Facing issue in loading UART for Beaglebone debian

I am facing issue in loading uart port for Beaglebone Debian.

Following are my configurations:

I have a beaglebone with Debian OS. I have an sd card with 4 Partitions.

Partition 1 ( mmcblk0p1 ) contains following bootloader configurations:-

  1. /boot/dtbs/4.14.71-ti-r80/am335x-bonegreen-wireless.dtb
  2. /boot/vmlinuz-4.14.71-ti-r80
  3. /boot/uEnv.txt
  4. /boot/initrd.img-4.14.71-ti-r80
  5. /lib/firmware/BB-UART4-00A0.dtbo
  6. /lib/firmware/BB-UART1-00A0.dtbo
  7. /lib/firmware/BB-I2C2-00A0.dtbo
  8. /lib/firmware/AM335X-PRU-UIO-00A0.dtbo
  9. /lib/firmware/BB-BBGW-WL1835-00A0.dtbo
  10. /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo
  11. /lib/firmware/BB-ADC-00A0.dtbo
  12. /uEnv.txt

Partition 2 ( mmcblk0p2 ) contains the Debian OS.

Partition 3 ( mmcblk0p3 ) contains another Debian OS.

Partition 4 ( mmcblk0p4 ) decides from Which partition to boot?

/uEnv.txt from mmcblk0p1 reads from mmcblk0p4 and decides from which partition to boot.

This is my /uEnv.txt:

rdaddr=0x88080000

initrd_high=0xffffffff
fdt_high=0xffffffff

loadxrd=echo debug: [/boot/initrd.img-${uname_r}] ... ; load mmc 0:1 ${rdaddr} /boot/initrd.img-${uname_r}; setenv rdsize ${filesize}
loaduEnvtxt=load mmc 0:1 ${loadaddr} /boot/uEnv.txt ; env import -t ${loadaddr} ${filesize};
check_dtb=if test -n ${dtb}; then setenv fdtfile ${dtb};fi;
check_uboot_overlays=if test -n ${enable_uboot_overlays}; then setenv enable_uboot_overlays ;fi;

loadall=run loaduEnvtxt; run check_dtb; run check_uboot_overlays; run loadxrd;

rootpart=0:2
flagpart=0:4
bootdir=/boot
bootfile=vmlinuz-4.14.71-ti-r80
console=ttyO0,115200n8
fdtaddr=0x88000000
fdtfile=am335x-bonegreen-wireless.dtb
loadaddr=0x82000000
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait

mmcargs=setenv bootargs console=${console} ${optargs} ${cape_disable} ${cape_enable} root=${mmcroot} rootfstype=${mmcrootfstype} ${cmdline}

loadfdt=echo debug: [/boot/dtbs/${uname_r}/${fdtfile}] ... ;load mmc 0:1 ${fdtaddr} /boot/dtbs/${uname_r}/${fdtfile}

loadimage=echo debug: [/boot/vmlinuz-${uname_r}] ... ; load mmc 0:1 ${loadaddr} /boot/vmlinuz-${uname_r}

boot_three=setenv rootpart 0:3; setenv mmcroot /dev/mmcblk0p3 ro

findroot=\
    if test -e mmc $flagpart three; then \
        if test -e mmc $flagpart three_ok; then \
            run boot_three; \
        elif test ! -e mmc $flagpart three_tried; then \
            fatwrite mmc $flagpart $loadaddr three_tried 4; \
            run boot_three; \
        fi; \
    elif test -e mmc $flagpart two; then \
        if test ! -e mmc $flagpart two_ok; then \
            if test -e mmc $flagpart two_tried; then \
                run boot_three; \
            else \
                fatwrite mmc $flagpart $loadaddr two_tried 4; \
            fi; \
        fi; \
    fi;
uenvcmd=\
    run loadall; \
    run findroot; \
    echo Using root partition ${rootpart}; \
    if run loadfdt; then \
        echo Loaded ${fdtfile}; \
        if run loadimage; then \
            run mmcargs; \
            bootz ${loadaddr} - ${fdtaddr}; \
        fi; \
    fi;

`

`

In /boot/uEnv.txt I have enabled following Configs:

`

uname_r=4.14.71-ti-r80
enable_uboot_overlays=1
uboot_overlay_addr0=/lib/firmware/BB-UART4-00A0.dtbo
uboot_overlay_addr1=/lib/firmware/BB-UART1-00A0.dtbo
uboot_overlay_addr2=/lib/firmware/BB-I2C2-00A0.dtbo
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
enable_uboot_cape_universal=1
cmdline=coherent_pool=1M net.ifnames=0 quiet

`

My Boot logs:

`

U-Boot SPL 2018.09-00002-g0b54a51eee (Sep 10 2018 - 19:41:39 -0500)
Trying to boot from MMC2
Loading Environment from EXT4...
** Unable to use mmc 0:1 for loading the env **

U-Boot 2018.09-00002-g0b54a51eee (Sep 10 2018 - 19:41:39 -0500), Build: jenkins-github_Bootloader-Builder-65

CPU  : AM335X-GP rev 2.1
I2C:   ready
DRAM:  512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4...
** Unable to use mmc 0:1 for loading the env **
Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
Model: SeeedStudio BeagleBone Green Wireless:
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net:   eth0: MII MODE
Could not get PHY for cpsw: addr 0
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
board_name=[A335BNLT] ...
board_rev=[GW1A] ...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
60067 bytes read in 6 ms (9.5 MiB/s)
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
2628 bytes read in 2 ms (1.3 MiB/s)
gpio: pin 55 (gpio 55) value is 1
Loaded environment from /uEnv.txt
Importing environment from mmc ...
Checking if uenvcmd is set ...
gpio: pin 56 (gpio 56) value is 1
Running uenvcmd ...
2113 bytes read in 3 ms (687.5 KiB/s)
debug: [/boot/initrd.img-4.14.71-ti-r80] ...
4799493 bytes read in 303 ms (15.1 MiB/s)
Using root partition 0:2
debug: [/boot/dtbs/4.14.71-ti-r80/am335x-bonegreen-wireless.dtb] ...
60067 bytes read in 8 ms (7.2 MiB/s)
Loaded am335x-bonegreen-wireless.dtb
debug: [/boot/vmlinuz-4.14.71-ti-r80] ...
10416640 bytes read in 652 ms (15.2 MiB/s)
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Using Device Tree in place at 88000000, end 88011aa2

Starting kernel ...

[    0.000749] timer_probe: no matching timers found
[    0.783193] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[    1.073624] omap_voltage_late_init: Voltage driver support not added
[    1.080550] PM: Cannot get wkup_m3_ipc handle

`

Question:

Now when I boot into the partition and check for the UART port I am unable to find them.

ls -l /dev/ttyO*
lrwxrwxrwx 1 root root 5 Nov  3  2016 /dev/ttyO0 -> ttyS0
lrwxrwxrwx 1 root root 5 Nov  3  2016 /dev/ttyO2 -> ttyS2

The output I am expecting is:

lrwxrwxrwx 1 root root 5 Nov  3  2016 /dev/ttyO0 -> ttyS0
lrwxrwxrwx 1 root root 5 Nov  3  2016 /dev/ttyO1 -> ttyS1
lrwxrwxrwx 1 root root 5 Nov  3  2016 /dev/ttyO2 -> ttyS2
lrwxrwxrwx 1 root root 5 Nov  3  2016 /dev/ttyO3 -> ttyS3
lrwxrwxrwx 1 root root 5 Nov  3  2016 /dev/ttyO4 -> ttyS4
lrwxrwxrwx 1 root root 5 Nov  3  2016 /dev/ttyO5 -> ttyS5

Loaded environment from /uEnv.txt
Importing environment from mmc ...
Checking if uenvcmd is set ...
gpio: pin 56 (gpio 56) value is 1
Running uenvcmd ...

You are using the "uenvcmd" path, it's up to "YOU" to load the overlays.

Regards,

Yes, I’m loading the Overlays. In my uEnv.txt I am running loadall which loads the /boot/uEnv.txt. What am I doing wrong here or what am I missing here?

