m68k: fix read/write multi-byte IO for PCI on ColdFire
authorGreg Ungerer <gerg@linux-m68k.org>
Fri, 30 Mar 2018 13:40:31 +0000 (23:40 +1000)
committerGreg Ungerer <gerg@linux-m68k.org>
Sun, 27 May 2018 23:45:26 +0000 (09:45 +1000)
commit4d53037876277fbba10f47de7b90d3a873c5d12b
treee79703184ec4066f0034c47b988cc8fb2aff3afe
parentdf8f77dec74319794eff9a93d68ada7998b0d510
m68k: fix read/write multi-byte IO for PCI on ColdFire

We need to treat built-in peripherals and bus based address ranges
differently. Local built-in peripherals (and the ColdFire SoC parts
have quite a lot of them) are always native endian - which is big
endian on m68k/ColdFire. Bus based address ranges, like the PCI bus,
are accessed little endian - so we need to byte swap those.

So implement readw/writew and readl/writel functions to deal with
memory mapped accesses correctly based on the address range being
accessed.

This fixes readw/writew and readl/writel so that they can be used in
drivers for native SoC hardware modules (many of which are shared with
other architectures (ARM in Freescale SoC parts for example). And also
drivers for PCI devices.

Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
Tested-by: Angelo Dureghello <angelo@sysam.it>
arch/m68k/include/asm/io_no.h