AnsweredAssumed Answered

Configuring register/SPI addresses for pcore using ad9361

Question asked by on May 6, 2014
Latest reply on May 15, 2014 by

I am building an end-to-end wireless transceiver (i.e. the interface to the device is packets instead of I/Q samples). As part of this process, I also plan to write a new device driver. I was trying to understand the existing ad9361 driver as a starting point, as I build my driver. As part of this process, I was looking at one case study in drivers/iio/adc/ad9361.c. In the ad9361_probe(...) function, it makes the following call: ad9361_spi_read(spi, REG_PRODUCT_ID), where REG_PRODUCT_ID is #defined as 0x037 in ad9361.h


I was trying to understand the flow of how this SPI call address actually gets translated to a physical location and fulfilled.


1. How does Linux translate translate this SPI address? I assume it is based on something in "arch/arm/boot/dts/zynq-zed-adv7511-ad9361.dts" but it wasn't obvious to me?


2. How is this address mapping available to the actual hardware/FPGA code/pcore? Where is this specified? I couldn't find anywhere the address 0x037 (or decimal 55) was mentioned by grepping.


I am hoping that understanding this flow will help me understand the flow for reading/writing other existing SPI addresses/registers, as well as enable me to create my own as I build my device driver.


I would appreciate your help.