[U-Boot] [PATCH v7 9/9] net: macb: Fix check for little-endian system in gmac_configure_dma()

Anup Patel anup at brainfault.org
Tue Jun 25 04:11:37 UTC 2019


On Mon, Jun 24, 2019 at 6:37 PM Ramon Fried <rfried.dev at gmail.com> wrote:
>
>
> On 6/24/19 4:02 PM, Daniel Schwierzeck wrote:
> > can't you simply remove the non-DM part of the driver and add a
> > device-tree property for the endianess?
> >
> > If that's not possible short-term, than maybe add a Kconfig symbol like this:
> >
> > config MACB_BIG_ENDIAN
> >     bool "...."
> >     depends on MACB
> >     default y if SYS_BIG_ENDIAN
> >     default n
> >
> > this way it's automatically sync'ed with
> > CONFIG_SYS_LITTLE_ENDIAN/CONFIG_SYS_BIG_ENDIAN, but a board config
> > could still override this setting.
>
> I can even do better, Linux for instance automatically detects the endianess for the CPU
> by writing to a scratch register on MACB HW and read it back.
>
> But I don't understand the need for a specific board to define anything different than the SYS_ENDIANES for this driver.

Yap, it's very easy to detect endianess at runtime. I will update this
patch accordingly.

Regards,
Anup


More information about the U-Boot mailing list