p5020_ds.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. #ifdef CONFIG_SMP
  39. extern struct smp_ops_t smp_85xx_ops;
  40. #endif
  41. if (of_flat_dt_is_compatible(root, "fsl,P5020DS"))
  42. return 1;
  43. /* Check if we're running under the Freescale hypervisor */
  44. if (of_flat_dt_is_compatible(root, "fsl,P5020DS-hv")) {
  45. ppc_md.init_IRQ = ehv_pic_init;
  46. ppc_md.get_irq = ehv_pic_get_irq;
  47. ppc_md.restart = fsl_hv_restart;
  48. ppc_md.power_off = fsl_hv_halt;
  49. ppc_md.halt = fsl_hv_halt;
  50. #ifdef CONFIG_SMP
  51. /*
  52. * Disable the timebase sync operations because we can't write
  53. * to the timebase registers under the hypervisor.
  54. */
  55. smp_85xx_ops.give_timebase = NULL;
  56. smp_85xx_ops.take_timebase = NULL;
  57. #endif
  58. return 1;
  59. }
  60. return 0;
  61. }
  62. define_machine(p5020_ds) {
  63. .name = "P5020 DS",
  64. .probe = p5020_ds_probe,
  65. .setup_arch = corenet_ds_setup_arch,
  66. .init_IRQ = corenet_ds_pic_init,
  67. #ifdef CONFIG_PCI
  68. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  69. #endif
  70. /* coreint doesn't play nice with lazy EE, use legacy mpic for now */
  71. #ifdef CONFIG_PPC64
  72. .get_irq = mpic_get_irq,
  73. #else
  74. .get_irq = mpic_get_coreint_irq,
  75. #endif
  76. .restart = fsl_rstcr_restart,
  77. .calibrate_decr = generic_calibrate_decr,
  78. .progress = udbg_progress,
  79. #ifdef CONFIG_PPC64
  80. .power_save = book3e_idle,
  81. #else
  82. .power_save = e500_idle,
  83. #endif
  84. };
  85. machine_device_initcall(p5020_ds, corenet_ds_publish_devices);
  86. #ifdef CONFIG_SWIOTLB
  87. machine_arch_initcall(p5020_ds, swiotlb_setup_bus_notifier);
  88. #endif