From fec6519b84115504e5da3c35209529ac2189643c Mon Sep 17 00:00:00 2001 From: Nascs Fang Date: Thu, 24 Oct 2024 20:34:41 +0800 Subject: [PATCH] feat: add spi1 to rock2 Signed-off-by: Nascs Fang --- .../arm64/boot/dts/rockchip/overlays/Makefile | 1 + .../rockchip/overlays/rk3528-spi1-cs-gpio.dts | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-spi1-cs-gpio.dts diff --git a/arch/arm64/boot/dts/rockchip/overlays/Makefile b/arch/arm64/boot/dts/rockchip/overlays/Makefile index f77b4410..0718631d 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/Makefile +++ b/arch/arm64/boot/dts/rockchip/overlays/Makefile @@ -136,6 +136,7 @@ dtb-$(CONFIG_CLK_RK3528) += \ rk3528-spi0-cs1-enc28j60.dtbo \ rk3528-spi0-cs1-mcp2515.dtbo \ rk3528-spi0-cs1-spidev.dtbo \ + rk3528-spi1-cs-gpio.dtbo \ rk3528-uart0-m0.dtbo \ rk3528-uart1-m0.dtbo \ rk3528-uart2-m1.dtbo \ diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-spi1-cs-gpio.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-spi1-cs-gpio.dts new file mode 100644 index 00000000..00ed8965 --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-spi1-cs-gpio.dts @@ -0,0 +1,31 @@ +/dts-v1/; +/plugin/; +#include +#include + +/ { + metadata { + title = "Enable spidev on SPI1 over PIN_26"; + compatible = "radxa,rock-2a", "radxa,rock-2f", "radxa,medge-rk3528a-io"; + category = "misc"; + exclusive = "GPIO1_B6", "GPIO1_B7", "GPIO1_C0", "GPIO4_C1"; + description = "Enable spidev on SPI1 over PIN_26."; + }; +}; + +&spi1 { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + max-freq = <50000000>; + num-cs = <1>; + cs-gpios = <&gpio4 RK_PC1 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&spi1_pins>; + + spidev@1 { + compatible = "rockchip,spidev"; + status = "okay"; + reg = <1>; + spi-max-frequency = <50000000>; + }; +};