1 .. SPDX-License-Identifier: GPL-2.0+
3 .. Texas Instruments Incorporated - http://www.ti.com/
5 Remote Processor Framework
6 ==========================
11 This is an introduction to driver-model for Remote Processors found
12 on various System on Chip(SoCs). The term remote processor is used to
13 indicate that this is not the processor on which U-Boot is operating
14 on, instead is yet another processing entity that may be controlled by
15 the processor on which we are functional.
17 The simplified model depends on a single UCLASS - UCLASS_REMOTEPROC
20 - drivers/remoteproc/rproc-uclass.c
21 - include/remoteproc.h
24 - common/cmd_remoteproc.c
27 - CONFIG_REMOTEPROC is selected by drivers as needed
28 - CONFIG_CMD_REMOTEPROC for the commands if required.
30 How does it work - The driver
31 -----------------------------
33 Overall, the driver statemachine transitions are typically as follows::
38 | | | <---------------------+
48 | +----v----+ reset | |
50 | Loaded +-----------+ |
56 Ping +- | +--------------------+
59 (is_running does not change state)
60 opt: Optional state transition implemented by driver.
62 NOTE: It depends on the remote processor as to the exact behavior
63 of the statemachine, remoteproc core does not intent to implement
64 statemachine logic. Certain processors may allow start/stop without
65 reloading the image in the middle, certain other processors may only
66 allow us to start the processor(image from a EEPROM/OTP) etc.
68 It is hence the responsibility of the driver to handle the requisite
69 state transitions of the device as necessary.
71 Basic design assumptions:
73 Remote processor can operate on a certain firmware that maybe loaded
74 and released from reset.
76 The driver follows a standard UCLASS DM.
78 in the bare minimum form:
82 static const struct dm_rproc_ops sandbox_testproc_ops = {
83 .load = sandbox_testproc_load,
84 .start = sandbox_testproc_start,
87 static const struct udevice_id sandbox_ids[] = {
88 {.compatible = "sandbox,test-processor"},
92 U_BOOT_DRIVER(sandbox_testproc) = {
93 .name = "sandbox_test_proc",
94 .of_match = sandbox_ids,
95 .id = UCLASS_REMOTEPROC,
96 .ops = &sandbox_testproc_ops,
97 .probe = sandbox_testproc_probe,
100 This allows for the device to be probed as part of the "init" command
101 or invocation of 'rproc_init()' function as the system dependencies define.
103 The driver is expected to maintain it's own statemachine which is
104 appropriate for the device it maintains. It must, at the very least
105 provide a load and start function. We assume here that the device
106 needs to be loaded and started, else, there is no real purpose of
107 using the remoteproc framework.
109 Describing the device using platform data
110 -----------------------------------------
112 *IMPORTANT* NOTE: THIS SUPPORT IS NOT MEANT FOR USE WITH NEWER PLATFORM
113 SUPPORT. THIS IS ONLY FOR LEGACY DEVICES. THIS MODE OF INITIALIZATION
114 *WILL* BE EVENTUALLY REMOVED ONCE ALL NECESSARY PLATFORMS HAVE MOVED
117 Considering that many platforms are yet to move to device-tree model,
118 a simplified definition of a device is as follows:
122 struct dm_rproc_uclass_pdata proc_3_test = {
123 .name = "proc_3_legacy",
124 .mem_type = RPROC_INTERNAL_MEMORY_MAPPED,
125 .driver_plat_data = &mydriver_data;
128 U_BOOT_DRVINFO(proc_3_demo) = {
129 .name = "sandbox_test_proc",
130 .plat = &proc_3_test,
133 There can be additional data that may be desired depending on the
134 remoteproc driver specific needs (for example: SoC integration
135 details such as clock handle or something similar). See appropriate
136 documentation for specific remoteproc driver for further details.
137 These are passed via driver_plat_data.
139 Describing the device using device tree
140 ---------------------------------------
148 remoteproc0 = &rproc_1;
149 remoteproc1 = &rproc_2;
155 compatible = "sandbox,test-processor";
156 remoteproc-name = "remoteproc-test-dev1";
160 compatible = "sandbox,test-processor";
161 internal-memory-mapped;
162 remoteproc-name = "remoteproc-test-dev2";
167 aliases usage is optional, but it is usually recommended to ensure the
168 users have a consistent usage model for a platform.
169 the compatible string used here is specific to the remoteproc driver involved.