summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e9f75e)
raw | patch | inline | side by side (parent: 5e9f75e)
author | Suman Anna <s-anna@ti.com> | |
Mon, 8 Oct 2018 22:55:32 +0000 (17:55 -0500) | ||
committer | Suman Anna <s-anna@ti.com> | |
Mon, 13 Jan 2020 19:57:47 +0000 (13:57 -0600) |
The remoteproc infrastructure is enhanced to allow remoteproc drivers to
be able to connect to already loaded and/or booted remote processors. The
added infrastructure is designed to allow multiple different scenarios:
- Support userspace driven loading, with the actual boot triggered
through the kernel.
- Support remote processors loaded and booted by bootloaders, with
resource table either directly provided by the remoteproc driver or
by remoteproc core by requesting the firmware and processing only
the resource table.
Support for these features are provided through two new fields in the
rproc structure - 'skip_firmware_request' and 'skip_load'. These fields
are expected to be set to true as per the mode/need required by the
remoteproc drivers before a rproc_add() call. The remoteproc core skips
looking for firmware and/or loading any firmware segments using these two
state flags. The default behavior is unchanged.
The interface and implementation details for either of the above scenarios
is left to the individual remoteproc drivers. This design will be used
to achieve the following different usecases on TI SoCs:
- Allow the TI Keystone remoteproc driver to support a userspace based
loader. The remoteproc driver is expected to invoke rproc_boot() and
rproc_shutdown() for triggering the boot and shutdown of the remote
processor after the loading is completed and the resource table
information is published to the remoteproc driver. The resource
table is processed in-line during the rproc_boot() invocation.
- Allow the K3 R5F remoteproc driver to be invoked in an IPC-only mode
(No load, boot or error recovery functionality, but only establish
IPC mechanism). The driver relies on still using the regular state
machine flow for creating the virtio devices. The rproc .start() and
.stop() ops are not bypassed, and the actual boot bypass is implemented
within the driver.
Signed-off-by: Suman Anna <s-anna@ti.com>
be able to connect to already loaded and/or booted remote processors. The
added infrastructure is designed to allow multiple different scenarios:
- Support userspace driven loading, with the actual boot triggered
through the kernel.
- Support remote processors loaded and booted by bootloaders, with
resource table either directly provided by the remoteproc driver or
by remoteproc core by requesting the firmware and processing only
the resource table.
Support for these features are provided through two new fields in the
rproc structure - 'skip_firmware_request' and 'skip_load'. These fields
are expected to be set to true as per the mode/need required by the
remoteproc drivers before a rproc_add() call. The remoteproc core skips
looking for firmware and/or loading any firmware segments using these two
state flags. The default behavior is unchanged.
The interface and implementation details for either of the above scenarios
is left to the individual remoteproc drivers. This design will be used
to achieve the following different usecases on TI SoCs:
- Allow the TI Keystone remoteproc driver to support a userspace based
loader. The remoteproc driver is expected to invoke rproc_boot() and
rproc_shutdown() for triggering the boot and shutdown of the remote
processor after the loading is completed and the resource table
information is published to the remoteproc driver. The resource
table is processed in-line during the rproc_boot() invocation.
- Allow the K3 R5F remoteproc driver to be invoked in an IPC-only mode
(No load, boot or error recovery functionality, but only establish
IPC mechanism). The driver relies on still using the regular state
machine flow for creating the virtio devices. The rproc .start() and
.stop() ops are not bypassed, and the actual boot bypass is implemented
within the driver.
Signed-off-by: Suman Anna <s-anna@ti.com>
drivers/remoteproc/remoteproc_core.c | patch | blob | history | |
include/linux/remoteproc.h | patch | blob | history |
index ce59f5b765cd81b840197aa9ba75a64284e06c48..b7e97b51977a12084ba83b1e4e1ac8adaefc543f 100644 (file)
struct device *dev = &rproc->dev;
int ret;
- /* load the ELF segments to memory */
- ret = rproc_load_segments(rproc, fw);
- if (ret) {
- dev_err(dev, "Failed to load program segments: %d\n", ret);
- return ret;
+ if (!rproc->skip_load) {
+ /* load the ELF segments to memory */
+ ret = rproc_load_segments(rproc, fw);
+ if (ret) {
+ dev_err(dev, "Failed to load program segments: %d\n",
+ ret);
+ return ret;
+ }
}
/*
if (ret)
return ret;
- dev_info(dev, "Booting fw image %s, size %zd\n", name, fw->size);
+ if (!rproc->skip_firmware_request)
+ dev_info(dev, "Booting fw image %s, size %zd\n",
+ name, fw->size);
+ else
+ dev_info(dev, "Booting unspecified pre-loaded fw image\n");
/*
* if enabling an IOMMU isn't relevant for this rproc, this is
dev_info(dev, "powering up %s\n", rproc->name);
- /* load firmware */
- ret = request_firmware(&firmware_p, rproc->firmware, dev);
- if (ret < 0) {
- dev_err(dev, "request_firmware failed: %d\n", ret);
- goto downref_rproc;
+ if (!rproc->skip_firmware_request) {
+ /* load firmware */
+ ret = request_firmware(&firmware_p, rproc->firmware, dev);
+ if (ret < 0) {
+ dev_err(dev, "request_firmware failed: %d\n", ret);
+ goto downref_rproc;
+ }
}
ret = rproc_fw_boot(rproc, firmware_p);
- release_firmware(firmware_p);
+ if (!rproc->skip_firmware_request)
+ release_firmware(firmware_p);
downref_rproc:
if (ret)
index eab814c0145822acd4334c77ed1f90450dc7e02f..c1ce8ee4411f24b54825b49fe98d54154b68e08d 100644 (file)
* @table_sz: size of @cached_table
* @has_iommu: flag to indicate if remote processor is behind an MMU
* @auto_boot: flag to indicate if remote processor should be auto-started
+ * @skip_firmware_request: flag to skip requesting the firmware
+ * @skip_load: flag to skip the loading of firmware segments
* @dump_segments: list of segments in the firmware
* @nb_vdev: number of vdev currently handled by rproc
*/
size_t table_sz;
bool has_iommu;
bool auto_boot;
+ unsigned int skip_firmware_request : 1;
+ unsigned int skip_load : 1;
struct list_head dump_segments;
int nb_vdev;
};