Skip to contentSkip to conversation

peach_pi: Add support for FIMD and DP

PATCH Superseded Ajay Kumar 6 participants 19 messages Dec 5, 2014 – Mar 2, 2015

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Ajay Kumar

author
#0 lore raw

cover peach_pi: Add support for FIMD and DP

Add support for the eDP panel supported on peach_pi.

Sjoerd Simons(1):
[PATCH 1/5] Exynos5800: The Peach-Pi board does not have a Parade video bridge

Ajay Kumar (4):
[PATCH 2/5] arm: exynos: add display clocks for Exynos5800
[PATCH 3/5] Exynos5: Fix rpll_sdiv to support both peach-pit and peach-pi panels [PATCH 4/5] exynos5420: Add LCD and LED powerup settings for peach-pi [PATCH 5/5] peach_pi: dts: Add lcd poweron delay

 arch/arm/cpu/armv7/exynos/clock.c              |   63 +++++++++++++++++++++++-
 arch/arm/cpu/armv7/exynos/clock_init_exynos5.c |    4 +-
 arch/arm/dts/exynos5800-peach-pi.dts           |    6 +--
 arch/arm/include/asm/arch-exynos/clk.h         |    3 ++
 board/samsung/smdk5420/smdk5420.c              |   32 +++++++-----
 5 files changed, 88 insertions(+), 20 deletions(-)
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/5 Exynos5800: The Peach-Pi board does not have a Parade video bridge

From: Sjoerd Simons <[email protected]>

Unlike the Peach-Pit board, there is no parade edp to lvds bridge on the Pi. So drop it from device-tree.

---
 arch/arm/dts/exynos5800-peach-pi.dts |    5 -----
 1 file changed, 5 deletions(-)
arch/arm/dts/exynos5800-peach-pi.dts +0 -5
index 8aedf8e..2f9d2db 100644
@@ -63,11 +63,6 @@
 	              reg = <0x20>;
 	              compatible = "maxim,max98090-codec";
 	       };
-
-	        edp-lvds-bridge at 48 {
-	                compatible = "parade,ps8625";
-	                reg = <0x48>;
-	        };
 	};
 
         sound at 3830000 {
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH 2/5 arm: exynos: add display clocks for Exynos5800

In reply to Ajay Kumar

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5800 needed by exynos video driver.

---
 arch/arm/cpu/armv7/exynos/clock.c      |   63 +++++++++++++++++++++++++++++++-
 arch/arm/include/asm/arch-exynos/clk.h |    3 ++
 2 files changed, 64 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/exynos/clock.c +61 -2
index 8fab135..1a34ad6 100644
@@ -1066,6 +1066,36 @@ static unsigned long exynos5420_get_lcd_clk(void)
 	return pclk;
 }
 
+static unsigned long exynos5800_get_lcd_clk(void)
+{
+	struct exynos5420_clock *clk =
+		(struct exynos5420_clock *)samsung_get_base_clock();
+	unsigned long sclk;
+	unsigned sel;
+	unsigned ratio;
+
+	sel = (readl(&clk->src_disp10) >> 4) & 7;
+
+	/*
+	 * Mapping of CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4] values into
+	 * PLLs. The first element is a placeholder to bypass the
+	 * default settig.
+	 */
+	const int reg_map[] = {0, CPLL, DPLL, MPLL, SPLL,
+			       IPLL, EPLL,  RPLL};
+	if (sel)
+		sclk = get_pll_clk(reg_map[sel]);
+	else
+		sclk = 24000000;
+	/*
+	 * CLK_DIV_DISP10
+	 * FIMD1_RATIO [3:0]
+	 */
+	ratio = readl(&clk->div_disp10) & 0xf;
+
+	return sclk / (ratio + 1);
+}
+
 void exynos4_set_lcd_clk(void)
 {
 	struct exynos4_clock *clk =
@@ -1197,6 +1227,31 @@ void exynos5420_set_lcd_clk(void)
 	writel(cfg, &clk->div_disp10);
 }
 
+void exynos5800_set_lcd_clk(void)
+{
+	struct exynos5420_clock *clk =
+		(struct exynos5420_clock *)samsung_get_base_clock();
+	unsigned int cfg;
+
+	/*
+	 * Use RPLL for pixel clock
+	 * CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4]
+	 * ==================
+	 * 111: SCLK_RPLL
+	 */
+	cfg = readl(&clk->src_disp10) | (7 << 4);
+	writel(cfg, &clk->src_disp10);
+
+	/*
+	 * CLK_DIV_DISP10
+	 * FIMD1_RATIO		[3:0]
+	 */
+	cfg = readl(&clk->div_disp10);
+	cfg &= ~(0xf << 0);
+	cfg |= (0 << 0);
+	writel(cfg, &clk->div_disp10);
+}
+
 void exynos4_set_mipi_clk(void)
 {
 	struct exynos4_clock *clk =
@@ -1669,8 +1724,10 @@ unsigned long get_lcd_clk(void)
 	if (cpu_is_exynos4())
 		return exynos4_get_lcd_clk();
 	else {
-		if (proid_is_exynos5420() || proid_is_exynos5800())
+		if (proid_is_exynos5420())
 			return exynos5420_get_lcd_clk();
+		else if (proid_is_exynos5800())
+			return exynos5800_get_lcd_clk();
 		else
 			return exynos5_get_lcd_clk();
 	}
@@ -1683,8 +1740,10 @@ void set_lcd_clk(void)
 	else {
 		if (proid_is_exynos5250())
 			exynos5_set_lcd_clk();
-		else if (proid_is_exynos5420() || proid_is_exynos5800())
+		else if (proid_is_exynos5420())
 			exynos5420_set_lcd_clk();
+		else
+			exynos5800_set_lcd_clk();
 	}
 }
 
arch/arm/include/asm/arch-exynos/clk.h +3 -0
index db24dc0..bf3d348 100644
@@ -16,6 +16,9 @@
 #define BPLL	5
 #define RPLL	6
 #define SPLL	7
+#define CPLL	8
+#define DPLL	9
+#define IPLL	10
 
 #define MASK_PRE_RATIO(x)	(0xff << ((x << 4) + 8))
 #define MASK_RATIO(x)		(0xf << (x << 4))
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 2/5 arm: exynos: add display clocks for Exynos5800

Dear Ajay Kumar,

Quoted 16 lines · Ajay Kumar

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5800 needed by exynos video driver.

---
 arch/arm/cpu/armv7/exynos/clock.c      |   63
+++++++++++++++++++++++++++++++-
 arch/arm/include/asm/arch-exynos/clk.h |    3 ++
 2 files changed, 64 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/exynos/clock.c +0 -0
index 8fab135..1a34ad6 100644

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void) · line 1075

Quoted 10 lines
arch/arm/cpu/armv7/exynos/clock.c +6 -0
@@ -1066,6 +1066,36 @@ static unsigned long exynos5420_get_lcd_clk(void)
        return pclk;
 }
 
+static unsigned long exynos5800_get_lcd_clk(void)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)samsung_get_base_clock();
+       unsigned long sclk;
+       unsigned sel;
 

just unsigned? why don't you specify in detail?

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void)

Quoted 4 lines
arch/arm/cpu/armv7/exynos/clock.c +3 -0
+       unsigned ratio;
+
+       sel = (readl(&clk->src_disp10) >> 4) & 7;
 

please add comment how you get "sel" from disp10.
and if 7 means mask then please use 0x7. it looks more clearly.

+

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void)

Quoted 8 lines
arch/arm/cpu/armv7/exynos/clock.c +7 -0
+       /*
+        * Mapping of CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4] values into
+        * PLLs. The first element is a placeholder to bypass the
+        * default settig.
+        */
+       const int reg_map[] = {0, CPLL, DPLL, MPLL, SPLL,
+                              IPLL, EPLL,  RPLL};
 

please don't define local variable at middle of function. you can move it to top of the function or
it seems to use sel is true then you can move it into the if statement.

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void) · line 1089

