From patchwork Wed Jun 5 00:53:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mank X-Patchwork-Id: 801708 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2118.outbound.protection.outlook.com [40.107.236.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4562B4C85; Wed, 5 Jun 2024 00:53:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.118 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717548818; cv=fail; b=BuW17uDviFd2baEn7my6P9IguqtwDrICjtsiq3LrgsxDvjBreDd5QLw/tPC7PhbQsBa0cisfQT0gUKWrQL5NbnfdXyHyrfQAaEkeH2afjCUMr/W0ez9nsSMbHgIhOMppDxYxN1EvOQU3j7pDM7Mv3RoG+0C8amG2n9aVRMFr3wU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717548818; c=relaxed/simple; bh=ff64lV4RyojYVcUrGKWXA9oV0Grf5/iL97paYPB6yQs=; h=Content-Type:From:To:CC:Subject:Date:Message-ID:MIME-Version; b=WVvCPykzWO0ZdW6InR4mAPRd5HC4Cp/zSfTz8QAYrsc2F9te5yO98wu/DpKQRtawQPMA2fSh7zE5rMrwh9OvD6LXOXUuVOqNGZ9WI3bjhG2RN5cWr/vOrbEpnzw5SHOZhPzP3WF2wWJ5+xjBzkoQQD3T1atGj7yOA/n/W7cFgUY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=netprisma.us; spf=pass smtp.mailfrom=netprisma.us; arc=fail smtp.client-ip=40.107.236.118 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=netprisma.us Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netprisma.us ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=moScQF9/VFEmvPTol//Ljqom4B4bN7XAEnwudhemWzGF2k4zWHGCXMrDCXIRN76OQwgSrrd9P9LeUMo18vYAQZoA2ll57xaq5bbJ0bD6tmhy7huqB4xwP6P4KvSJvOZ5BxiP1v9K3UTmq+gioV4GCBVmTcZNkhkez73EGBkoZ86YBPNDzWKS/45C8VSLMzalR5/unu46fEf6fhYdiGKdflIjtyc4MTtSNUzpcFtoorKNcQW10MVs87989gfPIBUco9cT0yBh+PcWc1aoaNbiwlOCdmFo1qFe7j/2WHGm0ePkdRBCzRAdN0JdWlxGpYAS6DhhVtOOIZesfJ/RO2RVCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pn8+yxgqjl37pE6DfiL3cZKzZTc69Oecn1m2xoFE87s=; b=KdCunsyOkiwi59rc3WDVpakdkfX6uqSXJv2leXW1NL/58QZUaQ079hY27ID7bUKbuEEDEeBNrAfCwJj7uPzM26X4abSOIzAh9FeOcJ6g9ic9AboK0qFoQeMJq7hoEAooG5GLsneokv+DXx6/Gele3WjeNsWdg1JqPkgqtrtxK1fc1H1bELK523R8ayQR/1poFO/HZcGTAVc7mWe/J6XIBzPAL/yS7pTrw5rKjyOfpz+vepXuA1E8LMo66PYOV+8Vqh7n4P7V71OD+3oXSpyWgHlC7Jz4ccIKC5jY+vV2bGmdNETekeZj15OiZWdeT1LCSLJqFbavoQSWSueBnn/huA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=netprisma.us; dmarc=pass action=none header.from=netprisma.us; dkim=pass header.d=netprisma.us; arc=none Received: from LV3PR22MB5104.namprd22.prod.outlook.com (2603:10b6:408:1d3::21) by PH7PR22MB3663.namprd22.prod.outlook.com (2603:10b6:510:1d6::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.27; Wed, 5 Jun 2024 00:53:31 +0000 Received: from LV3PR22MB5104.namprd22.prod.outlook.com ([fe80::4b3:b595:d0d2:d5be]) by LV3PR22MB5104.namprd22.prod.outlook.com ([fe80::4b3:b595:d0d2:d5be%5]) with mapi id 15.20.7633.018; Wed, 5 Jun 2024 00:53:31 +0000 From: mank To: "manivannan.sadhasivam@linaro.org" CC: "duke_xinanwen@163.com" , "loic.poulain@linaro.org" , "quic_qianyu@quicinc.com" , "mhi@lists.linux.dev" , "linux-arm-msm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] bus: mhi: host: pci_generic: Add support for Netprisma LCUR57 and FCUN69 Thread-Topic: [PATCH] bus: mhi: host: pci_generic: Add support for Netprisma LCUR57 and FCUN69 Thread-Index: Adq2n7odow5WyoWoQxywju2RPCQiqw== Date: Wed, 5 Jun 2024 00:53:31 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=netprisma.us; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV3PR22MB5104:EE_|PH7PR22MB3663:EE_ x-ms-office365-filtering-correlation-id: 395dcc1c-e4e0-40bf-7159-08dc84f9eba7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|366007|1800799015|376005|38070700009|80162012; x-microsoft-antispam-message-info: 5Z6b1mcoZ9W8RptxacrFhHTBnLPwegqCGIIriF//1zw0F3Bi9kT0irjoSQTlYFHFnGdzaiCAZDvFbGKtsrQBvhlZis6Ri9XxMdts1S9VEItbnLV1g0eqPZaj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G1kUmr5AG+jEhqIF4lBsMzg44BmG5w3hXnR28ByJCatJaB6vjZG6XdcIcF/c2bjWTnOK/cmfP1ynlzfc8jQZKPeVa9XVSgI09by/fNqD08GbKph+PDbacQp+WXOajggZIMM/wFnYISO7CG8mcjvIvvd3CA91yA/7QZjm8jsGiQnhICz1bZM2QtE5ziCCJ7qaJIN214veZz7bXNeo+SH+ewWLbnLEXguXDBP/qbsi5ufLw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:LV3PR22MB5104.namprd22.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(1800799015)(376005)(38070700009)(80162012); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: sbh+Z1MvZGhJYCgh6OyDPdl6kyKO7kriMG9KgVnV4GKObMb/NneyuzmAIXJCYKqiIBMSP9ZdmUBiJ83Iud+zbbtu+07myDgngrJu+VjZnoYCcvi/tiV4tRcw1vFBxdaRlHYqx2YMNLs3/MxEc08yups+XElkAk8vBEupAGu4lD1Hu9V1Or7HYsSSX4m6PMhMykzsRP5ASl3ex9AludFbo70QV1LZOQlRb+B7NU5NdxYDvpCLtxmZTo9ZdAGTkcQuR9CmBM8lU0wrMVqa6uTlH1JPiO7PDP2D3d/ZBATXFn1Gqw+RFbVvARpCvLJuhoeyFfK7/I73R8GJ69sdjUIUiKmYsx2j2nGTXX0vIsPw7zPS0Tguuz3S64pMB2KwgyFiF6cEz8rSQ35DcnxomIiZQ1nqpZWwyVepseQSj66Rh3fjGdd+Ki+7uKYCZuqeDKhe/zCE4RNO3AWatm1syncagbMLpB4PCrzbdyVNoZjtcRENC2OgHpgmUpv+wVS0NEVZHQXTRzUiQdQZZz3lCYzF2fwYdRgdkheswvnPH3Y5qtGsnZjDs6/ANWeiUYH1bfA3A+0kedrUBTwPfMdjd7xHU9ojMIL95UGI+MC57gpuErQD1CvIUSJ38//mlfL3SKtlMg8uk6cAVTONEZtQN4/lCGCpg2JeZ6RDBsfdmLzy41cv06yxn5WqzYiArVKTG7rsWCiKgOUoc4yNEAUXn0eNONvrtp3PO1WXEhRlJcCcPMPWksDO/mSRySuxJ6QRdqRfjoD8c/7uSUXi4mhUXSD7W5IN1+wK9rjZleDGpD27HvtVf4tHmbLf+rrwEn4ePb/ZdHEWmaCkBAI+52uHXAbvx8CiiAYzMV3TBDGYwpGLmEdXU7EkeX8ECIMCzLMvw4Efxoi/Q1UsEovU8N47okCNx/AFKa6nLxxoZlsFbZHk03kn/0ZeMEqOMoUbkfRbEAllF8/yeB/x+Fw829eqTdtXWcxM4KEs33GvsjBh/wBgYQMBIXBHhADclOTecQdVg75E2PvNb3KOAlZdHSieB3Du5ALhd8ANkDSZCFitVvWinCFsIibg/niKNeWsQSBVLlMi880+P2X7gUI520v4Rwreit7VxjHpTaeQmGBP9C41YCQE4fvGk1PsKoB48ja3hB3qtrjwDOpPuMXWjkv1+BabQL2TgESxWuXc2iE9zY13q28BFGBXxZB1ieRMrE/VnqPfrBIyyr079nClxmY1oH205aBZGL2Dg51dpmY7WdWNZ83TKnROXEDtJqGoweRgr0CyMM/mYvWW6NXj/c8MXWFnJPwLybAaxVK7+B/csOlwaNvociwWRJjm6PtCTPZG3dPl9ArpeogyuEwTKokvchGX6aEIfraaLT/h+5RaTYLkDPOQpJgpc7oUt2ZgRdFU95unxAy4Wx/3Jt9vnm9WevcxROUvg+MdSInKeS0aDAOi3mLX8mEZ26FQ9I7dpVcLScgwMm5tRXPy6XovqJjGafzFx/KGBXfbyomS3R4ONK2VlKteBdqhy0JtA9V5NQnbaquojxV8WsTOc6Yj6KgMFwH0mXzSYtPyLf44An+rPLFyRWw= Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: netprisma.us X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV3PR22MB5104.namprd22.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 395dcc1c-e4e0-40bf-7159-08dc84f9eba7 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jun 2024 00:53:31.4502 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fdc90941-0026-4225-aaa0-15fff5e87036 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Wl5zvUF8MGpXCw8lEV5u4tUGryTyre05dLQb3K/eEdkMvWBGceP0dbWUfiBmSz/c+Py0InvnDoMRhXKOrF93gw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR22MB3663 Add Netprisma LCUR57 and FCUN69 hardware revision: LCUR57: 02:00.0 Unassigned class [ff00]: Device 203e:1000 Subsystem: Device 203e:1000 FCUN69: 02:00.0 Unassigned class [ff00]: Device 203e:1001 Subsystem: Device 203e:1001 Signed-off-by: Mank Wang --- drivers/bus/mhi/host/pci_generic.c | 61 ++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c index 08844ee79654..e2b88699ce9e 100644 --- a/drivers/bus/mhi/host/pci_generic.c +++ b/drivers/bus/mhi/host/pci_generic.c @@ -26,6 +26,7 @@ /* PCI VID definitions */ #define PCI_VENDOR_ID_THALES 0x1269 #define PCI_VENDOR_ID_QUECTEL 0x1eac +#define PCI_VENDOR_ID_NETPRISMA 0x203E #define MHI_EDL_DB 91 #define MHI_EDL_COOKIE 0xEDEDEDED @@ -606,6 +607,60 @@ static const struct mhi_pci_dev_info mhi_telit_fn990_info = { .mru_default = 32768, }; +static const struct mhi_channel_config mhi_netprisma_lcur57_channels[] = { + MHI_CHANNEL_CONFIG_UL(0, "NMEA", 32, 0), + MHI_CHANNEL_CONFIG_DL(1, "NMEA", 32, 0), + MHI_CHANNEL_CONFIG_UL_SBL(2, "SAHARA", 32, 0), + MHI_CHANNEL_CONFIG_DL_SBL(3, "SAHARA", 32, 0), + MHI_CHANNEL_CONFIG_UL(4, "DIAG", 32, 1), + MHI_CHANNEL_CONFIG_DL(5, "DIAG", 32, 1), + MHI_CHANNEL_CONFIG_UL(12, "MBIM", 32, 0), + MHI_CHANNEL_CONFIG_DL(13, "MBIM", 32, 0), + MHI_CHANNEL_CONFIG_UL(32, "DUN", 32, 0), + MHI_CHANNEL_CONFIG_DL(33, "DUN", 32, 0), + MHI_CHANNEL_CONFIG_UL_FP(34, "FIREHOSE", 32, 0), + MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0), + MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0_MBIM", 128, 2), + MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3), +}; + +static struct mhi_event_config mhi_netprisma_lcur57_events[] = { + MHI_EVENT_CONFIG_CTRL(0, 128), + MHI_EVENT_CONFIG_DATA(1, 128), + MHI_EVENT_CONFIG_HW_DATA(2, 1024, 100), + MHI_EVENT_CONFIG_HW_DATA(3, 1024, 101) +}; + +static const struct mhi_controller_config modem_netprisma_lcur57_config = { + .max_channels = 128, + .timeout_ms = 20000, + .num_channels = ARRAY_SIZE(mhi_netprisma_lcur57_channels), + .ch_cfg = mhi_netprisma_lcur57_channels, + .num_events = ARRAY_SIZE(mhi_netprisma_lcur57_events), + .event_cfg = mhi_netprisma_lcur57_events, +}; + +static const struct mhi_pci_dev_info mhi_netprisma_lcur57_info = { + .name = "netprisma-lcur57", + .edl = "qcom/prog_firehose_sdx24.mbn", + .config = &modem_netprisma_lcur57_config, + .bar_num = MHI_PCI_DEFAULT_BAR_NUM, + .dma_data_width = 32, + .mru_default = 32768, + .sideband_wake = true, +}; + +static const struct mhi_pci_dev_info mhi_netprisma_fcun69_info = { + .name = "netprisma-fcun69", + .edl = "qcom/prog_firehose_sdx6x.elf", + /* FCUN69 uses the same controller configuration as LCUR57 */ + .config = &modem_netprisma_lcur57_config, + .bar_num = MHI_PCI_DEFAULT_BAR_NUM, + .dma_data_width = 32, + .mru_default = 32768, + .sideband_wake = true, +}; + /* Keep the list sorted based on the PID. New VID should be added as the last entry */ static const struct pci_device_id mhi_pci_id_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0304), @@ -695,6 +750,12 @@ static const struct pci_device_id mhi_pci_id_table[] = { /* T99W175 (sdx55), HP variant */ { PCI_DEVICE(0x03f0, 0x0a6c), .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info }, + /* NETPRISMA LCUR57 (SDX24) */ + { PCI_DEVICE(PCI_VENDOR_ID_NETPRISMA, 0x1000), + .driver_data = (kernel_ulong_t) &mhi_netprisma_lcur57_info }, + /* NETPRISMA FCUN69 (SDX6X) */ + { PCI_DEVICE(PCI_VENDOR_ID_NETPRISMA, 0x1001), + .driver_data = (kernel_ulong_t) &mhi_netprisma_fcun69_info }, { } }; MODULE_DEVICE_TABLE(pci, mhi_pci_id_table);