netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Hancock <hancock@sedsystems.ca>
To: netdev@vger.kernel.org
Cc: anirudh@xilinx.com, John.Linn@xilinx.com, andrew@lunn.ch,
	Robert Hancock <hancock@sedsystems.ca>
Subject: [PATCH net-next v4 02/20] net: axienet: Use standard IO accessors
Date: Wed,  5 Jun 2019 14:42:15 -0600	[thread overview]
Message-ID: <1559767353-17301-3-git-send-email-hancock@sedsystems.ca> (raw)
In-Reply-To: <1559767353-17301-1-git-send-email-hancock@sedsystems.ca>

This driver was using in_be32 and out_be32 IO accessors which do not
exist on most platforms. Also, the use of big-endian accessors does not
seem correct as this hardware is accessed over an AXI bus which, to the
extent it has an endian-ness, is little-endian. Switch to standard
ioread32/iowrite32 accessors.

Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
---
 drivers/net/ethernet/xilinx/xilinx_axienet.h      | 4 ++--
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h
index e09dc14..d82e3b6 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet.h
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h
@@ -476,7 +476,7 @@ struct axienet_option {
  */
 static inline u32 axienet_ior(struct axienet_local *lp, off_t offset)
 {
-	return in_be32(lp->regs + offset);
+	return ioread32(lp->regs + offset);
 }
 
 static inline u32 axinet_ior_read_mcr(struct axienet_local *lp)
@@ -496,7 +496,7 @@ static inline u32 axinet_ior_read_mcr(struct axienet_local *lp)
 static inline void axienet_iow(struct axienet_local *lp, off_t offset,
 			       u32 value)
 {
-	out_be32((lp->regs + offset), value);
+	iowrite32(value, lp->regs + offset);
 }
 
 /* Function prototypes visible in xilinx_axienet_mdio.c for other files */
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 1bace60..55beca1 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -125,7 +125,7 @@
  */
 static inline u32 axienet_dma_in32(struct axienet_local *lp, off_t reg)
 {
-	return in_be32(lp->dma_regs + reg);
+	return ioread32(lp->dma_regs + reg);
 }
 
 /**
@@ -140,7 +140,7 @@ static inline u32 axienet_dma_in32(struct axienet_local *lp, off_t reg)
 static inline void axienet_dma_out32(struct axienet_local *lp,
 				     off_t reg, u32 value)
 {
-	out_be32((lp->dma_regs + reg), value);
+	iowrite32(value, lp->dma_regs + reg);
 }
 
 /**
-- 
1.8.3.1


  parent reply	other threads:[~2019-06-05 20:42 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05 20:42 [PATCH net-next v4 00/20] Xilinx axienet driver updates (v4) Robert Hancock
2019-06-05 20:42 ` [PATCH net-next v4 01/20] net: axienet: Fix casting of pointers to u32 Robert Hancock
2019-06-05 20:42 ` Robert Hancock [this message]
2019-06-06 14:12   ` [PATCH net-next v4 02/20] net: axienet: Use standard IO accessors Andrew Lunn
2019-06-05 20:42 ` [PATCH net-next v4 03/20] net: axienet: fix MDIO bus naming Robert Hancock
2019-06-06 14:12   ` Andrew Lunn
2019-06-05 20:42 ` [PATCH net-next v4 04/20] net: axienet: add X86 and ARM as supported platforms Robert Hancock
2019-06-05 20:42 ` [PATCH net-next v4 05/20] net: axienet: Use clock framework to get device clock rate Robert Hancock
2019-06-05 20:42 ` [PATCH net-next v4 06/20] net: axienet: fix teardown order of MDIO bus Robert Hancock
2019-06-05 20:42 ` [PATCH net-next v4 07/20] net: axienet: Re-initialize MDIO registers properly after reset Robert Hancock
2019-06-06 21:05   ` David Miller
2019-06-05 20:42 ` [PATCH net-next v4 08/20] net: axienet: Cleanup DMA device reset and halt process Robert Hancock
2019-06-05 20:42 ` [PATCH net-next v4 09/20] net: axienet: Make RX/TX ring sizes configurable Robert Hancock
2019-06-05 20:42 ` [PATCH net-next v4 10/20] net: axienet: Add DMA registers to ethtool register dump Robert Hancock
2019-06-05 20:42 ` [PATCH net-next v4 11/20] net: axienet: Support shared interrupts Robert Hancock
2019-06-05 20:42 ` [PATCH net-next v4 12/20] net: axienet: Add optional support for Ethernet core interrupt Robert Hancock
2019-06-06 21:06   ` David Miller
2019-06-05 20:42 ` [PATCH net-next v4 13/20] net: axienet: Fix race condition causing TX hang Robert Hancock
2019-06-05 20:42 ` [PATCH net-next v4 14/20] net: axienet: Make missing MAC address non-fatal Robert Hancock
2019-06-05 20:42 ` [PATCH net-next v4 15/20] net: axienet: stop interface during shutdown Robert Hancock
2019-06-05 20:42 ` [PATCH net-next v4 16/20] net: axienet: document device tree mdio child node Robert Hancock
2019-06-06 14:16   ` Andrew Lunn
2019-06-05 20:42 ` [PATCH net-next v4 17/20] net: axienet: Fix MDIO bus parent node detection Robert Hancock
2019-06-05 20:42 ` [PATCH net-next v4 18/20] net: axienet: document axistream-connected attribute Robert Hancock
2019-06-05 20:42 ` [PATCH net-next v4 19/20] net: axienet: make use of axistream-connected attribute optional Robert Hancock
2019-06-05 20:42 ` [PATCH net-next v4 20/20] net: axienet: convert to phylink API Robert Hancock
2019-06-06 21:07   ` David Miller
2019-06-06 21:03 ` [PATCH net-next v4 00/20] Xilinx axienet driver updates (v4) David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1559767353-17301-3-git-send-email-hancock@sedsystems.ca \
    --to=hancock@sedsystems.ca \
    --cc=John.Linn@xilinx.com \
    --cc=andrew@lunn.ch \
    --cc=anirudh@xilinx.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).