From patchwork Fri Aug 7 10:01:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alison Wang X-Patchwork-Id: 6967411 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C07BF9F373 for ; Fri, 7 Aug 2015 10:10:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D456B2067A for ; Fri, 7 Aug 2015 10:10:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [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 1F6D82066F for ; Fri, 7 Aug 2015 10:10:28 +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 1ZNeYs-0006VI-Vx; Fri, 07 Aug 2015 10:07:39 +0000 Received: from mail-bl2on0104.outbound.protection.outlook.com ([65.55.169.104] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZNeYo-0006OF-Qz for linux-arm-kernel@lists.infradead.org; Fri, 07 Aug 2015 10:07:36 +0000 Received: from CO2PR03CA0040.namprd03.prod.outlook.com (10.141.194.167) by BY1PR0301MB1285.namprd03.prod.outlook.com (10.161.206.143) with Microsoft SMTP Server (TLS) id 15.1.225.19; Fri, 7 Aug 2015 10:07:11 +0000 Received: from BY2FFO11FD013.protection.gbl (2a01:111:f400:7c0c::146) by CO2PR03CA0040.outlook.office365.com (2a01:111:e400:1414::39) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Fri, 7 Aug 2015 10:07:11 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD013.mail.protection.outlook.com (10.1.14.75) with Microsoft SMTP Server (TLS) id 15.1.243.9 via Frontend Transport; Fri, 7 Aug 2015 10:07:10 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t77A77DM029028; Fri, 7 Aug 2015 03:07:08 -0700 From: Alison Wang To: , , Subject: [PATCH] ARM: ls1021a: add platform notifier for dma-coherent requirement Date: Fri, 7 Aug 2015 18:01:59 +0800 Message-ID: <1438941719-38350-1-git-send-email-b18965@freescale.com> X-Mailer: git-send-email 2.1.0.27.g96db324 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD013; 1:7xDrPAZLagH5H6ySAVAMEDvcu6PMe1tEfoYpJeV13iFHK5jb/u4vlU52UH7rpQD0+ZSDazQS1D+AAb5S8UOAiMwW+yWtZpf36pmHO8s3yTikW86UqW7yNmusi3ak2o9COsZaBOo4oTWXcPL4EMpFA8hMWKNGCmcymfAzB7p65MTuik4/LSuqaEDVaoHF6lFS713J/keEnZxmf83AUs1fSSyIDdbphQ6IpnQ7LZ2cY9LHCtDCap3yYdZvdnEXWFPu1sNC2AzGg7kuvnt+6UvuikkplMGkUSxK9JQ+UOw717UYVH6dKv9lmKZ9hhL/3WkcEQGbPUDAFZKzxAA5cUMbBQ== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(189002)(199003)(69596002)(68736005)(62966003)(50226001)(5001960100002)(77156002)(189998001)(97736004)(107886002)(77096005)(229853001)(104016003)(5003940100001)(5001830100001)(81156007)(4001540100001)(5001860100001)(5001770100001)(47776003)(64706001)(87936001)(19580395003)(85426001)(19580405001)(92566002)(6806004)(2201001)(106466001)(105606002)(36756003)(46102003)(50466002)(48376002)(50986999)(33646002)(4001430100001)(2101003)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR0301MB1285; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB1285; 2:y1ej0C1WwLjbMMO18ocyacm4+MYsuHQWWUhbApnZaJ5GKTIJ/2IuLDInoMuFiacQ2uwYRt1PBvtzQEC+r+dCVTK+DmlmVbARMcjRLX+h4Ecs1U/sy7VRVBgXu1qd8Z5w5P0P1Xku4g4TvnkkIeOplm+CBoK8yF43X+JYU1oRZWo=; 3:EPSfeVZVuAS4bvOXmnoGbkyXMjjfWxDPYWLms0Vez5oZjCjrOgb0W5ZK/keVkd7yAkQ8Pnx4mC1Mt2aBX2pcX9omM6a5fBEZr/g2qoat3DEb8iujJW/4qDQMr1WEZEA8rqlUHQ+E3YRiPa8CbWibD+D24DXfRBAip3W6VWMTF4sf27B0xUUuphdDgtMWmu9ig2AdhZLUNx7pD3BJ4O4aV5D0siUMzwaKrt1+3s7ooFM=; 25:EfTHTk6CRYIx9nUft26mkYPGOcGpaRSSzuYXSwGSJwkgWWwSdf7m8yUUj+gQCQg6avjansY4tWDQas3E9QF25MKxxHu6RujBNYHJlv6YxK8K2o3yi7mMzMoYi3JWqgDaUaFcrsCvCGBfmdWe2j4YtuAkYtfLNYB7WgFenJZbtNOJ+XN2P1NmvZsg4ZIpQ7+fxIJ9OWdyX7dNBXsXoZNQ7/VpYUZW3CG1SbaSc6WDYpelqnl+a321YimlzLhHboIU X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0301MB1285; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB1285; 20:B6co5EDd13J/bI9vP5kxiwt+1bGGL0fASXl7plT3FtEYKdWor3ZBs6LaPOZC7X1IIkVyQeANjPElOJoett/fFlXSH2zgHWSRAjjvTh+S/Ew8BSNBPjaJ/KCCJeBHkjM7TO69RQ/92W3p6q9zu9Bsk9JG7iBk5Z5X1ZHepwbKgFFDtvoFJs4lFBJ7nl/VNXLfPm//0yDfn5sS2B/7+J9Ssbxuo8mPordQgII5fxw2TKuRi8UzILOVk84gxERdbu462sNpNUzevU0FnJNYOXNZonZLTjyDSg+8ScF9y0BE8A4e5m0yV1x1Zvvsa2d7HIU/MgfV7mXhevuF4ZDfntKLWUsAGyhr7IHVaO/+OjxV5vo=; 4:C9eGCsXPlF0trigqprNRNNmFRNl5JQK8URgyCTwtvww7OcobdCwfT2RY1SXrKgwi18wQasR4/wvIyGJZXvRgzsPhOqY4zyLrCOodmVoEPTZJXDNM49BLW7quJzLrGAjgDQK3muT8ULBdNVeIBTnaPh1IZBSuyLhj3le0dTOoqnlwZJrYf5sPFypy7eBS+1Gti4MBYOEjQcaMk/by+UXW4Qs8kKp+OR9RfANBBCIrPCEcD3QlxOosTpDaPmV1Nw8luSyeKqtU/jsXogkr9ttXwxpvW4QzmNbGWNikPbP4F/A= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BY1PR0301MB1285; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0301MB1285; X-Forefront-PRVS: 066153096A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0301MB1285; 23:X+wphbptx/Pl+Di/WuSKklPWHQQqZw/mo5tNanh?= =?us-ascii?Q?4HeyC5j/0HLIjd4IRYMfurGPaNZlWiC/d/vHqRiOKYAaQ7rcaBoZx9ArP/+J?= =?us-ascii?Q?6MCr/Szqcff1lO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=?us-ascii?Q?T8/KJnXQJwH7xbDIjUDMiMU9Sd9KtQMHcb9do+EBnSwiEBOciTS/vKbyZzrQ?= =?us-ascii?Q?aojJ3F7Z56uEZ474knXHhlAuCifLZ7ywrsJiI8GqrUmpdG3C9Gubr7+F8snz?= =?us-ascii?Q?sNFg7uCmPJ1vWvyxbmcYc3YjpYrIOou25hEFwyzHWnAKyrYfS5CY6vA=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB1285; 5:1Y7J5FIN7DQ3Jfah7h0kz+cc0FVeRTXe6+nLM+ieWbqQQFlK2MsUIZK8gn/k86GCq8xBo1SHGrOv/kUz/IV5T0xoqiyRyKLPcwgVLsq8bGL2UqYgvxieXpnu3edeI3Qec1FhPHkM3l+FxLmKPnHngg==; 24:mFQNH27IHdUu+s1VFFF3StVOF2bU7j72/IfoZryaLgnD/CV7HTiC5TZDaimi8eqaVTpULFD0AmdtwTrxil/c+tBQ6ZX59Zyzhr+qnUt9uFM=; 20:u9bqAIelFaalMZnOi6fBMQaD00n6NRTKXmf/ShnQzFrTsoHLktwfKZ0c+L+ZWK+ZZwE6nZxG8sPW998Am8Kzug== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2015 10:07:10.5478 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0301MB1285 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150807_030735_119198_873FE9F1 X-CRM114-Status: GOOD ( 15.21 ) 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: jason.jin@freescale.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 platform notifier for dma-coherent requirement. Structure arm_coherent_dma_ops is used instead of arm_dma_ops. Signed-off-by: Alison Wang --- arch/arm/mach-imx/mach-ls1021a.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/arm/mach-imx/mach-ls1021a.c b/arch/arm/mach-imx/mach-ls1021a.c index b89c858..6bfc71b 100644 --- a/arch/arm/mach-imx/mach-ls1021a.c +++ b/arch/arm/mach-imx/mach-ls1021a.c @@ -7,10 +7,39 @@ * (at your option) any later version. */ +#include +#include #include #include "common.h" +static int ls1021a_platform_notifier(struct notifier_block *nb, + unsigned long event, void *__dev) +{ + struct device *dev = __dev; + + if (event != BUS_NOTIFY_ADD_DEVICE) + return NOTIFY_DONE; + + if (of_device_is_compatible(dev->of_node, "fsl,etsec2")) + set_dma_ops(dev, &arm_coherent_dma_ops); + else if (of_property_read_bool(dev->of_node, "dma-coherent")) + set_dma_ops(dev, &arm_coherent_dma_ops); + + return NOTIFY_OK; +} + +static struct notifier_block ls1021a_platform_nb = { + .notifier_call = ls1021a_platform_notifier, +}; + +static void __init ls1021a_init_machine(void) +{ + bus_register_notifier(&platform_bus_type, &ls1021a_platform_nb); + + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); +} + static const char * const ls1021a_dt_compat[] __initconst = { "fsl,ls1021a", NULL, @@ -18,5 +47,6 @@ static const char * const ls1021a_dt_compat[] __initconst = { DT_MACHINE_START(LS1021A, "Freescale LS1021A") .smp = smp_ops(ls1021a_smp_ops), + .init_machine = ls1021a_init_machine, .dt_compat = ls1021a_dt_compat, MACHINE_END