[U-Boot] [PATCH V3 1/5] i.MX5x: define cpu_type() to return processor portion of cpu rev.

Stefano Babic sbabic at denx.de
Mon Nov 18 11:42:58 CET 2013


Hi Eric,

On 17/11/2013 18:17, Eric Nelson wrote:
> Signed-off-by: Eric Nelson <eric.nelson at boundarydevices.com>
> ---
> This patch is new in V3
> 
>  arch/arm/include/asm/arch-mx5/sys_proto.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/include/asm/arch-mx5/sys_proto.h b/arch/arm/include/asm/arch-mx5/sys_proto.h
> index 9949ad1..9dad5fc 100644
> --- a/arch/arm/include/asm/arch-mx5/sys_proto.h
> +++ b/arch/arm/include/asm/arch-mx5/sys_proto.h
> @@ -17,6 +17,10 @@
>  
>  #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)
> +

There is already a get_cpu_type() for other architectures (OMAP). We do
not need to reinvent the wheel this time, and it is correct to add
get_cpu_type(void) to sys_proto.h.

This lets also easier to understand the code because it can be directly
derived from the User's Manual: shifting 12 bit in your macro is only
because this is done in get_cpu_rev(), not because this is the offset in
the i.MX6 register.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the U-Boot mailing list