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: 640643 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2117909pvb; Mon, 9 Jan 2023 04:59:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXvp7fAyFCNUNRIBa8GDtKGd3ij7cgf9kX4+wyyA3RkFWhwTBXia+uoqQ73ZFIBld5V3g0Aj X-Received: by 2002:a05:622a:1e85:b0:3a6:8b3a:6450 with SMTP id bz5-20020a05622a1e8500b003a68b3a6450mr110780443qtb.54.1673269177530; Mon, 09 Jan 2023 04:59:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673269177; cv=none; d=google.com; s=arc-20160816; b=nB3WXsxQBcAQi36zqaQMVJK0xtryDLkLwHTKISSy6EPfcEDZi8cqOxl4FqmEvjN0sC 5daxPlWERb6nQ67JIwGTgZpoE76tVg4g7ZJkry1n28rc0c00HQm5fbwLavP0QGdhBSAa qDgKumX3+5ukUHvtJW191Hb0lEnwuaOCn2DPnm1BEuh3INRq0MSWCy5aj3St5nt8N5yr USdPKVcswvKo/IW45MgFuk7t1kYwFEhS+8//A5BW8yBWEUVYE1SuKHhPnp6h8WqMzC9A QWNgufTaCvdqv3xkZJb8AAYN59t3NV67qEVpCU3AAA5FMh5OGKNV5pSrHtKJRhJEgDP1 7vLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TvirG+eigIopPOcx2cPrBXxTDVIETYN2my256Wba2R8=; b=aw0Df0bxRxwRIiZXFgfR8Yx+0S+9SOqCXg0RlBG9Mdsk9s3mFd14M/v8jLIrEKx0AJ 1Fud5zqb1MkjxC8kDMj6V0pd74D3XMgioR7eMOrOi/YwoykuRGAVcJmrmrSCaWz1z/ce vy8cOLHYFui+oQv9PYQtHTQPZUjxBViguqVUj0bab+WeiqYJfj6pyPDgHBysE60vEhU1 SkXNAjjuLQuKfQEWfTjGX91JjrJ9iruXHjy0L3fSONMK1rL+xnE47VS4v6y7WqrSUGIQ 4A/6gHem7ttWXkNu2/lMHY/Ijx+LSKpYoojZS501MowB17cdPK7iMDv9ORJd0wPdusQu ufJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NOg7+6kn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jr42-20020a05622a802a00b003ad55e2f3e8si1318189qtb.413.2023.01.09.04.59.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 04:59:37 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NOg7+6kn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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++;