socrates.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Copyright (c) 2008 Emcraft Systems
  4. * Sergei Poselenov <[email protected]>
  5. *
  6. * Based on MPC8560 ADS and arch/ppc tqm85xx ports
  7. *
  8. * Maintained by Kumar Gala (see MAINTAINERS for contact information)
  9. *
  10. * Copyright 2008 Freescale Semiconductor Inc.
  11. *
  12. * Copyright (c) 2005-2006 DENX Software Engineering
  13. * Stefan Roese <[email protected]>
  14. *
  15. * Based on original work by
  16. * Kumar Gala <[email protected]>
  17. * Copyright 2004 Freescale Semiconductor Inc.
  18. */
  19. #include <linux/stddef.h>
  20. #include <linux/kernel.h>
  21. #include <linux/pci.h>
  22. #include <linux/kdev_t.h>
  23. #include <linux/delay.h>
  24. #include <linux/seq_file.h>
  25. #include <linux/of_platform.h>
  26. #include <asm/time.h>
  27. #include <asm/machdep.h>
  28. #include <asm/pci-bridge.h>
  29. #include <asm/mpic.h>
  30. #include <mm/mmu_decl.h>
  31. #include <asm/udbg.h>
  32. #include <sysdev/fsl_soc.h>
  33. #include <sysdev/fsl_pci.h>
  34. #include "mpc85xx.h"
  35. #include "socrates_fpga_pic.h"
  36. static void __init socrates_pic_init(void)
  37. {
  38. struct device_node *np;
  39. struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN,
  40. 0, 256, " OpenPIC ");
  41. BUG_ON(mpic == NULL);
  42. mpic_init(mpic);
  43. np = of_find_compatible_node(NULL, NULL, "abb,socrates-fpga-pic");
  44. if (!np) {
  45. printk(KERN_ERR "Could not find socrates-fpga-pic node\n");
  46. return;
  47. }
  48. socrates_fpga_pic_init(np);
  49. of_node_put(np);
  50. }
  51. /*
  52. * Setup the architecture
  53. */
  54. static void __init socrates_setup_arch(void)
  55. {
  56. if (ppc_md.progress)
  57. ppc_md.progress("socrates_setup_arch()", 0);
  58. fsl_pci_assign_primary();
  59. }
  60. machine_arch_initcall(socrates, mpc85xx_common_publish_devices);
  61. /*
  62. * Called very early, device-tree isn't unflattened
  63. */
  64. static int __init socrates_probe(void)
  65. {
  66. if (of_machine_is_compatible("abb,socrates"))
  67. return 1;
  68. return 0;
  69. }
  70. define_machine(socrates) {
  71. .name = "Socrates",
  72. .probe = socrates_probe,
  73. .setup_arch = socrates_setup_arch,
  74. .init_IRQ = socrates_pic_init,
  75. .get_irq = mpic_get_irq,
  76. .calibrate_decr = generic_calibrate_decr,
  77. .progress = udbg_progress,
  78. };