[PATCH] timer: bcmbca: Add Broadcom BCMBCA timer support
William Zhang
william.zhang at broadcom.com
Sat Aug 6 03:16:50 CEST 2022
On 08/04/2022 01:25 PM, William Zhang wrote:
> Hi Florian,
>
> On 08/03/2022 08:21 PM, Florian Fainelli wrote:
>>
>>
>> On 8/2/2022 5:07 PM, William Zhang wrote:
>>> Hi Rafal,
>>>
>>> On 08/01/2022 10:26 PM, Rafał Miłecki wrote:
>>>> On 2.08.2022 00:03, William Zhang wrote:
>>>>> This driver supports the peripheral block timer found on the Broadcom
>>>>> BCA SoCs. It is 30-bit up-count timer running at 50MHz and can be used
>>>>> as the system clock source such as on BCM63138.
>>>>> Signed-off-by: William Zhang <william.zhang at broadcom.com>
>>>>>
>>>>> (...)
>>>>>
>>>>> +static const struct udevice_id bcmbca_timer_ids[] = {
>>>>> + { .compatible = "brcm,bcm-timers" },
>>>>> + { }
>>>>> +};
>>>>> +
>>>>> +U_BOOT_DRIVER(bcmbca_timer) = {
>>>>> + .name = "bcmbca_timer",
>>>>> + .id = UCLASS_TIMER,
>>>>> + .of_match = bcmbca_timer_ids,
>>>>> + .priv_auto = sizeof(struct bcmbca_timer_priv),
>>>>> + .probe = bcmbca_timer_probe,
>>>>> + .ops = &bcmbca_timer_ops,
>>>>> + .flags = DM_FLAG_PRE_RELOC,
>>>>> +};
>>>>
>>>> That "brcm,bcm-timers" seems like a really wide bidding. Is that exact
>>>> timer block guaranteed to be present on all Broadcom devices? Does it
>>>> exist e.g. on Northstar SoCs? Or old MIPS SoCs like BCM4706?
>>>>
>>> Agree I will make change to use brcm,bcmbca-timers.
>>
>> Why not change to use a compatible string that uses the first chip in
>> which this timer block was introduced, was that 6345 or later?
>>
> I don't mind to change to 6345. That chip should support the same timer
> block. Looks u-boot has a lot of Broadcom MIPS based chips that uses
> 6345 in compatible string name for various blocks.
>
>>>
>>>> It seems that even across BCMBCA devices this block may differ and may
>>>> need different bindings. Most SoCs have 4 CTL and 4 CNT registers but
>>>> some have only 3 + 3 (BCM6838 BCM60333 BCM63268).
>>> This timer driver is intended for the clock source for u-boot only so
>>> only need the first channel. Although it could work for the old mips
>>> based dsl chip, BCMBCA chip family support is only for the new ARM
>>> based chips which is stated in the BCMBA introduction patch.
>>>
>>>>
>>>> Finally could we have that binding actually documented?
>>> I don't see u-boot has binding document. I believe it generally use
>>> linux binding document. I have no plan to upstream this driver to
>>> linux. But I can put the binding info in the driver if that is the
>>> right way to do in u-boot.
>>
>> Out of curiosity, why does u-boot require this timer as opposed to
>> using the Cortex-A9 architected timers? Is it necessary to boot strap
>> the A9 timers?
> Cortex-A9 has an arch timer called global timer. But I don't see a
> generic global timer driver in the u-boot. There is one from
> STMicroelectronics sti-timer.c which is a a9 global timer but it is
> implemented under STI_TIMER and default enabled for ARCH_STI. I guess we
> can use that too when we have the clk driver(iproc clock driver) ported
> to u-boot. Just curious, does anyone in this list know why sti timer is
> not put under global timer config and file name? I don't see anything
> in that driver is sti specific. CC'ed driver maintainer Patrice as well.
Since there is already global timer support in u-boot, I decided to use
that for BCM63138. So I withdrew this patch and please discard.
I will also send a patch to move the sti a9 global timer to generic arm
a9 global timer driver if Patrice agrees or I don't hear from him back
next week.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4212 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220805/1a3bb3a1/attachment.bin>
More information about the U-Boot
mailing list