From e59f18bf29a8db4447100c57d3400ec432a94961 Mon Sep 17 00:00:00 2001 From: Jan Samek Date: Wed, 12 Apr 2023 14:36:02 +0200 Subject: drivers/i2c: Add PI7C9X2G608GP PCIe switch driver (pi608gp) This patch adds some of the variety of configuration options exported by the Pericom Inc. PI7C9X2G608GP PCIe switch over its SMBus interface. Currently implemented options are only used to adjust the switch upstream port amplitude and de-emphasis levels in millivolts. Only values specified in the switch datasheet (in tables 6-6 and 6-8) are allowed. Example of a devicetree.cb entry: chip drivers/i2c/pi608gp register "gen2_3p5_enable" = "true" register "gen2_3p5_amp" = "AMP_LVL_MV(425)" register "gen2_3p5_deemph" = \ "DEEMPH_LVL_MV(37, 5)" device i2c 0x6f on ops pi608gp_ops end end Link to the datasheet: https://web.archive.org/web/20210225074853/https://www.diodes.com/assets/Datasheets/PI7C9X2G608GP.pdf BUG=none TEST=Create devicetree.cb and Kconfig entries for this driver in a mainboard containing the switch and verify, that the values read out from the switch config space match the values programmed over the SMBus. Change-Id: Id191c4e97b99da58efd3ba38bf8cca3603ece4d5 Signed-off-by: Jan Samek Reviewed-on: https://review.coreboot.org/c/coreboot/+/74433 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held Reviewed-by: Mario Scheithauer --- src/drivers/i2c/pi608gp/chip.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/drivers/i2c/pi608gp/chip.h (limited to 'src/drivers/i2c/pi608gp/chip.h') diff --git a/src/drivers/i2c/pi608gp/chip.h b/src/drivers/i2c/pi608gp/chip.h new file mode 100644 index 0000000000..ca4a8c47ae --- /dev/null +++ b/src/drivers/i2c/pi608gp/chip.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef __DRIVERS_I2C_PI608GP_CHIP_H__ +#define __DRIVERS_I2C_PI608GP_CHIP_H__ + +#include "pi608gp.h" + +struct drivers_i2c_pi608gp_config { + bool gen2_3p5_enable; + uint32_t gen2_3p5_amp; + struct deemph_lvl gen2_3p5_deemph; +}; + +#endif /* __DRIVERS_I2C_PI608GP_CHIP_H__ */ -- cgit v1.2.3