← Documents Documentation/networking/device_drivers/ethernet/davicom/dm9000.rst GitHub 원문 ↗

Linux 6.18.37 · Networking

DM9000 Network driver

DM9000E/A/B platform device의 주소·데이터·IRQ 자원 순서, I/O 폭과 PHY·EEPROM 플래그, 내부·외부 PHY 링크 폴링을 설명합니다.

Source pathDocumentation/networking/device_drivers/ethernet/davicom/dm9000.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

dm9000.rst:1-171

이 문서의 핵심은 platform device 자원 배열의 순서가 ABI처럼 중요하다는 점입니다. 주소 레지스터, 데이터 레지스터, IRQ 순서를 지켜야 하며 IRQ 트리거 속성도 자원 플래그에 명시해야 합니다. platform data는 실제 보드 배선과 PHY 구성을 드라이버에 전달합니다.

지원 칩
위치주요 차이
DM9000E최초 지원기본 기능
DM9000A후속PHY 변화 IRQ·체크섬 기능
DM9000B후속PHY 변화 IRQ·체크섬 기능

하나의 드라이버가 세 DM9000 변형을 다룹니다.

필수 자원 순서
resource[0]주소 레지스터resource[1]데이터 레지스터resource[2]IRQ

드라이버가 배열 위치로 주소 영역의 의미를 구분합니다.

IRQ 등록
단계
자원`IORESOURCE_IRQ`
트리거`IORESOURCE_IRQ_HIGHLEVEL`
등록 함수`request_irq()`
누락 결과경고 발생

자원 플래그의 트리거 정보가 IRQ 설정으로 이어집니다.

Platform data 연결
`dm9000_plat_data`플래그 설정`platform_device.dev``platform_data` 포인터드라이버 probe

보드별 추가 정보는 장치의 `.dev.platform_data`로 전달합니다.

I/O 폭 플래그
플래그I/O 연산
`DM9000_PLATF_8BITONLY`8비트
`DM9000_PLATF_16BITONLY`16비트
`DM9000_PLATF_32BITONLY`32비트

보드 버스에 맞는 단일 접근 폭을 지정합니다.

장치 구성 플래그
플래그의미
`DM9000_PLATF_EXT_PHY`외부 PHY 연결
`DM9000_PLATF_NO_EEPROM`EEPROM 없음 또는 숨김
`DM9000_PLATF_SIMPLE_PHY`단순 내부 PHY 폴링

PHY와 EEPROM의 실제 연결 상태를 설명합니다.

내부 PHY 기본 경로
내부 PHY상태 변화 IRQ 지원?지원: 변화 시 MII 읽기미지원: 2초마다 MII 읽기

칩 기능에 따라 상태 변화 IRQ 또는 2초 타이머를 사용합니다.

단순 PHY 폴링
방식장점제약
MII 상태 읽기상세 정보접근 비용 큼
단순 NSR 폴링더 빠름정보가 적음
적용 대상내부 PHY외부 PHY에는 사용 불가

비용과 진단 정보량 사이의 선택입니다.

외부 PHY 경로
외부 PHY변화 IRQ 없음MII 링크 폴링carrier 갱신

링크 변화 IRQ를 받을 수 없어 MII 상태를 계속 확인합니다.

후속 칩 기능
기능DM9000A/B 칩당시 드라이버
내부 PHY 변화 IRQ지원활용 가능
주기 폴링 중단가능내부 PHY에서 가능
TCP/UDP 체크섬 오프로딩지원미지원

실리콘 기능과 당시 드라이버 지원 여부를 구분합니다.

ethtool 범위
대상접근
드라이버 상태ethtool
PHY 상태ethtool
EEPROMethtool

