Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755031AbcKPD54 (ORCPT ); Tue, 15 Nov 2016 22:57:56 -0500 Received: from mail-dm3nam03on0058.outbound.protection.outlook.com ([104.47.41.58]:40596 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752409AbcKPD5y (ORCPT ); Tue, 15 Nov 2016 22:57:54 -0500 X-Greylist: delayed 1051 seconds by postgrey-1.27 at vger.kernel.org; Tue, 15 Nov 2016 22:57:53 EST Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; X-IncomingTopHeaderMarker: OriginalChecksum:;UpperCasedChecksum:;SizeAsReceived:655;Count:8 From: To: CC: , , , Tang Yuantian , Tang Yuantian Subject: [PATCH 1/2] ahci: qoriq: added a condition to enable dma coherence Date: Wed, 16 Nov 2016 11:11:18 +0800 Message-ID: <1479265879-48840-1-git-send-email-yuantian.tang@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 X-IncomingHeaderCount: 8 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131237402699202206;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(7916002)(2980300002)(1109001)(1110001)(336004)(339900001)(189002)(199003)(4326007)(2876002)(7846002)(8666005)(2906002)(36756003)(356003)(81166006)(81156014)(50986999)(189998001)(6916009)(106466001)(8676002)(5003940100001)(6666003)(104016004)(33646002)(105606002)(85426001)(47776003)(68736007)(305945005)(5660300001)(97736004)(626004)(86152002)(8936002)(77096005)(50226002)(48376002)(87936001)(86362001)(50466002)(110136003)(2351001)(92566002)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR0301MB0741;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD020;1:0N+YAMLLxv73RsTatUvSfm3geKdDeWkFSc98+5d5vYlfwEEXuek1QfV2i//CycA9boTgIjGs5490pUAZAEDUbiFDTs9IdtS0piDebvjc5HyiqZe9t6037JRqYaRwmjQXo49mAbWL64amIFsrdUR9nkwrhXLclGZjyxZ540yrUXYl8NghdvH42DF9iuBRO6ubAlVNhZIwiHulLJkxojZOcKSmo5kgrxd+2UFfwL1U0b0Zu2ksAqheMWkHHgGZhLrT9V4WEqhVfXNgQ20PguD9CjC8DBqok3B1Uzo8g1vGMdGinBTVXdG5NxGCBF2YSWM5fJBnUkoBcRcxcZvFZXF+G7FkaPQbHqIx+9oGO8HidmdPMD/58OmXD5yLdmCXQWycvsO5dZ1K0wddhwfsHt74r6zLBZC8ESjivNLGWP5g28/MUs9zzgISBMFsMAOHaaiNSnSWoHIIJnP5uFo7/eGgDJLd6IsmxaRe4fFKJACw78Bo+xWTUSXTBuK7Uzo7aCNyvdYg4A9ROWH37ngoN9VcCH++qXHi4gBdZNAlV64AnvNmhw+ijvMStKbz7rXJkKpUqIbd76vAl2j2mD1rtt1uaVlSGXzzx6aXhPZc0WslXkAvVJsm8X+np+jf5aFw6UsIYP0HfdThURdY66VDB0BXOJr/2dKHG6q97mJZWzAC38ICJv0tlDurwmsaLVAPmcwS40+InNvPyRBUcKapO/EWu9PqiWnnKBI+FcM5iQ7ph7w= MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0741;2:gbpFFOXwHu86xOXtS3K/Ox2f1GlW4dzaCbQYXMxOR8Bc/a+UAFz+YFYuMnybdUzRZ/xgfrSMSQCKJWdigRe7gEXBmOuFym611v33IR3ocBqTczx/6rXmnCM1qJKf3sPDFVyBUDh73xsbwWUEgXVvXffCJ5+6ERAlcDMC8rE8DUc=;3:1FbbRggi3hIuEiQQsQMO5Pf82LR4Y6yBL9hlNMWOo/JOqlx8xyJrjRIs9FQcsQd9ALQ2v3VKFcSEl0ttzISH+VYpdHLIZC0v3e2+ZviUPiEznSERegqNFS8rH9ewZo0lWlDZD3U3LlW5CrZzjwkwYLURVMcTvZ6UD7p/G6WlisanlIaWoMNVD1YGyr2GTAGwHK0dkhBiM7Jx6N9lai9uj8tcHdxJCFxDzfICtTB9J+rmj1l0POAy8ZcMgTx9aCMVXeMjQD73Dt70kCq+0NG/ag==;25:q8yyZ9gl3gsXM4ShseykB52WPfliZsCj3NTBBTD1AyFj2sEjkYzON8Ygh8fyQ5pxKompFtkdgMHQnotaMEIMuVEinE9iwSkuFkvEIfI60kH5SCryVW062E1TIMCazWLZm/m2RQT3Q5QpXK3BDaMr5YlJCswW/ajPoXJsY9Fef4MWMkb1isvaNDyvGgNqBABUq7YM2bTiT7YrrrSabldg7+JKHhOEuwgCmQatYZTY/GioWrjTmGE+6YTrtc+1DPUasF6dLUT+oezuQ1+mtF/JhAL7qg7X/ofCF1i3R6EJYJzuKfShedbdi3eN3A8NtKvFIw4Pl9ul8qx65bXBQsDnR/d7u5laBqAKYUzlgMzVUO8CmXveZRHEv5tozG3ctEl/oVbebjjYBk/xw6R09+CapbI4wUooUt36HLuzuToorRn9sbttybWjGep6AbMIrVla5vJjX3TVtNXPyVZQFNicaQ== X-MS-Office365-Filtering-Correlation-Id: f0b3ab69-92cc-4dac-7396-08d40dd01385 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BY2PR0301MB0741; X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0741;31:xn3UArAZUY8EFEP1hGPaSLsrejzOQeQMqc99uWtEg5EArCEi2jQB23qqg8Ks3WaKEnUfzccamw10OwEjE/avp0ToTI3+KFe6zbrRQ2CFg7txqwzAitqaucIF1K5yWQXdZ59by5rcE6xu3Ux93ua0aDHRMxFaeNEApdRpw2AVk6v8CO5zNwUjCqrixpoVAtUYx4qHzFxH7aXtWOkw+Ox6OoGD+SCo/I/aYizPjJ/7XQ3ihT3SksWuWgRKhis+3BazkuOYYB8O3DTBBmRKkVZ27g==;4:FsFPWIYRhI2g6ttLUUotckdOcgXK2rjwXXWeszIic0Nm08wJ2gKiOs75gQ8r39bczocpGmkuimdIhkb9wf8pLBp1E11XOU/SjsfqrZ/jdK8wi8tA2Jq8i3Jwzykhr1dNgXxWl5XM4woGdYoHTKJWQnuI1DYh1rdMsLwEuKgQVWH+0PusBWKzXikFzj2mVUZ/Lp97AjUkuNSpzELxe+HF7YgrdVSp0fcAGsasIWR3R0ZyKYMSIkF2NKkVmACRVposanaG/I8L3x2J/lxDeUGzgnnKKhTUjwNdMeNcWzZtuzrAS+6qNIC/ekliv6oLdWGAoo8qElAqkC5MUdo0AVzIaE0GoulsmYkU3942bdaOquA18wJQkQG1SX2HORzd9+GoZoaV1bNwPK/UR5v6ID5N8tJgCREjqaKjv0GT9jS9ES3u8tOHA+CAONqMRr4xUaa6VdM3xpVu6OCWWrXvxUAemvgiy2hMQMvq6jXgG7gQqJhP0aQ3+u6QQ1dU6kuMKSGoU7XB5/b11slsI4nUAqDbguQ6dfXUOyCJgiMZge6HCzhx0RqZSSSWgQsCugLjvKcTRzTdkGzaBLY5lEPQPdpEEQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6095035)(601004)(2401047)(13023025)(13024025)(13015025)(13017025)(13018025)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6096035);SRVR:BY2PR0301MB0741;BCL:0;PCL:0;RULEID:(400006);SRVR:BY2PR0301MB0741; X-Forefront-PRVS: 01283822F8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR0301MB0741;23:nJ8iHw2vsf9kqMIbhLQJ8NS+wS+2RRogHIhPwBb?= =?us-ascii?Q?6Y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MjTsMPTyHb?= =?us-ascii?Q?6iYQ2JTt331A/sIWAi0y+8mkNODc5b5VxPLF6BszMF5rrg5X8MUvzfMsTC3d?= =?us-ascii?Q?MdTz4WOdKPWt/8QWByxQi5NwI2WYLe+xoA5JYDl0yFII//bSulRzE4E4/rj1?= =?us-ascii?Q?xMomqSzTFUxfu4c8khmtEv2uI3Goj2wz/D9A2NaJskCn3oToDtQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0741;6:WixYj4Uojr5uSyN78TCr+kHXX85QWzfcC1hnlrk/r1LoGytfsRY7mXWr93k0hKYPrpTD2XZUnzxMNF7KOfcdTMwCNL2DgquJS0DCftZ3Bl2SyEJcngDEydQQn/SXL86BP76t2op2PFtjFXHTu34CKyip8oKlcsyqsWdd6/8jo/2jRQcKXbrs+UZhgpeCrFOa+SWnTgxDcWnBFVMsUQBSNbbyaaWBkGyAUYIuZt+ggGY/bYvZwv+zwCiZvOiOJavE8IZ2OdU1E+/mi8Y717Q7HXmgQdyDbU+WgfdOOtC+YgG8ePSLJDwyjx6CuC6UmbD8HaEQhga/7BJneepPWyhEVg==;5:LdMn5Re1zbIZZMiboTkq1b4fyJICDWe977/E0VNCv5xwERvtmaHs8/7okTA+s4a5YspcAAgIEWRPbKswbnVMWtD4Atd9Hj7YdjEfZPma786zOorGosXCShx3pM53xyBV8SK3S7hHr09poerH2w30JMluaSK3oXybnzeoqbvvybHXdOIEwNTN0jvA9KKYwITr;24:nkJP0XGVtiNmvoyJ7dlpF2EK89yMH1gh04fwD31sq4S/1NEmQuLiBcePVFoeY6maIdz2nFE+cBLQgU7mf9z96tkydKI4DV9w9tn38BfeQbY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0741;7:8g+DJaNuZFlhyFgLXqv80LkQlLPWYBOwfBK5VDUCIqmC+t4u/7Zv3DCuWrZuiarSJo7+LDcgmDmyaBTiKr5LwJKBzmmBjIsooiu2joaY0gMFUXEoSrsIsAokre3d2JgCo6SWDxq8u+vrn5dXOZG+tKg50b99UhkB39hJoA66MyT5v9DPnMOStChbVh0l5Tur3nU0gBUDBrPnDXtZi4/NMHpEjJDmvWqJ7nNwGkiFNKwV6Dv5+PSiRVN3+dShdyXNpNaW3sVjexx1yG5siD4MSUY02x1xtWs/sEzXu8petWZY1Ogem/Hmu34Y2DqdXFUviydEQShw0QF4/C8hPWH8xpkTXw2wzzTjYk3SXsixiP4= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Nov 2016 03:24:24.6317 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0741 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2318 Lines: 68 From: Tang Yuantian Enable DMA coherence in SATA controller on condition that dma-coherent property exists in sata node in DTS. Signed-off-by: Tang Yuantian --- drivers/ata/ahci_qoriq.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c index 9884c8c..45c88de 100644 --- a/drivers/ata/ahci_qoriq.c +++ b/drivers/ata/ahci_qoriq.c @@ -59,6 +59,7 @@ struct ahci_qoriq_priv { struct ccsr_ahci *reg_base; enum ahci_qoriq_type type; void __iomem *ecc_addr; + bool is_dmacoherent; }; static const struct of_device_id ahci_qoriq_of_match[] = { @@ -164,26 +165,31 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv) writel(LS1021A_PORT_PHY4, reg_base + PORT_PHY4); writel(LS1021A_PORT_PHY5, reg_base + PORT_PHY5); writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); - writel(AHCI_PORT_AXICC_CFG, reg_base + LS1021A_AXICC_ADDR); + if (qpriv->is_dmacoherent) + writel(AHCI_PORT_AXICC_CFG, + reg_base + LS1021A_AXICC_ADDR); break; case AHCI_LS1043A: writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1); writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); - writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); + if (qpriv->is_dmacoherent) + writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); break; case AHCI_LS2080A: writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1); writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); - writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); + if (qpriv->is_dmacoherent) + writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); break; case AHCI_LS1046A: writel(LS1046A_SATA_ECC_DIS, qpriv->ecc_addr); writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1); writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); - writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); + if (qpriv->is_dmacoherent) + writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); break; } @@ -221,6 +227,7 @@ static int ahci_qoriq_probe(struct platform_device *pdev) if (IS_ERR(qoriq_priv->ecc_addr)) return PTR_ERR(qoriq_priv->ecc_addr); } + qoriq_priv->is_dmacoherent = of_property_read_bool(np, "dma-coherent"); rc = ahci_platform_enable_resources(hpriv); if (rc) -- 2.1.0.27.g96db324