I'm looking to customize the device tree on my linux target to incorporate the LTC2983 temp sensor. I've been referencing SPI device initialization here and the device tree customization on the target here. Does incorporating this SPI device initialization example into a .dts file expose the LTC298 properties to the devicetree after a reboot? And if so what dts file does the initialization example need to be place in?
There is a auxiliary SPI (spi0) interface routed to the PMOD connector on the ZU11EG carrier.
As in Michael's response, in HDL we assign the SPI CS to specific pins: https://github.com/analogdevicesinc/hdl/blob/master/projects/adrv9009zu11eg/adrv2crr_fmc/system_top.v#L256-L260.
How are you exactly defining your devicetree? You need to define the ltc2983 properties under the spi controller node where it is attached. Note that on this example, spi0 is just meant to be an example. It does not mean that you have to define it like that. On which platform do you want to use ltc2983?
- Nuno Sá
Where to define the ltc2983 properties is my question. I'm using the adrv9009, in the device tree for this would the ltc2983 properties just need to be defined under the fhm_spi attribute?
It all depends in which controller is your device attached (physically). AFAIK, in ultrascale you have spi0 and spi1 so it should be one of them. Moreover, you need to set the reg property to the correct value. This corresponds to the spi CS pin...
can the CS pin be any gpio pin from the ultrascale or does it have to be from a specific range?
I assume you don't use an external HMC7044 board in your setup.
So you could reuse this spi0 cs4 node:
if you use "cs-gpios" property you could use any system GPIO as CS.
Please see here: https://github.com/analogdevicesinc/linux/blob/master/Documentation/devicetree/bindings/spi/spi-bus.txt
I'm a little confused on how the chip select pins are mapped in the device tree. For the external HMC7044 it's reg 4 and for the hmc on the carrier it's reg 3. Is there documentation somewhere that shows how these register numbers are assigned to pins?
reg 4 is used for the expander, at which we connect the external HMC7044 evaluation board. If you want to connect someting else, you can connect it physically to the board and replace: https://github.com/analogdevicesinc/linux/blob/master/arch/arm64/boot/dts/xilinx/zynqmp-adrv9009-zu11eg-reva-adrv2crr-fmc-reva.dts#L519 with your own peripheral.