diff --git a/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.nrf51822_QFAA b/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.nrf51822_QFAA index 706c756fcc2..2f3204c78cc 100644 --- a/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.nrf51822_QFAA +++ b/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.nrf51822_QFAA @@ -12,11 +12,13 @@ config SOC string default nRF51822_QFAA +if !HAS_DTS config SRAM_SIZE default 16 config FLASH_SIZE default 256 +endif config ISR_STACK_SIZE default 640 diff --git a/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.nrf51822_QFAB b/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.nrf51822_QFAB index e3476627a64..c5d75bd804d 100644 --- a/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.nrf51822_QFAB +++ b/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.nrf51822_QFAB @@ -12,11 +12,13 @@ config SOC string default nRF51822_QFAB +if !HAS_DTS config SRAM_SIZE default 16 config FLASH_SIZE default 128 +endif config ISR_STACK_SIZE default 640 diff --git a/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.nrf51822_QFAC b/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.nrf51822_QFAC index 5e669445746..b8d85f1d323 100644 --- a/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.nrf51822_QFAC +++ b/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.nrf51822_QFAC @@ -12,10 +12,12 @@ config SOC string default nRF51822_QFAC +if !HAS_DTS config SRAM_SIZE default 32 config FLASH_SIZE default 256 +endif endif # SOC_NRF51822_QFAC diff --git a/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.series b/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.series index bf697eb5de4..d7d7c121c92 100644 --- a/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.series +++ b/arch/arm/soc/nordic_nrf5/nrf51/Kconfig.defconfig.series @@ -19,19 +19,21 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC config SYS_POWER_MANAGEMENT default y +if !HAS_DTS config SRAM_BASE_ADDRESS default 0x20000000 config FLASH_BASE_ADDRESS default 0x00000000 -config NUM_IRQS - int - default 26 - config NUM_IRQ_PRIO_BITS int default 2 +endif + +config NUM_IRQS + int + default 26 if SENSOR diff --git a/boards/arm/arduino_101_ble/arduino_101_ble_defconfig b/boards/arm/arduino_101_ble/arduino_101_ble_defconfig index 95291a95c1f..8d7cbcc213c 100644 --- a/boards/arm/arduino_101_ble/arduino_101_ble_defconfig +++ b/boards/arm/arduino_101_ble/arduino_101_ble_defconfig @@ -11,3 +11,6 @@ CONFIG_UART_NRF5=y # bluetooth CONFIG_BLUETOOTH=y CONFIG_BLUETOOTH_CONTROLLER=y + +#enable DTS +CONFIG_HAS_DTS=y diff --git a/boards/arm/bbc_microbit/bbc_microbit_defconfig b/boards/arm/bbc_microbit/bbc_microbit_defconfig index da7eef89a77..58a94228029 100644 --- a/boards/arm/bbc_microbit/bbc_microbit_defconfig +++ b/boards/arm/bbc_microbit/bbc_microbit_defconfig @@ -19,3 +19,6 @@ CONFIG_UART_CONSOLE=y # bluetooth CONFIG_BLUETOOTH=y CONFIG_BLUETOOTH_CONTROLLER=y + +#enable DTS +CONFIG_HAS_DTS=y diff --git a/boards/arm/curie_ble/curie_ble_defconfig b/boards/arm/curie_ble/curie_ble_defconfig index 2ebcb393c03..0183def5a96 100644 --- a/boards/arm/curie_ble/curie_ble_defconfig +++ b/boards/arm/curie_ble/curie_ble_defconfig @@ -11,3 +11,6 @@ CONFIG_UART_NRF5=y # bluetooth CONFIG_BLUETOOTH=y CONFIG_BLUETOOTH_CONTROLLER=y + +#enable DTS +CONFIG_HAS_DTS=y diff --git a/boards/arm/nrf51_blenano/nrf51_blenano_defconfig b/boards/arm/nrf51_blenano/nrf51_blenano_defconfig index c7af5b93bdb..185a42810b0 100644 --- a/boards/arm/nrf51_blenano/nrf51_blenano_defconfig +++ b/boards/arm/nrf51_blenano/nrf51_blenano_defconfig @@ -15,3 +15,6 @@ CONFIG_UART_CONSOLE=y # bluetooth CONFIG_BLUETOOTH=y CONFIG_BLUETOOTH_CONTROLLER=y + +#enable DTS +CONFIG_HAS_DTS=y diff --git a/boards/arm/nrf51_pca10028/nrf51_pca10028_defconfig b/boards/arm/nrf51_pca10028/nrf51_pca10028_defconfig index 147a800f298..120e8430b3c 100644 --- a/boards/arm/nrf51_pca10028/nrf51_pca10028_defconfig +++ b/boards/arm/nrf51_pca10028/nrf51_pca10028_defconfig @@ -15,3 +15,6 @@ CONFIG_UART_CONSOLE=y # bluetooth CONFIG_BLUETOOTH=y CONFIG_BLUETOOTH_CONTROLLER=y + +#enable DTS +CONFIG_HAS_DTS=y diff --git a/boards/arm/quark_se_c1000_ble/quark_se_c1000_ble_defconfig b/boards/arm/quark_se_c1000_ble/quark_se_c1000_ble_defconfig index 0f3a6e6510e..4f08c36f5b4 100644 --- a/boards/arm/quark_se_c1000_ble/quark_se_c1000_ble_defconfig +++ b/boards/arm/quark_se_c1000_ble/quark_se_c1000_ble_defconfig @@ -11,3 +11,6 @@ CONFIG_UART_NRF5=y # bluetooth CONFIG_BLUETOOTH=y CONFIG_BLUETOOTH_CONTROLLER=y + +#enable DTS +CONFIG_HAS_DTS=y diff --git a/dts/arm/Makefile b/dts/arm/Makefile index 5f21eaaf55e..16b2af2141a 100644 --- a/dts/arm/Makefile +++ b/dts/arm/Makefile @@ -22,6 +22,12 @@ dtb-$(CONFIG_BOARD_96B_NITROGEN) = 96b_nitrogen.dts_compiled dtb-$(CONFIG_BOARD_NRF52_PCA10040) = nrf52_pca10040.dts_compiled dtb-$(CONFIG_BOARD_NRF52_BLENANO2) = nrf52_blenano2.dts_compiled dtb-$(CONFIG_BOARD_NRF52840_PCA10056) = nrf52840_pca10056.dts_compiled +dtb-$(CONFIG_BOARD_ARDUINO_101_BLE) = arduino_101_ble.dts_compiled +dtb-$(CONFIG_BOARD_BBC_MICROBIT) = bbc_microbit.dts_compiled +dtb-$(CONFIG_BOARD_CURIE_BLE) = curie_ble.dts_compiled +dtb-$(CONFIG_BOARD_NRF51_BLENANO) = nrf51_blenano.dts_compiled +dtb-$(CONFIG_BOARD_NRF51_PCA10028) = nrf51_pca10028.dts_compiled +dtb-$(CONFIG_BOARD_QUARK_SE_C1000_BLE) = quark_se_c1000_ble.dts_compiled always := $(dtb-y) endif diff --git a/dts/arm/arduino_101_ble.dts b/dts/arm/arduino_101_ble.dts new file mode 100644 index 00000000000..89c722f876e --- /dev/null +++ b/dts/arm/arduino_101_ble.dts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2017 Linaro Limited + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include + +/ { + model = "Arduino 101-BLE"; + compatible = "arduino,101-ble", "nordic,nrf51822-qfaa", + "nordic,nrf51822"; + + chosen { + zephyr,console = &uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; +}; + +&uart0 { + current-speed = <1000000>; + status = "ok"; +}; diff --git a/dts/arm/arduino_101_ble.fixup b/dts/arm/arduino_101_ble.fixup new file mode 100644 index 00000000000..afcf87a74b5 --- /dev/null +++ b/dts/arm/arduino_101_ble.fixup @@ -0,0 +1,3 @@ +#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS +#define CONFIG_UART_NRF5_IRQ_PRI NORDIC_NRF_UART_40002000_IRQ_0_PRIORITY +#define CONFIG_UART_NRF5_BAUD_RATE NORDIC_NRF_UART_40002000_CURRENT_SPEED diff --git a/dts/arm/bbc_microbit.dts b/dts/arm/bbc_microbit.dts new file mode 100644 index 00000000000..672ee3a134a --- /dev/null +++ b/dts/arm/bbc_microbit.dts @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2017 Linaro Limited + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include + +/ { + model = "BBC Micro:bit"; + compatible = "bbc,microbit", "nordic,nrf51822-qfaa", "nordic,nrf51822"; + + chosen { + zephyr,console = &uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; +}; + +&uart0 { + status = "ok"; + current-speed = <115200>; +}; diff --git a/dts/arm/bbc_microbit.fixup b/dts/arm/bbc_microbit.fixup new file mode 100644 index 00000000000..afcf87a74b5 --- /dev/null +++ b/dts/arm/bbc_microbit.fixup @@ -0,0 +1,3 @@ +#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS +#define CONFIG_UART_NRF5_IRQ_PRI NORDIC_NRF_UART_40002000_IRQ_0_PRIORITY +#define CONFIG_UART_NRF5_BAUD_RATE NORDIC_NRF_UART_40002000_CURRENT_SPEED diff --git a/dts/arm/curie_ble.dts b/dts/arm/curie_ble.dts new file mode 100644 index 00000000000..2df9fff476e --- /dev/null +++ b/dts/arm/curie_ble.dts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2017 Linaro Limited + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include + +/ { + model = "Intel Curie BLE"; + compatible = "intel,curie-ble", "nordic,nrf51822-qfaa", + "nordic,nrf51822"; + + chosen { + zephyr,console = &uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; +}; + +&uart0 { + current-speed = <1000000>; + status = "ok"; +}; diff --git a/dts/arm/curie_ble.fixup b/dts/arm/curie_ble.fixup new file mode 100644 index 00000000000..afcf87a74b5 --- /dev/null +++ b/dts/arm/curie_ble.fixup @@ -0,0 +1,3 @@ +#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS +#define CONFIG_UART_NRF5_IRQ_PRI NORDIC_NRF_UART_40002000_IRQ_0_PRIORITY +#define CONFIG_UART_NRF5_BAUD_RATE NORDIC_NRF_UART_40002000_CURRENT_SPEED diff --git a/dts/arm/nordic/nrf51822.dtsi b/dts/arm/nordic/nrf51822.dtsi new file mode 100644 index 00000000000..f7445e5a850 --- /dev/null +++ b/dts/arm/nordic/nrf51822.dtsi @@ -0,0 +1,31 @@ +#include +#include + +/ { + cpus { + cpu@0 { + compatible = "arm,cortex-m0"; + }; + }; + + flash0: flash { + reg = <0x00000000 DT_FLASH_SIZE>; + }; + + sram0: memory { + reg = <0x20000000 DT_SRAM_SIZE>; + }; + + soc { + uart0: uart@40002000 { + compatible = "nordic,nrf-uart"; + reg = <0x40002000 0x1000>; + interrupts = <2 1>; + status = "disabled"; + }; + }; +}; + +&nvic { + arm,num-irq-priority-bits = <2>; +}; diff --git a/dts/arm/nrf51_blenano.dts b/dts/arm/nrf51_blenano.dts new file mode 100644 index 00000000000..c756d584b83 --- /dev/null +++ b/dts/arm/nrf51_blenano.dts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2017 Linaro Limited + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include + +/ { + model = "Redbear BLE Nano"; + compatible = "redbear,blenano", "nordic,nrf51822-qfaa", + "nordic,nrf51822"; + + chosen { + zephyr,console = &uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; +}; + +&uart0 { + current-speed = <115200>; + status = "ok"; +}; diff --git a/dts/arm/nrf51_blenano.fixup b/dts/arm/nrf51_blenano.fixup new file mode 100644 index 00000000000..afcf87a74b5 --- /dev/null +++ b/dts/arm/nrf51_blenano.fixup @@ -0,0 +1,3 @@ +#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS +#define CONFIG_UART_NRF5_IRQ_PRI NORDIC_NRF_UART_40002000_IRQ_0_PRIORITY +#define CONFIG_UART_NRF5_BAUD_RATE NORDIC_NRF_UART_40002000_CURRENT_SPEED diff --git a/dts/arm/nrf51_pca10028.dts b/dts/arm/nrf51_pca10028.dts new file mode 100644 index 00000000000..90a9b2d63c5 --- /dev/null +++ b/dts/arm/nrf51_pca10028.dts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2017 Linaro Limited + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include + +/ { + model = "Nordic PCA10028 Dev Kit"; + compatible = "nordic,pca10028-dk", "nordic,nrf51822-qfac", + "nordic,nrf51822"; + + chosen { + zephyr,console = &uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; +}; + +&uart0 { + current-speed = <115200>; + status = "ok"; +}; diff --git a/dts/arm/nrf51_pca10028.fixup b/dts/arm/nrf51_pca10028.fixup new file mode 100644 index 00000000000..afcf87a74b5 --- /dev/null +++ b/dts/arm/nrf51_pca10028.fixup @@ -0,0 +1,3 @@ +#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS +#define CONFIG_UART_NRF5_IRQ_PRI NORDIC_NRF_UART_40002000_IRQ_0_PRIORITY +#define CONFIG_UART_NRF5_BAUD_RATE NORDIC_NRF_UART_40002000_CURRENT_SPEED diff --git a/dts/arm/quark_se_c1000_ble.dts b/dts/arm/quark_se_c1000_ble.dts new file mode 100644 index 00000000000..54d7b158a6b --- /dev/null +++ b/dts/arm/quark_se_c1000_ble.dts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2017 Linaro Limited + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include + +/ { + model = "Intel Quark SE C1000 BLE"; + compatible = "intel,quark-se-c1000-ble", "nordic,nrf51822-qfaa", + "nordic,nrf51822"; + + chosen { + zephyr,console = &uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; +}; + +&uart0 { + status = "ok"; + current-speed = <1000000>; +}; diff --git a/dts/arm/quark_se_c1000_ble.fixup b/dts/arm/quark_se_c1000_ble.fixup new file mode 100644 index 00000000000..afcf87a74b5 --- /dev/null +++ b/dts/arm/quark_se_c1000_ble.fixup @@ -0,0 +1,3 @@ +#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS +#define CONFIG_UART_NRF5_IRQ_PRI NORDIC_NRF_UART_40002000_IRQ_0_PRIORITY +#define CONFIG_UART_NRF5_BAUD_RATE NORDIC_NRF_UART_40002000_CURRENT_SPEED