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 <asm/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>
37 #include <asm/arch/mmc.h>
38 #include <asm/arch/udc.h>
39 #include <asm/arch/gumstix.h>
41 #include <asm/arch/pxa-regs.h>
42 #include <asm/arch/pxa2xx-regs.h>
46 static struct resource flash_resource = {
49 .flags = IORESOURCE_MEM,
52 static struct mtd_partition gumstix_partitions[] = {
57 .mask_flags = MTD_WRITEABLE /* force read-only */
60 .size = MTDPART_SIZ_FULL,
61 .offset = MTDPART_OFS_APPEND
65 static struct flash_platform_data gumstix_flash_data = {
66 .map_name = "cfi_probe",
67 .parts = gumstix_partitions,
68 .nr_parts = ARRAY_SIZE(gumstix_partitions),
72 static struct platform_device gumstix_flash_device = {
73 .name = "pxa2xx-flash",
76 .platform_data = &gumstix_flash_data,
78 .resource = &flash_resource,
82 static struct platform_device *devices[] __initdata = {
83 &gumstix_flash_device,
87 static struct pxamci_platform_data gumstix_mci_platform_data;
89 static int gumstix_mci_init(struct device *dev, irq_handler_t detect_int,
92 pxa_gpio_mode(GPIO6_MMCCLK_MD);
93 pxa_gpio_mode(GPIO53_MMCCLK_MD);
94 pxa_gpio_mode(GPIO8_MMCCS0_MD);
99 static struct pxamci_platform_data gumstix_mci_platform_data = {
100 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
101 .init = gumstix_mci_init,
104 static void __init gumstix_mmc_init(void)
106 pxa_set_mci_info(&gumstix_mci_platform_data);
109 static void __init gumstix_mmc_init(void)
111 printk(KERN_INFO "Gumstix mmc disabled\n");
115 #ifdef CONFIG_USB_GADGET_PXA2XX
116 static struct pxa2xx_udc_mach_info gumstix_udc_info __initdata = {
117 .gpio_vbus = GPIO_GUMSTIX_USB_GPIOn,
118 .gpio_pullup = GPIO_GUMSTIX_USB_GPIOx,
121 static void __init gumstix_udc_init(void)
123 pxa_set_udc_info(&gumstix_udc_info);
126 static void gumstix_udc_init(void)
128 printk(KERN_INFO "Gumstix udc is disabled\n");
132 static void __init gumstix_init(void)
136 (void) platform_add_devices(devices, ARRAY_SIZE(devices));
139 MACHINE_START(GUMSTIX, "Gumstix")
140 .phys_io = 0x40000000,
141 .boot_params = 0xa0000100, /* match u-boot bi_boot_params */
142 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
143 .map_io = pxa_map_io,
144 .init_irq = pxa25x_init_irq,
146 .init_machine = gumstix_init,