]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0076-beaglebone-improve-GPMC-bus-timings-for-camera-cape.patch
linux-ti33x-psp 3.2: add fixed for cssp, fbset and OPP50
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / beaglebone / 0076-beaglebone-improve-GPMC-bus-timings-for-camera-cape.patch
1 From e81c7627c3d90209271a0f1e7486d0f779f05289 Mon Sep 17 00:00:00 2001
2 From: Dan Aizenstros <daizenstros@quicklogic.com>
3 Date: Thu, 12 Jul 2012 12:31:08 -0400
4 Subject: [PATCH 76/79] beaglebone: improve GPMC bus timings for camera cape
6 Signed-off-by: Dan Aizenstros <daizenstros@quicklogic.com>
7 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
8 ---
9  arch/arm/mach-omap2/board-am335xevm.c         |   13 +++++++------
10  drivers/media/video/cssp_camera/cssp_camera.c |    5 +----
11  drivers/media/video/cssp_camera/cssp_camera.h |    2 +-
12  3 files changed, 9 insertions(+), 11 deletions(-)
14 diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
15 index 6b4539e..82020fc 100644
16 --- a/arch/arm/mach-omap2/board-am335xevm.c
17 +++ b/arch/arm/mach-omap2/board-am335xevm.c
18 @@ -1895,9 +1895,10 @@ static struct gpmc_timings cssp_timings = {
19         /* Minimum clock period for synchronous mode (in picoseconds) */
20         .sync_clk = 10000,
21  
22 +       /* CS signal timings corresponding to GPMC_CONFIG2 */
23         .cs_on = 0,
24 -       .cs_rd_off = 23 * 10,           /* Read deassertion time */
25 -       .cs_wr_off = 23 * 10,           /* Write deassertion time */
26 +       .cs_rd_off = 8 * 10,            /* Read deassertion time */
27 +       .cs_wr_off = 20 * 10,           /* Write deassertion time */
28  
29         /* ADV signal timings corresponding to GPMC_CONFIG3 */
30         .adv_on = 0,                    /* Assertion time */
31 @@ -1906,17 +1907,17 @@ static struct gpmc_timings cssp_timings = {
32  
33         /* WE signals timings corresponding to GPMC_CONFIG4 */
34         .we_on = 3 * 10,                /* WE assertion time */
35 -       .we_off = 23 * 10,              /* WE deassertion time */
36 +       .we_off = 8 * 10,               /* WE deassertion time */
37  
38         /* OE signals timings corresponding to GPMC_CONFIG4 */
39         .oe_on = 3 * 10,                /* OE assertion time */
40 -       .oe_off = 23 * 10,              /* OE deassertion time */
41 +       .oe_off = 8 * 10,               /* OE deassertion time */
42  
43         /* Access time and cycle time timings corresponding to GPMC_CONFIG5 */
44         .page_burst_access = 1 * 10,    /* Multiple access word delay */
45         .access = 7 * 10,               /* Start-cycle to first data valid delay */
46 -       .rd_cycle = 23 * 10,            /* Total read cycle time */
47 -       .wr_cycle = 23 * 10,            /* Total write cycle time */
48 +       .rd_cycle = 8 * 10,             /* Total read cycle time */
49 +       .wr_cycle = 20 * 10,            /* Total write cycle time */
50  
51         /* The following are only on OMAP3430 */
52         .wr_access = 7 * 10,            /* WRACCESSTIME */
53 diff --git a/drivers/media/video/cssp_camera/cssp_camera.c b/drivers/media/video/cssp_camera/cssp_camera.c
54 index 39aa003..34a36d7 100644
55 --- a/drivers/media/video/cssp_camera/cssp_camera.c
56 +++ b/drivers/media/video/cssp_camera/cssp_camera.c
57 @@ -147,7 +147,6 @@ static int trigger_dma_transfer_to_buf(struct cssp_cam_dev *dev, struct vb2_buff
58         // Enable data capture
59         dev->mode |= ENABLE;
60         writew(dev->mode, dev->reg_base_virt + REG_MODE);
61 -       readw(dev->reg_base_virt + REG_MODE);
62  
63         dev->current_vb = vb;
64  
65 @@ -182,7 +181,6 @@ static void dma_callback(unsigned lch, u16 ch_status, void *data)
66         // Disable data capture
67         dev->mode &= ~ENABLE;
68         writew(dev->mode, dev->reg_base_virt + REG_MODE);
69 -       readw(dev->reg_base_virt + REG_MODE);
70  
71         if (ch_status == DMA_COMPLETE) {
72                 struct vb2_buffer *vb = dev->current_vb;
73 @@ -223,7 +221,7 @@ static int configure_edma(struct cssp_cam_dev *cam)
74                 return -1;
75         }
76  
77 -       cam->dma_ch = edma_alloc_channel(dma_channel, dma_callback, cam, EVENTQ_1);
78 +       cam->dma_ch = edma_alloc_channel(dma_channel, dma_callback, cam, EVENTQ_0);
79         if (cam->dma_ch < 0) {
80                 printk(KERN_ERR "[%s]: allocating channel for DMA failed\n", pdev->name);
81                 return -EBUSY;
82 @@ -526,7 +524,6 @@ static int stop_streaming(struct vb2_queue *vq)
83         // Disable data capture
84         dev->mode &= ~ENABLE;
85         writew(dev->mode, dev->reg_base_virt + REG_MODE);
86 -       readw(dev->reg_base_virt + REG_MODE);
87  
88         stop_camera_sensor(dev);
89  
90 diff --git a/drivers/media/video/cssp_camera/cssp_camera.h b/drivers/media/video/cssp_camera/cssp_camera.h
91 index d018ca1..8eb5f83 100644
92 --- a/drivers/media/video/cssp_camera/cssp_camera.h
93 +++ b/drivers/media/video/cssp_camera/cssp_camera.h
94 @@ -28,7 +28,7 @@ static unsigned debug;
95  module_param(debug, uint, 0644);
96  MODULE_PARM_DESC(debug, "activates debug info");
97  
98 -static unsigned int vid_limit = 1;
99 +static unsigned int vid_limit = 6;
100  module_param(vid_limit, uint, 0644);
101  MODULE_PARM_DESC(vid_limit, "capture memory limit in megabytes");
102  
103 -- 
104 1.7.10