Ian Molton | 7dc9641 | 2008-08-19 12:14:21 +0100 | [diff] [blame] | 1 | /* |
| 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 Molton | 0ec3cf6 | 2008-08-19 13:01:28 +0100 | [diff] [blame] | 15 | #include <linux/device.h> |
| 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/fb.h> |
Ian Molton | b1ae1b7 | 2008-09-26 13:38:59 +0100 | [diff] [blame] | 18 | #include <linux/mfd/tc6393xb.h> |
Ian Molton | 0ec3cf6 | 2008-08-19 13:01:28 +0100 | [diff] [blame] | 19 | |
| 20 | #include <video/w100fb.h> |
Ian Molton | 7dc9641 | 2008-08-19 12:14:21 +0100 | [diff] [blame] | 21 | |
| 22 | #include <asm/setup.h> |
| 23 | #include <asm/mach/arch.h> |
| 24 | #include <asm/mach-types.h> |
| 25 | |
Eric Miao | 51c6298 | 2009-01-02 23:17:22 +0800 | [diff] [blame^] | 26 | #include <mach/pxa25x.h> |
Ian Molton | b1ae1b7 | 2008-09-26 13:38:59 +0100 | [diff] [blame] | 27 | #include <mach/eseries-gpio.h> |
Ian Molton | ebcce7b | 2008-08-19 13:34:56 +0100 | [diff] [blame] | 28 | #include <mach/udc.h> |
Ian Molton | 3603342 | 2008-08-24 19:21:26 +0100 | [diff] [blame] | 29 | #include <mach/irda.h> |
Russell King | 80b02c1 | 2009-01-08 10:01:47 +0000 | [diff] [blame] | 30 | #include <mach/irqs.h> |
Ian Molton | 7dc9641 | 2008-08-19 12:14:21 +0100 | [diff] [blame] | 31 | |
| 32 | #include "generic.h" |
| 33 | #include "eseries.h" |
Ian Molton | b1ae1b7 | 2008-09-26 13:38:59 +0100 | [diff] [blame] | 34 | #include "clock.h" |
Ian Molton | 7dc9641 | 2008-08-19 12:14:21 +0100 | [diff] [blame] | 35 | |
Ian Molton | 0ec3cf6 | 2008-08-19 13:01:28 +0100 | [diff] [blame] | 36 | /* ---------------------- E750 LCD definitions -------------------- */ |
| 37 | |
| 38 | static struct w100_gen_regs e750_lcd_regs = { |
| 39 | .lcd_format = 0x00008003, |
| 40 | .lcdd_cntl1 = 0x00000000, |
| 41 | .lcdd_cntl2 = 0x0003ffff, |
| 42 | .genlcd_cntl1 = 0x00fff003, |
| 43 | .genlcd_cntl2 = 0x003c0f03, |
| 44 | .genlcd_cntl3 = 0x000143aa, |
| 45 | }; |
| 46 | |
| 47 | static struct w100_mode e750_lcd_mode = { |
| 48 | .xres = 240, |
| 49 | .yres = 320, |
| 50 | .left_margin = 21, |
| 51 | .right_margin = 22, |
| 52 | .upper_margin = 5, |
| 53 | .lower_margin = 4, |
| 54 | .crtc_ss = 0x80150014, |
| 55 | .crtc_ls = 0x8014000d, |
| 56 | .crtc_gs = 0xc1000005, |
| 57 | .crtc_vpos_gs = 0x00020147, |
| 58 | .crtc_rev = 0x0040010a, |
| 59 | .crtc_dclk = 0xa1700030, |
| 60 | .crtc_gclk = 0x80cc0015, |
| 61 | .crtc_goe = 0x80cc0015, |
| 62 | .crtc_ps1_active = 0x61060017, |
| 63 | .pll_freq = 57, |
| 64 | .pixclk_divider = 4, |
| 65 | .pixclk_divider_rotated = 4, |
| 66 | .pixclk_src = CLK_SRC_XTAL, |
| 67 | .sysclk_divider = 1, |
| 68 | .sysclk_src = CLK_SRC_PLL, |
| 69 | }; |
| 70 | |
| 71 | static struct w100_gpio_regs e750_w100_gpio_info = { |
| 72 | .init_data1 = 0x01192f1b, |
| 73 | .gpio_dir1 = 0xd5ffdeff, |
| 74 | .gpio_oe1 = 0x000020bf, |
| 75 | .init_data2 = 0x010f010f, |
| 76 | .gpio_dir2 = 0xffffffff, |
| 77 | .gpio_oe2 = 0x000001cf, |
| 78 | }; |
| 79 | |
| 80 | static struct w100fb_mach_info e750_fb_info = { |
| 81 | .modelist = &e750_lcd_mode, |
| 82 | .num_modes = 1, |
| 83 | .regs = &e750_lcd_regs, |
| 84 | .gpio = &e750_w100_gpio_info, |
| 85 | .xtal_freq = 14318000, |
| 86 | .xtal_dbl = 1, |
| 87 | }; |
| 88 | |
| 89 | static struct resource e750_fb_resources[] = { |
| 90 | [0] = { |
| 91 | .start = 0x0c000000, |
| 92 | .end = 0x0cffffff, |
| 93 | .flags = IORESOURCE_MEM, |
| 94 | }, |
| 95 | }; |
| 96 | |
| 97 | static struct platform_device e750_fb_device = { |
| 98 | .name = "w100fb", |
| 99 | .id = -1, |
| 100 | .dev = { |
| 101 | .platform_data = &e750_fb_info, |
| 102 | }, |
| 103 | .num_resources = ARRAY_SIZE(e750_fb_resources), |
| 104 | .resource = e750_fb_resources, |
| 105 | }; |
| 106 | |
Ian Molton | e1c4a2d | 2008-12-30 23:22:41 +0000 | [diff] [blame] | 107 | /* -------------------- e750 MFP parameters -------------------- */ |
| 108 | |
| 109 | static unsigned long e750_pin_config[] __initdata = { |
| 110 | /* Chip selects */ |
| 111 | GPIO15_nCS_1, /* CS1 - Flash */ |
| 112 | GPIO79_nCS_3, /* CS3 - IMAGEON */ |
| 113 | GPIO80_nCS_4, /* CS4 - TMIO */ |
| 114 | |
| 115 | /* Clocks */ |
| 116 | GPIO11_3_6MHz, |
| 117 | |
| 118 | /* BTUART */ |
| 119 | GPIO42_BTUART_RXD, |
| 120 | GPIO43_BTUART_TXD, |
| 121 | GPIO44_BTUART_CTS, |
| 122 | |
| 123 | /* TMIO controller */ |
| 124 | GPIO19_GPIO, /* t7l66xb #PCLR */ |
| 125 | GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */ |
| 126 | |
| 127 | /* UDC */ |
| 128 | GPIO13_GPIO, |
| 129 | GPIO3_GPIO, |
| 130 | |
| 131 | /* IrDA */ |
| 132 | GPIO38_GPIO | MFP_LPM_DRIVE_HIGH, |
| 133 | |
| 134 | /* PC Card */ |
| 135 | GPIO8_GPIO, /* CD0 */ |
| 136 | GPIO44_GPIO, /* CD1 */ |
| 137 | GPIO11_GPIO, /* IRQ0 */ |
| 138 | GPIO6_GPIO, /* IRQ1 */ |
| 139 | GPIO27_GPIO, /* RST0 */ |
| 140 | GPIO24_GPIO, /* RST1 */ |
| 141 | GPIO20_GPIO, /* PWR0 */ |
| 142 | GPIO23_GPIO, /* PWR1 */ |
| 143 | GPIO48_nPOE, |
| 144 | GPIO49_nPWE, |
| 145 | GPIO50_nPIOR, |
| 146 | GPIO51_nPIOW, |
| 147 | GPIO52_nPCE_1, |
| 148 | GPIO53_nPCE_2, |
| 149 | GPIO54_nPSKTSEL, |
| 150 | GPIO55_nPREG, |
| 151 | GPIO56_nPWAIT, |
| 152 | GPIO57_nIOIS16, |
| 153 | |
| 154 | /* wakeup */ |
| 155 | GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, |
| 156 | }; |
| 157 | |
Ian Molton | b1ae1b7 | 2008-09-26 13:38:59 +0100 | [diff] [blame] | 158 | /* ----------------- e750 tc6393xb parameters ------------------ */ |
| 159 | |
| 160 | static struct tc6393xb_platform_data e750_tc6393xb_info = { |
| 161 | .irq_base = IRQ_BOARD_START, |
| 162 | .scr_pll2cr = 0x0cc1, |
| 163 | .scr_gper = 0, |
| 164 | .gpio_base = -1, |
| 165 | .suspend = &eseries_tmio_suspend, |
| 166 | .resume = &eseries_tmio_resume, |
| 167 | .enable = &eseries_tmio_enable, |
| 168 | .disable = &eseries_tmio_disable, |
| 169 | }; |
| 170 | |
| 171 | static struct platform_device e750_tc6393xb_device = { |
| 172 | .name = "tc6393xb", |
| 173 | .id = -1, |
| 174 | .dev = { |
| 175 | .platform_data = &e750_tc6393xb_info, |
| 176 | }, |
| 177 | .num_resources = 2, |
| 178 | .resource = eseries_tmio_resources, |
| 179 | }; |
| 180 | |
| 181 | /* ------------------------------------------------------------- */ |
Ian Molton | 0ec3cf6 | 2008-08-19 13:01:28 +0100 | [diff] [blame] | 182 | |
| 183 | static struct platform_device *devices[] __initdata = { |
| 184 | &e750_fb_device, |
Ian Molton | b1ae1b7 | 2008-09-26 13:38:59 +0100 | [diff] [blame] | 185 | &e750_tc6393xb_device, |
Ian Molton | 0ec3cf6 | 2008-08-19 13:01:28 +0100 | [diff] [blame] | 186 | }; |
| 187 | |
| 188 | static void __init e750_init(void) |
| 189 | { |
Ian Molton | e1c4a2d | 2008-12-30 23:22:41 +0000 | [diff] [blame] | 190 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config)); |
Ian Molton | b1ae1b7 | 2008-09-26 13:38:59 +0100 | [diff] [blame] | 191 | clk_add_alias("CLK_CK3P6MI", &e750_tc6393xb_device.dev, |
| 192 | "GPIO11_CLK", NULL), |
| 193 | eseries_get_tmio_gpios(); |
Ian Molton | 0ec3cf6 | 2008-08-19 13:01:28 +0100 | [diff] [blame] | 194 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
Ian Molton | ebcce7b | 2008-08-19 13:34:56 +0100 | [diff] [blame] | 195 | pxa_set_udc_info(&e7xx_udc_mach_info); |
Ian Molton | 3603342 | 2008-08-24 19:21:26 +0100 | [diff] [blame] | 196 | e7xx_irda_init(); |
| 197 | pxa_set_ficp_info(&e7xx_ficp_platform_data); |
Ian Molton | 0ec3cf6 | 2008-08-19 13:01:28 +0100 | [diff] [blame] | 198 | } |
| 199 | |
Ian Molton | 7dc9641 | 2008-08-19 12:14:21 +0100 | [diff] [blame] | 200 | MACHINE_START(E750, "Toshiba e750") |
| 201 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
| 202 | .phys_io = 0x40000000, |
| 203 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
| 204 | .boot_params = 0xa0000100, |
| 205 | .map_io = pxa_map_io, |
| 206 | .init_irq = pxa25x_init_irq, |
| 207 | .fixup = eseries_fixup, |
Ian Molton | 0ec3cf6 | 2008-08-19 13:01:28 +0100 | [diff] [blame] | 208 | .init_machine = e750_init, |
Ian Molton | 7dc9641 | 2008-08-19 12:14:21 +0100 | [diff] [blame] | 209 | .timer = &pxa_timer, |
| 210 | MACHINE_END |
| 211 | |