← Documents Documentation/i2c/summary.rst GitHub 원문 ↗

Linux 6.18.37 · I2C

Introduction to I2C and SMBus

I2C와 SMBus의 관계, Linux의 컨트롤러·알고리즘·타깃 구성과 현재 권장 용어를 소개합니다.

Source pathDocumentation/i2c/summary.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

summary.rst:1-82

I2C는 저비용 2선식 장치 버스이고 SMBus는 대체로 그 부분집합입니다. Linux 구현에서는 controller를 adapter, target을 client라고 부른 역사적 이름이 남아 있지만 공식 용어인 controller와 target을 우선합니다.

문서 개요
항목
SourceDocumentation/i2c/summary.rst
분량82 source lines
일반 I2C 속도최대 400kHz
고속 모드최대 5MHz

원문 분량과 핵심 검토 대상을 요약합니다.

핵심 흐름
컨트롤러 드라이버 준비필요하면 공통 algorithm 사용타깃별 드라이버 연결컨트롤러가 주소로 타깃 선택권장 용어로 구현 설명

문서의 주요 판단과 동작을 압축합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 =============================
2 Introduction to I2C and SMBus
3 =============================
4
5 I²C (pronounce: I squared C and written I2C in the kernel documentation) is
6 a protocol developed by Philips. It is a two-wire protocol with variable
7 speed (typically up to 400 kHz, high speed modes up to 5 MHz). It provides
8 an inexpensive bus for connecting many types of devices with infrequent or
9 low bandwidth communications needs. I2C is widely used with embedded
10 systems. Some systems use variants that don't meet branding requirements,
11 and so are not advertised as being I2C but come under different names,
12 e.g. TWI (Two Wire Interface), IIC.
13
14 The latest official I2C specification is the `"I²C-bus specification and user
15 manual" (UM10204) <https://www.nxp.com/docs/en/user-guide/UM10204.pdf>`_
16 published by NXP Semiconductors, version 7 as of this writing.
17
18 SMBus (System Management Bus) is based on the I2C protocol, and is mostly
19 a subset of I2C protocols and signaling. Many I2C devices will work on an
20 SMBus, but some SMBus protocols add semantics beyond what is required to
21 achieve I2C branding. Modern PC mainboards rely on SMBus. The most common
22 devices connected through SMBus are RAM modules configured using I2C EEPROMs,
23 and hardware monitoring chips.
24
25 Because the SMBus is mostly a subset of the generalized I2C bus, we can
26 use its protocols on many I2C systems. However, there are systems that don't
27 meet both SMBus and I2C electrical constraints; and others which can't
28 implement all the common SMBus protocol semantics or messages.
29
30
31 Terminology
32 ===========
33
34 The I2C bus connects one or more controller chips and one or more target chips.
35
36 .. kernel-figure:: i2c_bus.svg
37 :alt: Simple I2C bus with one controller and 3 targets
38
39 Simple I2C bus
40
41 A **controller** chip is a node that starts communications with targets. In the
42 Linux kernel implementation it is also called an "adapter" or "bus". Controller
43 drivers are usually in the ``drivers/i2c/busses/`` subdirectory.
44
45 An **algorithm** contains general code that can be used to implement a whole
46 class of I2C controllers. Each specific controller driver either depends on an
47 algorithm driver in the ``drivers/i2c/algos/`` subdirectory, or includes its
48 own implementation.
49
50 A **target** chip is a node that responds to communications when addressed by a
51 controller. In the Linux kernel implementation it is also called a "client".
52 While targets are usually separate external chips, Linux can also act as a
53 target (needs hardware support) and respond to another controller on the bus.
54 This is then called a **local target**. In contrast, an external chip is called
55 a **remote target**.
56
57 Target drivers are kept in a directory specific to the feature they provide,
58 for example ``drivers/gpio/`` for GPIO expanders and ``drivers/media/i2c/`` for
59 video-related chips.
60
61 For the example configuration in the figure above, you will need one driver for
62 the I2C controller, and drivers for your I2C targets. Usually one driver for
63 each target.
64
65 Synonyms
66 --------
67
68 As mentioned above, the Linux I2C implementation historically uses the terms
69 "adapter" for controller and "client" for target. A number of data structures
70 have these synonyms in their name. So, when discussing implementation details,
71 you should be aware of these terms as well. The official wording is preferred,
72 though.
73
74 Outdated terminology
75 --------------------
76
77 In earlier I2C specifications, controller was named "master" and target was
78 named "slave". These terms have been obsoleted with v7 of the specification and
79 their use is also discouraged by the Linux Kernel Code of Conduct. You may
80 still find them in references to documentation which has not been updated. The
81 general attitude, however, is to use the inclusive terms: controller and
82 target. Work to replace the old terminology in the Linux Kernel is on-going.
83

