c293pcie.c 1.6 KB

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