aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/devices-tnetv107x.c
diff options
context:
space:
mode:
authorSekhar Nori <nsekhar@ti.com>2010-06-29 02:05:12 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2010-08-05 12:58:24 -0400
commitbc3ac9f31642fb4697b313c2eb575c5286f35c2a (patch)
treeabeeaa649da9d69713bf876575b5ba95befb1731 /arch/arm/mach-davinci/devices-tnetv107x.c
parentf027512db7410ed149422262b07d2c78f0a36282 (diff)
davinci: edma: provide ability to detect insufficient CC info data
This patch modifies the EDMA driver to expect the channel controller (CC) infomation passed on by the platform as a fixed size (EDMA_MAX_CC) array of pointers to structures. Doing so helps catch errors of the sort where the resource structure has information for more channel controllers than the number channel controller info structures defined. Such insufficient platform data would lead to illegal memory accesses. Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/devices-tnetv107x.c')
-rw-r--r--arch/arm/mach-davinci/devices-tnetv107x.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c
index 4eef6ccdc73e..2718a3a90dff 100644
--- a/arch/arm/mach-davinci/devices-tnetv107x.c
+++ b/arch/arm/mach-davinci/devices-tnetv107x.c
@@ -69,16 +69,18 @@ static const s8 edma_priority_mapping[][2] = {
69 { -1, -1 } 69 { -1, -1 }
70}; 70};
71 71
72static struct edma_soc_info edma_info[] = { 72static struct edma_soc_info edma_cc0_info = {
73 { 73 .n_channel = EDMA_TNETV107X_NUM_DMACH,
74 .n_channel = EDMA_TNETV107X_NUM_DMACH, 74 .n_region = EDMA_TNETV107X_NUM_REGIONS,
75 .n_region = EDMA_TNETV107X_NUM_REGIONS, 75 .n_slot = EDMA_TNETV107X_NUM_PARAMENTRY,
76 .n_slot = EDMA_TNETV107X_NUM_PARAMENTRY, 76 .n_tc = EDMA_TNETV107X_NUM_TC,
77 .n_tc = EDMA_TNETV107X_NUM_TC, 77 .n_cc = 1,
78 .n_cc = 1, 78 .queue_tc_mapping = edma_tc_mapping,
79 .queue_tc_mapping = edma_tc_mapping, 79 .queue_priority_mapping = edma_priority_mapping,
80 .queue_priority_mapping = edma_priority_mapping, 80};
81 }, 81
82static struct edma_soc_info *tnetv107x_edma_info[EDMA_MAX_CC] = {
83 &edma_cc0_info,
82}; 84};
83 85
84static struct resource edma_resources[] = { 86static struct resource edma_resources[] = {
@@ -117,7 +119,7 @@ static struct platform_device edma_device = {
117 .id = -1, 119 .id = -1,
118 .num_resources = ARRAY_SIZE(edma_resources), 120 .num_resources = ARRAY_SIZE(edma_resources),
119 .resource = edma_resources, 121 .resource = edma_resources,
120 .dev.platform_data = edma_info, 122 .dev.platform_data = tnetv107x_edma_info,
121}; 123};
122 124
123static struct plat_serial8250_port serial_data[] = { 125static struct plat_serial8250_port serial_data[] = {