From patchwork Tue Mar 15 17:23:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Appana Durga Kedareswara rao X-Patchwork-Id: 8590771 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BD35BC0554 for ; Tue, 15 Mar 2016 17:34:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1B1320204 for ; Tue, 15 Mar 2016 17:34:20 +0000 (UTC) Received: from bombadil.infradead.org (unknown [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C9235202F0 for ; Tue, 15 Mar 2016 17:34:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1afshF-0001S0-62; Tue, 15 Mar 2016 17:23:53 +0000 Received: from mail-sn1nam02on0047.outbound.protection.outlook.com ([104.47.36.47] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1afshA-0001P9-DB for linux-arm-kernel@lists.infradead.org; Tue, 15 Mar 2016 17:23:50 +0000 Received: from SN1NAM02FT037.eop-nam02.prod.protection.outlook.com (10.152.72.53) by SN1NAM02HT030.eop-nam02.prod.protection.outlook.com (10.152.72.96) with Microsoft SMTP Server (TLS) id 15.1.427.7; Tue, 15 Mar 2016 17:23:26 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT037.mail.protection.outlook.com (10.152.72.89) with Microsoft SMTP Server (TLS) id 15.1.443.6 via Frontend Transport; Tue, 15 Mar 2016 17:23:26 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1afsgn-00062Q-Hv; Tue, 15 Mar 2016 10:23:25 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1afsgn-0004O9-DN; Tue, 15 Mar 2016 10:23:25 -0700 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id u2FHNKRA017083; Tue, 15 Mar 2016 10:23:20 -0700 Received: from [172.23.64.207] (helo=xhd-lin64re117.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1afsgi-0004Nc-A4; Tue, 15 Mar 2016 10:23:20 -0700 Received: by xhd-lin64re117.xilinx.com (Postfix, from userid 13614) id 7FD7D208FB; Tue, 15 Mar 2016 22:53:19 +0530 (IST) From: Kedareswara rao Appana To: , , , , , , , , Subject: [PATCH 2/7] dmaengine: xilinx_vdma: Add quirks support to differentiate differnet IP cores Date: Tue, 15 Mar 2016 22:53:07 +0530 Message-ID: <1458062592-27981-3-git-send-email-appanad@xilinx.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1458062592-27981-1-git-send-email-appanad@xilinx.com> References: <1458062592-27981-1-git-send-email-appanad@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22194.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(90966002)(5008740100001)(2950100001)(52956003)(50226001)(189998001)(36386004)(48376002)(4326007)(586003)(50466002)(5001770100001)(46386002)(92566002)(11100500001)(6806005)(81166005)(36756003)(1096002)(2906002)(19580405001)(19580395003)(47776003)(42186005)(63266004)(103686003)(2201001)(33646002)(50986999)(87936001)(86362001)(4001450100002)(106466001)(76176999)(1220700001)(229853001)(107986001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1NAM02HT030; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 21f74dfa-ff9c-4490-9702-08d34cf684dd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:SN1NAM02HT030; X-Microsoft-Antispam-PRVS: <23430a6057ec46a59079c0bae99fdfba@SN1NAM02HT030.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(13024025)(13018025)(13017025)(8121501046)(13015025)(5005006)(10201501046)(3002001); SRVR:SN1NAM02HT030; BCL:0; PCL:0; RULEID:; SRVR:SN1NAM02HT030; X-Forefront-PRVS: 08828D20BC X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2016 17:23:26.0402 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM02HT030 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160315_102348_646353_2AE6FFF1 X-CRM114-Status: GOOD ( 14.57 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RDNS_NONE,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds quirks support in the driver to differentiate differnet IP cores. Signed-off-by: Kedareswara rao Appana --- drivers/dma/xilinx/xilinx_vdma.c | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/drivers/dma/xilinx/xilinx_vdma.c b/drivers/dma/xilinx/xilinx_vdma.c index 7ab6793..f682bef 100644 --- a/drivers/dma/xilinx/xilinx_vdma.c +++ b/drivers/dma/xilinx/xilinx_vdma.c @@ -139,6 +139,8 @@ /* Delay loop counter to prevent hardware failure */ #define XILINX_VDMA_LOOP_COUNT 1000000 +#define AXIVDMA_SUPPORT BIT(0) + /** * struct xilinx_vdma_desc_hw - Hardware Descriptor * @next_desc: Next Descriptor Pointer @0x00 @@ -240,6 +242,7 @@ struct xilinx_vdma_chan { * @chan: Driver specific VDMA channel * @has_sg: Specifies whether Scatter-Gather is present or not * @flush_on_fsync: Flush on frame sync + * @quirks: Needed for different IP cores */ struct xilinx_vdma_device { void __iomem *regs; @@ -248,6 +251,15 @@ struct xilinx_vdma_device { struct xilinx_vdma_chan *chan[XILINX_VDMA_MAX_CHANS_PER_DEVICE]; bool has_sg; u32 flush_on_fsync; + u32 quirks; +}; + +/** + * struct xdma_platform_data - DMA platform structure + * @quirks: quirks for platform specific data. + */ +struct xdma_platform_data { + u32 quirks; }; /* Macros */ @@ -1239,6 +1251,16 @@ static struct dma_chan *of_dma_xilinx_xlate(struct of_phandle_args *dma_spec, return dma_get_slave_channel(&xdev->chan[chan_id]->common); } +static const struct xdma_platform_data xvdma_def = { + .quirks = AXIVDMA_SUPPORT, +}; + +static const struct of_device_id xilinx_vdma_of_ids[] = { + { .compatible = "xlnx,axi-vdma-1.00.a", .data = &xvdma_def}, + {} +}; +MODULE_DEVICE_TABLE(of, xilinx_vdma_of_ids); + /** * xilinx_vdma_probe - Driver probe function * @pdev: Pointer to the platform_device structure @@ -1251,6 +1273,7 @@ static int xilinx_vdma_probe(struct platform_device *pdev) struct xilinx_vdma_device *xdev; struct device_node *child; struct resource *io; + const struct of_device_id *match; u32 num_frames; int i, err; @@ -1259,6 +1282,13 @@ static int xilinx_vdma_probe(struct platform_device *pdev) if (!xdev) return -ENOMEM; + match = of_match_node(xilinx_vdma_of_ids, pdev->dev.of_node); + if (match && match->data) { + const struct xdma_platform_data *data = match->data; + + xdev->quirks = data->quirks; + } + xdev->dev = &pdev->dev; /* Request and map I/O memory */ @@ -1356,12 +1386,6 @@ static int xilinx_vdma_remove(struct platform_device *pdev) return 0; } -static const struct of_device_id xilinx_vdma_of_ids[] = { - { .compatible = "xlnx,axi-vdma-1.00.a",}, - {} -}; -MODULE_DEVICE_TABLE(of, xilinx_vdma_of_ids); - static struct platform_driver xilinx_vdma_driver = { .driver = { .name = "xilinx-vdma",