Documentation/driver-api/i3c/protocol.rst GitHub 원문 ↗

Linux 6.18.37 · Driver API

I3C protocol

I3C bus 역할, DAA discovery, IBI·Hot-Join event, CCC·SDR·HDR transfer와 I2C compatibility를 설명합니다.

Source pathDocumentation/driver-api/i3c/protocol.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

protocol.rst:1-203

I3C는 I2C 호환성을 유지하면서 자동 discovery와 dynamic address, external IRQ 선 없는 slave event, 더 빠른 transfer class를 제공합니다. Software는 DAA identity, IBI priority, CCC addressing, HDR mode와 legacy I2C LVR를 함께 다뤄야 합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ============
4 I3C protocol
5 ============
6
7 Disclaimer
8 ==========
9
10 This chapter will focus on aspects that matter to software developers. For
11 everything hardware related (like how things are transmitted on the bus, how
12 collisions are prevented, ...) please have a look at the I3C specification.
13
14 This document is just a brief introduction to the I3C protocol and the concepts
15 it brings to the table. If you need more information, please refer to the MIPI
16 I3C specification (can be downloaded here
17 https://resources.mipi.org/mipi-i3c-v1-download).
18
19 Introduction
20 ============
21
22 The I3C (pronounced 'eye-three-see') is a MIPI standardized protocol designed
23 to overcome I2C limitations (limited speed, external signals needed for
24 interrupts, no automatic detection of the devices connected to the bus, ...)
25 while remaining power-efficient.
26
27 I3C Bus
28 =======
29
30 An I3C bus is made of several I3C devices and possibly some I2C devices as
31 well, but let's focus on I3C devices for now.
32
33 An I3C device on the I3C bus can have one of the following roles:
34
35 * Master: the device is driving the bus. It's the one in charge of initiating
36 transactions or deciding who is allowed to talk on the bus (slave generated
37 events are possible in I3C, see below).
38 * Slave: the device acts as a slave, and is not able to send frames to another
39 slave on the bus. The device can still send events to the master on
40 its own initiative if the master allowed it.
41
42 I3C is a multi-master protocol, so there might be several masters on a bus,
43 though only one device can act as a master at a given time. In order to gain
44 bus ownership, a master has to follow a specific procedure.
45
46 Each device on the I3C bus has to be assigned a dynamic address to be able to
47 communicate. Until this is done, the device should only respond to a limited
48 set of commands. If it has a static address (also called legacy I2C address),
49 the device can reply to I2C transfers.
50
51 In addition to these per-device addresses, the protocol defines a broadcast
52 address in order to address all devices on the bus.
53
54 Once a dynamic address has been assigned to a device, this address will be used
55 for any direct communication with the device. Note that even after being
56 assigned a dynamic address, the device should still process broadcast messages.
57
58 I3C Device discovery
59 ====================
60
61 The I3C protocol defines a mechanism to automatically discover devices present
62 on the bus, their capabilities and the functionalities they provide. In this
63 regard I3C is closer to a discoverable bus like USB than it is to I2C or SPI.
64
65 The discovery mechanism is called DAA (Dynamic Address Assignment), because it
66 not only discovers devices but also assigns them a dynamic address.
67
68 During DAA, each I3C device reports 3 important things:
69
70 * BCR: Bus Characteristic Register. This 8-bit register describes the device bus
71 related capabilities
72 * DCR: Device Characteristic Register. This 8-bit register describes the
73 functionalities provided by the device
74 * Provisioned ID: A 48-bit unique identifier. On a given bus there should be no
75 Provisioned ID collision, otherwise the discovery mechanism may fail.
76
77 I3C slave events
78 ================
79
80 The I3C protocol allows slaves to generate events on their own, and thus allows
81 them to take temporary control of the bus.
82
83 This mechanism is called IBI for In Band Interrupts, and as stated in the name,
84 it allows devices to generate interrupts without requiring an external signal.
85
86 During DAA, each device on the bus has been assigned an address, and this
87 address will serve as a priority identifier to determine who wins if 2 different
88 devices are generating an interrupt at the same moment on the bus (the lower the
89 dynamic address the higher the priority).
90
91 Masters are allowed to inhibit interrupts if they want to. This inhibition
92 request can be broadcast (applies to all devices) or sent to a specific
93 device.
94
95 I3C Hot-Join
96 ============
97
98 The Hot-Join mechanism is similar to USB hotplug. This mechanism allows
99 slaves to join the bus after it has been initialized by the master.
100
101 This covers the following use cases:
102
103 * the device is not powered when the bus is probed
104 * the device is hotplugged on the bus through an extension board
105
106 This mechanism is relying on slave events to inform the master that a new
107 device joined the bus and is waiting for a dynamic address.
108
109 The master is then free to address the request as it wishes: ignore it or
110 assign a dynamic address to the slave.
111
112 I3C transfer types
113 ==================
114
115 If you omit SMBus (which is just a standardization on how to access registers
116 exposed by I2C devices), I2C has only one transfer type.
117
118 I3C defines 3 different classes of transfer in addition to I2C transfers which
119 are here for backward compatibility with I2C devices.
120
121 I3C CCC commands
122 ----------------
123
124 CCC (Common Command Code) commands are meant to be used for anything that is
125 related to bus management and all features that are common to a set of devices.
126
127 CCC commands contain an 8-bit CCC ID describing the command that is executed.
128 The MSB of this ID specifies whether this is a broadcast command (bit7 = 0) or a
129 unicast one (bit7 = 1).
130
131 The command ID can be followed by a payload. Depending on the command, this
132 payload is either sent by the master sending the command (write CCC command),
133 or sent by the slave receiving the command (read CCC command). Of course, read
134 accesses only apply to unicast commands.
135 Note that, when sending a CCC command to a specific device, the device address
136 is passed in the first byte of the payload.
137
138 The payload length is not explicitly passed on the bus, and should be extracted
139 from the CCC ID.
140
141 Note that vendors can use a dedicated range of CCC IDs for their own commands
142 (0x61-0x7f and 0xe0-0xef).
143
144 I3C Private SDR transfers
145 -------------------------
146
147 Private SDR (Single Data Rate) transfers should be used for anything that is
148 device specific and does not require high transfer speed.
149
150 It is the equivalent of I2C transfers but in the I3C world. Each transfer is
151 passed the device address (dynamic address assigned during DAA), a payload
152 and a direction.
153
154 The only difference with I2C is that the transfer is much faster (typical clock
155 frequency is 12.5MHz).
156
157 I3C HDR commands
158 ----------------
159
160 HDR commands should be used for anything that is device specific and requires
161 high transfer speed.
162
163 The first thing attached to an HDR command is the HDR mode. There are currently
164 3 different modes defined by the I3C specification (refer to the specification
165 for more details):
166
167 * HDR-DDR: Double Data Rate mode
168 * HDR-TSP: Ternary Symbol Pure. Only usable on buses with no I2C devices
169 * HDR-TSL: Ternary Symbol Legacy. Usable on buses with I2C devices
170
171 When sending an HDR command, the whole bus has to enter HDR mode, which is done
172 using a broadcast CCC command.
173 Once the bus has entered a specific HDR mode, the master sends the HDR command.
174 An HDR command is made of:
175
176 * one 16-bits command word in big endian
177 * N 16-bits data words in big endian
178
179 Those words may be wrapped with specific preambles/post-ambles which depend on
180 the chosen HDR mode and are detailed here (see the specification for more
181 details).
182
183 The 16-bits command word is made of:
184
185 * bit[15]: direction bit, read is 1, write is 0
186 * bit[14:8]: command code. Identifies the command being executed, the amount of
187 data words and their meaning
188 * bit[7:1]: I3C address of the device this command is addressed to
189 * bit[0]: reserved/parity-bit
190
191 Backward compatibility with I2C devices
192 =======================================
193
194 The I3C protocol has been designed to be backward compatible with I2C devices.
195 This backward compatibility allows one to connect a mix of I2C and I3C devices
196 on the same bus, though, in order to be really efficient, I2C devices should
197 be equipped with 50 ns spike filters.
198
199 I2C devices can't be discovered like I3C ones and have to be statically
200 declared. In order to let the master know what these devices are capable of
201 (both in terms of bus related limitations and functionalities), the software
202 has to provide some information, which is done through the LVR (Legacy I2C
203 Virtual Register).
204

3. 한국어 전문 번역

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

I3C protocol 문서 범위

1-18

문서 제목은 `I3C protocol`입니다. 이 장은 software developer에게 중요한 측면에 초점을 맞춥니다. Bus에서 bit가 전송되는 방식이나 collision 방지처럼 hardware와 관련된 모든 사항은 I3C specification을 확인해야 합니다.

이 문서는 I3C protocol과 새로 도입되는 concept를 짧게 소개합니다. 더 자세한 내용은 MIPI I3C specification을 참조해야 하며 `https://resources.mipi.org/mipi-i3c-v1-download`에서 내려받을 수 있습니다.

문서와 specification의 범위
범위이 문서MIPI I3C specification
Software developer 관련 개념간략 소개상세 정의
Bus 전송 방식범위 밖정식 정의
Collision 방지범위 밖정식 정의
공식 자료Download URL 안내MIPI specification

Software 관점과 hardware 상세의 참조 위치를 구분합니다.

I3C가 해결하는 I2C 한계

19-26

I3C는 'eye-three-see'로 발음하며 MIPI가 표준화한 protocol입니다. I2C의 제한된 speed, interrupt를 위한 external signal 필요, bus에 연결된 device를 자동 감지하지 못하는 문제 등을 해결하면서도 power-efficient하도록 설계했습니다.

I2C 한계와 I3C 목표
I2C 제약I3C 설계 목표
제한된 speed더 높은 transfer speed
Interrupt용 external signalIn-band event
자동 device detection 없음DAA discovery
전력 비용Power-efficient operation

I3C가 개선하려는 핵심 항목입니다.

I3C bus 역할과 address

27-57

I3C bus는 여러 I3C device로 구성되며 I2C device도 함께 있을 수 있습니다. 여기서는 먼저 I3C device에 초점을 맞춥니다.

I3C bus의 device 역할은 Master 또는 Slave입니다. Master는 bus를 drive하고 transaction을 시작하거나 bus에서 누가 말할 수 있는지 결정합니다. I3C에서는 아래에서 설명하는 slave-generated event도 가능합니다.

Slave는 slave로 동작하며 bus의 다른 slave로 frame을 보낼 수 없습니다. 다만 master가 허용했다면 자신의 판단으로 master에 event를 보낼 수 있습니다.

I3C는 multi-master protocol이므로 bus에 master가 여러 개 있을 수 있지만 어느 한 순간에는 device 하나만 master로 동작할 수 있습니다. Master가 bus ownership을 얻으려면 정해진 procedure를 따라야 합니다.

I3C bus의 각 device는 통신하기 전에 dynamic address를 할당받아야 합니다. 할당 전에는 제한된 command 집합에만 응답해야 합니다. Static address, 즉 legacy I2C address가 있다면 I2C transfer에는 응답할 수 있습니다.

Protocol은 device별 address 외에 bus의 모든 device를 지정하는 broadcast address도 정의합니다. Dynamic address를 할당한 뒤에는 device와 직접 통신할 때 그 address를 사용하지만, device는 할당 후에도 broadcast message를 계속 처리해야 합니다.

I3C device 역할
역할할 수 있는 일제약
MasterTransaction 시작·발언권 결정·bus drive동시에 하나만 active
Slave허용된 event를 master에 자발적으로 전송다른 slave에 frame 전송 불가

Master와 Slave의 bus 권한을 비교합니다.

I3C address lifecycle
Device가 bus에 존재할당 전에는 제한 command만 응답Optional static legacy I2C address로 I2C 응답Dynamic address 할당Dynamic address로 direct communicationBroadcast address message도 계속 처리

초기 상태에서 direct·broadcast communication까지의 흐름입니다.

Device discovery와 DAA

58-76

I3C protocol은 bus에 있는 device, device capability, 제공 functionality를 자동으로 발견하는 mechanism을 정의합니다. 이 점에서 I3C는 I2C나 SPI보다 USB 같은 discoverable bus에 가깝습니다.

Discovery mechanism은 DAA(Dynamic Address Assignment)라고 부릅니다. Device를 발견할 뿐 아니라 dynamic address도 할당하기 때문입니다.

DAA 중 각 I3C device는 세 가지 핵심 정보를 보고합니다. BCR(Bus Characteristic Register)은 bus 관련 capability를 설명하는 8-bit register이고, DCR(Device Characteristic Register)은 device가 제공하는 functionality를 설명하는 8-bit register입니다. Provisioned ID는 48-bit unique identifier입니다.

같은 bus 안에서는 Provisioned ID collision이 없어야 합니다. 충돌하면 discovery mechanism이 실패할 수 있습니다.

DAA discovery 흐름
Master가 DAA 시작I3C device 발견BCR·DCR·Provisioned ID 보고Provisioned ID collision 확인Dynamic address 할당Addressed communication 가능

Device 발견과 dynamic address 할당을 함께 수행합니다.

DAA 보고 정보
Field의미
BCR8-bitBus Characteristic Register, bus capability
DCR8-bitDevice Characteristic Register, 제공 functionality
Provisioned ID48-bitBus 안에서 충돌하면 안 되는 unique identifier

DAA에서 각 device가 보고하는 세 field입니다.

In-Band Interrupt

77-94

I3C protocol은 slave가 스스로 event를 생성해 bus를 일시적으로 제어할 수 있게 합니다.

이 mechanism은 IBI(In Band Interrupts)라고 하며 이름 그대로 external signal 없이 device가 interrupt를 생성할 수 있게 합니다.

DAA에서 각 bus device에 할당된 dynamic address는 서로 다른 두 device가 같은 순간 interrupt를 생성할 때 승자를 정하는 priority identifier로 쓰입니다. Dynamic address가 낮을수록 priority가 높습니다.

Master는 원한다면 interrupt를 inhibit할 수 있습니다. Inhibition request는 broadcast하여 모든 device에 적용하거나 특정 device에만 보낼 수 있습니다.

IBI arbitration
Master가 IBI를 허용Slave가 external IRQ 선 없이 event 생성둘 이상이면 dynamic address 비교더 낮은 address가 높은 priority 획득승자가 bus를 일시 제어Master가 event 처리

동시 slave event에서 dynamic address로 우선순위를 정합니다.

IBI 제어 범위
동작대상효과
IBI eventSlave → MasterExternal signal 없는 interrupt
Broadcast inhibit모든 device전체 interrupt 억제
Unicast inhibit특정 device해당 device interrupt 억제

Interrupt 허용·억제와 대상 범위입니다.

Hot-Join

95-111

Hot-Join mechanism은 USB hotplug와 비슷하며 master가 bus를 initialize한 뒤에도 slave가 bus에 참여할 수 있게 합니다.

Bus probe 시점에 device 전원이 꺼져 있거나 extension board를 통해 device가 bus에 hotplug되는 use case를 다룹니다.

새 device는 slave event로 자신이 bus에 참여했고 dynamic address를 기다린다고 master에 알립니다. Master는 이 request를 무시하거나 slave에 dynamic address를 할당하는 등 원하는 방식으로 처리할 수 있습니다.

Hot-Join 처리
Master가 bus 초기화미전원 device가 켜지거나 extension board에서 hotplug새 slave가 event 생성Dynamic address 대기 상태 알림Master가 request 판단무시 또는 dynamic address 할당

초기화 뒤 참여한 slave의 address 요청 흐름입니다.

I3C transfer class

112-120

I2C device가 노출한 register에 접근하는 방식을 표준화한 SMBus를 제외하면 I2C에는 transfer type이 하나뿐입니다.

I3C는 서로 다른 transfer class 세 가지를 정의하고, I2C device와의 backward compatibility를 위해 I2C transfer도 추가로 허용합니다.

I3C transfer class
Class용도
CCC commandBus management·공통 feature
Private SDRDevice-specific, 일반 speed
HDR commandDevice-specific, high speed
I2C transferI2C device backward compatibility

세 I3C class와 compatibility transfer를 구분합니다.

CCC command

121-143

CCC(Common Command Code) command는 bus management와 여러 device에 공통인 모든 feature에 사용합니다.

CCC command에는 실행할 command를 설명하는 8-bit CCC ID가 있습니다. ID의 MSB인 bit7은 broadcast command인지 unicast command인지 나타냅니다. `bit7 = 0`이면 broadcast이고 `bit7 = 1`이면 unicast입니다.

Command ID 뒤에는 payload가 올 수 있습니다. Command에 따라 command를 보내는 master가 payload를 전송하는 write CCC command이거나 command를 받은 slave가 payload를 전송하는 read CCC command입니다. Read access는 당연히 unicast command에만 적용됩니다.

특정 device에 CCC command를 보낼 때 device address는 payload의 첫 byte로 전달합니다. Payload length는 bus에서 명시적으로 전달하지 않으며 CCC ID에서 추출해야 합니다.

Vendor는 자체 command에 전용 CCC ID 범위 `0x61-0x7f`와 `0xe0-0xef`를 사용할 수 있습니다.

CCC ID bit7
bit7Command 범위Read CCC
0Broadcast적용 불가
1Unicast적용 가능

8-bit CCC ID의 최상위 bit가 addressing mode를 정합니다.

CCC command payload
8-bit CCC ID 전송bit7로 broadcast·unicast 판별CCC ID로 payload length 결정Unicast면 payload 첫 byte에 device addressWrite는 Master → SlaveRead는 Slave → Master이며 unicast만 허용

ID 해석과 payload 방향·길이 결정 순서입니다.

Vendor CCC ID
범위용도
0x61-0x7fVendor-specific CCC
0xe0-0xefVendor-specific CCC

Vendor-specific command에 예약된 두 범위입니다.

Private SDR transfer

144-156

Private SDR(Single Data Rate) transfer는 device-specific이고 높은 transfer speed가 필요하지 않은 작업에 사용해야 합니다.

I3C 세계에서 I2C transfer에 해당합니다. 각 transfer에는 DAA 중 할당된 device dynamic address, payload, direction을 전달합니다.

I2C와의 유일한 차이는 transfer가 훨씬 빠르다는 점이며 typical clock frequency는 12.5 MHz입니다.

Private SDR 구성
항목
대상Device-specific data
AddressDAA dynamic address
전달 정보Payload + direction
Typical clock12.5 MHz
High-speed 요구없음

일반 device-specific transfer의 입력과 속도입니다.

HDR command

157-190

HDR command는 device-specific이고 높은 transfer speed가 필요한 작업에 사용해야 합니다.

HDR command에는 먼저 HDR mode가 붙습니다. I3C specification은 현재 세 mode를 정의합니다. HDR-DDR은 Double Data Rate mode입니다. HDR-TSP는 Ternary Symbol Pure로 I2C device가 없는 bus에서만 쓸 수 있습니다. HDR-TSL은 Ternary Symbol Legacy로 I2C device가 있는 bus에서도 쓸 수 있습니다. 자세한 내용은 specification을 참조해야 합니다.

HDR command를 보낼 때는 먼저 broadcast CCC command로 전체 bus를 HDR mode에 진입시켜야 합니다. Bus가 특정 HDR mode에 들어가면 master가 HDR command를 보냅니다.

HDR command는 big endian의 16-bits command word 하나와 big endian의 16-bits data word N개로 이루어집니다. 선택한 HDR mode에 따라 특정 preamble과 post-amble로 word를 감쌀 수 있으며 세부 형식은 specification에 있습니다.

16-bits command word에서 `bit[15]`는 direction bit로 read는 1, write는 0입니다. `bit[14:8]`은 실행할 command, data word 수와 의미를 식별하는 command code입니다. `bit[7:1]`은 command 대상 I3C device address이고 `bit[0]`은 reserved/parity-bit입니다.

HDR mode
Mode의미I2C device 공존
HDR-DDRDouble Data RateSpecification 조건
HDR-TSPTernary Symbol Pure불가
HDR-TSLTernary Symbol Legacy가능

세 high data rate mode와 I2C device 공존 조건입니다.

HDR command 전송
HDR mode 선택Broadcast CCC로 전체 bus를 HDR mode로 전환Master가 16-bit big endian command word 전송N개의 16-bit big endian data word 전송Mode별 preamble·post-amble 적용Specification에 따른 mode 종료

Bus mode 전환에서 data word 전송까지의 순서입니다.

HDR 16-bit command word
BitField의미
bit[15]DirectionRead=1, Write=0
bit[14:8]Command codeCommand·data word 수·의미
bit[7:1]I3C address대상 device
bit[0]Reserved/parity예약 또는 parity bit

Command word의 bit field를 보존해 구조화했습니다.

I2C backward compatibility와 LVR

191-203

I3C protocol은 I2C device와 backward compatible하도록 설계했습니다. 따라서 같은 bus에 I2C와 I3C device를 섞어 연결할 수 있습니다. 다만 실제로 효율적으로 동작하려면 I2C device에 50 ns spike filter가 있어야 합니다.

I2C device는 I3C device처럼 discovery할 수 없으므로 statically declared해야 합니다. Master가 bus-related limitation과 functionality 양쪽에서 이 device의 capability를 알 수 있도록 software가 정보를 제공해야 하며, 이 정보는 LVR(Legacy I2C Virtual Register)을 통해 전달합니다.

I2C compatibility 조건
항목요구·동작
Bus 구성I2C + I3C device 혼합 가능
Signal 효율I2C device에 50 ns spike filter 권장
DiscoveryI2C는 자동 discovery 불가
DeclarationSoftware에서 static declaration
Capability 전달LVR로 bus limitation·functionality 제공

혼합 bus에서 I2C device에 필요한 처리입니다.

Legacy I2C device 등록
I2C device를 statically declareSoftware가 bus limitation 수집Software가 functionality 정보 수집LVR 구성Master가 Legacy I2C capability 인식I3C device와 같은 bus에서 운용

자동 발견이 없는 I2C device 정보를 master에 제공하는 흐름입니다.