From patchwork Fri Mar 29 13:10:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 232400 X-Patchwork-Delegate: agust@denx.de 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 6DEB02C008D for ; Sat, 30 Mar 2013 00:10:13 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 391CE4A0C6; Fri, 29 Mar 2013 14:10:09 +0100 (CET) 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 vU5D1z1Nk+z4; Fri, 29 Mar 2013 14:10:09 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B1CAA4A025; Fri, 29 Mar 2013 14:10:07 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 74A9E4A025 for ; Fri, 29 Mar 2013 14:10:06 +0100 (CET) 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 Ak96RkLc3bWm for ; Fri, 29 Mar 2013 14:10:04 +0100 (CET) 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 mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by theia.denx.de (Postfix) with ESMTPS id 4B0CD4A023 for ; Fri, 29 Mar 2013 14:10:03 +0100 (CET) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3ZcjwV2qDLz4KK2h; Fri, 29 Mar 2013 14:10:02 +0100 (CET) X-Auth-Info: nsYJOe4QPt7L0vJMtfvCk9CnQ5045QaLwOGWFx+dRfY= Received: from localhost (pD9E2FE2C.dip.t-dialin.net [217.226.254.44]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 3ZcjwV16QQzbd6T; Fri, 29 Mar 2013 14:10:02 +0100 (CET) From: Anatolij Gustschin To: u-boot@lists.denx.de Date: Fri, 29 Mar 2013 14:10:09 +0100 Message-Id: <1364562609-25154-1-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.5.4 Subject: [U-Boot] [PATCH] video: bcm2835: fix build issues 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 After merging LCD patches for v2013.04 the bcm2835 video driver building is broken due to removal of many global variables. Fix the driver. Signed-off-by: Anatolij Gustschin Cc: Stephen Warren --- common/lcd.c | 12 ++++++++++++ drivers/video/bcm2835.c | 11 ----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/common/lcd.c b/common/lcd.c index b98eea6..b81be31 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -493,6 +493,18 @@ static int lcd_init(void *lcdbase) debug("[LCD] Initializing LCD frambuffer at %p\n", lcdbase); lcd_ctrl_init(lcdbase); + + /* + * lcd_ctrl_init() of some drivers (i.e. bcm2835 on rpi_b) ignores + * the 'lcdbase' argument and uses custom lcd base address + * by setting up gd->fb_base. Check for this condition and fixup + * 'lcd_base' address. + */ + if ((unsigned long)lcdbase != gd->fb_base) + lcd_base = (void *)gd->fb_base; + + debug("[LCD] Using LCD frambuffer at %p\n", lcd_base); + lcd_get_size(&lcd_line_length); lcd_line_length = (panel_info.vl_col * NBITS(panel_info.vl_bpix)) / 8; lcd_is_enabled = 1; diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c index 1e9a84a..0c77d17 100644 --- a/drivers/video/bcm2835.c +++ b/drivers/video/bcm2835.c @@ -23,17 +23,7 @@ DECLARE_GLOBAL_DATA_PTR; /* Global variables that lcd.c expects to exist */ -int lcd_line_length; -int lcd_color_fg; -int lcd_color_bg; -void *lcd_base; -void *lcd_console_address; -short console_col; -short console_row; vidinfo_t panel_info; -char lcd_cursor_enabled; -ushort lcd_cursor_width; -ushort lcd_cursor_height; struct msg_query { struct bcm2835_mbox_hdr hdr; @@ -119,7 +109,6 @@ void lcd_ctrl_init(void *lcdbase) panel_info.vl_bpix = LCD_COLOR16; gd->fb_base = msg_setup->allocate_buffer.body.resp.fb_address; - lcd_base = (void *)gd->fb_base; } void lcd_enable(void)