← Documents Documentation/ABI/testing/sysfs-bus-cdx GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

CDX bus and device sysfs ABI

CDX bus rescan·enable, device identity와 modalias, reset·remove lifecycle, FPGA update coordination, userspace-mappable memory resources를 설명합니다.

Source pathDocumentation/ABI/testing/sysfs-bus-cdx
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

CDX bus rescan

sysfs-bus-cdx:1-12

rescan에 y·1·on을 쓰면 CDX bus와 devices를 다시 scan하여 새 device를 Linux에 추가하고 제거된 device를 삭제합니다.

Vendor와 device IDs

sysfs-bus-cdx:14-29

vendor와 device는 hexadecimal 16-bit identifiers이며 manufacturer 범위 안에서 그 조합으로 device를 식별합니다.

Subsystem IDs, class와 revision

sysfs-bus-cdx:31-59

Subsystem vendor/device는 card manufacturer별 16-bit IDs이고 class는 24-bit functionality, revision은 8-bit revision identifier입니다.

FPGA update 전 bus enable control

sysfs-bus-cdx:61-72

enable은 FPGA device update 전에 CDX bus를 disable하고 이후 enable하며 read 시 current 0/1 state를 제공합니다.

Device reset과 hardware reconfiguration remove

sysfs-bus-cdx:74-99

reset은 device 또는 bus devices를 reset하며 driver에 전후 두 번 알리고, remove는 hardware reconfiguration 중 driver access를 막기 위해 device를 bus에서 제거합니다.

Memory resource와 CDX modalias

sysfs-bus-cdx:101-121

resource<N>은 userspace mmap이 가능한 memory-region binary file이고 modalias는 vendor·device·subsystem·class를 CDX ID string으로 결합합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 What: /sys/bus/cdx/rescan
2 Date: March 2023
3 Contact: nipun.gupta@amd.com
4 Description:
5 Writing y/1/on to this file will cause rescan of the bus
6 and devices on the CDX bus. Any new devices are scanned and
7 added to the list of Linux devices and any devices removed are
8 also deleted from Linux.
9
10 For example::
11
12 # echo 1 > /sys/bus/cdx/rescan
13
14 What: /sys/bus/cdx/devices/.../vendor
15 Date: March 2023
16 Contact: nipun.gupta@amd.com
17 Description:
18 Vendor ID for this CDX device, in hexadecimal. Vendor ID is
19 16 bit identifier which is specific to the device manufacturer.
20 Combination of Vendor ID and Device ID identifies a device.
21
22 What: /sys/bus/cdx/devices/.../device
23 Date: March 2023
24 Contact: nipun.gupta@amd.com
25 Description:
26 Device ID for this CDX device, in hexadecimal. Device ID is
27 16 bit identifier to identify a device type within the range
28 of a device manufacturer.
29 Combination of Vendor ID and Device ID identifies a device.
30
31 What: /sys/bus/cdx/devices/.../subsystem_vendor
32 Date: July 2023
33 Contact: puneet.gupta@amd.com
34 Description:
35 Subsystem Vendor ID for this CDX device, in hexadecimal.
36 Subsystem Vendor ID is 16 bit identifier specific to the
37 card manufacturer.
38
39 What: /sys/bus/cdx/devices/.../subsystem_device
40 Date: July 2023
41 Contact: puneet.gupta@amd.com
42 Description:
43 Subsystem Device ID for this CDX device, in hexadecimal
44 Subsystem Device ID is 16 bit identifier specific to the
45 card manufacturer.
46
47 What: /sys/bus/cdx/devices/.../class
48 Date: July 2023
49 Contact: puneet.gupta@amd.com
50 Description:
51 This file contains the class of the CDX device, in hexadecimal.
52 Class is 24 bit identifier specifies the functionality of the device.
53
54 What: /sys/bus/cdx/devices/.../revision
55 Date: July 2023
56 Contact: puneet.gupta@amd.com
57 Description:
58 This file contains the revision field of the CDX device, in hexadecimal.
59 Revision is 8 bit revision identifier of the device.
60
61 What: /sys/bus/cdx/devices/.../enable
62 Date: October 2023
63 Contact: abhijit.gangurde@amd.com
64 Description:
65 CDX bus should be disabled before updating the devices in FPGA.
66 Writing n/0/off will attempt to disable the CDX bus and.
67 writing y/1/on will attempt to enable the CDX bus. Reading this file
68 gives the current state of the bus, 1 for enabled and 0 for disabled.
69
70 For example::
71
72 # echo 1 > /sys/bus/cdx/.../enable
73
74 What: /sys/bus/cdx/devices/.../reset
75 Date: March 2023
76 Contact: nipun.gupta@amd.com
77 Description:
78 Writing y/1/on to this file resets the CDX device or all devices
79 on the bus. On resetting the device, the corresponding driver is
80 notified twice, once before the device is being reset, and again
81 after the reset has been complete.
82
83 For example::
84
85 # echo 1 > /sys/bus/cdx/.../reset
86
87 What: /sys/bus/cdx/devices/.../remove
88 Date: March 2023
89 Contact: tarak.reddy@amd.com
90 Description:
91 Writing y/1/on to this file removes the corresponding
92 device from the CDX bus. If the device is to be reconfigured
93 reconfigured in the Hardware, the device can be removed, so
94 that the device driver does not access the device while it is
95 being reconfigured.
96
97 For example::
98
99 # echo 1 > /sys/bus/cdx/devices/.../remove
100
101 What: /sys/bus/cdx/devices/.../resource<N>
102 Date: July 2023
103 Contact: puneet.gupta@amd.com
104 Description:
105 The resource binary file contains the content of the memory
106 regions. These files can be m'maped from userspace.
107
108 What: /sys/bus/cdx/devices/.../modalias
109 Date: July 2023
110 Contact: nipun.gupta@amd.com
111 Description:
112 This attribute indicates the CDX ID of the device.
113 That is in the format:
114 cdx:vXXXXdXXXXsvXXXXsdXXXXcXXXXXX,
115 where:
116
117 - vXXXX contains the vendor ID;
118 - dXXXX contains the device ID;
119 - svXXXX contains the subsystem vendor ID;
120 - sdXXXX contains the subsystem device ID;
121 - cXXXXXX contains the device class.
122

