From patchwork Thu Aug 26 07:15:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 502850 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp1330692jab; Thu, 26 Aug 2021 00:16:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDqatF4uEO8nK5XSl7pCcs7rsmoZ9rgQx7JU4xtcaILjEEhSOrJJsPnQkVXehmaXvCny0Q X-Received: by 2002:a05:6402:4d:: with SMTP id f13mr2736301edu.275.1629962173892; Thu, 26 Aug 2021 00:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629962173; cv=none; d=google.com; s=arc-20160816; b=rGnj/I9wMuU+UAkgoZQK9kxQqwgs/AWFhNYh8xuPj2cE6ZirzcF7/Oe6zl922vjz8v EvDQr7kr3T6cjwb0+s6vGYUBxW/SUCL4V1qpK2SQE6EfYdqv9229B2yWe33BLHQGq2/3 5PoWDgnxhIXHfg0NRjKD8lfkeWry+xu78ryquh9xDQHc9OO2ddy6JmHnyqDHuhPabUdX UP+ESAD0NYqeH5s3QNzG9WYaDAPbtMw8VdNgADDYoAM4UH/Uawid2DHpyEky7RjS710F CZpoT1hfXuPhgAFBIZ72s1I1JWxOEAO+RECqmsm8xaS4Y7P+SQEhagFsLRW232YmclBv 3RIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=0CekgEhhV94omM99Vq3yQRieUvwZzhTvLAg4OCzj4qQ=; b=M9dQdWH5CEAedNGfYypxHEdxHFSsYT7xYRLVEGbie5Bj89zQu/zWezNegQBrYXOsRS XA8yO039XSmlGMS6TOhObJq7r7q8dD7qFvwseQQVjAj0V0dOBoJULzy5S5APKZvhR3UT CwW4B4XS50ncHZOosVt5cblkukeRSFGso5gKCcDavWCKtLR89bPcH3FtOD/DYN6KUIkj o/B5C8r1iK6faX69Y9H+G8SZxmt0/dbWhmbmFmkUvjztfhuT776aoOKMsytk71jExu5x 3j6UmDLzK8juQuCCab7NKIVoaw4uw7B4KXDl6Sjy7njuqn0VvP2JKT9aS+c74EzElEgO Bcnw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g20si2615216ejm.455.2021.08.26.00.16.13; Thu, 26 Aug 2021 00:16:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240370AbhHZHQ7 (ORCPT + 3 others); Thu, 26 Aug 2021 03:16:59 -0400 Received: from foss.arm.com ([217.140.110.172]:40292 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240155AbhHZHQt (ORCPT ); Thu, 26 Aug 2021 03:16:49 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CA5CD1063; Thu, 26 Aug 2021 00:16:02 -0700 (PDT) Received: from u200856.usa.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 505AE3F5A1; Thu, 26 Aug 2021 00:16:02 -0700 (PDT) From: Jeremy Linton To: linux-pci@vger.kernel.org Cc: lorenzo.pieralisi@arm.com, nsaenz@kernel.org, bhelgaas@google.com, rjw@rjwysocki.net, lenb@kernel.org, robh@kernel.org, kw@linux.com, f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jeremy Linton Subject: [PATCH v3 3/4] PCI/ACPI: Add Broadcom bcm2711 MCFG quirk Date: Thu, 26 Aug 2021 02:15:56 -0500 Message-Id: <20210826071557.29239-4-jeremy.linton@arm.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210826071557.29239-1-jeremy.linton@arm.com> References: <20210826071557.29239-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Now that there is a bcm2711 quirk, it needs to be enabled when the MCFG is missing. Use an ACPI namespace _DSD property "linux-ecam-quirk-id" as an alternative to the MCFG OEM. Signed-off-by: Jeremy Linton Acked-by: Florian Fainelli Acked-by: Bjorn Helgaas --- drivers/acpi/pci_mcfg.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.31.1 Acked-by: Nicolas Saenz Julienne Acked-by: Rafael J. Wysocki diff --git a/drivers/acpi/pci_mcfg.c b/drivers/acpi/pci_mcfg.c index 53cab975f612..04c517418365 100644 --- a/drivers/acpi/pci_mcfg.c +++ b/drivers/acpi/pci_mcfg.c @@ -169,6 +169,9 @@ static struct mcfg_fixup mcfg_quirks[] = { ALTRA_ECAM_QUIRK(1, 13), ALTRA_ECAM_QUIRK(1, 14), ALTRA_ECAM_QUIRK(1, 15), + + { "bc2711", "", 0, 0, MCFG_BUS_ANY, &bcm2711_pcie_ops, + DEFINE_RES_MEM(0xFD500000, 0xA000) }, }; static char mcfg_oem_id[ACPI_OEM_ID_SIZE]; @@ -198,8 +201,22 @@ static void pci_mcfg_apply_quirks(struct acpi_pci_root *root, u16 segment = root->segment; struct resource *bus_range = &root->secondary; struct mcfg_fixup *f; + const char *soc; int i; + /* + * This may be a machine with a PCI/SMC conduit, which means it doesn't + * have an MCFG. Use an ACPI namespace definition instead. + */ + if (!fwnode_property_read_string(acpi_fwnode_handle(root->device), + "linux-ecam-quirk-id", &soc)) { + if (strlen(soc) != ACPI_OEM_ID_SIZE) + dev_err(&root->device->dev, "ECAM quirk should be %d characters\n", + ACPI_OEM_ID_SIZE); + else + memcpy(mcfg_oem_id, soc, ACPI_OEM_ID_SIZE); + } + for (i = 0, f = mcfg_quirks; i < ARRAY_SIZE(mcfg_quirks); i++, f++) { if (pci_mcfg_quirk_matches(f, segment, bus_range)) { if (f->cfgres.start)