From f8d6787ea6b3aea6230ff8a3d3f938ba1ab09382 Mon Sep 17 00:00:00 2001 From: Mega Mind <68985133+megamind4089@users.noreply.github.com> Date: Wed, 14 Oct 2020 08:16:14 +0800 Subject: [PATCH] Refactor nRFMicro dts files --- app/boards/arm/nrfmicro/nrfmicro.dtsi | 90 +++++++++++++++++++ app/boards/arm/nrfmicro/nrfmicro_11.dts | 83 +---------------- .../arm/nrfmicro/nrfmicro_11_flipped.dts | 83 +---------------- app/boards/arm/nrfmicro/nrfmicro_13.dts | 83 +---------------- 4 files changed, 93 insertions(+), 246 deletions(-) create mode 100644 app/boards/arm/nrfmicro/nrfmicro.dtsi diff --git a/app/boards/arm/nrfmicro/nrfmicro.dtsi b/app/boards/arm/nrfmicro/nrfmicro.dtsi new file mode 100644 index 00000000..90f97d7f --- /dev/null +++ b/app/boards/arm/nrfmicro/nrfmicro.dtsi @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + model = "nrfmicro"; + compatible = "joric,nrfmicro"; + + chosen { + zephyr,code-partition = &code_partition; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; + + leds { + compatible = "gpio-leds"; + blue_led: led_0 { + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + label = "Blue LED"; + }; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&i2c0 { + compatible = "nordic,nrf-twi"; + sda-pin = <15>; + scl-pin = <17>; +}; + +&uart0 { + compatible = "nordic,nrf-uarte"; + status = "okay"; + current-speed = <115200>; + tx-pin = <39>; + rx-pin = <34>; + rts-pin = <33>; + cts-pin = <12>; +}; + +&usbd { + status = "okay"; +}; + + +&flash0 { + /* + * For more information, see: + * http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html + */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "adafruit_boot"; + reg = <0x000000000 0x0000C000>; + }; + code_partition: partition@26000 { + label = "code_partition"; + reg = <0x00026000 0x000d2000>; + }; + + /* + * The flash starting at 0x000f8000 and ending at + * 0x000fffff is reserved for use by the application. + */ + + /* + * Storage partition will be used by FCB/LittleFS/NVS + * if enabled. + */ + storage_partition: partition@f8000 { + label = "storage"; + reg = <0x000f8000 0x00008000>; + }; + }; +}; diff --git a/app/boards/arm/nrfmicro/nrfmicro_11.dts b/app/boards/arm/nrfmicro/nrfmicro_11.dts index 87c650e1..177fb965 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_11.dts +++ b/app/boards/arm/nrfmicro/nrfmicro_11.dts @@ -5,94 +5,13 @@ */ /dts-v1/; -#include +#include "nrfmicro.dtsi" #include "arduino_pro_micro_pins.dtsi" / { - model = "nrfmicro"; - compatible = "joric,nrfmicro"; - - chosen { - zephyr,code-partition = &code_partition; - zephyr,sram = &sram0; - zephyr,flash = &flash0; - }; - - leds { - compatible = "gpio-leds"; - blue_led: led_0 { - gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; - label = "Blue LED"; - }; - }; - ext-power { compatible = "zmk,ext-power-generic"; label = "EXT_POWER"; control-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; }; }; - -&gpio0 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; - -&i2c0 { - compatible = "nordic,nrf-twi"; - sda-pin = <15>; - scl-pin = <17>; -}; - -&uart0 { - compatible = "nordic,nrf-uarte"; - status = "okay"; - current-speed = <115200>; - tx-pin = <39>; - rx-pin = <34>; - rts-pin = <33>; - cts-pin = <12>; -}; - -&usbd { - status = "okay"; -}; - - -&flash0 { - /* - * For more information, see: - * http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html - */ - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "adafruit_boot"; - reg = <0x000000000 0x0000C000>; - }; - code_partition: partition@26000 { - label = "code_partition"; - reg = <0x00026000 0x000d2000>; - }; - - /* - * The flash starting at 0x000f8000 and ending at - * 0x000fffff is reserved for use by the application. - */ - - /* - * Storage partition will be used by FCB/LittleFS/NVS - * if enabled. - */ - storage_partition: partition@f8000 { - label = "storage"; - reg = <0x000f8000 0x00008000>; - }; - }; -}; diff --git a/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts b/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts index ea15b819..4245ed80 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts +++ b/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts @@ -5,94 +5,13 @@ */ /dts-v1/; -#include +#include "nrfmicro.dtsi" #include "arduino_pro_micro_pins_flipped.dtsi" / { - model = "nrfmicro"; - compatible = "joric,nrfmicro"; - - chosen { - zephyr,code-partition = &code_partition; - zephyr,sram = &sram0; - zephyr,flash = &flash0; - }; - - leds { - compatible = "gpio-leds"; - blue_led: led_0 { - gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; - label = "Blue LED"; - }; - }; - ext-power { compatible = "zmk,ext-power-generic"; label = "EXT_POWER"; control-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; }; }; - -&gpio0 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; - -&i2c0 { - compatible = "nordic,nrf-twi"; - sda-pin = <30>; - scl-pin = <31>; -}; - -&uart0 { - compatible = "nordic,nrf-uarte"; - status = "okay"; - current-speed = <115200>; - tx-pin = <39>; - rx-pin = <34>; - rts-pin = <33>; - cts-pin = <12>; -}; - -&usbd { - status = "okay"; -}; - - -&flash0 { - /* - * For more information, see: - * http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html - */ - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "adafruit_boot"; - reg = <0x000000000 0x0000C000>; - }; - code_partition: partition@26000 { - label = "code_partition"; - reg = <0x00026000 0x000d2000>; - }; - - /* - * The flash starting at 0x000f8000 and ending at - * 0x000fffff is reserved for use by the application. - */ - - /* - * Storage partition will be used by FCB/LittleFS/NVS - * if enabled. - */ - storage_partition: partition@f8000 { - label = "storage"; - reg = <0x000f8000 0x00008000>; - }; - }; -}; diff --git a/app/boards/arm/nrfmicro/nrfmicro_13.dts b/app/boards/arm/nrfmicro/nrfmicro_13.dts index 5ae11ba0..a431b66a 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_13.dts +++ b/app/boards/arm/nrfmicro/nrfmicro_13.dts @@ -5,27 +5,10 @@ */ /dts-v1/; -#include +#include "nrfmicro.dtsi" #include "arduino_pro_micro_pins.dtsi" / { - model = "nrfmicro"; - compatible = "joric,nrfmicro"; - - chosen { - zephyr,code-partition = &code_partition; - zephyr,sram = &sram0; - zephyr,flash = &flash0; - }; - - leds { - compatible = "gpio-leds"; - blue_led: led_0 { - gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; - label = "Blue LED"; - }; - }; - ext-power { compatible = "zmk,ext-power-generic"; label = "EXT_POWER"; @@ -44,67 +27,3 @@ &adc { status = "okay"; }; - -&gpio0 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; - -&i2c0 { - compatible = "nordic,nrf-twi"; - sda-pin = <15>; - scl-pin = <17>; -}; - -&uart0 { - compatible = "nordic,nrf-uarte"; - status = "okay"; - current-speed = <115200>; - tx-pin = <39>; - rx-pin = <34>; - rts-pin = <33>; - cts-pin = <12>; -}; - -&usbd { - status = "okay"; -}; - - -&flash0 { - /* - * For more information, see: - * http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html - */ - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "adafruit_boot"; - reg = <0x000000000 0x0000C000>; - }; - code_partition: partition@26000 { - label = "code_partition"; - reg = <0x00026000 0x000d2000>; - }; - - /* - * The flash starting at 0x000f8000 and ending at - * 0x000fffff is reserved for use by the application. - */ - - /* - * Storage partition will be used by FCB/LittleFS/NVS - * if enabled. - */ - storage_partition: partition@f8000 { - label = "storage"; - reg = <0x000f8000 0x00008000>; - }; - }; -};