From patchwork Mon Sep 30 11:20:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Kumar X-Patchwork-Id: 279106 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 EF9222C00BC for ; Mon, 30 Sep 2013 21:00:46 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 850A54A109; Mon, 30 Sep 2013 13:00:43 +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 shZkN7hFqpbn; Mon, 30 Sep 2013 13:00:43 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9EA104A0E6; Mon, 30 Sep 2013 13:00:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EB05E4A0DE for ; Mon, 30 Sep 2013 13:00:13 +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 Ada1LZhD4LBe for ; Mon, 30 Sep 2013 13:00:06 +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 ESMTP id 76FFA4A0DF for ; Mon, 30 Sep 2013 13:00:04 +0200 (CEST) Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MTX00LYRQJKLE41@mailout1.samsung.com> for u-boot@lists.denx.de; Mon, 30 Sep 2013 19:59:54 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.122]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 6E.1D.31253.AA959425; Mon, 30 Sep 2013 19:59:54 +0900 (KST) X-AuditID: cbfee690-b7f3b6d000007a15-88-524959aa6d8a Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id F1.09.09055.AA959425; Mon, 30 Sep 2013 19:59:54 +0900 (KST) Received: from chromeserver-PowerEdge-T410.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MTX00J44QJN8020@mmp1.samsung.com>; Mon, 30 Sep 2013 19:59:54 +0900 (KST) From: Ajay Kumar To: u-boot@lists.denx.de, mk7.kang@samsung.com, dh09.lee@samsung.com Date: Mon, 30 Sep 2013 16:50:50 +0530 Message-id: <1380540055-469-2-git-send-email-ajaykumar.rs@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1380540055-469-1-git-send-email-ajaykumar.rs@samsung.com> References: <1380540055-469-1-git-send-email-ajaykumar.rs@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHLMWRmVeSWpSXmKPExsWyRsSkSndVpGeQwYRGQYvr5+0sJt2fwGLR caSF0eLnpDmsFm/3drI7sHpMnLiO0ePsnR2MHn1bVjEGMEdx2aSk5mSWpRbp2yVwZTw+q13w Xr6iafdm1gbGi1JdjJwcEgImEmcOT2KGsMUkLtxbzwZiCwksZZT4PdcCpmZ9z3VWiPgiRolX hzwg7NlMEgdn2YDYbALaEtum32QBsUUEXCTWzOxhBLGZBTQlPry+BzZfWMBOou/ZabA5L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kJ5akZqemFqQWwWxh4uCUamDMczwQz2uyP7bgh1OAY/ilCK9t aWbce64rhN8/UlsTqHk7StfybPuZtoX+TlvFhHlr+S+L7J51vsP1ZadDc6fHqwZXuVbuxCgN VV7RIF3BYlHpL/P3mZ+OvmV+y+vggiflMw7OVVZco7xVbX1b+64pR+Q2KRdNzjTPuXJFPPmp 8+blFWGTVymxFGckGmoxFxUnAgCfIFHv0AIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: inki.dae@samsung.com, sjg@chomium.org Subject: [U-Boot] [PATCH 1/6] 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 --- 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_BPP LCD_COLOR16 #endif #endif /* __CONFIG_5250_H */