UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor cthil
Visitor
6,524 Views
Registered: ‎04-17-2008

How to enable i2c subsystem in PetaLinux U-Boot

Hi,

 

I'm using Vivado/PetaLinux 2015.2 to build the complete Linux system, including FSBL and U-Boot. How do I enable the I2C subsystem in U-Boot to access, for example, an EEPROM?

 

I want to modify U-Boot to read some parameters out of the factory-programmed EEPROM if they are not set in the U-Boot environment.

 

Thanks,

Christophe

0 Kudos
2 Replies
Visitor rocco.brandi
Visitor
6,479 Views
Registered: ‎07-22-2015

Re: How to enable i2c subsystem in PetaLinux U-Boot

Hi Christophe,

I am trying to do the same thing. Have you found out how to do it?

 

Regards,

Rocco

0 Kudos
Explorer
Explorer
6,458 Views
Registered: ‎10-14-2015

Re: How to enable i2c subsystem in PetaLinux U-Boot

just to let you know,

I have managed to enable I2C in U-boot.

 

I have noticed that zynq_zc70x.h is replaced by platform-top.h

this file is stored in <$PETALINUX-PROJECT-DIRECTORY>/subsystems/linux/configs/u-boot.

so I have added  the following settings from file <$U-BOOT-SOURCE-DIRECTORY>/include/configs/zynq-common.h to file  <$PETALINUX-PROJECT-DIRECTORY>/subsystems/linux/configs/u-boot/platform-top.h:

 

#define CONFIG_SYS_I2C_ZYNQ
/* I2C */
#if defined(CONFIG_SYS_I2C_ZYNQ)
# define CONFIG_CMD_I2C
# define CONFIG_SYS_I2C
# define CONFIG_SYS_I2C_ZYNQ_SPEED  100000
# define CONFIG_SYS_I2C_ZYNQ_SLAVE  0
#endif

 

and it worked! Of course to have acces to the I2C buses, the bitsream file must be loaded before u-boot.

 

I hope it could help someone else.

Best Regards,

Rocco

0 Kudos