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