diff options
author | Ting Shen <phoenixshen@google.com> | 2019-08-26 16:41:09 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-26 10:56:52 +0000 |
commit | db93764becfb53cb172cf6c7f0828b260b140817 (patch) | |
tree | 2652f78165af6e48216f04177fc64efabd8c3115 /baseboard/kukui | |
parent | 93c0fac6c1ffdf58e29f3c0a7876a79d5a2bd2f0 (diff) | |
download | chrome-ec-db93764becfb53cb172cf6c7f0828b260b140817.tar.gz |
kukui: set SPI pin to high speed
The SPI pins should be configured to high speed to meet the spec.
And since the pin assignment is same on all kukui families, move the
setup code to baseboard/.
BUG=b:138768646
TEST=verified by observe the waveform
BRANCH=kukui
Change-Id: I5b07767000bdf47101f83d338d06e7679c4f4848
Signed-off-by: Ting Shen <phoenixshen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1770329
Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'baseboard/kukui')
-rw-r--r-- | baseboard/kukui/baseboard.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/baseboard/kukui/baseboard.c b/baseboard/kukui/baseboard.c index 2882fe760f..bdd4277b5c 100644 --- a/baseboard/kukui/baseboard.c +++ b/baseboard/kukui/baseboard.c @@ -6,6 +6,8 @@ #include "adc.h" #include "adc_chip.h" #include "gpio.h" +#include "hooks.h" +#include "registers.h" #include "timer.h" #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) @@ -112,6 +114,14 @@ int board_get_version(void) return version; } +static void baseboard_spi_init(void) +{ + /* Set SPI PA15,PB3/4/5/13/14/15 pins to high speed */ + STM32_GPIO_OSPEEDR(GPIO_A) |= 0xc0000000; + STM32_GPIO_OSPEEDR(GPIO_B) |= 0xfc000fc0; +} +DECLARE_HOOK(HOOK_INIT, baseboard_spi_init, HOOK_PRIO_INIT_SPI + 1); + #ifndef VARIANT_KUKUI_BATTERY_SMART int board_allow_i2c_passthru(int port) { |