lm32: fix vgafb baseaddress
authorMichael Walle <michael@walle.cc>
Sun, 16 May 2010 20:38:29 +0000 (22:38 +0200)
committerMichael Walle <michael@walle.cc>
Sun, 16 May 2010 20:38:29 +0000 (22:38 +0200)
The vgafb base address is relative to the SDRAM base address.

umon_ports/milkymist/vgafb.c

index 5d43b06..2121a07 100644 (file)
@@ -16,7 +16,8 @@
 uchar vgafb_framebuffer[FB_SIZE*2] __attribute__((aligned(32)));
 
 void fbdev_init(void) {
-       VGAFB_BASEADDRESS = (unsigned int)vgafb_framebuffer;
+       //VGAFB_BASEADDRESS = (unsigned int)vgafb_framebuffer;
+       VGAFB_BASEADDRESS = (unsigned int)vgafb_framebuffer & 0x7ffffff;
        VGAFB_HRES = PIXELS_PER_ROW;
        VGAFB_VRES = PIXELS_PER_COL;
        VGAFB_CONTROL = 0;
@@ -26,7 +27,7 @@ void fbdev_setstart(long addr) {
        /* The baseaddress has to be 32 byte aligned. For common screen
         * resolutions this requirement is met if the addr points to the
         * beginning of a row. */
-       VGAFB_BASEADDRESS = (unsigned int)addr;
+       VGAFB_BASEADDRESS = (unsigned int)addr & 0x7ffffff;
 }
 
 #endif