eseries.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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/gpio.h>
  15. #include <linux/delay.h>
  16. #include <linux/platform_device.h>
  17. #include <asm/setup.h>
  18. #include <asm/mach/arch.h>
  19. #include <asm/mach-types.h>
  20. #include <mach/pxa25x.h>
  21. #include <mach/eseries-gpio.h>
  22. #include <mach/udc.h>
  23. #include <mach/irda.h>
  24. #include "generic.h"
  25. #include "clock.h"
  26. /* Only e800 has 128MB RAM */
  27. void __init eseries_fixup(struct machine_desc *desc,
  28. struct tag *tags, char **cmdline, struct meminfo *mi)
  29. {
  30. mi->nr_banks=1;
  31. mi->bank[0].start = 0xa0000000;
  32. if (machine_is_e800())
  33. mi->bank[0].size = (128*1024*1024);
  34. else
  35. mi->bank[0].size = (64*1024*1024);
  36. }
  37. struct pxa2xx_udc_mach_info e7xx_udc_mach_info = {
  38. .gpio_vbus = GPIO_E7XX_USB_DISC,
  39. .gpio_pullup = GPIO_E7XX_USB_PULLUP,
  40. .gpio_pullup_inverted = 1
  41. };
  42. struct pxaficp_platform_data e7xx_ficp_platform_data = {
  43. .gpio_pwdown = GPIO_E7XX_IR_OFF,
  44. .transceiver_cap = IR_SIRMODE | IR_OFF,
  45. };
  46. int eseries_tmio_enable(struct platform_device *dev)
  47. {
  48. /* Reset - bring SUSPEND high before PCLR */
  49. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
  50. gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
  51. msleep(1);
  52. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
  53. msleep(1);
  54. gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 1);
  55. msleep(1);
  56. return 0;
  57. }
  58. int eseries_tmio_disable(struct platform_device *dev)
  59. {
  60. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
  61. gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
  62. return 0;
  63. }
  64. int eseries_tmio_suspend(struct platform_device *dev)
  65. {
  66. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
  67. return 0;
  68. }
  69. int eseries_tmio_resume(struct platform_device *dev)
  70. {
  71. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
  72. msleep(1);
  73. return 0;
  74. }
  75. void eseries_get_tmio_gpios(void)
  76. {
  77. gpio_request(GPIO_ESERIES_TMIO_SUSPEND, NULL);
  78. gpio_request(GPIO_ESERIES_TMIO_PCLR, NULL);
  79. gpio_direction_output(GPIO_ESERIES_TMIO_SUSPEND, 0);
  80. gpio_direction_output(GPIO_ESERIES_TMIO_PCLR, 0);
  81. }
  82. /* TMIO controller uses the same resources on all e-series machines. */
  83. struct resource eseries_tmio_resources[] = {
  84. [0] = {
  85. .start = PXA_CS4_PHYS,
  86. .end = PXA_CS4_PHYS + 0x1fffff,
  87. .flags = IORESOURCE_MEM,
  88. },
  89. [1] = {
  90. .start = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ),
  91. .end = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ),
  92. .flags = IORESOURCE_IRQ,
  93. },
  94. };
  95. /* Some e-series hardware cannot control the 32K clock */
  96. static void clk_32k_dummy(struct clk *clk)
  97. {
  98. }
  99. static const struct clkops clk_32k_dummy_ops = {
  100. .enable = clk_32k_dummy,
  101. .disable = clk_32k_dummy,
  102. };
  103. static struct clk tmio_dummy_clk = {
  104. .ops = &clk_32k_dummy_ops,
  105. .rate = 32768,
  106. };
  107. static struct clk_lookup eseries_clkregs[] = {
  108. INIT_CLKREG(&tmio_dummy_clk, NULL, "CLK_CK32K"),
  109. };
  110. void eseries_register_clks(void)
  111. {
  112. clkdev_add_table(eseries_clkregs, ARRAY_SIZE(eseries_clkregs));
  113. }