arm64: Use new arm_kernel_boothdr script for generating booti images.
This commit is contained in:
parent
e163cae76e
commit
28482babd0
@ -43,22 +43,6 @@
|
|||||||
.globl kernbase
|
.globl kernbase
|
||||||
.set kernbase, KERNBASE
|
.set kernbase, KERNBASE
|
||||||
|
|
||||||
|
|
||||||
/* U-Boot booti related constants. */
|
|
||||||
#if defined(LINUX_BOOT_ABI)
|
|
||||||
#ifndef UBOOT_IMAGE_OFFSET
|
|
||||||
#define UBOOT_IMAGE_OFFSET 0 /* Image offset from start of */
|
|
||||||
#endif /* 2 MiB page */
|
|
||||||
|
|
||||||
#ifndef UBOOT_IMAGE_SIZE /* Total size of image */
|
|
||||||
#define UBOOT_IMAGE_SIZE _end - _start
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef UBOOT_IMAGE_FLAGS
|
|
||||||
#define UBOOT_IMAGE_FLAGS 0 /* LE kernel, unspecified */
|
|
||||||
#endif /* page size */
|
|
||||||
#endif /* defined(LINUX_BOOT_ABI) */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We assume:
|
* We assume:
|
||||||
* MMU on with an identity map, or off
|
* MMU on with an identity map, or off
|
||||||
@ -68,21 +52,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
ENTRY(_start)
|
ENTRY(_start)
|
||||||
#if defined(LINUX_BOOT_ABI)
|
|
||||||
/* U-boot image header */
|
|
||||||
b 1f /* code 0 */
|
|
||||||
.long 0 /* code 1 */
|
|
||||||
.quad UBOOT_IMAGE_OFFSET /* Image offset in 2 MiB page, LE */
|
|
||||||
.quad UBOOT_IMAGE_SIZE /* Image size, LE */
|
|
||||||
.quad UBOOT_IMAGE_FLAGS /* Flags for kernel. LE */
|
|
||||||
.quad 0 /* Reserved */
|
|
||||||
.quad 0 /* Reserved */
|
|
||||||
.quad 0 /* Reserved */
|
|
||||||
.long 0x644d5241 /* Magic "ARM\x64", LE */
|
|
||||||
.long 0 /* Reserved for PE COFF offset*/
|
|
||||||
1:
|
|
||||||
#endif /* defined(LINUX_BOOT_ABI) */
|
|
||||||
|
|
||||||
/* Drop to EL1 */
|
/* Drop to EL1 */
|
||||||
bl drop_to_el1
|
bl drop_to_el1
|
||||||
|
|
||||||
|
@ -40,25 +40,11 @@ SYSTEM_LD= \
|
|||||||
--strip-symbol='$$[adtx]*' \
|
--strip-symbol='$$[adtx]*' \
|
||||||
${.TARGET}
|
${.TARGET}
|
||||||
|
|
||||||
# Generate the .bin (no elf headers) kernel as an extra build output.
|
# Generate the .bin (booti images) kernel as an extra build output.
|
||||||
# We must relink to generate the .bin kernel, because without headers the
|
# The targets and rules to generate these appear near the end of the file.
|
||||||
# location of everything changes. We also strip the ARM marker symbols.
|
|
||||||
KERNEL_EXTRA+= ${KERNEL_KO}.bin
|
KERNEL_EXTRA+= ${KERNEL_KO}.bin
|
||||||
KERNEL_EXTRA_INSTALL+= ${KERNEL_KO}.bin
|
KERNEL_EXTRA_INSTALL+= ${KERNEL_KO}.bin
|
||||||
|
|
||||||
${KERNEL_KO}.bin: ${SYSTEM_DEP} vers.o
|
|
||||||
@echo "linking ${.TARGET}"
|
|
||||||
@${SYSTEM_LD_BASECMD} \
|
|
||||||
--defsym='text_start=kernbase' \
|
|
||||||
-o ${.TARGET} ${SYSTEM_OBJS} vers.o
|
|
||||||
${SIZE} ${.TARGET}
|
|
||||||
@${OBJCOPY} \
|
|
||||||
--wildcard \
|
|
||||||
--strip-symbol='$$[adtx]*' \
|
|
||||||
--output-target=binary \
|
|
||||||
${.TARGET}
|
|
||||||
@chmod 755 ${.TARGET}
|
|
||||||
|
|
||||||
.if !empty(DDB_ENABLED)
|
.if !empty(DDB_ENABLED)
|
||||||
CFLAGS += -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
|
CFLAGS += -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
|
||||||
.endif
|
.endif
|
||||||
@ -79,3 +65,21 @@ CLEAN+= ${KERNEL_KO}.bin
|
|||||||
%RULES
|
%RULES
|
||||||
|
|
||||||
.include "$S/conf/kern.post.mk"
|
.include "$S/conf/kern.post.mk"
|
||||||
|
|
||||||
|
# Create a kernel.bin file...
|
||||||
|
# Copy the kernel to u-boot's booti image format (the elf headers are
|
||||||
|
# stripped and a custom binary head blob is prepended), saving the
|
||||||
|
# output in a temp file. We also strip arm "marker" symbols which are
|
||||||
|
# used only by elf toolchains. Read the symbols from kernel.full and pass
|
||||||
|
# them to arm_kernel_boothdr.awk, which generates a binary header blob
|
||||||
|
# that goes on the front of the stripped kernel. Cat the header blob
|
||||||
|
# and the temp file together to make the kernel.bin file.
|
||||||
|
${KERNEL_KO}.bin: ${FULLKERNEL}
|
||||||
|
@${OBJCOPY} --wildcard --strip-symbol='$$[adtx]*' \
|
||||||
|
--output-target=binary ${.ALLSRC} ${.TARGET}.temp
|
||||||
|
@{ readelf -s ${.ALLSRC} | \
|
||||||
|
${AWK} -f $S/tools/arm_kernel_boothdr.awk -v hdrtype=v8booti && \
|
||||||
|
cat ${.TARGET}.temp; \
|
||||||
|
} > ${.TARGET}
|
||||||
|
@rm ${.TARGET}.temp
|
||||||
|
@echo "created ${.TARGET} from ${.ALLSRC}"
|
||||||
|
Loading…
Reference in New Issue
Block a user