2 * linux/arch/arm/mach-pxa/colibri-pxa270.c
4 * Support for Toradex PXA270 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 <linux/gpio.h>
24 #include <asm/mach-types.h>
25 #include <mach/hardware.h>
27 #include <asm/sizes.h>
28 #include <asm/mach/arch.h>
29 #include <asm/mach/map.h>
30 #include <asm/mach/irq.h>
31 #include <asm/mach/flash.h>
33 #include <mach/pxa27x.h>
34 #include <mach/colibri.h>
42 static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
43 GPIO78_nCS_2, /* Ethernet CS */
44 GPIO114_GPIO, /* Ethernet IRQ */
50 static struct mtd_partition colibri_partitions[] = {
55 .mask_flags = MTD_WRITEABLE /* force read-only */
64 .size = MTDPART_SIZ_FULL,
69 static struct physmap_flash_data colibri_flash_data[] = {
71 .width = 4, /* bankwidth in bytes */
72 .parts = colibri_partitions,
73 .nr_parts = ARRAY_SIZE(colibri_partitions)
77 static struct resource colibri_pxa270_flash_resource = {
78 .start = PXA_CS0_PHYS,
79 .end = PXA_CS0_PHYS + SZ_32M - 1,
80 .flags = IORESOURCE_MEM,
83 static struct platform_device colibri_pxa270_flash_device = {
84 .name = "physmap-flash",
87 .platform_data = colibri_flash_data,
89 .resource = &colibri_pxa270_flash_resource,
96 #if defined(CONFIG_DM9000)
97 static struct resource dm9000_resources[] = {
99 .start = COLIBRI_PXA270_ETH_PHYS,
100 .end = COLIBRI_PXA270_ETH_PHYS + 3,
101 .flags = IORESOURCE_MEM,
104 .start = COLIBRI_PXA270_ETH_PHYS + 4,
105 .end = COLIBRI_PXA270_ETH_PHYS + 4 + 500,
106 .flags = IORESOURCE_MEM,
109 .start = COLIBRI_PXA270_ETH_IRQ,
110 .end = COLIBRI_PXA270_ETH_IRQ,
111 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
115 static struct platform_device dm9000_device = {
118 .num_resources = ARRAY_SIZE(dm9000_resources),
119 .resource = dm9000_resources,
121 #endif /* CONFIG_DM9000 */
123 static struct platform_device *colibri_pxa270_devices[] __initdata = {
124 &colibri_pxa270_flash_device,
125 #if defined(CONFIG_DM9000)
130 static void __init colibri_pxa270_init(void)
132 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config));
133 platform_add_devices(ARRAY_AND_SIZE(colibri_pxa270_devices));
136 MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
137 .phys_io = 0x40000000,
138 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
139 .boot_params = COLIBRI_SDRAM_BASE + 0x100,
140 .init_machine = colibri_pxa270_init,
141 .map_io = pxa_map_io,
142 .init_irq = pxa27x_init_irq,