blob: 2ef22900d7514af76033b78f07c85ebb5d816dea [file] [log] [blame]
Dirk Behmef904cdb2009-01-27 18:19:12 +01001/*
Tom Rini75c57a32011-11-18 12:48:08 +00002 * (C) Copyright 2004-2011
Dirk Behmef904cdb2009-01-27 18:19:12 +01003 * Texas Instruments, <www.ti.com>
4 *
5 * Author :
6 * Sunil Kumar <sunilsaini05@gmail.com>
7 * Shashi Ranjan <shashiranjanmca05@gmail.com>
8 *
9 * Derived from Beagle Board and 3430 SDP code by
10 * Richard Woodruff <r-woodruff2@ti.com>
11 * Syed Mohammed Khasim <khasim@ti.com>
12 *
13 *
14 * See file CREDITS for list of people who contributed to this
15 * project.
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License as
19 * published by the Free Software Foundation; either version 2 of
20 * the License, or (at your option) any later version.
21 *
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 * MA 02111-1307 USA
31 */
32#include <common.h>
Jason Kridner70d8c942011-04-18 17:23:35 -040033#ifdef CONFIG_STATUS_LED
34#include <status_led.h>
35#endif
Tom Rix2c155132009-06-28 12:52:30 -050036#include <twl4030.h>
Tom Rini75c57a32011-11-18 12:48:08 +000037#include <linux/mtd/nand.h>
Dirk Behmef904cdb2009-01-27 18:19:12 +010038#include <asm/io.h>
Steve Sakoman0cd31142010-09-19 21:19:48 -070039#include <asm/arch/mmc_host_def.h>
Dirk Behmef904cdb2009-01-27 18:19:12 +010040#include <asm/arch/mux.h>
Tom Rini75c57a32011-11-18 12:48:08 +000041#include <asm/arch/mem.h>
Dirk Behmef904cdb2009-01-27 18:19:12 +010042#include <asm/arch/sys_proto.h>
Sanjeev Premi84c3b632011-09-08 10:51:01 -040043#include <asm/gpio.h>
Dirk Behmef904cdb2009-01-27 18:19:12 +010044#include <asm/mach-types.h>
45#include "beagle.h"
Jason Kridnerf835ea72010-07-21 07:41:25 -050046#include <command.h>
Dirk Behmef904cdb2009-01-27 18:19:12 +010047
Govindraj.R43b62392012-02-06 03:55:34 +000048#ifdef CONFIG_USB_EHCI
49#include <usb.h>
50#include <asm/ehci-omap.h>
51#endif
52
Alexander Hollerd90859a2011-04-19 09:30:35 -040053#define pr_debug(fmt, args...) debug(fmt, ##args)
54
Koen Kooica5f80a2010-09-20 10:21:33 -070055#define TWL4030_I2C_BUS 0
56#define EXPANSION_EEPROM_I2C_BUS 1
57#define EXPANSION_EEPROM_I2C_ADDRESS 0x50
58
59#define TINCANTOOLS_ZIPPY 0x01000100
60#define TINCANTOOLS_ZIPPY2 0x02000100
61#define TINCANTOOLS_TRAINER 0x04000100
62#define TINCANTOOLS_SHOWDOG 0x03000100
63#define KBADC_BEAGLEFPGA 0x01000600
Koen Kooiee8485f2011-04-18 17:29:35 -040064#define LW_BEAGLETOUCH 0x01000700
65#define BRAINMUX_LCDOG 0x01000800
66#define BRAINMUX_LCDOGTOUCH 0x02000800
67#define BBTOYS_WIFI 0x01000B00
68#define BBTOYS_VGA 0x02000B00
69#define BBTOYS_LCD 0x03000B00
Peter Meerwald6cce5502012-01-03 04:14:35 +000070#define BCT_BRETTL3 0x01000F00
Peter Meerwaldef88e602012-06-28 05:38:35 +000071#define BCT_BRETTL4 0x02000F00
Koen Kooica5f80a2010-09-20 10:21:33 -070072#define BEAGLE_NO_EEPROM 0xffffffff
73
John Rigby29565322010-12-20 18:27:51 -070074DECLARE_GLOBAL_DATA_PTR;
75
Koen Kooica5f80a2010-09-20 10:21:33 -070076static struct {
77 unsigned int device_vendor;
78 unsigned char revision;
79 unsigned char content;
80 char fab_revision[8];
81 char env_var[16];
82 char env_setting[64];
83} expansion_config;
84
Tom Rix58911512009-04-01 22:02:20 -050085/*
Dirk Behmef904cdb2009-01-27 18:19:12 +010086 * Routine: board_init
87 * Description: Early hardware init.
Tom Rix58911512009-04-01 22:02:20 -050088 */
Dirk Behmef904cdb2009-01-27 18:19:12 +010089int board_init(void)
90{
Dirk Behmef904cdb2009-01-27 18:19:12 +010091 gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
92 /* board id for Linux */
93 gd->bd->bi_arch_number = MACH_TYPE_OMAP3_BEAGLE;
94 /* boot param addr */
95 gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
96
Jason Kridner70d8c942011-04-18 17:23:35 -040097#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
98 status_led_set (STATUS_LED_BOOT, STATUS_LED_ON);
99#endif
100
Dirk Behmef904cdb2009-01-27 18:19:12 +0100101 return 0;
102}
103
Tom Rix58911512009-04-01 22:02:20 -0500104/*
Steve Sakoman06b95bd2010-08-12 15:17:37 -0700105 * Routine: get_board_revision
106 * Description: Detect if we are running on a Beagle revision Ax/Bx,
Steve Sakoman08cbba2ab2010-08-19 20:56:11 -0700107 * C1/2/3, C4 or xM. This can be done by reading
Steve Sakoman06b95bd2010-08-12 15:17:37 -0700108 * the level of GPIO173, GPIO172 and GPIO171. This should
109 * result in
110 * GPIO173, GPIO172, GPIO171: 1 1 1 => Ax/Bx
111 * GPIO173, GPIO172, GPIO171: 1 1 0 => C1/2/3
112 * GPIO173, GPIO172, GPIO171: 1 0 1 => C4
Steve Sakoman08cbba2ab2010-08-19 20:56:11 -0700113 * GPIO173, GPIO172, GPIO171: 0 0 0 => xM
Tom Rix58911512009-04-01 22:02:20 -0500114 */
Steve Sakoman06b95bd2010-08-12 15:17:37 -0700115int get_board_revision(void)
Dirk Behmef956fd02009-02-12 18:55:41 +0100116{
Steve Sakoman06b95bd2010-08-12 15:17:37 -0700117 int revision;
Dirk Behmef956fd02009-02-12 18:55:41 +0100118
Sanjeev Premi84c3b632011-09-08 10:51:01 -0400119 if (!gpio_request(171, "") &&
120 !gpio_request(172, "") &&
121 !gpio_request(173, "")) {
Dirk Behmef956fd02009-02-12 18:55:41 +0100122
Sanjeev Premi84c3b632011-09-08 10:51:01 -0400123 gpio_direction_input(171);
124 gpio_direction_input(172);
125 gpio_direction_input(173);
Dirk Behmef956fd02009-02-12 18:55:41 +0100126
Sanjeev Premi84c3b632011-09-08 10:51:01 -0400127 revision = gpio_get_value(173) << 2 |
128 gpio_get_value(172) << 1 |
129 gpio_get_value(171);
Steve Sakoman06b95bd2010-08-12 15:17:37 -0700130 } else {
131 printf("Error: unable to acquire board revision GPIOs\n");
132 revision = -1;
Tom Rix718763c2009-06-03 01:53:57 -0500133 }
Dirk Behmef956fd02009-02-12 18:55:41 +0100134
Steve Sakoman06b95bd2010-08-12 15:17:37 -0700135 return revision;
Dirk Behmef956fd02009-02-12 18:55:41 +0100136}
137
Tom Rini75c57a32011-11-18 12:48:08 +0000138#ifdef CONFIG_SPL_BUILD
139/*
140 * Routine: get_board_mem_timings
141 * Description: If we use SPL then there is no x-loader nor config header
142 * so we have to setup the DDR timings ourself on both banks.
143 */
144void get_board_mem_timings(u32 *mcfg, u32 *ctrla, u32 *ctrlb, u32 *rfr_ctrl,
145 u32 *mr)
146{
147 int pop_mfr, pop_id;
148
149 /*
150 * We need to identify what PoP memory is on the board so that
151 * we know what timings to use. If we can't identify it then
152 * we know it's an xM. To map the ID values please see nand_ids.c
153 */
154 identify_nand_chip(&pop_mfr, &pop_id);
155
156 *mr = MICRON_V_MR_165;
157 switch (get_board_revision()) {
158 case REVISION_C4:
159 if (pop_mfr == NAND_MFR_STMICRO && pop_id == 0xba) {
160 /* 512MB DDR */
161 *mcfg = NUMONYX_V_MCFG_165(512 << 20);
162 *ctrla = NUMONYX_V_ACTIMA_165;
163 *ctrlb = NUMONYX_V_ACTIMB_165;
164 *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
165 break;
robertcnelson@gmail.com223b8aa2012-01-27 07:09:42 +0000166 } else if (pop_mfr == NAND_MFR_MICRON && pop_id == 0xba) {
167 /* Beagleboard Rev C4, 512MB Nand/256MB DDR*/
168 *mcfg = MICRON_V_MCFG_165(128 << 20);
169 *ctrla = MICRON_V_ACTIMA_165;
170 *ctrlb = MICRON_V_ACTIMB_165;
171 *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
172 break;
Tom Rini75c57a32011-11-18 12:48:08 +0000173 } else if (pop_mfr == NAND_MFR_MICRON && pop_id == 0xbc) {
174 /* Beagleboard Rev C5, 256MB DDR */
175 *mcfg = MICRON_V_MCFG_200(256 << 20);
176 *ctrla = MICRON_V_ACTIMA_200;
177 *ctrlb = MICRON_V_ACTIMB_200;
178 *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
179 break;
180 }
181 case REVISION_XM_A:
182 case REVISION_XM_B:
183 case REVISION_XM_C:
184 if (pop_mfr == 0) {
185 /* 256MB DDR */
186 *mcfg = MICRON_V_MCFG_200(256 << 20);
187 *ctrla = MICRON_V_ACTIMA_200;
188 *ctrlb = MICRON_V_ACTIMB_200;
189 *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
190 } else {
191 /* 512MB DDR */
192 *mcfg = NUMONYX_V_MCFG_165(512 << 20);
193 *ctrla = NUMONYX_V_ACTIMA_165;
194 *ctrlb = NUMONYX_V_ACTIMB_165;
195 *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
196 }
197 break;
198 default:
199 /* Assume 128MB and Micron/165MHz timings to be safe */
200 *mcfg = MICRON_V_MCFG_165(128 << 20);
201 *ctrla = MICRON_V_ACTIMA_165;
202 *ctrlb = MICRON_V_ACTIMB_165;
203 *rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
204 }
205}
206#endif
207
Tom Rix58911512009-04-01 22:02:20 -0500208/*
Koen Kooica5f80a2010-09-20 10:21:33 -0700209 * Routine: get_expansion_id
210 * Description: This function checks for expansion board by checking I2C
211 * bus 1 for the availability of an AT24C01B serial EEPROM.
212 * returns the device_vendor field from the EEPROM
213 */
214unsigned int get_expansion_id(void)
215{
216 i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS);
217
218 /* return BEAGLE_NO_EEPROM if eeprom doesn't respond */
219 if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) {
220 i2c_set_bus_num(TWL4030_I2C_BUS);
221 return BEAGLE_NO_EEPROM;
222 }
223
224 /* read configuration data */
225 i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config,
226 sizeof(expansion_config));
227
228 i2c_set_bus_num(TWL4030_I2C_BUS);
229
230 return expansion_config.device_vendor;
231}
232
233/*
Jason Kridner3f16ab92011-04-19 14:01:13 -0500234 * Configure DSS to display background color on DVID
235 * Configure VENC to display color bar on S-Video
236 */
237void beagle_display_init(void)
238{
239 omap3_dss_venc_config(&venc_config_std_tv, VENC_HEIGHT, VENC_WIDTH);
240 switch (get_board_revision()) {
241 case REVISION_AXBX:
242 case REVISION_CX:
243 case REVISION_C4:
244 omap3_dss_panel_config(&dvid_cfg);
245 break;
246 case REVISION_XM_A:
247 case REVISION_XM_B:
248 case REVISION_XM_C:
249 default:
250 omap3_dss_panel_config(&dvid_cfg_xm);
251 break;
252 }
253}
254
255/*
Peter Meerwald4258aa62012-02-08 05:24:26 +0000256 * Enable DVI power
257 */
Anatolij Gustschin3fbc6932012-03-27 23:05:07 +0000258static void beagle_dvi_pup(void)
259{
Peter Meerwald4258aa62012-02-08 05:24:26 +0000260 uchar val;
261
262 switch (get_board_revision()) {
263 case REVISION_AXBX:
264 case REVISION_CX:
265 case REVISION_C4:
266 case REVISION_XM_A:
267 gpio_request(170, "");
268 gpio_direction_output(170, 0);
269 gpio_set_value(170, 1);
270 break;
271 case REVISION_XM_B:
272 case REVISION_XM_C:
273 default:
274 #define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3)
275 #define GPIODATAOUT1 (TWL4030_BASEADD_GPIO+6)
276
277 i2c_read(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1);
278 val |= 4;
279 i2c_write(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1);
280
281 i2c_read(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1);
282 val |= 4;
283 i2c_write(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1);
284 break;
285 }
286}
287
288/*
Dirk Behmef904cdb2009-01-27 18:19:12 +0100289 * Routine: misc_init_r
290 * Description: Configure board specific parts
Tom Rix58911512009-04-01 22:02:20 -0500291 */
Dirk Behmef904cdb2009-01-27 18:19:12 +0100292int misc_init_r(void)
293{
Dirk Behme97a099e2009-08-08 09:30:21 +0200294 struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;
295 struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
Jason Kridnerf14a5222011-04-20 13:52:26 +0000296 struct control_prog_io *prog_io_base = (struct control_prog_io *)OMAP34XX_CTRL_BASE;
Steve Kipiszd4e53f02011-04-18 17:27:00 -0400297
298 /* Enable i2c2 pullup resisters */
299 writel(~(PRG_I2C2_PULLUPRESX), &prog_io_base->io1);
Dirk Behmef904cdb2009-01-27 18:19:12 +0100300
Steve Sakoman06b95bd2010-08-12 15:17:37 -0700301 switch (get_board_revision()) {
302 case REVISION_AXBX:
303 printf("Beagle Rev Ax/Bx\n");
304 setenv("beaglerev", "AxBx");
Steve Sakoman06b95bd2010-08-12 15:17:37 -0700305 break;
306 case REVISION_CX:
307 printf("Beagle Rev C1/C2/C3\n");
308 setenv("beaglerev", "Cx");
Steve Sakoman06b95bd2010-08-12 15:17:37 -0700309 MUX_BEAGLE_C();
310 break;
311 case REVISION_C4:
312 printf("Beagle Rev C4\n");
Steve Sakoman08cbba2ab2010-08-19 20:56:11 -0700313 setenv("beaglerev", "C4");
Steve Sakoman06b95bd2010-08-12 15:17:37 -0700314 MUX_BEAGLE_C();
315 /* Set VAUX2 to 1.8V for EHCI PHY */
316 twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
317 TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
318 TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
319 TWL4030_PM_RECEIVER_DEV_GRP_P1);
320 break;
Koen Kooif6e593b2011-04-18 17:28:32 -0400321 case REVISION_XM_A:
Steve Sakoman08cbba2ab2010-08-19 20:56:11 -0700322 printf("Beagle xM Rev A\n");
323 setenv("beaglerev", "xMA");
Koen Kooif6e593b2011-04-18 17:28:32 -0400324 MUX_BEAGLE_XM();
325 /* Set VAUX2 to 1.8V for EHCI PHY */
326 twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
327 TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
328 TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
329 TWL4030_PM_RECEIVER_DEV_GRP_P1);
330 break;
331 case REVISION_XM_B:
332 printf("Beagle xM Rev B\n");
333 setenv("beaglerev", "xMB");
Steve Sakoman08cbba2ab2010-08-19 20:56:11 -0700334 MUX_BEAGLE_XM();
335 /* Set VAUX2 to 1.8V for EHCI PHY */
336 twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
337 TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
338 TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
339 TWL4030_PM_RECEIVER_DEV_GRP_P1);
340 break;
Koen Kooi1ffcb342011-06-17 09:37:37 +0200341 case REVISION_XM_C:
342 printf("Beagle xM Rev C\n");
343 setenv("beaglerev", "xMC");
344 MUX_BEAGLE_XM();
345 /* Set VAUX2 to 1.8V for EHCI PHY */
346 twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
347 TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
348 TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
349 TWL4030_PM_RECEIVER_DEV_GRP_P1);
350 break;
Steve Sakoman06b95bd2010-08-12 15:17:37 -0700351 default:
352 printf("Beagle unknown 0x%02x\n", get_board_revision());
Koen Kooif6e593b2011-04-18 17:28:32 -0400353 MUX_BEAGLE_XM();
354 /* Set VAUX2 to 1.8V for EHCI PHY */
355 twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
356 TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
357 TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
358 TWL4030_PM_RECEIVER_DEV_GRP_P1);
Steve Sakoman06b95bd2010-08-12 15:17:37 -0700359 }
360
Koen Kooica5f80a2010-09-20 10:21:33 -0700361 switch (get_expansion_id()) {
362 case TINCANTOOLS_ZIPPY:
363 printf("Recognized Tincantools Zippy board (rev %d %s)\n",
364 expansion_config.revision,
365 expansion_config.fab_revision);
366 MUX_TINCANTOOLS_ZIPPY();
367 setenv("buddy", "zippy");
368 break;
369 case TINCANTOOLS_ZIPPY2:
370 printf("Recognized Tincantools Zippy2 board (rev %d %s)\n",
371 expansion_config.revision,
372 expansion_config.fab_revision);
373 MUX_TINCANTOOLS_ZIPPY();
374 setenv("buddy", "zippy2");
375 break;
376 case TINCANTOOLS_TRAINER:
377 printf("Recognized Tincantools Trainer board (rev %d %s)\n",
378 expansion_config.revision,
379 expansion_config.fab_revision);
380 MUX_TINCANTOOLS_ZIPPY();
381 MUX_TINCANTOOLS_TRAINER();
382 setenv("buddy", "trainer");
383 break;
384 case TINCANTOOLS_SHOWDOG:
385 printf("Recognized Tincantools Showdow board (rev %d %s)\n",
386 expansion_config.revision,
387 expansion_config.fab_revision);
388 /* Place holder for DSS2 definition for showdog lcd */
389 setenv("defaultdisplay", "showdoglcd");
390 setenv("buddy", "showdog");
391 break;
392 case KBADC_BEAGLEFPGA:
393 printf("Recognized KBADC Beagle FPGA board\n");
394 MUX_KBADC_BEAGLEFPGA();
395 setenv("buddy", "beaglefpga");
396 break;
Koen Kooiee8485f2011-04-18 17:29:35 -0400397 case LW_BEAGLETOUCH:
398 printf("Recognized Liquidware BeagleTouch board\n");
399 setenv("buddy", "beagletouch");
400 break;
401 case BRAINMUX_LCDOG:
402 printf("Recognized Brainmux LCDog board\n");
403 setenv("buddy", "lcdog");
404 break;
405 case BRAINMUX_LCDOGTOUCH:
406 printf("Recognized Brainmux LCDog Touch board\n");
407 setenv("buddy", "lcdogtouch");
408 break;
409 case BBTOYS_WIFI:
410 printf("Recognized BeagleBoardToys WiFi board\n");
411 MUX_BBTOYS_WIFI()
412 setenv("buddy", "bbtoys-wifi");
413 break;;
414 case BBTOYS_VGA:
415 printf("Recognized BeagleBoardToys VGA board\n");
416 break;;
417 case BBTOYS_LCD:
418 printf("Recognized BeagleBoardToys LCD board\n");
419 break;;
Peter Meerwald6cce5502012-01-03 04:14:35 +0000420 case BCT_BRETTL3:
Peter Meerwaldef88e602012-06-28 05:38:35 +0000421 printf("Recognized bct electronic GmbH brettl3 board\n");
422 break;
423 case BCT_BRETTL4:
424 printf("Recognized bct electronic GmbH brettl4 board\n");
425 break;
Koen Kooica5f80a2010-09-20 10:21:33 -0700426 case BEAGLE_NO_EEPROM:
427 printf("No EEPROM on expansion board\n");
428 setenv("buddy", "none");
429 break;
430 default:
431 printf("Unrecognized expansion board: %x\n",
432 expansion_config.device_vendor);
433 setenv("buddy", "unknown");
434 }
435
436 if (expansion_config.content == 1)
437 setenv(expansion_config.env_var, expansion_config.env_setting);
438
Tom Rix2c155132009-06-28 12:52:30 -0500439 twl4030_power_init();
Christian Spielberger38a77c32011-08-24 17:17:31 -0500440 switch (get_board_revision()) {
441 case REVISION_XM_A:
442 case REVISION_XM_B:
443 twl4030_led_init(TWL4030_LED_LEDEN_LEDBON);
444 break;
445 default:
446 twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
447 break;
448 }
Dirk Behmef904cdb2009-01-27 18:19:12 +0100449
Bob Feretich52d82e42011-02-24 13:16:44 +0000450 /* Set GPIO states before they are made outputs */
Dirk Behmef904cdb2009-01-27 18:19:12 +0100451 writel(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1,
452 &gpio6_base->setdataout);
453 writel(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |
454 GPIO15 | GPIO14 | GPIO13 | GPIO12, &gpio5_base->setdataout);
455
Bob Feretich52d82e42011-02-24 13:16:44 +0000456 /* Configure GPIOs to output */
457 writel(~(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1), &gpio6_base->oe);
458 writel(~(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |
459 GPIO15 | GPIO14 | GPIO13 | GPIO12), &gpio5_base->oe);
460
Dirk Behmee6a6a702009-03-12 19:30:50 +0100461 dieid_num_r();
Peter Meerwald4258aa62012-02-08 05:24:26 +0000462
463 beagle_dvi_pup();
Jason Kridner3f16ab92011-04-19 14:01:13 -0500464 beagle_display_init();
465 omap3_dss_enable();
Dirk Behmee6a6a702009-03-12 19:30:50 +0100466
Dirk Behmef904cdb2009-01-27 18:19:12 +0100467 return 0;
468}
469
Tom Rix58911512009-04-01 22:02:20 -0500470/*
Dirk Behmef904cdb2009-01-27 18:19:12 +0100471 * Routine: set_muxconf_regs
472 * Description: Setting up the configuration Mux registers specific to the
473 * hardware. Many pins need to be moved from protect to primary
474 * mode.
Tom Rix58911512009-04-01 22:02:20 -0500475 */
Dirk Behmef904cdb2009-01-27 18:19:12 +0100476void set_muxconf_regs(void)
477{
478 MUX_BEAGLE();
Dirk Behmef904cdb2009-01-27 18:19:12 +0100479}
Steve Sakoman0cd31142010-09-19 21:19:48 -0700480
Tom Rini75c57a32011-11-18 12:48:08 +0000481#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
Steve Sakoman0cd31142010-09-19 21:19:48 -0700482int board_mmc_init(bd_t *bis)
483{
Jonathan Solnitbbbc1ae2012-02-24 11:30:18 +0000484 omap_mmc_init(0, 0, 0);
Steve Sakoman0cd31142010-09-19 21:19:48 -0700485 return 0;
486}
487#endif
Alexander Hollerd90859a2011-04-19 09:30:35 -0400488
489#ifdef CONFIG_USB_EHCI
Alexander Hollerd90859a2011-04-19 09:30:35 -0400490/* Call usb_stop() before starting the kernel */
491void show_boot_progress(int val)
492{
Simon Glass578ac1e2011-12-10 11:07:54 +0000493 if (val == BOOTSTAGE_ID_RUN_OS)
Alexander Hollerd90859a2011-04-19 09:30:35 -0400494 usb_stop();
495}
Govindraj.R43b62392012-02-06 03:55:34 +0000496
497static struct omap_usbhs_board_data usbhs_bdata = {
498 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
499 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
500 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
501};
502
503int ehci_hcd_init(void)
504{
505 return omap_ehci_hcd_init(&usbhs_bdata);
506}
507
508int ehci_hcd_stop(void)
509{
510 return omap_ehci_hcd_stop();
511}
512
Alexander Hollerd90859a2011-04-19 09:30:35 -0400513#endif /* CONFIG_USB_EHCI */