Quoted 5 lines
arch/arm/cpu/armv7/exynos/clock.c +4 -0
+       if (sel)
+               sclk = get_pll_clk(reg_map[sel]);
+       else
+               sclk = 24000000;

please define this value.

Quoted 29 lines
arch/arm/cpu/armv7/exynos/clock.c +22 -0
+       /*
+        * CLK_DIV_DISP10
+        * FIMD1_RATIO [3:0]
+        */
+       ratio = readl(&clk->div_disp10) & 0xf;
+
+       return sclk / (ratio + 1);
+}
+
 void exynos4_set_lcd_clk(void)
 {
        struct exynos4_clock *clk =
@@ -1197,6 +1227,31 @@ void exynos5420_set_lcd_clk(void)
        writel(cfg, &clk->div_disp10);
 }
 
+void exynos5800_set_lcd_clk(void)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)samsung_get_base_clock();
+       unsigned int cfg;
+
+       /*
+        * Use RPLL for pixel clock
+        * CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4]
+        * ==================
+        * 111: SCLK_RPLL
+        */
+       cfg = readl(&clk->src_disp10) | (7 << 4);

arch/arm/cpu/armv7/exynos/clock.c void exynos5420_set_lcd_clk(void) · line 1252

Quoted 10 lines
arch/arm/cpu/armv7/exynos/clock.c +9 -0
+       writel(cfg, &clk->src_disp10);
+
+       /*
+        * CLK_DIV_DISP10
+        * FIMD1_RATIO          [3:0]
+        */
+       cfg = readl(&clk->div_disp10);
+       cfg &= ~(0xf << 0);
+       cfg |= (0 << 0);
 

it looks meaningless.

Quoted 48 lines
arch/arm/cpu/armv7/exynos/clock.c +3 -0
+       writel(cfg, &clk->div_disp10);
+}
+
 void exynos4_set_mipi_clk(void)
 {

struct exynos4_clock *clk =

arch/arm/cpu/armv7/exynos/clock.c +6 -2
@@ -1669,8 +1724,10 @@ unsigned long get_lcd_clk(void)
        if (cpu_is_exynos4())
                return exynos4_get_lcd_clk();
        else {
-               if (proid_is_exynos5420() || proid_is_exynos5800())
+               if (proid_is_exynos5420())
                        return exynos5420_get_lcd_clk();
+               else if (proid_is_exynos5800())
+                       return exynos5800_get_lcd_clk();
                else
                        return exynos5_get_lcd_clk();
        }
@@ -1683,8 +1740,10 @@ void set_lcd_clk(void)
        else {
                if (proid_is_exynos5250())
                        exynos5_set_lcd_clk();
-               else if (proid_is_exynos5420() || proid_is_exynos5800())
+               else if (proid_is_exynos5420())
                        exynos5420_set_lcd_clk();
+               else
+                       exynos5800_set_lcd_clk();
        }
 }
 
arch/arm/include/asm/arch-exynos/clk.h +3 -1
index db24dc0..bf3d348 100644
@@ -16,6 +16,9 @@
 #define BPLL   5
 #define RPLL   6
 #define SPLL   7
+#define CPLL   8
+#define DPLL   9
+#define IPLL   10
 
 #define MASK_PRE_RATIO(x)      (0xff << ((x << 4) + 8))
 #define MASK_RATIO(x)          (0xf << (x << 4))
--

1.7.9.5

Quoted 5 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Thanks,
Minkyu Kang.

Signature · 1 line
from. prom.
#4 lore raw

PATCH 2/5 arm: exynos: add display clocks for Exynos5800

Quoted 174 lines · Minkyu Kang

Dear Ajay Kumar,

Quoted 16 lines · Ajay Kumar

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5800 needed by exynos video driver.

---
 arch/arm/cpu/armv7/exynos/clock.c      |   63
+++++++++++++++++++++++++++++++-
 arch/arm/include/asm/arch-exynos/clk.h |    3 ++
 2 files changed, 64 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/exynos/clock.c +0 -0
index 8fab135..1a34ad6 100644

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void) · line 1075

Quoted 10 lines
arch/arm/cpu/armv7/exynos/clock.c +6 -0
@@ -1066,6 +1066,36 @@ static unsigned long exynos5420_get_lcd_clk(void)
        return pclk;
 }
 
+static unsigned long exynos5800_get_lcd_clk(void)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)samsung_get_base_clock();
+       unsigned long sclk;
+       unsigned sel;
 

just unsigned? why don't you specify in detail?

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void)

Quoted 4 lines
arch/arm/cpu/armv7/exynos/clock.c +3 -0
+       unsigned ratio;
+
+       sel = (readl(&clk->src_disp10) >> 4) & 7;
 

please add comment how you get "sel" from disp10.
and if 7 means mask then please use 0x7. it looks more clearly.

+

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void)

Quoted 8 lines
arch/arm/cpu/armv7/exynos/clock.c +7 -0
+       /*
+        * Mapping of CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4] values into
+        * PLLs. The first element is a placeholder to bypass the
+        * default settig.
+        */
+       const int reg_map[] = {0, CPLL, DPLL, MPLL, SPLL,
+                              IPLL, EPLL,  RPLL};
 

please don't define local variable at middle of function. you can move it to top of the function or
it seems to use sel is true then you can move it into the if statement.

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void) · line 1089

Quoted 5 lines
arch/arm/cpu/armv7/exynos/clock.c +4 -0
+       if (sel)
+               sclk = get_pll_clk(reg_map[sel]);
+       else
+               sclk = 24000000;

please define this value.

Quoted 29 lines
arch/arm/cpu/armv7/exynos/clock.c +22 -0
+       /*
+        * CLK_DIV_DISP10
+        * FIMD1_RATIO [3:0]
+        */
+       ratio = readl(&clk->div_disp10) & 0xf;
+
+       return sclk / (ratio + 1);
+}
+
 void exynos4_set_lcd_clk(void)
 {
        struct exynos4_clock *clk =
@@ -1197,6 +1227,31 @@ void exynos5420_set_lcd_clk(void)
        writel(cfg, &clk->div_disp10);
 }
 
+void exynos5800_set_lcd_clk(void)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)samsung_get_base_clock();
+       unsigned int cfg;
+
+       /*
+        * Use RPLL for pixel clock
+        * CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4]
+        * ==================
+        * 111: SCLK_RPLL
+        */
+       cfg = readl(&clk->src_disp10) | (7 << 4);

arch/arm/cpu/armv7/exynos/clock.c void exynos5420_set_lcd_clk(void) · line 1252

Quoted 10 lines
arch/arm/cpu/armv7/exynos/clock.c +9 -0
+       writel(cfg, &clk->src_disp10);
+
+       /*
+        * CLK_DIV_DISP10
+        * FIMD1_RATIO          [3:0]
+        */
+       cfg = readl(&clk->div_disp10);
+       cfg &= ~(0xf << 0);
+       cfg |= (0 << 0);
 

it looks meaningless.

Quoted 48 lines
arch/arm/cpu/armv7/exynos/clock.c +3 -0
+       writel(cfg, &clk->div_disp10);
+}
+
 void exynos4_set_mipi_clk(void)
 {

struct exynos4_clock *clk =

arch/arm/cpu/armv7/exynos/clock.c +6 -2
@@ -1669,8 +1724,10 @@ unsigned long get_lcd_clk(void)
        if (cpu_is_exynos4())
                return exynos4_get_lcd_clk();
        else {
-               if (proid_is_exynos5420() || proid_is_exynos5800())
+               if (proid_is_exynos5420())
                        return exynos5420_get_lcd_clk();
+               else if (proid_is_exynos5800())
+                       return exynos5800_get_lcd_clk();
                else
                        return exynos5_get_lcd_clk();
        }
@@ -1683,8 +1740,10 @@ void set_lcd_clk(void)
        else {
                if (proid_is_exynos5250())
                        exynos5_set_lcd_clk();
-               else if (proid_is_exynos5420() || proid_is_exynos5800())
+               else if (proid_is_exynos5420())
                        exynos5420_set_lcd_clk();
+               else
+                       exynos5800_set_lcd_clk();
        }
 }
 
