Skip to contentSkip to conversation

RFC, am335x_evm.h patch for u-boot on SD and rest on eMMC on BBB

U-Boot Robert P. J. Day 1 participant 2 messages Sep 4, 2013 – Sep 5, 2013

lore
Share & tools
lore
#0 lore raw

soldiering on with my configuring and building u-boot for my BBB, i
have a proposal for include/configs/am335x_evm.h:

#define CONFIG_BOOTCOMMAND \
        "run findfdt; " \
        "run mmcboot;" \
        "setenv mmcdev 1; " \
        "setenv bootpart 1:2; " \
        "setenv mmcroot /dev/mmcblk1p2 ro; " \    <-- add this line
        "run mmcboot;" \
        "run nandboot;"

the rationale is for when there is a full, bootable OS in eMMC on the BBB, but someone wants to experiment with newer u-boot MLO and u-boot.img files.

as you can see, there is an early attempt to run mmcboot off of SD
card and, if that fails, the env vars are tweaked to now point to eMMC as plan B:

        "setenv mmcdev 1; " \
        "setenv bootpart 1:2; " \

but if "mmcroot" isn't similariy tweaked, the boot process will still try to mount the second partition on the SD card as the root filesystem, which makes little sense.

i realize you can use uEnv.txt to fix this, but it seems that the
*default* should be that, if you're switching to eMMC for the boot partition, it only makes to switch to the same device for the root filesystem.

thoughts?

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#1 lore raw

i'm still interested on thoughts on this proposed patch:

Quoted 4 lines · Robert P. J. Day

soldiering on with my configuring and building u-boot for my BBB, i
have a proposal for include/configs/am335x_evm.h:

Quoted 8 lines
#define CONFIG_BOOTCOMMAND \
        "run findfdt; " \
        "run mmcboot;" \
        "setenv mmcdev 1; " \
        "setenv bootpart 1:2; " \
        "setenv mmcroot /dev/mmcblk1p2 ro; " \    <-- add this line
        "run mmcboot;" \
        "run nandboot;"

to recap, the idea is that if the first "run mmcboot" fails and both
"mmcdev" and "bootpart" are reassigned to refer to mmc device 1, it only makes sense to adjust "mmcroot" to refer to the same device from which to get the root filesystem. naturally, that can be done from within uEnv.txt, but it seems to make sense that that should be the default.

to be a bit more verbose, i'm setting up a classroom exercise where
students will have a fully installed and bootable BBB, but they'll get an exercise to download, configure and install u-boot (MLO and u-boot.img) on an SD card where that's *all* that will be on the SD card, so the BBB will run u-boot off of the SD card, but will automatically switch to eMMC for the kernel image and root filesystem when it tries to boot.

thoughts?

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================