armv7: add appropriate headers for assembly functions
Use ENTRY and ENDPROC with assembly functions to ensure necessary assembler directives for all functions. Signed-off-by: Aneesh V <aneesh@ti.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
7245536d19
commit
74236acacc
@ -22,6 +22,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <asm/arch/imx-regs.h>
|
#include <asm/arch/imx-regs.h>
|
||||||
#include <generated/asm-offsets.h>
|
#include <generated/asm-offsets.h>
|
||||||
|
#include <linux/linkage.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* L2CC Cache setup/invalidation/disable
|
* L2CC Cache setup/invalidation/disable
|
||||||
@ -326,8 +327,7 @@
|
|||||||
|
|
||||||
.section ".text.init", "x"
|
.section ".text.init", "x"
|
||||||
|
|
||||||
.globl lowlevel_init
|
ENTRY(lowlevel_init)
|
||||||
lowlevel_init:
|
|
||||||
#if defined(CONFIG_MX51)
|
#if defined(CONFIG_MX51)
|
||||||
ldr r0, =GPIO1_BASE_ADDR
|
ldr r0, =GPIO1_BASE_ADDR
|
||||||
ldr r1, [r0, #0x0]
|
ldr r1, [r0, #0x0]
|
||||||
@ -348,6 +348,7 @@ lowlevel_init:
|
|||||||
|
|
||||||
/* r12 saved upper lr*/
|
/* r12 saved upper lr*/
|
||||||
mov pc,lr
|
mov pc,lr
|
||||||
|
ENDPROC(lowlevel_init)
|
||||||
|
|
||||||
/* Board level setting value */
|
/* Board level setting value */
|
||||||
W_DP_OP_864: .word DP_OP_864
|
W_DP_OP_864: .word DP_OP_864
|
||||||
|
@ -18,7 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
.section ".text.init", "x"
|
.section ".text.init", "x"
|
||||||
|
|
||||||
.globl lowlevel_init
|
#include <linux/linkage.h>
|
||||||
lowlevel_init:
|
|
||||||
|
|
||||||
|
ENTRY(lowlevel_init)
|
||||||
mov pc, lr
|
mov pc, lr
|
||||||
|
ENDPROC(lowlevel_init)
|
||||||
|
@ -27,9 +27,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <asm/arch/omap.h>
|
#include <asm/arch/omap.h>
|
||||||
|
#include <linux/linkage.h>
|
||||||
|
|
||||||
.global save_boot_params
|
ENTRY(save_boot_params)
|
||||||
save_boot_params:
|
|
||||||
/*
|
/*
|
||||||
* See if the rom code passed pointer is valid:
|
* See if the rom code passed pointer is valid:
|
||||||
* It is not valid if it is not in non-secure SRAM
|
* It is not valid if it is not in non-secure SRAM
|
||||||
@ -76,10 +76,9 @@ save_boot_params:
|
|||||||
strb r2, [r3, #CH_FLAGS_OFFSET]
|
strb r2, [r3, #CH_FLAGS_OFFSET]
|
||||||
1:
|
1:
|
||||||
bx lr
|
bx lr
|
||||||
|
ENDPROC(save_boot_params)
|
||||||
|
|
||||||
|
ENTRY(lowlevel_init)
|
||||||
.globl lowlevel_init
|
|
||||||
lowlevel_init:
|
|
||||||
/*
|
/*
|
||||||
* Setup a temporary stack
|
* Setup a temporary stack
|
||||||
*/
|
*/
|
||||||
@ -95,12 +94,13 @@ lowlevel_init:
|
|||||||
*/
|
*/
|
||||||
bl s_init
|
bl s_init
|
||||||
pop {ip, pc}
|
pop {ip, pc}
|
||||||
|
ENDPROC(lowlevel_init)
|
||||||
|
|
||||||
.globl set_pl310_ctrl_reg
|
ENTRY(set_pl310_ctrl_reg)
|
||||||
set_pl310_ctrl_reg:
|
|
||||||
PUSH {r4-r11, lr} @ save registers - ROM code may pollute
|
PUSH {r4-r11, lr} @ save registers - ROM code may pollute
|
||||||
@ our registers
|
@ our registers
|
||||||
LDR r12, =0x102 @ Set PL310 control register - value in R0
|
LDR r12, =0x102 @ Set PL310 control register - value in R0
|
||||||
.word 0xe1600070 @ SMC #0 - hand assembled because -march=armv5
|
.word 0xe1600070 @ SMC #0 - hand assembled because -march=armv5
|
||||||
@ call ROM Code API to set control register
|
@ call ROM Code API to set control register
|
||||||
POP {r4-r11, pc}
|
POP {r4-r11, pc}
|
||||||
|
ENDPROC(set_pl310_ctrl_reg)
|
||||||
|
@ -31,22 +31,22 @@
|
|||||||
#include <version.h>
|
#include <version.h>
|
||||||
#include <asm/arch/mem.h>
|
#include <asm/arch/mem.h>
|
||||||
#include <asm/arch/clocks_omap3.h>
|
#include <asm/arch/clocks_omap3.h>
|
||||||
|
#include <linux/linkage.h>
|
||||||
|
|
||||||
_TEXT_BASE:
|
_TEXT_BASE:
|
||||||
.word CONFIG_SYS_TEXT_BASE /* sdram load addr from config.mk */
|
.word CONFIG_SYS_TEXT_BASE /* sdram load addr from config.mk */
|
||||||
|
|
||||||
#ifdef CONFIG_SPL_BUILD
|
#ifdef CONFIG_SPL_BUILD
|
||||||
.global save_boot_params
|
ENTRY(save_boot_params)
|
||||||
save_boot_params:
|
|
||||||
ldr r4, =omap3_boot_device
|
ldr r4, =omap3_boot_device
|
||||||
ldr r5, [r0, #0x4]
|
ldr r5, [r0, #0x4]
|
||||||
and r5, r5, #0xff
|
and r5, r5, #0xff
|
||||||
str r5, [r4]
|
str r5, [r4]
|
||||||
bx lr
|
bx lr
|
||||||
|
ENDPROC(save_boot_params)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
.global omap3_gp_romcode_call
|
ENTRY(omap3_gp_romcode_call)
|
||||||
omap3_gp_romcode_call:
|
|
||||||
PUSH {r4-r12, lr} @ Save all registers from ROM code!
|
PUSH {r4-r12, lr} @ Save all registers from ROM code!
|
||||||
MOV r12, r0 @ Copy the Service ID in R12
|
MOV r12, r0 @ Copy the Service ID in R12
|
||||||
MOV r0, r1 @ Copy parameter to R0
|
MOV r0, r1 @ Copy parameter to R0
|
||||||
@ -55,6 +55,7 @@ omap3_gp_romcode_call:
|
|||||||
.word 0xe1600070 @ SMC #0 to enter monitor - hand assembled
|
.word 0xe1600070 @ SMC #0 to enter monitor - hand assembled
|
||||||
@ because we use -march=armv5
|
@ because we use -march=armv5
|
||||||
POP {r4-r12, pc}
|
POP {r4-r12, pc}
|
||||||
|
ENDPROC(omap3_gp_romcode_call)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Funtion for making PPA HAL API calls in secure devices
|
* Funtion for making PPA HAL API calls in secure devices
|
||||||
@ -62,8 +63,7 @@ omap3_gp_romcode_call:
|
|||||||
* R0 - Service ID
|
* R0 - Service ID
|
||||||
* R1 - paramer list
|
* R1 - paramer list
|
||||||
*/
|
*/
|
||||||
.global do_omap3_emu_romcode_call
|
ENTRY(do_omap3_emu_romcode_call)
|
||||||
do_omap3_emu_romcode_call:
|
|
||||||
PUSH {r4-r12, lr} @ Save all registers from ROM code!
|
PUSH {r4-r12, lr} @ Save all registers from ROM code!
|
||||||
MOV r12, r0 @ Copy the Secure Service ID in R12
|
MOV r12, r0 @ Copy the Secure Service ID in R12
|
||||||
MOV r3, r1 @ Copy the pointer to va_list in R3
|
MOV r3, r1 @ Copy the pointer to va_list in R3
|
||||||
@ -76,14 +76,14 @@ do_omap3_emu_romcode_call:
|
|||||||
.word 0xe1600071 @ SMC #1 to call PPA service - hand assembled
|
.word 0xe1600071 @ SMC #1 to call PPA service - hand assembled
|
||||||
@ because we use -march=armv5
|
@ because we use -march=armv5
|
||||||
POP {r4-r12, pc}
|
POP {r4-r12, pc}
|
||||||
|
ENDPROC(do_omap3_emu_romcode_call)
|
||||||
|
|
||||||
#if !defined(CONFIG_SYS_NAND_BOOT) && !defined(CONFIG_SYS_NAND_BOOT)
|
#if !defined(CONFIG_SYS_NAND_BOOT) && !defined(CONFIG_SYS_NAND_BOOT)
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* cpy_clk_code: relocates clock code into SRAM where its safer to execute
|
* cpy_clk_code: relocates clock code into SRAM where its safer to execute
|
||||||
* R1 = SRAM destination address.
|
* R1 = SRAM destination address.
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
.global cpy_clk_code
|
ENTRY(cpy_clk_code)
|
||||||
cpy_clk_code:
|
|
||||||
/* Copy DPLL code into SRAM */
|
/* Copy DPLL code into SRAM */
|
||||||
adr r0, go_to_speed /* get addr of clock setting code */
|
adr r0, go_to_speed /* get addr of clock setting code */
|
||||||
mov r2, #384 /* r2 size to copy (div by 32 bytes) */
|
mov r2, #384 /* r2 size to copy (div by 32 bytes) */
|
||||||
@ -95,6 +95,7 @@ next2:
|
|||||||
cmp r0, r2 /* until source end address [r2] */
|
cmp r0, r2 /* until source end address [r2] */
|
||||||
bne next2
|
bne next2
|
||||||
mov pc, lr /* back to caller */
|
mov pc, lr /* back to caller */
|
||||||
|
ENDPROC(cpy_clk_code)
|
||||||
|
|
||||||
/* ***************************************************************************
|
/* ***************************************************************************
|
||||||
* go_to_speed: -Moves to bypass, -Commits clock dividers, -puts dpll at speed
|
* go_to_speed: -Moves to bypass, -Commits clock dividers, -puts dpll at speed
|
||||||
@ -109,8 +110,7 @@ next2:
|
|||||||
* L3 when its not in self refresh seems bad for it. Normally, this
|
* L3 when its not in self refresh seems bad for it. Normally, this
|
||||||
* code runs from flash before SDR is init so that should be ok.
|
* code runs from flash before SDR is init so that should be ok.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
.global go_to_speed
|
ENTRY(go_to_speed)
|
||||||
go_to_speed:
|
|
||||||
stmfd sp!, {r4 - r6}
|
stmfd sp!, {r4 - r6}
|
||||||
|
|
||||||
/* move into fast relock bypass */
|
/* move into fast relock bypass */
|
||||||
@ -171,6 +171,7 @@ wait2:
|
|||||||
nop
|
nop
|
||||||
ldmfd sp!, {r4 - r6}
|
ldmfd sp!, {r4 - r6}
|
||||||
mov pc, lr /* back to caller, locked */
|
mov pc, lr /* back to caller, locked */
|
||||||
|
ENDPROC(go_to_speed)
|
||||||
|
|
||||||
_go_to_speed: .word go_to_speed
|
_go_to_speed: .word go_to_speed
|
||||||
|
|
||||||
@ -211,8 +212,7 @@ pll_div_val5:
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
.globl lowlevel_init
|
ENTRY(lowlevel_init)
|
||||||
lowlevel_init:
|
|
||||||
ldr sp, SRAM_STACK
|
ldr sp, SRAM_STACK
|
||||||
str ip, [sp] /* stash old link register */
|
str ip, [sp] /* stash old link register */
|
||||||
mov ip, lr /* save link reg across call */
|
mov ip, lr /* save link reg across call */
|
||||||
@ -230,6 +230,7 @@ lowlevel_init:
|
|||||||
|
|
||||||
/* back to arch calling code */
|
/* back to arch calling code */
|
||||||
mov pc, lr
|
mov pc, lr
|
||||||
|
ENDPROC(lowlevel_init)
|
||||||
|
|
||||||
/* the literal pools origin */
|
/* the literal pools origin */
|
||||||
.ltorg
|
.ltorg
|
||||||
@ -480,22 +481,22 @@ per_36x_dpll_param:
|
|||||||
.word 26000, 432, 12, 9, 16, 9, 4, 3, 1
|
.word 26000, 432, 12, 9, 16, 9, 4, 3, 1
|
||||||
.word 38400, 360, 15, 9, 16, 5, 4, 3, 1
|
.word 38400, 360, 15, 9, 16, 5, 4, 3, 1
|
||||||
|
|
||||||
.globl get_36x_mpu_dpll_param
|
ENTRY(get_36x_mpu_dpll_param)
|
||||||
get_36x_mpu_dpll_param:
|
|
||||||
adr r0, mpu_36x_dpll_param
|
adr r0, mpu_36x_dpll_param
|
||||||
mov pc, lr
|
mov pc, lr
|
||||||
|
ENDPROC(get_36x_mpu_dpll_param)
|
||||||
|
|
||||||
.globl get_36x_iva_dpll_param
|
ENTRY(get_36x_iva_dpll_param)
|
||||||
get_36x_iva_dpll_param:
|
|
||||||
adr r0, iva_36x_dpll_param
|
adr r0, iva_36x_dpll_param
|
||||||
mov pc, lr
|
mov pc, lr
|
||||||
|
ENDPROC(get_36x_iva_dpll_param)
|
||||||
|
|
||||||
.globl get_36x_core_dpll_param
|
ENTRY(get_36x_core_dpll_param)
|
||||||
get_36x_core_dpll_param:
|
|
||||||
adr r0, core_36x_dpll_param
|
adr r0, core_36x_dpll_param
|
||||||
mov pc, lr
|
mov pc, lr
|
||||||
|
ENDPROC(get_36x_core_dpll_param)
|
||||||
|
|
||||||
.globl get_36x_per_dpll_param
|
ENTRY(get_36x_per_dpll_param)
|
||||||
get_36x_per_dpll_param:
|
|
||||||
adr r0, per_36x_dpll_param
|
adr r0, per_36x_dpll_param
|
||||||
mov pc, lr
|
mov pc, lr
|
||||||
|
ENDPROC(get_36x_per_dpll_param)
|
||||||
|
@ -25,20 +25,22 @@
|
|||||||
|
|
||||||
.align 5
|
.align 5
|
||||||
|
|
||||||
|
#include <linux/linkage.h>
|
||||||
|
|
||||||
#ifndef CONFIG_SYS_L2CACHE_OFF
|
#ifndef CONFIG_SYS_L2CACHE_OFF
|
||||||
.global v7_outer_cache_enable
|
ENTRY(v7_outer_cache_enable)
|
||||||
v7_outer_cache_enable:
|
|
||||||
push {r0, r1, r2, lr}
|
push {r0, r1, r2, lr}
|
||||||
mrc 15, 0, r3, cr1, cr0, 1
|
mrc 15, 0, r3, cr1, cr0, 1
|
||||||
orr r3, r3, #2
|
orr r3, r3, #2
|
||||||
mcr 15, 0, r3, cr1, cr0, 1
|
mcr 15, 0, r3, cr1, cr0, 1
|
||||||
pop {r1, r2, r3, pc}
|
pop {r1, r2, r3, pc}
|
||||||
|
ENDPROC(v7_outer_cache_enable)
|
||||||
|
|
||||||
.global v7_outer_cache_disable
|
ENTRY(v7_outer_cache_disable)
|
||||||
v7_outer_cache_disable:
|
|
||||||
push {r0, r1, r2, lr}
|
push {r0, r1, r2, lr}
|
||||||
mrc 15, 0, r3, cr1, cr0, 1
|
mrc 15, 0, r3, cr1, cr0, 1
|
||||||
bic r3, r3, #2
|
bic r3, r3, #2
|
||||||
mcr 15, 0, r3, cr1, cr0, 1
|
mcr 15, 0, r3, cr1, cr0, 1
|
||||||
pop {r1, r2, r3, pc}
|
pop {r1, r2, r3, pc}
|
||||||
|
ENDPROC(v7_outer_cache_disable)
|
||||||
#endif
|
#endif
|
||||||
|
@ -22,12 +22,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <asm/arch/cpu.h>
|
#include <asm/arch/cpu.h>
|
||||||
|
#include <linux/linkage.h>
|
||||||
|
|
||||||
#define S5PC100_SWRESET 0xE0200000
|
#define S5PC100_SWRESET 0xE0200000
|
||||||
#define S5PC110_SWRESET 0xE0102000
|
#define S5PC110_SWRESET 0xE0102000
|
||||||
|
|
||||||
.globl reset_cpu
|
ENTRY(reset_cpu)
|
||||||
reset_cpu:
|
|
||||||
ldr r1, =S5PC100_PRO_ID
|
ldr r1, =S5PC100_PRO_ID
|
||||||
ldr r2, [r1]
|
ldr r2, [r1]
|
||||||
ldr r4, =0x00010000
|
ldr r4, =0x00010000
|
||||||
@ -45,3 +45,4 @@ reset_cpu:
|
|||||||
str r2, [r1]
|
str r2, [r1]
|
||||||
_loop_forever:
|
_loop_forever:
|
||||||
b _loop_forever
|
b _loop_forever
|
||||||
|
ENDPROC(reset_cpu)
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <version.h>
|
#include <version.h>
|
||||||
#include <asm/system.h>
|
#include <asm/system.h>
|
||||||
|
#include <linux/linkage.h>
|
||||||
|
|
||||||
.globl _start
|
.globl _start
|
||||||
_start: b reset
|
_start: b reset
|
||||||
@ -172,8 +173,7 @@ call_board_init_f:
|
|||||||
* after relocating the monitor code.
|
* after relocating the monitor code.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
.globl relocate_code
|
ENTRY(relocate_code)
|
||||||
relocate_code:
|
|
||||||
mov r4, r0 /* save addr_sp */
|
mov r4, r0 /* save addr_sp */
|
||||||
mov r5, r1 /* save addr of gd */
|
mov r5, r1 /* save addr of gd */
|
||||||
mov r6, r2 /* save addr of destination */
|
mov r6, r2 /* save addr of destination */
|
||||||
@ -289,6 +289,7 @@ jump_2_ram:
|
|||||||
|
|
||||||
_board_init_r_ofs:
|
_board_init_r_ofs:
|
||||||
.word board_init_r - _start
|
.word board_init_r - _start
|
||||||
|
ENDPROC(relocate_code)
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
*
|
*
|
||||||
@ -298,8 +299,7 @@ _board_init_r_ofs:
|
|||||||
* CONFIG_SYS_ICACHE_OFF is defined.
|
* CONFIG_SYS_ICACHE_OFF is defined.
|
||||||
*
|
*
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
.globl cpu_init_cp15
|
ENTRY(cpu_init_cp15)
|
||||||
cpu_init_cp15:
|
|
||||||
/*
|
/*
|
||||||
* Invalidate L1 I/D
|
* Invalidate L1 I/D
|
||||||
*/
|
*/
|
||||||
@ -325,7 +325,7 @@ cpu_init_cp15:
|
|||||||
#endif
|
#endif
|
||||||
mcr p15, 0, r0, c1, c0, 0
|
mcr p15, 0, r0, c1, c0, 0
|
||||||
mov pc, lr @ back to my caller
|
mov pc, lr @ back to my caller
|
||||||
|
ENDPROC(cpu_init_cp15)
|
||||||
|
|
||||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@ -336,7 +336,7 @@ cpu_init_cp15:
|
|||||||
* setup memory timing
|
* setup memory timing
|
||||||
*
|
*
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
cpu_init_crit:
|
ENTRY(cpu_init_crit)
|
||||||
/*
|
/*
|
||||||
* Jump to board specific initialization...
|
* Jump to board specific initialization...
|
||||||
* The Mask ROM will have already initialized
|
* The Mask ROM will have already initialized
|
||||||
@ -347,6 +347,7 @@ cpu_init_crit:
|
|||||||
bl lowlevel_init @ go setup pll,mux,memory
|
bl lowlevel_init @ go setup pll,mux,memory
|
||||||
mov lr, ip @ restore link
|
mov lr, ip @ restore link
|
||||||
mov pc, lr @ back to my caller
|
mov pc, lr @ back to my caller
|
||||||
|
ENDPROC(cpu_init_crit)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_SPL_BUILD
|
#ifndef CONFIG_SPL_BUILD
|
||||||
|
@ -25,10 +25,10 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <version.h>
|
#include <version.h>
|
||||||
|
#include <linux/linkage.h>
|
||||||
|
|
||||||
.align 5
|
.align 5
|
||||||
.global reset_cpu
|
ENTRY(reset_cpu)
|
||||||
reset_cpu:
|
|
||||||
ldr r1, rstctl @ get addr for global reset
|
ldr r1, rstctl @ get addr for global reset
|
||||||
@ reg
|
@ reg
|
||||||
ldr r3, [r1]
|
ldr r3, [r1]
|
||||||
@ -39,3 +39,4 @@ _loop_forever:
|
|||||||
b _loop_forever
|
b _loop_forever
|
||||||
rstctl:
|
rstctl:
|
||||||
.word PRM_RSTCTRL
|
.word PRM_RSTCTRL
|
||||||
|
ENDPROC(reset_cpu)
|
||||||
|
@ -20,16 +20,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#include <linux/linkage.h>
|
||||||
|
|
||||||
.globl lowlevel_init
|
ENTRY(lowlevel_init)
|
||||||
lowlevel_init:
|
|
||||||
mov pc, lr
|
mov pc, lr
|
||||||
|
ENDPROC(lowlevel_init)
|
||||||
|
|
||||||
.align 5
|
.align 5
|
||||||
.globl reset_cpu
|
ENTRY(reset_cpu)
|
||||||
reset_cpu:
|
|
||||||
ldr r0, =CFG_PRCMU_BASE
|
ldr r0, =CFG_PRCMU_BASE
|
||||||
ldr r1, =0x1
|
ldr r1, =0x1
|
||||||
str r1, [r0, #0x228]
|
str r1, [r0, #0x228]
|
||||||
_loop_forever:
|
_loop_forever:
|
||||||
b _loop_forever
|
b _loop_forever
|
||||||
|
ENDPROC(reset_cpu)
|
||||||
|
Loading…
Reference in New Issue
Block a user