Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DA417C5479D for ; Mon, 9 Jan 2023 13:41:58 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pErd6-0006po-Ua; Mon, 09 Jan 2023 07:51:58 -0500 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 1pErd1-0006oS-Cq; Mon, 09 Jan 2023 07:51:53 -0500 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pErcz-0007Tu-Pc; Mon, 09 Jan 2023 07:51:51 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 99A257457E7; Mon, 9 Jan 2023 13:49:29 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 64964745720; Mon, 9 Jan 2023 13:49:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id 636B7745712; Mon, 9 Jan 2023 13:49:29 +0100 (CET) Date: Mon, 9 Jan 2023 13:49:29 +0100 (CET) From: BALATON Zoltan To: =?ISO-8859-15?Q?Philippe_Mathieu-Daud=E9?= cc: qemu-devel@nongnu.org, "Edgar E. Iglesias" , Yoshinori Sato , Aurelien Jarno , Jiaxun Yang , Magnus Damm , qemu-ppc@nongnu.org Subject: Re: [PATCH 5/5] hw/sh4/r2d: Add the FLASH_SECTOR_SIZE definition In-Reply-To: <20230109120154.2868-6-philmd@linaro.org> Message-ID: <2dec43d6-98ca-1f79-494b-e292d1052c92@eik.bme.hu> References: <20230109120154.2868-1-philmd@linaro.org> <20230109120154.2868-6-philmd@linaro.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="3866299591-1959592125-1673268569=:7264" Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --3866299591-1959592125-1673268569=:7264 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Mon, 9 Jan 2023, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/sh4/r2d.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c > index b3667e9b12..6e0c65124a 100644 > --- a/hw/sh4/r2d.c > +++ b/hw/sh4/r2d.c > @@ -45,7 +45,8 @@ > #include "hw/block/flash.h" > > #define FLASH_BASE 0x00000000 > -#define FLASH_SIZE (16 * MiB) > +#define FLASH_SIZE (16 * MiB) > +#define FLASH_SECTOR_SIZE (128 * KiB) I'm not a fan of single use defines when it makes harder to see what value is used than using a constant. This one is border line case as the pflash_cfi02_register() function has so many arguments that it's not clear which is which but I'm not sure it worth the churn but I don't care too much either. Regards, BALATON Zoltan > #define SDRAM_BASE (192 * MiB) /* Physical location of SDRAM: Area 3 */ > #define SDRAM_SIZE (64 * MiB) > @@ -304,8 +305,8 @@ static void r2d_init(MachineState *machine) > dinfo = drive_get(IF_PFLASH, 0, 0); > pflash_cfi02_register(0x0, "r2d.flash", FLASH_SIZE, > dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, > - 64 * KiB, 1, 2, 0x0001, 0x227e, 0x2220, 0x2200, > - 0x555, 0x2aa, 0); > + FLASH_SECTOR_SIZE, 1, 2, > + 0x0001, 0x227e, 0x2220, 0x2200, 0x555, 0x2aa, 0); > > /* NIC: rtl8139 on-board, and 2 slots. */ > for (i = 0; i < nb_nics; i++) > --3866299591-1959592125-1673268569=:7264--