Improve the porting guide page#86
Conversation
d959cdc to
3dcae1d
Compare
having duplicated embedded doxygen content results in the warning WARNING: Duplicate C++ declaration As these APIs are already detailed in the remoteproc documentation make a reference to them rather than repeat the embed. Signed-off-by: Sipke Vriend <sipke@direktembedded.com>
add some hw acronymns that will be used in porting guide changes to the glossary. Signed-off-by: Sipke Vriend <sipke@direktembedded.com>
3dcae1d to
0778cc5
Compare
|
During review note also the comment for 47ae5ad which includes a snippet from source in openamp-system-reference. If we think this is a good direction for other snippets, it would be better to use the start and end tags as detailed in that comment, rather than line numbers. |
| Shared memory forms the :ref:`physical layer<rpmsg-layers-work-label>` for | ||
| :doc:`RPMsg <../docs/rpmsg_design>` protocol. | ||
| The specific memory type and layout are implementation dependent, but should be a dedicated | ||
| SRAM or DDR region accessible by both cores, with caching disabled. |
There was a problem hiding this comment.
open-amp supports cache management
| ******** | ||
|
|
||
| The porting of OpenAMP to a new :doc:`multicore system <../openamp/overview>` requires | ||
| configuring the hardware on each core so it aligns with the OpenAMP architecture. |
There was a problem hiding this comment.
Proposal ```suggestion
The porting of OpenAMP to a new :doc:multicore system <../openamp/overview> requires
some hardware for inter-processor communication.
| Memory requirements are generally modest because RPMsg is a control‑oriented protocol | ||
| rather than a high‑bandwidth streaming channel. For example, using the Linux RPMsg packet | ||
| size of 512 bytes, a 64kB shared memory region can hold roughly 128 messages — sufficient | ||
| for most applications. Larger or smaller allocations can be chosen based on system needs. |
There was a problem hiding this comment.
you need also memory for the virtio rings , with Linux you should add 2* 4K for the vrings.. for other can be less
| Shared memory forms the :ref:`physical layer<rpmsg-layers-work-label>` for | ||
| :doc:`RPMsg <../docs/rpmsg_design>` protocol. | ||
| The specific memory type and layout are implementation dependent, but should be a dedicated | ||
| SRAM or DDR region accessible by both cores, with caching disabled. |
There was a problem hiding this comment.
it work with or without cache. the cache management can be enabled in open-amp using the WITH_DCACHE cmake configuration
|
|
||
| .. _driver-lcm-remoteproc: | ||
|
|
||
| Driver Lifecycle Management via Remoteproc |
There was a problem hiding this comment.
| Driver Lifecycle Management via Remoteproc | |
| Remote processor Lifecycle Management via Remoteproc |
| Driver Lifecycle Management via Remoteproc | ||
| ========================================== | ||
|
|
||
| Some systems do not require IPC or use an alternative IPC mechanism. In these cases, only |
There was a problem hiding this comment.
to remove the remoteproc framework is independent from the rpmsg
There was a problem hiding this comment.
not quite sure here that what is written is opposite to your point. will re-think and re-visit as part of rewrite
There was a problem hiding this comment.
if no IPC no remoteproc needed on remote processors
|
|
||
| Some systems do not require IPC or use an alternative IPC mechanism. In these cases, only | ||
| :ref:`Remoteproc<overview-remoteproc-work-label>` may be ported (or reused, as on Linux) | ||
| on both the main and remote processors. |
There was a problem hiding this comment.
the remoteproc framework is optional
- need on main processor if it need to manage the remote processor live cyccle
- can be used on remoteprocessor to manage the resource table for IPC
|
|
||
| - Pros: Very lightweight. | ||
| - Cons: Highly custom and less portable. | ||
|
|
There was a problem hiding this comment.
I wonder if we should not restructure the chapters.. here is a proposal (from .. _driver-lcm-remoteproc: reference)
i just put titles and list content
Don't hesitate to challenge this , it look to me that we woill probably need few iterations with some other reviewers to land to a good porting guide
Remoteproc framework
====================
- remote processor management
- resource table management
driver role
---------------
- remoteprocessor livecycle management
- resource table discovery
- example: https://github.com/OpenAMP/openamp-system-reference/tree/main/examples/legacy_apps/examples/load_fw
device role
---------------
- optional
- can be use for the resource table management
example: https://github.com/OpenAMP/openamp-system-reference/blob/main/examples/legacy_apps/machine/xlnx/zynqmp_r5/platform_info.c
- alternative is to managea static resource table directly
example https://github.com/OpenAMP/openamp-system-reference/blob/main/examples/zephyr/rpmsg_multi_services/src/main_remote.c
Remoteproc virtio framework
========================
This is the virtio transport layer ( virtio MMIO is another)
driver role
---------------
- get resource table information and configure it
- create virtio driver
device role
---------------
- get resource table information filled by the virtio driver
- create virtio device
example https://github.com/OpenAMP/openamp-system-reference/blob/main/examples/zephyr/rpmsg_multi_services/src/main_remote.c
RPMsg framework
===============
- IPC
- based on VirtIO
- remoteproc virtio
- static vring transport layer
example:https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/subsys/ipc/openamp
reference to https://github.com/OpenAMP/openamp-system-reference examples for the driver and devices implementation
There was a problem hiding this comment.
Addressed the simpler items, but for the more major ones not sure at this point exactly how to proceed. Also wondering if some of the suggestion belong in the porting page or should they be in a design page as we might be crossing boundaries between porting and implementation options?
There was a problem hiding this comment.
In my view, for this pages users will likely approach this with a requirement to implement either the driver or the device topology. With this approach, our role would be to guide them in identifying the appropriate topology (driver or device) and then selecting the assets to integrate, depending on the topology, the presence of Linux on main processor and the required features.
| `remoteproc header <https://github.com/OpenAMP/open-amp/blob/main/lib/include/openamp/remoteproc.h>`_. | ||
| The resource table is effectively a list of resource definitions, with each entry detailed by the | ||
| corresponding :ref:`resource structure<resource-structure>`, and the Remoteproc framework | ||
| is responsible for configuring the relevant drivers and/or bare metal hardware. |
There was a problem hiding this comment.
is responsible for configuring the resource need by the remote processor ( shared memory, traces buffers, vendor specific resources)
0778cc5 to
ad38d12
Compare
different implementation will use varying combinations of hardware, RPMsg and Remoteproc so provide an overview of these. Signed-off-by: Sipke Vriend <sipke@direktembedded.com>
To further detail what a resource table contains, embed the doxygen from the remoteproc.h structure definitions. Signed-off-by: Sipke Vriend <sipke@direktembedded.com>
Use sphinx's literalinclude to add code snippets from examples rather than having code in the documentation. This helps in the documentation being updated when the code is and shows the user where an example can be studied further. This uses line numbers, which may need adjusting each release, but there would be an option to change code to include start and end tags as follows to avoid line updates. e.g. .. literalinclude:: example.py :start-after: "# start function_x" :end-before: "# end function_y" Signed-off-by: Sipke Vriend <sipke@direktembedded.com>
Reword this section slightly and link to an example rather than include a code snippet. Signed-off-by: Sipke Vriend <sipke@direktembedded.com>
ad38d12 to
85ebc56
Compare
| control‑oriented protocol rather than a high‑bandwidth streaming channel. For example, using | ||
| the Linux RPMsg packet size of 512 bytes, a 64kB shared memory region can hold roughly 128 | ||
| messages — sufficient for most applications. Larger or smaller allocations can be chosen based | ||
| on system needs. |
There was a problem hiding this comment.
64 KB is very big for some system . limit to 16 messages -> 8 KB
"Larger or smaller allocations can be chosen based
on system needs"
-> explain instead that the size and the number of messgae can be tuned based on the system needs and constraints
| on system needs. | ||
|
|
||
| In addition to the messages, the Virtio ring structures need memory allocated. For Linux | ||
| this equates to 2*4k but likely less for other implementations. |
There was a problem hiding this comment.
for linux the size of the allocated vering is aligned on a linux kernel Page ( usually 4K)
|
|
||
| On systems running an advanced OS — such as Linux on the main | ||
| processor — these protections may be applied through OS mechanisms like the device tree or | ||
| via the :ref:`Remoteproc<overview-remoteproc-work-label>` :ref:`Resource Table<resource-table>`. |
There was a problem hiding this comment.
Confusing, I would remove this sentence. protections can not be applied trough resource table and are platform dependent. this can be done by some other mechanisms
| - :ref:`Remoteproc<overview-remoteproc-work-label>` on the remote processor only, | ||
| with the main processor using an existing | ||
| :ref:`Remoteproc<overview-remoteproc-work-label>` implementation (e.g., Linux Remoteproc) | ||
| and no IPC. |
There was a problem hiding this comment.
One criticism of OpenAMP is that the remote processor framework is required on the remote device side. that why I would split remoteproc in 3 feature:
- remote processor live cycle management ( implemented on main processor)
- remoteproc virtio : the transport layer of the virtio protocol
- the resource table
In fact, on the remote side, the full remote processor framework is not required. Only the remote processor virtio transport layer is required. the resource table is also only mandatory for communication with Linux.
In addition, if no inter-process communication (IPC) is implemented, the remote side does not need the remote processor framework.
see my proposal in comment https://github.com/OpenAMP/openamp-docs/pull/86/changes#r3340380433
| Driver Lifecycle Management via Remoteproc | ||
| ========================================== | ||
|
|
||
| Some systems do not require IPC or use an alternative IPC mechanism. In these cases, only |
There was a problem hiding this comment.
if no IPC no remoteproc needed on remote processors
|
|
||
| .. _driver-lcm-remoteproc: | ||
|
|
||
| Driver Lifecycle Management via Remoteproc |
|
|
||
| This configuration is common in custom or bare‑metal remote environments. | ||
|
|
||
| - Pros: Full IPC and remote firmware management |
There was a problem hiding this comment.
This is one main point that is not necessarily true for the remote processor side. We try to minimize the footprint on the remote side even in this topology.
For me, there is usually a mix-up between the remoteproc virtio, which is the virtio transport layer, and the remoteproc that manages the load and lifecycle of the remote processor.
i would like try to have a more explicit split for the remote proc framework.
|
|
||
| - Pros: Very lightweight. | ||
| - Cons: Highly custom and less portable. | ||
|
|
There was a problem hiding this comment.
In my view, for this pages users will likely approach this with a requirement to implement either the driver or the device topology. With this approach, our role would be to guide them in identifying the appropriate topology (driver or device) and then selecting the assets to integrate, depending on the topology, the presence of Linux on main processor and the required features.
Changes to address #85
Added high level overview attempting to address suggestions in the issue to get feedback on direction.
Also added some questions to the issue to get more input for future changes to this PR.