public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Chris Morgan <macroalpha82@gmail.com>
To: u-boot@lists.denx.de
Cc: eugen.hristev@collabora.com, kever.yang@rock-chips.com,
	xypron.glpk@gmx.de, cym@rock-chips.com, philipp.tomsich@vrull.eu,
	sjg@chromium.org, jonas@kwiboo.se, trini@konsulko.com,
	Chris Morgan <macromorgan@hotmail.com>
Subject: [RFC 1/2] rockchip: sdram: Allow board/soc specific RAM bank logic
Date: Sat, 30 Mar 2024 00:05:14 -0500	[thread overview]
Message-ID: <20240330050515.470025-2-macroalpha82@gmail.com> (raw)
In-Reply-To: <20240330050515.470025-1-macroalpha82@gmail.com>

From: Chris Morgan <macromorgan@hotmail.com>

Allow individual boards or SoCs to alter the RAM bank addition logic
by defining a __weak function that these boards can then override
if needed. In the event this function fails, fallback to the default
detection logic.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
 arch/arm/mach-rockchip/sdram.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/mach-rockchip/sdram.c b/arch/arm/mach-rockchip/sdram.c
index 0d9a0aef6f..53aa19feca 100644
--- a/arch/arm/mach-rockchip/sdram.c
+++ b/arch/arm/mach-rockchip/sdram.c
@@ -35,11 +35,18 @@ struct tos_parameter_t {
 	s64 reserve[8];
 };
 
+__weak int rk_get_ram_banks(void)
+{
+	return -EINVAL;
+}
+
 int dram_init_banksize(void)
 {
 	size_t ram_top = (unsigned long)(gd->ram_size + CFG_SYS_SDRAM_BASE);
 	size_t top = min((unsigned long)ram_top, (unsigned long)(gd->ram_top));
 
+	if (!rk_get_ram_banks())
+		return 0;
 #ifdef CONFIG_ARM64
 	/* Reserve 0x200000 for ATF bl31 */
 	gd->bd->bi_dram[0].start = 0x200000;
-- 
2.34.1


  reply	other threads:[~2024-03-30  5:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-30  5:05 [RFC 0/2] Update RAM Bank Logic for RK3588 Chris Morgan
2024-03-30  5:05 ` Chris Morgan [this message]
2024-03-30 11:00   ` [RFC 1/2] rockchip: sdram: Allow board/soc specific RAM bank logic Jonas Karlman
2024-03-30 15:36     ` Chris Morgan
2024-03-30  5:05 ` [RFC 2/2] rockchip: rk3588: Add SoC " Chris Morgan
2024-03-30 10:53   ` Jonas Karlman
2024-03-30 15:41     ` Chris Morgan

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=20240330050515.470025-2-macroalpha82@gmail.com \
    --to=macroalpha82@gmail.com \
    --cc=cym@rock-chips.com \
    --cc=eugen.hristev@collabora.com \
    --cc=jonas@kwiboo.se \
    --cc=kever.yang@rock-chips.com \
    --cc=macromorgan@hotmail.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /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