Skip to contentSkip to conversation

board: ti: am57xx: Fix detection of board version

PATCH New Lokesh Vutla 2 participants 6 messages Jul 16, 2017 – Jul 26, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 board: ti: am57xx: Fix detection of board version

board_is*("rev", board_ti_get_rev()) uses strncmp() for revison detection and assumes it is success if return value is <= 0. This will fail in case of multiple versions, as revb will be true for board_is_*revb() and board_is_*reva(). Fix it by looking for exact match of the string.

---
 board/ti/am57xx/board.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
board/ti/am57xx/board.c +2 -2
index bf8c8e1a67..6e248d6b1a 100644
@@ -36,11 +36,11 @@
 
 #define board_is_x15()		board_ti_is("BBRDX15_")
 #define board_is_x15_revb1()	(board_ti_is("BBRDX15_") && \
-				 (strncmp("B.10", board_ti_get_rev(), 3) <= 0))
+				 !strncmp("B.10", board_ti_get_rev(), 3))
 #define board_is_am572x_evm()	board_ti_is("AM572PM_")
 #define board_is_am572x_evm_reva3()	\
 				(board_ti_is("AM572PM_") && \
-				 (strncmp("A.30", board_ti_get_rev(), 3) <= 0))
+				 !strncmp("A.30", board_ti_get_rev(), 3))
 #define board_is_am572x_idk()	board_ti_is("AM572IDK")
 #define board_is_am571x_idk()	board_ti_is("AM571IDK")
 
Signature · 1 line
2.13.0
#1 lore raw

PATCH 2/2 board: ti: x15: Add support for beagle_X15 revC

BeagleBoard X15 revC board is similar to X15 revB1 except with a SR2.0 where revB1 uses a SR1.1. Add board detection support for revC.

---
 board/ti/am57xx/board.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
board/ti/am57xx/board.c +6 -1
index 6e248d6b1a..00a31a97fd 100644
@@ -37,6 +37,8 @@
 #define board_is_x15()		board_ti_is("BBRDX15_")
 #define board_is_x15_revb1()	(board_ti_is("BBRDX15_") && \
 				 !strncmp("B.10", board_ti_get_rev(), 3))
+#define board_is_x15_revc()	(board_ti_is("BBRDX15_") && \
+				 !strncmp("C.00", board_ti_get_rev(), 3))
 #define board_is_am572x_evm()	board_ti_is("AM572PM_")
 #define board_is_am572x_evm_reva3()	\
 				(board_ti_is("AM572PM_") && \
@@ -474,6 +476,8 @@ static void setup_board_eeprom_env(void)
 	if (board_is_x15()) {
 		if (board_is_x15_revb1())
 			name = "beagle_x15_revb1";
+		else if (board_is_x15_revc())
+			name = "beagle_x15_revc";
 		else
 			name = "beagle_x15";
 	} else if (board_is_am572x_evm()) {
@@ -683,7 +687,8 @@ void recalibrate_iodelay(void)
 
 	/* Now do the weird minor deltas that should be safe */
 	if (board_is_x15() || board_is_am572x_evm()) {
-		if (board_is_x15_revb1() || board_is_am572x_evm_reva3()) {
+		if (board_is_x15_revb1() || board_is_am572x_evm_reva3() ||
+		    board_is_x15_revc()) {
 			pconf = core_padconf_array_delta_x15_sr2_0;
 			pconf_sz = ARRAY_SIZE(core_padconf_array_delta_x15_sr2_0);
 		} else {
Signature · 1 line
2.13.0
#2 lore raw

PATCH 2/2 board: ti: x15: Add support for beagle_X15 revC

Quoted 5 lines · Lokesh Vutla

BeagleBoard X15 revC board is similar to X15 revB1 except with a SR2.0 where revB1 uses a SR1.1. Add board detection support for revC.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170718/711ba392/attachment.sig>
#3 lore raw

PATCH 2/2 board: ti: x15: Add support for beagle_X15 revC

In reply to Lokesh Vutla
Quoted 6 lines · Lokesh Vutla

BeagleBoard X15 revC board is similar to X15 revB1 except with a SR2.0 where revB1 uses a SR1.1. Add board detection support for revC.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170726/7db896da/attachment.sig>
#4 lore raw

PATCH 1/2 board: ti: am57xx: Fix detection of board version

In reply to Lokesh Vutla
Quoted 7 lines · Lokesh Vutla

board_is*("rev", board_ti_get_rev()) uses strncmp() for revison detection and assumes it is success if return value is <= 0. This will fail in case of multiple versions, as revb will be true for board_is_*revb() and board_is_*reva(). Fix it by looking for exact match of the string.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170718/e5e338fc/attachment.sig>
#5 lore raw

PATCH 1/2 board: ti: am57xx: Fix detection of board version

In reply to Lokesh Vutla
Quoted 8 lines · Lokesh Vutla

board_is*("rev", board_ti_get_rev()) uses strncmp() for revison detection and assumes it is success if return value is <= 0. This will fail in case of multiple versions, as revb will be true for board_is_*revb() and board_is_*reva(). Fix it by looking for exact match of the string.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170726/a3e5cd62/attachment.sig>