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 @@ -134,23 +134,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 @@ -51,7 +51,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>
104 +#include <linux/i2c/pxa-i2c.h>
105 +#include <linux/gpio.h>
106 +#include <linux/gpio-pxa.h>
108 +#include <asm/setup.h>
109 +#include <asm/memory.h>
110 +#include <asm/mach-types.h>
111 +#include <asm/irq.h>
112 +#include <asm/sizes.h>
115 +#include <asm/mach/arch.h>
116 +#include <asm/mach/map.h>
117 +#include <asm/mach/irq.h>
118 +#include <asm/mach/flash.h>
120 +#include <mach/mmc.h>
121 +#include <mach/udc.h>
122 +#include <mach/pxafb.h>
123 +#include <mach/ohci.h>
124 +#include <mach/pxa27x.h>
125 +#include <mach/pxa27x-udc.h>
126 +#include <mach/gpio.h>
128 +#include <mach/gumstix.h>
130 +#include "generic.h"
132 +#include <linux/delay.h>
134 +static struct resource flash_resource = {
135 + .start = 0x00000000,
137 + .flags = IORESOURCE_MEM,
140 +static struct mtd_partition gumstix_partitions[] = {
143 + .size = 0x00040000,
145 + .mask_flags = MTD_WRITEABLE /* force read-only */
148 + .size = 0x01ec0000,
149 + .offset = 0x00040000
152 + .size = 0x00100000,
153 + .offset = 0x01f00000
157 +static struct flash_platform_data gumstix_flash_data = {
158 + .map_name = "cfi_probe",
159 + .parts = gumstix_partitions,
160 + .nr_parts = ARRAY_SIZE(gumstix_partitions),
164 +static struct platform_device gumstix_flash_device = {
165 + .name = "pxa2xx-flash",
168 + .platform_data = &gumstix_flash_data,
170 + .resource = &flash_resource,
171 + .num_resources = 1,
174 +#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) \
175 + || defined(CONFIG_PCMCIA_PXA2XX) || defined(CONFIG_PCMCIA_PXA2XX_MODULE)
177 +#include <linux/smsc911x.h>
179 +static struct resource verdex_smsc911x_resources[] = {
181 + .name = "smsc911x-memory",
182 + .start = PXA_CS1_PHYS,
183 + .end = PXA_CS1_PHYS + 0x000fffff,
184 + .flags = IORESOURCE_MEM,
187 + .start = PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_ETH0),
188 + .end = PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_ETH0),
189 + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
193 +static struct smsc911x_platform_config verdex_smsc911x_config = {
194 + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
195 + .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
196 + .flags = SMSC911X_USE_16BIT | SMSC911X_SAVE_MAC_ADDRESS,
197 + .phy_interface = PHY_INTERFACE_MODE_MII,
200 +static struct platform_device verdex_smsc911x_device = {
201 + .name = "smsc911x",
203 + .num_resources = ARRAY_SIZE(verdex_smsc911x_resources),
204 + .resource = verdex_smsc911x_resources,
206 + .platform_data = &verdex_smsc911x_config,
211 +#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
212 +static void __init verdex_init_smsc911x(void)
215 + printk(KERN_INFO "Initializing Gumstix verdex smsc911x\n");
217 + if (gpio_request(GPIO_GUMSTIX_ETH0_RST, "SMSC911x_ETH0_RST") != 0) {
218 + printk(KERN_ERR "could not obtain gpio for SMSC911x_ETH0_RST\n");
219 + goto err_request_gpio_eth0_rst;
222 + if (gpio_request(GPIO_GUMSTIX_ETH0, "SMSC911x_ETH0_IRQ") != 0) {
223 + printk(KERN_ERR "could not obtain gpio for SMSC911x_ETH0_IRQ\n");
224 + goto err_request_gpio_eth0_irq;
227 + if (gpio_direction_output(GPIO_GUMSTIX_ETH0_RST, 0) != 0) {
228 + printk(KERN_ERR "could not set SMSC911x_ETH0_RST pin to output\n");
232 + gpio_set_value(GPIO_GUMSTIX_ETH0_RST, 0);
234 + msleep(500); // Hold RESET for at least 200ms
236 + gpio_set_value(GPIO_GUMSTIX_ETH0_RST, 1);
240 + if (gpio_direction_input(GPIO_GUMSTIX_ETH0) != 0) {
241 + printk(KERN_ERR "could not set SMSC911x_ETH0_IRQ pin to input\n");
245 + gpio_export(GPIO_GUMSTIX_ETH0, 0);
246 + platform_device_register(&verdex_smsc911x_device);
250 + gpio_free(GPIO_GUMSTIX_ETH0_RST);
252 +err_request_gpio_eth0_irq:
253 + gpio_free(GPIO_GUMSTIX_ETH0);
255 +err_request_gpio_eth0_rst:
260 +static void __init verdex_init_smsc911x(void) { return; }
263 +static unsigned long verdex_pin_config[] = {
292 + /* SDRAM and local bus */
326 +#ifdef CONFIG_FB_PXA_SHARP_LQ043_PSP
327 + /* DISP must be always high while screen is on */
328 + /* Done below in verdex_init */
334 +#if defined(CONFIG_PCMCIA_PXA2XX) || defined(CONFIG_PCMCIA_PXA2XX_MODULE)
336 +static unsigned long gpio_ntschg_0[] = {
337 + GPIO104_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_nCD_0_MD);
340 +static unsigned long gpio_ntschg_1[] = {
341 + GPIO18_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_nSTSCHG_1_MD);
342 + GPIO36_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_nCD_1_MD);
343 + GPIO27_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_PRDY_nBSY_1_MD);
346 +static unsigned long gpio_prdy_nbsy_old[] = {
347 + GPIO111_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_nSTSCHG_0_MD);
348 + GPIO109_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_PRDY_nBSY_0_OLD_MD);
351 +static unsigned long gpio_prdy_nbsy[] = {
352 + GPIO96_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_PRDY_nBSY_0_MD);
355 +static unsigned long gpio_nhw_init[] = {
356 + GPIO48_nPOE, // pxa_gpio_mode(GPIO_GUMSTIX_nPOE_MD);
357 + GPIO102_nPCE_1, // pxa_gpio_mode(GPIO_GUMSTIX_nPCE_1_MD);
358 + GPIO105_nPCE_2, // pxa_gpio_mode(GPIO_GUMSTIX_nPCE_2_MD);
359 + GPIO104_GPIO, // pxa_gpio_mode(GPIO_GUMSTIX_nCD_0_MD);
361 + GPIO49_nPWE, // pxa_gpio_mode(GPIO_GUMSTIX_nPWE_MD);
362 + GPIO50_nPIOR, // pxa_gpio_mode(GPIO_GUMSTIX_nPIOR_MD);
363 + GPIO51_nPIOW, // pxa_gpio_mode(GPIO_GUMSTIX_nPIOW_MD);
364 + GPIO79_PSKTSEL, // pxa_gpio_mode(GPIO_GUMSTIX_pSKTSEL_MD);
365 + GPIO55_nPREG, // pxa_gpio_mode(GPIO_GUMSTIX_nPREG_MD);
366 + GPIO56_nPWAIT, // pxa_gpio_mode(GPIO_GUMSTIX_nPWAIT_MD);
367 + GPIO57_nIOIS16, // pxa_gpio_mode(GPIO_GUMSTIX_nIOIS16_MD);
370 +static int net_cf_vx_mode = 0;
371 +static int pcmcia_cf_nr = 2;
373 +inline void __init gumstix_pcmcia_cpld_clk(void)
375 + gpio_set_value(GPIO_GUMSTIX_nPOE, 0);
376 + gpio_set_value(GPIO_GUMSTIX_nPOE, 1);
379 +inline unsigned char __init gumstix_pcmcia_cpld_read_bits(int bits)
381 + unsigned char result = 0;
382 + unsigned int shift = 0;
385 + result |= !!(gpio_get_value(GPIO_GUMSTIX_nCD_0) & GPIO_bit(GPIO_GUMSTIX_nCD_0)) << shift;
387 + gumstix_pcmcia_cpld_clk();
389 + printk("CPLD responded with: %02x\n",result);
393 +/* We use the CPLD on the CF-CF card to read a value from a shift register. If we can read that
394 + * magic sequence, then we have 2 CF cards; otherwise we assume just one
395 + * The CPLD will send the value of the shift register on GPIO11 (the CD line for slot 0)
396 + * when RESET is held in reset. We use GPIO48 (nPOE) as a clock signal,
397 + * GPIO52/53 (card enable for both cards) to control read/write to the shift register
399 +static void __init gumstix_count_cards(void)
401 + if ((gpio_request(GPIO_GUMSTIX_nPOE, "GPIO_GUMSTIX_nPOE") == 0) &&
402 + (gpio_direction_output(GPIO_GUMSTIX_nPOE, 1) == 0))
403 + gpio_export(GPIO_GUMSTIX_nPOE, 0);
405 + printk(KERN_ERR "could not obtain gpio for GPIO_GUMSTIX_nPOE\n");
407 + if ((gpio_request(GPIO_GUMSTIX_nPCE_1, "GPIO_GUMSTIX_nPCE_1") == 0) &&
408 + (gpio_direction_output(GPIO_GUMSTIX_nPCE_1, 1) == 0))
409 + gpio_export(GPIO_GUMSTIX_nPCE_1, 0);
411 + printk(KERN_ERR "could not obtain gpio for GPIO_GUMSTIX_nPCE_1\n");
413 + if ((gpio_request(GPIO_GUMSTIX_nPCE_2, "GPIO_GUMSTIX_nPCE_2") == 0) &&
414 + (gpio_direction_output(GPIO_GUMSTIX_nPCE_2, 1) == 0))
415 + gpio_export(GPIO_GUMSTIX_nPCE_2, 0);
417 + printk(KERN_ERR "could not obtain gpio for GPIO_GUMSTIX_nPCE_2\n");
419 + if ((gpio_request(GPIO_GUMSTIX_nCD_0, "GPIO_GUMSTIX_nCD_0") == 0) &&
420 + (gpio_direction_input(GPIO_GUMSTIX_nCD_0) == 0))
421 + gpio_export(GPIO_GUMSTIX_nCD_0, 0);
423 + printk(KERN_ERR "could not obtain gpio for GPIO_GUMSTIX_nCD_0\n");
425 + if (net_cf_vx_mode) {
426 + if ((gpio_request(GPIO_GUMSTIX_CF_OLD_RESET, "GPIO_GUMSTIX_CF_OLD_RESET") == 0) &&
427 + (gpio_direction_output(GPIO_GUMSTIX_CF_OLD_RESET, 1) == 0)) {
428 + gpio_export(GPIO_GUMSTIX_CF_OLD_RESET, 0);
430 + printk(KERN_ERR "could not obtain gpio for GPIO_GUMSTIX_CF_OLD_RESET\n");
433 + if ((gpio_request(GPIO_GUMSTIX_CF_RESET, "GPIO_GUMSTIX_CF_RESET") == 0) &&
434 + (gpio_direction_output(GPIO_GUMSTIX_CF_RESET, 1) == 0)) {
435 + gpio_export(GPIO_GUMSTIX_CF_RESET, 0);
437 + printk(KERN_ERR "could not obtain gpio for GPIO_GUMSTIX_CF_RESET\n");
441 + // Setup the shift register
442 + gpio_set_value(GPIO_GUMSTIX_nPCE_1, 1);
443 + gpio_set_value(GPIO_GUMSTIX_nPCE_2, 0);
445 + // Tick the clock to program the shift register
446 + gumstix_pcmcia_cpld_clk();
448 + // Now set shift register into read mode
449 + gpio_set_value(GPIO_GUMSTIX_nPCE_1, 0);
450 + gpio_set_value(GPIO_GUMSTIX_nPCE_2, 1);
452 + // We can read the bits now -- 0xC2 means "Dual compact flash"
453 + if(gumstix_pcmcia_cpld_read_bits(8) != 0xC2)
455 + // We do not have 2 CF slots
461 + if (net_cf_vx_mode) {
462 + gpio_set_value(GPIO_GUMSTIX_CF_OLD_RESET, 0);
463 + gpio_free(GPIO_GUMSTIX_CF_OLD_RESET);
465 + gpio_set_value(GPIO_GUMSTIX_CF_RESET, 0);
466 + gpio_free(GPIO_GUMSTIX_CF_RESET);
469 + printk(KERN_INFO "found %d CF slots\n", pcmcia_cf_nr);
471 + gpio_free(GPIO_GUMSTIX_nPCE_2);
472 + gpio_free(GPIO_GUMSTIX_nPCE_1);
473 + gpio_free(GPIO_GUMSTIX_nPOE);
477 +#define SMC_IO_EXTENT 16
478 +#define BANK_SELECT 14
480 +static void __init verdex_pcmcia_pin_config(void)
482 + struct resource *res;
483 + void *network_controller_memory;
484 + struct platform_device *pdev = &verdex_smsc911x_device;
486 + printk(KERN_INFO "Initializing Gumstix verdex pcmcia\n");
488 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
490 + printk(KERN_ERR "no memory resource defined\n");
494 + res = request_mem_region(res->start, SMC_IO_EXTENT, "smc91x probe");
496 + printk(KERN_ERR "failed to request memory resource\n");
500 + // We check for the possibility of SMSC91c111 (reg base offset 0x300 from CS1 base)
501 + network_controller_memory = ioremap(res->start + 0x300, SMC_IO_EXTENT);
502 + if (network_controller_memory == NULL) {
503 + printk(KERN_ERR "failed to ioremap() registers\n");
507 + // Look for the special 91c111 value in the bank select register
508 + if((0xff00 & readw(network_controller_memory+BANK_SELECT)) == 0x3300) {
509 + printk(KERN_INFO "Detected netCF-vx board: pcmcia using older GPIO configuration\n");
510 + net_cf_vx_mode = 1;
512 + printk(KERN_INFO "Not netCF-vx board: pcmcia using newer GPIO configuration\n");
513 + net_cf_vx_mode = 0;
516 + iounmap(network_controller_memory);
518 + release_mem_region(res->start, SMC_IO_EXTENT);
521 + gumstix_count_cards(); // this can update pcmcia_cf_nr
523 + // If pcmcia_cf_nr is 1 then we do not have 2 CF slots
524 + // Note: logic sequence was altered from previous kernel revs
525 + // so that this works as intended now.
526 + if (pcmcia_cf_nr != 0)
528 + pxa2xx_mfp_config(ARRAY_AND_SIZE(gpio_ntschg_0));
531 + pxa2xx_mfp_config(gpio_prdy_nbsy_old, 1);
533 + pxa2xx_mfp_config(gpio_prdy_nbsy, 1);
536 + // Note: this reconfigures pin GPIO18 to be GPIO-IN so make
537 + // sure that this only gets done for the old dual slot board
538 + // since that pin is an active AF1 out-mode signal (RDY) on
539 + // newer boards and changing the pin mode on the newer boards
540 + // would result in memory corruption for the NIC (and hang during
542 + pxa2xx_mfp_config(ARRAY_AND_SIZE(gpio_ntschg_1));
545 + pxa2xx_mfp_config(ARRAY_AND_SIZE(gpio_nhw_init));
549 +int __init gumstix_get_cf_cards(void)
551 + return pcmcia_cf_nr;
553 +EXPORT_SYMBOL(gumstix_get_cf_cards);
555 +#ifdef CONFIG_MACH_GUMSTIX_VERDEX
556 +int __init gumstix_check_if_netCF_vx(void)
558 + return net_cf_vx_mode;
560 +EXPORT_SYMBOL(gumstix_check_if_netCF_vx);
565 +#if defined(CONFIG_FB_PXA_SHARP_LQ043_PSP) || defined(CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C)
566 +static void gumstix_lcd_backlight(int on_or_off)
569 + err = gpio_request(17, "LCD BACKLIGHT");
571 + //pr_warning("Gumstix Verdex: Failed to request LCD Backlight gpio\n");
576 + gpio_direction_input(17);
578 + gpio_set_value(17, 0);
579 + gpio_direction_output(17, 0);
580 + gpio_set_value(17, 0);
587 +#ifdef CONFIG_FB_PXA_ALPS_CDOLLAR
588 +static struct pxafb_mode_info gumstix_fb_mode = {
589 + .pixclock = 300000,
599 + .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
602 +static struct pxafb_mach_info gumstix_fb_info = {
603 + .modes = &gumstix_fb_mode,
605 + .lccr0 = LCCR0_Pas | LCCR0_Sngl | LCCR0_Color,
606 + .lccr3 = LCCR3_PixFlEdg,
608 +#elif defined(CONFIG_FB_PXA_SHARP_LQ043_PSP)
609 +static struct pxafb_mode_info gumstix_fb_mode = {
610 + .pixclock = 110000,
620 + .sync = 0, // Hsync and Vsync both active low
623 +static struct pxafb_mach_info gumstix_fb_info = {
624 + .modes = &gumstix_fb_mode,
626 + .lccr0 = LCCR0_Act | LCCR0_Sngl | LCCR0_Color,
627 + .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | (0 << 30),
628 + .pxafb_backlight_power = &gumstix_lcd_backlight,
630 +#elif defined(CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C)
631 +static struct pxafb_mode_info gumstix_fb_mode = {
632 + .pixclock = 108696, // 9.2MHz typical DOTCLK from datasheet
634 + .hsync_len = 41, // HLW from datasheet: 41 typ
635 + .left_margin = 4, // HBP - HLW from datasheet: 45 - 41 = 4
636 + .right_margin = 8, // HFP from datasheet: 8 typ
638 + .vsync_len = 10, // VLW from datasheet: 10 typ
639 + .upper_margin = 2, // VBP - VLW from datasheet: 12 - 10 = 2
640 + .lower_margin = 4, // VFP from datasheet: 4 typ
642 + .sync = 0, // Hsync and Vsync both active low
645 +static struct pxafb_mach_info gumstix_fb_info = {
646 + .modes = &gumstix_fb_mode,
648 + .lccr0 = LCCR0_Act | LCCR0_Sngl | LCCR0_Color,
649 + .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | (0 << 30),
650 + .pxafb_backlight_power = &gumstix_lcd_backlight,
654 +static struct platform_device verdex_audio_device = {
655 + .name = "pxa2xx-ac97",
659 +static struct platform_device *devices[] __initdata = {
660 + &gumstix_flash_device,
661 + &verdex_audio_device,
664 +/* PXA27x OHCI controller setup */
665 +#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
666 +static int ohci_verdex_init(struct device *dev)
668 + // Turn on port 2 in host mode
669 + UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
671 + /* See drivers/usb/host/ohci-pxa27x.c for further details but
672 + ENABLE_PORT_ALL flag is equivalent to using this old sequence:
674 + ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE);
679 +static struct pxaohci_platform_data verdex_ohci_platform_data = {
680 + .port_mode = PMM_PERPORT_MODE,
681 + .flags = ENABLE_PORT_ALL,
682 + .init = ohci_verdex_init,
685 +static void __init verdex_ohci_init(void)
687 + pxa_set_ohci_info(&verdex_ohci_platform_data);
690 +static void __init verdex_ohci_init(void) {
691 + printk(KERN_INFO "Gumstix verdex host usb ohci is disabled\n");
696 +#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
697 +static struct pxamci_platform_data verdex_mci_platform_data;
699 +static int verdex_mci_init(struct device *dev, irq_handler_t detect_int,
702 + /* GPIO setup for MMC on the 120-pin connector is done in verdex_init.
703 + * There is no card detect on a uSD connector so no interrupt to
704 + * register. There is no WP detect GPIO line either.
710 +static struct pxamci_platform_data verdex_mci_platform_data = {
711 + .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
712 + .init = verdex_mci_init,
713 + .gpio_card_detect = -1,
714 + .gpio_card_ro = -1,
718 +static void __init verdex_mmc_init(void)
720 + pxa_set_mci_info(&verdex_mci_platform_data);
723 +static void __init verdex_mmc_init(void)
725 + printk(KERN_INFO "Gumstix verdex mmc disabled\n");
729 +#if defined(CONFIG_USB_GADGET_PXA2XX) || defined(CONFIG_USB_GADGET_PXA2XX_MODULE)
730 +static struct pxa2xx_udc_mach_info verdex_udc_info __initdata = {
731 + .gpio_vbus = GPIO35,
732 + .gpio_pullup = GPIO41,
735 +static void __init verdex_udc_init(void)
737 + pxa_set_udc_info(&verdex_udc_info);
740 +static void __init verdex_udc_init(void)
742 + printk(KERN_INFO "Gumstix verdex udc is disabled\n");
746 +#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
748 +#if defined(CONFIG_TOUCHSCREEN_TSC2003) || defined(CONFIG_TOUCHSCREEN_TSC2003_MODULE)
750 +#define VERDEX_GPIO_PENDOWN 16
752 +static int tsc2003_init_platform_hw(void)
757 +static void tsc2003_exit_platform_hw(void)
762 +static void tsc2003_clear_penirq(void)
767 +static int tsc2003_get_pendown_state(void)
769 + return !gpio_get_value(VERDEX_GPIO_PENDOWN);
772 +static struct tsc2007_platform_data tsc2003_config = {
774 + .x_plate_ohms = 100,
775 + .get_pendown_state = tsc2003_get_pendown_state,
776 + .clear_penirq = tsc2003_clear_penirq,
777 + .init_platform_hw = tsc2003_init_platform_hw,
778 + .exit_platform_hw = tsc2003_exit_platform_hw,
782 +static struct i2c_board_info __initdata verdex_i2c_board_info[] = {
783 +#if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE)
785 + I2C_BOARD_INFO("rtc-ds1307", 0x68),
788 +#if defined(CONFIG_TOUCHSCREEN_TSC2003) || defined(CONFIG_TOUCHSCREEN_TSC2003_MODULE)
790 + I2C_BOARD_INFO("tsc2003", 0x48),
791 + .platform_data = &tsc2003_config,
792 + .irq = IRQ_GPIO(VERDEX_GPIO_PENDOWN),
797 +static struct i2c_pxa_platform_data verdex_i2c_pwr_info = {
801 +static struct i2c_pxa_platform_data verdex_i2c_info = {
805 +static void __init verdex_i2c_init(void)
807 + printk(KERN_INFO "Initializing Gumstix verdex i2c\n");
809 +#if defined(CONFIG_TOUCHSCREEN_TSC2003) || defined(CONFIG_TOUCHSCREEN_TSC2003_MODULE)
810 + if ((gpio_request(VERDEX_GPIO_PENDOWN, "TSC2003_PENDOWN") == 0) &&
811 + (gpio_direction_input(VERDEX_GPIO_PENDOWN) == 0)) {
812 + gpio_export(VERDEX_GPIO_PENDOWN, 0);
814 + printk(KERN_ERR "could not obtain gpio for TSC2003_PENDOWN\n");
819 + i2c_register_board_info(0, verdex_i2c_board_info,
820 + ARRAY_SIZE(verdex_i2c_board_info));
821 + pxa_set_i2c_info(&verdex_i2c_info);
822 + pxa27x_set_i2c_power_info(&verdex_i2c_pwr_info);
825 +static inline void verdex_i2c_init(void) {}
828 +#if defined(CONFIG_PCMCIA_PXA2XX) || defined(CONFIG_PCMCIA_PXA2XX_MODULE)
829 +static void __init verdex_pcmcia_init(void)
831 + verdex_pcmcia_pin_config();
834 +static void __init verdex_pcmcia_init(void) {
835 + printk(KERN_INFO "Gumstix verdex pcmcia is disabled\n");
840 +static void __init verdex_init(void)
842 + pxa2xx_mfp_config(ARRAY_AND_SIZE(verdex_pin_config));
844 +#ifdef CONFIG_FB_PXA_SHARP_LQ043_PSP
845 + /* DISP must be always high while screen is on */
846 + gpio_direction_output(GPIO77, 0);
847 + gpio_set_value(GPIO77, 1);
851 + verdex_ohci_init();
853 + verdex_init_smsc911x();
854 + verdex_pcmcia_init();
856 +#if defined(CONFIG_FB_PXA_ALPS_CDOLLAR) || defined(CONFIG_FB_PXA_SHARP_LQ043_PSP) || defined(CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C)
857 + printk(KERN_INFO "Initializing Gumstix verdex FB info\n");
858 + set_pxa_fb_info(&gumstix_fb_info);
860 + printk(KERN_INFO "Initializing Gumstix platform_add_devices\n");
861 + (void) platform_add_devices(devices, ARRAY_SIZE(devices));
864 +MACHINE_START(GUMSTIX, "Gumstix verdex")
865 + .atag_offset = 0x100, /* match u-boot bi_boot_params */
866 + .map_io = pxa27x_map_io,
867 + .init_irq = pxa27x_init_irq,
868 + .handle_irq = pxa27x_handle_irq,
869 + .timer = &pxa_timer,
870 + .init_machine = verdex_init,
871 + .restart = pxa_restart,
873 --- a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
874 +++ b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
876 #define GPIO54_nPCE_2 MFP_CFG_OUT(GPIO54, AF2, DRIVE_HIGH)
877 #define GPIO78_nPCE_2 MFP_CFG_OUT(GPIO78, AF1, DRIVE_HIGH)
878 #define GPIO87_nPCE_2 MFP_CFG_IN(GPIO87, AF1)
879 +#define GPIO105_nPCE_2 MFP_CFG_OUT(GPIO105, AF1, DRIVE_HIGH)
880 #define GPIO55_nPREG MFP_CFG_OUT(GPIO55, AF2, DRIVE_HIGH)
881 #define GPIO50_nPIOR MFP_CFG_OUT(GPIO50, AF2, DRIVE_HIGH)
882 #define GPIO51_nPIOW MFP_CFG_OUT(GPIO51, AF2, DRIVE_HIGH)