1 /*
2  * Copyright (c) 2016 Piotr Mienkowski
3  * Copyright (c) 2019-2024 Gerson Fernando Budke <nandojve@gmail.com>
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /** @file
8  * @brief Register access macros for the Atmel SAM V71 MCU.
9  *
10  * This file provides register access macros for the Atmel SAM V71 MCU, HAL
11  * drivers for core peripherals as well as symbols specific to Atmel SAM family.
12  */
13 
14 #ifndef _SOC_ATMEL_SAM_SAMV71_SOC_H_
15 #define _SOC_ATMEL_SAM_SAMV71_SOC_H_
16 
17 #include <zephyr/sys/util.h>
18 
19 #ifndef _ASMLANGUAGE
20 
21 #define DONT_USE_CMSIS_INIT
22 #define DONT_USE_PREDEFINED_CORE_HANDLERS
23 #define DONT_USE_PREDEFINED_PERIPHERALS_HANDLERS
24 
25 #if defined(CONFIG_SOC_SAMV71J19)
26 #include <samv71j19.h>
27 #elif defined(CONFIG_SOC_SAMV71J20)
28 #include <samv71j20.h>
29 #elif defined(CONFIG_SOC_SAMV71J21)
30 #include <samv71j21.h>
31 #elif defined(CONFIG_SOC_SAMV71N19)
32 #include <samv71n19.h>
33 #elif defined(CONFIG_SOC_SAMV71N20)
34 #include <samv71n20.h>
35 #elif defined(CONFIG_SOC_SAMV71N21)
36 #include <samv71n21.h>
37 #elif defined(CONFIG_SOC_SAMV71Q19)
38 #include <samv71q19.h>
39 #elif defined(CONFIG_SOC_SAMV71Q20)
40 #include <samv71q20.h>
41 #elif defined(CONFIG_SOC_SAMV71Q21)
42 #include <samv71q21.h>
43 #elif defined(CONFIG_SOC_SAMV71J19B)
44 #include <samv71j19b.h>
45 #elif defined(CONFIG_SOC_SAMV71J20B)
46 #include <samv71j20b.h>
47 #elif defined(CONFIG_SOC_SAMV71J21B)
48 #include <samv71j21b.h>
49 #elif defined(CONFIG_SOC_SAMV71N19B)
50 #include <samv71n19b.h>
51 #elif defined(CONFIG_SOC_SAMV71N20B)
52 #include <samv71n20b.h>
53 #elif defined(CONFIG_SOC_SAMV71N21B)
54 #include <samv71n21b.h>
55 #elif defined(CONFIG_SOC_SAMV71Q19B)
56 #include <samv71q19b.h>
57 #elif defined(CONFIG_SOC_SAMV71Q20B)
58 #include <samv71q20b.h>
59 #elif defined(CONFIG_SOC_SAMV71Q21B)
60 #include <samv71q21b.h>
61 #else
62   #error Library does not support the specified device.
63 #endif
64 
65 #include "../common/soc_pmc.h"
66 #include "../common/soc_gpio.h"
67 #include "../common/soc_supc.h"
68 #include "../common/atmel_sam_dt.h"
69 
70 /** Processor Clock (HCLK) Frequency */
71 #define SOC_ATMEL_SAM_HCLK_FREQ_HZ ATMEL_SAM_DT_CPU_CLK_FREQ_HZ
72 
73 /** Master Clock (MCK) Frequency */
74 #define SOC_ATMEL_SAM_MCK_FREQ_HZ \
75 	(SOC_ATMEL_SAM_HCLK_FREQ_HZ / CONFIG_SOC_ATMEL_SAM_MDIV)
76 
77 /** UTMI PLL clock (UPLLCK) Frequency */
78 #define SOC_ATMEL_SAM_UPLLCK_FREQ_HZ MHZ(480)
79 
80 #endif /* _ASMLANGUAGE */
81 
82 #include "pwm_fixup.h"
83 
84 #endif /* _SOC_ATMEL_SAM_SAMV71_SOC_H_ */
85