1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * armboot - Startup Code for OMP2420/ARM1136 CPU-core
5 * Copyright (c) 2004 Texas Instruments <r-woodruff2@ti.com>
7 * Copyright (c) 2001 Marius Gröger <mag@sysgo.de>
8 * Copyright (c) 2002 Alex Züpke <azu@sysgo.de>
9 * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de>
10 * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com>
11 * Copyright (c) 2003 Kshitij <kshitij@ti.com>
14 #include <asm-offsets.h>
18 *************************************************************************
20 * Startup Code (reset vector)
22 * do important init only if we don't start from memory!
23 * setup Memory and board specific bits prior to relocation.
24 * relocate armboot to ram
27 *************************************************************************
34 * set the cpu to SVC32 mode
41 /* the mask ROM code should have PLL and others stable */
42 #if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT)
48 /*------------------------------------------------------------------------------*/
50 .globl c_runtime_cpu_setup
56 *************************************************************************
58 * CPU_init_critical registers
60 * setup important registers
63 *************************************************************************
65 #if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT)
71 mcr p15, 0, r0, c7, c7, 0 /* Invalidate I+D+BTB caches */
72 mcr p15, 0, r0, c8, c7, 0 /* Invalidate Unified TLB */
75 * disable MMU stuff and caches
77 mrc p15, 0, r0, c1, c0, 0
78 bic r0, r0, #0x00002300 @ clear bits 13, 9:8 (--V- --RS)
79 bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM)
80 orr r0, r0, #0x00000002 @ set bit 1 (A) Align
81 orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache
82 mcr p15, 0, r0, c1, c0, 0
84 #if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT_ONLY)
86 * Jump to board specific initialization... The Mask ROM will have already initialized
87 * basic memory. Go here to bump up clock rate and handle wake up conditions.
89 mov ip, lr /* persevere link reg across call */
90 bl lowlevel_init /* go setup pll,mux,memory */
91 mov lr, ip /* restore link */
93 mov pc, lr /* back to my caller */
94 #endif /* !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) */