public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] video: bcm2835: fix build issues
@ 2013-03-29 13:10 Anatolij Gustschin
  2013-03-29 13:34 ` Anatolij Gustschin
  0 siblings, 1 reply; 4+ messages in thread
From: Anatolij Gustschin @ 2013-03-29 13:10 UTC (permalink / raw)
  To: u-boot

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 <agust@denx.de>
Cc: Stephen Warren <swarren@wwwdotorg.org>
---
 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)
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] video: bcm2835: fix build issues
  2013-03-29 13:10 [U-Boot] [PATCH] video: bcm2835: fix build issues Anatolij Gustschin
@ 2013-03-29 13:34 ` Anatolij Gustschin
  2013-04-02  2:54   ` Stephen Warren
  0 siblings, 1 reply; 4+ messages in thread
From: Anatolij Gustschin @ 2013-03-29 13:34 UTC (permalink / raw)
  To: u-boot

On Fri, 29 Mar 2013 14:10:09 +0100
Anatolij Gustschin <agust@denx.de> wrote:

> 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 <agust@denx.de>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> ---
>  common/lcd.c            |   12 ++++++++++++
>  drivers/video/bcm2835.c |   11 -----------
>  2 files changed, 12 insertions(+), 11 deletions(-)

applied to u-boot-video/master.

Anatolij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] video: bcm2835: fix build issues
  2013-03-29 13:34 ` Anatolij Gustschin
@ 2013-04-02  2:54   ` Stephen Warren
  2013-04-02  4:22     ` Anatolij Gustschin
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Warren @ 2013-04-02  2:54 UTC (permalink / raw)
  To: u-boot

On 03/29/2013 07:34 AM, Anatolij Gustschin wrote:
> On Fri, 29 Mar 2013 14:10:09 +0100
> Anatolij Gustschin <agust@denx.de> wrote:
> 
>> 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 <agust@denx.de>
>> Cc: Stephen Warren <swarren@wwwdotorg.org>
>> ---
>>  common/lcd.c            |   12 ++++++++++++
>>  drivers/video/bcm2835.c |   11 -----------
>>  2 files changed, 12 insertions(+), 11 deletions(-)
> 
> applied to u-boot-video/master.

FYI, I just tested these patches as they exist in u-boot/master, and the
RPi "LCD" support still works fine after these patches. Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] video: bcm2835: fix build issues
  2013-04-02  2:54   ` Stephen Warren
@ 2013-04-02  4:22     ` Anatolij Gustschin
  0 siblings, 0 replies; 4+ messages in thread
From: Anatolij Gustschin @ 2013-04-02  4:22 UTC (permalink / raw)
  To: u-boot

On Mon, 01 Apr 2013 20:54:25 -0600
Stephen Warren <swarren@wwwdotorg.org> wrote:
...
> FYI, I just tested these patches as they exist in u-boot/master, and the
> RPi "LCD" support still works fine after these patches. Thanks.

Thanks for testing!

Anatolij

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-04-02  4:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-29 13:10 [U-Boot] [PATCH] video: bcm2835: fix build issues Anatolij Gustschin
2013-03-29 13:34 ` Anatolij Gustschin
2013-04-02  2:54   ` Stephen Warren
2013-04-02  4:22     ` Anatolij Gustschin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox