Skip to content

Commit 4c864d7

Browse files
committed
soc: samv70: add SAM V70 soc support
Implement soc files for the samv70(b) family devices. Signed-off-by: Perry Hung <[email protected]>
1 parent ca46598 commit 4c864d7

File tree

11 files changed

+682
-2
lines changed

11 files changed

+682
-2
lines changed

drivers/can/Kconfig.sam

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,15 @@ config CAN_SAM
88
bool "Atmel SAM CAN driver"
99
default $(dt_compat_enabled,$(DT_COMPAT_ATMEL_SAM_CAN))
1010
select CAN_MCAN
11+
12+
if CAN_SAM
13+
14+
config CAN_MAX_FILTER
15+
int "Maximum number of concurrent active filters"
16+
default 5
17+
range 1 32
18+
help
19+
Defines the array size of the callback/msgq pointers.
20+
Must be at least the size of concurrent reads.
21+
22+
endif # CAN_SAM

drivers/ethernet/Kconfig.sam_gmac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
menuconfig ETH_SAM_GMAC
77
bool "Atmel SAM Ethernet driver"
8-
depends on SOC_FAMILY_SAM0 || SOC_FAMILY_SAM
8+
depends on (SOC_FAMILY_SAM0 || SOC_FAMILY_SAM) && !SOC_SERIES_SAMV70
99
select NOCACHE_MEMORY if ARCH_HAS_NOCACHE_MEMORY_SUPPORT
1010
select MDIO
1111
help

