]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
toradex: tdx-cfg-block: add carrier board info printing
authorIgor Opaniuk <igor.opaniuk@toradex.com>
Wed, 15 Jul 2020 10:30:57 +0000 (13:30 +0300)
committerStefano Babic <sbabic@denx.de>
Mon, 27 Jul 2020 12:00:36 +0000 (14:00 +0200)
Add carrier board info printing during boot time:

U-Boot 2020.07-rc4-02435-g1756e05 (Jun 22 2020 - 22:43:59 +0300)

CPU:   Freescale i.MX8MMQ rev1.0 at 1200 MHz
....
Carrier: Toradex Verdin Development Board V1.0A, Serial# 10622780
Verdin iMX8MM #

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
board/toradex/common/tdx-common.c

index 3a3cfc8821ead761430cc05769e236ab4c520db4..afe07be949a1bf82961f8deab89829bc5b604ed4 100644 (file)
 static char tdx_serial_str[9];
 static char tdx_board_rev_str[6];
 
+#ifdef CONFIG_TDX_CFG_BLOCK_EXTRA
+static char tdx_car_serial_str[9];
+static char tdx_car_rev_str[6];
+static char *tdx_carrier_board_name;
+#endif
+
 #ifdef CONFIG_REVISION_TAG
 u32 get_board_rev(void)
 {
@@ -88,6 +94,28 @@ int show_board_info(void)
                       toradex_modules[tdx_hw_tag.prodid],
                       tdx_board_rev_str,
                       tdx_serial_str);
+#ifdef CONFIG_TDX_CFG_BLOCK_EXTRA
+               if (read_tdx_cfg_block_carrier()) {
+                       printf("MISSING TORADEX CARRIER CONFIG BLOCKS\n");
+                       try_migrate_tdx_cfg_block_carrier();
+               } else {
+                       tdx_carrier_board_name = (char *)
+                               toradex_carrier_boards[tdx_car_hw_tag.prodid];
+
+                       sprintf(tdx_car_serial_str, "%08u", tdx_car_serial);
+                       sprintf(tdx_car_rev_str, "V%1d.%1d%c",
+                               tdx_car_hw_tag.ver_major,
+                               tdx_car_hw_tag.ver_minor,
+                               (char)tdx_car_hw_tag.ver_assembly +
+                               'A');
+
+                       env_set("carrier_serial#", tdx_car_serial_str);
+                       printf("Carrier: Toradex %s %s, Serial# %s\n",
+                              tdx_carrier_board_name,
+                              tdx_car_rev_str,
+                              tdx_car_serial_str);
+               }
+#endif
        }
 
        /*