Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5EFDDC433F5 for ; Thu, 17 Mar 2022 17:05:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 442A283C07; Thu, 17 Mar 2022 18:04:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="q3DSsLE5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0CABF83CB6; Thu, 17 Mar 2022 18:04:04 +0100 (CET) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BF6EB83CD8 for ; Thu, 17 Mar 2022 18:03:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=d-gerlach@ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 22HH3kqE017129; Thu, 17 Mar 2022 12:03:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1647536626; bh=IK+/In5fcIjCG0EH7qULZ5piDKscxDHhWxadOLuODAk=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=q3DSsLE5Xsvua13KNtdlini001FB+cyTbPBiPTziqDUoJaVH64B8LoeGDbaFLwxeK d7hnCf4Sy2ags1xLdK5ViMbXFnkAm4+/Wu2dEh/Kp13z5/DV0L4DcK/8pwr351q1kj Pd6f6/anmnFqr1Axh7MQpL+M/DbBX1dWOapgSdL0= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 22HH3k2n077708 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 17 Mar 2022 12:03:46 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 17 Mar 2022 12:03:46 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Thu, 17 Mar 2022 12:03:46 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 22HH3kJI025845; Thu, 17 Mar 2022 12:03:46 -0500 From: Dave Gerlach To: Tom Rini CC: , Praneeth Bajjuri , Dave Gerlach , Georgi Vlaev Subject: [PATCH 2/8] board: ti: am64x: Use fdt functions for ram and bank init Date: Thu, 17 Mar 2022 12:03:40 -0500 Message-ID: <20220317170346.31162-3-d-gerlach@ti.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20220317170346.31162-1-d-gerlach@ti.com> References: <20220317170346.31162-1-d-gerlach@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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.5 at phobos.denx.de X-Virus-Status: Clean Use the appropriate fdtdec_setup_mem_size_base and fdtdec_setup_bank_size calls in dram_init and dram_bank_init to pull these values from DT, where they are already available, instead of hardcoding them. Signed-off-by: Dave Gerlach --- board/ti/am64x/evm.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/board/ti/am64x/evm.c b/board/ti/am64x/evm.c index 8373c768f189..7ea80b82bec5 100644 --- a/board/ti/am64x/evm.c +++ b/board/ti/am64x/evm.c @@ -29,19 +29,24 @@ int board_init(void) int dram_init(void) { - gd->ram_size = 0x80000000; + s32 ret; - return 0; + ret = fdtdec_setup_mem_size_base(); + if (ret) + printf("Error setting up mem size and base. %d\n", ret); + + return ret; } int dram_init_banksize(void) { - /* Bank 0 declares the memory available in the DDR low region */ - gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; - gd->bd->bi_dram[0].size = 0x80000000; - gd->ram_size = 0x80000000; + s32 ret; - return 0; + ret = fdtdec_setup_memory_banksize(); + if (ret) + printf("Error setting up memory banksize. %d\n", ret); + + return ret; } #if defined(CONFIG_SPL_LOAD_FIT) -- 2.35.0