Hi Folks,
I’m struggling to find recent (6.12 and later, trixie) advice on how to build a device tree overlay for pps_gpio usage.
I’m trying to use a GPS module on uart1 for the serial, and P9.12 for the PPS gpio. Based on rummaging through the latest trees I’ve mangled a dts together consisting of
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2013 CircuitCo
* Virtual cape for UART1 on connector pins P9.24 P9.26
* Bodged by AE to add PPS GPIO on P9.12
*/
/dts-v1/;
/plugin/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>
#include <dt-bindings/interrupt-controller/irq.h>
/*
* Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
*/
&{/chosen} {
overlays {
RFZERO-00A0.bb.org-overlays = __TIMESTAMP__;
};
};
/*
* Free up the pins used by the cape from the pinmux helpers.
*/
&ocp {
P9_12_pinmux { status = "disabled"; }; /* pps */
P9_24_pinmux { status = "disabled"; }; /* uart1_txd */
P9_26_pinmux { status = "disabled"; }; /* uart1_rxd */
};
&am33xx_pinmux {
bb_pps_gpio_pins: pinmux_pps_gpio_pins {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_GPMC_BEN1, PIN_INPUT_PULLDOWN, MUX_MODE7) /* P9_12 pps_gpio */
>;
};
bb_uart1_pins: pinmux_bb_uart1_pins {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_UART1_TXD, PIN_OUTPUT, MUX_MODE0) /* P9_24 uart1_txd.uart1_txd */
AM33XX_PADCONF(AM335X_PIN_UART1_RXD, PIN_INPUT, MUX_MODE0) /* P9_26 uart1_rxd.uart1_rxd */
>;
};
};
&uart1 {
/* sudo agetty 115200 ttyS1 */
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&bb_uart1_pins>;
};
&pps {
status = "okay";
compatible = "pps-gpio";
pinctrl-names = "default";
pinctrl-0 = <&bb_pps_gpio_pins>;
gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
};
but when I’ve run install.sh it’s put it in /lib/firmware rather than /boot/dtbs/$(uname -r)/, and even if I copy to the same place as the other overlays:
/boot/dtbs/6.15.9-bone25/RFZERO-00A0.dtbo: Device Tree Blob version 17, size=1540, boot CPU=0, string block size=188, DT structure block size=1296
adding to uEnv.txt fails to boot with FDT_ERR_NOTFOUND
U-Boot SPL 2022.04-ge0d31da5 (Aug 04 2023 - 18:48:26 +0000)
Trying to boot from MMC2
U-Boot 2022.04-ge0d31da5 (Aug 04 2023 - 18:48:26 +0000)
CPU : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM: 512 MiB
Reset Source: Global external warm reset has occurred.
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
Core: 150 devices, 14 uclasses, devicetree: separate
WDT: Started wdt@44e35000 with servicing (60s timeout)
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4... Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
BeagleBone Cape EEPROM: no EEPROM at address: 0x54
BeagleBone Cape EEPROM: no EEPROM at address: 0x55
BeagleBone Cape EEPROM: no EEPROM at address: 0x56
BeagleBone Cape EEPROM: no EEPROM at address: 0x57
Net: eth2: ethernet@4a100000, eth3: usb_ether
Press SPACE to abort autoboot in 0 seconds
board_name=[A335BNLT] ...
board_rev=[00C0] ...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk mmc@48060000.blk...
Disk mmc@48060000.blk not ready
Scanning disk mmc@481d8000.blk...
Found 2 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc1(part 0) is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
1706 bytes read in 2 ms (833 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-6.15.9-bone25 ...
8647168 bytes read in 549 ms (15 MiB/s)
debug: [enable_uboot_overlays=1] ...
debug: [enable_uboot_cape_universal=] ...
debug: [uboot_base_dtb_univ=am335x-boneblack-uboot.dtb] ...
uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot.dtb] ...
uboot_overlays: Switching too: dtb=am335x-boneblack-uboot.dtb ...
loading /boot/dtbs/6.15.9-bone25/am335x-boneblack-uboot.dtb ...
96712 bytes read in 10 ms (9.2 MiB/s)
Found 0 extension board(s).
uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: uboot loading of [BB-ADC-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_adc=1]...
uboot_overlays: loading /lib/firmware/RFZERO-00A0.dtbo ...
1540 bytes read in 10 ms (150.4 KiB/s)
failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND
uboot_overlays: loading /boot/dtbs/6.15.9-bone25/overlays/BB-BONE-eMMC1-01-00A0.dtbo ...
1645 bytes read in 5 ms (321.3 KiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
base fdt does did not have a /__symbols__ node
make sure you've compiled with -@
uboot_overlays: uboot loading of [BB-HDMI-TDA998x-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_video=1]...
loading /boot/initrd.img-6.15.9-bone25 ...
12488784 bytes read in 796 ms (15 MiB/s)
debug: [console=ttyS0,115200n8 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100] ...
debug: [bootz 0x82000000 0x88080000:be9050 88000000] ...
Kernel image @ 0x82000000 [ 0x000000 - 0x83f200 ]
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
and it hangs hunting for a TFTP rescue
Can someone point me to the steps I seem to have missed?
Many thanks
Andrew