svn commit: r290171 - head/sys/arm/broadcom/bcm2835
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Fri Oct 30 00:24:38 UTC 2015
Author: gonzo
Date: Fri Oct 30 00:24:37 2015
New Revision: 290171
URL: https://svnweb.freebsd.org/changeset/base/290171
Log:
Fix framebuffer compatibility with new RPi firmware. Framebuffer driver
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.
Modified:
head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h
Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Thu Oct 29 23:56:34 2015 (r290170)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Fri Oct 30 00:24:37 2015 (r290171)
@@ -577,7 +577,7 @@ bcm2835_mbox_fb_init(device_t dev, struc
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;
}
Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Thu Oct 29 23:56:34 2015 (r290170)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Fri Oct 30 00:24:37 2015 (r290171)
@@ -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_ */
More information about the svn-src-all
mailing list