From patchwork Wed Aug 14 10:59:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 819124 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp645973wrm; Wed, 14 Aug 2024 04:04:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXITXtv2Tt4mgfwbzmrPfPX4B3hhCj6aRN/98rs6Vwv+/WnHl+DGSpszPNvz1J3RJbP+uZAihYPx9CfcVf4DrFp X-Google-Smtp-Source: AGHT+IH1J5Hzsk2C9rKkkV37B8ieANeUpxFHfqTPCmKyNRidzNvlBNUsBeFXtUOit8i2mbkj2XHl X-Received: by 2002:a2e:9d50:0:b0:2ef:2677:7b74 with SMTP id 38308e7fff4ca-2f3aa3005e3mr16189281fa.41.1723633468998; Wed, 14 Aug 2024 04:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723633468; cv=none; d=google.com; s=arc-20160816; b=STS2pyuw8SZ8miFt5DhjbcOJ5XMTKSxvbiMqKv4ZEY11MFK5dJHVnlRDDmTi5hpCZ5 XwUaxvmj6cBv7m93XRsifdY30a8QCwK/VYczPhBJcfxlcxqzoy3eJa0mhPt9wyClbnKM RFgRVjZ9MvBQoaX8dwPwHAze6mIctrSdqyahUq64DPjNE29z6XHgz2LpCjcGL3Pm85Tn 6no5IL1fy8doWNuJ/fLcqvuXSqYTgmQMbNVpHb4bJmI+T7oIt1c4SROVfyycyryUWKP3 wSByd5+cNCzcR8CepZnVUQQR0/LH4M/ikPn7JYK3tCf2oDYY5cyJfLJxGY8/jPLX8PYF +X9w== 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=IXQg0Wn+Y7uZtWy1REKAe/SEwTQGyq/53nAowfSASnI=; fh=w4WyT9xL7ErtT1TeetrD/m0Y0mAgjnERgxacGUpGjSg=; b=VepjE1l6H4XE/5yQTL6ydV7D3pot5Axk/N5kG+Mqs37iGlWKx0jFJ4MDsnceFuOwij l1YPW6ZHobjQnyUEb5InB9VKa3FdeK8TgY9jC95hq9KvgXUbUMyOCCy2OJU4GrdAzAP5 4/y2ZMzrNMAXIe3N4KJOq9Bo6estrFNbivrnj7A7opnRg1OUM0bNN3KqBFng3XgiyXqT HqYwJhfBrVs7ltHYBE0dvq07nUUpdqVnXQZfibLq0Psj6xdTrsWB2/9dmFLhERg0Izks fgmYqlJ3B4Jq2w5zeoVjHedCsjzfGf25dh0ESMCVWn7urrAeqHeuexHDjkeWwZrCnuMT PVqQ==; 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-a80f4185cd5si200728566b.811.2024.08.14.04.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 04:04:28 -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 CA0D688A92; Wed, 14 Aug 2024 13:02: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 361A088A79; Wed, 14 Aug 2024 13:02:22 +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 B80A588A35 for ; Wed, 14 Aug 2024 13:02:18 +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 28B07DA7; Wed, 14 Aug 2024 04:02:44 -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 A98933F58B; Wed, 14 Aug 2024 04:02:13 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Marek Vasut , Tom Rini , Mark Kettenis , Michal Simek , Patrick DELAUNAY , Patrice CHOTARD , Huan Wang , Angelo Dureghello , Daniel Schwierzeck , Thomas Chou , Rick Chen , Max Filippov , Sughosh Ganu Subject: [PATCH v2 21/32] spl: sandbox: initialise the ram banksize in spl Date: Wed, 14 Aug 2024 16:29:58 +0530 Message-Id: <20240814110009.45310-22-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240814110009.45310-1-sughosh.ganu@linaro.org> References: <20240814110009.45310-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. This is needed for adding available memory to the LMB memory map, which is done as part of the initialisation sequence. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- Changes since V1: * Update the commit message to explain why this change is being done. 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();