[U-Boot] [PATCH 04/10] samsung: misc: move display logo function to misc.c file.

황형원 human.hwang at samsung.com
Tue Dec 10 10:47:09 CET 2013


I tested this code using TRATS2 board, and it worked well.

-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On
Behalf Of Przemyslaw Marczak
Sent: Wednesday, December 04, 2013 3:03 AM
To: u-boot at lists.denx.de
Cc: Przemyslaw Marczak
Subject: [U-Boot] [PATCH 04/10] samsung: misc: move display logo function
to misc.c file.

board/samsung/common/misc.c:
- move draw_logo() function from exynos_fb.c
- add get_tizen_logo_info() function call removed from board files

boards:
- update board files
- add CONFIG_MISC_INIT_R to Universal, Trats and Trats2

Signed-off-by: Przemyslaw Marczak <p.marczak at samsung.com>
Tested-by: Hyungwon Hwang <human.hwang at samsung.com>
---
 board/samsung/common/misc.c              |   39
++++++++++++++++++++++++++++++
 board/samsung/trats/trats.c              |    3 ---
 board/samsung/trats2/trats2.c            |    4 ---
 board/samsung/universal_c210/universal.c |    4 ---
 drivers/video/exynos_fb.c                |   28 ---------------------
 include/configs/s5pc210_universal.h      |    3 +++
 include/configs/trats.h                  |    3 +++
 include/configs/trats2.h                 |    3 +++
 8 files changed, 48 insertions(+), 39 deletions(-)

diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index 465895b..fa97644 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -6,11 +6,50 @@
  */
 
 #include <common.h>
+#include <lcd.h>
+#include <libtizen.h>
+
+#ifdef CONFIG_MISC_INIT_R
+#ifdef CONFIG_CMD_BMP
+static void draw_logo(void)
+{
+	int x, y;
+	ulong addr;
+
+#ifdef CONFIG_TIZEN
+	get_tizen_logo_info(&panel_info);
+#else
+	return;
+#endif
+
+	if (panel_info.vl_width >= panel_info.logo_width) {
+		x = ((panel_info.vl_width - panel_info.logo_width) >> 1);
+	} else {
+		x = 0;
+		printf("Warning: image width is bigger than display
width\n");
+	}
+
+	if (panel_info.vl_height >= panel_info.logo_height) {
+		y = ((panel_info.vl_height - panel_info.logo_height) >> 1);
+	} else {
+		y = 0;
+		printf("Warning: image height is bigger than display
height\n");
+	}
+
+	addr = panel_info.logo_addr;
+	bmp_display(addr, x, y);
+}
+#endif /* CONFIG_CMD_BMP */
+#endif /* CONFIG_MISC_INIT_R */
 
 #ifdef CONFIG_MISC_INIT_R
 /* Common for Samsung boards */
 int misc_init_r(void)
 {
+#ifdef CONFIG_CMD_BMP
+	if (panel_info.logo_on)
+		draw_logo();
+#endif
 	return 0;
 }
 #endif /* CONFIG_MISC_INIT_R */
diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index 6bd106e..ce4b41f 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -767,9 +767,6 @@ void init_panel_info(vidinfo_t *vid)
 	vid->resolution	= HD_RESOLUTION,
 	vid->rgb_mode	= MODE_RGB_P,
 
-#ifdef CONFIG_TIZEN
-	get_tizen_logo_info(vid);
-#endif
 	mipi_lcd_device.reverse_panel = 1;
 
 	strcpy(s6e8ax0_platform_data.lcd_panel_name, mipi_lcd_device.name);
diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c
index 2442d96..73b8cc1 100644
--- a/board/samsung/trats2/trats2.c
+++ b/board/samsung/trats2/trats2.c
@@ -573,10 +573,6 @@ void init_panel_info(vidinfo_t *vid)
 
 	mipi_lcd_device.reverse_panel = 1;
 
-#ifdef CONFIG_TIZEN
-	get_tizen_logo_info(vid);
-#endif
-
 	strcpy(dsim_platform_data.lcd_panel_name, mipi_lcd_device.name);
 	dsim_platform_data.mipi_power = mipi_power;
 	dsim_platform_data.phy_enable = set_mipi_phy_ctrl; diff --git
a/board/samsung/universal_c210/universal.c
b/board/samsung/universal_c210/universal.c
index 54d0e1e..166d5ee 100644
--- a/board/samsung/universal_c210/universal.c
+++ b/board/samsung/universal_c210/universal.c
@@ -484,10 +484,6 @@ void init_panel_info(vidinfo_t *vid)
 	vid->resolution	= HD_RESOLUTION;
 	vid->rgb_mode	= MODE_RGB_P;
 
-#ifdef CONFIG_TIZEN
-	get_tizen_logo_info(vid);
-#endif
-
 	/* for LD9040. */
 	vid->pclk_name = 1;	/* MPLL */
 	vid->sclk_div = 1;
diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c index
7d4c6e0..00a0a11 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -62,31 +62,6 @@ static void exynos_lcd_init(vidinfo_t *vid)
 	lcd_set_flush_dcache(1);
 }
 
-#ifdef CONFIG_CMD_BMP
-static void draw_logo(void)
-{
-	int x, y;
-	ulong addr;
-
-	if (panel_width >= panel_info.logo_width) {
-		x = ((panel_width - panel_info.logo_width) >> 1);
-	} else {
-		x = 0;
-		printf("Warning: image width is bigger than display
width\n");
-	}
-
-	if (panel_height >= panel_info.logo_height) {
-		y = ((panel_height - panel_info.logo_height) >> 1) - 4;
-	} else {
-		y = 0;
-		printf("Warning: image height is bigger than display
height\n");
-	}
-
-	addr = panel_info.logo_addr;
-	bmp_display(addr, x, y);
-}
-#endif
-
 void __exynos_cfg_lcd_gpio(void)
 {
 }
@@ -323,9 +298,6 @@ void lcd_enable(void)
 	if (panel_info.logo_on) {
 		memset((void *) gd->fb_base, 0, panel_width * panel_height *
 				(NBITS(panel_info.vl_bpix) >> 3));
-#ifdef CONFIG_CMD_BMP
-		draw_logo();
-#endif
 	}
 
 	lcd_panel_on(&panel_info);
diff --git a/include/configs/s5pc210_universal.h
b/include/configs/s5pc210_universal.h
index 02a1c99..47f0e85 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -269,6 +269,9 @@ void universal_spi_sda(int bit);  int
universal_spi_read(void);  #endif
 
+/* Common misc for Samsung */
+#define CONFIG_MISC_INIT_R	1
+
 /*
  * LCD Settings
  */
diff --git a/include/configs/trats.h b/include/configs/trats.h index
2b07fe0..806f6fe 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -310,6 +310,9 @@
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 #define CONFIG_USB_CABLE_CHECK
 
+/* Common misc for Samsung */
+#define CONFIG_MISC_INIT_R	1
+
 /* LCD */
 #define CONFIG_EXYNOS_FB
 #define CONFIG_LCD
diff --git a/include/configs/trats2.h b/include/configs/trats2.h index
18270c1..91821b4 100644
--- a/include/configs/trats2.h
+++ b/include/configs/trats2.h
@@ -316,6 +316,9 @@
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 #define CONFIG_USB_CABLE_CHECK
 
+/* Common misc for Samsung */
+#define CONFIG_MISC_INIT_R	1
+
 /* LCD */
 #define CONFIG_EXYNOS_FB
 #define CONFIG_LCD
--
1.7.9.5

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

---
Hyungwon Hwang
Samsung SWC S/W Platform Team
Smasung Electronics
human.hwang at samsung.com



More information about the U-Boot mailing list