summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Opaniuk <igor.opaniuk@toradex.com>2020-09-18 14:40:58 +0300
committerIgor Opaniuk <igor.opaniuk@toradex.com>2020-09-18 15:21:19 +0300
commit7efb4dbe94d0c13ab12538c011f3609a5dbfd6ff (patch)
tree3cfb2d769dcb300f74d0eb598e52c9ab7eab1209
parentffeb42c1a504ebb2bb0878057211a1c33b67a7fb (diff)
colibri-imx8x: add implementation for board_mem_get_layout
Add implementation of board_mem_get_layout for overriding the memory layout. Relates-to: ELB-3031 Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
-rw-r--r--board/toradex/colibri-imx8x/colibri-imx8x.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/board/toradex/colibri-imx8x/colibri-imx8x.c b/board/toradex/colibri-imx8x/colibri-imx8x.c
index abc6938965..73b6cbff26 100644
--- a/board/toradex/colibri-imx8x/colibri-imx8x.c
+++ b/board/toradex/colibri-imx8x/colibri-imx8x.c
@@ -51,6 +51,29 @@ static void setup_iomux_uart(void)
imx8_iomux_setup_multiple_pads(uart3_pads, ARRAY_SIZE(uart3_pads));
}
+void board_mem_get_layout(uint64_t *phys_sdram_1_start,
+ uint64_t *phys_sdram_1_size,
+ uint64_t *phys_sdram_2_start,
+ uint64_t *phys_sdram_2_size)
+{
+ uint32_t 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 = SC_80MHZ;