diff options
Diffstat (limited to 'board/gingerbread')
-rw-r--r-- | board/gingerbread/board.c | 105 | ||||
-rw-r--r-- | board/gingerbread/board.h | 23 | ||||
-rw-r--r-- | board/gingerbread/build.mk | 2 | ||||
-rw-r--r-- | board/gingerbread/ec.tasklist | 2 | ||||
-rw-r--r-- | board/gingerbread/gpio.inc | 2 |
5 files changed, 65 insertions, 69 deletions
diff --git a/board/gingerbread/board.c b/board/gingerbread/board.c index 3d80985c0a..8d14bda30c 100644 --- a/board/gingerbread/board.c +++ b/board/gingerbread/board.c @@ -1,4 +1,4 @@ -/* Copyright 2020 The Chromium OS Authors. All rights reserved. +/* Copyright 2020 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -31,8 +31,8 @@ #include "usb_tc_sm.h" #include "util.h" -#define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ## args) -#define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ## args) +#define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ##args) +#define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ##args) #define QUICHE_PD_DEBUG_LVL 1 @@ -102,27 +102,27 @@ static void board_pwr_btn_interrupt(enum gpio_signal signal) * signals is driven by USB/MST hub power sequencing requirements. */ const struct power_seq board_power_seq[] = { - {GPIO_EN_AC_JACK, 1, 20}, - {GPIO_EN_PP5000_A, 1, 31}, - {GPIO_EN_PP3300_A, 1, 135}, - {GPIO_EN_BB, 1, 30}, - {GPIO_EN_PP1100_A, 1, 30}, - {GPIO_EN_PP1000_A, 1, 20}, - {GPIO_EN_PP1050_A, 1, 30}, - {GPIO_EN_PP1200_A, 1, 20}, - {GPIO_EN_PP5000_HSPORT, 1, 31}, - {GPIO_EN_DP_SINK, 1, 80}, - {GPIO_MST_LP_CTL_L, 1, 80}, - {GPIO_MST_RST_L, 1, 41}, - {GPIO_EC_HUB1_RESET_L, 1, 41}, - {GPIO_EC_HUB2_RESET_L, 1, 33}, - {GPIO_USBC_DP_PD_RST_L, 1, 100}, - {GPIO_USBC_UF_RESET_L, 1, 33}, - {GPIO_DEMUX_DUAL_DP_PD_N, 1, 100}, - {GPIO_DEMUX_DUAL_DP_RESET_N, 1, 100}, - {GPIO_DEMUX_DP_HDMI_PD_N, 1, 10}, - {GPIO_DEMUX_DUAL_DP_MODE, 1, 10}, - {GPIO_DEMUX_DP_HDMI_MODE, 1, 1}, + { GPIO_EN_AC_JACK, 1, 20 }, + { GPIO_EN_PP5000_A, 1, 31 }, + { GPIO_EN_PP3300_A, 1, 135 }, + { GPIO_EN_BB, 1, 30 }, + { GPIO_EN_PP1100_A, 1, 30 }, + { GPIO_EN_PP1000_A, 1, 20 }, + { GPIO_EN_PP1050_A, 1, 30 }, + { GPIO_EN_PP1200_A, 1, 20 }, + { GPIO_EN_PP5000_HSPORT, 1, 31 }, + { GPIO_EN_DP_SINK, 1, 80 }, + { GPIO_MST_LP_CTL_L, 1, 80 }, + { GPIO_MST_RST_L, 1, 41 }, + { GPIO_EC_HUB1_RESET_L, 1, 41 }, + { GPIO_EC_HUB2_RESET_L, 1, 33 }, + { GPIO_USBC_DP_PD_RST_L, 1, 100 }, + { GPIO_USBC_UF_RESET_L, 1, 33 }, + { GPIO_DEMUX_DUAL_DP_PD_N, 1, 100 }, + { GPIO_DEMUX_DUAL_DP_RESET_N, 1, 100 }, + { GPIO_DEMUX_DP_HDMI_PD_N, 1, 10 }, + { GPIO_DEMUX_DUAL_DP_MODE, 1, 10 }, + { GPIO_DEMUX_DP_HDMI_MODE, 1, 1 }, }; const size_t board_power_seq_count = ARRAY_SIZE(board_power_seq); @@ -131,13 +131,13 @@ const size_t board_power_seq_count = ARRAY_SIZE(board_power_seq); * 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("Gingerbread"), - [USB_STR_SERIALNO] = 0, - [USB_STR_VERSION] = - USB_STRING_DESC(CROS_EC_SECTION ":" CROS_EC_VERSION32), - [USB_STR_UPDATE_NAME] = USB_STRING_DESC("Firmware update"), + [USB_STR_DESC] = usb_string_desc, + [USB_STR_VENDOR] = USB_STRING_DESC("Google LLC"), + [USB_STR_PRODUCT] = USB_STRING_DESC("Gingerbread"), + [USB_STR_SERIALNO] = 0, + [USB_STR_VERSION] = + USB_STRING_DESC(CROS_EC_SECTION ":" CROS_EC_VERSION32), + [USB_STR_UPDATE_NAME] = USB_STRING_DESC("Firmware update"), }; BUILD_ASSERT(ARRAY_SIZE(usb_strings) == USB_STR_COUNT); @@ -186,33 +186,33 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { }, }; -const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { +const struct usb_mux_chain usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { [USB_PD_PORT_HOST] = { - .usb_port = USB_PD_PORT_HOST, - .i2c_port = I2C_PORT_I2C1, - .i2c_addr_flags = TUSB1064_I2C_ADDR0_FLAGS, - .driver = &tusb1064_usb_mux_driver, - .board_set = &board_tusb1064_dp_rx_eq_set, + .mux = &(const struct usb_mux) { + .usb_port = USB_PD_PORT_HOST, + .i2c_port = I2C_PORT_I2C1, + .i2c_addr_flags = TUSB1064_I2C_ADDR0_FLAGS, + .driver = &tusb1064_usb_mux_driver, + .board_set = &board_tusb1064_dp_rx_eq_set, + }, }, [USB_PD_PORT_DP] = { - .usb_port = USB_PD_PORT_DP, - .i2c_port = I2C_PORT_I2C3, - .i2c_addr_flags = PS8XXX_I2C_ADDR2_FLAGS, - .driver = &tcpci_tcpm_usb_mux_driver, - .hpd_update = &ps8xxx_tcpc_update_hpd_status, + .mux = &(const struct usb_mux) { + .usb_port = USB_PD_PORT_DP, + .i2c_port = I2C_PORT_I2C3, + .i2c_addr_flags = PS8XXX_I2C_ADDR2_FLAGS, + .driver = &tcpci_tcpm_usb_mux_driver, + .hpd_update = &ps8xxx_tcpc_update_hpd_status, + }, }, }; /* USB-C PPC Configuration */ struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_MAX_COUNT] = { - [USB_PD_PORT_HOST] = { - .i2c_port = I2C_PORT_I2C3, - .i2c_addr_flags = SN5S330_ADDR0_FLAGS, - .drv = &sn5s330_drv - }, - [USB_PD_PORT_DP] = { - .drv = &board_ppc_null_drv - }, + [USB_PD_PORT_HOST] = { .i2c_port = I2C_PORT_I2C3, + .i2c_addr_flags = SN5S330_ADDR0_FLAGS, + .drv = &sn5s330_drv }, + [USB_PD_PORT_DP] = { .drv = &board_ppc_null_drv }, }; unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); @@ -239,7 +239,6 @@ void board_reset_pd_mcu(void) msleep(PS8805_FW_INIT_DELAY_MS); } - /* Power Delivery and charging functions */ void board_enable_usbc_interrupts(void) { @@ -253,7 +252,6 @@ void board_enable_usbc_interrupts(void) /* Enable HPD interrupt */ gpio_enable_interrupt(GPIO_DDI_MST_IN_HPD); - } /* Power Delivery and charging functions */ @@ -267,7 +265,6 @@ void board_disable_usbc_interrupts(void) /* Disable HPD interrupt */ gpio_disable_interrupt(GPIO_DDI_MST_IN_HPD); - } void board_tcpc_init(void) @@ -351,7 +348,7 @@ static void board_usb_tc_disconnect(void) gpio_set_level(GPIO_EC_HUB2_RESET_L, 0); } } -DECLARE_HOOK(HOOK_USB_PD_DISCONNECT, board_usb_tc_disconnect, \ +DECLARE_HOOK(HOOK_USB_PD_DISCONNECT, board_usb_tc_disconnect, HOOK_PRIO_DEFAULT); #endif /* SECTION_IS_RW */ diff --git a/board/gingerbread/board.h b/board/gingerbread/board.h index cfc5bbf0a0..09e9e0b7fe 100644 --- a/board/gingerbread/board.h +++ b/board/gingerbread/board.h @@ -1,4 +1,4 @@ -/* Copyright 2020 The Chromium OS Authors. All rights reserved. +/* Copyright 2020 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -20,7 +20,6 @@ #define CONFIG_SYSTEM_UNLOCKED /* Allow dangerous commands while in dev. */ #undef CONFIG_FLASH_PSTATE_LOCKED - #define CONFIG_WP_ACTIVE_HIGH /* Console */ @@ -29,8 +28,8 @@ #define CONFIG_UART_TX_DMA_PH DMAMUX_REQ_USART3_TX /* USB Type C and USB PD defines */ -#define USB_PD_PORT_HOST 0 -#define USB_PD_PORT_DP 1 +#define USB_PD_PORT_HOST 0 +#define USB_PD_PORT_DP 1 #define CONFIG_USB_PD_PORT_MAX_COUNT 2 #define CONFIG_USB_MUX_TUSB1064 @@ -44,13 +43,13 @@ #define CONFIG_USB_PD_IDENTITY_SW_VERS 1 /* I2C port names */ -#define I2C_PORT_I2C1 0 -#define I2C_PORT_I2C2 1 -#define I2C_PORT_I2C3 2 +#define I2C_PORT_I2C1 0 +#define I2C_PORT_I2C2 1 +#define I2C_PORT_I2C3 2 /* Required symbolic I2C port names */ #define I2C_PORT_MP4245 I2C_PORT_I2C3 #define I2C_PORT_EEPROM I2C_PORT_I2C1 -#define MP4245_I2C_ADDR_FLAGS MP4245_I2C_ADDR_0_FLAGS +#define MP4245_I2C_ADDR_FLAGS MP4245_I2C_ADDR_0_FLAGS /* * Macros for GPIO signals used in common code that don't match the @@ -58,9 +57,9 @@ * then redefined here to so it's more clear which signal is being used for * which purpose. */ -#define GPIO_ENTERING_RW GPIO_EC_ENTERING_RW -#define GPIO_WP_L GPIO_EC_WP_L -#define GPIO_WP GPIO_EC_WP_L +#define GPIO_ENTERING_RW GPIO_EC_ENTERING_RW +#define GPIO_WP_L GPIO_EC_WP_L +#define GPIO_WP GPIO_EC_WP_L /* Include math_util for bitmask_uint64 used in pd_timers */ #define CONFIG_MATH_UTIL @@ -80,7 +79,7 @@ #define GPIO_TRIGGER_1 GPIO_USB3_A1_CDP_EN #define GPIO_TRIGGER_2 GPIO_USB3_A2_CDP_EN -enum debug_gpio { +enum debug_gpio { TRIGGER_1 = 0, TRIGGER_2, }; diff --git a/board/gingerbread/build.mk b/board/gingerbread/build.mk index f994cc1434..d7ca7b35b5 100644 --- a/board/gingerbread/build.mk +++ b/board/gingerbread/build.mk @@ -1,5 +1,5 @@ # -*- makefile -*- -# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # diff --git a/board/gingerbread/ec.tasklist b/board/gingerbread/ec.tasklist index cc36bf5a74..ffd4a604c9 100644 --- a/board/gingerbread/ec.tasklist +++ b/board/gingerbread/ec.tasklist @@ -1,4 +1,4 @@ -/* Copyright 2020 The Chromium OS Authors. All rights reserved. +/* Copyright 2020 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ diff --git a/board/gingerbread/gpio.inc b/board/gingerbread/gpio.inc index 6226ff747e..4da3c973c1 100644 --- a/board/gingerbread/gpio.inc +++ b/board/gingerbread/gpio.inc @@ -1,6 +1,6 @@ /* -*- mode:c -*- * - * Copyright 2020 The Chromium OS Authors. All rights reserved. + * Copyright 2020 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ |