From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8617938D417 for ; Tue, 14 Jul 2026 11:59:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784030345; cv=none; b=pMgzDC+aRYu6pu98EI2YUDCZtzV/Es6TuciJw+soeE294SBHFIDrnu0eTzhO6M6nwKzvjNh69mj4U1maPgJuSOYmDXH5lknEC4fpcOWN/Wixodb7jwRE0lNsdBvAsY7kL+U+jiILhlpD4Aj3Wj6MBUgQxERnrvP3mBifV37Lk1g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784030345; c=relaxed/simple; bh=3p9BuWm7IXYgBoetquY2e6iWXaiFfSmr9XNkWeFYt2Q=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GHqM73WP6WpAKljeQYdVbTRc73yP9HyPP7NRkjURh+d9peexUgo/9kgnD8+ehl2a4GtQwFPTIUt0oELUR1vj8OmH7/lwemKhZIR8vpcSGK/eWobEvRS9BgjJ/fgDnHMb8ERycf9f8c8q+5mPz6UaSoFNLOgEq5iCHYh3TambvwQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IihgDt+W; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IihgDt+W" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-493bfe9f886so22893965e9.0 for ; Tue, 14 Jul 2026 04:59:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784030342; x=1784635142; darn=vger.kernel.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:content-type; bh=dta68QNbLoWzOS6PweKTXaAA6m2oOUeYKxDIVzU2tCk=; b=IihgDt+WzG9bdEoM2m2dF9NOOBd5o73B7kNU0daGiVR/6nFOnG72mr4JMIJLWxhNmv HXlXiSThp+v4W1TAFN/BrrbWb1c/tjJRbHNX4oMFmQ+whYrv4VHT3qwR3wNE6A+9O45w C4La9XQMSzrMUZgQvldiV+yoP0IJXarqwhInjP0pFAgHwSrKo+bndRNQjzgO7nmGdiZ4 6153zL7svRhrOFmS4rIjE4vBgCv4J1ymZdLr05le0mLaHnulkg7dcwAWr3z+c0DPHq88 hYN/IqYTOHt5EGfOfA9fhMswqmeyG7fDVGy36tr6Bk82dbby2c7yycmrRbvMB50MgQMp K2lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784030342; x=1784635142; 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:content-type; bh=dta68QNbLoWzOS6PweKTXaAA6m2oOUeYKxDIVzU2tCk=; b=mp6JrqYyFzDW2VokUmIrqV/Cl7WIk926+YrxcL5uuMKNpwr27yy9EdKSARRWHbsewS z+EaECXDgcnzs9QfF2VjuvZWHHcVV4gvcTJb2hZCXIniFS5TAdmiuigxsG15rsnygbsh Z2+6+CsWGs2xUi8dO9pGVKL0jlIL8HD47yupPrdNlVzkR0koaRK3sxn2UhpGJd3dYiSb vSwTUfSNSTjEJgRx5QhdDKmH2mxICfS6HSCZz09vKwbdA5jUo4d2O+JgQw8qN3/LqHgd 4IOIHk7EjQW/SquDGYN8DQfCcyvXs6DX1Kol0ctpeRBWV5jQpue611qBGc2hYcCzel4z To0w== X-Forwarded-Encrypted: i=1; AHgh+RrxJWbbQ6zUu4vMpFTlMqeF2ur3Bvqm/B1MG2olDCrAPRspOkHPkY8fE1/jvvkIJpqW3GKtCKN1JOM=@vger.kernel.org X-Gm-Message-State: AOJu0YxuUJ9KSv5eNPFolD6DqeC121TOHsxGUaPaIuxyBgLIfLTDxjj8 qtg3Iq7RKFB5TSx0SMle+IjuZgVr+jUUdwq0vITOrQajQwADXRFFrmqmGnSwh8JQ X-Gm-Gg: AfdE7cm3HsY7tTm6GSl/HTGRaZizV08iGbIp+6eJPN9WwCgm9ZwyyXtbtLUj1Blyr66 RZw8RJ33K/axoVLTqWylyQzzSpqRKMFRNFHJdXenWMjd4IxCHi+rXi4Mr+hI/YCNWiUJm/2Nd1l 9JeFRKkQfkzD+0kISgjzLrHDDe0SyoEWSdHlqbSKt7JXgyoMB0x3wpkAtRjTdF0Js6QQNaJe2YE Nr8vxBIoSbhQfnlsWPVVlkchgqemkoBp7cc54a3UpP1T+VkxNhe5H8o8K81tB1ZGJkBdXO/lAWl UyclEUH8ZO3KGAH+WeeBva2tqFDiOIJfiHjYE8E88hlGb+cHSNTkWJO6Az337J32tcy7+FhrByf fR5VBA7Ol5duZNvEYe+8r7BwP8ISvUMxeeWHixU+aPIeRLBNygODbjc9pc0ux/wpwLmADlDC3aT Bf44d/KtI8vGIRNC5+lglp7iu0Ag1fN+83K7IuPzW1jYuoyNO6e2s0HlZ1AGUCt80o4cL+YnsCf 8EEKS6B X-Received: by 2002:a05:600c:a4a:b0:493:e9c2:ba60 with SMTP id 5b1f17b1804b1-493f8820ab3mr130769725e9.22.1784030341641; Tue, 14 Jul 2026 04:59:01 -0700 (PDT) Received: from Ansuel-XPS24.localdomain (host-95-248-227-210.retail.telecomitalia.it. [95.248.227.210]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-493fd3ccfd4sm180531655e9.2.2026.07.14.04.59.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 04:59:01 -0700 (PDT) From: Christian Marangi To: Bjorn Helgaas , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , 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 v4 3/4] dt-bindings: PCI: mediatek-gen3: Split Airoha schema and document 2-lanes Date: Tue, 14 Jul 2026 13:58:45 +0200 Message-ID: <20260714115848.8537-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260714115848.8537-1-ansuelsmth@gmail.com> References: <20260714115848.8537-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 | 244 ++++++++++++++++++ .../bindings/pci/mediatek-pcie-gen3.yaml | 77 +----- 2 files changed, 249 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..78a181a3b599 --- /dev/null +++ b/Documentation/devicetree/bindings/pci/airoha,en7581-pcie.yaml @@ -0,0 +1,244 @@ +# 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: + maxItems: 1 + + 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 INTx 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: + reg: + 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-lane2 ] + - 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