]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
video: bcm2835: fix build issues
authorAnatolij Gustschin <agust@denx.de>
Fri, 29 Mar 2013 13:00:13 +0000 (14:00 +0100)
committerAnatolij Gustschin <agust@denx.de>
Fri, 29 Mar 2013 13:29:39 +0000 (14:29 +0100)
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
drivers/video/bcm2835.c

index b98eea669692a977c5a7684e81b56e5328d8111b..edae835fb0be1e6eb1fccdbf373b42dfc588ee31 100644 (file)
@@ -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;
index 1e9a84ac1ff4ff0226eaf3f294214bbf611a272d..0c77d17b444278a202d83d21dce2edcdd5386edc 100644 (file)
 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)