2 * linux/arch/arm/mach-pxa/gumstix.c
4 * Support for the Gumstix motherboards.
6 * Original Author: Craig Hughes
7 * Created: Feb 14, 2008
8 * Copyright: Craig Hughes
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
14 * Implemented based on lubbock.c by Nicolas Pitre and code from Craig
18 #include <linux/module.h>
19 #include <linux/kernel.h>
20 #include <linux/init.h>
21 #include <linux/platform_device.h>
22 #include <linux/interrupt.h>
23 #include <linux/mtd/mtd.h>
24 #include <linux/mtd/partitions.h>
26 #include <asm/setup.h>
27 #include <asm/memory.h>
28 #include <asm/mach-types.h>
29 #include <mach/hardware.h>
31 #include <asm/sizes.h>
33 #include <asm/mach/arch.h>
34 #include <asm/mach/map.h>
35 #include <asm/mach/irq.h>
36 #include <asm/mach/flash.h>
39 #include <mach/gumstix.h>
41 #include <mach/pxa-regs.h>
42 #include <mach/pxa2xx-regs.h>
43 #include <mach/pxa2xx-gpio.h>
47 static struct resource flash_resource
= {
50 .flags
= IORESOURCE_MEM
,
53 static struct mtd_partition gumstix_partitions
[] = {
58 .mask_flags
= MTD_WRITEABLE
/* force read-only */
61 .size
= MTDPART_SIZ_FULL
,
62 .offset
= MTDPART_OFS_APPEND
66 static struct flash_platform_data gumstix_flash_data
= {
67 .map_name
= "cfi_probe",
68 .parts
= gumstix_partitions
,
69 .nr_parts
= ARRAY_SIZE(gumstix_partitions
),
73 static struct platform_device gumstix_flash_device
= {
74 .name
= "pxa2xx-flash",
77 .platform_data
= &gumstix_flash_data
,
79 .resource
= &flash_resource
,
83 static struct platform_device
*devices
[] __initdata
= {
84 &gumstix_flash_device
,
88 static struct pxamci_platform_data gumstix_mci_platform_data
;
90 static int gumstix_mci_init(struct device
*dev
, irq_handler_t detect_int
,
93 pxa_gpio_mode(GPIO6_MMCCLK_MD
);
94 pxa_gpio_mode(GPIO53_MMCCLK_MD
);
95 pxa_gpio_mode(GPIO8_MMCCS0_MD
);
100 static struct pxamci_platform_data gumstix_mci_platform_data
= {
101 .ocr_mask
= MMC_VDD_32_33
|MMC_VDD_33_34
,
102 .init
= gumstix_mci_init
,
105 static void __init
gumstix_mmc_init(void)
107 pxa_set_mci_info(&gumstix_mci_platform_data
);
110 static void __init
gumstix_mmc_init(void)
112 printk(KERN_INFO
"Gumstix mmc disabled\n");
116 #ifdef CONFIG_USB_GADGET_PXA2XX
117 static struct pxa2xx_udc_mach_info gumstix_udc_info __initdata
= {
118 .gpio_vbus
= GPIO_GUMSTIX_USB_GPIOn
,
119 .gpio_pullup
= GPIO_GUMSTIX_USB_GPIOx
,
122 static void __init
gumstix_udc_init(void)
124 pxa_set_udc_info(&gumstix_udc_info
);
127 static void gumstix_udc_init(void)
129 printk(KERN_INFO
"Gumstix udc is disabled\n");
133 static void __init
gumstix_init(void)
137 (void) platform_add_devices(devices
, ARRAY_SIZE(devices
));
140 MACHINE_START(GUMSTIX
, "Gumstix")
141 .phys_io
= 0x40000000,
142 .boot_params
= 0xa0000100, /* match u-boot bi_boot_params */
143 .io_pg_offst
= (io_p2v(0x40000000) >> 18) & 0xfffc,
144 .map_io
= pxa_map_io
,
145 .init_irq
= pxa25x_init_irq
,
147 .init_machine
= gumstix_init
,