summaryrefslogtreecommitdiff
path: root/include/i2c_ite_flash_support.h
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2020-02-10 16:05:20 -0700
committerCommit Bot <commit-bot@chromium.org>2020-02-25 02:28:19 +0000
commit6331dd76feaa4dfeb5f66635f8b570b884380cb7 (patch)
tree9056a777a62ffb14e3dacd6e4551dfed3ca4387a /include/i2c_ite_flash_support.h
parentb7de2bf7b2879d582f0c9878034e6f2bba55cbe5 (diff)
downloadchrome-ec-6331dd76feaa4dfeb5f66635f8b570b884380cb7.tar.gz
servo_micro: move ite flashing code
In preparation for servo_micro and c2d2 to sharing the ite, i2c flashing code, move it to a stm specify common file. It is STM specific because it explicitly uses STM registers to accomplish the non-compliant i2c waveforms needed to put the ITE EC into flash mode. BRANCH=servo BUG=b:148610186,b:79684405 TEST=flash ampton with servo_micro using this code Change-Id: Ia0f3f944df2f8a8ad47ea5a62c5f0edae2c71943 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2064592 Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'include/i2c_ite_flash_support.h')
-rw-r--r--include/i2c_ite_flash_support.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/i2c_ite_flash_support.h b/include/i2c_ite_flash_support.h
new file mode 100644
index 0000000000..e926fe2539
--- /dev/null
+++ b/include/i2c_ite_flash_support.h
@@ -0,0 +1,27 @@
+/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+/* API for module that provides flash support for ITE-based ECs over i2c */
+
+#ifndef __CROS_EC_I2C_ITE_FLASH_SUPPORT_H
+#define __CROS_EC_I2C_ITE_FLASH_SUPPORT_H
+
+#include "gpio.h"
+#include "stdbool.h"
+
+struct ite_dfu_config_t {
+ /* I2C port to communicate on */
+ int i2c_port;
+ /*
+ * The gpio signals that moved between TIM16/17 (MODULE_I2C_TIMERS) and
+ * I2C (MODULE_I2C).
+ */
+ enum gpio_signal scl;
+ enum gpio_signal sda;
+};
+
+/* Provided by board implementation if CONFIG_ITE_FLASH_SUPPORT is used */
+const extern struct ite_dfu_config_t ite_dfu_config;
+
+#endif /* __CROS_EC_I2C_ITE_FLASH_SUPPORT_H */