1/*
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 *
8 * SPDX-License-Identifier:	GPL-2.0+
9 */
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 */
21	bl red_led_on
22	bl green_led_on
23
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 */
31	bl green_led_off
32
33	/* Setup SDRAM */
34	bl sdram_cfg
35
36	/* Turn on Green LED, Turn off the Red LED */
37	bl green_led_on
38	bl red_led_off
39
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
50