Skip to content

Commit d90f154

Browse files
committed
Merge remote-tracking branch 'remotes/dg-gitlab/tags/ppc-for-6.1-20210504' into staging
ppc patch queue 2021-05-04 Here's the first ppc pull request for qemu-6.1. It has a wide variety of stuff accumulated during the 6.0 freeze. Highlights are: * Multi-phase reset cleanups for PAPR * Preliminary cleanups towards allowing !CONFIG_TCG for the ppc target * Cleanup of AIL logic and extension to POWER10 * Further improvements to handling of hot unplug failures on PAPR * Allow much larger numbers of CPU on pseries * Support for the H_SCM_HEALTH hypercall * Add support for the Pegasos II board * Substantial cleanup to hflag handling * Assorted minor fixes and cleanups # gpg: Signature made Tue 04 May 2021 06:52:39 BST # gpg: using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392 # gpg: Good signature from "David Gibson <[email protected]>" [full] # gpg: aka "David Gibson (Red Hat) <[email protected]>" [full] # gpg: aka "David Gibson (ozlabs.org) <[email protected]>" [full] # gpg: aka "David Gibson (kernel.org) <[email protected]>" [unknown] # Primary key fingerprint: 75F4 6586 AE61 A66C C44E 87DC 6C38 CACA 20D9 B392 * remotes/dg-gitlab/tags/ppc-for-6.1-20210504: (46 commits) hw/ppc/pnv_psi: Use device_cold_reset() instead of device_legacy_reset() hw/ppc/spapr_vio: Reset TCE table object with device_cold_reset() hw/intc/spapr_xive: Use device_cold_reset() instead of device_legacy_reset() target/ppc: removed VSCR from SPR registration target/ppc: Reduce the size of ppc_spr_t target/ppc: Clean up _spr_register et al target/ppc: Add POWER10 exception model target/ppc: rework AIL logic in interrupt delivery target/ppc: move opcode table logic to translate.c target/ppc: code motion from translate_init.c.inc to gdbstub.c spapr_drc.c: handle hotunplug errors in drc_unisolate_logical() spapr.h: increase FDT_MAX_SIZE spapr.c: do not use MachineClass::max_cpus to limit CPUs ppc: Rename current DAWR macros and variables target/ppc: POWER10 supports scv target/ppc: Fix POWER9 radix guest HV interrupt AIL behaviour docs/system: ppc: Add documentation for ppce500 machine roms/u-boot: Bump ppce500 u-boot to v2021.04 to fix broken pci support roms/Makefile: Update ppce500 u-boot build directory name ppc/spapr: Add support for implement support for H_SCM_HEALTH ... Signed-off-by: Peter Maydell <[email protected]>
2 parents d45a527 + 4bb32cd commit d90f154

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+4010
-1198
lines changed

MAINTAINERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,16 @@ F: pc-bios/canyonlands.dt[sb]
13661366
F: pc-bios/u-boot-sam460ex-20100605.bin
13671367
F: roms/u-boot-sam460ex
13681368

1369+
pegasos2
1370+
M: BALATON Zoltan <[email protected]>
1371+
R: David Gibson <[email protected]>
1372+
1373+
S: Maintained
1374+
F: hw/ppc/pegasos2.c
1375+
F: hw/pci-host/mv64361.c
1376+
F: hw/pci-host/mv643xx.h
1377+
F: include/hw/pci-host/mv64361.h
1378+
13691379
RISC-V Machines
13701380
---------------
13711381
OpenTitan

default-configs/devices/ppc-softmmu.mak

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ CONFIG_SAM460EX=y
1414
CONFIG_MAC_OLDWORLD=y
1515
CONFIG_MAC_NEWWORLD=y
1616

17+
CONFIG_PEGASOS2=n
18+
1719
# For PReP
1820
CONFIG_PREP=y

