devices.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (C) ST-Ericsson SA 2010
  3. *
  4. * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
  5. * License terms: GNU General Public License (GPL) version 2
  6. */
  7. #include <linux/kernel.h>
  8. #include <linux/platform_device.h>
  9. #include <linux/interrupt.h>
  10. #include <linux/io.h>
  11. #include <linux/amba/bus.h>
  12. #include <mach/hardware.h>
  13. #include <mach/setup.h>
  14. #define __MEM_4K_RESOURCE(x) \
  15. .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
  16. struct amba_device ux500_pl031_device = {
  17. .dev = {
  18. .init_name = "pl031",
  19. },
  20. .res = {
  21. .start = UX500_RTC_BASE,
  22. .end = UX500_RTC_BASE + SZ_4K - 1,
  23. .flags = IORESOURCE_MEM,
  24. },
  25. .irq = {IRQ_RTC_RTT, NO_IRQ},
  26. };
  27. struct amba_device ux500_uart0_device = {
  28. .dev = { .init_name = "uart0" },
  29. __MEM_4K_RESOURCE(UX500_UART0_BASE),
  30. .irq = {IRQ_UART0, NO_IRQ},
  31. };
  32. struct amba_device ux500_uart1_device = {
  33. .dev = { .init_name = "uart1" },
  34. __MEM_4K_RESOURCE(UX500_UART1_BASE),
  35. .irq = {IRQ_UART1, NO_IRQ},
  36. };
  37. struct amba_device ux500_uart2_device = {
  38. .dev = { .init_name = "uart2" },
  39. __MEM_4K_RESOURCE(UX500_UART2_BASE),
  40. .irq = {IRQ_UART2, NO_IRQ},
  41. };
  42. void __init amba_add_devices(struct amba_device *devs[], int num)
  43. {
  44. int i;
  45. for (i = 0; i < num; i++) {
  46. struct amba_device *d = devs[i];
  47. amba_device_register(d, &iomem_resource);
  48. }
  49. }