arch/arm/include/asm/arch-exynos/clk.h +3 -1
index db24dc0..bf3d348 100644
@@ -16,6 +16,9 @@
 #define BPLL   5
 #define RPLL   6
 #define SPLL   7
+#define CPLL   8
+#define DPLL   9
+#define IPLL   10
 
 #define MASK_PRE_RATIO(x)      (0xff << ((x << 4) + 8))
 #define MASK_RATIO(x)          (0xf << (x << 4))
--

1.7.9.5

Quoted 5 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Thanks,
Minkyu Kang.
--
from. prom.

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#5 lore raw

PATCH 2/5 arm: exynos: add display clocks for Exynos5800

Hi Minkyu,

Quoted 24 lines · Ajay kumar
Quoted 23 lines · Minkyu Kang

Dear Ajay Kumar,

Quoted 19 lines · Ajay Kumar

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5800 needed by exynos video driver.

---
 arch/arm/cpu/armv7/exynos/clock.c      |   63
+++++++++++++++++++++++++++++++-
 arch/arm/include/asm/arch-exynos/clk.h |    3 ++
 2 files changed, 64 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/exynos/clock.c +0 -0
index 8fab135..1a34ad6 100644
@@ -1066,6 +1066,36 @@ static unsigned long exynos5420_get_lcd_clk(void)
        return pclk;
 }
 
Quoted 9 lines
Quoted 9 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void)

Quoted 7 lines
arch/arm/cpu/armv7/exynos/clock.c +6 -0
+static unsigned long exynos5800_get_lcd_clk(void)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)samsung_get_base_clock();
+       unsigned long sclk;
+       unsigned sel;
 

just unsigned? why don't you specify in detail?

I will fix this.

Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void)

Quoted 5 lines
arch/arm/cpu/armv7/exynos/clock.c +3 -0
+       unsigned ratio;
+
+       sel = (readl(&clk->src_disp10) >> 4) & 7;
 

please add comment how you get "sel" from disp10.
and if 7 means mask then please use 0x7. it looks more clearly.

Ok.

Quoted 10 lines
Quoted 10 lines

+

Quoted 8 lines
arch/arm/cpu/armv7/exynos/clock.c +7 -0
+       /*
+        * Mapping of CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4] values into
+        * PLLs. The first element is a placeholder to bypass the
+        * default settig.
+        */
+       const int reg_map[] = {0, CPLL, DPLL, MPLL, SPLL,
+                              IPLL, EPLL,  RPLL};
 
Quoted 3 lines
Quoted 3 lines

please don't define local variable at middle of function. you can move it to top of the function or
it seems to use sel is true then you can move it into the if statement.

I will move this to the top of the function.

Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void) · line 1089

Quoted 6 lines
arch/arm/cpu/armv7/exynos/clock.c +4 -0
+       if (sel)
+               sclk = get_pll_clk(reg_map[sel]);
+       else
+               sclk = 24000000;

please define this value.

Ok.

Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
arch/arm/cpu/armv7/exynos/clock.c +26 -0
+       /*
+        * CLK_DIV_DISP10
+        * FIMD1_RATIO [3:0]
+        */
+       ratio = readl(&clk->div_disp10) & 0xf;
+
+       return sclk / (ratio + 1);
+}
+
 void exynos4_set_lcd_clk(void)
 {
        struct exynos4_clock *clk =
@@ -1197,6 +1227,31 @@ void exynos5420_set_lcd_clk(void)
        writel(cfg, &clk->div_disp10);
 }
 
+void exynos5800_set_lcd_clk(void)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)samsung_get_base_clock();
+       unsigned int cfg;
+
+       /*
+        * Use RPLL for pixel clock
+        * CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4]
+        * ==================
+        * 111: SCLK_RPLL
+        */
+       cfg = readl(&clk->src_disp10) | (7 << 4);
+       writel(cfg, &clk->src_disp10);
+
+       /*
+        * CLK_DIV_DISP10
Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c void exynos5420_set_lcd_clk(void)

Quoted 6 lines
arch/arm/cpu/armv7/exynos/clock.c +5 -0
+        * FIMD1_RATIO          [3:0]
+        */
+       cfg = readl(&clk->div_disp10);
+       cfg &= ~(0xf << 0);
+       cfg |= (0 << 0);
 

it looks meaningless.

Why not?
I agree that the calculation can be skipped, and directly FIMD clock divider can be set to 0. But, I prefer to keep the readability. In fact, similar "meaningless" code is already part of the tree:
http://git.denx.de/?p=u-boot/u-boot-samsung.git;a=blob;f=arch/arm/cpu/armv7/exynos/clock.c;h=8fab135bebf4ef6900677847b60a8e1a1520254c;hb=HEAD#l1194

Ajay

Quoted 66 lines
Quoted 66 lines
Quoted 49 lines
arch/arm/cpu/armv7/exynos/clock.c +3 -0
+       writel(cfg, &clk->div_disp10);
+}
+
 void exynos4_set_mipi_clk(void)
 {

struct exynos4_clock *clk =

arch/arm/cpu/armv7/exynos/clock.c +6 -2
@@ -1669,8 +1724,10 @@ unsigned long get_lcd_clk(void)
        if (cpu_is_exynos4())
                return exynos4_get_lcd_clk();
        else {
-               if (proid_is_exynos5420() || proid_is_exynos5800())
+               if (proid_is_exynos5420())
                        return exynos5420_get_lcd_clk();
+               else if (proid_is_exynos5800())
+                       return exynos5800_get_lcd_clk();
                else
                        return exynos5_get_lcd_clk();
        }
@@ -1683,8 +1740,10 @@ void set_lcd_clk(void)
        else {
                if (proid_is_exynos5250())
                        exynos5_set_lcd_clk();
-               else if (proid_is_exynos5420() || proid_is_exynos5800())
+               else if (proid_is_exynos5420())
                        exynos5420_set_lcd_clk();
+               else
+                       exynos5800_set_lcd_clk();
        }
 }
 
arch/arm/include/asm/arch-exynos/clk.h +3 -1
index db24dc0..bf3d348 100644
@@ -16,6 +16,9 @@
 #define BPLL   5
 #define RPLL   6
 #define SPLL   7
+#define CPLL   8
+#define DPLL   9
+#define IPLL   10
 
 #define MASK_PRE_RATIO(x)      (0xff << ((x << 4) + 8))
 #define MASK_RATIO(x)          (0xf << (x << 4))
--

1.7.9.5

Quoted 5 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Thanks,
Minkyu Kang.
--
from. prom.

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#6 lore raw

PATCH 2/5 arm: exynos: add display clocks for Exynos5800

Hi Ajay,

Quoted 118 lines · Ajay kumar

Hi Minkyu,

Quoted 4 lines · Ajay kumar
Quoted 3 lines · Minkyu Kang

Dear Ajay Kumar,

On 5 December 2014 at 23:13, Ajay Kumar <[email protected]>

Quoted 11 lines · wrote:
Quoted 11 lines
Quoted 11 lines

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5800 needed by exynos video driver.

---
 arch/arm/cpu/armv7/exynos/clock.c      |   63
+++++++++++++++++++++++++++++++-
 arch/arm/include/asm/arch-exynos/clk.h |    3 ++
 2 files changed, 64 insertions(+), 2 deletions(-)
Quoted 6 lines
Quoted 6 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long

Quoted 6 lines
arch/arm/cpu/armv7/exynos/clock.c +0 -0
index 8fab135..1a34ad6 100644
@@ -1066,6 +1066,36 @@ static unsigned long

exynos5420_get_lcd_clk(void)

Quoted 12 lines
Quoted 12 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void)

Quoted 10 lines
arch/arm/cpu/armv7/exynos/clock.c +6 -0
        return pclk;
 }
 
+static unsigned long exynos5800_get_lcd_clk(void)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)samsung_get_base_clock();
+       unsigned long sclk;
+       unsigned sel;
 

just unsigned? why don't you specify in detail?

I will fix this.

Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void)

Quoted 5 lines
arch/arm/cpu/armv7/exynos/clock.c +3 -0
+       unsigned ratio;
+
+       sel = (readl(&clk->src_disp10) >> 4) & 7;
 

please add comment how you get "sel" from disp10.
and if 7 means mask then please use 0x7. it looks more clearly.

Ok.

Quoted 10 lines
Quoted 10 lines

+

Quoted 8 lines
arch/arm/cpu/armv7/exynos/clock.c +7 -0
+       /*
+        * Mapping of CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4] values into
+        * PLLs. The first element is a placeholder to bypass the
+        * default settig.
+        */
+       const int reg_map[] = {0, CPLL, DPLL, MPLL, SPLL,
+                              IPLL, EPLL,  RPLL};
 
Quoted 3 lines
Quoted 3 lines

please don't define local variable at middle of function. you can move it to top of the function or
it seems to use sel is true then you can move it into the if statement.

I will move this to the top of the function.

Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void) · line 1089

Quoted 6 lines
arch/arm/cpu/armv7/exynos/clock.c +4 -0
+       if (sel)
+               sclk = get_pll_clk(reg_map[sel]);
+       else
+               sclk = 24000000;

please define this value.

Ok.

Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
arch/arm/cpu/armv7/exynos/clock.c +26 -0
+       /*
+        * CLK_DIV_DISP10
+        * FIMD1_RATIO [3:0]
+        */
+       ratio = readl(&clk->div_disp10) & 0xf;
+
+       return sclk / (ratio + 1);
+}
+
 void exynos4_set_lcd_clk(void)
 {
        struct exynos4_clock *clk =
@@ -1197,6 +1227,31 @@ void exynos5420_set_lcd_clk(void)
        writel(cfg, &clk->div_disp10);
 }
 
+void exynos5800_set_lcd_clk(void)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)samsung_get_base_clock();
+       unsigned int cfg;
+
+       /*
+        * Use RPLL for pixel clock
+        * CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4]
+        * ==================
+        * 111: SCLK_RPLL
+        */
+       cfg = readl(&clk->src_disp10) | (7 << 4);
+       writel(cfg, &clk->src_disp10);
+
+       /*
+        * CLK_DIV_DISP10
Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c void exynos5420_set_lcd_clk(void)

Quoted 6 lines
arch/arm/cpu/armv7/exynos/clock.c +5 -0
+        * FIMD1_RATIO          [3:0]
+        */
+       cfg = readl(&clk->div_disp10);
+       cfg &= ~(0xf << 0);
+       cfg |= (0 << 0);
 

it looks meaningless.

Quoted 6 lines

Why not?
I agree that the calculation can be skipped, and directly FIMD clock divider can be set to 0. But, I prefer to keep the readability. In fact, similar "meaningless" code is already part of the tree:

http://git.denx.de/?p=u-boot/u-boot-samsung.git;a=blob;f=arch/arm/cpu/armv7/exynos/clock.c;h=8fab135bebf4ef6900677847b60a8e1a1520254c;hb=HEAD#l1194

Well perhaps a #define for the shift value? Then it would mean something.

Also this can probably use clrsetbits_le32().

Regards,
Simon

#7 lore raw

PATCH 2/5 arm: exynos: add display clocks for Exynos5800

Hi Ajay,

Quoted 128 lines · Simon Glass

Hi Ajay,

Quoted 124 lines · Ajay kumar

Hi Minkyu,

Quoted 26 lines · Ajay kumar
Quoted 25 lines · Minkyu Kang

Dear Ajay Kumar,

Quoted 20 lines · Ajay Kumar

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5800 needed by exynos video driver.

---
 arch/arm/cpu/armv7/exynos/clock.c      |   63
+++++++++++++++++++++++++++++++-
 arch/arm/include/asm/arch-exynos/clk.h |    3 ++
 2 files changed, 64 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/exynos/clock.c +0 -0
index 8fab135..1a34ad6 100644
@@ -1066,6 +1066,36 @@ static unsigned long
 exynos5420_get_lcd_clk(void)
        return pclk;
 }
 
Quoted 9 lines
Quoted 9 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void)

Quoted 7 lines
arch/arm/cpu/armv7/exynos/clock.c +6 -0
+static unsigned long exynos5800_get_lcd_clk(void)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)samsung_get_base_clock();
+       unsigned long sclk;
+       unsigned sel;
 

just unsigned? why don't you specify in detail?

I will fix this.

Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void)

Quoted 5 lines
arch/arm/cpu/armv7/exynos/clock.c +3 -0
+       unsigned ratio;
+
+       sel = (readl(&clk->src_disp10) >> 4) & 7;
 

please add comment how you get "sel" from disp10.
and if 7 means mask then please use 0x7. it looks more clearly.

Ok.

Quoted 10 lines
Quoted 10 lines

+

Quoted 8 lines
arch/arm/cpu/armv7/exynos/clock.c +7 -0
+       /*
+        * Mapping of CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4] values into
+        * PLLs. The first element is a placeholder to bypass the
+        * default settig.
+        */
+       const int reg_map[] = {0, CPLL, DPLL, MPLL, SPLL,
+                              IPLL, EPLL,  RPLL};
Quoted 3 lines
Quoted 3 lines

please don't define local variable at middle of function. you can move it to top of the function or
it seems to use sel is true then you can move it into the if statement.

I will move this to the top of the function.

Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void) · line 1089

Quoted 6 lines
arch/arm/cpu/armv7/exynos/clock.c +4 -0
+       if (sel)
+               sclk = get_pll_clk(reg_map[sel]);
+       else
+               sclk = 24000000;

please define this value.

Ok.

Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
arch/arm/cpu/armv7/exynos/clock.c +26 -0
+       /*
+        * CLK_DIV_DISP10
+        * FIMD1_RATIO [3:0]
+        */
+       ratio = readl(&clk->div_disp10) & 0xf;
+
+       return sclk / (ratio + 1);
+}
+
 void exynos4_set_lcd_clk(void)
 {
        struct exynos4_clock *clk =
@@ -1197,6 +1227,31 @@ void exynos5420_set_lcd_clk(void)
        writel(cfg, &clk->div_disp10);
 }
 
+void exynos5800_set_lcd_clk(void)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)samsung_get_base_clock();
+       unsigned int cfg;
+
+       /*
+        * Use RPLL for pixel clock
+        * CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4]
+        * ==================
+        * 111: SCLK_RPLL
+        */
+       cfg = readl(&clk->src_disp10) | (7 << 4);
+       writel(cfg, &clk->src_disp10);
+
+       /*
+        * CLK_DIV_DISP10
Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c void exynos5420_set_lcd_clk(void)

Quoted 6 lines
arch/arm/cpu/armv7/exynos/clock.c +5 -0
+        * FIMD1_RATIO          [3:0]
+        */
+       cfg = readl(&clk->div_disp10);
+       cfg &= ~(0xf << 0);
+       cfg |= (0 << 0);
 

it looks meaningless.

Why not?
I agree that the calculation can be skipped, and directly FIMD clock divider can be set to 0. But, I prefer to keep the readability. In fact, similar "meaningless" code is already part of the tree:

Quoted 6 lines
Quoted 1 line

http://git.denx.de/?p=u-boot/u-boot-samsung.git;a=blob;f=arch/arm/cpu/armv7/exynos/clock.c;h=8fab135bebf4ef6900677847b60a8e1a1520254c;hb=HEAD#l1194

Well perhaps a #define for the shift value? Then it would mean something.

Also this can probably use clrsetbits_le32().

This is one of four patches that I think were never applied and need a respin. Are you able to do that? Then Pi LCD will work OK I think.

http://patchwork.ozlabs.org/patch/418116/
http://patchwork.ozlabs.org/patch/418117/
http://patchwork.ozlabs.org/patch/418118/
http://patchwork.ozlabs.org/patch/418119/

Regards.
Simon

#8 lore raw

PATCH 2/5 arm: exynos: add display clocks for Exynos5800

Hi Simon,

Quoted 134 lines · Simon Glass

Hi Ajay,

Quoted 131 lines · Simon Glass

Hi Ajay,

Quoted 125 lines · Ajay kumar

Hi Minkyu,

Quoted 26 lines · Ajay kumar
Quoted 25 lines · Minkyu Kang

Dear Ajay Kumar,

Quoted 20 lines · Ajay Kumar

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5800 needed by exynos video driver.

---
 arch/arm/cpu/armv7/exynos/clock.c      |   63
+++++++++++++++++++++++++++++++-
 arch/arm/include/asm/arch-exynos/clk.h |    3 ++
 2 files changed, 64 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/exynos/clock.c +0 -0
index 8fab135..1a34ad6 100644
@@ -1066,6 +1066,36 @@ static unsigned long
 exynos5420_get_lcd_clk(void)
        return pclk;
 }
 
Quoted 9 lines
Quoted 9 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void)

Quoted 7 lines
arch/arm/cpu/armv7/exynos/clock.c +6 -0
+static unsigned long exynos5800_get_lcd_clk(void)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)samsung_get_base_clock();
+       unsigned long sclk;
+       unsigned sel;
 

just unsigned? why don't you specify in detail?

I will fix this.

Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void)

Quoted 5 lines
arch/arm/cpu/armv7/exynos/clock.c +3 -0
+       unsigned ratio;
+
+       sel = (readl(&clk->src_disp10) >> 4) & 7;
 

please add comment how you get "sel" from disp10.
and if 7 means mask then please use 0x7. it looks more clearly.

Ok.

Quoted 10 lines
Quoted 10 lines

+

Quoted 8 lines
arch/arm/cpu/armv7/exynos/clock.c +7 -0
+       /*
+        * Mapping of CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4] values into
+        * PLLs. The first element is a placeholder to bypass the
+        * default settig.
+        */
+       const int reg_map[] = {0, CPLL, DPLL, MPLL, SPLL,
+                              IPLL, EPLL,  RPLL};
Quoted 3 lines
Quoted 3 lines

please don't define local variable at middle of function. you can move it to top of the function or
it seems to use sel is true then you can move it into the if statement.

I will move this to the top of the function.

Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long exynos5420_get_lcd_clk(void) · line 1089

Quoted 6 lines
arch/arm/cpu/armv7/exynos/clock.c +4 -0
+       if (sel)
+               sclk = get_pll_clk(reg_map[sel]);
+       else
+               sclk = 24000000;

please define this value.

Ok.

Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
arch/arm/cpu/armv7/exynos/clock.c +26 -0
+       /*
+        * CLK_DIV_DISP10
+        * FIMD1_RATIO [3:0]
+        */
+       ratio = readl(&clk->div_disp10) & 0xf;
+
+       return sclk / (ratio + 1);
+}
+
 void exynos4_set_lcd_clk(void)
 {
        struct exynos4_clock *clk =
@@ -1197,6 +1227,31 @@ void exynos5420_set_lcd_clk(void)
        writel(cfg, &clk->div_disp10);
 }
 
+void exynos5800_set_lcd_clk(void)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)samsung_get_base_clock();
+       unsigned int cfg;
+
+       /*
+        * Use RPLL for pixel clock
+        * CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4]
+        * ==================
+        * 111: SCLK_RPLL
+        */
+       cfg = readl(&clk->src_disp10) | (7 << 4);
+       writel(cfg, &clk->src_disp10);
+
+       /*
+        * CLK_DIV_DISP10
Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c void exynos5420_set_lcd_clk(void)

Quoted 6 lines
arch/arm/cpu/armv7/exynos/clock.c +5 -0
+        * FIMD1_RATIO          [3:0]
+        */
+       cfg = readl(&clk->div_disp10);
+       cfg &= ~(0xf << 0);
+       cfg |= (0 << 0);
 

it looks meaningless.

Why not?
I agree that the calculation can be skipped, and directly FIMD clock divider can be set to 0. But, I prefer to keep the readability. In fact, similar "meaningless" code is already part of the tree:

http://git.denx.de/?p=u-boot/u-boot-samsung.git;a=blob;f=arch/arm/cpu/armv7/exynos/clock.c;h=8fab135bebf4ef6900677847b60a8e1a1520254c;hb=HEAD#l1194

Quoted 6 lines
Quoted 3 lines

Well perhaps a #define for the shift value? Then it would mean something.

Also this can probably use clrsetbits_le32().

This is one of four patches that I think were never applied and need a respin. Are you able to do that? Then Pi LCD will work OK I think.

Yes, I am respinning this patch. Also, trying to move out GPIOs from smdk5420.c. Will be posting them tomorrow.

Ajay

Quoted 7 lines

http://patchwork.ozlabs.org/patch/418116/
http://patchwork.ozlabs.org/patch/418117/
http://patchwork.ozlabs.org/patch/418118/
http://patchwork.ozlabs.org/patch/418119/

Regards.
Simon

#9 lore raw

PATCH 2/5 arm: exynos: add display clocks for Exynos5800

Hi Ajay,

Quoted 137 lines · Ajay kumar

Hi Simon,

Quoted 134 lines · Simon Glass

Hi Ajay,

Quoted 131 lines · Simon Glass

Hi Ajay,

Quoted 125 lines · Ajay kumar

Hi Minkyu,

Quoted 26 lines · Ajay kumar
Quoted 25 lines · Minkyu Kang

Dear Ajay Kumar,

Quoted 20 lines · Ajay Kumar

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5800 needed by exynos video driver.

---
 arch/arm/cpu/armv7/exynos/clock.c      |   63
+++++++++++++++++++++++++++++++-
 arch/arm/include/asm/arch-exynos/clk.h |    3 ++
 2 files changed, 64 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/exynos/clock.c +0 -0
index 8fab135..1a34ad6 100644
@@ -1066,6 +1066,36 @@ static unsigned long
 exynos5420_get_lcd_clk(void)
        return pclk;
 }
 
Quoted 9 lines
Quoted 9 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long · line 1076

Quoted 7 lines
arch/arm/cpu/armv7/exynos/clock.c +6 -0
+static unsigned long exynos5800_get_lcd_clk(void)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)samsung_get_base_clock();
+       unsigned long sclk;
+       unsigned sel;
 

just unsigned? why don't you specify in detail?

I will fix this.

Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long · line 1080

Quoted 5 lines
arch/arm/cpu/armv7/exynos/clock.c +3 -0
+       unsigned ratio;
+
+       sel = (readl(&clk->src_disp10) >> 4) & 7;
 

please add comment how you get "sel" from disp10.
and if 7 means mask then please use 0x7. it looks more clearly.

Ok.

Quoted 10 lines
Quoted 10 lines

+

Quoted 8 lines
arch/arm/cpu/armv7/exynos/clock.c +7 -0
+       /*
+        * Mapping of CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4] values into
+        * PLLs. The first element is a placeholder to bypass the
+        * default settig.
+        */
+       const int reg_map[] = {0, CPLL, DPLL, MPLL, SPLL,
+                              IPLL, EPLL,  RPLL};
Quoted 3 lines
Quoted 3 lines

please don't define local variable at middle of function. you can move it to top of the function or
it seems to use sel is true then you can move it into the if statement.

I will move this to the top of the function.

Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c static unsigned long · line 1091

Quoted 6 lines
arch/arm/cpu/armv7/exynos/clock.c +4 -0
+       if (sel)
+               sclk = get_pll_clk(reg_map[sel]);
+       else
+               sclk = 24000000;

please define this value.

Ok.

Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
arch/arm/cpu/armv7/exynos/clock.c +26 -0
+       /*
+        * CLK_DIV_DISP10
+        * FIMD1_RATIO [3:0]
+        */
+       ratio = readl(&clk->div_disp10) & 0xf;
+
+       return sclk / (ratio + 1);
+}
+
 void exynos4_set_lcd_clk(void)
 {
        struct exynos4_clock *clk =
@@ -1197,6 +1227,31 @@ void exynos5420_set_lcd_clk(void)
        writel(cfg, &clk->div_disp10);
 }
 
