Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp1402824pxy; Sun, 15 Aug 2021 20:17:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0MYd2apnq+cLunUfULElDqWXBF4knKPgcbtd7QeeH7mNzklbBvlGKz1JUn8B/1GDII3eg X-Received: by 2002:a05:6e02:134e:: with SMTP id k14mr10566210ilr.31.1629083865274; Sun, 15 Aug 2021 20:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629083865; cv=none; d=google.com; s=arc-20160816; b=VnGGHujiB3nI0hX4agIZKHjURzC+1UC5DJY5YJf/OoW3ZjVWNud6sn1wqfzsMoW4PA 8GOIpgUEbPbV/RN0DABMZjxjONF9qKKSPY8LdJCv+rJJjPCrDAMtHtVeTw5Sc2NXoFUX ANK57NETvkxlUe++Ak/eZK5Gh2g+TxlLffKz2CooaOLa1t/LGcm4Gp3nP2Va+ejOIVES V62poYkFWTg3R1qST4YtovcctIUttYO5ACIyqQmt/UyrrT+BPcz6k2Pw3LXA3ozVKwlk 1wsVBzE+hgVt19tStRzjo/7Q1zBeUgXxCyMQhTtSL+CHJ9eBFe0hEL4y9bdNiK+T1uto SQ1w== 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 :message-id:date:subject:cc:to:from; bh=YpaFNDiui7zFp+ZoL/K8CWDCtxfRHGz77fTf+FIeKEg=; b=izI1/aGxZ0s6rU0C3tlJDBhick+vswfU4NunyUIf/S9sApQrDl+i9ICioEdvvHPC7v UuEvUv3oVeO7Sze8qzYHBPiC29b+tK+vOn3w6m0Y5nM7PKLd/CSBWl/EFQq7I8cPEnVj By0OuAQRh+7Ryc4B1RI+zpOfeTKy61KtgOHJN99AuoKoQSULIYGT/vA1kzayxX6a384m Bz2H0/MtIpo0zhfQJm+SDwXXH0l/UKL3FkRk25ixgrGXjamS+Ush2HlDKDjX4WO2QgHz VYng8LKtwXpIK27yNOSx5XFoKmucAg7lp+zO0k7HnnGUsGe2QXY8BuQqLajh88Fd/cm+ aXsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si9563566jai.112.2021.08.15.20.17.34; Sun, 15 Aug 2021 20:17:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231673AbhHPDRP (ORCPT + 99 others); Sun, 15 Aug 2021 23:17:15 -0400 Received: from [138.197.143.207] ([138.197.143.207]:45154 "EHLO rosenzweig.io" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S229663AbhHPDRO (ORCPT ); Sun, 15 Aug 2021 23:17:14 -0400 From: Alyssa Rosenzweig To: linux-pci@vger.kernel.org Cc: Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Alyssa Rosenzweig , Stan Skowronek , Marc Zyngier , Mark Kettenis , Sven Peter , Hector Martin , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/6] Add PCI driver for the Apple M1 Date: Sun, 15 Aug 2021 23:16:15 -0400 Message-Id: <20210816031621.240268-1-alyssa@rosenzweig.io> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds a PCIe driver for the internal bus on the Apple M1 (and presumably other Apple system-on-chips). It's based on the work of Marc Zyngier, Mark Kettenis, and Stan Skowronek (Corellium). In conjunction with a pinctrl driver, this enables the USB type-A ports and the Ethernet port. It also paves the way for Wi-Fi and Bluetooth, but that requires further work. For the largest change since v1 of the series-- this now uses Mark Kettenis's device tree bindings for PCIe. This series contains Mark's patches (currently under discussion on the LKML) adding the device tree nodes required for PCIe. I have made minor modifications to Mark's original patches to get everything working under Linux: * In the bindings themselves, I've increased the maximum number of interrupts to accommodate the full set. * In the PCIe node, I've added the full set of interrupts. * I've added the PCIe DART nodes (IOMMUs) and the corresponding iommu-map(-mask) properties already covered in the bindings. * I've tweaked the sizes of the `reg` blocks. Otherwise I got a page fault early on. I've collected the patches required to test on this branch: https://github.com/mu-one/linux/commits/pcie-v2 This branch is based on linux-next and contains a GPIO (pinctrl) driver, a clock gate driver, additional device tree nodes, and this series. The type-A ports and Ethernet should work out-of-the-box on that tree, provided the kernel is booted through m1n1. This improves on Maz's initial PCIe driver, which required U-Boot to function. I've started using Linux on M1 as my workstation for Panfrost development, so this should have 40 hours of testing by this time next week. == Project Blurb == Asahi Linux is an open community project dedicated to developing and maintaining mainline support for Apple Silicon on Linux. Feel free to drop by #asahi and #asahi-dev on OFTC to chat with us, or check our website for more information on the project: == Changes == Changes for v2: - Cherrypicked Mark's device tree bindings and switched to using them. - Split up the PCI driver patch into 3. - Large numbers of minor changes to the driver better match upstream quality standards (using more helper functions, etc.) Alyssa Rosenzweig (3): PCI: apple: Add initial hardware bring-up PCI: apple: Set up reference clocks when probing PCI: apple: Add MSI handling Mark Kettenis (3): dt-bindings: pci: Add DT bindings for apple,pcie arm64: apple: Add pinctrl nodes arm64: apple: Add PCIe node .../devicetree/bindings/pci/apple,pcie.yaml | 166 +++++++ MAINTAINERS | 7 + arch/arm64/boot/dts/apple/t8103.dtsi | 207 ++++++++ drivers/pci/controller/Kconfig | 12 + drivers/pci/controller/Makefile | 1 + drivers/pci/controller/pcie-apple.c | 448 ++++++++++++++++++ 6 files changed, 841 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/apple,pcie.yaml create mode 100644 drivers/pci/controller/pcie-apple.c -- 2.30.2