Device Tree Overlay

Dear all,

May I ask for your advice regarding a device tree overlay problem occuring at boot time (Ubuntu on BBB). My MAX-GPIO-set-00A0.dtbo file works just nice when I use it manually by typing the command

echo MAX-GPIO-set > slots

(in /sys/devices/bone_capemgr.*). I conclude from this that the dtbo file itself is correct.

Now, when I modify uEnv.txt to load the dtbo file at boot:

optargs=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN capemgr.enable_partno=BB-UART5,MAX-GPIO-set

the MAX-GPIO-set file is not applied (however, the BB_UART5 file is applied correctly). dmesg | grep “MAX” gives the following output:

[ 0.000000] Kernel command line: console=ttyO0,115200n8 capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN capemgr.enable_partno=BB-UART5,MAX-GPIO-set root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait fixrtc ip=
[ 1.958351] bone-capemgr bone_capemgr.8: enabled_partno part_number ‘MAX-GPIO-set’, version ‘N/A’, prio ‘0’
[ 1.983096] bone-capemgr bone_capemgr.8: slot #8: ‘Override Board Name,00A0,Override Manuf,MAX-GPIO-set’
[ 2.052857] bone-capemgr bone_capemgr.8: loader: before slot-8 MAX-GPIO-set:00A0 (prio 0)
[ 2.061427] bone-capemgr bone_capemgr.8: loader: check slot-8 MAX-GPIO-set:00A0 (prio 0)
[ 2.107066] bone-capemgr bone_capemgr.8: loader: after slot-8 MAX-GPIO-set:00A0 (prio 0)
[ 2.175944] bone-capemgr bone_capemgr.8: slot #8: Requesting part number/version based 'MAX-GPIO-set-00A0.dtbo
[ 2.197751] bone-capemgr bone_capemgr.8: slot #8: Requesting firmware ‘MAX-GPIO-set-00A0.dtbo’ for board-name ‘Override Board Name’, version ‘00A0’
[ 3.396200] bone-capemgr bone_capemgr.8: failed to load firmware ‘MAX-GPIO-set-00A0.dtbo’
[ 3.404896] bone-capemgr bone_capemgr.8: loader: failed to load slot-8 MAX-GPIO-set:00A0 (prio 0)

Any ideas would be highly appreciated. Thanks in advance!

Max

Dear all,

May I ask for your advice regarding a device tree overlay problem occuring
at boot time (Ubuntu on BBB). My MAX-GPIO-set-00A0.dtbo file works just nice
when I use it manually by typing the command

echo MAX-GPIO-set > slots

(in /sys/devices/bone_capemgr.*). I conclude from this that the dtbo file
itself is correct.

Now, when I modify uEnv.txt to load the dtbo file at boot:

optargs=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
capemgr.enable_partno=BB-UART5,MAX-GPIO-set

the MAX-GPIO-set file is not applied (however, the BB_UART5 file is applied
correctly). dmesg | grep "MAX" gives the following output:

[ 0.000000] Kernel command line: console=ttyO0,115200n8
capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
capemgr.enable_partno=BB-UART5,MAX-GPIO-set root=/dev/mmcblk0p2 ro
rootfstype=ext4 rootwait fixrtc ip=
[ 1.958351] bone-capemgr bone_capemgr.8: enabled_partno part_number
'MAX-GPIO-set', version 'N/A', prio '0'
[ 1.983096] bone-capemgr bone_capemgr.8: slot #8: 'Override Board
Name,00A0,Override Manuf,MAX-GPIO-set'
[ 2.052857] bone-capemgr bone_capemgr.8: loader: before slot-8
MAX-GPIO-set:00A0 (prio 0)
[ 2.061427] bone-capemgr bone_capemgr.8: loader: check slot-8
MAX-GPIO-set:00A0 (prio 0)
[ 2.107066] bone-capemgr bone_capemgr.8: loader: after slot-8
MAX-GPIO-set:00A0 (prio 0)
[ 2.175944] bone-capemgr bone_capemgr.8: slot #8: Requesting part
number/version based 'MAX-GPIO-set-00A0.dtbo
[ 2.197751] bone-capemgr bone_capemgr.8: slot #8: Requesting firmware
'MAX-GPIO-set-00A0.dtbo' for board-name 'Override Board Name', version
'00A0'
[ 3.396200] bone-capemgr bone_capemgr.8: failed to load firmware
'MAX-GPIO-set-00A0.dtbo'
[ 3.404896] bone-capemgr bone_capemgr.8: loader: failed to load slot-8
MAX-GPIO-set:00A0 (prio 0)

Any ideas would be highly appreciated. Thanks in advance!

I've recently run into the same issue for the BEAGLEBOY .dts:
https://github.com/bear24rw/gamingcape/blob/master/software/BEAGLEBOY-00A0.dts

The load triggering code is at:
https://github.com/beagleboard/linux/blob/3.8/drivers/misc/cape/beaglebone/capemgr.c
There is a call to request_firmware() at:
https://github.com/beagleboard/linux/blob/3.8/drivers/misc/cape/beaglebone/capemgr.c#L1370
This seems to be a generic internal kernel interface:
https://github.com/beagleboard/linux/blob/0250b2002e6eb3a2f7a4eef526dd107bfda3f590/Documentation/firmware_class/README

It is going to take me more than a few seconds to figure out how the
devicetree overlay mechanism is providing a firmware-loading driver. I
expect there to be something accepting the fw_entry info in the DT
overlay code, but I'm not seeing it in:
https://github.com/beagleboard/linux/tree/3.8/drivers/of

Any experts want to send me in the right direction or do I need to
break out the debug tools?

Same problem here with the UART driver. I’m having difficulties with the new enable_partno the cape manager fails to load my dtbo even through the “echo slots” works just fine. I have:
$ cat /boot/uboot/uEnv.txt
optargs=fixrtc capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN capemgr.enable_partno=BB-UART4-RTS
uenvcmd=i2c mw 0x24 1 0x3e
loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtbs/${fdtfile}

and at boot time the cape manager says:

dmesg | grep capemgr

