summaryrefslogtreecommitdiff
path: root/board/atlas
diff options
context:
space:
mode:
Diffstat (limited to 'board/atlas')
-rw-r--r--board/atlas/battery.c259
-rw-r--r--board/atlas/board.c629
-rw-r--r--board/atlas/board.h269
-rw-r--r--board/atlas/build.mk16
-rw-r--r--board/atlas/ec.tasklist23
-rw-r--r--board/atlas/gpio.inc157
-rw-r--r--board/atlas/led.c93
-rw-r--r--board/atlas/usb_pd_policy.c125
-rw-r--r--board/atlas/vif_override.xml3
9 files changed, 0 insertions, 1574 deletions
diff --git a/board/atlas/battery.c b/board/atlas/battery.c
deleted file mode 100644
index fb2fba18be..0000000000
--- a/board/atlas/battery.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/* Copyright 2018 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.
- *
- * Placeholder values for temporary battery pack.
- */
-
-#include "battery.h"
-#include "battery_smart.h"
-#include "bd9995x.h"
-#include "charge_ramp.h"
-#include "charge_state.h"
-#include "console.h"
-#include "ec_commands.h"
-#include "extpower.h"
-#include "gpio.h"
-#include "hooks.h"
-#include "i2c.h"
-#include "util.h"
-
-#define CPRINTS(format, args...) cprints(CC_CHARGER, format, ## args)
-
-/* Shutdown mode parameter to write to manufacturer access register */
-#define SB_SHUTDOWN_DATA 0x0010
-
-enum battery_type {
- BATTERY_LG,
- BATTERY_LISHEN,
- BATTERY_SIMPLO,
- BATTERY_TYPE_COUNT,
-};
-
-struct board_batt_params {
- const char *manuf_name;
- const struct battery_info *batt_info;
-};
-
-/*
- * Set LISHEN as default since the LG precharge current level could cause the
- * LISHEN battery to not accept charge when it's recovering from a fully
- * discharged state.
- */
-#define DEFAULT_BATTERY_TYPE BATTERY_LISHEN
-static enum battery_type board_battery_type = BATTERY_TYPE_COUNT;
-
-/* Battery may delay reporting battery present */
-static int battery_report_present = 1;
-
-/*
- * Battery info for LG A50. Note that the fields start_charging_min/max and
- * charging_min/max are not used for the Eve charger. The effective temperature
- * limits are given by discharging_min/max_c.
- */
-static const struct battery_info batt_info_lg = {
- .voltage_max = TARGET_WITH_MARGIN(8800, 5), /* mV */
- .voltage_normal = 7700,
- .voltage_min = 6100, /* Add 100mV for charger accuracy */
- .precharge_current = 256, /* mA */
- .start_charging_min_c = 0,
- .start_charging_max_c = 46,
- .charging_min_c = 10,
- .charging_max_c = 50,
- .discharging_min_c = 0,
- .discharging_max_c = 60,
-};
-
-/*
- * Battery info for LISHEN. Note that the fields start_charging_min/max and
- * charging_min/max are not used for the Eve charger. The effective temperature
- * limits are given by discharging_min/max_c.
- */
-static const struct battery_info batt_info_lishen = {
- .voltage_max = TARGET_WITH_MARGIN(8800, 5), /* mV */
- .voltage_normal = 7700,
- .voltage_min = 6100, /* Add 100mV for charger accuracy */
- .precharge_current = 256, /* mA */
- .start_charging_min_c = 0,
- .start_charging_max_c = 46,
- .charging_min_c = 10,
- .charging_max_c = 50,
- .discharging_min_c = 0,
- .discharging_max_c = 60,
-};
-
-static const struct board_batt_params info[] = {
- [BATTERY_LG] = {
- .manuf_name = "LG A50",
- .batt_info = &batt_info_lg,
- },
-
- [BATTERY_LISHEN] = {
- .manuf_name = "Lishen A50",
- .batt_info = &batt_info_lishen,
- },
-
- [BATTERY_SIMPLO] = {
- .manuf_name = "Simplo A50",
- .batt_info = &batt_info_lishen,
- },
-
-};
-BUILD_ASSERT(ARRAY_SIZE(info) == BATTERY_TYPE_COUNT);
-
-/* Get type of the battery connected on the board */
-static int board_get_battery_type(void)
-{
- char name[3];
- int i;
-
- if (!battery_manufacturer_name(name, sizeof(name))) {
- for (i = 0; i < BATTERY_TYPE_COUNT; i++) {
- if (!strncasecmp(name, info[i].manuf_name,
- ARRAY_SIZE(name)-1)) {
- board_battery_type = i;
- break;
- }
- }
- }
-
- return board_battery_type;
-}
-
-/*
- * Initialize the battery type for the board.
- *
- * Very first battery info is called by the charger driver to initialize
- * the charger parameters hence initialize the battery type for the board
- * as soon as the I2C is initialized.
- */
-static void board_init_battery_type(void)
-{
- if (board_get_battery_type() != BATTERY_TYPE_COUNT)
- CPRINTS("found batt: %s", info[board_battery_type].manuf_name);
- else
- CPRINTS("battery not found");
-}
-DECLARE_HOOK(HOOK_INIT, board_init_battery_type, HOOK_PRIO_INIT_I2C + 1);
-
-const struct battery_info *battery_get_info(void)
-{
- return info[board_battery_type == BATTERY_TYPE_COUNT ?
- DEFAULT_BATTERY_TYPE : board_battery_type].batt_info;
-}
-
-int board_cut_off_battery(void)
-{
- int rv;
-
- /* Ship mode command must be sent twice to take effect */
- rv = sb_write(SB_MANUFACTURER_ACCESS, SB_SHUTDOWN_DATA);
- if (rv != EC_SUCCESS)
- return EC_RES_ERROR;
-
- rv = sb_write(SB_MANUFACTURER_ACCESS, SB_SHUTDOWN_DATA);
- return rv ? EC_RES_ERROR : EC_RES_SUCCESS;
-}
-
-static int charger_should_discharge_on_ac(struct charge_state_data *curr)
-{
- /* Can not discharge on AC without battery */
- if (curr->batt.is_present != BP_YES)
- return 0;
- if (curr->batt.flags & BATT_FLAG_BAD_STATUS)
- return 0;
-
- /* Do not discharge on AC if the battery is still waking up */
- if (!(curr->batt.flags & BATT_FLAG_WANT_CHARGE) &&
- !(curr->batt.status & STATUS_FULLY_CHARGED))
- return 0;
-
- /*
- * In light load (<450mA being withdrawn from VSYS) the DCDC of the
- * charger operates intermittently i.e. DCDC switches continuously
- * and then stops to regulate the output voltage and current, and
- * sometimes to prevent reverse current from flowing to the input.
- * This causes a slight voltage ripple on VSYS that falls in the
- * audible noise frequency (single digit kHz range). This small
- * ripple generates audible noise in the output ceramic capacitors
- * (caps on VSYS and any input of DCDC under VSYS).
- *
- * To overcome this issue enable the battery learning operation
- * and suspend USB charging and DC/DC converter.
- */
- if (!battery_is_cut_off() &&
- !(curr->batt.flags & BATT_FLAG_WANT_CHARGE) &&
- (curr->batt.status & STATUS_FULLY_CHARGED))
- return 1;
-
- return 0;
-}
-
-int charger_profile_override(struct charge_state_data *curr)
-{
- const struct battery_info *batt_info;
- /* battery temp in 0.1 deg C */
- int bat_temp_c;
- int disch_on_ac = charger_should_discharge_on_ac(curr);
-
- charger_discharge_on_ac(disch_on_ac);
- if (disch_on_ac) {
- curr->state = ST_DISCHARGE;
- return 0;
- }
-
- if (curr->batt.flags & BATT_FLAG_BAD_TEMPERATURE)
- return 0;
-
- bat_temp_c = curr->batt.temperature - 2731;
- batt_info = battery_get_info();
- /* Don't charge if outside of allowable temperature range */
- if (bat_temp_c >= batt_info->charging_max_c * 10 ||
- bat_temp_c < batt_info->charging_min_c * 10) {
- curr->requested_current = 0;
- curr->requested_voltage = 0;
- curr->batt.flags &= ~BATT_FLAG_WANT_CHARGE;
- curr->state = ST_IDLE;
- }
- return 0;
-}
-
-/* Customs options controllable by host command. */
-#define PARAM_FASTCHARGE (CS_PARAM_CUSTOM_PROFILE_MIN + 0)
-
-enum ec_status charger_profile_override_get_param(uint32_t param,
- uint32_t *value)
-{
- return EC_RES_INVALID_PARAM;
-}
-
-enum ec_status charger_profile_override_set_param(uint32_t param,
- uint32_t value)
-{
- return EC_RES_INVALID_PARAM;
-}
-
-enum battery_present battery_hw_present(void)
-{
- /* The GPIO is low when the battery is physically present */
- return gpio_get_level(GPIO_BATTERY_PRESENT_L) ? BP_NO : BP_YES;
-}
-
-/* Allow booting now that the battery has woke up */
-static void battery_now_present(void)
-{
- CPRINTS("battery will now report present");
- battery_report_present = 1;
-}
-DECLARE_DEFERRED(battery_now_present);
-
-/*
- * Physical detection of battery.
- */
-enum battery_present battery_is_present(void)
-{
- if (battery_hw_present() == BP_NO || battery_is_cut_off())
- return BP_NO;
-
- return BP_YES;
-}
diff --git a/board/atlas/board.c b/board/atlas/board.c
deleted file mode 100644
index 4881ed6898..0000000000
--- a/board/atlas/board.c
+++ /dev/null
@@ -1,629 +0,0 @@
-/* Copyright 2018 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.
- */
-
-/* Atlas board-specific configuration */
-
-#include "adc_chip.h"
-#include "bd99992gw.h"
-#include "board_config.h"
-#include "charge_manager.h"
-#include "charger.h"
-#include "charge_state.h"
-#include "chipset.h"
-#include "console.h"
-#include "driver/als_opt3001.h"
-#include "driver/pmic_bd99992gw.h"
-#include "driver/charger/isl923x.h"
-#include "driver/tcpm/ps8xxx.h"
-#include "driver/tcpm/tcpci.h"
-#include "driver/tcpm/tcpm.h"
-#include "espi.h"
-#include "extpower.h"
-#include "gpio.h"
-#include "hooks.h"
-#include "host_command.h"
-#include "i2c.h"
-#include "keyboard_8042_sharedlib.h"
-#include "keyboard_scan.h"
-#include "lid_switch.h"
-#include "motion_sense.h"
-#include "power_button.h"
-#include "power.h"
-#include "pwm_chip.h"
-#include "pwm.h"
-#include "spi.h"
-#include "switch.h"
-#include "system.h"
-#include "system_chip.h"
-#include "task.h"
-#include "temp_sensor.h"
-#include "timer.h"
-#include "uart.h"
-#include "usb_mux.h"
-#include "usb_pd.h"
-#include "usb_pd_tcpm.h"
-#include "util.h"
-
-#define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ## args)
-#define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ## args)
-
-static void tcpc_alert_event(enum gpio_signal signal)
-{
- int port = -1;
-
- switch (signal) {
- case GPIO_USB_C0_PD_INT_ODL:
- port = 0;
- break;
- case GPIO_USB_C1_PD_INT_ODL:
- port = 1;
- break;
- default:
- return;
- }
-
- schedule_deferred_pd_interrupt(port);
-}
-
-#include "gpio_list.h"
-
-/* Keyboard scan. Increase output_settle_us to 80us from default 50us. */
-__override struct keyboard_scan_config keyscan_config = {
- .output_settle_us = 80,
- .debounce_down_us = 9 * MSEC,
- .debounce_up_us = 30 * MSEC,
- .scan_period_us = 3 * MSEC,
- .min_post_scan_delay_us = 1000,
- .poll_timeout_us = 100 * MSEC,
- .actual_key_mask = {
- 0x3c, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff,
- 0xa4, 0xff, 0xfe, 0x55, 0xfa, 0xca /* full set */
- },
-};
-
-/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */
-const struct pwm_t pwm_channels[] = {
- [PWM_CH_KBLIGHT] = { 3, 0, 10000 },
- [PWM_CH_DB0_LED_BLUE] = {
- 0, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP, 2400 },
- [PWM_CH_DB0_LED_RED] = {
- 2, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP, 2400 },
- [PWM_CH_DB0_LED_GREEN] = {
- 6, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP, 2400 },
- [PWM_CH_DB1_LED_BLUE] = {
- 1, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP, 2400 },
- [PWM_CH_DB1_LED_RED] = {
- 7, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP, 2400 },
- [PWM_CH_DB1_LED_GREEN] = {
- 5, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP, 2400 },
-};
-BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
-
-/* Hibernate wake configuration */
-const enum gpio_signal hibernate_wake_pins[] = {
- GPIO_ROP_EC_ACOK,
- GPIO_LID_OPEN,
- GPIO_MECH_PWR_BTN_ODL,
-};
-const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins);
-
-const struct adc_t adc_channels[] = {
- /*
- * Adapter current output or battery charging/discharging current (uV)
- * 18x amplification on charger side.
- */
- [ADC_AMON_BMON] = {
- "AMON_BMON",
- NPCX_ADC_CH2,
- ADC_MAX_VOLT*1000/18,
- ADC_READ_MAX+1,
- 0
- },
- /*
- * ISL9238 PSYS output is 1.44 uA/W over 12.4K resistor, to read
- * 0.8V @ 45 W, i.e. 56250 uW/mV. Using ADC_MAX_VOLT*56250 and
- * ADC_READ_MAX+1 as multiplier/divider leads to overflows, so we
- * only divide by 2 (enough to avoid precision issues).
- */
- [ADC_PSYS] = {
- "PSYS",
- NPCX_ADC_CH3,
- ADC_MAX_VOLT*56250*2/(ADC_READ_MAX+1),
- 2,
- 0
- },
-};
-BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
-
-/* I2C port map */
-const struct i2c_port_t i2c_ports[] = {
- {"power", I2C_PORT_POWER, 100,
- GPIO_EC_I2C0_POWER_SCL, GPIO_EC_I2C0_POWER_SDA},
- {"tcpc0", I2C_PORT_TCPC0, 1000,
- GPIO_EC_I2C1_USB_C0_SCL, GPIO_EC_I2C1_USB_C0_SDA},
- {"tcpc1", I2C_PORT_TCPC1, 1000,
- GPIO_EC_I2C2_USB_C1_SCL, GPIO_EC_I2C2_USB_C1_SDA},
- {"sensor", I2C_PORT_SENSOR, 100,
- GPIO_EC_I2C3_SENSOR_3V3_SCL, GPIO_EC_I2C3_SENSOR_3V3_SDA},
- {"battery", I2C_PORT_BATTERY, 100,
- GPIO_EC_I2C4_BATTERY_SCL, GPIO_EC_I2C4_BATTERY_SDA},
-};
-const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
-
-/* Charger Chips */
-const struct charger_config_t chg_chips[] = {
- {
- .i2c_port = I2C_PORT_CHARGER,
- .i2c_addr_flags = ISL923X_ADDR_FLAGS,
- .drv = &isl923x_drv,
- },
-};
-
-/* TCPC mux configuration */
-const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
- {
- /* left port */
- .bus_type = EC_BUS_TYPE_I2C,
- .i2c_info = {
- .port = I2C_PORT_TCPC0,
- .addr_flags = I2C_ADDR_TCPC_FLAGS,
- },
- .drv = &ps8xxx_tcpm_drv,
- /* Alert is active-low, push-pull */
- .flags = 0,
- },
- {
- /* right port */
- .bus_type = EC_BUS_TYPE_I2C,
- .i2c_info = {
- .port = I2C_PORT_TCPC1,
- .addr_flags = I2C_ADDR_TCPC_FLAGS,
- },
- .drv = &ps8xxx_tcpm_drv,
- /* Alert is active-low, push-pull */
- .flags = 0,
- },
-};
-
-const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
- {
- .usb_port = 0,
- .driver = &tcpci_tcpm_usb_mux_driver,
- .hpd_update = &ps8xxx_tcpc_update_hpd_status,
- },
- {
- .usb_port = 1,
- .driver = &tcpci_tcpm_usb_mux_driver,
- .hpd_update = &ps8xxx_tcpc_update_hpd_status,
- },
-};
-
-void board_reset_pd_mcu(void)
-{
- gpio_set_level(GPIO_USB_PD_RST_L, 0);
- msleep(PS8XXX_RST_L_RST_H_DELAY_MS);
- gpio_set_level(GPIO_USB_PD_RST_L, 1);
-}
-
-void board_tcpc_init(void)
-{
- /* Only reset TCPC if not sysjump */
- if (!system_jumped_late())
- board_reset_pd_mcu();
-
- gpio_enable_interrupt(GPIO_USB_C0_PD_INT_ODL);
- gpio_enable_interrupt(GPIO_USB_C1_PD_INT_ODL);
-
- /*
- * Initialize HPD to low; after sysjump SOC needs to see
- * HPD pulse to enable video path
- */
- for (int port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; ++port)
- usb_mux_hpd_update(port, USB_PD_MUX_HPD_LVL_DEASSERTED |
- USB_PD_MUX_HPD_IRQ_DEASSERTED);
-}
-DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_INIT_I2C+1);
-
-uint16_t tcpc_get_alert_status(void)
-{
- uint16_t status = 0;
-
- if (!gpio_get_level(GPIO_USB_C0_PD_INT_ODL)) {
- if (gpio_get_level(GPIO_USB_C0_PD_RST_L))
- status |= PD_STATUS_TCPC_ALERT_0;
- }
-
- if (!gpio_get_level(GPIO_USB_C1_PD_INT_ODL)) {
- if (gpio_get_level(GPIO_USB_C1_PD_RST_L))
- status |= PD_STATUS_TCPC_ALERT_1;
- }
-
- return status;
-}
-
-const struct temp_sensor_t temp_sensors[] = {
- {"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp, 0},
- /* BD99992GW temp sensors are only readable in S0 */
- {"Ambient", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
- BD99992GW_ADC_CHANNEL_SYSTHERM0},
- {"Charger", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
- BD99992GW_ADC_CHANNEL_SYSTHERM1},
- {"DRAM", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
- BD99992GW_ADC_CHANNEL_SYSTHERM2},
- {"eMMC", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
- BD99992GW_ADC_CHANNEL_SYSTHERM3},
-};
-BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
-
-/*
- * Check if PMIC fault registers indicate VR fault. If yes, print out fault
- * register info to console. Additionally, set panic reason so that the OS can
- * check for fault register info by looking at offset 0x14(PWRSTAT1) and
- * 0x15(PWRSTAT2) in cros ec panicinfo.
- */
-static void board_report_pmic_fault(const char *str)
-{
- int vrfault, pwrstat1 = 0, pwrstat2 = 0;
- uint32_t info;
-
- /* RESETIRQ1 -- Bit 4: VRFAULT */
- if (i2c_read8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_RESETIRQ1, &vrfault) != EC_SUCCESS)
- return;
-
- if (!(vrfault & BIT(4)))
- return;
-
- /* VRFAULT has occurred, print VRFAULT status bits. */
-
- /* PWRSTAT1 */
- i2c_read8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_PWRSTAT1, &pwrstat1);
-
- /* PWRSTAT2 */
- i2c_read8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_PWRSTAT2, &pwrstat2);
-
- CPRINTS("PMIC VRFAULT: %s", str);
- CPRINTS("PMIC VRFAULT: PWRSTAT1=0x%02x PWRSTAT2=0x%02x", pwrstat1,
- pwrstat2);
-
- /* Clear all faults -- Write 1 to clear. */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_RESETIRQ1, BIT(4));
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_PWRSTAT1, pwrstat1);
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_PWRSTAT2, pwrstat2);
-
- /*
- * Status of the fault registers can be checked in the OS by looking at
- * offset 0x14(PWRSTAT1) and 0x15(PWRSTAT2) in cros ec panicinfo.
- */
- info = ((pwrstat2 & 0xFF) << 8) | (pwrstat1 & 0xFF);
- panic_set_reason(PANIC_SW_PMIC_FAULT, info, 0);
-}
-
-static void board_pmic_disable_slp_s0_vr_decay(void)
-{
- /*
- * VCCIOCNT:
- * Bit 6 (0) - Disable decay of VCCIO on SLP_S0# assertion
- * Bits 5:4 (11) - Nominal output voltage: 0.850V
- * Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
- * Bits 1:0 (10) - VR set to AUTO operating mode
- */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_VCCIOCNT, 0x3a);
-
- /*
- * V18ACNT:
- * Bits 7:6 (00) - Disable low power mode on SLP_S0# assertion
- * Bits 5:4 (10) - Nominal voltage set to 1.8V
- * Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
- * Bits 1:0 (10) - VR set to AUTO operating mode
- */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_V18ACNT, 0x2a);
-
- /*
- * V085ACNT:
- * Bits 7:6 (00) - Disable low power mode on SLP_S0# assertion
- * Bits 5:4 (10) - Nominal voltage 0.85V
- * Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
- * Bits 1:0 (10) - VR set to AUTO operating mode
- */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_V085ACNT, 0x2a);
-}
-
-static void board_pmic_enable_slp_s0_vr_decay(void)
-{
- /*
- * VCCIOCNT:
- * Bit 6 (1) - Enable decay of VCCIO on SLP_S0# assertion
- * Bits 5:4 (11) - Nominal output voltage: 0.850V
- * Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
- * Bits 1:0 (10) - VR set to AUTO operating mode
- */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_VCCIOCNT, 0x7a);
-
- /*
- * V18ACNT:
- * Bits 7:6 (01) - Enable low power mode on SLP_S0# assertion
- * Bits 5:4 (10) - Nominal voltage set to 1.8V
- * Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
- * Bits 1:0 (10) - VR set to AUTO operating mode
- */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_V18ACNT, 0x6a);
-
- /*
- * V085ACNT:
- * Bits 7:6 (01) - Enable low power mode on SLP_S0# assertion
- * Bits 5:4 (10) - Nominal voltage 0.85V
- * Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
- * Bits 1:0 (10) - VR set to AUTO operating mode
- */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_V085ACNT, 0x6a);
-}
-
-__override void power_board_handle_host_sleep_event(
- enum host_sleep_event state)
-{
- if (state == HOST_SLEEP_EVENT_S0IX_SUSPEND)
- board_pmic_enable_slp_s0_vr_decay();
- else if (state == HOST_SLEEP_EVENT_S0IX_RESUME)
- board_pmic_disable_slp_s0_vr_decay();
-}
-
-static void board_pmic_init(void)
-{
- board_report_pmic_fault("SYSJUMP");
-
- /* Clear power source events */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_PWRSRCINT, 0xff);
-
- /* Disable power button shutdown timer */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_PBCONFIG, 0x00);
-
- if (system_jumped_late())
- return;
-
- /* DISCHGCNT1 - enable 100 ohm discharge on VCCIO */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_DISCHGCNT1, 0x01);
-
- /*
- * DISCHGCNT2 - enable 100 ohm discharge on
- * V5.0A, V3.3DSW, V3.3A and V1.8A
- */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_DISCHGCNT2, 0x55);
-
- /*
- * DISCHGCNT3 - enable 500 ohm discharge on
- * V1.8U_2.5U
- * DISCHGCNT3 - enable 100 ohm discharge on
- * V12U, V1.00A, V0.85A
- */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_DISCHGCNT3, 0xd5);
-
- /* DISCHGCNT4 - enable 100 ohm discharge on V33S, V18S, V100S */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_DISCHGCNT4, 0x15);
-
- /* VRMODECTRL - disable low-power mode for all rails */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_VRMODECTRL, 0x1f);
-
- /* V5ADS3CNT - boost V5A_DS3 by 2% */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_V5ADS3CNT, 0x1a);
-
- board_pmic_disable_slp_s0_vr_decay();
-}
-DECLARE_HOOK(HOOK_INIT, board_pmic_init, HOOK_PRIO_DEFAULT);
-
-void board_hibernate(void)
-{
- int p;
-
- /* Configure PSL pins */
- for (p = 0; p < hibernate_wake_pins_used; p++)
- system_config_psl_mode(hibernate_wake_pins[p]);
-
- /*
- * Enter PSL mode. Note that on Atlas, simply enabling PSL mode does
- * not cut the EC's power. Therefore, we'll need to cut off power via
- * the ROP PMIC afterwards.
- */
- system_enter_psl_mode();
-
- /* Cut off DSW power via the ROP PMIC. */
- i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- BD99992GW_REG_SDWNCTRL, BD99992GW_SDWNCTRL_SWDN);
-
- /* Wait for power to be cut. */
- while (1)
- ;
-}
-
-/* Initialize board. */
-static void board_init(void)
-{
- if (system_get_board_version() < ATLAS_REV_FIXED_EC_WP) {
- int dflags;
-
- CPRINTS("Applying EC_WP_L workaround");
- dflags = gpio_get_default_flags(GPIO_EC_WP_L);
- gpio_set_flags(GPIO_EC_WP_L, dflags | GPIO_PULL_UP);
- }
-
- /* Provide AC status to the PCH */
- gpio_set_level(GPIO_PCH_ACOK, extpower_is_present());
-}
-DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
-
-static void board_extpower(void)
-{
- gpio_set_level(GPIO_PCH_ACOK, extpower_is_present());
-}
-DECLARE_HOOK(HOOK_AC_CHANGE, board_extpower, HOOK_PRIO_DEFAULT);
-
-/**
- * Set active charge port -- only one port can be active at a time.
- *
- * @param charge_port Charge port to enable.
- *
- * Returns EC_SUCCESS if charge port is accepted and made active,
- * EC_ERROR_* otherwise.
- */
-int board_set_active_charge_port(int charge_port)
-{
- /* charge port is a physical port */
- int is_real_port = (charge_port >= 0 &&
- charge_port < CONFIG_USB_PD_PORT_MAX_COUNT);
- /* check if we are sourcing VBUS on the port */
- int is_source = gpio_get_level(charge_port == 0 ?
- GPIO_USB_C0_5V_EN : GPIO_USB_C1_5V_EN);
-
- if (is_real_port && is_source) {
- CPRINTS("No charging from p%d", charge_port);
- return EC_ERROR_INVAL;
- }
-
- CPRINTS("New chg p%d", charge_port);
-
- if (charge_port == CHARGE_PORT_NONE) {
- /* Disable both ports */
- gpio_set_level(GPIO_EN_USB_C0_CHARGE_L, 1);
- gpio_set_level(GPIO_EN_USB_C1_CHARGE_L, 1);
- } else {
- /* Make sure non-charging port is disabled */
- gpio_set_level(charge_port ? GPIO_EN_USB_C0_CHARGE_L :
- GPIO_EN_USB_C1_CHARGE_L, 1);
- /* Enable charging port */
- gpio_set_level(charge_port ? GPIO_EN_USB_C1_CHARGE_L :
- GPIO_EN_USB_C0_CHARGE_L, 0);
- }
-
- return EC_SUCCESS;
-}
-
-/*
- * Limit the input current to 95% negotiated limit,
- * to account for the charger chip margin.
- */
-
-static int charger_derate(int current)
-{
- return current * 95 / 100;
-}
-
-static void board_charger_init(void)
-{
- charger_set_input_current_limit(CHARGER_SOLO,
- charger_derate(PD_MAX_CURRENT_MA));
-}
-DECLARE_HOOK(HOOK_INIT, board_charger_init, HOOK_PRIO_DEFAULT);
-
-/**
- * Set the charge limit based upon desired maximum.
- *
- * @param port Port number.
- * @param supplier Charge supplier type.
- * @param charge_ma Desired charge limit (mA).
- * @param charge_mv Negotiated charge voltage (mV).
- */
-void board_set_charge_limit(int port, int supplier, int charge_ma,
- int max_ma, int charge_mv)
-{
- charge_ma = charger_derate(charge_ma);
- charge_set_input_current_limit(MAX(charge_ma,
- CONFIG_CHARGER_INPUT_CURRENT), charge_mv);
-}
-
-static void board_chipset_suspend(void)
-{
- gpio_set_level(GPIO_KBD_BL_EN, 0);
-}
-DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
-
-static void board_chipset_resume(void)
-{
- gpio_set_level(GPIO_KBD_BL_EN, 1);
-}
-DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
-
-static void board_chipset_reset(void)
-{
- board_report_pmic_fault("CHIPSET RESET");
-}
-DECLARE_HOOK(HOOK_CHIPSET_RESET, board_chipset_reset, HOOK_PRIO_DEFAULT);
-
-int board_get_version(void)
-{
- static int ver;
-
- if (!ver) {
- /*
- * Read the board EC ID on the tristate strappings
- * using ternary encoding: 0 = 0, 1 = 1, Hi-Z = 2
- */
- uint8_t id0, id1, id2;
-
- id0 = gpio_get_ternary(GPIO_BOARD_VERSION1);
- id1 = gpio_get_ternary(GPIO_BOARD_VERSION2);
- id2 = gpio_get_ternary(GPIO_BOARD_VERSION3);
-
- ver = (id2 * 9) + (id1 * 3) + id0;
- CPRINTS("Board ID = %d", ver);
- }
-
- return ver;
-}
-
-static struct opt3001_drv_data_t g_opt3001_data = {
- .scale = 1,
- .uscale = 0,
- .offset = 0,
-};
-
-struct motion_sensor_t motion_sensors[] = {
- [LID_ALS] = {
- .name = "Light",
- .active_mask = SENSOR_ACTIVE_S0,
- .chip = MOTIONSENSE_CHIP_OPT3001,
- .type = MOTIONSENSE_TYPE_LIGHT,
- .location = MOTIONSENSE_LOC_LID,
- .drv = &opt3001_drv,
- .drv_data = &g_opt3001_data,
- .port = I2C_PORT_SENSOR,
- .i2c_spi_addr_flags = OPT3001_I2C_ADDR_FLAGS,
- .rot_standard_ref = NULL,
- .default_range = 0x2b11a1, /* from nocturne */
- .min_frequency = OPT3001_LIGHT_MIN_FREQ,
- .max_frequency = OPT3001_LIGHT_MAX_FREQ,
- .config = {
- /* Sensor on in S0 */
- [SENSOR_CONFIG_EC_S0] = {
- .odr = 1000,
- },
- },
- },
-};
-const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
-
-/* ALS instances when LPC mapping is needed. Each entry directs to a sensor. */
-const struct motion_sensor_t *motion_als_sensors[] = {
- &motion_sensors[LID_ALS],
-};
-BUILD_ASSERT(ARRAY_SIZE(motion_als_sensors) == ALS_COUNT);
diff --git a/board/atlas/board.h b/board/atlas/board.h
deleted file mode 100644
index 56685f1856..0000000000
--- a/board/atlas/board.h
+++ /dev/null
@@ -1,269 +0,0 @@
-/* Copyright 2018 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.
- */
-
-/* Atlas board configuration */
-
-#ifndef __CROS_EC_BOARD_H
-#define __CROS_EC_BOARD_H
-
-/*
- * By default, enable all console messages excepted HC, ACPI and event:
- * The sensor stack is generating a lot of activity.
- */
-#define CC_DEFAULT (CC_ALL & ~(CC_MASK(CC_EVENTS) | CC_MASK(CC_LPC)))
-#undef CONFIG_HOSTCMD_DEBUG_MODE
-#define CONFIG_HOSTCMD_DEBUG_MODE HCDEBUG_OFF
-
-/* EC */
-#define CONFIG_ADC
-#define CONFIG_BOARD_FORCE_RESET_PIN
-#define CONFIG_DPTF
-#define CONFIG_FPU
-#define CONFIG_I2C
-#define CONFIG_I2C_CONTROLLER
-#define CONFIG_LID_SWITCH
-#define CONFIG_LOW_POWER_IDLE
-#define CONFIG_LTO
-#define CONFIG_CHIP_PANIC_BACKUP
-#define CONFIG_SOFTWARE_PANIC
-#define CONFIG_PWM
-#define CONFIG_PWM_KBLIGHT
-#define CONFIG_SHA256_UNROLLED
-
-/* Internal SPI flash on NPCX7 */
-#define CONFIG_FLASH_SIZE_BYTES (512 * 1024) /* It's really 1MB. */
-#define CONFIG_SPI_FLASH_REGS
-#define CONFIG_SPI_FLASH_W25Q80 /* Internal SPI flash type. */
-
-#define CONFIG_VBOOT_HASH
-#define CONFIG_VSTORE
-#define CONFIG_VSTORE_SLOT_COUNT 1
-#define CONFIG_WATCHDOG_HELP
-
-/* EC console commands */
-#define CONFIG_CMD_ACCELS
-#define CONFIG_CMD_ACCEL_INFO
-#define CONFIG_CMD_BATT_MFG_ACCESS
-#define CONFIG_CMD_CHARGER_ADC_AMON_BMON
-#define CONFIG_HOSTCMD_PD_CONTROL
-
-/* SOC */
-#define CONFIG_CHIPSET_SKYLAKE
-#define CONFIG_CHIPSET_HAS_PLATFORM_PMIC_RESET
-#define CONFIG_CHIPSET_RESET_HOOK
-#define CONFIG_CPU_PROCHOT_ACTIVE_LOW
-#define CONFIG_HOSTCMD_ESPI
-#define CONFIG_HOSTCMD_ESPI_VW_SLP_S3
-#define CONFIG_HOSTCMD_ESPI_VW_SLP_S4
-
-#define CONFIG_KEYBOARD_COL2_INVERTED
-#define CONFIG_KEYBOARD_PROTOCOL_8042
-#define CONFIG_KEYBOARD_REFRESH_ROW3
-
-/* Battery */
-#define CONFIG_BATTERY_CUT_OFF
-#define CONFIG_BATTERY_DEVICE_CHEMISTRY "LION"
-#define CONFIG_BATTERY_LEVEL_NEAR_FULL 95
-#define CONFIG_BATTERY_HW_PRESENT_CUSTOM
-#define CONFIG_BATTERY_PRESENT_CUSTOM
-#define CONFIG_BATTERY_SMART
-/* battery briefly requests V=0, A=0 when woken up */
-#define CONFIG_BATTERY_REQUESTS_NIL_WHEN_DEAD
-
-/* Charger */
-#define CONFIG_CHARGE_MANAGER
-#define CONFIG_CHARGE_MANAGER_EXTERNAL_POWER_LIMIT
-#define CONFIG_CHARGER
-#define CONFIG_CHARGER_ISL9238
-#define CONFIG_CHARGER_DISCHARGE_ON_AC
-#define CONFIG_CHARGER_INPUT_CURRENT 512
-#define CONFIG_CHARGER_PROFILE_OVERRIDE
-#define CONFIG_CHARGER_PSYS
-#define CONFIG_CHARGER_PSYS_READ
-#define CONFIG_CHARGER_SENSE_RESISTOR 10
-#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20
-#define CONFIG_EXTPOWER_GPIO
-#define CONFIG_POWER_BUTTON
-#define CONFIG_POWER_BUTTON_X86
-#define CONFIG_POWER_COMMON
-#define CONFIG_POWER_SIGNAL_INTERRUPT_STORM_DETECT_THRESHOLD 30
-#define CONFIG_POWER_S0IX
-#define CONFIG_POWER_TRACK_HOST_SLEEP_STATE
-#define CONFIG_PWR_STATE_DISCHARGE_FULL
-
-/* LEDs */
-#define CONFIG_LED_COMMON
-#define CONFIG_LED_PWM_ACTIVE_CHARGE_PORT_ONLY
-#define CONFIG_LED_PWM_COUNT 2
-#undef CONFIG_LED_PWM_NEAR_FULL_COLOR
-#define CONFIG_LED_PWM_NEAR_FULL_COLOR EC_LED_COLOR_WHITE
-
-/* Temperature Sensor */
-#define CONFIG_TEMP_SENSOR
-#define CONFIG_TEMP_SENSOR_BD99992GW
-#define CONFIG_THERMISTOR_NCP15WB
-
-/* Sensor */
-#define CONFIG_MKBP_EVENT
-#define CONFIG_MKBP_USE_HOST_EVENT
-#define CONFIG_ALS
-#define CONFIG_ALS_OPT3001
-#define ALS_COUNT 1
-#define OPT3001_I2C_ADDR_FLAGS OPT3001_I2C_ADDR1_FLAGS
-/* Enable sensor fifo, must also define the _SIZE and _THRES */
-#define CONFIG_ACCEL_FIFO
-/* FIFO size is a power of 2. */
-#define CONFIG_ACCEL_FIFO_SIZE 1024
-/* Depends on how fast the AP boots and typical ODRs. */
-#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3)
-#define CONFIG_ACCEL_INTERRUPTS
-
-/* USB */
-#define CONFIG_USB_PD_ALT_MODE
-#define CONFIG_USB_PD_ALT_MODE_DFP
-#define CONFIG_USB_PD_COMM_LOCKED
-#define CONFIG_USB_PD_DISCHARGE
-#define CONFIG_USB_PD_DISCHARGE_TCPC
-#define CONFIG_USB_PD_DUAL_ROLE
-#define CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE
-#define CONFIG_USB_PD_LOGGING
-#define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0
-#define CONFIG_USB_PD_PORT_MAX_COUNT 2
-#define CONFIG_USB_PD_VBUS_DETECT_TCPC
-#define CONFIG_USB_PD_TCPC_LOW_POWER
-#define CONFIG_USB_PD_TCPM_MUX
-#define CONFIG_USB_PD_TCPM_PS8751
-#define CONFIG_USB_PD_TCPM_TCPCI
-#define CONFIG_USB_PD_TRY_SRC
-#undef CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC
-#define CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC 2
-#define CONFIG_USB_PD_VBUS_MEASURE_NOT_PRESENT
-#define CONFIG_USB_POWER_DELIVERY
-#define CONFIG_USB_PD_TCPMV1
-#define CONFIG_USBC_SS_MUX
-#define CONFIG_USBC_SS_MUX_DFP_ONLY /* FIXME: b/77151299 */
-#define CONFIG_USBC_VCONN
-#define CONFIG_USBC_VCONN_SWAP
-
-/* Optional feature to configure npcx chip */
-#define NPCX_UART_MODULE2 1 /* 1:GPIO64/65 as UART */
-#define NPCX_JTAG_MODULE2 0 /* 0:GPIO21/17/16/20 as JTAG */
-#define NPCX_TACH_SEL2 0 /* 0:GPIO40/73 1:GPIO93/A6 as TACH */
-#define NPCX7_PWM1_SEL 1 /* GPIO C2 is used as PWM1. */
-#define CONFIG_HIBERNATE_PSL /* Enable PSL pins for wakeup */
-
-/* I2C ports */
-#define I2C_PORT_POWER NPCX_I2C_PORT0_0 /* pmic/charger */
-#define I2C_PORT_TCPC0 NPCX_I2C_PORT1_0
-#define I2C_PORT_TCPC1 NPCX_I2C_PORT2_0
-#define I2C_PORT_SENSOR NPCX_I2C_PORT3_0 /* als */
-#define I2C_PORT_BATTERY NPCX_I2C_PORT4_1
-#define I2C_PORT_GYRO NPCX_I2C_PORT5_0 /* accel/gyro */
-
-#define I2C_PORT_ACCEL I2C_PORT_GYRO
-#define I2C_PORT_CHARGER I2C_PORT_POWER
-#define I2C_PORT_PMIC I2C_PORT_POWER
-#define I2C_PORT_THERMAL I2C_PORT_POWER
-
-/* I2C addresses */
-#define I2C_ADDR_TCPC_FLAGS 0x0B
-#define I2C_ADDR_MP2949_FLAGS 0x20
-#define I2C_ADDR_BD99992_FLAGS 0x30
-
-#ifndef __ASSEMBLER__
-
-#include "gpio_signal.h"
-#include "registers.h"
-
-enum temp_sensor_id {
- TEMP_SENSOR_BATTERY, /* BD99956GW TSENSE */
- TEMP_SENSOR_SYSTHERM0, /* BD99992GW SYSTHERM0 */
- TEMP_SENSOR_SYSTHERM1, /* BD99992GW SYSTHERM1 */
- TEMP_SENSOR_SYSTHERM2, /* BD99992GW SYSTHERM2 */
- TEMP_SENSOR_SYSTHERM3, /* BD99992GW SYSTHERM3 */
- TEMP_SENSOR_COUNT
-};
-
-enum pwm_channel {
- PWM_CH_KBLIGHT,
- PWM_CH_DB0_LED_BLUE,
- PWM_CH_DB0_LED_RED,
- PWM_CH_DB0_LED_GREEN,
- PWM_CH_DB1_LED_BLUE,
- PWM_CH_DB1_LED_RED,
- PWM_CH_DB1_LED_GREEN,
- PWM_CH_COUNT
-};
-
-enum sensor_id {
- LID_ALS,
- SENSOR_COUNT,
-};
-
-/* LID_ALS needs to be polled */
-#define CONFIG_ACCEL_FORCE_MODE_MASK BIT(LID_ALS)
-
-enum adc_channel {
- ADC_AMON_BMON,
- ADC_PSYS,
- ADC_CH_COUNT
-};
-
-/*
- * delay to turn on the power supply max is ~16ms.
- * delay to turn off the power supply max is about ~180ms.
- */
-#define PD_POWER_SUPPLY_TURN_ON_DELAY 30000 /* us */
-#define PD_POWER_SUPPLY_TURN_OFF_DELAY 250000 /* us */
-
-/* delay to turn on/off vconn */
-
-/* Define typical operating power and max power */
-#define PD_OPERATING_POWER_MW 15000
-#define PD_MAX_POWER_MW 60000
-#define PD_MAX_CURRENT_MA 3000
-#define PD_MAX_VOLTAGE_MV 20000
-
-/* Board specific handlers */
-int board_get_version(void);
-void board_reset_pd_mcu(void);
-
-#endif /* !__ASSEMBLER__ */
-
-/*
- * these are mappings from signal names used in the atlas schematics
- * vs. names hard-coded in various parts of the EC codebase.
- */
-
-#define GPIO_AC_PRESENT GPIO_ROP_EC_ACOK
-#define GPIO_BATTERY_PRESENT_L GPIO_EC_BATT_PRES_L
-#define GPIO_BOARD_VERSION1 GPIO_EC_BRD_ID1
-#define GPIO_BOARD_VERSION2 GPIO_EC_BRD_ID2
-#define GPIO_BOARD_VERSION3 GPIO_EC_BRD_ID3
-#define GPIO_CPU_PROCHOT GPIO_EC_PROCHOT_ODL
-#define GPIO_ENTERING_RW GPIO_EC_ENTERING_RW
-#define GPIO_KBD_KSO2 GPIO_EC_KB_ROW02_INV
-#define GPIO_PCH_ACOK GPIO_EC_PCH_ACPRESENT
-#define GPIO_PCH_PWRBTN_L GPIO_EC_PCH_PWR_BTN_L
-#define GPIO_PCH_RSMRST_L GPIO_RSMRST_L
-#define GPIO_PCH_SLP_SUS_L GPIO_SLP_SUS_L_PCH
-#define GPIO_PCH_WAKE_L GPIO_EC_PCH_WAKE_L
-#define GPIO_PMIC_DPWROK GPIO_ROP_DSW_PWROK_EC
-#define GPIO_PMIC_SLP_SUS_L GPIO_SLP_SUS_L_PMIC
-#define GPIO_POWER_BUTTON_L GPIO_MECH_PWR_BTN_ODL
-#define GPIO_RSMRST_L_PGOOD GPIO_ROP_EC_RSMRST_L
-#define GPIO_PCH_SLP_S0_L GPIO_SLP_S0_L
-#define GPIO_USB_C0_5V_EN GPIO_EN_USB_C0_5V_OUT
-#define GPIO_USB_C0_PD_RST_L GPIO_USB_PD_RST_L
-#define GPIO_USB_C1_5V_EN GPIO_EN_USB_C1_5V_OUT
-#define GPIO_USB_C1_PD_RST_L GPIO_USB_PD_RST_L
-#define GPIO_WP_L GPIO_EC_WP_L
-
-/* ps8751 requires 1ms reset down assertion */
-#define PS8XXX_RST_L_RST_H_DELAY_MS 1
-
-#define ATLAS_REV_FIXED_EC_WP 4
-
-#endif /* __CROS_EC_BOARD_H */
diff --git a/board/atlas/build.mk b/board/atlas/build.mk
deleted file mode 100644
index f1619f73cd..0000000000
--- a/board/atlas/build.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- makefile -*-
-# Copyright 2018 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.
-#
-# Board specific files build
-#
-
-CHIP:=npcx
-CHIP_FAMILY:=npcx7
-CHIP_VARIANT:=npcx7m6fb
-
-board-y=board.o
-board-$(CONFIG_BATTERY_SMART)+=battery.o
-board-$(CONFIG_LED_COMMON)+=led.o
-board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o
diff --git a/board/atlas/ec.tasklist b/board/atlas/ec.tasklist
deleted file mode 100644
index 33e3cccb16..0000000000
--- a/board/atlas/ec.tasklist
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright 2018 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.
- */
-
-/*
- * See CONFIG_TASK_LIST in config.h for details.
- */
-
-#define CONFIG_TASK_LIST \
- TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_ALWAYS(CHARGER, charger_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_ALWAYS(MOTIONSENSE, motion_sense_task, NULL, VENTI_TASK_STACK_SIZE) \
- TASK_NOTEST(CHIPSET, chipset_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \
- TASK_ALWAYS(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_ALWAYS(POWERBTN, power_button_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) \
- TASK_ALWAYS(PD_C0, pd_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_ALWAYS(PD_C1, pd_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_ALWAYS(PD_INT_C0, pd_interrupt_handler_task, 0, TASK_STACK_SIZE) \
- TASK_ALWAYS(PD_INT_C1, pd_interrupt_handler_task, 1, TASK_STACK_SIZE)
diff --git a/board/atlas/gpio.inc b/board/atlas/gpio.inc
deleted file mode 100644
index 4ce44cc130..0000000000
--- a/board/atlas/gpio.inc
+++ /dev/null
@@ -1,157 +0,0 @@
-/* -*- mode:c -*-
- *
- * Copyright 2018 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.
- */
-
-/* Declare symbolic names for all the GPIOs that we care about.
- * Note: Those with interrupt handlers must be declared first. */
-
-/* USB PD interrupt handler section */
-GPIO_INT(USB_C0_PD_INT_ODL, PIN(6, 1), GPIO_INT_FALLING | GPIO_PULL_UP, tcpc_alert_event)
-GPIO_INT(USB_C1_PD_INT_ODL, PIN(F, 5), GPIO_INT_FALLING | GPIO_PULL_UP, tcpc_alert_event)
-
-/* power seq interrupt handler section */
-GPIO_INT(ROP_DSW_PWROK_EC, PIN(F, 4), GPIO_INT_BOTH, power_signal_interrupt)
-GPIO_INT(ROP_EC_RSMRST_L, PIN(E, 2), GPIO_INT_BOTH, power_signal_interrupt)
-GPIO_INT(MECH_PWR_BTN_ODL, PIN(0, 1), GPIO_INT_BOTH | GPIO_PULL_UP, power_button_interrupt)
-GPIO_INT(SLP_S0_L, PIN(A, 4), GPIO_INT_BOTH, power_signal_interrupt)
-GPIO_INT(SLP_SUS_L_PCH, PIN(D, 4), GPIO_INT_BOTH, power_signal_interrupt)
-GPIO_INT(ROP_EC_ACOK, PIN(0, 0), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, extpower_interrupt)
-
-/* misc interrupt handler section */
-GPIO_INT(EC_WP_L, PIN(A, 1), GPIO_INT_BOTH, switch_interrupt)
-GPIO_INT(LID_OPEN, PIN(D, 2), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, lid_interrupt)
-
-/* SoC section */
-GPIO(RSMRST_L, PIN(3, 7), GPIO_OUT_LOW) /* SOC Resume Reset */
-GPIO(EC_PCH_PWR_BTN_L, PIN(C, 1), GPIO_OUT_HIGH) /* Power button to SOC */
-GPIO(EC_PCH_RTCRST, PIN(7, 6), GPIO_OUT_LOW) /* RTC Reset (broken) */
-GPIO(EC_PCH_WAKE_L, PIN(7, 4), GPIO_ODR_HIGH) /* PCH wake */
-GPIO(EC_PROCHOT_ODL, PIN(3, 4), GPIO_ODR_HIGH | GPIO_SEL_1P8V) /* SOC PROCHOT# */
-GPIO(SYS_RESET_L, PIN(0, 2), GPIO_ODR_HIGH) /* SOC reset */
-GPIO(USB_C0_DP_HPD, PIN(C, 5), GPIO_INPUT) /* C0 Hotplug Detect */
-GPIO(USB_C1_DP_HPD, PIN(C, 6), GPIO_INPUT) /* C1 Hotplug Detect */
-
-/* power seq section */
-GPIO(EC_PCH_ACPRESENT, PIN(7, 3), GPIO_ODR_LOW) /* ACOK to SOC */
-/* note: SLP_SUS_L_PMIC is an input in the schematics */
-GPIO(SLP_SUS_L_PMIC, PIN(E, 4), GPIO_OUT_LOW) /* SOC SLP_SUS# */
-GPIO(SLP_S4_L, PIN(A, 3), GPIO_INPUT) /* SOC SLP_S4# */
-GPIO(SLP_S3_L, PIN(A, 6), GPIO_INPUT) /* SOC SLP_S3# */
-GPIO(ROP_INT_L, PIN(D, 5), GPIO_INPUT | GPIO_PULL_UP) /* PMIC IRQ (Unused) */
-
-/* USB PD section */
-GPIO(EN_USB_C0_5V_OUT, PIN(6, 7), GPIO_OUT_LOW) /* C0 5V Enable */
-GPIO(EN_USB_C0_CHARGE_L, PIN(0, 3), GPIO_OUT_LOW) /* alt fn */
-GPIO(EN_USB_C0_3A, PIN(6, 2), GPIO_OUT_LOW) /* 1.5/3.0 C0 current limit selection */
-GPIO(EN_USB_C1_5V_OUT, PIN(7, 0), GPIO_OUT_LOW) /* C1 5V Enable */
-GPIO(EN_USB_C1_CHARGE_L, PIN(0, 4), GPIO_OUT_LOW) /* alt fn */
-GPIO(EN_USB_C1_3A, PIN(8, 3), GPIO_OUT_LOW) /* alt fn 1.5/3.0 C1 current limit selection */
-
-GPIO(USB2_VBUSSENSE, PIN(A, 2), GPIO_OUT_LOW) /* USB OTG ID */
-GPIO(USB2_ID, PIN(A, 0), GPIO_OUT_LOW) /* USB OTG VBUS Sense */
-
-GPIO(USB_PD_RST_L, PIN(F, 1), GPIO_OUT_LOW) /* C0,C1 PD Reset */
-
-/* misc section */
-GPIO(CCD_MODE_ODL, PIN(E, 3), GPIO_INPUT) /* Case Closed Debug Mode */
-GPIO(EC_BATT_PRES_L, PIN(E, 5), GPIO_INPUT) /* Battery Present */
-GPIO(EC_ENTERING_RW, PIN(E, 1), GPIO_OUTPUT) /* EC Entering RW */
-GPIO(EC_BL_DISABLE_L, PIN(D, 3), GPIO_INPUT) /* Enable Backlight */
-GPIO(EC_BRD_ID1, PIN(9, 6), GPIO_INPUT) /* Board ID bit0 */
-GPIO(EC_BRD_ID2, PIN(9, 3), GPIO_INPUT) /* Board ID bit1 */
-GPIO(EC_BRD_ID3, PIN(F, 0), GPIO_INPUT) /* Board ID bit2 */
-GPIO(KBD_BL_EN, PIN(7, 5), GPIO_OUT_LOW) /* KB backlight enable */
-GPIO(EC_PLATFORM_RST, PIN(8, 6), GPIO_OUT_LOW) /* EC Reset to LDO_EN */
-
-/* I2C pins - these will be reconfigured for alternate function below */
-
-GPIO(EC_I2C1_USB_C0_SCL, PIN(9, 0), GPIO_INPUT) /* alt fn I2C1_SCL */
-GPIO(EC_I2C1_USB_C0_SDA, PIN(8, 7), GPIO_INPUT) /* alt fn I2C1_SDA */
-GPIO(EC_I2C2_USB_C1_SCL, PIN(9, 2), GPIO_INPUT) /* alt fn I2C2_SCL */
-GPIO(EC_I2C2_USB_C1_SDA, PIN(9, 1), GPIO_INPUT) /* alt fn I2C2_SDA */
-GPIO(EC_I2C5_GYRO_SCL, PIN(3, 3), GPIO_INPUT) /* alt fn I2C5_SCL */
-GPIO(EC_I2C5_GYRO_SDA, PIN(3, 6), GPIO_INPUT) /* alt fn I2C5_SDA */
-GPIO(EC_I2C3_SENSOR_3V3_SCL, PIN(D, 1), GPIO_INPUT) /* alt fn I2C3_SCL */
-GPIO(EC_I2C3_SENSOR_3V3_SDA, PIN(D, 0), GPIO_INPUT) /* alt fn I2C3_SDA */
-GPIO(EC_I2C0_POWER_SCL, PIN(B, 5), GPIO_INPUT) /* alt fn I2C0_SCL */
-GPIO(EC_I2C0_POWER_SDA, PIN(B, 4), GPIO_INPUT) /* alt fn I2C0_SDA */
-GPIO(EC_I2C4_BATTERY_SCL, PIN(F, 3), GPIO_INPUT) /* alt fn I2C4_SCL */
-GPIO(EC_I2C4_BATTERY_SDA, PIN(F, 2), GPIO_INPUT) /* alt fn I2C4_SDA */
-
-/* Not connected */
-GPIO(NC_GPIO32, PIN(3, 2), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIO35, PIN(3, 5), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIO40, PIN(4, 0), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIO44, PIN(4, 4), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIO45, PIN(4, 5), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIO50, PIN(5, 0), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIO56, PIN(5, 6), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIO57, PIN(5, 7), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIO63, PIN(6, 3), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIO66, PIN(6, 6), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIO82, PIN(8, 2), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIO95, PIN(9, 5), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIOB1, PIN(B, 1), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIOB2, PIN(B, 2), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIOB3, PIN(B, 3), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIOB6, PIN(B, 6), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIOC7, PIN(C, 7), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIOD6, PIN(D, 6), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIOD7, PIN(D, 7), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIOE0, PIN(E, 0), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(ACCELGYRO3_INT_L, PIN(4, 1), GPIO_INPUT | GPIO_PULL_UP)
-
-/* WoV is unused */
-GPIO(NC_GPIO94, PIN(9, 4), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIO97, PIN(9, 7), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIOA5, PIN(A, 5), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIOA7, PIN(A, 7), GPIO_INPUT | GPIO_PULL_UP)
-GPIO(NC_GPIOB0, PIN(B, 0), GPIO_INPUT | GPIO_PULL_UP)
-
-/* Power Switch Logic (PSL) inputs */
-ALTERNATE(PIN_MASK(0, 0x03), 0, MODULE_PMU, 0) /* PSL3&GPI01, PSL2&GPI00 */
-ALTERNATE(PIN_MASK(D, 0x04), 0, MODULE_PMU, 0) /* GPIOD2 */
-
-/* gpio alternate functions */
-ALTERNATE(PIN_MASK(0, 0x18), 0, MODULE_GPIO, 0) /* GPIO03,4 */
-
-ALTERNATE(PIN_MASK(8, 0x08), 0, MODULE_GPIO, 0) /* GPIO83 */
-
-/* GPIOA3,1 are enabled by default even though they are ALT functions */
-
-/* PWM channels */
-ALTERNATE(PIN_MASK(6, 0x01), 0, MODULE_PWM, 0) /* GPIO60 PWM7 CHARGE_LED5 */
-ALTERNATE(PIN_MASK(8, 0x01), 0, MODULE_PWM, 0) /* GPIO80 PWM3 KBD_BL_PWM */
-ALTERNATE(PIN_MASK(B, 0x80), 0, MODULE_PWM, 0) /* GPIOB7 PWM5 CHARGE_LED6 */
-ALTERNATE(PIN_MASK(C, 0x1d), 0, MODULE_PWM, 0) /* GPIOC4,3,2,0 PWM2,0,1,6 CHARGE_LED2,1,4,3 */
-
-/* I2C alternate functions */
-ALTERNATE(PIN_MASK(B, 0x30), 0, MODULE_I2C, 0) /* I2C0_SCL0|I2C0_SDA0 */
-ALTERNATE(PIN_MASK(9, 0x01), 0, MODULE_I2C, 0) /* I2C1_SCL0 */
-ALTERNATE(PIN_MASK(8, 0x80), 0, MODULE_I2C, 0) /* I2C1_SDA0 */
-ALTERNATE(PIN_MASK(9, 0x06), 0, MODULE_I2C, 0) /* I2C2_SCL0|I2C2_SDA0 */
-ALTERNATE(PIN_MASK(D, 0x03), 0, MODULE_I2C, 0) /* I2C3_SCL0|I2C3_SDA0 */
-ALTERNATE(PIN_MASK(F, 0x0c), 0, MODULE_I2C, 0) /* I2C4_SCL1|I2C4_SDA1 */
-ALTERNATE(PIN_MASK(3, 0x48), 0, MODULE_I2C, 0) /* I2C5_SDA0|I2C5_SCL0 */
-
-/* ADC alternate functions */
-ALTERNATE(PIN_MASK(4, 0x0c), 0, MODULE_ADC, 0) /* ADC2-3 */
-
-/* UART alternate functions */
-ALTERNATE(PIN_MASK(6, 0x30), 0, MODULE_UART, 0) /* UART from EC to Servo */
-
-/* keyboard */
-#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP)
-#define GPIO_KB_OUTPUT (GPIO_ODR_HIGH)
-#define GPIO_KB_OUTPUT_COL2 (GPIO_OUT_LOW)
-
-/* keyboard alternate functions */
-ALTERNATE(PIN_MASK(0, 0xe0), 0, MODULE_KEYBOARD_SCAN, GPIO_KB_OUTPUT)
-ALTERNATE(PIN_MASK(1, 0x7f), 0, MODULE_KEYBOARD_SCAN, GPIO_KB_OUTPUT)
-ALTERNATE(PIN_MASK(2, 0x03), 0, MODULE_KEYBOARD_SCAN, GPIO_KB_OUTPUT)
-ALTERNATE(PIN_MASK(2, 0xfc), 0, MODULE_KEYBOARD_SCAN, GPIO_KB_INPUT)
-ALTERNATE(PIN_MASK(3, 0x03), 0, MODULE_KEYBOARD_SCAN, GPIO_KB_INPUT)
-GPIO(EC_KB_ROW02_INV, PIN(1, 7), GPIO_KB_OUTPUT_COL2)
diff --git a/board/atlas/led.c b/board/atlas/led.c
deleted file mode 100644
index 9cb4dabfd3..0000000000
--- a/board/atlas/led.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Copyright 2018 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.
- */
-
-/* Atlas specific PWM LED settings. */
-
-#include "common.h"
-#include "ec_commands.h"
-#include "led_pwm.h"
-#include "pwm.h"
-#include "util.h"
-
-const enum ec_led_id supported_led_ids[] = {
- EC_LED_ID_LEFT_LED,
- EC_LED_ID_RIGHT_LED,
-};
-const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
-
-struct pwm_led_color_map led_color_map[EC_LED_COLOR_COUNT] = {
- /* Red, Green, Blue */
- [EC_LED_COLOR_RED] = { 70, 0, 0 },
- [EC_LED_COLOR_GREEN] = { 0, 35, 0 },
- [EC_LED_COLOR_BLUE] = { 0, 0, 100 },
- [EC_LED_COLOR_YELLOW] = { 55, 15, 0 },
- [EC_LED_COLOR_WHITE] = { 62, 100, 31 },
- [EC_LED_COLOR_AMBER] = { 100, 31, 0 },
-};
-
-/*
- * Two tri-color LEDs with red, green, and blue channels.
- *
- * Note: This order must match tcpc_config[]
- */
-struct pwm_led pwm_leds[CONFIG_LED_PWM_COUNT] = {
- [PWM_LED0] = {
- /* left port LEDs */
- .ch0 = PWM_CH_DB1_LED_RED,
- .ch1 = PWM_CH_DB1_LED_GREEN,
- .ch2 = PWM_CH_DB1_LED_BLUE,
- .enable = &pwm_enable,
- .set_duty = &pwm_set_duty,
- },
- [PWM_LED1] = {
- /* right port LEDs */
- .ch0 = PWM_CH_DB0_LED_RED,
- .ch1 = PWM_CH_DB0_LED_GREEN,
- .ch2 = PWM_CH_DB0_LED_BLUE,
- .enable = &pwm_enable,
- .set_duty = &pwm_set_duty,
- },
-};
-
-void led_get_brightness_range(enum ec_led_id led_id, uint8_t *brightness_range)
-{
- brightness_range[EC_LED_COLOR_RED] = 100;
- brightness_range[EC_LED_COLOR_GREEN] = 100;
- brightness_range[EC_LED_COLOR_YELLOW] = 100;
- brightness_range[EC_LED_COLOR_AMBER] = 100;
- brightness_range[EC_LED_COLOR_BLUE] = 100;
- brightness_range[EC_LED_COLOR_WHITE] = 100;
-}
-
-int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness)
-{
- enum pwm_led_id pwm_id;
-
- /* Convert ec_led_id to pwm_led_id. */
- if (led_id == EC_LED_ID_LEFT_LED)
- pwm_id = PWM_LED0;
- else if (led_id == EC_LED_ID_RIGHT_LED)
- pwm_id = PWM_LED1;
- else
- return EC_ERROR_UNKNOWN;
-
- if (brightness[EC_LED_COLOR_RED])
- set_pwm_led_color(pwm_id, EC_LED_COLOR_RED);
- else if (brightness[EC_LED_COLOR_GREEN])
- set_pwm_led_color(pwm_id, EC_LED_COLOR_GREEN);
- else if (brightness[EC_LED_COLOR_BLUE])
- set_pwm_led_color(pwm_id, EC_LED_COLOR_BLUE);
- else if (brightness[EC_LED_COLOR_YELLOW])
- set_pwm_led_color(pwm_id, EC_LED_COLOR_YELLOW);
- else if (brightness[EC_LED_COLOR_WHITE])
- set_pwm_led_color(pwm_id, EC_LED_COLOR_WHITE);
- else if (brightness[EC_LED_COLOR_AMBER])
- set_pwm_led_color(pwm_id, EC_LED_COLOR_AMBER);
- else
- /* Otherwise, the "color" is "off". */
- set_pwm_led_color(pwm_id, -1);
-
- return EC_SUCCESS;
-}
diff --git a/board/atlas/usb_pd_policy.c b/board/atlas/usb_pd_policy.c
deleted file mode 100644
index 77a4941a9a..0000000000
--- a/board/atlas/usb_pd_policy.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/* Copyright 2018 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.
- */
-
-#include "atomic.h"
-#include "extpower.h"
-#include "charge_manager.h"
-#include "chipset.h"
-#include "common.h"
-#include "console.h"
-#include "driver/tcpm/ps8xxx.h"
-#include "gpio.h"
-#include "hooks.h"
-#include "host_command.h"
-#include "registers.h"
-#include "system.h"
-#include "task.h"
-#include "tcpm/tcpci.h"
-#include "timer.h"
-#include "util.h"
-#include "usb_mux.h"
-#include "usb_pd.h"
-#include "usb_pd_tcpm.h"
-
-#define CPRINTF(format, args...) cprintf(CC_USBPD, format, ## args)
-#define CPRINTS(format, args...) cprints(CC_USBPD, format, ## args)
-
-static uint8_t vbus_en[CONFIG_USB_PD_PORT_MAX_COUNT];
-static uint8_t vbus_rp[CONFIG_USB_PD_PORT_MAX_COUNT] = {TYPEC_RP_1A5,
- TYPEC_RP_1A5};
-
-int board_vbus_source_enabled(int port)
-{
- return vbus_en[port];
-}
-
-static void board_vbus_update_source_current(int port)
-{
- enum gpio_signal gpio_5v_en = port ? GPIO_USB_C1_5V_EN :
- GPIO_USB_C0_5V_EN;
- enum gpio_signal gpio_3a_en = port ? GPIO_EN_USB_C1_3A :
- GPIO_EN_USB_C0_3A;
-
- /*
- * 1.5 vs 3.0 A limit is controlled by a dedicated gpio where
- * high = 3.0A and low = 1.5A. VBUS on/off is controlled by
- * GPIO_USB_C0/1_5V_EN.
- */
- gpio_set_level(gpio_3a_en, vbus_rp[port] == TYPEC_RP_3A0 ? 1 : 0);
- gpio_set_level(gpio_5v_en, vbus_en[port]);
-}
-
-void typec_set_source_current_limit(int port, enum tcpc_rp_value rp)
-{
- vbus_rp[port] = rp;
-
- /* change the GPIO driving the load switch if needed */
- board_vbus_update_source_current(port);
-}
-
-int pd_snk_is_vbus_provided(int port)
-{
- return tcpci_tcpm_check_vbus_level(port, VBUS_PRESENT);
-}
-
-int pd_set_power_supply_ready(int port)
-{
- /* Disable charging */
- gpio_set_level(port ? GPIO_EN_USB_C1_CHARGE_L :
- GPIO_EN_USB_C0_CHARGE_L, 1);
-
- /* Ensure we advertise the proper available current quota */
- charge_manager_source_port(port, 1);
-
- pd_set_vbus_discharge(port, 0);
- /* Provide VBUS */
- vbus_en[port] = 1;
- board_vbus_update_source_current(port);
-
- /* notify host of power info change */
- pd_send_host_event(PD_EVENT_POWER_CHANGE);
-
- return EC_SUCCESS; /* we are ready */
-}
-
-void pd_power_supply_reset(int port)
-{
- int prev_en;
-
- prev_en = vbus_en[port];
-
- /* Disable VBUS */
- vbus_en[port] = 0;
- board_vbus_update_source_current(port);
-
- /* Enable discharge if we were previously sourcing 5V */
- if (prev_en)
- pd_set_vbus_discharge(port, 1);
-
- /* Give back the current quota we are no longer using */
- charge_manager_source_port(port, 0);
-
- /* notify host of power info change */
- pd_send_host_event(PD_EVENT_POWER_CHANGE);
-}
-
-int pd_check_vconn_swap(int port)
-{
- /* in G3, do not allow vconn swap since pp5000_A rail is off */
- return gpio_get_level(GPIO_PMIC_SLP_SUS_L);
-}
-
-__override void pd_execute_data_swap(int port,
- enum pd_data_role data_role)
-{
- /* Only port 0 supports device mode. */
- if (port != 0)
- return;
-
- gpio_set_level(GPIO_USB2_ID,
- (data_role == PD_ROLE_UFP) ? 1 : 0);
- gpio_set_level(GPIO_USB2_VBUSSENSE,
- (data_role == PD_ROLE_UFP) ? 1 : 0);
-}
diff --git a/board/atlas/vif_override.xml b/board/atlas/vif_override.xml
deleted file mode 100644
index 32736caf64..0000000000
--- a/board/atlas/vif_override.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<!-- Add VIF field overrides here. See genvif.c and the Vendor Info File
- Definition from the USB-IF.
--->