diff options
author | Frieder Schrempf <frieder.schrempf@kontron.de> | 2022-08-24 15:59:19 +0200 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2022-10-20 17:35:51 +0200 |
commit | ba30cc222748ac6686531acac490f06a2bdf9e5b (patch) | |
tree | fcbdb0aec9c27fdfe48b573d542fa27086f9c40e /board/kontron/sl-mx8mm | |
parent | c25c906c7b11e6b20a664e796a2a34a3c0d2a413 (diff) | |
download | u-boot-ba30cc222748ac6686531acac490f06a2bdf9e5b.tar.gz u-boot-ba30cc222748ac6686531acac490f06a2bdf9e5b.tar.bz2 u-boot-ba30cc222748ac6686531acac490f06a2bdf9e5b.zip |
imx: kontron-sl-mx8mm: Add support for Kontron Electronics SoM SL i.MX8MM OSM-S
This adds support for the Kontron Electronics SoM SL i.MX8MM OSM-S
and the matching baseboard BL i.MX8MM OSM-S.
The SoM hardware complies to the Open Standard Module (OSM) 1.0
specification, size S (https://sget.org/standards/osm).
The existing board configuration for the non-OSM SoM is reused and
allows to detect the SoM variant at runtime.
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Diffstat (limited to 'board/kontron/sl-mx8mm')
-rw-r--r-- | board/kontron/sl-mx8mm/sl-mx8mm.c | 7 | ||||
-rw-r--r-- | board/kontron/sl-mx8mm/spl.c | 25 |
2 files changed, 28 insertions, 4 deletions
diff --git a/board/kontron/sl-mx8mm/sl-mx8mm.c b/board/kontron/sl-mx8mm/sl-mx8mm.c index 6e73edeb23..641130112a 100644 --- a/board/kontron/sl-mx8mm/sl-mx8mm.c +++ b/board/kontron/sl-mx8mm/sl-mx8mm.c @@ -123,7 +123,12 @@ int board_init(void) int board_late_init(void) { - env_set("som_type", "sl"); + if (!fdt_node_check_compatible(gd->fdt_blob, 0, "kontron,imx8mm-n802x-som") || + !fdt_node_check_compatible(gd->fdt_blob, 0, "kontron,imx8mm-osm-s")) { + env_set("som_type", "osm-s"); + else + env_set("som_type", "sl"); + return 0; } 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; } |