diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2020-01-01 17:42:45 +0200 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2020-01-09 18:44:14 +0000 |
commit | 265cd9a2ee0bc738bf6d0dfd838b24168c8cefb9 (patch) | |
tree | 527008ffd54c9bb678185ea7fa3262c537685e9e /src/soc/intel | |
parent | 756646757e6608934bc544c0e066443f9c428c79 (diff) | |
download | coreboot-265cd9a2ee0bc738bf6d0dfd838b24168c8cefb9.tar.xz |
soc/intel/common: Remove extra call layer
Change-Id: I6987eb58b593e1f2bc6adf91be61bf7b5382440d
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38122
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel')
-rw-r--r-- | src/soc/intel/common/block/smbus/smbuslib.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/soc/intel/common/block/smbus/smbuslib.c b/src/soc/intel/common/block/smbus/smbuslib.c index 0680ce2b8e..0004ba7709 100644 --- a/src/soc/intel/common/block/smbus/smbuslib.c +++ b/src/soc/intel/common/block/smbus/smbuslib.c @@ -178,21 +178,6 @@ int do_smbus_read_word(unsigned int smbus_base, u8 device, unsigned int address) return data; } -static u16 smbus_read_word(u8 addr, u8 offset) -{ - return do_smbus_read_word(SMBUS_IO_BASE, addr, offset); -} - -static u8 smbus_read_byte(u8 addr, u8 offset) -{ - return do_smbus_read_byte(SMBUS_IO_BASE, addr, offset); -} - -static u8 smbus_write_byte(u8 addr, u8 offset, u8 value) -{ - return do_smbus_write_byte(SMBUS_IO_BASE, addr, offset, value); -} - static void update_spd_len(struct spd_block *blk) { u8 i, j = 0; @@ -218,15 +203,15 @@ static void smbus_read_spd(u8 *spd, u8 addr) for (i = 0; i < SPD_PAGE_LEN; i += step) { if (CONFIG(SPD_READ_BY_WORD)) ((u16*)spd)[i / sizeof(uint16_t)] = - smbus_read_word(addr, i); + do_smbus_read_word(SMBUS_IO_BASE, addr, i); else - spd[i] = smbus_read_byte(addr, i); + spd[i] = do_smbus_read_byte(SMBUS_IO_BASE, addr, i); } } static void get_spd(u8 *spd, u8 addr) { - if (smbus_read_byte(addr, 0) == 0xff) { + if (do_smbus_read_byte(SMBUS_IO_BASE, addr, 0) == 0xff) { printk(BIOS_INFO, "No memory dimm at address %02X\n", addr << 1); /* Make sure spd is zeroed if dimm doesn't exist. */ @@ -239,10 +224,10 @@ static void get_spd(u8 *spd, u8 addr) if (spd[SPD_DRAM_TYPE] == SPD_DRAM_DDR4 && CONFIG_DIMM_SPD_SIZE > SPD_PAGE_LEN) { /* Switch to page 1 */ - smbus_write_byte(SPD_PAGE_1, 0, 0); + do_smbus_write_byte(SMBUS_IO_BASE, SPD_PAGE_1, 0, 0); smbus_read_spd(spd + SPD_PAGE_LEN, addr); /* Restore to page 0 */ - smbus_write_byte(SPD_PAGE_0, 0, 0); + do_smbus_write_byte(SMBUS_IO_BASE, SPD_PAGE_0, 0, 0); } } |