All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] drm/panfrost: Misc. fixes and cleanups
@ 2019-05-03 15:31 ` Robin Murphy
  0 siblings, 0 replies; 14+ messages in thread
From: Robin Murphy @ 2019-05-03 15:31 UTC (permalink / raw)
  To: robh, tomeu.vizoso; +Cc: airlied, dri-devel, daniel, linux-arm-kernel

Hi,

These are a few trivial fixes and cleanups from playing with the
panfrost kernel driver on an Arm Juno board. Not that anyone has ever
cared much about the built-in GPU on Juno, but it's at least a somewhat
interesting platform from the kernel driver perspective for having
I/O coherency, RAM above 4GB, and DVFS abstracted behind a firmware
interface.

Robin.


Robin Murphy (4):
  drm/panfrost: Set DMA masks earlier
  drm/panfrost: Disable PM on probe failure
  drm/panfrost: Don't scream about deferred probe
  drm/panfrost: Show stored feature registers

 drivers/gpu/drm/panfrost/panfrost_drv.c | 12 +++++-------
 drivers/gpu/drm/panfrost/panfrost_gpu.c | 19 ++++++++++++-------
 2 files changed, 17 insertions(+), 14 deletions(-)

-- 
2.21.0.dirty


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 0/4] drm/panfrost: Misc. fixes and cleanups
@ 2019-05-03 15:31 ` Robin Murphy
  0 siblings, 0 replies; 14+ messages in thread
From: Robin Murphy @ 2019-05-03 15:31 UTC (permalink / raw)
  To: robh, tomeu.vizoso; +Cc: airlied, dri-devel, daniel, linux-arm-kernel

Hi,

These are a few trivial fixes and cleanups from playing with the
panfrost kernel driver on an Arm Juno board. Not that anyone has ever
cared much about the built-in GPU on Juno, but it's at least a somewhat
interesting platform from the kernel driver perspective for having
I/O coherency, RAM above 4GB, and DVFS abstracted behind a firmware
interface.

Robin.


Robin Murphy (4):
  drm/panfrost: Set DMA masks earlier
  drm/panfrost: Disable PM on probe failure
  drm/panfrost: Don't scream about deferred probe
  drm/panfrost: Show stored feature registers

 drivers/gpu/drm/panfrost/panfrost_drv.c | 12 +++++-------
 drivers/gpu/drm/panfrost/panfrost_gpu.c | 19 ++++++++++++-------
 2 files changed, 17 insertions(+), 14 deletions(-)

-- 
2.21.0.dirty

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

* [PATCH 1/4] drm/panfrost: Set DMA masks earlier
  2019-05-03 15:31 ` Robin Murphy
@ 2019-05-03 15:31   ` Robin Murphy
  -1 siblings, 0 replies; 14+ messages in thread
From: Robin Murphy @ 2019-05-03 15:31 UTC (permalink / raw)
  To: robh, tomeu.vizoso; +Cc: airlied, dri-devel, daniel, linux-arm-kernel

The DMA masks need to be set correctly before any DMA API activity kicks
off, and the current point in panfrost_probe() is way too late in that
regard. since panfrost_mmu_init() has already set up a live address
space and DMA-mapped MMU pagetables. We can't set masks until we've
queried the appropriate value from MMU_FEATURES, but as soon as
reasonably possible after that should suffice.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/gpu/drm/panfrost/panfrost_drv.c | 5 -----
 drivers/gpu/drm/panfrost/panfrost_gpu.c | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index c06af78ab833..af0058ffc1e4 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -3,8 +3,6 @@
 /* Copyright 2019 Linaro, Ltd., Rob Herring <robh@kernel.org> */
 /* Copyright 2019 Collabora ltd. */
 
-#include <linux/bitfield.h>
-#include <linux/dma-mapping.h>
 #include <linux/module.h>
 #include <linux/of_platform.h>
 #include <linux/pagemap.h>
