How do I install a single overlay? I’m writing and building a device tree overlay for a RTC chip (a DS1307) on a cape board that we designed. I want to communicate with the chip over the I2C bus no. 2 on a beaglebone black.
I know how to build the overlay using dtc, and I know I must copy the .dtbo file to /lib/firmware. My question is, do I have to run update-initramfs as well, or is it good enough to copy the .dtbo file to /lib/firmware?
Anything else I need to do to install a single .dtbo?
Or I could install all the overlays with sudo apt update; sudo apt install bb-cape-overlays. Is it safe to install all the currently available overlays from Robert Nelson’s site on my system? I have an older version of Ubuntu (16.04.3 LTS from Robert Nelson).
How do I install a single overlay? I'm writing and building a device tree overlay for a RTC chip (a DS1307) on a cape board that we designed. I want to communicate with the chip over the I2C bus no. 2 on a beaglebone black.
I know how to build the overlay using dtc, and I know I must copy the .dtbo file to /lib/firmware. My question is, do I have to run update-initramfs as well, or is it good enough to copy the .dtbo file to /lib/firmware?
Anything else I need to do to install a single .dtbo?
debian@test-bbb-1:/opt/source/bb.org-overlays$ make
src/arm/BB-I2C2-RTC-DS1338.dtbo
DTC src/arm/BB-I2C2-RTC-DS1338.dtbo
It should as long as you update these to ds1338 references to DS1307:
Or I could install all the overlays with sudo apt update; sudo apt install bb-cape-overlays. Is it safe to install all the currently available overlays from Robert Nelson's site on my system? I have an older version of Ubuntu (16.04.3 LTS from Robert Nelson).
So this really depends the version of u-boot and kernel that you
currently utilize.
Git Master of bb.org-overlays
Is currently targeting U-Boot Overlays with:
U-Boot v2018.03+
Kernel: v4.4.x -> v4.19.x
So, update-initramfs is no longer required, that was needed for
"Kernel Overlays", as the kernel needed access to the *.dtbo early in
bootup, but we've given up on supporting that. Kernel Overlays are
also no longer even available in anything later then our v4.15.x
kernel branches.
When Debian Buster get's released next spring, bb.org-overlays will
get a new tag, and v4.4.x/v4.9.x support will be no longer guaranteed.
(There's a few "hacks" in there to help support v4.4.x kernel that are
getting in the way of new drivers in mainline)
I added the following lines to /boot/uEnv.txt:
uboot_overlay_addr0=/lib/firmware/BB-UART2-00A0.dtbo
uboot_overlay_addr1=/lib/firmware/BB-I2C2-RTC-DS1307.dtbo
I rebooted.
After rebooting, dmesg shows this:
bone_capemgr bone_capemgr: Baseboard: ‘A335BNLT,000C,1633BBBG0596’
bone_capemgr bone_capemgr: compatible-baseboard=ti,beaglebone-black - #slots=4
bone_capemgr bone_capemgr: slot #0: No cape found
bone_capemgr bone_capemgr: slot #1: No cape found
bone_capemgr bone_capemgr: slot #2: No cape found
bone_capemgr bone_capemgr: slot #3: No cape found
bone_capemgr bone_capemgr: initialized OK.
I expected to see BB-UART2-00A0.dtbo in slot #1 and BB-I2C2-RTC-DS1307.dtbo in slot #2.
The overlays are not loaded. What am I doing wrong?
I also expect that loading the overlay BB-I2C2-RTC-DS1307.dtbo will create /dev/rtc1, and also load the module rtc-ds1286.ko. Am I correct in thinking this?
- I fetched GitHub - beagleboard/bb.org-overlays: Device Tree Overlays for bb.org boards
- copied the file BB-I2C2-RTC-DS1338.dts to BB-I2C2-RTC-DS1307.dts
- edited BB-I2C2-RTC-DS1307.dts to refer to my DS1307 chip instead of DS1338
- make src/arm/BB-I2C2-RTC-DS1307.dtbo
- sudo cp ./src/arm/BB-I2C2-RTC-DS1307.dtbo /lib/firmware/
I added the following lines to /boot/uEnv.txt:
uboot_overlay_addr0=/lib/firmware/BB-UART2-00A0.dtbo
uboot_overlay_addr1=/lib/firmware/BB-I2C2-RTC-DS1307.dtbo
I rebooted.
After rebooting, dmesg shows this:
bone_capemgr bone_capemgr: Baseboard: 'A335BNLT,000C,1633BBBG0596'
bone_capemgr bone_capemgr: compatible-baseboard=ti,beaglebone-black - #slots=4
bone_capemgr bone_capemgr: slot #0: No cape found
bone_capemgr bone_capemgr: slot #1: No cape found
bone_capemgr bone_capemgr: slot #2: No cape found
bone_capemgr bone_capemgr: slot #3: No cape found
bone_capemgr bone_capemgr: initialized OK.
I expected to see BB-UART2-00A0.dtbo in slot #1 and BB-I2C2-RTC-DS1307.dtbo in slot #2.
The overlays are not loaded. What am I doing wrong?
Run this script:
sudo /opt/scripts/tools/version.sh
It'll give us more information for debugging..
I also expect that loading the overlay BB-I2C2-RTC-DS1307.dtbo will create /dev/rtc1, and also load the module rtc-ds1286.ko. Am I correct in thinking this?
Actually we have an alias swap going on... The am335x's un-useful rtc
becomes /dev/rtc1 and the DS1307 becomes /dev/rtc0, thus all the
standard clock programs just work with the external rtc..
And the ds1307 module is usually built in, so you won't see the module
thru lsmod...
Actually we have an alias swap going on… The am335x’s un-useful rtc
becomes /dev/rtc1 and the DS1307 becomes /dev/rtc0, thus all the
standard clock programs just work with the external rtc…
I’m glad the DS1307 becomes /etc/rtc0. That makes things easier.
And the ds1307 module is usually built in, so you won’t see the module
thru lsmod…
This is good to know. I was looking at the output of lsmod and wondering why I didn’t see module rtc-ds1307.ko.
I know that the slots file (/sys/devices/platform/bone_capemgr/slots) is now disabled in my kernal (4.14.62-ti-r69).
But I think the bone_capemgr is still enabled.
dmesg shows this:
bone_capemgr bone_capemgr: Baseboard: ‘A335BNLT,000C,1633BBBG0596’
bone_capemgr bone_capemgr: compatible-baseboard=ti,beaglebone-black - #slots=4
bone_capemgr bone_capemgr: slot #0: No cape found
bone_capemgr bone_capemgr: slot #1: No cape found
bone_capemgr bone_capemgr: slot #2: No cape found
bone_capemgr bone_capemgr: slot #3: No cape found
bone_capemgr bone_capemgr: initialized OK.
Should I see BB-UART2-00A0.dtbo in slot #0 and BB-I2C2-RTC-DS1307.dtbo in slot #1?
Or is there another way to tell if the overlays have been loaded?