summaryrefslogtreecommitdiff
path: root/chip/it83xx/system.c
diff options
context:
space:
mode:
authorDino Li <dino.li@ite.com.tw>2016-04-18 15:41:27 +0800
committerchrome-bot <chrome-bot@chromium.org>2016-04-18 17:32:41 -0700
commit69668a04436700071bc2a26400f5f52f0e499020 (patch)
tree163d7ff68d473b703471e3639692041508ad0d93 /chip/it83xx/system.c
parent068cd0850684ee28a5a514e5a270edce2edb3979 (diff)
downloadchrome-ec-69668a04436700071bc2a26400f5f52f0e499020.tar.gz
chip: it83xx: add USBPD module
Add USBPD module for it8320 emulation board BRANCH=none BUG=none TEST=manual plug zinger adapter, connect uart console and type commands: pd 1 dev [20|12|5] pd 1 charger pd 1 swap power and check PD states Change-Id: I9ca1822deeb4b4dce1279a09490ed4175890cf3a Signed-off-by: Leon-Lee <leon.lee@ite.com.tw> Signed-off-by: Dino Li <dino.li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/326230 Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'chip/it83xx/system.c')
-rw-r--r--chip/it83xx/system.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/chip/it83xx/system.c b/chip/it83xx/system.c
index 94ef635f91..cc98fb4fd5 100644
--- a/chip/it83xx/system.c
+++ b/chip/it83xx/system.c
@@ -276,9 +276,11 @@ static int command_rw_ec_reg(int argc, char **argv)
{
volatile uint8_t *addr;
uint8_t value = 0;
+#ifdef CONFIG_EC2I
enum ec2i_message em;
enum logical_device_number ldn;
enum host_pnpcfg_index idx;
+#endif
int i;
char *e;
@@ -297,6 +299,7 @@ static int command_rw_ec_reg(int argc, char **argv)
/* access PNPCFG registers */
if (((uint32_t)addr & 0xffff0000) == 0xec210000) {
+#ifdef CONFIG_EC2I
/* set LDN */
ldn = ((uint32_t)addr & 0xff00) >> 8;
idx = (uint32_t)addr & 0xff;
@@ -326,6 +329,9 @@ static int command_rw_ec_reg(int argc, char **argv)
ccprintf(" %02x", value);
}
}
+#else
+ return EC_ERROR_ACCESS_DENIED;
+#endif
/* access EC registers */
} else {
/* write register */