/* * Copyright 2022 NXP * * SPDX-License-Identifier: Apache-2.0 */ #include #include #include #include #include #include void soc_reset_hook(void) { /* enable peripheral port access at EL1 and EL0 */ __asm__ volatile("mrc p15, 0, r0, c15, c0, 0\n"); __asm__ volatile("orr r0, #1\n"); __asm__ volatile("mcr p15, 0, r0, c15, c0, 0\n"); barrier_dsync_fence_full(); barrier_isync_fence_full(); /* * Take exceptions in Arm mode because Zephyr ASM code for Cortex-R Aarch32 * is written for Arm */ __set_SCTLR(__get_SCTLR() & ~SCTLR_TE_Msk); if (IS_ENABLED(CONFIG_ICACHE)) { if (!(__get_SCTLR() & SCTLR_I_Msk)) { L1C_InvalidateICacheAll(); __set_SCTLR(__get_SCTLR() | SCTLR_I_Msk); barrier_isync_fence_full(); } } if (IS_ENABLED(CONFIG_DCACHE)) { if (!(__get_SCTLR() & SCTLR_C_Msk)) { L1C_InvalidateDCacheAll(); __set_SCTLR(__get_SCTLR() | SCTLR_C_Msk); barrier_dsync_fence_full(); } } } void soc_early_init_hook(void) { OsIf_Init(NULL); }