Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp4882505pxb; Wed, 20 Apr 2022 12:08:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyK3zXelLtHhjLS7KVvfGBuBpqUJNRdS6l7RvRXTcggs6V2cxt7ydaZXTt4TgjhUEOz6OGw X-Received: by 2002:a17:902:a981:b0:156:229d:6834 with SMTP id bh1-20020a170902a98100b00156229d6834mr21352129plb.128.1650481727844; Wed, 20 Apr 2022 12:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650481727; cv=none; d=google.com; s=arc-20160816; b=n0NEAmFrM7RoR/IgmgJB0M2/WBauC3D0Xqp7UYfKxy5t+ALPP587YJ7oOQDIaHHOzx 3i3jJPhRmcWhwdLlGCSyp/1+vmyHt0FHLgR57LLLA4zoxr101IZ/Bn8AeUjtBC3tjQwx 75RiXVPmaCNy0dzE8hAiQXRGIFc1R5o6zL+y+e9FUB48/bEhTZFt+SZYq38a0LeqmUI/ Zg6AO1MKwcRXK+vfsZvJNHjp0a0TSNcNTB0A5xpNcHvbLwTWkkeH6dvwJ+gpzwM5rMq3 UtQ81Fs/e2zoYvKlvNa4MeNMywSiHr9QlX2DzXQ1nNCvRCCpmb1kxfWsPvkdh9WWjIaC e2TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7ut0QD0SeAhwHJ2wa4JZOw2v3iSr/i3NVuFHELZO3Hs=; b=XlEafnc2GmHydgJkLmpFXu3f72ZEmuf7bSHXeVlvebF89GJHSu95ezxihodGEe9qyB TRjFKkyatRXzjjsh1UGpWu04UijBNuhGjosf1XAqO6vG3OyZU6FlFrdkRZn8XR4H9OrR QfgKvdHeis+PrxjJCn3xIoQeN7m8fhJLyAnQqS7ZhysSI6cSK5o7xiTlm4027dNRFfwC AnqFiE6TxpTc4bQVIetJRaPGIm58pHgWPTElZH/6XJt+ohPp7N+7EofSPr3zxxNRrdte IN4jxD2jcnG8+o+sPb5KuYP/qe7GF5LFcylBe4YSkR22ER++xmjuC9wHGJhrsXp+6pcX Wzcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=iaitjDKG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h4-20020a636c04000000b003816043f11csi3121141pgc.785.2022.04.20.12.08.24; Wed, 20 Apr 2022 12:08:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=iaitjDKG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377813AbiDTKsU (ORCPT + 99 others); Wed, 20 Apr 2022 06:48:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378096AbiDTKsM (ORCPT ); Wed, 20 Apr 2022 06:48:12 -0400 X-Greylist: delayed 966 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 20 Apr 2022 03:45:19 PDT Received: from mail-m974.mail.163.com (mail-m974.mail.163.com [123.126.97.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1117313F66; Wed, 20 Apr 2022 03:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=7ut0Q D0SeAhwHJ2wa4JZOw2v3iSr/i3NVuFHELZO3Hs=; b=iaitjDKGmArIa/RPsuIEE uEdtSERqqRtURhqUx7BHXlYyE0/CAP0PZ3lIF2Min+CujtsfLf9GLnqFDtArgVWa 8eU9niGT+Dqr8RGBQ4uQK/Lg2k+mMzVFJs+TmUIim1CjoJV5TpOTYCqEOpkvpWS1 mg+3vZYGicnICipA0AZcxY= Received: from localhost.localdomain (unknown [112.97.59.179]) by smtp4 (Coremail) with SMTP id HNxpCgDX9AlY4F9i69iSAA--.8118S2; Wed, 20 Apr 2022 18:28:42 +0800 (CST) From: Slark Xiao To: mani@kernel.org, quic_hemantk@quicinc.com Cc: gregkh@linuxfoundation.org, loic.poulain@linaro.org, slark_xiao@163.com, bbhatt@codeaurora.org, christophe.jaillet@wanadoo.fr, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] bus: mhi: host: Add support for Cinterion MV32-WA/MV32-WB Date: Wed, 20 Apr 2022 18:28:11 +0800 Message-Id: <20220420102811.3157-1-slark_xiao@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: HNxpCgDX9AlY4F9i69iSAA--.8118S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxGw48JF17ArW8KFyktr4xJFb_yoW5GFWDpF WIvrWYyF4vqayaqanay34qgF98Cw4kG343KrnrKw12ywn0y34kZFykK343tFyYvw4vqrs3 tr1vqrW3uF4Dt3JanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zioGQfUUUUU= X-Originating-IP: [112.97.59.179] X-CM-SenderInfo: xvod2y5b0lt0i6rwjhhfrp/xtbCdRPoZGBbCtHDJAAAst X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org MV32-WA is designed based on Qualcomm SDX62, and MV32-WB is designed based on QUalcomm SDX65. Both products' enumeration would align with previous product MV31-W. Add some new items for mv32 to separate it from mv31-w, in case we need to do any changes in future. Signed-off-by: Slark Xiao --- drivers/bus/mhi/host/pci_generic.c | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c index 541ced27d941..a2da40340df7 100644 --- a/drivers/bus/mhi/host/pci_generic.c +++ b/drivers/bus/mhi/host/pci_generic.c @@ -406,6 +406,41 @@ static const struct mhi_pci_dev_info mhi_mv31_info = { .mru_default = 32768, }; +static const struct mhi_channel_config mhi_mv32_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_mv32_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_mv32_config = { + .max_channels = 128, + .timeout_ms = 20000, + .num_channels = ARRAY_SIZE(mhi_mv32_channels), + .ch_cfg = mhi_mv32_channels, + .num_events = ARRAY_SIZE(mhi_mv32_events), + .event_cfg = mhi_mv32_events, +}; + +static const struct mhi_pci_dev_info mhi_mv32_info = { + .name = "cinterion-mv32", + .config = &modem_mv32_config, + .bar_num = MHI_PCI_DEFAULT_BAR_NUM, + .dma_data_width = 32, + .mru_default = 32768, +}; + 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), @@ -475,6 +510,12 @@ static const struct pci_device_id mhi_pci_id_table[] = { /* MV31-W (Cinterion) */ { PCI_DEVICE(0x1269, 0x00b3), .driver_data = (kernel_ulong_t) &mhi_mv31_info }, + /* MV32-WA (Cinterion) */ + { PCI_DEVICE(0x1269, 0x00ba), + .driver_data = (kernel_ulong_t) &mhi_mv32_info }, + /* MV32-WB (Cinterion) */ + { PCI_DEVICE(0x1269, 0x00bb), + .driver_data = (kernel_ulong_t) &mhi_mv32_info }, { } }; MODULE_DEVICE_TABLE(pci, mhi_pci_id_table); -- 2.25.1