diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2017-03-09 13:14:34 +0100 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-03-13 05:16:04 -0700 |
commit | 6d7b4bb3d6c6364da3c16a56572d430f549264fb (patch) | |
tree | 35b93321d9bf92c29f8500d90ba4114f53330ac2 /board | |
parent | 3d9c6052578758558f4cef73e473b0fb8d1f7b29 (diff) | |
download | chrome-ec-6d7b4bb3d6c6364da3c16a56572d430f549264fb.tar.gz |
eve_fp: setup SPI slave communication on STM32L442
Enable properly the SPI slave command interface to drive the FP MCU from
the main CPU using the EC SPI protocol V3.
Fix the SPI slave driver on STM32L4 along the way:
- the STM32L4 family has the same FIFOs as STM32F0
- on STM32L4, we need to map the DMA requests
- set explicitly the data size (rather than setting an invalid value
which defaults to 8-bit).
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=b:36025702
TEST=On Eve, use the kernel cros_ec_spi driver to communicate with the
FPMCU using the Cros EC SPI protocol V3.
Change-Id: Ib641c141808aa60b3a74611319e18e7a6c3736f0
Reviewed-on: https://chromium-review.googlesource.com/452373
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/eve_fp/board.c | 3 | ||||
-rw-r--r-- | board/eve_fp/board.h | 1 | ||||
-rw-r--r-- | board/eve_fp/gpio.inc | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/board/eve_fp/board.c b/board/eve_fp/board.c index a84826833d..5846f304ee 100644 --- a/board/eve_fp/board.c +++ b/board/eve_fp/board.c @@ -36,5 +36,8 @@ static void board_init(void) STM32_GPIO_OSPEEDR(GPIO_B) |= 0x00000fc0; /* Enable clocks to SPI3 module (master) */ STM32_RCC_APB1ENR |= STM32_RCC_PB1_SPI3; + + /* we are ready for host transactions */ + hook_notify(HOOK_CHIPSET_RESUME); } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); diff --git a/board/eve_fp/board.h b/board/eve_fp/board.h index 454b4e7f93..b8a9e1c51a 100644 --- a/board/eve_fp/board.h +++ b/board/eve_fp/board.h @@ -24,6 +24,7 @@ /* Optional features */ #define CONFIG_CMD_SPI_XFER +#define CONFIG_HOST_COMMAND_STATUS #undef CONFIG_LID_SWITCH #define CONFIG_SPI #define CONFIG_SPI_MASTER diff --git a/board/eve_fp/gpio.inc b/board/eve_fp/gpio.inc index 9ab359479e..ee8da2a179 100644 --- a/board/eve_fp/gpio.inc +++ b/board/eve_fp/gpio.inc @@ -20,7 +20,7 @@ UNIMPLEMENTED(WP_L) /* USART1: PA9/10 */ ALTERNATE(PIN_MASK(A, 0x0600), GPIO_ALT_F7, MODULE_UART, 0) -/* SPI1 slave from PCH: PA5/6/7 */ -ALTERNATE(PIN_MASK(A, 0x00e0), GPIO_ALT_F5, MODULE_SPI, 0) +/* SPI1 slave from PCH: PA4/5/6/7 */ +ALTERNATE(PIN_MASK(A, 0x00f0), GPIO_ALT_F5, MODULE_SPI, 0) /* SPI3 master to sensor: PB3/4/5 */ ALTERNATE(PIN_MASK(B, 0x0038), GPIO_ALT_F6, MODULE_SPI_MASTER, 0) |