Hi,
I’m trying to use the EM919x connected to a i.MX6DualLite through the PCIe gen2 bus, but for the moment without success, could you help me ?
I’m following two approaches:
- Use the Sierra driver R21 with on the kernel 5.4
- Use the upstream MHI driver on the kernel 5.13
QMI and MBIM are exposed but:
-
With the Sierra driver R21, I tried to use commands described in readme to manage the modem using MBIM, without success, commands sent with mbimcli are deposed in the MHI channel, but they seem never consumed by the modem. In addition, the QMI interface doesn’t seem to work at all:
[/dev/mhi_0306_00.01.00_pipe_14] couldn't detect transport type of port: unexpected port subsystem.
-
With the upstream MHI driver, I manage to establish communication through the QMI and the MBIM channels but it’s really random: sometimes the requests succeed, other times it ends in timeout or receives an unexpected response…
Moreover MBIM channels seem only accessible after trying to send a QMI request, and AT commands seem to work correctly.
Moreover, in both approaches, I use the same user space stack:
- NetworkManager 1.32.4
- ModemManager 1.18.0
- libqmi 1.30.2
- libmbim 1.26.0
In addition, my EM919x seems to be an engineering sample, because the SVID and the SDID are incorrect:
cat /sys/bus/pci/drivers/mhi-pci-generic/0000\:01\:00.0/vendor
0x17cb
cat /sys/bus/pci/drivers/mhi-pci-generic/0000\:01\:00.0/subsystem_vendor
0x17cb
cat /sys/bus/pci/drivers/mhi-pci-generic/0000\:01\:00.0/subsystem_device
0x010c
cat /sys/bus/pci/drivers/mhi-pci-generic/0000\:01\:00.0/device
0x0306
And the firmware revision is “SWIX55C_00.16.04.00 000000 jenkins 2020/06/02 04:19:42"”. Then I also tried to use the revision “00.16.04.00_Generi_010.003_000”.
1. The Sierra driver R21 approach
To use the Sierra driver R21, I fixed few issues, in order to be able to compile and load the modules correctly:
- Allowed the cross-compilation,
- Allowed to use only one MSI vector,
- Prevent PCIe low power mode.
Because PCIe low power mode is not supported on our platform and it isn’t able to assign eight MSI vectors.
I also identified a possible deadlock:
[ 193.428213] *** DEADLOCK ***
[ 193.434138] 1 lock held by mbim-proxy/682:
[ 193.438238] #0: bf092340 (&mhi_uci_drv.lock){+.+.}, at: mhi_uci_open+0x28/0x4b4 [mhiuci]
2. The upstream MHI driver approach
I added a MHI channel mapping for the EM919x in the mhi/pci_generic driver :
+static const struct mhi_channel_config mhi_sierra_em919x_channels[] = {
+ MHI_CHANNEL_CONFIG_UL_SBL(2, "SAHARA", 32, 0),
+ MHI_CHANNEL_CONFIG_DL_SBL(3, "SAHARA", 256, 0),
+ MHI_CHANNEL_CONFIG_UL(4, "DIAG", 32, 0),
+ MHI_CHANNEL_CONFIG_DL(5, "DIAG", 32, 0),
+ MHI_CHANNEL_CONFIG_UL(12, "MBIM", 128, 0),
+ MHI_CHANNEL_CONFIG_DL(13, "MBIM", 128, 0),
+ MHI_CHANNEL_CONFIG_UL(14, "QMI", 32, 0),
+ MHI_CHANNEL_CONFIG_DL(15, "QMI", 32, 0),
+ MHI_CHANNEL_CONFIG_UL(32, "DUN", 32, 0),
+ MHI_CHANNEL_CONFIG_DL(33, "DUN", 32, 0),
+ MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0", 512, 1),
+ MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 512, 2),
+};
+
+static struct mhi_event_config modem_sierra_em919x_mhi_events[] = {
+ /* first ring is control+data and DIAG ring */
+ MHI_EVENT_CONFIG_CTRL(0, 2048),
+ /* Hardware channels request dedicated hardware event rings */
+ MHI_EVENT_CONFIG_HW_DATA(1, 2048, 100),
+ MHI_EVENT_CONFIG_HW_DATA(2, 2048, 101)
+};
+
+static const struct mhi_controller_config modem_sierra_em919x_config = {
+ .max_channels = 128,
+ .timeout_ms = 24000,
+ .num_channels = ARRAY_SIZE(mhi_sierra_em919x_channels),
+ .ch_cfg = mhi_sierra_em919x_channels,
+ .num_events = ARRAY_SIZE(modem_sierra_em919x_mhi_events),
+ .event_cfg = modem_sierra_em919x_mhi_events,
+};
+
+static const struct mhi_pci_dev_info mhi_sierra_em919x_info = {
+ .name = "sierra-em919x",
+ .config = &modem_sierra_em919x_config,
+ .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
+ .dma_data_width = 32,
+ .sideband_wake = true,
+};
+
static const struct mhi_channel_config mhi_quectel_em1xx_channels[] = {
MHI_CHANNEL_CONFIG_UL(0, "NMEA", 32, 0),
MHI_CHANNEL_CONFIG_DL(1, "NMEA", 32, 0),
@@ -377,6 +417,9 @@ static const struct pci_device_id mhi_pci_id_table[] = {
.driver_data = (kernel_ulong_t) &mhi_quectel_em1xx_info },
{ PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0308),
.driver_data = (kernel_ulong_t) &mhi_qcom_sdx65_info },
+ /* EM919x (sdx55), Both for eSIM and Non-eSIM */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0306, 0x18d7, 0x0200),
+ .driver_data = (kernel_ulong_t) &mhi_sierra_em919x_info },
/* T99W175 (sdx55), Both for eSIM and Non-eSIM */
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0ab),
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info },