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 * SPDX-License-Identifier: GPL-2.0+
17 #ifdef CONFIG_STATUS_LED
18 #include <status_led.h>
22 #include <asm/arch/mmc_host_def.h>
24 #include <asm/arch/mem.h>
25 #include <asm/arch/mux.h>
26 #include <asm/arch/sys_proto.h>
27 #include <asm/mach-types.h>
29 #include "zoom2_serial.h"
31 DECLARE_GLOBAL_DATA_PTR;
34 * This the the zoom2, board specific, gpmc configuration for the
35 * quad uart on the debug board. The more general gpmc configurations
36 * are setup at the cpu level in arch/arm/cpu/armv7/omap3/mem.c
38 * The details of the setting of the serial gpmc setup are not available.
39 * The values were provided by another party.
41 static u32 gpmc_serial_TL16CP754C[GPMC_MAX_REG] = {
50 /* Used to track the revision of the board */
51 static zoom2_revision revision = ZOOM2_REVISION_UNKNOWN;
54 * Routine: zoom2_get_revision
55 * Description: Return the revision of the Zoom2 this code is running on.
57 zoom2_revision zoom2_get_revision(void)
63 * Routine: zoom2_identify
64 * Description: Detect which version of Zoom2 we are running on.
66 void zoom2_identify(void)
69 * To check for production board vs beta board,
70 * check if gpio 94 is clear.
72 * No way yet to check for alpha board identity.
73 * Alpha boards were produced in very limited quantities
74 * and they are not commonly used. They are mentioned here
75 * only for completeness.
77 if (!gpio_request(94, "")) {
80 gpio_direction_input(94);
81 val = gpio_get_value(94);
84 revision = ZOOM2_REVISION_BETA;
86 revision = ZOOM2_REVISION_PRODUCTION;
89 printf("Board revision ");
91 case ZOOM2_REVISION_PRODUCTION:
92 printf("Production\n");
94 case ZOOM2_REVISION_BETA:
104 * Routine: board_init
105 * Description: Early hardware init.
107 int board_init (void)
111 gpmc_init (); /* in SRAM or SDRAM, finish GPMC */
113 /* Configure console support on zoom2 */
114 gpmc_config = gpmc_serial_TL16CP754C;
115 enable_gpmc_cs_config(gpmc_config, &gpmc_cfg->cs[3],
116 SERIAL_TL16CP754C_BASE, GPMC_SIZE_16M);
118 /* board id for Linux */
119 gd->bd->bi_arch_number = MACH_TYPE_OMAP_ZOOM2;
120 /* boot param addr */
121 gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
123 #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
124 status_led_set (STATUS_LED_BOOT, STATUS_LED_ON);
130 * Routine: misc_init_r
131 * Description: Configure zoom board specific configurations
133 int misc_init_r(void)
136 twl4030_power_init();
137 twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
142 * The board is reset by holding the the large button
143 * on the top right side of the main board for
146 * There are reported problems of some beta boards
147 * continously resetting. For those boards, disable resetting.
149 if (ZOOM2_REVISION_PRODUCTION <= zoom2_get_revision())
150 twl4030_power_reset_init();
156 * Routine: set_muxconf_regs
157 * Description: Setting up the configuration Mux registers specific to the
158 * hardware. Many pins need to be moved from protect to primary
161 void set_muxconf_regs (void)
163 /* platform specific muxes */
167 #ifdef CONFIG_GENERIC_MMC
168 int board_mmc_init(bd_t *bis)
170 return omap_mmc_init(0, 0, 0, -1, -1);
174 #ifdef CONFIG_CMD_NET
175 int board_eth_init(bd_t *bis)
178 #ifdef CONFIG_LAN91C96
179 rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);