2 * armboot - Startup Code for ARM926EJS CPU-core
4 * Copyright (c) 2003 Texas Instruments
6 * ----- Adapted for OMAP1610 OMAP730 from ARM925t code ------
8 * Copyright (c) 2001 Marius Gröger <mag@sysgo.de>
9 * Copyright (c) 2002 Alex Züpke <azu@sysgo.de>
10 * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de>
11 * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com>
12 * Copyright (c) 2003 Kshitij <kshitij@ti.com>
13 * Copyright (c) 2010 Albert Aribaud <albert.u.boot@aribaud.net>
15 * SPDX-License-Identifier: GPL-2.0+
18 #include <asm-offsets.h>
23 *************************************************************************
25 * Startup Code (reset vector)
27 * do important init only if we don't start from memory!
28 * setup Memory and board specific bits prior to relocation.
29 * relocate armboot to ram
32 *************************************************************************
39 * set the cpu to SVC32 mode
47 * we do sys-critical inits only at reboot,
48 * not when booting from ram!
50 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
56 /*------------------------------------------------------------------------------*/
58 .globl c_runtime_cpu_setup
64 *************************************************************************
66 * CPU_init_critical registers
68 * setup important registers
71 *************************************************************************
73 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
76 * flush D cache before disabling it
80 mrc p15, 0, r15, c7, c10, 3
83 mcr p15, 0, r0, c8, c7, 0 /* invalidate TLB */
84 mcr p15, 0, r0, c7, c5, 0 /* invalidate I Cache */
87 * disable MMU and D cache
88 * enable I cache if CONFIG_SYS_ICACHE_OFF is not defined
90 mrc p15, 0, r0, c1, c0, 0
91 bic r0, r0, #0x00000300 /* clear bits 9:8 (---- --RS) */
92 bic r0, r0, #0x00000087 /* clear bits 7, 2:0 (B--- -CAM) */
93 #ifdef CONFIG_SYS_EXCEPTION_VECTORS_HIGH
94 orr r0, r0, #0x00002000 /* set bit 13 (--V- ----) */
96 bic r0, r0, #0x00002000 /* clear bit 13 (--V- ----) */
98 orr r0, r0, #0x00000002 /* set bit 2 (A) Align */
99 #ifndef CONFIG_SYS_ICACHE_OFF
100 orr r0, r0, #0x00001000 /* set bit 12 (I) I-Cache */
102 mcr p15, 0, r0, c1, c0, 0
105 * Go setup Memory and board specific bits prior to relocation.
107 mov ip, lr /* perserve link reg across call */
108 bl lowlevel_init /* go setup pll,mux,memory */
109 mov lr, ip /* restore link */
110 mov pc, lr /* back to my caller */
111 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */