← Documents Documentation/i2c/busses/i2c-mlxcpld.rst GitHub 원문 ↗

Linux 6.18.37 · I2C Buses

Driver i2c-mlxcpld

Mellanox 시스템의 Lattice CPLD 기반 I2C 컨트롤러와 레지스터 맵을 설명합니다.

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

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

1. 요약·해설

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

요약·해설

i2c-mlxcpld.rst:1-57

mlxcpld는 단일 물리 버스의 마스터·폴링 컨트롤러이며 `CMD`를 마지막에 기록해 전송을 시작하고 `STATUS`로 완료를 확인합니다.

문서 개요
항목
SourceDocumentation/i2c/busses/i2c-mlxcpld.rst
분량57 source lines
레지스터9 groups
데이터 버퍼68 bytes

원문 분량과 핵심 기능을 요약합니다.

동작 흐름
기능 확인타이밍 설정주소·데이터 준비`CMD`로 시작`STATUS` 폴링

장치 인식부터 기능 제공까지의 순서입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ==================
2 Driver i2c-mlxcpld
3 ==================
4
5 Author: Michael Shych <michaelsh@mellanox.com>
6
7 This is the Mellanox I2C controller logic, implemented in Lattice CPLD
8 device.
9
10 Device supports:
11 - Master mode.
12 - One physical bus.
13 - Polling mode.
14
15 This controller is equipped within the next Mellanox systems:
16 "msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410", "msb7800",
17 "msn2740", "msn2100".
18
19 The next transaction types are supported:
20 - Receive Byte/Block.
21 - Send Byte/Block.
22 - Read Byte/Block.
23 - Write Byte/Block.
24
25 Registers:
26
27 =============== === =======================================================================
28 CPBLTY 0x0 - capability reg.
29 Bits [6:5] - transaction length. b01 - 72B is supported,
30 36B in other case.
31 Bit 7 - SMBus block read support.
32 CTRL 0x1 - control reg.
33 Resets all the registers.
34 HALF_CYC 0x4 - cycle reg.
35 Configure the width of I2C SCL half clock cycle (in 4 LPC_CLK
36 units).
37 I2C_HOLD 0x5 - hold reg.
38 OE (output enable) is delayed by value set to this register
39 (in LPC_CLK units)
40 CMD 0x6 - command reg.
41 Bit 0, 0 = write, 1 = read.
42 Bits [7:1] - the 7bit Address of the I2C device.
43 It should be written last as it triggers an I2C transaction.
44 NUM_DATA 0x7 - data size reg.
45 Number of data bytes to write in read transaction
46 NUM_ADDR 0x8 - address reg.
47 Number of address bytes to write in read transaction.
48 STATUS 0x9 - status reg.
49 Bit 0 - transaction is completed.
50 Bit 4 - ACK/NACK.
51 DATAx 0xa - 0x54 - 68 bytes data buffer regs.
52 For write transaction address is specified in four first bytes
53 (DATA1 - DATA4), data starting from DATA4.
54 For read transactions address is sent in a separate transaction and
55 specified in the four first bytes (DATA0 - DATA3). Data is read
56 starting from DATA0.
57 =============== === =======================================================================
58

3. 한국어 전문 번역

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

Mellanox CPLD I2C 컨트롤러

1-24

`i2c-mlxcpld`는 Lattice CPLD 장치에 구현된 Mellanox I2C 컨트롤러 로직입니다. 작성자는 Michael Shych <michaelsh@mellanox.com>입니다.

장치는 마스터 모드, 물리 버스 하나, 폴링 모드를 지원합니다.

이 컨트롤러는 Mellanox 시스템 `msx6710`, `msx6720`, `msb7700`, `msn2700`, `msx1410`, `msn2410`, `msb7800`, `msn2740`, `msn2100`에 탑재됩니다.

지원 트랜잭션은 Receive Byte/Block, Send Byte/Block, Read Byte/Block, Write Byte/Block입니다.

mlxcpld 기능
구분지원 내용
모드Master mode
물리 버스1개
완료 확인Polling mode
시스템`msx6710`, `msx6720`, `msb7700`, `msn2700`, `msx1410`, `msn2410`, `msb7800`, `msn2740`, `msn2100`
수신Receive Byte / Block
송신Send Byte / Block
읽기Read Byte / Block
쓰기Write Byte / Block

지원 시스템과 전송 유형을 구조화했습니다.

mlxcpld 트랜잭션
CPLD 레지스터 설정주소와 데이터 길이 기록`CMD`를 마지막에 기록해 트랜잭션 시작`STATUS` 폴링ACK/NACK와 데이터 처리

단일 물리 버스에서 마스터가 폴링으로 완료를 확인합니다.

==================
Driver i2c-mlxcpld
==================

Author: Michael Shych <michaelsh@mellanox.com>

This is the Mellanox I2C controller logic, implemented in Lattice CPLD
device.

Device supports:
 - Master mode.
 - One physical bus.
 - Polling mode.

