u-boot/arch/powerpc/cpu/mpc85xx
Pali Rohár 9167a1c28c powerpc: mpc85xx: Simplify jump to _start_cont in flash code
After more patches code for jumping to _start_cont symbol in flash memory
involved to code with useless mathematical operations. Currently it does:

  r3 := CONFIG_SYS_MONITOR_BASE + ABS(_start_cont) - CONFIG_SYS_MONITOR_BASE
  jump to r3

Which is equivalent of just:

  r3 := ABS(_start_cont)
  jump to r3

The purpose of that code is just to jump to _start_code symbol,
independently of program counter. So branch must be done to absolute
address. Trying to write:

  ba _start_cont

just cause linker error:

    LD      u-boot
  powerpc-linux-gnuspe-ld.bfd: arch/powerpc/cpu/mpc85xx/start.o: in function `switch_as':
  (.bootpg+0x4b8): relocation truncated to fit: R_PPC_ADDR24 against symbol `_start_cont' defined in .text section in arch/powerpc/cpu/mpc85xx/start.o
  make: *** [Makefile:1801: u-boot] Error 1

Probably by the fact that absolute address cannot be expressed by 24-bits.
So write the code via mtlr+blr pattern as it was before and load general
purpose register with absolute address of the symbol:

  lis     r3,_start_cont@h
  ori     r3,r3,_start_cont@l
  mtlr    r3
  blr

Seems that gcc and gnu ld linker support symbol@h and symbol@l syntax like
number@h and number@l without any problem. And disassembling of compiler
u-boot binary proved that lis+ori instructions are called with numbers
which represent halves of absolute address of _start_cont symbol.

Signed-off-by: Pali Rohár <pali@kernel.org>
2022-07-03 15:13:51 +08:00
..
b4860_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
b4860_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bsc9132_serdes.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
c29x_serdes.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
cmd_errata.c command: Remove the cmd_tbl_t typedef 2020-05-18 18:36:55 -04:00
config.mk mpc85xx: Add support for -msingle-pic-base 2019-01-23 10:48:48 -08:00
cpu.c powerpc: mpc85xx: Fix compilation with CONFIG_WDT 2022-06-20 09:18:26 +08:00
cpu_init.c caam: Fix crash in case caam_jr_probe failed 2022-05-20 12:36:47 +02:00
cpu_init_early.c Migrate CUSTOM_SYS_INIT_SP_ADDR to Kconfig using system-constants.h 2022-06-06 12:09:19 -04:00
fdt.c powerpc: Remove unused MPC8540/60ADS code 2022-03-03 16:51:19 -05:00
fsl_corenet2_serdes.c WS cleanup: remove trailing empty lines 2021-09-30 08:08:56 -04:00
fsl_corenet2_serdes.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
fsl_corenet_serdes.c WS cleanup: remove trailing empty lines 2021-09-30 08:08:56 -04:00
fsl_corenet_serdes.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
interrupts.c common: Drop asm/ptrace.h from common header 2020-05-18 21:19:23 -04:00
Kconfig Convert CONFIG_SYS_MPC85XX_NO_RESETVEC to Kconfig 2022-06-28 17:11:48 -04:00
liodn.c fdt_support: Add fdt_for_each_node_by_compatible() helper macro 2022-01-20 11:35:29 +01:00
Makefile Convert CONFIG_SPL_INIT_MINIMAL et al to Kconfig 2022-06-06 12:09:00 -04:00
mp.c powerpc: Move CONFIG_BPTR_VIRT_ADDR out of CONFIG namespace 2022-03-18 12:48:17 -04:00
mp.h powerpc/mpc85xx: Rewrite spin table to comply with ePAPR v1.1 2012-10-22 14:31:32 -05:00
mpc8536_serdes.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
mpc8544_serdes.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
mpc8548_serdes.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
p1010_serdes.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
p1021_serdes.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
p1023_serdes.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
p2020_serdes.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
p2041_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
p2041_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
p3041_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
p3041_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
p4080_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
p4080_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
p5040_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
p5040_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
portals.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
qe_io.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
release.S powerpc: mpc85xx: Improve Work-around for Erratum A005125 2018-05-09 09:17:51 -05:00
resetvec.S powerpc: mpc85xx: Rename _start_e500 symbol to _start 2022-04-26 17:18:39 +05:30
speed.c powerpc: Remove unused MPC8540/60ADS code 2022-03-03 16:51:19 -05:00
spl_minimal.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
start.S powerpc: mpc85xx: Simplify jump to _start_cont in flash code 2022-07-03 15:13:51 +08:00
t1024_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
t1024_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
t1040_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
t1040_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
t2080_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
t2080_serdes.c ppc: Remove T2081QDS board and ARCH_T2081 support 2021-04-10 08:04:42 -04:00
t4240_ids.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
t4240_serdes.c ppc: Remove T4160RDB board 2021-07-07 19:52:24 -04:00
tlb.c Convert CONFIG_SPL_INIT_MINIMAL et al to Kconfig 2022-06-06 12:09:00 -04:00
traps.c common: remove bedbug debugger support 2022-01-18 08:31:02 -05:00
u-boot-spl.lds Convert CONFIG_SYS_MPC85XX_NO_RESETVEC to Kconfig 2022-06-28 17:11:48 -04:00
u-boot.lds Convert CONFIG_SYS_MPC85XX_NO_RESETVEC to Kconfig 2022-06-28 17:11:48 -04:00