Serial presence detect


In computing, serial presence detect is a standardized way to automatically access information about a memory module. Earlier 72-pin SIMMs included five pins that provided five bits of parallel presence detect data, but the 168-pin DIMM standard changed to a serial presence detect to encode much more information.
When an ordinary modern computer is turned on, it starts by doing a power-on self-test. Since about the mid-1990s, this process includes automatically configuring the hardware currently present. SPD is a memory hardware feature that makes it possible for the computer to know what memory is present, and what timings to use to access the memory.
Some computers adapt to hardware changes completely automatically. In most cases, there is a special optional procedure for accessing BIOS parameters, to view and potentially make changes in settings. It may be possible to control how the computer uses the memory SPD data—to choose settings, selectively modify memory timings, or possibly to completely over-ride the SPD data.

Stored information

For a memory module to support SPD, the JEDEC standards require that certain parameters be in the lower 128 bytes of an EEPROM located on the memory module. These bytes contain timing parameters, manufacturer, serial number and other useful information about the module. Devices utilizing the memory automatically determine key parameters of the module by reading this information. For example, the SPD data on an SDRAM module might provide information about the CAS latency so the system can set this correctly without user intervention.
The SPD EEPROM is accessed using SMBus, a variant of the I²C protocol. This reduces the number of communication pins on the module to just two: a clock signal and a data signal. The EEPROM shares ground pins with the RAM, has its own power pin, and has three additional pins to identify the slot, which are used to assign the EEPROM a unique address in the range 0x50–0x57. Not only can the communication lines be shared among 8 memory modules, the same SMBus is commonly used on motherboards for system health monitoring tasks such as reading power supply voltages, CPU temperatures, and fan speeds.
SPD EEPROMs also respond to I²C addresses 0x30–0x37 if they have not been write protected, and an extension uses addresses 0x18–0x1F to access an optional on-chip temperature sensor. All those values are seven-bit I²C addresses formed by a Device Type Identifier Code prefix with SA0-2: to read from slot 3, one uses 110 0011 = 0x33. With a final R/W bit it forms the 8-bit Device Select Code. Note that the semantics of slot-id is different for write-protection operations: for them they can be not passed by the SA pins at all.
Before SPD, memory chips were spotted with parallel presence detect. PPD used a separate pin for each bit of information, which meant that only the speed and density of the memory module could be stored because of the limited space for pins.

SDR SDRAM

The first SPD specification was issued by JEDEC and tightened up by Intel as part of its PC100 memory specification. Most values specified are in binary-coded decimal form. The most significant nibble can contain values from 10 to 15, and in some cases extends higher. In such cases, the encodings for 1, 2 and 3 are instead used to encode 16, 17 and 18. A most significant nibble of 0 is reserved to represent "undefined".
The SPD ROM defines up to three DRAM timings, for three CAS latencies specified by set bits in byte 18. First comes the highest CAS latency, then two lower CAS latencies with progressively lower clock speeds.

DDR SDRAM

The DDR DIMM SPD format is an extension of the SDR SDRAM format. Mostly, parameter ranges are rescaled to accommodate higher speeds.

DDR2 SDRAM

The DDR2 SPD standard makes a number of changes, but is roughly similar to the above. One notable deletion is the confusing and little-used support for DIMMs with two ranks of different sizes.
For cycle time fields, which are encoded in BCD, some additional encodings are defined for the tenths digit to represent some common timings exactly:
HexBinarySignificance
A10100.25
B10110.33
C11000.66
D11010.75
E11100.875
F1111

DDR3 SDRAM

The DDR3 SDRAM standard significantly overhauls and simplifies the SPD contents layout. Instead of a number of BCD-encoded nanosecond fields, some "timebase" units are specified to high precision, and various timing parameters are encoded as multiples of that base unit. Further, the practice of specifying different time values depending on the CAS latency has been dropped; now there are just a single set of timing parameters.
Revision 1.1 lets some parameters be expressed as a "medium time base" value plus a "fine time base" correction. Generally, the medium time base is 1/8 ns, and the fine time base is 1, 2.5 or 5 ps. For compatibility with earlier versions that lack the correction, the medium time base number is usually rounded up and the correction is negative. Values that work this way are:
MTB byteFTB byteValue
1234tCKmin, minimum clock period
1635tAAmin, minimum CAS latency time
1836tRCDmin, minimum RAS# to CAS# delay
2037tRPmin, minimum row precharge delay
21, 2338tRCmin, minimum active to active/precharge delay

The memory capacity of a module can be computed from bytes 4, 7 and 8. The module width divided by the number of bits per chip gives the number of chips per rank. That can then be multiplied by the per-chip capacity and the number of ranks of chips on the module.

DDR4 SDRAM

The DDR4 SDRAM "Annex L" standard for SPD changes the EEPROM module used. Instead of the old AT24C02-compatible 256-byte EEPROMs, JEDEC now defines a new nonstandard EE1004 type with two pages at the SMBus level each with 256 bytes. The new memory still uses the old 0x50-0x57 addresses, but two additional address at 0x36 and 0x37 are now used to receive commands to select the currently-active page for the bus. Internally each logical page is further divided into two physical blocks of 128 bytes each, totaling four blocks and 512 bytes. Other semantics for "special" address ranges remain the same, although write protection is now addressed by blocks and a high voltage at SA0 is now required to change its status.
Annex L defines a few different layouts that can be plugged into a 512-byte template, depending on the type of the memory module. The bit definitions are similar to DDR3.

Extensions

