The FCPV has a selectable number of outstanding read transactions. According to the documentation the value must be set based on the type of the VSP the FCPV is connected to. Set the register accordingly at probe time. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx> --- drivers/media/platform/rcar-fcp.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/media/platform/rcar-fcp.c b/drivers/media/platform/rcar-fcp.c index ddbc960f8458..e93e9c4227d9 100644 --- a/drivers/media/platform/rcar-fcp.c +++ b/drivers/media/platform/rcar-fcp.c @@ -67,6 +67,7 @@ enum rcar_fcp_type { RCAR_FCPF, RCAR_FCPV, + RCAR_FCPVI, }; struct rcar_fcp_device { @@ -89,6 +90,12 @@ static u32 rcar_fcp_read(struct rcar_fcp_device *fcp, unsigned int reg) return ioread32(fcp->mmio + reg); } +static void rcar_fcp_write(struct rcar_fcp_device *fcp, unsigned int reg, + u32 value) +{ + iowrite32(value, fcp->mmio + reg); +} + /* ----------------------------------------------------------------------------- * Public API */ @@ -194,6 +201,7 @@ static int rcar_fcp_setup(struct rcar_fcp_device *fcp) static const char * const models[] = { [RCAR_FCPF] = "FCPF", [RCAR_FCPV] = "FCPV", + [RCAR_FCPVI] = "FCPVI", }; static struct { u32 version; @@ -228,12 +236,29 @@ static int rcar_fcp_setup(struct rcar_fcp_device *fcp) dev_dbg(fcp->dev, "%s %s device found\n", models[fcp->type], versions[i].name); + /* Set the processing mode (needed for FCPV only). */ + switch (fcp->type) { + case RCAR_FCPV: + /* 64 outstanding read transactions */ + rcar_fcp_write(fcp, FCP_CFG0, 0); + break; + + case RCAR_FCPVI: + /* 16 outstanding read transactions */ + rcar_fcp_write(fcp, FCP_CFG0, FCP_CFG0_FCPVSEL); + break; + + default: + break; + } + return 0; } static const struct of_device_id rcar_fcp_of_match[] = { { .compatible = "renesas,fcpf", .data = (void *)RCAR_FCPF }, { .compatible = "renesas,fcpv", .data = (void *)RCAR_FCPV }, + { .compatible = "renesas,fcpvi", .data = (void *)RCAR_FCPVI }, { }, }; MODULE_DEVICE_TABLE(of, rcar_fcp_of_match); -- Regards, Laurent Pinchart