Re: [U-Boot] [PATCH V3 03/12] video:exynos_fb:fdt: add additional fdt data

2014-02-27 Thread Ajay kumar
Piotr,

Adding more comments.

On Thu, Feb 27, 2014 at 10:50 PM, Ajay kumar  wrote:

> Hi Piotr,
> Find my comments inline.
>
>
> On Tue, Feb 25, 2014 at 11:33 PM, Piotr Wilczek wrote:
>
>> This patch adds additional data parsing from DTB and adds the new
>> exynos_lcd_panel_init() function for panel specific initialisation
>> from the board file.
>>
>> Signed-off-by: Piotr Wilczek 
>> Signed-off-by: Kyungmin Park 
>> Cc: Minkyu Kang 
>> ---
>> Changes for v3:
>>  - none
>>
>> Changes for v2:
>>  - removed duplicate DTB node parsing for panel_info.logo_on
>>  - added (weak) exynos_lcd_panel_init function for panel specific
>> initialisation from board file
>>
>>  drivers/video/exynos_fb.c | 21 +
>>  1 file changed, 21 insertions(+)
>>
>> diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
>> index 00a0a11..88d9037 100644
>> --- a/drivers/video/exynos_fb.c
>> +++ b/drivers/video/exynos_fb.c
>> @@ -104,6 +104,13 @@ void __exynos_backlight_reset(void)
>>  void exynos_backlight_reset(void)
>> __attribute__((weak, alias("__exynos_backlight_reset")));
>>
>> +int __exynos_lcd_panel_init(vidinfo_t *vid)
>> +{
>> +   return 0;
>> +}
>> +int exynos_lcd_panel_init(vidinfo_t *vid)
>> +   __attribute__((weak, alias("__exynos_lcd_panel_init")));
>> +
>>
> This is redundant! We already have exynos_cfg_lcd_gpio, exynos_lcd_power_on
> and other similar functions to support "panel init".
> Please check board/samsung/smdk5250.c
>
>>  static void lcd_panel_on(vidinfo_t *vid)
>>  {
>> udelay(vid->init_delay);
>> @@ -269,6 +276,15 @@ int exynos_fimd_parse_dt(const void *blob)
>> panel_info.dual_lcd_enabled = fdtdec_get_int(blob, node,
>>
>> "samsung,dual-lcd-enabled", 0);
>>
>> +   panel_info.resolution = fdtdec_get_int(blob, node,
>> +   "samsung,resolution", 0);
>> +
>> +   panel_info.rgb_mode = fdtdec_get_int(blob, node,
>> +   "samsung,rgb-mode", 0);
>> +
>> +   panel_info.power_on_delay = fdtdec_get_int(blob, node,
>> +   "samsung,power-on-delay",
>> 0);
>> +
>>
> All the above DT properties are already present in the same file!
> This are definitely duplicate entries.
> For passing resolution, please use "samsung,vl-col" and "samsung,vl-row"
>
>> return 0;
>>  }
>>  #endif
>> @@ -281,10 +297,15 @@ void lcd_ctrl_init(void *lcdbase)
>>  #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
>> +   exynos_lcd_panel_init(&panel_info);
>>
> This is already present as part of lcd_enable in same file!
> Please check it.
>
Ok. I just heard from MIPI-DSI engineer that MIPI-DSI should
usually be initialized before FIMD video output starts.

Is that the reason why you are trying to do panel_init here?
That seems ok, but definitely you should not be using a new
function for that.

Use something like below snippet:

/* exynos_fb.c */
.
lcd_ctrl_init()
{.
.
.
if(CONFIG_EXYNOS_MIPI...)
call lcd_panel_on  /* MIPI-DSI to be initialized before FIMD init */
.
do exynos_lcd_init() /* FIMD init */
.
}
.
.
.
.
lcd_enable()
{
.
.
if(CONFIG_EXYNOS_DP...)
call lcd_panel_on /* DP to be initialized after FIMD init */
.
.
}

>   #else
>> /* initialize parameters which is specific to panel. */
>> init_panel_info(&panel_info);
>>  #endif
>> +
>> panel_width = panel_info.vl_width;
>> panel_height = panel_info.vl_height;
>>
>> --
>> 1.8.3.2
>>
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>>
>
>
> Regards,
> Ajay Kumar
>

Regards,
Ajay Kumar
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V3 03/12] video:exynos_fb:fdt: add additional fdt data

2014-02-27 Thread Ajay kumar
Hi Piotr,
Find my comments inline.


On Tue, Feb 25, 2014 at 11:33 PM, Piotr Wilczek wrote:

> This patch adds additional data parsing from DTB and adds the new
> exynos_lcd_panel_init() function for panel specific initialisation
> from the board file.
>
> Signed-off-by: Piotr Wilczek 
> Signed-off-by: Kyungmin Park 
> Cc: Minkyu Kang 
> ---
> Changes for v3:
>  - none
>
> Changes for v2:
>  - removed duplicate DTB node parsing for panel_info.logo_on
>  - added (weak) exynos_lcd_panel_init function for panel specific
> initialisation from board file
>
>  drivers/video/exynos_fb.c | 21 +
>  1 file changed, 21 insertions(+)
>
> diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
> index 00a0a11..88d9037 100644
> --- a/drivers/video/exynos_fb.c
> +++ b/drivers/video/exynos_fb.c
> @@ -104,6 +104,13 @@ void __exynos_backlight_reset(void)
>  void exynos_backlight_reset(void)
> __attribute__((weak, alias("__exynos_backlight_reset")));
>
> +int __exynos_lcd_panel_init(vidinfo_t *vid)
> +{
> +   return 0;
> +}
> +int exynos_lcd_panel_init(vidinfo_t *vid)
> +   __attribute__((weak, alias("__exynos_lcd_panel_init")));
> +
>
This is redundant! We already have exynos_cfg_lcd_gpio, exynos_lcd_power_on
and other similar functions to support "panel init".
Please check board/samsung/smdk5250.c

>  static void lcd_panel_on(vidinfo_t *vid)
>  {
> udelay(vid->init_delay);
> @@ -269,6 +276,15 @@ int exynos_fimd_parse_dt(const void *blob)
> panel_info.dual_lcd_enabled = fdtdec_get_int(blob, node,
>
> "samsung,dual-lcd-enabled", 0);
>
> +   panel_info.resolution = fdtdec_get_int(blob, node,
> +   "samsung,resolution", 0);
> +
> +   panel_info.rgb_mode = fdtdec_get_int(blob, node,
> +   "samsung,rgb-mode", 0);
> +
> +   panel_info.power_on_delay = fdtdec_get_int(blob, node,
> +   "samsung,power-on-delay",
> 0);
> +
>
All the above DT properties are already present in the same file!
This are definitely duplicate entries.
For passing resolution, please use "samsung,vl-col" and "samsung,vl-row"

> return 0;
>  }
>  #endif
> @@ -281,10 +297,15 @@ void lcd_ctrl_init(void *lcdbase)
>  #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
> +   exynos_lcd_panel_init(&panel_info);
>
This is already present as part of lcd_enable in same file!
Please check it.

>  #else
> /* initialize parameters which is specific to panel. */
>     init_panel_info(&panel_info);
>  #endif
> +
> panel_width = panel_info.vl_width;
> panel_height = panel_info.vl_height;
>
> --
> 1.8.3.2
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>


Regards,
Ajay Kumar
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V3 02/12] video:mipidsim:fdt: Add DT support for mipi dsim driver

2014-02-27 Thread Ajay kumar
g_dt.esc_clk = fdtdec_get_int(blob, node,
> +   "samsung,dsim-config-esc_clk", 0);
> +
> +   dsim_config_dt.stop_holding_cnt = fdtdec_get_int(blob, node,
> +   "samsung,dsim-config-stop_holding_cnt", 0);
> +
> +   dsim_config_dt.bta_timeout = fdtdec_get_int(blob, node,
> +   "samsung,dsim-config-bta_timeout", 0);
> +
> +   dsim_config_dt.rx_timeout = fdtdec_get_int(blob, node,
> +   "samsung,dsim-config-rx_timeout", 0);
> +
> +   mipi_lcd_device_dt.name = fdtdec_get_config_string(blob,
> +   "samsung,dsim-device-name");
> +
> +   mipi_lcd_device_dt.id = fdtdec_get_int(blob, node,
> +   "samsung,dsim-device-id", 0);
> +
> +   mipi_lcd_device_dt.bus_id = fdtdec_get_int(blob, node,
> +   "samsung,dsim-device-bus_id", 0);
> +
> +   mipi_lcd_device_dt.reverse_panel = fdtdec_get_int(blob, node,
> +   "samsung,dsim-device-reverse_panel", 0);
> +
> +   return 0;
> +}
> +
> +void exynos_init_dsim_platform_data(vidinfo_t *vid)
> +{
> +   if (exynos_dsim_config_parse_dt(gd->fdt_blob))
> +   debug("Can't get proper dsim config.\n");
> +
> +   strcpy(dsim_platform_data_dt.lcd_panel_name,
> mipi_lcd_device_dt.name);
> +   dsim_platform_data_dt.dsim_config = &dsim_config_dt;
> +   dsim_platform_data_dt.mipi_power = mipi_power;
> +   dsim_platform_data_dt.phy_enable = set_mipi_phy_ctrl;
> +   dsim_platform_data_dt.lcd_panel_info = (void *)vid;
> +
> +   mipi_lcd_device_dt.platform_data = (void *)&dsim_platform_data_dt;
> +   exynos_mipi_dsi_register_lcd_device(&mipi_lcd_device_dt);
> +
> +   dsim_pd = &dsim_platform_data_dt;
> +}
> +#endif
> diff --git a/include/fdtdec.h b/include/fdtdec.h
> index 19bab79..bd84c83 100644
> --- a/include/fdtdec.h
> +++ b/include/fdtdec.h
> @@ -79,6 +79,7 @@ enum fdt_compat_id {
> COMPAT_SAMSUNG_EXYNOS5_USB3_PHY,/* Exynos phy controller for
> usb3.0 */
> COMPAT_SAMSUNG_EXYNOS_TMU,  /* Exynos TMU */
> COMPAT_SAMSUNG_EXYNOS_FIMD, /* Exynos Display controller */
> +   COMPAT_SAMSUNG_EXYNOS_MIPI_DSI, /* Exynos mipi dsi */
> COMPAT_SAMSUNG_EXYNOS5_DP,  /* Exynos Display port controller
> */
> COMPAT_SAMSUNG_EXYNOS5_DWMMC,   /* Exynos5 DWMMC controller */
> COMPAT_SAMSUNG_EXYNOS_SERIAL,   /* Exynos UART */
> diff --git a/lib/fdtdec.c b/lib/fdtdec.c
> index 1fecab3..c97fad3 100644
> --- a/lib/fdtdec.c
> +++ b/lib/fdtdec.c
> @@ -52,6 +52,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
> COMPAT(SAMSUNG_EXYNOS5_USB3_PHY, "samsung,exynos5250-usb3-phy"),
> COMPAT(SAMSUNG_EXYNOS_TMU, "samsung,exynos-tmu"),
> COMPAT(SAMSUNG_EXYNOS_FIMD, "samsung,exynos-fimd"),
> +   COMPAT(SAMSUNG_EXYNOS_MIPI_DSI, "samsung,exynos-mipi-dsi"),
> COMPAT(SAMSUNG_EXYNOS5_DP, "samsung,exynos5-dp"),
> COMPAT(SAMSUNG_EXYNOS5_DWMMC, "samsung,exynos5250-dwmmc"),
> COMPAT(SAMSUNG_EXYNOS_SERIAL, "samsung,exynos4210-uart"),
> --
> 1.8.3.2
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

Regards,
Ajay Kumar
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 1/7] exynos_fb: Remove usage of static defines

2013-11-12 Thread 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.

Signed-off-by: Ajay Kumar 
---
 arch/arm/include/asm/arch-exynos/system.h |  1 +
 board/samsung/common/board.c  | 15 +++
 drivers/video/exynos_fb.c | 20 ++--
 include/configs/exynos5250-dt.h   |  2 --
 4 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/system.h 
b/arch/arm/include/asm/arch-exynos/system.h
index 7e2057c..4968d3d 100644
--- a/arch/arm/include/asm/arch-exynos/system.h
+++ b/arch/arm/include/asm/arch-exynos/system.h
@@ -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 */
diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index cc83724..2536457 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -135,6 +136,20 @@ int board_early_init_f(void)
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
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 err;
 }
 #endif
diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index 7d4c6e0..69899a1 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -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
 
@@ -159,7 +154,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);
@@ -303,10 +298,7 @@ void lcd_ctrl_init(void *lcdbase)
set_system_display_ctrl();
set_lcd_clk();
 
-#ifdef CONFIG_OF_CONTROL
-   if (exynos_fimd_parse_dt(gd->fdt_blob))
-   debug("Can't get proper panel info\n");
-#else
+#ifndef CONFIG_OF_CONTROL
/* initialize parameters which is specific to panel. */
init_panel_info(&panel_info);
 #endif
diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 689919d..508962c 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -50,8 +50,6 @@
 #ifdef CONFIG_LCD
 #define CONFIG_EXYNOS_FB
 #define CONFIG_EXYNOS_DP
-#define LCD_XRES   2560
-#define LCD_YRES   1600
 #define LCD_BPPLCD_COLOR16
 #endif
 #endif  /* __CONFIG_5250_H */
-- 
1.7.12.4

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


[U-Boot] [PATCH V2 2/7] arm: exynos: Add RPLL for Exynos5420

2013-11-12 Thread Ajay Kumar
RPLL is needed to drive the LCD panel on Exynos5420 based boards.

Signed-off-by: Ajay Kumar 
---
 arch/arm/cpu/armv7/exynos/clock_init.h |  3 +++
 arch/arm/cpu/armv7/exynos/clock_init_exynos5.c | 13 +
 2 files changed, 16 insertions(+)

diff --git a/arch/arm/cpu/armv7/exynos/clock_init.h 
b/arch/arm/cpu/armv7/exynos/clock_init.h
index a875d0b..fce502f 100644
--- a/arch/arm/cpu/armv7/exynos/clock_init.h
+++ b/arch/arm/cpu/armv7/exynos/clock_init.h
@@ -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];
 
diff --git a/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c 
b/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
index e7f1496..c91c4a1 100644
--- a/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
+++ b/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
@@ -179,6 +179,10 @@ struct mem_timings mem_timings[] = {
.spll_mdiv = 0xc8,
.spll_pdiv = 0x3,
.spll_sdiv = 0x2,
+   /* RPLL @266MHz */
+   .rpll_mdiv = 0x10A,
+   .rpll_pdiv = 0x3,
+   .rpll_sdiv = 0x3,
 
.direct_cmd_msr = {
0x00020018, 0x0003, 0x00010046, 0x0d70,
@@ -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);
 
-- 
1.7.12.4

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


[U-Boot] [PATCH V2 0/7] SMDK5420: Add support for FIMD and DP

2013-11-12 Thread Ajay Kumar
This patchset adds support for FIMD and DP on SMDK5420.

This patchset is rebased on Rajeshwari's latest SMDK5420 patchset:
[PATCH 00/10 V6] EXYNOS5420: Add SMDK5420 board support
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/172653

For testing we need:
Naveen's i2c patchset:
i2c: improve s3c24x0 with High-speed and new SYS_I2C framework support
http://www.mail-archive.com/u-boot@lists.denx.de/msg122679.html
Leela's PMIC patchset:
[PATCH V3 0/6] SMDK5420: Add S2MPS11 pmic support to SMDK5420
http://www.mail-archive.com/u-boot@lists.denx.de/msg125733.html

Changes since V1:
[PATCH V2 4/7] - Read FIMD sysmmu addresses from DT
 instead of hardcoding them.
[PATCH V2 5/7] - Remove hardcoded i2c setting for enabling
 VDD_28IO_DP
[PATCH V2 6/7] - Enable VDD_28IO_DP in standard PMIC way

Ajay Kumar (7):
  [PATCH V2 1/7] exynos_fb: Remove usage of static defines
  [PATCH V2 2/7] arm: exynos: Add RPLL for Exynos5420
  [PATCH V2 3/7] arm: exynos: Add get_lcd_clk and set_lcd_clk
 callbacks for Exynos5420
  [PATCH V2 4/7] video: exynos_fimd: Add framework to disable FIMD sysmmu
  [PATCH V2 5/7] smdk5420: Implement callbacks needed by exynos_fb driver
  [PATCH V2 6/7] exynos: s2mps11_pmic: Enable LDO38 for SMDK5420
  [PATCH V2 7/7] CONFIG: SMDK5420: Enable FIMD and DP

 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.dtsi   |   7 ++
 arch/arm/include/asm/arch-exynos/clk.h |   1 +
 arch/arm/include/asm/arch-exynos/system.h  |   1 +
 board/samsung/common/board.c   |  18 +
 board/samsung/smdk5420/smdk5420.c  | 102 +
 doc/device-tree-bindings/video/exynos-fb.txt   |   4 +
 drivers/video/exynos_fb.c  |  20 ++---
 drivers/video/exynos_fimd.c|  24 ++
 include/configs/exynos5250-dt.h|   2 -
 include/configs/smdk5420.h |   8 ++
 include/power/s2mps11_pmic.h   |   3 +
 15 files changed, 177 insertions(+), 105 deletions(-)

-- 
1.7.12.4

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


[U-Boot] [PATCH V3 3/7] arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

2013-11-12 Thread 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.

Signed-off-by: Ajay Kumar 
---
 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(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index b52e61a..60ca7ea 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -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;
@@ -1038,6 +1042,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 =
@@ -1162,6 +1200,33 @@ void exynos5_set_lcd_clk(void)
writel(cfg, &clk->div_disp1_0);
 }
 
+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 =
@@ -1657,14 +1722,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();
 }
diff --git a/arch/arm/cpu/armv7/exynos/exynos5_setup.h 
b/arch/arm/cpu/armv7/exynos/exynos5_setup.h
index 8e05a00..70b1c04 100644
--- a/arch/arm/cpu/armv7/exynos/exynos5_setup.h
+++ b/arch/arm/cpu/armv7/exynos/exynos5_setup.h
@@ -780,7 +780,7 @@
 #define CLK_SRC_TOP2_VAL   0x11101000
 #define CLK_SRC_TOP3_VAL   0x
 #define CLK_SRC_TOP4_VAL   0x0111
-#define CLK_SRC_TOP5_VAL   0x1100
+#define CLK_SRC_TOP5_VAL   0x1101
 #define CLK_SRC_TOP6_VAL   0x0111
 #define CLK_SRC_TOP7_VAL   0x00022200
 
diff --git a/arch/arm/include/asm/arch-exynos/clk.h 
b/arch/arm/include/asm/arch-exynos/clk.h
index cdeef32..98faae7 100644
--- a/arch/arm/include/asm/arch-exynos/clk.h
+++ b/arch/arm/include/asm/arch-exynos/clk.h
@@ -15,6 +15,7 @@
 #define VPLL   4
 #define BPLL   5
 #define RPLL   6
+#define SPLL   7
 
 enum pll_src_bit {
EXYNOS_SRC_MPLL = 6,
-- 
1.7.12.4

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


[U-Boot] [PATCH V2 7/7] CONFIG: SMDK5420: Enable FIMD and DP

2013-11-12 Thread Ajay Kumar
Enable FIMD and DP drivers on SMDK5420 so that we get to
see the LCD console on eDP panel.

Signed-off-by: Ajay Kumar 
---
 include/configs/smdk5420.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/include/configs/smdk5420.h b/include/configs/smdk5420.h
index 46aeec0..d3fa49b 100644
--- a/include/configs/smdk5420.h
+++ b/include/configs/smdk5420.h
@@ -57,4 +57,12 @@
 #define CONFIG_POWER_I2C
 #define CONFIG_POWER_S2MPS11
 
+/* Display */
+#define CONFIG_LCD
+#ifdef CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_BPPLCD_COLOR16
+#endif
+
 #endif /* __CONFIG_5420_H */
-- 
1.7.12.4

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


[U-Boot] [PATCH V2 4/7] video: exynos_fimd: Add framework to disable FIMD sysmmu

2013-11-12 Thread 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.

Signed-off-by: Ajay Kumar 
---
 arch/arm/dts/exynos5420.dtsi |  7 +++
 doc/device-tree-bindings/video/exynos-fb.txt |  4 
 drivers/video/exynos_fimd.c  | 24 
 3 files changed, 35 insertions(+)

diff --git a/arch/arm/dts/exynos5420.dtsi b/arch/arm/dts/exynos5420.dtsi
index ca6c605..7443953 100644
--- a/arch/arm/dts/exynos5420.dtsi
+++ b/arch/arm/dts/exynos5420.dtsi
@@ -71,4 +71,11 @@
reg = <0x12E2 0x100>;
interrupts = <0 203 0>;
};
+
+   fimd@1440 {
+   /* sysmmu is not used in U-Boot */
+   samsung,disable-sysmmu;
+   samsung,sysmmu-fimdm0 = <0x1464>;
+   samsung,sysmmu-fimdm1 = <0x1468>;
+   };
 };
diff --git a/doc/device-tree-bindings/video/exynos-fb.txt 
b/doc/device-tree-bindings/video/exynos-fb.txt
index bb7441c..9ba2c47 100644
--- a/doc/device-tree-bindings/video/exynos-fb.txt
+++ b/doc/device-tree-bindings/video/exynos-fb.txt
@@ -55,6 +55,10 @@ 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)
+   samsung,sysmmu-fimdm0: Address of sysmmufimdm0 MMU_CTRL
+   samsung,sysmmu-fimdm1: Address of sysmmufimdm1 MMU_CTRL
 
 Example:
 SOC specific part:
diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
index f962c4f..bffc8fa 100644
--- a/drivers/video/exynos_fimd.c
+++ b/drivers/video/exynos_fimd.c
@@ -257,6 +257,7 @@ void exynos_fimd_lcd_init(vidinfo_t *vid)
unsigned int offset;
 #ifdef CONFIG_OF_CONTROL
unsigned int node;
+   u32 *sysmmufimdm0, *sysmmufimdm1;
 
node = fdtdec_next_compatible(gd->fdt_blob,
0, COMPAT_SAMSUNG_EXYNOS_FIMD);
@@ -267,6 +268,29 @@ void exynos_fimd_lcd_init(vidinfo_t *vid)
node, "reg");
if (fimd_ctrl == NULL)
debug("Can't get the FIMD base address\n");
+
+   if (fdtdec_get_bool(gd->fdt_blob, node, "samsung,disable-sysmmu")) {
+   /*
+   * The reset value for FIMD SYSMMU register MMU_CTRL is 3
+   * on Exynos5420 and newer versions.
+   * This means FIMD SYSMMU is on by default on Exynos5420
+   * and newer versions.
+   * Since in u-boot we don't use SYSMMU, we should disable
+   * those FIMD SYSMMU.
+   */
+   sysmmufimdm0 = (u32 *)fdtdec_get_int(gd->fdt_blob, node,
+   "samsung,sysmmu-fimdm0", 0);
+   if (!sysmmufimdm0)
+   debug("Can't get sysmmufimdm0");
+
+   sysmmufimdm1 = (u32 *)fdtdec_get_int(gd->fdt_blob, node,
+   "samsung,sysmmu-fimdm1", 0);
+   if (!sysmmufimdm1)
+   debug("Can't get sysmmufimdm1");
+
+   writel(0x0, sysmmufimdm0);
+   writel(0x0, sysmmufimdm1);
+   }
 #else
fimd_ctrl = (struct exynos_fb *)samsung_get_base_fimd();
 #endif
-- 
1.7.12.4

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


[U-Boot] [PATCH V2 5/7] smdk5420: Implement callbacks needed by exynos_fb driver

2013-11-12 Thread Ajay Kumar
Add callbacks to set up DP-HPD, backlight and LCD power
on SMDK5420.

Signed-off-by: Ajay Kumar 
---
 board/samsung/smdk5420/smdk5420.c | 102 +++---
 1 file changed, 17 insertions(+), 85 deletions(-)

diff --git a/board/samsung/smdk5420/smdk5420.c 
b/board/samsung/smdk5420/smdk5420.c
index d85b953..75b22cc 100644
--- a/board/samsung/smdk5420/smdk5420.c
+++ b/board/samsung/smdk5420/smdk5420.c
@@ -43,98 +43,30 @@ int exynos_init(void)
 }
 
 #ifdef CONFIG_LCD
-void cfg_lcd_gpio(void)
+void exynos_cfg_lcd_gpio(void)
 {
-   struct exynos5_gpio_part1 *gpio1 =
-   (struct exynos5_gpio_part1 *)samsung_get_base_gpio_part1();
-
-   /* For Backlight */
-   s5p_gpio_cfg_pin(&gpio1->b2, 0, GPIO_OUTPUT);
-   s5p_gpio_set_value(&gpio1->b2, 0, 1);
-
-   /* LCD power on */
-   s5p_gpio_cfg_pin(&gpio1->x1, 5, GPIO_OUTPUT);
-   s5p_gpio_set_value(&gpio1->x1, 5, 1);
+   struct exynos5420_gpio_part2 *gpio2 =
+   (struct exynos5420_gpio_part2 *)samsung_get_base_gpio_part2();
 
/* Set Hotplug detect for DP */
-   s5p_gpio_cfg_pin(&gpio1->x0, 7, GPIO_FUNC(0x3));
+   s5p_gpio_cfg_pin(&gpio2->x0, 7, GPIO_FUNC(0x3));
 }
 
-vidinfo_t panel_info = {
-   .vl_freq= 60,
-   .vl_col = 2560,
-   .vl_row = 1600,
-   .vl_width   = 2560,
-   .vl_height  = 1600,
-   .vl_clkp= CONFIG_SYS_LOW,
-   .vl_hsp = CONFIG_SYS_LOW,
-   .vl_vsp = CONFIG_SYS_LOW,
-   .vl_dp  = CONFIG_SYS_LOW,
-   .vl_bpix= 4,/* LCD_BPP = 2^4, for output conosle on LCD */
-
-   /* wDP panel timing infomation */
-   .vl_hspw= 32,
-   .vl_hbpd= 80,
-   .vl_hfpd= 48,
-
-   .vl_vspw= 6,
-   .vl_vbpd= 37,
-   .vl_vfpd= 3,
-   .vl_cmd_allow_len = 0xf,
-
-   .win_id = 3,
-   .cfg_gpio   = cfg_lcd_gpio,
-   .backlight_on   = NULL,
-   .lcd_power_on   = NULL,
-   .reset_lcd  = NULL,
-   .dual_lcd_enabled = 0,
-
-   .init_delay = 0,
-   .power_on_delay = 0,
-   .reset_delay= 0,
-   .interface_mode = FIMD_RGB_INTERFACE,
-   .dp_enabled = 1,
-};
-
-static struct edp_device_info edp_info = {
-   .disp_info = {
-   .h_res = 2560,
-   .h_sync_width = 32,
-   .h_back_porch = 80,
-   .h_front_porch = 48,
-   .v_res = 1600,
-   .v_sync_width  = 6,
-   .v_back_porch = 37,
-   .v_front_porch = 3,
-   .v_sync_rate = 60,
-   },
-   .lt_info = {
-   .lt_status = DP_LT_NONE,
-   },
-   .video_info = {
-   .master_mode = 0,
-   .bist_mode = DP_DISABLE,
-   .bist_pattern = NO_PATTERN,
-   .h_sync_polarity = 0,
-   .v_sync_polarity = 0,
-   .interlaced = 0,
-   .color_space = COLOR_RGB,
-   .dynamic_range = VESA,
-   .ycbcr_coeff = COLOR_YCBCR601,
-   .color_depth = COLOR_8,
-   },
-};
-
-static struct exynos_dp_platform_data dp_platform_data = {
-   .phy_enable = set_dp_phy_ctrl,
-   .edp_dev_info   = &edp_info,
-};
-
-void init_panel_info(vidinfo_t *vid)
+void exynos_backlight_on(unsigned int onoff)
 {
-   vid->rgb_mode   = MODE_RGB_P,
+   struct exynos5420_gpio_part1 *gpio1 =
+   (struct exynos5420_gpio_part1 *)samsung_get_base_gpio_part1();
+
+   struct exynos5420_gpio_part2 *gpio2 =
+   (struct exynos5420_gpio_part2 *)samsung_get_base_gpio_part2();
+
+   /* For PWM */
+   s5p_gpio_cfg_pin(&gpio1->b2, 0, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->b2, 0, 1);
 
-   exynos_set_dp_platform_data(&dp_platform_data);
+   /* BL_EN */
+   s5p_gpio_cfg_pin(&gpio2->x1, 5, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio2->x1, 5, 1);
 }
 #endif
 
