mmp-dt.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 <mach/irqs.h>
  17. #include "common.h"
  18. extern struct sys_timer pxa168_timer;
  19. extern void __init icu_init_irq(void);
  20. static const struct of_dev_auxdata mmp_auxdata_lookup[] __initconst = {
  21. OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL),
  22. OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL),
  23. OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4026000, "pxa2xx-uart.2", NULL),
  24. OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL),
  25. OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4025000, "pxa2xx-i2c.1", NULL),
  26. OF_DEV_AUXDATA("mrvl,mmp-gpio", 0xd4019000, "pxa-gpio", NULL),
  27. OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL),
  28. {}
  29. };
  30. static int __init mmp_intc_add_irq_domain(struct device_node *np,
  31. struct device_node *parent)
  32. {
  33. irq_domain_add_simple(np, 0);
  34. return 0;
  35. }
  36. static int __init mmp_gpio_add_irq_domain(struct device_node *np,
  37. struct device_node *parent)
  38. {
  39. irq_domain_add_simple(np, IRQ_GPIO_START);
  40. return 0;
  41. }
  42. static const struct of_device_id mmp_irq_match[] __initconst = {
  43. { .compatible = "mrvl,mmp-intc", .data = mmp_intc_add_irq_domain, },
  44. { .compatible = "mrvl,mmp-gpio", .data = mmp_gpio_add_irq_domain, },
  45. {}
  46. };
  47. static void __init mmp_dt_init(void)
  48. {
  49. of_irq_init(mmp_irq_match);
  50. of_platform_populate(NULL, of_default_bus_match_table,
  51. mmp_auxdata_lookup, NULL);
  52. }
  53. static const char *pxa168_dt_board_compat[] __initdata = {
  54. "mrvl,pxa168-aspenite",
  55. NULL,
  56. };
  57. DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)")
  58. .map_io = mmp_map_io,
  59. .init_irq = icu_init_irq,
  60. .timer = &pxa168_timer,
  61. .init_machine = mmp_dt_init,
  62. .dt_compat = pxa168_dt_board_compat,
  63. MACHINE_END