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 SpiFlash(tm) compatible 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 SpiFlash(tm).
52 SpiFlash chips typically have part numbers beginning with EN25,
53 IS25, MX25, S25, SST25, or W25.
57 driver uses opcode 0x9f to read the manufacturer and device ID
58 data to determine whether the device is supported.
59 The device ID is looked up using a table of data within the driver
60 which describes the attributes of each supported device,
61 such as block size, sector size, and device capacity.
62 When a supported device is found, the
64 driver creates a disk device and makes it accessible at
65 .Pa /dev/flash/mx25l? .
66 The new disk device is then tasted by the available
68 modules as with any disk device.
72 driver provides support for the following devices:
130 .Sh FDT CONFIGURATION
135 device is defined as a slave device subnode
136 of the SPI bus controller node.
137 All properties documented in the
139 bindings document can be used with the
142 The most commonly-used ones are documented below.
144 The following properties are required in the
147 .Bl -tag -width indent
149 Must be the string "jedec,spi-nor".
151 Chip select address of device.
152 .It Va spi-max-frequency
153 The maximum bus frequency to use when communicating with this slave device.
154 Actual bus speed may be lower, depending on the capabilities of the SPI
155 bus controller hardware.
158 The following properties are optional for the
161 .Bl -tag -width indent
163 Empty property indicating the slave device requires shifted clock
166 Empty property indicating the slave device requires inverse clock
167 polarity (CPOL) mode.
169 Empty property indicating the slave device requires chip select active high.
171 .Sh HINTS CONFIGURATION
174 based system, such as
176 these values are configurable for
178 .Bl -tag -width indent
179 .It Va hint.mx25l.%d.at
182 instance is attached to.
183 .It Va hint.mx25l.%d.clock
184 The maximum bus frequency to use when communicating with this device.
185 Actual bus speed may be lower, depending on the capabilities of the SPI
186 bus controller hardware.
187 .It Va hint.mx25l.%d.cs
188 The chip-select number to assert when performing I/O for this device.
189 Set the high bit (1 << 31) to invert the logic level of the chip select line.
190 .It Va hint.mx25l.%d.mode
191 The SPI mode (0-3) to use when communicating with this device.
194 .Bl -tag -width /dev/flash/mx25l?
195 .It Pa /dev/flash/mx25l?
196 Provides read/write access to the storage device.
197 .It Pa /dev/flash/spi?
200 device, for backwards compatibility with older versions of the driver.
208 driver first appeared in