board: stm32mp1: display reference only for STMicroelectronics board
authorPatrick Delaunay <patrick.delaunay@st.com>
Wed, 12 Feb 2020 18:37:42 +0000 (19:37 +0100)
committerPatrick Delaunay <patrick.delaunay@st.com>
Tue, 24 Mar 2020 13:15:05 +0000 (14:15 +0100)
Display the reference MBxxxx found in OTP49
only for STMicroelectronics boards when CONFIG_CMD_STBOARD
is activated.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
# Conflicts:
# board/st/stm32mp1/stm32mp1.c

board/st/stm32mp1/stm32mp1.c

index 4dd0098c6e8ab1ce6bd035ffbf79db95b82c8505..07f5344ec90f5aef7d78e1da6e0c44f6f48cb110 100644 (file)
@@ -105,20 +105,20 @@ int checkboard(void)
        puts("\n");
 
        /* display the STMicroelectronics board identification */
-       ret = uclass_get_device_by_driver(UCLASS_MISC,
-                                         DM_GET_DRIVER(stm32mp_bsec),
-                                         &dev);
-
-       if (!ret)
-               ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD),
-                               &otp, sizeof(otp));
-       if (ret > 0 && otp) {
-               printf("Board: MB%04x Var%d.%d Rev.%c-%02d\n",
-                      otp >> 16,
-                      (otp >> 12) & 0xF,
-                      (otp >> 4) & 0xF,
-                      ((otp >> 8) & 0xF) - 1 + 'A',
-                      otp & 0xF);
+       if (CONFIG_IS_ENABLED(CMD_STBOARD)) {
+               ret = uclass_get_device_by_driver(UCLASS_MISC,
+                                                 DM_GET_DRIVER(stm32mp_bsec),
+                                                 &dev);
+               if (!ret)
+                       ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD),
+                                       &otp, sizeof(otp));
+               if (ret > 0 && otp)
+                       printf("Board: MB%04x Var%d.%d Rev.%c-%02d\n",
+                              otp >> 16,
+                              (otp >> 12) & 0xF,
+                              (otp >> 4) & 0xF,
+                              ((otp >> 8) & 0xF) - 1 + 'A',
+                              otp & 0xF);
        }
 
        return 0;