2014-06-02 06:25:36

by Michal Simek

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] watchdog: Add Cadence WDT driver

On 05/29/2014 03:19 PM, Mark Rutland wrote:
> On Thu, May 29, 2014 at 10:43:05AM +0100, Michal Simek wrote:
>> Hi Mark,
>>
>>>> +static struct of_device_id cdns_wdt_of_match[] = {
>>>> + { .compatible = "xlnx,zynq-wdt-r1p2", },
>>>> + { .compatible = "cdns,wdt-r1p2", },
>>>
>>> If these can currently be handled identically, why not just have
>>> "cdns,wdt-r1p2" in the driver and in your dts have:
>>>
>>> compatible = "xlnx,zynq-wdt-r1p2", "cdns,wdt-r1p2";
>>>
>>> If we need to distinguish the two for some reason later we can always
>>> add the "xlnx,zynq-wdt-r1p2" string to the driver.
>>
>> I would prefer to have 2 compatible strings just because
>> of that we don't know what is different compare to origin cadence
>> version. We have done the same for spi-cadence.c that's why
>> it shouldn't be any problem to keep it as is.
>> Having zynq compatible property here and using it give us option
>> that if another SoC vendor come with new configuration or clean
>> cadence one we can simple handle it without changing compatible
>> property for us.
>
> Sure, we can have two documented strings. But as I mention for the
> moment the driver only needs to support the one string so long as a
> given dts has both. Then we can later distinguish the zynq variant (or
> any other) as necessary.

ok then. Let's use just "xlnx,zynq-wdt-r1p2" compatible string here
and remove "cdns,wdt-r1p2"

Thanks,
Michal

--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: http://www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform



Attachments:
signature.asc (263.00 B)
OpenPGP digital signature

2014-06-02 13:17:16

by Mark Rutland

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] watchdog: Add Cadence WDT driver

On Mon, Jun 02, 2014 at 07:25:16AM +0100, Michal Simek wrote:
> On 05/29/2014 03:19 PM, Mark Rutland wrote:
> > On Thu, May 29, 2014 at 10:43:05AM +0100, Michal Simek wrote:
> >> Hi Mark,
> >>
> >>>> +static struct of_device_id cdns_wdt_of_match[] = {
> >>>> + { .compatible = "xlnx,zynq-wdt-r1p2", },
> >>>> + { .compatible = "cdns,wdt-r1p2", },
> >>>
> >>> If these can currently be handled identically, why not just have
> >>> "cdns,wdt-r1p2" in the driver and in your dts have:
> >>>
> >>> compatible = "xlnx,zynq-wdt-r1p2", "cdns,wdt-r1p2";
> >>>
> >>> If we need to distinguish the two for some reason later we can always
> >>> add the "xlnx,zynq-wdt-r1p2" string to the driver.
> >>
> >> I would prefer to have 2 compatible strings just because
> >> of that we don't know what is different compare to origin cadence
> >> version. We have done the same for spi-cadence.c that's why
> >> it shouldn't be any problem to keep it as is.
> >> Having zynq compatible property here and using it give us option
> >> that if another SoC vendor come with new configuration or clean
> >> cadence one we can simple handle it without changing compatible
> >> property for us.
> >
> > Sure, we can have two documented strings. But as I mention for the
> > moment the driver only needs to support the one string so long as a
> > given dts has both. Then we can later distinguish the zynq variant (or
> > any other) as necessary.
>
> ok then. Let's use just "xlnx,zynq-wdt-r1p2" compatible string here
> and remove "cdns,wdt-r1p2"

That if anything seems backwards -- the driver should jsut take the most
general string for now: "cdns,wdt-r1p2", while the dtb will have both:

compatible = "xlnx,zynq-wdt-r1p2", "cdns,wdt-r1p2";

The driver can later disintguish "xlnx,zynq-wdt-r1p2" specially if
necessary.

Cheers,
Mark.

2014-06-02 13:29:20

by Michal Simek

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] watchdog: Add Cadence WDT driver

On 06/02/2014 03:17 PM, Mark Rutland wrote:
> On Mon, Jun 02, 2014 at 07:25:16AM +0100, Michal Simek wrote:
>> On 05/29/2014 03:19 PM, Mark Rutland wrote:
>>> On Thu, May 29, 2014 at 10:43:05AM +0100, Michal Simek wrote:
>>>> Hi Mark,
>>>>
>>>>>> +static struct of_device_id cdns_wdt_of_match[] = {
>>>>>> + { .compatible = "xlnx,zynq-wdt-r1p2", },
>>>>>> + { .compatible = "cdns,wdt-r1p2", },
>>>>>
>>>>> If these can currently be handled identically, why not just have
>>>>> "cdns,wdt-r1p2" in the driver and in your dts have:
>>>>>
>>>>> compatible = "xlnx,zynq-wdt-r1p2", "cdns,wdt-r1p2";
>>>>>
>>>>> If we need to distinguish the two for some reason later we can always
>>>>> add the "xlnx,zynq-wdt-r1p2" string to the driver.
>>>>
>>>> I would prefer to have 2 compatible strings just because
>>>> of that we don't know what is different compare to origin cadence
>>>> version. We have done the same for spi-cadence.c that's why
>>>> it shouldn't be any problem to keep it as is.
>>>> Having zynq compatible property here and using it give us option
>>>> that if another SoC vendor come with new configuration or clean
>>>> cadence one we can simple handle it without changing compatible
>>>> property for us.
>>>
>>> Sure, we can have two documented strings. But as I mention for the
>>> moment the driver only needs to support the one string so long as a
>>> given dts has both. Then we can later distinguish the zynq variant (or
>>> any other) as necessary.
>>
>> ok then. Let's use just "xlnx,zynq-wdt-r1p2" compatible string here
>> and remove "cdns,wdt-r1p2"
>
> That if anything seems backwards -- the driver should jsut take the most
> general string for now: "cdns,wdt-r1p2", while the dtb will have both:
>
> compatible = "xlnx,zynq-wdt-r1p2", "cdns,wdt-r1p2";
>
> The driver can later disintguish "xlnx,zynq-wdt-r1p2" specially if
> necessary.

ah. Ok I see your point now. No problem to do it in this way.

Thanks,
Michal