blob: 9a9c539f6c015b51b2c6eb45a5c483786b12338e [file] [log] [blame]
Robert Schwebel2e927b72008-01-08 08:52:04 +01001/*
2 * arch/arm/mach-pxa/pcm990-baseboard.c
3 * Support for the Phytec phyCORE-PXA270 Development Platform (PCM-990).
4 *
5 * Refer
6 * http://www.phytec.com/products/rdk/ARM-XScale/phyCORE-XScale-PXA270.html
7 * for additional hardware info
8 *
9 * Author: Juergen Kilb
10 * Created: April 05, 2005
11 * Copyright: Phytec Messtechnik GmbH
12 * e-Mail: armlinux@phytec.de
13 *
14 * based on Intel Mainstone Board
15 *
16 * Copyright 2007 Juergen Beisert @ Pengutronix (j.beisert@pengutronix.de)
17 *
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.
21 */
Russell King2f8163b2011-07-26 10:53:52 +010022#include <linux/gpio.h>
Robert Schwebel2e927b72008-01-08 08:52:04 +010023#include <linux/irq.h>
24#include <linux/platform_device.h>
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +020025#include <linux/i2c.h>
Sebastian Andrzej Siewiorb4593962011-02-23 12:38:16 +010026#include <linux/i2c/pxa-i2c.h>
Guennadi Liakhovetskic0f7edb2008-06-13 11:50:44 +010027#include <linux/pwm_backlight.h>
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +020028
29#include <media/soc_camera.h>
30
Russell Kinga09e64f2008-08-05 16:14:15 +010031#include <mach/camera.h>
Robert Schwebel2e927b72008-01-08 08:52:04 +010032#include <asm/mach/map.h>
Eric Miao51c62982009-01-02 23:17:22 +080033#include <mach/pxa27x.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010034#include <mach/audio.h>
35#include <mach/mmc.h>
36#include <mach/ohci.h>
37#include <mach/pcm990_baseboard.h>
38#include <mach/pxafb.h>
Guennadi Liakhovetskic0f7edb2008-06-13 11:50:44 +010039
40#include "devices.h"
Guennadi Liakhovetski6a566fb2008-06-16 08:16:46 +010041#include "generic.h"
42
43static unsigned long pcm990_pin_config[] __initdata = {
44 /* MMC */
45 GPIO32_MMC_CLK,
46 GPIO112_MMC_CMD,
47 GPIO92_MMC_DAT_0,
48 GPIO109_MMC_DAT_1,
49 GPIO110_MMC_DAT_2,
50 GPIO111_MMC_DAT_3,
51 /* USB */
52 GPIO88_USBH1_PWR,
53 GPIO89_USBH1_PEN,
54 /* PWM0 */
55 GPIO16_PWM0_OUT,
Eric Miao6f584cf2008-11-28 16:00:24 +080056
57 /* I2C */
58 GPIO117_I2C_SCL,
59 GPIO118_I2C_SDA,
Eric Miaoc11b6a42010-01-04 17:00:13 +080060
61 /* AC97 */
62 GPIO28_AC97_BITCLK,
63 GPIO29_AC97_SDATA_IN_0,
64 GPIO30_AC97_SDATA_OUT,
65 GPIO31_AC97_SYNC,
Guennadi Liakhovetski6a566fb2008-06-16 08:16:46 +010066};
Robert Schwebel2e927b72008-01-08 08:52:04 +010067
68/*
Guennadi Liakhovetskic0f7edb2008-06-13 11:50:44 +010069 * pcm990_lcd_power - control power supply to the LCD
70 * @on: 0 = switch off, 1 = switch on
71 *
72 * Called by the pxafb driver
73 */
74#ifndef CONFIG_PCM990_DISPLAY_NONE
75static void pcm990_lcd_power(int on, struct fb_var_screeninfo *var)
76{
77 if (on) {
78 /* enable LCD-Latches
79 * power on LCD
80 */
81 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3) =
82 PCM990_CTRL_LCDPWR + PCM990_CTRL_LCDON;
83 } else {
84 /* disable LCD-Latches
85 * power off LCD
86 */
87 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3) = 0x00;
88 }
89}
90#endif
91
92#if defined(CONFIG_PCM990_DISPLAY_SHARP)
93static struct pxafb_mode_info fb_info_sharp_lq084v1dg21 = {
94 .pixclock = 28000,
95 .xres = 640,
96 .yres = 480,
97 .bpp = 16,
98 .hsync_len = 20,
99 .left_margin = 103,
100 .right_margin = 47,
101 .vsync_len = 6,
102 .upper_margin = 28,
103 .lower_margin = 5,
104 .sync = 0,
105 .cmap_greyscale = 0,
106};
107
108static struct pxafb_mach_info pcm990_fbinfo __initdata = {
109 .modes = &fb_info_sharp_lq084v1dg21,
110 .num_modes = 1,
Eric Miao95873192008-12-07 17:49:01 +0800111 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
Guennadi Liakhovetskic0f7edb2008-06-13 11:50:44 +0100112 .pxafb_lcd_power = pcm990_lcd_power,
113};
114#elif defined(CONFIG_PCM990_DISPLAY_NEC)
115struct pxafb_mode_info fb_info_nec_nl6448bc20_18d = {
116 .pixclock = 39720,
117 .xres = 640,
118 .yres = 480,
119 .bpp = 16,
120 .hsync_len = 32,
121 .left_margin = 16,
122 .right_margin = 48,
123 .vsync_len = 2,
124 .upper_margin = 12,
125 .lower_margin = 17,
126 .sync = 0,
127 .cmap_greyscale = 0,
128};
129
130static struct pxafb_mach_info pcm990_fbinfo __initdata = {
131 .modes = &fb_info_nec_nl6448bc20_18d,
132 .num_modes = 1,
Eric Miao95873192008-12-07 17:49:01 +0800133 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
Guennadi Liakhovetskic0f7edb2008-06-13 11:50:44 +0100134 .pxafb_lcd_power = pcm990_lcd_power,
135};
136#endif
137
138static struct platform_pwm_backlight_data pcm990_backlight_data = {
139 .pwm_id = 0,
140 .max_brightness = 1023,
141 .dft_brightness = 1023,
142 .pwm_period_ns = 78770,
143};
144
145static struct platform_device pcm990_backlight_device = {
146 .name = "pwm-backlight",
147 .dev = {
148 .parent = &pxa27x_device_pwm0.dev,
149 .platform_data = &pcm990_backlight_data,
150 },
151};
152
153/*
154 * The PCM-990 development baseboard uses PCM-027's hardware in the
Robert Schwebel2e927b72008-01-08 08:52:04 +0100155 * following way:
156 *
157 * - LCD support is in use
158 * - GPIO16 is output for back light on/off with PWM
159 * - GPIO58 ... GPIO73 are outputs for display data
160 * - GPIO74 is output output for LCDFCLK
161 * - GPIO75 is output for LCDLCLK
162 * - GPIO76 is output for LCDPCLK
163 * - GPIO77 is output for LCDBIAS
164 * - MMC support is in use
165 * - GPIO32 is output for MMCCLK
166 * - GPIO92 is MMDAT0
167 * - GPIO109 is MMDAT1
168 * - GPIO110 is MMCS0
169 * - GPIO111 is MMCS1
170 * - GPIO112 is MMCMD
171 * - IDE/CF card is in use
172 * - GPIO48 is output /POE
173 * - GPIO49 is output /PWE
174 * - GPIO50 is output /PIOR
175 * - GPIO51 is output /PIOW
176 * - GPIO54 is output /PCE2
177 * - GPIO55 is output /PREG
178 * - GPIO56 is input /PWAIT
179 * - GPIO57 is output /PIOS16
180 * - GPIO79 is output PSKTSEL
181 * - GPIO85 is output /PCE1
182 * - FFUART is in use
183 * - GPIO34 is input FFRXD
184 * - GPIO35 is input FFCTS
185 * - GPIO36 is input FFDCD
186 * - GPIO37 is input FFDSR
187 * - GPIO38 is input FFRI
188 * - GPIO39 is output FFTXD
189 * - GPIO40 is output FFDTR
190 * - GPIO41 is output FFRTS
191 * - BTUART is in use
192 * - GPIO42 is input BTRXD
193 * - GPIO43 is output BTTXD
194 * - GPIO44 is input BTCTS
195 * - GPIO45 is output BTRTS
196 * - IRUART is in use
197 * - GPIO46 is input STDRXD
198 * - GPIO47 is output STDTXD
199 * - AC97 is in use*)
200 * - GPIO28 is input AC97CLK
201 * - GPIO29 is input AC97DatIn
202 * - GPIO30 is output AC97DatO
203 * - GPIO31 is output AC97SYNC
204 * - GPIO113 is output AC97_RESET
205 * - SSP is in use
206 * - GPIO23 is output SSPSCLK
207 * - GPIO24 is output chip select to Max7301
208 * - GPIO25 is output SSPTXD
209 * - GPIO26 is input SSPRXD
210 * - GPIO27 is input for Max7301 IRQ
211 * - GPIO53 is input SSPSYSCLK
212 * - SSP3 is in use
213 * - GPIO81 is output SSPTXD3
214 * - GPIO82 is input SSPRXD3
215 * - GPIO83 is output SSPSFRM
216 * - GPIO84 is output SSPCLK3
217 *
218 * Otherwise claimed GPIOs:
219 * GPIO1 -> IRQ from user switch
220 * GPIO9 -> IRQ from power management
221 * GPIO10 -> IRQ from WML9712 AC97 controller
222 * GPIO11 -> IRQ from IDE controller
223 * GPIO12 -> IRQ from CF controller
224 * GPIO13 -> IRQ from CF controller
225 * GPIO14 -> GPIO free
226 * GPIO15 -> /CS1 selects baseboard's Control CPLD (U7, 16 bit wide data path)
227 * GPIO19 -> GPIO free
228 * GPIO20 -> /SDCS2
229 * GPIO21 -> /CS3 PC card socket select
230 * GPIO33 -> /CS5 network controller select
231 * GPIO78 -> /CS2 (16 bit wide data path)
232 * GPIO80 -> /CS4 (16 bit wide data path)
233 * GPIO86 -> GPIO free
234 * GPIO87 -> GPIO free
235 * GPIO90 -> LED0 on CPU module
236 * GPIO91 -> LED1 on CPI module
237 * GPIO117 -> SCL
238 * GPIO118 -> SDA
239 */
240
241static unsigned long pcm990_irq_enabled;
242
Lennert Buytenheka3f4c922010-11-29 11:18:26 +0100243static void pcm990_mask_ack_irq(struct irq_data *d)
Robert Schwebel2e927b72008-01-08 08:52:04 +0100244{
Lennert Buytenheka3f4c922010-11-29 11:18:26 +0100245 int pcm990_irq = (d->irq - PCM027_IRQ(0));
Robert Schwebel2e927b72008-01-08 08:52:04 +0100246 PCM990_INTMSKENA = (pcm990_irq_enabled &= ~(1 << pcm990_irq));
247}
248
Lennert Buytenheka3f4c922010-11-29 11:18:26 +0100249static void pcm990_unmask_irq(struct irq_data *d)
Robert Schwebel2e927b72008-01-08 08:52:04 +0100250{
Lennert Buytenheka3f4c922010-11-29 11:18:26 +0100251 int pcm990_irq = (d->irq - PCM027_IRQ(0));
Robert Schwebel2e927b72008-01-08 08:52:04 +0100252 /* the irq can be acknowledged only if deasserted, so it's done here */
253 PCM990_INTSETCLR |= 1 << pcm990_irq;
254 PCM990_INTMSKENA = (pcm990_irq_enabled |= (1 << pcm990_irq));
255}
256
257static struct irq_chip pcm990_irq_chip = {
Lennert Buytenheka3f4c922010-11-29 11:18:26 +0100258 .irq_mask_ack = pcm990_mask_ack_irq,
259 .irq_unmask = pcm990_unmask_irq,
Robert Schwebel2e927b72008-01-08 08:52:04 +0100260};
261
262static void pcm990_irq_handler(unsigned int irq, struct irq_desc *desc)
263{
264 unsigned long pending = (~PCM990_INTSETCLR) & pcm990_irq_enabled;
265
266 do {
Lennert Buytenheka3f4c922010-11-29 11:18:26 +0100267 /* clear our parent IRQ */
268 desc->irq_data.chip->irq_ack(&desc->irq_data);
Robert Schwebel2e927b72008-01-08 08:52:04 +0100269 if (likely(pending)) {
270 irq = PCM027_IRQ(0) + __ffs(pending);
Dmitry Baryshkovd8aa0252008-10-09 13:36:24 +0100271 generic_handle_irq(irq);
Robert Schwebel2e927b72008-01-08 08:52:04 +0100272 }
273 pending = (~PCM990_INTSETCLR) & pcm990_irq_enabled;
274 } while (pending);
275}
276
277static void __init pcm990_init_irq(void)
278{
279 int irq;
280
281 /* setup extra PCM990 irqs */
282 for (irq = PCM027_IRQ(0); irq <= PCM027_IRQ(3); irq++) {
Thomas Gleixnerf38c02f2011-03-24 13:35:09 +0100283 irq_set_chip_and_handler(irq, &pcm990_irq_chip,
284 handle_level_irq);
Robert Schwebel2e927b72008-01-08 08:52:04 +0100285 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
286 }
287
288 PCM990_INTMSKENA = 0x00; /* disable all Interrupts */
289 PCM990_INTSETCLR = 0xFF;
290
Thomas Gleixner6845664a2011-03-24 13:25:22 +0100291 irq_set_chained_handler(PCM990_CTRL_INT_IRQ, pcm990_irq_handler);
292 irq_set_irq_type(PCM990_CTRL_INT_IRQ, PCM990_CTRL_INT_IRQ_EDGE);
Robert Schwebel2e927b72008-01-08 08:52:04 +0100293}
294
295static int pcm990_mci_init(struct device *dev, irq_handler_t mci_detect_int,
296 void *data)
297{
298 int err;
299
Robert Schwebel2e927b72008-01-08 08:52:04 +0100300 err = request_irq(PCM027_MMCDET_IRQ, mci_detect_int, IRQF_DISABLED,
301 "MMC card detect", data);
302 if (err)
303 printk(KERN_ERR "pcm990_mci_init: MMC/SD: can't request MMC "
304 "card detect IRQ\n");
305
306 return err;
307}
308
309static void pcm990_mci_setpower(struct device *dev, unsigned int vdd)
310{
311 struct pxamci_platform_data *p_d = dev->platform_data;
312
313 if ((1 << vdd) & p_d->ocr_mask)
314 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG5) =
315 PCM990_CTRL_MMC2PWR;
316 else
317 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG5) =
318 ~PCM990_CTRL_MMC2PWR;
319}
320
321static void pcm990_mci_exit(struct device *dev, void *data)
322{
323 free_irq(PCM027_MMCDET_IRQ, data);
324}
325
326#define MSECS_PER_JIFFY (1000/HZ)
327
328static struct pxamci_platform_data pcm990_mci_platform_data = {
Eric Miaof97cab22010-04-14 07:00:42 +0800329 .detect_delay_ms = 250,
Robert Jarzmik7a648252009-07-06 22:16:42 +0200330 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
331 .init = pcm990_mci_init,
332 .setpower = pcm990_mci_setpower,
333 .exit = pcm990_mci_exit,
334 .gpio_card_detect = -1,
335 .gpio_card_ro = -1,
336 .gpio_power = -1,
Robert Schwebel2e927b72008-01-08 08:52:04 +0100337};
338
Robert Schwebel2e927b72008-01-08 08:52:04 +0100339static struct pxaohci_platform_data pcm990_ohci_platform_data = {
340 .port_mode = PMM_PERPORT_MODE,
Eric Miao097b5332008-09-27 15:49:57 +0800341 .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
342 .power_on_delay = 10,
Robert Schwebel2e927b72008-01-08 08:52:04 +0100343};
344
345/*
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +0200346 * PXA27x Camera specific stuff
347 */
348#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
Guennadi Liakhovetski6a566fb2008-06-16 08:16:46 +0100349static unsigned long pcm990_camera_pin_config[] = {
350 /* CIF */
351 GPIO98_CIF_DD_0,
352 GPIO105_CIF_DD_1,
353 GPIO104_CIF_DD_2,
354 GPIO103_CIF_DD_3,
355 GPIO95_CIF_DD_4,
356 GPIO94_CIF_DD_5,
357 GPIO93_CIF_DD_6,
358 GPIO108_CIF_DD_7,
359 GPIO107_CIF_DD_8,
360 GPIO106_CIF_DD_9,
361 GPIO42_CIF_MCLK,
362 GPIO45_CIF_PCLK,
363 GPIO43_CIF_FV,
364 GPIO44_CIF_LV,
365};
366
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +0200367/*
368 * CICR4: PCLK_EN: Pixel clock is supplied by the sensor
369 * MCLK_EN: Master clock is generated by PXA
370 * PCP: Data sampled on the falling edge of pixel clock
371 */
372struct pxacamera_platform_data pcm990_pxacamera_platform_data = {
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +0200373 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 |
374 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/,
375 .mclk_10khz = 1000,
376};
377
378#include <linux/i2c/pca953x.h>
379
380static struct pca953x_platform_data pca9536_data = {
Guennadi Liakhovetskia48dc302009-04-15 13:56:08 +0200381 .gpio_base = NR_BUILTIN_GPIO,
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +0200382};
383
Guennadi Liakhovetski594bb462009-04-24 12:53:51 -0300384static int gpio_bus_switch = -EINVAL;
Sascha Hauerd75b1dc2009-03-13 06:08:20 -0300385
386static int pcm990_camera_set_bus_param(struct soc_camera_link *link,
Guennadi Liakhovetski594bb462009-04-24 12:53:51 -0300387 unsigned long flags)
Sascha Hauerd75b1dc2009-03-13 06:08:20 -0300388{
Guennadi Liakhovetski594bb462009-04-24 12:53:51 -0300389 if (gpio_bus_switch < 0) {
Sascha Hauerd75b1dc2009-03-13 06:08:20 -0300390 if (flags == SOCAM_DATAWIDTH_10)
391 return 0;
392 else
393 return -EINVAL;
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +0200394 }
Sascha Hauerd75b1dc2009-03-13 06:08:20 -0300395
396 if (flags & SOCAM_DATAWIDTH_8)
397 gpio_set_value(gpio_bus_switch, 1);
398 else
399 gpio_set_value(gpio_bus_switch, 0);
400
401 return 0;
402}
403
404static unsigned long pcm990_camera_query_bus_param(struct soc_camera_link *link)
405{
406 int ret;
407
Guennadi Liakhovetski594bb462009-04-24 12:53:51 -0300408 if (gpio_bus_switch < 0) {
Guennadi Liakhovetskia48dc302009-04-15 13:56:08 +0200409 ret = gpio_request(NR_BUILTIN_GPIO, "camera");
Sascha Hauerd75b1dc2009-03-13 06:08:20 -0300410 if (!ret) {
Guennadi Liakhovetskia48dc302009-04-15 13:56:08 +0200411 gpio_bus_switch = NR_BUILTIN_GPIO;
Sascha Hauerd75b1dc2009-03-13 06:08:20 -0300412 gpio_direction_output(gpio_bus_switch, 0);
Guennadi Liakhovetski594bb462009-04-24 12:53:51 -0300413 }
Sascha Hauerd75b1dc2009-03-13 06:08:20 -0300414 }
415
Guennadi Liakhovetski594bb462009-04-24 12:53:51 -0300416 if (gpio_bus_switch >= 0)
Sascha Hauerd75b1dc2009-03-13 06:08:20 -0300417 return SOCAM_DATAWIDTH_8 | SOCAM_DATAWIDTH_10;
418 else
419 return SOCAM_DATAWIDTH_10;
420}
421
Guennadi Liakhovetski594bb462009-04-24 12:53:51 -0300422static void pcm990_camera_free_bus(struct soc_camera_link *link)
423{
424 if (gpio_bus_switch < 0)
425 return;
426
427 gpio_free(gpio_bus_switch);
428 gpio_bus_switch = -EINVAL;
429}
430
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +0200431/* Board I2C devices. */
432static struct i2c_board_info __initdata pcm990_i2c_devices[] = {
433 {
434 /* Must initialize before the camera(s) */
Jean Delvare3760f732008-04-29 23:11:40 +0200435 I2C_BOARD_INFO("pca9536", 0x41),
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +0200436 .platform_data = &pca9536_data,
Guennadi Liakhovetski4a3d3ab2009-05-13 11:33:43 +0200437 },
438};
439
440static struct i2c_board_info pcm990_camera_i2c[] = {
441 {
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +0200442 I2C_BOARD_INFO("mt9v022", 0x48),
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +0200443 }, {
444 I2C_BOARD_INFO("mt9m001", 0x5d),
Guennadi Liakhovetski4a3d3ab2009-05-13 11:33:43 +0200445 },
446};
447
448static struct soc_camera_link iclink[] = {
449 {
450 .bus_id = 0, /* Must match with the camera ID */
451 .board_info = &pcm990_camera_i2c[0],
452 .i2c_adapter_id = 0,
453 .query_bus_param = pcm990_camera_query_bus_param,
454 .set_bus_param = pcm990_camera_set_bus_param,
455 .free_bus = pcm990_camera_free_bus,
Guennadi Liakhovetski4a3d3ab2009-05-13 11:33:43 +0200456 }, {
457 .bus_id = 0, /* Must match with the camera ID */
458 .board_info = &pcm990_camera_i2c[1],
459 .i2c_adapter_id = 0,
460 .query_bus_param = pcm990_camera_query_bus_param,
461 .set_bus_param = pcm990_camera_set_bus_param,
462 .free_bus = pcm990_camera_free_bus,
Guennadi Liakhovetski4a3d3ab2009-05-13 11:33:43 +0200463 },
464};
465
466static struct platform_device pcm990_camera[] = {
467 {
468 .name = "soc-camera-pdrv",
469 .id = 0,
470 .dev = {
471 .platform_data = &iclink[0],
472 },
473 }, {
474 .name = "soc-camera-pdrv",
475 .id = 1,
476 .dev = {
477 .platform_data = &iclink[1],
478 },
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +0200479 },
480};
481#endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */
482
483/*
Robert Schwebel2e927b72008-01-08 08:52:04 +0100484 * enable generic access to the base board control CPLDs U6 and U7
485 */
486static struct map_desc pcm990_io_desc[] __initdata = {
487 {
488 .virtual = PCM990_CTRL_BASE,
489 .pfn = __phys_to_pfn(PCM990_CTRL_PHYS),
490 .length = PCM990_CTRL_SIZE,
491 .type = MT_DEVICE /* CPLD */
492 }, {
493 .virtual = PCM990_CF_PLD_BASE,
494 .pfn = __phys_to_pfn(PCM990_CF_PLD_PHYS),
495 .length = PCM990_CF_PLD_SIZE,
496 .type = MT_DEVICE /* CPLD */
497 }
498};
499
500/*
501 * system init for baseboard usage. Will be called by pcm027 init.
502 *
503 * Add platform devices present on this baseboard and init
504 * them from CPU side as far as required to use them later on
505 */
506void __init pcm990_baseboard_init(void)
507{
Guennadi Liakhovetski6a566fb2008-06-16 08:16:46 +0100508 pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_pin_config));
509
Robert Schwebel2e927b72008-01-08 08:52:04 +0100510 /* register CPLD access */
Guennadi Liakhovetski6a566fb2008-06-16 08:16:46 +0100511 iotable_init(ARRAY_AND_SIZE(pcm990_io_desc));
Robert Schwebel2e927b72008-01-08 08:52:04 +0100512
513 /* register CPLD's IRQ controller */
514 pcm990_init_irq();
515
Guennadi Liakhovetskic0f7edb2008-06-13 11:50:44 +0100516#ifndef CONFIG_PCM990_DISPLAY_NONE
Russell King - ARM Linux4321e1a2011-02-15 15:37:30 +0800517 pxa_set_fb_info(NULL, &pcm990_fbinfo);
Guennadi Liakhovetskic0f7edb2008-06-13 11:50:44 +0100518#endif
Guennadi Liakhovetskic0f7edb2008-06-13 11:50:44 +0100519 platform_device_register(&pcm990_backlight_device);
520
Robert Schwebel2e927b72008-01-08 08:52:04 +0100521 /* MMC */
522 pxa_set_mci_info(&pcm990_mci_platform_data);
523
524 /* USB host */
525 pxa_set_ohci_info(&pcm990_ohci_platform_data);
526
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +0200527 pxa_set_i2c_info(NULL);
Mark Brown9f19d632008-06-10 12:30:05 +0100528 pxa_set_ac97_info(NULL);
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +0200529
530#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
Antonio Ospite0e851902009-11-27 21:31:36 +0100531 pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +0200532 pxa_set_camera_info(&pcm990_pxacamera_platform_data);
533
Guennadi Liakhovetski6a566fb2008-06-16 08:16:46 +0100534 i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices));
Guennadi Liakhovetski4a3d3ab2009-05-13 11:33:43 +0200535
536 platform_device_register(&pcm990_camera[0]);
537 platform_device_register(&pcm990_camera[1]);
Guennadi Liakhovetski58762e772008-04-06 23:08:15 +0200538#endif
539
Guennadi Liakhovetski6a566fb2008-06-16 08:16:46 +0100540 printk(KERN_INFO "PCM-990 Evaluation baseboard initialized\n");
Robert Schwebel2e927b72008-01-08 08:52:04 +0100541}