← Documents Documentation/i2c/slave-eeprom-backend.rst GitHub 원문 ↗

Linux 6.18.37 · I2C

Linux I2C slave EEPROM backend

Linux I2C 슬레이브 프레임워크에서 EEPROM을 모사하고 sysfs로 메모리 내용을 접근하는 백엔드를 설명합니다.

Source pathDocumentation/i2c/slave-eeprom-backend.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

slave-eeprom-backend.rst:1-26

슬레이브 EEPROM 백엔드는 24c02부터 24c512까지 읽기·쓰기 또는 읽기 전용 장치를 모사하며, 사용자 공간은 slave-eeprom sysfs 파일로 내용을 관리할 수 있습니다.

문서 개요
항목
SourceDocumentation/i2c/slave-eeprom-backend.rst
분량26 source lines
지원 유형4
접근 모드read/write, read-only

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

핵심 흐름
백엔드 유형과 모드 선택new_device로 슬레이브 생성선택적으로 firmware-name 데이터 적재sysfs 파일로 내용 접근

문서의 주요 생성·구성 순서를 압축합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ==============================
2 Linux I2C slave EEPROM backend
3 ==============================
4
5 by Wolfram Sang <[email protected]> in 2014-20
6
7 This backend simulates an EEPROM on the connected I2C bus. Its memory contents
8 can be accessed from userspace via this file located in sysfs::
9
10 /sys/bus/i2c/devices/<device-directory>/slave-eeprom
11
12 The following types are available: 24c02, 24c32, 24c64, and 24c512. Read-only
13 variants are also supported. The name needed for instantiating has the form
14 'slave-<type>[ro]'. Examples follow:
15
16 24c02, read/write, address 0x64:
17 # echo slave-24c02 0x1064 > /sys/bus/i2c/devices/i2c-1/new_device
18
19 24c512, read-only, address 0x42:
20 # echo slave-24c512ro 0x1042 > /sys/bus/i2c/devices/i2c-1/new_device
21
22 You can also preload data during boot if a device-property named
23 'firmware-name' contains a valid filename (DT or ACPI only).
24
25 As of 2015, Linux doesn't support poll on binary sysfs files, so there is no
26 notification when another master changed the content.
27

3. 한국어 전문 번역

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

I2C 슬레이브 EEPROM 백엔드

1-14

이 문서는 Wolfram Sang이 2014~2020년에 작성했습니다. 이 백엔드는 연결된 I2C 버스에서 EEPROM을 모사합니다.

메모리 내용은 사용자 공간에서 sysfs 파일 `/sys/bus/i2c/devices/<device-directory>/slave-eeprom`을 통해 접근할 수 있습니다.

지원 유형은 `24c02`, `24c32`, `24c64`, `24c512`이며 읽기 전용 변형도 지원합니다. 장치 생성에 필요한 이름 형식은 `slave-<type>[ro]`입니다.

슬레이브 EEPROM 유형
유형읽기·쓰기 이름읽기 전용 이름
24c02`slave-24c02``slave-24c02ro`
24c32`slave-24c32``slave-24c32ro`
24c64`slave-24c64``slave-24c64ro`
24c512`slave-24c512``slave-24c512ro`

지원 용량 유형과 이름 규칙입니다.

EEPROM 메모리 접근
슬레이브 EEPROM 백엔드 생성외부 I2C 마스터가 EEPROM 프로토콜로 접근백엔드 메모리 내용 변경사용자 공간이 `slave-eeprom` sysfs 파일 읽기·쓰기

외부 마스터와 사용자 공간이 같은 모사 메모리를 사용합니다.

==============================
Linux I2C slave EEPROM backend
==============================

by Wolfram Sang <[email protected]> in 2014-20

This backend simulates an EEPROM on the connected I2C bus. Its memory contents
can be accessed from userspace via this file located in sysfs::

        /sys/bus/i2c/devices/<device-directory>/slave-eeprom

The following types are available: 24c02, 24c32, 24c64, and 24c512. Read-only
variants are also supported. The name needed for instantiating has the form
'slave-<type>[ro]'. Examples follow:

장치 생성과 부팅 시 데이터 적재

15-26

읽기·쓰기 가능한 `24c02`를 주소 `0x64`에 만들려면 `echo slave-24c02 0x1064 > /sys/bus/i2c/devices/i2c-1/new_device`를 사용합니다.

읽기 전용 `24c512`를 주소 `0x42`에 만들려면 `echo slave-24c512ro 0x1042 > /sys/bus/i2c/devices/i2c-1/new_device`를 사용합니다.

Device Tree 또는 ACPI에서 `firmware-name` 장치 속성에 유효한 파일 이름을 지정하면 부팅 중 데이터를 미리 적재할 수도 있습니다.

2015년 기준 Linux는 바이너리 sysfs 파일의 `poll`을 지원하지 않으므로 다른 마스터가 내용을 바꾸어도 알림이 발생하지 않습니다.

슬레이브 EEPROM 생성 예
유형모드I2C 주소`new_device` 입력
24c02읽기·쓰기`0x64``slave-24c02 0x1064`
24c512읽기 전용`0x42``slave-24c512ro 0x1042`

유형, 접근 모드, 주소와 sysfs 입력을 보존합니다.

데이터 적재와 변경 감지
기능지원
부팅 시 사전 적재DT·ACPI의 `firmware-name`으로 지원
다른 마스터 변경 알림바이너리 sysfs의 poll 미지원으로 제공되지 않음

초기 내용과 런타임 알림의 제약입니다.


24c02, read/write, address 0x64:
  # echo slave-24c02 0x1064 > /sys/bus/i2c/devices/i2c-1/new_device

24c512, read-only, address 0x42:
  # echo slave-24c512ro 0x1042 > /sys/bus/i2c/devices/i2c-1/new_device

You can also preload data during boot if a device-property named
'firmware-name' contains a valid filename (DT or ACPI only).

As of 2015, Linux doesn't support poll on binary sysfs files, so there is no
notification when another master changed the content.