diff options
author | gonzo <gonzo@FreeBSD.org> | 2015-10-30 00:24:37 +0000 |
---|---|---|
committer | gonzo <gonzo@FreeBSD.org> | 2015-10-30 00:24:37 +0000 |
commit | 9c5daacfac459a36a56934429a7c9e4ed43f4150 (patch) | |
tree | 5b3b8126fc3d0adcdcf43ca07924bbdf14a38b4b /sys/arm | |
parent | 3d9be43e024bd23c162cabec70f4565a6198fb85 (diff) | |
download | FreeBSD-src-9c5daacfac459a36a56934429a7c9e4ed43f4150.zip FreeBSD-src-9c5daacfac459a36a56934429a7c9e4ed43f4150.tar.gz |
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.
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/broadcom/bcm2835/bcm2835_mbox.c | 2 | ||||
-rw-r--r-- | sys/arm/broadcom/bcm2835/bcm2835_vcbus.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_mbox.c b/sys/arm/broadcom/bcm2835/bcm2835_mbox.c index 5940ad6..78384eb 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_mbox.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_mbox.c @@ -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; } diff --git a/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h b/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h index 7b79b1a..e1d44b3 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h +++ b/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h @@ -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_ */ |