From patchwork Fri Jun 7 18:52:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 802330 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp949538wro; Fri, 7 Jun 2024 11:56:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUTC7J1BhOS3/R+Nx6tvsXkhamxo83fNYeq54msbiaEUg9tBMgCGlYpO3u1/OaAylvBteRWYJzjot/k88C9/CeU X-Google-Smtp-Source: AGHT+IH4mZfyrPYsXQrQz3c73/CyAj59VHuEsyKUrjhly9iElxe3rH6A43xPAEy8TwStCKu/M1kL X-Received: by 2002:a17:906:4411:b0:a68:bdab:48e4 with SMTP id a640c23a62f3a-a6cd5611c18mr222650266b.1.1717786612568; Fri, 07 Jun 2024 11:56:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717786612; cv=none; d=google.com; s=arc-20160816; b=ioQpc/RkPML+WdgqprTUOzTdSqG33UbLwVjH/u8GYi/h802vyGznuftqTRknekVLW7 LyJv41wbg/gsrjZC5nxdssMWmN7az/D9XQG3MflBj2YsuU3cnoTtfDmop40g0edmoZOE WWJWVHZgBHyyUi+uY+u7zwp/bLPo3LXWzS2AgZAU//gWHVykWfk2oDfAWpDL2fj128g5 TtugnCkv2PPcjKZw7EF7fxdVFEZpwtKH1c9Z2au4Zrlg1p39BbxKjH8eAYM/oNLaPMYi LSmOfSGYVl1LrZhclOMUJKWbYeBpwjAD5ajBAs+3jXXLwr34mm4ES/hAYjOSdh/fkh1c 5k6w== 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=6U7eg69+7IaRKDpFAIe8asEFyIEeaJwfCP4MfMSeQcQ=; fh=xLSOOz5Q0Mrmzd+lwBRTYS7D/8TpUWM8TEHgIjpMzow=; b=Icj46tzH1V1zzCxhegtqxrGVwtXt/b7E8CGfqekzSR+drLMlMEwg6qa7GJbp9l5y0r 1koBAtHYf90XPbXWqb+TM2dL4enEikvumq3KK86tO0dsIR/ItE9NaQirplRcWG8KZ+Zt 3P4GytpYf0HsYXW8VlvchxMWcDTexR/+zxE43SwBltA4Y1U6u1qVpLI6kYyajTntF+zf 5zlH44V2fT7N5pIv4vDBgeLH5opK4KriKF/YxyNLB0TgrtVQZ54FcTO8LPMjIOTitXnW xq0qagWmUpm1jrgEQQ1a9YC9/xJNUkKl4/Dq4o5QtEdgXf3rUqTN8d6ptTQTXCtUBVhn ztlg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id a640c23a62f3a-a6ef6790f89si39969366b.8.2024.06.07.11.56.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 11:56:52 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 299E88853E; Fri, 7 Jun 2024 20:54:38 +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 1496B88528; Fri, 7 Jun 2024 20:54:37 +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 22A6388470 for ; Fri, 7 Jun 2024 20:54:35 +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 DD56B1480; Fri, 7 Jun 2024 11:54:58 -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 5705F3F792; Fri, 7 Jun 2024 11:54:31 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Tom Rini , Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Marek Vasut , Mark Kettenis , Fabio Estevam , Sughosh Ganu Subject: [RFC PATCH 19/31] zynq: lmb: do not add to lmb map before relocation Date: Sat, 8 Jun 2024 00:22:28 +0530 Message-Id: <20240607185240.1892031-20-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607185240.1892031-1-sughosh.ganu@linaro.org> References: <20240607185240.1892031-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 --- 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 7be1b6e511..38967fc705 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -666,36 +665,6 @@ int embedded_dtb_select(void) } #endif -#if defined(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)