]> git.sur5r.net Git - u-boot/commitdiff
ddr: altera: Replace float multiplication with integer one
authorMarek Vasut <marex@denx.de>
Mon, 10 Aug 2015 20:50:11 +0000 (22:50 +0200)
committerMarek Vasut <marex@denx.de>
Sun, 23 Aug 2015 09:56:19 +0000 (11:56 +0200)
This gem is really really rare, there was an actual float used in
the Altera DDR init code, which pulled in floating point ops from
the libgcc, just wow.

Since we don't support floating point operations the same way Linux
does not support them, replace this with an integer multiplication
and division combo. This removes some 2kiB of size from the SPL as
the floating point ops are no longer pulled in from libgcc.

This was detected by enabling CONFIG_USE_PRIVATE_LIBGCC=y , which
does not contain the floating point bits.

Signed-off-by: Marek Vasut <marex@denx.de>
drivers/ddr/altera/sequencer.c

index 2bd01092eedc1476fe2c171e4083aaae6f7f07ed..f3621cf5de44306d1e48cadc936303ee6bc5950d 100644 (file)
@@ -3247,7 +3247,7 @@ static void mem_skip_calibrate(void)
                         *    (1.25 * iocfg->dll_chain_length - 2)
                         */
                        scc_mgr_set_dqdqs_output_phase(i,
-                                      1.25 * iocfg->dll_chain_length - 2);
+                                      ((125 * iocfg->dll_chain_length) / 100) - 2);
                }
                writel(0xff, &sdr_scc_mgr->dqs_ena);
                writel(0xff, &sdr_scc_mgr->dqs_io_ena);