Skip to content

Commit 1298a98

Browse files
josh-blakepelwell
authored andcommitted
overlays: Add support for pps-rp1 dtoverlay
Add support for pps-rp1 dtoverlay. Enables advanced pinctrl features found on RP1 based RPis and echo out functionality in the pps-gpio kernel module. Signed-off-by: Josh Blake <mail@josh.to>
1 parent 27b9789 commit 1298a98

File tree

3 files changed

+150
-0
lines changed

3 files changed

+150
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
227227
pitft35-resistive.dtbo \
228228
pivision.dtbo \
229229
pps-gpio.dtbo \
230+
pps-rp1.dtbo \
230231
proto-codec.dtbo \
231232
pwm.dtbo \
232233
pwm-2chan.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4152,6 +4152,52 @@ Params: gpiopin Input GPIO (default "18")
41524152
Default is "off".
41534153

41544154

4155+
Name: pps-rp1
4156+
4157+
Info: Configures the pps-gpio kernel module for use with the RP1 found on the
4158+
RPi 5 (pulse-per-second time signal via GPIO).
4159+
4160+
Load: dtoverlay=pps-rp1,<param>=<val>
4161+
4162+
Params: pin (integer) Specifies the PPS input pin.
4163+
Takes the pin number correlating to the RPi
4164+
40-pin GPIO header.
4165+
Defaults to GPIO 18.
4166+
4167+
pull-none (boolean) Disable pull-up/down resistors on the
4168+
PPS input pin.
4169+
4170+
pull-up (boolean) Enable pull-up resistor on the PPS
4171+
input pin.
4172+
4173+
pull-down (boolean) Enable pull-down resistor on the PPS
4174+
input pin.
4175+
4176+
schmitt-trigger (boolean) Enable the Schmitt-trigger on the PPS
4177+
input pin.
4178+
Defaults to off.
4179+
4180+
echo-pin (integer) Specifies the PPS echo output pin.
4181+
Takes the pin number correlating to the RPi
4182+
40-pin GPIO header.
4183+
Defaults to GPIO 17.
4184+
4185+
echo-ms (integer) Specifies the pulse-width in ms of the
4186+
echo signal on the PPS echo output pin.
4187+
Must be less than 999.
4188+
Defaults to 10ms.
4189+
4190+
echo (boolean) Enables the PPS echo output signal.
4191+
Defaults to off.
4192+
4193+
capture-clear (boolean) Captures the clear event time.
4194+
Defaults to off.
4195+
4196+
assert-falling-edge (boolean) Trigger on the falling signal edge
4197+
instead of the rising signal edge.
4198+
Defaults to off.
4199+
4200+
41554201
Name: proto-codec
41564202
Info: Configures the PROTO Audio Codec card
41574203
Load: dtoverlay=proto-codec
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
// This file is released under the GPL v2.0 License, and comes without warranty, express or implied.
3+
// (C) Josh Blake, 2026
4+
5+
/*
6+
* dtparams:
7+
* pin: (integer) Specifies the PPS Input pin.
8+
* Takes the pin number correlating to the RPi 40-pin GPIO.
9+
* Defaults to GPIO 18.
10+
* pull-none: (boolean) Disable pull-up/down resistors on the PPS Input pin.
11+
* pull-up: (boolean) Enable pull-up resistor on the PPS Input pin.
12+
* pull-down: (boolean) Enable pull-down resistor on the PPS Input pin.
13+
* schmitt-trigger: (boolean) Enable the Schmitt-trigger on the PPS Input pin.
14+
* Defaults to off.
15+
* echo-pin: (integer) Specifies the PPS Echo Output pin.
16+
* Takes the pin number correlating to the RPi 40-pin GPIO.
17+
* Defaults to GPIO 17.
18+
* echo-ms: (integer) Specifies the pulse-width in ms that the echo signal outputs
19+
* on the PPS Echo Output pin.
20+
* Must be less than 999.
21+
* Defaults to 10ms.
22+
* echo: (boolean) Enables the PPS Echo Output signal.
23+
* Defaults to off.
24+
* capture-clear: (boolean) Captures the clear event time.
25+
* Defaults to off.
26+
* assert-falling-edge: (boolean) Uses the falling signal edge instead of the
27+
* rising signal edge.
28+
* Defaults to off.
29+
*/
30+
31+
/dts-v1/;
32+
/plugin/;
33+
34+
/ {
35+
compatible = "brcm,bcm2712";
36+
37+
fragment@0 {
38+
target-path = "/";
39+
__overlay__ {
40+
pps: pps@ {
41+
compatible = "pps-gpio";
42+
pinctrl-names = "default";
43+
pinctrl-0 = <&pps_gpios>;
44+
gpios = <&gpio 18 0>;
45+
status = "okay";
46+
};
47+
};
48+
};
49+
50+
fragment@1 {
51+
target = <&gpio>;
52+
__overlay__ {
53+
pps_gpios: pps_gpios@ {
54+
pps_in: pps_in@ {
55+
function = "gpio";
56+
input-enable;
57+
};
58+
};
59+
};
60+
};
61+
62+
fragment@2 {
63+
target = <&pps_gpios>;
64+
__dormant__ {
65+
pps_out: pps_out@ {
66+
function = "gpio";
67+
output-enable;
68+
drive-push-pull;
69+
bias-disable;
70+
};
71+
};
72+
};
73+
74+
fragment@3 {
75+
target = <&pps>;
76+
pps_echo: __dormant__ {
77+
echo-gpios = <&gpio 17 0>;
78+
echo-active-ms = <10>;
79+
};
80+
};
81+
82+
__overrides__ {
83+
// A very annoying and inelegant pinctrl to pin number LUT
84+
pin =
85+
<&pps>,"reg:0{,=18}",
86+
<&pps>,"gpios:4{,=18}",
87+
<&pps_gpios>,"reg:0{,=18}",
88+
<&pps_in>,"reg:0{,=18}",
89+
<&pps_in>,"pins{2=gpio2,3=gpio3,4=gpio4,17=gpio17,27=gpio27,22=gpio22,10=gpio10,9=gpio9,11=gpio11,0=gpio0,5=gpio5,6=gpio6,13=gpio13,19=gpio19,26=gpio26,14=gpio14,15=gpio15,18=gpio18,23=gpio23,24=gpio24,25=gpio25,8=gpio8,7=gpio7,1=gpio1,12=gpio12,16=gpio16,20=gpio20,21=gpio21,=gpio18}";
90+
pull-none = <&pps_in>,"bias-disable?";
91+
pull-up = <&pps_in>,"bias-pull-up?";
92+
pull-down = <&pps_in>,"bias-pull-down?";
93+
schmitt-trigger = <&pps_in>,"input-enable!",<&pps_in>,"input-schmitt-enable?";
94+
assert-falling-edge = <&pps>,"assert-falling-edge?";
95+
capture-clear = <&pps>,"capture-clear?";
96+
echo-pin =
97+
<&pps_out>,"reg:0{,=17}",
98+
<&pps_out>,"pins{2=gpio2,3=gpio3,4=gpio4,17=gpio17,27=gpio27,22=gpio22,10=gpio10,9=gpio9,11=gpio11,0=gpio0,5=gpio5,6=gpio6,13=gpio13,19=gpio19,26=gpio26,14=gpio14,15=gpio15,18=gpio18,23=gpio23,24=gpio24,25=gpio25,8=gpio8,7=gpio7,1=gpio1,12=gpio12,16=gpio16,20=gpio20,21=gpio21,=gpio17}",
99+
<&pps_echo>,"echo-gpios:4{,=17}";
100+
echo-ms = <&pps_echo>,"echo-active-ms:0";
101+
echo = <0>,"+2+3";
102+
};
103+
};

0 commit comments

Comments
 (0)