Skip to contentSkip to conversation

peach_pit: Add support for FIMD, DP and parade chip

PATCH Superseded Ajay Kumar 5 participants 35 messages Jun 17, 2014 – Jun 26, 2014

Subsystems (7)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Ajay Kumar

author
#0 lore raw

cover peach_pit: Add support for FIMD, DP and parade chip

This patchset has dependency on Akshay's base patchset for peach_pit:
https://www.mail-archive.com/u-boot at lists.denx.de/msg138595.html

This patchset is actually a rebase of my older patchset:
http://lists.denx.de/pipermail/u-boot/2013-November/166935.html,
and this patchset enables display on exynos5420 based peach_pit board.

The last patch is TEST_ONLY, and it adds support for cros-ec on peach_pit. Simon will be sending a proper patchset for the same.

Ajay Kumar (9):
[PATCH 1/10] exynos_fb: Remove usage of static defines
[PATCH 2/10] arm: exynos: Add RPLL for Exynos5420
[PATCH 3/10] arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420 [PATCH 4/10] video: exynos_fimd: Add framework to disable FIMD sysmmu [PATCH 6/10] ARM: exynos: Add missing declaration for gpio_direction_input [PATCH 7/10] exynos5420: add callbacks needed for exynos_fb driver [PATCH 8/10] ARM: exynos: peach_pit: Add DT nodes for fimd and parade bridge chip [PATCH 9/10] CONFIGS: peach_pit: Enable display for peach_pit board

Vadim Bendebury (1):
[PATCH 5/10] video: Add driver for Parade PS8625 dP to LVDS bridge

Simon Glass (1):
[TEST_ONLY 10/10] Pit WIP

 arch/arm/cpu/armv7/exynos/clock.c              |  74 ++++++++-
 arch/arm/cpu/armv7/exynos/clock_init.h         |   3 +
 arch/arm/cpu/armv7/exynos/clock_init_exynos5.c |  13 ++
 arch/arm/cpu/armv7/exynos/exynos5_setup.h      |   2 +-
 arch/arm/dts/exynos5420-peach-pit.dts          |  30 ++++
 arch/arm/dts/exynos54xx.dtsi                   |  10 ++
 arch/arm/include/asm/arch-exynos/clk.h         |   1 +
 arch/arm/include/asm/arch-exynos/gpio.h        |   1 +
 arch/arm/include/asm/arch-exynos/system.h      |   4 +
 board/samsung/common/board.c                   |  15 ++
 board/samsung/smdk5420/smdk5420.c              | 129 ++++++---------
 doc/device-tree-bindings/video/exynos-fb.txt   |   2 +
 drivers/misc/cros_ec_spi.c                     |   4 +-
 drivers/power/pmic/Makefile                    |   3 +-
 drivers/power/pmic/pmic_tps65090_ec.c          | 212 ++++++++++++++++++++++++
 drivers/spi/exynos_spi.c                       |   9 +-
 drivers/spi/spi.c                              |   2 +
 drivers/video/Makefile                         |   1 +
 drivers/video/exynos_fb.c                      |  17 +-
 drivers/video/exynos_fimd.c                    |  52 ++++++
 drivers/video/parade.c                         | 220 +++++++++++++++++++++++++
 include/configs/exynos5-dt.h                   |   2 +-
 include/configs/exynos5250-dt.h                |   2 -
 include/configs/peach-pit.h                    |  12 ++
 include/configs/s5pc210_universal.h            |   3 -
 include/configs/trats.h                        |   3 -
 include/configs/trats2.h                       |   3 -
 include/fdtdec.h                               |   5 +
 include/power/tps65090_pmic.h                  |   6 +
 lib/fdtdec.c                                   |   3 +
 30 files changed, 726 insertions(+), 117 deletions(-)
 create mode 100644 drivers/power/pmic/pmic_tps65090_ec.c
 create mode 100644 drivers/video/parade.c
Signature · 1 line
1.8.1.2
author
#1 lore raw

PATCH 1/10 exynos_fb: Remove usage of static defines

Previously, we used to statically assign values for vl_col, vl_row and vl_bpix using #defines like LCD_XRES, LCD_YRES and LCD_COLOR16.

Introducing the function exynos_lcd_early_init() would take care of this assignment on the fly by parsing FIMD DT properties, thereby allowing us to remove LCD_XRES and LCD_YRES from the main config file.

---
 arch/arm/include/asm/arch-exynos/system.h |  1 +
 board/samsung/common/board.c              | 15 +++++++++++++++
 drivers/video/exynos_fb.c                 | 17 +++++------------
 include/configs/exynos5250-dt.h           |  2 --
 include/configs/s5pc210_universal.h       |  3 ---
 include/configs/trats.h                   |  3 ---
 include/configs/trats2.h                  |  3 ---
 7 files changed, 21 insertions(+), 23 deletions(-)
arch/arm/include/asm/arch-exynos/system.h +1 -0
index 7e2057c..4968d3d 100644
@@ -39,5 +39,6 @@ struct exynos5_sysreg {
 
 void set_usbhost_mode(unsigned int mode);
 void set_system_display_ctrl(void);
+int exynos_lcd_early_init(const void *blob);
 
 #endif	/* _EXYNOS4_SYSTEM_H */
board/samsung/common/board.c +15 -0
index 9dc7c83..1f6f0a0 100644
@@ -20,6 +20,7 @@
 #include <asm/arch/mmc.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/power.h>
+#include <asm/arch/system.h>
 #include <power/pmic.h>
 #include <asm/arch/sromc.h>
 #include <lcd.h>
@@ -148,6 +149,20 @@ int board_early_init_f(void)
 	board_i2c_init(gd->fdt_blob);
 #endif
 
+#if defined(CONFIG_OF_CONTROL) && defined(CONFIG_EXYNOS_FB)
+/*
+ * board_init_f(arch/arm/lib/board.c) calls lcd_setmem() which needs
+ * panel_info.vl_col, panel_info.vl_row and panel_info.vl_bpix, to reserve
+ * FB memory at a very early stage. So, we need to fill panel_info.vl_col,
+ * panel_info.vl_row and panel_info.vl_bpix before lcd_setmem() is called.
+ */
+	err = exynos_lcd_early_init(gd->fdt_blob);
+	if (err) {
+		debug("LCD early init failed\n");
+		return err;
+	}
+#endif
+
 	return exynos_early_init_f();
 }
 #endif
drivers/video/exynos_fb.c +5 -12
index e1e0d80..bc478a9 100644
@@ -27,17 +27,12 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static unsigned int panel_width, panel_height;
 
-/*
- * board_init_f(arch/arm/lib/board.c) calls lcd_setmem() which needs
- * panel_info.vl_col, panel_info.vl_row and panel_info.vl_bpix to reserve
- * FB memory at a very early stage, i.e even before exynos_fimd_parse_dt()
- * is called. So, we are forced to statically assign it.
- */
 #ifdef CONFIG_OF_CONTROL
 vidinfo_t panel_info  = {
-	.vl_col = LCD_XRES,
-	.vl_row = LCD_YRES,
-	.vl_bpix = LCD_COLOR16,
+	/* Insert a value here so that we don't end up in the BSS
+	 * Reference: drivers/video/tegra.c
+	 */
+	.vl_col = -1,
 };
 #endif
 
@@ -141,7 +136,7 @@ static void lcd_panel_on(vidinfo_t *vid)
 }
 
 #ifdef CONFIG_OF_CONTROL
-int exynos_fimd_parse_dt(const void *blob)
+int exynos_lcd_early_init(const void *blob)
 {
 	unsigned int node;
 	node = fdtdec_next_compatible(blob, 0, COMPAT_SAMSUNG_EXYNOS_FIMD);
@@ -286,8 +281,6 @@ void lcd_ctrl_init(void *lcdbase)
 	set_lcd_clk();
 
 #ifdef CONFIG_OF_CONTROL
-	if (exynos_fimd_parse_dt(gd->fdt_blob))
-		debug("Can't get proper panel info\n");
 #ifdef CONFIG_EXYNOS_MIPI_DSIM
 	exynos_init_dsim_platform_data(&panel_info);
 #endif
include/configs/exynos5250-dt.h +0 -2
index 9d1d56a..86a2570 100644
@@ -65,8 +65,6 @@
 #ifdef CONFIG_LCD
 #define CONFIG_EXYNOS_FB
 #define CONFIG_EXYNOS_DP
-#define LCD_XRES			2560
-#define LCD_YRES			1600
 #define LCD_BPP			LCD_COLOR16
 #endif
 #endif  /* __CONFIG_5250_H */
include/configs/s5pc210_universal.h +0 -3
index eb046cd..20985da 100644
@@ -247,7 +247,4 @@ int universal_spi_read(void);
 #define CONFIG_VIDEO_BMP_GZIP
 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54)
 
-#define LCD_XRES	480
-#define LCD_YRES	800
-
 #endif	/* __CONFIG_H */
