* [PATCH v7 0/3] Add emulation of AmigaOne XE board
@ 2023-10-27 11:54 BALATON Zoltan
2023-10-27 11:54 ` [PATCH v7 1/3] hw/pci-host: Add emulation of Mai Logic Articia S BALATON Zoltan
` (6 more replies)
0 siblings, 7 replies; 30+ messages in thread
From: BALATON Zoltan @ 2023-10-27 11:54 UTC (permalink / raw)
To: qemu-devel, qemu-ppc
Cc: Nicholas Piggin, Daniel Henrique Barboza, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
Changes in v7:
- Increase default memory size to 512m to match pegasos2 and sam460ex
and it's a better default for AmigaOS
Changes in v6:
- Dropped patch 1, now it's
Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
([PATCH v2 0/3] ide: implement simple legacy/native mode switching for PCI IDE controllers)
- Added Tested-by from Rene
Changes in v5:
- Fixed avocado test
Changes in v4:
- Found typo in comment in patch 1 so ended up rewording it again
trying to make it more concise. Also take the idea of using
range_covers_byte from Mark's patch
- Added RFC patch for avocado test (untested, I don't have Avocado)
Changes in v3:
- Update values, comment and commit message in patch 1 again
Changes in v2:
- Update comment and commit message in patch 1 (Mark)
- Fix irq mapping in patch 2 (Volker)
Regards,
BALATON Zoltan
BALATON Zoltan (3):
hw/pci-host: Add emulation of Mai Logic Articia S
hw/ppc: Add emulation of AmigaOne XE board
tests/avocado: Add test for amigaone board
MAINTAINERS | 8 +
configs/devices/ppc-softmmu/default.mak | 1 +
hw/pci-host/Kconfig | 5 +
hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
hw/pci-host/meson.build | 2 +
hw/ppc/Kconfig | 7 +
hw/ppc/amigaone.c | 164 +++++++++++++
hw/ppc/meson.build | 2 +
include/hw/pci-host/articia.h | 17 ++
tests/avocado/ppc_amiga.py | 38 +++
10 files changed, 537 insertions(+)
create mode 100644 hw/pci-host/articia.c
create mode 100644 hw/ppc/amigaone.c
create mode 100644 include/hw/pci-host/articia.h
create mode 100644 tests/avocado/ppc_amiga.py
--
2.30.9
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH v7 1/3] hw/pci-host: Add emulation of Mai Logic Articia S
2023-10-27 11:54 [PATCH v7 0/3] Add emulation of AmigaOne XE board BALATON Zoltan
@ 2023-10-27 11:54 ` BALATON Zoltan
2023-11-07 18:53 ` Daniel Henrique Barboza
2023-10-27 11:54 ` [PATCH v7 2/3] hw/ppc: Add emulation of AmigaOne XE board BALATON Zoltan
` (5 subsequent siblings)
6 siblings, 1 reply; 30+ messages in thread
From: BALATON Zoltan @ 2023-10-27 11:54 UTC (permalink / raw)
To: qemu-devel, qemu-ppc
Cc: Nicholas Piggin, Daniel Henrique Barboza, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
The Articia S is a generic chipset supporting several different CPUs
that were among others used on some PPC boards. This is a minimal
emulation of the parts needed for emulating the AmigaOne board.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Tested-by: Rene Engel <ReneEngel80@emailn.de>
---
hw/pci-host/Kconfig | 5 +
hw/pci-host/articia.c | 293 ++++++++++++++++++++++++++++++++++
hw/pci-host/meson.build | 2 +
include/hw/pci-host/articia.h | 17 ++
4 files changed, 317 insertions(+)
create mode 100644 hw/pci-host/articia.c
create mode 100644 include/hw/pci-host/articia.h
diff --git a/hw/pci-host/Kconfig b/hw/pci-host/Kconfig
index 54a609d2ca..f046d76a68 100644
--- a/hw/pci-host/Kconfig
+++ b/hw/pci-host/Kconfig
@@ -73,6 +73,11 @@ config SH_PCI
bool
select PCI
+config ARTICIA
+ bool
+ select PCI
+ select I8259
+
config MV64361
bool
select PCI
diff --git a/hw/pci-host/articia.c b/hw/pci-host/articia.c
new file mode 100644
index 0000000000..f3fcc49f81
--- /dev/null
+++ b/hw/pci-host/articia.c
@@ -0,0 +1,293 @@
+/*
+ * Mai Logic Articia S emulation
+ *
+ * Copyright (c) 2023 BALATON Zoltan
+ *
+ * This work is licensed under the GNU GPL license version 2 or later.
+ *
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/log.h"
+#include "qapi/error.h"
+#include "hw/pci/pci_device.h"
+#include "hw/pci/pci_host.h"
+#include "hw/irq.h"
+#include "hw/i2c/bitbang_i2c.h"
+#include "hw/intc/i8259.h"
+#include "hw/pci-host/articia.h"
+
+/*
+ * This is a minimal emulation of this chip as used in AmigaOne board.
+ * Most features are missing but those are not needed by firmware and guests.
+ */
+
+OBJECT_DECLARE_SIMPLE_TYPE(ArticiaState, ARTICIA)
+
+OBJECT_DECLARE_SIMPLE_TYPE(ArticiaHostState, ARTICIA_PCI_HOST)
+struct ArticiaHostState {
+ PCIDevice parent_obj;
+
+ ArticiaState *as;
+};
+
+/* TYPE_ARTICIA */
+
+struct ArticiaState {
+ PCIHostState parent_obj;
+
+ qemu_irq irq[PCI_NUM_PINS];
+ MemoryRegion io;
+ MemoryRegion mem;
+ MemoryRegion reg;
+
+ bitbang_i2c_interface smbus;
+ uint32_t gpio; /* bits 0-7 in, 8-15 out, 16-23 direction (0 in, 1 out) */
+ hwaddr gpio_base;
+ MemoryRegion gpio_reg;
+};
+
+static uint64_t articia_gpio_read(void *opaque, hwaddr addr, unsigned int size)
+{
+ ArticiaState *s = opaque;
+
+ return (s->gpio >> (addr * 8)) & 0xff;
+}
+
+static void articia_gpio_write(void *opaque, hwaddr addr, uint64_t val,
+ unsigned int size)
+{
+ ArticiaState *s = opaque;
+ uint32_t sh = addr * 8;
+
+ if (addr == 0) {
+ /* in bits read only? */
+ return;
+ }
+
+ if ((s->gpio & (0xff << sh)) != (val & 0xff) << sh) {
+ s->gpio &= ~(0xff << sh | 0xff);
+ s->gpio |= (val & 0xff) << sh;
+ s->gpio |= bitbang_i2c_set(&s->smbus, BITBANG_I2C_SDA,
+ s->gpio & BIT(16) ?
+ !!(s->gpio & BIT(8)) : 1);
+ if ((s->gpio & BIT(17))) {
+ s->gpio &= ~BIT(0);
+ s->gpio |= bitbang_i2c_set(&s->smbus, BITBANG_I2C_SCL,
+ !!(s->gpio & BIT(9)));
+ }
+ }
+}
+
+static const MemoryRegionOps articia_gpio_ops = {
+ .read = articia_gpio_read,
+ .write = articia_gpio_write,
+ .valid.min_access_size = 1,
+ .valid.max_access_size = 1,
+ .endianness = DEVICE_LITTLE_ENDIAN,
+};
+
+static uint64_t articia_reg_read(void *opaque, hwaddr addr, unsigned int size)
+{
+ ArticiaState *s = opaque;
+ uint64_t ret = UINT_MAX;
+
+ switch (addr) {
+ case 0xc00cf8:
+ ret = pci_host_conf_le_ops.read(PCI_HOST_BRIDGE(s), 0, size);
+ break;
+ case 0xe00cfc ... 0xe00cff:
+ ret = pci_host_data_le_ops.read(PCI_HOST_BRIDGE(s), addr - 0xe00cfc, size);
+ break;
+ case 0xf00000:
+ ret = pic_read_irq(isa_pic);
+ break;
+ default:
+ qemu_log_mask(LOG_UNIMP, "%s: Unimplemented register read 0x%"
+ HWADDR_PRIx " %d\n", __func__, addr, size);
+ break;
+ }
+ return ret;
+}
+
+static void articia_reg_write(void *opaque, hwaddr addr, uint64_t val,
+ unsigned int size)
+{
+ ArticiaState *s = opaque;
+
+ switch (addr) {
+ case 0xc00cf8:
+ pci_host_conf_le_ops.write(PCI_HOST_BRIDGE(s), 0, val, size);
+ break;
+ case 0xe00cfc ... 0xe00cff:
+ pci_host_data_le_ops.write(PCI_HOST_BRIDGE(s), addr, val, size);
+ break;
+ default:
+ qemu_log_mask(LOG_UNIMP, "%s: Unimplemented register write 0x%"
+ HWADDR_PRIx " %d <- %"PRIx64"\n", __func__, addr, size, val);
+ break;
+ }
+}
+
+static const MemoryRegionOps articia_reg_ops = {
+ .read = articia_reg_read,
+ .write = articia_reg_write,
+ .valid.min_access_size = 1,
+ .valid.max_access_size = 4,
+ .endianness = DEVICE_LITTLE_ENDIAN,
+};
+
+static void articia_pcihost_set_irq(void *opaque, int n, int level)
+{
+ ArticiaState *s = opaque;
+ qemu_set_irq(s->irq[n], level);
+}
+
+/*
+ * AmigaOne SE PCI slot to IRQ routing
+ *
+ * repository: https://source.denx.de/u-boot/custodians/u-boot-avr32.git
+ * refspec: v2010.06
+ * file: board/MAI/AmigaOneG3SE/articiaS_pci.c
+ */
+static int amigaone_pcihost_bus0_map_irq(PCIDevice *pdev, int pin)
+{
+ int devfn_slot = PCI_SLOT(pdev->devfn);
+
+ switch (devfn_slot) {
+ case 6: /* On board ethernet */
+ return 3;
+ case 7: /* South bridge */
+ return pin;
+ default: /* PCI Slot 1 Devfn slot 8, Slot 2 Devfn 9, Slot 3 Devfn 10 */
+ return pci_swizzle(devfn_slot, pin);
+ }
+
+}
+
+static void articia_realize(DeviceState *dev, Error **errp)
+{
+ ArticiaState *s = ARTICIA(dev);
+ PCIHostState *h = PCI_HOST_BRIDGE(dev);
+ PCIDevice *pdev;
+
+ bitbang_i2c_init(&s->smbus, i2c_init_bus(dev, "smbus"));
+ memory_region_init_io(&s->gpio_reg, OBJECT(s), &articia_gpio_ops, s,
+ TYPE_ARTICIA, 4);
+
+ memory_region_init(&s->mem, OBJECT(dev), "pci-mem", UINT64_MAX);
+ memory_region_init(&s->io, OBJECT(dev), "pci-io", 0xc00000);
+ memory_region_init_io(&s->reg, OBJECT(s), &articia_reg_ops, s,
+ TYPE_ARTICIA, 0x1000000);
+ memory_region_add_subregion_overlap(&s->reg, 0, &s->io, 1);
+
+ /* devfn_min is 8 that matches first PCI slot in AmigaOne */
+ h->bus = pci_register_root_bus(dev, NULL, articia_pcihost_set_irq,
+ amigaone_pcihost_bus0_map_irq, dev, &s->mem,
+ &s->io, PCI_DEVFN(8, 0), 4, TYPE_PCI_BUS);
+ pdev = pci_create_simple_multifunction(h->bus, PCI_DEVFN(0, 0),
+ TYPE_ARTICIA_PCI_HOST);
+ ARTICIA_PCI_HOST(pdev)->as = s;
+ pci_create_simple(h->bus, PCI_DEVFN(0, 1), TYPE_ARTICIA_PCI_BRIDGE);
+
+ sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->reg);
+ sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mem);
+ qdev_init_gpio_out(dev, s->irq, ARRAY_SIZE(s->irq));
+}
+
+static void articia_class_init(ObjectClass *klass, void *data)
+{
+ DeviceClass *dc = DEVICE_CLASS(klass);
+
+ dc->realize = articia_realize;
+ set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
+}
+
+/* TYPE_ARTICIA_PCI_HOST */
+
+static void articia_pci_host_cfg_write(PCIDevice *d, uint32_t addr,
+ uint32_t val, int len)
+{
+ ArticiaState *s = ARTICIA_PCI_HOST(d)->as;
+
+ pci_default_write_config(d, addr, val, len);
+ switch (addr) {
+ case 0x40:
+ s->gpio_base = val;
+ break;
+ case 0x44:
+ if (val != 0x11) {
+ /* FIXME what do the bits actually mean? */
+ break;
+ }
+ if (memory_region_is_mapped(&s->gpio_reg)) {
+ memory_region_del_subregion(&s->io, &s->gpio_reg);
+ }
+ memory_region_add_subregion(&s->io, s->gpio_base + 0x38, &s->gpio_reg);
+ break;
+ }
+}
+
+static void articia_pci_host_class_init(ObjectClass *klass, void *data)
+{
+ DeviceClass *dc = DEVICE_CLASS(klass);
+ PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+ k->config_write = articia_pci_host_cfg_write;
+ k->vendor_id = 0x10cc;
+ k->device_id = 0x0660;
+ k->class_id = PCI_CLASS_BRIDGE_HOST;
+ /*
+ * PCI-facing part of the host bridge,
+ * not usable without the host-facing part
+ */
+ dc->user_creatable = false;
+}
+
+/* TYPE_ARTICIA_PCI_BRIDGE */
+
+static void articia_pci_bridge_class_init(ObjectClass *klass, void *data)
+{
+ DeviceClass *dc = DEVICE_CLASS(klass);
+ PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+ k->vendor_id = 0x10cc;
+ k->device_id = 0x0661;
+ k->class_id = PCI_CLASS_BRIDGE_HOST;
+ /*
+ * PCI-facing part of the host bridge,
+ * not usable without the host-facing part
+ */
+ dc->user_creatable = false;
+}
+
+static const TypeInfo articia_types[] = {
+ {
+ .name = TYPE_ARTICIA,
+ .parent = TYPE_PCI_HOST_BRIDGE,
+ .instance_size = sizeof(ArticiaState),
+ .class_init = articia_class_init,
+ },
+ {
+ .name = TYPE_ARTICIA_PCI_HOST,
+ .parent = TYPE_PCI_DEVICE,
+ .instance_size = sizeof(ArticiaHostState),
+ .class_init = articia_pci_host_class_init,
+ .interfaces = (InterfaceInfo[]) {
+ { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+ { },
+ },
+ },
+ {
+ .name = TYPE_ARTICIA_PCI_BRIDGE,
+ .parent = TYPE_PCI_DEVICE,
+ .instance_size = sizeof(PCIDevice),
+ .class_init = articia_pci_bridge_class_init,
+ .interfaces = (InterfaceInfo[]) {
+ { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+ { },
+ },
+ },
+};
+
+DEFINE_TYPES(articia_types)
diff --git a/hw/pci-host/meson.build b/hw/pci-host/meson.build
index f891f026cb..de7bfb5a62 100644
--- a/hw/pci-host/meson.build
+++ b/hw/pci-host/meson.build
@@ -20,6 +20,8 @@ pci_ss.add(when: 'CONFIG_GRACKLE_PCI', if_true: files('grackle.c'))
pci_ss.add(when: 'CONFIG_UNIN_PCI', if_true: files('uninorth.c'))
# PowerPC E500 boards
pci_ss.add(when: 'CONFIG_PPCE500_PCI', if_true: files('ppce500.c'))
+# AmigaOne
+pci_ss.add(when: 'CONFIG_ARTICIA', if_true: files('articia.c'))
# Pegasos2
pci_ss.add(when: 'CONFIG_MV64361', if_true: files('mv64361.c'))
diff --git a/include/hw/pci-host/articia.h b/include/hw/pci-host/articia.h
new file mode 100644
index 0000000000..529c240274
--- /dev/null
+++ b/include/hw/pci-host/articia.h
@@ -0,0 +1,17 @@
+/*
+ * Mai Logic Articia S emulation
+ *
+ * Copyright (c) 2023 BALATON Zoltan
+ *
+ * This work is licensed under the GNU GPL license version 2 or later.
+ *
+ */
+
+#ifndef ARTICIA_H
+#define ARTICIA_H
+
+#define TYPE_ARTICIA "articia"
+#define TYPE_ARTICIA_PCI_HOST "articia-pci-host"
+#define TYPE_ARTICIA_PCI_BRIDGE "articia-pci-bridge"
+
+#endif
--
2.30.9
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v7 2/3] hw/ppc: Add emulation of AmigaOne XE board
2023-10-27 11:54 [PATCH v7 0/3] Add emulation of AmigaOne XE board BALATON Zoltan
2023-10-27 11:54 ` [PATCH v7 1/3] hw/pci-host: Add emulation of Mai Logic Articia S BALATON Zoltan
@ 2023-10-27 11:54 ` BALATON Zoltan
2023-11-07 18:21 ` [PATCH v8 " BALATON Zoltan
2023-10-27 11:54 ` [PATCH v7 3/3] tests/avocado: Add test for amigaone board BALATON Zoltan
` (4 subsequent siblings)
6 siblings, 1 reply; 30+ messages in thread
From: BALATON Zoltan @ 2023-10-27 11:54 UTC (permalink / raw)
To: qemu-devel, qemu-ppc
Cc: Nicholas Piggin, Daniel Henrique Barboza, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
The AmigaOne is a rebranded MAI Teron board that uses U-Boot firmware
with patches to support AmigaOS and is very similar to pegasos2 so can
be easily emulated sharing most code with pegasos2. The reason to
emulate it is that AmigaOS comes in different versions for AmigaOne
and PegasosII which only have drivers for one machine and firmware so
these only run on the specific machine. Adding this board allows
another AmigaOS version to be used reusing already existing peagasos2
emulation. (The AmigaOne was the first of these boards so likely most
widespread which then inspired Pegasos that was later replaced with
PegasosII due to problems with Articia S, so these have a lot of
similarity. Pegasos mainly ran MorphOS while the PegasosII version of
AmigaOS was added later and therefore less common than the AmigaOne
version.)
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Tested-by: Rene Engel <ReneEngel80@emailn.de>
---
MAINTAINERS | 8 ++
configs/devices/ppc-softmmu/default.mak | 1 +
hw/ppc/Kconfig | 7 +
hw/ppc/amigaone.c | 164 ++++++++++++++++++++++++
hw/ppc/meson.build | 2 +
5 files changed, 182 insertions(+)
create mode 100644 hw/ppc/amigaone.c
diff --git a/MAINTAINERS b/MAINTAINERS
index cd8d6b140f..ceaa55c555 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1535,6 +1535,14 @@ F: hw/pci-host/mv64361.c
F: hw/pci-host/mv643xx.h
F: include/hw/pci-host/mv64361.h
+amigaone
+M: BALATON Zoltan <balaton@eik.bme.hu>
+L: qemu-ppc@nongnu.org
+S: Maintained
+F: hw/ppc/amigaone.c
+F: hw/pci-host/articia.c
+F: include/hw/pci-host/articia.h
+
Virtual Open Firmware (VOF)
M: Alexey Kardashevskiy <aik@ozlabs.ru>
R: David Gibson <david@gibson.dropbear.id.au>
diff --git a/configs/devices/ppc-softmmu/default.mak b/configs/devices/ppc-softmmu/default.mak
index a887f5438b..b85fd2bcd7 100644
--- a/configs/devices/ppc-softmmu/default.mak
+++ b/configs/devices/ppc-softmmu/default.mak
@@ -14,6 +14,7 @@ CONFIG_SAM460EX=y
CONFIG_MAC_OLDWORLD=y
CONFIG_MAC_NEWWORLD=y
+CONFIG_AMIGAONE=y
CONFIG_PEGASOS2=y
# For PReP
diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
index 5dfbf47ef5..56f0475a8e 100644
--- a/hw/ppc/Kconfig
+++ b/hw/ppc/Kconfig
@@ -69,6 +69,13 @@ config SAM460EX
select USB_OHCI
select FDT_PPC
+config AMIGAONE
+ bool
+ imply ATI_VGA
+ select ARTICIA
+ select VT82C686
+ select SMBUS_EEPROM
+
config PEGASOS2
bool
imply ATI_VGA
diff --git a/hw/ppc/amigaone.c b/hw/ppc/amigaone.c
new file mode 100644
index 0000000000..f26970c261
--- /dev/null
+++ b/hw/ppc/amigaone.c
@@ -0,0 +1,164 @@
+/*
+ * QEMU Eyetech AmigaOne/Mai Logic Teron emulation
+ *
+ * Copyright (c) 2023 BALATON Zoltan
+ *
+ * This work is licensed under the GNU GPL license version 2 or later.
+ *
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/units.h"
+#include "qemu/datadir.h"
+#include "qemu/log.h"
+#include "qemu/error-report.h"
+#include "qapi/error.h"
+#include "hw/ppc/ppc.h"
+#include "hw/boards.h"
+#include "hw/loader.h"
+#include "hw/pci-host/articia.h"
+#include "hw/isa/vt82c686.h"
+#include "hw/ide/pci.h"
+#include "hw/i2c/smbus_eeprom.h"
+#include "hw/ppc/ppc.h"
+#include "sysemu/reset.h"
+#include "kvm_ppc.h"
+
+#define BUS_FREQ_HZ 100000000
+
+/*
+ * Firmware binary available at
+ * https://www.hyperion-entertainment.com/index.php/downloads?view=files&parent=28
+ * then "tail -c 524288 updater.image >u-boot-amigaone.bin"
+ *
+ * BIOS emulator in firmware cannot run QEMU vgabios and hangs on it, use
+ * -device VGA,romfile=VGABIOS-lgpl-latest.bin
+ * from http://www.nongnu.org/vgabios/ instead.
+ */
+#define PROM_FILENAME "u-boot-amigaone.bin"
+#define PROM_ADDR 0xfff00000
+#define PROM_SIZE (512 * KiB)
+
+static void amigaone_cpu_reset(void *opaque)
+{
+ PowerPCCPU *cpu = opaque;
+
+ cpu_reset(CPU(cpu));
+ cpu_ppc_tb_reset(&cpu->env);
+}
+
+static void fix_spd_data(uint8_t *spd)
+{
+ uint32_t bank_size = 4 * MiB * spd[31];
+ uint32_t rows = bank_size / spd[13] / spd[17];
+ spd[3] = ctz32(rows) - spd[4];
+}
+
+static void amigaone_init(MachineState *machine)
+{
+ PowerPCCPU *cpu;
+ CPUPPCState *env;
+ MemoryRegion *rom, *pci_mem, *mr;
+ const char *fwname = machine->firmware ?: PROM_FILENAME;
+ char *filename;
+ ssize_t sz;
+ PCIBus *pci_bus;
+ Object *via;
+ DeviceState *dev;
+ I2CBus *i2c_bus;
+ uint8_t *spd_data;
+ int i;
+
+ /* init CPU */
+ cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
+ env = &cpu->env;
+ if (PPC_INPUT(env) != PPC_FLAGS_INPUT_6xx) {
+ error_report("Incompatible CPU, only 6xx bus supported");
+ exit(1);
+ }
+ cpu_ppc_tb_init(env, BUS_FREQ_HZ / 4);
+ qemu_register_reset(amigaone_cpu_reset, cpu);
+
+ /* RAM */
+ if (machine->ram_size > 2 * GiB) {
+ error_report("RAM size more than 2 GiB is not supported");
+ exit(1);
+ }
+ memory_region_add_subregion(get_system_memory(), 0, machine->ram);
+ if (machine->ram_size < 1 * GiB + 32 * KiB) {
+ /* Firmware uses this area for startup */
+ mr = g_new(MemoryRegion, 1);
+ memory_region_init_ram(mr, NULL, "init-cache", 32 * KiB, &error_fatal);
+ memory_region_add_subregion(get_system_memory(), 0x40000000, mr);
+ }
+
+ /* allocate and load firmware */
+ filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, fwname);
+ if (!filename) {
+ error_report("Could not find firmware '%s'", fwname);
+ exit(1);
+ }
+ rom = g_new(MemoryRegion, 1);
+ memory_region_init_rom(rom, NULL, "rom", PROM_SIZE, &error_fatal);
+ memory_region_add_subregion(get_system_memory(), PROM_ADDR, rom);
+ sz = load_image_targphys(filename, PROM_ADDR, PROM_SIZE);
+ if (sz <= 0 || sz > PROM_SIZE) {
+ error_report("Could not load firmware '%s'", filename);
+ exit(1);
+ }
+ g_free(filename);
+
+ /* Articia S */
+ dev = sysbus_create_simple(TYPE_ARTICIA, 0xfe000000, NULL);
+
+ i2c_bus = I2C_BUS(qdev_get_child_bus(dev, "smbus"));
+ if (machine->ram_size > 512 * MiB) {
+ spd_data = spd_data_generate(SDR, machine->ram_size / 2);
+ } else {
+ spd_data = spd_data_generate(SDR, machine->ram_size);
+ }
+ fix_spd_data(spd_data);
+ smbus_eeprom_init_one(i2c_bus, 0x51, spd_data);
+ if (machine->ram_size > 512 * MiB) {
+ smbus_eeprom_init_one(i2c_bus, 0x52, spd_data);
+ }
+
+ pci_mem = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1);
+ mr = g_new(MemoryRegion, 1);
+ memory_region_init_alias(mr, OBJECT(dev), "pci-mem-low", pci_mem,
+ 0, 0x1000000);
+ memory_region_add_subregion(get_system_memory(), 0xfd000000, mr);
+ mr = g_new(MemoryRegion, 1);
+ memory_region_init_alias(mr, OBJECT(dev), "pci-mem-high", pci_mem,
+ 0x80000000, 0x7d000000);
+ memory_region_add_subregion(get_system_memory(), 0x80000000, mr);
+ pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci.0"));
+
+ /* VIA VT82c686B South Bridge (multifunction PCI device) */
+ via = OBJECT(pci_create_simple_multifunction(pci_bus, PCI_DEVFN(7, 0),
+ TYPE_VT82C686B_ISA));
+ object_property_add_alias(OBJECT(machine), "rtc-time",
+ object_resolve_path_component(via, "rtc"),
+ "date");
+ qdev_connect_gpio_out(DEVICE(via), 0,
+ qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_INT));
+ for (i = 0; i < PCI_NUM_PINS; i++) {
+ qdev_connect_gpio_out(dev, i, qdev_get_gpio_in_named(DEVICE(via),
+ "pirq", i));
+ }
+ pci_ide_create_devs(PCI_DEVICE(object_resolve_path_component(via, "ide")));
+ pci_vga_init(pci_bus);
+}
+
+static void amigaone_machine_init(MachineClass *mc)
+{
+ mc->desc = "Eyetech AmigaOne/Mai Logic Teron";
+ mc->init = amigaone_init;
+ mc->block_default_type = IF_IDE;
+ mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("7457_v1.2");
+ mc->default_display = "std";
+ mc->default_ram_id = "ram";
+ mc->default_ram_size = 512 * MiB;
+}
+
+DEFINE_MACHINE("amigaone", amigaone_machine_init)
diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build
index 7c2c52434a..7338f9432a 100644
--- a/hw/ppc/meson.build
+++ b/hw/ppc/meson.build
@@ -81,6 +81,8 @@ ppc_ss.add(when: 'CONFIG_E500', if_true: files(
))
# PowerPC 440 Xilinx ML507 reference board.
ppc_ss.add(when: 'CONFIG_VIRTEX', if_true: files('virtex_ml507.c'))
+# AmigaOne
+ppc_ss.add(when: 'CONFIG_AMIGAONE', if_true: files('amigaone.c'))
# Pegasos2
ppc_ss.add(when: 'CONFIG_PEGASOS2', if_true: files('pegasos2.c'))
--
2.30.9
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH v7 3/3] tests/avocado: Add test for amigaone board
2023-10-27 11:54 [PATCH v7 0/3] Add emulation of AmigaOne XE board BALATON Zoltan
2023-10-27 11:54 ` [PATCH v7 1/3] hw/pci-host: Add emulation of Mai Logic Articia S BALATON Zoltan
2023-10-27 11:54 ` [PATCH v7 2/3] hw/ppc: Add emulation of AmigaOne XE board BALATON Zoltan
@ 2023-10-27 11:54 ` BALATON Zoltan
2023-11-07 18:53 ` Daniel Henrique Barboza
2023-10-28 14:52 ` [PATCH v7 0/3] Add emulation of AmigaOne XE board Bernhard Beschow
` (3 subsequent siblings)
6 siblings, 1 reply; 30+ messages in thread
From: BALATON Zoltan @ 2023-10-27 11:54 UTC (permalink / raw)
To: qemu-devel, qemu-ppc
Cc: Nicholas Piggin, Daniel Henrique Barboza, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
Add an avocado test for the amigaone board that tests it with the
firmware.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
tests/avocado/ppc_amiga.py | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 tests/avocado/ppc_amiga.py
diff --git a/tests/avocado/ppc_amiga.py b/tests/avocado/ppc_amiga.py
new file mode 100644
index 0000000000..b6f866f91d
--- /dev/null
+++ b/tests/avocado/ppc_amiga.py
@@ -0,0 +1,38 @@
+# Test AmigaNG boards
+#
+# Copyright (c) 2023 BALATON Zoltan
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or
+# later. See the COPYING file in the top-level directory.
+
+from avocado.utils import archive
+from avocado.utils import process
+from avocado_qemu import QemuSystemTest
+from avocado_qemu import wait_for_console_pattern
+
+class AmigaOneMachine(QemuSystemTest):
+
+ timeout = 90
+
+ def test_ppc_amigaone(self):
+ """
+ :avocado: tags=arch:ppc
+ :avocado: tags=machine:amigaone
+ :avocado: tags=device:articia
+ :avocado: tags=accel:tcg
+ """
+ self.require_accelerator("tcg")
+ tar_name = 'A1Firmware_Floppy_05-Mar-2005.zip'
+ tar_url = ('https://www.hyperion-entertainment.com/index.php/'
+ 'downloads?view=download&format=raw&file=25')
+ tar_hash = 'c52e59bc73e31d8bcc3cc2106778f7ac84f6c755'
+ zip_file = self.fetch_asset(tar_name, locations=tar_url,
+ asset_hash=tar_hash)
+ archive.extract(zip_file, self.workdir)
+ cmd = f"tail -c 524288 {self.workdir}/floppy_edition/updater.image >{self.workdir}/u-boot-amigaone.bin"
+ process.run(cmd, shell=True)
+
+ self.vm.set_console()
+ self.vm.add_args('-bios', self.workdir + '/u-boot-amigaone.bin')
+ self.vm.launch()
+ wait_for_console_pattern(self, 'FLASH:')
--
2.30.9
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-10-27 11:54 [PATCH v7 0/3] Add emulation of AmigaOne XE board BALATON Zoltan
` (2 preceding siblings ...)
2023-10-27 11:54 ` [PATCH v7 3/3] tests/avocado: Add test for amigaone board BALATON Zoltan
@ 2023-10-28 14:52 ` Bernhard Beschow
2023-10-28 18:20 ` BALATON Zoltan
2023-11-06 10:30 ` BALATON Zoltan
` (2 subsequent siblings)
6 siblings, 1 reply; 30+ messages in thread
From: Bernhard Beschow @ 2023-10-28 14:52 UTC (permalink / raw)
To: BALATON Zoltan, qemu-devel, qemu-ppc
Cc: Nicholas Piggin, Daniel Henrique Barboza, clg, philmd,
Mark Cave-Ayland, Rene Engel, vr_qemu
Am 27. Oktober 2023 11:54:48 UTC schrieb BALATON Zoltan <balaton@eik.bme.hu>:
>Changes in v7:
>- Increase default memory size to 512m to match pegasos2 and sam460ex
>and it's a better default for AmigaOS
>
>Changes in v6:
>- Dropped patch 1, now it's
>
>Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>
>([PATCH v2 0/3] ide: implement simple legacy/native mode switching for PCI IDE controllers)
>- Added Tested-by from Rene
>
>Changes in v5:
>- Fixed avocado test
>
>Changes in v4:
>- Found typo in comment in patch 1 so ended up rewording it again
>trying to make it more concise. Also take the idea of using
>range_covers_byte from Mark's patch
>- Added RFC patch for avocado test (untested, I don't have Avocado)
>
>Changes in v3:
>- Update values, comment and commit message in patch 1 again
>
>Changes in v2:
>- Update comment and commit message in patch 1 (Mark)
>- Fix irq mapping in patch 2 (Volker)
>
>Regards,
>BALATON Zoltan
>
>BALATON Zoltan (3):
> hw/pci-host: Add emulation of Mai Logic Articia S
> hw/ppc: Add emulation of AmigaOne XE board
> tests/avocado: Add test for amigaone board
Hi Zoltan,
Could you please provide some documentation on how to run Linux or some other free (as in free beer) OS on this machine? Can you provide an Avocado test booting e.g. Linux as a quality gate for the VIA south bridges?
As you know I'm trying to bring these south bridges to the PC machine and relying on hard to get proprietary blobs or OSes makes this very difficult. Whenever the VIA south bridges are changed we end up having endless discussions due to this situation. We need a solution that works for everybody woking on these south bridges.
Best regards,
Bernhard
>
> MAINTAINERS | 8 +
> configs/devices/ppc-softmmu/default.mak | 1 +
> hw/pci-host/Kconfig | 5 +
> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
> hw/pci-host/meson.build | 2 +
> hw/ppc/Kconfig | 7 +
> hw/ppc/amigaone.c | 164 +++++++++++++
> hw/ppc/meson.build | 2 +
> include/hw/pci-host/articia.h | 17 ++
> tests/avocado/ppc_amiga.py | 38 +++
> 10 files changed, 537 insertions(+)
> create mode 100644 hw/pci-host/articia.c
> create mode 100644 hw/ppc/amigaone.c
> create mode 100644 include/hw/pci-host/articia.h
> create mode 100644 tests/avocado/ppc_amiga.py
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-10-28 14:52 ` [PATCH v7 0/3] Add emulation of AmigaOne XE board Bernhard Beschow
@ 2023-10-28 18:20 ` BALATON Zoltan
0 siblings, 0 replies; 30+ messages in thread
From: BALATON Zoltan @ 2023-10-28 18:20 UTC (permalink / raw)
To: Bernhard Beschow
Cc: qemu-devel, qemu-ppc, Nicholas Piggin, Daniel Henrique Barboza,
clg, philmd, Mark Cave-Ayland, Rene Engel, vr_qemu
On Sat, 28 Oct 2023, Bernhard Beschow wrote:
> Am 27. Oktober 2023 11:54:48 UTC schrieb BALATON Zoltan <balaton@eik.bme.hu>:
>> Changes in v7:
>> - Increase default memory size to 512m to match pegasos2 and sam460ex
>> and it's a better default for AmigaOS
>>
>> Changes in v6:
>> - Dropped patch 1, now it's
>>
>> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>>
>> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for PCI IDE controllers)
>> - Added Tested-by from Rene
>>
>> Changes in v5:
>> - Fixed avocado test
>>
>> Changes in v4:
>> - Found typo in comment in patch 1 so ended up rewording it again
>> trying to make it more concise. Also take the idea of using
>> range_covers_byte from Mark's patch
>> - Added RFC patch for avocado test (untested, I don't have Avocado)
>>
>> Changes in v3:
>> - Update values, comment and commit message in patch 1 again
>>
>> Changes in v2:
>> - Update comment and commit message in patch 1 (Mark)
>> - Fix irq mapping in patch 2 (Volker)
>>
>> Regards,
>> BALATON Zoltan
>>
>> BALATON Zoltan (3):
>> hw/pci-host: Add emulation of Mai Logic Articia S
>> hw/ppc: Add emulation of AmigaOne XE board
>> tests/avocado: Add test for amigaone board
>
> Hi Zoltan,
>
> Could you please provide some documentation on how to run Linux or some
> other free (as in free beer) OS on this machine?
There are some Linux images here that should work on amigaone:
https://sourceforge.net/projects/amigaone-linux/files/debian-installer/
To boot it get the firmware as described in the comment in amigaone.c or
in the avocado test then run:
qemu-system-ppc -M amigaone -bios u-boot-amigaone.bin \
-cdrom "A1 Linux Net Installer.iso" -serial stdio \
-device ati-vga,model=rv100,romfile=VGABIOS-lgpl-latest.bin
Then from the firmware menu select Boot sequence, Amiga Multiboot Options
and set Boot device 1 to VIA CDROM then escape back to top level and from
the exit menu that appears with escape on the main screen select either
save settings or use settings for current boot. It takes a long time at
Loading kernel... but eventually boots and you should see the installer
(or select rescue from the Linux boot menu then at language selection
Tab to Back button then run shell to get a prompt).
> Can you provide an
> Avocado test booting e.g. Linux as a quality gate for the VIA south
> bridges?
I don't know how to automate the above with avocado which seems to run
with -display none but the Linux iso has hard coded radeonfb so I could
only do a basic test with the firmware.
> As you know I'm trying to bring these south bridges to the PC machine
> and relying on hard to get proprietary blobs or OSes makes this very
> difficult.
I know that the machines and guests I work with are a bit obscure but I
can't change that. These machines also run Linux and some MorphOS too
which can be a test case that's available, unfortunately amigaone is not
supported by MorphOS so only Linux and AmigaOS is available there.
> Whenever the VIA south bridges are changed we end up having
> endless discussions due to this situation. We need a solution that works
> for everybody woking on these south bridges.
I afree with that and I think I wasn't the one who started endless
discussions about every little change to the via model so I think we can
find a solution that works for all. I'd just like to keep pegasos2 and
amigaone working with AmigaOS which is my main goal and also keep the
device model simple and managable.
Regards,
BALATON Zoltan
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-10-27 11:54 [PATCH v7 0/3] Add emulation of AmigaOne XE board BALATON Zoltan
` (3 preceding siblings ...)
2023-10-28 14:52 ` [PATCH v7 0/3] Add emulation of AmigaOne XE board Bernhard Beschow
@ 2023-11-06 10:30 ` BALATON Zoltan
2023-11-07 8:50 ` BALATON Zoltan
2023-11-07 17:20 ` Daniel Henrique Barboza
2023-11-07 18:53 ` Daniel Henrique Barboza
6 siblings, 1 reply; 30+ messages in thread
From: BALATON Zoltan @ 2023-11-06 10:30 UTC (permalink / raw)
To: qemu-devel, qemu-ppc
Cc: Nicholas Piggin, Daniel Henrique Barboza, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
On Fri, 27 Oct 2023, BALATON Zoltan wrote:
> Changes in v7:
> - Increase default memory size to 512m to match pegasos2 and sam460ex
> and it's a better default for AmigaOS
>
> Changes in v6:
> - Dropped patch 1, now it's
>
> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>
> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for PCI IDE controllers)
> - Added Tested-by from Rene
>
> Changes in v5:
> - Fixed avocado test
>
> Changes in v4:
> - Found typo in comment in patch 1 so ended up rewording it again
> trying to make it more concise. Also take the idea of using
> range_covers_byte from Mark's patch
> - Added RFC patch for avocado test (untested, I don't have Avocado)
>
> Changes in v3:
> - Update values, comment and commit message in patch 1 again
>
> Changes in v2:
> - Update comment and commit message in patch 1 (Mark)
> - Fix irq mapping in patch 2 (Volker)
>
> Regards,
> BALATON Zoltan
>
> BALATON Zoltan (3):
> hw/pci-host: Add emulation of Mai Logic Articia S
> hw/ppc: Add emulation of AmigaOne XE board
> tests/avocado: Add test for amigaone board
Nick,
Will you please send a pull request with this now? It's independent of the
IDE fix which as a bugfix so can wait a little more but this series should
be merged before the freeze starts tomorrow. (As this adds a new machine
and does not touch anything else it can't break anything either.)
Regards,
BALATON Zoltan
> MAINTAINERS | 8 +
> configs/devices/ppc-softmmu/default.mak | 1 +
> hw/pci-host/Kconfig | 5 +
> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
> hw/pci-host/meson.build | 2 +
> hw/ppc/Kconfig | 7 +
> hw/ppc/amigaone.c | 164 +++++++++++++
> hw/ppc/meson.build | 2 +
> include/hw/pci-host/articia.h | 17 ++
> tests/avocado/ppc_amiga.py | 38 +++
> 10 files changed, 537 insertions(+)
> create mode 100644 hw/pci-host/articia.c
> create mode 100644 hw/ppc/amigaone.c
> create mode 100644 include/hw/pci-host/articia.h
> create mode 100644 tests/avocado/ppc_amiga.py
>
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-11-06 10:30 ` BALATON Zoltan
@ 2023-11-07 8:50 ` BALATON Zoltan
2023-11-07 14:42 ` BALATON Zoltan
0 siblings, 1 reply; 30+ messages in thread
From: BALATON Zoltan @ 2023-11-07 8:50 UTC (permalink / raw)
To: qemu-devel, qemu-ppc
Cc: Nicholas Piggin, Daniel Henrique Barboza, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
On Mon, 6 Nov 2023, BALATON Zoltan wrote:
> On Fri, 27 Oct 2023, BALATON Zoltan wrote:
>> Changes in v7:
>> - Increase default memory size to 512m to match pegasos2 and sam460ex
>> and it's a better default for AmigaOS
>>
>> Changes in v6:
>> - Dropped patch 1, now it's
>>
>> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>>
>> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for PCI
>> IDE controllers)
>> - Added Tested-by from Rene
>>
>> Changes in v5:
>> - Fixed avocado test
>>
>> Changes in v4:
>> - Found typo in comment in patch 1 so ended up rewording it again
>> trying to make it more concise. Also take the idea of using
>> range_covers_byte from Mark's patch
>> - Added RFC patch for avocado test (untested, I don't have Avocado)
>>
>> Changes in v3:
>> - Update values, comment and commit message in patch 1 again
>>
>> Changes in v2:
>> - Update comment and commit message in patch 1 (Mark)
>> - Fix irq mapping in patch 2 (Volker)
>>
>> Regards,
>> BALATON Zoltan
>>
>> BALATON Zoltan (3):
>> hw/pci-host: Add emulation of Mai Logic Articia S
>> hw/ppc: Add emulation of AmigaOne XE board
>> tests/avocado: Add test for amigaone board
>
> Nick,
>
> Will you please send a pull request with this now? It's independent of the
> IDE fix which as a bugfix so can wait a little more but this series should be
> merged before the freeze starts tomorrow. (As this adds a new machine and
> does not touch anything else it can't break anything either.)
Is there a PPC pull request in the making with this series in it? It would
be really sad to miss the release not being able to merge such a simple
series for weeks. As I said this is independent of any other fixes so I'd
like to get this in now please.
Regards,
BALATON Zoltan
>> MAINTAINERS | 8 +
>> configs/devices/ppc-softmmu/default.mak | 1 +
>> hw/pci-host/Kconfig | 5 +
>> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
>> hw/pci-host/meson.build | 2 +
>> hw/ppc/Kconfig | 7 +
>> hw/ppc/amigaone.c | 164 +++++++++++++
>> hw/ppc/meson.build | 2 +
>> include/hw/pci-host/articia.h | 17 ++
>> tests/avocado/ppc_amiga.py | 38 +++
>> 10 files changed, 537 insertions(+)
>> create mode 100644 hw/pci-host/articia.c
>> create mode 100644 hw/ppc/amigaone.c
>> create mode 100644 include/hw/pci-host/articia.h
>> create mode 100644 tests/avocado/ppc_amiga.py
>>
>>
>
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-11-07 8:50 ` BALATON Zoltan
@ 2023-11-07 14:42 ` BALATON Zoltan
2023-11-07 16:20 ` Daniel Henrique Barboza
0 siblings, 1 reply; 30+ messages in thread
From: BALATON Zoltan @ 2023-11-07 14:42 UTC (permalink / raw)
To: qemu-devel, qemu-ppc
Cc: Nicholas Piggin, Daniel Henrique Barboza, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
[-- Attachment #1: Type: text/plain, Size: 3076 bytes --]
On Tue, 7 Nov 2023, BALATON Zoltan wrote:
> On Mon, 6 Nov 2023, BALATON Zoltan wrote:
>> On Fri, 27 Oct 2023, BALATON Zoltan wrote:
>>> Changes in v7:
>>> - Increase default memory size to 512m to match pegasos2 and sam460ex
>>> and it's a better default for AmigaOS
>>>
>>> Changes in v6:
>>> - Dropped patch 1, now it's
>>>
>>> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>>>
>>> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for PCI
>>> IDE controllers)
>>> - Added Tested-by from Rene
>>>
>>> Changes in v5:
>>> - Fixed avocado test
>>>
>>> Changes in v4:
>>> - Found typo in comment in patch 1 so ended up rewording it again
>>> trying to make it more concise. Also take the idea of using
>>> range_covers_byte from Mark's patch
>>> - Added RFC patch for avocado test (untested, I don't have Avocado)
>>>
>>> Changes in v3:
>>> - Update values, comment and commit message in patch 1 again
>>>
>>> Changes in v2:
>>> - Update comment and commit message in patch 1 (Mark)
>>> - Fix irq mapping in patch 2 (Volker)
>>>
>>> Regards,
>>> BALATON Zoltan
>>>
>>> BALATON Zoltan (3):
>>> hw/pci-host: Add emulation of Mai Logic Articia S
>>> hw/ppc: Add emulation of AmigaOne XE board
>>> tests/avocado: Add test for amigaone board
>>
>> Nick,
>>
>> Will you please send a pull request with this now? It's independent of the
>> IDE fix which as a bugfix so can wait a little more but this series should
>> be merged before the freeze starts tomorrow. (As this adds a new machine
>> and does not touch anything else it can't break anything either.)
>
> Is there a PPC pull request in the making with this series in it? It would be
> really sad to miss the release not being able to merge such a simple series
> for weeks. As I said this is independent of any other fixes so I'd like to
> get this in now please.
Nick seems to be away so please Cédric, Daniel, Phil or whoever can send a
pull request step in and please take care of this. This was posted a month
ago with this last version on the list for 1.5 week so I'd hate to miss
the release and wait until Easter next year to get this out to users
because none of the maintainers are available before and arounf the freeze.
Regards,
BALATON Zoltan
>>> MAINTAINERS | 8 +
>>> configs/devices/ppc-softmmu/default.mak | 1 +
>>> hw/pci-host/Kconfig | 5 +
>>> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
>>> hw/pci-host/meson.build | 2 +
>>> hw/ppc/Kconfig | 7 +
>>> hw/ppc/amigaone.c | 164 +++++++++++++
>>> hw/ppc/meson.build | 2 +
>>> include/hw/pci-host/articia.h | 17 ++
>>> tests/avocado/ppc_amiga.py | 38 +++
>>> 10 files changed, 537 insertions(+)
>>> create mode 100644 hw/pci-host/articia.c
>>> create mode 100644 hw/ppc/amigaone.c
>>> create mode 100644 include/hw/pci-host/articia.h
>>> create mode 100644 tests/avocado/ppc_amiga.py
>>>
>>>
>>
>>
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-11-07 14:42 ` BALATON Zoltan
@ 2023-11-07 16:20 ` Daniel Henrique Barboza
2023-11-07 16:41 ` BALATON Zoltan
0 siblings, 1 reply; 30+ messages in thread
From: Daniel Henrique Barboza @ 2023-11-07 16:20 UTC (permalink / raw)
To: BALATON Zoltan, qemu-devel, qemu-ppc
Cc: Nicholas Piggin, clg, philmd, Bernhard Beschow, Mark Cave-Ayland,
Rene Engel, vr_qemu
On 11/7/23 11:42, BALATON Zoltan wrote:
> On Tue, 7 Nov 2023, BALATON Zoltan wrote:
>> On Mon, 6 Nov 2023, BALATON Zoltan wrote:
>>> On Fri, 27 Oct 2023, BALATON Zoltan wrote:
>>>> Changes in v7:
>>>> - Increase default memory size to 512m to match pegasos2 and sam460ex
>>>> and it's a better default for AmigaOS
>>>>
>>>> Changes in v6:
>>>> - Dropped patch 1, now it's
>>>>
>>>> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>>>>
>>>> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for PCI IDE controllers)
>>>> - Added Tested-by from Rene
>>>>
>>>> Changes in v5:
>>>> - Fixed avocado test
>>>>
>>>> Changes in v4:
>>>> - Found typo in comment in patch 1 so ended up rewording it again
>>>> trying to make it more concise. Also take the idea of using
>>>> range_covers_byte from Mark's patch
>>>> - Added RFC patch for avocado test (untested, I don't have Avocado)
>>>>
>>>> Changes in v3:
>>>> - Update values, comment and commit message in patch 1 again
>>>>
>>>> Changes in v2:
>>>> - Update comment and commit message in patch 1 (Mark)
>>>> - Fix irq mapping in patch 2 (Volker)
>>>>
>>>> Regards,
>>>> BALATON Zoltan
>>>>
>>>> BALATON Zoltan (3):
>>>> hw/pci-host: Add emulation of Mai Logic Articia S
>>>> hw/ppc: Add emulation of AmigaOne XE board
>>>> tests/avocado: Add test for amigaone board
>>>
>>> Nick,
>>>
>>> Will you please send a pull request with this now? It's independent of the IDE fix which as a bugfix so can wait a little more but this series should be merged before the freeze starts tomorrow. (As this adds a new machine and does not touch anything else it can't break anything either.)
>>
>> Is there a PPC pull request in the making with this series in it? It would be really sad to miss the release not being able to merge such a simple series for weeks. As I said this is independent of any other fixes so I'd like to get this in now please.
>
> Nick seems to be away so please Cédric, Daniel, Phil or whoever can send a pull request step in and please take care of this. This was posted a month ago with this last version on the list for 1.5 week so I'd hate to miss the release and wait until Easter next year to get this out to users because none of the maintainers are available before and arounf the freeze.
Wait, do you think we would miss code freeze?
Code freeze in QEMU is a blast! People getting mad because stuff got left behind,
PRs getting remade over and over because gitlab is nagging about something, new
bugs introduced, sometimes master doesn't even build the following week. We might
miss any other boring date like release date or something, but code freeze? Nah,
we're right here man.
The reason why we didn't interfere is because it's rude to short-circuit the
maintainer on duty. Nick didn't send an email asking for help, so we were just
monitoring.
I'll consider Nick AWOL and take this PR. And don't worry, it's still sunny in
Brazil, we have plenty of time.
Thanks,
Daniel
>
> Regards,
> BALATON Zoltan
>
>>>> MAINTAINERS | 8 +
>>>> configs/devices/ppc-softmmu/default.mak | 1 +
>>>> hw/pci-host/Kconfig | 5 +
>>>> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
>>>> hw/pci-host/meson.build | 2 +
>>>> hw/ppc/Kconfig | 7 +
>>>> hw/ppc/amigaone.c | 164 +++++++++++++
>>>> hw/ppc/meson.build | 2 +
>>>> include/hw/pci-host/articia.h | 17 ++
>>>> tests/avocado/ppc_amiga.py | 38 +++
>>>> 10 files changed, 537 insertions(+)
>>>> create mode 100644 hw/pci-host/articia.c
>>>> create mode 100644 hw/ppc/amigaone.c
>>>> create mode 100644 include/hw/pci-host/articia.h
>>>> create mode 100644 tests/avocado/ppc_amiga.py
>>>>
>>>>
>>>
>>>
>>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-11-07 16:20 ` Daniel Henrique Barboza
@ 2023-11-07 16:41 ` BALATON Zoltan
0 siblings, 0 replies; 30+ messages in thread
From: BALATON Zoltan @ 2023-11-07 16:41 UTC (permalink / raw)
To: Daniel Henrique Barboza
Cc: qemu-devel, qemu-ppc, Nicholas Piggin, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
[-- Attachment #1: Type: text/plain, Size: 4774 bytes --]
On Tue, 7 Nov 2023, Daniel Henrique Barboza wrote:
> On 11/7/23 11:42, BALATON Zoltan wrote:
>> On Tue, 7 Nov 2023, BALATON Zoltan wrote:
>>> On Mon, 6 Nov 2023, BALATON Zoltan wrote:
>>>> On Fri, 27 Oct 2023, BALATON Zoltan wrote:
>>>>> Changes in v7:
>>>>> - Increase default memory size to 512m to match pegasos2 and sam460ex
>>>>> and it's a better default for AmigaOS
>>>>>
>>>>> Changes in v6:
>>>>> - Dropped patch 1, now it's
>>>>>
>>>>> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>>>>>
>>>>> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for
>>>>> PCI IDE controllers)
>>>>> - Added Tested-by from Rene
>>>>>
>>>>> Changes in v5:
>>>>> - Fixed avocado test
>>>>>
>>>>> Changes in v4:
>>>>> - Found typo in comment in patch 1 so ended up rewording it again
>>>>> trying to make it more concise. Also take the idea of using
>>>>> range_covers_byte from Mark's patch
>>>>> - Added RFC patch for avocado test (untested, I don't have Avocado)
>>>>>
>>>>> Changes in v3:
>>>>> - Update values, comment and commit message in patch 1 again
>>>>>
>>>>> Changes in v2:
>>>>> - Update comment and commit message in patch 1 (Mark)
>>>>> - Fix irq mapping in patch 2 (Volker)
>>>>>
>>>>> Regards,
>>>>> BALATON Zoltan
>>>>>
>>>>> BALATON Zoltan (3):
>>>>> hw/pci-host: Add emulation of Mai Logic Articia S
>>>>> hw/ppc: Add emulation of AmigaOne XE board
>>>>> tests/avocado: Add test for amigaone board
>>>>
>>>> Nick,
>>>>
>>>> Will you please send a pull request with this now? It's independent of
>>>> the IDE fix which as a bugfix so can wait a little more but this series
>>>> should be merged before the freeze starts tomorrow. (As this adds a new
>>>> machine and does not touch anything else it can't break anything either.)
>>>
>>> Is there a PPC pull request in the making with this series in it? It would
>>> be really sad to miss the release not being able to merge such a simple
>>> series for weeks. As I said this is independent of any other fixes so I'd
>>> like to get this in now please.
>>
>> Nick seems to be away so please Cédric, Daniel, Phil or whoever can send a
>> pull request step in and please take care of this. This was posted a month
>> ago with this last version on the list for 1.5 week so I'd hate to miss the
>> release and wait until Easter next year to get this out to users because
>> none of the maintainers are available before and arounf the freeze.
>
> Wait, do you think we would miss code freeze?
>
> Code freeze in QEMU is a blast! People getting mad because stuff got
> left behind, PRs getting remade over and over because gitlab is nagging
> about something, new bugs introduced, sometimes master doesn't even
> build the following week. We might miss any other boring date like
> release date or something, but code freeze? Nah, we're right here man.
OK, cool, thanks a lot. I was just worried that there was no answer that
somebody is working on this and wanted to make sure it won't be missed. If
it's being taken care of then sorry to bug you but had to make sure it
won't get lost in the noise with all the things happening in last minute.
> The reason why we didn't interfere is because it's rude to short-circuit
> the maintainer on duty. Nick didn't send an email asking for help, so we
> were just monitoring.
>
> I'll consider Nick AWOL and take this PR. And don't worry, it's still
> sunny in Brazil, we have plenty of time.
Good. It's dark and cold here and Stefan already sent a message hours ago
when it was evening for him but glad to hear its bright in Brazil, I was
still hoping for that. :-)
Regards,
BALATON Zoltan
>
>
> Thanks,
>
> Daniel
>
>>
>> Regards,
>> BALATON Zoltan
>>
>>>>> MAINTAINERS | 8 +
>>>>> configs/devices/ppc-softmmu/default.mak | 1 +
>>>>> hw/pci-host/Kconfig | 5 +
>>>>> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
>>>>> hw/pci-host/meson.build | 2 +
>>>>> hw/ppc/Kconfig | 7 +
>>>>> hw/ppc/amigaone.c | 164 +++++++++++++
>>>>> hw/ppc/meson.build | 2 +
>>>>> include/hw/pci-host/articia.h | 17 ++
>>>>> tests/avocado/ppc_amiga.py | 38 +++
>>>>> 10 files changed, 537 insertions(+)
>>>>> create mode 100644 hw/pci-host/articia.c
>>>>> create mode 100644 hw/ppc/amigaone.c
>>>>> create mode 100644 include/hw/pci-host/articia.h
>>>>> create mode 100644 tests/avocado/ppc_amiga.py
>>>>>
>>>>>
>>>>
>>>>
>>>
>
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-10-27 11:54 [PATCH v7 0/3] Add emulation of AmigaOne XE board BALATON Zoltan
` (4 preceding siblings ...)
2023-11-06 10:30 ` BALATON Zoltan
@ 2023-11-07 17:20 ` Daniel Henrique Barboza
2023-11-07 17:33 ` BALATON Zoltan
2023-11-07 18:53 ` Daniel Henrique Barboza
6 siblings, 1 reply; 30+ messages in thread
From: Daniel Henrique Barboza @ 2023-11-07 17:20 UTC (permalink / raw)
To: BALATON Zoltan, qemu-devel, qemu-ppc
Cc: Nicholas Piggin, clg, philmd, Bernhard Beschow, Mark Cave-Ayland,
Rene Engel, vr_qemu
Zoltan,
Gitlab is complaining about a missing file in one of the tests:
8/259 qemu:qtest+qtest-ppc / qtest-ppc/test-hmp ERROR 0.22s killed by signal 6 SIGABRT
4324>>> G_TEST_DBUS_DAEMON=/builds/danielhb/qemu/tests/dbus-vmstate-daemon.sh QTEST_QEMU_BINARY=./qemu-system-ppc MALLOC_PERTURB_=87 PYTHON=/builds/danielhb/qemu/build/pyvenv/bin/python3 /builds/danielhb/qemu/build/tests/qtest/test-hmp --tap -k
4325――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
4326stderr:
4327qemu-system-ppc: Could not find firmware 'u-boot-amigaone.bin'
4328Broken pipe
4329../tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
4330(test program exited with status code -6)
4331TAP parsing error: Too few tests run (expected 13, got 0)
You can reproduce it like this:
$ make -j -C build && QTEST_QEMU_BINARY=./build/qemu-system-ppc64 ./build/tests/qtest/test-hmp
I ended up amending in-tree (downloaded the firmware, put it under pc-bios, updated pc-bios/meson.build).
My manual test now passes, but not sure if gitlab will nag about it. Let's wait and see.
I told you: code freeze is a blast! Let's see if it's still sunny for the
AmigaOne XE board emulation.
Thanks,
Daniel
On 10/27/23 08:54, BALATON Zoltan wrote:
> Changes in v7:
> - Increase default memory size to 512m to match pegasos2 and sam460ex
> and it's a better default for AmigaOS
>
> Changes in v6:
> - Dropped patch 1, now it's
>
> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>
> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for PCI IDE controllers)
> - Added Tested-by from Rene
>
> Changes in v5:
> - Fixed avocado test
>
> Changes in v4:
> - Found typo in comment in patch 1 so ended up rewording it again
> trying to make it more concise. Also take the idea of using
> range_covers_byte from Mark's patch
> - Added RFC patch for avocado test (untested, I don't have Avocado)
>
> Changes in v3:
> - Update values, comment and commit message in patch 1 again
>
> Changes in v2:
> - Update comment and commit message in patch 1 (Mark)
> - Fix irq mapping in patch 2 (Volker)
>
> Regards,
> BALATON Zoltan
>
> BALATON Zoltan (3):
> hw/pci-host: Add emulation of Mai Logic Articia S
> hw/ppc: Add emulation of AmigaOne XE board
> tests/avocado: Add test for amigaone board
>
> MAINTAINERS | 8 +
> configs/devices/ppc-softmmu/default.mak | 1 +
> hw/pci-host/Kconfig | 5 +
> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
> hw/pci-host/meson.build | 2 +
> hw/ppc/Kconfig | 7 +
> hw/ppc/amigaone.c | 164 +++++++++++++
> hw/ppc/meson.build | 2 +
> include/hw/pci-host/articia.h | 17 ++
> tests/avocado/ppc_amiga.py | 38 +++
> 10 files changed, 537 insertions(+)
> create mode 100644 hw/pci-host/articia.c
> create mode 100644 hw/ppc/amigaone.c
> create mode 100644 include/hw/pci-host/articia.h
> create mode 100644 tests/avocado/ppc_amiga.py
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-11-07 17:20 ` Daniel Henrique Barboza
@ 2023-11-07 17:33 ` BALATON Zoltan
2023-11-07 17:42 ` Daniel Henrique Barboza
2023-11-07 17:44 ` BALATON Zoltan
0 siblings, 2 replies; 30+ messages in thread
From: BALATON Zoltan @ 2023-11-07 17:33 UTC (permalink / raw)
To: Daniel Henrique Barboza
Cc: qemu-devel, qemu-ppc, Nicholas Piggin, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
[-- Attachment #1: Type: text/plain, Size: 4224 bytes --]
On Tue, 7 Nov 2023, Daniel Henrique Barboza wrote:
> Zoltan,
>
> Gitlab is complaining about a missing file in one of the tests:
>
>
> 8/259 qemu:qtest+qtest-ppc / qtest-ppc/test-hmp
> ERROR 0.22s killed by signal 6 SIGABRT
> 4324>>> G_TEST_DBUS_DAEMON=/builds/danielhb/qemu/tests/dbus-vmstate-daemon.sh
> QTEST_QEMU_BINARY=./qemu-system-ppc MALLOC_PERTURB_=87
> PYTHON=/builds/danielhb/qemu/build/pyvenv/bin/python3
> /builds/danielhb/qemu/build/tests/qtest/test-hmp --tap -k
> 4325――――――――――――――――――――――――――――――――――――― ✀
> ―――――――――――――――――――――――――――――――――――――
> 4326stderr:
> 4327qemu-system-ppc: Could not find firmware 'u-boot-amigaone.bin'
> 4328Broken pipe
> 4329../tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU
> process but encountered exit status 1 (expected 0)
> 4330(test program exited with status code -6)
> 4331TAP parsing error: Too few tests run (expected 13, got 0)
>
>
> You can reproduce it like this:
>
> $ make -j -C build && QTEST_QEMU_BINARY=./build/qemu-system-ppc64
> ./build/tests/qtest/test-hmp
>
> I ended up amending in-tree (downloaded the firmware, put it under pc-bios,
> updated pc-bios/meson.build).
> My manual test now passes, but not sure if gitlab will nag about it. Let's
> wait and see.
This is handled in the avocado test and it should download the file from
the URL there. When tested locally it worked and downloaded the file and
extracted the firmware bin from it. Can the gitlab CI download stuff or
does it expect it to be in local cache already where you need to put it
somehow beforehand? I think Philippe said something about that before but
I did not quite get it as I don't know neither avocado nor gitlab. Hope
Philippe is reading it and can chime in.
But the test is not required to run the machine so as a last resort you
could just drop the avocado patch and then we can add it later if we can't
figure this out now.
Regards,
BALATON Zoltan
> I told you: code freeze is a blast! Let's see if it's still sunny for the
> AmigaOne XE board emulation.
>
>
>
> Thanks,
>
>
> Daniel
>
>
>
>
>
> On 10/27/23 08:54, BALATON Zoltan wrote:
>> Changes in v7:
>> - Increase default memory size to 512m to match pegasos2 and sam460ex
>> and it's a better default for AmigaOS
>>
>> Changes in v6:
>> - Dropped patch 1, now it's
>>
>> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>>
>> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for PCI
>> IDE controllers)
>> - Added Tested-by from Rene
>>
>> Changes in v5:
>> - Fixed avocado test
>>
>> Changes in v4:
>> - Found typo in comment in patch 1 so ended up rewording it again
>> trying to make it more concise. Also take the idea of using
>> range_covers_byte from Mark's patch
>> - Added RFC patch for avocado test (untested, I don't have Avocado)
>>
>> Changes in v3:
>> - Update values, comment and commit message in patch 1 again
>>
>> Changes in v2:
>> - Update comment and commit message in patch 1 (Mark)
>> - Fix irq mapping in patch 2 (Volker)
>>
>> Regards,
>> BALATON Zoltan
>>
>> BALATON Zoltan (3):
>> hw/pci-host: Add emulation of Mai Logic Articia S
>> hw/ppc: Add emulation of AmigaOne XE board
>> tests/avocado: Add test for amigaone board
>>
>> MAINTAINERS | 8 +
>> configs/devices/ppc-softmmu/default.mak | 1 +
>> hw/pci-host/Kconfig | 5 +
>> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
>> hw/pci-host/meson.build | 2 +
>> hw/ppc/Kconfig | 7 +
>> hw/ppc/amigaone.c | 164 +++++++++++++
>> hw/ppc/meson.build | 2 +
>> include/hw/pci-host/articia.h | 17 ++
>> tests/avocado/ppc_amiga.py | 38 +++
>> 10 files changed, 537 insertions(+)
>> create mode 100644 hw/pci-host/articia.c
>> create mode 100644 hw/ppc/amigaone.c
>> create mode 100644 include/hw/pci-host/articia.h
>> create mode 100644 tests/avocado/ppc_amiga.py
>>
>
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-11-07 17:33 ` BALATON Zoltan
@ 2023-11-07 17:42 ` Daniel Henrique Barboza
2023-11-07 17:49 ` BALATON Zoltan
2023-11-07 18:25 ` BALATON Zoltan
2023-11-07 17:44 ` BALATON Zoltan
1 sibling, 2 replies; 30+ messages in thread
From: Daniel Henrique Barboza @ 2023-11-07 17:42 UTC (permalink / raw)
To: BALATON Zoltan
Cc: qemu-devel, qemu-ppc, Nicholas Piggin, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
On 11/7/23 14:33, BALATON Zoltan wrote:
> On Tue, 7 Nov 2023, Daniel Henrique Barboza wrote:
>> Zoltan,
>>
>> Gitlab is complaining about a missing file in one of the tests:
>>
>>
>> 8/259 qemu:qtest+qtest-ppc / qtest-ppc/test-hmp ERROR 0.22s killed by signal 6 SIGABRT
>> 4324>>> G_TEST_DBUS_DAEMON=/builds/danielhb/qemu/tests/dbus-vmstate-daemon.sh QTEST_QEMU_BINARY=./qemu-system-ppc MALLOC_PERTURB_=87 PYTHON=/builds/danielhb/qemu/build/pyvenv/bin/python3 /builds/danielhb/qemu/build/tests/qtest/test-hmp --tap -k
>> 4325――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
>> 4326stderr:
>> 4327qemu-system-ppc: Could not find firmware 'u-boot-amigaone.bin'
>> 4328Broken pipe
>> 4329../tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
>> 4330(test program exited with status code -6)
>> 4331TAP parsing error: Too few tests run (expected 13, got 0)
>>
>>
>> You can reproduce it like this:
>>
>> $ make -j -C build && QTEST_QEMU_BINARY=./build/qemu-system-ppc64 ./build/tests/qtest/test-hmp
>>
>> I ended up amending in-tree (downloaded the firmware, put it under pc-bios, updated pc-bios/meson.build).
>> My manual test now passes, but not sure if gitlab will nag about it. Let's wait and see.
>
> This is handled in the avocado test and it should download the file from the URL there. When tested locally it worked and downloaded the file and extracted the firmware bin from it. Can the gitlab CI download stuff or does it expect it to be in local cache already where you need to put it somehow beforehand? I think Philippe said something about that before but I did not quite get it as I don't know neither avocado nor gitlab. Hope Philippe is reading it and can chime in.
Gitlab CI can download stuff. But note that the error above is not avocado, it's hmp.
It expects a firmware file to be available, and I'm not entirely sure it'll make any
effort (e.g. downloading it) aside from checking if the file exists.
>
> But the test is not required to run the machine so as a last resort you could just drop the avocado patch and then we can add it later if we can't figure this out now.
Not sure if dropping the avocado test would remediate the situation, but noted.
For now let's push stuff upstream. We have the freeze window to make smaller
adjustments if needed.
Thanks,
Daniel
>
> Regards,
> BALATON Zoltan
>
>> I told you: code freeze is a blast! Let's see if it's still sunny for the
>> AmigaOne XE board emulation.
>>
>>
>>
>> Thanks,
>>
>>
>> Daniel
>>
>>
>>
>>
>>
>> On 10/27/23 08:54, BALATON Zoltan wrote:
>>> Changes in v7:
>>> - Increase default memory size to 512m to match pegasos2 and sam460ex
>>> and it's a better default for AmigaOS
>>>
>>> Changes in v6:
>>> - Dropped patch 1, now it's
>>>
>>> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>>>
>>> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for PCI IDE controllers)
>>> - Added Tested-by from Rene
>>>
>>> Changes in v5:
>>> - Fixed avocado test
>>>
>>> Changes in v4:
>>> - Found typo in comment in patch 1 so ended up rewording it again
>>> trying to make it more concise. Also take the idea of using
>>> range_covers_byte from Mark's patch
>>> - Added RFC patch for avocado test (untested, I don't have Avocado)
>>>
>>> Changes in v3:
>>> - Update values, comment and commit message in patch 1 again
>>>
>>> Changes in v2:
>>> - Update comment and commit message in patch 1 (Mark)
>>> - Fix irq mapping in patch 2 (Volker)
>>>
>>> Regards,
>>> BALATON Zoltan
>>>
>>> BALATON Zoltan (3):
>>> hw/pci-host: Add emulation of Mai Logic Articia S
>>> hw/ppc: Add emulation of AmigaOne XE board
>>> tests/avocado: Add test for amigaone board
>>>
>>> MAINTAINERS | 8 +
>>> configs/devices/ppc-softmmu/default.mak | 1 +
>>> hw/pci-host/Kconfig | 5 +
>>> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
>>> hw/pci-host/meson.build | 2 +
>>> hw/ppc/Kconfig | 7 +
>>> hw/ppc/amigaone.c | 164 +++++++++++++
>>> hw/ppc/meson.build | 2 +
>>> include/hw/pci-host/articia.h | 17 ++
>>> tests/avocado/ppc_amiga.py | 38 +++
>>> 10 files changed, 537 insertions(+)
>>> create mode 100644 hw/pci-host/articia.c
>>> create mode 100644 hw/ppc/amigaone.c
>>> create mode 100644 include/hw/pci-host/articia.h
>>> create mode 100644 tests/avocado/ppc_amiga.py
>>>
>>
>>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-11-07 17:33 ` BALATON Zoltan
2023-11-07 17:42 ` Daniel Henrique Barboza
@ 2023-11-07 17:44 ` BALATON Zoltan
1 sibling, 0 replies; 30+ messages in thread
From: BALATON Zoltan @ 2023-11-07 17:44 UTC (permalink / raw)
To: Daniel Henrique Barboza
Cc: qemu-devel, qemu-ppc, Nicholas Piggin, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
[-- Attachment #1: Type: text/plain, Size: 5128 bytes --]
On Tue, 7 Nov 2023, BALATON Zoltan wrote:
> On Tue, 7 Nov 2023, Daniel Henrique Barboza wrote:
>> Zoltan,
>>
>> Gitlab is complaining about a missing file in one of the tests:
>>
>>
>> 8/259 qemu:qtest+qtest-ppc / qtest-ppc/test-hmp ERROR 0.22s
>> killed by signal 6 SIGABRT
>> 4324>>>
>> G_TEST_DBUS_DAEMON=/builds/danielhb/qemu/tests/dbus-vmstate-daemon.sh
>> QTEST_QEMU_BINARY=./qemu-system-ppc MALLOC_PERTURB_=87
>> PYTHON=/builds/danielhb/qemu/build/pyvenv/bin/python3
>> /builds/danielhb/qemu/build/tests/qtest/test-hmp --tap -k
>> 4325――――――――――――――――――――――――――――――――――――― ✀
>> ―――――――――――――――――――――――――――――――――――――
>> 4326stderr:
>> 4327qemu-system-ppc: Could not find firmware 'u-boot-amigaone.bin'
>> 4328Broken pipe
>> 4329../tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU
>> process but encountered exit status 1 (expected 0)
>> 4330(test program exited with status code -6)
>> 4331TAP parsing error: Too few tests run (expected 13, got 0)
>>
>>
>> You can reproduce it like this:
>>
>> $ make -j -C build && QTEST_QEMU_BINARY=./build/qemu-system-ppc64
>> ./build/tests/qtest/test-hmp
>>
>> I ended up amending in-tree (downloaded the firmware, put it under pc-bios,
>> updated pc-bios/meson.build).
>> My manual test now passes, but not sure if gitlab will nag about it. Let's
>> wait and see.
>
> This is handled in the avocado test and it should download the file from the
> URL there. When tested locally it worked and downloaded the file and
> extracted the firmware bin from it. Can the gitlab CI download stuff or does
> it expect it to be in local cache already where you need to put it somehow
> beforehand? I think Philippe said something about that before but I did not
> quite get it as I don't know neither avocado nor gitlab. Hope Philippe is
> reading it and can chime in.
$ make check-avocado AVOCADO_TAGS=machine:amigaone
[...]
Fetching asset from tests/avocado/ppc_amiga.py:AmigaOneMachine.test_ppc_amigaone
JOB ID : d638ea21275304aee911d63fdb9dc9f11a0f14e3
JOB LOG : [...]tests/results/job-2023-11-07T18.38-d638ea2/job.log
(1/1) tests/avocado/ppc_amiga.py:AmigaOneMachine.test_ppc_amigaone: PASS (0.11 s)
RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB TIME : 1.87 s
This creates $HOME/avocado where it downloads the zip. Maybe you need to
have this dir on your CI runner if it can't download it itself. Looking at
the job.log might tell what happened. I'm afraid I don't know anything
else about this.
Regards,
BALATON Zoltan
> But the test is not required to run the machine so as a last resort you could
> just drop the avocado patch and then we can add it later if we can't figure
> this out now.
>
> Regards,
> BALATON Zoltan
>
>> I told you: code freeze is a blast! Let's see if it's still sunny for the
>> AmigaOne XE board emulation.
>>
>>
>>
>> Thanks,
>>
>>
>> Daniel
>>
>>
>>
>>
>>
>> On 10/27/23 08:54, BALATON Zoltan wrote:
>>> Changes in v7:
>>> - Increase default memory size to 512m to match pegasos2 and sam460ex
>>> and it's a better default for AmigaOS
>>>
>>> Changes in v6:
>>> - Dropped patch 1, now it's
>>>
>>> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>>>
>>> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for PCI
>>> IDE controllers)
>>> - Added Tested-by from Rene
>>>
>>> Changes in v5:
>>> - Fixed avocado test
>>>
>>> Changes in v4:
>>> - Found typo in comment in patch 1 so ended up rewording it again
>>> trying to make it more concise. Also take the idea of using
>>> range_covers_byte from Mark's patch
>>> - Added RFC patch for avocado test (untested, I don't have Avocado)
>>>
>>> Changes in v3:
>>> - Update values, comment and commit message in patch 1 again
>>>
>>> Changes in v2:
>>> - Update comment and commit message in patch 1 (Mark)
>>> - Fix irq mapping in patch 2 (Volker)
>>>
>>> Regards,
>>> BALATON Zoltan
>>>
>>> BALATON Zoltan (3):
>>> hw/pci-host: Add emulation of Mai Logic Articia S
>>> hw/ppc: Add emulation of AmigaOne XE board
>>> tests/avocado: Add test for amigaone board
>>>
>>> MAINTAINERS | 8 +
>>> configs/devices/ppc-softmmu/default.mak | 1 +
>>> hw/pci-host/Kconfig | 5 +
>>> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
>>> hw/pci-host/meson.build | 2 +
>>> hw/ppc/Kconfig | 7 +
>>> hw/ppc/amigaone.c | 164 +++++++++++++
>>> hw/ppc/meson.build | 2 +
>>> include/hw/pci-host/articia.h | 17 ++
>>> tests/avocado/ppc_amiga.py | 38 +++
>>> 10 files changed, 537 insertions(+)
>>> create mode 100644 hw/pci-host/articia.c
>>> create mode 100644 hw/ppc/amigaone.c
>>> create mode 100644 include/hw/pci-host/articia.h
>>> create mode 100644 tests/avocado/ppc_amiga.py
>>>
>>
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-11-07 17:42 ` Daniel Henrique Barboza
@ 2023-11-07 17:49 ` BALATON Zoltan
2023-11-07 18:03 ` BALATON Zoltan
2023-11-07 18:25 ` BALATON Zoltan
1 sibling, 1 reply; 30+ messages in thread
From: BALATON Zoltan @ 2023-11-07 17:49 UTC (permalink / raw)
To: Daniel Henrique Barboza
Cc: qemu-devel, qemu-ppc, Nicholas Piggin, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
[-- Attachment #1: Type: text/plain, Size: 5757 bytes --]
On Tue, 7 Nov 2023, Daniel Henrique Barboza wrote:
> On 11/7/23 14:33, BALATON Zoltan wrote:
>> On Tue, 7 Nov 2023, Daniel Henrique Barboza wrote:
>>> Zoltan,
>>>
>>> Gitlab is complaining about a missing file in one of the tests:
>>>
>>>
>>> 8/259 qemu:qtest+qtest-ppc / qtest-ppc/test-hmp ERROR 0.22s
>>> killed by signal 6 SIGABRT
>>> 4324>>>
>>> G_TEST_DBUS_DAEMON=/builds/danielhb/qemu/tests/dbus-vmstate-daemon.sh
>>> QTEST_QEMU_BINARY=./qemu-system-ppc MALLOC_PERTURB_=87
>>> PYTHON=/builds/danielhb/qemu/build/pyvenv/bin/python3
>>> /builds/danielhb/qemu/build/tests/qtest/test-hmp --tap -k
>>> 4325――――――――――――――――――――――――――――――――――――― ✀
>>> ―――――――――――――――――――――――――――――――――――――
>>> 4326stderr:
>>> 4327qemu-system-ppc: Could not find firmware 'u-boot-amigaone.bin'
>>> 4328Broken pipe
>>> 4329../tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU
>>> process but encountered exit status 1 (expected 0)
>>> 4330(test program exited with status code -6)
>>> 4331TAP parsing error: Too few tests run (expected 13, got 0)
>>>
>>>
>>> You can reproduce it like this:
>>>
>>> $ make -j -C build && QTEST_QEMU_BINARY=./build/qemu-system-ppc64
>>> ./build/tests/qtest/test-hmp
>>>
>>> I ended up amending in-tree (downloaded the firmware, put it under
>>> pc-bios, updated pc-bios/meson.build).
>>> My manual test now passes, but not sure if gitlab will nag about it. Let's
>>> wait and see.
>>
>> This is handled in the avocado test and it should download the file from
>> the URL there. When tested locally it worked and downloaded the file and
>> extracted the firmware bin from it. Can the gitlab CI download stuff or
>> does it expect it to be in local cache already where you need to put it
>> somehow beforehand? I think Philippe said something about that before but I
>> did not quite get it as I don't know neither avocado nor gitlab. Hope
>> Philippe is reading it and can chime in.
>
> Gitlab CI can download stuff. But note that the error above is not
> avocado, it's hmp. It expects a firmware file to be available, and I'm
> not entirely sure it'll make any effort (e.g. downloading it) aside from
> checking if the file exists.
Hmm, that's strange because the extracted firmware is passed with -bios in
the avocado test. But maybe it's then something else tries to run the
machine with some other parameters but it needs a firmware. I was told we
can't add the firmware because while it's GPL the sources were lost and
not available any more so we only have the binary. Then the question is
which test is trying to run the machine without -bios? What's test-hmp?
Regards,
BALATON Zoltan
>> But the test is not required to run the machine so as a last resort you
>> could just drop the avocado patch and then we can add it later if we can't
>> figure this out now.
>
> Not sure if dropping the avocado test would remediate the situation, but
> noted.
>
> For now let's push stuff upstream. We have the freeze window to make smaller
> adjustments if needed.
>
>
> Thanks,
>
> Daniel
>
>>
>> Regards,
>> BALATON Zoltan
>>
>>> I told you: code freeze is a blast! Let's see if it's still sunny for the
>>> AmigaOne XE board emulation.
>>>
>>>
>>>
>>> Thanks,
>>>
>>>
>>> Daniel
>>>
>>>
>>>
>>>
>>>
>>> On 10/27/23 08:54, BALATON Zoltan wrote:
>>>> Changes in v7:
>>>> - Increase default memory size to 512m to match pegasos2 and sam460ex
>>>> and it's a better default for AmigaOS
>>>>
>>>> Changes in v6:
>>>> - Dropped patch 1, now it's
>>>>
>>>> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>>>>
>>>> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for
>>>> PCI IDE controllers)
>>>> - Added Tested-by from Rene
>>>>
>>>> Changes in v5:
>>>> - Fixed avocado test
>>>>
>>>> Changes in v4:
>>>> - Found typo in comment in patch 1 so ended up rewording it again
>>>> trying to make it more concise. Also take the idea of using
>>>> range_covers_byte from Mark's patch
>>>> - Added RFC patch for avocado test (untested, I don't have Avocado)
>>>>
>>>> Changes in v3:
>>>> - Update values, comment and commit message in patch 1 again
>>>>
>>>> Changes in v2:
>>>> - Update comment and commit message in patch 1 (Mark)
>>>> - Fix irq mapping in patch 2 (Volker)
>>>>
>>>> Regards,
>>>> BALATON Zoltan
>>>>
>>>> BALATON Zoltan (3):
>>>> hw/pci-host: Add emulation of Mai Logic Articia S
>>>> hw/ppc: Add emulation of AmigaOne XE board
>>>> tests/avocado: Add test for amigaone board
>>>>
>>>> MAINTAINERS | 8 +
>>>> configs/devices/ppc-softmmu/default.mak | 1 +
>>>> hw/pci-host/Kconfig | 5 +
>>>> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
>>>> hw/pci-host/meson.build | 2 +
>>>> hw/ppc/Kconfig | 7 +
>>>> hw/ppc/amigaone.c | 164 +++++++++++++
>>>> hw/ppc/meson.build | 2 +
>>>> include/hw/pci-host/articia.h | 17 ++
>>>> tests/avocado/ppc_amiga.py | 38 +++
>>>> 10 files changed, 537 insertions(+)
>>>> create mode 100644 hw/pci-host/articia.c
>>>> create mode 100644 hw/ppc/amigaone.c
>>>> create mode 100644 include/hw/pci-host/articia.h
>>>> create mode 100644 tests/avocado/ppc_amiga.py
>>>>
>>>
>>>
>
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-11-07 17:49 ` BALATON Zoltan
@ 2023-11-07 18:03 ` BALATON Zoltan
2023-11-07 18:14 ` Peter Maydell
0 siblings, 1 reply; 30+ messages in thread
From: BALATON Zoltan @ 2023-11-07 18:03 UTC (permalink / raw)
To: Daniel Henrique Barboza
Cc: qemu-devel, qemu-ppc, Nicholas Piggin, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
[-- Attachment #1: Type: text/plain, Size: 6557 bytes --]
On Tue, 7 Nov 2023, BALATON Zoltan wrote:
> On Tue, 7 Nov 2023, Daniel Henrique Barboza wrote:
>> On 11/7/23 14:33, BALATON Zoltan wrote:
>>> On Tue, 7 Nov 2023, Daniel Henrique Barboza wrote:
>>>> Zoltan,
>>>>
>>>> Gitlab is complaining about a missing file in one of the tests:
>>>>
>>>>
>>>> 8/259 qemu:qtest+qtest-ppc / qtest-ppc/test-hmp ERROR 0.22s
>>>> killed by signal 6 SIGABRT
>>>> 4324>>>
>>>> G_TEST_DBUS_DAEMON=/builds/danielhb/qemu/tests/dbus-vmstate-daemon.sh
>>>> QTEST_QEMU_BINARY=./qemu-system-ppc MALLOC_PERTURB_=87
>>>> PYTHON=/builds/danielhb/qemu/build/pyvenv/bin/python3
>>>> /builds/danielhb/qemu/build/tests/qtest/test-hmp --tap -k
>>>> 4325――――――――――――――――――――――――――――――――――――― ✀
>>>> ―――――――――――――――――――――――――――――――――――――
>>>> 4326stderr:
>>>> 4327qemu-system-ppc: Could not find firmware 'u-boot-amigaone.bin'
>>>> 4328Broken pipe
>>>> 4329../tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU
>>>> process but encountered exit status 1 (expected 0)
>>>> 4330(test program exited with status code -6)
>>>> 4331TAP parsing error: Too few tests run (expected 13, got 0)
>>>>
>>>>
>>>> You can reproduce it like this:
>>>>
>>>> $ make -j -C build && QTEST_QEMU_BINARY=./build/qemu-system-ppc64
>>>> ./build/tests/qtest/test-hmp
>>>>
>>>> I ended up amending in-tree (downloaded the firmware, put it under
>>>> pc-bios, updated pc-bios/meson.build).
>>>> My manual test now passes, but not sure if gitlab will nag about it.
>>>> Let's wait and see.
>>>
>>> This is handled in the avocado test and it should download the file from
>>> the URL there. When tested locally it worked and downloaded the file and
>>> extracted the firmware bin from it. Can the gitlab CI download stuff or
>>> does it expect it to be in local cache already where you need to put it
>>> somehow beforehand? I think Philippe said something about that before but
>>> I did not quite get it as I don't know neither avocado nor gitlab. Hope
>>> Philippe is reading it and can chime in.
>>
>> Gitlab CI can download stuff. But note that the error above is not avocado,
>> it's hmp. It expects a firmware file to be available, and I'm not entirely
>> sure it'll make any effort (e.g. downloading it) aside from checking if the
>> file exists.
>
> Hmm, that's strange because the extracted firmware is passed with -bios in
> the avocado test. But maybe it's then something else tries to run the machine
> with some other parameters but it needs a firmware. I was told we can't add
> the firmware because while it's GPL the sources were lost and not available
> any more so we only have the binary. Then the question is which test is
> trying to run the machine without -bios? What's test-hmp?
So if it's tests/qtest/test-hmp.c that seems to try to run a bunch of
command for each machine AFAIU. This machine needs a firmware image but
this test seems to run it with -S and never starts the machine so could
take any file with -bios for that, e.g. -bios vof.bin (thought about -bios
/dev/null but that does not work but any other file should probably be
OK). I don't know how to tell test-hmp to use that thogh or to skip this
machine.
At some point pegasos2 also needed a firmware but this wasn't a problem
back then. Either this test is new or we could just ignore this error?
Regards,
BALATON Zoltan
>>> But the test is not required to run the machine so as a last resort you
>>> could just drop the avocado patch and then we can add it later if we can't
>>> figure this out now.
>>
>> Not sure if dropping the avocado test would remediate the situation, but
>> noted.
>>
>> For now let's push stuff upstream. We have the freeze window to make
>> smaller
>> adjustments if needed.
>>
>>
>> Thanks,
>>
>> Daniel
>>
>>>
>>> Regards,
>>> BALATON Zoltan
>>>
>>>> I told you: code freeze is a blast! Let's see if it's still sunny for the
>>>> AmigaOne XE board emulation.
>>>>
>>>>
>>>>
>>>> Thanks,
>>>>
>>>>
>>>> Daniel
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On 10/27/23 08:54, BALATON Zoltan wrote:
>>>>> Changes in v7:
>>>>> - Increase default memory size to 512m to match pegasos2 and sam460ex
>>>>> and it's a better default for AmigaOS
>>>>>
>>>>> Changes in v6:
>>>>> - Dropped patch 1, now it's
>>>>>
>>>>> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>>>>>
>>>>> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for
>>>>> PCI IDE controllers)
>>>>> - Added Tested-by from Rene
>>>>>
>>>>> Changes in v5:
>>>>> - Fixed avocado test
>>>>>
>>>>> Changes in v4:
>>>>> - Found typo in comment in patch 1 so ended up rewording it again
>>>>> trying to make it more concise. Also take the idea of using
>>>>> range_covers_byte from Mark's patch
>>>>> - Added RFC patch for avocado test (untested, I don't have Avocado)
>>>>>
>>>>> Changes in v3:
>>>>> - Update values, comment and commit message in patch 1 again
>>>>>
>>>>> Changes in v2:
>>>>> - Update comment and commit message in patch 1 (Mark)
>>>>> - Fix irq mapping in patch 2 (Volker)
>>>>>
>>>>> Regards,
>>>>> BALATON Zoltan
>>>>>
>>>>> BALATON Zoltan (3):
>>>>> hw/pci-host: Add emulation of Mai Logic Articia S
>>>>> hw/ppc: Add emulation of AmigaOne XE board
>>>>> tests/avocado: Add test for amigaone board
>>>>>
>>>>> MAINTAINERS | 8 +
>>>>> configs/devices/ppc-softmmu/default.mak | 1 +
>>>>> hw/pci-host/Kconfig | 5 +
>>>>> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
>>>>> hw/pci-host/meson.build | 2 +
>>>>> hw/ppc/Kconfig | 7 +
>>>>> hw/ppc/amigaone.c | 164 +++++++++++++
>>>>> hw/ppc/meson.build | 2 +
>>>>> include/hw/pci-host/articia.h | 17 ++
>>>>> tests/avocado/ppc_amiga.py | 38 +++
>>>>> 10 files changed, 537 insertions(+)
>>>>> create mode 100644 hw/pci-host/articia.c
>>>>> create mode 100644 hw/ppc/amigaone.c
>>>>> create mode 100644 include/hw/pci-host/articia.h
>>>>> create mode 100644 tests/avocado/ppc_amiga.py
>>>>>
>>>>
>>>>
>>
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-11-07 18:03 ` BALATON Zoltan
@ 2023-11-07 18:14 ` Peter Maydell
2023-11-07 18:18 ` BALATON Zoltan
0 siblings, 1 reply; 30+ messages in thread
From: Peter Maydell @ 2023-11-07 18:14 UTC (permalink / raw)
To: BALATON Zoltan
Cc: Daniel Henrique Barboza, qemu-devel, qemu-ppc, Nicholas Piggin,
clg, philmd, Bernhard Beschow, Mark Cave-Ayland, Rene Engel,
vr_qemu
On Tue, 7 Nov 2023 at 18:05, BALATON Zoltan <balaton@eik.bme.hu> wrote:
> So if it's tests/qtest/test-hmp.c that seems to try to run a bunch of
> command for each machine AFAIU. This machine needs a firmware image but
> this test seems to run it with -S and never starts the machine so could
> take any file with -bios for that, e.g. -bios vof.bin (thought about -bios
> /dev/null but that does not work but any other file should probably be
> OK). I don't know how to tell test-hmp to use that thogh or to skip this
> machine.
>
> At some point pegasos2 also needed a firmware but this wasn't a problem
> back then. Either this test is new or we could just ignore this error?
The test has been around for a long time, and no, you can't ignore
'make check' failures, they will break the CI. It's one of
the tests we have that test properties that must be true for
all board types (or all devices, in the case of some other
tests). One of the properties is "it ought to start up cleanly
without extra arguments".
pegasos2 works because there's a vof.bin for it in pc-bios/.
thanks
-- PMM
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-11-07 18:14 ` Peter Maydell
@ 2023-11-07 18:18 ` BALATON Zoltan
2023-11-07 18:21 ` Peter Maydell
0 siblings, 1 reply; 30+ messages in thread
From: BALATON Zoltan @ 2023-11-07 18:18 UTC (permalink / raw)
To: Peter Maydell
Cc: Daniel Henrique Barboza, qemu-devel, qemu-ppc, Nicholas Piggin,
clg, philmd, Bernhard Beschow, Mark Cave-Ayland, Rene Engel,
vr_qemu
On Tue, 7 Nov 2023, Peter Maydell wrote:
> On Tue, 7 Nov 2023 at 18:05, BALATON Zoltan <balaton@eik.bme.hu> wrote:
>> So if it's tests/qtest/test-hmp.c that seems to try to run a bunch of
>> command for each machine AFAIU. This machine needs a firmware image but
>> this test seems to run it with -S and never starts the machine so could
>> take any file with -bios for that, e.g. -bios vof.bin (thought about -bios
>> /dev/null but that does not work but any other file should probably be
>> OK). I don't know how to tell test-hmp to use that thogh or to skip this
>> machine.
>>
>> At some point pegasos2 also needed a firmware but this wasn't a problem
>> back then. Either this test is new or we could just ignore this error?
>
> The test has been around for a long time, and no, you can't ignore
> 'make check' failures, they will break the CI. It's one of
> the tests we have that test properties that must be true for
> all board types (or all devices, in the case of some other
> tests). One of the properties is "it ought to start up cleanly
> without extra arguments".
I'll send a patch in a minute which hopefully fixes that skipping the exit
when using qtest and called without -bios.
> pegasos2 works because there's a vof.bin for it in pc-bios/.
Now it has vof.bin but it did not have that previously and it still worked
when it needed -bios too. But that was a while ago so don't remember the
details.
Regards,
BALATON Zoltan
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-11-07 18:18 ` BALATON Zoltan
@ 2023-11-07 18:21 ` Peter Maydell
0 siblings, 0 replies; 30+ messages in thread
From: Peter Maydell @ 2023-11-07 18:21 UTC (permalink / raw)
To: BALATON Zoltan
Cc: Daniel Henrique Barboza, qemu-devel, qemu-ppc, Nicholas Piggin,
clg, philmd, Bernhard Beschow, Mark Cave-Ayland, Rene Engel,
vr_qemu
On Tue, 7 Nov 2023 at 18:18, BALATON Zoltan <balaton@eik.bme.hu> wrote:
>
> On Tue, 7 Nov 2023, Peter Maydell wrote:
> > On Tue, 7 Nov 2023 at 18:05, BALATON Zoltan <balaton@eik.bme.hu> wrote:
> >> So if it's tests/qtest/test-hmp.c that seems to try to run a bunch of
> >> command for each machine AFAIU. This machine needs a firmware image but
> >> this test seems to run it with -S and never starts the machine so could
> >> take any file with -bios for that, e.g. -bios vof.bin (thought about -bios
> >> /dev/null but that does not work but any other file should probably be
> >> OK). I don't know how to tell test-hmp to use that thogh or to skip this
> >> machine.
> >>
> >> At some point pegasos2 also needed a firmware but this wasn't a problem
> >> back then. Either this test is new or we could just ignore this error?
> >
> > The test has been around for a long time, and no, you can't ignore
> > 'make check' failures, they will break the CI. It's one of
> > the tests we have that test properties that must be true for
> > all board types (or all devices, in the case of some other
> > tests). One of the properties is "it ought to start up cleanly
> > without extra arguments".
>
> I'll send a patch in a minute which hopefully fixes that skipping the exit
> when using qtest and called without -bios.
Yeah, looking at eg hw/mips/malta.c that's what we do there:
we check qtest_enabled() before printing the error about
not being able to load a BIOS blob.
thanks
-- PMM
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH v8 2/3] hw/ppc: Add emulation of AmigaOne XE board
2023-10-27 11:54 ` [PATCH v7 2/3] hw/ppc: Add emulation of AmigaOne XE board BALATON Zoltan
@ 2023-11-07 18:21 ` BALATON Zoltan
2023-11-07 18:25 ` Peter Maydell
2023-11-07 18:40 ` [PATCH v9 " BALATON Zoltan
0 siblings, 2 replies; 30+ messages in thread
From: BALATON Zoltan @ 2023-11-07 18:21 UTC (permalink / raw)
To: qemu-devel, qemu-ppc
Cc: Nicholas Piggin, Daniel Henrique Barboza, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
The AmigaOne is a rebranded MAI Teron board that uses U-Boot firmware
with patches to support AmigaOS and is very similar to pegasos2 so can
be easily emulated sharing most code with pegasos2. The reason to
emulate it is that AmigaOS comes in different versions for AmigaOne
and PegasosII which only have drivers for one machine and firmware so
these only run on the specific machine. Adding this board allows
another AmigaOS version to be used reusing already existing peagasos2
emulation. (The AmigaOne was the first of these boards so likely most
widespread which then inspired Pegasos that was later replaced with
PegasosII due to problems with Articia S, so these have a lot of
similarity. Pegasos mainly ran MorphOS while the PegasosII version of
AmigaOS was added later and therefore less common than the AmigaOne
version.)
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Tested-by: Rene Engel <ReneEngel80@emailn.de>
---
v8: Allow running without -bios when called from qtest
MAINTAINERS | 8 ++
configs/devices/ppc-softmmu/default.mak | 1 +
hw/ppc/Kconfig | 7 +
hw/ppc/amigaone.c | 169 ++++++++++++++++++++++++
hw/ppc/meson.build | 2 +
5 files changed, 187 insertions(+)
create mode 100644 hw/ppc/amigaone.c
diff --git a/MAINTAINERS b/MAINTAINERS
index b86ea7f75a..3d0aec7ffa 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1536,6 +1536,14 @@ F: hw/pci-host/mv64361.c
F: hw/pci-host/mv643xx.h
F: include/hw/pci-host/mv64361.h
+amigaone
+M: BALATON Zoltan <balaton@eik.bme.hu>
+L: qemu-ppc@nongnu.org
+S: Maintained
+F: hw/ppc/amigaone.c
+F: hw/pci-host/articia.c
+F: include/hw/pci-host/articia.h
+
Virtual Open Firmware (VOF)
M: Alexey Kardashevskiy <aik@ozlabs.ru>
R: David Gibson <david@gibson.dropbear.id.au>
diff --git a/configs/devices/ppc-softmmu/default.mak b/configs/devices/ppc-softmmu/default.mak
index a887f5438b..b85fd2bcd7 100644
--- a/configs/devices/ppc-softmmu/default.mak
+++ b/configs/devices/ppc-softmmu/default.mak
@@ -14,6 +14,7 @@ CONFIG_SAM460EX=y
CONFIG_MAC_OLDWORLD=y
CONFIG_MAC_NEWWORLD=y
+CONFIG_AMIGAONE=y
CONFIG_PEGASOS2=y
# For PReP
diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
index 5dfbf47ef5..56f0475a8e 100644
--- a/hw/ppc/Kconfig
+++ b/hw/ppc/Kconfig
@@ -69,6 +69,13 @@ config SAM460EX
select USB_OHCI
select FDT_PPC
+config AMIGAONE
+ bool
+ imply ATI_VGA
+ select ARTICIA
+ select VT82C686
+ select SMBUS_EEPROM
+
config PEGASOS2
bool
imply ATI_VGA
diff --git a/hw/ppc/amigaone.c b/hw/ppc/amigaone.c
new file mode 100644
index 0000000000..37df43cea3
--- /dev/null
+++ b/hw/ppc/amigaone.c
@@ -0,0 +1,169 @@
+/*
+ * QEMU Eyetech AmigaOne/Mai Logic Teron emulation
+ *
+ * Copyright (c) 2023 BALATON Zoltan
+ *
+ * This work is licensed under the GNU GPL license version 2 or later.
+ *
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/units.h"
+#include "qemu/datadir.h"
+#include "qemu/log.h"
+#include "qemu/error-report.h"
+#include "qapi/error.h"
+#include "hw/ppc/ppc.h"
+#include "hw/boards.h"
+#include "hw/loader.h"
+#include "hw/pci-host/articia.h"
+#include "hw/isa/vt82c686.h"
+#include "hw/ide/pci.h"
+#include "hw/i2c/smbus_eeprom.h"
+#include "hw/ppc/ppc.h"
+#include "sysemu/qtest.h"
+#include "sysemu/reset.h"
+#include "kvm_ppc.h"
+
+#define BUS_FREQ_HZ 100000000
+
+/*
+ * Firmware binary available at
+ * https://www.hyperion-entertainment.com/index.php/downloads?view=files&parent=28
+ * then "tail -c 524288 updater.image >u-boot-amigaone.bin"
+ *
+ * BIOS emulator in firmware cannot run QEMU vgabios and hangs on it, use
+ * -device VGA,romfile=VGABIOS-lgpl-latest.bin
+ * from http://www.nongnu.org/vgabios/ instead.
+ */
+#define PROM_FILENAME "u-boot-amigaone.bin"
+#define PROM_ADDR 0xfff00000
+#define PROM_SIZE (512 * KiB)
+
+static void amigaone_cpu_reset(void *opaque)
+{
+ PowerPCCPU *cpu = opaque;
+
+ cpu_reset(CPU(cpu));
+ cpu_ppc_tb_reset(&cpu->env);
+}
+
+static void fix_spd_data(uint8_t *spd)
+{
+ uint32_t bank_size = 4 * MiB * spd[31];
+ uint32_t rows = bank_size / spd[13] / spd[17];
+ spd[3] = ctz32(rows) - spd[4];
+}
+
+static void amigaone_init(MachineState *machine)
+{
+ PowerPCCPU *cpu;
+ CPUPPCState *env;
+ MemoryRegion *rom, *pci_mem, *mr;
+ const char *fwname = machine->firmware ?: PROM_FILENAME;
+ char *filename;
+ ssize_t sz;
+ PCIBus *pci_bus;
+ Object *via;
+ DeviceState *dev;
+ I2CBus *i2c_bus;
+ uint8_t *spd_data;
+ int i;
+
+ /* init CPU */
+ cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
+ env = &cpu->env;
+ if (PPC_INPUT(env) != PPC_FLAGS_INPUT_6xx) {
+ error_report("Incompatible CPU, only 6xx bus supported");
+ exit(1);
+ }
+ cpu_ppc_tb_init(env, BUS_FREQ_HZ / 4);
+ qemu_register_reset(amigaone_cpu_reset, cpu);
+
+ /* RAM */
+ if (machine->ram_size > 2 * GiB) {
+ error_report("RAM size more than 2 GiB is not supported");
+ exit(1);
+ }
+ memory_region_add_subregion(get_system_memory(), 0, machine->ram);
+ if (machine->ram_size < 1 * GiB + 32 * KiB) {
+ /* Firmware uses this area for startup */
+ mr = g_new(MemoryRegion, 1);
+ memory_region_init_ram(mr, NULL, "init-cache", 32 * KiB, &error_fatal);
+ memory_region_add_subregion(get_system_memory(), 0x40000000, mr);
+ }
+
+ /* allocate and load firmware */
+ filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, fwname);
+ if (!filename) {
+ error_report("Could not find firmware '%s'", fwname);
+ /* qtest/test-hmp expects to be able to run the machine without -bios */
+ if (!qtest_enabled()) {
+ exit(1);
+ }
+ } else {
+ rom = g_new(MemoryRegion, 1);
+ memory_region_init_rom(rom, NULL, "rom", PROM_SIZE, &error_fatal);
+ memory_region_add_subregion(get_system_memory(), PROM_ADDR, rom);
+ sz = load_image_targphys(filename, PROM_ADDR, PROM_SIZE);
+ if (sz <= 0 || sz > PROM_SIZE) {
+ error_report("Could not load firmware '%s'", filename);
+ exit(1);
+ }
+ }
+ g_free(filename);
+
+ /* Articia S */
+ dev = sysbus_create_simple(TYPE_ARTICIA, 0xfe000000, NULL);
+
+ i2c_bus = I2C_BUS(qdev_get_child_bus(dev, "smbus"));
+ if (machine->ram_size > 512 * MiB) {
+ spd_data = spd_data_generate(SDR, machine->ram_size / 2);
+ } else {
+ spd_data = spd_data_generate(SDR, machine->ram_size);
+ }
+ fix_spd_data(spd_data);
+ smbus_eeprom_init_one(i2c_bus, 0x51, spd_data);
+ if (machine->ram_size > 512 * MiB) {
+ smbus_eeprom_init_one(i2c_bus, 0x52, spd_data);
+ }
+
+ pci_mem = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1);
+ mr = g_new(MemoryRegion, 1);
+ memory_region_init_alias(mr, OBJECT(dev), "pci-mem-low", pci_mem,
+ 0, 0x1000000);
+ memory_region_add_subregion(get_system_memory(), 0xfd000000, mr);
+ mr = g_new(MemoryRegion, 1);
+ memory_region_init_alias(mr, OBJECT(dev), "pci-mem-high", pci_mem,
+ 0x80000000, 0x7d000000);
+ memory_region_add_subregion(get_system_memory(), 0x80000000, mr);
+ pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci.0"));
+
+ /* VIA VT82c686B South Bridge (multifunction PCI device) */
+ via = OBJECT(pci_create_simple_multifunction(pci_bus, PCI_DEVFN(7, 0),
+ TYPE_VT82C686B_ISA));
+ object_property_add_alias(OBJECT(machine), "rtc-time",
+ object_resolve_path_component(via, "rtc"),
+ "date");
+ qdev_connect_gpio_out(DEVICE(via), 0,
+ qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_INT));
+ for (i = 0; i < PCI_NUM_PINS; i++) {
+ qdev_connect_gpio_out(dev, i, qdev_get_gpio_in_named(DEVICE(via),
+ "pirq", i));
+ }
+ pci_ide_create_devs(PCI_DEVICE(object_resolve_path_component(via, "ide")));
+ pci_vga_init(pci_bus);
+}
+
+static void amigaone_machine_init(MachineClass *mc)
+{
+ mc->desc = "Eyetech AmigaOne/Mai Logic Teron";
+ mc->init = amigaone_init;
+ mc->block_default_type = IF_IDE;
+ mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("7457_v1.2");
+ mc->default_display = "std";
+ mc->default_ram_id = "ram";
+ mc->default_ram_size = 512 * MiB;
+}
+
+DEFINE_MACHINE("amigaone", amigaone_machine_init)
diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build
index 7c2c52434a..7338f9432a 100644
--- a/hw/ppc/meson.build
+++ b/hw/ppc/meson.build
@@ -81,6 +81,8 @@ ppc_ss.add(when: 'CONFIG_E500', if_true: files(
))
# PowerPC 440 Xilinx ML507 reference board.
ppc_ss.add(when: 'CONFIG_VIRTEX', if_true: files('virtex_ml507.c'))
+# AmigaOne
+ppc_ss.add(when: 'CONFIG_AMIGAONE', if_true: files('amigaone.c'))
# Pegasos2
ppc_ss.add(when: 'CONFIG_PEGASOS2', if_true: files('pegasos2.c'))
--
2.30.9
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH v8 2/3] hw/ppc: Add emulation of AmigaOne XE board
2023-11-07 18:21 ` [PATCH v8 " BALATON Zoltan
@ 2023-11-07 18:25 ` Peter Maydell
2023-11-07 18:28 ` BALATON Zoltan
2023-11-07 18:40 ` [PATCH v9 " BALATON Zoltan
1 sibling, 1 reply; 30+ messages in thread
From: Peter Maydell @ 2023-11-07 18:25 UTC (permalink / raw)
To: BALATON Zoltan
Cc: qemu-devel, qemu-ppc, Nicholas Piggin, Daniel Henrique Barboza,
clg, philmd, Bernhard Beschow, Mark Cave-Ayland, Rene Engel,
vr_qemu
On Tue, 7 Nov 2023 at 18:21, BALATON Zoltan <balaton@eik.bme.hu> wrote:
>
> The AmigaOne is a rebranded MAI Teron board that uses U-Boot firmware
> with patches to support AmigaOS and is very similar to pegasos2 so can
> be easily emulated sharing most code with pegasos2. The reason to
> emulate it is that AmigaOS comes in different versions for AmigaOne
> and PegasosII which only have drivers for one machine and firmware so
> these only run on the specific machine. Adding this board allows
> another AmigaOS version to be used reusing already existing peagasos2
> emulation. (The AmigaOne was the first of these boards so likely most
> widespread which then inspired Pegasos that was later replaced with
> PegasosII due to problems with Articia S, so these have a lot of
> similarity. Pegasos mainly ran MorphOS while the PegasosII version of
> AmigaOS was added later and therefore less common than the AmigaOne
> version.)
> + filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, fwname);
> + if (!filename) {
> + error_report("Could not find firmware '%s'", fwname);
> + /* qtest/test-hmp expects to be able to run the machine without -bios */
> + if (!qtest_enabled()) {
> + exit(1);
> + }
You should put the error_report() line inside the if() as well,
to stop the error line turning up in the logfiles/stdout. This
is what we do for the various MIPS boards that ordinarily
need a BIOS blob.
thanks
-- PMM
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-11-07 17:42 ` Daniel Henrique Barboza
2023-11-07 17:49 ` BALATON Zoltan
@ 2023-11-07 18:25 ` BALATON Zoltan
2023-11-07 18:41 ` BALATON Zoltan
1 sibling, 1 reply; 30+ messages in thread
From: BALATON Zoltan @ 2023-11-07 18:25 UTC (permalink / raw)
To: Daniel Henrique Barboza
Cc: qemu-devel, qemu-ppc, Nicholas Piggin, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
[-- Attachment #1: Type: text/plain, Size: 5586 bytes --]
On Tue, 7 Nov 2023, Daniel Henrique Barboza wrote:
> On 11/7/23 14:33, BALATON Zoltan wrote:
>> On Tue, 7 Nov 2023, Daniel Henrique Barboza wrote:
>>> Zoltan,
>>>
>>> Gitlab is complaining about a missing file in one of the tests:
>>>
>>>
>>> 8/259 qemu:qtest+qtest-ppc / qtest-ppc/test-hmp ERROR 0.22s
>>> killed by signal 6 SIGABRT
>>> 4324>>>
>>> G_TEST_DBUS_DAEMON=/builds/danielhb/qemu/tests/dbus-vmstate-daemon.sh
>>> QTEST_QEMU_BINARY=./qemu-system-ppc MALLOC_PERTURB_=87
>>> PYTHON=/builds/danielhb/qemu/build/pyvenv/bin/python3
>>> /builds/danielhb/qemu/build/tests/qtest/test-hmp --tap -k
>>> 4325――――――――――――――――――――――――――――――――――――― ✀
>>> ―――――――――――――――――――――――――――――――――――――
>>> 4326stderr:
>>> 4327qemu-system-ppc: Could not find firmware 'u-boot-amigaone.bin'
>>> 4328Broken pipe
>>> 4329../tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU
>>> process but encountered exit status 1 (expected 0)
>>> 4330(test program exited with status code -6)
>>> 4331TAP parsing error: Too few tests run (expected 13, got 0)
OK, how about with v8 of patch2 I've just sent? The other pathches are
unchanged so did not resend those. It should allow ronning without -bios
for qtest and as this test just runs monitor commands without starting the
machine that should be OK. Hopefully this fixes it.
Regards,
BALATON Zoltan
>>> You can reproduce it like this:
>>>
>>> $ make -j -C build && QTEST_QEMU_BINARY=./build/qemu-system-ppc64
>>> ./build/tests/qtest/test-hmp
>>>
>>> I ended up amending in-tree (downloaded the firmware, put it under
>>> pc-bios, updated pc-bios/meson.build).
>>> My manual test now passes, but not sure if gitlab will nag about it. Let's
>>> wait and see.
>>
>> This is handled in the avocado test and it should download the file from
>> the URL there. When tested locally it worked and downloaded the file and
>> extracted the firmware bin from it. Can the gitlab CI download stuff or
>> does it expect it to be in local cache already where you need to put it
>> somehow beforehand? I think Philippe said something about that before but I
>> did not quite get it as I don't know neither avocado nor gitlab. Hope
>> Philippe is reading it and can chime in.
>
> Gitlab CI can download stuff. But note that the error above is not avocado,
> it's hmp.
> It expects a firmware file to be available, and I'm not entirely sure it'll
> make any
> effort (e.g. downloading it) aside from checking if the file exists.
>>
>> But the test is not required to run the machine so as a last resort you
>> could just drop the avocado patch and then we can add it later if we can't
>> figure this out now.
>
> Not sure if dropping the avocado test would remediate the situation, but
> noted.
>
> For now let's push stuff upstream. We have the freeze window to make smaller
> adjustments if needed.
>
>
> Thanks,
>
> Daniel
>
>>
>> Regards,
>> BALATON Zoltan
>>
>>> I told you: code freeze is a blast! Let's see if it's still sunny for the
>>> AmigaOne XE board emulation.
>>>
>>>
>>>
>>> Thanks,
>>>
>>>
>>> Daniel
>>>
>>>
>>>
>>>
>>>
>>> On 10/27/23 08:54, BALATON Zoltan wrote:
>>>> Changes in v7:
>>>> - Increase default memory size to 512m to match pegasos2 and sam460ex
>>>> and it's a better default for AmigaOS
>>>>
>>>> Changes in v6:
>>>> - Dropped patch 1, now it's
>>>>
>>>> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>>>>
>>>> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for
>>>> PCI IDE controllers)
>>>> - Added Tested-by from Rene
>>>>
>>>> Changes in v5:
>>>> - Fixed avocado test
>>>>
>>>> Changes in v4:
>>>> - Found typo in comment in patch 1 so ended up rewording it again
>>>> trying to make it more concise. Also take the idea of using
>>>> range_covers_byte from Mark's patch
>>>> - Added RFC patch for avocado test (untested, I don't have Avocado)
>>>>
>>>> Changes in v3:
>>>> - Update values, comment and commit message in patch 1 again
>>>>
>>>> Changes in v2:
>>>> - Update comment and commit message in patch 1 (Mark)
>>>> - Fix irq mapping in patch 2 (Volker)
>>>>
>>>> Regards,
>>>> BALATON Zoltan
>>>>
>>>> BALATON Zoltan (3):
>>>> hw/pci-host: Add emulation of Mai Logic Articia S
>>>> hw/ppc: Add emulation of AmigaOne XE board
>>>> tests/avocado: Add test for amigaone board
>>>>
>>>> MAINTAINERS | 8 +
>>>> configs/devices/ppc-softmmu/default.mak | 1 +
>>>> hw/pci-host/Kconfig | 5 +
>>>> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
>>>> hw/pci-host/meson.build | 2 +
>>>> hw/ppc/Kconfig | 7 +
>>>> hw/ppc/amigaone.c | 164 +++++++++++++
>>>> hw/ppc/meson.build | 2 +
>>>> include/hw/pci-host/articia.h | 17 ++
>>>> tests/avocado/ppc_amiga.py | 38 +++
>>>> 10 files changed, 537 insertions(+)
>>>> create mode 100644 hw/pci-host/articia.c
>>>> create mode 100644 hw/ppc/amigaone.c
>>>> create mode 100644 include/hw/pci-host/articia.h
>>>> create mode 100644 tests/avocado/ppc_amiga.py
>>>>
>>>
>>>
>
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v8 2/3] hw/ppc: Add emulation of AmigaOne XE board
2023-11-07 18:25 ` Peter Maydell
@ 2023-11-07 18:28 ` BALATON Zoltan
0 siblings, 0 replies; 30+ messages in thread
From: BALATON Zoltan @ 2023-11-07 18:28 UTC (permalink / raw)
To: Peter Maydell
Cc: qemu-devel, qemu-ppc, Nicholas Piggin, Daniel Henrique Barboza,
clg, philmd, Bernhard Beschow, Mark Cave-Ayland, Rene Engel,
vr_qemu
On Tue, 7 Nov 2023, Peter Maydell wrote:
> On Tue, 7 Nov 2023 at 18:21, BALATON Zoltan <balaton@eik.bme.hu> wrote:
>>
>> The AmigaOne is a rebranded MAI Teron board that uses U-Boot firmware
>> with patches to support AmigaOS and is very similar to pegasos2 so can
>> be easily emulated sharing most code with pegasos2. The reason to
>> emulate it is that AmigaOS comes in different versions for AmigaOne
>> and PegasosII which only have drivers for one machine and firmware so
>> these only run on the specific machine. Adding this board allows
>> another AmigaOS version to be used reusing already existing peagasos2
>> emulation. (The AmigaOne was the first of these boards so likely most
>> widespread which then inspired Pegasos that was later replaced with
>> PegasosII due to problems with Articia S, so these have a lot of
>> similarity. Pegasos mainly ran MorphOS while the PegasosII version of
>> AmigaOS was added later and therefore less common than the AmigaOne
>> version.)
>> + filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, fwname);
>> + if (!filename) {
>> + error_report("Could not find firmware '%s'", fwname);
>> + /* qtest/test-hmp expects to be able to run the machine without -bios */
>> + if (!qtest_enabled()) {
>> + exit(1);
>> + }
>
> You should put the error_report() line inside the if() as well,
> to stop the error line turning up in the logfiles/stdout. This
> is what we do for the various MIPS boards that ordinarily
> need a BIOS blob.
OK, I'll do a v9 then...
Regards,
BALATON Zoltan
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH v9 2/3] hw/ppc: Add emulation of AmigaOne XE board
2023-11-07 18:21 ` [PATCH v8 " BALATON Zoltan
2023-11-07 18:25 ` Peter Maydell
@ 2023-11-07 18:40 ` BALATON Zoltan
2023-11-07 18:52 ` Daniel Henrique Barboza
1 sibling, 1 reply; 30+ messages in thread
From: BALATON Zoltan @ 2023-11-07 18:40 UTC (permalink / raw)
To: qemu-devel, qemu-ppc
Cc: Nicholas Piggin, Daniel Henrique Barboza, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
The AmigaOne is a rebranded MAI Teron board that uses U-Boot firmware
with patches to support AmigaOS and is very similar to pegasos2 so can
be easily emulated sharing most code with pegasos2. The reason to
emulate it is that AmigaOS comes in different versions for AmigaOne
and PegasosII which only have drivers for one machine and firmware so
these only run on the specific machine. Adding this board allows
another AmigaOS version to be used reusing already existing peagasos2
emulation. (The AmigaOne was the first of these boards so likely most
widespread which then inspired Pegasos that was later replaced with
PegasosII due to problems with Articia S, so these have a lot of
similarity. Pegasos mainly ran MorphOS while the PegasosII version of
AmigaOS was added later and therefore less common than the AmigaOne
version.)
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Tested-by: Rene Engel <ReneEngel80@emailn.de>
---
v9: Skip error about missing -bios when using qtest
MAINTAINERS | 8 ++
configs/devices/ppc-softmmu/default.mak | 1 +
hw/ppc/Kconfig | 7 +
hw/ppc/amigaone.c | 166 ++++++++++++++++++++++++
hw/ppc/meson.build | 2 +
5 files changed, 184 insertions(+)
create mode 100644 hw/ppc/amigaone.c
diff --git a/MAINTAINERS b/MAINTAINERS
index b86ea7f75a..3d0aec7ffa 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1536,6 +1536,14 @@ F: hw/pci-host/mv64361.c
F: hw/pci-host/mv643xx.h
F: include/hw/pci-host/mv64361.h
+amigaone
+M: BALATON Zoltan <balaton@eik.bme.hu>
+L: qemu-ppc@nongnu.org
+S: Maintained
+F: hw/ppc/amigaone.c
+F: hw/pci-host/articia.c
+F: include/hw/pci-host/articia.h
+
Virtual Open Firmware (VOF)
M: Alexey Kardashevskiy <aik@ozlabs.ru>
R: David Gibson <david@gibson.dropbear.id.au>
diff --git a/configs/devices/ppc-softmmu/default.mak b/configs/devices/ppc-softmmu/default.mak
index a887f5438b..b85fd2bcd7 100644
--- a/configs/devices/ppc-softmmu/default.mak
+++ b/configs/devices/ppc-softmmu/default.mak
@@ -14,6 +14,7 @@ CONFIG_SAM460EX=y
CONFIG_MAC_OLDWORLD=y
CONFIG_MAC_NEWWORLD=y
+CONFIG_AMIGAONE=y
CONFIG_PEGASOS2=y
# For PReP
diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
index 5dfbf47ef5..56f0475a8e 100644
--- a/hw/ppc/Kconfig
+++ b/hw/ppc/Kconfig
@@ -69,6 +69,13 @@ config SAM460EX
select USB_OHCI
select FDT_PPC
+config AMIGAONE
+ bool
+ imply ATI_VGA
+ select ARTICIA
+ select VT82C686
+ select SMBUS_EEPROM
+
config PEGASOS2
bool
imply ATI_VGA
diff --git a/hw/ppc/amigaone.c b/hw/ppc/amigaone.c
new file mode 100644
index 0000000000..992a55e632
--- /dev/null
+++ b/hw/ppc/amigaone.c
@@ -0,0 +1,166 @@
+/*
+ * QEMU Eyetech AmigaOne/Mai Logic Teron emulation
+ *
+ * Copyright (c) 2023 BALATON Zoltan
+ *
+ * This work is licensed under the GNU GPL license version 2 or later.
+ *
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/units.h"
+#include "qemu/datadir.h"
+#include "qemu/log.h"
+#include "qemu/error-report.h"
+#include "qapi/error.h"
+#include "hw/ppc/ppc.h"
+#include "hw/boards.h"
+#include "hw/loader.h"
+#include "hw/pci-host/articia.h"
+#include "hw/isa/vt82c686.h"
+#include "hw/ide/pci.h"
+#include "hw/i2c/smbus_eeprom.h"
+#include "hw/ppc/ppc.h"
+#include "sysemu/qtest.h"
+#include "sysemu/reset.h"
+#include "kvm_ppc.h"
+
+#define BUS_FREQ_HZ 100000000
+
+/*
+ * Firmware binary available at
+ * https://www.hyperion-entertainment.com/index.php/downloads?view=files&parent=28
+ * then "tail -c 524288 updater.image >u-boot-amigaone.bin"
+ *
+ * BIOS emulator in firmware cannot run QEMU vgabios and hangs on it, use
+ * -device VGA,romfile=VGABIOS-lgpl-latest.bin
+ * from http://www.nongnu.org/vgabios/ instead.
+ */
+#define PROM_FILENAME "u-boot-amigaone.bin"
+#define PROM_ADDR 0xfff00000
+#define PROM_SIZE (512 * KiB)
+
+static void amigaone_cpu_reset(void *opaque)
+{
+ PowerPCCPU *cpu = opaque;
+
+ cpu_reset(CPU(cpu));
+ cpu_ppc_tb_reset(&cpu->env);
+}
+
+static void fix_spd_data(uint8_t *spd)
+{
+ uint32_t bank_size = 4 * MiB * spd[31];
+ uint32_t rows = bank_size / spd[13] / spd[17];
+ spd[3] = ctz32(rows) - spd[4];
+}
+
+static void amigaone_init(MachineState *machine)
+{
+ PowerPCCPU *cpu;
+ CPUPPCState *env;
+ MemoryRegion *rom, *pci_mem, *mr;
+ const char *fwname = machine->firmware ?: PROM_FILENAME;
+ char *filename;
+ ssize_t sz;
+ PCIBus *pci_bus;
+ Object *via;
+ DeviceState *dev;
+ I2CBus *i2c_bus;
+ uint8_t *spd_data;
+ int i;
+
+ /* init CPU */
+ cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
+ env = &cpu->env;
+ if (PPC_INPUT(env) != PPC_FLAGS_INPUT_6xx) {
+ error_report("Incompatible CPU, only 6xx bus supported");
+ exit(1);
+ }
+ cpu_ppc_tb_init(env, BUS_FREQ_HZ / 4);
+ qemu_register_reset(amigaone_cpu_reset, cpu);
+
+ /* RAM */
+ if (machine->ram_size > 2 * GiB) {
+ error_report("RAM size more than 2 GiB is not supported");
+ exit(1);
+ }
+ memory_region_add_subregion(get_system_memory(), 0, machine->ram);
+ if (machine->ram_size < 1 * GiB + 32 * KiB) {
+ /* Firmware uses this area for startup */
+ mr = g_new(MemoryRegion, 1);
+ memory_region_init_ram(mr, NULL, "init-cache", 32 * KiB, &error_fatal);
+ memory_region_add_subregion(get_system_memory(), 0x40000000, mr);
+ }
+
+ /* allocate and load firmware */
+ filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, fwname);
+ if (filename) {
+ rom = g_new(MemoryRegion, 1);
+ memory_region_init_rom(rom, NULL, "rom", PROM_SIZE, &error_fatal);
+ memory_region_add_subregion(get_system_memory(), PROM_ADDR, rom);
+ sz = load_image_targphys(filename, PROM_ADDR, PROM_SIZE);
+ if (sz <= 0 || sz > PROM_SIZE) {
+ error_report("Could not load firmware '%s'", filename);
+ exit(1);
+ }
+ g_free(filename);
+ } else if (!qtest_enabled()) {
+ error_report("Could not find firmware '%s'", fwname);
+ exit(1);
+ }
+
+ /* Articia S */
+ dev = sysbus_create_simple(TYPE_ARTICIA, 0xfe000000, NULL);
+
+ i2c_bus = I2C_BUS(qdev_get_child_bus(dev, "smbus"));
+ if (machine->ram_size > 512 * MiB) {
+ spd_data = spd_data_generate(SDR, machine->ram_size / 2);
+ } else {
+ spd_data = spd_data_generate(SDR, machine->ram_size);
+ }
+ fix_spd_data(spd_data);
+ smbus_eeprom_init_one(i2c_bus, 0x51, spd_data);
+ if (machine->ram_size > 512 * MiB) {
+ smbus_eeprom_init_one(i2c_bus, 0x52, spd_data);
+ }
+
+ pci_mem = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1);
+ mr = g_new(MemoryRegion, 1);
+ memory_region_init_alias(mr, OBJECT(dev), "pci-mem-low", pci_mem,
+ 0, 0x1000000);
+ memory_region_add_subregion(get_system_memory(), 0xfd000000, mr);
+ mr = g_new(MemoryRegion, 1);
+ memory_region_init_alias(mr, OBJECT(dev), "pci-mem-high", pci_mem,
+ 0x80000000, 0x7d000000);
+ memory_region_add_subregion(get_system_memory(), 0x80000000, mr);
+ pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci.0"));
+
+ /* VIA VT82c686B South Bridge (multifunction PCI device) */
+ via = OBJECT(pci_create_simple_multifunction(pci_bus, PCI_DEVFN(7, 0),
+ TYPE_VT82C686B_ISA));
+ object_property_add_alias(OBJECT(machine), "rtc-time",
+ object_resolve_path_component(via, "rtc"),
+ "date");
+ qdev_connect_gpio_out(DEVICE(via), 0,
+ qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_INT));
+ for (i = 0; i < PCI_NUM_PINS; i++) {
+ qdev_connect_gpio_out(dev, i, qdev_get_gpio_in_named(DEVICE(via),
+ "pirq", i));
+ }
+ pci_ide_create_devs(PCI_DEVICE(object_resolve_path_component(via, "ide")));
+ pci_vga_init(pci_bus);
+}
+
+static void amigaone_machine_init(MachineClass *mc)
+{
+ mc->desc = "Eyetech AmigaOne/Mai Logic Teron";
+ mc->init = amigaone_init;
+ mc->block_default_type = IF_IDE;
+ mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("7457_v1.2");
+ mc->default_display = "std";
+ mc->default_ram_id = "ram";
+ mc->default_ram_size = 512 * MiB;
+}
+
+DEFINE_MACHINE("amigaone", amigaone_machine_init)
diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build
index 7c2c52434a..7338f9432a 100644
--- a/hw/ppc/meson.build
+++ b/hw/ppc/meson.build
@@ -81,6 +81,8 @@ ppc_ss.add(when: 'CONFIG_E500', if_true: files(
))
# PowerPC 440 Xilinx ML507 reference board.
ppc_ss.add(when: 'CONFIG_VIRTEX', if_true: files('virtex_ml507.c'))
+# AmigaOne
+ppc_ss.add(when: 'CONFIG_AMIGAONE', if_true: files('amigaone.c'))
# Pegasos2
ppc_ss.add(when: 'CONFIG_PEGASOS2', if_true: files('pegasos2.c'))
--
2.30.9
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-11-07 18:25 ` BALATON Zoltan
@ 2023-11-07 18:41 ` BALATON Zoltan
0 siblings, 0 replies; 30+ messages in thread
From: BALATON Zoltan @ 2023-11-07 18:41 UTC (permalink / raw)
To: Daniel Henrique Barboza
Cc: qemu-devel, qemu-ppc, Nicholas Piggin, clg, philmd,
Bernhard Beschow, Mark Cave-Ayland, Rene Engel, vr_qemu
[-- Attachment #1: Type: text/plain, Size: 5836 bytes --]
On Tue, 7 Nov 2023, BALATON Zoltan wrote:
> On Tue, 7 Nov 2023, Daniel Henrique Barboza wrote:
>> On 11/7/23 14:33, BALATON Zoltan wrote:
>>> On Tue, 7 Nov 2023, Daniel Henrique Barboza wrote:
>>>> Zoltan,
>>>>
>>>> Gitlab is complaining about a missing file in one of the tests:
>>>>
>>>>
>>>> 8/259 qemu:qtest+qtest-ppc / qtest-ppc/test-hmp ERROR 0.22s
>>>> killed by signal 6 SIGABRT
>>>> 4324>>>
>>>> G_TEST_DBUS_DAEMON=/builds/danielhb/qemu/tests/dbus-vmstate-daemon.sh
>>>> QTEST_QEMU_BINARY=./qemu-system-ppc MALLOC_PERTURB_=87
>>>> PYTHON=/builds/danielhb/qemu/build/pyvenv/bin/python3
>>>> /builds/danielhb/qemu/build/tests/qtest/test-hmp --tap -k
>>>> 4325――――――――――――――――――――――――――――――――――――― ✀
>>>> ―――――――――――――――――――――――――――――――――――――
>>>> 4326stderr:
>>>> 4327qemu-system-ppc: Could not find firmware 'u-boot-amigaone.bin'
>>>> 4328Broken pipe
>>>> 4329../tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU
>>>> process but encountered exit status 1 (expected 0)
>>>> 4330(test program exited with status code -6)
>>>> 4331TAP parsing error: Too few tests run (expected 13, got 0)
>
> OK, how about with v8 of patch2 I've just sent? The other pathches are
OK, sent v9 then. This shuold be it now.
> unchanged so did not resend those. It should allow ronning without -bios for
> qtest and as this test just runs monitor commands without starting the
> machine that should be OK. Hopefully this fixes it.
>
> Regards,
> BALATON Zoltan
>
>>>> You can reproduce it like this:
>>>>
>>>> $ make -j -C build && QTEST_QEMU_BINARY=./build/qemu-system-ppc64
>>>> ./build/tests/qtest/test-hmp
>>>>
>>>> I ended up amending in-tree (downloaded the firmware, put it under
>>>> pc-bios, updated pc-bios/meson.build).
>>>> My manual test now passes, but not sure if gitlab will nag about it.
>>>> Let's wait and see.
>>>
>>> This is handled in the avocado test and it should download the file from
>>> the URL there. When tested locally it worked and downloaded the file and
>>> extracted the firmware bin from it. Can the gitlab CI download stuff or
>>> does it expect it to be in local cache already where you need to put it
>>> somehow beforehand? I think Philippe said something about that before but
>>> I did not quite get it as I don't know neither avocado nor gitlab. Hope
>>> Philippe is reading it and can chime in.
>>
>> Gitlab CI can download stuff. But note that the error above is not avocado,
>> it's hmp.
>> It expects a firmware file to be available, and I'm not entirely sure it'll
>> make any
>> effort (e.g. downloading it) aside from checking if the file exists.
>>>
>>> But the test is not required to run the machine so as a last resort you
>>> could just drop the avocado patch and then we can add it later if we can't
>>> figure this out now.
>>
>> Not sure if dropping the avocado test would remediate the situation, but
>> noted.
>>
>> For now let's push stuff upstream. We have the freeze window to make
>> smaller
>> adjustments if needed.
>>
>>
>> Thanks,
>>
>> Daniel
>>
>>>
>>> Regards,
>>> BALATON Zoltan
>>>
>>>> I told you: code freeze is a blast! Let's see if it's still sunny for the
>>>> AmigaOne XE board emulation.
>>>>
>>>>
>>>>
>>>> Thanks,
>>>>
>>>>
>>>> Daniel
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On 10/27/23 08:54, BALATON Zoltan wrote:
>>>>> Changes in v7:
>>>>> - Increase default memory size to 512m to match pegasos2 and sam460ex
>>>>> and it's a better default for AmigaOS
>>>>>
>>>>> Changes in v6:
>>>>> - Dropped patch 1, now it's
>>>>>
>>>>> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>>>>>
>>>>> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for
>>>>> PCI IDE controllers)
>>>>> - Added Tested-by from Rene
>>>>>
>>>>> Changes in v5:
>>>>> - Fixed avocado test
>>>>>
>>>>> Changes in v4:
>>>>> - Found typo in comment in patch 1 so ended up rewording it again
>>>>> trying to make it more concise. Also take the idea of using
>>>>> range_covers_byte from Mark's patch
>>>>> - Added RFC patch for avocado test (untested, I don't have Avocado)
>>>>>
>>>>> Changes in v3:
>>>>> - Update values, comment and commit message in patch 1 again
>>>>>
>>>>> Changes in v2:
>>>>> - Update comment and commit message in patch 1 (Mark)
>>>>> - Fix irq mapping in patch 2 (Volker)
>>>>>
>>>>> Regards,
>>>>> BALATON Zoltan
>>>>>
>>>>> BALATON Zoltan (3):
>>>>> hw/pci-host: Add emulation of Mai Logic Articia S
>>>>> hw/ppc: Add emulation of AmigaOne XE board
>>>>> tests/avocado: Add test for amigaone board
>>>>>
>>>>> MAINTAINERS | 8 +
>>>>> configs/devices/ppc-softmmu/default.mak | 1 +
>>>>> hw/pci-host/Kconfig | 5 +
>>>>> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
>>>>> hw/pci-host/meson.build | 2 +
>>>>> hw/ppc/Kconfig | 7 +
>>>>> hw/ppc/amigaone.c | 164 +++++++++++++
>>>>> hw/ppc/meson.build | 2 +
>>>>> include/hw/pci-host/articia.h | 17 ++
>>>>> tests/avocado/ppc_amiga.py | 38 +++
>>>>> 10 files changed, 537 insertions(+)
>>>>> create mode 100644 hw/pci-host/articia.c
>>>>> create mode 100644 hw/ppc/amigaone.c
>>>>> create mode 100644 include/hw/pci-host/articia.h
>>>>> create mode 100644 tests/avocado/ppc_amiga.py
>>>>>
>>>>
>>>>
>>
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v9 2/3] hw/ppc: Add emulation of AmigaOne XE board
2023-11-07 18:40 ` [PATCH v9 " BALATON Zoltan
@ 2023-11-07 18:52 ` Daniel Henrique Barboza
0 siblings, 0 replies; 30+ messages in thread
From: Daniel Henrique Barboza @ 2023-11-07 18:52 UTC (permalink / raw)
To: BALATON Zoltan, qemu-devel, qemu-ppc
Cc: Nicholas Piggin, clg, philmd, Bernhard Beschow, Mark Cave-Ayland,
Rene Engel, vr_qemu
On 11/7/23 15:40, BALATON Zoltan wrote:
> The AmigaOne is a rebranded MAI Teron board that uses U-Boot firmware
> with patches to support AmigaOS and is very similar to pegasos2 so can
> be easily emulated sharing most code with pegasos2. The reason to
> emulate it is that AmigaOS comes in different versions for AmigaOne
> and PegasosII which only have drivers for one machine and firmware so
> these only run on the specific machine. Adding this board allows
> another AmigaOS version to be used reusing already existing peagasos2
> emulation. (The AmigaOne was the first of these boards so likely most
> widespread which then inspired Pegasos that was later replaced with
> PegasosII due to problems with Articia S, so these have a lot of
> similarity. Pegasos mainly ran MorphOS while the PegasosII version of
> AmigaOS was added later and therefore less common than the AmigaOne
> version.)
>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> Tested-by: Rene Engel <ReneEngel80@emailn.de>
Acked-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This is passing qtest-hmp and it's not adding a new firmware in pc-bios, so
let's go with it.
Thanks,
Daniel
> ---
> v9: Skip error about missing -bios when using qtest
>
> MAINTAINERS | 8 ++
> configs/devices/ppc-softmmu/default.mak | 1 +
> hw/ppc/Kconfig | 7 +
> hw/ppc/amigaone.c | 166 ++++++++++++++++++++++++
> hw/ppc/meson.build | 2 +
> 5 files changed, 184 insertions(+)
> create mode 100644 hw/ppc/amigaone.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index b86ea7f75a..3d0aec7ffa 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1536,6 +1536,14 @@ F: hw/pci-host/mv64361.c
> F: hw/pci-host/mv643xx.h
> F: include/hw/pci-host/mv64361.h
>
> +amigaone
> +M: BALATON Zoltan <balaton@eik.bme.hu>
> +L: qemu-ppc@nongnu.org
> +S: Maintained
> +F: hw/ppc/amigaone.c
> +F: hw/pci-host/articia.c
> +F: include/hw/pci-host/articia.h
> +
> Virtual Open Firmware (VOF)
> M: Alexey Kardashevskiy <aik@ozlabs.ru>
> R: David Gibson <david@gibson.dropbear.id.au>
> diff --git a/configs/devices/ppc-softmmu/default.mak b/configs/devices/ppc-softmmu/default.mak
> index a887f5438b..b85fd2bcd7 100644
> --- a/configs/devices/ppc-softmmu/default.mak
> +++ b/configs/devices/ppc-softmmu/default.mak
> @@ -14,6 +14,7 @@ CONFIG_SAM460EX=y
> CONFIG_MAC_OLDWORLD=y
> CONFIG_MAC_NEWWORLD=y
>
> +CONFIG_AMIGAONE=y
> CONFIG_PEGASOS2=y
>
> # For PReP
> diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
> index 5dfbf47ef5..56f0475a8e 100644
> --- a/hw/ppc/Kconfig
> +++ b/hw/ppc/Kconfig
> @@ -69,6 +69,13 @@ config SAM460EX
> select USB_OHCI
> select FDT_PPC
>
> +config AMIGAONE
> + bool
> + imply ATI_VGA
> + select ARTICIA
> + select VT82C686
> + select SMBUS_EEPROM
> +
> config PEGASOS2
> bool
> imply ATI_VGA
> diff --git a/hw/ppc/amigaone.c b/hw/ppc/amigaone.c
> new file mode 100644
> index 0000000000..992a55e632
> --- /dev/null
> +++ b/hw/ppc/amigaone.c
> @@ -0,0 +1,166 @@
> +/*
> + * QEMU Eyetech AmigaOne/Mai Logic Teron emulation
> + *
> + * Copyright (c) 2023 BALATON Zoltan
> + *
> + * This work is licensed under the GNU GPL license version 2 or later.
> + *
> + */
> +
> +#include "qemu/osdep.h"
> +#include "qemu/units.h"
> +#include "qemu/datadir.h"
> +#include "qemu/log.h"
> +#include "qemu/error-report.h"
> +#include "qapi/error.h"
> +#include "hw/ppc/ppc.h"
> +#include "hw/boards.h"
> +#include "hw/loader.h"
> +#include "hw/pci-host/articia.h"
> +#include "hw/isa/vt82c686.h"
> +#include "hw/ide/pci.h"
> +#include "hw/i2c/smbus_eeprom.h"
> +#include "hw/ppc/ppc.h"
> +#include "sysemu/qtest.h"
> +#include "sysemu/reset.h"
> +#include "kvm_ppc.h"
> +
> +#define BUS_FREQ_HZ 100000000
> +
> +/*
> + * Firmware binary available at
> + * https://www.hyperion-entertainment.com/index.php/downloads?view=files&parent=28
> + * then "tail -c 524288 updater.image >u-boot-amigaone.bin"
> + *
> + * BIOS emulator in firmware cannot run QEMU vgabios and hangs on it, use
> + * -device VGA,romfile=VGABIOS-lgpl-latest.bin
> + * from http://www.nongnu.org/vgabios/ instead.
> + */
> +#define PROM_FILENAME "u-boot-amigaone.bin"
> +#define PROM_ADDR 0xfff00000
> +#define PROM_SIZE (512 * KiB)
> +
> +static void amigaone_cpu_reset(void *opaque)
> +{
> + PowerPCCPU *cpu = opaque;
> +
> + cpu_reset(CPU(cpu));
> + cpu_ppc_tb_reset(&cpu->env);
> +}
> +
> +static void fix_spd_data(uint8_t *spd)
> +{
> + uint32_t bank_size = 4 * MiB * spd[31];
> + uint32_t rows = bank_size / spd[13] / spd[17];
> + spd[3] = ctz32(rows) - spd[4];
> +}
> +
> +static void amigaone_init(MachineState *machine)
> +{
> + PowerPCCPU *cpu;
> + CPUPPCState *env;
> + MemoryRegion *rom, *pci_mem, *mr;
> + const char *fwname = machine->firmware ?: PROM_FILENAME;
> + char *filename;
> + ssize_t sz;
> + PCIBus *pci_bus;
> + Object *via;
> + DeviceState *dev;
> + I2CBus *i2c_bus;
> + uint8_t *spd_data;
> + int i;
> +
> + /* init CPU */
> + cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
> + env = &cpu->env;
> + if (PPC_INPUT(env) != PPC_FLAGS_INPUT_6xx) {
> + error_report("Incompatible CPU, only 6xx bus supported");
> + exit(1);
> + }
> + cpu_ppc_tb_init(env, BUS_FREQ_HZ / 4);
> + qemu_register_reset(amigaone_cpu_reset, cpu);
> +
> + /* RAM */
> + if (machine->ram_size > 2 * GiB) {
> + error_report("RAM size more than 2 GiB is not supported");
> + exit(1);
> + }
> + memory_region_add_subregion(get_system_memory(), 0, machine->ram);
> + if (machine->ram_size < 1 * GiB + 32 * KiB) {
> + /* Firmware uses this area for startup */
> + mr = g_new(MemoryRegion, 1);
> + memory_region_init_ram(mr, NULL, "init-cache", 32 * KiB, &error_fatal);
> + memory_region_add_subregion(get_system_memory(), 0x40000000, mr);
> + }
> +
> + /* allocate and load firmware */
> + filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, fwname);
> + if (filename) {
> + rom = g_new(MemoryRegion, 1);
> + memory_region_init_rom(rom, NULL, "rom", PROM_SIZE, &error_fatal);
> + memory_region_add_subregion(get_system_memory(), PROM_ADDR, rom);
> + sz = load_image_targphys(filename, PROM_ADDR, PROM_SIZE);
> + if (sz <= 0 || sz > PROM_SIZE) {
> + error_report("Could not load firmware '%s'", filename);
> + exit(1);
> + }
> + g_free(filename);
> + } else if (!qtest_enabled()) {
> + error_report("Could not find firmware '%s'", fwname);
> + exit(1);
> + }
> +
> + /* Articia S */
> + dev = sysbus_create_simple(TYPE_ARTICIA, 0xfe000000, NULL);
> +
> + i2c_bus = I2C_BUS(qdev_get_child_bus(dev, "smbus"));
> + if (machine->ram_size > 512 * MiB) {
> + spd_data = spd_data_generate(SDR, machine->ram_size / 2);
> + } else {
> + spd_data = spd_data_generate(SDR, machine->ram_size);
> + }
> + fix_spd_data(spd_data);
> + smbus_eeprom_init_one(i2c_bus, 0x51, spd_data);
> + if (machine->ram_size > 512 * MiB) {
> + smbus_eeprom_init_one(i2c_bus, 0x52, spd_data);
> + }
> +
> + pci_mem = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1);
> + mr = g_new(MemoryRegion, 1);
> + memory_region_init_alias(mr, OBJECT(dev), "pci-mem-low", pci_mem,
> + 0, 0x1000000);
> + memory_region_add_subregion(get_system_memory(), 0xfd000000, mr);
> + mr = g_new(MemoryRegion, 1);
> + memory_region_init_alias(mr, OBJECT(dev), "pci-mem-high", pci_mem,
> + 0x80000000, 0x7d000000);
> + memory_region_add_subregion(get_system_memory(), 0x80000000, mr);
> + pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci.0"));
> +
> + /* VIA VT82c686B South Bridge (multifunction PCI device) */
> + via = OBJECT(pci_create_simple_multifunction(pci_bus, PCI_DEVFN(7, 0),
> + TYPE_VT82C686B_ISA));
> + object_property_add_alias(OBJECT(machine), "rtc-time",
> + object_resolve_path_component(via, "rtc"),
> + "date");
> + qdev_connect_gpio_out(DEVICE(via), 0,
> + qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_INT));
> + for (i = 0; i < PCI_NUM_PINS; i++) {
> + qdev_connect_gpio_out(dev, i, qdev_get_gpio_in_named(DEVICE(via),
> + "pirq", i));
> + }
> + pci_ide_create_devs(PCI_DEVICE(object_resolve_path_component(via, "ide")));
> + pci_vga_init(pci_bus);
> +}
> +
> +static void amigaone_machine_init(MachineClass *mc)
> +{
> + mc->desc = "Eyetech AmigaOne/Mai Logic Teron";
> + mc->init = amigaone_init;
> + mc->block_default_type = IF_IDE;
> + mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("7457_v1.2");
> + mc->default_display = "std";
> + mc->default_ram_id = "ram";
> + mc->default_ram_size = 512 * MiB;
> +}
> +
> +DEFINE_MACHINE("amigaone", amigaone_machine_init)
> diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build
> index 7c2c52434a..7338f9432a 100644
> --- a/hw/ppc/meson.build
> +++ b/hw/ppc/meson.build
> @@ -81,6 +81,8 @@ ppc_ss.add(when: 'CONFIG_E500', if_true: files(
> ))
> # PowerPC 440 Xilinx ML507 reference board.
> ppc_ss.add(when: 'CONFIG_VIRTEX', if_true: files('virtex_ml507.c'))
> +# AmigaOne
> +ppc_ss.add(when: 'CONFIG_AMIGAONE', if_true: files('amigaone.c'))
> # Pegasos2
> ppc_ss.add(when: 'CONFIG_PEGASOS2', if_true: files('pegasos2.c'))
>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 1/3] hw/pci-host: Add emulation of Mai Logic Articia S
2023-10-27 11:54 ` [PATCH v7 1/3] hw/pci-host: Add emulation of Mai Logic Articia S BALATON Zoltan
@ 2023-11-07 18:53 ` Daniel Henrique Barboza
0 siblings, 0 replies; 30+ messages in thread
From: Daniel Henrique Barboza @ 2023-11-07 18:53 UTC (permalink / raw)
To: BALATON Zoltan, qemu-devel, qemu-ppc
Cc: Nicholas Piggin, clg, philmd, Bernhard Beschow, Mark Cave-Ayland,
Rene Engel, vr_qemu
On 10/27/23 08:54, BALATON Zoltan wrote:
> The Articia S is a generic chipset supporting several different CPUs
> that were among others used on some PPC boards. This is a minimal
> emulation of the parts needed for emulating the AmigaOne board.
>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> Tested-by: Rene Engel <ReneEngel80@emailn.de>
> ---
Acked-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> hw/pci-host/Kconfig | 5 +
> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++++++++++++
> hw/pci-host/meson.build | 2 +
> include/hw/pci-host/articia.h | 17 ++
> 4 files changed, 317 insertions(+)
> create mode 100644 hw/pci-host/articia.c
> create mode 100644 include/hw/pci-host/articia.h
>
> diff --git a/hw/pci-host/Kconfig b/hw/pci-host/Kconfig
> index 54a609d2ca..f046d76a68 100644
> --- a/hw/pci-host/Kconfig
> +++ b/hw/pci-host/Kconfig
> @@ -73,6 +73,11 @@ config SH_PCI
> bool
> select PCI
>
> +config ARTICIA
> + bool
> + select PCI
> + select I8259
> +
> config MV64361
> bool
> select PCI
> diff --git a/hw/pci-host/articia.c b/hw/pci-host/articia.c
> new file mode 100644
> index 0000000000..f3fcc49f81
> --- /dev/null
> +++ b/hw/pci-host/articia.c
> @@ -0,0 +1,293 @@
> +/*
> + * Mai Logic Articia S emulation
> + *
> + * Copyright (c) 2023 BALATON Zoltan
> + *
> + * This work is licensed under the GNU GPL license version 2 or later.
> + *
> + */
> +
> +#include "qemu/osdep.h"
> +#include "qemu/log.h"
> +#include "qapi/error.h"
> +#include "hw/pci/pci_device.h"
> +#include "hw/pci/pci_host.h"
> +#include "hw/irq.h"
> +#include "hw/i2c/bitbang_i2c.h"
> +#include "hw/intc/i8259.h"
> +#include "hw/pci-host/articia.h"
> +
> +/*
> + * This is a minimal emulation of this chip as used in AmigaOne board.
> + * Most features are missing but those are not needed by firmware and guests.
> + */
> +
> +OBJECT_DECLARE_SIMPLE_TYPE(ArticiaState, ARTICIA)
> +
> +OBJECT_DECLARE_SIMPLE_TYPE(ArticiaHostState, ARTICIA_PCI_HOST)
> +struct ArticiaHostState {
> + PCIDevice parent_obj;
> +
> + ArticiaState *as;
> +};
> +
> +/* TYPE_ARTICIA */
> +
> +struct ArticiaState {
> + PCIHostState parent_obj;
> +
> + qemu_irq irq[PCI_NUM_PINS];
> + MemoryRegion io;
> + MemoryRegion mem;
> + MemoryRegion reg;
> +
> + bitbang_i2c_interface smbus;
> + uint32_t gpio; /* bits 0-7 in, 8-15 out, 16-23 direction (0 in, 1 out) */
> + hwaddr gpio_base;
> + MemoryRegion gpio_reg;
> +};
> +
> +static uint64_t articia_gpio_read(void *opaque, hwaddr addr, unsigned int size)
> +{
> + ArticiaState *s = opaque;
> +
> + return (s->gpio >> (addr * 8)) & 0xff;
> +}
> +
> +static void articia_gpio_write(void *opaque, hwaddr addr, uint64_t val,
> + unsigned int size)
> +{
> + ArticiaState *s = opaque;
> + uint32_t sh = addr * 8;
> +
> + if (addr == 0) {
> + /* in bits read only? */
> + return;
> + }
> +
> + if ((s->gpio & (0xff << sh)) != (val & 0xff) << sh) {
> + s->gpio &= ~(0xff << sh | 0xff);
> + s->gpio |= (val & 0xff) << sh;
> + s->gpio |= bitbang_i2c_set(&s->smbus, BITBANG_I2C_SDA,
> + s->gpio & BIT(16) ?
> + !!(s->gpio & BIT(8)) : 1);
> + if ((s->gpio & BIT(17))) {
> + s->gpio &= ~BIT(0);
> + s->gpio |= bitbang_i2c_set(&s->smbus, BITBANG_I2C_SCL,
> + !!(s->gpio & BIT(9)));
> + }
> + }
> +}
> +
> +static const MemoryRegionOps articia_gpio_ops = {
> + .read = articia_gpio_read,
> + .write = articia_gpio_write,
> + .valid.min_access_size = 1,
> + .valid.max_access_size = 1,
> + .endianness = DEVICE_LITTLE_ENDIAN,
> +};
> +
> +static uint64_t articia_reg_read(void *opaque, hwaddr addr, unsigned int size)
> +{
> + ArticiaState *s = opaque;
> + uint64_t ret = UINT_MAX;
> +
> + switch (addr) {
> + case 0xc00cf8:
> + ret = pci_host_conf_le_ops.read(PCI_HOST_BRIDGE(s), 0, size);
> + break;
> + case 0xe00cfc ... 0xe00cff:
> + ret = pci_host_data_le_ops.read(PCI_HOST_BRIDGE(s), addr - 0xe00cfc, size);
> + break;
> + case 0xf00000:
> + ret = pic_read_irq(isa_pic);
> + break;
> + default:
> + qemu_log_mask(LOG_UNIMP, "%s: Unimplemented register read 0x%"
> + HWADDR_PRIx " %d\n", __func__, addr, size);
> + break;
> + }
> + return ret;
> +}
> +
> +static void articia_reg_write(void *opaque, hwaddr addr, uint64_t val,
> + unsigned int size)
> +{
> + ArticiaState *s = opaque;
> +
> + switch (addr) {
> + case 0xc00cf8:
> + pci_host_conf_le_ops.write(PCI_HOST_BRIDGE(s), 0, val, size);
> + break;
> + case 0xe00cfc ... 0xe00cff:
> + pci_host_data_le_ops.write(PCI_HOST_BRIDGE(s), addr, val, size);
> + break;
> + default:
> + qemu_log_mask(LOG_UNIMP, "%s: Unimplemented register write 0x%"
> + HWADDR_PRIx " %d <- %"PRIx64"\n", __func__, addr, size, val);
> + break;
> + }
> +}
> +
> +static const MemoryRegionOps articia_reg_ops = {
> + .read = articia_reg_read,
> + .write = articia_reg_write,
> + .valid.min_access_size = 1,
> + .valid.max_access_size = 4,
> + .endianness = DEVICE_LITTLE_ENDIAN,
> +};
> +
> +static void articia_pcihost_set_irq(void *opaque, int n, int level)
> +{
> + ArticiaState *s = opaque;
> + qemu_set_irq(s->irq[n], level);
> +}
> +
> +/*
> + * AmigaOne SE PCI slot to IRQ routing
> + *
> + * repository: https://source.denx.de/u-boot/custodians/u-boot-avr32.git
> + * refspec: v2010.06
> + * file: board/MAI/AmigaOneG3SE/articiaS_pci.c
> + */
> +static int amigaone_pcihost_bus0_map_irq(PCIDevice *pdev, int pin)
> +{
> + int devfn_slot = PCI_SLOT(pdev->devfn);
> +
> + switch (devfn_slot) {
> + case 6: /* On board ethernet */
> + return 3;
> + case 7: /* South bridge */
> + return pin;
> + default: /* PCI Slot 1 Devfn slot 8, Slot 2 Devfn 9, Slot 3 Devfn 10 */
> + return pci_swizzle(devfn_slot, pin);
> + }
> +
> +}
> +
> +static void articia_realize(DeviceState *dev, Error **errp)
> +{
> + ArticiaState *s = ARTICIA(dev);
> + PCIHostState *h = PCI_HOST_BRIDGE(dev);
> + PCIDevice *pdev;
> +
> + bitbang_i2c_init(&s->smbus, i2c_init_bus(dev, "smbus"));
> + memory_region_init_io(&s->gpio_reg, OBJECT(s), &articia_gpio_ops, s,
> + TYPE_ARTICIA, 4);
> +
> + memory_region_init(&s->mem, OBJECT(dev), "pci-mem", UINT64_MAX);
> + memory_region_init(&s->io, OBJECT(dev), "pci-io", 0xc00000);
> + memory_region_init_io(&s->reg, OBJECT(s), &articia_reg_ops, s,
> + TYPE_ARTICIA, 0x1000000);
> + memory_region_add_subregion_overlap(&s->reg, 0, &s->io, 1);
> +
> + /* devfn_min is 8 that matches first PCI slot in AmigaOne */
> + h->bus = pci_register_root_bus(dev, NULL, articia_pcihost_set_irq,
> + amigaone_pcihost_bus0_map_irq, dev, &s->mem,
> + &s->io, PCI_DEVFN(8, 0), 4, TYPE_PCI_BUS);
> + pdev = pci_create_simple_multifunction(h->bus, PCI_DEVFN(0, 0),
> + TYPE_ARTICIA_PCI_HOST);
> + ARTICIA_PCI_HOST(pdev)->as = s;
> + pci_create_simple(h->bus, PCI_DEVFN(0, 1), TYPE_ARTICIA_PCI_BRIDGE);
> +
> + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->reg);
> + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mem);
> + qdev_init_gpio_out(dev, s->irq, ARRAY_SIZE(s->irq));
> +}
> +
> +static void articia_class_init(ObjectClass *klass, void *data)
> +{
> + DeviceClass *dc = DEVICE_CLASS(klass);
> +
> + dc->realize = articia_realize;
> + set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
> +}
> +
> +/* TYPE_ARTICIA_PCI_HOST */
> +
> +static void articia_pci_host_cfg_write(PCIDevice *d, uint32_t addr,
> + uint32_t val, int len)
> +{
> + ArticiaState *s = ARTICIA_PCI_HOST(d)->as;
> +
> + pci_default_write_config(d, addr, val, len);
> + switch (addr) {
> + case 0x40:
> + s->gpio_base = val;
> + break;
> + case 0x44:
> + if (val != 0x11) {
> + /* FIXME what do the bits actually mean? */
> + break;
> + }
> + if (memory_region_is_mapped(&s->gpio_reg)) {
> + memory_region_del_subregion(&s->io, &s->gpio_reg);
> + }
> + memory_region_add_subregion(&s->io, s->gpio_base + 0x38, &s->gpio_reg);
> + break;
> + }
> +}
> +
> +static void articia_pci_host_class_init(ObjectClass *klass, void *data)
> +{
> + DeviceClass *dc = DEVICE_CLASS(klass);
> + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
> +
> + k->config_write = articia_pci_host_cfg_write;
> + k->vendor_id = 0x10cc;
> + k->device_id = 0x0660;
> + k->class_id = PCI_CLASS_BRIDGE_HOST;
> + /*
> + * PCI-facing part of the host bridge,
> + * not usable without the host-facing part
> + */
> + dc->user_creatable = false;
> +}
> +
> +/* TYPE_ARTICIA_PCI_BRIDGE */
> +
> +static void articia_pci_bridge_class_init(ObjectClass *klass, void *data)
> +{
> + DeviceClass *dc = DEVICE_CLASS(klass);
> + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
> +
> + k->vendor_id = 0x10cc;
> + k->device_id = 0x0661;
> + k->class_id = PCI_CLASS_BRIDGE_HOST;
> + /*
> + * PCI-facing part of the host bridge,
> + * not usable without the host-facing part
> + */
> + dc->user_creatable = false;
> +}
> +
> +static const TypeInfo articia_types[] = {
> + {
> + .name = TYPE_ARTICIA,
> + .parent = TYPE_PCI_HOST_BRIDGE,
> + .instance_size = sizeof(ArticiaState),
> + .class_init = articia_class_init,
> + },
> + {
> + .name = TYPE_ARTICIA_PCI_HOST,
> + .parent = TYPE_PCI_DEVICE,
> + .instance_size = sizeof(ArticiaHostState),
> + .class_init = articia_pci_host_class_init,
> + .interfaces = (InterfaceInfo[]) {
> + { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> + { },
> + },
> + },
> + {
> + .name = TYPE_ARTICIA_PCI_BRIDGE,
> + .parent = TYPE_PCI_DEVICE,
> + .instance_size = sizeof(PCIDevice),
> + .class_init = articia_pci_bridge_class_init,
> + .interfaces = (InterfaceInfo[]) {
> + { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> + { },
> + },
> + },
> +};
> +
> +DEFINE_TYPES(articia_types)
> diff --git a/hw/pci-host/meson.build b/hw/pci-host/meson.build
> index f891f026cb..de7bfb5a62 100644
> --- a/hw/pci-host/meson.build
> +++ b/hw/pci-host/meson.build
> @@ -20,6 +20,8 @@ pci_ss.add(when: 'CONFIG_GRACKLE_PCI', if_true: files('grackle.c'))
> pci_ss.add(when: 'CONFIG_UNIN_PCI', if_true: files('uninorth.c'))
> # PowerPC E500 boards
> pci_ss.add(when: 'CONFIG_PPCE500_PCI', if_true: files('ppce500.c'))
> +# AmigaOne
> +pci_ss.add(when: 'CONFIG_ARTICIA', if_true: files('articia.c'))
> # Pegasos2
> pci_ss.add(when: 'CONFIG_MV64361', if_true: files('mv64361.c'))
>
> diff --git a/include/hw/pci-host/articia.h b/include/hw/pci-host/articia.h
> new file mode 100644
> index 0000000000..529c240274
> --- /dev/null
> +++ b/include/hw/pci-host/articia.h
> @@ -0,0 +1,17 @@
> +/*
> + * Mai Logic Articia S emulation
> + *
> + * Copyright (c) 2023 BALATON Zoltan
> + *
> + * This work is licensed under the GNU GPL license version 2 or later.
> + *
> + */
> +
> +#ifndef ARTICIA_H
> +#define ARTICIA_H
> +
> +#define TYPE_ARTICIA "articia"
> +#define TYPE_ARTICIA_PCI_HOST "articia-pci-host"
> +#define TYPE_ARTICIA_PCI_BRIDGE "articia-pci-bridge"
> +
> +#endif
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 3/3] tests/avocado: Add test for amigaone board
2023-10-27 11:54 ` [PATCH v7 3/3] tests/avocado: Add test for amigaone board BALATON Zoltan
@ 2023-11-07 18:53 ` Daniel Henrique Barboza
0 siblings, 0 replies; 30+ messages in thread
From: Daniel Henrique Barboza @ 2023-11-07 18:53 UTC (permalink / raw)
To: BALATON Zoltan, qemu-devel, qemu-ppc
Cc: Nicholas Piggin, clg, philmd, Bernhard Beschow, Mark Cave-Ayland,
Rene Engel, vr_qemu
On 10/27/23 08:54, BALATON Zoltan wrote:
> Add an avocado test for the amigaone board that tests it with the
> firmware.
>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> ---
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> tests/avocado/ppc_amiga.py | 38 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 38 insertions(+)
> create mode 100644 tests/avocado/ppc_amiga.py
>
> diff --git a/tests/avocado/ppc_amiga.py b/tests/avocado/ppc_amiga.py
> new file mode 100644
> index 0000000000..b6f866f91d
> --- /dev/null
> +++ b/tests/avocado/ppc_amiga.py
> @@ -0,0 +1,38 @@
> +# Test AmigaNG boards
> +#
> +# Copyright (c) 2023 BALATON Zoltan
> +#
> +# This work is licensed under the terms of the GNU GPL, version 2 or
> +# later. See the COPYING file in the top-level directory.
> +
> +from avocado.utils import archive
> +from avocado.utils import process
> +from avocado_qemu import QemuSystemTest
> +from avocado_qemu import wait_for_console_pattern
> +
> +class AmigaOneMachine(QemuSystemTest):
> +
> + timeout = 90
> +
> + def test_ppc_amigaone(self):
> + """
> + :avocado: tags=arch:ppc
> + :avocado: tags=machine:amigaone
> + :avocado: tags=device:articia
> + :avocado: tags=accel:tcg
> + """
> + self.require_accelerator("tcg")
> + tar_name = 'A1Firmware_Floppy_05-Mar-2005.zip'
> + tar_url = ('https://www.hyperion-entertainment.com/index.php/'
> + 'downloads?view=download&format=raw&file=25')
> + tar_hash = 'c52e59bc73e31d8bcc3cc2106778f7ac84f6c755'
> + zip_file = self.fetch_asset(tar_name, locations=tar_url,
> + asset_hash=tar_hash)
> + archive.extract(zip_file, self.workdir)
> + cmd = f"tail -c 524288 {self.workdir}/floppy_edition/updater.image >{self.workdir}/u-boot-amigaone.bin"
> + process.run(cmd, shell=True)
> +
> + self.vm.set_console()
> + self.vm.add_args('-bios', self.workdir + '/u-boot-amigaone.bin')
> + self.vm.launch()
> + wait_for_console_pattern(self, 'FLASH:')
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH v7 0/3] Add emulation of AmigaOne XE board
2023-10-27 11:54 [PATCH v7 0/3] Add emulation of AmigaOne XE board BALATON Zoltan
` (5 preceding siblings ...)
2023-11-07 17:20 ` Daniel Henrique Barboza
@ 2023-11-07 18:53 ` Daniel Henrique Barboza
6 siblings, 0 replies; 30+ messages in thread
From: Daniel Henrique Barboza @ 2023-11-07 18:53 UTC (permalink / raw)
To: BALATON Zoltan, qemu-devel, qemu-ppc
Cc: Nicholas Piggin, clg, philmd, Bernhard Beschow, Mark Cave-Ayland,
Rene Engel, vr_qemu
Patches 1 and 3 from v7, and 2 from v9, queued in ppc-next.
Thanks,
Daniel
On 10/27/23 08:54, BALATON Zoltan wrote:
> Changes in v7:
> - Increase default memory size to 512m to match pegasos2 and sam460ex
> and it's a better default for AmigaOS
>
> Changes in v6:
> - Dropped patch 1, now it's
>
> Based-on: <20231024224056.842607-1-mark.cave-ayland@ilande.co.uk>
>
> ([PATCH v2 0/3] ide: implement simple legacy/native mode switching for PCI IDE controllers)
> - Added Tested-by from Rene
>
> Changes in v5:
> - Fixed avocado test
>
> Changes in v4:
> - Found typo in comment in patch 1 so ended up rewording it again
> trying to make it more concise. Also take the idea of using
> range_covers_byte from Mark's patch
> - Added RFC patch for avocado test (untested, I don't have Avocado)
>
> Changes in v3:
> - Update values, comment and commit message in patch 1 again
>
> Changes in v2:
> - Update comment and commit message in patch 1 (Mark)
> - Fix irq mapping in patch 2 (Volker)
>
> Regards,
> BALATON Zoltan
>
> BALATON Zoltan (3):
> hw/pci-host: Add emulation of Mai Logic Articia S
> hw/ppc: Add emulation of AmigaOne XE board
> tests/avocado: Add test for amigaone board
>
> MAINTAINERS | 8 +
> configs/devices/ppc-softmmu/default.mak | 1 +
> hw/pci-host/Kconfig | 5 +
> hw/pci-host/articia.c | 293 ++++++++++++++++++++++++
> hw/pci-host/meson.build | 2 +
> hw/ppc/Kconfig | 7 +
> hw/ppc/amigaone.c | 164 +++++++++++++
> hw/ppc/meson.build | 2 +
> include/hw/pci-host/articia.h | 17 ++
> tests/avocado/ppc_amiga.py | 38 +++
> 10 files changed, 537 insertions(+)
> create mode 100644 hw/pci-host/articia.c
> create mode 100644 hw/ppc/amigaone.c
> create mode 100644 include/hw/pci-host/articia.h
> create mode 100644 tests/avocado/ppc_amiga.py
>
^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2023-11-07 18:53 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-27 11:54 [PATCH v7 0/3] Add emulation of AmigaOne XE board BALATON Zoltan
2023-10-27 11:54 ` [PATCH v7 1/3] hw/pci-host: Add emulation of Mai Logic Articia S BALATON Zoltan
2023-11-07 18:53 ` Daniel Henrique Barboza
2023-10-27 11:54 ` [PATCH v7 2/3] hw/ppc: Add emulation of AmigaOne XE board BALATON Zoltan
2023-11-07 18:21 ` [PATCH v8 " BALATON Zoltan
2023-11-07 18:25 ` Peter Maydell
2023-11-07 18:28 ` BALATON Zoltan
2023-11-07 18:40 ` [PATCH v9 " BALATON Zoltan
2023-11-07 18:52 ` Daniel Henrique Barboza
2023-10-27 11:54 ` [PATCH v7 3/3] tests/avocado: Add test for amigaone board BALATON Zoltan
2023-11-07 18:53 ` Daniel Henrique Barboza
2023-10-28 14:52 ` [PATCH v7 0/3] Add emulation of AmigaOne XE board Bernhard Beschow
2023-10-28 18:20 ` BALATON Zoltan
2023-11-06 10:30 ` BALATON Zoltan
2023-11-07 8:50 ` BALATON Zoltan
2023-11-07 14:42 ` BALATON Zoltan
2023-11-07 16:20 ` Daniel Henrique Barboza
2023-11-07 16:41 ` BALATON Zoltan
2023-11-07 17:20 ` Daniel Henrique Barboza
2023-11-07 17:33 ` BALATON Zoltan
2023-11-07 17:42 ` Daniel Henrique Barboza
2023-11-07 17:49 ` BALATON Zoltan
2023-11-07 18:03 ` BALATON Zoltan
2023-11-07 18:14 ` Peter Maydell
2023-11-07 18:18 ` BALATON Zoltan
2023-11-07 18:21 ` Peter Maydell
2023-11-07 18:25 ` BALATON Zoltan
2023-11-07 18:41 ` BALATON Zoltan
2023-11-07 17:44 ` BALATON Zoltan
2023-11-07 18:53 ` Daniel Henrique Barboza
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).