[U-Boot] [PATCH 1/5] imx: gpt: Add 24Mhz OSC clock source support for GPT

Stefano Babic sbabic at denx.de
Mon Oct 27 15:23:00 CET 2014


Hi Ye,

On 27/10/2014 14:58, Li Ye-B37916 wrote:
> Hi Stefano,
> 
> On 10/27/2014 7:18 PM, Stefano Babic wrote:
>> Hi Ye,
>>
>> On 27/10/2014 05:10, Li Ye-B37916 wrote:
>>> The patch is used to add a choice for GPT clock source to provide high frequency clock.  The configuration "CONFIG_MXC_GPT_HCLK" is not dependent on the chip version. Even it is i.MX28, it is ok to set the configuration.
>> Ok, thanks for clarification.
>>
>>> The implementation has handled the differences between the chips.
>>> Most of i.MX6 series supports to use 24Mhz OSC as its high clock source (except MX6Q/D Rev 1.0 and MX6SL).  So for i.MX6, the implementation uses the 24Mhz OSC.
>>> For others (the time.c only compiles for i.MX5 and i.MX6, so the other is i.MX5),  they don't have 24Mhz OSC source for GPT. When the configuration is set, we use perclk instead.
>> It should be not bad if you check for MX5 and CONFIG_MXC_GPT_HCLK and
>> raise an error at compile time. This configuration is wrong and the
>> error should be reported and not hidden at runtime.
> 
> No, this configuration is not wrong for MX5. When it is set on MX5, the implementation uses preclk as the clock source to generate a high frequency GPT.  

I see - in this case you defined GPTCR_CLKSOURCE_PRE. Ok, got it.

> 
>>> I feel the patch subject need to modify, like "add HCLK clock source for GPT", then people may not confuse.
>> Agree, do it.
>>
>>>>> MX6Q/D Rev 1.0 and MX6SL can't use the 24Mhz OSC clock source option,
>>>>> so select the perclk for them. For MX6SL, we will set the OSC 24Mhz to
>>>>> perclk in CCM, so eventually the clock comes from OSC 24Mhz.
>>>>>
>>>> I am trying to understand. The explanation here does not reflect in the
>>>> implementation.  From the implementation, it is possible to set it even
>>>> with wrong revision.
>>> As explained above, the implementation has handled the differences. Users does not need to care the revision. For example, when the image runs on a  MX6Q/D Rev 1.0 chip, the perclk will be selected not the 24Mhz OSC.
>>>
>>>> Anyway, I do not think it is correct to put it as a configuration
>>>> option. This makes that we need different binaries for different
>>>> revisions of the SOC. It should be checked at runtime if the revision is
>>>> correct to set this clock as source. gpt_has_clk_source_osc has a check,
>>>> but does it make sense that CONFIG_MXC_GPT_HCLK can be set in any case ?
>>> Only i.MX5 and i.MX6 uses the GPT driver. I think the CONFIG_MXC_GPT_HCLK can be set in any case.
>> Well, but if does not make sense for i.MX5, why do we have to accept it ?
> 
> The MX5 can also have a high frequency GPT. The difference is it uses another clock source "preclk" than the "24Mhz OSC" used for iMX6.

Fine.


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