@@ -388,9 +386,6 @@ static int panfrost_probe(struct platform_device *pdev)
 		goto err_out0;
 	}
 
-	dma_set_mask_and_coherent(pfdev->dev,
-		DMA_BIT_MASK(FIELD_GET(0xff00, pfdev->features.mmu_features)));
-
 	err = panfrost_devfreq_init(pfdev);
 	if (err) {
 		dev_err(&pdev->dev, "Fatal error during devfreq init\n");
diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c
index aceaf6e44a09..42511fc1fea0 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
@@ -2,8 +2,10 @@
 /* Copyright 2018 Marty E. Plummer <hanetzer@startmail.com> */
 /* Copyright 2019 Linaro, Ltd., Rob Herring <robh@kernel.org> */
 /* Copyright 2019 Collabora ltd. */
+#include <linux/bitfield.h>
 #include <linux/bitmap.h>
 #include <linux/delay.h>
+#include <linux/dma-mapping.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/iopoll.h>
@@ -332,6 +334,9 @@ int panfrost_gpu_init(struct panfrost_device *pfdev)
 
 	panfrost_gpu_init_features(pfdev);
 
+	dma_set_mask_and_coherent(pfdev->dev,
+		DMA_BIT_MASK(FIELD_GET(0xff00, pfdev->features.mmu_features)));
+
 	irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "gpu");
 	if (irq <= 0)
 		return -ENODEV;
-- 
2.21.0.dirty


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/4] drm/panfrost: Set DMA masks earlier
@ 2019-05-03 15:31   ` Robin Murphy
  0 siblings, 0 replies; 14+ messages in thread
From: Robin Murphy @ 2019-05-03 15:31 UTC (permalink / raw)
  To: robh, tomeu.vizoso; +Cc: airlied, dri-devel, daniel, linux-arm-kernel

The DMA masks need to be set correctly before any DMA API activity kicks
off, and the current point in panfrost_probe() is way too late in that
regard. since panfrost_mmu_init() has already set up a live address
space and DMA-mapped MMU pagetables. We can't set masks until we've
queried the appropriate value from MMU_FEATURES, but as soon as
reasonably possible after that should suffice.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/gpu/drm/panfrost/panfrost_drv.c | 5 -----
 drivers/gpu/drm/panfrost/panfrost_gpu.c | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index c06af78ab833..af0058ffc1e4 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -3,8 +3,6 @@
 /* Copyright 2019 Linaro, Ltd., Rob Herring <robh@kernel.org> */
 /* Copyright 2019 Collabora ltd. */
 
-#include <linux/bitfield.h>
-#include <linux/dma-mapping.h>
 #include <linux/module.h>
 #include <linux/of_platform.h>
 #include <linux/pagemap.h>
@@ -388,9 +386,6 @@ static int panfrost_probe(struct platform_device *pdev)
 		goto err_out0;
 	}
 
-	dma_set_mask_and_coherent(pfdev->dev,
-		DMA_BIT_MASK(FIELD_GET(0xff00, pfdev->features.mmu_features)));
-
 	err = panfrost_devfreq_init(pfdev);
 	if (err) {
 		dev_err(&pdev->dev, "Fatal error during devfreq init\n");
diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c
index aceaf6e44a09..42511fc1fea0 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
@@ -2,8 +2,10 @@
 /* Copyright 2018 Marty E. Plummer <hanetzer@startmail.com> */
 /* Copyright 2019 Linaro, Ltd., Rob Herring <robh@kernel.org> */
 /* Copyright 2019 Collabora ltd. */
+#include <linux/bitfield.h>
 #include <linux/bitmap.h>
 #include <linux/delay.h>
+#include <linux/dma-mapping.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/iopoll.h>
@@ -332,6 +334,9 @@ int panfrost_gpu_init(struct panfrost_device *pfdev)
 
 	panfrost_gpu_init_features(pfdev);
 
+	dma_set_mask_and_coherent(pfdev->dev,
+		DMA_BIT_MASK(FIELD_GET(0xff00, pfdev->features.mmu_features)));
+
 	irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "gpu");
 	if (irq <= 0)
 		return -ENODEV;
-- 
2.21.0.dirty

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

* [PATCH 2/4] drm/panfrost: Disable PM on probe failure
  2019-05-03 15:31 ` Robin Murphy
