qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: BALATON Zoltan <balaton@eik.bme.hu>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, "Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] mac99: Bring memory layout closer to real hardware
Date: Thu, 20 Mar 2014 11:16:52 +0100 (CET)	[thread overview]
Message-ID: <alpine.LMD.2.02.1403201111290.1165@jedlik.phy.bme.hu> (raw)
In-Reply-To: <20140315005522.E00822F418@mono.eik.bme.hu>

On Sat, 15 Mar 2014, BALATON Zoltan wrote:
> Try to better match the memory map of a PowerMac3,1 model by moving
> the pci-cfg mappings to where they are on a real machine. Also add the
> VGA card after the macio to let the latter be mapped from 0x80000000 to
> match hardware. (On real hardware the graphics card is on a different
> bus but we don't seem to model that yet.)
>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> ---
>
> This patch is intended to bring memory layout closer to what's seen in
> these dumps:
>
> http://nandra.segv.jp/NetBSD/G4.dump-device-tree.txt
> http://raveland.org/ports/eeprom.txt
> http://mail-index.netbsd.org/port-macppc/2007/10/24/0000.html
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=604134
>
> It makes MorphOS a little happier and not print alerts when creating
> its memory map but not happy enough to not crash later.

I'm not so sure about this patch either by now. I've come across some logs 
that show that these MorphOS alerts can happen on real hardware too and 
are probably not related to the crash but it needs more debugging and 
experimenting. If anyone has any ideas how to converge QEMU's model to 
what's seen in the dumps above please let me know.

Regards,
BALATON Zoltan

> If this is merged the corresponding addresses need to be changed in
> OpenBIOS arch/ppc/qemu/init.c also! I can send a patch for that if
> needed.
>
> hw/pci-host/uninorth.c | 10 +++++-----
> hw/ppc/mac_newworld.c  | 10 ++++++----
> 2 files changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
> index e72fe2a..6e88b6a 100644
> --- a/hw/pci-host/uninorth.c
> +++ b/hw/pci-host/uninorth.c
> @@ -230,7 +230,7 @@ PCIBus *pci_pmac_init(qemu_irq *pic,
>     d = UNI_NORTH_PCI_HOST_BRIDGE(dev);
>     memory_region_init(&d->pci_mmio, OBJECT(d), "pci-mmio", 0x100000000ULL);
>     memory_region_init_alias(&d->pci_hole, OBJECT(d), "pci-hole", &d->pci_mmio,
> -                             0x80000000ULL, 0x70000000ULL);
> +                             0x80000000ULL, 0x10000000ULL);
>     memory_region_add_subregion(address_space_mem, 0x80000000ULL,
>                                 &d->pci_hole);
>
> @@ -245,8 +245,8 @@ PCIBus *pci_pmac_init(qemu_irq *pic,
>     pci_create_simple(h->bus, PCI_DEVFN(11, 0), "uni-north");
> #endif
>
> -    sysbus_mmio_map(s, 0, 0xf2800000);
> -    sysbus_mmio_map(s, 1, 0xf2c00000);
> +    sysbus_mmio_map(s, 0, 0xf3000000);
> +    sysbus_mmio_map(s, 1, 0xf3400000);
>
>     /* DEC 21154 bridge */
> #if 0
> @@ -259,8 +259,8 @@ PCIBus *pci_pmac_init(qemu_irq *pic,
>     dev = qdev_create(NULL, TYPE_UNI_NORTH_AGP_HOST_BRIDGE);
>     qdev_init_nofail(dev);
>     s = SYS_BUS_DEVICE(dev);
> -    sysbus_mmio_map(s, 0, 0xf0800000);
> -    sysbus_mmio_map(s, 1, 0xf0c00000);
> +    sysbus_mmio_map(s, 0, 0xf1000000);
> +    sysbus_mmio_map(s, 1, 0xf1400000);
>
>     /* Uninorth internal bus */
> #if 0
> diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
> index 5e79575..9d4e570 100644
> --- a/hw/ppc/mac_newworld.c
> +++ b/hw/ppc/mac_newworld.c
> @@ -154,7 +154,9 @@ static void ppc_core99_init(QEMUMachineInitArgs *args)
>     qemu_irq *pic, **openpic_irqs;
>     MemoryRegion *isa = g_new(MemoryRegion, 1);
>     MemoryRegion *unin_memory = g_new(MemoryRegion, 1);
> +#if 0
>     MemoryRegion *unin2_memory = g_new(MemoryRegion, 1);
> +#endif
>     int linux_boot, i, j, k;
>     MemoryRegion *ram = g_new(MemoryRegion, 1), *bios = g_new(MemoryRegion, 1);
>     hwaddr kernel_base, initrd_base, cmdline_base = 0;
> @@ -296,10 +298,10 @@ static void ppc_core99_init(QEMUMachineInitArgs *args)
>     /* UniN init: XXX should be a real device */
>     memory_region_init_io(unin_memory, NULL, &unin_ops, token, "unin", 0x1000);
>     memory_region_add_subregion(get_system_memory(), 0xf8000000, unin_memory);
> -
> +#if 0
>     memory_region_init_io(unin2_memory, NULL, &unin_ops, token, "unin", 0x1000);
>     memory_region_add_subregion(get_system_memory(), 0xf3000000, unin2_memory);
> -
> +#endif
>     openpic_irqs = g_malloc0(smp_cpus * sizeof(qemu_irq *));
>     openpic_irqs[0] =
>         g_malloc0(smp_cpus * sizeof(qemu_irq) * OPENPIC_OUTPUT_NB);
> @@ -371,8 +373,6 @@ static void ppc_core99_init(QEMUMachineInitArgs *args)
>         machine_arch = ARCH_MAC99;
>     }
>     /* init basic PC hardware */
> -    pci_vga_init(pci_bus);
> -
>     escc_mem = escc_init(0, pic[0x25], pic[0x24],
>                          serial_hds[0], serial_hds[1], ESCC_CLOCK, 4);
>     memory_region_init_alias(escc_bar, NULL, "escc-bar",
> @@ -418,6 +418,8 @@ static void ppc_core99_init(QEMUMachineInitArgs *args)
>         }
>     }
>
> +    pci_vga_init(pci_bus);
> +
>     if (graphic_depth != 15 && graphic_depth != 32 && graphic_depth != 8)
>         graphic_depth = 15;
>
> -- 
> 1.8.1.5
>
>
>

  reply	other threads:[~2014-03-20 10:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-15  0:17 [Qemu-devel] [PATCH] mac99: Bring memory layout closer to real hardware BALATON Zoltan
2014-03-20 10:16 ` BALATON Zoltan [this message]
2014-04-11 11:39   ` [Qemu-devel] [Qemu-ppc] " Alexander Graf

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=alpine.LMD.2.02.1403201111290.1165@jedlik.phy.bme.hu \
    --to=balaton@eik.bme.hu \
    --cc=afaerber@suse.de \
    --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).