Welcome! Log In Create A New Profile

Advanced

Booting Kirkwood SoC NAS with stock u-boot

Posted by bodhi 
Booting Kirkwood SoC NAS with stock u-boot
July 06, 2025 04:52PM
Boot Kirkwood rootfs with stock u-boot

Check this u-boot release thread to see if there is new u-boot support for your box. If not then this is the instruction for how to boot Debian.


There are 3 methods. Pick one that your stock u-boot supports. Method 1 is the preferred procedure.

1. Booting with stock u-boot that supports usb, ext2load, and run commands
2. Booting with stock u-boot that does not supports usb, ext2load, and run commands
3. Booting with stock u-boot that supports sata (ide command), ext2load, and run commands


1. Booting with stock u-boot that supports usb, ext2load, and run commands

Assuming you have created a USB rootfs following the instruction in the release thread.

Power up, interrupt u-boot count down, and then.

setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial'
setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
setenv usb_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
setenv bootcmd 'usb reset; run usb_bootcmd; usb stop; reset'
And then,
printenv
boot

Since setenvs are transient, after test boot a few times with the above setenvs, you can proceed to make the envs permanent before boot
saveenv
boot



2. Booting with stock u-boot that does not supports usb, ext2load, and run commands

In case stock u-boot is way too limited, i.e. without the ability to use a USB drive (and also some u-boot does not even have the run or boot command), we'll use tftpboot to load the kernel files from tftp server. And then set up the envs to boot to USB rootfs.

- Assuming you have created a USB rootfs following the instruction in the release thread.
- Assuming you have set up a tftp server on another Linux box. And the tftp root on that box is at /tftproot folder.

2.a Preparing the kernel files

- Copy the uImage and uInitrd from the USB rootfs to the /tftproot folder on the Linux box that's running the tftp server.

- Assuming the tftp server box's IP address is 192.168.0.200, and the IP address you've chosen for this box is 192.168.0.100 (and therefore your router IP address is 192.168.0.1). Below, adjust the ipaddr and serverip to conform to the real IP addresses in your network environment.

2.b Boot the box

Power up, interrupt u-boot count down, and then,

setenv ipaddr 192.168.0.100
setenv serverip 192.168.0.200
setenv bootargs 'console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial'
mw 0x800000 0 1
tftpboot 0x800000 uImage
tftpboot 0x2100000 uInitrd
and then
printenv
bootm 0x800000 0x2100000


3. Booting with stock u-boot that supports sata (ide command), ext2load, and run commands

Assuming you have created a HDD rootfs following the instruction in the release thread.

Power up, interrupt u-boot count down, and then.

setenv ide_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial'
setenv load_uimage 'ext2load ide 0:1 0x800000 /boot/uImage'
setenv load_uinitrd 'ext2load ide 0:1 0x2100000 /boot/uInitrd'
setenv ide_boot 'mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000'
setenv ide_bootcmd 'run ide_set_bootargs; run ide_boot'
setenv bootcmd 'ide reset; run ide_bootcmd; reset'
And then,
printenv
boot

Since setenvs are transient, after test boot a few times with the above setenvs, you can proceed to make the envs permanent before boot
saveenv
boot


=================

Old instruction kept for posterity.

Quote
Old instruction

setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial'
setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
setenv load_uinitrd 'ext2load usb 0:1 0x2100000 /boot/uInitrd'
setenv usb_boot 'mw 0x800000 0 1; run load_uimage; if run load_uinitrd; then bootm 0x800000 0x2100000; else bootm 0x800000; fi'
setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
setenv bootcmd 'usb start; run usb_bootcmd; usb stop; reset'
And then,
printenv
boot

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 3 time(s). Last edit at 07/06/2025 10:47PM by bodhi.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: