Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CBA6C4338F for ; Tue, 10 Aug 2021 20:05:47 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A2C5D60EBB for ; Tue, 10 Aug 2021 20:05:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A2C5D60EBB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6F5D582C04; Tue, 10 Aug 2021 22:05:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="ZkLFZw9D"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="njcaUQfG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AEAF0805E7; Tue, 10 Aug 2021 16:31:35 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 976F7800D0 for ; Tue, 10 Aug 2021 16:31:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=iivanov@suse.de Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 626B122069; Tue, 10 Aug 2021 14:31:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1628605891; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=28GtBuUQgQ9WUrdwqGlri4VctB2CSsGdIhlWdKsdE9g=; b=ZkLFZw9DcJHeSJ4sQYltGuqhi/5dc/c99nt3Vow7pt1dTgSP55iCtmsu0c820BsRSK/fk1 o8TE+5u6Te8T3NFOHJsEjIPevVrJo8WPlOxB/CcL1G9pNUOM3LgYaa3ihs9Cgh5Ca2OCs6 fKTMeSjQ7L8ZHWEN3N0g2b++xryER/c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1628605891; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=28GtBuUQgQ9WUrdwqGlri4VctB2CSsGdIhlWdKsdE9g=; b=njcaUQfG8TbTxGIIAF39F6lwVYUtu6AEOHTZlNTkDMoqLESJSHvJbDaynDgxAyW/vkZBX6 0lbRJ58VjaEnOvAQ== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 4FB3A137CA; Tue, 10 Aug 2021 14:31:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id A4krE8ONEmGWNQAAGKfGzw (envelope-from ); Tue, 10 Aug 2021 14:31:31 +0000 From: "Ivan T. Ivanov" To: Matthias Brugger Cc: Nicolas Saenz Julienne , Peter Robinson , Marek Szyprowski , Jaehoon Chung , "Ivan T . Ivanov" , u-boot@lists.denx.de Subject: [PATCH] rpi: Conditionally add simple-framebuffer node Date: Tue, 10 Aug 2021 16:31:14 +0200 Message-Id: <20210810143114.32329-1-iivanov@suse.de> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Tue, 10 Aug 2021 22:05:43 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean It appears that RPi firmware has already added framebuffer node under /chosen, at least on RPi 2 versions. So check for this and don't add duplicate node. Signed-off-by: Ivan T. Ivanov --- board/raspberrypi/rpi/rpi.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index df52a4689f..372b26b6f2 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -497,12 +497,11 @@ void *board_fdt_blob_setup(void) int ft_board_setup(void *blob, struct bd_info *bd) { - /* - * For now, we simply always add the simplefb DT node. Later, we - * should be more intelligent, and e.g. only do this if no enabled DT - * node exists for the "real" graphics driver. - */ - lcd_dt_simplefb_add_node(blob); + int node; + + node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer"); + if (node < 0) + lcd_dt_simplefb_add_node(blob); #ifdef CONFIG_EFI_LOADER /* Reserve the spin table */ -- 2.32.0