summaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/system_info.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-10-09 23:50:20 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-10-10 09:10:28 +0200
commit01525288b031e868f5b39b55f3ff4b10d67399c3 (patch)
treecebd240dfee6284785008cefef6d94ea80544bb6 /arch/arm/include/asm/system_info.h
parent7764b1facaaa50b3e3114991ec78858efe5e8b8d (diff)
downloadbarebox-01525288b031e868f5b39b55f3ff4b10d67399c3.tar.gz
barebox-01525288b031e868f5b39b55f3ff4b10d67399c3.tar.xz
ARM: Add cpu_architecture() function
Once we run on multiple SoCs we must know which arm architecture we are on. Add cpu_architecture() from the kernel to detect it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/include/asm/system_info.h')
-rw-r--r--arch/arm/include/asm/system_info.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/arch/arm/include/asm/system_info.h b/arch/arm/include/asm/system_info.h
new file mode 100644
index 0000000000..5b676313c0
--- /dev/null
+++ b/arch/arm/include/asm/system_info.h
@@ -0,0 +1,60 @@
+#ifndef __ASM_ARM_SYSTEM_INFO_H
+#define __ASM_ARM_SYSTEM_INFO_H
+
+#define CPU_ARCH_UNKNOWN 0
+#define CPU_ARCH_ARMv3 1
+#define CPU_ARCH_ARMv4 2
+#define CPU_ARCH_ARMv4T 3
+#define CPU_ARCH_ARMv5 4
+#define CPU_ARCH_ARMv5T 5
+#define CPU_ARCH_ARMv5TE 6
+#define CPU_ARCH_ARMv5TEJ 7
+#define CPU_ARCH_ARMv6 8
+#define CPU_ARCH_ARMv7 9
+
+#ifdef CONFIG_CPU_32v4T
+#ifdef ARM_ARCH
+#define ARM_MULTIARCH
+#else
+#define ARM_ARCH CPU_ARCH_ARMv4T
+#endif
+#endif
+
+#ifdef CONFIG_CPU_32v5
+#ifdef ARM_ARCH
+#define ARM_MULTIARCH
+#else
+#define ARM_ARCH CPU_ARCH_ARMv5
+#endif
+#endif
+
+#ifdef CONFIG_CPU_32v6
+#ifdef ARM_ARCH
+#define ARM_MULTIARCH
+#else
+#define ARM_ARCH CPU_ARCH_ARMv6
+#endif
+#endif
+
+#ifdef CONFIG_CPU_32v7
+#ifdef ARM_ARCH
+#define ARM_MULTIARCH
+#else
+#define ARM_ARCH CPU_ARCH_ARMv7
+#endif
+#endif
+
+#ifndef __ASSEMBLY__
+
+#ifdef ARM_MULTIARCH
+extern int __pure cpu_architecture(void);
+#else
+static inline int __pure cpu_architecture(void)
+{
+ return ARM_ARCH;
+}
+#endif
+
+#endif /* !__ASSEMBLY__ */
+
+#endif /* __ASM_ARM_SYSTEM_INFO_H */