summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2021-10-18 14:51:45 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2021-10-26 09:33:45 +0000
commit030c1f695e1b8d8aea6d8296db7d506869a7c9c9 (patch)
tree34d0c69030ccdf8cc605130e39c38abb9df35812
parentd2cb3c20b0c76e33fd41d079d3e0ec076f891bb0 (diff)
colibri-imx8x: extraxt is_imx8dx() from ram detection
Refactor the detection of QXP vs. DX SoC into its own helper function. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
-rw-r--r--board/toradex/colibri-imx8x/colibri-imx8x.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/board/toradex/colibri-imx8x/colibri-imx8x.c b/board/toradex/colibri-imx8x/colibri-imx8x.c
index e4e96a207e..e98ddd2679 100644
--- a/board/toradex/colibri-imx8x/colibri-imx8x.c
+++ b/board/toradex/colibri-imx8x/colibri-imx8x.c
@@ -59,21 +59,25 @@ int board_ci_udc_phy_mode(void *__iomem phy_base, int phy_off)
}
}
-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)
+static int is_imx8dx(void)
{
- uint32_t is_dualx = 0, val = 0;
+ uint32_t 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;
+ return (val & 0xf) != 0x0;
}
+ return false;
+}
+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)
+{
*phys_sdram_1_start = PHYS_SDRAM_1;
- if (is_dualx)
+ if (is_imx8dx())
/* Our DX based SKUs only have 1 GB RAM */
*phys_sdram_1_size = SZ_1G;
else