Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ABI: sysfs: add documentation for ST M24LR EEPROM and control interface

Add sysfs ABI documentation for the STMicroelectronics M24LR device,
covering both the control interface (e.g., unlock, password update, UID,
total sectors, and SSS entries) and EEPROM access via the nvmem subsystem.

Signed-off-by: Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
Link: https://lore.kernel.org/r/20250717063934.5083-4-abd.masalkhi@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Abd-Alrhman Masalkhi and committed by
Greg Kroah-Hartman
bb7aa579 cd5c5e02

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