Re: [PATCH 1/4] drm/exynos: dsim: fix to control mipi phy register
On 09/02/15 13:17, Inki Dae wrote: >> 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? 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. -- Regards, Sylwester -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] drm/exynos: dsim: fix to control mipi phy register
On 2015년 02월 09일 19:57, Sylwester Nawrocki wrote: > On 07/02/15 12:53, Inki Dae wrote: >> 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@1188 { >> ... >> phys = <&mipi_phy 0>; >> phy-names = "csis"; >> ... >> }; >> csis_1: csis@1189 { >> ... >> 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] > > 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. 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 > -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] drm/exynos: dsim: fix to control mipi phy register
On 07/02/15 12:53, Inki Dae wrote: > 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@1188 { > ... > phys = <&mipi_phy 0>; > phy-names = "csis"; > ... > }; > csis_1: csis@1189 { > ... > 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] 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. -- Thanks, Sylwester [1] https://patchwork.ozlabs.org/patch/429948/ http://www.spinics.net/lists/linux-samsung-soc/msg41210.html -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 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@1188 { ... phys = <&mipi_phy 0>; phy-names = "csis"; ... }; csis_1: csis@1189 { ... 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] Signed-off-by: Inki Dae --- .../devicetree/bindings/video/exynos_dsim.txt |9 ++-- drivers/gpu/drm/exynos/exynos_drm_dsi.c| 54 ++-- 2 files changed, 56 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/video/exynos_dsim.txt b/Documentation/devicetree/bindings/video/exynos_dsim.txt index ca2b4aa..dec3b55 100644 --- a/Documentation/devicetree/bindings/video/exynos_dsim.txt +++ b/Documentation/devicetree/bindings/video/exynos_dsim.txt @@ -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 diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 05fe93d..38b025e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include @@ -263,6 +265,8 @@ struct exynos_dsi_transfer { struct exynos_dsi_driver_data { unsigned int plltmr_reg; + unsigned int mipi_phy_offset; + unsigned int mipi_phy_en_shift; unsigned int has_freqband:1; unsigned int has_clklane_stop:1; }; @@ -277,6 +281,7 @@ struct exynos_dsi { void __iomem *reg_base; struct phy *phy; + struct regmap *pmureg; struct clk *pll_clk; struct clk *bus_clk; struct regulator_bulk_data supplies[2]; @@ -313,21 +318,29 @@ static struct exynos_dsi_driver_data exynos3_dsi_driver_data = { .plltmr_reg = 0x50, .has_freqband = 1, .has_clklane_stop = 1, + .mipi_phy_offset = 0x710, + .mipi_phy_en_shift = 0, }; static struct exynos_dsi_driver_data exynos4_dsi_driver_data = { .plltmr_reg = 0x50, .has_freqband = 1, .has_clklane_stop = 1, + .mipi_phy_offset = 0x710, + .mipi_phy_en_shift = 0, }; static struct exynos_dsi_driver_data exynos4415_dsi_driver_data = { .plltmr_reg = 0x58, .has_clklane_stop = 1, + .mipi_phy_offset = 0x710, + .mipi_phy_en_shift = 0, }; static struct exynos_dsi_driver_data exynos5_dsi_driver_data = { .plltmr_reg = 0x58, + .mipi_phy_offset = 0x714, + .mipi_phy_en_shift = 0, }; static struct of_device_id exynos_dsi_of_match[] = { @@ -1294,6 +1307,7 @@ static const struct mipi_dsi_host_ops exynos_dsi_ops = { static int exynos_dsi_poweron(struct exynos_dsi *dsi) { + struct exynos_dsi_driver_data *driver_data = dsi->driver_data; int ret; ret = regulator_bulk_enable(ARRAY_SIZE(dsi->supplies), dsi->supplies); @@ -1314,7 +1328,14 @@ static int exynos_dsi_poweron(struct exynos_dsi *dsi)