soc: ambiq: enable the TPIU clock source
This commit enables the TPIU clock source in Apollo3 and Apollo4 soc initialization if LOG_BACKEND_SWO is used. Signed-off-by: Aaron Ye <aye@ambiq.com>
This commit is contained in:
parent
fe3c0ecb53
commit
f7b2638165
|
@ -28,4 +28,10 @@ void soc_early_init_hook(void)
|
|||
#ifdef CONFIG_PM
|
||||
ambiq_power_init();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LOG_BACKEND_SWO
|
||||
/* Select HFRC/8 (6MHz) for the TPIU clock source */
|
||||
MCUCTRL->TPIUCTRL_b.CLKSEL = MCUCTRL_TPIUCTRL_CLKSEL_HFRCDIV8;
|
||||
MCUCTRL->TPIUCTRL_b.ENABLE = MCUCTRL_TPIUCTRL_ENABLE_EN;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -23,4 +23,10 @@ void soc_early_init_hook(void)
|
|||
#ifdef CONFIG_PM
|
||||
ambiq_power_init();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LOG_BACKEND_SWO
|
||||
/* Select HFRC 48MHz for the TPIU clock source */
|
||||
MCUCTRL->DBGCTRL_b.CM4CLKSEL = MCUCTRL_DBGCTRL_CM4CLKSEL_HFRC48;
|
||||
MCUCTRL->DBGCTRL_b.CM4TPIUENABLE = MCUCTRL_DBGCTRL_CM4TPIUENABLE_EN;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue