devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] Add macro definition for the upcoming new OST driver.
@ 2020-10-07 18:14 周琰杰 (Zhou Yanjie)
  2020-10-07 18:14 ` [PATCH 1/1] dt-bindings: clock: Add new OST support for the upcoming new driver 周琰杰 (Zhou Yanjie)
  0 siblings, 1 reply; 4+ messages in thread
From: 周琰杰 (Zhou Yanjie) @ 2020-10-07 18:14 UTC (permalink / raw)
  To: robh+dt; +Cc: devicetree, linux-kernel, sernia.zhou

Add new macro definition to "ingenic,sysost.h", exchange the original
ABI values of OST_CLK_PERCPU_TIMER and OST_CLK_GLOBAL_TIMER, prepare
for the upcoming new OST driver.

周琰杰 (Zhou Yanjie) (1):
  dt-bindings: clock: Add new OST support for the upcoming new driver.

 include/dt-bindings/clock/ingenic,sysost.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

-- 
2.11.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] dt-bindings: clock: Add new OST support for the upcoming new driver.
  2020-10-07 18:14 [PATCH 0/1] Add macro definition for the upcoming new OST driver 周琰杰 (Zhou Yanjie)
@ 2020-10-07 18:14 ` 周琰杰 (Zhou Yanjie)
  2020-10-13 13:29   ` Rob Herring
  0 siblings, 1 reply; 4+ messages in thread
From: 周琰杰 (Zhou Yanjie) @ 2020-10-07 18:14 UTC (permalink / raw)
  To: robh+dt; +Cc: devicetree, linux-kernel, sernia.zhou

The new OST has one global timer and two or four percpu timers, so there will be three
combinations in the upcoming new OST driver: the original GLOBAL_TIMER + PERCPU_TIMER,
the new GLOBAL_TIMER + PERCPU_TIMER0/1 and GLOBAL_TIMER + PERCPU_TIMER0/1/2/3, For this,
add the macro definition about OST_CLK_PERCPU_TIMER0/1/2/3. And in order to ensure that
all the combinations work normally, the original ABI values of OST_CLK_PERCPU_TIMER and
OST_CLK_GLOBAL_TIMER need to be exchanged to ensure that in any combinations, the clock
can be registered (by calling clk_hw_register()) from index 0.

I'm sure that exchanging the ABI values of OST_CLK_PERCPU_TIMER and OST_CLK_GLOBAL_TIMER
will not affect the existing related drivers and the SoCs whitch using these drivers, so
we should be able to exchange them safely.

Tested-by: 周正 (Zhou Zheng) <sernia.zhou@foxmail.com>
Signed-off-by: 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>
---
 include/dt-bindings/clock/ingenic,sysost.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/include/dt-bindings/clock/ingenic,sysost.h b/include/dt-bindings/clock/ingenic,sysost.h
index 9ac88e90babf..063791b01ab3 100644
--- a/include/dt-bindings/clock/ingenic,sysost.h
+++ b/include/dt-bindings/clock/ingenic,sysost.h
@@ -1,12 +1,16 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * This header provides clock numbers for the ingenic,tcu DT binding.
+ * This header provides clock numbers for the Ingenic OST DT binding.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_INGENIC_OST_H__
 #define __DT_BINDINGS_CLOCK_INGENIC_OST_H__
 
-#define OST_CLK_PERCPU_TIMER	0
-#define OST_CLK_GLOBAL_TIMER	1
+#define OST_CLK_PERCPU_TIMER	1
+#define OST_CLK_GLOBAL_TIMER	0
+#define OST_CLK_PERCPU_TIMER0	1
+#define OST_CLK_PERCPU_TIMER1	2
+#define OST_CLK_PERCPU_TIMER2	3
+#define OST_CLK_PERCPU_TIMER3	4
 
 #endif /* __DT_BINDINGS_CLOCK_INGENIC_OST_H__ */
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] dt-bindings: clock: Add new OST support for the upcoming new driver.
  2020-10-07 18:14 ` [PATCH 1/1] dt-bindings: clock: Add new OST support for the upcoming new driver 周琰杰 (Zhou Yanjie)
