mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
c0b4e10144
Add support for detecting a vmlinuz.bin appended dtb and overriding the boot arguments to match the UHI interface. To ensure _edata / __apendend_dtb points to the actual end of the binary, align the data section to 16 bytes instead of the address cursor. Due to ld.script not going through the preprocessor, we can't check for MIPS_ZBOOT_APPENDED_DTB being enabled, so always reserve space for it. It should have no consequences for booting without it enabled except 1 MiB more ram usage during the uncompressing stage. Signed-off-by: Jonas Gorski <jogo@openwrt.org> Cc: linux-mips@linux-mips.org Cc: devicetree@vger.kernel.org Cc: John Crispin <blogic@openwrt.org> Cc: Kevin Cernekee <cernekee@gmail.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: Markos Chandras <markos.chandras@imgtec.com> Cc: Andrew Bresticker <abrestic@chromium.org> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Paul Burton <paul.burton@imgtec.com> Cc: James Hartley <James.Hartley@imgtec.com> Patchwork: https://patchwork.linux-mips.org/patch/9741/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
72 lines
1.3 KiB
ArmAsm
72 lines
1.3 KiB
ArmAsm
/*
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
* for more details.
|
|
*
|
|
* Copyright (C) 1994, 1995 Waldorf Electronics
|
|
* Written by Ralf Baechle and Andreas Busse
|
|
* Copyright (C) 1995 - 1999 Ralf Baechle
|
|
* Copyright (C) 1996 Paul M. Antoine
|
|
* Modified for DECStation and hence R3000 support by Paul M. Antoine
|
|
* Further modifications by David S. Miller and Harald Koerfgen
|
|
* Copyright (C) 1999 Silicon Graphics, Inc.
|
|
*/
|
|
|
|
#include <asm/asm.h>
|
|
#include <asm/regdef.h>
|
|
|
|
.set noreorder
|
|
.cprestore
|
|
LEAF(start)
|
|
start:
|
|
/* Save boot rom start args */
|
|
move s0, a0
|
|
move s1, a1
|
|
move s2, a2
|
|
move s3, a3
|
|
|
|
#ifdef CONFIG_MIPS_ZBOOT_APPENDED_DTB
|
|
PTR_LA t0, __appended_dtb
|
|
#ifdef CONFIG_CPU_BIG_ENDIAN
|
|
li t1, 0xd00dfeed
|
|
#else
|
|
li t1, 0xedfe0dd0
|
|
#endif
|
|
lw t2, (t0)
|
|
bne t1, t2, not_found
|
|
nop
|
|
|
|
move s1, t0
|
|
PTR_LI s0, -2
|
|
not_found:
|
|
#endif
|
|
|
|
/* Clear BSS */
|
|
PTR_LA a0, _edata
|
|
PTR_LA a2, _end
|
|
1: sw zero, 0(a0)
|
|
bne a2, a0, 1b
|
|
addiu a0, a0, 4
|
|
|
|
PTR_LA a0, (.heap) /* heap address */
|
|
PTR_LA sp, (.stack + 8192) /* stack address */
|
|
|
|
PTR_LA ra, 2f
|
|
PTR_LA k0, decompress_kernel
|
|
jr k0
|
|
nop
|
|
2:
|
|
move a0, s0
|
|
move a1, s1
|
|
move a2, s2
|
|
move a3, s3
|
|
PTR_LI k0, KERNEL_ENTRY
|
|
jr k0
|
|
nop
|
|
3:
|
|
b 3b
|
|
nop
|
|
END(start)
|
|
|
|
.comm .heap,BOOT_HEAP_SIZE,4
|
|
.comm .stack,4096*2,4
|