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.
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;
}
* 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_ */