Problems loading DTO with bone_capemgr at boot

Ask questions about Arch Linux ARM. Please search before making a new topic.

Problems loading DTO with bone_capemgr at boot

Postby axxxxe » Wed Mar 30, 2016 6:23 pm

I'm having trouble loading device tree overlays at boot with bone_capemgr on a Beaglebone Black.

$this->bbcode_second_pass_code('', '# uname -a
Linux spa.turrim 4.4.4-1-ARCH #1 Sat Mar 5 18:30:09 MST 2016 armv7l GNU/Linux
#')

I have DS3231.dts:

$this->bbcode_second_pass_code('', '/dts-v1/;
/plugin/;

/{

compatible = "ti,beaglebone", "ti,beaglebone-black";
part-number = "BBB-DS3231";
version = "00A0";

fragment@0 {
target = <&i2c2>;

__overlay__ {
pinctrl-0 = <&i2c2_pins>;

clock-frequency = <100000>;
status = "okay";

rtc: rtc@68 {
compatible = "dallas,ds1307";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x68>;
};
};
};
};
')

I have compiled it and put the .dtbo in /lib/firmware:

$this->bbcode_second_pass_code('', '# ls -l /lib/firmware/DS3231-00A0.dtbo
-rw-r--r-- 1 root root 699 Feb 22 21:35 /lib/firmware/DS3231-00A0.dtbo
# ')

Interactively it works, via bone_capemgr:

$this->bbcode_second_pass_code('', '# echo DS3231 > /sys/devices/platform/bone_capemgr/slots')

produces:

$this->bbcode_second_pass_code('', '[ 4082.171481] bone_capemgr bone_capemgr: part_number 'DS3231', version 'N/A'
[ 4082.178999] bone_capemgr bone_capemgr: slot #4: override
[ 4082.184502] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[ 4082.191512] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,DS3231'
[ 4082.216295] rtc-ds1307 2-0068: rtc core: registered ds1307 as rtc1
[ 4082.222530] rtc-ds1307 2-0068: 56 bytes nvram
[ 4082.237260] bone_capemgr bone_capemgr: slot #4: dtbo 'DS3231-00A0.dtbo' loaded; overlay id #0')

and

$this->bbcode_second_pass_code('', '# cat /sys/devices/platform/bone_capemgr/slots
0: PF---- -1
1: PF---- -1
2: PF---- -1
3: PF---- -1
4: P-O-L- 0 Override Board Name,00A0,Override Manuf,DS3231
# ')

So I ask to have it enabled at boot:

$this->bbcode_second_pass_code('', '# cat /boot/uEnv.txt
optargs=coherent_pool=1M bone_capemgr.enable_partno=BBB-DS3231
# ')

and I get this:

$this->bbcode_second_pass_code('', '# dmesg | grep bone
[ 0.000000] Kernel command line: console=ttyO0,115200n8 coherent_pool=1M bone_capemgr.enable_partno=BBB-DS3231 root=PARTUUID=0e4f7ccd-01 rw rootwait fixrtc
[ 4.950284] bone_capemgr bone_capemgr: Baseboard: 'A335BNLT,00C0,3214BBBK9247'
[ 4.957585] bone_capemgr bone_capemgr: compatible-baseboard=ti,beaglebone-black - #slots=4
[ 5.023585] bone_capemgr bone_capemgr: slot #0: No cape found
[ 5.083600] bone_capemgr bone_capemgr: slot #1: No cape found
[ 5.143596] bone_capemgr bone_capemgr: slot #2: No cape found
[ 5.203580] bone_capemgr bone_capemgr: slot #3: No cape found
[ 5.209370] bone_capemgr bone_capemgr: enabled_partno PARTNO 'BBB-DS3231' VER 'N/A' PR '0'
[ 5.217685] bone_capemgr bone_capemgr: slot #4: override
[ 5.223023] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[ 5.230034] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BBB-DS3231'
[ 5.239545] bone_capemgr bone_capemgr: initialized OK.
[ 6.259420] bone_capemgr bone_capemgr: loader: failed to load slot-4 BBB-DS3231:00A0 (prio 0)
#')

The fact that 00A0 appears in dmesg leads me to believe the overlay file is being read (vs. not available yet during boot).

A workaround I discovered was to decompile /boot/dtbs/am335x-boneblack.dtb with

$this->bbcode_second_pass_code('', 'dtc -I dtb -O dts am335x-boneblack.dtb > am335x-boneblack.dts')

then insert the content of my overlay into am335x-boneblack.dts and recompile with

$this->bbcode_second_pass_code('', 'dtc -O dtb -o am335x-boneblack.dtb -b o am335x-boneblack.dts')

That gives me what I want after a reboot, but the question remains what procedure I should be using to include devices at boot.

Should bone_capemgr be working based on what I'm doing above? Is there something wrong maybe with the u-boot.img config that is causing this? I don't really understand the function of everything in /boot, if someone wants to enlighten me ;-)
axxxxe
 
Posts: 1
Joined: Wed Mar 30, 2016 5:33 pm

Return to User Questions

Who is online

Users browsing this forum: No registered users and 30 guests