mbox series

[v3,0/7] scsi: ufs: renesas: Add support for R-Car S4-8 ES1.2

Message ID cover.1741179611.git.geert+renesas@glider.be
Headers show
Series scsi: ufs: renesas: Add support for R-Car S4-8 ES1.2 | expand

Message

Geert Uytterhoeven March 5, 2025, 1:34 p.m. UTC
Hi all,

Initialization of the UFS controller on R-Car S4-8 ES1.0 requires only
static values.  However, other UFS controller variants (R-Car S4-8 ES 1.2)
require dynamic values, like those obtained from E-FUSE, and downloading
firmware.

Hence this patch series refactors the initialization code to prepare for
this, and adds support for the UFS controller on R-Car S4-8 ES1.2.
The accompanying DTS change is available at [1].

Changes compared to v2[2]:
  - Take over from Shimoda-san,
  - New patches 1/7 (DT bindings update) and 7/7 (actual R-Car S4-8
    ES1.2 support),
  - Keep MAX_INDEX check, as it is still useful,
  - Prefix data parameters of ufs_renesas_write_d0_d4() by "data_", for
    consistency,
  - Document kernel size impact of switching to init code,
  - Rename ufs_renesas_init_ufshc() to ufs_renesas_init_step1_to_3(),
  - Extract ufs_renesas_init_step4_to_6(),
  - Move ufs_renesas_write_phy_10ad_10af() just before its sole user,

Changes compared to v1[3]:
  - Postpone removing the *_INDEX* enums until all users are gone,
  - Combine declaration and initialization of ufs_renesas_init_param,
  - Drop "_param" from ufs_renesas_*() helper function names.
  - Move MODE_READ handling after MODE_POLL handling,
  - Move ufs_renesas_read() after ufs_renesas_poll(),
  - Remove not just MODE_WAIT, but all of the struct-based control.

This has been tested on:
  - Renesas Spider with R-Car S4-8 ES1.0 (broken before/after),
  - Renesas S4 Starter Kit with R-Car S4-8 ES1.2 (works after).

Thanks for your comments!

[1] "[PATCH] arm64: dts: renesas: r8a779f4: Add UFS tuning parameters in
     E-FUSE"
    https://lore.kernel.org/3e4fca228eb049d54a1ae520104558505dbdf803.1741179629.git.geert+renesas@glider.be
[2] "[PATCH v2 0/5] scsi: ufs: renesas: Refactor code for other UFS
     controller"
    https://lore.kernel.org/20240709023550.1750333-1-yoshihiro.shimoda.uh@renesas.com
[3] "[PATCH 0/5] scsi: ufs: renesas: Refactor code for other UFS
     controller"
    https://lore.kernel.org/20240708120931.1703956-1-yoshihiro.shimoda.uh@renesas.com

Geert Uytterhoeven (1):
  dt-bindings: ufs: renesas,ufs: Add calibration data

Yoshihiro Shimoda (6):
  scsi: ufs: renesas: Replace init data by init code
  scsi: ufs: renesas: Add register read to remove save/set/restore
  scsi: ufs: renesas: Remove register control helper function
  scsi: ufs: renesas: Refactor 0x10ad/0x10af PHY settings
  scsi: ufs: renesas: Add reusable functions
  scsi: ufs: renesas: Add initialization code for R-Car S4-8 ES1.2

 .../devicetree/bindings/ufs/renesas,ufs.yaml  |  12 +
 drivers/ufs/host/ufs-renesas.c                | 723 +++++++++++-------
 2 files changed, 445 insertions(+), 290 deletions(-)

Comments

Conor Dooley March 5, 2025, 4:25 p.m. UTC | #1
On Wed, Mar 05, 2025 at 02:34:09PM +0100, Geert Uytterhoeven wrote:
> On R-Car S4-8 ES1.2, the E-FUSE block contains PLL and AFE tuning
> parameters for the Universal Flash Storage controller.  Document the
> related NVMEM properties, and update the example.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

> ---
> v3:
>   - New.
> ---
>  .../devicetree/bindings/ufs/renesas,ufs.yaml         | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/ufs/renesas,ufs.yaml b/Documentation/devicetree/bindings/ufs/renesas,ufs.yaml
> index 1949a15e73d25849..ac11ac7d1d12f6c9 100644
> --- a/Documentation/devicetree/bindings/ufs/renesas,ufs.yaml
> +++ b/Documentation/devicetree/bindings/ufs/renesas,ufs.yaml
> @@ -33,6 +33,16 @@ properties:
>    resets:
>      maxItems: 1
>  
> +  nvmem-cells:
> +    maxItems: 1
> +
> +  nvmem-cell-names:
> +    items:
> +      - const: calibration
> +
> +dependencies:
> +  nvmem-cells: [ nvmem-cell-names ]
> +
>  required:
>    - compatible
>    - reg
> @@ -58,4 +68,6 @@ examples:
>          freq-table-hz = <200000000 200000000>, <38400000 38400000>;
>          power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
>          resets = <&cpg 1514>;
> +        nvmem-cells = <&ufs_tune>;
> +        nvmem-cell-names = "calibration";
>      };
> -- 
> 2.43.0
>