From b09f63ac54324606ac82cb80f21ab3d6b19c9299 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 11 Apr 2017 12:55:16 -0500 Subject: [PATCH] arm: dts: nrf: Add Device Tree Support for nRF52840 SoC & boards Add device tree support for nRF52840 SoC and PCA10056-DK board. This is minimal support for memory, flash, and UART. For the nRF52840 we select between "nordic,nrf-uarte", "nordic,nrf-uart" support for each board. Change-Id: I1c377e0cb97ff4716ea5489fffaa7c0e2b34d18a Signed-off-by: Kumar Gala --- .../nrf52840_pca10056_defconfig | 3 ++ dts/arm/Makefile | 1 + dts/arm/nordic/nrf52840.dtsi | 38 +++++++++++++++++++ dts/arm/nrf52840_pca10056.dts | 26 +++++++++++++ dts/arm/nrf52840_pca10056.fixup | 3 ++ 5 files changed, 71 insertions(+) create mode 100644 dts/arm/nordic/nrf52840.dtsi create mode 100644 dts/arm/nrf52840_pca10056.dts create mode 100644 dts/arm/nrf52840_pca10056.fixup diff --git a/boards/arm/nrf52840_pca10056/nrf52840_pca10056_defconfig b/boards/arm/nrf52840_pca10056/nrf52840_pca10056_defconfig index 9ae816a6e18..daabd297e85 100644 --- a/boards/arm/nrf52840_pca10056/nrf52840_pca10056_defconfig +++ b/boards/arm/nrf52840_pca10056/nrf52840_pca10056_defconfig @@ -18,3 +18,6 @@ CONFIG_GPIO_AS_PINRESET=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 2fd1467f4bf..5f21eaaf55e 100644 --- a/dts/arm/Makefile +++ b/dts/arm/Makefile @@ -21,6 +21,7 @@ dtb-$(CONFIG_BOARD_STM32373C_EVAL) = stm32373c_eval.dts_compiled 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 always := $(dtb-y) endif diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi new file mode 100644 index 00000000000..fa13f3c5c54 --- /dev/null +++ b/dts/arm/nordic/nrf52840.dtsi @@ -0,0 +1,38 @@ +#include +#include + +/ { + cpus { + cpu@0 { + compatible = "arm,cortex-m4f"; + }; + }; + + flash0: flash { + reg = <0x00000000 DT_FLASH_SIZE>; + }; + + sram0: memory { + reg = <0x20000000 DT_SRAM_SIZE>; + }; + + soc { + uart0: uart@40002000 { + compatible = "nordic,nrf-uarte", "nordic,nrf-uart"; + reg = <0x40002000 0x1000>; + interrupts = <2 1>; + status = "disabled"; + }; + + uart1: uart@40028000 { + compatible = "nordic,nrf-uarte"; + reg = <0x40028000 0x1000>; + interrupts = <40 1>; + status = "disabled"; + }; + }; +}; + +&nvic { + arm,num-irq-priority-bits = <3>; +}; diff --git a/dts/arm/nrf52840_pca10056.dts b/dts/arm/nrf52840_pca10056.dts new file mode 100644 index 00000000000..20a9e83161b --- /dev/null +++ b/dts/arm/nrf52840_pca10056.dts @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2017 Linaro Limited + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include + +/ { + model = "Nordic PCA10056 Dev Kit"; + compatible = "nordic,pca10056-dk", "nordic,nrf52840-qiaa", + "nordic,nrf52840"; + + chosen { + zephyr,console = &uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; +}; + +&uart0 { + compatible = "nordic,nrf-uart"; + current-speed = <115200>; + status = "ok"; +}; diff --git a/dts/arm/nrf52840_pca10056.fixup b/dts/arm/nrf52840_pca10056.fixup new file mode 100644 index 00000000000..239d39e760d --- /dev/null +++ b/dts/arm/nrf52840_pca10056.fixup @@ -0,0 +1,3 @@ +#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V7M_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