Skip to content
Permalink
Browse files
bus: mhi: core: Enable unique QRTR node ID support
On multi-mhi platforms, host WiFi driver and
QMI test driver needs to differntiate between
QMI packets received from multiple mhi devices.

With QCN9000 PCI cards, once SBL gets loaded, we
utilize ERRDBG2 register to write a unique value
per mhi device from device-tree that the device
utilizes to set a unique QRTR node ID and
instance ID for the QMI service. This helps QRTR
stack in differenting the packets in a multi-mhi
environment and can route them accordingly.

sample:
root@OpenWrt:/# qrtr-lookup
  Service Version Instance Node  Port
       69       1       40   40     2 ATH10k WLAN firmware service
       15       1        0   40     1 Test service
       69       1       39   39     2 ATH10k WLAN firmware service
       15       1        0   39     1 Test service

Here on column 4, 39 and 40 are the node IDs that
is unique per mhi device.

Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
  • Loading branch information
Gokul Sriram Palanisamy authored and intel-lab-lkp committed Oct 16, 2020
1 parent 9ff9b0d commit 7a9b56e151211022c138dff2099281fa12103f00
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
@@ -0,0 +1,36 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)

%YAML 1.2
---
$id: "http://devicetree.org/schemas/pci/qcom,pcie.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: Qualcomm Modem Host Interface

maintainers:
- Gokul Sriram Palanisamy <gokulsri@codeaurora.org>

properties:
qrtr-instance-id:
const: 32

required:
- reg
- qrtr-instance-id

examples:
- |
pcie: pci@10000000 {
compatible = "qcom,pcie-qcs404";
status = "ok";
perst-gpio = <&tlmm 58 0x1>;
pcie0_rp: pcie0_rp {
reg = <0 0 0 0 0>;
status = "ok";
mhi_0: qcom,mhi@0 {
reg = <0 0 0 0 0 >;
qrtr_instance_id = <0x20>;
};
};
};
@@ -18,6 +18,9 @@
#include <linux/wait.h>
#include "internal.h"

#define QRTR_INSTANCE_MASK 0x0000FFFF
#define QRTR_INSTANCE_SHIFT 0

/* Setup RDDM vector table for RDDM transfer and program RXVEC */
void mhi_rddm_prepare(struct mhi_controller *mhi_cntrl,
struct image_info *img_info)
@@ -460,6 +463,17 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl)
return;
}

if (!ret && mhi_cntrl->cntrl_dev->of_node) {
ret = of_property_read_u32(mhi_cntrl->cntrl_dev->of_node,
"qrtr-instance-id", &instance);
if (!ret) {
instance &= QRTR_INSTANCE_MASK;
mhi_write_reg_field(mhi_cntrl, mhi_cntrl->bhi,
BHI_ERRDBG2, QRTR_INSTANCE_MASK,
QRTR_INSTANCE_SHIFT, instance);
}
}

if (mhi_cntrl->ee == MHI_EE_EDL)
return;

0 comments on commit 7a9b56e

Please sign in to comment.