board-dt.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Setup code for AT91SAM Evaluation Kits with Device Tree support
  3. *
  4. * Covers: * AT91SAM9G45-EKES board
  5. * * AT91SAM9M10-EKES board
  6. * * AT91SAM9M10G45-EK board
  7. *
  8. * Copyright (C) 2011 Atmel,
  9. * 2011 Nicolas Ferre <nicolas.ferre@atmel.com>
  10. *
  11. * Licensed under GPLv2 or later.
  12. */
  13. #include <linux/types.h>
  14. #include <linux/init.h>
  15. #include <linux/module.h>
  16. #include <linux/gpio.h>
  17. #include <linux/of.h>
  18. #include <linux/of_irq.h>
  19. #include <linux/of_platform.h>
  20. #include <mach/board.h>
  21. #include <asm/setup.h>
  22. #include <asm/irq.h>
  23. #include <asm/mach/arch.h>
  24. #include <asm/mach/map.h>
  25. #include <asm/mach/irq.h>
  26. #include "generic.h"
  27. static const struct of_device_id irq_of_match[] __initconst = {
  28. { .compatible = "atmel,at91rm9200-aic", .data = at91_aic_of_init },
  29. { .compatible = "atmel,at91rm9200-gpio", .data = at91_gpio_of_irq_setup },
  30. { .compatible = "atmel,at91sam9x5-gpio", .data = at91_gpio_of_irq_setup },
  31. { /*sentinel*/ }
  32. };
  33. static void __init at91_dt_init_irq(void)
  34. {
  35. of_irq_init(irq_of_match);
  36. }
  37. static void __init at91_dt_device_init(void)
  38. {
  39. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  40. }
  41. static const char *at91_dt_board_compat[] __initdata = {
  42. "atmel,at91sam9m10g45ek",
  43. "atmel,at91sam9x5ek",
  44. "calao,usb-a9g20",
  45. NULL
  46. };
  47. DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
  48. /* Maintainer: Atmel */
  49. .timer = &at91sam926x_timer,
  50. .map_io = at91_map_io,
  51. .init_early = at91_dt_initialize,
  52. .init_irq = at91_dt_init_irq,
  53. .init_machine = at91_dt_device_init,
  54. .dt_compat = at91_dt_board_compat,
  55. MACHINE_END