eewiki / u-boot-patches

44 stars 28 forks source link

BeagleBone bug in 2016.01 #4

Closed dlech closed 8 years ago

dlech commented 8 years ago

There seems to be a bug in u-boot 2016.01. When I run printenv, I see the following (formatted for readability):

...
bootcmd=
    run findfdt; 
    setenv fdtfile am335x-boneblack.dtb;
    setenv fdtbase am335x-boneblack; 
    run distro_bootcmd
...
findfdt=
    if test $board_name = A335BONE; then 
        setenv fdtfile am335x-bone.dtb; 
        setenv fdtbase am335x-bone; 
    fi; 
    if test $board_name = A335BNLT; then 
        if test $board_rev = BBG1; then 
            setenv fdtfile am335x-bonegreen.dtb; 
            setenv fdtbase am335x-bonegreen; 
        elif test $board_rev = AIA0; then 
            setenv fdtfile am335x-abbbi.dtb; 
            setenv fdtbase am335x-abbbi; 
        else 
            setenv fdtfile am335x-boneblack.dtb; 
            setenv fdtbase am335x-boneblack; 
        fi; 
    fi; 
    if test $board_name = A33515BB; then 
        setenv fdtfile am335x-evm.dtb; 
    fi; 
    if test $board_name = A335X_SK; then 
        setenv fdtfile am335x-evmsk.dtb; 
    fi; 
    if test $fdtfile = undefined; then 
        echo WARNING: Could not determine device tree to use; 
    fi;

These are they only places that findfdt are used, so it looks like when run bootcmd is called the values found in findfdt are immediately written over with am335x-boneblack. I only have a BeagleBone Black, so I can't confirm this for sure.

RobertCNelson commented 8 years ago

@dlech So this situation:

bootcmd=
    run findfdt; 
    setenv fdtfile am335x-boneblack.dtb;
    setenv fdtbase am335x-boneblack; 
    run distro_bootcmd

Is from this patch:

https://github.com/eewiki/u-boot-patches/blob/master/v2016.01/0002-NFM-Production-eeprom-assume-device-is-BeagleBone-Bl.patch

Which is "only" applied to the u-boot tree for a very special image for board oem's for initial board eeprom programming (aka when the board eeprom is blank).

"depending" on oem, flasher etc. It may end up as the final "u-boot" on eMMC, which is fine.. But my current generation of "blank" flashers (usbflasher) boots with this patch, but after eeprom programing flashes a normal u-boot

https://github.com/RobertCNelson/boot-scripts/blob/master/tools/eMMC/init-eMMC-flasher-from-usb-media.sh

https://rcn-ee.net/rootfs/bb.org/testing/2016-01-24/usbflasher/

Regards,

dlech commented 8 years ago

Thanks for the insight. Now that you mentioned it, I'm pretty sure I grabbed the bootloader from http://repos.rcn-ee.com/bootloader/am335x_boneblack/. Should I be using http://repos.rcn-ee.com/bootloader/am335x_evm/ if I want a bootloader that works on White/Black/Green?

RobertCNelson commented 8 years ago

Yeah, even that directory is a little risky, always grep this file:

https://rcn-ee.com/repos/bootloader/latest/bootloader-ng

STABLE = ABI2:am335x_evm:
#BeagleBone & BeagleBone Black
ABI2:am335x_evm:SPL https://rcn-ee.com/repos/bootloader/am335x_evm/MLO-am335x_evm-v2016.01-r5
ABI2:am335x_evm:BOOT https://rcn-ee.com/repos/bootloader/am335x_evm/u-boot-am335x_evm-v2016.01-r5.img

It's good for the White/Black/Green/

Regards,

dlech commented 8 years ago

Great, thanks!