File tree Expand file tree Collapse file tree 5 files changed +33
-9
lines changed
Expand file tree Collapse file tree 5 files changed +33
-9
lines changed Original file line number Diff line number Diff line change 33zephyr_include_directories(.)
44
55zephyr_sources(
6+ soc.c
67 start .S
78 soc_irq.S
89)
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ config SOC_ANDES_V5_PMA
9292 bool "Andes V5 Physical Memory Attribute (PMA)"
9393 select ARCH_HAS_NOCACHE_MEMORY_SUPPORT
9494 select SOC_EARLY_INIT_HOOK
95+ select SOC_PER_CORE_INIT_HOOK
9596 help
9697 This option enables the Andes V5 PMA, in order to support SW to
9798 configure physical memory attribute by PMA CSRs. The address
Original file line number Diff line number Diff line change @@ -187,13 +187,6 @@ static void configure_nocache_region(void)
187187}
188188#endif /* CONFIG_NOCACHE_MEMORY */
189189
190- /*
191- * @brief Init PMA CSRs of each CPU core
192- *
193- * In SMP, each CPU has it's own PMA CSR and PMA CSR only affect one CPU.
194- * We should configure CSRs of all CPUs to make memory attribute
195- * (e.g. uncacheable) affects all CPUs.
196- */
197190void pma_init_per_core (void )
198191{
199192#ifdef CONFIG_NOCACHE_MEMORY
@@ -218,6 +211,4 @@ void soc_early_init_hook(void)
218211#endif
219212 return ;
220213 }
221-
222- pma_init_per_core ();
223214}
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2021 Andes Technology Corporation
3+ * Copyright (c) 2024 Meta Platforms
4+ *
5+ * SPDX-License-Identifier: Apache-2.0
6+ */
7+
8+ /*
9+ * @brief Init PMA CSRs of each CPU core
10+ *
11+ * In SMP, each CPU has it's own PMA CSR and PMA CSR only affect one CPU.
12+ * We should configure CSRs of all CPUs to make memory attribute
13+ * (e.g. uncacheable) affects all CPUs.
14+ */
15+ void pma_init_per_core (void );
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2024 Meta Platforms
3+ *
4+ * SPDX-License-Identifier: Apache-2.0
5+ */
6+
7+ #include "pma.h"
8+
9+ #ifdef CONFIG_SOC_PER_CORE_INIT_HOOK
10+ void soc_per_core_init_hook (void )
11+ {
12+ #ifdef CONFIG_SOC_ANDES_V5_PMA
13+ pma_init_per_core ();
14+ #endif /* SOC_ANDES_V5_PMA */
15+ }
16+ #endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */
You can’t perform that action at this time.
0 commit comments