2 * linux/arch/arm/mach-pxa/colibri.c
4 * Support for Toradex PXA27x based Colibri module
5 * Daniel Mack <daniel@caiaq.de>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #include <linux/init.h>
13 #include <linux/kernel.h>
14 #include <linux/platform_device.h>
15 #include <linux/sysdev.h>
16 #include <linux/interrupt.h>
17 #include <linux/bitops.h>
18 #include <linux/ioport.h>
19 #include <linux/delay.h>
20 #include <linux/mtd/mtd.h>
21 #include <linux/mtd/partitions.h>
22 #include <linux/mtd/physmap.h>
23 #include <asm/mach-types.h>
24 #include <asm/arch/hardware.h>
26 #include <asm/sizes.h>
27 #include <asm/mach/arch.h>
28 #include <asm/mach/map.h>
29 #include <asm/mach/irq.h>
30 #include <asm/mach/flash.h>
31 #include <asm/arch/pxa-regs.h>
32 #include <asm/arch/pxa2xx-gpio.h>
33 #include <asm/arch/colibri.h>
41 static struct mtd_partition colibri_partitions[] = {
46 .mask_flags = MTD_WRITEABLE /* force read-only */
55 .size = MTDPART_SIZ_FULL,
60 static struct physmap_flash_data colibri_flash_data[] = {
62 .width = 4, /* bankwidth in bytes */
63 .parts = colibri_partitions,
64 .nr_parts = ARRAY_SIZE(colibri_partitions)
68 static struct resource flash_resource = {
69 .start = PXA_CS0_PHYS,
70 .end = PXA_CS0_PHYS + SZ_32M - 1,
71 .flags = IORESOURCE_MEM,
74 static struct platform_device flash_device = {
75 .name = "physmap-flash",
78 .platform_data = colibri_flash_data,
80 .resource = &flash_resource,
87 static struct resource dm9000_resources[] = {
89 .start = COLIBRI_ETH_PHYS,
90 .end = COLIBRI_ETH_PHYS + 3,
91 .flags = IORESOURCE_MEM,
94 .start = COLIBRI_ETH_PHYS + 4,
95 .end = COLIBRI_ETH_PHYS + 4 + 500,
96 .flags = IORESOURCE_MEM,
99 .start = COLIBRI_ETH_IRQ,
100 .end = COLIBRI_ETH_IRQ,
101 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
105 static struct platform_device dm9000_device = {
108 .num_resources = ARRAY_SIZE(dm9000_resources),
109 .resource = dm9000_resources,
112 static struct platform_device *colibri_devices[] __initdata = {
117 static void __init colibri_init(void)
120 pxa_gpio_mode(GPIO78_nCS_2_MD);
121 pxa_gpio_mode(GPIO_DM9000 | GPIO_IN);
123 platform_add_devices(colibri_devices, ARRAY_SIZE(colibri_devices));
126 MACHINE_START(COLIBRI, "Toradex Colibri PXA27x")
127 .phys_io = 0x40000000,
128 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
129 .boot_params = COLIBRI_SDRAM_BASE + 0x100,
130 .init_machine = colibri_init,
131 .map_io = pxa_map_io,
132 .init_irq = pxa27x_init_irq,