From nobody Mon Feb 9 09:34:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673265878; cv=none; d=zohomail.com; s=zohoarc; b=LCcqmIkvKaIg23zf1Dfc7ooUOgqvWYKENXlUn8j0aDJOr8iJ6HgPoxYAoTgpmUPaIyTAJPquTy/S5JnFUcmEBsywLi6tONz9MCVqzCbREVVVZLpj3g5Ba9DlV34N0jx6gdCeSyxzxqyYUPagXXLaeuP/YG/haVkv9yMbjH2rHjg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673265878; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iQs1+OIM6FI+xXo1eNVCeEzgZwL+2/Sa1KGrztxPB6E=; b=QykcqCYJjbziq0N31CtQUuZmG+/RIwFcw0QDl3M/KeJ38yYxqfdKuGqfKDZC7ZwQrhC9SklJJJlKkehOdxW7zD/pDOaWpnTy5p3KV5T0ypEVOa4yDrkpz2tZcgR0G8s52fD3l71onZHk48GSkSHGH+rRxf/NJFXmbxyfmPjKatg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673265878685688.7216142619109; Mon, 9 Jan 2023 04:04:38 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXvtcqpRhYAkOMcpFj5EggLXGaSJYEPX407TQS/a3sSIxJl1XT0TFrrQEBlwPgCq4+yBc0Cu2Q== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673265879981100001 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=C3=A9 Reviewed-by: Richard Henderson --- 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 =3D get_system_memory(); =20 uint32_t connex_rom =3D 0x01000000; uint32_t connex_ram =3D 0x04000000; =20 - cpu =3D pxa255_init(address_space_mem, connex_ram); + cpu =3D pxa255_init(connex_ram); =20 dinfo =3D 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, } =20 /* Initialise a PXA255 integrated chip (ARM based core). */ -PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_s= ize) +PXA2xxState *pxa255_init(unsigned int sdram_size) { + MemoryRegion *address_space =3D 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; =20 - mpu =3D pxa255_init(address_space_mem, tosa_binfo.ram_size); + mpu =3D pxa255_init(tosa_binfo.ram_size); =20 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 { =20 PXA2xxState *pxa270_init(MemoryRegion *address_space, unsigned int sdram_s= ize, const char *revision); -PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_s= ize); +PXA2xxState *pxa255_init(unsigned int sdram_size); =20 #endif /* PXA_H */ --=20 2.38.1 From nobody Mon Feb 9 09:34:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673265258; cv=none; d=zohomail.com; s=zohoarc; b=LleDOULgS0xJTNjGVZIUTVpSE1Hyp61CQ1q5jSIRv33yDpc9/FbjFZlio0/67XITIb7v1oDv7GEKJSaVoJPzRNcDHKR7z28dpAlsx5AXKkpZFsmqfe5f/epEWpzZiEXajhxlbtac9m6Poyjb+a9ZEoBxczXvbFGS7iEhWtVzIqs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673265258; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=f5egngPnKd3eXowoe9rSvuOk/WYn87jONK9fpMWE9oo=; b=gFlVd643DMXGlOkVAxV72fCin+YfddG6uT69dPvcjGea/AbTjQVd/H8DwFlR37KjqUfUIHv/DzkpUqFrl/mjyNLb9/niAiEuOODzBzmFMwZusURvEF33RDh6QFTondyjpuedu/ahnBP3G7J+74kmgYhPFXE+2MV/dKrI6FFMSzQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673265258294182.1446760414076; Mon, 9 Jan 2023 03:54:18 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXvK2gh1EpgI/tvEnS3PZe14SA66JxTOOtePl0Gbfbpr/ctjCJTPbDAHt29TZ2B7gefSydhP6Q== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673265260304100003 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=C3=A9 Reviewed-by: Richard Henderson --- 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 =3D get_system_memory(); =20 uint32_t verdex_rom =3D 0x02000000; uint32_t verdex_ram =3D 0x10000000; =20 - cpu =3D pxa270_init(address_space_mem, verdex_ram, machine->cpu_type); + cpu =3D pxa270_init(verdex_ram, machine->cpu_type); =20 dinfo =3D 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 =3D { .ram_size =3D 0x04000000, }; =20 -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 =3D 256 * 1024; @@ -121,11 +120,10 @@ static void mainstone_common_init(MemoryRegion *addre= ss_space_mem, MemoryRegion *rom =3D g_new(MemoryRegion, 1); =20 /* Setup CPU & memory */ - mpu =3D pxa270_init(address_space_mem, mainstone_binfo.ram_size, - machine->cpu_type); + mpu =3D 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); =20 /* There are two 32MiB flash devices on the board */ for (i =3D 0; i < 2; i ++) { @@ -165,7 +163,7 @@ static void mainstone_common_init(MemoryRegion *address= _space_mem, =20 static void mainstone_init(MachineState *machine) { - mainstone_common_init(get_system_memory(), machine, mainstone, 0x196); + mainstone_common_init(machine, mainstone, 0x196); } =20 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) } =20 /* 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 =3D 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 =3D SPITZ_MACHINE(machine); enum spitz_model_e model =3D smc->model; PXA2xxState *mpu; - MemoryRegion *address_space_mem =3D get_system_memory(); MemoryRegion *rom =3D g_new(MemoryRegion, 1); =20 /* Setup CPU & memory */ - mpu =3D pxa270_init(address_space_mem, spitz_binfo.ram_size, - machine->cpu_type); + mpu =3D pxa270_init(spitz_binfo.ram_size, machine->cpu_type); sms->mpu =3D mpu; =20 sl_flash_register(mpu, (model =3D=3D spitz) ? FLASH_128M : FLASH_1024M= ); =20 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); =20 /* 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 =3D { =20 static void z2_init(MachineState *machine) { - MemoryRegion *address_space_mem =3D get_system_memory(); uint32_t sector_len =3D 0x10000; PXA2xxState *mpu; DriveInfo *dinfo; @@ -308,7 +307,7 @@ static void z2_init(MachineState *machine) DeviceState *wm; =20 /* Setup CPU & memory */ - mpu =3D pxa270_init(address_space_mem, z2_binfo.ram_size, machine->cpu= _type); + mpu =3D pxa270_init(z2_binfo.ram_size, machine->cpu_type); =20 dinfo =3D 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 { =20 # define PA_FMT "0x%08lx" =20 -PXA2xxState *pxa270_init(MemoryRegion *address_space, unsigned int sdram_s= ize, - const char *revision); +PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision); PXA2xxState *pxa255_init(unsigned int sdram_size); =20 #endif /* PXA_H */ --=20 2.38.1 From nobody Mon Feb 9 09:34:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673266699; cv=none; d=zohomail.com; s=zohoarc; b=Ws+l/pRJhT/PZTw/Bo8hBcxpVT9o6V9dHsCvSpDP/OrkZqYfyeIXypdWs7nR5hE5AE+LpHDBoNo2+3h3uJihlN+J3EuM37OvqgMj1aXRcVnCtcL0YQI5B1di6L9VLUvCmQNYOS5UuMcWtaVFRb9nOTFAMa0+j+MLh7MXg6r5Cbg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673266699; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kABC6Dg8afXn22QWktdCfTPtG/Bv98gX9IL+lt9WyQQ=; b=YaFFPQrOW22ug09P/YHKgF5OQOqZgZ4nhWkhnL5ORzsyQ8WMiqtMCuBxhhgy6xM0v4v9BAzul+B5BsZs/G4270Y3I5ud+Gru/xrQk8KlszN3afXg9yrrvG5VajUyM+zfnwxu0/zMl0puIJiWKwjD8n+zqsEDFvGDZ92K2PpZKJM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673266699283633.0924396814614; Mon, 9 Jan 2023 04:18:19 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXtT60/8GtRWd8hZMJF0++piRHnN0vKyOb7Gtm8wuqt8/65BiJwdpLnCYqQBiXaNt6xnJ2B4bQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673266701104100001 IEC binary prefixes ease code review: the unit is explicit. Add definitions for RAM / Flash / Flash blocksize. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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" =20 +#define RAM_SIZE (512 * MiB) +#define FLASH_SIZE (32 * MiB) +#define FLASH_SECTOR_SIZE (64 * KiB) + struct CollieMachineState { MachineState parent; =20 @@ -31,7 +35,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(CollieMachineState, COLLIE_MAC= HINE) =20 static struct arm_boot_info collie_binfo =3D { .loader_start =3D SA_SDCS0, - .ram_size =3D 0x20000000, + .ram_size =3D RAM_SIZE, }; =20 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->ra= m); =20 dinfo =3D 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); =20 dinfo =3D 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); =20 sysbus_create_simple("scoop", 0x40800000, NULL); =20 @@ -75,7 +79,7 @@ static void collie_machine_class_init(ObjectClass *oc, vo= id *data) mc->init =3D collie_init; mc->ignore_memory_transaction_failures =3D true; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("sa1110"); - mc->default_ram_size =3D 0x20000000; + mc->default_ram_size =3D RAM_SIZE; mc->default_ram_id =3D "strongarm.sdram"; } =20 --=20 2.38.1 From nobody Mon Feb 9 09:34:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673265602; cv=none; d=zohomail.com; s=zohoarc; b=TZIofmNFDSXUzxmVFSrXfAyeSv6FLii3zvE8uJnU1/yo7ffAEFPr7B+NB+mBCSwen5eW2zCgIGcgEiykyoUa0OYHgzRx99Wflko1Ovsz+qzi83ZwvH+LoxmBqnjJZYoolfQcgqpGNMGQP/4D42Z/VA0n5o6gVKvkM7Jg/4L/WIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673265602; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=arGDJqPATELoiqCitRXAST5VMx8cy/N7Kqb6K/IJ2aQ=; b=J5p1kd4Ct6YNPE/u937dM69tassUpxZDE3Q/ibFmT/fpPinENGmOFFHDxBbtBKtfJs6beyrpoHVMf2unuHteIUKihiuPgHO04JM30V5GB8Jdh/KVwsl+Wn0T74BiJf+GuFNAjIehSsjuayepHnZ1HxXu3ifvHhe+R/sTbyc1quM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673265602321663.758299504791; Mon, 9 Jan 2023 04:00:02 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXv7CVHvNW9ytQP0JdexmrrqmlehyP9cRT2a04GHpH1pv1/TtK3vSNbUv5sHw2MhDfcSJkzICQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673265604670100003 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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 =3D { =20 static void collie_init(MachineState *machine) { - DriveInfo *dinfo; MachineClass *mc =3D MACHINE_GET_CLASS(machine); CollieMachineState *cms =3D COLLIE_MACHINE(machine); =20 @@ -55,15 +54,13 @@ static void collie_init(MachineState *machine) =20 memory_region_add_subregion(get_system_memory(), SA_SDCS0, machine->ra= m); =20 - dinfo =3D 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 =3D 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 =3D 0; i < 2; i++) { + DriveInfo *dinfo =3D 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); + } =20 sysbus_create_simple("scoop", 0x40800000, NULL); =20 --=20 2.38.1 From nobody Mon Feb 9 09:34:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673267264; cv=none; d=zohomail.com; s=zohoarc; b=aB3t092nwb1h/ljQIV17n/ZV+nuHAgqHg/34UwbjEEC6397zZsmeTfLjJtiX6YZPgH9Dv9UMlWIlCvnzgJK7oBfUt5zLqezqAQJgJeHi74NZvvAkoVJ00APEgCGHRMlhxqcXeAY0uWavu8/fb4Atw6ONZ61GypFzCKLEHDgbm1I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673267264; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EJ06rBglje6LQ6jpsdeFNJpw4LirYI6I0MIC3DLWsPw=; b=IQqIksamreidb6fd+hzgWyl+lN2eUH5JtVwtB1SFdnQZBWscq0R0cFvQnnjYSsxCAivP/OyFf8usws6NCM0PRM7Exbtr84UMncKLY5vnMKQiN2MzWlDOwxD95kGaRtEEeyL2nyMRDNPdcZZgb1fRbXBKLVn9ktC7g9KiuoflhP8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673267264111827.1310914023347; Mon, 9 Jan 2023 04:27:44 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXse8LdGG1T79XNZzWCAhAZ+NDjCL0uDOfeH7YAxVHoQYApcEl9TuIlVX1gM2iiUA7ERuYlRHQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673267265135100001 From: Philippe Mathieu-Daud=C3=A9 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=C3=A9 Message-Id: <20200223231044.8003-3-philmd@redhat.com> Reviewed-by: Richard Henderson --- 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. */ -=20 + /*=20 * Example usage: *=20 @@ -64,6 +64,7 @@ static void connex_init(MachineState *machine) exit(1); } =20 + /* 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); } =20 + /* 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 *da= ta) { MachineClass *mc =3D MACHINE_CLASS(oc); =20 - mc->desc =3D "Gumstix Verdex (PXA270)"; + mc->desc =3D "Gumstix Verdex Pro XL6P COMs (PXA270)"; mc->init =3D verdex_init; mc->ignore_memory_transaction_failures =3D true; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("pxa270-c0"); --=20 2.38.1 From nobody Mon Feb 9 09:34:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673269348; cv=none; d=zohomail.com; s=zohoarc; b=eEzje5AjBS8H9BePGrJ8JfuRB3LClujQN4DRfzYo3+lH9yDu3MSRUeYycToHHHvhyM9GOU/clmFx3OJw5Qb5EKWGYZFbNju1QZyHekepnt1FpCXCJUP1vIXdXPHLFQNOwq9MAv30QzBnGo2Httf/tt/wI2Xz6dqudOFaS8uEf78= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673269348; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=d549zrbSVj2+hdi6d6L6mPBf616eqZGm0GWt6kYTTIs=; b=J12+Ea6hJpR4J6JZFlqeE1D+c6JwgAYL0EJbsxxcjWsnuk3paSnTBrKp5l0PkM96+wR99B6qtGYY4jfoiu4HDhbetGwHteZWj6X1kftHQW3/ZtxTMAfoL6zjn6iAG/77oBANKD+Cgqays7aYl5W7wdU/+lStrmqTTsuyHpe7Vpc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673269348801490.1741607330657; Mon, 9 Jan 2023 05:02:28 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXt+egGy0UU0MI+eRr8B7MeAODF9TJL76o84FOjTnxrYz2j4p4/L9OjtPRDo41+fevQY2pPMDg== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673269350912100003 From: Philippe Mathieu-Daud=C3=A9 IEC binary prefixes ease code review: the unit is explicit. Add definitions for RAM / Flash / Flash blocksize. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200223231044.8003-3-philmd@redhat.com> Reviewed-by: Richard Henderson --- 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 @@ */ =20 #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" =20 -static const int sector_len =3D 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) =20 static void connex_init(MachineState *machine) { PXA2xxState *cpu; DriveInfo *dinfo; =20 - uint32_t connex_rom =3D 0x01000000; - uint32_t connex_ram =3D 0x04000000; - - cpu =3D pxa255_init(connex_ram); + cpu =3D pxa255_init(CONNEX_RAM_SIZE); =20 dinfo =3D drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { @@ -65,9 +69,9 @@ static void connex_init(MachineState *machine) } =20 /* Numonyx RC28F128J3F75 */ - if (!pflash_cfi01_register(0x00000000, "connext.rom", connex_rom, + if (!pflash_cfi01_register(0x00000000, "connext.rom", CONNEX_FLASH_SIZ= E, 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; =20 - uint32_t verdex_rom =3D 0x02000000; - uint32_t verdex_ram =3D 0x10000000; - - cpu =3D pxa270_init(verdex_ram, machine->cpu_type); + cpu =3D pxa270_init(VERDEX_RAM_SIZE, machine->cpu_type); =20 dinfo =3D drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { @@ -95,9 +96,9 @@ static void verdex_init(MachineState *machine) } =20 /* 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); } --=20 2.38.1 From nobody Mon Feb 9 09:34:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673266414; cv=none; d=zohomail.com; s=zohoarc; b=Br+5uNNS7rIBTqfQSwT++3MXd0E0XINCoGYWu6ltrum9eUZROAIyGyghGd2h2Uk5y4aJLq5KgY9ocpJO8mt+D3OfIgXLTv1064I6u0Tdpqg2aqzA2Kf8yDBwPogrF/6jSY0lim/X1pbvLSoojf2Nsmsg3noElAiE0lx0vymrmlo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673266414; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8ERSy5wcRjjSecTdAN061YLtBrODzsMdgJY9d4shct4=; b=Wy0qjQGt52oKeF/JP0gESxf7l+Qd9eBXA5SQpt3AgUF707mrSb0uXMrRXjnkLqgfaNmdFfMhOhWJPROzpdq1XIixW/eZTg9UkFBj27px6M4jlO3z8rgbrIN2SQu85WNCz1yf82e62u73W+No3w13by52+TgVdTq/n8ujPwKaWZY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167326641478135.051995400510464; Mon, 9 Jan 2023 04:13:34 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXu0jDsMsUYt3nuEPAneijVUksHCeFC58S42Pr9Gjx1X/+jxO+A6qg45llCFjxFj8iScmaV6TA== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673266415413100001 IEC binary prefixes ease code review: the unit is explicit. Add the FLASH_SECTOR_SIZE definition. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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] =3D { =20 enum mainstone_model_e { mainstone }; =20 -#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) =20 static struct arm_boot_info mainstone_binfo =3D { .loader_start =3D PXA2XX_SDRAM_BASE, - .ram_size =3D 0x04000000, + .ram_size =3D MAINSTONE_RAM_SIZE, }; =20 +#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 =3D 256 * 1024; hwaddr mainstone_flash_base[] =3D { MST_FLASH_0, MST_FLASH_1 }; PXA2xxState *mpu; DeviceState *mst_irq; @@ -121,7 +123,7 @@ static void mainstone_common_init(MachineState *machine, =20 /* Setup CPU & memory */ mpu =3D 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); =20 @@ -130,9 +132,9 @@ static void mainstone_common_init(MachineState *machine, dinfo =3D drive_get(IF_PFLASH, 0, i); if (!pflash_cfi01_register(mainstone_flash_base[i], i ? "mainstone.flash1" : "mainstone.fla= sh0", - MAINSTONE_FLASH, + MAINSTONE_FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NU= LL, - 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); } --=20 2.38.1 From nobody Mon Feb 9 09:34:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673266581; cv=none; d=zohomail.com; s=zohoarc; b=R8X4z3gb2HKAycVn816ao8knYA2yuq9MwwGhQPn0yt/CtTnuHM414M7EOp33j8DkjHioMd08ouyeCgy+hvgA2hoNmlyDMphS+oiEQebBnAJm4HoLQWYv51EyHj4AruA+E0TktgNFGFEMYehlL2ZsgfknkS57ERNnzEXmOe1E7pk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673266581; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7S4AtrItDHw6gjUi/DcC6OrJFm3Uy3mqWC4OtemhbH0=; b=jKMXOgb4hdKCM/fbYTbEi4ylACj596+FkmDfFZ6odH7YZrRbllMO1bUk3tul5ALV7uWe8efs3u2vVWEPEdVrRIDvOFqjN3ctYiryNmOicnwT4lchA4YQge9+xHKx1OOIFuPAp9061zZlqVtZFRFBK7gUgYVhgPdz4T8nW9iwmhE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673266581734969.8008321141991; Mon, 9 Jan 2023 04:16:21 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXvpEQjBg6+ubLjEP5orROiTBSsaEIq5dfKn15A9KPmD9UcCuw1yh3zVidTJcfJBHZR9zoNhkw== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673266583130100003 IEC binary prefixes ease code review: the unit is explicit. Add the FLASH_SECTOR_SIZE definition. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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 @@ */ =20 #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 =3D { .class_init =3D musicpal_key_class_init, }; =20 +#define FLASH_SECTOR_SIZE (64 * KiB) + static struct arm_boot_info musicpal_binfo =3D { .loader_start =3D 0x0, .board_id =3D 0x20e, @@ -1264,8 +1267,8 @@ static void musicpal_init(MachineState *machine) BlockBackend *blk =3D blk_by_legacy_dinfo(dinfo); =20 flash_size =3D blk_getlength(blk); - if (flash_size !=3D 8*1024*1024 && flash_size !=3D 16*1024*1024 && - flash_size !=3D 32*1024*1024) { + if (flash_size !=3D 8 * MiB && flash_size !=3D 16 * MiB && + flash_size !=3D 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); --=20 2.38.1 From nobody Mon Feb 9 09:34:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673265383; cv=none; d=zohomail.com; s=zohoarc; b=SKNph9ZTztSZ5uDlazOzRKRzALLwtuE1/2i0EKEfc88KNl04+/LxhCOqFVGwibiPXib8hDNPrwXIdUQd3VUX7adITdGOJc4sxY0qHRfttekowPGGqxnS4ygBtEizBxgglygql8/o1ossyeiz7u2bYTJemNIOc1/SsOd2hPveydc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673265383; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5Ex3NPUGvPkrE4NbytzYcH01U3eur12SK2WO3g4Dkuc=; b=mcXsZRZHIdB35U7cB6rUiVLyul+PUSlmeGjM/2iIsnuklzlBPklkucssQCCSJPVveDb6yQwytkREWqNa9ZoLwjSVGWpA4oMqfWxr0VCn1UJ+2SQ3D8cRv2EcpKkR+ybU7/YpWow8Fd55y4Vi6qXr0mdY5+W3EtIFMqZBgubLjy8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673265383521245.90835786272328; Mon, 9 Jan 2023 03:56:23 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXsStwz5FubuXkSg6FHw3LW3kjnDTRyqwHZjw0Xb3sCHCx4jCBzD6OZVq7XHNY8OJZWo/jS0vw== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673265385096100003 The total_ram_v1/total_ram_v2 definitions were never used. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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 =3D { #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_SR= AM_SIZE) -#define total_ram_v2 (sdram_size + flash2_size + OMAP15XX_SRAM_SIZE) =20 static struct arm_boot_info sx1_binfo =3D { .loader_start =3D OMAP_EMIFF_BASE, --=20 2.38.1 From nobody Mon Feb 9 09:34:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673266774; cv=none; d=zohomail.com; s=zohoarc; b=ed6Zi3dBsBwA5jSooGUuOfW130WEx6bp7KFYAJC0kcGZY2CcJrtitDSSnLSgjTQ3kZiGesvLABt36K5GRFdXXs3L2TFYKtAqDdbQ+7XyhmPTina1x6J4Zp0a6vFFRG8rh3T6fdKBX7cJZUuzH5HPolMf2x+guRDqaH4Zo+VCQDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673266774; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LVNFvExNkEf16xN6scmGKliquT0uXwHyZsjZ5nnvuPM=; b=Sa2FHHBA9nJjVfZ3pMP/j344c2PQSnL7johHyGEh60HLXiH4wH5qd3II6GblV12LWSW2g85UJTF65lcOTBrA/HITAvqKEfiYAwO917/gpwgOPrzV6LssRUlBb87ZUeLjfMSdcHlEoT/v+mOEa+BGIb3et6Gkv4y4kJPnsaW2K5M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673266774342746.4493401030868; Mon, 9 Jan 2023 04:19:34 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXtNOfpQmcF6d8mKogguAzRMtwK7tl06bBa0X17a98VK4wqTJEFxJcHdT4qo8o2Dl8wFdXbCzQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673266775489100001 IEC binary prefixes ease code review: the unit is explicit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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 =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -#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) =20 static struct arm_boot_info sx1_binfo =3D { .loader_start =3D OMAP_EMIFF_BASE, - .ram_size =3D sdram_size, + .ram_size =3D SDRAM_SIZE, .board_id =3D 0x265, }; =20 @@ -111,7 +112,7 @@ static void sx1_init(MachineState *machine, const int v= ersion) static uint32_t cs3val =3D 0x00001139; DriveInfo *dinfo; int fl_idx; - uint32_t flash_size =3D flash0_size; + uint32_t flash_size =3D FLASH0_SIZE; =20 if (machine->ram_size !=3D mc->default_ram_size) { char *sz =3D size_to_str(mc->default_ram_size); @@ -121,7 +122,7 @@ static void sx1_init(MachineState *machine, const int v= ersion) } =20 if (version =3D=3D 2) { - flash_size =3D flash2_size; + flash_size =3D FLASH2_SIZE; } =20 memory_region_add_subregion(address_space, OMAP_EMIFF_BASE, machine->r= am); @@ -154,7 +155,7 @@ static void sx1_init(MachineState *machine, const int v= ersion) 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 =3D drive_get(IF_PFLASH, 0, fl_idx)) !=3D NULL) { MemoryRegion *flash_1 =3D 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); =20 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]); =20 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 =3D sx1_init_v2; mc->ignore_memory_transaction_failures =3D true; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("ti925t"); - mc->default_ram_size =3D sdram_size; + mc->default_ram_size =3D SDRAM_SIZE; mc->default_ram_id =3D "omap1.dram"; } =20 @@ -236,7 +237,7 @@ static void sx1_machine_v1_class_init(ObjectClass *oc, = void *data) mc->init =3D sx1_init_v1; mc->ignore_memory_transaction_failures =3D true; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("ti925t"); - mc->default_ram_size =3D sdram_size; + mc->default_ram_size =3D SDRAM_SIZE; mc->default_ram_id =3D "omap1.dram"; } =20 --=20 2.38.1 From nobody Mon Feb 9 09:34:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673267151; cv=none; d=zohomail.com; s=zohoarc; b=k3GMOnZZ8bPYSjO67W1Mm8pLqX5W7WobPxo0IMPiRYmuiKfZIBXfzUu8ew7NB3gi4mbaIrkziNDZxfUI9dzF8Ze5htcha8mcIANOhK7Syblo9rwp1dY0cNSN+h1mXkKcrkQ4wZW3SRShmcwbVeHHvcoeM38ySyBaxS7rIOINObo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673267151; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fbdqJdHQkqZ1zlOSqiHVW5as1b5l8uF3BLsUWk2mkB4=; b=hs4wDydtu/FO5y5lC65tlHldwWspGU2MhtbyCLNygkbnPxe09qvQ4xpNmmbJr0OpAXlvrmQSKJVOoH40hmAu7j8lwbmyWX0tF5olLgZtoZLeKK0R+w+6xGfDmzccx94BPx4RUvbqtOEapUWxzd4HWFs0M1Ash2w2tFNoR9/F2kk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167326715155135.688127236697824; Mon, 9 Jan 2023 04:25:51 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXtPlUxANQuVUhMiNlXSB/QiySO8dwO1LWqgXTyoObOt+beYWlNI5GiZSFP0UF++nPfoNw2piQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673267153715100005 IEC binary prefixes ease code review: the unit is explicit. Add the FLASH_SECTOR_SIZE definition. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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 @@ */ =20 #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 =3D { .class_init =3D aer915_class_init, }; =20 +#define FLASH_SECTOR_SIZE (64 * KiB) + static void z2_init(MachineState *machine) { - uint32_t sector_len =3D 0x10000; PXA2xxState *mpu; DriveInfo *dinfo; void *z2_lcd; @@ -312,7 +314,7 @@ static void z2_init(MachineState *machine) dinfo =3D 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); } --=20 2.38.1 From nobody Mon Feb 9 09:34:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673265962; cv=none; d=zohomail.com; s=zohoarc; b=fDDWX9hrhKM0douU4Z8Tovu60s0HSWhY9W7ztwKsXVFjEtj/MLe4/n2M4djgCno+6rSIFgB1rrP9N+WUMH+knbnXIawyNTqwRI14543EpJbjjtMR3XHghde85vKNzJ2kt9wa/1r5rtlereXBqWcNfLeh7WGnJaNz8HbHYx/kkg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673265962; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FDVaRNcO9+ny7tdAgMwhPc41lYorsN/VnELvXWwWtQM=; b=X/WMFA0Pp9sd76J7atoQDwl7Jf0eN0pps/qaPhxBScXoIshwpZfFZsuKOQ7d6LGpXFqPfg/PJbhN2j/wEKOc0cRQqoHX8jaZ7lUT53XUyReiC7rr+bfIgMKYlqE5P3sfmtwUXgweOvjg5eSiXbrtTdtKSifiZPNmZnLg29ccrEA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673265961977531.6227886770937; Mon, 9 Jan 2023 04:06:01 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXswFcwWt/BTbMTXXgHP81KB47VS5v9ffQRP7dKvPw9N6oeMLR54pMn+PXMezSDsyJO5S3SmIg== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673265964581100003 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=C3=A9 Reviewed-by: Richard Henderson --- 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 =3D drive_get(IF_PFLASH, 0, 0); pflash0 =3D ve_pflash_cfi01_register(map[VE_NORFLASH0], "vexpress.flas= h0", dinfo); - if (!pflash0) { - error_report("vexpress: error registering flash 0"); - exit(1); - } =20 if (map[VE_NORFLASHALIAS] !=3D -1) { /* Map flash 0 as an alias into low memory */ @@ -673,11 +669,7 @@ static void vexpress_common_init(MachineState *machine) } =20 dinfo =3D 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); =20 sram_size =3D 0x2000000; memory_region_init_ram(sram, NULL, "vexpress.sram", sram_size, --=20 2.38.1 From nobody Mon Feb 9 09:34:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673266833; cv=none; d=zohomail.com; s=zohoarc; b=G86rlBztalb8/LKnN4LpvrFIgRGH+HtUJwZ1tARuceDSKvFSUk8xI3l31ubpyOMpG24898zrqxu3kVS7Gp+2bGCnLT4w/KIQvyHQj9ZPRkrg/7PCYcELmKM2Q49UZoi8ILgGtw+1jMxIiosVQaO2pE1D+fULtdGr159zYzHnTqg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673266833; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qf8hVEmg0ERboJd2XrjaxSQd2LANKOJppGaLQo7Delg=; b=ggyA23cWEh0fHJSxMgmfIZo7pVO2eiAqDIFVVfuePr51TlwIdKLGWViGAXXcDw7THjAnXCduszAMjKOeCEhF18J6JdBHfzbQoydu3Eq1BiqknXU9IV+aWdw7woBeu9MCQwjvZ890wc4acSrj9RSjOZ5AjhGp2vgoRbValy5mQ4U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673266833010298.2254925132589; Mon, 9 Jan 2023 04:20:33 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXudqt2o6vTr+fNpPiV4sj8QtRtMx4ZCoIIgjfiwfXVGhbwVjsQeHpmKX7YDnxzRIPfSc+UeXw== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Jan Kiszka , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673266833516100001 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=C3=A9 Reviewed-by: Richard Henderson --- 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) } =20 /* Numonyx RC28F128J3F75 */ - if (!pflash_cfi01_register(0x00000000, "connext.rom", CONNEX_FLASH_SIZ= E, - 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); =20 /* 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) } =20 /* 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); =20 /* 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 *machi= ne, /* There are two 32MiB flash devices on the board */ for (i =3D 0; i < 2; i ++) { dinfo =3D drive_get(IF_PFLASH, 0, i); - if (!pflash_cfi01_register(mainstone_flash_base[i], - i ? "mainstone.flash1" : "mainstone.fla= sh0", - MAINSTONE_FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NU= LL, - 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); } =20 mst_irq =3D 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) =20 fl_idx =3D 0; if ((dinfo =3D drive_get(IF_PFLASH, 0, fl_idx)) !=3D 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++; } =20 @@ -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]); =20 - 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 */ =20 dinfo =3D 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); =20 versatile_binfo.ram_size =3D machine->ram_size; versatile_binfo.board_id =3D 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 =3D pxa270_init(z2_binfo.ram_size, machine->cpu_type); =20 dinfo =3D 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); =20 /* setup keypad */ pxa27x_register_keypad(mpu->kp, map, 0x100); --=20 2.38.1