Commits
Suman Anna committed ee8d59ff29f
remoteproc/keystone: add support for MPM userspace loader The Keystone remoteproc driver performs the device management of different DSP processor subsystems present on various Keystone 2 family of SoCs. The driver currently supports loading/booting using the remoteproc core's 'auto-boot' feature and supports advanced features like error recovery. This patch enhances the Keystone remoteproc driver to add support for a TI specific userspace based loading/booting mechanism called the Multi Proc Manager (MPM) by exposing a character device interface to userspace per device. A new module parameter 'use_rproc_core_loader' is introduced to configure the driver for in-kernel auto-boot mode or the MPM non auto-boot mode, with the default configured for MPM. The standard platform driver's bind and unbind sysfs attributes are suppressed for MPM-based stack so that the regular sysfs approach of booting and shutting down a Keystone DSP remote processor does not mess up the MPM-based state-machine by unbinding the device from the driver even when it has open usage reference counts. The standard remoteproc sysfs interfaces for changing 'state' and 'firmware' conflict with the MPM state-machine and are denied using the remoteproc generic 'deny_sysfs_ops' flag. An exception notification is also provided through an UIO device exposed by the keystone remoteproc driver for now. The MPM loading/booting mechanism uses the file operations exported by the character device. The mmap interface is used for mapping device memory into userspace for loading and the ioctl interfaces are used for reset and remoteproc resource table configuration and triggering the boot and shutdown of the DSPs. The address and size of the various DSP internal RAM memories to be used with the mmap interface are provided through two sysfs files 'addr' and 'size' for each region, and are created under the respective dspX misc device for each DSP remoteproc processor. These files are created in their own directory for each region accessible under the /sys/class/misc/dspX/ path, where X is the DSP number (indexed from 0). The MPM also relies on another memory mapping character device (/dev/dspmem) to support loading images into external DDR memory and the Multicore Shared Memory (MSM). This sysfs logic allows the userspace-based Multi Proc Manager (MPM) stack to not rely on procfs-based DT parsing for looking up the memories. The MPM supports various kinds of firmware images - images with and without resource tables, images that have a resource table but with or without the virtio device resource entries. The loadable regions include images just using internal DSP memories, or images using portions of the MSM RAM and/or external DDR. The load/boot of images with and without resource tables are supported using separate ioctl operations. The KEYSTONE_RPROC_IOC_SET_STATE ioctl is used to boot and shutdown remote processors for images with resource tables, and the KEYSTONE_RPROC_IOC_DSP_RESET/BOOT ioctls for images without a resource table. The boot address/entry point is published during the corresponding ioctls that trigger a boot, and is stored in a local variable in driver instance and later picked up by remoteproc core driver through fw_ops. This logic is created anew using an older code from Cyril Chemparathy as a baseline. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Sam Nelson <samnelson@ti.com>