Re: [PATCHv3 1/3] net: fec: do not use readl()/writel() for ColdFire

From: Andrew Lunn

Date: Mon Sep 28 2026 - 10:13:06 EST


On Mon, Sep 28, 2026 at 10:59:52PM +1000, Greg Ungerer wrote:
>
> On 24/9/26 00:15, Andrew Lunn wrote:
> >> The driver will always need to support big and little endian hardware, so I
> >> am not sure how to avoid some abstraction like this.
> >
> > I was wondering if there is a linux standard set of macros which is
> > supposed to handle this big/little difference, the macro knows the
> > architecture and does the correct thing?
>
> There is regmap, but that is way more than just access macros.
> At least one driver shared across big and little endian architectures
> does use that - the freescale dspi driver (drivers/spi/spi-fsl-dspi.c).
> There is probably others.
>
> If the issue is more to do with code churn then a simpler approach here
> might be to just essentially keep the same work around but move it locally
> into fec.h. Something like the patch below.
>
> This could be cleaned up to use ioread32be()/iowrite32be() after the final
> readl()/writel() changes have been applied.

The changes are fine, i just did not know all the background and
wanted to make sure we were not missing something. Thanks for the
explanations.

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew