From: Patrick Delaunay Date: Wed, 12 Feb 2020 18:37:42 +0000 (+0100) Subject: board: stm32mp1: display reference only for STMicroelectronics board X-Git-Tag: v2020.07-rc1~41^2~6^2~19 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=61f6d4619859642c64870d54f75029d217e587fb;p=oweals%2Fu-boot.git board: stm32mp1: display reference only for STMicroelectronics board Display the reference MBxxxx found in OTP49 only for STMicroelectronics boards when CONFIG_CMD_STBOARD is activated. Signed-off-by: Patrick Delaunay Acked-by: Patrice Chotard # Conflicts: # board/st/stm32mp1/stm32mp1.c --- diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 4dd0098c6e..07f5344ec9 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -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;