public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Igor Opaniuk <igor.opaniuk@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v1 7/7] colibri-imx8x: add implementation for board_mem_get_layout
Date: Thu, 22 Oct 2020 11:21:43 +0300	[thread overview]
Message-ID: <20201022082143.21170-8-igor.opaniuk@gmail.com> (raw)
In-Reply-To: <20201022082143.21170-1-igor.opaniuk@gmail.com>

From: Igor Opaniuk <igor.opaniuk@toradex.com>

Add implementation of board_mem_get_layout for overriding the memory
layout.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

 board/toradex/colibri-imx8x/colibri-imx8x.c | 23 +++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/board/toradex/colibri-imx8x/colibri-imx8x.c b/board/toradex/colibri-imx8x/colibri-imx8x.c
index f981c11a37..da081e30be 100644
--- a/board/toradex/colibri-imx8x/colibri-imx8x.c
+++ b/board/toradex/colibri-imx8x/colibri-imx8x.c
@@ -39,6 +39,29 @@ static void setup_iomux_uart(void)
 	imx8_iomux_setup_multiple_pads(uart3_pads, ARRAY_SIZE(uart3_pads));
 }
 
+void board_mem_get_layout(u64 *phys_sdram_1_start,
+			  u64 *phys_sdram_1_size,
+			  u64 *phys_sdram_2_start,
+			  u64 *phys_sdram_2_size)
+{
+	u32 is_dualx = 0, val = 0;
+	sc_err_t scierr = sc_misc_otp_fuse_read(-1, 6, &val);
+
+	if (scierr == SC_ERR_NONE) {
+		/* DX has two A35 cores disabled */
+		is_dualx = (val & 0xf) != 0x0;
+	}
+
+	*phys_sdram_1_start = PHYS_SDRAM_1;
+	if (is_dualx)
+		/* Our DX based SKUs only have 1 GB RAM */
+		*phys_sdram_1_size = SZ_1G;
+	else
+		*phys_sdram_1_size = PHYS_SDRAM_1_SIZE;
+	*phys_sdram_2_start = PHYS_SDRAM_2;
+	*phys_sdram_2_size = PHYS_SDRAM_2_SIZE;
+}
+
 int board_early_init_f(void)
 {
 	sc_pm_clock_rate_t rate;
-- 
2.17.1

  parent reply	other threads:[~2020-10-22  8:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22  8:21 [PATCH v1 0/7] toradex: add support for Apalis iMX8X WB IT V1.1 module Igor Opaniuk
2020-10-22  8:21 ` [PATCH v1 1/7] ARM: dts: fsl-imx8qxp-apalis: add initial device tree Igor Opaniuk
2020-10-29 16:51   ` Oleksandr Suvorov
2020-12-08  7:59   ` sbabic at denx.de
2020-10-22  8:21 ` [PATCH v1 2/7] board: toradex: add apalis-imx8x 2gb wb it v1.1a module support Igor Opaniuk
2020-10-29 16:52   ` Oleksandr Suvorov
2020-11-19 14:27   ` Oliver Graute
2020-12-08  7:58   ` sbabic at denx.de
2020-10-22  8:21 ` [PATCH v1 3/7] doc: board: apalis-imx8x: add documentation Igor Opaniuk
2020-10-29 16:53   ` Oleksandr Suvorov
2020-12-08  7:58   ` sbabic at denx.de
2020-10-22  8:21 ` [PATCH v1 4/7] imx8: allow overriding memory layout Igor Opaniuk
2020-10-29 16:57   ` Oleksandr Suvorov
2020-12-08  7:59   ` sbabic at denx.de
2020-10-22  8:21 ` [PATCH v1 5/7] apalis-imx8: add implementation for board_mem_get_layout Igor Opaniuk
2020-10-30 15:19   ` Oleksandr Suvorov
2020-12-08  7:59   ` sbabic at denx.de
2020-10-22  8:21 ` [PATCH v1 6/7] apalis-imx8x: " Igor Opaniuk
2020-12-08  7:58   ` sbabic at denx.de
2020-10-22  8:21 ` Igor Opaniuk [this message]
2020-12-08  7:59   ` [PATCH v1 7/7] colibri-imx8x: " sbabic at denx.de

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=20201022082143.21170-8-igor.opaniuk@gmail.com \
    --to=igor.opaniuk@gmail.com \
    --cc=u-boot@lists.denx.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