Merge "arm: dts: qcom: add smdpkt node"

tirimbino
qctecmdr 4 years ago committed by Gerrit - the friendly Code Review server
commit 2494982e97
  1. 8
      arch/arm64/boot/dts/qcom/mdm9607.dtsi
  2. 21
      drivers/rpmsg/qcom_smd.c

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -1400,6 +1400,12 @@
qcom,smdpkt-dev-name = "apr_apps2";
};
qcom,smdpkt-data-mdm1 {
qcom,smdpkt-edge = "modem";
qcom,smdpkt-ch-name = "DS";
qcom,smdpkt-dev-name = "at_mdm1";
};
qcom,smdpkt-data1 {
qcom,smdpkt-edge = "modem";
qcom,smdpkt-ch-name = "DATA1";

@ -244,6 +244,7 @@ struct qcom_smd_channel {
void *extended_buf;
void *ext_buf;
int ext_pkt_size;
bool is_pkt_ch;
};
/*
@ -712,6 +713,13 @@ static bool qcom_smd_channel_intr(struct qcom_smd_channel *channel)
for (;;) {
avail = qcom_smd_channel_get_rx_avail(channel);
if (!channel->is_pkt_ch) {
if (avail > 0)
channel->pkt_size = avail;
else
break;
}
if (!channel->pkt_size && avail >= SMD_PACKET_HEADER_LEN) {
qcom_smd_channel_peek(channel, &pktlen, sizeof(pktlen));
qcom_smd_channel_advance(channel, SMD_PACKET_HEADER_LEN);
@ -861,7 +869,7 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
int len, bool wait)
{
__le32 hdr[5] = { cpu_to_le32(len), };
int tlen = sizeof(hdr) + len;
int tlen = (channel->is_pkt_ch) ? sizeof(hdr) + len : len;
unsigned long flags;
int ret;
@ -908,7 +916,9 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
SET_TX_CHANNEL_FLAG(channel, fTAIL, 0);
qcom_smd_write_fifo(channel, hdr, sizeof(hdr));
if (channel->is_pkt_ch)
qcom_smd_write_fifo(channel, hdr, sizeof(hdr));
qcom_smd_write_fifo(channel, data, len);
SET_TX_CHANNEL_FLAG(channel, fHEAD, 1);
@ -1346,7 +1356,8 @@ static void qcom_channel_scan_worker(struct work_struct *work)
if (!entry->name[0])
continue;
if (!(eflags & SMD_CHANNEL_FLAGS_PACKET))
if (!(eflags & SMD_CHANNEL_FLAGS_PACKET) &&
!(eflags & SMD_CHANNEL_FLAGS_STREAM))
continue;
if ((eflags & SMD_CHANNEL_FLAGS_EDGE_MASK) != edge->edge_id)
@ -1360,6 +1371,10 @@ static void qcom_channel_scan_worker(struct work_struct *work)
if (IS_ERR(channel))
continue;
channel->is_pkt_ch =
(eflags & SMD_CHANNEL_FLAGS_PACKET) ? true
: false;
spin_lock_irqsave(&edge->channels_lock, flags);
list_add(&channel->list, &edge->channels);
spin_unlock_irqrestore(&edge->channels_lock, flags);

Loading…
Cancel
Save