summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorZhuohao Lee <zhuohao@chromium.org>2021-08-24 17:24:25 +0800
committerCommit Bot <commit-bot@chromium.org>2021-08-25 06:11:06 +0000
commit418cc5cbb9bede43fbe8213a518b9faf3c2b9dc0 (patch)
tree785231d7f894504530fa09317608e72dab5d51cc /baseboard
parentdbcffbcfac595c694744bd888c4d5e5d9f269a68 (diff)
downloadchrome-ec-418cc5cbb9bede43fbe8213a518b9faf3c2b9dc0.tar.gz
brask: remove unnecessary configuration
This patch removes the configuration for the battery, charger, fan control, board id, keyboard, keyboard backlight, sensor, hibernate and led. In order to make the build pass, the CONFIG_ADC, CONFIG_POWER_BUTTON_IGNORE_LID and CONFIG_POWER_BUTTON_INIT_IDLE are added to the board.h/baseboard.h. In additional, the function board_set_active_charge_port() and board_set_charge_limit() are added to the board.c to avoid build error. BUG=b:191637086 BRANCH=None TEST=make BOARD=brask Change-Id: I15c01820dbd2f58f5722c87de51ebf425ffca13a Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3114497 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: caveh jalali <caveh@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r--baseboard/brask/baseboard.c3
-rw-r--r--baseboard/brask/baseboard.h102
-rw-r--r--baseboard/brask/baseboard_usbc_config.h2
-rw-r--r--baseboard/brask/battery_presence.c69
-rw-r--r--baseboard/brask/build.mk7
-rw-r--r--baseboard/brask/cbi.c52
-rw-r--r--baseboard/brask/charger.c90
-rw-r--r--baseboard/brask/usb_pd_policy.c2
8 files changed, 35 insertions, 292 deletions
diff --git a/baseboard/brask/baseboard.c b/baseboard/brask/baseboard.c
index 976831812f..2e60b565f8 100644
--- a/baseboard/brask/baseboard.c
+++ b/baseboard/brask/baseboard.c
@@ -10,8 +10,5 @@
/* Wake up pins */
const enum gpio_signal hibernate_wake_pins[] = {
- GPIO_ACOK_OD,
- GPIO_GSC_EC_PWR_BTN_ODL,
- GPIO_LID_OPEN,
};
const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins);
diff --git a/baseboard/brask/baseboard.h b/baseboard/brask/baseboard.h
index 6a4efe942e..7e3eae3a00 100644
--- a/baseboard/brask/baseboard.h
+++ b/baseboard/brask/baseboard.h
@@ -1,9 +1,9 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+/* Copyright 2021 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.
*/
-/* Brya baseboard configuration */
+/* Brask baseboard configuration */
#ifndef __CROS_EC_BASEBOARD_H
#define __CROS_EC_BASEBOARD_H
@@ -22,12 +22,13 @@
*/
#define NPCX_UART_MODULE2 1 /* 1:GPIO64/65 for UART1 */
-/* EC Defines */
-#define CONFIG_LTO
+/* CrOS Board Info */
#define CONFIG_CBI_EEPROM
#define CONFIG_BOARD_VERSION_CBI
#define CONFIG_CRC8
-#define CONFIG_DPTF
+
+/* EC Defines */
+#define CONFIG_LTO
#define CONFIG_FPU
/* Verified boot configs */
@@ -36,36 +37,28 @@
#define CONFIG_VSTORE
#define CONFIG_VSTORE_SLOT_COUNT 1
-#define CONFIG_HIBERNATE_PSL
-
/* Work around double CR50 reset by waiting in initial power on. */
#define CONFIG_BOARD_RESET_AFTER_POWER_ON
/* Host communication */
#define CONFIG_HOSTCMD_ESPI
#define CONFIG_HOSTCMD_ESPI_VW_SLP_S4
+#define CONFIG_HOSTCMD_ESPI_RESET_SLP_SX_VW_ON_ESPI_RST
-/*
- * TODO(b/179648721): implement sensors
- */
-#define CONFIG_TABLET_MODE
-#define CONFIG_TABLET_MODE_SWITCH
-#define CONFIG_GMR_TABLET_MODE
-
+/* Matrix Keyboard Protocol */
#define CONFIG_MKBP_EVENT
#define CONFIG_MKBP_USE_HOST_EVENT
/* LED */
-#define CONFIG_LED_COMMON
+/*
+ * TODO(b/197471359): Implement the LED behavior
+ */
+/* #define CONFIG_LED_COMMON */
/* Common charger defines */
#define CONFIG_CHARGE_MANAGER
-#define CONFIG_CHARGER
-#define CONFIG_CHARGER_DISCHARGE_ON_AC
-#define CONFIG_CHARGER_INPUT_CURRENT 512
-
-#define CONFIG_CMD_CHARGER_DUMP
+/* USBC BC1.2 */
#define CONFIG_USB_CHARGER
#define CONFIG_BC12_DETECT_PI3USB9201
@@ -73,32 +66,17 @@
* Don't allow the system to boot to S0 when the battery is low and unable to
* communicate on locked systems (which haven't PD negotiated)
*/
-#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT 15000
#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON 15001
-/* Common battery defines */
-#define CONFIG_BATTERY_SMART
-#define CONFIG_BATTERY_FUEL_GAUGE
-#define CONFIG_BATTERY_CUT_OFF
-#define CONFIG_BATTERY_PRESENT_CUSTOM
-#define CONFIG_BATTERY_HW_PRESENT_CUSTOM
-#define CONFIG_BATTERY_REVIVE_DISCONNECT
-#define CONFIG_CMD_BATT_MFG_ACCESS
-
/* Chipset config */
#define CONFIG_CHIPSET_ALDERLAKE_SLG4BD44540
-
#define CONFIG_CHIPSET_RESET_HOOK
+#define CONFIG_CHIPSET_CAN_THROTTLE
#define CONFIG_CPU_PROCHOT_ACTIVE_LOW
#define CONFIG_EXTPOWER_GPIO
-#define CONFIG_POWER_BUTTON
-#define CONFIG_POWER_BUTTON_X86
#define CONFIG_POWER_S0IX
#define CONFIG_POWER_SLEEP_FAILURE_DETECTION
#define CONFIG_POWER_TRACK_HOST_SLEEP_STATE
-#define CONFIG_LOW_POWER_IDLE
-
-#define CONFIG_HOSTCMD_ESPI_RESET_SLP_SX_VW_ON_ESPI_RST
/*
* TODO(b/191742284): When DAM enabled coreboot image is flashed on top of DAM
@@ -111,25 +89,15 @@
#define CONFIG_CMD_AP_RESET_LOG
#define CONFIG_HOSTCMD_AP_RESET
-/* Buttons / Switches */
-#define CONFIG_VOLUME_BUTTONS
-#define CONFIG_SWITCH
-
-/* Common Keyboard Defines */
-#define CONFIG_CMD_KEYBOARD
-
-#define CONFIG_KEYBOARD_COL2_INVERTED
-#define CONFIG_KEYBOARD_KEYPAD
-#define CONFIG_KEYBOARD_PROTOCOL_8042
-#ifdef CONFIG_KEYBOARD_VIVALDI
-#define CONFIG_KEYBOARD_PWRBTN_ASSERTS_KSI2
-#else
-#define CONFIG_KEYBOARD_PWRBTN_ASSERTS_KSI3
-#endif
+/* Buttons */
+#define CONFIG_POWER_BUTTON
+#define CONFIG_POWER_BUTTON_IGNORE_LID
+#define CONFIG_POWER_BUTTON_INIT_IDLE
+#define CONFIG_POWER_BUTTON_X86
/* Thermal features */
+#define CONFIG_DPTF
#define CONFIG_THROTTLE_AP
-#define CONFIG_CHIPSET_CAN_THROTTLE
#define CONFIG_PWM
@@ -137,9 +105,6 @@
#define CONFIG_I2C
#define CONFIG_I2C_CONTROLLER
-/* EDP back-light control defines */
-#define CONFIG_BACKLIGHT_LID
-
/* UART COMMAND */
#define CONFIG_CMD_CHARGEN
@@ -201,13 +166,20 @@
/*
* USB ID
- * This is allocated specifically for Brya
+ * This is allocated specifically for Brask
* http://google3/hardware/standards/usb/
*/
-#define CONFIG_USB_PID 0x504F
+#define CONFIG_USB_PID 0x5058
/* Device version of product. */
#define CONFIG_USB_BCD_DEV 0x0000
+/* Remove predefined features */
+#undef CONFIG_HIBERNATE
+#undef CONFIG_KEYBOARD_BOOT_KEYS
+#undef CONFIG_KEYBOARD_RUNTIME_KEYS
+#undef CONFIG_LID_SWITCH
+#undef CONFIG_KEYBOARD_VIVALDI
+
#ifndef __ASSEMBLER__
#include <stdbool.h>
@@ -217,7 +189,7 @@
#include "baseboard_usbc_config.h"
#include "extpower.h"
-/**
+/*
* Configure run-time data structures and operation based on CBI data. This
* typically includes customization for changes in the BOARD_VERSION and
* FW_CONFIG fields in CBI. This routine is called from the baseboard after
@@ -225,24 +197,12 @@
*/
__override_proto void board_cbi_init(void);
-/**
+/*
* Initialize the FW_CONFIG from CBI data. If the CBI data is not valid, set the
* FW_CONFIG to the board specific defaults.
*/
__override_proto void board_init_fw_config(void);
-/*
- * Check battery disconnect state.
- * This function will return if battery is initialized or not.
- * @return true - initialized. false - not.
- */
-__override_proto bool board_battery_is_initialized(void);
-
-/*
- * Return the board revision number.
- */
-uint8_t get_board_id(void);
-
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BASEBOARD_H */
diff --git a/baseboard/brask/baseboard_usbc_config.h b/baseboard/brask/baseboard_usbc_config.h
index f8b9fab35c..1b3d9e5d3f 100644
--- a/baseboard/brask/baseboard_usbc_config.h
+++ b/baseboard/brask/baseboard_usbc_config.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* brya family-specific USB-C configuration */
+/* brask family-specific USB-C configuration */
#ifndef __CROS_EC_BASEBOARD_USBC_CONFIG_H
#define __CROS_EC_BASEBOARD_USBC_CONFIG_H
diff --git a/baseboard/brask/battery_presence.c b/baseboard/brask/battery_presence.c
deleted file mode 100644
index 94c9926820..0000000000
--- a/baseboard/brask/battery_presence.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Copyright 2021 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.
- *
- * Common battery presence checking for Brya family.
- * Each board should implement board_battery_info[] to define the specific
- * battery packs supported.
- */
-#include <stdbool.h>
-
-#include "battery.h"
-#include "battery_smart.h"
-#include "common.h"
-
-static enum battery_present batt_pres_prev = BP_NOT_SURE;
-
-__overridable bool board_battery_is_initialized(void)
-{
- int batt_status;
-
- return battery_status(&batt_status) != EC_SUCCESS ? false :
- !!(batt_status & STATUS_INITIALIZED);
-}
-
-/*
- * Physical detection of battery.
- */
-static enum battery_present battery_check_present_status(void)
-{
- enum battery_present batt_pres;
-
- if (battery_is_cut_off())
- return BP_NO;
-
- /* Get the physical hardware status */
- batt_pres = battery_hw_present();
-
- /*
- * If the battery is not physically connected, then no need to perform
- * any more checks.
- */
- if (batt_pres == BP_NO)
- return BP_NO;
-
- /*
- * If the battery is present now and was present last time we checked,
- * return early.
- */
- if ((batt_pres == BP_YES) && (batt_pres == batt_pres_prev))
- return BP_YES;
-
- /*
- * Check battery initialization. If the battery is not initialized,
- * then return BP_NOT_SURE. Battery could be in ship
- * mode and might require pre-charge current to wake it up. BP_NO is not
- * returned here because charger state machine will not provide
- * pre-charge current assuming that battery is not present.
- */
- if (!board_battery_is_initialized())
- return BP_NOT_SURE;
-
- return BP_YES;
-}
-
-enum battery_present battery_is_present(void)
-{
- batt_pres_prev = battery_check_present_status();
- return batt_pres_prev;
-}
diff --git a/baseboard/brask/build.mk b/baseboard/brask/build.mk
index e03e0a919c..5ba6b135f9 100644
--- a/baseboard/brask/build.mk
+++ b/baseboard/brask/build.mk
@@ -1,14 +1,11 @@
# -*- makefile -*-
-# Copyright 2020 The Chromium OS Authors. All rights reserved.
+# Copyright 2021 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.
#
-# Brya baseboard specific files build
+# Brask baseboard specific files build
#
baseboard-y=
baseboard-y+=baseboard.o
-baseboard-y+=battery_presence.o
-baseboard-y+=cbi.o
-baseboard-y+=charger.o
baseboard-y+=usb_pd_policy.o
diff --git a/baseboard/brask/cbi.c b/baseboard/brask/cbi.c
deleted file mode 100644
index 6d9e2b93fa..0000000000
--- a/baseboard/brask/cbi.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright 2021 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 <stdint.h>
-
-#include "console.h"
-#include "common.h"
-#include "cros_board_info.h"
-#include "hooks.h"
-
-#define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args)
-#define CPRINTF(format, args...) cprintf(CC_CHIPSET, format, ## args)
-
-static uint8_t board_id;
-
-uint8_t get_board_id(void)
-{
- return board_id;
-}
-
-__overridable void board_cbi_init(void)
-{
-}
-
-__overridable void board_init_fw_config(void)
-{
-}
-
-/*
- * Read CBI from I2C EEPROM and initialize variables for board variants.
- */
-static void cbi_init(void)
-{
- uint32_t cbi_val;
-
- /* Board ID */
- if (cbi_get_board_version(&cbi_val) != EC_SUCCESS ||
- cbi_val > UINT8_MAX)
- CPRINTS("CBI: Read Board ID failed");
- else
- board_id = cbi_val;
-
- CPRINTS("Board ID: %d", board_id);
-
- board_init_fw_config();
-
- /* Allow the board project to make runtime changes based on CBI data */
- board_cbi_init();
-}
-DECLARE_HOOK(HOOK_INIT, cbi_init, HOOK_PRIO_FIRST);
diff --git a/baseboard/brask/charger.c b/baseboard/brask/charger.c
deleted file mode 100644
index 04be67147d..0000000000
--- a/baseboard/brask/charger.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Copyright 2021 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 "common.h"
-
-#include "charge_manager.h"
-#include "charge_state_v2.h"
-#include "charger.h"
-#include "compile_time_macros.h"
-#include "console.h"
-#include "driver/charger/bq25710.h"
-#include "usbc_ppc.h"
-#include "usb_pd.h"
-#include "util.h"
-
-
-#define CPRINTSUSB(format, args...) cprints(CC_USBCHARGE, format, ## args)
-#define CPRINTFUSB(format, args...) cprintf(CC_USBCHARGE, format, ## args)
-
-/* Charger Chip Configuration */
-const struct charger_config_t chg_chips[] = {
- {
- .i2c_port = I2C_PORT_CHARGER,
- .i2c_addr_flags = BQ25710_SMBUS_ADDR1_FLAGS,
- .drv = &bq25710_drv,
- },
-};
-BUILD_ASSERT(ARRAY_SIZE(chg_chips) == CHARGER_NUM);
-
-int board_set_active_charge_port(int port)
-{
- int is_valid_port = board_is_usb_pd_port_present(port);
- int i;
-
- if (port == CHARGE_PORT_NONE) {
- CPRINTSUSB("Disabling all charger ports");
-
- /* Disable all ports. */
- for (i = 0; i < ppc_cnt; i++) {
- /*
- * Do not return early if one fails otherwise we can
- * get into a boot loop assertion failure.
- */
- if (ppc_vbus_sink_enable(i, 0))
- CPRINTSUSB("Disabling C%d as sink failed.", i);
- }
-
- return EC_SUCCESS;
- } else if (!is_valid_port) {
- return EC_ERROR_INVAL;
- }
-
- /* Check if the port is sourcing VBUS. */
- if (ppc_is_sourcing_vbus(port)) {
- CPRINTFUSB("Skip enable C%d", port);
- return EC_ERROR_INVAL;
- }
-
- CPRINTSUSB("New charge port: C%d", port);
-
- /*
- * Turn off the other ports' sink path FETs, before enabling the
- * requested charge port.
- */
- for (i = 0; i < ppc_cnt; i++) {
- if (i == port)
- continue;
-
- if (ppc_vbus_sink_enable(i, 0))
- CPRINTSUSB("C%d: sink path disable failed.", i);
- }
-
- /* Enable requested charge port. */
- if (ppc_vbus_sink_enable(port, 1)) {
- CPRINTSUSB("C%d: sink path enable failed.", port);
- return EC_ERROR_UNKNOWN;
- }
-
- return EC_SUCCESS;
-}
-
-__overridable void board_set_charge_limit(int port, int supplier, int charge_ma,
- int max_ma, int charge_mv)
-{
- charge_set_input_current_limit(MAX(charge_ma,
- CONFIG_CHARGER_INPUT_CURRENT),
- charge_mv);
-}
diff --git a/baseboard/brask/usb_pd_policy.c b/baseboard/brask/usb_pd_policy.c
index 1637a8bfac..c603bbed24 100644
--- a/baseboard/brask/usb_pd_policy.c
+++ b/baseboard/brask/usb_pd_policy.c
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* Shared USB-C policy for Brya boards */
+/* Shared USB-C policy for Brask boards */
#include <stddef.h>
#include <stdint.h>