From patchwork Mon May 14 12:03:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen He X-Patchwork-Id: 10398139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 14DEC60216 for ; Mon, 14 May 2018 12:04:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0289428511 for ; Mon, 14 May 2018 12:04:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E923A2911D; Mon, 14 May 2018 12:04:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7EEF28511 for ; Mon, 14 May 2018 12:04:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752972AbeENMEV (ORCPT ); Mon, 14 May 2018 08:04:21 -0400 Received: from mail-bn3nam01on0094.outbound.protection.outlook.com ([104.47.33.94]:28224 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752935AbeENMET (ORCPT ); Mon, 14 May 2018 08:04:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freescale.onmicrosoft.com; s=selector1-freescale-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LazhTxI+FcDauVEKnML+82xm5EtAZaBWB/tXvlm7+vA=; b=g5fDO3G9fMsu0szfFSNxFkAdYmn/18V9rMJArRLgxN7e5lbwsugMsT6O8jG8pEZ/P+N53NBIT6r9Jo385D7nY9rf47LEPk7v62SC2nXNjxF2IQTEmmWrgkyt4njrUMRRv8CRF976Avns3qRjNYRK2vVgxeMO0AvfugBfZBiFbxU= Received: from CY4PR03CA0007.namprd03.prod.outlook.com (2603:10b6:903:33::17) by CY1PR03MB2188.namprd03.prod.outlook.com (2a01:111:e400:c613::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Mon, 14 May 2018 12:04:15 +0000 Received: from BN1BFFO11FD012.protection.gbl (2a01:111:f400:7c10::1:158) by CY4PR03CA0007.outlook.office365.com (2603:10b6:903:33::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.755.16 via Frontend Transport; Mon, 14 May 2018 12:04:15 +0000 Authentication-Results: spf=fail (sender IP is 64.157.242.222) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 64.157.242.222 as permitted sender) receiver=protection.outlook.com; client-ip=64.157.242.222; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (64.157.242.222) by BN1BFFO11FD012.mail.protection.outlook.com (10.58.144.75) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.735.16 via Frontend Transport; Mon, 14 May 2018 12:04:13 +0000 Received: from az84smr01.freescale.net (az84smr01.freescale.net [10.64.34.197]) by tx30smr01.am.freescale.net (8.14.3/8.14.3) with ESMTP id w4EC4D1n029927; Mon, 14 May 2018 05:04:13 -0700 Received: from titan.ap.freescale.net ([10.192.208.233]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id w4EC4AP4021601; Mon, 14 May 2018 05:04:10 -0700 From: Wen He To: , CC: , , , , , Wen He Subject: [v4 1/6] dmaengine: fsldma: Replace DMA_IN/OUT by FSL_DMA_IN/OUT Date: Mon, 14 May 2018 20:03:02 +0800 Message-ID: <20180514120307.15592-1-wen.he_1@nxp.com> X-Mailer: git-send-email 2.14.1 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:64.157.242.222; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(396003)(39860400002)(39380400002)(376002)(346002)(2980300002)(1109001)(1110001)(339900001)(3190300001)(189003)(199004)(85426001)(126002)(486006)(476003)(2616005)(53936002)(1076002)(51416003)(4326008)(305945005)(8656006)(316002)(336012)(110136005)(54906003)(16586007)(47776003)(26005)(6666003)(356003)(77096007)(86362001)(8676002)(50226002)(81156014)(81166006)(8936002)(498600001)(97736004)(2906002)(48376002)(36756003)(5660300001)(105606002)(106466001)(50466002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR03MB2188; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; LANG:en; PTR:ErrorRetry; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD012; 1:fGBZ5nr9SARZV+bzN5Iq/YdwshkwD8jIfPM+I/yeOqlGwxp48wXKKd79rmBZabXG4HBtXcPvsU383P/rDQJAaNBWjAZQytS93ZKY3CIvArprAW0WeqnGSEfao0rZ8++r MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(2017052603328); SRVR:CY1PR03MB2188; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2188; 3:89rhpGhhvuHisPU8pGiirpLDI8pQse/QuvC+DVEww7M24BTDRrFYkdfgxaIiq6QUJXSqUhobfrvLdZKTGclUcsmDCVBctuMxCtMRamCtKK+Q1ZYZAeMHx72EFjTp7w+CvS8xLGmAWUDax8KC2dtcpXbK0FlzyHtY2VwcXljC8kYP9AfF9+gVIRiyMabV4tm/lWLZWk3503intWH9+jwdYrsjaw+WPu35DoBuw6kbL061rFJSas5MhecaCD6vT2inpm3q+V/JbW0i08KvlFlqZ+qV8cc2Q7JVHD+M746FPbbRpfZ5le1U4Y89jF5rVOHs6rQBsqSiYHVk6TjKaBmbc374H+OCMScH0Zjd/Mg982o=; 25:lZ8uf8rMQhNdLrB9SFWbXAA3/4FCJLO0FbTxyYI7QOAWEyz4AV0WF7Gy6jtXWrzUqHAXf5lf8Fcpsaq7O01VG6xu7UyisR2fVrqsnliELNGhu+OENZru6U0Yk593dst8SLv6qy/7LGxQch7PtgI5yz0rplzeruUyaM8j/BkIeY9ht5bF9xt5a2oYAkuyAXPtK0FqFfjMOG3OChYM/EWoAYeoglMpFH7GbifZPni2Hai9KucTgy97jir0kQhpK9Llo6/bJ7p662rvvO81uLwZ14ZWLG96NIvzAFKxSAi4iVbUv4nkk/cUPCjlp45FcjwoWL3EziKd5XNjrES7MgRqvQ== X-MS-TrafficTypeDiagnostic: CY1PR03MB2188: X-LD-Processed: 710a03f5-10f6-4d38-9ff4-a80b81da590d,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2188; 31:pw+0+VOJXixPGJLBmibQwh0TxW7elwKz9hGXK68xcC9x1NFgsxp0YE7Swk7mV3TQ91aeWoyHkrNChBNo74lix5UWl+m2pLHhvzRERszWchF958xcubRtriOQBJIHs4qvYSrehJy8N0Y6UAKYvFyuoeBaRScr9z8GeqS2WEyo6p030krx1DVmW4Ku4zXqxposJjjySUxyglbimCtS6l6eO/GrzTcLc49Dq9xrznm/cU0=; 20:DqdhczY0TQL+rQIKurscyaHYn4YUy20lojHy4NynAaI5egfkmFdIvIGUgfXaOGg+PIPcZuFs0Heb7JYQ3v4twLjIpZxrYsH9tOPjAXhGAUHK3AZEyasYwRZ00mgEPk2tuZwF04/yytAlBeaVPhRwRYI2deXWpXs6E4anQFlPWEwxyEdUgq7DQeVoo6Lvb4hqEi5UiR2NR08CQ2voEd7CQdtFyGvTREIECxVaSz2u5wuLbVtiPE8MzJ2CE3Lej2/TLV2wOVIyJiX5Fai0ratg/aA8YG35c2jXI0zVbCZkwvoVoDGZXMFq0CQynT/8WKKmsgAboiU+MPxcN3p3UW6lJJXKggsO39R34DQ0nF1xQP1UOUlxmFyMx/HOuTKhA5O1rEZGcDE5tZR/M1cH4QIrtaF6ytP2B8fXGKvNHWqYqBBTcFIJJJm8arwRZ9uNdSTvS1CUuHC55LHx3LeOupP5owD1MlwCEWFLjh33JUdRpB2ZioButvGVCh3s1AXp2T8w8yYBAP6AvKUQ1/ElvMv4CfBc7j/Qxc8AfdXHgbg7QaHtl2N/eQOxC/y4Co5ODri36gi0jkmljybishbNeQ+bCRA1uesxJiBbLKDzvm4LFR4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(788757137089); X-MS-Exchange-SenderADCheck: 0 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93003095)(3231254)(944501410)(52105095)(6055026)(149027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:CY1PR03MB2188; BCL:0; PCL:0; RULEID:; SRVR:CY1PR03MB2188; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2188; 4:Ko29LEgfjI9oowwIrxY/5FD+JpVDM+CCFb18H9WB6cuHluzIzBeegkcUaeg7L7f7KfBwEsGOlNQHtSvcecwZOeRr9ON69CaphRFmF3XBmt4Dq2fH3BZBrrEwiP0ERqcZvp078coj2oADeLxVZjd6DJCy4JiwgmM8hokQudLvdsHaQpV8Wv3kex+7I8h4E5b73Yfm2LkcF5J5hbTfVwbhpepq8i5vL1nmW9dK1iLMwZ0GpQ3qvjqWSMr9k7vcnsY+1mz0IspuAL1BjESdpKPKRL+WkM66O703gLRkiUHo5+rr7q45ik/Ut7B+Jp9zCqmIfNyIYzFukwaf7kaPaPmpfQ== X-Forefront-PRVS: 067270ECAF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2188; 23:kpIPa6BIgIYuDlWrHvUqNVnauDvTNs42AXrzERGA8?= =?us-ascii?Q?vP4g73zS1iHp76g/WoMMlhr+DRoG97jClokk6wu1mXB7a8+3O+aYLet3MSt7?= =?us-ascii?Q?oncqrRrIl6lClaH8vwgaArKk3Qs2x2fMZDGxwPynBuaMM8Grp/uP7PnYSOAj?= =?us-ascii?Q?FU6njeACJM0k1wc9IpJX1HYxg+jK/C0hm7IzzGU1jmd9FVdwlYlNkk2/I5kC?= =?us-ascii?Q?lE+3tlJock/GWIMjggRdFedNnwUcaKSgRWTCSy/0f8d7tKEht+zF0bbnsKcT?= =?us-ascii?Q?KP0Ds5rDDkyKZ25Zuyziy4kTaFkUBrnuFPXA9DqFKw18bsK2d5UrzycPrgLi?= =?us-ascii?Q?Lie1yookc3q2na+WvRQBvSDPksHpOD6NCEtaGxVYbJlC22bPzhmdrGGaHsN4?= =?us-ascii?Q?P4OlJM3SBGZtFCQlStTT4vKfetYFNSmuEkbr4/ejGYNKoa7Ri9yWr85tCnAp?= =?us-ascii?Q?5LseLnkCkJ0IGJnfkG4eOvBKlBrvE8U0C+K98ksgEBebRJp9YdnAPDcZVczH?= =?us-ascii?Q?iGl85H0unDD20xLqz6ivvXyU/mL2Gz4cNsccgLlbQfv2KnW5OD5i0CXJHVft?= =?us-ascii?Q?yXApO7hV/JovLvjPebqTJSK9oQnVUSpNgOwFNx64KgEAO3gJW0Vod45zzsJz?= =?us-ascii?Q?3NvfxhNL+LjwxGnw8Fox0l73zyVIMWezbhhCYRUM3pxb2s1nHErF3XuXE2wi?= =?us-ascii?Q?hFb+dVuAC2+ZvDSwZRHw19vXON4Md1q4sQx77HkUYVs3gzZ6dIFGq6FcGISP?= =?us-ascii?Q?jJjbW43K+DwhbWLwWuM4w5a8W+EKa8eL3JffczoFgpJhcFHnfmdPbtqhTjZs?= =?us-ascii?Q?cyRfTZLFBERGOsvW7jqK4iKOC2BEWAVf/XZTkE6kb0zoZxXAucucHuOpmgg1?= =?us-ascii?Q?wQ8yjO2yaI6XdtKVxPrmVj1Wc0mOTPx24YVleJtCsg5xEz5RvhTLZEfMbB6w?= =?us-ascii?Q?5WOojpijbRCuBTSMN0VZg4IcFMbjvQnDGnFJ4ImioJkbZIdbGdvvJfVRCZCe?= =?us-ascii?Q?RQV0RMeXh2nzgslldGyn6S1ARE0m65rpcadtiksuXT8zkSLQEljmHKL6HUDt?= =?us-ascii?Q?DkuBfH2VZulP6rUx5jiMix+lJrhqD+6TZOGjEyTA7VV8ChEiw=3D=3D?= X-Microsoft-Antispam-Message-Info: sCTNztk/u7YNjraeovtKPQhSytYIkxgUc2UzBcFqfvaedMY+JVcvgRRHrdIRwbQfNgHq6rULGSS/wI/2BVgHukmOolA+kQbBVlQfRu5GiwmGOBJ3VoWDpEmddAg2vjEgVrZJJ5CzYmVawSxmC661IXARCHzTHUPGewwaGwm3mBdYFmxeQb40XSb+UmnLvSFO X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2188; 6:q+HpBZE2RDekGlkHBRZ44P6y8BoGsA/Lh0czhfR8+AZHNHqJBGfq+NT9BPqQT+2WWLPrOQ7WVYzp3XeoEvu08BiM5+shrG4maO/+aqlo4WYMf9R5r7kQHLeGI2YAz6itVzwMaVtiWO2m7EbbLpmTNIAWgxbM6hKeNIvfK+gyx5deo5EA9Skunks2yRYQXWP8NAGJDTgPfYiA4wps2wIv5DOpanbij0ePEvP5t7PSLkxPuV2SHhBGKfcI0kErqYGG+EJVELgxTWwEIGZJOx7Rq0bHjKf30+gdgtrugQlwPTxYKUQlxpg/wJpFKCICyOTSneJpqcalEzufKZirEjdSPkO179/6w1sWvpSQBZg9ab1N5NptQIlVQ0CSxlq4O1etIbIyaNp3+QreUoyiuW8Mpj1vK4i8cYAlGp8sj1OY63R3ahq/lEzI47brJVMTZzJvDjqjlMu+l2KtoQNzCZK6Qg==; 5:9YftbTmg1FJ33bSfhuk0dgcM8stzdHUoOhfkvgGexfzW0sm1gBCUUgsuVh891/RwmrzRb9r6b2Ifsc3Jno7B+9bTGGokP6fNsR9yhFInB2qMkVw2sh96rBmygkiC4px6jnWjFT7qsWkc/iMLoqxjw9BTP/eZvpmC1WKXtdJa41Q=; 24:9maDO283PChFyh2puxbfcns9QSlTr+oDH7VnlGAkkHvrDxwtw+PMkmh3oUt7xXCyyoyzflLuyrP+1gLa3+GQfwiyKGMLdPdOmYv19Y3V8O4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2188; 7:8Zf1bMJKOyWD5mqhebmahi4eTQIh+4r09fmR9kSUxKcqVfQWCiSWRTNDoxaAuYB1tFu1KI1juKsAYsTKpNwvBI18aaCmkFZigy2SWSTsv3m+4Z5wNswZiUVZQ6A/BV86Ia4NsIRHx3yCy5iHGNPSPg0pwfoU9x7/D19Um7rA3bY18lWx5d2ooZMwrPWPw5jPHFKeQ/Snhe1tM2OlwudvMp/YPl+obK1Oc0EI3vfOJJqF5ZOy+4wyJa/qiP2R5QAb X-MS-Office365-Filtering-Correlation-Id: 06675803-d2a0-4d1d-2fa6-08d5b992cf94 X-OriginatorOrg: freescale.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 May 2018 12:04:13.9568 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 06675803-d2a0-4d1d-2fa6-08d5b992cf94 X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[64.157.242.222]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2188 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch implenment a standard macro call functions is used to NXP dma drivers. Signed-off-by: Wen He --- change in v4: - no change in v3: - no change change in v2: - Replace 'ioread##width##be(addr) : ioread##width(addr)' by 'fsl_ioread##width##be(addr) : fsl_ioread##width(addr)' - Fix macro FSL_DMA_IN/OUT build issues in powerpc drivers/dma/fsldma.c | 16 +++++++------- drivers/dma/fsldma.h | 57 +++++++++++++++++++++++++++++++++---------------- 2 files changed, 46 insertions(+), 27 deletions(-) diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 3eaece8..75479d6 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c @@ -53,42 +53,42 @@ static void set_sr(struct fsldma_chan *chan, u32 val) { - DMA_OUT(chan, &chan->regs->sr, val, 32); + FSL_DMA_OUT(chan, &chan->regs->sr, val, 32); } static u32 get_sr(struct fsldma_chan *chan) { - return DMA_IN(chan, &chan->regs->sr, 32); + return FSL_DMA_IN(chan, &chan->regs->sr, 32); } static void set_mr(struct fsldma_chan *chan, u32 val) { - DMA_OUT(chan, &chan->regs->mr, val, 32); + FSL_DMA_OUT(chan, &chan->regs->mr, val, 32); } static u32 get_mr(struct fsldma_chan *chan) { - return DMA_IN(chan, &chan->regs->mr, 32); + return FSL_DMA_IN(chan, &chan->regs->mr, 32); } static void set_cdar(struct fsldma_chan *chan, dma_addr_t addr) { - DMA_OUT(chan, &chan->regs->cdar, addr | FSL_DMA_SNEN, 64); + FSL_DMA_OUT(chan, &chan->regs->cdar, addr | FSL_DMA_SNEN, 64); } static dma_addr_t get_cdar(struct fsldma_chan *chan) { - return DMA_IN(chan, &chan->regs->cdar, 64) & ~FSL_DMA_SNEN; + return FSL_DMA_IN(chan, &chan->regs->cdar, 64) & ~FSL_DMA_SNEN; } static void set_bcr(struct fsldma_chan *chan, u32 val) { - DMA_OUT(chan, &chan->regs->bcr, val, 32); + FSL_DMA_OUT(chan, &chan->regs->bcr, val, 32); } static u32 get_bcr(struct fsldma_chan *chan) { - return DMA_IN(chan, &chan->regs->bcr, 32); + return FSL_DMA_IN(chan, &chan->regs->bcr, 32); } /* diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h index 4787d48..4c33a53 100644 --- a/drivers/dma/fsldma.h +++ b/drivers/dma/fsldma.h @@ -196,39 +196,58 @@ struct fsldma_chan { #define to_fsl_desc(lh) container_of(lh, struct fsl_desc_sw, node) #define tx_to_fsl_desc(tx) container_of(tx, struct fsl_desc_sw, async_tx) +#ifdef CONFIG_PPC +#define fsl_ioread32(p) in_le32(p) +#define fsl_ioread32be(p) in_be32(p) +#define fsl_iowrite32(v, p) out_le32(p, v) +#define fsl_iowrite32be(v, p) out_be32(p, v) + #ifndef __powerpc64__ -static u64 in_be64(const u64 __iomem *addr) +static u64 fsl_ioread64(const u64 __iomem *addr) { - return ((u64)in_be32((u32 __iomem *)addr) << 32) | - (in_be32((u32 __iomem *)addr + 1)); + return ((u64)in_le32((u32 __iomem *)addr + 1) << 32) | + (in_le32((u32 __iomem *)addr)); } -static void out_be64(u64 __iomem *addr, u64 val) +static void fsl_iowrite64(u64 val, u64 __iomem *addr) { - out_be32((u32 __iomem *)addr, val >> 32); - out_be32((u32 __iomem *)addr + 1, (u32)val); + out_le32((u32 __iomem *)addr + 1, val >> 32); + out_le32((u32 __iomem *)addr, (u32)val); } -/* There is no asm instructions for 64 bits reverse loads and stores */ -static u64 in_le64(const u64 __iomem *addr) +static u64 fsl_ioread64be(const u64 __iomem *addr) { - return ((u64)in_le32((u32 __iomem *)addr + 1) << 32) | - (in_le32((u32 __iomem *)addr)); + return ((u64)in_be32((u32 __iomem *)addr) << 32) | + (in_be32((u32 __iomem *)addr + 1)); } -static void out_le64(u64 __iomem *addr, u64 val) +static void fsl_iowrite64be(u64 val, u64 __iomem *addr) { - out_le32((u32 __iomem *)addr + 1, val >> 32); - out_le32((u32 __iomem *)addr, (u32)val); + out_be32((u32 __iomem *)addr, val >> 32); + out_be32((u32 __iomem *)addr + 1, (u32)val); } #endif +#endif -#define DMA_IN(fsl_chan, addr, width) \ - (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ? \ - in_be##width(addr) : in_le##width(addr)) -#define DMA_OUT(fsl_chan, addr, val, width) \ - (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ? \ - out_be##width(addr, val) : out_le##width(addr, val)) +#if defined(CONFIG_ARM64) || defined(CONFIG_ARM) +#define fsl_ioread32(p) ioread32(p) +#define fsl_ioread32be(p) ioread32be(p) +#define fsl_iowrite32(v, p) iowrite32(v, p) +#define fsl_iowrite32be(v, p) iowrite32be(v, p) +#define fsl_ioread64(p) ioread64(p) +#define fsl_ioread64be(p) ioread64be(p) +#define fsl_iowrite64(v, p) iowrite64(v, p) +#define fsl_iowrite64be(v, p) iowrite64be(v, p) +#endif + +#define FSL_DMA_IN(fsl_dma, addr, width) \ + (((fsl_dma)->feature & FSL_DMA_BIG_ENDIAN) ? \ + fsl_ioread##width##be(addr) : fsl_ioread##width(addr)) + +#define FSL_DMA_OUT(fsl_dma, addr, val, width) \ + (((fsl_dma)->feature & FSL_DMA_BIG_ENDIAN) ? \ + fsl_iowrite##width##be(val, addr) : fsl_iowrite \ + ##width(val, addr)) #define DMA_TO_CPU(fsl_chan, d, width) \ (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ? \