powerpc: mpc85xx: Cleanup code
cover powerpc: mpc85xx: Cleanup code
This patch series cleanups mpc85xx e500 code. It removes _start symbol together with its content because it is useless and then rename symbol _start_e500 to _start as this is the real entry point. Third patch just show e500 core version.
Tested on P2020 board with configuration when BootROM loads SPL from SD card (which then loads U-Boot) and also when BootROM directly loads U-Boot from SD card. No visible difference, that (old) _start symbol and its content were useless.
Pali Rohár (3):
powerpc: mpc85xx: Drop _start symbol
powerpc: mpc85xx: Rename _start_e500 symbol to _start
powerpc: mpc85xx: Show e500 core version
arch/powerpc/cpu/mpc85xx/cpu.c | 4 +++- arch/powerpc/cpu/mpc85xx/resetvec.S | 2 +- arch/powerpc/cpu/mpc85xx/start.S | 13 ++++--------- arch/powerpc/cpu/mpc85xx/u-boot.lds | 2 +- doc/README.mpc85xx | 4 ++-- 5 files changed, 11 insertions(+), 14 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/3 powerpc: mpc85xx: Drop _start symbol
_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.
--- arch/powerpc/cpu/mpc85xx/start.S | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
arch/powerpc/cpu/mpc85xx/start.S +2 -7
@@ -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,
Signature · 1 line
2.20.1
PATCH 2/3 powerpc: mpc85xx: Rename _start_e500 symbol to _start
In reply to Pali RohárThe real entry point is _start_e500. There is no _start symbol at all. So rename _start_e500 to _start for convension that _start symbol is used as entry point.
--- arch/powerpc/cpu/mpc85xx/resetvec.S | 2 +- arch/powerpc/cpu/mpc85xx/start.S | 4 ++-- arch/powerpc/cpu/mpc85xx/u-boot.lds | 2 +- doc/README.mpc85xx | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-)
arch/powerpc/cpu/mpc85xx/resetvec.S +1 -1
@@ -1,2 +1,2 @@ .section .resetvec,"ax" - b _start_e500 + b _start
arch/powerpc/cpu/mpc85xx/start.S +2 -2
@@ -70,9 +70,9 @@ */ .section .bootpg,"ax" - .globl _start_e500 + .globl _start -_start_e500: +_start: /* Enable debug exception */ li r1,MSR_DE mtmsr r1
arch/powerpc/cpu/mpc85xx/u-boot.lds +1 -1
@@ -16,7 +16,7 @@ #endif OUTPUT_ARCH(powerpc) -ENTRY(_start_e500) +ENTRY(_start) PHDRS {
doc/README.mpc85xx +2 -2
@@ -45,7 +45,7 @@ Note: Sequence number is in order of execution A) defined(CONFIG_SYS_RAMBOOT) i.e. SD, SPI, NAND RAMBOOT & NAND_SPL boot 1) TLB entry to overcome e500 v1/v2 debug restriction - Location : Label "_start_e500" + Location : Label "_start" TLB Entry : CONFIG_SYS_PPC_E500_DEBUG_TLB EPN -->RPN : CONFIG_SYS_MONITOR_BASE --> CONFIG_SYS_MONITOR_BASE Properties : 256K, AS0, I, IPROT
@@ -91,7 +91,7 @@ A) defined(CONFIG_SYS_RAMBOOT) i.e. SD, SPI, NAND RAMBOOT & NAND_SPL boot B) !defined(CONFIG_SYS_RAMBOOT) i.e. NOR boot 1) TLB entry to overcome e500 v1/v2 debug restriction - Location : Label "_start_e500" + Location : Label "_start" TLB Entry : CONFIG_SYS_PPC_E500_DEBUG_TLB #if defined(CONFIG_NXP_ESBC) EPN -->RPN : CONFIG_SYS_MONITOR_BASE --> CONFIG_SYS_PBI_FLASH_WINDOW
Signature · 1 line
2.20.1
PATCH 3/3 powerpc: mpc85xx: Show e500 core version
In reply to Pali RohárDistinguish between e500v1 and e500v2.
--- arch/powerpc/cpu/mpc85xx/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/cpu/mpc85xx/cpu.c +3 -1
@@ -143,8 +143,10 @@ int checkcpu (void)printf ("Core: " );switch (ver) {case PVR_VER_E500_V1 : +puts ("e500v1" ); +break ;case PVR_VER_E500_V2 : -puts ("e500" ); +puts ("e500v2" );break ;case PVR_VER_E500MC :puts ("e500mc" );
Signature · 1 line
2.20.1