From patchwork Wed Aug 21 10:58:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 820971 Delivered-To: patch@linaro.org Received: by 2002:adf:e98a:0:b0:367:895a:4699 with SMTP id h10csp640826wrm; Wed, 21 Aug 2024 04:02:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVNzvYP6b8t7Mbsca/eMVRFGTomGZUr/dtD4iqbPmwzDq7CAL4vy8+iWdOouxczbBnOsnonXQ==@linaro.org X-Google-Smtp-Source: AGHT+IE2rtoGKVHygA4mekpA9u7OpF6mR9qk7VU1x5Mp1+EQ3nAxJVZg7auifyxjZowMISjWU2P6 X-Received: by 2002:a05:651c:1547:b0:2ef:324f:c907 with SMTP id 38308e7fff4ca-2f3f87ec4e5mr17527511fa.5.1724238158841; Wed, 21 Aug 2024 04:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724238158; cv=none; d=google.com; s=arc-20160816; b=ktdUuly9GsXuY8n0rXk3cHllvFeCeaS8SqjytafKNi4dqR5/0lPZC3zMx78aEZWDYi Z56k5d/kdYTJAknrexxwyp9aSpjDFUjXnh73LpozKJgwjAlC7jtSn9shB4XbkU0/JHLt aMII6ChVEhtjaBkQGyZtAiB4bFNtBV7mOWS12oXEkCdyoQEjWls+NIb/sdlD+zuD0ZIk hY6Hjtun92ObM5zkgmLMXqh1Q8XzhEi/8lDz9VYpm+pSnbDM2MN5o10WuHq005lwOmIf mIosSKvLIAOrmIo0JsmNodGpOzXSo0tJCSIlY9awkN+gS0pbiV5/ea9BA5SxgwgfNlKw WZXg== 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=FNyStS0Z+5rR0MQH9BZm3JQWJROs3whBurEhL1eZxxA=; fh=pnMZGD6unUPoMrkOwzXlkuYg+kVwGnSNRCTlQoWqjVc=; b=j30AWHKvMvok8C5hwN7tm3EK4geMe+TQZ9LHSyQkjOS82cNyg6KEH687Y/IRruOsw9 1qZvks/157F8L40TIW8laZfh97BmWxxNOQ1TQaiboo4M05lvFH7UlKGsv7f1PWx4PgWy wHZSK2ERTJnFmssxmAWl9NjMiG60Hze2tJXgT1YFH1WQZb1X5dj/KApsbFXMy4NqXZCl w5qE1yrMm+L7V5avOm5DvtQhpS5P2gzAPa3wKw4dMo3lODVRoKT8phXNZU/kG4nxMz5T f3yLzweE6UiZX96PCJMaCLQ//hEE2X3gNHdyp24Lzp1xyGaj39gP9wz4Pa4fJx1qH4m8 fE3w==; 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 4fb4d7f45d1cf-5bed0b5a4ddsi7105689a12.392.2024.08.21.04.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 04:02:38 -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 7097388DC9; Wed, 21 Aug 2024 13:00:23 +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 A6D2488C4B; Wed, 21 Aug 2024 13:00:21 +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_FILL_THIS_FORM_SHORT,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 B280D88DC6 for ; Wed, 21 Aug 2024 13:00:19 +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 457B4DA7; Wed, 21 Aug 2024 04:00: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 D84F13F73B; Wed, 21 Aug 2024 04:00:15 -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 , Sughosh Ganu Subject: [PATCH v3 21/27] spl: sandbox: initialise the ram banksize in spl Date: Wed, 21 Aug 2024 16:28:33 +0530 Message-Id: <20240821105839.2870293-22-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240821105839.2870293-1-sughosh.ganu@linaro.org> References: <20240821105839.2870293-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 Initialise the ram bank information for sandbox in SPL. The ram bank information gets initialised as part of the SPL initialisation sequence in board_init_r(), which is then used for adding available memory to the LMB memory map. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- Changes since V2: * Put the details of the calling of the dram_init_banksize() function in the commit message, as per Simon's review comment. arch/sandbox/cpu/spl.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c index bcb1ca10a5..1b9896bc68 100644 --- a/arch/sandbox/cpu/spl.c +++ b/arch/sandbox/cpu/spl.c @@ -127,6 +127,15 @@ static int load_from_image(struct spl_image_info *spl_image, } SPL_LOAD_IMAGE_METHOD("sandbox_image", 7, BOOT_DEVICE_BOARD, load_from_image); +int dram_init_banksize(void) +{ + /* These are necessary so TFTP can use LMBs to check its load address */ + gd->bd->bi_dram[0].start = gd->ram_base; + gd->bd->bi_dram[0].size = get_effective_memsize(); + + return 0; +} + void spl_board_init(void) { struct sandbox_state *state = state_get_current(); @@ -134,10 +143,6 @@ void spl_board_init(void) if (!CONFIG_IS_ENABLED(UNIT_TEST)) return; - /* These are necessary so TFTP can use LMBs to check its load address */ - gd->bd->bi_dram[0].start = gd->ram_base; - gd->bd->bi_dram[0].size = get_effective_memsize(); - if (state->run_unittests) { struct unit_test *tests = UNIT_TEST_ALL_START(); const int count = UNIT_TEST_ALL_COUNT();