From nobody Mon Feb 9 19:10:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667247339430159.43512379286813; Mon, 31 Oct 2022 13:15:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbBq-0007bI-Tp; Mon, 31 Oct 2022 16:15:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbBn-0007Xp-JP; Mon, 31 Oct 2022 16:15:21 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbBk-0000eN-SV; Mon, 31 Oct 2022 16:15:19 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbBa-0003Dd-VV; Mon, 31 Oct 2022 20:15:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=guWU5Luib1m4GhydteaZuvSimSBJWGSheGMPNQi9ELw=; b=D3NbovFc7g9n4kgWzJSjIlVKLB DsE5yozhS1xu9B30AU3OBeuutdL5Adx+mIBmQReFOf8AG6+NnvjltEt6oX48dwdWiMihM+7EGKrZK x6wvFaGPIt2OAcXDiCeNuK0Qf4jJg4yg/XjGBBpr75/WUWZXQlC2y6RF/Z/oelJsIy1/fIKhDlgpJ ++/KsCCPQgREvQmLpZO6v3Jcnay+VSw29x6qyFXHS0DEwUzAD9G0yxU0kXQABKRCLyU06+/yb9AVs MyZnpmCgoP+t15MCxaF2WVBb4d3vrdcae3hgINlFEQajWznxUA1h1pwIDml95gXlZW/hpMTUnog1q u8pEZWrCHVRe1hhX6i/Yfr9T9vKpJN4Yl3nwO0pfXcK/5q5RA35rMeaKJSHeFC9+k8Nh2vZbNhYwU TYwxtVjAaO9la57i6/lM0xoy67Zfj20K8X/4r1T6jXU+lRoPGdCg28O619My0kB3GfUNHEEHy0PUM 2z3aVSpHz2wqft2m1Sg8tGLXfmhnYJ7xblS94z8Jk0DvLi6UiXmp1Xgw3efeyFtzEkUaS8mKEcLw5 FIR6z761eyP/SDzbfVvwxEsdq5A/oVIC7q23ibgCeWXMOJiC7nE3Pqpuih9xzf1Jrf6VeJxV9ZFN+ uSHXaQ55iu0bs3q3fouovqQvdQITLhWBE9OmmJsb8=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:22 +0000 Message-Id: <20221031201435.677168-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 01/14] mac_newworld: Drop some variables X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247341192100007 From: BALATON Zoltan Values not used frequently enough may not worth putting in a local variable, especially with names almost as long as the original value because that does not improve readability, to the contrary it makes it harder to see what value is used. Drop a few such variables. This is the same clean up that was done for mac_oldworld in commit b8df32555ce5. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Message-Id: Signed-off-by: Mark Cave-Ayland --- hw/ppc/mac_newworld.c | 65 +++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 36 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index cf7eb72391..27e4e8d136 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -106,18 +106,13 @@ static void ppc_core99_reset(void *opaque) /* PowerPC Mac99 hardware initialisation */ static void ppc_core99_init(MachineState *machine) { - ram_addr_t ram_size =3D machine->ram_size; - const char *bios_name =3D machine->firmware ?: PROM_FILENAME; - const char *kernel_filename =3D machine->kernel_filename; - const char *kernel_cmdline =3D machine->kernel_cmdline; - const char *initrd_filename =3D machine->initrd_filename; - const char *boot_device =3D machine->boot_config.order; Core99MachineState *core99_machine =3D CORE99_MACHINE(machine); PowerPCCPU *cpu =3D NULL; CPUPPCState *env =3D NULL; char *filename; IrqLines *openpic_irqs; - int linux_boot, i, j, k; + int i, j, k, ppc_boot_device, machine_arch, bios_size; + const char *bios_name =3D machine->firmware ?: PROM_FILENAME; MemoryRegion *bios =3D g_new(MemoryRegion, 1); hwaddr kernel_base, initrd_base, cmdline_base =3D 0; long kernel_size, initrd_size; @@ -129,22 +124,16 @@ static void ppc_core99_init(MachineState *machine) MACIOIDEState *macio_ide; BusState *adb_bus; MacIONVRAMState *nvr; - int bios_size; - int ppc_boot_device; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; void *fw_cfg; - int machine_arch; SysBusDevice *s; DeviceState *dev, *pic_dev; DeviceState *uninorth_internal_dev =3D NULL, *uninorth_agp_dev =3D NUL= L; hwaddr nvram_addr =3D 0xFFF04000; uint64_t tbfreq; - unsigned int smp_cpus =3D machine->smp.cpus; - - linux_boot =3D (kernel_filename !=3D NULL); =20 /* init CPUs */ - for (i =3D 0; i < smp_cpus; i++) { + for (i =3D 0; i < machine->smp.cpus; i++) { cpu =3D POWERPC_CPU(cpu_create(machine->cpu_type)); env =3D &cpu->env; =20 @@ -184,7 +173,7 @@ static void ppc_core99_init(MachineState *machine) exit(1); } =20 - if (linux_boot) { + if (machine->kernel_filename) { int bswap_needed; =20 #ifdef BSWAP_NEEDED @@ -194,29 +183,31 @@ static void ppc_core99_init(MachineState *machine) #endif kernel_base =3D KERNEL_LOAD_ADDR; =20 - kernel_size =3D load_elf(kernel_filename, NULL, + kernel_size =3D load_elf(machine->kernel_filename, NULL, translate_kernel_address, NULL, NULL, NULL, NULL, NULL, 1, PPC_ELF_MACHINE, 0, 0); if (kernel_size < 0) - kernel_size =3D load_aout(kernel_filename, kernel_base, - ram_size - kernel_base, bswap_needed, - TARGET_PAGE_SIZE); + kernel_size =3D load_aout(machine->kernel_filename, kernel_bas= e, + machine->ram_size - kernel_base, + bswap_needed, TARGET_PAGE_SIZE); if (kernel_size < 0) - kernel_size =3D load_image_targphys(kernel_filename, + kernel_size =3D load_image_targphys(machine->kernel_filename, kernel_base, - ram_size - kernel_base); + machine->ram_size - kernel_b= ase); if (kernel_size < 0) { - error_report("could not load kernel '%s'", kernel_filename); + error_report("could not load kernel '%s'", + machine->kernel_filename); exit(1); } /* load initrd */ - if (initrd_filename) { + if (machine->initrd_filename) { initrd_base =3D TARGET_PAGE_ALIGN(kernel_base + kernel_size + = KERNEL_GAP); - initrd_size =3D load_image_targphys(initrd_filename, initrd_ba= se, - ram_size - initrd_base); + initrd_size =3D load_image_targphys(machine->initrd_filename, + initrd_base, + machine->ram_size - initrd_b= ase); if (initrd_size < 0) { error_report("could not load initial ram disk '%s'", - initrd_filename); + machine->initrd_filename); exit(1); } cmdline_base =3D TARGET_PAGE_ALIGN(initrd_base + initrd_size); @@ -235,9 +226,10 @@ static void ppc_core99_init(MachineState *machine) /* We consider that NewWorld PowerMac never have any floppy drive * For now, OHW cannot boot from the network. */ - for (i =3D 0; boot_device[i] !=3D '\0'; i++) { - if (boot_device[i] >=3D 'c' && boot_device[i] <=3D 'f') { - ppc_boot_device =3D boot_device[i]; + for (i =3D 0; machine->boot_config.order[i] !=3D '\0'; i++) { + if (machine->boot_config.order[i] >=3D 'c' && + machine->boot_config.order[i] <=3D 'f') { + ppc_boot_device =3D machine->boot_config.order[i]; break; } } @@ -254,8 +246,8 @@ static void ppc_core99_init(MachineState *machine) memory_region_add_subregion(get_system_memory(), 0xf8000000, sysbus_mmio_get_region(s, 0)); =20 - openpic_irqs =3D g_new0(IrqLines, smp_cpus); - for (i =3D 0; i < smp_cpus; i++) { + openpic_irqs =3D g_new0(IrqLines, machine->smp.cpus); + for (i =3D 0; i < machine->smp.cpus; i++) { /* Mac99 IRQ connection between OpenPIC outputs pins * and PowerPC input pins */ @@ -398,7 +390,7 @@ static void ppc_core99_init(MachineState *machine) /* OpenPIC */ s =3D SYS_BUS_DEVICE(pic_dev); k =3D 0; - for (i =3D 0; i < smp_cpus; i++) { + for (i =3D 0; i < machine->smp.cpus; i++) { for (j =3D 0; j < OPENPIC_OUTPUT_NB; j++) { sysbus_connect_irq(s, k++, openpic_irqs[i].irq[j]); } @@ -480,15 +472,16 @@ static void ppc_core99_init(MachineState *machine) sysbus_mmio_map(s, 0, CFG_ADDR); sysbus_mmio_map(s, 1, CFG_ADDR + 2); =20 - fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)smp_cpus); + fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)machine->smp.cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)machine->smp.max_cpu= s); - fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, machine_arch); fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ADDR, kernel_base); fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size); - if (kernel_cmdline) { + if (machine->kernel_cmdline) { fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_CMDLINE, cmdline_base); - pstrcpy_targphys("cmdline", cmdline_base, TARGET_PAGE_SIZE, kernel= _cmdline); + pstrcpy_targphys("cmdline", cmdline_base, TARGET_PAGE_SIZE, + machine->kernel_cmdline); } else { fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_CMDLINE, 0); } --=20 2.30.2 From nobody Mon Feb 9 19:10:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667247518652499.36445212801834; Mon, 31 Oct 2022 13:18:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbBu-0007d1-7X; Mon, 31 Oct 2022 16:15:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbBr-0007bM-EK; Mon, 31 Oct 2022 16:15:23 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbBp-0000gY-Ic; Mon, 31 Oct 2022 16:15:23 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbBf-0003Dd-4t; Mon, 31 Oct 2022 20:15:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=WmhDBcUW9WRacFuVqQ9e646FOZuBckQuO9Vj70jaVXA=; b=1QKh5YjdGMXYcM6tI0iMU95FB2 2qi7I01EdA3CYteCZFjm2RWTgStIeXaET21EwS54n91dBe6lNM4QzNkav+ZluTO4g56AK/4RjWJPw +VJiQBV+vNgUGdBFnp9I142KfHdkGtvzeojyNKmcQxRYmxwaX4ebpOvjwlgkx5F6F6tftyrjUlpCe r9/KD90rblB4fUbrN0c+ci5uLDAtDUxybo9Qokd4NFysqufbOUW7nts1eRg9COZbP0VQvnFD00Z8v BLTkuuL5X6Cf2HpE3J2WUXBBWnQOT6UkuLynxWOmzR5dwF5VpEe/WK4CVwpHOmgn52Grmnjvv7wAm Tobp1NNjyTgW2UHnXuQCNyfHO3VgbQDua/Yc4b4o+jeHjdK25HBj9mYoCtJhhi4liaghoz7wWeXXY aK8YXDTPVzq0JEOOC81iw1aSeBgV0ixjhGAyrQ5dNBdd1YHQI0l3Vpvmfcakd2/lI854RJs0ii/3q WKx+zqGRVDgioEc/L8jehTs+/kJBGGP7eclLxK5cFyzYf1aG6pczannPpcpA71HgzM6b9ccGaxtUn 3/VKvQV+42bDIsSQr5lt5flUrFSsQLy/KGyX33ki8uthLQ885TUUQYmXcLTi9HgsAg4eClWC8RMhI YITelzlJiy8l8xJNjvvY5yX9dBPKAqUCsjW4bUDaQ=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:23 +0000 Message-Id: <20221031201435.677168-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 02/14] mac_oldworld: Drop some more variables X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247520045100011 From: BALATON Zoltan Drop some more local variables additionally to commit b8df32555ce5 to match clean ups done to mac_newwold in previous patch. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Message-Id: <1b9a448431d9b1198432151af0511316cfc20d21.1666957578.git.balato= n@eik.bme.hu> Signed-off-by: Mark Cave-Ayland --- hw/ppc/mac_oldworld.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 03732ca7ed..86512d31ad 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -80,14 +80,13 @@ static void ppc_heathrow_reset(void *opaque) =20 static void ppc_heathrow_init(MachineState *machine) { - ram_addr_t ram_size =3D machine->ram_size; const char *bios_name =3D machine->firmware ?: PROM_FILENAME; - const char *boot_device =3D machine->boot_config.order; PowerPCCPU *cpu =3D NULL; CPUPPCState *env =3D NULL; char *filename; - int i; + int i, bios_size; MemoryRegion *bios =3D g_new(MemoryRegion, 1); + uint64_t bios_addr; uint32_t kernel_base, initrd_base, cmdline_base =3D 0; int32_t kernel_size, initrd_size; PCIBus *pci_bus; @@ -97,16 +96,13 @@ static void ppc_heathrow_init(MachineState *machine) SysBusDevice *s; DeviceState *dev, *pic_dev, *grackle_dev; BusState *adb_bus; - uint64_t bios_addr; - int bios_size; - unsigned int smp_cpus =3D machine->smp.cpus; uint16_t ppc_boot_device; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; void *fw_cfg; uint64_t tbfreq; =20 /* init CPUs */ - for (i =3D 0; i < smp_cpus; i++) { + for (i =3D 0; i < machine->smp.cpus; i++) { cpu =3D POWERPC_CPU(cpu_create(machine->cpu_type)); env =3D &cpu->env; =20 @@ -116,9 +112,9 @@ static void ppc_heathrow_init(MachineState *machine) } =20 /* allocate RAM */ - if (ram_size > 2047 * MiB) { + if (machine->ram_size > 2047 * MiB) { error_report("Too much memory for this machine: %" PRId64 " MB, " - "maximum 2047 MB", ram_size / MiB); + "maximum 2047 MB", machine->ram_size / MiB); exit(1); } =20 @@ -165,12 +161,12 @@ static void ppc_heathrow_init(MachineState *machine) NULL, NULL, 1, PPC_ELF_MACHINE, 0, 0); if (kernel_size < 0) kernel_size =3D load_aout(machine->kernel_filename, kernel_bas= e, - ram_size - kernel_base, bswap_needed, - TARGET_PAGE_SIZE); + machine->ram_size - kernel_base, + bswap_needed, TARGET_PAGE_SIZE); if (kernel_size < 0) kernel_size =3D load_image_targphys(machine->kernel_filename, kernel_base, - ram_size - kernel_base); + machine->ram_size - kernel_b= ase); if (kernel_size < 0) { error_report("could not load kernel '%s'", machine->kernel_filename); @@ -182,7 +178,7 @@ static void ppc_heathrow_init(MachineState *machine) KERNEL_GAP); initrd_size =3D load_image_targphys(machine->initrd_filename, initrd_base, - ram_size - initrd_base); + machine->ram_size - initrd_b= ase); if (initrd_size < 0) { error_report("could not load initial ram disk '%s'", machine->initrd_filename); @@ -201,19 +197,22 @@ static void ppc_heathrow_init(MachineState *machine) initrd_base =3D 0; initrd_size =3D 0; ppc_boot_device =3D '\0'; - for (i =3D 0; boot_device[i] !=3D '\0'; i++) { - /* TOFIX: for now, the second IDE channel is not properly + for (i =3D 0; machine->boot_config.order[i] !=3D '\0'; i++) { + /* + * TOFIX: for now, the second IDE channel is not properly * used by OHW. The Mac floppy disk are not emulated. * For now, OHW cannot boot from the network. */ #if 0 - if (boot_device[i] >=3D 'a' && boot_device[i] <=3D 'f') { - ppc_boot_device =3D boot_device[i]; + if (machine->boot_config.order[i] >=3D 'a' && + machine->boot_config.order[i] <=3D 'f') { + ppc_boot_device =3D machine->boot_config.order[i]; break; } #else - if (boot_device[i] >=3D 'c' && boot_device[i] <=3D 'd') { - ppc_boot_device =3D boot_device[i]; + if (machine->boot_config.order[i] >=3D 'c' && + machine->boot_config.order[i] <=3D 'd') { + ppc_boot_device =3D machine->boot_config.order[i]; break; } #endif @@ -266,7 +265,7 @@ static void ppc_heathrow_init(MachineState *machine) } =20 /* Connect the heathrow PIC outputs to the 6xx bus */ - for (i =3D 0; i < smp_cpus; i++) { + for (i =3D 0; i < machine->smp.cpus; i++) { switch (PPC_INPUT(env)) { case PPC_FLAGS_INPUT_6xx: /* XXX: we register only 1 output pin for heathrow PIC */ @@ -323,9 +322,9 @@ static void ppc_heathrow_init(MachineState *machine) sysbus_mmio_map(s, 0, CFG_ADDR); sysbus_mmio_map(s, 1, CFG_ADDR + 2); =20 - fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)smp_cpus); + fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)machine->smp.cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)machine->smp.max_cpu= s); - fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, ARCH_HEATHROW); fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ADDR, kernel_base); fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size); --=20 2.30.2 From nobody Mon Feb 9 19:10:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667247455057909.1940089795597; Mon, 31 Oct 2022 13:17:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbBy-0007gH-Jq; Mon, 31 Oct 2022 16:15:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbBx-0007fo-8x; Mon, 31 Oct 2022 16:15:29 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbBs-0000j4-IV; Mon, 31 Oct 2022 16:15:29 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbBj-0003Dd-9Y; Mon, 31 Oct 2022 20:15:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hwaUYYVU+41OOeU0hyXJRy+VYii281OzaGpgj7bDplE=; b=I0rdjEUlcvKOHHK2pOrGVi/NZT Zkm45etUnJvmzgbKoMR934MdJ1J6ajTJ0K/Tkc5hrQ+6FR5yctC+Sg2BuxAKzDNjDLmzbFefRxjIw 1i+S/AzPHr045OSTQjuyQrlITN4giGnKZFHipd0xjmWhimWpCPNfixVfi+pLvxwRNxJlQeijKIUDN AkFGNem3Bi3L9OtjB4nslrRumJzuJPRPtrE3AMsoi1yh8KeOVvRn7dyfr3B/Kh3GOxpe4me0mmuFX VPoQwl3vptfIZBlxgNI6JQP/vCguXXO4TwjIBDSRW/P72JI8nnSSmEDlc7myjA1fIO1rVdkh0PEXj VC52VK7YE5+RU1yQiuUWghxDpmTxLDs7RAaORNpfFvXGwHPVgTR+HziNQy3uUzVmQ83xgw0j834x6 f1BbKj5cjTrl/iuWNBbyu6tz7OPHM6KhUl8bZLCaUB/EpF5uhRGtPATdWqp1wqmJGitvg06/oCJkb 8hcI/raLKbmlkax2Aij8D0NDHUdLumuNhX9FJ283LhQ8lJeURATfHq6U/AJIr3EWAXLRmsLSDLNH3 rX4vqpfxrX3cIx81vql6GYXxYeqhoxOa1W3JA7zw6A1+AAymv4O8EGHyGZjEw3YGAAVveb/ruYxL+ SUZpctumPHU0a5eXrxiS3JUkFUpB75gIKPK2QzK9E=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:24 +0000 Message-Id: <20221031201435.677168-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 03/14] mac_{old|new}world: Set tbfreq at declaration X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247455650100001 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan The tbfreq variable is only set once in an if-else which can be done at the variable declaration saving some lines of code and making it simpler. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Message-Id: <15668da8eb8bad4561428a5f25b02f91e16d9c1b.1666957578.git.balato= n@eik.bme.hu> Signed-off-by: Mark Cave-Ayland --- hw/ppc/mac_newworld.c | 9 +-------- hw/ppc/mac_oldworld.c | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 27e4e8d136..6327694f85 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -130,7 +130,7 @@ static void ppc_core99_init(MachineState *machine) DeviceState *dev, *pic_dev; DeviceState *uninorth_internal_dev =3D NULL, *uninorth_agp_dev =3D NUL= L; hwaddr nvram_addr =3D 0xFFF04000; - uint64_t tbfreq; + uint64_t tbfreq =3D kvm_enabled() ? kvmppc_get_tbfreq() : TBFREQ; =20 /* init CPUs */ for (i =3D 0; i < machine->smp.cpus; i++) { @@ -343,13 +343,6 @@ static void ppc_core99_init(MachineState *machine) has_adb =3D (core99_machine->via_config =3D=3D CORE99_VIA_CONFIG_CUDA = || core99_machine->via_config =3D=3D CORE99_VIA_CONFIG_PMU_ADB= ); =20 - /* Timebase Frequency */ - if (kvm_enabled()) { - tbfreq =3D kvmppc_get_tbfreq(); - } else { - tbfreq =3D TBFREQ; - } - /* init basic PC hardware */ pci_bus =3D PCI_HOST_BRIDGE(uninorth_pci)->bus; =20 diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 86512d31ad..5cabc410e7 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -99,7 +99,7 @@ static void ppc_heathrow_init(MachineState *machine) uint16_t ppc_boot_device; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; void *fw_cfg; - uint64_t tbfreq; + uint64_t tbfreq =3D kvm_enabled() ? kvmppc_get_tbfreq() : TBFREQ; =20 /* init CPUs */ for (i =3D 0; i < machine->smp.cpus; i++) { @@ -223,13 +223,6 @@ static void ppc_heathrow_init(MachineState *machine) } } =20 - /* Timebase Frequency */ - if (kvm_enabled()) { - tbfreq =3D kvmppc_get_tbfreq(); - } else { - tbfreq =3D TBFREQ; - } - /* Grackle PCI host bridge */ grackle_dev =3D qdev_new(TYPE_GRACKLE_PCI_HOST_BRIDGE); qdev_prop_set_uint32(grackle_dev, "ofw-addr", 0x80000000); --=20 2.30.2 From nobody Mon Feb 9 19:10:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667247443652451.6932663042388; Mon, 31 Oct 2022 13:17:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbBw-0007e9-A4; Mon, 31 Oct 2022 16:15:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbBu-0007dE-Kf; Mon, 31 Oct 2022 16:15:26 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbBs-0000jW-Ve; Mon, 31 Oct 2022 16:15:26 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbBn-0003Dd-Do; Mon, 31 Oct 2022 20:15:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UHqiYzuk1mAmwGDYyXBPOqWTR/rY54X3mLbfuba1quE=; b=a/IFh3pfoGk76kbDl2w5ZOmLxf xJh4SxhQN7eK5FdNMHD0W0aTL85gUFYqsxB6hYS+MbitbFQTaAf3lWb6pN6w0auKdc3cyjiN9h4Bg eP7k/lx9LyZQuxT5oPIHBxAx3yilfjp41M9fhzgoond193qRGeVyM773CZTiaQCzmsZ19foNavJaR df07sCUD1fAp17O3b1yn9dBT4Wvg2V0ODzkvKITKrPMTPdegdGgi5xh0s49EU3qmY/d4+FE0hjRTu ICDqBkIvowNgSFA4s/RtoRaMemr8zcBubqhgwb5e0vLhmS4n7tDa1JLtykxQaXOyCYZd8w/4NZsFo j9tJojg7wZ9q8QQKeY+ewJ1qMrcmIGY/f68wceHRD8yNg8HX0FoodPts9ovD83BjtthRZCLDf93Vl 6HMTzqS6IZDrUF6qT02QU/vyqeeSIEbMGX/Q/daiDte3iyXD7ABd19zYV4k1RZbUwLhWe4nG7IiRF Dh1aD7bbGbdBmcI9Oj6jmJ3+CShkapBs7QSCncjCzzPe7IaGfRXH+U+E1DAUDPGKFruSbHzUxdFZ3 PJ6gV/k4lru1DEGxZBiAUNqye6dJl9IjeKoUwNeGSgOwwm2Xv9S/7/yjbxQ0qn5Q+gxmJaFOSF4DX J25wu68dnmp8nH9w7uWn7Y6O4kQL/O6D7nnrkfa9Q=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:25 +0000 Message-Id: <20221031201435.677168-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 04/14] mac_{old|new}world: Avoid else branch by setting default value X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247445816100006 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan Several variables are set in if-else branches where the else branch can be removed by setting a default value at the variable declaration which leads to simlpler code that is easier to follow. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Message-Id: <8dac3515b29976a61dacda07752175d7531dca3c.1666957578.git.balato= n@eik.bme.hu> Signed-off-by: Mark Cave-Ayland --- hw/ppc/mac_newworld.c | 19 ++++--------------- hw/ppc/mac_oldworld.c | 18 ++++-------------- 2 files changed, 8 insertions(+), 29 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 6327694f85..6bc3bd19be 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -111,11 +111,11 @@ static void ppc_core99_init(MachineState *machine) CPUPPCState *env =3D NULL; char *filename; IrqLines *openpic_irqs; - int i, j, k, ppc_boot_device, machine_arch, bios_size; + int i, j, k, ppc_boot_device, machine_arch, bios_size =3D -1; const char *bios_name =3D machine->firmware ?: PROM_FILENAME; MemoryRegion *bios =3D g_new(MemoryRegion, 1); - hwaddr kernel_base, initrd_base, cmdline_base =3D 0; - long kernel_size, initrd_size; + hwaddr kernel_base =3D 0, initrd_base =3D 0, cmdline_base =3D 0; + long kernel_size =3D 0, initrd_size =3D 0; UNINHostState *uninorth_pci; PCIBus *pci_bus; PCIDevice *macio; @@ -165,8 +165,6 @@ static void ppc_core99_init(MachineState *machine) bios_size =3D load_image_targphys(filename, PROM_BASE, PROM_SI= ZE); } g_free(filename); - } else { - bios_size =3D -1; } if (bios_size < 0 || bios_size > PROM_SIZE) { error_report("could not load PowerPC bios '%s'", bios_name); @@ -174,15 +172,12 @@ static void ppc_core99_init(MachineState *machine) } =20 if (machine->kernel_filename) { - int bswap_needed; + int bswap_needed =3D 0; =20 #ifdef BSWAP_NEEDED bswap_needed =3D 1; -#else - bswap_needed =3D 0; #endif kernel_base =3D KERNEL_LOAD_ADDR; - kernel_size =3D load_elf(machine->kernel_filename, NULL, translate_kernel_address, NULL, NULL, NULL, NULL, NULL, 1, PPC_ELF_MACHINE, 0, 0); @@ -212,16 +207,10 @@ static void ppc_core99_init(MachineState *machine) } cmdline_base =3D TARGET_PAGE_ALIGN(initrd_base + initrd_size); } else { - initrd_base =3D 0; - initrd_size =3D 0; cmdline_base =3D TARGET_PAGE_ALIGN(kernel_base + kernel_size += KERNEL_GAP); } ppc_boot_device =3D 'm'; } else { - kernel_base =3D 0; - kernel_size =3D 0; - initrd_base =3D 0; - initrd_size =3D 0; ppc_boot_device =3D '\0'; /* We consider that NewWorld PowerMac never have any floppy drive * For now, OHW cannot boot from the network. diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 5cabc410e7..cb67e44081 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -84,11 +84,11 @@ static void ppc_heathrow_init(MachineState *machine) PowerPCCPU *cpu =3D NULL; CPUPPCState *env =3D NULL; char *filename; - int i, bios_size; + int i, bios_size =3D -1; MemoryRegion *bios =3D g_new(MemoryRegion, 1); uint64_t bios_addr; - uint32_t kernel_base, initrd_base, cmdline_base =3D 0; - int32_t kernel_size, initrd_size; + uint32_t kernel_base =3D 0, initrd_base =3D 0, cmdline_base =3D 0; + int32_t kernel_size =3D 0, initrd_size =3D 0; PCIBus *pci_bus; PCIDevice *macio; MACIOIDEState *macio_ide; @@ -139,8 +139,6 @@ static void ppc_heathrow_init(MachineState *machine) bios_addr =3D PROM_BASE; } g_free(filename); - } else { - bios_size =3D -1; } if (bios_size < 0 || bios_addr - PROM_BASE + bios_size > PROM_SIZE) { error_report("could not load PowerPC bios '%s'", bios_name); @@ -148,12 +146,10 @@ static void ppc_heathrow_init(MachineState *machine) } =20 if (machine->kernel_filename) { - int bswap_needed; + int bswap_needed =3D 0; =20 #ifdef BSWAP_NEEDED bswap_needed =3D 1; -#else - bswap_needed =3D 0; #endif kernel_base =3D KERNEL_LOAD_ADDR; kernel_size =3D load_elf(machine->kernel_filename, NULL, @@ -186,16 +182,10 @@ static void ppc_heathrow_init(MachineState *machine) } cmdline_base =3D TARGET_PAGE_ALIGN(initrd_base + initrd_size); } else { - initrd_base =3D 0; - initrd_size =3D 0; cmdline_base =3D TARGET_PAGE_ALIGN(kernel_base + kernel_size += KERNEL_GAP); } ppc_boot_device =3D 'm'; } else { - kernel_base =3D 0; - kernel_size =3D 0; - initrd_base =3D 0; - initrd_size =3D 0; ppc_boot_device =3D '\0'; for (i =3D 0; machine->boot_config.order[i] !=3D '\0'; i++) { /* --=20 2.30.2 From nobody Mon Feb 9 19:10:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667247518523883.9991983523033; Mon, 31 Oct 2022 13:18:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbBx-0007fq-Aj; Mon, 31 Oct 2022 16:15:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbBv-0007db-Ve; Mon, 31 Oct 2022 16:15:28 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbBt-0000ji-Lz; Mon, 31 Oct 2022 16:15:27 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbBn-0003Dd-SW; Mon, 31 Oct 2022 20:15:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=BcQWcJ8ZXDwC4gCuiLb2NZ74ZtI95D38mrxv5HNu1aA=; b=Ioy9YoROlC29uqn++XVPgMd9kr IgXB5br9hh80yZjqZJlhSsK3JsvT5DYOdEfwz2IrpP6E6c5KXvv1A/Dei51fYKfJt8ZEhi8rbojub oUI8wLgam8JYrBTAPGJUSqdgyNno21ZSLFBJElqQKPVCpEBCEzkDpjxQVt1qbe8afsoLeQ3GBCCj8 xwW45bjyuo2M2loR8AnyPvTs6pG90+M/iFXkTgYmgIMmmts2YhpZ4YvhWO3Up0DwtX83tPSpMFhX6 whNQFM+zzTGhj7MWM2t71rgye41A5fUA83OxEskjDfNosGZZ19+JOfuxQv5Urfclr4B7Rhf/K9jVR aUN90g2WTP9kLjUuUZSA1GWnbE5w9UXNAeDSuznucTEWU8oGjJKItGuWJ2+8O02l7CivaXsdLLQq8 dojN7eNsnHCWb4pdRvMxg3Jw2ZHq518p70/XqfH8hKnbeBUc60kTZwFhRz3rGHyL77rMIm4FcYcaq pzFYLJArOBP8f6cFqH5cuWIr1rjZxbsBQAmmhS+CXoP9jRV44gVYpJ4SaJ3mcc/CWT9qBEQuxQUcl ghYfpWK83dLZKIA5RAasda90pih7XhE6zPPpkcwePsnxx2oy+TDlw02ldnRQqQ+mvHuh+nm3ujfZP kcNTGCDHlCInMTdecf22bis2QdocN5+idr+IbL8sk=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:26 +0000 Message-Id: <20221031201435.677168-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 05/14] mac_newworld: Clean up creation of Uninorth devices X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247519960100008 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan Map regions in ascending order and reorganise code a bit to avoid some casts and move Uninorth parts together. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Message-Id: Signed-off-by: Mark Cave-Ayland --- hw/ppc/mac_newworld.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 6bc3bd19be..e2f456b547 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -228,13 +228,6 @@ static void ppc_core99_init(MachineState *machine) } } =20 - /* UniN init */ - dev =3D qdev_new(TYPE_UNI_NORTH); - s =3D SYS_BUS_DEVICE(dev); - sysbus_realize_and_unref(s, &error_fatal); - memory_region_add_subregion(get_system_memory(), 0xf8000000, - sysbus_mmio_get_region(s, 0)); - openpic_irqs =3D g_new0(IrqLines, machine->smp.cpus); for (i =3D 0; i < machine->smp.cpus; i++) { /* Mac99 IRQ connection between OpenPIC outputs pins @@ -275,24 +268,30 @@ static void ppc_core99_init(MachineState *machine) } } =20 + /* UniN init */ + s =3D SYS_BUS_DEVICE(qdev_new(TYPE_UNI_NORTH)); + sysbus_realize_and_unref(s, &error_fatal); + memory_region_add_subregion(get_system_memory(), 0xf8000000, + sysbus_mmio_get_region(s, 0)); + if (PPC_INPUT(env) =3D=3D PPC_FLAGS_INPUT_970) { + machine_arch =3D ARCH_MAC99_U3; /* 970 gets a U3 bus */ /* Uninorth AGP bus */ dev =3D qdev_new(TYPE_U3_AGP_HOST_BRIDGE); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); uninorth_pci =3D U3_AGP_HOST_BRIDGE(dev); s =3D SYS_BUS_DEVICE(dev); + sysbus_realize_and_unref(s, &error_fatal); + sysbus_mmio_map(s, 0, 0xf0800000); + sysbus_mmio_map(s, 1, 0xf0c00000); /* PCI hole */ - memory_region_add_subregion(get_system_memory(), 0x80000000ULL, + memory_region_add_subregion(get_system_memory(), 0x80000000, sysbus_mmio_get_region(s, 2)); /* Register 8 MB of ISA IO space */ memory_region_add_subregion(get_system_memory(), 0xf2000000, sysbus_mmio_get_region(s, 3)); - sysbus_mmio_map(s, 0, 0xf0800000); - sysbus_mmio_map(s, 1, 0xf0c00000); - - machine_arch =3D ARCH_MAC99_U3; } else { + machine_arch =3D ARCH_MAC99; /* Use values found on a real PowerMac */ /* Uninorth AGP bus */ uninorth_agp_dev =3D qdev_new(TYPE_UNI_NORTH_AGP_HOST_BRIDGE); @@ -309,22 +308,20 @@ static void ppc_core99_init(MachineState *machine) sysbus_mmio_map(s, 0, 0xf4800000); sysbus_mmio_map(s, 1, 0xf4c00000); =20 - /* Uninorth main bus */ + /* Uninorth main bus - this must be last to make it the default */ dev =3D qdev_new(TYPE_UNI_NORTH_PCI_HOST_BRIDGE); qdev_prop_set_uint32(dev, "ofw-addr", 0xf2000000); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); uninorth_pci =3D UNI_NORTH_PCI_HOST_BRIDGE(dev); s =3D SYS_BUS_DEVICE(dev); + sysbus_realize_and_unref(s, &error_fatal); + sysbus_mmio_map(s, 0, 0xf2800000); + sysbus_mmio_map(s, 1, 0xf2c00000); /* PCI hole */ - memory_region_add_subregion(get_system_memory(), 0x80000000ULL, + memory_region_add_subregion(get_system_memory(), 0x80000000, sysbus_mmio_get_region(s, 2)); /* Register 8 MB of ISA IO space */ memory_region_add_subregion(get_system_memory(), 0xf2000000, sysbus_mmio_get_region(s, 3)); - sysbus_mmio_map(s, 0, 0xf2800000); - sysbus_mmio_map(s, 1, 0xf2c00000); - - machine_arch =3D ARCH_MAC99; } =20 machine->usb |=3D defaults_enabled() && !machine->usb_disabled; --=20 2.30.2 From nobody Mon Feb 9 19:10:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667247443466932.7819197149325; Mon, 31 Oct 2022 13:17:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbC1-0007i6-4J; Mon, 31 Oct 2022 16:15:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbBz-0007gu-K8; Mon, 31 Oct 2022 16:15:31 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbBx-0000ki-Fy; Mon, 31 Oct 2022 16:15:31 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbBo-0003Dd-83; Mon, 31 Oct 2022 20:15:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ROCBrwYAYugGOT3o5nbm7n84UCVP/KSFy6cJEyWooXc=; b=RG1DItBCDRdr6qXzAQ42d0Nfsv lBDHkuTuqMDSHs8U/20YeungDQN00lKTFL+62LlVfObbye9FfloTfMPFX8vAZamjPlNEl/gSKxzUI TQGhqUc/+hI5EKMq6/QYN/M+EX3zxFlbLddhnW+4wnWfXbbrUqdMHYkimzLgAZTjStIEe+0YUvh2f lN7Yygl9fcCLE0Fjjz7i7alpI0FzyjV4RR6dd3/ftiA322ZOu5HpsKdDvYoeQbc6SzpL5Y1iiEo6g NjvoDvmuvMrMlkMq+yLGCC1ppxoMsNrhpXL1Wqvp0/+MLK75yu/ZUs8cXpi2uWVVfjXuoD8LYMk4l 0nURq/YPs0RFVC+QQLF60H8pcBPGFAbwvUY28dfGKBOYvlN3ikqOt+Y0hocrVDZNyNtSF3HkmHMYC UpXb6FYExy/pjqUQt9HN80IeJgDME275KHu54upOjI0OFtEQ+NdCyt6gAYe35fU7HMdb4sET/YMWk 6OPq0lS9thA4O0TfS+jB8fTVFb+DCScP8JhFbGyMVrb4YUy0yFrhVWvco5hYaUz8TF3iNPJElbnZr Rjbtb6IWL+6BU3CFCHwo/fgXDjq5CKzgLm8vuQE5Qh7VCVItmPAeHFBK56/QCCJsZxndWioYzltKs wAD2791mWVsl5RdxvGdQ8wadFyvYVKhxq5kbCPImw=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:27 +0000 Message-Id: <20221031201435.677168-7-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 06/14] mac_{old|new}world: Reduce number of QOM casts X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247445804100005 From: BALATON Zoltan By storing the device pointers in a variable with the right type the number of QOM casts can be reduced which also makes the code more readable. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Message-Id: Signed-off-by: Mark Cave-Ayland --- hw/ppc/mac_newworld.c | 61 ++++++++++++++++++++----------------------- hw/ppc/mac_oldworld.c | 26 ++++++++---------- 2 files changed, 39 insertions(+), 48 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index e2f456b547..4bfffa586b 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -116,18 +116,16 @@ static void ppc_core99_init(MachineState *machine) MemoryRegion *bios =3D g_new(MemoryRegion, 1); hwaddr kernel_base =3D 0, initrd_base =3D 0, cmdline_base =3D 0; long kernel_size =3D 0, initrd_size =3D 0; - UNINHostState *uninorth_pci; PCIBus *pci_bus; - PCIDevice *macio; - ESCCState *escc; bool has_pmu, has_adb; + Object *macio; MACIOIDEState *macio_ide; BusState *adb_bus; MacIONVRAMState *nvr; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; void *fw_cfg; SysBusDevice *s; - DeviceState *dev, *pic_dev; + DeviceState *dev, *pic_dev, *uninorth_pci_dev; DeviceState *uninorth_internal_dev =3D NULL, *uninorth_agp_dev =3D NUL= L; hwaddr nvram_addr =3D 0xFFF04000; uint64_t tbfreq =3D kvm_enabled() ? kvmppc_get_tbfreq() : TBFREQ; @@ -229,6 +227,7 @@ static void ppc_core99_init(MachineState *machine) } =20 openpic_irqs =3D g_new0(IrqLines, machine->smp.cpus); + dev =3D DEVICE(cpu); for (i =3D 0; i < machine->smp.cpus; i++) { /* Mac99 IRQ connection between OpenPIC outputs pins * and PowerPC input pins @@ -236,30 +235,30 @@ static void ppc_core99_init(MachineState *machine) switch (PPC_INPUT(env)) { case PPC_FLAGS_INPUT_6xx: openpic_irqs[i].irq[OPENPIC_OUTPUT_INT] =3D - qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_INT); + qdev_get_gpio_in(dev, PPC6xx_INPUT_INT); openpic_irqs[i].irq[OPENPIC_OUTPUT_CINT] =3D - qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_INT); + qdev_get_gpio_in(dev, PPC6xx_INPUT_INT); openpic_irqs[i].irq[OPENPIC_OUTPUT_MCK] =3D - qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_MCP); + qdev_get_gpio_in(dev, PPC6xx_INPUT_MCP); /* Not connected ? */ openpic_irqs[i].irq[OPENPIC_OUTPUT_DEBUG] =3D NULL; /* Check this */ openpic_irqs[i].irq[OPENPIC_OUTPUT_RESET] =3D - qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_HRESET); + qdev_get_gpio_in(dev, PPC6xx_INPUT_HRESET); break; #if defined(TARGET_PPC64) case PPC_FLAGS_INPUT_970: openpic_irqs[i].irq[OPENPIC_OUTPUT_INT] =3D - qdev_get_gpio_in(DEVICE(cpu), PPC970_INPUT_INT); + qdev_get_gpio_in(dev, PPC970_INPUT_INT); openpic_irqs[i].irq[OPENPIC_OUTPUT_CINT] =3D - qdev_get_gpio_in(DEVICE(cpu), PPC970_INPUT_INT); + qdev_get_gpio_in(dev, PPC970_INPUT_INT); openpic_irqs[i].irq[OPENPIC_OUTPUT_MCK] =3D - qdev_get_gpio_in(DEVICE(cpu), PPC970_INPUT_MCP); + qdev_get_gpio_in(dev, PPC970_INPUT_MCP); /* Not connected ? */ openpic_irqs[i].irq[OPENPIC_OUTPUT_DEBUG] =3D NULL; /* Check this */ openpic_irqs[i].irq[OPENPIC_OUTPUT_RESET] =3D - qdev_get_gpio_in(DEVICE(cpu), PPC970_INPUT_HRESET); + qdev_get_gpio_in(dev, PPC970_INPUT_HRESET); break; #endif /* defined(TARGET_PPC64) */ default: @@ -278,9 +277,8 @@ static void ppc_core99_init(MachineState *machine) machine_arch =3D ARCH_MAC99_U3; /* 970 gets a U3 bus */ /* Uninorth AGP bus */ - dev =3D qdev_new(TYPE_U3_AGP_HOST_BRIDGE); - uninorth_pci =3D U3_AGP_HOST_BRIDGE(dev); - s =3D SYS_BUS_DEVICE(dev); + uninorth_pci_dev =3D qdev_new(TYPE_U3_AGP_HOST_BRIDGE); + s =3D SYS_BUS_DEVICE(uninorth_pci_dev); sysbus_realize_and_unref(s, &error_fatal); sysbus_mmio_map(s, 0, 0xf0800000); sysbus_mmio_map(s, 1, 0xf0c00000); @@ -309,10 +307,9 @@ static void ppc_core99_init(MachineState *machine) sysbus_mmio_map(s, 1, 0xf4c00000); =20 /* Uninorth main bus - this must be last to make it the default */ - dev =3D qdev_new(TYPE_UNI_NORTH_PCI_HOST_BRIDGE); - qdev_prop_set_uint32(dev, "ofw-addr", 0xf2000000); - uninorth_pci =3D UNI_NORTH_PCI_HOST_BRIDGE(dev); - s =3D SYS_BUS_DEVICE(dev); + uninorth_pci_dev =3D qdev_new(TYPE_UNI_NORTH_PCI_HOST_BRIDGE); + qdev_prop_set_uint32(uninorth_pci_dev, "ofw-addr", 0xf2000000); + s =3D SYS_BUS_DEVICE(uninorth_pci_dev); sysbus_realize_and_unref(s, &error_fatal); sysbus_mmio_map(s, 0, 0xf2800000); sysbus_mmio_map(s, 1, 0xf2c00000); @@ -330,24 +327,24 @@ static void ppc_core99_init(MachineState *machine) core99_machine->via_config =3D=3D CORE99_VIA_CONFIG_PMU_ADB= ); =20 /* init basic PC hardware */ - pci_bus =3D PCI_HOST_BRIDGE(uninorth_pci)->bus; + pci_bus =3D PCI_HOST_BRIDGE(uninorth_pci_dev)->bus; =20 /* MacIO */ - macio =3D pci_new(-1, TYPE_NEWWORLD_MACIO); + macio =3D OBJECT(pci_new(-1, TYPE_NEWWORLD_MACIO)); dev =3D DEVICE(macio); qdev_prop_set_uint64(dev, "frequency", tbfreq); qdev_prop_set_bit(dev, "has-pmu", has_pmu); qdev_prop_set_bit(dev, "has-adb", has_adb); =20 - escc =3D ESCC(object_resolve_path_component(OBJECT(macio), "escc")); - qdev_prop_set_chr(DEVICE(escc), "chrA", serial_hd(0)); - qdev_prop_set_chr(DEVICE(escc), "chrB", serial_hd(1)); + dev =3D DEVICE(object_resolve_path_component(macio, "escc")); + qdev_prop_set_chr(dev, "chrA", serial_hd(0)); + qdev_prop_set_chr(dev, "chrB", serial_hd(1)); =20 - pci_realize_and_unref(macio, pci_bus, &error_fatal); + pci_realize_and_unref(PCI_DEVICE(macio), pci_bus, &error_fatal); =20 - pic_dev =3D DEVICE(object_resolve_path_component(OBJECT(macio), "pic")= ); + pic_dev =3D DEVICE(object_resolve_path_component(macio, "pic")); for (i =3D 0; i < 4; i++) { - qdev_connect_gpio_out(DEVICE(uninorth_pci), i, + qdev_connect_gpio_out(uninorth_pci_dev, i, qdev_get_gpio_in(pic_dev, 0x1b + i)); } =20 @@ -379,19 +376,17 @@ static void ppc_core99_init(MachineState *machine) /* We only emulate 2 out of 3 IDE controllers for now */ ide_drive_get(hd, ARRAY_SIZE(hd)); =20 - macio_ide =3D MACIO_IDE(object_resolve_path_component(OBJECT(macio), - "ide[0]")); + macio_ide =3D MACIO_IDE(object_resolve_path_component(macio, "ide[0]")= ); macio_ide_init_drives(macio_ide, hd); =20 - macio_ide =3D MACIO_IDE(object_resolve_path_component(OBJECT(macio), - "ide[1]")); + macio_ide =3D MACIO_IDE(object_resolve_path_component(macio, "ide[1]")= ); macio_ide_init_drives(macio_ide, &hd[MAX_IDE_DEVS]); =20 if (has_adb) { if (has_pmu) { - dev =3D DEVICE(object_resolve_path_component(OBJECT(macio), "p= mu")); + dev =3D DEVICE(object_resolve_path_component(macio, "pmu")); } else { - dev =3D DEVICE(object_resolve_path_component(OBJECT(macio), "c= uda")); + dev =3D DEVICE(object_resolve_path_component(macio, "cuda")); } =20 adb_bus =3D qdev_get_child_bus(dev, "adb.0"); diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index cb67e44081..a497507f1d 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -90,9 +90,8 @@ static void ppc_heathrow_init(MachineState *machine) uint32_t kernel_base =3D 0, initrd_base =3D 0, cmdline_base =3D 0; int32_t kernel_size =3D 0, initrd_size =3D 0; PCIBus *pci_bus; - PCIDevice *macio; + Object *macio; MACIOIDEState *macio_ide; - ESCCState *escc; SysBusDevice *s; DeviceState *dev, *pic_dev, *grackle_dev; BusState *adb_bus; @@ -231,17 +230,16 @@ static void ppc_heathrow_init(MachineState *machine) pci_bus =3D PCI_HOST_BRIDGE(grackle_dev)->bus; =20 /* MacIO */ - macio =3D pci_new(PCI_DEVFN(16, 0), TYPE_OLDWORLD_MACIO); - dev =3D DEVICE(macio); - qdev_prop_set_uint64(dev, "frequency", tbfreq); + macio =3D OBJECT(pci_new(PCI_DEVFN(16, 0), TYPE_OLDWORLD_MACIO)); + qdev_prop_set_uint64(DEVICE(macio), "frequency", tbfreq); =20 - escc =3D ESCC(object_resolve_path_component(OBJECT(macio), "escc")); - qdev_prop_set_chr(DEVICE(escc), "chrA", serial_hd(0)); - qdev_prop_set_chr(DEVICE(escc), "chrB", serial_hd(1)); + dev =3D DEVICE(object_resolve_path_component(macio, "escc")); + qdev_prop_set_chr(dev, "chrA", serial_hd(0)); + qdev_prop_set_chr(dev, "chrB", serial_hd(1)); =20 - pci_realize_and_unref(macio, pci_bus, &error_fatal); + pci_realize_and_unref(PCI_DEVICE(macio), pci_bus, &error_fatal); =20 - pic_dev =3D DEVICE(object_resolve_path_component(OBJECT(macio), "pic")= ); + pic_dev =3D DEVICE(object_resolve_path_component(macio, "pic")); for (i =3D 0; i < 4; i++) { qdev_connect_gpio_out(grackle_dev, i, qdev_get_gpio_in(pic_dev, 0x15 + i)); @@ -269,16 +267,14 @@ static void ppc_heathrow_init(MachineState *machine) =20 /* MacIO IDE */ ide_drive_get(hd, ARRAY_SIZE(hd)); - macio_ide =3D MACIO_IDE(object_resolve_path_component(OBJECT(macio), - "ide[0]")); + macio_ide =3D MACIO_IDE(object_resolve_path_component(macio, "ide[0]")= ); macio_ide_init_drives(macio_ide, hd); =20 - macio_ide =3D MACIO_IDE(object_resolve_path_component(OBJECT(macio), - "ide[1]")); + macio_ide =3D MACIO_IDE(object_resolve_path_component(macio, "ide[1]")= ); macio_ide_init_drives(macio_ide, &hd[MAX_IDE_DEVS]); =20 /* MacIO CUDA/ADB */ - dev =3D DEVICE(object_resolve_path_component(OBJECT(macio), "cuda")); + dev =3D DEVICE(object_resolve_path_component(macio, "cuda")); adb_bus =3D qdev_get_child_bus(dev, "adb.0"); dev =3D qdev_new(TYPE_ADB_KEYBOARD); qdev_realize_and_unref(dev, adb_bus, &error_fatal); --=20 2.30.2 From nobody Mon Feb 9 19:10:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 166724740176714.867728933610579; Mon, 31 Oct 2022 13:16:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbC5-0007mn-PY; Mon, 31 Oct 2022 16:15:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbC4-0007l8-4w; Mon, 31 Oct 2022 16:15:36 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbC1-0000mP-JI; Mon, 31 Oct 2022 16:15:35 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbBs-0003Dd-Cx; Mon, 31 Oct 2022 20:15:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ImOXHYiv8O4xotxGyVdu9Mo4Ou027BIs5Y7o98ZDwYg=; b=sEmWriwws8azvH7APlpdRPGjCv D1+bwgGyKEtWlDmyouq0q0K8wggedTKNXY6gRPo5sif5sFyn1+CU8qgLVA84AwL7F0i9MtnlLg9QS x6PJrnHqTl2MyS/L4sSVU8erEDTZlqWgMb1SD5meaP3oocMOwWykOcMlf0xTShTjN+cQuetUo+/co 9LZBv+1QqwheDQsSEVlCVTSpqlvEwMskYmnTPNkTYAYNCd+JHL+h6MZk1JMod2uJ+Ak7iGiCe4z4f MRsLOJDcfrWBG0QejUa47CvgSB8dTTFhwi+QV8GiW9Rc8UjE+szES1ytZz4dSFiuYJtbAMw2gU2zG lU22M3yQG8M4Peg744LqApv9m1ddh39YW5IqVmsxPiZ6kZjcwEks9rtHkUByVwNqDASM2J9yJY9n8 Le7gXjNfh30tkyswMrdWCp74zeVWMAFTdvjtTPwj46YsemQSinV+HaV3WWGwUm0D6JkbY0yXkx/JO K5+qu99Xo4Y61pwmBfHHEZ8uojPmj/rocF/5rw4dzyltLstdl6eEqErDwEpawQv0aLRjykdv9ECE/ bRASVgIcj4ea/cKPAuls97w3dJtQGXPBDU63zmYy4Uh0dP62zn72i2umDFotDhMeBjlEh5D6Ataxu 3O1lFvl7bJMuTVe7SoajRTlBcLuGPgkLywO7ndLoM=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:28 +0000 Message-Id: <20221031201435.677168-8-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 07/14] hw/ppc/mac.h: Move newworld specific parts out from shared header X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247403432100007 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan Move the parts specific to and only used by mac99 out from the shared mac.h into mac_newworld.c where they better belong. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Message-Id: Signed-off-by: Mark Cave-Ayland --- hw/ppc/mac.h | 24 ------------------------ hw/ppc/mac_newworld.c | 19 +++++++++++++++++++ hw/ppc/mac_oldworld.c | 1 + 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index a1fa8f8e41..e97087c7e7 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -26,15 +26,8 @@ #ifndef PPC_MAC_H #define PPC_MAC_H =20 -#include "qemu/units.h" #include "exec/memory.h" -#include "hw/boards.h" #include "hw/sysbus.h" -#include "hw/input/adb.h" -#include "hw/misc/mos6522.h" -#include "hw/pci/pci_host.h" -#include "hw/pci-host/uninorth.h" -#include "qom/object.h" =20 #define NVRAM_SIZE 0x2000 #define PROM_FILENAME "openbios-ppc" @@ -65,23 +58,6 @@ #define NEWWORLD_EXTING_GPIO1 0x2f #define NEWWORLD_EXTING_GPIO9 0x37 =20 -/* Core99 machine */ -#define TYPE_CORE99_MACHINE MACHINE_TYPE_NAME("mac99") -typedef struct Core99MachineState Core99MachineState; -DECLARE_INSTANCE_CHECKER(Core99MachineState, CORE99_MACHINE, - TYPE_CORE99_MACHINE) - -#define CORE99_VIA_CONFIG_CUDA 0x0 -#define CORE99_VIA_CONFIG_PMU 0x1 -#define CORE99_VIA_CONFIG_PMU_ADB 0x2 - -struct Core99MachineState { - /*< private >*/ - MachineState parent; - - uint8_t via_config; -}; - /* Grackle PCI */ #define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost" =20 diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 4bfffa586b..873c9f5cb4 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -48,10 +48,13 @@ =20 #include "qemu/osdep.h" #include "qemu/datadir.h" +#include "qemu/units.h" #include "qapi/error.h" #include "hw/ppc/ppc.h" #include "hw/qdev-properties.h" #include "hw/ppc/mac.h" +#include "hw/boards.h" +#include "hw/pci-host/uninorth.h" #include "hw/input/adb.h" #include "hw/ppc/mac_dbdma.h" #include "hw/pci/pci.h" @@ -83,6 +86,22 @@ #define PROM_BASE 0xfff00000 #define PROM_SIZE (1 * MiB) =20 +#define TYPE_CORE99_MACHINE MACHINE_TYPE_NAME("mac99") +typedef struct Core99MachineState Core99MachineState; +DECLARE_INSTANCE_CHECKER(Core99MachineState, CORE99_MACHINE, + TYPE_CORE99_MACHINE) + +#define CORE99_VIA_CONFIG_CUDA 0x0 +#define CORE99_VIA_CONFIG_PMU 0x1 +#define CORE99_VIA_CONFIG_PMU_ADB 0x2 + +struct Core99MachineState { + /*< private >*/ + MachineState parent; + + uint8_t via_config; +}; + static void fw_cfg_boot_set(void *opaque, const char *boot_device, Error **errp) { diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index a497507f1d..f323a49d7a 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -31,6 +31,7 @@ #include "hw/ppc/ppc.h" #include "hw/qdev-properties.h" #include "mac.h" +#include "hw/boards.h" #include "hw/input/adb.h" #include "sysemu/sysemu.h" #include "net/net.h" --=20 2.30.2 From nobody Mon Feb 9 19:10:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667247391328817.2669534802984; Mon, 31 Oct 2022 13:16:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbC9-0007pc-4c; Mon, 31 Oct 2022 16:15:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbC6-0007oH-OC; Mon, 31 Oct 2022 16:15:38 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbC5-0000rJ-0q; Mon, 31 Oct 2022 16:15:38 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbBw-0003Dd-Iz; Mon, 31 Oct 2022 20:15:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=kstXfHnErQZUF6Wap6hUKqfvaq6xSCaNh+lwjMRDNgU=; b=qgEOQ1NFHGbkPGsSJ49E/8VjVq qZcl9R1PewKh0IbaAWxte5XDgLIFJBo3S4Clh2KX4T2VGo4hQ5BYHkvstLHcTzvo2JajjzlcQB5Hq 9Tdbu9QMFcZdpWmR1kmIaOD1uXE3lM0lXi3rvTH8yuMUkl2FmxX/kFiw29eJ9YdEWeb+deN9Q4UN5 8Ai6s0m/BkEnVRFKnpqOyZ+2KqdEZhCtMpcNomC3lTGfJUGvblnNoB/++Zq/sqp09ijdelor/MbIQ bLYhTUd5iDygmf9hRCEzhDeN6K6LRh8r6rhKXKaCDaMiPg9CJVolkjv17Zh22aO8uD65tRepq5AXM yJc61KsRI/7yac5pD4Xlx0aMUIrJcmIBAIolXVgN7TueVYj+HvsLHu2eIxEoFNts1mgZQX4BG+ne+ KATtsUaPgmeb5LHPl7bz7aWsQd1uRCsbCi7yP27hJz9/GMiuh8ckUheXhS+RgSOIn68RGF7+z0jgF mgcLyDlRbxDIqcUldyhg49EgxymJTrMna5z5Yw910OhRSC1UIF5L3KvxYgTlbBgWS16/Bb5UtzYSK eElsvnHutweUIWGFaAseQ7h3hTm+0EMyxOWBU4vae4rWG/THkOojnQKEOhFMRM8sTWPH0VhMI4tjR 7N1mMeU6bR9n1ZO/PxZvQYC6ZgueP3Nx/wamZBOOY=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:29 +0000 Message-Id: <20221031201435.677168-9-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 08/14] hw/ppc/mac.h: Move macio specific parts out from shared header X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247393394100003 From: BALATON Zoltan Move the parts specific to and only used by macio out from the shared mac.h into macio.c where they better belong. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Message-Id: Signed-off-by: Mark Cave-Ayland --- hw/misc/macio/macio.c | 5 +++-- hw/ppc/mac.h | 23 ----------------------- include/hw/misc/macio/macio.h | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index c1fad43f6c..f9f0758b03 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -37,8 +37,9 @@ #include "hw/intc/heathrow_pic.h" #include "trace.h" =20 -/* Note: this code is strongly inspirated from the corresponding code - * in PearPC */ +#define ESCC_CLOCK 3686400 + +/* Note: this code is strongly inspired by the corresponding code in PearP= C */ =20 /* * The mac-io has two interfaces to the ESCC. One is called "escc-legacy", diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index e97087c7e7..55cb02c990 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -35,29 +35,6 @@ #define KERNEL_LOAD_ADDR 0x01000000 #define KERNEL_GAP 0x00100000 =20 -#define ESCC_CLOCK 3686400 - -/* Old World IRQs */ -#define OLDWORLD_CUDA_IRQ 0x12 -#define OLDWORLD_ESCCB_IRQ 0x10 -#define OLDWORLD_ESCCA_IRQ 0xf -#define OLDWORLD_IDE0_IRQ 0xd -#define OLDWORLD_IDE0_DMA_IRQ 0x2 -#define OLDWORLD_IDE1_IRQ 0xe -#define OLDWORLD_IDE1_DMA_IRQ 0x3 - -/* New World IRQs */ -#define NEWWORLD_CUDA_IRQ 0x19 -#define NEWWORLD_PMU_IRQ 0x19 -#define NEWWORLD_ESCCB_IRQ 0x24 -#define NEWWORLD_ESCCA_IRQ 0x25 -#define NEWWORLD_IDE0_IRQ 0xd -#define NEWWORLD_IDE0_DMA_IRQ 0x2 -#define NEWWORLD_IDE1_IRQ 0xe -#define NEWWORLD_IDE1_DMA_IRQ 0x3 -#define NEWWORLD_EXTING_GPIO1 0x2f -#define NEWWORLD_EXTING_GPIO9 0x37 - /* Grackle PCI */ #define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost" =20 diff --git a/include/hw/misc/macio/macio.h b/include/hw/misc/macio/macio.h index 6c05f3bfd2..26cf15b1ce 100644 --- a/include/hw/misc/macio/macio.h +++ b/include/hw/misc/macio/macio.h @@ -38,6 +38,27 @@ #include "hw/ppc/openpic.h" #include "qom/object.h" =20 +/* Old World IRQs */ +#define OLDWORLD_CUDA_IRQ 0x12 +#define OLDWORLD_ESCCB_IRQ 0x10 +#define OLDWORLD_ESCCA_IRQ 0xf +#define OLDWORLD_IDE0_IRQ 0xd +#define OLDWORLD_IDE0_DMA_IRQ 0x2 +#define OLDWORLD_IDE1_IRQ 0xe +#define OLDWORLD_IDE1_DMA_IRQ 0x3 + +/* New World IRQs */ +#define NEWWORLD_CUDA_IRQ 0x19 +#define NEWWORLD_PMU_IRQ 0x19 +#define NEWWORLD_ESCCB_IRQ 0x24 +#define NEWWORLD_ESCCA_IRQ 0x25 +#define NEWWORLD_IDE0_IRQ 0xd +#define NEWWORLD_IDE0_DMA_IRQ 0x2 +#define NEWWORLD_IDE1_IRQ 0xe +#define NEWWORLD_IDE1_DMA_IRQ 0x3 +#define NEWWORLD_EXTING_GPIO1 0x2f +#define NEWWORLD_EXTING_GPIO9 0x37 + /* MacIO virtual bus */ #define TYPE_MACIO_BUS "macio-bus" OBJECT_DECLARE_SIMPLE_TYPE(MacIOBusState, MACIO_BUS) --=20 2.30.2 From nobody Mon Feb 9 19:10:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667247463652805.9456895386121; Mon, 31 Oct 2022 13:17:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbCD-0007sz-6P; Mon, 31 Oct 2022 16:15:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbCB-0007qQ-7M; Mon, 31 Oct 2022 16:15:43 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbC9-0001A9-9W; Mon, 31 Oct 2022 16:15:42 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbC0-0003Dd-4z; Mon, 31 Oct 2022 20:15:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RxsDWQAdJStnEC8K4Ef2GQKl+HhuRZ0ZJ+Jb5gKchas=; b=1DlRB4h6tk2vG3cVe7nfRy7t9/ X6L7KpnjawdxN91hYuyvBRdK20sttKatef4mrBPNoYB/J564s/T4XlFXnD2APvu+ozE9SQMvwkAbz XZrJIIIv90TftE5Hh7dOr3fvzt05zT44+cpnLH3T2lxNyJh9b2/ZWt3GS214apH3bOu2g2iNkZHo5 JzWiWYpbAHbedb04yHBvs+Hf3D9i1+wajW5sRzoQBrIguaDdMfPQ/ElrtS+oozQoYHoR2QU/8awLJ k154ZiDdYedRd4fWkehhBEzwwZMQQ7KGlBWFlyC19Od53yt+mE51qCHRFQhXhQGWBZexTZv6257+J TkV7UXxOEa+8Odbpk2X1WzwoKaKMm3mNy8scpT+fEk48NZuxXgRPMZAZbxkGy2ul67i0hR9J++FVG VFgsOt3sILVNXW8tlYnI1k1eSSfstjLUBwlw8Cm72nAz6LaovPScqICBA7E4a5vyQBJqwX5tT//kO G9f88YpMaNZ339GSFix+gc8AnFm5HuiXKxXRTjUwafjWZdRBW0x3TtEfZHoGGqouEDHkV7kghWLk3 Km6A8aGqSgLP5IzGK9al53vUA3vJM9I5wWxIVxyGykgU1nNHHzcDGFih06D6Zh/qwjVBhyhJAQa3j UJLEbvabTrvg6iqgC6GMt8G8mld9sZDAZRG4IGUE0=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:30 +0000 Message-Id: <20221031201435.677168-10-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 09/14] hw/ppc/mac.h: Move grackle-pcihost type declaration out to a header X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247465683100003 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Message-Id: Signed-off-by: Mark Cave-Ayland --- MAINTAINERS | 1 + hw/pci-host/grackle.c | 14 +---------- hw/ppc/mac.h | 3 --- hw/ppc/mac_oldworld.c | 1 + include/hw/pci-host/grackle.h | 44 +++++++++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+), 16 deletions(-) create mode 100644 include/hw/pci-host/grackle.h diff --git a/MAINTAINERS b/MAINTAINERS index c41d8d65e2..9f424bceb1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1344,6 +1344,7 @@ F: hw/intc/heathrow_pic.c F: hw/input/adb* F: include/hw/intc/heathrow_pic.h F: include/hw/input/adb* +F: include/hw/pci-host/grackle.h F: pc-bios/qemu_vga.ndrv =20 PReP diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index b05facf463..e4c7303859 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -24,7 +24,6 @@ */ =20 #include "qemu/osdep.h" -#include "hw/pci/pci_host.h" #include "hw/ppc/mac.h" #include "hw/qdev-properties.h" #include "hw/pci/pci.h" @@ -33,18 +32,7 @@ #include "qemu/module.h" #include "trace.h" #include "qom/object.h" - -OBJECT_DECLARE_SIMPLE_TYPE(GrackleState, GRACKLE_PCI_HOST_BRIDGE) - -struct GrackleState { - PCIHostState parent_obj; - - uint32_t ofw_addr; - qemu_irq irqs[4]; - MemoryRegion pci_mmio; - MemoryRegion pci_hole; - MemoryRegion pci_io; -}; +#include "hw/pci-host/grackle.h" =20 /* Don't know if this matches real hardware, but it agrees with OHW. */ static int pci_grackle_map_irq(PCIDevice *pci_dev, int irq_num) diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index 55cb02c990..fe77a6c6db 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -35,9 +35,6 @@ #define KERNEL_LOAD_ADDR 0x01000000 #define KERNEL_GAP 0x00100000 =20 -/* Grackle PCI */ -#define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost" - /* Mac NVRAM */ #define TYPE_MACIO_NVRAM "macio-nvram" OBJECT_DECLARE_SIMPLE_TYPE(MacIONVRAMState, MACIO_NVRAM) diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index f323a49d7a..47a1abf248 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -38,6 +38,7 @@ #include "hw/isa/isa.h" #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" +#include "hw/pci-host/grackle.h" #include "hw/nvram/fw_cfg.h" #include "hw/char/escc.h" #include "hw/misc/macio/macio.h" diff --git a/include/hw/pci-host/grackle.h b/include/hw/pci-host/grackle.h new file mode 100644 index 0000000000..7ad3a779f0 --- /dev/null +++ b/include/hw/pci-host/grackle.h @@ -0,0 +1,44 @@ +/* + * QEMU Grackle PCI host (heathrow OldWorld PowerMac) + * + * Copyright (c) 2006-2007 Fabrice Bellard + * Copyright (c) 2007 Jocelyn Mayer + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#ifndef GRACKLE_H +#define GRACKLE_H + +#include "hw/pci/pci_host.h" + +#define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost" +OBJECT_DECLARE_SIMPLE_TYPE(GrackleState, GRACKLE_PCI_HOST_BRIDGE) + +struct GrackleState { + PCIHostState parent_obj; + + uint32_t ofw_addr; + qemu_irq irqs[4]; + MemoryRegion pci_mmio; + MemoryRegion pci_hole; + MemoryRegion pci_io; +}; + +#endif --=20 2.30.2 From nobody Mon Feb 9 19:10:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667247533736546.0937802269368; Mon, 31 Oct 2022 13:18:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbCI-0007yV-23; Mon, 31 Oct 2022 16:15:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbCF-0007u3-14; Mon, 31 Oct 2022 16:15:48 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbCD-0001Bm-GI; Mon, 31 Oct 2022 16:15:46 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbC4-0003Dd-Ay; Mon, 31 Oct 2022 20:15:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=zLFSj1SiBfpXp2BAt8zDnh97wrdCPVXno/jH9FcZqso=; b=l2gwMwDdYLPLTpNdS3g64w45pY toRipf9YiMzHSuynnovWnsDJkpz5MJwq5FGpLzsVLyMg77DY2W2MBX9p8Hd1LB+R8la2cKs7DB/Uf UaBGp5m77pzdTfW4TzrDQ0p6lnhT7ioMeTRQdN1D81j2xHSL7Vg3nyF950O9bTYd9C3ZUzI+6n+G0 iprNsSOPDqcYtrt6+KJ/UtrLnZ0HwhMr4bDwhvJfpPfSPawZuiPg8hUs3CKsyNyxvU51le70TE7BI FDcXEtUbj1iJ5/lBUo5bU0c0WcvsQ9+GeKE38nGruNjn81iDHsT645o/UfFuEQZMNSIad1CRqz4QI iueqY2fBSy85vjimV9cxo3EyTXgN1s3oJvQtwYfVcPlr71id9SyoeZ30ogj5XglKtTfd9vI/VGlGx 9ljh25Ukiqlz//gIfTb1IbOk3j0K4Hs4Hwpgqd41rXJBbNOIq1iJ0nDCdW53IhTXbRX56fKRk7dFh xPS7vBYUnZtyBs8Cz2UfIyVFqeJpW1lr3exUe8gcbmtvMJgh9z5EsgJmvqFa0F8eU7NdlVdW/uWf3 tGuwiYvpfpxTUfJVVc8dYs7MaXqAoVsRdEWQrclzOKshR46IKKDkZn5p5y8cj/FSg7xUxEsQZXHLv EXA2ftdjWJB/1fgV3o0rhJQpCan1WIcSjrOwrzUqw=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:31 +0000 Message-Id: <20221031201435.677168-11-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 10/14] hw/ppc/mac.h: Move PROM and KERNEL defines to board code X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247534034100001 From: BALATON Zoltan The PROM_FILENAME and KERNEL_* defines are used by mac_oldworld and mac_newworld but they don't have to be identical so these could be moved to the individual boards. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Message-Id: <5fa693334adf166d23931c81d81ada4e3441ed7d.1666957578.git.balato= n@eik.bme.hu> Signed-off-by: Mark Cave-Ayland --- hw/ppc/mac.h | 4 ---- hw/ppc/mac_newworld.c | 4 ++++ hw/ppc/mac_oldworld.c | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index fe77a6c6db..3e2df262ee 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -30,10 +30,6 @@ #include "hw/sysbus.h" =20 #define NVRAM_SIZE 0x2000 -#define PROM_FILENAME "openbios-ppc" - -#define KERNEL_LOAD_ADDR 0x01000000 -#define KERNEL_GAP 0x00100000 =20 /* Mac NVRAM */ #define TYPE_MACIO_NVRAM "macio-nvram" diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 873c9f5cb4..c75c59fe3e 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -83,9 +83,13 @@ =20 #define NDRV_VGA_FILENAME "qemu_vga.ndrv" =20 +#define PROM_FILENAME "openbios-ppc" #define PROM_BASE 0xfff00000 #define PROM_SIZE (1 * MiB) =20 +#define KERNEL_LOAD_ADDR 0x01000000 +#define KERNEL_GAP 0x00100000 + #define TYPE_CORE99_MACHINE MACHINE_TYPE_NAME("mac99") typedef struct Core99MachineState Core99MachineState; DECLARE_INSTANCE_CHECKER(Core99MachineState, CORE99_MACHINE, diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 47a1abf248..ae8e0ff30a 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -58,10 +58,15 @@ =20 #define NDRV_VGA_FILENAME "qemu_vga.ndrv" =20 -#define GRACKLE_BASE 0xfec00000 +#define PROM_FILENAME "openbios-ppc" #define PROM_BASE 0xffc00000 #define PROM_SIZE (4 * MiB) =20 +#define KERNEL_LOAD_ADDR 0x01000000 +#define KERNEL_GAP 0x00100000 + +#define GRACKLE_BASE 0xfec00000 + static void fw_cfg_boot_set(void *opaque, const char *boot_device, Error **errp) { --=20 2.30.2 From nobody Mon Feb 9 19:10:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667247465884662.7452576917889; Mon, 31 Oct 2022 13:17:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbCf-0008Ka-2L; Mon, 31 Oct 2022 16:16:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbCJ-00080A-JJ; Mon, 31 Oct 2022 16:16:05 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbCH-0001CR-5P; Mon, 31 Oct 2022 16:15:51 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbC8-0003Dd-H0; Mon, 31 Oct 2022 20:15:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Q7UkqegOB8CHBfu3yfJiKQqOB3ZnHGphy6lCk4S2S+Y=; b=Q/iq/QvZyOuirlvC/wllthQxIy ADZmb2b9QnKuZhHWv2pJcGPTIbtCF3orK6AyJN8ib7qRg0WA9SehdXZG7FHik1aKtcEFPp2d6KIiO nIR7+3npVk0ElZmFOQwLMjsvCfc97+up71iPKmIJyQpOQZEYc4RGXAiy4GRrpGMx53983OuLkqeZH QIwOnRc7pwIxDBD13QTXY1gyDi/L3xCazQBVEJ+Tbtwlwv9kqtwPJfShEV4SMinB7vpr94UY7WfkQ Ba4AJsudUXp1OnTru9O58F5XResryJGHbyGWAMfiViYG9NSXWgLF5wScqt8utN5I/2QO+JIzQtDSC tI3Iux5twphQHQ0Czgze/l1LFM1CBID3XTtptR/XbIb169MIfZ82LnJX5L6gYoA4A26wi5oiIHd8l YFe0Ls/AtT+LnN6PMGWNtXdePmSZy3MuveJi8ScbTrBti/TwpgFXSj8+32I5WokmB/+LLT+yukwNc gES/FHIjdrHBtGKot7Y3oDfEdAJL/SwRbQzYlJgHC5uYo2ErlIxLBY+CBO3h9K38hEHs2kmqny5bT yNhqPY/ff+Njkx2GEJHCkFDpwY0LLA6TmnADe8Qv8k6K2Tid8esmI2gXHtjE+EQm+A2ZGQA/VcxJ+ 7pHPinPxzvcJ4uSGmfj37MzP48+wo2T27B7M82H8U=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:32 +0000 Message-Id: <20221031201435.677168-12-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 11/14] hw/ppc/mac.h: Rename to include/hw/nvram/mac_nvram.h X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247467716100007 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan All that is left in mac.h now belongs to the nvram emulation so rename it accordingly and only include it where it is really used. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Message-Id: Signed-off-by: Mark Cave-Ayland --- MAINTAINERS | 1 + hw/ide/macio.c | 1 - hw/intc/heathrow_pic.c | 1 - hw/intc/openpic.c | 1 - hw/misc/macio/cuda.c | 1 - hw/misc/macio/gpio.c | 1 - hw/misc/macio/macio.c | 1 - hw/misc/macio/pmu.c | 1 - hw/nvram/mac_nvram.c | 2 +- hw/pci-host/grackle.c | 1 - hw/pci-host/uninorth.c | 1 - hw/ppc/mac_newworld.c | 2 +- hw/ppc/mac_oldworld.c | 1 - include/hw/misc/macio/macio.h | 2 +- hw/ppc/mac.h =3D> include/hw/nvram/mac_nvram.h | 11 ++++++----- 15 files changed, 10 insertions(+), 18 deletions(-) rename hw/ppc/mac.h =3D> include/hw/nvram/mac_nvram.h (89%) diff --git a/MAINTAINERS b/MAINTAINERS index 9f424bceb1..223afc2e13 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1327,6 +1327,7 @@ F: hw/nvram/mac_nvram.c F: hw/input/adb* F: include/hw/misc/macio/ F: include/hw/misc/mos6522.h +F: include/hw/nvram/mac_nvram.h F: include/hw/ppc/mac_dbdma.h F: include/hw/pci-host/uninorth.h F: include/hw/input/adb* diff --git a/hw/ide/macio.c b/hw/ide/macio.c index 1c15c37ec5..e604466acb 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -24,7 +24,6 @@ */ =20 #include "qemu/osdep.h" -#include "hw/ppc/mac.h" #include "hw/ppc/mac_dbdma.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" diff --git a/hw/intc/heathrow_pic.c b/hw/intc/heathrow_pic.c index cb97c315da..13048a2735 100644 --- a/hw/intc/heathrow_pic.c +++ b/hw/intc/heathrow_pic.c @@ -24,7 +24,6 @@ */ =20 #include "qemu/osdep.h" -#include "hw/ppc/mac.h" #include "migration/vmstate.h" #include "qemu/module.h" #include "hw/intc/heathrow_pic.h" diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c index b0787e8ee7..c757adbe53 100644 --- a/hw/intc/openpic.c +++ b/hw/intc/openpic.c @@ -32,7 +32,6 @@ =20 #include "qemu/osdep.h" #include "hw/irq.h" -#include "hw/ppc/mac.h" #include "hw/pci/pci.h" #include "hw/ppc/openpic.h" #include "hw/ppc/ppc_e500.h" diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index 1498113cfc..0d4c13319a 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -25,7 +25,6 @@ =20 #include "qemu/osdep.h" #include "hw/irq.h" -#include "hw/ppc/mac.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "hw/input/adb.h" diff --git a/hw/misc/macio/gpio.c b/hw/misc/macio/gpio.c index b1bcf830c3..c8ac5633b2 100644 --- a/hw/misc/macio/gpio.c +++ b/hw/misc/macio/gpio.c @@ -24,7 +24,6 @@ */ =20 #include "qemu/osdep.h" -#include "hw/ppc/mac.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "hw/misc/macio/macio.h" diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index f9f0758b03..93a7c7bbc8 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -26,7 +26,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/module.h" -#include "hw/ppc/mac.h" #include "hw/misc/macio/cuda.h" #include "hw/pci/pci.h" #include "hw/ppc/mac_dbdma.h" diff --git a/hw/misc/macio/pmu.c b/hw/misc/macio/pmu.c index 336502a84b..70562ed8d0 100644 --- a/hw/misc/macio/pmu.c +++ b/hw/misc/macio/pmu.c @@ -29,7 +29,6 @@ */ =20 #include "qemu/osdep.h" -#include "hw/ppc/mac.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "hw/input/adb.h" diff --git a/hw/nvram/mac_nvram.c b/hw/nvram/mac_nvram.c index 11f2d31cdb..3d9ddda217 100644 --- a/hw/nvram/mac_nvram.c +++ b/hw/nvram/mac_nvram.c @@ -25,7 +25,7 @@ =20 #include "qemu/osdep.h" #include "hw/nvram/chrp_nvram.h" -#include "hw/ppc/mac.h" +#include "hw/nvram/mac_nvram.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qemu/cutils.h" diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index e4c7303859..95945ac0f4 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -24,7 +24,6 @@ */ =20 #include "qemu/osdep.h" -#include "hw/ppc/mac.h" #include "hw/qdev-properties.h" #include "hw/pci/pci.h" #include "hw/irq.h" diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index d25b62d6a5..aebd44d265 100644 --- a/hw/pci-host/uninorth.c +++ b/hw/pci-host/uninorth.c @@ -24,7 +24,6 @@ =20 #include "qemu/osdep.h" #include "hw/irq.h" -#include "hw/ppc/mac.h" #include "hw/qdev-properties.h" #include "qemu/module.h" #include "hw/pci/pci.h" diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index c75c59fe3e..eb597bbe20 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -52,7 +52,7 @@ #include "qapi/error.h" #include "hw/ppc/ppc.h" #include "hw/qdev-properties.h" -#include "hw/ppc/mac.h" +#include "hw/nvram/mac_nvram.h" #include "hw/boards.h" #include "hw/pci-host/uninorth.h" #include "hw/input/adb.h" diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index ae8e0ff30a..23d9268281 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -30,7 +30,6 @@ #include "qapi/error.h" #include "hw/ppc/ppc.h" #include "hw/qdev-properties.h" -#include "mac.h" #include "hw/boards.h" #include "hw/input/adb.h" #include "sysemu/sysemu.h" diff --git a/include/hw/misc/macio/macio.h b/include/hw/misc/macio/macio.h index 26cf15b1ce..95d30a1745 100644 --- a/include/hw/misc/macio/macio.h +++ b/include/hw/misc/macio/macio.h @@ -33,7 +33,7 @@ #include "hw/misc/macio/cuda.h" #include "hw/misc/macio/gpio.h" #include "hw/misc/macio/pmu.h" -#include "hw/ppc/mac.h" +#include "hw/nvram/mac_nvram.h" #include "hw/ppc/mac_dbdma.h" #include "hw/ppc/openpic.h" #include "qom/object.h" diff --git a/hw/ppc/mac.h b/include/hw/nvram/mac_nvram.h similarity index 89% rename from hw/ppc/mac.h rename to include/hw/nvram/mac_nvram.h index 3e2df262ee..baa9f6a5a6 100644 --- a/hw/ppc/mac.h +++ b/include/hw/nvram/mac_nvram.h @@ -1,5 +1,5 @@ /* - * QEMU PowerMac emulation shared definitions and prototypes + * PowerMac NVRAM emulation * * Copyright (c) 2004-2007 Fabrice Bellard * Copyright (c) 2007 Jocelyn Mayer @@ -23,8 +23,8 @@ * THE SOFTWARE. */ =20 -#ifndef PPC_MAC_H -#define PPC_MAC_H +#ifndef MAC_NVRAM_H +#define MAC_NVRAM_H =20 #include "exec/memory.h" #include "hw/sysbus.h" @@ -47,5 +47,6 @@ struct MacIONVRAMState { uint8_t *data; }; =20 -void pmac_format_nvram_partition (MacIONVRAMState *nvr, int len); -#endif /* PPC_MAC_H */ +void pmac_format_nvram_partition(MacIONVRAMState *nvr, int len); + +#endif /* MAC_NVRAM_H */ --=20 2.30.2 From nobody Mon Feb 9 19:10:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667247518550130.3391070235042; Mon, 31 Oct 2022 13:18:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbCZ-00088S-D0; Mon, 31 Oct 2022 16:16:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbCX-000829-DZ; Mon, 31 Oct 2022 16:16:05 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbCR-0001Cw-85; Mon, 31 Oct 2022 16:16:05 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbCC-0003Dd-9P; Mon, 31 Oct 2022 20:15:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HVs15WeIzupcMr7rgMwMEI0bZZSh2MhSc6xOwkoNU1k=; b=Or/5HWLUsPD2FhGhM89+ohw9JD FVVynFsGkXi8O8Kc4h2nz21ttvW0w4tbJnxfbMlPmoD3W1I90P8yNIYnoBxM2g7CgMKXGdRDorFy0 Y1NAkr7e0H+Q18h57Og4w+MVkpXhvz224uqnVhyXElFnogxZC1qFRNUuhI/WE7q+ytkV9dA/to02y /3GEUP+t7Imey8Tar/rYu3eLoekTd8SdJoPvP5WFHw7+GYz80ovTWSHxhhmWXRemZOiH3GN/humlx D84Y1pe6t37nmJbmVbtG2E7jxJvYClosX+f4Rg9l1/HddukWJOLbng1jkhZyfOLGH0wRgneBsLV1g YVw2x5xflsT6XlawdzUDi7cGZ/qSUdDo7cVRu7FrEcvBkpBKJVZFcB+Xm3kniGyg61G3/4oyDp2g3 KBxIiARA12BGy0HjqFit7nEoYjXtELcHC1DyUOpGlF25ZUN+1WDjvZy0kW0iyHcHIy9ukl/rEyEuG rdP/cT9tx23yMnOFLG6vpYrdD0Bwzqk9Ae3dSQgJN9uGEXQdaJSeYyUdPdCxY+2l/0Pm0aM8E/8Cs tEa8nDktEudEvKJx90zbP7utcWC0Ns/bxh75BvB2Myn+VoeFfhO2CH+rlhJCIN+xZGuM26eBRY03v zrv2OVeqvYaRF2nBaMFmCpEoIki2nBh+67cgCl804=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:33 +0000 Message-Id: <20221031201435.677168-13-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 12/14] mac_nvram: Use NVRAM_SIZE constant X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247519945100007 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan The NVRAM_SIZE constant was defined but not used. Rename it to MACIO_NVRAM_SIZE to match the device model and use it where appropriate. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Message-Id: <5b53c70438dfb46837af8a094e753706b06c4ec6.1666957578.git.balato= n@eik.bme.hu> Signed-off-by: Mark Cave-Ayland --- hw/misc/macio/macio.c | 2 +- hw/ppc/mac_newworld.c | 4 ++-- include/hw/nvram/mac_nvram.h | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index 93a7c7bbc8..08dbdd7fc0 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -226,7 +226,7 @@ static void macio_oldworld_init(Object *obj) =20 object_initialize_child(OBJECT(s), "nvram", &os->nvram, TYPE_MACIO_NVR= AM); dev =3D DEVICE(&os->nvram); - qdev_prop_set_uint32(dev, "size", 0x2000); + qdev_prop_set_uint32(dev, "size", MACIO_NVRAM_SIZE); qdev_prop_set_uint32(dev, "it_shift", 4); =20 for (i =3D 0; i < 2; i++) { diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index eb597bbe20..6b2d781dea 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -450,12 +450,12 @@ static void ppc_core99_init(MachineState *machine) nvram_addr =3D 0xFFE00000; } dev =3D qdev_new(TYPE_MACIO_NVRAM); - qdev_prop_set_uint32(dev, "size", 0x2000); + qdev_prop_set_uint32(dev, "size", MACIO_NVRAM_SIZE); qdev_prop_set_uint32(dev, "it_shift", 1); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, nvram_addr); nvr =3D MACIO_NVRAM(dev); - pmac_format_nvram_partition(nvr, 0x2000); + pmac_format_nvram_partition(nvr, MACIO_NVRAM_SIZE); /* No PCI init: the BIOS will do it */ =20 dev =3D qdev_new(TYPE_FW_CFG_MEM); diff --git a/include/hw/nvram/mac_nvram.h b/include/hw/nvram/mac_nvram.h index baa9f6a5a6..b780aca470 100644 --- a/include/hw/nvram/mac_nvram.h +++ b/include/hw/nvram/mac_nvram.h @@ -29,9 +29,8 @@ #include "exec/memory.h" #include "hw/sysbus.h" =20 -#define NVRAM_SIZE 0x2000 +#define MACIO_NVRAM_SIZE 0x2000 =20 -/* Mac NVRAM */ #define TYPE_MACIO_NVRAM "macio-nvram" OBJECT_DECLARE_SIMPLE_TYPE(MacIONVRAMState, MACIO_NVRAM) =20 --=20 2.30.2 From nobody Mon Feb 9 19:10:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 166724745812252.445026669311915; Mon, 31 Oct 2022 13:17:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbCi-0000A5-VY; Mon, 31 Oct 2022 16:16:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbCb-0008CZ-Q0; Mon, 31 Oct 2022 16:16:10 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbCT-0001FB-6V; Mon, 31 Oct 2022 16:16:09 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbCG-0003Dd-0T; Mon, 31 Oct 2022 20:15:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Dgtd0UJc8G+xqf3SCtNhRPavB+1WEQc3RMKfTkB/2hk=; b=WhDnuWqPT/Jw2e85K2M2MLMRDk hjXWplKoFu5rRyaTWdk13AwrOrCjhslgvT2qnfrbSnqDSd4eEX6BkXSzZJMvrr6r13kSeLT3PfgfG SE0b9sYLRPjNGzwfu6rFORffcd6dwP8oy7meBtjCjDnS+NhQJcBHaKDDAQ+T2hH1W7CAQzGqQOhFX +uKxQ4Lqw7TPhp4LczhVQn8BXkkG2bCg8/BijengzwCGcCIQb8EofoD26JwAGOo+zCa/jYNT3e78p Dq2mYBB4k8uOZJeNILzjDNoJag3WnYDXcU8X6a5bY1C473WNy5AA7FPTPjnuD7/xF8XQNQAcD5Np0 janj1LWwh+uCEC0TnZE2EKQCA85tM1b7f9FeKXv1itRkSpZjjsjRPRq5/B9l9eaS6WcGn/c10oXoq prKctrIJp5cigZFXodUHOKz2MJG0mM9htwmcRXoXVQvdu4W+sZZdnkBhnru1elDu6tfJ/4ky52qkL 7siCVprQFBEWSXLRfbB3JVuYNHpUQs82Hch7V9BTnO0TOe2QULdRHmwxf0x30Cri0cF1LOke3liK9 V/00lgDB/dZRMQgtuUfo89Eioh566pyB8DHgpIAW8aJ2FdSuw5WRR7VCyTnPLyIfosIYARouszEqc Zr7i9atgFedZ303/gEZLsixKWqyKc4UspLYXXgMVA=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:34 +0000 Message-Id: <20221031201435.677168-14-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 13/14] mac_{old|new}world: Code style fix adding missing braces to if-s X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247459656100007 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Message-Id: Signed-off-by: Mark Cave-Ayland --- hw/ppc/mac_newworld.c | 6 ++++-- hw/ppc/mac_oldworld.c | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 6b2d781dea..37123daa6b 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -202,14 +202,16 @@ static void ppc_core99_init(MachineState *machine) kernel_size =3D load_elf(machine->kernel_filename, NULL, translate_kernel_address, NULL, NULL, NULL, NULL, NULL, 1, PPC_ELF_MACHINE, 0, 0); - if (kernel_size < 0) + if (kernel_size < 0) { kernel_size =3D load_aout(machine->kernel_filename, kernel_bas= e, machine->ram_size - kernel_base, bswap_needed, TARGET_PAGE_SIZE); - if (kernel_size < 0) + } + if (kernel_size < 0) { kernel_size =3D load_image_targphys(machine->kernel_filename, kernel_base, machine->ram_size - kernel_b= ase); + } if (kernel_size < 0) { error_report("could not load kernel '%s'", machine->kernel_filename); diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 23d9268281..558c639202 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -160,14 +160,16 @@ static void ppc_heathrow_init(MachineState *machine) kernel_size =3D load_elf(machine->kernel_filename, NULL, translate_kernel_address, NULL, NULL, NULL, NULL, NULL, 1, PPC_ELF_MACHINE, 0, 0); - if (kernel_size < 0) + if (kernel_size < 0) { kernel_size =3D load_aout(machine->kernel_filename, kernel_bas= e, machine->ram_size - kernel_base, bswap_needed, TARGET_PAGE_SIZE); - if (kernel_size < 0) + } + if (kernel_size < 0) { kernel_size =3D load_image_targphys(machine->kernel_filename, kernel_base, machine->ram_size - kernel_b= ase); + } if (kernel_size < 0) { error_report("could not load kernel '%s'", machine->kernel_filename); @@ -291,8 +293,9 @@ static void ppc_heathrow_init(MachineState *machine) pci_create_simple(pci_bus, -1, "pci-ohci"); } =20 - if (graphic_depth !=3D 15 && graphic_depth !=3D 32 && graphic_depth != =3D 8) + if (graphic_depth !=3D 15 && graphic_depth !=3D 32 && graphic_depth != =3D 8) { graphic_depth =3D 15; + } =20 /* No PCI init: the BIOS will do it */ =20 --=20 2.30.2 From nobody Mon Feb 9 19:10:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667247400729270.06860341844276; Mon, 31 Oct 2022 13:16:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbCc-0008FP-O0; Mon, 31 Oct 2022 16:16:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbCY-00087a-PD; Mon, 31 Oct 2022 16:16:06 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opbCV-0001Hu-Eg; Mon, 31 Oct 2022 16:16:06 -0400 Received: from [2a00:23c4:8ba8:7100:6571:576d:97b8:647b] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opbCJ-0003Dd-OH; Mon, 31 Oct 2022 20:15:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CHlKI6NyvjoZek9p3zLZkb0QvqJYPf7CWU05w1ygMFI=; b=eCkYYPbjRlrhn23BMfDCbG0TWk aE4HAC7LKt/b6qi5G9J6zkhPsPumRxDoJItM9a2xGu8VNNcTjJaqXHGNxBohAjSnsQcu+u9AFPtqn IoMAZNvZQ53uFQ8d08X1dr6xO04QBA5KbKfitHefg2/RMC0jExO5BcX/wpKxi7IcnkhtjW+E9Mx7t q+IOg7O7uqkrIrUBBTa4Nc4C8dVXYDX+13Hyf4CqIITKZwjIlz+eyo1shd0j0g2z7Yz5wAQFWzSf3 lIxk53lkBu2bD8aXUsDn1y1MZqlgUbdXWTr+8G3aKDkEReTCueUeWAX8yQmsDb/CQdvbykagYXWe3 ziyt6hOM77rGyF8DHZtEn0Z17g6srrtxSs3ov3ra5u9FQiECuDZzG+Xbz1/snLgLaAJTtGBFbKhYL +idqpvUstpBtT91/0hLQRAUJUT1HCS2reUc7IG9Zkt/B+rNnvXyxU3g3RSdhzodJfGDCm4OB9nlia XhxUUMg4zSFJ5NNCjCOiJVwDpacgzzzyixzbnesp6rEPqypE/8Qehm64gBgyFdkFavLyHCcTYT0d4 YoeKyl38dTNABBqq1g+R81L0CcfGlkHvMPLihKlsy0yao/kuo2RA+pG+d+gynPA2AoKK114hVaq4v JrbTq/4OLTjbD7lNPkFrtI886XLx5e+BC22OyuvgI=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, stefanha@redhat.com Date: Mon, 31 Oct 2022 20:14:35 +0000 Message-Id: <20221031201435.677168-15-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> References: <20221031201435.677168-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba8:7100:6571:576d:97b8:647b X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 14/14] mac_newworld: Turn CORE99_VIA_CONFIG defines into an enum X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1667247401406100001 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan This might allow the compiler to check values. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Message-Id: Signed-off-by: Mark Cave-Ayland --- hw/ppc/mac_newworld.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 37123daa6b..601ea518f8 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -95,15 +95,17 @@ typedef struct Core99MachineState Core99MachineState; DECLARE_INSTANCE_CHECKER(Core99MachineState, CORE99_MACHINE, TYPE_CORE99_MACHINE) =20 -#define CORE99_VIA_CONFIG_CUDA 0x0 -#define CORE99_VIA_CONFIG_PMU 0x1 -#define CORE99_VIA_CONFIG_PMU_ADB 0x2 +typedef enum { + CORE99_VIA_CONFIG_CUDA =3D 0, + CORE99_VIA_CONFIG_PMU, + CORE99_VIA_CONFIG_PMU_ADB +} Core99ViaConfig; =20 struct Core99MachineState { /*< private >*/ MachineState parent; =20 - uint8_t via_config; + Core99ViaConfig via_config; }; =20 static void fw_cfg_boot_set(void *opaque, const char *boot_device, --=20 2.30.2