From patchwork Thu Jul 4 07:35:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 809928 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp1043032wru; Thu, 4 Jul 2024 00:40:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWgtqlnxjp/hJhaaiA9OekxgknyZgzc7KKAWJun+FzXQ3uY0MmItJonR0+e3zAzY7+Ky1VpKkolpKRny3LSR1Yh X-Google-Smtp-Source: AGHT+IELLN1tOm2MWmg41biI0dGtqgP7vYdDTczLN7g2UXVrl50DYfuEJ99y2KQuJqYPbcScpVxM X-Received: by 2002:a05:6402:26cc:b0:579:73b7:b4cc with SMTP id 4fb4d7f45d1cf-58e5994df08mr675327a12.2.1720078808208; Thu, 04 Jul 2024 00:40:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720078808; cv=none; d=google.com; s=arc-20160816; b=dMjNDqflRUfR2DtHEZryhWmwHjGE5C3XX8bEcM2ikB2Wbx+7YcLXh1ph3kDvhXBNFy r2mbaz1N8jtkb2mlwQxvCPf+NKlmSbdaXCR23L4JFSpFAAfbkKn6Dv1NR/PpXZL7qCYp iQK4cz4QsEgPmIn6Pt059ABvfMiVnfDvcFITGlyZnbrK40kjpNjVVwE+s17xuf1j8Qf4 kd8Zk5Xj+zHup0XJYBRM3oNwUqOc00tBJzo4c0H1/LFisdcGsY7dgrahm9NcaA+FziYm Ix9R98e8G65hdnLU3U/wpiM1l7aZI8pch3JEIJCN+LuNkQ9fHajOcY7PWA7r5Wxdo1hY I8fQ== 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=HBVPu2HosBP7mCtytKkEz5BW9mEm8msHiI7CehMwK0M=; fh=ez1zzjhC0XWyqTp7tWutqrA/nFdALDnQKrnQnXYhk5Q=; b=Zbev0IXg4NhUC7VFlMOUTphOGtJCUhvTaOPOQ/KbuAu0ucrKUh7Nx7jJNCGtyBRLoC 7TZFiw3ms2YwqgoMIPdIuFsZzTVzO+BJP0/ICI5WjvxLw4DKmqF2CMr3wF2tlzatYPaZ OtoMS+5mVkJDMIqRsHfGXB95qYs9Ulbrt5GYOLAuO8AKrZ8Ah+t4jWVrZCJ09HVfTXUJ MHihchYbXQNzg0XAxb4rzQl1Cqa7X+nDCRdynPTUCT2heVTswWmmvv3EzSVhWxLuAfyq SpCZv77mFZuH0BMgnTAYjGtscS5zmyVALLdvDDl4E1os86dJJsr+Xgjha5J6Zgt/0mej mVYQ==; 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 4fb4d7f45d1cf-5861503b6basi6551191a12.334.2024.07.04.00.40.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:40:08 -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 43B1B88905; Thu, 4 Jul 2024 09:37:25 +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 43AED8891F; Thu, 4 Jul 2024 09:37:24 +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 261A78892A for ; Thu, 4 Jul 2024 09:37:22 +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 A7988367; Thu, 4 Jul 2024 00:37:46 -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 7E8743F762; Thu, 4 Jul 2024 00:37:18 -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 21/48] lmb: remove lmb_init_and_reserve_range() function Date: Thu, 4 Jul 2024 13:05:17 +0530 Message-Id: <20240704073544.670249-22-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 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 --- Changes since V1: None boot/bootm.c | 15 +-------------- lib/lmb.c | 8 -------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/boot/bootm.c b/boot/bootm.c index 5ce84b73b5..d44fd2ed87 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/lib/lmb.c b/lib/lmb.c index 456b64c00a..bf6254f4fc 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -268,14 +268,6 @@ __weak void lmb_add_memory(void) } } -/* 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 bool lmb_region_flags_match(struct lmb_region *rgn, unsigned long r1, enum lmb_flags flags) {