Skip to contentSkip to conversation

clocksource: m86knommu: Convert to clocksource_register_hz/khz

PATCH Geert Uytterhoeven 3 participants 6 messages Oct 25, 2011 – Oct 27, 2011 1 message not in the archive m68k architecture

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Geert Uytterhoeven

author maintainer
#1 lore raw
Quoted 9 lines · On Tue, Oct 25, 2011 at 20:08, <[email protected]> wrote:

From: John Stultz <[email protected]>

This converts the m86knommu clocksources to use clocksource_register_hz/khz

This is untested, so any assistance in testing would be appreciated!

CC Geert Uytterhoeven <[email protected]>
CC Greg Ungerer <[email protected]>
Quoted 8 lines

---
 arch/m68k/platform/68328/timers.c         |    4 +- arch/m68k/platform/coldfire/dma_timer.c   |    5 +- arch/m68knommu/platform/coldfire/pit.c    |  167 ++++++++++++++++++++++++++++ arch/m68knommu/platform/coldfire/timers.c |  172 +++++++++++++++++++++++++++++

 4 files changed, 341 insertions(+), 7 deletions(-)

 create mode 100644 arch/m68knommu/platform/coldfire/pit.c create mode 100644 arch/m68knommu/platform/coldfire/timers.c

arch/m68knommu no longer exists.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds

#2 lore raw
Quoted 19 lines · Geert Uytterhoeven
Quoted 9 lines · On Tue, Oct 25, 2011 at 20:08, <[email protected]> wrote:

From: John Stultz <[email protected]>

This converts the m86knommu clocksources to use clocksource_register_hz/khz

This is untested, so any assistance in testing would be appreciated!

CC Geert Uytterhoeven <[email protected]>
CC Greg Ungerer <[email protected]>
Quoted 8 lines
---
 arch/m68k/platform/68328/timers.c         |    4 +-
 arch/m68k/platform/coldfire/dma_timer.c   |    5 +-
 arch/m68knommu/platform/coldfire/pit.c    |  167 ++++++++++++++++++++++++++++
 arch/m68knommu/platform/coldfire/timers.c |  172 +++++++++++++++++++++++++++++
 4 files changed, 341 insertions(+), 7 deletions(-)
 create mode 100644 arch/m68knommu/platform/coldfire/pit.c
 create mode 100644 arch/m68knommu/platform/coldfire/timers.c
Quoted 1 line

arch/m68knommu no longer exists.

Ah. My apologies. These patches have been around forever. Thanks for the heads up.

thanks
-john

#3 lore raw

Re: [PATCH 6/8] clocksource: m86k: Convert to clocksource_register_hz/khz

In reply to Geert Uytterhoeven

Updated to merge the valid bits of the two m68k patches.

This converts the m86k clocksources to use clocksource_register_hz/khz

This is untested, so any assistance in testing would be appreciated!

CC Geert Uytterhoeven <[email protected]>
CC Greg Ungerer <[email protected]>
---
 arch/m68k/platform/68328/timers.c       |    4 +---
 arch/m68k/platform/coldfire/dma_timer.c |    5 +----
 arch/m68k/platform/coldfire/pit.c       |    4 +---
 arch/m68k/platform/coldfire/sltimers.c  |    4 +---
 arch/m68k/platform/coldfire/timers.c    |    4 +---
 5 files changed, 5 insertions(+), 16 deletions(-)
arch/m68k/platform/68328/timers.c +1 -3
index 309f725..f267886 100644
@@ -93,7 +93,6 @@ static struct clocksource m68328_clk = {
 	.name	= "timer",
 	.rating	= 250,
 	.read	= m68328_read_clk,
-	.shift	= 20,
 	.mask	= CLOCKSOURCE_MASK(32),
 	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
 };
@@ -115,8 +114,7 @@ void hw_timer_init(void)
 
 	/* Enable timer 1 */
 	TCTL |= TCTL_TEN;
