| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 | /* * Hardware definitions for Voipac PXA270 * * Copyright (C) 2010 * Marek Vasut <marek.vasut@gmail.com> * * 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/platform_device.h>#include <linux/delay.h>#include <linux/irq.h>#include <linux/gpio_keys.h>#include <linux/input.h>#include <linux/gpio.h>#include <linux/usb/gpio_vbus.h>#include <linux/mtd/mtd.h>#include <linux/mtd/partitions.h>#include <linux/mtd/physmap.h>#include <linux/mtd/onenand.h>#include <linux/dm9000.h>#include <linux/ucb1400.h>#include <linux/ata_platform.h>#include <linux/regulator/max1586.h>#include <linux/i2c/pxa-i2c.h>#include <asm/mach-types.h>#include <asm/mach/arch.h>#include <mach/pxa27x.h>#include <mach/audio.h>#include <mach/vpac270.h>#include <linux/platform_data/mmc-pxamci.h>#include <linux/platform_data/video-pxafb.h>#include <linux/platform_data/usb-ohci-pxa27x.h>#include <mach/pxa27x-udc.h>#include <mach/udc.h>#include <linux/platform_data/ata-pxa.h>#include "generic.h"#include "devices.h"/****************************************************************************** * Pin configuration ******************************************************************************/static unsigned long vpac270_pin_config[] __initdata = {	/* MMC */	GPIO32_MMC_CLK,	GPIO92_MMC_DAT_0,	GPIO109_MMC_DAT_1,	GPIO110_MMC_DAT_2,	GPIO111_MMC_DAT_3,	GPIO112_MMC_CMD,	GPIO53_GPIO,	/* SD detect */	GPIO52_GPIO,	/* SD r/o switch */	/* GPIO KEYS */	GPIO1_GPIO,	/* USER BTN */	/* LEDs */	GPIO15_GPIO,	/* orange led */	/* FFUART */	GPIO34_FFUART_RXD,	GPIO39_FFUART_TXD,	GPIO27_FFUART_RTS,	GPIO100_FFUART_CTS,	GPIO33_FFUART_DSR,	GPIO40_FFUART_DTR,	GPIO10_FFUART_DCD,	GPIO38_FFUART_RI,	/* LCD */	GPIO58_LCD_LDD_0,	GPIO59_LCD_LDD_1,	GPIO60_LCD_LDD_2,	GPIO61_LCD_LDD_3,	GPIO62_LCD_LDD_4,	GPIO63_LCD_LDD_5,	GPIO64_LCD_LDD_6,	GPIO65_LCD_LDD_7,	GPIO66_LCD_LDD_8,	GPIO67_LCD_LDD_9,	GPIO68_LCD_LDD_10,	GPIO69_LCD_LDD_11,	GPIO70_LCD_LDD_12,	GPIO71_LCD_LDD_13,	GPIO72_LCD_LDD_14,	GPIO73_LCD_LDD_15,	GPIO86_LCD_LDD_16,	GPIO87_LCD_LDD_17,	GPIO74_LCD_FCLK,	GPIO75_LCD_LCLK,	GPIO76_LCD_PCLK,	GPIO77_LCD_BIAS,	/* PCMCIA */	GPIO48_nPOE,	GPIO49_nPWE,	GPIO50_nPIOR,	GPIO51_nPIOW,	GPIO85_nPCE_1,	GPIO54_nPCE_2,	GPIO55_nPREG,	GPIO57_nIOIS16,	GPIO56_nPWAIT,	GPIO104_PSKTSEL,	GPIO84_GPIO,	/* PCMCIA CD */	GPIO35_GPIO,	/* PCMCIA RDY */	GPIO107_GPIO,	/* PCMCIA PPEN */	GPIO11_GPIO,	/* PCMCIA RESET */	GPIO17_GPIO,	/* CF CD */	GPIO12_GPIO,	/* CF RDY */	GPIO16_GPIO,	/* CF RESET */	/* UHC */	GPIO88_USBH1_PWR,	GPIO89_USBH1_PEN,	GPIO119_USBH2_PWR,	GPIO120_USBH2_PEN,	/* UDC */	GPIO41_GPIO,	/* Ethernet */	GPIO114_GPIO,	/* IRQ */	/* AC97 */	GPIO28_AC97_BITCLK,	GPIO29_AC97_SDATA_IN_0,	GPIO30_AC97_SDATA_OUT,	GPIO31_AC97_SYNC,	GPIO95_AC97_nRESET,	GPIO98_AC97_SYSCLK,	GPIO113_GPIO,	/* TS IRQ */	/* I2C */	GPIO117_I2C_SCL,	GPIO118_I2C_SDA,	/* IDE */	GPIO36_GPIO,	/* IDE IRQ */	GPIO80_DREQ_1,};/****************************************************************************** * NOR Flash ******************************************************************************/#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)static struct mtd_partition vpac270_nor_partitions[] = {	{		.name		= "Flash",		.offset		= 0x00000000,		.size		= MTDPART_SIZ_FULL,	}};static struct physmap_flash_data vpac270_flash_data[] = {	{		.width		= 2,	/* bankwidth in bytes */		.parts		= vpac270_nor_partitions,		.nr_parts	= ARRAY_SIZE(vpac270_nor_partitions)	}};static struct resource vpac270_flash_resource = {	.start	= PXA_CS0_PHYS,	.end	= PXA_CS0_PHYS + SZ_64M - 1,	.flags	= IORESOURCE_MEM,};static struct platform_device vpac270_flash = {	.name		= "physmap-flash",	.id		= 0,	.resource	= &vpac270_flash_resource,	.num_resources	= 1,	.dev 		= {		.platform_data = vpac270_flash_data,	},};static void __init vpac270_nor_init(void){	platform_device_register(&vpac270_flash);}#elsestatic inline void vpac270_nor_init(void) {}#endif/****************************************************************************** * OneNAND Flash ******************************************************************************/#if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE)static struct mtd_partition vpac270_onenand_partitions[] = {	{		.name		= "Flash",		.offset		= 0x00000000,		.size		= MTDPART_SIZ_FULL,	}};static struct onenand_platform_data vpac270_onenand_info = {	.parts		= vpac270_onenand_partitions,	.nr_parts	= ARRAY_SIZE(vpac270_onenand_partitions),};static struct resource vpac270_onenand_resources[] = {	[0] = {		.start	= PXA_CS0_PHYS,		.end	= PXA_CS0_PHYS + SZ_1M,		.flags	= IORESOURCE_MEM,	},};static struct platform_device vpac270_onenand = {	.name		= "onenand-flash",	.id		= -1,	.resource	= vpac270_onenand_resources,	.num_resources	= ARRAY_SIZE(vpac270_onenand_resources),	.dev		= {		.platform_data	= &vpac270_onenand_info,	},};static void __init vpac270_onenand_init(void){	platform_device_register(&vpac270_onenand);}#elsestatic void __init vpac270_onenand_init(void) {}#endif/****************************************************************************** * SD/MMC card controller ******************************************************************************/#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)static struct pxamci_platform_data vpac270_mci_platform_data = {	.ocr_mask		= MMC_VDD_32_33 | MMC_VDD_33_34,	.gpio_power		= -1,	.gpio_card_detect	= GPIO53_VPAC270_SD_DETECT_N,	.gpio_card_ro		= GPIO52_VPAC270_SD_READONLY,	.detect_delay_ms	= 200,};static void __init vpac270_mmc_init(void){	pxa_set_mci_info(&vpac270_mci_platform_data);}#elsestatic inline void vpac270_mmc_init(void) {}#endif/****************************************************************************** * GPIO keys ******************************************************************************/#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)static struct gpio_keys_button vpac270_pxa_buttons[] = {	{KEY_POWER, GPIO1_VPAC270_USER_BTN, 0, "USER BTN"},};static struct gpio_keys_platform_data vpac270_pxa_keys_data = {	.buttons	= vpac270_pxa_buttons,	.nbuttons	= ARRAY_SIZE(vpac270_pxa_buttons),};static struct platform_device vpac270_pxa_keys = {	.name	= "gpio-keys",	.id	= -1,	.dev	= {		.platform_data = &vpac270_pxa_keys_data,	},};static void __init vpac270_keys_init(void){	platform_device_register(&vpac270_pxa_keys);}#elsestatic inline void vpac270_keys_init(void) {}#endif/****************************************************************************** * LED ******************************************************************************/#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)struct gpio_led vpac270_gpio_leds[] = {{	.name			= "vpac270:orange:user",	.default_trigger	= "none",	.gpio			= GPIO15_VPAC270_LED_ORANGE,	.active_low		= 1,}};static struct gpio_led_platform_data vpac270_gpio_led_info = {	.leds		= vpac270_gpio_leds,	.num_leds	= ARRAY_SIZE(vpac270_gpio_leds),};static struct platform_device vpac270_leds = {	.name	= "leds-gpio",	.id	= -1,	.dev	= {		.platform_data	= &vpac270_gpio_led_info,	}};static void __init vpac270_leds_init(void){	platform_device_register(&vpac270_leds);}#elsestatic inline void vpac270_leds_init(void) {}#endif/****************************************************************************** * USB Host ******************************************************************************/#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)static int vpac270_ohci_init(struct device *dev){	UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;	return 0;}
 |