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: 
Highlighted
8,993 Views
Registered: ‎08-16-2014

Adding analog devices AXI drivers to petalinux BSP

Jump to solution

Analog devices has some ADC drivers in the 3.15 linux kernel that are not available in the linux 3.14 kernel. They are here at:

https://github.com/analogdevicesinc/linux/tree/xcomm_zynq/drivers/iio/adc

 

I would like to compile some of the new drivers as modules so I can modprobe them into linux. Is there a guide on how to do that?

0 Kudos
1 Solution

Accepted Solutions
14,411 Views
Registered: ‎08-16-2014

Re: Adding analog devices AXI drivers to petalinux BSP

Jump to solution

It wasn't any problem with the build system. The solution was to change my makefile from this:

obj-$(CONFIG_CF_AXI_ADC) += cf_axi_adc.o ad9467.o ad9361.o admc_adc.o admc_speed.o admc_ctrl.o ad_adc.o
cf_axi_adc-y := cf_axi_adc_core.o cf_axi_adc_ring.o cf_axi_adc_ring_stream.o

 

to this:

obj-m := ad9467.o ad9361.o admc_adc.o admc_speed.o admc_ctrl.o ad_adc.o
ad9467-y := cf_axi_adc_core.o cf_axi_adc_ring.o cf_axi_adc_ring_stream.o
ad9361-y := cf_axi_adc_ring.o cf_axi_adc_ring_stream.o
admc_adc-y := cf_axi_adc_ring.o cf_axi_adc_ring_stream.o
admc_speed-y := cf_axi_adc_ring.o cf_axi_adc_ring_stream.o
admc_ctrl-y := cf_axi_adc_ring.o cf_axi_adc_ring_stream.o
ad_adc-y := cf_axi_adc_ring.o cf_axi_adc_ring_stream.o

View solution in original post

0 Kudos
6 Replies
Xilinx Employee
Xilinx Employee
8,961 Views
Registered: ‎07-01-2010

Re: Adding analog devices AXI drivers to petalinux BSP

Jump to solution
Hi,

Did you try enabling the driver using petalinux-config -kernel and by selecting industrial I/O?

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
8,950 Views
Registered: ‎08-16-2014

Re: Adding analog devices AXI drivers to petalinux BSP

Jump to solution

I did enable the iio in the menuconfig.

 

In the 3.15 kernel from the AD github, there are additional .c and .h files for the ring buffer (linux_src_root/drivers/iio/adc/) and things that are not in the 3.14 xilinx kernel. If I add them to the makefile, the kernel builds, but it does not match the (supposedly built) drivers with the device tree file.

0 Kudos
8,944 Views
Registered: ‎08-16-2014

Re: Adding analog devices AXI drivers to petalinux BSP

Jump to solution

The modules I added are supposedly loaded:

root@Avnet-Digilent-ZedBoard-2014_2:/lib/modules/3.14.2-xilinx# cat modules.builtin | grep adc

kernel/drivers/iio/adc/cf_axi_adc.ko
kernel/drivers/iio/adc/ad9467.ko
kernel/drivers/iio/adc/ad9361.ko
kernel/drivers/iio/adc/admc_adc.ko

kernel/drivers/iio/adc/ad_adc.ko
kernel/drivers/iio/adc/xilinx-xadc.ko

 

From config.gz:

# Analog to digital converters
#
CONFIG_CF_AXI_ADC=y
# CONFIG_AD7266 is not set
...

...
CONFIG_XILINX_XADC=y

 

When I try to load the drver with modprobe, it won't load:

root@Avnet-Digilent-ZedBoard-2014_2:/lib/modules/3.14.2-xilinx# modprobe cf_axi_adc
modprobe: module cf_axi_adc not found in modules.dep
root@Avnet-Digilent-ZedBoard-2014_2:/lib/modules/3.14.2-xilinx# modprobe cf_axi_adc.ko
modprobe: module cf_axi_adc.ko not found in modules.dep

 

I think I am missing something, but I am not sure what.

0 Kudos
8,927 Views
Registered: ‎08-16-2014

Re: Adding analog devices AXI drivers to petalinux BSP

Jump to solution

I believe I know the nature of the problem. Petalinux is building the modules as .o files as it should, and adding the files to the modules.builtin list as it should.

 

Petalinux is NOT sending the new AD driver .o files to the kbuild system to add them to the data structure that has all the info about the builtin modules (or gets added to the .o file to make a .ko file).

 

Basically, petalinux is compiling the .c code into the kernel but it is not using the driver build system so the kernel knows they are there. How do I tell petalinux to finish the kbuild process?

0 Kudos
14,412 Views
Registered: ‎08-16-2014

Re: Adding analog devices AXI drivers to petalinux BSP

Jump to solution

It wasn't any problem with the build system. The solution was to change my makefile from this:

obj-$(CONFIG_CF_AXI_ADC) += cf_axi_adc.o ad9467.o ad9361.o admc_adc.o admc_speed.o admc_ctrl.o ad_adc.o
cf_axi_adc-y := cf_axi_adc_core.o cf_axi_adc_ring.o cf_axi_adc_ring_stream.o

 

to this:

obj-m := ad9467.o ad9361.o admc_adc.o admc_speed.o admc_ctrl.o ad_adc.o
ad9467-y := cf_axi_adc_core.o cf_axi_adc_ring.o cf_axi_adc_ring_stream.o
ad9361-y := cf_axi_adc_ring.o cf_axi_adc_ring_stream.o
admc_adc-y := cf_axi_adc_ring.o cf_axi_adc_ring_stream.o
admc_speed-y := cf_axi_adc_ring.o cf_axi_adc_ring_stream.o
admc_ctrl-y := cf_axi_adc_ring.o cf_axi_adc_ring_stream.o
ad_adc-y := cf_axi_adc_ring.o cf_axi_adc_ring_stream.o

View solution in original post

0 Kudos
1,501 Views
Registered: ‎04-04-2018

Re: Adding analog devices AXI drivers to petalinux BSP

Jump to solution

Nick,

Would you mind posting the entire Makefile and a list of what files need to be where for this to work? I am trying to do the same for the AD9671. I am a noob when it comes to building drivers.

Thanks,

-Andrew

0 Kudos