summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Sanders <nsanders@chromium.org>2016-07-18 12:59:13 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-07-20 22:22:32 -0700
commit3c44198c3398806f7f4506fb758ef4856e67ebea (patch)
tree7906bfc5cecc62b97af97857a8eac77de79ce5ec
parentb1aecf2c5d420b172554ceb67119ff7a30b72b7d (diff)
downloadchrome-ec-3c44198c3398806f7f4506fb758ef4856e67ebea.tar.gz
servo_micro: support servo micro v2, console gpio
* Remove GPIO USB endpoint to make room for update endpoint. * Change GPIO mapping slightly to support servo micro v2. BUG=chromium:571477 BRANCH=None TEST=run servod, see new controls. Change-Id: Id3b85b4c77b8f21afd9636b2ee459ace6f42f68e Reviewed-on: https://chromium-review.googlesource.com/361383 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org>
-rw-r--r--board/servo_micro/board.c30
-rw-r--r--board/servo_micro/board.h7
-rw-r--r--board/servo_micro/gpio.inc64
3 files changed, 34 insertions, 67 deletions
diff --git a/board/servo_micro/board.c b/board/servo_micro/board.c
index 5ee94f032b..bf25f86630 100644
--- a/board/servo_micro/board.c
+++ b/board/servo_micro/board.c
@@ -16,43 +16,13 @@
#include "usart-stm32f0.h"
#include "usart_tx_dma.h"
#include "usart_rx_dma.h"
-#include "usb_gpio.h"
#include "usb_i2c.h"
#include "usb_spi.h"
#include "usb-stream.h"
#include "util.h"
-
-/******************************************************************************
- * Build GPIO tables and expose a subset of the GPIOs over USB.
- */
-
#include "gpio_list.h"
-static enum gpio_signal const usb_gpio_list[] = {
-GPIO_UART1_EN_L,
-GPIO_SERVO_JTAG_TRST_L,
-GPIO_SPI1_BUF_EN_L,
-GPIO_SPI2_BUF_EN_L,
-GPIO_UART2_EN_L,
-GPIO_SPI1_VREF_33,
-GPIO_SPI1_VREF_18,
-GPIO_SPI2_VREF_33,
-GPIO_SPI2_VREF_18,
-GPIO_SERVO_JTAG_TRST_DIR,
-GPIO_SERVO_JTAG_TDI_DIR,
-GPIO_TCA6416_RESET_L
-};
-
-/*
- * This instantiates struct usb_gpio_config const usb_gpio, plus several other
- * variables, all named something beginning with usb_gpio_
- */
-USB_GPIO_CONFIG(usb_gpio,
- usb_gpio_list,
- USB_IFACE_GPIO,
- USB_EP_GPIO);
-
/******************************************************************************
* Forward UARTs as a USB serial interface.
diff --git a/board/servo_micro/board.h b/board/servo_micro/board.h
index 7efb2fc3dd..ddb4316415 100644
--- a/board/servo_micro/board.h
+++ b/board/servo_micro/board.h
@@ -22,6 +22,8 @@
/* The UART console is on USART1 (PA9/PA10) */
#undef CONFIG_UART_CONSOLE
#define CONFIG_UART_CONSOLE 1
+#undef CONFIG_UART_TX_DMA
+#undef CONFIG_UART_RX_DMA
/* Optional features */
#define CONFIG_STM_HWTIMER32
@@ -34,7 +36,6 @@
/* USB interface indexes (use define rather than enum to expand them) */
#define USB_IFACE_USART4_STREAM 0
-#define USB_IFACE_GPIO 1
#define USB_IFACE_SPI 2
#define USB_IFACE_CONSOLE 3
#define USB_IFACE_I2C 4
@@ -45,7 +46,6 @@
/* USB endpoint indexes (use define rather than enum to expand them) */
#define USB_EP_CONTROL 0
#define USB_EP_USART4_STREAM 1
-#define USB_EP_GPIO 2
#define USB_EP_SPI 3
#define USB_EP_CONSOLE 4
#define USB_EP_I2C 5
@@ -53,9 +53,6 @@
#define USB_EP_USART2_STREAM 7
#define USB_EP_COUNT 8
-/* Enable control of GPIOs over USB */
-#define CONFIG_USB_GPIO
-
/* Enable console recasting of GPIO type. */
#define CONFIG_CMD_GPIO_EXTENDED
diff --git a/board/servo_micro/gpio.inc b/board/servo_micro/gpio.inc
index cca65d857d..8f04214746 100644
--- a/board/servo_micro/gpio.inc
+++ b/board/servo_micro/gpio.inc
@@ -6,41 +6,45 @@
*/
/* Outputs */
-GPIO(UART1_EN_L, PIN(A, 8), GPIO_OUT_HIGH)
-GPIO(SERVO_JTAG_TRST_L, PIN(A, 13), GPIO_OUT_LOW)
-GPIO(SPI1_BUF_EN_L, PIN(A, 14), GPIO_OUT_HIGH)
-GPIO(SPI2_BUF_EN_L, PIN(A, 15), GPIO_OUT_HIGH)
-
-GPIO(UART2_EN_L, PIN(B, 0), GPIO_OUT_HIGH)
-GPIO(SPI1_VREF_33, PIN(B, 2), GPIO_OUT_LOW)
-GPIO(SPI1_VREF_18, PIN(B, 3), GPIO_OUT_LOW)
-GPIO(SPI2_VREF_33, PIN(B, 4), GPIO_OUT_LOW)
-GPIO(SPI2_VREF_18, PIN(B, 5), GPIO_OUT_LOW)
-GPIO(SERVO_JTAG_TRST_DIR, PIN(B, 6), GPIO_OUT_HIGH)
-GPIO(SERVO_JTAG_TDI_DIR, PIN(B, 7), GPIO_OUT_HIGH)
-
-GPIO(TCA6416_RESET_L, PIN(C, 13), GPIO_OUT_LOW)
-GPIO(SERVO_JTAG_TMS_DIR, PIN(C, 14), GPIO_OUT_LOW)
-GPIO(SERVO_JTAG_TDO_SEL, PIN(C, 15), GPIO_OUT_LOW)
+GPIO(UART1_EN_L, PIN(A, 8), GPIO_OUT_HIGH)
+GPIO(SERVO_JTAG_TRST_L, PIN(A, 13), GPIO_OUT_LOW)
+GPIO(SPI1_BUF_EN_L, PIN(A, 14), GPIO_OUT_HIGH)
+GPIO(SPI2_BUF_EN_L, PIN(A, 15), GPIO_OUT_HIGH)
+
+GPIO(UART2_EN_L, PIN(B, 0), GPIO_OUT_HIGH)
+GPIO(SPI1_VREF_33, PIN(B, 2), GPIO_OUT_LOW)
+GPIO(SPI1_VREF_18, PIN(B, 3), GPIO_OUT_LOW)
+GPIO(SPI2_VREF_33, PIN(B, 4), GPIO_OUT_LOW)
+GPIO(SPI2_VREF_18, PIN(B, 5), GPIO_OUT_LOW)
+GPIO(SERVO_JTAG_TRST_DIR, PIN(B, 6), GPIO_OUT_HIGH)
+GPIO(SERVO_JTAG_TDI_DIR, PIN(B, 7), GPIO_OUT_HIGH)
+
+GPIO(TCA6416_RESET_L, PIN(C, 13), GPIO_OUT_LOW)
+GPIO(SPI1_MUX_SEL, PIN(A, 5), GPIO_OUT_LOW)
+GPIO(SERVO_JTAG_TMS_DIR, PIN(C, 14), GPIO_OUT_LOW)
+GPIO(SERVO_JTAG_TDO_SEL, PIN(C, 15), GPIO_OUT_LOW)
+GPIO(JTAG_BUFOUT_EN_L, PIN(F, 0), GPIO_OUT_HIGH)
+GPIO(JTAG_BUFIN_EN_L, PIN(F, 1), GPIO_OUT_HIGH)
/* Inputs */
-GPIO(SERVO_JTAG_TMS, PIN(A, 4), GPIO_INPUT)
-GPIO(SERVO_JTAG_TCK, PIN(A, 5), GPIO_INPUT)
-GPIO(SERVO_JTAG_MUX_TDO, PIN(A, 6), GPIO_INPUT)
-GPIO(SERVO_JTAG_TDI, PIN(A, 7), GPIO_INPUT)
+GPIO(SERVO_JTAG_TMS, PIN(A, 4), GPIO_INPUT)
+GPIO(UART3_TX_SERVO_JTAG_TCK, PIN(A, 0), GPIO_INPUT)
+GPIO(UART3_RX_JTAG_BUFFER_TO_SERVO_TDO, PIN(A, 1), GPIO_INPUT)
+GPIO(SERVO_JTAG_TDO_BUFFER_EN, PIN(A, 6), GPIO_INPUT)
+GPIO(SERVO_JTAG_TDI, PIN(A, 7), GPIO_INPUT)
-GPIO(SERVO_JTAG_RTCK, PIN(B, 1), GPIO_INPUT)
+GPIO(SERVO_JTAG_RTCK, PIN(B, 1), GPIO_INPUT)
/* Flash SPI interface */
-GPIO(SPI_CS, PIN(B, 12), GPIO_OUT_HIGH)
-GPIO(SPI_CLK, PIN(B, 13), GPIO_INPUT)
-GPIO(SPI_MISO, PIN(B, 14), GPIO_INPUT)
-GPIO(SPI_MOSI, PIN(B, 15), GPIO_INPUT)
+GPIO(SPI_CS, PIN(B, 12), GPIO_OUT_HIGH)
+GPIO(SPI_CLK, PIN(B, 13), GPIO_INPUT)
+GPIO(SPI_MISO, PIN(B, 14), GPIO_INPUT)
+GPIO(SPI_MOSI, PIN(B, 15), GPIO_INPUT)
/* I2C pins should be configured as inputs until I2C module is */
/* initialized. This will avoid driving the lines unintentionally.*/
-GPIO(MASTER_I2C_SCL, PIN(B, 8), GPIO_INPUT)
-GPIO(MASTER_I2C_SDA, PIN(B, 9), GPIO_INPUT)
+GPIO(MASTER_I2C_SCL, PIN(B, 8), GPIO_INPUT)
+GPIO(MASTER_I2C_SDA, PIN(B, 9), GPIO_INPUT)
/* Unimplemented signals since we are not an EC */
UNIMPLEMENTED(ENTERING_RW)
@@ -49,11 +53,7 @@ UNIMPLEMENTED(WP_L)
ALTERNATE(PIN_MASK(A, 0x0600), 1, MODULE_UART, 0) /* USART1: PA09/PA10 - Servo stm32 console UART*/
ALTERNATE(PIN_MASK(A, 0x000C), 1, MODULE_USART, 0) /* USART2: PA2/PA3 - Servo UART1 */
ALTERNATE(PIN_MASK(B, 0x0C00), 4, MODULE_USART, 0) /* USART3: PB10/PB11 - Servo UART2 */
-/* Servo UART3 (USART4) is broken on servo micro rev. 1 */
-// ALTERNATE(PIN_MASK(A, 0x0003), 4, MODULE_USART, 0) /* USART4: PA0/PA1 - Servo UART3 */
-/* Expose Servo UART3 as GPIOs for debugging. */
-GPIO(UART3_TX, PIN(A, 0), GPIO_INPUT)
-GPIO(UART3_RX, PIN(A, 1), GPIO_INPUT)
+ALTERNATE(PIN_MASK(A, 0x0003), 4, MODULE_USART, 0) /* USART4: PA0/PA1 - Servo UART3 */
ALTERNATE(PIN_MASK(B, 0x0300), 1, MODULE_I2C, 0) /* I2C MASTER:PB8/9 GPIO_ODR_HIGH */