-- 
1.7.12.4

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


[U-Boot] [PATCH V2 6/7] exynos: s2mps11_pmic: Enable LDO38 for SMDK5420

2013-11-12 Thread Ajay Kumar
Enabling VDD_28IO_DP via LDO38 for SMDK5420.

Signed-off-by: Ajay Kumar 
---
 board/samsung/common/board.c | 3 +++
 include/power/s2mps11_pmic.h | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 2536457..224f83d 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -180,6 +180,9 @@ int board_init_s2mps11(void)
{PMIC_REG_WRITE, S2MPS11_BUCK3_CTRL2, S2MPS11_BUCK_CTRL2_1V},
{PMIC_REG_WRITE, S2MPS11_BUCK4_CTRL2, S2MPS11_BUCK_CTRL2_1V},
{PMIC_REG_WRITE, S2MPS11_BUCK6_CTRL2, S2MPS11_BUCK_CTRL2_1V},
+#ifdef CONFIG_SMDK5420
+   {PMIC_REG_WRITE, S2MPS11_LDO38_CTRL, S2MPS11_LDO_CTRL_2_8V},
+#endif
{PMIC_REG_UPDATE, S2MPS11_REG_RTC_CTRL,
S2MPS11_RTC_CTRL_32KHZ_CP_EN | S2MPS11_RTC_CTRL_JIT},
{PMIC_REG_BAIL}
diff --git a/include/power/s2mps11_pmic.h b/include/power/s2mps11_pmic.h
index 20c781d..8c6bf4b 100644
--- a/include/power/s2mps11_pmic.h
+++ b/include/power/s2mps11_pmic.h
@@ -125,6 +125,8 @@ enum s2mps11_reg {
 #define S2MPS11_BUCK_CTRL2_1_2V0x60
 /* Value to set voltage as 1.2625V */
 #define S2MPS11_BUCK_CTRL2_1_2625V 0x6A
+/* Value to set voltage as 2.8V */
+#define S2MPS11_LDO_CTRL_2_8V  0x78
 
 /* Buck register addresses */
 #define S2MPS11_BUCK1_CTRL20x26
@@ -133,6 +135,7 @@ enum s2mps11_reg {
 #define S2MPS11_BUCK4_CTRL20x2c
 #define S2MPS11_BUCK6_CTRL20x34
 #define S2MPS11_LDO22_CTRL 0x52
+#define S2MPS11_LDO38_CTRL 0x62
 
 #define S2MPS11_DEVICE_NAME "S2MPS11_PMIC"
 
-- 
1.7.12.4

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


Re: [U-Boot] FW: [PATCH 06/10] video: exynos: fimd: always use 16bpp display mode.

2013-12-10 Thread Ajay kumar
Hi Marczak,


On Tue, Dec 10, 2013 at 1:45 PM, Przemyslaw Marczak
wrote:

> Hello Donghwa,
>
> On 12/10/2013 06:47 AM, Donghwa Lee wrote:
> > Hi,
> >
> > On 3 Dec 2013 18:03, Przemyslaw wrote:
> >> This change updates exynos board files too.
> >> 16 bpp mode is required by LCD console mode.
> >>
> >> Signed-off-by: Przemyslaw Marczak 
> >> ---
> >>   board/samsung/trats/trats.c  |2 +-
> >>   board/samsung/trats2/trats2.c|2 +-
> >>   board/samsung/universal_c210/universal.c |2 +-
> >>   drivers/video/exynos_fimd.c  |   10 ++
> >>   include/configs/s5pc210_universal.h  |2 +-
> >>   include/configs/trats.h  |2 +-
> >>   include/configs/trats2.h |2 +-
> >>   7 files changed, 8 insertions(+), 14 deletions(-)
> >>
> >> diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
> >> index ce4b41f..db527c7 100644
> >> --- a/board/samsung/trats/trats.c
> >> +++ b/board/samsung/trats/trats.c
> >> @@ -739,7 +739,7 @@ vidinfo_t panel_info = {
> >>  .vl_hsp = CONFIG_SYS_LOW,
> >>  .vl_vsp = CONFIG_SYS_LOW,
> >>  .vl_dp  = CONFIG_SYS_LOW,
> >> -.vl_bpix= 5,/* Bits per pixel, 2^5 = 32 */
> >> +.vl_bpix= 4,/* Bits per pixel, 2^4 = 16 */
> >>
> >>  /* s6e8ax0 Panel infomation */
> >>  .vl_hspw= 5,
> >> diff --git a/board/samsung/trats2/trats2.c
> b/board/samsung/trats2/trats2.c
> >> index 73b8cc1..6fa02c9 100644
> >> --- a/board/samsung/trats2/trats2.c
> >> +++ b/board/samsung/trats2/trats2.c
> >> @@ -542,7 +542,7 @@ vidinfo_t panel_info = {
> >>  .vl_hsp = CONFIG_SYS_LOW,
> >>  .vl_vsp = CONFIG_SYS_LOW,
> >>  .vl_dp  = CONFIG_SYS_LOW,
> >> -.vl_bpix= 5,/* Bits per pixel, 2^5 = 32 */
> >> +.vl_bpix= 4,/* Bits per pixel, 2^4 = 16 */
> >>
> >>  /* s6e8ax0 Panel infomation */
> >>  .vl_hspw= 5,
> >> diff --git a/board/samsung/universal_c210/universal.c
> >> b/board/samsung/universal_c210/universal.c
> >> index 166d5ee..1ebea0f 100644
> >> --- a/board/samsung/universal_c210/universal.c
> >> +++ b/board/samsung/universal_c210/universal.c
> >> @@ -446,7 +446,7 @@ vidinfo_t panel_info = {
> >>  .vl_vsp = CONFIG_SYS_HIGH,
> >>  .vl_dp  = CONFIG_SYS_HIGH,
> >>
> >> -.vl_bpix= 5,/* Bits per pixel */
> >> +.vl_bpix= 4,/* Bits per pixel */
> >>
> >>  /* LD9040 LCD Panel */
> >>  .vl_hspw= 2,
> >> diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
> >> index f962c4f..847fbe8 100644
> >> --- a/drivers/video/exynos_fimd.c
> >> +++ b/drivers/video/exynos_fimd.c
> >> @@ -73,18 +73,12 @@ static void exynos_fimd_set_par(unsigned int win_id)
> >>  /* DATAPATH is DMA */
> >>  cfg |= EXYNOS_WINCON_DATAPATH_DMA;
> >>
> >> -if (pvid->logo_on) /* To get proprietary LOGO */
> >> -cfg |= EXYNOS_WINCON_WSWP_ENABLE;
> >> -else /* To get output console on LCD */
> >> -cfg |= EXYNOS_WINCON_HAWSWP_ENABLE;
> >> +cfg |= EXYNOS_WINCON_HAWSWP_ENABLE;
> >>
>
>>  /* dma burst is 16 */
> >>  cfg |= EXYNOS_WINCON_BURSTLEN_16WORD;
> >>
> >> -if (pvid->logo_on) /* To get proprietary LOGO */
> >> -cfg |= EXYNOS_WINCON_BPPMODE_24BPP_888;
> >> -else /* To get output console on LCD */
> >> -cfg |= EXYNOS_WINCON_BPPMODE_16BPP_565;
> >> +cfg |= EXYNOS_WINCON_BPPMODE_16BPP_565;
> >>
> >
> > Why does exynos fimd always use 16bpp display mode?
>
> Good question. I switched fimd to 16BPP because of LCD framework which
> supports in max 16BPP mode for LCD console. Leaving fimd 32BPP mode and
> 16BPP console is possible but it causes wrong setup of lcd console row
> and columns, it also displays wrong size fonts.
>
> > It could be used as other bpp modes in exynos.
> > How do you use above vl_bpix variable in panel_info structure to check
> bpp mode?
>
> Actually vl_bpix was never used to check BPP mode in fimd driver, it was
> only used to set proper memory space. Fimd BPP mode was set by checking
> logo_on in panel_info structure.
> This is good reason to use vl_bpix in fimd driver to set proper BPP. I
> will change this to something like this:
>
> if (pvid->vl_bpix == 4)
> cfg |= EXYNOS_WINCON_BPPMODE_16BPP_565;
> else
> cfg |= EXYNOS_WINCON_BPPMODE_24BPP_888;
>
> Do you agree?
>
> This change makes sense.
We should actually be using vl_bpix for the check, and not logo_on.

> >
> >
> > BR,
> > Donghwa Lee.
> >
>
> Thank you,
> --
> Przemyslaw Marczak
> Samsung R&D Institute Poland
> Samsung Electronics
> p.marc...@samsung.com
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 4/7] video: exynos_fimd: Add framework to disable FIMD sysmmu

2013-12-20 Thread Ajay kumar
Hi Simon,
>
>
> On Fri, Dec 20, 2013 at 2:09 AM, Simon Glass  wrote:
>
>> Hi Ajay,
>>
>> On 12 November 2013 05:27, Ajay Kumar  wrote:
>> > 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.
>> >
>> > Signed-off-by: Ajay Kumar 
>>
>> Acked-by: Simon Glass 
>>
>> See a nit below if you re-issue this series.
>>
>> > ---
>> >  arch/arm/dts/exynos5420.dtsi |  7 +++
>> >  doc/device-tree-bindings/video/exynos-fb.txt |  4 
>> >  drivers/video/exynos_fimd.c  | 24
>> 
>> >  3 files changed, 35 insertions(+)
>> >
>> > diff --git a/arch/arm/dts/exynos5420.dtsi b/arch/arm/dts/exynos5420.dtsi
>> > index ca6c605..7443953 100644
>> > --- a/arch/arm/dts/exynos5420.dtsi
>> > +++ b/arch/arm/dts/exynos5420.dtsi
>> > @@ -71,4 +71,11 @@
>> > reg = <0x12E2 0x100>;
>> > interrupts = <0 203 0>;
>> > };
>> > +
>> > +   fimd@1440 {
>> > +   /* sysmmu is not used in U-Boot */
>> > +   samsung,disable-sysmmu;
>> > +   samsung,sysmmu-fimdm0 = <0x1464>;
>> > +   samsung,sysmmu-fimdm1 = <0x1468>;
>> > +   };
>> >  };
>> > diff --git a/doc/device-tree-bindings/video/exynos-fb.txt
>> b/doc/device-tree-bindings/video/exynos-fb.txt
>> > index bb7441c..9ba2c47 100644
>> > --- a/doc/device-tree-bindings/video/exynos-fb.txt
>> > +++ b/doc/device-tree-bindings/video/exynos-fb.txt
>> > @@ -55,6 +55,10 @@ 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)
>> > +   samsung,sysmmu-fimdm0: Address of sysmmufimdm0 MMU_CTRL
>> > +   samsung,sysmmu-fimdm1: Address of sysmmufimdm1 MMU_CTRL
>>
>> Is this a kernel binding?
>>
>> No. In kernel, we have DT nodes for FIMD symmus as well.
> How about creating FIMD sysmmu nodes in u-boot as well and use them inside
> exynos_fimd.c, rather than giving the sysmmu base addresses as a FIMD DT
> property?
>
>> >
>> >  Example:
>> >  SOC specific part:
>> > diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
>> > index f962c4f..bffc8fa 100644
>> > --- a/drivers/video/exynos_fimd.c
>> > +++ b/drivers/video/exynos_fimd.c
>> > @@ -257,6 +257,7 @@ void exynos_fimd_lcd_init(vidinfo_t *vid)
>> > unsigned int offset;
>> >  #ifdef CONFIG_OF_CONTROL
>> > unsigned int node;
>> > +   u32 *sysmmufimdm0, *sysmmufimdm1;
>> >
>> > node = fdtdec_next_compatible(gd->fdt_blob,
>> > 0, COMPAT_SAMSUNG_EXYNOS_FIMD);
>> > @@ -267,6 +268,29 @@ void exynos_fimd_lcd_init(vidinfo_t *vid)
>> > node,
>> "reg");
>> > if (fimd_ctrl == NULL)
>> > debug("Can't get the FIMD base address\n");
>> > +
>> > +   if (fdtdec_get_bool(gd->fdt_blob, node,
>> "samsung,disable-sysmmu")) {
>> > +   /*
>> > +   * The reset value for FIMD SYSMMU register MMU_CTRL is 3
>> > +   * on Exynos5420 and newer versions.
>> > +   * This means FIMD SYSMMU is on by default on Exynos5420
>> > +   * and newer versions.
>> > +   * Since in u-boot we don't use SYSMMU, we should disable
>> > +   * those FIMD SYSMMU.
>> > +   */
>> > +   sysmmufimdm0 = (u32 *)fdtdec_get_int(gd->fdt_blob, node,
>> > +
>> "samsung,sysmmu-fimdm0", 0);
>>
>> fdtdec_get_addr() might be better.
>
>
>> > +   if (!sysmmufimdm0)
>> > +   debug("Can't get sysmmufimdm0");
>> > +
>> > +   sysmmufimdm1 = (u32 *)fdtdec_get_int(gd->fdt_blob, node,
>> > +
>> "samsung,sysmmu-fimdm1", 0);
>> > +   if (!sysmmufimdm1)
>> > +   debug("Can't get sysmmufimdm1");
>> > +
>> > +   writel(0x0, sysmmufimdm0);
>> > +   writel(0x0, sysmmufimdm1);
>> > +   }
>> >  #else
>> > fimd_ctrl = (struct exynos_fb *)samsung_get_base_fimd();
>> >  #endif
>> > --
>> > 1.7.12.4
>> >
>>
>> Regards,
>> Simon
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>>
>
>
> Thanks and Regards,
> Ajay
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 5/7] smdk5420: Implement callbacks needed by exynos_fb driver

2013-12-20 Thread Ajay kumar
Hi Simon,


On Fri, Dec 20, 2013 at 2:10 AM, Simon Glass  wrote:

> Hi Ajay,
>
> On 12 November 2013 05:27, Ajay Kumar  wrote:
> > Add callbacks to set up DP-HPD, backlight and LCD power
> > on SMDK5420.
> >
> > Signed-off-by: Ajay Kumar 
> > ---
> >  board/samsung/smdk5420/smdk5420.c | 102
> +++---
> >  1 file changed, 17 insertions(+), 85 deletions(-)
> >
> > diff --git a/board/samsung/smdk5420/smdk5420.c
> b/board/samsung/smdk5420/smdk5420.c
> > index d85b953..75b22cc 100644
> > --- a/board/samsung/smdk5420/smdk5420.c
> > +++ b/board/samsung/smdk5420/smdk5420.c
> > @@ -43,98 +43,30 @@ int exynos_init(void)
> >  }
> >
> >  #ifdef CONFIG_LCD
> > -void cfg_lcd_gpio(void)
> > +void exynos_cfg_lcd_gpio(void)
> >  {
> > -   struct exynos5_gpio_part1 *gpio1 =
> > -   (struct exynos5_gpio_part1
> *)samsung_get_base_gpio_part1();
> > -
> > -   /* For Backlight */
> > -   s5p_gpio_cfg_pin(&gpio1->b2, 0, GPIO_OUTPUT);
> > -   s5p_gpio_set_value(&gpio1->b2, 0, 1);
> > -
> > -   /* LCD power on */
> > -   s5p_gpio_cfg_pin(&gpio1->x1, 5, GPIO_OUTPUT);
> > -   s5p_gpio_set_value(&gpio1->x1, 5, 1);
> > +   struct exynos5420_gpio_part2 *gpio2 =
> > +   (struct exynos5420_gpio_part2
> *)samsung_get_base_gpio_part2();
> >
> > /* Set Hotplug detect for DP */
> > -   s5p_gpio_cfg_pin(&gpio1->x0, 7, GPIO_FUNC(0x3));
> > +   s5p_gpio_cfg_pin(&gpio2->x0, 7, GPIO_FUNC(0x3));
> >  }
> >
> > -vidinfo_t panel_info = {
> > -   .vl_freq= 60,
> > -   .vl_col = 2560,
> > -   .vl_row = 1600,
> > -   .vl_width   = 2560,
> > -   .vl_height  = 1600,
> > -   .vl_clkp= CONFIG_SYS_LOW,
> > -   .vl_hsp = CONFIG_SYS_LOW,
> > -   .vl_vsp = CONFIG_SYS_LOW,
> > -   .vl_dp  = CONFIG_SYS_LOW,
> > -   .vl_bpix= 4,/* LCD_BPP = 2^4, for output conosle on
> LCD */
> > -
> > -   /* wDP panel timing infomation */
> > -   .vl_hspw= 32,
> > -   .vl_hbpd= 80,
> > -   .vl_hfpd= 48,
> > -
> > -   .vl_vspw= 6,
> > -   .vl_vbpd= 37,
> > -   .vl_vfpd= 3,
> > -   .vl_cmd_allow_len = 0xf,
> > -
> > -   .win_id = 3,
> > -   .cfg_gpio   = cfg_lcd_gpio,
> > -   .backlight_on   = NULL,
> > -   .lcd_power_on   = NULL,
> > -   .reset_lcd  = NULL,
> > -   .dual_lcd_enabled = 0,
> > -
> > -   .init_delay = 0,
> > -   .power_on_delay = 0,
> > -   .reset_delay= 0,
> > -   .interface_mode = FIMD_RGB_INTERFACE,
> > -   .dp_enabled = 1,
> > -};
> > -
> > -static struct edp_device_info edp_info = {
> > -   .disp_info = {
> > -   .h_res = 2560,
> > -   .h_sync_width = 32,
> > -   .h_back_porch = 80,
> > -   .h_front_porch = 48,
> > -   .v_res = 1600,
> > -   .v_sync_width  = 6,
> > -   .v_back_porch = 37,
> > -   .v_front_porch = 3,
> > -   .v_sync_rate = 60,
> > -   },
> > -   .lt_info = {
> > -   .lt_status = DP_LT_NONE,
> > -   },
> > -   .video_info = {
> > -   .master_mode = 0,
> > -   .bist_mode = DP_DISABLE,
> > -   .bist_pattern = NO_PATTERN,
> > -   .h_sync_polarity = 0,
> > -   .v_sync_polarity = 0,
> > -   .interlaced = 0,
> > -   .color_space = COLOR_RGB,
> > -   .dynamic_range = VESA,
> > -   .ycbcr_coeff = COLOR_YCBCR601,
> > -   .color_depth = COLOR_8,
> > -   },
> > -};
> > -
> > -static struct exynos_dp_platform_data dp_platform_data = {
> > -   .phy_enable = set_dp_phy_ctrl,
> > -   .edp_dev_info   = &edp_info,
> > -};
> > -
> > -void init_panel_info(vidinfo_t *vid)
> > +void exynos_backlight_on(unsigned int onoff)
> >  {
> > -   vid->rgb_mode   = MODE_RGB_P,
> > +   struct exynos5420_gpio_part1 *gpio1 =
> > +   (struct exynos5420_gpio_part1
> *)samsung_get_base_gpio_part1();
> > +
> > +   struct exynos5420_gpio_part2 *gpio2 =
> > +   

Re: [U-Boot] [PATCH V2 6/7] exynos: s2mps11_pmic: Enable LDO38 for SMDK5420

2013-12-20 Thread Ajay kumar
Hi Simon,


On Fri, Dec 20, 2013 at 2:10 AM, Simon Glass  wrote:

> Hi Ajay,
>
> On 12 November 2013 05:27, Ajay Kumar  wrote:
> > Enabling VDD_28IO_DP via LDO38 for SMDK5420.
> >
> > Signed-off-by: Ajay Kumar 
> > ---
> >  board/samsung/common/board.c | 3 +++
> >  include/power/s2mps11_pmic.h | 3 +++
> >  2 files changed, 6 insertions(+)
> >
> > diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
> > index 2536457..224f83d 100644
> > --- a/board/samsung/common/board.c
> > +++ b/board/samsung/common/board.c
> > @@ -180,6 +180,9 @@ int board_init_s2mps11(void)
> > {PMIC_REG_WRITE, S2MPS11_BUCK3_CTRL2,
> S2MPS11_BUCK_CTRL2_1V},
> > {PMIC_REG_WRITE, S2MPS11_BUCK4_CTRL2,
> S2MPS11_BUCK_CTRL2_1V},
> > {PMIC_REG_WRITE, S2MPS11_BUCK6_CTRL2,
> S2MPS11_BUCK_CTRL2_1V},
> > +#ifdef CONFIG_SMDK5420
> > +   {PMIC_REG_WRITE, S2MPS11_LDO38_CTRL,
> S2MPS11_LDO_CTRL_2_8V},
> > +#endif
>
> Should this be a runtime check based on a device tree setting?
>
Will change it.

>
> > {PMIC_REG_UPDATE, S2MPS11_REG_RTC_CTRL,
> > S2MPS11_RTC_CTRL_32KHZ_CP_EN |
> S2MPS11_RTC_CTRL_JIT},
> > {PMIC_REG_BAIL}
> > diff --git a/include/power/s2mps11_pmic.h b/include/power/s2mps11_pmic.h
> > index 20c781d..8c6bf4b 100644
> > --- a/include/power/s2mps11_pmic.h
> > +++ b/include/power/s2mps11_pmic.h
> > @@ -125,6 +125,8 @@ enum s2mps11_reg {
> >  #define S2MPS11_BUCK_CTRL2_1_2V0x60
> >  /* Value to set voltage as 1.2625V */
> >  #define S2MPS11_BUCK_CTRL2_1_2625V 0x6A
> > +/* Value to set voltage as 2.8V */
> > +#define S2MPS11_LDO_CTRL_2_8V  0x78
> >
> >  /* Buck register addresses */
> >  #define S2MPS11_BUCK1_CTRL20x26
> > @@ -133,6 +135,7 @@ enum s2mps11_reg {
> >  #define S2MPS11_BUCK4_CTRL20x2c
> >  #define S2MPS11_BUCK6_CTRL20x34
> >  #define S2MPS11_LDO22_CTRL 0x52
> > +#define S2MPS11_LDO38_CTRL 0x62
> >
> >  #define S2MPS11_DEVICE_NAME "S2MPS11_PMIC"
> >
> > --
> > 1.7.12.4
> >
>
> Regards,
> Simon
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V3 3/7] arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

2014-01-01 Thread Ajay kumar
Hi Minkyu,


On Thu, Jan 2, 2014 at 6:09 AM, Minkyu Kang  wrote:

> On 12/11/13 21:27, Ajay Kumar wrote:
> > Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420 needed by
>
> I think, they are not callback functions.

Ok. I will change the comment.

> > exynos video driver.
> > Also, configure ACLK_400_DISP1 as the parent for
> MUX_ACLK_400_DISP1_SUB_SEL.
> >
> > Signed-off-by: Ajay Kumar 
> > ---
> >  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(-)
> >
> > diff --git a/arch/arm/cpu/armv7/exynos/clock.c
> b/arch/arm/cpu/armv7/exynos/clock.c
> > index b52e61a..60ca7ea 100644
> > --- a/arch/arm/cpu/armv7/exynos/clock.c
> > +++ b/arch/arm/cpu/armv7/exynos/clock.c
> > @@ -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;
> > @@ -1038,6 +1042,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 =
> > @@ -1162,6 +1200,33 @@ void exynos5_set_lcd_clk(void)
> >   writel(cfg, &clk->div_disp1_0);
> >  }
> >
> > +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 =
> > @@ -1657,14 +1722,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())
>
> please don't mix cpu_is... and proid_is..
> please refer other functions.
>
> Ok. I will change it.

> > + return exynos5420_get_lcd_clk();
> > + 

Re: [U-Boot] [PATCH V2 7/7] CONFIG: SMDK5420: Enable FIMD and DP

2014-01-01 Thread Ajay kumar
Hi Minkyu,


On Thu, Jan 2, 2014 at 6:09 AM, Minkyu Kang  wrote:

> On 12/11/13 21:27, Ajay Kumar wrote:
> > Enable FIMD and DP drivers on SMDK5420 so that we get to
> > see the LCD console on eDP panel.
> >
> > Signed-off-by: Ajay Kumar 
> > ---
> >  include/configs/smdk5420.h | 8 
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/include/configs/smdk5420.h b/include/configs/smdk5420.h
> > index 46aeec0..d3fa49b 100644
> > --- a/include/configs/smdk5420.h
> > +++ b/include/configs/smdk5420.h
> > @@ -57,4 +57,12 @@
> >  #define CONFIG_POWER_I2C
> >  #define CONFIG_POWER_S2MPS11
> >
> > +/* Display */
> > +#define CONFIG_LCD
> > +#ifdef CONFIG_LCD
> > +#define CONFIG_EXYNOS_FB
> > +#define CONFIG_EXYNOS_DP
> > +#define LCD_BPP  LCD_COLOR16
>
> please use space.
>
> Ok. Will fix this in the next patchset.

> > +#endif
> > +
> >  #endif   /* __CONFIG_5420_H */
> >
>
> Thanks,
> Minkyu Kang.
>
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

Thanks and Regards,
Ajay
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 01/10] exynos_fb: Remove usage of static defines

2014-06-17 Thread 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.

Signed-off-by: Ajay Kumar 
---
 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(-)

diff --git a/arch/arm/include/asm/arch-exynos/system.h 
b/arch/arm/include/asm/arch-exynos/system.h
index 7e2057c..4968d3d 100644
--- a/arch/arm/include/asm/arch-exynos/system.h
+++ b/arch/arm/include/asm/arch-exynos/system.h
@@ -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 */
diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 9dc7c83..1f6f0a0 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -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
diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index e1e0d80..bc478a9 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -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
diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 9d1d56a..86a2570 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -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_BPPLCD_COLOR16
 #endif
 #endif  /* __CONFIG_5250_H */
diff --git a/include/configs/s5pc210_universal.h 
b/include/configs/s5pc210_universal.h
index eb046cd..20985da 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -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 */
diff --git a/include/configs/trats.h b/include/configs/trats.h
index 90f1962..35c1feb 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -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 */
diff --git a/include/configs/trats2.h b/include/configs/trats2.h
index 206

[U-Boot] [PATCH 05/10] video: Add driver for Parade PS8625 dP to LVDS bridge

2014-06-17 Thread Ajay Kumar
From: Vadim Bendebury 

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

Signed-off-by: Vadim Bendebury 
Signed-off-by: Ajay Kumar 
---
 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

diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 945f35d..8618590 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -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
diff --git a/drivers/video/parade.c b/drivers/video/parade.c
new file mode 100644
index 000..36e5d80
--- /dev/null
+++ b/drivers/video/parade.c
@@ -0,0 +1,220 @@
+/*
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/*
+ * This file is a driver for Parade dP<->LVDS bridges. The original submission
+ * is for the ps8625 chip.
+ */
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * Initialization of the chip is a process of writing certaing values into
+ * certain registers over i2c bus. The chip in fact responds to a range of
+ * addresses on the i2c bus, so for each written value three parameters are
+ * required: i2c address, register address and the actual value.
+ *
+ * The base address is derived from the device tree, only address offset is
+ * stored in the table below.
+ */
+/**
+ * struct reg_data() - data for a parade register write
+ *
+ * @addr_offoffset from the i2c base address for parade
+ * @reg_addrregister address to write
+ * @value   value to be written
+ */
+struct reg_data {
+   uint8_t addr_off;
+   uint8_t reg;
+   uint8_t value;
+} _packed;
+
+#define END_OF_TABLE 0xff /* Ficticious offset */
+
+static const struct reg_data parade_values[] = {
+   {0x02, 0xa1, 0x01},  /* HPD low */
+/*
+ * SW setting
+ * [1:0] SW output 1.2V voltage is lower to 96%
+ */
+   {0x04, 0x14, 0x01},
+/*
+ * RCO SS setting
+ * [5:4] = b01 0.5%, b10 1%, b11 1.5%
+ */
+   {0x04, 0xe3, 0x20},
+   {0x04, 0xe2, 0x80}, /* [7] RCO SS enable */
+/*
+ *  RPHY Setting
+ * [3:2] CDR tune wait cycle before
+ * measure for fine tune b00: 1us,
+ * 01: 0.5us, 10:2us, 11:4us.
+ */
+   {0x04, 0x8a, 0x0c},
+   {0x04, 0x89, 0x08}, /* [3] RFD always on */
+/*
+ * CTN lock in/out:
+ * 2ppm/8ppm. Lock out 2
+ * times.
+ */
+   {0x04, 0x71, 0x2d},
+/*
+ * 2.7G CDR settings
+ * NOF=40LSB for HBR CDR setting
+ */
+   {0x04, 0x7d, 0x07},
+   {0x04, 0x7b, 0x00},  /* [1:0] Fmin=+4bands */
+   {0x04, 0x7a, 0xfd},  /* [7:5] DCO_FTRNG=+-40% */
+/*
+ * 1.62G CDR settings
+ * [5:2]NOF=64LSB [1:0]DCO scale is 2/5
+ */
+   {0x04, 0xc0, 0x12},
+   {0x04, 0xc1, 0x92},  /* Gitune=-37% */
+   {0x04, 0xc2, 0x1c},  /* Fbstep=100% */
+   {0x04, 0x32, 0x80},  /* [7] LOS signal disable */
+/*
+ * RPIO Setting
+ * [7:4] LVDS driver bias current :
+ * 75% (250mV swing)
+ */
+   {0x04, 0x00, 0xb0},
+/*
+ * [7:6] Right-bar GPIO output strength is 8mA
+ */
+   {0x04, 0x15, 0x40},
+/* EQ Training State Machine Setting */
+   {0x04, 0x54, 0x10},  /* RCO calibration start */
+/* [4:0] MAX_LANE_COUNT set to one lane */
+   {0x01, 0x02, 0x81},
+/* [4:0] LANE_COUNT_SET set to one lane */
+   {0x01, 0x21, 0x81},
+   {0x00, 0x52, 0x20},
+   {0x00, 0xf1, 0x03},  /* HPD CP toggle enable */
+   {0x00, 0x62, 0x41},
+/* Counter number, add 1ms counter delay */
+   {0x00, 0xf6, 0x01},
+/*
+ * [6]PWM function control by
+ * DPCD0040f[7], default is PWM
+ * block always works.
+ */
+   {0x00, 0x77, 0x06},
+/*
+ * 04h Adjust VTotal tolerance to
+ * fix the 30Hz no display issue
+ */
+   {0x00, 0x4c, 0x04},
+/* DPCD00400='h00, Parade OUI = 'h001cf8 */
+   {0x01, 0xc0, 0x00},
+   {0x01, 0xc1, 0x1c},  /* DPCD00401='h1c */
+   {0x01, 0xc2, 0xf8},  /* DPCD00402='hf8 */
+/*
+ * DPCD403~408 = ASCII code
+ * D2SLV5='h4432534c5635
+ */
+   {0x01, 0xc3, 0x44},
+   {0x01, 0xc4, 0x32},  /* DPCD404 */
+   {0x01, 0xc5, 0x53},  /* DPCD405 */
+   {0x01, 0xc6, 0x4c},  /* DPCD406 */
+   {0x01, 

[U-Boot] [PATCH 00/10] peach_pit: Add support for FIMD, DP and parade chip

2014-06-17 Thread Ajay Kumar
This patchset has dependency on Akshay's base patchset for peach_pit:
https://www.mail-archive.com/u-boot@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

-- 
1.8.1.2

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


[U-Boot] [PATCH 04/10] video: exynos_fimd: Add framework to disable FIMD sysmmu

2014-06-17 Thread 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.

Signed-off-by: Ajay Kumar 
---
 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(+)

diff --git a/arch/arm/dts/exynos54xx.dtsi b/arch/arm/dts/exynos54xx.dtsi
index b9f8e0b..402d12b 100644
--- a/arch/arm/dts/exynos54xx.dtsi
+++ b/arch/arm/dts/exynos54xx.dtsi
@@ -113,6 +113,16 @@
status = "disabled";
};
 
+   fimdm0_sysmmu@0x1464 {
+   compatible = "samsung,sysmmu-fimdm0";
+   reg = <0x1464 0x100>;
+   };
+
+   fimdm1_sysmmu@0x1468 {
+   compatible = "samsung,sysmmu-fimdm1";
+   reg = <0x1468 0x100>;
+   };
+
fimd@1440 {
/* sysmmu is not used in U-Boot */
samsung,disable-sysmmu;
diff --git a/doc/device-tree-bindings/video/exynos-fb.txt 
b/doc/device-tree-bindings/video/exynos-fb.txt
index bb7441c..7d9b995 100644
--- a/doc/device-tree-bindings/video/exynos-fb.txt
+++ b/doc/device-tree-bindings/video/exynos-fb.txt
@@ -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:
diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
index cebbba7..5630d0b 100644
--- a/drivers/video/exynos_fimd.c
+++ b/drivers/video/exynos_fimd.c
@@ -251,6 +251,54 @@ void exynos_fimd_window_off(unsigned int win_id)
writel(cfg, &fimd_ctrl->winshmap);
 }
 
+#ifdef CONFIG_OF_CONTROL
+void exynos_fimd_disable_sysmmu(void)
+{
+   u32 *sysmmufimd;
+   unsigned int node;
+
+   /*
+   * The reset value for FIMD SYSMMU register MMU_CTRL is 3
+   * on Exynos5420 and newer versions.
+   * This means FIMD SYSMMU is on by default on Exynos5420
+   * and newer versions.
+   * Since in u-boot we don't use SYSMMU, we should disable
+   * those FIMD SYSMMU.
+   * Note that there are 2 SYSMMU for FIMD: m0 and m1.
+   * m0 handles windows 0 and 4, and m1 handles windows 1, 2 and 3.
+   * We disable both of them here.
+   */
+   node = fdtdec_next_compatible(gd->fdt_blob, 0,
+   COMPAT_SAMSUNG_EXYNOS_FIMD_SYSMMU0);
+   if (node <= 0) {
+   debug("exynos_fb: Can't get device node for fimd dma m0\n");
+   return;
+   }
+
+   sysmmufimd = (u32 *)fdtdec_get_addr(gd->fdt_blob, node, "reg");
+   if (!sysmmufimd) {
+   debug("Can't get base address for sysmmu fimdm0");
+   return;
+   }
+
+   writel(0x0, sysmmufimd);
+
+   node = fdtdec_next_compatible(gd->fdt_blob, 0,
+   COMPAT_SAMSUNG_EXYNOS_FIMD_SYSMMU1);
+   if (node <= 0) {
+   debug("exynos_fb: Can't get device node for fimd dma m1\n");
+   return;
+   }
+
+   sysmmufimd = (u32 *)fdtdec_get_addr(gd->fdt_blob, node, "reg");
+   if (!sysmmufimd) {
+   debug("Can't get base address for sysmmu fimdm0");
+   return;
+   }
+
+   writel(0x0, sysmmufimd);
+}
+#endif
 
 void exynos_fimd_lcd_init(vidinfo_t *vid)
 {
@@ -268,6 +316,10 @@ void exynos_fimd_lcd_init(vidinfo_t *vid)
node, "reg");
if (fimd_ctrl == NULL)
debug("Can't get the FIMD base address\n");
+
+   if (fdtdec_get_bool(gd->fdt_blob, node, "samsung,disable-sysmmu"))
+   exynos_fimd_disable_sysmmu();
+
 #else
fimd_ctrl = (struct exynos_fb *)samsung_get_base_fimd();
 #endif
diff --git a/include/fdtdec.h b/include/fdtdec.h
index a7e6ee7..3329623 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -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 co

[U-Boot] [PATCH 03/10] arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

2014-06-17 Thread 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.

Signed-off-by: Ajay Kumar 
---
 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(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index 400d134..c29b12d 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -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();
 }
diff --git a/arch/arm/cpu/armv7/exynos/exynos5_setup.h 
b/arch/arm/cpu/armv7/exynos/exynos5_setup.h
index db8ea86..5eac9cf 100644
--- a/arch/arm/cpu/armv7/exynos/exynos5_setup.h
+++ b/arch/arm/cpu/armv7/exynos/exynos5_setup.h
@@ -779,7 +779,7 @@
 #define CLK_SRC_TOP2_VAL   0x11101000
 #define CLK_SRC_TOP3_VAL   0x
 #define CLK_SRC_TOP4_VAL   0x0111
-#define CLK_SRC_TOP5_VAL   0x1100
+#define CLK_SRC_TOP5_VAL   0x1101
 #define CLK_SRC_TOP6_VAL   0x0111
 #define CLK_SRC_TOP7_VAL   0x00022200
 
diff --git a/arch/arm/include/asm/arch-exynos/clk.h 
b/arch/arm/include/asm/arch-exynos/clk.h
index ffbc07e..db24dc0 100644
--- a/arch/arm/include/asm/arch-exynos/clk.h
+++ b/arch/arm/include/asm/arch-exynos/clk.h
@@ -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))
-- 
1.8.1.2

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


[U-Boot] [PATCH 06/10] ARM: exynos: Add missing declaration for gpio_direction_input

2014-06-17 Thread Ajay Kumar
This patch adds missing declaration for gpio_direction_input
function, thereby helps in resolving compilation warnings.

Signed-off-by: Ajay Kumar 
---
 arch/arm/include/asm/arch-exynos/gpio.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/include/asm/arch-exynos/gpio.h 
b/arch/arm/include/asm/arch-exynos/gpio.h
index be5113f..8fb5c23 100644
--- a/arch/arm/include/asm/arch-exynos/gpio.h
+++ b/arch/arm/include/asm/arch-exynos/gpio.h
@@ -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);
-- 
1.8.1.2

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


[U-Boot] [PATCH 02/10] arm: exynos: Add RPLL for Exynos5420

2014-06-17 Thread Ajay Kumar
RPLL is needed to drive the LCD panel on Exynos5420 based boards.

Signed-off-by: Ajay Kumar 
---
 arch/arm/cpu/armv7/exynos/clock_init.h |  3 +++
 arch/arm/cpu/armv7/exynos/clock_init_exynos5.c | 13 +
 2 files changed, 16 insertions(+)

diff --git a/arch/arm/cpu/armv7/exynos/clock_init.h 
b/arch/arm/cpu/armv7/exynos/clock_init.h
index a875d0b..fce502f 100644
--- a/arch/arm/cpu/armv7/exynos/clock_init.h
+++ b/arch/arm/cpu/armv7/exynos/clock_init.h
@@ -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];
 
diff --git a/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c 
b/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
index 1d6977f..b6a9bc1 100644
--- a/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
+++ b/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
@@ -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, 0x0003, 0x00010046, 0x0d70,
@@ -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);
 
-- 
1.8.1.2

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


[U-Boot] [PATCH 09/10] CONFIGS: peach-pit: Enable display for peach_pit board

2014-06-17 Thread Ajay Kumar
Enable drivers for FIMD, DP and parade bridge chip.

Signed-off-by: Ajay Kumar 
---
 include/configs/peach-pit.h | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/include/configs/peach-pit.h b/include/configs/peach-pit.h
index 76b8d7a..88c093f 100644
--- a/include/configs/peach-pit.h
+++ b/include/configs/peach-pit.h
@@ -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_BPPLCD_COLOR16
+#endif
+
 #endif /* __CONFIG_PEACH_PIT_H */
-- 
1.8.1.2

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


[U-Boot] [PATCH 08/10] ARM: exynos: peach_pit: Add DT nodes for fimd and parade bridge chip

2014-06-17 Thread Ajay Kumar
This patch adds DT properties for fimd and the parade bridge chip
present on peach_pit. The panel supports 1366x768 resolution.

Signed-off-by: Ajay Kumar 
---
 arch/arm/dts/exynos5420-peach-pit.dts | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm/dts/exynos5420-peach-pit.dts 
b/arch/arm/dts/exynos5420-peach-pit.dts
index 8d148af..3ed70a8 100644
--- a/arch/arm/dts/exynos5420-peach-pit.dts
+++ b/arch/arm/dts/exynos5420-peach-pit.dts
@@ -63,6 +63,11 @@
  reg = <0x20>;
  compatible = "maxim,max98090-codec";
   };
+
+   edp-lvds-bridge@48 {
+   compatible = "parade,ps8625";
+   reg = <0x48>;
+   };
};
 
 sound@383 {
@@ -124,4 +129,29 @@
xhci@1240 {
samsung,vbus-gpio = <&gpio 0x41 0>; /* H01 */
};
+
+   fimd@1440 {
+   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>;
+   };
 };
-- 
1.8.1.2

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


[U-Boot] [PATCH 07/10] exynos5420: add callbacks needed for exynos_fb driver

2014-06-17 Thread Ajay Kumar
Add initialization code for peach_pit panel, parade bridge chip,
and backlight.

Signed-off-by: Ajay Kumar 
---
 arch/arm/include/asm/arch-exynos/system.h |   3 +
 board/samsung/smdk5420/smdk5420.c | 129 +++---
 2 files changed, 50 insertions(+), 82 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/system.h 
b/arch/arm/include/asm/arch-exynos/system.h
index 4968d3d..320763f 100644
--- a/arch/arm/include/asm/arch-exynos/system.h
+++ b/arch/arm/include/asm/arch-exynos/system.h
@@ -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 */
diff --git a/board/samsung/smdk5420/smdk5420.c 
b/board/samsung/smdk5420/smdk5420.c
index 183c522..270ee83 100644
--- a/board/samsung/smdk5420/smdk5420.c
+++ b/board/samsung/smdk5420/smdk5420.c
@@ -10,11 +10,14 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -40,95 +43,57 @@ int exynos_init(void)
 }
 
 #ifdef CONFIG_LCD
-void cfg_lcd_gpio(void)
+static int has_edp_bridge(void)
 {
-   /* For Backlight */
-   gpio_cfg_pin(EXYNOS5420_GPIO_B20, S5P_GPIO_OUTPUT);
-   gpio_set_value(EXYNOS5420_GPIO_B20, 1);
+   int node;
+
+   node = fdtdec_next_compatible(gd->fdt_blob, 0, COMPAT_PARADE_PS8625);
 
-   /* LCD power on */
-   gpio_cfg_pin(EXYNOS5420_GPIO_X15, S5P_GPIO_OUTPUT);
-   gpio_set_value(EXYNOS5420_GPIO_X15, 1);
+   /* No node for bridge in device tree. */
+   if (node <= 0)
+   return 0;
 
-   /* Set Hotplug detect for DP */
-   gpio_cfg_pin(EXYNOS5420_GPIO_X07, S5P_GPIO_FUNC(0x3));
+   /* Default is with bridge ic */
+   return 1;
 }
 
-vidinfo_t panel_info = {
-   .vl_freq= 60,
-   .vl_col = 2560,
-   .vl_row = 1600,
-   .vl_width   = 2560,
-   .vl_height  = 1600,
-   .vl_clkp= CONFIG_SYS_LOW,
-   .vl_hsp = CONFIG_SYS_LOW,
-   .vl_vsp = CONFIG_SYS_LOW,
-   .vl_dp  = CONFIG_SYS_LOW,
-   .vl_bpix= 4,/* LCD_BPP = 2^4, for output conosle on LCD */
-
-   /* wDP panel timing infomation */
-   .vl_hspw= 32,
-   .vl_hbpd= 80,
-   .vl_hfpd= 48,
-
-   .vl_vspw= 6,
-   .vl_vbpd= 37,
-   .vl_vfpd= 3,
-   .vl_cmd_allow_len = 0xf,
-
-   .win_id = 3,
-   .cfg_gpio   = cfg_lcd_gpio,
-   .backlight_on   = NULL,
-   .lcd_power_on   = NULL,
-   .reset_lcd  = NULL,
-   .dual_lcd_enabled = 0,
-
-   .init_delay = 0,
-   .power_on_delay = 0,
-   .reset_delay= 0,
-   .interface_mode = FIMD_RGB_INTERFACE,
-   .dp_enabled = 1,
-};
-
-static struct edp_device_info edp_info = {
-   .disp_info = {
-   .h_res = 2560,
-   .h_sync_width = 32,
-   .h_back_porch = 80,
-   .h_front_porch = 48,
-   .v_res = 1600,
-   .v_sync_width  = 6,
-   .v_back_porch = 37,
-   .v_front_porch = 3,
-   .v_sync_rate = 60,
-   },
-   .lt_info = {
-   .lt_status = DP_LT_NONE,
-   },
-   .video_info = {
-   .master_mode = 0,
-   .bist_mode = DP_DISABLE,
-   .bist_pattern = NO_PATTERN,
-   .h_sync_polarity = 0,
-   .v_sync_polarity = 0,
-   .interlaced = 0,
-   .color_space = COLOR_RGB,
-   .dynamic_range = VESA,
-   .ycbcr_coeff = COLOR_YCBCR601,
-   .color_depth = COLOR_8,
-   },
-};
-
-static struct exynos_dp_platform_data dp_platform_data = {
-   .phy_enable = set_dp_phy_ctrl,
-   .edp_dev_info   = &edp_info,
-};
-
-void init_panel_info(vidinfo_t *vid)
+void exynos_lcd_power_on(void)
 {
-   vid->rgb_mode   = MODE_RGB_P;
+   int ret;
+
+#ifdef CONFIG_POWER_TPS65090
+   ret = tps65090_init();
+   if (ret < 0) {
+   printf("%s: tps65090_init() failed\n", __func__);
+   return;
+   }
+
+   tps65090_fet_enable(6);
+#endif
+
+   mdelay(5);
+
+   /* TODO(ajaykumar...@samsung.com): Use device tree */
+   gpio_direction_output(EXYNOS5420_GPIO_X35, 1);  /* EDP_SLP# */
+   mdelay(10);
+   gpio_direction_output(EXYNOS5420_GPIO_Y77, 1);  /* EDP_RST# */
+   gpio_direction_input(EXYNOS5420_GPIO_X26);  /* EDP_HPD */
+   gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE);
 
-   exynos_set_dp_platform_data(&dp_platform_data);
+   if (has_edp_bridge())
+   if (parade_init(gd->fdt_blob))
+   printf("%s: ps

[U-Boot] [PATCH 10/10] Pit WIP

2014-06-17 Thread Ajay Kumar
From: Simon Glass 

WIP patch to enable cros-ec on peach_pit.

Signed-off-by: Simon Glass 
---
 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

diff --git a/drivers/misc/cros_ec_spi.c b/drivers/misc/cros_ec_spi.c
index 7df709c..015333f 100644
--- a/drivers/misc/cros_ec_spi.c
+++ b/drivers/misc/cros_ec_spi.c
@@ -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;
diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile
index a472f61..e7b07eb 100644
--- a/drivers/power/pmic/Makefile
+++ b/drivers/power/pmic/Makefile
@@ -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
diff --git a/drivers/power/pmic/pmic_tps65090_ec.c 
b/drivers/power/pmic/pmic_tps65090_ec.c
new file mode 100644
index 000..93b7923
--- /dev/null
+++ b/drivers/power/pmic/pmic_tps65090_ec.c
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define TPS65090_ADDR  0x48
+
+static struct tps65090 {
+   struct cros_ec_dev *dev;/* The CROS_EC device */
+} config;
+
+/* TPS65090 register addresses */
+enum {
+   REG_FET1_CTRL = 0x0f,
+   REG_FET2_CTRL,
+   REG_FET3_CTRL,
+   REG_FET4_CTRL,
+   REG_FET5_CTRL,
+   REG_FET6_CTRL,
+   REG_FET7_CTRL,
+   TPS65090_NUM_REGS,
+};
+
+enum {
+   MAX_FET_NUM = 7,
+   MAX_CTRL_READ_TRIES = 5,
+
+   /* TPS65090 FET_CTRL register values */
+   FET_CTRL_TOFET  = 1 << 7,  /* Timeout, startup, overload */
+   FET_CTRL_PGFET  = 1 << 4,  /* Power good for FET status */
+   FET_CTRL_WAIT   = 3 << 2,  /* Overcurrent timeout max */
+   FET_CTRL_ADENFET= 1 << 1,  /* Enable output auto discharge */
+   FET_CTRL_ENFET  = 1 << 0,  /* Enable FET */
+};
+
+/**
+ * tps65090_read - read a byte from tps6090
+ *
+ * @param reg  The register address to read from.
+ * @param val  We'll return value value read here.
+ * @return 0 if ok; error if EC returns failure.
+ */
+static int tps65090_read(u32 reg, u8 *val)
+{
+   return cros_ec_i2c_xfer(config.dev, TPS65090_ADDR, reg, 1,
+   val, 1, true);
+}
+
+/**
+ * tps65090_write - write a byte to tps6090
+ *
+ * @param reg  The register address to write to.
+ * @param val  The value to write.
+ * @return 0 if ok; error if EC returns failure.
+ */
+static int tps65090_write(u32 reg, u8 val)
+{
+   return cros_ec_i2c_xfer(config.dev, TPS65090_ADDR, reg, 1,
+   &val, 1, false);
+}
+
+/**
+ * Checks for a valid FET number
+ *
+ * @param fet_id   FET number to check
+ * @return 0 if ok, -1 if FET value is out of range
+ */
+static int tps65090_check_fet(unsigned int fet_id)
+{
+   if (fet_id == 0 || fet_id > MAX_FET_NUM) {
+   debug("parameter fet_id is out of range, %u not in 1 ~ %u\n",
+ fet_id, MAX_FET_NUM);
+   return -1;
+   }
+
+   return 0;
+}
+
+/**
+ * Set the power state for a FET
+ 

Re: [U-Boot] [PATCH 09/10] CONFIGS: peach-pit: Enable display for peach_pit board

2014-06-19 Thread Ajay kumar
Simon,

On Fri, Jun 20, 2014 at 9:08 AM, Simon Glass  wrote:
> Hi Ajay,
>
> On 17 June 2014 03:06, Ajay Kumar  wrote:
>> Enable drivers for FIMD, DP and parade bridge chip.
>>
>> Signed-off-by: Ajay Kumar 
>> ---
>>  include/configs/peach-pit.h | 10 ++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/include/configs/peach-pit.h b/include/configs/peach-pit.h
>> index 76b8d7a..88c093f 100644
>> --- a/include/configs/peach-pit.h
>> +++ b/include/configs/peach-pit.h
>> @@ -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_BPPLCD_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

> Regards,
> Simon
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 04/10] video: exynos_fimd: Add framework to disable FIMD sysmmu

2014-06-19 Thread Ajay kumar
Hi Simon,


On Fri, Jun 20, 2014 at 8:59 AM, Simon Glass  wrote:
> On 17 June 2014 03:06, Ajay Kumar  wrote:
>> 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.
>>
>> Signed-off-by: Ajay Kumar 
>
> Acked-by: Simon Glass 
> Tested-by: Simon Glass 
>
> (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
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 04/10] video: exynos_fimd: Add framework to disable FIMD sysmmu

2014-06-24 Thread Ajay kumar
Simon,

On Mon, Jun 23, 2014 at 5:45 PM, Simon Glass  wrote:
> Hi Ajay,
>
> On 20 June 2014 00:42, Ajay kumar  wrote:
>> Hi Simon,
>>
>>
>> On Fri, Jun 20, 2014 at 8:59 AM, Simon Glass  wrote:
>>> On 17 June 2014 03:06, Ajay Kumar  wrote:
>>>> 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.
>>>>
>>>> Signed-off-by: Ajay Kumar 
>>>
>>> Acked-by: Simon Glass 
>>> Tested-by: Simon Glass 
>>>
>>> (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.
Ok. I will add this.

Ajay
> Regards,
> Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 03/10] arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

2014-06-24 Thread Ajay kumar
Hi Minkyu,

On Tue, Jun 24, 2014 at 3:36 AM, Minkyu Kang  wrote:
> On 17/06/14 18:06, Ajay Kumar wrote:
>> 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.
>>
>> Signed-off-by: Ajay Kumar 
>> ---
>>  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(-)
>>
>> diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
>> b/arch/arm/cpu/armv7/exynos/clock.c
>> index 400d134..c29b12d 100644
>> --- a/arch/arm/cpu/armv7/exynos/clock.c
>> +++ b/arch/arm/cpu/armv7/exynos/clock.c
>> @@ -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();
>
> 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 function

Re: [U-Boot] [PATCH 03/10] arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

2014-06-24 Thread Ajay kumar
On Tue, Jun 24, 2014 at 7:36 AM, Minkyu Kang  wrote:
> On 24/06/14 20:28, Ajay kumar wrote:
>> Hi Minkyu,
>>
>> On Tue, Jun 24, 2014 at 3:36 AM, Minkyu Kang  wrote:
>>> On 17/06/14 18:06, Ajay Kumar wrote:
>>>> 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.
>>>>
>>>> Signed-off-by: Ajay Kumar 
>>>> ---
>>>>  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(-)
>>>>
>>>> diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
>>>> b/arch/arm/cpu/armv7/exynos/clock.c
>>>> index 400d134..c29b12d 100644
>>>> --- a/arch/arm/cpu/armv7/exynos/clock.c
>>>> +++ b/arch/arm/cpu/armv7/exynos/clock.c
>>>> @@ -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 = read

Re: [U-Boot] [PATCH] video: exynos_fb: Add the missing #else clause

2013-04-21 Thread Ajay kumar
ping.


On Thu, Apr 4, 2013 at 7:55 PM, Ajay Kumar  wrote:

> This patch fixes a bug introduced while adding DT support
> to Exynos FIMD driver:
>
> commit c23f3157d69bbb6c044256870f745f195b12431e
>     Author: Ajay Kumar 
> Date:   Thu Feb 21 23:53:01 2013 +
>
> video: exynos_fb: add DT support for FIMD driver
>
> Even though this part of code was missing, things were working
> fine on Exynos5250 because, samsung_get_base_fimd() used
> to give the correct base address for Exynos5250 FIMD.
>
> Signed-off-by: Ajay Kumar 
> ---
>  drivers/video/exynos_fimd.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
> index 3359949..7243ea3 100644
> --- a/drivers/video/exynos_fimd.c
> +++ b/drivers/video/exynos_fimd.c
> @@ -280,8 +280,9 @@ void exynos_fimd_lcd_init(vidinfo_t *vid)
> node,
> "reg");
> if (fimd_ctrl == NULL)
> debug("Can't get the FIMD base address\n");
> -#endif
> +#else
> fimd_ctrl = (struct exynos_fb *)samsung_get_base_fimd();
> +#endif
>
> offset = exynos_fimd_get_base_offset();
>
> --
> 1.8.0
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/13] video: exynos_fb: Remove callbacks from the driver

2013-03-13 Thread Ajay kumar
Hi Simon,

The idea was to move out panel_info structure from board files, and
passing the same info from the device tree.
The first obstacle towards this were the callback hooks in the
panel_info structure.
This is just a workaround for such function pointers.

Regards,
Ajay Kumar

On Wed, Mar 13, 2013 at 9:13 AM, Simon Glass  wrote:
> Hi,
>
> On Fri, Feb 22, 2013 at 1:52 AM, Ajay Kumar  wrote:
>> Replaced the functionality of callbacks by using a standard set of functions.
>> Instead of implementing and hooking up a callback, put the same code in one 
>> of
>> the standard set of functions by overriding it.
>>
>> This patch is tested only on SMDK5250.
>> For Trats and universal_c210 board, it is only compile tested.
>
> Can I ask please why you are doing this? It seems like the existing
> interface is better.
>
> Regards,
> Simon
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] video: exynos_fb: Add the missing #else clause

2013-04-04 Thread Ajay Kumar
This patch fixes a bug introduced while adding DT support
to Exynos FIMD driver:

commit c23f3157d69bbb6c044256870f745f195b12431e
Author: Ajay Kumar 
Date:   Thu Feb 21 23:53:01 2013 +

video: exynos_fb: add DT support for FIMD driver

Even though this part of code was missing, things were working
fine on Exynos5250 because, samsung_get_base_fimd() used
to give the correct base address for Exynos5250 FIMD.

Signed-off-by: Ajay Kumar 
---
 drivers/video/exynos_fimd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
index 3359949..7243ea3 100644
--- a/drivers/video/exynos_fimd.c
+++ b/drivers/video/exynos_fimd.c
@@ -280,8 +280,9 @@ void exynos_fimd_lcd_init(vidinfo_t *vid)
node, "reg");
if (fimd_ctrl == NULL)
debug("Can't get the FIMD base address\n");
-#endif
+#else
fimd_ctrl = (struct exynos_fb *)samsung_get_base_fimd();
+#endif
 
offset = exynos_fimd_get_base_offset();
 
-- 
1.8.0

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


Re: [U-Boot] [PATCH] Origen: Set FIMD as the default display path

2013-08-06 Thread Ajay kumar
+Donghwa Lee


Hi Tushar,

I think this setting already exists for Exynos4 in u-boot.

Are you not getting display without your patch?

Have a look at this:
http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=arch/arm/cpu/armv7/exynos/system.c;h=ad12445832cf7415e52e8593b595ab33a0b4d375;hb=HEAD#l33


Regards,
Ajay Kumar


On Tue, Aug 6, 2013 at 12:07 PM, Tushar Behera wrote:

> On 08/06/2013 08:29 AM, Minkyu Kang wrote:
> > Dear Tushar Behera,
> >
> > On 07/06/13 19:56, Tushar Behera wrote:
> >> On EXYNOS4210, there are three paths for display data to be processed,
> >> namely MIE, MDNIE and FIMD. On Origen board, FIMD display controller
> >> is used.
> >>
> >> Signed-off-by: Tushar Behera 
> >> ---
> >> This patch is rebased on master branch of u-boot-samsung tree.
> >>
> >>  board/samsung/origen/lowlevel_init.S |   13 +
> >>  board/samsung/origen/origen_setup.h  |7 +++
> >>  2 files changed, 20 insertions(+)
> >>
> >
> > Since the lowlevel_init.S is removed, this patch cannot be applied.
> >
>
> I will rebase to current tip and send again.
>
> > Thanks,
> > Minkyu Kang.
> >
>
> Thanks.
> --
> Tushar Behera
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] Origen: Set FIMD as the default display path

2013-08-16 Thread Ajay kumar
On Thu, Aug 15, 2013 at 6:53 PM, Tushar Behera wrote:

> On EXYNOS4210, there are three paths for display data to be processed,
> namely MIE, MDNIE and FIMD. On Origen board, FIMD display controller
> is used.
>
> Signed-off-by: Tushar Behera 
> ---
> Changes for V2:
> * Updated review comments from Ajay Kumar, reusing the code from
> arch/arm/cpu/armv7/exynos/system.c.
>
>  board/samsung/origen/origen.c |3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c
> index 15f77ca..bb16699 100644
> --- a/board/samsung/origen/origen.c
> +++ b/board/samsung/origen/origen.c
> @@ -22,6 +22,9 @@ int board_init(void)
> gpio2 = (struct exynos4_gpio_part2 *) EXYNOS4_GPIO_PART2_BASE;
>
> gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
> +
> +   set_system_display_ctrl();
> +
>
Ok. You are trying to get the display up in the kernel,
without enabling the display in u-boot.
And, thats why you are making an explicit call here?

return 0;
>  }
>
> --
> 1.7.9.5
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/6] exynos_fb: Remove usage of static defines

2013-09-30 Thread 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.

Signed-off-by: Ajay Kumar 
---
 arch/arm/include/asm/arch-exynos/system.h |  1 +
 board/samsung/common/board.c  | 15 +++
 drivers/video/exynos_fb.c | 20 ++--
 include/configs/exynos5250-dt.h   |  2 --
 4 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/system.h 
b/arch/arm/include/asm/arch-exynos/system.h
index 7e2057c..4968d3d 100644
--- a/arch/arm/include/asm/arch-exynos/system.h
+++ b/arch/arm/include/asm/arch-exynos/system.h
@@ -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 */
diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index ce85ddb..ae89c94 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -130,6 +131,20 @@ int board_early_init_f(void)
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
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 err;
 }
 #endif
diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index 5c7ec91..686870f 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -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
 
@@ -159,7 +154,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);
@@ -303,10 +298,7 @@ void lcd_ctrl_init(void *lcdbase)
set_system_display_ctrl();
set_lcd_clk();
 
-#ifdef CONFIG_OF_CONTROL
-   if (exynos_fimd_parse_dt(gd->fdt_blob))
-   debug("Can't get proper panel info\n");
-#else
+#ifndef CONFIG_OF_CONTROL
/* initialize parameters which is specific to panel. */
init_panel_info(&panel_info);
 #endif
diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 689919d..508962c 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -50,8 +50,6 @@
 #ifdef CONFIG_LCD
 #define CONFIG_EXYNOS_FB
 #define CONFIG_EXYNOS_DP
-#define LCD_XRES   2560
-#define LCD_YRES   1600
 #define LCD_BPPLCD_COLOR16
 #endif
 #endif  /* __CONFIG_5250_H */
-- 
1.7.12.4

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


[U-Boot] [PATCH 0/6] [U-boot] SMDK5420: Add support for FIMD and DP

2013-09-30 Thread Ajay Kumar
This patchset adds support for FIMD and DP on SMDK5420.

This patchset has dependency on Rajeshwari's base patchset:
[V4] EXYNOS5420: Add SMDK5420 board support
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/170582

Also, for testing we need Naveen's i2c patchset aswell:
i2c: improve s3c24x0 with High-speed and new SYS_I2C framework support
http://www.mail-archive.com/u-boot@lists.denx.de/msg122679.html

Ajay Kumar (6):
[PATCH 1/6] exynos_fb: Remove usage of static defines
[PATCH 2/6] arm: exynos: Add RPLL for Exynos5420
[PATCH 3/6] arm: exynos: Add get_lcd_clk and set_lcd_clk
callbacks for Exynos5420
[PATCH 4/6] video: exynos_fimd: Add framework to disable FIMD sysmmu
[PATCH 5/6] smdk5420: Implement callbacks needed by exynos_fb driver
[PATCH 6/6] CONFIG: SMDK5420: Enable FIMD and DP

 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.dtsi   |   5 ++
 arch/arm/include/asm/arch-exynos/clk.h |   1 +
 arch/arm/include/asm/arch-exynos/system.h  |   1 +
 board/samsung/common/board.c   |  15 
 board/samsung/smdk5420/smdk5420.c  | 118 +++--
 doc/device-tree-bindings/video/exynos-fb.txt   |   2 +
 drivers/video/exynos_fb.c  |  20 ++---
 drivers/video/exynos_fimd.c|  12 +++
 include/configs/exynos5250-dt.h|   2 -
 include/configs/smdk5420.h |   8 ++
 14 files changed, 172 insertions(+), 104 deletions(-)

-- 
1.7.12.4

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


[U-Boot] [PATCH 3/6] arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

2013-09-30 Thread 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.

Signed-off-by: Ajay Kumar 
---
 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(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index bc06995..e953ddc 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -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;
@@ -388,6 +389,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;
@@ -1035,6 +1039,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 =
@@ -1159,6 +1197,33 @@ void exynos5_set_lcd_clk(void)
writel(cfg, &clk->div_disp1_0);
 }
 
+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 =
@@ -1628,14 +1693,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();
 }
diff --git a/arch/arm/cpu/armv7/exynos/exynos5_setup.h 
b/arch/arm/cpu/armv7/exynos/exynos5_setup.h
index 8e05a00..70b1c04 100644
--- a/arch/arm/cpu/armv7/exynos/exynos5_setup.h
+++ b/arch/arm/cpu/armv7/exynos/exynos5_setup.h
@@ -780,7 +780,7 @@
 #define CLK_SRC_TOP2_VAL   0x11101000
 #define CLK_SRC_TOP3_VAL   0x
 #define CLK_SRC_TOP4_VAL   0x0111
-#define CLK_SRC_TOP5_VAL   0x1100
+#define CLK_SRC_TOP5_VAL   0x1101
 #define CLK_SRC_TOP6_VAL   0x0111
 #define CLK_SRC_TOP7_VAL   0x00022200
 
diff --git a/arch/arm/include/asm/arch-exynos/clk.h 
b/arch/arm/include/asm/arch-exynos/clk.h
index abce246..f0b4d70 100644
--- a/arch/arm/include/asm/arch-exynos/clk.h
+++ b/arch/arm/include/asm/arch-exynos/clk.h
@@ -15,6 +15,7 @@
 #define VPLL   4
 #define BPLL   5
 #define RPLL   6
+#define SPLL   7
 
 enum pll_src_bit {
EXYNOS_SRC_MPLL = 6,
-- 
1.7.12.4

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


[U-Boot] [PATCH 6/6] CONFIG: SMDK5420: Enable FIMD and DP

2013-09-30 Thread Ajay Kumar
Enable FIMD and DP drivers on SMDK5420 so that we get to
see the LCD console on eDP panel.

Signed-off-by: Ajay Kumar 
---
 include/configs/smdk5420.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/include/configs/smdk5420.h b/include/configs/smdk5420.h
index 447f8e5..cc9c424 100644
--- a/include/configs/smdk5420.h
+++ b/include/configs/smdk5420.h
@@ -53,4 +53,12 @@
 
 #define CONFIG_MAX_I2C_NUM 11
 
+/* Display */
+#define CONFIG_LCD
+#ifdef CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_BPPLCD_COLOR16
+#endif
+
 #endif /* __CONFIG_5420_H */
-- 
1.7.12.4

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


[U-Boot] [PATCH 2/6] arm: exynos: Add RPLL for Exynos5420

2013-09-30 Thread Ajay Kumar
RPLL is needed to drive the LCD panel on Exynos5420 based boards.

Signed-off-by: Ajay Kumar 
---
 arch/arm/cpu/armv7/exynos/clock_init.h |  3 +++
 arch/arm/cpu/armv7/exynos/clock_init_exynos5.c | 13 +
 2 files changed, 16 insertions(+)

diff --git a/arch/arm/cpu/armv7/exynos/clock_init.h 
b/arch/arm/cpu/armv7/exynos/clock_init.h
index a875d0b..fce502f 100644
--- a/arch/arm/cpu/armv7/exynos/clock_init.h
+++ b/arch/arm/cpu/armv7/exynos/clock_init.h
@@ -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];
 
diff --git a/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c 
b/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
index e7f1496..c91c4a1 100644
--- a/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
+++ b/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
@@ -179,6 +179,10 @@ struct mem_timings mem_timings[] = {
.spll_mdiv = 0xc8,
.spll_pdiv = 0x3,
.spll_sdiv = 0x2,
+   /* RPLL @266MHz */
+   .rpll_mdiv = 0x10A,
+   .rpll_pdiv = 0x3,
+   .rpll_sdiv = 0x3,
 
.direct_cmd_msr = {
0x00020018, 0x0003, 0x00010046, 0x0d70,
@@ -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);
 
-- 
1.7.12.4

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


[U-Boot] [PATCH 4/6] video: exynos_fimd: Add framework to disable FIMD sysmmu

2013-09-30 Thread Ajay Kumar
On Exynos5420, 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
to disable FIMD sysmmu on Exynos5420.

Signed-off-by: Ajay Kumar 
---
 arch/arm/dts/exynos5420.dtsi |  5 +
 doc/device-tree-bindings/video/exynos-fb.txt |  2 ++
 drivers/video/exynos_fimd.c  | 12 
 3 files changed, 19 insertions(+)

diff --git a/arch/arm/dts/exynos5420.dtsi b/arch/arm/dts/exynos5420.dtsi
index ca6c605..2d64df8 100644
--- a/arch/arm/dts/exynos5420.dtsi
+++ b/arch/arm/dts/exynos5420.dtsi
@@ -71,4 +71,9 @@
reg = <0x12E2 0x100>;
interrupts = <0 203 0>;
};
+
+   fimd@1440 {
+   /* sysmmu is not used in U-Boot */
+   samsung,disable-sysmmu;
+   };
 };
diff --git a/doc/device-tree-bindings/video/exynos-fb.txt 
b/doc/device-tree-bindings/video/exynos-fb.txt
index bb7441c..cddb505 100644
--- a/doc/device-tree-bindings/video/exynos-fb.txt
+++ b/doc/device-tree-bindings/video/exynos-fb.txt
@@ -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)
 
 Example:
 SOC specific part:
diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
index 8c2de4e..410fff1 100644
--- a/drivers/video/exynos_fimd.c
+++ b/drivers/video/exynos_fimd.c
@@ -267,6 +267,18 @@ void exynos_fimd_lcd_init(vidinfo_t *vid)
node, "reg");
if (fimd_ctrl == NULL)
debug("Can't get the FIMD base address\n");
+
+   if (fdtdec_get_bool(gd->fdt_blob, node, "samsung,disable-sysmmu")) {
+   /*
+   * The reset value for FIMD SYSMMU registers
+   * MMU_CTRL:0x1464 and MMU_CTRL:0x1468 is 3.
+   * This means FIMD SYSMMU is on by default on Exynos5420.
+   * Since in u-boot we don't use SYSMMU, we are disabling
+   * FIMD SYSMMU.
+   */
+   writel(0x0, 0x1464);
+   writel(0x0, 0x1468);
+   }
 #else
fimd_ctrl = (struct exynos_fb *)samsung_get_base_fimd();
 #endif
-- 
1.7.12.4

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


[U-Boot] [PATCH 5/6] smdk5420: Implement callbacks needed by exynos_fb driver

2013-09-30 Thread Ajay Kumar
Add callbacks to set up DP-HPD, backlight and LCD power
on SMDK5420.

Signed-off-by: Ajay Kumar 
---
 board/samsung/smdk5420/smdk5420.c | 118 +++---
 1 file changed, 34 insertions(+), 84 deletions(-)

diff --git a/board/samsung/smdk5420/smdk5420.c 
b/board/samsung/smdk5420/smdk5420.c
index cf76455..3f29ce0 100644
--- a/board/samsung/smdk5420/smdk5420.c
+++ b/board/samsung/smdk5420/smdk5420.c
@@ -137,98 +137,48 @@ int board_mmc_init(bd_t *bis)
 #endif
 
 #ifdef CONFIG_LCD
-void cfg_lcd_gpio(void)
+void exynos_cfg_lcd_gpio(void)
 {
-   struct exynos5_gpio_part1 *gpio1 =
-   (struct exynos5_gpio_part1 *)samsung_get_base_gpio_part1();
+   struct exynos5420_gpio_part2 *gpio2 =
+   (struct exynos5420_gpio_part2 *)samsung_get_base_gpio_part2();
 
-   /* For Backlight */
+   /* Set Hotplug detect for DP */
+   s5p_gpio_cfg_pin(&gpio2->x0, 7, GPIO_FUNC(0x3));
+}
+
+void exynos_backlight_on(unsigned int onoff)
+{
+   struct exynos5420_gpio_part1 *gpio1 =
+   (struct exynos5420_gpio_part1 *)samsung_get_base_gpio_part1();
+
+   struct exynos5420_gpio_part2 *gpio2 =
+   (struct exynos5420_gpio_part2 *)samsung_get_base_gpio_part2();
+
+   /* For PWM */
s5p_gpio_cfg_pin(&gpio1->b2, 0, GPIO_OUTPUT);
s5p_gpio_set_value(&gpio1->b2, 0, 1);
 
-   /* LCD power on */
-   s5p_gpio_cfg_pin(&gpio1->x1, 5, GPIO_OUTPUT);
-   s5p_gpio_set_value(&gpio1->x1, 5, 1);
-
-   /* Set Hotplug detect for DP */
-   s5p_gpio_cfg_pin(&gpio1->x0, 7, GPIO_FUNC(0x3));
+   /* BL_EN */
+   s5p_gpio_cfg_pin(&gpio2->x1, 5, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio2->x1, 5, 1);
 }
 
-vidinfo_t panel_info = {
-   .vl_freq= 60,
-   .vl_col = 2560,
-   .vl_row = 1600,
-   .vl_width   = 2560,
-   .vl_height  = 1600,
-   .vl_clkp= CONFIG_SYS_LOW,
-   .vl_hsp = CONFIG_SYS_LOW,
-   .vl_vsp = CONFIG_SYS_LOW,
-   .vl_dp  = CONFIG_SYS_LOW,
-   .vl_bpix= 4,/* LCD_BPP = 2^4, for output conosle on LCD */
-
-   /* wDP panel timing infomation */
-   .vl_hspw= 32,
-   .vl_hbpd= 80,
-   .vl_hfpd= 48,
-
-   .vl_vspw= 6,
-   .vl_vbpd= 37,
-   .vl_vfpd= 3,
-   .vl_cmd_allow_len = 0xf,
-
-   .win_id = 3,
-   .cfg_gpio   = cfg_lcd_gpio,
-   .backlight_on   = NULL,
-   .lcd_power_on   = NULL,
-   .reset_lcd  = NULL,
-   .dual_lcd_enabled = 0,
-
-   .init_delay = 0,
-   .power_on_delay = 0,
-   .reset_delay= 0,
-   .interface_mode = FIMD_RGB_INTERFACE,
-   .dp_enabled = 1,
-};
-
-static struct edp_device_info edp_info = {
-   .disp_info = {
-   .h_res = 2560,
-   .h_sync_width = 32,
-   .h_back_porch = 80,
-   .h_front_porch = 48,
-   .v_res = 1600,
-   .v_sync_width  = 6,
-   .v_back_porch = 37,
-   .v_front_porch = 3,
-   .v_sync_rate = 60,
-   },
-   .lt_info = {
-   .lt_status = DP_LT_NONE,
-   },
-   .video_info = {
-   .master_mode = 0,
-   .bist_mode = DP_DISABLE,
-   .bist_pattern = NO_PATTERN,
-   .h_sync_polarity = 0,
-   .v_sync_polarity = 0,
-   .interlaced = 0,
-   .color_space = COLOR_RGB,
-   .dynamic_range = VESA,
-   .ycbcr_coeff = COLOR_YCBCR601,
-   .color_depth = COLOR_8,
-   },
-};
-
-static struct exynos_dp_platform_data dp_platform_data = {
-   .phy_enable = set_dp_phy_ctrl,
-   .edp_dev_info   = &edp_info,
-};
-
-void init_panel_info(vidinfo_t *vid)
+void exynos_lcd_power_on(void)
 {
-   vid->rgb_mode   = MODE_RGB_P,
-
-   exynos_set_dp_platform_data(&dp_platform_data);
+   int pmic_bus, pmic_i2caddr, ldo38_reg, old_bus;
+   u8 value;
+
+   /* enable VDD_28IO_DP: LDO38 should be at 2.8V */
+   pmic_bus = 4;
+   pmic_i2caddr = 0x66;
+   ldo38_reg = 0x62;
+   value = 0x78;
+
+   old_bus = i2c_get_bus_num();
+   i2c_set_bus_num(pmic_bus);
+   if (i2c_write(pmic_i2caddr, ldo38_reg, 1, &value, 1))
+   printf("i2c write fail. Failed to enable VDD_28IO_DP\n");
+   i2c_set_bus_num(old_bus);
 }
 #endif
 
-- 
1.7.12.4

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


[U-Boot] [PATCH 2/2] RFC: exynos: Disable the display controller when starting Linux

2013-10-03 Thread Ajay Kumar
If the exynos display controller is still active when Linux starts,
then it will result in a kernel panic while FIMD sysmmu driver is
getting probed.
Calling exynos_fimd_lcd_disable() before jumping into kernel
disables the display controller by switching off the windows,
hence resolving the kernel panic which arises from sysmmu driver.

Create an Exynos specific definition for the weak function
arch_cleanup_before_linux(), and then place the call to
exynos_fimd_lcd_disable() inside the overrided definition of
arch_cleanup_before_linux().

Signed-off-by: Ajay Kumar 
Signed-off-by: Simon Glass 
---
 arch/arm/cpu/armv7/exynos/system.c| 9 +
 arch/arm/include/asm/arch-exynos/system.h | 9 +
 drivers/video/exynos_fimd.c   | 8 
 3 files changed, 26 insertions(+)

diff --git a/arch/arm/cpu/armv7/exynos/system.c 
b/arch/arm/cpu/armv7/exynos/system.c
index ad12445..977169b 100644
--- a/arch/arm/cpu/armv7/exynos/system.c
+++ b/arch/arm/cpu/armv7/exynos/system.c
@@ -69,3 +69,12 @@ void set_system_display_ctrl(void)
else
exynos5_set_system_display();
 }
+
+/*
+ * Cleanup any Exynos specific setting here,
+ * if they can cause problem during kernel boot.
+ */
+void arch_cleanup_before_linux(void)
+{
+   exynos_fimd_lcd_disable();
+}
diff --git a/arch/arm/include/asm/arch-exynos/system.h 
b/arch/arm/include/asm/arch-exynos/system.h
index 7e2057c..ed0c984 100644
--- a/arch/arm/include/asm/arch-exynos/system.h
+++ b/arch/arm/include/asm/arch-exynos/system.h
@@ -40,4 +40,13 @@ struct exynos5_sysreg {
 void set_usbhost_mode(unsigned int mode);
 void set_system_display_ctrl(void);
 
+#ifdef CONFIG_EXYNOS_FB
+/* Disable the display */
+void exynos_fimd_lcd_disable(void);
+#else
+static inline void exynos_fimd_lcd_disable(void)
+{
+}
+#endif
+
 #endif /* _EXYNOS4_SYSTEM_H */
diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
index 8c2de4e..6a13d03 100644
--- a/drivers/video/exynos_fimd.c
+++ b/drivers/video/exynos_fimd.c
@@ -363,3 +363,11 @@ unsigned long exynos_fimd_calc_fbsize(void)
 {
return pvid->vl_col * pvid->vl_row * (NBITS(pvid->vl_bpix) / 8);
 }
+
+void exynos_fimd_lcd_disable(void)
+{
+   int i;
+
+   for (i = 0; i < 4; i++)
+   exynos_fimd_window_off(i);
+}
-- 
1.7.12.4

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


[U-Boot] [PATCH 1/2] RFC: arm: add call to cleanup things before jumping into kernel

2013-10-03 Thread Ajay Kumar
Add infrasturcture to cleanup any of those architecture related settings
done for u-boot, if they can cause problem during kernel boot.

Signed-off-by: Ajay Kumar 
---
 arch/arm/cpu/armv7/cpu.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c
index 01cdb7e..edf4604 100644
--- a/arch/arm/cpu/armv7/cpu.c
+++ b/arch/arm/cpu/armv7/cpu.c
@@ -23,6 +23,7 @@
 #include 
 
 void __weak cpu_cache_initialization(void){}
+void __weak arch_cleanup_before_linux(void){}
 
 int cleanup_before_linux(void)
 {
@@ -35,6 +36,11 @@ int cleanup_before_linux(void)
 #ifndef CONFIG_SPL_BUILD
disable_interrupts();
 #endif
+   /*
+* Cleanup any of those architecture related settings done for u-boot,
+* if they can cause problem during kernel boot.
+*/
+   arch_cleanup_before_linux();
 
/*
 * Turn off I-cache and invalidate it
-- 
1.7.12.4

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


Re: [U-Boot] [PATCH 2/2] RFC: exynos: Disable the display controller when starting Linux

2013-10-03 Thread Ajay kumar
+Simon Glass


On Thu, Oct 3, 2013 at 2:25 PM, Albert ARIBAUD wrote:

> Hi Ajay,
>
> On Thu, 03 Oct 2013 14:34:20 +0530, Ajay Kumar
>  wrote:
>
> > If the exynos display controller is still active when Linux starts,
> > then it will result in a kernel panic while FIMD sysmmu driver is
> > getting probed.
> > Calling exynos_fimd_lcd_disable() before jumping into kernel
> > disables the display controller by switching off the windows,
> > hence resolving the kernel panic which arises from sysmmu driver.
> >
> > Create an Exynos specific definition for the weak function
> > arch_cleanup_before_linux(), and then place the call to
> > exynos_fimd_lcd_disable() inside the overrided definition of
> > arch_cleanup_before_linux().
> >
> > Signed-off-by: Ajay Kumar 
> > Signed-off-by: Simon Glass 
> > ---
>
> Why should the fix to this situation be making U-Boot disable the
> display controller rather than making Linux able to cope with an
> already active display controller?
>
> Besides, fixing Linux would allow seamless booting displays, without an
> ugly off-on glitch.
>
> Amicalement,
> --
> Albert.
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] RFC: arm: add call to cleanup things before jumping into kernel

2013-10-03 Thread Ajay kumar
Hi Albert,


On Thu, Oct 3, 2013 at 2:28 PM, Albert ARIBAUD wrote:

> Hi Ajay,
>
> On Thu, 03 Oct 2013 14:34:19 +0530, Ajay Kumar
>  wrote:
>
> > Add infrasturcture to cleanup any of those architecture related settings
> > done for u-boot, if they can cause problem during kernel boot.
> >
> > Signed-off-by: Ajay Kumar 
> > ---
>
> Regardless to ma question re fixing the issue in U-Boot or Linux: does
> something prevent using the already existing cleanup_before_linux()
> function, and if not, what made you choose to create another one
> instead?
>
> cleanup_before_linux() generally cleans up things specific to the
processor.
I thought of introducing a cleanup function which would allow us to cleanup
things which are SOC specific(all SOC under armv7 as per the patch).
And, used the same function to cleanup some exynos specific stuff before
booting linux.
May be, I should have used a different name instead of
arch_cleanup_before_linux?

> Amicalement,
> --
> Albert.
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] RFC: exynos: Disable the display controller when starting Linux

2013-10-03 Thread Ajay kumar
Hi Simon,

On Thu, Oct 3, 2013 at 7:51 PM, Simon Glass  wrote:

> Hi,
>
> On Thu, Oct 3, 2013 at 3:24 AM, Ajay kumar  wrote:
> > +Simon Glass
> >
> >
> > On Thu, Oct 3, 2013 at 2:25 PM, Albert ARIBAUD <
> albert.u.b...@aribaud.net>
> > wrote:
> >>
> >> Hi Ajay,
> >>
> >> On Thu, 03 Oct 2013 14:34:20 +0530, Ajay Kumar
> >>  wrote:
> >>
> >> > If the exynos display controller is still active when Linux starts,
> >> > then it will result in a kernel panic while FIMD sysmmu driver is
> >> > getting probed.
> >> > Calling exynos_fimd_lcd_disable() before jumping into kernel
> >> > disables the display controller by switching off the windows,
> >> > hence resolving the kernel panic which arises from sysmmu driver.
> >> >
> >> > Create an Exynos specific definition for the weak function
> >> > arch_cleanup_before_linux(), and then place the call to
> >> > exynos_fimd_lcd_disable() inside the overrided definition of
> >> > arch_cleanup_before_linux().
> >> >
> >> > Signed-off-by: Ajay Kumar 
> >> > Signed-off-by: Simon Glass 
> >> > ---
> >>
> >> Why should the fix to this situation be making U-Boot disable the
> >> display controller rather than making Linux able to cope with an
> >> already active display controller?
> >>
> >> Besides, fixing Linux would allow seamless booting displays, without an
> >> ugly off-on glitch.
>
> Yes, I believe this bug was fixed in Linux - Ajay do you know? Perhaps
> the fix has not been upstreamed yet?
>
> Regards,
> Simon
>
> You are right. I found it.
http://permalink.gmane.org/gmane.comp.video.dri.devel/78840
This patch would be resent in next series of iommu patches.
So, we would not need the u-boot patch anymore!

> >>
> >> Amicalement,
> >> --
> >> Albert.
> >> ___
> >> U-Boot mailing list
> >> U-Boot@lists.denx.de
> >> http://lists.denx.de/mailman/listinfo/u-boot
> >
> >
>
Thanks and regards,
Ajay Kumar
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] RFC: arm: add call to cleanup things before jumping into kernel

2013-10-03 Thread Ajay kumar
On Thu, Oct 3, 2013 at 9:14 PM, Albert ARIBAUD wrote:

> Hi Ajay,
>
> On Thu, 3 Oct 2013 14:49:49 +0530, Ajay kumar 
> wrote:
>
> > Hi Albert,
> >
> >
> > On Thu, Oct 3, 2013 at 2:28 PM, Albert ARIBAUD <
> albert.u.b...@aribaud.net>wrote:
> >
> > > Hi Ajay,
> > >
> > > On Thu, 03 Oct 2013 14:34:19 +0530, Ajay Kumar
> > >  wrote:
> > >
> > > > Add infrasturcture to cleanup any of those architecture related
> settings
> > > > done for u-boot, if they can cause problem during kernel boot.
> > > >
> > > > Signed-off-by: Ajay Kumar 
> > > > ---
> > >
> > > Regardless to ma question re fixing the issue in U-Boot or Linux: does
> > > something prevent using the already existing cleanup_before_linux()
> > > function, and if not, what made you choose to create another one
> > > instead?
> > >
>
> (fixed quote glitch here that put the start of your reply inside mine.)
>
> > cleanup_before_linux() generally cleans up things specific to the
> > processor.
> > I thought of introducing a cleanup function which would allow us to
> cleanup
> > things which are SOC specific(all SOC under armv7 as per the patch).
> > And, used the same function to cleanup some exynos specific stuff before
> > booting linux.
> > May be, I should have used a different name instead of
> > arch_cleanup_before_linux?
>
> Well, if it is *SoC* specific, then it is not *arch* specific, so yes,
> the name should be changed. Now, we don't really have a concept of
> 'SoC-specific' in U-Boot, so board-specific, as suggested by Simon, is
> the 'next not-too-worst thing'.
>
> Still, don't rush to provide a new patch. According to Simon, the Linux
> panic was solved and might just not have hit mainline yet; if that is
> confirmed, then renaming arch_cleanup_before_linux() becomes moot.
>
> Ok. I found the kernel patch:
http://permalink.gmane.org/gmane.comp.video.dri.devel/78840
So, this patch is not needed.

Thanks and Regards,
Ajay Kumar
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/6] [U-boot] SMDK5420: Add support for FIMD and DP

2013-10-10 Thread Ajay kumar
+Simon


On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote:

> This patchset adds support for FIMD and DP on SMDK5420.
>
> This patchset has dependency on Rajeshwari's base patchset:
> [V4] EXYNOS5420: Add SMDK5420 board support
> http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/170582
>
> Also, for testing we need Naveen's i2c patchset aswell:
> i2c: improve s3c24x0 with High-speed and new SYS_I2C framework support
> http://www.mail-archive.com/u-boot@lists.denx.de/msg122679.html
>
> Ajay Kumar (6):
> [PATCH 1/6] exynos_fb: Remove usage of static defines
> [PATCH 2/6] arm: exynos: Add RPLL for Exynos5420
> [PATCH 3/6] arm: exynos: Add get_lcd_clk and set_lcd_clk
> callbacks for Exynos5420
> [PATCH 4/6] video: exynos_fimd: Add framework to disable FIMD
> sysmmu
> [PATCH 5/6] smdk5420: Implement callbacks needed by exynos_fb
> driver
> [PATCH 6/6] CONFIG: SMDK5420: Enable FIMD and DP
>
>  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.dtsi   |   5 ++
>  arch/arm/include/asm/arch-exynos/clk.h |   1 +
>  arch/arm/include/asm/arch-exynos/system.h  |   1 +
>  board/samsung/common/board.c   |  15 
>  board/samsung/smdk5420/smdk5420.c  | 118
> +++--
>  doc/device-tree-bindings/video/exynos-fb.txt   |   2 +
>  drivers/video/exynos_fb.c  |  20 ++---
>  drivers/video/exynos_fimd.c|  12 +++
>  include/configs/exynos5250-dt.h|   2 -
>  include/configs/smdk5420.h |   8 ++
>  14 files changed, 172 insertions(+), 104 deletions(-)
>
> --
> 1.7.12.4
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/6] [U-boot] SMDK5420: Add support for FIMD and DP

2013-10-14 Thread Ajay kumar
ping.


On Fri, Oct 11, 2013 at 9:57 AM, Ajay kumar  wrote:

> +Simon
>
>
> On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote:
>
>> This patchset adds support for FIMD and DP on SMDK5420.
>>
>> This patchset has dependency on Rajeshwari's base patchset:
>> [V4] EXYNOS5420: Add SMDK5420 board support
>> http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/170582
>>
>> Also, for testing we need Naveen's i2c patchset aswell:
>> i2c: improve s3c24x0 with High-speed and new SYS_I2C framework support
>> http://www.mail-archive.com/u-boot@lists.denx.de/msg122679.html
>>
>> Ajay Kumar (6):
>> [PATCH 1/6] exynos_fb: Remove usage of static defines
>> [PATCH 2/6] arm: exynos: Add RPLL for Exynos5420
>> [PATCH 3/6] arm: exynos: Add get_lcd_clk and set_lcd_clk
>> callbacks for Exynos5420
>> [PATCH 4/6] video: exynos_fimd: Add framework to disable FIMD
>> sysmmu
>> [PATCH 5/6] smdk5420: Implement callbacks needed by exynos_fb
>> driver
>> [PATCH 6/6] CONFIG: SMDK5420: Enable FIMD and DP
>>
>>  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.dtsi   |   5 ++
>>  arch/arm/include/asm/arch-exynos/clk.h |   1 +
>>  arch/arm/include/asm/arch-exynos/system.h  |   1 +
>>  board/samsung/common/board.c   |  15 
>>  board/samsung/smdk5420/smdk5420.c  | 118
>> +++--
>>  doc/device-tree-bindings/video/exynos-fb.txt   |   2 +
>>  drivers/video/exynos_fb.c  |  20 ++---
>>  drivers/video/exynos_fimd.c|  12 +++
>>  include/configs/exynos5250-dt.h|   2 -
>>  include/configs/smdk5420.h |   8 ++
>>  14 files changed, 172 insertions(+), 104 deletions(-)
>>
>> --
>> 1.7.12.4
>>
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>>
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/6] arm: exynos: Add RPLL for Exynos5420

2013-10-14 Thread Ajay kumar
ping.


On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote:

> RPLL is needed to drive the LCD panel on Exynos5420 based boards.
>
> Signed-off-by: Ajay Kumar 
> ---
>  arch/arm/cpu/armv7/exynos/clock_init.h |  3 +++
>  arch/arm/cpu/armv7/exynos/clock_init_exynos5.c | 13 +
>  2 files changed, 16 insertions(+)
>
> diff --git a/arch/arm/cpu/armv7/exynos/clock_init.h
> b/arch/arm/cpu/armv7/exynos/clock_init.h
> index a875d0b..fce502f 100644
> --- a/arch/arm/cpu/armv7/exynos/clock_init.h
> +++ b/arch/arm/cpu/armv7/exynos/clock_init.h
> @@ -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];
>
> diff --git a/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
> b/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
> index e7f1496..c91c4a1 100644
> --- a/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
> +++ b/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c
> @@ -179,6 +179,10 @@ struct mem_timings mem_timings[] = {
> .spll_mdiv = 0xc8,
> .spll_pdiv = 0x3,
> .spll_sdiv = 0x2,
> +   /* RPLL @266MHz */
> +   .rpll_mdiv = 0x10A,
> +   .rpll_pdiv = 0x3,
> +   .rpll_sdiv = 0x3,
>
> .direct_cmd_msr = {
> 0x00020018, 0x0003, 0x00010046, 0x0d70,
> @@ -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);
>
> --
> 1.7.12.4
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6] CONFIG: SMDK5420: Enable FIMD and DP

2013-10-14 Thread Ajay kumar
ping.


On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote:

> Enable FIMD and DP drivers on SMDK5420 so that we get to
> see the LCD console on eDP panel.
>
> Signed-off-by: Ajay Kumar 
> ---
>  include/configs/smdk5420.h | 8 
>  1 file changed, 8 insertions(+)
>
> diff --git a/include/configs/smdk5420.h b/include/configs/smdk5420.h
> index 447f8e5..cc9c424 100644
> --- a/include/configs/smdk5420.h
> +++ b/include/configs/smdk5420.h
> @@ -53,4 +53,12 @@
>
>  #define CONFIG_MAX_I2C_NUM 11
>
> +/* Display */
> +#define CONFIG_LCD
> +#ifdef CONFIG_LCD
> +#define CONFIG_EXYNOS_FB
> +#define CONFIG_EXYNOS_DP
> +#define LCD_BPPLCD_COLOR16
> +#endif
> +
>  #endif /* __CONFIG_5420_H */
> --
> 1.7.12.4
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] video: exynos_fimd: Add framework to disable FIMD sysmmu

2013-10-14 Thread Ajay kumar
ping.


On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote:

> On Exynos5420, 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
> to disable FIMD sysmmu on Exynos5420.
>
> Signed-off-by: Ajay Kumar 
> ---
>  arch/arm/dts/exynos5420.dtsi |  5 +
>  doc/device-tree-bindings/video/exynos-fb.txt |  2 ++
>  drivers/video/exynos_fimd.c  | 12 
>  3 files changed, 19 insertions(+)
>
> diff --git a/arch/arm/dts/exynos5420.dtsi b/arch/arm/dts/exynos5420.dtsi
> index ca6c605..2d64df8 100644
> --- a/arch/arm/dts/exynos5420.dtsi
> +++ b/arch/arm/dts/exynos5420.dtsi
> @@ -71,4 +71,9 @@
> reg = <0x12E2 0x100>;
> interrupts = <0 203 0>;
> };
> +
> +   fimd@1440 {
> +   /* sysmmu is not used in U-Boot */
> +   samsung,disable-sysmmu;
> +   };
>  };
> diff --git a/doc/device-tree-bindings/video/exynos-fb.txt
> b/doc/device-tree-bindings/video/exynos-fb.txt
> index bb7441c..cddb505 100644
> --- a/doc/device-tree-bindings/video/exynos-fb.txt
> +++ b/doc/device-tree-bindings/video/exynos-fb.txt
> @@ -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)
>
>  Example:
>  SOC specific part:
> diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
> index 8c2de4e..410fff1 100644
> --- a/drivers/video/exynos_fimd.c
> +++ b/drivers/video/exynos_fimd.c
> @@ -267,6 +267,18 @@ void exynos_fimd_lcd_init(vidinfo_t *vid)
> node,
> "reg");
> if (fimd_ctrl == NULL)
> debug("Can't get the FIMD base address\n");
> +
> +   if (fdtdec_get_bool(gd->fdt_blob, node, "samsung,disable-sysmmu"))
> {
> +   /*
> +   * The reset value for FIMD SYSMMU registers
> +   * MMU_CTRL:0x1464 and MMU_CTRL:0x1468 is 3.
> +   * This means FIMD SYSMMU is on by default on Exynos5420.
> +   * Since in u-boot we don't use SYSMMU, we are disabling
> +   * FIMD SYSMMU.
> +   */
> +   writel(0x0, 0x1464);
> +   writel(0x0, 0x1468);
> +   }
>  #else
> fimd_ctrl = (struct exynos_fb *)samsung_get_base_fimd();
>  #endif
> --
> 1.7.12.4
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/6] arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420

2013-10-14 Thread Ajay kumar
ping.


On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote:

> 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.
>
> Signed-off-by: Ajay Kumar 
> ---
>  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(-)
>
> diff --git a/arch/arm/cpu/armv7/exynos/clock.c
> b/arch/arm/cpu/armv7/exynos/clock.c
> index bc06995..e953ddc 100644
> --- a/arch/arm/cpu/armv7/exynos/clock.c
> +++ b/arch/arm/cpu/armv7/exynos/clock.c
> @@ -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;
> @@ -388,6 +389,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;
> @@ -1035,6 +1039,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 =
> @@ -1159,6 +1197,33 @@ void exynos5_set_lcd_clk(void)
> writel(cfg, &clk->div_disp1_0);
>  }
>
> +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 =
> @@ -1628,14 +1693,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();
>  }
> diff --git a/arch/arm/cpu/armv7/exynos/exynos5_setup.h
> b/arch/arm/cpu/armv7/exynos/exynos5_setup.h
> index 8e05a00..70b1c04 100644
> --- a/arch/arm/cpu/armv7/exynos/exynos5_setup.h
> +++ b/arch/arm/cpu/armv7/exynos/exynos5_setup.h
> @@ -780,7 +780,7 @@
>  #define CLK_SRC_TOP2_VAL   0x11101000
>  #define CLK_SRC_TOP3_VAL   0x
>  #define CLK_S

Re: [U-Boot] [PATCH 5/6] smdk5420: Implement callbacks needed by exynos_fb driver

2013-10-14 Thread Ajay kumar
ping.


On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote:

> Add callbacks to set up DP-HPD, backlight and LCD power
> on SMDK5420.
>
> Signed-off-by: Ajay Kumar 
> ---
>  board/samsung/smdk5420/smdk5420.c | 118
> +++---
>  1 file changed, 34 insertions(+), 84 deletions(-)
>
> diff --git a/board/samsung/smdk5420/smdk5420.c
> b/board/samsung/smdk5420/smdk5420.c
> index cf76455..3f29ce0 100644
> --- a/board/samsung/smdk5420/smdk5420.c
> +++ b/board/samsung/smdk5420/smdk5420.c
> @@ -137,98 +137,48 @@ int board_mmc_init(bd_t *bis)
>  #endif
>
>  #ifdef CONFIG_LCD
> -void cfg_lcd_gpio(void)
> +void exynos_cfg_lcd_gpio(void)
>  {
> -   struct exynos5_gpio_part1 *gpio1 =
> -   (struct exynos5_gpio_part1 *)samsung_get_base_gpio_part1();
> +   struct exynos5420_gpio_part2 *gpio2 =
> +   (struct exynos5420_gpio_part2
> *)samsung_get_base_gpio_part2();
>
> -   /* For Backlight */
> +   /* Set Hotplug detect for DP */
> +   s5p_gpio_cfg_pin(&gpio2->x0, 7, GPIO_FUNC(0x3));
> +}
> +
> +void exynos_backlight_on(unsigned int onoff)
> +{
> +   struct exynos5420_gpio_part1 *gpio1 =
> +   (struct exynos5420_gpio_part1
> *)samsung_get_base_gpio_part1();
> +
> +   struct exynos5420_gpio_part2 *gpio2 =
> +   (struct exynos5420_gpio_part2
> *)samsung_get_base_gpio_part2();
> +
> +   /* For PWM */
> s5p_gpio_cfg_pin(&gpio1->b2, 0, GPIO_OUTPUT);
> s5p_gpio_set_value(&gpio1->b2, 0, 1);
>
> -   /* LCD power on */
> -   s5p_gpio_cfg_pin(&gpio1->x1, 5, GPIO_OUTPUT);
> -   s5p_gpio_set_value(&gpio1->x1, 5, 1);
> -
> -   /* Set Hotplug detect for DP */
> -   s5p_gpio_cfg_pin(&gpio1->x0, 7, GPIO_FUNC(0x3));
> +   /* BL_EN */
> +   s5p_gpio_cfg_pin(&gpio2->x1, 5, GPIO_OUTPUT);
> +   s5p_gpio_set_value(&gpio2->x1, 5, 1);
>  }
>
> -vidinfo_t panel_info = {
> -   .vl_freq= 60,
> -   .vl_col = 2560,
> -   .vl_row = 1600,
> -   .vl_width   = 2560,
> -   .vl_height  = 1600,
> -   .vl_clkp= CONFIG_SYS_LOW,
> -   .vl_hsp = CONFIG_SYS_LOW,
> -   .vl_vsp = CONFIG_SYS_LOW,
> -   .vl_dp  = CONFIG_SYS_LOW,
> -   .vl_bpix= 4,/* LCD_BPP = 2^4, for output conosle on
> LCD */
> -
> -   /* wDP panel timing infomation */
> -   .vl_hspw= 32,
> -   .vl_hbpd= 80,
> -   .vl_hfpd= 48,
> -
> -   .vl_vspw= 6,
> -   .vl_vbpd= 37,
> -   .vl_vfpd= 3,
> -   .vl_cmd_allow_len = 0xf,
> -
> -   .win_id = 3,
> -   .cfg_gpio   = cfg_lcd_gpio,
> -   .backlight_on   = NULL,
> -   .lcd_power_on   = NULL,
> -   .reset_lcd  = NULL,
> -   .dual_lcd_enabled = 0,
> -
> -   .init_delay = 0,
> -   .power_on_delay = 0,
> -   .reset_delay= 0,
> -   .interface_mode = FIMD_RGB_INTERFACE,
> -   .dp_enabled = 1,
> -};
> -
> -static struct edp_device_info edp_info = {
> -   .disp_info = {
> -   .h_res = 2560,
> -   .h_sync_width = 32,
> -   .h_back_porch = 80,
> -   .h_front_porch = 48,
> -   .v_res = 1600,
> -   .v_sync_width  = 6,
> -   .v_back_porch = 37,
> -   .v_front_porch = 3,
> -   .v_sync_rate = 60,
> -   },
> -   .lt_info = {
> -   .lt_status = DP_LT_NONE,
> -   },
> -   .video_info = {
> -   .master_mode = 0,
> -   .bist_mode = DP_DISABLE,
> -   .bist_pattern = NO_PATTERN,
> -   .h_sync_polarity = 0,
> -   .v_sync_polarity = 0,
> -   .interlaced = 0,
> -   .color_space = COLOR_RGB,
> -   .dynamic_range = VESA,
> -   .ycbcr_coeff = COLOR_YCBCR601,
> -   .color_depth = COLOR_8,
> -   },
> -};
> -
> -static struct exynos_dp_platform_data dp_platform_data = {
> -   .phy_enable = set_dp_phy_ctrl,
> -   .edp_dev_info   = &edp_info,
> -};
> -
> -void init_panel_info(vidinfo_t *vid)
> +void exynos_lcd_power_on(void)
>  {
> -   vid->rgb_mode   = MODE_RGB_P,
> -
> -   exynos_set_dp_platform_data(&dp_platform_data);
> +   int pmic_bus, pmic_i2caddr, ldo38_reg, old_bus;
> +   u8 value;
> +
> +   /* enable VDD_28IO_DP: LDO38 should be at 2.8V */
> +   pmic_bus = 4;
> +   pmic_i2caddr = 0x6

Re: [U-Boot] [PATCH 1/6] exynos_fb: Remove usage of static defines

2013-10-14 Thread Ajay kumar
ping.


On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote:

> 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.
>
> Signed-off-by: Ajay Kumar 
> ---
>  arch/arm/include/asm/arch-exynos/system.h |  1 +
>  board/samsung/common/board.c  | 15 +++
>  drivers/video/exynos_fb.c | 20 ++--
>  include/configs/exynos5250-dt.h   |  2 --
>  4 files changed, 22 insertions(+), 16 deletions(-)
>
> diff --git a/arch/arm/include/asm/arch-exynos/system.h
> b/arch/arm/include/asm/arch-exynos/system.h
> index 7e2057c..4968d3d 100644
> --- a/arch/arm/include/asm/arch-exynos/system.h
> +++ b/arch/arm/include/asm/arch-exynos/system.h
> @@ -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 */
> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
> index ce85ddb..ae89c94 100644
> --- a/board/samsung/common/board.c
> +++ b/board/samsung/common/board.c
> @@ -17,6 +17,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>
> @@ -130,6 +131,20 @@ int board_early_init_f(void)
>  #ifdef CONFIG_SYS_I2C_INIT_BOARD
> 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 err;
>  }
>  #endif
> diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
> index 5c7ec91..686870f 100644
> --- a/drivers/video/exynos_fb.c
> +++ b/drivers/video/exynos_fb.c
> @@ -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
>
> @@ -159,7 +154,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);
> @@ -303,10 +298,7 @@ void lcd_ctrl_init(void *lcdbase)
> set_system_display_ctrl();
> set_lcd_clk();
>
> -#ifdef CONFIG_OF_CONTROL
> -   if (exynos_fimd_parse_dt(gd->fdt_blob))
> -   debug("Can't get proper panel info\n");
> -#else
> +#ifndef CONFIG_OF_CONTROL
> /* initialize parameters which is specific to panel. */
> init_panel_info(&panel_info);
>  #endif
> diff --git a/include/configs/exynos5250-dt.h
> b/include/configs/exynos5250-dt.h
> index 689919d..508962c 100644
> --- a/include/configs/exynos5250-dt.h
> +++ b/include/configs/exynos5250-dt.h
> @@ -50,8 +50,6 @@
>  #ifdef CONFIG_LCD
>  #define CONFIG_EXYNOS_FB
>  #define CONFIG_EXYNOS_DP
> -#define LCD_XRES   2560
> -#define LCD_YRES   1600
>  #define LCD_BPPLCD_COLOR16
>  #endif
>  #endif  /* __CONFIG_5250_H */
> --
> 1.7.12.4
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Fwd: [PATCH 1/6] exynos_fb: Remove usage of static defines

2013-10-23 Thread Ajay kumar
Hi Simon,


On Wed, Oct 16, 2013 at 10:04 PM, Simon Glass  wrote:

> Hi Ajay,
>
> [once more from the right address]
>
> On Mon, Sep 30, 2013 at 5:20 AM, Ajay Kumar  >wrote:
>
> > 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.
> >
> > Signed-off-by: Ajay Kumar 
> >
>
> Acked-by: Simon Glass 
>
> I can't test this on Pit at present - any chance of a series at some point
> to enable that?
>
Should wait till Rajeshwari sends a patch for peach-pit dts.

 I pushed my branch to u-boot-x86.git branch try-5420b.
>
> As a general comment, it would be nice to follow up with a series to fully
> enable device tree for the GPIOs also. At the moment these are hard-coded.
>
Ok. I will do this for exynos video driver.

 Regards,
> Simon
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
>

Thanks and regards,
Ajay Kumar
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V4 03/12] video:exynos_fb:fdt: add additional fdt data

2014-03-04 Thread Ajay kumar
Piotr,

Sorry for late reply.
Can you change the name of exynos_lcd_panel_init
to exynos_lcd_misc_init. panel_init definitely gives a wrong meaning.

And, can you let me know where you are actually using
"panel_info.resolution"? Is it needed for FIMD or is it needed by MIPI-DSI?
If it is MIPI specific, then it should come as a DT entry from MIPI-DSI
node.

Also, if you add a new DT entry, please update the following file:
doc/device-tree-bindings/video/exynos-fb.txt

Regards,
Ajay Kumar



On Tue, Mar 4, 2014 at 7:25 PM, Piotr Wilczek  wrote:

> This patch adds additional data parsing from DTB and adds the new
> exynos_lcd_panel_init() function for panel specific initialisation
> from the board file.
>
> Signed-off-by: Piotr Wilczek 
> Signed-off-by: Kyungmin Park 
> Cc: Minkyu Kang 
> ---
> Changes for v4:
>  - remove duplicated DT properties at exynos_fb.c file
>
> Changes for v3:
>  - none
>
> Changes for v2:
>  - removed duplicate DTB node parsing for panel_info.logo_on
>  - added (weak) exynos_lcd_panel_init function for panel specific
> initialisation from board file
>
>  drivers/video/exynos_fb.c | 15 +++
>  1 file changed, 15 insertions(+)
>
> diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
> index 00a0a11..77a3186 100644
> --- a/drivers/video/exynos_fb.c
> +++ b/drivers/video/exynos_fb.c
> @@ -104,6 +104,13 @@ void __exynos_backlight_reset(void)
>  void exynos_backlight_reset(void)
> __attribute__((weak, alias("__exynos_backlight_reset")));
>
> +int __exynos_lcd_panel_init(vidinfo_t *vid)
> +{
> +   return 0;
> +}
> +int exynos_lcd_panel_init(vidinfo_t *vid)
> +   __attribute__((weak, alias("__exynos_lcd_panel_init")));
> +
>  static void lcd_panel_on(vidinfo_t *vid)
>  {
> udelay(vid->init_delay);
> @@ -269,6 +276,9 @@ int exynos_fimd_parse_dt(const void *blob)
> panel_info.dual_lcd_enabled = fdtdec_get_int(blob, node,
>
> "samsung,dual-lcd-enabled", 0);
>
> +   panel_info.resolution = fdtdec_get_int(blob, node,
> +   "samsung,resolution", 0);
> +
> return 0;
>  }
>  #endif
> @@ -281,10 +291,15 @@ void lcd_ctrl_init(void *lcdbase)
>  #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
> +   exynos_lcd_panel_init(&panel_info);
>  #else
> /* initialize parameters which is specific to panel. */
> init_panel_info(&panel_info);
>  #endif
> +
> panel_width = panel_info.vl_width;
> panel_height = panel_info.vl_height;
>
> --
> 1.8.3.2
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V4 02/12] video:mipidsim:fdt: Add DT support for mipi dsim driver

2014-03-04 Thread Ajay kumar
Piotr,

You need to add the documentation for the bindings you create.
Please add a exynos_mipi_dsi.txt file under the directory:
doc/device-tree-bindings/video/

Regards,
Ajay Kumar


On Tue, Mar 4, 2014 at 7:25 PM, Piotr Wilczek  wrote:

