diff options
author | wdenk <wdenk> | 2003-11-07 13:42:26 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2003-11-07 13:42:26 +0000 |
commit | 5cf9da4821db0b6d86d8bbb74af86a0303063201 (patch) | |
tree | 7173b1bb9eb0611765921aee5312a7c4d9ac67ad /cpu/mpc5xxx/i2c.c | |
parent | b13fb01a62708492cae4b33c4d6fa9ae127905f4 (diff) | |
download | u-boot-imx-5cf9da4821db0b6d86d8bbb74af86a0303063201.zip u-boot-imx-5cf9da4821db0b6d86d8bbb74af86a0303063201.tar.gz u-boot-imx-5cf9da4821db0b6d86d8bbb74af86a0303063201.tar.bz2 |
* Patch by Bernhard Kuhn, 28 Oct 2003:
Add low boot support for MPC5200
* Fix problem with dual PCMCIA support (NSCU)
* Fix MPC5200 I2C initialization function
Diffstat (limited to 'cpu/mpc5xxx/i2c.c')
-rw-r--r-- | cpu/mpc5xxx/i2c.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cpu/mpc5xxx/i2c.c b/cpu/mpc5xxx/i2c.c index ea37fb0..75c7739 100644 --- a/cpu/mpc5xxx/i2c.c +++ b/cpu/mpc5xxx/i2c.c @@ -229,9 +229,10 @@ static int mpc_get_fdr(int speed) { DECLARE_GLOBAL_DATA_PTR; static int fdr = -1; - static int best_speed = 0; if (fdr == -1) { + ulong best_speed = 0; + ulong divider; ulong ipb, scl; ulong bestmatch = 0xffffffffUL; int best_i = 0, best_j = 0, i, j; @@ -262,8 +263,13 @@ static int mpc_get_fdr(int speed) } } } - fdr = (best_i & 3) | ((best_i & 4) << 3) | (best_j << 2); - printf("%d kHz, ", best_speed / 1000); + divider = (best_i & 3) | ((best_i & 4) << 3) | (best_j << 2); + if (gd->flags & GD_FLG_RELOC) { + fdr = divider; + } else { + printf("%ld kHz, ", best_speed / 1000); + return divider; + } } return fdr; |