atsamd: Add support for SAMD51 overclocking

Signed-off-by: Lars R. Hansen <popshansen@hotmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Lars R. Hansen 2019-08-10 11:11:41 +01:00 committed by Kevin O'Connor
parent d38aed0773
commit 524ebbc7b3
2 changed files with 22 additions and 6 deletions

View File

@ -56,11 +56,6 @@ config MCU
default "samd51n19a" if MACH_SAMD51N19 default "samd51n19a" if MACH_SAMD51N19
default "samd51p20a" if MACH_SAMD51P20 default "samd51p20a" if MACH_SAMD51P20
config CLOCK_FREQ
int
default 48000000 if MACH_SAMD21
default 120000000 if MACH_SAMD51
config FLASH_SIZE config FLASH_SIZE
hex hex
default 0x8000 if MACH_SAMD21E15 default 0x8000 if MACH_SAMD21E15
@ -91,6 +86,27 @@ choice
bool "Internal clock" bool "Internal clock"
endchoice endchoice
choice
depends on MACH_SAMD51 && LOW_LEVEL_OPTIONS
prompt "Processor speed"
config SAMD51_FREQ_120
bool "120 MHz (standard)"
config SAMD51_FREQ_150
bool "150 MHz (overclock)"
config SAMD51_FREQ_180
bool "180 MHz (overclock)"
config SAMD51_FREQ_200
bool "200 MHz (overclock)"
endchoice
config CLOCK_FREQ
int
default 48000000 if MACH_SAMD21
default 150000000 if SAMD51_FREQ_150
default 180000000 if SAMD51_FREQ_180
default 200000000 if SAMD51_FREQ_200
default 120000000 if MACH_SAMD51
choice choice
prompt "Bootloader offset" prompt "Bootloader offset"
config FLASH_START_2000 config FLASH_START_2000

View File

@ -13,7 +13,7 @@
#define CLKGEN_48M 3 #define CLKGEN_48M 3
#define CLKGEN_2M 4 #define CLKGEN_2M 4
#define FREQ_MAIN 120000000 #define FREQ_MAIN CONFIG_CLOCK_FREQ
#define FREQ_32K 32768 #define FREQ_32K 32768
#define FREQ_48M 48000000 #define FREQ_48M 48000000
#define FREQ_2M 2000000 #define FREQ_2M 2000000