r8a77961 CMT test setup using UIO
Get series with b4
b4 am 160056199852.9912.5581183514421117508.sendpatchset@octoVersions newest first
- v1 Latest2 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | r8a77961 CMT0 device exposed via UIOarch/ drivers/ drivers/ | +20 | 1 reply | |
| 2/2 | UIO CMT test programuio-cmt-test-20200919.c | +190 | 0 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by.
| Patch | Magnus Damm |
|---|---|
| Series | Not-Yet-Signed-off-by |
| 1/2 | |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] r8a77961 CMT test setup using UIO
r8a77961 CMT test setup using UIO
[PATCH 1/2] r8a77961 CMT0 device exposed via UIO
[PATCH 2/2] UIO CMT test program
These two patches contain kernel and user space modificatons to allow some basic testing from user space of the CMT0 device included on the r8a77961 SoC.
For the kernel, simply apply the kernel patch (including a few debug printouts) and make sure to extend your kernel config with CONFIG_UIO_PDRV_GENIRQ=y.
The following log shows how to execute the test program on the target:
# ./uio-cmt-test found matching UIO device at /sys/class/uio/uio0/ CLKE CMCSR CMCOR [ 12.284451] irqhandler 20 waiting 10s UIO write CLKE UIO read got CMT IRQ CLKE #
Please note that only a few registers of a single channel of the CMT0 device has been exercised. The kernel debug printout and /proc/interrupts may be used to verify that at least one interrupt has been delivered.
One limitation with the current setup is that the UIO kernel driver only supports a single interrupt however the CMT devices come with one interrupt per channel on R-Car Gen3. Currently the code only uses a single IRQ.
If it turns out that the current test coverage should be extended then perhaps it would be wise to also extend the UIO kernel driver with support for multiple interrupts as well. To maintain the same user space interface the UIO driver can simply have a list of interrupts associated with each device and then enable/disable all of them on each IRQ. Not fast but good enough for testing.
The code applies cleanly on renesas-drivers-2020-09-15-v5.9-rc5 from the renesas-drivers repo on kernel.org. Testing has been performed remotely on r8a77961 Salvator-XS but should be easy enough to move to more or less any other SoC with any kind of memory mapped device. Devices that do not support bus mastering (like the CMT) can be safely used without any IOMMU.
---
arch/arm64/boot/dts/renesas/r8a77961.dtsi | 10 + drivers/uio/uio.c | 3 drivers/uio/uio_pdrv_genirq.c | 10 + uio-cmt-test-20200919.c | 190 +++++++++++++++++++++++++++++ 4 files changed, 210 insertions(+), 3 deletions(-)