From 707e03d8b90cf8a25520b7c5db4fa76d3a276f6a Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Thu, 17 Dec 2020 11:37:20 +0100 Subject: mb/prodrive/hermes: Use already-defined SMBus macros Drop chipset register definitions in mainboard code in favor of existing definitions in a header. These definitions are not mainboard-specific. Tested with BUILD_TIMELESS=1, Prodrive Hermes remains identical. Change-Id: I29d6f35ec27bff43cf52ae697e905b6a7b48a8d1 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/48805 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Rudolph --- src/mainboard/prodrive/hermes/eeprom.c | 3 ++- src/mainboard/prodrive/hermes/variants/baseboard/include/eeprom.h | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/mainboard/prodrive') diff --git a/src/mainboard/prodrive/hermes/eeprom.c b/src/mainboard/prodrive/hermes/eeprom.c index 25fde349e6..cece32cf55 100644 --- a/src/mainboard/prodrive/hermes/eeprom.c +++ b/src/mainboard/prodrive/hermes/eeprom.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "variants/baseboard/include/eeprom.h" /* @@ -32,7 +33,7 @@ bool read_write_config(u8 addr, void *blob, size_t read_offset, size_t write_off int ret = 0; u32 smb_ctrl_reg = pci_read_config32(PCH_DEV_SMBUS, HOSTC); - pci_write_config32(PCH_DEV_SMBUS, HOSTC, smb_ctrl_reg | HOSTC_I2C_EN); + pci_write_config32(PCH_DEV_SMBUS, HOSTC, smb_ctrl_reg | I2C_EN); printk(BIOS_SPEW, "%s\tOffset: %04zx\tSize: %02zx\n", __func__, read_offset, size); diff --git a/src/mainboard/prodrive/hermes/variants/baseboard/include/eeprom.h b/src/mainboard/prodrive/hermes/variants/baseboard/include/eeprom.h index 85edbcf903..bdfce8a278 100644 --- a/src/mainboard/prodrive/hermes/variants/baseboard/include/eeprom.h +++ b/src/mainboard/prodrive/hermes/variants/baseboard/include/eeprom.h @@ -2,9 +2,6 @@ #include -#define HOSTC 0x40 -#define SMBUS_IO_BASE 0xefa0 -#define HOSTC_I2C_EN (1 << 2) #define I2C_ADDR_EEPROM 0x57 #if ENV_ROMSTAGE -- cgit v1.2.3