[coreboot-gerrit] Change in coreboot[master]: device/dram/ddr2.c: Add methods to compute to identify dram

Felix Held (Code Review) gerrit at coreboot.org
Thu Jan 25 14:09:13 CET 2018


Felix Held has posted comments on this change. ( https://review.coreboot.org/23345 )

Change subject: device/dram/ddr2.c: Add methods to compute to identify dram
......................................................................


Patch Set 3:

> > > the crc16 function is a copy of the one found in
 > > src/device/dram/ddr3.c
 > > > so I'd rather like this to be factored out in a file that is
 > used
 > > > for both ddr2 and ddr3
 > >
 > > I simply copied it out of ddr3 but it could be any has sort of
 > crc
 > > or hash function. Are there any in coreboot? There is indeed no
 > > need to reuse this particular one here.
 > 
 > BTW the same holds true for ddr3 when computing a crc over the
 > unique ID bytes. I guess it simply reuses that out of convenience.

I don't see any strong reason not to use the crc16 here; if that worked well on ddr3, I'd also use it on ddr2.
I don't really like duplication of code that could be easily avoided thoough; duplicating code makes maintenance of the code base harder.

My suggestion would be to move the crc16 function in an extra c or h file and include it then in both ddr2 and ddr3 code


-- 
To view, visit https://review.coreboot.org/23345
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3c0c42786197f9b4eb3e42261c10ff5e4266120f
Gerrit-Change-Number: 23345
Gerrit-PatchSet: 3
Gerrit-Owner: Arthur Heymans <arthur at aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur at aheymans.xyz>
Gerrit-Reviewer: Felix Held <felix-coreboot at felixheld.de>
Gerrit-Reviewer: Patrick Rudolph <siro at das-labor.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
Gerrit-Comment-Date: Thu, 25 Jan 2018 13:09:13 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180125/29e4f79f/attachment.html>


More information about the coreboot-gerrit mailing list