From b296b664abc732532afb732f1d02d22cae9c847a Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Thu, 3 Jan 2019 17:27:24 +0100 Subject: smbus: Add a helper to generate SPD EEPROM data There are several boards with SPD EEPROMs that are now using duplicated or slightly different hard coded data. Add a helper to generate SPD data for a memory module of given type and size that could be used by these boards (either as is or with further changes if needed) which should help cleaning this up and avoid further duplication. Signed-off-by: BALATON Zoltan Signed-off-by: David Gibson --- include/hw/i2c/smbus.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/hw/i2c/smbus.h b/include/hw/i2c/smbus.h index 5c61c05999..89dfea1a08 100644 --- a/include/hw/i2c/smbus.h +++ b/include/hw/i2c/smbus.h @@ -95,4 +95,7 @@ void smbus_eeprom_init_one(I2CBus *smbus, uint8_t address, uint8_t *eeprom_buf); void smbus_eeprom_init(I2CBus *smbus, int nb_eeprom, const uint8_t *eeprom_spd, int size); +enum sdram_type { SDR = 0x4, DDR = 0x7, DDR2 = 0x8 }; +uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t size, Error **errp); + #endif -- cgit v1.2.3