summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/protonic-stm32mp1/lowlevel.c
blob: 583f72dfe7c38fafb342333e777726b141b55323 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: 2021 David Jander, Protonic Holland

#include <common.h>
#include <debug_ll.h>
#include <mach/entry.h>

extern char __dtb_z_stm32mp151_prtt1a_start[];
extern char __dtb_z_stm32mp151_prtt1c_start[];
extern char __dtb_z_stm32mp151_prtt1s_start[];

static void setup_uart(void)
{
	/* first stage has set up the UART, so nothing to do here */
	putc_ll('>');
}

ENTRY_FUNCTION(start_prtt1a, r0, r1, r2)
{
	void *fdt;

	stm32mp_cpu_lowlevel_init();

	if (IS_ENABLED(CONFIG_DEBUG_LL))
		setup_uart();

	fdt = __dtb_z_stm32mp151_prtt1a_start + get_runtime_offset();

	stm32mp1_barebox_entry(fdt);
}

ENTRY_FUNCTION(start_prtt1c, r0, r1, r2)
{
	void *fdt;

	stm32mp_cpu_lowlevel_init();

	if (IS_ENABLED(CONFIG_DEBUG_LL))
		setup_uart();

	fdt = __dtb_z_stm32mp151_prtt1c_start + get_runtime_offset();

	stm32mp1_barebox_entry(fdt);
}

ENTRY_FUNCTION(start_prtt1s, r0, r1, r2)
{
	void *fdt;

	stm32mp_cpu_lowlevel_init();

	if (IS_ENABLED(CONFIG_DEBUG_LL))
		setup_uart();

	fdt = __dtb_z_stm32mp151_prtt1s_start + get_runtime_offset();

	stm32mp1_barebox_entry(fdt);
}