diff mbox series

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

Message ID 20220407101624.15850-4-pali@kernel.org
State Superseded
Delegated to: Priyanka Jain
Headers show
Series board: freescale: p1_p2_rdb_pc: Various cleanups and fixes | expand

Commit Message

Pali Rohár April 7, 2022, 10:16 a.m. UTC
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@kernel.org>
---
 board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

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: ");