blob: bf2fa2ac320b989b050d92e98550b5b09fe0b12d [file] [log] [blame]
Matthias Kaehlcke195dbd12010-02-01 21:29:39 +01001/*
2 * Low-level initialization for EP93xx
3 *
4 * Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
5 *
6 * Copyright (C) 2006 Dominic Rath <Dominic.Rath@gmx.de>
7 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02008 * SPDX-License-Identifier: GPL-2.0+
Matthias Kaehlcke195dbd12010-02-01 21:29:39 +01009 */
10
11#include <version.h>
12#include <asm/arch/ep93xx.h>
13
14.globl lowlevel_init
15lowlevel_init:
16 /* backup return address */
17 ldr r1, =SYSCON_SCRATCH0
18 str lr, [r1]
19
20 /* Turn on both LEDs */
Jason Kridneraff0aa82011-09-04 14:40:16 -040021 bl red_led_on
22 bl green_led_on
Matthias Kaehlcke195dbd12010-02-01 21:29:39 +010023
24 /* Configure flash wait states before we switch to the PLL */
25 bl flash_cfg
26
27 /* Set up PLL */
28 bl pll_cfg
29
30 /* Turn off the Green LED and leave the Red LED on */
Jason Kridneraff0aa82011-09-04 14:40:16 -040031 bl green_led_off
Matthias Kaehlcke195dbd12010-02-01 21:29:39 +010032
33 /* Setup SDRAM */
34 bl sdram_cfg
35
36 /* Turn on Green LED, Turn off the Red LED */
Jason Kridneraff0aa82011-09-04 14:40:16 -040037 bl green_led_on
38 bl red_led_off
Matthias Kaehlcke195dbd12010-02-01 21:29:39 +010039
40 /* FIXME: we use async mode for now */
41 mrc p15, 0, r0, c1, c0, 0
42 orr r0, r0, #0xc0000000
43 mcr p15, 0, r0, c1, c0, 0
44
45 /* restore return address */
46 ldr r1, =SYSCON_SCRATCH0
47 ldr lr, [r1]
48
49 mov pc, lr