From patchwork Thu Sep 5 08:28:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 825625 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp187136wrb; Thu, 5 Sep 2024 01:30:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXfONuDsW2l+X55HK+qkcUgkXaLGaukGsFbJOOAEp2SVlDGqAgZOTspouuCvKHwoaEMiD8mgg==@linaro.org X-Google-Smtp-Source: AGHT+IFVykVluZt/0GWa826r01ugVEr9csBe/HpvFv7HsjF9xBrmj8mYNFYZo+EkWGK+RiAo6XDC X-Received: by 2002:a17:907:72d6:b0:a80:788e:176c with SMTP id a640c23a62f3a-a89a35ceef6mr1708913866b.23.1725525039044; Thu, 05 Sep 2024 01:30:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725525039; cv=none; d=google.com; s=arc-20240605; b=Qri4ZbDF0cvhaFfmME20qxuTbr4bipFq4/tBrOzLb02MDnfc3Y15HzNmPcYyG4Fw6/ UWP5mnM8vWO3LOBSDiV7ysj4pRyYnHe12gzzXtu5yHvudlJjSkHdFRPdpPjtWMTlXOOh bd34YqRBRZhMNTSQlkG1Qn523lVhni3TYL8Ep/A5571VTlpgnHMFhd9vNfjuHuIp18k5 v7Zc6+yukN83wSy1DXQAKAqZqjq9qvqjCoIbfZDHt/1I7ChssK1tYgNG7PAm/D97RmWq 8c52jAKsysI3mEzQ0YZ9kdCnDa1YVxqGyBzb8CHebVnQlvMTwI34rfhZnjXL6YReIVYf OMAA== 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=YVgs1cZqW4g2das9WbJ52f7/My1qh98To2QbSQmY8FQ=; fh=xhhG27Jur2HVmyj6xWbgrQg2vRawqr6LmtjP4yz05ls=; b=lJmvYodF+Jd5AgTC3BNFjwOAZuT7XB2RW9F00q1NqE/S7kfXPx/Md54ZCV5MqFs1Rw afz6Zpdx9sPuiEk2Uy7wv2vF59aXOmOmpXVW6Co4x8Dlb4oeALBynwOREHb9sr9qBpOY X8TDaIOSzNh7IFbz63Sv2hT6stTJI/Ae+r6SxzJk0keGDaffjJ48BUxZ/YNtb3u+t9f9 SOCF6OgYWJGNkpjV9mODomVEf9emJc3URulrBhohgx9UdN/4jhCOBeGwMQrGm+NZNM/G 5tKdQod1DrjlQX7TRCuvWFHEEOLNuzRw0gGbm5H0Z2g++yquthfpy/t8zjrDv8eZPV0G 2Ngg==; 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 a640c23a62f3a-a8a672a765asi89890266b.1015.2024.09.05.01.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 01:30:39 -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 5AA3288CE4; Thu, 5 Sep 2024 10:29:12 +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 9245F88C6D; Thu, 5 Sep 2024 10:29:11 +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_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_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 A0A2D88C1B for ; Thu, 5 Sep 2024 10:29:09 +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 AE96EFEC; Thu, 5 Sep 2024 01:29:35 -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 BBF173F66E; Thu, 5 Sep 2024 01:29:06 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Tom Rini , Bin Meng , Sughosh Ganu Subject: [PATCH 12/16] layerscape: use the lmb API's to add RAM memory Date: Thu, 5 Sep 2024 13:58:07 +0530 Message-Id: <20240905082811.1585467-13-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240905082811.1585467-1-sughosh.ganu@linaro.org> References: <20240905082811.1585467-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 --- 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 d2dbfdd08a..e7fb91a821 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 f2fb90c12d..ee0b4d65f2 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -1130,6 +1130,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