mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
Provide remote access to the PIO hardware in RP1. There is a single instance, with 4 state machines. Signed-off-by: Phil Elwell <phil@raspberrypi.com> misc: rp1-pio: Support larger data transfers Add a separate IOCTL for larger transfer with a 32-bit data_bytes field. See: https://github.com/raspberrypi/utils/issues/107 Signed-off-by: Phil Elwell <phil@raspberrypi.com> misc: rp1-pio: More logical probe sequence Sort the probe function initialisation into a more logical order. Signed-off-by: Phil Elwell <phil@raspberrypi.com> misc: rp1-pio: Minor cosmetic tweaks No functional change. Signed-off-by: Phil Elwell <phil@raspberrypi.com> misc: rp1-pio: Add in-kernel DMA support Add kernel-facing implementations of pio_sm_config_xfer and pio_xm_xfer_data. Signed-off-by: Phil Elwell <phil@raspberrypi.com> misc: rp1-pio: Handle probe errors Ensure that rp1_pio_open fails if the device failed to probe. Link: https://github.com/raspberrypi/linux/issues/6593 Signed-off-by: Phil Elwell <phil@raspberrypi.com> misc: rp1-pio: SM_CONFIG_XFER32 = larger DMA bufs Add an ioctl type - SM_CONFIG_XFER32 - that takes uints for the buf_size and buf_count values. Signed-off-by: Phil Elwell <phil@raspberrypi.com> misc/rp1-pio: Fix copy/paste error in pio_rp1.h As per the subject, there was a copy/paste error that caused pio_sm_unclaim from a driver to result in a call to pio_sm_claim. Fix it. Signed-off-by: Phil Elwell <phil@raspberrypi.com> misc: rp1-pio: Fix parameter checks wihout client Passing bad parameters to an API call without a pio pointer will cause a NULL pointer exception when the persistent error is set. Guard against that. Signed-off-by: Phil Elwell <phil@raspberrypi.com> misc: rp1-pio: Convert floats to 24.8 fixed point Floating point arithmetic is not supported in the kernel, so use fixed point instead. Signed-off-by: Phil Elwell <phil@raspberrypi.com> misc: rp1-pio: Error out on incompatible firmware If the RP1 firmware has reported an error then return that from the PIO probe function, otherwise defer the probing. Link: https://github.com/raspberrypi/linux/issues/6642 Signed-off-by: Phil Elwell <phil@raspberrypi.com> misc: rp1-pio: Demote fw probe error to warning Support for the RP1 firmware mailbox API is rolling out to Pi 5 EEPROM images. For most users, the fact that the PIO is not available is no cause for alarm. Change the message to a warning, so that it does not appear with "quiet" in cmdline.txt. Link: https://github.com/raspberrypi/linux/issues/6642 Signed-off-by: Phil Elwell <phil@raspberrypi.com> misc: rp1-pio: Don't just reuse the same DMA buf A missing pointer increment meant that not only was the same buffer being reused again and again, there was also no protection against using it simultaneously for multiple transfers. Fix that basic bug, and also move a similar increment to before the transfer is started, which feels less racy. See: https://github.com/raspberrypi/linux/issues/6919 Signed-off-by: Phil Elwell <phil@raspberrypi.com> misc: rp1-pio: Fix a config_xfer error path If the DMA channel allocation fails, the relevant dma_configs entry should be marked as no longer claimed, otherwise rp1_pio_sm_dma_free will be called with an error number as a DMA channel pointer. Signed-off-by: Phil Elwell <phil@raspberrypi.com> misc: rp1-pio: Request a DMA burst size of 8 Improve DMA performance by increasing the burst size to 8. Signed-off-by: Phil Elwell <phil@raspberrypi.com>