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 rocco.brandi
Visitor
7,812 Views
Registered: ‎07-22-2015

petalinux add I2C support to U-boot

Hi all,

I am trying to add I2C support to U-boot, in order to acces an EEPROM where are stored some boot information.

 

I have seen that I2C support is enabled in zynq-common.h (line 186):

 

#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

 

zynq-common.h is included in zynq_zc70x.h file. but it seems that when I build u-boot through petalinux, the configuration header file zynq_zc70x.h is replaced by platform-top.h file that contains only the enviroment settings.

 

here the line from the verbose (in red the specific command):

 

[ALL  ] if [ -f "/home/user/petalinux_projetcs/Software_337/Software/zynq/dtx_a350/subsystems/linux/configs/u-boot/platform-top.h" ]; then rsync "/home/user/petalinux_projetcs/Software_337/Software/zynq/dtx_a350/subsystems/linux/configs/u-boot"/*.h "/home/user/petalinux_projetcs/Software_337/Software/zynq/dtx_a350/build/linux/u-boot/src/u-boot-plnx_ORIG/include/configs"/; mv "/home/user/petalinux_projetcs/Software_337/Software/zynq/dtx_a350/build/linux/u-boot/src/u-boot-plnx_ORIG/include/configs/platform-top.h"  "/home/user/petalinux_projetcs/Software_337/Software/zynq/dtx_a350/build/linux/u-boot/src/u-boot-plnx_ORIG/include/configs/zynq_zc70x.h"; fi 

 

after that, the configuration files are called :

 

[INFO ] generate linux/u-boot configuration files

[ALL ] make O=/home/user/petalinux_projetcs/Software_337/Software/zynq/dtx_a350/build/linux/u-boot/u-boot-plnx_ORIG -C /home/user/petalinux_projetcs/Software_337/Software/zynq/dtx_a350/build/linux/u-boot/src/u-boot-plnx_ORIG -j2 zynq_zc70x_config || exit 255

 

but where are the settings from the configuration header file if it has been replaced?

I have attached all the log file when building u-boot

 

Regards,

Rocco

0 Kudos
3 Replies
Explorer
Explorer
7,771 Views
Registered: ‎10-14-2015

Re: petalinux add I2C support to 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

Xilinx Employee
Xilinx Employee
7,757 Views
Registered: ‎07-01-2010

Re: petalinux add I2C support to U-boot

@roccobrandi

 

Thanks for updating the thread with the solution. I will have this updated into answer record.

 

Regards,

Achutha

---------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------
0 Kudos
Scholar vanmierlo
Scholar
7,723 Views
Registered: ‎06-10-2008

Re: petalinux add I2C support to U-boot


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


That is of course only when you're using a MicroBlaze or route I2C through EMIO to PL pins on a Zynq. If I2C is routed through MIO pins on a Zynq this should not be required.

0 Kudos