From c6994af7a7a1ba9afb0403d9e0785a905edab6ee Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 31 Jul 2017 15:10:33 +0200 Subject: bsp/qoriq: Use LA to load an address Add 64-bit support for LA. Update #3082. --- c/src/lib/libbsp/powerpc/qoriq/start/start.S | 44 +++++++++++----------- .../powerpc/shared/include/powerpc-utility.h | 8 ++++ 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 .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 -- cgit v1.2.3