1 /*
2  * Copyright (c) 2019 Gerson Fernando Budke
3  * Copyright (c) 2016 Piotr Mienkowski
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 _ATMEL_SAMV71_SOC_H_
15 #define _ATMEL_SAMV71_SOC_H_
16 
17 #include <sys/util.h>
18 
19 #ifndef _ASMLANGUAGE
20 
21 /* Add include for DTS generated information */
22 #include <devicetree.h>
23 
24 #define DONT_USE_CMSIS_INIT
25 #define DONT_USE_PREDEFINED_CORE_HANDLERS
26 #define DONT_USE_PREDEFINED_PERIPHERALS_HANDLERS
27 
28 #if defined CONFIG_SOC_PART_NUMBER_SAMV71J19
29 #include <samv71j19.h>
30 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71J20
31 #include <samv71j20.h>
32 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71J21
33 #include <samv71j21.h>
34 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71N19
35 #include <samv71n19.h>
36 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71N20
37 #include <samv71n20.h>
38 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71N21
39 #include <samv71n21.h>
40 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71Q19
41 #include <samv71q19.h>
42 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71Q20
43 #include <samv71q20.h>
44 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71Q21
45 #include <samv71q21.h>
46 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71J19B
47 #include <samv71j19b.h>
48 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71J20B
49 #include <samv71j20b.h>
50 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71J21B
51 #include <samv71j21b.h>
52 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71N19B
53 #include <samv71n19b.h>
54 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71N20B
55 #include <samv71n20b.h>
56 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71N21B
57 #include <samv71n21b.h>
58 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71Q19B
59 #include <samv71q19b.h>
60 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71Q20B
61 #include <samv71q20b.h>
62 #elif defined CONFIG_SOC_PART_NUMBER_SAMV71Q21B
63 #include <samv71q21b.h>
64 #else
65   #error Library does not support the specified device.
66 #endif
67 
68 #include "../common/soc_pmc.h"
69 #include "../common/soc_gpio.h"
70 #include "../common/atmel_sam_dt.h"
71 
72 /** Processor Clock (HCLK) Frequency */
73 #define SOC_ATMEL_SAM_HCLK_FREQ_HZ ATMEL_SAM_DT_CPU_CLK_FREQ_HZ
74 
75 /** Master Clock (MCK) Frequency */
76 #define SOC_ATMEL_SAM_MCK_FREQ_HZ \
77 	(SOC_ATMEL_SAM_HCLK_FREQ_HZ / CONFIG_SOC_ATMEL_SAMV71_MDIV)
78 
79 #endif /* _ASMLANGUAGE */
80 
81 #include "pwm_fixup.h"
82 
83 #endif /* _ATMEL_SAMV71_SOC_H_ */
84