1 /*
2  * Copyright (c) 2019 ML!PA Consulting GmbH
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef _ATMEL_SAMD51_SOC_H_
8 #define _ATMEL_SAMD51_SOC_H_
9 
10 #ifndef _ASMLANGUAGE
11 
12 #define DONT_USE_CMSIS_INIT
13 
14 #include <zephyr/types.h>
15 
16 
17 #if defined(CONFIG_SOC_PART_NUMBER_SAMD51G18A)
18 #include <samd51g18a.h>
19 #elif defined(CONFIG_SOC_PART_NUMBER_SAMD51G19A)
20 #include <samd51g19a.h>
21 #elif defined(CONFIG_SOC_PART_NUMBER_SAMD51J18A)
22 #include <samd51j18a.h>
23 #elif defined(CONFIG_SOC_PART_NUMBER_SAMD51J19A)
24 #include <samd51j19a.h>
25 #elif defined(CONFIG_SOC_PART_NUMBER_SAMD51J20A)
26 #include <samd51j20a.h>
27 #elif defined(CONFIG_SOC_PART_NUMBER_SAMD51N19A)
28 #include <samd51n19a.h>
29 #elif defined(CONFIG_SOC_PART_NUMBER_SAMD51N20A)
30 #include <samd51n20a.h>
31 #elif defined(CONFIG_SOC_PART_NUMBER_SAMD51P19A)
32 #include <samd51p19a.h>
33 #elif defined(CONFIG_SOC_PART_NUMBER_SAMD51P20A)
34 #include <samd51p20a.h>
35 #else
36 #error Library does not support the specified device.
37 #endif
38 
39 #endif /* _ASMLANGUAGE */
40 
41 #include "sercom_fixup_samd5x.h"
42 #include "tc_fixup_samd5x.h"
43 #include "adc_fixup_sam0.h"
44 #include "../common/soc_port.h"
45 #include "../common/atmel_sam0_dt.h"
46 
47 #define SOC_ATMEL_SAM0_OSC32K_FREQ_HZ 32768
48 
49 /** Processor Clock (HCLK) Frequency */
50 #define SOC_ATMEL_SAM0_HCLK_FREQ_HZ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
51 /** Master Clock (MCK) Frequency */
52 #define SOC_ATMEL_SAM0_MCK_FREQ_HZ SOC_ATMEL_SAM0_HCLK_FREQ_HZ
53 #define SOC_ATMEL_SAM0_GCLK0_FREQ_HZ SOC_ATMEL_SAM0_MCK_FREQ_HZ
54 #define SOC_ATMEL_SAM0_GCLK2_FREQ_HZ 48000000
55 
56 #endif /* _ATMEL_SAMD51_SOC_H_ */
57