← Documents Documentation/networking/device_drivers/wwan/t7xx.rst GitHub 원문 ↗

Linux 6.18.37 · Networking

t7xx Driver for MediaTek T700 5G Modem

MediaTek T700 5G PCIe modem용 t7xx 드라이버의 MBIM·AT·fastboot·ADB·MIPC port, sysfs mode와 debug 제어, data link ABI를 설명합니다.

Source pathDocumentation/networking/device_drivers/wwan/t7xx.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

t7xx.rst:1-214

t7xx는 MBIM data 통신에 더해 AT, fastboot, ADB, MIPC용 character device를 분리해 제공합니다. `t7xx_mode`와 `t7xx_debug_ports`로 device mode와 debug port를 제어하며, fastboot 전환 뒤에는 cold reset과 driver reload가 필요합니다.

t7xx 관리 surface
범주interface
MBIM control`/dev/wwan0mbim0`
MBIM data`wwan0-X`
Command`/dev/wwan0at0`
Maintenance`/dev/wwan0fastboot0`, `wwan0adb0`, `wwan0mipc0`

정상 데이터 통신과 유지보수·진단 경로를 구분합니다.

t7xx fastboot 전환
`fastboot_switching` 설정device cold resett7xx driver reload`/dev/wwan0fastboot0` 사용

