linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] drm/nouveau: platform devices and GK20A probing
@ 2014-05-19  9:24 Alexandre Courbot
  2014-05-19  9:24 ` [PATCH 2/5] ARM: tegra: of: add GK20A device tree binding Alexandre Courbot
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Alexandre Courbot @ 2014-05-19  9:24 UTC (permalink / raw)
  To: Ben Skeggs, Stephen Warren, Thierry Reding
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

This patch series is the final (?) step towards the initial support of GK20A,
allowing it to be probed and used (currently at a very slow speed, and for
offscreen rendering only) on the Jetson TK1 and Venice 2 boards.

The main piece if the first patch which adds platform devices probing support
to Nouveau. There are probably lots of things that need to be discussed about
it, e.g.:

* The way the DRM device is created, especially with respect to the ongoing
  changes to the DRM framework,
* The fact that the same drm_driver instance is used for the PCI and platform
  drivers,
* Whether we should have only one platform driver capable of probing all
  platform devices, or one driver per GPU (in this case, where should all these
  drivers reside?)

So there are still some rough edges, but we are getting there. :)

The first patch should go through the Nouveau tree, while the 4 others are
rather intended for Tegra.

Alexandre Courbot (3):
  drm/nouveau: support for probing platform devices
  ARM: tegra: of: add GK20A device tree binding
  ARM: tegra: jetson-tk1: enable GK20A GPU

Thierry Reding (2):
  ARM: tegra: add GK20A GPU to Tegra124 DT
  ARM: tegra: venice2: enable GK20A GPU

 .../devicetree/bindings/gpu/nvidia,gk20a.txt       |  45 +++++
 arch/arm/boot/dts/tegra124-jetson-tk1.dts          |   8 +-
 arch/arm/boot/dts/tegra124-venice2.dts             |   8 +-
 arch/arm/boot/dts/tegra124.dtsi                    |  15 ++
 drivers/gpu/drm/nouveau/Kconfig                    |   8 +
 drivers/gpu/drm/nouveau/Makefile                   |   3 +
 drivers/gpu/drm/nouveau/nouveau_drm.c              |  33 ++--
 drivers/gpu/drm/nouveau/nouveau_drm.h              |  21 +++
 drivers/gpu/drm/nouveau/nouveau_platform.c         | 191 +++++++++++++++++++++
 9 files changed, 315 insertions(+), 17 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/gpu/nvidia,gk20a.txt
 create mode 100644 drivers/gpu/drm/nouveau/nouveau_platform.c

-- 
1.9.2

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 1/5] drm/nouveau: support for probing platform devices
       [not found] ` <1400491450-19223-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2014-05-19  9:24   ` Alexandre Courbot
  2014-05-19  9:24   ` [PATCH 3/5] ARM: tegra: add GK20A GPU to Tegra124 DT Alexandre Courbot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 19+ messages in thread
From: Alexandre Courbot @ 2014-05-19  9:24 UTC (permalink / raw)
  To: Ben Skeggs, Stephen Warren, Thierry Reding
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Thierry Reding

Add a platform driver for Nouveau devices declared using the device tree
or platform data. This driver currently supports GK20A on Tegra
platforms and is only compiled for these platforms if Nouveau is
enabled.

Nouveau will probe the chip type itself using the BOOT0 register, so all
this driver really needs to do is to make sure the module is powered and
its clocks active before calling nouveau_drm_platform_probe().

Heavily based on work done by Thierry Reding.

Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 drivers/gpu/drm/nouveau/Kconfig            |   8 ++
 drivers/gpu/drm/nouveau/Makefile           |   3 +
 drivers/gpu/drm/nouveau/nouveau_drm.c      |  33 ++---
 drivers/gpu/drm/nouveau/nouveau_drm.h      |  21 ++++
 drivers/gpu/drm/nouveau/nouveau_platform.c | 191 +++++++++++++++++++++++++++++
 5 files changed, 241 insertions(+), 15 deletions(-)
 create mode 100644 drivers/gpu/drm/nouveau/nouveau_platform.c

diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
index 637c29a33127..b8834ad55eb8 100644
--- a/drivers/gpu/drm/nouveau/Kconfig
+++ b/drivers/gpu/drm/nouveau/Kconfig
@@ -25,6 +25,14 @@ config DRM_NOUVEAU
 	help
 	  Choose this option for open-source nVidia support.
 
+config NOUVEAU_PLATFORM_DRIVER
+	bool
+	depends on DRM_NOUVEAU
+	default y if ARCH_TEGRA
+	help
+	 Support for Nouveau platform driver, used for integrated GPUs as found
+	 on NVIDIA Tegra K1.
+
 config NOUVEAU_DEBUG
 	int "Maximum debug level"
 	depends on DRM_NOUVEAU
diff --git a/drivers/gpu/drm/nouveau/Makefile b/drivers/gpu/drm/nouveau/Makefile
index 1aaa2ef577d9..45b17b6b1b59 100644
--- a/drivers/gpu/drm/nouveau/Makefile
+++ b/drivers/gpu/drm/nouveau/Makefile
@@ -331,6 +331,9 @@ nouveau-y += nv50_display.o
 # drm/pm
 nouveau-y += nouveau_hwmon.o nouveau_sysfs.o
 
+# platform driver
+nouveau-$(CONFIG_NOUVEAU_PLATFORM_DRIVER) += nouveau_platform.o
+
 # other random bits
 nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o
 ifdef CONFIG_X86
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index ddd83756b9a2..1538d0004e6e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -359,6 +359,9 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags)
 
 	dev->dev_private = drm;
 	drm->dev = dev;
+	if (dev->platformdev)
+		platform_set_drvdata(dev->platformdev, dev);
+
 	nouveau_client(drm)->debug = nouveau_dbgopt(nouveau_debug, "DRM");
 
 	INIT_LIST_HEAD(&drm->clients);
@@ -1003,23 +1006,19 @@ nouveau_drm_pci_driver = {
 	.driver.pm = &nouveau_pm_ops,
 };
 
-int nouveau_drm_platform_probe(struct platform_device *pdev)
+int nouveau_drm_platform_device_create(struct platform_device *pdev, int length,
+				       void **pobject)
 {
-	struct nouveau_device *device;
-	int ret;
-
-	ret = nouveau_device_create(pdev, NOUVEAU_BUS_PLATFORM,
-				    nouveau_platform_name(pdev),
-				    dev_name(&pdev->dev), nouveau_config,
-				    nouveau_debug, &device);
-
-	ret = drm_platform_init(&driver, pdev);
-	if (ret) {
-		nouveau_object_ref(NULL, (struct nouveau_object **)&device);
-		return ret;
-	}
+	return nouveau_device_create_(pdev, NOUVEAU_BUS_PLATFORM,
+				      nouveau_platform_name(pdev),
+				      dev_name(&pdev->dev),
+				      nouveau_config, nouveau_debug, length,
+				      pobject);
+}
 
