c293pcie.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * C293PCIE Board Setup
  4. *
  5. * Copyright 2013 Freescale Semiconductor Inc.
  6. */
  7. #include <linux/stddef.h>
  8. #include <linux/kernel.h>
  9. #include <linux/of_fdt.h>
  10. #include <linux/of_platform.h>
  11. #include <asm/machdep.h>
  12. #include <asm/udbg.h>
  13. #include <asm/mpic.h>
  14. #include <sysdev/fsl_soc.h>
  15. #include <sysdev/fsl_pci.h>
  16. #include "mpc85xx.h"
  17. static void __init c293_pcie_pic_init(void)
  18. {
  19. struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |
  20. MPIC_SINGLE_DEST_CPU, 0, 256, " OpenPIC ");
  21. BUG_ON(mpic == NULL);
  22. mpic_init(mpic);
  23. }
  24. /*
  25. * Setup the architecture
  26. */
  27. static void __init c293_pcie_setup_arch(void)
  28. {
  29. if (ppc_md.progress)
  30. ppc_md.progress("c293_pcie_setup_arch()", 0);
  31. fsl_pci_assign_primary();
  32. printk(KERN_INFO "C293 PCIE board from Freescale Semiconductor\n");
  33. }
  34. machine_arch_initcall(c293_pcie, mpc85xx_common_publish_devices);
  35. /*
  36. * Called very early, device-tree isn't unflattened
  37. */
  38. static int __init c293_pcie_probe(void)
  39. {
  40. if (of_machine_is_compatible("fsl,C293PCIE"))
  41. return 1;
  42. return 0;
  43. }
  44. define_machine(c293_pcie) {
  45. .name = "C293 PCIE",
  46. .probe = c293_pcie_probe,
  47. .setup_arch = c293_pcie_setup_arch,
  48. .init_IRQ = c293_pcie_pic_init,
  49. .get_irq = mpic_get_irq,
  50. .calibrate_decr = generic_calibrate_decr,
  51. .progress = udbg_progress,
  52. };