ACPICA: Add support for zero-length buffer-to-string conversions
[linux-2.6/mini2440.git] / arch / arm / mach-pxa / gumstix.c
blobc0092472fa589761d4d6afc281bf9b4c6c4abac7
1 /*
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
15 * Hughes
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>
30 #include <asm/irq.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 <mach/mmc.h>
38 #include <mach/udc.h>
39 #include <mach/gumstix.h>
41 #include <mach/pxa-regs.h>
42 #include <mach/pxa2xx-regs.h>
43 #include <mach/pxa2xx-gpio.h>
45 #include "generic.h"
47 static struct resource flash_resource = {
48 .start = 0x00000000,
49 .end = SZ_64M - 1,
50 .flags = IORESOURCE_MEM,
53 static struct mtd_partition gumstix_partitions[] = {
55 .name = "Bootloader",
56 .size = 0x00040000,
57 .offset = 0,
58 .mask_flags = MTD_WRITEABLE /* force read-only */
59 } , {
60 .name = "rootfs",
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),
70 .width = 2,
73 static struct platform_device gumstix_flash_device = {
74 .name = "pxa2xx-flash",
75 .id = 0,
76 .dev = {
77 .platform_data = &gumstix_flash_data,
79 .resource = &flash_resource,
80 .num_resources = 1,
83 static struct platform_device *devices[] __initdata = {
84 &gumstix_flash_device,
87 #ifdef CONFIG_MMC_PXA
88 static struct pxamci_platform_data gumstix_mci_platform_data;
90 static int gumstix_mci_init(struct device *dev, irq_handler_t detect_int,
91 void *data)
93 pxa_gpio_mode(GPIO6_MMCCLK_MD);
94 pxa_gpio_mode(GPIO53_MMCCLK_MD);
95 pxa_gpio_mode(GPIO8_MMCCS0_MD);
97 return 0;
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);
109 #else
110 static void __init gumstix_mmc_init(void)
112 printk(KERN_INFO "Gumstix mmc disabled\n");
114 #endif
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);
126 #else
127 static void gumstix_udc_init(void)
129 printk(KERN_INFO "Gumstix udc is disabled\n");
131 #endif
133 static void __init gumstix_init(void)
135 gumstix_udc_init();
136 gumstix_mmc_init();
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,
146 .timer = &pxa_timer,
147 .init_machine = gumstix_init,
148 MACHINE_END