From patchwork Thu Nov 23 06:53:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siva Durga Prasad Paladugu X-Patchwork-Id: 840684 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="o3w5EdaD"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yj9433FVVz9t2M for ; Thu, 23 Nov 2017 17:52:18 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id CE120C21E42; Thu, 23 Nov 2017 06:52:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAD_ENC_HEADER, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 75430C21D9F; Thu, 23 Nov 2017 06:52:09 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 22E86C21D9F; Thu, 23 Nov 2017 06:52:08 +0000 (UTC) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0045.outbound.protection.outlook.com [104.47.42.45]) by lists.denx.de (Postfix) with ESMTPS id 5998FC21D76 for ; Thu, 23 Nov 2017 06:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=guPMZrBIWsdUZRt/5PjWfXCVasAT91I/d8QIhOU477g=; b=o3w5EdaDCpxykR/JVjcbXxj8aJzl5qmkODUm1/dQE17dfOUB9Ac6jqCVsPMnD+mODebzFL21PB5RB98vZTpr3bF1U3cXLuud2XkwnyiVrhpGo/d/fNkipjrYQRf5cVwdNn2nZfzDmCFOLQDqZrpGluwfr0fdT9GPlDhNoo3nvMA= Received: from BN6PR02CA0038.namprd02.prod.outlook.com (10.173.146.152) by CY4PR02MB3381.namprd02.prod.outlook.com (10.165.89.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Thu, 23 Nov 2017 06:52:02 +0000 Received: from CY1NAM02FT011.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::208) by BN6PR02CA0038.outlook.office365.com (2603:10b6:404:5f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.239.5 via Frontend Transport; Thu, 23 Nov 2017 06:52:01 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT011.mail.protection.outlook.com (10.152.75.156) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.239.4 via Frontend Transport; Thu, 23 Nov 2017 06:52:00 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:38592 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1eHlMd-0001cB-Nu for u-boot@lists.denx.de; Wed, 22 Nov 2017 22:51:59 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1eHlMd-0002wK-Nd for u-boot@lists.denx.de; Wed, 22 Nov 2017 22:51:59 -0800 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id vAN6ptn0003690; Wed, 22 Nov 2017 22:51:55 -0800 Received: from [172.23.37.99] (helo=xhdsivadur40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1eHlMY-0002va-Qp; Wed, 22 Nov 2017 22:51:55 -0800 From: Siva Durga Prasad Paladugu To: Date: Thu, 23 Nov 2017 12:23:12 +0530 Message-ID: <1511419992-5381-1-git-send-email-sivadur@xilinx.com> X-Mailer: git-send-email 2.7.4 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23482.004 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(2980300002)(438002)(189002)(199003)(48376002)(63266004)(50466002)(551934003)(2351001)(189998001)(33646002)(106466001)(50986999)(6916009)(77096006)(5660300001)(106002)(47776003)(6666003)(81166006)(8676002)(54906003)(16586007)(478600001)(316002)(9786002)(8936002)(50226002)(2906002)(107886003)(5003940100001)(305945005)(36386004)(356003)(36756003)(81156014)(4326008)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR02MB3381; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT011; 1:kQ7PhvnydAZ5v64wml1i1tfFuecoSwO6nwPTE28iAAWRYNRiqLNVmg3agp0Ogz1Ihgvc/8aODM20i6N4+g9ZnSK7AtRVyY7dYd8lAdUjjQwkstna6t5URwoQ129Zh+mb MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 97b099b5-3d23-420c-5974-08d5323eb2a1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600022)(4604075)(4608076)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603258); SRVR:CY4PR02MB3381; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3381; 3:6GRUrNCIncF2X0WY0PFVDg3g0srstIfsJ7mE5Oxm3+SxM4sd6W3bd9hxdCWvCrhUEtA25clS57G5OLdlq1JLGAWRxJ41Wr2kRqAD22JDj3HEgHg1u/XqYhnnRvE+CU0tVaZuqgJA4g2UKorQEfwPUrmyWv0FKaDkIV9ZCqUJ853QydhSwOJKHnrdD6SBOEB4qCkZBanJFkUP4wyzGw5DOMtx3VH7MJKjIQQn21cgumJdfv3KoP3Y5emiuyxi8yzdpTUnMGIKAYr1DkRSlxVN5iuMbcc5Fxd0fTPGKAwfhvkg/M0ZEnfeXI8llSYkj/+Puujf44VOuONKrQqZXD8bckon98tCBZsfFWfmxPsFrZ4=; 25:DbpiFIWO2myIF2i5kk4MuUqVFiFv5aqzTyb5uLTvj6cua+uZElc7vqE3DeqSPhM96YoGh8A3LyXA44tRGaZ7ikBpUpka4ZYK3lW9T8jE4dal7OFGKSq/qk1CfeyDEr1bpOsMzh7kMTSbcHts37B7jSr93CGnMiUAVfHoqTKqNDL1rU7Hbbf52NXbIGzWiVaBBfkwTNGGWlXwHWxowJadal2pC4VI6BKaloVpnUSKGdUvtvgVCjt+AebpbYfzxQipzUMKG7PX0q4mglqCCh+7RcQ/GbxqPIfGTmTjbR/E2Vh3PDxD39s01Sp52B3LOpau7+45fihu127H5lnrtBT9ag== X-MS-TrafficTypeDiagnostic: CY4PR02MB3381: X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3381; 31:Jk4N1N5vNc48G1N0/Qn1dbvT/yqWBeL5z7EWiMFB14cbiWYuqzxs41n/DOJq9zkWsgKHERD17RkoRcMOTSvjwMOVT1ddYx645DyMhxHmxEjUMxl2jxMypBGVdMj2WZNXTIGvbWKBJknp05/ZoucDV+3AvtR8ROX820FC2gJ9fYMpJf8xTJnCtBeUWJbln8pDtXnFkv9lFtG7vHYIWR5tpuapIz1kzxluyU4mqh33nGI=; 20:5ufCBpytDC6oLWEU9Xb5CXR+sBjkvd1KmqHkLVPYOsFQJQN+igyvC/j3dIgDTsXYjfqo2aUf05lHLHLFD3/WHGUmshJggyWNTmxRsI0pHJhR09FubPsELILdG6OsCMAsOAOouWeXJw3kRutby5Ve7we24Ed2vv3OQWiiXyJLNyo/iKOPrcAwQF6hqfOIlQUGJpjrAc9gM5bSKeez9sCatleKSouCtj8bAhdgUhY8xVpA17EjY5zxnlTuctEZVcsFbCT5dzUFehBNkcYbbgC5n/xTyAl9SNGGLVn5XIfI4SyO2pTiixk93nV9XBcxabZLYQ9+FMsqrdjm9MZP2D+GxYkPLr7+28B0KNVW8xp7imLaTEcagJo2lpkKMdC5kyZ/R/jlPDWbP/a9wlBP+2EWxs3j0v8B00nqDiI+dpiAB9dz+UP7FAEweJoA8f+aZnHnD18i8xWj4mLIIz8KWnIyGPui252MGhOH5qEsTmAfs+ojSzjb+l0gLNccup26JVls X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93004095)(3002001)(3231022)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR02MB3381; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR02MB3381; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3381; 4:rY8pz1tmYaCeugZc7nBo5S5kVTPqFuBVnWwzKsKdoy7uNeVAcwAEyp1Rpc0euJNtuQje3AGPpXAfJCqtOTp1AQ+H/OF/VGTt4Ncok8KFla1zkm16pc56Et75DKbRzPoSEAKSyi9OFYF1L4eEP/7kpmWKYhUPq6XvkfQ2JUV4O1GRX15zQhwkcZCt7R9encPPDEwBQoiRigL5KNA9fsVkufNBTfTOl/B5TsgUhN0MD3YvVC745baiHFZoRi3WVkyi1AkQ34MXBcdZfkiTGHN3DMTEHocMWdR9eF0b2RuR1pBrTuhos01GEWJg3LVAqiBy X-Forefront-PRVS: 05009853EF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR02MB3381; 23:GYnTaRdYRS3joRgdQL3fbs0ImgkWsPTXnY5WYZOXD?= JrJcv/n4jSTaHoPqjDVLYouM1g8chDx8V8+EGVWF/ODqG8iBfr1iKg5ZR+lRs+et7CZ41zRAedf3ISPoe79d6/ZWa4KLBlIXh6RiDsUO4MlbcUEvLaCxHfuCfb1ANAxrE+t9vEhgXEml0/spJGF69AX0q/QUzf5Jug4IkK4Tz8i8kvcTPJntR8DOTz+mjSp7FpOMjaLVOr8cjZw5nWvqc6t+pOxzI7MdtxtZ0eCXQRO7EGlVqROeRZvyQXZMrd4V+aRnmkPlP1pR+fj8cXdNuPpPxK/LE5Xk08gIW8qJTkU3xrpVZIN2CP2Pxidezf0pi7Rz2ODwLzzUH8EDb4pSzTZsvwqNNFZM/MudgompHWmtuppwQa5FiKwyrUmByrGkh/W1vS1jH5tYkN+2MM2rizUqx13kvKtyv8EQl6b1s+3RtbMHBRG7bLc5JZP5XIz5EvbPaZm6bX63LNhFNJOuTLbcnogTk/RxNzp2JiDGs/Y3UW8wN/Gkm5oD8BeCwDJlqRS2ouUcaKBp7r0PAn7bOSxSJ7ooxmnmAKxeV33a2eB3uXDcfXn3vsPaNRr+Wau4007gdQDOA27Hhx7Ba7nCadz7dvVg5Y6NB/d6dIdOFZF0IGL/PHSH9nKMI9et3Dkk4epa5g+l5ckhtv+/6TkDLNSDNR9u2NsPTk10EadZ9+BVzYOfw6WVfWIgndgyaC15ugpsCmlm1zKUBqBr//YlyaguoDT1FYA5TPgqriiF1e4uON+aGr6nSzRZuWSg+DtPY9Id2QnebxFGzP1wM8AnnP/X3dlMKWKI2lRrE0sQ48irwoyzRkC1KZlvbfLE1Lk2903ZmLoojpdQAyg41+yUbV8hE8N42wL7sksCodxwWL1O6rXdklvnSJg2tMOhNiHgvAxlpV0mmEEKo/FkyVywXS6D6CnDyKYVUBOd7/uC7e7Bv/fWhXgop4gS2kurrF6Qb3IdvlxsBy27DfznjXLmATx+ZQtCSG20pXJbkdBziMy1A== X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3381; 6:ScJ3aD0Xzcr5XLnb2acqGJMJpY9ooosMamD41SByOBRpmuXzXXUakpJZmG4McwruFVOpArdNxL+KawNn9/Qr7X9bBveRE6nF2EX1SZvCcdfmR27ZGYWsKYi79tdPKtxmqWskw33SbIPFigNyX+KVSQJaatnBOacwM7EVcklzl66mez1sOC5FNEf1vgW7sHOnWY7kbS8C0EOaR1n0VHwH46txrlO77qhUCkpP/RfICc486AwniErXINp1jA6zOATqqjwv10lmhGKniuCePEYeO29leLlBo6CMApbWIkNFc/SpExhJcAbxQKnngJ9riUlaZUhM4WRGhaGN3gsgLD4AUtIeg6Ed7UbkJeyrGU1xaQQ=; 5:U+YTcWjuzV4GPjKcdvDi6wzNBsG86wOLai96yl/jNDcStYl45sTpYH6k+Tlt1q0YO/N+0TgZVJS0LiD7Ix4sjRg3FI/8qjcqVMcwb9DfiwOh1b97QWnHzYI7ox8NmQTSUz6oynKxPl3L4DIezNlZShZ1OpIz9ZxEFElLM3eqzoI=; 24:ZDDgzj9g7ZlXwv/bZH12voFCYp35zZYrA1ghCt1GT3MTaCkxutj5CRkp3CUJj8IsoCxnkQHnj0hm7+Risaw6PvkDKB/2TP/TLywtph03yEw=; 7:GPGKhCKj24Q0NTHTeuQiL8kIwUiFtjrdV4eaz23ZqnUc6EMBulrbg3z1JLAPMl0pDg6WvDuHMiqukjnIfasz8OFxNCQUBo4WCFpMbaB1jrbsVBRGQ4bq5vT2SyjnjfAoEUhKFSnLI2lTtXNm529GlEFzkDAlI6mgOTWRnuRw1H4HNkezX4YZfTcB4YIcKEASOhhlOrcCpX1zH8snVRcI8grSXSJ5EbW5ntsCwjo0E9vwvLTZhqobmUOR91GjBklm SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2017 06:52:00.6885 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97b099b5-3d23-420c-5974-08d5323eb2a1 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.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR02MB3381 Cc: michals@xilinx.com, Siva Durga Prasad Paladugu Subject: [U-Boot] [PATCH] net: xilinx_axi_emac: Use readl and writel for io ops X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This patch uses readl and writel instead of in_be32 and out_be32 for io ops as these internally uses readl, writel for microblaze and for Zynq, ZynqMP there is no need of endianness conversion and readl, writel should work straightaway. This patch starts supporting the driver for Zynq and ZynqMP platforms. Signed-off-by: Siva Durga Prasad Paladugu --- drivers/net/xilinx_axi_emac.c | 86 +++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c index 25c66c6..aa66e28 100644 --- a/drivers/net/xilinx_axi_emac.c +++ b/drivers/net/xilinx_axi_emac.c @@ -152,7 +152,7 @@ static inline int mdio_wait(struct axi_regs *regs) u32 timeout = 200; /* Wait till MDIO interface is ready to accept a new transaction. */ - while (timeout && (!(in_be32(®s->mdio_mcr) + while (timeout && (!(readl(®s->mdio_mcr) & XAE_MDIO_MCR_READY_MASK))) { timeout--; udelay(1); @@ -180,13 +180,13 @@ static u32 phyread(struct axidma_priv *priv, u32 phyaddress, u32 registernum, XAE_MDIO_MCR_INITIATE_MASK | XAE_MDIO_MCR_OP_READ_MASK; - out_be32(®s->mdio_mcr, mdioctrlreg); + writel(mdioctrlreg, ®s->mdio_mcr); if (mdio_wait(regs)) return 1; /* Read data */ - *val = in_be32(®s->mdio_mrd); + *val = readl(®s->mdio_mrd); return 0; } @@ -207,9 +207,9 @@ static u32 phywrite(struct axidma_priv *priv, u32 phyaddress, u32 registernum, XAE_MDIO_MCR_OP_WRITE_MASK; /* Write data */ - out_be32(®s->mdio_mwd, data); + writel(data, ®s->mdio_mwd); - out_be32(®s->mdio_mcr, mdioctrlreg); + writel(mdioctrlreg, ®s->mdio_mcr); if (mdio_wait(regs)) return 1; @@ -233,7 +233,7 @@ static int axiemac_phy_init(struct udevice *dev) SUPPORTED_1000baseT_Full; /* Set default MDIO divisor */ - out_be32(®s->mdio_mc, XAE_MDIO_DIV_DFT | XAE_MDIO_MC_MDIOEN_MASK); + writel(XAE_MDIO_DIV_DFT | XAE_MDIO_MC_MDIOEN_MASK, ®s->mdio_mc); if (priv->phyaddr == -1) { /* Detect the PHY address */ @@ -312,12 +312,12 @@ static int setup_phy(struct udevice *dev) } /* Setup the emac for the phy speed */ - emmc_reg = in_be32(®s->emmc); + emmc_reg = readl(®s->emmc); emmc_reg &= ~XAE_EMMC_LINKSPEED_MASK; emmc_reg |= speed; /* Write new speed setting out to Axi Ethernet */ - out_be32(®s->emmc, emmc_reg); + writel(emmc_reg, ®s->emmc); /* * Setting the operating speed of the MAC needs a delay. There @@ -336,13 +336,13 @@ static void axiemac_stop(struct udevice *dev) u32 temp; /* Stop the hardware */ - temp = in_be32(&priv->dmatx->control); + temp = readl(&priv->dmatx->control); temp &= ~XAXIDMA_CR_RUNSTOP_MASK; - out_be32(&priv->dmatx->control, temp); + writel(temp, &priv->dmatx->control); - temp = in_be32(&priv->dmarx->control); + temp = readl(&priv->dmarx->control); temp &= ~XAXIDMA_CR_RUNSTOP_MASK; - out_be32(&priv->dmarx->control, temp); + writel(temp, &priv->dmarx->control); debug("axiemac: Halted\n"); } @@ -359,7 +359,7 @@ static int axi_ethernet_init(struct axidma_priv *priv) * will be valid until this bit is valid. * The bit is always a 1 for all other PHY interfaces. */ - while (timeout && (!(in_be32(®s->is) & XAE_INT_MGTRDY_MASK))) { + while (timeout && (!(readl(®s->is) & XAE_INT_MGTRDY_MASK))) { timeout--; udelay(1); } @@ -370,21 +370,21 @@ static int axi_ethernet_init(struct axidma_priv *priv) /* Stop the device and reset HW */ /* Disable interrupts */ - out_be32(®s->ie, 0); + writel(0, ®s->ie); /* Disable the receiver */ - out_be32(®s->rcw1, in_be32(®s->rcw1) & ~XAE_RCW1_RX_MASK); + writel(readl(®s->rcw1) & ~XAE_RCW1_RX_MASK, ®s->rcw1); /* * Stopping the receiver in mid-packet causes a dropped packet * indication from HW. Clear it. */ /* Set the interrupt status register to clear the interrupt */ - out_be32(®s->is, XAE_INT_RXRJECT_MASK); + writel(XAE_INT_RXRJECT_MASK, ®s->is); /* Setup HW */ /* Set default MDIO divisor */ - out_be32(®s->mdio_mc, XAE_MDIO_DIV_DFT | XAE_MDIO_MC_MDIOEN_MASK); + writel(XAE_MDIO_DIV_DFT | XAE_MDIO_MC_MDIOEN_MASK, ®s->mdio_mc); debug("axiemac: InitHw done\n"); return 0; @@ -399,11 +399,11 @@ static int axiemac_write_hwaddr(struct udevice *dev) /* Set the MAC address */ int val = ((pdata->enetaddr[3] << 24) | (pdata->enetaddr[2] << 16) | (pdata->enetaddr[1] << 8) | (pdata->enetaddr[0])); - out_be32(®s->uaw0, val); + writel(val, ®s->uaw0); val = (pdata->enetaddr[5] << 8) | pdata->enetaddr[4]; - val |= in_be32(®s->uaw1) & ~XAE_UAW1_UNICASTADDR_MASK; - out_be32(®s->uaw1, val); + val |= readl(®s->uaw1) & ~XAE_UAW1_UNICASTADDR_MASK; + writel(val, ®s->uaw1); return 0; } @@ -413,15 +413,15 @@ static void axi_dma_init(struct axidma_priv *priv) u32 timeout = 500; /* Reset the engine so the hardware starts from a known state */ - out_be32(&priv->dmatx->control, XAXIDMA_CR_RESET_MASK); - out_be32(&priv->dmarx->control, XAXIDMA_CR_RESET_MASK); + writel(XAXIDMA_CR_RESET_MASK, &priv->dmatx->control); + writel(XAXIDMA_CR_RESET_MASK, &priv->dmarx->control); /* At the initialization time, hardware should finish reset quickly */ while (timeout--) { /* Check transmit/receive channel */ /* Reset is done when the reset bit is low */ - if (!((in_be32(&priv->dmatx->control) | - in_be32(&priv->dmarx->control)) + if (!((readl(&priv->dmatx->control) | + readl(&priv->dmarx->control)) & XAXIDMA_CR_RESET_MASK)) { break; } @@ -450,12 +450,12 @@ static int axiemac_start(struct udevice *dev) return -1; /* Disable all RX interrupts before RxBD space setup */ - temp = in_be32(&priv->dmarx->control); + temp = readl(&priv->dmarx->control); temp &= ~XAXIDMA_IRQ_ALL_MASK; - out_be32(&priv->dmarx->control, temp); + writel(temp, &priv->dmarx->control); /* Start DMA RX channel. Now it's ready to receive data.*/ - out_be32(&priv->dmarx->current, (u32)&rx_bd); + writel((u32)&rx_bd, &priv->dmarx->current); /* Setup the BD. */ memset(&rx_bd, 0, sizeof(rx_bd)); @@ -470,17 +470,17 @@ static int axiemac_start(struct udevice *dev) flush_cache((u32)&rxframe, sizeof(rxframe)); /* Start the hardware */ - temp = in_be32(&priv->dmarx->control); + temp = readl(&priv->dmarx->control); temp |= XAXIDMA_CR_RUNSTOP_MASK; - out_be32(&priv->dmarx->control, temp); + writel(temp, &priv->dmarx->control); /* Rx BD is ready - start */ - out_be32(&priv->dmarx->tail, (u32)&rx_bd); + writel((u32)&rx_bd, &priv->dmarx->tail); /* Enable TX */ - out_be32(®s->tc, XAE_TC_TX_MASK); + writel(XAE_TC_TX_MASK, ®s->tc); /* Enable RX */ - out_be32(®s->rcw1, XAE_RCW1_RX_MASK); + writel(XAE_RCW1_RX_MASK, ®s->rcw1); /* PHY setup */ if (!setup_phy(dev)) { @@ -515,22 +515,22 @@ static int axiemac_send(struct udevice *dev, void *ptr, int len) /* Flush the last BD so DMA core could see the updates */ flush_cache((u32)&tx_bd, sizeof(tx_bd)); - if (in_be32(&priv->dmatx->status) & XAXIDMA_HALTED_MASK) { + if (readl(&priv->dmatx->status) & XAXIDMA_HALTED_MASK) { u32 temp; - out_be32(&priv->dmatx->current, (u32)&tx_bd); + writel((u32)&tx_bd, &priv->dmatx->current); /* Start the hardware */ - temp = in_be32(&priv->dmatx->control); + temp = readl(&priv->dmatx->control); temp |= XAXIDMA_CR_RUNSTOP_MASK; - out_be32(&priv->dmatx->control, temp); + writel(temp, &priv->dmatx->control); } /* Start transfer */ - out_be32(&priv->dmatx->tail, (u32)&tx_bd); + writel((u32)&tx_bd, &priv->dmatx->tail); /* Wait for transmission to complete */ debug("axiemac: Waiting for tx to be done\n"); timeout = 200; - while (timeout && (!(in_be32(&priv->dmatx->status) & + while (timeout && (!(readl(&priv->dmatx->status) & (XAXIDMA_IRQ_DELAY_MASK | XAXIDMA_IRQ_IOC_MASK)))) { timeout--; udelay(1); @@ -549,10 +549,10 @@ static int isrxready(struct axidma_priv *priv) u32 status; /* Read pending interrupts */ - status = in_be32(&priv->dmarx->status); + status = readl(&priv->dmarx->status); /* Acknowledge pending interrupts */ - out_be32(&priv->dmarx->status, status & XAXIDMA_IRQ_ALL_MASK); + writel(status & XAXIDMA_IRQ_ALL_MASK, &priv->dmarx->status); /* * If Reception done interrupt is asserted, call RX call back function @@ -577,9 +577,9 @@ static int axiemac_recv(struct udevice *dev, int flags, uchar **packetp) debug("axiemac: RX data ready\n"); /* Disable IRQ for a moment till packet is handled */ - temp = in_be32(&priv->dmarx->control); + temp = readl(&priv->dmarx->control); temp &= ~XAXIDMA_IRQ_ALL_MASK; - out_be32(&priv->dmarx->control, temp); + writel(temp, &priv->dmarx->control); length = rx_bd.app4 & 0xFFFF; /* max length mask */ #ifdef DEBUG @@ -613,7 +613,7 @@ static int axiemac_free_pkt(struct udevice *dev, uchar *packet, int length) flush_cache((u32)&rxframe, sizeof(rxframe)); /* Rx BD is ready - start again */ - out_be32(&priv->dmarx->tail, (u32)&rx_bd); + writel((u32)&rx_bd, &priv->dmarx->tail); debug("axiemac: RX completed, framelength = %d\n", length);