AnsweredAssumed Answered

How many AD9361 can Linux kernel support

Question asked by dichy on May 31, 2018
Latest reply on Aug 7, 2018 by aardelean

Hello:

    We had used the linux driver to drive two AD9361s on our custom board. The board is designed following the fmcomms5 evb, and the driver worked well. Recently, we had a more complicated demand that we need to control as many as 12 AD80305s, 3 worked in FDD mode and others in TDD mode . For now, we had initialized all the AD80305s' phy with Linux driver succesfully, but we failed in the initialization of cf-ad9361-dds-core-lpc. 

    In our design, we configure 6 AD80305s to spi1, and the other half to spi2. Each spi master has 3 chip select pins, which is connected to an external 3-to-8 decoder to select 1 AD80305 out of 6.  The raw ADC channels are selected with 12 gpios so that only 1 channel is allowed to send data to ARM via dma. 

 

 

The kernal log is as follow: 

[ 1.556606] iio cdev add success
[ 1.561319] ad9361 spi1.0: ad9361_probe : AD936x Rev 2 successfully initialized
[ 1.568666] ad9361 spi1.1: ad9361_probe : enter (ad9361), cs 1
[ 2.009403] iio cdev add success
[ 2.014116] ad9361 spi1.1: ad9361_probe : AD936x Rev 2 successfully initialized
[ 2.021471] ad9361 spi1.2: ad9361_probe : enter (ad9361-2x), cs 2
[ 2.462363] iio cdev add success
[ 2.467072] ad9361 spi1.2: ad9361_probe : AD936x Rev 2 successfully initialized
[ 2.474420] ad9361 spi1.3: ad9361_probe : enter (ad9361), cs 3
[ 2.513451] random: nonblocking pool is initialized
[ 2.921557] iio cdev add success
[ 2.926275] ad9361 spi1.3: ad9361_probe : AD936x Rev 2 successfully initialized
[ 2.933634] ad9361 spi1.4: ad9361_probe : enter (ad9361-2x), cs 4
[ 3.377546] iio cdev add success
[ 3.382241] ad9361 spi1.4: ad9361_probe : AD936x Rev 2 successfully initialized
[ 3.389588] ad9361 spi1.5: ad9361_probe : enter (ad9361), cs 5
[ 3.969195] iio cdev add success
[ 3.973903] ad9361 spi1.5: ad9361_probe : AD936x Rev 2 successfully initialized
[ 3.981250] ad9361 spi2.0: ad9361_probe : enter (ad9361-2x), cs 0
[ 4.424485] iio cdev add success
[ 4.429188] ad9361 spi2.0: ad9361_probe : AD936x Rev 2 successfully initialized
[ 4.436542] ad9361 spi2.1: ad9361_probe : enter (ad9361), cs 1
[ 5.015013] iio cdev add success
[ 5.019679] ad9361 spi2.1: ad9361_probe : AD936x Rev 2 successfully initialized
[ 5.027029] ad9361 spi2.2: ad9361_probe : enter (ad9361-2x), cs 2
[ 5.470490] iio cdev add success
[ 5.475206] ad9361 spi2.2: ad9361_probe : AD936x Rev 2 successfully initialized
[ 5.482557] ad9361 spi2.3: ad9361_probe : enter (ad9361), cs 3
[ 6.057723] iio cdev add success
[ 6.062408] ad9361 spi2.3: ad9361_probe : AD936x Rev 2 successfully initialized
[ 6.069759] ad9361 spi2.4: ad9361_probe : enter (ad9361-2x), cs 4
[ 6.514545] iio cdev add success
[ 6.519228] ad9361 spi2.4: ad9361_probe : AD936x Rev 2 successfully initialized
[ 6.526576] ad9361 spi2.5: ad9361_probe : enter (ad9361), cs 5
[ 6.971960] iio cdev add success
[ 6.976653] ad9361 spi2.5: ad9361_probe : AD936x Rev 2 successfully initialized
[ 6.986885] iio cdev add success

