* [PATCH] ARM: edma: Fix configuration parsing for SoCs with multiple eDMA3 CC
@ 2014-08-04 12:26 ` Peter Ujfalusi
0 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2014-08-04 12:26 UTC (permalink / raw)
To: nsekhar, joelf
Cc: linux, vinod.koul, linux-arm-kernel, linux-kernel,
davinci-linux-open-source
The edma_setup_from_hw() should know about the CC number when parsing the
CCCFG register - when it reads the register to be precise. The base
addresses for CCs stored in an array and we need to provide the correct id
to edma_read() in order to read the correct register.
Cc: <stable@vger.kernel.org> # 3.16
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
arch/arm/common/edma.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index 88099175fc56..d86771abbf57 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -1443,14 +1443,14 @@ void edma_assign_channel_eventq(unsigned channel, enum dma_event_q eventq_no)
EXPORT_SYMBOL(edma_assign_channel_eventq);
static int edma_setup_from_hw(struct device *dev, struct edma_soc_info *pdata,
- struct edma *edma_cc)
+ struct edma *edma_cc, int cc_id)
{
int i;
u32 value, cccfg;
s8 (*queue_priority_map)[2];
/* Decode the eDMA3 configuration from CCCFG register */
- cccfg = edma_read(0, EDMA_CCCFG);
+ cccfg = edma_read(cc_id, EDMA_CCCFG);
value = GET_NUM_REGN(cccfg);
edma_cc->num_region = BIT(value);
@@ -1464,7 +1464,8 @@ static int edma_setup_from_hw(struct device *dev, struct edma_soc_info *pdata,
value = GET_NUM_EVQUE(cccfg);
edma_cc->num_tc = value + 1;
- dev_dbg(dev, "eDMA3 HW configuration (cccfg: 0x%08x):\n", cccfg);
+ dev_dbg(dev, "eDMA3 CC%d HW configuration (cccfg: 0x%08x):\n", cc_id,
+ cccfg);
dev_dbg(dev, "num_region: %u\n", edma_cc->num_region);
dev_dbg(dev, "num_channel: %u\n", edma_cc->num_channels);
dev_dbg(dev, "num_slot: %u\n", edma_cc->num_slots);
@@ -1684,7 +1685,7 @@ static int edma_probe(struct platform_device *pdev)
return -ENOMEM;
/* Get eDMA3 configuration from IP */
- ret = edma_setup_from_hw(dev, info[j], edma_cc[j]);
+ ret = edma_setup_from_hw(dev, info[j], edma_cc[j], j);
if (ret)
return ret;
--
2.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] ARM: edma: Fix configuration parsing for SoCs with multiple eDMA3 CC
@ 2014-08-04 12:26 ` Peter Ujfalusi
0 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2014-08-04 12:26 UTC (permalink / raw)
To: linux-arm-kernel
The edma_setup_from_hw() should know about the CC number when parsing the
CCCFG register - when it reads the register to be precise. The base
addresses for CCs stored in an array and we need to provide the correct id
to edma_read() in order to read the correct register.
Cc: <stable@vger.kernel.org> # 3.16
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
arch/arm/common/edma.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index 88099175fc56..d86771abbf57 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -1443,14 +1443,14 @@ void edma_assign_channel_eventq(unsigned channel, enum dma_event_q eventq_no)
EXPORT_SYMBOL(edma_assign_channel_eventq);
static int edma_setup_from_hw(struct device *dev, struct edma_soc_info *pdata,
- struct edma *edma_cc)
+ struct edma *edma_cc, int cc_id)
{
int i;
u32 value, cccfg;
s8 (*queue_priority_map)[2];
/* Decode the eDMA3 configuration from CCCFG register */
- cccfg = edma_read(0, EDMA_CCCFG);
+ cccfg = edma_read(cc_id, EDMA_CCCFG);
value = GET_NUM_REGN(cccfg);
edma_cc->num_region = BIT(value);
@@ -1464,7 +1464,8 @@ static int edma_setup_from_hw(struct device *dev, struct edma_soc_info *pdata,
value = GET_NUM_EVQUE(cccfg);
edma_cc->num_tc = value + 1;
- dev_dbg(dev, "eDMA3 HW configuration (cccfg: 0x%08x):\n", cccfg);
+ dev_dbg(dev, "eDMA3 CC%d HW configuration (cccfg: 0x%08x):\n", cc_id,
+ cccfg);
dev_dbg(dev, "num_region: %u\n", edma_cc->num_region);
dev_dbg(dev, "num_channel: %u\n", edma_cc->num_channels);
dev_dbg(dev, "num_slot: %u\n", edma_cc->num_slots);
@@ -1684,7 +1685,7 @@ static int edma_probe(struct platform_device *pdev)
return -ENOMEM;
/* Get eDMA3 configuration from IP */
- ret = edma_setup_from_hw(dev, info[j], edma_cc[j]);
+ ret = edma_setup_from_hw(dev, info[j], edma_cc[j], j);
if (ret)
return ret;
--
2.0.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: edma: Fix configuration parsing for SoCs with multiple eDMA3 CC
2014-08-04 12:26 ` Peter Ujfalusi
@ 2014-08-05 16:32 ` Vinod Koul
-1 siblings, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2014-08-05 16:32 UTC (permalink / raw)
To: Peter Ujfalusi
Cc: nsekhar, joelf, linux, linux-arm-kernel, linux-kernel,
davinci-linux-open-source
On Mon, Aug 04, 2014 at 03:26:56PM +0300, Peter Ujfalusi wrote:
> The edma_setup_from_hw() should know about the CC number when parsing the
> CCCFG register - when it reads the register to be precise. The base
> addresses for CCs stored in an array and we need to provide the correct id
> to edma_read() in order to read the correct register.
Just an othognal question:
I still see lot of code for edma in arm/. What is the plan to re/move that
to dma/
--
~Vinod
>
> Cc: <stable@vger.kernel.org> # 3.16
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
> arch/arm/common/edma.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
> index 88099175fc56..d86771abbf57 100644
> --- a/arch/arm/common/edma.c
> +++ b/arch/arm/common/edma.c
> @@ -1443,14 +1443,14 @@ void edma_assign_channel_eventq(unsigned channel, enum dma_event_q eventq_no)
> EXPORT_SYMBOL(edma_assign_channel_eventq);
>
> static int edma_setup_from_hw(struct device *dev, struct edma_soc_info *pdata,
> - struct edma *edma_cc)
> + struct edma *edma_cc, int cc_id)
> {
> int i;
> u32 value, cccfg;
> s8 (*queue_priority_map)[2];
>
> /* Decode the eDMA3 configuration from CCCFG register */
> - cccfg = edma_read(0, EDMA_CCCFG);
> + cccfg = edma_read(cc_id, EDMA_CCCFG);
>
> value = GET_NUM_REGN(cccfg);
> edma_cc->num_region = BIT(value);
> @@ -1464,7 +1464,8 @@ static int edma_setup_from_hw(struct device *dev, struct edma_soc_info *pdata,
> value = GET_NUM_EVQUE(cccfg);
> edma_cc->num_tc = value + 1;
>
> - dev_dbg(dev, "eDMA3 HW configuration (cccfg: 0x%08x):\n", cccfg);
> + dev_dbg(dev, "eDMA3 CC%d HW configuration (cccfg: 0x%08x):\n", cc_id,
> + cccfg);
> dev_dbg(dev, "num_region: %u\n", edma_cc->num_region);
> dev_dbg(dev, "num_channel: %u\n", edma_cc->num_channels);
> dev_dbg(dev, "num_slot: %u\n", edma_cc->num_slots);
> @@ -1684,7 +1685,7 @@ static int edma_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> /* Get eDMA3 configuration from IP */
> - ret = edma_setup_from_hw(dev, info[j], edma_cc[j]);
> + ret = edma_setup_from_hw(dev, info[j], edma_cc[j], j);
> if (ret)
> return ret;
>
> --
> 2.0.2
>
--
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] ARM: edma: Fix configuration parsing for SoCs with multiple eDMA3 CC
@ 2014-08-05 16:32 ` Vinod Koul
0 siblings, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2014-08-05 16:32 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Aug 04, 2014 at 03:26:56PM +0300, Peter Ujfalusi wrote:
> The edma_setup_from_hw() should know about the CC number when parsing the
> CCCFG register - when it reads the register to be precise. The base
> addresses for CCs stored in an array and we need to provide the correct id
> to edma_read() in order to read the correct register.
Just an othognal question:
I still see lot of code for edma in arm/. What is the plan to re/move that
to dma/
--
~Vinod
>
> Cc: <stable@vger.kernel.org> # 3.16
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
> arch/arm/common/edma.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
> index 88099175fc56..d86771abbf57 100644
> --- a/arch/arm/common/edma.c
> +++ b/arch/arm/common/edma.c
> @@ -1443,14 +1443,14 @@ void edma_assign_channel_eventq(unsigned channel, enum dma_event_q eventq_no)
> EXPORT_SYMBOL(edma_assign_channel_eventq);
>
> static int edma_setup_from_hw(struct device *dev, struct edma_soc_info *pdata,
> - struct edma *edma_cc)
> + struct edma *edma_cc, int cc_id)
> {
> int i;
> u32 value, cccfg;
> s8 (*queue_priority_map)[2];
>
> /* Decode the eDMA3 configuration from CCCFG register */
> - cccfg = edma_read(0, EDMA_CCCFG);
> + cccfg = edma_read(cc_id, EDMA_CCCFG);
>
> value = GET_NUM_REGN(cccfg);
> edma_cc->num_region = BIT(value);
> @@ -1464,7 +1464,8 @@ static int edma_setup_from_hw(struct device *dev, struct edma_soc_info *pdata,
> value = GET_NUM_EVQUE(cccfg);
> edma_cc->num_tc = value + 1;
>
> - dev_dbg(dev, "eDMA3 HW configuration (cccfg: 0x%08x):\n", cccfg);
> + dev_dbg(dev, "eDMA3 CC%d HW configuration (cccfg: 0x%08x):\n", cc_id,
> + cccfg);
> dev_dbg(dev, "num_region: %u\n", edma_cc->num_region);
> dev_dbg(dev, "num_channel: %u\n", edma_cc->num_channels);
> dev_dbg(dev, "num_slot: %u\n", edma_cc->num_slots);
> @@ -1684,7 +1685,7 @@ static int edma_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> /* Get eDMA3 configuration from IP */
> - ret = edma_setup_from_hw(dev, info[j], edma_cc[j]);
> + ret = edma_setup_from_hw(dev, info[j], edma_cc[j], j);
> if (ret)
> return ret;
>
> --
> 2.0.2
>
--
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: edma: Fix configuration parsing for SoCs with multiple eDMA3 CC
2014-08-05 16:32 ` Vinod Koul
@ 2014-08-11 7:58 ` Peter Ujfalusi
-1 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2014-08-11 7:58 UTC (permalink / raw)
To: Vinod Koul
Cc: nsekhar, linux, linux-arm-kernel, linux-kernel,
davinci-linux-open-source
On 08/05/2014 07:32 PM, Vinod Koul wrote:
> On Mon, Aug 04, 2014 at 03:26:56PM +0300, Peter Ujfalusi wrote:
>> The edma_setup_from_hw() should know about the CC number when parsing the
>> CCCFG register - when it reads the register to be precise. The base
>> addresses for CCs stored in an array and we need to provide the correct id
>> to edma_read() in order to read the correct register.
>
> Just an othognal question:
>
> I still see lot of code for edma in arm/. What is the plan to re/move that
> to dma/
Yes, there's still a big split. The code under arch/arm/common/ provides still
the 'legacy' edma API. This is still used by audio
sound/soc/davinci/davinci-pcm for older daVinci devices (AM335x. AM43xx uses
the edma-pcm).
And it is not that simple to deprecate davinci-pcm: it can use so called
ping-pong mode for audio data transfer. This mode is not possible via
dmaengine AFAIK.
I'm going to check if edma-pcm would work fine instead of the ping-pong mode.
If it does I can remove davinci-pcm and we can start cleaning up the edma code.
--
Péter
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] ARM: edma: Fix configuration parsing for SoCs with multiple eDMA3 CC
@ 2014-08-11 7:58 ` Peter Ujfalusi
0 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2014-08-11 7:58 UTC (permalink / raw)
To: linux-arm-kernel
On 08/05/2014 07:32 PM, Vinod Koul wrote:
> On Mon, Aug 04, 2014 at 03:26:56PM +0300, Peter Ujfalusi wrote:
>> The edma_setup_from_hw() should know about the CC number when parsing the
>> CCCFG register - when it reads the register to be precise. The base
>> addresses for CCs stored in an array and we need to provide the correct id
>> to edma_read() in order to read the correct register.
>
> Just an othognal question:
>
> I still see lot of code for edma in arm/. What is the plan to re/move that
> to dma/
Yes, there's still a big split. The code under arch/arm/common/ provides still
the 'legacy' edma API. This is still used by audio
sound/soc/davinci/davinci-pcm for older daVinci devices (AM335x. AM43xx uses
the edma-pcm).
And it is not that simple to deprecate davinci-pcm: it can use so called
ping-pong mode for audio data transfer. This mode is not possible via
dmaengine AFAIK.
I'm going to check if edma-pcm would work fine instead of the ping-pong mode.
If it does I can remove davinci-pcm and we can start cleaning up the edma code.
--
P?ter
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: edma: Fix configuration parsing for SoCs with multiple eDMA3 CC
2014-08-04 12:26 ` Peter Ujfalusi
@ 2014-08-26 9:20 ` Sekhar Nori
-1 siblings, 0 replies; 8+ messages in thread
From: Sekhar Nori @ 2014-08-26 9:20 UTC (permalink / raw)
To: Peter Ujfalusi
Cc: linux, vinod.koul, linux-arm-kernel, linux-kernel,
davinci-linux-open-source
On Monday 04 August 2014 05:56 PM, Peter Ujfalusi wrote:
> The edma_setup_from_hw() should know about the CC number when parsing the
> CCCFG register - when it reads the register to be precise. The base
> addresses for CCs stored in an array and we need to provide the correct id
> to edma_read() in order to read the correct register.
>
> Cc: <stable@vger.kernel.org> # 3.16
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Applied and will queue for v3.17-rc
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] ARM: edma: Fix configuration parsing for SoCs with multiple eDMA3 CC
@ 2014-08-26 9:20 ` Sekhar Nori
0 siblings, 0 replies; 8+ messages in thread
From: Sekhar Nori @ 2014-08-26 9:20 UTC (permalink / raw)
To: linux-arm-kernel
On Monday 04 August 2014 05:56 PM, Peter Ujfalusi wrote:
> The edma_setup_from_hw() should know about the CC number when parsing the
> CCCFG register - when it reads the register to be precise. The base
> addresses for CCs stored in an array and we need to provide the correct id
> to edma_read() in order to read the correct register.
>
> Cc: <stable@vger.kernel.org> # 3.16
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Applied and will queue for v3.17-rc
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-08-26 9:20 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-04 12:26 [PATCH] ARM: edma: Fix configuration parsing for SoCs with multiple eDMA3 CC Peter Ujfalusi
2014-08-04 12:26 ` Peter Ujfalusi
2014-08-05 16:32 ` Vinod Koul
2014-08-05 16:32 ` Vinod Koul
2014-08-11 7:58 ` Peter Ujfalusi
2014-08-11 7:58 ` Peter Ujfalusi
2014-08-26 9:20 ` Sekhar Nori
2014-08-26 9:20 ` Sekhar Nori
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.