summaryrefslogtreecommitdiff
path: root/board/hoho/board.c
diff options
context:
space:
mode:
authorTodd Broch <tbroch@chromium.org>2014-08-07 14:06:43 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-08-16 05:26:40 +0000
commite1ff1a3caef94bef3c2ea9e8036aa784be26ef1b (patch)
tree2b502fe069c0c9395b53630db3af87dcd4cb7424 /board/hoho/board.c
parentf3c308108b88ff4c8ac276269da056560265bf1b (diff)
downloadchrome-ec-e1ff1a3caef94bef3c2ea9e8036aa784be26ef1b.tar.gz
hoho: Initial board configuration.
Create necessary boiler plate files for USB type-C to HDMI dongle. BRANCH=none BUG=chrome-os-partner:31192 TEST=manual 1. Compiles & can program via fruitpie. 2. Can access uart (w/ rework for tx/rx). 3. Can drive HDMI capable monitor. test details ... Programming: ------------ # connect fruitpie + fruitpie std-adapter(red) with u-USB (CN3) & type-A # (CN1) both to host that will run servod. FPIE_PORT=9993 sudo servod -p 0x5009 --port $FPIE_PORT dut-control --port $FPIE_PORT "ec_uart_cmd:gpioset USB_C_5V_EN 1" dut-control --port $FPIE_PORT "ec_uart_cmd:usbmux usb" util/flash_ec --board=hoho Configuring samus for DPout on both ports: ------------------------------------------ sudo servod -b samus for port 0 1; do dut-control "usbpd_uart_cmd:pd ${PORT} dualrole off" dut-control "usbpd_uart_cmd:gpioset USB_C${PORT}_CHARGE_EN_L 1" dut-control "usbpd_uart_cmd:typec ${PORT} dp" dut-control "usbpd_uart_cmd:gpioset USB_C${PORT}_5V_EN 1" dut-control "usbpd_uart_cmd:typec ${PORT}" done Change-Id: I39bbe1e347d1cfd777b68f3fdac6c5c6dd22800d Signed-off-by: Todd Broch <tbroch@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/212523 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/hoho/board.c')
-rw-r--r--board/hoho/board.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/board/hoho/board.c b/board/hoho/board.c
new file mode 100644
index 0000000000..b0e3a7d37b
--- /dev/null
+++ b/board/hoho/board.c
@@ -0,0 +1,40 @@
+/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+/* Twinkie dongle configuration */
+
+#include "adc.h"
+#include "adc_chip.h"
+#include "common.h"
+#include "console.h"
+#include "gpio.h"
+#include "hooks.h"
+#include "i2c.h"
+#include "registers.h"
+#include "task.h"
+#include "util.h"
+
+#include "gpio_list.h"
+
+/* Initialize board. */
+void board_config_pre_init(void)
+{
+ /* enable SYSCFG clock */
+ STM32_RCC_APB2ENR |= 1 << 0;
+ /* Remap USART DMA to match the USART driver */
+ STM32_SYSCFG_CFGR1 |= (1 << 9) | (1 << 10);/* Remap USART1 RX/TX DMA */
+}
+
+/* ADC channels */
+const struct adc_t adc_channels[] = {
+ /* USB PD CC lines sensing. Converted to mV (3300mV/4096). */
+ [ADC_CH_CC1_PD] = {"USB_C_CC1_PD", 3300, 4096, 0, STM32_AIN(1)},
+};
+BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
+
+/* I2C ports */
+const struct i2c_port_t i2c_ports[] = {
+ {"master", I2C_PORT_MASTER, 400, GPIO_MCDP_I2C_SCL, GPIO_MCDP_I2C_SDA},
+};
+const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);