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 ENTRY(_unmask_wdog_wakeup_evt)
37 [--SP] = ( R7:0, P5:0 );
38 #if defined(CONFIG_BF561)
46 #if defined(CONFIG_BF561)
49 BITSET(R7,(IRQ_WATCH - IVG7));
54 ( R7:0, P5:0 ) = [SP++];
58 /* When watch dog timer is enabled, a write to STAT will load the
59 * contents of CNT to STAT
62 #if defined(CONFIG_BF561)
63 P0.h = HI(WDOGA_STAT);
64 P0.l = LO(WDOGA_STAT);
71 JUMP .LSKIP_WRITE_TO_STAT;
73 ENTRY(_program_wdog_timer)
74 [--SP] = ( R7:0, P5:0 );
75 #if defined(CONFIG_BF561)
85 #if defined(CONFIG_BF561)
94 if !CC JUMP .LWRITE_TO_STAT;
96 if !CC JUMP .LWRITE_TO_STAT;
99 #if defined(CONFIG_BF561)
100 P0.h = HI(WDOGA_CTL);
101 P0.l = LO(WDOGA_CTL);
107 BITCLR(R7,1); /* Enable GP event */
114 BITCLR(R7,4); /* Enable the wdog counter */
118 ( R7:0, P5:0 ) = [SP++];
121 ENTRY(_clear_wdog_wakeup_evt)
122 [--SP] = ( R7:0, P5:0 );
124 #if defined(CONFIG_BF561)
125 P0.h = HI(WDOGA_CTL);
126 P0.l = LO(WDOGA_CTL);
146 ( R7:0, P5:0 ) = [SP++];
149 ENTRY(_disable_wdog_timer)
150 [--SP] = ( R7:0, P5:0 );
151 #if defined(CONFIG_BF561)
152 P0.h = HI(WDOGA_CTL);
153 P0.l = LO(WDOGA_CTL);
161 ( R7:0, P5:0 ) = [SP++];
164 #if !defined(CONFIG_BF561)
169 [--SP] = ( R7:0, P5:0 );
188 call _test_pll_locked;
200 call _test_pll_locked;
203 ( R7:0, P5:0 ) = [SP++];
206 ENTRY(_hibernate_mode)
207 [--SP] = ( R7:0, P5:0 );
227 /* Actually, adding anything may not be necessary...SDRAM contents
232 [--SP] = ( R7:0, P5:0 );
239 call _set_sdram_srfs;
241 /* Clear all the interrupts,bits sticky */
251 call _test_pll_locked;
256 call _unset_sdram_srfs;
258 call _test_pll_locked;
271 call _test_pll_locked;
276 ( R7:0, P5:0 ) = [SP++];
280 [--SP] = ( R7:0, P5:0 );
288 call _set_sdram_srfs;
290 /* Clear all the interrupts,bits sticky */
303 R0.L = (CONFIG_MIN_VCO_HZ/CONFIG_CLKIN_HZ) << 9;
309 call _test_pll_locked;
319 R2 = DEPOSIT(R7, R1);
325 call _test_pll_locked;
339 call _test_pll_locked;
351 call _test_pll_locked;
361 call _test_pll_locked;
363 call _unset_sdram_srfs;
368 ( R7:0, P5:0 ) = [SP++];
371 ENTRY(_set_sdram_srfs)
372 /* set the sdram to self refresh mode */
373 P0.H = hi(EBIU_SDGCTL);
374 P0.L = lo(EBIU_SDGCTL);
383 ENTRY(_unset_sdram_srfs)
384 /* set the sdram out of self refresh mode */
385 P0.H = hi(EBIU_SDGCTL);
386 P0.L = lo(EBIU_SDGCTL);
403 ENTRY(_set_rtc_istat)
404 P0.H = hi(RTC_ISTAT);
405 P0.L = lo(RTC_ISTAT);
410 ENTRY(_test_pll_locked)