@ 2019-05-03 15:31   ` Robin Murphy
  -1 siblings, 0 replies; 14+ messages in thread
From: Robin Murphy @ 2019-05-03 15:31 UTC (permalink / raw)
  To: robh, tomeu.vizoso; +Cc: airlied, dri-devel, daniel, linux-arm-kernel

Make sure to disable runtime PM again if probe fails after we've enabled
it. Otherwise, any subsequent attempt to re-probe starts triggering
"Unbalanced pm_runtime_enable!" assertions from the driver core.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/gpu/drm/panfrost/panfrost_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index af0058ffc1e4..a881e2346b55 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -405,6 +405,7 @@ static int panfrost_probe(struct platform_device *pdev)
 err_out1:
 	panfrost_device_fini(pfdev);
 err_out0:
+	pm_runtime_disable(pfdev->dev);
 	drm_dev_put(ddev);
 	return err;
 }
-- 
2.21.0.dirty


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/4] drm/panfrost: Disable PM on probe failure
@ 2019-05-03 15:31   ` Robin Murphy
  0 siblings, 0 replies; 14+ messages in thread
From: Robin Murphy @ 2019-05-03 15:31 UTC (permalink / raw)
  To: robh, tomeu.vizoso; +Cc: airlied, dri-devel, daniel, linux-arm-kernel

Make sure to disable runtime PM again if probe fails after we've enabled
it. Otherwise, any subsequent attempt to re-probe starts triggering
"Unbalanced pm_runtime_enable!" assertions from the driver core.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/gpu/drm/panfrost/panfrost_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index af0058ffc1e4..a881e2346b55 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -405,6 +405,7 @@ static int panfrost_probe(struct platform_device *pdev)
 err_out1:
 	panfrost_device_fini(pfdev);
 err_out0:
+	pm_runtime_disable(pfdev->dev);
 	drm_dev_put(ddev);
 	return err;
 }
-- 
2.21.0.dirty

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

* [PATCH 3/4] drm/panfrost: Don't scream about deferred probe
  2019-05-03 15:31 ` Robin Murphy
@ 2019-05-03 15:31   ` Robin Murphy
  -1 siblings, 0 replies; 14+ messages in thread
From: Robin Murphy @ 2019-05-03 15:31 UTC (permalink / raw)
  To: robh, tomeu.vizoso; +Cc: airlied, dri-devel, daniel, linux-arm-kernel

Probe deferral is far from "fatal".

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/gpu/drm/panfrost/panfrost_drv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index a881e2346b55..4a3fd942ddc6 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -382,13 +382,15 @@ static int panfrost_probe(struct platform_device *pdev)
 
 	err = panfrost_device_init(pfdev);
 	if (err) {
-		dev_err(&pdev->dev, "Fatal error during GPU init\n");
+		if (err != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "Fatal error during GPU init\n");
 		goto err_out0;
 	}
 
 	err = panfrost_devfreq_init(pfdev);
 	if (err) {
-		dev_err(&pdev->dev, "Fatal error during devfreq init\n");
+		if (err != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "Fatal error during devfreq init\n");
 		goto err_out1;
 	}
 
