From 1439e5668b713f3230385a62f5389cbf90615615 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 31 Jan 2022 21:01:25 +0000 Subject: [PATCH] overlays: Add spi0-0cs overlay An overlay to enable SPI0 without claiming any chip select GPIOs. Signed-off-by: Phil Elwell --- arch/arm/boot/dts/overlays/Makefile | 1 + arch/arm/boot/dts/overlays/README | 8 ++++ .../boot/dts/overlays/spi0-0cs-overlay.dts | 39 +++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 arch/arm/boot/dts/overlays/spi0-0cs-overlay.dts diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile index bff07c1748b7..f51eca4887d5 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile @@ -194,6 +194,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ spi-gpio35-39.dtbo \ spi-gpio40-45.dtbo \ spi-rtc.dtbo \ + spi0-0cs.dtbo \ spi0-1cs.dtbo \ spi0-2cs.dtbo \ spi1-1cs.dtbo \ diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README index f124086d4702..0a2f62f2f28f 100644 --- a/arch/arm/boot/dts/overlays/README +++ b/arch/arm/boot/dts/overlays/README @@ -3098,6 +3098,14 @@ Params: ds3232 Select the DS3232 device cs_high This device requires an active-high CS +Name: spi0-0cs +Info: Don't claim any CS pins for SPI0. Requires a device with its chip + select permanently enabled, but frees a GPIO for e.g. a DPI display. +Load: dtoverlay=spi0-0cs,= +Params: no_miso Don't claim and use the MISO pin (9), freeing + it for other uses. + + Name: spi0-1cs Info: Only use one CS pin for SPI0 Load: dtoverlay=spi0-1cs,= diff --git a/arch/arm/boot/dts/overlays/spi0-0cs-overlay.dts b/arch/arm/boot/dts/overlays/spi0-0cs-overlay.dts new file mode 100644 index 000000000000..0d2acabf56a4 --- /dev/null +++ b/arch/arm/boot/dts/overlays/spi0-0cs-overlay.dts @@ -0,0 +1,39 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2835"; + + fragment@0 { + target = <&spi0_cs_pins>; + frag0: __overlay__ { + brcm,pins; + }; + }; + + fragment@1 { + target = <&spi0>; + __overlay__ { + cs-gpios; + status = "okay"; + }; + }; + + fragment@2 { + target = <&spidev1>; + __overlay__ { + status = "disabled"; + }; + }; + + fragment@3 { + target = <&spi0_pins>; + __dormant__ { + brcm,pins = <10 11>; + }; + }; + + __overrides__ { + no_miso = <0>,"=3"; + }; +}; -- 2.34.1