Message ID | 20230713090015.127541-3-william.qiu@starfivetech.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1699373vqm; Thu, 13 Jul 2023 02:29:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlHIYSfEWABOCImuOZgGTKn+EvDkcH5lxeB458830xTp6W9cGgfhquziLTxZLGZwP8T0v2NS X-Received: by 2002:a92:dad2:0:b0:343:92a1:9cf4 with SMTP id o18-20020a92dad2000000b0034392a19cf4mr985229ilq.19.1689240588095; Thu, 13 Jul 2023 02:29:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689240588; cv=none; d=google.com; s=arc-20160816; b=aciFfdkPbsJlDHPsHF0K0OKYZjK7WprhTybWNcZbrA99y1rpPrM0A9m8vUAnBEOG33 qn8ipo66P7hJ4swjaxDRYncc72ztmxNIjEdVsLmJ2ABvOWuZQ92rX5L52OJUvHXTRnu3 6EaBQnzaLZ5CFgCLkTxACf3w63rD9GG6JluC2rzyrF0bfTYHvGQgFoOfWuv/rBpv4czQ jQTgzz89I15v54lD09PFZ+NZlx5fOsHAsxPkCeFQdcNfjCsG770F2osVBB5JDtYfznjg /TjacDBpUaiG9QkVbEoymKZwLlg7jy4nJdATPxMA21wPb9Lik4ObCnkW9HRc+Ym2f/n8 x1/A== 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=4dUwQt0mxBk9X9v+nkMyF06g3rHj2AF5BUskXqmUATk=; fh=KMHIlvMyk955GAHEXyGRN89XCb+h1B+4yCIVAgCT/kI=; b=B8kERdMxWBXfFR3Qjbb2G7YVOGRVAESTXigOs1tMQZxbrPy8DwcPU+aPufMdwjila+ V8Vz5OeiCR73V9Ld8CDhk6hZZ6dq7c2R39uLT4HUDUetOA1qvu+dtGdgIvbhoo7wXrd9 ZCCzq4KzqdCSzHWn8v85sFbtPBmq9Dmz+UsUAL+959xBzkqpdgD+O0CPnYok4Knj6rj/ DTD4M8bw0Yu/K5IPEIpVLb3iI7ImodsIxtmq+q7OW2Zciv/TIAdisQ0+7REagmTE//Jt 6oR064Hi1RTrTBjCtZeculmI6cLvf63Ucz9tUfSmIO/XuEp1VW6yfA6aLu5lzxPiMWA1 dBBA== 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 by12-20020a056a00400c00b0064d4d472935si4848855pfb.18.2023.07.13.02.29.35; Thu, 13 Jul 2023 02:29:48 -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 S234289AbjGMJAn convert rfc822-to-8bit (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Thu, 13 Jul 2023 05:00:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234660AbjGMJAZ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 13 Jul 2023 05:00:25 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 797D71FF7; Thu, 13 Jul 2023 02:00:22 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 3A41B82E4; Thu, 13 Jul 2023 17:00:18 +0800 (CST) Received: from EXMBX068.cuchost.com (172.16.6.68) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 13 Jul 2023 17:00:18 +0800 Received: from williamqiu-virtual-machine.starfivetech.com (171.223.208.138) by EXMBX068.cuchost.com (172.16.6.68) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 13 Jul 2023 17:00:17 +0800 From: William Qiu <william.qiu@starfivetech.com> To: <devicetree@vger.kernel.org>, <linux-spi@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-riscv@lists.infradead.org> CC: Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Emil Renner Berthing <kernel@esmil.dk>, Linus Walleij <linus.walleij@linaro.org>, William Qiu <william.qiu@starfivetech.com> Subject: [PATCH v2 2/3] dt-bindings: spi: constrain minItems of clocks and clock-names Date: Thu, 13 Jul 2023 17:00:14 +0800 Message-ID: <20230713090015.127541-3-william.qiu@starfivetech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230713090015.127541-1-william.qiu@starfivetech.com> References: <20230713090015.127541-1-william.qiu@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX068.cuchost.com (172.16.6.68) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,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: INBOX X-GMAIL-THRID: 1771297138737622522 X-GMAIL-MSGID: 1771297138737622522 |
Series |
Add SPI module for StarFive JH7110 SoC
|
|
Commit Message
William Qiu
July 13, 2023, 9 a.m. UTC
The SPI controller only need apb_pclk clock to work properly on JH7110 SoC,
so there add minItems whose value is equal to 1. Other platforms do not
have this constraint.
Signed-off-by: William Qiu <william.qiu@starfivetech.com>
---
Documentation/devicetree/bindings/spi/spi-pl022.yaml | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
Comments
On 13/07/2023 11:00, William Qiu wrote: > The SPI controller only need apb_pclk clock to work properly on JH7110 SoC, > so there add minItems whose value is equal to 1. Other platforms do not > have this constraint. > > Signed-off-by: William Qiu <william.qiu@starfivetech.com> > --- Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof
On Thu, Jul 13, 2023 at 05:00:14PM +0800, William Qiu wrote: > The SPI controller only need apb_pclk clock to work properly on JH7110 SoC, > so there add minItems whose value is equal to 1. Other platforms do not > have this constraint. Presumably this means that this is some variant of the usual pl022 IP, or that the clock is in fact present but is not modelled in your DT?
On 13/07/2023 14:28, Mark Brown wrote: > On Thu, Jul 13, 2023 at 05:00:14PM +0800, William Qiu wrote: > >> The SPI controller only need apb_pclk clock to work properly on JH7110 SoC, >> so there add minItems whose value is equal to 1. Other platforms do not >> have this constraint. > > Presumably this means that this is some variant of the usual pl022 IP, Hm, in such case this could mean we need dedicated compatible. > or that the clock is in fact present but is not modelled in your DT? Best regards, Krzysztof
On Thu, Jul 13, 2023 at 02:39:19PM +0200, Krzysztof Kozlowski wrote: > On 13/07/2023 14:28, Mark Brown wrote: > > On Thu, Jul 13, 2023 at 05:00:14PM +0800, William Qiu wrote: > >> The SPI controller only need apb_pclk clock to work properly on JH7110 SoC, > >> so there add minItems whose value is equal to 1. Other platforms do not > >> have this constraint. > > Presumably this means that this is some variant of the usual pl022 IP, > Hm, in such case this could mean we need dedicated compatible. Yes, indeed.
On Thu, Jul 13, 2023 at 02:39:19PM +0200, Krzysztof Kozlowski wrote: > On 13/07/2023 14:28, Mark Brown wrote: > > On Thu, Jul 13, 2023 at 05:00:14PM +0800, William Qiu wrote: > > > >> The SPI controller only need apb_pclk clock to work properly on JH7110 SoC, > >> so there add minItems whose value is equal to 1. Other platforms do not > >> have this constraint. > > > > Presumably this means that this is some variant of the usual pl022 IP, > > Hm, in such case this could mean we need dedicated compatible. Except the vendor in the ID registers should be different if the IP is modified. I suspect that PCLK and SSPCLK are tied to the same clock source. There must be an SSPCLK because that is the one used to clock the SPI bus and we need to know the frequency of it. Rob
On 2023/7/13 22:57, Rob Herring wrote: > On Thu, Jul 13, 2023 at 02:39:19PM +0200, Krzysztof Kozlowski wrote: >> On 13/07/2023 14:28, Mark Brown wrote: >> > On Thu, Jul 13, 2023 at 05:00:14PM +0800, William Qiu wrote: >> > >> >> The SPI controller only need apb_pclk clock to work properly on JH7110 SoC, >> >> so there add minItems whose value is equal to 1. Other platforms do not >> >> have this constraint. >> > >> > Presumably this means that this is some variant of the usual pl022 IP, >> >> Hm, in such case this could mean we need dedicated compatible. > > Except the vendor in the ID registers should be different if the IP is > modified. > > I suspect that PCLK and SSPCLK are tied to the same clock source. There > must be an SSPCLK because that is the one used to clock the SPI bus and > we need to know the frequency of it. > > Rob After communicating with colleagues in SoC FE, I learned that PCLK and SSPCLK were homologous on JH7110. He said that SSPCLK would divide the frequency internally anyway, and there was no need for external part frequency, so he directly gave them together. So, should I call this clock ssp_apb or keep it SSPCLK? Best regards, William
On Fri, Jul 14, 2023 at 03:14:59PM +0800, William Qiu wrote: > On 2023/7/13 22:57, Rob Herring wrote: > > I suspect that PCLK and SSPCLK are tied to the same clock source. There > > must be an SSPCLK because that is the one used to clock the SPI bus and > > we need to know the frequency of it. > After communicating with colleagues in SoC FE, I learned that PCLK and > SSPCLK were homologous on JH7110. He said that SSPCLK would divide the > frequency internally anyway, and there was no need for external part frequency, > so he directly gave them together. > So, should I call this clock ssp_apb or keep it SSPCLK? I'd expect this to be handled in the DTS for the SoC - connect both clocks the binding requires to whatever the upstream clock is, it's not clear to me that any binding change is required.
On 2023/7/14 19:52, Mark Brown wrote: > On Fri, Jul 14, 2023 at 03:14:59PM +0800, William Qiu wrote: >> On 2023/7/13 22:57, Rob Herring wrote: > >> > I suspect that PCLK and SSPCLK are tied to the same clock source. There >> > must be an SSPCLK because that is the one used to clock the SPI bus and >> > we need to know the frequency of it. > >> After communicating with colleagues in SoC FE, I learned that PCLK and >> SSPCLK were homologous on JH7110. He said that SSPCLK would divide the >> frequency internally anyway, and there was no need for external part frequency, >> so he directly gave them together. > >> So, should I call this clock ssp_apb or keep it SSPCLK? > > I'd expect this to be handled in the DTS for the SoC - connect both > clocks the binding requires to whatever the upstream clock is, it's not > clear to me that any binding change is required. You mean binding two clocks, with the same clock source? Then there is no need to modify YAML. Best regards, William
On Tue, Jul 18, 2023 at 02:06:01PM +0800, William Qiu wrote: > On 2023/7/14 19:52, Mark Brown wrote: > > On Fri, Jul 14, 2023 at 03:14:59PM +0800, William Qiu wrote: > >> After communicating with colleagues in SoC FE, I learned that PCLK and > >> SSPCLK were homologous on JH7110. He said that SSPCLK would divide the > >> frequency internally anyway, and there was no need for external part frequency, > >> so he directly gave them together. > >> So, should I call this clock ssp_apb or keep it SSPCLK? > > I'd expect this to be handled in the DTS for the SoC - connect both > > clocks the binding requires to whatever the upstream clock is, it's not > > clear to me that any binding change is required. > You mean binding two clocks, with the same clock source? Then there is no > need to modify YAML. Yes, exactly.
diff --git a/Documentation/devicetree/bindings/spi/spi-pl022.yaml b/Documentation/devicetree/bindings/spi/spi-pl022.yaml index 5e5a704a766e..42bb34c39971 100644 --- a/Documentation/devicetree/bindings/spi/spi-pl022.yaml +++ b/Documentation/devicetree/bindings/spi/spi-pl022.yaml @@ -35,12 +35,16 @@ properties: maxItems: 1 clocks: + minItems: 1 maxItems: 2 clock-names: - items: - - const: sspclk - - const: apb_pclk + oneOf: + - items: + - const: apb_pclk + - items: + - const: sspclk + - const: apb_pclk pl022,autosuspend-delay: description: delay in ms following transfer completion before the