Message ID | 20230106200809.330769-4-william.zhang@broadcom.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1010770wrt; Fri, 6 Jan 2023 12:24:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXtcCO8qEUUreRRzZYIJQfAPUgd6YqlWluj6zy745gKu0Yu+UmOxGcvcC0tGASTvz41yVJrx X-Received: by 2002:a17:906:f854:b0:849:7688:3e3e with SMTP id ks20-20020a170906f85400b0084976883e3emr38468609ejb.44.1673036644349; Fri, 06 Jan 2023 12:24:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673036644; cv=none; d=google.com; s=arc-20160816; b=wB+00ilQ1sJ+AusLaRKEuQJuoypa15mHC5u9L79Dzhi/ZipyI/nP8MkiBqj/p3Ya9q E8wuquDrJ0XL6RrBzNDjzKk1P5sz5mlrx1R7H7dW6w48MhA3BkIapeXEHT7xr2WGNFfa mRjxahrgAyLtCSYnFxeSbXw1Fm1bj5Ah7ZsoRJEbZIu7gzxZAYlnJyARU3LtL986YAB1 6boyC9TkCqub05ohk81v7G8wp9POT/CfbOO3TqX0mWWWf0TbD5Z6QMkSYVRiPYj++Vpe CUhWKRx2qTFrczqcLmHW1x4wi2pKAKVW9/aE7FZvKB3vA3i7TxV+xFygOVtqNRv1OfU7 pvmg== 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 :dkim-signature:dkim-filter; bh=YqkBXqAp9252hafC4MtWUNFxwc6/MZaBDqZ+9PQ5Xz4=; b=rf7vIpVGuftyVAmyOalon7Bef4ixxXorENgLZv7gwuZc0bQNkxBIFXQ/fBYHr1RBGX +uha7YJ4wPX44M75r0dJu5XLm0arCajegZAV69MY4DIJrbPQJ+DIugBiGxfuGEwdOTb3 XYCEHPdqvwNL8LjwcjX4pkLFHq3DBiLULfSfCJPmwwONWth6gV9iSizyBiuZf4eoxxQV qaop/Y92eoKs8+eFv7Lpj5TXkfou68ThHGsmQKVNejZb9OCqps52Wi/z7svjbzEF6Sn2 mkPPWjXfhS5tpebi5l3M9k33/Vh9j3hk4NctmkCTO1C1tBlL4bXgj8Zn61xKW56VFvK3 PovQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=iQXhfdoe; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wy11-20020a170906fe0b00b0084d2e5c063asi382875ejb.481.2023.01.06.12.23.38; Fri, 06 Jan 2023 12:24:04 -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; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=iQXhfdoe; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235605AbjAFUTv (ORCPT <rfc822;ahmedalshaiji.dev@gmail.com> + 99 others); Fri, 6 Jan 2023 15:19:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236111AbjAFUS7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 6 Jan 2023 15:18:59 -0500 Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.144.205]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB3AB3C700; Fri, 6 Jan 2023 12:18:26 -0800 (PST) Received: from mail-lvn-it-01.lvn.broadcom.net (mail-lvn-it-01.lvn.broadcom.net [10.75.146.107]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id AB68DC0003C8; Fri, 6 Jan 2023 12:09:30 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com AB68DC0003C8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1673035770; bh=z13ASkxUuc4fajnr4hl+GEimGjj6wHKe2iHsFsjdvoU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iQXhfdoeh6FAHyJia1sRh/e8Gz5cVwMKFPtQy282HYXI70iHn9AkT1F3c/dIymVzi +XgOKmH1psWI3PZRJ0DGkSh2dEieVrcEyYEYhXiY0W6l+d8Rn501rWqkr1SyN6PK5b 8npFKA5EYhA87JjmE9xJg3H36qBQj9ArV58g5E0c= Received: from bcacpedev-irv-3.lvn.broadcom.net (bcacpedev-irv-3.lvn.broadcom.net [10.75.138.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-lvn-it-01.lvn.broadcom.net (Postfix) with ESMTPS id 73E4C18041CAC6; Fri, 6 Jan 2023 12:09:30 -0800 (PST) Received: by bcacpedev-irv-3.lvn.broadcom.net (Postfix, from userid 28376) id BB1E2101B33; Fri, 6 Jan 2023 12:09:20 -0800 (PST) From: William Zhang <william.zhang@broadcom.com> To: Linux SPI List <linux-spi@vger.kernel.org>, Broadcom Kernel List <bcm-kernel-feedback-list@broadcom.com> Cc: anand.gore@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, joel.peshkin@broadcom.com, f.fainelli@gmail.com, jonas.gorski@gmail.com, kursad.oney@broadcom.com, dregan@mail.com, William Zhang <william.zhang@broadcom.com>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/16] dt-bindings: spi: Add spi peripheral specific property Date: Fri, 6 Jan 2023 12:07:55 -0800 Message-Id: <20230106200809.330769-4-william.zhang@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230106200809.330769-1-william.zhang@broadcom.com> References: <20230106200809.330769-1-william.zhang@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE 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?1754306071987684495?= X-GMAIL-MSGID: =?utf-8?q?1754306071987684495?= |
Series |
spi: bcm63xx-hsspi: driver and doc updates
|
|
Commit Message
William Zhang
Jan. 6, 2023, 8:07 p.m. UTC
brcm,no-clk-gate is a Broadcom Broadband HS SPI controller specific
property for certain SPI device such as Broadcom ISI voice daughtercard
to work properly. It disables the clock gating feature when the chip
select is deasserted for any device that wants to keep the clock
running.
Signed-off-by: William Zhang <william.zhang@broadcom.com>
---
.../brcm,bcm63xx-hsspi-peripheral-props.yaml | 27 +++++++++++++++++++
.../bindings/spi/spi-peripheral-props.yaml | 1 +
2 files changed, 28 insertions(+)
create mode 100644 Documentation/devicetree/bindings/spi/brcm,bcm63xx-hsspi-peripheral-props.yaml
Comments
On Fri, Jan 06, 2023 at 12:07:55PM -0800, William Zhang wrote: > brcm,no-clk-gate is a Broadcom Broadband HS SPI controller specific > property for certain SPI device such as Broadcom ISI voice daughtercard > to work properly. It disables the clock gating feature when the chip > select is deasserted for any device that wants to keep the clock > running. Why would this property be Broadcom specific? Other devices could in theory implement this. > +properties: > + brcm,no-clk-gate: > + $ref: /schemas/types.yaml#/definitions/flag > + description: > + Some SPI device such as Broadcom ISI based voice daughtercard requires SPI > + clock running even when chip select is deasserted. By default the > + controller turns off or gate the clock when cs is not active to save > + power. This flag tells the controller driver to keep the clock running > + when chip select is not active. This seems problematic with any host controlled chip select support...
Hi Mark, On 01/06/2023 01:14 PM, Mark Brown wrote: > On Fri, Jan 06, 2023 at 12:07:55PM -0800, William Zhang wrote: > >> brcm,no-clk-gate is a Broadcom Broadband HS SPI controller specific >> property for certain SPI device such as Broadcom ISI voice daughtercard >> to work properly. It disables the clock gating feature when the chip >> select is deasserted for any device that wants to keep the clock >> running. > > Why would this property be Broadcom specific? Other devices could in > theory implement this. > It does not need to be Broadcom specific if other SoC's SPI bus controller support such function. I am not aware of such case but certainly I am no expert on other chips. I can put it in the generic spi-peripheral-props.yaml if that is what you suggest. >> +properties: >> + brcm,no-clk-gate: >> + $ref: /schemas/types.yaml#/definitions/flag >> + description: >> + Some SPI device such as Broadcom ISI based voice daughtercard requires SPI >> + clock running even when chip select is deasserted. By default the >> + controller turns off or gate the clock when cs is not active to save >> + power. This flag tells the controller driver to keep the clock running >> + when chip select is not active. > > This seems problematic with any host controlled chip select support... > Yes those ISI chip based voice cards do need such strange requirement and will not work with other controller. That is one of the reason I put this as Broadcom specific option.
On Fri, Jan 6, 2023 at 9:27 PM William Zhang <william.zhang@broadcom.com> wrote: > > Hi Mark, > > On 01/06/2023 01:14 PM, Mark Brown wrote: > > On Fri, Jan 06, 2023 at 12:07:55PM -0800, William Zhang wrote: > > > >> brcm,no-clk-gate is a Broadcom Broadband HS SPI controller specific > >> property for certain SPI device such as Broadcom ISI voice daughtercard > >> to work properly. It disables the clock gating feature when the chip > >> select is deasserted for any device that wants to keep the clock > >> running. > > > > Why would this property be Broadcom specific? Other devices could in > > theory implement this. > > > It does not need to be Broadcom specific if other SoC's SPI bus > controller support such function. I am not aware of such case but > certainly I am no expert on other chips. I can put it in the generic > spi-peripheral-props.yaml if that is what you suggest. > > >> +properties: > >> + brcm,no-clk-gate: > >> + $ref: /schemas/types.yaml#/definitions/flag > >> + description: > >> + Some SPI device such as Broadcom ISI based voice daughtercard requires SPI > >> + clock running even when chip select is deasserted. By default the > >> + controller turns off or gate the clock when cs is not active to save > >> + power. This flag tells the controller driver to keep the clock running > >> + when chip select is not active. > > > > This seems problematic with any host controlled chip select support... > > > Yes those ISI chip based voice cards do need such strange requirement > and will not work with other controller. That is one of the reason I > put this as Broadcom specific option. Keeping the clock on or not would affect all devices unless you have a per device clock you can gate, so making this a per device flag doesn't make sense. If this is a requirement of the slave device, then the device's compatible string can imply the need for this and its driver can tell the host controller in some way. Rob
On 06/01/2023 21:07, William Zhang wrote: > brcm,no-clk-gate is a Broadcom Broadband HS SPI controller specific > property for certain SPI device such as Broadcom ISI voice daughtercard > to work properly. It disables the clock gating feature when the chip > select is deasserted for any device that wants to keep the clock > running. > +additionalProperties: true > diff --git a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml > index ead2cccf658f..f85d777c7b67 100644 > --- a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml > +++ b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml > @@ -108,5 +108,6 @@ allOf: > - $ref: cdns,qspi-nor-peripheral-props.yaml# > - $ref: samsung,spi-peripheral-props.yaml# > - $ref: nvidia,tegra210-quad-peripheral-props.yaml# > + - $ref: brcm,bcm63xx-hsspi-peripheral-props.yaml# Don't break the order. Best regards, Krzysztof
Hi Rob, On 01/07/2023 07:38 AM, Rob Herring wrote: > On Fri, Jan 6, 2023 at 9:27 PM William Zhang <william.zhang@broadcom.com> wrote: >> >> Hi Mark, >> >> On 01/06/2023 01:14 PM, Mark Brown wrote: >>> On Fri, Jan 06, 2023 at 12:07:55PM -0800, William Zhang wrote: >>> >>>> brcm,no-clk-gate is a Broadcom Broadband HS SPI controller specific >>>> property for certain SPI device such as Broadcom ISI voice daughtercard >>>> to work properly. It disables the clock gating feature when the chip >>>> select is deasserted for any device that wants to keep the clock >>>> running. >>> >>> Why would this property be Broadcom specific? Other devices could in >>> theory implement this. >>> >> It does not need to be Broadcom specific if other SoC's SPI bus >> controller support such function. I am not aware of such case but >> certainly I am no expert on other chips. I can put it in the generic >> spi-peripheral-props.yaml if that is what you suggest. >> >>>> +properties: >>>> + brcm,no-clk-gate: >>>> + $ref: /schemas/types.yaml#/definitions/flag >>>> + description: >>>> + Some SPI device such as Broadcom ISI based voice daughtercard requires SPI >>>> + clock running even when chip select is deasserted. By default the >>>> + controller turns off or gate the clock when cs is not active to save >>>> + power. This flag tells the controller driver to keep the clock running >>>> + when chip select is not active. >>> >>> This seems problematic with any host controlled chip select support... >>> >> Yes those ISI chip based voice cards do need such strange requirement >> and will not work with other controller. That is one of the reason I >> put this as Broadcom specific option. > > Keeping the clock on or not would affect all devices unless you have a > per device clock you can gate, so making this a per device flag > doesn't make sense. > This applies only to each chip select. There is only one device under each chip select. So won't impact any other devices under other cs. > If this is a requirement of the slave device, then the device's > compatible string can imply the need for this and its driver can tell > the host controller in some way. That is true but spi host controller driver reads and parses these slave device flag directly. > > Rob >
On 01/08/2023 06:52 AM, Krzysztof Kozlowski wrote: > On 06/01/2023 21:07, William Zhang wrote: >> brcm,no-clk-gate is a Broadcom Broadband HS SPI controller specific >> property for certain SPI device such as Broadcom ISI voice daughtercard >> to work properly. It disables the clock gating feature when the chip >> select is deasserted for any device that wants to keep the clock >> running. > > >> +additionalProperties: true >> diff --git a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml >> index ead2cccf658f..f85d777c7b67 100644 >> --- a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml >> +++ b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml >> @@ -108,5 +108,6 @@ allOf: >> - $ref: cdns,qspi-nor-peripheral-props.yaml# >> - $ref: samsung,spi-peripheral-props.yaml# >> - $ref: nvidia,tegra210-quad-peripheral-props.yaml# >> + - $ref: brcm,bcm63xx-hsspi-peripheral-props.yaml# > > Don't break the order. > Will fix in v2 > Best regards, > Krzysztof >
On Mon, Jan 09, 2023 at 12:06:13AM -0800, William Zhang wrote: > > On Fri, Jan 6, 2023 at 9:27 PM William Zhang <william.zhang@broadcom.com> wrote: > > Keeping the clock on or not would affect all devices unless you have a > > per device clock you can gate, so making this a per device flag > > doesn't make sense. > This applies only to each chip select. There is only one device under each > chip select. So won't impact any other devices under other cs. I don't understand how this would work - usually a SPI controller has a single set of clock, MOSI and MISO lines with the only per device thing being the chip select. If the clock line is used by all devices then it must be kept on for all of them if it's to be kept on for one of them.
Hi Mark, On 01/09/2023 11:19 AM, Mark Brown wrote: > On Mon, Jan 09, 2023 at 12:06:13AM -0800, William Zhang wrote: >>> On Fri, Jan 6, 2023 at 9:27 PM William Zhang <william.zhang@broadcom.com> wrote: > >>> Keeping the clock on or not would affect all devices unless you have a >>> per device clock you can gate, so making this a per device flag >>> doesn't make sense. > >> This applies only to each chip select. There is only one device under each >> chip select. So won't impact any other devices under other cs. > > I don't understand how this would work - usually a SPI controller has a > single set of clock, MOSI and MISO lines with the only per device thing > being the chip select. If the clock line is used by all devices then it > must be kept on for all of them if it's to be kept on for one of them. > This setting is set per spi message for particular chip select of the device when starting the message through bcm63xx_hsspi_set_clk function and restore to default(clock gating) when message is done through bcm63xx_hsspi_restore_clk_gate.
On Mon, Jan 09, 2023 at 12:18:09PM -0800, William Zhang wrote: > This setting is set per spi message for particular chip select of the device > when starting the message through bcm63xx_hsspi_set_clk function and restore > to default(clock gating) when message is done through > bcm63xx_hsspi_restore_clk_gate. In that case I am extremely confused about what the feature is supposed to do. The description says: + brcm,no-clk-gate: + $ref: /schemas/types.yaml#/definitions/flag + description: + Some SPI device such as Broadcom ISI based voice daughtercard requires +SPI + clock running even when chip select is deasserted. By default the + controller turns off or gate the clock when cs is not active to save + power. This flag tells the controller driver to keep the clock running + when chip select is not active. which to me sounds like the clock should never be turned off and instead left running at all times. Switching back to clock gating after sending the message doesn't seem to correspond to the above at all, the message being done would normally also be the point at which chip select is deasserted.
On 01/10/2023 02:01 PM, Mark Brown wrote: > On Mon, Jan 09, 2023 at 12:18:09PM -0800, William Zhang wrote: > >> This setting is set per spi message for particular chip select of the device >> when starting the message through bcm63xx_hsspi_set_clk function and restore >> to default(clock gating) when message is done through >> bcm63xx_hsspi_restore_clk_gate. > > In that case I am extremely confused about what the feature is supposed > to do. The description says: > > + brcm,no-clk-gate: > + $ref: /schemas/types.yaml#/definitions/flag > + description: > + Some SPI device such as Broadcom ISI based voice daughtercard requires > +SPI > + clock running even when chip select is deasserted. By default the > + controller turns off or gate the clock when cs is not active to save > + power. This flag tells the controller driver to keep the clock running > + when chip select is not active. > > > which to me sounds like the clock should never be turned off and instead > left running at all times. Switching back to clock gating after sending > the message doesn't seem to correspond to the above at all, the message > being done would normally also be the point at which chip select is > deasserted. > This feature is used by our voice team and as far I can tell, it is used to keep clock running between the transfers within the same message. But now that we have prepend mode to combine to one transfer or dummy workaround to keep cs always active between transfers, this indeed does not seems right. I will have to talk to the voice team why this is still needed and get back here.
diff --git a/Documentation/devicetree/bindings/spi/brcm,bcm63xx-hsspi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/brcm,bcm63xx-hsspi-peripheral-props.yaml new file mode 100644 index 000000000000..81884e2cc42d --- /dev/null +++ b/Documentation/devicetree/bindings/spi/brcm,bcm63xx-hsspi-peripheral-props.yaml @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/brcm,bcm63xx-hsspi-peripheral-props.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Peripheral-specific properties for Broadcom Broadband SoC HSSPI controller + +description: + See spi-peripheral-props.yaml for more info. + +maintainers: + - William Zhang <william.zhang@broadcom.com> + - Kursad Oney <kursad.oney@broadcom.com> + - Jonas Gorski <jonas.gorski@gmail.com> + +properties: + brcm,no-clk-gate: + $ref: /schemas/types.yaml#/definitions/flag + description: + Some SPI device such as Broadcom ISI based voice daughtercard requires SPI + clock running even when chip select is deasserted. By default the + controller turns off or gate the clock when cs is not active to save + power. This flag tells the controller driver to keep the clock running + when chip select is not active. + +additionalProperties: true diff --git a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml index ead2cccf658f..f85d777c7b67 100644 --- a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml +++ b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml @@ -108,5 +108,6 @@ allOf: - $ref: cdns,qspi-nor-peripheral-props.yaml# - $ref: samsung,spi-peripheral-props.yaml# - $ref: nvidia,tegra210-quad-peripheral-props.yaml# + - $ref: brcm,bcm63xx-hsspi-peripheral-props.yaml# additionalProperties: true