dts: arm: atmel: Introduce sam4l SoC

Introduce SAM4L SoC device tree definitions.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
This commit is contained in:
Gerson Fernando Budke 2020-02-18 18:04:45 -03:00 committed by Maureen Helm
parent 7b0d7906ab
commit 18e608ee55
7 changed files with 346 additions and 0 deletions

View file

@ -275,6 +275,7 @@
/drivers/wifi/eswifi/ @loicpoulain /drivers/wifi/eswifi/ @loicpoulain
/dts/arc/ @abrodkin @ruuddw @iriszzw /dts/arc/ @abrodkin @ruuddw @iriszzw
/dts/arm/atmel/sam4e* @nandojve /dts/arm/atmel/sam4e* @nandojve
/dts/arm/atmel/sam4l* @nandojve
/dts/arm/atmel/samr21.dtsi @benpicco /dts/arm/atmel/samr21.dtsi @benpicco
/dts/arm/atmel/sam*5*.dtsi @benpicco /dts/arm/atmel/sam*5*.dtsi @benpicco
/dts/arm/atmel/same70* @nandojve /dts/arm/atmel/same70* @nandojve

View file

@ -13,6 +13,7 @@
#define PERIPH_e 4 #define PERIPH_e 4
#define PERIPH_f 5 #define PERIPH_f 5
#define PERIPH_g 6 #define PERIPH_g 6
#define PERIPH_h 7
/* Create a pincfg device tree node: /* Create a pincfg device tree node:
* *
@ -40,4 +41,9 @@
p##port##pin##periph##_##inst##_##signal { \ p##port##pin##periph##_##inst##_##signal { \
atmel,pins = < &pio##port pin PERIPH_##periph >; } atmel,pins = < &pio##port pin PERIPH_##periph >; }
#define DT_ATMEL_GPIO(inst, signal, port, pin, periph) \
p##port##pin##periph##_##inst##_##signal: \
p##port##pin##periph##_##inst##_##signal { \
atmel,pins = < &gpio##port pin PERIPH_##periph >; }
#endif /* PINCTRL_ATMEL_SAM_H_ */ #endif /* PINCTRL_ATMEL_SAM_H_ */

View file