include/configs/trats.h +0 -3
index 90f1962..35c1feb 100644
@@ -261,7 +261,4 @@
 #define CONFIG_VIDEO_BMP_GZIP
 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE  ((500 * 160 * 4) + 54)
 
-#define LCD_XRES	720
-#define LCD_YRES	1280
-
 #endif	/* __CONFIG_H */
include/configs/trats2.h +0 -3
index 206975b..94c8a9f 100644
@@ -241,7 +241,4 @@ int get_soft_i2c_sda_pin(void);
 #define CONFIG_VIDEO_BMP_GZIP
 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54)
 
-#define LCD_XRES	720
-#define LCD_YRES	1280
-
 #endif	/* __CONFIG_H */
Signature · 1 line
1.8.1.2
#2 lore raw

PATCH 1/10 exynos_fb: Remove usage of static defines

Quoted 8 lines · Ajay Kumar

Previously, we used to statically assign values for vl_col, vl_row and vl_bpix using #defines like LCD_XRES, LCD_YRES and LCD_COLOR16.

Introducing the function exynos_lcd_early_init() would take care of this assignment on the fly by parsing FIMD DT properties, thereby allowing us to remove LCD_XRES and LCD_YRES from the main config file.

author
#3 lore raw

PATCH 2/10 arm: exynos: Add RPLL for Exynos5420

In reply to Ajay Kumar

RPLL is needed to drive the LCD panel on Exynos5420 based boards.

---
 arch/arm/cpu/armv7/exynos/clock_init.h         |  3 +++
 arch/arm/cpu/armv7/exynos/clock_init_exynos5.c | 13 +++++++++++++
 2 files changed, 16 insertions(+)
arch/arm/cpu/armv7/exynos/clock_init.h +3 -0
index a875d0b..fce502f 100644
@@ -75,6 +75,9 @@ struct mem_timings {
 	unsigned spll_mdiv;
 	unsigned spll_pdiv;
 	unsigned spll_sdiv;
+	unsigned rpll_mdiv;
+	unsigned rpll_pdiv;
+	unsigned rpll_sdiv;
 	unsigned pclk_cdrex_ratio;
 	unsigned direct_cmd_msr[MEM_TIMINGS_MSR_COUNT];
 
arch/arm/cpu/armv7/exynos/clock_init_exynos5.c +13 -0
index 1d6977f..b6a9bc1 100644
@@ -179,6 +179,10 @@ struct mem_timings mem_timings[] = {
 		.spll_mdiv = 0xc8,
 		.spll_pdiv = 0x3,
 		.spll_sdiv = 0x2,
+		/* RPLL @70.5Mhz */
+		.rpll_mdiv = 0x5E,
+		.rpll_pdiv = 0x2,
+		.rpll_sdiv = 0x4,
 
 		.direct_cmd_msr = {
 			0x00020018, 0x00030000, 0x00010046, 0x00000d70,
@@ -800,6 +804,7 @@ static void exynos5420_system_clock_init(void)
 	writel(mem->ipll_pdiv * PLL_LOCK_FACTOR, &clk->ipll_lock);
 	writel(mem->spll_pdiv * PLL_LOCK_FACTOR, &clk->spll_lock);
 	writel(mem->kpll_pdiv * PLL_LOCK_FACTOR, &clk->kpll_lock);
+	writel(mem->rpll_pdiv * PLL_X_LOCK_FACTOR, &clk->rpll_lock);
 
 	setbits_le32(&clk->src_cpu, MUX_HPM_SEL_MASK);
 
@@ -898,6 +903,14 @@ static void exynos5420_system_clock_init(void)
 	while ((readl(&clk->spll_con0) & PLL_LOCKED) == 0)
 		;
 
+	/* Set RPLL */
+	writel(RPLL_CON2_VAL, &clk->rpll_con2);
+	writel(RPLL_CON1_VAL, &clk->rpll_con1);
+	val = set_pll(mem->rpll_mdiv, mem->rpll_pdiv, mem->rpll_sdiv);
+	writel(val, &clk->rpll_con0);
+	while ((readl(&clk->rpll_con0) & PLL_LOCKED) == 0)
+		;
+
 	writel(CLK_DIV_CDREX0_VAL, &clk->div_cdrex0);
 	writel(CLK_DIV_CDREX1_VAL, &clk->div_cdrex1);
 
Signature · 1 line
1.8.1.2
author
#5 lore raw

PATCH 3/10 arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

In reply to Ajay Kumar

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420 needed by exynos video driver.
Also, configure ACLK_400_DISP1 as the parent for MUX_ACLK_400_DISP1_SUB_SEL.

---
 arch/arm/cpu/armv7/exynos/clock.c         | 74 +++++++++++++++++++++++++++++--
 arch/arm/cpu/armv7/exynos/exynos5_setup.h |  2 +-
 arch/arm/include/asm/arch-exynos/clk.h    |  1 +
 3 files changed, 73 insertions(+), 4 deletions(-)
arch/arm/cpu/armv7/exynos/clock.c +71 -3
index 400d134..c29b12d 100644
@@ -82,7 +82,8 @@ static int exynos_get_pll_clk(int pllreg, unsigned int r, unsigned int k)
 	 * VPLL_CON: MIDV [24:16]
 	 * BPLL_CON: MIDV [25:16]: Exynos5
 	 */
-	if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL)
+	if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL ||
+	    pllreg == SPLL)
 		mask = 0x3ff;
 	else
 		mask = 0x1ff;
@@ -391,6 +392,9 @@ static unsigned long exynos5420_get_pll_clk(int pllreg)
 		r = readl(&clk->rpll_con0);
 		k = readl(&clk->rpll_con1);
 		break;
+	case SPLL:
+		r = readl(&clk->spll_con0);
+		break;
 	default:
 		printf("Unsupported PLL (%d)\n", pllreg);
 		return 0;
@@ -1027,6 +1031,40 @@ static unsigned long exynos5_get_lcd_clk(void)
 	return pclk;
 }
 
+static unsigned long exynos5420_get_lcd_clk(void)
+{
+	struct exynos5420_clock *clk =
+		(struct exynos5420_clock *)samsung_get_base_clock();
+	unsigned long pclk, sclk;
+	unsigned int sel;
+	unsigned int ratio;
+
+	/*
+	 * CLK_SRC_DISP10
+	 * FIMD1_SEL [4]
+	 * 0: SCLK_RPLL
+	 * 1: SCLK_SPLL
+	 */
+	sel = readl(&clk->src_disp10);
+	sel &= (1 << 4);
+
+	if (sel)
+		sclk = get_pll_clk(SPLL);
+	else
+		sclk = get_pll_clk(RPLL);
+
+	/*
+	 * CLK_DIV_DISP10
+	 * FIMD1_RATIO [3:0]
+	 */
+	ratio = readl(&clk->div_disp10);
+	ratio = ratio & 0xf;
+
+	pclk = sclk / (ratio + 1);
+
+	return pclk;
+}
+
 void exynos4_set_lcd_clk(void)
 {
 	struct exynos4_clock *clk =
@@ -1131,6 +1169,33 @@ void exynos5_set_lcd_clk(void)
 	clrsetbits_le32(&clk->div_disp1_0, 0xf, 0x0);
 }
 
+void exynos5420_set_lcd_clk(void)
+{
+	struct exynos5420_clock *clk =
+		(struct exynos5420_clock *)samsung_get_base_clock();
+	unsigned int cfg;
+
+	/*
+	 * CLK_SRC_DISP10
+	 * FIMD1_SEL [4]
+	 * 0: SCLK_RPLL
+	 * 1: SCLK_SPLL
+	 */
+	cfg = readl(&clk->src_disp10);
+	cfg &= ~(0x1 << 4);
+	cfg |= (0 << 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 =
@@ -1602,14 +1667,17 @@ unsigned long get_lcd_clk(void)
 {
 	if (cpu_is_exynos4())
 		return exynos4_get_lcd_clk();
-	else
-		return exynos5_get_lcd_clk();
+	else if (proid_is_exynos5420())
+		return exynos5420_get_lcd_clk();
+	return exynos5_get_lcd_clk();
 }
 
 void set_lcd_clk(void)
 {
 	if (cpu_is_exynos4())
 		exynos4_set_lcd_clk();
+	else if (proid_is_exynos5420())
+		exynos5420_set_lcd_clk();
 	else
 		exynos5_set_lcd_clk();
 }
arch/arm/cpu/armv7/exynos/exynos5_setup.h +1 -1
index db8ea86..5eac9cf 100644
@@ -779,7 +779,7 @@
 #define CLK_SRC_TOP2_VAL	0x11101000
 #define CLK_SRC_TOP3_VAL	0x11111111
 #define CLK_SRC_TOP4_VAL	0x11110111
-#define CLK_SRC_TOP5_VAL	0x11111100
+#define CLK_SRC_TOP5_VAL	0x11111101
 #define CLK_SRC_TOP6_VAL	0x11110111
 #define CLK_SRC_TOP7_VAL	0x00022200
 
arch/arm/include/asm/arch-exynos/clk.h +1 -0
index ffbc07e..db24dc0 100644
@@ -15,6 +15,7 @@
 #define VPLL	4
 #define BPLL	5
 #define RPLL	6
+#define SPLL	7
 
 #define MASK_PRE_RATIO(x)	(0xff << ((x << 4) + 8))
 #define MASK_RATIO(x)		(0xf << (x << 4))
Signature · 1 line
1.8.1.2
#7 lore raw

PATCH 3/10 arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

In reply to Ajay Kumar
Quoted 5 lines · Ajay Kumar

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420 needed by exynos video driver.
Also, configure ACLK_400_DISP1 as the parent for MUX_ACLK_400_DISP1_SUB_SEL.

(BTW please don't send patches to my google.com address as I use Chromium for this - thanks)

#8 lore raw

PATCH 3/10 arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

In reply to Ajay Kumar
Quoted 111 lines · Ajay Kumar

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420 needed by exynos video driver.
Also, configure ACLK_400_DISP1 as the parent for MUX_ACLK_400_DISP1_SUB_SEL.

---
 arch/arm/cpu/armv7/exynos/clock.c         | 74 +++++++++++++++++++++++++++++--
 arch/arm/cpu/armv7/exynos/exynos5_setup.h |  2 +-
 arch/arm/include/asm/arch-exynos/clk.h    |  1 +
 3 files changed, 73 insertions(+), 4 deletions(-)
arch/arm/cpu/armv7/exynos/clock.c +66 -1
index 400d134..c29b12d 100644
@@ -82,7 +82,8 @@ static int exynos_get_pll_clk(int pllreg, unsigned int r, unsigned int k)
 	 * VPLL_CON: MIDV [24:16]
 	 * BPLL_CON: MIDV [25:16]: Exynos5
 	 */
-	if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL)
+	if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL ||
+	    pllreg == SPLL)
 		mask = 0x3ff;
 	else
 		mask = 0x1ff;
@@ -391,6 +392,9 @@ static unsigned long exynos5420_get_pll_clk(int pllreg)
 		r = readl(&clk->rpll_con0);
 		k = readl(&clk->rpll_con1);
 		break;
+	case SPLL:
+		r = readl(&clk->spll_con0);
+		break;
 	default:
 		printf("Unsupported PLL (%d)\n", pllreg);
 		return 0;
@@ -1027,6 +1031,40 @@ static unsigned long exynos5_get_lcd_clk(void)
 	return pclk;
 }
 
+static unsigned long exynos5420_get_lcd_clk(void)
+{
+	struct exynos5420_clock *clk =
+		(struct exynos5420_clock *)samsung_get_base_clock();
+	unsigned long pclk, sclk;
+	unsigned int sel;
+	unsigned int ratio;
+
+	/*
+	 * CLK_SRC_DISP10
+	 * FIMD1_SEL [4]
+	 * 0: SCLK_RPLL
+	 * 1: SCLK_SPLL
+	 */
+	sel = readl(&clk->src_disp10);
+	sel &= (1 << 4);
+
+	if (sel)
+		sclk = get_pll_clk(SPLL);
+	else
+		sclk = get_pll_clk(RPLL);
+
+	/*
+	 * CLK_DIV_DISP10
+	 * FIMD1_RATIO [3:0]
+	 */
+	ratio = readl(&clk->div_disp10);
+	ratio = ratio & 0xf;
+
+	pclk = sclk / (ratio + 1);
+
+	return pclk;
+}
+
 void exynos4_set_lcd_clk(void)
 {
 	struct exynos4_clock *clk =
@@ -1131,6 +1169,33 @@ void exynos5_set_lcd_clk(void)
 	clrsetbits_le32(&clk->div_disp1_0, 0xf, 0x0);
 }
 
+void exynos5420_set_lcd_clk(void)
+{
+	struct exynos5420_clock *clk =
+		(struct exynos5420_clock *)samsung_get_base_clock();
+	unsigned int cfg;
+
+	/*
+	 * CLK_SRC_DISP10
+	 * FIMD1_SEL [4]
+	 * 0: SCLK_RPLL
+	 * 1: SCLK_SPLL
+	 */
+	cfg = readl(&clk->src_disp10);
+	cfg &= ~(0x1 << 4);
+	cfg |= (0 << 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 =

arch/arm/cpu/armv7/exynos/clock.c unsigned long get_lcd_clk(void) · line 1672

Quoted 8 lines
arch/arm/cpu/armv7/exynos/clock.c +3 -2
@@ -1602,14 +1667,17 @@ unsigned long get_lcd_clk(void)
 {
 	if (cpu_is_exynos4())
 		return exynos4_get_lcd_clk();
-	else
-		return exynos5_get_lcd_clk();
+	else if (proid_is_exynos5420())
+		return exynos5420_get_lcd_clk();
+	return exynos5_get_lcd_clk();

No. Please don't mix cpu_is... and proid_is....
You can refer to other functions.

arch/arm/cpu/armv7/exynos/clock.c unsigned long get_lcd_clk(void) · line 1680

Quoted 8 lines
arch/arm/cpu/armv7/exynos/clock.c +2 -0
 }
 
 void set_lcd_clk(void)
 {
 	if (cpu_is_exynos4())
 		exynos4_set_lcd_clk();
+	else if (proid_is_exynos5420())
+		exynos5420_set_lcd_clk();

ditto.

Quoted 22 lines
arch/arm/cpu/armv7/exynos/clock.c +0 -0
 	else
 		exynos5_set_lcd_clk();
 }
arch/arm/cpu/armv7/exynos/exynos5_setup.h +1 -1
index db8ea86..5eac9cf 100644
@@ -779,7 +779,7 @@
 #define CLK_SRC_TOP2_VAL	0x11101000
 #define CLK_SRC_TOP3_VAL	0x11111111
 #define CLK_SRC_TOP4_VAL	0x11110111
-#define CLK_SRC_TOP5_VAL	0x11111100
+#define CLK_SRC_TOP5_VAL	0x11111101
 #define CLK_SRC_TOP6_VAL	0x11110111
 #define CLK_SRC_TOP7_VAL	0x00022200
 
arch/arm/include/asm/arch-exynos/clk.h +0 -0
index ffbc07e..db24dc0 100644

arch/arm/include/asm/arch-exynos/clk.h line 21

Quoted 7 lines
arch/arm/include/asm/arch-exynos/clk.h +1 -0
@@ -15,6 +15,7 @@
 #define VPLL	4
 #define BPLL	5
 #define RPLL	6
+#define SPLL	7
 
 #define MASK_PRE_RATIO(x)	(0xff << ((x << 4) + 8))
 #define MASK_RATIO(x)		(0xf << (x << 4))

Thanks,
Minkyu Kang.

#9 lore raw

PATCH 3/10 arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

Hi Minkyu,

Quoted 115 lines · Minkyu Kang
Quoted 114 lines · Ajay Kumar

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420 needed by exynos video driver.
Also, configure ACLK_400_DISP1 as the parent for MUX_ACLK_400_DISP1_SUB_SEL.

---
 arch/arm/cpu/armv7/exynos/clock.c         | 74 +++++++++++++++++++++++++++++--
 arch/arm/cpu/armv7/exynos/exynos5_setup.h |  2 +-
 arch/arm/include/asm/arch-exynos/clk.h    |  1 +
 3 files changed, 73 insertions(+), 4 deletions(-)
arch/arm/cpu/armv7/exynos/clock.c +66 -1
index 400d134..c29b12d 100644
@@ -82,7 +82,8 @@ static int exynos_get_pll_clk(int pllreg, unsigned int r, unsigned int k)
       * VPLL_CON: MIDV [24:16]
       * BPLL_CON: MIDV [25:16]: Exynos5
       */
-     if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL)
+     if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL ||
+         pllreg == SPLL)
              mask = 0x3ff;
      else
              mask = 0x1ff;
@@ -391,6 +392,9 @@ static unsigned long exynos5420_get_pll_clk(int pllreg)
              r = readl(&clk->rpll_con0);
              k = readl(&clk->rpll_con1);
              break;
+     case SPLL:
+             r = readl(&clk->spll_con0);
+             break;
      default:
              printf("Unsupported PLL (%d)\n", pllreg);
              return 0;
@@ -1027,6 +1031,40 @@ static unsigned long exynos5_get_lcd_clk(void)
      return pclk;
 }
 
