← Documents Documentation/ABI/stable/sysfs-bus-nvmem GitHub 원문 ↗

Linux 6.18.37 · ABI / stable

NVMEM device stable sysfs ABI

NVMEM write protection 전환, raw content read/write와 Unknown·EEPROM·OTP·battery-backed·FRAM type 조회를 설명합니다.

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

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

1. 요약·해설

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

Write protection 제어

sysfs-bus-nvmem:1-16

force_ro는 간헐적 programming 때만 잠금을 풀어야 하는 device를 read-only와 read/write 사이에서 전환합니다.

Raw NVMEM과 device type

sysfs-bus-nvmem:18-50

CONFIG_NVMEM_SYSFS가 켜진 경우 raw byte content와 NVMEM provider type을 sysfs에 노출합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 What: /sys/bus/nvmem/devices/.../force_ro
2 Date: June 2024
3 KernelVersion: 6.11
4 Contact: Marek Vasut <[email protected]>
5 Description:
6 This read/write attribute allows users to set read-write
7 devices as read-only and back to read-write from userspace.
8 This can be used to unlock and relock write-protection of
9 devices which are generally locked, except during sporadic
10 programming operation.
11 Read returns '0' or '1' for read-write or read-only modes
12 respectively.
13 Write parses one of 'YyTt1NnFf0', or [oO][NnFf] for "on"
14 and "off", i.e. what kstrtobool() supports.
15 Note: This file is only present if CONFIG_NVMEM_SYSFS
16 is enabled.
17
18 What: /sys/bus/nvmem/devices/.../nvmem
19 Date: July 2015
20 KernelVersion: 4.2
21 Contact: Srinivas Kandagatla <[email protected]>
22 Description:
23 This file allows user to read/write the raw NVMEM contents.
24 Permissions for write to this file depends on the nvmem
25 provider configuration.
26 Note: This file is only present if CONFIG_NVMEM_SYSFS
27 is enabled
28
29 ex::
30
31 hexdump /sys/bus/nvmem/devices/qfprom0/nvmem
32
33 0000000 0000 0000 0000 0000 0000 0000 0000 0000
34 *
35 00000a0 db10 2240 0000 e000 0c00 0c00 0000 0c00
36 0000000 0000 0000 0000 0000 0000 0000 0000 0000
37 ...
38 *
39 0001000
40
41 What: /sys/bus/nvmem/devices/.../type
42 Date: November 2018
43 KernelVersion: 5.0
44 Contact: Alexandre Belloni <[email protected]>
45 Description:
46 This read-only attribute allows user to read the NVMEM
47 device type. Supported types are "Unknown", "EEPROM",
48 "OTP", "Battery backed", "FRAM".
49 Note: This file is only present if CONFIG_NVMEM_SYSFS
50 is enabled.
51

3. 한국어 전문 번역

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

NVMEM force_ro

1-16
항목
What/sys/bus/nvmem/devices/.../force_ro
Date2024년 6월
KernelVersion6.11
ContactMarek Vasut <[email protected]>
accessread/write

User space에서 read/write device를 read-only로 바꾸고 다시 read/write로 되돌릴 수 있다. 평소에는 잠그고 간헐적인 programming operation 때만 여는 device의 write protection을 해제하고 다시 잠그는 데 쓸 수 있다.

읽으면 read/write mode는 0, read-only mode는 1이다. 쓰기는 kstrtobool()이 지원하는 YyTt1NnFf0 또는 [oO][NnFf], 즉 on/off 형식을 받는다. CONFIG_NVMEM_SYSFS가 활성화된 경우에만 존재한다.

Raw NVMEM content

18-39
항목
What/sys/bus/nvmem/devices/.../nvmem
Date2015년 7월
KernelVersion4.2
ContactSrinivas Kandagatla <[email protected]>

Raw NVMEM content를 읽고 쓸 수 있다. Write permission은 nvmem provider configuration에 따라 달라진다. CONFIG_NVMEM_SYSFS가 활성화된 경우에만 존재한다.

hexdump /sys/bus/nvmem/devices/qfprom0/nvmem

0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
00000a0 db10 2240 0000 e000 0c00 0c00 0000 0c00
0000000 0000 0000 0000 0000 0000 0000 0000 0000
...
*
0001000

NVMEM device type

41-50
항목
What/sys/bus/nvmem/devices/.../type
Date2018년 11월
KernelVersion5.0
ContactAlexandre Belloni <[email protected]>
accessread-only

NVMEM device type을 읽는다. 지원하는 type은 Unknown, EEPROM, OTP, Battery backed, FRAM이다. CONFIG_NVMEM_SYSFS가 활성화된 경우에만 존재한다.