diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-07-25 02:49:00 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-07-30 19:58:09 +0000 |
commit | ff550b0e1abfc97a8531eed5515c75e0f37deba3 (patch) | |
tree | 9a9148a436f719437996d4703e2198942b9b5b3d /board/discovery-stm32f072 | |
parent | a3a5c90b54670ddc865defc16757f1fef78ca322 (diff) | |
download | chrome-ec-ff550b0e1abfc97a8531eed5515c75e0f37deba3.tar.gz |
stm32: Enable 3rd SPI interface
Remove assumption of only one SPI master going to the SPI flash.
SPI3 can be used as second SPI master.
Define a new module type, SPI_FLASH, that can be turned
on/off when flash is not in used without impacting other
SPI masters.
BRANCH=smaug
BUG=chrome-os-partner:42304
TEST=Test on Ryu board.
Change-Id: Ie72471cea6f0a357ffee055a610d032580a794e7
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288514
Diffstat (limited to 'board/discovery-stm32f072')
-rw-r--r-- | board/discovery-stm32f072/board.c | 4 | ||||
-rw-r--r-- | board/discovery-stm32f072/gpio.inc | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/board/discovery-stm32f072/board.c b/board/discovery-stm32f072/board.c index 7aa9a70555..5aa185ffc3 100644 --- a/board/discovery-stm32f072/board.c +++ b/board/discovery-stm32f072/board.c @@ -157,7 +157,7 @@ void usb_spi_board_enable(struct usb_spi_config const *config) STM32_SYSCFG_CFGR1 |= (1 << 24); /* Configure SPI GPIOs */ - gpio_config_module(MODULE_SPI_MASTER, 1); + gpio_config_module(MODULE_SPI_FLASH, 1); /* Set all four SPI pins to high speed */ STM32_GPIO_OSPEEDR(GPIO_B) |= 0xff000000; @@ -180,7 +180,7 @@ void usb_spi_board_disable(struct usb_spi_config const *config) STM32_RCC_APB1ENR &= ~STM32_RCC_PB1_SPI2; /* Release SPI GPIOs */ - gpio_config_module(MODULE_SPI_MASTER, 0); + gpio_config_module(MODULE_SPI_FLASH, 0); } USB_SPI_CONFIG(usb_spi, USB_IFACE_SPI, USB_EP_SPI); diff --git a/board/discovery-stm32f072/gpio.inc b/board/discovery-stm32f072/gpio.inc index 4311634dc3..14272dcadd 100644 --- a/board/discovery-stm32f072/gpio.inc +++ b/board/discovery-stm32f072/gpio.inc @@ -19,7 +19,7 @@ GPIO(SPI_WP, PIN(C, 3), GPIO_OUT_HIGH) GPIO(SPI_HOLD, PIN(C, 4), GPIO_OUT_HIGH) GPIO(SPI_CS, PIN(B, 12), GPIO_OUT_HIGH) -ALTERNATE(PIN_MASK(B, 0xE000), 0, MODULE_SPI_MASTER, 0) +ALTERNATE(PIN_MASK(B, 0xE000), 0, MODULE_SPI_FLASH, 0) /* Unimplemented signals which we need to emulate for now */ UNIMPLEMENTED(ENTERING_RW) |