From patchwork Wed Aug 21 10:58:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 820963 Delivered-To: patch@linaro.org Received: by 2002:adf:e98a:0:b0:367:895a:4699 with SMTP id h10csp639997wrm; Wed, 21 Aug 2024 04:01:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWNEdZNEM6ZYwGDRoYL1XzTVct77qQBTjmqDjGaR7kTYdncEQucsfRm24BKerHHGrRlmpT5vA==@linaro.org X-Google-Smtp-Source: AGHT+IGdidrj/gKFMvuEicO1brakw9iy0jNgoKCwLkmSwT7fu8CT0MG1MZ7c2VV4NZ3p4dBd2mY9 X-Received: by 2002:a05:6402:400d:b0:5be:f1a7:c2cd with SMTP id 4fb4d7f45d1cf-5bf1f25ee08mr1402623a12.31.1724238074402; Wed, 21 Aug 2024 04:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724238074; cv=none; d=google.com; s=arc-20160816; b=UdA48S83JLflba+IfUlebs7j4bXlif6IuRpKbZd4y24NLY8aVErvISAtNfi3U8CQVl htVPukUYqUPvwEmdwyrFk3vhBQvxqAtytnqHlHpUlyv3w7qYkVCt0rSumuLrwcpyagXW weciYEdI5rDd0sRrjyA0//oJ0WU70x9ygRzCKpQWrZcQM+TekobFba4+W6y37Awby9yo N7IxAEmy3Lql3JCOcnfdpbcKIuhhSQ165WPieXzwznbqv3GuqLpXwUAaWxLmDwPqTEMZ 1V3sI4fwsZRZBSltXq6QGtrpTp2ZlpkpLWu6DnIHeX8dewMYghNT8hcb54Mp1SyZ2y4T F/Rg== 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=OOph+IFGGsW0JoRSSmYPobS+HwiAqqighhdbqGS6z/k=; fh=pnMZGD6unUPoMrkOwzXlkuYg+kVwGnSNRCTlQoWqjVc=; b=a2FzYD92V0I7tyQk86Glk6OjbO/zjqe1tf+bOhqs+cgUtIANAD7l1vhysUasK5nNT2 fvElVd3u62zhBBeyW9FLiRXR6vq6TDvJhaAAcRzL2w2KVJhLtqSYIR/7RzAhSD3e/2kz /CtiRvPNX1ze+znMwyxMvZ5aoX2SDVrDA0SZnS+7Tfe/oV1pLqFSGTMqBwhTMsdbTtYC 9gHZSsY8uQaABKVcXR7X7Vg0Vmk+9tiC3yKnV1imeX5jTLDZeNCRzgysRYNtcIUR0oBR bHkFHZyezZvdhxgGGvmhUSH2xrxZXQKs4PP9x/bcQK0ZoICdse8Q5s0WFfXAq+PhPyTP 25jg==; 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-5bf0c77bda6si2477092a12.350.2024.08.21.04.01.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 04:01:14 -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 1834388DBE; Wed, 21 Aug 2024 12:59:52 +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 C24AA88DB7; Wed, 21 Aug 2024 12:59:50 +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 C8AC888C37 for ; Wed, 21 Aug 2024 12:59:48 +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 5C476FEC; Wed, 21 Aug 2024 04:00:14 -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 EDC3E3F73B; Wed, 21 Aug 2024 03:59:44 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Heinrich Schuchardt , Marek Vasut , Mark Kettenis , Michal Simek , Patrick DELAUNAY , Patrice CHOTARD , Sughosh Ganu Subject: [PATCH v3 13/27] lmb: remove lmb_init_and_reserve_range() function Date: Wed, 21 Aug 2024 16:28:25 +0530 Message-Id: <20240821105839.2870293-14-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240821105839.2870293-1-sughosh.ganu@linaro.org> References: <20240821105839.2870293-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 V2: None boot/bootm.c | 15 +-------------- include/lmb.h | 3 --- lib/lmb.c | 8 -------- 3 files changed, 1 insertion(+), 25 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 6d41672216..e6c6f1cdcd 100644 --- a/include/lmb.h +++ b/include/lmb.h @@ -63,9 +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); - /** * lmb_add_memory() - Add memory range for LMB allocations * diff --git a/lib/lmb.c b/lib/lmb.c index 83d3512a02..e26e329248 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -227,14 +227,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 __maybe_unused void lmb_reserve_common_spl(void) { phys_addr_t rsv_start;