p5040_ds.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * P5040 DS Setup
  3. *
  4. * Copyright 2009-2010 Freescale Semiconductor Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/pci.h>
  13. #include <asm/machdep.h>
  14. #include <asm/udbg.h>
  15. #include <asm/mpic.h>
  16. #include <linux/of_fdt.h>
  17. #include <sysdev/fsl_soc.h>
  18. #include <sysdev/fsl_pci.h>
  19. #include <asm/ehv_pic.h>
  20. #include "corenet_ds.h"
  21. /*
  22. * Called very early, device-tree isn't unflattened
  23. */
  24. static int __init p5040_ds_probe(void)
  25. {
  26. unsigned long root = of_get_flat_dt_root();
  27. #ifdef CONFIG_SMP
  28. extern struct smp_ops_t smp_85xx_ops;
  29. #endif
  30. if (of_flat_dt_is_compatible(root, "fsl,P5040DS"))
  31. return 1;
  32. /* Check if we're running under the Freescale hypervisor */
  33. if (of_flat_dt_is_compatible(root, "fsl,P5040DS-hv")) {
  34. ppc_md.init_IRQ = ehv_pic_init;
  35. ppc_md.get_irq = ehv_pic_get_irq;
  36. ppc_md.restart = fsl_hv_restart;
  37. ppc_md.power_off = fsl_hv_halt;
  38. ppc_md.halt = fsl_hv_halt;
  39. #ifdef CONFIG_SMP
  40. /*
  41. * Disable the timebase sync operations because we can't write
  42. * to the timebase registers under the hypervisor.
  43. */
  44. smp_85xx_ops.give_timebase = NULL;
  45. smp_85xx_ops.take_timebase = NULL;
  46. #endif
  47. return 1;
  48. }
  49. return 0;
  50. }
  51. define_machine(p5040_ds) {
  52. .name = "P5040 DS",
  53. .probe = p5040_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. .get_irq = mpic_get_coreint_irq,
  60. .restart = fsl_rstcr_restart,
  61. .calibrate_decr = generic_calibrate_decr,
  62. .progress = udbg_progress,
  63. #ifdef CONFIG_PPC64
  64. .power_save = book3e_idle,
  65. #else
  66. .power_save = e500_idle,
  67. #endif
  68. };
  69. machine_arch_initcall(p5040_ds, corenet_ds_publish_devices);
  70. #ifdef CONFIG_SWIOTLB
  71. machine_arch_initcall(p5040_ds, swiotlb_setup_bus_notifier);
  72. #endif