summaryrefslogtreecommitdiff
path: root/board/twinkie/board.c
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-11-04 12:11:58 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-05 04:22:34 +0000
commit252457d4b21f46889eebad61d4c0a65331919cec (patch)
tree01856c4d31d710b20e85a74c8d7b5836e35c3b98 /board/twinkie/board.c
parent08f5a1e6fc2c9467230444ac9b582dcf4d9f0068 (diff)
downloadchrome-ec-stabilize-14695.85.B-ish.tar.gz
In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'board/twinkie/board.c')
-rw-r--r--board/twinkie/board.c81
1 files changed, 0 insertions, 81 deletions
diff --git a/board/twinkie/board.c b/board/twinkie/board.c
deleted file mode 100644
index 6572f27281..0000000000
--- a/board/twinkie/board.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Copyright 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 "common.h"
-#include "console.h"
-#include "ec_version.h"
-#include "gpio.h"
-#include "hooks.h"
-#include "i2c.h"
-#include "ina2xx.h"
-#include "registers.h"
-#include "task.h"
-#include "usb_descriptor.h"
-#include "util.h"
-
-void cc2_event(enum gpio_signal signal)
-{
- ccprintf("INA!\n");
-}
-
-void vbus_event(enum gpio_signal signal)
-{
- ccprintf("INA!\n");
-}
-
-#include "gpio_list.h"
-
-/* Initialize board. */
-void board_config_pre_init(void)
-{
- /* enable SYSCFG clock */
- STM32_RCC_APB2ENR |= BIT(0);
- /* Remap USART DMA to match the USART driver and TIM2 DMA */
- STM32_SYSCFG_CFGR1 |= BIT(9) | BIT(10) /* Remap USART1 RX/TX DMA */
- | BIT(29);/* Remap TIM2 DMA */
- /* 40 MHz pin speed on UART PA9/PA10 */
- STM32_GPIO_OSPEEDR(GPIO_A) |= 0x003C0000;
- /* 40 MHz pin speed on TX clock out PB9 */
- STM32_GPIO_OSPEEDR(GPIO_B) |= 0x000C0000;
-}
-
-static void board_init(void)
-{
- /* Enable interrupts for INAs. */
- gpio_enable_interrupt(GPIO_CC2_ALERT_L);
- gpio_enable_interrupt(GPIO_VBUS_ALERT_L);
-
- /* Calibrate INA0 (VBUS) with 1mA/LSB scale */
- ina2xx_init(0, 0x8000, INA2XX_CALIB_1MA(15 /*mOhm*/));
- /* Disable INA1 (VCONN2) to avoid leaking current */
- ina2xx_init(1, 0, INA2XX_CALIB_1MA(15 /*mOhm*/));
-}
-DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
-
-/* ADC channels */
-const struct adc_t adc_channels[] = {
- /* USB PD CC lines sensing. Converted to mV (3300mV/4096). */
- [ADC_CH_CC1_PD] = {"CC1_PD", 3300, 4096, 0, STM32_AIN(1)},
- [ADC_CH_CC2_PD] = {"CC2_PD", 3300, 4096, 0, STM32_AIN(3)},
-};
-BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
-
-/* I2C ports */
-const struct i2c_port_t i2c_ports[] = {
- {"master", I2C_PORT_MASTER, 100, GPIO_I2C_SCL, GPIO_I2C_SDA},
-};
-const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
-
-const void * const usb_strings[] = {
- [USB_STR_DESC] = usb_string_desc,
- [USB_STR_VENDOR] = USB_STRING_DESC("Google Inc."),
- [USB_STR_PRODUCT] = USB_STRING_DESC("Twinkie"),
- [USB_STR_VERSION] = USB_STRING_DESC(CROS_EC_VERSION32),
- [USB_STR_SNIFFER] = USB_STRING_DESC("USB-PD Sniffer"),
- [USB_STR_CONSOLE_NAME] = USB_STRING_DESC("Shell"),
-};
-BUILD_ASSERT(ARRAY_SIZE(usb_strings) == USB_STR_COUNT);