-- 
2.21.0.dirty


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 3/4] drm/panfrost: Don't scream about deferred probe
@ 2019-05-03 15:31   ` Robin Murphy
  0 siblings, 0 replies; 14+ messages in thread
From: Robin Murphy @ 2019-05-03 15:31 UTC (permalink / raw)
  To: robh, tomeu.vizoso; +Cc: airlied, dri-devel, daniel, linux-arm-kernel

Probe deferral is far from "fatal".

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/gpu/drm/panfrost/panfrost_drv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index a881e2346b55..4a3fd942ddc6 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -382,13 +382,15 @@ static int panfrost_probe(struct platform_device *pdev)
 
 	err = panfrost_device_init(pfdev);
 	if (err) {
-		dev_err(&pdev->dev, "Fatal error during GPU init\n");
+		if (err != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "Fatal error during GPU init\n");
 		goto err_out0;
 	}
 
 	err = panfrost_devfreq_init(pfdev);
 	if (err) {
-		dev_err(&pdev->dev, "Fatal error during devfreq init\n");
+		if (err != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "Fatal error during devfreq init\n");
 		goto err_out1;
 	}
 
-- 
2.21.0.dirty

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

* [PATCH 4/4] drm/panfrost: Show stored feature registers
  2019-05-03 15:31 ` Robin Murphy
@ 2019-05-03 15:31   ` Robin Murphy
  -1 siblings, 0 replies; 14+ messages in thread
From: Robin Murphy @ 2019-05-03 15:31 UTC (permalink / raw)
  To: robh, tomeu.vizoso; +Cc: airlied, dri-devel, daniel, linux-arm-kernel

Re-reading the feature registers for the sake of displaying the raw
values seems pointless, and in fact showing the copies that we've
already read and stored is arguably more useful in terms of giving
exposure to any potential bugs in that part of the process.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/gpu/drm/panfrost/panfrost_gpu.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c
index 42511fc1fea0..58ef25573cda 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
@@ -278,13 +278,13 @@ static void panfrost_gpu_init_features(struct panfrost_device *pfdev)
 		 pfdev->features.hw_issues);
 
 	dev_info(pfdev->dev, "Features: L2:0x%08x Shader:0x%08x Tiler:0x%08x Mem:0x%0x MMU:0x%08x AS:0x%x JS:0x%x",
-		 gpu_read(pfdev, GPU_L2_FEATURES),
-		 gpu_read(pfdev, GPU_CORE_FEATURES),
-		 gpu_read(pfdev, GPU_TILER_FEATURES),
-		 gpu_read(pfdev, GPU_MEM_FEATURES),
-		 gpu_read(pfdev, GPU_MMU_FEATURES),
-		 gpu_read(pfdev, GPU_AS_PRESENT),
-		 gpu_read(pfdev, GPU_JS_PRESENT));
+		 pfdev->features.l2_features,
+		 pfdev->features.core_features,
+		 pfdev->features.tiler_features,
+		 pfdev->features.mem_features,
+		 pfdev->features.mmu_features,
+		 pfdev->features.as_present,
+		 pfdev->features.js_present);
 
 	dev_info(pfdev->dev, "shader_present=0x%0llx l2_present=0x%0llx",
 		 pfdev->features.shader_present, pfdev->features.l2_present);
-- 
2.21.0.dirty


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 4/4] drm/panfrost: Show stored feature registers
@ 2019-05-03 15:31   ` Robin Murphy
  0 siblings, 0 replies; 14+ messages in thread
From: Robin Murphy @ 2019-05-03 15:31 UTC (permalink / raw)
  To: robh, tomeu.vizoso; +Cc: airlied, dri-devel, daniel, linux-arm-kernel

