3 * Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * platform specific initializations are already done in Xloader
28 * Initializations already done include
29 * DDR, PLLs, IP's clock enable and reset release etc
33 /* By default, U-Boot switches CPU to low-vector */
34 /* Revert this as we work in high vector even in U-Boot */
35 mrc p15, 0, r0, c1, c0, 0
36 orr r0, r0, #0x00002000
37 mcr p15, 0, r0, c1, c0, 0
40 /* void setfreq(unsigned int device, unsigned int frequency) */
49 /* Saving the function arguements for later use */
53 /* Putting DDR into self refresh */
63 ldr r2,REFRESH_CYCLES_V
64 orr r1, r1, r2, lsl #16
68 ldr r2,SREFRESH_MASK_V
76 /* Delay to ensure self refresh mode */
77 ldr r0,SREFRESH_DELAY_V
83 /* Putting system in slow mode */
88 /* Changing PLL(1/2) frequency */
95 /* Change PLL2 (DDR frequency) */
101 /* Change PLL1 (CPU frequency) */
108 ldr r2,PLLFREQ_MASK_V
130 /* Putting system back to normal mode */
135 /* Putting DDR back to normal */
138 ldr r2,SREFRESH_MASK_V
145 /* Delay to ensure self refresh mode */
146 ldr r0,SREFRESH_DELAY_V
153 /* Resuming back to code */
195 .word setfreq_sz - setfreq