-	return ret;
+int nouveau_drm_platform_device_init(struct platform_device *pdev)
+{
+	return drm_platform_init(&driver, pdev);
 }
 
 static int __init
@@ -1035,6 +1034,8 @@ nouveau_drm_init(void)
 	if (!nouveau_modeset)
 		return 0;
 
+	nouveau_platform_driver_init();
+
 	nouveau_register_dsm_handler();
 	return drm_pci_init(&driver, &nouveau_drm_pci_driver);
 }
@@ -1047,6 +1048,8 @@ nouveau_drm_exit(void)
 
 	drm_pci_exit(&driver, &nouveau_drm_pci_driver);
 	nouveau_unregister_dsm_handler();
+
+	nouveau_platform_driver_exit();
 }
 
 module_init(nouveau_drm_init);
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.h b/drivers/gpu/drm/nouveau/nouveau_drm.h
index 7efbafaf7c1d..178f8cfb148c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.h
@@ -157,6 +157,27 @@ nouveau_dev(struct drm_device *dev)
 int nouveau_pmops_suspend(struct device *);
 int nouveau_pmops_resume(struct device *);
 
+int nouveau_drm_platform_device_create(struct platform_device *, int, void **);
+int nouveau_drm_platform_device_init(struct platform_device *);
+
+#if IS_ENABLED(CONFIG_NOUVEAU_PLATFORM_DRIVER)
+
+int nouveau_platform_driver_init(void);
+void nouveau_platform_driver_exit(void);
+
+#else
+
+static inline int nouveau_platform_driver_init(void)
+{
+	return 0;
+}
+
+static inline void nouveau_platform_driver_exit(void)
+{
+}
+
+#endif
+
 #define NV_FATAL(cli, fmt, args...) nv_fatal((cli), fmt, ##args)
 #define NV_ERROR(cli, fmt, args...) nv_error((cli), fmt, ##args)
 #define NV_WARN(cli, fmt, args...) nv_warn((cli), fmt, ##args)
diff --git a/drivers/gpu/drm/nouveau/nouveau_platform.c b/drivers/gpu/drm/nouveau/nouveau_platform.c
new file mode 100644
index 000000000000..0d55e04c816a
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/nouveau_platform.c
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/reset.h>
+#include <linux/regulator/consumer.h>
+#include <linux/tegra-powergate.h>
+
+#include "engine/device.h"
+#include "nouveau_drm.h"
+
+struct nouveau_platform_gpu {
+	struct nouveau_device device;
+
+	struct reset_control *rst;
+	struct clk *clk;
+	struct clk *clk_pll;
+
+	struct regulator *vdd;
+};
+
+#define nv_device_to_gpu(d) container_of(d, struct nouveau_platform_gpu, device)
+
+static int nouveau_platform_power_up(struct nouveau_platform_gpu *gpu)
+{
+	int err;
+
+	reset_control_assert(gpu->rst);
+
+	err = regulator_enable(gpu->vdd);
+	if (err)
+		goto err_power;
+
+	err = clk_prepare_enable(gpu->clk);
+	if (err)
+		goto err_clk;
+
+	udelay(10);
+	err = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D);
+	if (err)
+		goto err_clamp;
+
+	udelay(10);
+	reset_control_deassert(gpu->rst);
+
+	return 0;
+
+err_clamp:
+	clk_disable_unprepare(gpu->clk);
+err_clk:
+	regulator_disable(gpu->vdd);
+err_power:
+	return err;
+}
+
+static int nouveau_platform_power_down(struct nouveau_platform_gpu *gpu)
+{
+	int err;
+
+	clk_disable_unprepare(gpu->clk);
+
+	err = regulator_disable(gpu->vdd);
+	if (err)
+		return err;
+
+	return 0;
+}
+
+static int nouveau_platform_probe(struct platform_device *pdev)
+{
+	struct nouveau_platform_gpu *gpu;
+	struct regulator *vdd;
+	struct reset_control *rst;
+	struct clk *clk, *pll;
+	int err;
+
+	/*
+	 * get the resources we need before we allocate the device' memory
+	 * in case we need to return -EPROBE_DEFER
+	 */
+	vdd = devm_regulator_get(&pdev->dev, "vdd");
+	if (IS_ERR(vdd))
+		return PTR_ERR(vdd);
+
+	rst = devm_reset_control_get(&pdev->dev, "gpu");
+	if (IS_ERR(rst))
+		return PTR_ERR(rst);
+
+	clk = devm_clk_get(&pdev->dev, "gpu");
+	if (IS_ERR(clk))
+		return PTR_ERR(clk);
+
+	pll = devm_clk_get(&pdev->dev, "pll");
+	if (IS_ERR(pll))
+		return PTR_ERR(pll);
+
+	err = nouveau_drm_platform_device_create(pdev, sizeof(*gpu),
+						 (void **)&gpu);
+	if (err)
+		return err;
+
+	gpu->vdd = vdd;
+	gpu->rst = rst;
+	gpu->clk = clk;
+	gpu->clk_pll = pll;
+
+	err = nouveau_platform_power_up(gpu);
+	if (err)
+		goto err_probe;
+
+	err = nouveau_drm_platform_device_init(pdev);
+	if (err)
+		goto err_probe;
+
+	return 0;
+
+err_probe:
+	nouveau_object_ref(NULL, (struct nouveau_object **)&gpu->device);
+	return err;
+}
+
+static int nouveau_platform_remove(struct platform_device *pdev)
+{
+	struct drm_device *drm_dev = platform_get_drvdata(pdev);
+	struct nouveau_device *device = nouveau_dev(drm_dev);
+	struct nouveau_platform_gpu *gpu = nv_device_to_gpu(device);
+	int err;
+
+	drm_dev->irq_enabled = false;
+	drm_put_dev(drm_dev);
+
+	err = nouveau_platform_power_down(gpu);
+	if (err)
+		return err;
+
+	nouveau_object_ref(NULL, (struct nouveau_object **)&device);
+	nouveau_object_debug();
+
+	return 0;
+}
+
+#if IS_ENABLED(CONFIG_OF)
+static const struct of_device_id nouveau_platform_match[] = {
+	{ .compatible = "nvidia,gk20a" },
+	{ }
+};
+
+MODULE_DEVICE_TABLE(of, nouveau_platform_match);
+#endif
+
+struct platform_driver nouveau_platform_driver = {
+	.driver = {
+		.name = "nouveau",
+		.of_match_table = of_match_ptr(nouveau_platform_match),
+	},
+	.probe = nouveau_platform_probe,
+	.remove = nouveau_platform_remove,
+};
+
+int __init nouveau_platform_driver_init(void)
+{
+	return platform_driver_register(&nouveau_platform_driver);
+}
+
+void __exit nouveau_platform_driver_exit(void)
+{
+	platform_driver_unregister(&nouveau_platform_driver);
+}
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/5] ARM: tegra: of: add GK20A device tree binding
  2014-05-19  9:24 [PATCH 0/5] drm/nouveau: platform devices and GK20A probing Alexandre Courbot
