[U-Boot-Users] [PATCH] Fix i2c divisor calcularion for PPC4xx

Jeff Mann MannJ at embeddedplanet.com
Wed Apr 11 18:12:57 CEST 2007


U-Boot Users:

This patch fixes changes the i2c_init(...) function to use the function
get_OPB_freq() rather than calculating the OPB speed by
sysInfo.freqPLB/sysInfo.pllOpbDiv. The get_OPB_freq() function is
specific per processor. The prior method was not and so was calculating
the wrong speed for some PPC4xx processors. 


PATCH:
  * Fixes OPB Speed calculation used for initializing i2c in PPC4xx
processors.

    Signed-off-by: Jeffrey Mann <mannj at embeddedplanet.com>


--- old/cpu/ppc4xx/i2c.c	2007-04-06 11:46:35.000000000 -0400
+++ new/cpu/ppc4xx/i2c.c	2007-04-11 11:51:35.000000000 -0400
@@ -124,8 +124,7 @@ void i2c_init(int speed, int slaveadd)
 
 		/* Clock divide Register */
 		/* get OPB frequency */
-		get_sys_info(&sysInfo);
-		freqOPB = sysInfo.freqPLB / sysInfo.pllOpbDiv;
+		freqOPB = get_OPB_freq(); 
 		/* set divisor according to freqOPB */
 		divisor = (freqOPB - 1) / 10000000;
 		if (divisor == 0)








More information about the U-Boot mailing list