blob: 2761bf2cd52746501e46f4a9f6bacdb20dd0d84b [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0 */
Paul Burtonad8783c2016-09-08 07:47:39 +01002/*
3 * Copyright (C) 2016 Imagination Technologies
Paul Burtonad8783c2016-09-08 07:47:39 +01004 */
5
6#include <config.h>
7
8#include <asm/addrspace.h>
9#include <asm/asm.h>
10#include <asm/mipsregs.h>
11#include <asm/regdef.h>
12
13#include "boston-regs.h"
14
15.data
16
17msg_ddr_cal: .ascii "DDR Cal "
18msg_ddr_ok: .ascii "DDR OK "
19
20.text
21
22LEAF(lowlevel_init)
23 move s0, ra
24
25 PTR_LA a0, msg_ddr_cal
26 bal lowlevel_display
27
28 PTR_LI t0, BOSTON_PLAT_DDR3STAT
291: lw t1, 0(t0)
30 andi t1, t1, BOSTON_PLAT_DDR3STAT_CALIB
31 beqz t1, 1b
32
33 PTR_LA a0, msg_ddr_ok
34 bal lowlevel_display
35
Paul Burtonad8783c2016-09-08 07:47:39 +010036 jr s0
37 END(lowlevel_init)
38
39LEAF(lowlevel_display)
40 .set push
41 .set noat
42 PTR_LI AT, BOSTON_LCD_BASE
43#ifdef CONFIG_64BIT
44 ld k1, 0(a0)
45 sd k1, 0(AT)
46#else
47 lw k1, 0(a0)
48 sw k1, 0(AT)
49 lw k1, 4(a0)
50 sw k1, 4(AT)
51#endif
52 .set pop
Paul Burton64f733d2017-09-15 11:34:31 -070053 jr ra
Paul Burtonad8783c2016-09-08 07:47:39 +010054 END(lowlevel_display)