From nobody Sun Nov 9 16:03:52 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 1551209850839472.1223330099432; Tue, 26 Feb 2019 11:37:30 -0800 (PST) Received: from localhost ([127.0.0.1]:60239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyiXf-00041l-Nq for importer@patchew.org; Tue, 26 Feb 2019 14:37:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyiV0-0002IV-EJ for qemu-devel@nongnu.org; Tue, 26 Feb 2019 14:34:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyiUu-0006M9-Ob for qemu-devel@nongnu.org; Tue, 26 Feb 2019 14:34:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34142) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyiUf-00061p-Cc; Tue, 26 Feb 2019 14:34:21 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C51F77C84B; Tue, 26 Feb 2019 19:34:17 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 84E4269190; Tue, 26 Feb 2019 19:34:17 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2CF411132EC4; Tue, 26 Feb 2019 20:34:08 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 26 Feb 2019 20:34:06 +0100 Message-Id: <20190226193408.23862-10-armbru@redhat.com> In-Reply-To: <20190226193408.23862-1-armbru@redhat.com> References: <20190226193408.23862-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 26 Feb 2019 19:34:17 +0000 (UTC) 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 v2 09/11] 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: kwolf@redhat.com, qemu-block@nongnu.org, Aleksandar Rikalo , alex.bennee@linaro.org, mreitz@redhat.com, qemu-ppc@nongnu.org, lersek@redhat.com, Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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. There are more uses of BIOS_SIZE, but I don't sufficiently understand them to attempt cleanup. Cc: Aurelien Jarno Cc: Aleksandar Rikalo Signed-off-by: Markus Armbruster Reviewed-by: Alex Benn=C3=A9e --- hw/mips/mips_malta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 172ee033af..c2a5c65a24 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1269,12 +1269,12 @@ void mips_malta_init(MachineState *machine) if (dinfo) { printf("Register parallel flash %d size " TARGET_FMT_lx " at " "addr %08llx '%s' %x\n", - fl_idx, bios_size, FLASH_ADDRESS, + fl_idx, FLASH_SIZE, FLASH_ADDRESS, blk_name(dinfo->bdrv), fl_sectors); } #endif fl =3D pflash_cfi01_register(FLASH_ADDRESS, NULL, "mips_malta.bios", - BIOS_SIZE, + FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, 65536, fl_sectors, 4, 0x0000, 0x0000, 0x0000, 0x0000, be); --=20 2.17.2