diff options
author | Todd Broch <tbroch@chromium.org> | 2014-10-30 18:38:09 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-12-05 01:09:39 +0000 |
commit | 2bc0b68c863693ae9e3e315aa3438829e59077ef (patch) | |
tree | 8c730a18b5c2cdfa56daa67c2cf871abe977437a /board | |
parent | 63704fd11b1858d9438f6bfefcc0b304c43644ad (diff) | |
download | chrome-ec-2bc0b68c863693ae9e3e315aa3438829e59077ef.tar.gz |
pd: move get_info to common file.
get_info command needs to be used by all type-C accessories that would
entertain being updated in the field. This CL migrates function to
common/usb_pd_protocol.c for other boards to use.
Signed-off-by: Todd Broch <tbroch@chromium.org>
BRANCH=samus
BUG=chrome-os-partner:31192,chrome-os-partner:31193
TEST=manual,
Using
ectool --name=cros_pd infopddev <0|1>
Port:1 Devid 1.1 Hash: 0x00ec9619 0x811f3e68 0x4b90c8e9 0xd5b98fa8 0xfd373777
Port:1 Devid 3.0 Hash: 0x682fd366 0x7213f55e 0xddefb802 0xbedfec42 0x5cdcc226
Port:0 Devid 4.0 Hash: 0x57b1e4e0 0x7204075f 0x65c0fa72 0xdcca15ed 0xf3231237
Change-Id: Iffa8699056351f62cf90fdecbc7ef5cee81e67bb
Reviewed-on: https://chromium-review.googlesource.com/226891
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/dingdong/board.h | 3 | ||||
-rw-r--r-- | board/dingdong/ec.tasklist | 2 | ||||
-rw-r--r-- | board/dingdong/usb_pd_policy.c | 5 | ||||
-rw-r--r-- | board/hoho/board.h | 3 | ||||
-rw-r--r-- | board/hoho/ec.tasklist | 2 | ||||
-rw-r--r-- | board/hoho/usb_pd_policy.c | 5 | ||||
-rw-r--r-- | board/zinger/hardware.c | 11 | ||||
-rw-r--r-- | board/zinger/runtime.c | 8 |
8 files changed, 26 insertions, 13 deletions
diff --git a/board/dingdong/board.h b/board/dingdong/board.h index 32678b2ad4..29eeab1891 100644 --- a/board/dingdong/board.h +++ b/board/dingdong/board.h @@ -27,8 +27,11 @@ #define CONFIG_USB_INHIBIT_CONNECT #define CONFIG_USB_POWER_DELIVERY #define CONFIG_USB_PD_ALT_MODE +#define CONFIG_USB_PD_HW_DEV_ID_BOARD_MAJOR USB_PD_HW_DEV_ID_DINGDONG +#define CONFIG_USB_PD_HW_DEV_ID_BOARD_MINOR 0 #define CONFIG_USB_PD_DUAL_ROLE #define CONFIG_USB_PD_CUSTOM_VDM +#define CONFIG_USB_PD_FLASH #define CONFIG_USB_PD_INTERNAL_COMP #define CONFIG_USB_PD_IDENTITY_HW_VERS 1 #define CONFIG_USB_PD_IDENTITY_SW_VERS 1 diff --git a/board/dingdong/ec.tasklist b/board/dingdong/ec.tasklist index e9c8c1cc1f..d31352893c 100644 --- a/board/dingdong/ec.tasklist +++ b/board/dingdong/ec.tasklist @@ -19,4 +19,4 @@ #define CONFIG_TASK_LIST \ TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(PD, pd_task, NULL, TASK_STACK_SIZE) + TASK_ALWAYS(PD, pd_task, NULL, LARGER_TASK_STACK_SIZE) diff --git a/board/dingdong/usb_pd_policy.c b/board/dingdong/usb_pd_policy.c index b38254a83b..a09a432492 100644 --- a/board/dingdong/usb_pd_policy.c +++ b/board/dingdong/usb_pd_policy.c @@ -296,6 +296,11 @@ static int pd_custom_vdm(int port, int cnt, uint32_t *payload, memcpy(payload + 1, &version_data.version, 24); rsize = 7; break; + case VDO_CMD_READ_INFO: + /* copy info into response */ + pd_get_info(payload + 1); + rsize = 7; + break; default: rsize = 0; } diff --git a/board/hoho/board.h b/board/hoho/board.h index df9a963318..30aa1d49b8 100644 --- a/board/hoho/board.h +++ b/board/hoho/board.h @@ -35,8 +35,11 @@ #define CONFIG_USB_INHIBIT_CONNECT #define CONFIG_USB_POWER_DELIVERY #define CONFIG_USB_PD_ALT_MODE +#define CONFIG_USB_PD_HW_DEV_ID_BOARD_MAJOR USB_PD_HW_DEV_ID_HOHO +#define CONFIG_USB_PD_HW_DEV_ID_BOARD_MINOR 0 #define CONFIG_USB_PD_DUAL_ROLE #define CONFIG_USB_PD_CUSTOM_VDM +#define CONFIG_USB_PD_FLASH #define CONFIG_USB_PD_INTERNAL_COMP #define CONFIG_USB_PD_IDENTITY_HW_VERS 1 #define CONFIG_USB_PD_IDENTITY_SW_VERS 1 diff --git a/board/hoho/ec.tasklist b/board/hoho/ec.tasklist index e9c8c1cc1f..d31352893c 100644 --- a/board/hoho/ec.tasklist +++ b/board/hoho/ec.tasklist @@ -19,4 +19,4 @@ #define CONFIG_TASK_LIST \ TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(PD, pd_task, NULL, TASK_STACK_SIZE) + TASK_ALWAYS(PD, pd_task, NULL, LARGER_TASK_STACK_SIZE) diff --git a/board/hoho/usb_pd_policy.c b/board/hoho/usb_pd_policy.c index e15dc3d580..50792a0e68 100644 --- a/board/hoho/usb_pd_policy.c +++ b/board/hoho/usb_pd_policy.c @@ -295,6 +295,11 @@ static int pd_custom_vdm(int port, int cnt, uint32_t *payload, memcpy(payload + 1, &version_data.version, 24); rsize = 7; break; + case VDO_CMD_READ_INFO: + /* copy info into response */ + pd_get_info(payload + 1); + rsize = 7; + break; default: rsize = 0; } diff --git a/board/zinger/hardware.c b/board/zinger/hardware.c index 59e2f8b24b..1238d31a0d 100644 --- a/board/zinger/hardware.c +++ b/board/zinger/hardware.c @@ -9,8 +9,6 @@ #include "common.h" #include "cpu.h" #include "registers.h" -#include "rsa.h" -#include "sha256.h" #include "task.h" #include "timer.h" #include "util.h" @@ -409,12 +407,3 @@ exit_er: return res; } - -static struct sha256_ctx ctx; -uint8_t *flash_hash_rw(void) -{ - SHA256_init(&ctx); - SHA256_update(&ctx, (void *)CONFIG_FLASH_BASE + CONFIG_FW_RW_OFF, - CONFIG_FW_RW_SIZE - RSANUMBYTES); - return SHA256_final(&ctx); -} diff --git a/board/zinger/runtime.c b/board/zinger/runtime.c index 4dda979d46..0724c68c81 100644 --- a/board/zinger/runtime.c +++ b/board/zinger/runtime.c @@ -231,6 +231,14 @@ void panic_reboot(void) cpu_reset(); } +enum system_image_copy_t system_get_image_copy(void) +{ + if (is_ro_mode()) + return SYSTEM_IMAGE_RO; + else + return SYSTEM_IMAGE_RW; +} + /* --- stubs --- */ void __hw_timer_enable_clock(int n, int enable) { /* Done in hardware init */ } |