* [PATCH 09/31] drm/tegra: use reset framework
2013-11-15 20:53 [PATCH 00/31] ARM: tegra: use common reset and DMA bindings Stephen Warren
@ 2013-11-15 20:54 ` Stephen Warren
2013-11-29 13:42 ` Thierry Reding
2013-11-15 20:54 ` [PATCH 10/31] ARM: tegra: pass reset to tegra_powergate_sequence_power_up() Stephen Warren
` (3 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Stephen Warren @ 2013-11-15 20:54 UTC (permalink / raw)
To: swarren
Cc: Terje Bergström, pdeschrijver, dri-devel, linux-tegra,
Stephen Warren, treding, linux-arm-kernel
From: Stephen Warren <swarren@nvidia.com>
Tegra's clock driver now provides an implementation of the common
reset API (include/linux/reset.h). Use this instead of the old Tegra-
specific API; that will soon be removed.
Cc: treding@nvidia.com
Cc: pdeschrijver@nvidia.com
Cc: linux-tegra@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: Terje Bergström <tbergstrom@nvidia.com>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
This patch is part of a series with strong internal depdendencies. I'm
looking for an ack so that I can take the entire series through the Tegra
and arm-soc trees. The series will be part of a stable branch that can be
merged into other subsystems if needed to avoid/resolve dependencies.
---
drivers/gpu/drm/tegra/Kconfig | 1 +
drivers/gpu/drm/tegra/dc.c | 9 ++++++++-
drivers/gpu/drm/tegra/drm.h | 3 +++
drivers/gpu/drm/tegra/gr3d.c | 16 ++++++++++++++++
drivers/gpu/drm/tegra/hdmi.c | 14 +++++++++++---
5 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/tegra/Kconfig b/drivers/gpu/drm/tegra/Kconfig
index 8961ba6a34b8..8db9b3bce001 100644
--- a/drivers/gpu/drm/tegra/Kconfig
+++ b/drivers/gpu/drm/tegra/Kconfig
@@ -2,6 +2,7 @@ config DRM_TEGRA
bool "NVIDIA Tegra DRM"
depends on ARCH_TEGRA || ARCH_MULTIPLATFORM
depends on DRM
+ depends on RESET_CONTROLLER
select TEGRA_HOST1X
select DRM_KMS_HELPER
select DRM_KMS_FB_HELPER
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index ae1cb31ead7e..c3be92879bea 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -10,6 +10,7 @@
#include <linux/clk.h>
#include <linux/clk/tegra.h>
#include <linux/debugfs.h>
+#include <linux/reset.h>
#include "dc.h"
#include "drm.h"
@@ -712,7 +713,7 @@ static void tegra_crtc_prepare(struct drm_crtc *crtc)
unsigned long value;
/* hardware initialization */
- tegra_periph_reset_deassert(dc->clk);
+ reset_control_deassert(dc->rst);
usleep_range(10000, 20000);
if (dc->pipe)
@@ -1187,6 +1188,12 @@ static int tegra_dc_probe(struct platform_device *pdev)
return PTR_ERR(dc->clk);
}
+ dc->rst = devm_reset_control_get(&pdev->dev, "dc");
+ if (IS_ERR(dc->rst)) {
+ dev_err(&pdev->dev, "failed to get reset\n");
+ return PTR_ERR(dc->rst);
+ }
+
err = clk_prepare_enable(dc->clk);
if (err < 0)
return err;
diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h
index fdfe259ed7f8..f717c18b28c2 100644
--- a/drivers/gpu/drm/tegra/drm.h
+++ b/drivers/gpu/drm/tegra/drm.h
@@ -19,6 +19,8 @@
#include <drm/drm_fb_helper.h>
#include <drm/drm_fixed.h>
+struct reset_control;
+
struct tegra_fb {
struct drm_framebuffer base;
struct tegra_bo **planes;
@@ -93,6 +95,7 @@ struct tegra_dc {
int pipe;
struct clk *clk;
+ struct reset_control *rst;
void __iomem *regs;
int irq;
diff --git a/drivers/gpu/drm/tegra/gr3d.c b/drivers/gpu/drm/tegra/gr3d.c
index 4cec8f526af7..f629e38b00e4 100644
--- a/drivers/gpu/drm/tegra/gr3d.c
+++ b/drivers/gpu/drm/tegra/gr3d.c
@@ -11,6 +11,7 @@
#include <linux/host1x.h>
#include <linux/module.h>
#include <linux/platform_device.h>
+#include <linux/reset.h>
#include <linux/tegra-powergate.h>
#include "drm.h"
@@ -22,6 +23,8 @@ struct gr3d {
struct host1x_channel *channel;
struct clk *clk_secondary;
struct clk *clk;
+ struct reset_control *rst_secondary;
+ struct reset_control *rst;
DECLARE_BITMAP(addr_regs, GR3D_NUM_REGS);
};
@@ -255,12 +258,25 @@ static int gr3d_probe(struct platform_device *pdev)
return PTR_ERR(gr3d->clk);
}
+ gr3d->rst = devm_reset_control_get(&pdev->dev, "3d");
+ if (IS_ERR(gr3d->rst)) {
+ dev_err(&pdev->dev, "cannot get reset\n");
+ return PTR_ERR(gr3d->rst);
+ }
+
if (of_device_is_compatible(np, "nvidia,tegra30-gr3d")) {
gr3d->clk_secondary = devm_clk_get(&pdev->dev, "3d2");
if (IS_ERR(gr3d->clk)) {
dev_err(&pdev->dev, "cannot get secondary clock\n");
return PTR_ERR(gr3d->clk);
}
+
+ gr3d->rst_secondary = devm_reset_control_get(&pdev->dev,
+ "3d2");
+ if (IS_ERR(gr3d->rst_secondary)) {
+ dev_err(&pdev->dev, "cannot get secondary reset\n");
+ return PTR_ERR(gr3d->rst_secondary);
+ }
}
err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_3D, gr3d->clk);
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index 0cd9bc2056e8..f3aad49633d6 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -12,6 +12,7 @@
#include <linux/debugfs.h>
#include <linux/hdmi.h>
#include <linux/regulator/consumer.h>
+#include <linux/reset.h>
#include "hdmi.h"
#include "drm.h"
@@ -49,6 +50,7 @@ struct tegra_hdmi {
struct clk *clk_parent;
struct clk *clk;
+ struct reset_control *rst;
const struct tegra_hdmi_config *config;
@@ -731,9 +733,9 @@ static int tegra_output_hdmi_enable(struct tegra_output *output)
return err;
}
- tegra_periph_reset_assert(hdmi->clk);
+ reset_control_assert(hdmi->rst);
usleep_range(1000, 2000);
- tegra_periph_reset_deassert(hdmi->clk);
+ reset_control_deassert(hdmi->rst);
tegra_dc_writel(dc, VSYNC_H_POSITION(1),
DC_DISP_DISP_TIMING_OPTIONS);
@@ -912,7 +914,7 @@ static int tegra_output_hdmi_disable(struct tegra_output *output)
{
struct tegra_hdmi *hdmi = to_hdmi(output);
- tegra_periph_reset_assert(hdmi->clk);
+ reset_control_assert(hdmi->rst);
clk_disable(hdmi->clk);
regulator_disable(hdmi->pll);
@@ -1338,6 +1340,12 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
return PTR_ERR(hdmi->clk);
}
+ hdmi->rst = devm_reset_control_get(&pdev->dev, "hdmi");
+ if (IS_ERR(hdmi->rst)) {
+ dev_err(&pdev->dev, "failed to get reset\n");
+ return PTR_ERR(hdmi->rst);
+ }
+
err = clk_prepare(hdmi->clk);
if (err < 0)
return err;
--
1.8.1.5
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH 09/31] drm/tegra: use reset framework
2013-11-15 20:54 ` [PATCH 09/31] drm/tegra: use reset framework Stephen Warren
@ 2013-11-29 13:42 ` Thierry Reding
0 siblings, 0 replies; 14+ messages in thread
From: Thierry Reding @ 2013-11-29 13:42 UTC (permalink / raw)
To: Stephen Warren
Cc: Stephen Warren, pdeschrijver, dri-devel, linux-tegra,
Terje Bergström, treding, linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 3482 bytes --]
On Fri, Nov 15, 2013 at 01:54:04PM -0700, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Tegra's clock driver now provides an implementation of the common
> reset API (include/linux/reset.h). Use this instead of the old Tegra-
> specific API; that will soon be removed.
>
> Cc: treding@nvidia.com
> Cc: pdeschrijver@nvidia.com
> Cc: linux-tegra@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: Terje Bergström <tbergstrom@nvidia.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> This patch is part of a series with strong internal depdendencies. I'm
> looking for an ack so that I can take the entire series through the Tegra
> and arm-soc trees. The series will be part of a stable branch that can be
> merged into other subsystems if needed to avoid/resolve dependencies.
> ---
> drivers/gpu/drm/tegra/Kconfig | 1 +
> drivers/gpu/drm/tegra/dc.c | 9 ++++++++-
> drivers/gpu/drm/tegra/drm.h | 3 +++
> drivers/gpu/drm/tegra/gr3d.c | 16 ++++++++++++++++
> drivers/gpu/drm/tegra/hdmi.c | 14 +++++++++++---
> 5 files changed, 39 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/tegra/Kconfig b/drivers/gpu/drm/tegra/Kconfig
> index 8961ba6a34b8..8db9b3bce001 100644
> --- a/drivers/gpu/drm/tegra/Kconfig
> +++ b/drivers/gpu/drm/tegra/Kconfig
> @@ -2,6 +2,7 @@ config DRM_TEGRA
> bool "NVIDIA Tegra DRM"
> depends on ARCH_TEGRA || ARCH_MULTIPLATFORM
> depends on DRM
> + depends on RESET_CONTROLLER
Is this really needed? ARCH_TEGRA already selects RESET_CONTROLLER and
we depend on ARCH_TEGRA. Or perhaps you need this because it might also
be that ARCH_MULTIPLATFORM is selected without ARCH_TEGRA support? In
either case I guess a good thing would be to add dummies for the reset
API so that we don't have this additional compile-time dependency.
> select TEGRA_HOST1X
> select DRM_KMS_HELPER
> select DRM_KMS_FB_HELPER
> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> index ae1cb31ead7e..c3be92879bea 100644
> --- a/drivers/gpu/drm/tegra/dc.c
> +++ b/drivers/gpu/drm/tegra/dc.c
> @@ -10,6 +10,7 @@
> #include <linux/clk.h>
> #include <linux/clk/tegra.h>
> #include <linux/debugfs.h>
> +#include <linux/reset.h>
You should be able to drop linux/clk/tegra.h now.
> diff --git a/drivers/gpu/drm/tegra/gr3d.c b/drivers/gpu/drm/tegra/gr3d.c
> index 4cec8f526af7..f629e38b00e4 100644
> --- a/drivers/gpu/drm/tegra/gr3d.c
> +++ b/drivers/gpu/drm/tegra/gr3d.c
> @@ -11,6 +11,7 @@
> #include <linux/host1x.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> +#include <linux/reset.h>
I was going to say "Same here", but interestingly this driver doesn't
use the old Tegra-specific reset API. It's actually handled internally
by the tegra_powergate_sequence_power_up() function and I think that'll
be handled by a separate patch in your series if I recall correctly.
> diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
> index 0cd9bc2056e8..f3aad49633d6 100644
> --- a/drivers/gpu/drm/tegra/hdmi.c
> +++ b/drivers/gpu/drm/tegra/hdmi.c
> @@ -12,6 +12,7 @@
> #include <linux/debugfs.h>
> #include <linux/hdmi.h>
> #include <linux/regulator/consumer.h>
> +#include <linux/reset.h>
But here the linux/clk/tegra.h include can again be dropped.
Thierry
[-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 10/31] ARM: tegra: pass reset to tegra_powergate_sequence_power_up()
2013-11-15 20:53 [PATCH 00/31] ARM: tegra: use common reset and DMA bindings Stephen Warren
2013-11-15 20:54 ` [PATCH 09/31] drm/tegra: use reset framework Stephen Warren
@ 2013-11-15 20:54 ` Stephen Warren
[not found] ` <1384548866-13141-11-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-11-29 13:45 ` Thierry Reding
2013-11-18 8:24 ` [PATCH 00/31] ARM: tegra: use common reset and DMA bindings Terje Bergström
` (2 subsequent siblings)
4 siblings, 2 replies; 14+ messages in thread
From: Stephen Warren @ 2013-11-15 20:54 UTC (permalink / raw)
To: swarren
Cc: Stephen Warren, treding, pdeschrijver, linux-tegra,
linux-arm-kernel, Bjorn Helgaas, linux-pci, Terje Bergström,
David Airlie, dri-devel
From: Stephen Warren <swarren@nvidia.com>
Tegra's clock driver now provides an implementation of the common
reset API (include/linux/reset.h). Use this instead of the old Tegra-
specific API; that will soon be removed.
Cc: treding@nvidia.com
Cc: pdeschrijver@nvidia.com
Cc: linux-tegra@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Cc: Terje Bergström <tbergstrom@nvidia.com>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
This patch is part of a series with strong internal depdendencies. I'm
looking for an ack so that I can take the entire series through the Tegra
and arm-soc trees. The series will be part of a stable branch that can be
merged into other subsystems if needed to avoid/resolve dependencies.
---
arch/arm/mach-tegra/powergate.c | 8 +++++---
drivers/gpu/drm/tegra/gr3d.c | 6 ++++--
drivers/pci/host/pci-tegra.c | 3 ++-
include/linux/tegra-powergate.h | 4 +++-
4 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index 85d28e756bb7..f6f5b54ff95e 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -25,6 +25,7 @@
#include <linux/export.h>
#include <linux/init.h>
#include <linux/io.h>
+#include <linux/reset.h>
#include <linux/seq_file.h>
#include <linux/spinlock.h>
#include <linux/clk/tegra.h>
@@ -144,11 +145,12 @@ int tegra_powergate_remove_clamping(int id)
}
/* Must be called with clk disabled, and returns with clk enabled */
-int tegra_powergate_sequence_power_up(int id, struct clk *clk)
+int tegra_powergate_sequence_power_up(int id, struct clk *clk,
+ struct reset_control *rst)
{
int ret;
- tegra_periph_reset_assert(clk);
+ reset_control_assert(rst);
ret = tegra_powergate_power_on(id);
if (ret)
@@ -165,7 +167,7 @@ int tegra_powergate_sequence_power_up(int id, struct clk *clk)
goto err_clamp;
udelay(10);
- tegra_periph_reset_deassert(clk);
+ reset_control_deassert(rst);
return 0;
diff --git a/drivers/gpu/drm/tegra/gr3d.c b/drivers/gpu/drm/tegra/gr3d.c
index f629e38b00e4..0cbb24b1ae04 100644
--- a/drivers/gpu/drm/tegra/gr3d.c
+++ b/drivers/gpu/drm/tegra/gr3d.c
@@ -279,7 +279,8 @@ static int gr3d_probe(struct platform_device *pdev)
}
}
- err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_3D, gr3d->clk);
+ err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_3D, gr3d->clk,
+ gr3d->rst);
if (err < 0) {
dev_err(&pdev->dev, "failed to power up 3D unit\n");
return err;
@@ -287,7 +288,8 @@ static int gr3d_probe(struct platform_device *pdev)
if (gr3d->clk_secondary) {
err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_3D1,
- gr3d->clk_secondary);
+ gr3d->clk_secondary,
+ gr3d->rst_secondary);
if (err < 0) {
dev_err(&pdev->dev,
"failed to power up secondary 3D unit\n");
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 174a5bc2d993..aace19edc469 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -956,7 +956,8 @@ static int tegra_pcie_power_on(struct tegra_pcie *pcie)
}
err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_PCIE,
- pcie->pex_clk);
+ pcie->pex_clk,
+ pcie->pex_rst);
if (err) {
dev_err(pcie->dev, "powerup sequence failed: %d\n", err);
return err;
diff --git a/include/linux/tegra-powergate.h b/include/linux/tegra-powergate.h
index c98cfa406952..b5ad64aca071 100644
--- a/include/linux/tegra-powergate.h
+++ b/include/linux/tegra-powergate.h
@@ -19,6 +19,7 @@
#define _MACH_TEGRA_POWERGATE_H_
struct clk;
+struct reset_control;
#define TEGRA_POWERGATE_CPU 0
#define TEGRA_POWERGATE_3D 1
@@ -51,6 +52,7 @@ int tegra_powergate_power_off(int id);
int tegra_powergate_remove_clamping(int id);
/* Must be called with clk disabled, and returns with clk enabled */
-int tegra_powergate_sequence_power_up(int id, struct clk *clk);
+int tegra_powergate_sequence_power_up(int id, struct clk *clk,
+ struct reset_control *rst);
#endif /* _MACH_TEGRA_POWERGATE_H_ */
--
1.8.1.5
^ permalink raw reply related [flat|nested] 14+ messages in thread[parent not found: <1384548866-13141-11-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>]
* Re: [PATCH 10/31] ARM: tegra: pass reset to tegra_powergate_sequence_power_up()
[not found] ` <1384548866-13141-11-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-11-15 21:17 ` Bjorn Helgaas
0 siblings, 0 replies; 14+ messages in thread
From: Bjorn Helgaas @ 2013-11-15 21:17 UTC (permalink / raw)
To: Stephen Warren
Cc: Stephen Warren, treding-DDmLM1+adcrQT0dZR+AlfA,
pdeschrijver-DDmLM1+adcrQT0dZR+AlfA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm,
linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Terje Bergström, David Airlie, DRI mailing list
On Fri, Nov 15, 2013 at 1:54 PM, Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> Tegra's clock driver now provides an implementation of the common
> reset API (include/linux/reset.h). Use this instead of the old Tegra-
> specific API; that will soon be removed.
>
> Cc: treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
> Cc: pdeschrijver-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
> Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> Cc: Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> Cc: linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: Terje Bergström <tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Cc: David Airlie <airlied-cv59FeDIM0c@public.gmane.org>
> Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Acked-by: Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> ---
> This patch is part of a series with strong internal depdendencies. I'm
> looking for an ack so that I can take the entire series through the Tegra
> and arm-soc trees. The series will be part of a stable branch that can be
> merged into other subsystems if needed to avoid/resolve dependencies.
> ---
> arch/arm/mach-tegra/powergate.c | 8 +++++---
> drivers/gpu/drm/tegra/gr3d.c | 6 ++++--
> drivers/pci/host/pci-tegra.c | 3 ++-
> include/linux/tegra-powergate.h | 4 +++-
> 4 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
> index 85d28e756bb7..f6f5b54ff95e 100644
> --- a/arch/arm/mach-tegra/powergate.c
> +++ b/arch/arm/mach-tegra/powergate.c
> @@ -25,6 +25,7 @@
> #include <linux/export.h>
> #include <linux/init.h>
> #include <linux/io.h>
> +#include <linux/reset.h>
> #include <linux/seq_file.h>
> #include <linux/spinlock.h>
> #include <linux/clk/tegra.h>
> @@ -144,11 +145,12 @@ int tegra_powergate_remove_clamping(int id)
> }
>
> /* Must be called with clk disabled, and returns with clk enabled */
> -int tegra_powergate_sequence_power_up(int id, struct clk *clk)
> +int tegra_powergate_sequence_power_up(int id, struct clk *clk,
> + struct reset_control *rst)
> {
> int ret;
>
> - tegra_periph_reset_assert(clk);
> + reset_control_assert(rst);
>
> ret = tegra_powergate_power_on(id);
> if (ret)
> @@ -165,7 +167,7 @@ int tegra_powergate_sequence_power_up(int id, struct clk *clk)
> goto err_clamp;
>
> udelay(10);
> - tegra_periph_reset_deassert(clk);
> + reset_control_deassert(rst);
>
> return 0;
>
> diff --git a/drivers/gpu/drm/tegra/gr3d.c b/drivers/gpu/drm/tegra/gr3d.c
> index f629e38b00e4..0cbb24b1ae04 100644
> --- a/drivers/gpu/drm/tegra/gr3d.c
> +++ b/drivers/gpu/drm/tegra/gr3d.c
> @@ -279,7 +279,8 @@ static int gr3d_probe(struct platform_device *pdev)
> }
> }
>
> - err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_3D, gr3d->clk);
> + err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_3D, gr3d->clk,
> + gr3d->rst);
> if (err < 0) {
> dev_err(&pdev->dev, "failed to power up 3D unit\n");
> return err;
> @@ -287,7 +288,8 @@ static int gr3d_probe(struct platform_device *pdev)
>
> if (gr3d->clk_secondary) {
> err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_3D1,
> - gr3d->clk_secondary);
> + gr3d->clk_secondary,
> + gr3d->rst_secondary);
> if (err < 0) {
> dev_err(&pdev->dev,
> "failed to power up secondary 3D unit\n");
> diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
> index 174a5bc2d993..aace19edc469 100644
> --- a/drivers/pci/host/pci-tegra.c
> +++ b/drivers/pci/host/pci-tegra.c
> @@ -956,7 +956,8 @@ static int tegra_pcie_power_on(struct tegra_pcie *pcie)
> }
>
> err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_PCIE,
> - pcie->pex_clk);
> + pcie->pex_clk,
> + pcie->pex_rst);
> if (err) {
> dev_err(pcie->dev, "powerup sequence failed: %d\n", err);
> return err;
> diff --git a/include/linux/tegra-powergate.h b/include/linux/tegra-powergate.h
> index c98cfa406952..b5ad64aca071 100644
> --- a/include/linux/tegra-powergate.h
> +++ b/include/linux/tegra-powergate.h
> @@ -19,6 +19,7 @@
> #define _MACH_TEGRA_POWERGATE_H_
>
> struct clk;
> +struct reset_control;
>
> #define TEGRA_POWERGATE_CPU 0
> #define TEGRA_POWERGATE_3D 1
> @@ -51,6 +52,7 @@ int tegra_powergate_power_off(int id);
> int tegra_powergate_remove_clamping(int id);
>
> /* Must be called with clk disabled, and returns with clk enabled */
> -int tegra_powergate_sequence_power_up(int id, struct clk *clk);
> +int tegra_powergate_sequence_power_up(int id, struct clk *clk,
> + struct reset_control *rst);
>
> #endif /* _MACH_TEGRA_POWERGATE_H_ */
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 10/31] ARM: tegra: pass reset to tegra_powergate_sequence_power_up()
2013-11-15 20:54 ` [PATCH 10/31] ARM: tegra: pass reset to tegra_powergate_sequence_power_up() Stephen Warren
[not found] ` <1384548866-13141-11-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-11-29 13:45 ` Thierry Reding
[not found] ` <20131129134532.GX22771-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
1 sibling, 1 reply; 14+ messages in thread
From: Thierry Reding @ 2013-11-29 13:45 UTC (permalink / raw)
To: Stephen Warren
Cc: Stephen Warren, linux-pci, pdeschrijver, dri-devel, linux-tegra,
Bjorn Helgaas, Terje Bergström, treding, linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 372 bytes --]
On Fri, Nov 15, 2013 at 01:54:05PM -0700, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Tegra's clock driver now provides an implementation of the common
> reset API (include/linux/reset.h). Use this instead of the old Tegra-
> specific API; that will soon be removed.
Ah, there it is!
Reviewed-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 00/31] ARM: tegra: use common reset and DMA bindings
2013-11-15 20:53 [PATCH 00/31] ARM: tegra: use common reset and DMA bindings Stephen Warren
2013-11-15 20:54 ` [PATCH 09/31] drm/tegra: use reset framework Stephen Warren
2013-11-15 20:54 ` [PATCH 10/31] ARM: tegra: pass reset to tegra_powergate_sequence_power_up() Stephen Warren
@ 2013-11-18 8:24 ` Terje Bergström
2013-11-20 15:37 ` Arnd Bergmann
2013-12-12 0:11 ` Stephen Warren
4 siblings, 0 replies; 14+ messages in thread
From: Terje Bergström @ 2013-11-18 8:24 UTC (permalink / raw)
To: Stephen Warren
Cc: Mark Rutland, alsa-devel@alsa-project.org,
linux-usb@vger.kernel.org, Wolfram Sang, David Airlie,
linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org,
Marc Dietrich, linux-tegra@vger.kernel.org,
linux-i2c@vger.kernel.org, ac100@lists.launchpad.net,
devel@driverdev.osuosl.org, Stephen Warren, Alan Stern,
linux-serial@vger.kernel.org, linux-input@vger.kernel.org,
Thierry Reding, devicetree
On 15.11.2013 22:53, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> This series implements a common reset framework driver for Tegra, and
> updates all relevant Tegra drivers to use it. It also removes the custom
> DMA bindings and replaced them with the standard DMA DT bindings.
>
> Historically, the Tegra clock driver has exported a custom API for module
> reset. This series removes that API, and transitions DT and drivers to
> the new reset framework.
>
> The custom API used a "struct clk" to identify which module to reset, and
> consequently some DT bindings and drivers required clocks to be provided
> where they really needed just a reset identifier instead. Due to this
> known deficiency, I have always considered most Tegra bindings to be
> unstable. This series removes this excuse for instability, although I
> still consider some Tegra bindings unstable due to the need to convert to
> the common DMA bindings.
>
> Historically, Tegra DMA channels have been represented in DT using a
> custom nvidia,dma-request-selector property. Now that standard DMA DT
> bindings exist, convert all Tegra bindings, DTs, and drivers to use the
> standard instead.
>
> This series makes a DT-ABI-incompatible change to:
> - Require reset specifiers in DT where relevant.
> - Require standard DMA specifiers.
> - Remove clock specifiers from DT where they were only needed for reset.
> - Remove legacy DMA specifier properties.
>
> I anticipate merging this whole series into the Tegra and arm-soc trees
> as its own branch, due to internal dependencies. This branch will be
> stable and can then be merged into any other subsystem trees should any
> conflicts arise.
>
> This series depends on Peter's Tegra clock driver rework, available at
> git://nv-tegra.nvidia.com/user/pdeschrijver/linux tegra-clk-tegra124-0
> (or whatever version of that gets included in 3.14)
Overall, a good change. For host1x part:
Acked-By: Terje Bergstrom <tbergstrom@nvidia.com>
This patch does not change the behavior, but we have in original code
the problem that we don't flush the MC queue when resetting an engine.
This can cause some memory writes to not hit memory. There was an
earlier discussion on that, but we seem to have lost track of the issue.
Terje
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 00/31] ARM: tegra: use common reset and DMA bindings
2013-11-15 20:53 [PATCH 00/31] ARM: tegra: use common reset and DMA bindings Stephen Warren
` (2 preceding siblings ...)
2013-11-18 8:24 ` [PATCH 00/31] ARM: tegra: use common reset and DMA bindings Terje Bergström
@ 2013-11-20 15:37 ` Arnd Bergmann
2013-11-20 16:45 ` Stephen Warren
2013-12-12 0:11 ` Stephen Warren
4 siblings, 1 reply; 14+ messages in thread
From: Arnd Bergmann @ 2013-11-20 15:37 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Mark Rutland, alsa-devel, Dmitry Torokhov, Wolfram Sang,
David Airlie, linux-pci, dri-devel, Marc Dietrich, Bjorn Helgaas,
linux-i2c, ac100, devel, Stephen Warren, Mike Turquette,
Ian Campbell, Alan Stern, linux-serial, linux-input, treding,
devicetree, Pawel Moll, Stephen Warren, Julian Andres Klode,
Rob Herring, Mark Brown, linux-tegra, Terje
On Friday 15 November 2013, Stephen Warren wrote:
> This series implements a common reset framework driver for Tegra, and
> updates all relevant Tegra drivers to use it. It also removes the custom
> DMA bindings and replaced them with the standard DMA DT bindings.
The series is rather long, so I may have missed it, but I think you need one
more patch to the apbdma binding to document the use of #dma-cells, what
value it has, and what the format of the dma specifiers in slave drivers
needs to be.
Arnd
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 00/31] ARM: tegra: use common reset and DMA bindings
2013-11-20 15:37 ` Arnd Bergmann
@ 2013-11-20 16:45 ` Stephen Warren
2013-11-20 17:03 ` Arnd Bergmann
2013-11-20 19:17 ` [Ac100] " Martino Brandolini
0 siblings, 2 replies; 14+ messages in thread
From: Stephen Warren @ 2013-11-20 16:45 UTC (permalink / raw)
To: Arnd Bergmann, linux-arm-kernel
Cc: Mark Rutland, alsa-devel, Dmitry Torokhov, Wolfram Sang,
David Airlie, linux-pci, dri-devel, Marc Dietrich, Bjorn Helgaas,
linux-i2c, ac100, devel, Stephen Warren, Mike Turquette,
Alan Stern, linux-serial, linux-input, treding, devicetree,
Pawel Moll, Ian Campbell, Julian Andres Klode, Rob Herring,
Mark Brown, linux-tegra
On 11/20/2013 08:37 AM, Arnd Bergmann wrote:
> On Friday 15 November 2013, Stephen Warren wrote:
>> This series implements a common reset framework driver for Tegra, and
>> updates all relevant Tegra drivers to use it. It also removes the custom
>> DMA bindings and replaced them with the standard DMA DT bindings.
>
> The series is rather long, so I may have missed it, but I think you need one
> more patch to the apbdma binding to document the use of #dma-cells, what
> value it has, and what the format of the dma specifiers in slave drivers
> needs to be.
Yes, you're right. I will fold the following into "ARM: tegra: document
use of standard DMA DT bindings":
> diff --git a/Documentation/devicetree/bindings/dma/tegra20-apbdma.txt b/Documentation/devicetree/bindings/dma/tegra20-apbdma.txt
> index 0b1e577ab9d3..0b0f9498e265 100644
> --- a/Documentation/devicetree/bindings/dma/tegra20-apbdma.txt
> +++ b/Documentation/devicetree/bindings/dma/tegra20-apbdma.txt
> @@ -11,6 +11,10 @@ Required properties:
> See ../reset/reset.txt for details.
> - reset-names : Must include the following entries:
> - dma
> +- #iommu-cells : Must be <1>. This dictates the length of DMA specifiers in
> + client nodes' dmas properties. The specifier represents the DMA request
> + select value for the peripheral. For more details, consult the Tegra TRM's
> + documentation of the APB DMA channel control register REQ_SEL field.
>
> Examples:
>
> @@ -36,4 +40,5 @@ apbdma: dma@6000a000 {
> clocks = <&tegra_car 34>;
> resets = <&tegra_car 34>;
> reset-names = "dma";
> + #iommu-cells = <1>;
> };
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 00/31] ARM: tegra: use common reset and DMA bindings
2013-11-20 16:45 ` Stephen Warren
@ 2013-11-20 17:03 ` Arnd Bergmann
2013-11-20 17:23 ` Stephen Warren
2013-11-20 19:17 ` [Ac100] " Martino Brandolini
1 sibling, 1 reply; 14+ messages in thread
From: Arnd Bergmann @ 2013-11-20 17:03 UTC (permalink / raw)
To: Stephen Warren
Cc: Mark Rutland, alsa-devel, Dmitry Torokhov, Wolfram Sang,
David Airlie, linux-pci, dri-devel, Bjorn Helgaas, linux-i2c,
ac100, devel, Stephen Warren, Mike Turquette, Alan Stern,
linux-serial, linux-input, treding, devicetree, Pawel Moll,
Ian Campbell, Rob Herring, Mark Brown, linux-tegra,
Terje Bergström, Dan Williams, linux-arm-kernel
On Wednesday 20 November 2013, Stephen Warren wrote:
> > +- #iommu-cells : Must be <1>. This dictates the length of DMA specifiers in
> > + client nodes' dmas properties. The specifier represents the DMA request
> > + select value for the peripheral. For more details, consult the Tegra TRM's
> > + documentation of the APB DMA channel control register REQ_SEL field.
> >
> > Examples:
> >
> > @@ -36,4 +40,5 @@ apbdma: dma@6000a000 {
> > clocks = <&tegra_car 34>;
> > resets = <&tegra_car 34>;
> > reset-names = "dma";
> > + #iommu-cells = <1>;
s/iommu/dma/
Otherwise looks good. The dts files are correct, so I guess it's just
a typo here.
Arnd
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 00/31] ARM: tegra: use common reset and DMA bindings
2013-11-20 17:03 ` Arnd Bergmann
@ 2013-11-20 17:23 ` Stephen Warren
0 siblings, 0 replies; 14+ messages in thread
From: Stephen Warren @ 2013-11-20 17:23 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Mark Rutland, alsa-devel, Dmitry Torokhov, Wolfram Sang,
David Airlie, linux-pci, dri-devel, Bjorn Helgaas, linux-i2c,
ac100, devel, Stephen Warren, Mike Turquette, Alan Stern,
linux-serial, linux-input, treding, devicetree, Pawel Moll,
Ian Campbell, Rob Herring, Mark Brown, linux-tegra,
Terje Bergström, Dan Williams, linux-arm-kernel
On 11/20/2013 10:03 AM, Arnd Bergmann wrote:
> On Wednesday 20 November 2013, Stephen Warren wrote:
>>> +- #iommu-cells : Must be <1>. This dictates the length of DMA specifiers in
>>> + client nodes' dmas properties. The specifier represents the DMA request
>>> + select value for the peripheral. For more details, consult the Tegra TRM's
>>> + documentation of the APB DMA channel control register REQ_SEL field.
>>>
>>> Examples:
>>>
>>> @@ -36,4 +40,5 @@ apbdma: dma@6000a000 {
>>> clocks = <&tegra_car 34>;
>>> resets = <&tegra_car 34>;
>>> reset-names = "dma";
>>> + #iommu-cells = <1>;
>
>
> s/iommu/dma/
>
> Otherwise looks good. The dts files are correct, so I guess it's just
> a typo here.
Thanks, fixed locally.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Ac100] [PATCH 00/31] ARM: tegra: use common reset and DMA bindings
2013-11-20 16:45 ` Stephen Warren
2013-11-20 17:03 ` Arnd Bergmann
@ 2013-11-20 19:17 ` Martino Brandolini
1 sibling, 0 replies; 14+ messages in thread
From: Martino Brandolini @ 2013-11-20 19:17 UTC (permalink / raw)
To: Stephen Warren
Cc: Mark Rutland, alsa-devel, linux-usb, Wolfram Sang, linux-pci,
dri-devel, linux-tegra, linux-i2c, ac100, devel, Stephen Warren,
Arnd Bergmann, Terje Bergström, Alan Stern, linux-serial,
linux-input, treding, devicetree, Pawel Moll, Ian Campbell,
Julian Andres Klode, Rob Herring, Mark Brown, Bjorn Helgaas,
Mike Turquette, Dan Williams
[-- Attachment #1.1: Type: text/plain, Size: 2260 bytes --]
Dear all,
My ac100 screen is flickering so much. I realized I'm not using it anymore.
So if anyone wants to have it for free would be for me a huge pleasure to
give it away. I'm based in milan and I'll be in London for the next week.
Maybe someone needs it.
Martino
2013/11/20 Stephen Warren <swarren@wwwdotorg.org>
> On 11/20/2013 08:37 AM, Arnd Bergmann wrote:
> > On Friday 15 November 2013, Stephen Warren wrote:
> >> This series implements a common reset framework driver for Tegra, and
> >> updates all relevant Tegra drivers to use it. It also removes the custom
> >> DMA bindings and replaced them with the standard DMA DT bindings.
> >
> > The series is rather long, so I may have missed it, but I think you need
> one
> > more patch to the apbdma binding to document the use of #dma-cells, what
> > value it has, and what the format of the dma specifiers in slave drivers
> > needs to be.
>
> Yes, you're right. I will fold the following into "ARM: tegra: document
> use of standard DMA DT bindings":
>
> > diff --git a/Documentation/devicetree/bindings/dma/tegra20-apbdma.txt
> b/Documentation/devicetree/bindings/dma/tegra20-apbdma.txt
> > index 0b1e577ab9d3..0b0f9498e265 100644
> > --- a/Documentation/devicetree/bindings/dma/tegra20-apbdma.txt
> > +++ b/Documentation/devicetree/bindings/dma/tegra20-apbdma.txt
> > @@ -11,6 +11,10 @@ Required properties:
> > See ../reset/reset.txt for details.
> > - reset-names : Must include the following entries:
> > - dma
> > +- #iommu-cells : Must be <1>. This dictates the length of DMA
> specifiers in
> > + client nodes' dmas properties. The specifier represents the DMA
> request
> > + select value for the peripheral. For more details, consult the Tegra
> TRM's
> > + documentation of the APB DMA channel control register REQ_SEL field.
> >
> > Examples:
> >
> > @@ -36,4 +40,5 @@ apbdma: dma@6000a000 {
> > clocks = <&tegra_car 34>;
> > resets = <&tegra_car 34>;
> > reset-names = "dma";
> > + #iommu-cells = <1>;
> > };
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~ac100
> Post to : ac100@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~ac100
> More help : https://help.launchpad.net/ListHelp
>
[-- Attachment #1.2: Type: text/html, Size: 3121 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 00/31] ARM: tegra: use common reset and DMA bindings
2013-11-15 20:53 [PATCH 00/31] ARM: tegra: use common reset and DMA bindings Stephen Warren
` (3 preceding siblings ...)
2013-11-20 15:37 ` Arnd Bergmann
@ 2013-12-12 0:11 ` Stephen Warren
4 siblings, 0 replies; 14+ messages in thread
From: Stephen Warren @ 2013-12-12 0:11 UTC (permalink / raw)
To: swarren
Cc: Mark Rutland, alsa-devel, linux-usb, Wolfram Sang, David Airlie,
linux-pci, dri-devel, linux-tegra, linux-i2c, ac100, devel,
Stephen Warren, Alan Stern, linux-serial, linux-input,
Terje Bergström, devicetree, Pawel Moll, Ian Campbell,
Rob Herring, Mark Brown, Bjorn Helgaas, Mike Turquette,
Dan Williams, linux-arm-kernel, treding
On 11/15/2013 01:53 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> This series implements a common reset framework driver for Tegra, and
> updates all relevant Tegra drivers to use it. It also removes the custom
> DMA bindings and replaced them with the standard DMA DT bindings.
>
> Historically, the Tegra clock driver has exported a custom API for module
> reset. This series removes that API, and transitions DT and drivers to
> the new reset framework.
>
> The custom API used a "struct clk" to identify which module to reset, and
> consequently some DT bindings and drivers required clocks to be provided
> where they really needed just a reset identifier instead. Due to this
> known deficiency, I have always considered most Tegra bindings to be
> unstable. This series removes this excuse for instability, although I
> still consider some Tegra bindings unstable due to the need to convert to
> the common DMA bindings.
>
> Historically, Tegra DMA channels have been represented in DT using a
> custom nvidia,dma-request-selector property. Now that standard DMA DT
> bindings exist, convert all Tegra bindings, DTs, and drivers to use the
> standard instead.
>
> This series makes a DT-ABI-incompatible change to:
> - Require reset specifiers in DT where relevant.
> - Require standard DMA specifiers.
> - Remove clock specifiers from DT where they were only needed for reset.
> - Remove legacy DMA specifier properties.
>
> I anticipate merging this whole series into the Tegra and arm-soc trees
> as its own branch, due to internal dependencies. This branch will be
> stable and can then be merged into any other subsystem trees should any
> conflicts arise.
>
> This series depends on Peter's Tegra clock driver rework, available at
> git://nv-tegra.nvidia.com/user/pdeschrijver/linux tegra-clk-tegra124-0
> (or whatever version of that gets included in 3.14)
I've applied this series (and pulled in the DMA/ASoC/clk dependencies
required) to Tegra's for-3.14/dmas-resets-rework branch.
^ permalink raw reply [flat|nested] 14+ messages in thread