summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2017-05-16 10:16:43 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-05-16 07:47:05 -0700
commitcb9bd66ec66ccd499ff597919806eafc1524acd2 (patch)
treed891ff6be97a5b681e24097aadb17ce9231371e7
parentdee69a236f67b99e87746fee5894c915682623ee (diff)
downloadchrome-ec-cb9bd66ec66ccd499ff597919806eafc1524acd2.tar.gz
hammer: Add staff board
hammer corresponds to poppy, and staff corresponds to soraka. Current differences (hammer/staff): - USB id (5022/502b) - PWM frequency (10kHz/100Hz): - On staff, driving PWM at 10kHz leads to an actual duty cycle around 30-40%, with a PWM output at 1% (long rise/fall time). 100Hz looks better, we get ~1.45% duty with 1% PWM output. BRANCH=none BUG=b:38277869 TEST=Flash staff, boots fine. TEST=pwm 0 1 shows quite dim backlight on staff. Change-Id: I66ba2adf89fbee8578ee473afb28e3e242b4d111 Reviewed-on: https://chromium-review.googlesource.com/505855 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/hammer/board.c8
-rw-r--r--board/hammer/board.h6
l---------board/staff1
-rwxr-xr-xutil/flash_ec1
4 files changed, 15 insertions, 1 deletions
diff --git a/board/hammer/board.c b/board/hammer/board.c
index 4f157ad22c..56aefc89e4 100644
--- a/board/hammer/board.c
+++ b/board/hammer/board.c
@@ -54,9 +54,15 @@ const struct i2c_port_t i2c_ports[] = {
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
+#ifdef BOARD_STAFF
+#define KBLIGHT_PWM_FREQ 100 /* Hz */
+#else
+#define KBLIGHT_PWM_FREQ 10000 /* Hz */
+#endif
+
/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */
const struct pwm_t pwm_channels[] = {
- {STM32_TIM(TIM_KBLIGHT), STM32_TIM_CH(1), 0, 10000 /* Hz */ },
+ {STM32_TIM(TIM_KBLIGHT), STM32_TIM_CH(1), 0, KBLIGHT_PWM_FREQ},
};
BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
diff --git a/board/hammer/board.h b/board/hammer/board.h
index 613d98b66b..4debd1d10f 100644
--- a/board/hammer/board.h
+++ b/board/hammer/board.h
@@ -77,7 +77,13 @@
/* USB Configuration */
#define CONFIG_USB
+#ifdef BOARD_STAFF
+#define CONFIG_USB_PID 0x502b
+#elif defined(BOARD_HAMMER)
#define CONFIG_USB_PID 0x5022
+#else
+#error "Invalid board"
+#endif
#define CONFIG_STREAM_USB
#define CONFIG_USB_UPDATE
diff --git a/board/staff b/board/staff
new file mode 120000
index 0000000000..7f4a914148
--- /dev/null
+++ b/board/staff
@@ -0,0 +1 @@
+hammer \ No newline at end of file
diff --git a/util/flash_ec b/util/flash_ec
index c387427329..e2773ecedf 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -74,6 +74,7 @@ BOARDS_STM32=(
ryu
samus_pd
snoball
+ staff
strago_pd
zinger
)