2 * Copyright 2008 Freescale Semiconductor, Inc.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * Version 2 as published by the Free Software Foundation.
12 /* used for ddr1 and ddr2 spd */
14 spd_check(const u8 *buf, u8 spd_rev, u8 spd_cksum)
16 unsigned int cksum = 0;
20 * Check SPD revision supported
21 * Rev 1.2 or less supported by this code
24 printf("SPD revision %02X not supported by this code\n",
32 for (i = 0; i < 63; i++) {
37 if (cksum != spd_cksum) {
38 printf("SPD checksum unexpected. "
39 "Checksum in SPD = %02X, computed SPD = %02X\n",
48 ddr1_spd_check(const ddr1_spd_eeprom_t *spd)
50 const u8 *p = (const u8 *)spd;
52 return spd_check(p, spd->spd_rev, spd->cksum);
56 ddr2_spd_check(const ddr2_spd_eeprom_t *spd)
58 const u8 *p = (const u8 *)spd;
60 return spd_check(p, spd->spd_rev, spd->cksum);