1 From 42c792400770ec57cafce87cb9594a948d6c0700 Mon Sep 17 00:00:00 2001
2 From: Marc Kleine-Budde <mkl@pengutronix.de>
3 Date: Sat, 2 Jan 2021 21:38:58 +0100
4 Subject: [PATCH] overlays: Add overlay for Seeed Studio CAN BUS FD
5 HAT v1 (based on mcp2517fd)
7 This patch adds the overlay for the Seeed Studio CAN BUS FD HAT v1 with two CAN
8 FD Channels (based on mcp2517fd).
10 https://www.seeedstudio.com/2-Channel-CAN-BUS-FD-Shield-for-Raspberry-Pi-p-4072.html
12 The overlay was generated by:
13 ovmerge -c spi1-1cs-overlay.dts,cs0_pin=18,cs0_spidev=false \
14 mcp251xfd-overlay.dts,spi0-0,interrupt=25 \
15 mcp251xfd-overlay.dts,spi1-0,interrupt=24
17 Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
19 arch/arm/boot/dts/overlays/Makefile | 1 +
20 arch/arm/boot/dts/overlays/README | 8 +
21 .../overlays/seeed-can-fd-hat-v1-overlay.dts | 138 ++++++++++++++++++
22 3 files changed, 147 insertions(+)
23 create mode 100644 arch/arm/boot/dts/overlays/seeed-can-fd-hat-v1-overlay.dts
25 --- a/arch/arm/boot/dts/overlays/Makefile
26 +++ b/arch/arm/boot/dts/overlays/Makefile
27 @@ -159,6 +159,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
31 + seeed-can-fd-hat-v1.dtbo \
32 seeed-can-fd-hat-v2.dtbo \
35 --- a/arch/arm/boot/dts/overlays/README
36 +++ b/arch/arm/boot/dts/overlays/README
37 @@ -2460,6 +2460,14 @@ Info: This overlay is now deprecated.
41 +Name: seeed-can-fd-hat-v1
42 +Info: Overlay for Seeed Studio CAN BUS FD HAT with two CAN FD channels
43 + (based on the mcp2517fd).
44 + https://www.seeedstudio.com/2-Channel-CAN-BUS-FD-Shield-for-Raspberry-Pi-p-4072.html
45 +Load: dtoverlay=seeed-can-fd-hat-v1
49 Name: seeed-can-fd-hat-v2
50 Info: Overlay for Seeed Studio CAN BUS FD HAT with two CAN FD channels
51 (based on the mcp2518fd) and an RTC.
53 +++ b/arch/arm/boot/dts/overlays/seeed-can-fd-hat-v1-overlay.dts
55 +// redo: ovmerge -c spi1-1cs-overlay.dts,cs0_pin=18,cs0_spidev=false mcp251xfd-overlay.dts,spi0-0,interrupt=25 mcp251xfd-overlay.dts,spi1-0,interrupt=24
57 +// Device tree overlay for https://www.seeedstudio.com/2-Channel-CAN-BUS-FD-Shield-for-Raspberry-Pi-p-4072.html
62 +#include <dt-bindings/gpio/gpio.h>
63 +#include <dt-bindings/interrupt-controller/irq.h>
64 +#include <dt-bindings/pinctrl/bcm2835.h>
67 + compatible = "brcm,bcm2835";
71 + spi1_pins: spi1_pins {
72 + brcm,pins = <19 20 21>;
73 + brcm,function = <3>;
75 + spi1_cs_pins: spi1_cs_pins {
77 + brcm,function = <1>;
84 + #address-cells = <1>;
86 + pinctrl-names = "default";
87 + pinctrl-0 = <&spi1_pins &spi1_cs_pins>;
88 + cs-gpios = <&gpio 18 1>;
91 + compatible = "spidev";
93 + #address-cells = <1>;
95 + spi-max-frequency = <125000000>;
96 + status = "disabled";
107 + target = <&spidev0>;
109 + status = "disabled";
115 + mcp251xfd_pins: mcp251xfd_spi0_0_pins {
117 + brcm,function = <BCM2835_FSEL_GPIO_IN>;
122 + target-path = "/clocks";
124 + clk_mcp251xfd_osc: mcp251xfd-spi0-0-osc {
125 + #clock-cells = <0>;
126 + compatible = "fixed-clock";
127 + clock-frequency = <40000000>;
135 + #address-cells = <1>;
138 + compatible = "microchip,mcp251xfd";
140 + pinctrl-names = "default";
141 + pinctrl-0 = <&mcp251xfd_pins>;
142 + spi-max-frequency = <20000000>;
143 + interrupt-parent = <&gpio>;
144 + interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
145 + clocks = <&clk_mcp251xfd_osc>;
150 + target-path = "spi1/spidev@0";
152 + status = "disabled";
158 + mcp251xfd_pins_1: mcp251xfd_spi1_0_pins {
160 + brcm,function = <BCM2835_FSEL_GPIO_IN>;
165 + target-path = "/clocks";
167 + clk_mcp251xfd_osc_1: mcp251xfd-spi1-0-osc {
168 + #clock-cells = <0>;
169 + compatible = "fixed-clock";
170 + clock-frequency = <40000000>;
178 + #address-cells = <1>;
181 + compatible = "microchip,mcp251xfd";
183 + pinctrl-names = "default";
184 + pinctrl-0 = <&mcp251xfd_pins_1>;
185 + spi-max-frequency = <20000000>;
186 + interrupt-parent = <&gpio>;
187 + interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
188 + clocks = <&clk_mcp251xfd_osc_1>;