From patchwork Fri Jul 4 13:19:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Kumar X-Patchwork-Id: 367100 X-Patchwork-Delegate: promsoft@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C6F86140095 for ; Fri, 4 Jul 2014 23:23:25 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 78E4B4A058; Fri, 4 Jul 2014 15:23:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lXR7B9-UBO1l; Fri, 4 Jul 2014 15:23:24 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 74A734B174; Fri, 4 Jul 2014 15:23:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6B55A4A058 for ; Fri, 4 Jul 2014 15:23:21 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id atQDqAQN2vzQ for ; Fri, 4 Jul 2014 15:23:18 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by theia.denx.de (Postfix) with ESMTPS id 7AC6E4B5E4 for ; Fri, 4 Jul 2014 15:23:15 +0200 (CEST) Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N86002Q7VUPWO80@mailout1.samsung.com> for u-boot@lists.denx.de; Fri, 04 Jul 2014 22:23:13 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.123]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id B9.FE.16580.1CAA6B35; Fri, 04 Jul 2014 22:23:13 +0900 (KST) X-AuditID: cbfee691-b7f2f6d0000040c4-bf-53b6aac1c6a8 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 42.F0.05196.1CAA6B35; Fri, 04 Jul 2014 22:23:13 +0900 (KST) Received: from chromebld-server.sisodomain.com ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N8600JA8VSL7050@mmp2.samsung.com>; Fri, 04 Jul 2014 22:23:13 +0900 (KST) From: Ajay Kumar To: u-boot@lists.denx.de Date: Fri, 04 Jul 2014 18:49:27 +0530 Message-id: <1404479975-1938-2-git-send-email-ajaykumar.rs@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1404479975-1938-1-git-send-email-ajaykumar.rs@samsung.com> References: <1404479975-1938-1-git-send-email-ajaykumar.rs@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrILMWRmVeSWpSXmKPExsWyRsSkWvfgqm3BBgsnK1kceH+QxWLDm4XM FtfP21l0HGlhtFh1eAO7xbct2xgt3u7tZHdg95jdcJHFY+esu+weZ+/sYPTo27KKMYAlissm JTUnsyy1SN8ugSvj2fHnTAWTtSo+flzI3MDYo9zFyMkhIWAi0XnrASuELSZx4d56ti5GLg4h gaWMEn2Tv7PDFM0+tBasSEhgOqPE66+pEEUTmCQOtdxiAUmwCWhLbJt+E8wWEZCQ+NV/lRGk iFlgBqPE0QfTmEASwgKOEtP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w8xmgIdNZFZSjQ5HxjXeSXxhsYm5qbGppYmFiZmlkrivAdbrQOFBNITS1KzU1MLUotg+pg4 OKUaGFlyg7geTmIU/3FYiutTp1/PHr29Jj62vmp6m17wTJKStWfJn7Xs+I1Mm1aJivUMfw6m KfI8uzO15fcySf+Ai6Gbb3x+/HZXfuo64X2v7ROmB5db3LtRpHHo+MWffEwBf47Y3ji6eZXQ zC079V8nvKraOy+67deZA65RJ5wO34iNX1uRmR7LvVaJpTgj0VCLuag4EQDrR8jsswIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: dh09.lee@samsung.com, prashanth.g@samsung.com, Ajay Kumar Subject: [U-Boot] [PATCH V3 1/9] exynos_fb: Remove usage of static defines X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Tested-by: Simon Glass --- 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 74e72a5..c24984b 100644 --- a/include/configs/exynos5250-dt.h +++ b/include/configs/exynos5250-dt.h @@ -61,8 +61,6 @@ #ifdef CONFIG_LCD #define CONFIG_EXYNOS_FB #define CONFIG_EXYNOS_DP -#define LCD_XRES 2560 -#define LCD_YRES 1600 #define LCD_BPP LCD_COLOR16 #endif 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 206975b..94c8a9f 100644 --- a/include/configs/trats2.h +++ b/include/configs/trats2.h @@ -241,7 +241,4 @@ int get_soft_i2c_sda_pin(void); #define CONFIG_VIDEO_BMP_GZIP #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54) -#define LCD_XRES 720 -#define LCD_YRES 1280 - #endif /* __CONFIG_H */