docs/system/ppc/ppce500.rst

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
ppce500 generic platform (``ppce500``)
2+
======================================
3+
4+
QEMU for PPC supports a special ``ppce500`` machine designed for emulation and
5+
virtualization purposes.
6+
7+
Supported devices
8+
-----------------
9+
10+
The ``ppce500`` machine supports the following devices:
11+
12+
* PowerPC e500 series core (e500v2/e500mc/e5500/e6500)
13+
* Configuration, Control, and Status Register (CCSR)
14+
* Multicore Programmable Interrupt Controller (MPIC) with MSI support
15+
* 1 16550A UART device
16+
* 1 Freescale MPC8xxx I2C controller
17+
* 1 Pericom pt7c4338 RTC via I2C
18+
* 1 Freescale MPC8xxx GPIO controller
19+
* Power-off functionality via one GPIO pin
20+
* 1 Freescale MPC8xxx PCI host controller
21+
* VirtIO devices via PCI bus
22+
23+
Hardware configuration information
24+
----------------------------------
25+
26+
The ``ppce500`` machine automatically generates a device tree blob ("dtb")
27+
which it passes to the guest, if there is no ``-dtb`` option. This provides
28+
information about the addresses, interrupt lines and other configuration of
29+
the various devices in the system.
30+
31+
If users want to provide their own DTB, they can use the ``-dtb`` option.
32+
These DTBs should have the following requirements:
33+
34+
* The number of subnodes under /cpus node should match QEMU's ``-smp`` option
35+
* The /memory reg size should match QEMU’s selected ram_size via ``-m``
36+
37+
Both ``qemu-system-ppc`` and ``qemu-system-ppc64`` provide emulation for the
38+
following 32-bit PowerPC CPUs:
39+
40+
* e500v2
41+
* e500mc
42+
43+
Additionally ``qemu-system-ppc64`` provides support for the following 64-bit
44+
PowerPC CPUs:
45+
46+
* e5500
47+
* e6500
48+
49+
The CPU type can be specified via the ``-cpu`` command line. If not specified,
50+
it creates a machine with e500v2 core. The following example shows an e6500
51+
based machine creation:
52+
53+
.. code-block:: bash
54+
55+
$ qemu-system-ppc64 -nographic -M ppce500 -cpu e6500
56+
57+
Boot options
58+
------------
59+
60+
The ``ppce500`` machine can start using the standard -kernel functionality
61+
for loading a payload like an OS kernel (e.g.: Linux), or U-Boot firmware.
62+
63+
When -bios is omitted, the default pc-bios/u-boot.e500 firmware image is used
64+
as the BIOS. QEMU follows below truth table to select which payload to execute:
65+
66+
===== ========== =======
67+
-bios -kernel payload
68+
===== ========== =======
69+
N N u-boot
70+
N Y kernel
71+
Y don't care u-boot
72+
===== ========== =======
73+
74+
When both -bios and -kernel are present, QEMU loads U-Boot and U-Boot in turns
75+
automatically loads the kernel image specified by the -kernel parameter via
76+
U-Boot's built-in "bootm" command, hence a legacy uImage format is required in
77+
such senario.
78+
79+
Running Linux kernel
80+
--------------------
81+
82+
Linux mainline v5.11 release is tested at the time of writing. To build a
83+
Linux mainline kernel that can be booted by the ``ppce500`` machine in
84+
64-bit mode, simply configure the kernel using the defconfig configuration:
85+
86+
.. code-block:: bash
87+
88+
$ export ARCH=powerpc
89+
$ export CROSS_COMPILE=powerpc-linux-
90+
$ make corenet64_smp_defconfig
91+
$ make menuconfig
92+
93+
then manually select the following configuration:
94+
95+
Platform support > Freescale Book-E Machine Type > QEMU generic e500 platform
96+
97+
To boot the newly built Linux kernel in QEMU with the ``ppce500`` machine:
98+
99+
.. code-block:: bash
100+
101+
$ qemu-system-ppc64 -M ppce500 -cpu e5500 -smp 4 -m 2G \
102+
-display none -serial stdio \
103+
-kernel vmlinux \
104+
-initrd /path/to/rootfs.cpio \
105+
-append "root=/dev/ram"
106+
107+
To build a Linux mainline kernel that can be booted by the ``ppce500`` machine
108+
in 32-bit mode, use the same 64-bit configuration steps except the defconfig
109+
file should use corenet32_smp_defconfig.
110+
111+
To boot the 32-bit Linux kernel:
112+
113+
.. code-block:: bash
114+
115+
$ qemu-system-ppc{64|32} -M ppce500 -cpu e500mc -smp 4 -m 2G \
116+
-display none -serial stdio \
117+
-kernel vmlinux \
118+
-initrd /path/to/rootfs.cpio \
119+
-append "root=/dev/ram"
120+
121+
Running U-Boot
122+
--------------
123+
124+
U-Boot mainline v2021.04 release is tested at the time of writing. To build a
125+
U-Boot mainline bootloader that can be booted by the ``ppce500`` machine, use
126+
the qemu-ppce500_defconfig with similar commands as described above for Linux:
127+
128+
.. code-block:: bash
129+
130+
$ export CROSS_COMPILE=powerpc-linux-
131+
$ make qemu-ppce500_defconfig
132+
133+
You will get u-boot file in the build tree.
134+
135+
When U-Boot boots, you will notice the following if using with ``-cpu e6500``:
136+
137+
.. code-block:: none
138+
139+
CPU: Unknown, Version: 0.0, (0x00000000)
140+
Core: e6500, Version: 2.0, (0x80400020)
141+
142+
This is because we only specified a core name to QEMU and it does not have a
143+
meaningful SVR value which represents an actual SoC that integrates such core.
144+
You can specify a real world SoC device that QEMU has built-in support but all
145+
these SoCs are e500v2 based MPC85xx series, hence you cannot test anything
146+
built for P4080 (e500mc), P5020 (e5500) and T2080 (e6500).
147+
148+
By default a VirtIO standard PCI networking device is connected as an ethernet
149+
interface at PCI address 0.1.0, but we can switch that to an e1000 NIC by:
150+
151+
.. code-block:: bash
152+
153+
$ qemu-system-ppc -M ppce500 -smp 4 -m 2G \
154+
-display none -serial stdio \
155+
-bios u-boot \
156+
-nic tap,ifname=tap0,script=no,downscript=no,model=e1000

docs/system/target-ppc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ help``.
2020
ppc/embedded
2121
ppc/powermac
2222
ppc/powernv
23+
ppc/ppce500
2324
ppc/prep
2425
ppc/pseries

hw/intc/spapr_xive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@ static target_ulong h_int_reset(PowerPCCPU *cpu,
17981798
return H_PARAMETER;
17991799
}
18001800

1801-
device_legacy_reset(DEVICE(xive));
1801+
device_cold_reset(DEVICE(xive));
18021802

18031803
if (spapr_xive_in_kernel(xive)) {
18041804
Error *local_err = NULL;

0 commit comments

Comments
 (0)