e400.c 3.7 KB

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