+void exynos5800_set_lcd_clk(void)
+{
+       struct exynos5420_clock *clk =
+               (struct exynos5420_clock *)samsung_get_base_clock();
+       unsigned int cfg;
+
+       /*
+        * Use RPLL for pixel clock
+        * CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4]
+        * ==================
+        * 111: SCLK_RPLL
+        */
+       cfg = readl(&clk->src_disp10) | (7 << 4);
+       writel(cfg, &clk->src_disp10);
+
+       /*
+        * CLK_DIV_DISP10
Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c void exynos5420_set_lcd_clk(void) · line 1252

Quoted 6 lines
arch/arm/cpu/armv7/exynos/clock.c +5 -0
+        * FIMD1_RATIO          [3:0]
+        */
+       cfg = readl(&clk->div_disp10);
+       cfg &= ~(0xf << 0);
+       cfg |= (0 << 0);
 

it looks meaningless.

Why not?
I agree that the calculation can be skipped, and directly FIMD clock divider can be set to 0. But, I prefer to keep the readability. In fact, similar "meaningless" code is already part of the tree:

http://git.denx.de/?p=u-boot/u-boot-samsung.git;a=blob;f=arch/arm/cpu/armv7/exynos/clock.c;h=8fab135bebf4ef6900677847b60a8e1a1520254c;hb=HEAD#l1194

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Well perhaps a #define for the shift value? Then it would mean something.

Also this can probably use clrsetbits_le32().

This is one of four patches that I think were never applied and need a respin. Are you able to do that? Then Pi LCD will work OK I think.

Yes, I am respinning this patch. Also, trying to move out GPIOs from smdk5420.c. Will be posting them tomorrow.

OK great. You might find gpio_request_by_name() useful, and gpio_request_by_name_nodev() where the thing requesting the GPIOs does not use driver model yet.

Regards,
Simon

author
#10 lore raw

PATCH 3/5 Exynos5: Fix rpll_sdiv to support both peach-pit and peach-pi panels

In reply to Ajay Kumar

The existing setting for rpll_sdiv generates 70.5Mhz RPLL video clock to drive 1366x768 panel on peach_pit.

This clock rate is not sufficient to drive 1920x1080 panel on peach-pi. So, we adjust rpll_sdiv to 3 so that it generates 141Mhz pixel clock which can drive peach-pi LCD.

This change doesn't break peach-pit LCD since 141/2=70.5Mhz, i.e FIMD divider at IP level will get set to 1(the required divider setting will be calculated and set by exynos_fimd_set_clock()) and hence peach-pit LCD still works fine.

---
 arch/arm/cpu/armv7/exynos/clock_init_exynos5.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/exynos/clock_init_exynos5.c +2 -2
index 0aff3d0..0200fd1 100644
@@ -179,10 +179,10 @@ struct mem_timings mem_timings[] = {
 		.spll_mdiv = 0xc8,
 		.spll_pdiv = 0x3,
 		.spll_sdiv = 0x2,
-		/* RPLL @70.5Mhz */
+		/* RPLL @141Mhz */
 		.rpll_mdiv = 0x5E,
 		.rpll_pdiv = 0x2,
-		.rpll_sdiv = 0x4,
+		.rpll_sdiv = 0x3,
 
 		.direct_cmd_msr = {
 			0x00020018, 0x00030000, 0x00010046, 0x00000d70,
Signature · 1 line
1.7.9.5
author
#11 lore raw

PATCH 4/5 exynos5420: Add LCD and LED powerup settings for peach-pi

In reply to Ajay Kumar

Add code to support powerup sequence for peach-pi LCD.

---
 board/samsung/smdk5420/smdk5420.c |   32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)
board/samsung/smdk5420/smdk5420.c +21 -11
index a691222..915125e 100644
@@ -73,19 +73,24 @@ void exynos_lcd_power_on(void)
 
 	mdelay(5);
 
-	/* TODO(ajaykumar.rs at samsung.com): Use device tree */
-	gpio_request(EXYNOS5420_GPIO_X35, "edp_slp#");
-	gpio_direction_output(EXYNOS5420_GPIO_X35, 1);	/* EDP_SLP# */
-	mdelay(10);
-	gpio_request(EXYNOS5420_GPIO_Y77, "edp_rst#");
-	gpio_direction_output(EXYNOS5420_GPIO_Y77, 1);	/* EDP_RST# */
-	gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
-	gpio_direction_input(EXYNOS5420_GPIO_X26);	/* EDP_HPD */
-	gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
-
-	if (has_edp_bridge())
+	if (has_edp_bridge()) {
+		/* TODO(ajaykumar.rs at samsung.com): Use device tree */
+		gpio_request(EXYNOS5420_GPIO_X35, "edp_slp#");
+		gpio_direction_output(EXYNOS5420_GPIO_X35, 1);	/* EDP_SLP# */
+		mdelay(10);
+		gpio_request(EXYNOS5420_GPIO_Y77, "edp_rst#");
+		gpio_direction_output(EXYNOS5420_GPIO_Y77, 1);	/* EDP_RST# */
+		gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
+		gpio_direction_input(EXYNOS5420_GPIO_X26);	/* EDP_HPD */
+		gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
+
 		if (parade_init(gd->fdt_blob))
 			printf("%s: ps8625_init() failed\n", __func__);
+	} else {
+		gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
+		gpio_direction_input(EXYNOS5420_GPIO_X26);	/* EDP_HPD */
+		gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
+	}
 }
 
 void exynos_backlight_on(unsigned int onoff)
@@ -98,6 +103,11 @@ void exynos_backlight_on(unsigned int onoff)
 #ifdef CONFIG_POWER_TPS65090
 	tps65090_fet_enable(1);
 #endif
+
+	if (!has_edp_bridge()) {
+		gpio_request(EXYNOS5420_GPIO_X22, "bl_en");
+		gpio_direction_output(EXYNOS5420_GPIO_X22, 1);
+	}
 }
 #endif
 
Signature · 1 line
1.7.9.5
#12 lore raw

PATCH 4/5 exynos5420: Add LCD and LED powerup settings for peach-pi

Quoted 34 lines · Ajay Kumar

Add code to support powerup sequence for peach-pi LCD.

---
 board/samsung/smdk5420/smdk5420.c |   32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)
board/samsung/smdk5420/smdk5420.c +8 -11
index a691222..915125e 100644
@@ -73,19 +73,24 @@ void exynos_lcd_power_on(void)
 
 	mdelay(5);
 
-	/* TODO(ajaykumar.rs at samsung.com): Use device tree */
-	gpio_request(EXYNOS5420_GPIO_X35, "edp_slp#");
-	gpio_direction_output(EXYNOS5420_GPIO_X35, 1);	/* EDP_SLP# */
-	mdelay(10);
-	gpio_request(EXYNOS5420_GPIO_Y77, "edp_rst#");
-	gpio_direction_output(EXYNOS5420_GPIO_Y77, 1);	/* EDP_RST# */
-	gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
-	gpio_direction_input(EXYNOS5420_GPIO_X26);	/* EDP_HPD */
-	gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
-
-	if (has_edp_bridge())
+	if (has_edp_bridge()) {
+		/* TODO(ajaykumar.rs at samsung.com): Use device tree */
+		gpio_request(EXYNOS5420_GPIO_X35, "edp_slp#");
+		gpio_direction_output(EXYNOS5420_GPIO_X35, 1);	/* EDP_SLP# */
+		mdelay(10);
+		gpio_request(EXYNOS5420_GPIO_Y77, "edp_rst#");
+		gpio_direction_output(EXYNOS5420_GPIO_Y77, 1);	/* EDP_RST# */
+		gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");

board/samsung/smdk5420/smdk5420.c void exynos_lcd_power_on(void) · line 93

Quoted 10 lines
board/samsung/smdk5420/smdk5420.c +8 -0
+		gpio_direction_input(EXYNOS5420_GPIO_X26);	/* EDP_HPD */
+		gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
+
 		if (parade_init(gd->fdt_blob))
 			printf("%s: ps8625_init() failed\n", __func__);
+	} else {
+		gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
+		gpio_direction_input(EXYNOS5420_GPIO_X26);	/* EDP_HPD */
+		gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
+	}

