diff mbox

[U-Boot,v2,01/13] imx: arch-mx6: add is_soc_type helper macro

Message ID 1441220064-20866-1-git-send-email-aalonso@freescale.com
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show

Commit Message

Adrian Alonso Sept. 2, 2015, 6:54 p.m. UTC
Add helper macro is_soc_type to identify iMX SoC family

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
---
Changes for V2: Rework for common sys_proto header file
Changes for V3: Rework for latest master

 arch/arm/include/asm/arch-imx/cpu.h         | 2 ++
 arch/arm/include/asm/imx-common/sys_proto.h | 3 +++
 2 files changed, 5 insertions(+)

Comments

Stefano Babic Sept. 13, 2015, 8:13 a.m. UTC | #1
Hi Adrian,

thanks for pushing mx7 !

On 02/09/2015 20:54, Adrian Alonso wrote:
> Add helper macro is_soc_type to identify iMX SoC family
> 
> Signed-off-by: Adrian Alonso <aalonso@freescale.com>
> ---
> Changes for V2: Rework for common sys_proto header file
> Changes for V3: Rework for latest master
> 
>  arch/arm/include/asm/arch-imx/cpu.h         | 2 ++
>  arch/arm/include/asm/imx-common/sys_proto.h | 3 +++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h
> index 1c8d24e..416905a 100644
> --- a/arch/arm/include/asm/arch-imx/cpu.h
> +++ b/arch/arm/include/asm/arch-imx/cpu.h
> @@ -23,6 +23,8 @@
>  #define MXC_CPU_MX6QP		0x69
>  #define MXC_CPU_VF610		0xF6 /* dummy ID */
>  
> +#define MXC_SOC_MX6		0x60
> +
>  #define CS0_128					0
>  #define CS0_64M_CS1_64M				1
>  #define CS0_64M_CS1_32M_CS2_32M			2
> diff --git a/arch/arm/include/asm/imx-common/sys_proto.h b/arch/arm/include/asm/imx-common/sys_proto.h
> index 6954ee9..250f3f4 100644
> --- a/arch/arm/include/asm/imx-common/sys_proto.h
> +++ b/arch/arm/include/asm/imx-common/sys_proto.h
> @@ -17,9 +17,12 @@
>  
>  /* 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)
>  
>  #define is_mx6dqp() (is_cpu_type(MXC_CPU_MX6QP) || is_cpu_type(MXC_CPU_MX6DP))
>  


Applied to u-boot-imx,  thanks !

Best regards,
Stefano Babic
diff mbox

Patch

diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h
index 1c8d24e..416905a 100644
--- a/arch/arm/include/asm/arch-imx/cpu.h
+++ b/arch/arm/include/asm/arch-imx/cpu.h
@@ -23,6 +23,8 @@ 
 #define MXC_CPU_MX6QP		0x69
 #define MXC_CPU_VF610		0xF6 /* dummy ID */
 
+#define MXC_SOC_MX6		0x60
+
 #define CS0_128					0
 #define CS0_64M_CS1_64M				1
 #define CS0_64M_CS1_32M_CS2_32M			2
diff --git a/arch/arm/include/asm/imx-common/sys_proto.h b/arch/arm/include/asm/imx-common/sys_proto.h
index 6954ee9..250f3f4 100644
--- a/arch/arm/include/asm/imx-common/sys_proto.h
+++ b/arch/arm/include/asm/imx-common/sys_proto.h
@@ -17,9 +17,12 @@ 
 
 /* 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)
 
 #define is_mx6dqp() (is_cpu_type(MXC_CPU_MX6QP) || is_cpu_type(MXC_CPU_MX6DP))