summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDino Li <Dino.Li@ite.com.tw>2017-04-18 18:24:36 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-04-18 23:33:20 -0700
commit9b710e13cd2ef714ef656eb94383666f337f211e (patch)
tree394595616c60168d0f4dee9bb7089c06750d2c84
parent31efc1e864da2390d98abda1fedc479448e75942 (diff)
downloadchrome-ec-9b710e13cd2ef714ef656eb94383666f337f211e.tar.gz
it83xx: remove console command "rwreg"
We don't use this command so remove it to save flash space. BUG=none BRANCH=none TEST=build all. Change-Id: I7279c56add6ad2b07f0a9b3cdc0ed849f8176e61 Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/479976 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--chip/it83xx/system.c86
1 files changed, 0 insertions, 86 deletions
diff --git a/chip/it83xx/system.c b/chip/it83xx/system.c
index e9b7f37e45..bdae81daba 100644
--- a/chip/it83xx/system.c
+++ b/chip/it83xx/system.c
@@ -277,89 +277,3 @@ uintptr_t system_get_fw_reset_vector(uintptr_t base)
return reset_vector;
}
-
-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;
-
- if ((argc < 2) || (argc > 3))
- return EC_ERROR_PARAM_COUNT;
-
- addr = (uint8_t *)strtoi(argv[1], &e, 0);
- if (*e)
- return EC_ERROR_PARAM1;
-
- if (argc == 3) {
- value = (uint8_t)strtoi(argv[2], &e, 0);
- if (*e)
- return EC_ERROR_PARAM2;
- }
-
- /* 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;
- if (ec2i_write(HOST_INDEX_LDN, ldn) == EC2I_WRITE_ERROR)
- return EC_ERROR_UNKNOWN;
-
- /* ec2i write */
- if (argc == 3) {
- if (ec2i_write(idx, value) == EC2I_WRITE_ERROR)
- return EC_ERROR_UNKNOWN;
- em = ec2i_read(idx);
- if (em == EC2I_READ_ERROR)
- return EC_ERROR_UNKNOWN;
- value = em & 0xff;
- ccprintf("LDN%02X IDX%02X = %02x", ldn, idx, value);
- /* ec2i read */
- } else {
- for (i = 0; i < 256; i++) {
- em = ec2i_read(i);
- if (em == EC2I_READ_ERROR)
- return EC_ERROR_UNKNOWN;
- value = em & 0xff;
- if (0 == (i % 16))
- ccprintf("\nLDN%02X IDX%02X: %02x",
- ldn, i, value);
- else
- ccprintf(" %02x", value);
- }
- }
-#else
- return EC_ERROR_ACCESS_DENIED;
-#endif
- /* access EC registers */
- } else {
- /* write register */
- if (argc == 3) {
- *addr = value;
- ccprintf("%08X = %02x", addr, *addr);
- /* read registers */
- } else {
- for (i = 0; i < 256; i++) {
- if (0 == (i % 16))
- ccprintf("\n%08X: %02x", addr+i,
- addr[i]);
- else
- ccprintf(" %02x", addr[i]);
- }
- }
- }
- ccprintf("\n");
- cflush();
- return EC_SUCCESS;
-}
-DECLARE_CONSOLE_COMMAND(rwreg, command_rw_ec_reg,
- "addr [value (byte)]",
- "R/W EC/PNPCFG registers."
- " addr 0xec21xxyy for R/W PNPCFG, xx is LDN yy is IDX");