[PATCH v1 4/5] toradex: apalis-imx8: simplify module version handling
Stefan Eichenberger
eichest at gmail.com
Wed Dec 11 13:18:54 CET 2024
From: Stefan Eichenberger <stefan.eichenberger at toradex.com>
Simplify module version handling by removing the special case for the
Apalis iMX8QM.
The Apalis iMX8QM has been treated as a special case in module version
handling, but was always the default. By removing this special handling,
the code is simplified and easier to maintain.
We will not print the message "Unknown Apalis iMX8 module" anymore.
However, we still handle this because if the config block is missing we
show "MISSING TORADEX CONFIG BLOCK" and if the serial number is unknown
we show "Model: Toradex 0000 UNKNOWN MODULE V1.1A". Therefore, it is
still possible to detect such issues.
Signed-off-by: Stefan Eichenberger <stefan.eichenberger at toradex.com>
---
board/toradex/apalis-imx8/apalis-imx8.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c
index 1dc9483f022..a8c38208693 100644
--- a/board/toradex/apalis-imx8/apalis-imx8.c
+++ b/board/toradex/apalis-imx8/apalis-imx8.c
@@ -243,20 +243,12 @@ static enum pcb_rev_t get_pcb_revision(void)
static void select_dt_from_module_version(void)
{
- env_set("soc", "imx8qm");
- env_set("variant", "-v1.1");
+ if (get_pcb_revision() == PCB_VERSION_1_0)
+ env_set("variant", "");
+ else
+ env_set("variant", "-v1.1");
switch (tdx_hw_tag.prodid) {
- /* Select Apalis iMX8QM device trees */
- case APALIS_IMX8QM_IT:
- case APALIS_IMX8QM_WIFI_BT_IT:
- case APALIS_IMX8QM_8GB_WIFI_BT_IT:
- case APALIS_IMX8QM_IT_1300MHZ:
- case APALIS_IMX8QM_WIFI_BT_IT_1300MHZ:
- case APALIS_IMX8QM_8GB_WIFI_BT_IT_1300MHZ:
- if (get_pcb_revision() == PCB_VERSION_1_0)
- env_set("variant", "");
- break;
/* Select Apalis iMX8QP device trees */
case APALIS_IMX8QP_WIFI_BT:
case APALIS_IMX8QP:
@@ -265,8 +257,8 @@ static void select_dt_from_module_version(void)
env_set("soc", "imx8qp");
break;
default:
- printf("Unknown Apalis iMX8 module\n");
- return;
+ env_set("soc", "imx8qm");
+ break;
}
}
--
2.45.2
More information about the U-Boot
mailing list