Uh nope, your assumption is incorrect.

while loadall, loads the variables from /boot/uEnv.txt, the overlay path thru uboot is NOT enabled…

Why isn’t it enabled? Well I did not write it for that path, because old uboot + doing Overlays = uboot hard faults…

So to repeat…

You are using the “uenvcmd” path, it’s up to “YOU” to load the overlays in your uboot script.

Regards,

Okay, I see your point.

Just for verification purpose, you are talking about check_uboot_overlays from the script right?

Also, How can I enable the overlay path through uboot?

Thank you

so let's look at your script, and what u-boot did

uenvcmd=\
    run loadall; \
    run findroot; \
    echo Using root partition ${rootpart}; \
    if run loadfdt; then \
        echo Loaded ${fdtfile}; \
        if run loadimage; then \
            run mmcargs; \
            bootz ${loadaddr} - ${fdtaddr}; \
        fi; \
    fi;

loadadd:

loadall=run loaduEnvtxt; run check_dtb; run check_uboot_overlays; run loadxrd;

Okay, so we load /boot/uEnv.txt, select the defined dtb, check if
"enable_uboot_overlays" is enabled.. Finally we load the initrd..

loadxrd=echo debug: [/boot/initrd.img-${uname_r}] ... ; load mmc 0:1
${rdaddr} /boot/initrd.img-${uname_r}; setenv rdsize ${filesize}

findroot;

Set's root mmc..

loadfdt;

Loads the device tree:

loadfdt=echo debug: [/boot/dtbs/${uname_r}/${fdtfile}] ... ;load mmc
0:1 ${fdtaddr} /boot/dtbs/${uname_r}/${fdtfile}

loadimage

Loads the zImage..

loadimage=echo debug: [/boot/vmlinuz-${uname_r}] ... ; load mmc 0:1
${loadaddr} /boot/vmlinuz-${uname_r}

mmcargs, set's the mmcargs var..

mmcargs=setenv bootargs console=${console} ${optargs} ${cape_disable}
${cape_enable} root=${mmcroot} rootfstype=${mmcrootfstype} ${cmdline}

bootz ${loadaddr} - ${fdtaddr};

aka boot into linux..

Then we look at what u-boot did:

Still, I am unable to understand How can I enable the overlays and load the UART Port.

What I did was I add these lines in my /uEnv.txt under uenvcmd:

`

rdaddr=0x88080000

initrd_high=0xffffffff
fdt_high=0xffffffff

loadxrd=echo debug1: [/boot/initrd.img-${uname_r}] … ; load mmc 0:1 ${rdaddr} /boot/initrd.img-${uname_r}; setenv rdsize ${filesize}
loaduEnvtxt=echo debug1 loading uEnv.txt … ; load mmc 0:1 ${loadaddr} /boot/uEnv.txt ; env import -t ${loadaddr} ${filesize};
check_dtb=echo debug1 loading check_dtb … ; if test -n ${dtb}; then setenv fdtfile ${dtb};fi;
check_uboot_overlays=echo debug1 loading check_uboot_overlays … ; if test -n ${enable_uboot_overlays}; then setenv enable_uboot_overlays ;fi;

loadall=run loaduEnvtxt; run check_dtb; run check_uboot_overlays; run loadxrd;

rootpart=0:2
flagpart=0:4
bootdir=/boot
bootfile=vmlinuz-4.14.71-ti-r80
console=ttyO0,115200n8
fdtaddr=0x88000000
fdtfile=am335x-bonegreen-wireless.dtb
loadaddr=0x82000000
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait

mmcargs=setenv bootargs console=${console} ${optargs} ${cape_disable} ${cape_enable} root=${mmcroot} rootfstype=${mmcrootfstype} ${cmdline}

loadfdt=echo debug1: [/boot/dtbs/${uname_r}/${fdtfile}] … ;load mmc 0:1 ${fdtaddr} /boot/dtbs/${uname_r}/${fdtfile}

loadimage=echo debug1: [/boot/vmlinuz-${uname_r}] … ; load mmc 0:1 ${loadaddr} /boot/vmlinuz-${uname_r}

boot_three=setenv rootpart 0:3; setenv mmcroot /dev/mmcblk0p3 ro

findroot=
if test -e mmc $flagpart three; then
if test -e mmc $flagpart three_ok; then
run boot_three;
elif test ! -e mmc $flagpart three_tried; then
fatwrite mmc $flagpart $loadaddr three_tried 4;
run boot_three;
fi;
elif test -e mmc $flagpart two; then
if test ! -e mmc $flagpart two_ok; then
if test -e mmc $flagpart two_tried; then
run boot_three;
else
fatwrite mmc $flagpart $loadaddr two_tried 4;
fi;
fi;
fi;
uenvcmd=
run loadall;
run findroot;
echo Using root partition ${rootpart};
setenv fdt_buffer 0x60000;
load ${devtype} ${bootpart} ${rdaddr} ${uboot_overlay};
fdt addr ${fdtaddr};
fdt resize ${fdt_buffer};
fdt apply ${rdaddr};
fdt resize ${fdt_buffer};
echo Done with the edit;
if run loadfdt; then
echo Loaded ${fdtfile};
if run loadimage; then
run mmcargs;
bootz ${loadaddr} - ${fdtaddr};
fi;
fi;

`

