1PowerNV family boards (``powernv8``, ``powernv9``, ``powernv10``) 2================================================================== 3 4PowerNV (as Non-Virtualized) is the "bare metal" platform using the 5OPAL firmware. It runs Linux on IBM and OpenPOWER systems and it can 6be used as an hypervisor OS, running KVM guests, or simply as a host 7OS. 8 9The PowerNV QEMU machine tries to emulate a PowerNV system at the 10level of the skiboot firmware, which loads the OS and provides some 11runtime services. Power Systems have a lower firmware (HostBoot) that 12does low level system initialization, like DRAM training. This is 13beyond the scope of what QEMU addresses today. 14 15Supported devices 16----------------- 17 18 * Multi processor support for POWER8, POWER8NVL and POWER9. 19 * XSCOM, serial communication sideband bus to configure chiplets. 20 * Simple LPC Controller. 21 * Processor Service Interface (PSI) Controller. 22 * Interrupt Controller, XICS (POWER8) and XIVE (POWER9) and XIVE2 (Power10). 23 * POWER8 PHB3 PCIe Host bridge and POWER9 PHB4 PCIe Host bridge. 24 * Simple OCC is an on-chip micro-controller used for power management tasks. 25 * iBT device to handle BMC communication, with the internal BMC simulator 26 provided by QEMU or an external BMC such as an Aspeed QEMU machine. 27 * PNOR containing the different firmware partitions. 28 29Missing devices 30--------------- 31 32A lot is missing, among which : 33 34 * I2C controllers (yet to be merged). 35 * NPU/NPU2/NPU3 controllers. 36 * EEH support for PCIe Host bridge controllers. 37 * NX controller. 38 * VAS controller. 39 * chipTOD (Time Of Day). 40 * Self Boot Engine (SBE). 41 * FSI bus. 42 43Firmware 44-------- 45 46The OPAL firmware (OpenPower Abstraction Layer) for OpenPower systems 47includes the runtime services ``skiboot`` and the bootloader kernel and 48initramfs ``skiroot``. Source code can be found on the `OpenPOWER account at 49GitHub <https://github.com/open-power>`_. 50 51Prebuilt images of ``skiboot`` and ``skiroot`` are made available on the 52`OpenPOWER <https://github.com/open-power/op-build/releases/>`__ site. 53 54QEMU includes a prebuilt image of ``skiboot`` which is updated when a 55more recent version is required by the models. 56 57Boot options 58------------ 59 60Here is a simple setup with one e1000e NIC : 61 62.. code-block:: bash 63 64 $ qemu-system-ppc64 -m 2G -machine powernv9 -smp 2,cores=2,threads=1 \ 65 -accel tcg,thread=single \ 66 -device e1000e,netdev=net0,mac=C0:FF:EE:00:00:02,bus=pcie.0,addr=0x0 \ 67 -netdev user,id=net0,hostfwd=::20022-:22,hostname=pnv \ 68 -kernel ./zImage.epapr \ 69 -initrd ./rootfs.cpio.xz \ 70 -nographic 71 72and a SATA disk : 73 74.. code-block:: bash 75 76 -device ich9-ahci,id=sata0,bus=pcie.1,addr=0x0 \ 77 -drive file=./ubuntu-ppc64le.qcow2,if=none,id=drive0,format=qcow2,cache=none \ 78 -device ide-hd,bus=sata0.0,unit=0,drive=drive0,id=ide,bootindex=1 \ 79 80Complex PCIe configuration 81~~~~~~~~~~~~~~~~~~~~~~~~~~ 82 83Six PHBs are defined per chip (POWER9) but no default PCI layout is 84provided (to be compatible with libvirt). One PCI device can be added 85on any of the available PCIe slots using command line options such as: 86 87.. code-block:: bash 88 89 -device e1000e,netdev=net0,mac=C0:FF:EE:00:00:02,bus=pcie.0,addr=0x0 90 -netdev bridge,id=net0,helper=/usr/libexec/qemu-bridge-helper,br=virbr0,id=hostnet0 91 92 -device megasas,id=scsi0,bus=pcie.0,addr=0x0 93 -drive file=./ubuntu-ppc64le.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none 94 -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=2 95 96Here is a full example with two different storage controllers on 97different PHBs, each with a disk, the second PHB is empty : 98 99.. code-block:: bash 100 101 $ qemu-system-ppc64 -m 2G -machine powernv9 -smp 2,cores=2,threads=1 -accel tcg,thread=single \ 102 -kernel ./zImage.epapr -initrd ./rootfs.cpio.xz -bios ./skiboot.lid \ 103 \ 104 -device megasas,id=scsi0,bus=pcie.0,addr=0x0 \ 105 -drive file=./rhel7-ppc64le.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none \ 106 -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=2 \ 107 \ 108 -device pcie-pci-bridge,id=bridge1,bus=pcie.1,addr=0x0 \ 109 \ 110 -device ich9-ahci,id=sata0,bus=bridge1,addr=0x1 \ 111 -drive file=./ubuntu-ppc64le.qcow2,if=none,id=drive0,format=qcow2,cache=none \ 112 -device ide-hd,bus=sata0.0,unit=0,drive=drive0,id=ide,bootindex=1 \ 113 -device e1000e,netdev=net0,mac=C0:FF:EE:00:00:02,bus=bridge1,addr=0x2 \ 114 -netdev bridge,helper=/usr/libexec/qemu-bridge-helper,br=virbr0,id=net0 \ 115 -device nec-usb-xhci,bus=bridge1,addr=0x7 \ 116 \ 117 -serial mon:stdio -nographic 118 119You can also use VIRTIO devices : 120 121.. code-block:: bash 122 123 -drive file=./fedora-ppc64le.qcow2,if=none,snapshot=on,id=drive0 \ 124 -device virtio-blk-pci,drive=drive0,id=blk0,bus=pcie.0 \ 125 \ 126 -netdev tap,helper=/usr/lib/qemu/qemu-bridge-helper,br=virbr0,id=netdev0 \ 127 -device virtio-net-pci,netdev=netdev0,id=net0,bus=pcie.1 \ 128 \ 129 -fsdev local,id=fsdev0,path=$HOME,security_model=passthrough \ 130 -device virtio-9p-pci,fsdev=fsdev0,mount_tag=host,bus=pcie.2 131 132Multi sockets 133~~~~~~~~~~~~~ 134 135The number of sockets is deduced from the number of CPUs and the 136number of cores. ``-smp 2,cores=1`` will define a machine with 2 137sockets of 1 core, whereas ``-smp 2,cores=2`` will define a machine 138with 1 socket of 2 cores. ``-smp 8,cores=2``, 4 sockets of 2 cores. 139 140BMC configuration 141~~~~~~~~~~~~~~~~~ 142 143OpenPOWER systems negotiate the shutdown and reboot with their 144BMC. The QEMU PowerNV machine embeds an IPMI BMC simulator using the 145iBT interface and should offer the same power features. 146 147If you want to define your own BMC, use ``-nodefaults`` and specify 148one on the command line : 149 150.. code-block:: bash 151 152 -device ipmi-bmc-sim,id=bmc0 -device isa-ipmi-bt,bmc=bmc0,irq=10 153 154The files `palmetto-SDR.bin <http://www.kaod.org/qemu/powernv/palmetto-SDR.bin>`__ 155and `palmetto-FRU.bin <http://www.kaod.org/qemu/powernv/palmetto-FRU.bin>`__ 156define a Sensor Data Record repository and a Field Replaceable Unit 157inventory for a Palmetto BMC. They can be used to extend the QEMU BMC 158simulator. 159 160.. code-block:: bash 161 162 -device ipmi-bmc-sim,sdrfile=./palmetto-SDR.bin,fruareasize=256,frudatafile=./palmetto-FRU.bin,id=bmc0 \ 163 -device isa-ipmi-bt,bmc=bmc0,irq=10 164 165The PowerNV machine can also be run with an external IPMI BMC device 166connected to a remote QEMU machine acting as BMC, using these options 167: 168 169.. code-block:: bash 170 171 -chardev socket,id=ipmi0,host=localhost,port=9002,reconnect=10 \ 172 -device ipmi-bmc-extern,id=bmc0,chardev=ipmi0 \ 173 -device isa-ipmi-bt,bmc=bmc0,irq=10 \ 174 -nodefaults 175 176NVRAM 177~~~~~ 178 179Use a MTD drive to add a PNOR to the machine, and get a NVRAM : 180 181.. code-block:: bash 182 183 -drive file=./witherspoon.pnor,format=raw,if=mtd 184 185CAVEATS 186------- 187 188 * No support for multiple HW threads (SMT=1). Same as pseries. 189 190Maintainer contact information 191------------------------------ 192 193Cédric Le Goater <clg@kaod.org> 194