xref: /linux/Documentation/ABI/testing/sysfs-bus-i2c-devices-m24lr (revision 4f38da1f027ea2c9f01bb71daa7a299c191b6940)
1*bb7aa579SAbd-Alrhman MasalkhiWhat:           /sys/bus/i2c/devices/<busnum>-<primary-addr>/unlock
2*bb7aa579SAbd-Alrhman MasalkhiDate:           2025-07-04
3*bb7aa579SAbd-Alrhman MasalkhiKernelVersion:  6.17
4*bb7aa579SAbd-Alrhman MasalkhiContact:        Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
5*bb7aa579SAbd-Alrhman MasalkhiDescription:
6*bb7aa579SAbd-Alrhman Masalkhi                Write-only attribute used to present a password and unlock
7*bb7aa579SAbd-Alrhman Masalkhi                access to protected areas of the M24LR chip, including
8*bb7aa579SAbd-Alrhman Masalkhi                configuration registers such as the Sector Security Status
9*bb7aa579SAbd-Alrhman Masalkhi                (SSS) bytes. A valid password must be written to enable write
10*bb7aa579SAbd-Alrhman Masalkhi                access to these regions via the I2C interface.
11*bb7aa579SAbd-Alrhman Masalkhi
12*bb7aa579SAbd-Alrhman Masalkhi                Format:
13*bb7aa579SAbd-Alrhman Masalkhi                  - Hexadecimal string representing a 32-bit (4-byte) password
14*bb7aa579SAbd-Alrhman Masalkhi                  - Accepts 1 to 8 hex digits (e.g., "c", "1F", "a1b2c3d4")
15*bb7aa579SAbd-Alrhman Masalkhi                  - No "0x" prefix, whitespace, or trailing newline
16*bb7aa579SAbd-Alrhman Masalkhi                  - Case-insensitive
17*bb7aa579SAbd-Alrhman Masalkhi
18*bb7aa579SAbd-Alrhman Masalkhi                Behavior:
19*bb7aa579SAbd-Alrhman Masalkhi                  - If the password matches the internal stored value,
20*bb7aa579SAbd-Alrhman Masalkhi                    access to protected memory/configuration is granted
21*bb7aa579SAbd-Alrhman Masalkhi                  - If the password does not match the internally stored value,
22*bb7aa579SAbd-Alrhman Masalkhi                    it will fail silently
23*bb7aa579SAbd-Alrhman Masalkhi
24*bb7aa579SAbd-Alrhman MasalkhiWhat:           /sys/bus/i2c/devices/<busnum>-<primary-addr>/new_pass
25*bb7aa579SAbd-Alrhman MasalkhiDate:           2025-07-04
26*bb7aa579SAbd-Alrhman MasalkhiKernelVersion:  6.17
27*bb7aa579SAbd-Alrhman MasalkhiContact:        Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
28*bb7aa579SAbd-Alrhman MasalkhiDescription:
29*bb7aa579SAbd-Alrhman Masalkhi                Write-only attribute used to update the password required to
30*bb7aa579SAbd-Alrhman Masalkhi                unlock the M24LR chip.
31*bb7aa579SAbd-Alrhman Masalkhi
32*bb7aa579SAbd-Alrhman Masalkhi                Format:
33*bb7aa579SAbd-Alrhman Masalkhi                  - Hexadecimal string representing a new 32-bit password
34*bb7aa579SAbd-Alrhman Masalkhi                  - Accepts 1 to 8 hex digits (e.g., "1A", "ffff", "c0ffee00")
35*bb7aa579SAbd-Alrhman Masalkhi                  - No "0x" prefix, whitespace, or trailing newline
36*bb7aa579SAbd-Alrhman Masalkhi                  - Case-insensitive
37*bb7aa579SAbd-Alrhman Masalkhi
38*bb7aa579SAbd-Alrhman Masalkhi                Behavior:
39*bb7aa579SAbd-Alrhman Masalkhi                  - Overwrites the current password stored in the I2C password
40*bb7aa579SAbd-Alrhman Masalkhi                    register
41*bb7aa579SAbd-Alrhman Masalkhi                  - Requires the device to be unlocked before changing the
42*bb7aa579SAbd-Alrhman Masalkhi                    password
43*bb7aa579SAbd-Alrhman Masalkhi                  - If the device is locked, the write silently fails
44*bb7aa579SAbd-Alrhman Masalkhi
45*bb7aa579SAbd-Alrhman MasalkhiWhat:           /sys/bus/i2c/devices/<busnum>-<primary-addr>/uid
46*bb7aa579SAbd-Alrhman MasalkhiDate:           2025-07-04
47*bb7aa579SAbd-Alrhman MasalkhiKernelVersion:  6.17
48*bb7aa579SAbd-Alrhman MasalkhiContact:        Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
49*bb7aa579SAbd-Alrhman MasalkhiDescription:
50*bb7aa579SAbd-Alrhman Masalkhi                Read-only attribute that exposes the 8-byte unique identifier
51*bb7aa579SAbd-Alrhman Masalkhi                programmed into the M24LR chip at the factory.
52*bb7aa579SAbd-Alrhman Masalkhi
53*bb7aa579SAbd-Alrhman Masalkhi                Format:
54*bb7aa579SAbd-Alrhman Masalkhi                  - Lowercase hexadecimal string representing a 64-bit value
55*bb7aa579SAbd-Alrhman Masalkhi                  - 1 to 16 hex digits (e.g., "e00204f12345678")
56*bb7aa579SAbd-Alrhman Masalkhi                  - No "0x" prefix
57*bb7aa579SAbd-Alrhman Masalkhi                  - Includes a trailing newline
58*bb7aa579SAbd-Alrhman Masalkhi
59*bb7aa579SAbd-Alrhman MasalkhiWhat:           /sys/bus/i2c/devices/<busnum>-<primary-addr>/total_sectors
60*bb7aa579SAbd-Alrhman MasalkhiDate:           2025-07-04
61*bb7aa579SAbd-Alrhman MasalkhiKernelVersion:  6.17
62*bb7aa579SAbd-Alrhman MasalkhiContact:        Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
63*bb7aa579SAbd-Alrhman MasalkhiDescription:
64*bb7aa579SAbd-Alrhman Masalkhi                Read-only attribute that exposes the total number of EEPROM
65*bb7aa579SAbd-Alrhman Masalkhi                sectors available in the M24LR chip.
66*bb7aa579SAbd-Alrhman Masalkhi
67*bb7aa579SAbd-Alrhman Masalkhi                Format:
68*bb7aa579SAbd-Alrhman Masalkhi                  - 1 to 2 hex digits (e.g. "F")
69*bb7aa579SAbd-Alrhman Masalkhi                  - No "0x" prefix
70*bb7aa579SAbd-Alrhman Masalkhi                  - Includes a trailing newline
71*bb7aa579SAbd-Alrhman Masalkhi
72*bb7aa579SAbd-Alrhman Masalkhi                Notes:
73*bb7aa579SAbd-Alrhman Masalkhi                  - Value is encoded by the chip and corresponds to the EEPROM
74*bb7aa579SAbd-Alrhman Masalkhi                    size (e.g., 3 = 4 kbit for M24LR04E-R)
75*bb7aa579SAbd-Alrhman Masalkhi
76*bb7aa579SAbd-Alrhman MasalkhiWhat:           /sys/bus/i2c/devices/<busnum>-<primary-addr>/sss
77*bb7aa579SAbd-Alrhman MasalkhiDate:           2025-07-04
78*bb7aa579SAbd-Alrhman MasalkhiKernelVersion:  6.17
79*bb7aa579SAbd-Alrhman MasalkhiContact:        Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
80*bb7aa579SAbd-Alrhman MasalkhiDescription:
81*bb7aa579SAbd-Alrhman Masalkhi                Read/write binary attribute representing the Sector Security
82*bb7aa579SAbd-Alrhman Masalkhi                Status (SSS) bytes for all EEPROM sectors in STMicroelectronics
83*bb7aa579SAbd-Alrhman Masalkhi                M24LR chips.
84*bb7aa579SAbd-Alrhman Masalkhi
85*bb7aa579SAbd-Alrhman Masalkhi                Each EEPROM sector has one SSS byte, which controls I2C and
86*bb7aa579SAbd-Alrhman Masalkhi                RF access through protection bits and optional password
87*bb7aa579SAbd-Alrhman Masalkhi                authentication.
88*bb7aa579SAbd-Alrhman Masalkhi
89*bb7aa579SAbd-Alrhman Masalkhi                Format:
90*bb7aa579SAbd-Alrhman Masalkhi                  - The file contains one byte per EEPROM sector
91*bb7aa579SAbd-Alrhman Masalkhi                  - Byte at offset N corresponds to sector N
92*bb7aa579SAbd-Alrhman Masalkhi                  - Binary access only; use tools like dd, Python, or C that
93*bb7aa579SAbd-Alrhman Masalkhi                    support byte-level I/O and offset control.
94*bb7aa579SAbd-Alrhman Masalkhi
95*bb7aa579SAbd-Alrhman Masalkhi                Notes:
96*bb7aa579SAbd-Alrhman Masalkhi                  - The number of valid bytes in this file is equal to the
97*bb7aa579SAbd-Alrhman Masalkhi                    value exposed by 'total_sectors' file
98*bb7aa579SAbd-Alrhman Masalkhi                  - Write access requires prior password authentication in
99*bb7aa579SAbd-Alrhman Masalkhi                    I2C mode
100*bb7aa579SAbd-Alrhman Masalkhi                  - Refer to the M24LR datasheet for full SSS bit layout
101