p3060_qds.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * P3060 QDS Setup
  3. *
  4. * Copyright 2011 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/interrupt.h>
  13. #include <linux/phy.h>
  14. #include <asm/machdep.h>
  15. #include <asm/udbg.h>
  16. #include <asm/mpic.h>
  17. #include <linux/of_platform.h>
  18. #include <sysdev/fsl_soc.h>
  19. #include <sysdev/fsl_pci.h>
  20. #include <asm/ehv_pic.h>
  21. #include "corenet_ds.h"
  22. /*
  23. * Called very early, device-tree isn't unflattened
  24. */
  25. static int __init p3060_qds_probe(void)
  26. {
  27. unsigned long root = of_get_flat_dt_root();
  28. #ifdef CONFIG_SMP
  29. extern struct smp_ops_t smp_85xx_ops;
  30. #endif
  31. if (of_flat_dt_is_compatible(root, "fsl,P3060QDS"))
  32. return 1;
  33. /* Check if we're running under the Freescale hypervisor */
  34. if (of_flat_dt_is_compatible(root, "fsl,P3060QDS-hv")) {
  35. ppc_md.init_IRQ = ehv_pic_init;
  36. ppc_md.get_irq = ehv_pic_get_irq;
  37. ppc_md.restart = fsl_hv_restart;
  38. ppc_md.power_off = fsl_hv_halt;
  39. ppc_md.halt = fsl_hv_halt;
  40. #ifdef CONFIG_SMP
  41. /*
  42. * Disable the timebase sync operations because we can't write
  43. * to the timebase registers under the hypervisor.
  44. */
  45. smp_85xx_ops.give_timebase = NULL;
  46. smp_85xx_ops.take_timebase = NULL;
  47. #endif
  48. return 1;
  49. }
  50. return 0;
  51. }
  52. define_machine(p3060_qds) {
  53. .name = "P3060 QDS",
  54. .probe = p3060_qds_probe,
  55. .setup_arch = corenet_ds_setup_arch,
  56. .init_IRQ = corenet_ds_pic_init,
  57. #ifdef CONFIG_PCI
  58. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  59. #endif
  60. .get_irq = mpic_get_coreint_irq,
  61. .restart = fsl_rstcr_restart,
  62. .calibrate_decr = generic_calibrate_decr,
  63. .progress = udbg_progress,
  64. .power_save = e500_idle,
  65. };
  66. machine_device_initcall(p3060_qds, corenet_ds_publish_devices);
  67. #ifdef CONFIG_SWIOTLB
  68. machine_arch_initcall(p3060_qds, swiotlb_setup_bus_notifier);
  69. #endif