From patchwork Wed Jan 4 22:04:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 639058 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp1975592pvb; Wed, 4 Jan 2023 14:52:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXtbbieyN6/vHNtReF+JiSe4vaPhmlP+vK83lzFGv4f2RJd0d8EY/yWxXmj71XJbLH1TxoUl X-Received: by 2002:ac8:481a:0:b0:3a6:8b5a:7d02 with SMTP id g26-20020ac8481a000000b003a68b5a7d02mr75314179qtq.30.1672872731238; Wed, 04 Jan 2023 14:52:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672872731; cv=none; d=google.com; s=arc-20160816; b=Jx2KH+H5kj32lpoQiHOTpN09JAO1W+b3UIR6K1YHr71k2y5HO14/AVh2+F2L9KCG5q ZgxfwnIbzhrike7dT+kbq2TaVP4HSbSipelQRQ3fifIFdFJn41FyWtfHLtac+BqpGHqu zb0DWUnkGZ/PoHGf0uGFI8/cmDAtcAh36ECoN8mBLe0vz60+itG+Mdi98ai8JBpdax+3 1c+7DEWk8xrfX0TWqWz3oa3z0AdNiVxOOr87XKbrnftMPKHCf5ODLzWEyHT8+yFZ8qnP iOPrLwQ6Ey6nCvlfQEWsDksel9S8dz8bmxOeO+X5BxvdpkogxUa9b2yqnYhtRZ4wCLGL YDsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wmavs6sB32iuk0P3966mjPd+ATivEhkJqHU5LgWaQJM=; b=L6Cd4CcwqqBXNhEvymsUBi1Q/XpVKrIpHi/ZDMDNEQWh4/tLDX7v+XCCo/zoi+zHL2 nY09yYVS3mO1qbxxcq6ahXjtc0dJDJbT3QQQYb0arTmQ5Qh4uR2W0QngZWtDxT96MX9K Qy0btUjoaWTxzW4sCR05aSYPt0XGtfpwmasVi33wcD+NSD7bm2aUz2MozBj14Q0hf6nF pF6ZuDTcD4dDZ4+qfTrXQoIa3GAiFs417ZrpUM9RF6vkcGVOng8Sy4CX4R4cIzdSB20s yAi33Rm2A0FBy8UcA7X/JZhcITYOqBT3toWhdop3onhfVOs12h6F8VZueQmVE85J5pJa GnHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZTzMbgFd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bs19-20020ac86f13000000b003a7e21b2ccesi19512577qtb.23.2023.01.04.14.52.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Jan 2023 14:52:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZTzMbgFd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDBvd-0002Pg-NZ; Wed, 04 Jan 2023 17:08:09 -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 1pDBv1-00025L-UB for qemu-devel@nongnu.org; Wed, 04 Jan 2023 17:07:33 -0500 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDBuz-000629-8T for qemu-devel@nongnu.org; Wed, 04 Jan 2023 17:07:31 -0500 Received: by mail-ej1-x631.google.com with SMTP id vm8so79065096ejc.2 for ; Wed, 04 Jan 2023 14:07:28 -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=wmavs6sB32iuk0P3966mjPd+ATivEhkJqHU5LgWaQJM=; b=ZTzMbgFdAqNU+m8VRz2s+o2Vz5VeZXQ51dVr6ermRNbcO2+233UkuOZmWsdCFLihOs v0NXw4mi10RJSrjJCmmKxb8/gYg3P0mXfq+NxcpORte0pdXovaS3JVTJ25t2rLUFUfk+ mZX0m/TGcZbfZPvUip8vtzJqd8G7akAuh02cbjT1OvyfQHZHZIWsR6PbB1EW0xr+rkx+ h5m7sRBLJwiWrXIUApTFMu5D6mBbZLvYsgc22QA34RcoAddm/pQRR7S83oTSA+ZQ4osy l5slett8vvp+vKJfZK2xGrBj7EpdFGvAzv/RxR0lhebPGF/AaOHVI4mj0xNqryqEHtjI RLUA== 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=wmavs6sB32iuk0P3966mjPd+ATivEhkJqHU5LgWaQJM=; b=cTmFYl8KvWgHYBP9RSbbDaxLQhytYl3Gq/Bc3RhYDr1swcZ+m7+2BiFQoW8W21yDe7 jWrRUsCnq5YxkQboOLRPkIQfWNX+qzffTUQPYGFvOGJVgvXW6sfp5bI/kBdrG+aswlfl nGY1ENUGBmaPj3KSsIFF3A+gnKlgQft2QV6vvn8zHgnnDEFZOx9c3UpmI7JP2MisevrB rGVBg2VztB3ecUgfEY5CTW0tan5IN+jn0Jgx0FKxMdQq7RNkZqRXZsafeh3mpGzkMdMK vzvmEbX+3b9rDWSkBZkhAdntKaiR1nKjDeRauK9LQvSvNkVvT7vOiXcKDhORv4r86sxQ 1DyQ== X-Gm-Message-State: AFqh2kqp47cGASIsDfsW2tE/WXAvJDZYTy3BuFib0IsDRAex8nhN4izs Zaw1ZRe24D2gskOwS7ghrZReDJeC7g/aUJf7 X-Received: by 2002:a17:907:1385:b0:7c1:6167:7816 with SMTP id vs5-20020a170907138500b007c161677816mr35390562ejb.28.1672870047775; Wed, 04 Jan 2023 14:07:27 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id gs2-20020a170906f18200b007c491f53497sm16084240ejb.170.2023.01.04.14.07.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Jan 2023 14:07:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Song Gao , Antony Pavlov , Jan Kiszka , Marcel Apfelbaum , Hanna Reitz , Bernhard Beschow , BALATON Zoltan , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis , Paolo Bonzini , qemu-ppc@nongnu.org, Mark Burton , Richard Henderson , Magnus Damm , "Michael S. Tsirkin" , Bin Meng , Max Filippov , Aurelien Jarno , Eduardo Habkost , Palmer Dabbelt , Radoslaw Biernacki , Jiaxun Yang , "Edgar E. Iglesias" , Xiaojuan Yang , Peter Maydell , qemu-block@nongnu.org, qemu-riscv@nongnu.org, Yoshinori Sato , Alistair Francis , qemu-arm@nongnu.org, Leif Lindholm , Kevin Wolf Subject: [PATCH 18/20] hw/sh4: Open-code pflash_cfi02_register() Date: Wed, 4 Jan 2023 23:04:47 +0100 Message-Id: <20230104220449.41337-19-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230104220449.41337-1-philmd@linaro.org> References: <20230104220449.41337-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=philmd@linaro.org; helo=mail-ej1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org pflash_cfi02_register() hides an implicit sysbus mapping of MMIO region #0. This is not practical in a heterogeneous world where multiple cores use different address spaces. In order to remove to remove pflash_cfi02_register() from the pflash API, open-code it as a qdev creation call followed by an explicit sysbus mapping. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bin Meng --- hw/sh4/r2d.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 39fc4f19d9..43a8c56d14 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -302,10 +302,11 @@ static void r2d_init(MachineState *machine) * addressable in words of 16bit. */ dinfo = drive_get(IF_PFLASH, 0, 0); - pflash_cfi02_register(0x0, "r2d.flash", FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - 64 * KiB, 1, 2, 0x0001, 0x227e, 0x2220, 0x2200, - 0x555, 0x2aa, 0); + dev = pflash_cfi02_create("r2d.flash", FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + 64 * KiB, 1, 2, 0x0001, 0x227e, 0x2220, 0x2200, + 0x555, 0x2aa, 0); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x00000000); /* NIC: rtl8139 on-board, and 2 slots. */ for (i = 0; i < nb_nics; i++)