Message ID | 20230608072819.25930-2-zhuyinbo@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp110378vqr; Thu, 8 Jun 2023 00:50:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ54H1YevQ1EaVCXKhhMK6N/BZka7wymqdCMM/fHGrMZhRUU2Hdp5LWrA5mxdanvt0wsrNtg X-Received: by 2002:a05:6a20:7da0:b0:10e:e891:534 with SMTP id v32-20020a056a207da000b0010ee8910534mr3112600pzj.58.1686210617212; Thu, 08 Jun 2023 00:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686210617; cv=none; d=google.com; s=arc-20160816; b=0jX/GwjXle+1eJ1/RzY3AH4qMCyg8/uQGNGokA1yAjRJmpf5bdjTReTMUAfFvs8T+2 6nwj/e8CIsXKYc9PQa20yNNdIRH3vvAxORZRNhQWMNwfNbYD0iD3beg3qwpZ+swk9W6t sCo/H0hI774m6hE5zOQtG+Kle+HJfUC/RF5De3qv4d07nFUXwStvyHy7sy/+PnMvuXzf hOmUHXOL691ItCnefM62LYc8nBfXNt1Oort3hWu3Q0yGdyf1D/6PGylwJnyUJXcIuhV0 pItIWDzlGcfjEUZIyD9CCtErK1JXvqeqEGL2HRqWgAyNdEb6eEM+dJh5aoKZ1OgmWHzr E8vA== 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=2BdT50mCG3RK5/jw0ecupDgtB/ikk5f6vnUjRjwnO/k=; b=vvfgGeLNpS5Sytf+UrAM2iddYVp/59RIVkXz2LLYSUouMNThTGbahGSb1LmQjOnZhR 1W+oovrNlMHDlC+S26bQBm8QJMUMa9vDEke4b2Oi1eG6e7E1gSiNOxNgHtI0IMI9TCUV bmGOtkX46hfLW/1N6qPIsd19oTaV6pe37Ok3hyOttF7a1DvLsgL0oOvH+fpu0vfEEdsJ 5ayUYzsCaPNZVTsGARPdh8MbURqOLjcpOWwVmlfvaVpuqwvsQEj0XgyBsW/HZzR80EKN VkA1CsCTJaQEQVtqW7E0i96egVfrb48/Fo0CbFYmOeZrJfcgMDD94EpqHBmYRulkH1uf hluQ== 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 p18-20020a170902ebd200b001b066a9c06asi644093plg.583.2023.06.08.00.50.03; Thu, 08 Jun 2023 00:50:17 -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 S235393AbjFHH2k (ORCPT <rfc822;liningstudo@gmail.com> + 99 others); Thu, 8 Jun 2023 03:28:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235356AbjFHH2i (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 8 Jun 2023 03:28:38 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8C3191FDA; Thu, 8 Jun 2023 00:28:29 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.35]) by gateway (Coremail) with SMTP id _____8CxPuscg4Fk6XMAAA--.1813S3; Thu, 08 Jun 2023 15:28:28 +0800 (CST) Received: from user-pc.202.106.0.20 (unknown [10.20.42.35]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxC8oVg4Fka+EGAA--.13745S3; Thu, 08 Jun 2023 15:28:26 +0800 (CST) From: Yinbo Zhu <zhuyinbo@loongson.cn> To: Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jianmin Lv <lvjianmin@loongson.cn>, wanghongliang@loongson.cn, Liu Peibao <liupeibao@loongson.cn>, loongson-kernel@lists.loongnix.cn, Yinbo Zhu <zhuyinbo@loongson.cn>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Subject: [PATCH v12 1/2] spi: add loongson spi bindings Date: Thu, 8 Jun 2023 15:28:18 +0800 Message-Id: <20230608072819.25930-2-zhuyinbo@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230608072819.25930-1-zhuyinbo@loongson.cn> References: <20230608072819.25930-1-zhuyinbo@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8BxC8oVg4Fka+EGAA--.13745S3 X-CM-SenderInfo: 52kx5xhqerqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1768119984238171100?= X-GMAIL-MSGID: =?utf-8?q?1768119984238171100?= |
Series |
spi: loongson: add bus driver for the loongson spi
|
|
Commit Message
Yinbo Zhu
June 8, 2023, 7:28 a.m. UTC
Add the Loongson platform spi binding with DT schema format using json-schema. Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> --- .../bindings/spi/loongson,ls2k-spi.yaml | 41 +++++++++++++++++++ MAINTAINERS | 6 +++ 2 files changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml
Comments
On 08/06/2023 09:28, Yinbo Zhu wrote: > Add the Loongson platform spi binding with DT schema format using > json-schema. Please use subject prefixes matching the subsystem. You can get them for example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory your patch is touching. The prefix for SPI should be: "spi: dt-bindings: ". In the same time last "bindings" are redundant. > > Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > --- > .../bindings/spi/loongson,ls2k-spi.yaml | 41 +++++++++++++++++++ > MAINTAINERS | 6 +++ > 2 files changed, 47 insertions(+) > create mode 100644 Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml > > diff --git a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml > new file mode 100644 > index 000000000000..423ee851edd5 > --- /dev/null > +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml Filename based on compatible. > @@ -0,0 +1,41 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/spi/loongson,ls2k-spi.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Loongson SPI controller > + > +maintainers: > + - Yinbo Zhu <zhuyinbo@loongson.cn> > + > +allOf: > + - $ref: /schemas/spi/spi-controller.yaml# > + > +properties: > + compatible: > + enum: > + - loongson,ls2k1000-spi No compatibles for other devices? Didn't we have big discussion about this? https://elixir.bootlin.com/linux/v6.1-rc1/source/Documentation/devicetree/bindings/writing-bindings.rst#L42 Best regards, Krzysztof
在 2023/6/8 下午3:45, Krzysztof Kozlowski 写道: > On 08/06/2023 09:28, Yinbo Zhu wrote: >> Add the Loongson platform spi binding with DT schema format using >> json-schema. > > Please use subject prefixes matching the subsystem. You can get them for > example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory > your patch is touching. > > The prefix for SPI should be: "spi: dt-bindings: ". In the same time > last "bindings" are redundant. okay, I got it. > >> >> Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> >> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >> --- >> .../bindings/spi/loongson,ls2k-spi.yaml | 41 +++++++++++++++++++ >> MAINTAINERS | 6 +++ >> 2 files changed, 47 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >> >> diff --git a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >> new file mode 100644 >> index 000000000000..423ee851edd5 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml > > Filename based on compatible. There will be more ls2k series SoC spi device in the future thus I still use "loongson,ls2k-spi.yaml" for cover it. > >> @@ -0,0 +1,41 @@ >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/spi/loongson,ls2k-spi.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Loongson SPI controller >> + >> +maintainers: >> + - Yinbo Zhu <zhuyinbo@loongson.cn> >> + >> +allOf: >> + - $ref: /schemas/spi/spi-controller.yaml# >> + >> +properties: >> + compatible: >> + enum: >> + - loongson,ls2k1000-spi > > No compatibles for other devices? Didn't we have big discussion about this? > > https://elixir.bootlin.com/linux/v6.1-rc1/source/Documentation/devicetree/bindings/writing-bindings.rst#L42 There are other ls2k SPI devices compatible, such as, "loongson,ls2k0500-spi", "loongson,ls2k2000-spi" but currently I plan to add ls2k1000 spi device first, Other ls2k SoC spi device adaptation may require some additional work and I will add it later. Thanks
On 08/06/2023 10:39, zhuyinbo wrote: >>> >>> Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> >>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >>> --- >>> .../bindings/spi/loongson,ls2k-spi.yaml | 41 +++++++++++++++++++ >>> MAINTAINERS | 6 +++ >>> 2 files changed, 47 insertions(+) >>> create mode 100644 Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>> >>> diff --git a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>> new file mode 100644 >>> index 000000000000..423ee851edd5 >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >> >> Filename based on compatible. > > > There will be more ls2k series SoC spi device in the future thus I still > use "loongson,ls2k-spi.yaml" for cover it. Add them now. > >> >>> @@ -0,0 +1,41 @@ >>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >>> +%YAML 1.2 >>> +--- >>> +$id: http://devicetree.org/schemas/spi/loongson,ls2k-spi.yaml# >>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>> + >>> +title: Loongson SPI controller >>> + >>> +maintainers: >>> + - Yinbo Zhu <zhuyinbo@loongson.cn> >>> + >>> +allOf: >>> + - $ref: /schemas/spi/spi-controller.yaml# >>> + >>> +properties: >>> + compatible: >>> + enum: >>> + - loongson,ls2k1000-spi >> >> No compatibles for other devices? Didn't we have big discussion about this? >> >> https://elixir.bootlin.com/linux/v6.1-rc1/source/Documentation/devicetree/bindings/writing-bindings.rst#L42 > > > There are other ls2k SPI devices compatible, such as, > "loongson,ls2k0500-spi", "loongson,ls2k2000-spi" but currently I plan to > add ls2k1000 spi device first, Other ls2k SoC spi device adaptation may > require some additional work and I will add it later. Previously you claimed this serves entire family, so I don't understand why you need to fix something. Why previously it was working for entire family but now it does not? Best regards, Krzysztof
在 2023/6/8 下午4:53, Krzysztof Kozlowski 写道: > On 08/06/2023 10:39, zhuyinbo wrote: >>>> >>>> Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> >>>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >>>> --- >>>> .../bindings/spi/loongson,ls2k-spi.yaml | 41 +++++++++++++++++++ >>>> MAINTAINERS | 6 +++ >>>> 2 files changed, 47 insertions(+) >>>> create mode 100644 Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>> >>>> diff --git a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>> new file mode 100644 >>>> index 000000000000..423ee851edd5 >>>> --- /dev/null >>>> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>> >>> Filename based on compatible. >> >> >> There will be more ls2k series SoC spi device in the future thus I still >> use "loongson,ls2k-spi.yaml" for cover it. > > Add them now. The 2k0500 doesn't support CCF and not use CCF to gain clock and We internally tend to prioritize supporting 2k1000. > >> >>> >>>> @@ -0,0 +1,41 @@ >>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >>>> +%YAML 1.2 >>>> +--- >>>> +$id: http://devicetree.org/schemas/spi/loongson,ls2k-spi.yaml# >>>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>>> + >>>> +title: Loongson SPI controller >>>> + >>>> +maintainers: >>>> + - Yinbo Zhu <zhuyinbo@loongson.cn> >>>> + >>>> +allOf: >>>> + - $ref: /schemas/spi/spi-controller.yaml# >>>> + >>>> +properties: >>>> + compatible: >>>> + enum: >>>> + - loongson,ls2k1000-spi >>> >>> No compatibles for other devices? Didn't we have big discussion about this? >>> >>> https://elixir.bootlin.com/linux/v6.1-rc1/source/Documentation/devicetree/bindings/writing-bindings.rst#L42 >> >> >> There are other ls2k SPI devices compatible, such as, >> "loongson,ls2k0500-spi", "loongson,ls2k2000-spi" but currently I plan to >> add ls2k1000 spi device first, Other ls2k SoC spi device adaptation may >> require some additional work and I will add it later. > > Previously you claimed this serves entire family, so I don't understand > why you need to fix something. Why previously it was working for entire > family but now it does not? It can work was for ls2k1000 and ls2k0500 and it specifically refers to spi driver. but 2k0500 doesn't implementing a clock driver and doesn't use CCF to gain clock but can use "clock-frequency". Is it necessary to obtain a clock based on CCF? If it's necessary, then it seems that it can only added 2k1000 spi first. Thanks, Yinbo
On 08/06/2023 12:00, zhuyinbo wrote: > > > 在 2023/6/8 下午4:53, Krzysztof Kozlowski 写道: >> On 08/06/2023 10:39, zhuyinbo wrote: >>>>> >>>>> Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> >>>>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >>>>> --- >>>>> .../bindings/spi/loongson,ls2k-spi.yaml | 41 +++++++++++++++++++ >>>>> MAINTAINERS | 6 +++ >>>>> 2 files changed, 47 insertions(+) >>>>> create mode 100644 Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>> >>>>> diff --git a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>> new file mode 100644 >>>>> index 000000000000..423ee851edd5 >>>>> --- /dev/null >>>>> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>> >>>> Filename based on compatible. >>> >>> >>> There will be more ls2k series SoC spi device in the future thus I still >>> use "loongson,ls2k-spi.yaml" for cover it. >> >> Add them now. > > > The 2k0500 doesn't support CCF and not use CCF to gain clock and We > internally tend to prioritize supporting 2k1000. Don't you refer now to drivers? Because how hardware can not support clocks if it has them? How CCF is anyhow related to hardware? > >> >>> >>>> >>>>> @@ -0,0 +1,41 @@ >>>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >>>>> +%YAML 1.2 >>>>> +--- >>>>> +$id: http://devicetree.org/schemas/spi/loongson,ls2k-spi.yaml# >>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>>>> + >>>>> +title: Loongson SPI controller >>>>> + >>>>> +maintainers: >>>>> + - Yinbo Zhu <zhuyinbo@loongson.cn> >>>>> + >>>>> +allOf: >>>>> + - $ref: /schemas/spi/spi-controller.yaml# >>>>> + >>>>> +properties: >>>>> + compatible: >>>>> + enum: >>>>> + - loongson,ls2k1000-spi >>>> >>>> No compatibles for other devices? Didn't we have big discussion about this? >>>> >>>> https://elixir.bootlin.com/linux/v6.1-rc1/source/Documentation/devicetree/bindings/writing-bindings.rst#L42 >>> >>> >>> There are other ls2k SPI devices compatible, such as, >>> "loongson,ls2k0500-spi", "loongson,ls2k2000-spi" but currently I plan to >>> add ls2k1000 spi device first, Other ls2k SoC spi device adaptation may >>> require some additional work and I will add it later. >> >> Previously you claimed this serves entire family, so I don't understand >> why you need to fix something. Why previously it was working for entire >> family but now it does not? > > > It can work was for ls2k1000 and ls2k0500 and it specifically refers to > spi driver. but 2k0500 doesn't implementing a clock driver and doesn't We do not discuss here drivers, but bindings. Whatever your drivers are not supporting, matters less. > use CCF to gain clock but can use "clock-frequency". Is it necessary to > obtain a clock based on CCF? If it's necessary, then it seems that it > can only added 2k1000 spi first. Not related to bindings... Best regards, Krzysztof
在 2023/6/8 下午6:02, Krzysztof Kozlowski 写道: > On 08/06/2023 12:00, zhuyinbo wrote: >> >> >> 在 2023/6/8 下午4:53, Krzysztof Kozlowski 写道: >>> On 08/06/2023 10:39, zhuyinbo wrote: >>>>>> >>>>>> Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> >>>>>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >>>>>> --- >>>>>> .../bindings/spi/loongson,ls2k-spi.yaml | 41 +++++++++++++++++++ >>>>>> MAINTAINERS | 6 +++ >>>>>> 2 files changed, 47 insertions(+) >>>>>> create mode 100644 Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>> >>>>>> diff --git a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>> new file mode 100644 >>>>>> index 000000000000..423ee851edd5 >>>>>> --- /dev/null >>>>>> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>> >>>>> Filename based on compatible. >>>> >>>> >>>> There will be more ls2k series SoC spi device in the future thus I still >>>> use "loongson,ls2k-spi.yaml" for cover it. >>> >>> Add them now. >> >> >> The 2k0500 doesn't support CCF and not use CCF to gain clock and We >> internally tend to prioritize supporting 2k1000. > > Don't you refer now to drivers? Because how hardware can not support > clocks if it has them? How CCF is anyhow related to hardware? The CCF (common clock framework) driver only affects the clock parameter pass method and isn't related to clock hardware. and if dts pass a "clock-frequency" that not need a clock driver but if dts pass a "clocks" that need a clock driver. Currently, only 2k1000 has implemented a clock driver. > >> >>> >>>> >>>>> >>>>>> @@ -0,0 +1,41 @@ >>>>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >>>>>> +%YAML 1.2 >>>>>> +--- >>>>>> +$id: http://devicetree.org/schemas/spi/loongson,ls2k-spi.yaml# >>>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>>>>> + >>>>>> +title: Loongson SPI controller >>>>>> + >>>>>> +maintainers: >>>>>> + - Yinbo Zhu <zhuyinbo@loongson.cn> >>>>>> + >>>>>> +allOf: >>>>>> + - $ref: /schemas/spi/spi-controller.yaml# >>>>>> + >>>>>> +properties: >>>>>> + compatible: >>>>>> + enum: >>>>>> + - loongson,ls2k1000-spi >>>>> >>>>> No compatibles for other devices? Didn't we have big discussion about this? >>>>> >>>>> https://elixir.bootlin.com/linux/v6.1-rc1/source/Documentation/devicetree/bindings/writing-bindings.rst#L42 >>>> >>>> >>>> There are other ls2k SPI devices compatible, such as, >>>> "loongson,ls2k0500-spi", "loongson,ls2k2000-spi" but currently I plan to >>>> add ls2k1000 spi device first, Other ls2k SoC spi device adaptation may >>>> require some additional work and I will add it later. >>> >>> Previously you claimed this serves entire family, so I don't understand >>> why you need to fix something. Why previously it was working for entire >>> family but now it does not? >> >> >> It can work was for ls2k1000 and ls2k0500 and it specifically refers to >> spi driver. but 2k0500 doesn't implementing a clock driver and doesn't > > We do not discuss here drivers, but bindings. Whatever your drivers are > not supporting, matters less. > >> use CCF to gain clock but can use "clock-frequency". Is it necessary to >> obtain a clock based on CCF? If it's necessary, then it seems that it >> can only added 2k1000 spi first. > > Not related to bindings... I may understand that what you said, and the dt-bindings only cover hardware and not involve the drivers. if so, I will add following: --- a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml @@ -16,6 +16,7 @@ properties: compatible: enum: - loongson,ls2k1000-spi + - loongson,ls2k0500-spi Thanks, Yinbo
On 08/06/2023 13:42, zhuyinbo wrote: >> >>> It can work was for ls2k1000 and ls2k0500 and it specifically refers to >>> spi driver. but 2k0500 doesn't implementing a clock driver and doesn't >> >> We do not discuss here drivers, but bindings. Whatever your drivers are >> not supporting, matters less. >> >>> use CCF to gain clock but can use "clock-frequency". Is it necessary to >>> obtain a clock based on CCF? If it's necessary, then it seems that it >>> can only added 2k1000 spi first. >> >> Not related to bindings... > > > I may understand that what you said, and the dt-bindings only cover > hardware and not involve the drivers. if so, I will add following: > > > --- a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml > +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml > @@ -16,6 +16,7 @@ properties: > compatible: > enum: > - loongson,ls2k1000-spi > + - loongson,ls2k0500-spi Aren't they compatible? Best regards, Krzysztof
在 2023/6/8 下午7:45, Krzysztof Kozlowski 写道: > On 08/06/2023 13:42, zhuyinbo wrote: >> --- a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >> @@ -16,6 +16,7 @@ properties: >> compatible: >> enum: >> - loongson,ls2k1000-spi >> + - loongson,ls2k0500-spi > > Aren't they compatible? > Are you saying that the spi driver is compatible with 2k0500 ? Yes. and the 2k1000 spi hardware was same with 2k0500 common type spi hardware. but afterwards, it may be necessary to implement a clock drvier for 2k0500, because the spi driver was use "devm_clk_get_optional()" to get clock and not use "of_property_read_u32(np, "clock-frequency", &clk)", But this seems to have nothing to do with bindings. Thanks, Yinbo
On 08/06/2023 14:10, zhuyinbo wrote: > > > 在 2023/6/8 下午7:45, Krzysztof Kozlowski 写道: >> On 08/06/2023 13:42, zhuyinbo wrote: >>> --- a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>> @@ -16,6 +16,7 @@ properties: >>> compatible: >>> enum: >>> - loongson,ls2k1000-spi >>> + - loongson,ls2k0500-spi >> >> Aren't they compatible? >> > > > Are you saying that the spi driver is compatible with 2k0500 ? Didn't you say this through 11 previous revisions? > Yes. and the 2k1000 spi hardware was same with 2k0500 common type spi > hardware. > > but afterwards, it may be necessary to implement a clock drvier for > 2k0500, because the spi driver was use "devm_clk_get_optional()" to > get clock and not use "of_property_read_u32(np, "clock-frequency", > &clk)", But this seems to have nothing to do with bindings. > Best regards, Krzysztof
在 2023/6/8 下午9:26, Krzysztof Kozlowski 写道: > On 08/06/2023 14:10, zhuyinbo wrote: >> >> >> 在 2023/6/8 下午7:45, Krzysztof Kozlowski 写道: >>> On 08/06/2023 13:42, zhuyinbo wrote: >>>> --- a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>> @@ -16,6 +16,7 @@ properties: >>>> compatible: >>>> enum: >>>> - loongson,ls2k1000-spi >>>> + - loongson,ls2k0500-spi >>> >>> Aren't they compatible? >>> >> >> >> Are you saying that the spi driver is compatible with 2k0500 ? > > Didn't you say this through 11 previous revisions? Yes, did I understand your meaning incorrectly ? Thanks, Yinbo > >> Yes. and the 2k1000 spi hardware was same with 2k0500 common type spi >> hardware. >> >> but afterwards, it may be necessary to implement a clock drvier for >> 2k0500, because the spi driver was use "devm_clk_get_optional()" to >> get clock and not use "of_property_read_u32(np, "clock-frequency", >> &clk)", But this seems to have nothing to do with bindings.
On 09/06/2023 05:13, zhuyinbo wrote: > > > 在 2023/6/8 下午9:26, Krzysztof Kozlowski 写道: >> On 08/06/2023 14:10, zhuyinbo wrote: >>> >>> >>> 在 2023/6/8 下午7:45, Krzysztof Kozlowski 写道: >>>> On 08/06/2023 13:42, zhuyinbo wrote: >>>>> --- a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>> @@ -16,6 +16,7 @@ properties: >>>>> compatible: >>>>> enum: >>>>> - loongson,ls2k1000-spi >>>>> + - loongson,ls2k0500-spi >>>> >>>> Aren't they compatible? >>>> >>> >>> >>> Are you saying that the spi driver is compatible with 2k0500 ? >> >> Didn't you say this through 11 previous revisions? > > > Yes, did I understand your meaning incorrectly ? If they are compatible, then they are not part of one enum. They could not be as this would easily fail in testing of your DTS. Best regards, Krzysztof
在 2023/6/10 上午12:45, Krzysztof Kozlowski 写道: > On 09/06/2023 05:13, zhuyinbo wrote: >> >> >> 在 2023/6/8 下午9:26, Krzysztof Kozlowski 写道: >>> On 08/06/2023 14:10, zhuyinbo wrote: >>>> >>>> >>>> 在 2023/6/8 下午7:45, Krzysztof Kozlowski 写道: >>>>> On 08/06/2023 13:42, zhuyinbo wrote: >>>>>> --- a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>> @@ -16,6 +16,7 @@ properties: >>>>>> compatible: >>>>>> enum: >>>>>> - loongson,ls2k1000-spi >>>>>> + - loongson,ls2k0500-spi >>>>> >>>>> Aren't they compatible? >>>>> >>>> >>>> >>>> Are you saying that the spi driver is compatible with 2k0500 ? >>> >>> Didn't you say this through 11 previous revisions? >> >> >> Yes, did I understand your meaning incorrectly ? > > If they are compatible, then they are not part of one enum. They could > not be as this would easily fail in testing of your DTS. > The "loongson,ls2k0500-spi" wasn't a compatible in previous version and I will add "loongson,ls2k0500-spi" as a compatible in spi driver and added it as a part of the one enum in dt-binding. Thanks, Yinbo
On 12/06/2023 09:13, zhuyinbo wrote: > > > 在 2023/6/10 上午12:45, Krzysztof Kozlowski 写道: >> On 09/06/2023 05:13, zhuyinbo wrote: >>> >>> >>> 在 2023/6/8 下午9:26, Krzysztof Kozlowski 写道: >>>> On 08/06/2023 14:10, zhuyinbo wrote: >>>>> >>>>> >>>>> 在 2023/6/8 下午7:45, Krzysztof Kozlowski 写道: >>>>>> On 08/06/2023 13:42, zhuyinbo wrote: >>>>>>> --- a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>>> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>>> @@ -16,6 +16,7 @@ properties: >>>>>>> compatible: >>>>>>> enum: >>>>>>> - loongson,ls2k1000-spi >>>>>>> + - loongson,ls2k0500-spi >>>>>> >>>>>> Aren't they compatible? >>>>>> >>>>> >>>>> >>>>> Are you saying that the spi driver is compatible with 2k0500 ? >>>> >>>> Didn't you say this through 11 previous revisions? >>> >>> >>> Yes, did I understand your meaning incorrectly ? >> >> If they are compatible, then they are not part of one enum. They could >> not be as this would easily fail in testing of your DTS. >> > > > The "loongson,ls2k0500-spi" wasn't a compatible in previous version and > I will add "loongson,ls2k0500-spi" as a compatible in spi driver and > added it as a part of the one enum in dt-binding. No, because you claimed - if I understood correctly - that they are compatible. Don't add fake entries to the driver. Best regards, Krzysztof
在 2023/6/12 下午3:17, Krzysztof Kozlowski 写道: > On 12/06/2023 09:13, zhuyinbo wrote: >> >> >> 在 2023/6/10 上午12:45, Krzysztof Kozlowski 写道: >>> On 09/06/2023 05:13, zhuyinbo wrote: >>>> >>>> >>>> 在 2023/6/8 下午9:26, Krzysztof Kozlowski 写道: >>>>> On 08/06/2023 14:10, zhuyinbo wrote: >>>>>> >>>>>> >>>>>> 在 2023/6/8 下午7:45, Krzysztof Kozlowski 写道: >>>>>>> On 08/06/2023 13:42, zhuyinbo wrote: >>>>>>>> --- a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>>>> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>>>> @@ -16,6 +16,7 @@ properties: >>>>>>>> compatible: >>>>>>>> enum: >>>>>>>> - loongson,ls2k1000-spi >>>>>>>> + - loongson,ls2k0500-spi >>>>>>> >>>>>>> Aren't they compatible? >>>>>>> >>>>>> >>>>>> >>>>>> Are you saying that the spi driver is compatible with 2k0500 ? >>>>> >>>>> Didn't you say this through 11 previous revisions? >>>> >>>> >>>> Yes, did I understand your meaning incorrectly ? >>> >>> If they are compatible, then they are not part of one enum. They could >>> not be as this would easily fail in testing of your DTS. >>> >> >> >> The "loongson,ls2k0500-spi" wasn't a compatible in previous version and >> I will add "loongson,ls2k0500-spi" as a compatible in spi driver and >> added it as a part of the one enum in dt-binding. > > No, because you claimed - if I understood correctly - that they are > compatible. Don't add fake entries to the driver. > I'm a bit confused, and I just need to add 'loongson,ls2k0500-spi' as one enum in dt-bindings, but driver don't add this entry ? Thanks, Yinbo
On 12/06/2023 09:40, zhuyinbo wrote: > > > 在 2023/6/12 下午3:17, Krzysztof Kozlowski 写道: >> On 12/06/2023 09:13, zhuyinbo wrote: >>> >>> >>> 在 2023/6/10 上午12:45, Krzysztof Kozlowski 写道: >>>> On 09/06/2023 05:13, zhuyinbo wrote: >>>>> >>>>> >>>>> 在 2023/6/8 下午9:26, Krzysztof Kozlowski 写道: >>>>>> On 08/06/2023 14:10, zhuyinbo wrote: >>>>>>> >>>>>>> >>>>>>> 在 2023/6/8 下午7:45, Krzysztof Kozlowski 写道: >>>>>>>> On 08/06/2023 13:42, zhuyinbo wrote: >>>>>>>>> --- a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>>>>> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>>>>> @@ -16,6 +16,7 @@ properties: >>>>>>>>> compatible: >>>>>>>>> enum: >>>>>>>>> - loongson,ls2k1000-spi >>>>>>>>> + - loongson,ls2k0500-spi >>>>>>>> >>>>>>>> Aren't they compatible? >>>>>>>> >>>>>>> >>>>>>> >>>>>>> Are you saying that the spi driver is compatible with 2k0500 ? >>>>>> >>>>>> Didn't you say this through 11 previous revisions? >>>>> >>>>> >>>>> Yes, did I understand your meaning incorrectly ? >>>> >>>> If they are compatible, then they are not part of one enum. They could >>>> not be as this would easily fail in testing of your DTS. >>>> >>> >>> >>> The "loongson,ls2k0500-spi" wasn't a compatible in previous version and >>> I will add "loongson,ls2k0500-spi" as a compatible in spi driver and >>> added it as a part of the one enum in dt-binding. >> >> No, because you claimed - if I understood correctly - that they are >> compatible. Don't add fake entries to the driver. >> > > > I'm a bit confused, and I just need to add 'loongson,ls2k0500-spi' as > one enum in dt-bindings, but driver don't add this entry ? Compatibility is expressed with a list: https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#compatible so it cannot be just one enum, but "items". There are hundreds of examples including example-schema. Best regards, Krzysztof
在 2023/6/12 下午4:16, Krzysztof Kozlowski 写道: >>>>>>>> 在 2023/6/8 下午7:45, Krzysztof Kozlowski 写道: >>>>>>>>> On 08/06/2023 13:42, zhuyinbo wrote: >>>>>>>>>> --- a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>>>>>> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>>>>>> @@ -16,6 +16,7 @@ properties: >>>>>>>>>> compatible: >>>>>>>>>> enum: >>>>>>>>>> - loongson,ls2k1000-spi >>>>>>>>>> + - loongson,ls2k0500-spi >>>>>>>>> >>>>>>>>> Aren't they compatible? >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Are you saying that the spi driver is compatible with 2k0500 ? >>>>>>> >>>>>>> Didn't you say this through 11 previous revisions? >>>>>> >>>>>> >>>>>> Yes, did I understand your meaning incorrectly ? >>>>> >>>>> If they are compatible, then they are not part of one enum. They could >>>>> not be as this would easily fail in testing of your DTS. >>>>> >>>> >>>> >>>> The "loongson,ls2k0500-spi" wasn't a compatible in previous version and >>>> I will add "loongson,ls2k0500-spi" as a compatible in spi driver and >>>> added it as a part of the one enum in dt-binding. >>> >>> No, because you claimed - if I understood correctly - that they are >>> compatible. Don't add fake entries to the driver. >>> >> >> >> I'm a bit confused, and I just need to add 'loongson,ls2k0500-spi' as >> one enum in dt-bindings, but driver don't add this entry ? > > Compatibility is expressed with a list: > https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#compatible > so it cannot be just one enum, but "items". There are hundreds of > examples including example-schema. Is it a description like the following? properties: compatible: - enum: - - loongson,ls2k1000-spi + oneOf: + - enum: + - loongson,ls2k1000-spi + - items: + - enum: + - loongson,ls2k1000-spi + - const: loongson,ls2k1000-spi + - items: + - enum: + - loongson,ls2k0500-spi + - const: loongson,ls2k1000-spi reg: Thanks, Yinbo
On 12/06/2023 13:29, zhuyinbo wrote: > > > 在 2023/6/12 下午4:16, Krzysztof Kozlowski 写道: >>>>>>>>> 在 2023/6/8 下午7:45, Krzysztof Kozlowski 写道: >>>>>>>>>> On 08/06/2023 13:42, zhuyinbo wrote: >>>>>>>>>>> --- a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>>>>>>> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>>>>>>> @@ -16,6 +16,7 @@ properties: >>>>>>>>>>> compatible: >>>>>>>>>>> enum: >>>>>>>>>>> - loongson,ls2k1000-spi >>>>>>>>>>> + - loongson,ls2k0500-spi >>>>>>>>>> >>>>>>>>>> Aren't they compatible? >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> Are you saying that the spi driver is compatible with 2k0500 ? >>>>>>>> >>>>>>>> Didn't you say this through 11 previous revisions? >>>>>>> >>>>>>> >>>>>>> Yes, did I understand your meaning incorrectly ? >>>>>> >>>>>> If they are compatible, then they are not part of one enum. They could >>>>>> not be as this would easily fail in testing of your DTS. >>>>>> >>>>> >>>>> >>>>> The "loongson,ls2k0500-spi" wasn't a compatible in previous version and >>>>> I will add "loongson,ls2k0500-spi" as a compatible in spi driver and >>>>> added it as a part of the one enum in dt-binding. >>>> >>>> No, because you claimed - if I understood correctly - that they are >>>> compatible. Don't add fake entries to the driver. >>>> >>> >>> >>> I'm a bit confused, and I just need to add 'loongson,ls2k0500-spi' as >>> one enum in dt-bindings, but driver don't add this entry ? >> >> Compatibility is expressed with a list: >> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#compatible >> so it cannot be just one enum, but "items". There are hundreds of >> examples including example-schema. > > > Is it a description like the following? > > properties: > compatible: > - enum: > - - loongson,ls2k1000-spi > + oneOf: > + - enum: > + - loongson,ls2k1000-spi > + - items: > + - enum: > + - loongson,ls2k1000-spi > + - const: loongson,ls2k1000-spi Remove this items part - it does not make sense. Device is not compatible with itself. Rest looks ok. Best regards, Krzysztof
在 2023/6/13 上午2:03, Krzysztof Kozlowski 写道: > On 12/06/2023 13:29, zhuyinbo wrote: >> >> >> 在 2023/6/12 下午4:16, Krzysztof Kozlowski 写道: >>>>>>>>>> 在 2023/6/8 下午7:45, Krzysztof Kozlowski 写道: >>>>>>>>>>> On 08/06/2023 13:42, zhuyinbo wrote: >>>>>>>>>>>> --- a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>>>>>>>> +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml >>>>>>>>>>>> @@ -16,6 +16,7 @@ properties: >>>>>>>>>>>> compatible: >>>>>>>>>>>> enum: >>>>>>>>>>>> - loongson,ls2k1000-spi >>>>>>>>>>>> + - loongson,ls2k0500-spi >>>>>>>>>>> >>>>>>>>>>> Aren't they compatible? >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Are you saying that the spi driver is compatible with 2k0500 ? >>>>>>>>> >>>>>>>>> Didn't you say this through 11 previous revisions? >>>>>>>> >>>>>>>> >>>>>>>> Yes, did I understand your meaning incorrectly ? >>>>>>> >>>>>>> If they are compatible, then they are not part of one enum. They could >>>>>>> not be as this would easily fail in testing of your DTS. >>>>>>> >>>>>> >>>>>> >>>>>> The "loongson,ls2k0500-spi" wasn't a compatible in previous version and >>>>>> I will add "loongson,ls2k0500-spi" as a compatible in spi driver and >>>>>> added it as a part of the one enum in dt-binding. >>>>> >>>>> No, because you claimed - if I understood correctly - that they are >>>>> compatible. Don't add fake entries to the driver. >>>>> >>>> >>>> >>>> I'm a bit confused, and I just need to add 'loongson,ls2k0500-spi' as >>>> one enum in dt-bindings, but driver don't add this entry ? >>> >>> Compatibility is expressed with a list: >>> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#compatible >>> so it cannot be just one enum, but "items". There are hundreds of >>> examples including example-schema. >> >> >> Is it a description like the following? >> >> properties: >> compatible: >> - enum: >> - - loongson,ls2k1000-spi >> + oneOf: >> + - enum: >> + - loongson,ls2k1000-spi >> + - items: >> + - enum: >> + - loongson,ls2k1000-spi >> + - const: loongson,ls2k1000-spi > > Remove this items part - it does not make sense. Device is not > compatible with itself. Rest looks ok. okay, I got it. Thanks, Yinbo
diff --git a/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml new file mode 100644 index 000000000000..423ee851edd5 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/loongson,ls2k-spi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Loongson SPI controller + +maintainers: + - Yinbo Zhu <zhuyinbo@loongson.cn> + +allOf: + - $ref: /schemas/spi/spi-controller.yaml# + +properties: + compatible: + enum: + - loongson,ls2k1000-spi + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + +required: + - compatible + - reg + - clocks + +unevaluatedProperties: false + +examples: + - | + spi0: spi@1fff0220{ + compatible = "loongson,ls2k1000-spi"; + reg = <0x1fff0220 0x10>; + clocks = <&clk 17>; + #address-cells = <1>; + #size-cells = <0>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index bc201627c2e0..5e604dddd87b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12186,6 +12186,12 @@ F: Documentation/devicetree/bindings/clock/loongson,ls2k-clk.yaml F: drivers/clk/clk-loongson2.c F: include/dt-bindings/clock/loongson,ls2k-clk.h +LOONGSON SPI DRIVER +M: Yinbo Zhu <zhuyinbo@loongson.cn> +L: linux-spi@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/spi/loongson,ls2k-spi.yaml + LOONGSON-2 SOC SERIES GUTS DRIVER M: Yinbo Zhu <zhuyinbo@loongson.cn> L: loongarch@lists.linux.dev