@ 2014-05-19  9:24 ` Alexandre Courbot
  2014-05-19 21:14   ` Stephen Warren
       [not found] ` <1400491450-19223-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  2014-05-19 10:04 ` [PATCH 0/5] drm/nouveau: platform devices and GK20A probing Lucas Stach
  2 siblings, 1 reply; 19+ messages in thread
From: Alexandre Courbot @ 2014-05-19  9:24 UTC (permalink / raw)
  To: Ben Skeggs, Stephen Warren, Thierry Reding
  Cc: gnurou, nouveau, linux-kernel, dri-devel, linux-tegra

Add the device tree binding documentation for the GK20A GPU used in
Tegra K1 SoCs.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 .../devicetree/bindings/gpu/nvidia,gk20a.txt       | 45 ++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpu/nvidia,gk20a.txt

diff --git a/Documentation/devicetree/bindings/gpu/nvidia,gk20a.txt b/Documentation/devicetree/bindings/gpu/nvidia,gk20a.txt
new file mode 100644
index 000000000000..eda04c963af0
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpu/nvidia,gk20a.txt
@@ -0,0 +1,45 @@
+NVIDIA GK20A Graphics Processing Unit
+
+Required properties:
+- compatible: "nvidia,<chip>-<gpu>"
+  Currently recognized values:
+  - nvidia,tegra124-gk20a
+- reg: Physical base address and length of the controller's registers.
+  Must contain two entries:
+  - first entry for bar0
+  - second entry for bar1
+- interrupts: The interrupt outputs from the controller.
+- interrupt-names: Must include the following entries:
+  - stall
+  - nonstall
+- vdd-supply: regulator for supply voltage.
+- clocks: Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+  - gpu
+  - pll
+- resets: Must contain an entry for each entry in reset-names.
+  See ../reset/reset.txt for details.
+- reset-names: Must include the following entries:
+  - gpu
+
+Example:
+
+/ {
+	gpu@0,57000000 {
+		compatible = "nvidia,gk20a";
+		reg = <0x0 0x57000000 0x0 0x01000000>,
+		      <0x0 0x58000000 0x0 0x01000000>;
+		interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "stall", "nonstall";
+		vdd-supply = <&vdd_gpu>;
+		clocks = <&tegra_car TEGRA124_CLK_GPU>,
+			 <&tegra_car TEGRA124_CLK_PLL_P_OUT5>;
+		clock-names = "gpu", "pll";
+		resets = <&tegra_car 184>;
+		reset-names = "gpu";
+		status = "disabled";
+	};
+
+};
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 3/5] ARM: tegra: add GK20A GPU to Tegra124 DT
       [not found] ` <1400491450-19223-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  2014-05-19  9:24   ` [PATCH 1/5] drm/nouveau: support for probing platform devices Alexandre Courbot
@ 2014-05-19  9:24   ` Alexandre Courbot
  2014-05-19 21:16     ` Stephen Warren
  2014-05-19  9:24   ` [PATCH 4/5] ARM: tegra: venice2: enable GK20A GPU Alexandre Courbot
  2014-05-19  9:24   ` [PATCH 5/5] ARM: tegra: jetson-tk1: " Alexandre Courbot
  3 siblings, 1 reply; 19+ messages in thread
From: Alexandre Courbot @ 2014-05-19  9:24 UTC (permalink / raw)
  To: Ben Skeggs, Stephen Warren, Thierry Reding
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Thierry Reding

From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Add the GK20A device node to Tegra124's device tree.

Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 arch/arm/boot/dts/tegra124.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi
index 6e6bc4e8185c..0bccd6af81d6 100644
--- a/arch/arm/boot/dts/tegra124.dtsi
+++ b/arch/arm/boot/dts/tegra124.dtsi
@@ -102,6 +102,21 @@
 			(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
 	};
 
+	gpu@0,57000000 {
+		compatible = "nvidia,gk20a";
+		reg = <0x0 0x57000000 0x0 0x01000000>,
+		      <0x0 0x58000000 0x0 0x01000000>;
+		interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "stall", "nonstall";
+		clocks = <&tegra_car TEGRA124_CLK_GPU>,
+			 <&tegra_car TEGRA124_CLK_PLL_P_OUT5>;
+		clock-names = "gpu", "pll";
+		resets = <&tegra_car 184>;
+		reset-names = "gpu";
+		status = "disabled";
+	};
+
 	timer@0,60005000 {
 		compatible = "nvidia,tegra124-timer", "nvidia,tegra20-timer";
 		reg = <0x0 0x60005000 0x0 0x400>;
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 4/5] ARM: tegra: venice2: enable GK20A GPU
       [not found] ` <1400491450-19223-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  2014-05-19  9:24   ` [PATCH 1/5] drm/nouveau: support for probing platform devices Alexandre Courbot
  2014-05-19  9:24   ` [PATCH 3/5] ARM: tegra: add GK20A GPU to Tegra124 DT Alexandre Courbot
@ 2014-05-19  9:24   ` Alexandre Courbot
  2014-05-19  9:24   ` [PATCH 5/5] ARM: tegra: jetson-tk1: " Alexandre Courbot
  3 siblings, 0 replies; 19+ messages in thread
From: Alexandre Courbot @ 2014-05-19  9:24 UTC (permalink / raw)
  To: Ben Skeggs, Stephen Warren, Thierry Reding
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Thierry Reding

From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 arch/arm/boot/dts/tegra124-venice2.dts | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/tegra124-venice2.dts b/arch/arm/boot/dts/tegra124-venice2.dts
index f0bb84244025..86970ee48707 100644
--- a/arch/arm/boot/dts/tegra124-venice2.dts
+++ b/arch/arm/boot/dts/tegra124-venice2.dts
@@ -42,6 +42,12 @@
 		};
 	};
 
+	gpu@0,57000000 {
+		status = "okay";
+
+		vdd-supply = <&vdd_gpu>;
+	};
+
 	pinmux: pinmux@0,70000868 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinmux_default>;
@@ -726,7 +732,7 @@
 					regulator-always-on;
 				};
 
-				sd6 {
+				vdd_gpu: sd6 {
 					regulator-name = "+VDD_GPU_AP";
 					regulator-min-microvolt = <650000>;
 					regulator-max-microvolt = <1200000>;
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 5/5] ARM: tegra: jetson-tk1: enable GK20A GPU
       [not found] ` <1400491450-19223-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
                     ` (2 preceding siblings ...)
  2014-05-19  9:24   ` [PATCH 4/5] ARM: tegra: venice2: enable GK20A GPU Alexandre Courbot
