mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
ti: remove usage of DM_I2C_COMPAT and don't disable DM_I2C in SPL
DM_I2C_COMPAT is a compatibility layer that allows using the non-DM I2C API when DM_I2C is used. The goal is to eventually remove DM_I2C_COMPAT when all I2C "clients" have been migrated to use the DM API. This a step in that direction for the TI based platforms. Build tested with buildman: buildman -dle am33xx ti omap3 omap4 omap5 davinci keystone boot tested with: am335x_evm, am335x_boneblack, am335x_boneblack_vboot (DM version), am57xx_evm, dra7xx_evm, k2g_evm, am437x_evm Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
ad95da1f3c
commit
1514244cc1
11 changed files with 161 additions and 98 deletions
|
@ -403,6 +403,7 @@ static void init_ddr3param(struct ddr3_spd_cb *spd_cb,
|
|||
static int ddr3_read_spd(ddr3_spd_eeprom_t *spd_params)
|
||||
{
|
||||
int ret;
|
||||
#ifndef CONFIG_DM_I2C
|
||||
int old_bus;
|
||||
|
||||
i2c_init(CONFIG_SYS_DAVINCI_I2C_SPEED, CONFIG_SYS_DAVINCI_I2C_SLAVE);
|
||||
|
@ -413,7 +414,13 @@ static int ddr3_read_spd(ddr3_spd_eeprom_t *spd_params)
|
|||
ret = i2c_read(0x53, 0, 1, (unsigned char *)spd_params, 256);
|
||||
|
||||
i2c_set_bus_num(old_bus);
|
||||
#else
|
||||
struct udevice *dev;
|
||||
|
||||
ret = i2c_get_chip_for_busnum(1, 0x53, 1, &dev);
|
||||
if (!ret)
|
||||
ret = dm_i2c_read(dev, 0, (unsigned char *)spd_params, 256);
|
||||
#endif
|
||||
if (ret) {
|
||||
printf("Cannot read DIMM params\n");
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue