From patchwork Sun Oct 17 07:48:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 12564079 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7735FC433F5 for ; Sun, 17 Oct 2021 07:52:09 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DF51260F11 for ; Sun, 17 Oct 2021 07:52:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DF51260F11 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:55950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mc0xf-0000OV-TZ for qemu-devel@archiver.kernel.org; Sun, 17 Oct 2021 03:52:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mc0wP-0007rm-QO; Sun, 17 Oct 2021 03:50:45 -0400 Received: from gate.crashing.org ([63.228.1.57]:35541) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mc0wN-00036Q-Hb; Sun, 17 Oct 2021 03:50:45 -0400 Received: from ip6-localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 19H7mXLp021689; Sun, 17 Oct 2021 02:48:34 -0500 Message-ID: <5283e2811498034cc2de77f10eb16b9cd67a0698.camel@kernel.crashing.org> Subject: [PATCH 1/2] hw/misc/bcm2835_property: Fix framebuffer with recent RPi kernels From: Benjamin Herrenschmidt To: qemu-devel@nongnu.org Date: Sun, 17 Oct 2021 18:48:32 +1100 User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Received-SPF: pass client-ip=63.228.1.57; envelope-from=benh@kernel.crashing.org; helo=gate.crashing.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, Alex =?iso-8859-1?q?Benn=E9e?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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) 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 Reviewed-by: Philippe Mathieu-Daudé --- 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 */