From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 733F7C4338F for ; Mon, 2 Aug 2021 13:21:25 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E372860EE3 for ; Mon, 2 Aug 2021 13:21:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E372860EE3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D767583404; Mon, 2 Aug 2021 15:20:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="JRbQA9u5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E8F8F833D7; Mon, 2 Aug 2021 15:20:13 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C3A69833DB for ; Mon, 2 Aug 2021 15:19:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 07AF5610FC; Mon, 2 Aug 2021 13:19:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627910393; bh=AN9O3+camXjoIljeUGUajFFsqqPZC+cRrAcoAbO3U00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JRbQA9u5gwRPePplBCYAawmVGCqWGyAKIF8EFbNSrOTH05KN6TW6ZIUBScyU53XnL 4X9IU2X198Cauf8OJU34QEV1XWe/sw3QhaiVH8Uq1QVFeZcOG6LPxh46uBO/i6+MPs G/St3oLgomfAhfor9wJAKWxUFvg4iCNoLu9XyDavL3sENDLGWl/dcueHVlOp5/XXHA I9SaqjhHxQGvxiThpeGV4Fo7BRzVOuHHjFJM6xlI+K10CzuXrHtSzjYMmYYtw8s0Ut HtrmD8gyPylRdMDLWr6MVKbHscv7OGkWBgfUL5zZWSKfWRCP6oBoUd4aYx/PQ9firk BxuG3609IY38Q== Received: by pali.im (Postfix) id BCE91B98; Mon, 2 Aug 2021 15:19:52 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Simon Glass , Heinrich Schuchardt , Alexander Graf , Huan Wang , Angelo Dureghello , Wolfgang Denk , Priyanka Jain , Christophe Leroy , Bin Meng , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Tom Rini Cc: u-boot@lists.denx.de Subject: [PATCH 07/11] powerpc: mpc: Put U-Boot version string at correct place by linker script Date: Mon, 2 Aug 2021 15:18:34 +0200 Message-Id: <20210802131838.21097-8-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210802131838.21097-1-pali@kernel.org> References: <20210802131838.21097-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean It is unknown by version string is placed at specific position on these powerpc mpc platforms. But there is no need to overload version_string symbol. Just use common definition of version_string and modify linker script to put it at "correct place". Signed-off-by: Pali Rohár --- arch/powerpc/cpu/mpc83xx/start.S | 10 +++------- arch/powerpc/cpu/mpc83xx/u-boot.lds | 3 +++ arch/powerpc/cpu/mpc85xx/start.S | 10 ++++------ arch/powerpc/cpu/mpc85xx/u-boot-nand.lds | 4 ++++ arch/powerpc/cpu/mpc85xx/u-boot-spl.lds | 4 ++++ arch/powerpc/cpu/mpc85xx/u-boot.lds | 4 ++++ arch/powerpc/cpu/mpc8xx/start.S | 9 ++++----- board/cssi/MCR3000/u-boot.lds | 2 ++ 8 files changed, 28 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S index 9da22ce486a9..cc1d80368ab4 100644 --- a/arch/powerpc/cpu/mpc83xx/start.S +++ b/arch/powerpc/cpu/mpc83xx/start.S @@ -13,7 +13,6 @@ #include #include #include -#include #define CONFIG_83XX 1 /* needed for Linux kernel header files*/ @@ -76,7 +75,7 @@ * times so the processor can fetch it out of flash whether the flash * is 8, 16, 32, or 64 bits wide (hardware trickery). */ - .text + .text_pre #define _HRCW_TABLE_ENTRY(w) \ .fill 8,1,(((w)>>24)&0xff); \ .fill 8,1,(((w)>>16)&0xff); \ @@ -92,12 +91,9 @@ */ .long 0x27051956 /* U-Boot Magic Number */ - .globl version_string -version_string: - .ascii U_BOOT_VERSION_STRING, "\0" - - .align 2 +/* U-Boot version string is filled at this place by linker script */ + .text .globl enable_addr_trans enable_addr_trans: /* enable address translation */ diff --git a/arch/powerpc/cpu/mpc83xx/u-boot.lds b/arch/powerpc/cpu/mpc83xx/u-boot.lds index d10f528da4c4..309082bc3df5 100644 --- a/arch/powerpc/cpu/mpc83xx/u-boot.lds +++ b/arch/powerpc/cpu/mpc83xx/u-boot.lds @@ -10,6 +10,9 @@ SECTIONS /* Read-only sections, merged into text segment: */ .text : { + arch/powerpc/cpu/mpc83xx/start.o (.text_pre) + *(.text_version_string) + . = ALIGN(2); arch/powerpc/cpu/mpc83xx/start.o (.text*) *(.text*) . = ALIGN(16); diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S index f41e82ad189f..f89072d38d0d 100644 --- a/arch/powerpc/cpu/mpc85xx/start.S +++ b/arch/powerpc/cpu/mpc85xx/start.S @@ -14,7 +14,6 @@ #include #include #include -#include #include #include @@ -1134,15 +1133,14 @@ switch_as: blr #endif - .text + .text_pre .globl _start _start: .long 0x27051956 /* U-BOOT Magic Number */ - .globl version_string -version_string: - .ascii U_BOOT_VERSION_STRING, "\0" - .align 4 +/* U-Boot version string is filled at this place by linker script */ + + .text .globl _start_cont _start_cont: /* Setup the stack in initial RAM,could be L2-as-SRAM or L1 dcache*/ diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds b/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds index 75b0285e4e51..6e48223380cb 100644 --- a/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds +++ b/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds @@ -25,6 +25,10 @@ SECTIONS .interp : { *(.interp) } .text : { + arch/powerpc/cpu/mpc85xx/start.o (.text_pre) + *(.text_version_string) + . = ALIGN(4); + arch/powerpc/cpu/mpc85xx/start.o (.text*) *(.text*) } :text _etext = .; diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds index 27a5fe6306a3..2312cd47f11d 100644 --- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds +++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds @@ -20,6 +20,10 @@ SECTIONS { . = IMAGE_TEXT_BASE; .text : { + arch/powerpc/cpu/mpc85xx/start.o (.text_pre) + *(.text_version_string) + . = ALIGN(4); + arch/powerpc/cpu/mpc85xx/start.o (.text*) *(.text*) } _etext = .; diff --git a/arch/powerpc/cpu/mpc85xx/u-boot.lds b/arch/powerpc/cpu/mpc85xx/u-boot.lds index 22bbac51aa33..40d181ef2caa 100644 --- a/arch/powerpc/cpu/mpc85xx/u-boot.lds +++ b/arch/powerpc/cpu/mpc85xx/u-boot.lds @@ -31,6 +31,10 @@ SECTIONS .interp : { *(.interp) } .text : { + arch/powerpc/cpu/mpc85xx/start.o (.text_pre) + *(.text_version_string) + . = ALIGN(4); + arch/powerpc/cpu/mpc85xx/start.o (.text*) *(.text*) } :text _etext = .; diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S index ed735cdee005..d7003c76ca05 100644 --- a/arch/powerpc/cpu/mpc8xx/start.S +++ b/arch/powerpc/cpu/mpc8xx/start.S @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -60,12 +59,12 @@ * r3 - 1st arg to board_init(): IMMP pointer * r4 - 2nd arg to board_init(): boot flag */ - .text + .text_pre .long 0x27051956 /* U-Boot Magic Number */ - .globl version_string -version_string: - .ascii U_BOOT_VERSION_STRING, "\0" +/* U-Boot version string is filled at this place by linker script */ + + .text . = EXC_OFF_SYS_RESET .globl _start _start: diff --git a/board/cssi/MCR3000/u-boot.lds b/board/cssi/MCR3000/u-boot.lds index 70aef3241c8e..9b2ead29b4a5 100644 --- a/board/cssi/MCR3000/u-boot.lds +++ b/board/cssi/MCR3000/u-boot.lds @@ -16,6 +16,8 @@ SECTIONS . = + SIZEOF_HEADERS; .text : { + arch/powerpc/cpu/mpc8xx/start.o (.text_pre) + *(.text_version_string) arch/powerpc/cpu/mpc8xx/start.o (.text) arch/powerpc/cpu/mpc8xx/traps.o (.text*) arch/powerpc/lib/built-in.o (.text*) -- 2.20.1