You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
108 lines
3.2 KiB
108 lines
3.2 KiB
# Copyright (c) 2024-2025 Gerson Fernando Budke <nandojve@gmail.com> |
|
# SPDX-License-Identifier: Apache-2.0 |
|
|
|
if SOC_SERIES_SAMD20 || SOC_SERIES_SAMD21 || SOC_SERIES_SAMR21 |
|
|
|
config SOC_ATMEL_SAMD_NVM_WAIT_STATES |
|
int "NVM wait states" |
|
default 1 |
|
help |
|
Wait states to set for NVM. Consult the datasheet as these are highly |
|
dependent on the device operating conditions. |
|
|
|
config SOC_ATMEL_SAMD_OSC32K |
|
bool "Internal 32.768 kHz RC oscillator" |
|
help |
|
Enable the internal 32.768 kHz RC oscillator at startup. |
|
This can then be selected as the main clock reference for the SOC. |
|
|
|
config SOC_ATMEL_SAMD_OSC8M |
|
bool "Internal 8 MHz RC oscillator" |
|
help |
|
Enable the internal 8 MHz RC oscillator at startup. |
|
This can then be selected as the main clock reference for the SOC. |
|
|
|
config SOC_ATMEL_SAMD_XOSC32K |
|
bool "External 32.768 kHz clock source" |
|
help |
|
Enable the external 32.768 kHz clock source at startup. |
|
This can then be selected as the main clock reference for the SOC. |
|
|
|
config SOC_ATMEL_SAMD_XOSC32K_CRYSTAL |
|
bool "External 32.768 kHz clock is a crystal oscillator" |
|
depends on SOC_ATMEL_SAMD_XOSC32K |
|
default y |
|
help |
|
Enable the crystal oscillator (if disabled, expect a clock signal on |
|
XIN32). |
|
|
|
DT_ATMEL_RTC := $(dt_nodelabel_path,rtc) |
|
DT_ATMEL_RTC_COUNTER_CLOCK_MODE := $(dt_node_str_prop_equals,$(DT_ATMEL_RTC),counter-mode,clock) |
|
|
|
config SOC_ATMEL_SAMD_XOSC32K_PRESCALER |
|
int "XOSC32 Generic Clock Prescaler" |
|
range 1 512 |
|
default 32 if "$(DT_ATMEL_RTC_COUNTER_CLOCK_MODE)" |
|
default 1 |
|
depends on SOC_ATMEL_SAMD_XOSC32K |
|
help |
|
Configure the prescaler for the generic clock output |
|
connected on the xosc32. When using RTC in calendar mode |
|
the GCLK should be divided by 32 to RTC receive the |
|
1024 Hz reference clock. |
|
|
|
config SOC_ATMEL_SAMD_XOSC |
|
bool "External 0.4..32 MHz clock source" |
|
help |
|
Enable the external 0.4..32 MHz clock source at startup. |
|
This can then be selected as the main clock reference for the SOC. |
|
|
|
config SOC_ATMEL_SAMD_XOSC_CRYSTAL |
|
bool "External 0.4..32 MHz clock is a crystal oscillator" |
|
depends on SOC_ATMEL_SAMD_XOSC |
|
default y |
|
help |
|
Enable the crystal oscillator (if disabled, expect a clock signal on |
|
XIN). |
|
|
|
config SOC_ATMEL_SAMD_XOSC_FREQ_HZ |
|
int "External 0.4..32 MHz clock oscillator frequency" |
|
range 400000 32000000 |
|
default 8000000 |
|
depends on SOC_ATMEL_SAMD_XOSC |
|
help |
|
External 0.4..32 MHz clock oscillator reference frequency. |
|
|
|
choice |
|
prompt "Main clock reference" |
|
default SOC_ATMEL_SAMD_DEFAULT_AS_MAIN |
|
help |
|
Selects the clock that will be used for the DFLL48M's reference. |
|
Main clocks, such as the CPU and AHB clocks will be derived from |
|
DFLL48M. |
|
|
|
config SOC_ATMEL_SAMD_DEFAULT_AS_MAIN |
|
bool "DEFAULT" |
|
help |
|
This choice will leave all clocks to their current state. |
|
This can be the default reset state or a state set by a bootloader. |
|
|
|
config SOC_ATMEL_SAMD_OSC32K_AS_MAIN |
|
bool "OSC32K" |
|
depends on SOC_ATMEL_SAMD_OSC32K |
|
|
|
config SOC_ATMEL_SAMD_XOSC32K_AS_MAIN |
|
bool "XOSC32K" |
|
depends on SOC_ATMEL_SAMD_XOSC32K |
|
|
|
config SOC_ATMEL_SAMD_OSC8M_AS_MAIN |
|
bool "OSC8M" |
|
depends on SOC_ATMEL_SAMD_OSC8M |
|
|
|
config SOC_ATMEL_SAMD_XOSC_AS_MAIN |
|
bool "XOSC" |
|
depends on SOC_ATMEL_SAMD_XOSC |
|
|
|
endchoice |
|
|
|
endif # SOC_SERIES_SAMD20 || SOC_SERIES_SAMD21 || SOC_SERIES_SAMR21
|
|
|