Thursday, July 21, 2011

Booting from the external SD card on the Dreamplug

Adding multiboot support
Default my Dreamplug only booted from the internal micro-SD card and the external SD card could not be used as an OS drive.

From this post Multiboot Dreamplug I manged to get the Dreamplug to attempt to boot from the external SD card slot first and then the internal Micro SD.

To do this you need an jtag.

Connect to jtag to the Dreamplug and to an computer running linux with the minicom program. More on this in the Dreamplug User Guide.

Power on the DreamPlug. You will see the boot-up messages on the console, then stop the auto boot by pressing any key. At the terminal you should now see
Marvell>>

Where write the following command:
printenv

Make shure you see this output:
bootcmd=setenv ethact egiga0; ${x_bootcmd_ethernet}; setenv ethact egiga1; ${x_bootcmd_ethernet}; ${x_bootcmd_usb}; ${x_bootcmd_kernel}; setenv bootargs ${x_bootargs} ${x_bootargs_root}; bootm 0x6400000;
bootdelay=3
baudrate=115200
x_bootcmd_ethernet=ping 192.168.2.1
x_bootcmd_usb=usb start
x_bootcmd_kernel=fatload usb 0 0x6400000 uImage
x_bootargs=console=ttyS0,115200
x_bootargs_root=root=/dev/sda2 rootdelay=10
ethact=egiga0
ethaddr=F0:AD:4E:00:7C:xx
eth1addr=F0:AD:4E:00:7C:xx
stdin=serial
stdout=serial
stderr=serial

Environment size: 524/4092 bytes


Enter the following lines to enable multiboot:
setenv bootcmd_sdb 'setenv bootargs console=ttyS0,115200 root=/dev/sdb2 panic=10 rootwait; usb start; run boot_sdb;'

setenv boot_sdb 'fatload usb 1 0x6400000 uImage; bootm 0x6400000;'

setenv bootcmd_sda '${bootcmd_eth}; ${x_bootcmd_usb}; ${x_bootcmd_kernel}; setenv bootargs ${x_bootargs} ${x_bootargs_root}; bootm 0x6400000;'

setenv bootcmd_eth 'setenv ethact egiga0; ${x_bootcmd_ethernet}; setenv ethact egiga1; ${x_bootcmd_ethernet}'

setenv clear_kernel_in_mem 'echo Purging kernel in memory; mw 0x6400000 0x0 0x300000'

setenv bootcmd 'run clear_kernel_in_mem; run bootcmd_sdb; run bootcmd_sda'

finally save the changes:
saveenv


if you now do a new printenv you sould see:
bootdelay=3
baudrate=115200
x_bootcmd_ethernet=ping 192.168.2.1
x_bootcmd_usb=usb start
x_bootcmd_kernel=fatload usb 0 0x6400000 uImage
x_bootargs=console=ttyS0,115200
x_bootargs_root=root=/dev/sda2 rootdelay=10
ethact=egiga0
ethaddr=F0:AD:4E:00:7C:xx
eth1addr=F0:AD:4E:00:7C:xx
stdin=serial
stdout=serial
stderr=serial
bootcmd_sdb=setenv bootargs console=ttyS0,115200 root=/dev/sdb2 panic=10 rootwait; usb start; run boot_sdb;
boot_sdb=fatload usb 1 0x6400000 uImage; bootm 0x6400000;
bootcmd_sda=${bootcmd_eth}; ${x_bootcmd_usb}; ${x_bootcmd_kernel}; setenv bootargs ${x_bootargs} ${x_bootargs_root}; bootm 0x6400000;
bootcmd_eth=setenv ethact egiga0; ${x_bootcmd_ethernet}; setenv ethact egiga1; ${x_bootcmd_ethernet}
clear_kernel_in_mem=echo Purging kernel in memory; mw 0x6400000 0x0 0x300000
bootcmd=run clear_kernel_in_mem; run bootcmd_sdb; run bootcmd_sda

Environment size: 864/4092 bytes


Now the Dreamplug should first boot from the external SD card, if it can't boot from that card it will boot from the internal one.

If you want you can now open the Dreamplug again and remove the internal micro-SD card for safe keeping.

1 comment:

  1. Great article - many thanks for this - seems to be working so far, but my aim is to try and get Fedora on to the DreamPlug.
    First time for me to use JTAG and eventually got it working after entering:
    dmesg | grep tty
    ...to determine that I was using the ttyUSB0 port and just needed to select exit from the minicom setup screen rather than use the minicom –o marvell command.

    Thanks again for sharing this solution.

    ReplyDelete