Any chance you could switch to using device-tree while changing this area. On SMDK5420 and XU3 EXYNOS5420_GPIO_X26 is used for USB so there is a bit of a potentially nastly clash there.

Signature · 9 lines
Sjoerd Simons <[email protected]>
Collabora Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6170 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141205/436f21b3/attachment.bin>
#13 lore raw

PATCH 4/5 exynos5420: Add LCD and LED powerup settings for peach-pi

Hi,

Quoted 41 lines · Sjoerd Simons
Quoted 40 lines · Ajay Kumar

Add code to support powerup sequence for peach-pi LCD.

---
 board/samsung/smdk5420/smdk5420.c |   32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)
board/samsung/smdk5420/smdk5420.c +12 -11
index a691222..915125e 100644
@@ -73,19 +73,24 @@ void exynos_lcd_power_on(void)
 
      mdelay(5);
 
-     /* TODO(ajaykumar.rs at samsung.com): Use device tree */
-     gpio_request(EXYNOS5420_GPIO_X35, "edp_slp#");
-     gpio_direction_output(EXYNOS5420_GPIO_X35, 1);  /* EDP_SLP# */
-     mdelay(10);
-     gpio_request(EXYNOS5420_GPIO_Y77, "edp_rst#");
-     gpio_direction_output(EXYNOS5420_GPIO_Y77, 1);  /* EDP_RST# */
-     gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
-     gpio_direction_input(EXYNOS5420_GPIO_X26);      /* EDP_HPD */
-     gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
-
-     if (has_edp_bridge())
+     if (has_edp_bridge()) {
+             /* TODO(ajaykumar.rs at samsung.com): Use device tree */
+             gpio_request(EXYNOS5420_GPIO_X35, "edp_slp#");
+             gpio_direction_output(EXYNOS5420_GPIO_X35, 1);  /* EDP_SLP# */
+             mdelay(10);
+             gpio_request(EXYNOS5420_GPIO_Y77, "edp_rst#");
+             gpio_direction_output(EXYNOS5420_GPIO_Y77, 1);  /* EDP_RST# */
+             gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
+             gpio_direction_input(EXYNOS5420_GPIO_X26);      /* EDP_HPD */
+             gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
+
              if (parade_init(gd->fdt_blob))
                      printf("%s: ps8625_init() failed\n", __func__);
+     } else {
Quoted 8 lines

board/samsung/smdk5420/smdk5420.c void exynos_lcd_power_on(void) · line 93

Quoted 4 lines
board/samsung/smdk5420/smdk5420.c +4 -0
+             gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
+             gpio_direction_input(EXYNOS5420_GPIO_X26);      /* EDP_HPD */
+             gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
+     }

Any chance you could switch to using device-tree while changing this area. On SMDK5420 and XU3 EXYNOS5420_GPIO_X26 is used for USB so there is a bit of a potentially nastly clash there.

Yes we should really do that.

Regards,
Simon

#14 lore raw

PATCH 4/5 exynos5420: Add LCD and LED powerup settings for peach-pi

Hi,

Quoted 54 lines · Simon Glass

Hi,

Quoted 41 lines · Sjoerd Simons
Quoted 40 lines · Ajay Kumar

Add code to support powerup sequence for peach-pi LCD.

---
 board/samsung/smdk5420/smdk5420.c |   32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)
board/samsung/smdk5420/smdk5420.c +12 -11
index a691222..915125e 100644
@@ -73,19 +73,24 @@ void exynos_lcd_power_on(void)
 
      mdelay(5);
 
-     /* TODO(ajaykumar.rs at samsung.com): Use device tree */
-     gpio_request(EXYNOS5420_GPIO_X35, "edp_slp#");
-     gpio_direction_output(EXYNOS5420_GPIO_X35, 1);  /* EDP_SLP# */
-     mdelay(10);
-     gpio_request(EXYNOS5420_GPIO_Y77, "edp_rst#");
-     gpio_direction_output(EXYNOS5420_GPIO_Y77, 1);  /* EDP_RST# */
-     gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
-     gpio_direction_input(EXYNOS5420_GPIO_X26);      /* EDP_HPD */
-     gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
-
-     if (has_edp_bridge())
+     if (has_edp_bridge()) {
+             /* TODO(ajaykumar.rs at samsung.com): Use device tree */
+             gpio_request(EXYNOS5420_GPIO_X35, "edp_slp#");
+             gpio_direction_output(EXYNOS5420_GPIO_X35, 1);  /* EDP_SLP# */
+             mdelay(10);
+             gpio_request(EXYNOS5420_GPIO_Y77, "edp_rst#");
+             gpio_direction_output(EXYNOS5420_GPIO_Y77, 1);  /* EDP_RST# */
+             gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
+             gpio_direction_input(EXYNOS5420_GPIO_X26);      /* EDP_HPD */
+             gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
+
              if (parade_init(gd->fdt_blob))
                      printf("%s: ps8625_init() failed\n", __func__);
+     } else {
Quoted 8 lines

board/samsung/smdk5420/smdk5420.c void exynos_lcd_power_on(void) · line 93

Quoted 4 lines
board/samsung/smdk5420/smdk5420.c +4 -0
+             gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
+             gpio_direction_input(EXYNOS5420_GPIO_X26);      /* EDP_HPD */
+             gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
+     }

Any chance you could switch to using device-tree while changing this area. On SMDK5420 and XU3 EXYNOS5420_GPIO_X26 is used for USB so there is a bit of a potentially nastly clash there.

Quoted 1 line

Yes we should really do that.

I am trying to consolidate what all needs to be done for Exynos5250 and Exynos5420,
in order to remove LCD routines from the board files.
Here are my observations:
1) A separate driver for ptn3460 should be created.
2) Need a place holder for tps65090 FET settings.
3) I am planning to move all the LCD_EN/BACKLIGHT_EN GPIOs
to the "weak function definitions" in exynos_fb.c.
In that case, we have a limitation. All boards under a specific
SOC should conform
to use only device tree or use only define board level LCD routines.
ex: smdk5250 and snow - both need to use device tree to specify LCD details,
or both need to define LCD powerup routines. It cannot be
like snow uses device tree,
and smdk5250 defines LCD routines in smdk5250 board file.

Ajay

#15 lore raw

PATCH 4/5 exynos5420: Add LCD and LED powerup settings for peach-pi

Hi Ajay,

Quoted 58 lines · Ajay kumar

Hi,

Quoted 54 lines · Simon Glass

Hi,

Quoted 41 lines · Sjoerd Simons
Quoted 40 lines · Ajay Kumar

Add code to support powerup sequence for peach-pi LCD.

---
 board/samsung/smdk5420/smdk5420.c |   32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)
board/samsung/smdk5420/smdk5420.c +12 -11
index a691222..915125e 100644
@@ -73,19 +73,24 @@ void exynos_lcd_power_on(void)
 
      mdelay(5);
 
-     /* TODO(ajaykumar.rs at samsung.com): Use device tree */
-     gpio_request(EXYNOS5420_GPIO_X35, "edp_slp#");
-     gpio_direction_output(EXYNOS5420_GPIO_X35, 1);  /* EDP_SLP# */
-     mdelay(10);
-     gpio_request(EXYNOS5420_GPIO_Y77, "edp_rst#");
-     gpio_direction_output(EXYNOS5420_GPIO_Y77, 1);  /* EDP_RST# */
-     gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
-     gpio_direction_input(EXYNOS5420_GPIO_X26);      /* EDP_HPD */
-     gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
-
-     if (has_edp_bridge())
+     if (has_edp_bridge()) {
+             /* TODO(ajaykumar.rs at samsung.com): Use device tree */
+             gpio_request(EXYNOS5420_GPIO_X35, "edp_slp#");
+             gpio_direction_output(EXYNOS5420_GPIO_X35, 1);  /* EDP_SLP# */
+             mdelay(10);
+             gpio_request(EXYNOS5420_GPIO_Y77, "edp_rst#");
+             gpio_direction_output(EXYNOS5420_GPIO_Y77, 1);  /* EDP_RST# */
+             gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
+             gpio_direction_input(EXYNOS5420_GPIO_X26);      /* EDP_HPD */
+             gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
+
              if (parade_init(gd->fdt_blob))
                      printf("%s: ps8625_init() failed\n", __func__);
+     } else {
Quoted 8 lines

board/samsung/smdk5420/smdk5420.c void exynos_lcd_power_on(void) · line 93

Quoted 4 lines
board/samsung/smdk5420/smdk5420.c +4 -0
+             gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
+             gpio_direction_input(EXYNOS5420_GPIO_X26);      /* EDP_HPD */
+             gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
+     }

