Message ID | 453e34f0eda526f79b0297952937dc0a0b5aacf8.1682435583.git.geert+renesas@glider.be (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | media: renesas: fdp1: Identify R-Car Gen2 versions | expand |
On Tue, Apr 25, 2023 at 05:15:02PM +0200, Geert Uytterhoeven wrote: > On R-Car M2-W: > > rcar_fdp1 fe940000.fdp1: FDP1 Unidentifiable (0x02010101) > rcar_fdp1 fe944000.fdp1: FDP1 Unidentifiable (0x02010101) > > Although the IP Internal Data Register on R-Car Gen2 is documented to > contain all zeros, the actual register contents seem to match the FDP1 > version ID of R-Car H3 ES1.*, which has just been removed. > Fortunately this version is not used for any other purposes yet. > > Fix this by re-adding the ID, now using an R-Car Gen2-specific name. > > Fixes: af4273b43f2bd9ee ("media: renesas: fdp1: remove R-Car H3 ES1.* handling") > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> > /* Internal Data (HW Version) */ > #define FD1_IP_INTDATA 0x0800 > +#define FD1_IP_GEN2 0x02010101 Maybe add a comment here saying that this is needed despite the information in the datasheets?
Hi Geert, Thank you for the patch. On Tue, Apr 25, 2023 at 05:15:02PM +0200, Geert Uytterhoeven wrote: > On R-Car M2-W: > > rcar_fdp1 fe940000.fdp1: FDP1 Unidentifiable (0x02010101) > rcar_fdp1 fe944000.fdp1: FDP1 Unidentifiable (0x02010101) > > Although the IP Internal Data Register on R-Car Gen2 is documented to > contain all zeros, the actual register contents seem to match the FDP1 > version ID of R-Car H3 ES1.*, which has just been removed. > Fortunately this version is not used for any other purposes yet. > > Fix this by re-adding the ID, now using an R-Car Gen2-specific name. > > Fixes: af4273b43f2bd9ee ("media: renesas: fdp1: remove R-Car H3 ES1.* handling") > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > --- > Version register contents verified on R-Car H2 ES1.0, R-Car M2-W ES1.0 & > ES3.0, and R-Car E2 ES1.0. I couldn't get hold of an R-Car M2-N. > --- > drivers/media/platform/renesas/rcar_fdp1.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/media/platform/renesas/rcar_fdp1.c b/drivers/media/platform/renesas/rcar_fdp1.c > index 99af68fddc9249f5..b0a694f9245cc2c6 100644 > --- a/drivers/media/platform/renesas/rcar_fdp1.c > +++ b/drivers/media/platform/renesas/rcar_fdp1.c > @@ -254,6 +254,7 @@ MODULE_PARM_DESC(debug, "activate debug info"); > > /* Internal Data (HW Version) */ > #define FD1_IP_INTDATA 0x0800 > +#define FD1_IP_GEN2 0x02010101 A comment as requested by Wolfram would be nice. I'd mention here that the same ID is used by H3 ES1.x. With that, Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > #define FD1_IP_M3W 0x02010202 > #define FD1_IP_H3 0x02010203 > #define FD1_IP_M3N 0x02010204 > @@ -2360,6 +2361,9 @@ static int fdp1_probe(struct platform_device *pdev) > > hw_version = fdp1_read(fdp1, FD1_IP_INTDATA); > switch (hw_version) { > + case FD1_IP_GEN2: > + dprintk(fdp1, "FDP1 Version R-Car Gen2\n"); > + break; > case FD1_IP_M3W: > dprintk(fdp1, "FDP1 Version R-Car M3-W\n"); > break;
diff --git a/drivers/media/platform/renesas/rcar_fdp1.c b/drivers/media/platform/renesas/rcar_fdp1.c index 99af68fddc9249f5..b0a694f9245cc2c6 100644 --- a/drivers/media/platform/renesas/rcar_fdp1.c +++ b/drivers/media/platform/renesas/rcar_fdp1.c @@ -254,6 +254,7 @@ MODULE_PARM_DESC(debug, "activate debug info"); /* Internal Data (HW Version) */ #define FD1_IP_INTDATA 0x0800 +#define FD1_IP_GEN2 0x02010101 #define FD1_IP_M3W 0x02010202 #define FD1_IP_H3 0x02010203 #define FD1_IP_M3N 0x02010204 @@ -2360,6 +2361,9 @@ static int fdp1_probe(struct platform_device *pdev) hw_version = fdp1_read(fdp1, FD1_IP_INTDATA); switch (hw_version) { + case FD1_IP_GEN2: + dprintk(fdp1, "FDP1 Version R-Car Gen2\n"); + break; case FD1_IP_M3W: dprintk(fdp1, "FDP1 Version R-Car M3-W\n"); break;
On R-Car M2-W: rcar_fdp1 fe940000.fdp1: FDP1 Unidentifiable (0x02010101) rcar_fdp1 fe944000.fdp1: FDP1 Unidentifiable (0x02010101) Although the IP Internal Data Register on R-Car Gen2 is documented to contain all zeros, the actual register contents seem to match the FDP1 version ID of R-Car H3 ES1.*, which has just been removed. Fortunately this version is not used for any other purposes yet. Fix this by re-adding the ID, now using an R-Car Gen2-specific name. Fixes: af4273b43f2bd9ee ("media: renesas: fdp1: remove R-Car H3 ES1.* handling") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> --- Version register contents verified on R-Car H2 ES1.0, R-Car M2-W ES1.0 & ES3.0, and R-Car E2 ES1.0. I couldn't get hold of an R-Car M2-N. --- drivers/media/platform/renesas/rcar_fdp1.c | 4 ++++ 1 file changed, 4 insertions(+)