3 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4 * Marius Groeger <mgroeger@sysgo.de>
7 * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
10 * Texas Instruments, <www.ti.com>
11 * Kshitij Gupta <Kshitij@ti.com>
13 * See file CREDITS for list of people who contributed to this
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
33 #if defined(CONFIG_OMAP1610)
34 #include <./configs/omap1510.h>
37 void flash__init (void);
38 void ether__init (void);
39 void set_muxconf_regs (void);
40 void peripheral_power_enable (void);
42 #define COMP_MODE_ENABLE ((unsigned int)0x0000EAEF)
44 static inline void delay (unsigned long loops)
46 __asm__ volatile ("1:\n"
48 "bne 1b":"=r" (loops):"0" (loops));
52 * Miscellaneous platform dependent initialisations
57 DECLARE_GLOBAL_DATA_PTR;
59 /* arch number of OMAP 1510-Board */
60 /* to be changed for OMAP 1610 Board */
61 gd->bd->bi_arch_number = 234;
63 /* adress of boot parameters */
64 gd->bd->bi_boot_params = 0x10000100;
66 /* Configure MUX settings */
68 peripheral_power_enable ();
70 /* this speeds up your boot a quite a bit. However to make it
71 * work, you need make sure your kernel startup flush bug is fixed.
82 int misc_init_r (void)
88 /******************************
91 ******************************/
92 void flash__init (void)
94 #define EMIFS_GlB_Config_REG 0xfffecc0c
96 regval = *((volatile unsigned int *) EMIFS_GlB_Config_REG);
97 /* Turn off write protection for flash devices. */
98 regval = regval | 0x0001;
99 *((volatile unsigned int *) EMIFS_GlB_Config_REG) = regval;
101 /*************************************************************
103 Description: take the Ethernet controller out of reset and wait
104 for the EEPROM load to complete.
105 *************************************************************/
106 void ether__init (void)
108 #define ETH_CONTROL_REG 0x0400000b
110 *((volatile unsigned char *) ETH_CONTROL_REG) &= ~0x01;
114 /******************************
117 ******************************/
120 DECLARE_GLOBAL_DATA_PTR;
122 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
123 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
128 /******************************************************
129 Routine: set_muxconf_regs
130 Description: Setting up the configuration Mux registers
131 specific to the hardware
132 *******************************************************/
133 void set_muxconf_regs (void)
135 volatile unsigned int *MuxConfReg;
136 /* set each registers to its reset value; */
138 (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_0);
139 /* setup for UART1 */
140 *MuxConfReg &= ~(0x02000000); /* bit 25 */
141 /* setup for UART2 */
142 *MuxConfReg &= ~(0x01000000); /* bit 24 */
143 /* Disable Uwire CS Hi-Z */
144 *MuxConfReg |= 0x08000000;
146 (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_3);
147 *MuxConfReg = 0x00000000;
149 (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_4);
150 *MuxConfReg = 0x00000000;
152 (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_5);
153 *MuxConfReg = 0x00000000;
155 (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_6);
156 /*setup mux for UART3 */
157 *MuxConfReg |= 0x00000001; /* bit3, 1, 0 (mux0 5,5,26) */
158 *MuxConfReg &= ~0x0000003e;
160 (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_7);
161 *MuxConfReg = 0x00000000;
163 (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_8);
164 /* Disable Uwire CS Hi-Z */
165 *MuxConfReg |= 0x00001200; /*bit 9 for CS0 12 for CS3 */
167 (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_9);
168 /* Need to turn on bits 21 and 12 in FUNC_MUX_CTRL_9 so the */
169 /* hardware will actually use TX and RTS based on bit 25 in */
170 /* FUNC_MUX_CTRL_0. I told you this thing was screwy! */
171 *MuxConfReg |= 0x00201000;
173 (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_A);
174 *MuxConfReg = 0x00000000;
176 (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_B);
177 *MuxConfReg = 0x00000000;
179 (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_C);
180 /* setup for UART2 */
181 /* Need to turn on bits 27 and 24 in FUNC_MUX_CTRL_C so the */
182 /* hardware will actually use TX and RTS based on bit 24 in */
183 /* FUNC_MUX_CTRL_0. */
184 *MuxConfReg |= 0x09000000;
186 (volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_0);
187 *MuxConfReg = 0x00000000;
189 (volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_1);
190 *MuxConfReg = 0x00000000;
191 /* mux setup for SD/MMC driver */
193 (volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_2);
194 *MuxConfReg &= 0xFFFE0FFF;
196 (volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_3);
197 *MuxConfReg = 0x00000000;
199 (volatile unsigned int *) ((unsigned int) MOD_CONF_CTRL_0);
200 /* bit 13 for MMC2 XOR_CLK */
201 *MuxConfReg &= ~(0x00002000);
202 /* bit 29 for UART 1 */
203 *MuxConfReg &= ~(0x00002000);
205 (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_0);
206 /* Configure for USB. Turn on VBUS_CTRL and VBUS_MODE. */
207 *MuxConfReg |= 0x000C0000;
209 (volatile unsigned int *) ((unsigned int)USB_TRANSCEIVER_CTRL);
210 *MuxConfReg &= ~(0x00000070);
211 *MuxConfReg &= ~(0x00000008);
212 *MuxConfReg |= 0x00000003;
213 *MuxConfReg |= 0x00000180;
215 (volatile unsigned int *) ((unsigned int) MOD_CONF_CTRL_0);
216 /* bit 17, software controls VBUS */
217 *MuxConfReg &= ~(0x00020000);
218 /* Enable USB 48 and 12M clocks */
219 *MuxConfReg |= 0x00000200;
220 *MuxConfReg &= ~(0x00000180);
221 /*2.75V for MMCSDIO1 */
223 (volatile unsigned int *) ((unsigned int) VOLTAGE_CTRL_0);
224 *MuxConfReg = 0x00001FE7;
226 (volatile unsigned int *) ((unsigned int) PU_PD_SEL_0);
227 *MuxConfReg = 0x00000000;
229 (volatile unsigned int *) ((unsigned int) PU_PD_SEL_1);
230 *MuxConfReg = 0x00000000;
232 (volatile unsigned int *) ((unsigned int) PU_PD_SEL_2);
233 *MuxConfReg = 0x00000000;
235 (volatile unsigned int *) ((unsigned int) PU_PD_SEL_3);
236 *MuxConfReg = 0x00000000;
238 (volatile unsigned int *) ((unsigned int) PU_PD_SEL_4);
239 *MuxConfReg = 0x00000000;
241 (volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_4);
242 *MuxConfReg = 0x00000000;
243 /* Turn on UART2 48 MHZ clock */
245 (volatile unsigned int *) ((unsigned int) MOD_CONF_CTRL_0);
246 *MuxConfReg |= 0x40000000;
248 (volatile unsigned int *) ((unsigned int) USB_OTG_CTRL);
249 /* setup for USB VBus detection OMAP161x */
250 *MuxConfReg |= 0x00040000; /* bit 18 */
252 (volatile unsigned int *) ((unsigned int) PU_PD_SEL_2);
253 /* PullUps for SD/MMC driver */
254 *MuxConfReg |= ~(0xFFFE0FFF);
256 (volatile unsigned int *) ((unsigned int)COMP_MODE_CTRL_0);
257 *MuxConfReg = COMP_MODE_ENABLE;
260 /******************************************************
261 Routine: peripheral_power_enable
262 Description: Enable the power for UART1
263 *******************************************************/
264 void peripheral_power_enable (void)
266 #define UART1_48MHZ_ENABLE ((unsigned short)0x0200)
267 #define SW_CLOCK_REQUEST ((volatile unsigned short *)0xFFFE0834)
269 *SW_CLOCK_REQUEST |= UART1_48MHZ_ENABLE;