summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-03-18 12:10:11 -0600
committerCommit Bot <commit-bot@chromium.org>2022-03-18 19:59:14 +0000
commit2f3d1a3f4c13fc474adb4a2f6a1448f99cf8fd60 (patch)
tree8897bc3cf6d4bb3c6b88297dd783d640fc3e55a9
parent161ef2f24c16eb94f6dd7b790d895abfc0e02e27 (diff)
downloadchrome-ec-2f3d1a3f4c13fc474adb4a2f6a1448f99cf8fd60.tar.gz
zephyr: test-drivers: Set EC GPIO init before I2C
CL:3520139 changes the I2C init priority from 60 to 50, thus, blowing up a write failed when GPIO wasn't initialized yet. Change the init priority for this test. BUG=none BRANCH=none TEST=With CL:3520139, test passes Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I3ccfbbb2bb160b9b94a29dc10c8a6847221548d3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3536610 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
-rw-r--r--zephyr/test/drivers/prj.conf1
-rw-r--r--zephyr/test/drivers/src/ppc_sn5s330.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/zephyr/test/drivers/prj.conf b/zephyr/test/drivers/prj.conf
index ea5b5aa669..6efa6958db 100644
--- a/zephyr/test/drivers/prj.conf
+++ b/zephyr/test/drivers/prj.conf
@@ -48,6 +48,7 @@ CONFIG_I2C=y
CONFIG_I2C_EMUL=y
CONFIG_GPIO=y
CONFIG_GPIO_EMUL=y
+CONFIG_PLATFORM_EC_GPIO_INIT_PRIORITY=49
CONFIG_EEPROM=y
CONFIG_EEPROM_AT24=y
CONFIG_EEPROM_SIMULATOR=n
diff --git a/zephyr/test/drivers/src/ppc_sn5s330.c b/zephyr/test/drivers/src/ppc_sn5s330.c
index bddab927dc..bf57becbc3 100644
--- a/zephyr/test/drivers/src/ppc_sn5s330.c
+++ b/zephyr/test/drivers/src/ppc_sn5s330.c
@@ -193,6 +193,10 @@ ZTEST(ppc_sn5s330, test_vbus_source_sink_enable)
zassert_equal(func_set3_reg & SN5S330_PP2_EN, 0, NULL);
}
+/* This test depends on EC GIPO initialization happening before I2C */
+BUILD_ASSERT(
+ CONFIG_PLATFORM_EC_GPIO_INIT_PRIORITY < CONFIG_I2C_INIT_PRIORITY,
+ "GPIO initialization must happen before I2C");
ZTEST(ppc_sn5s330, test_vbus_discharge)
{
const struct emul *emul = EMUL;