From patchwork Tue Oct 15 15:37:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 835454 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c8f:0:b0:37d:45d0:187 with SMTP id z15csp301296wrs; Tue, 15 Oct 2024 08:39:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUdIaWKrS7QECeEDFi9YFUL2sOOPT+nw7Z7csS1lA6kQWYzM9sgvpOuKjo2+vNmWf3OYHAwAQ==@linaro.org X-Google-Smtp-Source: AGHT+IFPbG+1gXPxxRpT+WHEMJH53dvFrytp1TQGtCZj7xur8DpbltF6e2KSWEc0z1PtBGUV+//h X-Received: by 2002:a05:6602:6d18:b0:835:40af:c45b with SMTP id ca18e2360f4ac-83a9447a320mr84957939f.7.1729006770710; Tue, 15 Oct 2024 08:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729006770; cv=none; d=google.com; s=arc-20240605; b=NguNY94dcdgEBUEyg1On/bpYHHnHT8Iszf3FZ3EgQhcZGuJAyRiBAiwDOAi4WroRqW NVUuXxV0U0jxP8/JhrsOl1XwNIuZWHMV5m5pPD8Dw34S80CnBzBCrsZcYp+yXdh5e6B6 BTGHRmWDwd/TREQdsrA//fil+ZEo9n1dL3gsL+l4s+IiuBZK6mVbV1U2cUiN5+eIXS+B v19zuOqc47QHnZKwqn37oQhM3Wk6NfaRZpXYC7/jzxPxcdjCpdGiZRDDz1lU465xf4w4 jW0RMDlRYhtJkX1hve9odsjIuxjMY2bvkUWq1Nq0qi/g2fdhrJr37LxOj5s9qRBtgIso G68Q== 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=kGV9/18JqWXdqMGsam1HBh5snqjFghVwn8PLHB5K184=; fh=MYvlzMqd61VHJORtkCu1tTA+qP9jRMJFkVEqSzDEdy8=; b=MPYCaCNEW07JrjaqA/2xkDMZImaYsPnHMnKMWgv74dVCYZLrTFJX0Jc+q7HBUSohLj Wy9g9ZX4zSlac8ikz/Jci3fkFgUiQys7Cn8mOgmTpYL9YIb8t+4wwW22lH9n6W821RAf L7+DVpU/b0fqxUuHd9rXG9YuBYp1Wd8MT0XbsNZQyM45duEJqz9PmXulX4raLfe/BYKR E50S76QXeMmVsXv/T+LPP/q67CurgbfNEPHFJvZ4BfJr1s5dm6u5rxqUgD+lu5bWnzhO TCf5tlhmoyQaLz7/LHihi3XT3GMbvdaXsyUQySUJ68litjQuR4TmRfVt4IkOqLf43x18 g+vg==; 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 8926c6da1cb9f-4dbecc4a2b2si752917173.78.2024.10.15.08.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 08:39:30 -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 73F1988CC5; Tue, 15 Oct 2024 17:38:16 +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 DBB8688CC5; Tue, 15 Oct 2024 17:38:14 +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 E5DCE88B99 for ; Tue, 15 Oct 2024 17:38:12 +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 F3FFF16F3; Tue, 15 Oct 2024 08:38:41 -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 8062D3F528; Tue, 15 Oct 2024 08:38:09 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Tom Rini , Caleb Connolly , Jonas Karlman , Mark Kettenis , Sughosh Ganu Subject: [PATCH v4 10/15] layerscape: use the lmb API's to add RAM memory Date: Tue, 15 Oct 2024 21:07:12 +0530 Message-Id: <20241015153717.401371-11-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015153717.401371-1-sughosh.ganu@linaro.org> References: <20241015153717.401371-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 V3: 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 f9c2083677a..d2d3e346a36 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 3d2011ad4b7..b6b8b8d9c29 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -1122,6 +1122,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