From c8881f19b66be7fb9641fe6a67edeaa879ae313f Mon Sep 17 00:00:00 2001 From: imp Date: Sat, 27 Jul 2019 17:24:19 +0000 Subject: [PATCH] Remove support for kernel.tramp and kernel.tramp.gz Nothing uses these anymore. They were for super small armv4 boards without uboot. We removed armv4 support before 13.0, but neglected to garbage collect this at the same time. Today, both flavors of armv5 kernels (mv and ralink) boot via uboot which has its own compression scheme for boards that need it. Note: OLDFILES has not been updated beacuse installkernel will move the whole directory out of the way before installing the new kernel. Differential Revision: https://reviews.freebsd.org/D21072 --- sys/arm/arm/inckern.S | 42 ---------------- sys/arm/conf/NOTES.armv5 | 1 - sys/arm/mv/discovery/std.db78xxx | 1 - sys/arm/mv/orion/std.db88f5xxx | 1 - sys/arm/mv/orion/std.ts7800 | 1 - sys/arm/ralink/std.ralink | 1 - sys/conf/Makefile.arm | 83 ++------------------------------ 7 files changed, 3 insertions(+), 127 deletions(-) delete mode 100644 sys/arm/arm/inckern.S diff --git a/sys/arm/arm/inckern.S b/sys/arm/arm/inckern.S deleted file mode 100644 index bb0ec75e08f7..000000000000 --- a/sys/arm/arm/inckern.S +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * Copyright (c) 2005 Olivier Houchard. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "opt_kernname.h" - -#include -__FBSDID("$FreeBSD$") -ENTRY(do_call) - mov r6, r0 - mov r0, r1 - ldr r1, =0xfff00000 - and r1, pc, r1 - mov sp, r3 - mov r3, #1 - mov pc, r6 -.section ".real_kernel","aw" -.globl kernel_start; -kernel_start: -.incbin KERNNAME -.globl kernel_end; -kernel_end: diff --git a/sys/arm/conf/NOTES.armv5 b/sys/arm/conf/NOTES.armv5 index 1e8825980448..0c051c342ed2 100644 --- a/sys/arm/conf/NOTES.armv5 +++ b/sys/arm/conf/NOTES.armv5 @@ -18,7 +18,6 @@ files "../mv/orion/files.ts7800" makeoptions CONF_CFLAGS+="-march=armv5te" makeoptions LDFLAGS="-zmuldefs" -makeoptions KERNPHYSADDR=0x00000000 # Undo options from sys/conf/NOTES that we do not want... diff --git a/sys/arm/mv/discovery/std.db78xxx b/sys/arm/mv/discovery/std.db78xxx index a0a22f1c1c1b..582f26549964 100644 --- a/sys/arm/mv/discovery/std.db78xxx +++ b/sys/arm/mv/discovery/std.db78xxx @@ -3,6 +3,5 @@ include "../mv/std.mv" files "../mv/discovery/files.db78xxx" -makeoptions KERNPHYSADDR=0x00900000 makeoptions KERNVIRTADDR=0xc0900000 options KERNVIRTADDR=0xc0900000 diff --git a/sys/arm/mv/orion/std.db88f5xxx b/sys/arm/mv/orion/std.db88f5xxx index 8444683be1bd..e6b09890ad6b 100644 --- a/sys/arm/mv/orion/std.db88f5xxx +++ b/sys/arm/mv/orion/std.db88f5xxx @@ -3,6 +3,5 @@ include "../mv/std.mv" files "../mv/orion/files.db88f5xxx" -makeoptions KERNPHYSADDR=0x00900000 makeoptions KERNVIRTADDR=0xc0900000 options KERNVIRTADDR=0xc0900000 diff --git a/sys/arm/mv/orion/std.ts7800 b/sys/arm/mv/orion/std.ts7800 index 931da3a5f39d..53d6aa809649 100644 --- a/sys/arm/mv/orion/std.ts7800 +++ b/sys/arm/mv/orion/std.ts7800 @@ -3,7 +3,6 @@ include "../mv/std.mv" files "../mv/orion/files.ts7800" -makeoptions KERNPHYSADDR=0x00900000 makeoptions KERNVIRTADDR=0xc0900000 options KERNVIRTADDR=0xc0900000 options PHYSADDR=0x00000000 diff --git a/sys/arm/ralink/std.ralink b/sys/arm/ralink/std.ralink index 5cf4459bd231..a6c00c008bdb 100644 --- a/sys/arm/ralink/std.ralink +++ b/sys/arm/ralink/std.ralink @@ -5,6 +5,5 @@ machine arm makeoptions CONF_CFLAGS="-march=armv5te" options INTRNG -makeoptions KERNPHYSADDR=0x40000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNVIRTADDR=0xc0000000 diff --git a/sys/conf/Makefile.arm b/sys/conf/Makefile.arm index 8c9069bad311..e981fa697608 100644 --- a/sys/conf/Makefile.arm +++ b/sys/conf/Makefile.arm @@ -65,86 +65,13 @@ SYSTEM_LD_ = ${LD} -m ${LD_EMULATION} -Bdynamic -T ldscript.$M.noheader \ ${_LDFLAGS} --no-warn-mismatch --warn-common --export-dynamic \ --dynamic-linker /red/herring \ -o ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o -SYSTEM_LD_TAIL +=;sed s/" + SIZEOF_HEADERS"// ldscript.$M\ +SYSTEM_LD_TAIL +=;sed s/" + SIZEOF_HEADERS"// ldscript.$M \ >ldscript.$M.noheader; \ ${SYSTEM_LD_}; \ ${OBJCOPY} -S -O binary ${FULLKERNEL}.noheader \ ${KERNEL_KO}.bin; \ rm ${FULLKERNEL}.noheader -FILES_CPU_FUNC = \ - $S/$M/$M/cpufunc_asm_armv5_ec.S \ - $S/$M/$M/cpufunc_asm_sheeva.S - -.if ${MACHINE_ARCH:Marmv[67]*} == "" && defined(KERNPHYSADDR) -KERNEL_EXTRA=trampoline -KERNEL_EXTRA_INSTALL=kernel.gz.tramp -trampoline: ${KERNEL_KO}.tramp -${KERNEL_KO}.tramp: ${KERNEL_KO} $S/$M/$M/inckern.S $S/$M/$M/elf_trampoline.c - echo "#define KERNNAME \"${KERNEL_KO}.tmp\"" >opt_kernname.h - sed s/${KERNVIRTADDR}/${KERNPHYSADDR}/ ldscript.$M > ldscript.$M.tramp - sed s/" + SIZEOF_HEADERS"// ldscript.$M.tramp > \ - ldscript.$M.tramp.noheader - echo "#include " >tmphack.S - echo "ENTRY(_start)" >>tmphack.S - echo "bl _startC" >>tmphack.S - ${OBJCOPY} --strip-symbol '$$d' --strip-symbol '$$a' \ - -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp - eval $$(stat -s ${KERNEL_KO}.tmp) && \ - echo "#define KERNSIZE $$st_size" >>opt_kernname.h - ${CC} -O -nostdlib -I. -I$S \ - -Xlinker -T -Xlinker ldscript.$M.tramp \ - -DELF_TRAMPOLINE \ - tmphack.S \ - $S/$M/$M/elf_trampoline.c \ - $S/$M/$M/inckern.S \ - ${FILES_CPU_FUNC} \ - -o ${KERNEL_KO}.tramp - ${CC} -O -nostdlib -I. -I$S \ - -Xlinker -T -Xlinker ldscript.$M.tramp.noheader \ - -DELF_TRAMPOLINE \ - tmphack.S \ - $S/$M/$M/elf_trampoline.c \ - $S/$M/$M/inckern.S \ - ${FILES_CPU_FUNC} \ - -o ${KERNEL_KO}.tramp.noheader - ${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \ - ${KERNEL_KO}.tramp.bin - ${OBJCOPY} ${STRIP_FLAGS} ${KERNEL_KO}.tmp - echo "#define KERNNAME \"${KERNEL_KO}.tmp.gz\"" >opt_kernname.h - eval $$(stat -s ${KERNEL_KO}.tmp) && \ - echo "#define KERNSIZE $$st_size" >>opt_kernname.h - gzip -f9 ${KERNEL_KO}.tmp - eval $$(stat -s ${KERNEL_KO}.tmp.gz) && \ - echo "#define KERNCOMPSIZE $$st_size" >>opt_kernname.h - ${CC} -O2 -ffreestanding -I. -I$S -c \ - -DKZIP -DELF_TRAMPOLINE \ - $S/kern/subr_inflate.c \ - -o inflate-tramp.o - ${CC} -O -nostdlib -I. -I$S \ - -Xlinker -T -Xlinker ldscript.$M.tramp \ - -DKZIP -DELF_TRAMPOLINE \ - tmphack.S \ - $S/$M/$M/elf_trampoline.c \ - inflate-tramp.o \ - $S/$M/$M/inckern.S \ - ${FILES_CPU_FUNC} \ - -o ${KERNEL_KO}.gz.tramp - ${CC} -O -nostdlib -I. -I$S \ - -Xlinker -T -Xlinker ldscript.$M.tramp.noheader \ - -DKZIP -DELF_TRAMPOLINE \ - tmphack.S \ - $S/$M/$M/elf_trampoline.c \ - inflate-tramp.o \ - $S/$M/$M/inckern.S \ - ${FILES_CPU_FUNC} \ - -o ${KERNEL_KO}.tramp.noheader - ${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \ - ${KERNEL_KO}.gz.tramp.bin - rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h \ - inflate-tramp.o tmphack.S -.endif - %BEFORE_DEPEND %OBJS @@ -159,13 +86,9 @@ ${KERNEL_KO}.tramp: ${KERNEL_KO} $S/$M/$M/inckern.S $S/$M/$M/elf_trampoline.c CLEAN+= ldscript.$M ${KERNEL_KO}.bin ldscript.$M.noheader -CLEAN+= ${KERNEL_KO}.tramp ${KERNEL_KO}.tramp.bin ldscript.$M.tramp \ - ldscript.$M.tramp.noheader ${KERNEL_KO}.gz.tramp \ - ${KERNEL_KO}.gz.tramp.bin - ldscript.$M: $S/conf/ldscript.$M - cat $S/conf/ldscript.$M|sed s/KERNPHYSADDR/${KERNPHYSADDR}/g| \ - sed s/KERNVIRTADDR/${KERNVIRTADDR}/g > ldscript.$M + sed s/KERNVIRTADDR/${KERNVIRTADDR}/g > ldscript.$M < $S/conf/ldscript.$M + %RULES .include "$S/conf/kern.post.mk"