From patchwork Thu Aug 19 21:56:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 499776 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp933690jab; Thu, 19 Aug 2021 14:57:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzt9znBatrHgQUF9v7ax0p/ENs+KJRaSP9sholsHboaDHWqpcy2+cUqip55vEgNLe2HESDs X-Received: by 2002:a05:6e02:f91:: with SMTP id v17mr6380700ilo.0.1629410249629; Thu, 19 Aug 2021 14:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629410249; cv=none; d=google.com; s=arc-20160816; b=eR5GIp0zIfquNdHjzFeJXLtJokpK7mzWyY8aa+lvu2LRwwY/l5yodGV8kM/P7CC5sb Z88DgGo3SJJDetvmdOqPTJVdJsaY9W5RXdkR6V5zD7dQFpcCg6BT/UG0FSeIwUAMM3pH ni7yaOG9+CDQyuzFbXc5Yc3zlCO7PI4cRsmki6a1Wb62IqBXZNifzQr0hjl1+sOFtpAt dokFRlzMWWRRm6xeZ5TaUkKY9nTmszw+EzW03j19DClClaY3LrFXiF5XItFD+IRya8dl ij2WOCYETAPhKXNNeELMyO9dv47hqHvVqIAeJQzuYdvDY5G1NlNOcsbdk5NRsZPRcec8 hQZg== 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=TbPUfQ1Oq384j8zaTR4OA9g6kaTA0aScEM5AbVEoTIw=; b=qq2OmPyxz3JApnJ5/gqh8Enyhjkh/zFvnYt16KLI99C+KoPeaOfEuQ5UhpkVldES7/ yOgWWSdSGQhzJvgLZg0fF8sJruppxGUd3hZmmGCBf3c+8cQ/4DhLFyEXHtSHCqK74QbI wWyge7BUMFxNgo4GfZFhvoM3tF/6hsAaIZHsWntEB7oveitPVvfGONecsEuGG4qzgzxd 2FGMT2Op/D2O5PWIaWvt/1zwbCeqJTtYfzIKzgaIx5IePgI9uda+goPmxcpY6so2Rq4W 4V3pe3hXaI+HJWEpzlyszHcBIvdIhjvjMNkcTRL1Z1WGFd+9Xw4ctQtFjsD3w8rg0DNh aC6g== 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 h10si4106500ioe.21.2021.08.19.14.57.29; Thu, 19 Aug 2021 14:57:29 -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 S236028AbhHSV6E (ORCPT + 3 others); Thu, 19 Aug 2021 17:58:04 -0400 Received: from foss.arm.com ([217.140.110.172]:47550 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235771AbhHSV55 (ORCPT ); Thu, 19 Aug 2021 17:57:57 -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 442091435; Thu, 19 Aug 2021 14:57:20 -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 ACA283F40C; Thu, 19 Aug 2021 14:57:19 -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, sdonthineni@nvidia.com, stefan.wahren@i2se.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 v2 3/4] PCI/ACPI: Add Broadcom bcm2711 MCFG quirk Date: Thu, 19 Aug 2021 16:56:54 -0500 Message-Id: <20210819215655.84866-4-jeremy.linton@arm.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210819215655.84866-1-jeremy.linton@arm.com> References: <20210819215655.84866-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 --- drivers/acpi/pci_mcfg.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.31.1 diff --git a/drivers/acpi/pci_mcfg.c b/drivers/acpi/pci_mcfg.c index 53cab975f612..4b991ee5c66c 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), + + { "bcm2711", "", 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,18 @@ 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)) { + 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)