LS1046ardb I2C address map with source code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LS1046ardb I2C address map with source code

Jump to solution
1,471 Views
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

Labels (1)
Tags (2)
0 Kudos
1 Solution
1,457 Views
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;
}

 

View solution in original post

0 Kudos
3 Replies
1,458 Views
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 Kudos
1,451 Views
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 Kudos
1,413 Views
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 Kudos