1/*
2 * Copyright (C) 2016 Imagination Technologies
3 *
4 * SPDX-License-Identifier:	GPL-2.0
5 */
6
7#include <config.h>
8
9#include <asm/addrspace.h>
10#include <asm/asm.h>
11#include <asm/mipsregs.h>
12#include <asm/regdef.h>
13
14#include "boston-regs.h"
15
16.data
17
18msg_ddr_cal:	.ascii "DDR Cal "
19msg_ddr_ok:	.ascii "DDR OK  "
20
21.text
22
23LEAF(lowlevel_init)
24	move	s0, ra
25
26	PTR_LA	a0, msg_ddr_cal
27	bal	lowlevel_display
28
29	PTR_LI	t0, BOSTON_PLAT_DDR3STAT
301:	lw	t1, 0(t0)
31	andi	t1, t1, BOSTON_PLAT_DDR3STAT_CALIB
32	beqz	t1, 1b
33
34	PTR_LA	a0, msg_ddr_ok
35	bal	lowlevel_display
36
37	move	v0, zero
38	jr	s0
39	END(lowlevel_init)
40
41LEAF(lowlevel_display)
42	.set	push
43	.set	noat
44	PTR_LI	AT, BOSTON_LCD_BASE
45#ifdef CONFIG_64BIT
46	ld	k1, 0(a0)
47	sd	k1, 0(AT)
48#else
49	lw	k1, 0(a0)
50	sw	k1, 0(AT)
51	lw	k1, 4(a0)
52	sw	k1, 4(AT)
53#endif
54	.set	pop
551:	jr	ra
56	END(lowlevel_display)
57