From patchwork Thu Oct 19 21:17:50 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: 735643 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:32c:eacc:7fa with SMTP id o1csp1750676wrj; Thu, 19 Oct 2023 14:28:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/k3OgL8yfE6JljVpf741i197CoItrsysMBICR/ipZPZMCJQqoNi+HFuYEskPamqd+L3ne X-Received: by 2002:a05:6808:bc1:b0:3a9:cfb5:462a with SMTP id o1-20020a0568080bc100b003a9cfb5462amr21167oik.36.1697750893205; Thu, 19 Oct 2023 14:28:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697750893; cv=none; d=google.com; s=arc-20160816; b=vpwrwqQ3CDchFNZb5cLto/PsSXRh4LdUVHRn7zOxF2FwylCULoVbSZBsJ926JUNF62 WozdNUhD7w8Sf6ZzlC6cu3iTwuR0fS7bbcMRffIrTrG2cOY3eraDCfFyE47t8+4AN4c2 1PM6sggEDAvHgUgCwMDmewqZMQgrQBz3um0R2Jb1eTRcRu80BIsXaYLAUNEAx7QAJZat 0UujY4jaMA4i8g0AEJfGwt8zDDNDAn3/R9ibSEpoeBqGjgSX1uhstul1iij7V4AMjRXT x/R4T9kk6d1ZMTTY4huH49DZrIX1ndXNmroLWToieBKkrXCY8xMEES4zD3j3WtDOmuiS PXlw== 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=yHJOUZD7CaeAazVTXdyNVPRKOq5TT8EL7NxW6Z1zYOU=; fh=gPUAZr3rG5AAum2cFS0vXpLjRIjvY8asn41zDrAXuoE=; b=xIXDiKX0B18sX00VusRlpAXQDXJ8Vt0npQiPKUdETbsWuwR/R+4nHzOGCyoDmB6tln IjXC1agVty9HboxROxEtgJah55dEjxBz7oGMLbUXHEujYHLPG0Xy6SUfofVOGaYatGJR 8YO72sCKLWKaUaRtsDstz9cNcRzrb7xYDizj6i5KCNlhbKPf/ZZsk2QDiEQ627LtFANl 1cEyxPbFb85aMER+t3o4xCoV0GRpQVtmzx5LRPmSPEczeuCfZOagxa76b1R4MUJ3//TA W6ZHlvX+0XY4wKTVd5JX5swwGxZvu0uL9ERIpNnvgHKEDF3Y1Y2IqeXguBmwTO8iapir 8c9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iaYz1cUW; 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 k9-20020a05620a0b8900b0076dac93a764si257119qkh.379.2023.10.19.14.28.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 14:28:13 -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=iaYz1cUW; 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 1qtaSO-0001K9-Ms; Thu, 19 Oct 2023 17:21:28 -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 1qtaSK-0001Fb-4e for qemu-devel@nongnu.org; Thu, 19 Oct 2023 17:21:24 -0400 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 1qtaSA-0005je-C5 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 17:21:22 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40838915cecso992745e9.2 for ; Thu, 19 Oct 2023 14:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697750463; x=1698355263; 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=yHJOUZD7CaeAazVTXdyNVPRKOq5TT8EL7NxW6Z1zYOU=; b=iaYz1cUWQf2hsNHJvSX4EQs86ObNTeNkfye8axiciYd8S8OlL04rP6AEPeyCppCc6D GErJD74Wyw8GtzClDjf7ymzMUt9MddE82fk9DsDlokXejg3gvxw8JSklON/v8sRzKe2M ao5HjVQW5p9cTr7IpSAKozK+HuPIBAsLSOXr8gHrXjDYcpl6Btr47mowACJaezE4ST8R rAFo33gfg3CbGP3BJ/MOZsdoY90Dk55AOp8NLpi+HKGjHd/YeZbwUmHpEGgzK+SQOj0K PuBLJyXjxuoSy4P36aaYOK5Gzy06De37gBN8QDWfbAKNiiZ9CptbSm3/CRKKGDxWlbyl iAlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697750463; x=1698355263; 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=yHJOUZD7CaeAazVTXdyNVPRKOq5TT8EL7NxW6Z1zYOU=; b=mIHIolHLnyae7Og1TcHvA6Xfu3+F4viSYrppxgr6OVedaVyeoOa9biLrhh++bU4MOk clLOgd6TzgWuOb7to6tRe6OkR/GbCLgKTAEH9bBiAEk5Ksgzjyn3YbULpEMoaz9DS04R t/nKNEqSc9i0DwvoHNELP96PAlqn7efPWSv+D0Fm5BQCyEVEfW9vsF+zxFgZ5DvIk9c7 6VFUt1cGvBlGNtME6b6csAZr9X7fLd/oLnS/C0aWB/1dyBKtqY5LuccxUOe4OdbfLIhK prywV2ZUFk4YIJ+gKo3FHR4d12H5uMOjNeeYg67brf5w7e4ncbM/RyYWV5C4FQe6t0wc OnTA== X-Gm-Message-State: AOJu0YwWqbOc01eDlLkPSm5ldGpiR1FQVdjUrns2XMgar6+9OTZNaG3f bBokfB1sGU57OcUaGeI/VKeDBy10XaBFW67vYYvCLg== X-Received: by 2002:a05:600c:4f12:b0:408:364e:34a2 with SMTP id l18-20020a05600c4f1200b00408364e34a2mr17988wmq.10.1697750462773; Thu, 19 Oct 2023 14:21:02 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id p6-20020a5d6386000000b00327b5ca093dsm209316wru.117.2023.10.19.14.21.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 14:21:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Thomas Huth , LIU Zhiwei , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Nicholas Piggin , =?utf-8?b?RnLDqWTDqXJpYyBCYXJyYXQ=?= Subject: [PULL 25/46] hw/ppc/pnv_xscom: Move sysbus_mmio_map() call within pnv_xscom_init() Date: Thu, 19 Oct 2023 23:17:50 +0200 Message-ID: <20231019211814.30576-26-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019211814.30576-1-philmd@linaro.org> References: <20231019211814.30576-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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 In order to make the next commit trivial, move sysbus_init_mmio() calls just before the corresponding sysbus_mmio_map() calls. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: LIU Zhiwei Reviewed-by: Cédric Le Goater Message-Id: <20231019131647.19690-4-philmd@linaro.org> --- include/hw/ppc/pnv_xscom.h | 2 +- hw/ppc/pnv.c | 9 +++------ hw/ppc/pnv_xscom.c | 3 ++- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h index 41671001da..35b19610f7 100644 --- a/include/hw/ppc/pnv_xscom.h +++ b/include/hw/ppc/pnv_xscom.h @@ -170,7 +170,7 @@ struct PnvXScomInterfaceClass { #define PNV10_XSCOM_PEC_PCI_BASE 0x8010800 /* index goes upwards ... */ #define PNV10_XSCOM_PEC_PCI_SIZE 0x200 -void pnv_xscom_init(PnvChip *chip, uint64_t size); +void pnv_xscom_init(PnvChip *chip, uint64_t size, hwaddr addr); int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset, uint64_t xscom_base, uint64_t xscom_size, const char *compat, int compat_size); diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 456631c9dc..10158f7684 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1249,8 +1249,7 @@ static void pnv_chip_power8_realize(DeviceState *dev, Error **errp) assert(chip8->xics); /* XSCOM bridge is first */ - pnv_xscom_init(chip, PNV_XSCOM_SIZE); - sysbus_mmio_map(SYS_BUS_DEVICE(chip), 0, PNV_XSCOM_BASE(chip)); + pnv_xscom_init(chip, PNV_XSCOM_SIZE, PNV_XSCOM_BASE(chip)); pcc->parent_realize(dev, &local_err); if (local_err) { @@ -1508,8 +1507,7 @@ static void pnv_chip_power9_realize(DeviceState *dev, Error **errp) Error *local_err = NULL; /* XSCOM bridge is first */ - pnv_xscom_init(chip, PNV9_XSCOM_SIZE); - sysbus_mmio_map(SYS_BUS_DEVICE(chip), 0, PNV9_XSCOM_BASE(chip)); + pnv_xscom_init(chip, PNV9_XSCOM_SIZE, PNV9_XSCOM_BASE(chip)); pcc->parent_realize(dev, &local_err); if (local_err) { @@ -1719,8 +1717,7 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp) Error *local_err = NULL; /* XSCOM bridge is first */ - pnv_xscom_init(chip, PNV10_XSCOM_SIZE); - sysbus_mmio_map(SYS_BUS_DEVICE(chip), 0, PNV10_XSCOM_BASE(chip)); + pnv_xscom_init(chip, PNV10_XSCOM_SIZE, PNV10_XSCOM_BASE(chip)); pcc->parent_realize(dev, &local_err); if (local_err) { diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c index af57b55863..cf892c9fe8 100644 --- a/hw/ppc/pnv_xscom.c +++ b/hw/ppc/pnv_xscom.c @@ -221,7 +221,7 @@ const MemoryRegionOps pnv_xscom_ops = { .endianness = DEVICE_BIG_ENDIAN, }; -void pnv_xscom_init(PnvChip *chip, uint64_t size) +void pnv_xscom_init(PnvChip *chip, uint64_t size, hwaddr addr) { SysBusDevice *sbd = SYS_BUS_DEVICE(chip); char *name; @@ -230,6 +230,7 @@ void pnv_xscom_init(PnvChip *chip, uint64_t size) 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_init(&chip->xscom, OBJECT(chip), name, size); address_space_init(&chip->xscom_as, &chip->xscom, name);