diff options
-rw-r--r-- | board/cr50/board.c | 5 | ||||
-rw-r--r-- | board/cr50/board.h | 1 | ||||
-rw-r--r-- | board/cr50/usb_spi.c | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index 0e2e5edfef..d7e9742291 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -992,8 +992,9 @@ BUILD_ASSERT(ARRAY_SIZE(usb_strings) == USB_STR_COUNT); #endif /* SPI devices */ -const struct spi_device_t spi_devices[] = { [CONFIG_SPI_FLASH_PORT] = { - 0, 2, GPIO_SPI_CS_L } }; +const struct spi_device_t spi_devices[] = { + [CONFIG_SPI_FLASH_PORT] = {0, 2, GPIO_COUNT} +}; const unsigned int spi_devices_used = ARRAY_SIZE(spi_devices); int flash_regions_to_enable(struct g_flash_region *regions, diff --git a/board/cr50/board.h b/board/cr50/board.h index 9be61d9703..25d0ea5396 100644 --- a/board/cr50/board.h +++ b/board/cr50/board.h @@ -132,6 +132,7 @@ /* Enable SPI controller (SPI) module */ #define CONFIG_SPI_CONTROLLER +#define CONFIG_SPI_CONTROLLER_NO_CS_GPIOS #define CONFIG_SPI_CONTROLLER_CONFIGURE_GPIOS #define CONFIG_SPI_FLASH_PORT 0 diff --git a/board/cr50/usb_spi.c b/board/cr50/usb_spi.c index ac294546d9..47c1a070e7 100644 --- a/board/cr50/usb_spi.c +++ b/board/cr50/usb_spi.c @@ -223,6 +223,7 @@ static void enable_spi_pinmux(void) /* Connect DIO A4, A8, and A14 to the SPI peripheral */ GWRITE(PINMUX, DIOA4_SEL, 0); /* SPI_MOSI */ GWRITE(PINMUX, DIOA8_SEL, 0); /* SPI_CS_L */ + GWRITE(PINMUX, DIOA14_SEL, 0); /* SPI_CLK */ /* Set SPI_CS to be an internal pull up */ GWRITE_FIELD(PINMUX, DIOA14_CTL, PU, 1); @@ -251,6 +252,7 @@ static void disable_spi_pinmux(void) /* TODO: Implement way to get the gpio */ ASSERT(GREAD(PINMUX, GPIO0_GPIO7_SEL) == GC_PINMUX_DIOA4_SEL); ASSERT(GREAD(PINMUX, GPIO0_GPIO8_SEL) == GC_PINMUX_DIOA8_SEL); + ASSERT(GREAD(PINMUX, GPIO0_GPIO9_SEL) == GC_PINMUX_DIOA14_SEL); GWRITE_FIELD(PINMUX, DIOA4_CTL, PD, 1); /* SPI_MOSI */ GWRITE_FIELD(PINMUX, DIOA8_CTL, PD, 1); /* SPI_CLK */ @@ -258,6 +260,7 @@ static void disable_spi_pinmux(void) /* Set SPI MOSI, CLK, and CS_L as inputs */ GWRITE(PINMUX, DIOA4_SEL, GC_PINMUX_GPIO0_GPIO7_SEL); GWRITE(PINMUX, DIOA8_SEL, GC_PINMUX_GPIO0_GPIO8_SEL); + GWRITE(PINMUX, DIOA14_SEL, GC_PINMUX_GPIO0_GPIO9_SEL); } /*****************************************************************************/ |