fastboot port를 노출하려면 mode 전환 뒤 cold reset이 필요합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0-only
2
3 .. Copyright (C) 2020-21 Intel Corporation
4
5 .. _t7xx_driver_doc:
6
7 ============================================
8 t7xx driver for MTK PCIe based T700 5G modem
9 ============================================
10 The t7xx driver is a WWAN PCIe host driver developed for linux or Chrome OS
11 platforms for data exchange over PCIe interface between Host platform &
12 MediaTek's T700 5G modem.
13 The driver exposes an interface conforming to the MBIM protocol [1]. Any front
14 end application (e.g. Modem Manager) could easily manage the MBIM interface to
15 enable data communication towards WWAN. The driver also provides an interface
16 to interact with the MediaTek's modem via AT commands.
17
18 Basic usage
19 ===========
20 MBIM & AT functions are inactive when unmanaged. The t7xx driver provides
21 WWAN port userspace interfaces representing MBIM & AT control channels and does
22 not play any role in managing their functionality. It is the job of a userspace
23 application to detect port enumeration and enable MBIM & AT functionalities.
24
25 Examples of few such userspace applications are:
26
27 - mbimcli (included with the libmbim [2] library), and
28 - Modem Manager [3]
29
30 Management Applications to carry out below required actions for establishing
31 MBIM IP session:
32
33 - open the MBIM control channel
34 - configure network connection settings
35 - connect to network
36 - configure IP network interface
37
38 Management Applications to carry out below required actions for send an AT
39 command and receive response:
40
41 - open the AT control channel using a UART tool or a special user tool
42
43 Sysfs
44 =====
45 The driver provides sysfs interfaces to userspace.
46
47 t7xx_mode
48 ---------
49 The sysfs interface provides userspace with access to the device mode, this
50 interface supports read and write operations.
51
52 Device mode:
53
54 - ``unknown`` represents that device in unknown status
55 - ``ready`` represents that device in ready status
56 - ``reset`` represents that device in reset status
57 - ``fastboot_switching`` represents that device in fastboot switching status
58 - ``fastboot_download`` represents that device in fastboot download status
59 - ``fastboot_dump`` represents that device in fastboot dump status
60
61 Read from userspace to get the current device mode.
62
63 ::
64 $ cat /sys/bus/pci/devices/${bdf}/t7xx_mode
65
66 Write from userspace to set the device mode.
67
68 ::
69 $ echo fastboot_switching > /sys/bus/pci/devices/${bdf}/t7xx_mode
70
71 t7xx_debug_ports
72 ----------------
73 The sysfs interface provides userspace with access to enable/disable the debug
74 ports, this interface supports read and write operations.
75
76 Debug port status:
77
78 - ``1`` represents enable debug ports
79 - ``0`` represents disable debug ports
80
81 Currently supported debug ports (ADB/MIPC).
82
83 Read from userspace to get the current debug ports status.
84
85 ::
86 $ cat /sys/bus/pci/devices/${bdf}/t7xx_debug_ports
87
88 Write from userspace to set the debug ports status.
89
90 ::
91 $ echo 1 > /sys/bus/pci/devices/${bdf}/t7xx_debug_ports
92
93 Management application development
94 ==================================
95 The driver and userspace interfaces are described below. The MBIM protocol is
96 described in [1] Mobile Broadband Interface Model v1.0 Errata-1.
97
98 MBIM control channel userspace ABI
99 ----------------------------------
100
101 /dev/wwan0mbim0 character device
102 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103 The driver exposes an MBIM interface to the MBIM function by implementing
104 MBIM WWAN Port. The userspace end of the control channel pipe is a
105 /dev/wwan0mbim0 character device. Application shall use this interface for
106 MBIM protocol communication.
107
108 Fragmentation
109 ~~~~~~~~~~~~~
110 The userspace application is responsible for all control message fragmentation
111 and defragmentation as per MBIM specification.
112
113 /dev/wwan0mbim0 write()
114 ~~~~~~~~~~~~~~~~~~~~~~~
115 The MBIM control messages from the management application must not exceed the
116 negotiated control message size.
117
118 /dev/wwan0mbim0 read()
119 ~~~~~~~~~~~~~~~~~~~~~~
120 The management application must accept control messages of up the negotiated
121 control message size.
122
123 MBIM data channel userspace ABI
124 -------------------------------
125
126 wwan0-X network device
127 ~~~~~~~~~~~~~~~~~~~~~~
128 The t7xx driver exposes IP link interface "wwan0-X" of type "wwan" for IP
129 traffic. Iproute network utility is used for creating "wwan0-X" network
130 interface and for associating it with MBIM IP session.
131
132 The userspace management application is responsible for creating new IP link
133 prior to establishing MBIM IP session where the SessionId is greater than 0.
134
135 For example, creating new IP link for a MBIM IP session with SessionId 1:
136
137 ip link add dev wwan0-1 parentdev wwan0 type wwan linkid 1
138
139 The driver will automatically map the "wwan0-1" network device to MBIM IP
140 session 1.
141
142 AT port userspace ABI
143 ----------------------------------
144
145 /dev/wwan0at0 character device
146 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
147 The driver exposes an AT port by implementing AT WWAN Port.
148 The userspace end of the control port is a /dev/wwan0at0 character
149 device. Application shall use this interface to issue AT commands.
150
151 fastboot port userspace ABI
152 ---------------------------
153
154 /dev/wwan0fastboot0 character device
155 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156 The driver exposes a fastboot protocol interface by implementing
157 fastboot WWAN Port. The userspace end of the fastboot channel pipe is a
158 /dev/wwan0fastboot0 character device. Application shall use this interface for
159 fastboot protocol communication.
160
161 Please note that driver needs to be reloaded to export /dev/wwan0fastboot0
162 port, because device needs a cold reset after enter ``fastboot_switching``
163 mode.
164
165 ADB port userspace ABI
166 ----------------------
167
168 /dev/wwan0adb0 character device
169 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170 The driver exposes a ADB protocol interface by implementing ADB WWAN Port.
171 The userspace end of the ADB channel pipe is a /dev/wwan0adb0 character device.
172 Application shall use this interface for ADB protocol communication.
173
174 MIPC port userspace ABI
175 -----------------------
176
177 /dev/wwan0mipc0 character device
178 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
179 The driver exposes a diagnostic interface by implementing MIPC (Modem
180 Information Process Center) WWAN Port. The userspace end of the MIPC channel
181 pipe is a /dev/wwan0mipc0 character device.
182 Application shall use this interface for MTK modem diagnostic communication.
183
184 The MediaTek's T700 modem supports the 3GPP TS 27.007 [4] specification.
185
186 References
187 ==========
188 [1] *MBIM (Mobile Broadband Interface Model) Errata-1*
189
190 - https://www.usb.org/document-library/
191
192 [2] *libmbim "a glib-based library for talking to WWAN modems and devices which
193 speak the Mobile Interface Broadband Model (MBIM) protocol"*
194
195 - http://www.freedesktop.org/wiki/Software/libmbim/
196
197 [3] *Modem Manager "a DBus-activated daemon which controls mobile broadband
198 (2G/3G/4G/5G) devices and connections"*
199
200 - http://www.freedesktop.org/wiki/Software/ModemManager/
201
202 [4] *Specification # 27.007 - 3GPP*
203
204 - https://www.3gpp.org/DynaReport/27007.htm
205
206 [5] *fastboot "a mechanism for communicating with bootloaders"*
207
208 - https://android.googlesource.com/platform/system/core/+/refs/heads/main/fastboot/README.md
209
210 [6] *ADB (Android Debug Bridge) "a mechanism to keep track of Android devices
211 and emulators instances connected to or running on a given host developer
212 machine with ADB protocol"*
213
214 - https://android.googlesource.com/platform/packages/modules/adb/+/refs/heads/main/README.md
215

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

MediaTek T700 5G modem용 t7xx 드라이버

1-17

이 문서는 `GPL-2.0-only` 라이선스를 따릅니다.

Copyright 2020-2021 Intel Corporation.

MTK PCIe 기반 T700 5G modem용 t7xx 드라이버

t7xx는 Linux 또는 Chrome OS platform에서 host와 MediaTek T700 5G modem 사이의 PCIe 데이터 교환을 위해 개발한 WWAN PCIe host 드라이버입니다.

드라이버는 MBIM protocol을 따르는 interface를 노출하므로 ModemManager 같은 front-end application이 WWAN 데이터 통신을 관리할 수 있습니다.

MediaTek modem과 AT command로 상호 작용하는 interface도 제공합니다.

.. SPDX-License-Identifier: GPL-2.0-only

.. Copyright (C) 2020-21 Intel Corporation

.. _t7xx_driver_doc:

============================================
t7xx driver for MTK PCIe based T700 5G modem
============================================
The t7xx driver is a WWAN PCIe host driver developed for linux or Chrome OS
platforms for data exchange over PCIe interface between Host platform &
MediaTek's T700 5G modem.
The driver exposes an interface conforming to the MBIM protocol [1]. Any front
end application (e.g. Modem Manager) could easily manage the MBIM interface to
enable data communication towards WWAN. The driver also provides an interface
to interact with the MediaTek's modem via AT commands.

t7xx 기본 사용법

18-42

기본 사용법

MBIM과 AT function은 관리 application이 없으면 비활성 상태입니다. t7xx 드라이버는 MBIM과 AT control channel을 나타내는 WWAN port userspace interface를 제공하지만 기능을 직접 관리하지 않습니다.

userspace application이 port enumeration을 감지하고 MBIM·AT 기능을 활성화해야 합니다. 예로 libmbim의 `mbimcli`와 ModemManager가 있습니다.

MBIM IP session을 설정하려면 관리 application이 control channel을 열고, network connection을 구성하고, network에 연결하고, IP network interface를 설정해야 합니다.

AT command를 보내고 응답을 받으려면 UART tool 또는 전용 user tool로 AT control channel을 열어야 합니다.

t7xx userspace 관리 경로
t7xx port enumerationMBIM control channelnetwork 설정·연결IP interface
t7xx port enumerationAT control channelUART 또는 전용 toolAT command·response

MBIM data session과 AT command가 서로 다른 control port를 사용합니다.

Basic usage
===========
MBIM & AT functions are inactive when unmanaged. The t7xx driver provides
WWAN port userspace interfaces representing MBIM & AT control channels and does
not play any role in managing their functionality. It is the job of a userspace
application to detect port enumeration and enable MBIM & AT functionalities.

