2 .\" Copyright (c) 2019 Ian Lepore <ian@freebsd.org>
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 .Nd driver for DataFlash(tm) non-volatile storage devices
34 To compile this driver into the kernel,
35 place the following line in your
36 kernel configuration file:
37 .Bd -ragged -offset indent
41 Alternatively, to load the driver as a
42 module at boot time, place the following line in
44 .Bd -literal -offset indent
50 driver provides support for the family of non-volatile storage
51 devices known collectively as DataFlash(tm).
52 DataFlash chips typically have part numbers beginning with AT45DB.
55 driver supports only the SPI bus versions of each AT45DB device,
56 indicated by the last digit of the part number being 1 or 2.
60 driver uses opcode 0x9f to read the manufacturer and device ID
61 data to determine whether the device is supported.
62 The device ID is looked up using a table of data within the driver
63 which describes the attributes of each supported device,
64 such as block size, sector size, and device capacity.
65 When a supported device is found, the
67 driver creates a disk device and makes it accessible at
68 .Pa /dev/flash/at45d? .
69 The new disk device is then tasted by the available
71 modules as with any disk device.
75 driver provides support for the following devices:
102 device is defined as a slave device subnode
103 of the SPI bus controller node.
104 All properties documented in the
106 bindings document can be used with the
109 The most commonly-used ones are documented below.
111 The following properties are required in the
114 .Bl -tag -width indent
116 Must be the string "atmel,at45".
118 Chip select address of device.
119 .It Va spi-max-frequency
120 The maximum bus frequency to use when communicating with this slave device.
121 Actual bus speed may be lower, depending on the capabilities of the SPI
122 bus controller hardware.
125 The following properties are optional for the
128 .Bl -tag -width indent
129 .It Va freebsd,sectorsize
130 The sector size of the disk created for this storage device.
131 It must be a multiple of the device's page size.
132 The default is the device page size.
134 Empty property indicating the slave device requires shifted clock
137 Empty property indicating the slave device requires inverse clock
138 polarity (CPOL) mode.
140 Empty property indicating the slave device requires chip select active high.
142 .Sh HINTS CONFIGURATION
145 based system, such as
147 these values are configurable for
149 .Bl -tag -width indent
150 .It Va hint.at45d.%d.at
153 instance is attached to.
154 .It Va hint.at45d.%d.clock
155 The maximum bus frequency to use when communicating with this device.
156 Actual bus speed may be lower, depending on the capabilities of the SPI
157 bus controller hardware.
158 .It Va hint.at45d.%d.cs
159 The chip-select number to assert when performing I/O for this device.
160 Set the high bit (1 << 31) to invert the logic level of the chip select line.
161 .It Va hint.at45d.%d.mode
162 The SPI mode (0-3) to use when communicating with this device.
163 .It Va hint.at45d.%d.sectorsize
164 The sector size of the disk created for this storage device.
165 It must be a multiple of the device's page size.
166 The default is the device page size.
169 .Bl -tag -width /dev/flash/at45d?
170 .It Pa /dev/flash/at45d?
171 Provides read/write access to the storage device.
172 .It Pa /dev/flash/spi?
175 device, for backwards compatibility with older versions of the driver.
183 driver first appeared in