Re: [PATCH v3 10/15] media: vsp1: Fix access to reserved registers
From: Laurent Pinchart
Date: Fri Oct 30 2026 - 17:36:37 EST
On Thu, Oct 15, 2026 at 04:51:50PM +0900, Paul Elder wrote:
> From: Phong Hoang <phong.hoang.wz@xxxxxxxxxxx>
>
> Some modules of VSP are not available in all instances,
> so fix access to reserved registers.
>
> Signed-off-by: Phong Hoang <phong.hoang.wz@xxxxxxxxxxx>
> Reviewed-by: Paul Elder <paul.elder+renesas@xxxxxxxxxxxxxxxx>
> Signed-off-by: Paul Elder <paul.elder+renesas@xxxxxxxxxxxxxxxx>
> ---
> drivers/media/platform/renesas/vsp1/vsp1_drv.c | 34 ++++++++++++++++++--------
> 1 file changed, 24 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> index 6ec8c234ea29939e4aebdf56fc51ae1cc5c69156..819c5eda9171d8ef7c8fc88adc959019b6bed497 100644
> --- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> +++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> @@ -560,20 +560,34 @@ static int vsp1_device_init(struct vsp1_device *vsp1)
> for (unsigned int i = 0; i < vsp1->info->uif_count; ++i)
> vsp1_write(vsp1, VI6_DPR_UIF_ROUTE(i), VI6_DPR_NODE_UNUSED);
>
> - vsp1_write(vsp1, VI6_DPR_SRU_ROUTE, VI6_DPR_NODE_UNUSED);
> - vsp1_write(vsp1, VI6_DPR_LUT_ROUTE, VI6_DPR_NODE_UNUSED);
> - vsp1_write(vsp1, VI6_DPR_CLU_ROUTE, VI6_DPR_NODE_UNUSED);
> - vsp1_write(vsp1, VI6_DPR_HST_ROUTE, VI6_DPR_NODE_UNUSED);
> - vsp1_write(vsp1, VI6_DPR_HSI_ROUTE, VI6_DPR_NODE_UNUSED);
> - vsp1_write(vsp1, VI6_DPR_BRU_ROUTE, VI6_DPR_NODE_UNUSED);
> + if (vsp1_feature(vsp1, VSP1_HAS_SRU))
> + vsp1_write(vsp1, VI6_DPR_SRU_ROUTE, VI6_DPR_NODE_UNUSED);
> +
> + if (vsp1_feature(vsp1, VSP1_HAS_LUT))
> + vsp1_write(vsp1, VI6_DPR_LUT_ROUTE, VI6_DPR_NODE_UNUSED);
> +
> + if (vsp1_feature(vsp1, VSP1_HAS_CLU))
> + vsp1_write(vsp1, VI6_DPR_CLU_ROUTE, VI6_DPR_NODE_UNUSED);
> +
> + if (vsp1_feature(vsp1, VSP1_HAS_HSIT))
> + vsp1_write(vsp1, VI6_DPR_HST_ROUTE, VI6_DPR_NODE_UNUSED);
> +
> + if (vsp1_feature(vsp1, VSP1_HAS_HSIT))
> + vsp1_write(vsp1, VI6_DPR_HSI_ROUTE, VI6_DPR_NODE_UNUSED);
> +
> + if (vsp1_feature(vsp1, VSP1_HAS_BRU))
> + vsp1_write(vsp1, VI6_DPR_BRU_ROUTE, VI6_DPR_NODE_UNUSED);
>
> if (vsp1_feature(vsp1, VSP1_HAS_BRS))
> vsp1_write(vsp1, VI6_DPR_ILV_BRS_ROUTE, VI6_DPR_NODE_UNUSED);
>
> - vsp1_write(vsp1, VI6_DPR_HGO_SMPPT, (7 << VI6_DPR_SMPPT_TGW_SHIFT) |
> - (VI6_DPR_NODE_UNUSED << VI6_DPR_SMPPT_PT_SHIFT));
> - vsp1_write(vsp1, VI6_DPR_HGT_SMPPT, (7 << VI6_DPR_SMPPT_TGW_SHIFT) |
> - (VI6_DPR_NODE_UNUSED << VI6_DPR_SMPPT_PT_SHIFT));
> + if (vsp1_feature(vsp1, VSP1_HAS_HGO))
> + vsp1_write(vsp1, VI6_DPR_HGO_SMPPT, (7 << VI6_DPR_SMPPT_TGW_SHIFT) |
> + (VI6_DPR_NODE_UNUSED << VI6_DPR_SMPPT_PT_SHIFT));
> +
> + if (vsp1_feature(vsp1, VSP1_HAS_HGT))
> + vsp1_write(vsp1, VI6_DPR_HGT_SMPPT, (7 << VI6_DPR_SMPPT_TGW_SHIFT) |
> + (VI6_DPR_NODE_UNUSED << VI6_DPR_SMPPT_PT_SHIFT));
I'm fairly sure the hardware would work fine without those checks, but I
understand there's a desire to pass certifications. As this isn't in a
hot patch,
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>
>
> vsp1_dlm_setup(vsp1);
>
--
Regards,
Laurent Pinchart