Tom Rix | 0419d91 | 2009-05-15 23:48:36 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2009 Wind River Systems, Inc. |
| 3 | * Tom Rix <Tom.Rix@windriver.com> |
| 4 | * |
| 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> |
| 11 | * |
| 12 | * |
| 13 | * See file CREDITS for list of people who contributed to this |
| 14 | * project. |
| 15 | * |
| 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. |
| 20 | * |
| 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. |
| 25 | * |
| 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, |
| 29 | * MA 02111-1307 USA |
| 30 | */ |
| 31 | #include <common.h> |
| 32 | #include <asm/io.h> |
Tom Rix | 93bed9b | 2009-05-31 12:44:37 +0200 | [diff] [blame^] | 33 | #include <asm/arch/mem.h> |
Tom Rix | 0419d91 | 2009-05-15 23:48:36 +0200 | [diff] [blame] | 34 | #include <asm/arch/mux.h> |
| 35 | #include <asm/arch/sys_proto.h> |
| 36 | #include <asm/mach-types.h> |
| 37 | #include "zoom2.h" |
Tom Rix | 93bed9b | 2009-05-31 12:44:37 +0200 | [diff] [blame^] | 38 | #include "zoom2_serial.h" |
Tom Rix | 0419d91 | 2009-05-15 23:48:36 +0200 | [diff] [blame] | 39 | |
| 40 | /* |
Tom Rix | 93bed9b | 2009-05-31 12:44:37 +0200 | [diff] [blame^] | 41 | * This the the zoom2, board specific, gpmc configuration for the |
| 42 | * quad uart on the debug board. The more general gpmc configurations |
| 43 | * are setup at the cpu level in cpu/arm_cortexa8/omap3/mem.c |
| 44 | * |
| 45 | * The details of the setting of the serial gpmc setup are not available. |
| 46 | * The values were provided by another party. |
| 47 | */ |
| 48 | extern void enable_gpmc_config(u32 *gpmc_config, gpmc_csx_t *gpmc_cs_base, |
| 49 | u32 base, u32 size); |
| 50 | |
| 51 | static u32 gpmc_serial_TL16CP754C[GPMC_MAX_REG] = { |
| 52 | 0x00011000, |
| 53 | 0x001F1F01, |
| 54 | 0x00080803, |
| 55 | 0x1D091D09, |
| 56 | 0x041D1F1F, |
| 57 | 0x1D0904C4, 0 |
| 58 | }; |
| 59 | |
| 60 | /* |
Tom Rix | 0419d91 | 2009-05-15 23:48:36 +0200 | [diff] [blame] | 61 | * Routine: board_init |
| 62 | * Description: Early hardware init. |
| 63 | */ |
| 64 | int board_init (void) |
| 65 | { |
| 66 | DECLARE_GLOBAL_DATA_PTR; |
Tom Rix | 93bed9b | 2009-05-31 12:44:37 +0200 | [diff] [blame^] | 67 | gpmc_csx_t *serial_cs_base; |
| 68 | u32 *gpmc_config; |
Tom Rix | 0419d91 | 2009-05-15 23:48:36 +0200 | [diff] [blame] | 69 | |
| 70 | gpmc_init (); /* in SRAM or SDRAM, finish GPMC */ |
Tom Rix | 93bed9b | 2009-05-31 12:44:37 +0200 | [diff] [blame^] | 71 | |
| 72 | /* Configure console support on zoom2 */ |
| 73 | gpmc_config = gpmc_serial_TL16CP754C; |
| 74 | serial_cs_base = (gpmc_csx_t *) (GPMC_CONFIG_CS0_BASE + |
| 75 | (3 * GPMC_CONFIG_WIDTH)); |
| 76 | enable_gpmc_config(gpmc_config, |
| 77 | serial_cs_base, |
| 78 | SERIAL_TL16CP754C_BASE, |
| 79 | GPMC_SIZE_16M); |
| 80 | |
Tom Rix | 0419d91 | 2009-05-15 23:48:36 +0200 | [diff] [blame] | 81 | /* board id for Linux */ |
| 82 | gd->bd->bi_arch_number = MACH_TYPE_OMAP_ZOOM2; |
| 83 | /* boot param addr */ |
| 84 | gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100); |
| 85 | |
Tom Rix | 93bed9b | 2009-05-31 12:44:37 +0200 | [diff] [blame^] | 86 | #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT) |
| 87 | status_led_set (STATUS_LED_BOOT, STATUS_LED_ON); |
| 88 | #endif |
| 89 | |
Tom Rix | 0419d91 | 2009-05-15 23:48:36 +0200 | [diff] [blame] | 90 | return 0; |
| 91 | } |
| 92 | |
| 93 | /* |
| 94 | * Routine: misc_init_r |
| 95 | * Description: Configure zoom board specific configurations |
| 96 | */ |
| 97 | int misc_init_r (void) |
| 98 | { |
| 99 | power_init_r (); |
| 100 | dieid_num_r (); |
| 101 | return 0; |
| 102 | } |
| 103 | |
| 104 | /* |
| 105 | * Routine: set_muxconf_regs |
| 106 | * Description: Setting up the configuration Mux registers specific to the |
| 107 | * hardware. Many pins need to be moved from protect to primary |
| 108 | * mode. |
| 109 | */ |
| 110 | void set_muxconf_regs (void) |
| 111 | { |
| 112 | /* platform specific muxes */ |
| 113 | MUX_ZOOM2 (); |
| 114 | } |