2 * File: arch/blackfin/mach-common/dpmc.S
4 * Author: LG Soft India
7 * Description: Watchdog Timer APIs
10 * Copyright 2004-2006 Analog Devices Inc.
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (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, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 #include <linux/linkage.h>
31 #include <asm/blackfin.h>
32 #include <asm/mach/irq.h>
38 [--SP] = ( R7:0, P5:0 );
57 call _test_pll_locked;
72 call _test_pll_locked;
75 ( R7:0, P5:0 ) = [SP++];
78 ENTRY(_hibernate_mode)
79 [--SP] = ( R7:0, P5:0 );
99 /* Actually, adding anything may not be necessary...SDRAM contents
104 [--SP] = ( R7:0, P5:0 );
110 R1 = IWR_DISABLE_ALL;
111 R2 = IWR_DISABLE_ALL;
117 /* Clear all the interrupts,bits sticky */
127 call _test_pll_locked;
132 call _unset_dram_srfs;
134 call _test_pll_locked;
137 R1 = IWR_DISABLE_ALL;
138 R2 = IWR_DISABLE_ALL;
150 call _test_pll_locked;
155 ( R7:0, P5:0 ) = [SP++];
159 [--SP] = ( R7:0, P5:0 );
169 R1 = IWR_DISABLE_ALL;
170 R2 = IWR_DISABLE_ALL;
173 call _set_dram_srfs; /* Set SDRAM Self Refresh */
175 /* Clear all the interrupts,bits sticky */
182 W[P0] = R0.l; /* Set Max VCO to SCLK divider */
187 R0.L = (CONFIG_MIN_VCO_HZ/CONFIG_CLKIN_HZ) << 9;
188 W[P0] = R0.l; /* Set Min CLKIN to VCO multiplier */
193 call _test_pll_locked;
203 R2 = DEPOSIT(R7, R1);
204 W[P0] = R2; /* Set Min Core Voltage */
209 call _test_pll_locked;
214 call _set_sic_iwr; /* Set Awake from IDLE */
220 W[P0] = R0.L; /* Turn CCLK OFF */
224 call _test_pll_locked;
227 R1 = IWR_DISABLE_ALL;
228 R2 = IWR_DISABLE_ALL;
230 call _set_sic_iwr; /* Set Awake from IDLE PLL */
239 call _test_pll_locked;
243 W[P0]= R6; /* Restore CCLK and SCLK divider */
247 w[p0] = R5; /* Restore VCO multiplier */
249 call _test_pll_locked;
251 call _unset_dram_srfs; /* SDRAM Self Refresh Off */
256 ( R7:0, P5:0 ) = [SP++];
259 ENTRY(_set_dram_srfs)
260 /* set the dram to self refresh mode */
261 #if defined(CONFIG_BF54x)
262 P0.H = hi(EBIU_RSTCTL);
263 P0.L = lo(EBIU_RSTCTL);
268 P0.H = hi(EBIU_SDGCTL);
269 P0.L = lo(EBIU_SDGCTL);
277 #if defined(CONFIG_BF54x)
281 if !CC JUMP .LSRR_MODE;
285 ENTRY(_unset_dram_srfs)
286 /* set the dram out of self refresh mode */
287 #if defined(CONFIG_BF54x)
288 P0.H = hi(EBIU_RSTCTL);
289 P0.L = lo(EBIU_RSTCTL);
294 P0.H = hi(EBIU_SDGCTL);
295 P0.L = lo(EBIU_SDGCTL);
307 #if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561)
313 #if defined(CONFIG_BF54x)
327 ENTRY(_set_rtc_istat)
329 P0.H = hi(RTC_ISTAT);
330 P0.L = lo(RTC_ISTAT);
336 ENTRY(_test_pll_locked)