Examples of few such userspace applications are:

- mbimcli (included with the libmbim [2] library), and
- Modem Manager [3]

Management Applications to carry out below required actions for establishing
MBIM IP session:

- open the MBIM control channel
- configure network connection settings
- connect to network
- configure IP network interface

Management Applications to carry out below required actions for send an AT
command and receive response:

- open the AT control channel using a UART tool or a special user tool

t7xx sysfs interface

43-92

Sysfs

드라이버는 userspace에 sysfs interface를 제공합니다.

`t7xx_mode`

이 read/write sysfs interface로 userspace에서 현재 device mode를 읽거나 device mode를 설정할 수 있습니다.

t7xx device mode
의미
`unknown`device 상태를 알 수 없음
`ready`device 준비 완료
`reset`device reset 상태
`fastboot_switching`fastboot 전환 상태
`fastboot_download`fastboot download 상태
`fastboot_dump`fastboot dump 상태

`t7xx_mode`에서 읽고 쓸 수 있는 상태 이름입니다.

$ cat /sys/bus/pci/devices/${bdf}/t7xx_mode
$ echo fastboot_switching > /sys/bus/pci/devices/${bdf}/t7xx_mode

첫 명령은 현재 mode를 읽고, 두 번째 명령은 `fastboot_switching` mode를 설정합니다.

`t7xx_debug_ports`

이 read/write sysfs interface는 debug port를 활성화하거나 비활성화합니다. 현재 지원하는 debug port는 ADB와 MIPC입니다.

t7xx debug port 상태
의미
`1`debug port 활성화
`0`debug port 비활성화

`t7xx_debug_ports`의 값과 동작입니다.

$ cat /sys/bus/pci/devices/${bdf}/t7xx_debug_ports
$ echo 1 > /sys/bus/pci/devices/${bdf}/t7xx_debug_ports

첫 명령은 현재 debug port 상태를 읽고, 두 번째 명령은 debug port를 활성화합니다.

Sysfs
=====
The driver provides sysfs interfaces to userspace.

t7xx_mode
---------
The sysfs interface provides userspace with access to the device mode, this
interface supports read and write operations.

Device mode:

- ``unknown`` represents that device in unknown status
- ``ready`` represents that device in ready status
- ``reset`` represents that device in reset status
- ``fastboot_switching`` represents that device in fastboot switching status
- ``fastboot_download`` represents that device in fastboot download status
- ``fastboot_dump`` represents that device in fastboot dump status

Read from userspace to get the current device mode.

::
  $ cat /sys/bus/pci/devices/${bdf}/t7xx_mode

Write from userspace to set the device mode.

::
  $ echo fastboot_switching > /sys/bus/pci/devices/${bdf}/t7xx_mode

t7xx_debug_ports
----------------
The sysfs interface provides userspace with access to enable/disable the debug
ports, this interface supports read and write operations.

Debug port status:

- ``1`` represents enable debug ports
- ``0`` represents disable debug ports

Currently supported debug ports (ADB/MIPC).

Read from userspace to get the current debug ports status.

::
  $ cat /sys/bus/pci/devices/${bdf}/t7xx_debug_ports

Write from userspace to set the debug ports status.

::
  $ echo 1 > /sys/bus/pci/devices/${bdf}/t7xx_debug_ports

MBIM control channel userspace ABI

93-122

관리 application 개발

아래에서 드라이버와 userspace interface를 설명합니다. MBIM protocol은 참고문헌 [1] `Mobile Broadband Interface Model v1.0 Errata-1`에 정의되어 있습니다.

MBIM control channel userspace ABI

드라이버는 MBIM WWAN Port를 구현해 MBIM function interface를 노출합니다. control channel pipe의 userspace endpoint는 `/dev/wwan0mbim0` character device입니다.

application은 이 interface로 MBIM protocol 통신을 수행해야 합니다.

