u-boot/arch
Kyle Moffett e820a131f4 fsl_ddr: Don't use full 64-bit divides on 32-bit PowerPC
The current FreeScale MPC-8xxx DDR SPD interpreter is using full 64-bit
integer divide operations to convert between nanoseconds and DDR clock
cycles given arbitrary DDR clock frequencies.

Since all of the inputs to this are 32-bit (nanoseconds, clock cycles,
and DDR frequencies), we can easily restructure the computation to use
the "do_div()" function to perform 64-bit/32-bit divide operations.

On 64-bit this change is basically a no-op, because do_div is
implemented as a literal 64-bit divide operation and the instruction
scheduling works out almost the same.

On 32-bit PowerPC a fully accurate 64/64 divide (__udivdi3 in libgcc) is
over 1.1kB of code and thousands of heavily dependent cycles to compute,
all of which is linked from libgcc.  Another 1.2kB of code comes in for
the function __umoddi3.

It should be noted that nothing else in U-Boot or the Linux kernel seems
to require a full 64-bit divide on my 32-bit PowerPC.

Build-and-boot-tested on the HWW-1U-1A board using DDR2 SPD detection.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Acked-by: York Sun <yorksun@freescale.com>
Cc: Andy Fleming <afleming@gmail.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-04-04 09:24:43 -05:00
..
arm ARMV7: S5P: Fixed register offset in mmc.h 2011-03-27 19:20:21 +02:00
avr32 rename _end to __bss_end__ 2011-03-27 19:18:37 +02:00
blackfin Introduce a new linker flag LDFLAGS_FINAL 2011-03-22 23:32:06 +01:00
i386 Coding Style cleanup: remove trailing empty lines 2011-03-27 21:48:08 +02:00
m68k rename _end to __bss_end__ 2011-03-27 19:18:37 +02:00
microblaze microblaze: Fix msr handling in interrupt_handler 2011-02-15 15:13:24 +01:00
mips Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
nios2 rename _end to __bss_end__ 2011-03-27 19:18:37 +02:00
powerpc fsl_ddr: Don't use full 64-bit divides on 32-bit PowerPC 2011-04-04 09:24:43 -05:00
sh Coding Style cleanup: remove trailing empty lines 2011-03-27 21:48:08 +02:00
sparc Replace "FLASH" strings with "Flash" or "flash" 2011-01-19 00:02:37 +01:00
.gitignore update include/asm/ gitignore after move 2010-05-07 00:17:30 +02:00