Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Greg Ungerer <gerg@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org,
	arnd@kernel.org, wei.fang@nxp.com, frank.li@nxp.com,
	shenwei.wang@nxp.com, imx@lists.linux.dev,
	netdev@vger.kernel.org, nico@fluxnic.net,
	adureghello@baylibre.com, ulfh@kernel.org,
	linux-mmc@vger.kernel.org, linux-can@vger.kernel.org,
	linux-spi@vger.kernel.org, olteanv@gmail.com
Subject: Re: [PATCHv2 1/4] net: fec: do not use readl()/writel() for ColdFire
Date: Wed, 10 Jun 2026 10:05:30 +0200	[thread overview]
Message-ID: <caa2a34c-5a73-4075-9f7f-77b30673a4e2@lunn.ch> (raw)
In-Reply-To: <20260609142139.1563360-3-gerg@linux-m68k.org>

On Wed, Jun 10, 2026 at 12:12:58AM +1000, Greg Ungerer wrote:
> Modify the FEC driver to not directly use readl() and writel() to access
> hardware registers but instead local fec_readl() and fec_writel() methods.
> This allows for different architecture users of this driver to have
> different underlying access functions - to support both little and big
> endian hardware.
> 
> The FEC hardware block in ColdFire SoC parts is accessed big-endian.
> The usual kernel readl()/writel() IO memory access methods are defined to
> access little endian data. Change access for ColdFire to use __raw_readl()
> and __raw_writel() access methods - which do not modify or swap bytes
> on access.
> 
> The FEC driver works today because the m68k architecture io.h has a
> kludge in the definitions of the readl() and writel() functions for
> ColdFire that allow big-endian access if the address of the register to
> access is within the SoC's internal peripheral registers. This is being
> fixed in the near future to define readl() and writel() correctly - with
> no byte swapping. Thus the motivation for this fix here.
> 
> __raw_readl()/__raw_writel() access methods are used instead of the more
> commonly used ioread32be()/iowrite32be() here because those are broken too,
> because of the current readl()/writel() kludge. They are implemented in
> asm-generic/io.h in terms of readl()/writel().
> 
> Note that even when readl() and writel() are fixed on ColdFire they will
> not be the right thing to use within the FEC driver on ColdFire hardware.
> 
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

  reply	other threads:[~2026-06-10  8:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 14:12 [PATCHv2 0/4] m68k: coldfire: fix non-standard readX()/writeX() functions Greg Ungerer
2026-06-09 14:12 ` [PATCHv2 1/4] net: fec: do not use readl()/writel() for ColdFire Greg Ungerer
2026-06-10  8:05   ` Andrew Lunn [this message]
2026-06-09 14:12 ` [PATCHv2 2/4] net: smc91x: do not use readw()/writew() on ColdFire platforms Greg Ungerer
2026-06-09 14:13 ` [PATCHv2 3/4] mmc: sdhci-esdhc-mcf: do not use readl()/writel() on ColdFire Greg Ungerer
2026-06-09 14:13 ` [PATCHv2 4/4] m68k: coldfire: fix non-standard readX()/writeX() functions Greg Ungerer
2026-06-09 15:26   ` Frank Li
2026-06-13  9:22 ` [PATCHv2 0/4] " Paolo Abeni

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=caa2a34c-5a73-4075-9f7f-77b30673a4e2@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=adureghello@baylibre.com \
    --cc=arnd@kernel.org \
    --cc=frank.li@nxp.com \
    --cc=gerg@linux-m68k.org \
    --cc=imx@lists.linux.dev \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nico@fluxnic.net \
    --cc=olteanv@gmail.com \
    --cc=shenwei.wang@nxp.com \
    --cc=ulfh@kernel.org \
    --cc=wei.fang@nxp.com \
    /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