diff options
author | Anton Staaf <robotboy@chromium.org> | 2014-09-17 15:26:41 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-23 01:41:37 +0000 |
commit | 4b7f64cc2bc7d246575ee7484c63bc758345e5a1 (patch) | |
tree | 61f8bea9ef5f9c79ca345bf96f6a6313035b2beb /board/discovery-stm32f072/board.h | |
parent | 35a01462f14fd2eeb282af28fd82065aafee3747 (diff) | |
download | chrome-ec-4b7f64cc2bc7d246575ee7484c63bc758345e5a1.tar.gz |
discovery-stm32f072: Enable SPI over USB tunnel
Enable master control of SPI2 over USB for testing flashrom's
ability to write to a SPI flash chip attached to the stm32.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j; write image using flashrom
Change-Id: I7d320acd28a03e91fcd7f7d697be40f69ea7bbdc
Reviewed-on: https://chromium-review.googlesource.com/218741
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'board/discovery-stm32f072/board.h')
-rw-r--r-- | board/discovery-stm32f072/board.h | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/board/discovery-stm32f072/board.h b/board/discovery-stm32f072/board.h index 1e7d86363e..bb3fdee002 100644 --- a/board/discovery-stm32f072/board.h +++ b/board/discovery-stm32f072/board.h @@ -26,15 +26,36 @@ /* Optional features */ #define CONFIG_STM_HWTIMER32 #define CONFIG_HW_CRC + +/* USB Configuration */ #define CONFIG_USB +#define CONFIG_USB_PID 0x500f + +/* USB interface indexes (use define rather than enum to expand them) */ +#define USB_IFACE_STREAM 0 +#define USB_IFACE_GPIO 1 +#define USB_IFACE_SPI 2 +#define USB_IFACE_COUNT 3 + +/* USB endpoint indexes (use define rather than enum to expand them) */ +#define USB_EP_CONTROL 0 +#define USB_EP_STREAM 1 +#define USB_EP_GPIO 2 +#define USB_EP_SPI 3 +#define USB_EP_COUNT 4 + +/* Enable control of GPIOs over USB */ #define CONFIG_USB_GPIO +/* Enable control of SPI over USB */ +#define CONFIG_SPI_MASTER_PORT 2 +#define CONFIG_SPI_CS_GPIO GPIO_SPI_CS + +#define CONFIG_USB_SPI + #undef CONFIG_WATCHDOG_HELP #undef CONFIG_LID_SWITCH -/* USB configuration */ -#define CONFIG_USB_PID 0x500f - /* * Allow dangerous commands all the time, since we don't have a write protect * switch. @@ -59,16 +80,4 @@ enum usb_strings { }; #endif /* !__ASSEMBLER__ */ - -/* USB interface indexes (use define rather than enum to expand them) */ -#define USB_IFACE_STREAM 0 -#define USB_IFACE_GPIO 1 -#define USB_IFACE_COUNT 2 - -/* USB endpoint indexes (use define rather than enum to expand them) */ -#define USB_EP_CONTROL 0 -#define USB_EP_STREAM 1 -#define USB_EP_GPIO 2 -#define USB_EP_COUNT 3 - #endif /* __BOARD_H */ |