AT45D(4)
πΎ AT45D(4) β at45d β¨
okay so this is the at45d(4) page from the Kernel Interfaces Manual, and bestie, it's giving "tiny SPI storage driver, big main character energy." Let's go π
πΈ NAME πΈ
at45dβ driver forDataFlash(tm)non-volatile storage devices π«Ά
β¨ SYNOPSIS β¨
To compile this driver into the kernel, place the following line in your kernel configuration file:
device at45d
Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5):
at45d_load="YES"
π¦ DESCRIPTION π¦
The at45d driver provides support for the family of non-volatile storage devices known collectively as DataFlash(tm). DataFlash chips typically have part numbers beginning with AT45DB. Important vibe check: the at45d driver supports only the SPI bus versions of each AT45DB device, and those are indicated by the last digit of the part number being 1 or 2.
The at45d driver uses opcode 0x9f to read the manufacturer and device ID data to determine whether the device is supported. The device ID is looked up using a table of data within the driver which describes the attributes of each supported device, such as block size, sector size, and device capacity. When a supported device is found, the at45d driver creates a disk device and makes it accessible at /dev/flash/at45d?. The new disk device is then tasted by the available geom(4) modules as with any disk device β yes, "tasted" is the word, bestie π
π₯ HARDWARE π₯
The at45d driver provides support for the following devices:
AT45DB011BAT45DB021BAT45DB041xAT45DB081BAT45DB161xAT45DB321xAT45DB321xAT45DB641EAT45DB642x
and yes, AT45DB321x is listed twice in the original β I kept it exactly like that, no cap π«Ά
π§ FDT CONFIGURATION π§
On an fdt(4) based system, the at45d device is defined as a slave device subnode of the SPI bus controller node. All properties documented in the spibus.txt bindings document can be used with the at45d device. The most commonly-used ones are documented below.
The following properties are required in the at45d device subnode:
compatibleβ Must be the string"atmel,at45".regβ Chip select address of device.spi-max-frequencyβ The maximum bus frequency to use when communicating with this slave device. Actual bus speed may be lower, depending on the capabilities of the SPI bus controller hardware.
The following properties are optional for the at45d device subnode:
freebsd,sectorsizeβ The sector size of the disk created for this storage device. It must be a multiple of the device's page size. The default is the device page size.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.
π HINTS CONFIGURATION π
On a device.hints(5) based system, such as MIPS, these values are configurable for at45d:
hint.at45d.%d.atβ Thespibustheat45dinstance is attached to.hint.at45d.%d.clockβ The maximum bus frequency to use when communicating with this device. Actual bus speed may be lower, depending on the capabilities of the SPI bus controller hardware.hint.at45d.%d.csβ The chip-select number to assert when performing I/O for this device. Set the high bit(1 << 31)to invert the logic level of the chip select line.hint.at45d.%d.modeβ The SPI mode(0-3)to use when communicating with this device.hint.at45d.%d.sectorsizeβ The sector size of the disk created for this storage device. It must be a multiple of the device's page size. The default is the device page size.
π FILES π
/dev/flash/at45d?β Provides read/write access to the storage device./dev/flash/spi?β An alias for the/dev/at45d?device, for backwards compatibility with older versions of the driver.
π SEE ALSO π
go look at these too, bestie: fdt(4), geom(4) β that's the whole list π
β HISTORY β
The at45d driver first appeared in FreeBSD 6.0. she's been around since then, iconic π
xoxo from the Debian source/version, dated March 2, 2019, page AT45D(4) ππ¦
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2019 Ian Lepore <ian@freebsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms