From 44c421b4a33a31f5afcf024827b58158276bf19c Mon Sep 17 00:00:00 2001 From: fallrisk Date: Fri, 28 Apr 2017 09:07:20 -0700 Subject: [PATCH] boards: arduino_due: Added DTS to the Arduino Due. Change-Id: I006f9d4080a1351534ede5cc601e43526c39aa83 Origin: Original Signed-off-by: Justin Watson --- .../atmel_sam/sam3x/Kconfig.defconfig.series | 29 -------------- boards/arm/arduino_due/arduino_due_defconfig | 1 + dts/arm/Makefile | 1 + dts/arm/arduino_due.dts | 22 +++++++++++ dts/arm/arduino_due.fixup | 8 ++++ dts/arm/atmel/sam3x.dtsi | 38 +++++++++++++++++++ dts/arm/yaml/atmel,sam3x-uart.yaml | 30 +++++++++++++++ 7 files changed, 100 insertions(+), 29 deletions(-) create mode 100644 dts/arm/arduino_due.dts create mode 100644 dts/arm/arduino_due.fixup create mode 100644 dts/arm/atmel/sam3x.dtsi create mode 100644 dts/arm/yaml/atmel,sam3x-uart.yaml diff --git a/arch/arm/soc/atmel_sam/sam3x/Kconfig.defconfig.series b/arch/arm/soc/atmel_sam/sam3x/Kconfig.defconfig.series index 8ed2fecfcf4..f51572e1c4e 100644 --- a/arch/arm/soc/atmel_sam/sam3x/Kconfig.defconfig.series +++ b/arch/arm/soc/atmel_sam/sam3x/Kconfig.defconfig.series @@ -16,10 +16,6 @@ config SOC_PART_NUMBER string default sam3x8e if SOC_PART_NUMBER_SAM3X8E -config NUM_IRQ_PRIO_BITS - int - default 3 - # # SAM3 family has total 45 peripherals capable of # generating interrupts. @@ -32,29 +28,4 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC int default 84000000 -# -# SRAM address depends on the processor. -# -# SAM3X8E has two SRAM banks: -# 64K @ 0x20000000 -# 32K @ 0x20080000 -# The first 64K is mirrored at 0x20070000 -# to provide one continuous 96K block. -# -config SRAM_SIZE - default 96 if SOC_PART_NUMBER_SAM3X8E - -config SRAM_BASE_ADDRESS - default 0x20000000 if !SOC_PART_NUMBER_SAM3X8E - default 0x20070000 if SOC_PART_NUMBER_SAM3X8E - -# -# Atmel SAM3X family has flash starting @ 0x00080000. -# -config FLASH_SIZE - default 512 if SOC_PART_NUMBER_SAM3X8E - -config FLASH_BASE_ADDRESS - default 0x00080000 - endif # SOC_SERIES_SAM3X diff --git a/boards/arm/arduino_due/arduino_due_defconfig b/boards/arm/arduino_due/arduino_due_defconfig index 73b61fd8844..52c55efa4ab 100644 --- a/boards/arm/arduino_due/arduino_due_defconfig +++ b/boards/arm/arduino_due/arduino_due_defconfig @@ -11,3 +11,4 @@ CONFIG_UART_ATMEL_SAM3=y CONFIG_SOC_ATMEL_SAM3X_EXT_MAINCK=y CONFIG_PINMUX=y CONFIG_WATCHDOG=n +CONFIG_HAS_DTS=y diff --git a/dts/arm/Makefile b/dts/arm/Makefile index 0fa572c881b..8582a67b04f 100644 --- a/dts/arm/Makefile +++ b/dts/arm/Makefile @@ -30,6 +30,7 @@ dtb-$(CONFIG_BOARD_NRF51_PCA10028) = nrf51_pca10028.dts_compiled dtb-$(CONFIG_BOARD_QUARK_SE_C1000_BLE) = quark_se_c1000_ble.dts_compiled dtb-$(CONFIG_BOARD_QEMU_CORTEX_M3) = qemu_cortex_m3.dts_compiled dtb-$(CONFIG_BOARD_SAM_E70_XPLAINED) = sam_e70_xplained.dts_compiled +dtb-$(CONFIG_BOARD_ARDUINO_DUE) = arduino_due.dts_compiled always := $(dtb-y) endif diff --git a/dts/arm/arduino_due.dts b/dts/arm/arduino_due.dts new file mode 100644 index 00000000000..0b95b66c295 --- /dev/null +++ b/dts/arm/arduino_due.dts @@ -0,0 +1,22 @@ +/dts-v1/; + +#include + +/ { + model = "Arduino Due with an Atmel SAM3X8E SoC"; + compatible = "arduino,due", "atmel,sam3x8e", "atmel,sam3x"; + + aliases { + uart_0 = &uart0; + }; + + chosen { + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; +}; + +&uart0 { + status = "ok"; + current-speed = <115200>; +}; diff --git a/dts/arm/arduino_due.fixup b/dts/arm/arduino_due.fixup new file mode 100644 index 00000000000..1a411fa78f8 --- /dev/null +++ b/dts/arm/arduino_due.fixup @@ -0,0 +1,8 @@ +/* This file is a temporary workaround for mapping of the generated information + * to the current driver definitions. This will be removed when the drivers + * are modified to handle the generated information, or the mapping of + * generated data matches the driver definitions. + */ + + +#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS diff --git a/dts/arm/atmel/sam3x.dtsi b/dts/arm/atmel/sam3x.dtsi new file mode 100644 index 00000000000..d5d7f561983 --- /dev/null +++ b/dts/arm/atmel/sam3x.dtsi @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017 Justin Watson + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + cpus { + cpu@0 { + compatible = "arm,cortex-m4"; + }; + }; + + sram0: memory { + compatible = "sram"; + reg = <0x20070000 0x18000>; + }; + + flash0: flash { + compatible = "flash"; + reg = <0x00080000 0x80000>; + }; + + soc { + uart0: uart@400E0800 { + compatible = "atmel,sam3x-uart"; + reg = <0x400E0800 0x124>; + interrupts = <8 0>; + status = "disabled"; + }; + }; +}; + +&nvic { + arm,num-irq-priority-bits = <3>; +}; diff --git a/dts/arm/yaml/atmel,sam3x-uart.yaml b/dts/arm/yaml/atmel,sam3x-uart.yaml new file mode 100644 index 00000000000..cbe85bf2cdd --- /dev/null +++ b/dts/arm/yaml/atmel,sam3x-uart.yaml @@ -0,0 +1,30 @@ +--- +title: SAM3X UART +id: atmel,sam3x-uart +version: 0.1 + +description: > + This binding gives a base representation of the SAM3X UART + +inherits: + - !include uart.yaml + +properties: + - compatible: + type: string + category: required + description: compatible strings + constraint: "atmel,sam3x-uart" + + - reg: + type: array + description: mmio register space + generation: define + category: required + + - interrupts: + type: array + category: required + description: required interrupts + generation: define +...