aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorMax Krummenacher2023-03-03 14:26:32 +0100
committerStefano Babic2023-03-30 10:47:31 +0200
commit7689fc5524a6fff2c0d70c0d855aece85a5acd21 (patch)
tree86499677ae045ce4a802166211d8bc8373ca1756 /board
parent16db559a2d3d21a655ca0d1907d19179b5957dd9 (diff)
colibri-imx8x: extract 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> Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Diffstat (limited to 'board')
-rw-r--r--board/toradex/colibri-imx8x/colibri-imx8x.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/board/toradex/colibri-imx8x/colibri-imx8x.c b/board/toradex/colibri-imx8x/colibri-imx8x.c
index 169d4d04b16..88eddbddaef 100644
--- a/board/toradex/colibri-imx8x/colibri-imx8x.c
+++ b/board/toradex/colibri-imx8x/colibri-imx8x.c
@@ -40,21 +40,25 @@ 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)
+static int is_imx8dx(void)
{
- u32 is_dualx = 0, val = 0;
- sc_err_t scierr = sc_misc_otp_fuse_read(-1, 6, &val);
+ u32 val = 0;
+ sc_err_t sc_err = sc_misc_otp_fuse_read(-1, 6, &val);
- if (scierr == SC_ERR_NONE) {
+ if (sc_err == 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(u64 *phys_sdram_1_start,
+ u64 *phys_sdram_1_size,
+ u64 *phys_sdram_2_start,
+ u64 *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