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
128128 - All 32 bit::
129129
130130 +--------------+
131− | 401 |
132− +--------------+
133− |
134− |
135− v
136− +--------------+
137− | 403 |
138− +--------------+
139− |
140− |
141− v
142− +--------------+
143− | 405 |
144− +--------------+
145− |
146− |
147− v
148− +--------------+
149131 | 440 |
150132 +--------------+
151133 |
Documentation/arch/powerpc/elf_hwcaps.rst+1−0
@@ -91,6 +91,7 @@ PPC_FEATURE_HAS_MMU · 90 unmodified lines
9191
9292 PPC_FEATURE_HAS_4xxMAC
9393 The processor is 40x or 44x family.
94+ Unused in the kernel since 732b32daef80 ("powerpc: Remove core support for 40x")
9495
9596 PPC_FEATURE_UNIFIED_CACHE
9697 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
546546 +--------+-------+----+--------+----------------------------------+
547547 | 0x1052 | 0x08 | RW | T | CTRL |
548548 +--------+-------+----+--------+----------------------------------+
549−| 0x1053-| | | | Reserved |
549+| 0x1053 | 0x08 | RW | T | DPDES |
550++--------+-------+----+--------+----------------------------------+
551+| 0x1054-| | | | Reserved |
550552 | 0x1FFF | | | | |
551553 +--------+-------+----+--------+----------------------------------+
552554 | 0x2000 | 0x04 | RW | T | CR |
Documentation/virt/kvm/api.rst+3−0
@@ -2439,8 +2439,11 @@ registers, find a list below: · 2438 unmodified lines
24392439 PPC KVM_REG_PPC_PSSCR 64
24402440 PPC KVM_REG_PPC_DEC_EXPIRY 64
24412441 PPC KVM_REG_PPC_PTCR 64
2442+ PPC KVM_REG_PPC_HASHKEYR 64
2443+ PPC KVM_REG_PPC_HASHPKEYR 64
24422444 PPC KVM_REG_PPC_DAWR1 64
24432445 PPC KVM_REG_PPC_DAWRX1 64
2446+ PPC KVM_REG_PPC_DEXCR 64
24442447 PPC KVM_REG_PPC_TM_GPR0 64
24452448 ...
24462449 PPC KVM_REG_PPC_TM_GPR31 64
MAINTAINERS+0−1
@@ -12924,7 +12924,6 @@ F: arch/powerpc/platforms/52xx/ · 12923 unmodified lines
1292412924 LINUX FOR POWERPC EMBEDDED PPC4XX
1292512925 L: linuxppc-dev@lists.ozlabs.org
1292612926 S: Orphan
12927−F: arch/powerpc/platforms/40x/
1292812927 F: arch/powerpc/platforms/44x/
1292912928
1293012929 LINUX FOR POWERPC EMBEDDED PPC85XX
arch/powerpc/Kconfig+7−10
@@ -149,7 +149,7 @@ config PPC · 148 unmodified lines
149149 select ARCH_HAS_PTE_SPECIAL
150150 select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE && PPC_BOOK3S_64
151151 select ARCH_HAS_SET_MEMORY
152− select ARCH_HAS_STRICT_KERNEL_RWX if (PPC_BOOK3S || PPC_8xx || 40x) && !HIBERNATION
152+ select ARCH_HAS_STRICT_KERNEL_RWX if (PPC_BOOK3S || PPC_8xx) && !HIBERNATION
153153 select ARCH_HAS_STRICT_KERNEL_RWX if PPC_85xx && !HIBERNATION && !RANDOMIZE_BASE
154154 select ARCH_HAS_STRICT_MODULE_RWX if ARCH_HAS_STRICT_KERNEL_RWX
155155 select ARCH_HAS_SYSCALL_WRAPPER if !SPU_BASE && !COMPAT
@@ -167,7 +167,7 @@ config PPC · 11 unmodified lines
167167 select ARCH_SPLIT_ARG64 if PPC32
168168 select ARCH_STACKWALK
169169 select ARCH_SUPPORTS_ATOMIC_RMW
170− select ARCH_SUPPORTS_DEBUG_PAGEALLOC if PPC_BOOK3S || PPC_8xx || 40x
170+ select ARCH_SUPPORTS_DEBUG_PAGEALLOC if PPC_BOOK3S || PPC_8xx
171171 select ARCH_USE_BUILTIN_BSWAP
172172 select ARCH_USE_CMPXCHG_LOCKREF if PPC64
173173 select ARCH_USE_MEMTEST
@@ -389,7 +389,7 @@ config ARCH_SUSPEND_POSSIBLE · 215 unmodified lines
389389 def_bool y
390390 depends on ADB_PMU || PPC_EFIKA || PPC_LITE5200 || PPC_83xx || \
391391 (PPC_85xx && !PPC_E500MC) || PPC_86xx || PPC_PSERIES \
392− || 44x || 40x
392+ || 44x
393393
394394 config ARCH_SUSPEND_NONZERO_CPU
395395 def_bool y
@@ -443,7 +443,7 @@ config ARCH_SUPPORTS_UPROBES · 47 unmodified lines
443443
444444 config PPC_ADV_DEBUG_REGS
445445 bool
446− depends on 40x || BOOKE
446+ depends on BOOKE
447447 default y
448448
449449 config PPC_ADV_DEBUG_IACS
@@ -490,7 +490,7 @@ source "kernel/Kconfig.hz" · 40 unmodified lines
490490
491491 config MATH_EMULATION
492492 bool "Math emulation"
493− depends on 4xx || PPC_8xx || PPC_MPC832x || BOOKE || PPC_MICROWATT
493+ depends on 44x || PPC_8xx || PPC_MPC832x || BOOKE || PPC_MICROWATT
494494 select PPC_FPU_REGS
495495 help
496496 Some PowerPC chips designed for embedded applications do not have
@@ -1077,7 +1077,7 @@ config GENERIC_ISA_DMA · 580 unmodified lines
10771077 config PPC_INDIRECT_PCI
10781078 bool
10791079 depends on PCI
1080− default y if 40x || 44x
1080+ default y if 44x
10811081
10821082 config SBUS
10831083 bool
@@ -1102,15 +1102,12 @@ config FSL_PMC · 18 unmodified lines
11021102 config PPC4xx_CPM
11031103 bool
11041104 default y
1105− depends on SUSPEND && (44x || 40x)
1105+ depends on SUSPEND && 44x
11061106 help
11071107 PPC4xx Clock Power Management (CPM) support (suspend/resume).
11081108 It also enables support for two different idle states (idle-wait
11091109 and idle-doze).
11101110
1111−config 4xx_SOC
1112− bool
1113−
11141111 config FSL_LBC
11151112 bool "Freescale Local Bus support"
11161113 help
arch/powerpc/Kconfig.debug+0−13
@@ -244,14 +244,6 @@ config PPC_EARLY_DEBUG_44x · 243 unmodified lines
244244 inbuilt serial port. If you enable this, ensure you set
245245 PPC_EARLY_DEBUG_44x_PHYSLOW below to suit your target board.
246246
247−config 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−
255247 config PPC_EARLY_DEBUG_CPM
256248 bool "Early serial debugging for Freescale CPM-based serial ports"
257249 depends on SERIAL_CPM=y
@@ -356,11 +348,6 @@ config PPC_EARLY_DEBUG_44x_PHYSHIGH · 98 unmodified lines
356348 depends on PPC_EARLY_DEBUG_44x
357349 default "0x1"
358350
359−config PPC_EARLY_DEBUG_40x_PHYSADDR
360− hex "Early debug UART physical address"
361− depends on PPC_EARLY_DEBUG_40x
362− default "0xef600300"
363−
364351 config PPC_EARLY_DEBUG_CPM_ADDR
365352 hex "CPM UART early debug transmit descriptor address"
366353 depends on PPC_EARLY_DEBUG_CPM
arch/powerpc/Makefile+0−5
@@ -301,11 +301,6 @@ ppc32_allmodconfig: · 300 unmodified lines
301301 $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/book3s_32.config \
302302 -f $(srctree)/Makefile allmodconfig
303303
304−generated_configs += ppc40x_allmodconfig
305−ppc40x_allmodconfig:
306− $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/40x.config \
307− -f $(srctree)/Makefile allmodconfig
308−
309304 generated_configs += ppc44x_allmodconfig
310305 ppc44x_allmodconfig:
311306 $(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
253253 dt_fixup_memory(0, memsize);
254254 }
255255
256−#define SPRN_DBCR0_40X 0x3F2
257256 #define SPRN_DBCR0_44X 0x134
258257 #define DBCR0_RST_SYSTEM 0x30000000
259258
@@ -270,18 +269,6 @@ void ibm44x_dbcr_reset(void) · 10 unmodified lines
270269
271270 }
272271
273−void 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−
285272 #define EMAC_RESET 0x20000000
286273 void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1)
287274 {
@@ -544,256 +531,3 @@ void ibm440spe_fixup_clocks(unsigned int sys_clk, · 256 unmodified lines
544531 eplike_fixup_uart_clk(1, "/plb/opb/serial@f0000300", ser_clk, plb_clk);
545532 eplike_fixup_uart_clk(2, "/plb/opb/serial@f0000600", ser_clk, plb_clk);
546533 }
547−
548−void 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−
621−void 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−
663−static 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−
669−u32 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−
680−static 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−
712−u32 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−
723−void 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 {
776−bypass:
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
1212 void ibm440spe_fixup_memsize(void);
1313 void ibm4xx_denali_fixup_memsize(void);
1414 void ibm44x_dbcr_reset(void);
15−void ibm40x_dbcr_reset(void);
1615 void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1);
1716 void ibm4xx_fixup_ebc_ranges(const char *ebc);
1817
19−void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);
20−void ibm405ep_fixup_clocks(unsigned int sys_clk);
21−void ibm405ex_fixup_clocks(unsigned int sys_clk, unsigned int uart_clk);
2218 void ibm440gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);
2319 void ibm440ep_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,
2420 unsigned int tmr_clk);
arch/powerpc/boot/Makefile+0−11
@@ -54,10 +54,8 @@ endif · 53 unmodified lines
5454
5555 $(obj)/4xx.o: BOOTTARGETFLAGS += -mcpu=405
5656 $(obj)/ebony.o: BOOTTARGETFLAGS += -mcpu=440
57−$(obj)/cuboot-hotfoot.o: BOOTTARGETFLAGS += -mcpu=405
5857 $(obj)/cuboot-taishan.o: BOOTTARGETFLAGS += -mcpu=440
5958 $(obj)/cuboot-katmai.o: BOOTTARGETFLAGS += -mcpu=440
60−$(obj)/cuboot-acadia.o: BOOTTARGETFLAGS += -mcpu=405
6159 $(obj)/treeboot-iss4xx.o: BOOTTARGETFLAGS += -mcpu=405
6260 $(obj)/treeboot-currituck.o: BOOTTARGETFLAGS += -mcpu=405
6361 $(obj)/treeboot-akebono.o: BOOTTARGETFLAGS += -mcpu=405
@@ -146,7 +144,6 @@ src-wlib-$(CONFIG_PPC_POWERNV) += opal-calls.S opal.c · 82 unmodified lines
146144 ifndef CONFIG_PPC64_BOOT_WRAPPER
147145 src-wlib-y += crtsavres.S
148146 endif
149−src-wlib-$(CONFIG_40x) += 4xx.c planetcore.c
150147 src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c
151148 src-wlib-$(CONFIG_PPC_8xx) += mpc8xx.c planetcore.c fsl-soc.c
152149 src-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
154151 src-wlib-$(CONFIG_CPM) += cpm-serial.c
155152
156153 src-plat-y := of.c epapr.c
157−src-plat-$(CONFIG_40x) += fixed-head.S cuboot-hotfoot.c \
158− cuboot-acadia.c \
159− cuboot-kilauea.c simpleboot.c
160154 src-plat-$(CONFIG_44x) += treeboot-ebony.c cuboot-ebony.c treeboot-bamboo.c \
161155 cuboot-bamboo.c cuboot-sam440ep.c \
162156 cuboot-sequoia.c cuboot-rainier.c \
@@ -300,11 +294,6 @@ image-$(CONFIG_EPAPR_BOOT) += zImage.epapr · 137 unmodified lines
300294 # Boards with newish u-boot firmware can use the uImage target above
301295 #
302296
303−# Board ports in arch/powerpc/platform/40x/Kconfig
304−image-$(CONFIG_HOTFOOT) += cuImage.hotfoot
305−image-$(CONFIG_ACADIA) += cuImage.acadia
306−image-$(CONFIG_OBS600) += uImage.obs600
307−
308297 # Board ports in arch/powerpc/platform/44x/Kconfig
309298 image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony
310299 image-$(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−
21−static 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−
41−static 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−
156−static 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−
163−void 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−
20−static bd_t bd;
21−
22−#define NUM_REGS 3
23−
24−static 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−
131−void 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−
25−static bd_t bd;
26−
27−static 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−
38−void 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
153153 #define CPR0_SCPID 0x120
154154 #define CPR0_PLLC0 0x40
155155
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−
167156 /* 440GX/405EX Clock Control reg */
168157 #define DCRN_CPR0_CLKUPD 0x020
169158 #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−
35−typedef 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
6363 #if defined(TARGET_HYMOD)
6464 hymod_conf_t bi_hymod_conf; /* hymod configuration information */
6565 #endif
66−#if defined(TARGET_EVB64260) || defined(TARGET_405EP) || defined(TARGET_44x) || \
66+#if defined(TARGET_EVB64260) || defined(TARGET_44x) || \
6767 defined(TARGET_85xx) || defined(TARGET_83xx) || defined(TARGET_HAS_ETH1)
6868 /* second onboard ethernet port */
6969 unsigned char bi_enet1addr[6];
arch/powerpc/boot/wrapper+1−21
@@ -337,7 +337,7 @@ ps3) · 336 unmodified lines
337337 make_space=n
338338 pie=
339339 ;;
340−ep88xc|ep405|ep8248e)
340+ep88xc|ep8248e)
341341 platformo="$object/fixed-head.o $object/$platform.o"
342342 binary=y
343343 ;;
@@ -468,26 +468,6 @@ uboot) · 124 unmodified lines
468468 fi
469469 exit 0
470470 ;;
471−uboot-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− ;;
491471 esac
492472
493473 addsec() {
arch/powerpc/configs/40x.config+0−2
@@ -1,2 +0,0 @@
1−CONFIG_PPC64=n
2−CONFIG_40x=y
arch/powerpc/configs/40x/acadia_defconfig+0−61
@@ -1,61 +0,0 @@
1−CONFIG_40x=y
2−CONFIG_SYSVIPC=y
3−CONFIG_POSIX_MQUEUE=y
4−CONFIG_LOG_BUF_SHIFT=14
5−CONFIG_BLK_DEV_INITRD=y
6−CONFIG_EXPERT=y
7−CONFIG_KALLSYMS_ALL=y
8−CONFIG_MODULES=y
9−CONFIG_MODULE_UNLOAD=y
10−# CONFIG_BLK_DEV_BSG is not set
11−CONFIG_ACADIA=y
12−CONFIG_PCI=y
13−CONFIG_NET=y
14−CONFIG_PACKET=y
15−CONFIG_UNIX=y
16−CONFIG_INET=y
17−CONFIG_IP_PNP=y
18−CONFIG_IP_PNP_DHCP=y
19−CONFIG_IP_PNP_BOOTP=y
20−# CONFIG_IPV6 is not set
21−CONFIG_CONNECTOR=y
22−CONFIG_MTD=y
23−CONFIG_MTD_CMDLINE_PARTS=y
24−CONFIG_MTD_BLOCK=m
25−CONFIG_MTD_CFI=y
26−CONFIG_MTD_JEDECPROBE=y
27−CONFIG_MTD_CFI_AMDSTD=y
28−CONFIG_MTD_PHYSMAP_OF=y
29−CONFIG_BLK_DEV_RAM=y
30−CONFIG_BLK_DEV_RAM_SIZE=35000
31−CONFIG_NETDEVICES=y
32−CONFIG_IBM_EMAC=y
33−CONFIG_IBM_EMAC_RXB=256
34−CONFIG_IBM_EMAC_TXB=256
35−CONFIG_IBM_EMAC_DEBUG=y
36−# CONFIG_INPUT is not set
37−# CONFIG_SERIO is not set
38−# CONFIG_VT is not set
39−CONFIG_SERIAL_8250=y
40−CONFIG_SERIAL_8250_CONSOLE=y
41−CONFIG_SERIAL_8250_EXTENDED=y
42−CONFIG_SERIAL_8250_SHARE_IRQ=y
43−CONFIG_SERIAL_OF_PLATFORM=y
44−# CONFIG_HW_RANDOM is not set
45−# CONFIG_HWMON is not set
46−CONFIG_THERMAL=y
47−# CONFIG_USB_SUPPORT is not set
48−CONFIG_EXT2_FS=y
49−CONFIG_PROC_KCORE=y
50−CONFIG_TMPFS=y
51−CONFIG_CRAMFS=y
52−CONFIG_NFS_FS=y
53−CONFIG_ROOT_NFS=y
54−CONFIG_DEBUG_FS=y
55−CONFIG_MAGIC_SYSRQ=y
56−CONFIG_DETECT_HUNG_TASK=y
57−CONFIG_CRYPTO_CBC=y
58−CONFIG_CRYPTO_ECB=y
59−CONFIG_CRYPTO_PCBC=y
60−CONFIG_CRYPTO_MD5=y
61−CONFIG_CRYPTO_DES=y
arch/powerpc/configs/40x/kilauea_defconfig+0−69
@@ -1,69 +0,0 @@
1−CONFIG_40x=y
2−CONFIG_SYSVIPC=y
3−CONFIG_POSIX_MQUEUE=y
4−CONFIG_NO_HZ=y
5−CONFIG_HIGH_RES_TIMERS=y
6−CONFIG_LOG_BUF_SHIFT=14
7−CONFIG_BLK_DEV_INITRD=y
8−CONFIG_EXPERT=y
9−CONFIG_KALLSYMS_ALL=y
10−CONFIG_MODULES=y
11−CONFIG_MODULE_UNLOAD=y
12−# CONFIG_BLK_DEV_BSG is not set
13−CONFIG_KILAUEA=y
14−CONFIG_PCI=y
15−CONFIG_NET=y
16−CONFIG_PACKET=y
17−CONFIG_UNIX=y
18−CONFIG_INET=y
19−CONFIG_IP_PNP=y
20−CONFIG_IP_PNP_DHCP=y
21−CONFIG_IP_PNP_BOOTP=y
22−# CONFIG_IPV6 is not set
23−CONFIG_CONNECTOR=y
24−CONFIG_MTD=y
25−CONFIG_MTD_CMDLINE_PARTS=y
26−CONFIG_MTD_BLOCK=y
27−CONFIG_MTD_CFI=y
28−CONFIG_MTD_JEDECPROBE=y
29−CONFIG_MTD_CFI_AMDSTD=y
30−CONFIG_MTD_PHYSMAP_OF=y
31−CONFIG_MTD_RAW_NAND=y
32−CONFIG_MTD_NAND_NDFC=y
33−CONFIG_BLK_DEV_RAM=y
34−CONFIG_BLK_DEV_RAM_SIZE=35000
35−CONFIG_NETDEVICES=y
36−CONFIG_IBM_EMAC=y
37−CONFIG_IBM_EMAC_RXB=256
38−CONFIG_IBM_EMAC_TXB=256
39−# CONFIG_INPUT is not set
40−# CONFIG_SERIO is not set
41−# CONFIG_VT is not set
42−CONFIG_SERIAL_8250=y
43−CONFIG_SERIAL_8250_CONSOLE=y
44−CONFIG_SERIAL_8250_EXTENDED=y
45−CONFIG_SERIAL_8250_SHARE_IRQ=y
46−CONFIG_SERIAL_OF_PLATFORM=y
47−# CONFIG_HW_RANDOM is not set
48−CONFIG_I2C=y
49−CONFIG_I2C_CHARDEV=y
50−CONFIG_I2C_IBM_IIC=y
51−CONFIG_SENSORS_LM75=y
52−CONFIG_THERMAL=y
53−# CONFIG_USB_SUPPORT is not set
54−CONFIG_RTC_CLASS=y
55−CONFIG_RTC_DRV_DS1307=y
56−CONFIG_EXT2_FS=y
57−CONFIG_PROC_KCORE=y
58−CONFIG_TMPFS=y
59−CONFIG_CRAMFS=y
60−CONFIG_NFS_FS=y
61−CONFIG_ROOT_NFS=y
62−CONFIG_DEBUG_FS=y
63−CONFIG_MAGIC_SYSRQ=y
64−CONFIG_DETECT_HUNG_TASK=y
65−CONFIG_CRYPTO_CBC=y
66−CONFIG_CRYPTO_ECB=y
67−CONFIG_CRYPTO_PCBC=y
68−CONFIG_CRYPTO_MD5=y
69−CONFIG_CRYPTO_DES=y
arch/powerpc/configs/40x/klondike_defconfig+0−43
@@ -1,43 +0,0 @@
1−CONFIG_40x=y
2−CONFIG_SYSVIPC=y
3−CONFIG_LOG_BUF_SHIFT=14
4−CONFIG_SYSFS_DEPRECATED=y
5−CONFIG_SYSFS_DEPRECATED_V2=y
6−CONFIG_BLK_DEV_INITRD=y
7−CONFIG_EXPERT=y
8−CONFIG_MODULES=y
9−CONFIG_MODULE_UNLOAD=y
10−CONFIG_APM8018X=y
11−# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
12−CONFIG_MATH_EMULATION=y
13−# CONFIG_SUSPEND is not set
14−CONFIG_BLK_DEV_RAM=y
15−CONFIG_BLK_DEV_RAM_SIZE=35000
16−CONFIG_SCSI=y
17−CONFIG_BLK_DEV_SD=y
18−CONFIG_CHR_DEV_SG=y
19−CONFIG_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
29−CONFIG_EXT2_FS=y
30−CONFIG_EXT4_FS=y
31−CONFIG_MSDOS_FS=y
32−CONFIG_VFAT_FS=y
33−CONFIG_PROC_KCORE=y
34−CONFIG_TMPFS=y
35−CONFIG_CRAMFS=y
36−CONFIG_NLS_CODEPAGE_437=y
37−CONFIG_NLS_ASCII=y
38−CONFIG_NLS_ISO8859_1=y
39−CONFIG_NLS_UTF8=y
40−CONFIG_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 @@
1−CONFIG_40x=y
2−CONFIG_SYSVIPC=y
3−CONFIG_POSIX_MQUEUE=y
4−CONFIG_LOG_BUF_SHIFT=14
5−CONFIG_BLK_DEV_INITRD=y
6−CONFIG_EXPERT=y
7−CONFIG_KALLSYMS_ALL=y
8−CONFIG_MODULES=y
9−CONFIG_MODULE_UNLOAD=y
10−# CONFIG_BLK_DEV_BSG is not set
11−CONFIG_MAKALU=y
12−CONFIG_NET=y
13−CONFIG_PACKET=y
14−CONFIG_UNIX=y
15−CONFIG_INET=y
16−CONFIG_IP_PNP=y
17−CONFIG_IP_PNP_DHCP=y
18−CONFIG_IP_PNP_BOOTP=y
19−# CONFIG_IPV6 is not set
20−CONFIG_CONNECTOR=y
21−CONFIG_MTD=y
22−CONFIG_MTD_CMDLINE_PARTS=y
23−CONFIG_MTD_BLOCK=m
24−CONFIG_MTD_CFI=y
25−CONFIG_MTD_JEDECPROBE=y
26−CONFIG_MTD_CFI_AMDSTD=y
27−CONFIG_MTD_PHYSMAP_OF=y
28−CONFIG_BLK_DEV_RAM=y
29−CONFIG_BLK_DEV_RAM_SIZE=35000
30−CONFIG_NETDEVICES=y
31−CONFIG_IBM_EMAC=y
32−CONFIG_IBM_EMAC_RXB=256
33−CONFIG_IBM_EMAC_TXB=256
34−# CONFIG_INPUT is not set
35−# CONFIG_SERIO is not set
36−# CONFIG_VT is not set
37−CONFIG_SERIAL_8250=y
38−CONFIG_SERIAL_8250_CONSOLE=y
39−CONFIG_SERIAL_8250_EXTENDED=y
40−CONFIG_SERIAL_8250_SHARE_IRQ=y
41−CONFIG_SERIAL_OF_PLATFORM=y
42−# CONFIG_HW_RANDOM is not set
43−# CONFIG_HWMON is not set
44−CONFIG_THERMAL=y
45−# CONFIG_USB_SUPPORT is not set
46−CONFIG_EXT2_FS=y
47−CONFIG_PROC_KCORE=y
48−CONFIG_TMPFS=y
49−CONFIG_CRAMFS=y
50−CONFIG_NFS_FS=y
51−CONFIG_ROOT_NFS=y
52−CONFIG_DEBUG_FS=y
53−CONFIG_MAGIC_SYSRQ=y
54−CONFIG_DETECT_HUNG_TASK=y
55−CONFIG_CRYPTO_CBC=y
56−CONFIG_CRYPTO_ECB=y
57−CONFIG_CRYPTO_PCBC=y
58−CONFIG_CRYPTO_MD5=y
59−CONFIG_CRYPTO_DES=y
arch/powerpc/configs/40x/obs600_defconfig+0−69
@@ -1,69 +0,0 @@
1−CONFIG_40x=y
2−CONFIG_SYSVIPC=y
3−CONFIG_POSIX_MQUEUE=y
4−CONFIG_NO_HZ=y
5−CONFIG_HIGH_RES_TIMERS=y
6−CONFIG_LOG_BUF_SHIFT=14
7−CONFIG_BLK_DEV_INITRD=y
8−CONFIG_EXPERT=y
9−CONFIG_KALLSYMS_ALL=y
10−CONFIG_MODULES=y
11−CONFIG_MODULE_UNLOAD=y
12−# CONFIG_BLK_DEV_BSG is not set
13−CONFIG_OBS600=y
14−CONFIG_MATH_EMULATION=y
15−CONFIG_NET=y
16−CONFIG_PACKET=y
17−CONFIG_UNIX=y
18−CONFIG_INET=y
19−CONFIG_IP_PNP=y
20−CONFIG_IP_PNP_DHCP=y
21−CONFIG_IP_PNP_BOOTP=y
22−# CONFIG_IPV6 is not set
23−CONFIG_CONNECTOR=y
24−CONFIG_MTD=y
25−CONFIG_MTD_CMDLINE_PARTS=y
26−CONFIG_MTD_BLOCK=y
27−CONFIG_MTD_CFI=y
28−CONFIG_MTD_JEDECPROBE=y
29−CONFIG_MTD_CFI_AMDSTD=y
30−CONFIG_MTD_PHYSMAP_OF=y
31−CONFIG_MTD_RAW_NAND=y
32−CONFIG_MTD_NAND_NDFC=y
33−CONFIG_BLK_DEV_RAM=y
34−CONFIG_BLK_DEV_RAM_SIZE=35000
35−CONFIG_NETDEVICES=y
36−CONFIG_IBM_EMAC=y
37−CONFIG_IBM_EMAC_RXB=256
38−CONFIG_IBM_EMAC_TXB=256
39−# CONFIG_INPUT is not set
40−# CONFIG_SERIO is not set
41−# CONFIG_VT is not set
42−CONFIG_SERIAL_8250=y
43−CONFIG_SERIAL_8250_CONSOLE=y
44−CONFIG_SERIAL_8250_EXTENDED=y
45−CONFIG_SERIAL_8250_SHARE_IRQ=y
46−CONFIG_SERIAL_OF_PLATFORM=y
47−# CONFIG_HW_RANDOM is not set
48−CONFIG_I2C=y
49−CONFIG_I2C_CHARDEV=y
50−CONFIG_I2C_IBM_IIC=y
51−CONFIG_SENSORS_LM75=y
52−CONFIG_THERMAL=y
53−# CONFIG_USB_SUPPORT is not set
54−CONFIG_RTC_CLASS=y
55−CONFIG_RTC_DRV_DS1307=y
56−CONFIG_EXT2_FS=y
57−CONFIG_PROC_KCORE=y
58−CONFIG_TMPFS=y
59−CONFIG_CRAMFS=y
60−CONFIG_NFS_FS=y
61−CONFIG_ROOT_NFS=y
62−CONFIG_DEBUG_FS=y
63−CONFIG_MAGIC_SYSRQ=y
64−CONFIG_DETECT_HUNG_TASK=y
65−CONFIG_CRYPTO_CBC=y
66−CONFIG_CRYPTO_ECB=y
67−CONFIG_CRYPTO_PCBC=y
68−CONFIG_CRYPTO_MD5=y
69−CONFIG_CRYPTO_DES=y
arch/powerpc/configs/40x/walnut_defconfig+0−55
@@ -1,55 +0,0 @@
1−CONFIG_40x=y
2−CONFIG_SYSVIPC=y
3−CONFIG_POSIX_MQUEUE=y
4−CONFIG_LOG_BUF_SHIFT=14
5−CONFIG_BLK_DEV_INITRD=y
6−CONFIG_EXPERT=y
7−CONFIG_KALLSYMS_ALL=y
8−CONFIG_MODULES=y
9−CONFIG_MODULE_UNLOAD=y
10−# CONFIG_BLK_DEV_BSG is not set
11−CONFIG_NET=y
12−CONFIG_PACKET=y
13−CONFIG_UNIX=y
14−CONFIG_INET=y
15−CONFIG_IP_PNP=y
16−CONFIG_IP_PNP_DHCP=y
17−CONFIG_IP_PNP_BOOTP=y
18−# CONFIG_IPV6 is not set
19−CONFIG_CONNECTOR=y
20−CONFIG_MTD=y
21−CONFIG_MTD_CMDLINE_PARTS=y
22−CONFIG_MTD_BLOCK=m
23−CONFIG_MTD_CFI=y
24−CONFIG_MTD_JEDECPROBE=y
25−CONFIG_MTD_CFI_AMDSTD=y
26−CONFIG_MTD_PHYSMAP_OF=y
27−CONFIG_BLK_DEV_RAM=y
28−CONFIG_BLK_DEV_RAM_SIZE=35000
29−CONFIG_NETDEVICES=y
30−CONFIG_IBM_EMAC=y
31−# CONFIG_INPUT is not set
32−# CONFIG_SERIO is not set
33−# CONFIG_VT is not set
34−CONFIG_SERIAL_8250=y
35−CONFIG_SERIAL_8250_CONSOLE=y
36−CONFIG_SERIAL_8250_EXTENDED=y
37−CONFIG_SERIAL_8250_SHARE_IRQ=y
38−CONFIG_SERIAL_OF_PLATFORM=y
39−# CONFIG_HW_RANDOM is not set
40−# CONFIG_HWMON is not set
41−CONFIG_THERMAL=y
42−CONFIG_EXT2_FS=y
43−CONFIG_PROC_KCORE=y
44−CONFIG_TMPFS=y
45−CONFIG_CRAMFS=y
46−CONFIG_NFS_FS=y
47−CONFIG_ROOT_NFS=y
48−CONFIG_DEBUG_FS=y
49−CONFIG_MAGIC_SYSRQ=y
50−CONFIG_DETECT_HUNG_TASK=y
51−CONFIG_CRYPTO_CBC=y
52−CONFIG_CRYPTO_ECB=y
53−CONFIG_CRYPTO_PCBC=y
54−CONFIG_CRYPTO_MD5=y
55−CONFIG_CRYPTO_DES=y
arch/powerpc/configs/85xx-hw.config+2−0
@@ -24,6 +24,7 @@ CONFIG_FS_ENET=y · 23 unmodified lines
2424 CONFIG_FSL_CORENET_CF=y
2525 CONFIG_FSL_DMA=y
2626 CONFIG_FSL_HV_MANAGER=y
27+CONFIG_FSL_IFC=y
2728 CONFIG_FSL_PQ_MDIO=y
2829 CONFIG_FSL_RIO=y
2930 CONFIG_FSL_XGMAC_MDIO=y
@@ -58,6 +59,7 @@ CONFIG_INPUT_FF_MEMLESS=m · 28 unmodified lines
5859 CONFIG_MARVELL_PHY=y
5960 CONFIG_MDIO_BUS_MUX_GPIO=y
6061 CONFIG_MDIO_BUS_MUX_MMIOREG=y
62+CONFIG_MEMORY=y
6163 CONFIG_MMC_SDHCI_OF_ESDHC=y
6264 CONFIG_MMC_SDHCI_PLTFM=y
6365 CONFIG_MMC_SDHCI=y
arch/powerpc/configs/ppc40x_defconfig+0−74
@@ -1,74 +0,0 @@
1−CONFIG_40x=y
2−CONFIG_SYSVIPC=y
3−CONFIG_POSIX_MQUEUE=y
4−CONFIG_LOG_BUF_SHIFT=14
5−CONFIG_BLK_DEV_INITRD=y
6−CONFIG_EXPERT=y
7−CONFIG_KALLSYMS_ALL=y
8−CONFIG_MODULES=y
9−CONFIG_MODULE_UNLOAD=y
10−# CONFIG_BLK_DEV_BSG is not set
11−CONFIG_PPC4xx_GPIO=y
12−CONFIG_ACADIA=y
13−CONFIG_HOTFOOT=y
14−CONFIG_KILAUEA=y
15−CONFIG_MAKALU=y
16−CONFIG_NET=y
17−CONFIG_PACKET=y
18−CONFIG_UNIX=y
19−CONFIG_INET=y
20−CONFIG_IP_PNP=y
21−CONFIG_IP_PNP_DHCP=y
22−CONFIG_IP_PNP_BOOTP=y
23−CONFIG_CONNECTOR=y
24−CONFIG_MTD=y
25−CONFIG_MTD_CMDLINE_PARTS=y
26−CONFIG_MTD_BLOCK=m
27−CONFIG_MTD_CFI=y
28−CONFIG_MTD_JEDECPROBE=y
29−CONFIG_MTD_CFI_AMDSTD=y
30−CONFIG_MTD_PHYSMAP_OF=y
31−CONFIG_MTD_UBI=m
32−CONFIG_MTD_UBI_GLUEBI=m
33−CONFIG_BLK_DEV_RAM=y
34−CONFIG_BLK_DEV_RAM_SIZE=35000
35−CONFIG_NETDEVICES=y
36−CONFIG_IBM_EMAC=y
37−# CONFIG_INPUT is not set
38−CONFIG_SERIO=m
39−# CONFIG_SERIO_I8042 is not set
40−# CONFIG_SERIO_SERPORT is not set
41−# CONFIG_VT is not set
42−CONFIG_SERIAL_8250=y
43−CONFIG_SERIAL_8250_CONSOLE=y
44−CONFIG_SERIAL_8250_EXTENDED=y
45−CONFIG_SERIAL_8250_SHARE_IRQ=y
46−CONFIG_SERIAL_OF_PLATFORM=y
47−# CONFIG_HW_RANDOM is not set
48−CONFIG_I2C=m
49−CONFIG_I2C_CHARDEV=m
50−CONFIG_I2C_GPIO=m
51−CONFIG_I2C_IBM_IIC=m
52−# CONFIG_HWMON is not set
53−CONFIG_THERMAL=y
54−CONFIG_FB=m
55−CONFIG_EXT2_FS=y
56−CONFIG_EXT4_FS=m
57−CONFIG_VFAT_FS=m
58−CONFIG_PROC_KCORE=y
59−CONFIG_TMPFS=y
60−CONFIG_JFFS2_FS=m
61−CONFIG_UBIFS_FS=m
62−CONFIG_CRAMFS=y
63−CONFIG_NFS_FS=y
64−CONFIG_ROOT_NFS=y
65−CONFIG_NLS_CODEPAGE_437=m
66−CONFIG_NLS_ISO8859_1=m
67−CONFIG_DEBUG_FS=y
68−CONFIG_MAGIC_SYSRQ=y
69−CONFIG_DETECT_HUNG_TASK=y
70−CONFIG_CRYPTO_CBC=y
71−CONFIG_CRYPTO_ECB=y
72−CONFIG_CRYPTO_PCBC=y
73−CONFIG_CRYPTO_MD5=y
74−CONFIG_CRYPTO_DES=y
arch/powerpc/configs/ppc6xx_defconfig+0−1
@@ -12,7 +12,6 @@ CONFIG_TASK_XACCT=y · 11 unmodified lines
1212 CONFIG_TASK_IO_ACCOUNTING=y
1313 CONFIG_CGROUPS=y
1414 CONFIG_CGROUP_SCHED=y
15−CONFIG_RT_GROUP_SCHED=y
1615 CONFIG_CGROUP_DEVICE=y
1716 CONFIG_CGROUP_CPUACCT=y
1817 CONFIG_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
121121 mb(); /* sync */
122122 }
123123
124−#ifdef CONFIG_4xx
124+#ifdef CONFIG_44x
125125 static inline void flush_instruction_cache(void)
126126 {
127127 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
2424 {
2525 int i;
2626
27−#ifndef __clang__ /* clang can't cope with this */
2827 BUILD_BUG_ON(!__builtin_constant_p(feature));
29−#endif
28+ BUILD_BUG_ON(__builtin_popcountl(feature) > 1);
3029
3130 #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG
3231 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
353353 CPU_FTR_COMMON | CPU_FTR_FPU_UNAVAILABLE | CPU_FTR_NOEXECUTE)
354354 #define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON)
355355 #define CPU_FTRS_8XX (CPU_FTR_NOEXECUTE)
356−#define CPU_FTRS_40X (CPU_FTR_NOEXECUTE)
357356 #define CPU_FTRS_44X (CPU_FTR_NOEXECUTE)
358357 #define CPU_FTRS_440x6 (CPU_FTR_NOEXECUTE | \
359358 CPU_FTR_INDEXED_DCR)
@@ -507,9 +506,6 @@ enum { · 147 unmodified lines
507506 #ifdef CONFIG_PPC_8xx
508507 CPU_FTRS_8XX |
509508 #endif
510−#ifdef CONFIG_40x
511− CPU_FTRS_40X |
512−#endif
513509 #ifdef CONFIG_PPC_47x
514510 CPU_FTRS_47X | CPU_FTR_476_DD2 |
515511 #elif defined(CONFIG_44x)
@@ -582,9 +578,6 @@ enum { · 66 unmodified lines
582578 #ifdef CONFIG_PPC_8xx
583579 CPU_FTRS_8XX &
584580 #endif
585−#ifdef CONFIG_40x
586− CPU_FTRS_40X &
587−#endif
588581 #ifdef CONFIG_PPC_47x
589582 CPU_FTRS_47X &
590583 #elif defined(CONFIG_44x)
arch/powerpc/include/asm/guest-state-buffer.h+2−1
@@ -81,6 +81,7 @@ · 80 unmodified lines
8181 #define KVMPPC_GSID_HASHKEYR 0x1050
8282 #define KVMPPC_GSID_HASHPKEYR 0x1051
8383 #define KVMPPC_GSID_CTRL 0x1052
84+#define KVMPPC_GSID_DPDES 0x1053
8485
8586 #define KVMPPC_GSID_CR 0x2000
8687 #define KVMPPC_GSID_PIDR 0x2001
@@ -110,7 +111,7 @@ · 23 unmodified lines
110111 #define KVMPPC_GSE_META_COUNT (KVMPPC_GSE_META_END - KVMPPC_GSE_META_START + 1)
111112
112113 #define KVMPPC_GSE_DW_REGS_START KVMPPC_GSID_GPR(0)
113−#define KVMPPC_GSE_DW_REGS_END KVMPPC_GSID_CTRL
114+#define KVMPPC_GSE_DW_REGS_END KVMPPC_GSID_DPDES
114115 #define KVMPPC_GSE_DW_REGS_COUNT \
115116 (KVMPPC_GSE_DW_REGS_END - KVMPPC_GSE_DW_REGS_START + 1)
116117
arch/powerpc/include/asm/hw_irq.h+4−4
@@ -63,7 +63,7 @@ · 62 unmodified lines
6363
6464 static inline void __hard_irq_enable(void)
6565 {
66− if (IS_ENABLED(CONFIG_BOOKE_OR_40x))
66+ if (IS_ENABLED(CONFIG_BOOKE))
6767 wrtee(MSR_EE);
6868 else if (IS_ENABLED(CONFIG_PPC_8xx))
6969 wrtspr(SPRN_EIE);
@@ -75,7 +75,7 @@ static inline void __hard_irq_enable(void) · 5 unmodified lines
7575
7676 static inline void __hard_irq_disable(void)
7777 {
78− if (IS_ENABLED(CONFIG_BOOKE_OR_40x))
78+ if (IS_ENABLED(CONFIG_BOOKE))
7979 wrtee(0);
8080 else if (IS_ENABLED(CONFIG_PPC_8xx))
8181 wrtspr(SPRN_EID);
@@ -87,7 +87,7 @@ static inline void __hard_irq_disable(void) · 5 unmodified lines
8787
8888 static inline void __hard_EE_RI_disable(void)
8989 {
90− if (IS_ENABLED(CONFIG_BOOKE_OR_40x))
90+ if (IS_ENABLED(CONFIG_BOOKE))
9191 wrtee(0);
9292 else if (IS_ENABLED(CONFIG_PPC_8xx))
9393 wrtspr(SPRN_NRI);
@@ -99,7 +99,7 @@ static inline void __hard_EE_RI_disable(void) · 5 unmodified lines
9999
100100 static inline void __hard_RI_enable(void)
101101 {
102− if (IS_ENABLED(CONFIG_BOOKE_OR_40x))
102+ if (IS_ENABLED(CONFIG_BOOKE))
103103 return;
104104
105105 if (IS_ENABLED(CONFIG_PPC_8xx))
arch/powerpc/include/asm/iommu.h+13−3
@@ -31,6 +31,8 @@ · 30 unmodified lines
3131 #define DIRECT64_PROPNAME "linux,direct64-ddr-window-info"
3232 #define DMA64_PROPNAME "linux,dma64-ddr-window-info"
3333
34+#define MIN_DDW_VPMEM_DMA_WINDOW SZ_2G
35+
3436 /* Boot time flags */
3537 extern int iommu_is_off;
3638 extern int iommu_force_on;
@@ -156,6 +158,9 @@ extern int iommu_tce_table_put(struct iommu_table *tbl); · 119 unmodified lines
156158 extern struct iommu_table *iommu_init_table(struct iommu_table *tbl,
157159 int nid, unsigned long res_start, unsigned long res_end);
158160 bool iommu_table_in_use(struct iommu_table *tbl);
161+extern void iommu_table_reserve_pages(struct iommu_table *tbl,
162+ unsigned long res_start, unsigned long res_end);
163+extern void iommu_table_clear(struct iommu_table *tbl);
159164
160165 #define IOMMU_TABLE_GROUP_MAX_TABLES 2
161166
@@ -178,9 +183,9 @@ struct iommu_table_group_ops { · 16 unmodified lines
178183 long (*unset_window)(struct iommu_table_group *table_group,
179184 int num);
180185 /* 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);
182187 /* 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);
184189 };
185190
186191 struct iommu_table_group_link {
@@ -217,8 +222,8 @@ extern long iommu_tce_xchg_no_kill(struct mm_struct *mm, · 30 unmodified lines
217222 enum dma_data_direction *direction);
218223 extern void iommu_tce_kill(struct iommu_table *tbl,
219224 unsigned long entry, unsigned long pages);
225+int dev_has_iommu_table(struct device *dev, void *data);
220226
221−extern struct iommu_table_group_ops spapr_tce_table_group_ops;
222227 #else
223228 static inline void iommu_register_group(struct iommu_table_group *table_group,
224229 int pci_domain_number,
@@ -231,6 +236,11 @@ static inline int iommu_add_device(struct iommu_table_group *table_group, · 6 unmodified lines
231236 {
232237 return 0;
233238 }
239+
240+static inline int dev_has_iommu_table(struct device *dev, void *data)
241+{
242+ return 0;
243+}
234244 #endif /* !CONFIG_IOMMU_API */
235245
236246 u64 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
3333
3434 struct pt_regs;
3535
36−#ifdef CONFIG_BOOKE_OR_40x
36+#ifdef CONFIG_BOOKE
3737 /*
3838 * Per-cpu stacks for handling critical, debug and machine check
3939 * 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
103103 int setup_purgatory_ppc64(struct kimage *image, const void *slave_code,
104104 const void *fdt, unsigned long kernel_load_addr,
105105 unsigned long fdt_load_addr);
106−unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image);
107−int setup_new_fdt_ppc64(const struct kimage *image, void *fdt,
108− unsigned long initrd_load_addr,
109− unsigned long initrd_len, const char *cmdline);
106+unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image, struct crash_mem *rmem);
107+int setup_new_fdt_ppc64(const struct kimage *image, void *fdt, struct crash_mem *rmem);
110108 #endif /* CONFIG_PPC64 */
111109
112110 #endif /* CONFIG_KEXEC_FILE */
arch/powerpc/include/asm/kfence.h+10−1
@@ -15,10 +15,19 @@ · 14 unmodified lines
1515 #define ARCH_FUNC_PREFIX "."
1616 #endif
1717
18+#ifdef CONFIG_KFENCE
19+extern bool kfence_disabled;
20+
21+static inline void disable_kfence(void)
22+{
23+ kfence_disabled = true;
24+}
25+
1826 static inline bool arch_kfence_init_pool(void)
1927 {
20− return true;
28+ return !kfence_disabled;
2129 }
30+#endif
2231
2332 #ifdef CONFIG_PPC64
2433 static 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
2020 #include <asm/nohash/32/kup-8xx.h>
2121 #endif
2222
23−#ifdef CONFIG_BOOKE_OR_40x
23+#ifdef CONFIG_BOOKE
2424 #include <asm/nohash/kup-booke.h>
2525 #endif
2626
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
594594
595595
596596 KVMPPC_BOOK3S_VCORE_ACCESSOR(vtb, 64, KVMPPC_GSID_VTB)
597+KVMPPC_BOOK3S_VCORE_ACCESSOR(dpdes, 64, KVMPPC_GSID_DPDES)
597598 KVMPPC_BOOK3S_VCORE_ACCESSOR_GET(arch_compat, 32, KVMPPC_GSID_LOGICAL_PVR)
598599 KVMPPC_BOOK3S_VCORE_ACCESSOR_GET(lpcr, 64, KVMPPC_GSID_LPCR)
599600 KVMPPC_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
684684 int kvmhv_nestedv2_parse_output(struct kvm_vcpu *vcpu);
685685 int kvmhv_nestedv2_set_vpa(struct kvm_vcpu *vcpu, unsigned long vpa);
686686
687+int kmvhv_counters_tracepoint_regfunc(void);
688+void kmvhv_counters_tracepoint_unregfunc(void);
689+int kvmhv_get_l2_counters_status(void);
690+void kvmhv_set_l2_counters_status(int cpu, bool status);
691+
687692 #endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */
688693
689694 #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
599599 ulong dawrx0;
600600 ulong dawr1;
601601 ulong dawrx1;
602+ ulong dexcr;
603+ ulong hashkeyr;
604+ ulong hashpkeyr;
602605 ulong ciabr;
603606 ulong cfar;
604607 ulong ppr;
arch/powerpc/include/asm/lppaca.h+8−3
@@ -62,7 +62,8 @@ struct lppaca { · 61 unmodified lines
6262 u8 donate_dedicated_cpu; /* Donate dedicated CPU cycles */
6363 u8 fpregs_in_use;
6464 u8 pmcregs_in_use;
65− u8 reserved8[28];
65+ u8 l2_counters_enable; /* Enable usage of counters for KVM guest */
66+ u8 reserved8[27];
6667 __be64 wait_state_cycles; /* Wait cycles for this proc */
6768 u8 reserved9[28];
6869 __be16 slb_count; /* # of SLBs to maintain */
@@ -92,9 +93,13 @@ struct lppaca { · 23 unmodified lines
9293 /* cacheline 4-5 */
9394
9495 __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];
96101 volatile __be64 dtl_idx; /* Dispatch Trace Log head index */
97− u8 reserved13[96];
102+ u8 reserved14[96];
98103 } ____cacheline_aligned;
99104
100105 #define lppaca_of(cpu) (*paca_ptrs[cpu]->lppaca_ptr)
arch/powerpc/include/asm/mmu.h+1−9
@@ -16,7 +16,6 @@ · 15 unmodified lines
1616 */
1717 #define MMU_FTR_HPTE_TABLE ASM_CONST(0x00000001)
1818 #define MMU_FTR_TYPE_8xx ASM_CONST(0x00000002)
19−#define MMU_FTR_TYPE_40x ASM_CONST(0x00000004)
2019 #define MMU_FTR_TYPE_44x ASM_CONST(0x00000008)
2120 #define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010)
2221 #define MMU_FTR_TYPE_47x ASM_CONST(0x00000020)
@@ -153,9 +152,6 @@ enum { · 130 unmodified lines
153152 #ifdef CONFIG_PPC_8xx
154153 MMU_FTR_TYPE_8xx |
155154 #endif
156−#ifdef CONFIG_40x
157− MMU_FTR_TYPE_40x |
158−#endif
159155 #ifdef CONFIG_PPC_47x
160156 MMU_FTR_TYPE_47x | MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL |
161157 #elif defined(CONFIG_44x)
@@ -202,9 +198,6 @@ enum { · 40 unmodified lines
202198 #ifdef CONFIG_PPC_8xx
203199 #define MMU_FTRS_ALWAYS MMU_FTR_TYPE_8xx
204200 #endif
205−#ifdef CONFIG_40x
206−#define MMU_FTRS_ALWAYS MMU_FTR_TYPE_40x
207−#endif
208201 #ifdef CONFIG_PPC_47x
209202 #define MMU_FTRS_ALWAYS MMU_FTR_TYPE_47x
210203 #elif defined(CONFIG_44x)
@@ -246,9 +239,8 @@ static __always_inline bool mmu_has_feature(unsigned long feature) · 35 unmodified lines
246239 {
247240 int i;
248241
249−#ifndef __clang__ /* clang can't cope with this */
250242 BUILD_BUG_ON(!__builtin_constant_p(feature));
251−#endif
243+ BUILD_BUG_ON(__builtin_popcountl(feature) > 1);
252244
253245 #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG
254246 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−
57−typedef 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
118118 * (hardware-defined) PowerPC PTE as closely as possible.
119119 */
120120
121−#if defined(CONFIG_40x)
122−#include <asm/nohash/32/pte-40x.h>
123−#elif defined(CONFIG_44x)
121+#if defined(CONFIG_44x)
124122 #include <asm/nohash/32/pte-44x.h>
125123 #elif defined(CONFIG_PPC_85xx) && defined(CONFIG_PTE_64BIT)
126124 #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
22 #ifndef _ASM_POWERPC_NOHASH_MMU_H_
33 #define _ASM_POWERPC_NOHASH_MMU_H_
44
5−#if defined(CONFIG_40x)
6−/* 40x-style software loaded TLB */
7−#include <asm/nohash/32/mmu-40x.h>
8−#elif defined(CONFIG_44x)
5+#if defined(CONFIG_44x)
96 /* 44x-style software loaded TLB */
107 #include <asm/nohash/32/mmu-44x.h>
118 #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
8989 #define PPMU_NO_SIAR 0x00000100 /* Do not use SIAR */
9090 #define PPMU_ARCH_31 0x00000200 /* Has MMCR3, SIER2 and SIER3 */
9191 #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 */
9394
9495 /*
9596 * 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
1818 return plpar_hcall_norets(H_POLL_PENDING);
1919 }
2020
21−static inline u8 get_cede_latency_hint(void)
22−{
23− return get_lppaca()->cede_latency_hint;
24−}
25−
26−static inline void set_cede_latency_hint(u8 latency_hint)
27−{
28− get_lppaca()->cede_latency_hint = latency_hint;
29−}
30−
3121 static inline long cede_processor(void)
3222 {
3323 /*
@@ -37,24 +27,6 @@ static inline long cede_processor(void) · 3 unmodified lines
3727 return plpar_hcall_norets_notrace(H_CEDE);
3828 }
3929
40−static 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−
5830 static inline long vpa_call(unsigned long flags, unsigned long cpu,
5931 unsigned long vpa)
6032 {
arch/powerpc/include/asm/ppc-opcode.h+2−0
@@ -471,6 +471,7 @@ · 470 unmodified lines
471471 #define PPC_RAW_VCMPEQUB_RC(vrt, vra, vrb) \
472472 (0x10000006 | ___PPC_RT(vrt) | ___PPC_RA(vra) | ___PPC_RB(vrb) | __PPC_RC21)
473473 #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))
474475 #define PPC_RAW_LWZ(r, base, i) (0x80000000 | ___PPC_RT(r) | ___PPC_RA(base) | IMM_L(i))
475476 #define PPC_RAW_LWZX(t, a, b) (0x7c00002e | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b))
476477 #define PPC_RAW_STD(r, base, i) (0xf8000000 | ___PPC_RS(r) | ___PPC_RA(base) | IMM_DS(i))
@@ -535,6 +536,7 @@ · 58 unmodified lines
535536 #define PPC_RAW_MULI(d, a, i) (0x1c000000 | ___PPC_RT(d) | ___PPC_RA(a) | IMM_L(i))
536537 #define PPC_RAW_DIVW(d, a, b) (0x7c0003d6 | ___PPC_RT(d) | ___PPC_RA(a) | ___PPC_RB(b))
537538 #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))
538540 #define PPC_RAW_DIVDU(d, a, b) (0x7c000392 | ___PPC_RT(d) | ___PPC_RA(a) | ___PPC_RB(b))
539541 #define PPC_RAW_DIVDE(t, a, b) (0x7c000352 | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b))
540542 #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
482482 * and they must be used.
483483 */
484484
485−#if !defined(CONFIG_4xx) && !defined(CONFIG_PPC_8xx)
485+#if !defined(CONFIG_44x) && !defined(CONFIG_PPC_8xx)
486486 #define tlbia \
487487 li r4,1024; \
488488 mtctr r4; \
arch/powerpc/include/asm/processor.h+1−1
@@ -159,7 +159,7 @@ struct thread_struct { · 158 unmodified lines
159159 unsigned long sr0;
160160 #endif
161161 #endif /* CONFIG_PPC32 */
162−#if defined(CONFIG_BOOKE_OR_40x) && defined(CONFIG_PPC_KUAP)
162+#if defined(CONFIG_BOOKE) && defined(CONFIG_PPC_KUAP)
163163 unsigned long pid; /* value written in PID reg. at interrupt exit */
164164 #endif
165165 /* 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
310310
311311 static inline bool cpu_has_msr_ri(void)
312312 {
313− return !IS_ENABLED(CONFIG_BOOKE_OR_40x);
313+ return !IS_ENABLED(CONFIG_BOOKE);
314314 }
315315
316316 static inline bool regs_is_unrecoverable(struct pt_regs *regs)
arch/powerpc/include/asm/reg.h+2−25
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 #include <asm/feature-fixups.h>
1919
2020 /* Pickup Book E specific registers. */
21−#ifdef CONFIG_BOOKE_OR_40x
21+#ifdef CONFIG_BOOKE
2222 #include <asm/reg_booke.h>
2323 #endif
2424
@@ -233,14 +233,10 @@ · 208 unmodified lines
233233
234234 /* Special Purpose Registers (SPRNs)*/
235235
236−#ifdef CONFIG_40x
237−#define SPRN_PID 0x3B1 /* Process ID */
238−#else
239236 #define SPRN_PID 0x030 /* Process ID */
240237 #ifdef CONFIG_BOOKE
241238 #define SPRN_PID0 SPRN_PID/* Process ID Register 0 */
242239 #endif
243−#endif
244240
245241 #define SPRN_CTR 0x009 /* Count Register */
246242 #define SPRN_DSCR 0x11
@@ -527,7 +523,7 @@ · 280 unmodified lines
527523 #define SPRN_TSCR 0x399 /* Thread Switch Control Register */
528524
529525 #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) */
531527
532528 #define SPRN_DER 0x095 /* Debug Enable Register */
533529 #define DER_RSTE 0x40000000 /* Reset Interrupt */
@@ -1116,15 +1112,6 @@ · 582 unmodified lines
11161112 * - SPRG2 indicator that we are in RTAS
11171113 * - SPRG4 (603 only) pseudo TLB LRU data
11181114 *
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− *
11281115 * 32-bit 440 and FSL BookE:
11291116 * - SPRG0 scratch for exception vectors
11301117 * - SPRG1 scratch for exception vectors (*)
@@ -1216,16 +1203,6 @@ · 85 unmodified lines
12161203 #define SPRN_SPRG_603_LRU SPRN_SPRG4
12171204 #endif
12181205
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−
12291206 #ifdef CONFIG_BOOKE
12301207 #define SPRN_SPRG_RSCRATCH0 SPRN_SPRG0
12311208 #define SPRN_SPRG_WSCRATCH0 SPRN_SPRG0
arch/powerpc/include/asm/reg_booke.h+2−111
@@ -1,10 +1,7 @@
11 /* SPDX-License-Identifier: GPL-2.0-only */
22 /*
33 * Contains register definitions common to the Book E PowerPC
4− * specification. Notice that while the IBM-40x series of CPUs
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.
4+ * specification.
85 *
96 * Copyright 2009-2010 Freescale Semiconductor, Inc.
107 */
@@ -42,9 +39,6 @@ · 31 unmodified lines
4239 #define MSR_KERNEL (MSR_ | MSR_64BIT)
4340 #define MSR_USER32 (MSR_ | MSR_PR | MSR_EE)
4441 #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)
4842 #else
4943 #define MSR_KERNEL (MSR_ME|MSR_RI|MSR_CE)
5044 #define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE)
@@ -157,7 +151,6 @@ · 106 unmodified lines
157151 #define SPRN_TLB3CFG 0x2B3 /* TLB 3 Config Register */
158152 #define SPRN_EPR 0x2BE /* External Proxy Register */
159153 #define SPRN_CCR1 0x378 /* Core Configuration Register 1 */
160−#define SPRN_ZPR 0x3B0 /* Zone Protection Register (40x) */
161154 #define SPRN_MAS7 0x3B0 /* MMU Assist Register 7 */
162155 #define SPRN_MMUCR 0x3B2 /* MMU Control Register */
163156 #define SPRN_CCR0 0x3B3 /* Core Configuration Register 0 */
@@ -166,7 +159,6 @@ · 2 unmodified lines
166159 #define SPRN_SGR 0x3B9 /* Storage Guarded Register */
167160 #define SPRN_DCWR 0x3BA /* Data Cache Write-thru Register */
168161 #define SPRN_SLER 0x3BB /* Little-endian real mode */
169−#define SPRN_SU0R 0x3BC /* "User 0" real mode (40x) */
170162 #define SPRN_DCMP 0x3D1 /* Data TLB Compare Register */
171163 #define SPRN_ICDBDR 0x3D3 /* Instruction Cache Debug Data Register */
172164 #define SPRN_EVPR 0x3D6 /* Exception Vector Prefix Register */
@@ -183,10 +175,8 @@ · 10 unmodified lines
183175 #define SPRN_SVR 0x3FF /* System Version Register */
184176
185177 /*
186− * SPRs which have conflicting definitions on true Book E versus classic,
187− * or IBM 40x.
178+ * SPRs which have conflicting definitions on true Book E versus classic.
188179 */
189−#ifdef CONFIG_BOOKE
190180 #define SPRN_CSRR0 0x03A /* Critical Save and Restore Register 0 */
191181 #define SPRN_CSRR1 0x03B /* Critical Save and Restore Register 1 */
192182 #define SPRN_DEAR 0x03D /* Data Error Address Register */
@@ -201,22 +191,6 @@ · 8 unmodified lines
201191 #define SPRN_DAC2 0x13D /* Data Address Compare 2 */
202192 #define SPRN_TSR 0x150 /* Timer Status Register */
203193 #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
220194 #define SPRN_HACOP 0x15F /* Hypervisor Available Coprocessor Register */
221195
222196 /* Bit definitions for CCR1. */
@@ -296,10 +270,6 @@ · 73 unmodified lines
296270 #endif
297271
298272 /* 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
303273 #define DBSR_IDE 0x80000000 /* Imprecise Debug Event */
304274 #define DBSR_MRR 0x30000000 /* Most Recent Reset */
305275 #define DBSR_IC 0x08000000 /* Instruction Completion */
@@ -319,21 +289,6 @@ · 13 unmodified lines
319289 #define DBSR_CRET 0x00000020 /* Critical Return Debug Event */
320290 #define DBSR_IAC12ATS 0x00000002 /* Instr Address Compare 1/2 Toggle */
321291 #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
337292
338293 /* Bit definitions related to the ESR. */
339294 #define ESR_MCI 0x80000000 /* Machine Check - Instruction */
@@ -355,69 +310,6 @@ · 15 unmodified lines
355310 #define ESR_SPV 0x00000080 /* Signal Processing operation */
356311
357312 /* 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)
421313 #define DBCR0_EDM 0x80000000 /* External Debug Mode */
422314 #define DBCR0_IDM 0x40000000 /* Internal Debug Mode */
423315 #define DBCR0_RST 0x30000000 /* all the bits in the RST field */
@@ -518,7 +410,6 @@ · 94 unmodified lines
518410
519411 #define DBCR_ACTIVE_EVENTS(dbcr0, dbcr1) (((dbcr0) & DBCR0_ACTIVE_EVENTS) || \
520412 ((dbcr1) & DBCR1_ACTIVE_EVENTS))
521−#endif /* #elif defined(CONFIG_BOOKE) */
522413
523414 /* Bit definitions related to the TCR. */
524415 #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
5858 */
5959 static inline u64 get_dec(void)
6060 {
61− if (IS_ENABLED(CONFIG_40x))
62− return mfspr(SPRN_PIT);
63−
6461 return mfspr(SPRN_DEC);
6562 }
6663
@@ -71,9 +68,7 @@ static inline u64 get_dec(void) · 4 unmodified lines
7168 */
7269 static inline void set_dec(u64 val)
7370 {
74− if (IS_ENABLED(CONFIG_40x))
75− mtspr(SPRN_PIT, (u32)val);
76− else if (IS_ENABLED(CONFIG_BOOKE))
71+ if (IS_ENABLED(CONFIG_BOOKE))
7772 mtspr(SPRN_DEC, val);
7873 else
7974 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
4444 void __init udbg_init_rtas_console(void);
4545 void __init udbg_init_btext(void);
4646 void __init udbg_init_44x_as1(void);
47−void __init udbg_init_40x_realmode(void);
4847 void __init udbg_init_cpm(void);
4948 void __init udbg_init_usbgecko(void);
5049 void __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
645645 #define KVM_REG_PPC_SIER3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc3)
646646 #define KVM_REG_PPC_DAWR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc4)
647647 #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)
648651
649652 /* Transactional Memory checkpointed state:
650653 * 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
123123
124124 obj-$(CONFIG_PPC64) += head_64.o
125125 obj-$(CONFIG_PPC_BOOK3S_32) += head_book3s_32.o
126−obj-$(CONFIG_40x) += head_40x.o
127126 obj-$(CONFIG_44x) += head_44x.o
128127 obj-$(CONFIG_PPC_8xx) += head_8xx.o
129128 obj-$(CONFIG_PPC_85xx) += head_85xx.o
arch/powerpc/kernel/asm-offsets.c+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
5454 #endif
5555
5656 #ifdef CONFIG_PPC32
57−#ifdef CONFIG_BOOKE_OR_40x
57+#ifdef CONFIG_BOOKE
5858 #include "head_booke.h"
5959 #endif
6060 #endif
arch/powerpc/kernel/cpu_specs.h+0−4
@@ -1,9 +1,5 @@
11 /* SPDX-License-Identifier: GPL-2.0-or-later */
22
3−#ifdef CONFIG_40x
4−#include "cpu_specs_40x.h"
5−#endif
6−
73 #ifdef CONFIG_PPC_47x
84 #include "cpu_specs_47x.h"
95 #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−
6−static 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
12731273
12741274 #ifdef CONFIG_IOMMU_API
12751275
1276−static 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−
12921276 /**
12931277 * eeh_iommu_group_to_pe - Convert IOMMU group to EEH PE
12941278 * @group: IOMMU group
arch/powerpc/kernel/entry_32.S+3−45
@@ -108,7 +108,7 @@ transfer_to_syscall: · 107 unmodified lines
108108 stw r11, 0(r1)
109109 mflr r12
110110 stw r12, _LINK(r1)
111−#ifdef CONFIG_BOOKE_OR_40x
111+#ifdef CONFIG_BOOKE
112112 rlwinm r9,r9,0,14,12 /* clear MSR_WE (necessary?) */
113113 #endif
114114 lis r12,STACK_FRAME_REGS_MARKER@ha /* exception frame marker */
@@ -158,9 +158,6 @@ syscall_exit_finish: · 43 unmodified lines
158158 1: REST_GPR(2, r1)
159159 REST_GPR(1, r1)
160160 rfi
161−#ifdef CONFIG_40x
162− b . /* Prevent prefetch past rfi */
163−#endif
164161
165162 3: mtcr r5
166163 lwz r4,_CTR(r1)
@@ -214,7 +211,7 @@ start_kernel_thread: · 47 unmodified lines
214211
215212 .globl fast_exception_return
216213 fast_exception_return:
217−#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
214+#ifndef CONFIG_BOOKE
218215 andi. r10,r9,MSR_RI /* check for recoverable interrupt */
219216 beq 3f /* if not, we've got problems */
220217 #endif
@@ -237,9 +234,6 @@ fast_exception_return: · 16 unmodified lines
237234 REST_GPR(12, r11)
238235 REST_GPR(11, r11)
239236 rfi
240−#ifdef CONFIG_40x
241− b . /* Prevent prefetch past rfi */
242−#endif
243237 _ASM_NOKPROBE_SYMBOL(fast_exception_return)
244238
245239 /* aargh, a nonrecoverable interrupt, panic */
@@ -296,9 +290,6 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS) · 50 unmodified lines
296290 REST_GPR(0, r1)
297291 REST_GPR(1, r1)
298292 rfi
299−#ifdef CONFIG_40x
300− b . /* Prevent prefetch past rfi */
301−#endif
302293
303294 .Lrestore_nvgprs:
304295 REST_NVGPRS(r1)
@@ -346,9 +337,6 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS) · 41 unmodified lines
346337 REST_GPR(0, r1)
347338 REST_GPR(1, r1)
348339 rfi
349−#ifdef CONFIG_40x
350− b . /* Prevent prefetch past rfi */
351−#endif
352340
353341 1: /*
354342 * 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
375363 mfspr r9, SPRN_SPRG_SCRATCH0
376364 #endif
377365 rfi
378−#ifdef CONFIG_40x
379− b . /* Prevent prefetch past rfi */
380−#endif
381366 _ASM_NOKPROBE_SYMBOL(interrupt_return)
382367
383−#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
368+#ifdef CONFIG_BOOKE
384369
385370 /*
386371 * Returning from a critical interrupt in user mode doesn't need
@@ -395,17 +380,6 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return) · 8 unmodified lines
395380 * time of the critical interrupt.
396381 *
397382 */
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
409383
410384 #define RET_FROM_EXC_LEVEL(exc_lvl_srr0, exc_lvl_srr1, exc_lvl_rfi) \
411385 REST_NVGPRS(r1); \
@@ -423,7 +397,6 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return) · 11 unmodified lines
423397 mtlr r11; \
424398 lwz r10,_CCR(r1); \
425399 mtcrf 0xff,r10; \
426− PPC_40x_TURN_OFF_MSR_DR; \
427400 lwz r9,_DEAR(r1); \
428401 lwz r10,_ESR(r1); \
429402 mtspr SPRN_DEAR,r9; \
@@ -471,20 +444,6 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return) · 41 unmodified lines
471444 #define RESTORE_MMU_REGS
472445 #endif
473446
474−#ifdef CONFIG_40x
475− .globl ret_from_crit_exc
476−ret_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
488447 .globl ret_from_crit_exc
489448 ret_from_crit_exc:
490449 RESTORE_xSRR(SRR0,SRR1);
@@ -509,4 +468,3 @@ ret_from_mcheck_exc: · 18 unmodified lines
509468 RET_FROM_EXC_LEVEL(SPRN_MCSRR0, SPRN_MCSRR1, PPC_RFMCI)
510469 _ASM_NOKPROBE_SYMBOL(ret_from_mcheck_exc)
511470 #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
2121 ori r4, r4,_TLF_NAPPING /* so when we take an exception */
2222 PPC_STL r4, TI_LOCAL_FLAGS(r2) /* it will return to our caller */
2323
24−#ifdef CONFIG_BOOKE_OR_40x
24+#ifdef CONFIG_BOOKE
2525 wrteei 1
2626 #else
2727 mfmsr r4
arch/powerpc/kernel/head_32.h+1−11
@@ -21,17 +21,9 @@ · 20 unmodified lines
2121 mtspr SPRN_SPRG_SCRATCH1,r11
2222 mfspr r10, SPRN_SPRG_THREAD
2323 .if \handle_dar_dsisr
24−#ifdef CONFIG_40x
25− mfspr r11, SPRN_DEAR
26−#else
2724 mfspr r11, SPRN_DAR
28−#endif
2925 stw r11, DAR(r10)
30−#ifdef CONFIG_40x
31− mfspr r11, SPRN_ESR
32−#else
3326 mfspr r11, SPRN_DSISR
34−#endif
3527 stw r11, DSISR(r10)
3628 .endif
3729 mfspr r11, SPRN_SRR0
@@ -96,9 +88,7 @@ · 58 unmodified lines
9688 .endif
9789 lwz r9, SRR1(r12)
9890 lwz r12, SRR0(r12)
99−#ifdef CONFIG_40x
100− rlwinm r9,r9,0,14,12 /* clear MSR_WE (necessary?) */
101−#elif defined(CONFIG_PPC_8xx)
91+#ifdef CONFIG_PPC_8xx
10292 mtspr SPRN_EID, r2 /* Set MSR_RI */
10393 #else
10494 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− */
70−turn_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
85−crit_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 */
129−1: 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
139−1:
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− */
299−3:
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
306−4:
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−
331−2: /* 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−
343−5:
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− */
383−3:
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
390−4:
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−
415−2: /* 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−
427−5:
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. */
490−1: 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... */
508−2: 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
516−Decrementer:
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
526−FITException:
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
534−WDTException:
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− */
558−tlb_4xx_index:
559− .long 0
560−finish_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− */
592−start_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 */
638−2:
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− */
667−SYM_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
716−SYM_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
145145 b transfer_to_syscall /* jump to handler */
146146 .endm
147147
148−/* To handle the additional exception priority levels on 40x and Book-E
148+/* To handle the additional exception priority levels on Book-E
149149 * processors we allocate a stack per additional priority level.
150150 *
151− * On 40x critical is the only additional level
152151 * On 44x/e500 we have critical and machine check
153152 *
154153 * 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
643643 tbl->it_ops->flush(tbl);
644644 }
645645
646−static void iommu_table_clear(struct iommu_table *tbl)
646+void iommu_table_clear(struct iommu_table *tbl)
647647 {
648648 /*
649649 * 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
684684 #endif
685685 }
686686
687−static void iommu_table_reserve_pages(struct iommu_table *tbl,
687+void iommu_table_reserve_pages(struct iommu_table *tbl,
688688 unsigned long res_start, unsigned long res_end)
689689 {
690690 int i;
@@ -988,6 +988,23 @@ unsigned long iommu_direction_to_tce_perm(enum dma_data_direction dir) · 297 unmodified lines
988988 EXPORT_SYMBOL_GPL(iommu_direction_to_tce_perm);
989989
990990 #ifdef CONFIG_IOMMU_API
991+
992+int 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+
9911008 /*
9921009 * SPAPR TCE API
9931010 */
@@ -1102,59 +1119,6 @@ void iommu_tce_kill(struct iommu_table *tbl, · 108 unmodified lines
11021119 }
11031120 EXPORT_SYMBOL_GPL(iommu_tce_kill);
11041121
1105−#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV)
1106−static 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−
1139−static 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−
11581122 int iommu_add_device(struct iommu_table_group *table_group, struct device *dev)
11591123 {
11601124 /*
@@ -1186,98 +1150,6 @@ int iommu_add_device(struct iommu_table_group *table_group, struct device *dev) · 25 unmodified lines
11861150 EXPORT_SYMBOL_GPL(iommu_add_device);
11871151
11881152 #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− */
1195−static 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−
1206−static 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−
1224−static 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−
1230−static long spapr_tce_unset_window(struct iommu_table_group *table_group, int num)
1231−{
1232− return 0;
1233−}
1234−
1235−static 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−
1256−static 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−
1272−struct 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−
12811153 /*
12821154 * A simple iommu_ops to allow less cruft in generic VFIO code.
12831155 */
@@ -1299,7 +1171,7 @@ spapr_tce_platform_iommu_attach_dev(struct iommu_domain *platform_domain, · 15 unmodified lines
12991171 * The domain being set to PLATFORM from earlier
13001172 * BLOCKED. The table_group ownership has to be released.
13011173 */
1302− table_group->ops->release_ownership(table_group);
1174+ table_group->ops->release_ownership(table_group, dev);
13031175 iommu_group_put(grp);
13041176
13051177 return 0;
@@ -1327,7 +1199,7 @@ spapr_tce_blocked_iommu_attach_dev(struct iommu_domain *platform_domain, · 21 unmodified lines
13271199 * also sets the dma_api ops
13281200 */
13291201 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);
13311203 iommu_group_put(grp);
13321204
13331205 return ret;
arch/powerpc/kernel/irq.c+1−1
@@ -333,7 +333,7 @@ void __init init_IRQ(void) · 332 unmodified lines
333333 static_call_update(ppc_get_irq, ppc_md.get_irq);
334334 }
335335
336−#ifdef CONFIG_BOOKE_OR_40x
336+#ifdef CONFIG_BOOKE
337337 void *critirq_ctx[NR_CPUS] __read_mostly;
338338 void *dbgirq_ctx[NR_CPUS] __read_mostly;
339339 void *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
4545 { 0x0800, 0x08 /* SIGFPE */ }, /* fp unavailable */
4646 { 0x0900, 0x0e /* SIGALRM */ }, /* decrementer */
4747 { 0x0c00, 0x14 /* SIGCHLD */ }, /* system call */
48−#ifdef CONFIG_BOOKE_OR_40x
48+#ifdef CONFIG_BOOKE
4949 { 0x2002, 0x05 /* SIGTRAP */ }, /* debug */
5050 #if defined(CONFIG_PPC_85xx)
5151 { 0x2010, 0x08 /* SIGFPE */ }, /* spe unavailable */
@@ -64,7 +64,7 @@ static struct hard_trap_info · 12 unmodified lines
6464 { 0x2010, 0x08 /* SIGFPE */ }, /* fp unavailable */
6565 { 0x2020, 0x08 /* SIGFPE */ }, /* ap unavailable */
6666 #endif
67−#else /* !CONFIG_BOOKE_OR_40x */
67+#else /* !CONFIG_BOOKE */
6868 { 0x0d00, 0x05 /* SIGTRAP */ }, /* single-step */
6969 #if defined(CONFIG_PPC_8xx)
7070 { 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
176176
177177 #endif /* CONFIG_CPU_FREQ_PMAC && CONFIG_PPC_BOOK3S_32 */
178178
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−
219179 /*
220180 * Copy a whole page. We use the dcbz instruction on the destination
221181 * 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
9393 }
9494 EXPORT_SYMBOL_GPL(pci_hp_remove_devices);
9595
96+static 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+
96126 /**
97127 * pci_hp_add_devices - adds new pci devices to bus
98128 * @bus: the indicated PCI bus
@@ -106,7 +136,7 @@ EXPORT_SYMBOL_GPL(pci_hp_remove_devices); · 7 unmodified lines
106136 */
107137 void pci_hp_add_devices(struct pci_bus *bus)
108138 {
109− int slotno, mode, max;
139+ int mode, max;
110140 struct pci_dev *dev;
111141 struct pci_controller *phb;
112142 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
129159 * order for fully rescan all the way down to pick them up.
130160 * They can have been removed during partial hotplug.
131161 */
132− slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);
133− pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
162+ traverse_siblings_and_scan_slot(dn, bus);
134163 max = bus->busn_res.start;
135164 /*
136165 * 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
15731573 if (trap == INTERRUPT_MACHINE_CHECK ||
15741574 trap == INTERRUPT_DATA_STORAGE ||
15751575 trap == INTERRUPT_ALIGNMENT) {
1576− if (IS_ENABLED(CONFIG_4xx) || IS_ENABLED(CONFIG_BOOKE))
1576+ if (IS_ENABLED(CONFIG_BOOKE))
15771577 pr_cont("DEAR: "REG" ESR: "REG" ", regs->dear, regs->esr);
15781578 else
15791579 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
18751875 #if defined(CONFIG_PPC_BOOK3S_32) && defined(CONFIG_PPC_KUAP)
18761876 p->thread.kuap = KUAP_NONE;
18771877 #endif
1878−#if defined(CONFIG_BOOKE_OR_40x) && defined(CONFIG_PPC_KUAP)
1878+#if defined(CONFIG_BOOKE) && defined(CONFIG_PPC_KUAP)
18791879 p->thread.pid = MMU_NO_CONTEXT;
18801880 #endif
18811881
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
331331 void *data)
332332 {
333333 const char *type = of_get_flat_dt_prop(node, "device_type", NULL);
334+ const __be32 *cpu_version = NULL;
334335 const __be32 *prop;
335336 const __be32 *intserv;
336337 int i, nthreads;
@@ -420,7 +421,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node, · 83 unmodified lines
420421 prop = of_get_flat_dt_prop(node, "cpu-version", NULL);
421422 if (prop && (be32_to_cpup(prop) & 0xff000000) == 0x0f000000) {
422423 identify_cpu(0, be32_to_cpup(prop));
423− seq_buf_printf(&ppc_hw_desc, "0x%04x ", be32_to_cpup(prop));
424+ cpu_version = prop;
424425 }
425426
426427 check_cpu_feature_properties(node);
@@ -431,6 +432,12 @@ static int __init early_init_dt_scan_cpus(unsigned long node, · 4 unmodified lines
431432 }
432433
433434 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+
434441 init_mmu_slb_size(node);
435442
436443 #ifdef CONFIG_PPC64
@@ -881,9 +888,6 @@ void __init early_init_devtree(void *params) · 444 unmodified lines
881888
882889 dt_cpu_ftrs_scan();
883890
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−
887891 /* Retrieve CPU related informations from the flat tree
888892 * (altivec support, boot CPU ID, ...)
889893 */
arch/powerpc/kernel/rtas.c+4−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/lockdep.h>
2020 #include <linux/memblock.h>
2121 #include <linux/mutex.h>
22+#include <linux/nospec.h>
2223 #include <linux/of.h>
2324 #include <linux/of_fdt.h>
2425 #include <linux/reboot.h>
@@ -1916,6 +1917,9 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) · 1891 unmodified lines
19161917 || nargs + nret > ARRAY_SIZE(args.args))
19171918 return -EINVAL;
19181919
1920+ nargs = array_index_nospec(nargs, ARRAY_SIZE(args.args));
1921+ nret = array_index_nospec(nret, ARRAY_SIZE(args.args) - nargs);
1922+
19191923 /* Copy in args. */
19201924 if (copy_from_user(args.args, uargs->args,
19211925 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
773773
774774 module_init(rtas_flash_init);
775775 module_exit(rtas_flash_cleanup);
776+MODULE_DESCRIPTION("PPC procfs firmware flash interface");
776777 MODULE_LICENSE("GPL");
arch/powerpc/kernel/setup.h+1−1
@@ -29,7 +29,7 @@ void setup_tlb_core_data(void); · 28 unmodified lines
2929 static inline void setup_tlb_core_data(void) { }
3030 #endif
3131
32−#ifdef CONFIG_BOOKE_OR_40x
32+#ifdef CONFIG_BOOKE
3333 void exc_lvl_early_init(void);
3434 #else
3535 static 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
176176 }
177177 #endif
178178
179−#ifdef CONFIG_BOOKE_OR_40x
179+#ifdef CONFIG_BOOKE
180180 void __init exc_lvl_early_init(void)
181181 {
182182 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
695695
696696 static void start_cpu_decrementer(void)
697697 {
698−#ifdef CONFIG_BOOKE_OR_40x
698+#ifdef CONFIG_BOOKE
699699 unsigned int tcr;
700700
701701 /* 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
22442244 ;
22452245 }
22462246
2247−#if defined(CONFIG_BOOKE_WDT) || defined(CONFIG_40x)
2247+#ifdef CONFIG_BOOKE_WDT
22482248 DEFINE_INTERRUPT_HANDLER_NMI(WatchdogException)
22492249 {
22502250 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
4949 #elif defined(CONFIG_PPC_EARLY_DEBUG_44x)
5050 /* PPC44x debug */
5151 udbg_init_44x_as1();
52−#elif defined(CONFIG_PPC_EARLY_DEBUG_40x)
53− /* PPC40x debug */
54− udbg_init_40x_realmode();
5552 #elif defined(CONFIG_PPC_EARLY_DEBUG_CPM)
5653 udbg_init_cpm();
5754 #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
274274
275275 #endif /* CONFIG_PPC_EARLY_DEBUG_44x */
276276
277−#ifdef CONFIG_PPC_EARLY_DEBUG_40x
278−
279−static 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−
285−static 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−
291−void __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−
300277 #ifdef CONFIG_PPC_EARLY_DEBUG_16550
301278
302279 static 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
467467 * @fdt: Flattened device tree of the kernel.
468468 *
469469 * 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.
470473 */
471474 int update_cpus_node(void *fdt)
472475 {
476+ int prev_node_offset;
477+ const char *device_type;
478+ const struct fdt_property *prop;
473479 struct device_node *cpus_node, *dn;
474480 int cpus_offset, cpus_subnode_offset, ret = 0;
475481
@@ -480,30 +486,44 @@ int update_cpus_node(void *fdt) · 4 unmodified lines
480486 return cpus_offset;
481487 }
482488
483− if (cpus_offset > 0) {
484− ret = fdt_del_node(fdt, cpus_offset);
489+ prev_node_offset = 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);
485500 if (ret < 0) {
486− pr_err("Error deleting /cpus node: %s\n", fdt_strerror(ret));
487− return -EINVAL;
501+ pr_err("Failed to delete a cpus sub-node: %s\n", fdt_strerror(ret));
502+ return ret;
488503 }
504+next_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);
489509 }
490510
491− /* Add cpus node to fdt */
492− cpus_offset = fdt_add_subnode(fdt, fdt_path_offset(fdt, "/"), "cpus");
493− if (cpus_offset < 0) {
494− pr_err("Error creating /cpus node: %s\n", fdt_strerror(cpus_offset));
511+ cpus_node = of_find_node_by_path("/cpus");
512+ /* Fail here to avoid kexec/kdump kernel boot hung */
513+ if (!cpus_node) {
514+ pr_err("No /cpus node found\n");
495515 return -EINVAL;
496516 }
497517
498− /* Add cpus node properties */
499− cpus_node = of_find_node_by_path("/cpus");
500− ret = add_node_props(fdt, cpus_offset, cpus_node);
501− of_node_put(cpus_node);
502− if (ret < 0)
503− return ret;
518+ /* Add all /cpus sub-nodes of device_type == "cpu" to FDT */
519+ for_each_child_of_node(cpus_node, dn) {
520+ /* Ignore device nodes that do not have a device_type property
521+ * or device_type != "cpu".
522+ */
523+ device_type = of_get_property(dn, "device_type", NULL);
524+ if (!device_type || strcmp(device_type, "cpu"))
525+ continue;
504526
505− /* Loop through all subnodes of cpus and add them to fdt */
506− for_each_node_by_type(dn, "cpu") {
507527 cpus_subnode_offset = fdt_add_subnode(fdt, cpus_offset, dn->full_name);
508528 if (cpus_subnode_offset < 0) {
509529 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
517537 goto out;
518538 }
519539 out:
540+ of_node_put(cpus_node);
520541 of_node_put(dn);
521542 return ret;
522543 }
arch/powerpc/kexec/elf_64.c+9−3
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/of_fdt.h>
2424 #include <linux/slab.h>
2525 #include <linux/types.h>
26+#include <asm/kexec_ranges.h>
2627
2728 static void *elf64_load(struct kimage *image, char *kernel_buf,
2829 unsigned long kernel_len, char *initrd,
@@ -36,6 +37,7 @@ static void *elf64_load(struct kimage *image, char *kernel_buf, · 7 unmodified lines
3637 const void *slave_code;
3738 struct elfhdr ehdr;
3839 char *modified_cmdline = NULL;
40+ struct crash_mem *rmem = NULL;
3941 struct kexec_elf_info elf_info;
4042 struct kexec_buf kbuf = { .image = image, .buf_min = 0,
4143 .buf_max = ppc64_rma_size };
@@ -102,17 +104,20 @@ static void *elf64_load(struct kimage *image, char *kernel_buf, · 60 unmodified lines
102104 kexec_dprintk("Loaded initrd at 0x%lx\n", initrd_load_addr);
103105 }
104106
107+ ret = get_reserved_memory_ranges(&rmem);
108+ if (ret)
109+ goto out;
110+
105111 fdt = of_kexec_alloc_and_setup_fdt(image, initrd_load_addr,
106112 initrd_len, cmdline,
107− kexec_extra_fdt_size_ppc64(image));
113+ kexec_extra_fdt_size_ppc64(image, rmem));
108114 if (!fdt) {
109115 pr_err("Error setting up the new device tree.\n");
110116 ret = -EINVAL;
111117 goto out;
112118 }
113119
114− ret = setup_new_fdt_ppc64(image, fdt, initrd_load_addr,
115− initrd_len, cmdline);
120+ ret = setup_new_fdt_ppc64(image, fdt, rmem);
116121 if (ret)
117122 goto out_free_fdt;
118123
@@ -146,6 +151,7 @@ static void *elf64_load(struct kimage *image, char *kernel_buf, · 27 unmodified lines
146151 out_free_fdt:
147152 kvfree(fdt);
148153 out:
154+ kfree(rmem);
149155 kfree(modified_cmdline);
150156 kexec_free_elf_info(&elf_info);
151157
arch/powerpc/kexec/file_load_64.c+35−55
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include <linux/of_fdt.h>
1919 #include <linux/libfdt.h>
2020 #include <linux/of.h>
21+#include <linux/of_address.h>
2122 #include <linux/memblock.h>
2223 #include <linux/slab.h>
2324 #include <linux/vmalloc.h>
@@ -376,11 +377,10 @@ static int kdump_setup_usable_lmb(struct drmem_lmb *lmb, const __be32 **usm, · 352 unmodified lines
376377 static int add_usable_mem_property(void *fdt, struct device_node *dn,
377378 struct umem_info *um_info)
378379 {
379− int n_mem_addr_cells, n_mem_size_cells, node;
380+ int node;
380381 char path[NODE_PATH_LEN];
381− int i, len, ranges, ret;
382− const __be32 *prop;
383− u64 base, end;
382+ int i, ret;
383+ u64 base, size;
384384
385385 of_node_get(dn);
386386
@@ -399,41 +399,30 @@ static int add_usable_mem_property(void *fdt, struct device_node *dn, · 12 unmodified lines
399399 goto out;
400400 }
401401
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−
408402 um_info->idx = 0;
409403 if (!check_realloc_usable_mem(um_info, 2)) {
410404 ret = -ENOMEM;
411405 goto out;
412406 }
413407
414− prop = of_get_property(dn, "reg", &len);
415− if (!prop || len <= 0) {
416− ret = 0;
417− goto out;
418− }
419−
420408 /*
421409 * "reg" property represents sequence of (addr,size) tuples
422410 * each representing a memory range.
423411 */
424− ranges = (len >> 2) / (n_mem_addr_cells + n_mem_size_cells);
425−
426− for (i = 0; i < ranges; i++) {
427− base = of_read_number(prop, n_mem_addr_cells);
428− prop += n_mem_addr_cells;
429− end = base + of_read_number(prop, n_mem_size_cells) - 1;
430− prop += n_mem_size_cells;
412+ for (i = 0; ; i++) {
413+ ret = of_property_read_reg(dn, i, &base, &size);
414+ if (ret)
415+ break;
431416
432− ret = add_usable_mem(um_info, base, end);
417+ ret = add_usable_mem(um_info, base, base + size - 1);
433418 if (ret)
434419 goto out;
435420 }
436421
422+ // No reg or empty reg? Skip this node.
423+ if (i == 0)
424+ goto out;
425+
437426 /*
438427 * No kdump kernel usable memory found in this memory node.
439428 * Write (0,0) tuple in linux,usable-memory property for
@@ -803,10 +792,9 @@ static unsigned int cpu_node_size(void) · 363 unmodified lines
803792 return size;
804793 }
805794
806−static unsigned int kdump_extra_fdt_size_ppc64(struct kimage *image)
795+static unsigned int kdump_extra_fdt_size_ppc64(struct kimage *image, unsigned int cpu_nodes)
807796 {
808− unsigned int cpu_nodes, extra_size = 0;
809− struct device_node *dn;
797+ unsigned int extra_size = 0;
810798 u64 usm_entries;
811799 #ifdef CONFIG_CRASH_HOTPLUG
812800 unsigned int possible_cpu_nodes;
@@ -826,18 +814,6 @@ static unsigned int kdump_extra_fdt_size_ppc64(struct kimage *image) · 13 unmodified lines
826814 extra_size += (unsigned int)(usm_entries * sizeof(u64));
827815 }
828816
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−
841817 #ifdef CONFIG_CRASH_HOTPLUG
842818 /*
843819 * 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
861837 *
862838 * Returns the estimated extra size needed for kexec/kdump kernel FDT.
863839 */
864−unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image)
840+unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image, struct crash_mem *rmem)
865841 {
866− unsigned int extra_size = 0;
842+ struct device_node *dn;
843+ unsigned int cpu_nodes = 0, extra_size = 0;
867844
868845 // Budget some space for the password blob. There's already extra space
869846 // for the key name
870847 if (plpks_is_available())
871848 extra_size += (unsigned int)plpks_get_passwordlen();
872849
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);
874864 }
875865
876866 static 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
924914 * being loaded.
925915 * @image: kexec image being loaded.
926916 * @fdt: Flattened device tree for the next kernel.
927− * @initrd_load_addr: Address where the next initrd will be loaded.
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.
917+ * @rmem: Reserved memory ranges.
931918 *
932919 * Returns 0 on success, negative errno on error.
933920 */
934−int setup_new_fdt_ppc64(const struct kimage *image, void *fdt,
935− unsigned long initrd_load_addr,
936− unsigned long initrd_len, const char *cmdline)
921+int setup_new_fdt_ppc64(const struct kimage *image, void *fdt, struct crash_mem *rmem)
937922 {
938− struct crash_mem *umem = NULL, *rmem = NULL;
923+ struct crash_mem *umem = NULL;
939924 int i, nr_ranges, ret;
940925
941926 #ifdef CONFIG_CRASH_DUMP
@@ -991,10 +976,6 @@ int setup_new_fdt_ppc64(const struct kimage *image, void *fdt, · 49 unmodified lines
991976 goto out;
992977
993978 /* Update memory reserve map */
994− ret = get_reserved_memory_ranges(&rmem);
995− if (ret)
996− goto out;
997−
998979 nr_ranges = rmem ? rmem->nr_ranges : 0;
999980 for (i = 0; i < nr_ranges; i++) {
1000981 u64 base, size;
@@ -1014,7 +995,6 @@ int setup_new_fdt_ppc64(const struct kimage *image, void *fdt, · 13 unmodified lines
1014995 ret = plpks_populate_fdt(fdt);
1015996
1016997 out:
1017− kfree(rmem);
1018998 kfree(umem);
1019999 return ret;
10201000 }
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
23052305 *val = get_reg_val(id, kvmppc_get_siar_hv(vcpu));
23062306 break;
23072307 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));
23092309 break;
23102310 case KVM_REG_PPC_SIER:
23112311 *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
23492349 case KVM_REG_PPC_DAWRX1:
23502350 *val = get_reg_val(id, kvmppc_get_dawrx1_hv(vcpu));
23512351 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;
23522361 case KVM_REG_PPC_CIABR:
23532362 *val = get_reg_val(id, kvmppc_get_ciabr_hv(vcpu));
23542363 break;
@@ -2540,7 +2549,7 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id, · 185 unmodified lines
25402549 vcpu->arch.mmcrs = set_reg_val(id, *val);
25412550 break;
25422551 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));
25442553 break;
25452554 case KVM_REG_PPC_PMC1 ... KVM_REG_PPC_PMC8:
25462555 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
25922601 case KVM_REG_PPC_DAWRX1:
25932602 kvmppc_set_dawrx1_hv(vcpu, set_reg_val(id, *val) & ~DAWRX_HYP);
25942603 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;
25952613 case KVM_REG_PPC_CIABR:
25962614 kvmppc_set_ciabr_hv(vcpu, set_reg_val(id, *val));
25972615 /* 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
41084126 }
41094127 }
41104128
4129+/* Helper functions for reading L2's stats from L1's VPA */
4130+#ifdef CONFIG_PPC_PSERIES
4131+static DEFINE_PER_CPU(u64, l1_to_l2_cs);
4132+static DEFINE_PER_CPU(u64, l2_to_l1_cs);
4133+static DEFINE_PER_CPU(u64, l2_runtime_agg);
4134+
4135+int kvmhv_get_l2_counters_status(void)
4136+{
4137+ return firmware_has_feature(FW_FEATURE_LPAR) &&
4138+ get_lppaca()->l2_counters_enable;
4139+}
4140+
4141+void 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+
4151+int 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+
4161+void 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+
4170+static 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
4190+int kvmhv_get_l2_counters_status(void)
4191+{
4192+ return 0;
4193+}
4194+
4195+static void do_trace_nested_cs_time(struct kvm_vcpu *vcpu)
4196+{
4197+}
4198+#endif
4199+
41114200 static int kvmhv_vcpu_entry_nestedv2(struct kvm_vcpu *vcpu, u64 time_limit,
41124201 unsigned long lpcr, u64 *tb)
41134202 {
@@ -4116,6 +4205,11 @@ static int kvmhv_vcpu_entry_nestedv2(struct kvm_vcpu *vcpu, u64 time_limit, · 2 unmodified lines
41164205 int trap;
41174206 long rc;
41184207
4208+ if (vcpu->arch.doorbell_request) {
4209+ vcpu->arch.doorbell_request = 0;
4210+ kvmppc_set_dpdes(vcpu, 1);
4211+ }
4212+
41194213 io = &vcpu->arch.nestedv2_io;
41204214
41214215 msr = mfmsr();
@@ -4156,6 +4250,10 @@ static int kvmhv_vcpu_entry_nestedv2(struct kvm_vcpu *vcpu, u64 time_limit, · 34 unmodified lines
41564250
41574251 timer_rearm_host_dec(*tb);
41584252
4253+ /* Record context switch and guest_run_time data */
4254+ if (kvmhv_get_l2_counters_status())
4255+ do_trace_nested_cs_time(vcpu);
4256+
41594257 return trap;
41604258 }
41614259
@@ -6519,6 +6617,7 @@ static void kvmppc_book3s_exit_hv(void) · 2357 unmodified lines
65196617
65206618 module_init(kvmppc_book3s_init_hv);
65216619 module_exit(kvmppc_book3s_exit_hv);
6620+MODULE_DESCRIPTION("KVM on Book3S (POWER8 and later) in hypervisor mode");
65226621 MODULE_LICENSE("GPL");
65236622 MODULE_ALIAS_MISCDEV(KVM_MINOR);
65246623 MODULE_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
116116 KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawr1, 64, KVMPPC_GSID_DAWR1)
117117 KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawrx0, 64, KVMPPC_GSID_DAWRX0)
118118 KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawrx1, 64, KVMPPC_GSID_DAWRX1)
119+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dexcr, 64, KVMPPC_GSID_DEXCR)
120+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(hashkeyr, 64, KVMPPC_GSID_HASHKEYR)
121+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(hashpkeyr, 64, KVMPPC_GSID_HASHPKEYR)
119122 KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(ciabr, 64, KVMPPC_GSID_CIABR)
120123 KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(wort, 64, KVMPPC_GSID_WORT)
121124 KVMPPC_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
193193 case KVMPPC_GSID_DAWRX1:
194194 rc = kvmppc_gse_put_u32(gsb, iden, vcpu->arch.dawrx1);
195195 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;
196205 case KVMPPC_GSID_CIABR:
197206 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.ciabr);
198207 break;
@@ -311,6 +320,10 @@ static int gs_msg_ops_vcpu_fill_info(struct kvmppc_gs_buff *gsb, · 112 unmodified lines
311320 rc = kvmppc_gse_put_u64(gsb, iden,
312321 vcpu->arch.vcore->vtb);
313322 break;
323+ case KVMPPC_GSID_DPDES:
324+ rc = kvmppc_gse_put_u64(gsb, iden,
325+ vcpu->arch.vcore->dpdes);
326+ break;
314327 case KVMPPC_GSID_LPCR:
315328 rc = kvmppc_gse_put_u64(gsb, iden,
316329 vcpu->arch.vcore->lpcr);
@@ -441,6 +454,15 @@ static int gs_msg_ops_vcpu_refresh_info(struct kvmppc_gs_msg *gsm, · 124 unmodified lines
441454 case KVMPPC_GSID_DAWRX1:
442455 vcpu->arch.dawrx1 = kvmppc_gse_get_u32(gse);
443456 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;
444466 case KVMPPC_GSID_CIABR:
445467 vcpu->arch.ciabr = kvmppc_gse_get_u64(gse);
446468 break;
@@ -543,6 +565,9 @@ static int gs_msg_ops_vcpu_refresh_info(struct kvmppc_gs_msg *gsm, · 96 unmodified lines
543565 case KVMPPC_GSID_VTB:
544566 vcpu->arch.vcore->vtb = kvmppc_gse_get_u64(gse);
545567 break;
568+ case KVMPPC_GSID_DPDES:
569+ vcpu->arch.vcore->dpdes = kvmppc_gse_get_u64(gse);
570+ break;
546571 case KVMPPC_GSID_LPCR:
547572 vcpu->arch.vcore->lpcr = kvmppc_gse_get_u64(gse);
548573 break;
arch/powerpc/kvm/book3s_pr.c+1−0
@@ -2111,6 +2111,7 @@ void kvmppc_book3s_exit_pr(void) · 2110 unmodified lines
21112111 module_init(kvmppc_book3s_init_pr);
21122112 module_exit(kvmppc_book3s_exit_pr);
21132113
2114+MODULE_DESCRIPTION("KVM on Book3S without using hypervisor mode");
21142115 MODULE_LICENSE("GPL");
21152116 MODULE_ALIAS_MISCDEV(KVM_MINOR);
21162117 MODULE_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
151151 i++;
152152 }
153153
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++) {
155155 kvmppc_gsbm_set(&gsbm, iden);
156156 kvmppc_gsbm_set(&gsbm1, iden);
157157 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
325325
326326 kunit_test_suites(&guest_state_buffer_test_suite);
327327
328+MODULE_DESCRIPTION("KUnit tests for Guest State Buffer APIs");
328329 MODULE_LICENSE("GPL");
arch/powerpc/kvm/trace_hv.h+29−0
@@ -512,6 +512,35 @@ TRACE_EVENT(kvmppc_run_vcpu_exit, · 511 unmodified lines
512512 __entry->vcpu_id, __entry->exit, __entry->ret)
513513 );
514514
515+#ifdef CONFIG_PPC_PSERIES
516+
517+TRACE_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
515544 #endif /* _TRACE_KVM_HV_H */
516545
517546 /* This part must be outside protection */
arch/powerpc/mm/book3s64/radix_pgtable.c+80−4
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/hugetlb.h>
1818 #include <linux/string_helpers.h>
1919 #include <linux/memory.h>
20+#include <linux/kfence.h>
2021
2122 #include <asm/pgalloc.h>
2223 #include <asm/mmu_context.h>
@@ -31,6 +32,7 @@ · 8 unmodified lines
3132 #include <asm/uaccess.h>
3233 #include <asm/ultravisor.h>
3334 #include <asm/set_memory.h>
35+#include <asm/kfence.h>
3436
3537 #include <trace/events/thp.h>
3638
@@ -293,7 +295,8 @@ static unsigned long next_boundary(unsigned long addr, unsigned long end) · 256 unmodified lines
293295
294296 static int __meminit create_physical_mapping(unsigned long start,
295297 unsigned long end,
296− int nid, pgprot_t _prot)
298+ int nid, pgprot_t _prot,
299+ unsigned long mapping_sz_limit)
297300 {
298301 unsigned long vaddr, addr, mapping_size = 0;
299302 bool prev_exec, exec = false;
@@ -301,7 +304,10 @@ static int __meminit create_physical_mapping(unsigned long start, · 1 unmodified line
301304 int psize;
302305 unsigned long max_mapping_size = memory_block_size;
303306
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())
305311 max_mapping_size = PAGE_SIZE;
306312
307313 start = ALIGN(start, PAGE_SIZE);
@@ -356,8 +362,74 @@ static int __meminit create_physical_mapping(unsigned long start, · 48 unmodified lines
356362 return 0;
357363 }
358364
365+#ifdef CONFIG_KFENCE
366+static bool __ro_after_init kfence_early_init = !!CONFIG_KFENCE_SAMPLE_INTERVAL;
367+
368+static 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+}
376+early_param("kfence.sample_interval", parse_kfence_early_init);
377+
378+static 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+
403+no_kfence:
404+ disable_kfence();
405+ return 0;
406+}
407+
408+static 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+
421+err:
422+ memblock_phys_free(kfence_pool, KFENCE_POOL_SIZE);
423+ disable_kfence();
424+}
425+#else
426+static inline phys_addr_t alloc_kfence_pool(void) { return 0; }
427+static inline void map_kfence_pool(phys_addr_t kfence_pool) { }
428+#endif
429+
359430 static void __init radix_init_pgtable(void)
360431 {
432+ phys_addr_t kfence_pool;
361433 unsigned long rts_field;
362434 phys_addr_t start, end;
363435 u64 i;
@@ -365,6 +437,8 @@ static void __init radix_init_pgtable(void) · 1 unmodified line
365437 /* We don't support slb for radix */
366438 slb_set_size(0);
367439
440+ kfence_pool = alloc_kfence_pool();
441+
368442 /*
369443 * Create the linear mapping
370444 */
@@ -381,9 +455,11 @@ static void __init radix_init_pgtable(void) · 10 unmodified lines
381455 }
382456
383457 WARN_ON(create_physical_mapping(start, end,
384− -1, PAGE_KERNEL));
458+ -1, PAGE_KERNEL, ~0UL));
385459 }
386460
461+ map_kfence_pool(kfence_pool);
462+
387463 if (!cpu_has_feature(CPU_FTR_HVMODE) &&
388464 cpu_has_feature(CPU_FTR_P9_RADIX_PREFETCH_BUG)) {
389465 /*
@@ -875,7 +951,7 @@ int __meminit radix__create_section_mapping(unsigned long start, · 485 unmodified lines
875951 }
876952
877953 return create_physical_mapping(__pa(start), __pa(end),
878− nid, prot);
954+ nid, prot, ~0UL);
879955 }
880956
881957 int __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
491491 const __be32 *prop;
492492
493493 dn = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
494− if (!dn) {
495− pr_info("No dynamic reconfiguration memory found\n");
494+ if (!dn)
496495 return 0;
497− }
498496
499497 if (init_drmem_lmb_size(dn)) {
500498 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
368368 * Define the correct "is_write" bit in error_code based
369369 * on the processor family
370370 */
371−#if (defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
371+#ifdef CONFIG_BOOKE
372372 #define page_fault_is_write(__err) ((__err) & ESR_DST)
373373 #else
374374 #define page_fault_is_write(__err) ((__err) & DSISR_ISSTORE)
375375 #endif
376376
377−#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
377+#ifdef CONFIG_BOOKE
378378 #define page_fault_is_bad(__err) (0)
379379 #elif defined(CONFIG_PPC_8xx)
380380 #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
3131
3232 bool disable_kuep = !IS_ENABLED(CONFIG_PPC_KUEP);
3333 bool disable_kuap = !IS_ENABLED(CONFIG_PPC_KUAP);
34+#ifdef CONFIG_KFENCE
35+bool __ro_after_init kfence_disabled;
36+#endif
3437
3538 static int __init parse_nosmep(char *p)
3639 {
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
2121 #ifdef CONFIG_PPC_BOOK3S_32
2222 tsk->thread.sr0 = mm->context.sr0;
2323 #endif
24−#if defined(CONFIG_BOOKE_OR_40x) && defined(CONFIG_PPC_KUAP)
24+#if defined(CONFIG_BOOKE) && defined(CONFIG_PPC_KUAP)
2525 tsk->thread.pid = mm->context.id;
2626 #endif
2727 }
arch/powerpc/mm/mmu_decl.h+4−4
@@ -20,9 +20,9 @@ · 19 unmodified lines
2020 #include <asm/trace.h>
2121
2222 /*
23− * On 40x and 8xx, we directly inline tlbia and tlbivax
23+ * On 8xx, we directly inline tlbia
2424 */
25−#if defined(CONFIG_40x) || defined(CONFIG_PPC_8xx)
25+#ifdef CONFIG_PPC_8xx
2626 static inline void _tlbil_all(void)
2727 {
2828 asm volatile ("sync; tlbia; isync" : : : "memory");
@@ -35,7 +35,7 @@ static inline void _tlbil_pid(unsigned int pid) · 6 unmodified lines
3535 }
3636 #define _tlbil_pid_noind(pid) _tlbil_pid(pid)
3737
38−#else /* CONFIG_40x || CONFIG_PPC_8xx */
38+#else /* CONFIG_PPC_8xx */
3939 extern void _tlbil_all(void);
4040 extern void _tlbil_pid(unsigned int pid);
4141 #ifdef CONFIG_PPC_BOOK3E_64
@@ -43,7 +43,7 @@ extern void _tlbil_pid_noind(unsigned int pid); · 1 unmodified line
4343 #else
4444 #define _tlbil_pid_noind(pid) _tlbil_pid(pid)
4545 #endif
46−#endif /* !(CONFIG_40x || CONFIG_PPC_8xx) */
46+#endif /* !CONFIG_PPC_8xx */
4747
4848 /*
4949 * 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− */
49−void __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−
92−unsigned 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−
151−void 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
22
33 obj-y += mmu_context.o tlb.o tlb_low.o kup.o
44 obj-$(CONFIG_PPC_BOOK3E_64) += tlb_low_64e.o book3e_pgtable.o
5−obj-$(CONFIG_40x) += 40x.o
65 obj-$(CONFIG_44x) += 44x.o
76 obj-$(CONFIG_PPC_8xx) += 8xx.o
87 obj-$(CONFIG_PPC_E500) += e500.o
arch/powerpc/mm/nohash/kup.c+0−2
@@ -15,8 +15,6 @@ · 14 unmodified lines
1515 void setup_kuap(bool disabled)
1616 {
1717 if (disabled) {
18− if (IS_ENABLED(CONFIG_40x))
19− disable_kuep = true;
2018 if (smp_processor_id() == boot_cpuid)
2119 cur_cpu_spec->mmu_features &= ~MMU_FTR_KUAP;
2220 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
219219 /* sync */
220220 mb();
221221 } else if (kuap_is_disabled()) {
222− if (IS_ENABLED(CONFIG_40x))
223− mb(); /* sync */
224−
225222 mtspr(SPRN_PID, id);
226223 isync();
227224 }
@@ -306,7 +303,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next, · 78 unmodified lines
306303 if (IS_ENABLED(CONFIG_BDI_SWITCH))
307304 abatron_pteptrs[1] = next->pgd;
308305 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)
310307 tsk->thread.pid = id;
311308 #endif
312309 raw_spin_unlock(&context_lock);
arch/powerpc/mm/nohash/tlb_low.S+1−26
@@ -32,32 +32,7 @@ · 31 unmodified lines
3232 #include <asm/asm-compat.h>
3333 #include <asm/feature-fixups.h>
3434
35−#if defined(CONFIG_40x)
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
58−1: blr
59−
60−#elif defined(CONFIG_PPC_8xx)
35+#if defined(CONFIG_PPC_8xx)
6136
6237 /*
6338 * 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
896896
897897 static int __init parse_numa_properties(void)
898898 {
899− struct device_node *memory;
899+ struct device_node *memory, *pci;
900900 int default_nid = 0;
901901 unsigned long i;
902902 const __be32 *associativity;
@@ -1010,6 +1010,18 @@ new_range: · 107 unmodified lines
10101010 goto new_range;
10111011 }
10121012
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+
10131025 /*
10141026 * Now do the same thing for each MEMBLOCK listed in the
10151027 * ibm,dynamic-memory property in the
arch/powerpc/mm/ptdump/Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22
33 obj-y += ptdump.o
44
5−obj-$(CONFIG_4xx) += shared.o
5+obj-$(CONFIG_44x) += shared.o
66 obj-$(CONFIG_PPC_8xx) += 8xx.o
77 obj-$(CONFIG_PPC_E500) += shared.o
88 obj-$(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
510510 case BPF_ALU | BPF_DIV | BPF_X: /* (u32) dst /= (u32) src */
511511 case BPF_ALU | BPF_MOD | BPF_X: /* (u32) dst %= (u32) src */
512512 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+
514518 EMIT(PPC_RAW_MULW(tmp1_reg, src_reg, tmp1_reg));
515519 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg));
516520 } 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));
518525 goto bpf_alu32_trunc;
519526 case BPF_ALU64 | BPF_DIV | BPF_X: /* dst /= src */
520527 case BPF_ALU64 | BPF_MOD | BPF_X: /* dst %= src */
521528 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));
523533 EMIT(PPC_RAW_MULD(tmp1_reg, src_reg, tmp1_reg));
524534 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg));
525535 } 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));
527540 break;
528541 case BPF_ALU | BPF_MOD | BPF_K: /* (u32) dst %= (u32) imm */
529542 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
544557 switch (BPF_CLASS(code)) {
545558 case BPF_ALU:
546559 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));
548564 EMIT(PPC_RAW_MULW(tmp1_reg, tmp1_reg, tmp2_reg));
549565 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg));
550566 } 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));
552571 break;
553572 case BPF_ALU64:
554573 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));
556578 EMIT(PPC_RAW_MULD(tmp1_reg, tmp1_reg, tmp2_reg));
557579 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg));
558580 } 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));
560585 break;
561586 }
562587 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
676701 /* special mov32 for zext */
677702 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 0, 0, 31));
678703 break;
679− }
680− EMIT(PPC_RAW_MR(dst_reg, src_reg));
704+ } else if (off == 8) {
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));
681712 goto bpf_alu32_trunc;
682713 case BPF_ALU | BPF_MOV | BPF_K: /* (u32) dst = imm */
683714 case BPF_ALU64 | BPF_MOV | BPF_K: /* dst = (s64) imm */
@@ -699,11 +730,12 @@ bpf_alu32_trunc: · 15 unmodified lines
699730 */
700731 case BPF_ALU | BPF_END | BPF_FROM_LE:
701732 case BPF_ALU | BPF_END | BPF_FROM_BE:
733+ case BPF_ALU64 | BPF_END | BPF_FROM_LE:
702734 #ifdef __BIG_ENDIAN__
703735 if (BPF_SRC(code) == BPF_FROM_BE)
704736 goto emit_clear;
705737 #else /* !__BIG_ENDIAN__ */
706− if (BPF_SRC(code) == BPF_FROM_LE)
738+ if (BPF_CLASS(code) == BPF_ALU && BPF_SRC(code) == BPF_FROM_LE)
707739 goto emit_clear;
708740 #endif
709741 switch (imm) {
@@ -936,13 +968,19 @@ emit_clear: · 226 unmodified lines
936968 */
937969 /* dst = *(u8 *)(ul) (src + off) */
938970 case BPF_LDX | BPF_MEM | BPF_B:
971+ case BPF_LDX | BPF_MEMSX | BPF_B:
939972 case BPF_LDX | BPF_PROBE_MEM | BPF_B:
973+ case BPF_LDX | BPF_PROBE_MEMSX | BPF_B:
940974 /* dst = *(u16 *)(ul) (src + off) */
941975 case BPF_LDX | BPF_MEM | BPF_H:
976+ case BPF_LDX | BPF_MEMSX | BPF_H:
942977 case BPF_LDX | BPF_PROBE_MEM | BPF_H:
978+ case BPF_LDX | BPF_PROBE_MEMSX | BPF_H:
943979 /* dst = *(u32 *)(ul) (src + off) */
944980 case BPF_LDX | BPF_MEM | BPF_W:
981+ case BPF_LDX | BPF_MEMSX | BPF_W:
945982 case BPF_LDX | BPF_PROBE_MEM | BPF_W:
983+ case BPF_LDX | BPF_PROBE_MEMSX | BPF_W:
946984 /* dst = *(u64 *)(ul) (src + off) */
947985 case BPF_LDX | BPF_MEM | BPF_DW:
948986 case BPF_LDX | BPF_PROBE_MEM | BPF_DW:
@@ -952,7 +990,7 @@ emit_clear: · 3 unmodified lines
952990 * load only if addr is kernel address (see is_kernel_addr()), otherwise
953991 * set dst_reg=0 and move on.
954992 */
955− if (BPF_MODE(code) == BPF_PROBE_MEM) {
993+ if (BPF_MODE(code) == BPF_PROBE_MEM || BPF_MODE(code) == BPF_PROBE_MEMSX) {
956994 EMIT(PPC_RAW_ADDI(tmp1_reg, src_reg, off));
957995 if (IS_ENABLED(CONFIG_PPC_BOOK3E_64))
958996 PPC_LI64(tmp2_reg, 0x8000000000000000ul);
@@ -965,30 +1003,47 @@ emit_clear: · 6 unmodified lines
9651003 * Check if 'off' is word aligned for BPF_DW, because
9661004 * we might generate two instructions.
9671005 */
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))
9691009 PPC_JMP((ctx->idx + 3) * 4);
9701010 else
9711011 PPC_JMP((ctx->idx + 2) * 4);
9721012 }
9731013
974− switch (size) {
975− case BPF_B:
976− EMIT(PPC_RAW_LBZ(dst_reg, src_reg, off));
977− break;
978− case BPF_H:
979− EMIT(PPC_RAW_LHZ(dst_reg, src_reg, off));
980− break;
981− case BPF_W:
982− EMIT(PPC_RAW_LWZ(dst_reg, src_reg, off));
983− break;
984− case BPF_DW:
985− if (off % 4) {
986− EMIT(PPC_RAW_LI(tmp1_reg, off));
987− EMIT(PPC_RAW_LDX(dst_reg, src_reg, tmp1_reg));
988− } else {
989− EMIT(PPC_RAW_LD(dst_reg, src_reg, off));
1014+ if (BPF_MODE(code) == BPF_MEMSX || BPF_MODE(code) == BPF_PROBE_MEMSX) {
1015+ switch (size) {
1016+ case BPF_B:
1017+ EMIT(PPC_RAW_LBZ(dst_reg, src_reg, off));
1018+ EMIT(PPC_RAW_EXTSB(dst_reg, dst_reg));
1019+ break;
1020+ case BPF_H:
1021+ EMIT(PPC_RAW_LHA(dst_reg, src_reg, off));
1022+ break;
1023+ case BPF_W:
1024+ EMIT(PPC_RAW_LWA(dst_reg, src_reg, off));
1025+ break;
1026+ }
1027+ } else {
1028+ switch (size) {
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;
9901046 }
991− break;
9921047 }
9931048
9941049 if (size != BPF_DW && insn_is_zext(&insn[i + 1]))
@@ -1065,6 +1120,9 @@ emit_clear: · 70 unmodified lines
10651120 case BPF_JMP | BPF_JA:
10661121 PPC_JMP(addrs[i + 1 + off]);
10671122 break;
1123+ case BPF_JMP32 | BPF_JA:
1124+ PPC_JMP(addrs[i + 1 + imm]);
1125+ break;
10681126
10691127 case BPF_JMP | BPF_JGT | BPF_K:
10701128 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
266266 static inline u32 perf_get_misc_flags(struct pt_regs *regs)
267267 {
268268 bool use_siar = regs_use_siar(regs);
269− unsigned long mmcra = regs->dsisr;
270− int marked = mmcra & MMCRA_SAMPLE_ENABLE;
269+ unsigned long siar;
270+ unsigned long addr;
271271
272272 if (!use_siar)
273273 return perf_flags_from_msr(regs);
274274
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−
294275 /*
295276 * If we don't have flags in MMCRA, rather than using
296277 * 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
298279 * results
299280 */
300281 if (ppmu->flags & PPMU_NO_SIPR) {
301− unsigned long siar = mfspr(SPRN_SIAR);
282+ siar = mfspr(SPRN_SIAR);
302283 if (is_kernel_addr(siar))
303284 return PERF_RECORD_MISC_KERNEL;
304285 return PERF_RECORD_MISC_USER;
305286 }
306287
307288 /* PR has priority over HV, so order below is important */
308− if (regs_sipr(regs))
309− return PERF_RECORD_MISC_USER;
310−
311− if (regs_sihv(regs) && (freeze_events_kernel != MMCR0_FCHV))
289+ if (regs_sipr(regs)) {
290+ if (!(ppmu->flags & PPMU_P10))
291+ return PERF_RECORD_MISC_USER;
292+ } else if (regs_sihv(regs) && (freeze_events_kernel != MMCR0_FCHV))
312293 return PERF_RECORD_MISC_HYPERVISOR;
313294
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+
314307 return PERF_RECORD_MISC_KERNEL;
315308 }
316309
arch/powerpc/perf/power10-pmu.c+2−1
@@ -593,7 +593,8 @@ static struct power_pmu power10_pmu = { · 592 unmodified lines
593593 .get_mem_weight = isa207_get_mem_weight,
594594 .disable_pmc = isa207_disable_pmc,
595595 .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,
597598 .n_generic = ARRAY_SIZE(power10_generic_events),
598599 .generic_events = power10_generic_events,
599600 .cache_events = &power10_cache_events,
arch/powerpc/platforms/40x/Kconfig+0−78
@@ -1,78 +0,0 @@
1−# SPDX-License-Identifier: GPL-2.0
2−config 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−
10−config 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−
18−config 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−
29−config 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−
39−config 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−
47−config 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−
53−config 405EX
54− bool
55− select IBM_EMAC_EMAC4 if IBM_EMAC
56− select IBM_EMAC_RGMII if IBM_EMAC
57−
58−config 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−
64−config 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−
72−config 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
2−obj-$(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−
23−static 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−
32−static int __init ppc40x_device_probe(void)
33−{
34− of_platform_bus_probe(NULL, ppc40x_of_bus, NULL);
35−
36− return 0;
37−}
38−machine_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− */
49−static 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−
60−static int __init ppc40x_probe(void)
61−{
62− pci_set_flags(PCI_REASSIGN_ALL_RSRC);
63− return 1;
64−}
65−
66−define_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 @@
11 # SPDX-License-Identifier: GPL-2.0
2−obj-y += misc_44x.o machine_check.o
2+obj-y += misc_44x.o machine_check.o uic.o soc.o
33 ifneq ($(CONFIG_PPC4xx_CPM),y)
44 obj-y += idle.o
55 endif
@@ -12,3 +12,7 @@ obj-$(CONFIG_CANYONLANDS)+= canyonlands.o · 6 unmodified lines
1212 obj-$(CONFIG_CURRITUCK) += ppc476.o
1313 obj-$(CONFIG_AKEBONO) += ppc476.o
1414 obj-$(CONFIG_FSP2) += fsp2.o
15+obj-$(CONFIG_PCI) += pci.o
16+obj-$(CONFIG_PPC4xx_HSTA_MSI) += hsta_msi.o
17+obj-$(CONFIG_PPC4xx_CPM) += cpm.o
18+obj-$(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
99 #include <asm/reg.h>
1010 #include <asm/cacheflush.h>
1111
12+int 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+
1227 int machine_check_440A(struct pt_regs *regs)
1328 {
1429 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
12631263
12641264 #endif /* CONFIG_44x */
12651265
1266−#ifdef CONFIG_40x
1267−
1268−static int __init ppc405ex_pciex_core_init(struct device_node *np)
1269−{
1270− /* Nothing to do, return 2 ports */
1271− return 2;
1272−}
1273−
1274−static 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−
1295−static 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−
1330−static 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−
1351−static 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−
13621266 #ifdef CONFIG_476FPE
13631267 static int __init ppc_476fpe_pciex_core_init(struct device_node *np)
13641268 {
@@ -1427,10 +1331,6 @@ static int __init ppc4xx_pciex_check_core_init(struct device_node *np) · 62 unmodified lines
14271331 if (of_device_is_compatible(np, "ibm,plb-pciex-apm821xx"))
14281332 ppc4xx_pciex_hwops = &apm821xx_pcie_hwops;
14291333 #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
14341334 #ifdef CONFIG_476FPE
14351335 if (of_device_is_compatible(np, "ibm,plb-pciex-476fpe")
14361336 || 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
2−obj-y += uic.o machine_check.o
3−obj-$(CONFIG_4xx_SOC) += soc.o
4−obj-$(CONFIG_PCI) += pci.o
5−obj-$(CONFIG_PPC4xx_HSTA_MSI) += hsta_msi.o
6−obj-$(CONFIG_PPC4xx_CPM) += cpm.o
7−obj-$(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−
11−int 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
149149
150150 early_initcall(t1042rdb_diu_init);
151151
152+MODULE_DESCRIPTION("Freescale T1042 DIU driver");
152153 MODULE_LICENSE("GPL");
arch/powerpc/platforms/Kconfig+0−1
@@ -18,7 +18,6 @@ source "arch/powerpc/platforms/85xx/Kconfig" · 17 unmodified lines
1818 source "arch/powerpc/platforms/86xx/Kconfig"
1919 source "arch/powerpc/platforms/embedded6xx/Kconfig"
2020 source "arch/powerpc/platforms/44x/Kconfig"
21−source "arch/powerpc/platforms/40x/Kconfig"
2221 source "arch/powerpc/platforms/amigaone/Kconfig"
2322 source "arch/powerpc/platforms/book3s/Kconfig"
2423 source "arch/powerpc/platforms/microwatt/Kconfig"
arch/powerpc/platforms/Kconfig.cputype+4−24
@@ -43,19 +43,10 @@ config PPC_8xx · 42 unmodified lines
4343 select HAVE_ARCH_VMAP_STACK
4444 select HUGETLBFS
4545
46−config 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−
5446 config 44x
5547 bool "AMCC 44x, 46x or 47x"
5648 select PPC_DCR_NATIVE
5749 select PPC_UDBG_16550
58− select 4xx_SOC
5950 select HAVE_PCI
6051 select PHYS_64BIT
6152 select PPC_KUEP
@@ -194,11 +185,6 @@ config E6500_CPU · 132 unmodified lines
194185 depends on !CC_IS_CLANG
195186 select PPC_HAS_LBARX_LHARX
196187
197−config 405_CPU
198− bool "40x family"
199− depends on 40x
200− depends on !CC_IS_CLANG
201−
202188 config 440_CPU
203189 bool "440 (44x family)"
204190 depends on 44x
@@ -264,7 +250,6 @@ config TARGET_CPU · 59 unmodified lines
264250 default "e6500" if E6500_CPU
265251 default "power4" if POWERPC64_CPU && !CPU_LITTLE_ENDIAN
266252 default "power8" if POWERPC64_CPU && CPU_LITTLE_ENDIAN
267− default "405" if 405_CPU
268253 default "440" if 440_CPU
269254 default "464" if 464_CPU
270255 default "476" if 476_CPU
@@ -340,7 +325,7 @@ config FSL_EMB_PERF_EVENT_E500 · 69 unmodified lines
340325
341326 config 4xx
342327 bool
343− depends on 40x || 44x
328+ depends on 44x
344329 default y
345330
346331 config BOOKE
@@ -348,11 +333,6 @@ config BOOKE · 1 unmodified line
348333 depends on PPC_E500 || 44x
349334 default y
350335
351−config BOOKE_OR_40x
352− bool
353− depends on BOOKE || 40x
354− default y
355−
356336 config PTE_64BIT
357337 bool
358338 depends on 44x || PPC_E500 || PPC_86xx
@@ -495,8 +475,8 @@ config PPC_KERNEL_PCREL · 136 unmodified lines
495475 This option builds the kernel with the pc relative ABI model.
496476
497477 config PPC_KUEP
498− bool "Kernel Userspace Execution Prevention" if !40x
499− default y if !40x
478+ bool "Kernel Userspace Execution Prevention"
479+ default y
500480 help
501481 Enable support for Kernel Userspace Execution Prevention (KUEP)
502482
@@ -582,7 +562,7 @@ config NR_CPUS · 79 unmodified lines
582562
583563 config NOT_COHERENT_CACHE
584564 bool
585− depends on 4xx || PPC_8xx || PPC_MPC512x || \
565+ depends on 44x || PPC_8xx || PPC_MPC512x || \
586566 GAMECUBE_COMMON || AMIGAONE
587567 select ARCH_HAS_DMA_PREP_COHERENT
588568 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
44
55 obj-$(CONFIG_PPC_PMAC) += powermac/
66 obj-$(CONFIG_PPC_CHRP) += chrp/
7−obj-$(CONFIG_4xx) += 4xx/
8−obj-$(CONFIG_40x) += 40x/
97 obj-$(CONFIG_44x) += 44x/
108 obj-$(CONFIG_PPC_MPC512x) += 512x/
119 obj-$(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
101101 module_init(cbe_powerbutton_init);
102102 module_exit(cbe_powerbutton_exit);
103103
104+MODULE_DESCRIPTION("Driver for powerbutton on IBM cell blades");
104105 MODULE_LICENSE("GPL");
105106 MODULE_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
381381 }
382382 module_exit(thermal_exit);
383383
384+MODULE_DESCRIPTION("Cell processor thermal driver");
384385 MODULE_LICENSE("GPL");
385386 MODULE_AUTHOR("Christian Krafft <krafft@de.ibm.com>");
386387
arch/powerpc/platforms/cell/cpufreq_spudemand.c+1−0
@@ -129,5 +129,6 @@ static struct cpufreq_governor spu_governor = { · 128 unmodified lines
129129 cpufreq_governor_init(spu_governor);
130130 cpufreq_governor_exit(spu_governor);
131131
132+MODULE_DESCRIPTION("SPU-aware cpufreq governor for the cell processor");
132133 MODULE_LICENSE("GPL");
133134 MODULE_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
822822 }
823823 module_exit(spufs_exit);
824824
825+MODULE_DESCRIPTION("SPU file system");
825826 MODULE_LICENSE("GPL");
826827 MODULE_AUTHOR("Arnd Bergmann <arndb@de.ibm.com>");
827828
arch/powerpc/platforms/chrp/nvram.c+1−0
@@ -92,4 +92,5 @@ void __init chrp_nvram_init(void) · 91 unmodified lines
9292 return;
9393 }
9494
95+MODULE_DESCRIPTION("PPC NVRAM device driver");
9596 MODULE_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
15371537 }
15381538 }
15391539
1540−static long pnv_ioda2_take_ownership(struct iommu_table_group *table_group)
1540+static long pnv_ioda2_take_ownership(struct iommu_table_group *table_group,
1541+ struct device *dev __maybe_unused)
15411542 {
15421543 struct pnv_ioda_pe *pe = container_of(table_group, struct pnv_ioda_pe,
15431544 table_group);
@@ -1562,7 +1563,8 @@ static long pnv_ioda2_take_ownership(struct iommu_table_group *table_group) · 18 unmodified lines
15621563 return 0;
15631564 }
15641565
1565−static void pnv_ioda2_release_ownership(struct iommu_table_group *table_group)
1566+static void pnv_ioda2_release_ownership(struct iommu_table_group *table_group,
1567+ struct device *dev __maybe_unused)
15661568 {
15671569 struct pnv_ioda_pe *pe = container_of(table_group, struct pnv_ioda_pe,
15681570 table_group);
arch/powerpc/platforms/pseries/iommu.c+733−48
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <linux/dma-mapping.h>
2222 #include <linux/crash_dump.h>
2323 #include <linux/memory.h>
24+#include <linux/vmalloc.h>
2425 #include <linux/of.h>
2526 #include <linux/of_address.h>
2627 #include <linux/iommu.h>
@@ -67,6 +68,10 @@ static struct iommu_table *iommu_pseries_alloc_table(int node) · 40 unmodified lines
6768 return tbl;
6869 }
6970
71+#ifdef CONFIG_IOMMU_API
72+static struct iommu_table_group_ops spapr_tce_table_group_ops;
73+#endif
74+
7075 static struct iommu_table_group *iommu_pseries_alloc_group(int node)
7176 {
7277 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
102107 #endif
103108
104109 /* 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).
106111 */
107112 if (table_group->tables[0])
108113 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
143148 }
144149
145150
146−static void tce_free_pSeries(struct iommu_table *tbl, long index, long npages)
151+static void tce_clear_pSeries(struct iommu_table *tbl, long index, long npages)
147152 {
148153 __be64 *tcep;
149154
@@ -162,6 +167,39 @@ static unsigned long tce_get_pseries(struct iommu_table *tbl, long index) · 12 unmodified lines
162167 return be64_to_cpu(*tcep);
163168 }
164169
170+#ifdef CONFIG_IOMMU_API
171+static 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+
191+static void tce_iommu_userspace_view_free(struct iommu_table *tbl)
192+{
193+ vfree(tbl->it_userspace);
194+ tbl->it_userspace = NULL;
195+}
196+
197+static void tce_free_pSeries(struct iommu_table *tbl)
198+{
199+ if (!tbl->it_userspace)
200+ tce_iommu_userspace_view_free(tbl);
201+}
202+
165203 static void tce_free_pSeriesLP(unsigned long liobn, long, long, long);
166204 static void tce_freemulti_pSeriesLP(struct iommu_table*, long, long);
167205
@@ -576,7 +614,7 @@ struct iommu_table_ops iommu_table_lpar_multi_ops; · 408 unmodified lines
576614
577615 struct iommu_table_ops iommu_table_pseries_ops = {
578616 .set = tce_build_pSeries,
579− .clear = tce_free_pSeries,
617+ .clear = tce_clear_pSeries,
580618 .get = tce_get_pseries
581619 };
582620
@@ -685,17 +723,47 @@ static int tce_exchange_pseries(struct iommu_table *tbl, long index, unsigned · 102 unmodified lines
685723
686724 return rc;
687725 }
726+
727+static __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+}
688732 #endif
689733
690734 struct iommu_table_ops iommu_table_lpar_multi_ops = {
691735 .set = tce_buildmulti_pSeriesLP,
692736 #ifdef CONFIG_IOMMU_API
693737 .xchg_no_kill = tce_exchange_pseries,
738+ .useraddrptr = tce_useraddr_pSeriesLP,
694739 #endif
695740 .clear = tce_freemulti_pSeriesLP,
696− .get = tce_get_pSeriesLP
741+ .get = tce_get_pSeriesLP,
742+ .free = tce_free_pSeries
697743 };
698744
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+ */
750+static 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+
699767 /*
700768 * Find nearest ibm,dma-window (default DMA window) or direct DMA window or
701769 * 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
812880 be32_to_cpu(prop.tce_shift), NULL,
813881 &iommu_table_lpar_multi_ops);
814882
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−
822883 if (!iommu_init_table(tbl, ppci->phb->node, 0, 0))
823884 panic("Failed to initialize iommu table");
824885
@@ -917,7 +978,7 @@ static void __remove_dma_window(struct device_node *np, u32 *ddw_avail, u64 liob · 92 unmodified lines
917978 }
918979
919980 static void remove_dma_window(struct device_node *np, u32 *ddw_avail,
920− struct property *win)
981+ struct property *win, bool cleanup)
921982 {
922983 struct dynamic_dma_window_prop *dwp;
923984 u64 liobn;
@@ -925,11 +986,44 @@ static void remove_dma_window(struct device_node *np, u32 *ddw_avail, · 1 unmodified line
925986 dwp = win->value;
926987 liobn = (u64)be32_to_cpu(dwp->liobn);
927988
928− clean_dma_window(np, dwp);
989+ if (cleanup)
990+ clean_dma_window(np, dwp);
929991 __remove_dma_window(np, ddw_avail, liobn);
930992 }
931993
932−static int remove_ddw(struct device_node *np, bool remove_prop, const char *win_name)
994+static 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+
1019+free_prop:
1020+ kfree(dst->name);
1021+ kfree(dst->value);
1022+ kfree(dst);
1023+}
1024+
1025+static int remove_dma_window_named(struct device_node *np, bool remove_prop, const char *win_name,
1026+ bool cleanup)
9331027 {
9341028 struct property *win;
9351029 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
9441038 if (ret)
9451039 return 0;
9461040
947−
9481041 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);
9501043
9511044 if (!remove_prop)
9521045 return 0;
9531046
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+
9541055 ret = of_remove_property(np, win);
9551056 if (ret)
9561057 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
10081109 for_each_node_with_property(pdn, name) {
10091110 dma64 = of_get_property(pdn, name, &len);
10101111 if (!dma64 || len < sizeof(*dma64)) {
1011− remove_ddw(pdn, true, name);
1112+ remove_dma_window_named(pdn, true, name, true);
10121113 continue;
10131114 }
10141115
@@ -1304,7 +1405,7 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 289 unmodified lines
13041405 struct ddw_query_response query;
13051406 struct ddw_create_response create;
13061407 int page_shift;
1307− u64 win_addr;
1408+ u64 win_addr, dynamic_offset = 0;
13081409 const char *win_name;
13091410 struct device_node *dn;
13101411 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
13121413 struct property *win64;
13131414 struct failed_ddw_pdn *fpdn;
13141415 bool default_win_removed = false, direct_mapping = false;
1416+ bool dynamic_mapping = false;
13151417 bool pmem_present;
13161418 struct pci_dn *pci = PCI_DN(pdn);
13171419 struct property *default_win = NULL;
@@ -1385,7 +1487,7 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 67 unmodified lines
13851487 if (reset_win_ext)
13861488 goto out_failed;
13871489
1388− remove_dma_window(pdn, ddw_avail, default_win);
1490+ remove_dma_window(pdn, ddw_avail, default_win, true);
13891491 default_win_removed = true;
13901492
13911493 /* 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
14071509 goto out_failed;
14081510 }
14091511
1410−
14111512 /*
14121513 * The "ibm,pmemory" can appear anywhere in the address space.
14131514 * 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
14321533 1ULL << page_shift);
14331534
14341535 len = order_base_2(query.largest_available_block << page_shift);
1435− win_name = DMA64_PROPNAME;
1536+
1537+ dynamic_mapping = true;
14361538 } else {
14371539 direct_mapping = !default_win_removed ||
14381540 (len == MAX_PHYSMEM_BITS) ||
14391541 (!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+ }
14411565 }
14421566
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+
14431572 ret = create_ddw(dev, ddw_avail, &create, page_shift, len);
14441573 if (ret != 0)
14451574 goto out_failed;
@@ -1467,9 +1596,9 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) · 21 unmodified lines
14671596 if (!window)
14681597 goto out_del_prop;
14691598
1470− if (direct_mapping) {
1471− window->direct = true;
1599+ window->direct = direct_mapping;
14721600
1601+ if (direct_mapping) {
14731602 /* DDW maps the whole partition, so enable direct DMA mapping */
14741603 ret = walk_system_ram_range(0, memblock_end_of_DRAM() >> PAGE_SHIFT,
14751604 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
14811610 clean_dma_window(pdn, win64->value);
14821611 goto out_del_list;
14831612 }
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) {
14851621 struct iommu_table *newtbl;
14861622 int i;
14871623 unsigned long start = 0, end = 0;
1488−
1489− window->direct = false;
1624+ u64 dynamic_addr, dynamic_len;
14901625
14911626 for (i = 0; i < ARRAY_SIZE(pci->phb->mem_resources); i++) {
14921627 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
15061641 goto out_del_list;
15071642 }
15081643
1509− iommu_table_setparms_common(newtbl, pci->phb->bus->number, create.liobn, win_addr,
1510− 1UL << len, page_shift, NULL, &iommu_table_lpar_multi_ops);
1644+ /* If the DDW is split between directly mapped RAM and Dynamic
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);
15111653 iommu_init_table(newtbl, pci->phb->node, start, end);
15121654
1513− pci->table_group->tables[1] = newtbl;
1655+ pci->table_group->tables[default_win_removed ? 0 : 1] = newtbl;
15141656
15151657 set_iommu_table_base(&dev->dev, newtbl);
15161658 }
15171659
15181660 if (default_win_removed) {
1519− iommu_tce_table_put(pci->table_group->tables[0]);
1520− pci->table_group->tables[0] = NULL;
1521−
15221661 /* 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");
15231664 of_remove_property(pdn, default_win);
15241665 dev_info(&dev->dev, "Removed default DMA window for %pOF\n", pdn);
15251666 }
@@ -1559,17 +1700,81 @@ out_failed: · 33 unmodified lines
15591700 out_unlock:
15601701 mutex_unlock(&dma_win_init_mutex);
15611702
1562− /*
1563− * If we have persistent memory and the window size is only as big
1564− * as RAM, then we failed to create a window to cover persistent
1565− * memory and need to set the DMA limit.
1703+ /* If we have persistent memory and the window size is not big enough
1704+ * to directly map both RAM and vPMEM, then we need to set DMA limit.
15661705 */
1567− if (pmem_present && direct_mapping && len == max_ram_len)
1568− dev->dev.bus_dma_limit = dev->dev.archdata.dma_offset + (1ULL << len);
1706+ if (pmem_present && direct_mapping && len != MAX_PHYSMEM_BITS)
1707+ dev->dev.bus_dma_limit = dev->dev.archdata.dma_offset +
1708+ (1ULL << max_ram_len);
15691709
15701710 return direct_mapping;
15711711 }
15721712
1713+static __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+
1730+static 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+
15731778 static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
15741779 {
15751780 struct device_node *pdn, *dn;
@@ -1609,13 +1814,6 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev) · 33 unmodified lines
16091814 be32_to_cpu(prop.tce_shift), NULL,
16101815 &iommu_table_lpar_multi_ops);
16111816
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−
16191817 iommu_init_table(tbl, pci->phb->node, 0, 0);
16201818 iommu_register_group(pci->table_group,
16211819 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
16241822 pr_debug(" found DMA window, table: %p\n", pci->table_group);
16251823 }
16261824
1825+ spapr_tce_init_table_group(dev, pdn, prop);
1826+
16271827 set_iommu_table_base(&dev->dev, pci->table_group->tables[0]);
16281828 iommu_add_device(pci->table_group, &dev->dev);
16291829 }
@@ -1651,6 +1851,491 @@ static bool iommu_bypass_supported_pSeriesLP(struct pci_dev *pdev, u64 dma_mask) · 21 unmodified lines
16511851 return false;
16521852 }
16531853
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+ */
1861+static 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+
1872+static 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+
1887+static 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+
1893+static 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+
1929+static 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+
1973+static 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+
1983+static 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+
2153+remove_property:
2154+ of_remove_property(pdn, win64);
2155+free_property:
2156+ kfree(win64->name);
2157+ kfree(win64->value);
2158+ kfree(win64);
2159+remove_window:
2160+ __remove_dma_window(pdn, ddw_avail, create.liobn);
2161+
2162+out_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+
2169+out_unlock:
2170+ mutex_unlock(&dma_win_init_mutex);
2171+
2172+ return ret;
2173+exit:
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+
2183+static 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+
2192+static 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+
2198+static 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+
2246+out_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+
2253+out_unlock:
2254+ mutex_unlock(&dma_win_init_mutex);
2255+
2256+ return ret;
2257+}
2258+
2259+static 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+
2311+static 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+
2329+static 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+
16542339 static int iommu_mem_notifier(struct notifier_block *nb, unsigned long action,
16552340 void *data)
16562341 {
@@ -1712,8 +2397,8 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti · 55 unmodified lines
17122397 * we have to remove the property when releasing
17132398 * the device node.
17142399 */
1715− if (remove_ddw(np, false, DIRECT64_PROPNAME))
1716− remove_ddw(np, false, DMA64_PROPNAME);
2400+ if (remove_dma_window_named(np, false, DIRECT64_PROPNAME, true))
2401+ remove_dma_window_named(np, false, DMA64_PROPNAME, true);
17172402
17182403 if (pci && pci->table_group)
17192404 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
15361536 module_exit(papr_scm_exit);
15371537
15381538 MODULE_DEVICE_TABLE(of, papr_scm_match);
1539+MODULE_DESCRIPTION("PAPR Storage Class Memory interface driver");
15391540 MODULE_LICENSE("GPL");
15401541 MODULE_AUTHOR("IBM Corporation");
arch/powerpc/platforms/pseries/pci_dlpar.c+14−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111
1212 #include <linux/pci.h>
1313 #include <linux/export.h>
14+#include <linux/node.h>
1415 #include <asm/pci-bridge.h>
1516 #include <asm/ppc-pci.h>
1617 #include <asm/firmware.h>
@@ -21,9 +22,22 @@ · 4 unmodified lines
2122 struct pci_controller *init_phb_dynamic(struct device_node *dn)
2223 {
2324 struct pci_controller *phb;
25+ int nid;
2426
2527 pr_debug("PCI: Initializing new hotplug PHB %pOF\n", dn);
2628
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+
2741 phb = pcibios_alloc_controller(dn);
2842 if (!phb)
2943 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
3838 {
3939 /* Check if we are stalled for some time */
4040 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);
4262 rc = H_BUSY;
4363 } else if (rc == H_BUSY) {
4464 cond_resched();
arch/powerpc/sysdev/Kconfig+2−2
@@ -5,12 +5,12 @@ · 4 unmodified lines
55
66 config PPC4xx_PCI_EXPRESS
77 bool
8− depends on PCI && 4xx
8+ depends on PCI && 44x
99
1010 config PPC4xx_HSTA_MSI
1111 bool
1212 depends on PCI_MSI
13− depends on PCI && 4xx
13+ depends on PCI && 44x
1414
1515 config PPC_MSI_BITMAP
1616 bool
arch/powerpc/sysdev/rtc_cmos_setup.c+1−0
@@ -66,4 +66,5 @@ static int __init add_rtc(void) · 65 unmodified lines
6666 }
6767 fs_initcall(add_rtc);
6868
69+MODULE_DESCRIPTION("PPC RTC CMOS driver");
6970 MODULE_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
122122 bool insn_is_short;
123123 ppc_cpu_t dialect;
124124
125− dialect = PPC_OPCODE_PPC | PPC_OPCODE_COMMON
126− | PPC_OPCODE_64 | PPC_OPCODE_POWER4 | PPC_OPCODE_ALTIVEC;
125+ dialect = PPC_OPCODE_PPC | PPC_OPCODE_COMMON;
127126
128− if (cpu_has_feature(CPU_FTRS_POWER5))
129− dialect |= PPC_OPCODE_POWER5;
127+ if (IS_ENABLED(CONFIG_PPC64))
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;
130131
131− if (cpu_has_feature(CPU_FTRS_CELL))
132− dialect |= (PPC_OPCODE_CELL | PPC_OPCODE_ALTIVEC);
132+ if (cpu_has_feature(CPU_FTR_TM))
133+ dialect |= PPC_OPCODE_HTM;
133134
134− if (cpu_has_feature(CPU_FTRS_POWER6))
135− dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_ALTIVEC);
135+ if (cpu_has_feature(CPU_FTR_ALTIVEC))
136+ dialect |= PPC_OPCODE_ALTIVEC | PPC_OPCODE_ALTIVEC2;
136137
137− if (cpu_has_feature(CPU_FTRS_POWER7))
138− dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7
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);
138+ if (cpu_has_feature(CPU_FTR_VSX))
139+ dialect |= PPC_OPCODE_VSX | PPC_OPCODE_VSX3;
151140
152141 /* Get the major opcode of the insn. */
153142 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
6060 static void ams_i2c_remove(struct i2c_client *client);
6161
6262 static const struct i2c_device_id ams_id[] = {
63− { "MAC,accelerometer_1", 0 },
63+ { "MAC,accelerometer_1" },
6464 { }
6565 };
6666 MODULE_DEVICE_TABLE(i2c, ams_id);
drivers/macintosh/mac_hid.c+1−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/module.h>
1717 #include <linux/slab.h>
1818
19+MODULE_DESCRIPTION("Mouse button 2+3 emulation");
1920 MODULE_LICENSE("GPL");
2021
2122 static int mouse_emulate_buttons;
drivers/macintosh/therm_windtunnel.c+1−1
@@ -549,7 +549,7 @@ g4fan_exit( void ) · 548 unmodified lines
549549 platform_driver_unregister( &therm_of_driver );
550550
551551 if( x.of_dev )
552− of_device_unregister( x.of_dev );
552+ of_platform_device_destroy(&x.of_dev->dev, NULL);
553553 }
554554
555555 module_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
304304 }
305305
306306 static const struct i2c_device_id wf_ad7417_id[] = {
307− { "MAC,ad7417", 0 },
307+ { "MAC,ad7417" },
308308 { }
309309 };
310310 MODULE_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
573573 }
574574
575575 static const struct i2c_device_id wf_fcu_id[] = {
576− { "MAC,fcu", 0 },
576+ { "MAC,fcu" },
577577 { }
578578 };
579579 MODULE_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
156156 }
157157
158158 static const struct i2c_device_id wf_lm87_id[] = {
159− { "MAC,lm87cimt", 0 },
159+ { "MAC,lm87cimt" },
160160 { }
161161 };
162162 MODULE_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
112112 }
113113
114114 static const struct i2c_device_id wf_max6690_id[] = {
115− { "MAC,max6690", 0 },
115+ { "MAC,max6690" },
116116 { }
117117 };
118118 MODULE_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
333333 }
334334
335335 static const struct i2c_device_id wf_sat_id[] = {
336− { "MAC,smu-sat", 0 },
336+ { "MAC,smu-sat" },
337337 { }
338338 };
339339 MODULE_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
4040 bool disable_device)
4141 {
4242 struct pci_dev *pdev = php_slot->pdev;
43− int irq = php_slot->irq;
4443 u16 ctrl;
4544
4645 if (php_slot->irq > 0) {
@@ -59,7 +58,7 @@ static void pnv_php_disable_irq(struct pnv_php_slot *php_slot, · 12 unmodified lines
5958 php_slot->wq = NULL;
6059 }
6160
62− if (disable_device || irq > 0) {
61+ if (disable_device) {
6362 if (pdev->msix_enabled)
6463 pci_disable_msix(pdev);
6564 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
364364 if (!tbl)
365365 continue;
366366
367− tce_iommu_clear(container, tbl, tbl->it_offset, tbl->it_size);
368367 tce_iommu_free_table(container, tbl);
369368 }
370369
@@ -720,6 +719,8 @@ static long tce_iommu_remove_window(struct tce_container *container, · 349 unmodified lines
720719
721720 BUG_ON(!tbl->it_size);
722721
722+ tce_iommu_clear(container, tbl, tbl->it_offset, tbl->it_size);
723+
723724 /* Detach groups from IOMMUs */
724725 list_for_each_entry(tcegrp, &container->group_list, next) {
725726 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
738739 }
739740
740741 /* Free table */
741− tce_iommu_clear(container, tbl, tbl->it_offset, tbl->it_size);
742742 tce_iommu_free_table(container, tbl);
743743 container->tables[num] = NULL;
744744
@@ -1197,9 +1197,14 @@ static void tce_iommu_release_ownership(struct tce_container *container, · 452 unmodified lines
11971197 return;
11981198 }
11991199
1200− for (i = 0; i < IOMMU_TABLE_GROUP_MAX_TABLES; ++i)
1201− if (container->tables[i])
1200+ for (i = 0; i < IOMMU_TABLE_GROUP_MAX_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);
12021205 table_group->ops->unset_window(table_group, i);
1206+ }
1207+ }
12031208 }
12041209
12051210 static 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
2727 arch/nios2/kernel/head.o
2828 arch/openrisc/kernel/head.o
2929 arch/parisc/kernel/head.o
30−arch/powerpc/kernel/head_40x.o
3130 arch/powerpc/kernel/head_44x.o
3231 arch/powerpc/kernel/head_64.o
3332 arch/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
88 register unsigned long sp asm("esp");
99 #elif __loongarch64
1010 register unsigned long sp asm("$sp");
11−#elif __ppc__
11+#elif __powerpc__
1212 register unsigned long sp asm("r1");
1313 #elif __s390x__
1414 register 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