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-gpio.h>
33 #include <asm/arch/pxa2xx-regs.h>
34 #include <asm/arch/pxa2xx_spi.h>
35 #include <asm/arch/pcm027.h>
41 * The PXA270 processor comes with a bunch of hardware on its silicon.
42 * Not all of this hardware can be used at the same time and not all
43 * is routed to module's connectors. Also it depends on the baseboard, what
44 * kind of hardware can be used in which way.
45 * -> So this file supports the main devices on the CPU card only!
46 * Refer pcm990-baseboard.c how to extend this features to get a full
47 * blown system with many common interfaces.
49 * The PCM-027 supports the following interfaces through its connectors and
50 * will be used in pcm990-baseboard.c:
63 * GPIO0 -> IRQ input from RTC
67 * GPIO5 -> PowerCap0*)
68 * GPIO6 -> PowerCap1*)
69 * GPIO7 -> PowerCap2*)
70 * GPIO8 -> PowerCap3*)
74 * GPIO33 -> /CS5 network controller select
75 * GPIO52 -> IRQ from network controller
80 * GPIO114 -> IRQ from CAN controller
84 * *) CPU internal use only
88 * SMC91x network controller specific stuff
90 static struct resource smc91x_resources[] = {
92 .start = PCM027_ETH_PHYS + 0x300,
93 .end = PCM027_ETH_PHYS + PCM027_ETH_SIZE,
94 .flags = IORESOURCE_MEM,
97 .start = PCM027_ETH_IRQ,
98 .end = PCM027_ETH_IRQ,
99 /* note: smc91x's driver doesn't use the trigger bits yet */
100 .flags = IORESOURCE_IRQ | PCM027_ETH_IRQ_EDGE,
104 static struct platform_device smc91x_device = {
107 .num_resources = ARRAY_SIZE(smc91x_resources),
108 .resource = smc91x_resources,
111 static struct physmap_flash_data pcm027_flash_data = {
115 static struct resource pcm027_flash_resource = {
116 .start = PCM027_FLASH_PHYS,
117 .end = PCM027_FLASH_PHYS + PCM027_FLASH_SIZE - 1 ,
118 .flags = IORESOURCE_MEM,
121 static struct platform_device pcm027_flash = {
122 .name = "physmap-flash",
125 .platform_data = &pcm027_flash_data,
127 .resource = &pcm027_flash_resource,
131 #ifdef CONFIG_LEDS_GPIO
133 static struct gpio_led pcm027_led[] = {
135 .name = "led0:red", /* FIXME */
136 .gpio = PCM027_LED_CPU
139 .name = "led1:green", /* FIXME */
140 .gpio = PCM027_LED_HEARD_BEAT
144 static struct gpio_led_platform_data pcm027_led_data = {
145 .num_leds = ARRAY_SIZE(pcm027_led),
149 static struct platform_device pcm027_led_dev = {
153 .platform_data = &pcm027_led_data,
157 #endif /* CONFIG_LEDS_GPIO */
160 * declare the available device resources on this board
162 static struct platform_device *devices[] __initdata = {
165 #ifdef CONFIG_LEDS_GPIO
171 * pcm027_init - breath some life into the board
173 static void __init pcm027_init(void)
175 /* system bus arbiter setting
177 * - LCD_wt:DMA_wt:CORE_Wt = 2:3:4
179 ARB_CNTRL = ARB_CORE_PARK | 0x234;
181 platform_add_devices(devices, ARRAY_SIZE(devices));
183 /* LEDs (on demand only) */
184 #ifdef CONFIG_LEDS_GPIO
185 pxa_gpio_mode(PCM027_LED_CPU | GPIO_OUT);
186 pxa_gpio_mode(PCM027_LED_HEARD_BEAT | GPIO_OUT);
187 #endif /* CONFIG_LEDS_GPIO */
189 /* at last call the baseboard to initialize itself */
190 #ifdef CONFIG_MACH_PCM990_BASEBOARD
191 pcm990_baseboard_init();
195 static void __init pcm027_map_io(void)
199 /* initialize sleep mode regs (wake-up sources, etc) */
204 PWER = 0x40000000 | PWER_GPIO0 | PWER_GPIO1;
209 MACHINE_START(PCM027, "Phytec Messtechnik GmbH phyCORE-PXA270")
210 /* Maintainer: Pengutronix */
211 .boot_params = 0xa0000100,
212 .phys_io = 0x40000000,
213 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
214 .map_io = pcm027_map_io,
215 .init_irq = pxa27x_init_irq,
217 .init_machine = pcm027_init,