사용자 공간에서 조회할 수 있는 상태입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 =====================
4 DM9000 Network driver
5 =====================
6
7 Copyright 2008 Simtec Electronics,
8
10
11
12 Introduction
13 ------------
14
15 This file describes how to use the DM9000 platform-device based network driver
16 that is contained in the files drivers/net/dm9000.c and drivers/net/dm9000.h.
17
18 The driver supports three DM9000 variants, the DM9000E which is the first chip
19 supported as well as the newer DM9000A and DM9000B devices. It is currently
20 maintained and tested by Ben Dooks, who should be CC: to any patches for this
21 driver.
22
23
24 Defining the platform device
25 ----------------------------
26
27 The minimum set of resources attached to the platform device are as follows:
28
29 1) The physical address of the address register
30 2) The physical address of the data register
31 3) The IRQ line the device's interrupt pin is connected to.
32
33 These resources should be specified in that order, as the ordering of the
34 two address regions is important (the driver expects these to be address
35 and then data).
36
37 An example from arch/arm/mach-s3c/mach-bast.c is::
38
39 static struct resource bast_dm9k_resource[] = {
40 [0] = {
41 .start = S3C2410_CS5 + BAST_PA_DM9000,
42 .end = S3C2410_CS5 + BAST_PA_DM9000 + 3,
43 .flags = IORESOURCE_MEM,
44 },
45 [1] = {
46 .start = S3C2410_CS5 + BAST_PA_DM9000 + 0x40,
47 .end = S3C2410_CS5 + BAST_PA_DM9000 + 0x40 + 0x3f,
48 .flags = IORESOURCE_MEM,
49 },
50 [2] = {
51 .start = IRQ_DM9000,
52 .end = IRQ_DM9000,
53 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
54 }
55 };
56
57 static struct platform_device bast_device_dm9k = {
58 .name = "dm9000",
59 .id = 0,
60 .num_resources = ARRAY_SIZE(bast_dm9k_resource),
61 .resource = bast_dm9k_resource,
62 };
63
64 Note the setting of the IRQ trigger flag in bast_dm9k_resource[2].flags,
65 as this will generate a warning if it is not present. The trigger from
66 the flags field will be passed to request_irq() when registering the IRQ
67 handler to ensure that the IRQ is setup correctly.
68
69 This shows a typical platform device, without the optional configuration
70 platform data supplied. The next example uses the same resources, but adds
71 the optional platform data to pass extra configuration data::
72
73 static struct dm9000_plat_data bast_dm9k_platdata = {
74 .flags = DM9000_PLATF_16BITONLY,
75 };
76
77 static struct platform_device bast_device_dm9k = {
78 .name = "dm9000",
79 .id = 0,
80 .num_resources = ARRAY_SIZE(bast_dm9k_resource),
81 .resource = bast_dm9k_resource,
82 .dev = {
83 .platform_data = &bast_dm9k_platdata,
84 }
85 };
86
87 The platform data is defined in include/linux/dm9000.h and described below.
88
89
90 Platform data
91 -------------
92
93 Extra platform data for the DM9000 can describe the IO bus width to the
94 device, whether or not an external PHY is attached to the device and
95 the availability of an external configuration EEPROM.
96
97 The flags for the platform data .flags field are as follows:
98
99 DM9000_PLATF_8BITONLY
100
101 The IO should be done with 8bit operations.
102
103 DM9000_PLATF_16BITONLY
104
105 The IO should be done with 16bit operations.
106
107 DM9000_PLATF_32BITONLY
108
109 The IO should be done with 32bit operations.
110
111 DM9000_PLATF_EXT_PHY
112
113 The chip is connected to an external PHY.
114
115 DM9000_PLATF_NO_EEPROM
116
117 This can be used to signify that the board does not have an
118 EEPROM, or that the EEPROM should be hidden from the user.
119
120 DM9000_PLATF_SIMPLE_PHY
121
122 Switch to using the simpler PHY polling method which does not
123 try and read the MII PHY state regularly. This is only available
124 when using the internal PHY. See the section on link state polling
125 for more information.
126
127 The config symbol DM9000_FORCE_SIMPLE_PHY_POLL, Kconfig entry
128 "Force simple NSR based PHY polling" allows this flag to be
129 forced on at build time.
130
131
132 PHY Link state polling
133 ----------------------
134
135 The driver keeps track of the link state and informs the network core
136 about link (carrier) availability. This is managed by several methods
137 depending on the version of the chip and on which PHY is being used.
138
139 For the internal PHY, the original (and currently default) method is
140 to read the MII state, either when the status changes if we have the
141 necessary interrupt support in the chip or every two seconds via a
142 periodic timer.
143
144 To reduce the overhead for the internal PHY, there is now the option
145 of using the DM9000_FORCE_SIMPLE_PHY_POLL config, or DM9000_PLATF_SIMPLE_PHY
146 platform data option to read the summary information without the
147 expensive MII accesses. This method is faster, but does not print
148 as much information.
149
150 When using an external PHY, the driver currently has to poll the MII
151 link status as there is no method for getting an interrupt on link change.
152
153
154 DM9000A / DM9000B
155 -----------------
156
157 These chips are functionally similar to the DM9000E and are supported easily
158 by the same driver. The features are:
159
160 1) Interrupt on internal PHY state change. This means that the periodic
161 polling of the PHY status may be disabled on these devices when using
162 the internal PHY.
163
164 2) TCP/UDP checksum offloading, which the driver does not currently support.
165
166
167 ethtool
168 -------
169
170 The driver supports the ethtool interface for access to the driver
171 state information, the PHY state and the EEPROM.
172

3. 한국어 전문 번역

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

드라이버 소개와 지원 칩

1-23

DM9000 네트워크 드라이버

Copyright 2008 Simtec Electronics

Ben Dooks <[email protected]> <[email protected]>

소개

