Matthias Kaehlcke | 195dbd1 | 2010-02-01 21:29:39 +0100 | [diff] [blame] | 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 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: GPL-2.0+ |
Matthias Kaehlcke | 195dbd1 | 2010-02-01 21:29:39 +0100 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #include <version.h> |
| 12 | #include <asm/arch/ep93xx.h> |
| 13 | |
| 14 | .globl lowlevel_init |
| 15 | lowlevel_init: |
| 16 | /* backup return address */ |
| 17 | ldr r1, =SYSCON_SCRATCH0 |
| 18 | str lr, [r1] |
| 19 | |
| 20 | /* Turn on both LEDs */ |
Jason Kridner | aff0aa8 | 2011-09-04 14:40:16 -0400 | [diff] [blame] | 21 | bl red_led_on |
| 22 | bl green_led_on |
Matthias Kaehlcke | 195dbd1 | 2010-02-01 21:29:39 +0100 | [diff] [blame] | 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 */ |
Jason Kridner | aff0aa8 | 2011-09-04 14:40:16 -0400 | [diff] [blame] | 31 | bl green_led_off |
Matthias Kaehlcke | 195dbd1 | 2010-02-01 21:29:39 +0100 | [diff] [blame] | 32 | |
| 33 | /* Setup SDRAM */ |
| 34 | bl sdram_cfg |
| 35 | |
| 36 | /* Turn on Green LED, Turn off the Red LED */ |
Jason Kridner | aff0aa8 | 2011-09-04 14:40:16 -0400 | [diff] [blame] | 37 | bl green_led_on |
| 38 | bl red_led_off |
Matthias Kaehlcke | 195dbd1 | 2010-02-01 21:29:39 +0100 | [diff] [blame] | 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 |