Any chance you could switch to using device-tree while changing this area. On SMDK5420 and XU3 EXYNOS5420_GPIO_X26 is used for USB so there is a bit of a potentially nastly clash there.

Quoted 1 line

Yes we should really do that.

Quoted 15 lines

I am trying to consolidate what all needs to be done for Exynos5250 and Exynos5420,
in order to remove LCD routines from the board files.
Here are my observations:
1) A separate driver for ptn3460 should be created.
2) Need a place holder for tps65090 FET settings.
3) I am planning to move all the LCD_EN/BACKLIGHT_EN GPIOs
to the "weak function definitions" in exynos_fb.c.
In that case, we have a limitation. All boards under a specific
SOC should conform
to use only device tree or use only define board level LCD routines.
ex: smdk5250 and snow - both need to use device tree to specify LCD details,
or both need to define LCD powerup routines. It cannot be
like snow uses device tree,
and smdk5250 defines LCD routines in smdk5250 board file.

Do any boards exist which don't use device tree? I think we can drop that old support.

For a recent Tegra series I used the kernel device tree binding and just picked out information about the regulators. It might be possible to do the same on Exynos. See for example get_backlight_info() in this
patch: http://patchwork.ozlabs.org/patch/416675/

Regards,
Simon

#16 lore raw

PATCH 4/5 exynos5420: Add LCD and LED powerup settings for peach-pi

In reply to Ajay kumar

Hi Ajay,

(resending sorry)

Quoted 58 lines · Ajay kumar

Hi,

Quoted 54 lines · Simon Glass

Hi,

Quoted 41 lines · Sjoerd Simons
Quoted 40 lines · Ajay Kumar

Add code to support powerup sequence for peach-pi LCD.

---
 board/samsung/smdk5420/smdk5420.c |   32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)
board/samsung/smdk5420/smdk5420.c +12 -11
index a691222..915125e 100644
@@ -73,19 +73,24 @@ void exynos_lcd_power_on(void)
 
      mdelay(5);
 
-     /* TODO(ajaykumar.rs at samsung.com): Use device tree */
-     gpio_request(EXYNOS5420_GPIO_X35, "edp_slp#");
-     gpio_direction_output(EXYNOS5420_GPIO_X35, 1);  /* EDP_SLP# */
-     mdelay(10);
-     gpio_request(EXYNOS5420_GPIO_Y77, "edp_rst#");
-     gpio_direction_output(EXYNOS5420_GPIO_Y77, 1);  /* EDP_RST# */
-     gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
-     gpio_direction_input(EXYNOS5420_GPIO_X26);      /* EDP_HPD */
-     gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
-
-     if (has_edp_bridge())
+     if (has_edp_bridge()) {
+             /* TODO(ajaykumar.rs at samsung.com): Use device tree */
+             gpio_request(EXYNOS5420_GPIO_X35, "edp_slp#");
+             gpio_direction_output(EXYNOS5420_GPIO_X35, 1);  /* EDP_SLP# */
+             mdelay(10);
+             gpio_request(EXYNOS5420_GPIO_Y77, "edp_rst#");
+             gpio_direction_output(EXYNOS5420_GPIO_Y77, 1);  /* EDP_RST# */
+             gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
+             gpio_direction_input(EXYNOS5420_GPIO_X26);      /* EDP_HPD */
+             gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
+
              if (parade_init(gd->fdt_blob))
                      printf("%s: ps8625_init() failed\n", __func__);
+     } else {
Quoted 8 lines

board/samsung/smdk5420/smdk5420.c void exynos_lcd_power_on(void) · line 93

Quoted 4 lines
board/samsung/smdk5420/smdk5420.c +4 -0
+             gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd");
+             gpio_direction_input(EXYNOS5420_GPIO_X26);      /* EDP_HPD */
+             gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
+     }

Any chance you could switch to using device-tree while changing this area. On SMDK5420 and XU3 EXYNOS5420_GPIO_X26 is used for USB so there is a bit of a potentially nastly clash there.

Quoted 1 line

Yes we should really do that.

Quoted 15 lines

I am trying to consolidate what all needs to be done for Exynos5250 and Exynos5420,
in order to remove LCD routines from the board files.
Here are my observations:
1) A separate driver for ptn3460 should be created.
2) Need a place holder for tps65090 FET settings.
3) I am planning to move all the LCD_EN/BACKLIGHT_EN GPIOs
to the "weak function definitions" in exynos_fb.c.
In that case, we have a limitation. All boards under a specific
SOC should conform
to use only device tree or use only define board level LCD routines.
ex: smdk5250 and snow - both need to use device tree to specify LCD details,
or both need to define LCD powerup routines. It cannot be
like snow uses device tree,
and smdk5250 defines LCD routines in smdk5250 board file.

Do any boards exist which don't use device tree? I think we can drop that old support.

For a recent Tegra series I used the kernel device tree binding and just picked out information about the regulators. It might be possible to do the same on Exynos. See for example get_backlight_info() in this
patch: http://patchwork.ozlabs.org/patch/416675/

Regards,
Simon

author
#17 lore raw

PATCH 5/5 peach_pi: dts: Add lcd poweron delay

In reply to Ajay Kumar

Add some delay after powering up the peach_pi eDP panel, to make sure the panel is ready for link training.

---
 arch/arm/dts/exynos5800-peach-pi.dts |    1 +
 1 file changed, 1 insertion(+)
arch/arm/dts/exynos5800-peach-pi.dts +1 -0
index 2f9d2db..109dab5 100644
@@ -144,6 +144,7 @@
 		samsung,vl-vfpd = <10>;
 		samsung,vl-cmd-allow-len = <0xf>;
 
+		samsung,power-on-delay = <30000>;
 		samsung,winid = <3>;
 		samsung,interface-mode = <1>;
 		samsung,dp-enabled = <1>;
Signature · 1 line
1.7.9.5
#18 lore raw

cover peach_pi: Add support for FIMD and DP

In reply to Ajay Kumar

Hi Ajay,

Quoted 11 lines · Ajay Kumar

Add support for the eDP panel supported on peach_pi.

Sjoerd Simons(1):
[PATCH 1/5] Exynos5800: The Peach-Pi board does not have a Parade video bridge

Ajay Kumar (4):
[PATCH 2/5] arm: exynos: add display clocks for Exynos5800
[PATCH 3/5] Exynos5: Fix rpll_sdiv to support both peach-pit and peach-pi panels [PATCH 4/5] exynos5420: Add LCD and LED powerup settings for peach-pi [PATCH 5/5] peach_pi: dts: Add lcd poweron delay

Quoted 6 lines
 arch/arm/cpu/armv7/exynos/clock.c              |   63 +++++++++++++++++++++++-
 arch/arm/cpu/armv7/exynos/clock_init_exynos5.c |    4 +-
 arch/arm/dts/exynos5800-peach-pi.dts           |    6 +--
 arch/arm/include/asm/arch-exynos/clk.h         |    3 ++
 board/samsung/smdk5420/smdk5420.c              |   32 +++++++-----
 5 files changed, 88 insertions(+), 20 deletions(-)

Are you planning to respin this series? It looks like two of the patches need adjustments.

Regards,
Simon