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 <mach/hardware.h>
41 * Change frequency of core dpll
42 * r0 = sdrc_rfr_ctrl r1 = sdrc_actim_ctrla r2 = sdrc_actim_ctrlb r3 = M2
44 ENTRY(omap3_sram_configure_core_dpll)
45 stmfd sp!, {r1-r12, lr} @ store regs to stack
46 dsb @ flush buffered writes to interconnect
53 bl sdram_in_selfrefresh @ put the SDRAM in self refresh
54 bl configure_core_dpll
62 isb @ prevent speculative exec past here
63 mov r0, #0 @ return value
64 ldmfd sp!, {r1-r12, pc} @ restore regs and return
66 ldr r4, omap3_sdrc_dlla_ctrl
72 ldr r4, omap3_sdrc_dlla_ctrl
78 ldr r4, omap3_sdrc_power @ read the SDRC_POWER register
79 ldr r5, [r4] @ read the contents of SDRC_POWER
80 orr r5, r5, #0x40 @ enable self refresh on idle req
81 str r5, [r4] @ write back to SDRC_POWER register
82 ldr r4, omap3_cm_iclken1_core @ read the CM_ICLKEN1_CORE reg
84 bic r5, r5, #0x2 @ disable iclk bit for SRDC
87 ldr r4, omap3_cm_idlest1_core
89 and r5, r5, #0x2 @ check for SDRC idle
94 ldr r4, omap3_cm_clksel1_pll
96 ldr r6, core_m2_mask_val @ modify m2 for core dpll
98 orr r5, r5, r3, lsl #0x1B @ r3 contains the M2 val
100 mov r5, #0x800 @ wait for the clock to stabilise
119 ldr r4, omap3_cm_iclken1_core
121 orr r5, r5, #0x2 @ enable iclk bit for SDRC
124 ldr r4, omap3_cm_idlest1_core
129 ldr r4, omap3_sdrc_power
135 ldr r4, omap3_sdrc_dlla_status
142 ldr r4, omap3_sdrc_dlla_status
149 ldr r4, omap3_sdrc_rfr_ctrl
151 ldr r4, omap3_sdrc_actim_ctrla
153 ldr r4, omap3_sdrc_actim_ctrlb
158 .word OMAP34XX_SDRC_REGADDR(SDRC_POWER)
159 omap3_cm_clksel1_pll:
160 .word OMAP34XX_CM_REGADDR(PLL_MOD, CM_CLKSEL1)
161 omap3_cm_idlest1_core:
162 .word OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST)
163 omap3_cm_iclken1_core:
164 .word OMAP34XX_CM_REGADDR(CORE_MOD, CM_ICLKEN1)
166 .word OMAP34XX_SDRC_REGADDR(SDRC_RFR_CTRL_0)
167 omap3_sdrc_actim_ctrla:
168 .word OMAP34XX_SDRC_REGADDR(SDRC_ACTIM_CTRL_A_0)
169 omap3_sdrc_actim_ctrlb:
170 .word OMAP34XX_SDRC_REGADDR(SDRC_ACTIM_CTRL_B_0)
171 omap3_sdrc_dlla_status:
172 .word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS)
173 omap3_sdrc_dlla_ctrl:
174 .word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL)
178 ENTRY(omap3_sram_configure_core_dpll_sz)
179 .word . - omap3_sram_configure_core_dpll