p4080_ds.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * P4080 DS Setup
  3. *
  4. * Maintained by Kumar Gala (see MAINTAINERS for contact information)
  5. *
  6. * Copyright 2009 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 <asm/system.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 p4080_ds_probe(void)
  35. {
  36. unsigned long root = of_get_flat_dt_root();
  37. if (of_flat_dt_is_compatible(root, "fsl,P4080DS"))
  38. return 1;
  39. /* Check if we're running under the Freescale hypervisor */
  40. if (of_flat_dt_is_compatible(root, "fsl,P4080DS-hv")) {
  41. ppc_md.init_IRQ = ehv_pic_init;
  42. ppc_md.get_irq = ehv_pic_get_irq;
  43. ppc_md.restart = fsl_hv_restart;
  44. ppc_md.power_off = fsl_hv_halt;
  45. ppc_md.halt = fsl_hv_halt;
  46. return 1;
  47. }
  48. return 0;
  49. }
  50. define_machine(p4080_ds) {
  51. .name = "P4080 DS",
  52. .probe = p4080_ds_probe,
  53. .setup_arch = corenet_ds_setup_arch,
  54. .init_IRQ = corenet_ds_pic_init,
  55. #ifdef CONFIG_PCI
  56. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  57. #endif
  58. .get_irq = mpic_get_coreint_irq,
  59. .restart = fsl_rstcr_restart,
  60. .calibrate_decr = generic_calibrate_decr,
  61. .progress = udbg_progress,
  62. .power_save = e500_idle,
  63. };
  64. machine_device_initcall(p4080_ds, corenet_ds_publish_devices);
  65. #ifdef CONFIG_SWIOTLB
  66. machine_arch_initcall(p4080_ds, swiotlb_setup_bus_notifier);
  67. #endif