media: rockchip: vicap fixes error proc info of reg debug for rk3576

Change-Id: I6604f4218e9e4954e852f94d4334fb1d319b9b8f
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
This commit is contained in:
Zefa Chen
2025-03-11 17:07:40 +08:00
parent d689024559
commit 5bb7b93ed4
3 changed files with 26 additions and 8 deletions

View File

@@ -13962,22 +13962,22 @@ void rkcif_err_print_work(struct work_struct *work)
if (err_state & RKCIF_ERR_SIZE) {
if (dev->chip_id >= CHIP_RK3588_CIF)
v4l2_err(&dev->v4l2_dev,
"ERROR: csi size err, intstat:0x%x, size:0x%x,0x%x,0x%x,0x%x, cnt %llu\n",
"ERROR: size err, intstat:0x%x, size:0x%x,0x%x,0x%x,0x%x, cnt %llu\n",
intstat, err_state_work->size_id0, err_state_work->size_id1,
err_state_work->size_id2, err_state_work->size_id3,
dev->irq_stats.csi_size_err_cnt);
else
v4l2_err(&dev->v4l2_dev,
"ERROR: csi size err, intstat:0x%x, lastline:0x%x, cnt %llu\n",
"ERROR: size err, intstat:0x%x, lastline:0x%x, cnt %llu\n",
intstat, lastline, dev->irq_stats.csi_size_err_cnt);
}
if (err_state & RKCIF_ERR_OVERFLOW)
v4l2_err(&dev->v4l2_dev,
"ERROR: csi fifo overflow, intstat:0x%x, lastline:0x%x, cnt %llu\n",
"ERROR: fifo overflow, intstat:0x%x, lastline:0x%x, cnt %llu\n",
intstat, lastline, dev->irq_stats.csi_overflow_cnt);
if (err_state & RKCIF_ERR_BANDWIDTH_LACK)
v4l2_err(&dev->v4l2_dev,
"ERROR: csi bandwidth lack, intstat:0x%x, lastline:0x%x, cnt %llu\n",
"ERROR: bandwidth lack, intstat:0x%x, lastline:0x%x, cnt %llu\n",
intstat, lastline, dev->irq_stats.csi_bwidth_lack_cnt);
if (err_state & RKCIF_ERR_ID0_MULTI_FS)
v4l2_err(&dev->v4l2_dev,

View File

@@ -1062,6 +1062,10 @@ static const struct cif_reg rk3576_cif_regs[] = {
[CIF_REG_MIPI_SET_SIZE_ID1] = CIF_REG(CSI_MIPI0_SET_FRAME_SIZE_ID1_RK3576),
[CIF_REG_MIPI_SET_SIZE_ID2] = CIF_REG(CSI_MIPI0_SET_FRAME_SIZE_ID2_RK3576),
[CIF_REG_MIPI_SET_SIZE_ID3] = CIF_REG(CSI_MIPI0_SET_FRAME_SIZE_ID3_RK3576),
[CIF_REG_MIPI_FRAME_SIZE_ID0] = CIF_REG(CSI_MIPI0_FRAME_SIZE_ID0),
[CIF_REG_MIPI_FRAME_SIZE_ID1] = CIF_REG(CSI_MIPI0_FRAME_SIZE_ID1),
[CIF_REG_MIPI_FRAME_SIZE_ID2] = CIF_REG(CSI_MIPI0_FRAME_SIZE_ID2),
[CIF_REG_MIPI_FRAME_SIZE_ID3] = CIF_REG(CSI_MIPI0_FRAME_SIZE_ID3),
[CIF_REG_GLB_CTRL] = CIF_REG(GLB_CTRL),
[CIF_REG_GLB_INTEN] = CIF_REG(GLB_INTEN),
@@ -1147,6 +1151,10 @@ static const struct cif_reg rv1103b_cif_regs[] = {
[CIF_REG_MIPI_SET_SIZE_ID1] = CIF_REG(CSI_MIPI0_SET_FRAME_SIZE_ID1_RK3576),
[CIF_REG_MIPI_SET_SIZE_ID2] = CIF_REG(CSI_MIPI0_SET_FRAME_SIZE_ID2_RK3576),
[CIF_REG_MIPI_SET_SIZE_ID3] = CIF_REG(CSI_MIPI0_SET_FRAME_SIZE_ID3_RK3576),
[CIF_REG_MIPI_FRAME_SIZE_ID0] = CIF_REG(CSI_MIPI0_FRAME_SIZE_ID0),
[CIF_REG_MIPI_FRAME_SIZE_ID1] = CIF_REG(CSI_MIPI0_FRAME_SIZE_ID1),
[CIF_REG_MIPI_FRAME_SIZE_ID2] = CIF_REG(CSI_MIPI0_FRAME_SIZE_ID2),
[CIF_REG_MIPI_FRAME_SIZE_ID3] = CIF_REG(CSI_MIPI0_FRAME_SIZE_ID3),
[CIF_REG_GLB_CTRL] = CIF_REG(GLB_CTRL),
[CIF_REG_GLB_INTEN] = CIF_REG(GLB_INTEN),

View File

@@ -390,14 +390,14 @@ static void rkcif_show_reg_csi2(struct rkcif_device *dev, struct seq_file *f)
struct csi2_hw *csi2_hw = NULL;
int i, j;
int csi_idx = 0;
u32 buf[20];
u32 buf[24];
for (j = 0; j < csi2->csi_info.csi_num; j++) {
csi_idx = csi2->csi_info.csi_idx[j];
csi2_hw = csi2->csi2_hw[csi_idx];
seq_printf(f, "\nmipi%d csi2 reg:\n", csi_idx);
memcpy_fromio(buf, csi2_hw->base, 0x50);
for (i = 0; i < 0x50 / 16; i++)
memcpy_fromio(buf, csi2_hw->base, 0x60);
for (i = 0; i < 0x60 / 16; i++)
seq_printf(f, "0x%x: 0x%08x 0x%08x 0x%08x 0x%08x\n",
(u32)(csi2_hw->res->start + i * 16),
*(buf + i * 4), *(buf + i * 4 + 1),
@@ -491,6 +491,16 @@ static void rkcif_show_reg_dphys(struct rkcif_device *dev, struct seq_file *f)
if (dphy_hw)
rkcif_show_reg_dphy(dphy_hw, (csi_idx - 2) / 2, f);
}
} else if (dphy->drv_data->chip_id == CHIP_ID_RK3576) {
if (csi_idx < 1) {
dcphy_hw = dphy->samsung_phy_group[csi_idx];
if (dcphy_hw)
rkcif_show_reg_dcphy(dcphy_hw, csi_idx, f);
} else {
dphy_hw = dphy->dphy_hw_group[(csi_idx - 1) / 2];
if (dphy_hw)
rkcif_show_reg_dphy(dphy_hw, (csi_idx - 1) / 2, f);
}
} else {
dphy_hw = dphy->dphy_hw_group[csi_idx / 2];
if (dphy_hw)
@@ -507,7 +517,7 @@ static void rkcif_show_reg_dbg(struct rkcif_device *dev, struct seq_file *f)
if (dev->inf_id == RKCIF_MIPI_LVDS) {
if (dev->active_sensor->mbus.type == V4L2_MBUS_CSI2_DPHY ||
dev->active_sensor->mbus.type == V4L2_MBUS_CSI2_CPHY) {
for (i = 0; i < 5; i++) {
for (i = 0; i < 10; i++) {
rkcif_show_reg_csi2(dev, f);
usleep_range(2000, 4000);
}