@ 2014-05-19  9:24   ` Alexandre Courbot
       [not found]     ` <1400491450-19223-6-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  3 siblings, 1 reply; 19+ messages in thread
From: Alexandre Courbot @ 2014-05-19  9:24 UTC (permalink / raw)
  To: Ben Skeggs, Stephen Warren, Thierry Reding
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

Signed-off-by: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 arch/arm/boot/dts/tegra124-jetson-tk1.dts | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/tegra124-jetson-tk1.dts b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
index e31fb61a81d3..15a194d1277f 100644
--- a/arch/arm/boot/dts/tegra124-jetson-tk1.dts
+++ b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
@@ -30,6 +30,12 @@
 		};
 	};
 
+	gpu@0,57000000 {
+		status = "okay";
+
+		vdd-supply = <&vdd_gpu>;
+	};
+
 	pinmux: pinmux@0,70000868 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&state_default>;
@@ -1505,7 +1511,7 @@
 					regulator-always-on;
 				};
 
-				sd6 {
+				vdd_gpu: sd6 {
 					regulator-name = "+VDD_GPU_AP";
 					regulator-min-microvolt = <650000>;
 					regulator-max-microvolt = <1200000>;
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/5] drm/nouveau: platform devices and GK20A probing
  2014-05-19  9:24 [PATCH 0/5] drm/nouveau: platform devices and GK20A probing Alexandre Courbot
  2014-05-19  9:24 ` [PATCH 2/5] ARM: tegra: of: add GK20A device tree binding Alexandre Courbot
       [not found] ` <1400491450-19223-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2014-05-19 10:04 ` Lucas Stach
       [not found]   ` <1400493868.8467.26.camel-WzVe3FnzCwFR6QfukMTsflXZhhPuCNm+@public.gmane.org>
  2 siblings, 1 reply; 19+ messages in thread
From: Lucas Stach @ 2014-05-19 10:04 UTC (permalink / raw)
  To: Alexandre Courbot
  Cc: gnurou, Stephen Warren, nouveau, linux-kernel, dri-devel,
	Ben Skeggs, linux-tegra

Am Montag, den 19.05.2014, 18:24 +0900 schrieb Alexandre Courbot:
> This patch series is the final (?) step towards the initial support of GK20A,
> allowing it to be probed and used (currently at a very slow speed, and for
> offscreen rendering only) on the Jetson TK1 and Venice 2 boards.
> 
This seem to still need external firmware. Any chance to get this into
linux-firmware?

Regards,
Lucas
> The main piece if the first patch which adds platform devices probing support
> to Nouveau. There are probably lots of things that need to be discussed about
> it, e.g.:
> 
> * The way the DRM device is created, especially with respect to the ongoing
>   changes to the DRM framework,
> * The fact that the same drm_driver instance is used for the PCI and platform
>   drivers,
> * Whether we should have only one platform driver capable of probing all
>   platform devices, or one driver per GPU (in this case, where should all these
>   drivers reside?)
> 
> So there are still some rough edges, but we are getting there. :)
> 
> The first patch should go through the Nouveau tree, while the 4 others are
> rather intended for Tegra.
> 
> Alexandre Courbot (3):
>   drm/nouveau: support for probing platform devices
>   ARM: tegra: of: add GK20A device tree binding
>   ARM: tegra: jetson-tk1: enable GK20A GPU
> 
> Thierry Reding (2):
>   ARM: tegra: add GK20A GPU to Tegra124 DT
>   ARM: tegra: venice2: enable GK20A GPU
> 
>  .../devicetree/bindings/gpu/nvidia,gk20a.txt       |  45 +++++
>  arch/arm/boot/dts/tegra124-jetson-tk1.dts          |   8 +-
>  arch/arm/boot/dts/tegra124-venice2.dts             |   8 +-
>  arch/arm/boot/dts/tegra124.dtsi                    |  15 ++
>  drivers/gpu/drm/nouveau/Kconfig                    |   8 +
>  drivers/gpu/drm/nouveau/Makefile                   |   3 +
>  drivers/gpu/drm/nouveau/nouveau_drm.c              |  33 ++--
>  drivers/gpu/drm/nouveau/nouveau_drm.h              |  21 +++
>  drivers/gpu/drm/nouveau/nouveau_platform.c         | 191 +++++++++++++++++++++
>  9 files changed, 315 insertions(+), 17 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/gpu/nvidia,gk20a.txt
>  create mode 100644 drivers/gpu/drm/nouveau/nouveau_platform.c
> 

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/5] drm/nouveau: platform devices and GK20A probing
       [not found]   ` <1400493868.8467.26.camel-WzVe3FnzCwFR6QfukMTsflXZhhPuCNm+@public.gmane.org>
@ 2014-05-19 10:06     ` Thierry Reding
  0 siblings, 0 replies; 19+ messages in thread
From: Thierry Reding @ 2014-05-19 10:06 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Stephen Warren, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Ben Skeggs,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA


[-- Attachment #1.1: Type: text/plain, Size: 614 bytes --]

On Mon, May 19, 2014 at 12:04:28PM +0200, Lucas Stach wrote:
> Am Montag, den 19.05.2014, 18:24 +0900 schrieb Alexandre Courbot:
> > This patch series is the final (?) step towards the initial support of GK20A,
> > allowing it to be probed and used (currently at a very slow speed, and for
> > offscreen rendering only) on the Jetson TK1 and Venice 2 boards.
> > 
> This seem to still need external firmware. Any chance to get this into
> linux-firmware?

I think that should be possible. There didn't seem to be any objections
last time I asked but let me clarify again and get back to you.

Thierry

[-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 181 bytes --]

_______________________________________________
Nouveau mailing list
Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/5] ARM: tegra: of: add GK20A device tree binding
  2014-05-19  9:24 ` [PATCH 2/5] ARM: tegra: of: add GK20A device tree binding Alexandre Courbot
@ 2014-05-19 21:14   ` Stephen Warren
       [not found]     ` <537A7450.5030904-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 19+ messages in thread
From: Stephen Warren @ 2014-05-19 21:14 UTC (permalink / raw)
  To: Alexandre Courbot, Ben Skeggs, Thierry Reding
  Cc: linux-tegra, nouveau, linux-kernel, dri-devel, gnurou

On 05/19/2014 03:24 AM, Alexandre Courbot wrote:
> Add the device tree binding documentation for the GK20A GPU used in
> Tegra K1 SoCs.

A few minor nits, but otherwise,
Acked-by: Stephen Warren <swarren@nvidia.com>

> diff --git a/Documentation/devicetree/bindings/gpu/nvidia,gk20a.txt b/Documentation/devicetree/bindings/gpu/nvidia,gk20a.txt

> +Required properties:
> +- compatible: "nvidia,<chip>-<gpu>"
> +  Currently recognized values:
> +  - nvidia,tegra124-gk20a
> +- reg: Physical base address and length of the controller's registers.
> +  Must contain two entries:
> +  - first entry for bar0
> +  - second entry for bar1
> +- interrupts: The interrupt outputs from the controller.

To be consistent with the clocks and resets properties, it'd be nice to
reword that as:

interrupts: Must contain an entry for each entry in interrupt-names.

> +- interrupt-names: Must include the following entries:

... and add the following here:

See ../interrupt-controller/interrupts.txt

> +/ {

No need to wrap a root node around this in the example.

> +	gpu@0,57000000 {
...
> +	};
> +

Extra blank line here.

> +};

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/5] ARM: tegra: add GK20A GPU to Tegra124 DT
  2014-05-19  9:24   ` [PATCH 3/5] ARM: tegra: add GK20A GPU to Tegra124 DT Alexandre Courbot
@ 2014-05-19 21:16     ` Stephen Warren
  0 siblings, 0 replies; 19+ messages in thread
From: Stephen Warren @ 2014-05-19 21:16 UTC (permalink / raw)
  To: Alexandre Courbot, Ben Skeggs, Thierry Reding
  Cc: gnurou, nouveau, linux-kernel, dri-devel, linux-tegra,
	Thierry Reding

On 05/19/2014 03:24 AM, Alexandre Courbot wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Add the GK20A device node to Tegra124's device tree.

At a quick glance, patches 3-5 look fine too. I'll hold off on applying
them until patches 1-2 have been applied to the DRM/... tree.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/5] ARM: tegra: of: add GK20A device tree binding
       [not found]     ` <537A7450.5030904-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2014-05-23  7:13       ` Alexandre Courbot
  0 siblings, 0 replies; 19+ messages in thread
From: Alexandre Courbot @ 2014-05-23  7:13 UTC (permalink / raw)
  To: Stephen Warren
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Linux Kernel Mailing List,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Ben Skeggs, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Tue, May 20, 2014 at 6:14 AM, Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> wrote:
> On 05/19/2014 03:24 AM, Alexandre Courbot wrote:
>> Add the device tree binding documentation for the GK20A GPU used in
>> Tegra K1 SoCs.
>
> A few minor nits, but otherwise,
> Acked-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
>> diff --git a/Documentation/devicetree/bindings/gpu/nvidia,gk20a.txt b/Documentation/devicetree/bindings/gpu/nvidia,gk20a.txt
>
>> +Required properties:
>> +- compatible: "nvidia,<chip>-<gpu>"
>> +  Currently recognized values:
>> +  - nvidia,tegra124-gk20a
>> +- reg: Physical base address and length of the controller's registers.
>> +  Must contain two entries:
>> +  - first entry for bar0
>> +  - second entry for bar1
>> +- interrupts: The interrupt outputs from the controller.
>
> To be consistent with the clocks and resets properties, it'd be nice to
> reword that as:
>
> interrupts: Must contain an entry for each entry in interrupt-names.
>
>> +- interrupt-names: Must include the following entries:
>
> ... and add the following here:
>
> See ../interrupt-controller/interrupts.txt
>
>> +/ {
>
> No need to wrap a root node around this in the example.
>
>> +     gpu@0,57000000 {
> ...
>> +     };
>> +
>
> Extra blank line here.
>
>> +};
>

All fixed and acked-by added to the commit log.

Thanks,
Alex.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [5/5] ARM: tegra: jetson-tk1: enable GK20A GPU
       [not found]     ` <1400491450-19223-6-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2014-09-25 13:27       ` Sjoerd Simons
  2014-09-25 15:48         ` Stephen Warren
  0 siblings, 1 reply; 19+ messages in thread
From: Sjoerd Simons @ 2014-09-25 13:27 UTC (permalink / raw)
  To: Alexandre Courbot
  Cc: Ben Skeggs, Stephen Warren, Thierry Reding,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	gnurou-Re5JQEeQqe8AvxtiuMwx3w

Playing a bit with todays linux-next on my jetson, it seems this patch is
still required for enabling the GPU. Is there anything blocking it (firmware
not available yet in liux-firmware?)

