1 /*
2  * Copyright (c) 2016 Piotr Mienkowski
3  * Copyright (c) 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 E70 MCU.
9  *
10  * This file provides register access macros for the Atmel SAM E70 MCU, HAL
11  * drivers for core peripherals as well as symbols specific to Atmel SAM family.
12  */
13 
14 #ifndef _SOC_ATMEL_SAM_SAME70_SOC_H_
15 #define _SOC_ATMEL_SAM_SAME70_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_SAME70J19)
26 #include <same70j19.h>
27 #elif defined(CONFIG_SOC_SAME70J20)
28 #include <same70j20.h>
29 #elif defined(CONFIG_SOC_SAME70J21)
30 #include <same70j21.h>
31 #elif defined(CONFIG_SOC_SAME70N19)
32 #include <same70n19.h>
33 #elif defined(CONFIG_SOC_SAME70N20)
34 #include <same70n20.h>
35 #elif defined(CONFIG_SOC_SAME70N21)
36 #include <same70n21.h>
37 #elif defined(CONFIG_SOC_SAME70Q19)
38 #include <same70q19.h>
39 #elif defined(CONFIG_SOC_SAME70Q20)
40 #include <same70q20.h>
41 #elif defined(CONFIG_SOC_SAME70Q21)
42 #include <same70q21.h>
43 #elif defined(CONFIG_SOC_SAME70J19B)
44 #include <same70j19b.h>
45 #elif defined(CONFIG_SOC_SAME70J20B)
46 #include <same70j20b.h>
47 #elif defined(CONFIG_SOC_SAME70J21B)
48 #include <same70j21b.h>
49 #elif defined(CONFIG_SOC_SAME70N19B)
50 #include <same70n19b.h>
51 #elif defined(CONFIG_SOC_SAME70N20B)
52 #include <same70n20b.h>
53 #elif defined(CONFIG_SOC_SAME70N21B)
54 #include <same70n21b.h>
55 #elif defined(CONFIG_SOC_SAME70Q19B)
56 #include <same70q19b.h>
57 #elif defined(CONFIG_SOC_SAME70Q20B)
58 #include <same70q20b.h>
59 #elif defined(CONFIG_SOC_SAME70Q21B)
60 #include <same70q21b.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 #endif /* _SOC_ATMEL_SAM_SAME70_SOC_H_ */
83