The JEDEC standard only specifies some of the SPD bytes. The truly critical data fits into the first 64 bytes, while some of the remainder is earmarked for manufacturer identification. However, a 256-byte EEPROM is generally provided. A number of uses have been made of the remaining space.

Enhanced Performance Profiles (EPP)

Memory generally comes with conservative timing recommendations in the SPD ROM, to ensure basic functionality on all systems. Enthusiasts often spend considerable time manually adjusting the memory timings for higher speed.
Enhanced Performance Profiles is an extension of SPD, developed by Nvidia and Corsair, which includes additional information for higher-performance operation of DDR2 SDRAM, including supply voltages and command timing information not included in the JEDEC SPD spec. The EPP information is stored in the same EEPROM, but in bytes 99-127, which are unused by standard DDR2 SPD.
The parameters are particularly designed to fit the memory controller on the nForce 5, nForce 6 and nForce 7 chipsets. Nvidia encourages support for EPP in the BIOS for its high-end motherboard chipsets. This is intended to provide "one-click overclocking" to get better performance with minimal effort.
Nvidia's name for EPP memory that has been qualified for performance and stability is "SLI-ready memory". The term "SLI-ready-memory" has caused some confusion, as it has nothing to do with SLI video. One can use EPP/SLI memory with a single video card, and one can run a multi-card SLI video setup without EPP/SLI memory.
An extended version, EPP 2.0, supports DDR3 memory as well.

Extreme Memory Profile (XMP)

A similar, Intel-developed JEDEC SPD extension was developed for DDR3 SDRAM DIMMs, later used in DDR4 also. XMP uses bytes 176–255, which are unallocated by JEDEC, to encode higher-performance memory timings.
Later, AMD developed AMP, an equivalent technology to XMP, for use in its "Radeon Memory" line of memory modules optimized for use in AMD platforms. Furthermore, motherboard developers implemented their own technologies to allow their AMD-based motherboards to read XMP profiles: MSI offers A-XMP, ASUS has DOCP, and Gigabyte has EOCP.
DDR3 BytesSizeUse
176–18410XMP header
185–21933XMP profile 1
220–25436XMP profile 2

The header contains the following data. Most importantly, it contains a "medium timebase" value MTB, as a rational number of nanoseconds. Many other later timing values are expressed as an integer number of MTB units.
Also included in the header is the number of DIMMs per memory channel that the profile is designed to support; including more DIMMs may not work well.
DDR3 ByteBitsUse
1767:0XMP magic number byte 1 0x0C
1777:0XMP magic number byte 2 0x4A
1780Profile 1 enabled
1781Profile 2 enabled
1783:2Profile 1 DIMMs per channel
1785:4Profile 2 DIMMs per channel
1787:6
1793:0XMP minor version number
1797:4XMP major version number
1807:0Medium timebase dividend for profile 1
1817:0Medium timebase divisor for profile 1
1827:0Medium timebase dividend for profile 2
1837:0Medium timebase divisor for profile 2
1847:0

All data above are for DDR3 ; DDR4 specs are not yet available.

Vendor-specific memory

A common misuse is to write information to certain memory regions to bind vendor-specific memory modules to a specific system. Fujitsu Technology Solutions is known to do this. Adding different memory module to the system usually results in a refusal or other counter-measures.

02 0E 00 01-00 00 00 EF-02 03 19 4D-BC 47 C3 46...........M.G.F
53 43 00 04-EF 4F 8D 1F-00 01 70 00-01 03 C1 CF SC...O....p.....

This is the output of a 512 MB memory module from Micron Technologies, branded for Fujitsu-Siemens Computers, note the "FSC" string.
The system BIOS rejects memory modules that don't have this information starting at offset 128h.
Some Packard Bell AMD laptops also use this method, in this case the symptoms can vary but it can lead to a flashing cursor rather than a beep pattern. Incidentally this can also be a symptom of BIOS corruption as well. Though upgrading a 2GB to a 4GB can also lead to issues.

Reading and writing SPD information

Memory module manufacturers write the SPD information to the EEPROM on the module. Motherboard BIOSes read the SPD information to configure the memory controller. There exist several programs that are able to read and modify SPD information on most, but not all motherboard chipsets.
Chipset-independent reading and writing of SPD information is done by accessing the memory's EEPROM directly with eeprom programmer hardware and software.
A not so common use for old laptops is as generic SMBus readers, as the internal EEPROM on the module can be disabled once the BIOS has read it so the bus is essentially available for use. The method used is to pull low the A0,A1 lines so the internal memory shuts down, allowing the external device to access the SMBus. Once this is done, a custom Linux build or DOS application can then access the external device. A common use is recovering data from LCD panel memory chips to retrofit a generic panel into a proprietary laptop.
On some chips it is also a good idea to separate write protect lines so that the onboard chips do not get wiped during reprogramming.
A related technique is rewriting the chip on webcams often included with many laptops as the bus speed is substantially higher and can even be modified so that 25x compatible chips can be read back for later cloning of the uEFI in the event of a chip failure.
This unfortunately only works on DDR3 and below, as DDR4 uses different security and can usually only be read. Its possible to use a tool like SPDTool or similar and replace the chip with one that has its WP line free so it can be altered in situ.
On some chipsets the message "Incompatible SMBus driver?" may be seen so read is also prevented.

On older equipment

Some older equipment require the use of SIMMs with parallel presence detect. Some of this equipment uses non-standard PD coding, IBM computers and Hewlett-Packard LaserJet and other printers in particular.