1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/arch/arm/mach-pxa/pcm027.c
4 * Support for the Phytec phyCORE-PXA270 CPU card (aka PCM-027).
7 * http://www.phytec.com/products/sbc/ARM-XScale/phyCORE-XScale-PXA270.html
8 * for additional hardware info
10 * Author: Juergen Kilb
11 * Created: April 05, 2005
12 * Copyright: Phytec Messtechnik GmbH
13 * e-Mail: armlinux@phytec.de
15 * based on Intel Mainstone Board
17 * Copyright 2007 Juergen Beisert @ Pengutronix (j.beisert@pengutronix.de)
20 #include <linux/irq.h>
21 #include <linux/platform_device.h>
22 #include <linux/mtd/physmap.h>
23 #include <linux/spi/spi.h>
24 #include <linux/spi/max7301.h>
25 #include <linux/spi/pxa2xx_spi.h>
26 #include <linux/leds.h>
28 #include <asm/mach-types.h>
29 #include <asm/mach/arch.h>
37 * The PXA270 processor comes with a bunch of hardware on its silicon.
38 * Not all of this hardware can be used at the same time and not all
39 * is routed to module's connectors. Also it depends on the baseboard, what
40 * kind of hardware can be used in which way.
41 * -> So this file supports the main devices on the CPU card only!
42 * Refer pcm990-baseboard.c how to extend this features to get a full
43 * blown system with many common interfaces.
45 * The PCM-027 supports the following interfaces through its connectors and
46 * will be used in pcm990-baseboard.c:
59 * GPIO0 -> IRQ input from RTC
63 * GPIO5 -> PowerCap0*)
64 * GPIO6 -> PowerCap1*)
65 * GPIO7 -> PowerCap2*)
66 * GPIO8 -> PowerCap3*)
70 * GPIO33 -> /CS5 network controller select
71 * GPIO52 -> IRQ from network controller
76 * GPIO114 -> IRQ from CAN controller
80 * *) CPU internal use only
83 static unsigned long pcm027_pin_config
[] __initdata
= {
90 GPIO33_nCS_5
, /* Ethernet */
97 GPIO52_GPIO
, /* IRQ from network controller */
98 #ifdef CONFIG_LEDS_GPIO
99 GPIO90_GPIO
, /* PCM027_LED_CPU */
100 GPIO91_GPIO
, /* PCM027_LED_HEART_BEAT */
102 GPIO114_GPIO
, /* IRQ from CAN controller */
106 * SMC91x network controller specific stuff
108 static struct resource smc91x_resources
[] = {
110 .start
= PCM027_ETH_PHYS
+ 0x300,
111 .end
= PCM027_ETH_PHYS
+ PCM027_ETH_SIZE
,
112 .flags
= IORESOURCE_MEM
,
115 .start
= PCM027_ETH_IRQ
,
116 .end
= PCM027_ETH_IRQ
,
117 /* note: smc91x's driver doesn't use the trigger bits yet */
118 .flags
= IORESOURCE_IRQ
| PCM027_ETH_IRQ_EDGE
,
122 static struct platform_device smc91x_device
= {
125 .num_resources
= ARRAY_SIZE(smc91x_resources
),
126 .resource
= smc91x_resources
,
130 * SPI host and devices
132 static struct pxa2xx_spi_controller pxa_ssp_master_info
= {
136 static struct max7301_platform_data max7301_info
= {
140 /* bus_num must match id in pxa2xx_set_spi_info() call */
141 static struct spi_board_info spi_board_info
[] __initdata
= {
143 .modalias
= "max7301",
144 .platform_data
= &max7301_info
,
145 .max_speed_hz
= 13000000,
155 static struct physmap_flash_data pcm027_flash_data
= {
159 static struct resource pcm027_flash_resource
= {
160 .start
= PCM027_FLASH_PHYS
,
161 .end
= PCM027_FLASH_PHYS
+ PCM027_FLASH_SIZE
- 1 ,
162 .flags
= IORESOURCE_MEM
,
165 static struct platform_device pcm027_flash
= {
166 .name
= "physmap-flash",
169 .platform_data
= &pcm027_flash_data
,
171 .resource
= &pcm027_flash_resource
,
175 #ifdef CONFIG_LEDS_GPIO
177 static struct gpio_led pcm027_led
[] = {
179 .name
= "led0:red", /* FIXME */
180 .gpio
= PCM027_LED_CPU
183 .name
= "led1:green", /* FIXME */
184 .gpio
= PCM027_LED_HEARD_BEAT
188 static struct gpio_led_platform_data pcm027_led_data
= {
189 .num_leds
= ARRAY_SIZE(pcm027_led
),
193 static struct platform_device pcm027_led_dev
= {
197 .platform_data
= &pcm027_led_data
,
201 #endif /* CONFIG_LEDS_GPIO */
204 * declare the available device resources on this board
206 static struct platform_device
*devices
[] __initdata
= {
209 #ifdef CONFIG_LEDS_GPIO
215 * pcm027_init - breath some life into the board
217 static void __init
pcm027_init(void)
219 /* system bus arbiter setting
221 * - LCD_wt:DMA_wt:CORE_Wt = 2:3:4
223 ARB_CNTRL
= ARB_CORE_PARK
| 0x234;
225 pxa2xx_mfp_config(pcm027_pin_config
, ARRAY_SIZE(pcm027_pin_config
));
227 pxa_set_ffuart_info(NULL
);
228 pxa_set_btuart_info(NULL
);
229 pxa_set_stuart_info(NULL
);
231 platform_add_devices(devices
, ARRAY_SIZE(devices
));
233 /* at last call the baseboard to initialize itself */
234 #ifdef CONFIG_MACH_PCM990_BASEBOARD
235 pcm990_baseboard_init();
238 pxa2xx_set_spi_info(1, &pxa_ssp_master_info
);
239 spi_register_board_info(spi_board_info
, ARRAY_SIZE(spi_board_info
));
242 static void __init
pcm027_map_io(void)
246 /* initialize sleep mode regs (wake-up sources, etc) */
251 PWER
= 0x40000000 | PWER_GPIO0
| PWER_GPIO1
;
256 MACHINE_START(PCM027
, "Phytec Messtechnik GmbH phyCORE-PXA270")
257 /* Maintainer: Pengutronix */
258 .atag_offset
= 0x100,
259 .map_io
= pcm027_map_io
,
260 .nr_irqs
= PCM027_NR_IRQS
,
261 .init_irq
= pxa27x_init_irq
,
262 .handle_irq
= pxa27x_handle_irq
,
263 .init_time
= pxa_timer_init
,
264 .init_machine
= pcm027_init
,
265 .restart
= pxa_restart
,