Loading device tree overlays when using TFTP and NFS

I am using TFTP to load kernel and device tree overlay to a beaglebone black. I am using NFS to load rootfs. Everything seems to go well until I try to use uarts. It seems that the device tree overlays for them did not get loaded. How do you install device tree overlays when using TFTP and NFS? Do I need to merge all my device tree overlays and set dtb to that file? Below is my uEnv.txt file.

##Rename as: uEnv.txt to boot via nfs

##https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt

##SERVER: sudo apt-get install tftpd-hpa
##SERVER:
##SERVER: zImage boot:
##SERVER: TFTP_DIRECTORY defined in /etc/default/tftpd-hpa
##SERVER: zImage/*.dtb need to be located here:
##SERVER: TFTP_DIRECTORY/zImage
##SERVER: TFTP_DIRECTORY/dtbs/*.dtb
##SERVER:
##SERVER: uname_r boot:
##SERVER: TFTP_DIRECTORY defined in /etc/default/tftpd-hpa
##SERVER: Change TFTP_DIRECTORY to /NFSEXPORT/boot
##SERVER: TFTP_DIRECTORY/vmlinuz-${uname_r}
##SERVER: TFTP_DIRECTORY/dtbs/${uname_r}/*.dtb

##client_ip needs to be set for u-boot to try booting via nfs

client_ip=192.168.1.151

#u-boot defaults: uncomment and override where needed

server_ip=192.168.1.102
gw_ip=192.168.1.1
netmask=255.255.255.0
hostname=beaglebone
device=eth0
autoconf=off

#root=/dev/nfs
root_dir=/var/lib/beaglebone/pntr/debian-dev
nfs_options=,vers=3
nfsrootfstype=ext4 rootwait fixrtc
nfsroot=${server_ip}:${root_dir}${nfs_options}

##use uname_r= only if TFTP SERVER is setup for uname_r boot:
uname_r=4.19.37-bone32
#uuid=
#dtb=

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1
###
###Overide capes with eeprom
#uboot_overlay_addr0=/lib/firmware/<file0>.dtbo
#uboot_overlay_addr1=/lib/firmware/<file1>.dtbo
#uboot_overlay_addr2=/lib/firmware/BB-UART4-RTSCTS-00A0.dtbo
#uboot_overlay_addr3=/lib/firmware/BB-UART5-RTSCTS-00A0.dtbo
###
###Additional custom capes
uboot_overlay_addr4=/lib/firmware/BB-UART2-00A0.dtbo
uboot_overlay_addr5=/lib/firmware/BB-UART4-00A0.dtbo
uboot_overlay_addr6=/lib/firmware/BB-UART5-00A0.dtbo
#uboot_overlay_addr7=/lib/firmware/BBB-PRU-UART0-00A0.dtbo
###
###Custom Cape
#dtb_overlay=/lib/firmware/BBB-PRU-UART0-00A0.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
disable_uboot_overlay_video=1
disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1
###
###PRUSS OPTIONS
###pru_rproc (4.4.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo
###pru_rproc (4.14.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_rproc (4.19.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
###pru_uio (4.4.x-ti, 4.14.x-ti, 4.19.x-ti & mainline/bone kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-4-19-00A0.dtbo
###
###Cape Universal Enable
enable_uboot_cape_universal=1
###
###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###
###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###

cmdline=coherent_pool=1M net.ifnames=0 cape_universal=enable

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 quiet cape_universal=enable video=HDMI-A-1:1024x768@60e

#Use an overlayfs on top of a read-only root filesystem:
#cmdline=coherent_pool=1M net.ifnames=0 quiet cape_universal=enable overlayroot=tmpfs

##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

@pcknsonet, So sadly, i haven’t implemented overlays thru tftp/nfs, instead use the command line option fdtoverlay to build your final dtb…

3) fdtoverlay -- Flat Device Tree overlay applicator

The fdtoverlay applies an arbitrary number of FDT overlays to a base FDT blob
to a given output file.

The syntax of the fdtoverlay command line is:

    fdtoverlay -i <base-blob> -o <output-blob> <overlay-blob0> [<overlay-blob1> ...]

Where options are:
    -i, --input         Input base DT blob
    -o, --output        Output DT blob
    -v, --verbose       Verbose message output

Regards,

Thanks. This worked for me.
Since I can’t use U-Boot to pick the base DT blob. Is there a way to know the best base DT blob to use to have eMMC (no HDMI), PRU, and access to use config-pin on most pins. I am currently using am335x-boneblack-uboot.dtb but have no config-pin files in /sys/devices/platform/ocp/.
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-dirty]:[location: dd MBR]
kernel:[4.19.37-bone32]

am335x-boneblack-uboot-univ.dtb
BB-BONE-eMMC1-01-00A0.dtbo
AM335X-PRU-UIO-00A0.dtbo

*uboot-univ.dtb has all the config-pin’s enabled…

Then just add your usarts:

BB-UART2-00A0.dtbo
BB-UART4-00A0.dtbo
BB-UART5-00A0.dtbo

This should do it…

fdtoverlay -i am335x-boneblack-uboot-univ.dtb -o am335x-boneblack.dtbo BB-BONE-eMMC1-01-00A0.dtbo AM335X-PRU-UIO-00A0.dtbo BB-UART2-00A0.dtbo BB-UART4-00A0.dtbo BB-UART5-00A0.dtbo

Regards,

Using *uboot-univ.dtb I can now see config-pin files in /sys/devices/platform/ocp but I get the following error with command config-pin -q P8_07
P8_07 pinmux file not found!

Pin has no cape: P8_07

During booting my cmdline does not have bone_capemgr.uboot_capemgr_enabled=1. Should this be set? If so, how do I set it for TFTP booting. My uEnv.txt file has enable_uboot_overlays=1.

Let’s start with, what Px_yz files do show up under, /sys/devices/platform/ocp ?

None of those options listed above are valid for TFTP booting, as TFTP doesn’t currently support overlays…

“bone_capemgr.uboot_capemgr_enabled=1” is only needed for v4.14.x based and older kernel’s, to disable the kernel’s overlay manager… your v4.19.x based kernel doesn’t have that subsystem…

Regards,

Px_yz files that show up are for P8_ (07-19, 26-46) and for P9_ (12, 14-20, 23, 25, 27-31, 41, 42, 91, 92).

This problem goes away once I add ‘bone_capemgr.uboot_capemgr_enabled=1’ to line ‘cmdline=coherent_pool=1M net.iframes=0 cape_universal=enable’ in my uEnv.txt file.