From patchwork Mon Jan 9 12:01:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13093377 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 A21F5C54EBE for ; Mon, 9 Jan 2023 12:30:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEqqw-0005sJ-N0; Mon, 09 Jan 2023 07:02:10 -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 1pEqqt-0005oa-6o for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:02:07 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqqp-0001uW-PN for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:02:06 -0500 Received: by mail-wm1-x32b.google.com with SMTP id p3-20020a05600c1d8300b003d9ee5f125bso2312206wms.4 for ; Mon, 09 Jan 2023 04:02:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c6I1HLCSYyw0uAOoILOG7NYLqOybQWcLBPyeCZd7TC0=; b=xg9IfuLI7eQOsq6ONF5YgbO9EswzewJzZ7mXUWKY/+tkBLy+bo33lQNdSBahGMH/I7 q6Cfnd2GL8D6M7dnejza88qrS61xE+g8FLsF/1tQCiOJCEsUxkpJ9j030wm7LZnT9Q3h jOkddAkCxp13S7/X2b4RNi1htgt7pCdicYSG1Qej3TqdJ9uqEzNdvakjetrlrLNVjsw2 O4oXPYAJp+8a7Ib8C8ahMnrexrfrHSfp09qjtxwnt89dnZxfNTXZm5O+7iQtYxSVpWcC 6DyN3wOqYJN3iEwe8zY7NJW7LI9ALFQR8QZM2bUTMNGwrez8zfzX6wOqgTy9wtzB3KZM ZGkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c6I1HLCSYyw0uAOoILOG7NYLqOybQWcLBPyeCZd7TC0=; b=nKNePpQ80tmS5pqMZJU90xoMB7qGo/AlLTfLk6XUGbMC/ES+D0Qse5ruiRJIHrclhn Ieqdpwld2n6ndK2tf3cX1ZCO0id1SvJCsU+wBy0X4pWwKZntNaPb54cVFSLn7QdiY2Ch 38aVZ5FIEx2gniZZIp7ToTbrWfukp35n7dB3m/00dj0vJKWvjkUnlC2j+zGRD2O/Fh70 9QwpIB4xHGLldUTk/FV1jaxzwuCQ9MoYalLBkD3nLkc6hfISMHa26DWXLzPE0Vfoh5Ll cxs9d44KkL5Uw5HiwpwBQ2NdhVauc+F/lRQQq10n/kqTuBITatUOtVnieOYRyqmmtFQy j1RA== X-Gm-Message-State: AFqh2krtTPtX0xxddvCw7BMsVKAVprKikXLxPbqqAXjtAABTvY6CRRit zm8norqtg+MuQSJj64RLUARhmgbeeJerauwv X-Google-Smtp-Source: AMrXdXu1ZGkSk0WGtMytH4NKZzxuRWX73Ve68/XnfpSEN7YD22gJgESRjCP6z3D7IOaOmd2OH3V5xQ== X-Received: by 2002:a05:600c:4d14:b0:3d3:5c7d:a5f3 with SMTP id u20-20020a05600c4d1400b003d35c7da5f3mr49498434wmp.37.1673265721968; Mon, 09 Jan 2023 04:02:01 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id bi22-20020a05600c3d9600b003d208eb17ecsm11123199wmb.26.2023.01.09.04.02.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 04:02:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Yoshinori Sato , Aurelien Jarno , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Jiaxun Yang , Magnus Damm , qemu-ppc@nongnu.org, BALATON Zoltan Subject: [PATCH 1/5] hw/ppc/sam460ex: Remove unreachable code calling pflash_cfi01_register() Date: Mon, 9 Jan 2023 13:01:50 +0100 Message-Id: <20230109120154.2868-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109120154.2868-1-philmd@linaro.org> References: <20230109120154.2868-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 Since its QOM'ification in commit 368a354f02 ("pflash_cfi0x: QOMified") the pflash_cfi01_register() function does not fail. This call was later converted with a script to use &error_fatal, still unable to fail. Remove the unreachable code. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: BALATON Zoltan --- hw/ppc/sam460ex.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index 4a22ce3761..cf7213f7c9 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -103,14 +103,10 @@ static int sam460ex_load_uboot(void) DriveInfo *dinfo; dinfo = drive_get(IF_PFLASH, 0, 0); - if (!pflash_cfi01_register(FLASH_BASE | ((hwaddr)FLASH_BASE_H << 32), - "sam460ex.flash", FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - 64 * KiB, 1, 0x89, 0x18, 0x0000, 0x0, 1)) { - error_report("Error registering flash memory"); - /* XXX: return an error instead? */ - exit(1); - } + pflash_cfi01_register(FLASH_BASE | ((hwaddr)FLASH_BASE_H << 32), + "sam460ex.flash", FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + 64 * KiB, 1, 0x89, 0x18, 0x0000, 0x0, 1)); if (!dinfo) { /*error_report("No flash image given with the 'pflash' parameter," From patchwork Mon Jan 9 12:01:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13093340 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 8EB11C54EBE for ; Mon, 9 Jan 2023 12:13:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEqqz-0005tr-5m; Mon, 09 Jan 2023 07:02:13 -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 1pEqqw-0005sN-In for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:02:10 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqqu-0001zG-QY for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:02:10 -0500 Received: by mail-wm1-x332.google.com with SMTP id p1-20020a05600c1d8100b003d8c9b191e0so6486111wms.4 for ; Mon, 09 Jan 2023 04:02:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ItM+Iu1qenI4Asn3N+2BGwmWBIaMxDGBPbjt9fpGqnQ=; b=QNyTlnb1IY5R8p1K69couobceFCbFLhHPSPShrq9QFxGb/ZzkuLLvM9mMQNPxO6yV5 cISFisfXVVzhsw//OvO+6U4GpPXQDPNsRCElS15o4yqw6BE5zEsFVy8YOeQHug6yLEAu fnpVVl4u0iyYIBHwgq0EAsNAiwqsylchJjV1pHimcwm8MVbuFe8MUNp5gqGE+zyE+EKT 8t7tSRB0l3px2h0WZO0hHMS8Y90wNxD2TvN/Ps5w01LtDNFMUHuWlm9+Hp0PGJodSHy0 Ms40iRB8JITDuqRIbYGFASE7dwYV3P9RM5RWE9TkgKB0La6Vv6B/HUKP/j2fabLaOrOd cSbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ItM+Iu1qenI4Asn3N+2BGwmWBIaMxDGBPbjt9fpGqnQ=; b=GnEey4tBtkeyS/xh8gQnM6btQusEgE/HpG1Fp02dVrM1XaNq3wk5MucLHjBny6ZZWr AF70/Qx6zd4t5OGVtt97bbZky5omN03HmY+tnf18iQ/10ZUOYV/eIRgR1b8danqAfc1D kT+V47szHkwCw0CXEUTE1ICH2hvVMwWWmxQj3DeCbBetnkZMJM+fhcrlI8DzZAMBP1pM pqnHGi7ivbA0jC8VBrh+X0zaYj994Pl3XSG4SyJR5up7HuxvT7HKltuTSgAR3SL6RW+J x+6qgA9Rvq3uI48d6Er7N6jJdpOwwnZwZlsKOp8ueTHl6e9iXYX8bYjYXpaBM4jEQmD/ uqqQ== X-Gm-Message-State: AFqh2kofi7kCKTXjLC8Ga62ahT9AkmVeTJpiMfMrSk2sK5JmjmNT7i2T B5eTolgu546ZQANsAirbPNTCtpdjfAknl1Rw X-Google-Smtp-Source: AMrXdXtnWqrLPnCf+G0xfs/2irFKLQfhikRUXYDcqIwYnRhXyjhIyQ53QRw+gzh+yRxd2be5mMwkPg== X-Received: by 2002:a05:600c:3ca8:b0:3d9:e8b3:57fa with SMTP id bg40-20020a05600c3ca800b003d9e8b357famr4610956wmb.30.1673265727223; Mon, 09 Jan 2023 04:02:07 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id he12-20020a05600c540c00b003d9ddc82450sm10914942wmb.45.2023.01.09.04.02.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 04:02:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Yoshinori Sato , Aurelien Jarno , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Jiaxun Yang , Magnus Damm , qemu-ppc@nongnu.org, BALATON Zoltan Subject: [PATCH 2/5] hw/microblaze/petalogix: Add FLASH_SECTOR_SIZE definitions Date: Mon, 9 Jan 2023 13:01:51 +0100 Message-Id: <20230109120154.2868-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109120154.2868-1-philmd@linaro.org> References: <20230109120154.2868-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 Signed-off-by: Philippe Mathieu-Daudé --- hw/microblaze/petalogix_ml605_mmu.c | 3 ++- hw/microblaze/petalogix_s3adsp1800_mmu.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c index a24fadddca..1888900156 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -45,6 +45,7 @@ #define LMB_BRAM_SIZE (128 * KiB) #define FLASH_SIZE (32 * MiB) +#define FLASH_SECTOR_SIZE (64 * KiB) #define BINARY_DEVICE_TREE_FILE "petalogix-ml605.dtb" @@ -107,7 +108,7 @@ petalogix_ml605_init(MachineState *machine) * 10th paremeter 0 means little-endian */ pflash_cfi01_register(FLASH_BASEADDR, "petalogix_ml605.flash", FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - 64 * KiB, 2, 0x89, 0x18, 0x0000, 0x0, 0); + FLASH_SECTOR_SIZE, 2, 0x89, 0x18, 0x0000, 0x0, 0); dev = qdev_new("xlnx.xps-intc"); diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c index 9d959d1ad8..d14eff2514 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -40,6 +40,7 @@ #define LMB_BRAM_SIZE (128 * KiB) #define FLASH_SIZE (16 * MiB) +#define FLASH_SECTOR_SIZE (64 * KiB) #define BINARY_DEVICE_TREE_FILE "petalogix-s3adsp1800.dtb" @@ -87,7 +88,7 @@ petalogix_s3adsp1800_init(MachineState *machine) pflash_cfi01_register(FLASH_BASEADDR, "petalogix_s3adsp1800.flash", FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - 64 * KiB, 1, 0x89, 0x18, 0x0000, 0x0, 1); + FLASH_SECTOR_SIZE, 1, 0x89, 0x18, 0x0000, 0x0, 1); dev = qdev_new("xlnx.xps-intc"); qdev_prop_set_uint32(dev, "kind-of-intr", From patchwork Mon Jan 9 12:01:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13093495 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 DC7EDC5479D for ; Mon, 9 Jan 2023 12:59:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEqr4-0005vg-LO; Mon, 09 Jan 2023 07:02:18 -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 1pEqr1-0005ub-Fh for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:02:15 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqqz-00023H-UG for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:02:15 -0500 Received: by mail-wm1-x333.google.com with SMTP id i17-20020a05600c355100b003d99434b1cfso6503035wmq.1 for ; Mon, 09 Jan 2023 04:02:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TvirG+eigIopPOcx2cPrBXxTDVIETYN2my256Wba2R8=; b=NOg7+6knm0CCQUleysD4aDkuoTjxSl7z9cZ2+DcygWil0uXACfG7ia2ai8B5IviQnx /X/aaCcJzDltuBjxJ4aXgeMxRE+QrO9iKpf3pm2kUXgOtoNYPlSmqM4hn2FusOnDDhCE DwJlj13j9tRAuw20IvYm5axZ1b3rsloLEoJr5BBbfjjTljKfoKpiPHLIArmzMIsUfWMT JbpUe/pT3nGHJHr+dPTadR2Q1U2SpeQoUtmMpD4QN0jYba9cB148/bSWef5WBybs8fBV Erfv3NZsJThtosyeE+MslPqThUPHynwo/XzfiEJsGIyRT4YzxLvGnRkL8C6p4wNO07LT gaxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TvirG+eigIopPOcx2cPrBXxTDVIETYN2my256Wba2R8=; b=p+hS4TH+0ZiFAGeA3QxBKg1nP6FmFZscAYZT7A9T8JO+APBbMeAKZEr7//JwPohE8e KuPUZr8IkUlfwM+i/lOTT9w6B2u16AaFNFIYJcpzMGNcwKmW6k3P5gab/NZT6z+J0CdJ zCuOO3zbipU2rZpu6ZhRsCsne64gy0aOpWE1osdnOELD9CC7Ib5N/g/wLk0ss9WjkOTs EUzV0XYlHlOBbeuWGXPLngIkhuXQ1CyGu6V8cEpxJt/9dohR5dCkifm9Z6D2F/VDA71F f/jKUzGvtwh6I1nQ1P+XCUqUXw1mS3bIevzxVDp7jzW8goCnMrJGwr78Oz7eZMDDr1TC II3g== X-Gm-Message-State: AFqh2kolfeYd9IjIwTgWnMgRvlcO7g7ueagai9vhx173jw5mrIgK0LMy c9E104N5vtc1dmTppvGpCEtrk8dTMjF26VE+ X-Google-Smtp-Source: AMrXdXuw3UqW3PaOv/WGNrfhIZbfOgP2qfoKeOG8sNd3bjf1j4tAPDsxdr3gBqQiOWdcMaSqqnZ7KA== X-Received: by 2002:a05:600c:3d12:b0:3d2:392b:3165 with SMTP id bh18-20020a05600c3d1200b003d2392b3165mr45822556wmb.12.1673265732392; Mon, 09 Jan 2023 04:02:12 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id p3-20020a05600c358300b003d1f2c3e571sm17369906wmq.33.2023.01.09.04.02.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 04:02:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Yoshinori Sato , Aurelien Jarno , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Jiaxun Yang , Magnus Damm , qemu-ppc@nongnu.org, BALATON Zoltan Subject: [PATCH 3/5] hw/mips/malta: Add the FLASH_SECTOR_SIZE definition Date: Mon, 9 Jan 2023 13:01:52 +0100 Message-Id: <20230109120154.2868-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109120154.2868-1-philmd@linaro.org> References: <20230109120154.2868-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 Ease code review by using the IEC binary prefix definition for the FLASH_SIZE. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/malta.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index c0a2e0ab04..e645ba1322 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -69,7 +69,8 @@ #define FPGA_ADDRESS 0x1f000000ULL #define RESET_ADDRESS 0x1fc00000ULL -#define FLASH_SIZE 0x400000 +#define FLASH_SIZE (4 * MiB) +#define FLASH_SECTOR_SIZE (64 * KiB) typedef struct { MemoryRegion iomem; @@ -1289,7 +1290,7 @@ void mips_malta_init(MachineState *machine) fl = pflash_cfi01_register(FLASH_ADDRESS, "mips_malta.bios", FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - 65536, + FLASH_SECTOR_SIZE, 4, 0x0000, 0x0000, 0x0000, 0x0000, be); bios = pflash_cfi01_get_memory(fl); fl_idx++; From patchwork Mon Jan 9 12:01:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13093387 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 2B603C54EBD for ; Mon, 9 Jan 2023 12:31:12 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEqrA-0005xN-CJ; Mon, 09 Jan 2023 07:02:24 -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 1pEqr7-0005wX-Lo for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:02:21 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqr5-00025Z-0R for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:02:21 -0500 Received: by mail-wm1-x32c.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so8821510wmb.2 for ; Mon, 09 Jan 2023 04:02:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wxm/+ae/RexNrDFlylFgft3ctCQnO2vjWs01C2V9H4w=; b=HJgCg+9AWdllygcaF4GGLwC8Jz61t2+TAgtvzWUxVW5C6Pi4X/Ho94vBwgr9CFeMqZ h2qLaXeLq8pknFKWg74wjPZDJiVxdhOaVRbj6ltrAt5BYMhQn65mu4Ke8usNuUsk7rEe UL+eUw8dEmV6656wxfp2vL900/Y3La1bM2CmDC6mXyQG8YDQGsTRdfkbhfVyLxxDf+JO 1p19wxOw4jOWfNI6qAeGSPmyNbWMGkDokEVBBx+re2BrFDtO30CLVAICnSuhIzkyBLOQ WxrKePYIXMjUVR6uS3F+PNhfMhGMg/Zj/q6TmCn1SdlErQmCE28WZXC5JzmlEO/hMUj7 QMhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wxm/+ae/RexNrDFlylFgft3ctCQnO2vjWs01C2V9H4w=; b=v4h7i7lLzlqs7mdWtaDzjTR76Ah3HSiUTTCMTZ8UHyNiZrQ9hMo3+DjQH7jAhC9LVp QFVb9vG4+9/Dc8MTnTXi1r5la2yISR/nrQ2YEZeHEzHD9N2cd4twcBMl2/Etb/l6cI1f jrLnSjgICzkdES0+KDUDpPbwjGM0QS67ZxJ7PxRy2Tk8SGUaFSjMq3cIdDEziI/RbyqX BpUSweMXQZNmgCiXX9dTeaduzt3adwh5d2AmSQ9DpLH5f1jXqe/oqhxaj4tIyBg5fh6m KQasSqwIsH2aeHjXLeVNDQniX2sYEuDoHzUpNvRc6ZBS1dFq8Z76WMUy0PU0RvLvusVM wwmw== X-Gm-Message-State: AFqh2krfgUclsmWmdBRw/KuO05/r5msZUfADQFrW5hw/6uxDV3CurAVd 2GKhFg9LnrkUHIH1YZTUfp2ejl8bLiLPqWdR X-Google-Smtp-Source: AMrXdXtrhUfeoZ4aF3QJP5aSAbvj9bkfYfPfJHTe9upcEg5xpk5EddyKBhcwL35Zxs/U6EIhbuPtHw== X-Received: by 2002:a05:600c:4f55:b0:3d3:5166:2da4 with SMTP id m21-20020a05600c4f5500b003d351662da4mr45690040wmq.8.1673265737455; Mon, 09 Jan 2023 04:02:17 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id g6-20020adff406000000b00298d87b6309sm8459169wro.78.2023.01.09.04.02.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 04:02:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Yoshinori Sato , Aurelien Jarno , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Jiaxun Yang , Magnus Damm , qemu-ppc@nongnu.org, BALATON Zoltan Subject: [PATCH 4/5] hw/sh4/r2d: Use the IEC binary prefix definitions Date: Mon, 9 Jan 2023 13:01:53 +0100 Message-Id: <20230109120154.2868-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109120154.2868-1-philmd@linaro.org> References: <20230109120154.2868-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 IEC binary prefixes ease code review: the unit is explicit. Signed-off-by: Philippe Mathieu-Daudé --- hw/sh4/r2d.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 39fc4f19d9..b3667e9b12 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -47,10 +47,10 @@ #define FLASH_BASE 0x00000000 #define FLASH_SIZE (16 * MiB) -#define SDRAM_BASE 0x0c000000 /* Physical location of SDRAM: Area 3 */ -#define SDRAM_SIZE 0x04000000 +#define SDRAM_BASE (192 * MiB) /* Physical location of SDRAM: Area 3 */ +#define SDRAM_SIZE (64 * MiB) -#define SM501_VRAM_SIZE 0x800000 +#define SM501_VRAM_SIZE (8 * MiB) #define BOOT_PARAMS_OFFSET 0x0010000 /* CONFIG_BOOT_LINK_OFFSET of Linux kernel */ From patchwork Mon Jan 9 12:01:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13093355 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 A2027C54EBD for ; Mon, 9 Jan 2023 12:22:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEqrD-0005yh-2J; Mon, 09 Jan 2023 07:02:27 -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 1pEqrA-0005xj-S5 for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:02:25 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqr9-0001uW-AJ for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:02:24 -0500 Received: by mail-wm1-x32b.google.com with SMTP id p3-20020a05600c1d8300b003d9ee5f125bso2312923wms.4 for ; Mon, 09 Jan 2023 04:02:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fmB1uKPq6eeUbQCXeOn2PhOUbWdoWpaNbipdtr7rTeo=; b=av8OZnqqWP4e2jgZ/NumwW5XBeP283hJ5cUhHKOkiGmvYVdmsAaItK2AO9F6Qxv0WJ EA8Om+FFfGBtS+UMSL6+CLE6h/z+WvT5e2hF8gx9m0q1YlWZYNxWiHGHuS5xaFqanTtV lbbnUYKmC1hMQ/0IRk33pk7Y4nHOgNEhHMmdnEc5n5ErZeK4YXvysx0qEKMpkY7xgrwx 876moaYMDDsbsh1Ig19lcyhMnvwF0T3pryDjT69pq7XpoVLTYv/tqGX7BokZ9Fg9KXJ0 mTwdhN+vkxa6Kex4X7iWSZva7xabYuwoqUbATNWLOpvGB+68kRRzPq7qFXgXEiXEKnLG qPPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fmB1uKPq6eeUbQCXeOn2PhOUbWdoWpaNbipdtr7rTeo=; b=RE5u/IItHUBVtHvIZR65eiYH6Tlue16O5cZoNP+2fw5lffFU83cvM8RvfGF6xAozMY qcY5xECLDZMbAlebfKGKHdc8ikadubMbsGnoghmPN4Ks/qLQN7tmYdmOH9dC6APXpg+K HYR/zAOTxmYWQZmposNd9pRmPChGTBTMUrt+tD2C8UtYn3ErwQf/18PIK3v/ZWh4IHKG mi/MDNyLbmjJJZTQvvD3xlRN18KAyzgrZwwURamN5fak50ifGAFA4X7CEtI1K2XwVbJh eeaBLf8xytItQT0Q9gDAIh4s2O7cIDwvhZvH/6oGbgghdVpZfJV0ddyZeESrvr2WjSBC JPKQ== X-Gm-Message-State: AFqh2kpTOO/4rgh+ReYEWGDhkrxaV86GFLPNVAlbMphMmJERDF4FJoua OpPw3y+estEaeyCyeY7rmx+TQPmxpZq/XWSV X-Google-Smtp-Source: AMrXdXvSd1F0uWQi/mut6tOLGbqn6mAL4Bi8HrTn2/Hubypzs20rDRsgdJsmS83x+AEu6bSoWbPw1Q== X-Received: by 2002:a7b:c3c9:0:b0:3d2:e28:647f with SMTP id t9-20020a7bc3c9000000b003d20e28647fmr55589126wmj.15.1673265742355; Mon, 09 Jan 2023 04:02:22 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id r7-20020a05600c458700b003d974076f13sm11928490wmo.3.2023.01.09.04.02.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 04:02:22 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Yoshinori Sato , Aurelien Jarno , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Jiaxun Yang , Magnus Damm , qemu-ppc@nongnu.org, BALATON Zoltan Subject: [PATCH 5/5] hw/sh4/r2d: Add the FLASH_SECTOR_SIZE definition Date: Mon, 9 Jan 2023 13:01:54 +0100 Message-Id: <20230109120154.2868-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109120154.2868-1-philmd@linaro.org> References: <20230109120154.2868-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 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) #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++)