2 * linux/arch/arm/mach-pxa/pcm027.c
3 * Support for the Phytec phyCORE-PXA270 CPU card (aka PCM-027).
6 * http://www.phytec.com/products/sbc/ARM-XScale/phyCORE-XScale-PXA270.html
7 * for additional hardware info
10 * Created: April 05, 2005
11 * Copyright: Phytec Messtechnik GmbH
12 * e-Mail: armlinux@phytec.de
14 * based on Intel Mainstone Board
16 * Copyright 2007 Juergen Beisert @ Pengutronix (j.beisert@pengutronix.de)
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License version 2 as
20 * published by the Free Software Foundation.
23 #include <linux/irq.h>
24 #include <linux/platform_device.h>
25 #include <linux/mtd/physmap.h>
26 #include <linux/spi/spi.h>
27 #include <linux/leds.h>
28 #include <asm/mach-types.h>
29 #include <asm/mach/arch.h>
30 #include <asm/arch/hardware.h>
31 #include <asm/arch/pxa-regs.h>
32 #include <asm/arch/pxa2xx_spi.h>
33 #include <asm/arch/pcm027.h>
39 * The PXA270 processor comes with a bunch of hardware on its silicon.
40 * Not all of this hardware can be used at the same time and not all
41 * is routed to module's connectors. Also it depends on the baseboard, what
42 * kind of hardware can be used in which way.
43 * -> So this file supports the main devices on the CPU card only!
44 * Refer pcm990-baseboard.c how to extend this features to get a full
45 * blown system with many common interfaces.
47 * The PCM-027 supports the following interfaces through its connectors and
48 * will be used in pcm990-baseboard.c:
61 * GPIO0 -> IRQ input from RTC
65 * GPIO5 -> PowerCap0*)
66 * GPIO6 -> PowerCap1*)
67 * GPIO7 -> PowerCap2*)
68 * GPIO8 -> PowerCap3*)
72 * GPIO33 -> /CS5 network controller select
73 * GPIO52 -> IRQ from network controller
78 * GPIO114 -> IRQ from CAN controller
82 * *) CPU internal use only
86 * SMC91x network controller specific stuff
88 static struct resource smc91x_resources
[] = {
90 .start
= PCM027_ETH_PHYS
+ 0x300,
91 .end
= PCM027_ETH_PHYS
+ PCM027_ETH_SIZE
,
92 .flags
= IORESOURCE_MEM
,
95 .start
= PCM027_ETH_IRQ
,
96 .end
= PCM027_ETH_IRQ
,
97 /* note: smc91x's driver doesn't use the trigger bits yet */
98 .flags
= IORESOURCE_IRQ
| PCM027_ETH_IRQ_EDGE
,
102 static struct platform_device smc91x_device
= {
105 .num_resources
= ARRAY_SIZE(smc91x_resources
),
106 .resource
= smc91x_resources
,
109 static struct physmap_flash_data pcm027_flash_data
= {
113 static struct resource pcm027_flash_resource
= {
114 .start
= PCM027_FLASH_PHYS
,
115 .end
= PCM027_FLASH_PHYS
+ PCM027_FLASH_SIZE
- 1 ,
116 .flags
= IORESOURCE_MEM
,
119 static struct platform_device pcm027_flash
= {
120 .name
= "physmap-flash",
123 .platform_data
= &pcm027_flash_data
,
125 .resource
= &pcm027_flash_resource
,
129 #ifdef CONFIG_LEDS_GPIO
131 static struct gpio_led pcm027_led
[] = {
133 .name
= "led0:red", /* FIXME */
134 .gpio
= PCM027_LED_CPU
137 .name
= "led1:green", /* FIXME */
138 .gpio
= PCM027_LED_HEARD_BEAT
142 static struct gpio_led_platform_data pcm027_led_data
= {
143 .num_leds
= ARRAY_SIZE(pcm027_led
),
147 static struct platform_device pcm027_led_dev
= {
151 .platform_data
= &pcm027_led_data
,
155 #endif /* CONFIG_LEDS_GPIO */
158 * declare the available device resources on this board
160 static struct platform_device
*devices
[] __initdata
= {
163 #ifdef CONFIG_LEDS_GPIO
169 * pcm027_init - breath some life into the board
171 static void __init
pcm027_init(void)
173 /* system bus arbiter setting
175 * - LCD_wt:DMA_wt:CORE_Wt = 2:3:4
177 ARB_CNTRL
= ARB_CORE_PARK
| 0x234;
179 platform_add_devices(devices
, ARRAY_SIZE(devices
));
181 /* LEDs (on demand only) */
182 #ifdef CONFIG_LEDS_GPIO
183 pxa_gpio_mode(PCM027_LED_CPU
| GPIO_OUT
);
184 pxa_gpio_mode(PCM027_LED_HEARD_BEAT
| GPIO_OUT
);
185 #endif /* CONFIG_LEDS_GPIO */
187 /* at last call the baseboard to initialize itself */
188 #ifdef CONFIG_MACH_PCM990_BASEBOARD
189 pcm990_baseboard_init();
193 static void __init
pcm027_map_io(void)
197 /* initialize sleep mode regs (wake-up sources, etc) */
202 PWER
= 0x40000000 | PWER_GPIO0
| PWER_GPIO1
;
207 MACHINE_START(PCM027
, "Phytec Messtechnik GmbH phyCORE-PXA270")
208 /* Maintainer: Pengutronix */
209 .boot_params
= 0xa0000100,
210 .phys_io
= 0x40000000,
211 .io_pg_offst
= (io_p2v(0x40000000) >> 18) & 0xfffc,
212 .map_io
= pcm027_map_io
,
213 .init_irq
= pxa27x_init_irq
,
215 .init_machine
= pcm027_init
,