device.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * device.c -- common ColdFire SoC device support
  3. *
  4. * (C) Copyright 2011, Greg Ungerer <gerg@uclinux.org>
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file COPYING in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/init.h>
  12. #include <linux/io.h>
  13. #include <asm/traps.h>
  14. #include <asm/coldfire.h>
  15. #include <asm/mcfsim.h>
  16. #include <asm/mcfuart.h>
  17. static struct mcf_platform_uart mcf_uart_platform_data[] = {
  18. {
  19. .mapbase = MCFUART_BASE0,
  20. .irq = MCF_IRQ_UART0,
  21. },
  22. {
  23. .mapbase = MCFUART_BASE1,
  24. .irq = MCF_IRQ_UART1,
  25. },
  26. #ifdef MCFUART_BASE2
  27. {
  28. .mapbase = MCFUART_BASE2,
  29. .irq = MCF_IRQ_UART2,
  30. },
  31. #endif
  32. #ifdef MCFUART_BASE3
  33. {
  34. .mapbase = MCFUART_BASE3,
  35. .irq = MCF_IRQ_UART3,
  36. },
  37. #endif
  38. { },
  39. };
  40. static struct platform_device mcf_uart = {
  41. .name = "mcfuart",
  42. .id = 0,
  43. .dev.platform_data = mcf_uart_platform_data,
  44. };
  45. static struct platform_device *mcf_devices[] __initdata = {
  46. &mcf_uart,
  47. };
  48. static int __init mcf_init_devices(void)
  49. {
  50. platform_add_devices(mcf_devices, ARRAY_SIZE(mcf_devices));
  51. return 0;
  52. }
  53. arch_initcall(mcf_init_devices);