[PATCH 03/11] board: freescale: p1_p2_rdb_pc: Fix parsing negated upper 4 bits from boot input data

Pali Rohár pali at kernel.org
Thu Apr 7 12:16:16 CEST 2022


On some boards upper 4 bits of i2c boot input data (register 0) are
negated. So negate read input data back prior processing them.

Fixes printing correct rom_loc: value.

Signed-off-by: Pali Rohár <pali at kernel.org>
---
 board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
index 29502a5c05c2..766a82386079 100644
--- a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
+++ b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
@@ -202,6 +202,10 @@ int checkboard(void)
 	}
 	#endif
 
+#ifdef __SW_BOOT_IN_NEG_UPPER4
+	in = (~in & 0xf0) | (in & 0x0f);
+#endif
+
 	val = (in & io_config) | (out & (~io_config));
 
 	puts("rom_loc: ");
-- 
2.20.1



More information about the U-Boot mailing list