[PATCH] fixup! ddr_spd: add routine for printing DDR2 SPD contents in human-readable format

Alexander Smirnov alllecs at yandex.ru
Mon Jul 13 07:47:00 PDT 2015


---
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




More information about the barebox mailing list