psr2.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright 2008-2011, IBM Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version
  7. * 2 of the License, or (at your option) any later version.
  8. */
  9. #include <linux/delay.h>
  10. #include <linux/init.h>
  11. #include <linux/irq.h>
  12. #include <linux/kernel.h>
  13. #include <linux/mm.h>
  14. #include <linux/of.h>
  15. #include <linux/smp.h>
  16. #include <linux/time.h>
  17. #include <asm/machdep.h>
  18. #include <asm/udbg.h>
  19. #include "ics.h"
  20. #include "wsp.h"
  21. static void psr2_spin(void)
  22. {
  23. hard_irq_disable();
  24. for (;;)
  25. continue;
  26. }
  27. static void psr2_restart(char *cmd)
  28. {
  29. psr2_spin();
  30. }
  31. static int __init psr2_probe(void)
  32. {
  33. unsigned long root = of_get_flat_dt_root();
  34. if (of_flat_dt_is_compatible(root, "ibm,wsp-chroma")) {
  35. /* chroma systems also claim they are psr2s */
  36. return 0;
  37. }
  38. if (!of_flat_dt_is_compatible(root, "ibm,psr2"))
  39. return 0;
  40. return 1;
  41. }
  42. define_machine(psr2_md) {
  43. .name = "PSR2 A2",
  44. .probe = psr2_probe,
  45. .setup_arch = wsp_setup_arch,
  46. .restart = psr2_restart,
  47. .power_off = psr2_spin,
  48. .halt = psr2_spin,
  49. .calibrate_decr = generic_calibrate_decr,
  50. .init_IRQ = wsp_setup_irq,
  51. .progress = udbg_progress,
  52. .power_save = book3e_idle,
  53. };
  54. machine_arch_initcall(psr2_md, wsp_probe_devices);