> This patch enables parsing mipi data from device tree.
> Non device tree case is still supported.
>
> Signed-off-by: Piotr Wilczek 
> Signed-off-by: Kyungmin Park 
> Cc: Minkyu Kang 
> ---
> Changes for v4:
>  - use "-" hypen for DT bindings
>
> Changes for v3:
>  - none
>
> Changes for v2:
>  - removed panel specific init function 's6e8ax0_init' to the board file
>
>  arch/arm/include/asm/arch-exynos/mipi_dsim.h |  5 ++
>  drivers/video/exynos_mipi_dsi.c  | 96
> 
>  include/fdtdec.h |  1 +
>  lib/fdtdec.c |  1 +
>  4 files changed, 103 insertions(+)
>
> diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
> b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
> index 40aca71..50e5c25 100644
> --- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
> +++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
> @@ -12,6 +12,7 @@
>
>  #include 
>  #include 
> +#include 
>
>  #define PANEL_NAME_SIZE(32)
>
> @@ -368,8 +369,12 @@ int exynos_mipi_dsi_register_lcd_device(struct
> mipi_dsim_lcd_device
> *lcd_dev);
>
>  void exynos_set_dsim_platform_data(struct exynos_platform_mipi_dsim *pd);
> +void exynos_init_dsim_platform_data(vidinfo_t *vid);
>
>  /* panel driver init based on mipi dsi interface */
>  void s6e8ax0_init(void);
>
> +#ifdef CONFIG_OF_CONTROL
> +extern int mipi_power(void);
> +#endif
>  #endif /* _DSIM_H */
> diff --git a/drivers/video/exynos_mipi_dsi.c
> b/drivers/video/exynos_mipi_dsi.c
> index 8bb8fea..7dd4652 100644
> --- a/drivers/video/exynos_mipi_dsi.c
> +++ b/drivers/video/exynos_mipi_dsi.c
> @@ -9,6 +9,8 @@
>
>  #include 
>  #include 
> +#include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -22,7 +24,14 @@
>  #define master_to_driver(a)(a->dsim_lcd_drv)
>  #define master_to_device(a)(a->dsim_lcd_dev)
>
> +DECLARE_GLOBAL_DATA_PTR;
> +
>  static struct exynos_platform_mipi_dsim *dsim_pd;
> +#ifdef CONFIG_OF_CONTROL
> +static struct mipi_dsim_config dsim_config_dt;
> +static struct exynos_platform_mipi_dsim dsim_platform_data_dt;
> +static struct mipi_dsim_lcd_device mipi_lcd_device_dt;
> +#endif
>
>  struct mipi_dsim_ddi {
> int bus_id;
> @@ -238,3 +247,90 @@ void exynos_set_dsim_platform_data(struct
> exynos_platform_mipi_dsim *pd)
>
> dsim_pd = pd;
>  }
> +
> +#ifdef CONFIG_OF_CONTROL
> +int exynos_dsim_config_parse_dt(const void *blob)
> +{
> +   int node;
> +
> +   node = fdtdec_next_compatible(blob, 0,
> COMPAT_SAMSUNG_EXYNOS_MIPI_DSI);
> +   if (node <= 0) {
> +   printf("exynos_mipi_dsi: Can't get device node for mipi
> dsi\n");
> +   return -ENODEV;
> +   }
> +
> +   dsim_config_dt.e_interface = fdtdec_get_int(blob, node,
> +   "samsung,dsim-config-e-interface", 0);
> +
> +   dsim_config_dt.e_virtual_ch = fdtdec_get_int(blob, node,
> +   "samsung,dsim-config-e-virtual-ch", 0);
> +
> +   dsim_config_dt.e_pixel_format = fdtdec_get_int(blob, node,
> +   "samsung,dsim-config-e-pixel-format", 0);
> +
> +   dsim_config_dt.e_burst_mode = fdtdec_get_int(blob, node,
> +   "samsung,dsim-config-e-burst-mode", 0);
> +
> +   dsim_config_dt.e_no_data_lane = fdtdec_get_int(blob, node,
> +   "samsung,dsim-config-e-no-data-lane", 0);
> +
> +   dsim_config_dt.e_byte_clk = fdtdec_get_int(blob, node,
> +   "samsung,dsim-config-e-byte-clk", 0);
> +
> +   dsim_config_dt.hfp = fdtdec_get_int(blob, node,
> +   "samsung,dsim-config-hfp", 0);
> +
> +   dsim_config_dt.p = fdtdec_get_int(blob, node,
> + "samsung,dsim-config-p", 0);
> +   dsim_config_dt.m = fdtdec_get_int(blob, node,
> + "samsung,dsim-config-m", 0);
> +   dsim_config_dt.s = fdtdec_get_int(blob, node,
> + "samsung,dsim-config-s", 0);
> +
> +   dsim_config_dt.pll_stable_time = fdtdec_

Re: [U-Boot] [PATCH 09/10] exynos: Enable the LCD backlight for snow

2014-03-29 Thread Ajay kumar
Hi Simon,

Find my comments below:

On Wed, Mar 26, 2014 at 11:26 PM, Simon Glass  wrote:

> The backlight uses FETs on the TPS65090. Enable this so that the display
> is visible.
>
> Signed-off-by: Simon Glass 
> ---
>
>  board/samsung/smdk5250/exynos5-dt.c | 90
> +
>  1 file changed, 90 insertions(+)
>
> diff --git a/board/samsung/smdk5250/exynos5-dt.c
> b/board/samsung/smdk5250/exynos5-dt.c
> index c83b034..a0ae641 100644
> --- a/board/samsung/smdk5250/exynos5-dt.c
> +++ b/board/samsung/smdk5250/exynos5-dt.c
> @@ -20,6 +20,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>
>  DECLARE_GLOBAL_DATA_PTR;
> @@ -60,6 +61,52 @@ int checkboard(void)
>  #endif
>
>  #ifdef CONFIG_LCD
>
We should make sure this code runs only for snow, and not for SMDK.
Only Snow contains the bridge chip.

> +static int board_dp_bridge_setup(void)
> +{
> +   struct exynos5_gpio_part1 *gpio1 =
> +   (struct exynos5_gpio_part1 *)samsung_get_base_gpio_part1();
> +   const int MAX_TRIES = 10;
> +   int num_tries;
> +
> +   debug("%s\n", __func__);
> +
> +   /* Setup the GPIOs */
> +
> +   /* PD is ACTIVE_LOW, and initially de-asserted */
> +   s5p_gpio_set_pull(&gpio1->y2, 5, GPIO_PULL_NONE);
> +   s5p_gpio_direction_output(&gpio1->y2, 5, 1);
> +
> +   /* Reset is ACTIVE_LOW */
> +   s5p_gpio_set_pull(&gpio1->x1, 5, GPIO_PULL_NONE);
> +   s5p_gpio_direction_output(&gpio1->x1, 5, 0);
> +
> +   udelay(10);
> +   s5p_gpio_set_value(&gpio1->x1, 5, 1);
> +
> +   s5p_gpio_direction_input(&gpio1->x0, 7);
> +
> +   /*
> +* We need to wait for 90ms after bringing up the bridge since
> there
> +* is a phantom "high" on the HPD chip during its bootup.  The
> phantom
> +* high comes within 7ms of de-asserting PD and persists for at
> least
> +* 15ms.  The real high comes roughly 50ms after PD is
> de-asserted. The
> +* phantom high makes it hard for us to know when the NXP chip is
> up.
> +*/
> +   mdelay(90);
> +
> +   for (num_tries = 0; num_tries < MAX_TRIES; num_tries++) {
> +   /* Check HPD.  If it's high, we're all good. */
> +   if (s5p_gpio_get_value(&gpio1->x0, 7))
> +   return 0;
> +
> +   debug("%s: eDP bridge failed to come up; try %d of %d\n",
> + __func__, num_tries, MAX_TRIES);
> +   }
> +
> +   /* Immediately go into bridge reset if the hp line is not high */
> +   return -ENODEV;
> +}
> +
>  void exynos_cfg_lcd_gpio(void)
>  {
> struct exynos5_gpio_part1 *gpio1 =
> @@ -81,4 +128,47 @@ void exynos_set_dp_phy(unsigned int onoff)
>  {
> set_dp_phy_ctrl(onoff);
>  }
> +
> +void exynos_backlight_on(unsigned int onoff)
> +{
> +   debug("%s(%u)\n", __func__, onoff);
> +
> +   if (onoff) {
> +#ifdef CONFIG_POWER_TPS65090
> +   struct exynos5_gpio_part1 *gpio1 =
> +   (struct exynos5_gpio_part1 *)
> +   samsung_get_base_gpio_part1();
> +   int ret;
> +
> +   ret = tps65090_fet_enable(1); /* Enable FET1, backlight */
> +   if (ret)
> +   return;
> +
> +   /* T5 in the LCD timing spec (defined as > 10ms) */
> +   mdelay(10);
>
Can you check for backlight without using the above delay?

> +
> +   /* board_dp_backlight_pwm */
> +   s5p_gpio_direction_output(&gpio1->b2, 0, 1);
>
+
> +   /* T6 in the LCD timing spec (defined as > 10ms) */
> +   mdelay(10);
>
Can you check for backlight without using the above delay?

> +
> +   /* board_dp_backlight_en */
> +   s5p_gpio_direction_output(&gpio1->x3, 0, 1);
> +#endif
> +   }
> +}
> +
> +void exynos_lcd_power_on(void)
> +{
> +   debug("%s\n", __func__);
> +
> +#ifdef CONFIG_POWER_TPS65090
> +   /* board_dp_lcd_vdd */
> +   tps65090_fet_enable(6); /* Enable FET6, lcd panel */
> +#endif
> +
> +   board_dp_bridge_setup();
>
returning int. check for return value and print in case of failure.

> +}
> +
>  #endif
> --
> 1.9.1.423.g4596e3a
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>


Regards,
Ajay Kumar
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 03/10] exynos5: Enable tps65090 on smdk5250

2014-03-29 Thread Ajay kumar
Hi,

The patch name, kind of gives wrong impression.
There is no TPS65090 device on SMDK5250.
TPS65090 is present only on snow board based on exynos5250.
Please change it!


On Wed, Mar 26, 2014 at 11:26 PM, Simon Glass  wrote:

> From: Aaron Durbin 
>
> The TPS65090 pmic chip can be on exynos5250 boards. Therefore,
> select the appropriate config option for TPS65090 devices.
>
> This commit should really use exynos5-dt.c, when it is available.
>
> Signed-off-by: Simon Glass 
> Reviewed-by: Simon Glass 
> ---
>
>  include/configs/exynos5-dt.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/include/configs/exynos5-dt.h b/include/configs/exynos5-dt.h
> index 414db42..fbf09f5 100644
> --- a/include/configs/exynos5-dt.h
> +++ b/include/configs/exynos5-dt.h
> @@ -259,6 +259,7 @@
>  /* PMIC */
>  #define CONFIG_POWER
>  #define CONFIG_POWER_I2C
> +#define CONFIG_POWER_TPS65090
>
>  /* Ethernet Controllor Driver */
>  #ifdef CONFIG_CMD_NET
> --
> 1.9.1.423.g4596e3a
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

Regards,
Ajay Kumar
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/5] EXYNOS5: Change parent clock of FIMD to MPLL

2012-12-11 Thread Ajay Kumar
With VPLL as source clock to FIMD,
Exynos DP Initializaton was failing sometimes with unstable clock.
Changing FIMD source to resolves this issue.

Signed-off-by: Ajay Kumar 
---
 arch/arm/cpu/armv7/exynos/clock.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index fe61f88..bfcd5f7 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -603,7 +603,7 @@ void exynos5_set_lcd_clk(void)
 */
cfg = readl(&clk->src_disp1_0);
cfg &= ~(0xf);
-   cfg |= 0x8;
+   cfg |= 0x6;
writel(cfg, &clk->src_disp1_0);
 
/*
-- 
1.7.1

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


[U-Boot] [PATCH 2/5] EXYNOS5: Add pinmux for LCD

2012-12-11 Thread Ajay Kumar
This patch adds pinmux configuration for backlight, LCD reset
and HPD for DP panel on Exynos5 SMDK.

Signed-off-by: Ajay Kumar 
---
 arch/arm/cpu/armv7/exynos/pinmux.c|   20 
 arch/arm/include/asm/arch-exynos/periph.h |1 +
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index f02f441..84f52ea 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -284,6 +284,23 @@ void exynos5_spi_config(int peripheral)
}
 }
 
+void exynos5_lcd_config()
+{
+   struct exynos5_gpio_part1 *gpio1 =
+   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+
+   /* For Backlight */
+   s5p_gpio_cfg_pin(&gpio1->b2, 0, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->b2, 0, 1);
+
+   /* LCD power on */
+   s5p_gpio_cfg_pin(&gpio1->x1, 5, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->x1, 5, 1);
+
+   /* Set Hotplug detect for DP */
+   s5p_gpio_cfg_pin(&gpio1->x0, 7, GPIO_FUNC(0x3));
+}
+
 static int exynos5_pinmux_config(int peripheral, int flags)
 {
switch (peripheral) {
@@ -321,6 +338,9 @@ static int exynos5_pinmux_config(int peripheral, int flags)
case PERIPH_ID_SPI4:
exynos5_spi_config(peripheral);
break;
+   case PERIPH_ID_LCD:
+   exynos5_lcd_config();
+   break;
default:
debug("%s: invalid peripheral %d", __func__, peripheral);
return -1;
diff --git a/arch/arm/include/asm/arch-exynos/periph.h 
b/arch/arm/include/asm/arch-exynos/periph.h
index 13abd2d..446f5c9 100644
--- a/arch/arm/include/asm/arch-exynos/periph.h
+++ b/arch/arm/include/asm/arch-exynos/periph.h
@@ -54,6 +54,7 @@ enum periph_id {
PERIPH_ID_UART1,
PERIPH_ID_UART2,
PERIPH_ID_UART3,
+   PERIPH_ID_LCD,
 
PERIPH_ID_COUNT,
PERIPH_ID_NONE = -1,
-- 
1.7.1

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


[U-Boot] [PATCH 3/5] video: Fix compilation dependency of exynos_dp and exynos_mipi on exynos_fb

2012-12-11 Thread Ajay Kumar
When only DP is used, we need not enable CONFIG_EXYNOS_MIPI_DSIM.
Similarly, when only MIPI is used, we need not enable CONFIG_EXYNOS_DP.
But the current structuring of code forces us to enable both
CONFIG_EXYNOS_MIPI_DSIM and CONFIG_EXYNOS_DP.
This patch adds conditional compilation check to remove the dependency.

Signed-off-by: Ajay Kumar 
---
 drivers/video/exynos_fb.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index d9a3f9a..39d3b74 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -103,8 +103,10 @@ static void lcd_panel_on(vidinfo_t *vid)
 
udelay(vid->power_on_delay);
 
+#ifdef CONFIG_EXYNOS_DP
if (vid->dp_enabled)
exynos_init_dp();
+#endif
 
if (vid->reset_lcd) {
vid->reset_lcd();
@@ -120,8 +122,10 @@ static void lcd_panel_on(vidinfo_t *vid)
if (vid->enable_ldo)
vid->enable_ldo(1);
 
+#ifdef CONFIG_EXYNOS_MIPI_DSIM
if (vid->mipi_enabled)
exynos_mipi_dsi_init();
+#endif
 }
 
 void lcd_ctrl_init(void *lcdbase)
-- 
1.7.1

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


[U-Boot] [PATCH 4/5] EXYNOS5: Add support for FIMD and DP

2012-12-11 Thread Ajay Kumar
Add panel_info structure required by LCD driver
and DP panel platdata for SMDK5250.
Enable FIMD and DP support on SMDK5250.
DP Panel size: 2560x1600.
We use 16BPP resolution to get LCD console.

Signed-off-by: Ajay Kumar 
---
 board/samsung/smdk5250/smdk5250.c |   82 +
 include/configs/smdk5250.h|9 
 2 files changed, 91 insertions(+), 0 deletions(-)

diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index 4c50342..e3d6ac1 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -24,12 +24,15 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -181,6 +184,85 @@ static int board_uart_init(void)
return 0;
 }
 
+vidinfo_t panel_info = {
+   .vl_freq= 60,
+   .vl_col = 2560,
+   .vl_row = 1600,
+   .vl_width   = 2560,
+   .vl_height  = 1600,
+   .vl_clkp= CONFIG_SYS_LOW,
+   .vl_hsp = CONFIG_SYS_LOW,
+   .vl_vsp = CONFIG_SYS_LOW,
+   .vl_dp  = CONFIG_SYS_LOW,
+   .vl_bpix= 4,/* LCD_BPP = 2^4, for output conosle on LCD */
+
+   /* wDP panel timing infomation */
+   .vl_hspw= 32,
+   .vl_hbpd= 80,
+   .vl_hfpd= 48,
+
+   .vl_vspw= 6,
+   .vl_vbpd= 37,
+   .vl_vfpd= 3,
+   .vl_cmd_allow_len = 0xf,
+
+   .win_id = 3,
+   .cfg_gpio   = NULL,
+   .backlight_on   = NULL,
+   .lcd_power_on   = NULL,
+   .reset_lcd  = NULL,
+   .dual_lcd_enabled = 0,
+
+   .init_delay = 0,
+   .power_on_delay = 0,
+   .reset_delay= 0,
+   .interface_mode = FIMD_RGB_INTERFACE,
+   .dp_enabled = 1,
+};
+
+static struct edp_device_info edp_info = {
+   .disp_info = {
+   .h_res = 2560,
+   .h_sync_width = 32,
+   .h_back_porch = 80,
+   .h_front_porch = 48,
+   .v_res = 1600,
+   .v_sync_width  = 6,
+   .v_back_porch = 37,
+   .v_front_porch = 3,
+   .v_sync_rate = 60,
+   },
+   .lt_info = {
+   .lt_status = DP_LT_NONE,
+   },
+   .video_info = {
+   .master_mode = 0,
+   .bist_mode = DP_DISABLE,
+   .bist_pattern = NO_PATTERN,
+   .h_sync_polarity = 0,
+   .v_sync_polarity = 0,
+   .interlaced = 0,
+   .color_space = COLOR_RGB,
+   .dynamic_range = VESA,
+   .ycbcr_coeff = COLOR_YCBCR601,
+   .color_depth = COLOR_8,
+   },
+};
+
+static struct exynos_dp_platform_data dp_platform_data = {
+   .phy_enable = set_dp_phy_ctrl,
+   .edp_dev_info   = &edp_info,
+};
+
+void init_panel_info(vidinfo_t *vid)
+{
+   vid->logo_on= 1,
+   vid->rgb_mode   = MODE_RGB_P,
+
+   exynos_set_dp_platform_data(&dp_platform_data);
+   exynos_pinmux_config(PERIPH_ID_LCD, NULL);
+}
+
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
 static int board_i2c_init(void)
 {
diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
index e412da8..9489714 100644
--- a/include/configs/smdk5250.h
+++ b/include/configs/smdk5250.h
@@ -256,6 +256,15 @@
 #define CONFIG_SOUND_WM8994
 #endif
 
+/* Display */
+#define CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_XRES   2560
+#define LCD_YRES   1600
+#define LCD_BPPLCD_COLOR16
+#define CONFIG_CMD_BMP
+
 /* Enable devicetree support */
 #define CONFIG_OF_LIBFDT
 
-- 
1.7.1

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


[U-Boot] [PATCH 5/5] video: Modify exynos_fimd driver to support LCD console.

2012-12-11 Thread Ajay Kumar
Currently, exynos FIMD driver is being used to support only TIZEN LOGOs.
In order to get LCD console, we need to enable half word swap feature
of FIMD and use 16 BPP.

Signed-off-by: Ajay Kumar 
---
 drivers/video/exynos_fimd.c |   10 --
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
index 06eae2e..8a12c30 100644
--- a/drivers/video/exynos_fimd.c
+++ b/drivers/video/exynos_fimd.c
@@ -88,14 +88,20 @@ static void exynos_fimd_set_par(unsigned int win_id)
/* DATAPATH is DMA */
cfg |= EXYNOS_WINCON_DATAPATH_DMA;
 
-   /* bpp is 32 */
+#ifdef CONFIG_TIZEN /* Tizen uses Proprietary LOGO */
cfg |= EXYNOS_WINCON_WSWP_ENABLE;
+#else  /* Other boards must use output console on LCD */
+   cfg |= EXYNOS_WINCON_HAWSWP_ENABLE;
+#endif
 
/* dma burst is 16 */
cfg |= EXYNOS_WINCON_BURSTLEN_16WORD;
 
-   /* pixel format is unpacked RGB888 */
+#ifdef CONFIG_TIZEN /* Tizen uses Proprietary LOGO */
cfg |= EXYNOS_WINCON_BPPMODE_24BPP_888;
+#else  /* Other boards must use output console on LCD */
+   cfg |= EXYNOS_WINCON_BPPMODE_16BPP_565;
+#endif
 
writel(cfg, (unsigned int)&fimd_ctrl->wincon0 +
EXYNOS_WINCON(win_id));
-- 
1.7.1

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


[U-Boot] [PATCH V2 0/4] Add support for FIMD and DP on SMDK5250

2012-12-13 Thread Ajay Kumar
Changes since V1:
-- Fix commit message in [PATCH V2 1/4].
-- Move LCD GPIO confiration from exynos common file to board file.
-- Use CONFIG_CMD_BMP instead of CONFIG_TIZEN to distinguish
   between Proprietary logo support and LCD console support.

 [PATCH V2 1/4] EXYNOS5: Change parent clock of FIMD to MPLL
 [PATCH RESEND 2/4] video: Fix compilation dependency of exynos_dp and 
exynos_mipi on
exynos_fb
 [PATCH V2 3/4] video: Modify exynos_fimd driver to support LCD console
 [PATCH V2 4/4] EXYNOS5: Add support for FIMD and DP

 arch/arm/cpu/armv7/exynos/clock.c |2 +-
 board/samsung/smdk5250/smdk5250.c |   98 +
 drivers/video/exynos_fb.c |9 +++-
 drivers/video/exynos_fimd.c   |   10 +++-
 include/configs/smdk5250.h|8 +++
 5 files changed, 123 insertions(+), 4 deletions(-)

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


[U-Boot] [PATCH V2 1/4] EXYNOS5: Change parent clock of FIMD to MPLL

2012-12-13 Thread Ajay Kumar
With VPLL as source clock to FIMD,
Exynos DP Initializaton was failing sometimes with unstable clock.
Changing FIMD source to MPLL resolves this issue.

Signed-off-by: Ajay Kumar 
Acked-by: Simon Glass 
---
 arch/arm/cpu/armv7/exynos/clock.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index fe61f88..bfcd5f7 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -603,7 +603,7 @@ void exynos5_set_lcd_clk(void)
 */
cfg = readl(&clk->src_disp1_0);
cfg &= ~(0xf);
-   cfg |= 0x8;
+   cfg |= 0x6;
writel(cfg, &clk->src_disp1_0);
 
/*
-- 
1.7.1

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


[U-Boot] [PATCH RESEND 2/4] video: Fix compilation dependency of exynos_dp and exynos_mipi on exynos_fb

2012-12-13 Thread Ajay Kumar
When only DP is used, we need not enable CONFIG_EXYNOS_MIPI_DSIM.
Similarly, when only MIPI is used, we need not enable CONFIG_EXYNOS_DP.
But the current structuring of code forces us to enable both
CONFIG_EXYNOS_MIPI_DSIM and CONFIG_EXYNOS_DP.
This patch adds conditional compilation check to remove the dependency.

Signed-off-by: Ajay Kumar 
Acked-by: Simon Glass 
---
 drivers/video/exynos_fb.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index d9a3f9a..39d3b74 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -103,8 +103,10 @@ static void lcd_panel_on(vidinfo_t *vid)
 
udelay(vid->power_on_delay);
 
+#ifdef CONFIG_EXYNOS_DP
if (vid->dp_enabled)
exynos_init_dp();
+#endif
 
if (vid->reset_lcd) {
vid->reset_lcd();
@@ -120,8 +122,10 @@ static void lcd_panel_on(vidinfo_t *vid)
if (vid->enable_ldo)
vid->enable_ldo(1);
 
+#ifdef CONFIG_EXYNOS_MIPI_DSIM
if (vid->mipi_enabled)
exynos_mipi_dsi_init();
+#endif
 }
 
 void lcd_ctrl_init(void *lcdbase)
-- 
1.7.1

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


[U-Boot] [PATCH V2 3/4] video: Modify exynos_fimd driver to support LCD console

2012-12-13 Thread Ajay Kumar
Currently, exynos FIMD driver is being used to support only TIZEN LOGOs.
In order to get LCD console, we need to enable half word swap feature
of FIMD and use 16 BPP.
LCD console and proprietary Logo cannot be used simultaneously.
You should define CONFIG_CMD_BMP for proprietary Logo, and if
CONFIG_CMD_BMP is not defined you get output console on LCD.

Signed-off-by: Ajay Kumar 
---
 drivers/video/exynos_fb.c   |5 -
 drivers/video/exynos_fimd.c |   10 --
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index 39d3b74..cb19192 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -65,6 +65,7 @@ static void exynos_lcd_init(vidinfo_t *vid)
exynos_fimd_lcd_init(vid);
 }
 
+#ifdef CONFIG_CMD_BMP
 static void draw_logo(void)
 {
int x, y;
@@ -87,6 +88,7 @@ static void draw_logo(void)
addr = panel_info.logo_addr;
bmp_display(addr, x, y);
 }
+#endif
 
 static void lcd_panel_on(vidinfo_t *vid)
 {
@@ -146,12 +148,13 @@ void lcd_ctrl_init(void *lcdbase)
 
 void lcd_enable(void)
 {
+#ifdef CONFIG_CMD_BMP
if (panel_info.logo_on) {
memset(lcd_base, 0, panel_width * panel_height *
(NBITS(panel_info.vl_bpix) >> 3));
draw_logo();
}
-
+#endif
lcd_panel_on(&panel_info);
 }
 
diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
index 06eae2e..0776b6d 100644
--- a/drivers/video/exynos_fimd.c
+++ b/drivers/video/exynos_fimd.c
@@ -88,14 +88,20 @@ static void exynos_fimd_set_par(unsigned int win_id)
/* DATAPATH is DMA */
cfg |= EXYNOS_WINCON_DATAPATH_DMA;
 
-   /* bpp is 32 */
+#ifdef CONFIG_CMD_BMP /* To get proprietary LOGO */
cfg |= EXYNOS_WINCON_WSWP_ENABLE;
+#else  /* To get output console on LCD */
+   cfg |= EXYNOS_WINCON_HAWSWP_ENABLE;
+#endif
 
/* dma burst is 16 */
cfg |= EXYNOS_WINCON_BURSTLEN_16WORD;
 
-   /* pixel format is unpacked RGB888 */
+#ifdef CONFIG_CMD_BMP /* To get proprietary LOGO */
cfg |= EXYNOS_WINCON_BPPMODE_24BPP_888;
+#else  /* To get output console on LCD */
+   cfg |= EXYNOS_WINCON_BPPMODE_16BPP_565;
+#endif
 
writel(cfg, (unsigned int)&fimd_ctrl->wincon0 +
EXYNOS_WINCON(win_id));
-- 
1.7.1

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


[U-Boot] [PATCH V2 4/4] EXYNOS5: Add support for FIMD and DP

2012-12-13 Thread Ajay Kumar
Add panel_info structure required by LCD driver
and DP panel platdata for SMDK5250.
Add GPIO configuration for LCD.
Enable FIMD and DP support on SMDK5250.
DP Panel size: 2560x1600.
We use 16BPP resolution to get LCD console.

Signed-off-by: Ajay Kumar 
---
 board/samsung/smdk5250/smdk5250.c |   98 +
 include/configs/smdk5250.h|8 +++
 2 files changed, 106 insertions(+), 0 deletions(-)

diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index 4c50342..4c21742 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -24,12 +24,15 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -181,6 +184,101 @@ static int board_uart_init(void)
return 0;
 }
 
+vidinfo_t panel_info = {
+   .vl_freq= 60,
+   .vl_col = 2560,
+   .vl_row = 1600,
+   .vl_width   = 2560,
+   .vl_height  = 1600,
+   .vl_clkp= CONFIG_SYS_LOW,
+   .vl_hsp = CONFIG_SYS_LOW,
+   .vl_vsp = CONFIG_SYS_LOW,
+   .vl_dp  = CONFIG_SYS_LOW,
+   .vl_bpix= 4,/* LCD_BPP = 2^4, for output conosle on LCD */
+
+   /* wDP panel timing infomation */
+   .vl_hspw= 32,
+   .vl_hbpd= 80,
+   .vl_hfpd= 48,
+
+   .vl_vspw= 6,
+   .vl_vbpd= 37,
+   .vl_vfpd= 3,
+   .vl_cmd_allow_len = 0xf,
+
+   .win_id = 3,
+   .cfg_gpio   = NULL,
+   .backlight_on   = NULL,
+   .lcd_power_on   = NULL,
+   .reset_lcd  = NULL,
+   .dual_lcd_enabled = 0,
+
+   .init_delay = 0,
+   .power_on_delay = 0,
+   .reset_delay= 0,
+   .interface_mode = FIMD_RGB_INTERFACE,
+   .dp_enabled = 1,
+};
+
+static struct edp_device_info edp_info = {
+   .disp_info = {
+   .h_res = 2560,
+   .h_sync_width = 32,
+   .h_back_porch = 80,
+   .h_front_porch = 48,
+   .v_res = 1600,
+   .v_sync_width  = 6,
+   .v_back_porch = 37,
+   .v_front_porch = 3,
+   .v_sync_rate = 60,
+   },
+   .lt_info = {
+   .lt_status = DP_LT_NONE,
+   },
+   .video_info = {
+   .master_mode = 0,
+   .bist_mode = DP_DISABLE,
+   .bist_pattern = NO_PATTERN,
+   .h_sync_polarity = 0,
+   .v_sync_polarity = 0,
+   .interlaced = 0,
+   .color_space = COLOR_RGB,
+   .dynamic_range = VESA,
+   .ycbcr_coeff = COLOR_YCBCR601,
+   .color_depth = COLOR_8,
+   },
+};
+
+static struct exynos_dp_platform_data dp_platform_data = {
+   .phy_enable = set_dp_phy_ctrl,
+   .edp_dev_info   = &edp_info,
+};
+
+static void cfg_lcd_gpio(void)
+{
+   struct exynos5_gpio_part1 *gpio1 =
+   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+
+   /* For Backlight */
+   s5p_gpio_cfg_pin(&gpio1->b2, 0, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->b2, 0, 1);
+
+   /* LCD power on */
+   s5p_gpio_cfg_pin(&gpio1->x1, 5, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->x1, 5, 1);
+
+   /* Set Hotplug detect for DP */
+   s5p_gpio_cfg_pin(&gpio1->x0, 7, GPIO_FUNC(0x3));
+}
+
+void init_panel_info(vidinfo_t *vid)
+{
+   vid->rgb_mode   = MODE_RGB_P,
+
+   exynos_set_dp_platform_data(&dp_platform_data);
+   cfg_lcd_gpio();
+}
+
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
 static int board_i2c_init(void)
 {
diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
index e412da8..a9b3b8b 100644
--- a/include/configs/smdk5250.h
+++ b/include/configs/smdk5250.h
@@ -256,6 +256,14 @@
 #define CONFIG_SOUND_WM8994
 #endif
 
+/* Display */
+#define CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_XRES   2560
+#define LCD_YRES   1600
+#define LCD_BPPLCD_COLOR16
+
 /* Enable devicetree support */
 #define CONFIG_OF_LIBFDT
 
-- 
1.7.1

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


[U-Boot] [PATCH V3 0/4] Add support for FIMD and DP on SMDK5250

2012-12-20 Thread Ajay Kumar
Changes since V2:
-- Add dummy definition to fix compilation dependency on
   CONFIG_EXYNOS_MIPI_DSIM.
-- Create and use new config CONFIG_EXYNOS_LOGO instead of using
   CONFIG_CMD_BMP
-- Remove explicit call for cfg_lcd_gpio and add it as callback.

 [PATCH RESEND V2 1/4] EXYNOS5: Change parent clock of FIMD to MPLL
 [PATCH V3 2/4] EXYNOS: Add dummy definition to fix compilation dependency on
CONFIG_EXYNOS_MIPI_DSIM
 [PATCH V3 3/4] video: Modify exynos_fimd driver to support LCD console
 [PATCH V3 4/4]EXYNOS5: Add support for FIMD and DP

 arch/arm/cpu/armv7/exynos/clock.c|2 +-
 arch/arm/include/asm/arch-exynos/mipi_dsim.h |7 ++
 board/samsung/smdk5250/smdk5250.c|   97 ++
 drivers/video/exynos_fb.c|5 +-
 drivers/video/exynos_fimd.c  |   10 ++-
 include/configs/smdk5250.h   |8 ++
 include/configs/trats.h  |1 +
 7 files changed, 126 insertions(+), 4 deletions(-)

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


[U-Boot] [PATCH V3 2/4] EXYNOS: Add dummy definition to fix compilation dependency on CONFIG_EXYNOS_MIPI_DSIM

2012-12-20 Thread Ajay Kumar
When only DP is used, we need not enable CONFIG_EXYNOS_MIPI_DSIM.
But if we do not select CONFIG_EXYNOS_MIPI_DSIM, exynos_fb.c throws
error saying exynos_mipi_dsi_init() not defined. So, we add
dummy definition for exynos_mipi_dsi_init when CONFIG_EXYNOS_MIPI_DSIM
is not defined.

Signed-off-by: Ajay Kumar 
---
 arch/arm/include/asm/arch-exynos/mipi_dsim.h |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h 
b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
index 9a7cbeb..b73263d 100644
--- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
+++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
@@ -358,7 +358,14 @@ struct mipi_dsim_lcd_driver {
void(*mipi_display_on)(struct mipi_dsim_device *dsim_dev);
 };
 
+#ifdef CONFIG_EXYNOS_MIPI_DSIM
 int exynos_mipi_dsi_init(void);
+#else
+int exynos_mipi_dsi_init(void)
+{
+   return 0;
+}
+#endif
 
 /*
  * register mipi_dsim_lcd_driver object defined by lcd panel driver
-- 
1.7.1

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


[U-Boot] [PATCH RESEND V2 1/4] EXYNOS5: Change parent clock of FIMD to MPLL

2012-12-20 Thread Ajay Kumar
With VPLL as source clock to FIMD,
Exynos DP Initializaton was failing sometimes with unstable clock.
Changing FIMD source to MPLL resolves this issue.

Signed-off-by: Ajay Kumar 
Acked-by: Simon Glass 
---
 arch/arm/cpu/armv7/exynos/clock.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index fe61f88..bfcd5f7 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -603,7 +603,7 @@ void exynos5_set_lcd_clk(void)
 */
cfg = readl(&clk->src_disp1_0);
cfg &= ~(0xf);
-   cfg |= 0x8;
+   cfg |= 0x6;
writel(cfg, &clk->src_disp1_0);
 
/*
-- 
1.7.1

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


[U-Boot] [PATCH V3 3/4] video: Modify exynos_fimd driver to support LCD console

2012-12-20 Thread Ajay Kumar
Currently, exynos FIMD driver is being used to support only TIZEN LOGOs.
In order to get LCD console, we need to enable half word swap feature
of FIMD and use 16 BPP.
LCD console and proprietary Logo cannot be used simultaneously.
You should define CONFIG_EXYNOS_LOGO for proprietary Logo, and if
CONFIG_EXYNOS_LOGO is not defined you get output console on LCD.
CONFIG_EXYNOS_LOGO is added to Trats configuration to keep
existing logo feature intact in Trats.

Signed-off-by: Ajay Kumar 
---
 drivers/video/exynos_fb.c   |5 -
 drivers/video/exynos_fimd.c |   10 --
 include/configs/trats.h |1 +
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index d9a3f9a..c111a09 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -65,6 +65,7 @@ static void exynos_lcd_init(vidinfo_t *vid)
exynos_fimd_lcd_init(vid);
 }
 
+#ifdef CONFIG_EXYNOS_LOGO
 static void draw_logo(void)
 {
int x, y;
@@ -87,6 +88,7 @@ static void draw_logo(void)
addr = panel_info.logo_addr;
bmp_display(addr, x, y);
 }
+#endif
 
 static void lcd_panel_on(vidinfo_t *vid)
 {
@@ -142,12 +144,13 @@ void lcd_ctrl_init(void *lcdbase)
 
 void lcd_enable(void)
 {
+#ifdef CONFIG_EXYNOS_LOGO
if (panel_info.logo_on) {
memset(lcd_base, 0, panel_width * panel_height *
(NBITS(panel_info.vl_bpix) >> 3));
draw_logo();
}
-
+#endif
lcd_panel_on(&panel_info);
 }
 
diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
index 06eae2e..f2e4c27 100644
--- a/drivers/video/exynos_fimd.c
+++ b/drivers/video/exynos_fimd.c
@@ -88,14 +88,20 @@ static void exynos_fimd_set_par(unsigned int win_id)
/* DATAPATH is DMA */
cfg |= EXYNOS_WINCON_DATAPATH_DMA;
 
-   /* bpp is 32 */
+#ifdef CONFIG_EXYNOS_LOGO /* To get proprietary LOGO */
cfg |= EXYNOS_WINCON_WSWP_ENABLE;
+#else  /* To get output console on LCD */
+   cfg |= EXYNOS_WINCON_HAWSWP_ENABLE;
+#endif
 
/* dma burst is 16 */
cfg |= EXYNOS_WINCON_BURSTLEN_16WORD;
 
-   /* pixel format is unpacked RGB888 */
+#ifdef CONFIG_EXYNOS_LOGO /* To get proprietary LOGO */
cfg |= EXYNOS_WINCON_BPPMODE_24BPP_888;
+#else  /* To get output console on LCD */
+   cfg |= EXYNOS_WINCON_BPPMODE_16BPP_565;
+#endif
 
writel(cfg, (unsigned int)&fimd_ctrl->wincon0 +
EXYNOS_WINCON(win_id));
diff --git a/include/configs/trats.h b/include/configs/trats.h
index a24e945..1573573 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -252,6 +252,7 @@
 #define CONFIG_EXYNOS_FB
 #define CONFIG_LCD
 #define CONFIG_CMD_BMP
+#define CONFIG_EXYNOS_LOGO
 #define CONFIG_BMP_32BPP
 #define CONFIG_FB_ADDR 0x52504000
 #define CONFIG_S6E8AX0
-- 
1.7.1

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


[U-Boot] [PATCH V3 4/4] EXYNOS5: Add support for FIMD and DP

2012-12-20 Thread Ajay Kumar
Add panel_info structure required by LCD driver
and DP panel platdata for SMDK5250.
Add GPIO configuration for LCD.
Enable FIMD and DP support on SMDK5250.
DP Panel size: 2560x1600.
We use 16BPP resolution to get LCD console.

Signed-off-by: Ajay Kumar 
---
 board/samsung/smdk5250/smdk5250.c |   97 +
 include/configs/smdk5250.h|8 +++
 2 files changed, 105 insertions(+), 0 deletions(-)

diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index 4c50342..46fd2a5 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -24,12 +24,15 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -181,6 +184,100 @@ static int board_uart_init(void)
return 0;
 }
 
+void cfg_lcd_gpio(void)
+{
+   struct exynos5_gpio_part1 *gpio1 =
+   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+
+   /* For Backlight */
+   s5p_gpio_cfg_pin(&gpio1->b2, 0, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->b2, 0, 1);
+
+   /* LCD power on */
+   s5p_gpio_cfg_pin(&gpio1->x1, 5, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->x1, 5, 1);
+
+   /* Set Hotplug detect for DP */
+   s5p_gpio_cfg_pin(&gpio1->x0, 7, GPIO_FUNC(0x3));
+}
+
+vidinfo_t panel_info = {
+   .vl_freq= 60,
+   .vl_col = 2560,
+   .vl_row = 1600,
+   .vl_width   = 2560,
+   .vl_height  = 1600,
+   .vl_clkp= CONFIG_SYS_LOW,
+   .vl_hsp = CONFIG_SYS_LOW,
+   .vl_vsp = CONFIG_SYS_LOW,
+   .vl_dp  = CONFIG_SYS_LOW,
+   .vl_bpix= 4,/* LCD_BPP = 2^4, for output conosle on LCD */
+
+   /* wDP panel timing infomation */
+   .vl_hspw= 32,
+   .vl_hbpd= 80,
+   .vl_hfpd= 48,
+
+   .vl_vspw= 6,
+   .vl_vbpd= 37,
+   .vl_vfpd= 3,
+   .vl_cmd_allow_len = 0xf,
+
+   .win_id = 3,
+   .cfg_gpio   = cfg_lcd_gpio,
+   .backlight_on   = NULL,
+   .lcd_power_on   = NULL,
+   .reset_lcd  = NULL,
+   .dual_lcd_enabled = 0,
+
+   .init_delay = 0,
+   .power_on_delay = 0,
+   .reset_delay= 0,
+   .interface_mode = FIMD_RGB_INTERFACE,
+   .dp_enabled = 1,
+};
+
+static struct edp_device_info edp_info = {
+   .disp_info = {
+   .h_res = 2560,
+   .h_sync_width = 32,
+   .h_back_porch = 80,
+   .h_front_porch = 48,
+   .v_res = 1600,
+   .v_sync_width  = 6,
+   .v_back_porch = 37,
+   .v_front_porch = 3,
+   .v_sync_rate = 60,
+   },
+   .lt_info = {
+   .lt_status = DP_LT_NONE,
+   },
+   .video_info = {
+   .master_mode = 0,
+   .bist_mode = DP_DISABLE,
+   .bist_pattern = NO_PATTERN,
+   .h_sync_polarity = 0,
+   .v_sync_polarity = 0,
+   .interlaced = 0,
+   .color_space = COLOR_RGB,
+   .dynamic_range = VESA,
+   .ycbcr_coeff = COLOR_YCBCR601,
+   .color_depth = COLOR_8,
+   },
+};
+
+static struct exynos_dp_platform_data dp_platform_data = {
+   .phy_enable = set_dp_phy_ctrl,
+   .edp_dev_info   = &edp_info,
+};
+
+void init_panel_info(vidinfo_t *vid)
+{
+   vid->rgb_mode   = MODE_RGB_P,
+
+   exynos_set_dp_platform_data(&dp_platform_data);
+}
+
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
 static int board_i2c_init(void)
 {
diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
index e412da8..a9b3b8b 100644
--- a/include/configs/smdk5250.h
+++ b/include/configs/smdk5250.h
@@ -256,6 +256,14 @@
 #define CONFIG_SOUND_WM8994
 #endif
 
+/* Display */
+#define CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_XRES   2560
+#define LCD_YRES   1600
+#define LCD_BPPLCD_COLOR16
+
 /* Enable devicetree support */
 #define CONFIG_OF_LIBFDT
 
-- 
1.7.1

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


[U-Boot] [PATCH V4 0/4] Add support for FIMD and DP on SMDK5250

2012-12-21 Thread Ajay Kumar
Changes since V3:
-- Make the dummy definition for "exynos_mipi_dsi_init" static and 
inline.
-- Remove #ifdef, instead use logo_on field to add LCD console support.

 [PATCH V2 RESEND 1/4] EXYNOS5: Change parent clock of FIMD to MPLL
 [PATCH V2 2/4] EXYNOS: Add dummy definition to fix compilation dependency on
CONFIG_EXYNOS_MIPI_DSIM
 [PATCH V4 3/4] video: Modify exynos_fimd driver to support LCD console
 [PATCH V4 4/4] EXYNOS5: Add support for FIMD and DP

 arch/arm/cpu/armv7/exynos/clock.c|2 +-
 arch/arm/include/asm/arch-exynos/mipi_dsim.h |7 ++
 board/samsung/smdk5250/smdk5250.c|   97 ++
 drivers/video/exynos_fb.c|7 ++
 drivers/video/exynos_fimd.c  |   12 ++-
 include/configs/smdk5250.h   |8 ++
 6 files changed, 128 insertions(+), 5 deletions(-)

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


[U-Boot] [PATCH V2 RESEND 1/4] EXYNOS5: Change parent clock of FIMD to MPLL

2012-12-21 Thread Ajay Kumar
With VPLL as source clock to FIMD,
Exynos DP Initializaton was failing sometimes with unstable clock.
Changing FIMD source to MPLL resolves this issue.

Signed-off-by: Ajay Kumar 
Acked-by: Simon Glass 
Acked-by: Donghwa Lee 
---
 arch/arm/cpu/armv7/exynos/clock.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index fe61f88..bfcd5f7 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -603,7 +603,7 @@ void exynos5_set_lcd_clk(void)
 */
cfg = readl(&clk->src_disp1_0);
cfg &= ~(0xf);
-   cfg |= 0x8;
+   cfg |= 0x6;
writel(cfg, &clk->src_disp1_0);
 
/*
-- 
1.7.1

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


[U-Boot] [PATCH V2 2/4] EXYNOS: Add dummy definition to fix compilation dependency on CONFIG_EXYNOS_MIPI_DSIM

2012-12-21 Thread Ajay Kumar
When only DP is used, we need not enable CONFIG_EXYNOS_MIPI_DSIM.
But if we do not select CONFIG_EXYNOS_MIPI_DSIM, exynos_fb.c throws
error saying exynos_mipi_dsi_init() not defined. So, we add
dummy definition for exynos_mipi_dsi_init when CONFIG_EXYNOS_MIPI_DSIM
is not defined.

Signed-off-by: Ajay Kumar 
Acked-by: Simon Glass 
Acked-by: Donghwa Lee 
---
 arch/arm/include/asm/arch-exynos/mipi_dsim.h |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h 
b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
index 9a7cbeb..c1c9a35 100644
--- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
+++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
@@ -358,7 +358,14 @@ struct mipi_dsim_lcd_driver {
void(*mipi_display_on)(struct mipi_dsim_device *dsim_dev);
 };
 
+#ifdef CONFIG_EXYNOS_MIPI_DSIM
 int exynos_mipi_dsi_init(void);
+#else
+static inline int exynos_mipi_dsi_init(void)
+{
+   return 0;
+}
+#endif
 
 /*
  * register mipi_dsim_lcd_driver object defined by lcd panel driver
-- 
1.7.1

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


[U-Boot] [PATCH V4 3/4] video: Modify exynos_fimd driver to support LCD console

2012-12-21 Thread Ajay Kumar
Currently, exynos FIMD driver is being used to support only TIZEN LOGOs.
In order to get LCD console, we need to enable half word swap feature
of FIMD and use 16 BPP.
LCD console and proprietary Logo cannot be used simultaneously.
We use logo_on field inside vidinfo_t structure to decide whether
user wants Logo or Console.

Signed-off-by: Ajay Kumar 
---
 drivers/video/exynos_fb.c   |7 +++
 drivers/video/exynos_fimd.c |   12 
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index d9a3f9a..ee916be 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -45,6 +45,13 @@ short console_row;
 
 static unsigned int panel_width, panel_height;
 
+#ifndef CONFIG_CMD_BMP
+int bmp_display(ulong addr, int x, int y)
+{
+   return 0;
+}
+#endif
+
 static void exynos_lcd_init_mem(void *lcdbase, vidinfo_t *vid)
 {
unsigned long palette_size;
diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
index 06eae2e..f957dc8 100644
--- a/drivers/video/exynos_fimd.c
+++ b/drivers/video/exynos_fimd.c
@@ -88,14 +88,18 @@ static void exynos_fimd_set_par(unsigned int win_id)
/* DATAPATH is DMA */
cfg |= EXYNOS_WINCON_DATAPATH_DMA;
 
-   /* bpp is 32 */
-   cfg |= EXYNOS_WINCON_WSWP_ENABLE;
+   if (pvid->logo_on) /* To get proprietary LOGO */
+   cfg |= EXYNOS_WINCON_WSWP_ENABLE;
+   else /* To get output console on LCD */
+   cfg |= EXYNOS_WINCON_HAWSWP_ENABLE;
 
/* dma burst is 16 */
cfg |= EXYNOS_WINCON_BURSTLEN_16WORD;
 
-   /* pixel format is unpacked RGB888 */
-   cfg |= EXYNOS_WINCON_BPPMODE_24BPP_888;
+   if (pvid->logo_on) /* To get proprietary LOGO */
+   cfg |= EXYNOS_WINCON_BPPMODE_24BPP_888;
+   else /* To get output console on LCD */
+   cfg |= EXYNOS_WINCON_BPPMODE_16BPP_565;
 
writel(cfg, (unsigned int)&fimd_ctrl->wincon0 +
EXYNOS_WINCON(win_id));
-- 
1.7.1

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


[U-Boot] [PATCH V4 4/4] EXYNOS5: Add support for FIMD and DP

2012-12-21 Thread Ajay Kumar
Add panel_info structure required by LCD driver
and DP panel platdata for SMDK5250.
Add GPIO configuration for LCD.
Enable FIMD and DP support on SMDK5250.
DP Panel size: 2560x1600.
We use 16BPP resolution to get LCD console.

Signed-off-by: Ajay Kumar 
Acked-by: Simon Glass 
---
 board/samsung/smdk5250/smdk5250.c |   97 +
 include/configs/smdk5250.h|8 +++
 2 files changed, 105 insertions(+), 0 deletions(-)

diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index 4c50342..46fd2a5 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -24,12 +24,15 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -181,6 +184,100 @@ static int board_uart_init(void)
return 0;
 }
 
+void cfg_lcd_gpio(void)
+{
+   struct exynos5_gpio_part1 *gpio1 =
+   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+
+   /* For Backlight */
+   s5p_gpio_cfg_pin(&gpio1->b2, 0, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->b2, 0, 1);
+
+   /* LCD power on */
+   s5p_gpio_cfg_pin(&gpio1->x1, 5, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->x1, 5, 1);
+
+   /* Set Hotplug detect for DP */
+   s5p_gpio_cfg_pin(&gpio1->x0, 7, GPIO_FUNC(0x3));
+}
+
+vidinfo_t panel_info = {
+   .vl_freq= 60,
+   .vl_col = 2560,
+   .vl_row = 1600,
+   .vl_width   = 2560,
+   .vl_height  = 1600,
+   .vl_clkp= CONFIG_SYS_LOW,
+   .vl_hsp = CONFIG_SYS_LOW,
+   .vl_vsp = CONFIG_SYS_LOW,
+   .vl_dp  = CONFIG_SYS_LOW,
+   .vl_bpix= 4,/* LCD_BPP = 2^4, for output conosle on LCD */
+
+   /* wDP panel timing infomation */
+   .vl_hspw= 32,
+   .vl_hbpd= 80,
+   .vl_hfpd= 48,
+
+   .vl_vspw= 6,
+   .vl_vbpd= 37,
+   .vl_vfpd= 3,
+   .vl_cmd_allow_len = 0xf,
+
+   .win_id = 3,
+   .cfg_gpio   = cfg_lcd_gpio,
+   .backlight_on   = NULL,
+   .lcd_power_on   = NULL,
+   .reset_lcd  = NULL,
+   .dual_lcd_enabled = 0,
+
+   .init_delay = 0,
+   .power_on_delay = 0,
+   .reset_delay= 0,
+   .interface_mode = FIMD_RGB_INTERFACE,
+   .dp_enabled = 1,
+};
+
+static struct edp_device_info edp_info = {
+   .disp_info = {
+   .h_res = 2560,
+   .h_sync_width = 32,
+   .h_back_porch = 80,
+   .h_front_porch = 48,
+   .v_res = 1600,
+   .v_sync_width  = 6,
+   .v_back_porch = 37,
+   .v_front_porch = 3,
+   .v_sync_rate = 60,
+   },
+   .lt_info = {
+   .lt_status = DP_LT_NONE,
+   },
+   .video_info = {
+   .master_mode = 0,
+   .bist_mode = DP_DISABLE,
+   .bist_pattern = NO_PATTERN,
+   .h_sync_polarity = 0,
+   .v_sync_polarity = 0,
+   .interlaced = 0,
+   .color_space = COLOR_RGB,
+   .dynamic_range = VESA,
+   .ycbcr_coeff = COLOR_YCBCR601,
+   .color_depth = COLOR_8,
+   },
+};
+
+static struct exynos_dp_platform_data dp_platform_data = {
+   .phy_enable = set_dp_phy_ctrl,
+   .edp_dev_info   = &edp_info,
+};
+
+void init_panel_info(vidinfo_t *vid)
+{
+   vid->rgb_mode   = MODE_RGB_P,
+
+   exynos_set_dp_platform_data(&dp_platform_data);
+}
+
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
 static int board_i2c_init(void)
 {
diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
index e412da8..a9b3b8b 100644
--- a/include/configs/smdk5250.h
+++ b/include/configs/smdk5250.h
@@ -256,6 +256,14 @@
 #define CONFIG_SOUND_WM8994
 #endif
 
+/* Display */
+#define CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_XRES   2560
+#define LCD_YRES   1600
+#define LCD_BPPLCD_COLOR16
+
 /* Enable devicetree support */
 #define CONFIG_OF_LIBFDT
 
-- 
1.7.1

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


Re: [U-Boot] [PATCH V4 3/4] video: Modify exynos_fimd driver to support LCD console

2013-01-07 Thread Ajay kumar
Hi  Minkyu,

On Tue, Jan 8, 2013 at 8:05 AM, Minkyu Kang  wrote:
> Dear Ajay Kumar,
>
> On 21/12/12 19:35, Ajay Kumar wrote:
>> Currently, exynos FIMD driver is being used to support only TIZEN LOGOs.
>> In order to get LCD console, we need to enable half word swap feature
>> of FIMD and use 16 BPP.
>> LCD console and proprietary Logo cannot be used simultaneously.
>> We use logo_on field inside vidinfo_t structure to decide whether
>> user wants Logo or Console.
>>
>> Signed-off-by: Ajay Kumar 
>> ---
>
> Please add changelog here about what you changed since last version.
I will send V5 soon. Please see my explanation below.
>>  drivers/video/exynos_fb.c   |7 +++
>>  drivers/video/exynos_fimd.c |   12 
>>  2 files changed, 15 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
>> index d9a3f9a..ee916be 100644
>> --- a/drivers/video/exynos_fb.c
>> +++ b/drivers/video/exynos_fb.c
>> @@ -45,6 +45,13 @@ short console_row;
>>
>>  static unsigned int panel_width, panel_height;
>>
>> +#ifndef CONFIG_CMD_BMP
>> +int bmp_display(ulong addr, int x, int y)
>> +{
>> + return 0;
>> +}
>> +#endif


> It's a common function of bmp command.
> Please do not redefine such a function.

I am using CONFIG_CMD_BMP to differentiate between LCD Logo and LCD console.
I select CONFIG_CMD_BMP only when I need Logo, and
I will not select CONFIG_CMD_BMP when I need console.
Lets consider that we want console. So we don't define CONFIG_CMD_BMP now.
And, exynos_fb.c has linking time dependency on "bmp_display", which
is not defined!
In such a case, I am left with 2 options:
1) Place an #ifdef CONFIG_CMD_BMP inside exynos_fb, where it makes a
call to "bmp_display".
2) Redefine "bmp_display" to do nothing inside a header file(That's
how it is done in this patch!)
Kindly let me know if you have a better way to do this.

> ---
> Thanks,
> Minkyu Kang.
> ___
Regards,
Ajay Kumar

> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V4 4/4] EXYNOS5: Add support for FIMD and DP

2013-01-07 Thread Ajay kumar
On Tue, Jan 8, 2013 at 8:10 AM, Minkyu Kang  wrote:
> Dear Ajay,
>
> On 21/12/12 19:35, Ajay Kumar wrote:
>> Add panel_info structure required by LCD driver
>> and DP panel platdata for SMDK5250.
>> Add GPIO configuration for LCD.
>> Enable FIMD and DP support on SMDK5250.
>> DP Panel size: 2560x1600.
>> We use 16BPP resolution to get LCD console.
>>
>> Signed-off-by: Ajay Kumar 
>> Acked-by: Simon Glass 
>> ---
>
> Need changelog here.
>
>>  board/samsung/smdk5250/smdk5250.c |   97 
>> +
>>  include/configs/smdk5250.h|8 +++
>>  2 files changed, 105 insertions(+), 0 deletions(-)
>>
>
> Please rebase this patch.
Ok. I will send V5 soon.
> ---
> Thanks.
> Minkyu Kang.

Ajay
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V5 0/4] Add support for FIMD and DP on SMDK5250

2013-01-07 Thread Ajay Kumar
  [PATCH V3 1/4] EXYNOS5: Change parent clock of FIMD to MPLL
  [PATCH V3 2/4] EXYNOS: Add dummy definition to fix compilation dependency on
CONFIG_EXYNOS_MIPI_DSIM
  [PATCH V5 3/4] video: Modify exynos_fimd driver to support LCD console
  [PATCH V5 4/4] EXYNOS5: Add support for FIMD and DP

 arch/arm/cpu/armv7/exynos/clock.c|  2 +-
 arch/arm/include/asm/arch-exynos/mipi_dsim.h |  7 ++
 board/samsung/smdk5250/smdk5250.c| 97 
 drivers/video/exynos_fb.c|  2 +
 drivers/video/exynos_fimd.c  | 12 ++--
 include/configs/exynos5250-dt.h  |  8 +++
 6 files changed, 123 insertions(+), 5 deletions(-)

-- 
1.8.0

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


[U-Boot] [PATCH V3 1/4] EXYNOS5: Change parent clock of FIMD to MPLL

2013-01-07 Thread Ajay Kumar
With VPLL as source clock to FIMD,
Exynos DP Initializaton was failing sometimes with unstable clock.
Changing FIMD source to MPLL resolves this issue.

Changes in V2:
 -- Fix commit message. Had written VPLL instead of MPLL.
Changes in V3:
 -- Added changelog in commit message.

Signed-off-by: Ajay Kumar 
Acked-by: Simon Glass 
Acked-by: Donghwa Lee 
---
 arch/arm/cpu/armv7/exynos/clock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index ae6d7fe..abc3272 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -741,7 +741,7 @@ void exynos5_set_lcd_clk(void)
 */
cfg = readl(&clk->src_disp1_0);
cfg &= ~(0xf);
-   cfg |= 0x8;
+   cfg |= 0x6;
writel(cfg, &clk->src_disp1_0);
 
/*
-- 
1.8.0

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


[U-Boot] [PATCH V5 4/4] EXYNOS5: Add support for FIMD and DP

2013-01-07 Thread Ajay Kumar
Add panel_info structure required by LCD driver
and DP panel platdata for SMDK5250.
Add GPIO configuration for LCD.
Enable FIMD and DP support on SMDK5250.
DP Panel size: 2560x1600.
We use 16BPP resolution to get LCD console.

changes in V2:
 -- Move LCD GPIO confiration from exynos common file to board file.
changes in V3:
 -- Remove explicit call for cfg_lcd_gpio and add it as callback.
changes in V4:
 -- use logo_on = 1 for smdk5250 panel_info structure.
changes in V5:
 -- Move CONFIGS from smdk5250.h to exynos5250-dt.h.
 -- Added changelog in commit message.

Signed-off-by: Ajay Kumar 
Acked-by: Simon Glass 
---
 board/samsung/smdk5250/smdk5250.c | 97 +++
 include/configs/exynos5250-dt.h   |  8 
 2 files changed, 105 insertions(+)

diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index 73c3ec0..80fb43c 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -24,13 +24,16 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -258,3 +261,97 @@ int board_early_init_f(void)
return err;
 }
 #endif
+
+void cfg_lcd_gpio(void)
+{
+   struct exynos5_gpio_part1 *gpio1 =
+   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+
+   /* For Backlight */
+   s5p_gpio_cfg_pin(&gpio1->b2, 0, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->b2, 0, 1);
+
+   /* LCD power on */
+   s5p_gpio_cfg_pin(&gpio1->x1, 5, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->x1, 5, 1);
+
+   /* Set Hotplug detect for DP */
+   s5p_gpio_cfg_pin(&gpio1->x0, 7, GPIO_FUNC(0x3));
+}
+
+vidinfo_t panel_info = {
+   .vl_freq= 60,
+   .vl_col = 2560,
+   .vl_row = 1600,
+   .vl_width   = 2560,
+   .vl_height  = 1600,
+   .vl_clkp= CONFIG_SYS_LOW,
+   .vl_hsp = CONFIG_SYS_LOW,
+   .vl_vsp = CONFIG_SYS_LOW,
+   .vl_dp  = CONFIG_SYS_LOW,
+   .vl_bpix= 4,/* LCD_BPP = 2^4, for output conosle on LCD */
+
+   /* wDP panel timing infomation */
+   .vl_hspw= 32,
+   .vl_hbpd= 80,
+   .vl_hfpd= 48,
+
+   .vl_vspw= 6,
+   .vl_vbpd= 37,
+   .vl_vfpd= 3,
+   .vl_cmd_allow_len = 0xf,
+
+   .win_id = 3,
+   .cfg_gpio   = cfg_lcd_gpio,
+   .backlight_on   = NULL,
+   .lcd_power_on   = NULL,
+   .reset_lcd  = NULL,
+   .dual_lcd_enabled = 0,
+
+   .init_delay = 0,
+   .power_on_delay = 0,
+   .reset_delay= 0,
+   .interface_mode = FIMD_RGB_INTERFACE,
+   .dp_enabled = 1,
+};
+
+static struct edp_device_info edp_info = {
+   .disp_info = {
+   .h_res = 2560,
+   .h_sync_width = 32,
+   .h_back_porch = 80,
+   .h_front_porch = 48,
+   .v_res = 1600,
+   .v_sync_width  = 6,
+   .v_back_porch = 37,
+   .v_front_porch = 3,
+   .v_sync_rate = 60,
+   },
+   .lt_info = {
+   .lt_status = DP_LT_NONE,
+   },
+   .video_info = {
+   .master_mode = 0,
+   .bist_mode = DP_DISABLE,
+   .bist_pattern = NO_PATTERN,
+   .h_sync_polarity = 0,
+   .v_sync_polarity = 0,
+   .interlaced = 0,
+   .color_space = COLOR_RGB,
+   .dynamic_range = VESA,
+   .ycbcr_coeff = COLOR_YCBCR601,
+   .color_depth = COLOR_8,
+   },
+};
+
+static struct exynos_dp_platform_data dp_platform_data = {
+   .phy_enable = set_dp_phy_ctrl,
+   .edp_dev_info   = &edp_info,
+};
+
+void init_panel_info(vidinfo_t *vid)
+{
+   vid->rgb_mode   = MODE_RGB_P,
+
+   exynos_set_dp_platform_data(&dp_platform_data);
+}
diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 59182f4..07bca1d 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -297,4 +297,12 @@
 #define CONFIG_SHA1
 #define CONFIG_SHA256
 
+/* Display */
+#define CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_XRES   2560
+#define LCD_YRES   1600
+#define LCD_BPPLCD_COLOR16
+
 #endif /* __CONFIG_H */
-- 
1.8.0

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


[U-Boot] [PATCH V5 3/4] video: Modify exynos_fimd driver to support LCD console

2013-01-07 Thread Ajay Kumar
Currently, exynos FIMD driver is being used to support only TIZEN LOGOs.
In order to get LCD console, we need to enable half word swap feature
of FIMD and use 16 BPP.
LCD console and proprietary Logo cannot be used simultaneously.
We use "logo_on" field inside vidinfo_t structure to decide whether
user wants Logo or Console.
Define CONFIG_CMD_BMP and make logo_on = 1 to get Logo on screen.
Use logo_on = 0 to get output console on LCD.

Changes in V2:
 -- Use CONFIG_CMD_BMP instead of CONFIG_TIZEN to distinguish
between Proprietary logo support and LCD console support.
Changes in V3:
 -- Create and use new config CONFIG_EXYNOS_LOGO instead of using
CONFIG_CMD_BMP
Changes in V4:
 -- Remove #ifdef CONFIG_EXYNOS_LOGO, instead use logo_on field
to add LCD console support.
Changes in V5:
 -- Remove dummy definition for bmp_display. Instead, place the call to
bmp_display inside #ifdef CONFIG_CMD_BMP
 -- Added changelog in commit message.

Signed-off-by: Ajay Kumar 
---
 drivers/video/exynos_fb.c   |  2 ++
 drivers/video/exynos_fimd.c | 12 
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index d9a3f9a..944e9fa 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -85,7 +85,9 @@ static void draw_logo(void)
}
 
addr = panel_info.logo_addr;
+#ifdef CONFIG_CMD_BMP
bmp_display(addr, x, y);
+#endif
 }
 
 static void lcd_panel_on(vidinfo_t *vid)
diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
index 06eae2e..2efe6a6 100644
--- a/drivers/video/exynos_fimd.c
+++ b/drivers/video/exynos_fimd.c
@@ -88,14 +88,18 @@ static void exynos_fimd_set_par(unsigned int win_id)
/* DATAPATH is DMA */
cfg |= EXYNOS_WINCON_DATAPATH_DMA;
 
-   /* bpp is 32 */
-   cfg |= EXYNOS_WINCON_WSWP_ENABLE;
+   if (pvid->logo_on) /* To get proprietary LOGO */
+   cfg |= EXYNOS_WINCON_WSWP_ENABLE;
+   else /* To get output console on LCD */
+   cfg |= EXYNOS_WINCON_HAWSWP_ENABLE;
 
/* dma burst is 16 */
cfg |= EXYNOS_WINCON_BURSTLEN_16WORD;
 
-   /* pixel format is unpacked RGB888 */
-   cfg |= EXYNOS_WINCON_BPPMODE_24BPP_888;
+   if (pvid->logo_on) /* To get proprietary LOGO */
+   cfg |= EXYNOS_WINCON_BPPMODE_24BPP_888;
+   else /* To get output console on LCD */
+   cfg |= EXYNOS_WINCON_BPPMODE_16BPP_565;
 
writel(cfg, (unsigned int)&fimd_ctrl->wincon0 +
EXYNOS_WINCON(win_id));
-- 
1.8.0

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


[U-Boot] [PATCH V3 2/4] EXYNOS: Add dummy definition to fix compilation dependency on CONFIG_EXYNOS_MIPI_DSIM

2013-01-07 Thread Ajay Kumar
When only DP is used, we need not enable CONFIG_EXYNOS_MIPI_DSIM.
But if we do not select CONFIG_EXYNOS_MIPI_DSIM, exynos_fb.c throws
error saying exynos_mipi_dsi_init() not defined. So, we add
dummy definition for exynos_mipi_dsi_init when CONFIG_EXYNOS_MIPI_DSIM
is not defined.

Changes in V2:
 -- Make dummy definition for exynos_mipi_dsi_init as static.
Changes in V3:
 -- Added Changelog in commit message.

Signed-off-by: Ajay Kumar 
Acked-by: Simon Glass 
Acked-by: Donghwa Lee 
---
 arch/arm/include/asm/arch-exynos/mipi_dsim.h | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h 
b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
index 9a7cbeb..c1c9a35 100644
--- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
+++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
@@ -358,7 +358,14 @@ struct mipi_dsim_lcd_driver {
void(*mipi_display_on)(struct mipi_dsim_device *dsim_dev);
 };
 
+#ifdef CONFIG_EXYNOS_MIPI_DSIM
 int exynos_mipi_dsi_init(void);
+#else
+static inline int exynos_mipi_dsi_init(void)
+{
+   return 0;
+}
+#endif
 
 /*
  * register mipi_dsim_lcd_driver object defined by lcd panel driver
-- 
1.8.0

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


[U-Boot] [PATCH V6 0/4] Add support for FIMD and DP on SMDK5250

2013-01-09 Thread Ajay Kumar
  [PATCH V6 1/4] EXYNOS5: Change parent clock of FIMD to MPLL
  [PATCH V6 2/4] EXYNOS: Add dummy definition to fix compilation dependency on
CONFIG_EXYNOS_MIPI_DSIM
  [PATCH V6 3/4] video: Modify exynos_fimd driver to support LCD console
  [PATCH V6 4/4] EXYNOS5: Add support for FIMD and DP

 arch/arm/cpu/armv7/exynos/clock.c|  2 +-
 arch/arm/include/asm/arch-exynos/dp_info.h   |  2 +
 arch/arm/include/asm/arch-exynos/mipi_dsim.h |  7 ++
 board/samsung/smdk5250/smdk5250.c| 97 
 drivers/video/exynos_fb.c|  2 +
 drivers/video/exynos_fimd.c  | 12 ++--
 include/configs/exynos5250-dt.h  |  8 +++
 7 files changed, 125 insertions(+), 5 deletions(-)

-- 
1.8.0

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


[U-Boot] [PATCH V6 1/4] EXYNOS5: Change parent clock of FIMD to MPLL

2013-01-09 Thread Ajay Kumar
With VPLL as source clock to FIMD,
Exynos DP Initializaton was failing sometimes with unstable clock.
Changing FIMD source to MPLL resolves this issue.

Signed-off-by: Ajay Kumar 
Acked-by: Simon Glass 
Acked-by: Donghwa Lee 
---
Changes in V2:
 -- Fix commit message. Had written VPLL instead of MPLL.
Changes in V3:
 -- Added changelog in commit message.
Changes in V6:
 -- Moved changelog to proper position

 arch/arm/cpu/armv7/exynos/clock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index ae6d7fe..abc3272 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -741,7 +741,7 @@ void exynos5_set_lcd_clk(void)
 */
cfg = readl(&clk->src_disp1_0);
cfg &= ~(0xf);
-   cfg |= 0x8;
+   cfg |= 0x6;
writel(cfg, &clk->src_disp1_0);
 
/*
-- 
1.8.0

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


[U-Boot] [PATCH V6 3/4] video: Modify exynos_fimd driver to support LCD console

2013-01-09 Thread Ajay Kumar
Currently, exynos FIMD driver is being used to support only TIZEN LOGOs.
In order to get LCD console, we need to enable half word swap feature
of FIMD and use 16 BPP.
LCD console and proprietary Logo cannot be used simultaneously.
We use "logo_on" field inside vidinfo_t structure to decide whether
user wants Logo or Console.
Define CONFIG_CMD_BMP and make logo_on = 1 to get Logo on screen.
Use logo_on = 0 to get output console on LCD.

Signed-off-by: Ajay Kumar 
---
Changes in V2:
 -- Use CONFIG_CMD_BMP instead of CONFIG_TIZEN to distinguish
between Proprietary logo support and LCD console support.
Changes in V3:
 -- Create and use new config CONFIG_EXYNOS_LOGO instead of using
CONFIG_CMD_BMP
Changes in V4:
 -- Remove #ifdef CONFIG_EXYNOS_LOGO, instead use logo_on field
to add LCD console support.
Changes in V5:
 -- Remove dummy definition for bmp_display. Instead, place the call to
bmp_display inside #ifdef CONFIG_CMD_BMP
 -- Added changelog in commit message.
Changes in V6:
 -- Moved changelog to proper position

 drivers/video/exynos_fb.c   |  2 ++
 drivers/video/exynos_fimd.c | 12 
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index aac74a3..25d73cf 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -88,7 +88,9 @@ static void draw_logo(void)
}
 
addr = panel_info.logo_addr;
+#ifdef CONFIG_CMD_BMP
bmp_display(addr, x, y);
+#endif
 }
 
 static void lcd_panel_on(vidinfo_t *vid)
diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
index 06eae2e..2efe6a6 100644
--- a/drivers/video/exynos_fimd.c
+++ b/drivers/video/exynos_fimd.c
@@ -88,14 +88,18 @@ static void exynos_fimd_set_par(unsigned int win_id)
/* DATAPATH is DMA */
cfg |= EXYNOS_WINCON_DATAPATH_DMA;
 
-   /* bpp is 32 */
-   cfg |= EXYNOS_WINCON_WSWP_ENABLE;
+   if (pvid->logo_on) /* To get proprietary LOGO */
+   cfg |= EXYNOS_WINCON_WSWP_ENABLE;
+   else /* To get output console on LCD */
+   cfg |= EXYNOS_WINCON_HAWSWP_ENABLE;
 
/* dma burst is 16 */
cfg |= EXYNOS_WINCON_BURSTLEN_16WORD;
 
-   /* pixel format is unpacked RGB888 */
-   cfg |= EXYNOS_WINCON_BPPMODE_24BPP_888;
+   if (pvid->logo_on) /* To get proprietary LOGO */
+   cfg |= EXYNOS_WINCON_BPPMODE_24BPP_888;
+   else /* To get output console on LCD */
+   cfg |= EXYNOS_WINCON_BPPMODE_16BPP_565;
 
writel(cfg, (unsigned int)&fimd_ctrl->wincon0 +
EXYNOS_WINCON(win_id));
-- 
1.8.0

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


[U-Boot] [PATCH 4/4] EXYNOS5: Add support for FIMD and DP

2013-01-09 Thread Ajay Kumar
Add panel_info structure required by LCD driver
and DP panel platdata for SMDK5250.
Add GPIO configuration for LCD.
Enable FIMD and DP support on SMDK5250.
DP Panel size: 2560x1600.
We use 16BPP resolution to get LCD console.

Signed-off-by: Ajay Kumar 
Acked-by: Simon Glass 
---
changes in V2:
 -- Move LCD GPIO confiration from exynos common file to board file.
changes in V3:
 -- Remove explicit call for cfg_lcd_gpio and add it as callback.
changes in V4:
 -- use logo_on = 1 for smdk5250 panel_info structure.
changes in V5:
 -- Move CONFIGS from smdk5250.h to exynos5250-dt.h.
 -- Added changelog in commit message.
Changes in V6:
 -- Fix compilation warning:
implicit declaration of function 'exynos_set_dp_platform_data'
 -- Moved changelog to proper position

 arch/arm/include/asm/arch-exynos/dp_info.h |  2 +
 board/samsung/smdk5250/smdk5250.c  | 97 ++
 include/configs/exynos5250-dt.h|  8 +++
 3 files changed, 107 insertions(+)

diff --git a/arch/arm/include/asm/arch-exynos/dp_info.h 
b/arch/arm/include/asm/arch-exynos/dp_info.h
index 3569498..102b709 100644
--- a/arch/arm/include/asm/arch-exynos/dp_info.h
+++ b/arch/arm/include/asm/arch-exynos/dp_info.h
@@ -211,4 +211,6 @@ unsigned int exynos_init_dp(void)
 }
 #endif
 
+void exynos_set_dp_platform_data(struct exynos_dp_platform_data *pd);
+
 #endif /* _DP_INFO_H */
diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index d80f75d..9c4bf9b 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -24,13 +24,16 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -277,3 +280,97 @@ int board_early_init_f(void)
return err;
 }
 #endif
+
+void cfg_lcd_gpio(void)
+{
+   struct exynos5_gpio_part1 *gpio1 =
+   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+
+   /* For Backlight */
+   s5p_gpio_cfg_pin(&gpio1->b2, 0, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->b2, 0, 1);
+
+   /* LCD power on */
+   s5p_gpio_cfg_pin(&gpio1->x1, 5, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->x1, 5, 1);
+
+   /* Set Hotplug detect for DP */
+   s5p_gpio_cfg_pin(&gpio1->x0, 7, GPIO_FUNC(0x3));
+}
+
+vidinfo_t panel_info = {
+   .vl_freq= 60,
+   .vl_col = 2560,
+   .vl_row = 1600,
+   .vl_width   = 2560,
+   .vl_height  = 1600,
+   .vl_clkp= CONFIG_SYS_LOW,
+   .vl_hsp = CONFIG_SYS_LOW,
+   .vl_vsp = CONFIG_SYS_LOW,
+   .vl_dp  = CONFIG_SYS_LOW,
+   .vl_bpix= 4,/* LCD_BPP = 2^4, for output conosle on LCD */
+
+   /* wDP panel timing infomation */
+   .vl_hspw= 32,
+   .vl_hbpd= 80,
+   .vl_hfpd= 48,
+
+   .vl_vspw= 6,
+   .vl_vbpd= 37,
+   .vl_vfpd= 3,
+   .vl_cmd_allow_len = 0xf,
+
+   .win_id = 3,
+   .cfg_gpio   = cfg_lcd_gpio,
+   .backlight_on   = NULL,
+   .lcd_power_on   = NULL,
+   .reset_lcd  = NULL,
+   .dual_lcd_enabled = 0,
+
+   .init_delay = 0,
+   .power_on_delay = 0,
+   .reset_delay= 0,
+   .interface_mode = FIMD_RGB_INTERFACE,
+   .dp_enabled = 1,
+};
+
+static struct edp_device_info edp_info = {
+   .disp_info = {
+   .h_res = 2560,
+   .h_sync_width = 32,
+   .h_back_porch = 80,
+   .h_front_porch = 48,
+   .v_res = 1600,
+   .v_sync_width  = 6,
+   .v_back_porch = 37,
+   .v_front_porch = 3,
+   .v_sync_rate = 60,
+   },
+   .lt_info = {
+   .lt_status = DP_LT_NONE,
+   },
+   .video_info = {
+   .master_mode = 0,
+   .bist_mode = DP_DISABLE,
+   .bist_pattern = NO_PATTERN,
+   .h_sync_polarity = 0,
+   .v_sync_polarity = 0,
+   .interlaced = 0,
+   .color_space = COLOR_RGB,
+   .dynamic_range = VESA,
+   .ycbcr_coeff = COLOR_YCBCR601,
+   .color_depth = COLOR_8,
+   },
+};
+
+static struct exynos_dp_platform_data dp_platform_data = {
+   .phy_enable = set_dp_phy_ctrl,
+   .edp_dev_info   = &edp_info,
+};
+
+void init_panel_info(vidinfo_t *vid)
+{
+   vid->rgb_mode   = MODE_RGB_P,
+
+   exynos_set_dp_platform_data(&dp_platform_data);
+}
diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 59182f4..07bca1d 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -297,4 +297,12 @@
 #define CONFIG_SHA1
 #define CONFIG_SHA256
 
+/* Display */
+#define CONFIG_LCD
+#define CONF

[U-Boot] [PATCH V6 2/4] EXYNOS: Add dummy definition to fix compilation dependency on CONFIG_EXYNOS_MIPI_DSIM

2013-01-09 Thread Ajay Kumar
When only DP is used, we need not enable CONFIG_EXYNOS_MIPI_DSIM.
But if we do not select CONFIG_EXYNOS_MIPI_DSIM, exynos_fb.c throws
error saying exynos_mipi_dsi_init() not defined. So, we add
dummy definition for exynos_mipi_dsi_init when CONFIG_EXYNOS_MIPI_DSIM
is not defined.

Signed-off-by: Ajay Kumar 
Acked-by: Simon Glass 
Acked-by: Donghwa Lee 
---
Changes in V2:
 -- Make dummy definition for exynos_mipi_dsi_init as static.
Changes in V3:
 -- Added Changelog in commit message.
Changes in V6:
 -- Moved changelog to proper position

 arch/arm/include/asm/arch-exynos/mipi_dsim.h | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h 
b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
index 9a7cbeb..c1c9a35 100644
--- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
+++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
@@ -358,7 +358,14 @@ struct mipi_dsim_lcd_driver {
void(*mipi_display_on)(struct mipi_dsim_device *dsim_dev);
 };
 
+#ifdef CONFIG_EXYNOS_MIPI_DSIM
 int exynos_mipi_dsi_init(void);
+#else
+static inline int exynos_mipi_dsi_init(void)
+{
+   return 0;
+}
+#endif
 
 /*
  * register mipi_dsim_lcd_driver object defined by lcd panel driver
-- 
1.8.0

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


[U-Boot] [PATCH 1/2] EXYNOS5: Make all display related code dependent on CONFIG_LCD

2013-01-09 Thread Ajay Kumar
u-boot compilation fails for smdk5250 when we deselect CONFIG_LCD
from the main config file. This patch fixes it.

Signed-off-by: Ajay Kumar 
---
 board/samsung/smdk5250/smdk5250.c | 2 ++
 include/configs/exynos5250-dt.h   | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index 9c4bf9b..7a5f132 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -281,6 +281,7 @@ int board_early_init_f(void)
 }
 #endif
 
+#ifdef CONFIG_LCD
 void cfg_lcd_gpio(void)
 {
struct exynos5_gpio_part1 *gpio1 =
@@ -374,3 +375,4 @@ void init_panel_info(vidinfo_t *vid)
 
exynos_set_dp_platform_data(&dp_platform_data);
 }
+#endif
diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 07bca1d..298bae9 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -299,10 +299,12 @@
 
 /* Display */
 #define CONFIG_LCD
+#ifdef CONFIG_LCD
 #define CONFIG_EXYNOS_FB
 #define CONFIG_EXYNOS_DP
 #define LCD_XRES   2560
 #define LCD_YRES   1600
 #define LCD_BPPLCD_COLOR16
+#endif
 
 #endif /* __CONFIG_H */
-- 
1.8.0

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


[U-Boot] [PATCH 2/2] EXYNOS5: Enable console multiplexing in u-boot when LCD support is enabled

2013-01-09 Thread Ajay Kumar
With this patch, stdout/stderr is assigned to serial and also to LCD.
Initially, u-boot output console is observed via serial port.
If you also have a DP panel connected onto your SMDK5250 board,
you can switch to LCD console by typing "setenv stdout lcd".
You can always switch back to serial using "setenv stdout serial".
You can switch error console(stderr) as well, using similar commands.

Signed-off-by: Ajay Kumar 
---
 include/configs/exynos5250-dt.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 298bae9..49c0adf 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -305,6 +305,12 @@
 #define LCD_XRES   2560
 #define LCD_YRES   1600
 #define LCD_BPPLCD_COLOR16
+
+/* Override console configuration when LCD is present */
+#define CONFIG_CONSOLE_MUX
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_EXTRA_ENV_SETTINGS \
+   "stdout=serial,lcd\0"
 #endif
 
 #endif /* __CONFIG_H */
-- 
1.8.0

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


[U-Boot] [PATCH V2 1/2] EXYNOS5: Make all display related code dependent on CONFIG_LCD

2013-01-10 Thread Ajay Kumar
u-boot compilation fails for smdk5250 when we deselect CONFIG_LCD
from the main config file.

Following error was observed:
drivers/video/libvideo.o: In function `exynos_lcd_init':
/home/ajay/u-boot-samsung/drivers/video/exynos_fb.c:68: undefined reference to 
`lcd_set_flush_dcache'

This is because exynos video drivers have dependency on CONFIG_LCD.

Signed-off-by: Ajay Kumar 
Acked-by: Simon Glass 
---
Changes in V2:  Add compilation error message to commit log.

 board/samsung/smdk5250/smdk5250.c | 2 ++
 include/configs/exynos5250-dt.h   | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index 9c4bf9b..7a5f132 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -281,6 +281,7 @@ int board_early_init_f(void)
 }
 #endif
 
+#ifdef CONFIG_LCD
 void cfg_lcd_gpio(void)
 {
struct exynos5_gpio_part1 *gpio1 =
@@ -374,3 +375,4 @@ void init_panel_info(vidinfo_t *vid)
 
exynos_set_dp_platform_data(&dp_platform_data);
 }
+#endif
diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 07bca1d..298bae9 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -299,10 +299,12 @@
 
 /* Display */
 #define CONFIG_LCD
+#ifdef CONFIG_LCD
 #define CONFIG_EXYNOS_FB
 #define CONFIG_EXYNOS_DP
 #define LCD_XRES   2560
 #define LCD_YRES   1600
 #define LCD_BPPLCD_COLOR16
+#endif
 
 #endif /* __CONFIG_H */
-- 
1.8.0

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


[U-Boot] [PATCH V2 2/2] EXYNOS5: Enable console multiplexing in u-boot

2013-01-10 Thread Ajay Kumar
We enable console multiplexing and use both serial and LCD for stdout/stderr.
Initially, u-boot output console is observed via serial port.
If you also have a DP panel connected onto your SMDK5250 board,
you can switch to LCD console by typing "setenv stdout lcd".
You can always switch back to serial using "setenv stdout serial".
You can switch error console(stderr) as well, using similar commands.

Signed-off-by: Ajay Kumar 
Acked-by: Simon Glass 
---
Changes in V2:  We use CONFIG_CONSOLE_MUX always. In V1, CONFIG_CONSOLE_MUX
was enabled only when CONFIG_LCD is selected.

 include/configs/exynos5250-dt.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 298bae9..6912936 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -77,6 +77,17 @@
 #define CONFIG_BAUDRATE115200
 #define EXYNOS5_DEFAULT_UART_OFFSET0x01
 
+/* Console configuration */
+#define CONFIG_CONSOLE_MUX
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define EXYNOS_DEVICE_SETTINGS \
+   "stdin=serial\0" \
+   "stdout=serial,lcd\0" \
+   "stderr=serial,lcd\0"
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+   EXYNOS_DEVICE_SETTINGS
+
 #define TZPC_BASE_OFFSET   0x1
 
 /* SD/MMC configuration */
-- 
1.8.0

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


  1   2   3   >