[PATCH 3/6] board: ti: am62px: Add basic initialization for 32k crystal
Vishal Mahaveer
vishalm at ti.com
Wed Dec 10 16:48:41 CET 2025
Do the basic configuration required for enabling the 32k crystal. If
external 32k source is not used, 32k rc-osc comes into play, which is
accurate to +-20%.
Signed-off-by: Vishal Mahaveer <vishalm at ti.com>
---
board/ti/am62px/evm.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/board/ti/am62px/evm.c b/board/ti/am62px/evm.c
index 85c332b9339..7672d1eb272 100644
--- a/board/ti/am62px/evm.c
+++ b/board/ti/am62px/evm.c
@@ -43,11 +43,24 @@ struct efi_capsule_update_info update_info = {
};
#if IS_ENABLED(CONFIG_SPL_BUILD)
+#if IS_ENABLED(CONFIG_SPL_BOARD_INIT)
void spl_board_init(void)
{
+ u32 val;
+
+ /* We have 32k crystal, so lets enable it */
+ val = readl(MCU_CTRL_LFXOSC_CTRL);
+ val &= ~(MCU_CTRL_LFXOSC_32K_DISABLE_VAL);
+ writel(val, MCU_CTRL_LFXOSC_CTRL);
+ /* Add any TRIM needed for the crystal here.. */
+ /* Make sure to mux up to take the SoC 32k from the crystal */
+ writel(MCU_CTRL_DEVICE_CLKOUT_LFOSC_SELECT_VAL,
+ MCU_CTRL_DEVICE_CLKOUT_32K_CTRL);
+
enable_caches();
}
#endif
+#endif
#if defined(CONFIG_XPL_BUILD)
void spl_perform_board_fixups(struct spl_image_info *spl_image)
--
2.34.1
More information about the U-Boot
mailing list