From nobody Sun Nov 9 17:50:07 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551803493250103.48198988811612; Tue, 5 Mar 2019 08:31:33 -0800 (PST) Received: from localhost ([127.0.0.1]:45428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1CyX-0008UZ-2t for importer@patchew.org; Tue, 05 Mar 2019 11:31:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1Cvx-0006UJ-35 for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:28:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1Cvw-0002Lf-7v for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:28:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35110) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1Cvw-0002Kx-0V for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:28:48 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A235BDFF; Tue, 5 Mar 2019 16:28:47 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-67.brq.redhat.com [10.40.204.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0C246013F; Tue, 5 Mar 2019 16:28:40 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Date: Tue, 5 Mar 2019 17:28:25 +0100 Message-Id: <20190305162829.20079-2-philmd@redhat.com> In-Reply-To: <20190305162829.20079-1-philmd@redhat.com> References: <20190305162829.20079-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 05 Mar 2019 16:28:47 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/5] hw/mips/malta: Fix the DEBUG_BOARD_INIT code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Commit fa1d36df746 missed to convert this ifdef'ed out code. Introduce the pflash_blk variable. This fixes: hw/mips/mips_malta.c:1273:16: error: implicit declaration of function =E2= =80=98blk_name=E2=80=99; did you mean =E2=80=98basename=E2=80=99? [-Werror= =3Dimplicit-function-declaration] blk_name(dinfo->bdrv), fl_sectors); ^~~~~~~~ hw/mips/mips_malta.c:1273:16: error: nested extern declaration of =E2=80= =98blk_name=E2=80=99 [-Werror=3Dnested-externs] hw/mips/mips_malta.c:1273:30: error: =E2=80=98DriveInfo=E2=80=99 {aka =E2= =80=98struct DriveInfo=E2=80=99} has no member named =E2=80=98bdrv=E2=80=99 blk_name(dinfo->bdrv), fl_sectors); ^~ Fixes: fa1d36df746 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Aleksandar Markovic Reviewed-by: Richard Henderson --- hw/mips/mips_malta.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 2827074e9b..b4cd8f02ad 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -40,6 +40,7 @@ #include "hw/pci/pci.h" #include "sysemu/sysemu.h" #include "sysemu/arch_init.h" +#include "sysemu/block-backend.h" #include "qemu/log.h" #include "hw/mips/bios.h" #include "hw/ide.h" @@ -1205,6 +1206,7 @@ void mips_malta_init(MachineState *machine) qemu_irq cbus_irq, i8259_irq; int piix4_devfn; I2CBus *smbus; + BlockBackend *pflash_blk =3D NULL; DriveInfo *dinfo; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; int fl_idx =3D 0; @@ -1265,17 +1267,18 @@ void mips_malta_init(MachineState *machine) =20 /* Load firmware in flash / BIOS. */ dinfo =3D drive_get(IF_PFLASH, 0, fl_idx); -#ifdef DEBUG_BOARD_INIT if (dinfo) { + pflash_blk =3D blk_by_legacy_dinfo(dinfo); +#ifdef DEBUG_BOARD_INIT printf("Register parallel flash %d size " TARGET_FMT_lx " at " - "addr %08llx '%s' %x\n", - fl_idx, bios_size, FLASH_ADDRESS, - blk_name(dinfo->bdrv), fl_sectors); - } + "addr %08llx '%s'\n", + fl_idx, blk_getlength(pflash_blk), FLASH_ADDRESS, + blk_name(pflash_blk)); #endif + } fl =3D pflash_cfi01_register(FLASH_ADDRESS, NULL, "mips_malta.bios", BIOS_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + pflash_blk, 65536, fl_sectors, 4, 0x0000, 0x0000, 0x0000, 0x0000, be); bios =3D pflash_cfi01_get_memory(fl); --=20 2.20.1 From nobody Sun Nov 9 17:50:07 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551803564503198.6780525297154; Tue, 5 Mar 2019 08:32:44 -0800 (PST) Received: from localhost ([127.0.0.1]:45436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1Cze-0000w7-Gx for importer@patchew.org; Tue, 05 Mar 2019 11:32:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1Cw4-0006YW-9w for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:28:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1Cw3-0002Xm-Km for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:28:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55904) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1Cw3-0002X1-EJ for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:28:55 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 988B5307E05B; Tue, 5 Mar 2019 16:28:54 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-67.brq.redhat.com [10.40.204.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 04EB96013F; Tue, 5 Mar 2019 16:28:47 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Date: Tue, 5 Mar 2019 17:28:26 +0100 Message-Id: <20190305162829.20079-3-philmd@redhat.com> In-Reply-To: <20190305162829.20079-1-philmd@redhat.com> References: <20190305162829.20079-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 05 Mar 2019 16:28:54 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/5] hw/mips/malta: Remove fl_sectors variable (used one single time) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" fl_sectors is only used in one place, with bios_size =3D FLASH_SIZE. Use it directly and remove the variable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/mips/mips_malta.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index b4cd8f02ad..00e5aac98b 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1210,7 +1210,6 @@ void mips_malta_init(MachineState *machine) DriveInfo *dinfo; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; int fl_idx =3D 0; - int fl_sectors =3D bios_size >> 16; int be; =20 DeviceState *dev =3D qdev_create(NULL, TYPE_MIPS_MALTA); @@ -1279,7 +1278,7 @@ void mips_malta_init(MachineState *machine) fl =3D pflash_cfi01_register(FLASH_ADDRESS, NULL, "mips_malta.bios", BIOS_SIZE, pflash_blk, - 65536, fl_sectors, + 65536, FLASH_SIZE >> 16, 4, 0x0000, 0x0000, 0x0000, 0x0000, be); bios =3D pflash_cfi01_get_memory(fl); fl_idx++; --=20 2.20.1 From nobody Sun Nov 9 17:50:07 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551803688036336.1595966617142; Tue, 5 Mar 2019 08:34:48 -0800 (PST) Received: from localhost ([127.0.0.1]:45461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1D1g-0002JW-2V for importer@patchew.org; Tue, 05 Mar 2019 11:34:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1CwE-0006jH-8a for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:29:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1CwD-0002hD-IM for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:29:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57814) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1CwD-0002gW-Ao for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:29:05 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7AD4659471; Tue, 5 Mar 2019 16:29:04 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-67.brq.redhat.com [10.40.204.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 608EC6013F; Tue, 5 Mar 2019 16:28:55 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Date: Tue, 5 Mar 2019 17:28:27 +0100 Message-Id: <20190305162829.20079-4-philmd@redhat.com> In-Reply-To: <20190305162829.20079-1-philmd@redhat.com> References: <20190305162829.20079-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 05 Mar 2019 16:29:04 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/5] hw/mips/malta: Restrict 'bios_size' variable scope X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The 'bios_size' variable is only used in the 'if (!kernel_filename && !dinfo)' clause. This is the case when we don't provide -pflash command line option, and also don't provide a -kernel option. In this case we will check for the -bios option, or use the default BIOS_FILENAME file. The 'bios' term is valid in this if statement, but is confuse in the whole mips_malta_init() scope. Restrict his scope. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/mips/mips_malta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 00e5aac98b..396645b1a9 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1196,7 +1196,6 @@ void mips_malta_init(MachineState *machine) MemoryRegion *ram_low_preio =3D g_new(MemoryRegion, 1); MemoryRegion *ram_low_postio; MemoryRegion *bios, *bios_copy =3D g_new(MemoryRegion, 1); - target_long bios_size =3D FLASH_SIZE; const size_t smbus_eeprom_size =3D 8 * 256; uint8_t *smbus_eeprom_buf =3D g_malloc0(smbus_eeprom_size); int64_t kernel_entry, bootloader_run_addr; @@ -1314,6 +1313,7 @@ void mips_malta_init(MachineState *machine) bootloader_run_addr, kernel_entry); } } else { + target_long bios_size =3D FLASH_SIZE; /* The flash region isn't executable from a KVM guest */ if (kvm_enabled()) { error_report("KVM enabled but no -kernel argument was specifie= d. " --=20 2.20.1 From nobody Sun Nov 9 17:50:07 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551803576122108.85207359793822; Tue, 5 Mar 2019 08:32:56 -0800 (PST) Received: from localhost ([127.0.0.1]:45444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1Czo-00013b-5w for importer@patchew.org; Tue, 05 Mar 2019 11:32:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1CwI-0006nY-LJ for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:29:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1CwH-0002kK-Jv for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:29:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58598) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1CwH-0002jT-Ce for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:29:09 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 868D83078AA7; Tue, 5 Mar 2019 16:29:08 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-67.brq.redhat.com [10.40.204.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 370886013F; Tue, 5 Mar 2019 16:29:04 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Date: Tue, 5 Mar 2019 17:28:28 +0100 Message-Id: <20190305162829.20079-5-philmd@redhat.com> In-Reply-To: <20190305162829.20079-1-philmd@redhat.com> References: <20190305162829.20079-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 05 Mar 2019 16:29:08 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/5] hw/mips/malta: Only accept 'monitor' pflash of 4MiB X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The Malta 'mother' board can use various 'daughter' core cards [1]. QEMU only models the CoreLV card. The CoreLV card provides [2] a Galileo GT64120 as North bridge, connecting the CPU via the 'CBUS'. The CBUS also connects a 'Monitor flash' memory and maps it to the CPU RESET vector. The Monitor flash size is exactly 4 MiB. Refuse Monitor pflash of different size. [1] https://www.linux-mips.org/wiki/MIPS_Malta#Core_cards [2] "Malta User's Manual" rev. 01.05 (MIPS Technologies doc number: MD0004= 8) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/mips/mips_malta.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 396645b1a9..04788ff50a 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1267,6 +1267,11 @@ void mips_malta_init(MachineState *machine) dinfo =3D drive_get(IF_PFLASH, 0, fl_idx); if (dinfo) { pflash_blk =3D blk_by_legacy_dinfo(dinfo); + + if (blk_getlength(pflash_blk) !=3D FLASH_SIZE) { + error_report("Malta CoreLV card expects a bios of 4MB"); + exit(1); + } #ifdef DEBUG_BOARD_INIT printf("Register parallel flash %d size " TARGET_FMT_lx " at " "addr %08llx '%s'\n", --=20 2.20.1 From nobody Sun Nov 9 17:50:07 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551803696033330.4153369647049; Tue, 5 Mar 2019 08:34:56 -0800 (PST) Received: from localhost ([127.0.0.1]:45463 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1D1o-0002P8-JV for importer@patchew.org; Tue, 05 Mar 2019 11:34:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1CwM-0006rd-L3 for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:29:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1CwL-0002pf-Jz for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:29:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52584) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1CwL-0002ou-Bc for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:29:13 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C6BF8764F; Tue, 5 Mar 2019 16:29:12 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-67.brq.redhat.com [10.40.204.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4E7D06013F; Tue, 5 Mar 2019 16:29:08 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Date: Tue, 5 Mar 2019 17:28:29 +0100 Message-Id: <20190305162829.20079-6-philmd@redhat.com> In-Reply-To: <20190305162829.20079-1-philmd@redhat.com> References: <20190305162829.20079-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 05 Mar 2019 16:29:12 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 5/5] mips_malta: Clean up definition of flash memory size somewhat X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Markus Armbruster pflash_cfi01_register() takes a size in bytes, a block size in bytes and a number of blocks. mips_malta_init() passes BIOS_SIZE, 65536, FLASH_SIZE >> 16. Actually consistent only because BIOS_SIZE (defined in include/hw/mips/bios.h as (4 * MiB)) matches FLASH_SIZE (defined locally as 0x400000). Confusing all the same. Pass FLASH_SIZE instead of BIOS_SIZE. Cc: Aurelien Jarno Cc: Aleksandar Rikalo Signed-off-by: Markus Armbruster [PMD: rebased] Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- hw/mips/mips_malta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 04788ff50a..a5726edaa7 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1280,7 +1280,7 @@ void mips_malta_init(MachineState *machine) #endif } fl =3D pflash_cfi01_register(FLASH_ADDRESS, NULL, "mips_malta.bios", - BIOS_SIZE, + FLASH_SIZE, pflash_blk, 65536, FLASH_SIZE >> 16, 4, 0x0000, 0x0000, 0x0000, 0x0000, be); --=20 2.20.1