u-boot-brain/arch
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
..
arc Fix board init code to respect the C runtime environment 2016-01-13 21:05:17 -05:00
arm ARM: Disable "DISCARD" for secure section if CONFIG_ARMV7_SECURE_BASE isn't defined 2016-01-31 16:32:56 +01:00
avr32 avr32: Use the generic bitops headers 2015-11-05 10:52:31 -05:00
blackfin Move console definitions into a new console.h file 2015-11-19 20:27:50 -07:00
m68k m68k: M54418TWR: drop board/freescale/m54418twr/config.mk 2016-01-20 10:19:34 -05:00
microblaze microblaze: Remove empty file - cpu.c 2016-01-27 15:55:53 +01:00
mips mips: asm/io.h: Add in <linux/bug.h> 2016-01-25 18:52:23 -05:00
nds32 nds32: Fix compile error. 2016-01-21 10:41:43 +08:00
nios2 Fix board init code to respect the C runtime environment 2016-01-13 21:05:17 -05:00
openrisc openrisc: Fix build errors 2016-01-25 10:40:01 -05:00
powerpc Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq 2016-01-27 15:05:36 -05:00
sandbox dm: video: test: Add tests for the video uclass 2016-01-20 19:10:16 -07:00
sh Add more SPDX-License-Identifier tags 2016-01-19 08:31:21 -05:00
sparc sparc: Remove non-generic board init files: board.c, time.c 2015-12-03 13:15:50 +02:00
x86 x86: Correct spi node alias 2016-01-28 13:53:30 +08:00
.gitignore .gitignore: drop include/asm/proc from ignore pattern 2014-06-19 11:18:54 -04:00
Kconfig MIPS: add initial infrastructure for device-tree files 2016-01-16 21:06:45 +01:00