Message ID | 20220407071006.37031-2-tony@atomide.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/4] dt-bindings: timer: Add am6 compatible for ti-timer | expand |
On 07/04/2022 09:10, Tony Lindgren wrote: > We have pwm-omap-dmtimer tagged with COMPILE_TEST, so we need to use the > ifdefs around the inline functions. Let's add ARCH_K3 to the list of SoCs > to allow using timer-ti-dm on these SoCs. > > Cc: Keerthy <j-keerthy@ti.com> > Cc: Nishanth Menon <nm@ti.com> > Cc: Vignesh Raghavendra <vigneshr@ti.com> > Signed-off-by: Tony Lindgren <tony@atomide.com> > --- > include/clocksource/timer-ti-dm.h | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/include/clocksource/timer-ti-dm.h b/include/clocksource/timer-ti-dm.h > --- a/include/clocksource/timer-ti-dm.h > +++ b/include/clocksource/timer-ti-dm.h > @@ -251,7 +251,8 @@ int omap_dm_timers_active(void); > * The below are inlined to optimize code size for system timers. Other code > * should not need these at all. > */ > -#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) > +#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) || \ > + defined(CONFIG_ARCH_K3) Why not replace the above by CONFIG_OMAP_DM_TIMER ? > static inline u32 __omap_dm_timer_read(struct omap_dm_timer *timer, u32 reg, > int posted) > { > @@ -390,5 +391,5 @@ static inline void __omap_dm_timer_write_status(struct omap_dm_timer *timer, > { > writel_relaxed(value, timer->irq_stat); > } > -#endif /* CONFIG_ARCH_OMAP1 || CONFIG_ARCH_OMAP2PLUS */ > +#endif /* CONFIG_ARCH_OMAP1 || CONFIG_ARCH_OMAP2PLUS || CONFIG_ARCH_K3 */ > #endif /* __CLOCKSOURCE_DMTIMER_H */
* Daniel Lezcano <daniel.lezcano@linaro.org> [220407 08:01]: > On 07/04/2022 09:10, Tony Lindgren wrote: > > @@ -251,7 +251,8 @@ int omap_dm_timers_active(void); > > * The below are inlined to optimize code size for system timers. Other code > > * should not need these at all. > > */ > > -#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) > > +#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) || \ > > + defined(CONFIG_ARCH_K3) > > Why not replace the above by CONFIG_OMAP_DM_TIMER ? Hmm that's a good question for why it was not that way earlier. This series changes things for tristate "OMAP dual-mode timer driver" if ARCH_K3 || COMPILE_TEST though. So the inline stubs are still needed for COMPILE_TEST it seems. Regards, Tony
On 07/04/2022 10:15, Tony Lindgren wrote: > * Daniel Lezcano <daniel.lezcano@linaro.org> [220407 08:01]: >> On 07/04/2022 09:10, Tony Lindgren wrote: >>> @@ -251,7 +251,8 @@ int omap_dm_timers_active(void); >>> * The below are inlined to optimize code size for system timers. Other code >>> * should not need these at all. >>> */ >>> -#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) >>> +#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) || \ >>> + defined(CONFIG_ARCH_K3) >> >> Why not replace the above by CONFIG_OMAP_DM_TIMER ? > > Hmm that's a good question for why it was not that way earlier. > > This series changes things for tristate "OMAP dual-mode timer driver" if > ARCH_K3 || COMPILE_TEST though. So the inline stubs are still needed for > COMPILE_TEST it seems. But if ARCH_K3 or COMPILE_TEST is set, CONFIG_DM_TIMER is also set, no?
* Daniel Lezcano <daniel.lezcano@linaro.org> [220407 08:23]: > On 07/04/2022 10:15, Tony Lindgren wrote: > > * Daniel Lezcano <daniel.lezcano@linaro.org> [220407 08:01]: > > > On 07/04/2022 09:10, Tony Lindgren wrote: > > > > @@ -251,7 +251,8 @@ int omap_dm_timers_active(void); > > > > * The below are inlined to optimize code size for system timers. Other code > > > > * should not need these at all. > > > > */ > > > > -#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) > > > > +#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) || \ > > > > + defined(CONFIG_ARCH_K3) > > > > > > Why not replace the above by CONFIG_OMAP_DM_TIMER ? > > > > Hmm that's a good question for why it was not that way earlier. > > > > This series changes things for tristate "OMAP dual-mode timer driver" if > > ARCH_K3 || COMPILE_TEST though. So the inline stubs are still needed for > > COMPILE_TEST it seems. > > But if ARCH_K3 or COMPILE_TEST is set, CONFIG_DM_TIMER is also set, no? Right but I suspect that COMPILE_TEST will produce a build error on other architectures. I need to check that though, maybe that is no longer the case. Regards, Tony
* Tony Lindgren <tony@atomide.com> [220407 08:50]: > * Daniel Lezcano <daniel.lezcano@linaro.org> [220407 08:23]: > > On 07/04/2022 10:15, Tony Lindgren wrote: > > > * Daniel Lezcano <daniel.lezcano@linaro.org> [220407 08:01]: > > > > On 07/04/2022 09:10, Tony Lindgren wrote: > > > > > @@ -251,7 +251,8 @@ int omap_dm_timers_active(void); > > > > > * The below are inlined to optimize code size for system timers. Other code > > > > > * should not need these at all. > > > > > */ > > > > > -#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) > > > > > +#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) || \ > > > > > + defined(CONFIG_ARCH_K3) > > > > > > > > Why not replace the above by CONFIG_OMAP_DM_TIMER ? > > > > > > Hmm that's a good question for why it was not that way earlier. > > > > > > This series changes things for tristate "OMAP dual-mode timer driver" if > > > ARCH_K3 || COMPILE_TEST though. So the inline stubs are still needed for > > > COMPILE_TEST it seems. > > > > But if ARCH_K3 or COMPILE_TEST is set, CONFIG_DM_TIMER is also set, no? > > Right but I suspect that COMPILE_TEST will produce a build error on other > architectures. I need to check that though, maybe that is no longer the > case. We could use IS_ENABLED(CONFIG_OMAP_DM_TIMER), but looks like we can now just move the __omap_dm_timer_* inline functions to timer-ti-dm.c instead. I'll do that and repost after some testing. Regards, Tony
On 07/04/2022 12:26, Tony Lindgren wrote: > * Tony Lindgren <tony@atomide.com> [220407 08:50]: >> * Daniel Lezcano <daniel.lezcano@linaro.org> [220407 08:23]: >>> On 07/04/2022 10:15, Tony Lindgren wrote: >>>> * Daniel Lezcano <daniel.lezcano@linaro.org> [220407 08:01]: >>>>> On 07/04/2022 09:10, Tony Lindgren wrote: >>>>>> @@ -251,7 +251,8 @@ int omap_dm_timers_active(void); >>>>>> * The below are inlined to optimize code size for system timers. Other code >>>>>> * should not need these at all. >>>>>> */ >>>>>> -#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) >>>>>> +#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) || \ >>>>>> + defined(CONFIG_ARCH_K3) >>>>> >>>>> Why not replace the above by CONFIG_OMAP_DM_TIMER ? >>>> >>>> Hmm that's a good question for why it was not that way earlier. >>>> >>>> This series changes things for tristate "OMAP dual-mode timer driver" if >>>> ARCH_K3 || COMPILE_TEST though. So the inline stubs are still needed for >>>> COMPILE_TEST it seems. >>> >>> But if ARCH_K3 or COMPILE_TEST is set, CONFIG_DM_TIMER is also set, no? >> >> Right but I suspect that COMPILE_TEST will produce a build error on other >> architectures. I need to check that though, maybe that is no longer the >> case. > > We could use IS_ENABLED(CONFIG_OMAP_DM_TIMER), but looks like we can now > just move the __omap_dm_timer_* inline functions to timer-ti-dm.c instead. > > I'll do that and repost after some testing. Even better :)
diff --git a/include/clocksource/timer-ti-dm.h b/include/clocksource/timer-ti-dm.h --- a/include/clocksource/timer-ti-dm.h +++ b/include/clocksource/timer-ti-dm.h @@ -251,7 +251,8 @@ int omap_dm_timers_active(void); * The below are inlined to optimize code size for system timers. Other code * should not need these at all. */ -#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) +#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) || \ + defined(CONFIG_ARCH_K3) static inline u32 __omap_dm_timer_read(struct omap_dm_timer *timer, u32 reg, int posted) { @@ -390,5 +391,5 @@ static inline void __omap_dm_timer_write_status(struct omap_dm_timer *timer, { writel_relaxed(value, timer->irq_stat); } -#endif /* CONFIG_ARCH_OMAP1 || CONFIG_ARCH_OMAP2PLUS */ +#endif /* CONFIG_ARCH_OMAP1 || CONFIG_ARCH_OMAP2PLUS || CONFIG_ARCH_K3 */ #endif /* __CLOCKSOURCE_DMTIMER_H */
We have pwm-omap-dmtimer tagged with COMPILE_TEST, so we need to use the ifdefs around the inline functions. Let's add ARCH_K3 to the list of SoCs to allow using timer-ti-dm on these SoCs. Cc: Keerthy <j-keerthy@ti.com> Cc: Nishanth Menon <nm@ti.com> Cc: Vignesh Raghavendra <vigneshr@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> --- include/clocksource/timer-ti-dm.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)