요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
==============================================
spi_lm70llp : LM70-LLP parport-to-SPI adapter
==============================================
Supported board/chip:
* National Semiconductor LM70 LLP evaluation board
Datasheet: https://www.ti.com/lit/gpn/lm70
Author:
Kaiwan N Billimoria <kaiwan@designergraphix.com>
Description
-----------
This driver provides glue code connecting a National Semiconductor LM70 LLP
temperature sensor evaluation board to the kernel's SPI core subsystem.
This is a SPI master controller driver. It can be used in conjunction with
(layered under) the LM70 logical driver (a "SPI protocol driver").
In effect, this driver turns the parallel port interface on the eval board
into a SPI bus with a single device, which will be driven by the generic
LM70 driver (drivers/hwmon/lm70.c).
Hardware Interfacing
--------------------
The schematic for this particular board (the LM70EVAL-LLP) is
available (on page 4) here:
https://download.datasheets.com/pdfs/documentation/nat/kit&board/lm70llpevalmanual.pdf
The hardware interfacing on the LM70 LLP eval board is as follows:
======== == ========= ==========
Parallel LM70 LLP
Port . Direction JP2 Header
======== == ========= ==========
D0 2 - -
D1 3 --> V+ 5
D2 4 --> V+ 5
D3 5 --> V+ 5
D4 6 --> V+ 5
D5 7 --> nCS 8
D6 8 --> SCLK 3
D7 9 --> SI/O 5
GND 25 - GND 7
Select 13 <-- SI/O 1
======== == ========= ==========
Note that since the LM70 uses a "3-wire" variant of SPI, the SI/SO pin
is connected to both pin D7 (as Master Out) and Select (as Master In)
using an arrangement that lets either the parport or the LM70 pull the
pin low. This can't be shared with true SPI devices, but other 3-wire
devices might share the same SI/SO pin.
The bitbanger routine in this driver (lm70_txrx) is called back from
the bound "hwmon/lm70" protocol driver through its sysfs hook, using a
spi_write_then_read() call. It performs Mode 0 (SPI/Microwire) bitbanging.
The lm70 driver then interprets the resulting digital temperature value
and exports it through sysfs.
A "gotcha": National Semiconductor's LM70 LLP eval board circuit schematic
shows that the SI/O line from the LM70 chip is connected to the base of a
transistor Q1 (and also a pullup, and a zener diode to D7); while the
collector is tied to VCC.
Interpreting this circuit, when the LM70 SI/O line is High (or tristate
and not grounded by the host via D7), the transistor conducts and switches
the collector to zero, which is reflected on pin 13 of the DB25 parport
connector. When SI/O is Low (driven by the LM70 or the host) on the other
hand, the transistor is cut off and the voltage tied to its collector is
reflected on pin 13 as a High level.
So: the getmiso inline routine in this driver takes this fact into account,
inverting the value read at pin 13.
Thanks to
---------
- David Brownell for mentoring the SPI-side driver development.
- Dr.Craig Hollabaugh for the (early) "manual" bitbanging driver version.
- Nadir Billimoria for help interpreting the circuit schematic.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
지원 보드와 드라이버 역할
1-23`spi_lm70llp`는 National Semiconductor LM70 LLP evaluation board를 지원한다. 데이터시트 주소와 저자 Kaiwan N Billimoria의 정보는 원문에 제시되어 있다.
드라이버는 LM70 LLP temperature sensor evaluation board를 커널 SPI core subsystem에 연결하는 glue code를 제공한다. SPI master controller driver이며, 위 계층의 LM70 logical driver인 SPI protocol driver와 함께 사용한다.
결과적으로 evaluation board의 parallel port interface가 장치 하나를 가진 SPI bus가 되고, 일반 LM70 driver `drivers/hwmon/lm70.c`가 그 장치를 구동한다.
병렬 포트 controller와 hwmon protocol driver가 SPI core를 사이에 두고 결합한다.
==============================================
spi_lm70llp : LM70-LLP parport-to-SPI adapter
==============================================
Supported board/chip:
* National Semiconductor LM70 LLP evaluation board
Datasheet: https://www.ti.com/lit/gpn/lm70
Author:
Kaiwan N Billimoria <kaiwan@designergraphix.com>
Description
-----------
This driver provides glue code connecting a National Semiconductor LM70 LLP
temperature sensor evaluation board to the kernel's SPI core subsystem.
This is a SPI master controller driver. It can be used in conjunction with
(layered under) the LM70 logical driver (a "SPI protocol driver").
In effect, this driver turns the parallel port interface on the eval board
into a SPI bus with a single device, which will be driven by the generic
LM70 driver (drivers/hwmon/lm70.c).
LM70EVAL-LLP 하드웨어 배선
24-53LM70EVAL-LLP 회로도는 원문 링크 문서의 4쪽에 있다. 평가 보드의 병렬 포트와 JP2 header 사이 배선은 다음과 같다.
포트 핀, 방향, JP2 신호를 원문 표대로 보존한다.
LM70은 3-wire SPI 변형을 사용하므로 SI/SO pin이 master output인 D7과 master input인 Select 양쪽에 연결된다. 병렬 포트나 LM70 어느 쪽이든 이 pin을 low로 끌어내릴 수 있는 배치다. 진정한 4-wire SPI 장치와는 공유할 수 없지만 다른 3-wire 장치는 같은 SI/SO pin을 공유할 수 있다.
하나의 양방향 신호를 master output과 input 경로에 동시에 연결한다.
Hardware Interfacing
--------------------
The schematic for this particular board (the LM70EVAL-LLP) is
available (on page 4) here:
https://download.datasheets.com/pdfs/documentation/nat/kit&board/lm70llpevalmanual.pdf
The hardware interfacing on the LM70 LLP eval board is as follows:
======== == ========= ==========
Parallel LM70 LLP
Port . Direction JP2 Header
======== == ========= ==========
D0 2 - -
D1 3 --> V+ 5
D2 4 --> V+ 5
D3 5 --> V+ 5
D4 6 --> V+ 5
D5 7 --> nCS 8
D6 8 --> SCLK 3
D7 9 --> SI/O 5
GND 25 - GND 7
Select 13 <-- SI/O 1
======== == ========= ==========
Note that since the LM70 uses a "3-wire" variant of SPI, the SI/SO pin
is connected to both pin D7 (as Master Out) and Select (as Master In)
using an arrangement that lets either the parport or the LM70 pull the
bitbang 전송과 반전된 MISO
54-84드라이버의 bitbanger routine `lm70_txrx`는 bind된 `hwmon/lm70` protocol driver가 sysfs hook에서 `spi_write_then_read()`를 호출할 때 callback된다. Mode 0(SPI/Microwire) bitbanging을 수행하고, LM70 driver가 결과 digital temperature 값을 해석해 sysfs로 내보낸다.
sysfs 요청이 protocol driver와 bitbang controller를 거쳐 센서 값으로 돌아온다.
주의할 회로 특성이 있다. LM70 chip의 SI/O line은 transistor Q1의 base에 연결되고 pullup 및 D7로 향하는 zener diode에도 연결되며, collector는 VCC에 묶여 있다.
SI/O가 High이거나 tristate이고 host가 D7을 통해 ground로 내리지 않으면 transistor가 도통해 collector를 0으로 전환하며, 이 값이 DB25 pin 13에 반영된다. 반대로 SI/O가 LM70 또는 host에 의해 Low로 구동되면 transistor가 차단되고 collector의 전압이 pin 13에 High로 나타난다.
따라서 드라이버의 `getmiso` inline routine은 pin 13에서 읽은 값을 반전한다.
Q1 회로 때문에 센서 신호와 병렬 포트 입력 논리가 반대가 된다.
문서는 SPI 쪽 드라이버 개발을 지도한 David Brownell, 초기 수동 bitbang driver를 만든 Dr. Craig Hollabaugh, 회로도 해석을 도운 Nadir Billimoria에게 감사를 전한다.
pin low. This can't be shared with true SPI devices, but other 3-wire
devices might share the same SI/SO pin.
The bitbanger routine in this driver (lm70_txrx) is called back from
the bound "hwmon/lm70" protocol driver through its sysfs hook, using a
spi_write_then_read() call. It performs Mode 0 (SPI/Microwire) bitbanging.
The lm70 driver then interprets the resulting digital temperature value
and exports it through sysfs.
A "gotcha": National Semiconductor's LM70 LLP eval board circuit schematic
shows that the SI/O line from the LM70 chip is connected to the base of a
transistor Q1 (and also a pullup, and a zener diode to D7); while the
collector is tied to VCC.
Interpreting this circuit, when the LM70 SI/O line is High (or tristate
and not grounded by the host via D7), the transistor conducts and switches
the collector to zero, which is reflected on pin 13 of the DB25 parport
connector. When SI/O is Low (driven by the LM70 or the host) on the other
hand, the transistor is cut off and the voltage tied to its collector is
reflected on pin 13 as a High level.
So: the getmiso inline routine in this driver takes this fact into account,
inverting the value read at pin 13.
Thanks to
---------
- David Brownell for mentoring the SPI-side driver development.
- Dr.Craig Hollabaugh for the (early) "manual" bitbanging driver version.
- Nadir Billimoria for help interpreting the circuit schematic.
요약·해설
spi-lm70llp.rst:1-84LM70 LLP 평가 보드를 병렬 포트 기반 SPI master로 연결하는 배선, 3-wire SI/O, Mode 0 bitbang과 Q1 회로 때문에 MISO를 반전하는 이유를 설명합니다.