Hi Benjamin, On 10/17/21 09:48, Benjamin Herrenschmidt wrote: > The framebuffer driver fails to initialize with recent Raspberry Pi > kernels, such as the ones shipped in the current RaspiOS images > (with the out of tree bcm2708_fb.c driver)
Which particular version? > > The reason is that this driver uses a new firmware call to query the > number of displays, and the fallback when this call fails is broken. > > So implement the call and claim we have exactly one display > > Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> > --- > hw/misc/bcm2835_property.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c > index 73941bdae9..b958fa6a5c 100644 > --- a/hw/misc/bcm2835_property.c > +++ b/hw/misc/bcm2835_property.c > @@ -269,6 +269,10 @@ static void > bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) > stl_le_phys(&s->dma_as, value + 12, 0); > resplen = 4; > break; > + case 0x00040013: /* Get num displays */ > + stl_le_phys(&s->dma_as, value + 12, 1); > + resplen = 4; > + break; > > case 0x00060001: /* Get DMA channels */ > /* channels 2-5 */ > I carry (among others) this patch for the raspi4: -- >8 -- diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index 3b3f5a804d9..8bd149211af 100644 --- a/hw/misc/bcm2835_property.c +++ b/hw/misc/bcm2835_property.c @@ -36,6 +36,7 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) */ BCM2835FBConfig fbconfig = s->fbdev->config; bool fbconfig_updated = false; + int fbconfig_idx = 0; value &= ~0xf; @@ -290,6 +291,25 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) resplen = 4; break; + case 0x00040013: /* Get number of displays */ + stl_le_phys(&s->dma_as, value + 12, 0 /* old fw: unique display */); + resplen = 4; + break; + + case 0x00048013: /* Select display */ + fbconfig_idx = ldl_le_phys(&s->dma_as, value + 12); + if (fbconfig_idx) { + qemu_log_mask(LOG_GUEST_ERROR, + "bcm2835_property: Only one display implemented," + " requested display #%d\n", fbconfig_idx); + } + resplen = 4; + break; + + case 0x00040014: /* Get display settings */ + resplen = 0; /* as old fw we don't support that */ + break; + case 0x00060001: /* Get DMA channels */ /* channels 2-5 */ stl_le_phys(&s->dma_as, value + 12, 0x003C); --- FYI I plan to respin Alex's recent series with these patches: https://lore.kernel.org/qemu-devel/20211004134742.2044280-1-alex.ben...@linaro.org/ as soon as I get some time...