-	m68328_clk.mult = clocksource_hz2mult(TICKS_PER_JIFFY*HZ, m68328_clk.shift);
-	clocksource_register(&m68328_clk);
+	clocksource_register_hz(&m68328_clk, TICKS_PER_JIFFY*HZ);
 }
 
 /***************************************************************************/
arch/m68k/platform/coldfire/dma_timer.c +1 -4
index a5f5628..235ad57 100644
@@ -44,7 +44,6 @@ static struct clocksource clocksource_cf_dt = {
 	.rating		= 200,
 	.read		= cf_dt_get_cycles,
 	.mask		= CLOCKSOURCE_MASK(32),
-	.shift		= 20,
 	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
@@ -60,9 +59,7 @@ static int __init  init_cf_dt_clocksource(void)
 	__raw_writeb(0x00, DTER0);
 	__raw_writel(0x00000000, DTRR0);
 	__raw_writew(DMA_DTMR_CLK_DIV_16 | DMA_DTMR_ENABLE, DTMR0);
-	clocksource_cf_dt.mult = clocksource_hz2mult(DMA_FREQ,
-						     clocksource_cf_dt.shift);
-	return clocksource_register(&clocksource_cf_dt);
+	return clocksource_register_hz(&clocksource_cf_dt, DMA_FREQ);
 }
 
 arch_initcall(init_cf_dt_clocksource);
arch/m68k/platform/coldfire/pit.c +1 -3
index c2b9809..02663d2 100644
@@ -144,7 +144,6 @@ static struct clocksource pit_clk = {
 	.name	= "pit",
 	.rating	= 100,
 	.read	= pit_read_clk,
-	.shift	= 20,
 	.mask	= CLOCKSOURCE_MASK(32),
 };
 
@@ -162,8 +161,7 @@ void hw_timer_init(void)
 
 	setup_irq(MCFINT_VECBASE + MCFINT_PIT1, &pit_irq);
 
-	pit_clk.mult = clocksource_hz2mult(FREQ, pit_clk.shift);
-	clocksource_register(&pit_clk);
+	clocksource_register_hz(&pit_clk, FREQ);
 }
 
 /***************************************************************************/
arch/m68k/platform/coldfire/sltimers.c +1 -3
index 6a85daf..b7f822b 100644
@@ -114,7 +114,6 @@ static struct clocksource mcfslt_clk = {
 	.name	= "slt",
 	.rating	= 250,
 	.read	= mcfslt_read_clk,
-	.shift	= 20,
 	.mask	= CLOCKSOURCE_MASK(32),
 	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
 };
@@ -136,8 +135,7 @@ void hw_timer_init(void)
 
 	setup_irq(MCF_IRQ_TIMER, &mcfslt_timer_irq);
 
-	mcfslt_clk.mult = clocksource_hz2mult(MCF_BUSCLK, mcfslt_clk.shift);
-	clocksource_register(&mcfslt_clk);
+	clocksource_register_hz(&mcfslt_clk, MCF_BUSCLK);
 
 #ifdef CONFIG_HIGHPROFILE
 	mcfslt_profile_init();
arch/m68k/platform/coldfire/timers.c +1 -3
index 60242f6..0d90da3 100644
@@ -88,7 +88,6 @@ static struct clocksource mcftmr_clk = {
 	.name	= "tmr",
 	.rating	= 250,
 	.read	= mcftmr_read_clk,
-	.shift	= 20,
 	.mask	= CLOCKSOURCE_MASK(32),
 	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
 };
@@ -109,8 +108,7 @@ void hw_timer_init(void)
 	__raw_writew(MCFTIMER_TMR_ENORI | MCFTIMER_TMR_CLK16 |
 		MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, TA(MCFTIMER_TMR));
 
-	mcftmr_clk.mult = clocksource_hz2mult(FREQ, mcftmr_clk.shift);
-	clocksource_register(&mcftmr_clk);
+	clocksource_register_hz(&mcftmr_clk, FREQ);
 
 	setup_irq(MCF_IRQ_TIMER, &mcftmr_timer_irq);
 
