From: Frederik van Hövell <[email protected]> The value is used as framebuffer base address, but seen from the VideoCore[4-6] processor view of memory. This GPU view uses an offset of 0xc0000000 (i.e. bits 30 and 31 always set to 1), compared to the CPU memory view. Above interpretation can be found in below kernels: - UEFI firmware [edk2-platforms](https://github.com/tianocore/edk2-platforms/blob/306137738faf9f31eba9823d0f818397755cedaf/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c#L1045) - [Upstream linux](https://github.com/torvalds/linux/blob/0031c06807cfa8aa51a759ff8aa09e1aa48149af/drivers/gpu/drm/vc4/vc4_drv.c#L312) - [RaspberryPi linux](https://github.com/raspberrypi/linux/blob/3e44c7fdf879208adf51be589d60962269d25d18/drivers/video/fbdev/bcm2708_fb.c#L464C1-L466C29)
Signed-off-by: Frederik van Hövell <[email protected]> --- hw/misc/bcm2835_property.c | 3 ++- include/hw/display/bcm2835_fb.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index 216a746c2bd..a90c7e6c863 100644 --- a/hw/misc/bcm2835_property.c +++ b/hw/misc/bcm2835_property.c @@ -168,7 +168,8 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) /* Frame buffer */ case RPI_FWREQ_FRAMEBUFFER_ALLOCATE: - stl_le_phys(&s->dma_as, value + 12, fbconfig.base); + stl_le_phys(&s->dma_as, value + 12, + fbconfig.base | BCM2836_DMA_DEVICE_OFFSET); stl_le_phys(&s->dma_as, value + 16, bcm2835_fb_get_size(&fbconfig)); resplen = 8; diff --git a/include/hw/display/bcm2835_fb.h b/include/hw/display/bcm2835_fb.h index f7ef076f1f4..bcc87ad5390 100644 --- a/include/hw/display/bcm2835_fb.h +++ b/include/hw/display/bcm2835_fb.h @@ -15,7 +15,8 @@ #include "hw/core/sysbus.h" #include "qom/object.h" -#define UPPER_RAM_BASE 0x40000000 +#define UPPER_RAM_BASE 0x40000000 +#define BCM2836_DMA_DEVICE_OFFSET 0xc0000000 #define TYPE_BCM2835_FB "bcm2835-fb" OBJECT_DECLARE_SIMPLE_TYPE(BCM2835FBState, BCM2835_FB) -- 2.55.0
