Clean up SPD type handling with unions
This commit is contained in:
@@ -47,16 +47,6 @@
|
||||
#define SPD_SDR_ATTR_VCC_HI_5 0x20
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t slot;
|
||||
uint16_t size;
|
||||
uint16_t row1;
|
||||
uint16_t row2;
|
||||
|
||||
uint8_t data[SPD_DATA_SIZE];
|
||||
void *eeprom;
|
||||
} spd_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t bytes_used, spd_size, mem_type,
|
||||
row_bits, col_bits, banks,
|
||||
@@ -99,6 +89,20 @@ typedef struct {
|
||||
checksum2;
|
||||
} spd_sdram_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t slot;
|
||||
uint16_t size;
|
||||
uint16_t row1;
|
||||
uint16_t row2;
|
||||
|
||||
union {
|
||||
uint8_t data[SPD_DATA_SIZE];
|
||||
spd_edo_t edo_data;
|
||||
spd_sdram_t sdram_data;
|
||||
};
|
||||
void *eeprom;
|
||||
} spd_t;
|
||||
|
||||
|
||||
extern void spd_register(uint8_t ram_type, uint8_t slot_mask, uint16_t max_module_size);
|
||||
extern void spd_write_drbs(uint8_t *regs, uint8_t reg_min, uint8_t reg_max, uint8_t drb_unit);
|
||||
|
||||
Reference in New Issue
Block a user