dmaengine: sirf: enable the driver support new SiRFmarco SoC
PATCH 3/3 dmaengine: sirf: enable the driver support new SiRFmarco SoC
From: Barry Song <[email protected]>
The driver supports old up SiRFprimaII SoCs, this patch makes it support the new SiRFmarco as well.
SiRFmarco, as a SMP SoC, adds new DMA_INT_EN_CLR and DMA_CH_LOOP_CTRL_CLR registers, to disable IRQ/Channel, we should write 1 to the corresponding bit in the two CLEAR register.
Tested on SiRFmarco using SPI driver:
$ /mnt/spidev-sirftest -D /dev/spidev32766.0
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz) 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00
$ cat /proc/interrupts
CPU0 CPU1
32: 1593 0 GIC sirfsoc_timer0
33: 0 3533 GIC sirfsoc_timer1
44: 0 0 GIC sirfsoc_dma
45: 16 0 GIC sirfsoc_dma
47: 6 0 GIC sirfsoc_spi
50: 5654 0 GIC sirfsoc-uart
...---
depends on pulled CSR SiRFmarco preparing patches:
http://www.spinics.net/lists/arm-kernel/msg191412.html
drivers/dma/Kconfig | 2 +- drivers/dma/sirf-dma.c | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-)
drivers/dma/Kconfig +1 -1
@@ -203,7 +203,7 @@ config TIMB_DMA config SIRF_DMA tristate "CSR SiRFprimaII DMA support" - depends on ARCH_PRIMA2 + depends on ARCH_SIRF select DMA_ENGINE help Enable support for the CSR SiRFprimaII DMA engine.
drivers/dma/sirf-dma.c +19 -6
@@ -32,7 +32,9 @@#define SIRFSOC_DMA_CH_VALID 0x140#define SIRFSOC_DMA_CH_INT 0x144#define SIRFSOC_DMA_INT_EN 0x148 +#define SIRFSOC_DMA_INT_EN_CLR 0x14C#define SIRFSOC_DMA_CH_LOOP_CTRL 0x150 +#define SIRFSOC_DMA_CH_LOOP_CTRL_CLR 0x15C#define SIRFSOC_DMA_MODE_CTRL_BIT 4#define SIRFSOC_DMA_DIR_CTRL_BIT 5
@@ -76,6 +78,7 @@ struct sirfsoc_dma {struct sirfsoc_dma_chan channels[SIRFSOC_DMA_CHANNELS ];void __iomem *base;int irq; +bool is_marco; };#define DRV_NAME "sirfsoc_dma"
@@ -288,13 +291,19 @@ static int sirfsoc_dma_terminate_all(struct sirfsoc_dma_chan *schan)int cid = schan->chan.chan_id;unsigned long flags; -writel_relaxed (readl_relaxed (sdma->base +SIRFSOC_DMA_INT_EN ) & - ~(1 << cid), sdma->base +SIRFSOC_DMA_INT_EN ); -writel_relaxed (1 << cid, sdma->base +SIRFSOC_DMA_CH_VALID ); - -writel_relaxed (readl_relaxed (sdma->base +SIRFSOC_DMA_CH_LOOP_CTRL ) - & ~((1 << cid) |1 << (cid +16 )), +if (!sdma->is_marco) { +writel_relaxed (readl_relaxed (sdma->base +SIRFSOC_DMA_INT_EN ) & + ~(1 << cid), sdma->base +SIRFSOC_DMA_INT_EN ); +writel_relaxed (readl_relaxed (sdma->base +SIRFSOC_DMA_CH_LOOP_CTRL ) + & ~((1 << cid) |1 << (cid +16 )), sdma->base +SIRFSOC_DMA_CH_LOOP_CTRL ); + }else { +writel_relaxed (1 << cid, sdma->base +SIRFSOC_DMA_INT_EN_CLR ); +writel_relaxed ((1 << cid) |1 << (cid +16 ), + sdma->base +SIRFSOC_DMA_CH_LOOP_CTRL_CLR ); + } + +writel_relaxed (1 << cid, sdma->base +SIRFSOC_DMA_CH_VALID );spin_lock_irqsave (&schan->lock, flags);list_splice_tail_init (&schan->active, &schan->free);
@@ -568,6 +577,9 @@ static int __devinit sirfsoc_dma_probe(struct platform_device *op)return -ENOMEM ; } +if (of_device_is_compatible (dn,"sirf,marco-dmac" )) + sdma->is_marco = true; +if (of_property_read_u32 (dn,"cell-index" , &id)) {dev_err (dev,"Fail to get DMAC index\n" ); ret = -ENODEV ;
@@ -677,6 +689,7 @@ static int __devexit sirfsoc_dma_remove(struct platform_device *op)static struct of_device_id sirfsoc_dma_match[] = { { .compatible ="sirf,prima2-dmac" , }, + { .compatible ="sirf,marco-dmac" , }, {}, };
Signature · 6 lines
1.7.0.4 Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog
PATCH 3/3 dmaengine: sirf: enable the driver support new SiRFmarco SoC
Quoted 46 lines · Barry Song
From: Barry Song <[email protected]>
The driver supports old up SiRFprimaII SoCs, this patch makes it support the new SiRFmarco as well.
SiRFmarco, as a SMP SoC, adds newDMA_INT_EN_CLRandDMA_CH_LOOP_CTRL_CLRregisters, to disable IRQ/Channel, we should write 1 to the corresponding bit in the two CLEAR register.Tested on SiRFmarco using SPI driver:
$ /mnt/spidev-sirftest -D /dev/spidev32766.0 spi mode: 0 bits per word: 8 max speed: 500000 Hz (500 KHz)00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 $ cat /proc/interrupts CPU0 CPU1 32: 1593 0 GIC sirfsoc_timer0 33: 0 3533 GIC sirfsoc_timer1 44: 0 0 GIC sirfsoc_dma 45: 16 0 GIC sirfsoc_dma 47: 6 0 GIC sirfsoc_spi 50: 5654 0 GIC sirfsoc-uart ...Signed-off-by Barry Song <[email protected]>---
depends on pulled CSR SiRFmarco preparing patches:
http://www.spinics.net/lists/arm-kernel/msg191412.htmldrivers/dma/Kconfig | 2 +- drivers/dma/sirf-dma.c | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-)drivers/dma/Kconfig +0
-0
drivers/dma/Kconfig config TIMB_DMA · line 206
Quoted 5 lines
drivers/dma/Kconfig +1
-1@@ -203,7 +203,7 @@ config TIMB_DMA config SIRF_DMA tristate "CSR SiRFprimaII DMA support" - depends on ARCH_PRIMA2 + depends on ARCH_SIRF
patch description says adding support, but now your are removing for PRIMA2, did I miss anything?
drivers/dma/sirf-dma.c line 35
Quoted 12 lines
drivers/dma/Kconfig +0
-0select DMA_ENGINE help Enable support for the CSR SiRFprimaII DMA engine.drivers/dma/sirf-dma.c +1
-0@@ -32,7 +32,9 @@#define SIRFSOC_DMA_CH_VALID 0x140#define SIRFSOC_DMA_CH_INT 0x144#define SIRFSOC_DMA_INT_EN 0x148 +#define SIRFSOC_DMA_INT_EN_CLR 0x14C
can you pls align this
Quoted 40 lines
drivers/dma/sirf-dma.c +14
-6#define SIRFSOC_DMA_CH_LOOP_CTRL 0x150 +#define SIRFSOC_DMA_CH_LOOP_CTRL_CLR 0x15C#define SIRFSOC_DMA_MODE_CTRL_BIT 4#define SIRFSOC_DMA_DIR_CTRL_BIT 5@@ -76,6 +78,7 @@ struct sirfsoc_dma {struct sirfsoc_dma_chan channels[SIRFSOC_DMA_CHANNELS ];void __iomem *base;int irq; +bool is_marco; };#define DRV_NAME "sirfsoc_dma"@@ -288,13 +291,19 @@ static int sirfsoc_dma_terminate_all(struct sirfsoc_dma_chan *schan)int cid = schan->chan.chan_id;unsigned long flags; -writel_relaxed (readl_relaxed (sdma->base +SIRFSOC_DMA_INT_EN ) & - ~(1 << cid), sdma->base +SIRFSOC_DMA_INT_EN ); -writel_relaxed (1 << cid, sdma->base +SIRFSOC_DMA_CH_VALID ); - -writel_relaxed (readl_relaxed (sdma->base +SIRFSOC_DMA_CH_LOOP_CTRL ) - & ~((1 << cid) |1 << (cid +16 )), +if (!sdma->is_marco) { +writel_relaxed (readl_relaxed (sdma->base +SIRFSOC_DMA_INT_EN ) & + ~(1 << cid), sdma->base +SIRFSOC_DMA_INT_EN ); +writel_relaxed (readl_relaxed (sdma->base +SIRFSOC_DMA_CH_LOOP_CTRL ) + & ~((1 << cid) |1 << (cid +16 )), sdma->base +SIRFSOC_DMA_CH_LOOP_CTRL ); + }else { +writel_relaxed (1 << cid, sdma->base +SIRFSOC_DMA_INT_EN_CLR ); +writel_relaxed ((1 << cid) |1 << (cid +16 ), + sdma->base +SIRFSOC_DMA_CH_LOOP_CTRL_CLR ); + } + +writel_relaxed (1 << cid, sdma->base +SIRFSOC_DMA_CH_VALID );spin_lock_irqsave (&schan->lock, flags);list_splice_tail_init (&schan->active, &schan->free);
drivers/dma/sirf-dma.c static int __devinit sirfsoc_dma_probe(struct platform_device *op) · line 580
Quoted 4 lines
drivers/dma/sirf-dma.c +1
-0@@ -568,6 +577,9 @@ static int __devinit sirfsoc_dma_probe(struct platform_device *op)return -ENOMEM ; } +if (of_device_is_compatible (dn,"sirf,marco-dmac" ))
not a DT expert, but wouldn't there be a space after comma?
Quoted 13 lines
drivers/dma/sirf-dma.c +3
-0+ sdma->is_marco = true; +if (of_property_read_u32 (dn,"cell-index" , &id)) {dev_err (dev,"Fail to get DMAC index\n" ); ret = -ENODEV ;@@ -677,6 +689,7 @@ static int __devexit sirfsoc_dma_remove(struct platform_device *op)static struct of_device_id sirfsoc_dma_match[] = { { .compatible ="sirf,prima2-dmac" , }, + { .compatible ="sirf,marco-dmac" , }, {}, };
Signature · 2 lines
Vinod Koul Intel Corp.
PATCH 3/3 dmaengine: sirf: enable the driver support new SiRFmarco SoC
Hi Vinod,
Thanks a lot!
2012/10/24 Vinod Koul <[email protected]>
Quoted 49 lines · Barry Song
Quoted 47 lines
From: Barry Song <[email protected]>
The driver supports old up SiRFprimaII SoCs, this patch makes it support the new SiRFmarco as well.
SiRFmarco, as a SMP SoC, adds newDMA_INT_EN_CLRandDMA_CH_LOOP_CTRL_CLRregisters, to disable IRQ/Channel, we should write 1 to the corresponding bit in the two CLEAR register.Tested on SiRFmarco using SPI driver:
$ /mnt/spidev-sirftest -D /dev/spidev32766.0 spi mode: 0 bits per word: 8 max speed: 500000 Hz (500 KHz)00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 $ cat /proc/interrupts CPU0 CPU1 32: 1593 0 GIC sirfsoc_timer0 33: 0 3533 GIC sirfsoc_timer1 44: 0 0 GIC sirfsoc_dma 45: 16 0 GIC sirfsoc_dma 47: 6 0 GIC sirfsoc_spi 50: 5654 0 GIC sirfsoc-uart ...Signed-off-by Barry Song <[email protected]>---
depends on pulled CSR SiRFmarco preparing patches:
http://www.spinics.net/lists/arm-kernel/msg191412.htmldrivers/dma/Kconfig | 2 +- drivers/dma/sirf-dma.c | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-)drivers/dma/Kconfig +0
-0@@ -203,7 +203,7 @@ config TIMB_DMA
Quoted 6 lines
drivers/dma/Kconfig config TIMB_DMA · line 206
Quoted 4 lines
drivers/dma/Kconfig +1
-1config SIRF_DMA tristate "CSR SiRFprimaII DMA support" - depends on ARCH_PRIMA2 + depends on ARCH_SIRFpatch description says adding support, but now your are removing for PRIMA2, did I miss anything?
this is not removing PRIMA2, as you see the newest kernel, SIRF includes PRIMA2 and coming MARCO. so let the driver depend on SIRF since it supports both PRIMA2 and MARCO. see commit:
Quoted 50 lines
drivers/dma/sirf-dma.c line 35
Quoted 12 lines
drivers/dma/Kconfig +0
-0select DMA_ENGINE help Enable support for the CSR SiRFprimaII DMA engine.drivers/dma/sirf-dma.c +1
-0@@ -32,7 +32,9 @@#define SIRFSOC_DMA_CH_VALID 0x140#define SIRFSOC_DMA_CH_INT 0x144#define SIRFSOC_DMA_INT_EN 0x148 +#define SIRFSOC_DMA_INT_EN_CLR 0x14Ccan you pls align this
Quoted 37 lines
drivers/dma/sirf-dma.c +14
-6#define SIRFSOC_DMA_CH_LOOP_CTRL 0x150 +#define SIRFSOC_DMA_CH_LOOP_CTRL_CLR 0x15C#define SIRFSOC_DMA_MODE_CTRL_BIT 4#define SIRFSOC_DMA_DIR_CTRL_BIT 5@@ -76,6 +78,7 @@ struct sirfsoc_dma {struct sirfsoc_dma_chan channels[SIRFSOC_DMA_CHANNELS ];void __iomem *base;int irq; +bool is_marco; };#define DRV_NAME "sirfsoc_dma"@@ -288,13 +291,19 @@ static int sirfsoc_dma_terminate_all(struct sirfsoc_dma_chan *schan)int cid = schan->chan.chan_id;unsigned long flags; -writel_relaxed (readl_relaxed (sdma->base +SIRFSOC_DMA_INT_EN ) & - ~(1 << cid), sdma->base +SIRFSOC_DMA_INT_EN ); -writel_relaxed (1 << cid, sdma->base +SIRFSOC_DMA_CH_VALID ); - -writel_relaxed (readl_relaxed (sdma->base +SIRFSOC_DMA_CH_LOOP_CTRL ) - & ~((1 << cid) |1 << (cid +16 )), +if (!sdma->is_marco) { +writel_relaxed (readl_relaxed (sdma->base +SIRFSOC_DMA_INT_EN ) & + ~(1 << cid), sdma->base +SIRFSOC_DMA_INT_EN ); +writel_relaxed (readl_relaxed (sdma->base +SIRFSOC_DMA_CH_LOOP_CTRL ) + & ~((1 << cid) |1 << (cid +16 )), sdma->base +SIRFSOC_DMA_CH_LOOP_CTRL ); + }else { +writel_relaxed (1 << cid, sdma->base +SIRFSOC_DMA_INT_EN_CLR ); +writel_relaxed ((1 << cid) |1 << (cid +16 ), + sdma->base +SIRFSOC_DMA_CH_LOOP_CTRL_CLR ); + } + +writel_relaxed (1 << cid, sdma->base +SIRFSOC_DMA_CH_VALID );
Quoted 8 lines
drivers/dma/sirf-dma.c static int __devinit sirfsoc_dma_probe(struct platform_device *op) · line 580
Quoted 7 lines
drivers/dma/sirf-dma.c +1
-0spin_lock_irqsave (&schan->lock, flags);list_splice_tail_init (&schan->active, &schan->free);@@ -568,6 +577,9 @@ static int __devinit sirfsoc_dma_probe(struct platform_device *op)return -ENOMEM ; } +if (of_device_is_compatible (dn,"sirf,marco-dmac" ))not a DT expert, but wouldn't there be a space after comma?
compatible fields in .dts don't have space after comma:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=tree;f=arch/arm/boot/dts;
Quoted 7 lines
Quoted 7 lines
drivers/dma/sirf-dma.c +2
-0+ sdma->is_marco = true; +if (of_property_read_u32 (dn,"cell-index" , &id)) {dev_err (dev,"Fail to get DMAC index\n" ); ret = -ENODEV ;@@ -677,6 +689,7 @@ static int __devexit sirfsoc_dma_remove(struct platform_device *op)
Quoted 11 lines
drivers/dma/sirf-dma.c static int __devexit sirfsoc_dma_remove(struct platform_device *op) · line 695
Quoted 6 lines
drivers/dma/sirf-dma.c +1
-0static struct of_device_id sirfsoc_dma_match[] = { { .compatible ="sirf,prima2-dmac" , }, + { .compatible ="sirf,marco-dmac" , }, {}, };--
Vinod Koul
Intel Corp.
-barry
PATCH 3/3 dmaengine: sirf: enable the driver support new SiRFmarco SoC
Quoted 2 lines · Barry Song
Hi Vinod,
Thanks a lot!
Please dont top post.
Quoted 38 lines
2012/10/24 Vinod Koul <[email protected]>
Quoted 36 lines · Barry Song
Quoted 34 lines
From: Barry Song <[email protected]>
The driver supports old up SiRFprimaII SoCs, this patch makes it support the new SiRFmarco as well.
SiRFmarco, as a SMP SoC, adds newDMA_INT_EN_CLRandDMA_CH_LOOP_CTRL_CLRregisters, to disable IRQ/Channel, we should write 1 to the corresponding bit in the two CLEAR register.Tested on SiRFmarco using SPI driver:
$ /mnt/spidev-sirftest -D /dev/spidev32766.0 spi mode: 0 bits per word: 8 max speed: 500000 Hz (500 KHz)00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 $ cat /proc/interrupts CPU0 CPU1 32: 1593 0 GIC sirfsoc_timer0 33: 0 3533 GIC sirfsoc_timer1 44: 0 0 GIC sirfsoc_dma 45: 16 0 GIC sirfsoc_dma 47: 6 0 GIC sirfsoc_spi 50: 5654 0 GIC sirfsoc-uart ...Signed-off-by Barry Song <[email protected]>---
I tried applying this and it failed for me. Can you please respin this on my next and send again.
Signature · 2 lines
Vinod Koul Intel Corp.
PATCH 3/3 dmaengine: sirf: enable the driver support new SiRFmarco SoC
2012/10/25 Vinod Koul <[email protected]>:
Quoted 4 lines · Barry Song
Quoted 2 lines
Hi Vinod,
Thanks a lot!Please dont top post.
well. saying hello is an exception :-)
Quoted 36 lines
Quoted 36 lines
2012/10/24 Vinod Koul <[email protected]>
Quoted 34 lines · Barry Song
Quoted 32 lines
From: Barry Song <[email protected]>
The driver supports old up SiRFprimaII SoCs, this patch makes it support the new SiRFmarco as well.
SiRFmarco, as a SMP SoC, adds newDMA_INT_EN_CLRandDMA_CH_LOOP_CTRL_CLRregisters, to disable IRQ/Channel, we should write 1 to the corresponding bit in the two CLEAR register.Tested on SiRFmarco using SPI driver:
$ /mnt/spidev-sirftest -D /dev/spidev32766.0 spi mode: 0 bits per word: 8 max speed: 500000 Hz (500 KHz)00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 $ cat /proc/interrupts CPU0 CPU1 32: 1593 0 GIC sirfsoc_timer0 33: 0 3533 GIC sirfsoc_timer1 44: 0 0 GIC sirfsoc_dma 45: 16 0 GIC sirfsoc_dma 47: 6 0 GIC sirfsoc_spi 50: 5654 0 GIC sirfsoc-uart ...
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Signed-off-by Barry Song <[email protected]>---
I tried applying this and it failed for me. Can you please respin this on my next and send again.
ok
Quoted 4 lines
--
Vinod Koul
Intel Corp.
-barry
PATCH 3/3 dmaengine: sirf: enable the driver support new SiRFmarco SoC
2012/10/25 Barry Song <[email protected]>
Quoted 52 lines
2012/10/25 Vinod Koul <[email protected]>:
Quoted 4 lines · Barry Song
Quoted 2 lines
Hi Vinod,
Thanks a lot!Please dont top post.
well. saying hello is an exception :-)
Quoted 43 lines
Quoted 41 lines
2012/10/24 Vinod Koul <[email protected]>
Quoted 39 lines · Barry Song
Quoted 37 lines
From: Barry Song <[email protected]>
The driver supports old up SiRFprimaII SoCs, this patch makes it support
the new SiRFmarco as well.
SiRFmarco, as a SMP SoC, adds newDMA_INT_EN_CLRandDMA_CH_LOOP_CTRL_CLR
registers, to disable IRQ/Channel, we should write 1 to the corresponding
bit in the two CLEAR register.Tested on SiRFmarco using SPI driver:
$ /mnt/spidev-sirftest -D /dev/spidev32766.0 spi mode: 0 bits per word: 8 max speed: 500000 Hz (500 KHz)00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 $ cat /proc/interrupts CPU0 CPU1 32: 1593 0 GIC sirfsoc_timer0 33: 0 3533 GIC sirfsoc_timer1 44: 0 0 GIC sirfsoc_dma 45: 16 0 GIC sirfsoc_dma 47: 6 0 GIC sirfsoc_spi 50: 5654 0 GIC sirfsoc-uart ...Signed-off-by Barry Song <[email protected]>---
I tried applying this and it failed for me. Can you please respin this on my next and send again.
done. at:
http://www.spinics.net/lists/arm-kernel/msg204504.html
Quoted 6 lines
Quoted 4 lines
--
Vinod Koul
Intel Corp.-barry