Skip to content

Instantly share code, notes, and snippets.

@shaneshort
Created January 12, 2024 03:21
Show Gist options
  • Save shaneshort/c01cc2417465044110c867a5fb7ea4ac to your computer and use it in GitHub Desktop.
Save shaneshort/c01cc2417465044110c867a5fb7ea4ac to your computer and use it in GitHub Desktop.
Device Tree Overlay file for GPS Cape
/*
* Copyright (C) 2016 Shane Short <[email protected]>
* Hardware design by Brenton Hewitt <[email protected]>
*
* Combined GPS (with PPS) and Dallas 1W sensor bus cape.
*/
/dts-v1/;
/plugin/;
#include <dt-bindings/board/am335x-bbw-bbb-base.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black", "ti,beaglebone-green";
/* identification */
part-number = "BBB-WACAN-GPS";
version = "00A2";
/* state the resources this cape uses */
exclusive-use =
"P8.8", /* GPS PPS Signal */
"P9.11", /* UART4_rxd */
"P9.13", /* UART4_txd */
"P9.22", /* Dallas 1W Bus
/* the hardware ip uses */
"uart4",
"gpio2_3";
/*
* Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
*/
fragment@0 {
target-path="/";
__overlay__ {
chosen {
overlays {
BBB-WACAN-GPS-00A2 = __TIMESTAMP__;
};
};
};
};
/*
* Free up the pins used by the cape from the pinmux helpers.
*/
fragment@1 {
target = <&ocp>;
__overlay__ {
P9_12_pinmux { status = "disabled"; };
};
};
fragment@2 {
target = <&am33xx_pinmux>;
__overlay__ {
dallas_w1_pins: pinmux_dallas_w1_pins {
pinctrl-single,pins = <
BONE_P9_22 (INPUT_EN | PULL_UP | MUX_MODE7)
>;
};
bb_uart4_pins: pinmux_bb_uart4_pins {
pinctrl-single,pins = <
BONE_P9_13 (PIN_OUTPUT | MUX_MODE6)
BONE_P9_11 (PIN_INPUT | MUX_MODE6)
>;
};
/* GPS 1 PPS Input */
gps_pps_pins: pinmux_gps_pps_pins {
pinctrl-single,pins = < BONE_P8_08 (PIN_INPUT | MUX_MODE7) >;
};
};
};
fragment@3 {
target-path="/";
__overlay__ {
onewire {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&dallas_w1_pins>;
compatible = "w1-gpio";
gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
};
};
};
fragment@4 {
target = <&uart4>;
__overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&bb_uart4_pins>;
};
};
fragment@5 {
target = <&ocp>;
__overlay__ {
pps {
compatible = "pps-gpio";
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&gps_pps_pins>;
gpios = <&gpio2 3 0 >;
assert-rising-edge;
};
};
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment