All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <hancock@sedsystems.ca>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, anirudh@xilinx.com, John.Linn@xilinx.com
Subject: Re: [PATCH net-next 01/13] net: axienet: Fixed 64-bit compile, enable build on X86 and ARM
Date: Fri, 31 May 2019 17:28:45 -0600	[thread overview]
Message-ID: <94beef09-4ec9-194b-b8ed-47032c586b50@sedsystems.ca> (raw)
In-Reply-To: <20190531211043.GD3154@lunn.ch>

On 2019-05-31 3:10 p.m., Andrew Lunn wrote:
>>  static inline u32 axienet_ior(struct axienet_local *lp, off_t offset)
>>  {
>> -	return in_be32(lp->regs + offset);
>> +#ifdef CONFIG_MICROBLAZE
>> +	return __raw_readl(lp->regs + offset);
>> +#else
>> +	return ioread32(lp->regs + offset);
>> +#endif
>>  }
> 
> Please dig deeper into the available accessor functions. There should
> be a set which works without this #defery. 

This driver previously only compiled on MicroBlaze, and on that
platform, in_be32 is mapped to __raw_readl which reads with no byte
swapping. The confusing this is that MicroBlaze can apparently be set up
as either LE or BE, so I'm guessing that the hardware setup just
arranges that the reads are natively in the right byte order depending
on the mode. If I were to just use ioread32, there would be no change on
LE Microblaze, but BE Microblaze would start byte-swapping, which I
assume would break things.

The Xilinx version of this driver also supports Zynq (arm) and ZynqMP
(aarch64) platforms, and for those platforms it defines in_be32 to
__raw_readl as well. Since those are little-endian that ends up being
the same byte order as ioread32.

Finally, the setup we're using this hardware with on ARM over a PCIe to
AXI bridge exposes the device with the same byte order as any other PCIe
device, so the regular ioread32 accessors are correct.

I'm not quite sure what to make of that.. most platforms either would
need or work fine with the "regular" accessors, but I'm not sure that
wouldn't break big-endian MicroBlaze. It would be useful if one of the
Xilinx people could confirm that..

-- 
Robert Hancock
Senior Software Developer
SED Systems, a division of Calian Ltd.
Email: hancock@sedsystems.ca

  reply	other threads:[~2019-05-31 23:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 18:15 [PATCH net-next 00/13] Xilinx axienet driver updates Robert Hancock
2019-05-31 18:15 ` [PATCH net-next 01/13] net: axienet: Fixed 64-bit compile, enable build on X86 and ARM Robert Hancock
2019-05-31 21:10   ` Andrew Lunn
2019-05-31 23:28     ` Robert Hancock [this message]
2019-06-01  3:04       ` Andrew Lunn
2019-06-02  6:37   ` kbuild test robot
2019-05-31 18:15 ` [PATCH net-next 02/13] net: axienet: clean up MDIO handling Robert Hancock
2019-05-31 21:13   ` Andrew Lunn
2019-05-31 18:15 ` [PATCH net-next 03/13] net: axienet: Cleanup DMA device reset and halt process Robert Hancock
2019-05-31 18:15 ` [PATCH net-next 04/13] net: axienet: Make RX/TX ring sizes configurable Robert Hancock
2019-05-31 18:15 ` [PATCH net-next 05/13] net: axienet: Add DMA registers to ethtool register dump Robert Hancock
2019-05-31 18:15 ` [PATCH net-next 06/13] net: axienet: Support shared interrupts Robert Hancock
2019-05-31 18:15 ` [PATCH net-next 07/13] net: axienet: Add optional support for Ethernet core interrupt Robert Hancock
2019-05-31 18:15 ` [PATCH net-next 08/13] net: axienet: Fix race condition causing TX hang Robert Hancock
2019-05-31 18:15 ` [PATCH net-next 09/13] net: axienet: Make missing MAC address non-fatal Robert Hancock
2019-05-31 21:16   ` Andrew Lunn
2019-06-03 13:22   ` David Laight
2019-06-03 15:49     ` Robert Hancock
2019-05-31 18:15 ` [PATCH net-next 10/13] net: axienet: stop interface during shutdown Robert Hancock
2019-05-31 18:15 ` [PATCH net-next 11/13] net: axienet: document axistream-connected attribute Robert Hancock
2019-05-31 18:15 ` [PATCH net-next 12/13] net: axienet: make use of axistream-connected attribute optional Robert Hancock
2019-05-31 18:15 ` [PATCH net-next 13/13] net: axienet: convert to phylink API Robert Hancock

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=94beef09-4ec9-194b-b8ed-47032c586b50@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.