i2c, ppc4xx_i2c: switch to new multibus/multiadapter support
Signed-off-by: Dirk Eibach <dirk.eibach@gdsys.cc> Cc: Heiko Schocher <hs@denx.de> Cc: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
This commit is contained in:
committed by
Heiko Schocher
parent
1f2ba722ac
commit
880540decf
@@ -52,10 +52,6 @@
|
||||
/*
|
||||
* Set default values
|
||||
*/
|
||||
#ifndef CONFIG_SYS_I2C_SPEED
|
||||
#define CONFIG_SYS_I2C_SPEED 50000
|
||||
#endif
|
||||
|
||||
#define ONE_BILLION 1000000000
|
||||
|
||||
#define SDRAM0_CFG_DCE 0x80000000
|
||||
@@ -158,7 +154,7 @@ long int spd_sdram(int(read_spd)(uint addr))
|
||||
* Make sure I2C controller is initialized
|
||||
* before continuing.
|
||||
*/
|
||||
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
|
||||
i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
|
||||
}
|
||||
|
||||
/* Make shure we are using SDRAM */
|
||||
|
||||
@@ -62,10 +62,6 @@
|
||||
/*
|
||||
* Set default values
|
||||
*/
|
||||
#ifndef CONFIG_SYS_I2C_SPEED
|
||||
#define CONFIG_SYS_I2C_SPEED 50000
|
||||
#endif
|
||||
|
||||
#define ONE_BILLION 1000000000
|
||||
|
||||
/*
|
||||
@@ -168,7 +164,7 @@ long int spd_sdram(void) {
|
||||
* Make sure I2C controller is initialized
|
||||
* before continuing.
|
||||
*/
|
||||
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
|
||||
i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
|
||||
|
||||
/*
|
||||
* Read the SPD information using I2C interface. Check to see if the
|
||||
|
||||
@@ -459,8 +459,7 @@ phys_size_t initdram(int board_type)
|
||||
*/
|
||||
|
||||
/* switch to correct I2C bus */
|
||||
I2C_SET_BUS(CONFIG_SYS_SPD_BUS_NUM);
|
||||
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
|
||||
i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
* Clear out the serial presence detect buffers.
|
||||
|
||||
@@ -56,7 +56,7 @@ static int do_chip_config(cmd_tbl_t *cmdtp, int flag, int argc, char * const arg
|
||||
* First switch to correct I2C bus. This is I2C bus 0
|
||||
* for all currently available 4xx derivats.
|
||||
*/
|
||||
I2C_SET_BUS(0);
|
||||
i2c_set_bus_num(0);
|
||||
|
||||
#ifdef CONFIG_CMD_EEPROM
|
||||
ret = eeprom_read(CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR,
|
||||
|
||||
@@ -1041,8 +1041,7 @@ phys_size_t initdram(int board_type)
|
||||
* before continuing.
|
||||
*/
|
||||
/* switch to correct I2C bus */
|
||||
I2C_SET_BUS(CONFIG_SYS_SPD_BUS_NUM);
|
||||
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
|
||||
i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
* Clear out the serial presence detect buffers.
|
||||
|
||||
@@ -34,24 +34,6 @@
|
||||
|
||||
#define IIC_TIMEOUT 1 /* 1 second */
|
||||
|
||||
#if defined(CONFIG_I2C_MULTI_BUS)
|
||||
#define I2C_BUS_OFFS (i2c_bus_num * 0x100)
|
||||
#else
|
||||
#define I2C_BUS_OFFS (0x000)
|
||||
#endif /* CONFIG_I2C_MULTI_BUS */
|
||||
|
||||
#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
|
||||
defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
#define I2C_BASE_ADDR (CONFIG_SYS_PERIPHERAL_BASE + 0x00000700 + I2C_BUS_OFFS)
|
||||
#elif defined(CONFIG_440) || defined(CONFIG_405EX)
|
||||
/* all remaining 440 variants */
|
||||
#define I2C_BASE_ADDR (CONFIG_SYS_PERIPHERAL_BASE + 0x00000400 + I2C_BUS_OFFS)
|
||||
#else
|
||||
/* all 405 variants */
|
||||
#define I2C_BASE_ADDR (0xEF600500 + I2C_BUS_OFFS)
|
||||
#endif
|
||||
|
||||
struct ppc4xx_i2c {
|
||||
u8 mdbuf;
|
||||
u8 res1;
|
||||
|
||||
Reference in New Issue
Block a user