vikram pandita | 5f35fbe | 2009-11-22 10:11:32 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 Texas Instruments Inc. |
| 3 | * |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation. |
| 8 | */ |
| 9 | |
| 10 | #include <linux/kernel.h> |
| 11 | #include <linux/init.h> |
| 12 | #include <linux/platform_device.h> |
| 13 | #include <linux/input.h> |
| 14 | #include <linux/gpio.h> |
| 15 | |
| 16 | #include <asm/mach-types.h> |
| 17 | #include <asm/mach/arch.h> |
| 18 | |
| 19 | #include <mach/board-zoom.h> |
| 20 | |
| 21 | #include <plat/common.h> |
| 22 | #include <plat/board.h> |
vikram pandita | 31e464c | 2010-02-17 14:09:23 -0800 | [diff] [blame] | 23 | #include <plat/usb.h> |
vikram pandita | 5f35fbe | 2009-11-22 10:11:32 -0800 | [diff] [blame] | 24 | |
Tony Lindgren | 662c8b5 | 2009-12-11 16:16:33 -0800 | [diff] [blame] | 25 | #include "mux.h" |
vikram pandita | 5f35fbe | 2009-11-22 10:11:32 -0800 | [diff] [blame] | 26 | #include "sdram-hynix-h8mbx00u0mer-0em.h" |
| 27 | |
vikram pandita | 5f35fbe | 2009-11-22 10:11:32 -0800 | [diff] [blame] | 28 | static struct omap_board_config_kernel zoom_config[] __initdata = { |
| 29 | }; |
| 30 | |
Sukumar Ghorai | e08b105 | 2010-07-09 14:27:49 +0000 | [diff] [blame] | 31 | static struct mtd_partition zoom_nand_partitions[] = { |
| 32 | /* All the partition sizes are listed in terms of NAND block size */ |
| 33 | { |
| 34 | .name = "X-Loader-NAND", |
| 35 | .offset = 0, |
| 36 | .size = 4 * (64 * 2048), /* 512KB, 0x80000 */ |
| 37 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
| 38 | }, |
| 39 | { |
| 40 | .name = "U-Boot-NAND", |
| 41 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ |
| 42 | .size = 10 * (64 * 2048), /* 1.25MB, 0x140000 */ |
| 43 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
| 44 | }, |
| 45 | { |
| 46 | .name = "Boot Env-NAND", |
| 47 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */ |
| 48 | .size = 2 * (64 * 2048), /* 256KB, 0x40000 */ |
| 49 | }, |
| 50 | { |
| 51 | .name = "Kernel-NAND", |
| 52 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x0200000*/ |
| 53 | .size = 240 * (64 * 2048), /* 30M, 0x1E00000 */ |
| 54 | }, |
| 55 | { |
| 56 | .name = "system", |
| 57 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x2000000 */ |
| 58 | .size = 3328 * (64 * 2048), /* 416M, 0x1A000000 */ |
| 59 | }, |
| 60 | { |
| 61 | .name = "userdata", |
| 62 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x1C000000*/ |
| 63 | .size = 256 * (64 * 2048), /* 32M, 0x2000000 */ |
| 64 | }, |
| 65 | { |
| 66 | .name = "cache", |
| 67 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x1E000000*/ |
| 68 | .size = 256 * (64 * 2048), /* 32M, 0x2000000 */ |
| 69 | }, |
| 70 | }; |
| 71 | |
vikram pandita | 5f35fbe | 2009-11-22 10:11:32 -0800 | [diff] [blame] | 72 | static void __init omap_zoom_init_irq(void) |
| 73 | { |
| 74 | omap_board_config = zoom_config; |
| 75 | omap_board_config_size = ARRAY_SIZE(zoom_config); |
| 76 | omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params, |
| 77 | h8mbx00u0mer0em_sdrc_params); |
| 78 | omap_init_irq(); |
| 79 | omap_gpio_init(); |
| 80 | } |
| 81 | |
Tony Lindgren | 662c8b5 | 2009-12-11 16:16:33 -0800 | [diff] [blame] | 82 | #ifdef CONFIG_OMAP_MUX |
| 83 | static struct omap_board_mux board_mux[] __initdata = { |
Ohad Ben-Cohen | c3777c1 | 2010-08-02 13:18:00 +0300 | [diff] [blame] | 84 | /* WLAN IRQ - GPIO 162 */ |
| 85 | OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP), |
| 86 | /* WLAN POWER ENABLE - GPIO 101 */ |
| 87 | OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), |
| 88 | /* WLAN SDIO: MMC3 CMD */ |
| 89 | OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP), |
| 90 | /* WLAN SDIO: MMC3 CLK */ |
| 91 | OMAP3_MUX(ETK_CLK, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), |
| 92 | /* WLAN SDIO: MMC3 DAT[0-3] */ |
| 93 | OMAP3_MUX(ETK_D3, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), |
| 94 | OMAP3_MUX(ETK_D4, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), |
| 95 | OMAP3_MUX(ETK_D5, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), |
| 96 | OMAP3_MUX(ETK_D6, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), |
Tony Lindgren | 662c8b5 | 2009-12-11 16:16:33 -0800 | [diff] [blame] | 97 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
| 98 | }; |
| 99 | #else |
| 100 | #define board_mux NULL |
| 101 | #endif |
| 102 | |
Felipe Balbi | 6f69a18 | 2010-03-04 09:45:53 +0200 | [diff] [blame] | 103 | static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { |
vikram pandita | 31e464c | 2010-02-17 14:09:23 -0800 | [diff] [blame] | 104 | .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, |
| 105 | .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, |
| 106 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, |
| 107 | .phy_reset = true, |
| 108 | .reset_gpio_port[0] = -EINVAL, |
| 109 | .reset_gpio_port[1] = 64, |
| 110 | .reset_gpio_port[2] = -EINVAL, |
| 111 | }; |
| 112 | |
vikram pandita | 5f35fbe | 2009-11-22 10:11:32 -0800 | [diff] [blame] | 113 | static void __init omap_zoom_init(void) |
| 114 | { |
Tony Lindgren | 662c8b5 | 2009-12-11 16:16:33 -0800 | [diff] [blame] | 115 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); |
vikram pandita | 5f35fbe | 2009-11-22 10:11:32 -0800 | [diff] [blame] | 116 | zoom_peripherals_init(); |
Sukumar Ghorai | e08b105 | 2010-07-09 14:27:49 +0000 | [diff] [blame] | 117 | board_nand_init(zoom_nand_partitions, |
| 118 | ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS); |
vikram pandita | 5f35fbe | 2009-11-22 10:11:32 -0800 | [diff] [blame] | 119 | zoom_debugboard_init(); |
vikram pandita | 31e464c | 2010-02-17 14:09:23 -0800 | [diff] [blame] | 120 | |
| 121 | omap_mux_init_gpio(64, OMAP_PIN_OUTPUT); |
| 122 | usb_ehci_init(&ehci_pdata); |
vikram pandita | 5f35fbe | 2009-11-22 10:11:32 -0800 | [diff] [blame] | 123 | } |
| 124 | |
| 125 | MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") |
Tony Lindgren | a4f57b8 | 2010-04-30 12:57:14 -0700 | [diff] [blame] | 126 | .phys_io = ZOOM_UART_BASE, |
| 127 | .io_pg_offst = (ZOOM_UART_VIRT >> 18) & 0xfffc, |
vikram pandita | 5f35fbe | 2009-11-22 10:11:32 -0800 | [diff] [blame] | 128 | .boot_params = 0x80000100, |
Mike Rapoport | 869fef4 | 2010-08-04 14:43:18 +0300 | [diff] [blame] | 129 | .map_io = omap3_map_io, |
Russell King | 71ee7da | 2010-05-23 10:18:16 +0100 | [diff] [blame] | 130 | .reserve = omap_reserve, |
vikram pandita | 5f35fbe | 2009-11-22 10:11:32 -0800 | [diff] [blame] | 131 | .init_irq = omap_zoom_init_irq, |
| 132 | .init_machine = omap_zoom_init, |
| 133 | .timer = &omap_timer, |
| 134 | MACHINE_END |