mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fixup! ddr_spd: add routine for printing DDR2 SPD contents in human-readable format
@ 2015-07-13 14:47 Alexander Smirnov
  2015-07-14  5:09 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Smirnov @ 2015-07-13 14:47 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox, Alexander Smirnov

---
drop floating point stuff 

 common/ddr_spd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/ddr_spd.c b/common/ddr_spd.c
index 39f383b..ec343ef 100644
--- a/common/ddr_spd.c
+++ b/common/ddr_spd.c
@@ -190,8 +190,8 @@ void ddr_spd_print(uint8_t *record)
 	pcclk = pcclk - (pcclk % 100);
 	i_i = (s->nrow_addr & 0x0f) + (s->ncol_addr & 0x0f) - 17;
 	k = ((s->mod_ranks & 0x7) + 1) * s->nbanks;
-	trcd = ((s->trcd >> 2) + ((s->trcd & 3) * 0.25)) * 100 / ctime;
-	trp = ((s->trp >> 2) + ((s->trp & 3) * 0.25)) * 100 / ctime;
+	trcd = ((s->trcd >> 2) * 4 + (s->trcd & 3)) * 25 / ctime;
+	trp = ((s->trp >> 2) * 4 + (s->trp & 3)) * 25 / ctime;
 	tras = s->tras * 100 / ctime ;
 	x = (int)(ctime / 100);
 	y = (ctime - (int)((ctime / 100) * 100)) / 10;
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-14  5:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-13 14:47 [PATCH] fixup! ddr_spd: add routine for printing DDR2 SPD contents in human-readable format Alexander Smirnov
2015-07-14  5:09 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox