From patchwork Fri Jul 17 22:12:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 36108 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6HMHT3Y006414 for ; Fri, 17 Jul 2009 22:17:30 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n6HMGArn021609; Fri, 17 Jul 2009 17:16:15 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id n6HMG4ZY012968; Fri, 17 Jul 2009 17:16:08 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 590B980637; Fri, 17 Jul 2009 17:16:01 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 2AC7A8062A for ; Fri, 17 Jul 2009 17:13:32 -0500 (CDT) Received: from white.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id n6HMDVEt003244 for ; Fri, 17 Jul 2009 17:13:31 -0500 (CDT) Received: from mail198-dub-R.bigfish.com (mail-dub.bigfish.com [213.199.154.10]) by white.ext.ti.com (8.13.7/8.13.7) with ESMTP id n6HMDQpT032641 for ; Fri, 17 Jul 2009 17:13:31 -0500 Received: from mail198-dub (localhost.localdomain [127.0.0.1]) by mail198-dub-R.bigfish.com (Postfix) with ESMTP id D6C5B130016F for ; Fri, 17 Jul 2009 22:13:25 +0000 (UTC) X-SpamScore: 0 X-BigFish: vps0(zzzz1202hzzz2dh61h) X-Spam-TCS-SCL: 0:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 209.85.221.174; Service: EHS Received: by mail198-dub (MessageSwitch) id 1247868804228292_27966; Fri, 17 Jul 2009 22:13:24 +0000 (UCT) Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by mail198-dub.bigfish.com (Postfix) with ESMTP id E5D30568054 for ; Fri, 17 Jul 2009 22:13:23 +0000 (UTC) Received: by mail-qy0-f174.google.com with SMTP id 4so945780qyk.4 for ; Fri, 17 Jul 2009 15:13:23 -0700 (PDT) Received: by 10.224.3.4 with SMTP id 4mr1113735qal.210.1247868803716; Fri, 17 Jul 2009 15:13:23 -0700 (PDT) Received: from localhost (deeprooted.net [216.254.16.51]) by mx.google.com with ESMTPS id 6sm2376325qwk.44.2009.07.17.15.13.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 17 Jul 2009 15:13:23 -0700 (PDT) From: Kevin Hilman To: linux-arm-kernel@lists.arm.linux.org.uk Date: Fri, 17 Jul 2009 15:12:29 -0700 Message-Id: <1247868758-10423-16-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1247868758-10423-15-git-send-email-khilman@deeprootsystems.com> References: <1247868758-10423-1-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-2-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-3-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-4-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-5-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-6-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-7-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-8-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-9-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-10-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-11-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-12-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-13-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-14-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-15-git-send-email-khilman@deeprootsystems.com> Cc: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 15/24] davinci: dm365: add EDMA support 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: Sandeep Paulraj Signed-off-by: Sandeep Paulraj Signed-off-by: Kevin Hilman --- arch/arm/mach-davinci/dm365.c | 87 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 87 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 9d615db..c52aad3 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -660,6 +660,91 @@ static u8 dm365_default_priorities[DAVINCI_N_AINTC_IRQ] = { [IRQ_DM365_EMUINT] = 7, }; +/* Four Transfer Controllers on DM365 */ +static const s8 +dm365_queue_tc_mapping[][2] = { + /* {event queue no, TC no} */ + {0, 0}, + {1, 1}, + {2, 2}, + {3, 3}, + {-1, -1}, +}; + +static const s8 +dm365_queue_priority_mapping[][2] = { + /* {event queue no, Priority} */ + {0, 7}, + {1, 7}, + {2, 7}, + {3, 0}, + {-1, -1}, +}; + +static struct edma_soc_info dm365_edma_info[] = { + { + .n_channel = 64, + .n_region = 4, + .n_slot = 256, + .n_tc = 4, + .n_cc = 1, + .queue_tc_mapping = dm365_queue_tc_mapping, + .queue_priority_mapping = dm365_queue_priority_mapping, + }, +}; + +static struct resource edma_resources[] = { + { + .name = "edma_cc0", + .start = 0x01c00000, + .end = 0x01c00000 + SZ_64K - 1, + .flags = IORESOURCE_MEM, + }, + { + .name = "edma_tc0", + .start = 0x01c10000, + .end = 0x01c10000 + SZ_1K - 1, + .flags = IORESOURCE_MEM, + }, + { + .name = "edma_tc1", + .start = 0x01c10400, + .end = 0x01c10400 + SZ_1K - 1, + .flags = IORESOURCE_MEM, + }, + { + .name = "edma_tc2", + .start = 0x01c10800, + .end = 0x01c10800 + SZ_1K - 1, + .flags = IORESOURCE_MEM, + }, + { + .name = "edma_tc3", + .start = 0x01c10c00, + .end = 0x01c10c00 + SZ_1K - 1, + .flags = IORESOURCE_MEM, + }, + { + .name = "edma0", + .start = IRQ_CCINT0, + .flags = IORESOURCE_IRQ, + }, + { + .name = "edma0_err", + .start = IRQ_CCERRINT, + .flags = IORESOURCE_IRQ, + }, + /* not using TC*_ERR */ +}; + +static struct platform_device dm365_edma_device = { + .name = "edma", + .id = 0, + .dev.platform_data = dm365_edma_info, + .num_resources = ARRAY_SIZE(edma_resources), + .resource = edma_resources, +}; + static struct map_desc dm365_io_desc[] = { { .virtual = IO_VIRT, @@ -763,6 +848,8 @@ static int __init dm365_init_devices(void) if (!cpu_is_davinci_dm365()) return 0; + davinci_cfg_reg(DM365_INT_EDMA_CC); + platform_device_register(&dm365_edma_device); platform_device_register(&dm365_emac_device); return 0;