Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp713945pxy; Sat, 14 Aug 2021 21:37:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHOtxYWlOoiNKMSUCxhuUOEpb6HX+LTt9aRiLyVJACY3ui/P+8qmHnJWoZvltOHTZ+4i0i X-Received: by 2002:a17:906:1701:: with SMTP id c1mr9960870eje.425.1629002227254; Sat, 14 Aug 2021 21:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629002227; cv=none; d=google.com; s=arc-20160816; b=b8v4PFDZ4NhARghS5DPqa+aDZ2h4TCdEkz/+xiPkhfGR4qKejCkvSniIGGzuo4rOYr Smn94eMsKAuwx3k9o7qqNVv+oHhq1z6eRN1AW/CNMsWpLt5+YjUmRkJ+YQ3RbfXoCAlL cfxG838hzYDT27Iyq9afHmT6RMLptfGLQPw3BWDvac/GzbibIZpmmqhimBT3Z9mE7KFc 9Y7VfcZi6j3lsZzZMgdp0xy+GEZgsULxJ1Y7qd6MjdaN/EdyaQ1CdzYoTlcon2jpIAxr 3vOMP/jYIlkzaPSWbMMRH81nF01U/6jJzLn8zj/+nvjwqJzjjrxGN/tgcesFXxZYY49J EmRw== 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=lTcMF+vBshGDRMqdnqM1QO56wZaQgAzUt2lK4tXHqEU=; b=ZkT6XRY3RUU27i2tK6im+aLyPsFRQT3D3Iub4Wi6JKnsY5vF22/tlZ/SiGI/E3gDf4 hB02ZVcGaQ9Q9SldqGrg350WU6ZjwEKjoK7W33Cfem0LS59xlMSsEBkWcYkxlEC5dGZf akDanjiRd62Yec3+iZ0WA9q1KAtTaT0m9Ok7b4Q33uZ6uB3C2vEIWgnoVmfrlQrSUilQ ojDBXkottoQ9l7ew0LCozpiCIy3qSjVaoSmFcH/G2nGKoVTpboYMOLcKOmLmWEKmJNVw btO10vwNylg9K4OwOLbq9sLs80j2fDeqVIQKkHlAz3ta9Fcixs+DaCUDx+rdh0tYdDzY KVug== 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 q19si6711622edb.43.2021.08.14.21.36.43; Sat, 14 Aug 2021 21:37:07 -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 S229740AbhHOE0J (ORCPT + 99 others); Sun, 15 Aug 2021 00:26:09 -0400 Received: from [138.197.143.207] ([138.197.143.207]:44910 "EHLO rosenzweig.io" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S229452AbhHOE0I (ORCPT ); Sun, 15 Aug 2021 00:26:08 -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: [RFC PATCH 0/2] Add PCI driver for the Apple M1 Date: Sun, 15 Aug 2021 00:25:23 -0400 Message-Id: <20210815042525.36878-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 proper device tree and a GPIO 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. The device tree patch is not included here, as it depends on the GPIO driver which is still work-in-progress. Nevertheless, I feel comfortable submitting "PCI: apple: Add driver for the Apple M1". I expect review feedback will be concentrated on the device tree bindings. These bindings are a mish-mash of what's in the Marc's initial driver, Corellium driver, and Mark's U-Boot downstream. They differ from Maz's bindings by including nodes necessary for hardware bring-up, but are simplified from Corellium's bindings by omitting tunables which are handled by the Asahi Linux bootloader (m1n1). I am new to device tree and expect "dt-bindings: PCI: Add Apple PCI controller" to need changes. This was my first time working with YAML bindings; please be gentle :-) I've collected the patches required to test this branch on this branch: https://github.com/mu-one/linux/commits/pcie This branch is based on linux-next and contains a GPIO (pinctrl) driver, this series, and updates to the M1 (T8103) device tree. The type-A ports and Ethernet should work out-of-the-box on that tree, provided the kernel is booted through m1n1. This is a noticeable improvement 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. Alyssa Rosenzweig (2): dt-bindings: PCI: Add Apple PCI controller PCI: apple: Add driver for the Apple M1 .../devicetree/bindings/pci/apple,pcie.yaml | 153 ++++++ MAINTAINERS | 7 + drivers/pci/controller/Kconfig | 13 + drivers/pci/controller/Makefile | 1 + drivers/pci/controller/pcie-apple.c | 466 ++++++++++++++++++ 5 files changed, 640 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/apple,pcie.yaml create mode 100644 drivers/pci/controller/pcie-apple.c -- 2.30.2