[PATCH 2/3] ddr_spd: add routine for printing DDR2 SPD contents in human-readable format
Sascha Hauer
s.hauer at pengutronix.de
Mon Jul 13 02:44:58 PDT 2015
Hi Alexander,
On Fri, Jul 03, 2015 at 06:58:24PM +0300, Alexander Smirnov wrote:
> +
> + pcclk = ddrclk * tbits / 8;
> + 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;
Floats are not allowed in barebox, so the above has to be rewritten to
something like:
trcd = (((s->trcd >> 2) * 4) + (s->trcd & 3)) * 25 / ctime;
trp = (((s->trp >> 2) * 4) + (s->trp & 3)) * 25 / ctime;
Could you verify this is correct?
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list