e400.c 3.7 KB

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