From: Xiaojuan Yang <yangxiaojuan@loongson.cn>
To: qemu-devel@nongnu.org
Cc: mark.cave-ayland@ilande.co.uk, richard.henderson@linaro.org,
Song Gao <gaosong@loongson.cn>
Subject: [RFC PATCH v5 01/30] target/loongarch: Add system emulation introduction
Date: Thu, 27 Jan 2022 22:43:43 -0500 [thread overview]
Message-ID: <20220128034412.1262452-2-yangxiaojuan@loongson.cn> (raw)
In-Reply-To: <20220128034412.1262452-1-yangxiaojuan@loongson.cn>
Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
docs/system/loongarch/loongson3.rst | 78 +++++++++++++++++++++++++++++
target/loongarch/README | 28 +++++++++++
2 files changed, 106 insertions(+)
create mode 100644 docs/system/loongarch/loongson3.rst
diff --git a/docs/system/loongarch/loongson3.rst b/docs/system/loongarch/loongson3.rst
new file mode 100644
index 0000000000..1840ec5e75
--- /dev/null
+++ b/docs/system/loongarch/loongson3.rst
@@ -0,0 +1,78 @@
+loongson3-ls7a generic platform (``loongson3-ls7a``)
+====================================================
+
+Use ``loongson3-ls7a`` machine type to emulate the loongson7a board.
+There are some devices on loongson7a board, such as RTC device,
+IOAPIC device, ACPI device and so on.
+
+Supported devices
+-----------------
+
+The ``loongson3-ls7a`` machine supports:
+- PCI/PCIe devices
+- Memory device
+- CPU device
+- Ls7a host bridge
+- Ls7a RTC device
+- Ls7a IOAPIC device
+- Ls7a ACPI device
+- Fw_cfg device
+- CPU device. Type: Loongson-3A5000.
+
+CPU and machine Type
+--------------------
+
+The ``qemu-system-loongarch64`` provides emulation for loongson7a
+machine. You can specify the machine type ``loongson3-ls7a`` and
+cpu type ``Loongson-3A5000``.
+
+Boot options
+------------
+
+Now the ``loongson3-ls7a`` machine can start using -bios parameter:
+
+.. code-block:: bash
+
+ $ qemu-system-loongarch64 -M loongson3-ls7a -cpu Loongson-3A5000 -smp 2 -m 1G \
+ -display none -serial stdio \
+ -bios loongarch_bios.bini
+
+Info mtree
+----------
+address-space: memory
+ 0000000000000000-ffffffffffffffff (prio 0, i/o): system
+ 0000000000000000-ffffffffffffffff (prio 0, i/o): ls7a_mmio
+ 00000000000a0000-00000000000bffff (prio 1, i/o): cirrus-lowmem-container
+ 00000000000a0000-00000000000bffff (prio 0, i/o): cirrus-low-memory
+ 0000000000000000-000000000fffffff (prio 0, ram): alias loongarch.lowram @loongarch.ram 0000000000000000-000000000fffffff
+ 0000000010000000-00000000100000ff (prio 0, i/o): loongarch_pch_pic.reg32_part1
+ 0000000010000100-000000001000039f (prio 0, i/o): loongarch_pch_pic.reg8
+ 00000000100003a0-0000000010000fff (prio 0, i/o): loongarch_pch_pic.reg32_part2
+ 000000001001041c-000000001001041f (prio -1000, i/o): pci-dma-cfg
+ 0000000010013ffc-0000000010013fff (prio -1000, i/o): mmio fallback 1
+ 00000000100d0000-00000000100d00ff (prio 0, i/o): ls7a_pm
+ 00000000100d000c-00000000100d0013 (prio 0, i/o): acpi-evt
+ 00000000100d0014-00000000100d0017 (prio 0, i/o): acpi-cnt
+ 00000000100d0018-00000000100d001b (prio 0, i/o): acpi-tmr
+ 00000000100d0028-00000000100d002f (prio 0, i/o): acpi-gpe0
+ 00000000100d0030-00000000100d0033 (prio 0, i/o): acpi-reset
+ 00000000100d0100-00000000100d01ff (prio 0, i/o): ls7a_rtc
+ 0000000018000000-0000000018003fff (prio 0, i/o): alias isa-io @io 0000000000000000-0000000000003fff
+ 0000000018004000-000000001800ffff (prio 0, i/o): alias ls7a-pci-io @io 0000000000004000-000000000000ffff
+ 000000001a000000-000000001bffffff (prio 0, i/o): ls7a_pci_conf
+ 000000001c000000-000000001c3fffff (prio 0, rom): loongarch.bios
+ 000000001e020000-000000001e020001 (prio 0, i/o): fwcfg.ctl
+ 000000001e020008-000000001e02000f (prio 0, i/o): fwcfg.data
+ 000000001fe001e0-000000001fe001e7 (prio 0, i/o): serial
+ 0000000020000000-0000000027ffffff (prio 0, i/o): pcie-mmcfg-mmio
+ 000000002ff00000-000000002ff00007 (prio 0, i/o): loongarch_pch_msi
+ 0000000090000000-000000017fffffff (prio 0, ram): alias loongarch.highmem @loongarch.ram 0000000010000000-00000000ffffffff
+
+address-space: IOCSR
+ 0000000000000000-ffffffffffffffff (prio 0, i/o): iocsr
+ 0000000000000008-0000000000000427 (prio 0, i/o): iocsr_misc
+ 0000000000001000-00000000000010ff (prio 0, i/o): loongarch_ipi
+ 0000000000001400-00000000000014bf (prio 0, i/o): loongarch_extioi.nodetype
+ 00000000000014c0-000000000000167f (prio 0, i/o): loongarch_extioi.ipmap_enable
+ 0000000000001680-0000000000001bff (prio 0, i/o): loongarch_extioi.bounce_coreisr
+ 0000000000001c00-0000000000001cff (prio 0, i/o): loongarch_extioi.coremap
diff --git a/target/loongarch/README b/target/loongarch/README
index 383db6cc15..de44d39561 100644
--- a/target/loongarch/README
+++ b/target/loongarch/README
@@ -71,6 +71,34 @@
./qemu-loongarch64 /opt/clfs/usr/bin/pwd
...
+- System emulation
+
+ Mainly emulate a virt 3A5000 board and ls7a bridge that is not exactly the same as the host.
+ 3A5000 support multiple interrupt cascading while here we just emulate the extioi interrupt
+ cascading. LS7A1000 host bridge support multiple devices, such as sata, gmac, uart, rtc
+ and so on. But we just realize the rtc. Others use the qemu common devices. It does not affect
+ the general use. We also introduced the emulation of devices at docs/system/loongarch/loongson3.rst.
+
+ You can compile the binaries by youself or just get all required binaries from the github for testing.
+
+ 1.Download kernel and the cross-tools.(vmlinux)
+
+ https://github.com/loongson/linux/tree/loongarch-next
+ https://github.com/loongson/build-tools/releases/latest/download/loongarch64-clfs-20211202-cross-tools.tar.xz
+
+ 2.Download uefi code.(loongarch_bios.bin)
+
+ https://github.com/loongson/edk2/tree/LoongArch
+ https://github.com/loongson/edk2-platforms
+
+ 3.Download the clfs-system and make a ramdisk with busybox.(ramdisk)
+
+ 4.Run with command,eg:
+
+ ./build/qemu-system-loongarch64 -m 4G -smp 4 --cpu Loongson-3A5000 --machine loongson3-ls7a -kernel ./vmlinux -initrd ./ramdisk -append "root=/dev/ram console=ttyS0,115200 rdinit=/sbin/init loglevel=8" -monitor tcp::4000,server,nowait -nographic
+
+All binaries can get from here directly:
+ git clone https://github.com/yangxiaojuan-loongson/qemu-binary
- Note.
We can get the latest LoongArch documents or LoongArch tools at https://github.com/loongson/
--
2.27.0
next prev parent reply other threads:[~2022-01-28 3:49 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-28 3:43 [RFC PATCH v5 00/30] Add LoongArch softmmu support Xiaojuan Yang
2022-01-28 3:43 ` Xiaojuan Yang [this message]
2022-02-05 13:24 ` [RFC PATCH v5 01/30] target/loongarch: Add system emulation introduction Mark Cave-Ayland
2022-01-28 3:43 ` [RFC PATCH v5 02/30] target/loongarch: Add CSRs definition Xiaojuan Yang
2022-01-28 3:43 ` [RFC PATCH v5 03/30] target/loongarch: Add basic vmstate description of CPU Xiaojuan Yang
2022-01-28 3:43 ` [RFC PATCH v5 04/30] target/loongarch: Implement qmp_query_cpu_definitions() Xiaojuan Yang
2022-01-28 3:43 ` [RFC PATCH v5 05/30] target/loongarch: Add constant timer support Xiaojuan Yang
2022-01-28 3:43 ` [RFC PATCH v5 06/30] target/loongarch: Add MMU support for LoongArch CPU Xiaojuan Yang
2022-01-28 3:43 ` [RFC PATCH v5 07/30] target/loongarch: Add LoongArch CSR instruction Xiaojuan Yang
2022-01-28 3:43 ` [RFC PATCH v5 08/30] target/loongarch: Add LoongArch IOCSR instruction Xiaojuan Yang
2022-02-05 12:06 ` Mark Cave-Ayland
2022-01-28 3:43 ` [RFC PATCH v5 09/30] target/loongarch: Add TLB instruction support Xiaojuan Yang
2022-01-28 3:43 ` [RFC PATCH v5 10/30] target/loongarch: Add other core instructions support Xiaojuan Yang
2022-01-28 3:43 ` [RFC PATCH v5 11/30] target/loongarch: Add LoongArch interrupt and exception handle Xiaojuan Yang
2022-01-28 3:43 ` [RFC PATCH v5 12/30] target/loongarch: Add timer related instructions support Xiaojuan Yang
2022-01-28 3:43 ` [RFC PATCH v5 13/30] target/loongarch: Add gdb support Xiaojuan Yang
2022-01-28 3:43 ` [RFC PATCH v5 14/30] hw/pci-host: Add ls7a1000 PCIe Host bridge support for Loongson3 Platform Xiaojuan Yang
2022-01-28 3:43 ` [RFC PATCH v5 15/30] hw/loongarch: Add support loongson3-ls7a machine type Xiaojuan Yang
2022-01-28 3:43 ` [RFC PATCH v5 16/30] hw/loongarch: Add LoongArch cpu interrupt support(CPUINTC) Xiaojuan Yang
2022-02-05 12:13 ` Mark Cave-Ayland
2022-01-28 3:43 ` [RFC PATCH v5 17/30] hw/loongarch: Add LoongArch ipi interrupt support(IPI) Xiaojuan Yang
2022-02-05 12:22 ` Mark Cave-Ayland
2022-01-28 3:44 ` [RFC PATCH v5 18/30] hw/intc: Add LoongArch ls7a interrupt controller support(PCH-PIC) Xiaojuan Yang
2022-01-28 3:44 ` [RFC PATCH v5 19/30] hw/intc: Add LoongArch ls7a msi interrupt controller support(PCH-MSI) Xiaojuan Yang
2022-01-28 3:44 ` [RFC PATCH v5 20/30] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC) Xiaojuan Yang
2022-02-05 13:08 ` Mark Cave-Ayland
2022-01-28 3:44 ` [RFC PATCH v5 21/30] hw/loongarch: Add irq hierarchy for the system Xiaojuan Yang
2022-02-05 13:16 ` Mark Cave-Ayland
2022-01-28 3:44 ` [RFC PATCH v5 22/30] Enable common virtio pci support for LoongArch Xiaojuan Yang
2022-01-28 3:44 ` [RFC PATCH v5 23/30] hw/loongarch: Add some devices support for 3A5000 Xiaojuan Yang
2022-02-05 13:20 ` Mark Cave-Ayland
2022-01-28 3:44 ` [RFC PATCH v5 24/30] hw/loongarch: Add LoongArch ls7a rtc device support Xiaojuan Yang
2022-01-28 3:44 ` [RFC PATCH v5 25/30] hw/loongarch: Add default bios startup support Xiaojuan Yang
2022-01-28 3:44 ` [RFC PATCH v5 26/30] hw/loongarch: Add -kernel and -initrd options support Xiaojuan Yang
2022-01-28 3:44 ` [RFC PATCH v5 27/30] hw/loongarch: Add LoongArch smbios support Xiaojuan Yang
2022-01-28 3:44 ` [RFC PATCH v5 28/30] hw/loongarch: Add LoongArch acpi support Xiaojuan Yang
2022-01-28 3:44 ` [RFC PATCH v5 29/30] hw/loongarch: Add fdt support Xiaojuan Yang
2022-01-28 3:44 ` [RFC PATCH v5 30/30] tests/tcg/loongarch64: Add hello/memory test in loongarch64 system Xiaojuan Yang
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=20220128034412.1262452-2-yangxiaojuan@loongson.cn \
--to=yangxiaojuan@loongson.cn \
--cc=gaosong@loongson.cn \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).