From 08e8a21515bd12ce686263931a245a30f61db32e Mon Sep 17 00:00:00 2001 From: Rene Straub Date: Mon, 17 Aug 2020 11:24:56 +0200 Subject: [PATCH] hw21: fix RTC trimming - commit 7336361d5c broke PMIC RTC trim for hw21 - fixed hw type detection in init_bd_spl() --- board/nm/nmhw21/board.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/board/nm/nmhw21/board.c b/board/nm/nmhw21/board.c index b82882cab0..f0895a2f84 100644 --- a/board/nm/nmhw21/board.c +++ b/board/nm/nmhw21/board.c @@ -535,7 +535,13 @@ static void init_bd_spl(void) hw_type = 21; /* Assume hw21, unless BD tells different */ if (read_eeprom() >= 0) { - bd_get_hw_type(&hw_type); + int hw_type_from_bd = -1; + + /* If entry is found returns value, otherwise 0 */ + bd_get_hw_type(&hw_type_from_bd); + if (hw_type_from_bd != 0) { + hw_type = hw_type_from_bd; + } } else { puts("Could not get board ID.\n");