/* CRC16 compute for DDR3 SPD Copied from DDR3 SPD spec.  */
static int crc16(char *ptr, int count)
/* CRC16 compute for DDR3 SPD Copied from DDR3 SPD spec.  */
static int crc16(char *ptr, int count)
{
	int crc, i;
	crc = 0;
	while (--count >= 0) {
		crc = crc ^ (int)*ptr++ << 8;
		for (i = 0; i < 8; ++i)
			if (crc & 0x8000)
				crc = crc << 1 ^ 0x1021;
			else
				crc = crc << 1;
	}
	return crc & 0xffff;
}