From patchwork Sat Apr 12 09:20:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: BALATON Zoltan X-Patchwork-Id: 355103 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C9E081400A3 for ; Tue, 3 Jun 2014 09:12:25 +1000 (EST) Received: from localhost ([::1]:49626 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrbOx-0008Pt-4S for incoming@patchwork.ozlabs.org; Mon, 02 Jun 2014 19:12:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrbOd-0007me-PB for qemu-devel@nongnu.org; Mon, 02 Jun 2014 19:12:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrbOZ-0004ta-18 for qemu-devel@nongnu.org; Mon, 02 Jun 2014 19:12:03 -0400 Received: from mono.eik.bme.hu ([152.66.115.2]:52923) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrbOY-0004tW-M6 for qemu-devel@nongnu.org; Mon, 02 Jun 2014 19:11:58 -0400 Received: from mono.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id E23A34EA2; Tue, 3 Jun 2014 01:11:48 +0200 (CEST) Received: by mono.eik.bme.hu (Postfix, from userid 432) id 104752F472; Tue, 3 Jun 2014 01:11:48 +0200 (CEST) From: BALATON Zoltan Date: Sat, 12 Apr 2014 11:20:41 +0200 To: qemu-devel@nongnu.org Message-Id: <20140602231148.104752F472@mono.eik.bme.hu> X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 152.66.115.2 Cc: qemu-ppc@nongnu.org, agraf@suse.de, afaerber@suse.de Subject: [Qemu-devel] [PATCH v2] mac99: Change memory layout to better match PowerMac3, 1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Bring the memory map closer to a PowerMac3,1 model by removing unused areas and adding the VGA and network cards after the macio to let the latter be mapped from 0x80000000 like on real hardware. (On real hardware the graphics and network cards are on separate buses but we don't model that yet.) Signed-off-by: BALATON Zoltan --- 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 v2: Added back unin2_memory region that Darwin seems to like better --- hw/pci-host/uninorth.c | 2 +- hw/ppc/mac_newworld.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index e72fe2a..21f805f 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); diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 4bdaa8d..a4e5044 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -371,18 +371,11 @@ static void ppc_core99_init(MachineState *machine) 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", escc_mem, 0, memory_region_size(escc_mem)); - for(i = 0; i < nb_nics; i++) - pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL); - - ide_drive_get(hd, MAX_IDE_BUS); - macio = pci_create(pci_bus, -1, TYPE_NEWWORLD_MACIO); dev = DEVICE(macio); qdev_connect_gpio_out(dev, 0, pic[0x19]); /* CUDA */ @@ -393,6 +386,8 @@ static void ppc_core99_init(MachineState *machine) macio_init(macio, pic_mem, escc_bar); /* We only emulate 2 out of 3 IDE controllers for now */ + ide_drive_get(hd, MAX_IDE_BUS); + macio_ide = MACIO_IDE(object_resolve_path_component(OBJECT(macio), "ide[0]")); macio_ide_init_drives(macio_ide, hd); @@ -418,9 +413,14 @@ static void ppc_core99_init(MachineState *machine) } } + pci_vga_init(pci_bus); + if (graphic_depth != 15 && graphic_depth != 32 && graphic_depth != 8) graphic_depth = 15; + for(i = 0; i < nb_nics; i++) + pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL); + /* The NewWorld NVRAM is not located in the MacIO device */ dev = qdev_create(NULL, TYPE_MACIO_NVRAM); qdev_prop_set_uint32(dev, "size", 0x2000);