Skip to content

Commit 7e72256

Browse files
benpiccogalak
authored andcommitted
soc: atmel_sam0: Add SAME53
This adds supoprt for the Atmel SAME53 SoC. The SAME5x/SAMD5x is a line of Cortex-M4F MCUs that share peripherals with the sam0 Cortex-M0+ and saml1x Cortex-M23 parts. Signed-off-by: Benjamin Valentin <[email protected]>
1 parent de6bc41 commit 7e72256

File tree

7 files changed

+135
-0
lines changed

7 files changed

+135
-0
lines changed

soc/arm/atmel_sam0/common/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ zephyr_sources_ifdef(CONFIG_SOC_SERIES_SAMR21 soc_samd2x.c)
99

1010
zephyr_sources_ifdef(CONFIG_SOC_SERIES_SAMD51 soc_samd5x.c)
1111
zephyr_sources_ifdef(CONFIG_SOC_SERIES_SAME51 soc_samd5x.c)
12+
zephyr_sources_ifdef(CONFIG_SOC_SERIES_SAME53 soc_samd5x.c)
1213
zephyr_sources_ifdef(CONFIG_SOC_SERIES_SAME54 soc_samd5x.c)
1314

1415
zephyr_include_directories(.)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Kconfig - Atmel SAME53 MCU series configuration options
2+
#
3+
# Copyright (c) 2019 ML!PA Consulting GmbH
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if SOC_SERIES_SAME53
7+
8+
config SOC_SERIES
9+
string
10+
default "same53"
11+
12+
config SOC_PART_NUMBER
13+
string
14+
default "same53j18a" if SOC_PART_NUMBER_SAME53J18A
15+
default "same53j19a" if SOC_PART_NUMBER_SAME53J19A
16+
default "same53j20a" if SOC_PART_NUMBER_SAME53J20A
17+
default "same53n19a" if SOC_PART_NUMBER_SAME53N19A
18+
default "same53n20a" if SOC_PART_NUMBER_SAME53N20A
19+
20+
config NUM_IRQS
21+
int
22+
default 137
23+
24+
config SYS_CLOCK_HW_CYCLES_PER_SEC
25+
int
26+
default 120000000
27+
28+
endif # SOC_SERIES_SAME53
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Kconfig - Atmel SAME53 MCU series
2+
#
3+
# Copyright (c) 2019 ML!PA Consulting GmbH
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config SOC_SERIES_SAME53
7+
bool "Atmel SAME53 MCU"
8+
select CPU_CORTEX_M4
9+
select SOC_FAMILY_SAM0
10+
select CPU_CORTEX_M_HAS_SYSTICK
11+
select CPU_CORTEX_M_HAS_VTOR
12+
select ASF
13+
help
14+
Enable support for Atmel SAME53 Cortex-M4F microcontrollers.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Kconfig - Atmel SAME53 MCU series
2+
#
3+
# Copyright (c) 2019 ML!PA Consulting GmbH
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
choice
7+
prompt "Atmel SAME53 MCU Selection"
8+
depends on SOC_SERIES_SAME53
9+
10+
config SOC_PART_NUMBER_SAME53J18A
11+
bool "SAME53J18A"
12+
13+
config SOC_PART_NUMBER_SAME53J19A
14+
bool "SAME53J19A"
15+
16+
config SOC_PART_NUMBER_SAME53J20A
17+
bool "SAME53J20A"
18+
19+
config SOC_PART_NUMBER_SAME53N19A
20+
bool "SAME53N19A"
21+
22+
config SOC_PART_NUMBER_SAME53N20A
23+
bool "SAME53N20A"
24+
25+
endchoice
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright (c) 2019 ML!PA Consulting GmbH
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* SoC level DTS fixup file */
8+
9+
#define DT_FLASH_DEV_NAME DT_ATMEL_SAM0_NVMCTRL_0_LABEL
10+
11+
#define CONFIG_ENTROPY_NAME DT_ATMEL_SAM0_TRNG_0_LABEL
12+
13+
#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
14+
15+
/* End of SoC Level DTS fixup file */
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* linker.ld - Linker command/script file */
2+
3+
/*
4+
* Copyright (c) 2017 Google LLC.
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
#include <arch/arm/cortex_m/scripts/linker.ld>

soc/arm/atmel_sam0/same53/soc.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2019 ML!PA Consulting GmbH
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef _ATMEL_SAME53_SOC_H_
8+
#define _ATMEL_SAME53_SOC_H_
9+
10+
#ifndef _ASMLANGUAGE
11+
12+
#define DONT_USE_CMSIS_INIT
13+
14+
#include <zephyr/types.h>
15+
16+
#if defined(CONFIG_SOC_PART_NUMBER_SAME53J18A)
17+
#include <same53j18a.h>
18+
#elif defined(CONFIG_SOC_PART_NUMBER_SAME53J19A)
19+
#include <same53j19a.h>
20+
#elif defined(CONFIG_SOC_PART_NUMBER_SAME53J20A)
21+
#include <same53j20a.h>
22+
#elif defined(CONFIG_SOC_PART_NUMBER_SAME53N19A)
23+
#include <same53n19a.h>
24+
#elif defined(CONFIG_SOC_PART_NUMBER_SAME53N20A)
25+
#include <same53n20a.h>
26+
#else
27+
#error Library does not support the specified device.
28+
#endif
29+
30+
#endif /* _ASMLANGUAGE */
31+
32+
#include "sercom_fixup_samd5x.h"
33+
#include "tc_fixup_samd5x.h"
34+
35+
#define SOC_ATMEL_SAM0_OSC32K_FREQ_HZ 32768
36+
37+
/** Processor Clock (HCLK) Frequency */
38+
#define SOC_ATMEL_SAM0_HCLK_FREQ_HZ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
39+
/** Master Clock (MCK) Frequency */
40+
#define SOC_ATMEL_SAM0_MCK_FREQ_HZ SOC_ATMEL_SAM0_HCLK_FREQ_HZ
41+
#define SOC_ATMEL_SAM0_GCLK0_FREQ_HZ SOC_ATMEL_SAM0_MCK_FREQ_HZ
42+
#define SOC_ATMEL_SAM0_GCLK2_FREQ_HZ 48000000
43+
44+
#endif /* _ATMEL_SAME53_SOC_H_ */

0 commit comments

Comments
 (0)