m68knommu: use ColdFire DMA timer
cover m68knommu: use ColdFire DMA timer
From: Greg Ungerer <[email protected]>
Most of the modern ColdFire family members contain the DMA timer hardware module. Build the support code for it and use it on those that do. We can use it as an accurate time source.
I don't have test platforms based on all of these ColdFire types, it would be really helpful if anyone that has any of these can test these changes. It build tests fine on all these types, and it works on 520x and 527x based platforms.
These changes are (neccessarily) on top of my recent patch series titled "clean up timer code on the ColdFire 53xx".
--- arch/m68k/include/asm/m520xsim.h | 8 ++++++++ arch/m68k/include/asm/m523xsim.h | 8 ++++++++ arch/m68k/include/asm/m527xsim.h | 8 ++++++++ arch/m68k/include/asm/m528xsim.h | 8 ++++++++ arch/m68k/include/asm/m53xxsim.h | 10 +++++----- arch/m68k/include/asm/m5441xsim.h | 8 ++++++++ arch/m68k/platform/coldfire/Makefile | 10 +++++----- arch/m68k/platform/coldfire/dma_timer.c | 24 +++++++++++++----------- 8 files changed, 63 insertions(+), 21 deletions(-)
PATCH 1/9 m68knommu: add DMA timer base address definitions for ColdFire 53xx
From: Greg Ungerer <[email protected]>
The Coldfire 532x and 537x CPU families also contain the ColdFire DMA Timer hardware unit. Add address definitions for it.
--- arch/m68k/include/asm/m53xxsim.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/m68k/include/asm/m53xxsim.h +5 -5
@@ -116,12 +116,12 @@#define MCFPIT_BASE4 0xFC08C000/* Base address of TIMER4 */ /* -* Timer module. +* DMA Timer module. */ -#define MCFTIMER_BASE1 0xFC070000/* Base address of TIMER1 */ -#define MCFTIMER_BASE2 0xFC074000/* Base address of TIMER2 */ -#define MCFTIMER_BASE3 0xFC078000/* Base address of TIMER3 */ -#define MCFTIMER_BASE4 0xFC07C000/* Base address of TIMER4 */ +#define MCFDTIM_BASE0 0xFC070000/* Base of DMA TIMER 0 */ +#define MCFDTIM_BASE1 0xFC074000/* Base of DMA TIMER 1 */ +#define MCFDTIM_BASE2 0xFC078000/* Base of DMA TIMER 2 */ +#define MCFDTIM_BASE3 0xFC07C000/* Base of DMA TIMER 3 */ /********************************************************************* *
Signature · 1 line
1.8.1.4
PATCH 2/9 m68knommu: add DMA timer base address definitions for ColdFire 520x
In reply to [email protected]From: Greg Ungerer <[email protected]>
The Coldfire 520x CPU family also contains the ColdFire DMA Timer hardware unit. Add address definitions for it.
--- arch/m68k/include/asm/m520xsim.h | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/m68k/include/asm/m520xsim.h +8 -0
@@ -159,6 +159,14 @@#define MCFPIT_BASE2 0xFC084000/* Base address of TIMER2 */ /* +* DMA Timer module. +*/ +#define MCFDTIM_BASE0 0xFC070000/* Base of DMA TIMER 0 */ +#define MCFDTIM_BASE1 0xFC074000/* Base of DMA TIMER 1 */ +#define MCFDTIM_BASE2 0xFC078000/* Base of DMA TIMER 2 */ +#define MCFDTIM_BASE3 0xFC07C000/* Base of DMA TIMER 3 */ + +/* * UART module. */ #define MCFUART_BASE0 0xFC060000/* Base address of UART0 */
Signature · 1 line
1.8.1.4
PATCH 3/9 m68knommu: add DMA timer base address definitions for ColdFire 523x
In reply to [email protected]From: Greg Ungerer <[email protected]>
The Coldfire 523x CPU family also contains the ColdFire DMA Timer hardware unit. Add address definitions for it.
--- arch/m68k/include/asm/m523xsim.h | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/m68k/include/asm/m523xsim.h +8 -0
@@ -164,6 +164,14 @@#define MCFPIT_BASE4 (MCF_IPSBAR + 0x180000)/* +* DMA timer base addresses. +*/ +#define MCFDTIM_BASE0 (MCF_IPSBAR + 0x000400) +#define MCFDTIM_BASE1 (MCF_IPSBAR + 0x000440) +#define MCFDTIM_BASE2 (MCF_IPSBAR + 0x000480) +#define MCFDTIM_BASE3 (MCF_IPSBAR + 0x0004C0) + +/* * EPort */ #define MCFEPORT_EPPAR (MCF_IPSBAR + 0x130000)
Signature · 1 line
1.8.1.4
PATCH 4/9 m68knommu: add DMA timer base address definitions for ColdFire 527x
In reply to [email protected]From: Greg Ungerer <[email protected]>
The Coldfire 527x CPU family also contains the ColdFire DMA Timer hardware unit. Add address definitions for it.
--- arch/m68k/include/asm/m527xsim.h | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/m68k/include/asm/m527xsim.h +8 -0
@@ -333,6 +333,14 @@#define MCFPIT_BASE4 (MCF_IPSBAR + 0x180000)/* +* DMA timer base addresses. +*/ +#define MCFDTIM_BASE0 (MCF_IPSBAR + 0x000400) +#define MCFDTIM_BASE1 (MCF_IPSBAR + 0x000440) +#define MCFDTIM_BASE2 (MCF_IPSBAR + 0x000480) +#define MCFDTIM_BASE3 (MCF_IPSBAR + 0x0004C0) + +/* * EPort */ #define MCFEPORT_EPPAR (MCF_IPSBAR + 0x130000)
Signature · 1 line
1.8.1.4
PATCH 5/9 m68knommu: add DMA timer base address definitions for ColdFire 528x
In reply to [email protected]From: Greg Ungerer <[email protected]>
The Coldfire 528x CPU family also contains the ColdFire DMA Timer hardware unit. Add address definitions for it.
--- arch/m68k/include/asm/m528xsim.h | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/m68k/include/asm/m528xsim.h +8 -0
@@ -194,6 +194,14 @@#define MCFPIT_BASE4 (MCF_IPSBAR + 0x00180000)/* +* DMA timer base addresses. +*/ +#define MCFDTIM_BASE0 (MCF_IPSBAR + 0x000400) +#define MCFDTIM_BASE1 (MCF_IPSBAR + 0x000440) +#define MCFDTIM_BASE2 (MCF_IPSBAR + 0x000480) +#define MCFDTIM_BASE3 (MCF_IPSBAR + 0x0004C0) + +/* * Edge Port registers */ #define MCFEPORT_EPPAR (MCF_IPSBAR + 0x00130000)
Signature · 1 line
1.8.1.4
PATCH 6/9 m68knommu: add DMA timer base address definitions for ColdFire 5441x
In reply to [email protected]From: Greg Ungerer <[email protected]>
The Coldfire 5441x CPU family also contains the ColdFire DMA Timer hardware unit. Add address definitions for it.
--- arch/m68k/include/asm/m5441xsim.h | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/m68k/include/asm/m5441xsim.h +8 -0
@@ -102,6 +102,14 @@#define MCF_IRQ_PIT1 (MCFINT2_VECBASE + MCFINT2_PIT1)/* +* DMA Timer module. +*/ +#define MCFDTIM_BASE0 0xFC070000/* Base of DMA TIMER 0 */ +#define MCFDTIM_BASE1 0xFC074000/* Base of DMA TIMER 1 */ +#define MCFDTIM_BASE2 0xFC078000/* Base of DMA TIMER 2 */ +#define MCFDTIM_BASE3 0xFC07C000/* Base of DMA TIMER 3 */ + +/* * Power Management */ #define MCFPM_WCR 0xfc040013
Signature · 1 line
1.8.1.4
PATCH 7/9 m68knommu: modify ColdFire dma_timer to use common definitions
In reply to [email protected]From: Greg Ungerer <[email protected]>
The ColdFire DMA Timer hardware module is used on a number of the ColdFire family System on Chips. Modify the dma_timer.c driver address definitions so that it can be used on any of those devices.
--- arch/m68k/platform/coldfire/dma_timer.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)
arch/m68k/platform/coldfire/dma_timer.c +6 -11
@@ -14,17 +14,12 @@#include <asm/mcfpit.h> #include <asm/mcfsim.h> -#define DMA_TIMER_0 (0x00) -#define DMA_TIMER_1 (0x40) -#define DMA_TIMER_2 (0x80) -#define DMA_TIMER_3 (0xc0) - -#define DTMR0 (MCF_IPSBAR + DMA_TIMER_0 + 0x400) -#define DTXMR0 (MCF_IPSBAR + DMA_TIMER_0 + 0x402) -#define DTER0 (MCF_IPSBAR + DMA_TIMER_0 + 0x403) -#define DTRR0 (MCF_IPSBAR + DMA_TIMER_0 + 0x404) -#define DTCR0 (MCF_IPSBAR + DMA_TIMER_0 + 0x408) -#define DTCN0 (MCF_IPSBAR + DMA_TIMER_0 + 0x40c) +#define DTMR0 (MCFDTIM_BASE0 + 0x0) +#define DTXMR0 (MCFDTIM_BASE0 + 0x2) +#define DTER0 (MCFDTIM_BASE0 + 0x3) +#define DTRR0 (MCFDTIM_BASE0 + 0x4) +#define DTCR0 (MCFDTIM_BASE0 + 0x8) +#define DTCN0 (MCFDTIM_BASE0 + 0xc)#define DMA_FREQ ((MCF_CLK / 2) / 16)
Signature · 1 line
1.8.1.4
PATCH 8/9 m68knommu: enable clock when using dma_timer hardware module
In reply to [email protected]From: Greg Ungerer <[email protected]>
Acquire the SoC clock when using the DMA timer hardware module. With the clock acquired we can enable it and get it ticking. On most ColdFire SoC hardware the DMA timer clock is not enabled by default.
--- arch/m68k/platform/coldfire/dma_timer.c | 7 +++++++ 1 file changed, 7 insertions(+)
arch/m68k/platform/coldfire/dma_timer.c +7 -0
@@ -7,6 +7,7 @@*/ #include <linux/clocksource.h> +#include <linux/clk.h> #include <linux/io.h> #include <asm/machdep.h>
@@ -44,12 +45,18 @@ static struct clocksource clocksource_cf_dt = {static int __init init_cf_dt_clocksource (void ) { +struct clk *clk; +/* * We setup DMA timer 0 in free run mode. This incrementing counter is * used as a highly precious clock source. With MCF_CLOCK = 150 MHz we * get a ~213 ns resolution and the 32bit register will overflow almost * every 15 minutes. */ + clk =clk_get (NULL ,"mcftmr.0" ); +if (clk) +clk_enable (clk); +__raw_writeb (0x00 ,DTXMR0 );__raw_writeb (0x00 ,DTER0 );__raw_writel (0x00000000 ,DTRR0 );
Signature · 1 line
1.8.1.4
PATCH 9/9 m68knommu: use ColdFire DMA timer module on devices that have it
In reply to [email protected]From: Greg Ungerer <[email protected]>
The DMA timer hardware module is present in all of the 520x, 527x, 528x, 53xx and 5441x families of ColdFire SoC. Use it as clock source on those parts to give a more accurate clock.
--- arch/m68k/platform/coldfire/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/m68k/platform/coldfire/Makefile +5 -5
@@ -17,18 +17,18 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 obj-$(CONFIG_COLDFIRE) += cache.o clk.o device.o dma.o entry.o vectors.o obj-$(CONFIG_M5206) += m5206.o timers.o intc.o reset.o obj-$(CONFIG_M5206e) += m5206.o timers.o intc.o reset.o -obj-$(CONFIG_M520x) += m520x.o pit.o intc-simr.o reset.o +obj-$(CONFIG_M520x) += m520x.o pit.o dma_timer.o intc-simr.o reset.o obj-$(CONFIG_M523x) += m523x.o pit.o dma_timer.o intc-2.o reset.o obj-$(CONFIG_M5249) += m5249.o timers.o intc.o intc-5249.o reset.o obj-$(CONFIG_M525x) += m525x.o timers.o intc.o intc-525x.o reset.o -obj-$(CONFIG_M527x) += m527x.o pit.o intc-2.o reset.o +obj-$(CONFIG_M527x) += m527x.o pit.o dma_timer.o intc-2.o reset.o obj-$(CONFIG_M5272) += m5272.o intc-5272.o timers.o -obj-$(CONFIG_M528x) += m528x.o pit.o intc-2.o reset.o +obj-$(CONFIG_M528x) += m528x.o pit.o dma_timer.o intc-2.o reset.o obj-$(CONFIG_M5307) += m5307.o timers.o intc.o reset.o -obj-$(CONFIG_M53xx) += m53xx.o pit.o intc-simr.o reset.o +obj-$(CONFIG_M53xx) += m53xx.o pit.o dma_timer.o intc-simr.o reset.o obj-$(CONFIG_M5407) += m5407.o timers.o intc.o reset.o obj-$(CONFIG_M54xx) += m54xx.o sltimers.o intc-2.o -obj-$(CONFIG_M5441x) += m5441x.o pit.o intc-simr.o reset.o +obj-$(CONFIG_M5441x) += m5441x.o pit.o dma_timer.o intc-simr.o reset.o obj-$(CONFIG_NETtel) += nettel.o obj-$(CONFIG_CLEOPATRA) += nettel.o
Signature · 1 line
1.8.1.4
Re: [PATCH 9/9] m68knommu: use ColdFire DMA timer module on devices that have it
Quoted 30 lines · On Tuesday 27 May 2014 5:49:49 pm [email protected] wrote:
From: Greg Ungerer <[email protected]>
The DMA timer hardware module is present in all of the 520x, 527x, 528x, 53xx and 5441x families of ColdFire SoC. Use it as clock source on those parts to give a more accurate clock.
Signed-off-by Greg Ungerer <[email protected]>--- arch/m68k/platform/coldfire/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)(quoted diff) +0
-0b/arch/m68k/platform/coldfire/Makefile index 0818f77..cdd0b03 100644
arch/m68k/platform/coldfire/Makefile +0
-1@@ -17,18 +17,18 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 obj-$(CONFIG_COLDFIRE) += cache.o clk.odevice.o dma.o entry.o vectors.o obj-$(CONFIG_M5206) += m5206.o timers.o
intc.o reset.o
obj-$(CONFIG_M5206e) += m5206.o timers.o intc.o reset.oarch/m68k/platform/coldfire/Makefile +3
-3-obj-$(CONFIG_M520x) += m520x.o pit.o intc-simr.o reset.o +obj-$(CONFIG_M520x) += m520x.o pit.o dma_timer.o intc-simr.o reset.o obj-$(CONFIG_M523x) += m523x.o pit.o dma_timer.o intc-2.o reset.o obj-$(CONFIG_M5249) += m5249.o timers.o intc.o intc-5249.o reset.o obj-$(CONFIG_M525x) += m525x.o timers.o intc.o intc-525x.o reset.o -obj-$(CONFIG_M527x) += m527x.o pit.o intc-2.o reset.o +obj-$(CONFIG_M527x) += m527x.o pit.o dma_timer.o intc-2.o reset.o obj-$(CONFIG_M5272) += m5272.o intc-5272.o timers.o -obj-$(CONFIG_M528x) += m528x.o pit.o intc-2.o reset.o +obj-$(CONFIG_M528x) += m528x.o pit.o dma_timer.o intc-2.o reset.o
arch/m68k/platform/coldfire/Makefile asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 · line 34
Quoted 10 lines
arch/m68k/platform/coldfire/Makefile +2
-2obj-$(CONFIG_M5307) += m5307.o timers.o intc.o reset.o -obj-$(CONFIG_M53xx) += m53xx.o pit.o intc-simr.o reset.o +obj-$(CONFIG_M53xx) += m53xx.o pit.o dma_timer.o intc-simr.o reset.o obj-$(CONFIG_M5407) += m5407.o timers.o intc.o reset.o obj-$(CONFIG_M54xx) += m54xx.o sltimers.o intc-2.o -obj-$(CONFIG_M5441x) += m5441x.o pit.o intc-simr.o reset.o +obj-$(CONFIG_M5441x) += m5441x.o pit.o dma_timer.o intc-simr.o reset.o obj-$(CONFIG_NETtel) += nettel.o obj-$(CONFIG_CLEOPATRA) += nettel.o
Hi Greg,
I couldn't get this part to apply. What tree are you using?
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected] To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [PATCH 9/9] m68knommu: use ColdFire DMA timer module on devices that have it
Hi Steven,
Quoted 39 lines · Steven King
Quoted 38 lines · On Tuesday 27 May 2014 5:49:49 pm [email protected] wrote:
From: Greg Ungerer <[email protected]>
The DMA timer hardware module is present in all of the 520x, 527x, 528x, 53xx and 5441x families of ColdFire SoC. Use it as clock source on those parts to give a more accurate clock.
Signed-off-by Greg Ungerer <[email protected]>--- arch/m68k/platform/coldfire/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)(quoted diff) +0
-0b/arch/m68k/platform/coldfire/Makefile index 0818f77..cdd0b03 100644
arch/m68k/platform/coldfire/Makefile +0
-1@@ -17,18 +17,18 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 obj-$(CONFIG_COLDFIRE) += cache.o clk.odevice.o dma.o entry.o vectors.o obj-$(CONFIG_M5206) += m5206.o timers.o
intc.o reset.o
obj-$(CONFIG_M5206e) += m5206.o timers.o intc.o reset.oarch/m68k/platform/coldfire/Makefile +5
-5-obj-$(CONFIG_M520x) += m520x.o pit.o intc-simr.o reset.o +obj-$(CONFIG_M520x) += m520x.o pit.o dma_timer.o intc-simr.o reset.o obj-$(CONFIG_M523x) += m523x.o pit.o dma_timer.o intc-2.o reset.o obj-$(CONFIG_M5249) += m5249.o timers.o intc.o intc-5249.o reset.o obj-$(CONFIG_M525x) += m525x.o timers.o intc.o intc-525x.o reset.o -obj-$(CONFIG_M527x) += m527x.o pit.o intc-2.o reset.o +obj-$(CONFIG_M527x) += m527x.o pit.o dma_timer.o intc-2.o reset.o obj-$(CONFIG_M5272) += m5272.o intc-5272.o timers.o -obj-$(CONFIG_M528x) += m528x.o pit.o intc-2.o reset.o +obj-$(CONFIG_M528x) += m528x.o pit.o dma_timer.o intc-2.o reset.o obj-$(CONFIG_M5307) += m5307.o timers.o intc.o reset.o -obj-$(CONFIG_M53xx) += m53xx.o pit.o intc-simr.o reset.o +obj-$(CONFIG_M53xx) += m53xx.o pit.o dma_timer.o intc-simr.o reset.o obj-$(CONFIG_M5407) += m5407.o timers.o intc.o reset.o obj-$(CONFIG_M54xx) += m54xx.o sltimers.o intc-2.o -obj-$(CONFIG_M5441x) += m5441x.o pit.o intc-simr.o reset.o +obj-$(CONFIG_M5441x) += m5441x.o pit.o dma_timer.o intc-simr.o reset.o
Quoted 6 lines
Quoted 2 lines
obj-$(CONFIG_NETtel) += nettel.o
obj-$(CONFIG_CLEOPATRA) += nettel.oHi Greg,
I couldn't get this part to apply. What tree are you using?
This was against linux-3.15-rc4
Regards
Greg
_______________________________________________
uClinux-dev mailing list [email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected] To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Quoted 26 lines · On Tuesday 27 May 2014 5:49:40 pm [email protected] wrote:
From: Greg Ungerer <[email protected]>
Most of the modern ColdFire family members contain the DMA timer hardware module. Build the support code for it and use it on those that do. We can use it as an accurate time source.
I don't have test platforms based on all of these ColdFire types, it would be really helpful if anyone that has any of these can test these changes. It build tests fine on all these types, and it works on 520x and 527x based platforms.
These changes are (neccessarily) on top of my recent patch series titled "clean up timer code on the ColdFire 53xx".
Signed-off-by Greg Ungerer <[email protected]>--- arch/m68k/include/asm/m520xsim.h | 8 ++++++++ arch/m68k/include/asm/m523xsim.h | 8 ++++++++ arch/m68k/include/asm/m527xsim.h | 8 ++++++++ arch/m68k/include/asm/m528xsim.h | 8 ++++++++ arch/m68k/include/asm/m53xxsim.h | 10 +++++----- arch/m68k/include/asm/m5441xsim.h | 8 ++++++++ arch/m68k/platform/coldfire/Makefile | 10 +++++----- arch/m68k/platform/coldfire/dma_timer.c | 24 +++++++++++++----------- 8 files changed, 63 insertions(+), 21 deletions(-)
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Greg,
I was able to to test this on 528x and 5441x and didnt have problems, so you can add my Acked-by if you want.
Hi Steven,
Quoted 32 lines · Steven King
Quoted 26 lines · On Tuesday 27 May 2014 5:49:40 pm [email protected] wrote:
From: Greg Ungerer <[email protected]>
Most of the modern ColdFire family members contain the DMA timer hardware module. Build the support code for it and use it on those that do. We can use it as an accurate time source.
I don't have test platforms based on all of these ColdFire types, it would be really helpful if anyone that has any of these can test these changes. It build tests fine on all these types, and it works on 520x and 527x based platforms.
These changes are (neccessarily) on top of my recent patch series titled "clean up timer code on the ColdFire 53xx".
Signed-off-by Greg Ungerer <[email protected]>--- arch/m68k/include/asm/m520xsim.h | 8 ++++++++ arch/m68k/include/asm/m523xsim.h | 8 ++++++++ arch/m68k/include/asm/m527xsim.h | 8 ++++++++ arch/m68k/include/asm/m528xsim.h | 8 ++++++++ arch/m68k/include/asm/m53xxsim.h | 10 +++++----- arch/m68k/include/asm/m5441xsim.h | 8 ++++++++ arch/m68k/platform/coldfire/Makefile | 10 +++++----- arch/m68k/platform/coldfire/dma_timer.c | 24 +++++++++++++----------- 8 files changed, 63 insertions(+), 21 deletions(-)Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines
Hi Greg,
I was able to to test this on 528x and 5441x and didnt have problems, so you can add my Acked-by if you want.
Great, thanks for testing. I will add your acked-by.
The most significant change is for the 532x and 537x, but I don't have either of those to test with.
Regards
Greg