@ -0,0 +1,109 @@
/*
* Copyright (c) 2020 Gerson Fernando Budke <nandojve@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "pinctrl_atmel_sam.h"
/ {
soc {
pinctrl@400e1000 {
/* instance, signal, pio, pin, peripheral */
DT_ATMEL_GPIO(spi, miso, a, 3, b);
DT_ATMEL_GPIO(spi, miso, a, 21, a);
DT_ATMEL_GPIO(spi, miso, a, 27, a);
DT_ATMEL_GPIO(spi, miso, b, 14, b);
DT_ATMEL_GPIO(spi, miso, c, 4, a);
DT_ATMEL_GPIO(spi, miso, c, 28, b);
DT_ATMEL_GPIO(spi, mosi, a, 22, a);
DT_ATMEL_GPIO(spi, mosi, a, 28, a);
DT_ATMEL_GPIO(spi, mosi, b, 15, b);
DT_ATMEL_GPIO(spi, mosi, c, 5, a);
DT_ATMEL_GPIO(spi, mosi, c, 29, b);
DT_ATMEL_GPIO(spi, npcs0, a, 2, b);
DT_ATMEL_GPIO(spi, npcs0, a, 24, a);
DT_ATMEL_GPIO(spi, npcs0, a, 30, a);
DT_ATMEL_GPIO(spi, npcs0, c, 3, a);
DT_ATMEL_GPIO(spi, npcs0, c, 31, b);
DT_ATMEL_GPIO(spi, npcs1, c, 13, c);
DT_ATMEL_GPIO(spi, npcs1, a, 31, a);
DT_ATMEL_GPIO(spi, npcs1, b, 13, b);
DT_ATMEL_GPIO(spi, npcs1, c, 2, a);
DT_ATMEL_GPIO(spi, npcs2, a, 14, c);
DT_ATMEL_GPIO(spi, npcs2, b, 11, b);
DT_ATMEL_GPIO(spi, npcs2, c, 0, a);
DT_ATMEL_GPIO(spi, npcs3, a, 15, c);
DT_ATMEL_GPIO(spi, npcs3, b, 12, b);
DT_ATMEL_GPIO(spi, npcs3, c, 1, a);
DT_ATMEL_GPIO(spi, sck, a, 23, a);
DT_ATMEL_GPIO(spi, sck, a, 29, a);
DT_ATMEL_GPIO(spi, sck, c, 6, a);
DT_ATMEL_GPIO(spi, sck, c, 30, b);
DT_ATMEL_GPIO(usart0, cts0, a, 9, a);
DT_ATMEL_GPIO(usart0, cts0, b, 11, a);
DT_ATMEL_GPIO(usart0, cts0, c, 2, b);
DT_ATMEL_GPIO(usart0, rts0, a, 6, b);
DT_ATMEL_GPIO(usart0, rts0, a, 8, a);
DT_ATMEL_GPIO(usart0, rts0, b, 12, a);
DT_ATMEL_GPIO(usart0, rts0, c, 1, b);
DT_ATMEL_GPIO(usart0, rxd0, a, 5, b);
DT_ATMEL_GPIO(usart0, rxd0, a, 11, a);
DT_ATMEL_GPIO(usart0, rxd0, b, 0, b);
DT_ATMEL_GPIO(usart0, rxd0, b, 14, a);
DT_ATMEL_GPIO(usart0, rxd0, c, 2, c);
DT_ATMEL_GPIO(usart0, clk0, a, 4, b);
DT_ATMEL_GPIO(usart0, clk0, a, 10, a);
DT_ATMEL_GPIO(usart0, clk0, b, 13, a);
DT_ATMEL_GPIO(usart0, clk0, c, 0, b);
DT_ATMEL_GPIO(usart0, txd0, a, 7, b);
DT_ATMEL_GPIO(usart0, txd0, a, 12, a);
DT_ATMEL_GPIO(usart0, txd0, b, 1, b);
DT_ATMEL_GPIO(usart0, txd0, b, 15, a);
DT_ATMEL_GPIO(usart0, txd0, c, 3, c);
DT_ATMEL_GPIO(usart1, cts1, a, 21, b);
DT_ATMEL_GPIO(usart1, rts1, a, 13, a);
DT_ATMEL_GPIO(usart1, rts1, b, 2, b);
DT_ATMEL_GPIO(usart1, rts1, c, 24, a);
DT_ATMEL_GPIO(usart1, rxd1, a, 15, a);
DT_ATMEL_GPIO(usart1, rxd1, b, 4, b);
DT_ATMEL_GPIO(usart1, rxd1, c, 26, a);
DT_ATMEL_GPIO(usart1, clk1, a, 14, a);
DT_ATMEL_GPIO(usart1, clk1, b, 3, b);
DT_ATMEL_GPIO(usart1, clk1, c, 25, a);
DT_ATMEL_GPIO(usart1, txd1, a, 16, a);
DT_ATMEL_GPIO(usart1, txd1, b, 5, b);
DT_ATMEL_GPIO(usart1, txd1, c, 27, a);
DT_ATMEL_GPIO(usart2, cts2, a, 22, b);
DT_ATMEL_GPIO(usart2, cts2, c, 8, e);
DT_ATMEL_GPIO(usart2, rts2, a, 17, a);
DT_ATMEL_GPIO(usart2, rts2, c, 7, b);
DT_ATMEL_GPIO(usart2, rxd2, a, 19, a);
DT_ATMEL_GPIO(usart2, rxd2, a, 25, b);
DT_ATMEL_GPIO(usart2, rxd2, c, 11, b);
DT_ATMEL_GPIO(usart2, clk2, a, 18, a);
DT_ATMEL_GPIO(usart2, clk2, c, 8, b);
DT_ATMEL_GPIO(usart2, txd2, a, 20, a);
DT_ATMEL_GPIO(usart2, txd2, a, 26, b);
DT_ATMEL_GPIO(usart2, txd2, c, 12, b);
DT_ATMEL_GPIO(usart3, cts3, a, 28, e);
DT_ATMEL_GPIO(usart3, cts3, b, 7, a);
DT_ATMEL_GPIO(usart3, rts3, a, 27, e);
DT_ATMEL_GPIO(usart3, rts3, b, 6, a);
DT_ATMEL_GPIO(usart3, rts3, c, 13, b);
DT_ATMEL_GPIO(usart3, rts3, c, 30, a);
DT_ATMEL_GPIO(usart3, rxd3, a, 30, a);
DT_ATMEL_GPIO(usart3, rxd3, b, 9, a);
DT_ATMEL_GPIO(usart3, rxd3, c, 9, a);
DT_ATMEL_GPIO(usart3, rxd3, c, 28, a);
DT_ATMEL_GPIO(usart3, clk3, a, 29, e);
DT_ATMEL_GPIO(usart3, clk3, b, 8, a);
DT_ATMEL_GPIO(usart3, clk3, c, 14, b);
DT_ATMEL_GPIO(usart3, clk3, c, 31, a);
DT_ATMEL_GPIO(usart3, txd3, a, 31, e);
DT_ATMEL_GPIO(usart3, txd3, b, 10, a);
DT_ATMEL_GPIO(usart3, txd3, c, 10, b);
DT_ATMEL_GPIO(usart3, txd3, c, 29, a);
};
};
};

164
dts/arm/atmel/sam4l.dtsi Normal file
View file

@ -0,0 +1,164 @@
/*
* Copyright (c) 2020 Gerson Fernando Budke <nandojve@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <arm/armv7-m.dtsi>
#include <dt-bindings/i2c/i2c.h>
#include <dt-bindings/gpio/gpio.h>
#include "sam4l-pinctrl.dtsi"
/ {
chosen {
zephyr,flash-controller = &flashcalw;
zephyr,entropy = &trng;
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu0: cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-m4";
reg = <0>;
#address-cells = <1>;
#size-cells = <1>;
mpu: mpu@e000ed90 {
compatible = "arm,armv7m-mpu";
reg = <0xe000ed90 0x40>;
arm,num-mpu-regions = <8>;
};
};
};
sram0: memory@20000000 {
compatible = "mmio-sram";
};
/**
* HRAM1 are 4k SRAM that can be used by PicoCache or just extra
* memory available. The PicoCache will be keep disable to ensures
* deterministic behaviour. That way the extra memory can be
* exclusive for USB descriptors
*/
sram1: memory@21000000 {
compatible = "mmio-sram";
reg = <0x21000000 DT_SIZE_K(4)>;
};
soc {
flashcalw: flash-controller@400a0000 {
compatible = "atmel,sam-flash-controller";
label = "FLASH_CTRL";
reg = <0x400a0000 0x400>;
interrupts = <0 0>;
peripheral-id = <32>;
#address-cells = <1>;
#size-cells = <1>;
flash0: flash@0 {
compatible = "soc-nv-flash";
label = "FLASH_0";
};
};
spi0: spi@40008000 {
compatible = "atmel,sam-spi";
reg = <0x40008000 0x4000>;
interrupts = <54 0>;
peripheral-id = <1>;
label = "SPI_0";
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
usart0: usart@40024000 {
compatible = "atmel,sam-usart";
reg = <0x40024000 0x4000>;
interrupts = <65 1>;
peripheral-id = <8>;
status = "disabled";
label = "USART_0";
};
usart1: usart@40028000 {
compatible = "atmel,sam-usart";
reg = <0x40028000 0x4000>;
interrupts = <66 1>;
peripheral-id = <9>;
status = "disabled";
label = "USART_1";
};
usart2: usart@4002c000 {
compatible = "atmel,sam-usart";
reg = <0x4002c000 0x4000>;
interrupts = <67 1>;
peripheral-id = <10>;
status = "disabled";
label = "USART_2";
};
usart3: usart@40030000 {
compatible = "atmel,sam-usart";
reg = <0x40030000 0x4000>;
interrupts = <68 1>;
peripheral-id = <11>;
status = "disabled";
label = "USART_3";
};
pinctrl@400e1000 {
compatible = "atmel,sam-pinctrl";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x400e1000 0x400e1000 0x800>;
gpioa: gpio@400e1000 {
compatible = "atmel,sam-gpio";
reg = <0x400e1000 0x200>;
interrupts = <25 1>, <26 1>, <27 1>, <28 1>;
peripheral-id = <68>;
label = "GPIO_A";
gpio-controller;
#gpio-cells = <2>;
#atmel,pin-cells = <2>;
};
gpiob: gpio@400e1200 {
compatible = "atmel,sam-gpio";
reg = <0x400e1200 0x200>;
interrupts = <29 1>, <30 1>, <31 1>, <32 1>;
peripheral-id = <68>;
label = "GPIO_B";
gpio-controller;
#gpio-cells = <2>;
#atmel,pin-cells = <2>;
};
gpioc: gpio@400e1400 {
compatible = "atmel,sam-gpio";
reg = <0x400e1400 0x200>;
interrupts = <33 1>, <34 1>, <35 1>, <36 1>;
peripheral-id = <68>;
label = "GPIO_C";
gpio-controller;
#gpio-cells = <2>;
#atmel,pin-cells = <2>;
};
};
trng: random@40068000 {
compatible = "atmel,sam-trng";
reg = <0x40068000 0x4000>;
interrupts = <73 0>;
peripheral-id = <17>;
status = "okay";
label = "TRNG";
};
};
};
&nvic {
arm,num-irq-priority-bits = <4>;
};

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2020 Gerson Fernando Budke <nandojve@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <mem.h>
#include <atmel/sam4l.dtsi>
/ {
sram0: memory@20000000 {
reg = <0x20000000 DT_SIZE_K(32)>;
};
soc {
flash-controller@400a0000 {
flash0: flash@0 {
reg = <0x00000000 DT_SIZE_K(128)>;
};
};
};
};

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2020 Gerson Fernando Budke <nandojve@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <mem.h>
#include <atmel/sam4l.dtsi>
/ {
sram0: memory@20000000 {
reg = <0x20000000 DT_SIZE_K(32)>;
};
soc {
flash-controller@400a0000 {
flash0: flash@0 {
reg = <0x00000000 DT_SIZE_K(256)>;
};
};
};
};

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2020 Gerson Fernando Budke <nandojve@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <mem.h>
#include <atmel/sam4l.dtsi>
/ {
sram0: memory@20000000 {
reg = <0x20000000 DT_SIZE_K(64)>;
};
soc {
flash-controller@400a0000 {
flash0: flash@0 {
reg = <0x00000000 DT_SIZE_K(512)>;
};
};
};
};