mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: device/dram/ddr3: Fix calculation CRC16 of SPD
Fix regression with commit:
7dc4b84
device/dram/ddr3: Calculate CRC16 of SPD unique identifier
Misplaced parenthesis causes CRC check failure, potentially
rendering some platform unbootable.
BUG=None
BRANCH=None
TEST=None
Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/17550
Tested-by: build bot (Jenkins)
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Change-Id: I9699ee2ead5b99c7f46f6f4682235aae3125cca6
Reviewed-on: https://chromium-review.googlesource.com/413260
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
5c8580a161
commit
28e569fab7
1 changed files with 1 additions and 1 deletions
|
@ -52,7 +52,7 @@ static u16 crc16(const u8 *ptr, int n_crc)
|
|||
u16 crc = 0;
|
||||
|
||||
while (--n_crc >= 0) {
|
||||
crc = (crc ^ (int)*ptr++) << 8;
|
||||
crc = crc ^ ((int)*ptr++ << 8);
|
||||
for (i = 0; i < 8; ++i)
|
||||
if (crc & 0x8000) {
|
||||
crc = (crc << 1) ^ 0x1021;
|
||||
|
|
Loading…
Add table
Reference in a new issue