diff options
author | guoyin.chen <guoyin.chen@freescale.com> | 2013-08-16 10:34:29 +0800 |
---|---|---|
committer | guoyin.chen <guoyin.chen@freescale.com> | 2013-08-16 10:34:29 +0800 |
commit | 08967e3cf25b32dae50ca5455cd862ec86b06586 (patch) | |
tree | 388b22742fd868f1128931b3ec0c80cd782c0351 | |
parent | 7faf590b972d9ca8d65183fb61a87566abfc7a45 (diff) | |
parent | bdde708ebfde4a8c1d3829578d3f6481a343533a (diff) |
Merge remote-tracking branch 'fsl-linux-sdk/imx_3.0.35_4.1.0' into imx_3.0.35_android
-rw-r--r-- | arch/arm/mach-mx6/mm.c | 18 | ||||
-rw-r--r-- | drivers/media/video/mxc/capture/csi_v4l2_capture.c | 10 |
2 files changed, 24 insertions, 4 deletions
diff --git a/arch/arm/mach-mx6/mm.c b/arch/arm/mach-mx6/mm.c index 3cf6b226fca6..8d2c715f336b 100644 --- a/arch/arm/mach-mx6/mm.c +++ b/arch/arm/mach-mx6/mm.c @@ -111,9 +111,21 @@ int mxc_init_l2x0(void) writel(0x132, IO_ADDRESS(L2_BASE_ADDR + L2X0_TAG_LATENCY_CTRL)); writel(0x132, IO_ADDRESS(L2_BASE_ADDR + L2X0_DATA_LATENCY_CTRL)); - val = readl(IO_ADDRESS(L2_BASE_ADDR + L2X0_PREFETCH_CTRL)); - val |= 0x40800000; - writel(val, IO_ADDRESS(L2_BASE_ADDR + L2X0_PREFETCH_CTRL)); + /* + * The L2 cache controller(PL310) version on the i.MX6D/Q is r3p1-50rel0 + * The L2 cache controller(PL310) version on the i.MX6DL/SOLO/SL is r3p2 + * But according to ARM PL310 errata: 752271 + * ID: 752271: Double linefill feature can cause data corruption + * Fault Status: Present in: r3p0, r3p1, r3p1-50rel0. Fixed in r3p2 + * Workaround: The only workaround to this erratum is to disable the + * double linefill feature. This is the default behavior. + */ + if (!cpu_is_mx6q()) { + val = readl(IO_ADDRESS(L2_BASE_ADDR + L2X0_PREFETCH_CTRL)); + val |= 0x40800000; + writel(val, IO_ADDRESS(L2_BASE_ADDR + L2X0_PREFETCH_CTRL)); + } + val = readl(IO_ADDRESS(L2_BASE_ADDR + L2X0_POWER_CTRL)); val |= L2X0_DYNAMIC_CLK_GATING_EN; val |= L2X0_STNDBY_MODE_EN; diff --git a/drivers/media/video/mxc/capture/csi_v4l2_capture.c b/drivers/media/video/mxc/capture/csi_v4l2_capture.c index d1273f1e63f5..5810cffdfc1d 100644 --- a/drivers/media/video/mxc/capture/csi_v4l2_capture.c +++ b/drivers/media/video/mxc/capture/csi_v4l2_capture.c @@ -484,6 +484,7 @@ static void csi_free_frames(cam_data *cam) for (i = 0; i < FRAME_NUM; i++) cam->frame[i].buffer.flags = V4L2_BUF_FLAG_MAPPED; + cam->enc_counter = 0; INIT_LIST_HEAD(&cam->ready_q); INIT_LIST_HEAD(&cam->working_q); INIT_LIST_HEAD(&cam->done_q); @@ -1035,6 +1036,12 @@ static int csi_v4l_dqueue(cam_data *cam, struct v4l2_buffer *buf) spin_lock_irqsave(&cam->dqueue_int_lock, lock_flags); + if (list_empty(&cam->done_q)) { + spin_unlock_irqrestore(&cam->dqueue_int_lock, lock_flags); + up(&cam->busy_lock); + return -EINVAL; + } + cam->enc_counter--; frame = list_entry(cam->done_q.next, struct mxc_v4l_frame, queue); @@ -1075,7 +1082,8 @@ static int csi_v4l_dqueue(cam_data *cam, struct v4l2_buffer *buf) return retval; } pxp_complete_update(cam); - memcpy(cam->frame[buf->index].vaddress, + if (cam->frame[buf->index].vaddress) + memcpy(cam->frame[buf->index].vaddress, cam->frame[req_buf_number].vaddress, cam->v2f.fmt.pix.sizeimage); } |