[U-Boot] [PATCH 5/9] ARM: mx25: convert to common timer code

Rob Herring robherring2 at gmail.com
Mon Sep 9 23:00:51 CEST 2013


On Sun, Sep 8, 2013 at 6:56 PM, Benoît Thébaudeau
<benoit.thebaudeau at advansee.com> wrote:
> Dear Rob Herring,
>
> On Sunday, September 8, 2013 10:12:50 PM, Rob Herring wrote:
>> From: Rob Herring <rob.herring at calxeda.com>
>>
>> Convert mx25 to use the commmon timer code.
>>
>> Signed-off-by: Rob Herring <rob.herring at calxeda.com>
>> ---
> [...]
>> diff --git a/include/configs/mx25pdk.h b/include/configs/mx25pdk.h
>> index ccd3b6c..568ed6c 100644
>> --- a/include/configs/mx25pdk.h
>> +++ b/include/configs/mx25pdk.h
>> @@ -15,6 +15,9 @@
>>  #define CONFIG_SYS_TEXT_BASE         0x81200000
>>  #define CONFIG_MXC_GPIO
>>
>> +#define CONFIG_SYS_TIMER_RATE                32768
>                                                 ^
> MXC_CLK32 could be used here.

The problem the circular dependency that creates. MXC_CLK32 depends on
CONFIG_MX25_CLK32. Ordering could fix this, but


>> +#define CONFIG_SYS_TIMER_COUNTER     (IMX_GPT1_BASE + 0x24)
>
> This Linux-style (base + offset) register access is against U-Boot rules. You
> could write:
> (&((struct gpt_regs *)IMX_GPT1_BASE)->counter)

This may also have ordering issues. Including imx-regs.h just for the
base address doesn't work on mx27 for example.

Also, it seems like if u-boot is moving towards using kconfig, then
creating more include dependencies in the config headers is the wrong
direction.

Rob


More information about the U-Boot mailing list