[ 6.990460] Probe 9361 dds
[ 6.993208] cf_axi_dds 79024000.cf-ad9361-dds-core-lpc: Device Tree Probing 'cf-ad9361-dds-core-lpc'
[ 7.002311] cf_axi_dds 79024000.cf-ad9361-dds-core-lpc: Allocate iio device OK
[ 7.021436] iio cdev add success
[ 7.024616] cf_axi_dds 79024000.cf-ad9361-dds-core-lpc: Analog Devices CF_AXI_DDS_DDS MASTER (9.00.b) at 0x79024000 mapped to 0xf09c4000, probed DDS AD9361
[ 7.038544] Probe 9361 dds
[ 7.041284] cf_axi_dds 79044000.cf-ad9361-dds-core-lpc-1: Device Tree Probing 'cf-ad9361-dds-core-lpc-1'
[ 7.050751] cf_axi_dds 79044000.cf-ad9361-dds-core-lpc-1: Allocate iio device OK
[ 7.069702] iio cdev add success
[ 7.072877] cf_axi_dds 79044000.cf-ad9361-dds-core-lpc-1: Analog Devices CF_AXI_DDS_DDS SLAVE (9.00.b) at 0x79044000 mapped to 0xf09c8000, probed DDS AD9361
[ 7.086903] Probe 9361 dds
[ 7.089639] cf_axi_dds 43c04000.cf-ad9361-dds-core-lpc-2: Device Tree Probing 'cf-ad9361-dds-core-lpc-2'
[ 7.099105] cf_axi_dds 43c04000.cf-ad9361-dds-core-lpc-2: Allocate iio device OK
[ 7.117202] cf_axi_dds 43c04000.cf-ad9361-dds-core-lpc-2: configure buffer error -19
[ 7.124963] dds converter put
[ 7.128005] dds device free
[ 7.130931] Probe 9361 dds
[ 7.133668] cf_axi_dds 43c14000.cf-ad9361-dds-core-lpc-3: Device Tree Probing 'cf-ad9361-dds-core-lpc-3'
[ 7.143126] cf_axi_dds 43c14000.cf-ad9361-dds-core-lpc-3: Allocate iio device OK
[ 7.162092] iio cdev add success
[ 7.165265] cf_axi_dds 43c14000.cf-ad9361-dds-core-lpc-3: Analog Devices CF_AXI_DDS_DDS MASTER (9.00.b) at 0x43C14000 mapped to 0xf09d0000, probed DDS AD9361
[ 7.179365] Probe 9361 dds
[ 7.182099] cf_axi_dds 43c44000.cf-ad9361-dds-core-lpc-4: Device Tree Probing 'cf-ad9361-dds-core-lpc-4'
[ 7.191565] cf_axi_dds 43c44000.cf-ad9361-dds-core-lpc-4: Allocate iio device OK
[ 7.209618] cf_axi_dds 43c44000.cf-ad9361-dds-core-lpc-4: configure buffer error -19
[ 7.217379] dds converter put
[ 7.220419] dds device free
[ 7.223342] Probe 9361 dds
[ 7.226084] cf_axi_dds 43c54000.cf-ad9361-dds-core-lpc-5: Device Tree Probing 'cf-ad9361-dds-core-lpc-5'
[ 7.235542] cf_axi_dds 43c54000.cf-ad9361-dds-core-lpc-5: Allocate iio device OK
[ 7.254443] iio cdev add success
[ 7.257621] cf_axi_dds 43c54000.cf-ad9361-dds-core-lpc-5: Analog Devices CF_AXI_DDS_DDS MASTER (9.00.b) at 0x43C54000 mapped to 0xf09d6000, probed DDS AD9361
[ 7.271723] Probe 9361 dds
[ 7.274464] cf_axi_dds 43c64000.cf-ad9361-dds-core-lpc-B: Device Tree Probing 'cf-ad9361-dds-core-lpc-B'
[ 7.283936] cf_axi_dds 43c64000.cf-ad9361-dds-core-lpc-B: Allocate iio device OK
[ 7.301992] cf_axi_dds 43c64000.cf-ad9361-dds-core-lpc-B: configure buffer error -19
[ 7.309752] dds converter put
[ 7.312792] dds device free
[ 7.315715] Probe 9361 dds
[ 7.318456] cf_axi_dds 43c74000.cf-ad9361-dds-core-lpc-B-1: Device Tree Probing 'cf-ad9361-dds-core-lpc-B-1'
[ 7.328261] cf_axi_dds 43c74000.cf-ad9361-dds-core-lpc-B-1: Allocate iio device OK
[ 7.347353] iio cdev add success
[ 7.350531] cf_axi_dds 43c74000.cf-ad9361-dds-core-lpc-B-1: Analog Devices CF_AXI_DDS_DDS MASTER (9.00.b) at 0x43C74000 mapped to 0xf09dc000, probed DDS AD9361
[ 7.364814] Probe 9361 dds
[ 7.367547] cf_axi_dds 43c84000.cf-ad9361-dds-core-lpc-B-2: Device Tree Probing 'cf-ad9361-dds-core-lpc-B-2'
[ 7.377365] cf_axi_dds 43c84000.cf-ad9361-dds-core-lpc-B-2: Allocate iio device OK
[ 7.395586] cf_axi_dds 43c84000.cf-ad9361-dds-core-lpc-B-2: configure buffer error -19
[ 7.403522] dds converter put
[ 7.406562] dds device free
[ 7.409488] Probe 9361 dds
[ 7.412233] cf_axi_dds 43c94000.cf-ad9361-dds-core-lpc-B-3: Device Tree Probing 'cf-ad9361-dds-core-lpc-B-3'
[ 7.422033] cf_axi_dds 43c94000.cf-ad9361-dds-core-lpc-B-3: Allocate iio device OK
[ 7.441124] iio cdev add success
[ 7.444301] cf_axi_dds 43c94000.cf-ad9361-dds-core-lpc-B-3: Analog Devices CF_AXI_DDS_DDS MASTER (9.00.b) at 0x43C94000 mapped to 0xf09e2000, probed DDS AD9361
[ 7.458575] Probe 9361 dds
[ 7.461309] cf_axi_dds 43c24000.cf-ad9361-dds-core-lpc-B-4: Device Tree Probing 'cf-ad9361-dds-core-lpc-B-4'
[ 7.471122] cf_axi_dds 43c24000.cf-ad9361-dds-core-lpc-B-4: Allocate iio device OK
[ 7.489375] cf_axi_dds 43c24000.cf-ad9361-dds-core-lpc-B-4: configure buffer error -19
[ 7.497309] dds converter put
[ 7.500350] dds device free
[ 7.503273] Probe 9361 dds
[ 7.506013] cf_axi_dds 43c34000.cf-ad9361-dds-core-lpc-B-5: Device Tree Probing 'cf-ad9361-dds-core-lpc-B-5'
[ 7.515819] cf_axi_dds 43c34000.cf-ad9361-dds-core-lpc-B-5: Allocate iio device OK
[ 7.534925] iio cdev add success
[ 7.538106] cf_axi_dds 43c34000.cf-ad9361-dds-core-lpc-B-5: Analog Devices CF_AXI_DDS_DDS MASTER (9.00.b) at 0x43C34000 mapped to 0xf09e8000, probed DDS AD9361

 

  As you can see ,  some cf-ad9361-dds-core-lpc can be initialized successfully, but some failed. In the fmcomms 5 EVB, the kernel drive only two ad9361s, the two cf-ad9361-lpc and cf-ad9361-dds-core-lpc are configured as master or  slave seperately. I followed the configuration mode here (see the attachment)and combined every two AD80305s together as master-slave pair. The HDL should configure the ID (we configured them with almost all 0 for now) so that linux driver can recognize which one is master. That maybe why we failed to initialize the HDL here. We'll try later.

   

 

    My question is how many ad80305s can linux driver support at the same time. Is it possible to control so many ad80305s in linux kernel?  If it could:

 

   In the linux source code, I found the AXIADC_MAX_CHANNEL is 16 (in drviers/iio/adc/cf_axi_adc.h ), it means the driver can only support  for 1 master and 1 slave simutaneously. Can it be replaced with a bigger number to support for 1 master and N slave ? 

 

if it couldn't, which method is suggested?

 

   

Thank you for your time.

Sincerely,

dichy

Attachments

Outcomes