mb/prodrive/hermes: Use snake case for identifiers
There's no reason to use camel case for EEPROM region names or local variables. Use snake case for consistency with coreboot's code style. Change-Id: Id1200a0c778095b109d824a1ca4e3e69591e4165 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/67274 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Reviewed-by: Christian Walter <christian.walter@9elements.com> Reviewed-by: Martin L Roth <gaumless@gmail.com>
This commit is contained in:
parent
25d16291d4
commit
38688519cf
|
@ -39,7 +39,7 @@ int check_signature(const size_t offset, const uint64_t signature)
|
||||||
*/
|
*/
|
||||||
static bool get_board_settings_from_eeprom(struct eeprom_board_settings *board_cfg)
|
static bool get_board_settings_from_eeprom(struct eeprom_board_settings *board_cfg)
|
||||||
{
|
{
|
||||||
const size_t board_settings_offset = offsetof(struct eeprom_layout, BoardSettings);
|
const size_t board_settings_offset = offsetof(struct eeprom_layout, board_settings);
|
||||||
|
|
||||||
if (eeprom_read_buffer(board_cfg, board_settings_offset, sizeof(*board_cfg))) {
|
if (eeprom_read_buffer(board_cfg, board_settings_offset, sizeof(*board_cfg))) {
|
||||||
printk(BIOS_ERR, "CFG EEPROM: Failed to read board settings\n");
|
printk(BIOS_ERR, "CFG EEPROM: Failed to read board settings\n");
|
||||||
|
@ -72,7 +72,7 @@ struct eeprom_board_settings *get_board_settings(void)
|
||||||
|
|
||||||
struct eeprom_bmc_settings *get_bmc_settings(void)
|
struct eeprom_bmc_settings *get_bmc_settings(void)
|
||||||
{
|
{
|
||||||
const size_t bmc_settings_offset = offsetof(struct eeprom_layout, BMCSettings);
|
const size_t bmc_settings_offset = offsetof(struct eeprom_layout, bmc_settings);
|
||||||
static struct eeprom_bmc_settings bmc_cfg = {0};
|
static struct eeprom_bmc_settings bmc_cfg = {0};
|
||||||
|
|
||||||
/* 0: uninitialized, 1: settings are valid */
|
/* 0: uninitialized, 1: settings are valid */
|
||||||
|
@ -120,10 +120,10 @@ bool eeprom_read_buffer(void *blob, size_t read_offset, size_t size)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Write to UPD */
|
/* Write to UPD */
|
||||||
uint8_t *writePointer = (uint8_t *)blob + i;
|
uint8_t *write_ptr = (uint8_t *)blob + i;
|
||||||
writePointer[0] = tmp[0];
|
write_ptr[0] = tmp[0];
|
||||||
if (size - i > 1)
|
if (size - i > 1)
|
||||||
writePointer[1] = tmp[1];
|
write_ptr[1] = tmp[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Restore I2C_EN bit */
|
/* Restore I2C_EN bit */
|
||||||
|
@ -182,7 +182,7 @@ static bool eeprom_write_byte(const uint8_t data, const uint16_t write_offset)
|
||||||
*/
|
*/
|
||||||
bool write_board_settings(const struct eeprom_board_layout *new_layout)
|
bool write_board_settings(const struct eeprom_board_layout *new_layout)
|
||||||
{
|
{
|
||||||
const size_t off = offsetof(struct eeprom_layout, BoardLayout);
|
const size_t off = offsetof(struct eeprom_layout, board_layout);
|
||||||
struct eeprom_board_layout old_layout = {0};
|
struct eeprom_board_layout old_layout = {0};
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
|
|
@ -73,27 +73,27 @@ struct __packed eeprom_bmc_settings {
|
||||||
/* The EEPROM on address 0x57 has the following vendor defined layout: */
|
/* The EEPROM on address 0x57 has the following vendor defined layout: */
|
||||||
struct __packed eeprom_layout {
|
struct __packed eeprom_layout {
|
||||||
union {
|
union {
|
||||||
uint8_t RawFSPMUPD[0x600];
|
uint8_t raw_fspm_upd[0x600];
|
||||||
FSPM_UPD mupd;
|
FSPM_UPD mupd;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
uint8_t RawFSPSUPD[0xc00];
|
uint8_t raw_fsps_upd[0xc00];
|
||||||
FSPS_UPD supd;
|
FSPS_UPD supd;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
uint8_t RawBoardLayout[0x400];
|
uint8_t raw_board_layout[0x400];
|
||||||
struct eeprom_board_layout BoardLayout;
|
struct eeprom_board_layout board_layout;
|
||||||
};
|
};
|
||||||
char system_serial_number[HERMES_SERIAL_NUMBER_LENGTH];
|
char system_serial_number[HERMES_SERIAL_NUMBER_LENGTH];
|
||||||
char board_serial_number[HERMES_SERIAL_NUMBER_LENGTH];
|
char board_serial_number[HERMES_SERIAL_NUMBER_LENGTH];
|
||||||
uint8_t BootOrder[0x8c0];
|
uint8_t boot_order[0x8c0];
|
||||||
union {
|
union {
|
||||||
uint8_t RawBoardSetting[0xf8];
|
uint8_t raw_board_settings[0xf8];
|
||||||
struct eeprom_board_settings BoardSettings;
|
struct eeprom_board_settings board_settings;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
uint8_t RawBMCSetting[0x8];
|
uint8_t raw_bmc_settings[0x8];
|
||||||
struct eeprom_bmc_settings BMCSettings;
|
struct eeprom_bmc_settings bmc_settings;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -123,5 +123,5 @@ bool write_board_settings(const struct eeprom_board_layout *new_layout);
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define READ_EEPROM_FSP_M(dest, opt_name) READ_EEPROM(FSPM_UPD, RawFSPMUPD, dest, opt_name)
|
#define READ_EEPROM_FSP_M(dest, opt_name) READ_EEPROM(FSPM_UPD, raw_fspm_upd, dest, opt_name)
|
||||||
#define READ_EEPROM_FSP_S(dest, opt_name) READ_EEPROM(FSPS_UPD, RawFSPSUPD, dest, opt_name)
|
#define READ_EEPROM_FSP_S(dest, opt_name) READ_EEPROM(FSPS_UPD, raw_fsps_upd, dest, opt_name)
|
||||||
|
|
Loading…
Reference in New Issue