drivers/flash/Kconfig.sam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ config SOC_FLASH_SAM
1010
select FLASH_HAS_DRIVER_ENABLED
1111
select MPU_ALLOW_FLASH_WRITE if ARM_MPU
1212
depends on SOC_SERIES_SAME70 || \
13-
SOC_SERIES_SAMV71
13+
SOC_SERIES_SAMV71 || SOC_SERIES_SAMV70
1414
help
1515
Enable the Atmel SAM series internal flash driver.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_sources(
4+
soc.c
5+
soc_config.c
6+
)
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Atmel SAM V70 MCU series configuration options
2+
3+
# Copyright (c) 2019 Gerson Fernando Budke
4+
# Copyright (c) 2016 Piotr Mienkowski
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
if SOC_SERIES_SAMV70
8+
9+
config SOC_SERIES
10+
default "samv70"
11+
12+
config SOC_PART_NUMBER
13+
default "samv70q20" if SOC_PART_NUMBER_SAMV70Q20
14+
default "samv70q19" if SOC_PART_NUMBER_SAMV70Q19
15+
default "samv70n20" if SOC_PART_NUMBER_SAMV70N20
16+
default "samv70n19" if SOC_PART_NUMBER_SAMV70N19
17+
default "samv70j20" if SOC_PART_NUMBER_SAMV70J20
18+
default "samv70j19" if SOC_PART_NUMBER_SAMV70J19
19+
default "samv70q20b" if SOC_PART_NUMBER_SAMV70Q20B
20+
default "samv70q19b" if SOC_PART_NUMBER_SAMV70Q19B
21+
default "samv70n20b" if SOC_PART_NUMBER_SAMV70N20B
22+
default "samv70n19b" if SOC_PART_NUMBER_SAMV70N19B
23+
default "samv70j20b" if SOC_PART_NUMBER_SAMV70J20B
24+
default "samv70j19b" if SOC_PART_NUMBER_SAMV70J19B
25+
26+
#
27+
# SAM V70 family has in total 71 peripherals capable of generating interrupts
28+
# for the revision A and 74 for the revision B (not all Peripheral Identifiers
29+
# are used).
30+
#
31+
config NUM_IRQS
32+
default 74 if SOC_ATMEL_SAMV70_REVB
33+
default 71
34+
35+
# Configure default device drivers. If a feature is supported by more than one
36+
# device driver the default configuration will be placed in the board defconfig
37+
# file.
38+
39+
config DMA_SAM_XDMAC
40+
default y
41+
depends on DMA
42+
43+
config ADC_SAM_AFEC
44+
default y
45+
depends on ADC
46+
47+
config I2C_SAM_TWIHS
48+
default y
49+
depends on I2C
50+
51+
config I2S_SAM_SSC
52+
default y
53+
depends on I2S
54+
55+
config USB_DC_SAM_USBHS
56+
default y
57+
depends on USB_DEVICE_DRIVER
58+
59+
config ENTROPY_SAM_RNG
60+
default y
61+
depends on ENTROPY_GENERATOR
62+
63+
config SOC_FLASH_SAM
64+
default y
65+
depends on FLASH
66+
67+
config PWM_SAM
68+
default y
69+
depends on PWM
70+
71+
endif # SOC_SERIES_SAMV70
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Atmel SAM V70 MCU series
2+
3+
# Copyright (c) 2019 Gerson Fernando Budke
4+
# Copyright (c) 2016 Piotr Mienkowski
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
config SOC_SERIES_SAMV70
8+
bool "Atmel SAMV70 MCU"
9+
select ARM
10+
select CPU_CORTEX_M7
11+
select SOC_FAMILY_SAM
12+
select CPU_HAS_FPU_DOUBLE_PRECISION
13+
select CPU_CORTEX_M_HAS_CACHE
14+
select CPU_CORTEX_M_HAS_DWT
15+
select ASF
16+
select XIP
17+
select CPU_HAS_ARM_MPU
18+
select HAS_SWO
19+
help
20+
Enable support for Atmel SAM V70 ARM Cortex-M7 Microcontrollers.
21+
Part No.: SAMV70J19, SAMV70J20, SAMV70N19, SAMV70N20, SAMV70Q19, SAMV70Q20,
22+
SAMV70J19B, SAMV70J20B, SAMV70N19B, SAMV70N20B, SAMV70Q19B, SAMV70Q20B
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Atmel SAM V70 MCU series
2+
3+
# Copyright (c) 2019 Gerson Fernando Budke
4+
# Copyright (c) 2016 Piotr Mienkowski
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
choice
8+
prompt "Atmel SAMV70 MCU Selection"
9+
depends on SOC_SERIES_SAMV70
10+
11+
config SOC_PART_NUMBER_SAMV70Q20
12+
bool "SAMV70Q20"
13+
14+
config SOC_PART_NUMBER_SAMV70Q19
15+
bool "SAMV70Q19"
16+
17+
config SOC_PART_NUMBER_SAMV70N20
18+
bool "SAMV70N20"
19+
20+
config SOC_PART_NUMBER_SAMV70N19
21+
bool "SAMV70N19"
22+
23+
config SOC_PART_NUMBER_SAMV70J20
24+
bool "SAMV70J20"
25+
26+
config SOC_PART_NUMBER_SAMV70J19
27+
bool "SAMV70J19"
28+
29+
config SOC_PART_NUMBER_SAMV70Q20B
30+
bool "SAMV70Q20B"
31+
select SOC_ATMEL_SAMV70_REVB
32+
33+
config SOC_PART_NUMBER_SAMV70Q19B
34+
bool "SAMV70Q19B"
35+
select SOC_ATMEL_SAMV70_REVB
36+
37+
config SOC_PART_NUMBER_SAMV70N20B
38+
bool "SAMV70N20B"
39+
select SOC_ATMEL_SAMV70_REVB
40+
41+
config SOC_PART_NUMBER_SAMV70N19B
42+
bool "SAMV70N19B"
43+
select SOC_ATMEL_SAMV70_REVB
44+
45+
config SOC_PART_NUMBER_SAMV70J20B
46+
bool "SAMV70J20B"
47+
select SOC_ATMEL_SAMV70_REVB
48+
49+
config SOC_PART_NUMBER_SAMV70J19B
50+
bool "SAMV70J19B"
51+
select SOC_ATMEL_SAMV70_REVB
52+
endchoice
53+
54+
if SOC_SERIES_SAMV70
55+
56+
config SOC_ATMEL_SAMV70_REVB
57+
bool
58+
59+
config SOC_ATMEL_SAMV70_EXT_SLCK
60+
bool "Use external crystal oscillator for slow clock"
61+
help
62+
Say y if you want to use external 32 kHz crystal
63+
oscillator to drive the slow clock. Note that this
64+
adds a few seconds to boot time, as the crystal
65+
needs to stabilize after power-up.
66+
67+
Says n if you do not need accurate and precise timers.
68+
The slow clock will be driven by the internal fast
69+
RC oscillator running at 32 kHz.
70+
71+
config SOC_ATMEL_SAMV70_EXT_MAINCK
72+
bool "Use external crystal oscillator for main clock"
73+
help
74+
The main clock is being used to drive the PLL, and
75+
thus driving the processor clock.
76+
77+
Say y if you want to use external crystal oscillator
78+
to drive the main clock. Note that this adds about
79+
a second to boot time, as the crystal needs to
80+
stabilize after power-up.
81+
82+
The crystal used here can be from 3 to 20 MHz.
83+
84+
Says n here will use the internal fast RC oscillator
85+
running at 12 MHz.
86+
87+
config SOC_ATMEL_SAMV70_MDIV
88+
int "MDIV"
89+
default 2
90+
range 1 4
91+
help
92+
This divisor defines a ratio between processor clock (HCLK)
93+
and master clock (MCK):
94+
MCK = HCLK / MDIV
95+
96+
config SOC_ATMEL_SAMV70_PLLA_MULA
97+
int "PLL MULA"
98+
default 24
99+
range 1 62
100+
help
101+
This is the multiplier MULA used by the PLL.
102+
The processor clock is (MAINCK * (MULA + 1) / DIVA).
103+
104+
Board config file can override this settings
105+
for a particular board.
106+
107+
Setting MULA=0 would disable PLL at boot, this is currently
108+
not supported.
109+
110+
With default of MULA == 24, and DIVA == 1,
111+
PLL is running at 25 times the main clock frequency.
112+
113+
config SOC_ATMEL_SAMV70_PLLA_DIVA
114+
int "PLL DIVA"
115+
default 1
116+
range 1 255
117+
help
118+
This is the divider DIVA used by the PLL.
119+
The processor clock is (MAINCK * (MULA + 1) / DIVA).
120+
121+
Board config file can override this settings
122+
for a particular board.
123+
124+
Setting DIVA=0 would disable PLL at boot, this is currently
125+
not supported.
126+
127+
With default of MULA == 24, and DIVA == 1,
128+
PLL is running at 25 times the main clock frequency.
129+
130+
config SOC_ATMEL_SAMV70_WAIT_MODE
131+
bool "Go to Wait mode instead of Sleep mode"
132+
depends on SOC_ATMEL_SAMV70_EXT_MAINCK
133+
default y if DEBUG
134+
help
135+
For JTAG debugging CPU clock (HCLK) should not stop. In order
136+
to achieve this, make CPU go to Wait mode instead of Sleep
137+
mode while using external crystal oscillator for main clock.
138+
139+
config SOC_ATMEL_SAMV70_DISABLE_ERASE_PIN
140+
bool "Disable ERASE pin"
141+
help
142+
At reset ERASE pin is configured in System IO mode. Asserting the ERASE
143+
pin at '1' will completely erase Flash memory. Setting this option will
144+
switch the pin to general IO mode giving control of the pin to the GPIO
145+
module.
146+
147+
endif # SOC_SERIES_SAMV70

soc/arm/atmel_sam/samv70/linker.ld

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) 2014 Wind River Systems, Inc.
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
#include <zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld>

0 commit comments

Comments
 (0)