devices-wm8505.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* linux/arch/arm/mach-vt8500/devices-wm8505.c
  2. *
  3. * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
  4. *
  5. * This software is licensed under the terms of the GNU General Public
  6. * License version 2, as published by the Free Software Foundation, and
  7. * may be copied, distributed, and modified under those terms.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. */
  15. #include <linux/platform_device.h>
  16. #include <mach/wm8505_regs.h>
  17. #include <mach/wm8505_irqs.h>
  18. #include <mach/i8042.h>
  19. #include "devices.h"
  20. void __init wm8505_set_resources(void)
  21. {
  22. struct resource tmp[3];
  23. tmp[0] = wmt_mmio_res(WM8505_GOVR_BASE, SZ_512);
  24. wmt_res_add(&vt8500_device_wm8505_fb, tmp, 1);
  25. tmp[0] = wmt_mmio_res(WM8505_UART0_BASE, 0x1040);
  26. tmp[1] = wmt_irq_res(IRQ_UART0);
  27. wmt_res_add(&vt8500_device_uart0, tmp, 2);
  28. tmp[0] = wmt_mmio_res(WM8505_UART1_BASE, 0x1040);
  29. tmp[1] = wmt_irq_res(IRQ_UART1);
  30. wmt_res_add(&vt8500_device_uart1, tmp, 2);
  31. tmp[0] = wmt_mmio_res(WM8505_UART2_BASE, 0x1040);
  32. tmp[1] = wmt_irq_res(IRQ_UART2);
  33. wmt_res_add(&vt8500_device_uart2, tmp, 2);
  34. tmp[0] = wmt_mmio_res(WM8505_UART3_BASE, 0x1040);
  35. tmp[1] = wmt_irq_res(IRQ_UART3);
  36. wmt_res_add(&vt8500_device_uart3, tmp, 2);
  37. tmp[0] = wmt_mmio_res(WM8505_UART4_BASE, 0x1040);
  38. tmp[1] = wmt_irq_res(IRQ_UART4);
  39. wmt_res_add(&vt8500_device_uart4, tmp, 2);
  40. tmp[0] = wmt_mmio_res(WM8505_UART5_BASE, 0x1040);
  41. tmp[1] = wmt_irq_res(IRQ_UART5);
  42. wmt_res_add(&vt8500_device_uart5, tmp, 2);
  43. tmp[0] = wmt_mmio_res(WM8505_EHCI_BASE, SZ_512);
  44. tmp[1] = wmt_irq_res(IRQ_EHCI);
  45. wmt_res_add(&vt8500_device_ehci, tmp, 2);
  46. tmp[0] = wmt_mmio_res(WM8505_GEGEA_BASE, SZ_256);
  47. wmt_res_add(&vt8500_device_ge_rops, tmp, 1);
  48. tmp[0] = wmt_mmio_res(WM8505_PWM_BASE, 0x44);
  49. wmt_res_add(&vt8500_device_pwm, tmp, 1);
  50. tmp[0] = wmt_mmio_res(WM8505_RTC_BASE, 0x2c);
  51. tmp[1] = wmt_irq_res(IRQ_RTC);
  52. tmp[2] = wmt_irq_res(IRQ_RTCSM);
  53. wmt_res_add(&vt8500_device_rtc, tmp, 3);
  54. }
  55. static void __init wm8505_set_externs(void)
  56. {
  57. /* Non-resource-aware stuff */
  58. wmt_ic_base = WM8505_IC_BASE;
  59. wmt_sic_base = WM8505_SIC_BASE;
  60. wmt_gpio_base = WM8505_GPIO_BASE;
  61. wmt_pmc_base = WM8505_PMC_BASE;
  62. wmt_i8042_base = WM8505_PS2_BASE;
  63. wmt_nr_irqs = WM8505_NR_IRQS;
  64. wmt_timer_irq = IRQ_PMCOS0;
  65. wmt_gpio_ext_irq[0] = IRQ_EXT0;
  66. wmt_gpio_ext_irq[1] = IRQ_EXT1;
  67. wmt_gpio_ext_irq[2] = IRQ_EXT2;
  68. wmt_gpio_ext_irq[3] = IRQ_EXT3;
  69. wmt_gpio_ext_irq[4] = IRQ_EXT4;
  70. wmt_gpio_ext_irq[5] = IRQ_EXT5;
  71. wmt_gpio_ext_irq[6] = IRQ_EXT6;
  72. wmt_gpio_ext_irq[7] = IRQ_EXT7;
  73. wmt_i8042_kbd_irq = IRQ_PS2KBD;
  74. wmt_i8042_aux_irq = IRQ_PS2MOUSE;
  75. }
  76. void __init wm8505_map_io(void)
  77. {
  78. iotable_init(wmt_io_desc, ARRAY_SIZE(wmt_io_desc));
  79. /* Should be done before interrupts and timers are initialized */
  80. wm8505_set_externs();
  81. }