3. 한국어 전문 번역

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

CDX bus와 device rescan

1-12
항목전문 번역
What/sys/bus/cdx/rescan
Date2023년 3월
Contactnipun.gupta@amd.com
Description이 file에 y, 1 또는 on을 쓰면 CDX bus와 그 bus의 device를 rescan합니다. 새 device를 scan하여 Linux device list에 추가하고, 제거된 device도 Linux에서 삭제합니다.

원문 예시는 다음과 같습니다.

# echo 1 > /sys/bus/cdx/rescan

CDX vendor와 device identifiers

14-29
WhatDateContact전문 번역
/sys/bus/cdx/devices/.../vendor2023년 3월nipun.gupta@amd.com이 CDX device의 Vendor ID를 hexadecimal로 나타냅니다. Vendor ID는 device manufacturer별 16-bit identifier입니다. Vendor ID와 Device ID의 조합이 device를 식별합니다.
/sys/bus/cdx/devices/.../device2023년 3월nipun.gupta@amd.com이 CDX device의 Device ID를 hexadecimal로 나타냅니다. Device ID는 device manufacturer 범위 안에서 device type을 식별하는 16-bit identifier입니다. Vendor ID와 Device ID의 조합이 device를 식별합니다.

CDX subsystem, class와 revision fields

