bus: mhi: pci_generic: Add Cinterion MV31-W PCIe to MHI
authorULRICH Thomas <thomas.ulrich@thalesgroup.com>
Mon, 2 Aug 2021 05:12:47 +0000 (10:42 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Aug 2021 12:28:47 +0000 (14:28 +0200)
This patch adds VendorID/ProductID and MBIM Channel Definitions for
M.2 Modem Card (PCIe Variant) to MHI PCI generic controller driver.

Cinterion MV31-W (by Thales)
Additional information on such Modem Card (USB or PCIe variant) is
available at:
https://www.thalesgroup.com/en/markets/digital-identity-and-security/iot/iot-connectivity/products/iot-products/mv31-w-ultra-high

Link: https://lore.kernel.org/r/PAZP264MB284690134DA010698E6B3BDDE60A9@PAZP264MB2846.FRAP264.PROD.OUTLOOK.COM
[mani: fixed the subject, whitespace, and added sideband_wake field]
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: ULRICH Thomas <thomas.ulrich@thalesgroup.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20210802051255.5771-3-manivannan.sadhasivam@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bus/mhi/pci_generic.c

index 4dd1077..5872c42 100644 (file)
@@ -366,6 +366,40 @@ static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = {
        .sideband_wake = false,
 };
 
+static const struct mhi_channel_config mhi_mv31_channels[] = {
+       MHI_CHANNEL_CONFIG_UL(0, "LOOPBACK", 64, 0),
+       MHI_CHANNEL_CONFIG_DL(1, "LOOPBACK", 64, 0),
+       /* MBIM Control Channel */
+       MHI_CHANNEL_CONFIG_UL(12, "MBIM", 64, 0),
+       MHI_CHANNEL_CONFIG_DL(13, "MBIM", 64, 0),
+       /* MBIM Data Channel */
+       MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0_MBIM", 512, 2),
+       MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 512, 3),
+};
+
+static struct mhi_event_config mhi_mv31_events[] = {
+       MHI_EVENT_CONFIG_CTRL(0, 256),
+       MHI_EVENT_CONFIG_DATA(1, 256),
+       MHI_EVENT_CONFIG_HW_DATA(2, 1024, 100),
+       MHI_EVENT_CONFIG_HW_DATA(3, 1024, 101),
+};
+
+static const struct mhi_controller_config modem_mv31_config = {
+       .max_channels = 128,
+       .timeout_ms = 20000,
+       .num_channels = ARRAY_SIZE(mhi_mv31_channels),
+       .ch_cfg = mhi_mv31_channels,
+       .num_events = ARRAY_SIZE(mhi_mv31_events),
+       .event_cfg = mhi_mv31_events,
+};
+
+static const struct mhi_pci_dev_info mhi_mv31_info = {
+       .name = "cinterion-mv31",
+       .config = &modem_mv31_config,
+       .bar_num = MHI_PCI_DEFAULT_BAR_NUM,
+       .dma_data_width = 32,
+};
+
 static const struct pci_device_id mhi_pci_id_table[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0306),
                .driver_data = (kernel_ulong_t) &mhi_qcom_sdx55_info },
@@ -386,6 +420,9 @@ static const struct pci_device_id mhi_pci_id_table[] = {
        /* DW5930e (sdx55), Non-eSIM, It's also T99W175 */
        { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0b1),
                .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info },
+       /* MV31-W (Cinterion) */
+       { PCI_DEVICE(0x1269, 0x00b3),
+               .driver_data = (kernel_ulong_t) &mhi_mv31_info },
        {  }
 };
 MODULE_DEVICE_TABLE(pci, mhi_pci_id_table);