Stefan Reinauer has submitted this change. ( 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 Reviewed-on: https://review.coreboot.org/c/em100/+/37184 Reviewed-by: Angel Pons th3fanbus@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M em100.c 1 file changed, 14 insertions(+), 12 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/em100.c b/em100.c index 8596edb..530e9d2 100644 --- a/em100.c +++ b/em100.c @@ -790,7 +790,6 @@ name); }
-/* get MCU and FPGA version, *100 encoded */ int main(int argc, char **argv) { int opt, idx; @@ -893,16 +892,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 @@ -910,9 +902,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)