On Thu, Jul 16, 2009 at 3:42 PM, Wolfgang Denk<w...@denx.de> wrote: > The MII speed calculation was based on the CPU clock (ppc_proc_freq), > but for MPC512x we must use the bus clock instead. > > This patch makes it use the correct clock and makes sure we don't > clobber reserved bits in the MII_SPEED register. > > Signed-off-by: Wolfgang Denk <w...@denx.de> > Cc: Grant Likely <grant.lik...@secretlab.ca> > Cc: Kumar Gala <ga...@kernel.crashing.org> > Cc: <net...@vger.kernel.org>
Looks good to me. Thanks for the work! I assume this is tested. I have not tested this on my board, and I've got one question below, but otherwise I think I can say.... Acked-by: Grant Likely <grant.lik...@secretlab.ca> > - fec->mii_speed = ((ppc_proc_freq + 4999999) / 5000000) << 1; > + if (get_bus_freq) { > + clock = get_bus_freq(ofdev->node); > + > + if (!clock) { > + dev_err(&ofdev->dev, "could not determine IPS/IPB > clock\n"); > + goto out_unmap_regs; > + } > + } else > + clock = ppc_proc_freq; > + > + /* scale for a MII clock <= 2.5 MHz */ > + speed = (clock + 2499999) / 2500000; The calculation has changed here for non mpc5121 users. Shouldn't the "clock = ppc_proc_freq;" line above be "clock = ppc_proc_freq / 2;"? Or was this also a bug in the original driver? g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev