2 * linux/arch/arm/mach-omap3/sram.S
4 * Omap3 specific functions that need to be run in internal SRAM
7 * Texas Instruments Inc.
8 * Rajendra Nayak <rnayak@ti.com>
11 * Texas Instruments, <www.ti.com>
12 * Richard Woodruff <r-woodruff2@ti.com>
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 #include <linux/linkage.h>
30 #include <asm/assembler.h>
31 #include <asm/hardware.h>
33 #include <asm/arch/io.h>
40 ENTRY(omap34xx_sram_ddr_init)
41 stmfd sp!, {r0 - r12, lr} @ save registers on stack
42 ldmfd sp!, {r0 - r12, pc} @ restore regs and return
43 ENTRY(omap34xx_sram_ddr_init_sz)
44 .word . - omap34xx_sram_ddr_init
46 ENTRY(omap34xx_sram_reprogram_sdrc)
47 stmfd sp!, {r0 - r10, lr} @ save registers on stack
48 ldmfd sp!, {r0 - r10, pc} @ restore regs and return
49 ENTRY(omap34xx_sram_reprogram_sdrc_sz)
50 .word . - omap34xx_sram_reprogram_sdrc
53 * Set dividers and pll. Also recalculate DLL value for DDR and unlock mode.
55 ENTRY(omap34xx_sram_set_prcm)
56 stmfd sp!, {r0-r12, lr} @ regs to stack
57 ENTRY(omap34xx_sram_set_prcm_sz)
58 .word . - omap34xx_sram_set_prcm
61 * Change frequency of core dpll
62 * r0 = sdrc_rfr_ctrl r1 = sdrc_actim_ctrla r2 = sdrc_actim_ctrlb r3 = M2
64 ENTRY(omap34xx_sram_configure_core_dpll)
65 stmfd sp!, {r1-r12, lr} @ store regs to stack
72 bl sdram_in_selfrefresh @ put the SDRAM in self refresh
73 bl configure_core_dpll
81 mov r0, #0 @ return value
82 ldmfd sp!, {r1-r12, pc} @ restore regs and return
84 ldr r4, omap34xx_sdrc_dlla_ctrl
90 ldr r4, omap34xx_sdrc_dlla_ctrl
96 mov r5, #0x0 @ Move 0 to R5
97 mcr p15, 0, r5, c7, c10, 5 @ memory barrier
98 ldr r4, omap34xx_sdrc_power @ read the SDRC_POWER register
99 ldr r5, [r4] @ read the contents of SDRC_POWER
100 orr r5, r5, #0x40 @ enable self refresh on idle req
101 str r5, [r4] @ write back to SDRC_POWER register
102 ldr r4, omap34xx_cm_iclken1_core @ read the CM_ICLKEN1_CORE reg
104 bic r5, r5, #0x2 @ disable iclk bit for SRDC
107 ldr r4, omap34xx_cm_idlest1_core
109 and r5, r5, #0x2 @ check for SDRC idle
114 ldr r4, omap34xx_cm_clksel1_pll
116 ldr r6, core_m2_mask_val @ modify m2 for core dpll
118 orr r5, r5, r3, lsl #0x1B @ r3 contains the M2 val
120 mov r5, #0x800 @ wait for the clock to stabilise
139 ldr r4, omap34xx_cm_iclken1_core
141 orr r5, r5, #0x2 @ enable iclk bit for SDRC
144 ldr r4, omap34xx_cm_idlest1_core
149 ldr r4, omap34xx_sdrc_power
155 ldr r4, omap34xx_sdrc_dlla_status
162 ldr r4, omap34xx_sdrc_dlla_status
169 ldr r4, omap34xx_sdrc_rfr_ctrl
171 ldr r4, omap34xx_sdrc_actim_ctrla
173 ldr r4, omap34xx_sdrc_actim_ctrlb
178 .word OMAP34XX_SDRC_REGADDR(SDRC_POWER)
179 omap34xx_cm_clksel1_pll:
180 .word OMAP34XX_CM_REGADDR(PLL_MOD, CM_CLKSEL1)
181 omap34xx_cm_idlest1_core:
182 .word OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST)
183 omap34xx_cm_iclken1_core:
184 .word OMAP34XX_CM_REGADDR(CORE_MOD, CM_ICLKEN1)
185 omap34xx_sdrc_rfr_ctrl:
186 .word OMAP34XX_SDRC_REGADDR(SDRC_RFR_CTRL_0)
187 omap34xx_sdrc_actim_ctrla:
188 .word OMAP34XX_SDRC_REGADDR(SDRC_ACTIM_CTRL_A)
189 omap34xx_sdrc_actim_ctrlb:
190 .word OMAP34XX_SDRC_REGADDR(SDRC_ACTIM_CTRL_B)
191 omap34xx_sdrc_dlla_status:
192 .word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS)
193 omap34xx_sdrc_dlla_ctrl:
194 .word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL)
198 ENTRY(omap34xx_sram_configure_core_dpll_sz)
199 .word . - omap34xx_sram_configure_core_dpll
204 ENTRY(omap34xx_sram_reprogram_gpmc)
205 stmfd sp!, {r0-r12, lr} @ regs to stack
206 ldmfd sp!, {r0-r12, pc} @ restore regs and return
208 ENTRY(omap34xx_sram_reprogram_gpmc_sz)
209 .word . - omap34xx_sram_reprogram_gpmc