From ad29ec351e52b9d326d50c558c3af4b54a2e61d4 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Fri, 5 May 2017 21:08:00 +0200 Subject: sb/intel/i82801gx: Implement smbus block r/w functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uses common hardware access functions to make smbus block read and write available in romstage. Those are needed to reconfigure the clockgen on smbus offset 0x69, which is sometimes needed for things like CPU C-states or analog display out to work properly. Change-Id: I0a06178d2474ce65972de157cb437b42f3354da0 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/19594 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Damien Zammit Reviewed-by: Sumeet R Pawnikar Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Kyösti Mälkki --- src/southbridge/intel/i82801gx/early_smbus.c | 11 +++++++++++ src/southbridge/intel/i82801gx/i82801gx.h | 3 +++ 2 files changed, 14 insertions(+) (limited to 'src/southbridge/intel') diff --git a/src/southbridge/intel/i82801gx/early_smbus.c b/src/southbridge/intel/i82801gx/early_smbus.c index 5d204e9527..bb5caf5ca0 100644 --- a/src/southbridge/intel/i82801gx/early_smbus.c +++ b/src/southbridge/intel/i82801gx/early_smbus.c @@ -59,3 +59,14 @@ int i2c_block_read(unsigned int device, unsigned int offset, u32 bytes, u8 *buf) { return do_i2c_block_read(SMBUS_IO_BASE, device, offset, bytes, buf); } + +int smbus_block_read(unsigned int device, unsigned int cmd, u8 bytes, u8 *buf) +{ + return do_smbus_block_read(SMBUS_IO_BASE, device, cmd, bytes, buf); +} + +int smbus_block_write(unsigned int device, unsigned int cmd, u8 bytes, + const u8 *buf) +{ + return do_smbus_block_write(SMBUS_IO_BASE, device, cmd, bytes, buf); +} diff --git a/src/southbridge/intel/i82801gx/i82801gx.h b/src/southbridge/intel/i82801gx/i82801gx.h index d1c861ddeb..b3c1b48ec2 100644 --- a/src/southbridge/intel/i82801gx/i82801gx.h +++ b/src/southbridge/intel/i82801gx/i82801gx.h @@ -52,6 +52,9 @@ void enable_smbus(void); int smbus_read_byte(unsigned int device, unsigned int address); int i2c_block_read(unsigned int device, unsigned int cmd, unsigned int bytes, u8 *buf); +int smbus_block_read(unsigned int device, unsigned int cmd, u8 bytes, u8 *buf); +int smbus_block_write(unsigned int device, unsigned int cmd, u8 bytes, + const u8 *buf); int southbridge_detect_s3_resume(void); #endif #endif -- cgit v1.2.3