All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 38/38] doc: Add a reST document for qemu-ppce500
Date: Thu, 18 Feb 2021 23:58:06 +0800	[thread overview]
Message-ID: <1613663886-83811-39-git-send-email-bmeng.cn@gmail.com> (raw)
In-Reply-To: <1613663886-83811-1-git-send-email-bmeng.cn@gmail.com>

Add a reST document to describe how to build and run U-Boot for
the QEMU ppce500 machine.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

---

Changes in v2:
- add descriptions for VirtIO BLK, RTC and power off

 doc/board/emulation/index.rst        |  1 +
 doc/board/emulation/qemu-ppce500.rst | 88 ++++++++++++++++++++++++++++++++++++
 2 files changed, 89 insertions(+)
 create mode 100644 doc/board/emulation/qemu-ppce500.rst

diff --git a/doc/board/emulation/index.rst b/doc/board/emulation/index.rst
index a09ead1..be66b6b 100644
--- a/doc/board/emulation/index.rst
+++ b/doc/board/emulation/index.rst
@@ -8,6 +8,7 @@ Emulation
 
    qemu-arm
    qemu-mips
+   qemu-ppce500
    qemu-riscv
    qemu-x86
    qemu_capsule_update
diff --git a/doc/board/emulation/qemu-ppce500.rst b/doc/board/emulation/qemu-ppce500.rst
new file mode 100644
index 0000000..0a5c86c
--- /dev/null
+++ b/doc/board/emulation/qemu-ppce500.rst
@@ -0,0 +1,88 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. Copyright (C) 2021, Bin Meng <bmeng.cn@gmail.com>
+
+QEMU PPC E500
+=============
+
+QEMU for PPC supports a special 'ppce500' machine designed for emulation and
+virtualization purposes. This document describes how to run U-Boot under it.
+
+The QEMU ppce500 machine models a generic PowerPC E500 virtual machine with
+support for the VirtIO standard networking device connected to the built-in
+PCI host controller. Some common devices in the CCSBAR space are modeled,
+including MPIC, 16550A UART devices, GPIO, I2C and PCI host controller with
+MSI delivery to MPIC. It uses device-tree to pass configuration information
+to guest software.
+
+Building U-Boot
+---------------
+Set the CROSS_COMPILE environment variable as usual, and run::
+
+    $ make qemu-ppce500_defconfig
+    $ make
+
+Running U-Boot
+--------------
+The minimal QEMU command line to get U-Boot up and running is::
+
+    $ qemu-system-ppc -nographic -machine ppce500 -bios u-boot
+
+You can also run U-Boot using 'qemu-system-ppc64'::
+
+    $ qemu-system-ppc64 -nographic -machine ppce500 -bios u-boot
+
+The commands above create a target with 128 MiB memory by default. A freely
+configurable amount of RAM can be created via the '-m' parameter. For example,
+'-m 2G' creates 2 GiB memory for the target, and the memory node in the
+embedded DTB created by QEMU reflects the new setting.
+
+Both qemu-system-ppc and qemu-system-ppc64 provide emulation for the following
+32-bit PowerPC CPUs:
+
+* e500v2
+* e500mc
+
+Additionally qemu-system-ppc64 provides support for the following 64-bit CPUs:
+
+* e5500
+* e6500
+
+The CPU type can be specified via the '-cpu' command line. If not specified,
+it creates a machine with e500v2 core. The following example shows an e6500
+based machine creation::
+
+    $ qemu-system-ppc64 -nographic -machine ppce500 -cpu e6500 -bios u-boot
+
+When U-Boot boots, you will notice the following::
+
+    CPU:   Unknown, Version: 0.0, (0x00000000)
+    Core:  e6500, Version: 2.0, (0x80400020)
+
+This is because we only specified a core name to QEMU and it does not have a
+meaningful SVR value which represents an actual SoC that integrates such core.
+You can specify a real world SoC device that QEMU has built-in support but all
+these SoCs are e500v2 based MPC85xx series, hence you cannot test anything
+built for P4080 (e500mc), P5020 (e5500) and T2080 (e6500).
+
+By default a VirtIO standard PCI networking device is connected as an ethernet
+interface at PCI address 0.1.0, but we can switch that to an e1000 NIC by::
+
+    $ qemu-system-ppc -nographic -machine ppce500 -bios u-boot \
+                      -nic tap,ifname=tap0,script=no,downscript=no,model=e1000
+
+VirtIO BLK driver is also enabled to support booting from a disk image where
+a kernel image is stored. Append the following to QEMU::
+
+    -drive file=disk.img,format=raw,id=disk0 -device virtio-blk-pci,drive=disk0
+
+Pericom pt7c4338 RTC is supported so we can use the 'date' command::
+
+    => date
+    Date: 2021-02-18 (Thursday)    Time: 15:33:20
+
+Additionally, 'poweroff' command is supported to shut down the QEMU session::
+
+    => poweroff
+    poweroff ...
+
+These have been tested in QEMU 5.2.0.
-- 
2.7.4

  parent reply	other threads:[~2021-02-18 15:58 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18 15:57 [PATCH v2 00/38] ppc: qemu: Convert qemu-ppce500 to driver model and enable additional driver support Bin Meng
2021-02-18 15:57 ` Bin Meng
2021-02-18 15:57 ` [PATCH v2 01/38] pci: fsl_pci_init: Dynamically allocate the PCI regions Bin Meng
2021-02-20 11:54   ` Simon Glass
2021-02-20 13:57     ` Tom Rini
2021-02-18 15:57 ` [PATCH v2 02/38] ppc: qemu: Update MAINTAINERS for correct email address Bin Meng
2021-02-22  7:39   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 03/38] common: fdt_support: Support special case of PCI address in fdt_read_prop() Bin Meng
2021-02-20 11:54   ` Simon Glass
2021-02-20 13:03     ` Bin Meng
2021-02-22  7:42   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 04/38] ppc: qemu: Support non-identity PCI bus address Bin Meng
2021-02-18 15:57 ` [PATCH v2 05/38] ppc: qemu: Fix CONFIG_SYS_PCI_MAP_END Bin Meng
2021-02-22  7:47   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 06/38] ppc: mpc85xx: Wrap LAW related codes with CONFIG_FSL_LAW Bin Meng
2021-02-22  8:12   ` Priyanka Jain
2021-02-22  8:53     ` Bin Meng
2021-02-23 10:43       ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 07/38] ppc: qemu: Drop init_laws() and print_laws() Bin Meng
2021-02-18 15:57 ` [PATCH v2 08/38] ppc: qemu: Drop board_early_init_f() Bin Meng
2021-02-22  8:14   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 09/38] ppc: qemu: Enable OF_CONTROL Bin Meng
2021-02-22  8:14   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 10/38] ppc: qemu: Enable driver model Bin Meng
2021-02-22  8:14   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 11/38] include: Remove extern from addr_map.h Bin Meng
2021-02-22  8:16   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 12/38] lib: addr_map: Move address_map[] type to the header file Bin Meng
2021-02-22  8:17   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 13/38] cmd: Add a command to display the address map Bin Meng
2021-02-20 11:54   ` Simon Glass
2021-02-22  8:18   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 14/38] test: cmd: Add a basic test for 'addrmap' command Bin Meng
2021-02-20 11:54   ` Simon Glass
2021-02-20 13:01     ` Bin Meng
2021-02-21 16:24       ` Simon Glass
2021-02-22  1:55         ` Bin Meng
2021-02-22  9:20           ` Simon Glass
2021-02-22 12:13             ` Bin Meng
2021-02-22 14:00             ` Tom Rini
2021-02-18 15:57 ` [PATCH v2 15/38] lib: kconfig: Mention CONFIG_ADDR_MAP limitation in the help Bin Meng
2021-02-22  8:19   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 16/38] ppc: io.h: Use addrmap_ translation APIs only in post-relocation phase Bin Meng
2021-02-22  8:55   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 17/38] common: Move initr_addr_map() to a bit earlier Bin Meng
2021-02-22  9:05   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 18/38] ppc: qemu: Switch over to use DM serial Bin Meng
2021-02-22  9:05   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 19/38] pci: mpc85xx: Wrap LAW programming with CONFIG_FSL_LAW Bin Meng
2021-02-21  7:06   ` Heiko Schocher
2021-02-22  9:06   ` Priyanka Jain
2021-02-22 12:10     ` Bin Meng
2021-02-23 10:43       ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 20/38] pci: mpc85xx: Support controller register physical address beyond 32-bit Bin Meng
2021-02-21  7:06   ` Heiko Schocher
2021-02-22  9:07   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 21/38] pci: mpc85xx: Support 64-bit bus and cpu address Bin Meng
2021-02-21  7:06   ` Heiko Schocher
2021-02-18 15:57 ` [PATCH v2 22/38] ppc: qemu: Switch over to use DM ETH and PCI Bin Meng
2021-02-20 11:54   ` Simon Glass
2021-02-22  9:12   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 23/38] ppc: qemu: Drop CONFIG_OF_BOARD_SETUP Bin Meng
2021-02-18 15:57 ` [PATCH v2 24/38] cmd: Fix virtio command dependency Bin Meng
2021-02-22  9:13   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 25/38] ppc: qemu: Enable VirtIO NET support Bin Meng
2021-02-22  9:13   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 26/38] virtio: Fix VirtIO BLK driver dependency Bin Meng
2021-02-20 11:54   ` Simon Glass
2021-02-22  9:13   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 27/38] ppc: qemu: Enable VirtIO BLK support Bin Meng
2021-02-22  9:13   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 28/38] ppc: mpc85xx: Add 'gpibe' register to 'struct ccsr_gpio' Bin Meng
2021-02-22  9:13   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 29/38] gpio: mpc8xxx: Support controller register physical address beyond 32-bit Bin Meng
2021-02-22  9:13   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 30/38] ppc: qemu: Enable GPIO support Bin Meng
2021-02-22  9:13   ` Priyanka Jain
2021-02-18 15:57 ` [PATCH v2 31/38] dm: sysreset: Add a Kconfig option for the 'reset' command Bin Meng
2021-02-20 11:55   ` Simon Glass
2021-02-22  9:15   ` Priyanka Jain
2021-02-18 15:58 ` [PATCH v2 32/38] ppc: qemu: Enable support for power off via GPIO Bin Meng
2021-02-22  9:15   ` Priyanka Jain
2021-02-18 15:58 ` [PATCH v2 33/38] ppc: qemu: Enable RTC support via I2C Bin Meng
2021-02-22  9:15   ` Priyanka Jain
2021-02-18 15:58 ` [PATCH v2 34/38] ppc: qemu: Delete the temporary FDT virtual-physical mapping after U-Boot is relocated Bin Meng
2021-02-22  9:16   ` Priyanka Jain
2021-02-18 15:58 ` [PATCH v2 35/38] ppc: qemu: Drop a custom env variable 'fdt_addr_r' Bin Meng
2021-02-22  9:16   ` Priyanka Jain
2021-02-18 15:58 ` [PATCH v2 36/38] ppc: qemu: Drop fixed_sdram() Bin Meng
2021-02-22  9:16   ` Priyanka Jain
2021-02-18 15:58 ` [PATCH v2 37/38] ppc: qemu: Move board directory from board/freescale to board/emulation Bin Meng
2021-02-22  9:18   ` Priyanka Jain
2021-02-18 15:58 ` Bin Meng [this message]
2021-02-22  9:18   ` [PATCH v2 38/38] doc: Add a reST document for qemu-ppce500 Priyanka Jain
2021-02-19  1:29 ` [PATCH v2 00/38] ppc: qemu: Convert qemu-ppce500 to driver model and enable additional driver support Bin Meng
2021-02-19  1:29   ` Bin Meng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1613663886-83811-39-git-send-email-bmeng.cn@gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.