arm: Use the WEAK assembly entry point consistently
It is a bad idea, and more modern toolchains will fail, if you declare an assembly function to be global and then weak, instead of declaring it weak to start with. Update assorted assembly files to use the WEAK macro directly. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Pali Rohár <pali@kernel.org>
This commit is contained in:
parent
583f124aac
commit
fc2240046c
@ -207,7 +207,7 @@ ENDPROC(_nonsec_init)
|
|||||||
|
|
||||||
#ifdef CONFIG_SMP_PEN_ADDR
|
#ifdef CONFIG_SMP_PEN_ADDR
|
||||||
/* void __weak smp_waitloop(unsigned previous_address); */
|
/* void __weak smp_waitloop(unsigned previous_address); */
|
||||||
ENTRY(smp_waitloop)
|
WEAK(smp_waitloop)
|
||||||
wfi
|
wfi
|
||||||
ldr r1, =CONFIG_SMP_PEN_ADDR @ load start address
|
ldr r1, =CONFIG_SMP_PEN_ADDR @ load start address
|
||||||
ldr r1, [r1]
|
ldr r1, [r1]
|
||||||
@ -219,7 +219,6 @@ ENTRY(smp_waitloop)
|
|||||||
mov r0, r1
|
mov r0, r1
|
||||||
b _do_nonsec_entry
|
b _do_nonsec_entry
|
||||||
ENDPROC(smp_waitloop)
|
ENDPROC(smp_waitloop)
|
||||||
.weak smp_waitloop
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
.popsection
|
.popsection
|
||||||
|
@ -36,34 +36,32 @@ _psci_vectors:
|
|||||||
b default_psci_vector @ irq
|
b default_psci_vector @ irq
|
||||||
b psci_fiq_enter @ fiq
|
b psci_fiq_enter @ fiq
|
||||||
|
|
||||||
ENTRY(psci_fiq_enter)
|
WEAK(psci_fiq_enter)
|
||||||
movs pc, lr
|
movs pc, lr
|
||||||
ENDPROC(psci_fiq_enter)
|
ENDPROC(psci_fiq_enter)
|
||||||
.weak psci_fiq_enter
|
|
||||||
|
|
||||||
ENTRY(default_psci_vector)
|
WEAK(default_psci_vector)
|
||||||
movs pc, lr
|
movs pc, lr
|
||||||
ENDPROC(default_psci_vector)
|
ENDPROC(default_psci_vector)
|
||||||
.weak default_psci_vector
|
|
||||||
|
|
||||||
ENTRY(psci_version)
|
WEAK(psci_version)
|
||||||
ENTRY(psci_cpu_suspend)
|
WEAK(psci_cpu_suspend)
|
||||||
ENTRY(psci_cpu_off)
|
WEAK(psci_cpu_off)
|
||||||
ENTRY(psci_cpu_on)
|
WEAK(psci_cpu_on)
|
||||||
ENTRY(psci_affinity_info)
|
WEAK(psci_affinity_info)
|
||||||
ENTRY(psci_migrate)
|
WEAK(psci_migrate)
|
||||||
ENTRY(psci_migrate_info_type)
|
WEAK(psci_migrate_info_type)
|
||||||
ENTRY(psci_migrate_info_up_cpu)
|
WEAK(psci_migrate_info_up_cpu)
|
||||||
ENTRY(psci_system_off)
|
WEAK(psci_system_off)
|
||||||
ENTRY(psci_system_reset)
|
WEAK(psci_system_reset)
|
||||||
ENTRY(psci_features)
|
WEAK(psci_features)
|
||||||
ENTRY(psci_cpu_freeze)
|
WEAK(psci_cpu_freeze)
|
||||||
ENTRY(psci_cpu_default_suspend)
|
WEAK(psci_cpu_default_suspend)
|
||||||
ENTRY(psci_node_hw_state)
|
WEAK(psci_node_hw_state)
|
||||||
ENTRY(psci_system_suspend)
|
WEAK(psci_system_suspend)
|
||||||
ENTRY(psci_set_suspend_mode)
|
WEAK(psci_set_suspend_mode)
|
||||||
ENTRY(psi_stat_residency)
|
WEAK(psi_stat_residency)
|
||||||
ENTRY(psci_stat_count)
|
WEAK(psci_stat_count)
|
||||||
mov r0, #ARM_PSCI_RET_NI @ Return -1 (Not Implemented)
|
mov r0, #ARM_PSCI_RET_NI @ Return -1 (Not Implemented)
|
||||||
mov pc, lr
|
mov pc, lr
|
||||||
ENDPROC(psci_stat_count)
|
ENDPROC(psci_stat_count)
|
||||||
@ -84,24 +82,6 @@ ENDPROC(psci_cpu_on)
|
|||||||
ENDPROC(psci_cpu_off)
|
ENDPROC(psci_cpu_off)
|
||||||
ENDPROC(psci_cpu_suspend)
|
ENDPROC(psci_cpu_suspend)
|
||||||
ENDPROC(psci_version)
|
ENDPROC(psci_version)
|
||||||
.weak psci_version
|
|
||||||
.weak psci_cpu_suspend
|
|
||||||
.weak psci_cpu_off
|
|
||||||
.weak psci_cpu_on
|
|
||||||
.weak psci_affinity_info
|
|
||||||
.weak psci_migrate
|
|
||||||
.weak psci_migrate_info_type
|
|
||||||
.weak psci_migrate_info_up_cpu
|
|
||||||
.weak psci_system_off
|
|
||||||
.weak psci_system_reset
|
|
||||||
.weak psci_features
|
|
||||||
.weak psci_cpu_freeze
|
|
||||||
.weak psci_cpu_default_suspend
|
|
||||||
.weak psci_node_hw_state
|
|
||||||
.weak psci_system_suspend
|
|
||||||
.weak psci_set_suspend_mode
|
|
||||||
.weak psi_stat_residency
|
|
||||||
.weak psci_stat_count
|
|
||||||
|
|
||||||
_psci_table:
|
_psci_table:
|
||||||
.word ARM_PSCI_FN_CPU_SUSPEND
|
.word ARM_PSCI_FN_CPU_SUSPEND
|
||||||
@ -179,12 +159,11 @@ _smc_psci:
|
|||||||
movs pc, lr @ Return to the kernel
|
movs pc, lr @ Return to the kernel
|
||||||
|
|
||||||
@ Requires dense and single-cluster CPU ID space
|
@ Requires dense and single-cluster CPU ID space
|
||||||
ENTRY(psci_get_cpu_id)
|
WEAK(psci_get_cpu_id)
|
||||||
mrc p15, 0, r0, c0, c0, 5 /* read MPIDR */
|
mrc p15, 0, r0, c0, c0, 5 /* read MPIDR */
|
||||||
and r0, r0, #0xff /* return CPU ID in cluster */
|
and r0, r0, #0xff /* return CPU ID in cluster */
|
||||||
bx lr
|
bx lr
|
||||||
ENDPROC(psci_get_cpu_id)
|
ENDPROC(psci_get_cpu_id)
|
||||||
.weak psci_get_cpu_id
|
|
||||||
|
|
||||||
/* Imported from Linux kernel */
|
/* Imported from Linux kernel */
|
||||||
ENTRY(psci_v7_flush_dcache_all)
|
ENTRY(psci_v7_flush_dcache_all)
|
||||||
@ -236,7 +215,7 @@ finished:
|
|||||||
bx lr
|
bx lr
|
||||||
ENDPROC(psci_v7_flush_dcache_all)
|
ENDPROC(psci_v7_flush_dcache_all)
|
||||||
|
|
||||||
ENTRY(psci_disable_smp)
|
WEAK(psci_disable_smp)
|
||||||
mrc p15, 0, r0, c1, c0, 1 @ ACTLR
|
mrc p15, 0, r0, c1, c0, 1 @ ACTLR
|
||||||
bic r0, r0, #(1 << 6) @ Clear SMP bit
|
bic r0, r0, #(1 << 6) @ Clear SMP bit
|
||||||
mcr p15, 0, r0, c1, c0, 1 @ ACTLR
|
mcr p15, 0, r0, c1, c0, 1 @ ACTLR
|
||||||
@ -244,16 +223,14 @@ ENTRY(psci_disable_smp)
|
|||||||
dsb
|
dsb
|
||||||
bx lr
|
bx lr
|
||||||
ENDPROC(psci_disable_smp)
|
ENDPROC(psci_disable_smp)
|
||||||
.weak psci_disable_smp
|
|
||||||
|
|
||||||
ENTRY(psci_enable_smp)
|
WEAK(psci_enable_smp)
|
||||||
mrc p15, 0, r0, c1, c0, 1 @ ACTLR
|
mrc p15, 0, r0, c1, c0, 1 @ ACTLR
|
||||||
orr r0, r0, #(1 << 6) @ Set SMP bit
|
orr r0, r0, #(1 << 6) @ Set SMP bit
|
||||||
mcr p15, 0, r0, c1, c0, 1 @ ACTLR
|
mcr p15, 0, r0, c1, c0, 1 @ ACTLR
|
||||||
isb
|
isb
|
||||||
bx lr
|
bx lr
|
||||||
ENDPROC(psci_enable_smp)
|
ENDPROC(psci_enable_smp)
|
||||||
.weak psci_enable_smp
|
|
||||||
|
|
||||||
ENTRY(psci_cpu_off_common)
|
ENTRY(psci_cpu_off_common)
|
||||||
push {lr}
|
push {lr}
|
||||||
@ -316,15 +293,13 @@ ENTRY(psci_stack_setup)
|
|||||||
bx r6
|
bx r6
|
||||||
ENDPROC(psci_stack_setup)
|
ENDPROC(psci_stack_setup)
|
||||||
|
|
||||||
ENTRY(psci_arch_init)
|
WEAK(psci_arch_init)
|
||||||
mov pc, lr
|
mov pc, lr
|
||||||
ENDPROC(psci_arch_init)
|
ENDPROC(psci_arch_init)
|
||||||
.weak psci_arch_init
|
|
||||||
|
|
||||||
ENTRY(psci_arch_cpu_entry)
|
WEAK(psci_arch_cpu_entry)
|
||||||
mov pc, lr
|
mov pc, lr
|
||||||
ENDPROC(psci_arch_cpu_entry)
|
ENDPROC(psci_arch_cpu_entry)
|
||||||
.weak psci_arch_cpu_entry
|
|
||||||
|
|
||||||
ENTRY(psci_cpu_entry)
|
ENTRY(psci_cpu_entry)
|
||||||
bl psci_enable_smp
|
bl psci_enable_smp
|
||||||
|
@ -151,16 +151,14 @@ ENDPROC(c_runtime_cpu_setup)
|
|||||||
* Don't save anything to stack even if compiled with -O0
|
* Don't save anything to stack even if compiled with -O0
|
||||||
*
|
*
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
ENTRY(save_boot_params)
|
WEAK(save_boot_params)
|
||||||
b save_boot_params_ret @ back to my caller
|
b save_boot_params_ret @ back to my caller
|
||||||
ENDPROC(save_boot_params)
|
ENDPROC(save_boot_params)
|
||||||
.weak save_boot_params
|
|
||||||
|
|
||||||
#ifdef CONFIG_ARMV7_LPAE
|
#ifdef CONFIG_ARMV7_LPAE
|
||||||
ENTRY(switch_to_hypervisor)
|
WEAK(switch_to_hypervisor)
|
||||||
b switch_to_hypervisor_ret
|
b switch_to_hypervisor_ret
|
||||||
ENDPROC(switch_to_hypervisor)
|
ENDPROC(switch_to_hypervisor)
|
||||||
.weak switch_to_hypervisor
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
@ -12,11 +12,10 @@
|
|||||||
|
|
||||||
/* Default PSCI function, return -1, Not Implemented */
|
/* Default PSCI function, return -1, Not Implemented */
|
||||||
#define PSCI_DEFAULT(__fn) \
|
#define PSCI_DEFAULT(__fn) \
|
||||||
ENTRY(__fn); \
|
WEAK(__fn); \
|
||||||
mov w0, #ARM_PSCI_RET_NI; \
|
mov w0, #ARM_PSCI_RET_NI; \
|
||||||
ret; \
|
ret; \
|
||||||
ENDPROC(__fn); \
|
ENDPROC(__fn); \
|
||||||
.weak __fn
|
|
||||||
|
|
||||||
/* PSCI function and ID table definition*/
|
/* PSCI function and ID table definition*/
|
||||||
#define PSCI_TABLE(__id, __fn) \
|
#define PSCI_TABLE(__id, __fn) \
|
||||||
@ -207,7 +206,7 @@ handle_smc64:
|
|||||||
* used for the return value, while in this PSCI environment, X0 usually holds
|
* used for the return value, while in this PSCI environment, X0 usually holds
|
||||||
* the SMC function identifier, so X0 should be saved by caller function.
|
* the SMC function identifier, so X0 should be saved by caller function.
|
||||||
*/
|
*/
|
||||||
ENTRY(psci_get_cpu_id)
|
WEAK(psci_get_cpu_id)
|
||||||
#ifdef CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER
|
#ifdef CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER
|
||||||
mrs x9, MPIDR_EL1
|
mrs x9, MPIDR_EL1
|
||||||
ubfx x9, x9, #8, #8
|
ubfx x9, x9, #8, #8
|
||||||
@ -221,7 +220,6 @@ ENTRY(psci_get_cpu_id)
|
|||||||
add x0, x10, x9
|
add x0, x10, x9
|
||||||
ret
|
ret
|
||||||
ENDPROC(psci_get_cpu_id)
|
ENDPROC(psci_get_cpu_id)
|
||||||
.weak psci_get_cpu_id
|
|
||||||
|
|
||||||
/* CPU ID input in x0, stack top output in x0*/
|
/* CPU ID input in x0, stack top output in x0*/
|
||||||
LENTRY(psci_get_cpu_stack_top)
|
LENTRY(psci_get_cpu_stack_top)
|
||||||
@ -261,10 +259,9 @@ handle_sync:
|
|||||||
* Override this function if custom error handling is
|
* Override this function if custom error handling is
|
||||||
* needed for asynchronous aborts
|
* needed for asynchronous aborts
|
||||||
*/
|
*/
|
||||||
ENTRY(plat_error_handler)
|
WEAK(plat_error_handler)
|
||||||
ret
|
ret
|
||||||
ENDPROC(plat_error_handler)
|
ENDPROC(plat_error_handler)
|
||||||
.weak plat_error_handler
|
|
||||||
|
|
||||||
handle_error:
|
handle_error:
|
||||||
bl psci_get_cpu_id
|
bl psci_get_cpu_id
|
||||||
@ -323,9 +320,8 @@ ENTRY(psci_setup_vectors)
|
|||||||
ret
|
ret
|
||||||
ENDPROC(psci_setup_vectors)
|
ENDPROC(psci_setup_vectors)
|
||||||
|
|
||||||
ENTRY(psci_arch_init)
|
WEAK(psci_arch_init)
|
||||||
ret
|
ret
|
||||||
ENDPROC(psci_arch_init)
|
ENDPROC(psci_arch_init)
|
||||||
.weak psci_arch_init
|
|
||||||
|
|
||||||
.popsection
|
.popsection
|
||||||
|
@ -23,9 +23,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
.section .text.relocate_vectors,"ax",%progbits
|
.section .text.relocate_vectors,"ax",%progbits
|
||||||
.weak relocate_vectors
|
|
||||||
|
|
||||||
ENTRY(relocate_vectors)
|
WEAK(relocate_vectors)
|
||||||
|
|
||||||
#ifdef CONFIG_CPU_V7M
|
#ifdef CONFIG_CPU_V7M
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user