p3041_ds.c 2.2 KB

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