1 From 440b01a2a9a62352cfa355354d3a4de6c5d96adf Mon Sep 17 00:00:00 2001
2 From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
3 Date: Fri, 19 May 2023 19:28:03 +0530
4 Subject: [PATCH 06/13] bus: mhi: host: pci_generic: Add support for IP_SW0
7 IP_SW0 channels are used to transfer data over the networking interface
8 between MHI endpoint and the host. Define the channels in the MHI v1
9 channel config along with dedicated event rings.
11 Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
12 Link: https://lore.kernel.org/r/20230519135803.13850-1-manivannan.sadhasivam@linaro.org
13 Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
15 drivers/bus/mhi/host/pci_generic.c | 26 ++++++++++++++++++++++----
16 1 file changed, 22 insertions(+), 4 deletions(-)
18 --- a/drivers/bus/mhi/host/pci_generic.c
19 +++ b/drivers/bus/mhi/host/pci_generic.c
20 @@ -212,6 +212,19 @@ struct mhi_pci_dev_info {
21 .offload_channel = false, \
24 +#define MHI_EVENT_CONFIG_SW_DATA(ev_ring, el_count) \
26 + .num_elements = el_count, \
27 + .irq_moderation_ms = 0, \
28 + .irq = (ev_ring) + 1, \
30 + .mode = MHI_DB_BRST_DISABLE, \
31 + .data_type = MHI_ER_DATA, \
32 + .hardware_event = false, \
33 + .client_managed = false, \
34 + .offload_channel = false, \
37 #define MHI_EVENT_CONFIG_HW_DATA(ev_ring, el_count, ch_num) \
39 .num_elements = el_count, \
40 @@ -237,8 +250,10 @@ static const struct mhi_channel_config m
41 MHI_CHANNEL_CONFIG_DL_AUTOQUEUE(21, "IPCR", 8, 0),
42 MHI_CHANNEL_CONFIG_UL_FP(34, "FIREHOSE", 32, 0),
43 MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0),
44 - MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0", 128, 2),
45 - MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 128, 3),
46 + MHI_CHANNEL_CONFIG_UL(46, "IP_SW0", 64, 2),
47 + MHI_CHANNEL_CONFIG_DL(47, "IP_SW0", 64, 3),
48 + MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0", 128, 4),
49 + MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 128, 5),
52 static struct mhi_event_config modem_qcom_v1_mhi_events[] = {
53 @@ -246,9 +261,12 @@ static struct mhi_event_config modem_qco
54 MHI_EVENT_CONFIG_CTRL(0, 64),
55 /* DIAG dedicated event ring */
56 MHI_EVENT_CONFIG_DATA(1, 128),
57 + /* Software channels dedicated event ring */
58 + MHI_EVENT_CONFIG_SW_DATA(2, 64),
59 + MHI_EVENT_CONFIG_SW_DATA(3, 64),
60 /* Hardware channels request dedicated hardware event rings */
61 - MHI_EVENT_CONFIG_HW_DATA(2, 1024, 100),
62 - MHI_EVENT_CONFIG_HW_DATA(3, 2048, 101)
63 + MHI_EVENT_CONFIG_HW_DATA(4, 1024, 100),
64 + MHI_EVENT_CONFIG_HW_DATA(5, 2048, 101)
67 static const struct mhi_controller_config modem_qcom_v1_mhiv_config = {