summaryrefslogtreecommitdiffstats
path: root/drivers/rpmsg
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'rpmsg-v4.13' of git://github.com/andersson/remoteprocLinus Torvalds2017-07-067-17/+1279
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull rpmsg updates from Bjorn Andersson: "This introduces the Qualcomm GLINK protocol driver and DeviceTree-based modalias support, as well as a number of smaller fixes" * tag 'rpmsg-v4.13' of git://github.com/andersson/remoteproc: rpmsg: Make modalias work for DeviceTree based devices rpmsg: Drop VIRTUALIZATION dependency from RPMSG_VIRTIO rpmsg: Don't overwrite release op of rpdev rpmsg: virtio_rpmsg_bus: cleanup multiple assignment to ops rpmsg: virtio_rpmsg_bus: fix nameservice address rpmsg: cleanup incorrect function in dev_err message rpmsg: virtio_rpmsg_bus: fix announce for devices without endpoint rpmsg: Introduce Qualcomm RPM glink driver soc: qcom: Add device tree binding for GLINK RPM rpmsg: Release rpmsg devices in backends
| * rpmsg: Make modalias work for DeviceTree based devicesBjorn Andersson2017-06-281-0/+10
| | | | | | | | | | | | | | | | | | | | When rpmsg devices are expected to be matched based on their compatible the modalias should reflect this, so that module autoloading has a chance to match and load the appropriate module. Tested-by: Rob Clark <robdclark@gmail.com> Reported-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: Drop VIRTUALIZATION dependency from RPMSG_VIRTIOSuman Anna2017-06-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A dependency to VIRTUALIZATION has been added to RPMSG_VIRTIO (back when it was named RPMSG) in v3.10 kernel in commit 397944df3290 ("rpmsg: fix kconfig dependencies for VIRTIO") to resolve Kconfig warnings due to the inclusion of the virtio configuration file from the ARM's KVM config file. The KVM config was fixed properly in the subsequent release in commit 8bd4ffd6b3a9 ("ARM: kvm: don't include drivers/virtio/Kconfig"). So, drop this unneeded VIRTUALIZATION dependency from RPMSG_VIRTIO. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: Don't overwrite release op of rpdevBjorn Andersson2017-06-261-8/+0
| | | | | | | | | | | | | | | | | | | | | | b0b03b811963 ("rpmsg: Release rpmsg devices in backends") attempted to correct the ownership of freeing rpmsg device memory. But the patch is not complete, in that the rpmsg core will overwrite the release op as the device is being registered. Fixes: b0b03b811963 ("rpmsg: Release rpmsg devices in backends") Reported-by: Henri Roosen <henri.roosen@ginzinger.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: virtio_rpmsg_bus: cleanup multiple assignment to opsHenri Roosen2017-06-251-3/+0
| | | | | | | | | | | | | | | | | | Trivial cleanup: the .ops pointer is assigned twice. This patch removes the first assignment. Acked-by: Suman Anna <s-anna@ti.com> Signed-off-by: Henri Roosen <henri.roosen@ginzinger.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: virtio_rpmsg_bus: fix nameservice addressHenri Roosen2017-06-251-1/+1
| | | | | | | | | | | | | | | | | | Commit 2a48d7322dc8 ("rpmsg: rpmsg_send() operations takes rpmsg_endpoint") only changed the nameservice address for virtio_rpmsg_announce_create() but did not do the same change for virtio_rpmsg_announce_destroy(). Signed-off-by: Henri Roosen <henri.roosen@ginzinger.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: cleanup incorrect function in dev_err messageHenri Roosen2017-06-251-2/+2
| | | | | | | | | | | | | | Trivial cleanup for incorrect function in dev_err message Signed-off-by: Henri Roosen <henri.roosen@ginzinger.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: virtio_rpmsg_bus: fix announce for devices without endpointHenri Roosen2017-06-251-2/+2
| | | | | | | | | | | | | | | | A device might not have an endpoint assigned. This patch checks if rpdev->ept has a value before dereferencing or using it. Signed-off-by: Henri Roosen <henri.roosen@ginzinger.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: Introduce Qualcomm RPM glink driverBjorn Andersson2017-05-303-0/+1244
| | | | | | | | | | | | | | This introduces a basic driver for communicating over "native glink" with the RPM found in Qualcomm platforms. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: Release rpmsg devices in backendsBjorn Andersson2017-05-172-0/+20
| | | | | | | | | | | | | | The rpmsg devices are allocated in the backends and as such must be freed there as well. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-nextLinus Torvalds2017-07-051-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull networking updates from David Miller: "Reasonably busy this cycle, but perhaps not as busy as in the 4.12 merge window: 1) Several optimizations for UDP processing under high load from Paolo Abeni. 2) Support pacing internally in TCP when using the sch_fq packet scheduler for this is not practical. From Eric Dumazet. 3) Support mutliple filter chains per qdisc, from Jiri Pirko. 4) Move to 1ms TCP timestamp clock, from Eric Dumazet. 5) Add batch dequeueing to vhost_net, from Jason Wang. 6) Flesh out more completely SCTP checksum offload support, from Davide Caratti. 7) More plumbing of extended netlink ACKs, from David Ahern, Pablo Neira Ayuso, and Matthias Schiffer. 8) Add devlink support to nfp driver, from Simon Horman. 9) Add RTM_F_FIB_MATCH flag to RTM_GETROUTE queries, from Roopa Prabhu. 10) Add stack depth tracking to BPF verifier and use this information in the various eBPF JITs. From Alexei Starovoitov. 11) Support XDP on qed device VFs, from Yuval Mintz. 12) Introduce BPF PROG ID for better introspection of installed BPF programs. From Martin KaFai Lau. 13) Add bpf_set_hash helper for TC bpf programs, from Daniel Borkmann. 14) For loads, allow narrower accesses in bpf verifier checking, from Yonghong Song. 15) Support MIPS in the BPF selftests and samples infrastructure, the MIPS eBPF JIT will be merged in via the MIPS GIT tree. From David Daney. 16) Support kernel based TLS, from Dave Watson and others. 17) Remove completely DST garbage collection, from Wei Wang. 18) Allow installing TCP MD5 rules using prefixes, from Ivan Delalande. 19) Add XDP support to Intel i40e driver, from Björn Töpel 20) Add support for TC flower offload in nfp driver, from Simon Horman, Pieter Jansen van Vuuren, Benjamin LaHaise, Jakub Kicinski, and Bert van Leeuwen. 21) IPSEC offloading support in mlx5, from Ilan Tayari. 22) Add HW PTP support to macb driver, from Rafal Ozieblo. 23) Networking refcount_t conversions, From Elena Reshetova. 24) Add sock_ops support to BPF, from Lawrence Brako. This is useful for tuning the TCP sockopt settings of a group of applications, currently via CGROUPs" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1899 commits) net: phy: dp83867: add workaround for incorrect RX_CTRL pin strap dt-bindings: phy: dp83867: provide a workaround for incorrect RX_CTRL pin strap cxgb4: Support for get_ts_info ethtool method cxgb4: Add PTP Hardware Clock (PHC) support cxgb4: time stamping interface for PTP nfp: default to chained metadata prepend format nfp: remove legacy MAC address lookup nfp: improve order of interfaces in breakout mode net: macb: remove extraneous return when MACB_EXT_DESC is defined bpf: add missing break in for the TCP_BPF_SNDCWND_CLAMP case bpf: fix return in load_bpf_file mpls: fix rtm policy in mpls_getroute net, ax25: convert ax25_cb.refcount from atomic_t to refcount_t net, ax25: convert ax25_route.refcount from atomic_t to refcount_t net, ax25: convert ax25_uid_assoc.refcount from atomic_t to refcount_t net, sctp: convert sctp_ep_common.refcnt from atomic_t to refcount_t net, sctp: convert sctp_transport.refcnt from atomic_t to refcount_t net, sctp: convert sctp_chunk.refcnt from atomic_t to refcount_t net, sctp: convert sctp_datamsg.refcnt from atomic_t to refcount_t net, sctp: convert sctp_auth_bytes.refcnt from atomic_t to refcount_t ...
| * | networking: introduce and use skb_put_data()Johannes Berg2017-06-161-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common pattern with skb_put() is to just want to memcpy() some data into the new space, introduce skb_put_data() for this. An spatch similar to the one for skb_put_zero() converts many of the places using it: @@ identifier p, p2; expression len, skb, data; type t, t2; @@ ( -p = skb_put(skb, len); +p = skb_put_data(skb, data, len); | -p = (t)skb_put(skb, len); +p = skb_put_data(skb, data, len); ) ( p2 = (t2)p; -memcpy(p2, data, len); | -memcpy(p, data, len); ) @@ type t, t2; identifier p, p2; expression skb, data; @@ t *p; ... ( -p = skb_put(skb, sizeof(t)); +p = skb_put_data(skb, data, sizeof(t)); | -p = (t *)skb_put(skb, sizeof(t)); +p = skb_put_data(skb, data, sizeof(t)); ) ( p2 = (t2)p; -memcpy(p2, data, sizeof(*p)); | -memcpy(p, data, sizeof(*p)); ) @@ expression skb, len, data; @@ -memcpy(skb_put(skb, len), data, len); +skb_put_data(skb, data, len); (again, manually post-processed to retain some comments) Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* / rpmsg: use dev_groups and not dev_attrs for bus_typeGreg Kroah-Hartman2017-06-091-10/+13
|/ | | | | | | | | | | The dev_attrs field has long been "depreciated" and is finally being removed, so move the driver to use the "correct" dev_groups field instead for struct bus_type. Cc: Ohad Ben-Cohen <ohad@wizery.com> Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: <linux-remoteproc@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhostLinus Torvalds2017-05-101-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull virtio updates from Michael Tsirkin: "Fixes, cleanups, performance A bunch of changes to virtio, most affecting virtio net. Also ptr_ring batched zeroing - first of batching enhancements that seems ready." * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: s390/virtio: change maintainership tools/virtio: fix spelling mistake: "wakeus" -> "wakeups" virtio_net: tidy a couple debug statements ptr_ring: support testing different batching sizes ringtest: support test specific parameters ptr_ring: batch ring zeroing virtio: virtio_driver doc virtio_net: don't reset twice on XDP on/off virtio_net: fix support for small rings virtio_net: reduce alignment for buffers virtio_net: rework mergeable buffer handling virtio_net: allow specifying context for rx virtio: allow extra context per descriptor tools/virtio: fix build breakage virtio: add context flag to find vqs virtio: wrap find_vqs ringtest: fix an assert statement
| * virtio: wrap find_vqsMichael S. Tsirkin2017-05-021-1/+1
| | | | | | | | | | | | | | We are going to add more parameters to find_vqs, let's wrap the call so we don't need to tweak all drivers every time. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | soc: qcom: smd: Remove standalone driverBjorn Andersson2017-03-281-1/+0
|/ | | | | | | | | | | | Remove the standalone SMD implementation as we have transitioned the client drivers to use the RPMSG based one. Also remove all dependencies on QCOM_SMD from Kconfig files, in order to keep them selectable in the absence of the removed symbol. Acked-by: Andy Gross <andy.gross@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhostLinus Torvalds2017-03-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull vhost updates from Michael Tsirkin: "virtio, vhost: optimizations, fixes Looks like a quiet cycle for vhost/virtio, just a couple of minor tweaks. Most notable is automatic interrupt affinity for blk and scsi. Hopefully other devices are not far behind" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: virtio-console: avoid DMA from stack vhost: introduce O(1) vq metadata cache virtio_scsi: use virtio IRQ affinity virtio_blk: use virtio IRQ affinity blk-mq: provide a default queue mapping for virtio device virtio: provide a method to get the IRQ affinity mask for a virtqueue virtio: allow drivers to request IRQ affinity when creating VQs virtio_pci: simplify MSI-X setup virtio_pci: don't duplicate the msix_enable flag in struct pci_dev virtio_pci: use shared interrupts for virtqueues virtio_pci: remove struct virtio_pci_vq_info vhost: try avoiding avail index access when getting descriptor virtio_mmio: expose header to userspace
| * virtio: allow drivers to request IRQ affinity when creating VQsChristoph Hellwig2017-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a struct irq_affinity pointer to the find_vqs methods, which if set is used to tell the PCI layer to create the MSI-X vectors for our I/O virtqueues with the proper affinity from the start. Compared to after the fact affinity hints this gives us an instantly working setup and allows to allocate the irq descritors node-local and avoid interconnect traffic. Last but not least this will allow blk-mq queues are created based on the interrupt affinity for storage drivers. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | rpmsg: rpmsg_create_ept() returns NULL on errorBjorn Andersson2017-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | The parameter validation incorrectly returned an ERR_PTR(), which is not handled by the callers to rpmsg_create_ept(), per the definition NULL should be returned. Fixes: 93e9324431c9 ("rpmsg: Handle invalid parameters in public API") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | rpmsg: unlock on error in rpmsg_eptdev_read()Dan Carpenter2017-01-301-2/+1
| | | | | | | | | | | | | | | | We should unlock before returning if skb_dequeue() returns a NULL. Fixes: c0cdc19f84a4 ("rpmsg: Driver for user space endpoint interface") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | rpmsg: char: add CONFIG_NET dependencyArnd Bergmann2017-01-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without CONFIG_NET, we get a build failure for the new driver: ERROR: "skb_queue_tail" [drivers/rpmsg/rpmsg_char.ko] undefined! ERROR: "skb_put" [drivers/rpmsg/rpmsg_char.ko] undefined! ERROR: "__alloc_skb" [drivers/rpmsg/rpmsg_char.ko] undefined! ERROR: "kfree_skb" [drivers/rpmsg/rpmsg_char.ko] undefined! ERROR: "skb_dequeue" [drivers/rpmsg/rpmsg_char.ko] undefined! This adds a dependency so we don't try to build the broken configuration. Fixes: c0cdc19f84a4 ("rpmsg: Driver for user space endpoint interface") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | rpmsg: smd: Register rpmsg user space interface for edgesBjorn Andersson2017-01-181-0/+20
| | | | | | | | | | | | | | | | | | | | | | Create and register a rpmsg device for use with the rpmsg user space interface, allowing user space to access SMD channels. Also provide the "rpmsg_name" device attribute to expose the edge name in sysfs, allowing the user to write udev rules for specific rpmsg devices and their children. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | rpmsg: Driver for user space endpoint interfaceBjorn Andersson2017-01-184-0/+609
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver allows rpmsg instances to expose access to rpmsg endpoints to user space processes. It provides a control interface, allowing userspace to export endpoints and an endpoint interface for each exposed endpoint. The implementation is based on prior art by Texas Instrument, Google, PetaLogix and was derived from a FreeRTOS performance statistics driver written by Michal Simek. The control interface provides a "create endpoint" ioctl, which is fed a name, source and destination address. The three values are used to create the endpoint, in a backend-specific way, and a rpmsg endpoint device is created - with the three parameters are available in sysfs for udev usage. E.g. to create an endpoint device for one of the Qualcomm SMD channel related to DIAG one would issue: struct rpmsg_endpoint_info info = { "DIAG_CNTL", 0, 0 }; int fd = open("/dev/rpmsg_ctrl0", O_RDWR); ioctl(fd, RPMSG_CREATE_EPT_IOCTL, &info); Each created endpoint device shows up as an individual character device in /dev, allowing permission to be controlled on a per-endpoint basis. The rpmsg endpoint will be created and destroyed following the opening and closing of the endpoint device, allowing rpmsg backends to open and close the physical channel, if supported by the wire protocol. Cc: Marek Novak <marek.novak@nxp.com> Cc: Matteo Sartori <matteo.sartori@t3lab.it> Cc: Michal Simek <monstr@monstr.eu> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | rpmsg: qcom_smd: Implement endpoint "poll"Bjorn Andersson2017-01-181-0/+16
| | | | | | | | | | | | | | Add support for polling the status of the write buffer so that user space can use rpmsg character devices in non-blocking mode. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | rpmsg: Introduce "poll" to endpoint opsBjorn Andersson2017-01-182-0/+23
| | | | | | | | | | | | | | | | This allows rpmsg backends to implement polling of the outgoing buffer, which provides poll support to user space when using the rpmsg character device. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | rpmsg: qcom_smd: Add support for "label" propertyBjorn Andersson2017-01-181-0/+22
|/ | | | | | | | Add support for the "label" property, used to give the edge a name other than the one of the DT node. This allows the implementor to provide consistently named edges when using the rpmsg character device. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: virtio_rpmsg_bus: fix channel creationLoic Pallardy2016-12-301-2/+2
| | | | | | | | | | | | | | | | | | | Since commit 4dffed5b3ac796b ("rpmsg: Name rpmsg devices based on channel id"), it is no more possible for a firmware to register twice a service (on different endpoints). rpmsg_register_device function is failing when calling device_add for the second time as second device has the same name as first one already register. It is because name is based only on service name and so is not more unique. Previously name was unique thanks to the use of rpmsg_dev_index. This patch adds destination and source endpoint numbers device name to create an unique identifier. Fixes: 4dffed5b3ac7 ("rpmsg: Name rpmsg devices based on channel id") Acked-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Loic Pallardy <loic.pallardy@st.com> [bjorn: flipped name and address in device name] Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* Merge tag 'rpmsg-v4.10' of git://github.com/andersson/remoteprocLinus Torvalds2016-12-132-28/+63
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull rpmsg updates from Bjorn Andersson: "Argument validation in public functions, function stubs for COMPILE_TEST-ing clients, preparation for exposing rpmsg endponts to user space and minor Qualcomm SMD fixes" * tag 'rpmsg-v4.10' of git://github.com/andersson/remoteproc: dt-binding: soc: qcom: smd: Add label property rpmsg: qcom_smd: Correct return value for O_NONBLOCK rpmsg: Provide function stubs for API rpmsg: Handle invalid parameters in public API rpmsg: Support drivers without primary endpoint rpmsg: Introduce a driver override mechanism rpmsg: smd: Reduce restrictions when finding channel
| * rpmsg: qcom_smd: Correct return value for O_NONBLOCKBjorn Andersson2016-12-081-1/+1
| | | | | | | | | | | | | | | | qcom_smd_send() should return -EAGAIN for non-blocking channels with insufficient space, so that we can propagate this event to user space. Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend") Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: Handle invalid parameters in public APIBjorn Andersson2016-10-311-2/+37
| | | | | | | | | | | | | | | | | | There are two cases of possible uninitialized pointer usage in the API, either the parameters themselves are invalid or we're trying to jump to functions not required to be implemented by all backends. Suggested-by: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: Support drivers without primary endpointBjorn Andersson2016-10-311-14/+18
| | | | | | | | | | | | | | | | | | | | | | Some types of rpmsg drivers does not have a primary endpoint to tie their existence upon, but wishes to create and destroy endpoints dynamically, e.g. based on user interactions. Allow rpmsg drivers to omit a driver callback to signal this case and make the probe path not create a primary endpoint in this case. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: Introduce a driver override mechanismBjorn Andersson2016-10-311-0/+3
| | | | | | | | | | | | | | Similar to other subsystems it's useful to provide a mechanism to force a specific driver match on a device, so introduce this. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: smd: Reduce restrictions when finding channelBjorn Andersson2016-10-311-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | SMD channels are created by the remotes in "opening" state, but sometimes as we close and try to reopen them they linger in closing state. Following the search for a matching channel the create_ept() will verify that the channel is in a suitable state, so we can lax the restrictions of the search function to work around above difference in behaviour. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | rpmsg: smd: Expose edge registration functionsBjorn Andersson2016-11-141-0/+1
|/ | | | | | | | The edge registration functions is to be used from a remoteproc driver to register and unregister an edge as the remote processor comes and goes. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: smd: fix dependency on QCOM_SMD=nArnd Bergmann2016-09-121-1/+1
| | | | | | | | | | | | | | | | | | | The ARM allmodconfig build broke with the addition of the SMD rpmsg driver that conflicts with the driver its replaces: WARNING: drivers/soc/qcom/smd: 'qcom_smd_register_edge' exported twice. Previous export was in drivers/rpmsg/qcom_smd.ko WARNING: drivers/soc/qcom/smd: 'qcom_smd_unregister_edge' exported twice. Previous export was in drivers/rpmsg/qcom_smd.ko There is already a dependency that is meant to avoid the broken configuration, but that only prevents the case where at least one of the two are built-in, but not if both are modules. This changes the dependency to "=n", to ensure that the new driver can only be enabled if the other one is completely disabled. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend") Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Introduce Qualcomm SMD backendBjorn Andersson2016-09-083-0/+1445
| | | | | | | | | | | | | This introduces a new rpmsg backend for the Qualcomm SMD system, allowing communication with various remote processors found in Qualcomm platforms. The implementation is based on, and intends to replace, drivers/soc/qcom/smd.c with the necessary adaptions for fitting with the rpmsg core. Based on original work by Sricharan R <sricharan@codeaurora.org> Cc: Sricharan R <sricharan@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Allow callback to return errorsBjorn Andersson2016-09-081-4/+6
| | | | | | | | Some rpmsg backends support holding on to and redelivering messages upon failed handling of them, so provide a way for the callback to report and error and allow the backends to handle this. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Move virtio specifics from public headerBjorn Andersson2016-09-081-0/+52
| | | | | | | Move virtio rpmsg implementation details from the public header file to the virtio rpmsg implementation. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: virtio: Hide vrp pointer from the public APIBjorn Andersson2016-09-081-8/+35
| | | | | | | | Create a container struct virtio_rpmsg_channel around the rpmsg_channel to keep virtio backend information separate from the rpmsg and public API. This makes the public structures independant of virtio. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Hide rpmsg indirection tablesBjorn Andersson2016-09-082-0/+50
| | | | | | | Move the device and endpoint indirection tables to the rpmsg internal header file, to hide them from the public API. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Split rpmsg core and virtio backendBjorn Andersson2016-09-083-223/+237
| | | | | | | | | | | Extract the generic rpmsg core functionality from the virtio rpmsg implementation, splitting the implementation in a rpmsg core and a virtio backend. Based on initial work by Sricharan R <sricharan@codeaurora.org> Cc: Sricharan R <sricharan@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Split off generic tail of create_channel()Bjorn Andersson2016-09-081-3/+15
| | | | | | | | The tail of create_channel() is common among all rpmsg backends, so split it off from the virtio specific part to allow it to be extracted to the rpmsg core. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Move helper for finding rpmsg devices to coreBjorn Andersson2016-09-083-25/+68
| | | | | | | Extract and move the helper function for finding rpmsg child devices to the core. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Move endpoint related interface to rpmsg coreBjorn Andersson2016-09-082-13/+160
| | | | | | | | Move the rpmsg_send() and rpmsg_destroy_ept() interface to the rpmsg core, so that we eventually can hide the rpmsg_endpoint ops from the public API. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Indirection table for rpmsg_endpoint operationsBjorn Andersson2016-09-081-3/+82
| | | | | | | | Add indirection table for rpmsg_endpoint related operations and move virtio implementation behind this, this finishes of the decoupling of the virtio implementation from the public API. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Move rpmsg_device API to new fileBjorn Andersson2016-09-084-49/+77
| | | | | | | Extract the now indirect rpmsg_create_ept() interface to a separate file and start building up a rpmsg core. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Introduce indirection table for rpmsg_device operationsBjorn Andersson2016-09-081-6/+42
| | | | | | | | To allow for multiple backend implementations add an indireection table for rpmsg_device related operations and move the virtio implementation behind this table. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Clean up rpmsg device vs channel namingBjorn Andersson2016-09-081-21/+21
| | | | | | | | The rpmsg device representing struct is called rpmsg_channel and the variable name used throughout is rpdev, with the communication happening on endpoints it's clearer to just call this a "device" in a public API. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Make rpmsg_create_ept() take channel_info structBjorn Andersson2016-09-081-16/+10
| | | | | | | | | | As we introduce support for additional rpmsg backends, some of these only supports point-to-point "links" represented by a name. By making rpmsg_create_ept() take a channel_info struct we allow for these backends to either be passed a source address, a destination address or a name identifier. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: rpmsg_send() operations takes rpmsg_endpointBjorn Andersson2016-09-081-3/+3
| | | | | | | | | | | | | | | The rpmsg_send() operations has been taking a rpmsg_device, but this forces users of secondary rpmsg_endpoints to use the rpmsg_sendto() interface - by extracting source and destination from the given data structures. If we instead pass the rpmsg_endpoint to these functions a service can use rpmsg_sendto() to respond to messages, even on secondary endpoints. In addition this would allow us to support operations on multiple channels in future backends that does not support off-channel operations. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>