Arch linux and issues loading device tree overlay at boot via uEnv.txt

686 views
Skip to first unread message

Axe

unread,
Mar 25, 2016, 5:42:35 PM3/25/16
to BeagleBoard

Like many, I'm having issues with loading device tree overlays at boot.

# 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:

/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:

# 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:

# echo DS3231 > /sys/devices/platform/bone_capemgr/slots

produces:

[ 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

# 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:

# cat /boot/uEnv.txt
optargs=coherent_pool=1M bone_capemgr.enable_partno=BBB-DS3231
#

and I get this in dmesg:

# 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)
#

Is this a case of /lib/firmware not being available yet?  I see people with Debian fiddling with initramfs in similar situations...?


David Good

unread,
Mar 25, 2016, 6:00:24 PM3/25/16
to beagl...@googlegroups.com
Or does it have something to do with the external RTC specifically?  I made a cape that had an RTC which loads correctly at boot time using kernel 3.8 something, so maybe it's a kernel problem.  Can you check if another cape loads automatically on boot correctly?

--David


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robert Nelson

unread,
Mar 25, 2016, 6:00:36 PM3/25/16
to Beagle Board

Correct, if you use an initramfs, you must copy the dtbo objects into it.

https://github.com/beagleboard/bb.org-overlays/blob/master/tools/dtbo

Regards,

Axe

unread,
Mar 30, 2016, 2:02:44 PM3/30/16
to BeagleBoard

RobertCNelson: I am not using initramfs

After some experimentation I found a sort-of solution.

I removed the call to bone_capemgr from uEnv.txt, then decompiled /boot/dtbs/am335x-boneblack.dtb with

dtc -I dtb -O dts am335x-boneblack.dtb > am335x-boneblack.dts

then inserted the content of my overlay into am335x-boneblack.dts and recompiled with

dtc -O dtb -o am335x-boneblack.dtb -b o am335x-boneblack.dts

Now I get the RTC as I like at boot.

The question remains what's up with bone_capemgr and /lib/firmware at boot.  I'll ask on the Arch Arm forum.

Robert Nelson

unread,
Mar 30, 2016, 2:06:52 PM3/30/16
to Beagle Board
On Wed, Mar 30, 2016 at 1:02 PM, Axe <axele...@gmail.com> wrote:
>
> RobertCNelson: I am not using initramfs
>
> After some experimentation I found a sort-of solution.
>
> I removed the call to bone_capemgr from uEnv.txt, then decompiled
> /boot/dtbs/am335x-boneblack.dtb with
>
> dtc -I dtb -O dts am335x-boneblack.dtb > am335x-boneblack.dts
>
> then inserted the content of my overlay into am335x-boneblack.dts and
> recompiled with
>
> dtc -O dtb -o am335x-boneblack.dtb -b o am335x-boneblack.dts
>
> Now I get the RTC as I like at boot.

For next time:

https://github.com/RobertCNelson/dtb-rebuilder


> The question remains what's up with bone_capemgr and /lib/firmware at boot.
> I'll ask on the Arch Arm forum.

btw, there was a weird bug in v4.1.x, if you didn't have "quiet" on
the /proc/cmdline, the overlay wouldn't load... could be another thing
to check..

Regards,

--
Robert Nelson
https://rcn-ee.com/
Reply all
Reply to author
Forward
0 new messages