qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: BALATON Zoltan <balaton@eik.bme.hu>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: Nicholas Piggin <npiggin@gmail.com>,
	Markus Armbruster <armbru@redhat.com>,
	Harsh Prateek Bora <harshpb@linux.ibm.com>
Subject: Re: [PATCH v4 11/12] hw/ppc/pegasos2: Add Pegasos I emulation
Date: Thu, 23 Oct 2025 08:54:12 +0200	[thread overview]
Message-ID: <63bb6500-56f7-4d4c-86ec-7aef613de6b6@linaro.org> (raw)
In-Reply-To: <8f5bd07553b41d83a54f9df0bb93b76b22dea5c5.1761176219.git.balaton@eik.bme.hu>

On 23/10/25 02:06, BALATON Zoltan wrote:
> The Pegasos II is a redesign of the original Pegasos (later marked I)
> that replaces the north bridge and has updated firmware but otherwise
> these are very similar. The Pegasos uses the same north bridge that
> AmigaOne used which we already emulate so we can also easily emulate
> Pegasos I.
> 
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> ---
>   hw/ppc/pegasos2.c | 156 ++++++++++++++++++++++++++++++++++------------
>   1 file changed, 117 insertions(+), 39 deletions(-)


> @@ -89,6 +96,8 @@ static void pegasos2_cpu_reset(void *opaque)
>       if (pm->vof) {
>           cpu->env.gpr[1] = 2 * VOF_STACK_SIZE - 0x20;
>           cpu->env.nip = 0x100;
> +    } else if (pm->type == PEGASOS1) {
> +        cpu->env.nip = 0xfffc0100;

Preferably add a comment explaining/describing this value (think
at your future you in 3 years ;) ).


> +    case PEGASOS1:
> +    {
> +        MemoryRegion *pci_mem, *mr;
> +
> +        /* Articia S */
> +        pm->nb = DEVICE(sysbus_create_simple(TYPE_ARTICIA, 0xfe000000, NULL));
> +        pci_mem = sysbus_mmio_get_region(SYS_BUS_DEVICE(pm->nb), 1);
> +        mr = g_new(MemoryRegion, 1);
> +        memory_region_init_alias(mr, OBJECT(pm->nb), "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(pm->nb), "pci-mem-high", pci_mem,
> +                                 0x80000000, 0x7d000000);
> +        memory_region_add_subregion(get_system_memory(), 0x80000000, mr);

Since I don't want to delay this series any further, as a future
cleanup consider passing the host MR (get_system_memory) as a link
property, and map PCI hi/lo regions in the host bridge realize.

> +        pci_bus = PCI_BUS(qdev_get_child_bus(pm->nb, "pci.0"));
> +        break;
> +    }

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



  reply	other threads:[~2025-10-23  6:54 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-23  0:06 [PATCH v4 00/12] Pegasos2 clean up and pegasos1 emulation BALATON Zoltan
2025-10-23  0:06 ` [PATCH v4 01/12] ppc/vof: Make nextprop behave more like Open Firmware BALATON Zoltan
2025-10-23  0:06 ` [PATCH v4 02/12] hw/ppc/pegasos2: Remove explicit name properties from device tree BALATON Zoltan
2025-10-23  4:55   ` Harsh Prateek Bora
2025-10-23  0:06 ` [PATCH v4 03/12] hw/ppc/pegasos2: Change device tree generation BALATON Zoltan
2025-10-23  0:06 ` [PATCH v4 04/12] hw/ppc/pegasos2: Remove fdt pointer from machine state BALATON Zoltan
2025-10-23  0:06 ` [PATCH v4 05/12] hw/ppc/pegasos2: Rename mv field in " BALATON Zoltan
2025-10-23  0:06 ` [PATCH v4 06/12] hw/ppc/pegasos2: Add south bridge pointer in the " BALATON Zoltan
2025-10-23  0:06 ` [PATCH v4 07/12] hw/ppc/pegasos2: Move PCI IRQ routing setup to a function BALATON Zoltan
2025-10-23  6:47   ` Philippe Mathieu-Daudé
2025-10-23  0:06 ` [PATCH v4 08/12] hw/ppc/pegasos2: Move hardware specific parts out of machine reset BALATON Zoltan
2025-10-23  6:46   ` Philippe Mathieu-Daudé
2025-10-23  8:45     ` Harsh Prateek Bora
2025-10-23 11:41       ` BALATON Zoltan
2025-10-23 12:58     ` BALATON Zoltan
2025-10-23  0:06 ` [PATCH v4 09/12] hw/ppc/pegasos2: Introduce abstract superclass BALATON Zoltan
2025-10-23  0:06 ` [PATCH v4 10/12] hw/ppc/pegasos2: Add bus frequency to machine state BALATON Zoltan
2025-10-23  6:36   ` Philippe Mathieu-Daudé
2025-10-23 11:05     ` BALATON Zoltan
2025-10-23  0:06 ` [PATCH v4 11/12] hw/ppc/pegasos2: Add Pegasos I emulation BALATON Zoltan
2025-10-23  6:54   ` Philippe Mathieu-Daudé [this message]
2025-10-23 13:14     ` BALATON Zoltan
2025-10-23  0:06 ` [PATCH v4 12/12] hw/ppc/pegasos2: Add VOF support for pegasos1 BALATON Zoltan
2025-10-23  6:49   ` Philippe Mathieu-Daudé
2025-10-23 11:39 ` [PATCH v4 00/12] Pegasos2 clean up and pegasos1 emulation Harsh Prateek Bora
2025-10-23 12:07   ` BALATON Zoltan
2025-10-23 12:15     ` BALATON Zoltan
2025-10-23 12:23       ` Harsh Prateek Bora
2025-10-23 12:29         ` BALATON Zoltan

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=63bb6500-56f7-4d4c-86ec-7aef613de6b6@linaro.org \
    --to=philmd@linaro.org \
    --cc=armbru@redhat.com \
    --cc=balaton@eik.bme.hu \
    --cc=harshpb@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).