Path: blob/master/arch/arm/mach-omap2/board-3630sdp.c
10817 views
/*1* Copyright (C) 2009 Texas Instruments Inc.2*3* This program is free software; you can redistribute it and/or modify4* it under the terms of the GNU General Public License version 2 as5* published by the Free Software Foundation.6*/78#include <linux/kernel.h>9#include <linux/init.h>10#include <linux/platform_device.h>11#include <linux/input.h>12#include <linux/gpio.h>13#include <linux/mtd/nand.h>1415#include <asm/mach-types.h>16#include <asm/mach/arch.h>1718#include <plat/common.h>19#include <plat/board.h>20#include <plat/gpmc-smc91x.h>21#include <plat/usb.h>2223#include <mach/board-zoom.h>2425#include "board-flash.h"26#include "mux.h"27#include "sdram-hynix-h8mbx00u0mer-0em.h"2829#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)3031static struct omap_smc91x_platform_data board_smc91x_data = {32.cs = 3,33.flags = GPMC_MUX_ADD_DATA | IORESOURCE_IRQ_LOWLEVEL,34};3536static void __init board_smc91x_init(void)37{38board_smc91x_data.gpio_irq = 158;39gpmc_smc91x_init(&board_smc91x_data);40}4142#else4344static inline void board_smc91x_init(void)45{46}4748#endif /* defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) */4950static void enable_board_wakeup_source(void)51{52/* T2 interrupt line (keypad) */53omap_mux_init_signal("sys_nirq",54OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);55}5657static const struct usbhs_omap_board_data usbhs_bdata __initconst = {5859.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,60.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,61.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,6263.phy_reset = true,64.reset_gpio_port[0] = 126,65.reset_gpio_port[1] = 61,66.reset_gpio_port[2] = -EINVAL67};6869static struct omap_board_config_kernel sdp_config[] __initdata = {70};7172static void __init omap_sdp_init_early(void)73{74omap2_init_common_infrastructure();75omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,76h8mbx00u0mer0em_sdrc_params);77}7879#ifdef CONFIG_OMAP_MUX80static struct omap_board_mux board_mux[] __initdata = {81{ .reg_offset = OMAP_MUX_TERMINATOR },82};83#endif8485/*86* SDP3630 CS organization87* See also the Switch S8 settings in the comments.88*/89static char chip_sel_sdp[][GPMC_CS_NUM] = {90{PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */91{PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */92{PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */93};9495static struct mtd_partition sdp_nor_partitions[] = {96/* bootloader (U-Boot, etc) in first sector */97{98.name = "Bootloader-NOR",99.offset = 0,100.size = SZ_256K,101.mask_flags = MTD_WRITEABLE, /* force read-only */102},103/* bootloader params in the next sector */104{105.name = "Params-NOR",106.offset = MTDPART_OFS_APPEND,107.size = SZ_256K,108.mask_flags = 0,109},110/* kernel */111{112.name = "Kernel-NOR",113.offset = MTDPART_OFS_APPEND,114.size = SZ_2M,115.mask_flags = 0116},117/* file system */118{119.name = "Filesystem-NOR",120.offset = MTDPART_OFS_APPEND,121.size = MTDPART_SIZ_FULL,122.mask_flags = 0123}124};125126static struct mtd_partition sdp_onenand_partitions[] = {127{128.name = "X-Loader-OneNAND",129.offset = 0,130.size = 4 * (64 * 2048),131.mask_flags = MTD_WRITEABLE /* force read-only */132},133{134.name = "U-Boot-OneNAND",135.offset = MTDPART_OFS_APPEND,136.size = 2 * (64 * 2048),137.mask_flags = MTD_WRITEABLE /* force read-only */138},139{140.name = "U-Boot Environment-OneNAND",141.offset = MTDPART_OFS_APPEND,142.size = 1 * (64 * 2048),143},144{145.name = "Kernel-OneNAND",146.offset = MTDPART_OFS_APPEND,147.size = 16 * (64 * 2048),148},149{150.name = "File System-OneNAND",151.offset = MTDPART_OFS_APPEND,152.size = MTDPART_SIZ_FULL,153},154};155156static struct mtd_partition sdp_nand_partitions[] = {157/* All the partition sizes are listed in terms of NAND block size */158{159.name = "X-Loader-NAND",160.offset = 0,161.size = 4 * (64 * 2048),162.mask_flags = MTD_WRITEABLE, /* force read-only */163},164{165.name = "U-Boot-NAND",166.offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */167.size = 10 * (64 * 2048),168.mask_flags = MTD_WRITEABLE, /* force read-only */169},170{171.name = "Boot Env-NAND",172173.offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */174.size = 6 * (64 * 2048),175},176{177.name = "Kernel-NAND",178.offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */179.size = 40 * (64 * 2048),180},181{182.name = "File System - NAND",183.size = MTDPART_SIZ_FULL,184.offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */185},186};187188static struct flash_partitions sdp_flash_partitions[] = {189{190.parts = sdp_nor_partitions,191.nr_parts = ARRAY_SIZE(sdp_nor_partitions),192},193{194.parts = sdp_onenand_partitions,195.nr_parts = ARRAY_SIZE(sdp_onenand_partitions),196},197{198.parts = sdp_nand_partitions,199.nr_parts = ARRAY_SIZE(sdp_nand_partitions),200},201};202203static void __init omap_sdp_init(void)204{205omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);206omap_board_config = sdp_config;207omap_board_config_size = ARRAY_SIZE(sdp_config);208zoom_peripherals_init();209zoom_display_init();210board_smc91x_init();211board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);212enable_board_wakeup_source();213usbhs_init(&usbhs_bdata);214}215216MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")217.boot_params = 0x80000100,218.reserve = omap_reserve,219.map_io = omap3_map_io,220.init_early = omap_sdp_init_early,221.init_irq = omap_init_irq,222.init_machine = omap_sdp_init,223.timer = &omap_timer,224MACHINE_END225226227