imx31-dt.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright 2012 Sascha Hauer, Pengutronix
  3. *
  4. * The code contained herein is licensed under the GNU General Public
  5. * License. You may obtain a copy of the GNU General Public License
  6. * Version 2 or later at the following locations:
  7. *
  8. * http://www.opensource.org/licenses/gpl-license.html
  9. * http://www.gnu.org/copyleft/gpl.html
  10. */
  11. #include <linux/irq.h>
  12. #include <linux/of_irq.h>
  13. #include <linux/of_platform.h>
  14. #include <asm/mach/arch.h>
  15. #include <asm/mach/time.h>
  16. #include <mach/common.h>
  17. #include <mach/mx31.h>
  18. static const struct of_dev_auxdata imx31_auxdata_lookup[] __initconst = {
  19. OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART1_BASE_ADDR,
  20. "imx21-uart.0", NULL),
  21. OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART2_BASE_ADDR,
  22. "imx21-uart.1", NULL),
  23. OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART3_BASE_ADDR,
  24. "imx21-uart.2", NULL),
  25. OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART4_BASE_ADDR,
  26. "imx21-uart.3", NULL),
  27. OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART5_BASE_ADDR,
  28. "imx21-uart.4", NULL),
  29. { /* sentinel */ }
  30. };
  31. static void __init imx31_dt_init(void)
  32. {
  33. of_platform_populate(NULL, of_default_bus_match_table,
  34. imx31_auxdata_lookup, NULL);
  35. }
  36. static void __init imx31_timer_init(void)
  37. {
  38. mx31_clocks_init_dt();
  39. }
  40. static struct sys_timer imx31_timer = {
  41. .init = imx31_timer_init,
  42. };
  43. static const char *imx31_dt_board_compat[] __initdata = {
  44. "fsl,imx31",
  45. NULL
  46. };
  47. DT_MACHINE_START(IMX31_DT, "Freescale i.MX31 (Device Tree Support)")
  48. .map_io = mx31_map_io,
  49. .init_early = imx31_init_early,
  50. .init_irq = mx31_init_irq,
  51. .handle_irq = imx31_handle_irq,
  52. .timer = &imx31_timer,
  53. .init_machine = imx31_dt_init,
  54. .dt_compat = imx31_dt_board_compat,
  55. .restart = mxc_restart,
  56. MACHINE_END