Closed ShaneEverittM closed 2 years ago
Further investigation showed that ioctl operations requesting register values work for all the register offsets below XLLF_RDFD_OFFSET
.
@ShaneEverittM not sure I've never tried this. Are you sure you're accessing something that's in the address range of the IP?
Also not sure, I just assumed the #define
block labeled "IP register offsets" were the valid values for the regNo
field in the axis_fifo_kern_regInfo
. Can you shed some light on the expected behavior for the AXIS_FIFO_GET_REG
ioctl?
Also thanks for the quick reply!
It's been several years since I've looked at this in detail, so can't be of much help unfortunately. I would look at the IP datasheet and make sure you're addressing valid memory regions of the IP.
Alright, is this not something you would recommend for production use then? I saw it was in the staging area for the kernel.
Yeah it's been there in limbo for awhile. It seems there are several people using it successfully, but I'm not actively developing it.
Gotcha, also the same crash happens when running: cat /sys/class/axis_fifo/axis_fifo_0x43c00000/ip_registers/rlr
. Is it likely something I'm messing up? I'm using 4.2 and maybe that doesn't expose the same registers?
Ok, it's likely I'm just reading in invalid ways, the data sheet has rules for when registers are valid to read, and in what order.
You definitely have to be careful about accessing the registers directly - if you access them in the wrong order it can break things. IIRC this is somewhat explained in the datasheet (about the order in which you have to access the registers).
Yeah exactly.
Cool, other than me messing up, driver has been working great, love the helpful error messages, I'll go ahead and close this issue.
The following code causes a crash
Reads and writes are successful, other ioctl operations work fine, and the provided test app functions correctly. When I try the above code I get:
I am using PetaLinux 2021.2 with the following FIFO configuration Let me know if you need any more information.