[Top] [All Lists]

Re: [PATCH 2/2] MIPS: add readl/write_be

To: Ralf Baechle <>
Subject: Re: [PATCH 2/2] MIPS: add readl/write_be
From: Florian Fainelli <>
Date: Wed, 16 Dec 2009 11:29:06 +0100
Cc: Geert Uytterhoeven <>, Thomas Bogendoerfer <>,, Maxime Bizon <>
In-reply-to: <>
Organization: Freebox
Original-recipient: rfc822;
References: <> <> <>
User-agent: KMail/1.12.2 (Linux/2.6.31-16-server; KDE/4.3.2; x86_64; ; )
From: Florian Fainelli <>
Subject: [PATCH v3] MIPS: add readl/write_be accessors

MIPS currently lacks the readl_be and writel_be accessors
which are required by BCM63xx for OHCI and EHCI support.
Let's define them globally for MIPS. This also fixes the
compilation of the bcm63xx defconfig against USB.

Signed-off-by: Florian Fainelli <>
diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index 436878e..65d7843 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -447,6 +447,9 @@ __BUILDIO(q, u64)
 #define readl_relaxed                  readl
 #define readq_relaxed                  readq
+#define readl_be(addr)                 be32_to_cpu(__raw_readl((__force 
unsigned *)(addr)))
+#define writel_be(val, addr)           __raw_writel(cpu_to_be32((val)), 
(__force unsigned *)(addr))
  * Some code tests for these symbols

<Prev in Thread] Current Thread [Next in Thread>