LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v6 0/7] ARM: davinci: complete the conversion to using the reset framework
@ 2018-04-17 17:30 Bartosz Golaszewski
2018-04-17 17:30 ` [PATCH v6 1/7] ARM: davinci: dts: make psc0 a reset provider Bartosz Golaszewski
` (7 more replies)
0 siblings, 8 replies; 17+ messages in thread
From: Bartosz Golaszewski @ 2018-04-17 17:30 UTC (permalink / raw)
To: Suman Anna, Sekhar Nori, Kevin Hilman, Rob Herring, Mark Rutland,
Russell King, David Lechner, Michael Turquette, Stephen Boyd,
Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
This series converts the only user of the handcoded, mach-specific reset
routines in the davinci platform to using the reset framework.
Patches 1-2 add necessary lookups/DT-properties.
Patches 3-5 fix issues found in the remoteproc davinci driver.
Patch 6 converts the davinci-rproc driver to the reset framework.
Patch 7 removes now dead code.
Tested both in DT and legacy modes by booting the examples from
ti-ipc-rtos recipe in meta-ti.
This series applies on top of David Lechner's common-clk-v9 branch[1].
[1] git://github.com/dlech/ev3dev-kernel.git common-clk-v9
v1 -> v2:
- fixed the device tree patches the descriptions of which were mixed up
- return -EPROBE_DEFER from davinci-rproc's probe() if we can't get the
reset provider, since it's possible that the lookup table was not yet
registered
- made the local variable naming consistent in the davinci-rproc driver
- fixed a typo in PATCH 5/8
v2 -> v3:
- modify PATCH 1/8: drop the provider argument from the function adding
lookup entries and instead pass the provider name to the RESET_LOOKUP
macro, return -EPROBE_DEFER if we locate a correct lookup entry but
cannot get the corresponding reset controller
- modify the reset lookup entry in psc-da850
- don't manually return -EPROBE_DEFER from davinci-rproc, instead don't
emit an error message if devm_reset_control_get_exclusive() returns
this error code
v3 -> v4:
- make index the second parameter in RESET_LOOKUP() (right after the
provider name)
v4 -> v5:
- fix a bug where the dsp_reset object correctly stored in drproc struct
v5 -> v6:
- rebased on top of v4.17-rc1 and retested
- dropped patches that were applied during 4.17 merge window
- added relevant review and ack tags
Bartosz Golaszewski (7):
ARM: davinci: dts: make psc0 a reset provider
ARM: davinci: dts: add a reset control to the dsp node
remoteproc/davinci: add the missing retval check for clk_enable()
remoteproc/davinci: prepare and unprepare the clock where needed
remoteproc/davinci: use octal permissions for module_param()
remoteproc/davinci: use the reset framework
clk: davinci: kill davinci_clk_reset_assert/deassert()
arch/arm/boot/dts/da850.dtsi | 2 +
arch/arm/mach-davinci/include/mach/clock.h | 21 ----------
drivers/clk/davinci/psc.c | 18 ---------
drivers/remoteproc/da8xx_remoteproc.c | 46 ++++++++++++++++++----
4 files changed, 40 insertions(+), 47 deletions(-)
delete mode 100644 arch/arm/mach-davinci/include/mach/clock.h
--
2.17.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v6 1/7] ARM: davinci: dts: make psc0 a reset provider
2018-04-17 17:30 [PATCH v6 0/7] ARM: davinci: complete the conversion to using the reset framework Bartosz Golaszewski
@ 2018-04-17 17:30 ` Bartosz Golaszewski
2018-04-17 17:30 ` [PATCH v6 2/7] ARM: davinci: dts: add a reset control to the dsp node Bartosz Golaszewski
` (6 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Bartosz Golaszewski @ 2018-04-17 17:30 UTC (permalink / raw)
To: Suman Anna, Sekhar Nori, Kevin Hilman, Rob Herring, Mark Rutland,
Russell King, David Lechner, Michael Turquette, Stephen Boyd,
Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
The psc driver registers with the reset framework as a provider. Add
the #reset-cells property to the psc0 node.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: David Lechner <david@lechnology.com>
---
arch/arm/boot/dts/da850.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index b9639695dc8c..d56e670d9a32 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -123,6 +123,7 @@
compatible = "ti,da850-psc0";
reg = <0x10000 0x1000>;
#clock-cells = <1>;
+ #reset-cells = <1>;
#power-domain-cells = <1>;
clocks = <&pll0_sysclk 1>, <&pll0_sysclk 2>,
<&pll0_sysclk 4>, <&pll0_sysclk 6>,
--
2.17.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v6 2/7] ARM: davinci: dts: add a reset control to the dsp node
2018-04-17 17:30 [PATCH v6 0/7] ARM: davinci: complete the conversion to using the reset framework Bartosz Golaszewski
2018-04-17 17:30 ` [PATCH v6 1/7] ARM: davinci: dts: make psc0 a reset provider Bartosz Golaszewski
@ 2018-04-17 17:30 ` Bartosz Golaszewski
2018-04-17 17:30 ` [PATCH v6 3/7] remoteproc/davinci: add the missing retval check for clk_enable() Bartosz Golaszewski
` (5 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Bartosz Golaszewski @ 2018-04-17 17:30 UTC (permalink / raw)
To: Suman Anna, Sekhar Nori, Kevin Hilman, Rob Herring, Mark Rutland,
Russell King, David Lechner, Michael Turquette, Stephen Boyd,
Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
The davinci-rproc driver will soon use the reset framework. Add the
resets property to the dsp node in da850.dtsi.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: David Lechner <david@lechnology.com>
---
arch/arm/boot/dts/da850.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index d56e670d9a32..250aeee53202 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -109,6 +109,7 @@
interrupt-parent = <&intc>;
interrupts = <28>;
clocks = <&psc0 15>;
+ resets = <&psc0 15>;
status = "disabled";
};
soc@1c00000 {
--
2.17.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v6 3/7] remoteproc/davinci: add the missing retval check for clk_enable()
2018-04-17 17:30 [PATCH v6 0/7] ARM: davinci: complete the conversion to using the reset framework Bartosz Golaszewski
2018-04-17 17:30 ` [PATCH v6 1/7] ARM: davinci: dts: make psc0 a reset provider Bartosz Golaszewski
2018-04-17 17:30 ` [PATCH v6 2/7] ARM: davinci: dts: add a reset control to the dsp node Bartosz Golaszewski
@ 2018-04-17 17:30 ` Bartosz Golaszewski
2018-04-18 5:04 ` Sekhar Nori
2018-04-17 17:30 ` [PATCH v6 4/7] remoteproc/davinci: prepare and unprepare the clock where needed Bartosz Golaszewski
` (4 subsequent siblings)
7 siblings, 1 reply; 17+ messages in thread
From: Bartosz Golaszewski @ 2018-04-17 17:30 UTC (permalink / raw)
To: Suman Anna, Sekhar Nori, Kevin Hilman, Rob Herring, Mark Rutland,
Russell King, David Lechner, Michael Turquette, Stephen Boyd,
Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
The davinci platform is being switched to using the common clock
framework, where clk_enable() can fail. Add the return value check.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Suman Anna <s-anna@ti.com>
Reviewed-by: David Lechner <david@lechnology.com>
---
drivers/remoteproc/da8xx_remoteproc.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c
index bf3b9034c319..2b24291337b7 100644
--- a/drivers/remoteproc/da8xx_remoteproc.c
+++ b/drivers/remoteproc/da8xx_remoteproc.c
@@ -138,6 +138,7 @@ static int da8xx_rproc_start(struct rproc *rproc)
struct device *dev = rproc->dev.parent;
struct da8xx_rproc *drproc = (struct da8xx_rproc *)rproc->priv;
struct clk *dsp_clk = drproc->dsp_clk;
+ int ret;
/* hw requires the start (boot) address be on 1KB boundary */
if (rproc->bootaddr & 0x3ff) {
@@ -148,7 +149,12 @@ static int da8xx_rproc_start(struct rproc *rproc)
writel(rproc->bootaddr, drproc->bootreg);
- clk_enable(dsp_clk);
+ ret = clk_enable(dsp_clk);
+ if (ret) {
+ dev_err(dev, "clk_enable() failed: %d\n", ret);
+ return ret;
+ }
+
davinci_clk_reset_deassert(dsp_clk);
return 0;
--
2.17.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v6 4/7] remoteproc/davinci: prepare and unprepare the clock where needed
2018-04-17 17:30 [PATCH v6 0/7] ARM: davinci: complete the conversion to using the reset framework Bartosz Golaszewski
` (2 preceding siblings ...)
2018-04-17 17:30 ` [PATCH v6 3/7] remoteproc/davinci: add the missing retval check for clk_enable() Bartosz Golaszewski
@ 2018-04-17 17:30 ` Bartosz Golaszewski
2018-04-18 5:27 ` Sekhar Nori
2018-04-17 17:30 ` [PATCH v6 5/7] remoteproc/davinci: use octal permissions for module_param() Bartosz Golaszewski
` (3 subsequent siblings)
7 siblings, 1 reply; 17+ messages in thread
From: Bartosz Golaszewski @ 2018-04-17 17:30 UTC (permalink / raw)
To: Suman Anna, Sekhar Nori, Kevin Hilman, Rob Herring, Mark Rutland,
Russell King, David Lechner, Michael Turquette, Stephen Boyd,
Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
We're currently switching the platform to using the common clock
framework. We need to explicitly prepare and unprepare the rproc
clock.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Suman Anna <s-anna@ti.com>
Reviewed-by: David Lechner <david@lechnology.com>
---
drivers/remoteproc/da8xx_remoteproc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c
index 2b24291337b7..f134192922e0 100644
--- a/drivers/remoteproc/da8xx_remoteproc.c
+++ b/drivers/remoteproc/da8xx_remoteproc.c
@@ -149,9 +149,9 @@ static int da8xx_rproc_start(struct rproc *rproc)
writel(rproc->bootaddr, drproc->bootreg);
- ret = clk_enable(dsp_clk);
+ ret = clk_prepare_enable(dsp_clk);
if (ret) {
- dev_err(dev, "clk_enable() failed: %d\n", ret);
+ dev_err(dev, "clk_prepare_enable() failed: %d\n", ret);
return ret;
}
@@ -165,7 +165,7 @@ static int da8xx_rproc_stop(struct rproc *rproc)
struct da8xx_rproc *drproc = rproc->priv;
davinci_clk_reset_assert(drproc->dsp_clk);
- clk_disable(drproc->dsp_clk);
+ clk_disable_unprepare(drproc->dsp_clk);
return 0;
}
--
2.17.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v6 5/7] remoteproc/davinci: use octal permissions for module_param()
2018-04-17 17:30 [PATCH v6 0/7] ARM: davinci: complete the conversion to using the reset framework Bartosz Golaszewski
` (3 preceding siblings ...)
2018-04-17 17:30 ` [PATCH v6 4/7] remoteproc/davinci: prepare and unprepare the clock where needed Bartosz Golaszewski
@ 2018-04-17 17:30 ` Bartosz Golaszewski
2018-04-18 5:30 ` Sekhar Nori
2018-04-27 17:11 ` Suman Anna
2018-04-17 17:30 ` [PATCH v6 6/7] remoteproc/davinci: use the reset framework Bartosz Golaszewski
` (2 subsequent siblings)
7 siblings, 2 replies; 17+ messages in thread
From: Bartosz Golaszewski @ 2018-04-17 17:30 UTC (permalink / raw)
To: Suman Anna, Sekhar Nori, Kevin Hilman, Rob Herring, Mark Rutland,
Russell King, David Lechner, Michael Turquette, Stephen Boyd,
Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Checkpatch recommends to use octal perms instead of S_IRUGO.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
drivers/remoteproc/da8xx_remoteproc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c
index f134192922e0..b668e32996e2 100644
--- a/drivers/remoteproc/da8xx_remoteproc.c
+++ b/drivers/remoteproc/da8xx_remoteproc.c
@@ -25,7 +25,7 @@
#include "remoteproc_internal.h"
static char *da8xx_fw_name;
-module_param(da8xx_fw_name, charp, S_IRUGO);
+module_param(da8xx_fw_name, charp, 0444);
MODULE_PARM_DESC(da8xx_fw_name,
"Name of DSP firmware file in /lib/firmware (if not specified defaults to 'rproc-dsp-fw')");
--
2.17.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v6 6/7] remoteproc/davinci: use the reset framework
2018-04-17 17:30 [PATCH v6 0/7] ARM: davinci: complete the conversion to using the reset framework Bartosz Golaszewski
` (4 preceding siblings ...)
2018-04-17 17:30 ` [PATCH v6 5/7] remoteproc/davinci: use octal permissions for module_param() Bartosz Golaszewski
@ 2018-04-17 17:30 ` Bartosz Golaszewski
2018-04-18 5:44 ` Sekhar Nori
2018-04-18 8:50 ` Philipp Zabel
2018-04-17 17:30 ` [PATCH v6 7/7] clk: davinci: kill davinci_clk_reset_assert/deassert() Bartosz Golaszewski
2018-05-01 10:52 ` [PATCH v6 0/7] ARM: davinci: complete the conversion to using the reset framework Sekhar Nori
7 siblings, 2 replies; 17+ messages in thread
From: Bartosz Golaszewski @ 2018-04-17 17:30 UTC (permalink / raw)
To: Suman Anna, Sekhar Nori, Kevin Hilman, Rob Herring, Mark Rutland,
Russell King, David Lechner, Michael Turquette, Stephen Boyd,
Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Switch to using the reset framework instead of handcoded reset routines
we used so far.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
drivers/remoteproc/da8xx_remoteproc.c | 34 +++++++++++++++++++++++----
1 file changed, 29 insertions(+), 5 deletions(-)
diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c
index b668e32996e2..76c06b70a1c6 100644
--- a/drivers/remoteproc/da8xx_remoteproc.c
+++ b/drivers/remoteproc/da8xx_remoteproc.c
@@ -10,6 +10,7 @@
#include <linux/bitops.h>
#include <linux/clk.h>
+#include <linux/reset.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/io.h>
@@ -20,8 +21,6 @@
#include <linux/platform_device.h>
#include <linux/remoteproc.h>
-#include <mach/clock.h> /* for davinci_clk_reset_assert/deassert() */
-
#include "remoteproc_internal.h"
static char *da8xx_fw_name;
@@ -72,6 +71,7 @@ struct da8xx_rproc {
struct da8xx_rproc_mem *mem;
int num_mems;
struct clk *dsp_clk;
+ struct reset_control *dsp_reset;
void (*ack_fxn)(struct irq_data *data);
struct irq_data *irq_data;
void __iomem *chipsig;
@@ -138,6 +138,7 @@ static int da8xx_rproc_start(struct rproc *rproc)
struct device *dev = rproc->dev.parent;
struct da8xx_rproc *drproc = (struct da8xx_rproc *)rproc->priv;
struct clk *dsp_clk = drproc->dsp_clk;
+ struct reset_control *dsp_reset = drproc->dsp_reset;
int ret;
/* hw requires the start (boot) address be on 1KB boundary */
@@ -155,7 +156,12 @@ static int da8xx_rproc_start(struct rproc *rproc)
return ret;
}
- davinci_clk_reset_deassert(dsp_clk);
+ ret = reset_control_deassert(dsp_reset);
+ if (ret) {
+ dev_err(dev, "reset_control_deassert() failed: %d\n", ret);
+ clk_disable_unprepare(dsp_clk);
+ return ret;
+ }
return 0;
}
@@ -163,8 +169,15 @@ static int da8xx_rproc_start(struct rproc *rproc)
static int da8xx_rproc_stop(struct rproc *rproc)
{
struct da8xx_rproc *drproc = rproc->priv;
+ struct device *dev = rproc->dev.parent;
+ int ret;
+
+ ret = reset_control_assert(drproc->dsp_reset);
+ if (ret) {
+ dev_err(dev, "reset_control_assert() failed: %d\n", ret);
+ return ret;
+ }
- davinci_clk_reset_assert(drproc->dsp_clk);
clk_disable_unprepare(drproc->dsp_clk);
return 0;
@@ -232,6 +245,7 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
struct resource *bootreg_res;
struct resource *chipsig_res;
struct clk *dsp_clk;
+ struct reset_control *dsp_reset;
void __iomem *chipsig;
void __iomem *bootreg;
int irq;
@@ -268,6 +282,15 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
return PTR_ERR(dsp_clk);
}
+ dsp_reset = devm_reset_control_get_exclusive(dev, NULL);
+ if (IS_ERR(dsp_reset)) {
+ if (PTR_ERR(dsp_reset) != -EPROBE_DEFER)
+ dev_err(dev, "unable to get reset control: %ld\n",
+ PTR_ERR(dsp_reset));
+
+ return PTR_ERR(dsp_reset);
+ }
+
if (dev->of_node) {
ret = of_reserved_mem_device_init(dev);
if (ret) {
@@ -287,6 +310,7 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
drproc = rproc->priv;
drproc->rproc = rproc;
drproc->dsp_clk = dsp_clk;
+ drproc->dsp_reset = dsp_reset;
rproc->has_iommu = false;
ret = da8xx_rproc_get_internal_memories(pdev, drproc);
@@ -309,7 +333,7 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
* *not* in reset, but da8xx_rproc_start() needs the DSP to be
* held in reset at the time it is called.
*/
- ret = davinci_clk_reset_assert(drproc->dsp_clk);
+ ret = reset_control_assert(dsp_reset);
if (ret)
goto free_rproc;
--
2.17.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v6 7/7] clk: davinci: kill davinci_clk_reset_assert/deassert()
2018-04-17 17:30 [PATCH v6 0/7] ARM: davinci: complete the conversion to using the reset framework Bartosz Golaszewski
` (5 preceding siblings ...)
2018-04-17 17:30 ` [PATCH v6 6/7] remoteproc/davinci: use the reset framework Bartosz Golaszewski
@ 2018-04-17 17:30 ` Bartosz Golaszewski
2018-05-01 10:52 ` [PATCH v6 0/7] ARM: davinci: complete the conversion to using the reset framework Sekhar Nori
7 siblings, 0 replies; 17+ messages in thread
From: Bartosz Golaszewski @ 2018-04-17 17:30 UTC (permalink / raw)
To: Suman Anna, Sekhar Nori, Kevin Hilman, Rob Herring, Mark Rutland,
Russell King, David Lechner, Michael Turquette, Stephen Boyd,
Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
This code is no longer used. Remove it.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: David Lechner <david@lechnology.com>
Acked-by: Stephen Boyd <sboyd@kernel.org>
---
arch/arm/mach-davinci/include/mach/clock.h | 21 ---------------------
drivers/clk/davinci/psc.c | 18 ------------------
2 files changed, 39 deletions(-)
delete mode 100644 arch/arm/mach-davinci/include/mach/clock.h
diff --git a/arch/arm/mach-davinci/include/mach/clock.h b/arch/arm/mach-davinci/include/mach/clock.h
deleted file mode 100644
index 42ed4f2f5ce4..000000000000
--- a/arch/arm/mach-davinci/include/mach/clock.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * arch/arm/mach-davinci/include/mach/clock.h
- *
- * Clock control driver for DaVinci - header file
- *
- * Authors: Vladimir Barinov <source@mvista.com>
- *
- * 2007 (c) MontaVista Software, Inc. This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-#ifndef __ASM_ARCH_DAVINCI_CLOCK_H
-#define __ASM_ARCH_DAVINCI_CLOCK_H
-
-struct clk;
-
-int davinci_clk_reset_assert(struct clk *c);
-int davinci_clk_reset_deassert(struct clk *c);
-
-#endif
diff --git a/drivers/clk/davinci/psc.c b/drivers/clk/davinci/psc.c
index ce170e600f09..c822fdfd0897 100644
--- a/drivers/clk/davinci/psc.c
+++ b/drivers/clk/davinci/psc.c
@@ -295,24 +295,6 @@ static int davinci_lpsc_clk_reset(struct clk *clk, bool reset)
return 0;
}
-/*
- * REVISIT: These exported functions can be removed after a non-DT lookup is
- * added to the reset controller framework and the davinci-rproc driver is
- * updated to use the generic reset controller framework.
- */
-
-int davinci_clk_reset_assert(struct clk *clk)
-{
- return davinci_lpsc_clk_reset(clk, true);
-}
-EXPORT_SYMBOL(davinci_clk_reset_assert);
-
-int davinci_clk_reset_deassert(struct clk *clk)
-{
- return davinci_lpsc_clk_reset(clk, false);
-}
-EXPORT_SYMBOL(davinci_clk_reset_deassert);
-
static int davinci_psc_reset_assert(struct reset_controller_dev *rcdev,
unsigned long id)
{
--
2.17.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v6 3/7] remoteproc/davinci: add the missing retval check for clk_enable()
2018-04-17 17:30 ` [PATCH v6 3/7] remoteproc/davinci: add the missing retval check for clk_enable() Bartosz Golaszewski
@ 2018-04-18 5:04 ` Sekhar Nori
0 siblings, 0 replies; 17+ messages in thread
From: Sekhar Nori @ 2018-04-18 5:04 UTC (permalink / raw)
To: Bartosz Golaszewski, Suman Anna, Kevin Hilman, Rob Herring,
Mark Rutland, Russell King, David Lechner, Michael Turquette,
Stephen Boyd, Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
On Tuesday 17 April 2018 11:00 PM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> The davinci platform is being switched to using the common clock
> framework, where clk_enable() can fail. Add the return value check.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Acked-by: Suman Anna <s-anna@ti.com>
> Reviewed-by: David Lechner <david@lechnology.com>
Reviewed-by: Sekhar Nori <nsekhar@ti.com>
This should be safe to apply to v4.17-rc1 and should be queued by Ohad /
Bjorn.
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v6 4/7] remoteproc/davinci: prepare and unprepare the clock where needed
2018-04-17 17:30 ` [PATCH v6 4/7] remoteproc/davinci: prepare and unprepare the clock where needed Bartosz Golaszewski
@ 2018-04-18 5:27 ` Sekhar Nori
2018-04-18 8:03 ` Bartosz Golaszewski
0 siblings, 1 reply; 17+ messages in thread
From: Sekhar Nori @ 2018-04-18 5:27 UTC (permalink / raw)
To: Bartosz Golaszewski, Suman Anna, Kevin Hilman, Rob Herring,
Mark Rutland, Russell King, David Lechner, Michael Turquette,
Stephen Boyd, Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
On Tuesday 17 April 2018 11:00 PM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> We're currently switching the platform to using the common clock
> framework. We need to explicitly prepare and unprepare the rproc
> clock.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Acked-by: Suman Anna <s-anna@ti.com>
> Reviewed-by: David Lechner <david@lechnology.com>
Reviewed-by: Sekhar Nori <nsekhar@ti.com>
This should be safe to apply to v4.17-rc1 as well (for inclusion in v4.18).
Bartosz, I noticed that CONFIG_REMOTEPROC and the DA8XX driver is not
enabled in davinci_all_defconfig. Can you please send a patch enabling
that too?
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v6 5/7] remoteproc/davinci: use octal permissions for module_param()
2018-04-17 17:30 ` [PATCH v6 5/7] remoteproc/davinci: use octal permissions for module_param() Bartosz Golaszewski
@ 2018-04-18 5:30 ` Sekhar Nori
2018-04-27 17:11 ` Suman Anna
1 sibling, 0 replies; 17+ messages in thread
From: Sekhar Nori @ 2018-04-18 5:30 UTC (permalink / raw)
To: Bartosz Golaszewski, Suman Anna, Kevin Hilman, Rob Herring,
Mark Rutland, Russell King, David Lechner, Michael Turquette,
Stephen Boyd, Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
On Tuesday 17 April 2018 11:00 PM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> Checkpatch recommends to use octal perms instead of S_IRUGO.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Sekhar Nori <nsekhar@ti.com>
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v6 6/7] remoteproc/davinci: use the reset framework
2018-04-17 17:30 ` [PATCH v6 6/7] remoteproc/davinci: use the reset framework Bartosz Golaszewski
@ 2018-04-18 5:44 ` Sekhar Nori
2018-04-18 8:56 ` Bartosz Golaszewski
2018-04-18 8:50 ` Philipp Zabel
1 sibling, 1 reply; 17+ messages in thread
From: Sekhar Nori @ 2018-04-18 5:44 UTC (permalink / raw)
To: Bartosz Golaszewski, Suman Anna, Kevin Hilman, Rob Herring,
Mark Rutland, Russell King, David Lechner, Michael Turquette,
Stephen Boyd, Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
On Tuesday 17 April 2018 11:00 PM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> Switch to using the reset framework instead of handcoded reset routines
> we used so far.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Looks good!
Reviewed-by: Sekhar Nori <nsekhar@ti.com>
This depends on DaVinci gaining common clock / reset framework support
though. I am guessing remoteproc maintainers will have to be reminded
when its safe to apply.
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v6 4/7] remoteproc/davinci: prepare and unprepare the clock where needed
2018-04-18 5:27 ` Sekhar Nori
@ 2018-04-18 8:03 ` Bartosz Golaszewski
0 siblings, 0 replies; 17+ messages in thread
From: Bartosz Golaszewski @ 2018-04-18 8:03 UTC (permalink / raw)
To: Sekhar Nori
Cc: Suman Anna, Kevin Hilman, Rob Herring, Mark Rutland,
Russell King, David Lechner, Michael Turquette, Stephen Boyd,
Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel, Linux ARM,
devicetree, Linux Kernel Mailing List, linux-clk,
linux-remoteproc, Bartosz Golaszewski
2018-04-18 7:27 GMT+02:00 Sekhar Nori <nsekhar@ti.com>:
> On Tuesday 17 April 2018 11:00 PM, Bartosz Golaszewski wrote:
>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>
>> We're currently switching the platform to using the common clock
>> framework. We need to explicitly prepare and unprepare the rproc
>> clock.
>>
>> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>> Acked-by: Suman Anna <s-anna@ti.com>
>> Reviewed-by: David Lechner <david@lechnology.com>
>
> Reviewed-by: Sekhar Nori <nsekhar@ti.com>
>
> This should be safe to apply to v4.17-rc1 as well (for inclusion in v4.18).
>
> Bartosz, I noticed that CONFIG_REMOTEPROC and the DA8XX driver is not
> enabled in davinci_all_defconfig. Can you please send a patch enabling
> that too?
>
> Thanks,
> Sekhar
Sure, will do.
Bart
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v6 6/7] remoteproc/davinci: use the reset framework
2018-04-17 17:30 ` [PATCH v6 6/7] remoteproc/davinci: use the reset framework Bartosz Golaszewski
2018-04-18 5:44 ` Sekhar Nori
@ 2018-04-18 8:50 ` Philipp Zabel
1 sibling, 0 replies; 17+ messages in thread
From: Philipp Zabel @ 2018-04-18 8:50 UTC (permalink / raw)
To: Bartosz Golaszewski, Suman Anna, Sekhar Nori, Kevin Hilman,
Rob Herring, Mark Rutland, Russell King, David Lechner,
Michael Turquette, Stephen Boyd, Ohad Ben-Cohen, Bjorn Andersson
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
On Tue, 2018-04-17 at 19:30 +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> Switch to using the reset framework instead of handcoded reset routines
> we used so far.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
[...]
> @@ -268,6 +282,15 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
> return PTR_ERR(dsp_clk);
> }
>
> + dsp_reset = devm_reset_control_get_exclusive(dev, NULL);
> + if (IS_ERR(dsp_reset)) {
> + if (PTR_ERR(dsp_reset) != -EPROBE_DEFER)
> + dev_err(dev, "unable to get reset control: %ld\n",
> + PTR_ERR(dsp_reset));
> +
> + return PTR_ERR(dsp_reset);
> + }
> +
> if (dev->of_node) {
> ret = of_reserved_mem_device_init(dev);
> if (ret) {
[...]
> @@ -309,7 +333,7 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
> * *not* in reset, but da8xx_rproc_start() needs the DSP to be
> * held in reset at the time it is called.
Given this requirement, devm_reset_control_get_exclusive above is the
correct choice.
> */
> - ret = davinci_clk_reset_assert(drproc->dsp_clk);
> + ret = reset_control_assert(dsp_reset);
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v6 6/7] remoteproc/davinci: use the reset framework
2018-04-18 5:44 ` Sekhar Nori
@ 2018-04-18 8:56 ` Bartosz Golaszewski
0 siblings, 0 replies; 17+ messages in thread
From: Bartosz Golaszewski @ 2018-04-18 8:56 UTC (permalink / raw)
To: Sekhar Nori
Cc: Suman Anna, Kevin Hilman, Rob Herring, Mark Rutland,
Russell King, David Lechner, Michael Turquette, Stephen Boyd,
Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel, Linux ARM,
devicetree, Linux Kernel Mailing List, linux-clk,
linux-remoteproc, Bartosz Golaszewski
2018-04-18 7:44 GMT+02:00 Sekhar Nori <nsekhar@ti.com>:
> On Tuesday 17 April 2018 11:00 PM, Bartosz Golaszewski wrote:
>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>
>> Switch to using the reset framework instead of handcoded reset routines
>> we used so far.
>>
>> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> Looks good!
>
> Reviewed-by: Sekhar Nori <nsekhar@ti.com>
>
> This depends on DaVinci gaining common clock / reset framework support
> though. I am guessing remoteproc maintainers will have to be reminded
> when its safe to apply.
>
> Thanks,
> Sekhar
Right, I assume you plan to apply the platform & DT patches from David
for 4.18? We can then provide an immutable branch to remoteproc
maintainers.
Bart
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v6 5/7] remoteproc/davinci: use octal permissions for module_param()
2018-04-17 17:30 ` [PATCH v6 5/7] remoteproc/davinci: use octal permissions for module_param() Bartosz Golaszewski
2018-04-18 5:30 ` Sekhar Nori
@ 2018-04-27 17:11 ` Suman Anna
1 sibling, 0 replies; 17+ messages in thread
From: Suman Anna @ 2018-04-27 17:11 UTC (permalink / raw)
To: Bartosz Golaszewski, Sekhar Nori, Kevin Hilman, Rob Herring,
Mark Rutland, Russell King, David Lechner, Michael Turquette,
Stephen Boyd, Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
On 04/17/2018 12:30 PM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> Checkpatch recommends to use octal perms instead of S_IRUGO.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Looks like you missed by Acked-by from v3, so adding it back
Acked-by: Suman Anna <s-anna@ti.com>
regards
Suman
> ---
> drivers/remoteproc/da8xx_remoteproc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c
> index f134192922e0..b668e32996e2 100644
> --- a/drivers/remoteproc/da8xx_remoteproc.c
> +++ b/drivers/remoteproc/da8xx_remoteproc.c
> @@ -25,7 +25,7 @@
> #include "remoteproc_internal.h"
>
> static char *da8xx_fw_name;
> -module_param(da8xx_fw_name, charp, S_IRUGO);
> +module_param(da8xx_fw_name, charp, 0444);
> MODULE_PARM_DESC(da8xx_fw_name,
> "Name of DSP firmware file in /lib/firmware (if not specified defaults to 'rproc-dsp-fw')");
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v6 0/7] ARM: davinci: complete the conversion to using the reset framework
2018-04-17 17:30 [PATCH v6 0/7] ARM: davinci: complete the conversion to using the reset framework Bartosz Golaszewski
` (6 preceding siblings ...)
2018-04-17 17:30 ` [PATCH v6 7/7] clk: davinci: kill davinci_clk_reset_assert/deassert() Bartosz Golaszewski
@ 2018-05-01 10:52 ` Sekhar Nori
7 siblings, 0 replies; 17+ messages in thread
From: Sekhar Nori @ 2018-05-01 10:52 UTC (permalink / raw)
To: Bartosz Golaszewski, Suman Anna, Kevin Hilman, Rob Herring,
Mark Rutland, Russell King, David Lechner, Michael Turquette,
Stephen Boyd, Ohad Ben-Cohen, Bjorn Andersson, Philipp Zabel
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-clk,
linux-remoteproc, Bartosz Golaszewski
Hi Bartosz,
On Tuesday 17 April 2018 11:00 PM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> This series converts the only user of the handcoded, mach-specific reset
> routines in the davinci platform to using the reset framework.
>
> Patches 1-2 add necessary lookups/DT-properties.
>
> Patches 3-5 fix issues found in the remoteproc davinci driver.
>
> Patch 6 converts the davinci-rproc driver to the reset framework.
>
> Patch 7 removes now dead code.
>
> Tested both in DT and legacy modes by booting the examples from
> ti-ipc-rtos recipe in meta-ti.
>
> This series applies on top of David Lechner's common-clk-v9 branch[1].
To make it easier for Bjorn to apply his patches, can you please
separate out the remoteproc parts which are safe to apply to v4.17-rc1
and repost the series? Please collect the reviews and acks too.
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2018-05-01 10:54 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-17 17:30 [PATCH v6 0/7] ARM: davinci: complete the conversion to using the reset framework Bartosz Golaszewski
2018-04-17 17:30 ` [PATCH v6 1/7] ARM: davinci: dts: make psc0 a reset provider Bartosz Golaszewski
2018-04-17 17:30 ` [PATCH v6 2/7] ARM: davinci: dts: add a reset control to the dsp node Bartosz Golaszewski
2018-04-17 17:30 ` [PATCH v6 3/7] remoteproc/davinci: add the missing retval check for clk_enable() Bartosz Golaszewski
2018-04-18 5:04 ` Sekhar Nori
2018-04-17 17:30 ` [PATCH v6 4/7] remoteproc/davinci: prepare and unprepare the clock where needed Bartosz Golaszewski
2018-04-18 5:27 ` Sekhar Nori
2018-04-18 8:03 ` Bartosz Golaszewski
2018-04-17 17:30 ` [PATCH v6 5/7] remoteproc/davinci: use octal permissions for module_param() Bartosz Golaszewski
2018-04-18 5:30 ` Sekhar Nori
2018-04-27 17:11 ` Suman Anna
2018-04-17 17:30 ` [PATCH v6 6/7] remoteproc/davinci: use the reset framework Bartosz Golaszewski
2018-04-18 5:44 ` Sekhar Nori
2018-04-18 8:56 ` Bartosz Golaszewski
2018-04-18 8:50 ` Philipp Zabel
2018-04-17 17:30 ` [PATCH v6 7/7] clk: davinci: kill davinci_clk_reset_assert/deassert() Bartosz Golaszewski
2018-05-01 10:52 ` [PATCH v6 0/7] ARM: davinci: complete the conversion to using the reset framework Sekhar Nori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).