@ 2020-10-13 13:29   ` Rob Herring
  2020-10-14 16:25     ` Zhou Yanjie
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2020-10-13 13:29 UTC (permalink / raw)
  To: 周琰杰 (Zhou Yanjie)
  Cc: devicetree, linux-kernel, sernia.zhou

On Thu, Oct 08, 2020 at 02:14:07AM +0800, 周琰杰 (Zhou Yanjie) wrote:
> The new OST has one global timer and two or four percpu timers, so there will be three
> combinations in the upcoming new OST driver: the original GLOBAL_TIMER + PERCPU_TIMER,
> the new GLOBAL_TIMER + PERCPU_TIMER0/1 and GLOBAL_TIMER + PERCPU_TIMER0/1/2/3, For this,
> add the macro definition about OST_CLK_PERCPU_TIMER0/1/2/3. And in order to ensure that
> all the combinations work normally, the original ABI values of OST_CLK_PERCPU_TIMER and
> OST_CLK_GLOBAL_TIMER need to be exchanged to ensure that in any combinations, the clock
> can be registered (by calling clk_hw_register()) from index 0.

Wrap lines at <80 characters.

> 
> I'm sure that exchanging the ABI values of OST_CLK_PERCPU_TIMER and OST_CLK_GLOBAL_TIMER
> will not affect the existing related drivers and the SoCs whitch using these drivers, so
> we should be able to exchange them safely.

Why exactly is this okay?

> 
> Tested-by: 周正 (Zhou Zheng) <sernia.zhou@foxmail.com>
> Signed-off-by: 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>
> ---
>  include/dt-bindings/clock/ingenic,sysost.h | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/include/dt-bindings/clock/ingenic,sysost.h b/include/dt-bindings/clock/ingenic,sysost.h
> index 9ac88e90babf..063791b01ab3 100644
> --- a/include/dt-bindings/clock/ingenic,sysost.h
> +++ b/include/dt-bindings/clock/ingenic,sysost.h
> @@ -1,12 +1,16 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
>  /*
> - * This header provides clock numbers for the ingenic,tcu DT binding.
> + * This header provides clock numbers for the Ingenic OST DT binding.
>   */
>  
>  #ifndef __DT_BINDINGS_CLOCK_INGENIC_OST_H__
>  #define __DT_BINDINGS_CLOCK_INGENIC_OST_H__
>  
> -#define OST_CLK_PERCPU_TIMER	0
> -#define OST_CLK_GLOBAL_TIMER	1
> +#define OST_CLK_PERCPU_TIMER	1
> +#define OST_CLK_GLOBAL_TIMER	0
> +#define OST_CLK_PERCPU_TIMER0	1
> +#define OST_CLK_PERCPU_TIMER1	2
> +#define OST_CLK_PERCPU_TIMER2	3
> +#define OST_CLK_PERCPU_TIMER3	4
>  
>  #endif /* __DT_BINDINGS_CLOCK_INGENIC_OST_H__ */
> -- 
> 2.11.0
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] dt-bindings: clock: Add new OST support for the upcoming new driver.
  2020-10-13 13:29   ` Rob Herring
@ 2020-10-14 16:25     ` Zhou Yanjie
  0 siblings, 0 replies; 4+ messages in thread
From: Zhou Yanjie @ 2020-10-14 16:25 UTC (permalink / raw)
  To: Rob Herring; +Cc: devicetree, linux-kernel, sernia.zhou

Hi Rob,

在 2020/10/13 下午9:29, Rob Herring 写道:
> On Thu, Oct 08, 2020 at 02:14:07AM +0800, 周琰杰 (Zhou Yanjie) wrote:
>> The new OST has one global timer and two or four percpu timers, so there will be three
>> combinations in the upcoming new OST driver: the original GLOBAL_TIMER + PERCPU_TIMER,
>> the new GLOBAL_TIMER + PERCPU_TIMER0/1 and GLOBAL_TIMER + PERCPU_TIMER0/1/2/3, For this,
>> add the macro definition about OST_CLK_PERCPU_TIMER0/1/2/3. And in order to ensure that
>> all the combinations work normally, the original ABI values of OST_CLK_PERCPU_TIMER and
>> OST_CLK_GLOBAL_TIMER need to be exchanged to ensure that in any combinations, the clock
>> can be registered (by calling clk_hw_register()) from index 0.
> Wrap lines at <80 characters.


Sorry, I will fix it in the next version.


>
>> I'm sure that exchanging the ABI values of OST_CLK_PERCPU_TIMER and OST_CLK_GLOBAL_TIMER
>> will not affect the existing related drivers and the SoCs whitch using these drivers, so
>> we should be able to exchange them safely.
> Why exactly is this okay?


These definitions are currently only used in two places, one is when 
using "assigned-clocks" to configure the clock in the DTS file; the 
other is when registering the clock in the sysost driver. When 
exchanging the values of "OST_CLK_PERCPU_TIMER" and 
"OST_CLK_GLOBAL_TIMER", the corresponding values will be changed 
synchronously when the clock is driven to register and when the clock is 
configured through "assigned-clocks". Therefore, there is no situation 
that causes the wrong clock to the configured. And it has been tested on 
X1000 and X1000 and X1830 SoCs, all working fine.

I'm sorry because I didn't think carefully when writing this header 
file, and caused the current trouble.


Thanks and best regards!


>> Tested-by: 周正 (Zhou Zheng) <sernia.zhou@foxmail.com>
>> Signed-off-by: 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>
>> ---
>>   include/dt-bindings/clock/ingenic,sysost.h | 10 +++++++---
>>   1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/dt-bindings/clock/ingenic,sysost.h b/include/dt-bindings/clock/ingenic,sysost.h
>> index 9ac88e90babf..063791b01ab3 100644
>> --- a/include/dt-bindings/clock/ingenic,sysost.h
>> +++ b/include/dt-bindings/clock/ingenic,sysost.h
>> @@ -1,12 +1,16 @@
>>   /* SPDX-License-Identifier: GPL-2.0 */
>>   /*
>> - * This header provides clock numbers for the ingenic,tcu DT binding.
>> + * This header provides clock numbers for the Ingenic OST DT binding.
>>    */
>>   
>>   #ifndef __DT_BINDINGS_CLOCK_INGENIC_OST_H__
>>   #define __DT_BINDINGS_CLOCK_INGENIC_OST_H__
>>   
>> -#define OST_CLK_PERCPU_TIMER	0
>> -#define OST_CLK_GLOBAL_TIMER	1
>> +#define OST_CLK_PERCPU_TIMER	1
>> +#define OST_CLK_GLOBAL_TIMER	0
>> +#define OST_CLK_PERCPU_TIMER0	1
>> +#define OST_CLK_PERCPU_TIMER1	2
>> +#define OST_CLK_PERCPU_TIMER2	3
>> +#define OST_CLK_PERCPU_TIMER3	4
>>   
>>   #endif /* __DT_BINDINGS_CLOCK_INGENIC_OST_H__ */
>> -- 
>> 2.11.0
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-14 16:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07 18:14 [PATCH 0/1] Add macro definition for the upcoming new OST driver 周琰杰 (Zhou Yanjie)
2020-10-07 18:14 ` [PATCH 1/1] dt-bindings: clock: Add new OST support for the upcoming new driver 周琰杰 (Zhou Yanjie)
2020-10-13 13:29   ` Rob Herring
2020-10-14 16:25     ` Zhou Yanjie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).