0001 .. SPDX-License-Identifier: GPL-2.0
0002
0003 ============
0004 MHI Topology
0005 ============
0006
0007 This document provides information about the MHI topology modeling and
0008 representation in the kernel.
0009
0010 MHI Controller
0011 --------------
0012
0013 MHI controller driver manages the interaction with the MHI client devices
0014 such as the external modems and WiFi chipsets. It is also the MHI bus master
0015 which is in charge of managing the physical link between the host and device.
0016 It is however not involved in the actual data transfer as the data transfer
0017 is taken care by the physical bus such as PCIe. Each controller driver exposes
0018 channels and events based on the client device type.
0019
0020 Below are the roles of the MHI controller driver:
0021
0022 * Turns on the physical bus and establishes the link to the device
0023 * Configures IRQs, IOMMU, and IOMEM
0024 * Allocates struct mhi_controller and registers with the MHI bus framework
0025 with channel and event configurations using mhi_register_controller.
0026 * Initiates power on and shutdown sequence
0027 * Initiates suspend and resume power management operations of the device.
0028
0029 MHI Device
0030 ----------
0031
0032 MHI device is the logical device which binds to a maximum of two MHI channels
0033 for bi-directional communication. Once MHI is in powered on state, the MHI
0034 core will create MHI devices based on the channel configuration exposed
0035 by the controller. There can be a single MHI device for each channel or for a
0036 couple of channels.
0037
0038 Each supported device is enumerated in::
0039
0040 /sys/bus/mhi/devices/
0041
0042 MHI Driver
0043 ----------
0044
0045 MHI driver is the client driver which binds to one or more MHI devices. The MHI
0046 driver sends and receives the upper-layer protocol packets like IP packets,
0047 modem control messages, and diagnostics messages over MHI. The MHI core will
0048 bind the MHI devices to the MHI driver.
0049
0050 Each supported driver is enumerated in::
0051
0052 /sys/bus/mhi/drivers/
0053
0054 Below are the roles of the MHI driver:
0055
0056 * Registers the driver with the MHI bus framework using mhi_driver_register.
0057 * Prepares the device for transfer by calling mhi_prepare_for_transfer.
0058 * Initiates data transfer by calling mhi_queue_transfer.
0059 * Once the data transfer is finished, calls mhi_unprepare_from_transfer to
0060 end data transfer.