summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-07-31 15:10:33 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-08-22 16:27:02 +0200
commitc6994af7a7a1ba9afb0403d9e0785a905edab6ee (patch)
tree68b736241f46a864976ea6c97d2cec342b7f3cdf
parentbsps/powerpc: Add 64-bit CRT init/fini support (diff)
downloadrtems-c6994af7a7a1ba9afb0403d9e0785a905edab6ee.tar.bz2
bsp/qoriq: Use LA to load an address
Add 64-bit support for LA. Update #3082.
-rw-r--r--c/src/lib/libbsp/powerpc/qoriq/start/start.S44
-rw-r--r--c/src/lib/libcpu/powerpc/shared/include/powerpc-utility.h8
2 files changed, 30 insertions, 22 deletions
diff --git a/c/src/lib/libbsp/powerpc/qoriq/start/start.S b/c/src/lib/libbsp/powerpc/qoriq/start/start.S
index bcdbb0c3b2..0a2af7a200 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/start/start.S
+++ b/c/src/lib/libbsp/powerpc/qoriq/start/start.S
@@ -54,45 +54,45 @@ _start:
bl bsp_fdt_copy
/* Get start stack */
- LWI START_STACK, start_stack_end
+ LA START_STACK, start_stack_end
bl .Linitmore
/* Copy fast text */
- LWI r3, bsp_section_fast_text_begin
- LWI r4, bsp_section_fast_text_load_begin
- LWI r5, bsp_section_fast_text_size
+ LA r3, bsp_section_fast_text_begin
+ LA r4, bsp_section_fast_text_load_begin
+ LA r5, bsp_section_fast_text_size
bl .Lcopy
- LWI r3, bsp_section_fast_text_begin
- LWI r4, bsp_section_fast_text_size
+ LA r3, bsp_section_fast_text_begin
+ LA r4, bsp_section_fast_text_size
bl rtems_cache_flush_multiple_data_lines
/* Copy read-only data */
- LWI r3, bsp_section_rodata_begin
- LWI r4, bsp_section_rodata_load_begin
- LWI r5, bsp_section_rodata_size
+ LA r3, bsp_section_rodata_begin
+ LA r4, bsp_section_rodata_load_begin
+ LA r5, bsp_section_rodata_size
bl .Lcopy
- LWI r3, bsp_section_rodata_begin
- LWI r4, bsp_section_rodata_size
+ LA r3, bsp_section_rodata_begin
+ LA r4, bsp_section_rodata_size
bl rtems_cache_flush_multiple_data_lines
/* Copy fast data */
- LWI r3, bsp_section_fast_data_begin
- LWI r4, bsp_section_fast_data_load_begin
- LWI r5, bsp_section_fast_data_size
+ LA r3, bsp_section_fast_data_begin
+ LA r4, bsp_section_fast_data_load_begin
+ LA r5, bsp_section_fast_data_size
bl .Lcopy
/* Copy data */
- LWI r3, bsp_section_data_begin
- LWI r4, bsp_section_data_load_begin
- LWI r5, bsp_section_data_size
+ LA r3, bsp_section_data_begin
+ LA r4, bsp_section_data_load_begin
+ LA r5, bsp_section_data_size
bl .Lcopy
/* NULL pointer access protection (only core 0 has to do this) */
mfspr r3, BOOKE_PIR
cmpwi r3, 0
bne .Lnull_area_setup_done
- LWI r3, bsp_section_start_begin
+ LA r3, bsp_section_start_begin
srawi r3, r3, 2
mtctr r3
li r3, -4
@@ -106,13 +106,13 @@ _start:
bl .Linitmmu
/* Clear SBSS */
- LWI r3, bsp_section_sbss_begin
- LWI r4, bsp_section_sbss_size
+ LA r3, bsp_section_sbss_begin
+ LA r4, bsp_section_sbss_size
bl bsp_start_zero
/* Clear BSS */
- LWI r3, bsp_section_bss_begin
- LWI r4, bsp_section_bss_size
+ LA r3, bsp_section_bss_begin
+ LA r4, bsp_section_bss_size
bl bsp_start_zero
/* Set up EABI and SYSV environment */
diff --git a/c/src/lib/libcpu/powerpc/shared/include/powerpc-utility.h b/c/src/lib/libcpu/powerpc/shared/include/powerpc-utility.h
index ea063d5ff1..4d6af38485 100644
--- a/c/src/lib/libcpu/powerpc/shared/include/powerpc-utility.h
+++ b/c/src/lib/libcpu/powerpc/shared/include/powerpc-utility.h
@@ -869,8 +869,16 @@ void ShowBATS(void);
#include <rtems/asm.h>
.macro LA reg, addr
+#if defined(__powerpc64__)
+ lis \reg, (\addr)@highest
+ ori \reg, \reg, (\addr)@higher
+ rldicr \reg, \reg, 32, 31
+ oris \reg, \reg, (\addr)@h
+ ori \reg, \reg, (\addr)@l
+#else
lis \reg, (\addr)@h
ori \reg, \reg, (\addr)@l
+#endif
.endm
.macro LA32 reg, addr