+static unsigned long exynos5420_get_lcd_clk(void)
+{
+     struct exynos5420_clock *clk =
+             (struct exynos5420_clock *)samsung_get_base_clock();
+     unsigned long pclk, sclk;
+     unsigned int sel;
+     unsigned int ratio;
+
+     /*
+      * CLK_SRC_DISP10
+      * FIMD1_SEL [4]
+      * 0: SCLK_RPLL
+      * 1: SCLK_SPLL
+      */
+     sel = readl(&clk->src_disp10);
+     sel &= (1 << 4);
+
+     if (sel)
+             sclk = get_pll_clk(SPLL);
+     else
+             sclk = get_pll_clk(RPLL);
+
+     /*
+      * CLK_DIV_DISP10
+      * FIMD1_RATIO [3:0]
+      */
+     ratio = readl(&clk->div_disp10);
+     ratio = ratio & 0xf;
+
+     pclk = sclk / (ratio + 1);
+
+     return pclk;
+}
+
 void exynos4_set_lcd_clk(void)
 {
      struct exynos4_clock *clk =
@@ -1131,6 +1169,33 @@ void exynos5_set_lcd_clk(void)
      clrsetbits_le32(&clk->div_disp1_0, 0xf, 0x0);
 }
 
+void exynos5420_set_lcd_clk(void)
+{
+     struct exynos5420_clock *clk =
+             (struct exynos5420_clock *)samsung_get_base_clock();
+     unsigned int cfg;
+
+     /*
+      * CLK_SRC_DISP10
+      * FIMD1_SEL [4]
+      * 0: SCLK_RPLL
+      * 1: SCLK_SPLL
+      */
+     cfg = readl(&clk->src_disp10);
+     cfg &= ~(0x1 << 4);
+     cfg |= (0 << 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 =
@@ -1602,14 +1667,17 @@ unsigned long get_lcd_clk(void)
 {
      if (cpu_is_exynos4())
              return exynos4_get_lcd_clk();
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c unsigned long get_lcd_clk(void) · line 1672

Quoted 5 lines
arch/arm/cpu/armv7/exynos/clock.c +3 -2
-     else
-             return exynos5_get_lcd_clk();
+     else if (proid_is_exynos5420())
+             return exynos5420_get_lcd_clk();
+     return exynos5_get_lcd_clk();

No. Please don't mix cpu_is... and proid_is....
You can refer to other functions.

Actually, only "cpu_is_exynos4" and "cpu_is_exynos5" are defined in cpu.h. And, I need different clock setting for 5250 and 5420.
The only way to achieve this is by calling appropriate functions based on check to proid_is_exynos5420().
Let me know if these is some other way!

Regards,
Ajay

Quoted 47 lines

arch/arm/cpu/armv7/exynos/clock.c unsigned long get_lcd_clk(void) · line 1680

Quoted 8 lines
arch/arm/cpu/armv7/exynos/clock.c +2 -0
 }
 
 void set_lcd_clk(void)
 {
      if (cpu_is_exynos4())
              exynos4_set_lcd_clk();
+     else if (proid_is_exynos5420())
+             exynos5420_set_lcd_clk();

ditto.

Quoted 22 lines
arch/arm/cpu/armv7/exynos/clock.c +0 -0
      else
              exynos5_set_lcd_clk();
 }
arch/arm/cpu/armv7/exynos/exynos5_setup.h +1 -1
index db8ea86..5eac9cf 100644
@@ -779,7 +779,7 @@
 #define CLK_SRC_TOP2_VAL     0x11101000
 #define CLK_SRC_TOP3_VAL     0x11111111
 #define CLK_SRC_TOP4_VAL     0x11110111
-#define CLK_SRC_TOP5_VAL     0x11111100
+#define CLK_SRC_TOP5_VAL     0x11111101
 #define CLK_SRC_TOP6_VAL     0x11110111
 #define CLK_SRC_TOP7_VAL     0x00022200
 
arch/arm/include/asm/arch-exynos/clk.h +0 -0
index ffbc07e..db24dc0 100644

arch/arm/include/asm/arch-exynos/clk.h line 21

Quoted 7 lines
arch/arm/include/asm/arch-exynos/clk.h +1 -0
@@ -15,6 +15,7 @@
 #define VPLL 4
 #define BPLL 5
 #define RPLL 6
+#define SPLL 7
 
 #define MASK_PRE_RATIO(x)    (0xff << ((x << 4) + 8))
 #define MASK_RATIO(x)                (0xf << (x << 4))

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

#10 lore raw

PATCH 3/10 arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

Quoted 126 lines · Ajay kumar

Hi Minkyu,

Quoted 115 lines · Minkyu Kang
Quoted 114 lines · Ajay Kumar

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420 needed by exynos video driver.
Also, configure ACLK_400_DISP1 as the parent for MUX_ACLK_400_DISP1_SUB_SEL.

---
 arch/arm/cpu/armv7/exynos/clock.c         | 74 +++++++++++++++++++++++++++++--
 arch/arm/cpu/armv7/exynos/exynos5_setup.h |  2 +-
 arch/arm/include/asm/arch-exynos/clk.h    |  1 +
 3 files changed, 73 insertions(+), 4 deletions(-)
arch/arm/cpu/armv7/exynos/clock.c +66 -1
index 400d134..c29b12d 100644
@@ -82,7 +82,8 @@ static int exynos_get_pll_clk(int pllreg, unsigned int r, unsigned int k)
       * VPLL_CON: MIDV [24:16]
       * BPLL_CON: MIDV [25:16]: Exynos5
       */
-     if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL)
+     if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL ||
+         pllreg == SPLL)
              mask = 0x3ff;
      else
              mask = 0x1ff;
@@ -391,6 +392,9 @@ static unsigned long exynos5420_get_pll_clk(int pllreg)
              r = readl(&clk->rpll_con0);
              k = readl(&clk->rpll_con1);
              break;
+     case SPLL:
+             r = readl(&clk->spll_con0);
+             break;
      default:
              printf("Unsupported PLL (%d)\n", pllreg);
              return 0;
@@ -1027,6 +1031,40 @@ static unsigned long exynos5_get_lcd_clk(void)
      return pclk;
 }
 
+static unsigned long exynos5420_get_lcd_clk(void)
+{
+     struct exynos5420_clock *clk =
+             (struct exynos5420_clock *)samsung_get_base_clock();
+     unsigned long pclk, sclk;
+     unsigned int sel;
+     unsigned int ratio;
+
+     /*
+      * CLK_SRC_DISP10
+      * FIMD1_SEL [4]
+      * 0: SCLK_RPLL
+      * 1: SCLK_SPLL
+      */
+     sel = readl(&clk->src_disp10);
+     sel &= (1 << 4);
+
+     if (sel)
+             sclk = get_pll_clk(SPLL);
+     else
+             sclk = get_pll_clk(RPLL);
+
+     /*
+      * CLK_DIV_DISP10
+      * FIMD1_RATIO [3:0]
+      */
+     ratio = readl(&clk->div_disp10);
+     ratio = ratio & 0xf;
+
+     pclk = sclk / (ratio + 1);
+
+     return pclk;
+}
+
 void exynos4_set_lcd_clk(void)
 {
      struct exynos4_clock *clk =
@@ -1131,6 +1169,33 @@ void exynos5_set_lcd_clk(void)
      clrsetbits_le32(&clk->div_disp1_0, 0xf, 0x0);
 }
 
+void exynos5420_set_lcd_clk(void)
+{
+     struct exynos5420_clock *clk =
+             (struct exynos5420_clock *)samsung_get_base_clock();
+     unsigned int cfg;
+
+     /*
+      * CLK_SRC_DISP10
+      * FIMD1_SEL [4]
+      * 0: SCLK_RPLL
+      * 1: SCLK_SPLL
+      */
+     cfg = readl(&clk->src_disp10);
+     cfg &= ~(0x1 << 4);
+     cfg |= (0 << 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 =
@@ -1602,14 +1667,17 @@ unsigned long get_lcd_clk(void)
 {
      if (cpu_is_exynos4())
              return exynos4_get_lcd_clk();
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c unsigned long get_lcd_clk(void) · line 1672

Quoted 5 lines
arch/arm/cpu/armv7/exynos/clock.c +3 -2
-     else
-             return exynos5_get_lcd_clk();
+     else if (proid_is_exynos5420())
+             return exynos5420_get_lcd_clk();
+     return exynos5_get_lcd_clk();

No. Please don't mix cpu_is... and proid_is....
You can refer to other functions.

Quoted 5 lines

Actually, only "cpu_is_exynos4" and "cpu_is_exynos5" are defined in cpu.h. And, I need different clock setting for 5250 and 5420.
The only way to achieve this is by calling appropriate functions based on check to proid_is_exynos5420().
Let me know if these is some other way!

unsigned long get_lcd_clk(void)

{
	if (cpu_is_exynos4()) {
		return exynos4_get_lcd_clk();
	} else {
		if (proid_is_exynos5420())
			return exynos5420_get_lcd_clk();
		else
			return exynos5_get_lcd_clk();
	}
}

Thanks,
Minkyu Kang.

#11 lore raw

PATCH 3/10 arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

Quoted 134 lines · Minkyu Kang
Quoted 126 lines · Ajay kumar

Hi Minkyu,

Quoted 115 lines · Minkyu Kang
Quoted 114 lines · Ajay Kumar

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420 needed by exynos video driver.
Also, configure ACLK_400_DISP1 as the parent for MUX_ACLK_400_DISP1_SUB_SEL.

---
 arch/arm/cpu/armv7/exynos/clock.c         | 74 +++++++++++++++++++++++++++++--
 arch/arm/cpu/armv7/exynos/exynos5_setup.h |  2 +-
 arch/arm/include/asm/arch-exynos/clk.h    |  1 +
 3 files changed, 73 insertions(+), 4 deletions(-)
arch/arm/cpu/armv7/exynos/clock.c +66 -1
index 400d134..c29b12d 100644
@@ -82,7 +82,8 @@ static int exynos_get_pll_clk(int pllreg, unsigned int r, unsigned int k)
       * VPLL_CON: MIDV [24:16]
       * BPLL_CON: MIDV [25:16]: Exynos5
       */
-     if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL)
+     if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL ||
+         pllreg == SPLL)
              mask = 0x3ff;
      else
              mask = 0x1ff;
@@ -391,6 +392,9 @@ static unsigned long exynos5420_get_pll_clk(int pllreg)
              r = readl(&clk->rpll_con0);
              k = readl(&clk->rpll_con1);
              break;
+     case SPLL:
+             r = readl(&clk->spll_con0);
+             break;
      default:
              printf("Unsupported PLL (%d)\n", pllreg);
              return 0;
@@ -1027,6 +1031,40 @@ static unsigned long exynos5_get_lcd_clk(void)
      return pclk;
 }
 
