mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 00:51:29 +00:00
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>
41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
/* 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);
|