public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg@linux-m68k.org>
To: linux-m68k@lists.linux-m68k.org
Cc: arnd@kernel.org, Greg Ungerer <gerg@linux-m68k.org>
Subject: m68k: coldfire: create internal register access defines
Date: Thu, 30 Apr 2026 15:19:16 +1000	[thread overview]
Message-ID: <20260430052047.1827575-1-gerg@linux-m68k.org> (raw)


The readx/writex family of IO access functions for ColdFire are
non-standard. They return native endian data for multi-byte access,
which on m68k/ColdFire is big-endian byte order. A number of places
need fixing to change readx/writex to be more standard - a lot of
the CPU/SoC architecture specific code and a number of drivers.

The existing ColdFire CPU/SoC architecture code is inconsistent in
how it accesses SoC hardware module registers. Both readx/writex
and __raw_readx/__raw_writex are used across the code base. To clean
this up this set of patches moves to an internal set of access
defines for the CPU/SoC architecture code. The following are defined
and used for all internal register access:

    8 bit read  -->  mcf_read8
    8 bit write -->  mcf_write8
   16 bit read  -->  mcf_read16
   16 bit write -->  mcf_write16
   32 bit read  -->  mcf_read32
   32 bit write -->  mcf_write32

To ease review I have broken the changes up a little, grouping major
blocks together instead of one huge patch.

Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
 arch/m68k/coldfire/clk.c        |    8 +-
 arch/m68k/coldfire/device.c     |    8 +-
 arch/m68k/coldfire/dma_timer.c  |   12 +--
 arch/m68k/coldfire/intc-2.c     |   30 ++++-----
 arch/m68k/coldfire/intc-5249.c  |   10 +--
 arch/m68k/coldfire/intc-525x.c  |   12 +--
 arch/m68k/coldfire/intc-5272.c  |   20 +++---
 arch/m68k/coldfire/intc-simr.c  |   38 ++++++------
 arch/m68k/coldfire/intc.c       |   28 ++++-----
 arch/m68k/coldfire/m5206.c      |    2
 arch/m68k/coldfire/m520x.c      |   26 ++++----
 arch/m68k/coldfire/m523x.c      |   12 +--
 arch/m68k/coldfire/m5249.c      |   16 ++---
 arch/m68k/coldfire/m525x.c      |   12 +--
 arch/m68k/coldfire/m5272.c      |   16 ++---
 arch/m68k/coldfire/m527x.c      |   40 ++++++-------
 arch/m68k/coldfire/m528x.c      |   28 ++++-----
 arch/m68k/coldfire/m5307.c      |    2
 arch/m68k/coldfire/m53xx.c      |  122 ++++++++++++++++++++--------------------
 arch/m68k/coldfire/m5407.c      |    2
 arch/m68k/coldfire/m5441x.c     |   12 +--
 arch/m68k/coldfire/m54xx.c      |   18 ++---
 arch/m68k/coldfire/nettel.c     |   16 ++---
 arch/m68k/coldfire/pci.c        |   56 +++++++++---------
 arch/m68k/coldfire/pit.c        |   20 +++---
 arch/m68k/coldfire/reset.c      |    4 -
 arch/m68k/coldfire/sltimers.c   |   18 ++---
 arch/m68k/coldfire/stmark2.c    |   12 +--
 arch/m68k/coldfire/timers.c     |   38 ++++++------
 arch/m68k/include/asm/io_no.h   |   16 +++++
 arch/m68k/include/asm/mcfgpio.h |   12 +--
 arch/m68k/include/asm/nettel.h  |    4 -


             reply	other threads:[~2026-04-30  5:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30  5:19 Greg Ungerer [this message]
2026-04-30  5:19 ` [PATCH 1/7] m68k: coldfire: create IO access functions for internal registers Greg Ungerer
2026-04-30  7:13   ` Geert Uytterhoeven
2026-04-30  7:20     ` Arnd Bergmann
2026-04-30 11:10       ` Greg Ungerer
2026-04-30  5:19 ` [PATCH 2/7] m68k: coldfire: use ColdFire specific IO access in headers Greg Ungerer
2026-04-30  5:19 ` [PATCH 3/7] m68k: coldfire: use ColdFire specifc IO access in interrupt code Greg Ungerer
2026-04-30  5:19 ` [PATCH 4/7] m68k: coldfire: use ColdFire specifc IO access in timer code Greg Ungerer
2026-04-30  5:19 ` [PATCH 5/7] m68k: coldfire: rename timer register access defines Greg Ungerer
2026-04-30  5:19 ` [PATCH 6/7] m68k: coldfire: use ColdFire specifc IO access in system code Greg Ungerer
2026-04-30  5:19 ` [PATCH 7/7] m68k: coldfire: use ColdFire specifc IO access in SoC code Greg Ungerer
2026-04-30  7:39 ` m68k: coldfire: create internal register access defines Arnd Bergmann
2026-04-30 11:22   ` Greg Ungerer
2026-04-30 11:37     ` Arnd Bergmann

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=20260430052047.1827575-1-gerg@linux-m68k.org \
    --to=gerg@linux-m68k.org \
    --cc=arnd@kernel.org \
    --cc=linux-m68k@lists.linux-m68k.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox