summaryrefslogtreecommitdiff
path: root/src/soc/amd/common/block
diff options
context:
space:
mode:
authorFelix Held <felix.held@amd.corp-partner.google.com>2021-09-08 00:37:30 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-09-09 14:20:35 +0000
commit7bbde76014a571cbe2344615f19b1e9bc905b84a (patch)
treeaf97dd4cea8ad4282d5339fe6923dc2e3251ef48 /src/soc/amd/common/block
parentfd63e11f714eb1e908df2005d9becb492a5247e9 (diff)
soc/amd/common/block/include/i2c: introduce I2C_RESET_SCL_PIN macro
Add and use the I2C_RESET_SCL_PIN macro for populating the i2c_scl_pins array that is used for the sb_reset_i2c_peripherals call to bring the I2C buses into a defined state. TEST=Timeless build results in identical image for Mandolin. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Suggested-by: Raul E Rangel <rrangel@chromium.org> Change-Id: Ifedc09d0bf745545fa0510df7d5037f02b9012a6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/57479 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/soc/amd/common/block')
-rw-r--r--src/soc/amd/common/block/include/amdblocks/i2c.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/include/amdblocks/i2c.h b/src/soc/amd/common/block/include/amdblocks/i2c.h
index 4a7a7e83a0..22a408ec92 100644
--- a/src/soc/amd/common/block/include/amdblocks/i2c.h
+++ b/src/soc/amd/common/block/include/amdblocks/i2c.h
@@ -35,6 +35,13 @@ struct soc_i2c_scl_pin {
uint8_t pin_mask;
};
+/* Macro to populate the elements of the array of soc_i2c_scl_pin in the SoC code */
+#define I2C_RESET_SCL_PIN(pin_name, pin_mask_value) \
+{ \
+ .pin = PAD_CFG_STRUCT(pin_name, pin_name ## _IOMUX_GPIOxx, PAD_OUTPUT(HIGH)), \
+ .pin_mask = pin_mask_value, \
+}
+
/**
* Information about I2C peripherals that need to be reset.
* @i2c_scl_reset_mask: Bit mask of I2C buses that need to be reset based on the device tree