Skip to content

Commit 3b5e26c

Browse files
author
Lada Trimasova
committed
Fix problems with PGU when IOC is enabled
These patches fix the problem with blank screen when IOC is enabled: 0010-ARC-support-generic-per-device-coherent-dma-mem.patch 0011-ARC-add-support-for-reserved-memory-defined-by-devic.patch 0012-drm-arcpgu-use-dedicated-memory-area-for-frame-buffe.patch 0013-ARC-axs10x-Specify-reserved-memory-for-frame-buffer.patch Signed-off-by: Lada Trimasova <[email protected]>
1 parent 55b0c88 commit 3b5e26c

4 files changed

+250
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From e6b3f75dcf5c07179ad4c4d79d657dbbfac0f578 Mon Sep 17 00:00:00 2001
2+
From: Alexey Brodkin <[email protected]>
3+
Date: Tue, 26 Apr 2016 17:33:05 +0300
4+
Subject: [PATCH 10/12] ARC: support generic per-device coherent dma mem
5+
6+
Signed-off-by: Alexey Brodkin <[email protected]>
7+
---
8+
arch/arc/Kconfig | 1 +
9+
1 file changed, 1 insertion(+)
10+
11+
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
12+
index c22f5d4..939c93d 100644
13+
--- a/arch/arc/Kconfig
14+
+++ b/arch/arc/Kconfig
15+
@@ -39,6 +39,7 @@ config ARC
16+
select PERF_USE_VMALLOC
17+
select HAVE_DEBUG_STACKOVERFLOW
18+
select HAVE_DMA_ATTRS
19+
+ select HAVE_GENERIC_DMA_COHERENT
20+
21+
config TRACE_IRQFLAGS_SUPPORT
22+
def_bool y
23+
--
24+
2.5.5
25+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
From 9becc4d5045328906fb88dd920581cc66ce0490a Mon Sep 17 00:00:00 2001
2+
From: Alexey Brodkin <[email protected]>
3+
Date: Tue, 26 Apr 2016 17:37:21 +0300
4+
Subject: [PATCH 11/12] ARC: add support for reserved memory defined by device
5+
tree
6+
7+
Enable reserved memory initialization from device tree.
8+
9+
Signed-off-by: Alexey Brodkin <[email protected]>
10+
Cc: Grant Likely <[email protected]>
11+
Cc: Marek Szyprowski <[email protected]>
12+
---
13+
arch/arc/Kconfig | 1 +
14+
arch/arc/mm/init.c | 4 ++++
15+
2 files changed, 5 insertions(+)
16+
17+
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
18+
index 939c93d..fa49cbd 100644
19+
--- a/arch/arc/Kconfig
20+
+++ b/arch/arc/Kconfig
21+
@@ -36,6 +36,7 @@ config ARC
22+
select NO_BOOTMEM
23+
select OF
24+
select OF_EARLY_FLATTREE
25+
+ select OF_RESERVED_MEM
26+
select PERF_USE_VMALLOC
27+
select HAVE_DEBUG_STACKOVERFLOW
28+
select HAVE_DMA_ATTRS
29+
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
30+
index 7d2c4fb..5487d0b 100644
31+
--- a/arch/arc/mm/init.c
32+
+++ b/arch/arc/mm/init.c
33+
@@ -13,6 +13,7 @@
34+
#ifdef CONFIG_BLK_DEV_INITRD
35+
#include <linux/initrd.h>
36+
#endif
37+
+#include <linux/of_fdt.h>
38+
#include <linux/swap.h>
39+
#include <linux/module.h>
40+
#include <linux/highmem.h>
41+
@@ -136,6 +137,9 @@ void __init setup_arch_memory(void)
42+
memblock_reserve(__pa(initrd_start), initrd_end - initrd_start);
43+
#endif
44+
45+
+ early_init_fdt_reserve_self();
46+
+ early_init_fdt_scan_reserved_mem();
47+
+
48+
memblock_dump_all();
49+
50+
/*----------------- node/zones setup --------------------------*/
51+
--
52+
2.5.5
53+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
From a23409b1e0578168573f590bd280fadc0b3dee3f Mon Sep 17 00:00:00 2001
2+
From: Alexey Brodkin <[email protected]>
3+
Date: Wed, 27 Apr 2016 16:02:39 +0300
4+
Subject: [PATCH] drm/arcpgu: use dedicated memory area for frame buffer
5+
6+
Now when ARC supports reserved memory areas and
7+
per-device coherent DMA allocations we may switch ARC PGU
8+
to use of those dedicated areas.
9+
10+
One of the benefits we may move frame-buffer area out
11+
from IO Coherency aperture and so significantly
12+
reduce IOC utilization allowing less demanding
13+
peripherals to use all perks of IOC.
14+
15+
Signed-off-by: Alexey Brodkin <[email protected]>
16+
Cc: Dave Airlie <[email protected]>
17+
Cc: Daniel Vetter <[email protected]>
18+
19+
20+
---
21+
drivers/gpu/drm/arc/arcpgu_drv.c | 6 ++++++
22+
1 file changed, 6 insertions(+)
23+
24+
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
25+
index da61a33..5c64eb1 100644
26+
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
27+
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
28+
@@ -19,6 +19,7 @@
29+
#include <drm/drm_fb_cma_helper.h>
30+
#include <drm/drm_gem_cma_helper.h>
31+
#include <drm/drm_atomic_helper.h>
32+
+#include <linux/of_reserved_mem.h>
33+
34+
#include "arcpgu.h"
35+
#include "arcpgu_regs.h"
36+
@@ -135,6 +136,11 @@ static int arcpgu_load(struct drm_device *drm)
37+
dev_info(drm->dev, "arc_pgu ID: 0x%x\n",
38+
arc_pgu_read(arcpgu, ARCPGU_REG_ID));
39+
40+
+ /* Get the optional framebuffer memory resource */
41+
+ ret = of_reserved_mem_device_init(drm->dev);
42+
+ if (ret && ret != -ENODEV)
43+
+ return ret;
44+
+
45+
if (dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32)))
46+
return -ENODEV;
47+
48+
--
49+
2.5.0
50+
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
From f0402a7b201aae87ae9504defc46e25148664a06 Mon Sep 17 00:00:00 2001
2+
From: Alexey Brodkin <[email protected]>
3+
Date: Wed, 27 Apr 2016 16:59:50 +0300
4+
Subject: [PATCH] ARC: [axs10x] Specify reserved memory for frame buffer
5+
6+
Allocation of a frame buffer memory in a special memory region
7+
allows bypassing of so-called IO Coherency aperture
8+
which is typically set as a range 0x8z-0xAz.
9+
10+
I.e. all data traffic to PGU bypasses IO Coherency block
11+
and saves its bandwidth for other peripherals.
12+
13+
Even though for AXS101 (which sorts ARC770 CPU) IOC is not
14+
an option for a sake of keeping one DT description for the
15+
base-board (axs10x_mb.dtsi) we're still defining reserved
16+
memory location in the very end of DDR.
17+
18+
Signed-off-by: Alexey Brodkin <[email protected]>
19+
Cc: Vineet Gupta <[email protected]>
20+
21+
---
22+
arch/arc/boot/dts/axc001.dtsi | 22 ++++++++++++++++++++--
23+
arch/arc/boot/dts/axc003.dtsi | 14 ++++++++++++++
24+
arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
25+
arch/arc/boot/dts/axs10x_mb.dtsi | 2 +-
26+
4 files changed, 49 insertions(+), 3 deletions(-)
27+
28+
diff --git a/arch/arc/boot/dts/axc001.dtsi b/arch/arc/boot/dts/axc001.dtsi
29+
index 420dcfd..262496a 100644
30+
--- a/arch/arc/boot/dts/axc001.dtsi
31+
+++ b/arch/arc/boot/dts/axc001.dtsi
32+
@@ -93,8 +93,26 @@
33+
memory {
34+
#address-cells = <1>;
35+
#size-cells = <1>;
36+
- ranges = <0x00000000 0x80000000 0x40000000>;
37+
+ ranges = <0x00000000 0x80000000 0x20000000>;
38+
device_type = "memory";
39+
- reg = <0x80000000 0x20000000>; /* 512MiB */
40+
+ reg = <0x80000000 0x1b000000>; /* (512 - 32) MiB */
41+
+ };
42+
+
43+
+ reserved-memory {
44+
+ #address-cells = <1>;
45+
+ #size-cells = <1>;
46+
+ ranges;
47+
+ /*
48+
+ * We just move frame buffer area to the very end of
49+
+ * available DDR. And even though in case of ARC770 there's
50+
+ * no strict requirement for a frame-buffer to be in any
51+
+ * particular location it allows us to use the same
52+
+ * base board's DT node for ARC PGU as for ARc HS38.
53+
+ */
54+
+ frame_buffer: frame_buffer@9e000000 {
55+
+ compatible = "shared-dma-pool";
56+
+ reg = <0x9e000000 0x2000000>;
57+
+ no-map;
58+
+ };
59+
};
60+
};
61+
diff --git a/arch/arc/boot/dts/axc003.dtsi b/arch/arc/boot/dts/axc003.dtsi
62+
index f90fadf..35ece04 100644
63+
--- a/arch/arc/boot/dts/axc003.dtsi
64+
+++ b/arch/arc/boot/dts/axc003.dtsi
65+
@@ -100,4 +100,18 @@
66+
device_type = "memory";
67+
reg = <0x80000000 0x20000000>; /* 512MiB */
68+
};
69+
+
70+
+ reserved-memory {
71+
+ #address-cells = <1>;
72+
+ #size-cells = <1>;
73+
+ ranges;
74+
+ /*
75+
+ * Move frame buffer out of IOC aperture (0x8z-0xAz).
76+
+ */
77+
+ frame_buffer: frame_buffer@be000000 {
78+
+ compatible = "shared-dma-pool";
79+
+ reg = <0xbe000000 0x2000000>;
80+
+ no-map;
81+
+ };
82+
+ };
83+
};
84+
diff --git a/arch/arc/boot/dts/axc003_idu.dtsi b/arch/arc/boot/dts/axc003_idu.dtsi
85+
index 06a9f29..df9ddb6 100644
86+
--- a/arch/arc/boot/dts/axc003_idu.dtsi
87+
+++ b/arch/arc/boot/dts/axc003_idu.dtsi
88+
@@ -123,4 +123,18 @@
89+
device_type = "memory";
90+
reg = <0x80000000 0x20000000>; /* 512MiB */
91+
};
92+
+
93+
+ reserved-memory {
94+
+ #address-cells = <1>;
95+
+ #size-cells = <1>;
96+
+ ranges;
97+
+ /*
98+
+ * Move frame buffer out of IOC aperture (0x8z-0xAz).
99+
+ */
100+
+ frame_buffer: frame_buffer@be000000 {
101+
+ compatible = "shared-dma-pool";
102+
+ reg = <0xbe000000 0x2000000>;
103+
+ no-map;
104+
+ };
105+
+ };
106+
};
107+
diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
108+
index 8fee596..c3ecb5e 100644
109+
--- a/arch/arc/boot/dts/axs10x_mb.dtsi
110+
+++ b/arch/arc/boot/dts/axs10x_mb.dtsi
111+
@@ -275,7 +275,7 @@
112+
encoder-slave = <&adv7511>;
113+
clocks = <&pguclk>;
114+
clock-names = "pxlclk";
115+
-
116+
+ memory-region = <&frame_buffer>;
117+
port {
118+
pgu_output: endpoint {
119+
remote-endpoint = <&adv7511_input>;
120+
--
121+
2.5.0
122+

0 commit comments

Comments
 (0)