diff options
author | Dave Martin <dave.martin@linaro.org> | 2011-03-04 10:33:56 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-03-09 19:38:36 -0500 |
commit | ef7a87d34064eb87866d02547ee67060e5e49eb9 (patch) | |
tree | 6bba7f0228b442bccc391c8cc2272aa37652ec73 /arch/arm | |
parent | 76d500182061dcc7508e6b829af097348fa7d804 (diff) |
ARM: omap3: Thumb-2 compatibility for sram34xx.S
* Build unconditionally as ARM for correct interoperation with
OMAP firmware.
* Remove deprecated PC-relative stores
* Add the required ENDPROC() directive for each ENTRY().
* .align before data words
Signed-off-by: Dave Martin <dave.martin@linaro.org>
Tested-by: Jean Pihet <j-pihet@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/sram34xx.S | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S index 7f893a29d500..1078bfbc25c7 100644 --- a/arch/arm/mach-omap2/sram34xx.S +++ b/arch/arm/mach-omap2/sram34xx.S | |||
@@ -34,6 +34,12 @@ | |||
34 | #include "sdrc.h" | 34 | #include "sdrc.h" |
35 | #include "cm2xxx_3xxx.h" | 35 | #include "cm2xxx_3xxx.h" |
36 | 36 | ||
37 | /* | ||
38 | * This file needs be built unconditionally as ARM to interoperate correctly | ||
39 | * with non-Thumb-2-capable firmware. | ||
40 | */ | ||
41 | .arm | ||
42 | |||
37 | .text | 43 | .text |
38 | 44 | ||
39 | /* r1 parameters */ | 45 | /* r1 parameters */ |
@@ -116,24 +122,36 @@ ENTRY(omap3_sram_configure_core_dpll) | |||
116 | 122 | ||
117 | @ pull the extra args off the stack | 123 | @ pull the extra args off the stack |
118 | @ and store them in SRAM | 124 | @ and store them in SRAM |
125 | |||
126 | /* | ||
127 | * PC-relative stores are deprecated in ARMv7 and lead to undefined behaviour | ||
128 | * in Thumb-2: use a r7 as a base instead. | ||
129 | * Be careful not to clobber r7 when maintaing this file. | ||
130 | */ | ||
131 | THUMB( adr r7, omap3_sram_configure_core_dpll ) | ||
132 | .macro strtext Rt:req, label:req | ||
133 | ARM( str \Rt, \label ) | ||
134 | THUMB( str \Rt, [r7, \label - omap3_sram_configure_core_dpll] ) | ||
135 | .endm | ||
136 | |||
119 | ldr r4, [sp, #52] | 137 | ldr r4, [sp, #52] |
120 | str r4, omap_sdrc_rfr_ctrl_0_val | 138 | strtext r4, omap_sdrc_rfr_ctrl_0_val |
121 | ldr r4, [sp, #56] | 139 | ldr r4, [sp, #56] |
122 | str r4, omap_sdrc_actim_ctrl_a_0_val | 140 | strtext r4, omap_sdrc_actim_ctrl_a_0_val |
123 | ldr r4, [sp, #60] | 141 | ldr r4, [sp, #60] |
124 | str r4, omap_sdrc_actim_ctrl_b_0_val | 142 | strtext r4, omap_sdrc_actim_ctrl_b_0_val |
125 | ldr r4, [sp, #64] | 143 | ldr r4, [sp, #64] |
126 | str r4, omap_sdrc_mr_0_val | 144 | strtext r4, omap_sdrc_mr_0_val |
127 | ldr r4, [sp, #68] | 145 | ldr r4, [sp, #68] |
128 | str r4, omap_sdrc_rfr_ctrl_1_val | 146 | strtext r4, omap_sdrc_rfr_ctrl_1_val |
129 | cmp r4, #0 @ if SDRC_RFR_CTRL_1 is 0, | 147 | cmp r4, #0 @ if SDRC_RFR_CTRL_1 is 0, |
130 | beq skip_cs1_params @ do not use cs1 params | 148 | beq skip_cs1_params @ do not use cs1 params |
131 | ldr r4, [sp, #72] | 149 | ldr r4, [sp, #72] |
132 | str r4, omap_sdrc_actim_ctrl_a_1_val | 150 | strtext r4, omap_sdrc_actim_ctrl_a_1_val |
133 | ldr r4, [sp, #76] | 151 | ldr r4, [sp, #76] |
134 | str r4, omap_sdrc_actim_ctrl_b_1_val | 152 | strtext r4, omap_sdrc_actim_ctrl_b_1_val |
135 | ldr r4, [sp, #80] | 153 | ldr r4, [sp, #80] |
136 | str r4, omap_sdrc_mr_1_val | 154 | strtext r4, omap_sdrc_mr_1_val |
137 | skip_cs1_params: | 155 | skip_cs1_params: |
138 | mrc p15, 0, r8, c1, c0, 0 @ read ctrl register | 156 | mrc p15, 0, r8, c1, c0, 0 @ read ctrl register |
139 | bic r10, r8, #0x800 @ clear Z-bit, disable branch prediction | 157 | bic r10, r8, #0x800 @ clear Z-bit, disable branch prediction |
@@ -271,6 +289,7 @@ skip_cs1_prog: | |||
271 | ldr r12, [r11] @ posted-write barrier for SDRC | 289 | ldr r12, [r11] @ posted-write barrier for SDRC |
272 | bx lr | 290 | bx lr |
273 | 291 | ||
292 | .align | ||
274 | omap3_sdrc_power: | 293 | omap3_sdrc_power: |
275 | .word OMAP34XX_SDRC_REGADDR(SDRC_POWER) | 294 | .word OMAP34XX_SDRC_REGADDR(SDRC_POWER) |
276 | omap3_cm_clksel1_pll: | 295 | omap3_cm_clksel1_pll: |
@@ -319,6 +338,7 @@ omap3_sdrc_dlla_ctrl: | |||
319 | .word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) | 338 | .word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) |
320 | core_m2_mask_val: | 339 | core_m2_mask_val: |
321 | .word 0x07FFFFFF | 340 | .word 0x07FFFFFF |
341 | ENDPROC(omap3_sram_configure_core_dpll) | ||
322 | 342 | ||
323 | ENTRY(omap3_sram_configure_core_dpll_sz) | 343 | ENTRY(omap3_sram_configure_core_dpll_sz) |
324 | .word . - omap3_sram_configure_core_dpll | 344 | .word . - omap3_sram_configure_core_dpll |