From patchwork Wed Jul 31 14:39:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Gerlach X-Patchwork-Id: 13748861 X-Patchwork-Delegate: kw@linux.com Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2F531BBBC6; Wed, 31 Jul 2024 14:41:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722436893; cv=none; b=CHyRYp3ie0KjhWOUye6CH92zMRbAdv/5ecyKEZPk8JfmLTQDgsKmOMdEJwEsKJeZ7hXV+vvDqk2uPT4JYlIZnf2tEWINVhRv8KJ5mZLP2VD3+MUDt2SgTTbLGEAnqvFT0izV5yH2wSvZu0dw/XeI83hZk1jlV8nMhynn2iJxeYQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722436893; c=relaxed/simple; bh=nbISMGrUk989D2OsKIJb5oVaFpA/0tIMmoADJOR1sWg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AkmhNcKSxnlodUvAqaxki3QEuO95oNgs9ee5iC1hcS+TifxzOU7YRXfRQjHIxzQYCz67goA9gP1Xr0hQBBs+nE2VlAI429SVyrUN3W6oGOOq6Dq/Aj3rrJf83/1rCkg+u7sBpmGqFpbpX9UFpf+KkziyKXJpwYSZUap9XoRRdhk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=NFSTRAVx; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NFSTRAVx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722436892; x=1753972892; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nbISMGrUk989D2OsKIJb5oVaFpA/0tIMmoADJOR1sWg=; b=NFSTRAVxkMAntHffPaRHIwWJNWNrV+atPpSaxDXLsUhGLROfxKLJiYzg BHjYhOigVIbBaRJDhYyTkTBxMDFb89s3HEDDEuisdjiaitO4LguzalEoL BNReA2NpTnUJvMYZO34Sp3W4ji53a3jxofz2jcBP4XFGF1fn1WPRwPWGV O49UWno+atn0XMGObcVpwETw4flJu62Xcmzf4TPmlzqRl66HbknZXPCqH rD+h/LxWF7L8624gernpQoWmv7t1dhweKoq03rfaThUVYpYVkf+iSA+MM yA9tpnBPByVqnekJQSGDBDUkSM37S/ccDb7/2u3UgE0ZztcxQMMyRKuTV A==; X-CSE-ConnectionGUID: 90FKpXA0S6iX1OATtppujw== X-CSE-MsgGUID: Hbl4C/s5QlqGLku7FZlDMA== X-IronPort-AV: E=McAfee;i="6700,10204,11150"; a="20479801" X-IronPort-AV: E=Sophos;i="6.09,251,1716274800"; d="scan'208";a="20479801" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2024 07:41:23 -0700 X-CSE-ConnectionGUID: SrcBtcGmT96ZsE9eVhg1Tg== X-CSE-MsgGUID: xqVc+cr7SWCeB+dXsr5X4A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,251,1716274800"; d="scan'208";a="55295534" Received: from test2-linux-lab.an.intel.com ([10.122.105.166]) by orviesa007.jf.intel.com with ESMTP; 31 Jul 2024 07:41:22 -0700 From: matthew.gerlach@linux.intel.com To: lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, bhelgaas@google.com, krzk+dt@kernel.org, conor+dt@kernel.org, dinguyen@kernel.org, joyce.ooi@intel.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Matthew Gerlach , Conor Dooley Subject: [PATCH 1/7] dt-bindings: PCI: altera: Convert to YAML Date: Wed, 31 Jul 2024 09:39:40 -0500 Message-Id: <20240731143946.3478057-2-matthew.gerlach@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240731143946.3478057-1-matthew.gerlach@linux.intel.com> References: <20240731143946.3478057-1-matthew.gerlach@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Matthew Gerlach Convert the device tree bindings for the Altera Root Port PCIe controller from text to YAML. Update the entries in the interrupt-map field to have the correct number of address cells for the interrupt parent. Signed-off-by: Matthew Gerlach Reviewed-by: Conor Dooley --- v8: - Precisely constrain the number of items for reg and reg-names properties. Constrain maxItems to 2 for altr,pcie-root-port-1.0. Constrain minItems to 3 for altr,pcie-root-port-2.0. v7: - Keep original example dts, but fix warnings of interrupt-map field. v6: - Fix dt_binding_check warnings by creating interrupt-controller subnode and fixing interrupt-map. - Updated filename in MAINTAINERS. v5: - add interrupt-controller #interrupt-cells to required field - don't touch original example dts v4: - reorder reg-names to match original binding - move reg and reg-names to top level with limits. v3: - Added years to copyright - Correct order in file of allOf and unevaluatedProperties - remove items: in compatible field - fix reg and reg-names constraints - replace deprecated pci-bus.yaml with pci-host-bridge.yaml - fix entries in ranges property - remove device_type from required v2: - Move allOf: to bottom of file, just like example-schema is showing - add constraint for reg and reg-names - remove unneeded device_type - drop #address-cells and #size-cells - change minItems to maxItems for interrupts: - change msi-parent to just "msi-parent: true" - cleaned up required: - make subject consistent with other commits coverting to YAML - s/overt/onvert/g --- .../devicetree/bindings/pci/altera-pcie.txt | 50 -------- .../bindings/pci/altr,pcie-root-port.yaml | 114 ++++++++++++++++++ MAINTAINERS | 2 +- 3 files changed, 115 insertions(+), 51 deletions(-) delete mode 100644 Documentation/devicetree/bindings/pci/altera-pcie.txt create mode 100644 Documentation/devicetree/bindings/pci/altr,pcie-root-port.yaml diff --git a/Documentation/devicetree/bindings/pci/altera-pcie.txt b/Documentation/devicetree/bindings/pci/altera-pcie.txt deleted file mode 100644 index 816b244a221e..000000000000 --- a/Documentation/devicetree/bindings/pci/altera-pcie.txt +++ /dev/null @@ -1,50 +0,0 @@ -* Altera PCIe controller - -Required properties: -- compatible : should contain "altr,pcie-root-port-1.0" or "altr,pcie-root-port-2.0" -- reg: a list of physical base address and length for TXS and CRA. - For "altr,pcie-root-port-2.0", additional HIP base address and length. -- reg-names: must include the following entries: - "Txs": TX slave port region - "Cra": Control register access region - "Hip": Hard IP region (if "altr,pcie-root-port-2.0") -- interrupts: specifies the interrupt source of the parent interrupt - controller. The format of the interrupt specifier depends - on the parent interrupt controller. -- device_type: must be "pci" -- #address-cells: set to <3> -- #size-cells: set to <2> -- #interrupt-cells: set to <1> -- ranges: describes the translation of addresses for root ports and - standard PCI regions. -- interrupt-map-mask and interrupt-map: standard PCI properties to define the - mapping of the PCIe interface to interrupt numbers. - -Optional properties: -- msi-parent: Link to the hardware entity that serves as the MSI controller - for this PCIe controller. -- bus-range: PCI bus numbers covered - -Example - pcie_0: pcie@c00000000 { - compatible = "altr,pcie-root-port-1.0"; - reg = <0xc0000000 0x20000000>, - <0xff220000 0x00004000>; - reg-names = "Txs", "Cra"; - interrupt-parent = <&hps_0_arm_gic_0>; - interrupts = <0 40 4>; - interrupt-controller; - #interrupt-cells = <1>; - bus-range = <0x0 0xFF>; - device_type = "pci"; - msi-parent = <&msi_to_gic_gen_0>; - #address-cells = <3>; - #size-cells = <2>; - interrupt-map-mask = <0 0 0 7>; - interrupt-map = <0 0 0 1 &pcie_0 1>, - <0 0 0 2 &pcie_0 2>, - <0 0 0 3 &pcie_0 3>, - <0 0 0 4 &pcie_0 4>; - ranges = <0x82000000 0x00000000 0x00000000 0xc0000000 0x00000000 0x10000000 - 0x82000000 0x00000000 0x10000000 0xd0000000 0x00000000 0x10000000>; - }; diff --git a/Documentation/devicetree/bindings/pci/altr,pcie-root-port.yaml b/Documentation/devicetree/bindings/pci/altr,pcie-root-port.yaml new file mode 100644 index 000000000000..52533fccc134 --- /dev/null +++ b/Documentation/devicetree/bindings/pci/altr,pcie-root-port.yaml @@ -0,0 +1,114 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright (C) 2015, 2019, 2024, Intel Corporation +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/altr,pcie-root-port.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Altera PCIe Root Port + +maintainers: + - Matthew Gerlach + +properties: + compatible: + enum: + - altr,pcie-root-port-1.0 + - altr,pcie-root-port-2.0 + + reg: + items: + - description: TX slave port region + - description: Control register access region + - description: Hard IP region + minItems: 2 + + reg-names: + items: + - const: Txs + - const: Cra + - const: Hip + minItems: 2 + + interrupts: + maxItems: 1 + + interrupt-controller: true + + interrupt-map-mask: + items: + - const: 0 + - const: 0 + - const: 0 + - const: 7 + + interrupt-map: + maxItems: 4 + + "#interrupt-cells": + const: 1 + + msi-parent: true + +required: + - compatible + - reg + - reg-names + - interrupts + - "#interrupt-cells" + - interrupt-controller + - interrupt-map + - interrupt-map-mask + +allOf: + - $ref: /schemas/pci/pci-host-bridge.yaml# + - if: + properties: + compatible: + enum: + - altr,pcie-root-port-1.0 + then: + properties: + reg: + maxItems: 2 + + reg-names: + maxItems: 2 + + else: + properties: + reg: + minItems: 3 + + reg-names: + minItems: 3 + + +unevaluatedProperties: false + +examples: + - | + #include + #include + pcie_0: pcie@c00000000 { + compatible = "altr,pcie-root-port-1.0"; + reg = <0xc0000000 0x20000000>, + <0xff220000 0x00004000>; + reg-names = "Txs", "Cra"; + interrupt-parent = <&hps_0_arm_gic_0>; + interrupts = ; + interrupt-controller; + #interrupt-cells = <1>; + bus-range = <0x0 0xff>; + device_type = "pci"; + msi-parent = <&msi_to_gic_gen_0>; + #address-cells = <3>; + #size-cells = <2>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_0 0 0 0 1>, + <0 0 0 2 &pcie_0 0 0 0 2>, + <0 0 0 3 &pcie_0 0 0 0 3>, + <0 0 0 4 &pcie_0 0 0 0 4>; + ranges = <0x82000000 0x00000000 0x00000000 0xc0000000 0x00000000 0x10000000>, + <0x82000000 0x00000000 0x10000000 0xd0000000 0x00000000 0x10000000>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 9200d953868e..55ad37e73183 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -17366,7 +17366,7 @@ PCI DRIVER FOR ALTERA PCIE IP M: Joyce Ooi L: linux-pci@vger.kernel.org S: Supported -F: Documentation/devicetree/bindings/pci/altera-pcie.txt +F: Documentation/devicetree/bindings/pci/altr,pcie-root-port.yaml F: drivers/pci/controller/pcie-altera.c PCI DRIVER FOR APPLIEDMICRO XGENE