[ 0.000000] Kernel command line: console=ttyO0,115200n8 fixrtc capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN capemgr.enable_partno=BB-UART4-RTS root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
[ 1.343502] bone-capemgr bone_capemgr.9: Baseboard: ‘A335BNLT,0A5C,3513BBBK3163’
[ 1.351312] bone-capemgr bone_capemgr.9: compatible-baseboard=ti,beaglebone-black
[ 1.359241] bone-capemgr bone_capemgr.9: Skipping disabled cape with part# BB-BONELT-HDMI
[ 1.367894] bone-capemgr bone_capemgr.9: Skipping disabled cape with part# BB-BONELT-HDMIN
[ 1.406433] bone-capemgr bone_capemgr.9: slot #0: No cape found
[ 1.443539] bone-capemgr bone_capemgr.9: slot #1: No cape found
[ 1.480647] bone-capemgr bone_capemgr.9: slot #2: No cape found
[ 1.517756] bone-capemgr bone_capemgr.9: slot #3: No cape found
[ 1.524025] bone-capemgr bone_capemgr.9: slot #4: specific override
[ 1.530635] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 4
[ 1.538680] bone-capemgr bone_capemgr.9: slot #4: ‘Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G’
[ 1.548837] bone-capemgr bone_capemgr.9: slot #5: specific override
[ 1.555443] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 5
[ 1.563486] bone-capemgr bone_capemgr.9: slot #5: ‘Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI’
[ 1.573537] bone-capemgr bone_capemgr.9: slot #6: specific override
[ 1.580143] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 6
[ 1.588187] bone-capemgr bone_capemgr.9: slot #6: ‘Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN’
[ 1.598439] bone-capemgr bone_capemgr.9: enabled_partno part_number ‘BB-UART4-RTS’, version ‘N/A’, prio ‘0’
[ 1.608666] bone-capemgr bone_capemgr.9: slot #7: generic override
[ 1.615165] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 7
[ 1.623207] bone-capemgr bone_capemgr.9: slot #7: ‘Override Board Name,00A0,Override Manuf,BB-UART4-RTS’
[ 1.633413] bone-capemgr bone_capemgr.9: Skipping loading of disabled cape with part# BB-BONELT-HDMI
[ 1.643011] bone-capemgr bone_capemgr.9: Skipping loading of disabled cape with part# BB-BONELT-HDMIN
[ 1.652965] bone-capemgr bone_capemgr.9: loader: before slot-4 BB-BONE-EMMC-2G:00A0 (prio 1)
[ 1.661849] bone-capemgr bone_capemgr.9: loader: check slot-4 BB-BONE-EMMC-2G:00A0 (prio 1)
[ 1.670659] bone-capemgr bone_capemgr.9: initialized OK.
[ 1.676269] bone-capemgr bone_capemgr.9: loader: before slot-7 BB-UART4-RTS:00A0 (prio 0)
[ 1.684855] bone-capemgr bone_capemgr.9: loader: check slot-7 BB-UART4-RTS:00A0 (prio 0)
[ 1.707112] bone-capemgr bone_capemgr.9: loader: check slot-4 BB-BONE-EMMC-2G:00A0 (prio 1)
[ 1.722288] bone-capemgr bone_capemgr.9: loader: after slot-7 BB-UART4-RTS:00A0 (prio 0)
[ 1.736908] bone-capemgr bone_capemgr.9: slot #7: Requesting part number/version based 'BB-UART4-RTS-00A0.dtbo
[ 1.767844] bone-capemgr bone_capemgr.9: slot #7: Requesting firmware ‘BB-UART4-RTS-00A0.dtbo’ for board-name ‘Override Board Name’, version ‘00A0’
[ 62.000364] bone-capemgr bone_capemgr.9: failed to load firmware ‘BB-UART4-RTS-00A0.dtbo’
[ 62.008988] bone-capemgr bone_capemgr.9: loader: failed to load slot-7 BB-UART4-RTS:00A0 (prio 0)
[ 62.018399] bone-capemgr bone_capemgr.9: loader: check slot-4 BB-BONE-EMMC-2G:00A0 (prio 1)
[ 62.027331] bone-capemgr bone_capemgr.9: loader: after slot-4 BB-BONE-EMMC-2G:00A0 (prio 1)
[ 62.036148] bone-capemgr bone_capemgr.9: slot #4: Requesting firmware ‘cape-bone-2g-emmc1.dtbo’ for board-name ‘Bone-LT-eMMC-2G’, version ‘00A0’
[ 62.049743] bone-capemgr bone_capemgr.9: slot #4: dtbo ‘cape-bone-2g-emmc1.dtbo’ loaded; converting to live tree
[ 62.060764] bone-capemgr bone_capemgr.9: slot #4: #2 overlays
[ 62.143004] bone-capemgr bone_capemgr.9: slot #4: Applied #2 overlays.
[ 62.149936] bone-capemgr bone_capemgr.9: loader: done slot-4 BB-BONE-EMMC-2G:00A0 (prio 1)

If I then manually load the overlay it works fine:

echo BB-UART4-RTS >/sys/devices/bone_capemgr.9/slots

dmesg | tail

[ 264.848073] bone-capemgr bone_capemgr.9: part_number ‘BB-UART4-RTS’, version ‘N/A’
[ 264.848260] bone-capemgr bone_capemgr.9: slot #8: generic override
[ 264.848310] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 8
[ 264.848360] bone-capemgr bone_capemgr.9: slot #8: ‘Override Board Name,00A0,Override Manuf,BB-UART4-RTS’
[ 264.848632] bone-capemgr bone_capemgr.9: slot #8: Requesting part number/version based 'BB-UART4-RTS-00A0.dtbo
[ 264.848684] bone-capemgr bone_capemgr.9: slot #8: Requesting firmware ‘BB-UART4-RTS-00A0.dtbo’ for board-name ‘Override Board Name’, version ‘00A0’
[ 264.859878] bone-capemgr bone_capemgr.9: slot #8: dtbo ‘BB-UART4-RTS-00A0.dtbo’ loaded; converting to live tree
[ 264.860523] bone-capemgr bone_capemgr.9: slot #8: #2 overlays
[ 264.875574] 481a8000.serial: ttyO4 at MMIO 0x481a8000 (irq = 61) is a OMAP UART4
[ 264.878196] bone-capemgr bone_capemgr.9: slot #8: Applied #2 overlays.

What am I doing wrong?