1/* 2 * armboot - Startup Code for ARM720 CPU-core 3 * 4 * Copyright (c) 2001 Marius Gröger <mag@sysgo.de> 5 * Copyright (c) 2002 Alex Züpke <azu@sysgo.de> 6 * 7 * SPDX-License-Identifier: GPL-2.0+ 8 */ 9 10#include <asm-offsets.h> 11#include <config.h> 12#include <version.h> 13#include <asm/hardware.h> 14 15/* 16 ************************************************************************* 17 * 18 * Startup Code (reset vector) 19 * 20 * do important init only if we don't start from RAM! 21 * relocate armboot to ram 22 * setup stack 23 * jump to second stage 24 * 25 ************************************************************************* 26 */ 27 28 .globl reset 29 30reset: 31 /* 32 * set the cpu to SVC32 mode 33 */ 34 mrs r0,cpsr 35 bic r0,r0,#0x1f 36 orr r0,r0,#0xd3 37 msr cpsr,r0 38 39 /* 40 * we do sys-critical inits only at reboot, 41 * not when booting from ram! 42 */ 43#ifndef CONFIG_SKIP_LOWLEVEL_INIT 44 bl cpu_init_crit 45#endif 46 47 bl _main 48 49/*------------------------------------------------------------------------------*/ 50 51 .globl c_runtime_cpu_setup 52c_runtime_cpu_setup: 53 54 mov pc, lr 55 56/* 57 ************************************************************************* 58 * 59 * CPU_init_critical registers 60 * 61 * setup important registers 62 * setup memory timing 63 * 64 ************************************************************************* 65 */ 66 67#ifndef CONFIG_SKIP_LOWLEVEL_INIT 68cpu_init_crit: 69 70 mov ip, lr 71 /* 72 * before relocating, we have to setup RAM timing 73 * because memory timing is board-dependent, you will 74 * find a lowlevel_init.S in your board directory. 75 */ 76 bl lowlevel_init 77 mov lr, ip 78 79 mov pc, lr 80#endif /* CONFIG_SKIP_LOWLEVEL_INIT */ 81