이 문서는 `drivers/net/dm9000.c`와 `drivers/net/dm9000.h`에 들어 있는 platform device 기반 DM9000 네트워크 드라이버를 사용하는 방법을 설명합니다.

드라이버는 처음 지원한 DM9000E와 이후의 DM9000A, DM9000B까지 세 가지 변형을 지원합니다. 당시 Ben Dooks가 드라이버를 관리하고 시험했으며 이 드라이버의 패치를 보낼 때 참조(`CC`)에 포함해야 합니다.

.. SPDX-License-Identifier: GPL-2.0

=====================
DM9000 Network driver
=====================

Copyright 2008 Simtec Electronics,

          Ben Dooks <[email protected]> <[email protected]>


Introduction
------------

This file describes how to use the DM9000 platform-device based network driver
that is contained in the files drivers/net/dm9000.c and drivers/net/dm9000.h.

The driver supports three DM9000 variants, the DM9000E which is the first chip
supported as well as the newer DM9000A and DM9000B devices. It is currently
maintained and tested by Ben Dooks, who should be CC: to any patches for this
driver.

platform device 자원과 구성 데이터

24-89

platform device 정의

platform device에 연결해야 하는 최소 자원은 다음과 같습니다.

  • 1. 주소 레지스터의 물리 주소
  • 2. 데이터 레지스터의 물리 주소
  • 3. 장치 인터럽트 핀이 연결된 IRQ 선

자원은 반드시 이 순서로 지정해야 합니다. 두 주소 영역의 순서가 중요하며 드라이버는 첫 번째 영역을 주소 레지스터, 두 번째 영역을 데이터 레지스터로 해석합니다.

`arch/arm/mach-s3c/mach-bast.c`의 예

static struct resource bast_dm9k_resource[] = {
        [0] = {
                .start = S3C2410_CS5 + BAST_PA_DM9000,
                .end   = S3C2410_CS5 + BAST_PA_DM9000 + 3,
                .flags = IORESOURCE_MEM,
        },
        [1] = {
                .start = S3C2410_CS5 + BAST_PA_DM9000 + 0x40,
                .end   = S3C2410_CS5 + BAST_PA_DM9000 + 0x40 + 0x3f,
                .flags = IORESOURCE_MEM,
        },
        [2] = {
                .start = IRQ_DM9000,
                .end   = IRQ_DM9000,
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
        }
};

static struct platform_device bast_device_dm9k = {
        .name           = "dm9000",
        .id             = 0,
        .num_resources  = ARRAY_SIZE(bast_dm9k_resource),
        .resource       = bast_dm9k_resource,
};

`bast_dm9k_resource[2].flags`의 IRQ 트리거 플래그를 확인하십시오. 플래그가 없으면 경고가 발생합니다. `flags` 필드의 트리거 값은 IRQ 핸들러를 등록할 때 `request_irq()`에 전달되어 IRQ가 올바르게 설정되게 합니다.

위 예는 선택적 platform data를 제공하지 않은 일반적인 platform device입니다. 다음 예는 같은 자원을 사용하면서 추가 구성 정보를 전달할 선택적 platform data를 더합니다.

static struct dm9000_plat_data bast_dm9k_platdata = {
        .flags          = DM9000_PLATF_16BITONLY,
};

static struct platform_device bast_device_dm9k = {
        .name           = "dm9000",
        .id             = 0,
        .num_resources  = ARRAY_SIZE(bast_dm9k_resource),
        .resource       = bast_dm9k_resource,
        .dev            = {
                .platform_data = &bast_dm9k_platdata,
        }
};

platform data는 `include/linux/dm9000.h`에 정의되어 있으며 다음 절에서 설명합니다.

Defining the platform device
----------------------------

The minimum set of resources attached to the platform device are as follows:

    1) The physical address of the address register
    2) The physical address of the data register
    3) The IRQ line the device's interrupt pin is connected to.

These resources should be specified in that order, as the ordering of the
two address regions is important (the driver expects these to be address
and then data).

An example from arch/arm/mach-s3c/mach-bast.c is::

  static struct resource bast_dm9k_resource[] = {
        [0] = {
                .start = S3C2410_CS5 + BAST_PA_DM9000,
                .end   = S3C2410_CS5 + BAST_PA_DM9000 + 3,
                .flags = IORESOURCE_MEM,
        },
        [1] = {
                .start = S3C2410_CS5 + BAST_PA_DM9000 + 0x40,
                .end   = S3C2410_CS5 + BAST_PA_DM9000 + 0x40 + 0x3f,
                .flags = IORESOURCE_MEM,
        },
        [2] = {
                .start = IRQ_DM9000,
                .end   = IRQ_DM9000,
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
        }
  };

  static struct platform_device bast_device_dm9k = {
        .name                = "dm9000",
        .id                = 0,
        .num_resources        = ARRAY_SIZE(bast_dm9k_resource),
        .resource        = bast_dm9k_resource,
  };

Note the setting of the IRQ trigger flag in bast_dm9k_resource[2].flags,
as this will generate a warning if it is not present. The trigger from
the flags field will be passed to request_irq() when registering the IRQ
handler to ensure that the IRQ is setup correctly.

This shows a typical platform device, without the optional configuration
platform data supplied. The next example uses the same resources, but adds
the optional platform data to pass extra configuration data::

  static struct dm9000_plat_data bast_dm9k_platdata = {
        .flags                = DM9000_PLATF_16BITONLY,
  };

  static struct platform_device bast_device_dm9k = {
        .name                = "dm9000",
        .id                = 0,
        .num_resources        = ARRAY_SIZE(bast_dm9k_resource),
        .resource        = bast_dm9k_resource,
        .dev                = {
                .platform_data = &bast_dm9k_platdata,
        }
  };

The platform data is defined in include/linux/dm9000.h and described below.

platform data 플래그

90-131

Platform data

DM9000의 추가 platform data는 장치의 I/O 버스 폭, 외부 PHY 연결 여부와 외부 구성 EEPROM 사용 가능 여부를 나타낼 수 있습니다.

platform data의 `.flags` 필드에 사용할 수 있는 플래그는 다음과 같습니다.

`DM9000_PLATF_8BITONLY`

I/O를 8비트 연산으로 수행합니다.

`DM9000_PLATF_16BITONLY`

I/O를 16비트 연산으로 수행합니다.

`DM9000_PLATF_32BITONLY`

I/O를 32비트 연산으로 수행합니다.

`DM9000_PLATF_EXT_PHY`

칩이 외부 PHY에 연결되어 있음을 나타냅니다.

`DM9000_PLATF_NO_EEPROM`

보드에 EEPROM이 없거나 사용자에게 EEPROM을 숨겨야 함을 나타낼 때 사용합니다.

`DM9000_PLATF_SIMPLE_PHY`

MII PHY 상태를 주기적으로 읽지 않는 단순 PHY 폴링 방식으로 전환합니다. 내부 PHY를 사용할 때만 쓸 수 있습니다. 자세한 내용은 링크 상태 폴링 절을 참조하십시오.

Kconfig 항목 `Force simple NSR based PHY polling`에 해당하는 `DM9000_FORCE_SIMPLE_PHY_POLL` 구성 심볼을 사용하면 빌드 시 이 플래그를 강제로 활성화할 수 있습니다.

Platform data
-------------

Extra platform data for the DM9000 can describe the IO bus width to the
device, whether or not an external PHY is attached to the device and
the availability of an external configuration EEPROM.

The flags for the platform data .flags field are as follows:

DM9000_PLATF_8BITONLY

        The IO should be done with 8bit operations.

DM9000_PLATF_16BITONLY

        The IO should be done with 16bit operations.

DM9000_PLATF_32BITONLY

        The IO should be done with 32bit operations.

DM9000_PLATF_EXT_PHY

        The chip is connected to an external PHY.

DM9000_PLATF_NO_EEPROM

        This can be used to signify that the board does not have an
        EEPROM, or that the EEPROM should be hidden from the user.

DM9000_PLATF_SIMPLE_PHY

        Switch to using the simpler PHY polling method which does not
        try and read the MII PHY state regularly. This is only available
        when using the internal PHY. See the section on link state polling
        for more information.

        The config symbol DM9000_FORCE_SIMPLE_PHY_POLL, Kconfig entry
        "Force simple NSR based PHY polling" allows this flag to be
        forced on at build time.

DM9000A·DM9000B 기능과 ethtool

154-171

DM9000A / DM9000B

이 칩들은 기능상 DM9000E와 유사하며 같은 드라이버로 쉽게 지원할 수 있습니다. 추가 기능은 다음과 같습니다.

  • 1. 내부 PHY 상태 변화 인터럽트: 내부 PHY를 사용할 때 이 장치에서는 주기적인 PHY 상태 폴링을 비활성화할 수 있습니다.
  • 2. TCP/UDP 체크섬 오프로딩: 당시 드라이버는 이 기능을 지원하지 않았습니다.

ethtool

드라이버는 드라이버 상태 정보, PHY 상태와 EEPROM에 접근할 수 있도록 ethtool 인터페이스를 지원합니다.

DM9000A / DM9000B
-----------------

These chips are functionally similar to the DM9000E and are supported easily
by the same driver. The features are:

   1) Interrupt on internal PHY state change. This means that the periodic
      polling of the PHY status may be disabled on these devices when using
      the internal PHY.

   2) TCP/UDP checksum offloading, which the driver does not currently support.


ethtool
-------

The driver supports the ethtool interface for access to the driver
state information, the PHY state and the EEPROM.