It loaded the UART Port and tried to boot to the Partition 1 But this failed as partition 1 has no Os image

Boot logs:

`

U-Boot SPL 2018.09-00002-g0b54a51eee (Sep 10 2018 - 19:41:39 -0500)
Trying to boot from MMC2
Loading Environment from EXT4… Card did not respond to voltage select!

U-Boot 2018.09-00002-g0b54a51eee (Sep 10 2018 - 19:41:39 -0500), Build: jenkin
s-github_Bootloader-Builder-65

CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver ‘omap_hsmmc’
No match for driver ‘omap_hsmmc’
Some drivers were not found
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4… Card did not respond to voltage select!
Board: BeagleBone Black
not set. Validating first E-fuse MAC
BeagleBone Black:
Model: SeeedStudio BeagleBone Green Wireless:
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net: eth0: MII MODE
Could not get PHY for cpsw: addr 0
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
board_name=[A335BNLT] …
board_rev=[GW1A] …
SD/MMC found on device 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1…
60067 bytes read in 5 ms (11.5 MiB/s)
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt …
2261 bytes read in 2 ms (1.1 MiB/s)
gpio: pin 55 (gpio 55) value is 1
Loaded environment from /uEnv.txt
Importing environment from mmc …
Checking if uenvcmd is set …
gpio: pin 56 (gpio 56) value is 1
Running uenvcmd …
debug1 loading uEnv.txt …
2176 bytes read in 3 ms (708 KiB/s)
debug1 loading check_dtb …
debug1 loading check_uboot_overlays …
debug1: [/boot/initrd.img-4.14.71-ti-r80] …
4799493 bytes read in 302 ms (15.2 MiB/s)
Using root partition 0:2
10416640 bytes read in 652 ms (15.2 MiB/s)
Checking if client_ip is set …
Checking for: /boot.scr …
Checking for: /boot/boot.scr …
Checking for: /boot/uEnv.txt …
gpio: pin 55 (gpio 55) value is 1
2176 bytes read in 3 ms (708 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt…
gpio: pin 56 (gpio 56) value is 1
Running uname_boot …
loading /boot/vmlinuz-4.14.71-ti-r80 …
debug1: [/boot/vmlinuz-4.14.71-ti-r80] …
10416640 bytes read in 653 ms (15.2 MiB/s)
debug: [enable_uboot_overlays=1] …
debug: [enable_uboot_cape_universal=1] …
debug: [uboot_base_dtb_univ=am335x-bonegreen-wireless-uboot-univ.dtb] …
uboot_overlays: [uboot_base_dtb=am335x-bonegreen-wireless-uboot-univ.dtb] …
uboot_overlays: Switching too: dtb=am335x-bonegreen-wireless-uboot-univ.dtb …
debug1: [/boot/dtbs/4.14.71-ti-r80/am335x-bonegreen-wireless-uboot-univ.dtb] …
156290 bytes read in 14 ms (10.6 MiB/s)
uboot_overlays: [fdt_buffer=0x60000] …
uboot_overlays: loading /lib/firmware/BB-UART4-00A0.dtbo …
1075 bytes read in 3 ms (349.6 KiB/s)
uboot_overlays: loading /lib/firmware/BB-UART1-00A0.dtbo …
1075 bytes read in 2 ms (524.4 KiB/s)
uboot_overlays: loading /lib/firmware/BB-I2C2-00A0.dtbo …
1152 bytes read in 2 ms (562.5 KiB/s)
uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo …
1440 bytes read in 3 ms (468.8 KiB/s)
uboot_overlays: loading /lib/firmware/BB-BBGW-WL1835-00A0.dtbo …
4839 bytes read in 3 ms (1.5 MiB/s)
uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo …
711 bytes read in 3 ms (231.4 KiB/s)
uboot_overlays: loading /lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo …
2402 bytes read in 4 ms (585.9 KiB/s)
loading /boot/initrd.img-4.14.71-ti-r80 …
4799493 bytes read in 302 ms (15.2 MiB/s)
debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet] …
debug: [bootz 0x82000000 0x88080000:493c05 88000000] …

Flattened Device Tree blob at 88000000

Booting using the fdt blob at 0x88000000
reserving fdt memory region: addr=88000000 size=88000
Using Device Tree in place at 88000000, end 8808afff

Starting kernel …

[ 0.002060] timer_probe: no matching timers found
[ 1.135903] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[ 1.486326] omap_voltage_late_init: Voltage driver support not added
[ 1.493305] PM: Cannot get wkup_m3_ipc handle
mount: mounting /dev/mmcblk0p1 on /root failed: Invalid argument
mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /run on /root/run failed: No such file or directory
run-init: current directory on the same filesystem as the root: error 0
Target filesystem doesn’t have requested /sbin/init.
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
No init found. Try passing init= bootarg.

BusyBox v1.22.1 (Debian 1:1.22.0-19+b3) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.

`

