In theory the MMSYS device tree identifier is matches twice, by the clk driver
and the DRM subsystem. But the kernel only matches the first driver for a
device (clk) and discards the second one. This breaks graphics on mt8173 and
most probably on mt2701 as well.
MMSYS in Mediatek SoCs has some registers to control clock gates (which is
used in the clk driver) and some registers to enable the differnet blocks of
the display subsystem. The kernel uses the binding to load the central
comoponent of the distplay subsystem, which in place probes all the other
components and enables the present ones in the MMSYS.
We found us with the problem, that we need to change and therefor break one
of the two bindings, or the DRM one or the clock driver one.
Apart from that the DRM subysystem does access the MMSYS registers via relaxed
reads/writes. But the it should to so via regmap, as the registers are shared.
Possible solutions:
1) We add a new mediatek,mt8173-mmsys-clk node, which lives as a simple-mfd
under the actual mmsys node. We change the clock driver to probe on this
binding. This would make sense as the clock gate register live completly in
the MMSYS configuration registers.
2) As the nodes of the DRM subsystem just need some of the registers of MMSYS
we add a new binding mediatek,mt8173-dispsys which probes the central
component of the DRM system. It has only a handle to mt8173-mmsys to access
the registerspace via regmap functions.
In this patchset I implemented 2). Please take into account, that this is a
RFC. I had no time to actually test the verison on real HW. Some of the
register accesses should be done using regmap_update instead of
regmap_read + regmap_write.
This RFC shall only show how solution 2) would look like. We can use it as
discussion to see how we circumvent the actual situation.
The mmsys block is an independent block that probes the
clock driver. The multimedia subsystem therefore does not get
probed. We add a new compatible for the multimedia subsystem.
We pass the mmsys registers via syscon and access them using regmap
instead of relaxed read/write.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 ++--
drivers/gpu/drm/mediatek/mtk_drm_ddp.c | 30 +++++++++++++++++-------------
drivers/gpu/drm/mediatek/mtk_drm_ddp.h | 4 ++--
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 17 ++++++-----------
drivers/gpu/drm/mediatek/mtk_drm_drv.h | 2 +-
5 files changed, 28 insertions(+), 29 deletions(-)
DRM subysystem and clock driver shared the same compatible mmsys.
This stopped does not work, as only the first driver for a compatible
gets probed. We change the comaptible to the new DRM identifier to fix
this.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
arch/arm/boot/dts/mt2701.dtsi | 5 +++++
1 file changed, 5 insertions(+)
DRM subysystem and clock driver shared the same compatible mmsys.
This stopped does not work, as only the first driver for a compatible
gets probed. We change the comaptible to the new DRM identifier to fix
this.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 5 +++++
1 file changed, 5 insertions(+)
DRM subysystem and clock driver shared the same compatible mmsys.
This stopped does not work, as only the first driver for a compatible
gets probed. We change the comaptible to the new DRM identifier to fix
this.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
.../devicetree/bindings/display/mediatek/mediatek,disp.txt | 6 ++++++
1 file changed, 6 insertions(+)
From: Ryder Lee <ryder.lee@mediatek.com> Date: 2017-10-19 12:19:36
Hi Matthias,
Should I base on your changes and resend this patch series
https://patchwork.kernel.org/patch/9980061/ ?
I add a similar node - display_components, but your approach is better
than mine.
Thanks.
On Thu, 2017-10-19 at 13:26 +0200, Matthias Brugger wrote:
quoted hunk
DRM subysystem and clock driver shared the same compatible mmsys.
This stopped does not work, as only the first driver for a compatible
gets probed. We change the comaptible to the new DRM identifier to fix
this.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
.../devicetree/bindings/display/mediatek/mediatek,disp.txt | 6 ++++++
1 file changed, 6 insertions(+)
From: Philipp Zabel <p.zabel@pengutronix.de> Date: 2017-10-19 12:38:30
Hi Matthias,
On Thu, 2017-10-19 at 13:26 +0200, Matthias Brugger wrote:
quoted hunk
DRM subysystem and clock driver shared the same compatible mmsys.
This stopped does not work, as only the first driver for a compatible
gets probed. We change the comaptible to the new DRM identifier to fix
this.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
.../devicetree/bindings/display/mediatek/mediatek,disp.txt | 6 ++++++
1 file changed, 6 insertions(+)
Could we call this node display-subsystem for consistency with i.MX and
Rockchip device trees?
With that change,
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
From: Philipp Zabel <p.zabel@pengutronix.de> Date: 2017-10-19 12:38:47
On Thu, 2017-10-19 at 13:26 +0200, Matthias Brugger wrote:
quoted hunk
DRM subysystem and clock driver shared the same compatible mmsys.
This stopped does not work, as only the first driver for a compatible
gets probed. We change the comaptible to the new DRM identifier to fix
this.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 5 +++++
1 file changed, 5 insertions(+)
Same comment as for patch 1, I'd prefer the node to be called
"display-
subsystem" instead.
With that changed,
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Hi Matthias,
Thank you for the patch.
On Thursday, 19 October 2017 14:26:07 EEST Matthias Brugger wrote:
quoted hunk
DRM subysystem and clock driver shared the same compatible mmsys.
This stopped does not work, as only the first driver for a compatible
gets probed. We change the comaptible to the new DRM identifier to fix
this.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
.../devicetree/bindings/display/mediatek/mediatek,disp.txt | 6 +++
1 file changed, 6 insertions(+)
diff --git
a/Documentation/devicetree/bindings/display/mediatek/mediatek,disp.txt
b/Documentation/devicetree/bindings/display/mediatek/mediatek,disp.txt
index 383183a89164..6db652463e64 100644
Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt.
Required properties (all function blocks):
- compatible: "mediatek,<chip>-disp-<function>", one of
+ "mediatek,<chip>-dispsys" - central component for the DRM system
"mediatek,<chip>-disp-ovl" - overlay (4 layers, blending, csc)
"mediatek,<chip>-disp-rdma" - read DMA / line buffer
"mediatek,<chip>-disp-wdma" - write DMA
So this node doesn't correspond to an IP core but is meant as a top-level
entry point for the operating system. This leads me to three questions.
1. Is there any IP core in the Mediatek display subsystem that could be
considered (or at least used) as a top-level entry point ? That would be my
preferred solution as I'm not fond of DT nodes not describing hardware.
2. If there's no such IP core, are all the display subsystem IP cores grouped
together in one MMIO register range ? If so we could move them as children of
this new display system node which, even if doesn't describe an IP core, would
describe the way the display IP cores are grouped in the hardware, and would
thus be a hardware description.
3. If the answer to the second question is also negative, shouldn't this
display system node reference all other display IP DT nodes (through direct
phandles and/or OF graph bindings) ?
From: Philipp Zabel <p.zabel@pengutronix.de> Date: 2017-10-19 13:02:07
On Thu, 2017-10-19 at 13:26 +0200, Matthias Brugger wrote:
In theory the MMSYS device tree identifier is matches twice, by the clk driver
and the DRM subsystem. But the kernel only matches the first driver for a
device (clk) and discards the second one. This breaks graphics on mt8173 and
most probably on mt2701 as well.
MMSYS in Mediatek SoCs has some registers to control clock gates (which is
used in the clk driver) and some registers to enable the differnet blocks of
the display subsystem. The kernel uses the binding to load the central
comoponent of the distplay subsystem, which in place probes all the other
components and enables the present ones in the MMSYS.
We found us with the problem, that we need to change and therefor break one
of the two bindings, or the DRM one or the clock driver one.
Apart from that the DRM subysystem does access the MMSYS registers via relaxed
reads/writes. But the it should to so via regmap, as the registers are shared.
Possible solutions:
1) We add a new mediatek,mt8173-mmsys-clk node, which lives as a simple-mfd
under the actual mmsys node. We change the clock driver to probe on this
binding. This would make sense as the clock gate register live completly in
the MMSYS configuration registers.
The reason why the drm driver matches against the mmsys node in the
first place is that we wanted to avoid 2).
Also, mmsys is not a pure clock controller, as it also contains the
display path configuration in its register space.
2) As the nodes of the DRM subsystem just need some of the registers of MMSYS
we add a new binding mediatek,mt8173-dispsys which probes the central
component of the DRM system. It has only a handle to mt8173-mmsys to access
the registerspace via regmap functions.
In this patchset I implemented 2). Please take into account, that this is a
RFC. I had no time to actually test the verison on real HW. Some of the
register accesses should be done using regmap_update instead of
regmap_read + regmap_write.
This RFC shall only show how solution 2) would look like. We can use it as
discussion to see how we circumvent the actual situation.
Or we could leave the bindings untouched and create one platform device
from the other or even set up the clocks from the drm driver?
regards
Philipp
From: Philipp Zabel <p.zabel@pengutronix.de> Date: 2017-10-19 13:06:49
On Thu, 2017-10-19 at 15:53 +0300, Laurent Pinchart wrote:
Hi Matthias,
Thank you for the patch.
On Thursday, 19 October 2017 14:26:07 EEST Matthias Brugger wrote:
quoted
DRM subysystem and clock driver shared the same compatible mmsys.
This stopped does not work, as only the first driver for a compatible
gets probed. We change the comaptible to the new DRM identifier to fix
this.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
.../devicetree/bindings/display/mediatek/mediatek,disp.txt | 6 +++
1 file changed, 6 insertions(+)
diff --git
a/Documentation/devicetree/bindings/display/mediatek/mediatek,disp.txt
b/Documentation/devicetree/bindings/display/mediatek/mediatek,disp.txt
index 383183a89164..6db652463e64 100644
Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt.
Required properties (all function blocks):
- compatible: "mediatek,<chip>-disp-<function>", one of
+ "mediatek,<chip>-dispsys" - central component for the DRM system
"mediatek,<chip>-disp-ovl" - overlay (4 layers, blending, csc)
"mediatek,<chip>-disp-rdma" - read DMA / line buffer
"mediatek,<chip>-disp-wdma" - write DMA
So this node doesn't correspond to an IP core but is meant as a top-level
entry point for the operating system. This leads me to three questions.
1. Is there any IP core in the Mediatek display subsystem that could be
considered (or at least used) as a top-level entry point ? That would be my
preferred solution as I'm not fond of DT nodes not describing hardware.
At least on MT8173 that node is MMSYS, which it is currently matching
against. The issue, if I understand correctly, is that the clocks
provided by this same region were previously created via CLK_OF_DECLARE,
and are now changed to a separate clock driver that matches to the same
node.
2. If there's no such IP core, are all the display subsystem IP cores grouped
together in one MMIO register range ? If so we could move them as children of
this new display system node which, even if doesn't describe an IP core, would
describe the way the display IP cores are grouped in the hardware, and would
thus be a hardware description.
3. If the answer to the second question is also negative, shouldn't this
display system node reference all other display IP DT nodes (through direct
phandles and/or OF graph bindings) ?
Hi Philipp,
On Thursday, 19 October 2017 16:01:54 EEST Philipp Zabel wrote:
On Thu, 2017-10-19 at 13:26 +0200, Matthias Brugger wrote:
quoted
In theory the MMSYS device tree identifier is matches twice, by the clk
driver and the DRM subsystem. But the kernel only matches the first
driver for a device (clk) and discards the second one. This breaks
graphics on mt8173 and most probably on mt2701 as well.
MMSYS in Mediatek SoCs has some registers to control clock gates (which is
used in the clk driver) and some registers to enable the differnet blocks
of the display subsystem. The kernel uses the binding to load the central
comoponent of the distplay subsystem, which in place probes all the other
components and enables the present ones in the MMSYS.
We found us with the problem, that we need to change and therefor break
one
of the two bindings, or the DRM one or the clock driver one.
Apart from that the DRM subysystem does access the MMSYS registers via
relaxed reads/writes. But the it should to so via regmap, as the
registers are shared.
Possible solutions:
1) We add a new mediatek,mt8173-mmsys-clk node, which lives as a
simple-mfd under the actual mmsys node. We change the clock driver to
probe on this binding. This would make sense as the clock gate register
live completly in the MMSYS configuration registers.
The reason why the drm driver matches against the mmsys node in the
first place is that we wanted to avoid 2).
Why did you want to avoid 2) ?
Also, mmsys is not a pure clock controller, as it also contains the
display path configuration in its register space.
Which makes the mmsys related to display, but more in a syscon (combining
clocks and routing, and I assume other miscellaneous features that wouldn't
fit nicely in the other display-related IP cores) way than actually being part
of the display subsystem. Or does mmsys only provide display-related features
?
quoted
2) As the nodes of the DRM subsystem just need some of the registers of
MMSYS we add a new binding mediatek,mt8173-dispsys which probes the
central component of the DRM system. It has only a handle to mt8173-mmsys
to access the registerspace via regmap functions.
In this patchset I implemented 2). Please take into account, that this is
a RFC. I had no time to actually test the verison on real HW. Some of the
register accesses should be done using regmap_update instead of
regmap_read + regmap_write.
This RFC shall only show how solution 2) would look like. We can use it as
discussion to see how we circumvent the actual situation.
Or we could leave the bindings untouched and create one platform device
from the other or even set up the clocks from the drm driver?
Does mmsys provide features (such as clocks) to non-display IP cores ?
--
Regards,
Laurent Pinchart
Hi Matthias,
Should I base on your changes and resend this patch series
https://patchwork.kernel.org/patch/9980061/ ?
I add a similar node - display_components, but your approach is better
than mine.
You series should have the same issue as the Ulrich sees on the chromebook.
Basically you have two nodes which both bind to mediatek,mt7623-mmsys.
The only difference here is, that your clock drivers is a
builtin_platform_driver while on mt8173 it get's probed earlier as it is defined
as CLK_OF_DECLARE.
Do you see both drivers getting probed? I don't have my mt7623 board at hand
right now to check this.
In any case, please wait until we found a way to fix the issue before we add
these bindings.
Regards,
Matthias
PS @ryder: I have the rest of the series on my radar, between today and tomorrow
I will look into this
Thanks.
On Thu, 2017-10-19 at 13:26 +0200, Matthias Brugger wrote:
quoted
DRM subysystem and clock driver shared the same compatible mmsys.
This stopped does not work, as only the first driver for a compatible
gets probed. We change the comaptible to the new DRM identifier to fix
this.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
.../devicetree/bindings/display/mediatek/mediatek,disp.txt | 6 ++++++
1 file changed, 6 insertions(+)
From: Philipp Zabel <p.zabel@pengutronix.de> Date: 2017-10-19 14:54:35
Hi Laurent,
On Thu, 2017-10-19 at 16:39 +0300, Laurent Pinchart wrote:
Hi Philipp,
On Thursday, 19 October 2017 16:01:54 EEST Philipp Zabel wrote:
quoted
On Thu, 2017-10-19 at 13:26 +0200, Matthias Brugger wrote:
quoted
In theory the MMSYS device tree identifier is matches twice, by the clk
driver and the DRM subsystem. But the kernel only matches the first
driver for a device (clk) and discards the second one. This breaks
graphics on mt8173 and most probably on mt2701 as well.
MMSYS in Mediatek SoCs has some registers to control clock gates (which is
used in the clk driver) and some registers to enable the differnet blocks
of the display subsystem. The kernel uses the binding to load the central
comoponent of the distplay subsystem, which in place probes all the other
components and enables the present ones in the MMSYS.
We found us with the problem, that we need to change and therefor break
one
of the two bindings, or the DRM one or the clock driver one.
Apart from that the DRM subysystem does access the MMSYS registers via
relaxed reads/writes. But the it should to so via regmap, as the
registers are shared.
Possible solutions:
1) We add a new mediatek,mt8173-mmsys-clk node, which lives as a
simple-mfd under the actual mmsys node. We change the clock driver to
probe on this binding. This would make sense as the clock gate register
live completly in the MMSYS configuration registers.
The reason why the drm driver matches against the mmsys node in the
first place is that we wanted to avoid 2).
Why did you want to avoid 2) ?
Because the "display-subsystem" node does not represent a real device,
it's just there to probe the driver that stitches all the DISP
components together.
quoted
Also, mmsys is not a pure clock controller, as it also contains the
display path configuration in its register space.
Which makes the mmsys related to display, but more in a syscon (combining
clocks and routing, and I assume other miscellaneous features that wouldn't
fit nicely in the other display-related IP cores) way than actually being part
of the display subsystem. Or does mmsys only provide display-related features
?
All devices in the 0x14000000 - 0x14ffffff memory range are part of the
MMSYS system. That includes the MMSYS control or system configuration
block at 0x14000000 - 0x14000fff as well as all the related MDP (media
data path) and DISP (display data path) blocks that follow. The DISP
blocks are purely display related, while the MDP blocks implement
implement mem2mem functions like scaling and conversion.
quoted
quoted
2) As the nodes of the DRM subsystem just need some of the registers of
MMSYS we add a new binding mediatek,mt8173-dispsys which probes the
central component of the DRM system. It has only a handle to mt8173-mmsys
to access the registerspace via regmap functions.
In this patchset I implemented 2). Please take into account, that this is
a RFC. I had no time to actually test the verison on real HW. Some of the
register accesses should be done using regmap_update instead of
regmap_read + regmap_write.
This RFC shall only show how solution 2) would look like. We can use it as
discussion to see how we circumvent the actual situation.
Or we could leave the bindings untouched and create one platform device
from the other or even set up the clocks from the drm driver?
Does mmsys provide features (such as clocks) to non-display IP cores ?
The MMSYS control block provides clocks for the DISP (display data path)
and MDP (multimedia data path) blocks, as well as the routing between
them, but not to anything outside of the MMSYS system.
regards
Philipp
On Thu, 2017-10-19 at 15:53 +0300, Laurent Pinchart wrote:
quoted
Hi Matthias,
Thank you for the patch.
On Thursday, 19 October 2017 14:26:07 EEST Matthias Brugger wrote:
quoted
DRM subysystem and clock driver shared the same compatible mmsys.
This stopped does not work, as only the first driver for a compatible
gets probed. We change the comaptible to the new DRM identifier to fix
this.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
.../devicetree/bindings/display/mediatek/mediatek,disp.txt | 6 +++
1 file changed, 6 insertions(+)
diff --git
a/Documentation/devicetree/bindings/display/mediatek/mediatek,disp.txt
b/Documentation/devicetree/bindings/display/mediatek/mediatek,disp.txt
index 383183a89164..6db652463e64 100644
Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt.
Required properties (all function blocks):
- compatible: "mediatek,<chip>-disp-<function>", one of
+ "mediatek,<chip>-dispsys" - central component for the DRM system
"mediatek,<chip>-disp-ovl" - overlay (4 layers, blending, csc)
"mediatek,<chip>-disp-rdma" - read DMA / line buffer
"mediatek,<chip>-disp-wdma" - write DMA
So this node doesn't correspond to an IP core but is meant as a top-level
entry point for the operating system. This leads me to three questions.
1. Is there any IP core in the Mediatek display subsystem that could be
considered (or at least used) as a top-level entry point ? That would be my
preferred solution as I'm not fond of DT nodes not describing hardware.
At least on MT8173 that node is MMSYS, which it is currently matching
against. The issue, if I understand correctly, is that the clocks
provided by this same region were previously created via CLK_OF_DECLARE,
and are now changed to a separate clock driver that matches to the same
node.
Exactly that seems to be the problem we hit. I have to setup my chromebook to do
some changes, but that won't happen before the week after next week.
So yes, the MMSYS is the top-level-entry point for the display subsystem, the
clocks in mmsys are just a small part of the whole register block. I will cite
the cover letter which unfortunately wasn't send, because I broke my email setup:
"Possible solutions:
1) We add a new mediatek,mt8173-mmsys-clk node, which lives as a simple-mfd
under the actual mmsys node. We change the clock driver to probe on this
binding. This would make sense as the clock gate register live completely in
the MMSYS configuration registers.
2) As the nodes of the DRM subsystem just need some of the registers of MMSYS
we add a new binding mediatek,mt8173-dispsys which probes the central
component of the DRM system. It has only a handle to mt8173-mmsys to access
the registerspace via regmap functions."
So this patch set implemented solution 2).
quoted
2. If there's no such IP core, are all the display subsystem IP cores grouped
together in one MMIO register range ? If so we could move them as children of
this new display system node which, even if doesn't describe an IP core, would
describe the way the display IP cores are grouped in the hardware, and would
thus be a hardware description.
They are all mapped somewhere at 140xxxxx. But there are other components which
are used by other HW blocks smi_common especially. So I'm not sure which impact
that move would have.
The MMSYS for mt8173 actually enables the overlays and set's the multiplexer for
the output path. Does this make sense? It's the first time I've a deeper look in
such a driver, so maybe I don't grasp everything.
Regards,
Matthias
quoted
3. If the answer to the second question is also negative, shouldn't this
display system node reference all other display IP DT nodes (through direct
phandles and/or OF graph bindings) ?
Hi, Matthias:
On Thu, 2017-10-19 at 13:26 +0200, Matthias Brugger wrote:
quoted hunk
DRM subysystem and clock driver shared the same compatible mmsys.
This stopped does not work, as only the first driver for a compatible
gets probed. We change the comaptible to the new DRM identifier to fix
this.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 5 +++++
1 file changed, 5 insertions(+)
Hi, Matthias:
On Thu, 2017-10-19 at 13:26 +0200, Matthias Brugger wrote:
quoted
DRM subysystem and clock driver shared the same compatible mmsys.
This stopped does not work, as only the first driver for a compatible
gets probed. We change the comaptible to the new DRM identifier to fix
this.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 5 +++++
1 file changed, 5 insertions(+)
Hi,
On Thu, 2017-10-19 at 16:54 +0200, Philipp Zabel wrote:
Hi Laurent,
On Thu, 2017-10-19 at 16:39 +0300, Laurent Pinchart wrote:
quoted
Hi Philipp,
On Thursday, 19 October 2017 16:01:54 EEST Philipp Zabel wrote:
quoted
On Thu, 2017-10-19 at 13:26 +0200, Matthias Brugger wrote:
quoted
In theory the MMSYS device tree identifier is matches twice, by the clk
driver and the DRM subsystem. But the kernel only matches the first
driver for a device (clk) and discards the second one. This breaks
graphics on mt8173 and most probably on mt2701 as well.
MMSYS in Mediatek SoCs has some registers to control clock gates (which is
used in the clk driver) and some registers to enable the differnet blocks
of the display subsystem. The kernel uses the binding to load the central
comoponent of the distplay subsystem, which in place probes all the other
components and enables the present ones in the MMSYS.
We found us with the problem, that we need to change and therefor break
one
of the two bindings, or the DRM one or the clock driver one.
Apart from that the DRM subysystem does access the MMSYS registers via
relaxed reads/writes. But the it should to so via regmap, as the
registers are shared.
Possible solutions:
1) We add a new mediatek,mt8173-mmsys-clk node, which lives as a
simple-mfd under the actual mmsys node. We change the clock driver to
probe on this binding. This would make sense as the clock gate register
live completly in the MMSYS configuration registers.
The reason why the drm driver matches against the mmsys node in the
first place is that we wanted to avoid 2).
Why did you want to avoid 2) ?
Because the "display-subsystem" node does not represent a real device,
it's just there to probe the driver that stitches all the DISP
components together.
quoted
quoted
Also, mmsys is not a pure clock controller, as it also contains the
display path configuration in its register space.
Which makes the mmsys related to display, but more in a syscon (combining
clocks and routing, and I assume other miscellaneous features that wouldn't
fit nicely in the other display-related IP cores) way than actually being part
of the display subsystem. Or does mmsys only provide display-related features
?
All devices in the 0x14000000 - 0x14ffffff memory range are part of the
MMSYS system. That includes the MMSYS control or system configuration
block at 0x14000000 - 0x14000fff as well as all the related MDP (media
data path) and DISP (display data path) blocks that follow. The DISP
blocks are purely display related, while the MDP blocks implement
implement mem2mem functions like scaling and conversion.
quoted
quoted
quoted
2) As the nodes of the DRM subsystem just need some of the registers of
MMSYS we add a new binding mediatek,mt8173-dispsys which probes the
central component of the DRM system. It has only a handle to mt8173-mmsys
to access the registerspace via regmap functions.
In this patchset I implemented 2). Please take into account, that this is
a RFC. I had no time to actually test the verison on real HW. Some of the
register accesses should be done using regmap_update instead of
regmap_read + regmap_write.
This RFC shall only show how solution 2) would look like. We can use it as
discussion to see how we circumvent the actual situation.
Or we could leave the bindings untouched and create one platform device
from the other or even set up the clocks from the drm driver?
Does mmsys provide features (such as clocks) to non-display IP cores ?
The MMSYS control block provides clocks for the DISP (display data path)
and MDP (multimedia data path) blocks, as well as the routing between
them, but not to anything outside of the MMSYS system.
According to register table of mediatek x20 mmsys [1] and Philipp's
statement, I think mmsys is neither clock-controller nor display
controller. It's a combination of multiple function. The four major
function is display's clock-control, mdp's clock-control, display's
routing, and mdp's routing. So we have two choice:
1) Centralize these multiple function control inside mmsys device: This
means there is only a mmsys device which contains function of
clock-control, display, and mdp.
2) Separate these multiple function to different device: mmsys is the
major device which owns the register resource but does nothing. The
function is controlled by three virtual device: mmsys-clock-controller,
display-controller, and mdp-controller.
I prefer 2) because these function seems independent.
Regards,
CK
[1]
https://www.96boards.org/documentation/ConsumerEdition/MediaTekX20/AdditionalDocs/
Hi Philipp,
On Thursday, 19 October 2017 17:54:16 EEST Philipp Zabel wrote:
On Thu, 2017-10-19 at 16:39 +0300, Laurent Pinchart wrote:
quoted
On Thursday, 19 October 2017 16:01:54 EEST Philipp Zabel wrote:
quoted
On Thu, 2017-10-19 at 13:26 +0200, Matthias Brugger wrote:
quoted
In theory the MMSYS device tree identifier is matches twice, by the
clk driver and the DRM subsystem. But the kernel only matches the
first driver for a device (clk) and discards the second one. This
breaks graphics on mt8173 and most probably on mt2701 as well.
MMSYS in Mediatek SoCs has some registers to control clock gates
(which is used in the clk driver) and some registers to enable the
differnet blocks of the display subsystem. The kernel uses the binding
to load the central comoponent of the distplay subsystem, which in
place probes all the other components and enables the present ones in
the MMSYS.
We found us with the problem, that we need to change and therefor
break one of the two bindings, or the DRM one or the clock driver one.
Apart from that the DRM subysystem does access the MMSYS registers via
relaxed reads/writes. But the it should to so via regmap, as the
registers are shared.
Possible solutions:
1) We add a new mediatek,mt8173-mmsys-clk node, which lives as a
simple-mfd under the actual mmsys node. We change the clock driver to
probe on this binding. This would make sense as the clock gate
register live completly in the MMSYS configuration registers.
The reason why the drm driver matches against the mmsys node in the
first place is that we wanted to avoid 2).
Why did you want to avoid 2) ?
Because the "display-subsystem" node does not represent a real device,
it's just there to probe the driver that stitches all the DISP components
together.
I'm not a big supported of such DT nodes for "logical" devices either. When
possible I prefer describing the relationship between display IP cores using
OF graph DT bindings.
In some cases (and I don't know if the Mediatek display is one of them) there
is no single IP core that can be considered as a master from a display point
of view. This is inconvenient for device drivers as there's no clear place for
an entry point. I could thus be convinced to accept DT bindings for a logical
display DT node when there's really no other good choice.
quoted
quoted
Also, mmsys is not a pure clock controller, as it also contains the
display path configuration in its register space.
Which makes the mmsys related to display, but more in a syscon (combining
clocks and routing, and I assume other miscellaneous features that
wouldn't fit nicely in the other display-related IP cores) way than
actually being part of the display subsystem. Or does mmsys only provide
display-related features ?
All devices in the 0x14000000 - 0x14ffffff memory range are part of the
MMSYS system. That includes the MMSYS control or system configuration
block at 0x14000000 - 0x14000fff as well as all the related MDP (media
data path) and DISP (display data path) blocks that follow. The DISP
blocks are purely display related, while the MDP blocks implement
implement mem2mem functions like scaling and conversion.
Without more information about the hardware it's hard to tell whether the DT
nodes for the DISP and MDP IP cores should be children of the MMSYS DT node or
not. In any case, it looks like the MMSYS is a syscon that provides
miscellaneous functions not fitting anywhere else.
On simple solution, which shouldn't require DT changes, would be to merge the
MMSYS clock driver into the mediatek DRM driver, and register the MMSYS clocks
at probe time instead of using CLK_OF_DECLARE.
Another option would be to handle MMSYS as an MFD. That shouldn't require DT
changes either.
quoted
quoted
quoted
2) As the nodes of the DRM subsystem just need some of the registers
of MMSYS we add a new binding mediatek,mt8173-dispsys which probes the
central component of the DRM system. It has only a handle to mt8173-
mmsys to access the registerspace via regmap functions.
In this patchset I implemented 2). Please take into account, that this
is a RFC. I had no time to actually test the verison on real HW. Some
of the register accesses should be done using regmap_update instead of
regmap_read + regmap_write.
This RFC shall only show how solution 2) would look like. We can use
it as discussion to see how we circumvent the actual situation.
Or we could leave the bindings untouched and create one platform device
from the other or even set up the clocks from the drm driver?
Does mmsys provide features (such as clocks) to non-display IP cores ?
The MMSYS control block provides clocks for the DISP (display data path)
and MDP (multimedia data path) blocks, as well as the routing between
them, but not to anything outside of the MMSYS system.