MX25L(4)

πŸ’Ύ MX25L β€” the mx25l driver, bestie edition πŸŽ€

okay so this is the MX25L(4) man page, from the Kernel Interfaces Manual section (that's section 4, drivers, we love her). it's all about a driver for SpiFlash(tm)-compatible non-volatile storage devices. sit down, grab a snack πŸ“, we're gonna get into it.


✨ NAME ✨

mx25l β€” driver for SpiFlash(tm) compatible non-volatile storage devices πŸ’…

like. that's literally her. that's the whole vibe.


🌸 SYNOPSIS 🌸

so to get this driver compiled into your kernel, you drop this line into your kernel configuration file:

device mx25l

or, alternatively, if you'd rather load the driver as a module at boot time, you put this line in loader.conf(5):

mx25l_load="YES"

pick your fighter. both slay. 🫢


πŸ’– DESCRIPTION πŸ’–

okay so the mx25l driver provides support for the whole family of non-volatile storage devices that everyone calls SpiFlash(tm). these chips typically have part numbers starting with EN25, IS25, MX25, S25, SST25, or W25 β€” if you see one of those prefixes you already know what time it is. πŸ‘‘

the mx25l driver reads the manufacturer and device ID data using opcode 0x9f to figure out whether the device is supported. and the way it checks β€” it looks the device ID up in a table of data inside the driver, which describes the attributes of each supported device, like block size, sector size, and device capacity. so smart. so organized. πŸ’…

when a supported device is found, the mx25l driver creates a disk device and makes it accessible at /dev/flash/mx25l?. the new disk device then gets tasted by the available geom(4) modules, just like with any other disk device. no special treatment, she's just a disk now. periodt.


πŸ”₯ HARDWARE πŸ”₯

the mx25l driver provides support for these devices, and honestly? the roster is giving range:

  • AT25DF641
  • EN25F32
  • EN25P32
  • EN25P64
  • EN25Q32
  • EN25Q64
  • GD25Q64
  • M25P32
  • M25P64
  • MX25L1606E
  • MX25LL128
  • MX25LL256
  • MX25LL32
  • MX25LL64
  • S25FL032
  • S25FL064
  • S25FL128
  • S25FL256S
  • SST25VF010A
  • SST25VF032B
  • W25Q128
  • W25Q256
  • W25Q32
  • W25Q64
  • W25Q64BV
  • W25X32
  • W25X64

twenty-seven icons. not one flop. 🌈


🧚 FDT CONFIGURATION 🧚

on an fdt(4) based system, the mx25l device is defined as a slave device subnode of the SPI bus controller node. and good news β€” all the properties documented in the spibus.txt bindings document can be used with the mx25l device. the most commonly-used ones are documented below. πŸ’–

the properties you NEED (required) in the mx25l device subnode 🫢

  • compatible β€” must be the string "jedec,spi-nor". non-negotiable bestie.
  • reg β€” chip select address of device.
  • spi-max-frequency β€” the maximum bus frequency to use when communicating with this slave device. heads up though: the actual bus speed may be lower, depending on what the SPI bus controller hardware is capable of. she can only go as fast as she can go. 😭

the properties you CAN add (optional) πŸŽ€

  • spi-cpha β€” empty property indicating the slave device requires shifted clock phase (CPHA) mode.
  • spi-cpol β€” empty property indicating the slave device requires inverse clock polarity (CPOL) mode.
  • spi-cs-high β€” empty property indicating the slave device requires chip select active high.

empty properties are such a mood ngl. present, but with nothing to say. πŸ’…


⭐ HINTS CONFIGURATION ⭐

on a device.hints(5) based system β€” like MIPS, hi MIPS ily β€” these values are configurable for mx25l:

  • hint.mx25l.%d.at β€” the spibus the mx25l instance is attached to.
  • hint.mx25l.%d.clock β€” the maximum bus frequency to use when communicating with this device. again: actual bus speed may be lower, depending on the capabilities of the SPI bus controller hardware. same disclaimer, same energy.
  • hint.mx25l.%d.cs β€” the chip-select number to assert when performing I/O for this device. and ooh, spicy detail: set the high bit (1 << 31) to invert the logic level of the chip select line. 🀯
  • hint.mx25l.%d.mode β€” the SPI mode (0-3) to use when communicating with this device.

πŸ¦‹ FILES πŸ¦‹

  • /dev/flash/mx25l? β€” provides read/write access to the storage device. this is the main character right here. πŸ‘‘
  • /dev/flash/spi? β€” an alias for the /dev/mx25l? device, for backwards compatibility with older versions of the driver. she's keeping the old name alive out of respect. we love a nostalgic queen.

πŸ‘€ SEE ALSO πŸ‘€

go read those next, bestie, that's the homework. πŸ“š


πŸ’œ HISTORY πŸ’œ

the mx25l driver first appeared in FreeBSD 8.0. a legend from day one, no cap.


🌟 and that's the whole page! every option, every device, every property, every path β€” nothing skipped, nothing invented. iykyk. πŸ’…βœ¨

okay and for the cute sign-off: this page came to you courtesy of Debian, dated February 26, 2019 β€” that's the source and version vibes, and she's still serving. bye bestie, go mount something πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from