drm/exynos: use syscon framework to enable mipi phy
cover drm/exynos: use syscon framework to enable mipi phy
This patch series makes syscon framework to be used instead of phy framework.
For this, I adds syscon support to mipi dsi driver and the relevant device tree properties to each dtsi files, Exynos4, Exynos3250 and Exynos5420.
Inki Dae (4):
drm/exynos: dsim: fix to control mipi phy register
ARM: dts: exynos4: use pmureg device node to enable mipi phy
ARM: dts: exynos3250: use pmureg device node to enable mipi phy
ARM: dts: exynos5420: use pmureg device node to enable mipi phy
.../devicetree/bindings/video/exynos_dsim.txt | 9 ++-- arch/arm/boot/dts/exynos3250.dtsi | 3 +- arch/arm/boot/dts/exynos4.dtsi | 3 +- arch/arm/boot/dts/exynos5420.dtsi | 3 +- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 54 ++++++++++++++++++-- 5 files changed, 59 insertions(+), 13 deletions(-)
Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Inki Dae
maintainerPATCH 1/4 drm/exynos: dsim: fix to control mipi phy register
This patch fixes the issue that the try to get a phy object is failed to enable mipi phy.
System and power management unit registers should be controlled by syscon framework. So this patch removes existing phy framework based codes and adds syscon support instead. However, we should support legacy device tree binding so consider the legacy binding for compatibility.
In addition, we need to remove below device node and relevant properties,
mipi_phy: video-phy@10020710 {
compatible = "samsung,s5pv210-mipi-video-phy";
reg = <0x10020710 8>;
#phy-cells = <1>;
};Now camera device node uses mipi_phy node relevant properties like below,
camera {
...
csis_0: csis@11880000 {
...
phys = <&mipi_phy 0>;
phy-names = "csis";
...
};
csis_1: csis@11890000 {
...
phys = <&mipi_phy 2>;
phy-names = "csis";
...
};
...
};With above, we will find below message while booting,
can't request region for resource [mem 0x10020710-0x10020717]
--- .../devicetree/bindings/video/exynos_dsim.txt | 9 ++-- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 54 ++++++++++++++++++-- 2 files changed, 56 insertions(+), 7 deletions(-)
Documentation/devicetree/bindings/video/exynos_dsim.txt +6 -3
@@ -11,15 +11,18 @@ Required properties: - clocks: list of clock specifiers, must contain an entry for each required entry in clock-names - clock-names: should include "bus_clk"and "pll_clk" entries - - phys: list of phy specifiers, must contain an entry for each required - entry in phy-names - - phy-names: should include "dsim" entry + - samsung,pmureg: handle to syscon used to control the PMU registers - vddcore-supply: MIPI DSIM Core voltage supply (e.g. 1.1V) - vddio-supply: MIPI DSIM I/O and PLL voltage supply (e.g. 1.8V) - samsung,pll-clock-frequency: specifies frequency of the "pll_clk" clock - #address-cells, #size-cells: should be set respectively to <1> and <0> according to DSI host bindings (see MIPI DSI bindings [1]) +Deprecated properties for MIPI DSI Master: + - phys: list of phy specifiers, must contain an entry for each required + entry in phy-names (Deprecated) + - phy-names: should include "dsim" entry (Deprecated) + Optional properties: - samsung,power-domain: a phandle to DSIM power domain node
drivers/gpu/drm/exynos/exynos_drm_dsi.c +50 -4
128 lines not on this page · raw message
Signature · 6 lines
1.7.9.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/4] drm/exynos: dsim: fix to control mipi phy register
Quoted 33 lines · Inki Dae
This patch fixes the issue that the try to get a phy object is failed to enable mipi phy.
System and power management unit registers should be controlled by syscon framework. So this patch removes existing phy framework based codes and adds syscon support instead. However, we should support legacy device tree binding so consider the legacy binding for compatibility.
In addition, we need to remove below device node and relevant properties,
mipi_phy: video-phy@10020710 { compatible = "samsung,s5pv210-mipi-video-phy"; reg = <0x10020710 8>; #phy-cells = <1>; };Now camera device node uses
mipi_phynode relevant properties like below,camera { ... csis_0: csis@11880000 { ... phys = <&mipi_phy 0>; phy-names = "csis"; ... }; csis_1: csis@11890000 { ... phys = <&mipi_phy 2>; phy-names = "csis"; ... }; ... };
Quoted 2 lines
With above, we will find below message while booting,
can't request region for resource [mem 0x10020710-0x10020717]
I'm afraid this approach won't work because MIPI DSI Master and MIPI CSI Slave devices share a control bit in the register and it seems impossible to ensure proper locking with current regmap/syscon API.
I have submitted patches to fix this issue [1] and they should be already available in linux-next and can be found on linux-samsung-soc ML:
[PATCH 1/2] phy: exynos-video-mipi: Fix regression by adding support for PMU regmap [PATCH 2/2] ARM: dts: Add syscon phandle to the video-phy node for Exynos4
The other issue with your approach is that we are moving the PMU details to the MIPI DSIM driver and similar changes would need to be done in the MIPI CSIS driver.
Instead I just added syscon support to the PHY layer, it's not perfect but fixes the issue for both DSI and CSI and doesn't strip the PHY layer which could potentially be useful.
Signature · 5 lines
Thanks,
Sylwester
[1] https://patchwork.ozlabs.org/patch/429948/
http://www.spinics.net/lists/linux-samsung-soc/msg41210.htmlInki Dae
maintainerRe: [PATCH 1/4] drm/exynos: dsim: fix to control mipi phy register
Quoted 47 lines · Sylwester Nawrocki
Quoted 33 lines · Inki Dae
This patch fixes the issue that the try to get a phy object is failed to enable mipi phy.
System and power management unit registers should be controlled by syscon framework. So this patch removes existing phy framework based codes and adds syscon support instead. However, we should support legacy device tree binding so consider the legacy binding for compatibility.
In addition, we need to remove below device node and relevant properties,
mipi_phy: video-phy@10020710 { compatible = "samsung,s5pv210-mipi-video-phy"; reg = <0x10020710 8>; #phy-cells = <1>; };Now camera device node uses
mipi_phynode relevant properties like below,camera { ... csis_0: csis@11880000 { ... phys = <&mipi_phy 0>; phy-names = "csis"; ... }; csis_1: csis@11890000 { ... phys = <&mipi_phy 2>; phy-names = "csis"; ... }; ... };Quoted 2 lines
With above, we will find below message while booting,
can't request region for resource [mem 0x10020710-0x10020717]I'm afraid this approach won't work because MIPI DSI Master and MIPI CSI Slave devices share a control bit in the register and it seems impossible to ensure proper locking with current regmap/syscon API.
I have submitted patches to fix this issue [1] and they should be already available in linux-next and can be found on linux-samsung-soc ML:
[PATCH 1/2] phy: exynos-video-mipi: Fix regression by adding support for PMU regmap [PATCH 2/2] ARM: dts: Add syscon phandle to the video-phy node for Exynos4
Quoted 7 lines
The other issue with your approach is that we are moving the PMU details to the MIPI DSIM driver and similar changes would need to be done in the MIPI CSIS driver.
Instead I just added syscon support to the PHY layer, it's not perfect but fixes the issue for both DSI and CSI and doesn't strip the PHY layer which could potentially be useful.
Ah, Right. I didn't check your patch set. Your way is a better idea than my one. With this, we don't need to change device drivers, MIPI DSI and CSI.
Then, what is the meaning that it's not perfect?
Thanks,
Inki Dae
Quoted 1 line
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/4] drm/exynos: dsim: fix to control mipi phy register
Quoted 8 lines · Inki Dae
Quoted 3 lines
Instead I just added syscon support to the PHY layer, it's not perfect
Quoted 2 lines
but fixes the issue for both DSI and CSI and doesn't strip the PHY layer which could potentially be useful.
Ah, Right. I didn't check your patch set. Your way is a better idea than my one. With this, we don't need to change device drivers, MIPI DSI and CSI.
Then, what is the meaning that it's not perfect?
What I didn't like is that there are at least 3 mutexes on the phy_power_on/ phy_power_off path (PHY core, PHY driver, regmap) and there is another level of indirection after introducing the regmap. I guess it's nothing serious though. And BTW the syscon could be converted to use spinlock rather than a mutex, since in our case behind the PMU syscon is always a memory mapped region.
Signature · 2 lines
Regards, Sylwester
Inki Dae
maintainerPATCH 2/4 ARM: dts: exynos4: use pmureg device node to enable mipi phy
In reply to Inki DaeThis patch removes mipi phy relevant properties from dsim device node and makes the pmureg device node to be used instead to enable mipi phy.
--- arch/arm/boot/dts/exynos4.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm/boot/dts/exynos4.dtsi +1 -2
@@ -148,8 +148,7 @@ reg = <0x11C80000 0x10000>; interrupts = <0 79 0>; samsung,power-domain = <&pd_lcd0>; - phys = <&mipi_phy 1>; - phy-names = "dsim"; + samsung,pmureg = <&pmu_system_controller>; clocks = <&clock CLK_DSIM0>, <&clock CLK_SCLK_MIPI0>; clock-names = "bus_clk", "pll_clk"; status = "disabled";
Signature · 1 line
1.7.9.5
Inki Dae
maintainerPATCH 3/4 ARM: dts: exynos3250: use pmureg device node to enable mipi phy
In reply to Inki DaeThis patch removes mipi phy relevant properties from dsim device node and makes the pmureg device node to be used instead to enable mipi phy.
--- arch/arm/boot/dts/exynos3250.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm/boot/dts/exynos3250.dtsi +1 -2
@@ -246,8 +246,7 @@ interrupts = <0 83 0>; samsung,phy-type = <0>; samsung,power-domain = <&pd_lcd0>; - phys = <&mipi_phy 1>; - phy-names = "dsim"; + samsung,pmureg = <&pmu_system_controller>; clocks = <&cmu CLK_DSIM0>, <&cmu CLK_SCLK_MIPI0>; clock-names = "bus_clk", "pll_clk"; #address-cells = <1>;
Signature · 6 lines
1.7.9.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Inki Dae
maintainerPATCH 4/4 ARM: dts: exynos5420: use pmureg device node to enable mipi phy
In reply to Inki DaeThis patch removes mipi phy relevant properties from dsim device node and makes the pmureg device node to be used instead to enable mipi phy.
--- arch/arm/boot/dts/exynos5420.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm/boot/dts/exynos5420.dtsi +1 -2
@@ -525,8 +525,7 @@ compatible = "samsung,exynos5410-mipi-dsi"; reg = <0x14500000 0x10000>; interrupts = <0 82 0>; - phys = <&mipi_phy 1>; - phy-names = "dsim"; + samsung,pmureg = <&pmu_system_controller>; clocks = <&clock CLK_DSIM1>, <&clock CLK_SCLK_MIPI1>; clock-names = "bus_clk", "pll_clk"; #address-cells = <1>;
Signature · 6 lines
1.7.9.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel