diff options
author | Tom Rini <trini@konsulko.com> | 2020-05-15 16:42:06 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-05-15 16:42:06 -0400 |
commit | 506159549df76034dfbdee562304ce4c102d3a06 (patch) | |
tree | 85c116fc3267a1ce16d6771f0a08675788d48ccd /arch/arm/mach-lpc32xx/lowlevel_init.S | |
parent | 5f09f9af3cc335fe6a74c031cfa0b1d8bdf4b9db (diff) | |
parent | 24bf6e84ce22cd1b53cb79e4f89a4036af7e9c6b (diff) |
Merge branch '2020-05-15-misc-bugfixes'
- A number of symbol name consistency updates
- JFFS2 bugfix
- Use /* fallthrough */ for now to help at least gcc know when we're
intentionally not 'break;'ing in a switch statement, we'll adopt
fallthrough; later on.
- Assorted other fixes
Diffstat (limited to 'arch/arm/mach-lpc32xx/lowlevel_init.S')
-rw-r--r-- | arch/arm/mach-lpc32xx/lowlevel_init.S | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/mach-lpc32xx/lowlevel_init.S b/arch/arm/mach-lpc32xx/lowlevel_init.S new file mode 100644 index 0000000000..d42da2bc56 --- /dev/null +++ b/arch/arm/mach-lpc32xx/lowlevel_init.S @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * WORK Microwave work_92105 board low level init + * + * (C) Copyright 2014 DENX Software Engineering GmbH + * Written-by: Albert ARIBAUD <albert.aribaud@3adev.fr> + * + * Low level init is called from SPL to set up the clocks. + * On entry, the LPC3250 is in Direct Run mode with all clocks + * running at 13 MHz; on exit, ARM clock is 208 MHz, HCLK is + * 104 MHz and PCLK is 13 MHz. + * + * This code must run from SRAM so that the clock changes do + * not prevent it from executing. + */ + +.globl lowlevel_init + +lowlevel_init: + + /* Set ARM, HCLK, PCLK dividers for normal mode */ + ldr r0, =0x0000003D + ldr r1, =0x40004040 + str r0, [r1] + + /* Start HCLK PLL for 208 MHz */ + ldr r0, =0x0001401E + ldr r1, =0x40004058 + str r0, [r1] + + /* wait for HCLK PLL to lock */ +1: + ldr r0, [r1] + ands r0, r0, #1 + beq 1b + + /* switch to normal mode */ + ldr r1, =0x40004044 + ldr r0, [r1] + orr r0, #0x00000004 + str r0, [r1] + + /* Return to U-Boot via saved link register */ + mov pc, lr |