Skip to content

Commit b819176

Browse files
committed
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 <[email protected]>
1 parent b0e9955 commit b819176

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

soc/andestech/ae350/pma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ void pma_init_per_core(void)
194194
#endif /* CONFIG_NOCACHE_MEMORY */
195195
}
196196

197-
void soc_early_init_hook(void)
197+
void pma_init(void)
198198
{
199199
unsigned long mmsc_cfg;
200200

soc/andestech/ae350/pma.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313
* (e.g. uncacheable) affects all CPUs.
1414
*/
1515
void pma_init_per_core(void);
16+
17+
/* Initialize PMA */
18+
void pma_init(void);

soc/andestech/ae350/soc.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,12 @@ void soc_per_core_init_hook(void)
1414
#endif /* SOC_ANDES_V5_PMA */
1515
}
1616
#endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
17+
18+
#ifdef CONFIG_SOC_EARLY_INIT_HOOK
19+
void soc_early_init_hook(void)
20+
{
21+
#ifdef CONFIG_SOC_ANDES_V5_PMA
22+
pma_init();
23+
#endif /* CONFIG_SOC_ANDES_V5_PMA */
24+
}
25+
#endif /* CONFIG_SOC_EARLY_INIT_HOOK */

0 commit comments

Comments
 (0)