blob: 687417a936988014da451cfaf8676fad1e08aa55 [file] [log] [blame]
Jürgen Schindele326764a2006-06-29 16:01:43 +01001/*
2 * linux/arch/arm/mach-pxa/trizeps4.c
3 *
4 * Support for the Keith und Koep Trizeps4 Module Platform.
5 *
6 * Author: Jürgen Schindele
7 * Created: 20 02, 2006
8 * Copyright: Jürgen Schindele
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/init.h>
16#include <linux/kernel.h>
17#include <linux/platform_device.h>
Jürgen Schindele326764a2006-06-29 16:01:43 +010018#include <linux/interrupt.h>
19#include <linux/sched.h>
20#include <linux/bitops.h>
21#include <linux/fb.h>
22#include <linux/ioport.h>
23#include <linux/delay.h>
Jürgen Schindele642aa662008-08-18 21:45:03 +010024#include <linux/gpio.h>
25#include <linux/dm9000.h>
Jürgen Schindelec9184f52007-05-07 19:48:44 +010026#include <linux/mtd/physmap.h>
Jürgen Schindele326764a2006-06-29 16:01:43 +010027#include <linux/mtd/partitions.h>
Sebastian Andrzej Siewiorb4593962011-02-23 12:38:16 +010028#include <linux/i2c/pxa-i2c.h>
Jürgen Schindele326764a2006-06-29 16:01:43 +010029
30#include <asm/types.h>
31#include <asm/setup.h>
32#include <asm/memory.h>
33#include <asm/mach-types.h>
Jürgen Schindele326764a2006-06-29 16:01:43 +010034#include <asm/irq.h>
35#include <asm/sizes.h>
36
37#include <asm/mach/arch.h>
38#include <asm/mach/map.h>
39#include <asm/mach/irq.h>
40#include <asm/mach/flash.h>
41
Eric Miao51c62982009-01-02 23:17:22 +080042#include <mach/pxa27x.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010043#include <mach/trizeps4.h>
44#include <mach/audio.h>
45#include <mach/pxafb.h>
46#include <mach/mmc.h>
47#include <mach/irda.h>
48#include <mach/ohci.h>
Marek Vasutad68bb92010-11-03 16:29:35 +010049#include <mach/smemc.h>
Jürgen Schindele326764a2006-06-29 16:01:43 +010050
51#include "generic.h"
Russell King46c41e62007-05-15 15:39:36 +010052#include "devices.h"
Jürgen Schindele326764a2006-06-29 16:01:43 +010053
Jürgen Schindele642aa662008-08-18 21:45:03 +010054/* comment out the following line if you want to use the
55 * Standard UART from PXA for serial / irda transmission
56 * and acivate it if you have status leds connected */
57#define STATUS_LEDS_ON_STUART_PINS 1
58
59/*****************************************************************************
60 * MultiFunctionPins of CPU
61 *****************************************************************************/
62static unsigned long trizeps4_pin_config[] __initdata = {
63 /* Chip Selects */
64 GPIO15_nCS_1, /* DiskOnChip CS */
65 GPIO93_GPIO, /* TRIZEPS4_DOC_IRQ */
66 GPIO94_GPIO, /* DOC lock */
67
68 GPIO78_nCS_2, /* DM9000 CS */
69 GPIO101_GPIO, /* TRIZEPS4_ETH_IRQ */
70
71 GPIO79_nCS_3, /* Logic CS */
72 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, /* Logic irq */
73
Eric Miaoc11b6a42010-01-04 17:00:13 +080074 /* AC97 */
75 GPIO28_AC97_BITCLK,
76 GPIO29_AC97_SDATA_IN_0,
77 GPIO30_AC97_SDATA_OUT,
78 GPIO31_AC97_SYNC,
79
Jürgen Schindele642aa662008-08-18 21:45:03 +010080 /* LCD - 16bpp Active TFT */
Eric Miaobedbda92010-01-04 11:37:14 +080081 GPIOxx_LCD_TFT_16BPP,
Jürgen Schindele642aa662008-08-18 21:45:03 +010082
83 /* UART */
84 GPIO9_FFUART_CTS,
85 GPIO10_FFUART_DCD,
86 GPIO16_FFUART_TXD,
87 GPIO33_FFUART_DSR,
88 GPIO38_FFUART_RI,
89 GPIO82_FFUART_DTR,
90 GPIO83_FFUART_RTS,
91 GPIO96_FFUART_RXD,
92
93 GPIO42_BTUART_RXD,
94 GPIO43_BTUART_TXD,
95 GPIO44_BTUART_CTS,
96 GPIO45_BTUART_RTS,
97#ifdef STATUS_LEDS_ON_STUART_PINS
98 GPIO46_GPIO,
99 GPIO47_GPIO,
100#else
101 GPIO46_STUART_RXD,
102 GPIO47_STUART_TXD,
103#endif
104 /* PCMCIA */
105 GPIO11_GPIO, /* TRIZEPS4_CD_IRQ */
106 GPIO13_GPIO, /* TRIZEPS4_READY_NINT */
107 GPIO48_nPOE,
108 GPIO49_nPWE,
109 GPIO50_nPIOR,
110 GPIO51_nPIOW,
111 GPIO54_nPCE_2,
112 GPIO55_nPREG,
113 GPIO56_nPWAIT,
114 GPIO57_nIOIS16,
115 GPIO102_nPCE_1,
116 GPIO104_PSKTSEL,
117
118 /* MultiMediaCard */
119 GPIO32_MMC_CLK,
120 GPIO92_MMC_DAT_0,
121 GPIO109_MMC_DAT_1,
122 GPIO110_MMC_DAT_2,
123 GPIO111_MMC_DAT_3,
124 GPIO112_MMC_CMD,
125 GPIO12_GPIO, /* TRIZEPS4_MMC_IRQ */
126
127 /* USB OHCI */
128 GPIO88_USBH1_PWR, /* USBHPWR1 */
129 GPIO89_USBH1_PEN, /* USBHPEN1 */
130
131 /* I2C */
132 GPIO117_I2C_SCL,
133 GPIO118_I2C_SDA,
134};
135
136static unsigned long trizeps4wl_pin_config[] __initdata = {
137 /* SSP 2 */
138 GPIO14_SSP2_SFRM,
139 GPIO19_SSP2_SCLK,
140 GPIO53_GPIO, /* TRIZEPS4_SPI_IRQ */
141 GPIO86_SSP2_RXD,
142 GPIO87_SSP2_TXD,
143};
144
145/****************************************************************************
Jürgen Schindele326764a2006-06-29 16:01:43 +0100146 * ONBOARD FLASH
Jürgen Schindele642aa662008-08-18 21:45:03 +0100147 ****************************************************************************/
Jürgen Schindele326764a2006-06-29 16:01:43 +0100148static struct mtd_partition trizeps4_partitions[] = {
149 {
150 .name = "Bootloader",
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100151 .offset = 0x00000000,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100152 .size = 0x00040000,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100153 .mask_flags = MTD_WRITEABLE /* force read-only */
Jürgen Schindele642aa662008-08-18 21:45:03 +0100154 }, {
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100155 .name = "Backup",
156 .offset = 0x00040000,
157 .size = 0x00040000,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100158 }, {
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100159 .name = "Image",
160 .offset = 0x00080000,
161 .size = 0x01080000,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100162 }, {
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100163 .name = "IPSM",
164 .offset = 0x01100000,
165 .size = 0x00e00000,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100166 }, {
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100167 .name = "Registry",
168 .offset = 0x01f00000,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100169 .size = MTDPART_SIZ_FULL,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100170 }
171};
172
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100173static struct physmap_flash_data trizeps4_flash_data[] = {
Jürgen Schindele326764a2006-06-29 16:01:43 +0100174 {
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100175 .width = 4, /* bankwidth in bytes */
Jürgen Schindele326764a2006-06-29 16:01:43 +0100176 .parts = trizeps4_partitions,
177 .nr_parts = ARRAY_SIZE(trizeps4_partitions)
178 }
179};
180
181static struct resource flash_resource = {
182 .start = PXA_CS0_PHYS,
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100183 .end = PXA_CS0_PHYS + SZ_32M - 1,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100184 .flags = IORESOURCE_MEM,
185};
186
187static struct platform_device flash_device = {
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100188 .name = "physmap-flash",
Jürgen Schindele326764a2006-06-29 16:01:43 +0100189 .id = 0,
190 .dev = {
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100191 .platform_data = trizeps4_flash_data,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100192 },
193 .resource = &flash_resource,
194 .num_resources = 1,
195};
196
Jürgen Schindele642aa662008-08-18 21:45:03 +0100197/****************************************************************************
Jürgen Schindele326764a2006-06-29 16:01:43 +0100198 * DAVICOM DM9000 Ethernet
Jürgen Schindele642aa662008-08-18 21:45:03 +0100199 ****************************************************************************/
Jürgen Schindele326764a2006-06-29 16:01:43 +0100200static struct resource dm9000_resources[] = {
201 [0] = {
202 .start = TRIZEPS4_ETH_PHYS+0x300,
203 .end = TRIZEPS4_ETH_PHYS+0x400-1,
204 .flags = IORESOURCE_MEM,
205 },
206 [1] = {
207 .start = TRIZEPS4_ETH_PHYS+0x8300,
208 .end = TRIZEPS4_ETH_PHYS+0x8400-1,
209 .flags = IORESOURCE_MEM,
210 },
211 [2] = {
212 .start = TRIZEPS4_ETH_IRQ,
213 .end = TRIZEPS4_ETH_IRQ,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100214 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100215 },
216};
217
Jürgen Schindele642aa662008-08-18 21:45:03 +0100218static struct dm9000_plat_data tri_dm9000_platdata = {
219 .flags = DM9000_PLATF_32BITONLY,
220};
221
Jürgen Schindele326764a2006-06-29 16:01:43 +0100222static struct platform_device dm9000_device = {
223 .name = "dm9000",
224 .id = -1,
225 .num_resources = ARRAY_SIZE(dm9000_resources),
226 .resource = dm9000_resources,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100227 .dev = {
228 .platform_data = &tri_dm9000_platdata,
229 }
Jürgen Schindele326764a2006-06-29 16:01:43 +0100230};
231
Jürgen Schindele642aa662008-08-18 21:45:03 +0100232/****************************************************************************
233 * LED's on GPIO pins of PXA
234 ****************************************************************************/
235static struct gpio_led trizeps4_led[] = {
236#ifdef STATUS_LEDS_ON_STUART_PINS
Jürgen Schindele326764a2006-06-29 16:01:43 +0100237 {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100238 .name = "led0:orange:heartbeat", /* */
239 .default_trigger = "heartbeat",
240 .gpio = GPIO_HEARTBEAT_LED,
241 .active_low = 1,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100242 },
243 {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100244 .name = "led1:yellow:cpubusy", /* */
245 .default_trigger = "cpu-busy",
246 .gpio = GPIO_SYS_BUSY_LED,
247 .active_low = 1,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100248 },
249#endif
250};
251
Jürgen Schindele642aa662008-08-18 21:45:03 +0100252static struct gpio_led_platform_data trizeps4_led_data = {
253 .leds = trizeps4_led,
254 .num_leds = ARRAY_SIZE(trizeps4_led),
255};
256
257static struct platform_device leds_devices = {
258 .name = "leds-gpio",
259 .id = -1,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100260 .dev = {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100261 .platform_data = &trizeps4_led_data,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100262 },
Jürgen Schindele326764a2006-06-29 16:01:43 +0100263};
264
Jürgen Schindele642aa662008-08-18 21:45:03 +0100265static struct platform_device *trizeps4_devices[] __initdata = {
Jürgen Schindele326764a2006-06-29 16:01:43 +0100266 &flash_device,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100267 &dm9000_device,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100268 &leds_devices,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100269};
270
Jürgen Schindele642aa662008-08-18 21:45:03 +0100271static struct platform_device *trizeps4wl_devices[] __initdata = {
272 &flash_device,
273 &leds_devices,
274};
275
Jürgen Schindele326764a2006-06-29 16:01:43 +0100276static short trizeps_conxs_bcr;
277
278/* PCCARD power switching supports only 3,3V */
279void board_pcmcia_power(int power)
280{
281 if (power) {
282 /* switch power on, put in reset and enable buffers */
283 trizeps_conxs_bcr |= power;
284 trizeps_conxs_bcr |= ConXS_BCR_CF_RESET;
Jürgen Schindele642aa662008-08-18 21:45:03 +0100285 trizeps_conxs_bcr &= ~ConXS_BCR_CF_BUF_EN;
286 BCR_writew(trizeps_conxs_bcr);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100287 /* wait a little */
288 udelay(2000);
289 /* take reset away */
Jürgen Schindele642aa662008-08-18 21:45:03 +0100290 trizeps_conxs_bcr &= ~ConXS_BCR_CF_RESET;
291 BCR_writew(trizeps_conxs_bcr);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100292 udelay(2000);
293 } else {
294 /* put in reset */
295 trizeps_conxs_bcr |= ConXS_BCR_CF_RESET;
Jürgen Schindele642aa662008-08-18 21:45:03 +0100296 BCR_writew(trizeps_conxs_bcr);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100297 udelay(1000);
298 /* switch power off */
Jürgen Schindele642aa662008-08-18 21:45:03 +0100299 trizeps_conxs_bcr &= ~0xf;
300 BCR_writew(trizeps_conxs_bcr);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100301 }
Jürgen Schindele642aa662008-08-18 21:45:03 +0100302 pr_debug("%s: o%s 0x%x\n", __func__, power ? "n" : "ff",
303 trizeps_conxs_bcr);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100304}
Jürgen Schindele642aa662008-08-18 21:45:03 +0100305EXPORT_SYMBOL(board_pcmcia_power);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100306
307/* backlight power switching for LCD panel */
308static void board_backlight_power(int on)
309{
Jürgen Schindele642aa662008-08-18 21:45:03 +0100310 if (on)
Jürgen Schindele326764a2006-06-29 16:01:43 +0100311 trizeps_conxs_bcr |= ConXS_BCR_L_DISP;
Jürgen Schindele642aa662008-08-18 21:45:03 +0100312 else
Jürgen Schindele326764a2006-06-29 16:01:43 +0100313 trizeps_conxs_bcr &= ~ConXS_BCR_L_DISP;
Jürgen Schindele642aa662008-08-18 21:45:03 +0100314
315 pr_debug("%s: o%s 0x%x\n", __func__, on ? "n" : "ff",
316 trizeps_conxs_bcr);
317 BCR_writew(trizeps_conxs_bcr);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100318}
319
Jürgen Schindele642aa662008-08-18 21:45:03 +0100320/* a I2C based RTC is known on CONXS board */
321static struct i2c_board_info trizeps4_i2c_devices[] __initdata = {
322 { I2C_BOARD_INFO("rtc-pcf8593", 0x51) }
323};
Jürgen Schindele326764a2006-06-29 16:01:43 +0100324
Jürgen Schindele642aa662008-08-18 21:45:03 +0100325/****************************************************************************
326 * MMC card slot external to module
327 ****************************************************************************/
328static int trizeps4_mci_init(struct device *dev, irq_handler_t mci_detect_int,
329 void *data)
Jürgen Schindele326764a2006-06-29 16:01:43 +0100330{
331 int err;
Jürgen Schindele326764a2006-06-29 16:01:43 +0100332
Thomas Gleixner52e405e2006-07-03 02:20:05 +0200333 err = request_irq(TRIZEPS4_MMC_IRQ, mci_detect_int,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100334 IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_SAMPLE_RANDOM,
335 "MMC card detect", data);
336 if (err) {
337 printk(KERN_ERR "trizeps4_mci_init: MMC/SD: can't request"
338 "MMC card detect IRQ\n");
339 return -1;
340 }
341 return 0;
Jürgen Schindele326764a2006-06-29 16:01:43 +0100342}
343
344static void trizeps4_mci_exit(struct device *dev, void *data)
345{
346 free_irq(TRIZEPS4_MMC_IRQ, data);
347}
348
349static struct pxamci_platform_data trizeps4_mci_platform_data = {
350 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
Eric Miaof97cab22010-04-14 07:00:42 +0800351 .detect_delay_ms= 10,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100352 .init = trizeps4_mci_init,
353 .exit = trizeps4_mci_exit,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100354 .get_ro = NULL, /* write-protection not supported */
355 .setpower = NULL, /* power-switching not supported */
Robert Jarzmik7a648252009-07-06 22:16:42 +0200356 .gpio_card_detect = -1,
357 .gpio_card_ro = -1,
358 .gpio_power = -1,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100359};
360
Jürgen Schindele642aa662008-08-18 21:45:03 +0100361/****************************************************************************
362 * IRDA mode switching on stuart
363 ****************************************************************************/
364#ifndef STATUS_LEDS_ON_STUART_PINS
365static short trizeps_conxs_ircr;
366
367static int trizeps4_irda_startup(struct device *dev)
368{
369 trizeps_conxs_ircr &= ~ConXS_IRCR_SD;
370 IRCR_writew(trizeps_conxs_ircr);
371 return 0;
372}
373
374static void trizeps4_irda_shutdown(struct device *dev)
375{
376 trizeps_conxs_ircr |= ConXS_IRCR_SD;
377 IRCR_writew(trizeps_conxs_ircr);
378}
379
380static void trizeps4_irda_transceiver_mode(struct device *dev, int mode)
381{
382 unsigned long flags;
383
384 local_irq_save(flags);
385 /* Switch mode */
386 if (mode & IR_SIRMODE)
387 trizeps_conxs_ircr &= ~ConXS_IRCR_MODE; /* Slow mode */
Mariusz Kozlowski778c4c82008-10-18 15:15:16 +0200388 else if (mode & IR_FIRMODE)
Jürgen Schindele642aa662008-08-18 21:45:03 +0100389 trizeps_conxs_ircr |= ConXS_IRCR_MODE; /* Fast mode */
390
391 /* Switch power */
392 if (mode & IR_OFF)
393 trizeps_conxs_ircr |= ConXS_IRCR_SD;
394 else
395 trizeps_conxs_ircr &= ~ConXS_IRCR_SD;
396
397 IRCR_writew(trizeps_conxs_ircr);
398 local_irq_restore(flags);
399
400 pxa2xx_transceiver_mode(dev, mode);
401}
402
Jürgen Schindele326764a2006-06-29 16:01:43 +0100403static struct pxaficp_platform_data trizeps4_ficp_platform_data = {
Marek Vasutc4bd0172009-07-17 12:50:43 +0200404 .gpio_pwdown = -1,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100405 .transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF,
406 .transceiver_mode = trizeps4_irda_transceiver_mode,
407 .startup = trizeps4_irda_startup,
408 .shutdown = trizeps4_irda_shutdown,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100409};
Jürgen Schindele642aa662008-08-18 21:45:03 +0100410#endif
Jürgen Schindele326764a2006-06-29 16:01:43 +0100411
Jürgen Schindele642aa662008-08-18 21:45:03 +0100412/****************************************************************************
413 * OHCI USB port
414 ****************************************************************************/
Jürgen Schindele326764a2006-06-29 16:01:43 +0100415static struct pxaohci_platform_data trizeps4_ohci_platform_data = {
416 .port_mode = PMM_PERPORT_MODE,
Eric Miao097b5332008-09-27 15:49:57 +0800417 .flags = ENABLE_PORT_ALL | POWER_CONTROL_LOW | POWER_SENSE_LOW,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100418};
419
420static struct map_desc trizeps4_io_desc[] __initdata = {
421 { /* ConXS CFSR */
422 .virtual = TRIZEPS4_CFSR_VIRT,
423 .pfn = __phys_to_pfn(TRIZEPS4_CFSR_PHYS),
424 .length = 0x00001000,
425 .type = MT_DEVICE
426 },
427 { /* ConXS BCR */
428 .virtual = TRIZEPS4_BOCR_VIRT,
429 .pfn = __phys_to_pfn(TRIZEPS4_BOCR_PHYS),
430 .length = 0x00001000,
431 .type = MT_DEVICE
432 },
433 { /* ConXS IRCR */
434 .virtual = TRIZEPS4_IRCR_VIRT,
435 .pfn = __phys_to_pfn(TRIZEPS4_IRCR_PHYS),
436 .length = 0x00001000,
437 .type = MT_DEVICE
438 },
439 { /* ConXS DCR */
440 .virtual = TRIZEPS4_DICR_VIRT,
441 .pfn = __phys_to_pfn(TRIZEPS4_DICR_PHYS),
442 .length = 0x00001000,
443 .type = MT_DEVICE
444 },
445 { /* ConXS UPSR */
446 .virtual = TRIZEPS4_UPSR_VIRT,
447 .pfn = __phys_to_pfn(TRIZEPS4_UPSR_PHYS),
448 .length = 0x00001000,
449 .type = MT_DEVICE
450 }
451};
452
Richard Purdied14b2722006-09-20 22:54:21 +0100453static struct pxafb_mode_info sharp_lcd_mode = {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100454 .pixclock = 78000,
455 .xres = 640,
456 .yres = 480,
457 .bpp = 8,
458 .hsync_len = 4,
459 .left_margin = 4,
460 .right_margin = 4,
461 .vsync_len = 2,
462 .upper_margin = 0,
463 .lower_margin = 0,
464 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
465 .cmap_greyscale = 0,
Richard Purdied14b2722006-09-20 22:54:21 +0100466};
467
468static struct pxafb_mach_info sharp_lcd = {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100469 .modes = &sharp_lcd_mode,
470 .num_modes = 1,
471 .lcd_conn = LCD_COLOR_DSTN_16BPP | LCD_PCLK_EDGE_FALL,
472 .cmap_inverse = 0,
473 .cmap_static = 0,
474 .pxafb_backlight_power = board_backlight_power,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100475};
476
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100477static struct pxafb_mode_info toshiba_lcd_mode = {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100478 .pixclock = 39720,
479 .xres = 640,
480 .yres = 480,
481 .bpp = 8,
482 .hsync_len = 63,
483 .left_margin = 12,
484 .right_margin = 12,
485 .vsync_len = 4,
486 .upper_margin = 32,
487 .lower_margin = 10,
488 .sync = 0,
489 .cmap_greyscale = 0,
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100490};
491
492static struct pxafb_mach_info toshiba_lcd = {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100493 .modes = &toshiba_lcd_mode,
494 .num_modes = 1,
495 .lcd_conn = (LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL),
496 .cmap_inverse = 0,
497 .cmap_static = 0,
498 .pxafb_backlight_power = board_backlight_power,
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100499};
500
Jürgen Schindele326764a2006-06-29 16:01:43 +0100501static void __init trizeps4_init(void)
502{
Jürgen Schindele642aa662008-08-18 21:45:03 +0100503 pxa2xx_mfp_config(ARRAY_AND_SIZE(trizeps4_pin_config));
504 if (machine_is_trizeps4wl()) {
505 pxa2xx_mfp_config(ARRAY_AND_SIZE(trizeps4wl_pin_config));
506 platform_add_devices(trizeps4wl_devices,
507 ARRAY_SIZE(trizeps4wl_devices));
508 } else {
509 platform_add_devices(trizeps4_devices,
510 ARRAY_SIZE(trizeps4_devices));
511 }
Jürgen Schindele326764a2006-06-29 16:01:43 +0100512
Russell Kingcc155c62009-11-09 13:34:08 +0800513 pxa_set_ffuart_info(NULL);
514 pxa_set_btuart_info(NULL);
515 pxa_set_stuart_info(NULL);
516
Jürgen Schindele642aa662008-08-18 21:45:03 +0100517 if (0) /* dont know how to determine LCD */
Russell King - ARM Linux4321e1a2011-02-15 15:37:30 +0800518 pxa_set_fb_info(NULL, &sharp_lcd);
Jürgen Schindele642aa662008-08-18 21:45:03 +0100519 else
Russell King - ARM Linux4321e1a2011-02-15 15:37:30 +0800520 pxa_set_fb_info(NULL, &toshiba_lcd);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100521
522 pxa_set_mci_info(&trizeps4_mci_platform_data);
Jürgen Schindele642aa662008-08-18 21:45:03 +0100523#ifndef STATUS_LEDS_ON_STUART_PINS
Jürgen Schindele326764a2006-06-29 16:01:43 +0100524 pxa_set_ficp_info(&trizeps4_ficp_platform_data);
Jürgen Schindele642aa662008-08-18 21:45:03 +0100525#endif
Jürgen Schindele326764a2006-06-29 16:01:43 +0100526 pxa_set_ohci_info(&trizeps4_ohci_platform_data);
Mark Brown9f19d632008-06-10 12:30:05 +0100527 pxa_set_ac97_info(NULL);
Jürgen Schindele642aa662008-08-18 21:45:03 +0100528 pxa_set_i2c_info(NULL);
529 i2c_register_board_info(0, trizeps4_i2c_devices,
530 ARRAY_SIZE(trizeps4_i2c_devices));
Jürgen Schindele326764a2006-06-29 16:01:43 +0100531
Jürgen Schindele326764a2006-06-29 16:01:43 +0100532 /* this is the reset value */
533 trizeps_conxs_bcr = 0x00A0;
Christoph Egger0846efa2010-07-04 23:31:37 +0800534
Jürgen Schindele642aa662008-08-18 21:45:03 +0100535 BCR_writew(trizeps_conxs_bcr);
536 board_backlight_power(1);
537}
Jürgen Schindele326764a2006-06-29 16:01:43 +0100538
Jürgen Schindele642aa662008-08-18 21:45:03 +0100539static void __init trizeps4_map_io(void)
540{
Marek Vasut851982c2010-10-11 02:20:19 +0200541 pxa27x_map_io();
Jürgen Schindele642aa662008-08-18 21:45:03 +0100542 iotable_init(trizeps4_io_desc, ARRAY_SIZE(trizeps4_io_desc));
543
Marek Vasutad68bb92010-11-03 16:29:35 +0100544 if ((__raw_readl(MSC0) & 0x8) && (__raw_readl(BOOT_DEF) & 0x1)) {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100545 /* if flash is 16 bit wide its a Trizeps4 WL */
546 __machine_arch_type = MACH_TYPE_TRIZEPS4WL;
547 trizeps4_flash_data[0].width = 2;
548 } else {
549 /* if flash is 32 bit wide its a Trizeps4 */
550 __machine_arch_type = MACH_TYPE_TRIZEPS4;
551 trizeps4_flash_data[0].width = 4;
552 }
Jürgen Schindele326764a2006-06-29 16:01:43 +0100553}
554
555MACHINE_START(TRIZEPS4, "Keith und Koep Trizeps IV module")
556 /* MAINTAINER("Jürgen Schindele") */
Jürgen Schindele326764a2006-06-29 16:01:43 +0100557 .boot_params = TRIZEPS4_SDRAM_BASE + 0x100,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100558 .init_machine = trizeps4_init,
559 .map_io = trizeps4_map_io,
Eric Miaocd491042007-06-22 04:14:09 +0100560 .init_irq = pxa27x_init_irq,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100561 .timer = &pxa_timer,
562MACHINE_END
563
Jürgen Schindele642aa662008-08-18 21:45:03 +0100564MACHINE_START(TRIZEPS4WL, "Keith und Koep Trizeps IV-WL module")
565 /* MAINTAINER("Jürgen Schindele") */
Jürgen Schindele642aa662008-08-18 21:45:03 +0100566 .boot_params = TRIZEPS4_SDRAM_BASE + 0x100,
567 .init_machine = trizeps4_init,
568 .map_io = trizeps4_map_io,
569 .init_irq = pxa27x_init_irq,
570 .timer = &pxa_timer,
571MACHINE_END