From patchwork Wed Aug 14 10:59:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 819116 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp645316wrm; Wed, 14 Aug 2024 04:03:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVZcdol9Ky1rpylZg3diW7nJ1Ja0ZvhCKHtPns/qtTKSq6zq0M1EaaaCR7OV9jF9YDeD6uw6IbuMQ+c+46YFJay X-Google-Smtp-Source: AGHT+IGjR0mZgViwW7E2G+XCB8MxOwi+c17QnSQ5NALYU6FDnMg93qKOdXLoCAfjB4nIGu5vMjEJ X-Received: by 2002:a05:6512:3982:b0:52e:764b:b20d with SMTP id 2adb3069b0e04-532eda872camr1151193e87.28.1723633383952; Wed, 14 Aug 2024 04:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723633383; cv=none; d=google.com; s=arc-20160816; b=Epn/51wd49hnsiZC0K3Q3E+gmb8GXu/0K6wP802JH2bKSZAsO6Np5mXXlZ3MI9b3Yt hNrq4GREpvaQ5OdpsaAUT3+LT8Y+1IXSIKdlHx2hDw5G+JBOclwlZN3bHgUQbq62/zhz uKs+rF0oXyDG0/2EeXMUBUmlFsWekrFM8c0vHaYVEn/bEEL8iMtBPTvlDpE4cNHru0CV 4BXhzbNA/xFPU1n46WYQJ4SLKDz3SzO/uaVe1guItu31RnnMhc2fZSozOTZE02JaDd33 NLbKqzwUN7/jrrXhMkDYs3p40X6q2LQ2yaTA3ahpoFv1dIoAyenS9XF0+bm4pXb2NHWb 4FTQ== 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=wF/oMuJfL9os9lJf9kOBKVI6PWwdeAhNt5EmwA13J4U=; fh=w4WyT9xL7ErtT1TeetrD/m0Y0mAgjnERgxacGUpGjSg=; b=neQfQFC03NwHTkGUM45Xayv1GacCXXLnPWLQwmvlsNQ1FNcvFak/ln3PC7n+tLFeew HZtsDdz9RjEp7h3Ncq2xwU9KoeV6BwdqRzqSIUMaHzL/iE6dFAHv9BV5hLrFekY3YF50 gvew57bA8VQZdovJfHBqBRd0ZYr36BfjuCIDoFNQwSWNzonk9tHfzw2w/Z82zNWRx7s1 j19EwNEN1A6Qc1NJ+ekM6fPpeNw6Nti7SwlzZ6nGqQy21RFXq8uyZ2E+CVd59/pA+Bkw /rP/L/jX9aEsoS6Xjcrd0d4ff9LhZYnNqhaipcxo5MBre6ImUN5ed94PNYqKMuqTba+K wAdg==; 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-a80f411e2acsi209833966b.386.2024.08.14.04.03.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 04:03:03 -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 71763889D2; Wed, 14 Aug 2024 13:01:41 +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 696A1889D2; Wed, 14 Aug 2024 13:01:40 +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 5AE3588A3A for ; Wed, 14 Aug 2024 13:01:38 +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 BF93DDA7; Wed, 14 Aug 2024 04:02:03 -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 4ADE83F58B; Wed, 14 Aug 2024 04:01:33 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Marek Vasut , Tom Rini , Mark Kettenis , Michal Simek , Patrick DELAUNAY , Patrice CHOTARD , Huan Wang , Angelo Dureghello , Daniel Schwierzeck , Thomas Chou , Rick Chen , Max Filippov , Sughosh Ganu Subject: [PATCH v2 13/32] lmb: remove lmb_init_and_reserve_range() function Date: Wed, 14 Aug 2024 16:29:50 +0530 Message-Id: <20240814110009.45310-14-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240814110009.45310-1-sughosh.ganu@linaro.org> References: <20240814110009.45310-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 With the move to make the LMB allocations persistent and the common memory regions being reserved during board init, there is no need for an explicit reservation of a memory range. Remove the lmb_init_and_reserve_range() function. Signed-off-by: Sughosh Ganu Reviewed-by: Ilias Apalodimas Reviewed-by: Tom Rini Reviewed-by: Simon Glass --- Changes since V1: None boot/bootm.c | 15 +-------------- include/lmb.h | 2 -- lib/lmb.c | 8 -------- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/boot/bootm.c b/boot/bootm.c index e244b9b410..ddede08979 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -239,18 +239,7 @@ static int boot_get_kernel(const char *addr_fit, struct bootm_headers *images, return 0; } -#if CONFIG_IS_ENABLED(LMB) -static void boot_start_lmb(void) -{ - phys_addr_t mem_start; - phys_size_t mem_size; - - mem_start = env_get_bootm_low(); - mem_size = env_get_bootm_size(); - - lmb_init_and_reserve_range(mem_start, mem_size, NULL); -} -#else +#if !CONFIG_IS_ENABLED(LMB) #define lmb_reserve(base, size) static inline void boot_start_lmb(void) { } #endif @@ -260,8 +249,6 @@ static int bootm_start(void) memset((void *)&images, 0, sizeof(images)); images.verify = env_get_yesno("verify"); - boot_start_lmb(); - bootstage_mark_name(BOOTSTAGE_ID_BOOTM_START, "bootm_start"); images.state = BOOTM_STATE_START; diff --git a/include/lmb.h b/include/lmb.h index 4a9070799e..f6b2a81546 100644 --- a/include/lmb.h +++ b/include/lmb.h @@ -63,8 +63,6 @@ struct lmb { */ int lmb_init(void); -void lmb_init_and_reserve_range(phys_addr_t base, phys_size_t size, - void *fdt_blob); long lmb_add(phys_addr_t base, phys_size_t size); long lmb_reserve(phys_addr_t base, phys_size_t size); /** diff --git a/lib/lmb.c b/lib/lmb.c index f803b5f63f..3ccee26a46 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -225,14 +225,6 @@ static void lmb_reserve_common(void *fdt_blob) efi_lmb_reserve(); } -/* Initialize the struct, add memory and call arch/board reserve functions */ -void lmb_init_and_reserve_range(phys_addr_t base, phys_size_t size, - void *fdt_blob) -{ - lmb_add(base, size); - lmb_reserve_common(fdt_blob); -} - static long lmb_resize_regions(struct alist *lmb_rgn_lst, unsigned long idx_start, phys_addr_t base, phys_size_t size)