31-59
WhatDateContact전문 번역
/sys/bus/cdx/devices/.../subsystem_vendor2023년 7월puneet.gupta@amd.com이 CDX device의 Subsystem Vendor ID를 hexadecimal로 나타냅니다. Subsystem Vendor ID는 card manufacturer별 16-bit identifier입니다.
/sys/bus/cdx/devices/.../subsystem_device2023년 7월puneet.gupta@amd.com이 CDX device의 Subsystem Device ID를 hexadecimal로 나타냅니다. Subsystem Device ID는 card manufacturer별 16-bit identifier입니다.
/sys/bus/cdx/devices/.../class2023년 7월puneet.gupta@amd.com이 file은 CDX device의 class를 hexadecimal로 담습니다. Class는 device functionality를 지정하는 24-bit identifier입니다.
/sys/bus/cdx/devices/.../revision2023년 7월puneet.gupta@amd.com이 file은 CDX device의 revision field를 hexadecimal로 담습니다. Revision은 device의 8-bit revision identifier입니다.
FieldWidthScope
vendor16-bitDevice manufacturer
device16-bitManufacturer 내 device type
subsystem_vendor16-bitCard manufacturer
subsystem_device16-bitCard manufacturer별 subsystem
class24-bitDevice functionality
revision8-bitDevice revision

FPGA update를 위한 CDX bus enable control

61-72
항목전문 번역
What/sys/bus/cdx/devices/.../enable
Date2023년 10월
Contactabhijit.gangurde@amd.com
DescriptionFPGA의 device를 update하기 전에 CDX bus를 disable해야 합니다. n, 0 또는 off를 쓰면 CDX bus disable을 시도하고 y, 1 또는 on을 쓰면 CDX bus enable을 시도합니다. 이 file을 읽으면 bus의 current state를 반환하며 enabled는 1, disabled는 0입니다.
# echo 1 > /sys/bus/cdx/.../enable
CDX FPGA update coordination
CDX bus enabledWrite n, 0 or offCDX bus disabledUpdate devices in FPGAWrite y, 1 or onCDX bus enabled
Read enable1 for enabled0 for disabled

FPGA device configuration을 바꾸는 동안 CDX bus와 drivers의 접근을 제어하는 운영 순서다.

CDX reset notification과 device remove

74-99
WhatDateContact전문 번역
/sys/bus/cdx/devices/.../reset2023년 3월nipun.gupta@amd.com이 file에 y, 1 또는 on을 쓰면 CDX device 또는 bus의 모든 device를 reset합니다. Device를 reset할 때 corresponding driver에 두 번 알립니다. Device reset 전에 한 번, reset 완료 뒤 다시 한 번 알립니다.
/sys/bus/cdx/devices/.../remove2023년 3월tarak.reddy@amd.com이 file에 y, 1 또는 on을 쓰면 corresponding device를 CDX bus에서 제거합니다. Hardware에서 device를 reconfigure해야 한다면 reconfiguration 중 device driver가 해당 device에 access하지 않도록 device를 제거할 수 있습니다.
# echo 1 > /sys/bus/cdx/.../reset
# echo 1 > /sys/bus/cdx/devices/.../remove
CDX device reset과 remove lifecycle
Write resetNotify driver before resetReset deviceNotify driver after completion
Plan hardware reconfigurationWrite removeDevice removed from CDX busDriver cannot access deviceReconfigure hardware

Reset은 driver notification을 전후로 감싸고, remove는 hardware reconfiguration 동안 driver access를 차단한다.

CDX memory resources와 modalias format

101-121
WhatDateContact전문 번역
/sys/bus/cdx/devices/.../resource<N>2023년 7월puneet.gupta@amd.comResource binary file은 memory region의 content를 담습니다. Userspace에서 이 file을 mmap할 수 있습니다.
/sys/bus/cdx/devices/.../modalias2023년 7월nipun.gupta@amd.com이 attribute는 device의 CDX ID를 나타냅니다.
cdx:vXXXXdXXXXsvXXXXsdXXXXcXXXXXX,
Component전문 번역
vXXXXVendor ID를 담습니다.
dXXXXDevice ID를 담습니다.
svXXXXSubsystem Vendor ID를 담습니다.
sdXXXXSubsystem Device ID를 담습니다.
cXXXXXXDevice class를 담습니다.