public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Priyanka Jain <priyanka.jain@nxp.com>, Wolfgang Denk <wd@denx.de>
Cc: u-boot@lists.denx.de
Subject: [PATCH 1/3] powerpc: mpc85xx: Drop _start symbol
Date: Sun,  3 Apr 2022 00:05:08 +0200	[thread overview]
Message-ID: <20220402220510.17879-2-pali@kernel.org> (raw)
In-Reply-To: <20220402220510.17879-1-pali@kernel.org>

_start symbol contains only 32-bit data number 0x27051956 despite it is
marked as text section. This magic number is IH_MAGIC which is used for
marking uboot image header.

mpc85xx start.S code does not define valid uboot image header, so IH_MAGIC
number in _start symbol is useless there.

Moreover this _start symbol is not used at all. Entry point is at symbol
_start_e500.

So because this _start symbol is not used for anything, completely remove
it with IH_MAGIC number. After _start symbol was _start_cont symbol, so
replace all relative address calculations by _start_cont.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 arch/powerpc/cpu/mpc85xx/start.S | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 656cc6ec8024..71b04b9f7286 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -46,7 +46,6 @@
 	GOT_ENTRY(_FIXUP_TABLE_)
 
 #ifndef MINIMAL_SPL
-	GOT_ENTRY(_start)
 	GOT_ENTRY(_start_of_vectors)
 	GOT_ENTRY(_end_of_vectors)
 	GOT_ENTRY(transfer_to_handler)
@@ -1128,16 +1127,12 @@ switch_as:
 	/*--------------------------------------------------------------*/
 	lis	r3,CONFIG_SYS_MONITOR_BASE@h
 	ori	r3,r3,CONFIG_SYS_MONITOR_BASE@l
-	addi	r3,r3,_start_cont - _start
+	addi	r3,r3,_start_cont - _start_cont
 	mtlr	r3
 	blr
 #endif
 
 	.text
-	.globl	_start
-_start:
-	.long	0x27051956		/* U-BOOT Magic Number */
-
 	.globl	_start_cont
 _start_cont:
 	/* Setup the stack in initial RAM,could be L2-as-SRAM or L1 dcache*/
@@ -1604,7 +1599,7 @@ relocate_code:
  * initialization, now running from RAM.
  */
 
-	addi	r0,r10,in_ram - _start
+	addi	r0,r10,in_ram - _start_cont
 
 	/*
 	 * As IVPR is going to point RAM address,
-- 
2.20.1


  reply	other threads:[~2022-04-02 22:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-02 22:05 [PATCH 0/3] powerpc: mpc85xx: Cleanup code Pali Rohár
2022-04-02 22:05 ` Pali Rohár [this message]
2022-04-02 22:05 ` [PATCH 2/3] powerpc: mpc85xx: Rename _start_e500 symbol to _start Pali Rohár
2022-04-02 22:05 ` [PATCH 3/3] powerpc: mpc85xx: Show e500 core version Pali Rohár

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220402220510.17879-2-pali@kernel.org \
    --to=pali@kernel.org \
    --cc=priyanka.jain@nxp.com \
    --cc=u-boot@lists.denx.de \
    --cc=wd@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox