Skip to contentSkip to conversation

S5PC110: add machine specific MIPI-DSI setup code.

PATCH In review Inki Dae 3 participants 5 messages Dec 28, 2010 – Jan 4, 2011

Subsystems (4)
lore
Share & tools
lore

Inki Dae

author
#0 lore raw

PATCH 3/5 S5PC110: add machine specific MIPI-DSI setup code.

---
 arch/arm/mach-s5pv210/Kconfig      |    6 +++
 arch/arm/mach-s5pv210/Makefile     |    1 +
 arch/arm/mach-s5pv210/setup-mipi.c |   76 ++++++++++++++++++++++++++++++++++++
 3 files changed, 83 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/setup-mipi.c
arch/arm/mach-s5pv210/Kconfig +6 -0
index 862f239..76da541 100644
@@ -53,6 +53,11 @@ config S5PV210_SETUP_SDHCI_GPIO
 	help
 	  Common setup code for SDHCI gpio.
 
+config S5P_SETUP_MIPI_DSI
+	bool
+	help
+	  Common setup code for MIPI-DSI
+
 menu "S5PC110 Machines"
 
 config MACH_AQUILA
@@ -92,6 +97,7 @@ config MACH_GONI
 	select S5PV210_SETUP_I2C2
 	select S5PV210_SETUP_KEYPAD
 	select S5PV210_SETUP_SDHCI
+	select S5P_SETUP_MIPI_DSI
 	help
 	  Machine support for Samsung GONI board
 	  S5PC110(MCP) is one of package option of S5PV210
arch/arm/mach-s5pv210/Makefile +1 -0
index ff1a0db..638747c 100644
@@ -37,3 +37,4 @@ obj-$(CONFIG_S5PV210_SETUP_IDE)		+= setup-ide.o
 obj-$(CONFIG_S5PV210_SETUP_KEYPAD)	+= setup-keypad.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI)       += setup-sdhci.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
+obj-$(CONFIG_S5P_SETUP_MIPI_DSI)	+= setup-mipi.o
\ No newline at end of file
arch/arm/mach-s5pv210/setup-mipi.c new file +76 -0

76 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 3/5 S5PC110: add machine specific MIPI-DSI setup code.

Quoted 15 lines · InKi Dae
---
 arch/arm/mach-s5pv210/Kconfig      |    6 +++
 arch/arm/mach-s5pv210/Makefile     |    1 +
 arch/arm/mach-s5pv210/setup-mipi.c |   76
++++++++++++++++++++++++++++++++++++
 3 files changed, 83 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/setup-mipi.c
arch/arm/mach-s5pv210/Kconfig +0 -0
index 862f239..76da541 100644

arch/arm/mach-s5pv210/Kconfig config S5PV210_SETUP_SDHCI_GPIO · line 56

Quoted 4 lines
arch/arm/mach-s5pv210/Kconfig +1 -0
@@ -53,6 +53,11 @@ config S5PV210_SETUP_SDHCI_GPIO
 	help
 	  Common setup code for SDHCI gpio.
 
+config S5P_SETUP_MIPI_DSI

If this is for S5PV210, please use S5PV210_xxx as prefix. Or this is for S5P SoCS, move into plat-s5p.

And as I know, this is _not_ only for MIPI DSI master...so need to re-name.

arch/arm/mach-s5pv210/Kconfig config MACH_GONI · line 100

Quoted 12 lines
arch/arm/mach-s5pv210/Kconfig +5 -0
+	bool
+	help
+	  Common setup code for MIPI-DSI
+
 menu "S5PC110 Machines"
 
 config MACH_AQUILA
@@ -92,6 +97,7 @@ config MACH_GONI
 	select S5PV210_SETUP_I2C2
 	select S5PV210_SETUP_KEYPAD
 	select S5PV210_SETUP_SDHCI
+	select S5P_SETUP_MIPI_DSI

Is this really only for machine?

Review

Quoted 4 lines
arch/arm/mach-s5pv210/Kconfig +0 -0
 	help
 	  Machine support for Samsung GONI board
 	  S5PC110(MCP) is one of package option of S5PV210
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/Makefile

arch/arm/mach-s5pv210/Makefile obj-$(CONFIG_S5PV210_SETUP_IDE) +=

Quoted 4 lines

index ff1a0db..638747c 100644

arch/arm/mach-s5pv210/Makefile +0 -0
@@ -37,3 +37,4 @@ obj-$(CONFIG_S5PV210_SETUP_IDE)		+=

setup-ide.o

Quoted 34 lines
arch/arm/mach-s5pv210/Makefile +1 -0
 obj-$(CONFIG_S5PV210_SETUP_KEYPAD)	+= setup-keypad.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI)       += setup-sdhci.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
+obj-$(CONFIG_S5P_SETUP_MIPI_DSI)	+= setup-mipi.o
\ No newline at end of file
arch/arm/mach- renamed from arch/arm/mach-s5pv210/setup-mipi.c +0 -0

s5pv210/setup-mipi.c
new file mode 100644
index 0000000..2cc8cd1

arch/arm/mach-s5pv210/setup-mipi.c new file +22 -0
@@ -0,0 +1,76 @@
+/* linux/arch/arm/plat-s5p/setup-mipi.c
+ *
+ * Samsung MIPI-DSI DPHY driver.
+ *
+ * Author: InKi Dae <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#include <linux/kernel.h>

arch/arm/mach-s5pv210/setup-mipi.c line 32

Quoted 10 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +10 -0
+#include <linux/string.h>
+#include <linux/io.h>
+#include <linux/err.h>
+#include <linux/platform_device.h>
+#include <linux/clk.h>
+
+#include <mach/map.h>
+#include <mach/regs-clock.h>
+
+#include <plat/mipi-dsi.h>

Hmm...I didn't find this header in your previous patch.

arch/arm/mach-s5pv210/setup-mipi.c line 33

Quoted 1 line
arch/arm/mach-s5pv210/setup-mipi.c new file +1 -0
+#include <plat/regs-dsim.h>

Same.

Quoted 3 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +2 -0
+
+static int s5p_mipi_enable_d_phy(struct dsim_device *dsim, unsigned int

enable)

Why need struct dsim_device in argument?
As I said, this is for MIPI DSI and MIPI CSI...right?

arch/arm/mach-s5pv210/setup-mipi.c line 39

Quoted 4 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +4 -0
+{
+	unsigned int reg;
+
+	reg = readl(S5P_MIPI_CONTROL) & ~(1 << 0);

Please use __raw_readl here, because no need memory barrier between operations.

arch/arm/mach-s5pv210/setup-mipi.c

Quoted 2 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +2 -0
+	reg |= (enable << 0);
+	writel(reg, S5P_MIPI_CONTROL);

Same.

arch/arm/mach-s5pv210/setup-mipi.c

Quoted 2 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +2 -0
+
+	return 0;

Always, return 0?

If enabled by MIPI DSI and MIPI CSI, how each IP can know other IP's MIPI enalbling?

arch/arm/mach-s5pv210/setup-mipi.c line 46

Quoted 3 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +3 -0
+}
+
+static int s5p_mipi_enable_dsi_master(struct dsim_device *dsim,

Same.

arch/arm/mach-s5pv210/setup-mipi.c line 51

Quoted 5 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +5 -0
+	unsigned int enable)
+{
+	unsigned int reg;
+
+	reg = readl(S5P_MIPI_CONTROL) & ~(1 << 2);

Same.

arch/arm/mach-s5pv210/setup-mipi.c line 53

Quoted 2 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +2 -0
+	reg |= (enable << 2);
+	writel(reg, S5P_MIPI_CONTROL);

Same.

arch/arm/mach-s5pv210/setup-mipi.c line 58

Quoted 5 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +5 -0
+
+	return 0;
+}
+
+int s5p_mipi_part_reset(struct dsim_device *dsim)

Do we really need argument, struct dsim_device?

arch/arm/mach-s5pv210/setup-mipi.c

Quoted 10 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +10 -0
+{
+	writel(S5P_MIPI_M_RESETN, S5P_MIPI_PHY_CON0);
+
+	return 0;
+}
+
+int s5p_mipi_init_d_phy(struct dsim_device *dsim)
+{
+	/**
+	 * DPHY and Master block must be enabled at the system

initialization

arch/arm/mach-s5pv210/setup-mipi.c

Quoted 9 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +8 -1
+	 * step before data access from/to DPHY begins.
+	 */
+	s5p_mipi_enable_d_phy(dsim, 1);
+
+	s5p_mipi_enable_dsi_master(dsim, 1);
+
+	return 0;
+}
--

