Date: Fri, 30 Oct 2015 00:24:37 +0000 (UTC) From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290171 - head/sys/arm/broadcom/bcm2835 Message-ID: <201510300024.t9U0ObWP097973@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510300024.t9U0ObWP097973>