요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
====================
Kernel driver ds2490
====================
Supported chips:
* Maxim DS2490 based
Author: Evgeniy Polyakov <[email protected]>
Description
-----------
The Maxim/Dallas Semiconductor DS2490 is a chip
which allows to build USB <-> W1 bridges.
DS9490(R) is a USB <-> W1 bus master device
which has 0x81 family ID integrated chip and DS2490
low-level operational chip.
Notes and limitations.
- The weak pullup current is a minimum of 0.9mA and maximum of 6.0mA.
- The 5V strong pullup is supported with a minimum of 5.9mA and a
maximum of 30.4 mA. (From DS2490.pdf)
- The hardware will detect when devices are attached to the bus on the
next bus (reset?) operation, however only a message is printed as
the core w1 code doesn't make use of the information. Connecting
one device tends to give multiple new device notifications.
- The number of USB bus transactions could be reduced if w1_reset_send
was added to the API. The name is just a suggestion. It would take
a write buffer and a read buffer (along with sizes) as arguments.
The ds2490 block I/O command supports reset, write buffer, read
buffer, and strong pullup all in one command, instead of the current
1 reset bus, 2 write the match rom command and slave rom id, 3 block
write and read data. The write buffer needs to have the match rom
command and slave rom id prepended to the front of the requested
write buffer, both of which are known to the driver.
- The hardware supports normal, flexible, and overdrive bus
communication speeds, but only the normal is supported.
- The registered w1_bus_master functions don't define error
conditions. If a bus search is in progress and the ds2490 is
removed it can produce a good amount of error output before the bus
search finishes.
- The hardware supports detecting some error conditions, such as
short, alarming presence on reset, and no presence on reset, but the
driver doesn't query those values.
- The ds2490 specification doesn't cover short bulk in reads in
detail, but my observation is if fewer bytes are requested than are
available, the bulk read will return an error and the hardware will
clear the entire bulk in buffer. It would be possible to read the
maximum buffer size to not run into this error condition, only extra
bytes in the buffer is a logic error in the driver. The code should
match reads and writes as well as data sizes. Reads and
writes are serialized and the status verifies that the chip is idle
(and data is available) before the read is executed, so it should
not happen.
- Running x86_64 2.6.24 UHCI under qemu 0.9.0 under x86_64 2.6.22-rc6
with a OHCI controller, ds2490 running in the guest would operate
normally the first time the module was loaded after qemu attached
the ds2490 hardware, but if the module was unloaded, then reloaded
most of the time one of the bulk out or in, and usually the bulk in
would fail. qemu sets a 50ms timeout and the bulk in would timeout
even when the status shows data available. A bulk out write would
show a successful completion, but the ds2490 status register would
show 0 bytes written. Detaching qemu from the ds2490 hardware and
reattaching would clear the problem. usbmon output in the guest and
host did not explain the problem. My guess is a bug in either qemu
or the host OS and more likely the host OS.
03-06-2008 David Fries <[email protected]>
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
DS2490과 DS9490(R)
1-20이 driver는 Maxim DS2490 기반 chip을 지원하며 원 저자는 Evgeniy Polyakov입니다.
DS2490은 USB와 W1을 연결하는 bridge를 만드는 low-level operation chip입니다.
DS9490(R)은 family ID `0x81` integrated chip과 DS2490을 결합한 USB-to-W1 bus master device입니다.
USB adapter 안의 두 역할을 구분합니다.
====================
Kernel driver ds2490
====================
Supported chips:
* Maxim DS2490 based
Author: Evgeniy Polyakov <[email protected]>
Description
-----------
The Maxim/Dallas Semiconductor DS2490 is a chip
which allows to build USB <-> W1 bridges.
DS9490(R) is a USB <-> W1 bus master device
which has 0x81 family ID integrated chip and DS2490
low-level operational chip.
Pull-up과 attach notification
21-33Weak pull-up current는 최소 0.9mA, 최대 6.0mA입니다.
5V strong pull-up은 최소 5.9mA, 최대 30.4mA를 지원하며 이 수치는 DS2490 datasheet에서 가져왔습니다.
Hardware는 다음 bus reset operation에서 device attach를 감지하지만 W1 core가 정보를 사용하지 않아 message만 출력합니다. Device 하나를 연결해도 여러 new-device notification이 발생하는 경향이 있습니다.
Pull-up 종류별 datasheet 전류 범위입니다.
Notes and limitations.
- The weak pullup current is a minimum of 0.9mA and maximum of 6.0mA.
- The 5V strong pullup is supported with a minimum of 5.9mA and a
maximum of 30.4 mA. (From DS2490.pdf)
- The hardware will detect when devices are attached to the bus on the
next bus (reset?) operation, however only a message is printed as
the core w1 code doesn't make use of the information. Connecting
one device tends to give multiple new device notifications.
- The number of USB bus transactions could be reduced if w1_reset_send
was added to the API. The name is just a suggestion. It would take
a write buffer and a read buffer (along with sizes) as arguments.
API·speed·error와 가상화 제약
34-72`w1_reset_send` 같은 API를 추가하면 USB transaction 수를 줄일 수 있습니다. 제안 interface는 write buffer와 read buffer 및 각 크기를 받습니다.
DS2490 block I/O command는 reset, write buffer, read buffer, strong pull-up을 한 command로 수행할 수 있습니다. 현재는 bus reset, Match ROM command와 slave ROM ID write, data block write/read의 세 단계가 필요합니다. Driver가 아는 Match ROM과 ROM ID를 write buffer 앞에 붙이면 통합할 수 있습니다.
Hardware는 normal, flexible, overdrive bus speed를 지원하지만 driver는 normal speed만 지원합니다.
등록된 `w1_bus_master` function은 error condition을 정의하지 않습니다. Bus search 중 DS2490을 제거하면 search가 끝날 때까지 많은 error output이 발생할 수 있습니다.
Hardware는 short, reset 시 alarming presence, reset 시 no presence 같은 오류를 감지할 수 있지만 driver는 이 값을 query하지 않습니다.
Specification은 short bulk-in read를 자세히 설명하지 않습니다. 요청 byte가 available data보다 적으면 bulk read가 error를 반환하고 hardware가 bulk-in buffer 전체를 clear하는 것으로 관찰됐습니다.
Maximum buffer size를 읽어 이 오류를 피할 수 있지만 extra byte는 driver logic error를 뜻합니다. Read/write와 data size가 일치해야 하며 operation은 serialize되고 status가 chip idle과 data availability를 확인하므로 정상적으로는 발생하지 않아야 합니다.
QEMU 0.9.0에서 x86_64 guest kernel 2.6.24 UHCI와 x86_64 host 2.6.22-rc6 OHCI 조합을 시험했을 때, hardware attach 후 첫 module load는 정상이나 unload/reload 뒤 bulk-in 또는 bulk-out, 특히 bulk-in이 자주 실패했습니다.
QEMU의 50ms timeout으로 status가 data available이어도 bulk-in이 timeout됐고, bulk-out completion은 성공이어도 DS2490 status에는 0 byte written이 표시됐습니다. QEMU에서 hardware를 detach·reattach하면 복구됐으며 guest·host usbmon은 원인을 설명하지 못했습니다. 문서는 QEMU 또는 host OS bug로 추정하며 host OS 가능성을 더 높게 봅니다.
지원되지 않거나 노출되지 않는 기능입니다.
현재 세 단계와 hardware 통합 command의 차이입니다.
The ds2490 block I/O command supports reset, write buffer, read
buffer, and strong pullup all in one command, instead of the current
1 reset bus, 2 write the match rom command and slave rom id, 3 block
write and read data. The write buffer needs to have the match rom
command and slave rom id prepended to the front of the requested
write buffer, both of which are known to the driver.
- The hardware supports normal, flexible, and overdrive bus
communication speeds, but only the normal is supported.
- The registered w1_bus_master functions don't define error
conditions. If a bus search is in progress and the ds2490 is
removed it can produce a good amount of error output before the bus
search finishes.
- The hardware supports detecting some error conditions, such as
short, alarming presence on reset, and no presence on reset, but the
driver doesn't query those values.
- The ds2490 specification doesn't cover short bulk in reads in
detail, but my observation is if fewer bytes are requested than are
available, the bulk read will return an error and the hardware will
clear the entire bulk in buffer. It would be possible to read the
maximum buffer size to not run into this error condition, only extra
bytes in the buffer is a logic error in the driver. The code should
match reads and writes as well as data sizes. Reads and
writes are serialized and the status verifies that the chip is idle
(and data is available) before the read is executed, so it should
not happen.
- Running x86_64 2.6.24 UHCI under qemu 0.9.0 under x86_64 2.6.22-rc6
with a OHCI controller, ds2490 running in the guest would operate
normally the first time the module was loaded after qemu attached
the ds2490 hardware, but if the module was unloaded, then reloaded
most of the time one of the bulk out or in, and usually the bulk in
would fail. qemu sets a 50ms timeout and the bulk in would timeout
even when the status shows data available. A bulk out write would
show a successful completion, but the ds2490 status register would
show 0 bytes written. Detaching qemu from the ds2490 hardware and
reattaching would clear the problem. usbmon output in the guest and
host did not explain the problem. My guess is a bug in either qemu
or the host OS and more likely the host OS.
03-06-2008 David Fries <[email protected]>
요약·해설
ds2490.rst:1-72DS2490 USB bridge의 pull-up, block I/O, speed·error·QEMU 제약을 설명합니다.