From patchwork Mon Jul 25 16:39:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 12928275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E35A5C433EF for ; Mon, 25 Jul 2022 16:40:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Rc24sVDWQ3i9Gm3R8SNXzpXAiX0QKpr+M+FtQPXMDtE=; b=nCv4BDvfea17cc 111pPfLQ6aDgSbSlccPQM6xLYE2hHQuBADzLOWL9ox8PhNccAykif0YtwmV/CVMJy9G2w9iKoN+vW 2s0eqNlQeM+dsQEbiCKxGjOKLSyJwUael+LEn1B90uDtdvIOJjKYZQY9SQm/XtFedofaIEa2qCFPx JlW/1pYWJimGIXkb3pCo8MU6AwbbFvS5wnWH26YX70egG9RVrxw4/ckufO7CccRNMsdqQL997DA9l 54V06Dysh09YX/bRmve+auD1Cst8hr0Ar+1zhFele0w6uQcwqvG8HTEiXI3s/XI4lyAv/6sBgX9yv sO0C3EmvAI9tshk3Wjzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oG16z-00Fi56-TO; Mon, 25 Jul 2022 16:39:17 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oG16x-00Fi1c-7L for linux-arm-kernel@lists.infradead.org; Mon, 25 Jul 2022 16:39:16 +0000 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 1719D2B; Mon, 25 Jul 2022 09:39:09 -0700 (PDT) Received: from mammon-tx2.austin.arm.com (mammon-tx2.austin.arm.com [10.118.28.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4C26F3F73D; Mon, 25 Jul 2022 09:39:08 -0700 (PDT) From: Jeremy Linton To: linux-pci@vger.kernel.org Cc: will@kernel.org, bhelgaas@google.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, lpieralisi@kernel.org, kw@linux.com, mark.rutland@arm.com, sudeep.holla@arm.com, boqun.feng@gmail.com, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jeremy Linton Subject: [PATCH 0/4] PCI SMC conduit, now with DT support Date: Mon, 25 Jul 2022 11:39:01 -0500 Message-Id: <20220725163905.2024437-1-jeremy.linton@arm.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220725_093915_343917_C76D74CC X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is a rebase of the later revisions of [1], but refactored slightly to add a DT method as well. It has all the same advantages of the ACPI method (putting HW quirks in the firmware rather than the kernel) but now applied to a 'pci-host-smc-generic' compatible property which extends the pci-host-generic logic to handle cases where the PCI Config region isn't ECAM compliant. With this in place, and firmware managed clock/phy/etc its possible to run the generic driver on hardware that isn't what one would consider standards compliant PCI root ports. The DT code was tested on the RPi4, where the ACPI/SMC is upstream in TF-A and EDK2. On that platform the PCIe works as expected utilizing the generic host driver rather than the pcie-brcmstb driver. [1] https://lkml.org/lkml/2021/1/4/1255 Jeremy Linton (4): arm64: smccc: Add PCI SMCCCs arm64: PCI: Enable SMC conduit PCI: host-generic: Add firmware managed config ops dt-bindings: PCI: Note the use of pci-host-smc-generic .../bindings/pci/host-generic-pci.yaml | 24 +++- arch/arm64/kernel/pci.c | 109 ++++++++++++++++++ drivers/pci/controller/pci-host-common.c | 34 ++++-- drivers/pci/controller/pci-host-generic.c | 6 + include/linux/arm-smccc.h | 29 +++++ 5 files changed, 186 insertions(+), 16 deletions(-)