tianocore / edk2

EDK II
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II
Other
4.54k stars 2.45k forks source link

MdePkg/BaseLib: Add CRC16 CCITT False Implementation. #6011

Closed apop5 closed 1 month ago

apop5 commented 1 month ago

Description

This change is added to incorporate basic implementation for CRC16-CCITT-FALSE algorithm.

This function is useful for providing CRC16 value used in other data structures that requires CRC16 values. JEDEC specifications for BDAT, eMMC and SPD callout this algorithm.

The lookup table is inherited from https://crccalc.com/ and the result values are also compared against this site.

How This Was Tested

Using BaseLib function, results were verified against the values generated on crccalc.com

Integration Instructions

N/A

lgao4 commented 1 month ago

Could you list more detail on the consumer code, such as BDAT table?

apop5 commented 1 month ago

Could you list more detail on the consumer code, such as BDAT table?

@lgao4

Some embedded controllers require the CRC16 CCITT false algorithm for their communication packets.

JEDEC also seems to favor this, as it is called out in EMMc specification, and SPD specificaitons.