aboutsummaryrefslogtreecommitdiff
path: root/include/asm-arm/arch-ixp4xx/cpu.h
diff options
context:
space:
mode:
authorKrzysztof Halasa <khc@pm.waw.pl>2007-12-18 03:53:27 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-02-04 13:15:25 +0000
commitc18f65816ef80b67eb4511ed8359c2dfcd69680d (patch)
tree4802b4316796b8dbee051d2a36064e221249f8df /include/asm-arm/arch-ixp4xx/cpu.h
parenta9a424ce9a209155f3d4b9f8ceba50cdebb7769b (diff)
[ARM] 4712/2: Adds functions to read and write IXP4xx "feature" bits
Adds functions to read and write IXP4xx "feature" (aka "fuse") bits, containing information about available/enabled CPU features. The uncompress.h included by boot/compressed/misc.c resides in a different space than rest of the kernel and thus can't use asm/hardware.h (including asm/arch/cpu.h - which, in turn, may use EXPORTed symbol "processor_id"). Posted to linux-arm-kernel on 2 Dec 2007 and revised. Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm/arch-ixp4xx/cpu.h')
-rw-r--r--include/asm-arm/arch-ixp4xx/cpu.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/asm-arm/arch-ixp4xx/cpu.h b/include/asm-arm/arch-ixp4xx/cpu.h
index d2523b326c6..2fa3d6b8dbb 100644
--- a/include/asm-arm/arch-ixp4xx/cpu.h
+++ b/include/asm-arm/arch-ixp4xx/cpu.h
@@ -28,4 +28,19 @@ extern unsigned int processor_id;
#define cpu_is_ixp46x() ((processor_id & IXP4XX_PROCESSOR_ID_MASK) == \
IXP465_PROCESSOR_ID_VALUE)
+static inline u32 ixp4xx_read_feature_bits(void)
+{
+ unsigned int val = ~*IXP4XX_EXP_CFG2;
+ val &= ~IXP4XX_FEATURE_RESERVED;
+ if (!cpu_is_ixp46x())
+ val &= ~IXP4XX_FEATURE_IXP46X_ONLY;
+
+ return val;
+}
+
+static inline void ixp4xx_write_feature_bits(u32 value)
+{
+ *IXP4XX_EXP_CFG2 = ~value;
+}
+
#endif /* _ASM_ARCH_CPU_H */