On Mon, May 19, 2014 at 06:24:10PM +0900, Alexandre Courbot wrote:
> Signed-off-by: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
>  arch/arm/boot/dts/tegra124-jetson-tk1.dts | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/tegra124-jetson-tk1.dts b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
> index e31fb61a81d3..15a194d1277f 100644
> --- a/arch/arm/boot/dts/tegra124-jetson-tk1.dts
> +++ b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
> @@ -30,6 +30,12 @@
>  		};
>  	};
>  
> +	gpu@0,57000000 {
> +		status = "okay";
> +
> +		vdd-supply = <&vdd_gpu>;
> +	};
> +
>  	pinmux: pinmux@0,70000868 {
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&state_default>;
> @@ -1505,7 +1511,7 @@
>  					regulator-always-on;
>  				};
>  
> -				sd6 {
> +				vdd_gpu: sd6 {
>  					regulator-name = "+VDD_GPU_AP";
>  					regulator-min-microvolt = <650000>;
>  					regulator-max-microvolt = <1200000>;

-- 
If you put it off long enough, it might go away.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [5/5] ARM: tegra: jetson-tk1: enable GK20A GPU
  2014-09-25 13:27       ` [5/5] " Sjoerd Simons
@ 2014-09-25 15:48         ` Stephen Warren
  2014-09-25 16:41           ` Thierry Reding
       [not found]           ` <54243931.6050804-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 2 replies; 19+ messages in thread
From: Stephen Warren @ 2014-09-25 15:48 UTC (permalink / raw)
  To: Sjoerd Simons, Alexandre Courbot
  Cc: Ben Skeggs, Thierry Reding, nouveau, dri-devel, linux-tegra,
	linux-kernel, gnurou

On 09/25/2014 07:27 AM, Sjoerd Simons wrote:
> Playing a bit with todays linux-next on my jetson, it seems this patch is
> still required for enabling the GPU. Is there anything blocking it (firmware
> not available yet in liux-firmware?)

I think initially I was waiting for the DRM patch "drm/nouvea: support 
for probing platform devices" to be applied, but it looks like that's 
been applied already, so only patches 4 and 5 in this series are still 
outstanding.

Alex, wasn't there also some issue where the VPR register had to be 
programmed, and if it wasn't there'd be a hang when the GPU registers 
were touched? If we've added code to Nouveau/tegradrm to detect that and 
avoid the problem, then I guess we can commit these last two patches for 
3.19. A resend after the 3.18 merge window might help.

> On Mon, May 19, 2014 at 06:24:10PM +0900, Alexandre Courbot wrote:
>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
>> ---
>>   arch/arm/boot/dts/tegra124-jetson-tk1.dts | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/boot/dts/tegra124-jetson-tk1.dts b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
>> index e31fb61a81d3..15a194d1277f 100644
>> --- a/arch/arm/boot/dts/tegra124-jetson-tk1.dts
>> +++ b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
>> @@ -30,6 +30,12 @@
>>   		};
>>   	};
>>
>> +	gpu@0,57000000 {
>> +		status = "okay";
>> +
>> +		vdd-supply = <&vdd_gpu>;
>> +	};
>> +
>>   	pinmux: pinmux@0,70000868 {
>>   		pinctrl-names = "default";
>>   		pinctrl-0 = <&state_default>;
>> @@ -1505,7 +1511,7 @@
>>   					regulator-always-on;
>>   				};
>>
>> -				sd6 {
>> +				vdd_gpu: sd6 {
>>   					regulator-name = "+VDD_GPU_AP";
>>   					regulator-min-microvolt = <650000>;
>>   					regulator-max-microvolt = <1200000>;
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [5/5] ARM: tegra: jetson-tk1: enable GK20A GPU
  2014-09-25 15:48         ` Stephen Warren
@ 2014-09-25 16:41           ` Thierry Reding
  2014-09-25 18:07             ` Stephen Warren
  2014-09-25 18:10             ` Sjoerd Simons
       [not found]           ` <54243931.6050804-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  1 sibling, 2 replies; 19+ messages in thread
From: Thierry Reding @ 2014-09-25 16:41 UTC (permalink / raw)
  To: Stephen Warren
  Cc: gnurou, Sjoerd Simons, nouveau, linux-kernel, dri-devel,
	Ben Skeggs, linux-tegra


[-- Attachment #1.1: Type: text/plain, Size: 1462 bytes --]

On Thu, Sep 25, 2014 at 09:48:01AM -0600, Stephen Warren wrote:
> On 09/25/2014 07:27 AM, Sjoerd Simons wrote:
> >Playing a bit with todays linux-next on my jetson, it seems this patch is
> >still required for enabling the GPU. Is there anything blocking it (firmware
> >not available yet in liux-firmware?)
> 
> I think initially I was waiting for the DRM patch "drm/nouvea: support for
> probing platform devices" to be applied, but it looks like that's been
> applied already, so only patches 4 and 5 in this series are still
> outstanding.
> 
> Alex, wasn't there also some issue where the VPR register had to be
> programmed, and if it wasn't there'd be a hang when the GPU registers were
> touched? If we've added code to Nouveau/tegradrm to detect that and avoid
> the problem, then I guess we can commit these last two patches for 3.19. A
> resend after the 3.18 merge window might help.

A patch that programs VPR was merged into U-Boot (though I don't think
it's made it into master yet). I'm not sure we can reasonably check for
that in Nouveau, given that the register is somewhere completely
unrelated. In fact I think the U-Boot patch was triggered by some
discussion about how to solve this and it was decided that it shouldn't
be done in the kernel, but U-Boot should set it up.

That said, perhaps one solution would be to make U-Boot enable the gk20a
device if it's set up the VPR and disable it otherwise?

Thierry

[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 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] 19+ messages in thread

* Re: [5/5] ARM: tegra: jetson-tk1: enable GK20A GPU
  2014-09-25 16:41           ` Thierry Reding
@ 2014-09-25 18:07             ` Stephen Warren
       [not found]               ` <542459C5.9060505-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  2014-09-25 18:10             ` Sjoerd Simons
  1 sibling, 1 reply; 19+ messages in thread
From: Stephen Warren @ 2014-09-25 18:07 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Sjoerd Simons, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Ben Skeggs,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

On 09/25/2014 10:41 AM, Thierry Reding wrote:
> On Thu, Sep 25, 2014 at 09:48:01AM -0600, Stephen Warren wrote:
>> On 09/25/2014 07:27 AM, Sjoerd Simons wrote:
>>> Playing a bit with todays linux-next on my jetson, it seems this patch is
>>> still required for enabling the GPU. Is there anything blocking it (firmware
>>> not available yet in liux-firmware?)
>>
>> I think initially I was waiting for the DRM patch "drm/nouvea: support for
>> probing platform devices" to be applied, but it looks like that's been
>> applied already, so only patches 4 and 5 in this series are still
>> outstanding.
>>
>> Alex, wasn't there also some issue where the VPR register had to be
>> programmed, and if it wasn't there'd be a hang when the GPU registers were
>> touched? If we've added code to Nouveau/tegradrm to detect that and avoid
>> the problem, then I guess we can commit these last two patches for 3.19. A
>> resend after the 3.18 merge window might help.
>
> A patch that programs VPR was merged into U-Boot (though I don't think
> it's made it into master yet). I'm not sure we can reasonably check for
> that in Nouveau, given that the register is somewhere completely
> unrelated. In fact I think the U-Boot patch was triggered by some
> discussion about how to solve this and it was decided that it shouldn't
> be done in the kernel, but U-Boot should set it up.
>
> That said, perhaps one solution would be to make U-Boot enable the gk20a
> device if it's set up the VPR and disable it otherwise?

For that to work, we'd need the DT to say status="disabled" by default 
for the GPU, and for the fixed U-Boot (and indeed every other 
bootloader...) to enable the GPU node. This would allow people with old 
versions of U-Boot (or other bootloaders) to continue to boot. This 
means bootloaders would only have to set status="okay", but never have 
to set status="disabled", which at least simplifies them a tiny bit.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [5/5] ARM: tegra: jetson-tk1: enable GK20A GPU
  2014-09-25 16:41           ` Thierry Reding
  2014-09-25 18:07             ` Stephen Warren
@ 2014-09-25 18:10             ` Sjoerd Simons
  2014-09-26 10:01               ` Thierry Reding
  1 sibling, 1 reply; 19+ messages in thread
From: Sjoerd Simons @ 2014-09-25 18:10 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Stephen Warren, Alexandre Courbot, Ben Skeggs,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	gnurou-Re5JQEeQqe8AvxtiuMwx3w

On Thu, 2014-09-25 at 18:41 +0200, Thierry Reding wrote:
> On Thu, Sep 25, 2014 at 09:48:01AM -0600, Stephen Warren wrote:
> > On 09/25/2014 07:27 AM, Sjoerd Simons wrote:
> > >Playing a bit with todays linux-next on my jetson, it seems this patch is
> > >still required for enabling the GPU. Is there anything blocking it (firmware
> > >not available yet in liux-firmware?)
> > 
> > I think initially I was waiting for the DRM patch "drm/nouvea: support for
> > probing platform devices" to be applied, but it looks like that's been
> > applied already, so only patches 4 and 5 in this series are still
> > outstanding.
> > 
> > Alex, wasn't there also some issue where the VPR register had to be
> > programmed, and if it wasn't there'd be a hang when the GPU registers were
> > touched? If we've added code to Nouveau/tegradrm to detect that and avoid
> > the problem, then I guess we can commit these last two patches for 3.19. A
> > resend after the 3.18 merge window might help.
> 
> A patch that programs VPR was merged into U-Boot (though I don't think
> it's made it into master yet).

Assuming you're talking about "ARM: tegra: Disable VPR",that has landed
in u-boot master and released as part of v2014.10-rc2 [0]

>  I'm not sure we can reasonably check for
> that in Nouveau, given that the register is somewhere completely
> unrelated. In fact I think the U-Boot patch was triggered by some
> discussion about how to solve this and it was decided that it shouldn't
> be done in the kernel, but U-Boot should set it up.
> 
> That said, perhaps one solution would be to make U-Boot enable the gk20a
> device if it's set up the VPR and disable it otherwise?

I guess in that case the vdd-supply should still be added to the dts
with u-boot toggling the status field of the node?


0: http://git.denx.de/?p=u-boot.git;a=commit;h=df3443dfa449ad02bef8ddf6e2c90a6fd9394fc9
-- 
Sjoerd Simons <sjoerd-FGvqe4uplSY@public.gmane.org>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [5/5] ARM: tegra: jetson-tk1: enable GK20A GPU
       [not found]           ` <54243931.6050804-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2014-09-26  4:44             ` Alexandre Courbot
  0 siblings, 0 replies; 19+ messages in thread
From: Alexandre Courbot @ 2014-09-26  4:44 UTC (permalink / raw)
  To: Stephen Warren, Sjoerd Simons
  Cc: Ben Skeggs, Thierry Reding,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	gnurou-Re5JQEeQqe8AvxtiuMwx3w

On 09/26/2014 12:48 AM, Stephen Warren wrote:
> On 09/25/2014 07:27 AM, Sjoerd Simons wrote:
>> Playing a bit with todays linux-next on my jetson, it seems this patch is
>> still required for enabling the GPU. Is there anything blocking it
>> (firmware
>> not available yet in liux-firmware?)
>
> I think initially I was waiting for the DRM patch "drm/nouvea: support
> for probing platform devices" to be applied, but it looks like that's
> been applied already, so only patches 4 and 5 in this series are still
> outstanding.

Actually I am waiting for the firmware and firmware loading support 
patch to land in linux-firmware and Nouveau respectively. I have yet to 
send these patches publicly due to some ongoing discussion about the 
firmware's license.

For now if you want to run Nouveau on TK1, the easiest solution is to 
use my kernel and Nouveau branches. The branches that should be used are 
visible in the manifest of 
https://github.com/Gnurou/tegra-nouveau-rootfs - which BTW also provides 
an easy way to enable the FOSS graphics stack on a L4T image (minus the 
firmware at the moment).

More generally speaking, I still have a lot of patches to upstream - I 
apologize for not having been able to catch up with them. Things have 
been busy on other fronts, but since these other fronts are soon not 
going to be a concern anymore I will be able to focus on Nouveau again 
after mid-next week. :)

>
> Alex, wasn't there also some issue where the VPR register had to be
> programmed, and if it wasn't there'd be a hang when the GPU registers
> were touched? If we've added code to Nouveau/tegradrm to detect that and
> avoid the problem, then I guess we can commit these last two patches for
> 3.19. A resend after the 3.18 merge window might help.

The VPR patch has landed in U-boot mainline, so this should be less of a 
problem now. AFAIK there is no safe way to check whether VPR has been 
disabled, but the solution might be in your suggestion to make the 
bootloader enable the GPU DT node if it finds it safe to do so.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [5/5] ARM: tegra: jetson-tk1: enable GK20A GPU
       [not found]               ` <542459C5.9060505-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2014-09-26  9:59                 ` Thierry Reding
  0 siblings, 0 replies; 19+ messages in thread
From: Thierry Reding @ 2014-09-26  9:59 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Sjoerd Simons, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Ben Skeggs,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA


[-- Attachment #1.1: Type: text/plain, Size: 2328 bytes --]

On Thu, Sep 25, 2014 at 12:07:01PM -0600, Stephen Warren wrote:
> On 09/25/2014 10:41 AM, Thierry Reding wrote:
> >On Thu, Sep 25, 2014 at 09:48:01AM -0600, Stephen Warren wrote:
> >>On 09/25/2014 07:27 AM, Sjoerd Simons wrote:
> >>>Playing a bit with todays linux-next on my jetson, it seems this patch is
> >>>still required for enabling the GPU. Is there anything blocking it (firmware
> >>>not available yet in liux-firmware?)
> >>
> >>I think initially I was waiting for the DRM patch "drm/nouvea: support for
> >>probing platform devices" to be applied, but it looks like that's been
> >>applied already, so only patches 4 and 5 in this series are still
> >>outstanding.
> >>
> >>Alex, wasn't there also some issue where the VPR register had to be
> >>programmed, and if it wasn't there'd be a hang when the GPU registers were
> >>touched? If we've added code to Nouveau/tegradrm to detect that and avoid
> >>the problem, then I guess we can commit these last two patches for 3.19. A
> >>resend after the 3.18 merge window might help.
> >
> >A patch that programs VPR was merged into U-Boot (though I don't think
> >it's made it into master yet). I'm not sure we can reasonably check for
> >that in Nouveau, given that the register is somewhere completely
> >unrelated. In fact I think the U-Boot patch was triggered by some
> >discussion about how to solve this and it was decided that it shouldn't
> >be done in the kernel, but U-Boot should set it up.
> >
> >That said, perhaps one solution would be to make U-Boot enable the gk20a
> >device if it's set up the VPR and disable it otherwise?
> 
> For that to work, we'd need the DT to say status="disabled" by default for
> the GPU, and for the fixed U-Boot (and indeed every other bootloader...) to
> enable the GPU node. This would allow people with old versions of U-Boot (or
> other bootloaders) to continue to boot. This means bootloaders would only
> have to set status="okay", but never have to set status="disabled", which at
> least simplifies them a tiny bit.

Sounds like a reasonable requirement on bootloaders to me. If it's clear
that the device will not work without an initialized VPR region, part of
the "boot protocol" should be for the bootloader to tell the kernel when
it's safe to enable the GPU.

Thierry

[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 181 bytes --]

_______________________________________________
Nouveau mailing list
Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [5/5] ARM: tegra: jetson-tk1: enable GK20A GPU
  2014-09-25 18:10             ` Sjoerd Simons
@ 2014-09-26 10:01               ` Thierry Reding
  0 siblings, 0 replies; 19+ messages in thread
From: Thierry Reding @ 2014-09-26 10:01 UTC (permalink / raw)
  To: Sjoerd Simons
  Cc: gnurou, Stephen Warren, nouveau, linux-kernel, dri-devel,
	Ben Skeggs, linux-tegra


[-- Attachment #1.1: Type: text/plain, Size: 2089 bytes --]

On Thu, Sep 25, 2014 at 08:10:31PM +0200, Sjoerd Simons wrote:
> On Thu, 2014-09-25 at 18:41 +0200, Thierry Reding wrote:
> > On Thu, Sep 25, 2014 at 09:48:01AM -0600, Stephen Warren wrote:
> > > On 09/25/2014 07:27 AM, Sjoerd Simons wrote:
> > > >Playing a bit with todays linux-next on my jetson, it seems this patch is
> > > >still required for enabling the GPU. Is there anything blocking it (firmware
> > > >not available yet in liux-firmware?)
> > > 
> > > I think initially I was waiting for the DRM patch "drm/nouvea: support for
> > > probing platform devices" to be applied, but it looks like that's been
> > > applied already, so only patches 4 and 5 in this series are still
> > > outstanding.
> > > 
> > > Alex, wasn't there also some issue where the VPR register had to be
> > > programmed, and if it wasn't there'd be a hang when the GPU registers were
> > > touched? If we've added code to Nouveau/tegradrm to detect that and avoid
> > > the problem, then I guess we can commit these last two patches for 3.19. A
> > > resend after the 3.18 merge window might help.
> > 
> > A patch that programs VPR was merged into U-Boot (though I don't think
> > it's made it into master yet).
> 
> Assuming you're talking about "ARM: tegra: Disable VPR",that has landed
> in u-boot master and released as part of v2014.10-rc2 [0]

Oh, good.

> >  I'm not sure we can reasonably check for
> > that in Nouveau, given that the register is somewhere completely
> > unrelated. In fact I think the U-Boot patch was triggered by some
> > discussion about how to solve this and it was decided that it shouldn't
> > be done in the kernel, but U-Boot should set it up.
> > 
> > That said, perhaps one solution would be to make U-Boot enable the gk20a
> > device if it's set up the VPR and disable it otherwise?
> 
> I guess in that case the vdd-supply should still be added to the dts
> with u-boot toggling the status field of the node?

Yes, if that's what we decide on then this patch should be modified to
remove the status = "okay" line.

Thierry

[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 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] 19+ messages in thread

end of thread, other threads:[~2014-09-26 10:01 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-19  9:24 [PATCH 0/5] drm/nouveau: platform devices and GK20A probing Alexandre Courbot
2014-05-19  9:24 ` [PATCH 2/5] ARM: tegra: of: add GK20A device tree binding Alexandre Courbot
2014-05-19 21:14   ` Stephen Warren
     [not found]     ` <537A7450.5030904-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-05-23  7:13       ` Alexandre Courbot
     [not found] ` <1400491450-19223-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-05-19  9:24   ` [PATCH 1/5] drm/nouveau: support for probing platform devices Alexandre Courbot
2014-05-19  9:24   ` [PATCH 3/5] ARM: tegra: add GK20A GPU to Tegra124 DT Alexandre Courbot
2014-05-19 21:16     ` Stephen Warren
2014-05-19  9:24   ` [PATCH 4/5] ARM: tegra: venice2: enable GK20A GPU Alexandre Courbot
2014-05-19  9:24   ` [PATCH 5/5] ARM: tegra: jetson-tk1: " Alexandre Courbot
     [not found]     ` <1400491450-19223-6-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-09-25 13:27       ` [5/5] " Sjoerd Simons
2014-09-25 15:48         ` Stephen Warren
2014-09-25 16:41           ` Thierry Reding
2014-09-25 18:07             ` Stephen Warren
     [not found]               ` <542459C5.9060505-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-09-26  9:59                 ` Thierry Reding
2014-09-25 18:10             ` Sjoerd Simons
2014-09-26 10:01               ` Thierry Reding
     [not found]           ` <54243931.6050804-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-09-26  4:44             ` Alexandre Courbot
2014-05-19 10:04 ` [PATCH 0/5] drm/nouveau: platform devices and GK20A probing Lucas Stach
     [not found]   ` <1400493868.8467.26.camel-WzVe3FnzCwFR6QfukMTsflXZhhPuCNm+@public.gmane.org>
2014-05-19 10:06     ` Thierry Reding

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).