From 1ca244ded50de4b5f39ded2793a02fe5f17f9ba6 Mon Sep 17 00:00:00 2001 From: Eric Nelson Date: Thu, 29 Aug 2013 10:57:10 -0700 Subject: [PATCH] i.MX6: Add convenience macros cpu_type(rev) and is_cpu_type(cpu) Signed-off-by: Eric Nelson Acked-by: Stefano Babic --- arch/arm/include/asm/arch-mx6/sys_proto.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/include/asm/arch-mx6/sys_proto.h b/arch/arm/include/asm/arch-mx6/sys_proto.h index bfdfd2911d..8c21364e71 100644 --- a/arch/arm/include/asm/arch-mx6/sys_proto.h +++ b/arch/arm/include/asm/arch-mx6/sys_proto.h @@ -19,6 +19,13 @@ #define is_soc_rev(rev) ((get_cpu_rev() & 0xFF) - rev) u32 get_cpu_rev(void); + +/* returns MXC_CPU_ value */ +#define cpu_type(rev) (((rev) >> 12)&0xff) + +/* use with MXC_CPU_ constants */ +#define is_cpu_type(cpu) (cpu_type(get_cpu_rev()) == cpu) + const char *get_imx_type(u32 imxtype); unsigned imx_ddr_size(void); -- 2.39.5