11-06-2013 06:17 AM
I want to compile Zynq Linux ( http://www.wiki.xilinx.com/Fetch+Sources ) including the I2C driver. How can I do it??
According to this link: http://www.wiki.xilinx.com/Linux+I2C+Driver , I need to select I2C support from the device drivers menu, but I don't know what menu is it talking about, since I compile the kernel without any interface, using these steps:
Can anyone help me???
thank you in advance!
11-06-2013 07:59 AM
Just yesterday I got I2C to show up in /dev and /sys.
You need to do two things. Add I2C to your kernel, and (the hard part) set up your
Attached find my kernel .config file and a .dts file based on release
14.7 and setup for the MicroZed board.
You wlll probably need to modify the .dts if you're using a board different
This setup boots for me, but I get this "skb_over_panic" after about a day
of operation. Working on that one...
YMMV. Good luck.
11-06-2013 09:20 AM
Can you please give more details what you try to do and what your problem is?
The Zynq defconfig already has I2C enabled and includes drivers for the common I2C devices (probably not for soft-IP controllers though) on Zynq platforms. Also dts files shipped with the kernel sources include proper descriptions for the I2C busses on those supported platforms.
11-06-2013 09:46 AM
11-06-2013 11:06 AM
You're right, the Zed dts does not have any I2C information. BTW, you can see the dts sources here: https://github.com/Xilinx/linux-xlnx/tree/master/arch/arm/boot/dts
If you want to use the PS I2C controller, you shouldn't have to recompile the whole kernel, since that driver is included - you might have to though, depending on what I2C devices you want to talk to and whether their drivers are enabled in the kernel.
And in general you'd have to add the description for the I2C bus in the Zed dts file and recompile the DT image. You can take a look at the zc702, zc706 files or the dts leith provided to get started.
11-06-2013 01:49 PM
Great. Thanks for the pointer to the dts sources. Wished
I'd a known about that a few days ago.
I did look at zynq-zc702-base-trd.dts. It uses
a different naming scheme than the base Zed .dts. Be careful
when cutting and pasting!
11-06-2013 02:03 PM
I didn't expect those to be such a secret. Anyway, you probably learned a lot by doing it the hard way :P
One additional note though: Make sure your dts and kernel are coming from the same commit. Otherwise you might run in fatal incompatibilities.
11-07-2013 08:51 AM
First of all, thank you for your answers!
I use a ZedBoard, and there is no mention of I2C in the corresponding dts file located on Xilinx Git (zynq-zed.dts). Anyway, I will use leith's dts as base.
Sorenb says that I don't need to recompile the whole kernel as the driver is included by default. Now my question is: how can I use the driver on a linux application? should i follow the steps described here?
The thing is that this page says that it is outdated and may provide inaccurate information. At what extend is outdated??
thank you in advance!
03-01-2014 05:46 AM
Can anyone help me???
I have done this before on a zynq 7020 before using i2c-dev (userspace device driver).
The way I did it was get the sources for the i2c-tools package on Ubuntu/Debian.
$ sudo apt-get source i2c-tools
Inside the directory, there will be a include directory and a tools directory. The include directory has the defines for i2c and smbus. In the tools directory is the source, you need to compile that with the cross compiler. I used the one in sysroots from poky. If you have it pathed in your environment it is smart enough to know where to pick up it's files.
Compile the code, in take the shared libraries, they need to get copied to the embedded linux. Compile your app and link against the shared libraries. Run the binary on the device with the shared libraries.
That should give you a start.
09-17-2014 10:08 AM
I am working with Zybo board, I compiled Linux sources provided by Digilent, I also added I2C to the kernel configuration and set up the device tree.
The setup boots on the processor, but I do not find any sources under /dev/i2c folder. Its empty.
I am not understanding whats wrong with the set up. Could you please help?
I have verified the .config file with the ones you have attached and also checked the device tree.