3. 한국어 전문 번역

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

I2C와 SMBus의 관계

1-29

I²C는 'I squared C'라고 읽고 커널 문서에서는 I2C로 씁니다. Philips가 개발한 가변 속도 2선식 프로토콜이며, 보통 최대 400kHz이고 고속 모드는 최대 5MHz입니다.

통신 빈도나 대역폭 요구가 낮은 여러 종류의 장치를 저렴하게 연결하는 버스로, 임베디드 시스템에서 널리 사용됩니다. 일부 시스템은 브랜드 요구사항을 충족하지 않아 I2C로 표기하지 않고 TWI(Two Wire Interface), IIC 같은 이름을 사용합니다.

최신 공식 I2C 규격은 NXP Semiconductors가 발행한 `I²C-bus specification and user manual`(UM10204)이며, 문서 작성 시점에는 버전 7입니다.

SMBus(System Management Bus)는 I2C를 기반으로 하며 대부분 I2C 프로토콜과 신호의 부분집합입니다. 많은 I2C 장치가 SMBus에서 동작하지만, 일부 SMBus 프로토콜은 I2C 브랜드 요건을 넘어서는 의미를 추가합니다.

현대 PC 메인보드는 SMBus에 의존합니다. 대표적인 연결 장치는 I2C EEPROM으로 설정되는 RAM 모듈과 하드웨어 모니터링 칩입니다.

SMBus가 일반화된 I2C 버스의 부분집합인 경우가 많으므로 많은 I2C 시스템에서 SMBus 프로토콜을 사용할 수 있습니다. 다만 SMBus와 I2C의 전기적 제약을 동시에 만족하지 않는 시스템도 있고, 공통 SMBus 프로토콜 의미나 메시지를 모두 구현하지 못하는 시스템도 있습니다.

I2C와 SMBus
항목I2CSMBus
관계일반화된 2선식 프로토콜대체로 I2C 부분집합
일반 속도보통 최대 400kHz, 고속 최대 5MHz시스템 관리 중심
대표 환경임베디드 시스템PC 메인보드
대표 장치저대역폭 센서·주변장치RAM EEPROM, 하드웨어 모니터
호환성SMBus 명령을 표현 가능임의 I2C 명령은 처리하지 못할 수 있음

두 버스의 범위와 대표 용도를 비교합니다.

=============================
Introduction to I2C and SMBus
=============================

I²C (pronounce: I squared C and written I2C in the kernel documentation) is
a protocol developed by Philips. It is a two-wire protocol with variable
speed (typically up to 400 kHz, high speed modes up to 5 MHz). It provides
an inexpensive bus for connecting many types of devices with infrequent or
low bandwidth communications needs. I2C is widely used with embedded
systems. Some systems use variants that don't meet branding requirements,
and so are not advertised as being I2C but come under different names,
e.g. TWI (Two Wire Interface), IIC.

The latest official I2C specification is the `"I²C-bus specification and user
manual" (UM10204) <https://www.nxp.com/docs/en/user-guide/UM10204.pdf>`_
published by NXP Semiconductors, version 7 as of this writing.

SMBus (System Management Bus) is based on the I2C protocol, and is mostly
a subset of I2C protocols and signaling. Many I2C devices will work on an
SMBus, but some SMBus protocols add semantics beyond what is required to
achieve I2C branding. Modern PC mainboards rely on SMBus. The most common
devices connected through SMBus are RAM modules configured using I2C EEPROMs,
and hardware monitoring chips.

Because the SMBus is mostly a subset of the generalized I2C bus, we can
use its protocols on many I2C systems. However, there are systems that don't
meet both SMBus and I2C electrical constraints; and others which can't
implement all the common SMBus protocol semantics or messages.

컨트롤러, 알고리즘과 타깃

30-64

I2C 버스는 하나 이상의 컨트롤러 칩과 하나 이상의 타깃 칩을 연결합니다.

단순 I2C 버스
버스 노드수량통신 역할
Controller1통신 시작, 공용 SCL/SDA 제어
Target 11주소가 선택되면 응답
Target 21주소가 선택되면 응답
Target 31주소가 선택되면 응답

원문의 `i2c_bus.svg`가 나타내는 한 컨트롤러와 세 타깃 구성을 구조화했습니다.

단순 I2C 통신
컨트롤러가 START 생성공용 버스에 타깃 주소 전송선택된 타깃만 응답데이터 교환컨트롤러가 STOP 생성

컨트롤러가 한 타깃을 선택해 전송하는 관계입니다.

컨트롤러는 타깃과의 통신을 시작하는 노드입니다. Linux 커널 구현에서는 `adapter` 또는 `bus`라고도 부릅니다. 컨트롤러 드라이버는 대개 `drivers/i2c/busses/` 아래에 있습니다.

