2018-05-07 06:58:06 +09:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2002-11-03 09:38:21 +09:00
|
|
|
/*
|
|
|
|
* armboot - Startup Code for ARM720 CPU-core
|
|
|
|
*
|
2011-08-05 01:45:45 +09:00
|
|
|
* Copyright (c) 2001 Marius Gröger <mag@sysgo.de>
|
|
|
|
* Copyright (c) 2002 Alex Züpke <azu@sysgo.de>
|
2002-11-03 09:38:21 +09:00
|
|
|
*/
|
|
|
|
|
2010-10-26 21:34:52 +09:00
|
|
|
#include <asm-offsets.h>
|
2002-11-03 09:38:21 +09:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
*************************************************************************
|
|
|
|
*
|
|
|
|
* Startup Code (reset vector)
|
|
|
|
*
|
2004-02-09 04:38:38 +09:00
|
|
|
* do important init only if we don't start from RAM!
|
2002-11-03 09:38:21 +09:00
|
|
|
* relocate armboot to ram
|
|
|
|
* setup stack
|
|
|
|
* jump to second stage
|
|
|
|
*
|
|
|
|
*************************************************************************
|
|
|
|
*/
|
|
|
|
|
2014-04-15 23:13:51 +09:00
|
|
|
.globl reset
|
2010-09-17 20:10:52 +09:00
|
|
|
|
|
|
|
reset:
|
|
|
|
/*
|
|
|
|
* set the cpu to SVC32 mode
|
|
|
|
*/
|
|
|
|
mrs r0,cpsr
|
|
|
|
bic r0,r0,#0x1f
|
|
|
|
orr r0,r0,#0xd3
|
|
|
|
msr cpsr,r0
|
|
|
|
|
|
|
|
/*
|
|
|
|
* we do sys-critical inits only at reboot,
|
|
|
|
* not when booting from ram!
|
|
|
|
*/
|
2017-06-01 08:57:11 +09:00
|
|
|
#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
|
|
|
|
!defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
|
2010-09-17 20:10:52 +09:00
|
|
|
bl cpu_init_crit
|
|
|
|
#endif
|
|
|
|
|
2013-01-08 19:18:02 +09:00
|
|
|
bl _main
|
2010-09-17 20:10:52 +09:00
|
|
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
|
2013-01-08 19:18:02 +09:00
|
|
|
.globl c_runtime_cpu_setup
|
|
|
|
c_runtime_cpu_setup:
|
|
|
|
|
|
|
|
mov pc, lr
|
|
|
|
|
2002-11-03 09:38:21 +09:00
|
|
|
/*
|
|
|
|
*************************************************************************
|
|
|
|
*
|
|
|
|
* CPU_init_critical registers
|
|
|
|
*
|
|
|
|
* setup important registers
|
|
|
|
* setup memory timing
|
|
|
|
*
|
|
|
|
*************************************************************************
|
|
|
|
*/
|
|
|
|
|
2017-06-01 08:57:11 +09:00
|
|
|
#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
|
|
|
|
!defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
|
2002-11-03 09:38:21 +09:00
|
|
|
cpu_init_crit:
|
|
|
|
|
2005-10-07 00:08:18 +09:00
|
|
|
mov ip, lr
|
2002-11-03 09:38:21 +09:00
|
|
|
/*
|
|
|
|
* before relocating, we have to setup RAM timing
|
2004-02-09 04:38:38 +09:00
|
|
|
* because memory timing is board-dependent, you will
|
2005-04-03 08:52:25 +09:00
|
|
|
* find a lowlevel_init.S in your board directory.
|
2002-11-03 09:38:21 +09:00
|
|
|
*/
|
2005-04-03 08:52:25 +09:00
|
|
|
bl lowlevel_init
|
2002-11-03 09:38:21 +09:00
|
|
|
mov lr, ip
|
|
|
|
|
|
|
|
mov pc, lr
|
2013-05-21 22:44:10 +09:00
|
|
|
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
|