summaryrefslogtreecommitdiff
path: root/src/drivers/i2c/pi608gp/chip.h
diff options
context:
space:
mode:
authorJan Samek <jan.samek@siemens.com>2023-04-12 14:36:02 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-05-08 13:11:22 +0000
commite59f18bf29a8db4447100c57d3400ec432a94961 (patch)
tree341552fe9873700dbdb3f8b843fbd0a94192d36b /src/drivers/i2c/pi608gp/chip.h
parent995772f0c3126672773983cb8e7a7d8f0b23b379 (diff)
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 <jan.samek@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/74433 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Diffstat (limited to 'src/drivers/i2c/pi608gp/chip.h')
-rw-r--r--src/drivers/i2c/pi608gp/chip.h14
1 files changed, 14 insertions, 0 deletions
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__ */