Re-reading the feature registers for the sake of displaying the raw
values seems pointless, and in fact showing the copies that we've
already read and stored is arguably more useful in terms of giving
exposure to any potential bugs in that part of the process.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/gpu/drm/panfrost/panfrost_gpu.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c
index 42511fc1fea0..58ef25573cda 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
@@ -278,13 +278,13 @@ static void panfrost_gpu_init_features(struct panfrost_device *pfdev)
 		 pfdev->features.hw_issues);
 
 	dev_info(pfdev->dev, "Features: L2:0x%08x Shader:0x%08x Tiler:0x%08x Mem:0x%0x MMU:0x%08x AS:0x%x JS:0x%x",
-		 gpu_read(pfdev, GPU_L2_FEATURES),
-		 gpu_read(pfdev, GPU_CORE_FEATURES),
-		 gpu_read(pfdev, GPU_TILER_FEATURES),
-		 gpu_read(pfdev, GPU_MEM_FEATURES),
-		 gpu_read(pfdev, GPU_MMU_FEATURES),
-		 gpu_read(pfdev, GPU_AS_PRESENT),
-		 gpu_read(pfdev, GPU_JS_PRESENT));
+		 pfdev->features.l2_features,
+		 pfdev->features.core_features,
+		 pfdev->features.tiler_features,
+		 pfdev->features.mem_features,
+		 pfdev->features.mmu_features,
+		 pfdev->features.as_present,
+		 pfdev->features.js_present);
 
 	dev_info(pfdev->dev, "shader_present=0x%0llx l2_present=0x%0llx",
 		 pfdev->features.shader_present, pfdev->features.l2_present);
-- 
2.21.0.dirty

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

* [RFC 5/4] arm64: dts: juno: add GPU subsystem
  2019-05-03 15:31 ` Robin Murphy
@ 2019-05-03 15:31   ` Robin Murphy
  -1 siblings, 0 replies; 14+ messages in thread
From: Robin Murphy @ 2019-05-03 15:31 UTC (permalink / raw)
  To: robh, tomeu.vizoso; +Cc: airlied, dri-devel, daniel, linux-arm-kernel

Since we now have bindings for Mali Midgard GPUs, let's use them to
describe Juno's GPU subsystem, if only because we can. Juno sports a
Mali-T624 integrated behind an MMU-400 (as a gesture towards
virtualisation), in their own dedicated power domain with DVFS
controlled by the SCP.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---

Just in case anyone else is interested. Note that I've not been using
this exact patch, since my Juno is running the new SCMI-based firmware
which needs not-yet-upstream MHU changes, but this should in theory be
the equivalent change for the upstream SCPI-based DT.

 .../bindings/gpu/arm,mali-midgard.txt         |  1 +
 arch/arm64/boot/dts/arm/juno-base.dtsi        | 25 +++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt
index 18a2cde2e5f3..c17f8e96d1e6 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt
@@ -16,6 +16,7 @@ Required properties:
     + "arm,mali-t880"
   * which must be preceded by one of the following vendor specifics:
     + "amlogic,meson-gxm-mali"
+    + "arm,juno-mali"
     + "rockchip,rk3288-mali"
     + "rockchip,rk3399-mali"
 
diff --git a/arch/arm64/boot/dts/arm/juno-base.dtsi b/arch/arm64/boot/dts/arm/juno-base.dtsi
index 995a7107cdd3..6edaf03620f9 100644
--- a/arch/arm64/boot/dts/arm/juno-base.dtsi
+++ b/arch/arm64/boot/dts/arm/juno-base.dtsi
@@ -35,6 +35,18 @@
 		clock-names = "apb_pclk";
 	};
 
+	smmu_gpu: iommu@2b400000 {
+		compatible = "arm,mmu-400", "arm,smmu-v1";
+		reg = <0x0 0x2b400000 0x0 0x10000>;
+		interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
+		#iommu-cells = <1>;
+		#global-interrupts = <1>;
+		power-domains = <&scpi_devpd 3>;
+		dma-coherent;
+		status = "disabled";
+	};
+
 	smmu_pcie: iommu@2b500000 {
 		compatible = "arm,mmu-401", "arm,smmu-v1";
 		reg = <0x0 0x2b500000 0x0 0x10000>;
@@ -487,6 +499,19 @@
 		};
 	};
 
