Get DDR3 or DDR2 serial number, 0 most of the times, always return a valid ptr */
| 538 | |
| 539 | /** Get DDR3 or DDR2 serial number, 0 most of the times, always return a valid ptr */ |
| 540 | CHAR8* getDDRSerial(UINT8* spd) |
| 541 | { |
| 542 | CHAR8* asciiSerial; //[16]; |
| 543 | asciiSerial = (__typeof__(asciiSerial))AllocatePool(17); |
| 544 | if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR4) { // DDR4 |
| 545 | snprintf(asciiSerial, 17, "%01hhX%01hhX%01hhX%01hhX%01hhX%01hhX%01hhX%01hhX", SMST(325) /*& 0x7*/, SLST(325), SMST(326), SLST(326), SMST(327), SLST(327), SMST(328), SLST(328)); |
| 546 | } else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR3) { // DDR3 |
| 547 | snprintf(asciiSerial, 17, "%01hhX%01hhX%01hhX%01hhX%01hhX%01hhX%01hhX%01hhX", SMST(122) /*& 0x7*/, SLST(122), SMST(123), SLST(123), SMST(124), SLST(124), SMST(125), SLST(125)); |
| 548 | } else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2 || |
| 549 | spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR) { // DDR2 or DDR |
| 550 | snprintf(asciiSerial, 17, "%01hhX%01hhX%01hhX%01hhX%01hhX%01hhX%01hhX%01hhX", SMST(95) /*& 0x7*/, SLST(95), SMST(96), SLST(96), SMST(97), SLST(97), SMST(98), SLST(98)); |
| 551 | } else { |
| 552 | AsciiStrCpyS(asciiSerial, 17, "0000000000000000"); |
| 553 | } |
| 554 | |
| 555 | return asciiSerial; |
| 556 | } |
| 557 | |
| 558 | /** Get DDR2 or DDR3 or DDR4 Part Number, always return a valid ptr */ |
| 559 | CHAR8* getDDRPartNum(UINT8* spd, UINT32 base, UINT8 slot) |
no test coverage detected