From patchwork Mon Jul 6 21:14:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 34317 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n66LI0He016643 for ; Mon, 6 Jul 2009 21:18:01 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id n66LGcpX029028; Mon, 6 Jul 2009 16:16:43 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id n66LGZx8022070; Mon, 6 Jul 2009 16:16:36 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 70D648062E; Mon, 6 Jul 2009 16:16:34 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 9017A8062F for ; Mon, 6 Jul 2009 16:15:52 -0500 (CDT) Received: from white.ext.ti.com (localhost [127.0.0.1]) by dflp51.itg.ti.com (8.13.7/8.13.7) with ESMTP id n66LFq01013578 for ; Mon, 6 Jul 2009 16:15:52 -0500 (CDT) Received: from mail179-wa4-R.bigfish.com (mail-wa4.bigfish.com [216.32.181.114]) by white.ext.ti.com (8.13.7/8.13.7) with ESMTP id n66LFkIC022345 for ; Mon, 6 Jul 2009 16:15:51 -0500 Received: from mail179-wa4 (localhost.localdomain [127.0.0.1]) by mail179-wa4-R.bigfish.com (Postfix) with ESMTP id A2FC91E8081 for ; Mon, 6 Jul 2009 21:15:46 +0000 (UTC) X-SpamScore: 0 X-BigFish: vps0(zzzz1202hzzz2dh62h) X-Spam-TCS-SCL: 1:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 209.85.222.185; Service: EHS Received: by mail179-wa4 (MessageSwitch) id 1246914943364329_1737; Mon, 6 Jul 2009 21:15:43 +0000 (UCT) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mail179-wa4.bigfish.com (Postfix) with ESMTP id 47852D80058 for ; Mon, 6 Jul 2009 21:15:43 +0000 (UTC) Received: by pzk15 with SMTP id 15so474410pzk.4 for ; Mon, 06 Jul 2009 14:15:43 -0700 (PDT) Received: by 10.114.12.8 with SMTP id 8mr8105817wal.154.1246914943051; Mon, 06 Jul 2009 14:15:43 -0700 (PDT) Received: from localhost ([216.254.16.51]) by mx.google.com with ESMTPS id f20sm11945054waf.52.2009.07.06.14.15.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 06 Jul 2009 14:15:42 -0700 (PDT) From: Kevin Hilman To: linux-arm-kernel@lists.arm.linux.org.uk Date: Mon, 6 Jul 2009 14:14:38 -0700 Message-Id: <1246914900-9034-5-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1246914900-9034-4-git-send-email-khilman@deeprootsystems.com> References: <1246914900-9034-1-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-2-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-3-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-4-git-send-email-khilman@deeprootsystems.com> Cc: davinci-linux-open-source@linux.davincidsp.com, Naresh Medisetty Subject: [PATCH 04/26] davinci: EDMA: Move queue related mappings to dm.c X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: Sudhakar Rajashekhara EDMA in DM355 and DM644x has two transfer controllers while DM646x has four transfer controllers. Moving the queue to tc mapping and queue priority mapping to dm.c will be helpful to probe these mappings from platform device so that the machine_is_* testing will be avoided. Signed-off-by: Naresh Medisetty Signed-off-by: Sudhakar Rajashekhara Signed-off-by: Kevin Hilman --- arch/arm/mach-davinci/dm355.c | 30 ++++++++++++++++++---- arch/arm/mach-davinci/dm644x.c | 30 ++++++++++++++++++---- arch/arm/mach-davinci/dm646x.c | 38 +++++++++++++++++++++++----- arch/arm/mach-davinci/dma.c | 22 ++++------------- arch/arm/mach-davinci/include/mach/edma.h | 2 + 5 files changed, 86 insertions(+), 36 deletions(-) diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index beda643..9baeed3 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c @@ -558,13 +558,31 @@ static const s8 dma_chan_dm355_no_event[] = { -1 }; +static const s8 +queue_tc_mapping[][2] = { + /* {event queue no, TC no} */ + {0, 0}, + {1, 1}, + {-1, -1}, +}; + +static const s8 +queue_priority_mapping[][2] = { + /* {event queue no, Priority} */ + {0, 3}, + {1, 7}, + {-1, -1}, +}; + static struct edma_soc_info dm355_edma_info = { - .n_channel = 64, - .n_region = 4, - .n_slot = 128, - .n_tc = 2, - .n_cc = 1, - .noevent = dma_chan_dm355_no_event, + .n_channel = 64, + .n_region = 4, + .n_slot = 128, + .n_tc = 2, + .n_cc = 1, + .noevent = dma_chan_dm355_no_event, + .queue_tc_mapping = queue_tc_mapping, + .queue_priority_mapping = queue_priority_mapping, }; static struct resource edma_resources[] = { diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index ddc1d4f..a2f83af 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c @@ -484,13 +484,31 @@ static const s8 dma_chan_dm644x_no_event[] = { -1 }; +static const s8 +queue_tc_mapping[][2] = { + /* {event queue no, TC no} */ + {0, 0}, + {1, 1}, + {-1, -1}, +}; + +static const s8 +queue_priority_mapping[][2] = { + /* {event queue no, Priority} */ + {0, 3}, + {1, 7}, + {-1, -1}, +}; + static struct edma_soc_info dm644x_edma_info = { - .n_channel = 64, - .n_region = 4, - .n_slot = 128, - .n_tc = 2, - .n_cc = 1, - .noevent = dma_chan_dm644x_no_event, + .n_channel = 64, + .n_region = 4, + .n_slot = 128, + .n_tc = 2, + .n_cc = 1, + .noevent = dma_chan_dm644x_no_event, + .queue_tc_mapping = queue_tc_mapping, + .queue_priority_mapping = queue_priority_mapping, }; static struct resource edma_resources[] = { diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 334f071..d32d2b8 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -451,17 +451,41 @@ static const s8 dma_chan_dm646x_no_event[] = { -1 }; +/* Four Transfer Controllers on DM646x */ +static const s8 +dm646x_queue_tc_mapping[][2] = { + /* {event queue no, TC no} */ + {0, 0}, + {1, 1}, + {2, 2}, + {3, 3}, + {-1, -1}, +}; + +static const s8 +dm646x_queue_priority_mapping[][2] = { + /* {event queue no, Priority} */ + {0, 4}, + {1, 0}, + {2, 5}, + {3, 1}, + {-1, -1}, +}; + static struct edma_soc_info dm646x_edma_info = { - .n_channel = 64, - .n_region = 6, /* 0-1, 4-7 */ - .n_slot = 512, - .n_tc = 4, - .noevent = dma_chan_dm646x_no_event, + .n_channel = 64, + .n_region = 6, /* 0-1, 4-7 */ + .n_slot = 512, + .n_tc = 4, + .n_cc = 1, + .noevent = dma_chan_dm646x_no_event, + .queue_tc_mapping = dm646x_queue_tc_mapping, + .queue_priority_mapping = dm646x_queue_priority_mapping, }; static struct resource edma_resources[] = { { - .name = "edma_cc", + .name = "edma_cc0", .start = 0x01c00000, .end = 0x01c00000 + SZ_64K - 1, .flags = IORESOURCE_MEM, @@ -503,7 +527,7 @@ static struct resource edma_resources[] = { static struct platform_device dm646x_edma_device = { .name = "edma", - .id = -1, + .id = 0, .dev.platform_data = &dm646x_edma_info, .num_resources = ARRAY_SIZE(edma_resources), .resource = edma_resources, diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/mach-davinci/dma.c index 0a021ff..50ac74f 100644 --- a/arch/arm/mach-davinci/dma.c +++ b/arch/arm/mach-davinci/dma.c @@ -106,7 +106,6 @@ #define EDMA_MAX_DMACH 64 #define EDMA_MAX_PARAMENTRY 512 -#define EDMA_MAX_EVQUE 2 /* FIXME too small */ #define EDMA_MAX_CC 2 @@ -258,22 +257,6 @@ static const struct edmacc_param dummy_paramset = { .ccnt = 1, }; -static const int __initconst -queue_tc_mapping[EDMA_MAX_EVQUE + 1][2] = { -/* {event queue no, TC no} */ - {0, 0}, - {1, 1}, - {-1, -1} -}; - -static const int __initconst -queue_priority_mapping[EDMA_MAX_EVQUE + 1][2] = { - /* {event queue no, Priority} */ - {0, 3}, - {1, 7}, - {-1, -1} -}; - /*****************************************************************************/ static void map_dmach_queue(unsigned ctlr, unsigned ch_no, @@ -1191,6 +1174,8 @@ EXPORT_SYMBOL(edma_clear_event); static int __init edma_probe(struct platform_device *pdev) { struct edma_soc_info *info = pdev->dev.platform_data; + const s8 (*queue_priority_mapping)[2]; + const s8 (*queue_tc_mapping)[2]; int i; int status; const s8 *noevent; @@ -1289,6 +1274,9 @@ static int __init edma_probe(struct platform_device *pdev) for (i = 0; i < edma_info[pdev->id]->num_channels; i++) map_dmach_queue(pdev->id, i, EVENTQ_1); + queue_tc_mapping = info->queue_tc_mapping; + queue_priority_mapping = info->queue_priority_mapping; + /* Event queue to TC mapping */ for (i = 0; queue_tc_mapping[i][0] != -1; i++) map_queue_tc(pdev->id, queue_tc_mapping[i][0], diff --git a/arch/arm/mach-davinci/include/mach/edma.h b/arch/arm/mach-davinci/include/mach/edma.h index e2f7deb..ba2ebdd 100644 --- a/arch/arm/mach-davinci/include/mach/edma.h +++ b/arch/arm/mach-davinci/include/mach/edma.h @@ -224,6 +224,8 @@ struct edma_soc_info { /* list of channels with no even trigger; terminated by "-1" */ const s8 *noevent; + const s8 (*queue_tc_mapping)[2]; + const s8 (*queue_priority_mapping)[2]; }; #endif