Signature · 1 line
1.7.3.2.146.gca209
Acked-by
#4 lore raw

Re: [PATCH 6/8] clocksource: m86k: Convert to clocksource_register_hz/khz

Hi John,

Quoted 5 lines · john stultz

Updated to merge the valid bits of the two m68k patches.

This converts the m86k clocksources to use clocksource_register_hz/khz

This is untested, so any assistance in testing would be appreciated!

This looks good. I test compiled across all targets these files affect. And run tested on ColdFire/5208 (which uses pit.c).

Quoted 3 lines
CC Geert Uytterhoeven<[email protected]>
CC Greg Ungerer<[email protected]>

Do you want me to push these via the m68knommu git tree?

Regards
Greg

Quoted 118 lines
  arch/m68k/platform/68328/timers.c       |    4 +---
  arch/m68k/platform/coldfire/dma_timer.c |    5 +----
  arch/m68k/platform/coldfire/pit.c       |    4 +---
  arch/m68k/platform/coldfire/sltimers.c  |    4 +---
  arch/m68k/platform/coldfire/timers.c    |    4 +---
  5 files changed, 5 insertions(+), 16 deletions(-)
arch/m68k/platform/68328/timers.c +1 -3
index 309f725..f267886 100644
@@ -93,7 +93,6 @@ static struct clocksource m68328_clk = {
  	.name	= "timer",
  	.rating	= 250,
  	.read	= m68328_read_clk,
-	.shift	= 20,
  	.mask	= CLOCKSOURCE_MASK(32),
  	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
  };
@@ -115,8 +114,7 @@ void hw_timer_init(void)
 
  	/* Enable timer 1 */
  	TCTL |= TCTL_TEN;
-	m68328_clk.mult = clocksource_hz2mult(TICKS_PER_JIFFY*HZ, m68328_clk.shift);
-	clocksource_register(&m68328_clk);
+	clocksource_register_hz(&m68328_clk, TICKS_PER_JIFFY*HZ);
  }
 
  /***************************************************************************/
arch/m68k/platform/coldfire/dma_timer.c +1 -4
index a5f5628..235ad57 100644
@@ -44,7 +44,6 @@ static struct clocksource clocksource_cf_dt = {
  	.rating		= 200,
  	.read		= cf_dt_get_cycles,
  	.mask		= CLOCKSOURCE_MASK(32),
-	.shift		= 20,
  	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
  };
 
@@ -60,9 +59,7 @@ static int __init  init_cf_dt_clocksource(void)
  	__raw_writeb(0x00, DTER0);
  	__raw_writel(0x00000000, DTRR0);
  	__raw_writew(DMA_DTMR_CLK_DIV_16 | DMA_DTMR_ENABLE, DTMR0);
-	clocksource_cf_dt.mult = clocksource_hz2mult(DMA_FREQ,
-						     clocksource_cf_dt.shift);
-	return clocksource_register(&clocksource_cf_dt);
+	return clocksource_register_hz(&clocksource_cf_dt, DMA_FREQ);
  }
 
  arch_initcall(init_cf_dt_clocksource);
arch/m68k/platform/coldfire/pit.c +1 -3
index c2b9809..02663d2 100644
@@ -144,7 +144,6 @@ static struct clocksource pit_clk = {
  	.name	= "pit",
  	.rating	= 100,
  	.read	= pit_read_clk,
-	.shift	= 20,
  	.mask	= CLOCKSOURCE_MASK(32),
  };
 
@@ -162,8 +161,7 @@ void hw_timer_init(void)
 
  	setup_irq(MCFINT_VECBASE + MCFINT_PIT1,&pit_irq);
 
-	pit_clk.mult = clocksource_hz2mult(FREQ, pit_clk.shift);
-	clocksource_register(&pit_clk);
+	clocksource_register_hz(&pit_clk, FREQ);
  }
 
  /***************************************************************************/
