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/spi/max7301.h>
28 #include <linux/leds.h>
30 #include <asm/mach-types.h>
31 #include <asm/mach/arch.h>
32 #include <mach/hardware.h>
33 #include <mach/pxa-regs.h>
34 #include <mach/pxa2xx-gpio.h>
35 #include <mach/pxa2xx-regs.h>
36 #include <mach/pxa2xx_spi.h>
37 #include <mach/pcm027.h>
43 * The PXA270 processor comes with a bunch of hardware on its silicon.
44 * Not all of this hardware can be used at the same time and not all
45 * is routed to module's connectors. Also it depends on the baseboard, what
46 * kind of hardware can be used in which way.
47 * -> So this file supports the main devices on the CPU card only!
48 * Refer pcm990-baseboard.c how to extend this features to get a full
49 * blown system with many common interfaces.
51 * The PCM-027 supports the following interfaces through its connectors and
52 * will be used in pcm990-baseboard.c:
65 * GPIO0 -> IRQ input from RTC
69 * GPIO5 -> PowerCap0*)
70 * GPIO6 -> PowerCap1*)
71 * GPIO7 -> PowerCap2*)
72 * GPIO8 -> PowerCap3*)
76 * GPIO33 -> /CS5 network controller select
77 * GPIO52 -> IRQ from network controller
82 * GPIO114 -> IRQ from CAN controller
86 * *) CPU internal use only
90 * SMC91x network controller specific stuff
92 static struct resource smc91x_resources[] = {
94 .start = PCM027_ETH_PHYS + 0x300,
95 .end = PCM027_ETH_PHYS + PCM027_ETH_SIZE,
96 .flags = IORESOURCE_MEM,
99 .start = PCM027_ETH_IRQ,
100 .end = PCM027_ETH_IRQ,
101 /* note: smc91x's driver doesn't use the trigger bits yet */
102 .flags = IORESOURCE_IRQ | PCM027_ETH_IRQ_EDGE,
106 static struct platform_device smc91x_device = {
109 .num_resources = ARRAY_SIZE(smc91x_resources),
110 .resource = smc91x_resources,
114 * SPI host and devices
116 static struct pxa2xx_spi_master pxa_ssp_master_info = {
120 static struct max7301_platform_data max7301_info = {
124 /* bus_num must match id in pxa2xx_set_spi_info() call */
125 static struct spi_board_info spi_board_info[] __initdata = {
127 .modalias = "max7301",
128 .platform_data = &max7301_info,
129 .max_speed_hz = 13000000,
139 static struct physmap_flash_data pcm027_flash_data = {
143 static struct resource pcm027_flash_resource = {
144 .start = PCM027_FLASH_PHYS,
145 .end = PCM027_FLASH_PHYS + PCM027_FLASH_SIZE - 1 ,
146 .flags = IORESOURCE_MEM,
149 static struct platform_device pcm027_flash = {
150 .name = "physmap-flash",
153 .platform_data = &pcm027_flash_data,
155 .resource = &pcm027_flash_resource,
159 #ifdef CONFIG_LEDS_GPIO
161 static struct gpio_led pcm027_led[] = {
163 .name = "led0:red", /* FIXME */
164 .gpio = PCM027_LED_CPU
167 .name = "led1:green", /* FIXME */
168 .gpio = PCM027_LED_HEARD_BEAT
172 static struct gpio_led_platform_data pcm027_led_data = {
173 .num_leds = ARRAY_SIZE(pcm027_led),
177 static struct platform_device pcm027_led_dev = {
181 .platform_data = &pcm027_led_data,
185 #endif /* CONFIG_LEDS_GPIO */
188 * declare the available device resources on this board
190 static struct platform_device *devices[] __initdata = {
193 #ifdef CONFIG_LEDS_GPIO
199 * pcm027_init - breath some life into the board
201 static void __init pcm027_init(void)
203 /* system bus arbiter setting
205 * - LCD_wt:DMA_wt:CORE_Wt = 2:3:4
207 ARB_CNTRL = ARB_CORE_PARK | 0x234;
209 platform_add_devices(devices, ARRAY_SIZE(devices));
211 /* LEDs (on demand only) */
212 #ifdef CONFIG_LEDS_GPIO
213 pxa_gpio_mode(PCM027_LED_CPU | GPIO_OUT);
214 pxa_gpio_mode(PCM027_LED_HEARD_BEAT | GPIO_OUT);
215 #endif /* CONFIG_LEDS_GPIO */
217 /* at last call the baseboard to initialize itself */
218 #ifdef CONFIG_MACH_PCM990_BASEBOARD
219 pcm990_baseboard_init();
222 pxa2xx_set_spi_info(1, &pxa_ssp_master_info);
223 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
226 static void __init pcm027_map_io(void)
230 /* initialize sleep mode regs (wake-up sources, etc) */
235 PWER = 0x40000000 | PWER_GPIO0 | PWER_GPIO1;
240 MACHINE_START(PCM027, "Phytec Messtechnik GmbH phyCORE-PXA270")
241 /* Maintainer: Pengutronix */
242 .boot_params = 0xa0000100,
243 .phys_io = 0x40000000,
244 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
245 .map_io = pcm027_map_io,
246 .init_irq = pxa27x_init_irq,
248 .init_machine = pcm027_init,