...
Kernel configurations
To compile a kernel with a driver for the AMS enable the following kernel config option:Code Block | ||
---|---|---|
| ||
CONFIG_XILINX_AMS |
Device Tree Settings
Device Tree Bindings Doc: https://github.com/Xilinx/linux-xlnx/blob/master/Documentation/devicetree/bindings/iio/adc/xlnx%2Czynqmp-ams.yaml
- 2022.2 and prior: https://github.com/Xilinx/linux-xlnx/blob/master/Documentation/devicetree/bindings/iio/adc/xilinx-ams.txt
The above doc will provide details into what full configuration will look like.
The following Device Tree shows minimal configuration.
Code Block | ||
---|---|---|
| ||
xilinx_ams: ams@ffa50000 { compatible = "xlnx,zynqmp-ams"; interrupt-parent = <&&gic>; interrupts = <0 56 4>; interrupt-names = "ams-irq"; reg = <0x0 0xffa50000 0x0 0x800>; reg-names = "ams-base"; #address-cells = <2>; #size-cells = <2>; ranges; ams_ps: ams_ps@ffa50800 { compatible = "xlnx,zynqmp-ams-ps"; reg = <0x0 0xffa50800 0x0 0x400>; }; ams_pl: ams_pl@ffa50c00 { compatible = "xlnx,zynqmp-ams-pl"; reg = <0x0 0xffa50c00 0x0 0x400>; }; }; |
Test Procedure
Test Case 1: Read channel value via sysfs
The above example is calculating the temperature in millidegrees C the calculation as prescribed in sysfs-bus-iio.
the cacuation is as follow:
Temp (mdeg C) = (in_temp<n>_raw + in_temp<n>_offset) X in_temp<n>_scale
The processed temperature in millidegrees C can also be read directly from the in_temp<n>_input sysfs entry.
Test Case 2: Get rising event for channel using sample application
iio_event_monitor is a program that is located in tools/iio/iio_event_monitor.c inside the linux kernel source.
This application is being used here for monitoring sysmon events.
Test Case 3: Rising event – negative test using sample application
Test Case 4: Get falling event for voltage channel using sample application
Test Case 5: Falling event for voltage channel – negative test using sample application
Change Log
2017.1- Add Xilinx AMS driver
- Enable the clock through CCF
- fix temperature offset
- fix false alarm event
- Fix error handling
- Disable interrupts at boot up
- fix module unload crash
- enable clock before device initialization
...