arch/m68k/platform/coldfire/sltimers.c +1 -3
index 6a85daf..b7f822b 100644
@@ -114,7 +114,6 @@ static struct clocksource mcfslt_clk = {
  	.name	= "slt",
  	.rating	= 250,
  	.read	= mcfslt_read_clk,
-	.shift	= 20,
  	.mask	= CLOCKSOURCE_MASK(32),
  	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
  };
@@ -136,8 +135,7 @@ void hw_timer_init(void)
 
  	setup_irq(MCF_IRQ_TIMER,&mcfslt_timer_irq);
 
-	mcfslt_clk.mult = clocksource_hz2mult(MCF_BUSCLK, mcfslt_clk.shift);
-	clocksource_register(&mcfslt_clk);
+	clocksource_register_hz(&mcfslt_clk, MCF_BUSCLK);
 
  #ifdef CONFIG_HIGHPROFILE
  	mcfslt_profile_init();
arch/m68k/platform/coldfire/timers.c +1 -3
index 60242f6..0d90da3 100644
@@ -88,7 +88,6 @@ static struct clocksource mcftmr_clk = {
  	.name	= "tmr",
  	.rating	= 250,
  	.read	= mcftmr_read_clk,
-	.shift	= 20,
  	.mask	= CLOCKSOURCE_MASK(32),
  	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
  };
@@ -109,8 +108,7 @@ void hw_timer_init(void)
  	__raw_writew(MCFTIMER_TMR_ENORI | MCFTIMER_TMR_CLK16 |
  		MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, TA(MCFTIMER_TMR));
 
-	mcftmr_clk.mult = clocksource_hz2mult(FREQ, mcftmr_clk.shift);
-	clocksource_register(&mcftmr_clk);
+	clocksource_register_hz(&mcftmr_clk, FREQ);
 
  	setup_irq(MCF_IRQ_TIMER,&mcftmr_timer_irq);
 
Signature · 5 lines
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
#5 lore raw

Re: [PATCH 6/8] clocksource: m86k: Convert to clocksource_register_hz/khz

Quoted 11 lines · Greg Ungerer

Hi John,

Quoted 5 lines · john stultz

Updated to merge the valid bits of the two m68k patches.

This converts the m86k clocksources to use clocksource_register_hz/khz

This is untested, so any assistance in testing would be appreciated!

This looks good. I test compiled across all targets these files affect. And run tested on ColdFire/5208 (which uses pit.c).

Thanks for testing! I really appreciate it!

Quoted 8 lines
Quoted 4 lines
CC Geert Uytterhoeven<[email protected]>
CC Greg Ungerer<[email protected]>

Do you want me to push these via the m68knommu git tree?

I'd prefer it go through either one of the m68k trees.

thanks
-john

#6 lore raw

Re: [PATCH 6/8] clocksource: m86k: Convert to clocksource_register_hz/khz

Hi John,

Quoted 20 lines · john stultz
Quoted 11 lines · Greg Ungerer

Hi John,

Quoted 5 lines · john stultz

Updated to merge the valid bits of the two m68k patches.

This converts the m86k clocksources to use clocksource_register_hz/khz

This is untested, so any assistance in testing would be appreciated!

This looks good. I test compiled across all targets these files affect. And run tested on ColdFire/5208 (which uses pit.c).

Thanks for testing! I really appreciate it!

Quoted 5 lines
Quoted 4 lines
CC Geert Uytterhoeven<[email protected]>
CC Greg Ungerer<[email protected]>
Quoted 5 lines
Quoted 3 lines

Do you want me to push these via the m68knommu git tree?

I'd prefer it go through either one of the m68k trees.

Ok, I have put it int the m68knommu git tree (since all the changes apply to non-mmu versions of the m68k).

Thanks
Greg

------------------------------------------------------------------------

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com