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 | b1ae1b7 | 2008-09-26 13:38:59 +0100 | [diff] [blame] | 15 | #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 Molton | 7dc9641 | 2008-08-19 12:14:21 +0100 | [diff] [blame] | 20 | |
| 21 | #include <asm/setup.h> |
| 22 | #include <asm/mach/arch.h> |
| 23 | #include <asm/mach-types.h> |
| 24 | |
Eric Miao | 51c6298 | 2009-01-02 23:17:22 +0800 | [diff] [blame] | 25 | #include <mach/pxa25x.h> |
Ian Molton | b1ae1b7 | 2008-09-26 13:38:59 +0100 | [diff] [blame] | 26 | #include <mach/eseries-gpio.h> |
Ian Molton | 0ec3cf6 | 2008-08-19 13:01:28 +0100 | [diff] [blame] | 27 | #include <mach/pxafb.h> |
Ian Molton | ebcce7b | 2008-08-19 13:34:56 +0100 | [diff] [blame] | 28 | #include <mach/udc.h> |
Russell King | 80b02c1 | 2009-01-08 10:01:47 +0000 | [diff] [blame] | 29 | #include <mach/irqs.h> |
Ian Molton | 0ec3cf6 | 2008-08-19 13:01:28 +0100 | [diff] [blame] | 30 | |
Ian Molton | 7dc9641 | 2008-08-19 12:14:21 +0100 | [diff] [blame] | 31 | #include "generic.h" |
| 32 | #include "eseries.h" |
Ian Molton | b1ae1b7 | 2008-09-26 13:38:59 +0100 | [diff] [blame] | 33 | #include "clock.h" |
Ian Molton | 7dc9641 | 2008-08-19 12:14:21 +0100 | [diff] [blame] | 34 | |
Ian Molton | 0ec3cf6 | 2008-08-19 13:01:28 +0100 | [diff] [blame] | 35 | /* ------------------------ E400 LCD definitions ------------------------ */ |
| 36 | |
| 37 | static struct pxafb_mode_info e400_pxafb_mode_info = { |
| 38 | .pixclock = 140703, |
| 39 | .xres = 240, |
| 40 | .yres = 320, |
| 41 | .bpp = 16, |
| 42 | .hsync_len = 4, |
| 43 | .left_margin = 28, |
| 44 | .right_margin = 8, |
| 45 | .vsync_len = 3, |
| 46 | .upper_margin = 5, |
| 47 | .lower_margin = 6, |
| 48 | .sync = 0, |
| 49 | }; |
| 50 | |
| 51 | static struct pxafb_mach_info e400_pxafb_mach_info = { |
| 52 | .modes = &e400_pxafb_mode_info, |
| 53 | .num_modes = 1, |
Eric Miao | 9587319 | 2008-12-07 17:49:01 +0800 | [diff] [blame] | 54 | .lcd_conn = LCD_COLOR_TFT_16BPP, |
Ian Molton | 0ec3cf6 | 2008-08-19 13:01:28 +0100 | [diff] [blame] | 55 | .lccr3 = 0, |
| 56 | .pxafb_backlight_power = NULL, |
| 57 | }; |
| 58 | |
| 59 | /* ------------------------ E400 MFP config ----------------------------- */ |
| 60 | |
Ian Molton | 7dc9641 | 2008-08-19 12:14:21 +0100 | [diff] [blame] | 61 | static unsigned long e400_pin_config[] __initdata = { |
| 62 | /* Chip selects */ |
| 63 | GPIO15_nCS_1, /* CS1 - Flash */ |
| 64 | GPIO80_nCS_4, /* CS4 - TMIO */ |
| 65 | |
| 66 | /* Clocks */ |
| 67 | GPIO12_32KHz, |
| 68 | |
| 69 | /* BTUART */ |
| 70 | GPIO42_BTUART_RXD, |
| 71 | GPIO43_BTUART_TXD, |
| 72 | GPIO44_BTUART_CTS, |
Ian Molton | b1ae1b7 | 2008-09-26 13:38:59 +0100 | [diff] [blame] | 73 | |
| 74 | /* TMIO controller */ |
| 75 | GPIO19_GPIO, /* t7l66xb #PCLR */ |
| 76 | GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */ |
Ian Molton | 7dc9641 | 2008-08-19 12:14:21 +0100 | [diff] [blame] | 77 | |
| 78 | /* wakeup */ |
| 79 | GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, |
| 80 | }; |
| 81 | |
Ian Molton | 0ec3cf6 | 2008-08-19 13:01:28 +0100 | [diff] [blame] | 82 | /* ---------------------------------------------------------------------- */ |
| 83 | |
Ian Molton | b1ae1b7 | 2008-09-26 13:38:59 +0100 | [diff] [blame] | 84 | static struct mtd_partition partition_a = { |
| 85 | .name = "Internal NAND flash", |
| 86 | .offset = 0, |
| 87 | .size = MTDPART_SIZ_FULL, |
| 88 | }; |
| 89 | |
| 90 | static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; |
| 91 | |
| 92 | static struct nand_bbt_descr e400_t7l66xb_nand_bbt = { |
| 93 | .options = 0, |
| 94 | .offs = 4, |
| 95 | .len = 2, |
| 96 | .pattern = scan_ff_pattern |
| 97 | }; |
| 98 | |
| 99 | static struct tmio_nand_data e400_t7l66xb_nand_config = { |
| 100 | .num_partitions = 1, |
| 101 | .partition = &partition_a, |
| 102 | .badblock_pattern = &e400_t7l66xb_nand_bbt, |
| 103 | }; |
| 104 | |
| 105 | static struct t7l66xb_platform_data e400_t7l66xb_info = { |
| 106 | .irq_base = IRQ_BOARD_START, |
| 107 | .enable = &eseries_tmio_enable, |
| 108 | .suspend = &eseries_tmio_suspend, |
| 109 | .resume = &eseries_tmio_resume, |
| 110 | |
| 111 | .nand_data = &e400_t7l66xb_nand_config, |
| 112 | }; |
| 113 | |
| 114 | static struct platform_device e400_t7l66xb_device = { |
| 115 | .name = "t7l66xb", |
| 116 | .id = -1, |
| 117 | .dev = { |
| 118 | .platform_data = &e400_t7l66xb_info, |
| 119 | }, |
| 120 | .num_resources = 2, |
| 121 | .resource = eseries_tmio_resources, |
| 122 | }; |
| 123 | |
| 124 | /* ---------------------------------------------------------- */ |
| 125 | |
| 126 | static struct platform_device *devices[] __initdata = { |
| 127 | &e400_t7l66xb_device, |
| 128 | }; |
| 129 | |
Ian Molton | 7dc9641 | 2008-08-19 12:14:21 +0100 | [diff] [blame] | 130 | static void __init e400_init(void) |
| 131 | { |
| 132 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config)); |
Russell King | cc155c6 | 2009-11-09 13:34:08 +0800 | [diff] [blame^] | 133 | pxa_set_ffuart_info(NULL); |
| 134 | pxa_set_btuart_info(NULL); |
| 135 | pxa_set_stuart_info(NULL); |
Ian Molton | b1ae1b7 | 2008-09-26 13:38:59 +0100 | [diff] [blame] | 136 | /* Fixme - e400 may have a switched clock */ |
| 137 | eseries_register_clks(); |
| 138 | eseries_get_tmio_gpios(); |
Ian Molton | 0ec3cf6 | 2008-08-19 13:01:28 +0100 | [diff] [blame] | 139 | set_pxa_fb_info(&e400_pxafb_mach_info); |
Ian Molton | b1ae1b7 | 2008-09-26 13:38:59 +0100 | [diff] [blame] | 140 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
Ian Molton | ebcce7b | 2008-08-19 13:34:56 +0100 | [diff] [blame] | 141 | pxa_set_udc_info(&e7xx_udc_mach_info); |
Ian Molton | 7dc9641 | 2008-08-19 12:14:21 +0100 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | MACHINE_START(E400, "Toshiba e400") |
| 145 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
| 146 | .phys_io = 0x40000000, |
| 147 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
| 148 | .boot_params = 0xa0000100, |
| 149 | .map_io = pxa_map_io, |
| 150 | .init_irq = pxa25x_init_irq, |
| 151 | .fixup = eseries_fixup, |
| 152 | .init_machine = e400_init, |
| 153 | .timer = &pxa_timer, |
| 154 | MACHINE_END |
| 155 | |