Stefan Reinauer has uploaded this change for review. ( https://review.coreboot.org/c/em100/+/37184 )
Change subject: Clean up version code ......................................................................
Clean up version code
Organize by HW version first
Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org Change-Id: Ie44122b28044a781b1fe8a653f080cb84a8dc1b6 --- M em100.c 1 file changed, 14 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/84/37184/1
diff --git a/em100.c b/em100.c index 5e33af2..83fa06a 100644 --- a/em100.c +++ b/em100.c @@ -789,7 +789,6 @@ name); }
-/* get MCU and FPGA version, *100 encoded */ int main(int argc, char **argv) { int opt, idx; @@ -895,16 +894,9 @@ if (desiredchip && !chip) return 1;
- printf("MCU version: %d.%02d\n", em100.mcu >> 8, em100.mcu & 0xff); - if (em100.fpga > 0x0033) { /* 0.51 */ - if (em100.hwversion == HWVERSION_EM100PRO) - printf("FPGA version: %d.%02d (%s)\n", - em100.fpga >> 8 & 0x7f, em100.fpga & 0xff, - em100.fpga & 0x8000 ? "1.8V" : "3.3V"); - else /* EM100Pro-G2 */ - printf("FPGA version: %d.%03d\n", - em100.fpga >> 8 & 0x7f, em100.fpga & 0xff); - } else { + + if (em100.hwversion == HWVERSION_EM100PRO) { + printf("MCU version: %d.%02d\n", em100.mcu >> 8, em100.mcu & 0xff); /* While the Dediprog software for Windows will refuse to work * with 1.8V chips on older FPGA versions, it does not * specifically output a voltage when reporting the FPGA @@ -912,9 +904,19 @@ * known to behave the old way, 0.75 is behaving the new * way. */ - printf("FPGA version: %d.%02d\n", em100.fpga >> 8, + if (em100.fpga > 0x0033) /* 0.51 */ + printf("FPGA version: %d.%02d (%s)\n", + em100.fpga >> 8 & 0x7f, em100.fpga & 0xff, + em100.fpga & 0x8000 ? "1.8V" : "3.3V"); + else + printf("FPGA version: %d.%02d\n", em100.fpga >> 8, em100.fpga & 0xff); + } else {/* EM100Pro-G2 */ + printf("MCU version: %d.%d\n", em100.mcu >> 8, em100.mcu & 0xff); + printf("FPGA version: %d.%03d\n", + em100.fpga >> 8 & 0x7f, em100.fpga & 0xff); } + printf("Hardware version: %u\n", em100.hwversion);
if (em100.serialno != 0xffffffff)