What am I doing wrong here? How can I boot from partition2 or partition 3 while loading all the UART Port?

uenvcmd=\
run loadall; \
run findroot; \
echo Using root partition ${rootpart}; \
setenv fdt_buffer 0x60000; \
load ${devtype} ${bootpart} ${rdaddr} ${uboot_overlay}; \
fdt addr ${fdtaddr}; \
fdt resize ${fdt_buffer}; \
fdt apply ${rdaddr}; \
fdt resize ${fdt_buffer}; \
        echo Done with the edit; \
if run loadfdt; then \
echo Loaded ${fdtfile}; \

Wrong order, you placed my "reference example" before the you loaded
the main dtb. ( i also didn't expect you'd just copy it as is.. so
let's expand it more..)

    if run loadfdt; then \
        echo Loaded ${fdtfile}; \
        setenv fdt_buffer 0x60000; \
        load mmc 0:1 ${rdaddr} /lib/firmware/BB-UART4-00A0.dtbo; \
        fdt addr ${fdtaddr}; \
        fdt resize ${fdt_buffer}; \
        fdt apply ${rdaddr}; \
        fdt resize ${fdt_buffer}; \
        load mmc 0:1 ${rdaddr} /lib/firmware/BB-UART1-00A0.dtbo; \
        fdt addr ${fdtaddr}; \
        fdt resize ${fdt_buffer}; \
        fdt apply ${rdaddr}; \
        fdt resize ${fdt_buffer}; \
        <and so on>
        <and so on>
        if run loadimage; then \
            run mmcargs; \
            bootz ${loadaddr} - ${fdtaddr}; \
        fi; \
    fi;

Does that now make sense?

Regards,

When I add under *if run loadfdt; then * This is working properly

`
setenv fdt_buffer 0x60000;
fatload mmc 0:1 ${rdaddr} /lib/firmware/BB-UART4-00A0.dtbo; \
fdt addr ${fdtaddr};
fdt resize ${fdt_buffer};
fdt apply ${rdaddr};
fdt resize ${fdt_buffer}; \

fatload mmc 0:1 ${rdaddr} /lib/firmware/BB-UART1-00A0.dtbo; \

`

But When I add anything under *fatload mmc 0:1 ${rdaddr} /lib/firmware/BB-UART1-00A0.dtbo; *

Uboot starts booting in a different way.

uEnv.txt:

`

rdaddr=0x88080000

initrd_high=0xffffffff
fdt_high=0xffffffff

loadxrd=echo debug: [/boot/initrd.img-${uname_r}] … ; load mmc 0:1 ${rdaddr} /boot/initrd.img-${uname_r}; setenv rdsize ${filesize}
loaduEnvtxt=load mmc 0:1 ${loadaddr} /boot/uEnv.txt ; env import -t ${loadaddr} ${filesize};
check_dtb=if test -n ${dtb}; then setenv fdtfile ${dtb};fi;
check_uboot_overlays=if test -n ${enable_uboot_overlays}; then setenv enable_uboot_overlays ;fi;

loadall=run loaduEnvtxt; run check_dtb; run check_uboot_overlays; run loadxrd;

rootpart=0:2
flagpart=0:4
bootdir=/boot
bootfile=vmlinuz-4.14.71-ti-r80
console=ttyO0,115200n8
fdtaddr=0x88000000
fdtfile=am335x-bonegreen-wireless.dtb
loadaddr=0x82000000
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait

mmcargs=setenv bootargs console=${console} ${optargs} ${cape_disable} ${cape_enable} root=${mmcroot} rootfstype=${mmcrootfstype} ${cmdline}

loadfdt=echo debug: [/boot/dtbs/${uname_r}/${fdtfile}] … ;load mmc 0:1 ${fdtaddr} /boot/dtbs/${uname_r}/${fdtfile}

loadimage=echo debug: [/boot/vmlinuz-${uname_r}] … ; load mmc 0:1 ${loadaddr} /boot/vmlinuz-${uname_r}

boot_three=setenv rootpart 0:3; setenv mmcroot /dev/mmcblk0p3 ro

findroot=
if test -e mmc $flagpart three; then
if test -e mmc $flagpart three_ok; then
run boot_three;
elif test ! -e mmc $flagpart three_tried; then
fatwrite mmc $flagpart $loadaddr three_tried 4;
run boot_three;
fi;
elif test -e mmc $flagpart two; then
if test ! -e mmc $flagpart two_ok; then
if test -e mmc $flagpart two_tried; then
run boot_three;
else
fatwrite mmc $flagpart $loadaddr two_tried 4;
fi;
fi;
fi;
uenvcmd=
run loadall;
run findroot;
echo Using root partition ${rootpart};
if run loadfdt; then
echo Inside loadfdt;
setenv fdt_buffer 0x60000;
fatload mmc 0:1 ${rdaddr} /lib/firmware/BB-UART4-00A0.dtbo;
echo I have loaded BB-UART4-00A0.dtbo;
fdt addr ${fdtaddr};
fdt resize ${fdt_buffer};
fdt apply ${rdaddr};
fdt resize ${fdt_buffer};
fatload mmc 0:1 ${rdaddr} /lib/firmware/BB-UART1-00A0.dtbo;
echo I have loaded BB-UART1-00A0.dtbo;
if run loadimage; then
run mmcargs;
bootz ${loadaddr} - ${fdtaddr};
fi;
fi;

`

Boot logs:

`

U-Boot SPL 2018.09-00002-g0b54a51eee (Sep 10 2018 - 19:41:39 -0500)

Trying to boot from MMC2
Loading Environment from EXT4…
** Unable to use mmc 0:1 for loading the env **

U-Boot 2018.09-00002-g0b54a51eee (Sep 10 2018 - 19:41:39 -0500), Build: jenkin
s-github_Bootloader-Builder-65

CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver ‘omap_hsmmc’
No match for driver ‘omap_hsmmc’
Some drivers were not found
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4…
** Unable to use mmc 0:1 for loading the env **
Board: BeagleBone Black
not set. Validating first E-fuse MAC
BeagleBone Black:
Model: SeeedStudio BeagleBone Green Wireless:
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net: eth0: MII MODE
Could not get PHY for cpsw: addr 0
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
board_name=[A335BNLT] …
board_rev=[GW1A] …
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1…
60067 bytes read in 5 ms (11.5 MiB/s)
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt …
2257 bytes read in 2 ms (1.1 MiB/s)
gpio: pin 55 (gpio 55) value is 1
Loaded environment from /uEnv.txt
Importing environment from mmc …
Checking if uenvcmd is set …
test - minimal test like /bin/sh

Usage:
test [args…]
Checking if client_ip is set …
Checking for: /boot.scr …
Checking for: /boot/boot.scr …
Checking for: /boot/uEnv.txt …
gpio: pin 55 (gpio 55) value is 1
2176 bytes read in 3 ms (708 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt…
gpio: pin 56 (gpio 56) value is 1
Running uname_boot …
loading /boot/vmlinuz-4.14.71-ti-r80 …
debug: [/boot/vmlinuz-4.14.71-ti-r80] …
10416640 bytes read in 652 ms (15.2 MiB/s)
debug: [enable_uboot_overlays=1] …
debug: [enable_uboot_cape_universal=1] …
debug: [uboot_base_dtb_univ=am335x-bonegreen-wireless-uboot-univ.dtb] …
uboot_overlays: [uboot_base_dtb=am335x-bonegreen-wireless-uboot-univ.dtb] …
uboot_overlays: Switching too: dtb=am335x-bonegreen-wireless-uboot-univ.dtb …
debug: [/boot/dtbs/4.14.71-ti-r80/am335x-bonegreen-wireless-uboot-univ.dtb] …
156290 bytes read in 14 ms (10.6 MiB/s)
uboot_overlays: [fdt_buffer=0x60000] …
uboot_overlays: loading /lib/firmware/BB-UART4-00A0.dtbo …
1075 bytes read in 3 ms (349.6 KiB/s)
uboot_overlays: loading /lib/firmware/BB-UART1-00A0.dtbo …
1075 bytes read in 3 ms (349.6 KiB/s)
uboot_overlays: loading /lib/firmware/BB-I2C2-00A0.dtbo …
1152 bytes read in 3 ms (375 KiB/s)
uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo …
1440 bytes read in 3 ms (468.8 KiB/s)
uboot_overlays: loading /lib/firmware/BB-BBGW-WL1835-00A0.dtbo …
4839 bytes read in 3 ms (1.5 MiB/s)
uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo …
711 bytes read in 3 ms (231.4 KiB/s)
uboot_overlays: loading /lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo …
2402 bytes read in 3 ms (781.3 KiB/s)
loading /boot/initrd.img-4.14.71-ti-r80 …
4799493 bytes read in 303 ms (15.1 MiB/s)
debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet] …
debug: [bootz 0x82000000 0x88080000:493c05 88000000] …

Flattened Device Tree blob at 88000000

Booting using the fdt blob at 0x88000000
reserving fdt memory region: addr=88000000 size=88000
Using Device Tree in place at 88000000, end 8808afff

Starting kernel …

[ 0.002080] timer_probe: no matching timers found
[ 1.135823] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[ 1.486352] omap_voltage_late_init: Voltage driver support not added
[ 1.493340] PM: Cannot get wkup_m3_ipc handle
mount: mounting /dev/mmcblk0p1 on /root failed: Invalid argument
mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /run on /root/run failed: No such file or directory
run-init: current directory on the same filesystem as the root: error 0
Target filesystem doesn’t have requested /sbin/init.
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
run-init: current directory on the same filesystem as the root: error 0
No init found. Try passing init= bootarg.

BusyBox v1.22.1 (Debian 1:1.22.0-19+b3) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.

(initramfs)

`

It boots into 1st partition I am unable to understand this behaviour

Hello Robert

I am still facing the issue for loading the UART Port

Thanks