1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
<table class="head">
<tr>
<td class="head-ltitle">AT45D(4)</td>
<td class="head-vol">Device Drivers Manual</td>
<td class="head-rtitle">AT45D(4)</td>
</tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">at45d</code> — <span class="Nd">driver for
DataFlash(tm) non-volatile storage devices</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp">To compile this driver into the kernel, place the following line
in your kernel configuration file:</p>
<div class="Bd Pp Bd-indent"><code class="Cd">device at45d</code></div>
<p class="Pp">Alternatively, to load the driver as a module at boot time, place
the following line in <a class="Xr">loader.conf(5)</a>:</p>
<div class="Bd Pp Bd-indent Li">
<pre>at45d_load="YES"</pre>
</div>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The <code class="Nm">at45d</code> 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. The
<code class="Nm">at45d</code> driver supports only the SPI bus versions of
each AT45DB device, indicated by the last digit of the part number being 1
or 2.</p>
<p class="Pp">The <code class="Nm">at45d</code> 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 <code class="Nm">at45d</code> driver creates a disk device and
makes it accessible at <span class="Pa">/dev/flash/at45d?</span>. The new
disk device is then tasted by the available <a class="Xr">geom(4)</a>
modules as with any disk device.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="HARDWARE"><a class="permalink" href="#HARDWARE">HARDWARE</a></h1>
<p class="Pp">The <code class="Nm">at45d</code> driver provides support for the
following devices:</p>
<p class="Pp"></p>
<ul class="Bl-bullet Bl-compact">
<li>AT45DB011B</li>
<li>AT45DB021B</li>
<li>AT45DB041x</li>
<li>AT45DB081B</li>
<li>AT45DB161x</li>
<li>AT45DB321x</li>
<li>AT45DB321x</li>
<li>AT45DB641E</li>
<li>AT45DB642x</li>
</ul>
</section>
<section class="Sh">
<h1 class="Sh" id="FDT_CONFIGURATION"><a class="permalink" href="#FDT_CONFIGURATION">FDT
CONFIGURATION</a></h1>
<p class="Pp">On an <a class="Xr">fdt(4)</a> based system, the
<code class="Nm">at45d</code> device is defined as a slave device subnode of
the SPI bus controller node. All properties documented in the
<var class="Va">spibus.txt</var> bindings document can be used with the
<code class="Nm">at45d</code> device. The most commonly-used ones are
documented below.</p>
<p class="Pp">The following properties are required in the
<code class="Nm">at45d</code> device subnode:</p>
<dl class="Bl-tag">
<dt id="compatible"><var class="Va">compatible</var></dt>
<dd>Must be the string "atmel,at45".</dd>
<dt id="reg"><var class="Va">reg</var></dt>
<dd>Chip select address of device.</dd>
<dt id="spi-max-frequency"><var class="Va">spi-max-frequency</var></dt>
<dd>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.</dd>
</dl>
<p class="Pp">The following properties are optional for the
<code class="Nm">at45d</code> device subnode:</p>
<dl class="Bl-tag">
<dt id="freebsd,sectorsize"><var class="Va">freebsd,sectorsize</var></dt>
<dd>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.</dd>
<dt id="spi-cpha"><var class="Va">spi-cpha</var></dt>
<dd>Empty property indicating the slave device requires shifted clock phase
(CPHA) mode.</dd>
<dt id="spi-cpol"><var class="Va">spi-cpol</var></dt>
<dd>Empty property indicating the slave device requires inverse clock polarity
(CPOL) mode.</dd>
<dt id="spi-cs-high"><var class="Va">spi-cs-high</var></dt>
<dd>Empty property indicating the slave device requires chip select active
high.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="HINTS_CONFIGURATION"><a class="permalink" href="#HINTS_CONFIGURATION">HINTS
CONFIGURATION</a></h1>
<p class="Pp">On a <a class="Xr">device.hints(5)</a> based system, such as
<code class="Li">MIPS</code>, these values are configurable for
<code class="Nm">at45d</code>:</p>
<dl class="Bl-tag">
<dt id="hint.at45d._d.at"><var class="Va">hint.at45d.%d.at</var></dt>
<dd>The spibus the <code class="Nm">at45d</code> instance is attached to.</dd>
<dt id="hint.at45d._d.clock"><var class="Va">hint.at45d.%d.clock</var></dt>
<dd>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.</dd>
<dt id="hint.at45d._d.cs"><var class="Va">hint.at45d.%d.cs</var></dt>
<dd>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.</dd>
<dt id="hint.at45d._d.mode"><var class="Va">hint.at45d.%d.mode</var></dt>
<dd>The SPI mode (0-3) to use when communicating with this device.</dd>
<dt id="hint.at45d._d.sectorsize"><var class="Va">hint.at45d.%d.sectorsize</var></dt>
<dd>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.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1>
<dl class="Bl-tag">
<dt><span class="Pa">/dev/flash/at45d?</span></dt>
<dd>Provides read/write access to the storage device.</dd>
<dt><span class="Pa">/dev/flash/spi?</span></dt>
<dd>An alias for the <span class="Pa">/dev/at45d?</span> device, for backwards
compatibility with older versions of the driver.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<p class="Pp"><a class="Xr">fdt(4)</a>, <a class="Xr">geom(4)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">The <code class="Nm">at45d</code> driver first appeared in
<span class="Ux">FreeBSD 6.0</span>.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">March 2, 2019</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|