summaryrefslogtreecommitdiff
path: root/board/sweetberry/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/sweetberry/board.c
parent08f5a1e6fc2c9467230444ac9b582dcf4d9f0068 (diff)
downloadchrome-ec-stabilize-14682.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/sweetberry/board.c')
-rw-r--r--board/sweetberry/board.c126
1 files changed, 0 insertions, 126 deletions
diff --git a/board/sweetberry/board.c b/board/sweetberry/board.c
deleted file mode 100644
index 66b21a81b9..0000000000
--- a/board/sweetberry/board.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/* Copyright 2016 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.
- */
-/* Sweetberry board configuration */
-
-#include "common.h"
-#include "dma.h"
-#include "ec_version.h"
-#include "gpio.h"
-#include "gpio_list.h"
-#include "hooks.h"
-#include "i2c.h"
-#include "registers.h"
-#include "stm32-dma.h"
-#include "task.h"
-#include "update_fw.h"
-#include "usb_descriptor.h"
-#include "usb_dwc_console.h"
-#include "usb_dwc_i2c.h"
-#include "usb_dwc_stream.h"
-#include "usb_dwc_update.h"
-#include "usb_hw.h"
-#include "usb_power.h"
-#include "util.h"
-
-/******************************************************************************
- * Define the strings used in our USB descriptors.
- */
-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("Sweetberry"),
- [USB_STR_SERIALNO] = USB_STRING_DESC("1234-a"),
- [USB_STR_VERSION] = USB_STRING_DESC(CROS_EC_VERSION32),
- [USB_STR_I2C_NAME] = USB_STRING_DESC("I2C"),
- [USB_STR_CONSOLE_NAME] = USB_STRING_DESC("Sweetberry EC Shell"),
- [USB_STR_UPDATE_NAME] = USB_STRING_DESC("Firmware update"),
-};
-
-BUILD_ASSERT(ARRAY_SIZE(usb_strings) == USB_STR_COUNT);
-
-/* USB power interface. */
-USB_POWER_CONFIG(sweetberry_power, USB_IFACE_POWER, USB_EP_POWER);
-
-struct dwc_usb usb_ctl = {
- .ep = {
- &ep0_ctl,
- &ep_console_ctl,
- &usb_update_ep_ctl,
- &sweetberry_power_ep_ctl,
- &i2c_usb__ep_ctl,
- },
- .speed = USB_SPEED_FS,
- .phy_type = USB_PHY_ULPI,
- .dma_en = 1,
- .irq = STM32_IRQ_OTG_HS,
-};
-
-/* I2C ports */
-const struct i2c_port_t i2c_ports[] = {
- {"i2c1", I2C_PORT_0, 400,
- GPIO_I2C1_SCL, GPIO_I2C1_SDA},
- {"i2c2", I2C_PORT_1, 400,
- GPIO_I2C2_SCL, GPIO_I2C2_SDA},
- {"i2c3", I2C_PORT_2, 400,
- GPIO_I2C3_SCL, GPIO_I2C3_SDA},
- {"fmpi2c4", FMPI2C_PORT_3, 900,
- GPIO_FMPI2C_SCL, GPIO_FMPI2C_SDA},
-};
-const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
-
-int usb_i2c_board_is_enabled(void) { return 1; }
-
-#define GPIO_SET_HS(bank, number) \
- (STM32_GPIO_OSPEEDR(GPIO_##bank) |= (0x3 << ((number) * 2)))
-
-void board_config_post_gpio_init(void)
-{
- /* We use MCO2 clock passthrough to provide a clock to USB HS */
- gpio_config_module(MODULE_MCO, 1);
- /* GPIO PC9 to high speed */
- GPIO_SET_HS(C, 9);
-
- if (usb_ctl.phy_type == USB_PHY_ULPI)
- gpio_set_level(GPIO_USB_MUX_SEL, 0);
- else
- gpio_set_level(GPIO_USB_MUX_SEL, 1);
-
- /* Set USB GPIO to high speed */
- GPIO_SET_HS(A, 11);
- GPIO_SET_HS(A, 12);
-
- GPIO_SET_HS(C, 3);
- GPIO_SET_HS(C, 2);
- GPIO_SET_HS(C, 0);
- GPIO_SET_HS(A, 5);
-
- GPIO_SET_HS(B, 5);
- GPIO_SET_HS(B, 13);
- GPIO_SET_HS(B, 12);
- GPIO_SET_HS(B, 2);
- GPIO_SET_HS(B, 10);
- GPIO_SET_HS(B, 1);
- GPIO_SET_HS(B, 0);
- GPIO_SET_HS(A, 3);
-
- /* Set I2C GPIO to HS */
- GPIO_SET_HS(B, 6);
- GPIO_SET_HS(B, 7);
- GPIO_SET_HS(F, 1);
- GPIO_SET_HS(F, 0);
- GPIO_SET_HS(A, 8);
- GPIO_SET_HS(B, 4);
- GPIO_SET_HS(C, 6);
- GPIO_SET_HS(C, 7);
-}
-
-static void board_init(void)
-{
- uint8_t tmp;
-
- /* i2c 0 has a tendancy to get wedged. TODO(nsanders): why? */
- i2c_xfer(0, 0, NULL, 0, &tmp, 1);
-}
-DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);