From mboxrd@z Thu Jan 1 00:00:00 1970 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 73AAACDE00E for ; Thu, 25 Jun 2026 21:58:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wXBSiVYw4dw99aOLLsw4EHudQGFh22uKX4umeTTHsO4=; b=LCIKcc3J3I0Gss/3AFDnZkqxEK d96khsU6shTtX/lP8tNXE2bD6pRHzvvnDypFn0tWVORqWzCrjTJfjxIEo/abCU4D9pWTIbMHHFiy9 UKUbldeLmaufjURxJT5TWFOHRrUIHm81LTpZH1PFJukhBEFZb+aDpj3j+Nn7wyfxmVQkO7M2tvi7d pjSC0miEbNAoVoRisuLlsT27nzvrmWbT4LJWQSsz1aOBEP5MBoKwmI2UIWPjjrgdRB6dV8+shy40d CW/sCFF4+fFzTjPyPd2SESQRjZQMmbPWgwHSnUeTTsSF8DV64gk/8NAnugoraN534MIz5Tmw8iInD byBEBX6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wcs5P-00000009tma-2axC; Thu, 25 Jun 2026 21:58:15 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wcs5E-00000009teT-1phw for linux-arm-kernel@lists.infradead.org; Thu, 25 Jun 2026 21:58:06 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-490b8ac62baso13169005e9.0 for ; Thu, 25 Jun 2026 14:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782424682; x=1783029482; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=wXBSiVYw4dw99aOLLsw4EHudQGFh22uKX4umeTTHsO4=; b=U5UWA22hfbjN/+JbEDyw/vQiS0LgnTIYpAefbeyv+0kIYPEHQVtEmJ2kd4pv+fen7a HMP64LpeHHIJ9MZ8LvK2FcWh3fOG1eufKJkGKYAUVvwH9glyFLQeytKSRFSZ+Rup2fVf jV3A95tsHteSc3uczASdmhUROeZ3tkzGVe1jdZzT32iqUAKbpeY75AG5HUamcri6iu8L iQWwn+hcLtVVHp4CPAPK1EZSFFAIgklrSkLs4zj0YxtK4757yyih2wY5EZLP+T/fEMbI AA52OcoP0oBDtJzUDEWQPZa3IwtVG6WLUlM5ftyi+ppFoOhPeZNytNls8iImQC89Jt5A sYQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782424682; x=1783029482; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=wXBSiVYw4dw99aOLLsw4EHudQGFh22uKX4umeTTHsO4=; b=sOe2fYGdwYCs8fgqaUCF8nTA0Z31GiFTiBc4u6A0+R7s9yVOYPTrmGc8ty8DeAy/Cq JmaTIFkVUre74s8fU/cjH8zcMmq1nZ51+5eBEIYWZ1yHUEVV+9QnIHjw+rNcDMXcjmDo o7Y7Kqa1Wx0GmB5WawmAhQTVbY6mZK1ovBnQSZ2RhjKpyNHhUZZRnfzfLa5DmHB+ccL0 TUfuHIec1f/SIyA8kD3meVFnzy6JQ2437yFHKBx6pzKR/Wsw/X7DyaDm+u24szENTPMt Y6ruMinGUxGgypb9b7u/c2Za36TuDMW9dHOLD9J3I+2DEJIKdVo+oqr2vWoC6iZBsnZ2 bbow== X-Forwarded-Encrypted: i=1; AFNElJ8SUu9uoSSy3JBUNx6Q1JbZE8LZdEBnv2u8JnYNWLD9Ye85C5MkeYoWYnFKejSmXrZp6nd9maP3qQzw3uc6Vh7o@lists.infradead.org X-Gm-Message-State: AOJu0Yx94W4E6XfwYgBlHGWpcDtEscOiuaRD95b592EbCsFORwxwR7zm QAf7B7Gy3Be3uuFhH9lHw3UHJl1QViDds28fLi+GiBQYmX2QbBal9mri X-Gm-Gg: AfdE7cnm9H1uLyrlbg9S8JJV+snUTMKOrBKO2fpLkur5n4QHjcqtAokzjpgsOHo8Zlj BVWhwZ2VdqAPV8pRztaXWXAtpEMfcmB2ms311S4qA9KggPynrC/xvjjGzVUF92u+Mtbbqws82W1 pXGnhqoZcjh8miGnoZ2BdW4txuBsN4+FH4QUxWzRCHxXXzmS4TND2TCzM3BNTubBK1P2BicHDNA c5cywtO501M6x6rMu2txRy7m52wuJZlorqL8iLwgwHeUJIf0EFr6qsLiuj9hUw2OOrXdpjrNEMy CS5xFXdrIzJmKjWafN69jhDCwSbpUrEj/FMSVqGpErV4ARBO452S28xB574gDW7OKRBqA+vjfuT CqlS/p4MzOARWxJSrRPD/rezu1+9ayDw2PWXR6eXNIUvmaSFoV3+/SyAYnyM3Lkc2o+69duFaNB UbQ2EupBRYN6xMQfOfeUtTsSo8G239h1Ku/biE8zEYu34Q9nUDWJ9qepAly5Jd+lTceptwuCokN 3Al+lB4QM2d X-Received: by 2002:a05:600c:638e:b0:490:7df7:9190 with SMTP id 5b1f17b1804b1-492663ea3d3mr48190505e9.8.1782424682103; Thu, 25 Jun 2026 14:58:02 -0700 (PDT) Received: from Ansuel-XPS24.localdomain (host-80-183-219-152.pool80183.interbusiness.it. [80.183.219.152]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-492690988e0sm27339185e9.14.2026.06.25.14.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2026 14:58:01 -0700 (PDT) From: Christian Marangi To: Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Ryder Lee , Michael Turquette , Stephen Boyd , Brian Masney , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Christian Marangi , Jianjun Wang , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/4] dt-bindings: PCI: mediatek-gen3: Split Airoha schema and document 2-lanes Date: Thu, 25 Jun 2026 23:57:36 +0200 Message-ID: <20260625215741.3253212-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260625215741.3253212-1-ansuelsmth@gmail.com> References: <20260625215741.3253212-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260625_145804_545798_EBF25318 X-CRM114-Status: GOOD ( 19.81 ) 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 To permit proper documentation of required property to support PCIe configured for 2-lanes mode, split the Airoha schema part from the mediatek-gen3 schema to a dedicated schema. A PCIe configured for 2-lanes mode require an additional reg for the secondary PCIe to be configured and the airoha,scu phandle to correctly configure the PCIe MUX. Rework the mediatek-gen3 schema to drop any redundant constraint previsouly introduced for Airoha PCIe properties. Signed-off-by: Christian Marangi --- .../bindings/pci/airoha,en7581-pcie.yaml | 251 ++++++++++++++++++ .../bindings/pci/mediatek-pcie-gen3.yaml | 77 +----- 2 files changed, 256 insertions(+), 72 deletions(-) create mode 100644 Documentation/devicetree/bindings/pci/airoha,en7581-pcie.yaml diff --git a/Documentation/devicetree/bindings/pci/airoha,en7581-pcie.yaml b/Documentation/devicetree/bindings/pci/airoha,en7581-pcie.yaml new file mode 100644 index 000000000000..977c1816572c --- /dev/null +++ b/Documentation/devicetree/bindings/pci/airoha,en7581-pcie.yaml @@ -0,0 +1,251 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pci/airoha,en7581-pcie.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Gen3 PCIe controller on Airoha SoCs + +maintainers: + - Christian Marangi + +description: |+ + PCIe Gen3 MAC controller for Airoha SoCs, it supports Gen3 speed + and compatible with Gen2, Gen1 speed. + + This PCIe controller supports up to 256 MSI vectors, the MSI hardware + block diagram is as follows: + + +-----+ + | GIC | + +-----+ + ^ + | + port->irq + | + +-+-+-+-+-+-+-+-+ + |0|1|2|3|4|5|6|7| (PCIe intc) + +-+-+-+-+-+-+-+-+ + ^ ^ ^ + | | ... | + +-------+ +------+ +-----------+ + | | | + +-+-+---+--+--+ +-+-+---+--+--+ +-+-+---+--+--+ + |0|1|...|30|31| |0|1|...|30|31| |0|1|...|30|31| (MSI sets) + +-+-+---+--+--+ +-+-+---+--+--+ +-+-+---+--+--+ + ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ + | | | | | | | | | | | | (MSI vectors) + | | | | | | | | | | | | + + (MSI SET0) (MSI SET1) ... (MSI SET7) + + With 256 MSI vectors supported, the MSI vectors are composed of 8 sets, + each set has its own address for MSI message, and supports 32 MSI vectors + to generate interrupt. + +properties: + compatible: + const: airoha,en7581-pcie + + reg: + minItems: 1 + maxItems: 2 + + reg-names: + minItems: 1 + maxItems: 2 + + interrupts: + maxItems: 1 + + ranges: + minItems: 1 + maxItems: 8 + + iommu-map: + maxItems: 1 + + iommu-map-mask: + const: 0 + + resets: + minItems: 1 + maxItems: 4 + + reset-names: + minItems: 1 + maxItems: 4 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: sys-ck + + phys: + maxItems: 1 + + phy-names: + items: + - const: pcie-phy + + num-lanes: + enum: [1, 2] + + mediatek,pbus-csr: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to pbus-csr syscon + - description: offset of pbus-csr base address register + - description: offset of pbus-csr base address mask register + description: + Phandle with two arguments to the syscon node used to detect if + a given address is accessible on PCIe controller. + + airoha,scu: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to airoha SCU syscon + description: + Phandle to SCU syscon to configure PCIe MUX for 2 lines support. + + '#interrupt-cells': + const: 1 + + interrupt-controller: + description: Interrupt controller node for handling legacy PCI interrupts. + type: object + properties: + '#address-cells': + const: 0 + '#interrupt-cells': + const: 1 + interrupt-controller: true + + required: + - '#address-cells' + - '#interrupt-cells' + - interrupt-controller + + additionalProperties: false + +required: + - compatible + - reg + - reg-names + - interrupts + - ranges + - clocks + - clock-names + - '#interrupt-cells' + - interrupt-controller + +allOf: + - $ref: /schemas/pci/pci-host-bridge.yaml# + - if: + properties: + num-lanes: + const: 2 + then: + properties: + regs: + minItems: 2 + + reg-names: + items: + - const: pcie-mac + - const: sec-pcie-mac + + resets: + minItems: 4 + + reset-names: + items: + - const: phy-lane0 + - const: phy-lane1 + - const: perstout + - const: sec-perstout + + required: + - airoha,scu + + else: + properties: + reg: + maxItems: 1 + + reg-names: + items: + - const: pcie-mac + + resets: + minItems: 2 + maxItems: 3 + + reset-names: + minItems: 2 + items: + - enum: [ phy-lane0, phy-lane1, phy-lan2 ] + - enum: [ phy-lane1, perstout ] + - const: phy-lane2 + +unevaluatedProperties: false + +examples: + - | + #include + #include + + bus { + #address-cells = <2>; + #size-cells = <2>; + + pcie@1fc00000 { + compatible = "airoha,en7581-pcie"; + device_type = "pci"; + #address-cells = <3>; + #size-cells = <2>; + + reg = <0x0 0x1fc00000 0x0 0x1670>, + <0x0 0x1fc20000 0x0 0x1670>; + reg-names = "pcie-mac", "sec-pcie-mac"; + + clocks = <&scuclk 7>; + clock-names = "sys-ck"; + + phys = <&pciephy>; + phy-names = "pcie-phy"; + + ranges = <0x02000000 0 0x20000000 0x0 0x20000000 0 0x4000000>; + + resets = <&scuclk 48>, + <&scuclk 49>, + <&scuclk 53>, + <&scuclk 54>; + reset-names = "phy-lane0", "phy-lane1", + "perstout", "sec-perstout"; + + num-lanes = <2>; + + mediatek,pbus-csr = <&pbus_csr 0x0 0x4>; + + airoha,scu = <&scuclk>; + + interrupts = ; + bus-range = <0x00 0xff>; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0x7>; + interrupt-map = <0 0 0 1 &pcie_intc 0>, + <0 0 0 2 &pcie_intc 1>, + <0 0 0 3 &pcie_intc 2>, + <0 0 0 4 &pcie_intc 3>; + pcie_intc: interrupt-controller { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml b/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml index 4db700fc36ba..510f1f2b1c5a 100644 --- a/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +++ b/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml @@ -59,7 +59,6 @@ properties: - const: mediatek,mt8196-pcie - const: mediatek,mt8192-pcie - const: mediatek,mt8196-pcie - - const: airoha,en7581-pcie reg: maxItems: 1 @@ -83,20 +82,20 @@ properties: resets: minItems: 1 - maxItems: 3 + maxItems: 2 reset-names: minItems: 1 - maxItems: 3 + maxItems: 2 items: - enum: [ phy, mac, phy-lane0, phy-lane1, phy-lane2 ] + enum: [ phy, mac ] clocks: - minItems: 1 + minItems: 4 maxItems: 6 clock-names: - minItems: 1 + minItems: 4 maxItems: 6 assigned-clocks: @@ -115,17 +114,6 @@ properties: power-domains: maxItems: 1 - mediatek,pbus-csr: - $ref: /schemas/types.yaml#/definitions/phandle-array - items: - - items: - - description: phandle to pbus-csr syscon - - description: offset of pbus-csr base address register - - description: offset of pbus-csr base address mask register - description: - Phandle with two arguments to the syscon node used to detect if - a given address is accessible on PCIe controller. - '#interrupt-cells': const: 1 @@ -177,16 +165,6 @@ allOf: - const: peri_26m - const: top_133m - resets: - minItems: 1 - maxItems: 2 - - reset-names: - minItems: 1 - maxItems: 2 - - mediatek,pbus-csr: false - - if: properties: compatible: @@ -208,16 +186,6 @@ allOf: - const: peri_26m - const: peri_mem - resets: - minItems: 1 - maxItems: 2 - - reset-names: - minItems: 1 - maxItems: 2 - - mediatek,pbus-csr: false - - if: properties: compatible: @@ -246,8 +214,6 @@ allOf: - const: phy - const: mac - mediatek,pbus-csr: false - - if: properties: compatible: @@ -257,7 +223,6 @@ allOf: then: properties: clocks: - minItems: 4 maxItems: 4 clock-names: @@ -267,38 +232,6 @@ allOf: - const: peri_26m - const: top_133m - resets: - minItems: 1 - maxItems: 2 - - reset-names: - minItems: 1 - maxItems: 2 - - mediatek,pbus-csr: false - - - if: - properties: - compatible: - const: airoha,en7581-pcie - then: - properties: - clocks: - maxItems: 1 - - clock-names: - items: - - const: sys-ck - - resets: - minItems: 3 - - reset-names: - items: - - const: phy-lane0 - - const: phy-lane1 - - const: phy-lane2 - unevaluatedProperties: false examples: -- 2.53.0