From patchwork Tue Oct 8 18:14:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 833595 Delivered-To: patch@linaro.org Received: by 2002:adf:a1d9:0:b0:367:895a:4699 with SMTP id v25csp436062wrv; Tue, 8 Oct 2024 11:16:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUOVvIuivYFcmhFjxEOHAV/o8c5GmAXGabfM36HvSnkfveT95yVtZlkCCFHHYuoqa28AjxrGw==@linaro.org X-Google-Smtp-Source: AGHT+IGj+nvc5uSV39zRjL/QC7pTTDgEeu4SqJHPee4Nk5aLYqNktFG7xxlXRlsvxjJBN5Hc+6DE X-Received: by 2002:a05:600c:3b9b:b0:430:57f1:d6d with SMTP id 5b1f17b1804b1-43057f10fe7mr5470515e9.1.1728411396237; Tue, 08 Oct 2024 11:16:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728411396; cv=none; d=google.com; s=arc-20240605; b=IYcGa9+73NYvLK89QjqWCm3rUJHegkR3DRT2SqXYnz2BdrfmaCGcRHIwmVcEPD+5Hb MBodnXJ7IooiF9DD9argoevJYKroApbU9uwvfMovhmsTNLVFZ1zXPrHZPMvq8qkL5o3A WV+kIAxMrByykUhidfrsYarlgysipy4k841yQSaMjhr6XlSeQOLaaExBW8pecpU41AAv NK7xPaWIQRUpHwB0TXdc8nZct310yQtynjVGqqSAdKP4+vDe+hbB5l45zYwoDDAjGnIs l6q5CSmuOns+Yc4fZJ3dSQsHsqFDHYjYLOY4xHoPBzbPdUvEGke3Vdd6/fhUr/4Q1OdQ db7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=kinyZ73WQc9/L4cYH/TpeybY7cfMwqVlp+iYv/Q+fFA=; fh=EURqIhM9Cs9+QDCQ9Vm6IsJQ8gNya1VBDuunKFxPiA8=; b=PJgv+3IiBCsHNDnMKoA96JUqmfaWBPJ/LVexN9fAe1LILds6EJQLuM7O1XerjNNWIo p7LE67RNRwMVvzFthnCydaK65uHY6GO1mFNTXyiKTNKzOl7gFqbKec3lNRSjAF/BZSVz ZW7cAra1nyNtw1n5oqAzQUzPs0GQNKTy1wIq+TEFWM+VBK0OMobr9eUhlpxUW/tHrF5h Sr5XEUx2Z3xPVyQVxV1xPsUsokdIdvJbXQMOvFy2Z3Na6B4r2JEym8Z5p4YxBkNavMNC EjgZ2OXQA4IEKbxJqZVccl4T83QCGGP5OaTTuqPd04MQ8bb5XF97NzLuun+syaiT57tI Tg9Q==; 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-43056c1da48si6316505e9.191.2024.10.08.11.16.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 11:16:36 -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 7823D88F2A; Tue, 8 Oct 2024 20:15:24 +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 EAE9188F27; Tue, 8 Oct 2024 20:15:22 +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_DNSWL_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_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 F313E88E26 for ; Tue, 8 Oct 2024 20:15:20 +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 0AFBBDA7; Tue, 8 Oct 2024 11:15:50 -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 9645A3F64C; Tue, 8 Oct 2024 11:15:17 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Tom Rini , Bin Meng , Caleb Connolly , Jonas Karlman , Sughosh Ganu Subject: [PATCH v2 10/14] layerscape: use the lmb API's to add RAM memory Date: Tue, 8 Oct 2024 23:44:31 +0530 Message-Id: <20241008181435.1753814-11-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241008181435.1753814-1-sughosh.ganu@linaro.org> References: <20241008181435.1753814-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 EFI memory allocations are now being done through the LMB module, and hence the memory map is maintained by the LMB module. Use the lmb_arch_add_memory() API function to add the usable RAM memory to the LMB's memory map. Signed-off-by: Sughosh Ganu --- Changes since V1: None arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 8 ++++---- lib/Kconfig | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c index d2dbfdd08a0..e7fb91a8219 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -1525,8 +1526,8 @@ int dram_init_banksize(void) return 0; } -#if CONFIG_IS_ENABLED(EFI_LOADER) -void efi_add_known_memory(void) +#if CONFIG_IS_ENABLED(LMB_ARCH_MEM_MAP) +void lmb_arch_add_memory(void) { int i; phys_addr_t ram_start; @@ -1548,8 +1549,7 @@ void efi_add_known_memory(void) gd->arch.resv_ram < ram_start + ram_size) ram_size = gd->arch.resv_ram - ram_start; #endif - efi_add_memory_map(ram_start, ram_size, - EFI_CONVENTIONAL_MEMORY); + lmb_add(ram_start, ram_size); } } #endif diff --git a/lib/Kconfig b/lib/Kconfig index 100c4e5c250..3796adc453b 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -1135,6 +1135,7 @@ config SPL_LMB config LMB_ARCH_MEM_MAP bool "Add an architecture specific memory map" depends on LMB + default y if FSL_LAYERSCAPE help Some architectures have special or unique aspects which need consideration when adding memory ranges to the list of available