This controller is equipped within the next Mellanox systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410", "msb7800",
"msn2740", "msn2100".

The next transaction types are supported:
 - Receive Byte/Block.
 - Send Byte/Block.
 - Read Byte/Block.
 - Write Byte/Block.

CPLD 레지스터 맵

25-57

`CPBLTY`(`0x0`)는 기능 레지스터입니다. 비트 `[6:5]`는 트랜잭션 길이를 나타내며 `b01`이면 72바이트, 그 밖의 값이면 36바이트를 지원합니다. 비트 7은 SMBus 블록 읽기 지원을 나타냅니다.

`CTRL`(`0x1`)은 모든 레지스터를 재설정하는 제어 레지스터입니다. `HALF_CYC`(`0x4`)는 I2C SCL 반주기 폭을 4 `LPC_CLK` 단위로 설정합니다. `I2C_HOLD`(`0x5`)는 출력 활성화(OE)를 레지스터 값만큼 `LPC_CLK` 단위로 지연합니다.

`CMD`(`0x6`)의 비트 0은 쓰기 0, 읽기 1을 선택하고 비트 `[7:1]`은 I2C 장치의 7비트 주소입니다. 이 레지스터 기록이 I2C 트랜잭션을 시작하므로 반드시 마지막에 써야 합니다.

`NUM_DATA`(`0x7`)는 읽기 트랜잭션에서 쓸 데이터 바이트 수이고, `NUM_ADDR`(`0x8`)는 읽기 트랜잭션에서 쓸 주소 바이트 수입니다. `STATUS`(`0x9`)의 비트 0은 트랜잭션 완료, 비트 4는 ACK/NACK를 나타냅니다.

`DATAx`(`0xa`~`0x54`)는 68바이트 데이터 버퍼 레지스터입니다. 쓰기 트랜잭션의 주소는 처음 네 바이트 `DATA1`~`DATA4`에 두고 데이터는 `DATA4`부터 둡니다. 읽기 트랜잭션에서는 별도 트랜잭션으로 주소를 보내며 처음 네 바이트 `DATA0`~`DATA3`에 지정하고, 읽은 데이터는 `DATA0`부터 시작합니다.

mlxcpld 레지스터
레지스터주소기능
`CPBLTY``0x0``[6:5]`: 72B(`b01`) 또는 36B, bit 7: SMBus block read
`CTRL``0x1`모든 레지스터 재설정
`HALF_CYC``0x4`SCL 반주기 폭, 4 `LPC_CLK` 단위
`I2C_HOLD``0x5`OE 지연, `LPC_CLK` 단위
`CMD``0x6`bit 0: write/read, `[7:1]`: 7-bit 주소, 마지막 기록
`NUM_DATA``0x7`읽기 트랜잭션에서 쓸 데이터 바이트 수
`NUM_ADDR``0x8`읽기 트랜잭션에서 쓸 주소 바이트 수
`STATUS``0x9`bit 0: 완료, bit 4: ACK/NACK
`DATAx``0xa`~`0x54`68바이트 데이터 버퍼

원문의 ASCII 레지스터 표를 같은 의미의 구조화 표로 다시 그렸습니다.

mlxcpld 레지스터 순서
`CPBLTY`로 길이와 block read 확인`HALF_CYC`와 `I2C_HOLD` 설정`DATAx`, `NUM_DATA`, `NUM_ADDR` 준비`CMD`를 마지막에 기록`STATUS`의 완료와 ACK/NACK 폴링

`CMD` 기록이 전송을 촉발한다는 제약을 보존합니다.

Registers:

=============== === =======================================================================
CPBLTY                0x0 - capability reg.
                        Bits [6:5] - transaction length. b01 - 72B is supported,
                        36B in other case.
                        Bit 7 - SMBus block read support.
CTRL                0x1 - control reg.
                        Resets all the registers.
HALF_CYC        0x4 - cycle reg.
                        Configure the width of I2C SCL half clock cycle (in 4 LPC_CLK
                        units).
I2C_HOLD        0x5 - hold reg.
                        OE (output enable) is delayed by value set to this register
                        (in LPC_CLK units)
CMD                        0x6 - command reg.
                        Bit 0, 0 = write, 1 = read.
                        Bits [7:1] - the 7bit Address of the I2C device.
                        It should be written last as it triggers an I2C transaction.
NUM_DATA        0x7 - data size reg.
                        Number of data bytes to write in read transaction
NUM_ADDR        0x8 - address reg.
                        Number of address bytes to write in read transaction.
STATUS                0x9 - status reg.
                        Bit 0 - transaction is completed.
                        Bit 4 - ACK/NACK.
DATAx                0xa - 0x54  - 68 bytes data buffer regs.
                        For write transaction address is specified in four first bytes
                        (DATA1 - DATA4), data starting from DATA4.
                        For read transactions address is sent in a separate transaction and
                        specified in the four first bytes (DATA0 - DATA3). Data is read
                        starting from DATA0.
=============== === =======================================================================