I can't get these needs...I mean need to re-think this for support MIPI DSI(M) and MIPI CSI(S).
Actually MIPI control is needed in both.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

author
#2 lore raw

PATCH 3/5 S5PC110: add machine specific MIPI-DSI setup code.

Kukjin Kim ? ?:

Quoted 18 lines
Quoted 17 lines · InKi Dae
---
 arch/arm/mach-s5pv210/Kconfig      |    6 +++
 arch/arm/mach-s5pv210/Makefile     |    1 +
 arch/arm/mach-s5pv210/setup-mipi.c |   76
++++++++++++++++++++++++++++++++++++
 3 files changed, 83 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/setup-mipi.c
arch/arm/mach-s5pv210/Kconfig +0 -0
index 862f239..76da541 100644
@@ -53,6 +53,11 @@ config S5PV210_SETUP_SDHCI_GPIO
 	help
 	  Common setup code for SDHCI gpio.
 
Quoted 7 lines

arch/arm/mach-s5pv210/Kconfig config S5PV210_SETUP_SDHCI_GPIO · line 56

Quoted 1 line
arch/arm/mach-s5pv210/Kconfig +1 -0
+config S5P_SETUP_MIPI_DSI

If this is for S5PV210, please use S5PV210_xxx as prefix. Or this is for S5P SoCS, move into plat-s5p.

And as I know, this is _not_ only for MIPI DSI master...so need to re-name.

Ok, moved to plat-s5p.

Quoted 63 lines

arch/arm/mach-s5pv210/Kconfig config MACH_GONI · line 100

Quoted 12 lines
arch/arm/mach-s5pv210/Kconfig +5 -0
+	bool
+	help
+	  Common setup code for MIPI-DSI
+
 menu "S5PC110 Machines"
 
 config MACH_AQUILA
@@ -92,6 +97,7 @@ config MACH_GONI
 	select S5PV210_SETUP_I2C2
 	select S5PV210_SETUP_KEYPAD
 	select S5PV210_SETUP_SDHCI
+	select S5P_SETUP_MIPI_DSI

Is this really only for machine?

Review

Quoted 4 lines
arch/arm/mach-s5pv210/Kconfig +0 -0
 	help
 	  Machine support for Samsung GONI board
 	  S5PC110(MCP) is one of package option of S5PV210
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/Makefile

arch/arm/mach-s5pv210/Makefile obj-$(CONFIG_S5PV210_SETUP_IDE) +=

Quoted 4 lines

index ff1a0db..638747c 100644

arch/arm/mach-s5pv210/Makefile +0 -0
@@ -37,3 +37,4 @@ obj-$(CONFIG_S5PV210_SETUP_IDE)		+=

setup-ide.o

Quoted 38 lines
arch/arm/mach-s5pv210/Makefile +1 -0
 obj-$(CONFIG_S5PV210_SETUP_KEYPAD)	+= setup-keypad.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI)       += setup-sdhci.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
+obj-$(CONFIG_S5P_SETUP_MIPI_DSI)	+= setup-mipi.o
\ No newline at end of file
arch/arm/mach- renamed from arch/arm/mach-s5pv210/setup-mipi.c +0 -0

s5pv210/setup-mipi.c
new file mode 100644
index 0000000..2cc8cd1

arch/arm/mach-s5pv210/setup-mipi.c new file +26 -0
@@ -0,0 +1,76 @@
+/* linux/arch/arm/plat-s5p/setup-mipi.c
+ *
+ * Samsung MIPI-DSI DPHY driver.
+ *
+ * Author: InKi Dae <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/io.h>
+#include <linux/err.h>
+#include <linux/platform_device.h>
Quoted 9 lines

arch/arm/mach-s5pv210/setup-mipi.c line 32

Quoted 6 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +6 -0
+#include <linux/clk.h>
+
+#include <mach/map.h>
+#include <mach/regs-clock.h>
+
+#include <plat/mipi-dsi.h>

Hmm...I didn't find this header in your previous patch.

previous patch??

Quoted 24 lines

arch/arm/mach-s5pv210/setup-mipi.c line 33

Quoted 1 line
arch/arm/mach-s5pv210/setup-mipi.c new file +1 -0
+#include <plat/regs-dsim.h>

Same.

Quoted 3 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +2 -0
+
+static int s5p_mipi_enable_d_phy(struct dsim_device *dsim, unsigned int

enable)

Why need struct dsim_device in argument?
As I said, this is for MIPI DSI and MIPI CSI...right?

arch/arm/mach-s5pv210/setup-mipi.c line 39

Quoted 4 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +4 -0
+{
+	unsigned int reg;
+
+	reg = readl(S5P_MIPI_CONTROL) & ~(1 << 0);

Please use __raw_readl here, because no need memory barrier between operations.

arch/arm/mach-s5pv210/setup-mipi.c

Quoted 2 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +2 -0
+	reg |= (enable << 0);
+	writel(reg, S5P_MIPI_CONTROL);

Same.

Quoted 8 lines

arch/arm/mach-s5pv210/setup-mipi.c

Quoted 2 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +2 -0
+
+	return 0;

Always, return 0?

If enabled by MIPI DSI and MIPI CSI, how each IP can know other IP's MIPI enalbling?

ok, naming issue sould be considered more.
hm, how about using "DSIM"? I think S5P_MIPI_DSI or MIPI_DSI is too long.

Quoted 19 lines

arch/arm/mach-s5pv210/setup-mipi.c line 46

Quoted 3 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +3 -0
+}
+
+static int s5p_mipi_enable_dsi_master(struct dsim_device *dsim,

Same.

arch/arm/mach-s5pv210/setup-mipi.c line 51

Quoted 5 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +5 -0
+	unsigned int enable)
+{
+	unsigned int reg;
+
+	reg = readl(S5P_MIPI_CONTROL) & ~(1 << 2);

Same.

arch/arm/mach-s5pv210/setup-mipi.c line 53

Quoted 2 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +2 -0
+	reg |= (enable << 2);
+	writel(reg, S5P_MIPI_CONTROL);

Same.

Quoted 8 lines

arch/arm/mach-s5pv210/setup-mipi.c line 58

Quoted 5 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +5 -0
+
+	return 0;
+}
+
+int s5p_mipi_part_reset(struct dsim_device *dsim)

Do we really need argument, struct dsim_device?

It doesn't. setup-mipi.c is specific to SoC platform. these functions should be registered to mipi-dsi platform data as callbacks in other words, mipi-dsi driver calls them so according to mipi-dsi master framework rule, I added dsim_device as argument. anyway, don't care.

Quoted 11 lines

arch/arm/mach-s5pv210/setup-mipi.c

Quoted 10 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +10 -0
+{
+	writel(S5P_MIPI_M_RESETN, S5P_MIPI_PHY_CON0);
+
+	return 0;
+}
+
+int s5p_mipi_init_d_phy(struct dsim_device *dsim)
+{
+	/**
+	 * DPHY and Master block must be enabled at the system

initialization

Quoted 14 lines

arch/arm/mach-s5pv210/setup-mipi.c

Quoted 9 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +8 -1
+	 * step before data access from/to DPHY begins.
+	 */
+	s5p_mipi_enable_d_phy(dsim, 1);
+
+	s5p_mipi_enable_dsi_master(dsim, 1);
+
+	return 0;
+}
--

I can't get these needs...I mean need to re-think this for support MIPI DSI(M) and MIPI CSI(S).
Actually MIPI control is needed in both.

I agree to your opinion.
it would be corrected, "MIPI" -> "DSIM"

Quoted 10 lines

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#3 lore raw
In reply to Inki Dae
Quoted 131 lines · daeinki

Kukjin Kim 쓴 글:

Quoted 19 lines
Quoted 18 lines · InKi Dae

---
arch/arm/mach-s5pv210/Kconfig | 6 +++ arch/arm/mach-s5pv210/Makefile | 1 + arch/arm/mach-s5pv210/setup-mipi.c | 76
++++++++++++++++++++++++++++++++++++

3 files changed, 83 insertions(+), 0 deletions(-)

create mode 100644 arch/arm/mach-s5pv210/setup-mipi.c

arch/arm/mach-s5pv210/Kconfig +0 -0
index 862f239..76da541 100644
@@ -53,6 +53,11 @@ config S5PV210_SETUP_SDHCI_GPIO

help
Common setup code for SDHCI gpio.

Quoted 9 lines
Quoted 1 line

+config S5P_SETUP_MIPI_DSI

If this is for S5PV210, please use S5PV210_xxx as prefix. Or this is for S5P
SoCS, move into plat-s5p.

And as I know, this is _not_ only for MIPI DSI master...so need to re-name.

Ok, moved to plat-s5p.

Quoted 62 lines
Quoted 8 lines

+ bool
+ help
+ Common setup code for MIPI-DSI
+
menu "S5PC110 Machines"

config MACH_AQUILA

arch/arm/mach-s5pv210/Kconfig +0 -0
@@ -92,6 +97,7 @@ config MACH_GONI
Quoted 4 lines

select S5PV210_SETUP_I2C2
select S5PV210_SETUP_KEYPAD
select S5PV210_SETUP_SDHCI
+ select S5P_SETUP_MIPI_DSI

Is this really only for machine?

Review

Quoted 4 lines

help
Machine support for Samsung GONI board S5PC110(MCP) is one of package option of S5PV210

