blob: 441600845a72eee1be6b3e918d9ce5b76ed3fe51 [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>
18#include <linux/sysdev.h>
19#include <linux/interrupt.h>
20#include <linux/sched.h>
21#include <linux/bitops.h>
22#include <linux/fb.h>
23#include <linux/ioport.h>
24#include <linux/delay.h>
Jürgen Schindele642aa662008-08-18 21:45:03 +010025#include <linux/gpio.h>
26#include <linux/dm9000.h>
Jürgen Schindelec9184f52007-05-07 19:48:44 +010027#include <linux/mtd/physmap.h>
Jürgen Schindele326764a2006-06-29 16:01:43 +010028#include <linux/mtd/partitions.h>
29
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>
Jürgen Schindele642aa662008-08-18 21:45:03 +010043#include <mach/pxa2xx_spi.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010044#include <mach/trizeps4.h>
45#include <mach/audio.h>
46#include <mach/pxafb.h>
47#include <mach/mmc.h>
48#include <mach/irda.h>
49#include <mach/ohci.h>
Eric Miaof0a83702009-04-13 15:03:11 +080050#include <plat/i2c.h>
Jürgen Schindele326764a2006-06-29 16:01:43 +010051
52#include "generic.h"
Russell King46c41e62007-05-15 15:39:36 +010053#include "devices.h"
Jürgen Schindele326764a2006-06-29 16:01:43 +010054
Jürgen Schindele642aa662008-08-18 21:45:03 +010055/* comment out the following line if you want to use the
56 * Standard UART from PXA for serial / irda transmission
57 * and acivate it if you have status leds connected */
58#define STATUS_LEDS_ON_STUART_PINS 1
59
60/*****************************************************************************
61 * MultiFunctionPins of CPU
62 *****************************************************************************/
63static unsigned long trizeps4_pin_config[] __initdata = {
64 /* Chip Selects */
65 GPIO15_nCS_1, /* DiskOnChip CS */
66 GPIO93_GPIO, /* TRIZEPS4_DOC_IRQ */
67 GPIO94_GPIO, /* DOC lock */
68
69 GPIO78_nCS_2, /* DM9000 CS */
70 GPIO101_GPIO, /* TRIZEPS4_ETH_IRQ */
71
72 GPIO79_nCS_3, /* Logic CS */
73 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, /* Logic irq */
74
75 /* LCD - 16bpp Active TFT */
Eric Miaobedbda92010-01-04 11:37:14 +080076 GPIOxx_LCD_TFT_16BPP,
Jürgen Schindele642aa662008-08-18 21:45:03 +010077
78 /* UART */
79 GPIO9_FFUART_CTS,
80 GPIO10_FFUART_DCD,
81 GPIO16_FFUART_TXD,
82 GPIO33_FFUART_DSR,
83 GPIO38_FFUART_RI,
84 GPIO82_FFUART_DTR,
85 GPIO83_FFUART_RTS,
86 GPIO96_FFUART_RXD,
87
88 GPIO42_BTUART_RXD,
89 GPIO43_BTUART_TXD,
90 GPIO44_BTUART_CTS,
91 GPIO45_BTUART_RTS,
92#ifdef STATUS_LEDS_ON_STUART_PINS
93 GPIO46_GPIO,
94 GPIO47_GPIO,
95#else
96 GPIO46_STUART_RXD,
97 GPIO47_STUART_TXD,
98#endif
99 /* PCMCIA */
100 GPIO11_GPIO, /* TRIZEPS4_CD_IRQ */
101 GPIO13_GPIO, /* TRIZEPS4_READY_NINT */
102 GPIO48_nPOE,
103 GPIO49_nPWE,
104 GPIO50_nPIOR,
105 GPIO51_nPIOW,
106 GPIO54_nPCE_2,
107 GPIO55_nPREG,
108 GPIO56_nPWAIT,
109 GPIO57_nIOIS16,
110 GPIO102_nPCE_1,
111 GPIO104_PSKTSEL,
112
113 /* MultiMediaCard */
114 GPIO32_MMC_CLK,
115 GPIO92_MMC_DAT_0,
116 GPIO109_MMC_DAT_1,
117 GPIO110_MMC_DAT_2,
118 GPIO111_MMC_DAT_3,
119 GPIO112_MMC_CMD,
120 GPIO12_GPIO, /* TRIZEPS4_MMC_IRQ */
121
122 /* USB OHCI */
123 GPIO88_USBH1_PWR, /* USBHPWR1 */
124 GPIO89_USBH1_PEN, /* USBHPEN1 */
125
126 /* I2C */
127 GPIO117_I2C_SCL,
128 GPIO118_I2C_SDA,
129};
130
131static unsigned long trizeps4wl_pin_config[] __initdata = {
132 /* SSP 2 */
133 GPIO14_SSP2_SFRM,
134 GPIO19_SSP2_SCLK,
135 GPIO53_GPIO, /* TRIZEPS4_SPI_IRQ */
136 GPIO86_SSP2_RXD,
137 GPIO87_SSP2_TXD,
138};
139
140/****************************************************************************
Jürgen Schindele326764a2006-06-29 16:01:43 +0100141 * ONBOARD FLASH
Jürgen Schindele642aa662008-08-18 21:45:03 +0100142 ****************************************************************************/
Jürgen Schindele326764a2006-06-29 16:01:43 +0100143static struct mtd_partition trizeps4_partitions[] = {
144 {
145 .name = "Bootloader",
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100146 .offset = 0x00000000,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100147 .size = 0x00040000,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100148 .mask_flags = MTD_WRITEABLE /* force read-only */
Jürgen Schindele642aa662008-08-18 21:45:03 +0100149 }, {
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100150 .name = "Backup",
151 .offset = 0x00040000,
152 .size = 0x00040000,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100153 }, {
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100154 .name = "Image",
155 .offset = 0x00080000,
156 .size = 0x01080000,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100157 }, {
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100158 .name = "IPSM",
159 .offset = 0x01100000,
160 .size = 0x00e00000,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100161 }, {
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100162 .name = "Registry",
163 .offset = 0x01f00000,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100164 .size = MTDPART_SIZ_FULL,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100165 }
166};
167
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100168static struct physmap_flash_data trizeps4_flash_data[] = {
Jürgen Schindele326764a2006-06-29 16:01:43 +0100169 {
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100170 .width = 4, /* bankwidth in bytes */
Jürgen Schindele326764a2006-06-29 16:01:43 +0100171 .parts = trizeps4_partitions,
172 .nr_parts = ARRAY_SIZE(trizeps4_partitions)
173 }
174};
175
176static struct resource flash_resource = {
177 .start = PXA_CS0_PHYS,
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100178 .end = PXA_CS0_PHYS + SZ_32M - 1,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100179 .flags = IORESOURCE_MEM,
180};
181
182static struct platform_device flash_device = {
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100183 .name = "physmap-flash",
Jürgen Schindele326764a2006-06-29 16:01:43 +0100184 .id = 0,
185 .dev = {
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100186 .platform_data = trizeps4_flash_data,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100187 },
188 .resource = &flash_resource,
189 .num_resources = 1,
190};
191
Jürgen Schindele642aa662008-08-18 21:45:03 +0100192/****************************************************************************
Jürgen Schindele326764a2006-06-29 16:01:43 +0100193 * DAVICOM DM9000 Ethernet
Jürgen Schindele642aa662008-08-18 21:45:03 +0100194 ****************************************************************************/
Jürgen Schindele326764a2006-06-29 16:01:43 +0100195static struct resource dm9000_resources[] = {
196 [0] = {
197 .start = TRIZEPS4_ETH_PHYS+0x300,
198 .end = TRIZEPS4_ETH_PHYS+0x400-1,
199 .flags = IORESOURCE_MEM,
200 },
201 [1] = {
202 .start = TRIZEPS4_ETH_PHYS+0x8300,
203 .end = TRIZEPS4_ETH_PHYS+0x8400-1,
204 .flags = IORESOURCE_MEM,
205 },
206 [2] = {
207 .start = TRIZEPS4_ETH_IRQ,
208 .end = TRIZEPS4_ETH_IRQ,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100209 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100210 },
211};
212
Jürgen Schindele642aa662008-08-18 21:45:03 +0100213static struct dm9000_plat_data tri_dm9000_platdata = {
214 .flags = DM9000_PLATF_32BITONLY,
215};
216
Jürgen Schindele326764a2006-06-29 16:01:43 +0100217static struct platform_device dm9000_device = {
218 .name = "dm9000",
219 .id = -1,
220 .num_resources = ARRAY_SIZE(dm9000_resources),
221 .resource = dm9000_resources,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100222 .dev = {
223 .platform_data = &tri_dm9000_platdata,
224 }
Jürgen Schindele326764a2006-06-29 16:01:43 +0100225};
226
Jürgen Schindele642aa662008-08-18 21:45:03 +0100227/****************************************************************************
228 * LED's on GPIO pins of PXA
229 ****************************************************************************/
230static struct gpio_led trizeps4_led[] = {
231#ifdef STATUS_LEDS_ON_STUART_PINS
Jürgen Schindele326764a2006-06-29 16:01:43 +0100232 {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100233 .name = "led0:orange:heartbeat", /* */
234 .default_trigger = "heartbeat",
235 .gpio = GPIO_HEARTBEAT_LED,
236 .active_low = 1,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100237 },
238 {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100239 .name = "led1:yellow:cpubusy", /* */
240 .default_trigger = "cpu-busy",
241 .gpio = GPIO_SYS_BUSY_LED,
242 .active_low = 1,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100243 },
244#endif
245};
246
Jürgen Schindele642aa662008-08-18 21:45:03 +0100247static struct gpio_led_platform_data trizeps4_led_data = {
248 .leds = trizeps4_led,
249 .num_leds = ARRAY_SIZE(trizeps4_led),
250};
251
252static struct platform_device leds_devices = {
253 .name = "leds-gpio",
254 .id = -1,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100255 .dev = {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100256 .platform_data = &trizeps4_led_data,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100257 },
Jürgen Schindele326764a2006-06-29 16:01:43 +0100258};
259
Jürgen Schindele642aa662008-08-18 21:45:03 +0100260static struct platform_device *trizeps4_devices[] __initdata = {
Jürgen Schindele326764a2006-06-29 16:01:43 +0100261 &flash_device,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100262 &dm9000_device,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100263 &leds_devices,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100264};
265
Jürgen Schindele642aa662008-08-18 21:45:03 +0100266static struct platform_device *trizeps4wl_devices[] __initdata = {
267 &flash_device,
268 &leds_devices,
269};
270
Jürgen Schindele326764a2006-06-29 16:01:43 +0100271static short trizeps_conxs_bcr;
272
273/* PCCARD power switching supports only 3,3V */
274void board_pcmcia_power(int power)
275{
276 if (power) {
277 /* switch power on, put in reset and enable buffers */
278 trizeps_conxs_bcr |= power;
279 trizeps_conxs_bcr |= ConXS_BCR_CF_RESET;
Jürgen Schindele642aa662008-08-18 21:45:03 +0100280 trizeps_conxs_bcr &= ~ConXS_BCR_CF_BUF_EN;
281 BCR_writew(trizeps_conxs_bcr);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100282 /* wait a little */
283 udelay(2000);
284 /* take reset away */
Jürgen Schindele642aa662008-08-18 21:45:03 +0100285 trizeps_conxs_bcr &= ~ConXS_BCR_CF_RESET;
286 BCR_writew(trizeps_conxs_bcr);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100287 udelay(2000);
288 } else {
289 /* put in reset */
290 trizeps_conxs_bcr |= ConXS_BCR_CF_RESET;
Jürgen Schindele642aa662008-08-18 21:45:03 +0100291 BCR_writew(trizeps_conxs_bcr);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100292 udelay(1000);
293 /* switch power off */
Jürgen Schindele642aa662008-08-18 21:45:03 +0100294 trizeps_conxs_bcr &= ~0xf;
295 BCR_writew(trizeps_conxs_bcr);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100296 }
Jürgen Schindele642aa662008-08-18 21:45:03 +0100297 pr_debug("%s: o%s 0x%x\n", __func__, power ? "n" : "ff",
298 trizeps_conxs_bcr);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100299}
Jürgen Schindele642aa662008-08-18 21:45:03 +0100300EXPORT_SYMBOL(board_pcmcia_power);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100301
302/* backlight power switching for LCD panel */
303static void board_backlight_power(int on)
304{
Jürgen Schindele642aa662008-08-18 21:45:03 +0100305 if (on)
Jürgen Schindele326764a2006-06-29 16:01:43 +0100306 trizeps_conxs_bcr |= ConXS_BCR_L_DISP;
Jürgen Schindele642aa662008-08-18 21:45:03 +0100307 else
Jürgen Schindele326764a2006-06-29 16:01:43 +0100308 trizeps_conxs_bcr &= ~ConXS_BCR_L_DISP;
Jürgen Schindele642aa662008-08-18 21:45:03 +0100309
310 pr_debug("%s: o%s 0x%x\n", __func__, on ? "n" : "ff",
311 trizeps_conxs_bcr);
312 BCR_writew(trizeps_conxs_bcr);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100313}
314
Jürgen Schindele642aa662008-08-18 21:45:03 +0100315/* a I2C based RTC is known on CONXS board */
316static struct i2c_board_info trizeps4_i2c_devices[] __initdata = {
317 { I2C_BOARD_INFO("rtc-pcf8593", 0x51) }
318};
Jürgen Schindele326764a2006-06-29 16:01:43 +0100319
Jürgen Schindele642aa662008-08-18 21:45:03 +0100320/****************************************************************************
321 * MMC card slot external to module
322 ****************************************************************************/
323static int trizeps4_mci_init(struct device *dev, irq_handler_t mci_detect_int,
324 void *data)
Jürgen Schindele326764a2006-06-29 16:01:43 +0100325{
326 int err;
Jürgen Schindele326764a2006-06-29 16:01:43 +0100327
Thomas Gleixner52e405e2006-07-03 02:20:05 +0200328 err = request_irq(TRIZEPS4_MMC_IRQ, mci_detect_int,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100329 IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_SAMPLE_RANDOM,
330 "MMC card detect", data);
331 if (err) {
332 printk(KERN_ERR "trizeps4_mci_init: MMC/SD: can't request"
333 "MMC card detect IRQ\n");
334 return -1;
335 }
336 return 0;
Jürgen Schindele326764a2006-06-29 16:01:43 +0100337}
338
339static void trizeps4_mci_exit(struct device *dev, void *data)
340{
341 free_irq(TRIZEPS4_MMC_IRQ, data);
342}
343
344static struct pxamci_platform_data trizeps4_mci_platform_data = {
345 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100346 .detect_delay = 1,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100347 .init = trizeps4_mci_init,
348 .exit = trizeps4_mci_exit,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100349 .get_ro = NULL, /* write-protection not supported */
350 .setpower = NULL, /* power-switching not supported */
Robert Jarzmik7a648252009-07-06 22:16:42 +0200351 .gpio_card_detect = -1,
352 .gpio_card_ro = -1,
353 .gpio_power = -1,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100354};
355
Jürgen Schindele642aa662008-08-18 21:45:03 +0100356/****************************************************************************
357 * IRDA mode switching on stuart
358 ****************************************************************************/
359#ifndef STATUS_LEDS_ON_STUART_PINS
360static short trizeps_conxs_ircr;
361
362static int trizeps4_irda_startup(struct device *dev)
363{
364 trizeps_conxs_ircr &= ~ConXS_IRCR_SD;
365 IRCR_writew(trizeps_conxs_ircr);
366 return 0;
367}
368
369static void trizeps4_irda_shutdown(struct device *dev)
370{
371 trizeps_conxs_ircr |= ConXS_IRCR_SD;
372 IRCR_writew(trizeps_conxs_ircr);
373}
374
375static void trizeps4_irda_transceiver_mode(struct device *dev, int mode)
376{
377 unsigned long flags;
378
379 local_irq_save(flags);
380 /* Switch mode */
381 if (mode & IR_SIRMODE)
382 trizeps_conxs_ircr &= ~ConXS_IRCR_MODE; /* Slow mode */
Mariusz Kozlowski778c4c82008-10-18 15:15:16 +0200383 else if (mode & IR_FIRMODE)
Jürgen Schindele642aa662008-08-18 21:45:03 +0100384 trizeps_conxs_ircr |= ConXS_IRCR_MODE; /* Fast mode */
385
386 /* Switch power */
387 if (mode & IR_OFF)
388 trizeps_conxs_ircr |= ConXS_IRCR_SD;
389 else
390 trizeps_conxs_ircr &= ~ConXS_IRCR_SD;
391
392 IRCR_writew(trizeps_conxs_ircr);
393 local_irq_restore(flags);
394
395 pxa2xx_transceiver_mode(dev, mode);
396}
397
Jürgen Schindele326764a2006-06-29 16:01:43 +0100398static struct pxaficp_platform_data trizeps4_ficp_platform_data = {
Marek Vasutc4bd0172009-07-17 12:50:43 +0200399 .gpio_pwdown = -1,
Jürgen Schindele642aa662008-08-18 21:45:03 +0100400 .transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF,
401 .transceiver_mode = trizeps4_irda_transceiver_mode,
402 .startup = trizeps4_irda_startup,
403 .shutdown = trizeps4_irda_shutdown,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100404};
Jürgen Schindele642aa662008-08-18 21:45:03 +0100405#endif
Jürgen Schindele326764a2006-06-29 16:01:43 +0100406
Jürgen Schindele642aa662008-08-18 21:45:03 +0100407/****************************************************************************
408 * OHCI USB port
409 ****************************************************************************/
Jürgen Schindele326764a2006-06-29 16:01:43 +0100410static struct pxaohci_platform_data trizeps4_ohci_platform_data = {
411 .port_mode = PMM_PERPORT_MODE,
Eric Miao097b5332008-09-27 15:49:57 +0800412 .flags = ENABLE_PORT_ALL | POWER_CONTROL_LOW | POWER_SENSE_LOW,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100413};
414
415static struct map_desc trizeps4_io_desc[] __initdata = {
416 { /* ConXS CFSR */
417 .virtual = TRIZEPS4_CFSR_VIRT,
418 .pfn = __phys_to_pfn(TRIZEPS4_CFSR_PHYS),
419 .length = 0x00001000,
420 .type = MT_DEVICE
421 },
422 { /* ConXS BCR */
423 .virtual = TRIZEPS4_BOCR_VIRT,
424 .pfn = __phys_to_pfn(TRIZEPS4_BOCR_PHYS),
425 .length = 0x00001000,
426 .type = MT_DEVICE
427 },
428 { /* ConXS IRCR */
429 .virtual = TRIZEPS4_IRCR_VIRT,
430 .pfn = __phys_to_pfn(TRIZEPS4_IRCR_PHYS),
431 .length = 0x00001000,
432 .type = MT_DEVICE
433 },
434 { /* ConXS DCR */
435 .virtual = TRIZEPS4_DICR_VIRT,
436 .pfn = __phys_to_pfn(TRIZEPS4_DICR_PHYS),
437 .length = 0x00001000,
438 .type = MT_DEVICE
439 },
440 { /* ConXS UPSR */
441 .virtual = TRIZEPS4_UPSR_VIRT,
442 .pfn = __phys_to_pfn(TRIZEPS4_UPSR_PHYS),
443 .length = 0x00001000,
444 .type = MT_DEVICE
445 }
446};
447
Richard Purdied14b2722006-09-20 22:54:21 +0100448static struct pxafb_mode_info sharp_lcd_mode = {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100449 .pixclock = 78000,
450 .xres = 640,
451 .yres = 480,
452 .bpp = 8,
453 .hsync_len = 4,
454 .left_margin = 4,
455 .right_margin = 4,
456 .vsync_len = 2,
457 .upper_margin = 0,
458 .lower_margin = 0,
459 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
460 .cmap_greyscale = 0,
Richard Purdied14b2722006-09-20 22:54:21 +0100461};
462
463static struct pxafb_mach_info sharp_lcd = {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100464 .modes = &sharp_lcd_mode,
465 .num_modes = 1,
466 .lcd_conn = LCD_COLOR_DSTN_16BPP | LCD_PCLK_EDGE_FALL,
467 .cmap_inverse = 0,
468 .cmap_static = 0,
469 .pxafb_backlight_power = board_backlight_power,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100470};
471
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100472static struct pxafb_mode_info toshiba_lcd_mode = {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100473 .pixclock = 39720,
474 .xres = 640,
475 .yres = 480,
476 .bpp = 8,
477 .hsync_len = 63,
478 .left_margin = 12,
479 .right_margin = 12,
480 .vsync_len = 4,
481 .upper_margin = 32,
482 .lower_margin = 10,
483 .sync = 0,
484 .cmap_greyscale = 0,
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100485};
486
487static struct pxafb_mach_info toshiba_lcd = {
Jürgen Schindele642aa662008-08-18 21:45:03 +0100488 .modes = &toshiba_lcd_mode,
489 .num_modes = 1,
490 .lcd_conn = (LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL),
491 .cmap_inverse = 0,
492 .cmap_static = 0,
493 .pxafb_backlight_power = board_backlight_power,
Jürgen Schindelec9184f52007-05-07 19:48:44 +0100494};
495
Jürgen Schindele326764a2006-06-29 16:01:43 +0100496static void __init trizeps4_init(void)
497{
Jürgen Schindele642aa662008-08-18 21:45:03 +0100498 pxa2xx_mfp_config(ARRAY_AND_SIZE(trizeps4_pin_config));
499 if (machine_is_trizeps4wl()) {
500 pxa2xx_mfp_config(ARRAY_AND_SIZE(trizeps4wl_pin_config));
501 platform_add_devices(trizeps4wl_devices,
502 ARRAY_SIZE(trizeps4wl_devices));
503 } else {
504 platform_add_devices(trizeps4_devices,
505 ARRAY_SIZE(trizeps4_devices));
506 }
Jürgen Schindele326764a2006-06-29 16:01:43 +0100507
Russell Kingcc155c62009-11-09 13:34:08 +0800508 pxa_set_ffuart_info(NULL);
509 pxa_set_btuart_info(NULL);
510 pxa_set_stuart_info(NULL);
511
Jürgen Schindele642aa662008-08-18 21:45:03 +0100512 if (0) /* dont know how to determine LCD */
513 set_pxa_fb_info(&sharp_lcd);
514 else
515 set_pxa_fb_info(&toshiba_lcd);
Jürgen Schindele326764a2006-06-29 16:01:43 +0100516
517 pxa_set_mci_info(&trizeps4_mci_platform_data);
Jürgen Schindele642aa662008-08-18 21:45:03 +0100518#ifndef STATUS_LEDS_ON_STUART_PINS
Jürgen Schindele326764a2006-06-29 16:01:43 +0100519 pxa_set_ficp_info(&trizeps4_ficp_platform_data);
Jürgen Schindele642aa662008-08-18 21:45:03 +0100520#endif
Jürgen Schindele326764a2006-06-29 16:01:43 +0100521 pxa_set_ohci_info(&trizeps4_ohci_platform_data);
Mark Brown9f19d632008-06-10 12:30:05 +0100522 pxa_set_ac97_info(NULL);
Jürgen Schindele642aa662008-08-18 21:45:03 +0100523 pxa_set_i2c_info(NULL);
524 i2c_register_board_info(0, trizeps4_i2c_devices,
525 ARRAY_SIZE(trizeps4_i2c_devices));
Jürgen Schindele326764a2006-06-29 16:01:43 +0100526
Jürgen Schindele326764a2006-06-29 16:01:43 +0100527#ifdef CONFIG_IDE_PXA_CF
528 /* if boot direct from compact flash dont disable power */
529 trizeps_conxs_bcr = 0x0009;
530#else
531 /* this is the reset value */
532 trizeps_conxs_bcr = 0x00A0;
533#endif
Jürgen Schindele642aa662008-08-18 21:45:03 +0100534 BCR_writew(trizeps_conxs_bcr);
535 board_backlight_power(1);
536}
Jürgen Schindele326764a2006-06-29 16:01:43 +0100537
Jürgen Schindele642aa662008-08-18 21:45:03 +0100538static void __init trizeps4_map_io(void)
539{
540 pxa_map_io();
541 iotable_init(trizeps4_io_desc, ARRAY_SIZE(trizeps4_io_desc));
542
543 if ((MSC0 & 0x8) && (BOOT_DEF & 0x1)) {
544 /* if flash is 16 bit wide its a Trizeps4 WL */
545 __machine_arch_type = MACH_TYPE_TRIZEPS4WL;
546 trizeps4_flash_data[0].width = 2;
547 } else {
548 /* if flash is 32 bit wide its a Trizeps4 */
549 __machine_arch_type = MACH_TYPE_TRIZEPS4;
550 trizeps4_flash_data[0].width = 4;
551 }
Jürgen Schindele326764a2006-06-29 16:01:43 +0100552}
553
554MACHINE_START(TRIZEPS4, "Keith und Koep Trizeps IV module")
555 /* MAINTAINER("Jürgen Schindele") */
556 .phys_io = 0x40000000,
557 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
558 .boot_params = TRIZEPS4_SDRAM_BASE + 0x100,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100559 .init_machine = trizeps4_init,
560 .map_io = trizeps4_map_io,
Eric Miaocd491042007-06-22 04:14:09 +0100561 .init_irq = pxa27x_init_irq,
Jürgen Schindele326764a2006-06-29 16:01:43 +0100562 .timer = &pxa_timer,
563MACHINE_END
564
Jürgen Schindele642aa662008-08-18 21:45:03 +0100565MACHINE_START(TRIZEPS4WL, "Keith und Koep Trizeps IV-WL module")
566 /* MAINTAINER("Jürgen Schindele") */
567 .phys_io = 0x40000000,
568 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
569 .boot_params = TRIZEPS4_SDRAM_BASE + 0x100,
570 .init_machine = trizeps4_init,
571 .map_io = trizeps4_map_io,
572 .init_irq = pxa27x_init_irq,
573 .timer = &pxa_timer,
574MACHINE_END