video: exynos: Add DT support for exynos_fb and exynos_dp drivers
Subsystems (5)
cover video: exynos: Add DT support for exynos_fb and exynos_dp drivers
Ajay Kumar (13):
[PATCH 01/13] video: exynos_fb: Remove callbacks from the driver [PATCH 02/13] video: exynos_dp: Remove callbacks from the driver [PATCH 03/13] video: exynos_fb: Make fimd_ctrl global
[PATCH 04/13] EXYNOS: FDT: Add compatible strings for FIMD [PATCH 05/13] video: exynos_fb: add DT support for FIMD driver [PATCH 06/13] EXYNOS5: Add device node for FIMD
[PATCH 07/13] SMDK5250: Add device node for FIMD
[PATCH 08/13] video: exynos_dp: Make dp_regs global
[PATCH 09/13] EXYNOS5: FDT: Add compatible strings for FIMD [PATCH 10/13] video: exynos_dp: Add function to parse DP DT node [PATCH 11/13] EXYNOS5: Add device node for DP
[PATCH 12/13] SMDK5250: Add device node for DP
[PATCH 13/13] SMDK5250: Use statically defined structures only in non DT case
arch/arm/dts/exynos5250.dtsi | 13 ++ arch/arm/include/asm/arch-exynos/dp_info.h | 1 - board/samsung/dts/exynos5250-smdk5250.dts | 40 +++++ board/samsung/smdk5250/smdk5250.c | 16 +- board/samsung/trats/trats.c | 6 +- board/samsung/universal_c210/universal.c | 23 +-- doc/device-tree-bindings/video/exynos-dp.txt | 69 ++++++++ doc/device-tree-bindings/video/exynos-fb.txt | 92 +++++++++++ drivers/video/exynos_dp.c | 76 ++++++++- drivers/video/exynos_dp_lowlevel.c | 69 +++----- drivers/video/exynos_dp_lowlevel.h | 1 + drivers/video/exynos_fb.c | 230 +++++++++++++++++++++++++-- drivers/video/exynos_fimd.c | 44 +++-- include/fdtdec.h | 2 + include/lcd.h | 9 -- lib/fdtdec.c | 2 + 16 files changed, 574 insertions(+), 119 deletions(-) create mode 100644 doc/device-tree-bindings/video/exynos-dp.txt create mode 100644 doc/device-tree-bindings/video/exynos-fb.txt
Signature · 1 line
1.8.0
PATCH 1/13 video: exynos_fb: Remove callbacks from the driver
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.
--- board/samsung/smdk5250/smdk5250.c | 6 +-- board/samsung/trats/trats.c | 6 +-- board/samsung/universal_c210/universal.c | 23 ++++++----- drivers/video/exynos_fb.c | 67 ++++++++++++++++++++++++-------- include/lcd.h | 9 ----- 5 files changed, 66 insertions(+), 45 deletions(-)
board/samsung/smdk5250/smdk5250.c +1 -5
@@ -391,7 +391,7 @@ int board_early_init_f(void)#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 ();
@@ -431,10 +431,6 @@ vidinfo_t panel_info = { .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,
board/samsung/trats/trats.c +1 -5
@@ -634,7 +634,7 @@ int board_early_init_f(void)return 0 ; } -static void lcd_reset (void ) +void exynos_reset_lcd (void ) {struct exynos4_gpio_part2 *gpio2 = (struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2 ();
@@ -754,10 +754,6 @@ vidinfo_t panel_info = { .vl_cmd_allow_len = 0xf, .win_id = 3, - .cfg_gpio = NULL, - .backlight_on = NULL, - .lcd_power_on = NULL, /* lcd_power_on in mipi dsi driver */ - .reset_lcd = lcd_reset, .dual_lcd_enabled = 0, .init_delay = 0,
board/samsung/universal_c210/universal.c +13 -10
@@ -384,7 +384,7 @@ static void init_pmic_lcd(void)puts ("LCD pmic initialisation error!\n" ); } -static void lcd_cfg_gpio (void ) +void exynos_cfg_lcd_gpio (void ) {unsigned int i, f3_end =4 ;
@@ -423,7 +423,7 @@ static void lcd_cfg_gpio(void)spi_init (); } -static void reset_lcd (void ) +void exynos_reset_lcd (void ) {s5p_gpio_set_value (&gpio2->y4,5 ,1 );udelay (10000 );
@@ -433,7 +433,7 @@ static void reset_lcd(void)udelay (100 ); } -static void lcd_power_on (void ) +void exynos_lcd_power_on (void ) {struct pmic *p =pmic_get ("MAX8998_PMIC" );
@@ -471,10 +471,6 @@ vidinfo_t panel_info = { .vl_cmd_allow_len = 0xf, .win_id = 0, - .cfg_gpio = lcd_cfg_gpio, - .backlight_on = NULL, - .lcd_power_on = lcd_power_on, - .reset_lcd = reset_lcd, .dual_lcd_enabled = 0, .init_delay = 0,
@@ -484,6 +480,16 @@ vidinfo_t panel_info = { .mipi_enabled = 0, }; +void exynos_cfg_ldo (void ) +{ +ld9040_cfg_ldo (); +} + +void exynos_enable_ldo (unsigned int onoff) +{ +ld9040_enable_ldo (onoff); +} +void init_panel_info (vidinfo_t *vid) { vid->logo_on =1 ;
@@ -498,9 +504,6 @@ void init_panel_info(vidinfo_t *vid) vid->pclk_name =1 ;/* MPLL */ vid->sclk_div =1 ; - vid->cfg_ldo = ld9040_cfg_ldo; - vid->enable_ldo = ld9040_enable_ldo; -setenv ("lcdinfo" ,"lcd=ld9040" ); }
drivers/video/exynos_fb.c +51 -16
88 lines not on this page · raw message
include/lcd.h +0 -9
@@ -233,15 +233,6 @@ typedef struct vidinfo {u_char vl_vbpd;/* Wait end of frame */ u_char vl_cmd_allow_len;/* Wait end of frame */ -void (*cfg_gpio)(void ); -void (*backlight_on)(unsigned int onoff); -void (*reset_lcd)(void ); -void (*lcd_power_on)(void ); -void (*cfg_ldo)(void ); -void (*enable_ldo)(unsigned int onoff); -void (*mipi_power)(void ); -void (*backlight_reset)(void ); -unsigned int win_id;unsigned int init_delay;unsigned int power_on_delay;
Signature · 1 line
1.8.0
PATCH 1/13 video: exynos_fb: Remove callbacks from the driver
Hi,
Quoted 6 lines · Ajay Kumar
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 anduniversal_c210board, it is only compile tested.
Can I ask please why you are doing this? It seems like the existing interface is better.
Regards,
Simon
PATCH 1/13 video: exynos_fb: Remove callbacks from the driver
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
Quoted 19 lines · Simon Glass
Hi,
Quoted 6 lines · Ajay Kumar
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 anduniversal_c210board, 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 at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
PATCH 1/13 video: exynos_fb: Remove callbacks from the driver
Hi Ajay,
Quoted 7 lines · Ajay kumar
Hi Simon,
The idea was to move out
panel_infostructure from board files, and passing the same info from the device tree.
The first obstacle towards this were the callback hooks in thepanel_infostructure.
This is just a workaround for such function pointers.
OK, understood, that makes sense.
Regards,
Simon
Quoted 24 lines
Regards,
Ajay KumarQuoted 19 lines · Simon Glass
Hi,
Quoted 6 lines · Ajay Kumar
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 anduniversal_c210board, 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 at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
PATCH 2/13 video: exynos_dp: Remove callbacks from the driver
In reply to Ajay KumarReplaced 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.
--- arch/arm/include/asm/arch-exynos/dp_info.h | 1 - board/samsung/smdk5250/smdk5250.c | 6 +++++- drivers/video/exynos_dp.c | 9 +++++++-- 3 files changed, 12 insertions(+), 4 deletions(-)
arch/arm/include/asm/arch-exynos/dp_info.h +0 -1
@@ -199,7 +199,6 @@ enum {struct exynos_dp_platform_data {struct edp_device_info *edp_dev_info; -void (*phy_enable)(unsigned int ); };#ifdef CONFIG_EXYNOS_DP
board/samsung/smdk5250/smdk5250.c +5 -1
@@ -440,6 +440,11 @@ vidinfo_t panel_info = { .dp_enabled = 1, }; +void exynos_set_dp_phy (unsigned int onoff) +{ +set_dp_phy_ctrl (onoff); +} +static struct edp_device_info edp_info = { .disp_info = { .h_res =2560 ,
@@ -470,7 +475,6 @@ static struct edp_device_info edp_info = { };static struct exynos_dp_platform_data dp_platform_data = { - .phy_enable = set_dp_phy_ctrl, .edp_dev_info = &edp_info, };
drivers/video/exynos_dp.c +7 -2
@@ -32,6 +32,12 @@static struct exynos_dp_platform_data *dp_pd; +void __exynos_set_dp_phy (unsigned int onoff) +{ +} +void exynos_set_dp_phy (unsigned int onoff) + __attribute__((weak,alias ("__exynos_set_dp_phy" ))); +static void exynos_dp_disp_info (struct edp_disp_info *disp_info) { disp_info->h_total = disp_info->h_res + disp_info->h_sync_width +
@@ -872,8 +878,7 @@ unsigned int exynos_init_dp(void)exynos_dp_disp_info (&edp_info->disp_info); -if (dp_pd->phy_enable) - dp_pd->phy_enable (1 ); +exynos_set_dp_phy (1 ); ret =exynos_dp_init_dp ();if (ret !=EXYNOS_DP_SUCCESS ) {
Signature · 1 line
1.8.0
PATCH 3/13 video: exynos_fb: Make fimd_ctrl global
In reply to Ajay Kumarfimd_ctrl variable was redundantly defined across all the functions in the driver even though it contains just the same address. We make it global and initialize it in exynos_fimd_lcd_init. From then on, other funtions can use the data in the global variable.
--- drivers/video/exynos_fimd.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-)
drivers/video/exynos_fimd.c +2 -25
@@ -32,6 +32,7 @@static unsigned long *lcd_base_addr;static vidinfo_t *pvid; +static struct exynos_fb *fimd_ctrl;void exynos_fimd_lcd_init_mem (u_long screen_base,u_long fb_size,u_long palette_size)
@@ -41,8 +42,6 @@ void exynos_fimd_lcd_init_mem(u_long screen_base, u_long fb_size,static void exynos_fimd_set_dualrgb (unsigned int enabled) { -struct exynos_fb *fimd_ctrl = - (struct exynos_fb *)samsung_get_base_fimd ();unsigned int cfg =0 ;if (enabled) {
@@ -59,9 +58,6 @@ static void exynos_fimd_set_dualrgb(unsigned int enabled)static void exynos_fimd_set_dp_clkcon (unsigned int enabled) { - -struct exynos_fb *fimd_ctrl = - (struct exynos_fb *)samsung_get_base_fimd ();unsigned int cfg =0 ;if (enabled)
@@ -73,8 +69,6 @@ static void exynos_fimd_set_dp_clkcon(unsigned int enabled)static void exynos_fimd_set_par (unsigned int win_id) {unsigned int cfg =0 ; -struct exynos_fb *fimd_ctrl = - (struct exynos_fb *)samsung_get_base_fimd ();/* set window control */ cfg = readl((unsigned int)&fimd_ctrl->wincon0 +
@@ -126,8 +120,6 @@ static void exynos_fimd_set_par(unsigned int win_id)static void exynos_fimd_set_buffer_address (unsigned int win_id) {unsigned long start_addr, end_addr; -struct exynos_fb *fimd_ctrl = - (struct exynos_fb *)samsung_get_base_fimd (); start_addr = (unsigned long )lcd_base_addr; end_addr = start_addr + ((pvid->vl_col * (NBITS(pvid->vl_bpix) / 8)) *
@@ -144,8 +136,6 @@ static void exynos_fimd_set_clock(vidinfo_t *pvid)unsigned int cfg =0 , div =0 , remainder, remainder_div;unsigned long pixel_clock;unsigned long long src_clock; -struct exynos_fb *fimd_ctrl = - (struct exynos_fb *)samsung_get_base_fimd ();if (pvid->dual_lcd_enabled) { pixel_clock = pvid->vl_freq *
@@ -197,8 +187,6 @@ static void exynos_fimd_set_clock(vidinfo_t *pvid)void exynos_set_trigger (void ) {unsigned int cfg =0 ; -struct exynos_fb *fimd_ctrl = - (struct exynos_fb *)samsung_get_base_fimd (); cfg =readl (&fimd_ctrl->trigcon);
@@ -211,8 +199,6 @@ int exynos_is_i80_frame_done(void) {unsigned int cfg =0 ;int status; -struct exynos_fb *fimd_ctrl = - (struct exynos_fb *)samsung_get_base_fimd (); cfg =readl (&fimd_ctrl->trigcon);
@@ -226,8 +212,6 @@ int exynos_is_i80_frame_done(void)static void exynos_fimd_lcd_on (void ) {unsigned int cfg =0 ; -struct exynos_fb *fimd_ctrl = - (struct exynos_fb *)samsung_get_base_fimd ();/* display on */ cfg =readl (&fimd_ctrl->vidcon0);
@@ -238,8 +222,6 @@ static void exynos_fimd_lcd_on(void)static void exynos_fimd_window_on (unsigned int win_id) {unsigned int cfg =0 ; -struct exynos_fb *fimd_ctrl = - (struct exynos_fb *)samsung_get_base_fimd ();/* enable window */ cfg = readl((unsigned int)&fimd_ctrl->wincon0 +
@@ -256,8 +238,6 @@ static void exynos_fimd_window_on(unsigned int win_id)void exynos_fimd_lcd_off (void ) {unsigned int cfg =0 ; -struct exynos_fb *fimd_ctrl = - (struct exynos_fb *)samsung_get_base_fimd (); cfg =readl (&fimd_ctrl->vidcon0); cfg &= (EXYNOS_VIDCON0_ENVID_DISABLE |EXYNOS_VIDCON0_ENVID_F_DISABLE );
@@ -267,8 +247,6 @@ void exynos_fimd_lcd_off(void)void exynos_fimd_window_off (unsigned int win_id) {unsigned int cfg =0 ; -struct exynos_fb *fimd_ctrl = - (struct exynos_fb *)samsung_get_base_fimd (); cfg =readl ((unsigned int )&fimd_ctrl->wincon0 +EXYNOS_WINCON (win_id));
@@ -286,8 +264,7 @@ void exynos_fimd_lcd_init(vidinfo_t *vid) {unsigned int cfg =0 , rgb_mode;unsigned int offset; -struct exynos_fb *fimd_ctrl = - (struct exynos_fb *)samsung_get_base_fimd (); + fimd_ctrl = (struct exynos_fb *)samsung_get_base_fimd (); offset =exynos_fimd_get_base_offset ();
Signature · 1 line
1.8.0
PATCH 4/13 EXYNOS: FDT: Add compatible strings for FIMD
In reply to Ajay KumarAdd required compatible information for FIMD.
--- include/fdtdec.h | 1 + lib/fdtdec.c | 1 + 2 files changed, 2 insertions(+)
include/fdtdec.h +1 -0
@@ -81,6 +81,7 @@ enum fdt_compat_id {COMPAT_SAMSUNG_EXYNOS_EHCI ,/* Exynos EHCI controller */ COMPAT_SAMSUNG_EXYNOS_USB_PHY ,/* Exynos phy controller for usb2.0 */ COMPAT_MAXIM_MAX77686_PMIC ,/* MAX77686 PMIC */ +COMPAT_SAMSUNG_EXYNOS_FIMD ,/* Exynos Display controller */ COMPAT_COUNT, };
lib/fdtdec.c +1 -0
@@ -56,6 +56,7 @@ static const char * const compat_names[COMPAT_COUNT] = {COMPAT (SAMSUNG_EXYNOS_EHCI ,"samsung,exynos-ehci" ),COMPAT (SAMSUNG_EXYNOS_USB_PHY ,"samsung,exynos-usb-phy" ),COMPAT (MAXIM_MAX77686_PMIC ,"maxim,max77686_pmic" ), + COMPAT(SAMSUNG_EXYNOS_FIMD, "samsung,exynos-fimd"), };const char *fdtdec_get_compatible (enum fdt_compat_id id)
Signature · 1 line
1.8.0
PATCH 5/13 video: exynos_fb: add DT support for FIMD driver
In reply to Ajay KumarAdd function to parse FIMD data from device tree.
The driver still supports non-DT case.
Define panel_info statically in some file if you are not using DT. If you have defined DT node for FIMD, panel_info will be filled using the bindings of FIMD DT node.
--- drivers/video/exynos_fb.c | 163 ++++++++++++++++++++++++++++++++++++++++++++ drivers/video/exynos_fimd.c | 17 +++++ 2 files changed, 180 insertions(+)
drivers/video/exynos_fb.c +163 -0
@@ -23,6 +23,8 @@#include <config.h> #include <common.h> #include <lcd.h> +#include <fdtdec.h> +#include <libfdt.h> #include <asm/io.h> #include <asm/arch/cpu.h> #include <asm/arch/clock.h>
@@ -30,9 +32,12 @@#include <asm/arch/mipi_dsim.h> #include <asm/arch/dp_info.h> #include <asm/arch/system.h> +#include <asm-generic/errno.h> #include "exynos_fb.h" +DECLARE_GLOBAL_DATA_PTR ; +int lcd_line_length;int lcd_color_fg;int lcd_color_bg;
@@ -45,6 +50,20 @@ short console_row;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 , +}; +#endif +static void exynos_lcd_init_mem (void *lcdbase,vidinfo_t *vid) {unsigned long palette_size;
@@ -164,11 +183,155 @@ static void lcd_panel_on(vidinfo_t *vid)exynos_mipi_dsi_init (); } +#ifdef CONFIG_OF_CONTROL +int exynos_fimd_parse_dt (const void *blob) +{ +unsigned int node; + node =fdtdec_next_compatible (blob,0 ,COMPAT_SAMSUNG_EXYNOS_FIMD ); +if (node <=0 ) { +debug ("exynos_fb: Can't get device node for fimd\n" ); +return -ENODEV ; + } + + panel_info.vl_col =fdtdec_get_int (blob, node,"samsung,vl-col" ,0 ); +if (panel_info.vl_col ==0 ) { +debug ("Can't get XRES\n" ); +return -ENXIO ; + } + + panel_info.vl_row =fdtdec_get_int (blob, node,"samsung,vl-row" ,0 ); +if (panel_info.vl_row ==0 ) { +debug ("Can't get YRES\n" ); +return -ENXIO ; + } + + panel_info.vl_width =fdtdec_get_int (blob, node, +"samsung,vl-width" ,0 ); + + panel_info.vl_height =fdtdec_get_int (blob, node, +"samsung,vl-height" ,0 ); + + panel_info.vl_freq =fdtdec_get_int (blob, node,"samsung,vl-freq" ,0 ); +if (panel_info.vl_freq ==0 ) { +debug ("Can't get refresh rate\n" ); +return -ENXIO ; + } + +if (fdtdec_get_bool (blob, node,"samsung,vl-clkp" )) + panel_info.vl_clkp =CONFIG_SYS_LOW ; + +if (fdtdec_get_bool (blob, node,"samsung,vl-oep" )) + panel_info.vl_oep =CONFIG_SYS_LOW ; + +if (fdtdec_get_bool (blob, node,"samsung,vl-hsp" )) + panel_info.vl_hsp =CONFIG_SYS_LOW ; + +if (fdtdec_get_bool (blob, node,"samsung,vl-vsp" )) + panel_info.vl_vsp =CONFIG_SYS_LOW ; + +if (fdtdec_get_bool (blob, node,"samsung,vl-dp" )) + panel_info.vl_dp =CONFIG_SYS_LOW ; + + panel_info.vl_bpix =fdtdec_get_int (blob, node,"samsung,vl-bpix" ,0 ); +if (panel_info.vl_bpix ==0 ) { +debug ("Can't get bits per pixel\n" ); +return -ENXIO ; + } + + panel_info.vl_hspw =fdtdec_get_int (blob, node,"samsung,vl-hspw" ,0 ); +if (panel_info.vl_hspw ==0 ) { +debug ("Can't get hsync width\n" ); +return -ENXIO ; + } + + panel_info.vl_hfpd =fdtdec_get_int (blob, node,"samsung,vl-hfpd" ,0 ); +if (panel_info.vl_hfpd ==0 ) { +debug ("Can't get right margin\n" ); +return -ENXIO ; + } + + panel_info.vl_hbpd = (u_char )fdtdec_get_int (blob, node, +"samsung,vl-hbpd" ,0 ); +if (panel_info.vl_hbpd ==0 ) { +debug ("Can't get left margin\n" ); +return -ENXIO ; + } + + panel_info.vl_vspw = (u_char )fdtdec_get_int (blob, node, +"samsung,vl-vspw" ,0 ); +if (panel_info.vl_vspw ==0 ) { +debug ("Can't get vsync width\n" ); +return -ENXIO ; + } + + panel_info.vl_vfpd =fdtdec_get_int (blob, node, +"samsung,vl-vfpd" ,0 ); +if (panel_info.vl_vfpd ==0 ) { +debug ("Can't get lower margin\n" ); +return -ENXIO ; + } + + panel_info.vl_vbpd =fdtdec_get_int (blob, node,"samsung,vl-vbpd" ,0 ); +if (panel_info.vl_vbpd ==0 ) { +debug ("Can't get upper margin\n" ); +return -ENXIO ; + } + + panel_info.vl_cmd_allow_len =fdtdec_get_int (blob, node, +"samsung,vl-cmd-allow-len" ,0 ); + + panel_info.win_id =fdtdec_get_int (blob, node,"samsung,winid" ,0 ); + panel_info.init_delay =fdtdec_get_int (blob, node, +"samsung,init-delay" ,0 ); + panel_info.power_on_delay =fdtdec_get_int (blob, node, +"samsung,power-on-delay" ,0 ); + panel_info.reset_delay =fdtdec_get_int (blob, node, +"samsung,reset-delay" ,0 ); + panel_info.interface_mode =fdtdec_get_int (blob, node, +"samsung,interface-mode" ,0 ); + panel_info.mipi_enabled =fdtdec_get_int (blob, node, +"samsung,mipi-enabled" ,0 ); + panel_info.dp_enabled =fdtdec_get_int (blob, node, +"samsung,dp-enabled" ,0 ); + panel_info.cs_setup =fdtdec_get_int (blob, node, +"samsung,cs-setup" ,0 ); + panel_info.wr_setup =fdtdec_get_int (blob, node, +"samsung,wr-setup" ,0 ); + panel_info.wr_act =fdtdec_get_int (blob, node,"samsung,wr-act" ,0 ); + panel_info.wr_hold =fdtdec_get_int (blob, node,"samsung,wr-hold" ,0 ); + + panel_info.logo_on =fdtdec_get_int (blob, node,"samsung,logo-on" ,0 ); +if (panel_info.logo_on) { + panel_info.logo_width =fdtdec_get_int (blob, node, +"samsung,logo-width" ,0 ); + panel_info.logo_height =fdtdec_get_int (blob, node, +"samsung,logo-height" ,0 ); + panel_info.logo_addr =fdtdec_get_int (blob, node, +"samsung,logo-addr" ,0 ); + } + + panel_info.rgb_mode =fdtdec_get_int (blob, node, +"samsung,rgb-mode" ,0 ); + panel_info.pclk_name =fdtdec_get_int (blob, node, +"samsung,pclk-name" ,0 ); + panel_info.sclk_div =fdtdec_get_int (blob, node, +"samsung,sclk-div" ,0 ); + panel_info.dual_lcd_enabled =fdtdec_get_int (blob, node, +"samsung,dual-lcd-enabled" ,0 ); + +return 0 ; +} +#endif +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" ); +#endif /* initialize parameters which is specific to panel. */ init_panel_info (&panel_info);
drivers/video/exynos_fimd.c +17 -0
@@ -25,11 +25,15 @@#include <asm/io.h> #include <lcd.h> #include <div64.h> +#include <fdtdec.h> +#include <libfdt.h> #include <asm/arch/clk.h> #include <asm/arch/clock.h> #include <asm/arch/cpu.h> #include "exynos_fb.h" +DECLARE_GLOBAL_DATA_PTR ; +static unsigned long *lcd_base_addr;static vidinfo_t *pvid;static struct exynos_fb *fimd_ctrl;
@@ -264,6 +268,19 @@ void exynos_fimd_lcd_init(vidinfo_t *vid) {unsigned int cfg =0 , rgb_mode;unsigned int offset; +#ifdef CONFIG_OF_CONTROL +unsigned int node; + + node =fdtdec_next_compatible (gd->fdt_blob, +0 ,COMPAT_SAMSUNG_EXYNOS_FIMD ); +if (node <=0 ) +debug ("exynos_fb: Can't get device node for fimd\n" ); + + fimd_ctrl = (struct exynos_fb *)fdtdec_get_addr (gd->fdt_blob, + node,"reg" ); +if (fimd_ctrl ==NULL ) +debug ("Can't get the FIMD base address\n" ); +#endif fimd_ctrl = (struct exynos_fb *)samsung_get_base_fimd (); offset =exynos_fimd_get_base_offset ();
Signature · 1 line
1.8.0
PATCH 6/13 EXYNOS5: Add device node for FIMD
In reply to Ajay KumarAdd DT node and bindings documentation for FIMD.
--- arch/arm/dts/exynos5250.dtsi | 6 ++ doc/device-tree-bindings/video/exynos-fb.txt | 92 ++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 doc/device-tree-bindings/video/exynos-fb.txt
arch/arm/dts/exynos5250.dtsi +6 -0
@@ -151,4 +151,10 @@ }; }; + fimd at 14400000 { + compatible = "samsung,exynos-fimd"; + reg = <0x14400000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; + }; };
doc/device-tree-bindings/video/exynos-fb.txt new file +92 -0
92 lines not on this page · raw message
Signature · 1 line
1.8.0
PATCH 7/13 SMDK5250: Add device node for FIMD
In reply to Ajay KumarAdd DT bindings for FIMD supporting an eDP panel of size 2560x1600.
--- board/samsung/dts/exynos5250-smdk5250.dts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
board/samsung/dts/exynos5250-smdk5250.dts +25 -0
@@ -66,4 +66,29 @@ compatible = "maxim,max77686_pmic"; }; }; + + fimd at 14400000 { + samsung,vl-freq = <60>; + samsung,vl-col = <2560>; + samsung,vl-row = <1600>; + samsung,vl-width = <2560>; + samsung,vl-height = <1600>; + + samsung,vl-clkp; + samsung,vl-dp; + samsung,vl-bpix = <4>; + + samsung,vl-hspw = <32>; + samsung,vl-hbpd = <80>; + samsung,vl-hfpd = <48>; + samsung,vl-vspw = <6>; + samsung,vl-vbpd = <37>; + samsung,vl-vfpd = <3>; + samsung,vl-cmd-allow-len = <0xf>; + + samsung,winid = <3>; + samsung,interface-mode = <1>; + samsung,dp-enabled = <1>; + samsung,dual-lcd-enabled = <0>; + }; };
Signature · 1 line
1.8.0
PATCH 8/13 video: exynos_dp: Make dp_regs global
In reply to Ajay Kumardp_regs variable was redundantly defined across all the functions in the driver even though it contains just the same address. We make it global and initialize it once using exynos_dp_set_base_addr().
PATCH 9/13 EXYNOS5: FDT: Add compatible strings for FIMD
In reply to Ajay KumarAdd required compatible information for FIMD.
--- include/fdtdec.h | 1 + lib/fdtdec.c | 1 + 2 files changed, 2 insertions(+)
include/fdtdec.h +1 -0
@@ -82,6 +82,7 @@ enum fdt_compat_id {COMPAT_SAMSUNG_EXYNOS_USB_PHY ,/* Exynos phy controller for usb2.0 */ COMPAT_MAXIM_MAX77686_PMIC ,/* MAX77686 PMIC */ COMPAT_SAMSUNG_EXYNOS_FIMD ,/* Exynos Display controller */ +COMPAT_SAMSUNG_EXYNOS5_DP ,/* Exynos Display port controller */ COMPAT_COUNT, };
lib/fdtdec.c +1 -0
@@ -57,6 +57,7 @@ static const char * const compat_names[COMPAT_COUNT] = {COMPAT (SAMSUNG_EXYNOS_USB_PHY ,"samsung,exynos-usb-phy" ),COMPAT (MAXIM_MAX77686_PMIC ,"maxim,max77686_pmic" ),COMPAT (SAMSUNG_EXYNOS_FIMD ,"samsung,exynos-fimd" ), + COMPAT(SAMSUNG_EXYNOS5_DP, "samsung,exynos5-dp"), };const char *fdtdec_get_compatible (enum fdt_compat_id id)
Signature · 1 line
1.8.0
PATCH 10/13 video: exynos_dp: Add function to parse DP DT node
In reply to Ajay KumarAdd function to parse the required platform data fron DP DT node and fill the edp_info structure.
--- drivers/video/exynos_dp.c | 65 ++++++++++++++++++++++++++++++++++++++ drivers/video/exynos_dp_lowlevel.c | 17 ++++++++++ 2 files changed, 82 insertions(+)
drivers/video/exynos_dp.c +65 -0
@@ -27,9 +27,13 @@#include <asm/arch/cpu.h> #include <asm/arch/dp_info.h> #include <asm/arch/dp.h> +#include <fdtdec.h> +#include <libfdt.h> #include "exynos_dp_lowlevel.h" +DECLARE_GLOBAL_DATA_PTR ; +static struct exynos_dp_platform_data *dp_pd;void __exynos_set_dp_phy (unsigned int onoff)
@@ -859,6 +863,62 @@ static unsigned int exynos_dp_config_video(struct edp_device_info *edp_info)return ret; } +#ifdef CONFIG_OF_CONTROL +int exynos_dp_parse_dt (const void *blob,struct edp_device_info *edp_info) +{ +unsigned int node =fdtdec_next_compatible (blob,0 , +COMPAT_SAMSUNG_EXYNOS5_DP ); +if (node <=0 ) { +debug ("exynos_dp: Can't get device node for dp\n" ); +return -ENODEV ; + } + + edp_info->disp_info.h_res =fdtdec_get_int (blob, node, +"samsung,h-res" ,0 ); + edp_info->disp_info.h_sync_width =fdtdec_get_int (blob, node, +"samsung,h-sync-width" ,0 ); + edp_info->disp_info.h_back_porch =fdtdec_get_int (blob, node, +"samsung,h-back-porch" ,0 ); + edp_info->disp_info.h_front_porch =fdtdec_get_int (blob, node, +"samsung,h-front-porch" ,0 ); + edp_info->disp_info.v_res =fdtdec_get_int (blob, node, +"samsung,v-res" ,0 ); + edp_info->disp_info.v_sync_width =fdtdec_get_int (blob, node, +"samsung,v-sync-width" ,0 ); + edp_info->disp_info.v_back_porch =fdtdec_get_int (blob, node, +"samsung,v-back-porch" ,0 ); + edp_info->disp_info.v_front_porch =fdtdec_get_int (blob, node, +"samsung,v-front-porch" ,0 ); + edp_info->disp_info.v_sync_rate =fdtdec_get_int (blob, node, +"samsung,v-sync-rate" ,0 ); + + edp_info->lt_info.lt_status =fdtdec_get_int (blob, node, +"samsung,lt-status" ,0 ); + + edp_info->video_info.master_mode =fdtdec_get_int (blob, node, +"samsung,master-mode" ,0 ); + edp_info->video_info.bist_mode =fdtdec_get_int (blob, node, +"samsung,bist-mode" ,0 ); + edp_info->video_info.bist_pattern =fdtdec_get_int (blob, node, +"samsung,bist-pattern" ,0 ); + edp_info->video_info.h_sync_polarity =fdtdec_get_int (blob, node, +"samsung,h-sync-polarity" ,0 ); + edp_info->video_info.v_sync_polarity =fdtdec_get_int (blob, node, +"samsung,v-sync-polarity" ,0 ); + edp_info->video_info.interlaced =fdtdec_get_int (blob, node, +"samsung,interlaced" ,0 ); + edp_info->video_info.color_space =fdtdec_get_int (blob, node, +"samsung,color-space" ,0 ); + edp_info->video_info.dynamic_range =fdtdec_get_int (blob, node, +"samsung,dynamic-range" ,0 ); + edp_info->video_info.ycbcr_coeff =fdtdec_get_int (blob, node, +"samsung,ycbcr-coeff" ,0 ); + edp_info->video_info.color_depth =fdtdec_get_int (blob, node, +"samsung,color-depth" ,0 ); +return 0 ; +} +#endif +unsigned int exynos_init_dp (void ) {unsigned int ret;
@@ -870,11 +930,16 @@ unsigned int exynos_init_dp(void)return -EFAULT ; } +#ifdef CONFIG_OF_CONTROL +if (exynos_dp_parse_dt (gd->fdt_blob, edp_info)) +debug ("unable to parse DP DT node\n" ); +#else edp_info = dp_pd->edp_dev_info;if (edp_info ==NULL ) {debug ("failed to get edp_info data.\n" );return -EFAULT ; } +#endif exynos_dp_set_base_addr ();
drivers/video/exynos_dp_lowlevel.c +17 -0
@@ -25,12 +25,29 @@#include <asm/arch/cpu.h> #include <asm/arch/dp_info.h> #include <asm/arch/dp.h> +#include <fdtdec.h> +#include <libfdt.h> + +/* Declare global data pointer */ +DECLARE_GLOBAL_DATA_PTR ;struct exynos_dp *dp_regs;void exynos_dp_set_base_addr (void ) { +#ifdef CONFIG_OF_CONTROL +unsigned int node =fdtdec_next_compatible (gd->fdt_blob, +0 ,COMPAT_SAMSUNG_EXYNOS5_DP ); +if (node <=0 ) +debug ("exynos_dp: Can't get device node for dp\n" ); + + dp_regs = (struct exynos_dp *)fdtdec_get_addr (gd->fdt_blob, + node,"reg" ); +if (dp_regs ==NULL ) +debug ("Can't get the DP base address\n" ); +#else dp_regs = (struct exynos_dp *)samsung_get_base_dp (); +#endif }static void exynos_dp_enable_video_input (unsigned int enable)
Signature · 1 line
1.8.0
PATCH 11/13 EXYNOS5: Add device node for DP
In reply to Ajay KumarAdd DT node and bindings documentaion for DP.
--- arch/arm/dts/exynos5250.dtsi | 7 +++ doc/device-tree-bindings/video/exynos-dp.txt | 69 ++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 doc/device-tree-bindings/video/exynos-dp.txt
arch/arm/dts/exynos5250.dtsi +7 -0
@@ -157,4 +157,11 @@ #address-cells = <1>; #size-cells = <1>; }; + + dp at 145b0000 { + compatible = "samsung,exynos5-dp"; + reg = <0x145b0000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + }; };
doc/device-tree-bindings/video/exynos-dp.txt new file +69 -0
69 lines not on this page · raw message
Signature · 1 line
1.8.0
PATCH 12/13 SMDK5250: Add device node for DP
In reply to Ajay KumarAdd DT bindings for DP supporting an eDP panel of size 2560x1600.
--- board/samsung/dts/exynos5250-smdk5250.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
board/samsung/dts/exynos5250-smdk5250.dts +15 -0
@@ -91,4 +91,19 @@ samsung,dp-enabled = <1>; samsung,dual-lcd-enabled = <0>; }; + + dp at 145b0000 { + samsung,lt-status = <0>; + + samsung,master-mode = <0>; + samsung,bist-mode = <0>; + samsung,bist-pattern = <0>; + samsung,h-sync-polarity = <0>; + samsung,v-sync-polarity = <0>; + samsung,interlaced = <0>; + samsung,color-space = <0>; + samsung,dynamic-range = <0>; + samsung,ycbcr-coeff = <0>; + samsung,color-depth = <1>; + }; };
Signature · 1 line
1.8.0
PATCH 13/13 SMDK5250: Use statically defined structures only in non DT case
In reply to Ajay KumarSince we have DT support in exynos_fb and exynos_dp drivers now,
we need not define any static structure or platform data related to display in the board file smdk5250.c.
So, we place the already existing structures inside #ifndef CONFIG_OF_CONTROL block.
--- board/samsung/smdk5250/smdk5250.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
board/samsung/smdk5250/smdk5250.c +9 -5
@@ -408,6 +408,12 @@ void exynos_cfg_lcd_gpio(void)s5p_gpio_cfg_pin (&gpio1->x0,7 ,GPIO_FUNC (0x3 )); } +void exynos_set_dp_phy (unsigned int onoff) +{ +set_dp_phy_ctrl (onoff); +} + +#ifndef CONFIG_OF_CONTROL vidinfo_t panel_info = { .vl_freq =60 , .vl_col = 2560,
@@ -440,11 +446,6 @@ vidinfo_t panel_info = { .dp_enabled = 1, }; -void exynos_set_dp_phy (unsigned int onoff) -{ -set_dp_phy_ctrl (onoff); -} -static struct edp_device_info edp_info = { .disp_info = { .h_res =2560 ,
@@ -478,10 +479,13 @@ static struct exynos_dp_platform_data dp_platform_data = { .edp_dev_info = &edp_info, }; +#endif void init_panel_info (vidinfo_t *vid) { +#ifndef CONFIG_OF_CONTROL vid->rgb_mode =MODE_RGB_P ,exynos_set_dp_platform_data (&dp_platform_data); +#endif }#endif
Signature · 1 line
1.8.0
cover video: exynos: Add DT support for exynos_fb and exynos_dp drivers
In reply to Ajay KumarDear Donghwa,
Quoted 26 lines · Ajay Kumar
Ajay Kumar (13):
[PATCH 01/13] video:exynos_fb: Remove callbacks from the driver [PATCH 02/13] video:exynos_dp: Remove callbacks from the driver [PATCH 03/13] video:exynos_fb: Makefimd_ctrlglobal
[PATCH 04/13] EXYNOS: FDT: Add compatible strings for FIMD [PATCH 05/13] video:exynos_fb: add DT support for FIMD driver [PATCH 06/13] EXYNOS5: Add device node for FIMD
[PATCH 07/13] SMDK5250: Add device node for FIMD
[PATCH 08/13] video:exynos_dp: Makedp_regsglobal
[PATCH 09/13] EXYNOS5: FDT: Add compatible strings for FIMD [PATCH 10/13] video:exynos_dp: Add function to parse DP DT node [PATCH 11/13] EXYNOS5: Add device node for DP
[PATCH 12/13] SMDK5250: Add device node for DP
[PATCH 13/13] SMDK5250: Use statically defined structures only in non DT casearch/arm/dts/exynos5250.dtsi | 13 ++ arch/arm/include/asm/arch-exynos/dp_info.h | 1 - board/samsung/dts/exynos5250-smdk5250.dts | 40 +++++ board/samsung/smdk5250/smdk5250.c | 16 +- board/samsung/trats/trats.c | 6 +- board/samsung/universal_c210/universal.c | 23 +-- doc/device-tree-bindings/video/exynos-dp.txt | 69 ++++++++ doc/device-tree-bindings/video/exynos-fb.txt | 92 +++++++++++ drivers/video/exynos_dp.c | 76 ++++++++- drivers/video/exynos_dp_lowlevel.c | 69 +++----- drivers/video/exynos_dp_lowlevel.h | 1 +
Quoted 9 lines
drivers/video/exynos_fb.c | 230 +++++++++++++++++++++++++-- drivers/video/exynos_fimd.c | 44 +++-- include/fdtdec.h | 2 + include/lcd.h | 9 -- lib/fdtdec.c | 2 + 16 files changed, 574 insertions(+), 119 deletions(-) create mode 100644 doc/device-tree-bindings/video/exynos-dp.txt create mode 100644 doc/device-tree-bindings/video/exynos-fb.txt
Could you please test this patchset?
Thanks,
Minkyu Kang.
cover video: exynos: Add DT support for exynos_fb and exynos_dp drivers
In reply to Ajay KumarQuoted 26 lines · Ajay Kumar
Ajay Kumar (13):
[PATCH 01/13] video:exynos_fb: Remove callbacks from the driver [PATCH 02/13] video:exynos_dp: Remove callbacks from the driver [PATCH 03/13] video:exynos_fb: Makefimd_ctrlglobal
[PATCH 04/13] EXYNOS: FDT: Add compatible strings for FIMD [PATCH 05/13] video:exynos_fb: add DT support for FIMD driver [PATCH 06/13] EXYNOS5: Add device node for FIMD
[PATCH 07/13] SMDK5250: Add device node for FIMD
[PATCH 08/13] video:exynos_dp: Makedp_regsglobal
[PATCH 09/13] EXYNOS5: FDT: Add compatible strings for FIMD [PATCH 10/13] video:exynos_dp: Add function to parse DP DT node [PATCH 11/13] EXYNOS5: Add device node for DP
[PATCH 12/13] SMDK5250: Add device node for DP
[PATCH 13/13] SMDK5250: Use statically defined structures only in non DT casearch/arm/dts/exynos5250.dtsi | 13 ++ arch/arm/include/asm/arch-exynos/dp_info.h | 1 - board/samsung/dts/exynos5250-smdk5250.dts | 40 +++++ board/samsung/smdk5250/smdk5250.c | 16 +- board/samsung/trats/trats.c | 6 +- board/samsung/universal_c210/universal.c | 23 +-- doc/device-tree-bindings/video/exynos-dp.txt | 69 ++++++++ doc/device-tree-bindings/video/exynos-fb.txt | 92 +++++++++++ drivers/video/exynos_dp.c | 76 ++++++++- drivers/video/exynos_dp_lowlevel.c | 69 +++----- drivers/video/exynos_dp_lowlevel.h | 1 +
Quoted 9 lines
drivers/video/exynos_fb.c | 230 +++++++++++++++++++++++++-- drivers/video/exynos_fimd.c | 44 +++-- include/fdtdec.h | 2 + include/lcd.h | 9 -- lib/fdtdec.c | 2 + 16 files changed, 574 insertions(+), 119 deletions(-) create mode 100644 doc/device-tree-bindings/video/exynos-dp.txt create mode 100644 doc/device-tree-bindings/video/exynos-fb.txt
applied to u-boot-samsung.
Thanks,
Minkyu Kang.