← Documents Documentation/w1/masters/ds2490.rst GitHub 원문 ↗

Linux 6.18.37 · 1-Wire / Master

Kernel driver ds2490

DS2490 USB bridge의 pull-up, block I/O, speed·error·QEMU 제약을 설명합니다.

Source pathDocumentation/w1/masters/ds2490.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

ds2490.rst:1-72

DS2490 USB bridge의 pull-up, block I/O, speed·error·QEMU 제약을 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ====================
2 Kernel driver ds2490
3 ====================
4
5 Supported chips:
6
7 * Maxim DS2490 based
8
9 Author: Evgeniy Polyakov <[email protected]>
10
11
12 Description
13 -----------
14
15 The Maxim/Dallas Semiconductor DS2490 is a chip
16 which allows to build USB <-> W1 bridges.
17
18 DS9490(R) is a USB <-> W1 bus master device
19 which has 0x81 family ID integrated chip and DS2490
20 low-level operational chip.
21
22 Notes and limitations.
23
24 - The weak pullup current is a minimum of 0.9mA and maximum of 6.0mA.
25 - The 5V strong pullup is supported with a minimum of 5.9mA and a
26 maximum of 30.4 mA. (From DS2490.pdf)
27 - The hardware will detect when devices are attached to the bus on the
28 next bus (reset?) operation, however only a message is printed as
29 the core w1 code doesn't make use of the information. Connecting
30 one device tends to give multiple new device notifications.
31 - The number of USB bus transactions could be reduced if w1_reset_send
32 was added to the API. The name is just a suggestion. It would take
33 a write buffer and a read buffer (along with sizes) as arguments.
34 The ds2490 block I/O command supports reset, write buffer, read
35 buffer, and strong pullup all in one command, instead of the current
36 1 reset bus, 2 write the match rom command and slave rom id, 3 block
37 write and read data. The write buffer needs to have the match rom
38 command and slave rom id prepended to the front of the requested
39 write buffer, both of which are known to the driver.
40 - The hardware supports normal, flexible, and overdrive bus
41 communication speeds, but only the normal is supported.
42 - The registered w1_bus_master functions don't define error
43 conditions. If a bus search is in progress and the ds2490 is
44 removed it can produce a good amount of error output before the bus
45 search finishes.
46 - The hardware supports detecting some error conditions, such as
47 short, alarming presence on reset, and no presence on reset, but the
48 driver doesn't query those values.
49 - The ds2490 specification doesn't cover short bulk in reads in
50 detail, but my observation is if fewer bytes are requested than are
51 available, the bulk read will return an error and the hardware will
52 clear the entire bulk in buffer. It would be possible to read the
53 maximum buffer size to not run into this error condition, only extra
54 bytes in the buffer is a logic error in the driver. The code should
55 match reads and writes as well as data sizes. Reads and
56 writes are serialized and the status verifies that the chip is idle
57 (and data is available) before the read is executed, so it should
58 not happen.
59 - Running x86_64 2.6.24 UHCI under qemu 0.9.0 under x86_64 2.6.22-rc6
60 with a OHCI controller, ds2490 running in the guest would operate
61 normally the first time the module was loaded after qemu attached
62 the ds2490 hardware, but if the module was unloaded, then reloaded
63 most of the time one of the bulk out or in, and usually the bulk in
64 would fail. qemu sets a 50ms timeout and the bulk in would timeout
65 even when the status shows data available. A bulk out write would
66 show a successful completion, but the ds2490 status register would
67 show 0 bytes written. Detaching qemu from the ds2490 hardware and
68 reattaching would clear the problem. usbmon output in the guest and
69 host did not explain the problem. My guess is a bug in either qemu
70 or the host OS and more likely the host OS.
71
72 03-06-2008 David Fries <[email protected]>
73

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입니다.

DS2490 계층
Component역할
DS2490USB ↔ W1 low-level operation
DS9490(R)USB ↔ W1 bus master device
Family ID0x81 integrated chip
DriverLinux W1 master interface

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-33

Weak 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이 발생하는 경향이 있습니다.

DS2490 electrical limits
기능최소최대
Weak pull-up0.9mA6.0mA
5V strong pull-up5.9mA30.4mA

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 가능성을 더 높게 봅니다.

DS2490 limitation
영역HardwareDriver 상태
Bus speednormal/flexible/overdrivenormal만 지원
Error detectionshort/presence conditionQuery하지 않음
Attach detection다음 reset에서 감지Message만 출력
Master API errors오류 가능w1_bus_master contract 없음
Bulk short readBuffer 전체 clear 가능Size 일치 필요
USB operationReset+write+read+pull-up 통합 가능현재 여러 transaction

지원되지 않거나 노출되지 않는 기능입니다.

제안된 block I/O
Bus resetMatch ROM + slave ROM ID writeRequested data write/read제안: driver가 ROM prefix를 buffer 앞에 추가DS2490 block command 하나로 reset·I/O·pull-up 수행

현재 세 단계와 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]>