From 13c7a5c8d469c4ee0425e64a1ae4bf11edee7bed Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Thu, 21 Apr 2016 02:06:47 +0100 Subject: sun50i: remove Allwinner hash output We actually have the short SHA1 of the HEAD commit already in the output, so there is no need for that extra bloated code to insert it into the binary. Remove it. Signed-off-by: Andre Przywara --- Makefile | 4 ---- bl31/bl31.ld.S | 1 - bl31/bl31.mk | 1 - bl31/bl31_hash.c | 25 ------------------------- bl31/bl31_main.c | 3 --- bl31/head_data.c | 43 +++++++++++++++++++++--------------------- tools/add_hash_bl31.sh | 51 -------------------------------------------------- 7 files changed, 21 insertions(+), 107 deletions(-) delete mode 100644 bl31/bl31_hash.c delete mode 100755 tools/add_hash_bl31.sh diff --git a/Makefile b/Makefile index b074ed4..f96e2cb 100644 --- a/Makefile +++ b/Makefile @@ -421,10 +421,6 @@ $(BIN) : $(ELF) @echo @echo "Built $$@ successfully" @echo -ifeq (bl31.bin,$(notdir ${BIN})) - $${Q}git show HEAD --pretty=format:"%H" | head -n 1 > cur.log - $${Q}./tools/add_hash_bl31.sh -f $$@ -m bl31 -endif .PHONY : bl$(1) bl$(1) : $(BUILD_DIR) $(BIN) $(DUMP) diff --git a/bl31/bl31.ld.S b/bl31/bl31.ld.S index b7a867f..7fd385a 100644 --- a/bl31/bl31.ld.S +++ b/bl31/bl31.ld.S @@ -48,7 +48,6 @@ SECTIONS ro . : { __RO_START__ = .; KEEP(*head_data.o(.head_data*)) - KEEP(*bl31_hash.o(.hash_data*)) KEEP(*bl31_entrypoint.o(.text*)) *(.text*) *(.rodata*) diff --git a/bl31/bl31.mk b/bl31/bl31.mk index cbeac94..be0a2ce 100644 --- a/bl31/bl31.mk +++ b/bl31/bl31.mk @@ -29,7 +29,6 @@ # BL31_SOURCES+= bl31/head_data.c \ - bl31/bl31_hash.c \ bl31/bl31_main.c \ bl31/context_mgmt.c \ bl31/cpu_data_array.c \ diff --git a/bl31/bl31_hash.c b/bl31/bl31_hash.c deleted file mode 100644 index 2722d64..0000000 --- a/bl31/bl31_hash.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * (C) Copyright 2007-2013 - * Allwinner Technology Co., Ltd. - * Jerry Wang - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - - char bl31_hash_value[64] __attribute__ ((section(".hash_data"))) = {0x38}; diff --git a/bl31/bl31_main.c b/bl31/bl31_main.c index cab46d7..d338b03 100644 --- a/bl31/bl31_main.c +++ b/bl31/bl31_main.c @@ -71,11 +71,8 @@ void bl31_lib_init(void) ******************************************************************************/ void bl31_main(void) { - extern char bl31_hash_value[64]; - NOTICE("BL3-1: %s\n", version_string); NOTICE("BL3-1: %s\n", build_message); - NOTICE("BL3-1 commit: %s\n", bl31_hash_value); /* Perform remaining generic architectural setup from EL3 */ bl31_arch_setup(); diff --git a/bl31/head_data.c b/bl31/head_data.c index d14dd86..ebb3b9e 100644 --- a/bl31/head_data.c +++ b/bl31/head_data.c @@ -1,23 +1,22 @@ -/* - * - * Header for semelis - * - */ - -#include -#include - -extern char bl31_hash_value[64]; +/* + * + * Header for semelis + * + */ -struct spare_boot_ctrl_head monitor_head __attribute__ ((section(".head_data"))) = -{ - (0x14000000 |(((sizeof(struct spare_boot_ctrl_head)+sizeof(bl31_hash_value)) / sizeof(int)) & 0x00FFFFFF)), - "monitor", - 0, - 0, - 0, - 0, - "2.0", - "monitor", - {BL31_BASE} -}; +#include +#include + +struct spare_boot_ctrl_head +monitor_head __attribute__ ((section(".head_data"))) = +{ + (0x14000000 | ((sizeof(struct spare_boot_ctrl_head) / sizeof(int)) & 0x00FFFFFF)), + "monitor", + 0, + 0, + 0, + 0, + "2.0", + "monitor", + {BL31_BASE} +}; diff --git a/tools/add_hash_bl31.sh b/tools/add_hash_bl31.sh deleted file mode 100755 index 1814460..0000000 --- a/tools/add_hash_bl31.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -set -e - -BUILD_FILE=bl31.bin -BUILD_MODE=bl31 - -show_help() -{ - printf "\n add_hash.sh - add git log hash value into uboot,boot0,sboot,fes \n" - echo " eg :" - echo " ./add_hash.sh -f input_file -m file_flag " - echo " file_flag = uboot or boot0 or sboot" - printf "\n\n" -} - - -build_bl31() -{ - dd if=./${BUILD_FILE} of=./bl31_back bs=48 count=1 status=noxfer 2> /dev/null - dd if=./cur.log of=./bl31_back ibs=64 conv=notrunc,sync oflag=append obs=64 count=1 status=noxfer 2> /dev/null - dd if=./${BUILD_FILE} of=./bl31_back ibs=112 obs=112 conv=notrunc oflag=append skip=1 status=noxfer 2> /dev/null - mv bl31_back ${BUILD_FILE} -} - - -do_common() -{ - if [ "x${BUILD_MODE}" = "xbl31" ] ; then - echo " add commit info for bl31 " - build_bl31 - else - echo "build none" - fi -} -while getopts f:m: OPTION -do - case $OPTION in - f) - BUILD_FILE=$OPTARG - ;; - m) - BUILD_MODE=$OPTARG - ;; - *) - show_help - exit - ;; - esac -done - -do_common -- cgit v1.2.3