]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: rockchip: vop: Add dsp offset support
authorJagan Teki <jagan@edgeble.ai>
Wed, 17 Jan 2024 07:51:45 +0000 (13:21 +0530)
committerAnatolij Gustschin <agust@denx.de>
Sun, 21 Apr 2024 07:07:00 +0000 (09:07 +0200)
Unlike RK3399, RK3288 the Newer Rockchip SoC's like RK3328 have
different offsets for dsp registers.

Group the dsp register set via dsp_regs pointers so that dsp_offset
would point the dsp_regs to access for any changes in the offset value.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
drivers/video/rockchip/rk_vop.c
drivers/video/rockchip/rk_vop.h

index b719a4e4eaf368aae712faafaee742833f35ef66..acc02e5d7c7813122a06bdf091e8f9d930f8a453 100644 (file)
@@ -165,6 +165,7 @@ static void rkvop_mode_set(struct udevice *dev,
 {
        struct rk_vop_priv *priv = dev_get_priv(dev);
        struct rk3288_vop *regs = priv->regs;
+       struct rk3288_vop *dsp_regs = priv->regs + priv->dsp_offset;
        struct rkvop_driverdata *data =
                (struct rkvop_driverdata *)dev_get_driver_data(dev);
 
@@ -198,27 +199,27 @@ static void rkvop_mode_set(struct udevice *dev,
 
        writel(V_HSYNC(hsync_len) |
               V_HORPRD(hsync_len + hback_porch + hactive + hfront_porch),
-                       &regs->dsp_htotal_hs_end);
+                       &dsp_regs->dsp_htotal_hs_end);
 
        writel(V_HEAP(hsync_len + hback_porch + hactive) |
               V_HASP(hsync_len + hback_porch),
-              &regs->dsp_hact_st_end);
+              &dsp_regs->dsp_hact_st_end);
 
        writel(V_VSYNC(vsync_len) |
               V_VERPRD(vsync_len + vback_porch + vactive + vfront_porch),
-              &regs->dsp_vtotal_vs_end);
+              &dsp_regs->dsp_vtotal_vs_end);
 
        writel(V_VAEP(vsync_len + vback_porch + vactive)|
               V_VASP(vsync_len + vback_porch),
-              &regs->dsp_vact_st_end);
+              &dsp_regs->dsp_vact_st_end);
 
        writel(V_HEAP(hsync_len + hback_porch + hactive) |
               V_HASP(hsync_len + hback_porch),
-              &regs->post_dsp_hact_info);
+              &dsp_regs->post_dsp_hact_info);
 
        writel(V_VAEP(vsync_len + vback_porch + vactive)|
               V_VASP(vsync_len + vback_porch),
-              &regs->post_dsp_vact_info);
+              &dsp_regs->post_dsp_vact_info);
 
        writel(0x01, &regs->reg_cfg_done); /* enable reg config */
 }
@@ -452,6 +453,7 @@ int rk_vop_probe(struct udevice *dev)
 
        priv->regs = dev_read_addr_ptr(dev);
        priv->win_offset = ops->win_offset;
+       priv->dsp_offset = ops->dsp_offset;
 
        /*
         * Try all the ports until we find one that works. In practice this
index 909f5602e533c9a4ba66c1195f481e3a395e6aa6..eba68d87c4b2edc5492e0b9b537fc43ed742c3b1 100644 (file)
@@ -12,6 +12,7 @@ struct rk_vop_priv {
        void *grf;
        void *regs;
        int win_offset;
+       int dsp_offset;
 };
 
 enum vop_features {
@@ -20,6 +21,7 @@ enum vop_features {
 
 struct rkvop_driverdata {
        int win_offset;
+       int dsp_offset;
        /* configuration */
        u32 features;
        /* block-specific setters/getters */