mpc85xx_rdb.c 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * MPC85xx RDB Board Setup
  4. *
  5. * Copyright 2009,2012-2013 Freescale Semiconductor Inc.
  6. */
  7. #include <linux/stddef.h>
  8. #include <linux/kernel.h>
  9. #include <linux/pci.h>
  10. #include <linux/kdev_t.h>
  11. #include <linux/delay.h>
  12. #include <linux/seq_file.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/of.h>
  15. #include <linux/of_address.h>
  16. #include <linux/fsl/guts.h>
  17. #include <asm/time.h>
  18. #include <asm/machdep.h>
  19. #include <asm/pci-bridge.h>
  20. #include <mm/mmu_decl.h>
  21. #include <asm/udbg.h>
  22. #include <asm/mpic.h>
  23. #include <soc/fsl/qe/qe.h>
  24. #include <sysdev/fsl_soc.h>
  25. #include <sysdev/fsl_pci.h>
  26. #include "smp.h"
  27. #include "mpc85xx.h"
  28. static void __init mpc85xx_rdb_pic_init(void)
  29. {
  30. struct mpic *mpic;
  31. int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU;
  32. if (of_machine_is_compatible("fsl,MPC85XXRDB-CAMP"))
  33. flags |= MPIC_NO_RESET;
  34. mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC ");
  35. if (WARN_ON(!mpic))
  36. return;
  37. mpic_init(mpic);
  38. }
  39. /*
  40. * Setup the architecture
  41. */
  42. static void __init mpc85xx_rdb_setup_arch(void)
  43. {
  44. if (ppc_md.progress)
  45. ppc_md.progress("mpc85xx_rdb_setup_arch()", 0);
  46. mpc85xx_smp_init();
  47. fsl_pci_assign_primary();
  48. mpc85xx_qe_par_io_init();
  49. #if defined(CONFIG_UCC_GETH) || defined(CONFIG_SERIAL_QE)
  50. if (machine_is(p1025_rdb)) {
  51. struct device_node *np;
  52. struct ccsr_guts __iomem *guts;
  53. np = of_find_node_by_name(NULL, "global-utilities");
  54. if (np) {
  55. guts = of_iomap(np, 0);
  56. if (!guts) {
  57. pr_err("mpc85xx-rdb: could not map global utilities register\n");
  58. } else {
  59. /* P1025 has pins muxed for QE and other functions. To
  60. * enable QE UEC mode, we need to set bit QE0 for UCC1
  61. * in Eth mode, QE0 and QE3 for UCC5 in Eth mode, QE9
  62. * and QE12 for QE MII management signals in PMUXCR
  63. * register.
  64. */
  65. setbits32(&guts->pmuxcr, MPC85xx_PMUXCR_QE(0) |
  66. MPC85xx_PMUXCR_QE(3) |
  67. MPC85xx_PMUXCR_QE(9) |
  68. MPC85xx_PMUXCR_QE(12));
  69. iounmap(guts);
  70. }
  71. of_node_put(np);
  72. }
  73. }
  74. #endif
  75. pr_info("MPC85xx RDB board from Freescale Semiconductor\n");
  76. }
  77. machine_arch_initcall(p1020_mbg_pc, mpc85xx_common_publish_devices);
  78. machine_arch_initcall(p1020_rdb, mpc85xx_common_publish_devices);
  79. machine_arch_initcall(p1020_rdb_pc, mpc85xx_common_publish_devices);
  80. machine_arch_initcall(p1020_rdb_pd, mpc85xx_common_publish_devices);
  81. machine_arch_initcall(p1020_utm_pc, mpc85xx_common_publish_devices);
  82. machine_arch_initcall(p1021_rdb_pc, mpc85xx_common_publish_devices);
  83. machine_arch_initcall(p1025_rdb, mpc85xx_common_publish_devices);
  84. machine_arch_initcall(p1024_rdb, mpc85xx_common_publish_devices);
  85. define_machine(p1020_rdb) {
  86. .name = "P1020 RDB",
  87. .compatible = "fsl,P1020RDB",
  88. .setup_arch = mpc85xx_rdb_setup_arch,
  89. .init_IRQ = mpc85xx_rdb_pic_init,
  90. #ifdef CONFIG_PCI
  91. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  92. .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
  93. #endif
  94. .get_irq = mpic_get_irq,
  95. .progress = udbg_progress,
  96. };
  97. define_machine(p1021_rdb_pc) {
  98. .name = "P1021 RDB-PC",
  99. .compatible = "fsl,P1021RDB-PC",
  100. .setup_arch = mpc85xx_rdb_setup_arch,
  101. .init_IRQ = mpc85xx_rdb_pic_init,
  102. #ifdef CONFIG_PCI
  103. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  104. .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
  105. #endif
  106. .get_irq = mpic_get_irq,
  107. .progress = udbg_progress,
  108. };
  109. define_machine(p1025_rdb) {
  110. .name = "P1025 RDB",
  111. .compatible = "fsl,P1025RDB",
  112. .setup_arch = mpc85xx_rdb_setup_arch,
  113. .init_IRQ = mpc85xx_rdb_pic_init,
  114. #ifdef CONFIG_PCI
  115. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  116. .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
  117. #endif
  118. .get_irq = mpic_get_irq,
  119. .progress = udbg_progress,
  120. };
  121. define_machine(p1020_mbg_pc) {
  122. .name = "P1020 MBG-PC",
  123. .compatible = "fsl,P1020MBG-PC",
  124. .setup_arch = mpc85xx_rdb_setup_arch,
  125. .init_IRQ = mpc85xx_rdb_pic_init,
  126. #ifdef CONFIG_PCI
  127. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  128. .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
  129. #endif
  130. .get_irq = mpic_get_irq,
  131. .progress = udbg_progress,
  132. };
  133. define_machine(p1020_utm_pc) {
  134. .name = "P1020 UTM-PC",
  135. .compatible = "fsl,P1020UTM-PC",
  136. .setup_arch = mpc85xx_rdb_setup_arch,
  137. .init_IRQ = mpc85xx_rdb_pic_init,
  138. #ifdef CONFIG_PCI
  139. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  140. .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
  141. #endif
  142. .get_irq = mpic_get_irq,
  143. .progress = udbg_progress,
  144. };
  145. define_machine(p1020_rdb_pc) {
  146. .name = "P1020RDB-PC",
  147. .compatible = "fsl,P1020RDB-PC",
  148. .setup_arch = mpc85xx_rdb_setup_arch,
  149. .init_IRQ = mpc85xx_rdb_pic_init,
  150. #ifdef CONFIG_PCI
  151. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  152. .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
  153. #endif
  154. .get_irq = mpic_get_irq,
  155. .progress = udbg_progress,
  156. };
  157. define_machine(p1020_rdb_pd) {
  158. .name = "P1020RDB-PD",
  159. .compatible = "fsl,P1020RDB-PD",
  160. .setup_arch = mpc85xx_rdb_setup_arch,
  161. .init_IRQ = mpc85xx_rdb_pic_init,
  162. #ifdef CONFIG_PCI
  163. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  164. .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
  165. #endif
  166. .get_irq = mpic_get_irq,
  167. .progress = udbg_progress,
  168. };
  169. define_machine(p1024_rdb) {
  170. .name = "P1024 RDB",
  171. .compatible = "fsl,P1024RDB",
  172. .setup_arch = mpc85xx_rdb_setup_arch,
  173. .init_IRQ = mpc85xx_rdb_pic_init,
  174. #ifdef CONFIG_PCI
  175. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  176. .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
  177. #endif
  178. .get_irq = mpic_get_irq,
  179. .progress = udbg_progress,
  180. };