summaryrefslogtreecommitdiff
path: root/board/sandburst/common/sb_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/sandburst/common/sb_common.c')
-rw-r--r--board/sandburst/common/sb_common.c103
1 files changed, 52 insertions, 51 deletions
diff --git a/board/sandburst/common/sb_common.c b/board/sandburst/common/sb_common.c
index 12334dfdd1..b579812ccf 100644
--- a/board/sandburst/common/sb_common.c
+++ b/board/sandburst/common/sb_common.c
@@ -10,7 +10,6 @@
#include <asm/io.h>
#include <spd_sdram.h>
#include <i2c.h>
-#include "ppc440gx_i2c.h"
#include "sb_common.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -68,7 +67,7 @@ unsigned short sbcommon_get_serial_number(void)
/* Get the board serial number from eeprom */
/* Initialize I2C */
- i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_set_bus_num(0);
/* Read 256 bytes in EEPROM */
i2c_read (0x50, 0, 1, buff, 0x100);
@@ -94,85 +93,87 @@ void sbcommon_fans(void)
* Attempt to turn on 2 of the fans...
* Need to go through the bridge
*/
+ i2c_set_bus_num(1);
puts ("FANS: ");
/* select fan4 through the bridge */
- i2c_reg_write1(0x73, /* addr */
- 0x00, /* reg */
- 0x08); /* val = bus 4 */
+ i2c_reg_write(0x73, /* addr */
+ 0x00, /* reg */
+ 0x08); /* val = bus 4 */
/* Turn on FAN 4 */
- i2c_reg_write1(0x2e,
- 1,
- 0x80);
+ i2c_reg_write(0x2e,
+ 1,
+ 0x80);
- i2c_reg_write1(0x2e,
- 0,
- 0x19);
+ i2c_reg_write(0x2e,
+ 0,
+ 0x19);
/* Deselect bus 4 on the bridge */
- i2c_reg_write1(0x73,
- 0x00,
- 0x00);
+ i2c_reg_write(0x73,
+ 0x00,
+ 0x00);
/* select fan3 through the bridge */
- i2c_reg_write1(0x73, /* addr */
- 0x00, /* reg */
- 0x04); /* val = bus 3 */
+ i2c_reg_write(0x73, /* addr */
+ 0x00, /* reg */
+ 0x04); /* val = bus 3 */
/* Turn on FAN 3 */
- i2c_reg_write1(0x2e,
- 1,
- 0x80);
+ i2c_reg_write(0x2e,
+ 1,
+ 0x80);
- i2c_reg_write1(0x2e,
- 0,
- 0x19);
+ i2c_reg_write(0x2e,
+ 0,
+ 0x19);
/* Deselect bus 3 on the bridge */
- i2c_reg_write1(0x73,
- 0x00,
- 0x00);
+ i2c_reg_write(0x73,
+ 0x00,
+ 0x00);
/* select fan2 through the bridge */
- i2c_reg_write1(0x73, /* addr */
- 0x00, /* reg */
- 0x02); /* val = bus 4 */
+ i2c_reg_write(0x73, /* addr */
+ 0x00, /* reg */
+ 0x02); /* val = bus 4 */
/* Turn on FAN 2 */
- i2c_reg_write1(0x2e,
- 1,
- 0x80);
+ i2c_reg_write(0x2e,
+ 1,
+ 0x80);
- i2c_reg_write1(0x2e,
- 0,
- 0x19);
+ i2c_reg_write(0x2e,
+ 0,
+ 0x19);
/* Deselect bus 2 on the bridge */
- i2c_reg_write1(0x73,
- 0x00,
- 0x00);
+ i2c_reg_write(0x73,
+ 0x00,
+ 0x00);
/* select fan1 through the bridge */
- i2c_reg_write1(0x73, /* addr */
- 0x00, /* reg */
- 0x01); /* val = bus 0 */
+ i2c_reg_write(0x73, /* addr */
+ 0x00, /* reg */
+ 0x01); /* val = bus 0 */
/* Turn on FAN 1 */
- i2c_reg_write1(0x2e,
- 1,
- 0x80);
+ i2c_reg_write(0x2e,
+ 1,
+ 0x80);
- i2c_reg_write1(0x2e,
- 0,
- 0x19);
+ i2c_reg_write(0x2e,
+ 0,
+ 0x19);
/* Deselect bus 1 on the bridge */
- i2c_reg_write1(0x73,
- 0x00,
- 0x00);
+ i2c_reg_write(0x73,
+ 0x00,
+ 0x00);
puts ("on\n");
+ i2c_set_bus_num(0);
return;
@@ -303,7 +304,7 @@ void board_get_enetaddr(int macaddr_idx, uchar *enet)
if (0 == macaddr_idx) {
/* Initialize I2C */
- i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+ i2c_set_bus_num(0);
/* Read 256 bytes in EEPROM */
i2c_read (0x50, 0, 1, buff, 0x100);