diff options
-rw-r--r-- | zephyr/projects/skyrim/CMakeLists.txt | 2 | ||||
-rw-r--r-- | zephyr/projects/skyrim/frostflow.dts | 81 | ||||
-rw-r--r-- | zephyr/projects/skyrim/prj_frostflow.conf | 6 | ||||
-rw-r--r-- | zephyr/projects/skyrim/src/frostflow/alt_charger.c | 28 | ||||
-rw-r--r-- | zephyr/projects/skyrim/src/frostflow/fan.c | 46 | ||||
-rw-r--r-- | zephyr/projects/skyrim/src/frostflow/usb_mux_config.c | 17 |
6 files changed, 1 insertions, 179 deletions
diff --git a/zephyr/projects/skyrim/CMakeLists.txt b/zephyr/projects/skyrim/CMakeLists.txt index 1662e27e84..063d1eec59 100644 --- a/zephyr/projects/skyrim/CMakeLists.txt +++ b/zephyr/projects/skyrim/CMakeLists.txt @@ -53,9 +53,7 @@ if(DEFINED CONFIG_BOARD_FROSTFLOW) zephyr_library_sources( "src/frostflow/usb_mux_config.c" "src/frostflow/ppc_config.c" - "src/frostflow/alt_charger.c" ) - zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_FAN "src/frostflow/fan.c") zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_KEYBOARD_CUSTOMIZATION "src/frostflow/keyboard.c" "src/frostflow/keyboard_customization.c") diff --git a/zephyr/projects/skyrim/frostflow.dts b/zephyr/projects/skyrim/frostflow.dts index d35a6e335d..1ed0b4cb2b 100644 --- a/zephyr/projects/skyrim/frostflow.dts +++ b/zephyr/projects/skyrim/frostflow.dts @@ -30,81 +30,6 @@ }; }; - /* - * Note this is expected to vary per-board, so we keep it in the board - * dts files. - */ - frostflow-fw-config { - compatible = "cros-ec,cbi-fw-config"; - - form-factor { - enum-name = "FW_FORM_FACTOR"; - start = <0>; - size = <1>; - - ff-clamshell { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_FF_CLAMSHELL"; - value = <0>; - }; - ff-convertible { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_FF_CONVERTIBLE"; - value = <1>; - default; - }; - }; - io-db { - enum-name = "FW_IO_DB"; - start = <6>; - size = <2>; - - io-db-ps8811-ps8818 { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_IO_DB_PS8811_PS8818"; - value = <0>; - }; - }; - - /* - * FW_CONFIG field to enable fan or not. - */ - fan { - enum-name = "FW_FAN"; - start = <10>; - size = <1>; - - no-fan { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_FAN_NOT_PRESENT"; - value = <0>; - }; - fan-present { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_FAN_PRESENT"; - value = <1>; - /* - * Set as default so that unprovisioned - * configs will run the fan regardless. - */ - default; - }; - }; - - charger-option { - enum-name = "FW_CHARGER"; - start = <11>; - size = <2>; - - charger-option-isl9241 { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_CHARGER_ISL9241"; - value = <0>; - default; - }; - }; - }; - /* Rotation matrices for motion sensors. */ motionsense-rotation-ref { compatible = "cros-ec,motionsense-rotation-ref"; @@ -160,15 +85,9 @@ status = "okay"; reg = <0x9>; }; - alt_charger: isl9538@9 { - compatible = "intersil,isl923x"; - status = "okay"; - reg = <0x9>; - }; }; &usbc_port0 { - chg_alt = <&alt_charger>; ppc = <&ppc_port0>; usb-mux-chain-0 { compatible = "cros-ec,usb-mux-chain"; diff --git a/zephyr/projects/skyrim/prj_frostflow.conf b/zephyr/projects/skyrim/prj_frostflow.conf index 73e6ebf828..6372bae444 100644 --- a/zephyr/projects/skyrim/prj_frostflow.conf +++ b/zephyr/projects/skyrim/prj_frostflow.conf @@ -13,7 +13,7 @@ CONFIG_PLATFORM_EC_SYSTEM_UNLOCKED=y # LED CONFIG_PLATFORM_EC_LED_DT=y -# Frostflow is capable of sinking 100W +# Frostflow is capable of sinking 45W CONFIG_PLATFORM_EC_PD_MAX_POWER_MW=45000 CONFIG_PLATFORM_EC_PD_MAX_CURRENT_MA=3000 CONFIG_PLATFORM_EC_PD_MAX_VOLTAGE_MV=20000 @@ -23,9 +23,5 @@ CONFIG_PLATFORM_EC_TEMP_SENSOR_PCT2075=y CONFIG_PLATFORM_EC_USBC_RETIMER_ANX7483=y -# Enable alternative charger chip -CONFIG_PLATFORM_EC_CHARGER_RUNTIME_CONFIG=y -CONFIG_PLATFORM_EC_CHARGER_ISL9238C=y - # Keyboard CONFIG_PLATFORM_EC_KEYBOARD_CUSTOMIZATION=y diff --git a/zephyr/projects/skyrim/src/frostflow/alt_charger.c b/zephyr/projects/skyrim/src/frostflow/alt_charger.c deleted file mode 100644 index 76b26d32bc..0000000000 --- a/zephyr/projects/skyrim/src/frostflow/alt_charger.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include <zephyr/devicetree.h> -#include <zephyr/logging/log.h> - -#include "charger_chips.h" -#include "common.h" -#include "cros_board_info.h" -#include "cros_cbi.h" -#include "hooks.h" - -LOG_MODULE_DECLARE(frostflow, CONFIG_SKYRIM_LOG_LEVEL); - -static void alt_charger_init(void) -{ - int ret; - uint32_t val; - - ret = cros_cbi_get_fw_config(FW_CHARGER, &val); - if (ret != 0) { - LOG_ERR("Error retrieving CBI FW_CONFIG field %d", FW_CHARGER); - return; - } -} -DECLARE_HOOK(HOOK_INIT, alt_charger_init, HOOK_PRIO_POST_FIRST); diff --git a/zephyr/projects/skyrim/src/frostflow/fan.c b/zephyr/projects/skyrim/src/frostflow/fan.c deleted file mode 100644 index 5df2639208..0000000000 --- a/zephyr/projects/skyrim/src/frostflow/fan.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include <zephyr/devicetree.h> -#include <zephyr/drivers/gpio.h> -#include <zephyr/logging/log.h> - -#include "cros_board_info.h" -#include "cros_cbi.h" -#include "fan.h" -#include "gpio/gpio.h" -#include "hooks.h" - -LOG_MODULE_DECLARE(frostflow, CONFIG_SKYRIM_LOG_LEVEL); - -/* - * Frostflow fan support - */ -static void fan_init(void) -{ - int ret; - uint32_t val; - uint32_t board_version; - /* - * Retrieve the fan config. - */ - ret = cros_cbi_get_fw_config(FW_FAN, &val); - if (ret != 0) { - LOG_ERR("Error retrieving CBI FW_CONFIG field %d", FW_FAN); - return; - } - - ret = cbi_get_board_version(&board_version); - if (ret != EC_SUCCESS) { - LOG_ERR("Error retrieving CBI board version"); - return; - } - - if ((board_version >= 3) && (val != FW_FAN_PRESENT)) { - /* Disable the fan */ - fan_set_count(0); - } -} -DECLARE_HOOK(HOOK_INIT, fan_init, HOOK_PRIO_POST_FIRST); diff --git a/zephyr/projects/skyrim/src/frostflow/usb_mux_config.c b/zephyr/projects/skyrim/src/frostflow/usb_mux_config.c index 58111e66ec..e641e0d649 100644 --- a/zephyr/projects/skyrim/src/frostflow/usb_mux_config.c +++ b/zephyr/projects/skyrim/src/frostflow/usb_mux_config.c @@ -121,20 +121,3 @@ int board_c1_ps8818_mux_set(const struct usb_mux *me, mux_state_t mux_state) return 0; } - -static void setup_mux(void) -{ - uint32_t val; - - if (cros_cbi_get_fw_config(FW_IO_DB, &val) != 0) - CPRINTSUSB("Error finding FW_DB_IO in CBI FW_CONFIG"); - /* Val will have our dts default on error, so continue setup */ - - if (val == FW_IO_DB_PS8811_PS8818) { - CPRINTSUSB("C1: Setting PS8818 mux"); - USB_MUX_ENABLE_ALTERNATIVE(usb_mux_chain_ps8818_port1); - } else { - CPRINTSUSB("Unexpected DB_IO board: %d", val); - } -} -DECLARE_HOOK(HOOK_INIT, setup_mux, HOOK_PRIO_INIT_I2C); |