at91rm9200.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Setup code for AT91RM9200
  3. *
  4. * Copyright (C) 2011 Atmel,
  5. * 2011 Nicolas Ferre <nicolas.ferre@atmel.com>
  6. * 2012 Joachim Eastwood <manabian@gmail.com>
  7. *
  8. * Licensed under GPLv2 or later.
  9. */
  10. #include <linux/types.h>
  11. #include <linux/init.h>
  12. #include <linux/module.h>
  13. #include <linux/gpio.h>
  14. #include <linux/of.h>
  15. #include <linux/of_irq.h>
  16. #include <linux/of_platform.h>
  17. #include <linux/clk-provider.h>
  18. #include <asm/setup.h>
  19. #include <asm/irq.h>
  20. #include <asm/mach/arch.h>
  21. #include <asm/mach/map.h>
  22. #include <asm/mach/irq.h>
  23. #include <asm/system_misc.h>
  24. #include <mach/at91_st.h>
  25. #include "generic.h"
  26. static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
  27. {
  28. /*
  29. * Perform a hardware reset with the use of the Watchdog timer.
  30. */
  31. at91_st_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1);
  32. at91_st_write(AT91_ST_CR, AT91_ST_WDRST);
  33. }
  34. static void __init at91rm9200_dt_timer_init(void)
  35. {
  36. of_clk_init(NULL);
  37. at91rm9200_timer_init();
  38. }
  39. static void __init at91rm9200_dt_device_init(void)
  40. {
  41. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  42. arm_pm_idle = at91rm9200_idle;
  43. arm_pm_restart = at91rm9200_restart;
  44. at91rm9200_pm_init();
  45. }
  46. static const char *at91rm9200_dt_board_compat[] __initconst = {
  47. "atmel,at91rm9200",
  48. NULL
  49. };
  50. DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200")
  51. .init_time = at91rm9200_dt_timer_init,
  52. .map_io = at91_map_io,
  53. .init_machine = at91rm9200_dt_device_init,
  54. .dt_compat = at91rm9200_dt_board_compat,
  55. MACHINE_END