2 * armboot - Startup Code for ARM926EJS CPU-core
4 * Copyright (c) 2003 Texas Instruments
6 * ----- Adapted for OMAP1610 OMAP730 from ARM925t code ------
15 * SPDX-License-Identifier: GPL-2.0+
18 #include <asm-offsets.h>
24 *************************************************************************
26 * Startup Code (reset vector)
28 * do important init only if we don't start from memory!
29 * setup Memory and board specific bits prior to relocation.
30 * relocate armboot to ram
33 *************************************************************************
40 * set the cpu to SVC32 mode
48 * we do sys-critical inits only at reboot,
49 * not when booting from ram!
51 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
57 /*------------------------------------------------------------------------------*/
59 .globl c_runtime_cpu_setup
65 *************************************************************************
67 * CPU_init_critical registers
69 * setup important registers
72 *************************************************************************
74 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
77 * flush D cache before disabling it
81 mrc p15, 0, r15, c7, c10, 3
84 mcr p15, 0, r0, c8, c7, 0 /* invalidate TLB */
85 mcr p15, 0, r0, c7, c5, 0 /* invalidate I Cache */
88 * disable MMU and D cache
89 * enable I cache if CONFIG_SYS_ICACHE_OFF is not defined
91 mrc p15, 0, r0, c1, c0, 0
92 bic r0, r0, #0x00000300 /* clear bits 9:8 (---- --RS) */
93 bic r0, r0, #0x00000087 /* clear bits 7, 2:0 (B--- -CAM) */
94 #ifdef CONFIG_SYS_EXCEPTION_VECTORS_HIGH
95 orr r0, r0, #0x00002000 /* set bit 13 (--V- ----) */
97 bic r0, r0, #0x00002000 /* clear bit 13 (--V- ----) */
99 orr r0, r0, #0x00000002 /* set bit 2 (A) Align */
100 #ifndef CONFIG_SYS_ICACHE_OFF
101 orr r0, r0, #0x00001000 /* set bit 12 (I) I-Cache */
103 mcr p15, 0, r0, c1, c0, 0
106 * Go setup Memory and board specific bits prior to relocation.
108 mov ip, lr /* perserve link reg across call */
109 bl lowlevel_init /* go setup pll,mux,memory */
110 mov lr, ip /* restore link */
111 mov pc, lr /* back to my caller */
112 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */