From patchwork Wed Jul 24 06:02:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 814156 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2619812wro; Tue, 23 Jul 2024 23:11:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWygK8Rj0OMvPLruLwzeMtNQEC+ffaGtBgy7qGJgHrrr/E46iuAdH4QrPehqMUQysFWCj8N4Wn98QfaAHI/BEJz X-Google-Smtp-Source: AGHT+IGyKv7nrO4f936P0xxauBb0CHpFq97uAxyQcZbdBf7fkGcVN6+V6UJOSODap4JQYYdnvHcy X-Received: by 2002:adf:e689:0:b0:368:591:9bc1 with SMTP id ffacd0b85a97d-369bae6ff54mr8253285f8f.46.1721801511071; Tue, 23 Jul 2024 23:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721801511; cv=none; d=google.com; s=arc-20160816; b=yJww2WpkMbwh5reLOF5D+2B6xYQbleRsiRwCQt+Fo8eSbBzuVaF5+vfV5BWQW7DtPc Db3eqQ8XUC0Z460R2LTfGIP2LNMlTfO8UokyK0262Cu/CwKAtml7/jmRxIWzM9PMgAzY uU/0zvufoneytwY+xouIJrUtH5gHOjgGS9WScy4+cVzm17GtU2F6LeCSyuW/k3JFzgGg dfR7P3OZMo5NFc8ryqYRxpYef/aDVfiTbpQyQ8vJ4ggjwVlXV3GTRe4yqtxPoWnKh3Zp EP576yLxLsYDwUwZsPG0ETx+Wg5Nc4YsQYJAYOsHHhuf2ZZkgYdw9ccBuBfxnxFmOTjx ib7w== 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=6QRd1yLUWkD0TmWHGpLvSNN82s0ItHXPbRYvJzqxw0c=; fh=eimiGswTlodK8yi2DcDfSicmKwvq5bxKQKpD+SkkTNY=; b=u9NzBy1bf4lzRBfr3BFS7TY92eV9J+hihnWO82DPNAfVvqQbXqSV3s2igdid+qGIyJ m3tjg3AdD4GOHCIir2Y0McHOZ146oI6VgoNFPjDAtzc2Tn5bXWV44cy5OwLodkIP4oa4 zsHv+pGISJsnJAYAi/6HSQh3rVWPxIVWQp/7YkyYY478XUEnIU8cFvjFb+U8Qy6JfHWK I6ngFPKDXAm0rmG+/ejM7Cl+5hNrYgCkrzn5/jaT6a7dou914/SOZFKdOUDsZtOCvolT /JQQcfsOr69+QG72zxu+Qll8A+/RbwYTZOen3NlR+WnFmEpbdF0XgGKPAKMsuH4tNQeZ Svlw==; 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 ffacd0b85a97d-369e383230bsi1355085f8f.728.2024.07.23.23.11.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 23:11:51 -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 876C188965; Wed, 24 Jul 2024 08:05: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 5A74988896; Wed, 24 Jul 2024 08:05:47 +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.9 required=5.0 tests=BAYES_00, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, SPF_HELO_NONE,T_SPF_TEMPERROR autolearn=unavailable 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 4E1588880F for ; Wed, 24 Jul 2024 08:05:34 +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 42118153B; Tue, 23 Jul 2024 23:05:49 -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 2F2DA3F766; Tue, 23 Jul 2024 23:05:18 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Marek Vasut , Mark Kettenis , Michal Simek , Patrick DELAUNAY , Patrice CHOTARD , Huan Wang , Angelo Dureghello , Daniel Schwierzeck , Thomas Chou , Rick Chen , Max Filippov , Sughosh Ganu Subject: [PATCH 31/40] zynq: lmb: do not add to lmb map before relocation Date: Wed, 24 Jul 2024 11:32:15 +0530 Message-Id: <20240724060224.3071065-32-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240724060224.3071065-1-sughosh.ganu@linaro.org> References: <20240724060224.3071065-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 rfc: 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 1fcf7c3d8f..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, LMB_NONE); - 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, LMB_NONE); - - 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)