Message ID | 20230222165514.684729-2-suijingfeng@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp691964wrd; Wed, 22 Feb 2023 09:07:23 -0800 (PST) X-Google-Smtp-Source: AK7set/58YsHYiraTO6El6/zYgI7P8acp+gTRK6x/zJ0UDPi8yHgDBkwCkt7qo4fAKcnJfEXNW/k X-Received: by 2002:aa7:970f:0:b0:5a8:aae8:1160 with SMTP id a15-20020aa7970f000000b005a8aae81160mr8209603pfg.20.1677085643189; Wed, 22 Feb 2023 09:07:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677085643; cv=none; d=google.com; s=arc-20160816; b=Y7A7TPDIDRxru4TZXlqvA75UHCBSYxPSujJ69B4Y/dovWzu2mHFNTiFYGO+3xWxuS/ u/ESalLZnTF+SQz+b0VJKEUUruhI8EmrjmF/SwxhMKDFft98JK8AaKZCDaGgTM9ozsBu BC4k0iqL8wmhys9UzsIjfxZQVHUqap9ZOmUpsYJq9oT3/EfVM84SBl0PU1zCcmwzKVUX 7UVOMtk6R4s1AK9evRy3WYiMMhS2garSZ2N+muNaVIiVTQwWGbTipRnkCxyM+T+YCMI5 Sk0rNg529peyulwZZZOGdpvzuUXByyMbNWXFzowpiX02B30OlXsjk/gRm0Z2a8vuhokK Y4oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=H1Fe7B1ApwcRh3sTfXG+fANUPG9e9+AO7AZQJr0MwC0=; b=pZq99U/uWrNwc95X5msH9Ltsl339EZFmkh6ozlxy7C3xmPlKjlBwRMdQVEpbs68nGy oLzYjXoy6/pbB6PcC5+CSIhLw8U9NXWYSB+hLOkHlYAReGeD9NKqeHJaLW2o7LZcUOHI sfKWe1Dr+3o5TfXxmkN9LR0x1P1TrYgIaPxWW5nEf+N297RuxYMEJqiFJ8A49oBCdAr5 03IVJ5S/pn0kZeod7DujUZxjG6PjeO31YPk92NhLOtccS6WuWPIQRlYoS/VnGMBvh9cU iopFA0A93Dmx3Ldi63hyQWkqrLe7j3L+VPzCsCe2c/0oR19QumA7IMrwigR06v3KxW1h s9rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x69-20020a628648000000b005a90ee7188fsi20799636pfd.49.2023.02.22.09.07.09; Wed, 22 Feb 2023 09:07:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232314AbjBVQz1 (ORCPT <rfc822;chinmaygameti@gmail.com> + 99 others); Wed, 22 Feb 2023 11:55:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232399AbjBVQzX (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 22 Feb 2023 11:55:23 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1432D12BCA; Wed, 22 Feb 2023 08:55:18 -0800 (PST) Received: from loongson.cn (unknown [10.20.42.133]) by gateway (Coremail) with SMTP id _____8CxC9r0SPZjf6YDAA--.7811S3; Thu, 23 Feb 2023 00:55:16 +0800 (CST) Received: from openarena.loongson.cn (unknown [10.20.42.133]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxTL7ySPZjRes4AA--.38394S3; Thu, 23 Feb 2023 00:55:15 +0800 (CST) From: suijingfeng <suijingfeng@loongson.cn> To: Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, Rob Herring <robh+dt@kernel.org>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Krzysztof Kozlowski <krzk@kernel.org>, suijingfeng <suijingfeng@loongson.cn> Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] dt-bindings: display: Add Loongson display controller Date: Thu, 23 Feb 2023 00:55:14 +0800 Message-Id: <20230222165514.684729-2-suijingfeng@loongson.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230222165514.684729-1-suijingfeng@loongson.cn> References: <20230222165514.684729-1-suijingfeng@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8BxTL7ySPZjRes4AA--.38394S3 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7tF48ur1DKF45Gw47XF4xWFg_yoW8uFW5pa nxCan7Gr4jqFnFy3yfta48Wr45Zr95AFn7GFsrJw17K3srWayFvw15KF1kXF47GF9rZa4j vFy0gF4xK3Z7Cw7anT9S1TB71UUUUjDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bfkYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVW8JVW8Jr1ln4kS 14v26r126r1DM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E87Iv 67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxVAaw2 AFwI0_JF0_Jw1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxYO2xF xVAFwI0_JF0_Jw1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWw C2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Gr0_ Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJV WUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIY CTnIWIevJa73UjIFyTuYvjxU4Xo7DUUUU X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758551754950475126?= X-GMAIL-MSGID: =?utf-8?q?1758551754950475126?= |
Series |
[1/2] Mips: ls2k1000: dts: add the display controller device node
|
|
Commit Message
Sui Jingfeng
Feb. 22, 2023, 4:55 p.m. UTC
This patch add a trival DT usages for loongson display controller found
in LS2k1000 SoC.
Signed-off-by: suijingfeng <suijingfeng@loongson.cn>
---
.../loongson/loongson,display-controller.yaml | 58 +++++++++++++++++++
1 file changed, 58 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml
Comments
On 22/02/2023 17:55, suijingfeng wrote: > This patch add a trival DT usages for loongson display controller found > in LS2k1000 SoC. Trivial yet so many things to improve... if you only started from recent kernel tree (since you Cced wrong address, I doubt you did) and bindings you would avoid half of these comments. > > Signed-off-by: suijingfeng <suijingfeng@loongson.cn> > --- > .../loongson/loongson,display-controller.yaml | 58 +++++++++++++++++++ > 1 file changed, 58 insertions(+) > create mode 100644 Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml > > diff --git a/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml b/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml > new file mode 100644 > index 000000000000..98b78f449a80 > --- /dev/null > +++ b/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml Filename based on compatible, so "loongson,ls2k1000-dc.yaml" > @@ -0,0 +1,58 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/display/loongson/loongson,display-controller.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Loongson Display Controller Device Tree Bindings Drop "Device Tree Bindings" > + > +maintainers: > + - Sui Jingfeng <suijingfeng@loongson.cn> > + > +description: |+ Drop |+ > + No need for blank line. Do you see it anywhere else in the bindings? > + The display controller is a PCI device, it has two display pipe. > + For the DC in LS2K1000 each way has a DVO output interface which > + provide RGB888 signals, vertical & horizontal synchronisations > + and the pixel clock. Each CRTC is able to support 1920x1080@60Hz, > + the maximum resolution is 2048x2048 according to the hardware spec. > + > +properties: > + $nodename: > + pattern: "^display-controller@[0-9a-f],[0-9a-f]$" Drop nodename. > + > + compatible: > + oneOf: Drop oneOf > + - items: and items... > + - enum: > + - loongson,ls2k1000-dc > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > +required: > + - compatible > + - reg > + - interrupts > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/interrupt-controller/irq.h> > + bus { > + Drop blank line. > + #address-cells = <3>; > + #size-cells = <2>; > + #interrupt-cells = <2>; Why do you need interrupt-cells? > + > + display-controller@6,0 { > + compatible = "loongson,ls2k1000-dc"; > + reg = <0x3000 0x0 0x0 0x0 0x0>;> + interrupts = <28 IRQ_TYPE_LEVEL_LOW>; > + }; > + }; > + > +... Best regards, Krzysztof
Hi, On 2023/2/23 02:30, Krzysztof Kozlowski wrote: > On 22/02/2023 17:55, suijingfeng wrote: >> This patch add a trival DT usages for loongson display controller found >> in LS2k1000 SoC. > Trivial yet so many things to improve... if you only started from recent > kernel tree (since you Cced wrong address, I doubt you did) and bindings > you would avoid half of these comments. Yes, you are right. I will double check the Cced next time, I'm start from drm-tip. but Cced using a record before. >> Signed-off-by: suijingfeng <suijingfeng@loongson.cn> >> --- >> .../loongson/loongson,display-controller.yaml | 58 +++++++++++++++++++ >> 1 file changed, 58 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml >> >> diff --git a/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml b/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml >> new file mode 100644 >> index 000000000000..98b78f449a80 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml > Filename based on compatible, so "loongson,ls2k1000-dc.yaml" what if we have more than one SoC, we have loongson,ls2k1000-dc, loongson,ls2k2000-dc and loongson,ls2k0500-dc we will have loongson,ls2k3000-dc in the future, then how should i write this? I want a single file yaml file include them all. I'm asking because we don't know which method is good, write three piece of yaml or just one. Just tell me how to write this, i will follow you instruction. >> @@ -0,0 +1,58 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/display/loongson/loongson,display-controller.yaml# >> >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Loongson Display Controller Device Tree Bindings > Drop "Device Tree Bindings" OK, >> + >> +maintainers: >> + - Sui Jingfeng <suijingfeng@loongson.cn> >> + >> +description: |+ > Drop |+ > >> + > No need for blank line. Do you see it anywhere else in the bindings? OK, acceptable. >> + The display controller is a PCI device, it has two display pipe. >> + For the DC in LS2K1000 each way has a DVO output interface which >> + provide RGB888 signals, vertical & horizontal synchronisations >> + and the pixel clock. Each CRTC is able to support 1920x1080@60Hz, >> + the maximum resolution is 2048x2048 according to the hardware spec. >> + >> +properties: >> + $nodename: >> + pattern: "^display-controller@[0-9a-f],[0-9a-f]$" > Drop nodename. Are you sure about this? When i write this property, I'm reference the ingenic,lcd.yaml . ingenic,lcd.yaml has nodename too. If I delete $nodename, then the test results say '^display-controller@[0-9a-f],[0-9a-f]$' is not of type 'object'. log is pasted at below. make -j$(nproc) ARCH=loongarch CROSS_COMPILE=loongarch64-unknown-linux-gnu- dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml LINT Documentation/devicetree/bindings DTEX Documentation/devicetree/bindings/display/loongson/loongson,display-controller.example.dts CHKDT Documentation/devicetree/bindings/processed-schema.json /home/suijingfeng/UpStream/drm-tip/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml: properties:pattern: '^display-controller@[0-9a-f],[0-9a-f]$' is not of type 'object', 'boolean' from schema $id: http://json-schema.org/draft-07/schema# /home/suijingfeng/UpStream/drm-tip/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml: properties: 'pattern' should not be valid under {'$ref': '#/definitions/json-schema-prop-names'} hint: A json-schema keyword was found instead of a DT property name. from schema $id: http://devicetree.org/meta-schemas/keywords.yaml# SCHEMA Documentation/devicetree/bindings/processed-schema.json /home/suijingfeng/UpStream/drm-tip/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml: ignoring, error in schema: properties: pattern DTC_CHK Documentation/devicetree/bindings/display/loongson/loongson,display-controller.example.dtb > >> + >> + compatible: >> + oneOf: > Drop oneOf > >> + - items: > and items... > >> + - enum: >> + - loongson,ls2k1000-dc >> + reg: >> + maxItems: 1 >> + >> + interrupts: >> + maxItems: 1 >> + >> +required: >> + - compatible >> + - reg >> + - interrupts >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + #include <dt-bindings/interrupt-controller/irq.h> >> + bus { >> + > Drop blank line. > >> + #address-cells = <3>; >> + #size-cells = <2>; >> + #interrupt-cells = <2>; > Why do you need interrupt-cells? > >> + >> + display-controller@6,0 { >> + compatible = "loongson,ls2k1000-dc"; >> + reg = <0x3000 0x0 0x0 0x0 0x0>;> + interrupts = <28 IRQ_TYPE_LEVEL_LOW>; >> + }; >> + }; >> + >> +... > Best regards, > Krzysztof
On 23/02/2023 10:51, suijingfeng wrote: >>> diff --git a/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml b/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml >>> new file mode 100644 >>> index 000000000000..98b78f449a80 >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml >> Filename based on compatible, so "loongson,ls2k1000-dc.yaml" > > what if we have more than one SoC, > > we have loongson,ls2k1000-dc, loongson,ls2k2000-dc and loongson,ls2k0500-dc > > we will have loongson,ls2k3000-dc in the future, then how should i write > this? Then it is fine. > > I want a single file yaml file include them all. > > I'm asking because we don't know which method is good, write three piece > of yaml or just one. > > Just tell me how to write this, i will follow you instruction. > >>> @@ -0,0 +1,58 @@ >>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >>> +%YAML 1.2 >>> +--- >>> +$id: http://devicetree.org/schemas/display/loongson/loongson,display-controller.yaml# >>> >>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>> + >>> +title: Loongson Display Controller Device Tree Bindings >> Drop "Device Tree Bindings" > OK, >>> + >>> +maintainers: >>> + - Sui Jingfeng <suijingfeng@loongson.cn> >>> + >>> +description: |+ >> Drop |+ >> >>> + >> No need for blank line. Do you see it anywhere else in the bindings? > OK, acceptable. >>> + The display controller is a PCI device, it has two display pipe. >>> + For the DC in LS2K1000 each way has a DVO output interface which >>> + provide RGB888 signals, vertical & horizontal synchronisations >>> + and the pixel clock. Each CRTC is able to support 1920x1080@60Hz, >>> + the maximum resolution is 2048x2048 according to the hardware spec. >>> + >>> +properties: >>> + $nodename: >>> + pattern: "^display-controller@[0-9a-f],[0-9a-f]$" >> Drop nodename. > > Are you sure about this? When i write this property, I'm reference the > ingenic,lcd.yaml . > > ingenic,lcd.yaml has nodename too. > > If I delete $nodename, then the test results say > '^display-controller@[0-9a-f],[0-9a-f]$' is not of type 'object'. > > log is pasted at below. I meant, drop entire nodename and pattern. Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml b/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml new file mode 100644 index 000000000000..98b78f449a80 --- /dev/null +++ b/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml @@ -0,0 +1,58 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/loongson/loongson,display-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Loongson Display Controller Device Tree Bindings + +maintainers: + - Sui Jingfeng <suijingfeng@loongson.cn> + +description: |+ + + The display controller is a PCI device, it has two display pipe. + For the DC in LS2K1000 each way has a DVO output interface which + provide RGB888 signals, vertical & horizontal synchronisations + and the pixel clock. Each CRTC is able to support 1920x1080@60Hz, + the maximum resolution is 2048x2048 according to the hardware spec. + +properties: + $nodename: + pattern: "^display-controller@[0-9a-f],[0-9a-f]$" + + compatible: + oneOf: + - items: + - enum: + - loongson,ls2k1000-dc + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + bus { + + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <2>; + + display-controller@6,0 { + compatible = "loongson,ls2k1000-dc"; + reg = <0x3000 0x0 0x0 0x0 0x0>; + interrupts = <28 IRQ_TYPE_LEVEL_LOW>; + }; + }; + +...