blob: 77bb8e2c48c0ad7291c0df847284504fa69268eb [file] [log] [blame]
Ian Molton7dc96412008-08-19 12:14:21 +01001/*
2 * Hardware definitions for the Toshiba eseries PDAs
3 *
4 * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
5 *
6 * This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
Ian Moltonb1ae1b72008-09-26 13:38:59 +010015#include <linux/clk.h>
16#include <linux/platform_device.h>
17#include <linux/mfd/t7l66xb.h>
18#include <linux/mtd/nand.h>
19#include <linux/mtd/partitions.h>
Ian Molton7dc96412008-08-19 12:14:21 +010020
21#include <asm/setup.h>
22#include <asm/mach/arch.h>
23#include <asm/mach-types.h>
24
25#include <mach/mfp-pxa25x.h>
Ian Moltonb1ae1b72008-09-26 13:38:59 +010026#include <mach/pxa-regs.h>
Ian Molton7dc96412008-08-19 12:14:21 +010027#include <mach/hardware.h>
Ian Moltonb1ae1b72008-09-26 13:38:59 +010028#include <mach/eseries-gpio.h>
Ian Molton0ec3cf62008-08-19 13:01:28 +010029#include <mach/pxafb.h>
Ian Moltonebcce7b2008-08-19 13:34:56 +010030#include <mach/udc.h>
Russell King80b02c12009-01-08 10:01:47 +000031#include <mach/irqs.h>
Ian Molton0ec3cf62008-08-19 13:01:28 +010032
Ian Molton7dc96412008-08-19 12:14:21 +010033#include "generic.h"
34#include "eseries.h"
Ian Moltonb1ae1b72008-09-26 13:38:59 +010035#include "clock.h"
Ian Molton7dc96412008-08-19 12:14:21 +010036
Ian Molton0ec3cf62008-08-19 13:01:28 +010037/* ------------------------ E400 LCD definitions ------------------------ */
38
39static struct pxafb_mode_info e400_pxafb_mode_info = {
40 .pixclock = 140703,
41 .xres = 240,
42 .yres = 320,
43 .bpp = 16,
44 .hsync_len = 4,
45 .left_margin = 28,
46 .right_margin = 8,
47 .vsync_len = 3,
48 .upper_margin = 5,
49 .lower_margin = 6,
50 .sync = 0,
51};
52
53static struct pxafb_mach_info e400_pxafb_mach_info = {
54 .modes = &e400_pxafb_mode_info,
55 .num_modes = 1,
Eric Miao95873192008-12-07 17:49:01 +080056 .lcd_conn = LCD_COLOR_TFT_16BPP,
Ian Molton0ec3cf62008-08-19 13:01:28 +010057 .lccr3 = 0,
58 .pxafb_backlight_power = NULL,
59};
60
61/* ------------------------ E400 MFP config ----------------------------- */
62
Ian Molton7dc96412008-08-19 12:14:21 +010063static unsigned long e400_pin_config[] __initdata = {
64 /* Chip selects */
65 GPIO15_nCS_1, /* CS1 - Flash */
66 GPIO80_nCS_4, /* CS4 - TMIO */
67
68 /* Clocks */
69 GPIO12_32KHz,
70
71 /* BTUART */
72 GPIO42_BTUART_RXD,
73 GPIO43_BTUART_TXD,
74 GPIO44_BTUART_CTS,
Ian Moltonb1ae1b72008-09-26 13:38:59 +010075
76 /* TMIO controller */
77 GPIO19_GPIO, /* t7l66xb #PCLR */
78 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
Ian Molton7dc96412008-08-19 12:14:21 +010079
80 /* wakeup */
81 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
82};
83
Ian Molton0ec3cf62008-08-19 13:01:28 +010084/* ---------------------------------------------------------------------- */
85
Ian Moltonb1ae1b72008-09-26 13:38:59 +010086static struct mtd_partition partition_a = {
87 .name = "Internal NAND flash",
88 .offset = 0,
89 .size = MTDPART_SIZ_FULL,
90};
91
92static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
93
94static struct nand_bbt_descr e400_t7l66xb_nand_bbt = {
95 .options = 0,
96 .offs = 4,
97 .len = 2,
98 .pattern = scan_ff_pattern
99};
100
101static struct tmio_nand_data e400_t7l66xb_nand_config = {
102 .num_partitions = 1,
103 .partition = &partition_a,
104 .badblock_pattern = &e400_t7l66xb_nand_bbt,
105};
106
107static struct t7l66xb_platform_data e400_t7l66xb_info = {
108 .irq_base = IRQ_BOARD_START,
109 .enable = &eseries_tmio_enable,
110 .suspend = &eseries_tmio_suspend,
111 .resume = &eseries_tmio_resume,
112
113 .nand_data = &e400_t7l66xb_nand_config,
114};
115
116static struct platform_device e400_t7l66xb_device = {
117 .name = "t7l66xb",
118 .id = -1,
119 .dev = {
120 .platform_data = &e400_t7l66xb_info,
121 },
122 .num_resources = 2,
123 .resource = eseries_tmio_resources,
124};
125
126/* ---------------------------------------------------------- */
127
128static struct platform_device *devices[] __initdata = {
129 &e400_t7l66xb_device,
130};
131
Ian Molton7dc96412008-08-19 12:14:21 +0100132static void __init e400_init(void)
133{
134 pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config));
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100135 /* Fixme - e400 may have a switched clock */
136 eseries_register_clks();
137 eseries_get_tmio_gpios();
Ian Molton0ec3cf62008-08-19 13:01:28 +0100138 set_pxa_fb_info(&e400_pxafb_mach_info);
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100139 platform_add_devices(devices, ARRAY_SIZE(devices));
Ian Moltonebcce7b2008-08-19 13:34:56 +0100140 pxa_set_udc_info(&e7xx_udc_mach_info);
Ian Molton7dc96412008-08-19 12:14:21 +0100141}
142
143MACHINE_START(E400, "Toshiba e400")
144 /* Maintainer: Ian Molton (spyro@f2s.com) */
145 .phys_io = 0x40000000,
146 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
147 .boot_params = 0xa0000100,
148 .map_io = pxa_map_io,
149 .init_irq = pxa25x_init_irq,
150 .fixup = eseries_fixup,
151 .init_machine = e400_init,
152 .timer = &pxa_timer,
153MACHINE_END
154