eseries.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. mi->bank[0].node = 0;
  33. if (machine_is_e800())
  34. mi->bank[0].size = (128*1024*1024);
  35. else
  36. mi->bank[0].size = (64*1024*1024);
  37. }
  38. struct pxa2xx_udc_mach_info e7xx_udc_mach_info = {
  39. .gpio_vbus = GPIO_E7XX_USB_DISC,
  40. .gpio_pullup = GPIO_E7XX_USB_PULLUP,
  41. .gpio_pullup_inverted = 1
  42. };
  43. struct pxaficp_platform_data e7xx_ficp_platform_data = {
  44. .gpio_pwdown = GPIO_E7XX_IR_OFF,
  45. .transceiver_cap = IR_SIRMODE | IR_OFF,
  46. };
  47. int eseries_tmio_enable(struct platform_device *dev)
  48. {
  49. /* Reset - bring SUSPEND high before PCLR */
  50. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
  51. gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
  52. msleep(1);
  53. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
  54. msleep(1);
  55. gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 1);
  56. msleep(1);
  57. return 0;
  58. }
  59. int eseries_tmio_disable(struct platform_device *dev)
  60. {
  61. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
  62. gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
  63. return 0;
  64. }
  65. int eseries_tmio_suspend(struct platform_device *dev)
  66. {
  67. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
  68. return 0;
  69. }
  70. int eseries_tmio_resume(struct platform_device *dev)
  71. {
  72. gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
  73. msleep(1);
  74. return 0;
  75. }
  76. void eseries_get_tmio_gpios(void)
  77. {
  78. gpio_request(GPIO_ESERIES_TMIO_SUSPEND, NULL);
  79. gpio_request(GPIO_ESERIES_TMIO_PCLR, NULL);
  80. gpio_direction_output(GPIO_ESERIES_TMIO_SUSPEND, 0);
  81. gpio_direction_output(GPIO_ESERIES_TMIO_PCLR, 0);
  82. }
  83. /* TMIO controller uses the same resources on all e-series machines. */
  84. struct resource eseries_tmio_resources[] = {
  85. [0] = {
  86. .start = PXA_CS4_PHYS,
  87. .end = PXA_CS4_PHYS + 0x1fffff,
  88. .flags = IORESOURCE_MEM,
  89. },
  90. [1] = {
  91. .start = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ),
  92. .end = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ),
  93. .flags = IORESOURCE_IRQ,
  94. },
  95. };
  96. /* Some e-series hardware cannot control the 32K clock */
  97. static void clk_32k_dummy(struct clk *clk)
  98. {
  99. }
  100. static const struct clkops clk_32k_dummy_ops = {
  101. .enable = clk_32k_dummy,
  102. .disable = clk_32k_dummy,
  103. };
  104. static struct clk tmio_dummy_clk = {
  105. .ops = &clk_32k_dummy_ops,
  106. .rate = 32768,
  107. };
  108. static struct clk_lookup eseries_clkregs[] = {
  109. INIT_CLKREG(&tmio_dummy_clk, NULL, "CLK_CK32K"),
  110. };
  111. void eseries_register_clks(void)
  112. {
  113. clks_register(eseries_clkregs, ARRAY_SIZE(eseries_clkregs));
  114. }