| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 | /* * linux/arch/arm/mach-omap2/board-omap3evm.c * * Copyright (C) 2008 Texas Instruments * * Modified from mach-omap2/board-3430sdp.c * * Initial code: Syed Mohammed Khasim * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */#include <linux/kernel.h>#include <linux/init.h>#include <linux/platform_device.h>#include <linux/delay.h>#include <linux/err.h>#include <linux/clk.h>#include <linux/gpio.h>#include <linux/input.h>#include <linux/input/matrix_keypad.h>#include <linux/leds.h>#include <linux/interrupt.h>#include <linux/mtd/mtd.h>#include <linux/mtd/partitions.h>#include <linux/mtd/nand.h>#include <linux/spi/spi.h>#include <linux/spi/ads7846.h>#include <linux/i2c/twl.h>#include <linux/usb/otg.h>#include <linux/usb/musb.h>#include <linux/usb/nop-usb-xceiv.h>#include <linux/smsc911x.h>#include <linux/wl12xx.h>#include <linux/regulator/fixed.h>#include <linux/regulator/machine.h>#include <linux/mmc/host.h>#include <linux/export.h>#include <asm/mach-types.h>#include <asm/mach/arch.h>#include <asm/mach/map.h>#include <linux/platform_data/mtd-nand-omap2.h>#include "common.h"#include <linux/platform_data/spi-omap2-mcspi.h>#include <video/omapdss.h>#include <video/omap-panel-tfp410.h>#include "soc.h"#include "mux.h"#include "sdram-micron-mt46h32m32lf-6.h"#include "hsmmc.h"#include "common-board-devices.h"#include "board-flash.h"#define	NAND_CS			0#define OMAP3_EVM_TS_GPIO	175#define OMAP3_EVM_EHCI_VBUS	22#define OMAP3_EVM_EHCI_SELECT	61#define OMAP3EVM_ETHR_START	0x2c000000#define OMAP3EVM_ETHR_SIZE	1024#define OMAP3EVM_ETHR_ID_REV	0x50#define OMAP3EVM_ETHR_GPIO_IRQ	176#define OMAP3EVM_SMSC911X_CS	5/* * Eth Reset signal *	64 = Generation 1 (<=RevD) *	7 = Generation 2 (>=RevE) */#define OMAP3EVM_GEN1_ETHR_GPIO_RST	64#define OMAP3EVM_GEN2_ETHR_GPIO_RST	7/* * OMAP35x EVM revision * Run time detection of EVM revision is done by reading Ethernet * PHY ID - *	GEN_1	= 0x01150000 *	GEN_2	= 0x92200000 */enum {	OMAP3EVM_BOARD_GEN_1 = 0,	/* EVM Rev between  A - D */	OMAP3EVM_BOARD_GEN_2,		/* EVM Rev >= Rev E */};static u8 omap3_evm_version;static u8 get_omap3_evm_rev(void){	return omap3_evm_version;}static void __init omap3_evm_get_revision(void){	void __iomem *ioaddr;	unsigned int smsc_id;	/* Ethernet PHY ID is stored at ID_REV register */	ioaddr = ioremap_nocache(OMAP3EVM_ETHR_START, SZ_1K);	if (!ioaddr)		return;	smsc_id = readl(ioaddr + OMAP3EVM_ETHR_ID_REV) & 0xFFFF0000;	iounmap(ioaddr);	switch (smsc_id) {	/*SMSC9115 chipset*/	case 0x01150000:		omap3_evm_version = OMAP3EVM_BOARD_GEN_1;		break;	/*SMSC 9220 chipset*/	case 0x92200000:	default:		omap3_evm_version = OMAP3EVM_BOARD_GEN_2;	}}#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)#include "gpmc-smsc911x.h"static struct omap_smsc911x_platform_data smsc911x_cfg = {	.cs             = OMAP3EVM_SMSC911X_CS,	.gpio_irq       = OMAP3EVM_ETHR_GPIO_IRQ,	.gpio_reset     = -EINVAL,	.flags		= SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,};static inline void __init omap3evm_init_smsc911x(void){	/* Configure ethernet controller reset gpio */	if (cpu_is_omap3430()) {		if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)			smsc911x_cfg.gpio_reset = OMAP3EVM_GEN1_ETHR_GPIO_RST;		else			smsc911x_cfg.gpio_reset = OMAP3EVM_GEN2_ETHR_GPIO_RST;	}	gpmc_smsc911x_init(&smsc911x_cfg);}#elsestatic inline void __init omap3evm_init_smsc911x(void) { return; }#endif/* * OMAP3EVM LCD Panel control signals */#define OMAP3EVM_LCD_PANEL_LR		2#define OMAP3EVM_LCD_PANEL_UD		3#define OMAP3EVM_LCD_PANEL_INI		152#define OMAP3EVM_LCD_PANEL_ENVDD	153#define OMAP3EVM_LCD_PANEL_QVGA		154#define OMAP3EVM_LCD_PANEL_RESB		155#define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO	210#define OMAP3EVM_DVI_PANEL_EN_GPIO	199
 |