MIPS: CPC: provide functions to retrieve register addresses
authorPaul Burton <paul.burton@imgtec.com>
Fri, 14 Feb 2014 09:27:15 +0000 (09:27 +0000)
committerPaul Burton <paul.burton@imgtec.com>
Fri, 2 May 2014 15:39:14 +0000 (16:39 +0100)
This patch introduces addr_ functions in addition to the existing read_
& write_ functions. The new functions simply return the address of the
appropriate CPC register rather than performing a memory access. This
will be used in a subsequent patch.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
arch/mips/include/asm/mips-cpc.h

index 988507e46d42f837350b9a63e47180d7d39ae4b8..c5bb609c4b97c77ea1e534f255d1eb9dbb5edb2c 100644 (file)
@@ -72,7 +72,12 @@ static inline bool mips_cpc_present(void)
 #define MIPS_CPC_COCB_OFS      0x4000
 
 /* Macros to ease the creation of register access functions */
-#define BUILD_CPC_R_(name, off) \
+#define BUILD_CPC_R_(name, off)                                        \
+static inline u32 *addr_cpc_##name(void)                       \
+{                                                              \
+       return (u32 *)(mips_cpc_base + (off));                  \
+}                                                              \
+                                                               \
 static inline u32 read_cpc_##name(void)                                \
 {                                                              \
        return __raw_readl(mips_cpc_base + (off));              \
This page took 0.028689 seconds and 5 git commands to generate.