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