diff options
Diffstat (limited to 'board/kontron/sl-mx8mm/spl.c')
-rw-r--r-- | board/kontron/sl-mx8mm/spl.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/board/kontron/sl-mx8mm/spl.c b/board/kontron/sl-mx8mm/spl.c index 403ab9a3ea..8e7d017688 100644 --- a/board/kontron/sl-mx8mm/spl.c +++ b/board/kontron/sl-mx8mm/spl.c @@ -29,6 +29,7 @@ DECLARE_GLOBAL_DATA_PTR; enum { BOARD_TYPE_KTN_N801X, + BOARD_TYPE_KTN_N802X, BOARD_TYPE_MAX }; @@ -110,9 +111,22 @@ static void spl_dram_init(void) int do_board_detect(void) { - gd->board_type = BOARD_TYPE_KTN_N801X; - printf("Kontron SL i.MX8MM (N801X) module, %u GB RAM detected\n", - (unsigned int)gd->ram_size); + struct udevice *udev; + + /* + * Check for the RTC on the OSM module. + */ + imx_iomux_v3_setup_multiple_pads(i2c1_pads, ARRAY_SIZE(i2c1_pads)); + + if (i2c_get_chip_for_busnum(0, 0x52, 0, &udev) == 0) { + gd->board_type = BOARD_TYPE_KTN_N802X; + printf("Kontron OSM-S i.MX8MM (N802X) module, %u GB RAM detected\n", + (unsigned int)gd->ram_size); + } else { + gd->board_type = BOARD_TYPE_KTN_N801X; + printf("Kontron SL i.MX8MM (N801X) module, %u GB RAM detected\n", + (unsigned int)gd->ram_size); + } /* * Check the I2C PMIC to detect the deprecated SoM with DA9063. @@ -135,6 +149,11 @@ int board_fit_config_name_match(const char *name) !strcmp(name, "imx8mm-kontron-bl"))) return 0; + if (gd->board_type == BOARD_TYPE_KTN_N802X && is_imx8mm() && + (!strcmp(name, "imx8mm-kontron-n802x-s") || + !strcmp(name, "imx8mm-kontron-bl-osm-s"))) + return 0; + return -1; } |