diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-07-25 02:14:13 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-07-30 19:57:55 +0000 |
commit | 5b71b33aba6cb0108a864cc7000918b8f06b139a (patch) | |
tree | aa49a59a306d91b189e9fcdddc3bbb0e2deba628 /board/npcx_evb | |
parent | 9008c7a4fd131a96ccb0078a46ec545cff2f43b1 (diff) | |
download | chrome-ec-5b71b33aba6cb0108a864cc7000918b8f06b139a.tar.gz |
common: change interface to SPI flash
Allow more than one SPI master.
Add CONFIG variables to address the system SPI flash.
To have SPI master ports, spi_ports array must be defined.
BRANCH=smaug
TEST=compile
BUG=chrome-os-partner:42304
Change-Id: Id43869f648965c1582b7be1c7fb3a38f175fda95
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288512
Commit-Queue: David James <davidjames@chromium.org>
Diffstat (limited to 'board/npcx_evb')
-rw-r--r-- | board/npcx_evb/board.c | 8 | ||||
-rw-r--r-- | board/npcx_evb/board.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/board/npcx_evb/board.c b/board/npcx_evb/board.c index 9523c3b937..8b3a72304d 100644 --- a/board/npcx_evb/board.c +++ b/board/npcx_evb/board.c @@ -23,6 +23,7 @@ #include "pwm.h" #include "pwm_chip.h" #include "registers.h" +#include "spi.h" #include "switch.h" #include "temp_sensor.h" #include "temp_sensor_chip.h" @@ -115,6 +116,13 @@ const struct i2c_port_t i2c_ports[] = { const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); /******************************************************************************/ +/* SPI devices */ +const struct spi_device_t spi_devices[] = { + { CONFIG_SPI_FLASH_PORT, 0, GPIO_SPI_CS_L}, +}; +const unsigned int spi_devices_used = ARRAY_SIZE(spi_devices); + +/******************************************************************************/ /* Keyboard scan setting */ struct keyboard_scan_config keyscan_config = { .output_settle_us = 40, diff --git a/board/npcx_evb/board.h b/board/npcx_evb/board.h index f4059151fc..1553edba3f 100644 --- a/board/npcx_evb/board.h +++ b/board/npcx_evb/board.h @@ -20,6 +20,7 @@ /* Optional features */ #define CONFIG_SYSTEM_UNLOCKED /* Allow dangerous commands for testing */ +#define CONFIG_SPI_FLASH_PORT 0 #define CONFIG_SPI_FLASH #define CONFIG_SPI_FLASH_SIZE 0x00800000 /* 8MB spi flash */ #define CONFIG_SPI_FLASH_W25Q64 |