From patchwork Thu Jul 4 07:35:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 809934 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp1043363wru; Thu, 4 Jul 2024 00:41:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV2R3lR58OG2hM6LLg6aTLa9wX7+xYxMBSt2ATM2SLFeo1E+//PZBE1WFmtJIhnDXfExq9Dw7hxENf1OZRfxyOz X-Google-Smtp-Source: AGHT+IGmCwOHyKaBI213qOz5MhpBK3+n24FhIF0lG7C7FK3XyiC3+iy/0Kp0GafM0/KYURf0+tJS X-Received: by 2002:a05:6402:d07:b0:57d:ef3:c3b7 with SMTP id 4fb4d7f45d1cf-58e5cd125f8mr513839a12.36.1720078875888; Thu, 04 Jul 2024 00:41:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720078875; cv=none; d=google.com; s=arc-20160816; b=de3amvWKkBED/8lkfg+INDfilZQSnH+l776UnHRIJ+XEJ5H6TIwD3k73c5yAKJkdpq N4D5NH1WKPDyUYKXW2jiEQ+0UtZ0LC106UTp8+BOeQh+jpup3VFNBkKvoJQ77yUxFZtG 2oFMTeZJvgJ4+X2o0W3MVo/dsK/iZx3D426xNY+MZIqhg4MgcRNnTpk6z5U59WVGQV6+ wIEeGoIfu65iBGIHbXQAhK8tC/aIURc/pucQ4Hyz0rEMG067kt+1kAiA09M1w+wYMKne qEZwuWQ4Gdp1rDRtiBMYZ2BhDL8vQ7+a7Y9BKRn4NTydx4lSBEyPIFVJVrH0jDaS7rn8 g9Eg== 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=XZE+y8NzmQ+RrELtMf8x6qLKw/FE1EHqupzc2EVQeWM=; fh=ez1zzjhC0XWyqTp7tWutqrA/nFdALDnQKrnQnXYhk5Q=; b=yK9W3NQU1uacbHW1/Im+6e0laBpQ+y9L18GwLZlz8YpTr24oHDUpFzzM/LyJ8ck/L0 K7O5GFSF80FudP51Efer7H8IkomWaqBqORxjzP8wE1kemzPz+zMTUU8BRCcdmr2cQlQ/ W0uv34/ZZUim9p1kpkc6mN13zmBsqXYO6iZkrn5T94h3uS933KDalHC9YpUjftIJDTTA lF9NqDZoNsgLiRpktbW425K675bGpe0+Lnqr1AqP9MccMaNHv3W5HwmU/SUM3HMKT7OF xYnYKoumIXlLj11VG3QGx+dq7UXt5kBGp9sI4Qzrle2SSMqdFiYV2Omb5WvDHHMFoIfT xvpg==; 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 4fb4d7f45d1cf-58e1f5f73e2si566619a12.285.2024.07.04.00.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:41:15 -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 90635888A0; Thu, 4 Jul 2024 09:37:47 +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 3F8E38889D; Thu, 4 Jul 2024 09:37:46 +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 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 0DC5C8892C for ; Thu, 4 Jul 2024 09:37:44 +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 84DF3367; Thu, 4 Jul 2024 00:38:08 -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 616E03F762; Thu, 4 Jul 2024 00:37:40 -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 , Michal Simek , Sughosh Ganu Subject: [RFC PATCH v2 27/48] zynq: lmb: do not add to lmb map before relocation Date: Thu, 4 Jul 2024 13:05:23 +0530 Message-Id: <20240704073544.670249-28-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240704073544.670249-1-sughosh.ganu@linaro.org> References: <20240704073544.670249-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 V1: 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)