Re: [PATCH] mmu: fix ioremap for mcf54xx and mcf5441x

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 27, 2018 at 11:06:07PM +1000, Greg Ungerer wrote:

Hi Greg,

Hi Angelo,

On 27/02/18 05:50, Angelo Dureghello wrote:
Also, IO bus access should be big endian, since the general rule
is to swap eventually the bytes in hardware when little endian
peripherals are connected.

Reformatted readx/writex tabs.

You need to break this up into 3 separate patches.
You have 3 quite distinct logical changes being made here:

 1. fixing iomremap
 2. changing the behavior of IO buss access
 3. whitespace change


Ok, ack. I'll split into 3.


Signed-off-by: Angelo Dureghello <angelo@xxxxxxxx>
---
  arch/m68k/include/asm/io_mm.h | 12 ++++++------
  arch/m68k/mm/kmap.c           |  8 ++++++++
  2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch/m68k/include/asm/io_mm.h b/arch/m68k/include/asm/io_mm.h
index ed5333e87879..a0d44ea82c22 100644
--- a/arch/m68k/include/asm/io_mm.h
+++ b/arch/m68k/include/asm/io_mm.h
@@ -442,15 +442,15 @@ static inline void isa_delay(void)
  /*
   * These should be valid on any ioremap()ed region
   */
-#define readb(addr)      in_8(addr)
-#define writeb(val,addr) out_8((addr),(val))
-#define readw(addr)      in_le16(addr)
-#define writew(val,addr) out_le16((addr),(val))
+#define readb(addr)		in_8(addr)
+#define writeb(val, addr)	out_8((addr), (val))
+#define readw(addr)		in_be16(addr)
+#define writew(val, addr)	out_be16((addr), (val))
  #endif /* !CONFIG_ISA && !CONFIG_ATARI_ROM_ISA */
-#define readl(addr)      in_le32(addr)
-#define writel(val,addr) out_le32((addr),(val))
+#define readl(addr)		in_be32(addr)
+#define writel(val, addr)	out_be32((addr), (val))
  #define readsb(port, buf, nr)     raw_insb((port), (u8 *)(buf), (nr))
  #define readsw(port, buf, nr)     raw_insw((port), (u16 *)(buf), (nr))
diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c
index c2a38321c96d..e8ebfc44ee03 100644
--- a/arch/m68k/mm/kmap.c
+++ b/arch/m68k/mm/kmap.c
@@ -118,6 +118,14 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla
  	if (!size || physaddr > (unsigned long)(-size))
  		return NULL;
+#if defined(CONFIG_M54xx) || defined(CONFIG_M5441x)

I think this could be changed to "defined(CONFIG_COLDFIRE)". Currently all
ColdFire configured systems (MMU and non-MMU) will have a direct mapping
at the same physical address.

Ack.


+	/*
+	 * This ColdFire models maps IO space into ACR0_MODE,
+	 * so they can access IO space directly.
+	 */
+	return (void __iomem *)physaddr;
+#endif

Does this change also require a change to iounmap()?
It looks like it will try to free resources that it no longer allocates
afetr this change is made.


Likely yes, will fix it.

Regards
Greg



Thanks & regards,
Angelo

  #ifdef CONFIG_AMIGA
  	if (MACH_IS_AMIGA) {
  		if ((physaddr >= 0x40000000) && (physaddr + size < 0x60000000)


--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux