]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Fix framebuffer compatibility with new RPi firmware. Framebuffer driver
authorgonzo <gonzo@FreeBSD.org>
Fri, 30 Oct 2015 00:24:37 +0000 (00:24 +0000)
committergonzo <gonzo@FreeBSD.org>
Fri, 30 Oct 2015 00:24:37 +0000 (00:24 +0000)
receives video memory address from VideoCore through property mailbox
channel. Older versions of firmware (and the one that is currently part
of sysutils/u-boot-rpi and sysutils/u-boot-rpi2) returned real physical
address, newer one returns VideoCore bus address, so we need to convert
it to actual physical address. this version works with both older and
newer interface.

sys/arm/broadcom/bcm2835/bcm2835_mbox.c
sys/arm/broadcom/bcm2835/bcm2835_vcbus.h

index 5940ad66a24109f923bf35930ddd6c9d0ba4ed1e..78384ebc9236fb81f0c74b0ce88372ec7a1d1f74 100644 (file)
@@ -577,7 +577,7 @@ bcm2835_mbox_fb_init(device_t dev, struct bcm2835_fb_config *fb)
                fb->xoffset = msg->offset.body.resp.x;
                fb->yoffset = msg->offset.body.resp.y;
                fb->pitch = msg->pitch.body.resp.pitch;
-               fb->base = msg->buffer.body.resp.fb_address;
+               fb->base = VCBUS_TO_PHYS(msg->buffer.body.resp.fb_address);
                fb->size = msg->buffer.body.resp.fb_size;
        }
 
index 7b79b1ab5ea41f55b037065d35cedef3e7476947..e1d44b31f76da27dc8329fc9698697fdb8aa0cf5 100644 (file)
@@ -67,6 +67,6 @@
  * when address is returned by VC over mailbox interface. e.g.
  * framebuffer base
  */
-#define        VCBUS_TO_PHYS(vca)      ((vca) - BCM2835_VCBUS_SDRAM_BASE)
+#define        VCBUS_TO_PHYS(vca)      ((vca) & ~(BCM2835_VCBUS_SDRAM_BASE))
 
 #endif /* _BCM2835_VCBUS_H_ */