From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Sun Date: Mon, 14 Mar 2011 14:41:46 -0700 Subject: [U-Boot] [PATCHv2] fsl_ddr: Don't use full 64-bit divides on 32-bit PowerPC In-Reply-To: <1298478920-22044-1-git-send-email-Kyle.D.Moffett@boeing.com> References: <1298478920-22044-1-git-send-email-Kyle.D.Moffett@boeing.com> Message-ID: <1300138906.23720.55.camel@oslab-l1> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 2011-02-23 at 11:35 -0500, Kyle Moffett wrote: > 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. > > This decreases compute time rather significantly for each conversion and > avoids bringing in a very complicated function from libgcc. > > It should be noted that nothing else in U-Boot or the Linux kernel seems > to require a full 64-bit divide on any 32-bit PowerPC. > > Build-and-boot-tested on the HWW-1U-1A board using DDR2 SPD detection. > > Signed-off-by: Kyle Moffett > Cc: Andy Fleming > Cc: Kumar Gala > Cc: Wolfgang Denk > Cc: Kim Phillips > --- Acked-by: York Sun