← Documents Documentation/ABI/testing/sysfs-class-watchdog GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

Watchdog class sysfs ABI

Watchdog boot/internal status, identity·firmware·nowayout, reset timeout·pretimeout governor와 ASPEED alternate-flash access를 설명합니다.

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

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

1. 요약·해설

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

Watchdog identity, state and status

sysfs-class-watchdog:1-54

Watchdog는 boot status, options, firmware, identity, active state와 ioctl-equivalent internal status를 제공하며 nowayout은 한 번 enable하면 disable할 수 없습니다.

Reset and pretimeout control

sysfs-class-watchdog:56-93

Reset까지 남은 시간과 programmed timeout, optional pretimeout interval을 읽고 available governor 중 active pretimeout governor를 선택합니다.

ASPEED alternate-flash mapping recovery

sysfs-class-watchdog:94-129

AST2400/AST2500 WDT2 alternate boot 뒤 access_cs0는 primary flash 접근 또는 normal chip-select mapping 복구를 수행하고 boot selection·timeout counter를 clear합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 What: /sys/class/watchdog/watchdogn/bootstatus
2 Date: August 2015
3 Contact: Wim Van Sebroeck <wim@iguana.be>
4 Description:
5 It is a read only file. It contains status of the watchdog
6 device at boot. It is equivalent to WDIOC_GETBOOTSTATUS of
7 ioctl interface.
8
9 What: /sys/class/watchdog/watchdogn/options
10 Date: April 2023
11 Contact: Thomas Weißschuh
12 Description:
13 It is a read only file. It contains options of watchdog device.
14
15 What: /sys/class/watchdog/watchdogn/fw_version
16 Date: April 2023
17 Contact: Thomas Weißschuh
18 Description:
19 It is a read only file. It contains firmware version of
20 watchdog device.
21
22 What: /sys/class/watchdog/watchdogn/identity
23 Date: August 2015
24 Contact: Wim Van Sebroeck <wim@iguana.be>
25 Description:
26 It is a read only file. It contains identity string of
27 watchdog device.
28
29 What: /sys/class/watchdog/watchdogn/nowayout
30 Date: August 2015
31 Contact: Wim Van Sebroeck <wim@iguana.be>
32 Description:
33 It is a read/write file. While reading, it gives '1'
34 if the device has the nowayout feature set, otherwise
35 it gives '0'. Writing a '1' to the file enables the
36 nowayout feature. Once set, the nowayout feature
37 cannot be disabled, so writing a '0' either has no
38 effect (if the feature was already disabled) or
39 results in a permission error.
40
41 What: /sys/class/watchdog/watchdogn/state
42 Date: August 2015
43 Contact: Wim Van Sebroeck <wim@iguana.be>
44 Description:
45 It is a read only file. It gives active/inactive status of
46 watchdog device.
47
48 What: /sys/class/watchdog/watchdogn/status
49 Date: August 2015
50 Contact: Wim Van Sebroeck <wim@iguana.be>
51 Description:
52 It is a read only file. It contains watchdog device's
53 internal status bits. It is equivalent to WDIOC_GETSTATUS
54 of ioctl interface.
55
56 What: /sys/class/watchdog/watchdogn/timeleft
57 Date: August 2015
58 Contact: Wim Van Sebroeck <wim@iguana.be>
59 Description:
60 It is a read only file. It contains value of time left for
61 reset generation. It is equivalent to WDIOC_GETTIMELEFT of
62 ioctl interface.
63
64 What: /sys/class/watchdog/watchdogn/timeout
65 Date: August 2015
66 Contact: Wim Van Sebroeck <wim@iguana.be>
67 Description:
68 It is a read only file. It is read to know about current
69 value of timeout programmed.
70
71 What: /sys/class/watchdog/watchdogn/pretimeout
72 Date: December 2016
73 Contact: Wim Van Sebroeck <wim@iguana.be>
74 Description:
75 It is a read only file. It specifies the time in seconds before
76 timeout when the pretimeout interrupt is delivered. Pretimeout
77 is an optional feature.
78
79 What: /sys/class/watchdog/watchdogn/pretimeout_available_governors
80 Date: February 2017
81 Contact: Wim Van Sebroeck <wim@iguana.be>
82 Description:
83 It is a read only file. It shows the pretimeout governors
84 available for this watchdog.
85
86 What: /sys/class/watchdog/watchdogn/pretimeout_governor
87 Date: February 2017
88 Contact: Wim Van Sebroeck <wim@iguana.be>
89 Description:
90 It is a read/write file. When read, the currently assigned
91 pretimeout governor is returned. When written, it sets
92 the pretimeout governor.
93
94 What: /sys/class/watchdog/watchdog1/access_cs0
95 Date: August 2019
96 Contact: Ivan Mikhaylov <i.mikhaylov@yadro.com>,
97 Alexander Amelkin <a.amelkin@yadro.com>
98 Description:
99 It is a read/write file. This attribute exists only if the
100 system has booted from the alternate flash chip due to
101 expiration of a watchdog timer of AST2400/AST2500 when
102 alternate boot function was enabled with 'aspeed,alt-boot'
103 devicetree option for that watchdog or with an appropriate
104 h/w strapping (for WDT2 only).
105
106 At alternate flash the 'access_cs0' sysfs node provides:
107
108 ast2400:
109 a way to get access to the primary SPI flash
110 chip at CS0 after booting from the alternate
111 chip at CS1.
112 ast2500:
113 a way to restore the normal address mapping
114 from (CS0->CS1, CS1->CS0) to (CS0->CS0,
115 CS1->CS1).
116
117 Clearing the boot code selection and timeout counter also
118 resets to the initial state the chip select line mapping. When
119 the SoC is in normal mapping state (i.e. booted from CS0),
120 clearing those bits does nothing for both versions of the SoC.
121 For alternate boot mode (booted from CS1 due to wdt2
122 expiration) the behavior differs as described above.
123
124 This option can be used with wdt2 (watchdog1) only.
125
126 When read, the current status of the boot code selection is
127 shown. When written with any non-zero value, it clears
128 the boot code selection and the timeout counter, which results
129 in chipselect reset for AST2400/AST2500.
130

3. 한국어 전문 번역

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

Watchdog boot status

1-8
항목한국어 전문 번역
What/sys/class/watchdog/watchdogn/bootstatus
Date2015년 8월
ContactWim Van Sebroeck <wim@iguana.be>
DescriptionRead-only file입니다. Boot 시 watchdog device status를 담으며 ioctl interface의 WDIOC_GETBOOTSTATUS와 같습니다.

Watchdog device options

9-14
항목한국어 전문 번역
What/sys/class/watchdog/watchdogn/options
Date2023년 4월
ContactThomas Weißschuh
DescriptionRead-only file이며 watchdog device option을 담습니다.

Watchdog firmware version

15-21
항목한국어 전문 번역
What/sys/class/watchdog/watchdogn/fw_version
Date2023년 4월
ContactThomas Weißschuh
DescriptionRead-only file이며 watchdog device firmware version을 담습니다.

Watchdog identity string

22-28
항목한국어 전문 번역
What/sys/class/watchdog/watchdogn/identity
Date2015년 8월
ContactWim Van Sebroeck <wim@iguana.be>
DescriptionRead-only file이며 watchdog device identity string을 담습니다.

Irreversible nowayout setting

29-40
항목한국어 전문 번역
What/sys/class/watchdog/watchdogn/nowayout
Date2015년 8월
ContactWim Van Sebroeck <wim@iguana.be>
DescriptionRead/write file입니다. Read 시 device에 nowayout feature가 set되어 있으면 1, 아니면 0을 반환합니다. 1을 쓰면 nowayout feature를 enable합니다. 한 번 set하면 disable할 수 없으므로 0을 쓰면 이미 disabled였을 때 effect가 없거나 permission error가 발생합니다.
Watchdog nowayout state
nowayout read: 0 또는 10 상태에서 1 writenowayout enabled이후 0 writeNo effect 또는 permission error, disable 불가

Enable transition은 가능하지만 enabled 상태에서 되돌아갈 수 없습니다.

Watchdog active state

41-47
항목한국어 전문 번역
What/sys/class/watchdog/watchdogn/state
Date2015년 8월
ContactWim Van Sebroeck <wim@iguana.be>
DescriptionRead-only file이며 watchdog device의 active/inactive status를 제공합니다.

Watchdog internal status bits

48-55
항목한국어 전문 번역
What/sys/class/watchdog/watchdogn/status
Date2015년 8월
ContactWim Van Sebroeck <wim@iguana.be>
DescriptionRead-only file이며 watchdog device internal status bit를 담습니다. Ioctl interface의 WDIOC_GETSTATUS와 같습니다.
Watchdog identity and status files
Attribute내용
bootstatusBoot-time status, WDIOC_GETBOOTSTATUS equivalent
optionsDevice options
fw_versionFirmware version
identityIdentity string
stateactive / inactive
statusInternal bits, WDIOC_GETSTATUS equivalent

Descriptive metadata, runtime state와 ioctl-equivalent status를 구분합니다.

Time left before reset

56-63
항목한국어 전문 번역
What/sys/class/watchdog/watchdogn/timeleft
Date2015년 8월
ContactWim Van Sebroeck <wim@iguana.be>
DescriptionRead-only file이며 reset generation까지 남은 time value를 담습니다. Ioctl interface의 WDIOC_GETTIMELEFT와 같습니다.

Programmed watchdog timeout

64-70
항목한국어 전문 번역
What/sys/class/watchdog/watchdogn/timeout
Date2015년 8월
ContactWim Van Sebroeck <wim@iguana.be>
DescriptionRead-only file이며 programmed timeout의 current value를 알기 위해 읽습니다.

Optional pretimeout interval

71-78
항목한국어 전문 번역
What/sys/class/watchdog/watchdogn/pretimeout
Date2016년 12월
ContactWim Van Sebroeck <wim@iguana.be>
DescriptionRead-only file이며 timeout 전에 pretimeout interrupt가 전달되는 interval을 seconds 단위로 지정합니다. Pretimeout은 optional feature입니다.

Available pretimeout governors

79-85
항목한국어 전문 번역
What/sys/class/watchdog/watchdogn/pretimeout_available_governors
Date2017년 2월
ContactWim Van Sebroeck <wim@iguana.be>
DescriptionRead-only file이며 이 watchdog에 사용할 수 있는 pretimeout governor를 표시합니다.

Selected pretimeout governor

86-93
항목한국어 전문 번역
What/sys/class/watchdog/watchdogn/pretimeout_governor
Date2017년 2월
ContactWim Van Sebroeck <wim@iguana.be>
DescriptionRead/write file입니다. Read하면 현재 assigned pretimeout governor를 반환하고 write하면 pretimeout governor를 설정합니다.
Watchdog timeout sequence
Watchdog armed with timeoutpretimeout이 지원되면 timeout 전 interruptpretimeout_governor가 event 처리timeleft가 계속 감소Final timeout에서 reset generation

Optional pretimeout event가 final reset timeout보다 먼저 발생하고 governor가 이를 처리합니다.

Watchdog timeout attributes
AttributeAccess역할
timeleftROReset까지 남은 value
timeoutROCurrent programmed timeout
pretimeoutROTimeout 전 interrupt interval, seconds
pretimeout_available_governorsROAvailable handlers
pretimeout_governorRWCurrent handler selection

Countdown observation과 optional early-warning policy를 구분합니다.

ASPEED alternate-flash CS0 access

94-129
항목한국어 전문 번역
What/sys/class/watchdog/watchdog1/access_cs0
Date2019년 8월
ContactIvan Mikhaylov <i.mikhaylov@yadro.com>, Alexander Amelkin <a.amelkin@yadro.com>
DescriptionRead/write file입니다. 해당 watchdog에 'aspeed,alt-boot' devicetree option을 사용하거나 적절한 hardware strapping(WDT2만 해당)으로 alternate boot function을 enable한 뒤 AST2400/AST2500 watchdog timer expiry 때문에 system이 alternate flash chip에서 boot한 경우에만 존재합니다. Alternate flash에서 AST2400은 CS1의 alternate chip으로 boot한 뒤 CS0의 primary SPI flash chip에 접근하게 합니다. AST2500은 swapped mapping (CS0->CS1, CS1->CS0)을 normal mapping (CS0->CS0, CS1->CS1)으로 복원합니다. Boot code selection과 timeout counter를 clear하면 chip-select mapping도 initial state로 reset합니다. Normal mapping state, 즉 CS0에서 boot한 경우 이 bit를 clear해도 두 SoC version 모두 아무 effect가 없습니다. WDT2 expiry 때문에 CS1에서 boot한 alternate mode에서는 앞서 설명한 대로 behavior가 다릅니다. 이 option은 WDT2(watchdog1)에만 사용할 수 있습니다. Read하면 current boot code selection status를 표시합니다. Non-zero value를 write하면 boot code selection과 timeout counter를 clear하여 AST2400/AST2500 chip-select를 reset합니다.
ASPEED access_cs0 behavior
SoCAlternate stateaccess_cs0 effect
AST2400Booted from CS1Primary SPI flash at CS0에 접근
AST2500CS0->CS1, CS1->CS0 swappedCS0->CS0, CS1->CS1 normal mapping 복원
Both, normal bootBooted from CS0Clear operation has no effect

Alternate boot 뒤 AST2400과 AST2500이 제공하는 recovery 동작이 다릅니다.

ASPEED alternate-boot recovery
WDT2 expiry with alternate boot enabledSystem boots from CS1access_cs0 attribute appearsNon-zero value writeBoot code selection + timeout counter clearChip-select mapping reset

WDT2 alternate boot 상태에서 non-zero write가 selection과 timeout을 함께 clear합니다.