t7xx MBIM control ABI 책임
영역담당제약
port 노출t7xx driver`/dev/wwan0mbim0` character device
fragmentationuserspaceMBIM 규격에 따라 분할·재조립
`write()`userspace협상된 control message 크기를 넘지 않음
`read()`userspace협상된 최대 크기까지 message 수용

control message 처리에서 driver와 userspace 역할을 구분합니다.

모든 control message fragmentation과 defragmentation은 userspace application이 담당합니다. 쓰는 message는 협상된 크기를 넘으면 안 되고, 읽는 application은 그 크기까지 받아들여야 합니다.

Management application development
==================================
The driver and userspace interfaces are described below. The MBIM protocol is
described in [1] Mobile Broadband Interface Model v1.0 Errata-1.

MBIM control channel userspace ABI
----------------------------------

/dev/wwan0mbim0 character device
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The driver exposes an MBIM interface to the MBIM function by implementing
MBIM WWAN Port. The userspace end of the control channel pipe is a
/dev/wwan0mbim0 character device. Application shall use this interface for
MBIM protocol communication.

Fragmentation
~~~~~~~~~~~~~
The userspace application is responsible for all control message fragmentation
and defragmentation as per MBIM specification.

/dev/wwan0mbim0 write()
~~~~~~~~~~~~~~~~~~~~~~~
The MBIM control messages from the management application must not exceed the
negotiated control message size.

/dev/wwan0mbim0 read()
~~~~~~~~~~~~~~~~~~~~~~
The management application must accept control messages of up the negotiated
control message size.

MBIM data channel userspace ABI

123-141

MBIM data channel userspace ABI

t7xx 드라이버는 IP traffic용 `wwan` type IP link interface `wwan0-X`를 노출합니다.

iproute network utility로 `wwan0-X`를 만들고 MBIM IP session과 연결합니다.

`SessionId`가 0보다 큰 MBIM IP session을 설정하기 전에 userspace 관리 application이 새 IP link를 만들어야 합니다.

`SessionId 1`용 link 생성 예는 다음과 같습니다.

ip link add dev wwan0-1 parentdev wwan0 type wwan linkid 1

드라이버는 `wwan0-1` network device를 MBIM IP session 1에 자동으로 mapping합니다.

MBIM data channel userspace ABI
-------------------------------

wwan0-X network device
~~~~~~~~~~~~~~~~~~~~~~
The t7xx driver exposes IP link interface "wwan0-X" of type "wwan" for IP
traffic. Iproute network utility is used for creating "wwan0-X" network
interface and for associating it with MBIM IP session.

The userspace management application is responsible for creating new IP link
prior to establishing MBIM IP session where the SessionId is greater than 0.

For example, creating new IP link for a MBIM IP session with SessionId 1:

  ip link add dev wwan0-1 parentdev wwan0 type wwan linkid 1

The driver will automatically map the "wwan0-1" network device to MBIM IP
session 1.

AT·fastboot·ADB·MIPC userspace ABI

142-183

AT port userspace ABI

드라이버는 AT WWAN Port를 구현해 `/dev/wwan0at0` character device를 노출합니다. application은 이 interface로 AT command를 실행합니다.

fastboot port userspace ABI

드라이버는 fastboot WWAN Port를 구현해 `/dev/wwan0fastboot0` character device를 노출합니다. application은 이 interface로 fastboot protocol 통신을 수행합니다.

`fastboot_switching` mode에 들어가면 device cold reset이 필요하므로 `/dev/wwan0fastboot0` port를 내보내려면 드라이버를 다시 적재해야 합니다.

ADB port userspace ABI

드라이버는 ADB WWAN Port를 구현해 `/dev/wwan0adb0` character device를 노출합니다. application은 이 interface로 ADB protocol 통신을 수행합니다.

MIPC port userspace ABI

드라이버는 MIPC(Modem Information Process Center) WWAN Port를 구현해 `/dev/wwan0mipc0` character device를 노출합니다.

application은 이 interface로 MediaTek modem 진단 통신을 수행합니다.

