Skip to content

Commit 44f9df0

Browse files
boards: arm: atsaml21: Add SAML21 Xplained board
Implement support for SAML21 Xplained Pro dev board. Signed-off-by: Attie Grande <[email protected]>
1 parent 53b53a5 commit 44f9df0

File tree

15 files changed

+555
-1
lines changed

15 files changed

+555
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SAM L21 Xplained Pro board configuration
2+
3+
# Copyright (c) 2021 Argentum Systems Ltd.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config BOARD_ATSAML21_XPRO
7+
bool "SAM L21 Xplained Pro"
8+
depends on SOC_PART_NUMBER_SAML21J18B
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SAM L21 Xplained Pro board configuration
2+
3+
# Copyright (c) 2021 Argentum Systems Ltd.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config BOARD
7+
default "atsaml21_xpro"
8+
depends on BOARD_ATSAML21_XPRO
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright (c) 2021 Argentum Systems Ltd.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <dt-bindings/pinctrl/saml21j-pinctrl.h>
8+
9+
&pinctrl {
10+
tcc0_default: tcc0_default {
11+
group1 {
12+
pinmux = <PB10F_TCC0_WO4>;
13+
};
14+
};
15+
16+
sercom0_default: sercom0_default {
17+
group1 {
18+
pinmux = <PA4D_SERCOM0_PAD0>,
19+
<PA6D_SERCOM0_PAD2>,
20+
<PA7D_SERCOM0_PAD3>;
21+
};
22+
};
23+
24+
sercom1_default: sercom1_default {
25+
group1 {
26+
pinmux = <PA18C_SERCOM1_PAD2>,
27+
<PA19C_SERCOM1_PAD3>;
28+
};
29+
};
30+
31+
sercom2_default: sercom2_default {
32+
group1 {
33+
pinmux = <PA8D_SERCOM2_PAD0>,
34+
<PA9D_SERCOM2_PAD1>;
35+
};
36+
};
37+
38+
sercom3_default: sercom3_default {
39+
group1 {
40+
pinmux = <PA22C_SERCOM3_PAD0>,
41+
<PA23C_SERCOM3_PAD1>;
42+
};
43+
};
44+
45+
sercom4_default: sercom4_default {
46+
group1 {
47+
pinmux = <PB8D_SERCOM4_PAD0>,
48+
<PB9D_SERCOM4_PAD1>;
49+
};
50+
};
51+
52+
sercom5_default: sercom5_default {
53+
group1 {
54+
pinmux = <PB16C_SERCOM5_PAD0>,
55+
<PB22D_SERCOM5_PAD2>,
56+
<PB23D_SERCOM5_PAD3>;
57+
};
58+
};
59+
};
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
/*
2+
* Copyright (c) 2021 Argentum Systems Ltd.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <atmel/saml21.dtsi>
9+
#include "atsaml21_xpro-pinctrl.dtsi"
10+
11+
/ {
12+
model = "SAM L21 Xplained Pro";
13+
compatible = "atsaml21,xpro", "atmel,saml21j18b", "atmel,saml21";
14+
15+
chosen {
16+
zephyr,console = &sercom3;
17+
zephyr,shell-uart = &sercom3;
18+
zephyr,sram = &sram0;
19+
zephyr,flash = &flash0;
20+
};
21+
22+
/* These aliases are provided for compatibility with samples */
23+
aliases {
24+
led0 = &led0;
25+
pwm-led0 = &pwm_led0;
26+
sw0 = &user_button;
27+
};
28+
29+
leds {
30+
compatible = "gpio-leds";
31+
led0: led_0 {
32+
gpios = <&portb 10 GPIO_ACTIVE_LOW>;
33+
label = "Yellow LED";
34+
};
35+
};
36+
37+
pwmleds {
38+
compatible = "pwm-leds";
39+
pwm_led0: pwm_led_0 {
40+
pwms = <&tcc0 0 PWM_MSEC(20)>;
41+
};
42+
};
43+
44+
buttons {
45+
compatible = "gpio-keys";
46+
user_button: button_0 {
47+
gpios = <&porta 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
48+
label = "SW0";
49+
};
50+
};
51+
};
52+
53+
&cpu0 {
54+
clock-frequency = <48000000>;
55+
};
56+
57+
&adc {
58+
status = "okay";
59+
};
60+
61+
&tcc0 {
62+
status = "okay";
63+
compatible = "atmel,sam0-tcc-pwm";
64+
/* Gives a maximum period of 1.4s */
65+
prescaler = <4>;
66+
#pwm-cells = <2>;
67+
68+
pinctrl-0 = <&tcc0_default>;
69+
pinctrl-names = "default";
70+
};
71+
72+
&sercom0 {
73+
status = "okay";
74+
compatible = "atmel,sam0-spi";
75+
dipo = <0>;
76+
dopo = <1>;
77+
#address-cells = <1>;
78+
#size-cells = <0>;
79+
80+
pinctrl-0 = <&sercom0_default>;
81+
pinctrl-names = "default";
82+
};
83+
84+
&sercom1 {
85+
status = "okay";
86+
compatible = "atmel,sam0-uart";
87+
current-speed = <115200>;
88+
rxpo = <3>;
89+
txpo = <0>;
90+
91+
pinctrl-0 = <&sercom1_default>;
92+
pinctrl-names = "default";
93+
};
94+
95+
&sercom2 {
96+
status = "okay";
97+
compatible = "atmel,sam0-i2c";
98+
clock-frequency = <I2C_BITRATE_FAST>;
99+
#address-cells = <1>;
100+
#size-cells = <0>;
101+
102+
pinctrl-0 = <&sercom2_default>;
103+
pinctrl-names = "default";
104+
};
105+
106+
&sercom3 {
107+
status = "okay";
108+
compatible = "atmel,sam0-uart";
109+
current-speed = <115200>;
110+
rxpo = <1>;
111+
txpo = <0>;
112+
113+
pinctrl-0 = <&sercom3_default>;
114+
pinctrl-names = "default";
115+
};
116+
117+
&sercom4 {
118+
status = "okay";
119+
compatible = "atmel,sam0-uart";
120+
current-speed = <115200>;
121+
rxpo = <1>;
122+
txpo = <0>;
123+
124+
pinctrl-0 = <&sercom4_default>;
125+
pinctrl-names = "default";
126+
};
127+
128+
&sercom5 {
129+
status = "okay";
130+
compatible = "atmel,sam0-spi";
131+
dipo = <0>;
132+
dopo = <1>;
133+
#address-cells = <1>;
134+
#size-cells = <0>;
135+
136+
pinctrl-0 = <&sercom5_default>;
137+
pinctrl-names = "default";
138+
};
139+
140+
zephyr_udc0: &usb0 {
141+
status = "okay";
142+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2021 Argentum Systems Ltd.
2+
# SPDX-License-Identifier: Apache-2.0
3+
identifier: atsaml21_xpro
4+
name: SAM L21 Xplained Pro
5+
type: mcu
6+
arch: arm
7+
ram: 32
8+
flash: 256
9+
toolchain:
10+
- zephyr
11+
- gnuarmemb
12+
- xtools
13+
supported:
14+
- adc
15+
- counter
16+
- dma
17+
- gpio
18+
- i2c
19+
- pwm
20+
- spi
21+
- usb_cdc
22+
- usb_device
23+
- watchdog
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2021 Argentum Systems Ltd.
2+
# SPDX-License-Identifier: Apache-2.0
3+
CONFIG_SOC_SERIES_SAML21=y
4+
CONFIG_SOC_PART_NUMBER_SAML21J18B=y
5+
CONFIG_BOARD_ATSAML21_XPRO=y
6+
CONFIG_BUILD_OUTPUT_HEX=y
7+
CONFIG_CORTEX_M_SYSTICK=y
8+
CONFIG_CONSOLE=y
9+
CONFIG_UART_CONSOLE=y
10+
CONFIG_SERIAL=y
11+
CONFIG_UART_SAM0=y
12+
CONFIG_UART_INTERRUPT_DRIVEN=y
13+
CONFIG_GPIO=y
14+
CONFIG_GPIO_SAM0=y
15+
CONFIG_SOC_ATMEL_SAML_XOSC32K=y
16+
CONFIG_SOC_ATMEL_SAML_XOSC32K_AS_MAIN=y
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2021 Argentum Systems Ltd.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
183 KB
Loading
130 KB
Loading

0 commit comments

Comments
 (0)