xref: /openbmc/qemu/include/hw/i2c/smbus_eeprom.h (revision 93198b6cad8af03996373584284a1673ad6000cb)
1*93198b6cSCorey Minyard /*
2*93198b6cSCorey Minyard  * QEMU SMBus EEPROM API
3*93198b6cSCorey Minyard  *
4*93198b6cSCorey Minyard  * Permission is hereby granted, free of charge, to any person obtaining a copy
5*93198b6cSCorey Minyard  * of this software and associated documentation files (the "Software"), to deal
6*93198b6cSCorey Minyard  * in the Software without restriction, including without limitation the rights
7*93198b6cSCorey Minyard  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8*93198b6cSCorey Minyard  * copies of the Software, and to permit persons to whom the Software is
9*93198b6cSCorey Minyard  * furnished to do so, subject to the following conditions:
10*93198b6cSCorey Minyard  *
11*93198b6cSCorey Minyard  * The above copyright notice and this permission notice shall be included in
12*93198b6cSCorey Minyard  * all copies or substantial portions of the Software.
13*93198b6cSCorey Minyard  *
14*93198b6cSCorey Minyard  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*93198b6cSCorey Minyard  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*93198b6cSCorey Minyard  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17*93198b6cSCorey Minyard  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18*93198b6cSCorey Minyard  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19*93198b6cSCorey Minyard  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20*93198b6cSCorey Minyard  * THE SOFTWARE.
21*93198b6cSCorey Minyard  */
22*93198b6cSCorey Minyard 
23*93198b6cSCorey Minyard #ifndef HW_SMBUS_EEPROM_H
24*93198b6cSCorey Minyard #define HW_SMBUS_EEPROM_H
25*93198b6cSCorey Minyard 
26*93198b6cSCorey Minyard #include "hw/i2c/i2c.h"
27*93198b6cSCorey Minyard 
28*93198b6cSCorey Minyard void smbus_eeprom_init_one(I2CBus *bus, uint8_t address, uint8_t *eeprom_buf);
29*93198b6cSCorey Minyard void smbus_eeprom_init(I2CBus *bus, int nb_eeprom,
30*93198b6cSCorey Minyard                        const uint8_t *eeprom_spd, int size);
31*93198b6cSCorey Minyard 
32*93198b6cSCorey Minyard enum sdram_type { SDR = 0x4, DDR = 0x7, DDR2 = 0x8 };
33*93198b6cSCorey Minyard uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t size, Error **errp);
34*93198b6cSCorey Minyard 
35*93198b6cSCorey Minyard #endif
36