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>
36 #if !defined(CONFIG_BF561)
41 [--SP] = ( R7:0, P5:0 );
60 call _test_pll_locked;
75 call _test_pll_locked;
78 ( R7:0, P5:0 ) = [SP++];
81 ENTRY(_hibernate_mode)
82 [--SP] = ( R7:0, P5:0 );
102 /* Actually, adding anything may not be necessary...SDRAM contents
107 [--SP] = ( R7:0, P5:0 );
113 R1 = IWR_DISABLE_ALL;
114 R2 = IWR_DISABLE_ALL;
120 /* Clear all the interrupts,bits sticky */
130 call _test_pll_locked;
135 call _unset_dram_srfs;
137 call _test_pll_locked;
140 R1 = IWR_DISABLE_ALL;
141 R2 = IWR_DISABLE_ALL;
153 call _test_pll_locked;
158 ( R7:0, P5:0 ) = [SP++];
162 [--SP] = ( R7:0, P5:0 );
172 R1 = IWR_DISABLE_ALL;
173 R2 = IWR_DISABLE_ALL;
176 call _set_dram_srfs; /* Set SDRAM Self Refresh */
178 /* Clear all the interrupts,bits sticky */
185 W[P0] = R0.l; /* Set Max VCO to SCLK divider */
190 R0.L = (CONFIG_MIN_VCO_HZ/CONFIG_CLKIN_HZ) << 9;
191 W[P0] = R0.l; /* Set Min CLKIN to VCO multiplier */
196 call _test_pll_locked;
206 R2 = DEPOSIT(R7, R1);
207 W[P0] = R2; /* Set Min Core Voltage */
212 call _test_pll_locked;
217 call _set_sic_iwr; /* Set Awake from IDLE */
223 W[P0] = R0.L; /* Turn CCLK OFF */
227 call _test_pll_locked;
230 R1 = IWR_DISABLE_ALL;
231 R2 = IWR_DISABLE_ALL;
233 call _set_sic_iwr; /* Set Awake from IDLE PLL */
242 call _test_pll_locked;
246 W[P0]= R6; /* Restore CCLK and SCLK divider */
250 w[p0] = R5; /* Restore VCO multiplier */
252 call _test_pll_locked;
254 call _unset_dram_srfs; /* SDRAM Self Refresh Off */
259 ( R7:0, P5:0 ) = [SP++];
262 ENTRY(_set_dram_srfs)
263 /* set the dram to self refresh mode */
264 #if defined(CONFIG_BF54x)
265 P0.H = hi(EBIU_RSTCTL);
266 P0.L = lo(EBIU_RSTCTL);
271 P0.H = hi(EBIU_SDGCTL);
272 P0.L = lo(EBIU_SDGCTL);
280 #if defined(CONFIG_BF54x)
284 if !CC JUMP .LSRR_MODE;
288 ENTRY(_unset_dram_srfs)
289 /* set the dram out of self refresh mode */
290 #if defined(CONFIG_BF54x)
291 P0.H = hi(EBIU_RSTCTL);
292 P0.L = lo(EBIU_RSTCTL);
297 P0.H = hi(EBIU_SDGCTL);
298 P0.L = lo(EBIU_SDGCTL);
310 #if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561)
316 #if defined(CONFIG_BF54x)
330 ENTRY(_set_rtc_istat)
331 P0.H = hi(RTC_ISTAT);
332 P0.L = lo(RTC_ISTAT);
337 ENTRY(_test_pll_locked)