t7xx userspace port
deviceprotocol/용도주의
`/dev/wwan0at0`AT commandAT WWAN Port
`/dev/wwan0fastboot0`fastbootfastboot_switching 뒤 cold reset·driver reload 필요
`/dev/wwan0adb0`ADBdebug port 활성화 필요
`/dev/wwan0mipc0`MediaTek modem 진단MIPC debug port

각 character device와 protocol 역할입니다.

AT port userspace ABI
----------------------------------

/dev/wwan0at0 character device
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The driver exposes an AT port by implementing AT WWAN Port.
The userspace end of the control port is a /dev/wwan0at0 character
device. Application shall use this interface to issue AT commands.

fastboot port userspace ABI
---------------------------

/dev/wwan0fastboot0 character device
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The driver exposes a fastboot protocol interface by implementing
fastboot WWAN Port. The userspace end of the fastboot channel pipe is a
/dev/wwan0fastboot0 character device. Application shall use this interface for
fastboot protocol communication.

Please note that driver needs to be reloaded to export /dev/wwan0fastboot0
port, because device needs a cold reset after enter ``fastboot_switching``
mode.

ADB port userspace ABI
----------------------

/dev/wwan0adb0 character device
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The driver exposes a ADB protocol interface by implementing ADB WWAN Port.
The userspace end of the ADB channel pipe is a /dev/wwan0adb0 character device.
Application shall use this interface for ADB protocol communication.

MIPC port userspace ABI
-----------------------

/dev/wwan0mipc0 character device
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The driver exposes a diagnostic interface by implementing MIPC (Modem
Information Process Center) WWAN Port. The userspace end of the MIPC channel
pipe is a /dev/wwan0mipc0 character device.
Application shall use this interface for MTK modem diagnostic communication.

t7xx 규격과 참고문헌

184-214

MediaTek T700 modem은 3GPP TS 27.007 specification을 지원합니다.

참고문헌

  • [1] MBIM Errata-1: `https://www.usb.org/document-library/`
  • [2] libmbim: `http://www.freedesktop.org/wiki/Software/libmbim/`
  • [3] ModemManager: `http://www.freedesktop.org/wiki/Software/ModemManager/`
  • [4] 3GPP Specification 27.007: `https://www.3gpp.org/DynaReport/27007.htm`
  • [5] fastboot README: `https://android.googlesource.com/platform/system/core/+/refs/heads/main/fastboot/README.md`
  • [6] ADB README: `https://android.googlesource.com/platform/packages/modules/adb/+/refs/heads/main/README.md`

libmbim은 MBIM WWAN modem과 통신하는 glib 기반 library입니다. ModemManager는 2G/3G/4G/5G mobile broadband 장치와 연결을 제어하는 D-Bus activated daemon입니다.

fastboot는 bootloader와 통신하는 mechanism이고, ADB는 host 개발 시스템에 연결되거나 실행 중인 Android device와 emulator instance를 추적하는 protocol입니다.

The MediaTek's T700 modem supports the 3GPP TS 27.007 [4] specification.

References
==========
[1] *MBIM (Mobile Broadband Interface Model) Errata-1*

- https://www.usb.org/document-library/

[2] *libmbim "a glib-based library for talking to WWAN modems and devices which
speak the Mobile Interface Broadband Model (MBIM) protocol"*

- http://www.freedesktop.org/wiki/Software/libmbim/

[3] *Modem Manager "a DBus-activated daemon which controls mobile broadband
(2G/3G/4G/5G) devices and connections"*

- http://www.freedesktop.org/wiki/Software/ModemManager/

[4] *Specification # 27.007 - 3GPP*

- https://www.3gpp.org/DynaReport/27007.htm

[5] *fastboot "a mechanism for communicating with bootloaders"*

- https://android.googlesource.com/platform/system/core/+/refs/heads/main/fastboot/README.md

[6] *ADB (Android Debug Bridge) "a mechanism to keep track of Android devices
and emulators instances connected to or running on a given host developer
machine with ADB protocol"*

- https://android.googlesource.com/platform/packages/modules/adb/+/refs/heads/main/README.md