Skip to content

Commit

Permalink
boards: arduino_due: Added DTS to the Arduino Due.
Browse files Browse the repository at this point in the history
Change-Id: I006f9d4080a1351534ede5cc601e43526c39aa83
Origin: Original
Signed-off-by: Justin Watson <[email protected]>
  • Loading branch information
fallrisk authored and galak committed May 4, 2017
1 parent 9b874d6 commit 95628a4
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 29 deletions.
29 changes: 0 additions & 29 deletions arch/arm/soc/atmel_sam/sam3x/Kconfig.defconfig.series
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
1 change: 1 addition & 0 deletions boards/arm/arduino_due/arduino_due_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions dts/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ 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
dtb-$(CONFIG_BOARD_QEMU_CORTEX_M3) = qemu_cortex_m3.dts_compiled
dtb-$(CONFIG_BOARD_ARDUINO_DUE) = arduino_due.dts_compiled

always := $(dtb-y)
endif
22 changes: 22 additions & 0 deletions dts/arm/arduino_due.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/dts-v1/;

#include <atmel/sam3x.dtsi>

/ {
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>;
};
8 changes: 8 additions & 0 deletions dts/arm/arduino_due.fixup
Original file line number Diff line number Diff line change
@@ -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
38 changes: 38 additions & 0 deletions dts/arm/atmel/sam3x.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2017 Justin Watson
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <arm/armv7-m.dtsi>

/ {
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>;
};
30 changes: 30 additions & 0 deletions dts/arm/yaml/atmel,sam3x-uart.yaml
Original file line number Diff line number Diff line change
@@ -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
...

0 comments on commit 95628a4

Please sign in to comment.