LS1046ardb I2C address map with source code

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LS1046ardb I2C address map with source code

ソリューションへジャンプ
1,472件の閲覧回数
RatanLal
Contributor I

Hi Team,

 

When I am trying to probe I2C0 in to LS1046ARDB at u-boot level, I am able to probe below address


=> i2c dev
Current bus is 0
=> i2c probe
Valid chip addresses: 00 08 18 19 36 37 40 4C 51 52 53 69 

But when I am trying to find all these address in u-boot source only able to find 0x18, 0x51,0x53 in u-boot/include/configs/ls1046ardb.h file as below  

#define SPD_EEPROM_ADDRESS 0x51

#define SPD_EEPROM_ADDRESS 0x51

/* EEPROM */
#define CONFIG_ID_EEPROM #define CONFIG_SYS_I2C_EEPROM_NXID #define CONFIG_SYS_EEPROM_BUS_NUM 0 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x53 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 > +#define I2C_RETIMER_ADDR 0x18

 

Please suggest where all other address are defined in source and how the read/write is happing with these slaves using mxc_i2c.c driver 

 

Also We have manufactured our custom board based on the LS1046ARDB, if I want to add a new I2C device on I2C0 at U-boot level.

So what all modification required in firmware(u-boot, atf). 

 

Note:- We using flexbuild_la1224ardb_bsp1.9 LSDK

ラベル(1)
タグ(2)
0 件の賞賛
1 解決策
1,458件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to I2C bus device map on LS1046ARDB. If the device is not used in u-boot, it is not defined.

yipingwang_0-1650863710493.png

Please refer to function select_i2c_ch_pca9547 in board/freescale/ls1046aqds/ls1046aqds.c, if you want to add an i2c device in u-boot.

int select_i2c_ch_pca9547(u8 ch, int bus_num)
{
int ret;
#if CONFIG_IS_ENABLED(DM_I2C)
struct udevice *dev;

ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
1, &dev);
if (ret) {
printf("%s: Cannot find udev for a bus %d\n", __func__,
bus_num);
return ret;
}
ret = dm_i2c_write(dev, 0, &ch, 1);
#else
ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
#endif
if (ret) {
puts("PCA: failed to select proper channel\n");
return ret;
}

return 0;
}

 

元の投稿で解決策を見る

0 件の賞賛
3 返答(返信)
1,459件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to I2C bus device map on LS1046ARDB. If the device is not used in u-boot, it is not defined.

yipingwang_0-1650863710493.png

Please refer to function select_i2c_ch_pca9547 in board/freescale/ls1046aqds/ls1046aqds.c, if you want to add an i2c device in u-boot.

int select_i2c_ch_pca9547(u8 ch, int bus_num)
{
int ret;
#if CONFIG_IS_ENABLED(DM_I2C)
struct udevice *dev;

ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
1, &dev);
if (ret) {
printf("%s: Cannot find udev for a bus %d\n", __func__,
bus_num);
return ret;
}
ret = dm_i2c_write(dev, 0, &ch, 1);
#else
ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
#endif
if (ret) {
puts("PCA: failed to select proper channel\n");
return ret;
}

return 0;
}

 

0 件の賞賛
1,452件の閲覧回数
RatanLal
Contributor I

Hi yipingwang,

 

Thanks for your quick support.

But In ls1046ardb we have ds110df111 retimer and DDR SPD etc... on I2C bus. 

Can you suggest where all the code for Retimer configuration and DDR SPD(reading for spd and writing to DDR registers) is present for ls1046ardb in LSDK ? 

0 件の賞賛
1,414件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

 

DDR SPD please refer to fsl_ddr_set_intl3r in ./drivers/ddr/fsl/main.c of u-boot source code.

No Retimer configuration code, you could refer to board_retimer_init in ./board/freescale/ls1043aqds/ls1043aqds.c.

0 件の賞賛