diff options
author | Camelia Groza <camelia.groza@nxp.com> | 2021-06-11 15:28:06 +0300 |
---|---|---|
committer | Priyanka Jain <priyanka.jain@nxp.com> | 2021-06-17 09:16:11 +0300 |
commit | c91b1305547ee72c0b0e5995c3b47d2b56ad698f (patch) | |
tree | d0036741e1e2e2354ddb945458026119b66346cb /board | |
parent | a484f7c4869723451c1ca98e8b2e9dbee0e8ff16 (diff) | |
download | u-boot-c91b1305547ee72c0b0e5995c3b47d2b56ad698f.tar.xz |
board: freescale: t208xrdb: detect the board revision version
Detect and print the board revision version based on the CPLD registers.
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/freescale/t208xrdb/t208xrdb.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/board/freescale/t208xrdb/t208xrdb.c b/board/freescale/t208xrdb/t208xrdb.c index 35f5dff466..f7fa65d1a1 100644 --- a/board/freescale/t208xrdb/t208xrdb.c +++ b/board/freescale/t208xrdb/t208xrdb.c @@ -27,14 +27,29 @@ DECLARE_GLOBAL_DATA_PTR; +u8 get_hw_revision(void) +{ + u8 ver = CPLD_READ(hw_ver); + + switch (ver) { + default: + case 0x1: + return 'C'; + case 0x0: + return 'D'; + case 0x2: + return 'E'; + } +} + int checkboard(void) { struct cpu_type *cpu = gd->arch.cpu; static const char *freq[3] = {"100.00MHZ", "125.00MHz", "156.25MHZ"}; printf("Board: %sRDB, ", cpu->name); - printf("Board rev: 0x%02x CPLD ver: 0x%02x, boot from ", - CPLD_READ(hw_ver), CPLD_READ(sw_ver)); + printf("Board rev: %c CPLD ver: 0x%02x, boot from ", + get_hw_revision(), CPLD_READ(sw_ver)); #ifdef CONFIG_SDCARD puts("SD/MMC\n"); |