Thread (18 messages) 18 messages, 6 authors, 15d ago

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

flat view

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2026-09-23 14:40:54
Also in: imx, linux-can, linux-m68k, linux-spi, lkml

Hi Andrew,

On Wed, 23 Sept 2026 at 16:16, Andrew Lunn [off-list ref] wrote:
quoted
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?
Unfortunately not.

Quoting Arnd:
   "fec is an exception to this because it happened to rely on the
    unusual macros: all the Arm SoCs using this hardware have little-endian
    registers (regardless of whether the CPU runs as BE or LE), while
    all the coldfire chips use big-endian registers (and don't support
    LE kernels). The powerpc variant of fec also uses big-endian registers
    but has a separate copy of the driver that hardcodes this. Other
    Freescale drivers already have a runtime endianess detection that
    is needed because they built both BE and LE variants of the hardware
    on Arm SoCs that could run the same kernel."

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help