1 From 4f4bb58cba3a6c44e9f9f113609287d9d50be9c4 Mon Sep 17 00:00:00 2001
2 From: Joseph Kortje <jpktech@rogers.com>
3 Date: Wed, 28 Oct 2009 21:11:28 -0400
4 Subject: [PATCH] [ARM] Gumstix Verdex Pro arch support
6 add an option for Verdex Pro when ARCH_GUMSTIX is selected, and
7 factor earlier Gumstix support into a seperate option
9 Signed-off-by: Bobby Powers <bobbypowers@gmail.com>
11 arch/arm/mach-pxa/Kconfig | 29 +-
12 arch/arm/mach-pxa/Makefile | 3 +-
13 arch/arm/mach-pxa/gumstix-verdex.c | 749 +++++++++++++++++++++++++++
14 arch/arm/mach-pxa/include/mach/mfp-pxa27x.h | 1 +
15 4 files changed, 772 insertions(+), 10 deletions(-)
16 create mode 100644 arch/arm/mach-pxa/gumstix-verdex.c
18 --- a/arch/arm/mach-pxa/Kconfig
19 +++ b/arch/arm/mach-pxa/Kconfig
20 @@ -116,23 +116,34 @@ config MACH_CAPC7117
24 - bool "Gumstix XScale 255 boards"
26 + bool "Gumstix boards"
28 - Say Y here if you intend to run this kernel on
29 - Basix, Connex, ws-200ax, ws-400ax systems
30 + Say Y here if you intend to run this kernel on a
34 - prompt "Gumstix Carrier/Expansion Board"
35 depends on ARCH_GUMSTIX
37 -config GUMSTIX_AM200EPD
38 +config MACH_GUMSTIX_F
39 + bool "Gumstix Basix/Connex ..."
40 + depends on ARCH_GUMSTIX
44 + prompt "Gumstix Carrier/Expansion Board"
45 + depends on MACH_GUMSTIX_F
47 + config GUMSTIX_AM200EPD
48 bool "Enable AM200EPD board support"
50 -config GUMSTIX_AM300EPD
51 + config GUMSTIX_AM300EPD
52 bool "Enable AM300EPD board support"
57 +config MACH_GUMSTIX_VERDEX
58 + bool "Gumstix VERDEX ..."
59 + depends on ARCH_GUMSTIX
62 config MACH_INTELMOTE2
63 bool "Intel Mote 2 Platform"
64 --- a/arch/arm/mach-pxa/Makefile
65 +++ b/arch/arm/mach-pxa/Makefile
66 @@ -49,7 +49,8 @@ endif
67 obj-$(CONFIG_MACH_EM_X270) += em-x270.o
68 obj-$(CONFIG_MACH_CM_X300) += cm-x300.o
69 obj-$(CONFIG_MACH_CAPC7117) += capc7117.o mxm8x10.o
70 -obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o
71 +obj-$(CONFIG_MACH_GUMSTIX_F) += gumstix.o
72 +obj-$(CONFIG_MACH_GUMSTIX_VERDEX) += gumstix-verdex.o
73 obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o
74 obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o
75 obj-$(CONFIG_MACH_INTELMOTE2) += stargate2.o
77 +++ b/arch/arm/mach-pxa/gumstix-verdex.c
80 + * linux/arch/arm/mach-pxa/gumstix-verdex.c
82 + * Support for the Gumstix verdex motherboard.
84 + * Original Author: Craig Hughes
85 + * Created: Feb 14, 2008
86 + * Copyright: Craig Hughes
88 + * This program is free software; you can redistribute it and/or modify
89 + * it under the terms of the GNU General Public License version 2 as
90 + * published by the Free Software Foundation.
92 + * Implemented based on lubbock.c by Nicolas Pitre and code from Craig
96 +#include <linux/module.h>
97 +#include <linux/kernel.h>
98 +#include <linux/init.h>
99 +#include <linux/platform_device.h>
100 +#include <linux/interrupt.h>
101 +#include <linux/mtd/mtd.h>
102 +#include <linux/mtd/partitions.h>
103 +#include <linux/i2c/tsc2007.h>
105 +#include <asm/setup.h>
106 +#include <asm/memory.h>
107 +#include <asm/mach-types.h>
108 +#include <asm/irq.h>
109 +#include <asm/sizes.h>
112 +#include <asm/mach/arch.h>
113 +#include <asm/mach/map.h>
114 +#include <asm/mach/irq.h>
115 +#include <asm/mach/flash.h>
117 +#include <mach/mmc.h>
118 +#include <mach/udc.h>
119 +#include <mach/pxafb.h>
120 +#include <mach/ohci.h>
121 +#include <plat/i2c.h>
122 +#include <mach/pxa27x.h>
123 +#include <mach/pxa27x-udc.h>
124 +#include <mach/gpio.h>
126 +#include <mach/gumstix.h>
128 +#include "generic.h"
130 +#include <linux/delay.h>
132 +#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
134 +#include <linux/smsc911x.h>
136 +static struct resource verdex_smsc911x_resources[] = {
138 + .name = "smsc911x-memory",
139 + .start = PXA_CS1_PHYS,
140 + .end = PXA_CS1_PHYS + 0x000fffff,
141 + .flags = IORESOURCE_MEM,
144 + .start = IRQ_GPIO(GPIO_GUMSTIX_ETH0),
145 + .end = IRQ_GPIO(GPIO_GUMSTIX_ETH0),
146 + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
150 +static struct smsc911x_platform_config verdex_smsc911x_config = {
151 + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
152 + .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
153 + .flags = SMSC911X_USE_16BIT | SMSC911X_SAVE_MAC_ADDRESS,
154 + .phy_interface = PHY_INTERFACE_MODE_MII,
157 +static struct platform_device verdex_smsc911x_device = {
158 + .name = "smsc911x",
160 + .num_resources = ARRAY_SIZE(verdex_smsc911x_resources),
161 + .resource = verdex_smsc911x_resources,
163 + .platform_data = &verdex_smsc911x_config,
167 +static void __init verdex_init_smsc911x(void)
170 + printk(KERN_INFO "Initializing Gumstix verdex smsc911x\n");
172 + if (gpio_request(GPIO_GUMSTIX_ETH0_RST, "SMSC911x_ETH0_RST") != 0) {
173 + printk(KERN_ERR "could not obtain gpio for SMSC911x_ETH0_RST\n");
174 + goto err_request_gpio_eth0_rst;
177 + if (gpio_request(GPIO_GUMSTIX_ETH0, "SMSC911x_ETH0_IRQ") != 0) {
178 + printk(KERN_ERR "could not obtain gpio for SMSC911x_ETH0_IRQ\n");
179 + goto err_request_gpio_eth0_irq;
182 + if (gpio_direction_output(GPIO_GUMSTIX_ETH0_RST, 0) != 0) {
183 + printk(KERN_ERR "could not set SMSC911x_ETH0_RST pin to output\n");
187 + gpio_set_value(GPIO_GUMSTIX_ETH0_RST, 0);
189 + msleep(500); // Hold RESET for at least 200ms
191 + gpio_set_value(GPIO_GUMSTIX_ETH0_RST, 1);
195 + if (gpio_direction_input(GPIO_GUMSTIX_ETH0) != 0) {
196 + printk(KERN_ERR "could not set SMSC911x_ETH0_IRQ pin to input\n");
200 + gpio_export(GPIO_GUMSTIX_ETH0, 0);
201 + platform_device_register(&verdex_smsc911x_device);
205 + gpio_free(GPIO_GUMSTIX_ETH0_RST);
207 +err_request_gpio_eth0_irq:
208 + gpio_free(GPIO_GUMSTIX_ETH0);
210 +err_request_gpio_eth0_rst:
215 +static void __init verdex_init_smsc911x(void) { return; }
218 +static unsigned long verdex_pin_config[] = {
247 + /* SDRAM and local bus */
281 +#ifdef CONFIG_FB_PXA_SHARP_LQ043_PSP
282 + /* DISP must be always high while screen is on */
283 + /* Done below in verdex_init */
290 +#if defined(CONFIG_PCMCIA_PXA2XX) || defined(CONFIG_PCMCIA_PXA2XX_MODULE)
292 +static unsigned long gpio_ntschg_0[] = {
293 + GPIO104_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_nCD_0_MD);
296 +static unsigned long gpio_ntschg_1[] = {
297 + GPIO18_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_nSTSCHG_1_MD);
298 + GPIO36_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_nCD_1_MD);
299 + GPIO27_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_PRDY_nBSY_1_MD);
302 +static unsigned long gpio_prdy_nbsy_old[] = {
303 + GPIO111_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_nSTSCHG_0_MD);
304 + GPIO109_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_PRDY_nBSY_0_OLD_MD);
307 +static unsigned long gpio_prdy_nbsy[] = {
308 + GPIO96_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_PRDY_nBSY_0_MD);
311 +static unsigned long gpio_nhw_init[] = {
312 + GPIO48_nPOE, // pxa_gpio_mode(GPIO_GUMSTIX_nPOE_MD);
313 + GPIO102_nPCE_1, // pxa_gpio_mode(GPIO_GUMSTIX_nPCE_1_MD);
314 + GPIO105_nPCE_2, // pxa_gpio_mode(GPIO_GUMSTIX_nPCE_2_MD);
315 + GPIO104_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_nCD_0_MD);
317 + GPIO49_nPWE, // pxa_gpio_mode(GPIO_GUMSTIX_nPWE_MD);
318 + GPIO50_nPIOR, // pxa_gpio_mode(GPIO_GUMSTIX_nPIOR_MD);
319 + GPIO51_nPIOW, // pxa_gpio_mode(GPIO_GUMSTIX_nPIOW_MD);
320 + GPIO79_PSKTSEL, // pxa_gpio_mode(GPIO_GUMSTIX_pSKTSEL_MD);
321 + GPIO55_nPREG, // pxa_gpio_mode(GPIO_GUMSTIX_nPREG_MD);
322 + GPIO56_nPWAIT, // pxa_gpio_mode(GPIO_GUMSTIX_nPWAIT_MD);
323 + GPIO57_nIOIS16, // pxa_gpio_mode(GPIO_GUMSTIX_nIOIS16_MD);
326 +static int net_cf_vx_mode = 0;
327 +static int pcmcia_cf_nr = 2;
329 +inline void __init gumstix_pcmcia_cpld_clk(void)
331 + GPCR(GPIO_GUMSTIX_nPOE) = GPIO_bit(GPIO_GUMSTIX_nPOE);
332 + GPSR(GPIO_GUMSTIX_nPOE) = GPIO_bit(GPIO_GUMSTIX_nPOE);
335 +inline unsigned char __init gumstix_pcmcia_cpld_read_bits(int bits)
337 + unsigned char result = 0;
338 + unsigned int shift = 0;
341 + result |= !!(GPLR(GPIO_GUMSTIX_nCD_0) & GPIO_bit(GPIO_GUMSTIX_nCD_0)) << shift;
343 + gumstix_pcmcia_cpld_clk();
345 + printk("CPLD responded with: %02x\n",result);
349 +/* We use the CPLD on the CF-CF card to read a value from a shift register. If we can read that
350 + * magic sequence, then we have 2 CF cards; otherwise we assume just one
351 + * The CPLD will send the value of the shift register on GPIO11 (the CD line for slot 0)
352 + * when RESET is held in reset. We use GPIO48 (nPOE) as a clock signal,
353 + * GPIO52/53 (card enable for both cards) to control read/write to the shift register
355 +static void __init gumstix_count_cards(void)
358 + if ((gpio_request(GPIO_GUMSTIX_nPOE, "GPIO_GUMSTIX_nPOE") == 0) &&
359 + (gpio_direction_output(GPIO_GUMSTIX_nPOE, 1) == 0))
360 + gpio_export(GPIO_GUMSTIX_nPOE, 0);
362 + printk(KERN_ERR "could not obtain gpio for GPIO_GUMSTIX_nPOE\n");
364 + if ((gpio_request(GPIO_GUMSTIX_nPCE_1, "GPIO_GUMSTIX_nPCE_1") == 0) &&
365 + (gpio_direction_output(GPIO_GUMSTIX_nPCE_1, 1) == 0))
366 + gpio_export(GPIO_GUMSTIX_nPCE_1, 0);
368 + printk(KERN_ERR "could not obtain gpio for GPIO_GUMSTIX_nPCE_1\n");
370 + if ((gpio_request(GPIO_GUMSTIX_nPCE_2, "GPIO_GUMSTIX_nPCE_2") == 0) &&
371 + (gpio_direction_output(GPIO_GUMSTIX_nPCE_2, 1) == 0))
372 + gpio_export(GPIO_GUMSTIX_nPCE_2, 0);
374 + printk(KERN_ERR "could not obtain gpio for GPIO_GUMSTIX_nPCE_2\n");
376 + if ((gpio_request(GPIO_GUMSTIX_nCD_0, "GPIO_GUMSTIX_nCD_0") == 0) &&
377 + (gpio_direction_input(GPIO_GUMSTIX_nCD_0) == 0))
378 + gpio_export(GPIO_GUMSTIX_nCD_0, 0);
380 + printk(KERN_ERR "could not obtain gpio for GPIO_GUMSTIX_nCD_0\n");
382 + if (net_cf_vx_mode) {
383 + if ((gpio_request(GPIO_GUMSTIX_CF_OLD_RESET, "GPIO_GUMSTIX_CF_OLD_RESET") == 0) &&
384 + (gpio_direction_output(GPIO_GUMSTIX_CF_OLD_RESET, 1) == 0)) {
385 + gpio_export(GPIO_GUMSTIX_CF_OLD_RESET, 0);
387 + printk(KERN_ERR "could not obtain gpio for GPIO_GUMSTIX_CF_OLD_RESET\n");
390 + if ((gpio_request(GPIO_GUMSTIX_CF_RESET, "GPIO_GUMSTIX_CF_RESET") == 0) &&
391 + (gpio_direction_output(GPIO_GUMSTIX_CF_RESET, 1) == 0)) {
392 + gpio_export(GPIO_GUMSTIX_CF_RESET, 0);
394 + printk(KERN_ERR "could not obtain gpio for GPIO_GUMSTIX_CF_RESET\n");
398 + // Setup the shift register
399 + GPSR(GPIO_GUMSTIX_nPCE_1) = GPIO_bit(GPIO_GUMSTIX_nPCE_1);
400 + GPCR(GPIO_GUMSTIX_nPCE_2) = GPIO_bit(GPIO_GUMSTIX_nPCE_2);
402 + // Tick the clock to program the shift register
403 + gumstix_pcmcia_cpld_clk();
405 + // Now set shift register into read mode
406 + GPCR(GPIO_GUMSTIX_nPCE_1) = GPIO_bit(GPIO_GUMSTIX_nPCE_1);
407 + GPSR(GPIO_GUMSTIX_nPCE_2) = GPIO_bit(GPIO_GUMSTIX_nPCE_2);
409 + // We can read the bits now -- 0xC2 means "Dual compact flash"
410 + if(gumstix_pcmcia_cpld_read_bits(8) != 0xC2)
412 + // We do not have 2 CF slots
418 + if (net_cf_vx_mode) {
419 + gpio_set_value(GPIO_GUMSTIX_CF_OLD_RESET, 0);
420 + gpio_free(GPIO_GUMSTIX_CF_OLD_RESET);
422 + gpio_set_value(GPIO_GUMSTIX_CF_RESET, 0);
423 + gpio_free(GPIO_GUMSTIX_CF_RESET);
426 + printk(KERN_INFO "found %d CF slots\n", pcmcia_cf_nr);
428 + gpio_free(GPIO_GUMSTIX_nPCE_2);
429 + gpio_free(GPIO_GUMSTIX_nPCE_1);
430 + gpio_free(GPIO_GUMSTIX_nPOE);
434 +#define SMC_IO_EXTENT 16
435 +#define BANK_SELECT 14
437 +static void __init verdex_pcmcia_pin_config(void)
439 + struct resource *res;
440 + void *network_controller_memory;
441 + struct platform_device *pdev = &verdex_smsc911x_device;
443 + printk(KERN_INFO "Initializing Gumstix verdex pcmcia\n");
445 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
447 + printk(KERN_ERR "no memory resource defined\n");
451 + res = request_mem_region(res->start, SMC_IO_EXTENT, "smc91x probe");
453 + printk(KERN_ERR "failed to request memory resource\n");
457 + // We check for the possibility of SMSC91c111 (reg base offset 0x300 from CS1 base)
458 + network_controller_memory = ioremap(res->start + 0x300, SMC_IO_EXTENT);
459 + if (network_controller_memory == NULL) {
460 + printk(KERN_ERR "failed to ioremap() registers\n");
464 + // Look for the special 91c111 value in the bank select register
465 + if((0xff00 & readw(network_controller_memory+BANK_SELECT)) == 0x3300) {
466 + printk(KERN_INFO "Detected netCF-vx board: pcmcia using older GPIO configuration\n");
467 + net_cf_vx_mode = 1;
469 + printk(KERN_INFO "Not netCF-vx board: pcmcia using newer GPIO configuration\n");
470 + net_cf_vx_mode = 0;
473 + iounmap(network_controller_memory);
475 + release_mem_region(res->start, SMC_IO_EXTENT);
478 + gumstix_count_cards(); // this can update pcmcia_cf_nr
480 + // If pcmcia_cf_nr is 1 then we do not have 2 CF slots
481 + // Note: logic sequence was altered from previous kernel revs
482 + // so that this works as intended now.
483 + if (pcmcia_cf_nr != 0)
485 + pxa2xx_mfp_config(ARRAY_AND_SIZE(gpio_ntschg_0));
488 + pxa2xx_mfp_config(gpio_prdy_nbsy_old, 1);
490 + pxa2xx_mfp_config(gpio_prdy_nbsy, 1);
493 + // Note: this reconfigures pin GPIO18 to be GPIO-IN so make
494 + // sure that this only gets done for the old dual slot board
495 + // since that pin is an active AF1 out-mode signal (RDY) on
496 + // newer boards and changing the pin mode on the newer boards
497 + // would result in memory corruption for the NIC (and hang during
499 + pxa2xx_mfp_config(ARRAY_AND_SIZE(gpio_ntschg_1));
502 + pxa2xx_mfp_config(ARRAY_AND_SIZE(gpio_nhw_init));
506 +int __init gumstix_get_cf_cards(void)
508 + return pcmcia_cf_nr;
510 +EXPORT_SYMBOL(gumstix_get_cf_cards);
512 +#ifdef CONFIG_MACH_GUMSTIX_VERDEX
513 +int __init gumstix_check_if_netCF_vx(void)
515 + return net_cf_vx_mode;
517 +EXPORT_SYMBOL(gumstix_check_if_netCF_vx);
522 +#if defined(CONFIG_FB_PXA_SHARP_LQ043_PSP) || defined(CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C)
523 +static void gumstix_lcd_backlight(int on_or_off)
526 + err = gpio_request(17, "LCD BACKLIGHT");
528 + //pr_warning("Gumstix Verdex: Failed to request LCD Backlight gpio\n");
533 + gpio_direction_input(17);
535 + GPCR(17) = GPIO_bit(17);
536 + gpio_direction_output(17, 0);
537 + GPCR(17) = GPIO_bit(17);
544 +#ifdef CONFIG_FB_PXA_ALPS_CDOLLAR
545 +static struct pxafb_mode_info gumstix_fb_mode = {
546 + .pixclock = 300000,
556 + .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
559 +static struct pxafb_mach_info gumstix_fb_info = {
560 + .modes = &gumstix_fb_mode,
562 + .lccr0 = LCCR0_Pas | LCCR0_Sngl | LCCR0_Color,
563 + .lccr3 = LCCR3_PixFlEdg,
565 +#elif defined(CONFIG_FB_PXA_SHARP_LQ043_PSP)
566 +static struct pxafb_mode_info gumstix_fb_mode = {
567 + .pixclock = 110000,
577 + .sync = 0, // Hsync and Vsync both active low
580 +static struct pxafb_mach_info gumstix_fb_info = {
581 + .modes = &gumstix_fb_mode,
583 + .lccr0 = LCCR0_Act | LCCR0_Sngl | LCCR0_Color,
584 + .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | (0 << 30),
585 + .pxafb_backlight_power = &gumstix_lcd_backlight,
587 +#elif defined(CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C)
588 +static struct pxafb_mode_info gumstix_fb_mode = {
589 + .pixclock = 108696, // 9.2MHz typical DOTCLK from datasheet
591 + .hsync_len = 41, // HLW from datasheet: 41 typ
592 + .left_margin = 4, // HBP - HLW from datasheet: 45 - 41 = 4
593 + .right_margin = 8, // HFP from datasheet: 8 typ
595 + .vsync_len = 10, // VLW from datasheet: 10 typ
596 + .upper_margin = 2, // VBP - VLW from datasheet: 12 - 10 = 2
597 + .lower_margin = 4, // VFP from datasheet: 4 typ
599 + .sync = 0, // Hsync and Vsync both active low
602 +static struct pxafb_mach_info gumstix_fb_info = {
603 + .modes = &gumstix_fb_mode,
605 + .lccr0 = LCCR0_Act | LCCR0_Sngl | LCCR0_Color,
606 + .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | (0 << 30),
607 + .pxafb_backlight_power = &gumstix_lcd_backlight,
611 +static struct platform_device verdex_audio_device = {
612 + .name = "pxa2xx-ac97",
616 +static struct platform_device *devices[] __initdata = {
617 + &verdex_audio_device,
620 +/* PXA27x OHCI controller setup */
621 +#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
622 +static int ohci_verdex_init(struct device *dev)
624 + // Turn on port 2 in host mode
625 + UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
627 + /* See drivers/usb/host/ohci-pxa27x.c for further details but
628 + ENABLE_PORT_ALL flag is equivalent to using this old sequence:
630 + ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE);
635 +static struct pxaohci_platform_data verdex_ohci_platform_data = {
636 + .port_mode = PMM_PERPORT_MODE,
637 + .flags = ENABLE_PORT_ALL,
638 + .init = ohci_verdex_init,
641 +static void __init verdex_ohci_init(void)
643 + pxa_set_ohci_info(&verdex_ohci_platform_data);
646 +static void __init verdex_ohci_init(void) {
647 + printk(KERN_INFO "Gumstix verdex host usb ohci is disabled\n");
652 +#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
653 +static struct pxamci_platform_data verdex_mci_platform_data;
655 +static int verdex_mci_init(struct device *dev, irq_handler_t detect_int,
658 + /* GPIO setup for MMC on the 120-pin connector is done in verdex_init.
659 + * There is no card detect on a uSD connector so no interrupt to register.
660 + * There is no WP detect GPIO line either.
666 +static struct pxamci_platform_data verdex_mci_platform_data = {
667 + .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
668 + .init = verdex_mci_init,
671 +static void __init verdex_mmc_init(void)
673 + pxa_set_mci_info(&verdex_mci_platform_data);
676 +static void __init verdex_mmc_init(void)
678 + printk(KERN_INFO "Gumstix verdex mmc disabled\n");
682 +#if defined(CONFIG_USB_GADGET_PXA2XX) || defined(CONFIG_USB_GADGET_PXA2XX_MODULE)
683 +static struct pxa2xx_udc_mach_info verdex_udc_info __initdata = {
684 + .gpio_vbus = GPIO35,
685 + .gpio_pullup = GPIO41,
688 +static void __init verdex_udc_init(void)
690 + pxa_set_udc_info(&verdex_udc_info);
693 +static void __init verdex_udc_init(void)
695 + printk(KERN_INFO "Gumstix verdex udc is disabled\n");
699 +#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
701 +#if defined(CONFIG_TOUCHSCREEN_TSC2003) || defined(CONFIG_TOUCHSCREEN_TSC2003_MODULE)
703 +#define VERDEX_GPIO_PENDOWN 16
705 +static int tsc2003_init_platform_hw(void)
710 +static void tsc2003_exit_platform_hw(void)
715 +static void tsc2003_clear_penirq(void)
720 +static int tsc2003_get_pendown_state(void)
722 + return !gpio_get_value(VERDEX_GPIO_PENDOWN);
725 +static struct tsc2007_platform_data tsc2003_config = {
727 + .x_plate_ohms = 100,
728 + .get_pendown_state = tsc2003_get_pendown_state,
729 + .clear_penirq = tsc2003_clear_penirq,
730 + .init_platform_hw = tsc2003_init_platform_hw,
731 + .exit_platform_hw = tsc2003_exit_platform_hw,
735 +static struct i2c_board_info __initdata verdex_i2c_board_info[] = {
736 +#if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE)
739 + I2C_BOARD_INFO("rtc-ds1307", 0x68),
742 +#if defined(CONFIG_TOUCHSCREEN_TSC2003) || defined(CONFIG_TOUCHSCREEN_TSC2003_MODULE)
744 + I2C_BOARD_INFO("tsc2003", 0x48),
745 + .platform_data = &tsc2003_config,
746 + .irq = IRQ_GPIO(VERDEX_GPIO_PENDOWN),
751 +static struct i2c_pxa_platform_data verdex_i2c_pwr_info = {
755 +static struct i2c_pxa_platform_data verdex_i2c_info = {
759 +static void __init verdex_i2c_init(void)
761 + printk(KERN_INFO "Initializing Gumstix verdex i2c\n");
763 +#if defined(CONFIG_TOUCHSCREEN_TSC2003) || defined(CONFIG_TOUCHSCREEN_TSC2003_MODULE)
764 + if ((gpio_request(VERDEX_GPIO_PENDOWN, "TSC2003_PENDOWN") == 0) &&
765 + (gpio_direction_input(VERDEX_GPIO_PENDOWN) == 0)) {
766 + gpio_export(VERDEX_GPIO_PENDOWN, 0);
768 + printk(KERN_ERR "could not obtain gpio for TSC2003_PENDOWN\n");
773 + i2c_register_board_info(0, verdex_i2c_board_info,
774 + ARRAY_SIZE(verdex_i2c_board_info));
775 + pxa_set_i2c_info(&verdex_i2c_info);
776 + pxa27x_set_i2c_power_info(&verdex_i2c_pwr_info);
779 +static inline void verdex_i2c_init(void) {}
782 +#if defined(CONFIG_PCMCIA_PXA2XX) || defined(CONFIG_PCMCIA_PXA2XX_MODULE)
783 +static void __init verdex_pcmcia_init(void)
785 + verdex_pcmcia_pin_config();
788 +static void __init verdex_pcmcia_init(void) {
789 + printk(KERN_INFO "Gumstix verdex pcmcia is disabled\n");
794 +static void __init verdex_init(void)
796 + pxa2xx_mfp_config(ARRAY_AND_SIZE(verdex_pin_config));
798 +#ifdef CONFIG_FB_PXA_SHARP_LQ043_PSP
799 + /* DISP must be always high while screen is on */
800 + gpio_direction_output(GPIO77, 0);
801 + GPSR(GPIO77) = GPIO_bit(GPIO77);
805 + verdex_ohci_init();
807 + verdex_init_smsc911x();
808 + verdex_pcmcia_init();
810 +#if defined(CONFIG_FB_PXA_ALPS_CDOLLAR) || defined(CONFIG_FB_PXA_SHARP_LQ043_PSP) || defined(CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C)
811 + printk(KERN_INFO "Initializing Gumstix verdex FB info\n");
812 + set_pxa_fb_info(&gumstix_fb_info);
814 + printk(KERN_INFO "Initializing Gumstix platform_add_devices\n");
815 + (void) platform_add_devices(devices, ARRAY_SIZE(devices));
818 +MACHINE_START(GUMSTIX, "Gumstix verdex")
819 + .boot_params = 0xa0000100, /* match u-boot bi_boot_params */
820 + .map_io = pxa_map_io,
821 + .init_irq = pxa27x_init_irq,
822 + .timer = &pxa_timer,
823 + .init_machine = verdex_init,
826 --- a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
827 +++ b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
829 #define GPIO54_nPCE_2 MFP_CFG_OUT(GPIO54, AF2, DRIVE_HIGH)
830 #define GPIO78_nPCE_2 MFP_CFG_OUT(GPIO78, AF1, DRIVE_HIGH)
831 #define GPIO87_nPCE_2 MFP_CFG_IN(GPIO87, AF1)
832 +#define GPIO105_nPCE_2 MFP_CFG_OUT(GPIO105, AF1, DRIVE_HIGH)
833 #define GPIO55_nPREG MFP_CFG_OUT(GPIO55, AF2, DRIVE_HIGH)
834 #define GPIO50_nPIOR MFP_CFG_OUT(GPIO50, AF2, DRIVE_HIGH)
835 #define GPIO51_nPIOW MFP_CFG_OUT(GPIO51, AF2, DRIVE_HIGH)