Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp543549ybe; Fri, 6 Sep 2019 03:34:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqed5UDjI31+RQdcbUjOh8Ixi2D3ktO/y2higs565U6QWyGcTCpTPiGvfVsxv6/UgLn6Dk X-Received: by 2002:a17:902:7085:: with SMTP id z5mr8560101plk.102.1567766059830; Fri, 06 Sep 2019 03:34:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567766059; cv=none; d=google.com; s=arc-20160816; b=zpge4HfXe++mSdFBjN5F6BDrCqExP7fFnouGh0UaMA73e0dPkOLPiFQVqW9YzW/YKH xurJNa/svpEA55wDAlSoE3oztnd7uJvU2wmhqS+ZHABw+kgawtBMq4TVGXD1AY8yFhuD xL2npOqwrC88aTW9Ice5Ffx8m1TOQxh2yDNfYG3q2ym5CpBeXMLkGOZonJVe7Fskn9Qa QPwlvH3bPEXU0Mh+1YlSmZTPbhshPjIhQlJd311A1K43jdeoJtrOmZEcYstBk+6PUp7l DHngrMt2DKhsJN2OoquL9m5kwJYqzQDUtHKlIZffKXtB+y0CT/efHeMdADJWWH4sqxt/ H9Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ov2lxhlDP5VFCTzZogkfVmJ3x14OwOX2imR6ut5rqd0=; b=BNsJ8vbTBln51NIDp0UC+MduuH4LlJ2CG9jXaxr6ZXTs5AydRLUeiXJqSOyGvho0q0 wBgY0Pi3KtWIjYgcArKQBXkGSSs+ELChZ4FsZQmczeN0YrI8C08y9WFgwdHBP10A4HnM ZIa2Mlbo4mSnQ/c1CBha8HarcpGKVksMMn7FI5wsuypX8ap4WskssJJZuOSekBeAMysh db/6bo3k+PAPuNA5wuA4SgQn6dVPgHN2kgqmnu1U6JF8p1btSkGe35qsu4y2+D82s+/Y NrbBCT2pU2qCiDqHaJKDTI4vx8wI8asuQimJG/tONlDySEJm0ShnxYffGYvchdbs94Rm rGZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t7si4542562plz.185.2019.09.06.03.34.04; Fri, 06 Sep 2019 03:34:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390408AbfIFDWc (ORCPT + 99 others); Thu, 5 Sep 2019 23:22:32 -0400 Received: from mga04.intel.com ([192.55.52.120]:3028 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731938AbfIFDWc (ORCPT ); Thu, 5 Sep 2019 23:22:32 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2019 20:22:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,472,1559545200"; d="scan'208";a="267231270" Received: from linux.intel.com ([10.54.29.200]) by orsmga001.jf.intel.com with ESMTP; 05 Sep 2019 20:22:30 -0700 Received: from [10.226.39.8] (leichuan-mobl.gar.corp.intel.com [10.226.39.8]) by linux.intel.com (Postfix) with ESMTP id F14005808CB; Thu, 5 Sep 2019 20:22:27 -0700 (PDT) Subject: Re: [PATCH v3 1/2] dt-bindings: PCI: intel: Add YAML schemas for the PCIe RC controller To: Martin Blumenstingl , Dilip Kota Cc: jingoohan1@gmail.com, gustavo.pimentel@synopsys.com, lorenzo.pieralisi@arm.com, robh@kernel.org, linux-pci@vger.kernel.org, hch@infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, andriy.shevchenko@intel.com, cheol.yong.kim@intel.com, qi-ming.wu@intel.com References: From: "Chuan Hua, Lei" Message-ID: Date: Fri, 6 Sep 2019 11:22:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/6/2019 4:31 AM, Martin Blumenstingl wrote: > Hi Dilip, > > On Wed, Sep 4, 2019 at 12:11 PM Dilip Kota wrote: > [...] >> +properties: >> + compatible: >> + const: intel,lgm-pcie > should we add the "snps,dw-pcie" here (and in the example below) as well? > (this is what for example > Documentation/devicetree/bindings/pci/amlogic,meson-pcie.txt does) Thanks for pointing out this. We should add this. > > [...] >> + phy-names: >> + const: pciephy > the most popular choice in Documentation/devicetree/bindings/pci/ is "pcie-phy" > if Rob is happy with "pciephy" (which is already part of two other > bindings) then I'm happy with "pciephy" as well Agree. > >> + num-lanes: >> + description: Number of lanes to use for this port. > are there SoCs with more than 2 lanes? > you can list the allowed values in an enum so "num-lanes = <16>" > causes an error when someone accidentally has this in their .dts (and > runs the dt-bindings validation) Our SoC(LGM) supports single lane or dual lane. Again this also depends on the board. I wonder if we should put this into board specific dts.  To make multiple lanes work properly, it also depends on the phy mode. In my internal version, I put it into board dts. > > [...] >> + reset-assert-ms: > maybe add: > $ref: /schemas/types.yaml#/definitions/uint32 Agree >> + description: | >> + Device reset interval in ms. >> + Some devices need an interval upto 500ms. By default it is 100ms. >> + >> +required: >> + - compatible >> + - device_type >> + - reg >> + - reg-names >> + - ranges >> + - resets >> + - clocks >> + - phys >> + - phy-names >> + - reset-gpios >> + - num-lanes >> + - linux,pci-domain >> + - interrupts >> + - interrupt-map >> + - interrupt-map-mask >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + pcie10:pcie@d0e00000 { >> + compatible = "intel,lgm-pcie"; >> + device_type = "pci"; >> + #address-cells = <3>; >> + #size-cells = <2>; >> + reg = < >> + 0xd0e00000 0x1000 >> + 0xd2000000 0x800000 >> + 0xd0a41000 0x1000 >> + >; >> + reg-names = "dbi", "config", "app"; >> + linux,pci-domain = <0>; >> + max-link-speed = <4>; >> + bus-range = <0x00 0x08>; >> + interrupt-parent = <&ioapic1>; >> + interrupts = <67 1>; >> + #interrupt-cells = <1>; >> + interrupt-map-mask = <0 0 0 0x7>; >> + interrupt-map = <0 0 0 1 &ioapic1 27 1>, >> + <0 0 0 2 &ioapic1 28 1>, >> + <0 0 0 3 &ioapic1 29 1>, >> + <0 0 0 4 &ioapic1 30 1>; > is the "1" in the interrupts and interrupt-map properties IRQ_TYPE_EDGE_RISING? > you can use these macros in this example as well, see > Documentation/devicetree/bindings/iio/accel/adi,adxl372.yaml for > example No. 1 here means index from arch/x86/devicetree.c static struct of_ioapic_type of_ioapic_type[] = {     {         .out_type    = IRQ_TYPE_EDGE_RISING,         .trigger    = IOAPIC_EDGE,         .polarity    = 1,     },     {         .out_type    = IRQ_TYPE_LEVEL_LOW,         .trigger    = IOAPIC_LEVEL,         .polarity    = 0,     },     {         .out_type    = IRQ_TYPE_LEVEL_HIGH,         .trigger    = IOAPIC_LEVEL,         .polarity    = 1,     },     {         .out_type    = IRQ_TYPE_EDGE_FALLING,         .trigger    = IOAPIC_EDGE,         .polarity    = 0,     }, }; static int dt_irqdomain_alloc(struct irq_domain *domain, unsigned int virq,                   unsigned int nr_irqs, void *arg) {     struct irq_fwspec *fwspec = (struct irq_fwspec *)arg;     struct of_ioapic_type *it;     struct irq_alloc_info tmp;     int type_index;     if (WARN_ON(fwspec->param_count < 2))         return -EINVAL;     type_index = fwspec->param[1]; // index.     if (type_index >= ARRAY_SIZE(of_ioapic_type))         return -EINVAL; I would not see this definition is user-friendly. But it is how x86 handles at the moment. > > Martin