HPS access to SDM for internal TDS readings
Hi,
I am trying to read the Stratix 10 internal TDS from HPS, but I want to do this without loading a bitstream that contains the Mailbox IP block or the Temperature Sensor IP block. I am booting with "HPS first" mode from the SD-CARD and therefore have the FPGA I/O ring configured at boot, but no other bitstream is loaded after booting into Linux (HPS).
I understand that the SDM has access to the temperature sensors (see attached image), but I do not understand how HPS can interact with the SDM directly.
There are mapped memory ranges in the HPS such as "SDM, External_Master_mailbox, Mailbox_to_SDM, Mailbox_From_SDM, Mailbox_stream", how may one use these to query information from the SDM? For example, a 'C' program on HPS that writes and reads to the memory mapped registers to get the temperature value from the FPGA fabric from the SDM.
Thank you for the help!
Hi,
yes I got it to work on stratix 10 with linux 5.15.30-lts and uboot 2022.01, ATF 2.6.1
The process is to enable the HWMON in the defconfig of the kernel (CONFIG_SENSORS_SOC64=y) and add a new node to the device tree that contains the labels and register address of the ADC channels that is then readout by the SDM.
look at 5.15.70-lts for some documentation and an example of adding these nodes to the device tree. You may also look at the patches made to this tag for the HWMON and apply them yourself if needed.
After doing that, booting into HPS in HPS first mode without loading any bitstreams, you can read the voltages and the die temperature with a system call at " /sys/class/hwmon/hwmon0/[<name>_label or <name>_input> "
the values are already multiplied by 1000 in the driver.
Thanks