Re: [Discuss OpenCPI] Fwd: Fwd: Fwd: Multiple AD9361 Devices Cause Multiple Connections Error

From: James Kulp <jek_at_parera.com>
Date: Mon, 20 Jan 20 12:57:21 -0500

(plain text this time)

Brian,

The general model of sub-devices for things like SPI and I2c and
potentially other hardware pins that are somehow shared between multiple
devices, is that there must be a platform-specific sub-device worker
created for the platform since the exact collection of devices sharing
the SPI or I2C is indeed very platform specific.

This subdevice worker should generally live in the ""devices"
subdirectory of the hdl/platform/<platform>, making it clear that it is
specific to that platform.

An example of this is the subdevice worker for the fmcomms2/3 card. 
That card has an i2c bus that is used for two different devices on that
card: ad7291 and stm_mc24c02.

projects/assets/hdl/cards/fmcomms_2_3_i2c.hdl

Another example is the the i2c subdevice for the Epic Matchstiq_z1
radio.  That radio has an i2c bus for si5338, tmp100, pca9534, pca9535,
avr microcontroller.

projects/assets/hdl/platforms/matchstiq_z1/devices/matchstiq_z1_i2c.hdl

So you would not use the ad9361_spi since that is specialized for a
non-shared SPI.

If your two SPIs are dealing with separate sets of devices, then you
could have two SPI subdevices. But you could also create a single
subdevice that controlled both SPI buses.

The ad9361_spi - could have been named:  
ad9361_spi_when_spi_is_dedicated_to_a_single_9361

When a device worker is supporting a device with a SPI or I2C control
interface, that (portable) device worker uses the "rawprop" interface to
delegate SPI/I2C accesses to a platform-specific subdevice.

I wish we had lots of better diagrams to show the various cases.

Jim

On 1/20/20 9:52 AM, Brian Padalino wrote:
> Hey James,
>
> On Sun, Jan 19, 2020 at 5:56 PM James Kulp <jek_at_parera.com
> <mailto:jek_at_parera.com>> wrote:
>
> Brian/Davis,
>
> I am assuming that both ad9361s share the same SPI bus?
>
>
> Actually, in my application, I have two separate SPI buses.  But,
> those SPI buses have more than just the AD9361 hanging off of them, so
> I will somehow have to share the clock, and data lines while having a
> different chip select for a different device.  Do you have any
> suggestions on supporting that?
>
> Thanks,
> Brian





Received on Mon Jan 20 2020 - 17:57:21 CST

This archive was generated by hypermail 2.3.0 : Fri Jun 05 2026 - 08:45:25 CDT