Skip to contentSkip to conversation

imx: arch-mx6: add is_soc_type helper macro

PATCH New Adrian Alonso 1 participant 1 message Aug 25, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 imx: arch-mx6: add is_soc_type helper macro

Add helper macro is_soc_type to identify iMX SoC family

---
 arch/arm/include/asm/arch-imx/cpu.h       | 2 ++
 arch/arm/include/asm/arch-mx6/sys_proto.h | 3 +++
 2 files changed, 5 insertions(+)
arch/arm/include/asm/arch-imx/cpu.h +2 -0
index c7f9fff..033cd27 100644
@@ -16,6 +16,8 @@
 #define MXC_CPU_MX6DP		0x68
 #define MXC_CPU_MX6QP		0x69
 
+#define MXC_SOC_MX6		0x60
+
 #define CS0_128					0
 #define CS0_64M_CS1_64M				1
 #define CS0_64M_CS1_32M_CS2_32M			2
arch/arm/include/asm/arch-mx6/sys_proto.h +3 -0
index eee8ca8..24f69a3 100644
@@ -21,10 +21,13 @@ u32 get_cpu_temp_grade(int *minc, int *maxc);
 
 /* returns MXC_CPU_ value */
 #define cpu_type(rev) (((rev) >> 12) & 0xff)
+#define soc_type(rev) (((rev) >> 12) & 0xf0)
 
 /* both macros return/take MXC_CPU_ constants */
 #define get_cpu_type()	(cpu_type(get_cpu_rev()))
+#define get_soc_type()  (soc_type(get_cpu_rev()))
 #define is_cpu_type(cpu) (get_cpu_type() == cpu)
+#define is_soc_type(soc) (get_soc_type() == soc)
 
 const char *get_imx_type(u32 imxtype);
 unsigned imx_ddr_size(void);
Signature · 1 line
2.1.4