Commit Graph
163 Commits
Author SHA1 Message Date
Arnaud Pouliquen 6032b22f1c rpmsg: rename destroy_cb to unbind_cb
the callback is no more used to inform application that the
local endpoint is destroyed but to inform that the remote
end point is destroyed so that the service is unbound.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2018-07-30 17:24:27 -07:00
Wendy Liang ef89a84593 rpmsg: retarget: use stdint.h instead of sys/types.h
sys/types.h is not available in some compiler, uses stdint.h
for uintX_t or intX_t types.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen 9867ca04d8 rpmsg: suppress useless include
Inclusion of types.h is not needed and can generate compilation issue.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2018-07-30 17:24:27 -07:00
Wendy Liang 875c6ed1d3 rpmsg_retarget: Line up with the RPMsg API changes
Update the RPMsg retarget service implementation to line up
with the RPMsg API changes.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen f93350359d rpmsg: rename endpoint create callback
This callback is called when a name service announcement is
received while no matching endpoint has been previously registered.
rename the callback to match with the usage.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen 7c8c63b3cb rpmsg_virtio: expose rpmsg_virtio_shm_pool_get_buffer
add rpmsg_virtio_shm_pool_get_buffer weak function in
rpmsg_vitio.h and comment the shared memory pool management.

Notice that if you implement your own rpmsg_virtio_shm_pool_get_buffer
the expectation is that one would embedded struct rpmsg_virtio_shm_pool
object inside your own struct and utilize something like metal_container_of()
to reference back to your own struct in your implementation of
rpmsg_virtio_shm_pool_get_buffer

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen e9dc87adcd rpmsg: cleanup is_rpmsg_ept_ready
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen b3488d8e12 rpmsg: suppress RPMSG_ERR_UNEXPECTED error
unexpected error does not mean anything. Manage this error by
either assert or invalid parameter depending on use case.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>

# Conflicts:
#	lib/rpmsg/rpmsg.c
#	lib/rpmsg/rpmsg_virtio.c
2018-07-30 17:24:27 -07:00
Wendy Liang 45681650f1 virtio: fix checkpatch warnings and errors
Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang 243162ce9f remoteproc: rsc: use I/O region in rsc table handler
Use I/O region to verify resource table in resource table handler.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang 30ef1984a8 remoteproc: add init and add remoteproc memory APIs
Add APIs to initialize remoteproc memory and add remoteproc
memories.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang 8f6b043346 remoteproc: pass remoteproc pointer to init()
Use remoteproc pointer as input arguement to remoteproc_init()
to allow static memory allocation.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang fa5303dfe1 rpmsg: change rpmsg ept callback return to int
It will be useful to have int as return type instead of void
as the RPMsg library implementation can decide the next step
based on the return code.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-07-30 17:24:27 -07:00
Wendy Liang ba6583910b rpmsg: remove unused declaration in header
Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen 9717d9ca0a remorteproc: fix coding rules
Fix coding rules highlighted by linux checkpatch script

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2018-07-30 17:24:27 -07:00
Wendy Liang 39ca857290 remoteproc: Remove calling shutdown from remove()
Remove is only allowed if the remoteproc state is
OFFLINE. Otherwise, instead of calling shutdown()
it will just return as remoteproc can be used
without life cycle management.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang 6efad8014f remoteproc: virtio: mark virtio dispatch functions const
mark the remoteproc virtio dispatch functions as const so that
they will not be modified at runtime.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang 157ebc3124 rpmsg: includes stdint.h in rpmsg.h
Linux system needs to have stdint.h included for uint32_t

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen bf9c2ff485 rpmsg: fix coding rules
Fix coding rule highlighted by linux checkpatch script

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen 3ad00ec42f virtio: fix coding rules
Fix coding rule highlighted by linux checkpatch script

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen a787732323 sh_mem: suppressed as no more used
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen 013b814dc1 rpmsg: virtio: supress sh_mem use
sh_mem offer utilities to dynamically manage a memory
pool for buffers. this is not need for rpmsg implementation.
The buffer management iss directly done in rpmsg_c, without
buffer memory free.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Wendy Liang <wendy.liang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang 17886a6c07 rpmsg: virtio: clean up rpmsg vdev init/deinit comments
Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang 78d109d600 rpmsg: include sys/types.h for uintX_t
should includes sys/types.h when uintX_t is used.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen d7aad45683 rpmsg_virtio: test metal_io_block_write return
If metal lib ops are not implemented an error is returned.
this error is lost. fix add check on the return.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2018-07-30 17:24:27 -07:00
Wendy Liang 087f67c36f rpmsg: define new endpoint callback type
Define new endpoint callback function type make it easier for
other functions to use it as input argument.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang bd72907209 rpmsg: Add rpmsg device input arg to new_endpoint_cb()
Add rpmsg device input argument to new_endpoint_cb() so that it
knows which rpmsg device this request is from.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang 56bca4fdcb rpmsg: Add checking if rpmsg endpoint ready API
Add API to allow application to check if the RPMsg endpoint is ready
to send message.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang 4ac907c9f5 rpmsg: virtio: expose get buffer size to user app
Allow user application to get vring buffer size.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen fead62d20f virtqueue: change vq name parameter type
Replace the char table by a pointer to a constant char.
As client provide constant char pointer to the name.
We can just register the address instead of copying the
name.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen 8313b18cf6 rpmsg: suppress endpoint creation on ns annoucement.
no more endpoint is created in rpmsg to store the remote
new service. Only a callback is called to inform the application.
Then application can create the associated endpoint or
just store the service for future usage.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen 487e3b1e95 rpmsg: update endpoint creation to support static allocation.
suppress the malloc and free. Let application provides the
rpmsg_endpoint structure.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2018-07-30 17:24:27 -07:00
Wendy Liang cf7be420a7 rpmsg: add name service endpoint to rpmsg_device
Add name service endpoint to rpmsg device struct.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang bf116c0489 remoteproc/remoteproc_virtio: updates
remoteproc_virtio:
* Implement virtio dispatch functions and remoteproc virtio creation
  and initialization functions.
* migrate vring structures
* migrate virqueue creation from remote proc to virtio
* declare rproc_remove_virtio function
* change type of vrings_num in virtio to unsigned int
* rename virtio_vring to virtio_vring_info
* rename rvring to vring_info
* Fixup for virtqueue_alloc change
* line up with VIRTIO_DEV_XXX macro change
* set the virtio dispatch func in virtio creation
* implement rproc_virtio_remove_vdev()
* send notification for virtio config changes - Notify the other side
  for virtio configuration changes.
* rename rpmsg_virtio_ function to rproc_virtio_
* track the remoteproc virtio in remoteproc
* implement remoteproc virtio notificaiton
* add notification from remote implementation
* fixup test on uninitialized role

remoteproc:
* fix function name of remove virtio
* add remoteproc id allocation function to allocate notifyid for vdev
  resource.
* implement remoteproc create/remove vdev function
* fix unused variable warnings
* rename set_rsc_table function to parse_rsc_table
* fix uninitialised variable
* implement remoteproc_parse_rsc_table
* fix up remoteproc notify definition
* fix missing list initialisation
* fix return in case of success
* remove vdevs in remoteproc shutdown
* calls rproc defined stop()/shutdown() if defined
* implement lookup for I/O region based on PA
* Add looking up metal I/O region with given va
* add set and parse resource table function
* correct setting rsc table in load() function

Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2018-07-30 17:24:27 -07:00
Kumar Gala 24795f4f20 lib: rpmsg: Add new rpmsg
- Add new API
- rmpsg_init implementation
- rpmsg: suppress the channel management
	Rebase rpmsg on endpoint only.
	Reintroduce rpmsg core to split interface part with the core.
	Now rpmsg.c provide the API relying on the core.
- add remoteproc_vshm_pool to rpmsg.h for now, we need to clean this up
- rpmsg: add shm_io as input arguemnt to rpmsg_vdev_init
- Add core function to unregister the end points.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen 98611c83b8 lib: virtio: update virtio device
update virtio structure for new design

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-07-30 17:24:27 -07:00
Arnaud Pouliquen cb8de4198b lib: rpmsg: Remove old rpmsg implementation
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-07-30 17:24:27 -07:00
Wendy Liang dcc12a1a59 lib: remoteproc_virtio: Introduce new remoteproc_virtio
remoteproc virtio to replace hil.c/.h to setup vdev,vrings and shm

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang bf7ee51a7f decouple rproc WIP
* Add size attribute to remoteproc memory struct.
* remoteproc: Add remoteproc memory lookup APIs

Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-07-30 17:24:27 -07:00
Kumar Gala 57dbfb4caf remoteproc_loader: updates for decoupling 2018-07-30 17:24:27 -07:00
Kumar Gala 878c13a841 lib: remoteproc: Update rsc_table_parser
* implement vdev resource parser - The vdev resourcde parser will allocate notifyid.
* add find resource funcion to locate the resource in the
resource table.
* fix resource table parsing.
  Fix the management of the addresses offset if a second resource is
  declared, its start address is not valid.
* add trace handler
  Add handler for the trace type.  in this first step only trace
  statically defined by remote processor is valid.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2018-07-30 17:24:27 -07:00
Kumar Gala 3ba3821df9 lib: elf_loader: update 2018-07-30 17:24:27 -07:00
Kumar Gala 8d0997acc6 TODO: lib: sh_mem: Add new openamp_get_shmem_datova
Added:
 openamp_get_shmem_datova
 openamp_get_shmem_patova
 openamp_get_shmem_vatopa

This isn't currently used by anything and it feels like the
imlementation isn't complete as there is some init of the shmem struct
that has to happen somewhere.
2018-07-30 17:24:27 -07:00
Wendy Liang d18afbb647 lib: remove firmware implementation
Remove firmware implementation as it assume that the firmware
needs to be in memory. We will need to support firmware
in storage too.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang 8e5f479d2e lib: remove hil layer
Remove hil layer to separate RPMsg from Remoteproc

Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2018-07-30 17:24:27 -07:00
Kumar Gala ac828df5e3 virtqueue: encapsulate shared memory handling
Encapsulate the the handling of the shared memory region to make it clear
exactly what functionality is needed and ensure that others aren't touch
internal data that we aren't aware of.

We treat the sh_mem region in the virtqueue as an obaque pointer that
only should get used by v2p and p2v functions.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-07-30 17:24:27 -07:00
Kumar Gala 7d21283fd8 virtqueue: Introduce virtqueue_buffer to replace metal_sg
virtqueue_add_buffer takes a list of buffers, so lets decouple it from
depending on metal_sg.  Instead we just create a new struct
virtqueue_buffer which keeps track of the buffer pointer and length.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-07-30 17:24:27 -07:00
Kumar Gala b13a42b215 virtqueue: remove virtqueue_add_single_buffer
virtqueue_add_single_buffer isn't used by anything and we have
virtqueue_add_buffer that accomplishes what we need, so remove the
function.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-07-30 17:24:27 -07:00
Wendy Liang 6f816566e0 virtqueue: remove shm_io argument from virtqueue_create()
Remove shared memory I/O region argument from virtqueue_create() API.
The virtqueue I/O region can be set in another APIs.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00
Wendy Liang d7b3558a3b virtqueue: Add function to set shmem I/O region
Add function to set shared memory I/O region per virtqueue.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
2018-07-30 17:24:27 -07:00