Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5458712pxb; Mon, 28 Mar 2022 12:46:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycu1nL7UKoNiJ7ul0b+EfSNIdIFusXofhWhQN+u5Uwx2Y39OQ7rOoR0JIJF1GXFWfBAo3y X-Received: by 2002:ab0:7541:0:b0:359:eb0b:8162 with SMTP id k1-20020ab07541000000b00359eb0b8162mr4549906uaq.15.1648496760181; Mon, 28 Mar 2022 12:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648496760; cv=none; d=google.com; s=arc-20160816; b=uOzB6fzBo8DjXRtsGjpvoR5tRPyMGK6XUp8HY2VQ/isYnSG3+5MfvkZfuRos2G0MpL 3Gq1XYq2sPASMGJydckV/DJjvRdq9ZVdE9HqJyupW4mfy/X2JGnC6gUldca6epbcHhZ3 dmmuACD5Hgb2dqjTCCLCC1UeuikYeacv7ZffQSDxcvDT6/Zn7KJCWQjkeyUE6PyZwAXz kSgnTGlDXgN/LNUQXh5JS0JPKTsJ+Av8u1vyKqXTVYx6P2iTNk7RiS+Ana6kA9GXCwQW 6m518lHEAgNXq2p30+LBJ2lfheIrL1IIGZGr6MPaROQoikhipH9jlBctbkaaPmUfBbQw AUXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:hmm_source_type:hmm_attache_num :hmm_source_ip; bh=FhFpcqnl39xb3VBc/R8RIJaDGVr6owgQBcjRRGlcmY8=; b=nv9y/gE4aTqr7f0edRcDlb5BzloxN9S8w2MeqRYkWNZxg+KzV/VLd0UY89jIm2YuLG RgRgjpTkpEkvA6hqpKBsH1jbg0w9a4G62ZWwtSWPnl/7n7+n2BplJaaBJDcl8EmGnKTc zGbx7cCa8tuRhV57uwe6gg2RYFzuoHVYmcGLd1Iqah01LI7JZFbNSrrmLQ+aAVwrkJhS gyrxWrpovqA6vRX5SHr+luMRAs/SHko6jlYWXOh9pZhyhZlElnI1/jdj5K1h41CvXUCS ooE4w5A80iXIrJJtgek9vuMNJekkVO+Cfz7ow3HtJvp9UuIfNUeVdMbbJgND3MWvQwJB +Yuw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y131-20020a1f7d89000000b0033e831701b6si2984075vkc.32.2022.03.28.12.45.44; Mon, 28 Mar 2022 12:45:59 -0700 (PDT) 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 S237400AbiC1BzF (ORCPT + 99 others); Sun, 27 Mar 2022 21:55:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234637AbiC1BzC (ORCPT ); Sun, 27 Mar 2022 21:55:02 -0400 Received: from 189.cn (ptr.189.cn [183.61.185.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C6C3BB8; Sun, 27 Mar 2022 18:53:20 -0700 (PDT) HMM_SOURCE_IP: 10.64.8.43:53434.1335546779 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-114.242.206.180 (unknown [10.64.8.43]) by 189.cn (HERMES) with SMTP id 6258A1002E0; Mon, 28 Mar 2022 09:52:31 +0800 (CST) Received: from ([114.242.206.180]) by gateway-151646-dep-b7fbf7d79-vjdjk with ESMTP id 99efaa0237f14c4d90846b278cc6f86f for jiaxun.yang@flygoat.com; Mon, 28 Mar 2022 09:53:18 CST X-Transaction-ID: 99efaa0237f14c4d90846b278cc6f86f X-Real-From: 15330273260@189.cn X-Receive-IP: 114.242.206.180 X-MEDUSA-Status: 0 Sender: 15330273260@189.cn Message-ID: <30b8ee6e-d890-a76a-96fd-080042af1d7a@189.cn> Date: Mon, 28 Mar 2022 09:52:30 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v12 3/6] dt-bindings: display: Add Loongson display controller Content-Language: en-US To: Jiaxun Yang , Maxime Ripard , Thomas Zimmermann , Roland Scheidegger , Zack Rusin , Christian Gmeiner , David Airlie , Daniel Vetter , Rob Herring , Thomas Bogendoerfer , Dan Carpenter , Krzysztof Kozlowski , Andrey Zhizhikin , Sam Ravnborg , "David S . Miller" , Lucas Stach , Maarten Lankhorst , Ilia Mirkin , Qing Zhang , suijingfeng Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org References: <20220327113846.2498146-1-15330273260@189.cn> <20220327113846.2498146-4-15330273260@189.cn> <169412ca-9167-b214-d613-4fe0e76ad36a@flygoat.com> From: Sui Jingfeng <15330273260@189.cn> In-Reply-To: <169412ca-9167-b214-d613-4fe0e76ad36a@flygoat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,FROM_LOCAL_DIGITS, FROM_LOCAL_HEX,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/3/27 20:54, Jiaxun Yang wrote: > > > 在 2022/3/27 12:38, Sui Jingfeng 写道: >> Add DT bindings and simple usages for Loongson display controller >> found in LS7A1000 bridges chip and LS2k1000 SoC. >> >> Signed-off-by: Sui Jingfeng <15330273260@189.cn> > [...] >> + >> +  - | >> +    #include >> +    bus { >> + >> +        #address-cells = <3>; >> +        #size-cells = <2>; >> +        #interrupt-cells = <2>; >> + >> +        display-controller@6,1 { >> +            compatible = "loongson,ls7a1000-dc"; >> +            reg = <0x3100 0x0 0x0 0x0 0x0>; >> +            interrupts = <28 IRQ_TYPE_LEVEL_HIGH>; >> + >> +            #address-cells = <1>; >> +            #size-cells = <0>; >> + >> +            i2c@6 { >> +                compatible = "loongson,gpio-i2c"; >> +                reg = <0x00001650 0x00000020>; > Hi Jingfeng, > > Thanks for your patch. > > Just curious about what is this "reg" for? Hi, Jiaxun Thanks for you take valuable time to review my patch. Without it make dt_binding_check generate warnings: Documentation/devicetree/bindings/display/loongson/loongson,display-controller.example.dts:65.23-73.19: Warning (unit_address_vs_reg): /example-1/bus/display-controller@6,1/i2c@6: node has a unit name, but no reg or ranges property reg are the control register offset and size of the dedicate GPIO, they are not get used by the driver currently, put in there just for silence the warning . >> +                loongson,nr = <6>; > Why nr start from 6? Bus number greater than 6 is safe because ls7a1000 bridge have 6 hardware I2C controller integrated. but the driver for it is not upstream yet. To avoid potential conflict with the bus number of the hardware I2C driver. In the future, if someone contribute the hardware I2C driver to upstream, you don't need change it. Let me give you an example to show what it will be: aliases { i2c0 = &i2c0; i2c1 = &i2c1; i2c2 = &i2c2; i2c3 = &i2c3; i2c4 = &i2c4; i2c5 = &i2c5; i2c6 = &i2c6; i2c7 = &i2c7; }; i2c0: i2c@10090000 { compatible = "loongson,ls-i2c"; reg = <0x10090000 0x8>; interrupts = <73>; interrupt-parent = <&platic>; #address-cells = <1>; #size-cells = <0>; }; i2c1: i2c@10090100 { compatible = "loongson,ls-i2c"; reg = <0x10090100 0x8>; interrupts = <73>; interrupt-parent = <&platic>; #address-cells = <1>; #size-cells = <0>; }; i2c2: i2c@10090200 { compatible = "loongson,ls-i2c"; reg = <0x10090200 0x8>; interrupts = <73>; interrupt-parent = <&platic>; #address-cells = <1>; #size-cells = <0>; }; i2c3: i2c@10090300 { compatible = "loongson,ls-i2c"; reg = <0x10090300 0x8>; interrupts = <73>; interrupt-parent = <&platic>; #address-cells = <1>; #size-cells = <0>; }; i2c4: i2c@10090400 { compatible = "loongson,ls-i2c"; reg = <0x10090400 0x8>; interrupts = <73>; interrupt-parent = <&platic>; #address-cells = <1>; #size-cells = <0>; }; i2c5: i2c@10090500 { compatible = "loongson,ls-i2c"; reg = <0x10090500 0x8>; interrupts = <73>; interrupt-parent = <&platic>; #address-cells = <1>; #size-cells = <0>; }; > The approach you are handling I2C seems to be wired.. > It is not wired,  you can change it to 0 or 1 it you like currently, you can even remove loongson,nr = <6> and loongson,nr = <7>, then the i2c core driver will automatically  allocate one for you. It is very flexible actually. > Actually you can reference how network subsystem is handling > MDIO controller built-in into Ethernet controller [1] in this case. It is > basically the same problem. > > [1]: > https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/net/snps,dwmac.yaml > > Thanks. > - Jiaxun > >> +                loongson,sda = <0>; >> +                loongson,scl = <1>; >> +                loongson,udelay = <5>; >> +                loongson,timeout = <2200>; >> +            }; >> + >> +            i2c@7 { >> +                compatible = "loongson,gpio-i2c"; >> +                reg = <0x00001650 0x00000020>; >> +                loongson,nr = <7>; >> +                loongson,sda = <2>; >> +                loongson,scl = <3>; >> +                loongson,udelay = <5>; >> +                loongson,timeout = <2200>; >> +            }; >> + >> +            ports { >> +                #address-cells = <1>; >> +                #size-cells = <0>; >> +                port@0 { >> +                    reg = <0>; >> +                    endpoint { >> +                            remote-endpoint = <&vga_encoder_in>; >> +                    }; >> +                }; >> + >> +                port@1 { >> +                    reg = <1>; >> +                    endpoint { >> +                            remote-endpoint = <&dvi_encoder_in>; >> +                    }; >> +                }; >> +            }; >> +        }; >> +    }; >> + >> +  - | >> +    #include >> +    bus { >> + >> +        #address-cells = <3>; >> +        #size-cells = <2>; >> +        #interrupt-cells = <2>; >> + >> +        display-controller@6,0 { >> +            compatible = "loongson,ls2k1000-dc"; >> +            reg = <0x3100 0x0 0x0 0x0 0x0>; >> +            interrupts = <28 IRQ_TYPE_LEVEL_HIGH>; >> + >> +            ports { >> +                #address-cells = <1>; >> +                #size-cells = <0>; >> +                port@0 { >> +                    reg = <0>; >> +                    endpoint { >> +                            remote-endpoint = <&panel_in>; >> +                    }; >> +                }; >> + >> +                port@1 { >> +                    reg = <1>; >> +                    endpoint { >> +                            remote-endpoint = <&hdmi_encoder_in>; >> +                    }; >> +                }; >> +            }; >> +        }; >> +    }; >> +... >