[U-Boot] [PATCH] powerpc/p2041rdb: fix SerDes clock display for RevC & RevD boards

Shaohui Xie Shaohui.Xie at freescale.com
Thu May 23 11:54:48 CEST 2013


For now there are three boards supported:

Early -PB board used schematic RevC(x) and it's PCBA rev4.0.
Now -PB board used schematic RevD(x) and it's PCBA rev5.0.
Now -PC board used schematic RevD(x) and it's PCBA rev5.0.

All RevD(x) boards have same clock setting on bank1 and bank2,
RevC(x) board has different clock setting on two banks, PCBA can
be used to distinguish the boards, PCBA could be increased on
RevD(x) board in future, but RevC(x) board will never has PCBA > 4.

Signed-off-by: Shaohui Xie <Shaohui.Xie at freescale.com>
---
 board/freescale/p2041rdb/p2041rdb.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/board/freescale/p2041rdb/p2041rdb.c b/board/freescale/p2041rdb/p2041rdb.c
index a706a6d..8549639 100644
--- a/board/freescale/p2041rdb/p2041rdb.c
+++ b/board/freescale/p2041rdb/p2041rdb.c
@@ -84,7 +84,10 @@ int checkboard(void)
 		};
 		unsigned int clock = (sw >> (2 * i)) & 3;
 
-		printf("Bank%u=%sMhz ", i+1, freq[i][clock]);
+		if ((i == 1) && (CPLD_READ(pcba_ver) >= 5))
+			printf("Bank%u=%sMhz ", i+1, freq[i-1][clock]);
+		else
+			printf("Bank%u=%sMhz ", i+1, freq[i][clock]);
 	}
 	puts("\n");
 
@@ -227,6 +230,16 @@ int misc_init_r(void)
 				"'00' is unsupported\n");
 		else
 			actual[i] = freq[i][clock];
+
+		/*
+		 * RevD(x) board has a different clock setting with RevC(x)
+		 * board, CPLD on RevD(x) board has pcba_ver >= 5. RevC(x)
+		 * board has pcba_ver = 4, it can be used to distinguish
+		 * the two boards.
+		 */
+		if ((i == 1) && (CPLD_READ(pcba_ver) >= 5))
+			/* RevD(x) board bank2 frequency */
+			actual[i] = freq[i-1][clock];
 	}
 
 	for (i = 0; i < NUM_SRDS_BANKS; i++) {
-- 
1.8.0




More information about the U-Boot mailing list