mmp-dt.c 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * linux/arch/arm/mach-mmp/mmp-dt.c
  3. *
  4. * Copyright (C) 2012 Marvell Technology Group Ltd.
  5. * Author: Haojian Zhuang <haojian.zhuang@marvell.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * publishhed by the Free Software Foundation.
  10. */
  11. #include <linux/irq.h>
  12. #include <linux/irqdomain.h>
  13. #include <linux/of_irq.h>
  14. #include <linux/of_platform.h>
  15. #include <asm/mach/arch.h>
  16. #include <asm/mach/time.h>
  17. #include <mach/irqs.h>
  18. #include "common.h"
  19. extern void __init mmp_dt_irq_init(void);
  20. extern void __init mmp_dt_init_timer(void);
  21. static struct sys_timer mmp_dt_timer = {
  22. .init = mmp_dt_init_timer,
  23. };
  24. static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = {
  25. OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL),
  26. OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL),
  27. OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4026000, "pxa2xx-uart.2", NULL),
  28. OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL),
  29. OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4025000, "pxa2xx-i2c.1", NULL),
  30. OF_DEV_AUXDATA("mrvl,mmp-gpio", 0xd4019000, "pxa-gpio", NULL),
  31. OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL),
  32. {}
  33. };
  34. static const struct of_dev_auxdata pxa910_auxdata_lookup[] __initconst = {
  35. OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL),
  36. OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL),
  37. OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4036000, "pxa2xx-uart.2", NULL),
  38. OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL),
  39. OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4037000, "pxa2xx-i2c.1", NULL),
  40. OF_DEV_AUXDATA("mrvl,mmp-gpio", 0xd4019000, "pxa-gpio", NULL),
  41. OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL),
  42. {}
  43. };
  44. static void __init pxa168_dt_init(void)
  45. {
  46. of_platform_populate(NULL, of_default_bus_match_table,
  47. pxa168_auxdata_lookup, NULL);
  48. }
  49. static void __init pxa910_dt_init(void)
  50. {
  51. of_platform_populate(NULL, of_default_bus_match_table,
  52. pxa910_auxdata_lookup, NULL);
  53. }
  54. static const char *mmp_dt_board_compat[] __initdata = {
  55. "mrvl,pxa168-aspenite",
  56. "mrvl,pxa910-dkb",
  57. NULL,
  58. };
  59. DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)")
  60. .map_io = mmp_map_io,
  61. .init_irq = mmp_dt_irq_init,
  62. .timer = &mmp_dt_timer,
  63. .init_machine = pxa168_dt_init,
  64. .dt_compat = mmp_dt_board_compat,
  65. MACHINE_END
  66. DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)")
  67. .map_io = mmp_map_io,
  68. .init_irq = mmp_dt_irq_init,
  69. .timer = &mmp_dt_timer,
  70. .init_machine = pxa910_dt_init,
  71. .dt_compat = mmp_dt_board_compat,
  72. MACHINE_END