arm/rp2040,rp2350: Use BOARD_XOSC_FREQ for calculating startup delay

Previously this used a hard-coded value of 12 MHz, but this presumably
should use `BOARD_XOSC_FREQ`. Similarly to how it is done in pico-sdk.

It looks like all boards are currently defined to use 12 MHz XOSC
clocks, so this won't change behavior with any of them.

Signed-off-by: Ian Douglas Scott <ian@iandouglasscott.com>
This commit is contained in:
Ian Douglas Scott
2025-01-15 22:31:41 -08:00
committed by archer
parent 9f5a45340f
commit 4401036406
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ void rp2040_xosc_init(void)
/* Set xosc startup delay */
uint32_t startup_delay = (((12 * MHZ) / 1000) + 128) / 256;
uint32_t startup_delay = ((BOARD_XOSC_FREQ / 1000) + 128) / 256;
putreg32(startup_delay, RP2040_XOSC_STARTUP);
/* Set the enable bit now that we have set freq range and startup delay */
+1 -1
View File
@@ -78,7 +78,7 @@ void rp23xx_xosc_init(void)
/* Set xosc startup delay */
uint32_t startup_delay = (((12 * MHZ) / 1000) + 128) / 256;
uint32_t startup_delay = ((BOARD_XOSC_FREQ / 1000) + 128) / 256;
putreg32(startup_delay, RP23XX_XOSC_STARTUP);
/* Set the enable bit now that we have set freq range and startup delay */