summaryrefslogtreecommitdiff
path: root/board/it8xxx2_evb/board.c
diff options
context:
space:
mode:
authorRuibin Chang <ruibin.chang@ite.com.tw>2020-03-11 17:00:10 +0800
committerCommit Bot <commit-bot@chromium.org>2020-03-12 06:09:33 +0000
commit3426fb1e93654ff2bba8b7ea7c2e143487462d18 (patch)
treeea94c1578f33b5446ac78463e5051c93c1cd7165 /board/it8xxx2_evb/board.c
parent72c922bd73f22fc1f3cea29d078516017c56e83c (diff)
downloadchrome-ec-3426fb1e93654ff2bba8b7ea7c2e143487462d18.tar.gz
baseboard/ite_evb: create ite_evb baseboard
The development board of it83xx and it8xxx2 have common code and config options which are moved to baseboard ite_evb. And we create another board for PD EVB based on baseboard ite_evb. BUG=none BRANCH=none TEST=on baseboard ite_evb: 1.test board it83xx_evb and it8xxx2_evb: successfully Flash EC image and boot on chip it8320 and it83202. 2.flashrom by ite_spi test: $ sudo ./util/flash_ec --board=it8xxx2_evb --verbose INFO: Using servo_v2. INFO: Using ec image : /mnt/host/source/src/platform/ec/build/ it8xxx2_evb/ec.bin dut-control --port=9999 i2c_mux_en:on dut-control --port=9999 i2c_mux:remote_adc INFO: Flashing chip ite_spi. dut-control --port=9999 cold_reset:on dut-control --port=9999 fw_up:on dut-control --port=9999 cold_reset:off dut-control --port=9999 fw_up:off dut-control --port=9999 spi1_vref:pp1800 spi1_buf_en:on dut-control --port=9999 spi1_buf_on_flex_en:on INFO: Running flashrom: sudo /usr/sbin/flashrom -p ft2232_spi:type=servo-v2,port=B, serial=911416-00012 --flash-size flashrom v0.9.9 : : on Linux 4.15.0-76-generic (x86_64) flashrom v0.9.9 : : on Linux 4.15.0-76-generic (x86_64) INFO: Programming EC firmware image. INFO: Running flashrom: /usr/sbin/flashrom -p ft2232_spi:type=servo-v2,port=B, serial=911416-00012 -w /tmp/flash_spi_6163 flashrom v0.9.9 : : on Linux 4.15.0-76-generic (x86_64) flashrom v0.9.9 : : on Linux 4.15.0-76-generic (x86_64) Calibrating delay loop... OK. Erasing and writing flash chip... Verifying flash... VERIFIED. SUCCESS INFO: Flashing done. INFO: Restoring servo settings... dut-control --port=9999 cold_reset:off dut-control --port=9999 i2c_mux_en:on dut-control --port=9999 i2c_mux:remote_adc dut-control --port=9999 spi1_vref:off dut-control --port=9999 spi1_buf_en:off dut-control --port=9999 spi1_buf_on_flex_en:off dut-control --port=9999 cold_reset:on dut-control --port=9999 cold_reset:off 3.test board it8xxx2_pdevb: successfully Flash EC image and boot on chip it83202. Connection with adapter and dongle are able to ready state. Change-Id: Ib6371b61c27980eb9977548177efb8c896e72d47 Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw> Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2071551 Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board/it8xxx2_evb/board.c')
-rw-r--r--board/it8xxx2_evb/board.c79
1 files changed, 79 insertions, 0 deletions
diff --git a/board/it8xxx2_evb/board.c b/board/it8xxx2_evb/board.c
new file mode 100644
index 0000000000..082b8c0d9f
--- /dev/null
+++ b/board/it8xxx2_evb/board.c
@@ -0,0 +1,79 @@
+/* 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.
+ */
+/* IT8xxx2 development board configuration */
+
+#include "adc_chip.h"
+#include "pwm.h"
+#include "pwm_chip.h"
+
+/*
+ * PWM channels. Must be in the exactly same order as in enum pwm_channel.
+ * There total three 16 bits clock prescaler registers for all pwm channels,
+ * so use the same frequency and prescaler register setting is required if
+ * number of pwm channel greater than three.
+ */
+const struct pwm_t pwm_channels[] = {
+ [PWM_CH_FAN] = {
+ .channel = PWM_HW_CH_DCR7,
+ .flags = 0,
+ .freq_hz = 30000,
+ .pcfsr_sel = PWM_PRESCALER_C4,
+ },
+ [PWM_CH_WITH_DSLEEP_FLAG] = {
+ .channel = PWM_HW_CH_DCR0,
+ .flags = PWM_CONFIG_DSLEEP,
+ .freq_hz = 100,
+ .pcfsr_sel = PWM_PRESCALER_C6,
+ },
+};
+BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
+
+/* ADC channels. Must be in the exactly same order as in enum adc_channel. */
+const struct adc_t adc_channels[] = {
+ /* Convert to mV (3000mV/1024). */
+ [ADC_VBUSSA] = {
+ .name = "ADC_VBUSSA",
+ .factor_mul = ADC_MAX_MVOLT,
+ .factor_div = ADC_READ_MAX + 1,
+ .shift = 0,
+ .channel = CHIP_ADC_CH0, /* GPI0, ADC0 */
+ },
+ [ADC_VBUSSB] = {
+ .name = "ADC_VBUSSB",
+ .factor_mul = ADC_MAX_MVOLT,
+ .factor_div = ADC_READ_MAX + 1,
+ .shift = 0,
+ .channel = CHIP_ADC_CH1, /* GPI1, ADC1 */
+ },
+ [ADC_EVB_CH_13] = {
+ .name = "ADC_EVB_CH_13",
+ .factor_mul = ADC_MAX_MVOLT,
+ .factor_div = ADC_READ_MAX + 1,
+ .shift = 0,
+ .channel = CHIP_ADC_CH13, /* GPL0, ADC13 */
+ },
+ [ADC_EVB_CH_14] = {
+ .name = "ADC_EVB_CH_14",
+ .factor_mul = ADC_MAX_MVOLT,
+ .factor_div = ADC_READ_MAX + 1,
+ .shift = 0,
+ .channel = CHIP_ADC_CH14, /* GPL1, ADC14 */
+ },
+ [ADC_EVB_CH_15] = {
+ .name = "ADC_EVB_CH_15",
+ .factor_mul = ADC_MAX_MVOLT,
+ .factor_div = ADC_READ_MAX + 1,
+ .shift = 0,
+ .channel = CHIP_ADC_CH15, /* GPL2, ADC15 */
+ },
+ [ADC_EVB_CH_16] = {
+ .name = "ADC_EVB_CH_16",
+ .factor_mul = ADC_MAX_MVOLT,
+ .factor_div = ADC_READ_MAX + 1,
+ .shift = 0,
+ .channel = CHIP_ADC_CH16, /* GPL3, ADC16 */
+ },
+};
+BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);