+static unsigned long exynos5420_get_lcd_clk(void)
+{
+     struct exynos5420_clock *clk =
+             (struct exynos5420_clock *)samsung_get_base_clock();
+     unsigned long pclk, sclk;
+     unsigned int sel;
+     unsigned int ratio;
+
+     /*
+      * CLK_SRC_DISP10
+      * FIMD1_SEL [4]
+      * 0: SCLK_RPLL
+      * 1: SCLK_SPLL
+      */
+     sel = readl(&clk->src_disp10);
+     sel &= (1 << 4);
+
+     if (sel)
+             sclk = get_pll_clk(SPLL);
+     else
+             sclk = get_pll_clk(RPLL);
+
+     /*
+      * CLK_DIV_DISP10
+      * FIMD1_RATIO [3:0]
+      */
+     ratio = readl(&clk->div_disp10);
+     ratio = ratio & 0xf;
+
+     pclk = sclk / (ratio + 1);
+
+     return pclk;
+}
+
 void exynos4_set_lcd_clk(void)
 {
      struct exynos4_clock *clk =
@@ -1131,6 +1169,33 @@ void exynos5_set_lcd_clk(void)
      clrsetbits_le32(&clk->div_disp1_0, 0xf, 0x0);
 }
 
+void exynos5420_set_lcd_clk(void)
+{
+     struct exynos5420_clock *clk =
+             (struct exynos5420_clock *)samsung_get_base_clock();
+     unsigned int cfg;
+
+     /*
+      * CLK_SRC_DISP10
+      * FIMD1_SEL [4]
+      * 0: SCLK_RPLL
+      * 1: SCLK_SPLL
+      */
+     cfg = readl(&clk->src_disp10);
+     cfg &= ~(0x1 << 4);
+     cfg |= (0 << 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 =
@@ -1602,14 +1667,17 @@ unsigned long get_lcd_clk(void)
 {
      if (cpu_is_exynos4())
              return exynos4_get_lcd_clk();
Quoted 8 lines

arch/arm/cpu/armv7/exynos/clock.c unsigned long get_lcd_clk(void) · line 1672

Quoted 5 lines
arch/arm/cpu/armv7/exynos/clock.c +3 -2
-     else
-             return exynos5_get_lcd_clk();
+     else if (proid_is_exynos5420())
+             return exynos5420_get_lcd_clk();
+     return exynos5_get_lcd_clk();

No. Please don't mix cpu_is... and proid_is....
You can refer to other functions.

Quoted 5 lines

Actually, only "cpu_is_exynos4" and "cpu_is_exynos5" are defined in cpu.h. And, I need different clock setting for 5250 and 5420.
The only way to achieve this is by calling appropriate functions based on check to proid_is_exynos5420().
Let me know if these is some other way!

unsigned long get_lcd_clk(void)

Quoted 10 lines
{
        if (cpu_is_exynos4()) {
                return exynos4_get_lcd_clk();
        } else {
                if (proid_is_exynos5420())
                        return exynos5420_get_lcd_clk();
                else
                        return exynos5_get_lcd_clk();
        }
}

Actually, both the ways, functionality is the same. Its just that, in your case readability is fine, and in my case the code takes fewer number of lines. ^^

Ajay

#12 lore raw

PATCH 3/10 arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

Quoted 49 lines · Ajay kumar
Quoted 38 lines · Minkyu Kang
Quoted 30 lines · Ajay kumar

Hi Minkyu,

Quoted 12 lines · Minkyu Kang
Quoted 11 lines · Ajay Kumar

Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420 needed by exynos video driver.
Also, configure ACLK_400_DISP1 as the parent for MUX_ACLK_400_DISP1_SUB_SEL.

---
 arch/arm/cpu/armv7/exynos/clock.c         | 74 +++++++++++++++++++++++++++++--
 arch/arm/cpu/armv7/exynos/exynos5_setup.h |  2 +-
 arch/arm/include/asm/arch-exynos/clk.h    |  1 +
 3 files changed, 73 insertions(+), 4 deletions(-)
Quoted 15 lines

arch/arm/cpu/armv7/exynos/clock.c unsigned long get_lcd_clk(void) · line 1672

Quoted 12 lines

void exynos4_set_mipi_clk(void)
{
struct exynos4_clock *clk =

arch/arm/cpu/armv7/exynos/clock.c +3 -2
@@ -1602,14 +1667,17 @@ unsigned long get_lcd_clk(void)
 {
      if (cpu_is_exynos4())
              return exynos4_get_lcd_clk();
-     else
-             return exynos5_get_lcd_clk();
+     else if (proid_is_exynos5420())
+             return exynos5420_get_lcd_clk();
+     return exynos5_get_lcd_clk();

No. Please don't mix cpu_is... and proid_is....
You can refer to other functions.

Quoted 5 lines

Actually, only "cpu_is_exynos4" and "cpu_is_exynos5" are defined in cpu.h. And, I need different clock setting for 5250 and 5420.
The only way to achieve this is by calling appropriate functions based on check to proid_is_exynos5420().
Let me know if these is some other way!

unsigned long get_lcd_clk(void)

Quoted 10 lines
{
        if (cpu_is_exynos4()) {
                return exynos4_get_lcd_clk();
        } else {
                if (proid_is_exynos5420())
                        return exynos5420_get_lcd_clk();
                else
                        return exynos5_get_lcd_clk();
        }
}
Quoted 4 lines

Actually, both the ways, functionality is the same. Its just that, in your case readability is fine, and in my case the code takes fewer number of lines. ^^

At the same level if statement, it should be same level context. cpu_is... and proid_is are not same level context. Please consider it.

Thanks,
Minkyu Kang.

#13 lore raw

PATCH 3/10 arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

In reply to Minkyu Kang

Hi,

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

Hi Minkyu,

Quoted 1 line · Minkyu Kang

On 17/06/14 18:06, Ajay Kumar wrote:

[snip]

Quoted 10 lines
Quoted 8 lines
Quoted 3 lines

No. Please don't mix cpu_is... and proid_is....
You can refer to other functions.

Actually, only "cpu_is_exynos4" and "cpu_is_exynos5" are defined in cpu.h. And, I need different clock setting for 5250 and 5420.
The only way to achieve this is by calling appropriate functions based on check to proid_is_exynos5420().
Let me know if these is some other way!

unsigned long get_lcd_clk(void)

Quoted 10 lines
{
        if (cpu_is_exynos4()) {
                return exynos4_get_lcd_clk();
        } else {
                if (proid_is_exynos5420())
                        return exynos5420_get_lcd_clk();
                else
                        return exynos5_get_lcd_clk();
        }
}

Please be careful with 'else' in SPL. It can pull in code that we don't need. I think the second else here should be 'if prodid_is_exynos5250()' or something like that. Otherwise we can find ourselves including the tables for both 5250 and 5420 in the SPL for 5420. Granted we might want our SPL to support both, but if the CONFIG options are not set for both, then the user does not want both, so we should avoid waiting the code space.

Regards,
Simon

author
#14 lore raw

PATCH 4/10 video: exynos_fimd: Add framework to disable FIMD sysmmu

In reply to Ajay Kumar

On Exynos5420 and newer versions, the FIMD sysmmus are in "on state" by default.
We have to disable them in order to make FIMD DMA work. This patch adds the required framework to exynos_fimd driver, and disables FIMD sysmmu on Exynos5420.

---
 arch/arm/dts/exynos54xx.dtsi                 | 10 ++++++
 doc/device-tree-bindings/video/exynos-fb.txt |  2 ++
 drivers/video/exynos_fimd.c                  | 52 ++++++++++++++++++++++++++++
 include/fdtdec.h                             |  4 +++
 lib/fdtdec.c                                 |  2 ++
 5 files changed, 70 insertions(+)
arch/arm/dts/exynos54xx.dtsi +10 -0
index b9f8e0b..402d12b 100644
@@ -113,6 +113,16 @@
 		status = "disabled";
 	};
 
+	fimdm0_sysmmu at 0x14640000 {
+		compatible = "samsung,sysmmu-fimdm0";
+		reg = <0x14640000 0x100>;
+	};
+
+	fimdm1_sysmmu at 0x14680000 {
+		compatible = "samsung,sysmmu-fimdm1";
+		reg = <0x14680000 0x100>;
+	};
+
 	fimd at 14400000 {
 		/* sysmmu is not used in U-Boot */
 		samsung,disable-sysmmu;
doc/device-tree-bindings/video/exynos-fb.txt +2 -0
index bb7441c..7d9b995 100644
@@ -55,6 +55,8 @@ Board(panel specific):
 	samsung,pclk-name: parent clock identifier: 1(MPLL), 2(EPLL), 3(VPLL)
 	samsung,sclk-div: parent_clock/source_clock ratio
 	samsung,dual-lcd-enabled: 1 if you support two LCD, else 0
+	samsung,disable-sysmmu: present if you want to disable the sysmmu
+			(needed for Exynos5420 and newer versions)
 
 Example:
 SOC specific part:
drivers/video/exynos_fimd.c +52 -0

64 lines not on this page · raw message

include/fdtdec.h +4 -0
index a7e6ee7..3329623 100644
@@ -94,6 +94,10 @@ enum fdt_compat_id {
 	COMPAT_SANDBOX_LCD_SDL,		/* Sandbox LCD emulation with SDL */
 	COMPAT_TI_TPS65090,		/* Texas Instrument TPS65090 */
 	COMPAT_NXP_PTN3460,		/* NXP PTN3460 DP/LVDS bridge */
+	/* Exynos Display controller sysmmu0 */
+	COMPAT_SAMSUNG_EXYNOS_FIMD_SYSMMU0,
+	/* Exynos Display controller sysmmu1 */
+	COMPAT_SAMSUNG_EXYNOS_FIMD_SYSMMU1,
 
 	COMPAT_COUNT,
 };
lib/fdtdec.c +2 -0
index 13d3d2f..701169e 100644
@@ -68,6 +68,8 @@ static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(SANDBOX_LCD_SDL, "sandbox,lcd-sdl"),
 	COMPAT(TI_TPS65090, "ti,tps65090"),
 	COMPAT(COMPAT_NXP_PTN3460, "nxp,ptn3460"),
+	COMPAT(SAMSUNG_EXYNOS_FIMD_SYSMMU0, "samsung,sysmmu-fimdm0"),
+	COMPAT(SAMSUNG_EXYNOS_FIMD_SYSMMU1, "samsung,sysmmu-fimdm1"),
 };
 
 const char *fdtdec_get_compatible(enum fdt_compat_id id)
Signature · 1 line
1.8.1.2
#15 lore raw

PATCH 4/10 video: exynos_fimd: Add framework to disable FIMD sysmmu

Quoted 7 lines · Ajay Kumar

On Exynos5420 and newer versions, the FIMD sysmmus are in "on state" by default.
We have to disable them in order to make FIMD DMA work. This patch adds the required framework to exynos_fimd driver, and disables FIMD sysmmu on Exynos5420.

(I assume this is the same device tree binding as Linux?)

#16 lore raw

PATCH 4/10 video: exynos_fimd: Add framework to disable FIMD sysmmu

Hi Simon,

Quoted 7 lines · Simon Glass
Quoted 6 lines · Ajay Kumar

On Exynos5420 and newer versions, the FIMD sysmmus are in "on state" by default.
We have to disable them in order to make FIMD DMA work. This patch adds the required framework to exynos_fimd driver, and disables FIMD sysmmu on Exynos5420.

Quoted 6 lines
Quoted 1 line

(I assume this is the same device tree binding as Linux?)

Actually, No!
Kernel has a generic binding named "samsung,sysmmu-v3.3", and it is common for all sysmmu nodes. There is a seperate IOMMU driver to handle the same. We can port the device probing part from kernel to u-boot, but we would need to add seperate driver(since the name is generic) to handle the same. That driver, even though being generic, will be used only by FIMD sysmmus(that too, just to turn them off).

Ajay

Quoted 4 lines

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

#17 lore raw

PATCH 4/10 video: exynos_fimd: Add framework to disable FIMD sysmmu

Hi Ajay,

Quoted 16 lines · Ajay kumar

Hi Simon,

Quoted 12 lines · Simon Glass
Quoted 7 lines · Ajay Kumar

On Exynos5420 and newer versions, the FIMD sysmmus are in "on state" by default.
We have to disable them in order to make FIMD DMA work. This patch adds the required framework to exynos_fimd driver, and disables FIMD sysmmu on Exynos5420.

Quoted 8 lines
Quoted 1 line

(I assume this is the same device tree binding as Linux?)

Actually, No!
Kernel has a generic binding named "samsung,sysmmu-v3.3", and it is common for all sysmmu nodes. There is a seperate IOMMU driver to handle the same. We can port the device probing part from kernel to u-boot, but we would need to add seperate driver(since the name is generic) to handle the same. That driver, even though being generic, will be used only by FIMD sysmmus(that too, just to turn them off).

OK. I suppose you could add a very short new C file with a function which finds the device tree node by its compatible string or whatever, and then updates the hardware.

Regards,
Simon

#18 lore raw

PATCH 4/10 video: exynos_fimd: Add framework to disable FIMD sysmmu

Simon,

Quoted 28 lines · Simon Glass

Hi Ajay,

Quoted 16 lines · Ajay kumar

Hi Simon,

Quoted 12 lines · Simon Glass
Quoted 7 lines · Ajay Kumar

On Exynos5420 and newer versions, the FIMD sysmmus are in "on state" by default.
We have to disable them in order to make FIMD DMA work. This patch adds the required framework to exynos_fimd driver, and disables FIMD sysmmu on Exynos5420.

Quoted 8 lines
Quoted 1 line

(I assume this is the same device tree binding as Linux?)

Actually, No!
Kernel has a generic binding named "samsung,sysmmu-v3.3", and it is common for all sysmmu nodes. There is a seperate IOMMU driver to handle the same. We can port the device probing part from kernel to u-boot, but we would need to add seperate driver(since the name is generic) to handle the same. That driver, even though being generic, will be used only by FIMD sysmmus(that too, just to turn them off).

Quoted 3 lines

OK. I suppose you could add a very short new C file with a function which finds the device tree node by its compatible string or whatever, and then updates the hardware.

Ok. I will add this.

Ajay

Quoted 2 lines

Regards,
Simon

#19 lore raw

PATCH 4/10 video: exynos_fimd: Add framework to disable FIMD sysmmu

In reply to Ajay Kumar
Quoted 7 lines · Ajay Kumar

On Exynos5420 and newer versions, the FIMD sysmmus are in "on state" by default.
We have to disable them in order to make FIMD DMA work. This patch adds the required framework to exynos_fimd driver, and disables FIMD sysmmu on Exynos5420.

author
#20 lore raw

PATCH 5/10 video: Add driver for Parade PS8625 dP to LVDS bridge

In reply to Ajay Kumar

From: Vadim Bendebury <[email protected]>

The initialization table comes from the "Illustration of I2C command for initialing PS8625" document supplied by Parade.

---
 drivers/video/Makefile |   1 +
 drivers/video/parade.c | 220 +++++++++++++++++++++++++++++++++++++++++++++++++
 include/fdtdec.h       |   1 +
 lib/fdtdec.c           |   1 +
 4 files changed, 223 insertions(+)
 create mode 100644 drivers/video/parade.c
drivers/video/Makefile +1 -0
index 945f35d..8618590 100644
@@ -41,3 +41,4 @@ obj-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o videomodes.o
 obj-$(CONFIG_VIDEO_TEGRA) += tegra.o
 obj-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o
 obj-$(CONFIG_FORMIKE) += formike.o
+obj-$(CONFIG_VIDEO_PARADE) += parade.o
drivers/video/parade.c new file +220 -0

220 lines not on this page · raw message

include/fdtdec.h +1 -0
index 3329623..3f23458 100644
@@ -98,6 +98,7 @@ enum fdt_compat_id {
 	COMPAT_SAMSUNG_EXYNOS_FIMD_SYSMMU0,
 	/* Exynos Display controller sysmmu1 */
 	COMPAT_SAMSUNG_EXYNOS_FIMD_SYSMMU1,
+	COMPAT_PARADE_PS8625,		/* Parade PS8622 EDP->LVDS bridge */
 
 	COMPAT_COUNT,
 };
lib/fdtdec.c +1 -0
index 701169e..fae1257 100644
@@ -70,6 +70,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(COMPAT_NXP_PTN3460, "nxp,ptn3460"),
 	COMPAT(SAMSUNG_EXYNOS_FIMD_SYSMMU0, "samsung,sysmmu-fimdm0"),
 	COMPAT(SAMSUNG_EXYNOS_FIMD_SYSMMU1, "samsung,sysmmu-fimdm1"),
+	COMPAT(PARADE_PS8625, "parade,ps8625"),
 };
 
 const char *fdtdec_get_compatible(enum fdt_compat_id id)
Signature · 1 line
1.8.1.2
#22 lore raw

PATCH 5/10 video: Add driver for Parade PS8625 dP to LVDS bridge

In reply to Ajay Kumar
Quoted 7 lines · Ajay Kumar

From: Vadim Bendebury <[email protected]>

The initialization table comes from the "Illustration of I2C command for initialing PS8625" document supplied by Parade.

author
#23 lore raw

PATCH 6/10 ARM: exynos: Add missing declaration for gpio_direction_input

In reply to Ajay Kumar

This patch adds missing declaration for gpio_direction_input function, thereby helps in resolving compilation warnings.

---
 arch/arm/include/asm/arch-exynos/gpio.h | 1 +
 1 file changed, 1 insertion(+)
arch/arm/include/asm/arch-exynos/gpio.h +1 -0
index be5113f..8fb5c23 100644
@@ -1504,6 +1504,7 @@ static const struct gpio_name_num_table exynos5420_gpio_table[] = {
 void gpio_cfg_pin(int gpio, int cfg);
 void gpio_set_pull(int gpio, int mode);
 void gpio_set_drv(int gpio, int mode);
+int gpio_direction_input(unsigned gpio);
 int gpio_direction_output(unsigned gpio, int value);
 int gpio_set_value(unsigned gpio, int value);
 int gpio_get_value(unsigned gpio);
Signature · 1 line
1.8.1.2
#24 lore raw

PATCH 6/10 ARM: exynos: Add missing declaration for gpio_direction_input

Hi Ajay,

Quoted 21 lines · Ajay Kumar

This patch adds missing declaration for gpio_direction_input function, thereby helps in resolving compilation warnings.

---
 arch/arm/include/asm/arch-exynos/gpio.h | 1 +
 1 file changed, 1 insertion(+)
arch/arm/include/asm/arch-exynos/gpio.h +1 -1
index be5113f..8fb5c23 100644
@@ -1504,6 +1504,7 @@ static const struct gpio_name_num_table exynos5420_gpio_table[] = {
 void gpio_cfg_pin(int gpio, int cfg);
 void gpio_set_pull(int gpio, int mode);
 void gpio_set_drv(int gpio, int mode);
+int gpio_direction_input(unsigned gpio);
 int gpio_direction_output(unsigned gpio, int value);
 int gpio_set_value(unsigned gpio, int value);
 int gpio_get_value(unsigned gpio);
--
Quoted 1 line

1.8.1.2

Actually I think that the problem is that we are using asm/arch/gpio.h instead of asm/gpio.h. I have a patch that fixes this - see u-boot-dm.git branch working, commit 56236bf. I expect to send a patch next week.

Regards,
Simon

author
#25 lore raw

PATCH 7/10 exynos5420: add callbacks needed for exynos_fb driver

In reply to Ajay Kumar

Add initialization code for peach_pit panel, parade bridge chip, and backlight.

---
 arch/arm/include/asm/arch-exynos/system.h |   3 +
 board/samsung/smdk5420/smdk5420.c         | 129 +++++++++++-------------------
 2 files changed, 50 insertions(+), 82 deletions(-)
arch/arm/include/asm/arch-exynos/system.h +3 -0
index 4968d3d..320763f 100644
@@ -41,4 +41,7 @@ void set_usbhost_mode(unsigned int mode);
 void set_system_display_ctrl(void);
 int exynos_lcd_early_init(const void *blob);
 
+/* Initialize the Parade dP<->LVDS bridge if present */
+int parade_init(const void *blob);
+
 #endif	/* _EXYNOS4_SYSTEM_H */
board/samsung/smdk5420/smdk5420.c +47 -82

153 lines not on this page · raw message

Signature · 1 line
1.8.1.2
author
#27 lore raw

PATCH 8/10 ARM: exynos: peach_pit: Add DT nodes for fimd and parade bridge chip

In reply to Ajay Kumar

This patch adds DT properties for fimd and the parade bridge chip present on peach_pit. The panel supports 1366x768 resolution.

---
 arch/arm/dts/exynos5420-peach-pit.dts | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
arch/arm/dts/exynos5420-peach-pit.dts +30 -0
index 8d148af..3ed70a8 100644
@@ -63,6 +63,11 @@
 	              reg = <0x20>;
 	              compatible = "maxim,max98090-codec";
 	       };
+
+	        edp-lvds-bridge at 48 {
+	                compatible = "parade,ps8625";
+	                reg = <0x48>;
+	        };
 	};
 
         sound at 3830000 {
@@ -124,4 +129,29 @@
 	xhci at 12400000 {
 		samsung,vbus-gpio = <&gpio 0x41 0>; /* H01 */
 	};
+
+	fimd at 14400000 {
+		samsung,vl-freq = <60>;
+		samsung,vl-col = <1366>;
+		samsung,vl-row = <768>;
+		samsung,vl-width = <1366>;
+		samsung,vl-height = <768>;
+
+		samsung,vl-clkp;
+		samsung,vl-dp;
+		samsung,vl-bpix = <4>;
+
+		samsung,vl-hspw = <32>;
+		samsung,vl-hbpd = <40>;
+		samsung,vl-hfpd = <40>;
+		samsung,vl-vspw = <6>;
+		samsung,vl-vbpd = <10>;
+		samsung,vl-vfpd = <12>;
+		samsung,vl-cmd-allow-len = <0xf>;
+
+		samsung,winid = <3>;
+		samsung,interface-mode = <1>;
+		samsung,dp-enabled = <1>;
+		samsung,dual-lcd-enabled = <0>;
+	};
 };
Signature · 1 line
1.8.1.2
author
#29 lore raw

PATCH 9/10 CONFIGS: peach-pit: Enable display for peach_pit board

In reply to Ajay Kumar

Enable drivers for FIMD, DP and parade bridge chip.

---
 include/configs/peach-pit.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
include/configs/peach-pit.h +10 -0
index 76b8d7a..88c093f 100644
@@ -22,4 +22,14 @@
 #define CONFIG_SYS_PROMPT	"Peach # "
 #define CONFIG_IDENT_STRING	" for Peach"
 
+#define CONFIG_VIDEO_PARADE
+
+/* Display */
+#define CONFIG_LCD
+#ifdef CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_BPP			LCD_COLOR16
+#endif
+
 #endif	/* __CONFIG_PEACH_PIT_H */
Signature · 1 line
1.8.1.2
#30 lore raw

PATCH 9/10 CONFIGS: peach-pit: Enable display for peach_pit board

Hi Ajay,

Quoted 16 lines · Ajay Kumar

Enable drivers for FIMD, DP and parade bridge chip.

---
 include/configs/peach-pit.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
include/configs/peach-pit.h +1 -0
index 76b8d7a..88c093f 100644
@@ -22,4 +22,14 @@
 #define CONFIG_SYS_PROMPT      "Peach # "
 #define CONFIG_IDENT_STRING    " for Peach"
 
+#define CONFIG_VIDEO_PARADE

include/configs/peach-pit.h line 35

Quoted 10 lines
include/configs/peach-pit.h +9 -0
+
+/* Display */
+#define CONFIG_LCD
+#ifdef CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_BPP                        LCD_COLOR16
+#endif
+
 #endif /* __CONFIG_PEACH_PIT_H */

Can this go in exynos5420.h? It seems to be common except for the PARADE bit.

Regards,
Simon

#31 lore raw

PATCH 9/10 CONFIGS: peach-pit: Enable display for peach_pit board

Simon,

Quoted 18 lines · Simon Glass

Hi Ajay,

Quoted 15 lines · Ajay Kumar

Enable drivers for FIMD, DP and parade bridge chip.

---
 include/configs/peach-pit.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
include/configs/peach-pit.h +0 -0
index 76b8d7a..88c093f 100644
@@ -22,4 +22,14 @@
 #define CONFIG_SYS_PROMPT      "Peach # "
 #define CONFIG_IDENT_STRING    " for Peach"
 
Quoted 13 lines

include/configs/peach-pit.h line 35

Quoted 11 lines
include/configs/peach-pit.h +10 -0
+#define CONFIG_VIDEO_PARADE
+
+/* Display */
+#define CONFIG_LCD
+#ifdef CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_BPP                        LCD_COLOR16
+#endif
+
 #endif /* __CONFIG_PEACH_PIT_H */

Can this go in exynos5420.h? It seems to be common except for the PARADE bit.

No. This patchset enables display only for peach_pit. So, we cannot move this to exynos5420.h.

Ajay

Quoted 6 lines

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

#32 lore raw

PATCH 9/10 CONFIGS: peach-pit: Enable display for peach_pit board

Hi Ajay,

Quoted 34 lines · Ajay kumar

Simon,

Quoted 18 lines · Simon Glass

Hi Ajay,

Quoted 15 lines · Ajay Kumar

Enable drivers for FIMD, DP and parade bridge chip.

---
 include/configs/peach-pit.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
include/configs/peach-pit.h +0 -0
index 76b8d7a..88c093f 100644
@@ -22,4 +22,14 @@
 #define CONFIG_SYS_PROMPT      "Peach # "
 #define CONFIG_IDENT_STRING    " for Peach"
 
Quoted 13 lines

include/configs/peach-pit.h line 35

Quoted 11 lines
include/configs/peach-pit.h +10 -0
+#define CONFIG_VIDEO_PARADE
+
+/* Display */
+#define CONFIG_LCD
+#ifdef CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_BPP                        LCD_COLOR16
+#endif
+
 #endif /* __CONFIG_PEACH_PIT_H */

Can this go in exynos5420.h? It seems to be common except for the PARADE bit.

Quoted 2 lines

No. This patchset enables display only for peach_pit. So, we cannot move this to exynos5420.h.

OK. At some point I would like to come up with a generic board for exynos5 and move pit/snow/spring/pi to that. But it can come later.

Regards,
Simon

author
#33 lore raw

PATCH 10/10 Pit WIP

In reply to Ajay Kumar

From: Simon Glass <[email protected]>

WIP patch to enable cros-ec on peach_pit.

---
 drivers/misc/cros_ec_spi.c            |   4 +-
 drivers/power/pmic/Makefile           |   3 +-
 drivers/power/pmic/pmic_tps65090_ec.c | 212 ++++++++++++++++++++++++++++++++++
 drivers/spi/exynos_spi.c              |   9 +-
 drivers/spi/spi.c                     |   2 +
 include/configs/exynos5-dt.h          |   2 +-
 include/configs/peach-pit.h           |   2 +
 include/power/tps65090_pmic.h         |   6 +
 8 files changed, 232 insertions(+), 8 deletions(-)
 create mode 100644 drivers/power/pmic/pmic_tps65090_ec.c
drivers/misc/cros_ec_spi.c +2 -2
index 7df709c..015333f 100644
@@ -98,7 +98,7 @@ int cros_ec_spi_command(struct cros_ec_dev *dev, uint8_t cmd, int cmd_version,
 	}
 
 	out = dev->dout;
-	out[0] = cmd_version;
+	out[0] = EC_CMD_VERSION0 + cmd_version;
 	out[1] = cmd;
 	out[2] = (uint8_t)dout_len;
 	memcpy(out + 3, dout, dout_len);
@@ -165,7 +165,7 @@ int cros_ec_spi_decode_fdt(struct cros_ec_dev *dev, const void *blob)
  */
 int cros_ec_spi_init(struct cros_ec_dev *dev, const void *blob)
 {
-	dev->spi = spi_setup_slave_fdt(blob, dev->parent_node, dev->node);
+	dev->spi = spi_setup_slave_fdt(blob, dev->node, dev->parent_node);
 	if (!dev->spi) {
 		debug("%s: Could not setup SPI slave\n", __func__);
 		return -1;
drivers/power/pmic/Makefile +2 -1
index a472f61..e7b07eb 100644
@@ -11,7 +11,8 @@ obj-$(CONFIG_POWER_MAX8997) += pmic_max8997.o
 obj-$(CONFIG_POWER_MUIC_MAX8997) += muic_max8997.o
 obj-$(CONFIG_POWER_MAX77686) += pmic_max77686.o
 obj-$(CONFIG_POWER_PFUZE100) += pmic_pfuze100.o
-obj-$(CONFIG_POWER_TPS65090) += pmic_tps65090.o
+obj-$(CONFIG_POWER_TPS65090_I2C) += pmic_tps65090.o
+obj-$(CONFIG_POWER_TPS65090_EC) += pmic_tps65090_ec.o
 obj-$(CONFIG_POWER_TPS65217) += pmic_tps65217.o
 obj-$(CONFIG_POWER_TPS65218) += pmic_tps65218.o
 obj-$(CONFIG_POWER_TPS65910) += pmic_tps65910.o
drivers/power/pmic/pmic_tps65090_ec.c new file +212 -0

212 lines not on this page · raw message

drivers/spi/exynos_spi.c +5 -4
index 4d5def2..2839221 100644
@@ -425,10 +425,6 @@ void spi_cs_activate(struct spi_slave *slave)
 	clrbits_le32(&spi_slave->regs->cs_reg, SPI_SLAVE_SIG_INACT);
 	debug("Activate CS, bus %d\n", spi_slave->slave.bus);
 	spi_slave->skip_preamble = spi_slave->mode & SPI_PREAMBLE;
-
-	/* Remember time of this transaction so we can honour the bus delay */
-	if (spi_slave->bus->deactivate_delay_us)
-		spi_slave->last_transaction_us = timer_get_us();
 }
 
 /**
@@ -442,6 +438,11 @@ void spi_cs_deactivate(struct spi_slave *slave)
 	struct exynos_spi_slave *spi_slave = to_exynos_spi(slave);
 
 	setbits_le32(&spi_slave->regs->cs_reg, SPI_SLAVE_SIG_INACT);
+
+	/* Remember time of this transaction so we can honour the bus delay */
+	if (spi_slave->bus->deactivate_delay_us)
+		spi_slave->last_transaction_us = timer_get_us();
+
 	debug("Deactivate CS, bus %d\n", spi_slave->slave.bus);
 }
 
drivers/spi/spi.c +2 -0
index 7ddea9b..7d81fbd 100644
@@ -53,6 +53,8 @@ struct spi_slave *spi_base_setup_slave_fdt(const void *blob, int busnum,
 		mode |= SPI_CPHA;
 	if (fdtdec_get_bool(blob, node, "spi-cs-high"))
 		mode |= SPI_CS_HIGH;
+	if (fdtdec_get_bool(blob, node, "spi-half-duplex"))
+		mode |= SPI_PREAMBLE;
 	return spi_setup_slave(busnum, cs, max_hz, mode);
 }
 #endif
include/configs/exynos5-dt.h +1 -1
index b830495..dea3bd4 100644
@@ -37,8 +37,8 @@
 #define CONFIG_TRACE_EARLY_ADDR		0x50000000
 
 /* Keep L2 Cache Disabled */
-#define CONFIG_SYS_DCACHE_OFF
 #define CONFIG_SYS_CACHELINE_SIZE	64
+#define CONFIG_CMD_CACHE
 
 /* Enable ACE acceleration for SHA1 and SHA256 */
 #define CONFIG_EXYNOS_ACE_SHA
include/configs/peach-pit.h +2 -0
index 88c093f..01be8a6 100644
@@ -22,6 +22,8 @@
 #define CONFIG_SYS_PROMPT	"Peach # "
 #define CONFIG_IDENT_STRING	" for Peach"
 
+#define CONFIG_POWER_TPS65090_EC
+
 #define CONFIG_VIDEO_PARADE
 
 /* Display */
include/power/tps65090_pmic.h +6 -0
index dcf99c9..531751d 100644
@@ -18,6 +18,12 @@ enum {
 	TPS65090_ST1_STATE_MASK	= 0xf << TPS65090_ST1_STATE_SHIFT,
 };
 
+/* FET errors */
+enum {
+	FET_ERR_COMMS		= -1,	/* FET comms error */
+	FET_ERR_NOT_READY	= -2,	/* FET is not yet ready - retry */
+};
+
 /**
  * Enable FET
  *
Signature · 1 line
1.8.1.2
#34 lore raw

PATCH 10/10 Pit WIP

Hi Ajay,

Quoted 5 lines · Ajay Kumar

From: Simon Glass <[email protected]>

WIP patch to enable cros-ec on peach_pit.

Quoted 11 lines
---
 drivers/misc/cros_ec_spi.c            |   4 +-
 drivers/power/pmic/Makefile           |   3 +-
 drivers/power/pmic/pmic_tps65090_ec.c | 212 ++++++++++++++++++++++++++++++++++
 drivers/spi/exynos_spi.c              |   9 +-
 drivers/spi/spi.c                     |   2 +
 include/configs/exynos5-dt.h          |   2 +-
 include/configs/peach-pit.h           |   2 +
 include/power/tps65090_pmic.h         |   6 +
 8 files changed, 232 insertions(+), 8 deletions(-)
 create mode 100644 drivers/power/pmic/pmic_tps65090_ec.c

Yes I will put together a few patches for this, thanks for posting it. Until we have driver model I2C we are going to have to live with duplicating this driver for the EC interface.

Regards,
Simon