2 * Copyright 2004-2008 Analog Devices Inc.
4 * Licensed under the GPL-2 or later.
7 #include <linux/linkage.h>
8 #include <asm/blackfin.h>
9 #include <asm/mach/irq.h>
15 [--SP] = ( R7:0, P5:0 );
34 call _test_pll_locked;
49 call _test_pll_locked;
52 ( R7:0, P5:0 ) = [SP++];
55 ENTRY(_hibernate_mode)
56 [--SP] = ( R7:0, P5:0 );
76 /* Actually, adding anything may not be necessary...SDRAM contents
81 [--SP] = ( R7:0, P5:0 );
94 /* Clear all the interrupts,bits sticky */
104 call _test_pll_locked;
109 call _unset_dram_srfs;
111 call _test_pll_locked;
114 R1 = IWR_DISABLE_ALL;
115 R2 = IWR_DISABLE_ALL;
127 call _test_pll_locked;
132 ( R7:0, P5:0 ) = [SP++];
136 [--SP] = ( R7:0, P5:0 );
146 R1 = IWR_DISABLE_ALL;
147 R2 = IWR_DISABLE_ALL;
150 call _set_dram_srfs; /* Set SDRAM Self Refresh */
152 /* Clear all the interrupts,bits sticky */
159 W[P0] = R0.l; /* Set Max VCO to SCLK divider */
164 R0.L = (CONFIG_MIN_VCO_HZ/CONFIG_CLKIN_HZ) << 9;
165 W[P0] = R0.l; /* Set Min CLKIN to VCO multiplier */
170 call _test_pll_locked;
180 R2 = DEPOSIT(R7, R1);
181 W[P0] = R2; /* Set Min Core Voltage */
186 call _test_pll_locked;
191 call _set_sic_iwr; /* Set Awake from IDLE */
197 W[P0] = R0.L; /* Turn CCLK OFF */
201 call _test_pll_locked;
204 R1 = IWR_DISABLE_ALL;
205 R2 = IWR_DISABLE_ALL;
207 call _set_sic_iwr; /* Set Awake from IDLE PLL */
216 call _test_pll_locked;
220 W[P0]= R6; /* Restore CCLK and SCLK divider */
224 w[p0] = R5; /* Restore VCO multiplier */
226 call _test_pll_locked;
228 call _unset_dram_srfs; /* SDRAM Self Refresh Off */
233 ( R7:0, P5:0 ) = [SP++];
236 ENTRY(_set_dram_srfs)
237 /* set the dram to self refresh mode */
238 #if defined(CONFIG_BF54x)
239 P0.H = hi(EBIU_RSTCTL);
240 P0.L = lo(EBIU_RSTCTL);
245 P0.H = hi(EBIU_SDGCTL);
246 P0.L = lo(EBIU_SDGCTL);
254 #if defined(CONFIG_BF54x)
258 if !CC JUMP .LSRR_MODE;
262 ENTRY(_unset_dram_srfs)
263 /* set the dram out of 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);
284 #if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561)
290 #if defined(CONFIG_BF54x)
304 ENTRY(_set_rtc_istat)
306 P0.H = hi(RTC_ISTAT);
307 P0.L = lo(RTC_ISTAT);
313 ENTRY(_test_pll_locked)