[PATCH 4/6] arm: mx5: always use __mxc_cpu_type to check cpu type

Richard Zhao linuxzsc at gmail.com
Thu Dec 9 02:52:01 EST 2010


2010/12/9 Uwe Kleine-König <u.kleine-koenig at pengutronix.de>:
> On Thu, Dec 09, 2010 at 10:08:34PM +0800, Richard Zhao wrote:
>> Every SoC in mach-mx5 calls mxc_set_cpu_type to set cpu type.
> I don't like that.  Your change makes the usage of cpu_is_mx51() for
> single-machine builds more expensive.
You're right. I'll add the below like other SoCs:
#ifdef CONFIG_SOC_IMX51
..
#else
# define cpu_is_mx51()          (mxc_cpu_type == MXC_CPU_MX51)
#endif

can I remove cpu_is_mx53 definition?  because CONFIG_SOC_IMX53 is
undefined yet. Dinh can add it back when he send out other commits.

Thanks
Richard
>
>>
>> Signed-off-by: Richard Zhao <richard.zhao at freescale.com>
>> ---
>>  arch/arm/plat-mxc/include/mach/mxc.h |    4 +---
>>  1 files changed, 1 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/plat-mxc/include/mach/mxc.h
>> index 4abbdd1..04afa33 100644
>> --- a/arch/arm/plat-mxc/include/mach/mxc.h
>> +++ b/arch/arm/plat-mxc/include/mach/mxc.h
>> @@ -129,10 +129,8 @@ extern unsigned int __mxc_cpu_type;
>>  #ifdef CONFIG_ARCH_MX5
>>  # ifdef mxc_cpu_type
>>  #  undef mxc_cpu_type
>> -#  define mxc_cpu_type __mxc_cpu_type
>> -# else
>> -#  define mxc_cpu_type MXC_CPU_MX51
>>  # endif
>> +# define mxc_cpu_type __mxc_cpu_type
>>  # define cpu_is_mx51()               (mxc_cpu_type == MXC_CPU_MX51)
>>  # define cpu_is_mx53()               (mxc_cpu_type == MXC_CPU_MX53)
>>  #else
> Here is a bug.  cpu_is_mx53 will never be true for a mx5-only build.
> (That is currently always true for images supporting mx5.)
>
> Uwe
>
> --
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
>



More information about the linux-arm-kernel mailing list