* [PATCH] ARM: davinci: Add the clock for the CPPI 4.1 DMA engine
@ 2017-03-29 16:09 Alexandre Bailon
2017-03-29 16:16 ` Sergei Shtylyov
2017-04-04 6:16 ` Sekhar Nori
0 siblings, 2 replies; 5+ messages in thread
From: Alexandre Bailon @ 2017-03-29 16:09 UTC (permalink / raw)
To: linux-arm-kernel
The CPPI 4.1 DMA is sharing its clock with the USB OTG,
and most of the time, the clock will be enabled by USB.
But during the init of the DMA, USB is not enabled (waiting for DMA),
and then we must enable the clock before to do anything.
Add the clock for the CPPI 4.1 DMA engine.
Note:
This patch is to apply instead of:
"ARM: davinci: Make the usb20 clock available to PM runtime"
Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
---
arch/arm/mach-davinci/da830.c | 1 +
arch/arm/mach-davinci/da850.c | 1 +
arch/arm/mach-davinci/da8xx-dt.c | 2 ++
3 files changed, 4 insertions(+)
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index 073c458..ae4a8a5 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -413,6 +413,7 @@ static struct clk_lookup da830_clks[] = {
CLK("davinci-mcasp.1", NULL, &mcasp1_clk),
CLK("davinci-mcasp.2", NULL, &mcasp2_clk),
CLK("musb-da8xx", "usb20", &usb20_clk),
+ CLK("cppi41-dmaengine", NULL, &usb20_clk),
CLK(NULL, "aemif", &aemif_clk),
CLK(NULL, "aintc", &aintc_clk),
CLK(NULL, "secu_mgr", &secu_mgr_clk),
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index ccad2f9..9739aaa 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -560,6 +560,7 @@ static struct clk_lookup da850_clks[] = {
CLK("davinci-nand.0", "aemif", &aemif_nand_clk),
CLK("ohci-da8xx", "usb11", &usb11_clk),
CLK("musb-da8xx", "usb20", &usb20_clk),
+ CLK("cppi41-dmaengine", NULL, &usb20_clk),
CLK("spi_davinci.0", NULL, &spi0_clk),
CLK("spi_davinci.1", NULL, &spi1_clk),
CLK("vpif", NULL, &vpif_clk),
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index e3cef50..5bf08ba 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -53,6 +53,8 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA("ti,da830-musb", 0x01e00000, "musb-da8xx", NULL),
OF_DEV_AUXDATA("ti,da830-usb-phy", 0x01c1417c, "da8xx-usb-phy", NULL),
OF_DEV_AUXDATA("ti,da850-ahci", 0x01e18000, "ahci_da850", NULL),
+ OF_DEV_AUXDATA("ti,da830-cppi41", 0x01e01000, "cppi41-dma-engine",
+ NULL),
{}
};
--
2.10.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] ARM: davinci: Add the clock for the CPPI 4.1 DMA engine
2017-03-29 16:09 [PATCH] ARM: davinci: Add the clock for the CPPI 4.1 DMA engine Alexandre Bailon
@ 2017-03-29 16:16 ` Sergei Shtylyov
2017-03-29 16:26 ` Alexandre Bailon
2017-04-04 6:16 ` Sekhar Nori
1 sibling, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2017-03-29 16:16 UTC (permalink / raw)
To: linux-arm-kernel
Hello!
On 03/29/2017 07:09 PM, Alexandre Bailon wrote:
> The CPPI 4.1 DMA is sharing its clock with the USB OTG,
> and most of the time, the clock will be enabled by USB.
> But during the init of the DMA, USB is not enabled (waiting for DMA),
> and then we must enable the clock before to do anything.
s/to do/doing/.
> Add the clock for the CPPI 4.1 DMA engine.
>
> Note:
> This patch is to apply instead of:
> "ARM: davinci: Make the usb20 clock available to PM runtime"
>
> Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
> ---
> arch/arm/mach-davinci/da830.c | 1 +
> arch/arm/mach-davinci/da850.c | 1 +
> arch/arm/mach-davinci/da8xx-dt.c | 2 ++
> 3 files changed, 4 insertions(+)
>
> diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
> index 073c458..ae4a8a5 100644
> --- a/arch/arm/mach-davinci/da830.c
> +++ b/arch/arm/mach-davinci/da830.c
> @@ -413,6 +413,7 @@ static struct clk_lookup da830_clks[] = {
> CLK("davinci-mcasp.1", NULL, &mcasp1_clk),
> CLK("davinci-mcasp.2", NULL, &mcasp2_clk),
> CLK("musb-da8xx", "usb20", &usb20_clk),
> + CLK("cppi41-dmaengine", NULL, &usb20_clk),
> CLK(NULL, "aemif", &aemif_clk),
> CLK(NULL, "aintc", &aintc_clk),
> CLK(NULL, "secu_mgr", &secu_mgr_clk),
> diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
> index ccad2f9..9739aaa 100644
> --- a/arch/arm/mach-davinci/da850.c
> +++ b/arch/arm/mach-davinci/da850.c
> @@ -560,6 +560,7 @@ static struct clk_lookup da850_clks[] = {
> CLK("davinci-nand.0", "aemif", &aemif_nand_clk),
> CLK("ohci-da8xx", "usb11", &usb11_clk),
> CLK("musb-da8xx", "usb20", &usb20_clk),
> + CLK("cppi41-dmaengine", NULL, &usb20_clk),
> CLK("spi_davinci.0", NULL, &spi0_clk),
> CLK("spi_davinci.1", NULL, &spi1_clk),
> CLK("vpif", NULL, &vpif_clk),
> diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
> index e3cef50..5bf08ba 100644
> --- a/arch/arm/mach-davinci/da8xx-dt.c
> +++ b/arch/arm/mach-davinci/da8xx-dt.c
> @@ -53,6 +53,8 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
> OF_DEV_AUXDATA("ti,da830-musb", 0x01e00000, "musb-da8xx", NULL),
> OF_DEV_AUXDATA("ti,da830-usb-phy", 0x01c1417c, "da8xx-usb-phy", NULL),
> OF_DEV_AUXDATA("ti,da850-ahci", 0x01e18000, "ahci_da850", NULL),
> + OF_DEV_AUXDATA("ti,da830-cppi41", 0x01e01000, "cppi41-dma-engine",
Not "cppi41-dmaengine"?
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: davinci: Add the clock for the CPPI 4.1 DMA engine
2017-03-29 16:16 ` Sergei Shtylyov
@ 2017-03-29 16:26 ` Alexandre Bailon
0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Bailon @ 2017-03-29 16:26 UTC (permalink / raw)
To: linux-arm-kernel
Hello Serge,
On 03/29/2017 06:16 PM, Sergei Shtylyov wrote:
> Hello!
>
> On 03/29/2017 07:09 PM, Alexandre Bailon wrote:
>
>> The CPPI 4.1 DMA is sharing its clock with the USB OTG,
>> and most of the time, the clock will be enabled by USB.
>> But during the init of the DMA, USB is not enabled (waiting for DMA),
>> and then we must enable the clock before to do anything.
>
> s/to do/doing/.
>
>> Add the clock for the CPPI 4.1 DMA engine.
>>
>> Note:
>> This patch is to apply instead of:
>> "ARM: davinci: Make the usb20 clock available to PM runtime"
>>
>> Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
>> ---
>> arch/arm/mach-davinci/da830.c | 1 +
>> arch/arm/mach-davinci/da850.c | 1 +
>> arch/arm/mach-davinci/da8xx-dt.c | 2 ++
>> 3 files changed, 4 insertions(+)
>>
>> diff --git a/arch/arm/mach-davinci/da830.c
>> b/arch/arm/mach-davinci/da830.c
>> index 073c458..ae4a8a5 100644
>> --- a/arch/arm/mach-davinci/da830.c
>> +++ b/arch/arm/mach-davinci/da830.c
>> @@ -413,6 +413,7 @@ static struct clk_lookup da830_clks[] = {
>> CLK("davinci-mcasp.1", NULL, &mcasp1_clk),
>> CLK("davinci-mcasp.2", NULL, &mcasp2_clk),
>> CLK("musb-da8xx", "usb20", &usb20_clk),
>> + CLK("cppi41-dmaengine", NULL, &usb20_clk),
>> CLK(NULL, "aemif", &aemif_clk),
>> CLK(NULL, "aintc", &aintc_clk),
>> CLK(NULL, "secu_mgr", &secu_mgr_clk),
>> diff --git a/arch/arm/mach-davinci/da850.c
>> b/arch/arm/mach-davinci/da850.c
>> index ccad2f9..9739aaa 100644
>> --- a/arch/arm/mach-davinci/da850.c
>> +++ b/arch/arm/mach-davinci/da850.c
>> @@ -560,6 +560,7 @@ static struct clk_lookup da850_clks[] = {
>> CLK("davinci-nand.0", "aemif", &aemif_nand_clk),
>> CLK("ohci-da8xx", "usb11", &usb11_clk),
>> CLK("musb-da8xx", "usb20", &usb20_clk),
>> + CLK("cppi41-dmaengine", NULL, &usb20_clk),
>> CLK("spi_davinci.0", NULL, &spi0_clk),
>> CLK("spi_davinci.1", NULL, &spi1_clk),
>> CLK("vpif", NULL, &vpif_clk),
>> diff --git a/arch/arm/mach-davinci/da8xx-dt.c
>> b/arch/arm/mach-davinci/da8xx-dt.c
>> index e3cef50..5bf08ba 100644
>> --- a/arch/arm/mach-davinci/da8xx-dt.c
>> +++ b/arch/arm/mach-davinci/da8xx-dt.c
>> @@ -53,6 +53,8 @@ static struct of_dev_auxdata da850_auxdata_lookup[]
>> __initdata = {
>> OF_DEV_AUXDATA("ti,da830-musb", 0x01e00000, "musb-da8xx", NULL),
>> OF_DEV_AUXDATA("ti,da830-usb-phy", 0x01c1417c, "da8xx-usb-phy",
>> NULL),
>> OF_DEV_AUXDATA("ti,da850-ahci", 0x01e18000, "ahci_da850", NULL),
>> + OF_DEV_AUXDATA("ti,da830-cppi41", 0x01e01000, "cppi41-dma-engine",
>
> Not "cppi41-dmaengine"?
Oops. I should I removed this line. It must be made in the da8xx.c USB
driver.
>
> [...]
>
> MBR, Sergei
>
Regards,
Alexandre
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: davinci: Add the clock for the CPPI 4.1 DMA engine
2017-03-29 16:09 [PATCH] ARM: davinci: Add the clock for the CPPI 4.1 DMA engine Alexandre Bailon
2017-03-29 16:16 ` Sergei Shtylyov
@ 2017-04-04 6:16 ` Sekhar Nori
2017-04-05 17:10 ` Alexandre Bailon
1 sibling, 1 reply; 5+ messages in thread
From: Sekhar Nori @ 2017-04-04 6:16 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 29 March 2017 09:39 PM, Alexandre Bailon wrote:
> The CPPI 4.1 DMA is sharing its clock with the USB OTG,
> and most of the time, the clock will be enabled by USB.
> But during the init of the DMA, USB is not enabled (waiting for DMA),
> and then we must enable the clock before to do anything.
> Add the clock for the CPPI 4.1 DMA engine.
>
> Note:
> This patch is to apply instead of:
> "ARM: davinci: Make the usb20 clock available to PM runtime"
Okay, but I still liked the fact that that patch was using NULL as
con_id for MUSB clock. That makes sense because MUSB gets a single clock
input. I think you should still make that change. If not for v4.12, then
for v4.13.
>
> Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
> ---
> arch/arm/mach-davinci/da830.c | 1 +
> arch/arm/mach-davinci/da850.c | 1 +
> arch/arm/mach-davinci/da8xx-dt.c | 2 ++
> 3 files changed, 4 insertions(+)
>
> diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
> index 073c458..ae4a8a5 100644
> --- a/arch/arm/mach-davinci/da830.c
> +++ b/arch/arm/mach-davinci/da830.c
> @@ -413,6 +413,7 @@ static struct clk_lookup da830_clks[] = {
> CLK("davinci-mcasp.1", NULL, &mcasp1_clk),
> CLK("davinci-mcasp.2", NULL, &mcasp2_clk),
> CLK("musb-da8xx", "usb20", &usb20_clk),
> + CLK("cppi41-dmaengine", NULL, &usb20_clk),
Did you try reading /sys/kernel/debug/davinci_clocks after this patch?
It will hang because of the loop created here.
Looks like what you want is cppi4.1 dma clock to be a child of MUSB
clock. That way, even if DMA is enabled before MUSB, it still works.
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: davinci: Add the clock for the CPPI 4.1 DMA engine
2017-04-04 6:16 ` Sekhar Nori
@ 2017-04-05 17:10 ` Alexandre Bailon
0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Bailon @ 2017-04-05 17:10 UTC (permalink / raw)
To: linux-arm-kernel
On 04/04/2017 08:16 AM, Sekhar Nori wrote:
> On Wednesday 29 March 2017 09:39 PM, Alexandre Bailon wrote:
>> The CPPI 4.1 DMA is sharing its clock with the USB OTG,
>> and most of the time, the clock will be enabled by USB.
>> But during the init of the DMA, USB is not enabled (waiting for DMA),
>> and then we must enable the clock before to do anything.
>> Add the clock for the CPPI 4.1 DMA engine.
>>
>> Note:
>> This patch is to apply instead of:
>> "ARM: davinci: Make the usb20 clock available to PM runtime"
> Okay, but I still liked the fact that that patch was using NULL as
> con_id for MUSB clock. That makes sense because MUSB gets a single clock
> input. I think you should still make that change. If not for v4.12, then
> for v4.13.
>
>> Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
>> ---
>> arch/arm/mach-davinci/da830.c | 1 +
>> arch/arm/mach-davinci/da850.c | 1 +
>> arch/arm/mach-davinci/da8xx-dt.c | 2 ++
>> 3 files changed, 4 insertions(+)
>>
>> diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
>> index 073c458..ae4a8a5 100644
>> --- a/arch/arm/mach-davinci/da830.c
>> +++ b/arch/arm/mach-davinci/da830.c
>> @@ -413,6 +413,7 @@ static struct clk_lookup da830_clks[] = {
>> CLK("davinci-mcasp.1", NULL, &mcasp1_clk),
>> CLK("davinci-mcasp.2", NULL, &mcasp2_clk),
>> CLK("musb-da8xx", "usb20", &usb20_clk),
>> + CLK("cppi41-dmaengine", NULL, &usb20_clk),
> Did you try reading /sys/kernel/debug/davinci_clocks after this patch?
> It will hang because of the loop created here.
I have tried and I did not get any issues.
>
> Looks like what you want is cppi4.1 dma clock to be a child of MUSB
> clock. That way, even if DMA is enabled before MUSB, it still works.
OK. I will update the patch to make cppi4.1 clock a child of usb clock.
>
> Thanks,
> Sekhar
Thanks,
Alexandre
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-04-05 17:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-29 16:09 [PATCH] ARM: davinci: Add the clock for the CPPI 4.1 DMA engine Alexandre Bailon
2017-03-29 16:16 ` Sergei Shtylyov
2017-03-29 16:26 ` Alexandre Bailon
2017-04-04 6:16 ` Sekhar Nori
2017-04-05 17:10 ` Alexandre Bailon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox