rpmsg updates for v4.15
This turn RPMSG_VIRTIO into a user selectable config, fixes a few bugs in GLINK and provides the support for specifying initial buffer sizes for GLINK channels. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJaD2r+AAoJEAsfOT8Nma3F/tMP/24c6KyWfmkhRYXA5gJmEjnD PpzhfNonTYl225ZRutR6M4+gpOt6Ljtu8gvGzqXuPRNBf4CNCMqTRvQt0nF+jZnw QciY3dtDMKdCGC3hZoxCX6d1GjjtqvPL4SJW4zkcgYw4SnN5nISFw9iHpdDcX5bx RoCcCzq7rPRBRs4HNQ7wDSFTh9UAr5tAY5i4HwsAAoGejlhhioduDWoLp4dgGV5j Nc7wOU8KQZzPivN/i9ma8WdjZDzy9oSz0PRF6nbGnvFp/NOlxA3rj1DVIB7ONaV0 Ttod4Fs5Mj1GrsBKQ4rf2qVwjTIM2x721wJDBAzqJ6fRtHwCFim2THMZPx0s7pa9 SqX+ZUmV9WD8TBz+mQcLYG3mHqZIlpE4f+uAc8XWruISyij7j9QVoqzZxtGRI1H/ SFu21ovlZieuBRS3g8soxkjFmHzlvvyzrv8p/+t4KqAtb1csTVPAxEsT8PddHzPR +c8mUKgFlcJnmi4ILg3rIo7Z3BLfz7C7jIZpRBXEe2Z2JA1aHbUrUWDpw/QhHoEy rlASk0f4h4uhAYlsxJDYx+Wg5b3DV0H/ouy5qzDdxlB78Gvw+6/2RUPSeummu2Mt 5rKg0anw1GtAGYlXx14HVX427HY3y6mrmNERlfPnwkwfQfTbYVQ6vMp1op+8XF0H KbxkyufQlZnimLJjwD6W =jirb -----END PGP SIGNATURE----- Merge tag 'rpmsg-v4.15' of git://github.com/andersson/remoteproc Pull rpmsg updates from Bjorn Andersson: - turn RPMSG_VIRTIO into a user selectable config - fix few bugs in GLINK - provide the support for specifying initial buffer sizes for GLINK channels. * tag 'rpmsg-v4.15' of git://github.com/andersson/remoteproc: rpmsg: glink: The mbox client knows_txdone rpmsg: glink: Add missing MODULE_LICENSE rpmsg: glink: Use best fit intent during tx rpmsg: glink: Add support to preallocate intents dt-bindings: soc: qcom: Support GLINK intents rpmsg: glink: Initialize the "intent_req_comp" completion variable rpmsg: Allow RPMSG_VIRTIO to be enabled via menuconfig or defconfig
This commit is contained in:
commit
bedf571986
|
@ -39,6 +39,14 @@ of these nodes are defined by the individual bindings for the specific function
|
|||
Definition: a list of channels tied to this function, used for matching
|
||||
the function to a set of virtual channels
|
||||
|
||||
- qcom,intents:
|
||||
Usage: optional
|
||||
Value type: <prop-encoded-array>
|
||||
Definition: a list of size,amount pairs describing what intents should
|
||||
be preallocated for this virtual channel. This can be used
|
||||
to tweak the default intents available for the channel to
|
||||
meet expectations of the remote.
|
||||
|
||||
= EXAMPLE
|
||||
The following example represents the GLINK RPM node on a MSM8996 device, with
|
||||
the function for the "rpm_request" channel defined, which is used for
|
||||
|
@ -69,6 +77,8 @@ regualtors and root clocks.
|
|||
compatible = "qcom,rpm-msm8996";
|
||||
qcom,glink-channels = "rpm_requests";
|
||||
|
||||
qcom,intents = <0x400 5
|
||||
0x800 1>;
|
||||
...
|
||||
};
|
||||
};
|
||||
|
|
|
@ -28,7 +28,6 @@ config OMAP_REMOTEPROC
|
|||
depends on OMAP_IOMMU
|
||||
select MAILBOX
|
||||
select OMAP2PLUS_MBOX
|
||||
select RPMSG_VIRTIO
|
||||
help
|
||||
Say y here to support OMAP's remote processors (dual M3
|
||||
and DSP on OMAP4) via the remote processor framework.
|
||||
|
@ -58,7 +57,6 @@ config DA8XX_REMOTEPROC
|
|||
tristate "DA8xx/OMAP-L13x remoteproc support"
|
||||
depends on ARCH_DAVINCI_DA8XX
|
||||
depends on DMA_CMA
|
||||
select RPMSG_VIRTIO
|
||||
help
|
||||
Say y here to support DA8xx/OMAP-L13x remote processors via the
|
||||
remote processor framework.
|
||||
|
@ -79,7 +77,6 @@ config DA8XX_REMOTEPROC
|
|||
config KEYSTONE_REMOTEPROC
|
||||
tristate "Keystone Remoteproc support"
|
||||
depends on ARCH_KEYSTONE
|
||||
select RPMSG_VIRTIO
|
||||
help
|
||||
Say Y here here to support Keystone remote processors (DSP)
|
||||
via the remote processor framework.
|
||||
|
@ -135,7 +132,6 @@ config ST_REMOTEPROC
|
|||
depends on ARCH_STI
|
||||
select MAILBOX
|
||||
select STI_MBOX
|
||||
select RPMSG_VIRTIO
|
||||
help
|
||||
Say y here to support ST's adjunct processors via the remote
|
||||
processor framework.
|
||||
|
|
|
@ -47,7 +47,8 @@ config RPMSG_QCOM_SMD
|
|||
platforms.
|
||||
|
||||
config RPMSG_VIRTIO
|
||||
tristate
|
||||
tristate "Virtio RPMSG bus driver"
|
||||
depends on HAS_DMA
|
||||
select RPMSG
|
||||
select VIRTIO
|
||||
|
||||
|
|
|
@ -227,6 +227,7 @@ static struct glink_channel *qcom_glink_alloc_channel(struct qcom_glink *glink,
|
|||
|
||||
init_completion(&channel->open_req);
|
||||
init_completion(&channel->open_ack);
|
||||
init_completion(&channel->intent_req_comp);
|
||||
|
||||
INIT_LIST_HEAD(&channel->done_intents);
|
||||
INIT_WORK(&channel->intent_work, qcom_glink_rx_done_work);
|
||||
|
@ -1148,19 +1149,38 @@ static struct rpmsg_endpoint *qcom_glink_create_ept(struct rpmsg_device *rpdev,
|
|||
static int qcom_glink_announce_create(struct rpmsg_device *rpdev)
|
||||
{
|
||||
struct glink_channel *channel = to_glink_channel(rpdev->ept);
|
||||
struct glink_core_rx_intent *intent;
|
||||
struct device_node *np = rpdev->dev.of_node;
|
||||
struct qcom_glink *glink = channel->glink;
|
||||
int num_intents = glink->intentless ? 0 : 5;
|
||||
struct glink_core_rx_intent *intent;
|
||||
const struct property *prop = NULL;
|
||||
__be32 defaults[] = { cpu_to_be32(SZ_1K), cpu_to_be32(5) };
|
||||
int num_intents;
|
||||
int num_groups = 1;
|
||||
__be32 *val = defaults;
|
||||
int size;
|
||||
|
||||
/* Channel is now open, advertise base set of intents */
|
||||
while (num_intents--) {
|
||||
intent = qcom_glink_alloc_intent(glink, channel, SZ_1K, true);
|
||||
if (!intent)
|
||||
break;
|
||||
if (glink->intentless)
|
||||
return 0;
|
||||
|
||||
qcom_glink_advertise_intent(glink, channel, intent);
|
||||
prop = of_find_property(np, "qcom,intents", NULL);
|
||||
if (prop) {
|
||||
val = prop->value;
|
||||
num_groups = prop->length / sizeof(u32) / 2;
|
||||
}
|
||||
|
||||
/* Channel is now open, advertise base set of intents */
|
||||
while (num_groups--) {
|
||||
size = be32_to_cpup(val++);
|
||||
num_intents = be32_to_cpup(val++);
|
||||
while (num_intents--) {
|
||||
intent = qcom_glink_alloc_intent(glink, channel, size,
|
||||
true);
|
||||
if (!intent)
|
||||
break;
|
||||
|
||||
qcom_glink_advertise_intent(glink, channel, intent);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1237,11 +1257,16 @@ static int __qcom_glink_send(struct glink_channel *channel,
|
|||
spin_lock_irqsave(&channel->intent_lock, flags);
|
||||
idr_for_each_entry(&channel->riids, tmp, iid) {
|
||||
if (tmp->size >= len && !tmp->in_use) {
|
||||
tmp->in_use = true;
|
||||
intent = tmp;
|
||||
break;
|
||||
if (!intent)
|
||||
intent = tmp;
|
||||
else if (intent->size > tmp->size)
|
||||
intent = tmp;
|
||||
if (intent->size == len)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (intent)
|
||||
intent->in_use = true;
|
||||
spin_unlock_irqrestore(&channel->intent_lock, flags);
|
||||
|
||||
/* We found an available intent */
|
||||
|
@ -1551,6 +1576,7 @@ struct qcom_glink *qcom_glink_native_probe(struct device *dev,
|
|||
idr_init(&glink->rcids);
|
||||
|
||||
glink->mbox_client.dev = dev;
|
||||
glink->mbox_client.knows_txdone = true;
|
||||
glink->mbox_chan = mbox_request_channel(&glink->mbox_client, 0);
|
||||
if (IS_ERR(glink->mbox_chan)) {
|
||||
if (PTR_ERR(glink->mbox_chan) != -EPROBE_DEFER)
|
||||
|
@ -1616,3 +1642,6 @@ void qcom_glink_native_unregister(struct qcom_glink *glink)
|
|||
device_unregister(glink->dev);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(qcom_glink_native_unregister);
|
||||
|
||||
MODULE_DESCRIPTION("Qualcomm GLINK driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
|
Loading…
Reference in New Issue