Skip to content

Commit 6150e5e

Browse files
groeckgregkh
authored andcommitted
eeprom: ee1004: Instantiate jc42 devices for DIMMS implementing Rev.1 SPD
DDR4 DIMMS implementing SPD Annex L, Revision 1 do not implement SPD byte 14 (Module Temperature Sensor); this byte was only added in revision 2 of the standard. This only applies to DDR4, not DDR4E or LPDDR4, since those DDR types were only introduced in revision 3 of the standard. Use this information to instantiate the jc42 device if the module is a DDR4 following SPD revision 1.0 and a device is detected at the expected thermal sensor address, even if the Module Temperature Sensor byte suggests that the thermal sensor is not supported. Cc: Heiner Kallweit <[email protected]> Cc: Thomas Weißschuh <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 249b4de commit 6150e5e

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

drivers/misc/eeprom/ee1004.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,31 @@ static void ee1004_probe_temp_sensor(struct i2c_client *client)
186186
struct i2c_board_info info = { .type = "jc42" };
187187
unsigned short addr = 0x18 | (client->addr & 7);
188188
unsigned short addr_list[] = { addr, I2C_CLIENT_END };
189-
u8 byte14;
189+
u8 data[2];
190190
int ret;
191191

192192
/* byte 14, bit 7 is set if temp sensor is present */
193-
ret = ee1004_eeprom_read(client, &byte14, 14, 1);
194-
if (ret != 1 || !(byte14 & BIT(7)))
193+
ret = ee1004_eeprom_read(client, data, 14, 1);
194+
if (ret != 1)
195195
return;
196196

197+
if (!(data[0] & BIT(7))) {
198+
/*
199+
* If the SPD data suggests that there is no temperature
200+
* sensor, it may still be there for SPD revision 1.0.
201+
* See SPD Annex L, Revision 1 and 2, for details.
202+
* Check DIMM type and SPD revision; if it is a DDR4
203+
* with SPD revision 1.0, check the thermal sensor address
204+
* and instantiate the jc42 driver if a chip is found at
205+
* that address.
206+
* It is not necessary to check if there is a chip at the
207+
* temperature sensor address since i2c_new_scanned_device()
208+
* will do that and return silently if no chip is found.
209+
*/
210+
ret = ee1004_eeprom_read(client, data, 1, 2);
211+
if (ret != 2 || data[0] != 0x10 || data[1] != 0x0c)
212+
return;
213+
}
197214
i2c_new_scanned_device(client->adapter, &info, addr_list, NULL);
198215
}
199216

0 commit comments

Comments
 (0)