+	gpu: gpu@2d000000 {
+		compatible = "arm,juno-mali", "arm,mali-t624";
+		reg = <0 0x2d000000 0 0x10000>;
+		interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "gpu", "job", "mmu";
+		clocks = <&scpi_dvfs 2>;
+		power-domains = <&scpi_devpd 3>;
+		dma-coherent;
+		status = "disabled";
+	};
+
 	sram: sram@2e000000 {
 		compatible = "arm,juno-sram-ns", "mmio-sram";
 		reg = <0x0 0x2e000000 0x0 0x8000>;
-- 
2.21.0.dirty


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [RFC 5/4] arm64: dts: juno: add GPU subsystem
@ 2019-05-03 15:31   ` Robin Murphy
  0 siblings, 0 replies; 14+ messages in thread
From: Robin Murphy @ 2019-05-03 15:31 UTC (permalink / raw)
  To: robh, tomeu.vizoso; +Cc: airlied, dri-devel, daniel, linux-arm-kernel

Since we now have bindings for Mali Midgard GPUs, let's use them to
describe Juno's GPU subsystem, if only because we can. Juno sports a
Mali-T624 integrated behind an MMU-400 (as a gesture towards
virtualisation), in their own dedicated power domain with DVFS
controlled by the SCP.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---

Just in case anyone else is interested. Note that I've not been using
this exact patch, since my Juno is running the new SCMI-based firmware
which needs not-yet-upstream MHU changes, but this should in theory be
the equivalent change for the upstream SCPI-based DT.

 .../bindings/gpu/arm,mali-midgard.txt         |  1 +
 arch/arm64/boot/dts/arm/juno-base.dtsi        | 25 +++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt
index 18a2cde2e5f3..c17f8e96d1e6 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt
@@ -16,6 +16,7 @@ Required properties:
     + "arm,mali-t880"
   * which must be preceded by one of the following vendor specifics:
     + "amlogic,meson-gxm-mali"
+    + "arm,juno-mali"
     + "rockchip,rk3288-mali"
     + "rockchip,rk3399-mali"
 
diff --git a/arch/arm64/boot/dts/arm/juno-base.dtsi b/arch/arm64/boot/dts/arm/juno-base.dtsi
index 995a7107cdd3..6edaf03620f9 100644
--- a/arch/arm64/boot/dts/arm/juno-base.dtsi
+++ b/arch/arm64/boot/dts/arm/juno-base.dtsi
@@ -35,6 +35,18 @@
 		clock-names = "apb_pclk";
 	};
 
+	smmu_gpu: iommu@2b400000 {
+		compatible = "arm,mmu-400", "arm,smmu-v1";
+		reg = <0x0 0x2b400000 0x0 0x10000>;
+		interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
+		#iommu-cells = <1>;
+		#global-interrupts = <1>;
+		power-domains = <&scpi_devpd 3>;
+		dma-coherent;
+		status = "disabled";
+	};
+
 	smmu_pcie: iommu@2b500000 {
 		compatible = "arm,mmu-401", "arm,smmu-v1";
 		reg = <0x0 0x2b500000 0x0 0x10000>;
@@ -487,6 +499,19 @@
 		};
 	};
 
+	gpu: gpu@2d000000 {
+		compatible = "arm,juno-mali", "arm,mali-t624";
+		reg = <0 0x2d000000 0 0x10000>;
+		interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "gpu", "job", "mmu";
+		clocks = <&scpi_dvfs 2>;
+		power-domains = <&scpi_devpd 3>;
+		dma-coherent;
+		status = "disabled";
+	};
+
 	sram: sram@2e000000 {
 		compatible = "arm,juno-sram-ns", "mmio-sram";
 		reg = <0x0 0x2e000000 0x0 0x8000>;
-- 
2.21.0.dirty

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

* Re: [PATCH 0/4] drm/panfrost: Misc. fixes and cleanups
  2019-05-03 15:31 ` Robin Murphy
@ 2019-05-03 21:04   ` Rob Herring
  -1 siblings, 0 replies; 14+ messages in thread
From: Rob Herring @ 2019-05-03 21:04 UTC (permalink / raw)
  To: Robin Murphy
  Cc: David Airlie, dri-devel, Daniel Vetter, Tomeu Vizoso,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Fri, May 3, 2019 at 10:31 AM Robin Murphy <robin.murphy@arm.com> wrote:
>
> Hi,
>
> These are a few trivial fixes and cleanups from playing with the
> panfrost kernel driver on an Arm Juno board. Not that anyone has ever
> cared much about the built-in GPU on Juno, but it's at least a somewhat
> interesting platform from the kernel driver perspective for having
> I/O coherency, RAM above 4GB, and DVFS abstracted behind a firmware
> interface.
>
> Robin.
>
>
> Robin Murphy (4):
>   drm/panfrost: Set DMA masks earlier
>   drm/panfrost: Disable PM on probe failure
>   drm/panfrost: Don't scream about deferred probe
>   drm/panfrost: Show stored feature registers
>
>  drivers/gpu/drm/panfrost/panfrost_drv.c | 12 +++++-------
>  drivers/gpu/drm/panfrost/panfrost_gpu.c | 19 ++++++++++++-------
>  2 files changed, 17 insertions(+), 14 deletions(-)

Series applied to drm-misc-next-fixes.

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/4] drm/panfrost: Misc. fixes and cleanups
@ 2019-05-03 21:04   ` Rob Herring
  0 siblings, 0 replies; 14+ messages in thread
From: Rob Herring @ 2019-05-03 21:04 UTC (permalink / raw)
  To: Robin Murphy
  Cc: David Airlie, dri-devel, Tomeu Vizoso,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Fri, May 3, 2019 at 10:31 AM Robin Murphy <robin.murphy@arm.com> wrote:
>
> Hi,
>
> These are a few trivial fixes and cleanups from playing with the
> panfrost kernel driver on an Arm Juno board. Not that anyone has ever
> cared much about the built-in GPU on Juno, but it's at least a somewhat
> interesting platform from the kernel driver perspective for having
> I/O coherency, RAM above 4GB, and DVFS abstracted behind a firmware
> interface.
>
> Robin.
>
>
> Robin Murphy (4):
>   drm/panfrost: Set DMA masks earlier
>   drm/panfrost: Disable PM on probe failure
>   drm/panfrost: Don't scream about deferred probe
>   drm/panfrost: Show stored feature registers
>
>  drivers/gpu/drm/panfrost/panfrost_drv.c | 12 +++++-------
>  drivers/gpu/drm/panfrost/panfrost_gpu.c | 19 ++++++++++++-------
>  2 files changed, 17 insertions(+), 14 deletions(-)

Series applied to drm-misc-next-fixes.

Rob
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2019-05-03 21:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-03 15:31 [PATCH 0/4] drm/panfrost: Misc. fixes and cleanups Robin Murphy
2019-05-03 15:31 ` Robin Murphy
2019-05-03 15:31 ` [PATCH 1/4] drm/panfrost: Set DMA masks earlier Robin Murphy
2019-05-03 15:31   ` Robin Murphy
2019-05-03 15:31 ` [PATCH 2/4] drm/panfrost: Disable PM on probe failure Robin Murphy
2019-05-03 15:31   ` Robin Murphy
2019-05-03 15:31 ` [PATCH 3/4] drm/panfrost: Don't scream about deferred probe Robin Murphy
2019-05-03 15:31   ` Robin Murphy
2019-05-03 15:31 ` [PATCH 4/4] drm/panfrost: Show stored feature registers Robin Murphy
2019-05-03 15:31   ` Robin Murphy
2019-05-03 15:31 ` [RFC 5/4] arm64: dts: juno: add GPU subsystem Robin Murphy
2019-05-03 15:31   ` Robin Murphy
2019-05-03 21:04 ` [PATCH 0/4] drm/panfrost: Misc. fixes and cleanups Rob Herring
2019-05-03 21:04   ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.