Received: by 2002:ab2:7407:0:b0:1f4:b336:87c4 with SMTP id e7csp246767lqn; Thu, 11 Apr 2024 23:07:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWnf7DCXkFeha8EB2a1/Pp0PQ3itp3VfcZSWC+jChH1OICNxBA2e+AEmL6VdTQQr2Ju020pGuzdxhOSfhPmw/D4JRkYy9DFKK5NP5cruA== X-Google-Smtp-Source: AGHT+IG5Vu9aMPivTZm3sukB49oXAhKi0xw1vQjPVlLdMrQdEkxnCTSvobhK+fgB8l07VEjLHcHI X-Received: by 2002:a17:902:e5c2:b0:1e4:3c7f:c179 with SMTP id u2-20020a170902e5c200b001e43c7fc179mr6695403plf.12.1712902042717; Thu, 11 Apr 2024 23:07:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712902042; cv=pass; d=google.com; s=arc-20160816; b=xilX5UxUKJWsXrhX3zizVWf4Ly9cKLAmx/QwqstBAzKWGsLdgIpE5f/yRuBdItMp/r w+k+JvYxzxILjw35BNzzeiyTZqPUJED2kdS9zLwCXvMCmkp9v946PuGyNEHZoKOq55Xp MpB33Md/9M6zbGhnRRKotW+z81+OTuT+qcY6XfJAgfxOh2BkyCadG0XwOPVDV08tjk7k JnxIZDIz67/LoLwXdvQDHp566i7f8sSxb45lPIDNAZ3KFo17gtUGyzKNL7qY4sA6+zvs t3OLx92bV41dMAO/4BGsv+plJQXO+6n7L72IuVVsSGQ7QXLB40Xdx3u9YltMA2w+pVLh 6j1w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date:dkim-signature; bh=bVDvQWSd1mdwyUeHA5nxPmJyJkIswZLDmzA5VN1Ahr0=; fh=YjzU6iM0Fh+zp2j5AJNcjCtN6FMlEGoUFq31wTSiHxM=; b=xwrQjFklrYW9MoSIS74lcYqnVtbKhmO5XKfaBjRQbGqs981qLhEB3aM/arfYt0LL37 IVaev339RoVSbSNNUvJVV1BbxanjM12jr7zfCq2MsyYDtyMmHHw30whN5w7yUeXOShQy fkz12zrveyKAs+jLp15OIeJ8pmY6OBOCurRf1BtwoelCeRc5V7mVuaunelHoXjVhldzX H6jy8dMZ8TYJFRy+xzPluZzuBC6VJYvI3xaWmXXCfm//5vNxq43oh8GAv8/tr1leUWpz YmmWkdUiEkJAUQLVSvRMFhMCNsGpxdNHpAuwp3XN/RxxJeDmOF3Ws4kMnNJpVSIKsUIV kJZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jshMclaE; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-141736-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141736-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x16-20020a634850000000b005d8e283c1ebsi2531121pgk.840.2024.04.11.23.07.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 23:07:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141736-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jshMclaE; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-141736-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141736-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 68BFEB21889 for ; Fri, 12 Apr 2024 00:05:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FF1B1373; Fri, 12 Apr 2024 00:04:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jshMclaE" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 55F2E161; Fri, 12 Apr 2024 00:04:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712880296; cv=none; b=XRX0lwyHX+D9HzBxxCaIPgzNNLYxiJLFUjMvkUUA9I5DlQLskt+XLKbGVosOXnUngPpVFFroRnmhi1GezYkIrcLCj5h5dNOYt+AzhCrd+ThqUOYXUKLqankVV84iALTCPvbclYPuPYaA4h3BLJ6ZvHDjrji8WL7RrS1LjYWljjc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712880296; c=relaxed/simple; bh=NyrufYflZQsz24CNEg+9x1m4HQeabvk+5HUYpQBPq/o=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=fPzrIH58nGv6rHewaHSjLfePUEAKwhbahfRY+CNbHLAq03TkK9nfXnbrHTQNr9Wunh2M8WA4Dk0/tpL1xjb+gUmvseR46Z9I9eMqC+F0F0HicNdbIraEtzIhZ9wRpdvzSaSrBqNBF2b8HStTB3HVbbXj1RfOe3+8XOTbYuCPeuc= 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=jshMclaE; arc=none smtp.client-ip=192.198.163.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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712880295; x=1744416295; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=NyrufYflZQsz24CNEg+9x1m4HQeabvk+5HUYpQBPq/o=; b=jshMclaEUBPq7CSct1EUM02gO5DdbLyBWE/pn438Y1EDGzXm32njRGAN meeE4ZGeDD0SVrYVIHnDK+McV5qKeDPo5Kgj6rgCIMZ0yXDsa4zOe5grh Krqs+83g8+Ry+dcUrmuUf/dTLkgkTfT/x1NAvPdKx+pBR9jk6u55abLRg Qvq4lZXyTZOhYvYDeV5SBkN4NiLx97fIGmq87Mk4irfXYri1PZIPvgtYM b3meOLLMihPhPkRM3F3uWyX2oxMYK9Rk38juWjpIMMgmTpme4Jf6qpDqX BXbPUqaqf2LW23HN2Vh35ganr0l2euJFoR4ILv68bv6SbVP2wetVWY8kG A==; X-CSE-ConnectionGUID: yCACObOFQeqUXOBmvx4k6w== X-CSE-MsgGUID: VqSVflGyS8iyhzrvvmVfjQ== X-IronPort-AV: E=McAfee;i="6600,9927,11041"; a="8882675" X-IronPort-AV: E=Sophos;i="6.07,194,1708416000"; d="scan'208";a="8882675" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2024 17:04:54 -0700 X-CSE-ConnectionGUID: Pd9JT0nqS8Ssu3svs3QJ+A== X-CSE-MsgGUID: b6R3xiLWSqWRpBNHhB1ZDQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,194,1708416000"; d="scan'208";a="21031337" Received: from sj-4150-psse-sw-opae-dev2.sj.intel.com ([10.233.115.162]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2024 17:04:53 -0700 Date: Thu, 11 Apr 2024 17:04:52 -0700 (PDT) From: matthew.gerlach@linux.intel.com X-X-Sender: mgerlach@sj-4150-psse-sw-opae-dev2 To: Rob Herring cc: bhelgaas@google.com, lpieralisi@kernel.org, kw@linux.com, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] dt-bindings: PCI: altera: Convert to YAML In-Reply-To: <20240410173159.GA733161-robh@kernel.org> Message-ID: References: <20240405145322.3805828-1-matthew.gerlach@linux.intel.com> <20240410173159.GA733161-robh@kernel.org> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Wed, 10 Apr 2024, Rob Herring wrote: > On Fri, Apr 05, 2024 at 09:53:22AM -0500, matthew.gerlach@linux.intel.com wrote: >> From: Matthew Gerlach >> >> Convert the device tree bindings for the Altera Root Port PCIe controller >> from text to YAML. >> >> Signed-off-by: Matthew Gerlach >> --- >> 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 | 106 ++++++++++++++++++ >> 2 files changed, 106 insertions(+), 50 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..999dcda05f55 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/pci/altr,pcie-root-port.yaml >> @@ -0,0 +1,106 @@ >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >> +# Copyright (C) 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: >> + items: >> + - enum: >> + - altr,pcie-root-port-1.0 >> + - altr,pcie-root-port-2.0 >> + >> + interrupts: >> + maxItems: 1 >> + >> + interrupt-map-mask: >> + items: >> + - const: 0 >> + - const: 0 >> + - const: 0 >> + - const: 7 >> + >> + interrupt-map: >> + maxItems: 4 >> + >> + "#interrupt-cells": >> + const: 1 > > Already defined in the common schema, drop. When I remove the lines above, "make dt_binding_check" gives me the warning, properties: '#interrupt-cells' is a dependency of 'interrupt-map'. > >> + >> + msi-parent: true >> + >> +required: >> + - compatible >> + - reg >> + - reg-names >> + - device_type > > Drop. I will drop this in v3. > >> + - interrupts >> + - interrupt-map >> + - interrupt-map-mask >> + >> +unevaluatedProperties: false >> + >> +allOf: >> + - $ref: /schemas/pci/pci-bus.yaml# >> + - if: >> + properties: >> + compatible: >> + enum: >> + - altr,pcie-root-port-1.0 >> + then: >> + properties: >> + reg: >> + items: >> + - description: TX slave port region >> + - description: Control register access region >> + >> + reg-names: >> + items: >> + - const: Txs >> + - const: Cra >> + >> + else: >> + properties: >> + reg: >> + items: >> + - description: Hard IP region >> + - description: TX slave port region >> + - description: Control register access region >> + >> + reg-names: >> + items: >> + - const: Hip >> + - const: Txs >> + - const: Cra >> + >> +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-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_intc 1>, >> + <0 0 0 2 &pcie_intc 2>, >> + <0 0 0 3 &pcie_intc 3>, >> + <0 0 0 4 &pcie_intc 4>; >> + ranges = <0x82000000 0x00000000 0x00000000 0xc0000000 0x00000000 0x10000000 >> + 0x82000000 0x00000000 0x10000000 0xd0000000 0x00000000 0x10000000>; >> + }; >> -- >> 2.34.1 >> >