lkml.org 
[lkml]   [2022]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] memory: renesas-rpc-if: Fix HF/OSPI data transfer in Manual mode
Hi Geert,

thank you for the patch!

> Lightly (read-only) tested on:
> - Salvator-XS with R-Car M3-W ES1.0 with HyperFLASH,
> - Falcon with R-Car V3U ES1.0 with QSPI.

I (also lightly) tested writing on the V3U and it seems to still work,
even with the problematic cases we needed to fix earlier.

> Note: Alternatively, rpcif_manual_xfer() could bypass regmap and
> use {read,write}[bwl]() directly, cfr. commit 0d37f69cacb33435
> ("memory: renesas-rpc-if: Correct QSPI data transfer in Manual
> mode") in the BSP.

As discuseed via IRC, I don't like bypassing regmap. I prefer your
solution here.

> @@ -171,18 +171,32 @@ static int rpcif_reg_read(void *context, unsigned int reg, unsigned int *val)

Before this function is a comment which needs to be updated (away from
SMENR_SPIDE to xfer_size).

> + switch (rpc->xfer_size) {
> + case 1:
> *val = readb(rpc->base + reg);
> return 0;
> - } else if (spide == 0xC) {
> +
> + case 2:
> *val = readw(rpc->base + reg);
> return 0;
> - } else if (spide != 0xF) {
> +
> + case 4:
> + case 8:

I think it is more readable to add here:

*val = readl(rpc->base + reg);
return 0;

> + break;

... and remove this break ...


> +
> + default:
> return -EILSEQ;
> }
> + break;

... and this one. Same for the write function. I am not strict on this
one, but I think this make following the logic easier.

Rest looks good. I like the additional checks!

All the best,

Wolfram

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-03-18 11:15    [W:0.066 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site