summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0076-beaglebone-improve-GPMC-bus-timings-for-camera-cape.patch
blob: 5997367f76e7c2cebadf1d0e832ae59fb2a5f318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
From e81c7627c3d90209271a0f1e7486d0f779f05289 Mon Sep 17 00:00:00 2001
From: Dan Aizenstros <daizenstros@quicklogic.com>
Date: Thu, 12 Jul 2012 12:31:08 -0400
Subject: [PATCH 76/79] beaglebone: improve GPMC bus timings for camera cape

Signed-off-by: Dan Aizenstros <daizenstros@quicklogic.com>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 arch/arm/mach-omap2/board-am335xevm.c         |   13 +++++++------
 drivers/media/video/cssp_camera/cssp_camera.c |    5 +----
 drivers/media/video/cssp_camera/cssp_camera.h |    2 +-
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
index 6b4539e..82020fc 100644
--- a/arch/arm/mach-omap2/board-am335xevm.c
+++ b/arch/arm/mach-omap2/board-am335xevm.c
@@ -1895,9 +1895,10 @@ static struct gpmc_timings cssp_timings = {
 	/* Minimum clock period for synchronous mode (in picoseconds) */
 	.sync_clk = 10000,
 
+	/* CS signal timings corresponding to GPMC_CONFIG2 */
 	.cs_on = 0,
-	.cs_rd_off = 23 * 10,		/* Read deassertion time */
-	.cs_wr_off = 23 * 10,		/* Write deassertion time */
+	.cs_rd_off = 8 * 10,		/* Read deassertion time */
+	.cs_wr_off = 20 * 10,		/* Write deassertion time */
 
 	/* ADV signal timings corresponding to GPMC_CONFIG3 */
 	.adv_on = 0,			/* Assertion time */
@@ -1906,17 +1907,17 @@ static struct gpmc_timings cssp_timings = {
 
 	/* WE signals timings corresponding to GPMC_CONFIG4 */
 	.we_on = 3 * 10,		/* WE assertion time */
-	.we_off = 23 * 10,		/* WE deassertion time */
+	.we_off = 8 * 10,		/* WE deassertion time */
 
 	/* OE signals timings corresponding to GPMC_CONFIG4 */
 	.oe_on = 3 * 10,		/* OE assertion time */
-	.oe_off = 23 * 10,		/* OE deassertion time */
+	.oe_off = 8 * 10,		/* OE deassertion time */
 
 	/* Access time and cycle time timings corresponding to GPMC_CONFIG5 */
 	.page_burst_access = 1 * 10,	/* Multiple access word delay */
 	.access = 7 * 10,		/* Start-cycle to first data valid delay */
-	.rd_cycle = 23 * 10,		/* Total read cycle time */
-	.wr_cycle = 23 * 10,		/* Total write cycle time */
+	.rd_cycle = 8 * 10,		/* Total read cycle time */
+	.wr_cycle = 20 * 10,		/* Total write cycle time */
 
 	/* The following are only on OMAP3430 */
 	.wr_access = 7 * 10,		/* WRACCESSTIME */
diff --git a/drivers/media/video/cssp_camera/cssp_camera.c b/drivers/media/video/cssp_camera/cssp_camera.c
index 39aa003..34a36d7 100644
--- a/drivers/media/video/cssp_camera/cssp_camera.c
+++ b/drivers/media/video/cssp_camera/cssp_camera.c
@@ -147,7 +147,6 @@ static int trigger_dma_transfer_to_buf(struct cssp_cam_dev *dev, struct vb2_buff
 	// Enable data capture
 	dev->mode |= ENABLE;
 	writew(dev->mode, dev->reg_base_virt + REG_MODE);
-	readw(dev->reg_base_virt + REG_MODE);
 
 	dev->current_vb = vb;
 
@@ -182,7 +181,6 @@ static void dma_callback(unsigned lch, u16 ch_status, void *data)
 	// Disable data capture
 	dev->mode &= ~ENABLE;
 	writew(dev->mode, dev->reg_base_virt + REG_MODE);
-	readw(dev->reg_base_virt + REG_MODE);
 
 	if (ch_status == DMA_COMPLETE) {
 		struct vb2_buffer *vb = dev->current_vb;
@@ -223,7 +221,7 @@ static int configure_edma(struct cssp_cam_dev *cam)
 		return -1;
 	}
 
-	cam->dma_ch = edma_alloc_channel(dma_channel, dma_callback, cam, EVENTQ_1);
+	cam->dma_ch = edma_alloc_channel(dma_channel, dma_callback, cam, EVENTQ_0);
 	if (cam->dma_ch < 0) {
 		printk(KERN_ERR "[%s]: allocating channel for DMA failed\n", pdev->name);
 		return -EBUSY;
@@ -526,7 +524,6 @@ static int stop_streaming(struct vb2_queue *vq)
 	// Disable data capture
 	dev->mode &= ~ENABLE;
 	writew(dev->mode, dev->reg_base_virt + REG_MODE);
-	readw(dev->reg_base_virt + REG_MODE);
 
 	stop_camera_sensor(dev);
 
diff --git a/drivers/media/video/cssp_camera/cssp_camera.h b/drivers/media/video/cssp_camera/cssp_camera.h
index d018ca1..8eb5f83 100644
--- a/drivers/media/video/cssp_camera/cssp_camera.h
+++ b/drivers/media/video/cssp_camera/cssp_camera.h
@@ -28,7 +28,7 @@ static unsigned debug;
 module_param(debug, uint, 0644);
 MODULE_PARM_DESC(debug, "activates debug info");
 
-static unsigned int vid_limit = 1;
+static unsigned int vid_limit = 6;
 module_param(vid_limit, uint, 0644);
 MODULE_PARM_DESC(vid_limit, "capture memory limit in megabytes");
 
-- 
1.7.10