U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Georgi Vlaev <g-vlaev@ti.com>
To: Vignesh Raghavendra <vigneshr@ti.com>,
	Anand Gadiyar <gadiyar@ti.com>, Tom Rini <trini@konsulko.com>
Cc: <u-boot@lists.denx.de>, Georgi Vlaev <g-vlaev@ti.com>
Subject: [PATCH 3/5] board: ti: am62x: Use fdt functions for ram and bank init
Date: Tue, 14 Jun 2022 17:45:32 +0300	[thread overview]
Message-ID: <20220614144534.317407-4-g-vlaev@ti.com> (raw)
In-Reply-To: <20220614144534.317407-1-g-vlaev@ti.com>

Use the appropriate fdtdec_setup_mem_size_base() call in
dram_init() and fdtdec_setup_bank_size() in dram_bank_init()
to pull these values from DT, where they are already available,
instead of hardcoding them.

Signed-off-by: Georgi Vlaev <g-vlaev@ti.com>
---
 board/ti/am62x/evm.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index 4dd5e64299bf..fb5106d1f3c8 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -23,17 +23,10 @@ int board_init(void)
 
 int dram_init(void)
 {
-	gd->ram_size = 0x80000000;
-
-	return 0;
+	return fdtdec_setup_mem_size_base();
 }
 
 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;
-
-	return 0;
+	return fdtdec_setup_memory_banksize();
 }
-- 
2.30.2


  parent reply	other threads:[~2022-06-14 15:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-14 14:45 [PATCH 0/5] board: ti: am62x: Add support for 1-bit inline DDRSS ECC Georgi Vlaev
2022-06-14 14:45 ` [PATCH 1/5] arm: mach-k3: common: Use ddr_init in spl_enable_dcache Georgi Vlaev
2022-06-16 14:38   ` Tom Rini
2022-07-07  1:55   ` Tom Rini
2022-06-14 14:45 ` [PATCH 2/5] arm: dts: k3-am625-*: Mark memory with u-boot,dm-spl Georgi Vlaev
2022-06-16 14:38   ` Tom Rini
2022-07-07  1:55   ` Tom Rini
2022-06-14 14:45 ` Georgi Vlaev [this message]
2022-06-16 14:38   ` [PATCH 3/5] board: ti: am62x: Use fdt functions for ram and bank init Tom Rini
2022-07-07  1:55   ` Tom Rini
2022-06-14 14:45 ` [PATCH 4/5] board: ti: am62x: Account for DDR size fixups if ECC is enabled Georgi Vlaev
2022-06-16 14:39   ` Tom Rini
2022-07-07  1:55   ` Tom Rini
2022-06-14 14:45 ` [PATCH 5/5] configs: am62x_evm_r5: Add CONFIG_NR_DRAM_BANKS as done in a53 defconfig Georgi Vlaev
2022-06-16 14:39   ` Tom Rini
2022-07-07  1:55   ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220614144534.317407-4-g-vlaev@ti.com \
    --to=g-vlaev@ti.com \
    --cc=gadiyar@ti.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox