From patchwork Sun Oct 13 10:55:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 835077 Delivered-To: patch@linaro.org Received: by 2002:adf:b352:0:b0:37d:45d0:187 with SMTP id k18csp1536887wrd; Sun, 13 Oct 2024 03:57:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWzumuz9Ty8C1bfdhZ3wKciAzbPBbb6fagDQ1k8zfEIa3JDX3kp6bpjSJG0Xb95juOtoJSNLg==@linaro.org X-Google-Smtp-Source: AGHT+IFET1h5rEtWwdmjBuR+rApjUq8xm1maMG5yJYrTJlIj7qTkwOc4ujbkZJhueuRomp+rGn8c X-Received: by 2002:a05:6602:150c:b0:82a:4419:6156 with SMTP id ca18e2360f4ac-83794d484cfmr662106839f.14.1728817057546; Sun, 13 Oct 2024 03:57:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728817057; cv=none; d=google.com; s=arc-20240605; b=Z/qRrhCjVS09Ji4zpvF24XOA3qDco4pTlc611URqJvJRGUDnu0SRZ3TmM3MIN89z1B VM9OcFMtWOR5p4NT/LIobZKMD1G6hyeSunSIpgiUiRxJ8vT709GKfc3xP4EPOV9DbTKM R45CVZC+OfMOMPCw+nrWRp2ilngJiQHfghHDUJsbYARElglGI5KiiWrOJss9THHHheiy Nb9MqaPQToFW77Os12f7lSnJfJbVzSA2pu2EYFK5eTcIGmu+fztLhmmHO80ZNohGAiHL YJi6wF2bOuMWwpKjlMh7H7innewlJdUsvD0sxgLOoSSs3Nh0/KU7GLT1Y3OQI8PE2SNI sucA== 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=JNgKYH4N+pB0nMynAdn9XgDjfNLWGprMR14NGEGzfgE=; fh=DqKFq13hCy9hcb48ZltPVvgEKSF1g1c/m42wn0WwlIc=; b=S2GbxMy8zwVXi8FwID9jI1HVpnfdTpKpXv8W1CuyqhTOkJsfLLnBFyF2GNC+CstzPQ SdYvlOmhq6qO8adwTNuV37EBJ9qx3i1/KwxQHKuXyD72BOX3I1Jd2kQ7qXH69HOMLuE6 uwgSTvfrS0He9sqG37ik01JDf94qCmgniCdh3niz+msdmxUBJYdPn/HN/GT59eWPGwbV aBAzkk4CrOG3jjgyQcWYjScMeyYEBvr3pCdR/Y6A9SFTocuUK/TsWBkCj0BGVoC0iyHb cPT2qid33XvRLXSgviGRCz7lViBl1LChYr8+XhxHx0QCq49Vy3ng4W9c8ALGufpiZWw2 9jkg==; 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 ca18e2360f4ac-8354ba68764si324728439f.130.2024.10.13.03.57.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Oct 2024 03:57:37 -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 0BB9688ECB; Sun, 13 Oct 2024 12:56:19 +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 259AE88F4E; Sun, 13 Oct 2024 12:56:18 +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_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 1F48588F24 for ; Sun, 13 Oct 2024 12:56:16 +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 321531007; Sun, 13 Oct 2024 03:56:45 -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 0B3713F71E; Sun, 13 Oct 2024 03:56:12 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Tom Rini , Caleb Connolly , Jonas Karlman , Sughosh Ganu Subject: [PATCH v3 11/15] layerscape: use the lmb API's to add RAM memory Date: Sun, 13 Oct 2024 16:25:18 +0530 Message-Id: <20241013105522.391414-12-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241013105522.391414-1-sughosh.ganu@linaro.org> References: <20241013105522.391414-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 V2: 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 f9c2083677..d2d3e346a3 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 100c4e5c25..3796adc453 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