From patchwork Mon Aug 26 11:59:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 822458 Delivered-To: patch@linaro.org Received: by 2002:adf:e044:0:b0:367:895a:4699 with SMTP id w4csp1478624wrh; Mon, 26 Aug 2024 05:04:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVMN86JSLf+H7EdIevgu4LXEO0GIMdt/cjX5HsxQcODZo7R5BlsenprF8TJdMWYpNjOeOyYWw==@linaro.org X-Google-Smtp-Source: AGHT+IE+N2kyi/mBr+baMdVDxWLAYSMg4PGj2EINipDzUHoBw/QHpelXRPcUPyQyVDu5VyTzRYpK X-Received: by 2002:a05:6000:402a:b0:368:3717:10c7 with SMTP id ffacd0b85a97d-37311841b20mr7576162f8f.4.1724673853451; Mon, 26 Aug 2024 05:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724673853; cv=none; d=google.com; s=arc-20160816; b=paqMwurWnirDbUCtAdnq5qwVj4hZyUwaCyMBxm9Tt4mf9TlE9uIIRkd2ZYyo9KAGDM WtNraMlIkFY/EWiwzVQZfUD+SS33juaCM0l5plowY+bh/IhfcRR0ykFPxhH6zxN+LYVj 3x68lp6e1KgFSmW+RoKIqhb0tj8bTD2rjlb84LQohgG7pJ2u25RwsblJF/NaZT4ARXXh CjuIMyP5fhZtZthwG5mgDLB/+mhAjh2rzJdJFJLtqKSJsIepChCpMHEHM03L1jklM9mt I0vCxlP7A/xitAIgn2/J/Jjxlga70mnH7gsyjomQ1YomqWypf5+G6TPnzQh3n8ttG0/6 M60A== 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=16NGe1lGOXj8l7nFd4AgccHG9cka3VEb/13iIOUFJy8=; fh=8IbOOFAUJYCfGYrzM0jWqtoOP7AaZuPOmdHZ5mvNk1Q=; b=h8DO0DSyXnNhzjpfkK/HAZLxv9mBo2feGvYGEr6et11c3VYIwkjoC5Lqjt0NjcOXZB z8ZfAn9ljhj36lLs92U4bE8/cIXQxaVkKfuH9Mm0NXPgd6lmuncRb8fBCjkAPGFbKYdv hUZcGi9JGx8CwiDex9Bc0fpCsXZLlJ6D6aYrY9TeNa57b1Qy8rIaNP4aV/OBT+OCo6+P Np7LgqbG0KonnzoSWrQbyqijb6lQT80wy46stC1ZkX6U7JyYztxzOegKkJIXECmf07jt q3cCHZgOWB5Vgm1SZHn7GXIFNhdsNpHS7NcCQvH+83PMkV1/7BnXDwhtqV4MEP/7ZF4h zeUQ==; 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 ffacd0b85a97d-37308118102si3794458f8f.12.2024.08.26.05.04.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 05:04:13 -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 F2C6C88A2E; Mon, 26 Aug 2024 14:01:50 +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 AE4F588905; Mon, 26 Aug 2024 14:01:50 +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 AEBB588A2E for ; Mon, 26 Aug 2024 14:01:48 +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 5B49A11FB; Mon, 26 Aug 2024 05:02:14 -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 7680F3F762; Mon, 26 Aug 2024 05:01:44 -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 , =?utf-8?q?Marek_Beh=C3=BAn?= , Sughosh Ganu Subject: [PATCH v4 24/27] zynq: lmb: do not add to lmb map before relocation Date: Mon, 26 Aug 2024 17:29:37 +0530 Message-Id: <20240826115940.3233167-25-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826115940.3233167-1-sughosh.ganu@linaro.org> References: <20240826115940.3233167-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 V3: 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)