2 * Copyright (c) 2009 Wind River Systems, Inc.
3 * Tom Rix <Tom.Rix@windriver.com>
5 * Derived from Zoom1 code by
6 * Nishanth Menon <nm@ti.com>
7 * Sunil Kumar <sunilsaini05@gmail.com>
8 * Shashi Ranjan <shashiranjanmca05@gmail.com>
9 * Richard Woodruff <r-woodruff2@ti.com>
10 * Syed Mohammed Khasim <khasim@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 #ifdef CONFIG_STATUS_LED
34 #include <status_led.h>
38 #include <asm/arch/mmc_host_def.h>
40 #include <asm/arch/mem.h>
41 #include <asm/arch/mux.h>
42 #include <asm/arch/sys_proto.h>
43 #include <asm/mach-types.h>
45 #include "zoom2_serial.h"
47 DECLARE_GLOBAL_DATA_PTR;
50 * This the the zoom2, board specific, gpmc configuration for the
51 * quad uart on the debug board. The more general gpmc configurations
52 * are setup at the cpu level in arch/arm/cpu/armv7/omap3/mem.c
54 * The details of the setting of the serial gpmc setup are not available.
55 * The values were provided by another party.
57 static u32 gpmc_serial_TL16CP754C[GPMC_MAX_REG] = {
66 /* Used to track the revision of the board */
67 static zoom2_revision revision = ZOOM2_REVISION_UNKNOWN;
70 * Routine: zoom2_get_revision
71 * Description: Return the revision of the Zoom2 this code is running on.
73 zoom2_revision zoom2_get_revision(void)
79 * Routine: zoom2_identify
80 * Description: Detect which version of Zoom2 we are running on.
82 void zoom2_identify(void)
85 * To check for production board vs beta board,
86 * check if gpio 94 is clear.
88 * No way yet to check for alpha board identity.
89 * Alpha boards were produced in very limited quantities
90 * and they are not commonly used. They are mentioned here
91 * only for completeness.
93 if (!gpio_request(94, "")) {
96 gpio_direction_input(94);
97 val = gpio_get_value(94);
101 revision = ZOOM2_REVISION_BETA;
103 revision = ZOOM2_REVISION_PRODUCTION;
106 printf("Board revision ");
108 case ZOOM2_REVISION_PRODUCTION:
109 printf("Production\n");
111 case ZOOM2_REVISION_BETA:
121 * Routine: board_init
122 * Description: Early hardware init.
124 int board_init (void)
128 gpmc_init (); /* in SRAM or SDRAM, finish GPMC */
130 /* Configure console support on zoom2 */
131 gpmc_config = gpmc_serial_TL16CP754C;
132 enable_gpmc_cs_config(gpmc_config, &gpmc_cfg->cs[3],
133 SERIAL_TL16CP754C_BASE, GPMC_SIZE_16M);
135 /* board id for Linux */
136 gd->bd->bi_arch_number = MACH_TYPE_OMAP_ZOOM2;
137 /* boot param addr */
138 gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
140 #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
141 status_led_set (STATUS_LED_BOOT, STATUS_LED_ON);
147 * Routine: misc_init_r
148 * Description: Configure zoom board specific configurations
150 int misc_init_r(void)
153 twl4030_power_init();
154 twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
159 * The board is reset by holding the the large button
160 * on the top right side of the main board for
163 * There are reported problems of some beta boards
164 * continously resetting. For those boards, disable resetting.
166 if (ZOOM2_REVISION_PRODUCTION <= zoom2_get_revision())
167 twl4030_power_reset_init();
173 * Routine: set_muxconf_regs
174 * Description: Setting up the configuration Mux registers specific to the
175 * hardware. Many pins need to be moved from protect to primary
178 void set_muxconf_regs (void)
180 /* platform specific muxes */
184 #ifdef CONFIG_GENERIC_MMC
185 int board_mmc_init(bd_t *bis)
192 #ifdef CONFIG_CMD_NET
193 int board_eth_init(bd_t *bis)
196 #ifdef CONFIG_LAN91C96
197 rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);