mbox series

[0/3] Add dw_mmc support for rk3576

Message ID 20240802153609.296197-1-detlev.casanova@collabora.com
Headers show
Series Add dw_mmc support for rk3576 | expand

Message

Detlev Casanova Aug. 2, 2024, 3:31 p.m. UTC
The SD card controller on the rk3576 SoC uses a new tuning version that is
capable of using pre-boot tuning information.

Also, it stores the phase settings into the dw_mmc controller, so the code
has to be adapted to implement that.

Detlev Casanova (1):
  dt-bindings: pinctrl: Add rk3576 dw-mshc bindings

Shawn Lin (2):
  mmc: dw_mmc-rockchip: Add v2 tuning support
  mmc: dw_mmc-rockchip: Add internal phase support

 .../bindings/mmc/rockchip-dw-mshc.yaml        |  11 +
 drivers/mmc/host/dw_mmc-rockchip.c            | 224 +++++++++++++++++-
 2 files changed, 226 insertions(+), 9 deletions(-)

Comments

Detlev Casanova Aug. 2, 2024, 3:39 p.m. UTC | #1
> [PATCH 1/3] dt-bindings: pinctrl: Add rk3576 dw-mshc bindings

s/pinctrl/mmc

On Friday, 2 August 2024 11:31:27 EDT Detlev Casanova wrote:
> Add the compatible string for rockchip,rk3576-dw-mshc and add support
> for the rockchip,use-v2-tuning flag, a new feature of this core.
> 
> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
> ---
>  .../devicetree/bindings/mmc/rockchip-dw-mshc.yaml     | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml
> b/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml index
> 211cd0b0bc5f3..dd8d1e773bb38 100644
> --- a/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml
> +++ b/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml
> @@ -39,6 +39,7 @@ properties:
>                - rockchip,rk3368-dw-mshc
>                - rockchip,rk3399-dw-mshc
>                - rockchip,rk3568-dw-mshc
> +              - rockchip,rk3576-dw-mshc
>                - rockchip,rk3588-dw-mshc
>                - rockchip,rv1108-dw-mshc
>                - rockchip,rv1126-dw-mshc
> @@ -95,6 +96,16 @@ properties:
>        If not specified, the host will do tuning for 360 times,
>        namely tuning for each degree.
> 
> +  rockchip,use-v2-tuning:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description:
> +      If present, use tuning version 2.
> +      v2 tuning will inherit pre-stage loader's phase settings for the
> first +      time, and do re-tune if necessary.
> +      Re-tune will still try the rough degrees, for instance, 90, 180, 270,
> +      360 but continue to do the fine tuning if sample window isn't good +
>      enough.
> +
>  required:
>    - compatible
>    - reg
Krzysztof Kozlowski Aug. 4, 2024, 9:55 a.m. UTC | #2
On 02/08/2024 17:31, Detlev Casanova wrote:
> Add the compatible string for rockchip,rk3576-dw-mshc and add support
> for the rockchip,use-v2-tuning flag, a new feature of this core.
> 
> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>

A nit, subject: drop second/last, redundant "bindings". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

> ---
>  .../devicetree/bindings/mmc/rockchip-dw-mshc.yaml     | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml b/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml
> index 211cd0b0bc5f3..dd8d1e773bb38 100644
> --- a/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml
> +++ b/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml
> @@ -39,6 +39,7 @@ properties:
>                - rockchip,rk3368-dw-mshc
>                - rockchip,rk3399-dw-mshc
>                - rockchip,rk3568-dw-mshc
> +              - rockchip,rk3576-dw-mshc
>                - rockchip,rk3588-dw-mshc
>                - rockchip,rv1108-dw-mshc
>                - rockchip,rv1126-dw-mshc
> @@ -95,6 +96,16 @@ properties:
>        If not specified, the host will do tuning for 360 times,
>        namely tuning for each degree.
>  
> +  rockchip,use-v2-tuning:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description:
> +      If present, use tuning version 2.
> +      v2 tuning will inherit pre-stage loader's phase settings for the first
> +      time, and do re-tune if necessary.
> +      Re-tune will still try the rough degrees, for instance, 90, 180, 270,
> +      360 but continue to do the fine tuning if sample window isn't good
> +      enough.

You described the desired Linux feature or behavior, not the actual
hardware. The bindings are about the latter, so instead you need to
rephrase the property and its description to match actual hardware
capabilities/features/configuration etc.

Best regards,
Krzysztof