* [PATCH 02/05] sh: arch earlytimer support
@ 2009-04-15 10:50 Magnus Damm
2009-04-15 11:42 ` Paul Mundt
2009-04-15 12:03 ` Magnus Damm
0 siblings, 2 replies; 3+ messages in thread
From: Magnus Damm @ 2009-04-15 10:50 UTC (permalink / raw)
To: linux-sh
From: Magnus Damm <damm@igel.co.jp>
Extend the 32-bit SuperH timer code to register and probe
the earlytimer class of Early Platform Drivers.
This registers the sh_cmt driver if compiled-in.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
---
arch/sh/kernel/time_32.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- 0001/arch/sh/kernel/time_32.c
+++ work/arch/sh/kernel/time_32.c 2009-04-15 16:59:31.000000000 +0900
@@ -17,6 +17,7 @@
#include <linux/sched.h>
#include <linux/clockchips.h>
#include <linux/mc146818rtc.h> /* for rtc_lock */
+#include <linux/platform_device.h>
#include <linux/smp.h>
#include <asm/clock.h>
#include <asm/rtc.h>
@@ -233,6 +234,14 @@ void __init time_init(void)
* initialized for us.
*/
sys_timer = get_sys_timer();
+
+ /* Make sure all compiled-in early timers register themselves.
+ * Run probe() for one "earlytimer" device.
+ */
+ early_platform_driver_register_all("earlytimer");
+ if (early_platform_driver_probe("earlytimer", 1, 0))
+ return;
+
if (unlikely(!sys_timer))
panic("System timer missing.\n");
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 02/05] sh: arch earlytimer support
2009-04-15 10:50 [PATCH 02/05] sh: arch earlytimer support Magnus Damm
@ 2009-04-15 11:42 ` Paul Mundt
2009-04-15 12:03 ` Magnus Damm
1 sibling, 0 replies; 3+ messages in thread
From: Paul Mundt @ 2009-04-15 11:42 UTC (permalink / raw)
To: linux-sh
On Wed, Apr 15, 2009 at 07:50:12PM +0900, Magnus Damm wrote:
> --- 0001/arch/sh/kernel/time_32.c
> +++ work/arch/sh/kernel/time_32.c 2009-04-15 16:59:31.000000000 +0900
> @@ -233,6 +234,14 @@ void __init time_init(void)
> * initialized for us.
> */
> sys_timer = get_sys_timer();
> +
> + /* Make sure all compiled-in early timers register themselves.
> + * Run probe() for one "earlytimer" device.
> + */
> + early_platform_driver_register_all("earlytimer");
> + if (early_platform_driver_probe("earlytimer", 1, 0))
> + return;
> +
> if (unlikely(!sys_timer))
> panic("System timer missing.\n");
>
What exactly is the plan for progression from here? If the CMT
clocksource and clockevent drivers are filling the role of the old CMT
driver, then the sys_timer stuff needs to be isolated. As it is now,
platforms that only contain the CMT will still need to use the sys_timer
version, especially if they don't have multiple channels.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 02/05] sh: arch earlytimer support
2009-04-15 10:50 [PATCH 02/05] sh: arch earlytimer support Magnus Damm
2009-04-15 11:42 ` Paul Mundt
@ 2009-04-15 12:03 ` Magnus Damm
1 sibling, 0 replies; 3+ messages in thread
From: Magnus Damm @ 2009-04-15 12:03 UTC (permalink / raw)
To: linux-sh
On Wed, Apr 15, 2009 at 8:42 PM, Paul Mundt <lethal@linux-sh.org> wrote:
> On Wed, Apr 15, 2009 at 07:50:12PM +0900, Magnus Damm wrote:
>> --- 0001/arch/sh/kernel/time_32.c
>> +++ work/arch/sh/kernel/time_32.c 2009-04-15 16:59:31.000000000 +0900
>> @@ -233,6 +234,14 @@ void __init time_init(void)
>> * initialized for us.
>> */
>> sys_timer = get_sys_timer();
>> +
>> + /* Make sure all compiled-in early timers register themselves.
>> + * Run probe() for one "earlytimer" device.
>> + */
>> + early_platform_driver_register_all("earlytimer");
>> + if (early_platform_driver_probe("earlytimer", 1, 0))
>> + return;
>> +
>> if (unlikely(!sys_timer))
>> panic("System timer missing.\n");
>>
> What exactly is the plan for progression from here? If the CMT
> clocksource and clockevent drivers are filling the role of the old CMT
> driver, then the sys_timer stuff needs to be isolated. As it is now,
> platforms that only contain the CMT will still need to use the sys_timer
> version, especially if they don't have multiple channels.
Sorry about the unclear code. So the early platform stuff should be
moved up before get_sys_timer(). This way sys_timer will always be
NULL if earlytimer is used. I'll resend a new version.
/ magnus
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-04-15 12:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-15 10:50 [PATCH 02/05] sh: arch earlytimer support Magnus Damm
2009-04-15 11:42 ` Paul Mundt
2009-04-15 12:03 ` Magnus Damm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox