From f43bae38e86c0328c6232606e552acff845e64cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 25 Sep 2019 07:43:48 +0200 Subject: [PATCH] dts: Use separate compatibles for Nordic SPI/SPIM/SPIS peripherals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit introduces separate "compatible" strings for DTS nodes representing different types of Nordic SPI peripherals. Previously "nordic,nrf-spi" was used for both SPI and SPIM. SPIS was already handled separately. Quite a few files need to be touched by this commit but the changes can be divided into groups of related or very similar ones, distinguishable by the initial part of the path to the modified file: * dts/bindings/spi/ new binding for "nordic,nrf-spim" is added and common fields for all 3 types of Nordic SPI peripherals are extracted to a shared file * dts/arm/nordic/ "compatible" properties in spiX nodes are updated (when there is no choice as only one type of SPI peripheral is available) or replaced with a comment pointing out that the proper type of peripheral needs to be picked at some upper layer * drivers/spi/ spi_nrfx_spim driver is updated with the new form of macros generated from dts * boards/ all spiX nodes in dts files for boards equipped with an nRF chip are updated with the proper "compatible" property, according to the type of SPI peripheral that is currently selected for the board by the corresponding Kconfig choice option (SPI_x_NRF_SPI*) Signed-off-by: Andrzej Głąbek --- boards/arm/96b_nitrogen/96b_nitrogen.dts | 1 + .../actinius_icarus_common.dts | 1 + boards/arm/bl652_dvk/bl652_dvk.dts | 6 ++-- boards/arm/bl654_dvk/bl654_dvk.dts | 2 ++ boards/arm/nrf51_ble400/nrf51_ble400.dts | 1 + boards/arm/nrf51_pca10028/nrf51_pca10028.dts | 1 + .../nrf52810_pca10040/nrf52810_pca10040.dts | 1 + .../nrf52811_pca10056/nrf52811_pca10056.dts | 2 ++ boards/arm/nrf52840_blip/nrf52840_blip.dts | 3 ++ boards/arm/nrf52840_papyr/nrf52840_papyr.dts | 1 + .../nrf52840_pca10056/nrf52840_pca10056.dts | 3 ++ .../nrf52840_pca10059/nrf52840_pca10059.dts | 2 ++ boards/arm/nrf52_pca10040/nrf52_pca10040.dts | 3 ++ .../nrf9160_pca10090_common.dts | 1 + .../arm/particle_argon/dts/mesh_feather.dtsi | 1 + .../arm/particle_boron/dts/mesh_feather.dtsi | 1 + .../arm/particle_xenon/dts/mesh_feather.dtsi | 1 + boards/arm/reel_board/dts/reel_board.dtsi | 1 + drivers/spi/spi_nrfx_spim.c | 10 +++--- dts/arm/nordic/nrf51822.dtsi | 7 ++++- dts/arm/nordic/nrf52810.dtsi | 8 ++++- dts/arm/nordic/nrf52811.dtsi | 16 ++++++++-- dts/arm/nordic/nrf52832.dtsi | 24 ++++++++++++-- dts/arm/nordic/nrf52840.dtsi | 26 +++++++++++++--- dts/arm/nordic/nrf9160_common.dtsi | 24 +++++++++++--- dts/bindings/spi/nordic,nrf-spi-common.yaml | 28 +++++++++++++++++ dts/bindings/spi/nordic,nrf-spi.yaml | 31 +++---------------- dts/bindings/spi/nordic,nrf-spim.yaml | 10 ++++++ dts/bindings/spi/nordic,nrf-spis.yaml | 28 ++--------------- 29 files changed, 170 insertions(+), 74 deletions(-) create mode 100644 dts/bindings/spi/nordic,nrf-spi-common.yaml create mode 100644 dts/bindings/spi/nordic,nrf-spim.yaml diff --git a/boards/arm/96b_nitrogen/96b_nitrogen.dts b/boards/arm/96b_nitrogen/96b_nitrogen.dts index 6c60e937ea2..1900eb5ec96 100644 --- a/boards/arm/96b_nitrogen/96b_nitrogen.dts +++ b/boards/arm/96b_nitrogen/96b_nitrogen.dts @@ -80,6 +80,7 @@ }; &spi1 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <26>; mosi-pin = <23>; diff --git a/boards/arm/actinius_icarus/actinius_icarus_common.dts b/boards/arm/actinius_icarus/actinius_icarus_common.dts index 7a169a135f2..6c1a3ba7575 100644 --- a/boards/arm/actinius_icarus/actinius_icarus_common.dts +++ b/boards/arm/actinius_icarus/actinius_icarus_common.dts @@ -105,6 +105,7 @@ }; &spi3 { + compatible = "nordic,nrf-spim"; status = "okay"; sck-pin = <20>; diff --git a/boards/arm/bl652_dvk/bl652_dvk.dts b/boards/arm/bl652_dvk/bl652_dvk.dts index b86262a780c..6e8cad6ee41 100644 --- a/boards/arm/bl652_dvk/bl652_dvk.dts +++ b/boards/arm/bl652_dvk/bl652_dvk.dts @@ -91,19 +91,21 @@ }; &spi0 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <25>; mosi-pin = <23>; miso-pin = <24>; - cs-gpios = <&gpio0 22 0>; + cs-gpios = <&gpio0 22 0>; }; &spi1 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <16>; mosi-pin = <20>; miso-pin = <14>; - cs-gpios = <&gpio0 12 0>; + cs-gpios = <&gpio0 12 0>; }; &flash0 { diff --git a/boards/arm/bl654_dvk/bl654_dvk.dts b/boards/arm/bl654_dvk/bl654_dvk.dts index 453f815729a..62fff914867 100644 --- a/boards/arm/bl654_dvk/bl654_dvk.dts +++ b/boards/arm/bl654_dvk/bl654_dvk.dts @@ -115,6 +115,7 @@ }; &spi0 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <41>; mosi-pin = <40>; @@ -123,6 +124,7 @@ }; &spi1 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <19>; mosi-pin = <20>; diff --git a/boards/arm/nrf51_ble400/nrf51_ble400.dts b/boards/arm/nrf51_ble400/nrf51_ble400.dts index 393af2076ac..1a43d4b0609 100644 --- a/boards/arm/nrf51_ble400/nrf51_ble400.dts +++ b/boards/arm/nrf51_ble400/nrf51_ble400.dts @@ -91,6 +91,7 @@ }; &spi1 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <25>; mosi-pin = <24>; diff --git a/boards/arm/nrf51_pca10028/nrf51_pca10028.dts b/boards/arm/nrf51_pca10028/nrf51_pca10028.dts index 6f02a342bbf..5207d9288e5 100644 --- a/boards/arm/nrf51_pca10028/nrf51_pca10028.dts +++ b/boards/arm/nrf51_pca10028/nrf51_pca10028.dts @@ -119,6 +119,7 @@ }; &spi1 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <6>; mosi-pin = <5>; diff --git a/boards/arm/nrf52810_pca10040/nrf52810_pca10040.dts b/boards/arm/nrf52810_pca10040/nrf52810_pca10040.dts index 6940bf92913..6ebddae6412 100644 --- a/boards/arm/nrf52810_pca10040/nrf52810_pca10040.dts +++ b/boards/arm/nrf52810_pca10040/nrf52810_pca10040.dts @@ -108,6 +108,7 @@ }; &spi0 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <29>; mosi-pin = <31>; diff --git a/boards/arm/nrf52811_pca10056/nrf52811_pca10056.dts b/boards/arm/nrf52811_pca10056/nrf52811_pca10056.dts index 979db7b5863..000ef5b4159 100644 --- a/boards/arm/nrf52811_pca10056/nrf52811_pca10056.dts +++ b/boards/arm/nrf52811_pca10056/nrf52811_pca10056.dts @@ -113,6 +113,7 @@ }; &spi0 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <0>; mosi-pin = <1>; @@ -120,6 +121,7 @@ }; &spi1 { + compatible = "nordic,nrf-spi"; /* cannot be used with i2c0 */ sck-pin = <19>; mosi-pin = <20>; diff --git a/boards/arm/nrf52840_blip/nrf52840_blip.dts b/boards/arm/nrf52840_blip/nrf52840_blip.dts index d35dd25cc53..f0ba3c2581d 100644 --- a/boards/arm/nrf52840_blip/nrf52840_blip.dts +++ b/boards/arm/nrf52840_blip/nrf52840_blip.dts @@ -100,6 +100,7 @@ }; &spi0 { + compatible = "nordic,nrf-spi"; /* Cannot be used together with i2c0. */ /* status = "okay"; */ sck-pin = <19>; @@ -108,6 +109,7 @@ }; &spi1 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <25>; mosi-pin = <34>; @@ -115,6 +117,7 @@ }; &spi2 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <26>; mosi-pin = <23>; diff --git a/boards/arm/nrf52840_papyr/nrf52840_papyr.dts b/boards/arm/nrf52840_papyr/nrf52840_papyr.dts index d7fbf38ee3e..747c148004c 100644 --- a/boards/arm/nrf52840_papyr/nrf52840_papyr.dts +++ b/boards/arm/nrf52840_papyr/nrf52840_papyr.dts @@ -87,6 +87,7 @@ }; &spi1 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <31>; mosi-pin = <29>; diff --git a/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts b/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts index 25657cbe015..582db3207ee 100644 --- a/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts +++ b/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts @@ -158,6 +158,7 @@ arduino_i2c: &i2c0 { }; &spi0 { + compatible = "nordic,nrf-spi"; /* Cannot be used together with i2c0. */ /* status = "okay"; */ sck-pin = <27>; @@ -166,6 +167,7 @@ arduino_i2c: &i2c0 { }; &spi1 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <31>; mosi-pin = <30>; @@ -173,6 +175,7 @@ arduino_i2c: &i2c0 { }; &spi2 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <19>; mosi-pin = <20>; diff --git a/boards/arm/nrf52840_pca10059/nrf52840_pca10059.dts b/boards/arm/nrf52840_pca10059/nrf52840_pca10059.dts index 60bf4be2150..125a22d598d 100644 --- a/boards/arm/nrf52840_pca10059/nrf52840_pca10059.dts +++ b/boards/arm/nrf52840_pca10059/nrf52840_pca10059.dts @@ -112,6 +112,7 @@ * limited GPIOs available on dongle board. */ &spi0 { + compatible = "nordic,nrf-spi"; /* Cannot be used together with i2c0. */ /* status = "okay"; */ sck-pin = <27>; @@ -120,6 +121,7 @@ }; &spi1 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <31>; mosi-pin = <30>; diff --git a/boards/arm/nrf52_pca10040/nrf52_pca10040.dts b/boards/arm/nrf52_pca10040/nrf52_pca10040.dts index 2edcf29635c..0d9fde2fe56 100644 --- a/boards/arm/nrf52_pca10040/nrf52_pca10040.dts +++ b/boards/arm/nrf52_pca10040/nrf52_pca10040.dts @@ -148,6 +148,7 @@ arduino_i2c: &i2c0 { }; &spi0 { + compatible = "nordic,nrf-spi"; /* Cannot be used together with i2c0. */ /* status = "okay"; */ sck-pin = <27>; @@ -156,6 +157,7 @@ arduino_i2c: &i2c0 { }; &spi1 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <31>; mosi-pin = <30>; @@ -163,6 +165,7 @@ arduino_i2c: &i2c0 { }; arduino_spi: &spi2 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <25>; mosi-pin = <23>; diff --git a/boards/arm/nrf9160_pca10090/nrf9160_pca10090_common.dts b/boards/arm/nrf9160_pca10090/nrf9160_pca10090_common.dts index fcc2db4ce3c..60af4864730 100644 --- a/boards/arm/nrf9160_pca10090/nrf9160_pca10090_common.dts +++ b/boards/arm/nrf9160_pca10090/nrf9160_pca10090_common.dts @@ -116,6 +116,7 @@ }; &spi3 { + compatible = "nordic,nrf-spim"; status = "okay"; sck-pin = <19>; mosi-pin = <18>; diff --git a/boards/arm/particle_argon/dts/mesh_feather.dtsi b/boards/arm/particle_argon/dts/mesh_feather.dtsi index 5ad4a6cfbf2..dbf1f44ee30 100644 --- a/boards/arm/particle_argon/dts/mesh_feather.dtsi +++ b/boards/arm/particle_argon/dts/mesh_feather.dtsi @@ -127,6 +127,7 @@ /* TWI1 used on Boron; also see mesh_feather_spi1_spi1.dtsi */ &spi2 { /* dedicated MX25L */ + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <19>; mosi-pin = <20>; diff --git a/boards/arm/particle_boron/dts/mesh_feather.dtsi b/boards/arm/particle_boron/dts/mesh_feather.dtsi index 5ad4a6cfbf2..dbf1f44ee30 100644 --- a/boards/arm/particle_boron/dts/mesh_feather.dtsi +++ b/boards/arm/particle_boron/dts/mesh_feather.dtsi @@ -127,6 +127,7 @@ /* TWI1 used on Boron; also see mesh_feather_spi1_spi1.dtsi */ &spi2 { /* dedicated MX25L */ + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <19>; mosi-pin = <20>; diff --git a/boards/arm/particle_xenon/dts/mesh_feather.dtsi b/boards/arm/particle_xenon/dts/mesh_feather.dtsi index 5ad4a6cfbf2..dbf1f44ee30 100644 --- a/boards/arm/particle_xenon/dts/mesh_feather.dtsi +++ b/boards/arm/particle_xenon/dts/mesh_feather.dtsi @@ -127,6 +127,7 @@ /* TWI1 used on Boron; also see mesh_feather_spi1_spi1.dtsi */ &spi2 { /* dedicated MX25L */ + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <19>; mosi-pin = <20>; diff --git a/boards/arm/reel_board/dts/reel_board.dtsi b/boards/arm/reel_board/dts/reel_board.dtsi index 3fd5d0523f0..6c7c6e3e167 100644 --- a/boards/arm/reel_board/dts/reel_board.dtsi +++ b/boards/arm/reel_board/dts/reel_board.dtsi @@ -128,6 +128,7 @@ arduino_i2c: &i2c0 { }; arduino_spi: &spi1 { + compatible = "nordic,nrf-spi"; status = "okay"; sck-pin = <47>; miso-pin = <46>; diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index d446e9b91b4..9812d1d04e9 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -371,7 +371,7 @@ static int spim_nrfx_pm_control(struct device *dev, u32_t ctrl_command, static int spi_##idx##_init(struct device *dev) \ { \ IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIM##idx), \ - DT_NORDIC_NRF_SPI_SPI_##idx##_IRQ_0_PRIORITY, \ + DT_NORDIC_NRF_SPIM_SPI_##idx##_IRQ_0_PRIORITY, \ nrfx_isr, nrfx_spim_##idx##_irq_handler, 0); \ return init_spim(dev); \ } \ @@ -384,9 +384,9 @@ static int spim_nrfx_pm_control(struct device *dev, u32_t ctrl_command, .spim = NRFX_SPIM_INSTANCE(idx), \ .max_chunk_len = (1 << SPIM##idx##_EASYDMA_MAXCNT_SIZE) - 1, \ .config = { \ - .sck_pin = DT_NORDIC_NRF_SPI_SPI_##idx##_SCK_PIN, \ - .mosi_pin = DT_NORDIC_NRF_SPI_SPI_##idx##_MOSI_PIN, \ - .miso_pin = DT_NORDIC_NRF_SPI_SPI_##idx##_MISO_PIN, \ + .sck_pin = DT_NORDIC_NRF_SPIM_SPI_##idx##_SCK_PIN, \ + .mosi_pin = DT_NORDIC_NRF_SPIM_SPI_##idx##_MOSI_PIN, \ + .miso_pin = DT_NORDIC_NRF_SPIM_SPI_##idx##_MISO_PIN, \ .ss_pin = NRFX_SPIM_PIN_NOT_USED, \ .orc = CONFIG_SPI_##idx##_NRF_ORC, \ .frequency = NRF_SPIM_FREQ_4M, \ @@ -396,7 +396,7 @@ static int spim_nrfx_pm_control(struct device *dev, u32_t ctrl_command, } \ }; \ DEVICE_DEFINE(spi_##idx, \ - DT_NORDIC_NRF_SPI_SPI_##idx##_LABEL, \ + DT_NORDIC_NRF_SPIM_SPI_##idx##_LABEL, \ spi_##idx##_init, \ spim_nrfx_pm_control, \ &spi_##idx##_data, \ diff --git a/dts/arm/nordic/nrf51822.dtsi b/dts/arm/nordic/nrf51822.dtsi index d0c20ef9774..02f41c7c36a 100644 --- a/dts/arm/nordic/nrf51822.dtsi +++ b/dts/arm/nordic/nrf51822.dtsi @@ -141,7 +141,12 @@ }; spi1: spi@40004000 { - compatible = "nordic,nrf-spi"; + /* + * This spi node can be either SPI or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spi" or + * "nordic,nrf-spis". + */ #address-cells = <1>; #size-cells = <0>; reg = <0x40004000 0x1000>; diff --git a/dts/arm/nordic/nrf52810.dtsi b/dts/arm/nordic/nrf52810.dtsi index 37ec0054e6e..13698d1f5f6 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -134,7 +134,13 @@ }; spi0: spi@40004000 { - compatible = "nordic,nrf-spi"; + /* + * This spi node can be SPI, SPIM, or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spi" or + * "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ #address-cells = <1>; #size-cells = <0>; reg = <0x40004000 0x1000>; diff --git a/dts/arm/nordic/nrf52811.dtsi b/dts/arm/nordic/nrf52811.dtsi index afd342f8422..0e552e711a0 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -141,7 +141,13 @@ }; spi0: spi@40004000 { - compatible = "nordic,nrf-spi"; + /* + * This spi node can be SPI, SPIM, or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spi" or + * "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ #address-cells = <1>; #size-cells = <0>; reg = <0x40004000 0x1000>; @@ -152,7 +158,13 @@ spi1: spi@40003000 { /* cannot be used with i2c0 */ - compatible = "nordic,nrf-spi"; + /* + * This spi node can be SPI, SPIM, or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spi" or + * "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ #address-cells = <1>; #size-cells = <0>; reg = <0x40003000 0x1000>; diff --git a/dts/arm/nordic/nrf52832.dtsi b/dts/arm/nordic/nrf52832.dtsi index d5ed5699dcf..de10ed8990a 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -175,7 +175,13 @@ }; spi0: spi@40003000 { - compatible = "nordic,nrf-spi"; + /* + * This spi node can be SPI, SPIM, or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spi" or + * "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ #address-cells = <1>; #size-cells = <0>; reg = <0x40003000 0x1000>; @@ -185,7 +191,13 @@ }; spi1: spi@40004000 { - compatible = "nordic,nrf-spi"; + /* + * This spi node can be SPI, SPIM, or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spi" or + * "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ #address-cells = <1>; #size-cells = <0>; reg = <0x40004000 0x1000>; @@ -195,7 +207,13 @@ }; spi2: spi@40023000 { - compatible = "nordic,nrf-spi"; + /* + * This spi node can be SPI, SPIM, or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spi" or + * "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ #address-cells = <1>; #size-cells = <0>; reg = <0x40023000 0x1000>; diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index 61e0cd6f335..f8c469a331f 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -209,7 +209,13 @@ }; spi0: spi@40003000 { - compatible = "nordic,nrf-spi"; + /* + * This spi node can be SPI, SPIM, or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spi" or + * "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ #address-cells = <1>; #size-cells = <0>; reg = <0x40003000 0x1000>; @@ -219,7 +225,13 @@ }; spi1: spi@40004000 { - compatible = "nordic,nrf-spi"; + /* + * This spi node can be SPI, SPIM, or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spi" or + * "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ #address-cells = <1>; #size-cells = <0>; reg = <0x40004000 0x1000>; @@ -229,7 +241,13 @@ }; spi2: spi@40023000 { - compatible = "nordic,nrf-spi"; + /* + * This spi node can be SPI, SPIM, or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spi" or + * "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ #address-cells = <1>; #size-cells = <0>; reg = <0x40023000 0x1000>; @@ -239,7 +257,7 @@ }; spi3: spi@4002b000 { - compatible = "nordic,nrf-spi"; + compatible = "nordic,nrf-spim"; #address-cells = <1>; #size-cells = <0>; reg = <0x4002b000 0x1000>; diff --git a/dts/arm/nordic/nrf9160_common.dtsi b/dts/arm/nordic/nrf9160_common.dtsi index 3c0bef83d51..b5b666b8154 100644 --- a/dts/arm/nordic/nrf9160_common.dtsi +++ b/dts/arm/nordic/nrf9160_common.dtsi @@ -209,7 +209,11 @@ i2c3: i2c@b000 { }; spi0: spi@8000 { - compatible = "nordic,nrf-spi"; + /* + * This spi node can be either SPIM or SPIS, for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ #address-cells = <1>; #size-cells = <0>; reg = <0x8000 0x1000>; @@ -219,7 +223,11 @@ spi0: spi@8000 { }; spi1: spi@9000 { - compatible = "nordic,nrf-spi"; + /* + * This spi node can be either SPIM or SPIS, for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ #address-cells = <1>; #size-cells = <0>; reg = <0x9000 0x1000>; @@ -229,7 +237,11 @@ spi1: spi@9000 { }; spi2: spi@a000 { - compatible = "nordic,nrf-spi"; + /* + * This spi node can be either SPIM or SPIS, for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ #address-cells = <1>; #size-cells = <0>; reg = <0xa000 0x1000>; @@ -239,7 +251,11 @@ spi2: spi@a000 { }; spi3: spi@b000 { - compatible = "nordic,nrf-spi"; + /* + * This spi node can be either SPIM or SPIS, for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ #address-cells = <1>; #size-cells = <0>; reg = <0xb000 0x1000>; diff --git a/dts/bindings/spi/nordic,nrf-spi-common.yaml b/dts/bindings/spi/nordic,nrf-spi-common.yaml new file mode 100644 index 00000000000..24d82e4a091 --- /dev/null +++ b/dts/bindings/spi/nordic,nrf-spi-common.yaml @@ -0,0 +1,28 @@ +# Copyright (c) 2018 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Common fields for Nordic nRF family SPI peripherals + +include: spi-controller.yaml + +properties: + reg: + required: true + + interrupts: + required: true + + sck-pin: + type: int + required: true + description: SCK pin + + mosi-pin: + type: int + required: true + description: MOSI pin + + miso-pin: + type: int + required: true + description: MISO pin diff --git a/dts/bindings/spi/nordic,nrf-spi.yaml b/dts/bindings/spi/nordic,nrf-spi.yaml index 1ecb861cd28..7bc2e660df4 100644 --- a/dts/bindings/spi/nordic,nrf-spi.yaml +++ b/dts/bindings/spi/nordic,nrf-spi.yaml @@ -1,33 +1,10 @@ -# Copyright (c) 2018 Nordic Semiconductor ASA +# Copyright (c) 2019 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -title: Nordic nRF Family SPI Master node +title: Nordic nRF family SPI -description: > - This is a representation of the Nordic nRF SPI node +description: Nordic nRF family SPI (SPI master) compatible: "nordic,nrf-spi" -include: spi-controller.yaml - -properties: - reg: - required: true - - interrupts: - required: true - - sck-pin: - type: int - required: true - description: SCK pin - - mosi-pin: - type: int - required: true - description: MOSI pin - - miso-pin: - type: int - required: true - description: MISO pin +include: nordic,nrf-spi-common.yaml diff --git a/dts/bindings/spi/nordic,nrf-spim.yaml b/dts/bindings/spi/nordic,nrf-spim.yaml new file mode 100644 index 00000000000..58ea30e1491 --- /dev/null +++ b/dts/bindings/spi/nordic,nrf-spim.yaml @@ -0,0 +1,10 @@ +# Copyright (c) 2019 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +title: Nordic nRF family SPIM + +description: Nordic nRF family SPIM (SPI master with EasyDMA) + +compatible: "nordic,nrf-spim" + +include: nordic,nrf-spi-common.yaml diff --git a/dts/bindings/spi/nordic,nrf-spis.yaml b/dts/bindings/spi/nordic,nrf-spis.yaml index 556b5c17200..bb675982331 100644 --- a/dts/bindings/spi/nordic,nrf-spis.yaml +++ b/dts/bindings/spi/nordic,nrf-spis.yaml @@ -1,37 +1,15 @@ # Copyright (c) 2019 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -title: Nordic nRF Family SPIS (SPI Slave) +title: Nordic nRF family SPIS -description: > - This is a representation of the Nordic nRF SPIS node +description: Nordic nRF family SPIS (SPI slave with EasyDMA) compatible: "nordic,nrf-spis" -include: spi-controller.yaml +include: nordic,nrf-spi-common.yaml properties: - reg: - required: true - - interrupts: - required: true - - sck-pin: - type: int - required: true - description: SCK pin - - mosi-pin: - type: int - required: true - description: MOSI pin - - miso-pin: - type: int - required: true - description: MISO pin - csn-pin: type: int required: true