p4080_ds.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 "corenet_ds.h"
  30. #ifdef CONFIG_PCI
  31. static int primary_phb_addr;
  32. #endif
  33. /*
  34. * Called very early, device-tree isn't unflattened
  35. */
  36. static int __init p4080_ds_probe(void)
  37. {
  38. unsigned long root = of_get_flat_dt_root();
  39. if (of_flat_dt_is_compatible(root, "fsl,P4080DS")) {
  40. #ifdef CONFIG_PCI
  41. /* treat PCIe1 as primary,
  42. * shouldn't matter as we have no ISA on the board
  43. */
  44. primary_phb_addr = 0x0000;
  45. #endif
  46. return 1;
  47. } else {
  48. return 0;
  49. }
  50. }
  51. define_machine(p4080_ds) {
  52. .name = "P4080 DS",
  53. .probe = p4080_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. };
  64. machine_device_initcall(p4080_ds, corenet_ds_publish_devices);
  65. machine_arch_initcall(p4080_ds, swiotlb_setup_bus_notifier);