From patchwork Wed Aug 21 10:58:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 820974 Delivered-To: patch@linaro.org Received: by 2002:adf:e98a:0:b0:367:895a:4699 with SMTP id h10csp641066wrm; Wed, 21 Aug 2024 04:03:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW58PCvtEcKpgv3GUyX4s3lV8qrvYaOX/TBWhUTSJfL8SBAroyWqYLDrDAMjYGJbXxkXWiIMA==@linaro.org X-Google-Smtp-Source: AGHT+IGqNJJ7QkFMy6sqduOTqJO479H6yoOPVI8+UncBnQg05MHjEKIVkJ0HIWQ+oZyvk3IJpNEt X-Received: by 2002:a17:906:fd86:b0:a7d:a453:dba1 with SMTP id a640c23a62f3a-a867003ae11mr187845366b.20.1724238190505; Wed, 21 Aug 2024 04:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724238190; cv=none; d=google.com; s=arc-20160816; b=u10+JDjo7TdZGcyGW4WZ+pu29171mWa0Y0GG8rgU/nG+KloIN+aqZioXlhHZI7Y+jb 9732m8rI06DDiXb7d4WCm1ZIvHefMaeNxlhWKQMGBKWQqLwAFvlBETQVhfeW6F+gP1YS iCt6sw1DNV+xajOnc/JEcXV5WSY3MgEJ2IKbi0lvlEiNoyBYGaR6SCOgtuxVWcgE5kx8 4ysXC8/c8SOtG6NEthuK66felSnVJYQEsiJznnj+rHlzd78r8NKW2J0t48jZ0D54mvJp vAu2jwSt3IxszmGHQyMmkDRL+XbE1SgM+KrQIoRPG7rDJabtdVHfFO+j8W4FVjyYjnFS dCGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=yu0yMUr9Piud49Hg9M9pa9MRn592AI6t5nqNdkqWlvk=; fh=pnMZGD6unUPoMrkOwzXlkuYg+kVwGnSNRCTlQoWqjVc=; b=r2kJVBY6HXqLzHXzHlxoZT+nzvHYUsMQ6toWnwpRfNZEJdPhjLUtiA5PC3k9e7Ajst ITPsmwv7tLJByUKy0Tbc+vtPRA/snjNRRwKrJJB2MM7mt36Vi7OrlYjpnX/S4gpWWXLR YjS6E6HpwQayFsqa1K/9k2ryz+UqP4jx6F8gpNPLHdoI4v+c6OneZolplPuaAE6b6VkJ ogvtpOjP4ArvrMnH3RijPqkLz+CXqj3zD2qULenYsawCIhiGaFMAdhEssq3SMOGqkMoG k6ZP+msX5ILlSHNKK5U3yfk7Ngwpm1vcZA/9nR+FkBYfIm2Ickr3H58EjWjpO4FcNLoI k/GQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id a640c23a62f3a-a86801f0d32si30963466b.765.2024.08.21.04.03.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 04:03:10 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 83C4088C52; Wed, 21 Aug 2024 13:00:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 4855588DDD; Wed, 21 Aug 2024 13:00:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 5043288DC6 for ; Wed, 21 Aug 2024 13:00:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D7F9ADA7; Wed, 21 Aug 2024 04:00:56 -0700 (PDT) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 754A03F73B; Wed, 21 Aug 2024 04:00:27 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Heinrich Schuchardt , Marek Vasut , Mark Kettenis , Michal Simek , Patrick DELAUNAY , Patrice CHOTARD , Sughosh Ganu Subject: [PATCH v3 24/27] zynq: lmb: do not add to lmb map before relocation Date: Wed, 21 Aug 2024 16:28:36 +0530 Message-Id: <20240821105839.2870293-25-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240821105839.2870293-1-sughosh.ganu@linaro.org> References: <20240821105839.2870293-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 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 The LMB memory is typically not needed very early in the platform's boot. Do not add memory to the LMB map before relocation. Reservation of common areas and adding of memory is done after relocation. Signed-off-by: Sughosh Ganu --- Changes since V2: None board/xilinx/common/board.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index f04c92a70f..3440402ab4 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -665,36 +664,6 @@ int embedded_dtb_select(void) } #endif -#if IS_ENABLED(CONFIG_LMB) - -#ifndef MMU_SECTION_SIZE -#define MMU_SECTION_SIZE (1 * 1024 * 1024) -#endif - -phys_addr_t board_get_usable_ram_top(phys_size_t total_size) -{ - phys_size_t size; - phys_addr_t reg; - - if (!total_size) - return gd->ram_top; - - if (!IS_ALIGNED((ulong)gd->fdt_blob, 0x8)) - panic("Not 64bit aligned DT location: %p\n", gd->fdt_blob); - - /* found enough not-reserved memory to relocated U-Boot */ - lmb_add(gd->ram_base, gd->ram_size); - boot_fdt_add_mem_rsv_regions((void *)gd->fdt_blob); - size = ALIGN(CONFIG_SYS_MALLOC_LEN + total_size, MMU_SECTION_SIZE); - reg = lmb_alloc(size, MMU_SECTION_SIZE); - - if (!reg) - reg = gd->ram_top - size; - - return reg + size; -} -#endif - #ifdef CONFIG_OF_BOARD_SETUP #define MAX_RAND_SIZE 8 int ft_board_setup(void *blob, struct bd_info *bd)