Skip to content

Commit 4bd94f5

Browse files
committed
soc: atmel: add base support for C2x SOC
Adds Atmel SAMC20 and SAMC21 soc. C series is based on Cortex-M0+. C21 contains CAN interface. The init routines are same for SAMC20 and SAMC21. They use one clock OSC48M without configuration. The code is inspirated from atmel_sam0/samd21. Signed-off-by: Kamil Serwus <[email protected]>
1 parent 8511633 commit 4bd94f5

27 files changed

+940
-0
lines changed

drivers/flash/Kconfig.sam0

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ menuconfig SOC_FLASH_SAM0
1616
config SOC_FLASH_SAM0_EMULATE_BYTE_PAGES
1717
bool "Emulate byte-sized pages"
1818
depends on SOC_FLASH_SAM0
19+
default y if SOC_SERIES_SAMC20 || \
20+
SOC_SERIES_SAMC21
1921
help
2022
Emulate a device with byte-sized pages by doing a
2123
read/modify/erase/write.

dts/arm/atmel/samc20x15.dtsi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2019 Gerson Fernando Budke
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <mem.h>
8+
#include <atmel/samc2x.dtsi>
9+
10+
/ {
11+
sram0: memory@20000000 {
12+
reg = <0x20000000 DT_SIZE_K(4)>;
13+
};
14+
15+
soc {
16+
nvmctrl: nvmctrl@41004000 {
17+
flash0: flash@0 {
18+
reg = <0 DT_SIZE_K(32)>;
19+
};
20+
};
21+
};
22+
};

dts/arm/atmel/samc20x16.dtsi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2019 Gerson Fernando Budke
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <mem.h>
8+
#include <atmel/samc2x.dtsi>
9+
10+
/ {
11+
sram0: memory@20000000 {
12+
reg = <0x20000000 DT_SIZE_K(8)>;
13+
};
14+
15+
soc {
16+
nvmctrl: nvmctrl@41004000 {
17+
flash0: flash@0 {
18+
reg = <0 DT_SIZE_K(64)>;
19+
};
20+
};
21+
};
22+
};

dts/arm/atmel/samc20x17.dtsi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2019 Gerson Fernando Budke
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <mem.h>
8+
#include <atmel/samc2x.dtsi>
9+
10+
/ {
11+
sram0: memory@20000000 {
12+
reg = <0x20000000 DT_SIZE_K(16)>;
13+
};
14+
15+
soc {
16+
nvmctrl: nvmctrl@41004000 {
17+
flash0: flash@0 {
18+
reg = <0 DT_SIZE_K(128)>;
19+
};
20+
};
21+
};
22+
};

dts/arm/atmel/samc20x18.dtsi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2019 Gerson Fernando Budke
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <mem.h>
8+
#include <atmel/samc2x.dtsi>
9+
10+
/ {
11+
sram0: memory@20000000 {
12+
reg = <0x20000000 DT_SIZE_K(32)>;
13+
};
14+
15+
soc {
16+
nvmctrl: nvmctrl@41004000 {
17+
flash0: flash@0 {
18+
reg = <0 DT_SIZE_K(256)>;
19+
};
20+
};
21+
};
22+
};

dts/arm/atmel/samc21.dtsi

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright (c) 2022 Kamil Serwus
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <atmel/samc2x.dtsi>
8+
9+
/ {
10+
aliases {
11+
sercom-4 = &sercom4;
12+
sercom-5 = &sercom5;
13+
};
14+
15+
soc {
16+
adc1: adc@42004800 {
17+
compatible = "atmel,sam0-adc";
18+
status = "disabled";
19+
reg = <0x42004800 0x30>;
20+
interrupts = <26 0>;
21+
interrupt-names = "resrdy";
22+
clocks = <&gclk 34>, <&mclk 0x1c 18>;
23+
clock-names = "GCLK", "MCLK";
24+
gclk = <0>;
25+
prescaler = <4>;
26+
#io-channel-cells = <1>;
27+
};
28+
29+
sercom4: sercom@42001400 {
30+
compatible = "atmel,sam0-sercom";
31+
reg = <0x42001400 0x40>;
32+
interrupts = <13 0>;
33+
clocks = <&gclk 23>, <&mclk 0x1c 5>;
34+
clock-names = "GCLK", "MCLK";
35+
status = "disabled";
36+
};
37+
38+
sercom5: sercom@42001800 {
39+
compatible = "atmel,sam0-sercom";
40+
reg = <0x42001800 0x40>;
41+
interrupts = <14 0>;
42+
clocks = <&gclk 25>, <&mclk 0x1c 6>;
43+
clock-names = "GCLK", "MCLK";
44+
status = "disabled";
45+
};
46+
};
47+
};

dts/arm/atmel/samc21x15.dtsi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2019 Gerson Fernando Budke
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <mem.h>
8+
#include <atmel/samc21.dtsi>
9+
10+
/ {
11+
sram0: memory@20000000 {
12+
reg = <0x20000000 DT_SIZE_K(4)>;
13+
};
14+
15+
soc {
16+
nvmctrl: nvmctrl@41004000 {
17+
flash0: flash@0 {
18+
reg = <0 DT_SIZE_K(32)>;
19+
};
20+
};
21+
};
22+
};

dts/arm/atmel/samc21x16.dtsi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2019 Gerson Fernando Budke
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <mem.h>
8+
#include <atmel/samc21.dtsi>
9+
10+
/ {
11+
sram0: memory@20000000 {
12+
reg = <0x20000000 DT_SIZE_K(8)>;
13+
};
14+
15+
soc {
16+
nvmctrl: nvmctrl@41004000 {
17+
flash0: flash@0 {
18+
reg = <0 DT_SIZE_K(64)>;
19+
};
20+
};
21+
};
22+
};

dts/arm/atmel/samc21x17.dtsi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2019 Gerson Fernando Budke
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <mem.h>
8+
#include <atmel/samc21.dtsi>
9+
10+
/ {
11+
sram0: memory@20000000 {
12+
reg = <0x20000000 DT_SIZE_K(16)>;
13+
};
14+
15+
soc {
16+
nvmctrl: nvmctrl@41004000 {
17+
flash0: flash@0 {
18+
reg = <0 DT_SIZE_K(128)>;
19+
};
20+
};
21+
};
22+
};

dts/arm/atmel/samc21x18.dtsi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2019 Gerson Fernando Budke
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <mem.h>
8+
#include <atmel/samc21.dtsi>
9+
10+
/ {
11+
sram0: memory@20000000 {
12+
reg = <0x20000000 DT_SIZE_K(32)>;
13+
};
14+
15+
soc {
16+
nvmctrl: nvmctrl@41004000 {
17+
flash0: flash@0 {
18+
reg = <0 DT_SIZE_K(256)>;
19+
};
20+
};
21+
};
22+
};

0 commit comments

Comments
 (0)