Commit cc4ca483085c36f8316261053b385a1febde6d34

Authored by Peng Fan
1 parent 3afecc120b

MLK-18577-6 imx8: boot0: add boot header

Starting U-Boot in a XEN VM, needs a header, just like Linux Kernel.
Without it, xen tool will take is as a file not supported.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 344ddf76c6de808699ab742d3c11728ca62f36ee)
(cherry picked from commit d260e97be35718bea46019b7ca8666e83d0b9f01)
(cherry picked from commit fa6d1e299da0f6913564dcb11c171cee69a43f8e)
(cherry picked from commit 2f1f8069405bdb74d811bb594cbbea3d552fa31a)

Showing 1 changed file with 17 additions and 0 deletions Inline Diff

arch/arm/include/asm/arch-imx8/boot0.h
1 /* SPDX-License-Identifier: GPL-2.0+ */ 1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /* 2 /*
3 * Copyright 2019 NXP 3 * Copyright 2019 NXP
4 */ 4 */
5 5
6 #ifdef CONFIG_XEN
7 add x13, x18, #0x16
8 b reset
9 /* start of zImage header */
10 .quad 0x80000 // Image load offset from start of RAM
11 .quad _end - _start // Effective size of kernel image
12 .quad 0 // Flags
13 .quad 0 // reserved
14 .quad 0 // reserved
15 .quad 0 // reserved
16 .byte 0x41 // Magic number, "ARM\x64"
17 .byte 0x52
18 .byte 0x4d
19 .byte 0x64
20 /* end of zImage header */
21 #endif
22
6 #if defined(CONFIG_SPL_BUILD) 23 #if defined(CONFIG_SPL_BUILD)
7 /* 24 /*
8 * We use absolute address not PC relative address to jump. 25 * We use absolute address not PC relative address to jump.
9 * When running SPL on iMX8, the A core starts at address 0, a alias to OCRAM 0x100000, 26 * When running SPL on iMX8, the A core starts at address 0, a alias to OCRAM 0x100000,
10 * our linker address for SPL is from 0x100000. So using absolute address can jump to 27 * our linker address for SPL is from 0x100000. So using absolute address can jump to
11 * the OCRAM address from the alias. 28 * the OCRAM address from the alias.
12 * The alias only map first 96KB of OCRAM, so this require the SPL size can't beyond 96KB. 29 * The alias only map first 96KB of OCRAM, so this require the SPL size can't beyond 96KB.
13 * But when using SPL DM, the size increase significantly and may exceed 96KB. 30 * But when using SPL DM, the size increase significantly and may exceed 96KB.
14 * That's why we have to jump to OCRAM. 31 * That's why we have to jump to OCRAM.
15 */ 32 */
16 33
17 ldr x0, =reset 34 ldr x0, =reset
18 br x0 35 br x0
19 #else 36 #else
20 b reset 37 b reset
21 #endif 38 #endif
22 39