알고리즘은 I2C 컨트롤러의 한 종류 전체를 구현하는 데 재사용할 수 있는 공통 코드입니다. 특정 컨트롤러 드라이버는 `drivers/i2c/algos/` 아래의 알고리즘 드라이버에 의존하거나 자체 구현을 포함합니다.

타깃은 컨트롤러가 주소를 지정했을 때 통신에 응답하는 노드입니다. Linux 커널 구현에서는 `client`라고도 합니다.

타깃은 보통 별도 외부 칩이지만, 하드웨어가 지원하면 Linux도 타깃으로 동작해 버스의 다른 컨트롤러에 응답할 수 있습니다. 이 경우 Linux 쪽은 `local target`, 외부 칩은 `remote target`이라고 부릅니다.

타깃 드라이버는 제공 기능에 맞는 디렉터리에 둡니다. 예를 들어 GPIO 확장기는 `drivers/gpio/`, 비디오 관련 칩은 `drivers/media/i2c/`에 있습니다.

그림과 같은 구성에는 I2C 컨트롤러용 드라이버 하나와 각 I2C 타깃용 드라이버가 필요합니다. 보통 타깃마다 드라이버 하나를 사용합니다.

Linux I2C 구성 요소
공식 용어Linux 동의어역할일반 위치
Controlleradapter, bus통신 시작`drivers/i2c/busses/`
Algorithm-컨트롤러 계열 공통 구현`drivers/i2c/algos/`
Targetclient주소 선택 시 응답기능별 디렉터리
Local targetlocal client 역할Linux가 외부 컨트롤러에 응답I2C 타깃 지원 코드

공식 용어, 커널 동의어와 소스 위치입니다.


Terminology
===========

The I2C bus connects one or more controller chips and one or more target chips.

.. kernel-figure::  i2c_bus.svg
   :alt:    Simple I2C bus with one controller and 3 targets

   Simple I2C bus

A **controller** chip is a node that starts communications with targets. In the
Linux kernel implementation it is also called an "adapter" or "bus". Controller
drivers are usually in the ``drivers/i2c/busses/`` subdirectory.

An **algorithm** contains general code that can be used to implement a whole
class of I2C controllers. Each specific controller driver either depends on an
algorithm driver in the ``drivers/i2c/algos/`` subdirectory, or includes its
own implementation.

A **target** chip is a node that responds to communications when addressed by a
controller. In the Linux kernel implementation it is also called a "client".
While targets are usually separate external chips, Linux can also act as a
target (needs hardware support) and respond to another controller on the bus.
This is then called a **local target**. In contrast, an external chip is called
a **remote target**.

Target drivers are kept in a directory specific to the feature they provide,
for example ``drivers/gpio/`` for GPIO expanders and ``drivers/media/i2c/`` for
video-related chips.

For the example configuration in the figure above, you will need one driver for
the I2C controller, and drivers for your I2C targets. Usually one driver for
each target.

동의어와 폐기된 용어

65-82

Linux I2C 구현은 역사적으로 controller를 `adapter`, target을 `client`라고 불렀습니다. 여러 데이터 구조 이름에 이 동의어가 남아 있으므로 구현 세부를 논의할 때 함께 알아야 합니다. 새 문서와 일반 설명에서는 공식 용어를 우선합니다.

이전 I2C 규격은 controller를 `master`, target을 `slave`라고 불렀습니다. 규격 버전 7에서 이 용어들은 폐기됐고 Linux Kernel Code of Conduct도 사용을 권장하지 않습니다.

아직 갱신되지 않은 문서를 참조할 때 옛 용어가 남아 있을 수 있지만, 일반 원칙은 포용적인 `controller`와 `target`을 사용하는 것입니다. Linux 커널에서 옛 용어를 교체하는 작업은 계속 진행 중입니다.

I2C 용어 대응
권장 공식 용어Linux 역사적 동의어폐기된 용어
controlleradapter, busmaster
targetclientslave

공식 용어, 커널 역사적 동의어와 폐기된 표현입니다.

Synonyms
--------

As mentioned above, the Linux I2C implementation historically uses the terms
"adapter" for controller and "client" for target. A number of data structures
have these synonyms in their name. So, when discussing implementation details,
you should be aware of these terms as well. The official wording is preferred,
though.

Outdated terminology
--------------------

In earlier I2C specifications, controller was named "master" and target was
named "slave". These terms have been obsoleted with v7 of the specification and
their use is also discouraged by the Linux Kernel Code of Conduct. You may
still find them in references to documentation which has not been updated. The
general attitude, however, is to use the inclusive terms: controller and
target. Work to replace the old terminology in the Linux Kernel is on-going.