]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/at45d.4
Remove deprecated GEOM classes
[FreeBSD/FreeBSD.git] / share / man / man4 / at45d.4
1 .\"
2 .\" Copyright (c) 2019 Ian Lepore <ian@freebsd.org>
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\"
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.
13 .\"
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.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd March 2, 2019
28 .Dt AT45D 4
29 .Os
30 .Sh NAME
31 .Nm at45d
32 .Nd driver for DataFlash(tm) non-volatile storage devices
33 .Sh SYNOPSIS
34 To compile this driver into the kernel,
35 place the following line in your
36 kernel configuration file:
37 .Bd -ragged -offset indent
38 .Cd "device at45d"
39 .Ed
40 .Pp
41 Alternatively, to load the driver as a
42 module at boot time, place the following line in
43 .Xr loader.conf 5 :
44 .Bd -literal -offset indent
45 at45d_load="YES"
46 .Ed
47 .Sh DESCRIPTION
48 The
49 .Nm
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.
53 The
54 .Nm
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.
57 .Pp
58 The
59 .Nm
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
66 .Nm
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
70 .Xr geom 4
71 modules as with any disk device.
72 .Sh HARDWARE
73 The
74 .Nm
75 driver provides support for the following devices:
76 .Pp
77 .Bl -bullet -compact
78 .It
79 AT45DB011B
80 .It
81 AT45DB021B
82 .It
83 AT45DB041x
84 .It
85 AT45DB081B
86 .It
87 AT45DB161x
88 .It
89 AT45DB321x
90 .It
91 AT45DB321x
92 .It
93 AT45DB641E
94 .It
95 AT45DB642x
96 .El
97 .Sh FDT CONFIGURATION
98 On an
99 .Xr fdt 4
100 based system, the
101 .Nm
102 device is defined as a slave device subnode
103 of the SPI bus controller node.
104 All properties documented in the
105 .Va spibus.txt
106 bindings document can be used with the
107 .Nm
108 device.
109 The most commonly-used ones are documented below.
110 .Pp
111 The following properties are required in the
112 .Nm
113 device subnode:
114 .Bl -tag -width indent
115 .It Va compatible
116 Must be the string "atmel,at45".
117 .It Va reg
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.
123 .El
124 .Pp
125 The following properties are optional for the
126 .Nm
127 device subnode:
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.
133 .It Va spi-cpha
134 Empty property indicating the slave device requires shifted clock
135 phase (CPHA) mode.
136 .It Va spi-cpol
137 Empty property indicating the slave device requires inverse clock
138 polarity (CPOL) mode.
139 .It Va spi-cs-high
140 Empty property indicating the slave device requires chip select active high.
141 .El
142 .Sh HINTS CONFIGURATION
143 On a
144 .Xr device.hints 5
145 based system, such as
146 .Li MIPS ,
147 these values are configurable for
148 .Nm :
149 .Bl -tag -width indent
150 .It Va hint.at45d.%d.at
151 The spibus the
152 .Nm
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.
167 .El
168 .Sh FILES
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?
173 An alias for the
174 .Pa /dev/at45d?
175 device, for backwards compatibility with older versions of the driver.
176 .El
177 .Sh SEE ALSO
178 .Xr fdt 4 ,
179 .Xr geom 4
180 .Sh HISTORY
181 The
182 .Nm
183 driver first appeared in
184 .Fx 6.0 .