* [U-Boot] [PATCH 1/2] ddr: altera: Replace float multiplication with integer one
@ 2015-08-10 22:59 Marek Vasut
2015-08-10 22:59 ` [U-Boot] [PATCH 2/2] ddr: altera: Repair uninited variable Marek Vasut
2015-08-18 20:13 ` [U-Boot] [PATCH 1/2] ddr: altera: Replace float multiplication with integer one Dinh Nguyen
0 siblings, 2 replies; 6+ messages in thread
From: Marek Vasut @ 2015-08-10 22:59 UTC (permalink / raw)
To: u-boot
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ddr/altera/sequencer.c b/drivers/ddr/altera/sequencer.c
index 2bd0109..f3621cf 100644
--- a/drivers/ddr/altera/sequencer.c
+++ b/drivers/ddr/altera/sequencer.c
@@ -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);
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 2/2] ddr: altera: Repair uninited variable
2015-08-10 22:59 [U-Boot] [PATCH 1/2] ddr: altera: Replace float multiplication with integer one Marek Vasut
@ 2015-08-10 22:59 ` Marek Vasut
2015-08-18 20:14 ` Dinh Nguyen
2015-08-18 20:13 ` [U-Boot] [PATCH 1/2] ddr: altera: Replace float multiplication with integer one Dinh Nguyen
1 sibling, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2015-08-10 22:59 UTC (permalink / raw)
To: u-boot
Fix the following problem:
drivers/ddr/altera/sequencer.c: In function 'sdram_calibration_full':
drivers/ddr/altera/sequencer.c:1943:25: warning: 'found_failing_read' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (found_passing_read && found_failing_read)
^
drivers/ddr/altera/sequencer.c:1803:26: note: 'found_failing_read' was declared here
u32 found_passing_read, found_failing_read, initial_failing_dtap;
^
Signed-off-by: Marek Vasut <marex@denx.de>
---
drivers/ddr/altera/sequencer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ddr/altera/sequencer.c b/drivers/ddr/altera/sequencer.c
index f3621cf..79c265f 100644
--- a/drivers/ddr/altera/sequencer.c
+++ b/drivers/ddr/altera/sequencer.c
@@ -1800,7 +1800,7 @@ static int rw_mgr_mem_calibrate_vfifo_find_dqs_en_phase(const u32 grp)
u32 d, p, i;
u32 dtaps_per_ptap;
u32 work_bgn, work_end;
- u32 found_passing_read, found_failing_read, initial_failing_dtap;
+ u32 found_passing_read, found_failing_read = 0, initial_failing_dtap;
int ret;
debug("%s:%d %u\n", __func__, __LINE__, grp);
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 1/2] ddr: altera: Replace float multiplication with integer one
2015-08-10 22:59 [U-Boot] [PATCH 1/2] ddr: altera: Replace float multiplication with integer one Marek Vasut
2015-08-10 22:59 ` [U-Boot] [PATCH 2/2] ddr: altera: Repair uninited variable Marek Vasut
@ 2015-08-18 20:13 ` Dinh Nguyen
2015-08-18 22:07 ` Marek Vasut
1 sibling, 1 reply; 6+ messages in thread
From: Dinh Nguyen @ 2015-08-18 20:13 UTC (permalink / raw)
To: u-boot
On 8/10/15 5:59 PM, Marek Vasut wrote:
> 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 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ddr/altera/sequencer.c b/drivers/ddr/altera/sequencer.c
> index 2bd0109..f3621cf 100644
Acked-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Thanks,
Dinh
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 2/2] ddr: altera: Repair uninited variable
2015-08-10 22:59 ` [U-Boot] [PATCH 2/2] ddr: altera: Repair uninited variable Marek Vasut
@ 2015-08-18 20:14 ` Dinh Nguyen
2015-08-18 22:06 ` Marek Vasut
0 siblings, 1 reply; 6+ messages in thread
From: Dinh Nguyen @ 2015-08-18 20:14 UTC (permalink / raw)
To: u-boot
On 8/10/15 5:59 PM, Marek Vasut wrote:
> Fix the following problem:
> drivers/ddr/altera/sequencer.c: In function 'sdram_calibration_full':
> drivers/ddr/altera/sequencer.c:1943:25: warning: 'found_failing_read' may be used uninitialized in this function [-Wmaybe-uninitialized]
> if (found_passing_read && found_failing_read)
> ^
> drivers/ddr/altera/sequencer.c:1803:26: note: 'found_failing_read' was declared here
> u32 found_passing_read, found_failing_read, initial_failing_dtap;
> ^
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> drivers/ddr/altera/sequencer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Acked-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Thanks,
Dinh
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 2/2] ddr: altera: Repair uninited variable
2015-08-18 20:14 ` Dinh Nguyen
@ 2015-08-18 22:06 ` Marek Vasut
0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2015-08-18 22:06 UTC (permalink / raw)
To: u-boot
On Tuesday, August 18, 2015 at 10:14:17 PM, Dinh Nguyen wrote:
> On 8/10/15 5:59 PM, Marek Vasut wrote:
> > Fix the following problem:
> > drivers/ddr/altera/sequencer.c: In function 'sdram_calibration_full':
> > drivers/ddr/altera/sequencer.c:1943:25: warning: 'found_failing_read' may
> > be used uninitialized in this function [-Wmaybe-uninitialized]
> >
> > if (found_passing_read && found_failing_read)
> >
> > ^
> >
> > drivers/ddr/altera/sequencer.c:1803:26: note: 'found_failing_read' was
> > declared here
> >
> > u32 found_passing_read, found_failing_read, initial_failing_dtap;
> >
> > ^
> >
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > ---
> >
> > drivers/ddr/altera/sequencer.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Acked-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Applied to u-boot-socfpga/master, thanks!
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 1/2] ddr: altera: Replace float multiplication with integer one
2015-08-18 20:13 ` [U-Boot] [PATCH 1/2] ddr: altera: Replace float multiplication with integer one Dinh Nguyen
@ 2015-08-18 22:07 ` Marek Vasut
0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2015-08-18 22:07 UTC (permalink / raw)
To: u-boot
On Tuesday, August 18, 2015 at 10:13:42 PM, Dinh Nguyen wrote:
> On 8/10/15 5:59 PM, Marek Vasut wrote:
> > 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.
Private libgcc is indeed helpful! :-)
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > ---
> >
> > drivers/ddr/altera/sequencer.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/ddr/altera/sequencer.c
> > b/drivers/ddr/altera/sequencer.c index 2bd0109..f3621cf 100644
>
> Acked-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Applied to u-boot-socfpga/master, thanks!
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-08-18 22:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-10 22:59 [U-Boot] [PATCH 1/2] ddr: altera: Replace float multiplication with integer one Marek Vasut
2015-08-10 22:59 ` [U-Boot] [PATCH 2/2] ddr: altera: Repair uninited variable Marek Vasut
2015-08-18 20:14 ` Dinh Nguyen
2015-08-18 22:06 ` Marek Vasut
2015-08-18 20:13 ` [U-Boot] [PATCH 1/2] ddr: altera: Replace float multiplication with integer one Dinh Nguyen
2015-08-18 22:07 ` Marek Vasut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox