e400.c 3.7 KB

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