From patchwork Wed Oct 18 13:30:56 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: 735058 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp997004wro; Wed, 18 Oct 2023 06:37:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGT+0fk5W8LaTIlb6YkRaLRlt3ocPQfKdJQUu73TGaZprwvWdZq7C7bvkomJfSFwbaYKtg9 X-Received: by 2002:a25:ab4a:0:b0:d80:a9d:aeae with SMTP id u68-20020a25ab4a000000b00d800a9daeaemr5010908ybi.44.1697636245121; Wed, 18 Oct 2023 06:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697636245; cv=none; d=google.com; s=arc-20160816; b=OGClFq7k1TBDcJ9Nzq4J9ED1aNAqKkrv1vZIKUiTe9ZfYpbNLYfB4LEgoGVgLeVydm n1b1PBknH9t+mUaQjucTM9YqxJJRZDFtScIPHEHZJBTFuYsQXLiAHxD1saiEmr5ei46P NJjWlFM7o0ieprs5Xhds+l6ibIMuXhQNQaynJr+e/olGhJFcAZdAraNuncWa+V2j39x9 GZebfqcGdLL7Y98kXELKIIhxIrMpPFWkOkgOEcOeqCdKkORw8l/fvVNY1RucVEXX4Uzg FLxMkvlv0b+MDDT+njP66Z25ioppXxOStrzyDJXk2W1jaI43bOYPSfS8gGmNMrwv8uEf S0jA== 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=T/OzLFcKSh0UPM5Lh64d1MpdKJAnWvLj8FsUJLUNjvo=; fh=i/WIozb1pGRSSAvN281CL0P9xvW88xHKKqLcdnHBUKw=; b=I7R+wYhpSsmZQ3pk114a9tUwzoqCZ8DCF0VCz0IgesfrmBvx04UpuF1P+R/fJxp5px qqIfQbSVafL+xHv2IiIhy1Dd1EUsUv9AhAz2qZsdrVn1Ggj5aEY4HVA6DeR+Hb+vfow0 H07aX0gFrxW74Dey4rvC1abVXS14/hu4G0H7PMCPQDLu2KeHpNehqM9rBHcvB9zmr+r1 LI9UxkfaYpHcmQpm21cbpll0kvzuQ93UY+dp8bYWMSZBnUimrnH5pphHnwQVPDGV0jU5 iyGxZ1t+bXodBiPfSqfU27tSE+ai1RAfqWUuxgh7d3TH5gKo7UzW0+GZUh/iHaNqq+NA 6WpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VYVsTTWe; 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 w11-20020a0cdf8b000000b0066cfb9c84d9si2669099qvl.289.2023.10.18.06.37.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 06:37:25 -0700 (PDT) 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=VYVsTTWe; 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 1qt6e5-0007qi-0Q; Wed, 18 Oct 2023 09:31:33 -0400 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 1qt6dy-0007hr-VP for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:31:31 -0400 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 1qt6dw-0004k5-2Y for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:31:26 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-32d9552d765so5321022f8f.2 for ; Wed, 18 Oct 2023 06:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697635881; x=1698240681; darn=nongnu.org; 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=T/OzLFcKSh0UPM5Lh64d1MpdKJAnWvLj8FsUJLUNjvo=; b=VYVsTTWeNDrE4l/vtCPuXX8NUI+4C6lNbImc9WVJd3Jo5YZIuv8vCPlbXWdCsQC6Dz sURxUyujmp1aE73D+fy7CT4L/8Xq2A6Jwg9KNSdANG0mREhanQi7PGKS9Y7rSy3d8Oa3 MONCTX/Jp5oTKKLa+niQ+AQ1Y5mPq3f0/78eIwRCdMVbDRrpNuBLEwIMTfqhvro8N4/F fWtOjVGE0GyJsCFiTZ1FrJbk1vnv5s1y/i2Td1WFV36wHmPZi85PF6p1fjNZPvM+DpuF 3YiEyj10B4TzNZqIxOBLcBqD7ZZOIBjMldftpTEOUCNutdcihyHDzfP5AAQN6l3MB/By Fh4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697635881; x=1698240681; 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=T/OzLFcKSh0UPM5Lh64d1MpdKJAnWvLj8FsUJLUNjvo=; b=GbKuUx6pm8HO27rrbOFWzmQ3Ugch/JHlgDuhdgoddAb2Gy1u7VdSO5SuDw3TTiDlw3 J1PppEptUKjqTrfmENKBjFhohwI5LMDw2EP+hoFx5cvYDksgy19iCfs6R97CHTwUvcsd 2K6Ra+Asja3aAtU1blmLVDgv5smg597tOOjlRYIOsMhz7Y5fXBnoSBtzwIP9YtTaeMNW TKKdud4hCaLECTSNZKgVoWUei0uKu+bW67p9vJjzazeagqrTcgeQHWrMtyxzROXCMcKl wfsrFXExQAyz2FFOEwgGmmdtp4EdVzEzYzfY2cP5K+5VQ2ndKmwLaPoeIWrjggJnGwih cn2Q== X-Gm-Message-State: AOJu0YweSKJDy8ZpfNj/E+nETEtR4faoRFz9b03ohWnwWaqyGANBh7CO 7//O3CCyVnEaLc5NHZ3hnOkE3EfyHkAYbw6kFHE= X-Received: by 2002:adf:f982:0:b0:32d:b06c:80b2 with SMTP id f2-20020adff982000000b0032db06c80b2mr4791674wrr.0.1697635881371; Wed, 18 Oct 2023 06:31:21 -0700 (PDT) Received: from m1x-phil.lan (gyl59-h01-176-171-218-149.dsl.sta.abo.bbox.fr. [176.171.218.149]) by smtp.gmail.com with ESMTPSA id p14-20020adfcc8e000000b0032db1d741a6sm2128974wrj.99.2023.10.18.06.31.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Oct 2023 06:31:21 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , =?utf-8?b?RnLDqWTDqXJpYyBC?= =?utf-8?b?YXJyYXQ=?= , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/6] hw/ppc/pnv_xscom: Do not use SysBus API to map local MMIO region Date: Wed, 18 Oct 2023 15:30:56 +0200 Message-ID: <20231018133059.85765-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018133059.85765-1-philmd@linaro.org> References: <20231018133059.85765-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org There is no point in exposing an internal MMIO region via SysBus and directly mapping it in the very same device. Just map it without using the SysBus API. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/ppc/pnv_xscom.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c index cf892c9fe8..805b1d0c87 100644 --- a/hw/ppc/pnv_xscom.c +++ b/hw/ppc/pnv_xscom.c @@ -223,14 +223,12 @@ const MemoryRegionOps pnv_xscom_ops = { void pnv_xscom_init(PnvChip *chip, uint64_t size, hwaddr addr) { - SysBusDevice *sbd = SYS_BUS_DEVICE(chip); char *name; name = g_strdup_printf("xscom-%x", chip->chip_id); memory_region_init_io(&chip->xscom_mmio, OBJECT(chip), &pnv_xscom_ops, chip, name, size); - sysbus_init_mmio(sbd, &chip->xscom_mmio); - sysbus_mmio_map(sbd, 0, addr); + memory_region_add_subregion(get_system_memory(), addr, &chip->xscom_mmio); memory_region_init(&chip->xscom, OBJECT(chip), name, size); address_space_init(&chip->xscom_as, &chip->xscom, name);