0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include <linux/irq.h>
0021 #include <linux/platform_device.h>
0022 #include <linux/mtd/physmap.h>
0023 #include <linux/spi/spi.h>
0024 #include <linux/spi/max7301.h>
0025 #include <linux/spi/pxa2xx_spi.h>
0026 #include <linux/leds.h>
0027
0028 #include <asm/mach-types.h>
0029 #include <asm/mach/arch.h>
0030 #include "pxa27x.h"
0031 #include "pcm027.h"
0032 #include "generic.h"
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083 static unsigned long pcm027_pin_config[] __initdata = {
0084
0085 GPIO20_nSDCS_2,
0086 GPIO21_nSDCS_3,
0087 GPIO15_nCS_1,
0088 GPIO78_nCS_2,
0089 GPIO80_nCS_4,
0090 GPIO33_nCS_5,
0091
0092
0093 GPIO117_I2C_SCL,
0094 GPIO118_I2C_SDA,
0095
0096
0097 GPIO52_GPIO,
0098 #ifdef CONFIG_LEDS_GPIO
0099 GPIO90_GPIO,
0100 GPIO91_GPIO,
0101 #endif
0102 GPIO114_GPIO,
0103 };
0104
0105
0106
0107
0108 static struct resource smc91x_resources[] = {
0109 [0] = {
0110 .start = PCM027_ETH_PHYS + 0x300,
0111 .end = PCM027_ETH_PHYS + PCM027_ETH_SIZE,
0112 .flags = IORESOURCE_MEM,
0113 },
0114 [1] = {
0115 .start = PCM027_ETH_IRQ,
0116 .end = PCM027_ETH_IRQ,
0117
0118 .flags = IORESOURCE_IRQ | PCM027_ETH_IRQ_EDGE,
0119 }
0120 };
0121
0122 static struct platform_device smc91x_device = {
0123 .name = "smc91x",
0124 .id = 0,
0125 .num_resources = ARRAY_SIZE(smc91x_resources),
0126 .resource = smc91x_resources,
0127 };
0128
0129
0130
0131
0132 static struct pxa2xx_spi_controller pxa_ssp_master_info = {
0133 .num_chipselect = 1,
0134 };
0135
0136 static struct max7301_platform_data max7301_info = {
0137 .base = -1,
0138 };
0139
0140
0141 static struct spi_board_info spi_board_info[] __initdata = {
0142 {
0143 .modalias = "max7301",
0144 .platform_data = &max7301_info,
0145 .max_speed_hz = 13000000,
0146 .bus_num = 1,
0147 .chip_select = 0,
0148 .mode = SPI_MODE_0,
0149 },
0150 };
0151
0152
0153
0154
0155 static struct physmap_flash_data pcm027_flash_data = {
0156 .width = 4,
0157 };
0158
0159 static struct resource pcm027_flash_resource = {
0160 .start = PCM027_FLASH_PHYS,
0161 .end = PCM027_FLASH_PHYS + PCM027_FLASH_SIZE - 1 ,
0162 .flags = IORESOURCE_MEM,
0163 };
0164
0165 static struct platform_device pcm027_flash = {
0166 .name = "physmap-flash",
0167 .id = 0,
0168 .dev = {
0169 .platform_data = &pcm027_flash_data,
0170 },
0171 .resource = &pcm027_flash_resource,
0172 .num_resources = 1,
0173 };
0174
0175 #ifdef CONFIG_LEDS_GPIO
0176
0177 static struct gpio_led pcm027_led[] = {
0178 {
0179 .name = "led0:red",
0180 .gpio = PCM027_LED_CPU
0181 },
0182 {
0183 .name = "led1:green",
0184 .gpio = PCM027_LED_HEARD_BEAT
0185 },
0186 };
0187
0188 static struct gpio_led_platform_data pcm027_led_data = {
0189 .num_leds = ARRAY_SIZE(pcm027_led),
0190 .leds = pcm027_led
0191 };
0192
0193 static struct platform_device pcm027_led_dev = {
0194 .name = "leds-gpio",
0195 .id = 0,
0196 .dev = {
0197 .platform_data = &pcm027_led_data,
0198 },
0199 };
0200
0201 #endif
0202
0203
0204
0205
0206 static struct platform_device *devices[] __initdata = {
0207 &smc91x_device,
0208 &pcm027_flash,
0209 #ifdef CONFIG_LEDS_GPIO
0210 &pcm027_led_dev
0211 #endif
0212 };
0213
0214
0215
0216
0217 static void __init pcm027_init(void)
0218 {
0219
0220
0221
0222
0223 ARB_CNTRL = ARB_CORE_PARK | 0x234;
0224
0225 pxa2xx_mfp_config(pcm027_pin_config, ARRAY_SIZE(pcm027_pin_config));
0226
0227 pxa_set_ffuart_info(NULL);
0228 pxa_set_btuart_info(NULL);
0229 pxa_set_stuart_info(NULL);
0230
0231 platform_add_devices(devices, ARRAY_SIZE(devices));
0232
0233
0234 #ifdef CONFIG_MACH_PCM990_BASEBOARD
0235 pcm990_baseboard_init();
0236 #endif
0237
0238 pxa2xx_set_spi_info(1, &pxa_ssp_master_info);
0239 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
0240 }
0241
0242 static void __init pcm027_map_io(void)
0243 {
0244 pxa27x_map_io();
0245
0246
0247 PGSR0 = 0x01308000;
0248 PGSR1 = 0x00CF0002;
0249 PGSR2 = 0x0E294000;
0250 PGSR3 = 0x0000C000;
0251 PWER = 0x40000000 | PWER_GPIO0 | PWER_GPIO1;
0252 PRER = 0x00000000;
0253 PFER = 0x00000003;
0254 }
0255
0256 MACHINE_START(PCM027, "Phytec Messtechnik GmbH phyCORE-PXA270")
0257
0258 .atag_offset = 0x100,
0259 .map_io = pcm027_map_io,
0260 .nr_irqs = PCM027_NR_IRQS,
0261 .init_irq = pxa27x_init_irq,
0262 .handle_irq = pxa27x_handle_irq,
0263 .init_time = pxa_timer_init,
0264 .init_machine = pcm027_init,
0265 .restart = pxa_restart,
0266 MACHINE_END