(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/Makefile

Quoted 42 lines

index ff1a0db..638747c 100644

arch/arm/mach-s5pv210/Makefile +0 -0
@@ -37,3 +37,4 @@ obj-$(CONFIG_S5PV210_SETUP_IDE) +>> setup-ide.o

obj-$(CONFIG_S5PV210_SETUP_KEYPAD) += setup-keypad.o obj-$(CONFIG_S5PV210_SETUP_SDHCI) += setup-sdhci.o obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o

arch/arm/mach-s5pv210/Makefile +1 -0
+obj-$(CONFIG_S5P_SETUP_MIPI_DSI) += setup-mipi.o
\ No newline at end of file
arch/arm/mach- renamed from arch/arm/mach-s5pv210/setup-mipi.c +0 -0

s5pv210/setup-mipi.c
new file mode 100644
index 0000000..2cc8cd1

arch/arm/mach-s5pv210/setup-mipi.c new file +26 -0
@@ -0,0 +1,76 @@
+/* linux/arch/arm/plat-s5p/setup-mipi.c
+ *
+ * Samsung MIPI-DSI DPHY driver.
+ *
+ * Author: InKi Dae <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/io.h>
+#include <linux/err.h>
+#include <linux/platform_device.h>
Quoted 9 lines

arch/arm/mach-s5pv210/setup-mipi.c line 32

Quoted 6 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +6 -0
+#include <linux/clk.h>
+
+#include <mach/map.h>
+#include <mach/regs-clock.h>
+
+#include <plat/mipi-dsi.h>

Hmm...I didn't find this header in your previous patch.

previous patch??

Quoted 27 lines

arch/arm/mach-s5pv210/setup-mipi.c line 33

Quoted 1 line
arch/arm/mach-s5pv210/setup-mipi.c new file +1 -0
+#include <plat/regs-dsim.h>

Same.

Quoted 3 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +2 -0
+
+static int s5p_mipi_enable_d_phy(struct dsim_device *dsim, unsigned int

enable)

Why need struct dsim_device in argument?
As I said, this is for MIPI DSI and MIPI CSI...right?

arch/arm/mach-s5pv210/setup-mipi.c line 39

Quoted 4 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +4 -0
+{
+ unsigned int reg;
+
+ reg = readl(S5P_MIPI_CONTROL) & ~(1 << 0);

Please use __raw_readl here, because no need memory barrier between operations.

Quoted 2 lines

+ reg |= (enable << 0);
+ writel(reg, S5P_MIPI_CONTROL);

Same.

Quoted 2 lines

+
+ return 0;

Quoted 7 lines
Quoted 5 lines

Always, return 0?

If enabled by MIPI DSI and MIPI CSI, how each IP can know other IP's MIPI enalbling?

ok, naming issue sould be considered more.
hm, how about using "DSIM"? I think S5P_MIPI_DSI or MIPI_DSI is too long.

I think that Kukjin's question is not about naming but about the logic behind your interface. If I understand correctly bit 0 in "S5P_MIPI_CONTROL" register is a common enable bit for both the camera and display MIPI PHYs. Only the PHY reset bits are separate for both PHYs. We need to create callbacks for both (DSIM, CSIS) drivers here. And S5P_MIPI_CONTROL register access must be protected from possible races when CSIS and DSIM drivers are trying to use it at the same time. Actually I did some work towards camera interface support, in regards of the PHY control, possibly I can post some RFC patches tomorrow.

I have also tried to exploit the shared I/O region support as described
here: http://lwn.net/Articles/338837 . However it seems not really applicable to our case or would need an extension. And it would add a relatively large overhead for controlling just a single shared memory mapped register..

Regards,
Sylwester

author
#4 lore raw
In reply to Inki Dae

Sylwester Nawrocki 쓴 글:

Quoted 152 lines · daeinki
Quoted 132 lines

Kukjin Kim 쓴 글:

Quoted 19 lines
Quoted 18 lines · InKi Dae

---
arch/arm/mach-s5pv210/Kconfig | 6 +++ arch/arm/mach-s5pv210/Makefile | 1 + arch/arm/mach-s5pv210/setup-mipi.c | 76
++++++++++++++++++++++++++++++++++++

3 files changed, 83 insertions(+), 0 deletions(-)

create mode 100644 arch/arm/mach-s5pv210/setup-mipi.c

arch/arm/mach-s5pv210/Kconfig +0 -0
index 862f239..76da541 100644
@@ -53,6 +53,11 @@ config S5PV210_SETUP_SDHCI_GPIO

help
Common setup code for SDHCI gpio.

Quoted 9 lines
Quoted 1 line

+config S5P_SETUP_MIPI_DSI

If this is for S5PV210, please use S5PV210_xxx as prefix. Or this is for S5P
SoCS, move into plat-s5p.

And as I know, this is _not_ only for MIPI DSI master...so need to re-name.

Ok, moved to plat-s5p.

Quoted 62 lines
Quoted 8 lines

+ bool
+ help
+ Common setup code for MIPI-DSI
+
menu "S5PC110 Machines"

config MACH_AQUILA

arch/arm/mach-s5pv210/Kconfig +0 -0
@@ -92,6 +97,7 @@ config MACH_GONI
Quoted 4 lines

select S5PV210_SETUP_I2C2
select S5PV210_SETUP_KEYPAD
select S5PV210_SETUP_SDHCI
+ select S5P_SETUP_MIPI_DSI

Is this really only for machine?

Review

Quoted 4 lines

help
Machine support for Samsung GONI board S5PC110(MCP) is one of package option of S5PV210

(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/Makefile

Quoted 42 lines

index ff1a0db..638747c 100644

arch/arm/mach-s5pv210/Makefile +0 -0
@@ -37,3 +37,4 @@ obj-$(CONFIG_S5PV210_SETUP_IDE) +>>> setup-ide.o

obj-$(CONFIG_S5PV210_SETUP_KEYPAD) += setup-keypad.o obj-$(CONFIG_S5PV210_SETUP_SDHCI) += setup-sdhci.o obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o

arch/arm/mach-s5pv210/Makefile +1 -0
+obj-$(CONFIG_S5P_SETUP_MIPI_DSI) += setup-mipi.o
\ No newline at end of file
arch/arm/mach- renamed from arch/arm/mach-s5pv210/setup-mipi.c +0 -0

s5pv210/setup-mipi.c
new file mode 100644
index 0000000..2cc8cd1

arch/arm/mach-s5pv210/setup-mipi.c new file +26 -0
@@ -0,0 +1,76 @@
+/* linux/arch/arm/plat-s5p/setup-mipi.c
+ *
+ * Samsung MIPI-DSI DPHY driver.
+ *
+ * Author: InKi Dae <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/io.h>
+#include <linux/err.h>
+#include <linux/platform_device.h>
Quoted 9 lines

arch/arm/mach-s5pv210/setup-mipi.c line 32

Quoted 6 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +6 -0
+#include <linux/clk.h>
+
+#include <mach/map.h>
+#include <mach/regs-clock.h>
+
+#include <plat/mipi-dsi.h>

Hmm...I didn't find this header in your previous patch.

previous patch??

Quoted 28 lines

arch/arm/mach-s5pv210/setup-mipi.c line 33

Quoted 1 line
arch/arm/mach-s5pv210/setup-mipi.c new file +1 -0
+#include <plat/regs-dsim.h>

Same.

Quoted 4 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +2 -0
+
+static int s5p_mipi_enable_d_phy(struct dsim_device *dsim, unsigned 

int
enable)

Why need struct dsim_device in argument?
As I said, this is for MIPI DSI and MIPI CSI...right?

arch/arm/mach-s5pv210/setup-mipi.c line 39

Quoted 4 lines
arch/arm/mach-s5pv210/setup-mipi.c new file +4 -0
+{
+ unsigned int reg;
+
+ reg = readl(S5P_MIPI_CONTROL) & ~(1 << 0);

Please use __raw_readl here, because no need memory barrier between operations.

Quoted 2 lines

+ reg |= (enable << 0);
+ writel(reg, S5P_MIPI_CONTROL);

Same.

Quoted 2 lines

+
+ return 0;

Quoted 8 lines
Quoted 6 lines

Always, return 0?

If enabled by MIPI DSI and MIPI CSI, how each IP can know other IP's MIPI
enalbling?

ok, naming issue sould be considered more.
hm, how about using "DSIM"? I think S5P_MIPI_DSI or MIPI_DSI is too long.

I think that Kukjin's question is not about naming but about the logic behind your interface. If I understand correctly bit 0 in "S5P_MIPI_CONTROL" register is a common enable bit for both the camera and display MIPI PHYs. Only the PHY reset bits are separate for both PHYs. We need to create callbacks for both (DSIM, CSIS) drivers here. And S5P_MIPI_CONTROL register access must be protected from possible races when CSIS and DSIM drivers are trying to use it at the same time. Actually I did some work towards camera interface support, in regards of the PHY control, possibly I can post some RFC patches tomorrow.

Quoted 6 lines

I have also tried to exploit the shared I/O region support as described
here: http://lwn.net/Articles/338837 . However it seems not really applicable to our case or would need an extension. And it would add a relatively large overhead for controlling just a single shared memory mapped register..

I and Mr. Kukjin had discussion about MIPI DPHY issue yesterday.(they, DSI and CSI, share MIPI CONTROL register.) the issue was holded(you tried to resolve that before) so we need to have discussion about that. post your RFC patches please then we could get any good idea.

thank you.

Quoted 7 lines

Regards,
Sylwester

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html