From 030c1f695e1b8d8aea6d8296db7d506869a7c9c9 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Mon, 18 Oct 2021 14:51:45 +0200 Subject: 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 --- board/toradex/colibri-imx8x/colibri-imx8x.c | 18 +++++++++++------- 1 file 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 -- cgit v1.2.3