Browse Source

soc: andestech: refactor out soc_early_init_hook() from pma.c

Refactor out the `soc_early_init_hook()` function from `pma.c` to
`soc.c` which is always compiled so that it can be extended to run
other init functions easily in the future. Then, restore the function
in `pma.c` to `pma_init()`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
pull/81485/head
Yong Cong Sin 8 months ago committed by Anas Nashif
parent
commit
ad7f3a9a0c
  1. 2
      soc/andestech/ae350/pma.c
  2. 3
      soc/andestech/ae350/pma.h
  3. 9
      soc/andestech/ae350/soc.c

2
soc/andestech/ae350/pma.c

@ -194,7 +194,7 @@ void pma_init_per_core(void)
#endif /* CONFIG_NOCACHE_MEMORY */ #endif /* CONFIG_NOCACHE_MEMORY */
} }
void soc_early_init_hook(void) void pma_init(void)
{ {
unsigned long mmsc_cfg; unsigned long mmsc_cfg;

3
soc/andestech/ae350/pma.h

@ -13,3 +13,6 @@
* (e.g. uncacheable) affects all CPUs. * (e.g. uncacheable) affects all CPUs.
*/ */
void pma_init_per_core(void); void pma_init_per_core(void);
/* Initialize PMA */
void pma_init(void);

9
soc/andestech/ae350/soc.c

@ -14,3 +14,12 @@ void soc_per_core_init_hook(void)
#endif /* SOC_ANDES_V5_PMA */ #endif /* SOC_ANDES_V5_PMA */
} }
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */ #endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
#ifdef CONFIG_SOC_EARLY_INIT_HOOK
void soc_early_init_hook(void)
{
#ifdef CONFIG_SOC_ANDES_V5_PMA
pma_init();
#endif /* CONFIG_SOC_ANDES_V5_PMA */
}
#endif /* CONFIG_SOC_EARLY_INIT_HOOK */

Loading…
Cancel
Save