From patchwork Mon Aug 26 11:59:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 822449 Delivered-To: patch@linaro.org Received: by 2002:adf:e044:0:b0:367:895a:4699 with SMTP id w4csp1477705wrh; Mon, 26 Aug 2024 05:02:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUA6/w9oMn7n5LfrrdJQaJ+cJqTGzr23RRtSJDVqr1c+OE1qcH6C+hmrtXBbIAgAkkubgIAjw==@linaro.org X-Google-Smtp-Source: AGHT+IF3YsGJPfDhRTUZEkztnN/VSQU2AlIl6ryqlF2hhorFVVhY0dH0PcZUC/H4dylHQRXS5Jr0 X-Received: by 2002:a5d:44c9:0:b0:368:3ac6:1fff with SMTP id ffacd0b85a97d-37310ec8e04mr5080089f8f.20.1724673763938; Mon, 26 Aug 2024 05:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724673763; cv=none; d=google.com; s=arc-20160816; b=FjFTwVk1F+II9tXYGjfUDdZt102NzEXkEeWQy0Zm2x8lJZ7EJOZ7C2HRVvgKKf6Wvl GW6B1ctK9ysT0CRppAUQOoNFjao00RvhCgXARwAB009vYPcdxDF0hZd5evb3U+ey1o7k fdmJDa9gfk34/PuNF9bRh/4pIly3/wVB4fajziCuMbu+KcxzykgJYv2lnVsrbZAC9EEi YNh/sUC/mefogKRqwgiSMO52dSsxyL5UEmgikcAKeD/lGSTCh5RD+TYCUn/A68Fq4gDM RwHrpmHGXhobK2d0yl7jJ3/BLBheUnBWWxLctefsuKAe8MoDcMc2NcI2r+n9FW6GWgNu yhxA== 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=LCAzQAxUi1e+b5Jt6hAJLnPF8X+XT8HGFG2bQI88M54=; fh=8IbOOFAUJYCfGYrzM0jWqtoOP7AaZuPOmdHZ5mvNk1Q=; b=Fo58rahs1UX52syQrFs3wnwIh4M+HkXZhu31OfAWqFZxulL3qw4KhiOzQB4zxUS8j1 9EPpwISL1SgZ50QF+iWQJo/4pqxQVXssOSzrKNP7uLvkIgBxvbnKqjPZzhVL5HdGVJxV fvLGecEiXxlqgL3QLyqZ6W6Eg/nSa5V1uwXCQl6DgyZLncZeAZ2HifLQ+HRlNjnQLJKh QyTVh6t0vJqdPgrHc82CruYJw+57fhTyxeMTJgXT9FeSWHqI2gi92CpIK5KwJrLK1rJd cml4WCt7NxWat9Fyxe5vxWTmrZ6UBPUgULYje3vLhTQewc7wg5EYeNrr9N0Dd9SGpFXf SgmQ==; 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 ffacd0b85a97d-373081ffc3dsi3919629f8f.305.2024.08.26.05.02.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 05:02:43 -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 4A00C88A7B; Mon, 26 Aug 2024 14:01:14 +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 2AF8088B36; Mon, 26 Aug 2024 14:01:13 +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_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_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 5A37488B5A for ; Mon, 26 Aug 2024 14:01:10 +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 05B4EDA7; Mon, 26 Aug 2024 05:01:36 -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 22D333F762; Mon, 26 Aug 2024 05:01:05 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Heinrich Schuchardt , Marek Vasut , Mark Kettenis , Michal Simek , Patrick DELAUNAY , Patrice CHOTARD , =?utf-8?q?Marek_Beh=C3=BAn?= , Sughosh Ganu Subject: [PATCH v4 15/27] lmb: init: initialise the lmb data structures during board init Date: Mon, 26 Aug 2024 17:29:28 +0530 Message-Id: <20240826115940.3233167-16-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826115940.3233167-1-sughosh.ganu@linaro.org> References: <20240826115940.3233167-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 memory map maintained by the LMB module is now persistent and global. This memory map is being maintained through the alloced list structure which can be extended at runtime -- there is one list for the available memory, and one for the used memory. Allocate and initialise these lists during the board init. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass Reviewed-by: Ilias Apalodimas --- Changes since V3: None common/board_r.c | 10 ++++++++++ common/spl/spl.c | 3 +++ 2 files changed, 13 insertions(+) diff --git a/common/board_r.c b/common/board_r.c index f445803d7a..a60da39a29 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -510,6 +511,14 @@ int initr_mem(void) } #endif +static int initr_lmb(void) +{ + if (CONFIG_IS_ENABLED(LMB)) + return lmb_init(); + else + return 0; +} + static int dm_announce(void) { int device_count; @@ -612,6 +621,7 @@ static init_fnc_t init_sequence_r[] = { #ifdef CONFIG_CLOCKS set_cpu_clk_info, /* Setup clock information */ #endif + initr_lmb, #ifdef CONFIG_EFI_LOADER efi_memory_init, #endif diff --git a/common/spl/spl.c b/common/spl/spl.c index 7c6e322ffd..ad2dc6a908 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -721,6 +721,9 @@ void board_init_r(gd_t *dummy1, ulong dummy2) IS_ENABLED(CONFIG_SPL_ATF)) dram_init_banksize(); + if (IS_ENABLED(CONFIG_SPL_LMB)) + lmb_init(); + if (CONFIG_IS_ENABLED(PCI) && !(gd->flags & GD_FLG_DM_DEAD)) { ret = pci_init(); if (ret)