p5020_ds.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * P5020 DS Setup
  3. *
  4. * Maintained by Kumar Gala (see MAINTAINERS for contact information)
  5. *
  6. * Copyright 2009-2010 Freescale Semiconductor Inc.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/pci.h>
  15. #include <linux/kdev_t.h>
  16. #include <linux/delay.h>
  17. #include <linux/interrupt.h>
  18. #include <linux/phy.h>
  19. #include <asm/system.h>
  20. #include <asm/time.h>
  21. #include <asm/machdep.h>
  22. #include <asm/pci-bridge.h>
  23. #include <mm/mmu_decl.h>
  24. #include <asm/prom.h>
  25. #include <asm/udbg.h>
  26. #include <asm/mpic.h>
  27. #include <linux/of_platform.h>
  28. #include <sysdev/fsl_soc.h>
  29. #include <sysdev/fsl_pci.h>
  30. #include <asm/ehv_pic.h>
  31. #include "corenet_ds.h"
  32. /*
  33. * Called very early, device-tree isn't unflattened
  34. */
  35. static int __init p5020_ds_probe(void)
  36. {
  37. unsigned long root = of_get_flat_dt_root();
  38. if (of_flat_dt_is_compatible(root, "fsl,P5020DS"))
  39. return 1;
  40. /* Check if we're running under the Freescale hypervisor */
  41. if (of_flat_dt_is_compatible(root, "fsl,P5020DS-hv")) {
  42. ppc_md.init_IRQ = ehv_pic_init;
  43. ppc_md.get_irq = ehv_pic_get_irq;
  44. ppc_md.restart = fsl_hv_restart;
  45. ppc_md.power_off = fsl_hv_halt;
  46. ppc_md.halt = fsl_hv_halt;
  47. return 1;
  48. }
  49. return 0;
  50. }
  51. define_machine(p5020_ds) {
  52. .name = "P5020 DS",
  53. .probe = p5020_ds_probe,
  54. .setup_arch = corenet_ds_setup_arch,
  55. .init_IRQ = corenet_ds_pic_init,
  56. #ifdef CONFIG_PCI
  57. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  58. #endif
  59. /* coreint doesn't play nice with lazy EE, use legacy mpic for now */
  60. #ifdef CONFIG_PPC64
  61. .get_irq = mpic_get_irq,
  62. #else
  63. .get_irq = mpic_get_coreint_irq,
  64. #endif
  65. .restart = fsl_rstcr_restart,
  66. .calibrate_decr = generic_calibrate_decr,
  67. .progress = udbg_progress,
  68. #ifdef CONFIG_PPC64
  69. .power_save = book3e_idle,
  70. #else
  71. .power_save = e500_idle,
  72. #endif
  73. };
  74. machine_device_initcall(p5020_ds, corenet_ds_publish_devices);
  75. #ifdef CONFIG_SWIOTLB
  76. machine_arch_initcall(p5020_ds, swiotlb_setup_bus_notifier);
  77. #endif