u-boot/arch/arm/cpu
Wang Dongsheng c5e954eccd ARM: Disable "DISCARD" for secure section if CONFIG_ARMV7_SECURE_BASE isn't defined
"DISCARD" will remove ._secure.text relocate, but PSCI framework
has already used some absolute address those need to relocate.

Use readelf -t -r u-boot show us:
.__secure_start		addr: 601408e4
.__secure_end		addr: 60141460

60141140  00000017 R_ARM_RELATIVE
46	_secure_monitor:
47	#ifdef CONFIG_ARMV7_PSCI
48      ldr     r5, =_psci_vectors

60141194  00000017 R_ARM_RELATIVE
6014119c  00000017 R_ARM_RELATIVE
601411a4  00000017 R_ARM_RELATIVE
601411ac  00000017 R_ARM_RELATIVE
64	_psci_table:
66	.word	psci_cpu_suspend
...
72	.word	psci_migrate

60141344  00000017 R_ARM_RELATIVE
6014145c  00000017 R_ARM_RELATIVE
202	ldr     r5, =psci_text_end

Solutions:
1. Change absolute address to RelAdr.
   Based on LDR (immediate, ARM), we only have 4K offset to jump.
Now PSCI code size is close to 4K size that is LDR limit jump size,
so even if the LDR is based on the current instruction address,
there is also have a risk for RelAdr. If we use two jump steps I
think we can fix this issue, but looks too hack, so give up this way.

2. Enable "DISCARD" only for CONFIG_ARMV7_SECURE_BASE has defined.
   If CONFIG_ARMV7_SECURE_BASE is defined in platform, all of secure
will in the BASE address that is absolute.

Signed-off-by: Wang Dongsheng <dongsheng.wang@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-01-31 16:32:56 +01:00
..
arm11 ARM: cache: implement a default weak flush_cache() function 2015-08-12 20:47:48 -04:00
arm720t ARM: ARM720t: remove empty asm/arch/hardware.h 2015-04-23 08:52:27 -04:00
arm920t arch/arm/cpu/arm920t/ep93xx/led.c: Mark inline functions as static inline 2015-12-05 18:22:28 -05:00
arm926ejs arm: lpc32xx: switch SPL builds to driver model 2016-01-13 21:05:22 -05:00
arm946es ARM: integrator: abolish CONFIG_INTEGRATOR 2015-04-23 08:52:27 -04:00
arm1136 imx: mx31 use new formula for get_cpu_rev 2015-09-02 15:29:14 +02:00
arm1176 arm1136/arm1176: Merge cache handling code 2015-08-12 20:47:41 -04:00
armv7 arm: cache: Implement cache range check for v7 2016-01-31 16:32:56 +01:00
armv7m stm32: move stm32 specific code to mach-stm32 2016-01-20 10:19:41 -05:00
armv8 Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq 2016-01-27 15:05:36 -05:00
pxa arm: pxa: clean-up include file order 2015-08-24 20:30:37 +02:00
sa1100 ARM: move -march=* and -mtune= options to arch/arm/Makefile 2015-03-27 16:55:22 +01:00
Makefile Various Makefiles: Add SPDX-License-Identifier tags 2015-11-10 09:19:52 -05:00
u-boot-spl.lds dm: arm: Put driver model I2C drivers before legacy ones 2015-07-21 17:39:21 -06:00
u-boot.lds ARM: Disable "DISCARD" for secure section if CONFIG_ARMV7_SECURE_BASE isn't defined 2016-01-31 16:32:56 +01:00