History

Merge tag 'powerpc-6.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc updates from Michael Ellerman: - Remove support for 40x CPUs & platforms - Add support to the 64-bit BPF JIT for cpu v4 instructions - Fix PCI hotplug driver crash on powernv - Fix doorbell emulation for KVM on PAPR guests (nestedv2) - Fix KVM nested guest handling of some less used SPRs - Online NUMA nodes with no CPU/memory if they have a PCI device attached - Reduce memory overhead of enabling kfence on 64-bit Radix MMU kernels - Reimplement the iommu table_group_ops for pseries for VFIO SPAPR TCE Thanks to: Anjali K, Artem Savkov, Athira Rajeev, Breno Leitao, Brian King, Celeste Liu, Christophe Leroy, Esben Haabendal, Gaurav Batra, Gautam Menghani, Haren Myneni, Hari Bathini, Jeff Johnson, Krishna Kumar, Krzysztof Kozlowski, Nathan Lynch, Nicholas Piggin, Nick Bowler, Nilay Shroff, Rob Herring (Arm), Shawn Anastasio, Shivaprasad G Bhat, Sourabh Jain, Srikar Dronamraju, Timothy Pearson, Uwe Kleine-König, and Vaibhav Jain. * tag 'powerpc-6.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (57 commits) Documentation/powerpc: Mention 40x is removed powerpc: Remove 40x leftovers macintosh/therm_windtunnel: fix module unload. powerpc: Check only single values are passed to CPU/MMU feature checks powerpc/xmon: Fix disassembly CPU feature checks powerpc: Drop clang workaround for builtin constant checks powerpc64/bpf: jit support for signed division and modulo powerpc64/bpf: jit support for sign extended mov powerpc64/bpf: jit support for sign extended load powerpc64/bpf: jit support for unconditional byte swap powerpc64/bpf: jit support for 32bit offset jmp instruction powerpc/pci: Hotplug driver bridge support pci/hotplug/pnv_php: Fix hotplug driver crash on Powernv powerpc/configs: Update defconfig with now user-visible CONFIG_FSL_IFC powerpc: add missing MODULE_DESCRIPTION() macros macintosh/mac_hid: add MODULE_DESCRIPTION() KVM: PPC: add missing MODULE_DESCRIPTION() macros powerpc/kexec: Use of_property_read_reg() powerpc/64s/radix/kfence: map __kfence_pool at page granularity powerpc/pseries/iommu: Define spapr_tce_table_group_ops only with CONFIG_IOMMU_API ...

Linus Torvalds committed 2 years ago

Commit 3c3ff7b2 parents 3f386cb 9ff0251158 files · +1464 −5776Browse files

Unified · Split

158 files
  1. Documentation/arch/powerpc/cpu_families.rst +0 −18
  2. Documentation/arch/powerpc/elf_hwcaps.rst +1 −0
  3. Documentation/arch/powerpc/kvm-nested.rst +3 −1
  4. Documentation/virt/kvm/api.rst +3 −0
  5. MAINTAINERS +0 −1
  6. arch/powerpc/Kconfig +7 −10
  7. arch/powerpc/Kconfig.debug +0 −13
  8. arch/powerpc/Makefile +0 −5
  9. arch/powerpc/boot/4xx.c +0 −266
  10. arch/powerpc/boot/4xx.h +0 −4
  11. arch/powerpc/boot/Makefile +0 −11
  12. arch/powerpc/boot/cuboot-acadia.c +0 −171
  13. arch/powerpc/boot/cuboot-hotfoot.c +0 −139
  14. arch/powerpc/boot/cuboot-kilauea.c +0 −46
  15. arch/powerpc/boot/dcr.h +0 −11
  16. arch/powerpc/boot/dts/acadia.dts +0 −224
  17. arch/powerpc/boot/dts/haleakala.dts +0 −281
  18. arch/powerpc/boot/dts/hotfoot.dts +0 −296
  19. arch/powerpc/boot/dts/kilauea.dts +0 −407
  20. arch/powerpc/boot/dts/klondike.dts +0 −212
  21. arch/powerpc/boot/dts/makalu.dts +0 −353
  22. arch/powerpc/boot/dts/obs600.dts +0 −314
  23. arch/powerpc/boot/ppcboot-hotfoot.h +0 −119
  24. arch/powerpc/boot/ppcboot.h +1 −1
  25. arch/powerpc/boot/wrapper +1 −21
  26. arch/powerpc/configs/40x.config +0 −2
  27. arch/powerpc/configs/40x/acadia_defconfig +0 −61
  28. arch/powerpc/configs/40x/kilauea_defconfig +0 −69
  29. arch/powerpc/configs/40x/klondike_defconfig +0 −43
  30. arch/powerpc/configs/40x/makalu_defconfig +0 −59
  31. arch/powerpc/configs/40x/obs600_defconfig +0 −69
  32. arch/powerpc/configs/40x/walnut_defconfig +0 −55
  33. arch/powerpc/configs/85xx-hw.config +2 −0
  34. arch/powerpc/configs/ppc40x_defconfig +0 −74
  35. arch/powerpc/configs/ppc6xx_defconfig +0 −1
  36. arch/powerpc/include/asm/cacheflush.h +1 −1
  37. arch/powerpc/include/asm/cpu_has_feature.h +1 −2
  38. arch/powerpc/include/asm/cputable.h +0 −7
  39. arch/powerpc/include/asm/guest-state-buffer.h +2 −1
  40. arch/powerpc/include/asm/hw_irq.h +4 −4
  41. arch/powerpc/include/asm/iommu.h +13 −3
  42. arch/powerpc/include/asm/irq.h +1 −1
  43. arch/powerpc/include/asm/kexec.h +2 −4
  44. arch/powerpc/include/asm/kfence.h +10 −1
  45. arch/powerpc/include/asm/kup.h +1 −1
  46. arch/powerpc/include/asm/kvm_book3s.h +1 −0
  47. arch/powerpc/include/asm/kvm_book3s_64.h +5 −0
  48. arch/powerpc/include/asm/kvm_host.h +3 −0
  49. arch/powerpc/include/asm/lppaca.h +8 −3
  50. arch/powerpc/include/asm/mmu.h +1 −9
  51. arch/powerpc/include/asm/nohash/32/mmu-40x.h +0 −68
  52. arch/powerpc/include/asm/nohash/32/pgtable.h +1 −3
  53. arch/powerpc/include/asm/nohash/32/pte-40x.h +0 −73
  54. arch/powerpc/include/asm/nohash/mmu.h +1 −4
  55. arch/powerpc/include/asm/perf_event_server.h +2 −1
  56. arch/powerpc/include/asm/plpar_wrappers.h +0 −28
  57. arch/powerpc/include/asm/ppc-opcode.h +2 −0
  58. arch/powerpc/include/asm/ppc_asm.h +1 −1
  59. arch/powerpc/include/asm/processor.h +1 −1
  60. arch/powerpc/include/asm/ptrace.h +1 −1
  61. arch/powerpc/include/asm/reg.h +2 −25
  62. arch/powerpc/include/asm/reg_booke.h +2 −111
  63. arch/powerpc/include/asm/time.h +1 −6
  64. arch/powerpc/include/asm/udbg.h +0 −1
  65. arch/powerpc/include/uapi/asm/kvm.h +3 −0
  66. arch/powerpc/kernel/Makefile +0 −1
  67. arch/powerpc/kernel/asm-offsets.c +1 −1
  68. arch/powerpc/kernel/cpu_specs.h +0 −4
  69. arch/powerpc/kernel/cpu_specs_40x.h +0 −280
  70. arch/powerpc/kernel/eeh.c +0 −16
  71. arch/powerpc/kernel/entry_32.S +3 −45
  72. arch/powerpc/kernel/epapr_hcalls.S +1 −1
  73. arch/powerpc/kernel/head_32.h +1 −11
  74. arch/powerpc/kernel/head_40x.S +0 −721
  75. arch/powerpc/kernel/head_booke.h +1 −2
  76. arch/powerpc/kernel/iommu.c +21 −149
  77. arch/powerpc/kernel/irq.c +1 −1
  78. arch/powerpc/kernel/kgdb.c +2 −2
  79. arch/powerpc/kernel/misc_32.S +0 −40
  80. arch/powerpc/kernel/pci-hotplug.c +32 −3
  81. arch/powerpc/kernel/process.c +2 −2
  82. arch/powerpc/kernel/prom.c +8 −4
  83. arch/powerpc/kernel/rtas.c +4 −0
  84. arch/powerpc/kernel/rtas_flash.c +1 −0
  85. arch/powerpc/kernel/setup.h +1 −1
  86. arch/powerpc/kernel/setup_32.c +1 −1
  87. arch/powerpc/kernel/time.c +1 −1
  88. arch/powerpc/kernel/traps.c +1 −1
  89. arch/powerpc/kernel/udbg.c +0 −3
  90. arch/powerpc/kernel/udbg_16550.c +0 −23
  91. arch/powerpc/kexec/core_64.c +37 −16
  92. arch/powerpc/kexec/elf_64.c +9 −3
  93. arch/powerpc/kexec/file_load_64.c +35 −55
  94. arch/powerpc/kvm/book3s_hv.c +101 −2
  95. arch/powerpc/kvm/book3s_hv.h +3 −0
  96. arch/powerpc/kvm/book3s_hv_nestedv2.c +25 −0
  97. arch/powerpc/kvm/book3s_pr.c +1 −0
  98. arch/powerpc/kvm/test-guest-state-buffer.c +2 −1
  99. arch/powerpc/kvm/trace_hv.h +29 −0
  100. arch/powerpc/mm/book3s64/radix_pgtable.c +80 −4
  101. arch/powerpc/mm/drmem.c +1 −3
  102. arch/powerpc/mm/fault.c +2 −2
  103. arch/powerpc/mm/init-common.c +3 −0
  104. arch/powerpc/mm/mmu_context.c +1 −1
  105. arch/powerpc/mm/mmu_decl.h +4 −4
  106. arch/powerpc/mm/nohash/40x.c +0 −161
  107. arch/powerpc/mm/nohash/Makefile +0 −1
  108. arch/powerpc/mm/nohash/kup.c +0 −2
  109. arch/powerpc/mm/nohash/mmu_context.c +1 −4
  110. arch/powerpc/mm/nohash/tlb_low.S +1 −26
  111. arch/powerpc/mm/numa.c +13 −1
  112. arch/powerpc/mm/ptdump/Makefile +1 −1
  113. arch/powerpc/net/bpf_jit_comp64.c +88 −30
  114. arch/powerpc/perf/core-book3s.c +19 −26
  115. arch/powerpc/perf/power10-pmu.c +2 −1
  116. arch/powerpc/platforms/40x/Kconfig +0 −78
  117. arch/powerpc/platforms/40x/Makefile +0 −2
  118. arch/powerpc/platforms/40x/ppc40x_simple.c +0 −74
  119. arch/powerpc/platforms/44x/Makefile +5 −1
  120. arch/powerpc/platforms/44x/cpm.c +0 −0
  121. arch/powerpc/platforms/44x/gpio.c +0 −0
  122. arch/powerpc/platforms/44x/hsta_msi.c +0 −0
  123. arch/powerpc/platforms/44x/machine_check.c +15 −0
  124. arch/powerpc/platforms/44x/pci.c +0 −100
  125. arch/powerpc/platforms/44x/pci.h +0 −0
  126. arch/powerpc/platforms/44x/soc.c +0 −0
  127. arch/powerpc/platforms/44x/uic.c +0 −0
  128. arch/powerpc/platforms/4xx/Makefile +0 −7
  129. arch/powerpc/platforms/4xx/machine_check.c +0 −23
  130. arch/powerpc/platforms/85xx/t1042rdb_diu.c +1 −0
  131. arch/powerpc/platforms/Kconfig +0 −1
  132. arch/powerpc/platforms/Kconfig.cputype +4 −24
  133. arch/powerpc/platforms/Makefile +0 −2
  134. arch/powerpc/platforms/cell/cbe_powerbutton.c +1 −0
  135. arch/powerpc/platforms/cell/cbe_thermal.c +1 −0
  136. arch/powerpc/platforms/cell/cpufreq_spudemand.c +1 −0
  137. arch/powerpc/platforms/cell/spufs/inode.c +1 −0
  138. arch/powerpc/platforms/chrp/nvram.c +1 −0
  139. arch/powerpc/platforms/powernv/pci-ioda.c +4 −2
  140. arch/powerpc/platforms/pseries/iommu.c +733 −48
  141. arch/powerpc/platforms/pseries/papr_scm.c +1 −0
  142. arch/powerpc/platforms/pseries/pci_dlpar.c +14 −0
  143. arch/powerpc/platforms/pseries/vas.c +21 −1
  144. arch/powerpc/sysdev/Kconfig +2 −2
  145. arch/powerpc/sysdev/rtc_cmos_setup.c +1 −0
  146. arch/powerpc/xmon/ppc-dis.c +11 −22
  147. drivers/macintosh/ams/ams-i2c.c +1 −1
  148. drivers/macintosh/mac_hid.c +1 −0
  149. drivers/macintosh/therm_windtunnel.c +1 −1
  150. drivers/macintosh/windfarm_ad7417_sensor.c +1 −1
  151. drivers/macintosh/windfarm_fcu_controls.c +1 −1
  152. drivers/macintosh/windfarm_lm87_sensor.c +1 −1
  153. drivers/macintosh/windfarm_max6690_sensor.c +1 −1
  154. drivers/macintosh/windfarm_smu_sat.c +1 −1
  155. drivers/pci/hotplug/pnv_php.c +1 −2
  156. drivers/vfio/vfio_iommu_spapr_tce.c +9 −4
  157. scripts/head-object-list.txt +0 −1
  158. tools/testing/selftests/sigaltstack/current_stack_pointer.h +1 −1
Documentation/arch/powerpc/cpu_families.rst+0−18
@@ -128,24 +128,6 @@ IBM BookE · 127 unmodified lines
128- All 32 bit::128- All 32 bit::
129 129
130 +--------------+130 +--------------+
131 | 401 |
132 +--------------+
133 |
134 |
135 v
136 +--------------+
137 | 403 |
138 +--------------+
139 |
140 |
141 v
142 +--------------+
143 | 405 |
144 +--------------+
145 |
146 |
147 v
148 +--------------+
149 | 440 |131 | 440 |
150 +--------------+132 +--------------+
151 |133 |
Documentation/arch/powerpc/elf_hwcaps.rst+1−0
@@ -91,6 +91,7 @@ PPC_FEATURE_HAS_MMU · 90 unmodified lines
91 91
92PPC_FEATURE_HAS_4xxMAC92PPC_FEATURE_HAS_4xxMAC
93 The processor is 40x or 44x family.93 The processor is 40x or 44x family.
94 Unused in the kernel since 732b32daef80 ("powerpc: Remove core support for 40x")
94 95
95PPC_FEATURE_UNIFIED_CACHE96PPC_FEATURE_UNIFIED_CACHE
96 The processor has a unified L1 cache for instructions and data, as97 The processor has a unified L1 cache for instructions and data, as
Documentation/arch/powerpc/kvm-nested.rst+3−1
@@ -546,7 +546,9 @@ table information. · 545 unmodified lines
546+--------+-------+----+--------+----------------------------------+546+--------+-------+----+--------+----------------------------------+
547| 0x1052 | 0x08 | RW | T | CTRL |547| 0x1052 | 0x08 | RW | T | CTRL |
548+--------+-------+----+--------+----------------------------------+548+--------+-------+----+--------+----------------------------------+
549| 0x1053-| | | | Reserved |549| 0x1053 | 0x08 | RW | T | DPDES |
550+--------+-------+----+--------+----------------------------------+
551| 0x1054-| | | | Reserved |
550| 0x1FFF | | | | |552| 0x1FFF | | | | |
551+--------+-------+----+--------+----------------------------------+553+--------+-------+----+--------+----------------------------------+
552| 0x2000 | 0x04 | RW | T | CR |554| 0x2000 | 0x04 | RW | T | CR |
Documentation/virt/kvm/api.rst+3−0
@@ -2439,8 +2439,11 @@ registers, find a list below: · 2438 unmodified lines
2439 PPC KVM_REG_PPC_PSSCR 642439 PPC KVM_REG_PPC_PSSCR 64
2440 PPC KVM_REG_PPC_DEC_EXPIRY 642440 PPC KVM_REG_PPC_DEC_EXPIRY 64
2441 PPC KVM_REG_PPC_PTCR 642441 PPC KVM_REG_PPC_PTCR 64
2442 PPC KVM_REG_PPC_HASHKEYR 64
2443 PPC KVM_REG_PPC_HASHPKEYR 64
2442 PPC KVM_REG_PPC_DAWR1 642444 PPC KVM_REG_PPC_DAWR1 64
2443 PPC KVM_REG_PPC_DAWRX1 642445 PPC KVM_REG_PPC_DAWRX1 64
2446 PPC KVM_REG_PPC_DEXCR 64
2444 PPC KVM_REG_PPC_TM_GPR0 642447 PPC KVM_REG_PPC_TM_GPR0 64
2445 ...2448 ...
2446 PPC KVM_REG_PPC_TM_GPR31 642449 PPC KVM_REG_PPC_TM_GPR31 64
MAINTAINERS+0−1
@@ -12924,7 +12924,6 @@ F: arch/powerpc/platforms/52xx/ · 12923 unmodified lines
12924LINUX FOR POWERPC EMBEDDED PPC4XX12924LINUX FOR POWERPC EMBEDDED PPC4XX
12925L: linuxppc-dev@lists.ozlabs.org12925L: linuxppc-dev@lists.ozlabs.org
12926S: Orphan12926S: Orphan
12927F: arch/powerpc/platforms/40x/
12928F: arch/powerpc/platforms/44x/12927F: arch/powerpc/platforms/44x/
12929 12928
12930LINUX FOR POWERPC EMBEDDED PPC85XX12929LINUX FOR POWERPC EMBEDDED PPC85XX
arch/powerpc/Kconfig+7−10
@@ -149,7 +149,7 @@ config PPC · 148 unmodified lines
149 select ARCH_HAS_PTE_SPECIAL149 select ARCH_HAS_PTE_SPECIAL
150 select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE && PPC_BOOK3S_64150 select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE && PPC_BOOK3S_64
151 select ARCH_HAS_SET_MEMORY151 select ARCH_HAS_SET_MEMORY
152 select ARCH_HAS_STRICT_KERNEL_RWX if (PPC_BOOK3S || PPC_8xx || 40x) && !HIBERNATION152 select ARCH_HAS_STRICT_KERNEL_RWX if (PPC_BOOK3S || PPC_8xx) && !HIBERNATION
153 select ARCH_HAS_STRICT_KERNEL_RWX if PPC_85xx && !HIBERNATION && !RANDOMIZE_BASE153 select ARCH_HAS_STRICT_KERNEL_RWX if PPC_85xx && !HIBERNATION && !RANDOMIZE_BASE
154 select ARCH_HAS_STRICT_MODULE_RWX if ARCH_HAS_STRICT_KERNEL_RWX154 select ARCH_HAS_STRICT_MODULE_RWX if ARCH_HAS_STRICT_KERNEL_RWX
155 select ARCH_HAS_SYSCALL_WRAPPER if !SPU_BASE && !COMPAT155 select ARCH_HAS_SYSCALL_WRAPPER if !SPU_BASE && !COMPAT
@@ -167,7 +167,7 @@ config PPC · 11 unmodified lines
167 select ARCH_SPLIT_ARG64 if PPC32167 select ARCH_SPLIT_ARG64 if PPC32
168 select ARCH_STACKWALK168 select ARCH_STACKWALK
169 select ARCH_SUPPORTS_ATOMIC_RMW169 select ARCH_SUPPORTS_ATOMIC_RMW
170 select ARCH_SUPPORTS_DEBUG_PAGEALLOC if PPC_BOOK3S || PPC_8xx || 40x170 select ARCH_SUPPORTS_DEBUG_PAGEALLOC if PPC_BOOK3S || PPC_8xx
171 select ARCH_USE_BUILTIN_BSWAP171 select ARCH_USE_BUILTIN_BSWAP
172 select ARCH_USE_CMPXCHG_LOCKREF if PPC64172 select ARCH_USE_CMPXCHG_LOCKREF if PPC64
173 select ARCH_USE_MEMTEST173 select ARCH_USE_MEMTEST
@@ -389,7 +389,7 @@ config ARCH_SUSPEND_POSSIBLE · 215 unmodified lines
389 def_bool y389 def_bool y
390 depends on ADB_PMU || PPC_EFIKA || PPC_LITE5200 || PPC_83xx || \390 depends on ADB_PMU || PPC_EFIKA || PPC_LITE5200 || PPC_83xx || \
391 (PPC_85xx && !PPC_E500MC) || PPC_86xx || PPC_PSERIES \391 (PPC_85xx && !PPC_E500MC) || PPC_86xx || PPC_PSERIES \
392 || 44x || 40x392 || 44x
393 393
394config ARCH_SUSPEND_NONZERO_CPU394config ARCH_SUSPEND_NONZERO_CPU
395 def_bool y395 def_bool y
@@ -443,7 +443,7 @@ config ARCH_SUPPORTS_UPROBES · 47 unmodified lines
443 443
444config PPC_ADV_DEBUG_REGS444config PPC_ADV_DEBUG_REGS
445 bool445 bool
446 depends on 40x || BOOKE446 depends on BOOKE
447 default y447 default y
448 448
449config PPC_ADV_DEBUG_IACS449config PPC_ADV_DEBUG_IACS
@@ -490,7 +490,7 @@ source "kernel/Kconfig.hz" · 40 unmodified lines
490 490
491config MATH_EMULATION491config MATH_EMULATION
492 bool "Math emulation"492 bool "Math emulation"
493 depends on 4xx || PPC_8xx || PPC_MPC832x || BOOKE || PPC_MICROWATT493 depends on 44x || PPC_8xx || PPC_MPC832x || BOOKE || PPC_MICROWATT
494 select PPC_FPU_REGS494 select PPC_FPU_REGS
495 help495 help
496 Some PowerPC chips designed for embedded applications do not have496 Some PowerPC chips designed for embedded applications do not have
@@ -1077,7 +1077,7 @@ config GENERIC_ISA_DMA · 580 unmodified lines
1077config PPC_INDIRECT_PCI1077config PPC_INDIRECT_PCI
1078 bool1078 bool
1079 depends on PCI1079 depends on PCI
1080 default y if 40x || 44x1080 default y if 44x
1081 1081
1082config SBUS1082config SBUS
1083 bool1083 bool
@@ -1102,15 +1102,12 @@ config FSL_PMC · 18 unmodified lines
1102config PPC4xx_CPM1102config PPC4xx_CPM
1103 bool1103 bool
1104 default y1104 default y
1105 depends on SUSPEND && (44x || 40x)1105 depends on SUSPEND && 44x
1106 help1106 help
1107 PPC4xx Clock Power Management (CPM) support (suspend/resume).1107 PPC4xx Clock Power Management (CPM) support (suspend/resume).
1108 It also enables support for two different idle states (idle-wait1108 It also enables support for two different idle states (idle-wait
1109 and idle-doze).1109 and idle-doze).
1110 1110
1111config 4xx_SOC
1112 bool
1113
1114config FSL_LBC1111config FSL_LBC
1115 bool "Freescale Local Bus support"1112 bool "Freescale Local Bus support"
1116 help1113 help
arch/powerpc/Kconfig.debug+0−13
@@ -244,14 +244,6 @@ config PPC_EARLY_DEBUG_44x · 243 unmodified lines
244 inbuilt serial port. If you enable this, ensure you set244 inbuilt serial port. If you enable this, ensure you set
245 PPC_EARLY_DEBUG_44x_PHYSLOW below to suit your target board.245 PPC_EARLY_DEBUG_44x_PHYSLOW below to suit your target board.
246 246
247config PPC_EARLY_DEBUG_40x
248 bool "Early serial debugging for IBM/AMCC 40x CPUs"
249 depends on 40x
250 help
251 Select this to enable early debugging for IBM 40x chips via the
252 inbuilt serial port. This works on chips with a 16550 compatible
253 UART.
254
255config PPC_EARLY_DEBUG_CPM247config PPC_EARLY_DEBUG_CPM
256 bool "Early serial debugging for Freescale CPM-based serial ports"248 bool "Early serial debugging for Freescale CPM-based serial ports"
257 depends on SERIAL_CPM=y249 depends on SERIAL_CPM=y
@@ -356,11 +348,6 @@ config PPC_EARLY_DEBUG_44x_PHYSHIGH · 98 unmodified lines
356 depends on PPC_EARLY_DEBUG_44x348 depends on PPC_EARLY_DEBUG_44x
357 default "0x1"349 default "0x1"
358 350
359config PPC_EARLY_DEBUG_40x_PHYSADDR
360 hex "Early debug UART physical address"
361 depends on PPC_EARLY_DEBUG_40x
362 default "0xef600300"
363
364config PPC_EARLY_DEBUG_CPM_ADDR351config PPC_EARLY_DEBUG_CPM_ADDR
365 hex "CPM UART early debug transmit descriptor address"352 hex "CPM UART early debug transmit descriptor address"
366 depends on PPC_EARLY_DEBUG_CPM353 depends on PPC_EARLY_DEBUG_CPM
arch/powerpc/Makefile+0−5
@@ -301,11 +301,6 @@ ppc32_allmodconfig: · 300 unmodified lines
301 $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/book3s_32.config \301 $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/book3s_32.config \
302 -f $(srctree)/Makefile allmodconfig302 -f $(srctree)/Makefile allmodconfig
303 303
304generated_configs += ppc40x_allmodconfig
305ppc40x_allmodconfig:
306 $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/40x.config \
307 -f $(srctree)/Makefile allmodconfig
308
309generated_configs += ppc44x_allmodconfig304generated_configs += ppc44x_allmodconfig
310ppc44x_allmodconfig:305ppc44x_allmodconfig:
311 $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/44x.config \306 $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/44x.config \
arch/powerpc/boot/4xx.c+0−266
@@ -253,7 +253,6 @@ void ibm4xx_denali_fixup_memsize(void) · 252 unmodified lines
253 dt_fixup_memory(0, memsize);253 dt_fixup_memory(0, memsize);
254}254}
255 255
256#define SPRN_DBCR0_40X 0x3F2
257#define SPRN_DBCR0_44X 0x134256#define SPRN_DBCR0_44X 0x134
258#define DBCR0_RST_SYSTEM 0x30000000257#define DBCR0_RST_SYSTEM 0x30000000
259 258
@@ -270,18 +269,6 @@ void ibm44x_dbcr_reset(void) · 10 unmodified lines
270 269
271}270}
272 271
273void ibm40x_dbcr_reset(void)
274{
275 unsigned long tmp;
276
277 asm volatile (
278 "mfspr %0,%1\n"
279 "oris %0,%0,%2@h\n"
280 "mtspr %1,%0"
281 : "=&r"(tmp) : "i"(SPRN_DBCR0_40X), "i"(DBCR0_RST_SYSTEM)
282 );
283}
284
285#define EMAC_RESET 0x20000000272#define EMAC_RESET 0x20000000
286void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1)273void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1)
287{274{
@@ -544,256 +531,3 @@ void ibm440spe_fixup_clocks(unsigned int sys_clk, · 256 unmodified lines
544 eplike_fixup_uart_clk(1, "/plb/opb/serial@f0000300", ser_clk, plb_clk);531 eplike_fixup_uart_clk(1, "/plb/opb/serial@f0000300", ser_clk, plb_clk);
545 eplike_fixup_uart_clk(2, "/plb/opb/serial@f0000600", ser_clk, plb_clk);532 eplike_fixup_uart_clk(2, "/plb/opb/serial@f0000600", ser_clk, plb_clk);
546}533}
547
548void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk)
549{
550 u32 pllmr = mfdcr(DCRN_CPC0_PLLMR);
551 u32 cpc0_cr0 = mfdcr(DCRN_405_CPC0_CR0);
552 u32 cpc0_cr1 = mfdcr(DCRN_405_CPC0_CR1);
553 u32 psr = mfdcr(DCRN_405_CPC0_PSR);
554 u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
555 u32 fwdv, fwdvb, fbdv, cbdv, opdv, epdv, ppdv, udiv;
556
557 fwdv = (8 - ((pllmr & 0xe0000000) >> 29));
558 fbdv = (pllmr & 0x1e000000) >> 25;
559 if (fbdv == 0)
560 fbdv = 16;
561 cbdv = ((pllmr & 0x00060000) >> 17) + 1; /* CPU:PLB */
562 opdv = ((pllmr & 0x00018000) >> 15) + 1; /* PLB:OPB */
563 ppdv = ((pllmr & 0x00006000) >> 13) + 1; /* PLB:PCI */
564 epdv = ((pllmr & 0x00001800) >> 11) + 2; /* PLB:EBC */
565 udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
566
567 /* check for 405GPr */
568 if ((mfpvr() & 0xfffffff0) == (0x50910951 & 0xfffffff0)) {
569 fwdvb = 8 - (pllmr & 0x00000007);
570 if (!(psr & 0x00001000)) /* PCI async mode enable == 0 */
571 if (psr & 0x00000020) /* New mode enable */
572 m = fwdvb * 2 * ppdv;
573 else
574 m = fwdvb * cbdv * ppdv;
575 else if (psr & 0x00000020) /* New mode enable */
576 if (psr & 0x00000800) /* PerClk synch mode */
577 m = fwdvb * 2 * epdv;
578 else
579 m = fbdv * fwdv;
580 else if (epdv == fbdv)
581 m = fbdv * cbdv * epdv;
582 else
583 m = fbdv * fwdvb * cbdv;
584
585 cpu = sys_clk * m / fwdv;
586 plb = sys_clk * m / (fwdvb * cbdv);
587 } else {
588 m = fwdv * fbdv * cbdv;
589 cpu = sys_clk * m / fwdv;
590 plb = cpu / cbdv;
591 }
592 opb = plb / opdv;
593 ebc = plb / epdv;
594
595 if (cpc0_cr0 & 0x80)
596 /* uart0 uses the external clock */
597 uart0 = ser_clk;
598 else
599 uart0 = cpu / udiv;
600
601 if (cpc0_cr0 & 0x40)
602 /* uart1 uses the external clock */
603 uart1 = ser_clk;
604 else
605 uart1 = cpu / udiv;
606
607 /* setup the timebase clock to tick at the cpu frequency */
608 cpc0_cr1 = cpc0_cr1 & ~0x00800000;
609 mtdcr(DCRN_405_CPC0_CR1, cpc0_cr1);
610 tb = cpu;
611
612 dt_fixup_cpu_clocks(cpu, tb, 0);
613 dt_fixup_clock("/plb", plb);
614 dt_fixup_clock("/plb/opb", opb);
615 dt_fixup_clock("/plb/ebc", ebc);
616 dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
617 dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
618}
619
620
621void ibm405ep_fixup_clocks(unsigned int sys_clk)
622{
623 u32 pllmr0 = mfdcr(DCRN_CPC0_PLLMR0);
624 u32 pllmr1 = mfdcr(DCRN_CPC0_PLLMR1);
625 u32 cpc0_ucr = mfdcr(DCRN_CPC0_UCR);
626 u32 cpu, plb, opb, ebc, uart0, uart1;
627 u32 fwdva, fwdvb, fbdv, cbdv, opdv, epdv;
628 u32 pllmr0_ccdv, tb, m;
629
630 fwdva = 8 - ((pllmr1 & 0x00070000) >> 16);
631 fwdvb = 8 - ((pllmr1 & 0x00007000) >> 12);
632 fbdv = (pllmr1 & 0x00f00000) >> 20;
633 if (fbdv == 0)
634 fbdv = 16;
635
636 cbdv = ((pllmr0 & 0x00030000) >> 16) + 1; /* CPU:PLB */
637 epdv = ((pllmr0 & 0x00000300) >> 8) + 2; /* PLB:EBC */
638 opdv = ((pllmr0 & 0x00003000) >> 12) + 1; /* PLB:OPB */
639
640 m = fbdv * fwdvb;
641
642 pllmr0_ccdv = ((pllmr0 & 0x00300000) >> 20) + 1;
643 if (pllmr1 & 0x80000000)
644 cpu = sys_clk * m / (fwdva * pllmr0_ccdv);
645 else
646 cpu = sys_clk / pllmr0_ccdv;
647
648 plb = cpu / cbdv;
649 opb = plb / opdv;
650 ebc = plb / epdv;
651 tb = cpu;
652 uart0 = cpu / (cpc0_ucr & 0x0000007f);
653 uart1 = cpu / ((cpc0_ucr & 0x00007f00) >> 8);
654
655 dt_fixup_cpu_clocks(cpu, tb, 0);
656 dt_fixup_clock("/plb", plb);
657 dt_fixup_clock("/plb/opb", opb);
658 dt_fixup_clock("/plb/ebc", ebc);
659 dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
660 dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
661}
662
663static u8 ibm405ex_fwdv_multi_bits[] = {
664 /* values for: 1 - 16 */
665 0x01, 0x02, 0x0e, 0x09, 0x04, 0x0b, 0x10, 0x0d, 0x0c, 0x05,
666 0x06, 0x0f, 0x0a, 0x07, 0x08, 0x03
667};
668
669u32 ibm405ex_get_fwdva(unsigned long cpr_fwdv)
670{
671 u32 index;
672
673 for (index = 0; index < ARRAY_SIZE(ibm405ex_fwdv_multi_bits); index++)
674 if (cpr_fwdv == (u32)ibm405ex_fwdv_multi_bits[index])
675 return index + 1;
676
677 return 0;
678}
679
680static u8 ibm405ex_fbdv_multi_bits[] = {
681 /* values for: 1 - 100 */
682 0x00, 0xff, 0x7e, 0xfd, 0x7a, 0xf5, 0x6a, 0xd5, 0x2a, 0xd4,
683 0x29, 0xd3, 0x26, 0xcc, 0x19, 0xb3, 0x67, 0xce, 0x1d, 0xbb,
684 0x77, 0xee, 0x5d, 0xba, 0x74, 0xe9, 0x52, 0xa5, 0x4b, 0x96,
685 0x2c, 0xd8, 0x31, 0xe3, 0x46, 0x8d, 0x1b, 0xb7, 0x6f, 0xde,
686 0x3d, 0xfb, 0x76, 0xed, 0x5a, 0xb5, 0x6b, 0xd6, 0x2d, 0xdb,
687 0x36, 0xec, 0x59, 0xb2, 0x64, 0xc9, 0x12, 0xa4, 0x48, 0x91,
688 0x23, 0xc7, 0x0e, 0x9c, 0x38, 0xf0, 0x61, 0xc2, 0x05, 0x8b,
689 0x17, 0xaf, 0x5f, 0xbe, 0x7c, 0xf9, 0x72, 0xe5, 0x4a, 0x95,
690 0x2b, 0xd7, 0x2e, 0xdc, 0x39, 0xf3, 0x66, 0xcd, 0x1a, 0xb4,
691 0x68, 0xd1, 0x22, 0xc4, 0x09, 0x93, 0x27, 0xcf, 0x1e, 0xbc,
692 /* values for: 101 - 200 */
693 0x78, 0xf1, 0x62, 0xc5, 0x0a, 0x94, 0x28, 0xd0, 0x21, 0xc3,
694 0x06, 0x8c, 0x18, 0xb0, 0x60, 0xc1, 0x02, 0x84, 0x08, 0x90,
695 0x20, 0xc0, 0x01, 0x83, 0x07, 0x8f, 0x1f, 0xbf, 0x7f, 0xfe,
696 0x7d, 0xfa, 0x75, 0xea, 0x55, 0xaa, 0x54, 0xa9, 0x53, 0xa6,
697 0x4c, 0x99, 0x33, 0xe7, 0x4e, 0x9d, 0x3b, 0xf7, 0x6e, 0xdd,
698 0x3a, 0xf4, 0x69, 0xd2, 0x25, 0xcb, 0x16, 0xac, 0x58, 0xb1,
699 0x63, 0xc6, 0x0d, 0x9b, 0x37, 0xef, 0x5e, 0xbd, 0x7b, 0xf6,
700 0x6d, 0xda, 0x35, 0xeb, 0x56, 0xad, 0x5b, 0xb6, 0x6c, 0xd9,
701 0x32, 0xe4, 0x49, 0x92, 0x24, 0xc8, 0x11, 0xa3, 0x47, 0x8e,
702 0x1c, 0xb8, 0x70, 0xe1, 0x42, 0x85, 0x0b, 0x97, 0x2f, 0xdf,
703 /* values for: 201 - 255 */
704 0x3e, 0xfc, 0x79, 0xf2, 0x65, 0xca, 0x15, 0xab, 0x57, 0xae,
705 0x5c, 0xb9, 0x73, 0xe6, 0x4d, 0x9a, 0x34, 0xe8, 0x51, 0xa2,
706 0x44, 0x89, 0x13, 0xa7, 0x4f, 0x9e, 0x3c, 0xf8, 0x71, 0xe2,
707 0x45, 0x8a, 0x14, 0xa8, 0x50, 0xa1, 0x43, 0x86, 0x0c, 0x98,
708 0x30, 0xe0, 0x41, 0x82, 0x04, 0x88, 0x10, 0xa0, 0x40, 0x81,
709 0x03, 0x87, 0x0f, 0x9f, 0x3f /* END */
710};
711
712u32 ibm405ex_get_fbdv(unsigned long cpr_fbdv)
713{
714 u32 index;
715
716 for (index = 0; index < ARRAY_SIZE(ibm405ex_fbdv_multi_bits); index++)
717 if (cpr_fbdv == (u32)ibm405ex_fbdv_multi_bits[index])
718 return index + 1;
719
720 return 0;
721}
722
723void ibm405ex_fixup_clocks(unsigned int sys_clk, unsigned int uart_clk)
724{
725 /* PLL config */
726 u32 pllc = CPR0_READ(DCRN_CPR0_PLLC);
727 u32 plld = CPR0_READ(DCRN_CPR0_PLLD);
728 u32 cpud = CPR0_READ(DCRN_CPR0_PRIMAD);
729 u32 plbd = CPR0_READ(DCRN_CPR0_PRIMBD);
730 u32 opbd = CPR0_READ(DCRN_CPR0_OPBD);
731 u32 perd = CPR0_READ(DCRN_CPR0_PERD);
732
733 /* Dividers */
734 u32 fbdv = ibm405ex_get_fbdv(__fix_zero((plld >> 24) & 0xff, 1));
735
736 u32 fwdva = ibm405ex_get_fwdva(__fix_zero((plld >> 16) & 0x0f, 1));
737
738 u32 cpudv0 = __fix_zero((cpud >> 24) & 7, 8);
739
740 /* PLBDV0 is hardwared to 010. */
741 u32 plbdv0 = 2;
742 u32 plb2xdv0 = __fix_zero((plbd >> 16) & 7, 8);
743
744 u32 opbdv0 = __fix_zero((opbd >> 24) & 3, 4);
745
746 u32 perdv0 = __fix_zero((perd >> 24) & 3, 4);
747
748 /* Resulting clocks */
749 u32 cpu, plb, opb, ebc, vco, tb, uart0, uart1;
750
751 /* PLL's VCO is the source for primary forward ? */
752 if (pllc & 0x40000000) {
753 u32 m;
754
755 /* Feedback path */
756 switch ((pllc >> 24) & 7) {
757 case 0:
758 /* PLLOUTx */
759 m = fbdv;
760 break;
761 case 1:
762 /* CPU */
763 m = fbdv * fwdva * cpudv0;
764 break;
765 case 5:
766 /* PERClk */
767 m = fbdv * fwdva * plb2xdv0 * plbdv0 * opbdv0 * perdv0;
768 break;
769 default:
770 printf("WARNING ! Invalid PLL feedback source !\n");
771 goto bypass;
772 }
773
774 vco = (unsigned int)(sys_clk * m);
775 } else {
776bypass:
777 /* Bypass system PLL */
778 vco = 0;
779 }
780
781 /* CPU = VCO / ( FWDVA x CPUDV0) */
782 cpu = vco / (fwdva * cpudv0);
783 /* PLB = VCO / ( FWDVA x PLB2XDV0 x PLBDV0) */
784 plb = vco / (fwdva * plb2xdv0 * plbdv0);
785 /* OPB = PLB / OPBDV0 */
786 opb = plb / opbdv0;
787 /* EBC = OPB / PERDV0 */
788 ebc = opb / perdv0;
789
790 tb = cpu;
791 uart0 = uart1 = uart_clk;
792
793 dt_fixup_cpu_clocks(cpu, tb, 0);
794 dt_fixup_clock("/plb", plb);
795 dt_fixup_clock("/plb/opb", opb);
796 dt_fixup_clock("/plb/opb/ebc", ebc);
797 dt_fixup_clock("/plb/opb/serial@ef600200", uart0);
798 dt_fixup_clock("/plb/opb/serial@ef600300", uart1);
799}
arch/powerpc/boot/4xx.h+0−4
@@ -12,13 +12,9 @@ void ibm4xx_sdram_fixup_memsize(void); · 11 unmodified lines
12void ibm440spe_fixup_memsize(void);12void ibm440spe_fixup_memsize(void);
13void ibm4xx_denali_fixup_memsize(void);13void ibm4xx_denali_fixup_memsize(void);
14void ibm44x_dbcr_reset(void);14void ibm44x_dbcr_reset(void);
15void ibm40x_dbcr_reset(void);
16void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1);15void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1);
17void ibm4xx_fixup_ebc_ranges(const char *ebc);16void ibm4xx_fixup_ebc_ranges(const char *ebc);
18 17
19void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);
20void ibm405ep_fixup_clocks(unsigned int sys_clk);
21void ibm405ex_fixup_clocks(unsigned int sys_clk, unsigned int uart_clk);
22void ibm440gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);18void ibm440gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);
23void ibm440ep_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,19void ibm440ep_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,
24 unsigned int tmr_clk);20 unsigned int tmr_clk);
arch/powerpc/boot/Makefile+0−11
@@ -54,10 +54,8 @@ endif · 53 unmodified lines
54 54
55$(obj)/4xx.o: BOOTTARGETFLAGS += -mcpu=40555$(obj)/4xx.o: BOOTTARGETFLAGS += -mcpu=405
56$(obj)/ebony.o: BOOTTARGETFLAGS += -mcpu=44056$(obj)/ebony.o: BOOTTARGETFLAGS += -mcpu=440
57$(obj)/cuboot-hotfoot.o: BOOTTARGETFLAGS += -mcpu=405
58$(obj)/cuboot-taishan.o: BOOTTARGETFLAGS += -mcpu=44057$(obj)/cuboot-taishan.o: BOOTTARGETFLAGS += -mcpu=440
59$(obj)/cuboot-katmai.o: BOOTTARGETFLAGS += -mcpu=44058$(obj)/cuboot-katmai.o: BOOTTARGETFLAGS += -mcpu=440
60$(obj)/cuboot-acadia.o: BOOTTARGETFLAGS += -mcpu=405
61$(obj)/treeboot-iss4xx.o: BOOTTARGETFLAGS += -mcpu=40559$(obj)/treeboot-iss4xx.o: BOOTTARGETFLAGS += -mcpu=405
62$(obj)/treeboot-currituck.o: BOOTTARGETFLAGS += -mcpu=40560$(obj)/treeboot-currituck.o: BOOTTARGETFLAGS += -mcpu=405
63$(obj)/treeboot-akebono.o: BOOTTARGETFLAGS += -mcpu=40561$(obj)/treeboot-akebono.o: BOOTTARGETFLAGS += -mcpu=405
@@ -146,7 +144,6 @@ src-wlib-$(CONFIG_PPC_POWERNV) += opal-calls.S opal.c · 82 unmodified lines
146ifndef CONFIG_PPC64_BOOT_WRAPPER144ifndef CONFIG_PPC64_BOOT_WRAPPER
147src-wlib-y += crtsavres.S145src-wlib-y += crtsavres.S
148endif146endif
149src-wlib-$(CONFIG_40x) += 4xx.c planetcore.c
150src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c147src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c
151src-wlib-$(CONFIG_PPC_8xx) += mpc8xx.c planetcore.c fsl-soc.c148src-wlib-$(CONFIG_PPC_8xx) += mpc8xx.c planetcore.c fsl-soc.c
152src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c149src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c
@@ -154,9 +151,6 @@ src-wlib-$(CONFIG_EMBEDDED6xx) += ugecon.c fsl-soc.c · 1 unmodified line
154src-wlib-$(CONFIG_CPM) += cpm-serial.c151src-wlib-$(CONFIG_CPM) += cpm-serial.c
155 152
156src-plat-y := of.c epapr.c153src-plat-y := of.c epapr.c
157src-plat-$(CONFIG_40x) += fixed-head.S cuboot-hotfoot.c \
158 cuboot-acadia.c \
159 cuboot-kilauea.c simpleboot.c
160src-plat-$(CONFIG_44x) += treeboot-ebony.c cuboot-ebony.c treeboot-bamboo.c \154src-plat-$(CONFIG_44x) += treeboot-ebony.c cuboot-ebony.c treeboot-bamboo.c \
161 cuboot-bamboo.c cuboot-sam440ep.c \155 cuboot-bamboo.c cuboot-sam440ep.c \
162 cuboot-sequoia.c cuboot-rainier.c \156 cuboot-sequoia.c cuboot-rainier.c \
@@ -300,11 +294,6 @@ image-$(CONFIG_EPAPR_BOOT) += zImage.epapr · 137 unmodified lines
300# Boards with newish u-boot firmware can use the uImage target above294# Boards with newish u-boot firmware can use the uImage target above
301#295#
302 296
303# Board ports in arch/powerpc/platform/40x/Kconfig
304image-$(CONFIG_HOTFOOT) += cuImage.hotfoot
305image-$(CONFIG_ACADIA) += cuImage.acadia
306image-$(CONFIG_OBS600) += uImage.obs600
307
308# Board ports in arch/powerpc/platform/44x/Kconfig297# Board ports in arch/powerpc/platform/44x/Kconfig
309image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony298image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony
310image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo299image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo
arch/powerpc/boot/cuboot-acadia.c+0−171
@@ -1,171 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Old U-boot compatibility for Acadia
4 *
5 * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com>
6 *
7 * Copyright 2008 IBM Corporation
8 */
9
10#include "ops.h"
11#include "io.h"
12#include "dcr.h"
13#include "stdio.h"
14#include "4xx.h"
15#include "44x.h"
16#include "cuboot.h"
17
18#define TARGET_4xx
19#include "ppcboot.h"
20
21static bd_t bd;
22
23#define CPR_PERD0_SPIDV_MASK 0x000F0000 /* SPI Clock Divider */
24
25#define PLLC_SRC_MASK 0x20000000 /* PLL feedback source */
26
27#define PLLD_FBDV_MASK 0x1F000000 /* PLL feedback divider value */
28#define PLLD_FWDVA_MASK 0x000F0000 /* PLL forward divider A value */
29#define PLLD_FWDVB_MASK 0x00000700 /* PLL forward divider B value */
30
31#define PRIMAD_CPUDV_MASK 0x0F000000 /* CPU Clock Divisor Mask */
32#define PRIMAD_PLBDV_MASK 0x000F0000 /* PLB Clock Divisor Mask */
33#define PRIMAD_OPBDV_MASK 0x00000F00 /* OPB Clock Divisor Mask */
34#define PRIMAD_EBCDV_MASK 0x0000000F /* EBC Clock Divisor Mask */
35
36#define PERD0_PWMDV_MASK 0xFF000000 /* PWM Divider Mask */
37#define PERD0_SPIDV_MASK 0x000F0000 /* SPI Divider Mask */
38#define PERD0_U0DV_MASK 0x0000FF00 /* UART 0 Divider Mask */
39#define PERD0_U1DV_MASK 0x000000FF /* UART 1 Divider Mask */
40
41static void get_clocks(void)
42{
43 unsigned long sysclk, cpr_plld, cpr_pllc, cpr_primad, plloutb, i;
44 unsigned long pllFwdDiv, pllFwdDivB, pllFbkDiv, pllPlbDiv, pllExtBusDiv;
45 unsigned long pllOpbDiv, freqEBC, freqUART, freqOPB;
46 unsigned long div; /* total divisor udiv * bdiv */
47 unsigned long umin; /* minimum udiv */
48 unsigned short diff; /* smallest diff */
49 unsigned long udiv; /* best udiv */
50 unsigned short idiff; /* current diff */
51 unsigned short ibdiv; /* current bdiv */
52 unsigned long est; /* current estimate */
53 unsigned long baud;
54 void *np;
55
56 /* read the sysclk value from the CPLD */
57 sysclk = (in_8((unsigned char *)0x80000000) == 0xc) ? 66666666 : 33333000;
58
59 /*
60 * Read PLL Mode registers
61 */
62 cpr_plld = CPR0_READ(DCRN_CPR0_PLLD);
63 cpr_pllc = CPR0_READ(DCRN_CPR0_PLLC);
64
65 /*
66 * Determine forward divider A
67 */
68 pllFwdDiv = ((cpr_plld & PLLD_FWDVA_MASK) >> 16);
69
70 /*
71 * Determine forward divider B
72 */
73 pllFwdDivB = ((cpr_plld & PLLD_FWDVB_MASK) >> 8);
74 if (pllFwdDivB == 0)
75 pllFwdDivB = 8;
76
77 /*
78 * Determine FBK_DIV.
79 */
80 pllFbkDiv = ((cpr_plld & PLLD_FBDV_MASK) >> 24);
81 if (pllFbkDiv == 0)
82 pllFbkDiv = 256;
83
84 /*
85 * Read CPR_PRIMAD register
86 */
87 cpr_primad = CPR0_READ(DCRN_CPR0_PRIMAD);
88
89 /*
90 * Determine PLB_DIV.
91 */
92 pllPlbDiv = ((cpr_primad & PRIMAD_PLBDV_MASK) >> 16);
93 if (pllPlbDiv == 0)
94 pllPlbDiv = 16;
95
96 /*
97 * Determine EXTBUS_DIV.
98 */
99 pllExtBusDiv = (cpr_primad & PRIMAD_EBCDV_MASK);
100 if (pllExtBusDiv == 0)
101 pllExtBusDiv = 16;
102
103 /*
104 * Determine OPB_DIV.
105 */
106 pllOpbDiv = ((cpr_primad & PRIMAD_OPBDV_MASK) >> 8);
107 if (pllOpbDiv == 0)
108 pllOpbDiv = 16;
109
110 /* There is a bug in U-Boot that prevents us from using
111 * bd.bi_opbfreq because U-Boot doesn't populate it for
112 * 405EZ. We get to calculate it, yay!
113 */
114 freqOPB = (sysclk *pllFbkDiv) /pllOpbDiv;
115
116 freqEBC = (sysclk * pllFbkDiv) / pllExtBusDiv;
117
118 plloutb = ((sysclk * ((cpr_pllc & PLLC_SRC_MASK) ?
119 pllFwdDivB : pllFwdDiv) *
120 pllFbkDiv) / pllFwdDivB);
121
122 np = find_node_by_alias("serial0");
123 if (getprop(np, "current-speed", &baud, sizeof(baud)) != sizeof(baud))
124 fatal("no current-speed property\n\r");
125
126 udiv = 256; /* Assume lowest possible serial clk */
127 div = plloutb / (16 * baud); /* total divisor */
128 umin = (plloutb / freqOPB) << 1; /* 2 x OPB divisor */
129 diff = 256; /* highest possible */
130
131 /* i is the test udiv value -- start with the largest
132 * possible (256) to minimize serial clock and constrain
133 * search to umin.
134 */
135 for (i = 256; i > umin; i--) {
136 ibdiv = div / i;
137 est = i * ibdiv;
138 idiff = (est > div) ? (est-div) : (div-est);
139 if (idiff == 0) {
140 udiv = i;
141 break; /* can't do better */
142 } else if (idiff < diff) {
143 udiv = i; /* best so far */
144 diff = idiff; /* update lowest diff*/
145 }
146 }
147 freqUART = plloutb / udiv;
148
149 dt_fixup_cpu_clocks(bd.bi_procfreq, bd.bi_intfreq, bd.bi_plb_busfreq);
150 dt_fixup_clock("/plb/ebc", freqEBC);
151 dt_fixup_clock("/plb/opb", freqOPB);
152 dt_fixup_clock("/plb/opb/serial@ef600300", freqUART);
153 dt_fixup_clock("/plb/opb/serial@ef600400", freqUART);
154}
155
156static void acadia_fixups(void)
157{
158 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
159 get_clocks();
160 dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
161}
162
163void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
164 unsigned long r6, unsigned long r7)
165{
166 CUBOOT_INIT();
167 platform_ops.fixups = acadia_fixups;
168 platform_ops.exit = ibm40x_dbcr_reset;
169 fdt_init(_dtb_start);
170 serial_console_init();
171}
arch/powerpc/boot/cuboot-hotfoot.c+0−139
@@ -1,139 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Old U-boot compatibility for Esteem 195E Hotfoot CPU Board
4 *
5 * Author: Solomon Peachy <solomon@linux-wlan.com>
6 */
7
8#include "ops.h"
9#include "stdio.h"
10#include "reg.h"
11#include "dcr.h"
12#include "4xx.h"
13#include "cuboot.h"
14
15#define TARGET_4xx
16#define TARGET_HOTFOOT
17
18#include "ppcboot-hotfoot.h"
19
20static bd_t bd;
21
22#define NUM_REGS 3
23
24static void hotfoot_fixups(void)
25{
26 u32 uart = mfdcr(DCRN_CPC0_UCR) & 0x7f;
27
28 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
29
30 dt_fixup_cpu_clocks(bd.bi_procfreq, bd.bi_procfreq, 0);
31 dt_fixup_clock("/plb", bd.bi_plb_busfreq);
32 dt_fixup_clock("/plb/opb", bd.bi_opbfreq);
33 dt_fixup_clock("/plb/ebc", bd.bi_pci_busfreq);
34 dt_fixup_clock("/plb/opb/serial@ef600300", bd.bi_procfreq / uart);
35 dt_fixup_clock("/plb/opb/serial@ef600400", bd.bi_procfreq / uart);
36
37 dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
38 dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
39
40 /* Is this a single eth/serial board? */
41 if ((bd.bi_enet1addr[0] == 0) &&
42 (bd.bi_enet1addr[1] == 0) &&
43 (bd.bi_enet1addr[2] == 0) &&
44 (bd.bi_enet1addr[3] == 0) &&
45 (bd.bi_enet1addr[4] == 0) &&
46 (bd.bi_enet1addr[5] == 0)) {
47 void *devp;
48
49 printf("Trimming devtree for single serial/eth board\n");
50
51 devp = finddevice("/plb/opb/serial@ef600300");
52 if (!devp)
53 fatal("Can't find node for /plb/opb/serial@ef600300");
54 del_node(devp);
55
56 devp = finddevice("/plb/opb/ethernet@ef600900");
57 if (!devp)
58 fatal("Can't find node for /plb/opb/ethernet@ef600900");
59 del_node(devp);
60 }
61
62 ibm4xx_quiesce_eth((u32 *)0xef600800, (u32 *)0xef600900);
63
64 /* Fix up flash size in fdt for 4M boards. */
65 if (bd.bi_flashsize < 0x800000) {
66 u32 regs[NUM_REGS];
67 void *devp = finddevice("/plb/ebc/nor_flash@0");
68 if (!devp)
69 fatal("Can't find FDT node for nor_flash!??");
70
71 printf("Fixing devtree for 4M Flash\n");
72
73 /* First fix up the base address */
74 getprop(devp, "reg", regs, sizeof(regs));
75 regs[0] = 0;
76 regs[1] = 0xffc00000;
77 regs[2] = 0x00400000;
78 setprop(devp, "reg", regs, sizeof(regs));
79
80 /* Then the offsets */
81 devp = finddevice("/plb/ebc/nor_flash@0/partition@0");
82 if (!devp)
83 fatal("Can't find FDT node for partition@0");
84 getprop(devp, "reg", regs, 2*sizeof(u32));
85 regs[0] -= 0x400000;
86 setprop(devp, "reg", regs, 2*sizeof(u32));
87
88 devp = finddevice("/plb/ebc/nor_flash@0/partition@1");
89 if (!devp)
90 fatal("Can't find FDT node for partition@1");
91 getprop(devp, "reg", regs, 2*sizeof(u32));
92 regs[0] -= 0x400000;
93 setprop(devp, "reg", regs, 2*sizeof(u32));
94
95 devp = finddevice("/plb/ebc/nor_flash@0/partition@2");
96 if (!devp)
97 fatal("Can't find FDT node for partition@2");
98 getprop(devp, "reg", regs, 2*sizeof(u32));
99 regs[0] -= 0x400000;
100 setprop(devp, "reg", regs, 2*sizeof(u32));
101
102 devp = finddevice("/plb/ebc/nor_flash@0/partition@3");
103 if (!devp)
104 fatal("Can't find FDT node for partition@3");
105 getprop(devp, "reg", regs, 2*sizeof(u32));
106 regs[0] -= 0x400000;
107 setprop(devp, "reg", regs, 2*sizeof(u32));
108
109 devp = finddevice("/plb/ebc/nor_flash@0/partition@4");
110 if (!devp)
111 fatal("Can't find FDT node for partition@4");
112 getprop(devp, "reg", regs, 2*sizeof(u32));
113 regs[0] -= 0x400000;
114 setprop(devp, "reg", regs, 2*sizeof(u32));
115
116 devp = finddevice("/plb/ebc/nor_flash@0/partition@6");
117 if (!devp)
118 fatal("Can't find FDT node for partition@6");
119 getprop(devp, "reg", regs, 2*sizeof(u32));
120 regs[0] -= 0x400000;
121 setprop(devp, "reg", regs, 2*sizeof(u32));
122
123 /* Delete the FeatFS node */
124 devp = finddevice("/plb/ebc/nor_flash@0/partition@5");
125 if (!devp)
126 fatal("Can't find FDT node for partition@5");
127 del_node(devp);
128 }
129}
130
131void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
132 unsigned long r6, unsigned long r7)
133{
134 CUBOOT_INIT();
135 platform_ops.fixups = hotfoot_fixups;
136 platform_ops.exit = ibm40x_dbcr_reset;
137 fdt_init(_dtb_start);
138 serial_console_init();
139}
arch/powerpc/boot/cuboot-kilauea.c+0−46
@@ -1,46 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Old U-boot compatibility for PPC405EX. This image is already included
4 * a dtb.
5 *
6 * Author: Tiejun Chen <tiejun.chen@windriver.com>
7 *
8 * Copyright (C) 2009 Wind River Systems, Inc.
9 */
10
11#include "ops.h"
12#include "io.h"
13#include "dcr.h"
14#include "stdio.h"
15#include "4xx.h"
16#include "44x.h"
17#include "cuboot.h"
18
19#define TARGET_4xx
20#define TARGET_44x
21#include "ppcboot.h"
22
23#define KILAUEA_SYS_EXT_SERIAL_CLOCK 11059200 /* ext. 11.059MHz clk */
24
25static bd_t bd;
26
27static void kilauea_fixups(void)
28{
29 unsigned long sysclk = 33333333;
30
31 ibm405ex_fixup_clocks(sysclk, KILAUEA_SYS_EXT_SERIAL_CLOCK);
32 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
33 ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
34 dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
35 dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
36}
37
38void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
39 unsigned long r6, unsigned long r7)
40{
41 CUBOOT_INIT();
42 platform_ops.fixups = kilauea_fixups;
43 platform_ops.exit = ibm40x_dbcr_reset;
44 fdt_init(_dtb_start);
45 serial_console_init();
46}
arch/powerpc/boot/dcr.h+0−11
@@ -153,17 +153,6 @@ static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR, · 152 unmodified lines
153#define CPR0_SCPID 0x120153#define CPR0_SCPID 0x120
154#define CPR0_PLLC0 0x40154#define CPR0_PLLC0 0x40
155 155
156/* 405GP Clocking/Power Management/Chip Control regs */
157#define DCRN_CPC0_PLLMR 0xb0
158#define DCRN_405_CPC0_CR0 0xb1
159#define DCRN_405_CPC0_CR1 0xb2
160#define DCRN_405_CPC0_PSR 0xb4
161
162/* 405EP Clocking/Power Management/Chip Control regs */
163#define DCRN_CPC0_PLLMR0 0xf0
164#define DCRN_CPC0_PLLMR1 0xf4
165#define DCRN_CPC0_UCR 0xf5
166
167/* 440GX/405EX Clock Control reg */156/* 440GX/405EX Clock Control reg */
168#define DCRN_CPR0_CLKUPD 0x020157#define DCRN_CPR0_CLKUPD 0x020
169#define DCRN_CPR0_PLLC 0x040158#define DCRN_CPR0_PLLC 0x040
arch/powerpc/boot/dts/acadia.dts+0−224
@@ -1,224 +0,0 @@
1/*
2 * Device Tree Source for AMCC Acadia (405EZ)
3 *
4 * Copyright IBM Corp. 2008
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11/dts-v1/;
12
13/ {
14 #address-cells = <1>;
15 #size-cells = <1>;
16 model = "amcc,acadia";
17 compatible = "amcc,acadia";
18 dcr-parent = <&{/cpus/cpu@0}>;
19
20 aliases {
21 ethernet0 = &EMAC0;
22 serial0 = &UART0;
23 serial1 = &UART1;
24 };
25
26 cpus {
27 #address-cells = <1>;
28 #size-cells = <0>;
29
30 cpu@0 {
31 device_type = "cpu";
32 model = "PowerPC,405EZ";
33 reg = <0x0>;
34 clock-frequency = <0>; /* Filled in by wrapper */
35 timebase-frequency = <0>; /* Filled in by wrapper */
36 i-cache-line-size = <32>;
37 d-cache-line-size = <32>;
38 i-cache-size = <16384>;
39 d-cache-size = <16384>;
40 dcr-controller;
41 dcr-access-method = "native";
42 };
43 };
44
45 memory {
46 device_type = "memory";
47 reg = <0x0 0x0>; /* Filled in by wrapper */
48 };
49
50 UIC0: interrupt-controller {
51 compatible = "ibm,uic-405ez", "ibm,uic";
52 interrupt-controller;
53 dcr-reg = <0x0c0 0x009>;
54 cell-index = <0>;
55 #address-cells = <0>;
56 #size-cells = <0>;
57 #interrupt-cells = <2>;
58 };
59
60 plb {
61 compatible = "ibm,plb-405ez", "ibm,plb3";
62 #address-cells = <1>;
63 #size-cells = <1>;
64 ranges;
65 clock-frequency = <0>; /* Filled in by wrapper */
66
67 MAL0: mcmal {
68 compatible = "ibm,mcmal-405ez", "ibm,mcmal";
69 dcr-reg = <0x380 0x62>;
70 num-tx-chans = <1>;
71 num-rx-chans = <1>;
72 interrupt-parent = <&UIC0>;
73 /* 405EZ has only 3 interrupts to the UIC, as
74 * SERR, TXDE, and RXDE are or'd together into
75 * one UIC bit
76 */
77 interrupts = <
78 0x13 0x4 /* TXEOB */
79 0x15 0x4 /* RXEOB */
80 0x12 0x4 /* SERR, TXDE, RXDE */>;
81 };
82
83 POB0: opb {
84 compatible = "ibm,opb-405ez", "ibm,opb";
85 #address-cells = <1>;
86 #size-cells = <1>;
87 ranges;
88 dcr-reg = <0x0a 0x05>;
89 clock-frequency = <0>; /* Filled in by wrapper */
90
91 UART0: serial@ef600300 {
92 device_type = "serial";
93 compatible = "ns16550";
94 reg = <0xef600300 0x8>;
95 virtual-reg = <0xef600300>;
96 clock-frequency = <0>; /* Filled in by wrapper */
97 current-speed = <115200>;
98 interrupt-parent = <&UIC0>;
99 interrupts = <0x5 0x4>;
100 };
101
102 UART1: serial@ef600400 {
103 device_type = "serial";
104 compatible = "ns16550";
105 reg = <0xef600400 0x8>;
106 clock-frequency = <0>; /* Filled in by wrapper */
107 current-speed = <115200>;
108 interrupt-parent = <&UIC0>;
109 interrupts = <0x6 0x4>;
110 };
111
112 IIC: i2c@ef600500 {
113 compatible = "ibm,iic-405ez", "ibm,iic";
114 reg = <0xef600500 0x11>;
115 interrupt-parent = <&UIC0>;
116 interrupts = <0xa 0x4>;
117 };
118
119 GPIO0: gpio@ef600700 {
120 compatible = "ibm,gpio-405ez";
121 reg = <0xef600700 0x20>;
122 };
123
124 GPIO1: gpio@ef600800 {
125 compatible = "ibm,gpio-405ez";
126 reg = <0xef600800 0x20>;
127 };
128
129 EMAC0: ethernet@ef600900 {
130 device_type = "network";
131 compatible = "ibm,emac-405ez", "ibm,emac";
132 interrupt-parent = <&UIC0>;
133 interrupts = <
134 0x10 0x4 /* Ethernet */
135 0x11 0x4 /* Ethernet Wake up */>;
136 local-mac-address = [000000000000]; /* Filled in by wrapper */
137 reg = <0xef600900 0x70>;
138 mal-device = <&MAL0>;
139 mal-tx-channel = <0>;
140 mal-rx-channel = <0>;
141 cell-index = <0>;
142 max-frame-size = <1500>;
143 rx-fifo-size = <4096>;
144 tx-fifo-size = <2048>;
145 phy-mode = "mii";
146 phy-map = <0x0>;
147 };
148
149 CAN0: can@ef601000 {
150 compatible = "amcc,can-405ez";
151 reg = <0xef601000 0x620>;
152 interrupt-parent = <&UIC0>;
153 interrupts = <0x7 0x4>;
154 };
155
156 CAN1: can@ef601800 {
157 compatible = "amcc,can-405ez";
158 reg = <0xef601800 0x620>;
159 interrupt-parent = <&UIC0>;
160 interrupts = <0x8 0x4>;
161 };
162
163 cameleon@ef602000 {
164 compatible = "amcc,cameleon-405ez";
165 reg = <0xef602000 0x800>;
166 interrupt-parent = <&UIC0>;
167 interrupts = <0xb 0x4 0xc 0x4>;
168 };
169
170 ieee1588@ef602800 {
171 compatible = "amcc,ieee1588-405ez";
172 reg = <0xef602800 0x60>;
173 interrupt-parent = <&UIC0>;
174 interrupts = <0x4 0x4>;
175 /* This thing is a bit weird. It has its own UIC
176 * that it uses to generate snapshot triggers. We
177 * don't really support this device yet, and it needs
178 * work to figure this out.
179 */
180 dcr-reg = <0xe0 0x9>;
181 };
182
183 usb@ef603000 {
184 compatible = "ohci-be";
185 reg = <0xef603000 0x80>;
186 interrupt-parent = <&UIC0>;
187 interrupts = <0xd 0x4 0xe 0x4>;
188 };
189
190 dac@ef603300 {
191 compatible = "amcc,dac-405ez";
192 reg = <0xef603300 0x40>;
193 interrupt-parent = <&UIC0>;
194 interrupts = <0x18 0x4>;
195 };
196
197 adc@ef603400 {
198 compatible = "amcc,adc-405ez";
199 reg = <0xef603400 0x40>;
200 interrupt-parent = <&UIC0>;
201 interrupts = <0x17 0x4>;
202 };
203
204 spi@ef603500 {
205 compatible = "amcc,spi-405ez";
206 reg = <0xef603500 0x100>;
207 interrupt-parent = <&UIC0>;
208 interrupts = <0x9 0x4>;
209 };
210 };
211
212 EBC0: ebc {
213 compatible = "ibm,ebc-405ez", "ibm,ebc";
214 dcr-reg = <0x12 0x2>;
215 #address-cells = <2>;
216 #size-cells = <1>;
217 clock-frequency = <0>; /* Filled in by wrapper */
218 };
219 };
220
221 chosen {
222 stdout-path = "/plb/opb/serial@ef600300";
223 };
224};
arch/powerpc/boot/dts/haleakala.dts+0−281
@@ -1,281 +0,0 @@
1/*
2 * Device Tree Source for AMCC Haleakala (405EXr)
3 *
4 * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without
8 * any warranty of any kind, whether express or implied.
9 */
10
11/dts-v1/;
12
13/ {
14 #address-cells = <1>;
15 #size-cells = <1>;
16 model = "amcc,haleakala";
17 compatible = "amcc,haleakala", "amcc,kilauea";
18 dcr-parent = <&{/cpus/cpu@0}>;
19
20 aliases {
21 ethernet0 = &EMAC0;
22 serial0 = &UART0;
23 serial1 = &UART1;
24 };
25
26 cpus {
27 #address-cells = <1>;
28 #size-cells = <0>;
29
30 cpu@0 {
31 device_type = "cpu";
32 model = "PowerPC,405EXr";
33 reg = <0x00000000>;
34 clock-frequency = <0>; /* Filled in by U-Boot */
35 timebase-frequency = <0>; /* Filled in by U-Boot */
36 i-cache-line-size = <32>;
37 d-cache-line-size = <32>;
38 i-cache-size = <16384>; /* 16 kB */
39 d-cache-size = <16384>; /* 16 kB */
40 dcr-controller;
41 dcr-access-method = "native";
42 };
43 };
44
45 memory {
46 device_type = "memory";
47 reg = <0x00000000 0x00000000>; /* Filled in by U-Boot */
48 };
49
50 UIC0: interrupt-controller {
51 compatible = "ibm,uic-405exr", "ibm,uic";
52 interrupt-controller;
53 cell-index = <0>;
54 dcr-reg = <0x0c0 0x009>;
55 #address-cells = <0>;
56 #size-cells = <0>;
57 #interrupt-cells = <2>;
58 };
59
60 UIC1: interrupt-controller1 {
61 compatible = "ibm,uic-405exr","ibm,uic";
62 interrupt-controller;
63 cell-index = <1>;
64 dcr-reg = <0x0d0 0x009>;
65 #address-cells = <0>;
66 #size-cells = <0>;
67 #interrupt-cells = <2>;
68 interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
69 interrupt-parent = <&UIC0>;
70 };
71
72 UIC2: interrupt-controller2 {
73 compatible = "ibm,uic-405exr","ibm,uic";
74 interrupt-controller;
75 cell-index = <2>;
76 dcr-reg = <0x0e0 0x009>;
77 #address-cells = <0>;
78 #size-cells = <0>;
79 #interrupt-cells = <2>;
80 interrupts = <0x1c 0x4 0x1d 0x4>; /* cascade */
81 interrupt-parent = <&UIC0>;
82 };
83
84 plb {
85 compatible = "ibm,plb-405exr", "ibm,plb4";
86 #address-cells = <1>;
87 #size-cells = <1>;
88 ranges;
89 clock-frequency = <0>; /* Filled in by U-Boot */
90
91 SDRAM0: memory-controller {
92 compatible = "ibm,sdram-405exr", "ibm,sdram-4xx-ddr2";
93 dcr-reg = <0x010 0x002>;
94 interrupt-parent = <&UIC2>;
95 interrupts = <0x5 0x4 /* ECC DED Error */
96 0x6 0x4>; /* ECC SEC Error */
97 };
98
99 MAL0: mcmal {
100 compatible = "ibm,mcmal-405exr", "ibm,mcmal2";
101 dcr-reg = <0x180 0x062>;
102 num-tx-chans = <2>;
103 num-rx-chans = <2>;
104 interrupt-parent = <&MAL0>;
105 interrupts = <0x0 0x1 0x2 0x3 0x4>;
106 #interrupt-cells = <1>;
107 #address-cells = <0>;
108 #size-cells = <0>;
109 interrupt-map = </*TXEOB*/ 0x0 &UIC0 0xa 0x4
110 /*RXEOB*/ 0x1 &UIC0 0xb 0x4
111 /*SERR*/ 0x2 &UIC1 0x0 0x4
112 /*TXDE*/ 0x3 &UIC1 0x1 0x4
113 /*RXDE*/ 0x4 &UIC1 0x2 0x4>;
114 interrupt-map-mask = <0xffffffff>;
115 };
116
117 POB0: opb {
118 compatible = "ibm,opb-405exr", "ibm,opb";
119 #address-cells = <1>;
120 #size-cells = <1>;
121 ranges = <0x80000000 0x80000000 0x10000000
122 0xef600000 0xef600000 0x00a00000
123 0xf0000000 0xf0000000 0x10000000>;
124 dcr-reg = <0x0a0 0x005>;
125 clock-frequency = <0>; /* Filled in by U-Boot */
126
127 EBC0: ebc {
128 compatible = "ibm,ebc-405exr", "ibm,ebc";
129 dcr-reg = <0x012 0x002>;
130 #address-cells = <2>;
131 #size-cells = <1>;
132 clock-frequency = <0>; /* Filled in by U-Boot */
133 /* ranges property is supplied by U-Boot */
134 interrupts = <0x5 0x1>;
135 interrupt-parent = <&UIC1>;
136
137 nor_flash@0,0 {
138 compatible = "amd,s29gl512n", "cfi-flash";
139 bank-width = <2>;
140 reg = <0x00000000 0x00000000 0x04000000>;
141 #address-cells = <1>;
142 #size-cells = <1>;
143 partition@0 {
144 label = "kernel";
145 reg = <0x00000000 0x00200000>;
146 };
147 partition@200000 {
148 label = "root";
149 reg = <0x00200000 0x00200000>;
150 };
151 partition@400000 {
152 label = "user";
153 reg = <0x00400000 0x03b60000>;
154 };
155 partition@3f60000 {
156 label = "env";
157 reg = <0x03f60000 0x00040000>;
158 };
159 partition@3fa0000 {
160 label = "u-boot";
161 reg = <0x03fa0000 0x00060000>;
162 };
163 };
164 };
165
166 UART0: serial@ef600200 {
167 device_type = "serial";
168 compatible = "ns16550";
169 reg = <0xef600200 0x00000008>;
170 virtual-reg = <0xef600200>;
171 clock-frequency = <0>; /* Filled in by U-Boot */
172 current-speed = <0>;
173 interrupt-parent = <&UIC0>;
174 interrupts = <0x1a 0x4>;
175 };
176
177 UART1: serial@ef600300 {
178 device_type = "serial";
179 compatible = "ns16550";
180 reg = <0xef600300 0x00000008>;
181 virtual-reg = <0xef600300>;
182 clock-frequency = <0>; /* Filled in by U-Boot */
183 current-speed = <0>;
184 interrupt-parent = <&UIC0>;
185 interrupts = <0x1 0x4>;
186 };
187
188 IIC0: i2c@ef600400 {
189 compatible = "ibm,iic-405exr", "ibm,iic";
190 reg = <0xef600400 0x00000014>;
191 interrupt-parent = <&UIC0>;
192 interrupts = <0x2 0x4>;
193 };
194
195 IIC1: i2c@ef600500 {
196 compatible = "ibm,iic-405exr", "ibm,iic";
197 reg = <0xef600500 0x00000014>;
198 interrupt-parent = <&UIC0>;
199 interrupts = <0x7 0x4>;
200 };
201
202
203 RGMII0: emac-rgmii@ef600b00 {
204 compatible = "ibm,rgmii-405exr", "ibm,rgmii";
205 reg = <0xef600b00 0x00000104>;
206 has-mdio;
207 };
208
209 EMAC0: ethernet@ef600900 {
210 linux,network-index = <0x0>;
211 device_type = "network";
212 compatible = "ibm,emac-405exr", "ibm,emac4sync";
213 interrupt-parent = <&EMAC0>;
214 interrupts = <0x0 0x1>;
215 #interrupt-cells = <1>;
216 #address-cells = <0>;
217 #size-cells = <0>;
218 interrupt-map = </*Status*/ 0x0 &UIC0 0x18 0x4
219 /*Wake*/ 0x1 &UIC1 0x1d 0x4>;
220 reg = <0xef600900 0x000000c4>;
221 local-mac-address = [000000000000]; /* Filled in by U-Boot */
222 mal-device = <&MAL0>;
223 mal-tx-channel = <0>;
224 mal-rx-channel = <0>;
225 cell-index = <0>;
226 max-frame-size = <9000>;
227 rx-fifo-size = <4096>;
228 tx-fifo-size = <2048>;
229 rx-fifo-size-gige = <16384>;
230 tx-fifo-size-gige = <16384>;
231 phy-mode = "rgmii";
232 phy-map = <0x00000000>;
233 rgmii-device = <&RGMII0>;
234 rgmii-channel = <0>;
235 has-inverted-stacr-oc;
236 has-new-stacr-staopc;
237 };
238 };
239
240 PCIE0: pcie@a0000000 {
241 device_type = "pci";
242 #interrupt-cells = <1>;
243 #size-cells = <2>;
244 #address-cells = <3>;
245 compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
246 primary;
247 port = <0x0>; /* port number */
248 reg = <0xa0000000 0x20000000 /* Config space access */
249 0xef000000 0x00001000>; /* Registers */
250 dcr-reg = <0x040 0x020>;
251 sdr-base = <0x400>;
252
253 /* Outbound ranges, one memory and one IO,
254 * later cannot be changed
255 */
256 ranges = <0x02000000 0x00000000 0x80000000 0x90000000 0x00000000 0x08000000
257 0x01000000 0x00000000 0x00000000 0xe0000000 0x00000000 0x00010000>;
258
259 /* Inbound 2GB range starting at 0 */
260 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>;
261
262 /* This drives busses 0x00 to 0x3f */
263 bus-range = <0x0 0x3f>;
264
265 /* Legacy interrupts (note the weird polarity, the bridge seems
266 * to invert PCIe legacy interrupts).
267 * We are de-swizzling here because the numbers are actually for
268 * port of the root complex virtual P2P bridge. But I want
269 * to avoid putting a node for it in the tree, so the numbers
270 * below are basically de-swizzled numbers.
271 * The real slot is on idsel 0, so the swizzling is 1:1
272 */
273 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
274 interrupt-map = <
275 0x0 0x0 0x0 0x1 &UIC2 0x0 0x4 /* swizzled int A */
276 0x0 0x0 0x0 0x2 &UIC2 0x1 0x4 /* swizzled int B */
277 0x0 0x0 0x0 0x3 &UIC2 0x2 0x4 /* swizzled int C */
278 0x0 0x0 0x0 0x4 &UIC2 0x3 0x4 /* swizzled int D */>;
279 };
280 };
281};
arch/powerpc/boot/dts/hotfoot.dts+0−296
@@ -1,296 +0,0 @@
1/*
2 * Device Tree Source for ESTeem 195E Hotfoot
3 *
4 * Copyright 2009 AbsoluteValue Systems <solomon@linux-wlan.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without
8 * any warranty of any kind, whether express or implied.
9 */
10
11/dts-v1/;
12
13/ {
14 #address-cells = <1>;
15 #size-cells = <1>;
16 model = "est,hotfoot";
17 compatible = "est,hotfoot";
18 dcr-parent = <&{/cpus/cpu@0}>;
19
20 aliases {
21 ethernet0 = &EMAC0;
22 ethernet1 = &EMAC1;
23 serial0 = &UART0;
24 serial1 = &UART1;
25 };
26
27 cpus {
28 #address-cells = <1>;
29 #size-cells = <0>;
30
31 cpu@0 {
32 device_type = "cpu";
33 model = "PowerPC,405EP";
34 reg = <0x00000000>;
35 clock-frequency = <0>; /* Filled in by zImage */
36 timebase-frequency = <0>; /* Filled in by zImage */
37 i-cache-line-size = <0x20>;
38 d-cache-line-size = <0x20>;
39 i-cache-size = <0x4000>;
40 d-cache-size = <0x4000>;
41 dcr-controller;
42 dcr-access-method = "native";
43 };
44 };
45
46 memory {
47 device_type = "memory";
48 reg = <0x00000000 0x00000000>; /* Filled in by zImage */
49 };
50
51 UIC0: interrupt-controller {
52 compatible = "ibm,uic";
53 interrupt-controller;
54 cell-index = <0>;
55 dcr-reg = <0x0c0 0x009>;
56 #address-cells = <0>;
57 #size-cells = <0>;
58 #interrupt-cells = <2>;
59 };
60
61 plb {
62 compatible = "ibm,plb3";
63 #address-cells = <1>;
64 #size-cells = <1>;
65 ranges;
66 clock-frequency = <0>; /* Filled in by zImage */
67
68 SDRAM0: memory-controller {
69 compatible = "ibm,sdram-405ep";
70 dcr-reg = <0x010 0x002>;
71 };
72
73 MAL: mcmal {
74 compatible = "ibm,mcmal-405ep", "ibm,mcmal";
75 dcr-reg = <0x180 0x062>;
76 num-tx-chans = <4>;
77 num-rx-chans = <2>;
78 interrupt-parent = <&UIC0>;
79 interrupts = <
80 0xb 0x4 /* TXEOB */
81 0xc 0x4 /* RXEOB */
82 0xa 0x4 /* SERR */
83 0xd 0x4 /* TXDE */
84 0xe 0x4 /* RXDE */>;
85 };
86
87 POB0: opb {
88 compatible = "ibm,opb-405ep", "ibm,opb";
89 #address-cells = <1>;
90 #size-cells = <1>;
91 ranges = <0xef600000 0xef600000 0x00a00000>;
92 dcr-reg = <0x0a0 0x005>;
93 clock-frequency = <0>; /* Filled in by zImage */
94
95 /* Hotfoot has UART0/UART1 swapped */
96
97 UART0: serial@ef600400 {
98 device_type = "serial";
99 compatible = "ns16550";
100 reg = <0xef600400 0x00000008>;
101 virtual-reg = <0xef600400>;
102 clock-frequency = <0>; /* Filled in by zImage */
103 current-speed = <0x9600>;
104 interrupt-parent = <&UIC0>;
105 interrupts = <0x1 0x4>;
106 };
107
108 UART1: serial@ef600300 {
109 device_type = "serial";
110 compatible = "ns16550";
111 reg = <0xef600300 0x00000008>;
112 virtual-reg = <0xef600300>;
113 clock-frequency = <0>; /* Filled in by zImage */
114 current-speed = <0x9600>;
115 interrupt-parent = <&UIC0>;
116 interrupts = <0x0 0x4>;
117 };
118
119 IIC: i2c@ef600500 {
120 #address-cells = <1>;
121 #size-cells = <0>;
122 compatible = "ibm,iic-405ep", "ibm,iic";
123 reg = <0xef600500 0x00000011>;
124 interrupt-parent = <&UIC0>;
125 interrupts = <0x2 0x4>;
126
127 rtc@68 {
128 /* Actually a DS1339 */
129 compatible = "dallas,ds1307";
130 reg = <0x68>;
131 };
132
133 temp@4a {
134 /* Not present on all boards */
135 compatible = "national,lm75";
136 reg = <0x4a>;
137 };
138 };
139
140 GPIO: gpio@ef600700 {
141 #gpio-cells = <2>;
142 compatible = "ibm,ppc4xx-gpio";
143 reg = <0xef600700 0x00000020>;
144 gpio-controller;
145 };
146
147 gpio-leds {
148 compatible = "gpio-leds";
149 status {
150 label = "Status";
151 gpios = <&GPIO 1 0>;
152 };
153 radiorx {
154 label = "Rx";
155 gpios = <&GPIO 0xe 0>;
156 };
157 };
158
159 EMAC0: ethernet@ef600800 {
160 linux,network-index = <0x0>;
161 device_type = "network";
162 compatible = "ibm,emac-405ep", "ibm,emac";
163 interrupt-parent = <&UIC0>;
164 interrupts = <
165 0xf 0x4 /* Ethernet */
166 0x9 0x4 /* Ethernet Wake Up */>;
167 local-mac-address = [000000000000]; /* Filled in by zImage */
168 reg = <0xef600800 0x00000070>;
169 mal-device = <&MAL>;
170 mal-tx-channel = <0>;
171 mal-rx-channel = <0>;
172 cell-index = <0>;
173 max-frame-size = <0x5dc>;
174 rx-fifo-size = <0x1000>;
175 tx-fifo-size = <0x800>;
176 phy-mode = "mii";
177 phy-map = <0x00000000>;
178 };
179
180 EMAC1: ethernet@ef600900 {
181 linux,network-index = <0x1>;
182 device_type = "network";
183 compatible = "ibm,emac-405ep", "ibm,emac";
184 interrupt-parent = <&UIC0>;
185 interrupts = <
186 0x11 0x4 /* Ethernet */
187 0x9 0x4 /* Ethernet Wake Up */>;
188 local-mac-address = [000000000000]; /* Filled in by zImage */
189 reg = <0xef600900 0x00000070>;
190 mal-device = <&MAL>;
191 mal-tx-channel = <2>;
192 mal-rx-channel = <1>;
193 cell-index = <1>;
194 max-frame-size = <0x5dc>;
195 rx-fifo-size = <0x1000>;
196 tx-fifo-size = <0x800>;
197 mdio-device = <&EMAC0>;
198 phy-mode = "mii";
199 phy-map = <0x0000001>;
200 };
201 };
202
203 EBC0: ebc {
204 compatible = "ibm,ebc-405ep", "ibm,ebc";
205 dcr-reg = <0x012 0x002>;
206 #address-cells = <2>;
207 #size-cells = <1>;
208
209 /* The ranges property is supplied by the bootwrapper
210 * and is based on the firmware's configuration of the
211 * EBC bridge
212 */
213 clock-frequency = <0>; /* Filled in by zImage */
214
215 nor_flash@0 {
216 compatible = "cfi-flash";
217 bank-width = <2>;
218 reg = <0x0 0xff800000 0x00800000>;
219 #address-cells = <1>;
220 #size-cells = <1>;
221
222 /* This mapping is for the 8M flash
223 4M flash has all ofssets -= 4M,
224 and FeatFS partition is not present */
225 partition@0 {
226 label = "Bootloader";
227 reg = <0x7c0000 0x40000>;
228 /* read-only; */
229 };
230 partition@1 {
231 label = "Env_and_Config_Primary";
232 reg = <0x400000 0x10000>;
233 };
234 partition@2 {
235 label = "Kernel";
236 reg = <0x420000 0x100000>;
237 };
238 partition@3 {
239 label = "Filesystem";
240 reg = <0x520000 0x2a0000>;
241 };
242 partition@4 {
243 label = "Env_and_Config_Secondary";
244 reg = <0x410000 0x10000>;
245 };
246 partition@5 {
247 label = "FeatFS";
248 reg = <0x000000 0x400000>;
249 };
250 partition@6 {
251 label = "Bootloader_Env";
252 reg = <0x7d0000 0x10000>;
253 };
254 };
255 };
256
257 PCI0: pci@ec000000 {
258 device_type = "pci";
259 #interrupt-cells = <1>;
260 #size-cells = <2>;
261 #address-cells = <3>;
262 compatible = "ibm,plb405ep-pci", "ibm,plb-pci";
263 primary;
264 reg = <0xeec00000 0x00000008 /* Config space access */
265 0xeed80000 0x00000004 /* IACK */
266 0xeed80000 0x00000004 /* Special cycle */
267 0xef480000 0x00000040>; /* Internal registers */
268
269 /* Outbound ranges, one memory and one IO,
270 * later cannot be changed. Chip supports a second
271 * IO range but we don't use it for now
272 */
273 ranges = <0x02000000 0x00000000 0x80000000 0x80000000 0x00000000 0x20000000
274 0x01000000 0x00000000 0x00000000 0xe8000000 0x00000000 0x00010000>;
275
276 /* Inbound 2GB range starting at 0 */
277 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>;
278
279 interrupt-parent = <&UIC0>;
280 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
281 interrupt-map = <
282 /* IDSEL 3 -- slot1 (optional) 27/29 A/B IRQ2/4 */
283 0x1800 0x0 0x0 0x1 &UIC0 0x1b 0x8
284 0x1800 0x0 0x0 0x2 &UIC0 0x1d 0x8
285
286 /* IDSEL 4 -- slot0, 26/28 A/B IRQ1/3 */
287 0x2000 0x0 0x0 0x1 &UIC0 0x1a 0x8
288 0x2000 0x0 0x0 0x2 &UIC0 0x1c 0x8
289 >;
290 };
291 };
292
293 chosen {
294 stdout-path = &UART0;
295 };
296};
arch/powerpc/boot/dts/kilauea.dts+0−407
@@ -1,407 +0,0 @@
1/*
2 * Device Tree Source for AMCC Kilauea (405EX)
3 *
4 * Copyright 2007-2009 DENX Software Engineering, Stefan Roese <sr@denx.de>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without
8 * any warranty of any kind, whether express or implied.
9 */
10
11/dts-v1/;
12
13/ {
14 #address-cells = <1>;
15 #size-cells = <1>;
16 model = "amcc,kilauea";
17 compatible = "amcc,kilauea";
18 dcr-parent = <&{/cpus/cpu@0}>;
19
20 aliases {
21 ethernet0 = &EMAC0;
22 ethernet1 = &EMAC1;
23 serial0 = &UART0;
24 serial1 = &UART1;
25 };
26
27 cpus {
28 #address-cells = <1>;
29 #size-cells = <0>;
30
31 cpu@0 {
32 device_type = "cpu";
33 model = "PowerPC,405EX";
34 reg = <0x00000000>;
35 clock-frequency = <0>; /* Filled in by U-Boot */
36 timebase-frequency = <0>; /* Filled in by U-Boot */
37 i-cache-line-size = <32>;
38 d-cache-line-size = <32>;
39 i-cache-size = <16384>; /* 16 kB */
40 d-cache-size = <16384>; /* 16 kB */
41 dcr-controller;
42 dcr-access-method = "native";
43 };
44 };
45
46 memory {
47 device_type = "memory";
48 reg = <0x00000000 0x00000000>; /* Filled in by U-Boot */
49 };
50
51 UIC0: interrupt-controller {
52 compatible = "ibm,uic-405ex", "ibm,uic";
53 interrupt-controller;
54 cell-index = <0>;
55 dcr-reg = <0x0c0 0x009>;
56 #address-cells = <0>;
57 #size-cells = <0>;
58 #interrupt-cells = <2>;
59 };
60
61 UIC1: interrupt-controller1 {
62 compatible = "ibm,uic-405ex","ibm,uic";
63 interrupt-controller;
64 cell-index = <1>;
65 dcr-reg = <0x0d0 0x009>;
66 #address-cells = <0>;
67 #size-cells = <0>;
68 #interrupt-cells = <2>;
69 interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
70 interrupt-parent = <&UIC0>;
71 };
72
73 UIC2: interrupt-controller2 {
74 compatible = "ibm,uic-405ex","ibm,uic";
75 interrupt-controller;
76 cell-index = <2>;
77 dcr-reg = <0x0e0 0x009>;
78 #address-cells = <0>;
79 #size-cells = <0>;
80 #interrupt-cells = <2>;
81 interrupts = <0x1c 0x4 0x1d 0x4>; /* cascade */
82 interrupt-parent = <&UIC0>;
83 };
84
85 CPM0: cpm {
86 compatible = "ibm,cpm";
87 dcr-access-method = "native";
88 dcr-reg = <0x0b0 0x003>;
89 unused-units = <0x00000000>;
90 idle-doze = <0x02000000>;
91 standby = <0xe3e74800>;
92 };
93
94 plb {
95 compatible = "ibm,plb-405ex", "ibm,plb4";
96 #address-cells = <1>;
97 #size-cells = <1>;
98 ranges;
99 clock-frequency = <0>; /* Filled in by U-Boot */
100
101 SDRAM0: memory-controller {
102 compatible = "ibm,sdram-405ex", "ibm,sdram-4xx-ddr2";
103 dcr-reg = <0x010 0x002>;
104 interrupt-parent = <&UIC2>;
105 interrupts = <0x5 0x4 /* ECC DED Error */
106 0x6 0x4>; /* ECC SEC Error */
107 };
108
109 CRYPTO: crypto@ef700000 {
110 compatible = "amcc,ppc405ex-crypto", "amcc,ppc4xx-crypto";
111 reg = <0xef700000 0x80400>;
112 interrupt-parent = <&UIC0>;
113 interrupts = <0x17 0x2>;
114 };
115
116 MAL0: mcmal {
117 compatible = "ibm,mcmal-405ex", "ibm,mcmal2";
118 dcr-reg = <0x180 0x062>;
119 num-tx-chans = <2>;
120 num-rx-chans = <2>;
121 interrupt-parent = <&MAL0>;
122 interrupts = <0x0 0x1 0x2 0x3 0x4>;
123 #interrupt-cells = <1>;
124 #address-cells = <0>;
125 #size-cells = <0>;
126 interrupt-map = </*TXEOB*/ 0x0 &UIC0 0xa 0x4
127 /*RXEOB*/ 0x1 &UIC0 0xb 0x4
128 /*SERR*/ 0x2 &UIC1 0x0 0x4
129 /*TXDE*/ 0x3 &UIC1 0x1 0x4
130 /*RXDE*/ 0x4 &UIC1 0x2 0x4>;
131 interrupt-map-mask = <0xffffffff>;
132 };
133
134 POB0: opb {
135 compatible = "ibm,opb-405ex", "ibm,opb";
136 #address-cells = <1>;
137 #size-cells = <1>;
138 ranges = <0x80000000 0x80000000 0x10000000
139 0xef600000 0xef600000 0x00a00000
140 0xf0000000 0xf0000000 0x10000000>;
141 dcr-reg = <0x0a0 0x005>;
142 clock-frequency = <0>; /* Filled in by U-Boot */
143
144 EBC0: ebc {
145 compatible = "ibm,ebc-405ex", "ibm,ebc";
146 dcr-reg = <0x012 0x002>;
147 #address-cells = <2>;
148 #size-cells = <1>;
149 clock-frequency = <0>; /* Filled in by U-Boot */
150 /* ranges property is supplied by U-Boot */
151 interrupts = <0x5 0x1>;
152 interrupt-parent = <&UIC1>;
153
154 nor_flash@0,0 {
155 compatible = "amd,s29gl512n", "cfi-flash";
156 bank-width = <2>;
157 reg = <0x00000000 0x00000000 0x04000000>;
158 #address-cells = <1>;
159 #size-cells = <1>;
160 partition@0 {
161 label = "kernel";
162 reg = <0x00000000 0x001e0000>;
163 };
164 partition@1e0000 {
165 label = "dtb";
166 reg = <0x001e0000 0x00020000>;
167 };
168 partition@200000 {
169 label = "root";
170 reg = <0x00200000 0x00200000>;
171 };
172 partition@400000 {
173 label = "user";
174 reg = <0x00400000 0x03b60000>;
175 };
176 partition@3f60000 {
177 label = "env";
178 reg = <0x03f60000 0x00040000>;
179 };
180 partition@3fa0000 {
181 label = "u-boot";
182 reg = <0x03fa0000 0x00060000>;
183 };
184 };
185
186 ndfc@1,0 {
187 compatible = "ibm,ndfc";
188 reg = <0x00000001 0x00000000 0x00002000>;
189 ccr = <0x00001000>;
190 bank-settings = <0x80002222>;
191 #address-cells = <1>;
192 #size-cells = <1>;
193
194 nand {
195 #address-cells = <1>;
196 #size-cells = <1>;
197
198 partition@0 {
199 label = "u-boot";
200 reg = <0x00000000 0x00100000>;
201 };
202 partition@100000 {
203 label = "user";
204 reg = <0x00000000 0x03f00000>;
205 };
206 };
207 };
208 };
209
210 UART0: serial@ef600200 {
211 device_type = "serial";
212 compatible = "ns16550";
213 reg = <0xef600200 0x00000008>;
214 virtual-reg = <0xef600200>;
215 clock-frequency = <0>; /* Filled in by U-Boot */
216 current-speed = <0>;
217 interrupt-parent = <&UIC0>;
218 interrupts = <0x1a 0x4>;
219 };
220
221 UART1: serial@ef600300 {
222 device_type = "serial";
223 compatible = "ns16550";
224 reg = <0xef600300 0x00000008>;
225 virtual-reg = <0xef600300>;
226 clock-frequency = <0>; /* Filled in by U-Boot */
227 current-speed = <0>;
228 interrupt-parent = <&UIC0>;
229 interrupts = <0x1 0x4>;
230 };
231
232 IIC0: i2c@ef600400 {
233 compatible = "ibm,iic-405ex", "ibm,iic";
234 reg = <0xef600400 0x00000014>;
235 interrupt-parent = <&UIC0>;
236 interrupts = <0x2 0x4>;
237 #address-cells = <1>;
238 #size-cells = <0>;
239
240 rtc@68 {
241 compatible = "dallas,ds1338";
242 reg = <0x68>;
243 };
244
245 dtt@48 {
246 compatible = "dallas,ds1775";
247 reg = <0x48>;
248 };
249 };
250
251 IIC1: i2c@ef600500 {
252 compatible = "ibm,iic-405ex", "ibm,iic";
253 reg = <0xef600500 0x00000014>;
254 interrupt-parent = <&UIC0>;
255 interrupts = <0x7 0x4>;
256 };
257
258 RGMII0: emac-rgmii@ef600b00 {
259 compatible = "ibm,rgmii-405ex", "ibm,rgmii";
260 reg = <0xef600b00 0x00000104>;
261 has-mdio;
262 };
263
264 EMAC0: ethernet@ef600900 {
265 linux,network-index = <0x0>;
266 device_type = "network";
267 compatible = "ibm,emac-405ex", "ibm,emac4sync";
268 interrupt-parent = <&EMAC0>;
269 interrupts = <0x0 0x1>;
270 #interrupt-cells = <1>;
271 #address-cells = <0>;
272 #size-cells = <0>;
273 interrupt-map = </*Status*/ 0x0 &UIC0 0x18 0x4
274 /*Wake*/ 0x1 &UIC1 0x1d 0x4>;
275 reg = <0xef600900 0x000000c4>;
276 local-mac-address = [000000000000]; /* Filled in by U-Boot */
277 mal-device = <&MAL0>;
278 mal-tx-channel = <0>;
279 mal-rx-channel = <0>;
280 cell-index = <0>;
281 max-frame-size = <9000>;
282 rx-fifo-size = <4096>;
283 tx-fifo-size = <2048>;
284 rx-fifo-size-gige = <16384>;
285 tx-fifo-size-gige = <16384>;
286 phy-mode = "rgmii";
287 phy-map = <0x00000000>;
288 rgmii-device = <&RGMII0>;
289 rgmii-channel = <0>;
290 has-inverted-stacr-oc;
291 has-new-stacr-staopc;
292 };
293
294 EMAC1: ethernet@ef600a00 {
295 linux,network-index = <0x1>;
296 device_type = "network";
297 compatible = "ibm,emac-405ex", "ibm,emac4sync";
298 interrupt-parent = <&EMAC1>;
299 interrupts = <0x0 0x1>;
300 #interrupt-cells = <1>;
301 #address-cells = <0>;
302 #size-cells = <0>;
303 interrupt-map = </*Status*/ 0x0 &UIC0 0x19 0x4
304 /*Wake*/ 0x1 &UIC1 0x1f 0x4>;
305 reg = <0xef600a00 0x000000c4>;
306 local-mac-address = [000000000000]; /* Filled in by U-Boot */
307 mal-device = <&MAL0>;
308 mal-tx-channel = <1>;
309 mal-rx-channel = <1>;
310 cell-index = <1>;
311 max-frame-size = <9000>;
312 rx-fifo-size = <4096>;
313 tx-fifo-size = <2048>;
314 rx-fifo-size-gige = <16384>;
315 tx-fifo-size-gige = <16384>;
316 phy-mode = "rgmii";
317 phy-map = <0x00000000>;
318 rgmii-device = <&RGMII0>;
319 rgmii-channel = <1>;
320 has-inverted-stacr-oc;
321 has-new-stacr-staopc;
322 };
323 };
324
325 PCIE0: pcie@a0000000 {
326 device_type = "pci";
327 #interrupt-cells = <1>;
328 #size-cells = <2>;
329 #address-cells = <3>;
330 compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
331 primary;
332 port = <0x0>; /* port number */
333 reg = <0xa0000000 0x20000000 /* Config space access */
334 0xef000000 0x00001000>; /* Registers */
335 dcr-reg = <0x040 0x020>;
336 sdr-base = <0x400>;
337
338 /* Outbound ranges, one memory and one IO,
339 * later cannot be changed
340 */
341 ranges = <0x02000000 0x00000000 0x80000000 0x90000000 0x00000000 0x08000000
342 0x01000000 0x00000000 0x00000000 0xe0000000 0x00000000 0x00010000>;
343
344 /* Inbound 2GB range starting at 0 */
345 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>;
346
347 /* This drives busses 0x00 to 0x3f */
348 bus-range = <0x0 0x3f>;
349
350 /* Legacy interrupts (note the weird polarity, the bridge seems
351 * to invert PCIe legacy interrupts).
352 * We are de-swizzling here because the numbers are actually for
353 * port of the root complex virtual P2P bridge. But I want
354 * to avoid putting a node for it in the tree, so the numbers
355 * below are basically de-swizzled numbers.
356 * The real slot is on idsel 0, so the swizzling is 1:1
357 */
358 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
359 interrupt-map = <
360 0x0 0x0 0x0 0x1 &UIC2 0x0 0x4 /* swizzled int A */
361 0x0 0x0 0x0 0x2 &UIC2 0x1 0x4 /* swizzled int B */
362 0x0 0x0 0x0 0x3 &UIC2 0x2 0x4 /* swizzled int C */
363 0x0 0x0 0x0 0x4 &UIC2 0x3 0x4 /* swizzled int D */>;
364 };
365
366 PCIE1: pcie@c0000000 {
367 device_type = "pci";
368 #interrupt-cells = <1>;
369 #size-cells = <2>;
370 #address-cells = <3>;
371 compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
372 primary;
373 port = <0x1>; /* port number */
374 reg = <0xc0000000 0x20000000 /* Config space access */
375 0xef001000 0x00001000>; /* Registers */
376 dcr-reg = <0x060 0x020>;
377 sdr-base = <0x440>;
378
379 /* Outbound ranges, one memory and one IO,
380 * later cannot be changed
381 */
382 ranges = <0x02000000 0x00000000 0x80000000 0x98000000 0x00000000 0x08000000
383 0x01000000 0x00000000 0x00000000 0xe0010000 0x00000000 0x00010000>;
384
385 /* Inbound 2GB range starting at 0 */
386 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>;
387
388 /* This drives busses 0x40 to 0x7f */
389 bus-range = <0x40 0x7f>;
390
391 /* Legacy interrupts (note the weird polarity, the bridge seems
392 * to invert PCIe legacy interrupts).
393 * We are de-swizzling here because the numbers are actually for
394 * port of the root complex virtual P2P bridge. But I want
395 * to avoid putting a node for it in the tree, so the numbers
396 * below are basically de-swizzled numbers.
397 * The real slot is on idsel 0, so the swizzling is 1:1
398 */
399 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
400 interrupt-map = <
401 0x0 0x0 0x0 0x1 &UIC2 0xb 0x4 /* swizzled int A */
402 0x0 0x0 0x0 0x2 &UIC2 0xc 0x4 /* swizzled int B */
403 0x0 0x0 0x0 0x3 &UIC2 0xd 0x4 /* swizzled int C */
404 0x0 0x0 0x0 0x4 &UIC2 0xe 0x4 /* swizzled int D */>;
405 };
406 };
407};
arch/powerpc/boot/dts/klondike.dts+0−212
@@ -1,212 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Device Tree for Klondike (APM8018X) board.
4 *
5 * Copyright (c) 2010, Applied Micro Circuits Corporation
6 * Author: Tanmay Inamdar <tinamdar@apm.com>
7 */
8
9/dts-v1/;
10
11/ {
12 #address-cells = <1>;
13 #size-cells = <1>;
14 model = "apm,klondike";
15 compatible = "apm,klondike";
16 dcr-parent = <&{/cpus/cpu@0}>;
17
18 aliases {
19 ethernet0 = &EMAC0;
20 ethernet1 = &EMAC1;
21 };
22
23 cpus {
24 #address-cells = <1>;
25 #size-cells = <0>;
26
27 cpu@0 {
28 device_type = "cpu";
29 model = "PowerPC,apm8018x";
30 reg = <0x00000000>;
31 clock-frequency = <300000000>; /* Filled in by U-Boot */
32 timebase-frequency = <300000000>; /* Filled in by U-Boot */
33 i-cache-line-size = <32>;
34 d-cache-line-size = <32>;
35 i-cache-size = <16384>; /* 16 kB */
36 d-cache-size = <16384>; /* 16 kB */
37 dcr-controller;
38 dcr-access-method = "native";
39 };
40 };
41
42 memory {
43 device_type = "memory";
44 reg = <0x00000000 0x20000000>; /* Filled in by U-Boot */
45 };
46
47 UIC0: interrupt-controller {
48 compatible = "ibm,uic";
49 interrupt-controller;
50 cell-index = <0>;
51 dcr-reg = <0x0c0 0x010>;
52 #address-cells = <0>;
53 #size-cells = <0>;
54 #interrupt-cells = <2>;
55 };
56
57 UIC1: interrupt-controller1 {
58 compatible = "ibm,uic";
59 interrupt-controller;
60 cell-index = <1>;
61 dcr-reg = <0x0d0 0x010>;
62 #address-cells = <0>;
63 #size-cells = <0>;
64 #interrupt-cells = <2>;
65 interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
66 interrupt-parent = <&UIC0>;
67 };
68
69 UIC2: interrupt-controller2 {
70 compatible = "ibm,uic";
71 interrupt-controller;
72 cell-index = <2>;
73 dcr-reg = <0x0e0 0x010>;
74 #address-cells = <0>;
75 #size-cells = <0>;
76 #interrupt-cells = <2>;
77 interrupts = <0x0a 0x4 0x0b 0x4>; /* cascade */
78 interrupt-parent = <&UIC0>;
79 };
80
81 UIC3: interrupt-controller3 {
82 compatible = "ibm,uic";
83 interrupt-controller;
84 cell-index = <3>;
85 dcr-reg = <0x0f0 0x010>;
86 #address-cells = <0>;
87 #size-cells = <0>;
88 #interrupt-cells = <2>;
89 interrupts = <0x10 0x4 0x11 0x4>; /* cascade */
90 interrupt-parent = <&UIC0>;
91 };
92
93 plb {
94 compatible = "ibm,plb4";
95 #address-cells = <1>;
96 #size-cells = <1>;
97 ranges;
98 clock-frequency = <0>; /* Filled in by U-Boot */
99
100 SDRAM0: memory-controller {
101 compatible = "ibm,sdram-apm8018x";
102 dcr-reg = <0x010 0x002>;
103 };
104
105 MAL0: mcmal {
106 compatible = "ibm,mcmal2";
107 dcr-reg = <0x180 0x062>;
108 num-tx-chans = <2>;
109 num-rx-chans = <16>;
110 #address-cells = <0>;
111 #size-cells = <0>;
112 interrupt-parent = <&UIC1>;
113 interrupts = </*TXEOB*/ 0x6 0x4
114 /*RXEOB*/ 0x7 0x4
115 /*SERR*/ 0x1 0x4
116 /*TXDE*/ 0x2 0x4
117 /*RXDE*/ 0x3 0x4>;
118 };
119
120 POB0: opb {
121 compatible = "ibm,opb";
122 #address-cells = <1>;
123 #size-cells = <1>;
124 ranges = <0x20000000 0x20000000 0x30000000
125 0x50000000 0x50000000 0x10000000
126 0x60000000 0x60000000 0x10000000
127 0xFE000000 0xFE000000 0x00010000>;
128 dcr-reg = <0x100 0x020>;
129 clock-frequency = <300000000>; /* Filled in by U-Boot */
130
131 RGMII0: emac-rgmii@400a2000 {
132 compatible = "ibm,rgmii";
133 reg = <0x400a2000 0x00000010>;
134 has-mdio;
135 };
136
137 TAH0: emac-tah@400a3000 {
138 compatible = "ibm,tah";
139 reg = <0x400a3000 0x100>;
140 };
141
142 TAH1: emac-tah@400a4000 {
143 compatible = "ibm,tah";
144 reg = <0x400a4000 0x100>;
145 };
146
147 EMAC0: ethernet@400a0000 {
148 compatible = "ibm,emac4", "ibm-emac4sync";
149 interrupt-parent = <&EMAC0>;
150 interrupts = <0x0>;
151 #interrupt-cells = <1>;
152 #address-cells = <0>;
153 #size-cells = <0>;
154 interrupt-map = </*Status*/ 0x0 &UIC0 0x13 0x4>;
155 reg = <0x400a0000 0x00000100>;
156 local-mac-address = [000000000000]; /* Filled in by U-Boot */
157 mal-device = <&MAL0>;
158 mal-tx-channel = <0x0>;
159 mal-rx-channel = <0x0>;
160 cell-index = <0>;
161 max-frame-size = <9000>;
162 rx-fifo-size = <4096>;
163 tx-fifo-size = <2048>;
164 phy-mode = "rgmii";
165 phy-address = <0x2>;
166 turbo = "no";
167 phy-map = <0x00000000>;
168 rgmii-device = <&RGMII0>;
169 rgmii-channel = <0>;
170 tah-device = <&TAH0>;
171 tah-channel = <0>;
172 has-inverted-stacr-oc;
173 has-new-stacr-staopc;
174 };
175
176 EMAC1: ethernet@400a1000 {
177 compatible = "ibm,emac4", "ibm-emac4sync";
178 status = "disabled";
179 interrupt-parent = <&EMAC1>;
180 interrupts = <0x0>;
181 #interrupt-cells = <1>;
182 #address-cells = <0>;
183 #size-cells = <0>;
184 interrupt-map = </*Status*/ 0x0 &UIC0 0x14 0x4>;
185 reg = <0x400a1000 0x00000100>;
186 local-mac-address = [000000000000]; /* Filled in by U-Boot */
187 mal-device = <&MAL0>;
188 mal-tx-channel = <1>;
189 mal-rx-channel = <8>;
190 cell-index = <1>;
191 max-frame-size = <9000>;
192 rx-fifo-size = <4096>;
193 tx-fifo-size = <2048>;
194 phy-mode = "rgmii";
195 phy-address = <0x3>;
196 turbo = "no";
197 phy-map = <0x00000000>;
198 rgmii-device = <&RGMII0>;
199 rgmii-channel = <1>;
200 tah-device = <&TAH1>;
201 tah-channel = <0>;
202 has-inverted-stacr-oc;
203 has-new-stacr-staopc;
204 mdio-device = <&EMAC0>;
205 };
206 };
207 };
208
209 chosen {
210 stdout-path = "/plb/opb/serial@50001000";
211 };
212};
arch/powerpc/boot/dts/makalu.dts+0−353
@@ -1,353 +0,0 @@
1/*
2 * Device Tree Source for AMCC Makalu (405EX)
3 *
4 * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without
8 * any warranty of any kind, whether express or implied.
9 */
10
11/dts-v1/;
12
13/ {
14 #address-cells = <1>;
15 #size-cells = <1>;
16 model = "amcc,makalu";
17 compatible = "amcc,makalu";
18 dcr-parent = <&{/cpus/cpu@0}>;
19
20 aliases {
21 ethernet0 = &EMAC0;
22 ethernet1 = &EMAC1;
23 serial0 = &UART0;
24 serial1 = &UART1;
25 };
26
27 cpus {
28 #address-cells = <1>;
29 #size-cells = <0>;
30
31 cpu@0 {
32 device_type = "cpu";
33 model = "PowerPC,405EX";
34 reg = <0x00000000>;
35 clock-frequency = <0>; /* Filled in by U-Boot */
36 timebase-frequency = <0>; /* Filled in by U-Boot */
37 i-cache-line-size = <32>;
38 d-cache-line-size = <32>;
39 i-cache-size = <16384>; /* 16 kB */
40 d-cache-size = <16384>; /* 16 kB */
41 dcr-controller;
42 dcr-access-method = "native";
43 };
44 };
45
46 memory {
47 device_type = "memory";
48 reg = <0x00000000 0x00000000>; /* Filled in by U-Boot */
49 };
50
51 UIC0: interrupt-controller {
52 compatible = "ibm,uic-405ex", "ibm,uic";
53 interrupt-controller;
54 cell-index = <0>;
55 dcr-reg = <0x0c0 0x009>;
56 #address-cells = <0>;
57 #size-cells = <0>;
58 #interrupt-cells = <2>;
59 };
60
61 UIC1: interrupt-controller1 {
62 compatible = "ibm,uic-405ex","ibm,uic";
63 interrupt-controller;
64 cell-index = <1>;
65 dcr-reg = <0x0d0 0x009>;
66 #address-cells = <0>;
67 #size-cells = <0>;
68 #interrupt-cells = <2>;
69 interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
70 interrupt-parent = <&UIC0>;
71 };
72
73 UIC2: interrupt-controller2 {
74 compatible = "ibm,uic-405ex","ibm,uic";
75 interrupt-controller;
76 cell-index = <2>;
77 dcr-reg = <0x0e0 0x009>;
78 #address-cells = <0>;
79 #size-cells = <0>;
80 #interrupt-cells = <2>;
81 interrupts = <0x1c 0x4 0x1d 0x4>; /* cascade */
82 interrupt-parent = <&UIC0>;
83 };
84
85 plb {
86 compatible = "ibm,plb-405ex", "ibm,plb4";
87 #address-cells = <1>;
88 #size-cells = <1>;
89 ranges;
90 clock-frequency = <0>; /* Filled in by U-Boot */
91
92 SDRAM0: memory-controller {
93 compatible = "ibm,sdram-405ex", "ibm,sdram-4xx-ddr2";
94 dcr-reg = <0x010 0x002>;
95 interrupt-parent = <&UIC2>;
96 interrupts = <0x5 0x4 /* ECC DED Error */
97 0x6 0x4 /* ECC SEC Error */ >;
98 };
99
100 MAL0: mcmal {
101 compatible = "ibm,mcmal-405ex", "ibm,mcmal2";
102 dcr-reg = <0x180 0x062>;
103 num-tx-chans = <2>;
104 num-rx-chans = <2>;
105 interrupt-parent = <&MAL0>;
106 interrupts = <0x0 0x1 0x2 0x3 0x4>;
107 #interrupt-cells = <1>;
108 #address-cells = <0>;
109 #size-cells = <0>;
110 interrupt-map = </*TXEOB*/ 0x0 &UIC0 0xa 0x4
111 /*RXEOB*/ 0x1 &UIC0 0xb 0x4
112 /*SERR*/ 0x2 &UIC1 0x0 0x4
113 /*TXDE*/ 0x3 &UIC1 0x1 0x4
114 /*RXDE*/ 0x4 &UIC1 0x2 0x4>;
115 interrupt-map-mask = <0xffffffff>;
116 };
117
118 POB0: opb {
119 compatible = "ibm,opb-405ex", "ibm,opb";
120 #address-cells = <1>;
121 #size-cells = <1>;
122 ranges = <0x80000000 0x80000000 0x10000000
123 0xef600000 0xef600000 0x00a00000
124 0xf0000000 0xf0000000 0x10000000>;
125 dcr-reg = <0x0a0 0x005>;
126 clock-frequency = <0>; /* Filled in by U-Boot */
127
128 EBC0: ebc {
129 compatible = "ibm,ebc-405ex", "ibm,ebc";
130 dcr-reg = <0x012 0x002>;
131 #address-cells = <2>;
132 #size-cells = <1>;
133 clock-frequency = <0>; /* Filled in by U-Boot */
134 /* ranges property is supplied by U-Boot */
135 interrupts = <0x5 0x1>;
136 interrupt-parent = <&UIC1>;
137
138 nor_flash@0,0 {
139 compatible = "amd,s29gl512n", "cfi-flash";
140 bank-width = <2>;
141 reg = <0x00000000 0x00000000 0x04000000>;
142 #address-cells = <1>;
143 #size-cells = <1>;
144 partition@0 {
145 label = "kernel";
146 reg = <0x00000000 0x00200000>;
147 };
148 partition@200000 {
149 label = "root";
150 reg = <0x00200000 0x00200000>;
151 };
152 partition@400000 {
153 label = "user";
154 reg = <0x00400000 0x03b60000>;
155 };
156 partition@3f60000 {
157 label = "env";
158 reg = <0x03f60000 0x00040000>;
159 };
160 partition@3fa0000 {
161 label = "u-boot";
162 reg = <0x03fa0000 0x00060000>;
163 };
164 };
165 };
166
167 UART0: serial@ef600200 {
168 device_type = "serial";
169 compatible = "ns16550";
170 reg = <0xef600200 0x00000008>;
171 virtual-reg = <0xef600200>;
172 clock-frequency = <0>; /* Filled in by U-Boot */
173 current-speed = <0>;
174 interrupt-parent = <&UIC0>;
175 interrupts = <0x1a 0x4>;
176 };
177
178 UART1: serial@ef600300 {
179 device_type = "serial";
180 compatible = "ns16550";
181 reg = <0xef600300 0x00000008>;
182 virtual-reg = <0xef600300>;
183 clock-frequency = <0>; /* Filled in by U-Boot */
184 current-speed = <0>;
185 interrupt-parent = <&UIC0>;
186 interrupts = <0x1 0x4>;
187 };
188
189 IIC0: i2c@ef600400 {
190 compatible = "ibm,iic-405ex", "ibm,iic";
191 reg = <0xef600400 0x00000014>;
192 interrupt-parent = <&UIC0>;
193 interrupts = <0x2 0x4>;
194 };
195
196 IIC1: i2c@ef600500 {
197 compatible = "ibm,iic-405ex", "ibm,iic";
198 reg = <0xef600500 0x00000014>;
199 interrupt-parent = <&UIC0>;
200 interrupts = <0x7 0x4>;
201 };
202
203
204 RGMII0: emac-rgmii@ef600b00 {
205 compatible = "ibm,rgmii-405ex", "ibm,rgmii";
206 reg = <0xef600b00 0x00000104>;
207 has-mdio;
208 };
209
210 EMAC0: ethernet@ef600900 {
211 linux,network-index = <0x0>;
212 device_type = "network";
213 compatible = "ibm,emac-405ex", "ibm,emac4sync";
214 interrupt-parent = <&EMAC0>;
215 interrupts = <0x0 0x1>;
216 #interrupt-cells = <1>;
217 #address-cells = <0>;
218 #size-cells = <0>;
219 interrupt-map = </*Status*/ 0x0 &UIC0 0x18 0x4
220 /*Wake*/ 0x1 &UIC1 0x1d 0x4>;
221 reg = <0xef600900 0x000000c4>;
222 local-mac-address = [000000000000]; /* Filled in by U-Boot */
223 mal-device = <&MAL0>;
224 mal-tx-channel = <0>;
225 mal-rx-channel = <0>;
226 cell-index = <0>;
227 max-frame-size = <9000>;
228 rx-fifo-size = <4096>;
229 tx-fifo-size = <2048>;
230 rx-fifo-size-gige = <16384>;
231 tx-fifo-size-gige = <16384>;
232 phy-mode = "rgmii";
233 phy-map = <0x0000003f>; /* Start at 6 */
234 rgmii-device = <&RGMII0>;
235 rgmii-channel = <0>;
236 has-inverted-stacr-oc;
237 has-new-stacr-staopc;
238 };
239
240 EMAC1: ethernet@ef600a00 {
241 linux,network-index = <0x1>;
242 device_type = "network";
243 compatible = "ibm,emac-405ex", "ibm,emac4sync";
244 interrupt-parent = <&EMAC1>;
245 interrupts = <0x0 0x1>;
246 #interrupt-cells = <1>;
247 #address-cells = <0>;
248 #size-cells = <0>;
249 interrupt-map = </*Status*/ 0x0 &UIC0 0x19 0x4
250 /*Wake*/ 0x1 &UIC1 0x1f 0x4>;
251 reg = <0xef600a00 0x000000c4>;
252 local-mac-address = [000000000000]; /* Filled in by U-Boot */
253 mal-device = <&MAL0>;
254 mal-tx-channel = <1>;
255 mal-rx-channel = <1>;
256 cell-index = <1>;
257 max-frame-size = <9000>;
258 rx-fifo-size = <4096>;
259 tx-fifo-size = <2048>;
260 rx-fifo-size-gige = <16384>;
261 tx-fifo-size-gige = <16384>;
262 phy-mode = "rgmii";
263 phy-map = <0x00000000>;
264 rgmii-device = <&RGMII0>;
265 rgmii-channel = <1>;
266 has-inverted-stacr-oc;
267 has-new-stacr-staopc;
268 };
269 };
270
271 PCIE0: pcie@a0000000 {
272 device_type = "pci";
273 #interrupt-cells = <1>;
274 #size-cells = <2>;
275 #address-cells = <3>;
276 compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
277 primary;
278 port = <0x0>; /* port number */
279 reg = <0xa0000000 0x20000000 /* Config space access */
280 0xef000000 0x00001000>; /* Registers */
281 dcr-reg = <0x040 0x020>;
282 sdr-base = <0x400>;
283
284 /* Outbound ranges, one memory and one IO,
285 * later cannot be changed
286 */
287 ranges = <0x02000000 0x00000000 0x80000000 0x90000000 0x00000000 0x08000000
288 0x01000000 0x00000000 0x00000000 0xe0000000 0x00000000 0x00010000>;
289
290 /* Inbound 2GB range starting at 0 */
291 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>;
292
293 /* This drives busses 0x00 to 0x3f */
294 bus-range = <0x0 0x3f>;
295
296 /* Legacy interrupts (note the weird polarity, the bridge seems
297 * to invert PCIe legacy interrupts).
298 * We are de-swizzling here because the numbers are actually for
299 * port of the root complex virtual P2P bridge. But I want
300 * to avoid putting a node for it in the tree, so the numbers
301 * below are basically de-swizzled numbers.
302 * The real slot is on idsel 0, so the swizzling is 1:1
303 */
304 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
305 interrupt-map = <
306 0x0 0x0 0x0 0x1 &UIC2 0x0 0x4 /* swizzled int A */
307 0x0 0x0 0x0 0x2 &UIC2 0x1 0x4 /* swizzled int B */
308 0x0 0x0 0x0 0x3 &UIC2 0x2 0x4 /* swizzled int C */
309 0x0 0x0 0x0 0x4 &UIC2 0x3 0x4 /* swizzled int D */>;
310 };
311
312 PCIE1: pcie@c0000000 {
313 device_type = "pci";
314 #interrupt-cells = <1>;
315 #size-cells = <2>;
316 #address-cells = <3>;
317 compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
318 primary;
319 port = <0x1>; /* port number */
320 reg = <0xc0000000 0x20000000 /* Config space access */
321 0xef001000 0x00001000>; /* Registers */
322 dcr-reg = <0x060 0x020>;
323 sdr-base = <0x440>;
324
325 /* Outbound ranges, one memory and one IO,
326 * later cannot be changed
327 */
328 ranges = <0x02000000 0x00000000 0x80000000 0x98000000 0x00000000 0x08000000
329 0x01000000 0x00000000 0x00000000 0xe0010000 0x00000000 0x00010000>;
330
331 /* Inbound 2GB range starting at 0 */
332 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>;
333
334 /* This drives busses 0x40 to 0x7f */
335 bus-range = <0x40 0x7f>;
336
337 /* Legacy interrupts (note the weird polarity, the bridge seems
338 * to invert PCIe legacy interrupts).
339 * We are de-swizzling here because the numbers are actually for
340 * port of the root complex virtual P2P bridge. But I want
341 * to avoid putting a node for it in the tree, so the numbers
342 * below are basically de-swizzled numbers.
343 * The real slot is on idsel 0, so the swizzling is 1:1
344 */
345 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
346 interrupt-map = <
347 0x0 0x0 0x0 0x1 &UIC2 0xb 0x4 /* swizzled int A */
348 0x0 0x0 0x0 0x2 &UIC2 0xc 0x4 /* swizzled int B */
349 0x0 0x0 0x0 0x3 &UIC2 0xd 0x4 /* swizzled int C */
350 0x0 0x0 0x0 0x4 &UIC2 0xe 0x4 /* swizzled int D */>;
351 };
352 };
353};
arch/powerpc/boot/dts/obs600.dts+0−314
@@ -1,314 +0,0 @@
1/*
2 * Device Tree Source for PlatHome OpenBlockS 600 (405EX)
3 *
4 * Copyright 2011 Ben Herrenschmidt, IBM Corp.
5 *
6 * Based on Kilauea by:
7 *
8 * Copyright 2007-2009 DENX Software Engineering, Stefan Roese <sr@denx.de>
9 *
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without
12 * any warranty of any kind, whether express or implied.
13 */
14
15/dts-v1/;
16
17/ {
18 #address-cells = <1>;
19 #size-cells = <1>;
20 model = "PlatHome,OpenBlockS 600";
21 compatible = "plathome,obs600";
22 dcr-parent = <&{/cpus/cpu@0}>;
23
24 aliases {
25 ethernet0 = &EMAC0;
26 ethernet1 = &EMAC1;
27 serial0 = &UART0;
28 serial1 = &UART1;
29 };
30
31 cpus {
32 #address-cells = <1>;
33 #size-cells = <0>;
34
35 cpu@0 {
36 device_type = "cpu";
37 model = "PowerPC,405EX";
38 reg = <0x00000000>;
39 clock-frequency = <0>; /* Filled in by U-Boot */
40 timebase-frequency = <0>; /* Filled in by U-Boot */
41 i-cache-line-size = <32>;
42 d-cache-line-size = <32>;
43 i-cache-size = <16384>; /* 16 kB */
44 d-cache-size = <16384>; /* 16 kB */
45 dcr-controller;
46 dcr-access-method = "native";
47 };
48 };
49
50 memory {
51 device_type = "memory";
52 reg = <0x00000000 0x00000000>; /* Filled in by U-Boot */
53 };
54
55 UIC0: interrupt-controller {
56 compatible = "ibm,uic-405ex", "ibm,uic";
57 interrupt-controller;
58 cell-index = <0>;
59 dcr-reg = <0x0c0 0x009>;
60 #address-cells = <0>;
61 #size-cells = <0>;
62 #interrupt-cells = <2>;
63 };
64
65 UIC1: interrupt-controller1 {
66 compatible = "ibm,uic-405ex","ibm,uic";
67 interrupt-controller;
68 cell-index = <1>;
69 dcr-reg = <0x0d0 0x009>;
70 #address-cells = <0>;
71 #size-cells = <0>;
72 #interrupt-cells = <2>;
73 interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
74 interrupt-parent = <&UIC0>;
75 };
76
77 UIC2: interrupt-controller2 {
78 compatible = "ibm,uic-405ex","ibm,uic";
79 interrupt-controller;
80 cell-index = <2>;
81 dcr-reg = <0x0e0 0x009>;
82 #address-cells = <0>;
83 #size-cells = <0>;
84 #interrupt-cells = <2>;
85 interrupts = <0x1c 0x4 0x1d 0x4>; /* cascade */
86 interrupt-parent = <&UIC0>;
87 };
88
89 CPM0: cpm {
90 compatible = "ibm,cpm";
91 dcr-access-method = "native";
92 dcr-reg = <0x0b0 0x003>;
93 unused-units = <0x00000000>;
94 idle-doze = <0x02000000>;
95 standby = <0xe3e74800>;
96 };
97
98 plb {
99 compatible = "ibm,plb-405ex", "ibm,plb4";
100 #address-cells = <1>;
101 #size-cells = <1>;
102 ranges;
103 clock-frequency = <0>; /* Filled in by U-Boot */
104
105 SDRAM0: memory-controller {
106 compatible = "ibm,sdram-405ex", "ibm,sdram-4xx-ddr2";
107 dcr-reg = <0x010 0x002>;
108 interrupt-parent = <&UIC2>;
109 interrupts = <0x5 0x4 /* ECC DED Error */
110 0x6 0x4>; /* ECC SEC Error */
111 };
112
113 CRYPTO: crypto@ef700000 {
114 compatible = "amcc,ppc405ex-crypto", "amcc,ppc4xx-crypto";
115 reg = <0xef700000 0x80400>;
116 interrupt-parent = <&UIC0>;
117 interrupts = <0x17 0x2>;
118 };
119
120 MAL0: mcmal {
121 compatible = "ibm,mcmal-405ex", "ibm,mcmal2";
122 dcr-reg = <0x180 0x062>;
123 num-tx-chans = <2>;
124 num-rx-chans = <2>;
125 interrupt-parent = <&MAL0>;
126 interrupts = <0x0 0x1 0x2 0x3 0x4>;
127 #interrupt-cells = <1>;
128 #address-cells = <0>;
129 #size-cells = <0>;
130 interrupt-map = </*TXEOB*/ 0x0 &UIC0 0xa 0x4
131 /*RXEOB*/ 0x1 &UIC0 0xb 0x4
132 /*SERR*/ 0x2 &UIC1 0x0 0x4
133 /*TXDE*/ 0x3 &UIC1 0x1 0x4
134 /*RXDE*/ 0x4 &UIC1 0x2 0x4>;
135 interrupt-map-mask = <0xffffffff>;
136 };
137
138 POB0: opb {
139 compatible = "ibm,opb-405ex", "ibm,opb";
140 #address-cells = <1>;
141 #size-cells = <1>;
142 ranges = <0x80000000 0x80000000 0x10000000
143 0xef600000 0xef600000 0x00a00000
144 0xf0000000 0xf0000000 0x10000000>;
145 dcr-reg = <0x0a0 0x005>;
146 clock-frequency = <0>; /* Filled in by U-Boot */
147
148 EBC0: ebc {
149 compatible = "ibm,ebc-405ex", "ibm,ebc";
150 dcr-reg = <0x012 0x002>;
151 #address-cells = <2>;
152 #size-cells = <1>;
153 clock-frequency = <0>; /* Filled in by U-Boot */
154 /* ranges property is supplied by U-Boot */
155 interrupts = <0x5 0x1>;
156 interrupt-parent = <&UIC1>;
157
158 nor_flash@0,0 {
159 compatible = "amd,s29gl512n", "cfi-flash";
160 bank-width = <2>;
161 reg = <0x00000000 0x00000000 0x08000000>;
162 #address-cells = <1>;
163 #size-cells = <1>;
164 partition@0 {
165 label = "kernel + initrd";
166 reg = <0x00000000 0x03de0000>;
167 };
168 partition@3de0000 {
169 label = "user config area";
170 reg = <0x03de0000 0x00080000>;
171 };
172 partition@3e60000 {
173 label = "user program area";
174 reg = <0x03e60000 0x04000000>;
175 };
176 partition@7e60000 {
177 label = "flat device tree";
178 reg = <0x07e60000 0x00080000>;
179 };
180 partition@7ee0000 {
181 label = "test program";
182 reg = <0x07ee0000 0x00080000>;
183 };
184 partition@7f60000 {
185 label = "u-boot env";
186 reg = <0x07f60000 0x00040000>;
187 };
188 partition@7fa0000 {
189 label = "u-boot";
190 reg = <0x07fa0000 0x00060000>;
191 };
192 };
193 };
194
195 UART0: serial@ef600200 {
196 device_type = "serial";
197 compatible = "ns16550";
198 reg = <0xef600200 0x00000008>;
199 virtual-reg = <0xef600200>;
200 clock-frequency = <0>; /* Filled in by U-Boot */
201 current-speed = <0>;
202 interrupt-parent = <&UIC0>;
203 interrupts = <0x1a 0x4>;
204 };
205
206 UART1: serial@ef600300 {
207 device_type = "serial";
208 compatible = "ns16550";
209 reg = <0xef600300 0x00000008>;
210 virtual-reg = <0xef600300>;
211 clock-frequency = <0>; /* Filled in by U-Boot */
212 current-speed = <0>;
213 interrupt-parent = <&UIC0>;
214 interrupts = <0x1 0x4>;
215 };
216
217 IIC0: i2c@ef600400 {
218 compatible = "ibm,iic-405ex", "ibm,iic";
219 reg = <0xef600400 0x00000014>;
220 interrupt-parent = <&UIC0>;
221 interrupts = <0x2 0x4>;
222 #address-cells = <1>;
223 #size-cells = <0>;
224
225 rtc@68 {
226 compatible = "dallas,ds1340";
227 reg = <0x68>;
228 };
229 };
230
231 IIC1: i2c@ef600500 {
232 compatible = "ibm,iic-405ex", "ibm,iic";
233 reg = <0xef600500 0x00000014>;
234 interrupt-parent = <&UIC0>;
235 interrupts = <0x7 0x4>;
236 };
237
238 RGMII0: emac-rgmii@ef600b00 {
239 compatible = "ibm,rgmii-405ex", "ibm,rgmii";
240 reg = <0xef600b00 0x00000104>;
241 has-mdio;
242 };
243
244 EMAC0: ethernet@ef600900 {
245 linux,network-index = <0x0>;
246 device_type = "network";
247 compatible = "ibm,emac-405ex", "ibm,emac4sync";
248 interrupt-parent = <&EMAC0>;
249 interrupts = <0x0 0x1>;
250 #interrupt-cells = <1>;
251 #address-cells = <0>;
252 #size-cells = <0>;
253 interrupt-map = </*Status*/ 0x0 &UIC0 0x18 0x4
254 /*Wake*/ 0x1 &UIC1 0x1d 0x4>;
255 reg = <0xef600900 0x000000c4>;
256 local-mac-address = [000000000000]; /* Filled in by U-Boot */
257 mal-device = <&MAL0>;
258 mal-tx-channel = <0>;
259 mal-rx-channel = <0>;
260 cell-index = <0>;
261 max-frame-size = <9000>;
262 rx-fifo-size = <4096>;
263 tx-fifo-size = <2048>;
264 rx-fifo-size-gige = <16384>;
265 tx-fifo-size-gige = <16384>;
266 phy-mode = "rgmii";
267 phy-map = <0x00000000>;
268 rgmii-device = <&RGMII0>;
269 rgmii-channel = <0>;
270 has-inverted-stacr-oc;
271 has-new-stacr-staopc;
272 };
273
274 EMAC1: ethernet@ef600a00 {
275 linux,network-index = <0x1>;
276 device_type = "network";
277 compatible = "ibm,emac-405ex", "ibm,emac4sync";
278 interrupt-parent = <&EMAC1>;
279 interrupts = <0x0 0x1>;
280 #interrupt-cells = <1>;
281 #address-cells = <0>;
282 #size-cells = <0>;
283 interrupt-map = </*Status*/ 0x0 &UIC0 0x19 0x4
284 /*Wake*/ 0x1 &UIC1 0x1f 0x4>;
285 reg = <0xef600a00 0x000000c4>;
286 local-mac-address = [000000000000]; /* Filled in by U-Boot */
287 mal-device = <&MAL0>;
288 mal-tx-channel = <1>;
289 mal-rx-channel = <1>;
290 cell-index = <1>;
291 max-frame-size = <9000>;
292 rx-fifo-size = <4096>;
293 tx-fifo-size = <2048>;
294 rx-fifo-size-gige = <16384>;
295 tx-fifo-size-gige = <16384>;
296 phy-mode = "rgmii";
297 phy-map = <0x00000000>;
298 rgmii-device = <&RGMII0>;
299 rgmii-channel = <1>;
300 has-inverted-stacr-oc;
301 has-new-stacr-staopc;
302 };
303
304 GPIO: gpio@ef600800 {
305 device_type = "gpio";
306 compatible = "ibm,gpio-405ex", "ibm,ppc4xx-gpio";
307 reg = <0xef600800 0x50>;
308 };
309 };
310 };
311 chosen {
312 stdout-path = "/plb/opb/serial@ef600200";
313 };
314};
arch/powerpc/boot/ppcboot-hotfoot.h+0−119
@@ -1,119 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * This interface is used for compatibility with old U-boots *ONLY*.
4 * Please do not imitate or extend this.
5 */
6
7/*
8 * Unfortunately, the ESTeem Hotfoot board uses a mangled version of
9 * ppcboot.h for historical reasons, and in the interest of having a
10 * mainline kernel boot on the production board+bootloader, this was the
11 * least-offensive solution. Please direct all flames to:
12 *
13 * Solomon Peachy <solomon@linux-wlan.com>
14 *
15 * (This header is identical to ppcboot.h except for the
16 * TARGET_HOTFOOT bits)
17 */
18
19/*
20 * (C) Copyright 2000, 2001
21 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
22 */
23
24#ifndef __PPCBOOT_H__
25#define __PPCBOOT_H__
26
27/*
28 * Board information passed to kernel from PPCBoot
29 *
30 * include/asm-ppc/ppcboot.h
31 */
32
33#include "types.h"
34
35typedef struct bd_info {
36 unsigned long bi_memstart; /* start of DRAM memory */
37 unsigned long bi_memsize; /* size of DRAM memory in bytes */
38 unsigned long bi_flashstart; /* start of FLASH memory */
39 unsigned long bi_flashsize; /* size of FLASH memory */
40 unsigned long bi_flashoffset; /* reserved area for startup monitor */
41 unsigned long bi_sramstart; /* start of SRAM memory */
42 unsigned long bi_sramsize; /* size of SRAM memory */
43#if defined(TARGET_8xx) || defined(TARGET_CPM2) || defined(TARGET_85xx) ||\
44 defined(TARGET_83xx)
45 unsigned long bi_immr_base; /* base of IMMR register */
46#endif
47#if defined(TARGET_PPC_MPC52xx)
48 unsigned long bi_mbar_base; /* base of internal registers */
49#endif
50 unsigned long bi_bootflags; /* boot / reboot flag (for LynxOS) */
51 unsigned long bi_ip_addr; /* IP Address */
52 unsigned char bi_enetaddr[6]; /* Ethernet address */
53#if defined(TARGET_HOTFOOT)
54 /* second onboard ethernet port */
55 unsigned char bi_enet1addr[6];
56#define HAVE_ENET1ADDR
57#endif /* TARGET_HOOTFOOT */
58 unsigned short bi_ethspeed; /* Ethernet speed in Mbps */
59 unsigned long bi_intfreq; /* Internal Freq, in MHz */
60 unsigned long bi_busfreq; /* Bus Freq, in MHz */
61#if defined(TARGET_CPM2)
62 unsigned long bi_cpmfreq; /* CPM_CLK Freq, in MHz */
63 unsigned long bi_brgfreq; /* BRG_CLK Freq, in MHz */
64 unsigned long bi_sccfreq; /* SCC_CLK Freq, in MHz */
65 unsigned long bi_vco; /* VCO Out from PLL, in MHz */
66#endif
67#if defined(TARGET_PPC_MPC52xx)
68 unsigned long bi_ipbfreq; /* IPB Bus Freq, in MHz */
69 unsigned long bi_pcifreq; /* PCI Bus Freq, in MHz */
70#endif
71 unsigned long bi_baudrate; /* Console Baudrate */
72#if defined(TARGET_4xx)
73 unsigned char bi_s_version[4]; /* Version of this structure */
74 unsigned char bi_r_version[32]; /* Version of the ROM (IBM) */
75 unsigned int bi_procfreq; /* CPU (Internal) Freq, in Hz */
76 unsigned int bi_plb_busfreq; /* PLB Bus speed, in Hz */
77 unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */
78 unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */
79#endif
80#if defined(TARGET_HOTFOOT)
81 unsigned int bi_pllouta_freq; /* PLL OUTA speed, in Hz */
82#endif
83#if defined(TARGET_HYMOD)
84 hymod_conf_t bi_hymod_conf; /* hymod configuration information */
85#endif
86#if defined(TARGET_EVB64260) || defined(TARGET_405EP) || defined(TARGET_44x) || \
87 defined(TARGET_85xx) || defined(TARGET_83xx) || defined(TARGET_HAS_ETH1)
88 /* second onboard ethernet port */
89 unsigned char bi_enet1addr[6];
90#define HAVE_ENET1ADDR
91#endif
92#if defined(TARGET_EVB64260) || defined(TARGET_440GX) || \
93 defined(TARGET_85xx) || defined(TARGET_HAS_ETH2)
94 /* third onboard ethernet ports */
95 unsigned char bi_enet2addr[6];
96#define HAVE_ENET2ADDR
97#endif
98#if defined(TARGET_440GX) || defined(TARGET_HAS_ETH3)
99 /* fourth onboard ethernet ports */
100 unsigned char bi_enet3addr[6];
101#define HAVE_ENET3ADDR
102#endif
103#if defined(TARGET_HOTFOOT)
104 int bi_phynum[2]; /* Determines phy mapping */
105 int bi_phymode[2]; /* Determines phy mode */
106#endif
107#if defined(TARGET_4xx)
108 unsigned int bi_opbfreq; /* OB clock in Hz */
109 int bi_iic_fast[2]; /* Use fast i2c mode */
110#endif
111#if defined(TARGET_440GX)
112 int bi_phynum[4]; /* phy mapping */
113 int bi_phymode[4]; /* phy mode */
114#endif
115} bd_t;
116
117#define bi_tbfreq bi_intfreq
118
119#endif /* __PPCBOOT_H__ */
arch/powerpc/boot/ppcboot.h+1−1
@@ -63,7 +63,7 @@ typedef struct bd_info { · 62 unmodified lines
63#if defined(TARGET_HYMOD)63#if defined(TARGET_HYMOD)
64 hymod_conf_t bi_hymod_conf; /* hymod configuration information */64 hymod_conf_t bi_hymod_conf; /* hymod configuration information */
65#endif65#endif
66#if defined(TARGET_EVB64260) || defined(TARGET_405EP) || defined(TARGET_44x) || \66#if defined(TARGET_EVB64260) || defined(TARGET_44x) || \
67 defined(TARGET_85xx) || defined(TARGET_83xx) || defined(TARGET_HAS_ETH1)67 defined(TARGET_85xx) || defined(TARGET_83xx) || defined(TARGET_HAS_ETH1)
68 /* second onboard ethernet port */68 /* second onboard ethernet port */
69 unsigned char bi_enet1addr[6];69 unsigned char bi_enet1addr[6];
arch/powerpc/boot/wrapper+1−21
@@ -337,7 +337,7 @@ ps3) · 336 unmodified lines
337 make_space=n337 make_space=n
338 pie=338 pie=
339 ;;339 ;;
340ep88xc|ep405|ep8248e)340ep88xc|ep8248e)
341 platformo="$object/fixed-head.o $object/$platform.o"341 platformo="$object/fixed-head.o $object/$platform.o"
342 binary=y342 binary=y
343 ;;343 ;;
@@ -468,26 +468,6 @@ uboot) · 124 unmodified lines
468 fi468 fi
469 exit 0469 exit 0
470 ;;470 ;;
471uboot-obs600)
472 rm -f "$ofile"
473 # obs600 wants a multi image with an initrd, so we need to put a fake
474 # one in even when building a "normal" image.
475 if [ -n "$initrd" ]; then
476 real_rd="$initrd"
477 else
478 real_rd=`mktemp`
479 echo "\0" >>"$real_rd"
480 fi
481 ${MKIMAGE} -A ppc -O linux -T multi -C gzip -a $membase -e $membase \
482 $uboot_version -d "$vmz":"$real_rd":"$dtb" "$ofile"
483 if [ -z "$initrd" ]; then
484 rm -f "$real_rd"
485 fi
486 if [ -z "$cacheit" ]; then
487 rm -f "$vmz"
488 fi
489 exit 0
490 ;;
491esac471esac
492 472
493addsec() {473addsec() {
arch/powerpc/configs/40x.config+0−2
@@ -1,2 +0,0 @@
1CONFIG_PPC64=n
2CONFIG_40x=y
arch/powerpc/configs/40x/acadia_defconfig+0−61
@@ -1,61 +0,0 @@
1CONFIG_40x=y
2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_LOG_BUF_SHIFT=14
5CONFIG_BLK_DEV_INITRD=y
6CONFIG_EXPERT=y
7CONFIG_KALLSYMS_ALL=y
8CONFIG_MODULES=y
9CONFIG_MODULE_UNLOAD=y
10# CONFIG_BLK_DEV_BSG is not set
11CONFIG_ACADIA=y
12CONFIG_PCI=y
13CONFIG_NET=y
14CONFIG_PACKET=y
15CONFIG_UNIX=y
16CONFIG_INET=y
17CONFIG_IP_PNP=y
18CONFIG_IP_PNP_DHCP=y
19CONFIG_IP_PNP_BOOTP=y
20# CONFIG_IPV6 is not set
21CONFIG_CONNECTOR=y
22CONFIG_MTD=y
23CONFIG_MTD_CMDLINE_PARTS=y
24CONFIG_MTD_BLOCK=m
25CONFIG_MTD_CFI=y
26CONFIG_MTD_JEDECPROBE=y
27CONFIG_MTD_CFI_AMDSTD=y
28CONFIG_MTD_PHYSMAP_OF=y
29CONFIG_BLK_DEV_RAM=y
30CONFIG_BLK_DEV_RAM_SIZE=35000
31CONFIG_NETDEVICES=y
32CONFIG_IBM_EMAC=y
33CONFIG_IBM_EMAC_RXB=256
34CONFIG_IBM_EMAC_TXB=256
35CONFIG_IBM_EMAC_DEBUG=y
36# CONFIG_INPUT is not set
37# CONFIG_SERIO is not set
38# CONFIG_VT is not set
39CONFIG_SERIAL_8250=y
40CONFIG_SERIAL_8250_CONSOLE=y
41CONFIG_SERIAL_8250_EXTENDED=y
42CONFIG_SERIAL_8250_SHARE_IRQ=y
43CONFIG_SERIAL_OF_PLATFORM=y
44# CONFIG_HW_RANDOM is not set
45# CONFIG_HWMON is not set
46CONFIG_THERMAL=y
47# CONFIG_USB_SUPPORT is not set
48CONFIG_EXT2_FS=y
49CONFIG_PROC_KCORE=y
50CONFIG_TMPFS=y
51CONFIG_CRAMFS=y
52CONFIG_NFS_FS=y
53CONFIG_ROOT_NFS=y
54CONFIG_DEBUG_FS=y
55CONFIG_MAGIC_SYSRQ=y
56CONFIG_DETECT_HUNG_TASK=y
57CONFIG_CRYPTO_CBC=y
58CONFIG_CRYPTO_ECB=y
59CONFIG_CRYPTO_PCBC=y
60CONFIG_CRYPTO_MD5=y
61CONFIG_CRYPTO_DES=y
arch/powerpc/configs/40x/kilauea_defconfig+0−69
@@ -1,69 +0,0 @@
1CONFIG_40x=y
2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_NO_HZ=y
5CONFIG_HIGH_RES_TIMERS=y
6CONFIG_LOG_BUF_SHIFT=14
7CONFIG_BLK_DEV_INITRD=y
8CONFIG_EXPERT=y
9CONFIG_KALLSYMS_ALL=y
10CONFIG_MODULES=y
11CONFIG_MODULE_UNLOAD=y
12# CONFIG_BLK_DEV_BSG is not set
13CONFIG_KILAUEA=y
14CONFIG_PCI=y
15CONFIG_NET=y
16CONFIG_PACKET=y
17CONFIG_UNIX=y
18CONFIG_INET=y
19CONFIG_IP_PNP=y
20CONFIG_IP_PNP_DHCP=y
21CONFIG_IP_PNP_BOOTP=y
22# CONFIG_IPV6 is not set
23CONFIG_CONNECTOR=y
24CONFIG_MTD=y
25CONFIG_MTD_CMDLINE_PARTS=y
26CONFIG_MTD_BLOCK=y
27CONFIG_MTD_CFI=y
28CONFIG_MTD_JEDECPROBE=y
29CONFIG_MTD_CFI_AMDSTD=y
30CONFIG_MTD_PHYSMAP_OF=y
31CONFIG_MTD_RAW_NAND=y
32CONFIG_MTD_NAND_NDFC=y
33CONFIG_BLK_DEV_RAM=y
34CONFIG_BLK_DEV_RAM_SIZE=35000
35CONFIG_NETDEVICES=y
36CONFIG_IBM_EMAC=y
37CONFIG_IBM_EMAC_RXB=256
38CONFIG_IBM_EMAC_TXB=256
39# CONFIG_INPUT is not set
40# CONFIG_SERIO is not set
41# CONFIG_VT is not set
42CONFIG_SERIAL_8250=y
43CONFIG_SERIAL_8250_CONSOLE=y
44CONFIG_SERIAL_8250_EXTENDED=y
45CONFIG_SERIAL_8250_SHARE_IRQ=y
46CONFIG_SERIAL_OF_PLATFORM=y
47# CONFIG_HW_RANDOM is not set
48CONFIG_I2C=y
49CONFIG_I2C_CHARDEV=y
50CONFIG_I2C_IBM_IIC=y
51CONFIG_SENSORS_LM75=y
52CONFIG_THERMAL=y
53# CONFIG_USB_SUPPORT is not set
54CONFIG_RTC_CLASS=y
55CONFIG_RTC_DRV_DS1307=y
56CONFIG_EXT2_FS=y
57CONFIG_PROC_KCORE=y
58CONFIG_TMPFS=y
59CONFIG_CRAMFS=y
60CONFIG_NFS_FS=y
61CONFIG_ROOT_NFS=y
62CONFIG_DEBUG_FS=y
63CONFIG_MAGIC_SYSRQ=y
64CONFIG_DETECT_HUNG_TASK=y
65CONFIG_CRYPTO_CBC=y
66CONFIG_CRYPTO_ECB=y
67CONFIG_CRYPTO_PCBC=y
68CONFIG_CRYPTO_MD5=y
69CONFIG_CRYPTO_DES=y
arch/powerpc/configs/40x/klondike_defconfig+0−43
@@ -1,43 +0,0 @@
1CONFIG_40x=y
2CONFIG_SYSVIPC=y
3CONFIG_LOG_BUF_SHIFT=14
4CONFIG_SYSFS_DEPRECATED=y
5CONFIG_SYSFS_DEPRECATED_V2=y
6CONFIG_BLK_DEV_INITRD=y
7CONFIG_EXPERT=y
8CONFIG_MODULES=y
9CONFIG_MODULE_UNLOAD=y
10CONFIG_APM8018X=y
11# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
12CONFIG_MATH_EMULATION=y
13# CONFIG_SUSPEND is not set
14CONFIG_BLK_DEV_RAM=y
15CONFIG_BLK_DEV_RAM_SIZE=35000
16CONFIG_SCSI=y
17CONFIG_BLK_DEV_SD=y
18CONFIG_CHR_DEV_SG=y
19CONFIG_SCSI_SAS_ATTRS=y
20# CONFIG_INPUT is not set
21# CONFIG_SERIO is not set
22# CONFIG_VT is not set
23# CONFIG_UNIX98_PTYS is not set
24# CONFIG_LEGACY_PTYS is not set
25# CONFIG_HW_RANDOM is not set
26# CONFIG_HWMON is not set
27# CONFIG_USB_SUPPORT is not set
28# CONFIG_IOMMU_SUPPORT is not set
29CONFIG_EXT2_FS=y
30CONFIG_EXT4_FS=y
31CONFIG_MSDOS_FS=y
32CONFIG_VFAT_FS=y
33CONFIG_PROC_KCORE=y
34CONFIG_TMPFS=y
35CONFIG_CRAMFS=y
36CONFIG_NLS_CODEPAGE_437=y
37CONFIG_NLS_ASCII=y
38CONFIG_NLS_ISO8859_1=y
39CONFIG_NLS_UTF8=y
40CONFIG_MAGIC_SYSRQ=y
41# CONFIG_SCHED_DEBUG is not set
42# CONFIG_DEBUG_BUGVERBOSE is not set
43# CONFIG_FTRACE is not set
arch/powerpc/configs/40x/makalu_defconfig+0−59
@@ -1,59 +0,0 @@
1CONFIG_40x=y
2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_LOG_BUF_SHIFT=14
5CONFIG_BLK_DEV_INITRD=y
6CONFIG_EXPERT=y
7CONFIG_KALLSYMS_ALL=y
8CONFIG_MODULES=y
9CONFIG_MODULE_UNLOAD=y
10# CONFIG_BLK_DEV_BSG is not set
11CONFIG_MAKALU=y
12CONFIG_NET=y
13CONFIG_PACKET=y
14CONFIG_UNIX=y
15CONFIG_INET=y
16CONFIG_IP_PNP=y
17CONFIG_IP_PNP_DHCP=y
18CONFIG_IP_PNP_BOOTP=y
19# CONFIG_IPV6 is not set
20CONFIG_CONNECTOR=y
21CONFIG_MTD=y
22CONFIG_MTD_CMDLINE_PARTS=y
23CONFIG_MTD_BLOCK=m
24CONFIG_MTD_CFI=y
25CONFIG_MTD_JEDECPROBE=y
26CONFIG_MTD_CFI_AMDSTD=y
27CONFIG_MTD_PHYSMAP_OF=y
28CONFIG_BLK_DEV_RAM=y
29CONFIG_BLK_DEV_RAM_SIZE=35000
30CONFIG_NETDEVICES=y
31CONFIG_IBM_EMAC=y
32CONFIG_IBM_EMAC_RXB=256
33CONFIG_IBM_EMAC_TXB=256
34# CONFIG_INPUT is not set
35# CONFIG_SERIO is not set
36# CONFIG_VT is not set
37CONFIG_SERIAL_8250=y
38CONFIG_SERIAL_8250_CONSOLE=y
39CONFIG_SERIAL_8250_EXTENDED=y
40CONFIG_SERIAL_8250_SHARE_IRQ=y
41CONFIG_SERIAL_OF_PLATFORM=y
42# CONFIG_HW_RANDOM is not set
43# CONFIG_HWMON is not set
44CONFIG_THERMAL=y
45# CONFIG_USB_SUPPORT is not set
46CONFIG_EXT2_FS=y
47CONFIG_PROC_KCORE=y
48CONFIG_TMPFS=y
49CONFIG_CRAMFS=y
50CONFIG_NFS_FS=y
51CONFIG_ROOT_NFS=y
52CONFIG_DEBUG_FS=y
53CONFIG_MAGIC_SYSRQ=y
54CONFIG_DETECT_HUNG_TASK=y
55CONFIG_CRYPTO_CBC=y
56CONFIG_CRYPTO_ECB=y
57CONFIG_CRYPTO_PCBC=y
58CONFIG_CRYPTO_MD5=y
59CONFIG_CRYPTO_DES=y
arch/powerpc/configs/40x/obs600_defconfig+0−69
@@ -1,69 +0,0 @@
1CONFIG_40x=y
2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_NO_HZ=y
5CONFIG_HIGH_RES_TIMERS=y
6CONFIG_LOG_BUF_SHIFT=14
7CONFIG_BLK_DEV_INITRD=y
8CONFIG_EXPERT=y
9CONFIG_KALLSYMS_ALL=y
10CONFIG_MODULES=y
11CONFIG_MODULE_UNLOAD=y
12# CONFIG_BLK_DEV_BSG is not set
13CONFIG_OBS600=y
14CONFIG_MATH_EMULATION=y
15CONFIG_NET=y
16CONFIG_PACKET=y
17CONFIG_UNIX=y
18CONFIG_INET=y
19CONFIG_IP_PNP=y
20CONFIG_IP_PNP_DHCP=y
21CONFIG_IP_PNP_BOOTP=y
22# CONFIG_IPV6 is not set
23CONFIG_CONNECTOR=y
24CONFIG_MTD=y
25CONFIG_MTD_CMDLINE_PARTS=y
26CONFIG_MTD_BLOCK=y
27CONFIG_MTD_CFI=y
28CONFIG_MTD_JEDECPROBE=y
29CONFIG_MTD_CFI_AMDSTD=y
30CONFIG_MTD_PHYSMAP_OF=y
31CONFIG_MTD_RAW_NAND=y
32CONFIG_MTD_NAND_NDFC=y
33CONFIG_BLK_DEV_RAM=y
34CONFIG_BLK_DEV_RAM_SIZE=35000
35CONFIG_NETDEVICES=y
36CONFIG_IBM_EMAC=y
37CONFIG_IBM_EMAC_RXB=256
38CONFIG_IBM_EMAC_TXB=256
39# CONFIG_INPUT is not set
40# CONFIG_SERIO is not set
41# CONFIG_VT is not set
42CONFIG_SERIAL_8250=y
43CONFIG_SERIAL_8250_CONSOLE=y
44CONFIG_SERIAL_8250_EXTENDED=y
45CONFIG_SERIAL_8250_SHARE_IRQ=y
46CONFIG_SERIAL_OF_PLATFORM=y
47# CONFIG_HW_RANDOM is not set
48CONFIG_I2C=y
49CONFIG_I2C_CHARDEV=y
50CONFIG_I2C_IBM_IIC=y
51CONFIG_SENSORS_LM75=y
52CONFIG_THERMAL=y
53# CONFIG_USB_SUPPORT is not set
54CONFIG_RTC_CLASS=y
55CONFIG_RTC_DRV_DS1307=y
56CONFIG_EXT2_FS=y
57CONFIG_PROC_KCORE=y
58CONFIG_TMPFS=y
59CONFIG_CRAMFS=y
60CONFIG_NFS_FS=y
61CONFIG_ROOT_NFS=y
62CONFIG_DEBUG_FS=y
63CONFIG_MAGIC_SYSRQ=y
64CONFIG_DETECT_HUNG_TASK=y
65CONFIG_CRYPTO_CBC=y
66CONFIG_CRYPTO_ECB=y
67CONFIG_CRYPTO_PCBC=y
68CONFIG_CRYPTO_MD5=y
69CONFIG_CRYPTO_DES=y
arch/powerpc/configs/40x/walnut_defconfig+0−55
@@ -1,55 +0,0 @@
1CONFIG_40x=y
2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_LOG_BUF_SHIFT=14
5CONFIG_BLK_DEV_INITRD=y
6CONFIG_EXPERT=y
7CONFIG_KALLSYMS_ALL=y
8CONFIG_MODULES=y
9CONFIG_MODULE_UNLOAD=y
10# CONFIG_BLK_DEV_BSG is not set
11CONFIG_NET=y
12CONFIG_PACKET=y
13CONFIG_UNIX=y
14CONFIG_INET=y
15CONFIG_IP_PNP=y
16CONFIG_IP_PNP_DHCP=y
17CONFIG_IP_PNP_BOOTP=y
18# CONFIG_IPV6 is not set
19CONFIG_CONNECTOR=y
20CONFIG_MTD=y
21CONFIG_MTD_CMDLINE_PARTS=y
22CONFIG_MTD_BLOCK=m
23CONFIG_MTD_CFI=y
24CONFIG_MTD_JEDECPROBE=y
25CONFIG_MTD_CFI_AMDSTD=y
26CONFIG_MTD_PHYSMAP_OF=y
27CONFIG_BLK_DEV_RAM=y
28CONFIG_BLK_DEV_RAM_SIZE=35000
29CONFIG_NETDEVICES=y
30CONFIG_IBM_EMAC=y
31# CONFIG_INPUT is not set
32# CONFIG_SERIO is not set
33# CONFIG_VT is not set
34CONFIG_SERIAL_8250=y
35CONFIG_SERIAL_8250_CONSOLE=y
36CONFIG_SERIAL_8250_EXTENDED=y
37CONFIG_SERIAL_8250_SHARE_IRQ=y
38CONFIG_SERIAL_OF_PLATFORM=y
39# CONFIG_HW_RANDOM is not set
40# CONFIG_HWMON is not set
41CONFIG_THERMAL=y
42CONFIG_EXT2_FS=y
43CONFIG_PROC_KCORE=y
44CONFIG_TMPFS=y
45CONFIG_CRAMFS=y
46CONFIG_NFS_FS=y
47CONFIG_ROOT_NFS=y
48CONFIG_DEBUG_FS=y
49CONFIG_MAGIC_SYSRQ=y
50CONFIG_DETECT_HUNG_TASK=y
51CONFIG_CRYPTO_CBC=y
52CONFIG_CRYPTO_ECB=y
53CONFIG_CRYPTO_PCBC=y
54CONFIG_CRYPTO_MD5=y
55CONFIG_CRYPTO_DES=y
arch/powerpc/configs/85xx-hw.config+2−0
@@ -24,6 +24,7 @@ CONFIG_FS_ENET=y · 23 unmodified lines
24CONFIG_FSL_CORENET_CF=y24CONFIG_FSL_CORENET_CF=y
25CONFIG_FSL_DMA=y25CONFIG_FSL_DMA=y
26CONFIG_FSL_HV_MANAGER=y26CONFIG_FSL_HV_MANAGER=y
27CONFIG_FSL_IFC=y
27CONFIG_FSL_PQ_MDIO=y28CONFIG_FSL_PQ_MDIO=y
28CONFIG_FSL_RIO=y29CONFIG_FSL_RIO=y
29CONFIG_FSL_XGMAC_MDIO=y30CONFIG_FSL_XGMAC_MDIO=y
@@ -58,6 +59,7 @@ CONFIG_INPUT_FF_MEMLESS=m · 28 unmodified lines
58CONFIG_MARVELL_PHY=y59CONFIG_MARVELL_PHY=y
59CONFIG_MDIO_BUS_MUX_GPIO=y60CONFIG_MDIO_BUS_MUX_GPIO=y
60CONFIG_MDIO_BUS_MUX_MMIOREG=y61CONFIG_MDIO_BUS_MUX_MMIOREG=y
62CONFIG_MEMORY=y
61CONFIG_MMC_SDHCI_OF_ESDHC=y63CONFIG_MMC_SDHCI_OF_ESDHC=y
62CONFIG_MMC_SDHCI_PLTFM=y64CONFIG_MMC_SDHCI_PLTFM=y
63CONFIG_MMC_SDHCI=y65CONFIG_MMC_SDHCI=y
arch/powerpc/configs/ppc40x_defconfig+0−74
@@ -1,74 +0,0 @@
1CONFIG_40x=y
2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_LOG_BUF_SHIFT=14
5CONFIG_BLK_DEV_INITRD=y
6CONFIG_EXPERT=y
7CONFIG_KALLSYMS_ALL=y
8CONFIG_MODULES=y
9CONFIG_MODULE_UNLOAD=y
10# CONFIG_BLK_DEV_BSG is not set
11CONFIG_PPC4xx_GPIO=y
12CONFIG_ACADIA=y
13CONFIG_HOTFOOT=y
14CONFIG_KILAUEA=y
15CONFIG_MAKALU=y
16CONFIG_NET=y
17CONFIG_PACKET=y
18CONFIG_UNIX=y
19CONFIG_INET=y
20CONFIG_IP_PNP=y
21CONFIG_IP_PNP_DHCP=y
22CONFIG_IP_PNP_BOOTP=y
23CONFIG_CONNECTOR=y
24CONFIG_MTD=y
25CONFIG_MTD_CMDLINE_PARTS=y
26CONFIG_MTD_BLOCK=m
27CONFIG_MTD_CFI=y
28CONFIG_MTD_JEDECPROBE=y
29CONFIG_MTD_CFI_AMDSTD=y
30CONFIG_MTD_PHYSMAP_OF=y
31CONFIG_MTD_UBI=m
32CONFIG_MTD_UBI_GLUEBI=m
33CONFIG_BLK_DEV_RAM=y
34CONFIG_BLK_DEV_RAM_SIZE=35000
35CONFIG_NETDEVICES=y
36CONFIG_IBM_EMAC=y
37# CONFIG_INPUT is not set
38CONFIG_SERIO=m
39# CONFIG_SERIO_I8042 is not set
40# CONFIG_SERIO_SERPORT is not set
41# CONFIG_VT is not set
42CONFIG_SERIAL_8250=y
43CONFIG_SERIAL_8250_CONSOLE=y
44CONFIG_SERIAL_8250_EXTENDED=y
45CONFIG_SERIAL_8250_SHARE_IRQ=y
46CONFIG_SERIAL_OF_PLATFORM=y
47# CONFIG_HW_RANDOM is not set
48CONFIG_I2C=m
49CONFIG_I2C_CHARDEV=m
50CONFIG_I2C_GPIO=m
51CONFIG_I2C_IBM_IIC=m
52# CONFIG_HWMON is not set
53CONFIG_THERMAL=y
54CONFIG_FB=m
55CONFIG_EXT2_FS=y
56CONFIG_EXT4_FS=m
57CONFIG_VFAT_FS=m
58CONFIG_PROC_KCORE=y
59CONFIG_TMPFS=y
60CONFIG_JFFS2_FS=m
61CONFIG_UBIFS_FS=m
62CONFIG_CRAMFS=y
63CONFIG_NFS_FS=y
64CONFIG_ROOT_NFS=y
65CONFIG_NLS_CODEPAGE_437=m
66CONFIG_NLS_ISO8859_1=m
67CONFIG_DEBUG_FS=y
68CONFIG_MAGIC_SYSRQ=y
69CONFIG_DETECT_HUNG_TASK=y
70CONFIG_CRYPTO_CBC=y
71CONFIG_CRYPTO_ECB=y
72CONFIG_CRYPTO_PCBC=y
73CONFIG_CRYPTO_MD5=y
74CONFIG_CRYPTO_DES=y
arch/powerpc/configs/ppc6xx_defconfig+0−1
@@ -12,7 +12,6 @@ CONFIG_TASK_XACCT=y · 11 unmodified lines
12CONFIG_TASK_IO_ACCOUNTING=y12CONFIG_TASK_IO_ACCOUNTING=y
13CONFIG_CGROUPS=y13CONFIG_CGROUPS=y
14CONFIG_CGROUP_SCHED=y14CONFIG_CGROUP_SCHED=y
15CONFIG_RT_GROUP_SCHED=y
16CONFIG_CGROUP_DEVICE=y15CONFIG_CGROUP_DEVICE=y
17CONFIG_CGROUP_CPUACCT=y16CONFIG_CGROUP_CPUACCT=y
18CONFIG_USER_NS=y17CONFIG_USER_NS=y
arch/powerpc/include/asm/cacheflush.h+1−1
@@ -121,7 +121,7 @@ static inline void invalidate_dcache_range(unsigned long start, · 120 unmodified lines
121 mb(); /* sync */121 mb(); /* sync */
122}122}
123 123
124#ifdef CONFIG_4xx124#ifdef CONFIG_44x
125static inline void flush_instruction_cache(void)125static inline void flush_instruction_cache(void)
126{126{
127 iccci((void *)KERNELBASE);127 iccci((void *)KERNELBASE);
arch/powerpc/include/asm/cpu_has_feature.h+1−2
@@ -24,9 +24,8 @@ static __always_inline bool cpu_has_feature(unsigned long feature) · 23 unmodified lines
24{24{
25 int i;25 int i;
26 26
27#ifndef __clang__ /* clang can't cope with this */
28 BUILD_BUG_ON(!__builtin_constant_p(feature));27 BUILD_BUG_ON(!__builtin_constant_p(feature));
29#endif28 BUILD_BUG_ON(__builtin_popcountl(feature) > 1);
30 29
31#ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG30#ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG
32 if (!static_key_feature_checks_initialized) {31 if (!static_key_feature_checks_initialized) {
arch/powerpc/include/asm/cputable.h+0−7
@@ -353,7 +353,6 @@ static inline void cpu_feature_keys_init(void) { } · 352 unmodified lines
353 CPU_FTR_COMMON | CPU_FTR_FPU_UNAVAILABLE | CPU_FTR_NOEXECUTE)353 CPU_FTR_COMMON | CPU_FTR_FPU_UNAVAILABLE | CPU_FTR_NOEXECUTE)
354#define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON)354#define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON)
355#define CPU_FTRS_8XX (CPU_FTR_NOEXECUTE)355#define CPU_FTRS_8XX (CPU_FTR_NOEXECUTE)
356#define CPU_FTRS_40X (CPU_FTR_NOEXECUTE)
357#define CPU_FTRS_44X (CPU_FTR_NOEXECUTE)356#define CPU_FTRS_44X (CPU_FTR_NOEXECUTE)
358#define CPU_FTRS_440x6 (CPU_FTR_NOEXECUTE | \357#define CPU_FTRS_440x6 (CPU_FTR_NOEXECUTE | \
359 CPU_FTR_INDEXED_DCR)358 CPU_FTR_INDEXED_DCR)
@@ -507,9 +506,6 @@ enum { · 147 unmodified lines
507#ifdef CONFIG_PPC_8xx506#ifdef CONFIG_PPC_8xx
508 CPU_FTRS_8XX |507 CPU_FTRS_8XX |
509#endif508#endif
510#ifdef CONFIG_40x
511 CPU_FTRS_40X |
512#endif
513#ifdef CONFIG_PPC_47x509#ifdef CONFIG_PPC_47x
514 CPU_FTRS_47X | CPU_FTR_476_DD2 |510 CPU_FTRS_47X | CPU_FTR_476_DD2 |
515#elif defined(CONFIG_44x)511#elif defined(CONFIG_44x)
@@ -582,9 +578,6 @@ enum { · 66 unmodified lines
582#ifdef CONFIG_PPC_8xx578#ifdef CONFIG_PPC_8xx
583 CPU_FTRS_8XX &579 CPU_FTRS_8XX &
584#endif580#endif
585#ifdef CONFIG_40x
586 CPU_FTRS_40X &
587#endif
588#ifdef CONFIG_PPC_47x581#ifdef CONFIG_PPC_47x
589 CPU_FTRS_47X &582 CPU_FTRS_47X &
590#elif defined(CONFIG_44x)583#elif defined(CONFIG_44x)
arch/powerpc/include/asm/guest-state-buffer.h+2−1
@@ -81,6 +81,7 @@ · 80 unmodified lines
81#define KVMPPC_GSID_HASHKEYR 0x105081#define KVMPPC_GSID_HASHKEYR 0x1050
82#define KVMPPC_GSID_HASHPKEYR 0x105182#define KVMPPC_GSID_HASHPKEYR 0x1051
83#define KVMPPC_GSID_CTRL 0x105283#define KVMPPC_GSID_CTRL 0x1052
84#define KVMPPC_GSID_DPDES 0x1053
84 85
85#define KVMPPC_GSID_CR 0x200086#define KVMPPC_GSID_CR 0x2000
86#define KVMPPC_GSID_PIDR 0x200187#define KVMPPC_GSID_PIDR 0x2001
@@ -110,7 +111,7 @@ · 23 unmodified lines
110#define KVMPPC_GSE_META_COUNT (KVMPPC_GSE_META_END - KVMPPC_GSE_META_START + 1)111#define KVMPPC_GSE_META_COUNT (KVMPPC_GSE_META_END - KVMPPC_GSE_META_START + 1)
111 112
112#define KVMPPC_GSE_DW_REGS_START KVMPPC_GSID_GPR(0)113#define KVMPPC_GSE_DW_REGS_START KVMPPC_GSID_GPR(0)
113#define KVMPPC_GSE_DW_REGS_END KVMPPC_GSID_CTRL114#define KVMPPC_GSE_DW_REGS_END KVMPPC_GSID_DPDES
114#define KVMPPC_GSE_DW_REGS_COUNT \115#define KVMPPC_GSE_DW_REGS_COUNT \
115 (KVMPPC_GSE_DW_REGS_END - KVMPPC_GSE_DW_REGS_START + 1)116 (KVMPPC_GSE_DW_REGS_END - KVMPPC_GSE_DW_REGS_START + 1)
116 117
arch/powerpc/include/asm/hw_irq.h+4−4
@@ -63,7 +63,7 @@ · 62 unmodified lines
63 63
64static inline void __hard_irq_enable(void)64static inline void __hard_irq_enable(void)
65{65{
66 if (IS_ENABLED(CONFIG_BOOKE_OR_40x))66 if (IS_ENABLED(CONFIG_BOOKE))
67 wrtee(MSR_EE);67 wrtee(MSR_EE);
68 else if (IS_ENABLED(CONFIG_PPC_8xx))68 else if (IS_ENABLED(CONFIG_PPC_8xx))
69 wrtspr(SPRN_EIE);69 wrtspr(SPRN_EIE);
@@ -75,7 +75,7 @@ static inline void __hard_irq_enable(void) · 5 unmodified lines
75 75
76static inline void __hard_irq_disable(void)76static inline void __hard_irq_disable(void)
77{77{
78 if (IS_ENABLED(CONFIG_BOOKE_OR_40x))78 if (IS_ENABLED(CONFIG_BOOKE))
79 wrtee(0);79 wrtee(0);
80 else if (IS_ENABLED(CONFIG_PPC_8xx))80 else if (IS_ENABLED(CONFIG_PPC_8xx))
81 wrtspr(SPRN_EID);81 wrtspr(SPRN_EID);
@@ -87,7 +87,7 @@ static inline void __hard_irq_disable(void) · 5 unmodified lines
87 87
88static inline void __hard_EE_RI_disable(void)88static inline void __hard_EE_RI_disable(void)
89{89{
90 if (IS_ENABLED(CONFIG_BOOKE_OR_40x))90 if (IS_ENABLED(CONFIG_BOOKE))
91 wrtee(0);91 wrtee(0);
92 else if (IS_ENABLED(CONFIG_PPC_8xx))92 else if (IS_ENABLED(CONFIG_PPC_8xx))
93 wrtspr(SPRN_NRI);93 wrtspr(SPRN_NRI);
@@ -99,7 +99,7 @@ static inline void __hard_EE_RI_disable(void) · 5 unmodified lines
99 99
100static inline void __hard_RI_enable(void)100static inline void __hard_RI_enable(void)
101{101{
102 if (IS_ENABLED(CONFIG_BOOKE_OR_40x))102 if (IS_ENABLED(CONFIG_BOOKE))
103 return;103 return;
104 104
105 if (IS_ENABLED(CONFIG_PPC_8xx))105 if (IS_ENABLED(CONFIG_PPC_8xx))
arch/powerpc/include/asm/iommu.h+13−3
@@ -31,6 +31,8 @@ · 30 unmodified lines
31#define DIRECT64_PROPNAME "linux,direct64-ddr-window-info"31#define DIRECT64_PROPNAME "linux,direct64-ddr-window-info"
32#define DMA64_PROPNAME "linux,dma64-ddr-window-info"32#define DMA64_PROPNAME "linux,dma64-ddr-window-info"
33 33
34#define MIN_DDW_VPMEM_DMA_WINDOW SZ_2G
35
34/* Boot time flags */36/* Boot time flags */
35extern int iommu_is_off;37extern int iommu_is_off;
36extern int iommu_force_on;38extern int iommu_force_on;
@@ -156,6 +158,9 @@ extern int iommu_tce_table_put(struct iommu_table *tbl); · 119 unmodified lines
156extern struct iommu_table *iommu_init_table(struct iommu_table *tbl,158extern struct iommu_table *iommu_init_table(struct iommu_table *tbl,
157 int nid, unsigned long res_start, unsigned long res_end);159 int nid, unsigned long res_start, unsigned long res_end);
158bool iommu_table_in_use(struct iommu_table *tbl);160bool iommu_table_in_use(struct iommu_table *tbl);
161extern void iommu_table_reserve_pages(struct iommu_table *tbl,
162 unsigned long res_start, unsigned long res_end);
163extern void iommu_table_clear(struct iommu_table *tbl);
159 164
160#define IOMMU_TABLE_GROUP_MAX_TABLES 2165#define IOMMU_TABLE_GROUP_MAX_TABLES 2
161 166
@@ -178,9 +183,9 @@ struct iommu_table_group_ops { · 16 unmodified lines
178 long (*unset_window)(struct iommu_table_group *table_group,183 long (*unset_window)(struct iommu_table_group *table_group,
179 int num);184 int num);
180 /* Switch ownership from platform code to external user (e.g. VFIO) */185 /* Switch ownership from platform code to external user (e.g. VFIO) */
181 long (*take_ownership)(struct iommu_table_group *table_group);186 long (*take_ownership)(struct iommu_table_group *table_group, struct device *dev);
182 /* Switch ownership from external user (e.g. VFIO) back to core */187 /* Switch ownership from external user (e.g. VFIO) back to core */
183 void (*release_ownership)(struct iommu_table_group *table_group);188 void (*release_ownership)(struct iommu_table_group *table_group, struct device *dev);
184};189};
185 190
186struct iommu_table_group_link {191struct iommu_table_group_link {
@@ -217,8 +222,8 @@ extern long iommu_tce_xchg_no_kill(struct mm_struct *mm, · 30 unmodified lines
217 enum dma_data_direction *direction);222 enum dma_data_direction *direction);
218extern void iommu_tce_kill(struct iommu_table *tbl,223extern void iommu_tce_kill(struct iommu_table *tbl,
219 unsigned long entry, unsigned long pages);224 unsigned long entry, unsigned long pages);
225int dev_has_iommu_table(struct device *dev, void *data);
220 226
221extern struct iommu_table_group_ops spapr_tce_table_group_ops;
222#else227#else
223static inline void iommu_register_group(struct iommu_table_group *table_group,228static inline void iommu_register_group(struct iommu_table_group *table_group,
224 int pci_domain_number,229 int pci_domain_number,
@@ -231,6 +236,11 @@ static inline int iommu_add_device(struct iommu_table_group *table_group, · 6 unmodified lines
231{236{
232 return 0;237 return 0;
233}238}
239
240static inline int dev_has_iommu_table(struct device *dev, void *data)
241{
242 return 0;
243}
234#endif /* !CONFIG_IOMMU_API */244#endif /* !CONFIG_IOMMU_API */
235 245
236u64 dma_iommu_get_required_mask(struct device *dev);246u64 dma_iommu_get_required_mask(struct device *dev);
arch/powerpc/include/asm/irq.h+1−1
@@ -33,7 +33,7 @@ extern int distribute_irqs; · 32 unmodified lines
33 33
34struct pt_regs;34struct pt_regs;
35 35
36#ifdef CONFIG_BOOKE_OR_40x36#ifdef CONFIG_BOOKE
37/*37/*
38 * Per-cpu stacks for handling critical, debug and machine check38 * Per-cpu stacks for handling critical, debug and machine check
39 * level interrupts.39 * level interrupts.
arch/powerpc/include/asm/kexec.h+2−4
@@ -103,10 +103,8 @@ int load_crashdump_segments_ppc64(struct kimage *image, · 102 unmodified lines
103int setup_purgatory_ppc64(struct kimage *image, const void *slave_code,103int setup_purgatory_ppc64(struct kimage *image, const void *slave_code,
104 const void *fdt, unsigned long kernel_load_addr,104 const void *fdt, unsigned long kernel_load_addr,
105 unsigned long fdt_load_addr);105 unsigned long fdt_load_addr);
106unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image);106unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image, struct crash_mem *rmem);
107int setup_new_fdt_ppc64(const struct kimage *image, void *fdt,107int setup_new_fdt_ppc64(const struct kimage *image, void *fdt, struct crash_mem *rmem);
108 unsigned long initrd_load_addr,
109 unsigned long initrd_len, const char *cmdline);
110#endif /* CONFIG_PPC64 */108#endif /* CONFIG_PPC64 */
111 109
112#endif /* CONFIG_KEXEC_FILE */110#endif /* CONFIG_KEXEC_FILE */
arch/powerpc/include/asm/kfence.h+10−1
@@ -15,10 +15,19 @@ · 14 unmodified lines
15#define ARCH_FUNC_PREFIX "."15#define ARCH_FUNC_PREFIX "."
16#endif16#endif
17 17
18#ifdef CONFIG_KFENCE
19extern bool kfence_disabled;
20
21static inline void disable_kfence(void)
22{
23 kfence_disabled = true;
24}
25
18static inline bool arch_kfence_init_pool(void)26static inline bool arch_kfence_init_pool(void)
19{27{
20 return true;28 return !kfence_disabled;
21}29}
30#endif
22 31
23#ifdef CONFIG_PPC6432#ifdef CONFIG_PPC64
24static inline bool kfence_protect_page(unsigned long addr, bool protect)33static inline bool kfence_protect_page(unsigned long addr, bool protect)
arch/powerpc/include/asm/kup.h+1−1
@@ -20,7 +20,7 @@ static __always_inline bool kuap_is_disabled(void); · 19 unmodified lines
20#include <asm/nohash/32/kup-8xx.h>20#include <asm/nohash/32/kup-8xx.h>
21#endif21#endif
22 22
23#ifdef CONFIG_BOOKE_OR_40x23#ifdef CONFIG_BOOKE
24#include <asm/nohash/kup-booke.h>24#include <asm/nohash/kup-booke.h>
25#endif25#endif
26 26
arch/powerpc/include/asm/kvm_book3s.h+1−0
@@ -594,6 +594,7 @@ static inline u##size kvmppc_get_##reg(struct kvm_vcpu *vcpu) \ · 593 unmodified lines
594 594
595 595
596KVMPPC_BOOK3S_VCORE_ACCESSOR(vtb, 64, KVMPPC_GSID_VTB)596KVMPPC_BOOK3S_VCORE_ACCESSOR(vtb, 64, KVMPPC_GSID_VTB)
597KVMPPC_BOOK3S_VCORE_ACCESSOR(dpdes, 64, KVMPPC_GSID_DPDES)
597KVMPPC_BOOK3S_VCORE_ACCESSOR_GET(arch_compat, 32, KVMPPC_GSID_LOGICAL_PVR)598KVMPPC_BOOK3S_VCORE_ACCESSOR_GET(arch_compat, 32, KVMPPC_GSID_LOGICAL_PVR)
598KVMPPC_BOOK3S_VCORE_ACCESSOR_GET(lpcr, 64, KVMPPC_GSID_LPCR)599KVMPPC_BOOK3S_VCORE_ACCESSOR_GET(lpcr, 64, KVMPPC_GSID_LPCR)
599KVMPPC_BOOK3S_VCORE_ACCESSOR_SET(tb_offset, 64, KVMPPC_GSID_TB_OFFSET)600KVMPPC_BOOK3S_VCORE_ACCESSOR_SET(tb_offset, 64, KVMPPC_GSID_TB_OFFSET)
arch/powerpc/include/asm/kvm_book3s_64.h+5−0
@@ -684,6 +684,11 @@ int kvmhv_nestedv2_set_ptbl_entry(unsigned long lpid, u64 dw0, u64 dw1); · 683 unmodified lines
684int kvmhv_nestedv2_parse_output(struct kvm_vcpu *vcpu);684int kvmhv_nestedv2_parse_output(struct kvm_vcpu *vcpu);
685int kvmhv_nestedv2_set_vpa(struct kvm_vcpu *vcpu, unsigned long vpa);685int kvmhv_nestedv2_set_vpa(struct kvm_vcpu *vcpu, unsigned long vpa);
686 686
687int kmvhv_counters_tracepoint_regfunc(void);
688void kmvhv_counters_tracepoint_unregfunc(void);
689int kvmhv_get_l2_counters_status(void);
690void kvmhv_set_l2_counters_status(int cpu, bool status);
691
687#endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */692#endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */
688 693
689#endif /* __ASM_KVM_BOOK3S_64_H__ */694#endif /* __ASM_KVM_BOOK3S_64_H__ */
arch/powerpc/include/asm/kvm_host.h+3−0
@@ -599,6 +599,9 @@ struct kvm_vcpu_arch { · 598 unmodified lines
599 ulong dawrx0;599 ulong dawrx0;
600 ulong dawr1;600 ulong dawr1;
601 ulong dawrx1;601 ulong dawrx1;
602 ulong dexcr;
603 ulong hashkeyr;
604 ulong hashpkeyr;
602 ulong ciabr;605 ulong ciabr;
603 ulong cfar;606 ulong cfar;
604 ulong ppr;607 ulong ppr;
arch/powerpc/include/asm/lppaca.h+8−3
@@ -62,7 +62,8 @@ struct lppaca { · 61 unmodified lines
62 u8 donate_dedicated_cpu; /* Donate dedicated CPU cycles */62 u8 donate_dedicated_cpu; /* Donate dedicated CPU cycles */
63 u8 fpregs_in_use;63 u8 fpregs_in_use;
64 u8 pmcregs_in_use;64 u8 pmcregs_in_use;
65 u8 reserved8[28];65 u8 l2_counters_enable; /* Enable usage of counters for KVM guest */
66 u8 reserved8[27];
66 __be64 wait_state_cycles; /* Wait cycles for this proc */67 __be64 wait_state_cycles; /* Wait cycles for this proc */
67 u8 reserved9[28];68 u8 reserved9[28];
68 __be16 slb_count; /* # of SLBs to maintain */69 __be16 slb_count; /* # of SLBs to maintain */
@@ -92,9 +93,13 @@ struct lppaca { · 23 unmodified lines
92 /* cacheline 4-5 */93 /* cacheline 4-5 */
93 94
94 __be32 page_ins; /* CMO Hint - # page ins by OS */95 __be32 page_ins; /* CMO Hint - # page ins by OS */
95 u8 reserved12[148];96 u8 reserved12[28];
97 volatile __be64 l1_to_l2_cs_tb;
98 volatile __be64 l2_to_l1_cs_tb;
99 volatile __be64 l2_runtime_tb;
100 u8 reserved13[96];
96 volatile __be64 dtl_idx; /* Dispatch Trace Log head index */101 volatile __be64 dtl_idx; /* Dispatch Trace Log head index */
97 u8 reserved13[96];102 u8 reserved14[96];
98} ____cacheline_aligned;103} ____cacheline_aligned;
99 104
100#define lppaca_of(cpu) (*paca_ptrs[cpu]->lppaca_ptr)105#define lppaca_of(cpu) (*paca_ptrs[cpu]->lppaca_ptr)
arch/powerpc/include/asm/mmu.h+1−9
@@ -16,7 +16,6 @@ · 15 unmodified lines
16 */16 */
17#define MMU_FTR_HPTE_TABLE ASM_CONST(0x00000001)17#define MMU_FTR_HPTE_TABLE ASM_CONST(0x00000001)
18#define MMU_FTR_TYPE_8xx ASM_CONST(0x00000002)18#define MMU_FTR_TYPE_8xx ASM_CONST(0x00000002)
19#define MMU_FTR_TYPE_40x ASM_CONST(0x00000004)
20#define MMU_FTR_TYPE_44x ASM_CONST(0x00000008)19#define MMU_FTR_TYPE_44x ASM_CONST(0x00000008)
21#define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010)20#define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010)
22#define MMU_FTR_TYPE_47x ASM_CONST(0x00000020)21#define MMU_FTR_TYPE_47x ASM_CONST(0x00000020)
@@ -153,9 +152,6 @@ enum { · 130 unmodified lines
153#ifdef CONFIG_PPC_8xx152#ifdef CONFIG_PPC_8xx
154 MMU_FTR_TYPE_8xx |153 MMU_FTR_TYPE_8xx |
155#endif154#endif
156#ifdef CONFIG_40x
157 MMU_FTR_TYPE_40x |
158#endif
159#ifdef CONFIG_PPC_47x155#ifdef CONFIG_PPC_47x
160 MMU_FTR_TYPE_47x | MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL |156 MMU_FTR_TYPE_47x | MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL |
161#elif defined(CONFIG_44x)157#elif defined(CONFIG_44x)
@@ -202,9 +198,6 @@ enum { · 40 unmodified lines
202#ifdef CONFIG_PPC_8xx198#ifdef CONFIG_PPC_8xx
203#define MMU_FTRS_ALWAYS MMU_FTR_TYPE_8xx199#define MMU_FTRS_ALWAYS MMU_FTR_TYPE_8xx
204#endif200#endif
205#ifdef CONFIG_40x
206#define MMU_FTRS_ALWAYS MMU_FTR_TYPE_40x
207#endif
208#ifdef CONFIG_PPC_47x201#ifdef CONFIG_PPC_47x
209#define MMU_FTRS_ALWAYS MMU_FTR_TYPE_47x202#define MMU_FTRS_ALWAYS MMU_FTR_TYPE_47x
210#elif defined(CONFIG_44x)203#elif defined(CONFIG_44x)
@@ -246,9 +239,8 @@ static __always_inline bool mmu_has_feature(unsigned long feature) · 35 unmodified lines
246{239{
247 int i;240 int i;
248 241
249#ifndef __clang__ /* clang can't cope with this */
250 BUILD_BUG_ON(!__builtin_constant_p(feature));242 BUILD_BUG_ON(!__builtin_constant_p(feature));
251#endif243 BUILD_BUG_ON(__builtin_popcountl(feature) > 1);
252 244
253#ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG245#ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG
254 if (!static_key_feature_checks_initialized) {246 if (!static_key_feature_checks_initialized) {
arch/powerpc/include/asm/nohash/32/mmu-40x.h+0−68
@@ -1,68 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_POWERPC_MMU_40X_H_
3#define _ASM_POWERPC_MMU_40X_H_
4
5/*
6 * PPC40x support
7 */
8
9#define PPC40X_TLB_SIZE 64
10
11/*
12 * TLB entries are defined by a "high" tag portion and a "low" data
13 * portion. On all architectures, the data portion is 32-bits.
14 *
15 * TLB entries are managed entirely under software control by reading,
16 * writing, and searchoing using the 4xx-specific tlbre, tlbwr, and tlbsx
17 * instructions.
18 */
19
20#define TLB_LO 1
21#define TLB_HI 0
22
23#define TLB_DATA TLB_LO
24#define TLB_TAG TLB_HI
25
26/* Tag portion */
27
28#define TLB_EPN_MASK 0xFFFFFC00 /* Effective Page Number */
29#define TLB_PAGESZ_MASK 0x00000380
30#define TLB_PAGESZ(x) (((x) & 0x7) << 7)
31#define PAGESZ_1K 0
32#define PAGESZ_4K 1
33#define PAGESZ_16K 2
34#define PAGESZ_64K 3
35#define PAGESZ_256K 4
36#define PAGESZ_1M 5
37#define PAGESZ_4M 6
38#define PAGESZ_16M 7
39#define TLB_VALID 0x00000040 /* Entry is valid */
40
41/* Data portion */
42
43#define TLB_RPN_MASK 0xFFFFFC00 /* Real Page Number */
44#define TLB_PERM_MASK 0x00000300
45#define TLB_EX 0x00000200 /* Instruction execution allowed */
46#define TLB_WR 0x00000100 /* Writes permitted */
47#define TLB_ZSEL_MASK 0x000000F0
48#define TLB_ZSEL(x) (((x) & 0xF) << 4)
49#define TLB_ATTR_MASK 0x0000000F
50#define TLB_W 0x00000008 /* Caching is write-through */
51#define TLB_I 0x00000004 /* Caching is inhibited */
52#define TLB_M 0x00000002 /* Memory is coherent */
53#define TLB_G 0x00000001 /* Memory is guarded from prefetch */
54
55#ifndef __ASSEMBLY__
56
57typedef struct {
58 unsigned int id;
59 unsigned int active;
60 void __user *vdso;
61} mm_context_t;
62
63#endif /* !__ASSEMBLY__ */
64
65#define mmu_virtual_psize MMU_PAGE_4K
66#define mmu_linear_psize MMU_PAGE_256M
67
68#endif /* _ASM_POWERPC_MMU_40X_H_ */
arch/powerpc/include/asm/nohash/32/pgtable.h+1−3
@@ -118,9 +118,7 @@ · 117 unmodified lines
118 * (hardware-defined) PowerPC PTE as closely as possible.118 * (hardware-defined) PowerPC PTE as closely as possible.
119 */119 */
120 120
121#if defined(CONFIG_40x)121#if defined(CONFIG_44x)
122#include <asm/nohash/32/pte-40x.h>
123#elif defined(CONFIG_44x)
124#include <asm/nohash/32/pte-44x.h>122#include <asm/nohash/32/pte-44x.h>
125#elif defined(CONFIG_PPC_85xx) && defined(CONFIG_PTE_64BIT)123#elif defined(CONFIG_PPC_85xx) && defined(CONFIG_PTE_64BIT)
126#include <asm/nohash/pte-e500.h>124#include <asm/nohash/pte-e500.h>
arch/powerpc/include/asm/nohash/32/pte-40x.h+0−73
@@ -1,73 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_POWERPC_NOHASH_32_PTE_40x_H
3#define _ASM_POWERPC_NOHASH_32_PTE_40x_H
4#ifdef __KERNEL__
5
6/*
7 * At present, all PowerPC 400-class processors share a similar TLB
8 * architecture. The instruction and data sides share a unified,
9 * 64-entry, fully-associative TLB which is maintained totally under
10 * software control. In addition, the instruction side has a
11 * hardware-managed, 4-entry, fully-associative TLB which serves as a
12 * first level to the shared TLB. These two TLBs are known as the UTLB
13 * and ITLB, respectively (see "mmu.h" for definitions).
14 *
15 * There are several potential gotchas here. The 40x hardware TLBLO
16 * field looks like this:
17 *
18 * 0 1 2 3 4 ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31
19 * RPN..................... 0 0 EX WR ZSEL....... W I M G
20 *
21 * Where possible we make the Linux PTE bits match up with this
22 *
23 * - bits 20 and 21 must be cleared, because we use 4k pages (40x can
24 * support down to 1k pages), this is done in the TLBMiss exception
25 * handler.
26 * - We use only zones 0 (for kernel pages) and 1 (for user pages)
27 * of the 16 available. Bit 24-26 of the TLB are cleared in the TLB
28 * miss handler. Bit 27 is PAGE_USER, thus selecting the correct
29 * zone.
30 * - PRESENT *must* be in the bottom two bits because swap PTEs
31 * use the top 30 bits. Because 40x doesn't support SMP anyway, M is
32 * irrelevant so we borrow it for PAGE_PRESENT. Bit 30
33 * is cleared in the TLB miss handler before the TLB entry is loaded.
34 * - All other bits of the PTE are loaded into TLBLO without
35 * modification, leaving us only the bits 20, 21, 24, 25, 26, 30 for
36 * software PTE bits. We actually use bits 21, 24, 25, and
37 * 30 respectively for the software bits: ACCESSED, DIRTY, RW, and
38 * PRESENT.
39 */
40
41#define _PAGE_GUARDED 0x001 /* G: page is guarded from prefetch */
42#define _PAGE_PRESENT 0x002 /* software: PTE contains a translation */
43#define _PAGE_NO_CACHE 0x004 /* I: caching is inhibited */
44#define _PAGE_WRITETHRU 0x008 /* W: caching is write-through */
45#define _PAGE_READ 0x010 /* software: read permission */
46#define _PAGE_SPECIAL 0x020 /* software: Special page */
47#define _PAGE_DIRTY 0x080 /* software: dirty page */
48#define _PAGE_WRITE 0x100 /* hardware: WR, anded with dirty in exception */
49#define _PAGE_EXEC 0x200 /* hardware: EX permission */
50#define _PAGE_ACCESSED 0x400 /* software: R: page referenced */
51
52/* No page size encoding in the linux PTE */
53#define _PAGE_PSIZE 0
54
55/* cache related flags non existing on 40x */
56#define _PAGE_COHERENT 0
57
58#define _PMD_PRESENT 0x400 /* PMD points to page of PTEs */
59#define _PMD_PRESENT_MASK _PMD_PRESENT
60#define _PMD_BAD 0x802
61#define _PMD_SIZE_4M 0x0c0
62#define _PMD_SIZE_16M 0x0e0
63#define _PMD_USER 0
64
65#define _PTE_NONE_MASK 0
66
67#define _PAGE_BASE_NC (_PAGE_PRESENT | _PAGE_ACCESSED)
68#define _PAGE_BASE (_PAGE_BASE_NC)
69
70#include <asm/pgtable-masks.h>
71
72#endif /* __KERNEL__ */
73#endif /* _ASM_POWERPC_NOHASH_32_PTE_40x_H */
arch/powerpc/include/asm/nohash/mmu.h+1−4
@@ -2,10 +2,7 @@ · 1 unmodified line
2#ifndef _ASM_POWERPC_NOHASH_MMU_H_2#ifndef _ASM_POWERPC_NOHASH_MMU_H_
3#define _ASM_POWERPC_NOHASH_MMU_H_3#define _ASM_POWERPC_NOHASH_MMU_H_
4 4
5#if defined(CONFIG_40x)5#if defined(CONFIG_44x)
6/* 40x-style software loaded TLB */
7#include <asm/nohash/32/mmu-40x.h>
8#elif defined(CONFIG_44x)
9/* 44x-style software loaded TLB */6/* 44x-style software loaded TLB */
10#include <asm/nohash/32/mmu-44x.h>7#include <asm/nohash/32/mmu-44x.h>
11#elif defined(CONFIG_PPC_E500)8#elif defined(CONFIG_PPC_E500)
arch/powerpc/include/asm/perf_event_server.h+2−1
@@ -89,7 +89,8 @@ struct power_pmu { · 88 unmodified lines
89#define PPMU_NO_SIAR 0x00000100 /* Do not use SIAR */89#define PPMU_NO_SIAR 0x00000100 /* Do not use SIAR */
90#define PPMU_ARCH_31 0x00000200 /* Has MMCR3, SIER2 and SIER3 */90#define PPMU_ARCH_31 0x00000200 /* Has MMCR3, SIER2 and SIER3 */
91#define PPMU_P10_DD1 0x00000400 /* Is power10 DD1 processor version */91#define PPMU_P10_DD1 0x00000400 /* Is power10 DD1 processor version */
92#define PPMU_HAS_ATTR_CONFIG1 0x00000800 /* Using config1 attribute */92#define PPMU_P10 0x00000800 /* For power10 pmu */
93#define PPMU_HAS_ATTR_CONFIG1 0x00001000 /* Using config1 attribute */
93 94
94/*95/*
95 * Values for flags to get_alternatives()96 * Values for flags to get_alternatives()
arch/powerpc/include/asm/plpar_wrappers.h+0−28
@@ -18,16 +18,6 @@ static inline long poll_pending(void) · 17 unmodified lines
18 return plpar_hcall_norets(H_POLL_PENDING);18 return plpar_hcall_norets(H_POLL_PENDING);
19}19}
20 20
21static inline u8 get_cede_latency_hint(void)
22{
23 return get_lppaca()->cede_latency_hint;
24}
25
26static inline void set_cede_latency_hint(u8 latency_hint)
27{
28 get_lppaca()->cede_latency_hint = latency_hint;
29}
30
31static inline long cede_processor(void)21static inline long cede_processor(void)
32{22{
33 /*23 /*
@@ -37,24 +27,6 @@ static inline long cede_processor(void) · 3 unmodified lines
37 return plpar_hcall_norets_notrace(H_CEDE);27 return plpar_hcall_norets_notrace(H_CEDE);
38}28}
39 29
40static inline long extended_cede_processor(unsigned long latency_hint)
41{
42 long rc;
43 u8 old_latency_hint = get_cede_latency_hint();
44
45 set_cede_latency_hint(latency_hint);
46
47 rc = cede_processor();
48
49 /* Ensure that H_CEDE returns with IRQs on */
50 if (WARN_ON(IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG) && !(mfmsr() & MSR_EE)))
51 __hard_irq_enable();
52
53 set_cede_latency_hint(old_latency_hint);
54
55 return rc;
56}
57
58static inline long vpa_call(unsigned long flags, unsigned long cpu,30static inline long vpa_call(unsigned long flags, unsigned long cpu,
59 unsigned long vpa)31 unsigned long vpa)
60{32{
arch/powerpc/include/asm/ppc-opcode.h+2−0
@@ -471,6 +471,7 @@ · 470 unmodified lines
471#define PPC_RAW_VCMPEQUB_RC(vrt, vra, vrb) \471#define PPC_RAW_VCMPEQUB_RC(vrt, vra, vrb) \
472 (0x10000006 | ___PPC_RT(vrt) | ___PPC_RA(vra) | ___PPC_RB(vrb) | __PPC_RC21)472 (0x10000006 | ___PPC_RT(vrt) | ___PPC_RA(vra) | ___PPC_RB(vrb) | __PPC_RC21)
473#define PPC_RAW_LD(r, base, i) (0xe8000000 | ___PPC_RT(r) | ___PPC_RA(base) | IMM_DS(i))473#define PPC_RAW_LD(r, base, i) (0xe8000000 | ___PPC_RT(r) | ___PPC_RA(base) | IMM_DS(i))
474#define PPC_RAW_LWA(r, base, i) (0xe8000002 | ___PPC_RT(r) | ___PPC_RA(base) | IMM_DS(i))
474#define PPC_RAW_LWZ(r, base, i) (0x80000000 | ___PPC_RT(r) | ___PPC_RA(base) | IMM_L(i))475#define PPC_RAW_LWZ(r, base, i) (0x80000000 | ___PPC_RT(r) | ___PPC_RA(base) | IMM_L(i))
475#define PPC_RAW_LWZX(t, a, b) (0x7c00002e | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b))476#define PPC_RAW_LWZX(t, a, b) (0x7c00002e | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b))
476#define PPC_RAW_STD(r, base, i) (0xf8000000 | ___PPC_RS(r) | ___PPC_RA(base) | IMM_DS(i))477#define PPC_RAW_STD(r, base, i) (0xf8000000 | ___PPC_RS(r) | ___PPC_RA(base) | IMM_DS(i))
@@ -535,6 +536,7 @@ · 58 unmodified lines
535#define PPC_RAW_MULI(d, a, i) (0x1c000000 | ___PPC_RT(d) | ___PPC_RA(a) | IMM_L(i))536#define PPC_RAW_MULI(d, a, i) (0x1c000000 | ___PPC_RT(d) | ___PPC_RA(a) | IMM_L(i))
536#define PPC_RAW_DIVW(d, a, b) (0x7c0003d6 | ___PPC_RT(d) | ___PPC_RA(a) | ___PPC_RB(b))537#define PPC_RAW_DIVW(d, a, b) (0x7c0003d6 | ___PPC_RT(d) | ___PPC_RA(a) | ___PPC_RB(b))
537#define PPC_RAW_DIVWU(d, a, b) (0x7c000396 | ___PPC_RT(d) | ___PPC_RA(a) | ___PPC_RB(b))538#define PPC_RAW_DIVWU(d, a, b) (0x7c000396 | ___PPC_RT(d) | ___PPC_RA(a) | ___PPC_RB(b))
539#define PPC_RAW_DIVD(d, a, b) (0x7c0003d2 | ___PPC_RT(d) | ___PPC_RA(a) | ___PPC_RB(b))
538#define PPC_RAW_DIVDU(d, a, b) (0x7c000392 | ___PPC_RT(d) | ___PPC_RA(a) | ___PPC_RB(b))540#define PPC_RAW_DIVDU(d, a, b) (0x7c000392 | ___PPC_RT(d) | ___PPC_RA(a) | ___PPC_RB(b))
539#define PPC_RAW_DIVDE(t, a, b) (0x7c000352 | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b))541#define PPC_RAW_DIVDE(t, a, b) (0x7c000352 | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b))
540#define PPC_RAW_DIVDE_DOT(t, a, b) (0x7c000352 | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b) | 0x1)542#define PPC_RAW_DIVDE_DOT(t, a, b) (0x7c000352 | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b) | 0x1)
arch/powerpc/include/asm/ppc_asm.h+1−1
@@ -482,7 +482,7 @@ END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96) · 481 unmodified lines
482 * and they must be used.482 * and they must be used.
483 */483 */
484 484
485#if !defined(CONFIG_4xx) && !defined(CONFIG_PPC_8xx)485#if !defined(CONFIG_44x) && !defined(CONFIG_PPC_8xx)
486#define tlbia \486#define tlbia \
487 li r4,1024; \487 li r4,1024; \
488 mtctr r4; \488 mtctr r4; \
arch/powerpc/include/asm/processor.h+1−1
@@ -159,7 +159,7 @@ struct thread_struct { · 158 unmodified lines
159 unsigned long sr0;159 unsigned long sr0;
160#endif160#endif
161#endif /* CONFIG_PPC32 */161#endif /* CONFIG_PPC32 */
162#if defined(CONFIG_BOOKE_OR_40x) && defined(CONFIG_PPC_KUAP)162#if defined(CONFIG_BOOKE) && defined(CONFIG_PPC_KUAP)
163 unsigned long pid; /* value written in PID reg. at interrupt exit */163 unsigned long pid; /* value written in PID reg. at interrupt exit */
164#endif164#endif
165 /* Debug Registers */165 /* Debug Registers */
arch/powerpc/include/asm/ptrace.h+1−1
@@ -310,7 +310,7 @@ static inline void regs_set_return_value(struct pt_regs *regs, unsigned long rc) · 309 unmodified lines
310 310
311static inline bool cpu_has_msr_ri(void)311static inline bool cpu_has_msr_ri(void)
312{312{
313 return !IS_ENABLED(CONFIG_BOOKE_OR_40x);313 return !IS_ENABLED(CONFIG_BOOKE);
314}314}
315 315
316static inline bool regs_is_unrecoverable(struct pt_regs *regs)316static inline bool regs_is_unrecoverable(struct pt_regs *regs)
arch/powerpc/include/asm/reg.h+2−25
@@ -18,7 +18,7 @@ · 17 unmodified lines
18#include <asm/feature-fixups.h>18#include <asm/feature-fixups.h>
19 19
20/* Pickup Book E specific registers. */20/* Pickup Book E specific registers. */
21#ifdef CONFIG_BOOKE_OR_40x21#ifdef CONFIG_BOOKE
22#include <asm/reg_booke.h>22#include <asm/reg_booke.h>
23#endif23#endif
24 24
@@ -233,14 +233,10 @@ · 208 unmodified lines
233 233
234/* Special Purpose Registers (SPRNs)*/234/* Special Purpose Registers (SPRNs)*/
235 235
236#ifdef CONFIG_40x
237#define SPRN_PID 0x3B1 /* Process ID */
238#else
239#define SPRN_PID 0x030 /* Process ID */236#define SPRN_PID 0x030 /* Process ID */
240#ifdef CONFIG_BOOKE237#ifdef CONFIG_BOOKE
241#define SPRN_PID0 SPRN_PID/* Process ID Register 0 */238#define SPRN_PID0 SPRN_PID/* Process ID Register 0 */
242#endif239#endif
243#endif
244 240
245#define SPRN_CTR 0x009 /* Count Register */241#define SPRN_CTR 0x009 /* Count Register */
246#define SPRN_DSCR 0x11242#define SPRN_DSCR 0x11
@@ -527,7 +523,7 @@ · 280 unmodified lines
527#define SPRN_TSCR 0x399 /* Thread Switch Control Register */523#define SPRN_TSCR 0x399 /* Thread Switch Control Register */
528 524
529#define SPRN_DEC 0x016 /* Decrement Register */525#define SPRN_DEC 0x016 /* Decrement Register */
530#define SPRN_PIT 0x3DB /* Programmable Interval Timer (40x/BOOKE) */526#define SPRN_PIT 0x3DB /* Programmable Interval Timer (BOOKE) */
531 527
532#define SPRN_DER 0x095 /* Debug Enable Register */528#define SPRN_DER 0x095 /* Debug Enable Register */
533#define DER_RSTE 0x40000000 /* Reset Interrupt */529#define DER_RSTE 0x40000000 /* Reset Interrupt */
@@ -1116,15 +1112,6 @@ · 582 unmodified lines
1116 * - SPRG2 indicator that we are in RTAS1112 * - SPRG2 indicator that we are in RTAS
1117 * - SPRG4 (603 only) pseudo TLB LRU data1113 * - SPRG4 (603 only) pseudo TLB LRU data
1118 *1114 *
1119 * 32-bit 40x:
1120 * - SPRG0 scratch for exception vectors
1121 * - SPRG1 scratch for exception vectors
1122 * - SPRG2 scratch for exception vectors
1123 * - SPRG4 scratch for exception vectors (not 403)
1124 * - SPRG5 scratch for exception vectors (not 403)
1125 * - SPRG6 scratch for exception vectors (not 403)
1126 * - SPRG7 scratch for exception vectors (not 403)
1127 *
1128 * 32-bit 440 and FSL BookE:1115 * 32-bit 440 and FSL BookE:
1129 * - SPRG0 scratch for exception vectors1116 * - SPRG0 scratch for exception vectors
1130 * - SPRG1 scratch for exception vectors (*)1117 * - SPRG1 scratch for exception vectors (*)
@@ -1216,16 +1203,6 @@ · 85 unmodified lines
1216#define SPRN_SPRG_603_LRU SPRN_SPRG41203#define SPRN_SPRG_603_LRU SPRN_SPRG4
1217#endif1204#endif
1218 1205
1219#ifdef CONFIG_40x
1220#define SPRN_SPRG_SCRATCH0 SPRN_SPRG0
1221#define SPRN_SPRG_SCRATCH1 SPRN_SPRG1
1222#define SPRN_SPRG_SCRATCH2 SPRN_SPRG2
1223#define SPRN_SPRG_SCRATCH3 SPRN_SPRG4
1224#define SPRN_SPRG_SCRATCH4 SPRN_SPRG5
1225#define SPRN_SPRG_SCRATCH5 SPRN_SPRG6
1226#define SPRN_SPRG_SCRATCH6 SPRN_SPRG7
1227#endif
1228
1229#ifdef CONFIG_BOOKE1206#ifdef CONFIG_BOOKE
1230#define SPRN_SPRG_RSCRATCH0 SPRN_SPRG01207#define SPRN_SPRG_RSCRATCH0 SPRN_SPRG0
1231#define SPRN_SPRG_WSCRATCH0 SPRN_SPRG01208#define SPRN_SPRG_WSCRATCH0 SPRN_SPRG0
arch/powerpc/include/asm/reg_booke.h+2−111
@@ -1,10 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0-only */1/* SPDX-License-Identifier: GPL-2.0-only */
2/*2/*
3 * Contains register definitions common to the Book E PowerPC3 * Contains register definitions common to the Book E PowerPC
4 * specification. Notice that while the IBM-40x series of CPUs4 * specification.
5 * are not true Book E PowerPCs, they borrowed a number of features
6 * before Book E was finalized, and are included here as well. Unfortunately,
7 * they sometimes used different locations than true Book E CPUs did.
8 *5 *
9 * Copyright 2009-2010 Freescale Semiconductor, Inc.6 * Copyright 2009-2010 Freescale Semiconductor, Inc.
10 */7 */
@@ -42,9 +39,6 @@ · 31 unmodified lines
42#define MSR_KERNEL (MSR_ | MSR_64BIT)39#define MSR_KERNEL (MSR_ | MSR_64BIT)
43#define MSR_USER32 (MSR_ | MSR_PR | MSR_EE)40#define MSR_USER32 (MSR_ | MSR_PR | MSR_EE)
44#define MSR_USER64 (MSR_USER32 | MSR_64BIT)41#define MSR_USER64 (MSR_USER32 | MSR_64BIT)
45#elif defined (CONFIG_40x)
46#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR|MSR_CE)
47#define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE)
48#else42#else
49#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_CE)43#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_CE)
50#define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE)44#define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE)
@@ -157,7 +151,6 @@ · 106 unmodified lines
157#define SPRN_TLB3CFG 0x2B3 /* TLB 3 Config Register */151#define SPRN_TLB3CFG 0x2B3 /* TLB 3 Config Register */
158#define SPRN_EPR 0x2BE /* External Proxy Register */152#define SPRN_EPR 0x2BE /* External Proxy Register */
159#define SPRN_CCR1 0x378 /* Core Configuration Register 1 */153#define SPRN_CCR1 0x378 /* Core Configuration Register 1 */
160#define SPRN_ZPR 0x3B0 /* Zone Protection Register (40x) */
161#define SPRN_MAS7 0x3B0 /* MMU Assist Register 7 */154#define SPRN_MAS7 0x3B0 /* MMU Assist Register 7 */
162#define SPRN_MMUCR 0x3B2 /* MMU Control Register */155#define SPRN_MMUCR 0x3B2 /* MMU Control Register */
163#define SPRN_CCR0 0x3B3 /* Core Configuration Register 0 */156#define SPRN_CCR0 0x3B3 /* Core Configuration Register 0 */
@@ -166,7 +159,6 @@ · 2 unmodified lines
166#define SPRN_SGR 0x3B9 /* Storage Guarded Register */159#define SPRN_SGR 0x3B9 /* Storage Guarded Register */
167#define SPRN_DCWR 0x3BA /* Data Cache Write-thru Register */160#define SPRN_DCWR 0x3BA /* Data Cache Write-thru Register */
168#define SPRN_SLER 0x3BB /* Little-endian real mode */161#define SPRN_SLER 0x3BB /* Little-endian real mode */
169#define SPRN_SU0R 0x3BC /* "User 0" real mode (40x) */
170#define SPRN_DCMP 0x3D1 /* Data TLB Compare Register */162#define SPRN_DCMP 0x3D1 /* Data TLB Compare Register */
171#define SPRN_ICDBDR 0x3D3 /* Instruction Cache Debug Data Register */163#define SPRN_ICDBDR 0x3D3 /* Instruction Cache Debug Data Register */
172#define SPRN_EVPR 0x3D6 /* Exception Vector Prefix Register */164#define SPRN_EVPR 0x3D6 /* Exception Vector Prefix Register */
@@ -183,10 +175,8 @@ · 10 unmodified lines
183#define SPRN_SVR 0x3FF /* System Version Register */175#define SPRN_SVR 0x3FF /* System Version Register */
184 176
185/*177/*
186 * SPRs which have conflicting definitions on true Book E versus classic,178 * SPRs which have conflicting definitions on true Book E versus classic.
187 * or IBM 40x.
188 */179 */
189#ifdef CONFIG_BOOKE
190#define SPRN_CSRR0 0x03A /* Critical Save and Restore Register 0 */180#define SPRN_CSRR0 0x03A /* Critical Save and Restore Register 0 */
191#define SPRN_CSRR1 0x03B /* Critical Save and Restore Register 1 */181#define SPRN_CSRR1 0x03B /* Critical Save and Restore Register 1 */
192#define SPRN_DEAR 0x03D /* Data Error Address Register */182#define SPRN_DEAR 0x03D /* Data Error Address Register */
@@ -201,22 +191,6 @@ · 8 unmodified lines
201#define SPRN_DAC2 0x13D /* Data Address Compare 2 */191#define SPRN_DAC2 0x13D /* Data Address Compare 2 */
202#define SPRN_TSR 0x150 /* Timer Status Register */192#define SPRN_TSR 0x150 /* Timer Status Register */
203#define SPRN_TCR 0x154 /* Timer Control Register */193#define SPRN_TCR 0x154 /* Timer Control Register */
204#endif /* Book E */
205#ifdef CONFIG_40x
206#define SPRN_DBCR1 0x3BD /* Debug Control Register 1 */
207#define SPRN_ESR 0x3D4 /* Exception Syndrome Register */
208#define SPRN_DEAR 0x3D5 /* Data Error Address Register */
209#define SPRN_TSR 0x3D8 /* Timer Status Register */
210#define SPRN_TCR 0x3DA /* Timer Control Register */
211#define SPRN_SRR2 0x3DE /* Save/Restore Register 2 */
212#define SPRN_SRR3 0x3DF /* Save/Restore Register 3 */
213#define SPRN_DBSR 0x3F0 /* Debug Status Register */
214#define SPRN_DBCR0 0x3F2 /* Debug Control Register 0 */
215#define SPRN_DAC1 0x3F6 /* Data Address Compare 1 */
216#define SPRN_DAC2 0x3F7 /* Data Address Compare 2 */
217#define SPRN_CSRR0 SPRN_SRR2 /* Critical Save and Restore Register 0 */
218#define SPRN_CSRR1 SPRN_SRR3 /* Critical Save and Restore Register 1 */
219#endif
220#define SPRN_HACOP 0x15F /* Hypervisor Available Coprocessor Register */194#define SPRN_HACOP 0x15F /* Hypervisor Available Coprocessor Register */
221 195
222/* Bit definitions for CCR1. */196/* Bit definitions for CCR1. */
@@ -296,10 +270,6 @@ · 73 unmodified lines
296#endif270#endif
297 271
298/* Bit definitions for the DBSR. */272/* Bit definitions for the DBSR. */
299/*
300 * DBSR bits which have conflicting definitions on true Book E versus IBM 40x.
301 */
302#ifdef CONFIG_BOOKE
303#define DBSR_IDE 0x80000000 /* Imprecise Debug Event */273#define DBSR_IDE 0x80000000 /* Imprecise Debug Event */
304#define DBSR_MRR 0x30000000 /* Most Recent Reset */274#define DBSR_MRR 0x30000000 /* Most Recent Reset */
305#define DBSR_IC 0x08000000 /* Instruction Completion */275#define DBSR_IC 0x08000000 /* Instruction Completion */
@@ -319,21 +289,6 @@ · 13 unmodified lines
319#define DBSR_CRET 0x00000020 /* Critical Return Debug Event */289#define DBSR_CRET 0x00000020 /* Critical Return Debug Event */
320#define DBSR_IAC12ATS 0x00000002 /* Instr Address Compare 1/2 Toggle */290#define DBSR_IAC12ATS 0x00000002 /* Instr Address Compare 1/2 Toggle */
321#define DBSR_IAC34ATS 0x00000001 /* Instr Address Compare 3/4 Toggle */291#define DBSR_IAC34ATS 0x00000001 /* Instr Address Compare 3/4 Toggle */
322#endif
323#ifdef CONFIG_40x
324#define DBSR_IC 0x80000000 /* Instruction Completion */
325#define DBSR_BT 0x40000000 /* Branch taken */
326#define DBSR_IRPT 0x20000000 /* Exception Debug Event */
327#define DBSR_TIE 0x10000000 /* Trap Instruction debug Event */
328#define DBSR_IAC1 0x04000000 /* Instruction Address Compare 1 Event */
329#define DBSR_IAC2 0x02000000 /* Instruction Address Compare 2 Event */
330#define DBSR_IAC3 0x00080000 /* Instruction Address Compare 3 Event */
331#define DBSR_IAC4 0x00040000 /* Instruction Address Compare 4 Event */
332#define DBSR_DAC1R 0x01000000 /* Data Address Compare 1 Read Event */
333#define DBSR_DAC1W 0x00800000 /* Data Address Compare 1 Write Event */
334#define DBSR_DAC2R 0x00400000 /* Data Address Compare 2 Read Event */
335#define DBSR_DAC2W 0x00200000 /* Data Address Compare 2 Write Event */
336#endif
337 292
338/* Bit definitions related to the ESR. */293/* Bit definitions related to the ESR. */
339#define ESR_MCI 0x80000000 /* Machine Check - Instruction */294#define ESR_MCI 0x80000000 /* Machine Check - Instruction */
@@ -355,69 +310,6 @@ · 15 unmodified lines
355#define ESR_SPV 0x00000080 /* Signal Processing operation */310#define ESR_SPV 0x00000080 /* Signal Processing operation */
356 311
357/* Bit definitions related to the DBCR0. */312/* Bit definitions related to the DBCR0. */
358#if defined(CONFIG_40x)
359#define DBCR0_EDM 0x80000000 /* External Debug Mode */
360#define DBCR0_IDM 0x40000000 /* Internal Debug Mode */
361#define DBCR0_RST 0x30000000 /* all the bits in the RST field */
362#define DBCR0_RST_SYSTEM 0x30000000 /* System Reset */
363#define DBCR0_RST_CHIP 0x20000000 /* Chip Reset */
364#define DBCR0_RST_CORE 0x10000000 /* Core Reset */
365#define DBCR0_RST_NONE 0x00000000 /* No Reset */
366#define DBCR0_IC 0x08000000 /* Instruction Completion */
367#define DBCR0_ICMP DBCR0_IC
368#define DBCR0_BT 0x04000000 /* Branch Taken */
369#define DBCR0_BRT DBCR0_BT
370#define DBCR0_EDE 0x02000000 /* Exception Debug Event */
371#define DBCR0_IRPT DBCR0_EDE
372#define DBCR0_TDE 0x01000000 /* TRAP Debug Event */
373#define DBCR0_IA1 0x00800000 /* Instr Addr compare 1 enable */
374#define DBCR0_IAC1 DBCR0_IA1
375#define DBCR0_IA2 0x00400000 /* Instr Addr compare 2 enable */
376#define DBCR0_IAC2 DBCR0_IA2
377#define DBCR0_IA12 0x00200000 /* Instr Addr 1-2 range enable */
378#define DBCR0_IA12X 0x00100000 /* Instr Addr 1-2 range eXclusive */
379#define DBCR0_IA3 0x00080000 /* Instr Addr compare 3 enable */
380#define DBCR0_IAC3 DBCR0_IA3
381#define DBCR0_IA4 0x00040000 /* Instr Addr compare 4 enable */
382#define DBCR0_IAC4 DBCR0_IA4
383#define DBCR0_IA34 0x00020000 /* Instr Addr 3-4 range Enable */
384#define DBCR0_IA34X 0x00010000 /* Instr Addr 3-4 range eXclusive */
385#define DBCR0_IA12T 0x00008000 /* Instr Addr 1-2 range Toggle */
386#define DBCR0_IA34T 0x00004000 /* Instr Addr 3-4 range Toggle */
387#define DBCR0_FT 0x00000001 /* Freeze Timers on debug event */
388
389#define dbcr_iac_range(task) ((task)->thread.debug.dbcr0)
390#define DBCR_IAC12I DBCR0_IA12 /* Range Inclusive */
391#define DBCR_IAC12X (DBCR0_IA12 | DBCR0_IA12X) /* Range Exclusive */
392#define DBCR_IAC12MODE (DBCR0_IA12 | DBCR0_IA12X) /* IAC 1-2 Mode Bits */
393#define DBCR_IAC34I DBCR0_IA34 /* Range Inclusive */
394#define DBCR_IAC34X (DBCR0_IA34 | DBCR0_IA34X) /* Range Exclusive */
395#define DBCR_IAC34MODE (DBCR0_IA34 | DBCR0_IA34X) /* IAC 3-4 Mode Bits */
396
397/* Bit definitions related to the DBCR1. */
398#define DBCR1_DAC1R 0x80000000 /* DAC1 Read Debug Event */
399#define DBCR1_DAC2R 0x40000000 /* DAC2 Read Debug Event */
400#define DBCR1_DAC1W 0x20000000 /* DAC1 Write Debug Event */
401#define DBCR1_DAC2W 0x10000000 /* DAC2 Write Debug Event */
402
403#define dbcr_dac(task) ((task)->thread.debug.dbcr1)
404#define DBCR_DAC1R DBCR1_DAC1R
405#define DBCR_DAC1W DBCR1_DAC1W
406#define DBCR_DAC2R DBCR1_DAC2R
407#define DBCR_DAC2W DBCR1_DAC2W
408
409/*
410 * Are there any active Debug Events represented in the
411 * Debug Control Registers?
412 */
413#define DBCR0_ACTIVE_EVENTS (DBCR0_ICMP | DBCR0_IAC1 | DBCR0_IAC2 | \
414 DBCR0_IAC3 | DBCR0_IAC4)
415#define DBCR1_ACTIVE_EVENTS (DBCR1_DAC1R | DBCR1_DAC2R | \
416 DBCR1_DAC1W | DBCR1_DAC2W)
417#define DBCR_ACTIVE_EVENTS(dbcr0, dbcr1) (((dbcr0) & DBCR0_ACTIVE_EVENTS) || \
418 ((dbcr1) & DBCR1_ACTIVE_EVENTS))
419
420#elif defined(CONFIG_BOOKE)
421#define DBCR0_EDM 0x80000000 /* External Debug Mode */313#define DBCR0_EDM 0x80000000 /* External Debug Mode */
422#define DBCR0_IDM 0x40000000 /* Internal Debug Mode */314#define DBCR0_IDM 0x40000000 /* Internal Debug Mode */
423#define DBCR0_RST 0x30000000 /* all the bits in the RST field */315#define DBCR0_RST 0x30000000 /* all the bits in the RST field */
@@ -518,7 +410,6 @@ · 94 unmodified lines
518 410
519#define DBCR_ACTIVE_EVENTS(dbcr0, dbcr1) (((dbcr0) & DBCR0_ACTIVE_EVENTS) || \411#define DBCR_ACTIVE_EVENTS(dbcr0, dbcr1) (((dbcr0) & DBCR0_ACTIVE_EVENTS) || \
520 ((dbcr1) & DBCR1_ACTIVE_EVENTS))412 ((dbcr1) & DBCR1_ACTIVE_EVENTS))
521#endif /* #elif defined(CONFIG_BOOKE) */
522 413
523/* Bit definitions related to the TCR. */414/* Bit definitions related to the TCR. */
524#define TCR_WP(x) (((x)&0x3)<<30) /* WDT Period */415#define TCR_WP(x) (((x)&0x3)<<30) /* WDT Period */
arch/powerpc/include/asm/time.h+1−6
@@ -58,9 +58,6 @@ static inline u64 get_vtb(void) · 57 unmodified lines
58 */58 */
59static inline u64 get_dec(void)59static inline u64 get_dec(void)
60{60{
61 if (IS_ENABLED(CONFIG_40x))
62 return mfspr(SPRN_PIT);
63
64 return mfspr(SPRN_DEC);61 return mfspr(SPRN_DEC);
65}62}
66 63
@@ -71,9 +68,7 @@ static inline u64 get_dec(void) · 4 unmodified lines
71 */68 */
72static inline void set_dec(u64 val)69static inline void set_dec(u64 val)
73{70{
74 if (IS_ENABLED(CONFIG_40x))71 if (IS_ENABLED(CONFIG_BOOKE))
75 mtspr(SPRN_PIT, (u32)val);
76 else if (IS_ENABLED(CONFIG_BOOKE))
77 mtspr(SPRN_DEC, val);72 mtspr(SPRN_DEC, val);
78 else73 else
79 mtspr(SPRN_DEC, val - 1);74 mtspr(SPRN_DEC, val - 1);
arch/powerpc/include/asm/udbg.h+0−1
@@ -44,7 +44,6 @@ void __init udbg_init_rtas_panel(void); · 43 unmodified lines
44void __init udbg_init_rtas_console(void);44void __init udbg_init_rtas_console(void);
45void __init udbg_init_btext(void);45void __init udbg_init_btext(void);
46void __init udbg_init_44x_as1(void);46void __init udbg_init_44x_as1(void);
47void __init udbg_init_40x_realmode(void);
48void __init udbg_init_cpm(void);47void __init udbg_init_cpm(void);
49void __init udbg_init_usbgecko(void);48void __init udbg_init_usbgecko(void);
50void __init udbg_init_memcons(void);49void __init udbg_init_memcons(void);
arch/powerpc/include/uapi/asm/kvm.h+3−0
@@ -645,6 +645,9 @@ struct kvm_ppc_cpu_char { · 644 unmodified lines
645#define KVM_REG_PPC_SIER3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc3)645#define KVM_REG_PPC_SIER3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc3)
646#define KVM_REG_PPC_DAWR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc4)646#define KVM_REG_PPC_DAWR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc4)
647#define KVM_REG_PPC_DAWRX1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc5)647#define KVM_REG_PPC_DAWRX1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc5)
648#define KVM_REG_PPC_DEXCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc6)
649#define KVM_REG_PPC_HASHKEYR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc7)
650#define KVM_REG_PPC_HASHPKEYR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc8)
648 651
649/* Transactional Memory checkpointed state:652/* Transactional Memory checkpointed state:
650 * This is all GPRs, all VSX regs and a subset of SPRs653 * This is all GPRs, all VSX regs and a subset of SPRs
arch/powerpc/kernel/Makefile+0−1
@@ -123,7 +123,6 @@ obj-$(CONFIG_JUMP_LABEL) += jump_label.o · 122 unmodified lines
123 123
124obj-$(CONFIG_PPC64) += head_64.o124obj-$(CONFIG_PPC64) += head_64.o
125obj-$(CONFIG_PPC_BOOK3S_32) += head_book3s_32.o125obj-$(CONFIG_PPC_BOOK3S_32) += head_book3s_32.o
126obj-$(CONFIG_40x) += head_40x.o
127obj-$(CONFIG_44x) += head_44x.o126obj-$(CONFIG_44x) += head_44x.o
128obj-$(CONFIG_PPC_8xx) += head_8xx.o127obj-$(CONFIG_PPC_8xx) += head_8xx.o
129obj-$(CONFIG_PPC_85xx) += head_85xx.o128obj-$(CONFIG_PPC_85xx) += head_85xx.o
arch/powerpc/kernel/asm-offsets.c+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
54#endif54#endif
55 55
56#ifdef CONFIG_PPC3256#ifdef CONFIG_PPC32
57#ifdef CONFIG_BOOKE_OR_40x57#ifdef CONFIG_BOOKE
58#include "head_booke.h"58#include "head_booke.h"
59#endif59#endif
60#endif60#endif
arch/powerpc/kernel/cpu_specs.h+0−4
@@ -1,9 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */1/* SPDX-License-Identifier: GPL-2.0-or-later */
2 2
3#ifdef CONFIG_40x
4#include "cpu_specs_40x.h"
5#endif
6
7#ifdef CONFIG_PPC_47x3#ifdef CONFIG_PPC_47x
8#include "cpu_specs_47x.h"4#include "cpu_specs_47x.h"
9#elif defined(CONFIG_44x)5#elif defined(CONFIG_44x)
arch/powerpc/kernel/cpu_specs_40x.h+0−280
@@ -1,280 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
4 */
5
6static struct cpu_spec cpu_specs[] __initdata = {
7 { /* STB 04xxx */
8 .pvr_mask = 0xffff0000,
9 .pvr_value = 0x41810000,
10 .cpu_name = "STB04xxx",
11 .cpu_features = CPU_FTRS_40X,
12 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
13 PPC_FEATURE_HAS_4xxMAC,
14 .mmu_features = MMU_FTR_TYPE_40x,
15 .icache_bsize = 32,
16 .dcache_bsize = 32,
17 .machine_check = machine_check_4xx,
18 .platform = "ppc405",
19 },
20 { /* NP405L */
21 .pvr_mask = 0xffff0000,
22 .pvr_value = 0x41610000,
23 .cpu_name = "NP405L",
24 .cpu_features = CPU_FTRS_40X,
25 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
26 PPC_FEATURE_HAS_4xxMAC,
27 .mmu_features = MMU_FTR_TYPE_40x,
28 .icache_bsize = 32,
29 .dcache_bsize = 32,
30 .machine_check = machine_check_4xx,
31 .platform = "ppc405",
32 },
33 { /* NP4GS3 */
34 .pvr_mask = 0xffff0000,
35 .pvr_value = 0x40B10000,
36 .cpu_name = "NP4GS3",
37 .cpu_features = CPU_FTRS_40X,
38 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
39 PPC_FEATURE_HAS_4xxMAC,
40 .mmu_features = MMU_FTR_TYPE_40x,
41 .icache_bsize = 32,
42 .dcache_bsize = 32,
43 .machine_check = machine_check_4xx,
44 .platform = "ppc405",
45 },
46 { /* NP405H */
47 .pvr_mask = 0xffff0000,
48 .pvr_value = 0x41410000,
49 .cpu_name = "NP405H",
50 .cpu_features = CPU_FTRS_40X,
51 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
52 PPC_FEATURE_HAS_4xxMAC,
53 .mmu_features = MMU_FTR_TYPE_40x,
54 .icache_bsize = 32,
55 .dcache_bsize = 32,
56 .machine_check = machine_check_4xx,
57 .platform = "ppc405",
58 },
59 { /* 405GPr */
60 .pvr_mask = 0xffff0000,
61 .pvr_value = 0x50910000,
62 .cpu_name = "405GPr",
63 .cpu_features = CPU_FTRS_40X,
64 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
65 PPC_FEATURE_HAS_4xxMAC,
66 .mmu_features = MMU_FTR_TYPE_40x,
67 .icache_bsize = 32,
68 .dcache_bsize = 32,
69 .machine_check = machine_check_4xx,
70 .platform = "ppc405",
71 },
72 { /* STBx25xx */
73 .pvr_mask = 0xffff0000,
74 .pvr_value = 0x51510000,
75 .cpu_name = "STBx25xx",
76 .cpu_features = CPU_FTRS_40X,
77 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
78 PPC_FEATURE_HAS_4xxMAC,
79 .mmu_features = MMU_FTR_TYPE_40x,
80 .icache_bsize = 32,
81 .dcache_bsize = 32,
82 .machine_check = machine_check_4xx,
83 .platform = "ppc405",
84 },
85 { /* 405LP */
86 .pvr_mask = 0xffff0000,
87 .pvr_value = 0x41F10000,
88 .cpu_name = "405LP",
89 .cpu_features = CPU_FTRS_40X,
90 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
91 .mmu_features = MMU_FTR_TYPE_40x,
92 .icache_bsize = 32,
93 .dcache_bsize = 32,
94 .machine_check = machine_check_4xx,
95 .platform = "ppc405",
96 },
97 { /* 405EP */
98 .pvr_mask = 0xffff0000,
99 .pvr_value = 0x51210000,
100 .cpu_name = "405EP",
101 .cpu_features = CPU_FTRS_40X,
102 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
103 PPC_FEATURE_HAS_4xxMAC,
104 .mmu_features = MMU_FTR_TYPE_40x,
105 .icache_bsize = 32,
106 .dcache_bsize = 32,
107 .machine_check = machine_check_4xx,
108 .platform = "ppc405",
109 },
110 { /* 405EX Rev. A/B with Security */
111 .pvr_mask = 0xffff000f,
112 .pvr_value = 0x12910007,
113 .cpu_name = "405EX Rev. A/B",
114 .cpu_features = CPU_FTRS_40X,
115 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
116 PPC_FEATURE_HAS_4xxMAC,
117 .mmu_features = MMU_FTR_TYPE_40x,
118 .icache_bsize = 32,
119 .dcache_bsize = 32,
120 .machine_check = machine_check_4xx,
121 .platform = "ppc405",
122 },
123 { /* 405EX Rev. C without Security */
124 .pvr_mask = 0xffff000f,
125 .pvr_value = 0x1291000d,
126 .cpu_name = "405EX Rev. C",
127 .cpu_features = CPU_FTRS_40X,
128 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
129 PPC_FEATURE_HAS_4xxMAC,
130 .mmu_features = MMU_FTR_TYPE_40x,
131 .icache_bsize = 32,
132 .dcache_bsize = 32,
133 .machine_check = machine_check_4xx,
134 .platform = "ppc405",
135 },
136 { /* 405EX Rev. C with Security */
137 .pvr_mask = 0xffff000f,
138 .pvr_value = 0x1291000f,
139 .cpu_name = "405EX Rev. C",
140 .cpu_features = CPU_FTRS_40X,
141 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
142 PPC_FEATURE_HAS_4xxMAC,
143 .mmu_features = MMU_FTR_TYPE_40x,
144 .icache_bsize = 32,
145 .dcache_bsize = 32,
146 .machine_check = machine_check_4xx,
147 .platform = "ppc405",
148 },
149 { /* 405EX Rev. D without Security */
150 .pvr_mask = 0xffff000f,
151 .pvr_value = 0x12910003,
152 .cpu_name = "405EX Rev. D",
153 .cpu_features = CPU_FTRS_40X,
154 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
155 PPC_FEATURE_HAS_4xxMAC,
156 .mmu_features = MMU_FTR_TYPE_40x,
157 .icache_bsize = 32,
158 .dcache_bsize = 32,
159 .machine_check = machine_check_4xx,
160 .platform = "ppc405",
161 },
162 { /* 405EX Rev. D with Security */
163 .pvr_mask = 0xffff000f,
164 .pvr_value = 0x12910005,
165 .cpu_name = "405EX Rev. D",
166 .cpu_features = CPU_FTRS_40X,
167 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
168 PPC_FEATURE_HAS_4xxMAC,
169 .mmu_features = MMU_FTR_TYPE_40x,
170 .icache_bsize = 32,
171 .dcache_bsize = 32,
172 .machine_check = machine_check_4xx,
173 .platform = "ppc405",
174 },
175 { /* 405EXr Rev. A/B without Security */
176 .pvr_mask = 0xffff000f,
177 .pvr_value = 0x12910001,
178 .cpu_name = "405EXr Rev. A/B",
179 .cpu_features = CPU_FTRS_40X,
180 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
181 PPC_FEATURE_HAS_4xxMAC,
182 .mmu_features = MMU_FTR_TYPE_40x,
183 .icache_bsize = 32,
184 .dcache_bsize = 32,
185 .machine_check = machine_check_4xx,
186 .platform = "ppc405",
187 },
188 { /* 405EXr Rev. C without Security */
189 .pvr_mask = 0xffff000f,
190 .pvr_value = 0x12910009,
191 .cpu_name = "405EXr Rev. C",
192 .cpu_features = CPU_FTRS_40X,
193 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
194 PPC_FEATURE_HAS_4xxMAC,
195 .mmu_features = MMU_FTR_TYPE_40x,
196 .icache_bsize = 32,
197 .dcache_bsize = 32,
198 .machine_check = machine_check_4xx,
199 .platform = "ppc405",
200 },
201 { /* 405EXr Rev. C with Security */
202 .pvr_mask = 0xffff000f,
203 .pvr_value = 0x1291000b,
204 .cpu_name = "405EXr Rev. C",
205 .cpu_features = CPU_FTRS_40X,
206 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
207 PPC_FEATURE_HAS_4xxMAC,
208 .mmu_features = MMU_FTR_TYPE_40x,
209 .icache_bsize = 32,
210 .dcache_bsize = 32,
211 .machine_check = machine_check_4xx,
212 .platform = "ppc405",
213 },
214 { /* 405EXr Rev. D without Security */
215 .pvr_mask = 0xffff000f,
216 .pvr_value = 0x12910000,
217 .cpu_name = "405EXr Rev. D",
218 .cpu_features = CPU_FTRS_40X,
219 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
220 PPC_FEATURE_HAS_4xxMAC,
221 .mmu_features = MMU_FTR_TYPE_40x,
222 .icache_bsize = 32,
223 .dcache_bsize = 32,
224 .machine_check = machine_check_4xx,
225 .platform = "ppc405",
226 },
227 { /* 405EXr Rev. D with Security */
228 .pvr_mask = 0xffff000f,
229 .pvr_value = 0x12910002,
230 .cpu_name = "405EXr Rev. D",
231 .cpu_features = CPU_FTRS_40X,
232 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
233 PPC_FEATURE_HAS_4xxMAC,
234 .mmu_features = MMU_FTR_TYPE_40x,
235 .icache_bsize = 32,
236 .dcache_bsize = 32,
237 .machine_check = machine_check_4xx,
238 .platform = "ppc405",
239 },
240 {
241 /* 405EZ */
242 .pvr_mask = 0xffff0000,
243 .pvr_value = 0x41510000,
244 .cpu_name = "405EZ",
245 .cpu_features = CPU_FTRS_40X,
246 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
247 PPC_FEATURE_HAS_4xxMAC,
248 .mmu_features = MMU_FTR_TYPE_40x,
249 .icache_bsize = 32,
250 .dcache_bsize = 32,
251 .machine_check = machine_check_4xx,
252 .platform = "ppc405",
253 },
254 { /* APM8018X */
255 .pvr_mask = 0xffff0000,
256 .pvr_value = 0x7ff11432,
257 .cpu_name = "APM8018X",
258 .cpu_features = CPU_FTRS_40X,
259 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
260 PPC_FEATURE_HAS_4xxMAC,
261 .mmu_features = MMU_FTR_TYPE_40x,
262 .icache_bsize = 32,
263 .dcache_bsize = 32,
264 .machine_check = machine_check_4xx,
265 .platform = "ppc405",
266 },
267 { /* default match */
268 .pvr_mask = 0x00000000,
269 .pvr_value = 0x00000000,
270 .cpu_name = "(generic 40x PPC)",
271 .cpu_features = CPU_FTRS_40X,
272 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU |
273 PPC_FEATURE_HAS_4xxMAC,
274 .mmu_features = MMU_FTR_TYPE_40x,
275 .icache_bsize = 32,
276 .dcache_bsize = 32,
277 .machine_check = machine_check_4xx,
278 .platform = "ppc405",
279 }
280};
arch/powerpc/kernel/eeh.c+0−16
@@ -1273,22 +1273,6 @@ EXPORT_SYMBOL(eeh_dev_release); · 1272 unmodified lines
1273 1273
1274#ifdef CONFIG_IOMMU_API1274#ifdef CONFIG_IOMMU_API
1275 1275
1276static int dev_has_iommu_table(struct device *dev, void *data)
1277{
1278 struct pci_dev *pdev = to_pci_dev(dev);
1279 struct pci_dev **ppdev = data;
1280
1281 if (!dev)
1282 return 0;
1283
1284 if (device_iommu_mapped(dev)) {
1285 *ppdev = pdev;
1286 return 1;
1287 }
1288
1289 return 0;
1290}
1291
1292/**1276/**
1293 * eeh_iommu_group_to_pe - Convert IOMMU group to EEH PE1277 * eeh_iommu_group_to_pe - Convert IOMMU group to EEH PE
1294 * @group: IOMMU group1278 * @group: IOMMU group
arch/powerpc/kernel/entry_32.S+3−45
@@ -108,7 +108,7 @@ transfer_to_syscall: · 107 unmodified lines
108 stw r11, 0(r1)108 stw r11, 0(r1)
109 mflr r12109 mflr r12
110 stw r12, _LINK(r1)110 stw r12, _LINK(r1)
111#ifdef CONFIG_BOOKE_OR_40x111#ifdef CONFIG_BOOKE
112 rlwinm r9,r9,0,14,12 /* clear MSR_WE (necessary?) */112 rlwinm r9,r9,0,14,12 /* clear MSR_WE (necessary?) */
113#endif113#endif
114 lis r12,STACK_FRAME_REGS_MARKER@ha /* exception frame marker */114 lis r12,STACK_FRAME_REGS_MARKER@ha /* exception frame marker */
@@ -158,9 +158,6 @@ syscall_exit_finish: · 43 unmodified lines
1581: REST_GPR(2, r1)1581: REST_GPR(2, r1)
159 REST_GPR(1, r1)159 REST_GPR(1, r1)
160 rfi160 rfi
161#ifdef CONFIG_40x
162 b . /* Prevent prefetch past rfi */
163#endif
164 161
1653: mtcr r51623: mtcr r5
166 lwz r4,_CTR(r1)163 lwz r4,_CTR(r1)
@@ -214,7 +211,7 @@ start_kernel_thread: · 47 unmodified lines
214 211
215 .globl fast_exception_return212 .globl fast_exception_return
216fast_exception_return:213fast_exception_return:
217#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))214#ifndef CONFIG_BOOKE
218 andi. r10,r9,MSR_RI /* check for recoverable interrupt */215 andi. r10,r9,MSR_RI /* check for recoverable interrupt */
219 beq 3f /* if not, we've got problems */216 beq 3f /* if not, we've got problems */
220#endif217#endif
@@ -237,9 +234,6 @@ fast_exception_return: · 16 unmodified lines
237 REST_GPR(12, r11)234 REST_GPR(12, r11)
238 REST_GPR(11, r11)235 REST_GPR(11, r11)
239 rfi236 rfi
240#ifdef CONFIG_40x
241 b . /* Prevent prefetch past rfi */
242#endif
243_ASM_NOKPROBE_SYMBOL(fast_exception_return)237_ASM_NOKPROBE_SYMBOL(fast_exception_return)
244 238
245/* aargh, a nonrecoverable interrupt, panic */239/* aargh, a nonrecoverable interrupt, panic */
@@ -296,9 +290,6 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS) · 50 unmodified lines
296 REST_GPR(0, r1)290 REST_GPR(0, r1)
297 REST_GPR(1, r1)291 REST_GPR(1, r1)
298 rfi292 rfi
299#ifdef CONFIG_40x
300 b . /* Prevent prefetch past rfi */
301#endif
302 293
303.Lrestore_nvgprs:294.Lrestore_nvgprs:
304 REST_NVGPRS(r1)295 REST_NVGPRS(r1)
@@ -346,9 +337,6 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS) · 41 unmodified lines
346 REST_GPR(0, r1)337 REST_GPR(0, r1)
347 REST_GPR(1, r1)338 REST_GPR(1, r1)
348 rfi339 rfi
349#ifdef CONFIG_40x
350 b . /* Prevent prefetch past rfi */
351#endif
352 340
3531: /*3411: /*
354 * Emulate stack store with update. New r1 value was already calculated342 * Emulate stack store with update. New r1 value was already calculated
@@ -375,12 +363,9 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS) · 20 unmodified lines
375 mfspr r9, SPRN_SPRG_SCRATCH0363 mfspr r9, SPRN_SPRG_SCRATCH0
376#endif364#endif
377 rfi365 rfi
378#ifdef CONFIG_40x
379 b . /* Prevent prefetch past rfi */
380#endif
381_ASM_NOKPROBE_SYMBOL(interrupt_return)366_ASM_NOKPROBE_SYMBOL(interrupt_return)
382 367
383#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)368#ifdef CONFIG_BOOKE
384 369
385/*370/*
386 * Returning from a critical interrupt in user mode doesn't need371 * Returning from a critical interrupt in user mode doesn't need
@@ -395,17 +380,6 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return) · 8 unmodified lines
395 * time of the critical interrupt.380 * time of the critical interrupt.
396 *381 *
397 */382 */
398#ifdef CONFIG_40x
399#define PPC_40x_TURN_OFF_MSR_DR \
400 /* avoid any possible TLB misses here by turning off MSR.DR, we \
401 * assume the instructions here are mapped by a pinned TLB entry */ \
402 li r10,MSR_IR; \
403 mtmsr r10; \
404 isync; \
405 tophys(r1, r1);
406#else
407#define PPC_40x_TURN_OFF_MSR_DR
408#endif
409 383
410#define RET_FROM_EXC_LEVEL(exc_lvl_srr0, exc_lvl_srr1, exc_lvl_rfi) \384#define RET_FROM_EXC_LEVEL(exc_lvl_srr0, exc_lvl_srr1, exc_lvl_rfi) \
411 REST_NVGPRS(r1); \385 REST_NVGPRS(r1); \
@@ -423,7 +397,6 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return) · 11 unmodified lines
423 mtlr r11; \397 mtlr r11; \
424 lwz r10,_CCR(r1); \398 lwz r10,_CCR(r1); \
425 mtcrf 0xff,r10; \399 mtcrf 0xff,r10; \
426 PPC_40x_TURN_OFF_MSR_DR; \
427 lwz r9,_DEAR(r1); \400 lwz r9,_DEAR(r1); \
428 lwz r10,_ESR(r1); \401 lwz r10,_ESR(r1); \
429 mtspr SPRN_DEAR,r9; \402 mtspr SPRN_DEAR,r9; \
@@ -471,20 +444,6 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return) · 41 unmodified lines
471#define RESTORE_MMU_REGS444#define RESTORE_MMU_REGS
472#endif445#endif
473 446
474#ifdef CONFIG_40x
475 .globl ret_from_crit_exc
476ret_from_crit_exc:
477 lis r9,crit_srr0@ha;
478 lwz r9,crit_srr0@l(r9);
479 lis r10,crit_srr1@ha;
480 lwz r10,crit_srr1@l(r10);
481 mtspr SPRN_SRR0,r9;
482 mtspr SPRN_SRR1,r10;
483 RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, PPC_RFCI)
484_ASM_NOKPROBE_SYMBOL(ret_from_crit_exc)
485#endif /* CONFIG_40x */
486
487#ifdef CONFIG_BOOKE
488 .globl ret_from_crit_exc447 .globl ret_from_crit_exc
489ret_from_crit_exc:448ret_from_crit_exc:
490 RESTORE_xSRR(SRR0,SRR1);449 RESTORE_xSRR(SRR0,SRR1);
@@ -509,4 +468,3 @@ ret_from_mcheck_exc: · 18 unmodified lines
509 RET_FROM_EXC_LEVEL(SPRN_MCSRR0, SPRN_MCSRR1, PPC_RFMCI)468 RET_FROM_EXC_LEVEL(SPRN_MCSRR0, SPRN_MCSRR1, PPC_RFMCI)
510_ASM_NOKPROBE_SYMBOL(ret_from_mcheck_exc)469_ASM_NOKPROBE_SYMBOL(ret_from_mcheck_exc)
511#endif /* CONFIG_BOOKE */470#endif /* CONFIG_BOOKE */
512#endif /* !(CONFIG_4xx || CONFIG_BOOKE) */
arch/powerpc/kernel/epapr_hcalls.S+1−1
@@ -21,7 +21,7 @@ _GLOBAL(epapr_ev_idle) · 20 unmodified lines
21 ori r4, r4,_TLF_NAPPING /* so when we take an exception */21 ori r4, r4,_TLF_NAPPING /* so when we take an exception */
22 PPC_STL r4, TI_LOCAL_FLAGS(r2) /* it will return to our caller */22 PPC_STL r4, TI_LOCAL_FLAGS(r2) /* it will return to our caller */
23 23
24#ifdef CONFIG_BOOKE_OR_40x24#ifdef CONFIG_BOOKE
25 wrteei 125 wrteei 1
26#else26#else
27 mfmsr r427 mfmsr r4
arch/powerpc/kernel/head_32.h+1−11
@@ -21,17 +21,9 @@ · 20 unmodified lines
21 mtspr SPRN_SPRG_SCRATCH1,r1121 mtspr SPRN_SPRG_SCRATCH1,r11
22 mfspr r10, SPRN_SPRG_THREAD22 mfspr r10, SPRN_SPRG_THREAD
23 .if \handle_dar_dsisr23 .if \handle_dar_dsisr
24#ifdef CONFIG_40x
25 mfspr r11, SPRN_DEAR
26#else
27 mfspr r11, SPRN_DAR24 mfspr r11, SPRN_DAR
28#endif
29 stw r11, DAR(r10)25 stw r11, DAR(r10)
30#ifdef CONFIG_40x
31 mfspr r11, SPRN_ESR
32#else
33 mfspr r11, SPRN_DSISR26 mfspr r11, SPRN_DSISR
34#endif
35 stw r11, DSISR(r10)27 stw r11, DSISR(r10)
36 .endif28 .endif
37 mfspr r11, SPRN_SRR029 mfspr r11, SPRN_SRR0
@@ -96,9 +88,7 @@ · 58 unmodified lines
96 .endif88 .endif
97 lwz r9, SRR1(r12)89 lwz r9, SRR1(r12)
98 lwz r12, SRR0(r12)90 lwz r12, SRR0(r12)
99#ifdef CONFIG_40x91#ifdef CONFIG_PPC_8xx
100 rlwinm r9,r9,0,14,12 /* clear MSR_WE (necessary?) */
101#elif defined(CONFIG_PPC_8xx)
102 mtspr SPRN_EID, r2 /* Set MSR_RI */92 mtspr SPRN_EID, r2 /* Set MSR_RI */
103#else93#else
104 li r10, MSR_KERNEL /* can take exceptions */94 li r10, MSR_KERNEL /* can take exceptions */
arch/powerpc/kernel/head_40x.S+0−721
@@ -1,721 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org>
4 * Initial PowerPC version.
5 * Copyright (c) 1996 Cort Dougan <cort@cs.nmt.edu>
6 * Rewritten for PReP
7 * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au>
8 * Low-level exception handers, MMU support, and rewrite.
9 * Copyright (c) 1997 Dan Malek <dmalek@jlc.net>
10 * PowerPC 8xx modifications.
11 * Copyright (c) 1998-1999 TiVo, Inc.
12 * PowerPC 403GCX modifications.
13 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
14 * PowerPC 403GCX/405GP modifications.
15 * Copyright 2000 MontaVista Software Inc.
16 * PPC405 modifications
17 * PowerPC 403GCX/405GP modifications.
18 * Author: MontaVista Software, Inc.
19 * frank_rowand@mvista.com or source@mvista.com
20 * debbie_chu@mvista.com
21 *
22 * Module name: head_4xx.S
23 *
24 * Description:
25 * Kernel execution entry point code.
26 */
27
28#include <linux/init.h>
29#include <linux/pgtable.h>
30#include <linux/sizes.h>
31#include <linux/linkage.h>
32
33#include <asm/processor.h>
34#include <asm/page.h>
35#include <asm/mmu.h>
36#include <asm/cputable.h>
37#include <asm/thread_info.h>
38#include <asm/ppc_asm.h>
39#include <asm/asm-offsets.h>
40#include <asm/ptrace.h>
41
42#include "head_32.h"
43
44/* As with the other PowerPC ports, it is expected that when code
45 * execution begins here, the following registers contain valid, yet
46 * optional, information:
47 *
48 * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.)
49 * r4 - Starting address of the init RAM disk
50 * r5 - Ending address of the init RAM disk
51 * r6 - Start of kernel command line string (e.g. "mem=96m")
52 * r7 - End of kernel command line string
53 *
54 * This is all going to change RSN when we add bi_recs....... -- Dan
55 */
56 __HEAD
57_GLOBAL(_stext);
58_GLOBAL(_start);
59
60 mr r31,r3 /* save device tree ptr */
61
62 /* We have to turn on the MMU right away so we get cache modes
63 * set correctly.
64 */
65 bl initial_mmu
66
67/* We now have the lower 16 Meg mapped into TLB entries, and the caches
68 * ready to work.
69 */
70turn_on_mmu:
71 lis r0,MSR_KERNEL@h
72 ori r0,r0,MSR_KERNEL@l
73 mtspr SPRN_SRR1,r0
74 lis r0,start_here@h
75 ori r0,r0,start_here@l
76 mtspr SPRN_SRR0,r0
77 rfi /* enables MMU */
78 b . /* prevent prefetch past rfi */
79
80/*
81 * This area is used for temporarily saving registers during the
82 * critical exception prolog.
83 */
84 . = 0xc0
85crit_save:
86_GLOBAL(crit_r10)
87 .space 4
88_GLOBAL(crit_r11)
89 .space 4
90_GLOBAL(crit_srr0)
91 .space 4
92_GLOBAL(crit_srr1)
93 .space 4
94_GLOBAL(crit_r1)
95 .space 4
96_GLOBAL(crit_dear)
97 .space 4
98_GLOBAL(crit_esr)
99 .space 4
100
101/*
102 * Exception prolog for critical exceptions. This is a little different
103 * from the normal exception prolog above since a critical exception
104 * can potentially occur at any point during normal exception processing.
105 * Thus we cannot use the same SPRG registers as the normal prolog above.
106 * Instead we use a couple of words of memory at low physical addresses.
107 * This is OK since we don't support SMP on these processors.
108 */
109.macro CRITICAL_EXCEPTION_PROLOG trapno name
110 stw r10,crit_r10@l(0) /* save two registers to work with */
111 stw r11,crit_r11@l(0)
112 mfspr r10,SPRN_SRR0
113 mfspr r11,SPRN_SRR1
114 stw r10,crit_srr0@l(0)
115 stw r11,crit_srr1@l(0)
116 mfspr r10,SPRN_DEAR
117 mfspr r11,SPRN_ESR
118 stw r10,crit_dear@l(0)
119 stw r11,crit_esr@l(0)
120 mfcr r10 /* save CR in r10 for now */
121 mfspr r11,SPRN_SRR3 /* check whether user or kernel */
122 andi. r11,r11,MSR_PR
123 lis r11,(critirq_ctx-PAGE_OFFSET)@ha
124 lwz r11,(critirq_ctx-PAGE_OFFSET)@l(r11)
125 beq 1f
126 /* COMING FROM USER MODE */
127 mfspr r11,SPRN_SPRG_THREAD /* if from user, start at top of */
128 lwz r11,TASK_STACK-THREAD(r11) /* this thread's kernel stack */
1291: stw r1,crit_r1@l(0)
130 addi r1,r11,THREAD_SIZE-INT_FRAME_SIZE /* Alloc an excpt frm */
131 LOAD_REG_IMMEDIATE(r11, MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)) /* re-enable MMU */
132 mtspr SPRN_SRR1, r11
133 lis r11, 1f@h
134 ori r11, r11, 1f@l
135 mtspr SPRN_SRR0, r11
136 rfi
137
138 .text
1391:
140\name\()_virt:
141 lwz r11,crit_r1@l(0)
142 stw r11,GPR1(r1)
143 stw r11,0(r1)
144 mr r11,r1
145 stw r10,_CCR(r11) /* save various registers */
146 stw r12,GPR12(r11)
147 stw r9,GPR9(r11)
148 mflr r10
149 stw r10,_LINK(r11)
150 lis r9,PAGE_OFFSET@ha
151 lwz r10,crit_r10@l(r9)
152 lwz r12,crit_r11@l(r9)
153 stw r10,GPR10(r11)
154 stw r12,GPR11(r11)
155 lwz r12,crit_dear@l(r9)
156 lwz r9,crit_esr@l(r9)
157 stw r12,_DEAR(r11) /* since they may have had stuff */
158 stw r9,_ESR(r11) /* exception was taken */
159 mfspr r12,SPRN_SRR2
160 mfspr r9,SPRN_SRR3
161 rlwinm r9,r9,0,14,12 /* clear MSR_WE (necessary?) */
162 COMMON_EXCEPTION_PROLOG_END \trapno + 2
163_ASM_NOKPROBE_SYMBOL(\name\()_virt)
164.endm
165
166 /*
167 * State at this point:
168 * r9 saved in stack frame, now saved SRR3 & ~MSR_WE
169 * r10 saved in crit_r10 and in stack frame, trashed
170 * r11 saved in crit_r11 and in stack frame,
171 * now phys stack/exception frame pointer
172 * r12 saved in stack frame, now saved SRR2
173 * CR saved in stack frame, CR0.EQ = !SRR3.PR
174 * LR, DEAR, ESR in stack frame
175 * r1 saved in stack frame, now virt stack/excframe pointer
176 * r0, r3-r8 saved in stack frame
177 */
178
179/*
180 * Exception vectors.
181 */
182#define CRITICAL_EXCEPTION(n, label, hdlr) \
183 START_EXCEPTION(n, label); \
184 CRITICAL_EXCEPTION_PROLOG n label; \
185 prepare_transfer_to_handler; \
186 bl hdlr; \
187 b ret_from_crit_exc
188
189/*
190 * 0x0100 - Critical Interrupt Exception
191 */
192 CRITICAL_EXCEPTION(0x0100, CriticalInterrupt, unknown_exception)
193
194/*
195 * 0x0200 - Machine Check Exception
196 */
197 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
198
199/*
200 * 0x0300 - Data Storage Exception
201 * This happens for just a few reasons. U0 set (but we don't do that),
202 * or zone protection fault (user violation, write to protected page).
203 * The other Data TLB exceptions bail out to this point
204 * if they can't resolve the lightweight TLB fault.
205 */
206 START_EXCEPTION(0x0300, DataStorage)
207 EXCEPTION_PROLOG 0x300 DataStorage handle_dar_dsisr=1
208 prepare_transfer_to_handler
209 bl do_page_fault
210 b interrupt_return
211
212/*
213 * 0x0400 - Instruction Storage Exception
214 * This is caused by a fetch from non-execute or guarded pages.
215 */
216 START_EXCEPTION(0x0400, InstructionAccess)
217 EXCEPTION_PROLOG 0x400 InstructionAccess
218 li r5,0
219 stw r5, _ESR(r11) /* Zero ESR */
220 stw r12, _DEAR(r11) /* SRR0 as DEAR */
221 prepare_transfer_to_handler
222 bl do_page_fault
223 b interrupt_return
224
225/* 0x0500 - External Interrupt Exception */
226 EXCEPTION(0x0500, HardwareInterrupt, do_IRQ)
227
228/* 0x0600 - Alignment Exception */
229 START_EXCEPTION(0x0600, Alignment)
230 EXCEPTION_PROLOG 0x600 Alignment handle_dar_dsisr=1
231 prepare_transfer_to_handler
232 bl alignment_exception
233 REST_NVGPRS(r1)
234 b interrupt_return
235
236/* 0x0700 - Program Exception */
237 START_EXCEPTION(0x0700, ProgramCheck)
238 EXCEPTION_PROLOG 0x700 ProgramCheck handle_dar_dsisr=1
239 prepare_transfer_to_handler
240 bl program_check_exception
241 REST_NVGPRS(r1)
242 b interrupt_return
243
244 EXCEPTION(0x0800, Trap_08, unknown_exception)
245 EXCEPTION(0x0900, Trap_09, unknown_exception)
246 EXCEPTION(0x0A00, Trap_0A, unknown_exception)
247 EXCEPTION(0x0B00, Trap_0B, unknown_exception)
248
249/* 0x0C00 - System Call Exception */
250 START_EXCEPTION(0x0C00, SystemCall)
251 SYSCALL_ENTRY 0xc00
252/* Trap_0D is commented out to get more space for system call exception */
253
254/* EXCEPTION(0x0D00, Trap_0D, unknown_exception) */
255 EXCEPTION(0x0E00, Trap_0E, unknown_exception)
256 EXCEPTION(0x0F00, Trap_0F, unknown_exception)
257
258/* 0x1000 - Programmable Interval Timer (PIT) Exception */
259 START_EXCEPTION(0x1000, DecrementerTrap)
260 b Decrementer
261
262/* 0x1010 - Fixed Interval Timer (FIT) Exception */
263 START_EXCEPTION(0x1010, FITExceptionTrap)
264 b FITException
265
266/* 0x1020 - Watchdog Timer (WDT) Exception */
267 START_EXCEPTION(0x1020, WDTExceptionTrap)
268 b WDTException
269
270/* 0x1100 - Data TLB Miss Exception
271 * As the name implies, translation is not in the MMU, so search the
272 * page tables and fix it. The only purpose of this function is to
273 * load TLB entries from the page table if they exist.
274 */
275 START_EXCEPTION(0x1100, DTLBMiss)
276 mtspr SPRN_SPRG_SCRATCH5, r10 /* Save some working registers */
277 mtspr SPRN_SPRG_SCRATCH6, r11
278 mtspr SPRN_SPRG_SCRATCH3, r12
279 mtspr SPRN_SPRG_SCRATCH4, r9
280 mfcr r12
281 mfspr r9, SPRN_PID
282 rlwimi r12, r9, 0, 0xff
283 mfspr r10, SPRN_DEAR /* Get faulting address */
284
285 /* If we are faulting a kernel address, we have to use the
286 * kernel page tables.
287 */
288 lis r11, PAGE_OFFSET@h
289 cmplw r10, r11
290 blt+ 3f
291 lis r11, swapper_pg_dir@h
292 ori r11, r11, swapper_pg_dir@l
293 li r9, 0
294 mtspr SPRN_PID, r9 /* TLB will have 0 TID */
295 b 4f
296
297 /* Get the PGD for the current thread.
298 */
2993:
300 mfspr r11,SPRN_SPRG_THREAD
301 lwz r11,PGDIR(r11)
302#ifdef CONFIG_PPC_KUAP
303 rlwinm. r9, r9, 0, 0xff
304 beq 5f /* Kuap fault */
305#endif
3064:
307 tophys(r11, r11)
308 rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */
309 lwz r11, 0(r11) /* Get L1 entry */
310 andi. r9, r11, _PMD_PRESENT /* Check if it points to a PTE page */
311 beq 2f /* Bail if no table */
312
313 rlwimi r11, r10, 22, 20, 29 /* Compute PTE address */
314 lwz r11, 0(r11) /* Get Linux PTE */
315 li r9, _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_READ
316 andc. r9, r9, r11 /* Check permission */
317 bne 5f
318
319 rlwinm r9, r11, 1, _PAGE_WRITE /* dirty => w */
320 and r9, r9, r11 /* hwwrite = dirty & w */
321 rlwimi r11, r9, 0, _PAGE_WRITE /* replace w by hwwrite */
322
323 /* Create TLB tag. This is the faulting address plus a static
324 * set of bits. These are size, valid, E, U0.
325 */
326 li r9, 0x00c0
327 rlwimi r10, r9, 0, 20, 31
328
329 b finish_tlb_load
330
3312: /* Check for possible large-page pmd entry */
332 rlwinm. r9, r11, 2, 22, 24
333 beq 5f
334
335 /* Create TLB tag. This is the faulting address, plus a static
336 * set of bits (valid, E, U0) plus the size from the PMD.
337 */
338 ori r9, r9, 0x40
339 rlwimi r10, r9, 0, 20, 31
340
341 b finish_tlb_load
342
3435:
344 /* The bailout. Restore registers to pre-exception conditions
345 * and call the heavyweights to help us out.
346 */
347 mtspr SPRN_PID, r12
348 mtcrf 0x80, r12
349 mfspr r9, SPRN_SPRG_SCRATCH4
350 mfspr r12, SPRN_SPRG_SCRATCH3
351 mfspr r11, SPRN_SPRG_SCRATCH6
352 mfspr r10, SPRN_SPRG_SCRATCH5
353 b DataStorage
354
355/* 0x1200 - Instruction TLB Miss Exception
356 * Nearly the same as above, except we get our information from different
357 * registers and bailout to a different point.
358 */
359 START_EXCEPTION(0x1200, ITLBMiss)
360 mtspr SPRN_SPRG_SCRATCH5, r10 /* Save some working registers */
361 mtspr SPRN_SPRG_SCRATCH6, r11
362 mtspr SPRN_SPRG_SCRATCH3, r12
363 mtspr SPRN_SPRG_SCRATCH4, r9
364 mfcr r12
365 mfspr r9, SPRN_PID
366 rlwimi r12, r9, 0, 0xff
367 mfspr r10, SPRN_SRR0 /* Get faulting address */
368
369 /* If we are faulting a kernel address, we have to use the
370 * kernel page tables.
371 */
372 lis r11, PAGE_OFFSET@h
373 cmplw r10, r11
374 blt+ 3f
375 lis r11, swapper_pg_dir@h
376 ori r11, r11, swapper_pg_dir@l
377 li r9, 0
378 mtspr SPRN_PID, r9 /* TLB will have 0 TID */
379 b 4f
380
381 /* Get the PGD for the current thread.
382 */
3833:
384 mfspr r11,SPRN_SPRG_THREAD
385 lwz r11,PGDIR(r11)
386#ifdef CONFIG_PPC_KUAP
387 rlwinm. r9, r9, 0, 0xff
388 beq 5f /* Kuap fault */
389#endif
3904:
391 tophys(r11, r11)
392 rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */
393 lwz r11, 0(r11) /* Get L1 entry */
394 andi. r9, r11, _PMD_PRESENT /* Check if it points to a PTE page */
395 beq 2f /* Bail if no table */
396
397 rlwimi r11, r10, 22, 20, 29 /* Compute PTE address */
398 lwz r11, 0(r11) /* Get Linux PTE */
399 li r9, _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
400 andc. r9, r9, r11 /* Check permission */
401 bne 5f
402
403 rlwinm r9, r11, 1, _PAGE_WRITE /* dirty => w */
404 and r9, r9, r11 /* hwwrite = dirty & w */
405 rlwimi r11, r9, 0, _PAGE_WRITE /* replace w by hwwrite */
406
407 /* Create TLB tag. This is the faulting address plus a static
408 * set of bits. These are size, valid, E, U0.
409 */
410 li r9, 0x00c0
411 rlwimi r10, r9, 0, 20, 31
412
413 b finish_tlb_load
414
4152: /* Check for possible large-page pmd entry */
416 rlwinm. r9, r11, 2, 22, 24
417 beq 5f
418
419 /* Create TLB tag. This is the faulting address, plus a static
420 * set of bits (valid, E, U0) plus the size from the PMD.
421 */
422 ori r9, r9, 0x40
423 rlwimi r10, r9, 0, 20, 31
424
425 b finish_tlb_load
426
4275:
428 /* The bailout. Restore registers to pre-exception conditions
429 * and call the heavyweights to help us out.
430 */
431 mtspr SPRN_PID, r12
432 mtcrf 0x80, r12
433 mfspr r9, SPRN_SPRG_SCRATCH4
434 mfspr r12, SPRN_SPRG_SCRATCH3
435 mfspr r11, SPRN_SPRG_SCRATCH6
436 mfspr r10, SPRN_SPRG_SCRATCH5
437 b InstructionAccess
438
439 EXCEPTION(0x1300, Trap_13, unknown_exception)
440 EXCEPTION(0x1400, Trap_14, unknown_exception)
441 EXCEPTION(0x1500, Trap_15, unknown_exception)
442 EXCEPTION(0x1600, Trap_16, unknown_exception)
443 EXCEPTION(0x1700, Trap_17, unknown_exception)
444 EXCEPTION(0x1800, Trap_18, unknown_exception)
445 EXCEPTION(0x1900, Trap_19, unknown_exception)
446 EXCEPTION(0x1A00, Trap_1A, unknown_exception)
447 EXCEPTION(0x1B00, Trap_1B, unknown_exception)
448 EXCEPTION(0x1C00, Trap_1C, unknown_exception)
449 EXCEPTION(0x1D00, Trap_1D, unknown_exception)
450 EXCEPTION(0x1E00, Trap_1E, unknown_exception)
451 EXCEPTION(0x1F00, Trap_1F, unknown_exception)
452
453/* Check for a single step debug exception while in an exception
454 * handler before state has been saved. This is to catch the case
455 * where an instruction that we are trying to single step causes
456 * an exception (eg ITLB/DTLB miss) and thus the first instruction of
457 * the exception handler generates a single step debug exception.
458 *
459 * If we get a debug trap on the first instruction of an exception handler,
460 * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is
461 * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR).
462 * The exception handler was handling a non-critical interrupt, so it will
463 * save (and later restore) the MSR via SPRN_SRR1, which will still have
464 * the MSR_DE bit set.
465 */
466 /* 0x2000 - Debug Exception */
467 START_EXCEPTION(0x2000, DebugTrap)
468 CRITICAL_EXCEPTION_PROLOG 0x2000 DebugTrap
469
470 /*
471 * If this is a single step or branch-taken exception in an
472 * exception entry sequence, it was probably meant to apply to
473 * the code where the exception occurred (since exception entry
474 * doesn't turn off DE automatically). We simulate the effect
475 * of turning off DE on entry to an exception handler by turning
476 * off DE in the SRR3 value and clearing the debug status.
477 */
478 mfspr r10,SPRN_DBSR /* check single-step/branch taken */
479 andis. r10,r10,DBSR_IC@h
480 beq+ 2f
481
482 andi. r10,r9,MSR_IR|MSR_PR /* check supervisor + MMU off */
483 beq 1f /* branch and fix it up */
484
485 mfspr r10,SPRN_SRR2 /* Faulting instruction address */
486 cmplwi r10,0x2100
487 bgt+ 2f /* address above exception vectors */
488
489 /* here it looks like we got an inappropriate debug exception. */
4901: rlwinm r9,r9,0,~MSR_DE /* clear DE in the SRR3 value */
491 lis r10,DBSR_IC@h /* clear the IC event */
492 mtspr SPRN_DBSR,r10
493 /* restore state and get out */
494 lwz r10,_CCR(r11)
495 lwz r0,GPR0(r11)
496 lwz r1,GPR1(r11)
497 mtcrf 0x80,r10
498 mtspr SPRN_SRR2,r12
499 mtspr SPRN_SRR3,r9
500 lwz r9,GPR9(r11)
501 lwz r12,GPR12(r11)
502 lwz r10,crit_r10@l(0)
503 lwz r11,crit_r11@l(0)
504 rfci
505 b .
506
507 /* continue normal handling for a critical exception... */
5082: mfspr r4,SPRN_DBSR
509 stw r4,_ESR(r11) /* DebugException takes DBSR in _ESR */
510 prepare_transfer_to_handler
511 bl DebugException
512 b ret_from_crit_exc
513
514 /* Programmable Interval Timer (PIT) Exception. (from 0x1000) */
515 __HEAD
516Decrementer:
517 EXCEPTION_PROLOG 0x1000 Decrementer
518 lis r0,TSR_PIS@h
519 mtspr SPRN_TSR,r0 /* Clear the PIT exception */
520 prepare_transfer_to_handler
521 bl timer_interrupt
522 b interrupt_return
523
524 /* Fixed Interval Timer (FIT) Exception. (from 0x1010) */
525 __HEAD
526FITException:
527 EXCEPTION_PROLOG 0x1010 FITException
528 prepare_transfer_to_handler
529 bl unknown_exception
530 b interrupt_return
531
532 /* Watchdog Timer (WDT) Exception. (from 0x1020) */
533 __HEAD
534WDTException:
535 CRITICAL_EXCEPTION_PROLOG 0x1020 WDTException
536 prepare_transfer_to_handler
537 bl WatchdogException
538 b ret_from_crit_exc
539
540/* Other PowerPC processors, namely those derived from the 6xx-series
541 * have vectors from 0x2100 through 0x2F00 defined, but marked as reserved.
542 * However, for the 4xx-series processors these are neither defined nor
543 * reserved.
544 */
545
546 __HEAD
547 /* Damn, I came up one instruction too many to fit into the
548 * exception space :-). Both the instruction and data TLB
549 * miss get to this point to load the TLB.
550 * r10 - TLB_TAG value
551 * r11 - Linux PTE
552 * r9 - available to use
553 * PID - loaded with proper value when we get here
554 * Upon exit, we reload everything and RFI.
555 * Actually, it will fit now, but oh well.....a common place
556 * to load the TLB.
557 */
558tlb_4xx_index:
559 .long 0
560finish_tlb_load:
561 /*
562 * Clear out the software-only bits in the PTE to generate the
563 * TLB_DATA value. These are the bottom 2 bits of the RPM, the
564 * 4 bits of the zone field, and M.
565 */
566 li r9, 0x0cf2
567 andc r11, r11, r9
568 rlwimi r11, r10, 8, 24, 27 /* Copy 4 upper address bit into zone */
569
570 /* load the next available TLB index. */
571 lwz r9, tlb_4xx_index@l(0)
572 addi r9, r9, 1
573 andi. r9, r9, PPC40X_TLB_SIZE - 1
574 stw r9, tlb_4xx_index@l(0)
575
576 tlbwe r11, r9, TLB_DATA /* Load TLB LO */
577 tlbwe r10, r9, TLB_TAG /* Load TLB HI */
578
579 /* Done...restore registers and get out of here.
580 */
581 mtspr SPRN_PID, r12
582 mtcrf 0x80, r12
583 mfspr r9, SPRN_SPRG_SCRATCH4
584 mfspr r12, SPRN_SPRG_SCRATCH3
585 mfspr r11, SPRN_SPRG_SCRATCH6
586 mfspr r10, SPRN_SPRG_SCRATCH5
587 rfi /* Should sync shadow TLBs */
588 b . /* prevent prefetch past rfi */
589
590/* This is where the main kernel code starts.
591 */
592start_here:
593
594 /* ptr to current */
595 lis r2,init_task@h
596 ori r2,r2,init_task@l
597
598 /* ptr to phys current thread */
599 tophys(r4,r2)
600 addi r4,r4,THREAD /* init task's THREAD */
601 mtspr SPRN_SPRG_THREAD,r4
602
603 /* stack */
604 lis r1,init_thread_union@ha
605 addi r1,r1,init_thread_union@l
606 li r0,0
607 stwu r0,THREAD_SIZE-STACK_FRAME_MIN_SIZE(r1)
608
609 bl early_init /* We have to do this with MMU on */
610
611/*
612 * Decide what sort of machine this is and initialize the MMU.
613 */
614#ifdef CONFIG_KASAN
615 bl kasan_early_init
616#endif
617 li r3,0
618 mr r4,r31
619 bl machine_init
620 bl MMU_init
621
622/* Go back to running unmapped so we can load up new values
623 * and change to using our exception vectors.
624 * On the 4xx, all we have to do is invalidate the TLB to clear
625 * the old 16M byte TLB mappings.
626 */
627 lis r4,2f@h
628 ori r4,r4,2f@l
629 tophys(r4,r4)
630 lis r3,(MSR_KERNEL & ~(MSR_IR|MSR_DR))@h
631 ori r3,r3,(MSR_KERNEL & ~(MSR_IR|MSR_DR))@l
632 mtspr SPRN_SRR0,r4
633 mtspr SPRN_SRR1,r3
634 rfi
635 b . /* prevent prefetch past rfi */
636
637/* Load up the kernel context */
6382:
639 sync /* Flush to memory before changing TLB */
640 tlbia
641 isync /* Flush shadow TLBs */
642
643 /* set up the PTE pointers for the Abatron bdiGDB.
644 */
645 lis r6, swapper_pg_dir@h
646 ori r6, r6, swapper_pg_dir@l
647 lis r5, abatron_pteptrs@h
648 ori r5, r5, abatron_pteptrs@l
649 stw r5, 0xf0(0) /* Must match your Abatron config file */
650 tophys(r5,r5)
651 stw r6, 0(r5)
652
653/* Now turn on the MMU for real! */
654 lis r4,MSR_KERNEL@h
655 ori r4,r4,MSR_KERNEL@l
656 lis r3,start_kernel@h
657 ori r3,r3,start_kernel@l
658 mtspr SPRN_SRR0,r3
659 mtspr SPRN_SRR1,r4
660 rfi /* enable MMU and jump to start_kernel */
661 b . /* prevent prefetch past rfi */
662
663/* Set up the initial MMU state so we can do the first level of
664 * kernel initialization. This maps the first 32 MBytes of memory 1:1
665 * virtual to physical and more importantly sets the cache mode.
666 */
667SYM_FUNC_START_LOCAL(initial_mmu)
668 tlbia /* Invalidate all TLB entries */
669 isync
670
671 /* We should still be executing code at physical address 0x0000xxxx
672 * at this point. However, start_here is at virtual address
673 * 0xC000xxxx. So, set up a TLB mapping to cover this once
674 * translation is enabled.
675 */
676
677 lis r3,KERNELBASE@h /* Load the kernel virtual address */
678 ori r3,r3,KERNELBASE@l
679 tophys(r4,r3) /* Load the kernel physical address */
680
681 iccci r0,r3 /* Invalidate the i-cache before use */
682
683 /* Load the kernel PID.
684 */
685 li r0,0
686 mtspr SPRN_PID,r0
687 sync
688
689 /* Configure and load one entry into TLB slots 63 */
690 clrrwi r4,r4,10 /* Mask off the real page number */
691 ori r4,r4,(TLB_WR | TLB_EX) /* Set the write and execute bits */
692
693 clrrwi r3,r3,10 /* Mask off the effective page number */
694 ori r3,r3,(TLB_VALID | TLB_PAGESZ(PAGESZ_16M))
695
696 li r0,63 /* TLB slot 63 */
697
698 tlbwe r4,r0,TLB_DATA /* Load the data portion of the entry */
699 tlbwe r3,r0,TLB_TAG /* Load the tag portion of the entry */
700
701 li r0,62 /* TLB slot 62 */
702 addis r4,r4,SZ_16M@h
703 addis r3,r3,SZ_16M@h
704 tlbwe r4,r0,TLB_DATA /* Load the data portion of the entry */
705 tlbwe r3,r0,TLB_TAG /* Load the tag portion of the entry */
706
707 isync
708
709 /* Establish the exception vector base
710 */
711 lis r4,KERNELBASE@h /* EVPR only uses the high 16-bits */
712 tophys(r0,r4) /* Use the physical address */
713 mtspr SPRN_EVPR,r0
714
715 blr
716SYM_FUNC_END(initial_mmu)
717
718_GLOBAL(abort)
719 mfspr r13,SPRN_DBCR0
720 oris r13,r13,DBCR0_RST_SYSTEM@h
721 mtspr SPRN_DBCR0,r13
arch/powerpc/kernel/head_booke.h+1−2
@@ -145,10 +145,9 @@ ALT_FTR_SECTION_END_IFSET(CPU_FTR_EMB_HV) · 144 unmodified lines
145 b transfer_to_syscall /* jump to handler */145 b transfer_to_syscall /* jump to handler */
146.endm146.endm
147 147
148/* To handle the additional exception priority levels on 40x and Book-E148/* To handle the additional exception priority levels on Book-E
149 * processors we allocate a stack per additional priority level.149 * processors we allocate a stack per additional priority level.
150 *150 *
151 * On 40x critical is the only additional level
152 * On 44x/e500 we have critical and machine check151 * On 44x/e500 we have critical and machine check
153 *152 *
154 * Additionally we reserve a SPRG for each priority level so we can free up a153 * Additionally we reserve a SPRG for each priority level so we can free up a
arch/powerpc/kernel/iommu.c+21−149
@@ -643,7 +643,7 @@ void ppc_iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, · 642 unmodified lines
643 tbl->it_ops->flush(tbl);643 tbl->it_ops->flush(tbl);
644}644}
645 645
646static void iommu_table_clear(struct iommu_table *tbl)646void iommu_table_clear(struct iommu_table *tbl)
647{647{
648 /*648 /*
649 * In case of firmware assisted dump system goes through clean649 * In case of firmware assisted dump system goes through clean
@@ -684,7 +684,7 @@ static void iommu_table_clear(struct iommu_table *tbl) · 34 unmodified lines
684#endif684#endif
685}685}
686 686
687static void iommu_table_reserve_pages(struct iommu_table *tbl,687void iommu_table_reserve_pages(struct iommu_table *tbl,
688 unsigned long res_start, unsigned long res_end)688 unsigned long res_start, unsigned long res_end)
689{689{
690 int i;690 int i;
@@ -988,6 +988,23 @@ unsigned long iommu_direction_to_tce_perm(enum dma_data_direction dir) · 297 unmodified lines
988EXPORT_SYMBOL_GPL(iommu_direction_to_tce_perm);988EXPORT_SYMBOL_GPL(iommu_direction_to_tce_perm);
989 989
990#ifdef CONFIG_IOMMU_API990#ifdef CONFIG_IOMMU_API
991
992int dev_has_iommu_table(struct device *dev, void *data)
993{
994 struct pci_dev *pdev = to_pci_dev(dev);
995 struct pci_dev **ppdev = data;
996
997 if (!dev)
998 return 0;
999
1000 if (device_iommu_mapped(dev)) {
1001 *ppdev = pdev;
1002 return 1;
1003 }
1004
1005 return 0;
1006}
1007
991/*1008/*
992 * SPAPR TCE API1009 * SPAPR TCE API
993 */1010 */
@@ -1102,59 +1119,6 @@ void iommu_tce_kill(struct iommu_table *tbl, · 108 unmodified lines
1102}1119}
1103EXPORT_SYMBOL_GPL(iommu_tce_kill);1120EXPORT_SYMBOL_GPL(iommu_tce_kill);
1104 1121
1105#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV)
1106static int iommu_take_ownership(struct iommu_table *tbl)
1107{
1108 unsigned long flags, i, sz = (tbl->it_size + 7) >> 3;
1109 int ret = 0;
1110
1111 /*
1112 * VFIO does not control TCE entries allocation and the guest
1113 * can write new TCEs on top of existing ones so iommu_tce_build()
1114 * must be able to release old pages. This functionality
1115 * requires exchange() callback defined so if it is not
1116 * implemented, we disallow taking ownership over the table.
1117 */
1118 if (!tbl->it_ops->xchg_no_kill)
1119 return -EINVAL;
1120
1121 spin_lock_irqsave(&tbl->large_pool.lock, flags);
1122 for (i = 0; i < tbl->nr_pools; i++)
1123 spin_lock_nest_lock(&tbl->pools[i].lock, &tbl->large_pool.lock);
1124
1125 if (iommu_table_in_use(tbl)) {
1126 pr_err("iommu_tce: it_map is not empty");
1127 ret = -EBUSY;
1128 } else {
1129 memset(tbl->it_map, 0xff, sz);
1130 }
1131
1132 for (i = 0; i < tbl->nr_pools; i++)
1133 spin_unlock(&tbl->pools[i].lock);
1134 spin_unlock_irqrestore(&tbl->large_pool.lock, flags);
1135
1136 return ret;
1137}
1138
1139static void iommu_release_ownership(struct iommu_table *tbl)
1140{
1141 unsigned long flags, i, sz = (tbl->it_size + 7) >> 3;
1142
1143 spin_lock_irqsave(&tbl->large_pool.lock, flags);
1144 for (i = 0; i < tbl->nr_pools; i++)
1145 spin_lock_nest_lock(&tbl->pools[i].lock, &tbl->large_pool.lock);
1146
1147 memset(tbl->it_map, 0, sz);
1148
1149 iommu_table_reserve_pages(tbl, tbl->it_reserved_start,
1150 tbl->it_reserved_end);
1151
1152 for (i = 0; i < tbl->nr_pools; i++)
1153 spin_unlock(&tbl->pools[i].lock);
1154 spin_unlock_irqrestore(&tbl->large_pool.lock, flags);
1155}
1156#endif
1157
1158int iommu_add_device(struct iommu_table_group *table_group, struct device *dev)1122int iommu_add_device(struct iommu_table_group *table_group, struct device *dev)
1159{1123{
1160 /*1124 /*
@@ -1186,98 +1150,6 @@ int iommu_add_device(struct iommu_table_group *table_group, struct device *dev) · 25 unmodified lines
1186EXPORT_SYMBOL_GPL(iommu_add_device);1150EXPORT_SYMBOL_GPL(iommu_add_device);
1187 1151
1188#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV)1152#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV)
1189/*
1190 * A simple iommu_table_group_ops which only allows reusing the existing
1191 * iommu_table. This handles VFIO for POWER7 or the nested KVM.
1192 * The ops does not allow creating windows and only allows reusing the existing
1193 * one if it matches table_group->tce32_start/tce32_size/page_shift.
1194 */
1195static unsigned long spapr_tce_get_table_size(__u32 page_shift,
1196 __u64 window_size, __u32 levels)
1197{
1198 unsigned long size;
1199
1200 if (levels > 1)
1201 return ~0U;
1202 size = window_size >> (page_shift - 3);
1203 return size;
1204}
1205
1206static long spapr_tce_create_table(struct iommu_table_group *table_group, int num,
1207 __u32 page_shift, __u64 window_size, __u32 levels,
1208 struct iommu_table **ptbl)
1209{
1210 struct iommu_table *tbl = table_group->tables[0];
1211
1212 if (num > 0)
1213 return -EPERM;
1214
1215 if (tbl->it_page_shift != page_shift ||
1216 tbl->it_size != (window_size >> page_shift) ||
1217 tbl->it_indirect_levels != levels - 1)
1218 return -EINVAL;
1219
1220 *ptbl = iommu_tce_table_get(tbl);
1221 return 0;
1222}
1223
1224static long spapr_tce_set_window(struct iommu_table_group *table_group,
1225 int num, struct iommu_table *tbl)
1226{
1227 return tbl == table_group->tables[num] ? 0 : -EPERM;
1228}
1229
1230static long spapr_tce_unset_window(struct iommu_table_group *table_group, int num)
1231{
1232 return 0;
1233}
1234
1235static long spapr_tce_take_ownership(struct iommu_table_group *table_group)
1236{
1237 int i, j, rc = 0;
1238
1239 for (i = 0; i < IOMMU_TABLE_GROUP_MAX_TABLES; ++i) {
1240 struct iommu_table *tbl = table_group->tables[i];
1241
1242 if (!tbl || !tbl->it_map)
1243 continue;
1244
1245 rc = iommu_take_ownership(tbl);
1246 if (!rc)
1247 continue;
1248
1249 for (j = 0; j < i; ++j)
1250 iommu_release_ownership(table_group->tables[j]);
1251 return rc;
1252 }
1253 return 0;
1254}
1255
1256static void spapr_tce_release_ownership(struct iommu_table_group *table_group)
1257{
1258 int i;
1259
1260 for (i = 0; i < IOMMU_TABLE_GROUP_MAX_TABLES; ++i) {
1261 struct iommu_table *tbl = table_group->tables[i];
1262
1263 if (!tbl)
1264 continue;
1265
1266 iommu_table_clear(tbl);
1267 if (tbl->it_map)
1268 iommu_release_ownership(tbl);
1269 }
1270}
1271
1272struct iommu_table_group_ops spapr_tce_table_group_ops = {
1273 .get_table_size = spapr_tce_get_table_size,
1274 .create_table = spapr_tce_create_table,
1275 .set_window = spapr_tce_set_window,
1276 .unset_window = spapr_tce_unset_window,
1277 .take_ownership = spapr_tce_take_ownership,
1278 .release_ownership = spapr_tce_release_ownership,
1279};
1280
1281/*1153/*
1282 * A simple iommu_ops to allow less cruft in generic VFIO code.1154 * A simple iommu_ops to allow less cruft in generic VFIO code.
1283 */1155 */
@@ -1299,7 +1171,7 @@ spapr_tce_platform_iommu_attach_dev(struct iommu_domain *platform_domain, · 15 unmodified lines
1299 * The domain being set to PLATFORM from earlier1171 * The domain being set to PLATFORM from earlier
1300 * BLOCKED. The table_group ownership has to be released.1172 * BLOCKED. The table_group ownership has to be released.
1301 */1173 */
1302 table_group->ops->release_ownership(table_group);1174 table_group->ops->release_ownership(table_group, dev);
1303 iommu_group_put(grp);1175 iommu_group_put(grp);
1304 1176
1305 return 0;1177 return 0;
@@ -1327,7 +1199,7 @@ spapr_tce_blocked_iommu_attach_dev(struct iommu_domain *platform_domain, · 21 unmodified lines
1327 * also sets the dma_api ops1199 * also sets the dma_api ops
1328 */1200 */
1329 table_group = iommu_group_get_iommudata(grp);1201 table_group = iommu_group_get_iommudata(grp);
1330 ret = table_group->ops->take_ownership(table_group);1202 ret = table_group->ops->take_ownership(table_group, dev);
1331 iommu_group_put(grp);1203 iommu_group_put(grp);
1332 1204
1333 return ret;1205 return ret;
arch/powerpc/kernel/irq.c+1−1
@@ -333,7 +333,7 @@ void __init init_IRQ(void) · 332 unmodified lines
333 static_call_update(ppc_get_irq, ppc_md.get_irq);333 static_call_update(ppc_get_irq, ppc_md.get_irq);
334}334}
335 335
336#ifdef CONFIG_BOOKE_OR_40x336#ifdef CONFIG_BOOKE
337void *critirq_ctx[NR_CPUS] __read_mostly;337void *critirq_ctx[NR_CPUS] __read_mostly;
338void *dbgirq_ctx[NR_CPUS] __read_mostly;338void *dbgirq_ctx[NR_CPUS] __read_mostly;
339void *mcheckirq_ctx[NR_CPUS] __read_mostly;339void *mcheckirq_ctx[NR_CPUS] __read_mostly;
arch/powerpc/kernel/kgdb.c+2−2
@@ -45,7 +45,7 @@ static struct hard_trap_info · 44 unmodified lines
45 { 0x0800, 0x08 /* SIGFPE */ }, /* fp unavailable */45 { 0x0800, 0x08 /* SIGFPE */ }, /* fp unavailable */
46 { 0x0900, 0x0e /* SIGALRM */ }, /* decrementer */46 { 0x0900, 0x0e /* SIGALRM */ }, /* decrementer */
47 { 0x0c00, 0x14 /* SIGCHLD */ }, /* system call */47 { 0x0c00, 0x14 /* SIGCHLD */ }, /* system call */
48#ifdef CONFIG_BOOKE_OR_40x48#ifdef CONFIG_BOOKE
49 { 0x2002, 0x05 /* SIGTRAP */ }, /* debug */49 { 0x2002, 0x05 /* SIGTRAP */ }, /* debug */
50#if defined(CONFIG_PPC_85xx)50#if defined(CONFIG_PPC_85xx)
51 { 0x2010, 0x08 /* SIGFPE */ }, /* spe unavailable */51 { 0x2010, 0x08 /* SIGFPE */ }, /* spe unavailable */
@@ -64,7 +64,7 @@ static struct hard_trap_info · 12 unmodified lines
64 { 0x2010, 0x08 /* SIGFPE */ }, /* fp unavailable */64 { 0x2010, 0x08 /* SIGFPE */ }, /* fp unavailable */
65 { 0x2020, 0x08 /* SIGFPE */ }, /* ap unavailable */65 { 0x2020, 0x08 /* SIGFPE */ }, /* ap unavailable */
66#endif66#endif
67#else /* !CONFIG_BOOKE_OR_40x */67#else /* !CONFIG_BOOKE */
68 { 0x0d00, 0x05 /* SIGTRAP */ }, /* single-step */68 { 0x0d00, 0x05 /* SIGTRAP */ }, /* single-step */
69#if defined(CONFIG_PPC_8xx)69#if defined(CONFIG_PPC_8xx)
70 { 0x1000, 0x04 /* SIGILL */ }, /* software emulation */70 { 0x1000, 0x04 /* SIGILL */ }, /* software emulation */
arch/powerpc/kernel/misc_32.S+0−40
@@ -176,46 +176,6 @@ _GLOBAL(low_choose_7447a_dfs) · 175 unmodified lines
176 176
177#endif /* CONFIG_CPU_FREQ_PMAC && CONFIG_PPC_BOOK3S_32 */177#endif /* CONFIG_CPU_FREQ_PMAC && CONFIG_PPC_BOOK3S_32 */
178 178
179#ifdef CONFIG_40x
180
181/*
182 * Do an IO access in real mode
183 */
184_GLOBAL(real_readb)
185 mfmsr r7
186 rlwinm r0,r7,0,~MSR_DR
187 sync
188 mtmsr r0
189 sync
190 isync
191 lbz r3,0(r3)
192 sync
193 mtmsr r7
194 sync
195 isync
196 blr
197_ASM_NOKPROBE_SYMBOL(real_readb)
198
199 /*
200 * Do an IO access in real mode
201 */
202_GLOBAL(real_writeb)
203 mfmsr r7
204 rlwinm r0,r7,0,~MSR_DR
205 sync
206 mtmsr r0
207 sync
208 isync
209 stb r3,0(r4)
210 sync
211 mtmsr r7
212 sync
213 isync
214 blr
215_ASM_NOKPROBE_SYMBOL(real_writeb)
216
217#endif /* CONFIG_40x */
218
219/*179/*
220 * Copy a whole page. We use the dcbz instruction on the destination180 * Copy a whole page. We use the dcbz instruction on the destination
221 * to reduce memory traffic (it eliminates the unnecessary reads of181 * to reduce memory traffic (it eliminates the unnecessary reads of
arch/powerpc/kernel/pci-hotplug.c+32−3
@@ -93,6 +93,36 @@ void pci_hp_remove_devices(struct pci_bus *bus) · 92 unmodified lines
93}93}
94EXPORT_SYMBOL_GPL(pci_hp_remove_devices);94EXPORT_SYMBOL_GPL(pci_hp_remove_devices);
95 95
96static void traverse_siblings_and_scan_slot(struct device_node *start, struct pci_bus *bus)
97{
98 struct device_node *dn;
99 int slotno;
100
101 u32 class = 0;
102
103 if (!of_property_read_u32(start->child, "class-code", &class)) {
104 /* Call of pci_scan_slot for non-bridge/EP case */
105 if (!((class >> 8) == PCI_CLASS_BRIDGE_PCI)) {
106 slotno = PCI_SLOT(PCI_DN(start->child)->devfn);
107 pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
108 return;
109 }
110 }
111
112 /* Iterate all siblings */
113 for_each_child_of_node(start, dn) {
114 class = 0;
115
116 if (!of_property_read_u32(start->child, "class-code", &class)) {
117 /* Call of pci_scan_slot on each sibling-nodes/bridge-ports */
118 if ((class >> 8) == PCI_CLASS_BRIDGE_PCI) {
119 slotno = PCI_SLOT(PCI_DN(dn)->devfn);
120 pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
121 }
122 }
123 }
124}
125
96/**126/**
97 * pci_hp_add_devices - adds new pci devices to bus127 * pci_hp_add_devices - adds new pci devices to bus
98 * @bus: the indicated PCI bus128 * @bus: the indicated PCI bus
@@ -106,7 +136,7 @@ EXPORT_SYMBOL_GPL(pci_hp_remove_devices); · 7 unmodified lines
106 */136 */
107void pci_hp_add_devices(struct pci_bus *bus)137void pci_hp_add_devices(struct pci_bus *bus)
108{138{
109 int slotno, mode, max;139 int mode, max;
110 struct pci_dev *dev;140 struct pci_dev *dev;
111 struct pci_controller *phb;141 struct pci_controller *phb;
112 struct device_node *dn = pci_bus_to_OF_node(bus);142 struct device_node *dn = pci_bus_to_OF_node(bus);
@@ -129,8 +159,7 @@ void pci_hp_add_devices(struct pci_bus *bus) · 16 unmodified lines
129 * order for fully rescan all the way down to pick them up.159 * order for fully rescan all the way down to pick them up.
130 * They can have been removed during partial hotplug.160 * They can have been removed during partial hotplug.
131 */161 */
132 slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);162 traverse_siblings_and_scan_slot(dn, bus);
133 pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
134 max = bus->busn_res.start;163 max = bus->busn_res.start;
135 /*164 /*
136 * Scan bridges that are already configured. We don't touch165 * Scan bridges that are already configured. We don't touch
arch/powerpc/kernel/process.c+2−2
@@ -1573,7 +1573,7 @@ static void __show_regs(struct pt_regs *regs) · 1572 unmodified lines
1573 if (trap == INTERRUPT_MACHINE_CHECK ||1573 if (trap == INTERRUPT_MACHINE_CHECK ||
1574 trap == INTERRUPT_DATA_STORAGE ||1574 trap == INTERRUPT_DATA_STORAGE ||
1575 trap == INTERRUPT_ALIGNMENT) {1575 trap == INTERRUPT_ALIGNMENT) {
1576 if (IS_ENABLED(CONFIG_4xx) || IS_ENABLED(CONFIG_BOOKE))1576 if (IS_ENABLED(CONFIG_BOOKE))
1577 pr_cont("DEAR: "REG" ESR: "REG" ", regs->dear, regs->esr);1577 pr_cont("DEAR: "REG" ESR: "REG" ", regs->dear, regs->esr);
1578 else1578 else
1579 pr_cont("DAR: "REG" DSISR: %08lx ", regs->dar, regs->dsisr);1579 pr_cont("DAR: "REG" DSISR: %08lx ", regs->dar, regs->dsisr);
@@ -1875,7 +1875,7 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args) · 295 unmodified lines
1875#if defined(CONFIG_PPC_BOOK3S_32) && defined(CONFIG_PPC_KUAP)1875#if defined(CONFIG_PPC_BOOK3S_32) && defined(CONFIG_PPC_KUAP)
1876 p->thread.kuap = KUAP_NONE;1876 p->thread.kuap = KUAP_NONE;
1877#endif1877#endif
1878#if defined(CONFIG_BOOKE_OR_40x) && defined(CONFIG_PPC_KUAP)1878#if defined(CONFIG_BOOKE) && defined(CONFIG_PPC_KUAP)
1879 p->thread.pid = MMU_NO_CONTEXT;1879 p->thread.pid = MMU_NO_CONTEXT;
1880#endif1880#endif
1881 1881
arch/powerpc/kernel/prom.c+8−4
@@ -331,6 +331,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node, · 330 unmodified lines
331 void *data)331 void *data)
332{332{
333 const char *type = of_get_flat_dt_prop(node, "device_type", NULL);333 const char *type = of_get_flat_dt_prop(node, "device_type", NULL);
334 const __be32 *cpu_version = NULL;
334 const __be32 *prop;335 const __be32 *prop;
335 const __be32 *intserv;336 const __be32 *intserv;
336 int i, nthreads;337 int i, nthreads;
@@ -420,7 +421,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node, · 83 unmodified lines
420 prop = of_get_flat_dt_prop(node, "cpu-version", NULL);421 prop = of_get_flat_dt_prop(node, "cpu-version", NULL);
421 if (prop && (be32_to_cpup(prop) & 0xff000000) == 0x0f000000) {422 if (prop && (be32_to_cpup(prop) & 0xff000000) == 0x0f000000) {
422 identify_cpu(0, be32_to_cpup(prop));423 identify_cpu(0, be32_to_cpup(prop));
423 seq_buf_printf(&ppc_hw_desc, "0x%04x ", be32_to_cpup(prop));424 cpu_version = prop;
424 }425 }
425 426
426 check_cpu_feature_properties(node);427 check_cpu_feature_properties(node);
@@ -431,6 +432,12 @@ static int __init early_init_dt_scan_cpus(unsigned long node, · 4 unmodified lines
431 }432 }
432 433
433 identical_pvr_fixup(node);434 identical_pvr_fixup(node);
435
436 // We can now add the CPU name & PVR to the hardware description
437 seq_buf_printf(&ppc_hw_desc, "%s 0x%04lx ", cur_cpu_spec->cpu_name, mfspr(SPRN_PVR));
438 if (cpu_version)
439 seq_buf_printf(&ppc_hw_desc, "0x%04x ", be32_to_cpup(cpu_version));
440
434 init_mmu_slb_size(node);441 init_mmu_slb_size(node);
435 442
436#ifdef CONFIG_PPC64443#ifdef CONFIG_PPC64
@@ -881,9 +888,6 @@ void __init early_init_devtree(void *params) · 444 unmodified lines
881 888
882 dt_cpu_ftrs_scan();889 dt_cpu_ftrs_scan();
883 890
884 // We can now add the CPU name & PVR to the hardware description
885 seq_buf_printf(&ppc_hw_desc, "%s 0x%04lx ", cur_cpu_spec->cpu_name, mfspr(SPRN_PVR));
886
887 /* Retrieve CPU related informations from the flat tree891 /* Retrieve CPU related informations from the flat tree
888 * (altivec support, boot CPU ID, ...)892 * (altivec support, boot CPU ID, ...)
889 */893 */
arch/powerpc/kernel/rtas.c+4−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
19#include <linux/lockdep.h>19#include <linux/lockdep.h>
20#include <linux/memblock.h>20#include <linux/memblock.h>
21#include <linux/mutex.h>21#include <linux/mutex.h>
22#include <linux/nospec.h>
22#include <linux/of.h>23#include <linux/of.h>
23#include <linux/of_fdt.h>24#include <linux/of_fdt.h>
24#include <linux/reboot.h>25#include <linux/reboot.h>
@@ -1916,6 +1917,9 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) · 1891 unmodified lines
1916 || nargs + nret > ARRAY_SIZE(args.args))1917 || nargs + nret > ARRAY_SIZE(args.args))
1917 return -EINVAL;1918 return -EINVAL;
1918 1919
1920 nargs = array_index_nospec(nargs, ARRAY_SIZE(args.args));
1921 nret = array_index_nospec(nret, ARRAY_SIZE(args.args) - nargs);
1922
1919 /* Copy in args. */1923 /* Copy in args. */
1920 if (copy_from_user(args.args, uargs->args,1924 if (copy_from_user(args.args, uargs->args,
1921 nargs * sizeof(rtas_arg_t)) != 0)1925 nargs * sizeof(rtas_arg_t)) != 0)
arch/powerpc/kernel/rtas_flash.c+1−0
@@ -773,4 +773,5 @@ static void __exit rtas_flash_cleanup(void) · 772 unmodified lines
773 773
774module_init(rtas_flash_init);774module_init(rtas_flash_init);
775module_exit(rtas_flash_cleanup);775module_exit(rtas_flash_cleanup);
776MODULE_DESCRIPTION("PPC procfs firmware flash interface");
776MODULE_LICENSE("GPL");777MODULE_LICENSE("GPL");
arch/powerpc/kernel/setup.h+1−1
@@ -29,7 +29,7 @@ void setup_tlb_core_data(void); · 28 unmodified lines
29static inline void setup_tlb_core_data(void) { }29static inline void setup_tlb_core_data(void) { }
30#endif30#endif
31 31
32#ifdef CONFIG_BOOKE_OR_40x32#ifdef CONFIG_BOOKE
33void exc_lvl_early_init(void);33void exc_lvl_early_init(void);
34#else34#else
35static inline void exc_lvl_early_init(void) { }35static inline void exc_lvl_early_init(void) { }
arch/powerpc/kernel/setup_32.c+1−1
@@ -176,7 +176,7 @@ void __init emergency_stack_init(void) · 175 unmodified lines
176}176}
177#endif177#endif
178 178
179#ifdef CONFIG_BOOKE_OR_40x179#ifdef CONFIG_BOOKE
180void __init exc_lvl_early_init(void)180void __init exc_lvl_early_init(void)
181{181{
182 unsigned int i, hw_cpu;182 unsigned int i, hw_cpu;
arch/powerpc/kernel/time.c+1−1
@@ -695,7 +695,7 @@ static int __init get_freq(char *name, int cells, unsigned long *val) · 694 unmodified lines
695 695
696static void start_cpu_decrementer(void)696static void start_cpu_decrementer(void)
697{697{
698#ifdef CONFIG_BOOKE_OR_40x698#ifdef CONFIG_BOOKE
699 unsigned int tcr;699 unsigned int tcr;
700 700
701 /* Clear any pending timer interrupts */701 /* Clear any pending timer interrupts */
arch/powerpc/kernel/traps.c+1−1
@@ -2244,7 +2244,7 @@ void __noreturn unrecoverable_exception(struct pt_regs *regs) · 2243 unmodified lines
2244 ;2244 ;
2245}2245}
2246 2246
2247#if defined(CONFIG_BOOKE_WDT) || defined(CONFIG_40x)2247#ifdef CONFIG_BOOKE_WDT
2248DEFINE_INTERRUPT_HANDLER_NMI(WatchdogException)2248DEFINE_INTERRUPT_HANDLER_NMI(WatchdogException)
2249{2249{
2250 printk (KERN_EMERG "PowerPC Book-E Watchdog Exception\n");2250 printk (KERN_EMERG "PowerPC Book-E Watchdog Exception\n");
arch/powerpc/kernel/udbg.c+0−3
@@ -49,9 +49,6 @@ void __init udbg_early_init(void) · 48 unmodified lines
49#elif defined(CONFIG_PPC_EARLY_DEBUG_44x)49#elif defined(CONFIG_PPC_EARLY_DEBUG_44x)
50 /* PPC44x debug */50 /* PPC44x debug */
51 udbg_init_44x_as1();51 udbg_init_44x_as1();
52#elif defined(CONFIG_PPC_EARLY_DEBUG_40x)
53 /* PPC40x debug */
54 udbg_init_40x_realmode();
55#elif defined(CONFIG_PPC_EARLY_DEBUG_CPM)52#elif defined(CONFIG_PPC_EARLY_DEBUG_CPM)
56 udbg_init_cpm();53 udbg_init_cpm();
57#elif defined(CONFIG_PPC_EARLY_DEBUG_USBGECKO)54#elif defined(CONFIG_PPC_EARLY_DEBUG_USBGECKO)
arch/powerpc/kernel/udbg_16550.c+0−23
@@ -274,29 +274,6 @@ void __init udbg_init_44x_as1(void) · 273 unmodified lines
274 274
275#endif /* CONFIG_PPC_EARLY_DEBUG_44x */275#endif /* CONFIG_PPC_EARLY_DEBUG_44x */
276 276
277#ifdef CONFIG_PPC_EARLY_DEBUG_40x
278
279static u8 udbg_uart_in_40x(unsigned int reg)
280{
281 return real_readb((void __iomem *)CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR
282 + reg);
283}
284
285static void udbg_uart_out_40x(unsigned int reg, u8 val)
286{
287 real_writeb(val, (void __iomem *)CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR
288 + reg);
289}
290
291void __init udbg_init_40x_realmode(void)
292{
293 udbg_uart_in = udbg_uart_in_40x;
294 udbg_uart_out = udbg_uart_out_40x;
295 udbg_use_uart();
296}
297
298#endif /* CONFIG_PPC_EARLY_DEBUG_40x */
299
300#ifdef CONFIG_PPC_EARLY_DEBUG_16550277#ifdef CONFIG_PPC_EARLY_DEBUG_16550
301 278
302static void __iomem *udbg_uart_early_addr;279static void __iomem *udbg_uart_early_addr;
arch/powerpc/kexec/core_64.c+37−16
@@ -467,9 +467,15 @@ static int add_node_props(void *fdt, int node_offset, const struct device_node * · 466 unmodified lines
467 * @fdt: Flattened device tree of the kernel.467 * @fdt: Flattened device tree of the kernel.
468 *468 *
469 * Returns 0 on success, negative errno on error.469 * Returns 0 on success, negative errno on error.
470 *
471 * Note: expecting no subnodes under /cpus/<node> with device_type == "cpu".
472 * If this changes, update this function to include them.
470 */473 */
471int update_cpus_node(void *fdt)474int update_cpus_node(void *fdt)
472{475{
476 int prev_node_offset;
477 const char *device_type;
478 const struct fdt_property *prop;
473 struct device_node *cpus_node, *dn;479 struct device_node *cpus_node, *dn;
474 int cpus_offset, cpus_subnode_offset, ret = 0;480 int cpus_offset, cpus_subnode_offset, ret = 0;
475 481
@@ -480,30 +486,44 @@ int update_cpus_node(void *fdt) · 4 unmodified lines
480 return cpus_offset;486 return cpus_offset;
481 }487 }
482 488
483 if (cpus_offset > 0) {489 prev_node_offset = cpus_offset;
484 ret = fdt_del_node(fdt, cpus_offset);490 /* Delete sub-nodes of /cpus node with device_type == "cpu" */
491 for (cpus_subnode_offset = fdt_first_subnode(fdt, cpus_offset); cpus_subnode_offset >= 0;) {
492 /* Ignore nodes that do not have a device_type property or device_type != "cpu" */
493 prop = fdt_get_property(fdt, cpus_subnode_offset, "device_type", NULL);
494 if (!prop || strcmp(prop->data, "cpu")) {
495 prev_node_offset = cpus_subnode_offset;
496 goto next_node;
497 }
498
499 ret = fdt_del_node(fdt, cpus_subnode_offset);
485 if (ret < 0) {500 if (ret < 0) {
486 pr_err("Error deleting /cpus node: %s\n", fdt_strerror(ret));501 pr_err("Failed to delete a cpus sub-node: %s\n", fdt_strerror(ret));
487 return -EINVAL;502 return ret;
488 }503 }
504next_node:
505 if (prev_node_offset == cpus_offset)
506 cpus_subnode_offset = fdt_first_subnode(fdt, cpus_offset);
507 else
508 cpus_subnode_offset = fdt_next_subnode(fdt, prev_node_offset);
489 }509 }
490 510
491 /* Add cpus node to fdt */511 cpus_node = of_find_node_by_path("/cpus");
492 cpus_offset = fdt_add_subnode(fdt, fdt_path_offset(fdt, "/"), "cpus");512 /* Fail here to avoid kexec/kdump kernel boot hung */
493 if (cpus_offset < 0) {513 if (!cpus_node) {
494 pr_err("Error creating /cpus node: %s\n", fdt_strerror(cpus_offset));514 pr_err("No /cpus node found\n");
495 return -EINVAL;515 return -EINVAL;
496 }516 }
497 517
498 /* Add cpus node properties */518 /* Add all /cpus sub-nodes of device_type == "cpu" to FDT */
499 cpus_node = of_find_node_by_path("/cpus");519 for_each_child_of_node(cpus_node, dn) {
500 ret = add_node_props(fdt, cpus_offset, cpus_node);520 /* Ignore device nodes that do not have a device_type property
501 of_node_put(cpus_node);521 * or device_type != "cpu".
502 if (ret < 0)522 */
503 return ret;523 device_type = of_get_property(dn, "device_type", NULL);
524 if (!device_type || strcmp(device_type, "cpu"))
525 continue;
504 526
505 /* Loop through all subnodes of cpus and add them to fdt */
506 for_each_node_by_type(dn, "cpu") {
507 cpus_subnode_offset = fdt_add_subnode(fdt, cpus_offset, dn->full_name);527 cpus_subnode_offset = fdt_add_subnode(fdt, cpus_offset, dn->full_name);
508 if (cpus_subnode_offset < 0) {528 if (cpus_subnode_offset < 0) {
509 pr_err("Unable to add %s subnode: %s\n", dn->full_name,529 pr_err("Unable to add %s subnode: %s\n", dn->full_name,
@@ -517,6 +537,7 @@ int update_cpus_node(void *fdt) · 7 unmodified lines
517 goto out;537 goto out;
518 }538 }
519out:539out:
540 of_node_put(cpus_node);
520 of_node_put(dn);541 of_node_put(dn);
521 return ret;542 return ret;
522}543}
arch/powerpc/kexec/elf_64.c+9−3
@@ -23,6 +23,7 @@ · 22 unmodified lines
23#include <linux/of_fdt.h>23#include <linux/of_fdt.h>
24#include <linux/slab.h>24#include <linux/slab.h>
25#include <linux/types.h>25#include <linux/types.h>
26#include <asm/kexec_ranges.h>
26 27
27static void *elf64_load(struct kimage *image, char *kernel_buf,28static void *elf64_load(struct kimage *image, char *kernel_buf,
28 unsigned long kernel_len, char *initrd,29 unsigned long kernel_len, char *initrd,
@@ -36,6 +37,7 @@ static void *elf64_load(struct kimage *image, char *kernel_buf, · 7 unmodified lines
36 const void *slave_code;37 const void *slave_code;
37 struct elfhdr ehdr;38 struct elfhdr ehdr;
38 char *modified_cmdline = NULL;39 char *modified_cmdline = NULL;
40 struct crash_mem *rmem = NULL;
39 struct kexec_elf_info elf_info;41 struct kexec_elf_info elf_info;
40 struct kexec_buf kbuf = { .image = image, .buf_min = 0,42 struct kexec_buf kbuf = { .image = image, .buf_min = 0,
41 .buf_max = ppc64_rma_size };43 .buf_max = ppc64_rma_size };
@@ -102,17 +104,20 @@ static void *elf64_load(struct kimage *image, char *kernel_buf, · 60 unmodified lines
102 kexec_dprintk("Loaded initrd at 0x%lx\n", initrd_load_addr);104 kexec_dprintk("Loaded initrd at 0x%lx\n", initrd_load_addr);
103 }105 }
104 106
107 ret = get_reserved_memory_ranges(&rmem);
108 if (ret)
109 goto out;
110
105 fdt = of_kexec_alloc_and_setup_fdt(image, initrd_load_addr,111 fdt = of_kexec_alloc_and_setup_fdt(image, initrd_load_addr,
106 initrd_len, cmdline,112 initrd_len, cmdline,
107 kexec_extra_fdt_size_ppc64(image));113 kexec_extra_fdt_size_ppc64(image, rmem));
108 if (!fdt) {114 if (!fdt) {
109 pr_err("Error setting up the new device tree.\n");115 pr_err("Error setting up the new device tree.\n");
110 ret = -EINVAL;116 ret = -EINVAL;
111 goto out;117 goto out;
112 }118 }
113 119
114 ret = setup_new_fdt_ppc64(image, fdt, initrd_load_addr,120 ret = setup_new_fdt_ppc64(image, fdt, rmem);
115 initrd_len, cmdline);
116 if (ret)121 if (ret)
117 goto out_free_fdt;122 goto out_free_fdt;
118 123
@@ -146,6 +151,7 @@ static void *elf64_load(struct kimage *image, char *kernel_buf, · 27 unmodified lines
146out_free_fdt:151out_free_fdt:
147 kvfree(fdt);152 kvfree(fdt);
148out:153out:
154 kfree(rmem);
149 kfree(modified_cmdline);155 kfree(modified_cmdline);
150 kexec_free_elf_info(&elf_info);156 kexec_free_elf_info(&elf_info);
151 157
arch/powerpc/kexec/file_load_64.c+35−55
@@ -18,6 +18,7 @@ · 17 unmodified lines
18#include <linux/of_fdt.h>18#include <linux/of_fdt.h>
19#include <linux/libfdt.h>19#include <linux/libfdt.h>
20#include <linux/of.h>20#include <linux/of.h>
21#include <linux/of_address.h>
21#include <linux/memblock.h>22#include <linux/memblock.h>
22#include <linux/slab.h>23#include <linux/slab.h>
23#include <linux/vmalloc.h>24#include <linux/vmalloc.h>
@@ -376,11 +377,10 @@ static int kdump_setup_usable_lmb(struct drmem_lmb *lmb, const __be32 **usm, · 352 unmodified lines
376static int add_usable_mem_property(void *fdt, struct device_node *dn,377static int add_usable_mem_property(void *fdt, struct device_node *dn,
377 struct umem_info *um_info)378 struct umem_info *um_info)
378{379{
379 int n_mem_addr_cells, n_mem_size_cells, node;380 int node;
380 char path[NODE_PATH_LEN];381 char path[NODE_PATH_LEN];
381 int i, len, ranges, ret;382 int i, ret;
382 const __be32 *prop;383 u64 base, size;
383 u64 base, end;
384 384
385 of_node_get(dn);385 of_node_get(dn);
386 386
@@ -399,41 +399,30 @@ static int add_usable_mem_property(void *fdt, struct device_node *dn, · 12 unmodified lines
399 goto out;399 goto out;
400 }400 }
401 401
402 /* Get the address & size cells */
403 n_mem_addr_cells = of_n_addr_cells(dn);
404 n_mem_size_cells = of_n_size_cells(dn);
405 kexec_dprintk("address cells: %d, size cells: %d\n", n_mem_addr_cells,
406 n_mem_size_cells);
407
408 um_info->idx = 0;402 um_info->idx = 0;
409 if (!check_realloc_usable_mem(um_info, 2)) {403 if (!check_realloc_usable_mem(um_info, 2)) {
410 ret = -ENOMEM;404 ret = -ENOMEM;
411 goto out;405 goto out;
412 }406 }
413 407
414 prop = of_get_property(dn, "reg", &len);
415 if (!prop || len <= 0) {
416 ret = 0;
417 goto out;
418 }
419
420 /*408 /*
421 * "reg" property represents sequence of (addr,size) tuples409 * "reg" property represents sequence of (addr,size) tuples
422 * each representing a memory range.410 * each representing a memory range.
423 */411 */
424 ranges = (len >> 2) / (n_mem_addr_cells + n_mem_size_cells);412 for (i = 0; ; i++) {
425 413 ret = of_property_read_reg(dn, i, &base, &size);
426 for (i = 0; i < ranges; i++) {414 if (ret)
427 base = of_read_number(prop, n_mem_addr_cells);415 break;
428 prop += n_mem_addr_cells;
429 end = base + of_read_number(prop, n_mem_size_cells) - 1;
430 prop += n_mem_size_cells;
431 416
432 ret = add_usable_mem(um_info, base, end);417 ret = add_usable_mem(um_info, base, base + size - 1);
433 if (ret)418 if (ret)
434 goto out;419 goto out;
435 }420 }
436 421
422 // No reg or empty reg? Skip this node.
423 if (i == 0)
424 goto out;
425
437 /*426 /*
438 * No kdump kernel usable memory found in this memory node.427 * No kdump kernel usable memory found in this memory node.
439 * Write (0,0) tuple in linux,usable-memory property for428 * Write (0,0) tuple in linux,usable-memory property for
@@ -803,10 +792,9 @@ static unsigned int cpu_node_size(void) · 363 unmodified lines
803 return size;792 return size;
804}793}
805 794
806static unsigned int kdump_extra_fdt_size_ppc64(struct kimage *image)795static unsigned int kdump_extra_fdt_size_ppc64(struct kimage *image, unsigned int cpu_nodes)
807{796{
808 unsigned int cpu_nodes, extra_size = 0;797 unsigned int extra_size = 0;
809 struct device_node *dn;
810 u64 usm_entries;798 u64 usm_entries;
811#ifdef CONFIG_CRASH_HOTPLUG799#ifdef CONFIG_CRASH_HOTPLUG
812 unsigned int possible_cpu_nodes;800 unsigned int possible_cpu_nodes;
@@ -826,18 +814,6 @@ static unsigned int kdump_extra_fdt_size_ppc64(struct kimage *image) · 13 unmodified lines
826 extra_size += (unsigned int)(usm_entries * sizeof(u64));814 extra_size += (unsigned int)(usm_entries * sizeof(u64));
827 }815 }
828 816
829 /*
830 * Get the number of CPU nodes in the current DT. This allows to
831 * reserve places for CPU nodes added since the boot time.
832 */
833 cpu_nodes = 0;
834 for_each_node_by_type(dn, "cpu") {
835 cpu_nodes++;
836 }
837
838 if (cpu_nodes > boot_cpu_node_count)
839 extra_size += (cpu_nodes - boot_cpu_node_count) * cpu_node_size();
840
841#ifdef CONFIG_CRASH_HOTPLUG817#ifdef CONFIG_CRASH_HOTPLUG
842 /*818 /*
843 * Make sure enough space is reserved to accommodate possible CPU nodes819 * Make sure enough space is reserved to accommodate possible CPU nodes
@@ -861,16 +837,30 @@ static unsigned int kdump_extra_fdt_size_ppc64(struct kimage *image) · 17 unmodified lines
861 *837 *
862 * Returns the estimated extra size needed for kexec/kdump kernel FDT.838 * Returns the estimated extra size needed for kexec/kdump kernel FDT.
863 */839 */
864unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image)840unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image, struct crash_mem *rmem)
865{841{
866 unsigned int extra_size = 0;842 struct device_node *dn;
843 unsigned int cpu_nodes = 0, extra_size = 0;
867 844
868 // Budget some space for the password blob. There's already extra space845 // Budget some space for the password blob. There's already extra space
869 // for the key name846 // for the key name
870 if (plpks_is_available())847 if (plpks_is_available())
871 extra_size += (unsigned int)plpks_get_passwordlen();848 extra_size += (unsigned int)plpks_get_passwordlen();
872 849
873 return extra_size + kdump_extra_fdt_size_ppc64(image);850 /* Get the number of CPU nodes in the current device tree */
851 for_each_node_by_type(dn, "cpu") {
852 cpu_nodes++;
853 }
854
855 /* Consider extra space for CPU nodes added since the boot time */
856 if (cpu_nodes > boot_cpu_node_count)
857 extra_size += (cpu_nodes - boot_cpu_node_count) * cpu_node_size();
858
859 /* Consider extra space for reserved memory ranges if any */
860 if (rmem->nr_ranges > 0)
861 extra_size += sizeof(struct fdt_reserve_entry) * rmem->nr_ranges;
862
863 return extra_size + kdump_extra_fdt_size_ppc64(image, cpu_nodes);
874}864}
875 865
876static int copy_property(void *fdt, int node_offset, const struct device_node *dn,866static int copy_property(void *fdt, int node_offset, const struct device_node *dn,
@@ -924,18 +914,13 @@ static int update_pci_dma_nodes(void *fdt, const char *dmapropname) · 47 unmodified lines
924 * being loaded.914 * being loaded.
925 * @image: kexec image being loaded.915 * @image: kexec image being loaded.
926 * @fdt: Flattened device tree for the next kernel.916 * @fdt: Flattened device tree for the next kernel.
927 * @initrd_load_addr: Address where the next initrd will be loaded.917 * @rmem: Reserved memory ranges.
928 * @initrd_len: Size of the next initrd, or 0 if there will be none.
929 * @cmdline: Command line for the next kernel, or NULL if there will
930 * be none.
931 *918 *
932 * Returns 0 on success, negative errno on error.919 * Returns 0 on success, negative errno on error.
933 */920 */
934int setup_new_fdt_ppc64(const struct kimage *image, void *fdt,921int setup_new_fdt_ppc64(const struct kimage *image, void *fdt, struct crash_mem *rmem)
935 unsigned long initrd_load_addr,
936 unsigned long initrd_len, const char *cmdline)
937{922{
938 struct crash_mem *umem = NULL, *rmem = NULL;923 struct crash_mem *umem = NULL;
939 int i, nr_ranges, ret;924 int i, nr_ranges, ret;
940 925
941#ifdef CONFIG_CRASH_DUMP926#ifdef CONFIG_CRASH_DUMP
@@ -991,10 +976,6 @@ int setup_new_fdt_ppc64(const struct kimage *image, void *fdt, · 49 unmodified lines
991 goto out;976 goto out;
992 977
993 /* Update memory reserve map */978 /* Update memory reserve map */
994 ret = get_reserved_memory_ranges(&rmem);
995 if (ret)
996 goto out;
997
998 nr_ranges = rmem ? rmem->nr_ranges : 0;979 nr_ranges = rmem ? rmem->nr_ranges : 0;
999 for (i = 0; i < nr_ranges; i++) {980 for (i = 0; i < nr_ranges; i++) {
1000 u64 base, size;981 u64 base, size;
@@ -1014,7 +995,6 @@ int setup_new_fdt_ppc64(const struct kimage *image, void *fdt, · 13 unmodified lines
1014 ret = plpks_populate_fdt(fdt);995 ret = plpks_populate_fdt(fdt);
1015 996
1016out:997out:
1017 kfree(rmem);
1018 kfree(umem);998 kfree(umem);
1019 return ret;999 return ret;
1020}1000}
arch/powerpc/kvm/book3s_hv.c+101−2
@@ -2305,7 +2305,7 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id, · 2304 unmodified lines
2305 *val = get_reg_val(id, kvmppc_get_siar_hv(vcpu));2305 *val = get_reg_val(id, kvmppc_get_siar_hv(vcpu));
2306 break;2306 break;
2307 case KVM_REG_PPC_SDAR:2307 case KVM_REG_PPC_SDAR:
2308 *val = get_reg_val(id, kvmppc_get_siar_hv(vcpu));2308 *val = get_reg_val(id, kvmppc_get_sdar_hv(vcpu));
2309 break;2309 break;
2310 case KVM_REG_PPC_SIER:2310 case KVM_REG_PPC_SIER:
2311 *val = get_reg_val(id, kvmppc_get_sier_hv(vcpu, 0));2311 *val = get_reg_val(id, kvmppc_get_sier_hv(vcpu, 0));
@@ -2349,6 +2349,15 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id, · 37 unmodified lines
2349 case KVM_REG_PPC_DAWRX1:2349 case KVM_REG_PPC_DAWRX1:
2350 *val = get_reg_val(id, kvmppc_get_dawrx1_hv(vcpu));2350 *val = get_reg_val(id, kvmppc_get_dawrx1_hv(vcpu));
2351 break;2351 break;
2352 case KVM_REG_PPC_DEXCR:
2353 *val = get_reg_val(id, kvmppc_get_dexcr_hv(vcpu));
2354 break;
2355 case KVM_REG_PPC_HASHKEYR:
2356 *val = get_reg_val(id, kvmppc_get_hashkeyr_hv(vcpu));
2357 break;
2358 case KVM_REG_PPC_HASHPKEYR:
2359 *val = get_reg_val(id, kvmppc_get_hashpkeyr_hv(vcpu));
2360 break;
2352 case KVM_REG_PPC_CIABR:2361 case KVM_REG_PPC_CIABR:
2353 *val = get_reg_val(id, kvmppc_get_ciabr_hv(vcpu));2362 *val = get_reg_val(id, kvmppc_get_ciabr_hv(vcpu));
2354 break;2363 break;
@@ -2540,7 +2549,7 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id, · 185 unmodified lines
2540 vcpu->arch.mmcrs = set_reg_val(id, *val);2549 vcpu->arch.mmcrs = set_reg_val(id, *val);
2541 break;2550 break;
2542 case KVM_REG_PPC_MMCR3:2551 case KVM_REG_PPC_MMCR3:
2543 *val = get_reg_val(id, vcpu->arch.mmcr[3]);2552 kvmppc_set_mmcr_hv(vcpu, 3, set_reg_val(id, *val));
2544 break;2553 break;
2545 case KVM_REG_PPC_PMC1 ... KVM_REG_PPC_PMC8:2554 case KVM_REG_PPC_PMC1 ... KVM_REG_PPC_PMC8:
2546 i = id - KVM_REG_PPC_PMC1;2555 i = id - KVM_REG_PPC_PMC1;
@@ -2592,6 +2601,15 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id, · 45 unmodified lines
2592 case KVM_REG_PPC_DAWRX1:2601 case KVM_REG_PPC_DAWRX1:
2593 kvmppc_set_dawrx1_hv(vcpu, set_reg_val(id, *val) & ~DAWRX_HYP);2602 kvmppc_set_dawrx1_hv(vcpu, set_reg_val(id, *val) & ~DAWRX_HYP);
2594 break;2603 break;
2604 case KVM_REG_PPC_DEXCR:
2605 kvmppc_set_dexcr_hv(vcpu, set_reg_val(id, *val));
2606 break;
2607 case KVM_REG_PPC_HASHKEYR:
2608 kvmppc_set_hashkeyr_hv(vcpu, set_reg_val(id, *val));
2609 break;
2610 case KVM_REG_PPC_HASHPKEYR:
2611 kvmppc_set_hashpkeyr_hv(vcpu, set_reg_val(id, *val));
2612 break;
2595 case KVM_REG_PPC_CIABR:2613 case KVM_REG_PPC_CIABR:
2596 kvmppc_set_ciabr_hv(vcpu, set_reg_val(id, *val));2614 kvmppc_set_ciabr_hv(vcpu, set_reg_val(id, *val));
2597 /* Don't allow setting breakpoints in hypervisor code */2615 /* Don't allow setting breakpoints in hypervisor code */
@@ -4108,6 +4126,77 @@ static void vcpu_vpa_increment_dispatch(struct kvm_vcpu *vcpu) · 1510 unmodified lines
4108 }4126 }
4109}4127}
4110 4128
4129/* Helper functions for reading L2's stats from L1's VPA */
4130#ifdef CONFIG_PPC_PSERIES
4131static DEFINE_PER_CPU(u64, l1_to_l2_cs);
4132static DEFINE_PER_CPU(u64, l2_to_l1_cs);
4133static DEFINE_PER_CPU(u64, l2_runtime_agg);
4134
4135int kvmhv_get_l2_counters_status(void)
4136{
4137 return firmware_has_feature(FW_FEATURE_LPAR) &&
4138 get_lppaca()->l2_counters_enable;
4139}
4140
4141void kvmhv_set_l2_counters_status(int cpu, bool status)
4142{
4143 if (!firmware_has_feature(FW_FEATURE_LPAR))
4144 return;
4145 if (status)
4146 lppaca_of(cpu).l2_counters_enable = 1;
4147 else
4148 lppaca_of(cpu).l2_counters_enable = 0;
4149}
4150
4151int kmvhv_counters_tracepoint_regfunc(void)
4152{
4153 int cpu;
4154
4155 for_each_present_cpu(cpu) {
4156 kvmhv_set_l2_counters_status(cpu, true);
4157 }
4158 return 0;
4159}
4160
4161void kmvhv_counters_tracepoint_unregfunc(void)
4162{
4163 int cpu;
4164
4165 for_each_present_cpu(cpu) {
4166 kvmhv_set_l2_counters_status(cpu, false);
4167 }
4168}
4169
4170static void do_trace_nested_cs_time(struct kvm_vcpu *vcpu)
4171{
4172 struct lppaca *lp = get_lppaca();
4173 u64 l1_to_l2_ns, l2_to_l1_ns, l2_runtime_ns;
4174 u64 *l1_to_l2_cs_ptr = this_cpu_ptr(&l1_to_l2_cs);
4175 u64 *l2_to_l1_cs_ptr = this_cpu_ptr(&l2_to_l1_cs);
4176 u64 *l2_runtime_agg_ptr = this_cpu_ptr(&l2_runtime_agg);
4177
4178 l1_to_l2_ns = tb_to_ns(be64_to_cpu(lp->l1_to_l2_cs_tb));
4179 l2_to_l1_ns = tb_to_ns(be64_to_cpu(lp->l2_to_l1_cs_tb));
4180 l2_runtime_ns = tb_to_ns(be64_to_cpu(lp->l2_runtime_tb));
4181 trace_kvmppc_vcpu_stats(vcpu, l1_to_l2_ns - *l1_to_l2_cs_ptr,
4182 l2_to_l1_ns - *l2_to_l1_cs_ptr,
4183 l2_runtime_ns - *l2_runtime_agg_ptr);
4184 *l1_to_l2_cs_ptr = l1_to_l2_ns;
4185 *l2_to_l1_cs_ptr = l2_to_l1_ns;
4186 *l2_runtime_agg_ptr = l2_runtime_ns;
4187}
4188
4189#else
4190int kvmhv_get_l2_counters_status(void)
4191{
4192 return 0;
4193}
4194
4195static void do_trace_nested_cs_time(struct kvm_vcpu *vcpu)
4196{
4197}
4198#endif
4199
4111static int kvmhv_vcpu_entry_nestedv2(struct kvm_vcpu *vcpu, u64 time_limit,4200static int kvmhv_vcpu_entry_nestedv2(struct kvm_vcpu *vcpu, u64 time_limit,
4112 unsigned long lpcr, u64 *tb)4201 unsigned long lpcr, u64 *tb)
4113{4202{
@@ -4116,6 +4205,11 @@ static int kvmhv_vcpu_entry_nestedv2(struct kvm_vcpu *vcpu, u64 time_limit, · 2 unmodified lines
4116 int trap;4205 int trap;
4117 long rc;4206 long rc;
4118 4207
4208 if (vcpu->arch.doorbell_request) {
4209 vcpu->arch.doorbell_request = 0;
4210 kvmppc_set_dpdes(vcpu, 1);
4211 }
4212
4119 io = &vcpu->arch.nestedv2_io;4213 io = &vcpu->arch.nestedv2_io;
4120 4214
4121 msr = mfmsr();4215 msr = mfmsr();
@@ -4156,6 +4250,10 @@ static int kvmhv_vcpu_entry_nestedv2(struct kvm_vcpu *vcpu, u64 time_limit, · 34 unmodified lines
4156 4250
4157 timer_rearm_host_dec(*tb);4251 timer_rearm_host_dec(*tb);
4158 4252
4253 /* Record context switch and guest_run_time data */
4254 if (kvmhv_get_l2_counters_status())
4255 do_trace_nested_cs_time(vcpu);
4256
4159 return trap;4257 return trap;
4160}4258}
4161 4259
@@ -6519,6 +6617,7 @@ static void kvmppc_book3s_exit_hv(void) · 2357 unmodified lines
6519 6617
6520module_init(kvmppc_book3s_init_hv);6618module_init(kvmppc_book3s_init_hv);
6521module_exit(kvmppc_book3s_exit_hv);6619module_exit(kvmppc_book3s_exit_hv);
6620MODULE_DESCRIPTION("KVM on Book3S (POWER8 and later) in hypervisor mode");
6522MODULE_LICENSE("GPL");6621MODULE_LICENSE("GPL");
6523MODULE_ALIAS_MISCDEV(KVM_MINOR);6622MODULE_ALIAS_MISCDEV(KVM_MINOR);
6524MODULE_ALIAS("devname:kvm");6623MODULE_ALIAS("devname:kvm");
arch/powerpc/kvm/book3s_hv.h+3−0
@@ -116,6 +116,9 @@ KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawr0, 64, KVMPPC_GSID_DAWR0) · 115 unmodified lines
116KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawr1, 64, KVMPPC_GSID_DAWR1)116KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawr1, 64, KVMPPC_GSID_DAWR1)
117KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawrx0, 64, KVMPPC_GSID_DAWRX0)117KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawrx0, 64, KVMPPC_GSID_DAWRX0)
118KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawrx1, 64, KVMPPC_GSID_DAWRX1)118KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawrx1, 64, KVMPPC_GSID_DAWRX1)
119KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dexcr, 64, KVMPPC_GSID_DEXCR)
120KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(hashkeyr, 64, KVMPPC_GSID_HASHKEYR)
121KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(hashpkeyr, 64, KVMPPC_GSID_HASHPKEYR)
119KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(ciabr, 64, KVMPPC_GSID_CIABR)122KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(ciabr, 64, KVMPPC_GSID_CIABR)
120KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(wort, 64, KVMPPC_GSID_WORT)123KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(wort, 64, KVMPPC_GSID_WORT)
121KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(ppr, 64, KVMPPC_GSID_PPR)124KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(ppr, 64, KVMPPC_GSID_PPR)
arch/powerpc/kvm/book3s_hv_nestedv2.c+25−0
@@ -193,6 +193,15 @@ static int gs_msg_ops_vcpu_fill_info(struct kvmppc_gs_buff *gsb, · 192 unmodified lines
193 case KVMPPC_GSID_DAWRX1:193 case KVMPPC_GSID_DAWRX1:
194 rc = kvmppc_gse_put_u32(gsb, iden, vcpu->arch.dawrx1);194 rc = kvmppc_gse_put_u32(gsb, iden, vcpu->arch.dawrx1);
195 break;195 break;
196 case KVMPPC_GSID_DEXCR:
197 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.dexcr);
198 break;
199 case KVMPPC_GSID_HASHKEYR:
200 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.hashkeyr);
201 break;
202 case KVMPPC_GSID_HASHPKEYR:
203 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.hashpkeyr);
204 break;
196 case KVMPPC_GSID_CIABR:205 case KVMPPC_GSID_CIABR:
197 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.ciabr);206 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.ciabr);
198 break;207 break;
@@ -311,6 +320,10 @@ static int gs_msg_ops_vcpu_fill_info(struct kvmppc_gs_buff *gsb, · 112 unmodified lines
311 rc = kvmppc_gse_put_u64(gsb, iden,320 rc = kvmppc_gse_put_u64(gsb, iden,
312 vcpu->arch.vcore->vtb);321 vcpu->arch.vcore->vtb);
313 break;322 break;
323 case KVMPPC_GSID_DPDES:
324 rc = kvmppc_gse_put_u64(gsb, iden,
325 vcpu->arch.vcore->dpdes);
326 break;
314 case KVMPPC_GSID_LPCR:327 case KVMPPC_GSID_LPCR:
315 rc = kvmppc_gse_put_u64(gsb, iden,328 rc = kvmppc_gse_put_u64(gsb, iden,
316 vcpu->arch.vcore->lpcr);329 vcpu->arch.vcore->lpcr);
@@ -441,6 +454,15 @@ static int gs_msg_ops_vcpu_refresh_info(struct kvmppc_gs_msg *gsm, · 124 unmodified lines
441 case KVMPPC_GSID_DAWRX1:454 case KVMPPC_GSID_DAWRX1:
442 vcpu->arch.dawrx1 = kvmppc_gse_get_u32(gse);455 vcpu->arch.dawrx1 = kvmppc_gse_get_u32(gse);
443 break;456 break;
457 case KVMPPC_GSID_DEXCR:
458 vcpu->arch.dexcr = kvmppc_gse_get_u64(gse);
459 break;
460 case KVMPPC_GSID_HASHKEYR:
461 vcpu->arch.hashkeyr = kvmppc_gse_get_u64(gse);
462 break;
463 case KVMPPC_GSID_HASHPKEYR:
464 vcpu->arch.hashpkeyr = kvmppc_gse_get_u64(gse);
465 break;
444 case KVMPPC_GSID_CIABR:466 case KVMPPC_GSID_CIABR:
445 vcpu->arch.ciabr = kvmppc_gse_get_u64(gse);467 vcpu->arch.ciabr = kvmppc_gse_get_u64(gse);
446 break;468 break;
@@ -543,6 +565,9 @@ static int gs_msg_ops_vcpu_refresh_info(struct kvmppc_gs_msg *gsm, · 96 unmodified lines
543 case KVMPPC_GSID_VTB:565 case KVMPPC_GSID_VTB:
544 vcpu->arch.vcore->vtb = kvmppc_gse_get_u64(gse);566 vcpu->arch.vcore->vtb = kvmppc_gse_get_u64(gse);
545 break;567 break;
568 case KVMPPC_GSID_DPDES:
569 vcpu->arch.vcore->dpdes = kvmppc_gse_get_u64(gse);
570 break;
546 case KVMPPC_GSID_LPCR:571 case KVMPPC_GSID_LPCR:
547 vcpu->arch.vcore->lpcr = kvmppc_gse_get_u64(gse);572 vcpu->arch.vcore->lpcr = kvmppc_gse_get_u64(gse);
548 break;573 break;
arch/powerpc/kvm/book3s_pr.c+1−0
@@ -2111,6 +2111,7 @@ void kvmppc_book3s_exit_pr(void) · 2110 unmodified lines
2111module_init(kvmppc_book3s_init_pr);2111module_init(kvmppc_book3s_init_pr);
2112module_exit(kvmppc_book3s_exit_pr);2112module_exit(kvmppc_book3s_exit_pr);
2113 2113
2114MODULE_DESCRIPTION("KVM on Book3S without using hypervisor mode");
2114MODULE_LICENSE("GPL");2115MODULE_LICENSE("GPL");
2115MODULE_ALIAS_MISCDEV(KVM_MINOR);2116MODULE_ALIAS_MISCDEV(KVM_MINOR);
2116MODULE_ALIAS("devname:kvm");2117MODULE_ALIAS("devname:kvm");
arch/powerpc/kvm/test-guest-state-buffer.c+2−1
@@ -151,7 +151,7 @@ static void test_gs_bitmap(struct kunit *test) · 150 unmodified lines
151 i++;151 i++;
152 }152 }
153 153
154 for (u16 iden = KVMPPC_GSID_GPR(0); iden <= KVMPPC_GSID_CTRL; iden++) {154 for (u16 iden = KVMPPC_GSID_GPR(0); iden <= KVMPPC_GSE_DW_REGS_END; iden++) {
155 kvmppc_gsbm_set(&gsbm, iden);155 kvmppc_gsbm_set(&gsbm, iden);
156 kvmppc_gsbm_set(&gsbm1, iden);156 kvmppc_gsbm_set(&gsbm1, iden);
157 KUNIT_EXPECT_TRUE(test, kvmppc_gsbm_test(&gsbm, iden));157 KUNIT_EXPECT_TRUE(test, kvmppc_gsbm_test(&gsbm, iden));
@@ -325,4 +325,5 @@ static struct kunit_suite guest_state_buffer_test_suite = { · 167 unmodified lines
325 325
326kunit_test_suites(&guest_state_buffer_test_suite);326kunit_test_suites(&guest_state_buffer_test_suite);
327 327
328MODULE_DESCRIPTION("KUnit tests for Guest State Buffer APIs");
328MODULE_LICENSE("GPL");329MODULE_LICENSE("GPL");
arch/powerpc/kvm/trace_hv.h+29−0
@@ -512,6 +512,35 @@ TRACE_EVENT(kvmppc_run_vcpu_exit, · 511 unmodified lines
512 __entry->vcpu_id, __entry->exit, __entry->ret)512 __entry->vcpu_id, __entry->exit, __entry->ret)
513);513);
514 514
515#ifdef CONFIG_PPC_PSERIES
516
517TRACE_EVENT_FN_COND(kvmppc_vcpu_stats,
518 TP_PROTO(struct kvm_vcpu *vcpu, u64 l1_to_l2_cs, u64 l2_to_l1_cs, u64 l2_runtime),
519
520 TP_ARGS(vcpu, l1_to_l2_cs, l2_to_l1_cs, l2_runtime),
521
522 TP_CONDITION(l1_to_l2_cs || l2_to_l1_cs || l2_runtime),
523
524 TP_STRUCT__entry(
525 __field(int, vcpu_id)
526 __field(u64, l1_to_l2_cs)
527 __field(u64, l2_to_l1_cs)
528 __field(u64, l2_runtime)
529 ),
530
531 TP_fast_assign(
532 __entry->vcpu_id = vcpu->vcpu_id;
533 __entry->l1_to_l2_cs = l1_to_l2_cs;
534 __entry->l2_to_l1_cs = l2_to_l1_cs;
535 __entry->l2_runtime = l2_runtime;
536 ),
537
538 TP_printk("VCPU %d: l1_to_l2_cs_time=%llu ns l2_to_l1_cs_time=%llu ns l2_runtime=%llu ns",
539 __entry->vcpu_id, __entry->l1_to_l2_cs,
540 __entry->l2_to_l1_cs, __entry->l2_runtime),
541 kmvhv_counters_tracepoint_regfunc, kmvhv_counters_tracepoint_unregfunc
542);
543#endif
515#endif /* _TRACE_KVM_HV_H */544#endif /* _TRACE_KVM_HV_H */
516 545
517/* This part must be outside protection */546/* This part must be outside protection */
arch/powerpc/mm/book3s64/radix_pgtable.c+80−4
@@ -17,6 +17,7 @@ · 16 unmodified lines
17#include <linux/hugetlb.h>17#include <linux/hugetlb.h>
18#include <linux/string_helpers.h>18#include <linux/string_helpers.h>
19#include <linux/memory.h>19#include <linux/memory.h>
20#include <linux/kfence.h>
20 21
21#include <asm/pgalloc.h>22#include <asm/pgalloc.h>
22#include <asm/mmu_context.h>23#include <asm/mmu_context.h>
@@ -31,6 +32,7 @@ · 8 unmodified lines
31#include <asm/uaccess.h>32#include <asm/uaccess.h>
32#include <asm/ultravisor.h>33#include <asm/ultravisor.h>
33#include <asm/set_memory.h>34#include <asm/set_memory.h>
35#include <asm/kfence.h>
34 36
35#include <trace/events/thp.h>37#include <trace/events/thp.h>
36 38
@@ -293,7 +295,8 @@ static unsigned long next_boundary(unsigned long addr, unsigned long end) · 256 unmodified lines
293 295
294static int __meminit create_physical_mapping(unsigned long start,296static int __meminit create_physical_mapping(unsigned long start,
295 unsigned long end,297 unsigned long end,
296 int nid, pgprot_t _prot)298 int nid, pgprot_t _prot,
299 unsigned long mapping_sz_limit)
297{300{
298 unsigned long vaddr, addr, mapping_size = 0;301 unsigned long vaddr, addr, mapping_size = 0;
299 bool prev_exec, exec = false;302 bool prev_exec, exec = false;
@@ -301,7 +304,10 @@ static int __meminit create_physical_mapping(unsigned long start, · 1 unmodified line
301 int psize;304 int psize;
302 unsigned long max_mapping_size = memory_block_size;305 unsigned long max_mapping_size = memory_block_size;
303 306
304 if (debug_pagealloc_enabled_or_kfence())307 if (mapping_sz_limit < max_mapping_size)
308 max_mapping_size = mapping_sz_limit;
309
310 if (debug_pagealloc_enabled())
305 max_mapping_size = PAGE_SIZE;311 max_mapping_size = PAGE_SIZE;
306 312
307 start = ALIGN(start, PAGE_SIZE);313 start = ALIGN(start, PAGE_SIZE);
@@ -356,8 +362,74 @@ static int __meminit create_physical_mapping(unsigned long start, · 48 unmodified lines
356 return 0;362 return 0;
357}363}
358 364
365#ifdef CONFIG_KFENCE
366static bool __ro_after_init kfence_early_init = !!CONFIG_KFENCE_SAMPLE_INTERVAL;
367
368static int __init parse_kfence_early_init(char *arg)
369{
370 int val;
371
372 if (get_option(&arg, &val))
373 kfence_early_init = !!val;
374 return 0;
375}
376early_param("kfence.sample_interval", parse_kfence_early_init);
377
378static inline phys_addr_t alloc_kfence_pool(void)
379{
380 phys_addr_t kfence_pool;
381
382 /*
383 * TODO: Support to enable KFENCE after bootup depends on the ability to
384 * split page table mappings. As such support is not currently
385 * implemented for radix pagetables, support enabling KFENCE
386 * only at system startup for now.
387 *
388 * After support for splitting mappings is available on radix,
389 * alloc_kfence_pool() & map_kfence_pool() can be dropped and
390 * mapping for __kfence_pool memory can be
391 * split during arch_kfence_init_pool().
392 */
393 if (!kfence_early_init)
394 goto no_kfence;
395
396 kfence_pool = memblock_phys_alloc(KFENCE_POOL_SIZE, PAGE_SIZE);
397 if (!kfence_pool)
398 goto no_kfence;
399
400 memblock_mark_nomap(kfence_pool, KFENCE_POOL_SIZE);
401 return kfence_pool;
402
403no_kfence:
404 disable_kfence();
405 return 0;
406}
407
408static inline void map_kfence_pool(phys_addr_t kfence_pool)
409{
410 if (!kfence_pool)
411 return;
412
413 if (create_physical_mapping(kfence_pool, kfence_pool + KFENCE_POOL_SIZE,
414 -1, PAGE_KERNEL, PAGE_SIZE))
415 goto err;
416
417 memblock_clear_nomap(kfence_pool, KFENCE_POOL_SIZE);
418 __kfence_pool = __va(kfence_pool);
419 return;
420
421err:
422 memblock_phys_free(kfence_pool, KFENCE_POOL_SIZE);
423 disable_kfence();
424}
425#else
426static inline phys_addr_t alloc_kfence_pool(void) { return 0; }
427static inline void map_kfence_pool(phys_addr_t kfence_pool) { }
428#endif
429
359static void __init radix_init_pgtable(void)430static void __init radix_init_pgtable(void)
360{431{
432 phys_addr_t kfence_pool;
361 unsigned long rts_field;433 unsigned long rts_field;
362 phys_addr_t start, end;434 phys_addr_t start, end;
363 u64 i;435 u64 i;
@@ -365,6 +437,8 @@ static void __init radix_init_pgtable(void) · 1 unmodified line
365 /* We don't support slb for radix */437 /* We don't support slb for radix */
366 slb_set_size(0);438 slb_set_size(0);
367 439
440 kfence_pool = alloc_kfence_pool();
441
368 /*442 /*
369 * Create the linear mapping443 * Create the linear mapping
370 */444 */
@@ -381,9 +455,11 @@ static void __init radix_init_pgtable(void) · 10 unmodified lines
381 }455 }
382 456
383 WARN_ON(create_physical_mapping(start, end,457 WARN_ON(create_physical_mapping(start, end,
384 -1, PAGE_KERNEL));458 -1, PAGE_KERNEL, ~0UL));
385 }459 }
386 460
461 map_kfence_pool(kfence_pool);
462
387 if (!cpu_has_feature(CPU_FTR_HVMODE) &&463 if (!cpu_has_feature(CPU_FTR_HVMODE) &&
388 cpu_has_feature(CPU_FTR_P9_RADIX_PREFETCH_BUG)) {464 cpu_has_feature(CPU_FTR_P9_RADIX_PREFETCH_BUG)) {
389 /*465 /*
@@ -875,7 +951,7 @@ int __meminit radix__create_section_mapping(unsigned long start, · 485 unmodified lines
875 }951 }
876 952
877 return create_physical_mapping(__pa(start), __pa(end),953 return create_physical_mapping(__pa(start), __pa(end),
878 nid, prot);954 nid, prot, ~0UL);
879}955}
880 956
881int __meminit radix__remove_section_mapping(unsigned long start, unsigned long end)957int __meminit radix__remove_section_mapping(unsigned long start, unsigned long end)
arch/powerpc/mm/drmem.c+1−3
@@ -491,10 +491,8 @@ static int __init drmem_init(void) · 490 unmodified lines
491 const __be32 *prop;491 const __be32 *prop;
492 492
493 dn = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");493 dn = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
494 if (!dn) {494 if (!dn)
495 pr_info("No dynamic reconfiguration memory found\n");
496 return 0;495 return 0;
497 }
498 496
499 if (init_drmem_lmb_size(dn)) {497 if (init_drmem_lmb_size(dn)) {
500 of_node_put(dn);498 of_node_put(dn);
arch/powerpc/mm/fault.c+2−2
@@ -368,13 +368,13 @@ static void sanity_check_fault(bool is_write, bool is_user, · 367 unmodified lines
368 * Define the correct "is_write" bit in error_code based368 * Define the correct "is_write" bit in error_code based
369 * on the processor family369 * on the processor family
370 */370 */
371#if (defined(CONFIG_4xx) || defined(CONFIG_BOOKE))371#ifdef CONFIG_BOOKE
372#define page_fault_is_write(__err) ((__err) & ESR_DST)372#define page_fault_is_write(__err) ((__err) & ESR_DST)
373#else373#else
374#define page_fault_is_write(__err) ((__err) & DSISR_ISSTORE)374#define page_fault_is_write(__err) ((__err) & DSISR_ISSTORE)
375#endif375#endif
376 376
377#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)377#ifdef CONFIG_BOOKE
378#define page_fault_is_bad(__err) (0)378#define page_fault_is_bad(__err) (0)
379#elif defined(CONFIG_PPC_8xx)379#elif defined(CONFIG_PPC_8xx)
380#define page_fault_is_bad(__err) ((__err) & DSISR_NOEXEC_OR_G)380#define page_fault_is_bad(__err) ((__err) & DSISR_NOEXEC_OR_G)
arch/powerpc/mm/init-common.c+3−0
@@ -31,6 +31,9 @@ EXPORT_SYMBOL_GPL(kernstart_virt_addr); · 30 unmodified lines
31 31
32bool disable_kuep = !IS_ENABLED(CONFIG_PPC_KUEP);32bool disable_kuep = !IS_ENABLED(CONFIG_PPC_KUEP);
33bool disable_kuap = !IS_ENABLED(CONFIG_PPC_KUAP);33bool disable_kuap = !IS_ENABLED(CONFIG_PPC_KUAP);
34#ifdef CONFIG_KFENCE
35bool __ro_after_init kfence_disabled;
36#endif
34 37
35static int __init parse_nosmep(char *p)38static int __init parse_nosmep(char *p)
36{39{
arch/powerpc/mm/mmu_context.c+1−1
@@ -21,7 +21,7 @@ static inline void switch_mm_pgdir(struct task_struct *tsk, · 20 unmodified lines
21#ifdef CONFIG_PPC_BOOK3S_3221#ifdef CONFIG_PPC_BOOK3S_32
22 tsk->thread.sr0 = mm->context.sr0;22 tsk->thread.sr0 = mm->context.sr0;
23#endif23#endif
24#if defined(CONFIG_BOOKE_OR_40x) && defined(CONFIG_PPC_KUAP)24#if defined(CONFIG_BOOKE) && defined(CONFIG_PPC_KUAP)
25 tsk->thread.pid = mm->context.id;25 tsk->thread.pid = mm->context.id;
26#endif26#endif
27}27}
arch/powerpc/mm/mmu_decl.h+4−4
@@ -20,9 +20,9 @@ · 19 unmodified lines
20#include <asm/trace.h>20#include <asm/trace.h>
21 21
22/*22/*
23 * On 40x and 8xx, we directly inline tlbia and tlbivax23 * On 8xx, we directly inline tlbia
24 */24 */
25#if defined(CONFIG_40x) || defined(CONFIG_PPC_8xx)25#ifdef CONFIG_PPC_8xx
26static inline void _tlbil_all(void)26static inline void _tlbil_all(void)
27{27{
28 asm volatile ("sync; tlbia; isync" : : : "memory");28 asm volatile ("sync; tlbia; isync" : : : "memory");
@@ -35,7 +35,7 @@ static inline void _tlbil_pid(unsigned int pid) · 6 unmodified lines
35}35}
36#define _tlbil_pid_noind(pid) _tlbil_pid(pid)36#define _tlbil_pid_noind(pid) _tlbil_pid(pid)
37 37
38#else /* CONFIG_40x || CONFIG_PPC_8xx */38#else /* CONFIG_PPC_8xx */
39extern void _tlbil_all(void);39extern void _tlbil_all(void);
40extern void _tlbil_pid(unsigned int pid);40extern void _tlbil_pid(unsigned int pid);
41#ifdef CONFIG_PPC_BOOK3E_6441#ifdef CONFIG_PPC_BOOK3E_64
@@ -43,7 +43,7 @@ extern void _tlbil_pid_noind(unsigned int pid); · 1 unmodified line
43#else43#else
44#define _tlbil_pid_noind(pid) _tlbil_pid(pid)44#define _tlbil_pid_noind(pid) _tlbil_pid(pid)
45#endif45#endif
46#endif /* !(CONFIG_40x || CONFIG_PPC_8xx) */46#endif /* !CONFIG_PPC_8xx */
47 47
48/*48/*
49 * On 8xx, we directly inline tlbie, on others, it's extern49 * On 8xx, we directly inline tlbie, on others, it's extern
arch/powerpc/mm/nohash/40x.c+0−161
@@ -1,161 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * This file contains the routines for initializing the MMU
4 * on the 4xx series of chips.
5 * -- paulus
6 *
7 * Derived from arch/ppc/mm/init.c:
8 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
9 *
10 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
11 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
12 * Copyright (C) 1996 Paul Mackerras
13 *
14 * Derived from "arch/i386/mm/init.c"
15 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
16 */
17
18#include <linux/signal.h>
19#include <linux/sched.h>
20#include <linux/kernel.h>
21#include <linux/errno.h>
22#include <linux/string.h>
23#include <linux/types.h>
24#include <linux/ptrace.h>
25#include <linux/mman.h>
26#include <linux/mm.h>
27#include <linux/swap.h>
28#include <linux/stddef.h>
29#include <linux/vmalloc.h>
30#include <linux/init.h>
31#include <linux/delay.h>
32#include <linux/highmem.h>
33#include <linux/memblock.h>
34
35#include <asm/io.h>
36#include <asm/mmu_context.h>
37#include <asm/mmu.h>
38#include <linux/uaccess.h>
39#include <asm/smp.h>
40#include <asm/bootx.h>
41#include <asm/machdep.h>
42#include <asm/setup.h>
43
44#include <mm/mmu_decl.h>
45
46/*
47 * MMU_init_hw does the chip-specific initialization of the MMU hardware.
48 */
49void __init MMU_init_hw(void)
50{
51 int i;
52 unsigned long zpr;
53
54 /*
55 * The Zone Protection Register (ZPR) defines how protection will
56 * be applied to every page which is a member of a given zone.
57 * The zone index bits (of ZSEL) in the PTE are used for software
58 * indicators. We use the 4 upper bits of virtual address to select
59 * the zone. We set all zones above TASK_SIZE to zero, allowing
60 * only kernel access as indicated in the PTE. For zones below
61 * TASK_SIZE, we set a 01 binary (a value of 10 will not work)
62 * to allow user access as indicated in the PTE. This also allows
63 * kernel access as indicated in the PTE.
64 */
65
66 for (i = 0, zpr = 0; i < TASK_SIZE >> 28; i++)
67 zpr |= 1 << (30 - i * 2);
68
69 mtspr(SPRN_ZPR, zpr);
70
71 flush_instruction_cache();
72
73 /*
74 * Set up the real-mode cache parameters for the exception vector
75 * handlers (which are run in real-mode).
76 */
77
78 mtspr(SPRN_DCWR, 0x00000000); /* All caching is write-back */
79
80 /*
81 * Cache instruction and data space where the exception
82 * vectors and the kernel live in real-mode.
83 */
84
85 mtspr(SPRN_DCCR, 0xFFFF0000); /* 2GByte of data space at 0x0. */
86 mtspr(SPRN_ICCR, 0xFFFF0000); /* 2GByte of instr. space at 0x0. */
87}
88
89#define LARGE_PAGE_SIZE_16M (1<<24)
90#define LARGE_PAGE_SIZE_4M (1<<22)
91
92unsigned long __init mmu_mapin_ram(unsigned long base, unsigned long top)
93{
94 unsigned long v, s, mapped;
95 phys_addr_t p;
96
97 v = KERNELBASE;
98 p = 0;
99 s = total_lowmem;
100
101 if (IS_ENABLED(CONFIG_KFENCE))
102 return 0;
103
104 if (debug_pagealloc_enabled())
105 return 0;
106
107 if (strict_kernel_rwx_enabled())
108 return 0;
109
110 while (s >= LARGE_PAGE_SIZE_16M) {
111 pmd_t *pmdp;
112 unsigned long val = p | _PMD_SIZE_16M | _PAGE_EXEC | _PAGE_RW;
113
114 pmdp = pmd_off_k(v);
115 *pmdp++ = __pmd(val);
116 *pmdp++ = __pmd(val);
117 *pmdp++ = __pmd(val);
118 *pmdp++ = __pmd(val);
119
120 v += LARGE_PAGE_SIZE_16M;
121 p += LARGE_PAGE_SIZE_16M;
122 s -= LARGE_PAGE_SIZE_16M;
123 }
124
125 while (s >= LARGE_PAGE_SIZE_4M) {
126 pmd_t *pmdp;
127 unsigned long val = p | _PMD_SIZE_4M | _PAGE_EXEC | _PAGE_RW;
128
129 pmdp = pmd_off_k(v);
130 *pmdp = __pmd(val);
131
132 v += LARGE_PAGE_SIZE_4M;
133 p += LARGE_PAGE_SIZE_4M;
134 s -= LARGE_PAGE_SIZE_4M;
135 }
136
137 mapped = total_lowmem - s;
138
139 /* If the size of RAM is not an exact power of two, we may not
140 * have covered RAM in its entirety with 16 and 4 MiB
141 * pages. Consequently, restrict the top end of RAM currently
142 * allocable so that calls to the MEMBLOCK to allocate PTEs for "tail"
143 * coverage with normal-sized pages (or other reasons) do not
144 * attempt to allocate outside the allowed range.
145 */
146 memblock_set_current_limit(mapped);
147
148 return mapped;
149}
150
151void setup_initial_memory_limit(phys_addr_t first_memblock_base,
152 phys_addr_t first_memblock_size)
153{
154 /* We don't currently support the first MEMBLOCK not mapping 0
155 * physical on those processors
156 */
157 BUG_ON(first_memblock_base != 0);
158
159 /* 40x can only access 16MB at the moment (see head_40x.S) */
160 memblock_set_current_limit(min_t(u64, first_memblock_size, 0x00800000));
161}
arch/powerpc/mm/nohash/Makefile+0−1
@@ -2,7 +2,6 @@ · 1 unmodified line
2 2
3obj-y += mmu_context.o tlb.o tlb_low.o kup.o3obj-y += mmu_context.o tlb.o tlb_low.o kup.o
4obj-$(CONFIG_PPC_BOOK3E_64) += tlb_low_64e.o book3e_pgtable.o4obj-$(CONFIG_PPC_BOOK3E_64) += tlb_low_64e.o book3e_pgtable.o
5obj-$(CONFIG_40x) += 40x.o
6obj-$(CONFIG_44x) += 44x.o5obj-$(CONFIG_44x) += 44x.o
7obj-$(CONFIG_PPC_8xx) += 8xx.o6obj-$(CONFIG_PPC_8xx) += 8xx.o
8obj-$(CONFIG_PPC_E500) += e500.o7obj-$(CONFIG_PPC_E500) += e500.o
arch/powerpc/mm/nohash/kup.c+0−2
@@ -15,8 +15,6 @@ · 14 unmodified lines
15void setup_kuap(bool disabled)15void setup_kuap(bool disabled)
16{16{
17 if (disabled) {17 if (disabled) {
18 if (IS_ENABLED(CONFIG_40x))
19 disable_kuep = true;
20 if (smp_processor_id() == boot_cpuid)18 if (smp_processor_id() == boot_cpuid)
21 cur_cpu_spec->mmu_features &= ~MMU_FTR_KUAP;19 cur_cpu_spec->mmu_features &= ~MMU_FTR_KUAP;
22 return;20 return;
arch/powerpc/mm/nohash/mmu_context.c+1−4
@@ -219,9 +219,6 @@ static void set_context(unsigned long id, pgd_t *pgd) · 218 unmodified lines
219 /* sync */219 /* sync */
220 mb();220 mb();
221 } else if (kuap_is_disabled()) {221 } else if (kuap_is_disabled()) {
222 if (IS_ENABLED(CONFIG_40x))
223 mb(); /* sync */
224
225 mtspr(SPRN_PID, id);222 mtspr(SPRN_PID, id);
226 isync();223 isync();
227 }224 }
@@ -306,7 +303,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next, · 78 unmodified lines
306 if (IS_ENABLED(CONFIG_BDI_SWITCH))303 if (IS_ENABLED(CONFIG_BDI_SWITCH))
307 abatron_pteptrs[1] = next->pgd;304 abatron_pteptrs[1] = next->pgd;
308 set_context(id, next->pgd);305 set_context(id, next->pgd);
309#if defined(CONFIG_BOOKE_OR_40x) && defined(CONFIG_PPC_KUAP)306#if defined(CONFIG_BOOKE) && defined(CONFIG_PPC_KUAP)
310 tsk->thread.pid = id;307 tsk->thread.pid = id;
311#endif308#endif
312 raw_spin_unlock(&context_lock);309 raw_spin_unlock(&context_lock);
arch/powerpc/mm/nohash/tlb_low.S+1−26
@@ -32,32 +32,7 @@ · 31 unmodified lines
32#include <asm/asm-compat.h>32#include <asm/asm-compat.h>
33#include <asm/feature-fixups.h>33#include <asm/feature-fixups.h>
34 34
35#if defined(CONFIG_40x)35#if defined(CONFIG_PPC_8xx)
36
37/*
38 * 40x implementation needs only tlbil_va
39 */
40_GLOBAL(__tlbil_va)
41 /* We run the search with interrupts disabled because we have to change
42 * the PID and I don't want to preempt when that happens.
43 */
44 mfmsr r5
45 mfspr r6,SPRN_PID
46 wrteei 0
47 mtspr SPRN_PID,r4
48 tlbsx. r3, 0, r3
49 mtspr SPRN_PID,r6
50 wrtee r5
51 bne 1f
52 sync
53 /* There are only 64 TLB entries, so r3 < 64, which means bit 25 is
54 * clear. Since 25 is the V bit in the TLB_TAG, loading this value
55 * will invalidate the TLB entry. */
56 tlbwe r3, r3, TLB_TAG
57 isync
581: blr
59
60#elif defined(CONFIG_PPC_8xx)
61 36
62/*37/*
63 * Nothing to do for 8xx, everything is inline38 * Nothing to do for 8xx, everything is inline
arch/powerpc/mm/numa.c+13−1
@@ -896,7 +896,7 @@ static int __init numa_setup_drmem_lmb(struct drmem_lmb *lmb, · 895 unmodified lines
896 896
897static int __init parse_numa_properties(void)897static int __init parse_numa_properties(void)
898{898{
899 struct device_node *memory;899 struct device_node *memory, *pci;
900 int default_nid = 0;900 int default_nid = 0;
901 unsigned long i;901 unsigned long i;
902 const __be32 *associativity;902 const __be32 *associativity;
@@ -1010,6 +1010,18 @@ new_range: · 107 unmodified lines
1010 goto new_range;1010 goto new_range;
1011 }1011 }
1012 1012
1013 for_each_node_by_name(pci, "pci") {
1014 int nid = NUMA_NO_NODE;
1015
1016 associativity = of_get_associativity(pci);
1017 if (associativity) {
1018 nid = associativity_to_nid(associativity);
1019 initialize_form1_numa_distance(associativity);
1020 }
1021 if (likely(nid >= 0) && !node_online(nid))
1022 node_set_online(nid);
1023 }
1024
1013 /*1025 /*
1014 * Now do the same thing for each MEMBLOCK listed in the1026 * Now do the same thing for each MEMBLOCK listed in the
1015 * ibm,dynamic-memory property in the1027 * ibm,dynamic-memory property in the
arch/powerpc/mm/ptdump/Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
2 2
3obj-y += ptdump.o3obj-y += ptdump.o
4 4
5obj-$(CONFIG_4xx) += shared.o5obj-$(CONFIG_44x) += shared.o
6obj-$(CONFIG_PPC_8xx) += 8xx.o6obj-$(CONFIG_PPC_8xx) += 8xx.o
7obj-$(CONFIG_PPC_E500) += shared.o7obj-$(CONFIG_PPC_E500) += shared.o
8obj-$(CONFIG_PPC_BOOK3S_32) += shared.o8obj-$(CONFIG_PPC_BOOK3S_32) += shared.o
arch/powerpc/net/bpf_jit_comp64.c+88−30
@@ -510,20 +510,33 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct code · 509 unmodified lines
510 case BPF_ALU | BPF_DIV | BPF_X: /* (u32) dst /= (u32) src */510 case BPF_ALU | BPF_DIV | BPF_X: /* (u32) dst /= (u32) src */
511 case BPF_ALU | BPF_MOD | BPF_X: /* (u32) dst %= (u32) src */511 case BPF_ALU | BPF_MOD | BPF_X: /* (u32) dst %= (u32) src */
512 if (BPF_OP(code) == BPF_MOD) {512 if (BPF_OP(code) == BPF_MOD) {
513 EMIT(PPC_RAW_DIVWU(tmp1_reg, dst_reg, src_reg));513 if (off)
514 EMIT(PPC_RAW_DIVW(tmp1_reg, dst_reg, src_reg));
515 else
516 EMIT(PPC_RAW_DIVWU(tmp1_reg, dst_reg, src_reg));
517
514 EMIT(PPC_RAW_MULW(tmp1_reg, src_reg, tmp1_reg));518 EMIT(PPC_RAW_MULW(tmp1_reg, src_reg, tmp1_reg));
515 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg));519 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg));
516 } else520 } else
517 EMIT(PPC_RAW_DIVWU(dst_reg, dst_reg, src_reg));521 if (off)
522 EMIT(PPC_RAW_DIVW(dst_reg, dst_reg, src_reg));
523 else
524 EMIT(PPC_RAW_DIVWU(dst_reg, dst_reg, src_reg));
518 goto bpf_alu32_trunc;525 goto bpf_alu32_trunc;
519 case BPF_ALU64 | BPF_DIV | BPF_X: /* dst /= src */526 case BPF_ALU64 | BPF_DIV | BPF_X: /* dst /= src */
520 case BPF_ALU64 | BPF_MOD | BPF_X: /* dst %= src */527 case BPF_ALU64 | BPF_MOD | BPF_X: /* dst %= src */
521 if (BPF_OP(code) == BPF_MOD) {528 if (BPF_OP(code) == BPF_MOD) {
522 EMIT(PPC_RAW_DIVDU(tmp1_reg, dst_reg, src_reg));529 if (off)
530 EMIT(PPC_RAW_DIVD(tmp1_reg, dst_reg, src_reg));
531 else
532 EMIT(PPC_RAW_DIVDU(tmp1_reg, dst_reg, src_reg));
523 EMIT(PPC_RAW_MULD(tmp1_reg, src_reg, tmp1_reg));533 EMIT(PPC_RAW_MULD(tmp1_reg, src_reg, tmp1_reg));
524 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg));534 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg));
525 } else535 } else
526 EMIT(PPC_RAW_DIVDU(dst_reg, dst_reg, src_reg));536 if (off)
537 EMIT(PPC_RAW_DIVD(dst_reg, dst_reg, src_reg));
538 else
539 EMIT(PPC_RAW_DIVDU(dst_reg, dst_reg, src_reg));
527 break;540 break;
528 case BPF_ALU | BPF_MOD | BPF_K: /* (u32) dst %= (u32) imm */541 case BPF_ALU | BPF_MOD | BPF_K: /* (u32) dst %= (u32) imm */
529 case BPF_ALU | BPF_DIV | BPF_K: /* (u32) dst /= (u32) imm */542 case BPF_ALU | BPF_DIV | BPF_K: /* (u32) dst /= (u32) imm */
@@ -544,19 +557,31 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct code · 14 unmodified lines
544 switch (BPF_CLASS(code)) {557 switch (BPF_CLASS(code)) {
545 case BPF_ALU:558 case BPF_ALU:
546 if (BPF_OP(code) == BPF_MOD) {559 if (BPF_OP(code) == BPF_MOD) {
547 EMIT(PPC_RAW_DIVWU(tmp2_reg, dst_reg, tmp1_reg));560 if (off)
561 EMIT(PPC_RAW_DIVW(tmp2_reg, dst_reg, tmp1_reg));
562 else
563 EMIT(PPC_RAW_DIVWU(tmp2_reg, dst_reg, tmp1_reg));
548 EMIT(PPC_RAW_MULW(tmp1_reg, tmp1_reg, tmp2_reg));564 EMIT(PPC_RAW_MULW(tmp1_reg, tmp1_reg, tmp2_reg));
549 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg));565 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg));
550 } else566 } else
551 EMIT(PPC_RAW_DIVWU(dst_reg, dst_reg, tmp1_reg));567 if (off)
568 EMIT(PPC_RAW_DIVW(dst_reg, dst_reg, tmp1_reg));
569 else
570 EMIT(PPC_RAW_DIVWU(dst_reg, dst_reg, tmp1_reg));
552 break;571 break;
553 case BPF_ALU64:572 case BPF_ALU64:
554 if (BPF_OP(code) == BPF_MOD) {573 if (BPF_OP(code) == BPF_MOD) {
555 EMIT(PPC_RAW_DIVDU(tmp2_reg, dst_reg, tmp1_reg));574 if (off)
575 EMIT(PPC_RAW_DIVD(tmp2_reg, dst_reg, tmp1_reg));
576 else
577 EMIT(PPC_RAW_DIVDU(tmp2_reg, dst_reg, tmp1_reg));
556 EMIT(PPC_RAW_MULD(tmp1_reg, tmp1_reg, tmp2_reg));578 EMIT(PPC_RAW_MULD(tmp1_reg, tmp1_reg, tmp2_reg));
557 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg));579 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg));
558 } else580 } else
559 EMIT(PPC_RAW_DIVDU(dst_reg, dst_reg, tmp1_reg));581 if (off)
582 EMIT(PPC_RAW_DIVD(dst_reg, dst_reg, tmp1_reg));
583 else
584 EMIT(PPC_RAW_DIVDU(dst_reg, dst_reg, tmp1_reg));
560 break;585 break;
561 }586 }
562 goto bpf_alu32_trunc;587 goto bpf_alu32_trunc;
@@ -676,8 +701,14 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct code · 113 unmodified lines
676 /* special mov32 for zext */701 /* special mov32 for zext */
677 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 0, 0, 31));702 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 0, 0, 31));
678 break;703 break;
679 }704 } else if (off == 8) {
680 EMIT(PPC_RAW_MR(dst_reg, src_reg));705 EMIT(PPC_RAW_EXTSB(dst_reg, src_reg));
706 } else if (off == 16) {
707 EMIT(PPC_RAW_EXTSH(dst_reg, src_reg));
708 } else if (off == 32) {
709 EMIT(PPC_RAW_EXTSW(dst_reg, src_reg));
710 } else if (dst_reg != src_reg)
711 EMIT(PPC_RAW_MR(dst_reg, src_reg));
681 goto bpf_alu32_trunc;712 goto bpf_alu32_trunc;
682 case BPF_ALU | BPF_MOV | BPF_K: /* (u32) dst = imm */713 case BPF_ALU | BPF_MOV | BPF_K: /* (u32) dst = imm */
683 case BPF_ALU64 | BPF_MOV | BPF_K: /* dst = (s64) imm */714 case BPF_ALU64 | BPF_MOV | BPF_K: /* dst = (s64) imm */
@@ -699,11 +730,12 @@ bpf_alu32_trunc: · 15 unmodified lines
699 */730 */
700 case BPF_ALU | BPF_END | BPF_FROM_LE:731 case BPF_ALU | BPF_END | BPF_FROM_LE:
701 case BPF_ALU | BPF_END | BPF_FROM_BE:732 case BPF_ALU | BPF_END | BPF_FROM_BE:
733 case BPF_ALU64 | BPF_END | BPF_FROM_LE:
702#ifdef __BIG_ENDIAN__734#ifdef __BIG_ENDIAN__
703 if (BPF_SRC(code) == BPF_FROM_BE)735 if (BPF_SRC(code) == BPF_FROM_BE)
704 goto emit_clear;736 goto emit_clear;
705#else /* !__BIG_ENDIAN__ */737#else /* !__BIG_ENDIAN__ */
706 if (BPF_SRC(code) == BPF_FROM_LE)738 if (BPF_CLASS(code) == BPF_ALU && BPF_SRC(code) == BPF_FROM_LE)
707 goto emit_clear;739 goto emit_clear;
708#endif740#endif
709 switch (imm) {741 switch (imm) {
@@ -936,13 +968,19 @@ emit_clear: · 226 unmodified lines
936 */968 */
937 /* dst = *(u8 *)(ul) (src + off) */969 /* dst = *(u8 *)(ul) (src + off) */
938 case BPF_LDX | BPF_MEM | BPF_B:970 case BPF_LDX | BPF_MEM | BPF_B:
971 case BPF_LDX | BPF_MEMSX | BPF_B:
939 case BPF_LDX | BPF_PROBE_MEM | BPF_B:972 case BPF_LDX | BPF_PROBE_MEM | BPF_B:
973 case BPF_LDX | BPF_PROBE_MEMSX | BPF_B:
940 /* dst = *(u16 *)(ul) (src + off) */974 /* dst = *(u16 *)(ul) (src + off) */
941 case BPF_LDX | BPF_MEM | BPF_H:975 case BPF_LDX | BPF_MEM | BPF_H:
976 case BPF_LDX | BPF_MEMSX | BPF_H:
942 case BPF_LDX | BPF_PROBE_MEM | BPF_H:977 case BPF_LDX | BPF_PROBE_MEM | BPF_H:
978 case BPF_LDX | BPF_PROBE_MEMSX | BPF_H:
943 /* dst = *(u32 *)(ul) (src + off) */979 /* dst = *(u32 *)(ul) (src + off) */
944 case BPF_LDX | BPF_MEM | BPF_W:980 case BPF_LDX | BPF_MEM | BPF_W:
981 case BPF_LDX | BPF_MEMSX | BPF_W:
945 case BPF_LDX | BPF_PROBE_MEM | BPF_W:982 case BPF_LDX | BPF_PROBE_MEM | BPF_W:
983 case BPF_LDX | BPF_PROBE_MEMSX | BPF_W:
946 /* dst = *(u64 *)(ul) (src + off) */984 /* dst = *(u64 *)(ul) (src + off) */
947 case BPF_LDX | BPF_MEM | BPF_DW:985 case BPF_LDX | BPF_MEM | BPF_DW:
948 case BPF_LDX | BPF_PROBE_MEM | BPF_DW:986 case BPF_LDX | BPF_PROBE_MEM | BPF_DW:
@@ -952,7 +990,7 @@ emit_clear: · 3 unmodified lines
952 * load only if addr is kernel address (see is_kernel_addr()), otherwise990 * load only if addr is kernel address (see is_kernel_addr()), otherwise
953 * set dst_reg=0 and move on.991 * set dst_reg=0 and move on.
954 */992 */
955 if (BPF_MODE(code) == BPF_PROBE_MEM) {993 if (BPF_MODE(code) == BPF_PROBE_MEM || BPF_MODE(code) == BPF_PROBE_MEMSX) {
956 EMIT(PPC_RAW_ADDI(tmp1_reg, src_reg, off));994 EMIT(PPC_RAW_ADDI(tmp1_reg, src_reg, off));
957 if (IS_ENABLED(CONFIG_PPC_BOOK3E_64))995 if (IS_ENABLED(CONFIG_PPC_BOOK3E_64))
958 PPC_LI64(tmp2_reg, 0x8000000000000000ul);996 PPC_LI64(tmp2_reg, 0x8000000000000000ul);
@@ -965,30 +1003,47 @@ emit_clear: · 6 unmodified lines
965 * Check if 'off' is word aligned for BPF_DW, because1003 * Check if 'off' is word aligned for BPF_DW, because
966 * we might generate two instructions.1004 * we might generate two instructions.
967 */1005 */
968 if (BPF_SIZE(code) == BPF_DW && (off & 3))1006 if ((BPF_SIZE(code) == BPF_DW ||
1007 (BPF_SIZE(code) == BPF_B && BPF_MODE(code) == BPF_PROBE_MEMSX)) &&
1008 (off & 3))
969 PPC_JMP((ctx->idx + 3) * 4);1009 PPC_JMP((ctx->idx + 3) * 4);
970 else1010 else
971 PPC_JMP((ctx->idx + 2) * 4);1011 PPC_JMP((ctx->idx + 2) * 4);
972 }1012 }
973 1013
974 switch (size) {1014 if (BPF_MODE(code) == BPF_MEMSX || BPF_MODE(code) == BPF_PROBE_MEMSX) {
975 case BPF_B:1015 switch (size) {
976 EMIT(PPC_RAW_LBZ(dst_reg, src_reg, off));1016 case BPF_B:
977 break;1017 EMIT(PPC_RAW_LBZ(dst_reg, src_reg, off));
978 case BPF_H:1018 EMIT(PPC_RAW_EXTSB(dst_reg, dst_reg));
979 EMIT(PPC_RAW_LHZ(dst_reg, src_reg, off));1019 break;
980 break;1020 case BPF_H:
981 case BPF_W:1021 EMIT(PPC_RAW_LHA(dst_reg, src_reg, off));
982 EMIT(PPC_RAW_LWZ(dst_reg, src_reg, off));1022 break;
983 break;1023 case BPF_W:
984 case BPF_DW:1024 EMIT(PPC_RAW_LWA(dst_reg, src_reg, off));
985 if (off % 4) {1025 break;
986 EMIT(PPC_RAW_LI(tmp1_reg, off));1026 }
987 EMIT(PPC_RAW_LDX(dst_reg, src_reg, tmp1_reg));1027 } else {
988 } else {1028 switch (size) {
989 EMIT(PPC_RAW_LD(dst_reg, src_reg, off));1029 case BPF_B:
1030 EMIT(PPC_RAW_LBZ(dst_reg, src_reg, off));
1031 break;
1032 case BPF_H:
1033 EMIT(PPC_RAW_LHZ(dst_reg, src_reg, off));
1034 break;
1035 case BPF_W:
1036 EMIT(PPC_RAW_LWZ(dst_reg, src_reg, off));
1037 break;
1038 case BPF_DW:
1039 if (off % 4) {
1040 EMIT(PPC_RAW_LI(tmp1_reg, off));
1041 EMIT(PPC_RAW_LDX(dst_reg, src_reg, tmp1_reg));
1042 } else {
1043 EMIT(PPC_RAW_LD(dst_reg, src_reg, off));
1044 }
1045 break;
990 }1046 }
991 break;
992 }1047 }
993 1048
994 if (size != BPF_DW && insn_is_zext(&insn[i + 1]))1049 if (size != BPF_DW && insn_is_zext(&insn[i + 1]))
@@ -1065,6 +1120,9 @@ emit_clear: · 70 unmodified lines
1065 case BPF_JMP | BPF_JA:1120 case BPF_JMP | BPF_JA:
1066 PPC_JMP(addrs[i + 1 + off]);1121 PPC_JMP(addrs[i + 1 + off]);
1067 break;1122 break;
1123 case BPF_JMP32 | BPF_JA:
1124 PPC_JMP(addrs[i + 1 + imm]);
1125 break;
1068 1126
1069 case BPF_JMP | BPF_JGT | BPF_K:1127 case BPF_JMP | BPF_JGT | BPF_K:
1070 case BPF_JMP | BPF_JGT | BPF_X:1128 case BPF_JMP | BPF_JGT | BPF_X:
arch/powerpc/perf/core-book3s.c+19−26
@@ -266,31 +266,12 @@ static inline u32 perf_flags_from_msr(struct pt_regs *regs) · 265 unmodified lines
266static inline u32 perf_get_misc_flags(struct pt_regs *regs)266static inline u32 perf_get_misc_flags(struct pt_regs *regs)
267{267{
268 bool use_siar = regs_use_siar(regs);268 bool use_siar = regs_use_siar(regs);
269 unsigned long mmcra = regs->dsisr;269 unsigned long siar;
270 int marked = mmcra & MMCRA_SAMPLE_ENABLE;270 unsigned long addr;
271 271
272 if (!use_siar)272 if (!use_siar)
273 return perf_flags_from_msr(regs);273 return perf_flags_from_msr(regs);
274 274
275 /*
276 * Check the address in SIAR to identify the
277 * privilege levels since the SIER[MSR_HV, MSR_PR]
278 * bits are not set for marked events in power10
279 * DD1.
280 */
281 if (marked && (ppmu->flags & PPMU_P10_DD1)) {
282 unsigned long siar = mfspr(SPRN_SIAR);
283 if (siar) {
284 if (is_kernel_addr(siar))
285 return PERF_RECORD_MISC_KERNEL;
286 return PERF_RECORD_MISC_USER;
287 } else {
288 if (is_kernel_addr(regs->nip))
289 return PERF_RECORD_MISC_KERNEL;
290 return PERF_RECORD_MISC_USER;
291 }
292 }
293
294 /*275 /*
295 * If we don't have flags in MMCRA, rather than using276 * If we don't have flags in MMCRA, rather than using
296 * the MSR, we intuit the flags from the address in277 * the MSR, we intuit the flags from the address in
@@ -298,19 +279,31 @@ static inline u32 perf_get_misc_flags(struct pt_regs *regs) · 1 unmodified line
298 * results279 * results
299 */280 */
300 if (ppmu->flags & PPMU_NO_SIPR) {281 if (ppmu->flags & PPMU_NO_SIPR) {
301 unsigned long siar = mfspr(SPRN_SIAR);282 siar = mfspr(SPRN_SIAR);
302 if (is_kernel_addr(siar))283 if (is_kernel_addr(siar))
303 return PERF_RECORD_MISC_KERNEL;284 return PERF_RECORD_MISC_KERNEL;
304 return PERF_RECORD_MISC_USER;285 return PERF_RECORD_MISC_USER;
305 }286 }
306 287
307 /* PR has priority over HV, so order below is important */288 /* PR has priority over HV, so order below is important */
308 if (regs_sipr(regs))289 if (regs_sipr(regs)) {
309 return PERF_RECORD_MISC_USER;290 if (!(ppmu->flags & PPMU_P10))
310 291 return PERF_RECORD_MISC_USER;
311 if (regs_sihv(regs) && (freeze_events_kernel != MMCR0_FCHV))292 } else if (regs_sihv(regs) && (freeze_events_kernel != MMCR0_FCHV))
312 return PERF_RECORD_MISC_HYPERVISOR;293 return PERF_RECORD_MISC_HYPERVISOR;
313 294
295 /*
296 * Check the address in SIAR to identify the
297 * privilege levels since the SIER[MSR_HV, MSR_PR]
298 * bits are not set correctly in power10 sometimes
299 */
300 if (ppmu->flags & PPMU_P10) {
301 siar = mfspr(SPRN_SIAR);
302 addr = siar ? siar : regs->nip;
303 if (!is_kernel_addr(addr))
304 return PERF_RECORD_MISC_USER;
305 }
306
314 return PERF_RECORD_MISC_KERNEL;307 return PERF_RECORD_MISC_KERNEL;
315}308}
316 309
arch/powerpc/perf/power10-pmu.c+2−1
@@ -593,7 +593,8 @@ static struct power_pmu power10_pmu = { · 592 unmodified lines
593 .get_mem_weight = isa207_get_mem_weight,593 .get_mem_weight = isa207_get_mem_weight,
594 .disable_pmc = isa207_disable_pmc,594 .disable_pmc = isa207_disable_pmc,
595 .flags = PPMU_HAS_SIER | PPMU_ARCH_207S |595 .flags = PPMU_HAS_SIER | PPMU_ARCH_207S |
596 PPMU_ARCH_31 | PPMU_HAS_ATTR_CONFIG1,596 PPMU_ARCH_31 | PPMU_HAS_ATTR_CONFIG1 |
597 PPMU_P10,
597 .n_generic = ARRAY_SIZE(power10_generic_events),598 .n_generic = ARRAY_SIZE(power10_generic_events),
598 .generic_events = power10_generic_events,599 .generic_events = power10_generic_events,
599 .cache_events = &power10_cache_events,600 .cache_events = &power10_cache_events,
arch/powerpc/platforms/40x/Kconfig+0−78
@@ -1,78 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0
2config ACADIA
3 bool "Acadia"
4 depends on 40x
5 select PPC40x_SIMPLE
6 select 405EZ
7 help
8 This option enables support for the AMCC 405EZ Acadia evaluation board.
9
10config HOTFOOT
11 bool "Hotfoot"
12 depends on 40x
13 select PPC40x_SIMPLE
14 select FORCE_PCI
15 help
16 This option enables support for the ESTEEM 195E Hotfoot board.
17
18config KILAUEA
19 bool "Kilauea"
20 depends on 40x
21 select 405EX
22 select PPC40x_SIMPLE
23 select PPC4xx_PCI_EXPRESS
24 select FORCE_PCI
25 select PCI_MSI
26 help
27 This option enables support for the AMCC PPC405EX evaluation board.
28
29config MAKALU
30 bool "Makalu"
31 depends on 40x
32 select 405EX
33 select FORCE_PCI
34 select PPC4xx_PCI_EXPRESS
35 select PPC40x_SIMPLE
36 help
37 This option enables support for the AMCC PPC405EX board.
38
39config OBS600
40 bool "OpenBlockS 600"
41 depends on 40x
42 select 405EX
43 select PPC40x_SIMPLE
44 help
45 This option enables support for PlatHome OpenBlockS 600 server
46
47config PPC40x_SIMPLE
48 bool "Simple PowerPC 40x board support"
49 depends on 40x
50 help
51 This option enables the simple PowerPC 40x platform support.
52
53config 405EX
54 bool
55 select IBM_EMAC_EMAC4 if IBM_EMAC
56 select IBM_EMAC_RGMII if IBM_EMAC
57
58config 405EZ
59 bool
60 select IBM_EMAC_NO_FLOW_CTRL if IBM_EMAC
61 select IBM_EMAC_MAL_CLR_ICINTSTAT if IBM_EMAC
62 select IBM_EMAC_MAL_COMMON_ERR if IBM_EMAC
63
64config PPC4xx_GPIO
65 bool "PPC4xx GPIO support"
66 depends on 40x
67 select GPIOLIB
68 select OF_GPIO_MM_GPIOCHIP
69 help
70 Enable gpiolib support for ppc40x based boards
71
72config APM8018X
73 bool "APM8018X"
74 depends on 40x
75 select PPC40x_SIMPLE
76 help
77 This option enables support for the AppliedMicro APM8018X evaluation
78 board.
arch/powerpc/platforms/40x/Makefile+0−2
@@ -1,2 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2obj-$(CONFIG_PPC40x_SIMPLE) += ppc40x_simple.o
arch/powerpc/platforms/40x/ppc40x_simple.c+0−74
@@ -1,74 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Generic PowerPC 40x platform support
4 *
5 * Copyright 2008 IBM Corporation
6 *
7 * This implements simple platform support for PowerPC 44x chips. This is
8 * mostly used for eval boards or other simple and "generic" 44x boards. If
9 * your board has custom functions or hardware, then you will likely want to
10 * implement your own board.c file to accommodate it.
11 */
12
13#include <asm/machdep.h>
14#include <asm/pci-bridge.h>
15#include <asm/ppc4xx.h>
16#include <asm/time.h>
17#include <asm/udbg.h>
18#include <asm/uic.h>
19
20#include <linux/init.h>
21#include <linux/of_platform.h>
22
23static const struct of_device_id ppc40x_of_bus[] __initconst = {
24 { .compatible = "ibm,plb3", },
25 { .compatible = "ibm,plb4", },
26 { .compatible = "ibm,opb", },
27 { .compatible = "ibm,ebc", },
28 { .compatible = "simple-bus", },
29 {},
30};
31
32static int __init ppc40x_device_probe(void)
33{
34 of_platform_bus_probe(NULL, ppc40x_of_bus, NULL);
35
36 return 0;
37}
38machine_device_initcall(ppc40x_simple, ppc40x_device_probe);
39
40/* This is the list of boards that can be supported by this simple
41 * platform code. This does _not_ mean the boards are compatible,
42 * as they most certainly are not from a device tree perspective.
43 * However, their differences are handled by the device tree and the
44 * drivers and therefore they don't need custom board support files.
45 *
46 * Again, if your board needs to do things differently then create a
47 * board.c file for it rather than adding it to this list.
48 */
49static const char * const board[] __initconst = {
50 "amcc,acadia",
51 "amcc,haleakala",
52 "amcc,kilauea",
53 "amcc,makalu",
54 "apm,klondike",
55 "est,hotfoot",
56 "plathome,obs600",
57 NULL
58};
59
60static int __init ppc40x_probe(void)
61{
62 pci_set_flags(PCI_REASSIGN_ALL_RSRC);
63 return 1;
64}
65
66define_machine(ppc40x_simple) {
67 .name = "PowerPC 40x Platform",
68 .compatibles = board,
69 .probe = ppc40x_probe,
70 .progress = udbg_progress,
71 .init_IRQ = uic_init_tree,
72 .get_irq = uic_get_irq,
73 .restart = ppc4xx_reset_system,
74};
arch/powerpc/platforms/44x/Makefile+5−1
@@ -1,5 +1,5 @@
1# SPDX-License-Identifier: GPL-2.01# SPDX-License-Identifier: GPL-2.0
2obj-y += misc_44x.o machine_check.o2obj-y += misc_44x.o machine_check.o uic.o soc.o
3ifneq ($(CONFIG_PPC4xx_CPM),y)3ifneq ($(CONFIG_PPC4xx_CPM),y)
4obj-y += idle.o4obj-y += idle.o
5endif5endif
@@ -12,3 +12,7 @@ obj-$(CONFIG_CANYONLANDS)+= canyonlands.o · 6 unmodified lines
12obj-$(CONFIG_CURRITUCK) += ppc476.o12obj-$(CONFIG_CURRITUCK) += ppc476.o
13obj-$(CONFIG_AKEBONO) += ppc476.o13obj-$(CONFIG_AKEBONO) += ppc476.o
14obj-$(CONFIG_FSP2) += fsp2.o14obj-$(CONFIG_FSP2) += fsp2.o
15obj-$(CONFIG_PCI) += pci.o
16obj-$(CONFIG_PPC4xx_HSTA_MSI) += hsta_msi.o
17obj-$(CONFIG_PPC4xx_CPM) += cpm.o
18obj-$(CONFIG_PPC4xx_GPIO) += gpio.o
arch/powerpc/platforms/44x/cpm.crenamed from arch/powerpc/platforms/4xx/cpm.c+0−0

File renamed without changes.

arch/powerpc/platforms/44x/gpio.crenamed from arch/powerpc/platforms/4xx/gpio.c+0−0

File renamed without changes.

arch/powerpc/platforms/44x/hsta_msi.crenamed from arch/powerpc/platforms/4xx/hsta_msi.c+0−0

File renamed without changes.

arch/powerpc/platforms/44x/machine_check.c+15−0
@@ -9,6 +9,21 @@ · 8 unmodified lines
9#include <asm/reg.h>9#include <asm/reg.h>
10#include <asm/cacheflush.h>10#include <asm/cacheflush.h>
11 11
12int machine_check_4xx(struct pt_regs *regs)
13{
14 unsigned long reason = regs->esr;
15
16 if (reason & ESR_IMCP) {
17 printk("Instruction");
18 mtspr(SPRN_ESR, reason & ~ESR_IMCP);
19 } else
20 printk("Data");
21
22 printk(" machine check in kernel mode.\n");
23
24 return 0;
25}
26
12int machine_check_440A(struct pt_regs *regs)27int machine_check_440A(struct pt_regs *regs)
13{28{
14 unsigned long reason = regs->esr;29 unsigned long reason = regs->esr;
arch/powerpc/platforms/44x/pci.crenamed from arch/powerpc/platforms/4xx/pci.c+0−100
@@ -1263,102 +1263,6 @@ static struct ppc4xx_pciex_hwops ppc460sx_pcie_hwops __initdata = { · 1262 unmodified lines
1263 1263
1264#endif /* CONFIG_44x */1264#endif /* CONFIG_44x */
1265 1265
1266#ifdef CONFIG_40x
1267
1268static int __init ppc405ex_pciex_core_init(struct device_node *np)
1269{
1270 /* Nothing to do, return 2 ports */
1271 return 2;
1272}
1273
1274static void __init ppc405ex_pcie_phy_reset(struct ppc4xx_pciex_port *port)
1275{
1276 /* Assert the PE0_PHY reset */
1277 mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01010000);
1278 msleep(1);
1279
1280 /* deassert the PE0_hotreset */
1281 if (port->endpoint)
1282 mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01111000);
1283 else
1284 mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01101000);
1285
1286 /* poll for phy !reset */
1287 /* XXX FIXME add timeout */
1288 while (!(mfdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSTA) & 0x00001000))
1289 ;
1290
1291 /* deassert the PE0_gpl_utl_reset */
1292 mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x00101000);
1293}
1294
1295static int __init ppc405ex_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
1296{
1297 u32 val;
1298
1299 if (port->endpoint)
1300 val = PTYPE_LEGACY_ENDPOINT;
1301 else
1302 val = PTYPE_ROOT_PORT;
1303
1304 mtdcri(SDR0, port->sdr_base + PESDRn_DLPSET,
1305 1 << 24 | val << 20 | LNKW_X1 << 12);
1306
1307 mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, 0x00000000);
1308 mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x01010000);
1309 mtdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSET1, 0x720F0000);
1310 mtdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSET2, 0x70600003);
1311
1312 /*
1313 * Only reset the PHY when no link is currently established.
1314 * This is for the Atheros PCIe board which has problems to establish
1315 * the link (again) after this PHY reset. All other currently tested
1316 * PCIe boards don't show this problem.
1317 * This has to be re-tested and fixed in a later release!
1318 */
1319 val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP);
1320 if (!(val & 0x00001000))
1321 ppc405ex_pcie_phy_reset(port);
1322
1323 dcr_write(port->dcrs, DCRO_PEGPL_CFG, 0x10000000); /* guarded on */
1324
1325 port->has_ibpre = 1;
1326
1327 return ppc4xx_pciex_port_reset_sdr(port);
1328}
1329
1330static int ppc405ex_pciex_init_utl(struct ppc4xx_pciex_port *port)
1331{
1332 dcr_write(port->dcrs, DCRO_PEGPL_SPECIAL, 0x0);
1333
1334 /*
1335 * Set buffer allocations and then assert VRB and TXE.
1336 */
1337 out_be32(port->utl_base + PEUTL_OUTTR, 0x02000000);
1338 out_be32(port->utl_base + PEUTL_INTR, 0x02000000);
1339 out_be32(port->utl_base + PEUTL_OPDBSZ, 0x04000000);
1340 out_be32(port->utl_base + PEUTL_PBBSZ, 0x21000000);
1341 out_be32(port->utl_base + PEUTL_IPHBSZ, 0x02000000);
1342 out_be32(port->utl_base + PEUTL_IPDBSZ, 0x04000000);
1343 out_be32(port->utl_base + PEUTL_RCIRQEN, 0x00f00000);
1344 out_be32(port->utl_base + PEUTL_PCTL, 0x80800066);
1345
1346 out_be32(port->utl_base + PEUTL_PBCTL, 0x08000000);
1347
1348 return 0;
1349}
1350
1351static struct ppc4xx_pciex_hwops ppc405ex_pcie_hwops __initdata =
1352{
1353 .want_sdr = true,
1354 .core_init = ppc405ex_pciex_core_init,
1355 .port_init_hw = ppc405ex_pciex_init_port_hw,
1356 .setup_utl = ppc405ex_pciex_init_utl,
1357 .check_link = ppc4xx_pciex_check_link_sdr,
1358};
1359
1360#endif /* CONFIG_40x */
1361
1362#ifdef CONFIG_476FPE1266#ifdef CONFIG_476FPE
1363static int __init ppc_476fpe_pciex_core_init(struct device_node *np)1267static int __init ppc_476fpe_pciex_core_init(struct device_node *np)
1364{1268{
@@ -1427,10 +1331,6 @@ static int __init ppc4xx_pciex_check_core_init(struct device_node *np) · 62 unmodified lines
1427 if (of_device_is_compatible(np, "ibm,plb-pciex-apm821xx"))1331 if (of_device_is_compatible(np, "ibm,plb-pciex-apm821xx"))
1428 ppc4xx_pciex_hwops = &apm821xx_pcie_hwops;1332 ppc4xx_pciex_hwops = &apm821xx_pcie_hwops;
1429#endif /* CONFIG_44x */1333#endif /* CONFIG_44x */
1430#ifdef CONFIG_40x
1431 if (of_device_is_compatible(np, "ibm,plb-pciex-405ex"))
1432 ppc4xx_pciex_hwops = &ppc405ex_pcie_hwops;
1433#endif
1434#ifdef CONFIG_476FPE1334#ifdef CONFIG_476FPE
1435 if (of_device_is_compatible(np, "ibm,plb-pciex-476fpe")1335 if (of_device_is_compatible(np, "ibm,plb-pciex-476fpe")
1436 || of_device_is_compatible(np, "ibm,plb-pciex-476gtr"))1336 || of_device_is_compatible(np, "ibm,plb-pciex-476gtr"))
arch/powerpc/platforms/44x/pci.hrenamed from arch/powerpc/platforms/4xx/pci.h+0−0

File renamed without changes.

arch/powerpc/platforms/44x/soc.crenamed from arch/powerpc/platforms/4xx/soc.c+0−0

File renamed without changes.

arch/powerpc/platforms/44x/uic.crenamed from arch/powerpc/platforms/4xx/uic.c+0−0

File renamed without changes.

arch/powerpc/platforms/4xx/Makefile+0−7
@@ -1,7 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2obj-y += uic.o machine_check.o
3obj-$(CONFIG_4xx_SOC) += soc.o
4obj-$(CONFIG_PCI) += pci.o
5obj-$(CONFIG_PPC4xx_HSTA_MSI) += hsta_msi.o
6obj-$(CONFIG_PPC4xx_CPM) += cpm.o
7obj-$(CONFIG_PPC4xx_GPIO) += gpio.o
arch/powerpc/platforms/4xx/machine_check.c+0−23
@@ -1,23 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 */
4
5#include <linux/kernel.h>
6#include <linux/printk.h>
7#include <linux/ptrace.h>
8
9#include <asm/reg.h>
10
11int machine_check_4xx(struct pt_regs *regs)
12{
13 unsigned long reason = regs->esr;
14
15 if (reason & ESR_IMCP) {
16 printk("Instruction");
17 mtspr(SPRN_ESR, reason & ~ESR_IMCP);
18 } else
19 printk("Data");
20 printk(" machine check in kernel mode.\n");
21
22 return 0;
23}
arch/powerpc/platforms/85xx/t1042rdb_diu.c+1−0
@@ -149,4 +149,5 @@ static int __init t1042rdb_diu_init(void) · 148 unmodified lines
149 149
150early_initcall(t1042rdb_diu_init);150early_initcall(t1042rdb_diu_init);
151 151
152MODULE_DESCRIPTION("Freescale T1042 DIU driver");
152MODULE_LICENSE("GPL");153MODULE_LICENSE("GPL");
arch/powerpc/platforms/Kconfig+0−1
@@ -18,7 +18,6 @@ source "arch/powerpc/platforms/85xx/Kconfig" · 17 unmodified lines
18source "arch/powerpc/platforms/86xx/Kconfig"18source "arch/powerpc/platforms/86xx/Kconfig"
19source "arch/powerpc/platforms/embedded6xx/Kconfig"19source "arch/powerpc/platforms/embedded6xx/Kconfig"
20source "arch/powerpc/platforms/44x/Kconfig"20source "arch/powerpc/platforms/44x/Kconfig"
21source "arch/powerpc/platforms/40x/Kconfig"
22source "arch/powerpc/platforms/amigaone/Kconfig"21source "arch/powerpc/platforms/amigaone/Kconfig"
23source "arch/powerpc/platforms/book3s/Kconfig"22source "arch/powerpc/platforms/book3s/Kconfig"
24source "arch/powerpc/platforms/microwatt/Kconfig"23source "arch/powerpc/platforms/microwatt/Kconfig"
arch/powerpc/platforms/Kconfig.cputype+4−24
@@ -43,19 +43,10 @@ config PPC_8xx · 42 unmodified lines
43 select HAVE_ARCH_VMAP_STACK43 select HAVE_ARCH_VMAP_STACK
44 select HUGETLBFS44 select HUGETLBFS
45 45
46config 40x
47 bool "AMCC 40x"
48 select PPC_DCR_NATIVE
49 select PPC_UDBG_16550
50 select 4xx_SOC
51 select HAVE_PCI
52 select PPC_KUEP if PPC_KUAP
53
54config 44x46config 44x
55 bool "AMCC 44x, 46x or 47x"47 bool "AMCC 44x, 46x or 47x"
56 select PPC_DCR_NATIVE48 select PPC_DCR_NATIVE
57 select PPC_UDBG_1655049 select PPC_UDBG_16550
58 select 4xx_SOC
59 select HAVE_PCI50 select HAVE_PCI
60 select PHYS_64BIT51 select PHYS_64BIT
61 select PPC_KUEP52 select PPC_KUEP
@@ -194,11 +185,6 @@ config E6500_CPU · 132 unmodified lines
194 depends on !CC_IS_CLANG185 depends on !CC_IS_CLANG
195 select PPC_HAS_LBARX_LHARX186 select PPC_HAS_LBARX_LHARX
196 187
197config 405_CPU
198 bool "40x family"
199 depends on 40x
200 depends on !CC_IS_CLANG
201
202config 440_CPU188config 440_CPU
203 bool "440 (44x family)"189 bool "440 (44x family)"
204 depends on 44x190 depends on 44x
@@ -264,7 +250,6 @@ config TARGET_CPU · 59 unmodified lines
264 default "e6500" if E6500_CPU250 default "e6500" if E6500_CPU
265 default "power4" if POWERPC64_CPU && !CPU_LITTLE_ENDIAN251 default "power4" if POWERPC64_CPU && !CPU_LITTLE_ENDIAN
266 default "power8" if POWERPC64_CPU && CPU_LITTLE_ENDIAN252 default "power8" if POWERPC64_CPU && CPU_LITTLE_ENDIAN
267 default "405" if 405_CPU
268 default "440" if 440_CPU253 default "440" if 440_CPU
269 default "464" if 464_CPU254 default "464" if 464_CPU
270 default "476" if 476_CPU255 default "476" if 476_CPU
@@ -340,7 +325,7 @@ config FSL_EMB_PERF_EVENT_E500 · 69 unmodified lines
340 325
341config 4xx326config 4xx
342 bool327 bool
343 depends on 40x || 44x328 depends on 44x
344 default y329 default y
345 330
346config BOOKE331config BOOKE
@@ -348,11 +333,6 @@ config BOOKE · 1 unmodified line
348 depends on PPC_E500 || 44x333 depends on PPC_E500 || 44x
349 default y334 default y
350 335
351config BOOKE_OR_40x
352 bool
353 depends on BOOKE || 40x
354 default y
355
356config PTE_64BIT336config PTE_64BIT
357 bool337 bool
358 depends on 44x || PPC_E500 || PPC_86xx338 depends on 44x || PPC_E500 || PPC_86xx
@@ -495,8 +475,8 @@ config PPC_KERNEL_PCREL · 136 unmodified lines
495 This option builds the kernel with the pc relative ABI model.475 This option builds the kernel with the pc relative ABI model.
496 476
497config PPC_KUEP477config PPC_KUEP
498 bool "Kernel Userspace Execution Prevention" if !40x478 bool "Kernel Userspace Execution Prevention"
499 default y if !40x479 default y
500 help480 help
501 Enable support for Kernel Userspace Execution Prevention (KUEP)481 Enable support for Kernel Userspace Execution Prevention (KUEP)
502 482
@@ -582,7 +562,7 @@ config NR_CPUS · 79 unmodified lines
582 562
583config NOT_COHERENT_CACHE563config NOT_COHERENT_CACHE
584 bool564 bool
585 depends on 4xx || PPC_8xx || PPC_MPC512x || \565 depends on 44x || PPC_8xx || PPC_MPC512x || \
586 GAMECUBE_COMMON || AMIGAONE566 GAMECUBE_COMMON || AMIGAONE
587 select ARCH_HAS_DMA_PREP_COHERENT567 select ARCH_HAS_DMA_PREP_COHERENT
588 select ARCH_HAS_SYNC_DMA_FOR_DEVICE568 select ARCH_HAS_SYNC_DMA_FOR_DEVICE
arch/powerpc/platforms/Makefile+0−2
@@ -4,8 +4,6 @@ obj-$(CONFIG_FSL_ULI1575) += fsl_uli1575.o · 3 unmodified lines
4 4
5obj-$(CONFIG_PPC_PMAC) += powermac/5obj-$(CONFIG_PPC_PMAC) += powermac/
6obj-$(CONFIG_PPC_CHRP) += chrp/6obj-$(CONFIG_PPC_CHRP) += chrp/
7obj-$(CONFIG_4xx) += 4xx/
8obj-$(CONFIG_40x) += 40x/
9obj-$(CONFIG_44x) += 44x/7obj-$(CONFIG_44x) += 44x/
10obj-$(CONFIG_PPC_MPC512x) += 512x/8obj-$(CONFIG_PPC_MPC512x) += 512x/
11obj-$(CONFIG_PPC_MPC52xx) += 52xx/9obj-$(CONFIG_PPC_MPC52xx) += 52xx/
arch/powerpc/platforms/cell/cbe_powerbutton.c+1−0
@@ -101,5 +101,6 @@ static void __exit cbe_powerbutton_exit(void) · 100 unmodified lines
101module_init(cbe_powerbutton_init);101module_init(cbe_powerbutton_init);
102module_exit(cbe_powerbutton_exit);102module_exit(cbe_powerbutton_exit);
103 103
104MODULE_DESCRIPTION("Driver for powerbutton on IBM cell blades");
104MODULE_LICENSE("GPL");105MODULE_LICENSE("GPL");
105MODULE_AUTHOR("Christian Krafft <krafft@de.ibm.com>");106MODULE_AUTHOR("Christian Krafft <krafft@de.ibm.com>");
arch/powerpc/platforms/cell/cbe_thermal.c+1−0
@@ -381,6 +381,7 @@ static void __exit thermal_exit(void) · 380 unmodified lines
381}381}
382module_exit(thermal_exit);382module_exit(thermal_exit);
383 383
384MODULE_DESCRIPTION("Cell processor thermal driver");
384MODULE_LICENSE("GPL");385MODULE_LICENSE("GPL");
385MODULE_AUTHOR("Christian Krafft <krafft@de.ibm.com>");386MODULE_AUTHOR("Christian Krafft <krafft@de.ibm.com>");
386 387
arch/powerpc/platforms/cell/cpufreq_spudemand.c+1−0
@@ -129,5 +129,6 @@ static struct cpufreq_governor spu_governor = { · 128 unmodified lines
129cpufreq_governor_init(spu_governor);129cpufreq_governor_init(spu_governor);
130cpufreq_governor_exit(spu_governor);130cpufreq_governor_exit(spu_governor);
131 131
132MODULE_DESCRIPTION("SPU-aware cpufreq governor for the cell processor");
132MODULE_LICENSE("GPL");133MODULE_LICENSE("GPL");
133MODULE_AUTHOR("Christian Krafft <krafft@de.ibm.com>");134MODULE_AUTHOR("Christian Krafft <krafft@de.ibm.com>");
arch/powerpc/platforms/cell/spufs/inode.c+1−0
@@ -822,6 +822,7 @@ static void __exit spufs_exit(void) · 821 unmodified lines
822}822}
823module_exit(spufs_exit);823module_exit(spufs_exit);
824 824
825MODULE_DESCRIPTION("SPU file system");
825MODULE_LICENSE("GPL");826MODULE_LICENSE("GPL");
826MODULE_AUTHOR("Arnd Bergmann <arndb@de.ibm.com>");827MODULE_AUTHOR("Arnd Bergmann <arndb@de.ibm.com>");
827 828
arch/powerpc/platforms/chrp/nvram.c+1−0
@@ -92,4 +92,5 @@ void __init chrp_nvram_init(void) · 91 unmodified lines
92 return;92 return;
93}93}
94 94
95MODULE_DESCRIPTION("PPC NVRAM device driver");
95MODULE_LICENSE("GPL v2");96MODULE_LICENSE("GPL v2");
arch/powerpc/platforms/powernv/pci-ioda.c+4−2
@@ -1537,7 +1537,8 @@ static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, struct pci_bus *bus) · 1536 unmodified lines
1537 }1537 }
1538}1538}
1539 1539
1540static long pnv_ioda2_take_ownership(struct iommu_table_group *table_group)1540static long pnv_ioda2_take_ownership(struct iommu_table_group *table_group,
1541 struct device *dev __maybe_unused)
1541{1542{
1542 struct pnv_ioda_pe *pe = container_of(table_group, struct pnv_ioda_pe,1543 struct pnv_ioda_pe *pe = container_of(table_group, struct pnv_ioda_pe,
1543 table_group);1544 table_group);
@@ -1562,7 +1563,8 @@ static long pnv_ioda2_take_ownership(struct iommu_table_group *table_group) · 18 unmodified lines
1562 return 0;1563 return 0;
1563}1564}
1564 1565
1565static void pnv_ioda2_release_ownership(struct iommu_table_group *table_group)1566static void pnv_ioda2_release_ownership(struct iommu_table_group *table_group,
1567 struct device *dev __maybe_unused)
1566{1568{
1567 struct pnv_ioda_pe *pe = container_of(table_group, struct pnv_ioda_pe,1569 struct pnv_ioda_pe *pe = container_of(table_group, struct pnv_ioda_pe,
1568 table_group);1570 table_group);
arch/powerpc/platforms/pseries/iommu.c+733−48
@@ -21,6 +21,7 @@ · 20 unmodified lines
21#include <linux/dma-mapping.h>21#include <linux/dma-mapping.h>
22#include <linux/crash_dump.h>22#include <linux/crash_dump.h>
23#include <linux/memory.h>23#include <linux/memory.h>
24#include <linux/vmalloc.h>
24#include <linux/of.h>25#include <linux/of.h>
25#include <linux/of_address.h>26#include <linux/of_address.h>
26#include <linux/iommu.h>27#include <linux/iommu.h>
@@ -67,6 +68,10 @@ static struct iommu_table *iommu_pseries_alloc_table(int node) · 40 unmodified lines
67 return tbl;68 return tbl;
68}69}
69 70
71#ifdef CONFIG_IOMMU_API
72static struct iommu_table_group_ops spapr_tce_table_group_ops;
73#endif
74
70static struct iommu_table_group *iommu_pseries_alloc_group(int node)75static struct iommu_table_group *iommu_pseries_alloc_group(int node)
71{76{
72 struct iommu_table_group *table_group;77 struct iommu_table_group *table_group;
@@ -102,7 +107,7 @@ static void iommu_pseries_free_group(struct iommu_table_group *table_group, · 29 unmodified lines
102#endif107#endif
103 108
104 /* Default DMA window table is at index 0, while DDW at 1. SR-IOV109 /* Default DMA window table is at index 0, while DDW at 1. SR-IOV
105 * adapters only have table on index 1.110 * adapters only have table on index 0(if not direct mapped).
106 */111 */
107 if (table_group->tables[0])112 if (table_group->tables[0])
108 iommu_tce_table_put(table_group->tables[0]);113 iommu_tce_table_put(table_group->tables[0]);
@@ -143,7 +148,7 @@ static int tce_build_pSeries(struct iommu_table *tbl, long index, · 34 unmodified lines
143}148}
144 149
145 150
146static void tce_free_pSeries(struct iommu_table *tbl, long index, long npages)151static void tce_clear_pSeries(struct iommu_table *tbl, long index, long npages)
147{152{
148 __be64 *tcep;153 __be64 *tcep;
149 154
@@ -162,6 +167,39 @@ static unsigned long tce_get_pseries(struct iommu_table *tbl, long index) · 12 unmodified lines
162 return be64_to_cpu(*tcep);167 return be64_to_cpu(*tcep);
163}168}
164 169
170#ifdef CONFIG_IOMMU_API
171static long pseries_tce_iommu_userspace_view_alloc(struct iommu_table *tbl)
172{
173 unsigned long cb = ALIGN(sizeof(tbl->it_userspace[0]) * tbl->it_size, PAGE_SIZE);
174 unsigned long *uas;
175
176 if (tbl->it_indirect_levels) /* Impossible */
177 return -EPERM;
178
179 WARN_ON(tbl->it_userspace);
180
181 uas = vzalloc(cb);
182 if (!uas)
183 return -ENOMEM;
184
185 tbl->it_userspace = (__be64 *) uas;
186
187 return 0;
188}
189#endif
190
191static void tce_iommu_userspace_view_free(struct iommu_table *tbl)
192{
193 vfree(tbl->it_userspace);
194 tbl->it_userspace = NULL;
195}
196
197static void tce_free_pSeries(struct iommu_table *tbl)
198{
199 if (!tbl->it_userspace)
200 tce_iommu_userspace_view_free(tbl);
201}
202
165static void tce_free_pSeriesLP(unsigned long liobn, long, long, long);203static void tce_free_pSeriesLP(unsigned long liobn, long, long, long);
166static void tce_freemulti_pSeriesLP(struct iommu_table*, long, long);204static void tce_freemulti_pSeriesLP(struct iommu_table*, long, long);
167 205
@@ -576,7 +614,7 @@ struct iommu_table_ops iommu_table_lpar_multi_ops; · 408 unmodified lines
576 614
577struct iommu_table_ops iommu_table_pseries_ops = {615struct iommu_table_ops iommu_table_pseries_ops = {
578 .set = tce_build_pSeries,616 .set = tce_build_pSeries,
579 .clear = tce_free_pSeries,617 .clear = tce_clear_pSeries,
580 .get = tce_get_pseries618 .get = tce_get_pseries
581};619};
582 620
@@ -685,17 +723,47 @@ static int tce_exchange_pseries(struct iommu_table *tbl, long index, unsigned · 102 unmodified lines
685 723
686 return rc;724 return rc;
687}725}
726
727static __be64 *tce_useraddr_pSeriesLP(struct iommu_table *tbl, long index,
728 bool __always_unused alloc)
729{
730 return tbl->it_userspace ? &tbl->it_userspace[index - tbl->it_offset] : NULL;
731}
688#endif732#endif
689 733
690struct iommu_table_ops iommu_table_lpar_multi_ops = {734struct iommu_table_ops iommu_table_lpar_multi_ops = {
691 .set = tce_buildmulti_pSeriesLP,735 .set = tce_buildmulti_pSeriesLP,
692#ifdef CONFIG_IOMMU_API736#ifdef CONFIG_IOMMU_API
693 .xchg_no_kill = tce_exchange_pseries,737 .xchg_no_kill = tce_exchange_pseries,
738 .useraddrptr = tce_useraddr_pSeriesLP,
694#endif739#endif
695 .clear = tce_freemulti_pSeriesLP,740 .clear = tce_freemulti_pSeriesLP,
696 .get = tce_get_pSeriesLP741 .get = tce_get_pSeriesLP,
742 .free = tce_free_pSeries
697};743};
698 744
745#ifdef CONFIG_IOMMU_API
746/*
747 * When the DMA window properties might have been removed,
748 * the parent node has the table_group setup on it.
749 */
750static struct device_node *pci_dma_find_parent_node(struct pci_dev *dev,
751 struct iommu_table_group *table_group)
752{
753 struct device_node *dn = pci_device_to_OF_node(dev);
754 struct pci_dn *rpdn;
755
756 for (; dn && PCI_DN(dn); dn = dn->parent) {
757 rpdn = PCI_DN(dn);
758
759 if (table_group == rpdn->table_group)
760 return dn;
761 }
762
763 return NULL;
764}
765#endif
766
699/*767/*
700 * Find nearest ibm,dma-window (default DMA window) or direct DMA window or768 * Find nearest ibm,dma-window (default DMA window) or direct DMA window or
701 * dynamic 64bit DMA window, walking up the device tree.769 * dynamic 64bit DMA window, walking up the device tree.
@@ -812,13 +880,6 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus) · 110 unmodified lines
812 be32_to_cpu(prop.tce_shift), NULL,880 be32_to_cpu(prop.tce_shift), NULL,
813 &iommu_table_lpar_multi_ops);881 &iommu_table_lpar_multi_ops);
814 882
815 /* Only for normal boot with default window. Doesn't matter even
816 * if we set these with DDW which is 64bit during kdump, since
817 * these will not be used during kdump.
818 */
819 ppci->table_group->tce32_start = be64_to_cpu(prop.dma_base);
820 ppci->table_group->tce32_size = 1 << be32_to_cpu(prop.window_shift);
821
822 if (!iommu_init_table(tbl, ppci->phb->node, 0, 0))883 if (!iommu_init_table(tbl, ppci->phb->node, 0, 0))
823 panic("Failed to initialize iommu table");884 panic("Failed to initialize iommu table");
824 885
@@ -917,7 +978,7 @@ static void __remove_dma_window(struct device_node *np, u32 *ddw_avail, u64 liob · 92 unmodified lines
917}978}
918 979
919static void remove_dma_window(struct device_node *np, u32 *ddw_avail,980static void remove_dma_window(struct device_node *np, u32 *ddw_avail,
920 struct property *win)981 struct property *win, bool cleanup)
921{982{
922 struct dynamic_dma_window_prop *dwp;983 struct dynamic_dma_window_prop *dwp;
923 u64 liobn;984 u64 liobn;
@@ -925,11 +986,44 @@ static void remove_dma_window(struct device_node *np, u32 *ddw_avail, · 1 unmodified line
925 dwp = win->value;986 dwp = win->value;
926 liobn = (u64)be32_to_cpu(dwp->liobn);987 liobn = (u64)be32_to_cpu(dwp->liobn);
927 988
928 clean_dma_window(np, dwp);989 if (cleanup)
990 clean_dma_window(np, dwp);
929 __remove_dma_window(np, ddw_avail, liobn);991 __remove_dma_window(np, ddw_avail, liobn);
930}992}
931 993
932static int remove_ddw(struct device_node *np, bool remove_prop, const char *win_name)994static void copy_property(struct device_node *pdn, const char *from, const char *to)
995{
996 struct property *src, *dst;
997
998 src = of_find_property(pdn, from, NULL);
999 if (!src)
1000 return;
1001
1002 dst = kzalloc(sizeof(*dst), GFP_KERNEL);
1003 if (!dst)
1004 return;
1005
1006 dst->name = kstrdup(to, GFP_KERNEL);
1007 dst->value = kmemdup(src->value, src->length, GFP_KERNEL);
1008 dst->length = src->length;
1009 if (!dst->name || !dst->value)
1010 return;
1011
1012 if (of_add_property(pdn, dst)) {
1013 pr_err("Unable to add DMA window property for %pOF", pdn);
1014 goto free_prop;
1015 }
1016
1017 return;
1018
1019free_prop:
1020 kfree(dst->name);
1021 kfree(dst->value);
1022 kfree(dst);
1023}
1024
1025static int remove_dma_window_named(struct device_node *np, bool remove_prop, const char *win_name,
1026 bool cleanup)
933{1027{
934 struct property *win;1028 struct property *win;
935 u32 ddw_avail[DDW_APPLICABLE_SIZE];1029 u32 ddw_avail[DDW_APPLICABLE_SIZE];
@@ -944,13 +1038,20 @@ static int remove_ddw(struct device_node *np, bool remove_prop, const char *win_ · 8 unmodified lines
944 if (ret)1038 if (ret)
945 return 0;1039 return 0;
946 1040
947
948 if (win->length >= sizeof(struct dynamic_dma_window_prop))1041 if (win->length >= sizeof(struct dynamic_dma_window_prop))
949 remove_dma_window(np, ddw_avail, win);1042 remove_dma_window(np, ddw_avail, win, cleanup);
950 1043
951 if (!remove_prop)1044 if (!remove_prop)
952 return 0;1045 return 0;
953 1046
1047 /* Default window property if removed is lost as reset-pe doesn't restore it.
1048 * Though FDT has a copy of it, the DLPAR hotplugged devices will not have a
1049 * node on FDT until next reboot. So, back it up.
1050 */
1051 if ((strcmp(win_name, "ibm,dma-window") == 0) &&
1052 !of_find_property(np, "ibm,dma-window-saved", NULL))
1053 copy_property(np, win_name, "ibm,dma-window-saved");
1054
954 ret = of_remove_property(np, win);1055 ret = of_remove_property(np, win);
955 if (ret)1056 if (ret)
956 pr_warn("%pOF: failed to remove DMA window property: %d\n",1057 pr_warn("%pOF: failed to remove DMA window property: %d\n",
@@ -1008,7 +1109,7 @@ static void find_existing_ddw_windows_named(const char *name) · 51 unmodified lines
1008 for_each_node_with_property(pdn, name) {1109 for_each_node_with_property(pdn, name) {
1009 dma64 = of_get_property(pdn, name, &len);1110 dma64 = of_get_property(pdn, name, &len);
1010 if (!dma64 || len < sizeof(*dma64)) {1111 if (!dma64 || len < sizeof(*dma64)) {
1011 remove_ddw(pdn, true, name);1112 remove_dma_window_named(pdn, true, name, true);
1012 continue;1113 continue;
1013 }1114 }
1014 1115
@@ -1304,7 +1405,7 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 289 unmodified lines
1304 struct ddw_query_response query;1405 struct ddw_query_response query;
1305 struct ddw_create_response create;1406 struct ddw_create_response create;
1306 int page_shift;1407 int page_shift;
1307 u64 win_addr;1408 u64 win_addr, dynamic_offset = 0;
1308 const char *win_name;1409 const char *win_name;
1309 struct device_node *dn;1410 struct device_node *dn;
1310 u32 ddw_avail[DDW_APPLICABLE_SIZE];1411 u32 ddw_avail[DDW_APPLICABLE_SIZE];
@@ -1312,6 +1413,7 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 1 unmodified line
1312 struct property *win64;1413 struct property *win64;
1313 struct failed_ddw_pdn *fpdn;1414 struct failed_ddw_pdn *fpdn;
1314 bool default_win_removed = false, direct_mapping = false;1415 bool default_win_removed = false, direct_mapping = false;
1416 bool dynamic_mapping = false;
1315 bool pmem_present;1417 bool pmem_present;
1316 struct pci_dn *pci = PCI_DN(pdn);1418 struct pci_dn *pci = PCI_DN(pdn);
1317 struct property *default_win = NULL;1419 struct property *default_win = NULL;
@@ -1385,7 +1487,7 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 67 unmodified lines
1385 if (reset_win_ext)1487 if (reset_win_ext)
1386 goto out_failed;1488 goto out_failed;
1387 1489
1388 remove_dma_window(pdn, ddw_avail, default_win);1490 remove_dma_window(pdn, ddw_avail, default_win, true);
1389 default_win_removed = true;1491 default_win_removed = true;
1390 1492
1391 /* Query again, to check if the window is available */1493 /* Query again, to check if the window is available */
@@ -1407,7 +1509,6 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 15 unmodified lines
1407 goto out_failed;1509 goto out_failed;
1408 }1510 }
1409 1511
1410
1411 /*1512 /*
1412 * The "ibm,pmemory" can appear anywhere in the address space.1513 * The "ibm,pmemory" can appear anywhere in the address space.
1413 * Assuming it is still backed by page structs, try MAX_PHYSMEM_BITS1514 * Assuming it is still backed by page structs, try MAX_PHYSMEM_BITS
@@ -1432,14 +1533,42 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 18 unmodified lines
1432 1ULL << page_shift);1533 1ULL << page_shift);
1433 1534
1434 len = order_base_2(query.largest_available_block << page_shift);1535 len = order_base_2(query.largest_available_block << page_shift);
1435 win_name = DMA64_PROPNAME;1536
1537 dynamic_mapping = true;
1436 } else {1538 } else {
1437 direct_mapping = !default_win_removed ||1539 direct_mapping = !default_win_removed ||
1438 (len == MAX_PHYSMEM_BITS) ||1540 (len == MAX_PHYSMEM_BITS) ||
1439 (!pmem_present && (len == max_ram_len));1541 (!pmem_present && (len == max_ram_len));
1440 win_name = direct_mapping ? DIRECT64_PROPNAME : DMA64_PROPNAME;1542
1543 /* DDW is big enough to direct map RAM. If there is vPMEM, check
1544 * if enough space is left in DDW where we can dynamically
1545 * allocate TCEs for vPMEM. For now, this Hybrid sharing of DDW
1546 * is only for SR-IOV devices.
1547 */
1548 if (default_win_removed && pmem_present && !direct_mapping) {
1549 /* DDW is big enough to be split */
1550 if ((query.largest_available_block << page_shift) >=
1551 MIN_DDW_VPMEM_DMA_WINDOW + (1ULL << max_ram_len)) {
1552 direct_mapping = true;
1553
1554 /* offset of the Dynamic part of DDW */
1555 dynamic_offset = 1ULL << max_ram_len;
1556 }
1557
1558 /* DDW will at least have dynamic allocation */
1559 dynamic_mapping = true;
1560
1561 /* create max size DDW possible */
1562 len = order_base_2(query.largest_available_block
1563 << page_shift);
1564 }
1441 }1565 }
1442 1566
1567 /* Even if the DDW is split into both direct mapped RAM and dynamically
1568 * mapped vPMEM, the DDW property in OF will be marked as Direct.
1569 */
1570 win_name = direct_mapping ? DIRECT64_PROPNAME : DMA64_PROPNAME;
1571
1443 ret = create_ddw(dev, ddw_avail, &create, page_shift, len);1572 ret = create_ddw(dev, ddw_avail, &create, page_shift, len);
1444 if (ret != 0)1573 if (ret != 0)
1445 goto out_failed;1574 goto out_failed;
@@ -1467,9 +1596,9 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 21 unmodified lines
1467 if (!window)1596 if (!window)
1468 goto out_del_prop;1597 goto out_del_prop;
1469 1598
1470 if (direct_mapping) {1599 window->direct = direct_mapping;
1471 window->direct = true;
1472 1600
1601 if (direct_mapping) {
1473 /* DDW maps the whole partition, so enable direct DMA mapping */1602 /* DDW maps the whole partition, so enable direct DMA mapping */
1474 ret = walk_system_ram_range(0, memblock_end_of_DRAM() >> PAGE_SHIFT,1603 ret = walk_system_ram_range(0, memblock_end_of_DRAM() >> PAGE_SHIFT,
1475 win64->value, tce_setrange_multi_pSeriesLP_walk);1604 win64->value, tce_setrange_multi_pSeriesLP_walk);
@@ -1481,12 +1610,18 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 5 unmodified lines
1481 clean_dma_window(pdn, win64->value);1610 clean_dma_window(pdn, win64->value);
1482 goto out_del_list;1611 goto out_del_list;
1483 }1612 }
1484 } else {1613 if (default_win_removed) {
1614 iommu_tce_table_put(pci->table_group->tables[0]);
1615 pci->table_group->tables[0] = NULL;
1616 set_iommu_table_base(&dev->dev, NULL);
1617 }
1618 }
1619
1620 if (dynamic_mapping) {
1485 struct iommu_table *newtbl;1621 struct iommu_table *newtbl;
1486 int i;1622 int i;
1487 unsigned long start = 0, end = 0;1623 unsigned long start = 0, end = 0;
1488 1624 u64 dynamic_addr, dynamic_len;
1489 window->direct = false;
1490 1625
1491 for (i = 0; i < ARRAY_SIZE(pci->phb->mem_resources); i++) {1626 for (i = 0; i < ARRAY_SIZE(pci->phb->mem_resources); i++) {
1492 const unsigned long mask = IORESOURCE_MEM_64 | IORESOURCE_MEM;1627 const unsigned long mask = IORESOURCE_MEM_64 | IORESOURCE_MEM;
@@ -1506,20 +1641,26 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 13 unmodified lines
1506 goto out_del_list;1641 goto out_del_list;
1507 }1642 }
1508 1643
1509 iommu_table_setparms_common(newtbl, pci->phb->bus->number, create.liobn, win_addr,1644 /* If the DDW is split between directly mapped RAM and Dynamic
1510 1UL << len, page_shift, NULL, &iommu_table_lpar_multi_ops);1645 * mapped for TCES, offset into the DDW where the dynamic part
1646 * begins.
1647 */
1648 dynamic_addr = win_addr + dynamic_offset;
1649 dynamic_len = (1UL << len) - dynamic_offset;
1650 iommu_table_setparms_common(newtbl, pci->phb->bus->number, create.liobn,
1651 dynamic_addr, dynamic_len, page_shift, NULL,
1652 &iommu_table_lpar_multi_ops);
1511 iommu_init_table(newtbl, pci->phb->node, start, end);1653 iommu_init_table(newtbl, pci->phb->node, start, end);
1512 1654
1513 pci->table_group->tables[1] = newtbl;1655 pci->table_group->tables[default_win_removed ? 0 : 1] = newtbl;
1514 1656
1515 set_iommu_table_base(&dev->dev, newtbl);1657 set_iommu_table_base(&dev->dev, newtbl);
1516 }1658 }
1517 1659
1518 if (default_win_removed) {1660 if (default_win_removed) {
1519 iommu_tce_table_put(pci->table_group->tables[0]);
1520 pci->table_group->tables[0] = NULL;
1521
1522 /* default_win is valid here because default_win_removed == true */1661 /* default_win is valid here because default_win_removed == true */
1662 if (!of_find_property(pdn, "ibm,dma-window-saved", NULL))
1663 copy_property(pdn, "ibm,dma-window", "ibm,dma-window-saved");
1523 of_remove_property(pdn, default_win);1664 of_remove_property(pdn, default_win);
1524 dev_info(&dev->dev, "Removed default DMA window for %pOF\n", pdn);1665 dev_info(&dev->dev, "Removed default DMA window for %pOF\n", pdn);
1525 }1666 }
@@ -1559,17 +1700,81 @@ out_failed: · 33 unmodified lines
1559out_unlock:1700out_unlock:
1560 mutex_unlock(&dma_win_init_mutex);1701 mutex_unlock(&dma_win_init_mutex);
1561 1702
1562 /*1703 /* If we have persistent memory and the window size is not big enough
1563 * If we have persistent memory and the window size is only as big1704 * to directly map both RAM and vPMEM, then we need to set DMA limit.
1564 * as RAM, then we failed to create a window to cover persistent
1565 * memory and need to set the DMA limit.
1566 */1705 */
1567 if (pmem_present && direct_mapping && len == max_ram_len)1706 if (pmem_present && direct_mapping && len != MAX_PHYSMEM_BITS)
1568 dev->dev.bus_dma_limit = dev->dev.archdata.dma_offset + (1ULL << len);1707 dev->dev.bus_dma_limit = dev->dev.archdata.dma_offset +
1708 (1ULL << max_ram_len);
1569 1709
1570 return direct_mapping;1710 return direct_mapping;
1571}1711}
1572 1712
1713static __u64 query_page_size_to_mask(u32 query_page_size)
1714{
1715 const long shift[] = {
1716 (SZ_4K), (SZ_64K), (SZ_16M),
1717 (SZ_32M), (SZ_64M), (SZ_128M),
1718 (SZ_256M), (SZ_16G), (SZ_2M)
1719 };
1720 int i, ret = 0;
1721
1722 for (i = 0; i < ARRAY_SIZE(shift); i++) {
1723 if (query_page_size & (1 << i))
1724 ret |= shift[i];
1725 }
1726
1727 return ret;
1728}
1729
1730static void spapr_tce_init_table_group(struct pci_dev *pdev,
1731 struct device_node *pdn,
1732 struct dynamic_dma_window_prop prop)
1733{
1734 struct iommu_table_group *table_group = PCI_DN(pdn)->table_group;
1735 u32 ddw_avail[DDW_APPLICABLE_SIZE];
1736
1737 struct ddw_query_response query;
1738 int ret;
1739
1740 /* Only for normal boot with default window. Doesn't matter during
1741 * kdump, since these will not be used during kdump.
1742 */
1743 if (is_kdump_kernel())
1744 return;
1745
1746 if (table_group->max_dynamic_windows_supported != 0)
1747 return; /* already initialized */
1748
1749 table_group->tce32_start = be64_to_cpu(prop.dma_base);
1750 table_group->tce32_size = 1 << be32_to_cpu(prop.window_shift);
1751
1752 if (!of_find_property(pdn, "ibm,dma-window", NULL))
1753 dev_err(&pdev->dev, "default dma window missing!\n");
1754
1755 ret = of_property_read_u32_array(pdn, "ibm,ddw-applicable",
1756 &ddw_avail[0], DDW_APPLICABLE_SIZE);
1757 if (ret) {
1758 table_group->max_dynamic_windows_supported = -1;
1759 return;
1760 }
1761
1762 ret = query_ddw(pdev, ddw_avail, &query, pdn);
1763 if (ret) {
1764 dev_err(&pdev->dev, "%s: query_ddw failed\n", __func__);
1765 table_group->max_dynamic_windows_supported = -1;
1766 return;
1767 }
1768
1769 if (query.windows_available == 0)
1770 table_group->max_dynamic_windows_supported = 1;
1771 else
1772 table_group->max_dynamic_windows_supported = IOMMU_TABLE_GROUP_MAX_TABLES;
1773
1774 table_group->max_levels = 1;
1775 table_group->pgsizes |= query_page_size_to_mask(query.page_size);
1776}
1777
1573static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)1778static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
1574{1779{
1575 struct device_node *pdn, *dn;1780 struct device_node *pdn, *dn;
@@ -1609,13 +1814,6 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev) · 33 unmodified lines
1609 be32_to_cpu(prop.tce_shift), NULL,1814 be32_to_cpu(prop.tce_shift), NULL,
1610 &iommu_table_lpar_multi_ops);1815 &iommu_table_lpar_multi_ops);
1611 1816
1612 /* Only for normal boot with default window. Doesn't matter even
1613 * if we set these with DDW which is 64bit during kdump, since
1614 * these will not be used during kdump.
1615 */
1616 pci->table_group->tce32_start = be64_to_cpu(prop.dma_base);
1617 pci->table_group->tce32_size = 1 << be32_to_cpu(prop.window_shift);
1618
1619 iommu_init_table(tbl, pci->phb->node, 0, 0);1817 iommu_init_table(tbl, pci->phb->node, 0, 0);
1620 iommu_register_group(pci->table_group,1818 iommu_register_group(pci->table_group,
1621 pci_domain_nr(pci->phb->bus), 0);1819 pci_domain_nr(pci->phb->bus), 0);
@@ -1624,6 +1822,8 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev) · 2 unmodified lines
1624 pr_debug(" found DMA window, table: %p\n", pci->table_group);1822 pr_debug(" found DMA window, table: %p\n", pci->table_group);
1625 }1823 }
1626 1824
1825 spapr_tce_init_table_group(dev, pdn, prop);
1826
1627 set_iommu_table_base(&dev->dev, pci->table_group->tables[0]);1827 set_iommu_table_base(&dev->dev, pci->table_group->tables[0]);
1628 iommu_add_device(pci->table_group, &dev->dev);1828 iommu_add_device(pci->table_group, &dev->dev);
1629}1829}
@@ -1651,6 +1851,491 @@ static bool iommu_bypass_supported_pSeriesLP(struct pci_dev *pdev, u64 dma_mask) · 21 unmodified lines
1651 return false;1851 return false;
1652}1852}
1653 1853
1854#ifdef CONFIG_IOMMU_API
1855/*
1856 * A simple iommu_table_group_ops which only allows reusing the existing
1857 * iommu_table. This handles VFIO for POWER7 or the nested KVM.
1858 * The ops does not allow creating windows and only allows reusing the existing
1859 * one if it matches table_group->tce32_start/tce32_size/page_shift.
1860 */
1861static unsigned long spapr_tce_get_table_size(__u32 page_shift,
1862 __u64 window_size, __u32 levels)
1863{
1864 unsigned long size;
1865
1866 if (levels > 1)
1867 return ~0U;
1868 size = window_size >> (page_shift - 3);
1869 return size;
1870}
1871
1872static struct pci_dev *iommu_group_get_first_pci_dev(struct iommu_group *group)
1873{
1874 struct pci_dev *pdev = NULL;
1875 int ret;
1876
1877 /* No IOMMU group ? */
1878 if (!group)
1879 return NULL;
1880
1881 ret = iommu_group_for_each_dev(group, &pdev, dev_has_iommu_table);
1882 if (!ret || !pdev)
1883 return NULL;
1884 return pdev;
1885}
1886
1887static void restore_default_dma_window(struct pci_dev *pdev, struct device_node *pdn)
1888{
1889 reset_dma_window(pdev, pdn);
1890 copy_property(pdn, "ibm,dma-window-saved", "ibm,dma-window");
1891}
1892
1893static long remove_dynamic_dma_windows(struct pci_dev *pdev, struct device_node *pdn)
1894{
1895 struct pci_dn *pci = PCI_DN(pdn);
1896 struct dma_win *window;
1897 bool direct_mapping;
1898 int len;
1899
1900 if (find_existing_ddw(pdn, &pdev->dev.archdata.dma_offset, &len, &direct_mapping)) {
1901 remove_dma_window_named(pdn, true, direct_mapping ?
1902 DIRECT64_PROPNAME : DMA64_PROPNAME, true);
1903 if (!direct_mapping) {
1904 WARN_ON(!pci->table_group->tables[0] && !pci->table_group->tables[1]);
1905
1906 if (pci->table_group->tables[1]) {
1907 iommu_tce_table_put(pci->table_group->tables[1]);
1908 pci->table_group->tables[1] = NULL;
1909 } else if (pci->table_group->tables[0]) {
1910 /* Default window was removed and only the DDW exists */
1911 iommu_tce_table_put(pci->table_group->tables[0]);
1912 pci->table_group->tables[0] = NULL;
1913 }
1914 }
1915 spin_lock(&dma_win_list_lock);
1916 list_for_each_entry(window, &dma_win_list, list) {
1917 if (window->device == pdn) {
1918 list_del(&window->list);
1919 kfree(window);
1920 break;
1921 }
1922 }
1923 spin_unlock(&dma_win_list_lock);
1924 }
1925
1926 return 0;
1927}
1928
1929static long pseries_setup_default_iommu_config(struct iommu_table_group *table_group,
1930 struct device *dev)
1931{
1932 struct pci_dev *pdev = to_pci_dev(dev);
1933 const __be32 *default_prop;
1934 long liobn, offset, size;
1935 struct device_node *pdn;
1936 struct iommu_table *tbl;
1937 struct pci_dn *pci;
1938
1939 pdn = pci_dma_find_parent_node(pdev, table_group);
1940 if (!pdn || !PCI_DN(pdn)) {
1941 dev_warn(&pdev->dev, "No table_group configured for the node %pOF\n", pdn);
1942 return -1;
1943 }
1944 pci = PCI_DN(pdn);
1945
1946 /* The default window is restored if not present already on removal of DDW.
1947 * However, if used by VFIO SPAPR sub driver, the user's order of removal of
1948 * windows might have been different to not leading to auto restoration,
1949 * suppose the DDW was removed first followed by the default one.
1950 * So, restore the default window with reset-pe-dma call explicitly.
1951 */
1952 restore_default_dma_window(pdev, pdn);
1953
1954 default_prop = of_get_property(pdn, "ibm,dma-window", NULL);
1955 of_parse_dma_window(pdn, default_prop, &liobn, &offset, &size);
1956 tbl = iommu_pseries_alloc_table(pci->phb->node);
1957 if (!tbl) {
1958 dev_err(&pdev->dev, "couldn't create new IOMMU table\n");
1959 return -1;
1960 }
1961
1962 iommu_table_setparms_common(tbl, pci->phb->bus->number, liobn, offset,
1963 size, IOMMU_PAGE_SHIFT_4K, NULL,
1964 &iommu_table_lpar_multi_ops);
1965 iommu_init_table(tbl, pci->phb->node, 0, 0);
1966
1967 pci->table_group->tables[0] = tbl;
1968 set_iommu_table_base(&pdev->dev, tbl);
1969
1970 return 0;
1971}
1972
1973static bool is_default_window_request(struct iommu_table_group *table_group, __u32 page_shift,
1974 __u64 window_size)
1975{
1976 if ((window_size <= table_group->tce32_size) &&
1977 (page_shift == IOMMU_PAGE_SHIFT_4K))
1978 return true;
1979
1980 return false;
1981}
1982
1983static long spapr_tce_create_table(struct iommu_table_group *table_group, int num,
1984 __u32 page_shift, __u64 window_size, __u32 levels,
1985 struct iommu_table **ptbl)
1986{
1987 struct pci_dev *pdev = iommu_group_get_first_pci_dev(table_group->group);
1988 u32 ddw_avail[DDW_APPLICABLE_SIZE];
1989 struct ddw_create_response create;
1990 unsigned long liobn, offset, size;
1991 unsigned long start = 0, end = 0;
1992 struct ddw_query_response query;
1993 const __be32 *default_prop;
1994 struct failed_ddw_pdn *fpdn;
1995 unsigned int window_shift;
1996 struct device_node *pdn;
1997 struct iommu_table *tbl;
1998 struct dma_win *window;
1999 struct property *win64;
2000 struct pci_dn *pci;
2001 u64 win_addr;
2002 int len, i;
2003 long ret;
2004
2005 if (!is_power_of_2(window_size) || levels > 1)
2006 return -EINVAL;
2007
2008 window_shift = order_base_2(window_size);
2009
2010 mutex_lock(&dma_win_init_mutex);
2011
2012 ret = -ENODEV;
2013
2014 pdn = pci_dma_find_parent_node(pdev, table_group);
2015 if (!pdn || !PCI_DN(pdn)) { /* Niether of 32s|64-bit exist! */
2016 dev_warn(&pdev->dev, "No dma-windows exist for the node %pOF\n", pdn);
2017 goto out_failed;
2018 }
2019 pci = PCI_DN(pdn);
2020
2021 /* If the enable DDW failed for the pdn, dont retry! */
2022 list_for_each_entry(fpdn, &failed_ddw_pdn_list, list) {
2023 if (fpdn->pdn == pdn) {
2024 dev_info(&pdev->dev, "%pOF in failed DDW device list\n", pdn);
2025 goto out_unlock;
2026 }
2027 }
2028
2029 tbl = iommu_pseries_alloc_table(pci->phb->node);
2030 if (!tbl) {
2031 dev_dbg(&pdev->dev, "couldn't create new IOMMU table\n");
2032 goto out_unlock;
2033 }
2034
2035 if (num == 0) {
2036 bool direct_mapping;
2037 /* The request is not for default window? Ensure there is no DDW window already */
2038 if (!is_default_window_request(table_group, page_shift, window_size)) {
2039 if (find_existing_ddw(pdn, &pdev->dev.archdata.dma_offset, &len,
2040 &direct_mapping)) {
2041 dev_warn(&pdev->dev, "%pOF: 64-bit window already present.", pdn);
2042 ret = -EPERM;
2043 goto out_unlock;
2044 }
2045 } else {
2046 /* Request is for Default window, ensure there is no DDW if there is a
2047 * need to reset. reset-pe otherwise removes the DDW also
2048 */
2049 default_prop = of_get_property(pdn, "ibm,dma-window", NULL);
2050 if (!default_prop) {
2051 if (find_existing_ddw(pdn, &pdev->dev.archdata.dma_offset, &len,
2052 &direct_mapping)) {
2053 dev_warn(&pdev->dev, "%pOF: Attempt to create window#0 when 64-bit window is present. Preventing the attempt as that would destroy the 64-bit window",
2054 pdn);
2055 ret = -EPERM;
2056 goto out_unlock;
2057 }
2058
2059 restore_default_dma_window(pdev, pdn);
2060
2061 default_prop = of_get_property(pdn, "ibm,dma-window", NULL);
2062 of_parse_dma_window(pdn, default_prop, &liobn, &offset, &size);
2063 /* Limit the default window size to window_size */
2064 iommu_table_setparms_common(tbl, pci->phb->bus->number, liobn,
2065 offset, 1UL << window_shift,
2066 IOMMU_PAGE_SHIFT_4K, NULL,
2067 &iommu_table_lpar_multi_ops);
2068 iommu_init_table(tbl, pci->phb->node, start, end);
2069
2070 table_group->tables[0] = tbl;
2071
2072 mutex_unlock(&dma_win_init_mutex);
2073
2074 goto exit;
2075 }
2076 }
2077 }
2078
2079 ret = of_property_read_u32_array(pdn, "ibm,ddw-applicable",
2080 &ddw_avail[0], DDW_APPLICABLE_SIZE);
2081 if (ret) {
2082 dev_info(&pdev->dev, "ibm,ddw-applicable not found\n");
2083 goto out_failed;
2084 }
2085 ret = -ENODEV;
2086
2087 pr_err("%s: Calling query %pOF\n", __func__, pdn);
2088 ret = query_ddw(pdev, ddw_avail, &query, pdn);
2089 if (ret)
2090 goto out_failed;
2091 ret = -ENODEV;
2092
2093 len = window_shift;
2094 if (query.largest_available_block < (1ULL << (len - page_shift))) {
2095 dev_dbg(&pdev->dev, "can't map window 0x%llx with %llu %llu-sized pages\n",
2096 1ULL << len, query.largest_available_block,
2097 1ULL << page_shift);
2098 ret = -EINVAL; /* Retry with smaller window size */
2099 goto out_unlock;
2100 }
2101
2102 if (create_ddw(pdev, ddw_avail, &create, page_shift, len)) {
2103 pr_err("%s: Create ddw failed %pOF\n", __func__, pdn);
2104 goto out_failed;
2105 }
2106
2107 win_addr = ((u64)create.addr_hi << 32) | create.addr_lo;
2108 win64 = ddw_property_create(DMA64_PROPNAME, create.liobn, win_addr, page_shift, len);
2109 if (!win64)
2110 goto remove_window;
2111
2112 ret = of_add_property(pdn, win64);
2113 if (ret) {
2114 dev_err(&pdev->dev, "unable to add DMA window property for %pOF: %ld", pdn, ret);
2115 goto free_property;
2116 }
2117 ret = -ENODEV;
2118
2119 window = ddw_list_new_entry(pdn, win64->value);
2120 if (!window)
2121 goto remove_property;
2122
2123 window->direct = false;
2124
2125 for (i = 0; i < ARRAY_SIZE(pci->phb->mem_resources); i++) {
2126 const unsigned long mask = IORESOURCE_MEM_64 | IORESOURCE_MEM;
2127
2128 /* Look for MMIO32 */
2129 if ((pci->phb->mem_resources[i].flags & mask) == IORESOURCE_MEM) {
2130 start = pci->phb->mem_resources[i].start;
2131 end = pci->phb->mem_resources[i].end;
2132 break;
2133 }
2134 }
2135
2136 /* New table for using DDW instead of the default DMA window */
2137 iommu_table_setparms_common(tbl, pci->phb->bus->number, create.liobn, win_addr,
2138 1UL << len, page_shift, NULL, &iommu_table_lpar_multi_ops);
2139 iommu_init_table(tbl, pci->phb->node, start, end);
2140
2141 pci->table_group->tables[num] = tbl;
2142 set_iommu_table_base(&pdev->dev, tbl);
2143 pdev->dev.archdata.dma_offset = win_addr;
2144
2145 spin_lock(&dma_win_list_lock);
2146 list_add(&window->list, &dma_win_list);
2147 spin_unlock(&dma_win_list_lock);
2148
2149 mutex_unlock(&dma_win_init_mutex);
2150
2151 goto exit;
2152
2153remove_property:
2154 of_remove_property(pdn, win64);
2155free_property:
2156 kfree(win64->name);
2157 kfree(win64->value);
2158 kfree(win64);
2159remove_window:
2160 __remove_dma_window(pdn, ddw_avail, create.liobn);
2161
2162out_failed:
2163 fpdn = kzalloc(sizeof(*fpdn), GFP_KERNEL);
2164 if (!fpdn)
2165 goto out_unlock;
2166 fpdn->pdn = pdn;
2167 list_add(&fpdn->list, &failed_ddw_pdn_list);
2168
2169out_unlock:
2170 mutex_unlock(&dma_win_init_mutex);
2171
2172 return ret;
2173exit:
2174 /* Allocate the userspace view */
2175 pseries_tce_iommu_userspace_view_alloc(tbl);
2176 tbl->it_allocated_size = spapr_tce_get_table_size(page_shift, window_size, levels);
2177
2178 *ptbl = iommu_tce_table_get(tbl);
2179
2180 return 0;
2181}
2182
2183static bool is_default_window_table(struct iommu_table_group *table_group, struct iommu_table *tbl)
2184{
2185 if (((tbl->it_size << tbl->it_page_shift) <= table_group->tce32_size) &&
2186 (tbl->it_page_shift == IOMMU_PAGE_SHIFT_4K))
2187 return true;
2188
2189 return false;
2190}
2191
2192static long spapr_tce_set_window(struct iommu_table_group *table_group,
2193 int num, struct iommu_table *tbl)
2194{
2195 return tbl == table_group->tables[num] ? 0 : -EPERM;
2196}
2197
2198static long spapr_tce_unset_window(struct iommu_table_group *table_group, int num)
2199{
2200 struct pci_dev *pdev = iommu_group_get_first_pci_dev(table_group->group);
2201 struct device_node *dn = pci_device_to_OF_node(pdev), *pdn;
2202 struct iommu_table *tbl = table_group->tables[num];
2203 struct failed_ddw_pdn *fpdn;
2204 struct dma_win *window;
2205 const char *win_name;
2206 int ret = -ENODEV;
2207
2208 mutex_lock(&dma_win_init_mutex);
2209
2210 if ((num == 0) && is_default_window_table(table_group, tbl))
2211 win_name = "ibm,dma-window";
2212 else
2213 win_name = DMA64_PROPNAME;
2214
2215 pdn = pci_dma_find(dn, NULL);
2216 if (!pdn || !PCI_DN(pdn)) { /* Niether of 32s|64-bit exist! */
2217 dev_warn(&pdev->dev, "No dma-windows exist for the node %pOF\n", pdn);
2218 goto out_failed;
2219 }
2220
2221 /* Dont clear the TCEs, User should have done it */
2222 if (remove_dma_window_named(pdn, true, win_name, false)) {
2223 pr_err("%s: The existing DDW removal failed for node %pOF\n", __func__, pdn);
2224 goto out_failed; /* Could not remove it either! */
2225 }
2226
2227 if (strcmp(win_name, DMA64_PROPNAME) == 0) {
2228 spin_lock(&dma_win_list_lock);
2229 list_for_each_entry(window, &dma_win_list, list) {
2230 if (window->device == pdn) {
2231 list_del(&window->list);
2232 kfree(window);
2233 break;
2234 }
2235 }
2236 spin_unlock(&dma_win_list_lock);
2237 }
2238
2239 iommu_tce_table_put(table_group->tables[num]);
2240 table_group->tables[num] = NULL;
2241
2242 ret = 0;
2243
2244 goto out_unlock;
2245
2246out_failed:
2247 fpdn = kzalloc(sizeof(*fpdn), GFP_KERNEL);
2248 if (!fpdn)
2249 goto out_unlock;
2250 fpdn->pdn = pdn;
2251 list_add(&fpdn->list, &failed_ddw_pdn_list);
2252
2253out_unlock:
2254 mutex_unlock(&dma_win_init_mutex);
2255
2256 return ret;
2257}
2258
2259static long spapr_tce_take_ownership(struct iommu_table_group *table_group, struct device *dev)
2260{
2261 struct iommu_table *tbl = table_group->tables[0];
2262 struct pci_dev *pdev = to_pci_dev(dev);
2263 struct device_node *dn = pci_device_to_OF_node(pdev);
2264 struct device_node *pdn;
2265
2266 /* SRIOV VFs using direct map by the host driver OR multifunction devices
2267 * where the ownership was taken on the attempt by the first function
2268 */
2269 if (!tbl && (table_group->max_dynamic_windows_supported != 1))
2270 return 0;
2271
2272 mutex_lock(&dma_win_init_mutex);
2273
2274 pdn = pci_dma_find(dn, NULL);
2275 if (!pdn || !PCI_DN(pdn)) { /* Niether of 32s|64-bit exist! */
2276 dev_warn(&pdev->dev, "No dma-windows exist for the node %pOF\n", pdn);
2277 mutex_unlock(&dma_win_init_mutex);
2278 return -1;
2279 }
2280
2281 /*
2282 * Though rtas call reset-pe removes the DDW, it doesn't clear the entries on the table
2283 * if there are any. In case of direct map, the entries will be left over, which
2284 * is fine for PEs with 2 DMA windows where the second window is created with create-pe
2285 * at which point the table is cleared. However, on VFs having only one DMA window, the
2286 * default window would end up seeing the entries left over from the direct map done
2287 * on the second window. So, remove the ddw explicitly so that clean_dma_window()
2288 * cleans up the entries if any.
2289 */
2290 if (remove_dynamic_dma_windows(pdev, pdn)) {
2291 dev_warn(&pdev->dev, "The existing DDW removal failed for node %pOF\n", pdn);
2292 mutex_unlock(&dma_win_init_mutex);
2293 return -1;
2294 }
2295
2296 /* The table_group->tables[0] is not null now, it must be the default window
2297 * Remove it, let the userspace create it as it needs.
2298 */
2299 if (table_group->tables[0]) {
2300 remove_dma_window_named(pdn, true, "ibm,dma-window", true);
2301 iommu_tce_table_put(tbl);
2302 table_group->tables[0] = NULL;
2303 }
2304 set_iommu_table_base(dev, NULL);
2305
2306 mutex_unlock(&dma_win_init_mutex);
2307
2308 return 0;
2309}
2310
2311static void spapr_tce_release_ownership(struct iommu_table_group *table_group, struct device *dev)
2312{
2313 struct iommu_table *tbl = table_group->tables[0];
2314
2315 if (tbl) { /* Default window already restored */
2316 return;
2317 }
2318
2319 mutex_lock(&dma_win_init_mutex);
2320
2321 /* Restore the default window */
2322 pseries_setup_default_iommu_config(table_group, dev);
2323
2324 mutex_unlock(&dma_win_init_mutex);
2325
2326 return;
2327}
2328
2329static struct iommu_table_group_ops spapr_tce_table_group_ops = {
2330 .get_table_size = spapr_tce_get_table_size,
2331 .create_table = spapr_tce_create_table,
2332 .set_window = spapr_tce_set_window,
2333 .unset_window = spapr_tce_unset_window,
2334 .take_ownership = spapr_tce_take_ownership,
2335 .release_ownership = spapr_tce_release_ownership,
2336};
2337#endif
2338
1654static int iommu_mem_notifier(struct notifier_block *nb, unsigned long action,2339static int iommu_mem_notifier(struct notifier_block *nb, unsigned long action,
1655 void *data)2340 void *data)
1656{2341{
@@ -1712,8 +2397,8 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti · 55 unmodified lines
1712 * we have to remove the property when releasing2397 * we have to remove the property when releasing
1713 * the device node.2398 * the device node.
1714 */2399 */
1715 if (remove_ddw(np, false, DIRECT64_PROPNAME))2400 if (remove_dma_window_named(np, false, DIRECT64_PROPNAME, true))
1716 remove_ddw(np, false, DMA64_PROPNAME);2401 remove_dma_window_named(np, false, DMA64_PROPNAME, true);
1717 2402
1718 if (pci && pci->table_group)2403 if (pci && pci->table_group)
1719 iommu_pseries_free_group(pci->table_group,2404 iommu_pseries_free_group(pci->table_group,
arch/powerpc/platforms/pseries/papr_scm.c+1−0
@@ -1536,5 +1536,6 @@ static void __exit papr_scm_exit(void) · 1535 unmodified lines
1536module_exit(papr_scm_exit);1536module_exit(papr_scm_exit);
1537 1537
1538MODULE_DEVICE_TABLE(of, papr_scm_match);1538MODULE_DEVICE_TABLE(of, papr_scm_match);
1539MODULE_DESCRIPTION("PAPR Storage Class Memory interface driver");
1539MODULE_LICENSE("GPL");1540MODULE_LICENSE("GPL");
1540MODULE_AUTHOR("IBM Corporation");1541MODULE_AUTHOR("IBM Corporation");
arch/powerpc/platforms/pseries/pci_dlpar.c+14−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
11 11
12#include <linux/pci.h>12#include <linux/pci.h>
13#include <linux/export.h>13#include <linux/export.h>
14#include <linux/node.h>
14#include <asm/pci-bridge.h>15#include <asm/pci-bridge.h>
15#include <asm/ppc-pci.h>16#include <asm/ppc-pci.h>
16#include <asm/firmware.h>17#include <asm/firmware.h>
@@ -21,9 +22,22 @@ · 4 unmodified lines
21struct pci_controller *init_phb_dynamic(struct device_node *dn)22struct pci_controller *init_phb_dynamic(struct device_node *dn)
22{23{
23 struct pci_controller *phb;24 struct pci_controller *phb;
25 int nid;
24 26
25 pr_debug("PCI: Initializing new hotplug PHB %pOF\n", dn);27 pr_debug("PCI: Initializing new hotplug PHB %pOF\n", dn);
26 28
29 nid = of_node_to_nid(dn);
30 if (likely((nid) >= 0)) {
31 if (!node_online(nid)) {
32 if (__register_one_node(nid)) {
33 pr_err("PCI: Failed to register node %d\n", nid);
34 } else {
35 update_numa_distance(dn);
36 node_set_online(nid);
37 }
38 }
39 }
40
27 phb = pcibios_alloc_controller(dn);41 phb = pcibios_alloc_controller(dn);
28 if (!phb)42 if (!phb)
29 return NULL;43 return NULL;
arch/powerpc/platforms/pseries/vas.c+21−1
@@ -38,7 +38,27 @@ static long hcall_return_busy_check(long rc) · 37 unmodified lines
38{38{
39 /* Check if we are stalled for some time */39 /* Check if we are stalled for some time */
40 if (H_IS_LONG_BUSY(rc)) {40 if (H_IS_LONG_BUSY(rc)) {
41 msleep(get_longbusy_msecs(rc));41 unsigned int ms;
42 /*
43 * Allocate, Modify and Deallocate HCALLs returns
44 * H_LONG_BUSY_ORDER_1_MSEC or H_LONG_BUSY_ORDER_10_MSEC
45 * for the long delay. So the sleep time should always
46 * be either 1 or 10msecs, but in case if the HCALL
47 * returns the long delay > 10 msecs, clamp the sleep
48 * time to 10msecs.
49 */
50 ms = clamp(get_longbusy_msecs(rc), 1, 10);
51
52 /*
53 * msleep() will often sleep at least 20 msecs even
54 * though the hypervisor suggests that the OS reissue
55 * HCALLs after 1 or 10msecs. Also the delay hint from
56 * the HCALL is just a suggestion. So OK to pause for
57 * less time than the hinted delay. Use usleep_range()
58 * to ensure we don't sleep much longer than actually
59 * needed.
60 */
61 usleep_range(ms * (USEC_PER_MSEC / 10), ms * USEC_PER_MSEC);
42 rc = H_BUSY;62 rc = H_BUSY;
43 } else if (rc == H_BUSY) {63 } else if (rc == H_BUSY) {
44 cond_resched();64 cond_resched();
arch/powerpc/sysdev/Kconfig+2−2
@@ -5,12 +5,12 @@ · 4 unmodified lines
5 5
6config PPC4xx_PCI_EXPRESS6config PPC4xx_PCI_EXPRESS
7 bool7 bool
8 depends on PCI && 4xx8 depends on PCI && 44x
9 9
10config PPC4xx_HSTA_MSI10config PPC4xx_HSTA_MSI
11 bool11 bool
12 depends on PCI_MSI12 depends on PCI_MSI
13 depends on PCI && 4xx13 depends on PCI && 44x
14 14
15config PPC_MSI_BITMAP15config PPC_MSI_BITMAP
16 bool16 bool
arch/powerpc/sysdev/rtc_cmos_setup.c+1−0
@@ -66,4 +66,5 @@ static int __init add_rtc(void) · 65 unmodified lines
66}66}
67fs_initcall(add_rtc);67fs_initcall(add_rtc);
68 68
69MODULE_DESCRIPTION("PPC RTC CMOS driver");
69MODULE_LICENSE("GPL");70MODULE_LICENSE("GPL");
arch/powerpc/xmon/ppc-dis.c+11−22
@@ -122,32 +122,21 @@ int print_insn_powerpc (unsigned long insn, unsigned long memaddr) · 121 unmodified lines
122 bool insn_is_short;122 bool insn_is_short;
123 ppc_cpu_t dialect;123 ppc_cpu_t dialect;
124 124
125 dialect = PPC_OPCODE_PPC | PPC_OPCODE_COMMON125 dialect = PPC_OPCODE_PPC | PPC_OPCODE_COMMON;
126 | PPC_OPCODE_64 | PPC_OPCODE_POWER4 | PPC_OPCODE_ALTIVEC;
127 126
128 if (cpu_has_feature(CPU_FTRS_POWER5))127 if (IS_ENABLED(CONFIG_PPC64))
129 dialect |= PPC_OPCODE_POWER5;128 dialect |= PPC_OPCODE_64 | PPC_OPCODE_POWER4 | PPC_OPCODE_CELL |
129 PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 |
130 PPC_OPCODE_POWER9;
130 131
131 if (cpu_has_feature(CPU_FTRS_CELL))132 if (cpu_has_feature(CPU_FTR_TM))
132 dialect |= (PPC_OPCODE_CELL | PPC_OPCODE_ALTIVEC);133 dialect |= PPC_OPCODE_HTM;
133 134
134 if (cpu_has_feature(CPU_FTRS_POWER6))135 if (cpu_has_feature(CPU_FTR_ALTIVEC))
135 dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_ALTIVEC);136 dialect |= PPC_OPCODE_ALTIVEC | PPC_OPCODE_ALTIVEC2;
136 137
137 if (cpu_has_feature(CPU_FTRS_POWER7))138 if (cpu_has_feature(CPU_FTR_VSX))
138 dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7139 dialect |= PPC_OPCODE_VSX | PPC_OPCODE_VSX3;
139 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX);
140
141 if (cpu_has_feature(CPU_FTRS_POWER8))
142 dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7
143 | PPC_OPCODE_POWER8 | PPC_OPCODE_HTM
144 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_ALTIVEC2 | PPC_OPCODE_VSX);
145
146 if (cpu_has_feature(CPU_FTRS_POWER9))
147 dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7
148 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9 | PPC_OPCODE_HTM
149 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_ALTIVEC2
150 | PPC_OPCODE_VSX | PPC_OPCODE_VSX3);
151 140
152 /* Get the major opcode of the insn. */141 /* Get the major opcode of the insn. */
153 opcode = NULL;142 opcode = NULL;
drivers/macintosh/ams/ams-i2c.c+1−1
@@ -60,7 +60,7 @@ static int ams_i2c_probe(struct i2c_client *client); · 59 unmodified lines
60static void ams_i2c_remove(struct i2c_client *client);60static void ams_i2c_remove(struct i2c_client *client);
61 61
62static const struct i2c_device_id ams_id[] = {62static const struct i2c_device_id ams_id[] = {
63 { "MAC,accelerometer_1", 0 },63 { "MAC,accelerometer_1" },
64 { }64 { }
65};65};
66MODULE_DEVICE_TABLE(i2c, ams_id);66MODULE_DEVICE_TABLE(i2c, ams_id);
drivers/macintosh/mac_hid.c+1−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
16#include <linux/module.h>16#include <linux/module.h>
17#include <linux/slab.h>17#include <linux/slab.h>
18 18
19MODULE_DESCRIPTION("Mouse button 2+3 emulation");
19MODULE_LICENSE("GPL");20MODULE_LICENSE("GPL");
20 21
21static int mouse_emulate_buttons;22static int mouse_emulate_buttons;
drivers/macintosh/therm_windtunnel.c+1−1
@@ -549,7 +549,7 @@ g4fan_exit( void ) · 548 unmodified lines
549 platform_driver_unregister( &therm_of_driver );549 platform_driver_unregister( &therm_of_driver );
550 550
551 if( x.of_dev )551 if( x.of_dev )
552 of_device_unregister( x.of_dev );552 of_platform_device_destroy(&x.of_dev->dev, NULL);
553}553}
554 554
555module_init(g4fan_init);555module_init(g4fan_init);
drivers/macintosh/windfarm_ad7417_sensor.c+1−1
@@ -304,7 +304,7 @@ static void wf_ad7417_remove(struct i2c_client *client) · 303 unmodified lines
304}304}
305 305
306static const struct i2c_device_id wf_ad7417_id[] = {306static const struct i2c_device_id wf_ad7417_id[] = {
307 { "MAC,ad7417", 0 },307 { "MAC,ad7417" },
308 { }308 { }
309};309};
310MODULE_DEVICE_TABLE(i2c, wf_ad7417_id);310MODULE_DEVICE_TABLE(i2c, wf_ad7417_id);
drivers/macintosh/windfarm_fcu_controls.c+1−1
@@ -573,7 +573,7 @@ static void wf_fcu_remove(struct i2c_client *client) · 572 unmodified lines
573}573}
574 574
575static const struct i2c_device_id wf_fcu_id[] = {575static const struct i2c_device_id wf_fcu_id[] = {
576 { "MAC,fcu", 0 },576 { "MAC,fcu" },
577 { }577 { }
578};578};
579MODULE_DEVICE_TABLE(i2c, wf_fcu_id);579MODULE_DEVICE_TABLE(i2c, wf_fcu_id);
drivers/macintosh/windfarm_lm87_sensor.c+1−1
@@ -156,7 +156,7 @@ static void wf_lm87_remove(struct i2c_client *client) · 155 unmodified lines
156}156}
157 157
158static const struct i2c_device_id wf_lm87_id[] = {158static const struct i2c_device_id wf_lm87_id[] = {
159 { "MAC,lm87cimt", 0 },159 { "MAC,lm87cimt" },
160 { }160 { }
161};161};
162MODULE_DEVICE_TABLE(i2c, wf_lm87_id);162MODULE_DEVICE_TABLE(i2c, wf_lm87_id);
drivers/macintosh/windfarm_max6690_sensor.c+1−1
@@ -112,7 +112,7 @@ static void wf_max6690_remove(struct i2c_client *client) · 111 unmodified lines
112}112}
113 113
114static const struct i2c_device_id wf_max6690_id[] = {114static const struct i2c_device_id wf_max6690_id[] = {
115 { "MAC,max6690", 0 },115 { "MAC,max6690" },
116 { }116 { }
117};117};
118MODULE_DEVICE_TABLE(i2c, wf_max6690_id);118MODULE_DEVICE_TABLE(i2c, wf_max6690_id);
drivers/macintosh/windfarm_smu_sat.c+1−1
@@ -333,7 +333,7 @@ static void wf_sat_remove(struct i2c_client *client) · 332 unmodified lines
333}333}
334 334
335static const struct i2c_device_id wf_sat_id[] = {335static const struct i2c_device_id wf_sat_id[] = {
336 { "MAC,smu-sat", 0 },336 { "MAC,smu-sat" },
337 { }337 { }
338};338};
339MODULE_DEVICE_TABLE(i2c, wf_sat_id);339MODULE_DEVICE_TABLE(i2c, wf_sat_id);
drivers/pci/hotplug/pnv_php.c+1−2
@@ -40,7 +40,6 @@ static void pnv_php_disable_irq(struct pnv_php_slot *php_slot, · 39 unmodified lines
40 bool disable_device)40 bool disable_device)
41{41{
42 struct pci_dev *pdev = php_slot->pdev;42 struct pci_dev *pdev = php_slot->pdev;
43 int irq = php_slot->irq;
44 u16 ctrl;43 u16 ctrl;
45 44
46 if (php_slot->irq > 0) {45 if (php_slot->irq > 0) {
@@ -59,7 +58,7 @@ static void pnv_php_disable_irq(struct pnv_php_slot *php_slot, · 12 unmodified lines
59 php_slot->wq = NULL;58 php_slot->wq = NULL;
60 }59 }
61 60
62 if (disable_device || irq > 0) {61 if (disable_device) {
63 if (pdev->msix_enabled)62 if (pdev->msix_enabled)
64 pci_disable_msix(pdev);63 pci_disable_msix(pdev);
65 else if (pdev->msi_enabled)64 else if (pdev->msi_enabled)
drivers/vfio/vfio_iommu_spapr_tce.c+9−4
@@ -364,7 +364,6 @@ static void tce_iommu_release(void *iommu_data) · 363 unmodified lines
364 if (!tbl)364 if (!tbl)
365 continue;365 continue;
366 366
367 tce_iommu_clear(container, tbl, tbl->it_offset, tbl->it_size);
368 tce_iommu_free_table(container, tbl);367 tce_iommu_free_table(container, tbl);
369 }368 }
370 369
@@ -720,6 +719,8 @@ static long tce_iommu_remove_window(struct tce_container *container, · 349 unmodified lines
720 719
721 BUG_ON(!tbl->it_size);720 BUG_ON(!tbl->it_size);
722 721
722 tce_iommu_clear(container, tbl, tbl->it_offset, tbl->it_size);
723
723 /* Detach groups from IOMMUs */724 /* Detach groups from IOMMUs */
724 list_for_each_entry(tcegrp, &container->group_list, next) {725 list_for_each_entry(tcegrp, &container->group_list, next) {
725 table_group = iommu_group_get_iommudata(tcegrp->grp);726 table_group = iommu_group_get_iommudata(tcegrp->grp);
@@ -738,7 +739,6 @@ static long tce_iommu_remove_window(struct tce_container *container, · 12 unmodified lines
738 }739 }
739 740
740 /* Free table */741 /* Free table */
741 tce_iommu_clear(container, tbl, tbl->it_offset, tbl->it_size);
742 tce_iommu_free_table(container, tbl);742 tce_iommu_free_table(container, tbl);
743 container->tables[num] = NULL;743 container->tables[num] = NULL;
744 744
@@ -1197,9 +1197,14 @@ static void tce_iommu_release_ownership(struct tce_container *container, · 452 unmodified lines
1197 return;1197 return;
1198 }1198 }
1199 1199
1200 for (i = 0; i < IOMMU_TABLE_GROUP_MAX_TABLES; ++i)1200 for (i = 0; i < IOMMU_TABLE_GROUP_MAX_TABLES; ++i) {
1201 if (container->tables[i])1201 if (container->tables[i]) {
1202 tce_iommu_clear(container, container->tables[i],
1203 container->tables[i]->it_offset,
1204 container->tables[i]->it_size);
1202 table_group->ops->unset_window(table_group, i);1205 table_group->ops->unset_window(table_group, i);
1206 }
1207 }
1203}1208}
1204 1209
1205static long tce_iommu_take_ownership(struct tce_container *container,1210static long tce_iommu_take_ownership(struct tce_container *container,
scripts/head-object-list.txt+0−1
@@ -27,7 +27,6 @@ arch/mips/kernel/head.o · 26 unmodified lines
27arch/nios2/kernel/head.o27arch/nios2/kernel/head.o
28arch/openrisc/kernel/head.o28arch/openrisc/kernel/head.o
29arch/parisc/kernel/head.o29arch/parisc/kernel/head.o
30arch/powerpc/kernel/head_40x.o
31arch/powerpc/kernel/head_44x.o30arch/powerpc/kernel/head_44x.o
32arch/powerpc/kernel/head_64.o31arch/powerpc/kernel/head_64.o
33arch/powerpc/kernel/head_8xx.o32arch/powerpc/kernel/head_8xx.o
tools/testing/selftests/sigaltstack/current_stack_pointer.h+1−1
@@ -8,7 +8,7 @@ register unsigned long sp asm("sp"); · 7 unmodified lines
8register unsigned long sp asm("esp");8register unsigned long sp asm("esp");
9#elif __loongarch649#elif __loongarch64
10register unsigned long sp asm("$sp");10register unsigned long sp asm("$sp");
11#elif __ppc__11#elif __powerpc__
12register unsigned long sp asm("r1");12register unsigned long sp asm("r1");
13#elif __s390x__13#elif __s390x__
14register unsigned long sp asm("%15");14register unsigned long sp asm("%15");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t