From patchwork Mon Jan 9 11:53:04 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: 640609 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2093806pvb; Mon, 9 Jan 2023 04:04:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXvAsDJffTMcI59kB5Q1zOAWX8y6hl3rg5+WxZiKlIMG2UrBF1l4gz0L4muN6KuUmakuU0nS X-Received: by 2002:a05:622a:5c19:b0:3ad:d2d4:2503 with SMTP id gd25-20020a05622a5c1900b003add2d42503mr3000788qtb.7.1673265878271; Mon, 09 Jan 2023 04:04:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673265878; cv=none; d=google.com; s=arc-20160816; b=Gq95RHAfBWTjC3n9rqCK1GFjeURrtfE19KMkdNOz2oCNoAkHRfdTZ35Ei1hajjsF4U uwkzMzkiiGEg9cPQ+DWTG2BL1AYc1Qu45HIuj2gk0tZXE1Uq+FGgyfHklPE/Qvxi0LgD Qh5mXEyuo+q7jq8oRJ6W735RfadCmepgX1Fg3JJRCIbxwVb2X2mVr8iKrGaUwAYa5/lo yhgUpUw82lzjgWYIHlmajPsQ7LKrUyA1SItamWejUhIaGytudRt7yJ49d5d2nBGkHZPY u3fdlpse3+9n9kktxOK1pOjPPbwqT45yI98NjtvUR+xsw8kprf3OqqeMcRVU/B9YGcCW F2Jg== 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=iQs1+OIM6FI+xXo1eNVCeEzgZwL+2/Sa1KGrztxPB6E=; b=0Qo5/14LKWacLuH7znfPkaF9MHbWe9dk+/gjGK1gX1Pm1BATeQjQgW1Jy+wgPd9FoV 8Aif3CdJb7am9yCHEwN/RiJgNvDnW/Fhj7KMb3SiQChJ+zAV8iq8wVa75nB/yntvZ5sh S1ZYWhY0jsocvojNYi48SsEy0Pp3Cuf0hm5wVPqkjMM4A3VpUPtr47s9OSymRa2igvkc gzSPcvlKkeIV64Z2H1iJLrDDquQLWCRWLWg3qtK/+wgp+blMFz13VnJXnCefWS8ztFMM TYjGzcr2rxqNjGuzxQ1EI6xuTmQBWBgNHdmTCwJSoYQ71gaT/6QrjR/Bc7QTMfZn7ZSp TOgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LHUpQHsG; 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 y21-20020ac87c95000000b003ad36ef5f6bsi1320479qtv.272.2023.01.09.04.04.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 04:04:38 -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=LHUpQHsG; 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 1pEqiW-0002no-0v; Mon, 09 Jan 2023 06:53:28 -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 1pEqiU-0002n3-EE for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:26 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqiS-0007xA-H0 for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:26 -0500 Received: by mail-wr1-x42a.google.com with SMTP id j7so2877314wrn.9 for ; Mon, 09 Jan 2023 03:53:24 -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=iQs1+OIM6FI+xXo1eNVCeEzgZwL+2/Sa1KGrztxPB6E=; b=LHUpQHsGMytocszGYclxxFY/M0sI4Wy83DOeMv67XaQlZjsqp3QXXAy4ByzQW+Nu5G Yx+deKJeqp+pLH4vSzj/oFuhvWNm1V1ao0WgxhlyMKPbMh2eFlASN0y05W2jqvQkz9li qavptblnClL/RMxD/dm+V/lPWzomhuCkD28gqtNER1MQ6bIayj7IcI+9AEu9sQwilqUK X4hgHYe72wWx4ND3foCra70qRuy6Z96KQJKrTaSUWevKYlqKl4o/5uMzbPyfVbX4GoNu i5P06j9e1s52YPrKMe/4BgltPHFPq9SUEXKBp8DvRkWI6kcoMLSemL07RWMIDCm4aA/S juoQ== 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=iQs1+OIM6FI+xXo1eNVCeEzgZwL+2/Sa1KGrztxPB6E=; b=4YBZpjbviyrN9DNsIRANq6M1xWCf3cj5wcCcVNlZI8uyMzYQfGlLfmrg6pxWJ1bKTu YILveFaNSg19W2IdTncxIb49BlMmjTjAmH2d1xPCySydYAhPL94hobhZEkxF2sXzmnYg 0+rPoEZ7EtzvowfC4YgRr/AIZtoRDWkDh4ZyJBCA2bs81DMDQnQzNdxxT/jXWkYY8DCF v1lmBf7KXrvWklyNQGYEoOH8JCVetFSaB2RDeqIbnSbrCL+AJ6prTa4puaFSuncHlOB4 7G1OzBv0DQGCteO9NrQ0Rc23Dtxlzpc+ekTME4o2lpulEklOh23QDcRH1si9yIBgqddp mGiw== X-Gm-Message-State: AFqh2kqpSI00PU+NnvHGjkcJkJiKEifwIbJ5951l4lmpp1/EYipJjQ3q LgifD4QVsc/PonXpEnjeFQOTaDzUf4sgJnCO X-Received: by 2002:a5d:620f:0:b0:242:9e3:72b8 with SMTP id y15-20020a5d620f000000b0024209e372b8mr46471796wru.31.1673265203010; Mon, 09 Jan 2023 03:53:23 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id f14-20020adff58e000000b00241fea203b6sm8495136wro.87.2023.01.09.03.53.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 03:53:22 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 01/13] hw/arm/pxa2xx: Simplify pxa255_init() Date: Mon, 9 Jan 2023 12:53:04 +0100 Message-Id: <20230109115316.2235-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109115316.2235-1-philmd@linaro.org> References: <20230109115316.2235-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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 Since pxa255_init() must map the device in the system memory, there is no point in passing get_system_memory() by argument. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/gumstix.c | 3 +-- hw/arm/pxa2xx.c | 4 +++- hw/arm/tosa.c | 2 +- include/hw/arm/pxa.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c index 3a4bc332c4..c167518a46 100644 --- a/hw/arm/gumstix.c +++ b/hw/arm/gumstix.c @@ -51,12 +51,11 @@ static void connex_init(MachineState *machine) { PXA2xxState *cpu; DriveInfo *dinfo; - MemoryRegion *address_space_mem = get_system_memory(); uint32_t connex_rom = 0x01000000; uint32_t connex_ram = 0x04000000; - cpu = pxa255_init(address_space_mem, connex_ram); + cpu = pxa255_init(connex_ram); dinfo = drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 93dda83d7a..8b8845fc63 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -11,6 +11,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qapi/error.h" +#include "exec/address-spaces.h" #include "cpu.h" #include "hw/sysbus.h" #include "migration/vmstate.h" @@ -2230,8 +2231,9 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, } /* Initialise a PXA255 integrated chip (ARM based core). */ -PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size) +PXA2xxState *pxa255_init(unsigned int sdram_size) { + MemoryRegion *address_space = get_system_memory(); PXA2xxState *s; int i; DriveInfo *dinfo; diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index d5a6763cf9..3ca2e4459c 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -242,7 +242,7 @@ static void tosa_init(MachineState *machine) TC6393xbState *tmio; DeviceState *scp0, *scp1; - mpu = pxa255_init(address_space_mem, tosa_binfo.ram_size); + mpu = pxa255_init(tosa_binfo.ram_size); memory_region_init_rom(rom, NULL, "tosa.rom", TOSA_ROM, &error_fatal); memory_region_add_subregion(address_space_mem, 0, rom); diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index 1095504b86..c26007e57f 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -195,6 +195,6 @@ struct PXA2xxI2SState { PXA2xxState *pxa270_init(MemoryRegion *address_space, unsigned int sdram_size, const char *revision); -PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size); +PXA2xxState *pxa255_init(unsigned int sdram_size); #endif /* PXA_H */ From patchwork Mon Jan 9 11:53:05 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: 640606 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2089157pvb; Mon, 9 Jan 2023 03:54:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXv621ssduC6f2feJ58/1VMafSJo2X5lgXLnHFmZbmvtoBpjnT2yzk0VlbWPVG8d0slgzjUT X-Received: by 2002:a05:622a:1f09:b0:3a7:eb01:5dde with SMTP id ca9-20020a05622a1f0900b003a7eb015ddemr76800018qtb.14.1673265257833; Mon, 09 Jan 2023 03:54:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673265257; cv=none; d=google.com; s=arc-20160816; b=PDXVx+gBbU7t4suJHtpNYeuHImI8bnRHzyKCOecEaY23NuhGS0J20nzoTV6miioqTm p+5Sz4Oi/uP98EPMopLFs6WKS0+E3hiZWOJPSj3VDU7KqE0OGn9gHGf73qC2yTwjX/bL v6UPAiT2+lthjyafTE/NOgLddKBjQRM3/Dyz9pNYmDhNVd09sodlns8lZF9dvOo/meU1 8eOE6Pd5vu0Zq5PfT23G47jEb035A1MBWqMkRpPNbbvwux/wiYEABcdPdGDsf2KXQaR1 0OKdi/9R1L1Xgxy5/Pfrrs3i7nGUm8mzQxn2yAixCXNlI1n0z1r7vkx1hNZ0VWfVsvi+ WzMg== 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=f5egngPnKd3eXowoe9rSvuOk/WYn87jONK9fpMWE9oo=; b=EkYNseizyXhkHXcRtk2wZIVJhW1kXaVCk9I+xaynq5xPYxmphm7wt3oxwOcvLuzxOA AuyKKcQRy/fQdw1hb0OV2fHyGa0eCZAHbSKx13O/XbPsBpQHnxbvp5dqeIpyYXLuz7SE ZPTKAlJMohF50AVeCvE8qtxobb6oF5dcYCt4rRca6NtcNIucVuG+Vq7b1SNYoVbCJ3N+ ilUP2Lt23ZwRnGAmng0zbs3gpgFVScBy1D4WzhZjJid0q1YuCLxeA5OUrUDlAnk7McCn /iu741j0tjseFz4qvin3lE50TrISewStRayfznac5yKFVVQ+7BEZ5FY/AU8k+Ov/2KT0 GSZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nq0LEoq9; 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 u7-20020a37ab07000000b006fa4afd27a2si4212180qke.592.2023.01.09.03.54.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 03:54:17 -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=nq0LEoq9; 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 1pEqib-0002pB-33; Mon, 09 Jan 2023 06:53:33 -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 1pEqiZ-0002od-9x for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:31 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqiX-00081k-EU for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:31 -0500 Received: by mail-wm1-x32a.google.com with SMTP id m3so6086048wmq.0 for ; Mon, 09 Jan 2023 03:53:29 -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=f5egngPnKd3eXowoe9rSvuOk/WYn87jONK9fpMWE9oo=; b=nq0LEoq9wNXmRpFMh9EiF5b22JVd2yATmMcp9kR7Tv24lPBvOe3UT+LOJ4QWALohbi y3H7PM64pnp6BLlCkauBQL5o1DPnfsZNK2EAOl7FPMBNGKqwJ5jeWQ1qHq7D6cVsjm6d SMVzSltoxU2KxC6m959HITQoIKXhzrNJIA+EKu3T3TVLyO0ex7+mpHswTVSGPyApPExk 4hHji9kPKlFMOB12nYj3oDTFIZqHCZtkiC2aDBGQR0/ihJDLjELMiFhGKNeehsEcmqfk 4RjX0z96Hg0QXP+H3jHguNfJo76O0a3o+UuvxvpE+zxZlNGzor7qmQz/RTfgDPBG08LZ BUiQ== 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=f5egngPnKd3eXowoe9rSvuOk/WYn87jONK9fpMWE9oo=; b=NGQI6oYlVYCmZ72MrBu7gW0sMTP1yiwMnBA7xwRM+fyj7f0xt14Fjae7YazB0U6LMQ RmM+tliMYaMNgl6jNWj7M6flswH83pIkSpPMr90TgatkCuoxqn1+pUQ0pZrqX9gID6T1 07s0Ui1xqRd+7JgpS5+1wuB+f6GNosdLbx57P85sgSRL1Bq8ZEXbCxb9iUjOPzigi0YP u+NGSTBCrrkRgnmAYvyo27EP0oY6eNi+EJpO8gFhZmioBopujBbDulVQcg07/sBszCyI OmN6Et3kSZsySkOw5UU0Jo37DxzEviOcegQxikRawfvxpU6OhWvEBnRdXbDwkPtYlAwg q0yQ== X-Gm-Message-State: AFqh2kpGLukgrV1fTa1anGoaRJePNhhmmeU+SzbGEoDWvV2KqK594ukP TGiOQwZ+6YeUlGOIi6LBEbvhg76+mMV5joKj X-Received: by 2002:a05:600c:4690:b0:3d9:f42c:56c5 with SMTP id p16-20020a05600c469000b003d9f42c56c5mr1086470wmo.4.1673265207803; Mon, 09 Jan 2023 03:53:27 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id l3-20020a05600c4f0300b003a6125562e1sm11840678wmq.46.2023.01.09.03.53.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 03:53:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 02/13] hw/arm/pxa2xx: Simplify pxa270_init() Date: Mon, 9 Jan 2023 12:53:05 +0100 Message-Id: <20230109115316.2235-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109115316.2235-1-philmd@linaro.org> References: <20230109115316.2235-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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 Since pxa270_init() must map the device in the system memory, there is no point in passing get_system_memory() by argument. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/gumstix.c | 3 +-- hw/arm/mainstone.c | 10 ++++------ hw/arm/pxa2xx.c | 4 ++-- hw/arm/spitz.c | 6 ++---- hw/arm/z2.c | 3 +-- include/hw/arm/pxa.h | 3 +-- 6 files changed, 11 insertions(+), 18 deletions(-) diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c index c167518a46..ab9b0182f6 100644 --- a/hw/arm/gumstix.c +++ b/hw/arm/gumstix.c @@ -80,12 +80,11 @@ static void verdex_init(MachineState *machine) { PXA2xxState *cpu; DriveInfo *dinfo; - MemoryRegion *address_space_mem = get_system_memory(); uint32_t verdex_rom = 0x02000000; uint32_t verdex_ram = 0x10000000; - cpu = pxa270_init(address_space_mem, verdex_ram, machine->cpu_type); + cpu = pxa270_init(verdex_ram, machine->cpu_type); dinfo = drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c index 8454b65458..f6293c6c13 100644 --- a/hw/arm/mainstone.c +++ b/hw/arm/mainstone.c @@ -108,8 +108,7 @@ static struct arm_boot_info mainstone_binfo = { .ram_size = 0x04000000, }; -static void mainstone_common_init(MemoryRegion *address_space_mem, - MachineState *machine, +static void mainstone_common_init(MachineState *machine, enum mainstone_model_e model, int arm_id) { uint32_t sector_len = 256 * 1024; @@ -121,11 +120,10 @@ static void mainstone_common_init(MemoryRegion *address_space_mem, MemoryRegion *rom = g_new(MemoryRegion, 1); /* Setup CPU & memory */ - mpu = pxa270_init(address_space_mem, mainstone_binfo.ram_size, - machine->cpu_type); + mpu = pxa270_init(mainstone_binfo.ram_size, machine->cpu_type); memory_region_init_rom(rom, NULL, "mainstone.rom", MAINSTONE_ROM, &error_fatal); - memory_region_add_subregion(address_space_mem, 0, rom); + memory_region_add_subregion(get_system_memory(), 0x00000000, rom); /* There are two 32MiB flash devices on the board */ for (i = 0; i < 2; i ++) { @@ -165,7 +163,7 @@ static void mainstone_common_init(MemoryRegion *address_space_mem, static void mainstone_init(MachineState *machine) { - mainstone_common_init(get_system_memory(), machine, mainstone, 0x196); + mainstone_common_init(machine, mainstone, 0x196); } static void mainstone2_machine_init(MachineClass *mc) diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 8b8845fc63..07d5dd8691 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -2092,9 +2092,9 @@ static void pxa2xx_reset(void *opaque, int line, int level) } /* Initialise a PXA270 integrated chip (ARM based core). */ -PXA2xxState *pxa270_init(MemoryRegion *address_space, - unsigned int sdram_size, const char *cpu_type) +PXA2xxState *pxa270_init(unsigned int sdram_size, const char *cpu_type) { + MemoryRegion *address_space = get_system_memory(); PXA2xxState *s; int i; DriveInfo *dinfo; diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 5aab0b8565..f732fe0acf 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -986,18 +986,16 @@ static void spitz_common_init(MachineState *machine) SpitzMachineState *sms = SPITZ_MACHINE(machine); enum spitz_model_e model = smc->model; PXA2xxState *mpu; - MemoryRegion *address_space_mem = get_system_memory(); MemoryRegion *rom = g_new(MemoryRegion, 1); /* Setup CPU & memory */ - mpu = pxa270_init(address_space_mem, spitz_binfo.ram_size, - machine->cpu_type); + mpu = pxa270_init(spitz_binfo.ram_size, machine->cpu_type); sms->mpu = mpu; sl_flash_register(mpu, (model == spitz) ? FLASH_128M : FLASH_1024M); memory_region_init_rom(rom, NULL, "spitz.rom", SPITZ_ROM, &error_fatal); - memory_region_add_subregion(address_space_mem, 0, rom); + memory_region_add_subregion(get_system_memory(), 0, rom); /* Setup peripherals */ spitz_keyboard_register(mpu); diff --git a/hw/arm/z2.c b/hw/arm/z2.c index 9c1e876207..8eb6f495bc 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -299,7 +299,6 @@ static const TypeInfo aer915_info = { static void z2_init(MachineState *machine) { - MemoryRegion *address_space_mem = get_system_memory(); uint32_t sector_len = 0x10000; PXA2xxState *mpu; DriveInfo *dinfo; @@ -308,7 +307,7 @@ static void z2_init(MachineState *machine) DeviceState *wm; /* Setup CPU & memory */ - mpu = pxa270_init(address_space_mem, z2_binfo.ram_size, machine->cpu_type); + mpu = pxa270_init(z2_binfo.ram_size, machine->cpu_type); dinfo = drive_get(IF_PFLASH, 0, 0); if (!pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE, diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index c26007e57f..ba8f49e48e 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -193,8 +193,7 @@ struct PXA2xxI2SState { # define PA_FMT "0x%08lx" -PXA2xxState *pxa270_init(MemoryRegion *address_space, unsigned int sdram_size, - const char *revision); +PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision); PXA2xxState *pxa255_init(unsigned int sdram_size); #endif /* PXA_H */ From patchwork Mon Jan 9 11:53:06 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: 640616 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2100103pvb; Mon, 9 Jan 2023 04:18:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXtcL6I6dW562cN1nUKiA/Sa8HplD2iA8ODwScbblEN1jCzhgp2Cd4VeJ/4Q/D5qcXlaRalg X-Received: by 2002:ac8:47c4:0:b0:3a7:e1d5:3429 with SMTP id d4-20020ac847c4000000b003a7e1d53429mr84015541qtr.22.1673266698810; Mon, 09 Jan 2023 04:18:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673266698; cv=none; d=google.com; s=arc-20160816; b=CA6txpKlRC0q+fQ9WHruHWSLWGO8pMxombu3WVMHBv7sCKRhlniVCsN3hn0010XC9Z cqTjHHmeB5LP7LR5NZfXJyGVdddcGI7sW2WoOip7ZXnrAyHmLc9B9xkWEWwZ8JTZwdwO r4+ll3hJ3g/jogcaI2CoXQ7C+paA1QHBbBMh/XHgLlscfQYdP5eisD32W2TYc3zsfn7l AHfMJgKXzShQzsbdXWsqTt8Movm4cm6dIsrHN9x4PCecJVoa5d2HiUcJfYwx2xQQBj95 EYCqcU3nBu2LCS9GnV81j6cGULiZxA2nLV9pc88a2HqiqeTx23dF2GPIjzEEbSkOrbLL T53Q== 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=kABC6Dg8afXn22QWktdCfTPtG/Bv98gX9IL+lt9WyQQ=; b=lDP4E0/cPNlv/oblvSmBBpdQB2h6NV4PB4UetlOrKe/b/ynoZF+rAkaBaTpy+v0Hu9 aAzcOCxAANTN2utCqmwcJ2yW6+RT5oyHpFqRozAZAvNRlxzZIU8fIefO9vGMBIPu0tdM 6BLaxZYVbDk6a8miNsuJhTP5biY0a4NnxoJUkMNCjy0uqZ8En3Uh7uiqU39MWKgY+CGa sX9OOKQNsp71Z5D/8RFQxP0nrGQQtt1dYb9ogpAonC425Dy0zxw5esWMNKShrPNosyFh a6woBqhidNOOku0pdDY4kQ2pX4qdZ3j+qqNEZEA+cLj5U2Ch5bMOV+ZiO1JjyoJrCd9/ On1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MpY4iZiX; 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 b15-20020ac8678f000000b003a55c9ed459si4196883qtp.561.2023.01.09.04.18.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 04:18:18 -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=MpY4iZiX; 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 1pEqil-0002t8-Kk; Mon, 09 Jan 2023 06:53:43 -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 1pEqid-0002re-Iq for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:35 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqib-00082Z-Ss for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:35 -0500 Received: by mail-wm1-x331.google.com with SMTP id i17-20020a05600c355100b003d99434b1cfso6480301wmq.1 for ; Mon, 09 Jan 2023 03:53:33 -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=kABC6Dg8afXn22QWktdCfTPtG/Bv98gX9IL+lt9WyQQ=; b=MpY4iZiX5WIaoEoozJxdF8cC26tBpsQTe6o+9CeNBtAyqsEBH1emKIrLxEM+A8qBBw QyHaQUQBSRie0wFHpyW+VKScOudKrvYGYqLsAuRksLZOJW0P51NGY8IbaTeZ62npMLXS LNOo6JNc4fxZr7Mc23wmUr7x0O16A/ldOp5f3VwLM/MfTy0TWi6A1m20kN1O2kddPNEB FetHlSO5ayv7NSwc5OqG6yThPjgMWdmMe3/FvIlDX4OUWWR0+Q3lzTik74w5xtLeDBjK i6O/NixQs7CvhX24quiwoAnDde6cMqCW4DstQk8V9ZQHjPsus115ytlwQ8mJHIgTAtgq 3hIg== 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=kABC6Dg8afXn22QWktdCfTPtG/Bv98gX9IL+lt9WyQQ=; b=6sY0LS0HhJ03Mtv/1QVt63uJSsn6ALLlyKhTL12PYlxYtp97QBk9L43WDqxc5scUNF jO0LjQtmFCrdIobkuMIxbyhZfAyj2iH0e+IPbPX+y+CogyUbkInBt30LIJw3cNyVHpMo CBmo9iLxkfovgPkNSBpJe71youJ+r6CoYtNLkvV++Lkm98TZuwtnUHfYyuhwx4NAXHui 15csl5qwQ6hIzf2fieqHR4+DsevJGvT4cCdethPtkNmqCPLLKCf1thXOkeRfhYcNiyKq 4hUgT/YGfRxf8nH8lI1fl5pYpIIaNekHFa0jAPushH94Uqd+wZllyS1iUwf9wLt38Nah LeEw== X-Gm-Message-State: AFqh2kpjEZuhj/pP8pJ0CZquaKIqWuewV3M0pRzzbAg8hDH6z8nBKHAL AUhtP5rQgbeMAKeU1nWKwaoMwweILPZ2yHEw X-Received: by 2002:a05:600c:4fcf:b0:3d1:d396:1ade with SMTP id o15-20020a05600c4fcf00b003d1d3961ademr45806891wmq.9.1673265212398; Mon, 09 Jan 2023 03:53:32 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id f28-20020a05600c491c00b003d9bd56e9c1sm10568247wmp.11.2023.01.09.03.53.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 03:53:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 03/13] hw/arm/collie: Use the IEC binary prefix definitions Date: Mon, 9 Jan 2023 12:53:06 +0100 Message-Id: <20230109115316.2235-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109115316.2235-1-philmd@linaro.org> References: <20230109115316.2235-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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 IEC binary prefixes ease code review: the unit is explicit. Add definitions for RAM / Flash / Flash blocksize. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/collie.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/arm/collie.c b/hw/arm/collie.c index 8df31e2793..d59c376e60 100644 --- a/hw/arm/collie.c +++ b/hw/arm/collie.c @@ -20,6 +20,10 @@ #include "cpu.h" #include "qom/object.h" +#define RAM_SIZE (512 * MiB) +#define FLASH_SIZE (32 * MiB) +#define FLASH_SECTOR_SIZE (64 * KiB) + struct CollieMachineState { MachineState parent; @@ -31,7 +35,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(CollieMachineState, COLLIE_MACHINE) static struct arm_boot_info collie_binfo = { .loader_start = SA_SDCS0, - .ram_size = 0x20000000, + .ram_size = RAM_SIZE, }; static void collie_init(MachineState *machine) @@ -52,14 +56,14 @@ static void collie_init(MachineState *machine) memory_region_add_subregion(get_system_memory(), SA_SDCS0, machine->ram); dinfo = drive_get(IF_PFLASH, 0, 0); - pflash_cfi01_register(SA_CS0, "collie.fl1", 0x02000000, + pflash_cfi01_register(SA_CS0, "collie.fl1", FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - 64 * KiB, 4, 0x00, 0x00, 0x00, 0x00, 0); + FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0); dinfo = drive_get(IF_PFLASH, 0, 1); - pflash_cfi01_register(SA_CS1, "collie.fl2", 0x02000000, + pflash_cfi01_register(SA_CS1, "collie.fl2", FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - 64 * KiB, 4, 0x00, 0x00, 0x00, 0x00, 0); + FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0); sysbus_create_simple("scoop", 0x40800000, NULL); @@ -75,7 +79,7 @@ static void collie_machine_class_init(ObjectClass *oc, void *data) mc->init = collie_init; mc->ignore_memory_transaction_failures = true; mc->default_cpu_type = ARM_CPU_TYPE_NAME("sa1110"); - mc->default_ram_size = 0x20000000; + mc->default_ram_size = RAM_SIZE; mc->default_ram_id = "strongarm.sdram"; } From patchwork Mon Jan 9 11:53:07 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: 640608 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2091079pvb; Mon, 9 Jan 2023 04:00:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXvuSOaJAfZ9xPUcnf/DXA5A7LoyZDsA6jObhYYfra7TbhdmIlY2BhFLPVVrxP1/49VIxNYg X-Received: by 2002:a0c:b3cb:0:b0:531:c556:c2ce with SMTP id b11-20020a0cb3cb000000b00531c556c2cemr39875333qvf.16.1673265601586; Mon, 09 Jan 2023 04:00:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673265601; cv=none; d=google.com; s=arc-20160816; b=iCXPahDHnECqunIxNys3I1YqvncZQzhlUaF18J6R/DQGIpoRuk2GwRyr5Imt9lYfEO C13u4PFd5+A3F+pp5M34thWXGFdSwP0iFnhua1yVBIwo7/JHVp0u03r20dvdKRSuzfBH Af1y+GXEH6NBOp7L6iYuWSpCMncxsvKpq+qv1U0hW/gdlbZMDQA4/vSULlqXtDtA8FXa txHyJrtE2k5StuFCMzbMCoRI4uZXXpIBB2tKBmnrJYO5Giloqlkb5RKQAKNEn4joZcVC 6jfPgdHk5EP+Khd5dOKg3ql8VzcUT0+A3CpVtPerwTNrCdobTfyttyiRXgK0dL5l6Zxs c7fQ== 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=arGDJqPATELoiqCitRXAST5VMx8cy/N7Kqb6K/IJ2aQ=; b=0BzooBydwEEkHSNaAlNc/I6u0AqOFeOVZwvvuwL+2Oueb9aNkPhOgJt1bu+uBQmKOd wsQblp5gYBxNJbC/WsfFpyyqVUyTxCpcSuLJgnWO4IcO5Y0Jl+BKh+ppyV76MpZVORjc OXqCzi+jn7+8w2NQeRUQ+fhIcBR387eD5MAzUDAAWIAK2ApSmRx+hwU6600R8OUENbNp r3gXfKw6ywy9s5Ej+uNX6fIYxbTP3QqpGskQ/j6z9N9X0wTHSTfHmLfvmIBzFPqsXaEk StGR4cyO1JrdWTSOZcVtyWXFwGpLOorJ1k7dbW8+pDLBfIGO//7COlcHqNcHUue8OTbw eqBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y8zzCrgT; 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 w5-20020a05620a444500b00704f6874e7fsi4631435qkp.472.2023.01.09.04.00.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 04:00:01 -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=Y8zzCrgT; 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 1pEqiu-0002wq-KZ; Mon, 09 Jan 2023 06:53:53 -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 1pEqih-0002sU-Rc for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:40 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqig-00082Z-8s for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:39 -0500 Received: by mail-wm1-x331.google.com with SMTP id i17-20020a05600c355100b003d99434b1cfso6480506wmq.1 for ; Mon, 09 Jan 2023 03:53:37 -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=arGDJqPATELoiqCitRXAST5VMx8cy/N7Kqb6K/IJ2aQ=; b=Y8zzCrgTut6jgjD+2PJJkoxwC8GTlfXoG3Y6pHmori7AkAM9EIXts79gGfuYdKWTnM Lp4IfJpjqJ6ygvjqPHSf/FrlJYQ0VTUbWLjg8UMsHdRfLMq41uhL+Vy8KMxCjafgV3l2 nn2EeN4u+ET6PQaj7MNOoRaea9dmORXobnGLJcHRlV200nrIDq4mRQQTuJ8EhcCTcs/x P8L5WuWUPzj7Ri7gVD2iuT68cyjV6CUIhm2utjEzFD6xdlqmOiHYGf5ZOTyPfxnyOtYL 8zjkVr425b44r+EmKsJg/RdE7u/gn8ZZl8OaG+Q6I/RutHUHEnEg18WRmGh7HT2NYQmn 6YFw== 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=arGDJqPATELoiqCitRXAST5VMx8cy/N7Kqb6K/IJ2aQ=; b=U2oPdQbICErce7QJVvqXweWbWzdH+JKDi0shxj1FcEZ6sa/OZZOSljJ9pNcg1NVekZ dDH+ehcmXewWblN6FY3ICKZbIhVO964eIeTXtbPPTEwkz8yBx826cJGlD/7UmsLf/1my nVkutypjUlolmLv1jMXPS1munA7N8QE1/D/gFaios54Xeidrv7LjTEXPAPMXJqh9j2ha DVDUjBrKfe3bjBF6iqQmNJmkHjWbfZBHsyg/ewLvEWbihydbOmKCNL8ZYdjt1pixPkrF iUNNK9oRRMHCnxp8FEIwD7/XAI58+tbfNgSzWX12PD3wU9+bn3V4isqUSbH51X3MpJyH OGZQ== X-Gm-Message-State: AFqh2kra7xMN+fUywgn5hgWUJGwMOdnyJpWvN4NzGdJBDh10bf4id9zx l+BNSUJqpjxH5Fq5RgU4o24MH0cB16f5xsdt X-Received: by 2002:a05:600c:4f48:b0:3c6:f7ff:6f87 with SMTP id m8-20020a05600c4f4800b003c6f7ff6f87mr46835458wmq.11.1673265217427; Mon, 09 Jan 2023 03:53:37 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id f19-20020a05600c155300b003d98a7aa12csm17525389wmg.16.2023.01.09.03.53.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 03:53:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 04/13] hw/arm/collie: Simplify flash creation using for() loop Date: Mon, 9 Jan 2023 12:53:07 +0100 Message-Id: <20230109115316.2235-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109115316.2235-1-philmd@linaro.org> References: <20230109115316.2235-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/collie.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/hw/arm/collie.c b/hw/arm/collie.c index d59c376e60..9edff59370 100644 --- a/hw/arm/collie.c +++ b/hw/arm/collie.c @@ -40,7 +40,6 @@ static struct arm_boot_info collie_binfo = { static void collie_init(MachineState *machine) { - DriveInfo *dinfo; MachineClass *mc = MACHINE_GET_CLASS(machine); CollieMachineState *cms = COLLIE_MACHINE(machine); @@ -55,15 +54,13 @@ static void collie_init(MachineState *machine) memory_region_add_subregion(get_system_memory(), SA_SDCS0, machine->ram); - dinfo = drive_get(IF_PFLASH, 0, 0); - pflash_cfi01_register(SA_CS0, "collie.fl1", FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0); - - dinfo = drive_get(IF_PFLASH, 0, 1); - pflash_cfi01_register(SA_CS1, "collie.fl2", FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0); + for (unsigned i = 0; i < 2; i++) { + DriveInfo *dinfo = drive_get(IF_PFLASH, 0, i); + pflash_cfi01_register(i ? SA_CS1 : SA_CS0, + i ? "collie.fl2" : "collie.fl1", FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0); + } sysbus_create_simple("scoop", 0x40800000, NULL); From patchwork Mon Jan 9 11:53:08 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: 640628 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2104025pvb; Mon, 9 Jan 2023 04:27:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXszuDe7jsGL+xSUwsi+J8pYD3MWFZCAPZDxcoA6HT/DsHXlnHNNWeae0BQrLx14z5iVCKZ3 X-Received: by 2002:ac8:6641:0:b0:3a9:7f7b:b9b0 with SMTP id j1-20020ac86641000000b003a97f7bb9b0mr80428502qtp.45.1673267263024; Mon, 09 Jan 2023 04:27:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673267263; cv=none; d=google.com; s=arc-20160816; b=GiPnQ0kzAiJTZ7vgdZ3QSJXqPCkaHpzuOR8AL73xqSlKwUxiSxOdxUGtVLL8+ZhKxt xo8gQH4P1U60YkAG5li8pCc/eUSRk31zwYO5IWImxhVbxShxMB9n9kxPPEOa9TlB9Rre 50Rb1BOTURrw1Qcv8RQYCFVVi1N/cxKCc1vfZlh1Yf37uc6WlCkXus0d7wKaNUzYNdKi EpxI+s+98Ve/BnMBdM9DXr0FkuYTTu4K725bg0nZ07aupKSfhDu6FL9lKRIM4kunJ7U1 6ZLk95iz9WGgSlIDslLnJcJMG2Eyu3yBf2VQtkgFk4oHO3eZNuuQRM4ymJmTQ44mhF/0 HhCw== 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=EJ06rBglje6LQ6jpsdeFNJpw4LirYI6I0MIC3DLWsPw=; b=eAes2IRJ7RD0SzrAmfbqKHAuoXc7YoI9fGN9dohzF0uKL5ATP5IbVIQfx4uqUtXwI0 2SpgdCBdZe6lbB21sq/hlqA9WjnorMJGvE2xGT/w2DpB1O5fGpszwJ/so77qT5GN0ENE ZN/m4URYLIE642tLcWB41Z1bCiDsnV9Xo+MAnCB82EtPNd8CxpHFw1J274/QdDIhnj4v ZY2EtIjDTXxWpYxjIVciu+3AP/POZEezV75JYarSw8N7BHsfOyl1Hbig7t1vfMJMd722 fzWmNJXqLpCZPIJFw41O6kT90Rq3yMamY1EVWxKUHNhtNt6l7AeouDud9XyppmTK2rgc PgDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PamQoxSw; 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 b15-20020ac8754f000000b003a6894892d2si4326673qtr.736.2023.01.09.04.27.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 04:27:43 -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=PamQoxSw; 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 1pEqiw-000340-3O; Mon, 09 Jan 2023 06:53:54 -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 1pEqin-0002wx-GB for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:50 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqil-000854-U0 for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:45 -0500 Received: by mail-wm1-x336.google.com with SMTP id o15so6057773wmr.4 for ; Mon, 09 Jan 2023 03:53:43 -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=EJ06rBglje6LQ6jpsdeFNJpw4LirYI6I0MIC3DLWsPw=; b=PamQoxSwf3OOa2/AyFS9ESEXv6sXNnK+HmuzgQl1ERFY3ruy7tMea17qpNwXFcK2om L3I1FWzbFrQITkkvliS9NTwjo7jTPBegBF4QEwyTNaXer8dyXQUoP/Z4e5yZAgKGuRFX KtGGsNAIjcodQI8KVOFHSi9DB5PKTNIUYDiT8OaAUEUSw2dG59nNSG6jlJhSwcu5lqrU J5Qu85sqil+MWOsZL25p6r7ly/46IKCBsPF9eL20d/Tto7qC6e7XQDlERVlBpS16z3xs qtZirSuHPZzXGIixUi8bCcjAD5azcLbiEeHcTC8c2+CTz85zkKBQpwzhHNbLaNlRYTaQ +kgQ== 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=EJ06rBglje6LQ6jpsdeFNJpw4LirYI6I0MIC3DLWsPw=; b=a68iuZbFNI6D80NUqUh6Ot9Cq6moMotnQmeidTBIjzXLFRO27qfPBezCCCDOqgqCsq CoYj9SN4uIGwTw0S2Ir6ViZAXDTC9BgfIhziEImUlIsYiL1zOTzQWw0PsOH+wF7qd8YU UTzxGpzFl4Mi3PWJ4D0e9oH2Unxlo89XpabFOVi+4zreN7MVtaWmRMfoulgs01yMDYnB xOaBe7WKndXfs7ykDhEeDPbznoISUCGPGDfR4I4zAPhalW1NFZQbibA6REfBGyEUTCM5 SQij19ZmXeU8OFKAcOVi+774EZd259bfDuEsGc6/orcqm1j8MlXVnaAQSQNlziDph8pC jXOw== X-Gm-Message-State: AFqh2kocGMQAXgDC78o7Y1Bpnq/x4og05hBak0NUkOp6paGb4xOGKulX 8N9VVe9jHHfBIet2j2yzumbeIziL6Pxv4Wh+ X-Received: by 2002:a05:600c:3490:b0:3d9:ed39:8999 with SMTP id a16-20020a05600c349000b003d9ed398999mr3425285wmq.35.1673265222407; Mon, 09 Jan 2023 03:53:42 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id bg23-20020a05600c3c9700b003d1de805de5sm12616481wmb.16.2023.01.09.03.53.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 03:53:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 05/13] hw/arm/gumstix: Improve documentation Date: Mon, 9 Jan 2023 12:53:08 +0100 Message-Id: <20230109115316.2235-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109115316.2235-1-philmd@linaro.org> References: <20230109115316.2235-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 From: Philippe Mathieu-Daudé Add a comment describing the Connex uses a Numonyx RC28F128J3F75 flash, and the Verdex uses a Micron RC28F256P30TFA. Correct the Verdex machine description (we model the 'Pro' board). Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200223231044.8003-3-philmd@redhat.com> --- hw/arm/gumstix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c index ab9b0182f6..89c15bee75 100644 --- a/hw/arm/gumstix.c +++ b/hw/arm/gumstix.c @@ -10,7 +10,7 @@ * Contributions after 2012-01-13 are licensed under the terms of the * GNU GPL, version 2 or (at your option) any later version. */ - + /* * Example usage: * @@ -64,6 +64,7 @@ static void connex_init(MachineState *machine) exit(1); } + /* Numonyx RC28F128J3F75 */ if (!pflash_cfi01_register(0x00000000, "connext.rom", connex_rom, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, sector_len, 2, 0, 0, 0, 0, 0)) { @@ -93,6 +94,7 @@ static void verdex_init(MachineState *machine) exit(1); } + /* Micron RC28F256P30TFA */ if (!pflash_cfi01_register(0x00000000, "verdex.rom", verdex_rom, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, sector_len, 2, 0, 0, 0, 0, 0)) { @@ -124,7 +126,7 @@ static void verdex_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); - mc->desc = "Gumstix Verdex (PXA270)"; + mc->desc = "Gumstix Verdex Pro XL6P COMs (PXA270)"; mc->init = verdex_init; mc->ignore_memory_transaction_failures = true; mc->default_cpu_type = ARM_CPU_TYPE_NAME("pxa270-c0"); From patchwork Mon Jan 9 11:53:09 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: 640644 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2119725pvb; Mon, 9 Jan 2023 05:02:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXtm7H9rdYvoxtCuRHxgUS1diS4fkCLl5587XXJ5qHp1Iy+v79zGN6kMkmaNnpX7jFmgrS9B X-Received: by 2002:a92:c885:0:b0:30d:a57c:904c with SMTP id w5-20020a92c885000000b0030da57c904cmr3271302ilo.4.1673269348108; Mon, 09 Jan 2023 05:02:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673269348; cv=none; d=google.com; s=arc-20160816; b=dogbeCGo2uARdKbJ5tPMRsKlx4gN/Y1FXb1OCeU5Yugh7RrIGnKoT/rCE9amJTC1hW /MVuHuTOkKXjfwFxSAHu8jXG5FBzdCfwU/bHlua9zmtNAX+kUdc5/fU7FDhwYvUhKSCl z8Dkzx4l9HOdp+NEMic+nq65tV7QWKfzFSRPV9vRxLnVRwQjv8lGOzlWcIIKnMjRtYQz nhKsfL7qzFZPjm3C9jVz+cx1hcjm5/5yLWFLwdiI3qEQk+pyZNnXuvxqLT03ZYCsZqCz g4KzC8w03WuS4DODht5jfUROnlaUMOHCWgCQpmIxRjhr7YXHG0zxLYjWWTUM9N5igl0c 5L8g== 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=d549zrbSVj2+hdi6d6L6mPBf616eqZGm0GWt6kYTTIs=; b=Wm8q8SuuS4GBeNSGKNSTFzEKnvlBRH24GJJAc5mz3diT8olWNWM80czWXMRvv8uBB0 2VasDq3vDPqxFHCoOUF7PthWlwqmiK3EBMyGl0pGMhKw2Zke7QqIF0rM9vKdrVBUnnzc 613S+S4XhFdUCofigFCkLwi6ATo18fEgogqLvzdgmEql/MpvcPmFsOn+OWyQZRcP14YD JDhGhP6YyVYjevZqLcriSyLAsSKgpeKoJHwohNVH0TRtREuCcjkNghwZSgB/Z5PAfV54 7OE4mtz9IAg9XX+V8f7lJZD2o0gpXD6IEe3DzNPONst1HSFyC0meEqwnvEiuj8/en1h3 zUhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="QGsKjWi/"; 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 y15-20020a05620a25cf00b006fec4421824si4559620qko.667.2023.01.09.05.02.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 05:02:28 -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="QGsKjWi/"; 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 1pEqix-00034o-8M; Mon, 09 Jan 2023 06:53:55 -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 1pEqis-00032h-K2 for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:52 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqiq-00085r-Vw for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:50 -0500 Received: by mail-wm1-x32f.google.com with SMTP id p1-20020a05600c1d8100b003d8c9b191e0so6464827wms.4 for ; Mon, 09 Jan 2023 03:53:48 -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=d549zrbSVj2+hdi6d6L6mPBf616eqZGm0GWt6kYTTIs=; b=QGsKjWi/U6qI6cQcswl5uKfo4M3xmsY6vSuTJenV2Lvaoxr4JDdW8MNWdHXgn4vcJ5 QS/DTveG8wha0+2NM8v/JNF6L0ozrLKkOcgV9FrqdT2lB82HfuwOTdlPyfQMBJHjSv7h EGj8rC+5WmJMhZDWtmxAgPKOYfXzIQ3xCVozuVLfh0t5Wyd18BT29BQ/xOGR/bdWgX+T 8YH33u72FcAj0HV5O5ohPCybK9irLqMRb39IUl8nGUJAXfMBd0tPh6VPEOXD6MzXkrfn 06LHtOOd9qp+IBI3hzWdYQ1940l/ZAgdhK7LntXOZi+tBj2DTEC77jzWAO234CABDLgM 4ZpQ== 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=d549zrbSVj2+hdi6d6L6mPBf616eqZGm0GWt6kYTTIs=; b=hwX07fWwCjd8gXU5oESljD5pT4ly5h+xG82s8m2VWixPbqj53Pgzq34GKGGBPJgf0j cb681TfEX55pTAykyewQ1tEfWpwauP6tpGypHMdewf5noWsWoxoplFRnFg/MKN4gi925 zFIAMStl1O8BbrhOvplXZPwtkCH41PHyUeBe3ThaquStbW4ImM0osXgLVZfYL8K5I1Ny 5Qulk/DLJ9ZqahpMcn6MMy9r2VBBecJ+dX2zb/ynLdhGloT7Pu5Jbtc72Kn89F3fxa43 mPeigaiyV/UuIsIjRj6DcUF1zPLh0YTc58xBH1SMfbIEJso+iOQL++obhmTMfO78+pFV Wc6A== X-Gm-Message-State: AFqh2krsJGSetmjdLOytrNzDoLeW9iXiBSsuaN/9dJq6S0UMTzuF3lGp qyOxzUqkUX1Uq3Ui1fS9Xpnv52tPi0UJQT5P X-Received: by 2002:a05:600c:3491:b0:3d1:f16d:5848 with SMTP id a17-20020a05600c349100b003d1f16d5848mr46707787wmq.26.1673265227376; Mon, 09 Jan 2023 03:53:47 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id f28-20020a05600c491c00b003d9bd56e9c1sm10568885wmp.11.2023.01.09.03.53.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 03:53:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 06/13] hw/arm/gumstix: Use the IEC binary prefix definitions Date: Mon, 9 Jan 2023 12:53:09 +0100 Message-Id: <20230109115316.2235-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109115316.2235-1-philmd@linaro.org> References: <20230109115316.2235-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé IEC binary prefixes ease code review: the unit is explicit. Add definitions for RAM / Flash / Flash blocksize. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200223231044.8003-3-philmd@redhat.com> --- hw/arm/gumstix.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c index 89c15bee75..579d363577 100644 --- a/hw/arm/gumstix.c +++ b/hw/arm/gumstix.c @@ -35,6 +35,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/error-report.h" #include "hw/arm/pxa.h" #include "net/net.h" @@ -45,17 +46,20 @@ #include "sysemu/qtest.h" #include "cpu.h" -static const int sector_len = 128 * 1024; +#define CONNEX_FLASH_SIZE (16 * MiB) +#define CONNEX_RAM_SIZE (64 * MiB) + +#define VERDEX_FLASH_SIZE (32 * MiB) +#define VERDEX_RAM_SIZE (256 * MiB) + +#define FLASH_SECTOR_SIZE (128 * KiB) static void connex_init(MachineState *machine) { PXA2xxState *cpu; DriveInfo *dinfo; - uint32_t connex_rom = 0x01000000; - uint32_t connex_ram = 0x04000000; - - cpu = pxa255_init(connex_ram); + cpu = pxa255_init(CONNEX_RAM_SIZE); dinfo = drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { @@ -65,9 +69,9 @@ static void connex_init(MachineState *machine) } /* Numonyx RC28F128J3F75 */ - if (!pflash_cfi01_register(0x00000000, "connext.rom", connex_rom, + if (!pflash_cfi01_register(0x00000000, "connext.rom", CONNEX_FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - sector_len, 2, 0, 0, 0, 0, 0)) { + FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0)) { error_report("Error registering flash memory"); exit(1); } @@ -82,10 +86,7 @@ static void verdex_init(MachineState *machine) PXA2xxState *cpu; DriveInfo *dinfo; - uint32_t verdex_rom = 0x02000000; - uint32_t verdex_ram = 0x10000000; - - cpu = pxa270_init(verdex_ram, machine->cpu_type); + cpu = pxa270_init(VERDEX_RAM_SIZE, machine->cpu_type); dinfo = drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { @@ -95,9 +96,9 @@ static void verdex_init(MachineState *machine) } /* Micron RC28F256P30TFA */ - if (!pflash_cfi01_register(0x00000000, "verdex.rom", verdex_rom, + if (!pflash_cfi01_register(0x00000000, "verdex.rom", VERDEX_FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - sector_len, 2, 0, 0, 0, 0, 0)) { + FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0)) { error_report("Error registering flash memory"); exit(1); } From patchwork Mon Jan 9 11:53:10 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: 640612 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2098044pvb; Mon, 9 Jan 2023 04:13:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXsnDmJ/MuoUcLTxFatXgOoJnEgqvTEHC5aCnDff80uboLrRs77fPAtYkstBLzAQfDfUFYG6 X-Received: by 2002:a1f:a242:0:b0:3bd:9713:f6b9 with SMTP id l63-20020a1fa242000000b003bd9713f6b9mr30816693vke.9.1673266414198; Mon, 09 Jan 2023 04:13:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673266414; cv=none; d=google.com; s=arc-20160816; b=bdY+D+/sDSk6gxGnC58PjtOgdKP7lvFJQvGEx3uZuzdQr9pxhaU3N9igHfQeGVkybg f2j4YWvY/DCXYKXWGTXTzMdFZHDtk19+Yxp2OTvL45ZvHo45b3RyYlqKvZw9n7ni6dkB wUn0rmLZTgUPagk5H90M/94M9dBaw21dyzvJvmAp+HtGW8iDe/OntUTH338AuZKPPX8e a1olTnM98UHyjDBtafWOznzKndNFg/AR8MjfM1Lakhx1aMnlkoWqaje+wOB15NTY4Cyx CAqtuzcQ1hFyZkJfNoanF+P+sN9FBa2EuhJatQiDUlqM5B6X7RLJJvgY6f4iClh27SUe p5iQ== 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=8ERSy5wcRjjSecTdAN061YLtBrODzsMdgJY9d4shct4=; b=wnjtMMhmQCOyNiEOxAOkwYCCvregAZ+OdJDX1B666LS31s+y0vCrtYx3BDWvkSaV8Z v9U2i7ZqX5xZyAWtE+DOALZR6i77uiJ0JIw6pV0s3T4pDT59xjCF+BQ9B6gefL60nq9o X0PfjuNEEUkAS2hM4MsPsiMEJXp6+XN+AGMNBKe/tLjwx0EHD97sZIoZcyzBPP6uKi2N hy3cAwSZiCOCd9Jhc2ylyahe4n2KWj+QtMspjJGAJW/Bnn8h8YU8iiRu+kLkZNjLCy8D aba4xnFQRUhfo/HShZwMEyN8qvn28cl4jLEf5W/0asidle0uwC/ts2qs8Kyma3GOr77W S0Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kaLTikEk; 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 o74-20020a37414d000000b006fc9b13832csi4198760qka.446.2023.01.09.04.13.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 04:13:34 -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=kaLTikEk; 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 1pEqiz-000369-4X; Mon, 09 Jan 2023 06:53:57 -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 1pEqiw-00034R-Qz for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:54 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqiv-0007tT-4J for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:54 -0500 Received: by mail-wr1-x42a.google.com with SMTP id d17so7892768wrs.2 for ; Mon, 09 Jan 2023 03:53:52 -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=8ERSy5wcRjjSecTdAN061YLtBrODzsMdgJY9d4shct4=; b=kaLTikEkyQPY5JrXFdTQCtS28Mm2WEUsaiRImfff56vAh2qvCDYFB1i4Zwnc6p1ySh lzTMkeI76KM5Mv85kwwWRBOZsDrWQFHJK7lvb4IbdC09g2vBj9MU/rKv493xrAPOiHOc Qg7PtJb8622RbHoiQcT+Q6Mtd04WWOTXwmT+F3F69l1XRuhRCRknUcLZ5/Zp82eWcf3r 13YfUY16jVnMGhktXoWH70VeEMcAGN8wU5SP0PvIMcvuCNAnTMLOZx0ViVJWsfrlv6l3 kccj2FObqosnGEmUMfMc6jfC3DIwYP8YRolXEdzJibSlQGoeNVTrE7XiWBRSpAlr9GOz nIIA== 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=8ERSy5wcRjjSecTdAN061YLtBrODzsMdgJY9d4shct4=; b=sYyl3XW7dxi8n2UMYRcEmRDXN2OnIEvBfaemjnfyd4gpNcLayKT128dhJVUSudaK4M 3VjQbHYNPAuGH2lvC3wixrVN6MSD87aujNi44lB+pPdHBHfimOCmPxjNkHPKxzgHyyg3 56X//51abHDUS2P/XrILdSetGfNbBu5KRJNMFtys+S2iFTe7NEtTWtbeyI7IatUDZAx6 ADwsss3zWo2Aq9gqPPR4fjaYznUQ53skGmJ08ibJ+R8bb/4WppNYDP9Yz4WRXIULYkyF +RmPl3+QJW6rLCCbRIfPPSy9+mv77ttaykRJeay6VF2OLYB196+oIz1t/vLXwR8W3g7P HB6g== X-Gm-Message-State: AFqh2kpXdKiK5MRS7Q+07qZ8MHfSx5rWYvLHHnTlkt47YzZlQvS/bKts uoLNIS36LotA/cExKxCjB3Id0+UM9uBivFpJ X-Received: by 2002:a5d:5b17:0:b0:26f:42c9:a224 with SMTP id bx23-20020a5d5b17000000b0026f42c9a224mr44211101wrb.63.1673265232216; Mon, 09 Jan 2023 03:53:52 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id i6-20020adfe486000000b002423dc3b1a9sm8251662wrm.52.2023.01.09.03.53.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 03:53:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 07/13] hw/arm/mainstone: Use the IEC binary prefix definitions Date: Mon, 9 Jan 2023 12:53:10 +0100 Message-Id: <20230109115316.2235-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109115316.2235-1-philmd@linaro.org> References: <20230109115316.2235-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org IEC binary prefixes ease code review: the unit is explicit. Add the FLASH_SECTOR_SIZE definition. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/mainstone.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c index f6293c6c13..eebaed6e3e 100644 --- a/hw/arm/mainstone.c +++ b/hw/arm/mainstone.c @@ -12,6 +12,7 @@ * GNU GPL, version 2 or (at your option) any later version. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/error-report.h" #include "qapi/error.h" #include "hw/arm/pxa.h" @@ -99,19 +100,20 @@ static const struct keymap map[0xE0] = { enum mainstone_model_e { mainstone }; -#define MAINSTONE_RAM 0x04000000 -#define MAINSTONE_ROM 0x00800000 -#define MAINSTONE_FLASH 0x02000000 +#define MAINSTONE_RAM_SIZE (64 * MiB) +#define MAINSTONE_ROM_SIZE (8 * MiB) +#define MAINSTONE_FLASH_SIZE (32 * MiB) static struct arm_boot_info mainstone_binfo = { .loader_start = PXA2XX_SDRAM_BASE, - .ram_size = 0x04000000, + .ram_size = MAINSTONE_RAM_SIZE, }; +#define FLASH_SECTOR_SIZE (256 * KiB) + static void mainstone_common_init(MachineState *machine, enum mainstone_model_e model, int arm_id) { - uint32_t sector_len = 256 * 1024; hwaddr mainstone_flash_base[] = { MST_FLASH_0, MST_FLASH_1 }; PXA2xxState *mpu; DeviceState *mst_irq; @@ -121,7 +123,7 @@ static void mainstone_common_init(MachineState *machine, /* Setup CPU & memory */ mpu = pxa270_init(mainstone_binfo.ram_size, machine->cpu_type); - memory_region_init_rom(rom, NULL, "mainstone.rom", MAINSTONE_ROM, + memory_region_init_rom(rom, NULL, "mainstone.rom", MAINSTONE_ROM_SIZE, &error_fatal); memory_region_add_subregion(get_system_memory(), 0x00000000, rom); @@ -130,9 +132,9 @@ static void mainstone_common_init(MachineState *machine, dinfo = drive_get(IF_PFLASH, 0, i); if (!pflash_cfi01_register(mainstone_flash_base[i], i ? "mainstone.flash1" : "mainstone.flash0", - MAINSTONE_FLASH, + MAINSTONE_FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - sector_len, 4, 0, 0, 0, 0, 0)) { + FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { error_report("Error registering flash memory"); exit(1); } From patchwork Mon Jan 9 11:53:11 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: 640615 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2099279pvb; Mon, 9 Jan 2023 04:16:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXs0IchbWfVvKHxmYbcxnR8DHTTTH/zMsRdI1arF3BSFnY0PvXk5+2yBNmOf+KMrEktKhfHC X-Received: by 2002:a05:622a:1b12:b0:3a8:a6f:fb7 with SMTP id bb18-20020a05622a1b1200b003a80a6f0fb7mr88196805qtb.11.1673266580890; Mon, 09 Jan 2023 04:16:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673266580; cv=none; d=google.com; s=arc-20160816; b=zbWSqkvKN/Al8Us5NUvFr2RbRjitHpYGMg2R2goXLyeAUshmzw5p0IHh1YUk8dhqel 6I4xTDyCVGFxLcQwABHs4Af93Lim/Ww2N0klkjPdtxW+6xoVZ7v8vcsk6sgrbODtSnWp 0DzDHRU5WTQa0hi33L3XzILK31ZFkeAzpqJk3gBJgjkNHIDpNegwhuNfY/MquG7VlB1a Dj5LdQ15mbWblU8FpRm/IQsV75h9QI7ePLdSo2TTpFUNeNMrv8J11EUMWj5jHdTxrNC7 p2nlVy5sHyrn8PMJhwBtaL4xFwH8NyjWQMBaGJ0Bk73+on69ZpQxksMJDtzMAsK8rnZt utqQ== 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=7S4AtrItDHw6gjUi/DcC6OrJFm3Uy3mqWC4OtemhbH0=; b=rJSTuFHxYz5FVmHZeC76VIsGlog/1xXrbAG2UmRim/xSMrNSRsXJuixLDvvJNe72qI s2Qw74CxQVd/+VWzgiS9Yujcv7FUOdOvNnBJt2teahyA/QCcBFgvFlxb5ElRnN7z1Sd7 5SlsLqTxh9/3WV1EtcjuIdEDu12bAqESqSX2dk9FPVSgbxZ4Cl9by0fjKzeK3xByWk8S E2VNHrQzOT8gumP/v75zXxyNR/ntsaPriRvQkN1iFpXW2GcmsH0Pht8IugoI96c1xCXV ipdxXRly5cW0Ed1kAe1CIAVF3gN4zOpObYeA72dlY928fKQhkAq9Hz0EfEUd0tEh1/BA SnSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pePx4DCv; 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 e25-20020ac845d9000000b003a4f2a458d0si4250475qto.400.2023.01.09.04.16.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 04:16:20 -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=pePx4DCv; 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 1pEqj3-00037a-Bw; Mon, 09 Jan 2023 06:54:01 -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 1pEqj1-000372-V9 for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:59 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqj0-00088K-FR for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:53:59 -0500 Received: by mail-wr1-x435.google.com with SMTP id w1so7885021wrt.8 for ; Mon, 09 Jan 2023 03:53:58 -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=7S4AtrItDHw6gjUi/DcC6OrJFm3Uy3mqWC4OtemhbH0=; b=pePx4DCvFpr8t3cPEDuEXDalYvRffpzgmGQGamHsL1EOAkOREfaNq+rqiSnjahYXQC J0gDBwsga221inhUAmFBKWkx+eS7def5xLicwtg4YNpaVKAEJ5tHVCdwwD2DM0IDKYCz DjDkUeUyO93xME5SE/OIqbMGE66wkbpxLU5zGygju04/PsTEv3pTlASizbOqwB5/hSsb 34+BaYmezJZip6AupL3JhpHzm98AQ5dgBWFfEJ7p3N7k7S9IV28aegNyBS2tRvgr4C7R 4DPlqFR7RhDLHn6iWYONVI8VwiiKWUUMhG5o4oZsn7iMSPM2v81rWuqWHIoJhAaga3KL 58Kg== 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=7S4AtrItDHw6gjUi/DcC6OrJFm3Uy3mqWC4OtemhbH0=; b=ngEBw8LHJbSfEFr3Sp3c9rVdquTZdBo4gyVjdnvFnkol2wsWPHjmPUnrCaa7rF89D8 zK3G1CVjVKoP8cHMiIni7BgSnKH5cGXtnObp2oVrPixrvv/WIUJPbLMvzIveTVkEnbVx uBDSIRCZ3QK2V6U2e+ARj/IlJoK5Q3kLe3PJra2J8alocaKdne/9TY2en6d2GQgaFdZX Y7/7lSPk324GtnZaj8Lgv+nhQ37vTXvFoGieyJTwtvXdnpWfwg2uWg2NRlEGP8b29+zF XbPQV8+XZmQsdsGR621/yylvoQ+ImZZsRsbJDkTqAUkW4mzTtdrDr/pRVsascJuJDrjD ZODA== X-Gm-Message-State: AFqh2kosRhg4HRf8qTCeRbZKfYVrOCVhKay0NkwH2Eyz1biLMqxsoNdP r2CNPO8mRdn3xLrxFjEnOhtq9fFyUuvwetqG X-Received: by 2002:adf:eb09:0:b0:2aa:1121:1b79 with SMTP id s9-20020adfeb09000000b002aa11211b79mr11348107wrn.25.1673265236995; Mon, 09 Jan 2023 03:53:56 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id m5-20020adfdc45000000b002428c4fb16asm8528588wrj.10.2023.01.09.03.53.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 03:53:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 08/13] hw/arm/musicpal: Use the IEC binary prefix definitions Date: Mon, 9 Jan 2023 12:53:11 +0100 Message-Id: <20230109115316.2235-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109115316.2235-1-philmd@linaro.org> References: <20230109115316.2235-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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 IEC binary prefixes ease code review: the unit is explicit. Add the FLASH_SECTOR_SIZE definition. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/musicpal.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index b65c020115..73e2b7e4ce 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -10,6 +10,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "cpu.h" #include "hw/sysbus.h" @@ -1196,6 +1197,8 @@ static const TypeInfo musicpal_key_info = { .class_init = musicpal_key_class_init, }; +#define FLASH_SECTOR_SIZE (64 * KiB) + static struct arm_boot_info musicpal_binfo = { .loader_start = 0x0, .board_id = 0x20e, @@ -1264,8 +1267,8 @@ static void musicpal_init(MachineState *machine) BlockBackend *blk = blk_by_legacy_dinfo(dinfo); flash_size = blk_getlength(blk); - if (flash_size != 8*1024*1024 && flash_size != 16*1024*1024 && - flash_size != 32*1024*1024) { + if (flash_size != 8 * MiB && flash_size != 16 * MiB && + flash_size != 32 * MiB) { error_report("Invalid flash image size"); exit(1); } @@ -1277,7 +1280,7 @@ static void musicpal_init(MachineState *machine) */ pflash_cfi02_register(0x100000000ULL - MP_FLASH_SIZE_MAX, "musicpal.flash", flash_size, - blk, 0x10000, + blk, FLASH_SECTOR_SIZE, MP_FLASH_SIZE_MAX / flash_size, 2, 0x00BF, 0x236D, 0x0000, 0x0000, 0x5555, 0x2AAA, 0); From patchwork Mon Jan 9 11:53:12 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: 640607 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2089862pvb; Mon, 9 Jan 2023 03:56:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXs+fd7wdFYms2N77jIohW9fk+ANsuD42nx5NtDTesiZQ0zh86R+iGnhArhVDiHYiYirNGGM X-Received: by 2002:ac8:4b6c:0:b0:3a8:119f:c0e1 with SMTP id g12-20020ac84b6c000000b003a8119fc0e1mr85761761qts.36.1673265382566; Mon, 09 Jan 2023 03:56:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673265382; cv=none; d=google.com; s=arc-20160816; b=dfiOAWq+y9RLpsMT/FPeTGqMWDjO6ml226YenmIyZGddmBUoRH4ffFxLSdNiX4sP1s Vj4eHyB164EHhli4aWjWNYVJowysYxc/3Hz6W49c38NFn72dUZlHMLTha9soGNtB2mAJ 26FmqSpn8waubj8ujm6LQL7m3Am8dOVFafRmWzp+cOUYHCGBgxxnXYrz9m4KIjfuGlL1 M3GdBiYnXPlg5hMehQwHpuaZhoeVh1vug1OyVs4eqeR6P5GnC0dJrsSOHMxLrPeSXHCb CGMVFVs/baBNlUtsg//U/D01qEU3duvws7g0z7x3K1JCFCbaeKynif3xsIu8E2QFUKnZ JbjA== 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=5Ex3NPUGvPkrE4NbytzYcH01U3eur12SK2WO3g4Dkuc=; b=TUr75Rx0LspZcIjy3Uuro6PZ9kCmja7LuKDF0iCbjfr6faEiqwIAhdJYgFBHyMcKMN sVDpEXdiK4c6iKEMU+erDv50ss2gMIBEEF5IGmgEnvh01OrNfacgEejxDPpViF4PJwOc 4DZApXw77rQ7FA79a7o5rioWuYTjNisN5hcErbi2BtOTlgmudsienZyd4c2zHBNV5jSc EmIUeQ0LbtVU/3uZhXCUrQu5nO4AVhS4pD/fu/FgMYL8GxrN9xg7BHKeGJswuS70Ebwt iozsxfN/RgsN9idb5V53uLDrjN073Fvf49ZffUDmVK1P454fgRW8ie6EfaIovvfa323M goFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=roX9pbyN; 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 g22-20020a05620a40d600b006bb1bf2516esi4858842qko.620.2023.01.09.03.56.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 03:56:22 -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=roX9pbyN; 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 1pEqj7-00039M-TV; Mon, 09 Jan 2023 06:54:05 -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 1pEqj6-00038f-JE for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:54:04 -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 1pEqj5-000896-62 for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:54:04 -0500 Received: by mail-wm1-x332.google.com with SMTP id m26-20020a05600c3b1a00b003d9811fcaafso6468699wms.5 for ; Mon, 09 Jan 2023 03:54:02 -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=5Ex3NPUGvPkrE4NbytzYcH01U3eur12SK2WO3g4Dkuc=; b=roX9pbyNuYzkTx5SFY4T28SUdC6McGy0ZFo+OU3EDN/uBL8CSDu0c/Jz4nzsxvSxC/ PWl/ZbXVxMf76NngqO3p479YO0itIdX4kXx7+Fnx+kNOfhXfx6diBx27Xks/PYNL1Dkk PKSv+wiHAfuaIEef5sqMQrDUyyx0dKTb2Lj9/3z4GE/M22x7y6B8bfH1xeuJFwYhetQp ru9ouXwWk+tATYFui0G7bfilQAXhGSPoe+kjw47W+T9mKZQf2UpCC7SUKq5qr+ed2MeV k+Ytm0LmwBvYWKaifSN3Qf5tDtLgGLD1ggazYklEFtWotkmGNhkdhoZC/LdauWFPyHhk 8IjA== 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=5Ex3NPUGvPkrE4NbytzYcH01U3eur12SK2WO3g4Dkuc=; b=Jubb5yevPA9r5cAwWkXN5D2I2XQUn0Jf3bgst58Yrui3rwvI2ks3KeqwVG0mmM3RRo p+IAVPEmBSH694gmxfC6FaTr9AcZNnB1/jzo8O7arjXKCR60nDY1qqTeHGuhCeF7DVVF A1JaATflbbmjyVvpGg5pJoMOjXNgaOvlu1j9KD2eLo0c9VTda9ymn2Zx5OCYjs+hwdhk HHOMIsTm6X8d5dLHI86Wrl8odJf+I3wEapjiH96Mja3dHOKaV5PeKHdTrsrdbgMzB8CK iMs2YuZgWHQtmBAEWPsJ+KuO54wiQgF3qlNA6UaN8r0mJOgLxnX8szZvtInugxWMGBMU mrjw== X-Gm-Message-State: AFqh2kqoFnT3FiZboeOR68C6t4P8DWu1WPHO4mLMk6uk5fJ1gmiNSFzx tgyA3odUgM73mjzJJZKdaJsXXOKJv1MYZ4Lo X-Received: by 2002:a05:600c:3545:b0:3d9:a145:9ab with SMTP id i5-20020a05600c354500b003d9a14509abmr26827508wmq.39.1673265241710; Mon, 09 Jan 2023 03:54:01 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id r10-20020a05600c458a00b003d35acb0fd7sm16646985wmo.34.2023.01.09.03.54.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 03:54:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 09/13] hw/arm/omap_sx1: Remove unused 'total_ram' definitions Date: Mon, 9 Jan 2023 12:53:12 +0100 Message-Id: <20230109115316.2235-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109115316.2235-1-philmd@linaro.org> References: <20230109115316.2235-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The total_ram_v1/total_ram_v2 definitions were never used. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/omap_sx1.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index 57829b3744..84b7059f7c 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -91,8 +91,6 @@ static const MemoryRegionOps static_ops = { #define flash0_size (16 * 1024 * 1024) #define flash1_size ( 8 * 1024 * 1024) #define flash2_size (32 * 1024 * 1024) -#define total_ram_v1 (sdram_size + flash0_size + flash1_size + OMAP15XX_SRAM_SIZE) -#define total_ram_v2 (sdram_size + flash2_size + OMAP15XX_SRAM_SIZE) static struct arm_boot_info sx1_binfo = { .loader_start = OMAP_EMIFF_BASE, From patchwork Mon Jan 9 11:53:13 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: 640617 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2100683pvb; Mon, 9 Jan 2023 04:19:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXuo9aQZMSyihUv7BA6NunV07YXdEFCHrRl05U9F0TCqfObD1R01kdqcvQ4a68aIFUBVKPRZ X-Received: by 2002:a05:622a:1a24:b0:3a8:a84:7ffa with SMTP id f36-20020a05622a1a2400b003a80a847ffamr119426548qtb.57.1673266774344; Mon, 09 Jan 2023 04:19:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673266774; cv=none; d=google.com; s=arc-20160816; b=t2jFji+kLWdQGKz83pTNn1TeN2juHWFTLDJbNbEfxWREZW8bYi1CCqpNL2aVzWL9hG sHYrGq/uJOu6uY4LU9pyBQuwuZNXazpX3D0v2sn4EqoI/udRURAbUDDTogLuIwmeGHtt 5QezfhiAjuzUzrNHP8BUlFCmObXr1wEqApW1J3pyY+NfoZQqhmN0kUIir6Fh1Knr2klH HmRqzQrsY5WbNNRO58UD3E5tpi+GOQgHeGT8SjhSwO06Us5qck6bzinahpzSgtHlln31 7RlO1ghaQ1Iw4jfNLwvr3XTfhhd6TC901+J5FC7Rt5X3cJSr4E/BtuiwLbw7T4E3g8YJ Ilwg== 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=LVNFvExNkEf16xN6scmGKliquT0uXwHyZsjZ5nnvuPM=; b=Qyeqda69wps4HWfExd0zYu0OfZoBCuISrlSGUVuCqQ6VLWkcRb7lCXXpy3O4H5Rwzr wTHjO6SpDztxIA3bg0bAqPchP53V56k8G6iwWPaYJfnXQihep23fhO4majocBZqdt+7Y L+7F8ChnIggaiRrQt96aULxCr2ozP93Vu6jQP0C9cx7NbX1LyY0b2s0baIZiU8uC13Mp 4QvOalzLwaaOZPzKFi1UsV1EagkheVCQWcv0Nbu3axw/rForDhncTElCkSMTjd7jgg2C c8PWrWoOTLA0n3opis/a18m0pbDoA0EZXNpqezj9Ze1zQguTrP7Bz45pXGmv+QQGiZoP qY7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Sxp/Wg/0"; 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 ck7-20020a05622a230700b003a4d3a5ce56si4547897qtb.245.2023.01.09.04.19.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 04:19:34 -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="Sxp/Wg/0"; 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 1pEqjC-0003Cg-MD; Mon, 09 Jan 2023 06:54: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 1pEqjB-0003CH-Kq for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:54:09 -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 1pEqj9-00089s-Sb for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:54:09 -0500 Received: by mail-wm1-x32b.google.com with SMTP id j16-20020a05600c1c1000b003d9ef8c274bso2113200wms.0 for ; Mon, 09 Jan 2023 03:54:07 -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=LVNFvExNkEf16xN6scmGKliquT0uXwHyZsjZ5nnvuPM=; b=Sxp/Wg/0RMnlrTjkIbq3Ax1cZ0nwKHugsjmteYO0+L7sAJJF5NjXUTKVwwyGAY6Aul VytvzhgnSojuOCWtGgk3AQzWaQgnjpTf5erRSEKztda8vhjNfI6twICPKaMzzsKESs7z MzZpcdDwawoFXImfSAI7s4cw2FaFf/+Ul60su6Pxuf2t/OVIYDLxPEnfqzqVKq5bb5tN h95fNb16cxlXR1Q/p10yASbAx25R3fmv/cPa1pw3oLdxGKeBsy8h8dPyEr1v/5jMUEVn r4g74tFVWizSc6Ej/YAc8CY7+Y/JTXyjq8zVJ4KXwMBNNdFqTvgpWzwfKruPTEjJAfm+ d7zg== 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=LVNFvExNkEf16xN6scmGKliquT0uXwHyZsjZ5nnvuPM=; b=P6A8JvKnxwSz7WNj+xOt/zOq+bAbHUkq8gKDJBfvlg2fId+Tco62FH1Xi31+wkiynz wgBhttcpA64Ytg24LOUILhL4WYcmTxmaHInZX5BWXll1n+cZRbttA3f+6yWkFzJeymas +gym+UfX0WG75+Ie8OPthQ/eWiHrBtNvGA9v9ZmhK2G4rA/MOlkikf57OEbIqNNyiVdk RhQwEbx4lmJmeb+FiOxn1o7zzWC9y0WMPxoCEpPyUS58EjNKF8bZAqF6Jr6jYALu29Mi jXESdOXBeg16/5J/8rR7UQi7tbkJXTSM5Tb7bsnF2OqrIpxe5nBX1j7bQJtDiA9gVZ2j d3nw== X-Gm-Message-State: AFqh2ko8gXEiW+r5y+SI76D86HD1MvxgZ6lSj19FEIMKR2Wu9Db+xgzi 1PD903uP9CIlsuY/u4QJXq4yQ1U3GKM1HErB X-Received: by 2002:a05:600c:3509:b0:3c6:e60f:3f6f with SMTP id h9-20020a05600c350900b003c6e60f3f6fmr45448282wmq.38.1673265246364; Mon, 09 Jan 2023 03:54:06 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id j30-20020a05600c1c1e00b003d9f14e9085sm2706376wms.17.2023.01.09.03.54.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 03:54:05 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 10/13] hw/arm/omap_sx1: Use the IEC binary prefix definitions Date: Mon, 9 Jan 2023 12:53:13 +0100 Message-Id: <20230109115316.2235-11-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109115316.2235-1-philmd@linaro.org> References: <20230109115316.2235-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org IEC binary prefixes ease code review: the unit is explicit. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/omap_sx1.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index 84b7059f7c..d1b0ec3264 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -26,6 +26,7 @@ * with this program; if not, see . */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "ui/console.h" #include "hw/arm/omap.h" @@ -86,15 +87,15 @@ static const MemoryRegionOps static_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -#define sdram_size 0x02000000 -#define sector_size (128 * 1024) -#define flash0_size (16 * 1024 * 1024) -#define flash1_size ( 8 * 1024 * 1024) -#define flash2_size (32 * 1024 * 1024) +#define SDRAM_SIZE (32 * MiB) +#define SECTOR_SIZE (128 * KiB) +#define FLASH0_SIZE (16 * MiB) +#define FLASH1_SIZE (8 * MiB) +#define FLASH2_SIZE (32 * MiB) static struct arm_boot_info sx1_binfo = { .loader_start = OMAP_EMIFF_BASE, - .ram_size = sdram_size, + .ram_size = SDRAM_SIZE, .board_id = 0x265, }; @@ -111,7 +112,7 @@ static void sx1_init(MachineState *machine, const int version) static uint32_t cs3val = 0x00001139; DriveInfo *dinfo; int fl_idx; - uint32_t flash_size = flash0_size; + uint32_t flash_size = FLASH0_SIZE; if (machine->ram_size != mc->default_ram_size) { char *sz = size_to_str(mc->default_ram_size); @@ -121,7 +122,7 @@ static void sx1_init(MachineState *machine, const int version) } if (version == 2) { - flash_size = flash2_size; + flash_size = FLASH2_SIZE; } memory_region_add_subregion(address_space, OMAP_EMIFF_BASE, machine->ram); @@ -154,7 +155,7 @@ static void sx1_init(MachineState *machine, const int version) if (!pflash_cfi01_register(OMAP_CS0_BASE, "omap_sx1.flash0-1", flash_size, blk_by_legacy_dinfo(dinfo), - sector_size, 4, 0, 0, 0, 0, 0)) { + SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { fprintf(stderr, "qemu: Error registering flash memory %d.\n", fl_idx); } @@ -165,18 +166,18 @@ static void sx1_init(MachineState *machine, const int version) (dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) { MemoryRegion *flash_1 = g_new(MemoryRegion, 1); memory_region_init_rom(flash_1, NULL, "omap_sx1.flash1-0", - flash1_size, &error_fatal); + FLASH1_SIZE, &error_fatal); memory_region_add_subregion(address_space, OMAP_CS1_BASE, flash_1); memory_region_init_io(&cs[1], NULL, &static_ops, &cs1val, - "sx1.cs1", OMAP_CS1_SIZE - flash1_size); + "sx1.cs1", OMAP_CS1_SIZE - FLASH1_SIZE); memory_region_add_subregion(address_space, - OMAP_CS1_BASE + flash1_size, &cs[1]); + OMAP_CS1_BASE + FLASH1_SIZE, &cs[1]); if (!pflash_cfi01_register(OMAP_CS1_BASE, - "omap_sx1.flash1-1", flash1_size, + "omap_sx1.flash1-1", FLASH1_SIZE, blk_by_legacy_dinfo(dinfo), - sector_size, 4, 0, 0, 0, 0, 0)) { + SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { fprintf(stderr, "qemu: Error registering flash memory %d.\n", fl_idx); } @@ -218,7 +219,7 @@ static void sx1_machine_v2_class_init(ObjectClass *oc, void *data) mc->init = sx1_init_v2; mc->ignore_memory_transaction_failures = true; mc->default_cpu_type = ARM_CPU_TYPE_NAME("ti925t"); - mc->default_ram_size = sdram_size; + mc->default_ram_size = SDRAM_SIZE; mc->default_ram_id = "omap1.dram"; } @@ -236,7 +237,7 @@ static void sx1_machine_v1_class_init(ObjectClass *oc, void *data) mc->init = sx1_init_v1; mc->ignore_memory_transaction_failures = true; mc->default_cpu_type = ARM_CPU_TYPE_NAME("ti925t"); - mc->default_ram_size = sdram_size; + mc->default_ram_size = SDRAM_SIZE; mc->default_ram_id = "omap1.dram"; } From patchwork Mon Jan 9 11:53:14 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: 640626 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2103209pvb; Mon, 9 Jan 2023 04:25:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXummHvq9FXuF1yA2HlCUqq/vBklulbYgJmcGqwe2m1y7oiSV3gCiwMB4c2CmGMltEPYomjS X-Received: by 2002:a05:622a:229f:b0:3a7:f552:fd5f with SMTP id ay31-20020a05622a229f00b003a7f552fd5fmr87651992qtb.50.1673267151051; Mon, 09 Jan 2023 04:25:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673267151; cv=none; d=google.com; s=arc-20160816; b=NOoPv2C13IGBnrfDUO+5puIet8r5NOrHXrCwE5zLWIlm4pj4L+tbL3qfeK7lHikhS8 rL+orEAuifH+GzVtnB4s2e9GNdJqg2sMz7g1HE8XaQhiVIzrvFPKpwxYTiU4C9c9tYhr VuDhTUey7suVZgNuMYO5UnbdsW1PIa3BdrmOMilfPifcJ5MwaWDrVlR7r0k8ZcKdFdOq NJN/a4OT5RSkVmXcfUx26gvVMLXjEDVYTBM9f362CJWGHWHDcME3fadoob4gw2eOR+IR +/OcimY1q/2tVmDr4Rhvbsa/3MkhA9eflNo/mZINndDHQ+FUNpzKrHGdSy7Grc9rlhtY 9ebw== 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=fbdqJdHQkqZ1zlOSqiHVW5as1b5l8uF3BLsUWk2mkB4=; b=gQYppCRN09qQAKXhOQ24BO2URCirRm6NhHgM+MzDJyJRyiTaTRgOFSeSZwjIWjSVqO vasjaLYTPwbw0LcX6ow9AOD1VA916YvS9Hjj6Po1i7LkN3ilBOCKP0tdhEg70xTuo4Q4 iEC9IrD0MEVvPLWJSuU83puIEzbd/gMsdI1uzHAsMyF7Hzx3Pu2T+cjpkoYmer4JK/cD /6OhFVDWdx4DoSKFhWZHM19Fz/DIZFjl+e+fB1HEDzTWZl16RCiiMb/x4QRAlVSexcY4 VGnnKSfqcPU1qN4yIBRk1Illkpyy0k4Y7P1bSe8VOU1TueLURvjS05n8ubpXHn6MVdTf Jqgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wQJgC4G+; 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 fd9-20020a05622a4d0900b003ad45c0fd12si1341450qtb.625.2023.01.09.04.25.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 04:25:51 -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=wQJgC4G+; 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 1pEqjI-0003EN-HP; Mon, 09 Jan 2023 06:54:16 -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 1pEqjG-0003Dc-P2 for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:54:14 -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 1pEqjE-0008CT-Qr for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:54:14 -0500 Received: by mail-wm1-x32c.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so3968763wma.1 for ; Mon, 09 Jan 2023 03:54:12 -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=fbdqJdHQkqZ1zlOSqiHVW5as1b5l8uF3BLsUWk2mkB4=; b=wQJgC4G+IEut3I7ha9T9Q6SCdf/ps0N9N0nBl7WPF5ylGYc2yWxv26w7MyGPgC33bX ta3/q8NQ5eKoWfOeSanzlghudqEb8+y/0Ik6ZwXwVPN/oSewxVhqfBCktC4Mz+2KsDrl uY3qf444K7xmLcdo/OaX0knUSuuLEehr4KoGug6j4PfuBZVe5x7d8Q2OwljJq5g7aCon tzuYnzROjvqVoa1U+kG2S1X4xarG2br2Dvk/xGrniINVcE6AuNIEU8X7INtpailCXhdY Vi5JICr3tMGj/O6arFa+JD7YHcU1gIxFy3W1kOCLeDJtOkUHk451hZtOLfvrjxkxIIJM 9j9g== 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=fbdqJdHQkqZ1zlOSqiHVW5as1b5l8uF3BLsUWk2mkB4=; b=N10wZLh15qSdlrnNicMTl0UJlIPTJwtIOCkv17+j3OG/8pHHjACbpQeFcaUXtG7EHG XMxYC0MW2SKPu6AB8WvTDuKThODZGPXiFjcm+wrdovqXizG+ThYQHI0J3TNkDUGGBP2W Ave9R6ElFZCFtSjkducMOlfJ1ibh8P26VLtvWnIeRXsl/3bHHIKwMMZ+Vw0na7x+Sixu axSNGeHGR9ZqjV0BxEwzIANg9iRgmgSnBU8EXDl9mJulD8MaO4SoZaSg2gkGwBu5E3pr OeHBnJi+7ZYVzh6T0DKxX7qo2FBgD+yX1YkW2Eq4t1oyqRl96CPWiG3JPSf+YOmixa/Y elYw== X-Gm-Message-State: AFqh2koBUcX5zt2H2bzYdAN3+JJqhat3uC0822Psj6wUpT7NDG9ejebV lbS2n6fAYDvZFqWHwy5uxXi8kyo5ECMosa4d X-Received: by 2002:a05:600c:a51:b0:3cf:6f4d:c259 with SMTP id c17-20020a05600c0a5100b003cf6f4dc259mr44893613wmq.39.1673265251307; Mon, 09 Jan 2023 03:54:11 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id h8-20020a05600c350800b003d990372dd5sm17224440wmq.20.2023.01.09.03.54.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 03:54:10 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 11/13] hw/arm/z2: Use the IEC binary prefix definitions Date: Mon, 9 Jan 2023 12:53:14 +0100 Message-Id: <20230109115316.2235-12-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109115316.2235-1-philmd@linaro.org> References: <20230109115316.2235-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org IEC binary prefixes ease code review: the unit is explicit. Add the FLASH_SECTOR_SIZE definition. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/z2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/arm/z2.c b/hw/arm/z2.c index 8eb6f495bc..839be3ca16 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -12,6 +12,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/arm/pxa.h" #include "hw/arm/boot.h" #include "hw/i2c/i2c.h" @@ -297,9 +298,10 @@ static const TypeInfo aer915_info = { .class_init = aer915_class_init, }; +#define FLASH_SECTOR_SIZE (64 * KiB) + static void z2_init(MachineState *machine) { - uint32_t sector_len = 0x10000; PXA2xxState *mpu; DriveInfo *dinfo; void *z2_lcd; @@ -312,7 +314,7 @@ static void z2_init(MachineState *machine) dinfo = drive_get(IF_PFLASH, 0, 0); if (!pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - sector_len, 4, 0, 0, 0, 0, 0)) { + FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { error_report("Error registering flash memory"); exit(1); } From patchwork Mon Jan 9 11:53:15 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: 640610 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2094604pvb; Mon, 9 Jan 2023 04:06:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXv3Mj4UyFmcGIjDeBCBCWdw2XasJ79ZNbfdR1cts8CY3v/kXAfQ4n52XmEEtPCEhOrLS+xS X-Received: by 2002:a05:7500:408f:b0:f0:522d:633e with SMTP id d15-20020a057500408f00b000f0522d633emr49598gab.38.1673265963471; Mon, 09 Jan 2023 04:06:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673265963; cv=none; d=google.com; s=arc-20160816; b=MfjNmm1q/SO+g0gE6q5JEa3dpSpJK2oC7wrktsT2z/o3cl3biarUZfP01FyJh1j4FT RVE01Nt918hTLLdX6N5hR0wyGXu8WNfJlz12BABmQYxvSb/z7thIxe7ezIwtTNiphlo9 Fw4a3I8ade2x5aPEilT5rqD26Z7scSRsZOMk1sWfOexmekEx/lLyF2ENPh+cqxDuLWGE 1zJ0xc6YxWL6uIFZ8A0LDpb05rx5C+dVlQP15lRYRN2yNw6iMoJCfhDzCYbKnPiwlNnc nwYR0gzLwiGRDSeu9dAseDXSkZjrrbjhqOpVki2r/hQ3bCyr1SpKue3ecG40CpF/blsu QxYQ== 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=FDVaRNcO9+ny7tdAgMwhPc41lYorsN/VnELvXWwWtQM=; b=pGq0m+aU2u8ciuPVNKmrxmmWI50sTD7lxzudSTiWU82VRJGlSbVQN+ZBLDjxNbYZMY DCuZFEOFHAFndnCxREVGk7DetETOLCaatZT8J+v3PLDlwi0xUlt6US6Uy9MY4MomsUPh 71DpyNG/EgaKBR6n13NkPYH9JO9G95LzpLji1YaugXhR+VQYbHzoEKSHWX7w9itwhgjR +znXVVFBDPqGPt4MXJ0BFDZeQsoH+h8DMpeMp2y/MwVFtwUu3pjb7Io6sG4rU30cuspk EAcxRIUZLfUsrq9mDt8j536dNlb9M+u76jZSaEyoF3z4LiOdwDH4rktMwD5PVKDKl1LJ GRTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O2xUZEX5; 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 bk15-20020a05620a1a0f00b006fbdef09390si4242374qkb.96.2023.01.09.04.06.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 04:06:03 -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=O2xUZEX5; 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 1pEqjL-0003MH-MS; Mon, 09 Jan 2023 06:54:19 -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 1pEqjL-0003Ly-0a for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:54:19 -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 1pEqjI-00089s-UM for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:54:18 -0500 Received: by mail-wm1-x32b.google.com with SMTP id j16-20020a05600c1c1000b003d9ef8c274bso2113600wms.0 for ; Mon, 09 Jan 2023 03:54:16 -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=FDVaRNcO9+ny7tdAgMwhPc41lYorsN/VnELvXWwWtQM=; b=O2xUZEX5hwRpCQ3t3VFkygUGb2Tt5aept/9DhS661DHH0Zr5tiQt9VzVxmWQTJQIC5 rsKgfFO9kAY5W0VpjyIucaFalJziGQ4ZX0SvL+KfAt8pu14H9VRRCLgVGQQHJili1+Sr TgkePgcCvgxIbUXNpW/lnjOlxJMo9HqwdY4IRTMHjCwj/qYvwIN/xd6vxCk5ExpyoJYZ bxvm6JZzxeqOrDeia6VeRQCmGYfGaSgVg1uODZViTwHO0eDk8n7wRpinYNHeXLQP0PsC bxB7ow8c019+eOqs2hplaHHnDI/9XXGyhMJmUp+gVHEib+POerWmcP7VR++vMr0xFQou MygA== 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=FDVaRNcO9+ny7tdAgMwhPc41lYorsN/VnELvXWwWtQM=; b=Ju0UDDGRHmyBwxhp5EzVE7ear6BeDXSmZ48NlQyiF2FxdCFnu+CBwJd7LqY+dl68UP vNZyrRxcvu/fkg+hTJCHOyN728hFulFriSG+dNpSbij+2g/5wHM/9CSKTLIFeJDos+dx VIhz5Fud/AokTfTdlLiw3YEOt66J5XV33KwHtIaICjAqssTpzTc9AegaRrgCqL7zkVuy TJ/zGn8yyAfE5pbauV0wQ31CGUfMW/9AzjVC4TSrW19E7bbPaqX8iYdcAQrVWVpn2TJR ejcJ14T+5CsF0mOFVf2ohse7XjL9oGvdZj22rOjBOlM5oRqt7q+KwsFnQiienMC0sisx CB1A== X-Gm-Message-State: AFqh2krV90mkU/jT1W/p4XkMqvlAMSIrZzkJonbapal8oa4rRjSiAUg+ hqtqxVLQlKo6ykAuv+I0h2H7SzXsxX4yo7X8 X-Received: by 2002:a05:600c:3845:b0:3d1:caf1:3f56 with SMTP id s5-20020a05600c384500b003d1caf13f56mr50679684wmr.9.1673265256106; Mon, 09 Jan 2023 03:54:16 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id m25-20020a05600c3b1900b003d9ed49ee2bsm5158895wms.1.2023.01.09.03.54.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 03:54:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 12/13] hw/arm/vexpress: Remove dead code in vexpress_common_init() Date: Mon, 9 Jan 2023 12:53:15 +0100 Message-Id: <20230109115316.2235-13-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109115316.2235-1-philmd@linaro.org> References: <20230109115316.2235-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Upon introduction in commit b8433303fb ("Set proper device-width for vexpress flash"), ve_pflash_cfi01_register() was calling qdev_init_nofail() which can 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é --- hw/arm/vexpress.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index e1d1983ae6..757236767b 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -659,10 +659,6 @@ static void vexpress_common_init(MachineState *machine) dinfo = drive_get(IF_PFLASH, 0, 0); pflash0 = ve_pflash_cfi01_register(map[VE_NORFLASH0], "vexpress.flash0", dinfo); - if (!pflash0) { - error_report("vexpress: error registering flash 0"); - exit(1); - } if (map[VE_NORFLASHALIAS] != -1) { /* Map flash 0 as an alias into low memory */ @@ -673,11 +669,7 @@ static void vexpress_common_init(MachineState *machine) } dinfo = drive_get(IF_PFLASH, 0, 1); - if (!ve_pflash_cfi01_register(map[VE_NORFLASH1], "vexpress.flash1", - dinfo)) { - error_report("vexpress: error registering flash 1"); - exit(1); - } + ve_pflash_cfi01_register(map[VE_NORFLASH1], "vexpress.flash1", dinfo); sram_size = 0x2000000; memory_region_init_ram(sram, NULL, "vexpress.sram", sram_size, From patchwork Mon Jan 9 11:53:16 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: 640621 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2101115pvb; Mon, 9 Jan 2023 04:20:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXtwXS6DWiBm7cI7PbJ60zNPkxM4sWSrspPMEABksOmjmrErY8RRbYixNWpXjrld3XmIcJWE X-Received: by 2002:ac8:741a:0:b0:3ab:75e1:47ef with SMTP id p26-20020ac8741a000000b003ab75e147efmr82810398qtq.48.1673266832587; Mon, 09 Jan 2023 04:20:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673266832; cv=none; d=google.com; s=arc-20160816; b=ehjq90gATKo/DD33+5PwN5cMYYhYM9ZIyE0/yYC20Q93mhejMh3NyvBEjs6Cp7qImA De8Zw17dVTjwtFAJJZaoXk8pyRzzXhYFHc1+Be3Jj7LyR7QZR8XPmp781HZBn3fk5lWL ED9f/q6FPrylf8pUXrIXXKZQh8qfcHa9ry4tQ7a4HSmjYjepAsjZD140hR3z5n0xACj2 BEjdBAnv3Jwem41bobtJaUQMHeqhUkqCisP8jz0n5JurAVvSba57PirwlvfZ0V6eZxY+ F4GO3pKXPr6X1RqlrP4Nx1QzN74VrutVjZVF8p9ozmEzA142Riag95HRXx7DTgee6KYv 07Tg== 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=qf8hVEmg0ERboJd2XrjaxSQd2LANKOJppGaLQo7Delg=; b=iVU0VyPVOQA4pmahdy9j9IKmO8Sytl/4OEh9UMlLHbiWDSTHqn0aliOq14F3QiOOEz 0XFn3KDV5PRDao4pMU0fFPNM2zHmqk2BooNjl2a1AYCbxAgD1IApcypDuU5Fn/NXVsB7 jworyPZKhCdysLZgXLsAiBu7zHwKIoHOKgvzgiivfwGW7EbVErPRa6SFN3NdQRogreaV xUfDENfWZNWBFJHnTjCEsbCp/GdZVkesSTHl8H9AXABKdR+7Qzoqu+TQy2O5B1kuvn9r 5op1p/38h/qOIuM1hU3ED4mTDVFxV76cKc032V3Yp+ei2VMnmHsQDGqj1/aOqt4AJoEM p+rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rZw61Ejv; 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 d17-20020ac86691000000b003ab69a78e51si4400880qtp.593.2023.01.09.04.20.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 04:20:32 -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=rZw61Ejv; 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 1pEqjU-0003Qk-8a; Mon, 09 Jan 2023 06:54:28 -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 1pEqjQ-0003Nr-V8 for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:54:26 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqjO-0008Ef-K7 for qemu-devel@nongnu.org; Mon, 09 Jan 2023 06:54:24 -0500 Received: by mail-wm1-x329.google.com with SMTP id bi26-20020a05600c3d9a00b003d3404a89faso6805556wmb.1 for ; Mon, 09 Jan 2023 03:54: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=qf8hVEmg0ERboJd2XrjaxSQd2LANKOJppGaLQo7Delg=; b=rZw61EjvJ2aYT97ub4xB6LRt0F0xKKVA7oyA6cAW8S1IFPjUS/Yz9764XoSoSowELq cXr2LYvoz+Kgv58GWRXtRps6MXW6H8ayOfFDu0ED3zg5MiaecsrM2OZVSciSLl1+GM8e 0uVLHf3YgeKs0LpnwhhWIF4nDIw4OG1l0x73Trm3O+YbD8pEI9yeVwzzkPQSjpjKFYwh ppSH/nWekBU2upQdEvQvaK9By5MYBvap9n1PgSVpAZ49mnO3oVvL88w05ABINR74P2wV m4NQ4/Z5ejtPaXsRZBneY5M6nJFFvqLAaUAHlDLlW9gJhKKtbb3foBsMC4vfj1unf9us D66g== 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=qf8hVEmg0ERboJd2XrjaxSQd2LANKOJppGaLQo7Delg=; b=d3p3lNrnl9hLIglsTvMO3n2VsfYOz5+JpryNKQpHqKXQMhlAnirAcYkfOvQFtM3F+i CL5EHKJAFEqVWh+DD8HdnQf3yvihqKxQK77RHwyVK6ArvLZbz/swj90Iw2PurNMgMYRa 12+0Vx5FDEcmX93TNxzAJZdjiTNH5M5auqG0F+FLnDQdC/wuVEDavGtb9wfkbKtJfWE7 e0lkNTtRY83EckgzhZZAvpe6QC5UNlH61ooeBuK2eJluu5nrNcSbTjlw5VMASTUHl+ck Tb9bi2pBUgE5F8Sz8FdLZrxWRgZA9k9YqG4YcrqYJ3YE0uxmwGqvLomjtxFFDMl/Zfqb 7cPg== X-Gm-Message-State: AFqh2koAr0nMtiRnnkmXgpXP855r/3SDGEfdQirBr3E2KPUoObi62haG /4/4dPUx7BbNpqc+mQmYbHgx6l6coUDd+sjG X-Received: by 2002:a05:600c:4148:b0:3d3:52bb:3985 with SMTP id h8-20020a05600c414800b003d352bb3985mr46187630wmm.31.1673265260851; Mon, 09 Jan 2023 03:54:20 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id f15-20020a7bcd0f000000b003d9a71ee54dsm10937675wmj.36.2023.01.09.03.54.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 03:54:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 13/13] hw/arm: Remove unreachable code calling pflash_cfi01_register() Date: Mon, 9 Jan 2023 12:53:16 +0100 Message-Id: <20230109115316.2235-14-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109115316.2235-1-philmd@linaro.org> References: <20230109115316.2235-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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 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é --- hw/arm/gumstix.c | 18 ++++++------------ hw/arm/mainstone.c | 13 +++++-------- hw/arm/omap_sx1.c | 22 ++++++++-------------- hw/arm/versatilepb.c | 6 ++---- hw/arm/z2.c | 9 +++------ 5 files changed, 24 insertions(+), 44 deletions(-) diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c index 579d363577..2ca4140c9f 100644 --- a/hw/arm/gumstix.c +++ b/hw/arm/gumstix.c @@ -69,12 +69,9 @@ static void connex_init(MachineState *machine) } /* Numonyx RC28F128J3F75 */ - if (!pflash_cfi01_register(0x00000000, "connext.rom", CONNEX_FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0)) { - error_report("Error registering flash memory"); - exit(1); - } + pflash_cfi01_register(0x00000000, "connext.rom", CONNEX_FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0); /* Interrupt line of NIC is connected to GPIO line 36 */ smc91c111_init(&nd_table[0], 0x04000300, @@ -96,12 +93,9 @@ static void verdex_init(MachineState *machine) } /* Micron RC28F256P30TFA */ - if (!pflash_cfi01_register(0x00000000, "verdex.rom", VERDEX_FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0)) { - error_report("Error registering flash memory"); - exit(1); - } + pflash_cfi01_register(0x00000000, "verdex.rom", VERDEX_FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0); /* Interrupt line of NIC is connected to GPIO line 99 */ smc91c111_init(&nd_table[0], 0x04000300, diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c index eebaed6e3e..68329c4617 100644 --- a/hw/arm/mainstone.c +++ b/hw/arm/mainstone.c @@ -130,14 +130,11 @@ static void mainstone_common_init(MachineState *machine, /* There are two 32MiB flash devices on the board */ for (i = 0; i < 2; i ++) { dinfo = drive_get(IF_PFLASH, 0, i); - if (!pflash_cfi01_register(mainstone_flash_base[i], - i ? "mainstone.flash1" : "mainstone.flash0", - MAINSTONE_FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { - error_report("Error registering flash memory"); - exit(1); - } + pflash_cfi01_register(mainstone_flash_base[i], + i ? "mainstone.flash1" : "mainstone.flash0", + MAINSTONE_FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0); } mst_irq = sysbus_create_simple("mainstone-fpga", MST_FPGA_PHYS, diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index d1b0ec3264..1d156bc344 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -152,13 +152,10 @@ static void sx1_init(MachineState *machine, const int version) fl_idx = 0; if ((dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) { - if (!pflash_cfi01_register(OMAP_CS0_BASE, - "omap_sx1.flash0-1", flash_size, - blk_by_legacy_dinfo(dinfo), - SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { - fprintf(stderr, "qemu: Error registering flash memory %d.\n", - fl_idx); - } + pflash_cfi01_register(OMAP_CS0_BASE, + "omap_sx1.flash0-1", flash_size, + blk_by_legacy_dinfo(dinfo), + SECTOR_SIZE, 4, 0, 0, 0, 0, 0); fl_idx++; } @@ -174,13 +171,10 @@ static void sx1_init(MachineState *machine, const int version) memory_region_add_subregion(address_space, OMAP_CS1_BASE + FLASH1_SIZE, &cs[1]); - if (!pflash_cfi01_register(OMAP_CS1_BASE, - "omap_sx1.flash1-1", FLASH1_SIZE, - blk_by_legacy_dinfo(dinfo), - SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { - fprintf(stderr, "qemu: Error registering flash memory %d.\n", - fl_idx); - } + pflash_cfi01_register(OMAP_CS1_BASE, + "omap_sx1.flash1-1", FLASH1_SIZE, + blk_by_legacy_dinfo(dinfo), + SECTOR_SIZE, 4, 0, 0, 0, 0, 0); fl_idx++; } else { memory_region_init_io(&cs[1], NULL, &static_ops, &cs1val, diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index ecc1f6cf74..43172d72ea 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -385,13 +385,11 @@ static void versatile_init(MachineState *machine, int board_id) /* 0x34000000 NOR Flash */ dinfo = drive_get(IF_PFLASH, 0, 0); - if (!pflash_cfi01_register(VERSATILE_FLASH_ADDR, "versatile.flash", + pflash_cfi01_register(VERSATILE_FLASH_ADDR, "versatile.flash", VERSATILE_FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, VERSATILE_FLASH_SECT_SIZE, - 4, 0x0089, 0x0018, 0x0000, 0x0, 0)) { - fprintf(stderr, "qemu: Error registering flash memory.\n"); - } + 4, 0x0089, 0x0018, 0x0000, 0x0, 0); versatile_binfo.ram_size = machine->ram_size; versatile_binfo.board_id = board_id; diff --git a/hw/arm/z2.c b/hw/arm/z2.c index 839be3ca16..dc25304290 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -312,12 +312,9 @@ static void z2_init(MachineState *machine) mpu = pxa270_init(z2_binfo.ram_size, machine->cpu_type); dinfo = drive_get(IF_PFLASH, 0, 0); - if (!pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { - error_report("Error registering flash memory"); - exit(1); - } + pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0); /* setup keypad */ pxa27x_register_keypad(mpu->kp, map, 0x100);