From patchwork Wed Jul 24 06:02:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 814144 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2618887wro; Tue, 23 Jul 2024 23:08:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWfHx75OTbDFD787t+FY9r/ctShOJ+6dpGxB6ayUBqE/MqK1RhiiSFuU8xJVcwW39YszhtW7VAMg76VlnYtvogl X-Google-Smtp-Source: AGHT+IHcnILjvFrj7FfuGj1wKwDl/ekRo7ILz1s/qna8pn+p7okb4hYeiE6D6RGTP9EWjltAyvMr X-Received: by 2002:a05:600c:4f51:b0:426:686f:7ad with SMTP id 5b1f17b1804b1-427f9a0b5f5mr6265515e9.10.1721801299965; Tue, 23 Jul 2024 23:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721801299; cv=none; d=google.com; s=arc-20160816; b=Oq1Y/2hKFmFyhZL5rC57YIv1pFW4VjBWbWp/8DzvNxUHoNSu5X7v3i3ivYWEjtdv7H w5njpo564yVhfExx6o0WZajeZboAL4syA3Bk4RxkDmBf169/Xe6THiNucMMzvZNxNSVN MPQWbWPU3OTCxm2ZVIpG/bxCyKnaJYGCOyFRkaFvFvBN+WFIpDP9QVVi15KJFcoHpYnS Hh8ZVqxBo4Irjd9Cl0pOD1rxbTzUZEUiGX+VnFpLZPQPKNMtgGK/Yep4dhwQlXgzusTz pJ8u0ugb/sEpEedgmp4RC+Sm7sKj/+h+VcdyboXMSSGS20QycilgCJdmVrzUlE6Jp3Mn nwoQ== 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=/QMpzzogESEy4kg+BRSoW6WdKTNBet/JnBpcziU3TSI=; fh=2Pj5JIsHjq5RrikEkOcQACB00oozvLDfE1bUuj4kmbs=; b=gixbWksWo3iwVSEQJpPy82k9Cnj2NH/FhuReCJGGglaK44P4DkTNr1hNnN+zOVNY4Y Wal1AbGzYZ29C6cNr90eRJmSoJIion9nqURmv+bRM59hLwhOw/D+tRkxh1gD6E+mojuO yJ4pX2xhZH2LZQB7RvoAv3XAl8ikKQrQMvxdMB6HH1EcUEHspNx7NBjDYSSORRtH7gp5 tcZTKcy70X3dpT3UecoxbLBN1XIwfCeBOtCLJG87XbIRF73QjDKjpxpHuJjWI6myiuzQ 6MeBADyZQMWlnSgNGTJiTtbPPP2qKHRin8tQ/eIXZClLsBajulPBkdc7lH1K2iMlxosa 9u4A==; 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 5b1f17b1804b1-427f9374d09si3662605e9.63.2024.07.23.23.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 23:08:19 -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 302F9888EB; Wed, 24 Jul 2024 08:04:42 +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 4DA8D887FA; Wed, 24 Jul 2024 08:04:36 +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=ham 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 1B64488875 for ; Wed, 24 Jul 2024 08:04:27 +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 11A99106F; Tue, 23 Jul 2024 23:04:52 -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 B31AB3F766; Tue, 23 Jul 2024 23:04:21 -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 , Tom Rini Subject: [PATCH 20/40] lmb: remove lmb_init_and_reserve_range() function Date: Wed, 24 Jul 2024 11:32:04 +0530 Message-Id: <20240724060224.3071065-21-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 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 rfc: 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 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/include/lmb.h b/include/lmb.h index 50977e6561..2d8f9a6b71 100644 --- a/include/lmb.h +++ b/include/lmb.h @@ -37,9 +37,6 @@ struct lmb_region { enum lmb_flags flags; }; -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 ce1b0204c9..5afdfc32fb 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -292,14 +292,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) {