2 * linux/arch/arm/mach-pxa/colibri-pxa270.c
4 * Support for Toradex PXA270 based Colibri module
5 * Daniel Mack <daniel@caiaq.de>
6 * Marek Vasut <marek.vasut@gmail.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <linux/init.h>
14 #include <linux/kernel.h>
15 #include <linux/platform_device.h>
16 #include <linux/sysdev.h>
17 #include <linux/interrupt.h>
18 #include <linux/bitops.h>
19 #include <linux/ioport.h>
20 #include <linux/delay.h>
21 #include <linux/mtd/mtd.h>
22 #include <linux/mtd/partitions.h>
23 #include <linux/mtd/physmap.h>
24 #include <linux/gpio.h>
25 #include <asm/mach-types.h>
26 #include <mach/hardware.h>
28 #include <asm/sizes.h>
29 #include <asm/mach/arch.h>
30 #include <asm/mach/map.h>
31 #include <asm/mach/irq.h>
32 #include <asm/mach/flash.h>
34 #include <mach/pxa27x.h>
35 #include <mach/colibri.h>
41 /******************************************************************************
43 ******************************************************************************/
44 static mfp_cfg_t colibri_pxa270_pin_config
[] __initdata
= {
46 GPIO78_nCS_2
, /* Ethernet CS */
47 GPIO114_GPIO
, /* Ethernet IRQ */
56 GPIO0_GPIO
, /* SD detect */
63 /******************************************************************************
65 ******************************************************************************/
66 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
67 static struct mtd_partition colibri_partitions
[] = {
72 .mask_flags
= MTD_WRITEABLE
/* force read-only */
81 .size
= MTDPART_SIZ_FULL
,
86 static struct physmap_flash_data colibri_flash_data
[] = {
88 .width
= 4, /* bankwidth in bytes */
89 .parts
= colibri_partitions
,
90 .nr_parts
= ARRAY_SIZE(colibri_partitions
)
94 static struct resource colibri_pxa270_flash_resource
= {
95 .start
= PXA_CS0_PHYS
,
96 .end
= PXA_CS0_PHYS
+ SZ_32M
- 1,
97 .flags
= IORESOURCE_MEM
,
100 static struct platform_device colibri_pxa270_flash_device
= {
101 .name
= "physmap-flash",
104 .platform_data
= colibri_flash_data
,
106 .resource
= &colibri_pxa270_flash_resource
,
110 static void __init
colibri_pxa270_nor_init(void)
112 platform_device_register(&colibri_pxa270_flash_device
);
115 static inline void colibri_pxa270_nor_init(void) {}
118 /******************************************************************************
120 ******************************************************************************/
121 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
122 static struct resource colibri_pxa270_dm9000_resources
[] = {
124 .start
= PXA_CS2_PHYS
,
125 .end
= PXA_CS2_PHYS
+ 3,
126 .flags
= IORESOURCE_MEM
,
129 .start
= PXA_CS2_PHYS
+ 4,
130 .end
= PXA_CS2_PHYS
+ 4 + 500,
131 .flags
= IORESOURCE_MEM
,
134 .start
= gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ
),
135 .end
= gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ
),
136 .flags
= IORESOURCE_IRQ
| IRQF_TRIGGER_RISING
,
140 static struct platform_device colibri_pxa270_dm9000_device
= {
143 .num_resources
= ARRAY_SIZE(colibri_pxa270_dm9000_resources
),
144 .resource
= colibri_pxa270_dm9000_resources
,
147 static void __init
colibri_pxa270_eth_init(void)
149 platform_device_register(&colibri_pxa270_dm9000_device
);
152 static inline void colibri_pxa270_eth_init(void) {}
155 /******************************************************************************
156 * SD/MMC card controller
157 ******************************************************************************/
158 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
159 static struct pxamci_platform_data colibri_pxa270_mci_platform_data
= {
160 .ocr_mask
= MMC_VDD_32_33
| MMC_VDD_33_34
,
162 .gpio_card_detect
= GPIO0_COLIBRI_PXA270_SD_DETECT
,
164 .detect_delay_ms
= 200,
167 static void __init
colibri_pxa270_mmc_init(void)
169 pxa_set_mci_info(&colibri_pxa270_mci_platform_data
);
172 static inline void colibri_pxa270_mmc_init(void) {}
175 static void __init
colibri_pxa270_init(void)
177 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config
));
178 pxa_set_ffuart_info(NULL
);
179 pxa_set_btuart_info(NULL
);
180 pxa_set_stuart_info(NULL
);
182 colibri_pxa270_nor_init();
183 colibri_pxa270_eth_init();
184 colibri_pxa270_mmc_init();
187 MACHINE_START(COLIBRI
, "Toradex Colibri PXA270")
188 .phys_io
= 0x40000000,
189 .io_pg_offst
= (io_p2v(0x40000000) >> 18) & 0xfffc,
190 .boot_params
= COLIBRI_SDRAM_BASE
+ 0x100,
191 .init_machine
= colibri_pxa270_init
,
192 .map_io
= pxa_map_io
,
193 .init_irq
= pxa27x_init_irq
,