From mboxrd@z Thu Jan 1 00:00:00 1970 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 70C4CC0015E for ; Tue, 1 Aug 2023 14:04:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CE67B86C7E; Tue, 1 Aug 2023 16:04:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com 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=ti.com header.i=@ti.com header.b="ZrayLksF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8DF5486AB7; Tue, 1 Aug 2023 16:04:25 +0200 (CEST) Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EFD6386AB7 for ; Tue, 1 Aug 2023 16:04:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=devarsht@ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 371E4HUX050692; Tue, 1 Aug 2023 09:04:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1690898657; bh=opFlhPY3To1X+55c5pVpcTLSjyV+0c/C2oXN3rs+YKA=; h=From:To:CC:Subject:Date; b=ZrayLksFkezfbrN8UXR1AlHYCnPBxslhbFoylnJS07/jYcCMiWcMbb+8p3K45wctO HE4+Hd6Dfm005UZwuyF9vK+TQGoD9sVqdZ4wWmtpRlP3PwcOzUXBwHd2+Dg1aAfuw7 FUbaUoM/wJOo3ZYnfVYusk9hpkuQRJhgIU48eK0M= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 371E4Haj020773 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 1 Aug 2023 09:04:17 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 1 Aug 2023 09:04:16 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 1 Aug 2023 09:04:15 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 371E4FO8023760; Tue, 1 Aug 2023 09:04:15 -0500 From: Devarsh Thakkar To: , , , , CC: , , , , , , Subject: [PATCH] common: board_f: Move relocation address after framebuffer Date: Tue, 1 Aug 2023 19:34:14 +0530 Message-ID: <20230801140414.76216-1-devarsht@ti.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean When passing framebuffer address using bloblist, check that passed address is overlapping with current relocation address, if so move the relocation address after the framebuffer region to avoid overlap. Fixes: 5bc610a7d9d ("common: board_f: Pass frame buffer info from SPL to u-boot") Signed-off-by: Devarsh Thakkar --- common/board_f.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/board_f.c b/common/board_f.c index 7d2c380e91..20fa17207a 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -419,7 +419,10 @@ static int reserve_video(void) if (!ho) return log_msg_ret("blf", -ENOENT); video_reserve_from_bloblist(ho); - gd->relocaddr = ho->fb; + /* Relocate after framebuffer area to avoid overlap */ + if (gd->relocaddr > (unsigned long)ho->fb) + gd->relocaddr = ho->fb; + } else if (CONFIG_IS_ENABLED(VIDEO)) { ulong addr; int ret; -- 2.34.1