xref: /freebsd/share/man/man4/jedec_dimm.4 (revision d4eeb02986980bf33dd56c41ceb9fc5f180c0d47)
1.\"
2.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3.\"
4.\" Copyright (c) 2016 Andriy Gapon <avg@FreeBSD.org>
5.\" Copyright (c) 2018 Ravi Pokala <rpokala@freebsd.org>
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.\" $FreeBSD$
28.\"
29.Dd July 31, 2018
30.Dt JEDEC_DIMM 4
31.Os
32.Sh NAME
33.Nm jedec_dimm
34.Nd report asset information and temperatures for JEDEC DDR3 / DDR4 DIMMs
35.Sh SYNOPSIS
36.Bd -ragged -offset indent
37.Cd "device jedec_dimm"
38.Cd "device smbus"
39.Ed
40.Pp
41Alternatively, to load the driver as a module at boot time, place the following
42line in
43.Xr loader.conf 5 :
44.Bd -literal -offset indent
45jedec_dimm_load="YES"
46.Ed
47.Pp
48Addressing information must be manually specified in
49.Pa /boot/device.hints :
50.Bd -literal -offset indent
51.Cd hint.jedec_dimm.0.at="smbus0"
52.Cd hint.jedec_dimm.0.addr="0xa0"
53.Cd hint.jedec_dimm.0.slotid="Silkscreen"
54.Ed
55.Sh DESCRIPTION
56The
57.Nm
58driver reports asset information (Part Number, Serial Number) encoded in the
59.Dq Serial Presence Detect
60(SPD) data on JEDEC DDR3 and DDR4 DIMMs.
61It also calculates and reports the memory capacity of the DIMM, in megabytes.
62If the DIMM includes a
63.Dq Thermal Sensor On DIMM
64(TSOD), the temperature is also reported.
65.Pp
66The
67.Nm
68driver accesses the SPD and TSOD over the
69.Xr smbus 4 .
70.Pp
71The data is reported via a
72.Xr sysctl 8
73interface; all values are read-only:
74.Bl -tag -width "dev.jedec_dimm.X.capacity"
75.It Va dev.jedec_dimm.X.%desc
76a string description of the DIMM, including TSOD and slotid info if present.
77.It Va dev.jedec_dimm.X.capacity
78the DIMM's memory capacity, in megabytes
79.It Va dev.jedec_dimm.X.part
80the manufacturer's part number of the DIMM
81.It Va dev.jedec_dimm.X.serial
82the manufacturer's serial number of the DIMM
83.It Va dev.jedec_dimm.X.slotid
84a copy of the corresponding hint, if set
85.It Va dev.jedec_dimm.X.temp
86if a TSOD is present, the reported temperature
87.It Va dev.jedec_dimm.X.type
88the DIMM type (DDR3 or DDR4)
89.El
90.Pp
91These values are configurable for
92.Nm
93via
94.Xr device.hints 5 :
95.Bl -tag -width "hint.jedec_dimm.X.slotid"
96.It Va hint.jedec_dimm.X.at
97the
98.Xr smbus 4
99to which the DIMM is connected
100.It Va hint.jedec_dimm.X.addr
101the SMBus address of the SPD.
102JEDEC specifies that the four most-significant bits of the address are the
103.Dq Device Type Identifier
104(DTI), and that the DTI of the SPD is 0xa.
105Since the least-significant bit of an SMBus address is the read/write bit, and
106is always written as 0, that means the four least-significant bits of the
107address must be even.
108.It Va hint.jedec_dimm.X.slotid
109optional slot identifier.
110If populated with the DIMM slot name silkscreened on the motherboard, this
111provides a mapping between the DIMM slot name and the DIMM serial number.
112That mapping is useful for detailed asset tracking, and makes it easier to
113physically locate a specific DIMM when doing a replacement.
114This is useful when assembling multiple identical systems, as might be done by
115a system vendor.
116The mapping between bus/address and DIMM slot must first be determined, either
117through motherboard documentation or trial-and-error.
118.El
119.Pp
120If the DIMMs are on an I2C bus behind an
121.Xr iicbus 4
122controller, then the
123.Xr iicsmb 4
124bridge driver can be used to attach the
125.Xr smbus 4 .
126.Sh EXAMPLES
127Consider two DDR4 DIMMs with the following hints:
128.Bd -literal -offset indent
129hint.jedec_dimm.0.at="smbus0"
130hint.jedec_dimm.0.addr="0xa0"
131hint.jedec_dimm.0.slotid="A1"
132
133hint.jedec_dimm.6.at="smbus1"
134hint.jedec_dimm.6.addr="0xa8"
135.Ed
136.Pp
137Their
138.Xr sysctl 8
139output (sorted):
140.Bd -literal -offset indent
141dev.jedec_dimm.0.%desc: DDR4 DIMM w/ Atmel TSOD (A1)
142dev.jedec_dimm.0.%driver: jedec_dimm
143dev.jedec_dimm.0.%location: addr=0xa0
144dev.jedec_dimm.0.%parent: smbus0
145dev.jedec_dimm.0.%pnpinfo:
146dev.jedec_dimm.0.capacity: 16384
147dev.jedec_dimm.0.part: 36ASF2G72PZ-2G1A2
148dev.jedec_dimm.0.serial: 0ea815de
149dev.jedec_dimm.0.slotid: A1
150dev.jedec_dimm.0.temp: 32.7C
151dev.jedec_dimm.0.type: DDR4
152
153dev.jedec_dimm.6.%desc: DDR4 DIMM w/ TSE2004av compliant TSOD
154dev.jedec_dimm.6.%driver: jedec_dimm
155dev.jedec_dimm.6.%location: addr=0xa8
156dev.jedec_dimm.6.%parent: smbus1
157dev.jedec_dimm.6.%pnpinfo:
158dev.jedec_dimm.6.capacity: 8192
159dev.jedec_dimm.6.part: VRA9MR8B2H1603
160dev.jedec_dimm.6.serial: 0c4c46ad
161dev.jedec_dimm.6.temp: 43.1C
162dev.jedec_dimm.6.type: DDR4
163.Ed
164.Sh COMPATIBILITY
165.Nm
166implements a superset of the functionality of the now-deleted
167.Xr jedec_ts 4 .
168Hints for
169.Xr jedec_ts 4
170can be mechanically converted for use with
171.Nm .
172Two changes are required:
173.Bl -enum
174.It
175In all
176.Xr jedec_ts 4
177hints, replace
178.Dq jedec_ts
179with
180.Dq jedec_dimm
181.It
182In
183.Xr jedec_ts 4
184.Dq addr
185hints, replace the TSOD DTI
186.Dq 0x3
187with the SPD DTI
188.Dq 0xa
189.El
190.Pp
191The following
192.Xr sed 1
193script will perform the necessary changes:
194.Bd -literal -offset indent
195sed -i ".old" -e 's/jedec_ts/jedec_dimm/' \\
196    -e '/jedec_dimm/s/addr="0x3/addr="0xa/' /boot/device.hints
197.Ed
198.Sh SEE ALSO
199.Xr iicbus 4 ,
200.Xr iicsmb 4 ,
201.Xr smbus 4 ,
202.Xr sysctl 8
203.Sh STANDARDS
204.Rs
205(DDR3 SPD)
206.%A JEDEC
207.%T Standard 21-C, Annex K
208.Re
209.Pp
210.Rs
211(DDR3 TSOD)
212.%A JEDEC
213.%T Standard 21-C, TSE2002av
214.Re
215.Pp
216.Rs
217(DDR4 SPD)
218.%A JEDEC
219.%T Standard 21-C, Annex L
220.Re
221.Pp
222.Rs
223(DDR4 TSOD)
224.%A JEDEC
225.%T Standard 21-C, TSE2004av
226.Re
227.Sh HISTORY
228The
229.Nm
230driver first appeared in
231.Fx 12.0 .
232.Sh AUTHORS
233.An -nosplit
234The
235.Nm
236driver and this manual page were written by
237.An Ravi Pokala Aq Mt rpokala@freebsd.org .
238They are both based in part on the now-deleted
239.Xr jedec_ts 4
240driver and manual page, written by
241.An Andriy Gapon Aq Mt avg@FreeBSD.org .
242