From d3c688f15601a01691d6ec68b8ae3f3c5f8ecd19 Mon Sep 17 00:00:00 2001 From: Jason Yuan Date: Wed, 30 Nov 2022 16:15:59 -0800 Subject: zephyr: Devicetree organization - skyrim Smaller project specific devicetree changes are merged into the overlay file. Some shared devicetree nodes have been merged into program directory. BUG=b:254097911 TEST=Ran zmake compare-builds BRANCH=none Change-Id: Ie17e2854aaaffd29712054e41e3299d9328ce2cc Signed-off-by: Jason Yuan Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4072139 Tested-by: zhi cheng yuan Code-Coverage: Zoss Commit-Queue: zhi cheng yuan Reviewed-by: Diana Z --- zephyr/program/skyrim/crystaldrift/battery.dtsi | 15 -- .../program/skyrim/crystaldrift/crystaldrift.dtsi | 209 ------------------- zephyr/program/skyrim/crystaldrift/project.overlay | 156 +++++++++++++- zephyr/program/skyrim/frostflow/battery.dtsi | 12 -- zephyr/program/skyrim/frostflow/frostflow.dtsi | 223 --------------------- zephyr/program/skyrim/frostflow/project.overlay | 221 +++++++++++++++++++- zephyr/program/skyrim/i2c.dtsi | 46 +++++ zephyr/program/skyrim/morthal/battery.dtsi | 15 -- zephyr/program/skyrim/morthal/morthal.dtsi | 185 ----------------- zephyr/program/skyrim/morthal/project.overlay | 147 +++++++++++++- zephyr/program/skyrim/skyrim/battery.dtsi | 15 -- zephyr/program/skyrim/skyrim/project.overlay | 156 +++++++++++++- zephyr/program/skyrim/skyrim/skyrim.dtsi | 209 ------------------- zephyr/program/skyrim/usbc.dtsi | 16 ++ zephyr/program/skyrim/winterhold/battery.dtsi | 33 --- zephyr/program/skyrim/winterhold/project.overlay | 166 ++++++++++++++- zephyr/program/skyrim/winterhold/winterhold.dtsi | 168 ---------------- 17 files changed, 898 insertions(+), 1094 deletions(-) delete mode 100644 zephyr/program/skyrim/crystaldrift/battery.dtsi delete mode 100644 zephyr/program/skyrim/crystaldrift/crystaldrift.dtsi delete mode 100644 zephyr/program/skyrim/frostflow/battery.dtsi delete mode 100644 zephyr/program/skyrim/frostflow/frostflow.dtsi delete mode 100644 zephyr/program/skyrim/morthal/battery.dtsi delete mode 100644 zephyr/program/skyrim/morthal/morthal.dtsi delete mode 100644 zephyr/program/skyrim/skyrim/battery.dtsi delete mode 100644 zephyr/program/skyrim/skyrim/skyrim.dtsi delete mode 100644 zephyr/program/skyrim/winterhold/battery.dtsi delete mode 100644 zephyr/program/skyrim/winterhold/winterhold.dtsi (limited to 'zephyr/program/skyrim') diff --git a/zephyr/program/skyrim/crystaldrift/battery.dtsi b/zephyr/program/skyrim/crystaldrift/battery.dtsi deleted file mode 100644 index 6b1799c233..0000000000 --- a/zephyr/program/skyrim/crystaldrift/battery.dtsi +++ /dev/null @@ -1,15 +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. - */ - -/ { - batteries { - default_battery: aec_5477109 { - compatible = "aec,5477109", "battery-smart"; - }; - smp_l20m3pg1 { - compatible = "smp,l20m3pg1", "battery-smart"; - }; - }; -}; diff --git a/zephyr/program/skyrim/crystaldrift/crystaldrift.dtsi b/zephyr/program/skyrim/crystaldrift/crystaldrift.dtsi deleted file mode 100644 index 812f97a7c7..0000000000 --- a/zephyr/program/skyrim/crystaldrift/crystaldrift.dtsi +++ /dev/null @@ -1,209 +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 - -#include "../i2c.dtsi" - -/ { - named-gpios { - /* Crystaldrift-specific GPIO customizations */ - }; - - named-temp-sensors { - compatible = "cros-ec,temp-sensors"; - soc-pct2075 { - temp_host_high = <100>; - temp_host_halt = <105>; - temp_host_release_high = <80>; - temp_host_release_halt = <80>; - temp_fan_off = <35>; - temp_fan_max = <70>; - power-good-pin = <&gpio_pg_pwr_s5>; - sensor = <&soc_pct2075>; - }; - amb-pct2075 { - power-good-pin = <&gpio_pg_pwr_s5>; - sensor = <&amb_pct2075>; - }; - }; - - /* - * Note this is expected to vary per-board, so we keep it in the board - * dts files. - */ - crystaldrift-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>; - }; - io-db-none-anx7483 { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_IO_DB_NONE_ANX7483"; - value = <1>; - default; - }; - }; - - /* - * 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; - }; - charger-option-isl9538 { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_CHARGER_ISL9538"; - value = <1>; - }; - }; - }; - - /* Rotation matrices for motion sensors. */ - motionsense-rotation-ref { - compatible = "cros-ec,motionsense-rotation-ref"; - lid_rot_ref: lid-rotation-ref { - mat33 = <0 (-1) 0 - 1 0 0 - 0 0 1>; - }; - - lid_rot_ref1: lid-rotation-ref1 { - mat33 = <0 1 0 - (-1) 0 0 - 0 0 1>; - }; - - base_rot_ref: base-rotation-ref { - mat33 = <0 1 0 - (-1) 0 0 - 0 0 1>; - }; - }; - - ppc_port0: aoz1380 { - compatible = "aoz,aoz1380"; - status = "okay"; - }; -}; - -&i2c0_0 { - anx7483_port0: anx7483@3e { - compatible = "analogix,anx7483"; - reg = <0x3e>; - board-set = "board_anx7483_c0_mux_set"; - flags = ; - }; -}; - -&i2c1_0 { - anx7483_port1: anx7483@3e { - compatible = "analogix,anx7483"; - reg = <0x3e>; - board-set = "board_anx7483_c1_mux_set"; - flags = ; - }; - ppc_port1: nx20p348x@71 { - compatible = "nxp,nx20p348x"; - status = "okay"; - reg = <0x71>; - }; - ps8818_port1: ps8818@28 { - compatible = "parade,ps8818"; - reg = <0x28>; - flags = <(USB_MUX_FLAG_RESETS_IN_G3)>; - board-set = "board_c1_ps8818_mux_set"; - }; -}; - -&i2c4_1 { - charger: isl9241@9 { - compatible = "intersil,isl9241"; - 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"; - usb-muxes = <&amd_fp6_port0 &anx7483_port0>; - }; -}; - -&usbc_port1 { - ppc = <&ppc_port1>; - usb-mux-chain-1-anx { - compatible = "cros-ec,usb-mux-chain"; - usb-muxes = <&amd_fp6_port1 &anx7483_port1>; - }; - usb_mux_chain_ps8818_port1: usb-mux-chain-1-ps { - compatible = "cros-ec,usb-mux-chain"; - usb-muxes = <&amd_fp6_port1 &ps8818_port1>; - alternative-chain; - }; -}; diff --git a/zephyr/program/skyrim/crystaldrift/project.overlay b/zephyr/program/skyrim/crystaldrift/project.overlay index 1192bb0d16..ba4d5ea549 100644 --- a/zephyr/program/skyrim/crystaldrift/project.overlay +++ b/zephyr/program/skyrim/crystaldrift/project.overlay @@ -7,13 +7,165 @@ #include "../adc.dtsi" #include "../fan.dtsi" #include "../gpio.dtsi" +#include "../i2c.dtsi" #include "../interrupts.dtsi" #include "../keyboard.dtsi" #include "../usbc.dtsi" /* Crystaldrift project DTS includes*/ -#include "crystaldrift.dtsi" -#include "battery.dtsi" #include "led_pins.dtsi" #include "led_policy.dtsi" #include "motionsense.dtsi" + +/* Crystaldrift overrides follow... */ +/ { + /* battery overrides */ + batteries { + default_battery: aec_5477109 { + compatible = "aec,5477109", "battery-smart"; + }; + smp_l20m3pg1 { + compatible = "smp,l20m3pg1", "battery-smart"; + }; + }; + + named-gpios { + /* Crystaldrift-specific GPIO customizations */ + }; + + named-temp-sensors { + compatible = "cros-ec,temp-sensors"; + soc-pct2075 { + temp_host_high = <100>; + temp_host_halt = <105>; + temp_host_release_high = <80>; + temp_host_release_halt = <80>; + temp_fan_off = <35>; + temp_fan_max = <70>; + power-good-pin = <&gpio_pg_pwr_s5>; + sensor = <&soc_pct2075>; + }; + amb-pct2075 { + power-good-pin = <&gpio_pg_pwr_s5>; + sensor = <&amb_pct2075>; + }; + }; + + /* + * Note this is expected to vary per-board, so we keep it in the overlay + * file. + */ + crystaldrift-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>; + }; + io-db-none-anx7483 { + compatible = "cros-ec,cbi-fw-config-value"; + enum-name = "FW_IO_DB_NONE_ANX7483"; + value = <1>; + default; + }; + }; + + /* + * 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; + }; + charger-option-isl9538 { + compatible = "cros-ec,cbi-fw-config-value"; + enum-name = "FW_CHARGER_ISL9538"; + value = <1>; + }; + }; + }; + + /* Rotation matrices for motion sensors. */ + motionsense-rotation-ref { + compatible = "cros-ec,motionsense-rotation-ref"; + lid_rot_ref: lid-rotation-ref { + mat33 = <0 (-1) 0 + 1 0 0 + 0 0 1>; + }; + + lid_rot_ref1: lid-rotation-ref1 { + mat33 = <0 1 0 + (-1) 0 0 + 0 0 1>; + }; + + base_rot_ref: base-rotation-ref { + mat33 = <0 1 0 + (-1) 0 0 + 0 0 1>; + }; + }; + + ppc_port0: aoz1380 { + compatible = "aoz,aoz1380"; + status = "okay"; + }; +}; + +/* i2c overrides */ +&i2c0_0 { + /delete-node/ nx20p348x@71; +}; diff --git a/zephyr/program/skyrim/frostflow/battery.dtsi b/zephyr/program/skyrim/frostflow/battery.dtsi deleted file mode 100644 index 2d6b28de70..0000000000 --- a/zephyr/program/skyrim/frostflow/battery.dtsi +++ /dev/null @@ -1,12 +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. - */ - -/ { - batteries { - default_battery: cdt_c340152 { - compatible = "cdt,c340152", "battery-smart"; - }; - }; -}; diff --git a/zephyr/program/skyrim/frostflow/frostflow.dtsi b/zephyr/program/skyrim/frostflow/frostflow.dtsi deleted file mode 100644 index 1cadf7ee2d..0000000000 --- a/zephyr/program/skyrim/frostflow/frostflow.dtsi +++ /dev/null @@ -1,223 +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 - -#include "../i2c.dtsi" - -/ { - named-gpios { - /* Frostflow-specific GPIO customizations */ - }; - - named-temp-sensors { - compatible = "cros-ec,temp-sensors"; - temp_soc: soc-pct2075 { - temp_host_high = <75>; - temp_host_halt = <80>; - temp_host_release_high = <65>; - temp_host_release_halt = <70>; - power-good-pin = <&gpio_pg_pwr_s5>; - sensor = <&soc_pct2075>; - }; - temp_amb: amb-pct2075 { - temp_host_high = <65>; - temp_host_halt = <70>; - temp_host_release_high = <55>; - temp_host_release_halt = <60>; - temp_fan_off = <32>; - temp_fan_max = <45>; - power-good-pin = <&gpio_pg_pwr_s5>; - sensor = <&amb_pct2075>; - }; - }; - - /* Rotation matrices for motion sensors. */ - motionsense-rotation-ref { - compatible = "cros-ec,motionsense-rotation-ref"; - lid_rot_ref: lid-rotation-ref { - mat33 = <1 0 0 - 0 1 0 - 0 0 1>; - }; - - base_rot_ref: base-rotation-ref { - mat33 = <0 1 0 - 1 0 0 - 0 0 (-1)>; - }; - }; - - ppc_port0: aoz1380 { - compatible = "aoz,aoz1380"; - status = "okay"; - }; - - fan_steps_clamshell: fan-steps-clamshell { - compatible = "cros-ec,fan-steps"; - level_0 { - temp_on = <(-1) (-1) (-1) (-1) 31>; - temp_off = <(-1) (-1) (-1) (-1) 99>; - rpm_target = <0>; - }; - level_1 { - temp_on = <(-1) (-1) (-1) (-1) 32>; - temp_off = <(-1) (-1) (-1) (-1) 30>; - rpm_target = <2600>; - }; - level_2 { - temp_on = <(-1) (-1) (-1) (-1) 34>; - temp_off = <(-1) (-1) (-1) (-1) 31>; - rpm_target = <2900>; - }; - level_3 { - temp_on = <(-1) (-1) (-1) (-1) 36>; - temp_off = <(-1) (-1) (-1) (-1) 33>; - rpm_target = <3600>; - }; - level_4 { - temp_on = <(-1) (-1) (-1) (-1) 38>; - temp_off = <(-1) (-1) (-1) (-1) 35>; - rpm_target = <4200>; - }; - level_5 { - temp_on = <(-1) (-1) (-1) (-1) 45>; - temp_off = <(-1) (-1) (-1) (-1) 37>; - rpm_target = <4600>; - }; - }; - - fan_steps_tablet: fan-steps-tablet { - compatible = "cros-ec,fan-steps"; - level_0 { - temp_on = <(-1) (-1) (-1) (-1) 31>; - temp_off = <(-1) (-1) (-1) (-1) 99>; - rpm_target = <0>; - }; - level_1 { - temp_on = <(-1) (-1) (-1) (-1) 32>; - temp_off = <(-1) (-1) (-1) (-1) 30>; - rpm_target = <2600>; - }; - level_2 { - temp_on = <(-1) (-1) (-1) (-1) 34>; - temp_off = <(-1) (-1) (-1) (-1) 31>; - rpm_target = <2900>; - }; - level_3 { - temp_on = <(-1) (-1) (-1) (-1) 36>; - temp_off = <(-1) (-1) (-1) (-1) 33>; - rpm_target = <3600>; - }; - level_4 { - temp_on = <(-1) (-1) (-1) (-1) 38>; - temp_off = <(-1) (-1) (-1) (-1) 35>; - rpm_target = <4200>; - }; - level_5 { - temp_on = <(-1) (-1) (-1) (-1) 45>; - temp_off = <(-1) (-1) (-1) (-1) 37>; - rpm_target = <4600>; - }; - }; -}; - -&i2c1_0 { - ppc_port1: nx20p348x@71 { - compatible = "nxp,nx20p348x"; - status = "okay"; - reg = <0x71>; - }; - ps8818_port1: ps8818@28 { - compatible = "parade,ps8818"; - reg = <0x28>; - flags = <(USB_MUX_FLAG_RESETS_IN_G3)>; - board-set = "board_c1_ps8818_mux_set"; - }; -}; - -&i2c4_1 { - charger: isl9241@9 { - compatible = "intersil,isl9241"; - status = "okay"; - reg = <0x9>; - }; -}; - -&amd_fp6_port0 { - board-set = "board_c0_amd_fp6_mux_set"; -}; - -&usbc_port0 { - ppc = <&ppc_port0>; - usb-mux-chain-0 { - compatible = "cros-ec,usb-mux-chain"; - usb-muxes = <&amd_fp6_port0>; - }; -}; - -&usbc_port1 { - ppc = <&ppc_port1>; - usb-mux-chain-1-ps8818 { - compatible = "cros-ec,usb-mux-chain"; - usb-muxes = <&amd_fp6_port1 &ps8818_port1>; - }; -}; - -&cros_kb_raw { - pinctrl-0 = < - &ksi0_gp31 - &ksi1_gp30 - &ksi2_gp27 - &ksi3_gp26 - &ksi4_gp25 - &ksi5_gp24 - &ksi6_gp23 - &ksi7_gp22 - &kso00_gp21 - &kso01_gp20 - &kso03_gp16 - &kso04_gp15 - &kso05_gp14 - &kso06_gp13 - &kso07_gp12 - &kso08_gp11 - &kso09_gp10 - &kso10_gp07 - &kso11_gp06 - &kso12_gp05 - &kso13_gp04 - &kso14_gp82 - >; -}; - -&temp_sensor_charger { - temp_host_high = <75>; - temp_host_halt = <80>; - temp_host_release_high = <65>; - temp_host_release_halt = <70>; -}; - -&temp_sensor_memory { - temp_host_high = <75>; - temp_host_halt = <80>; - temp_host_release_high = <65>; - temp_host_release_halt = <70>; -}; - -&temp_sensor_cpu { - /delete-property/ temp_host_high; - /delete-property/ temp_host_halt; - /delete-property/ temp_host_release_high; - /delete-property/ temp_fan_off; - /delete-property/ temp_fan_max; -}; - -&fan0 { - pwms = <&pwm0 0 PWM_KHZ(25) PWM_POLARITY_NORMAL>; - rpm_min = <2400>; - rpm_start = <2600>; - rpm_max = <4600>; -}; diff --git a/zephyr/program/skyrim/frostflow/project.overlay b/zephyr/program/skyrim/frostflow/project.overlay index a1bc7dbb5e..033e6dfedf 100644 --- a/zephyr/program/skyrim/frostflow/project.overlay +++ b/zephyr/program/skyrim/frostflow/project.overlay @@ -7,13 +7,230 @@ #include "../adc.dtsi" #include "../fan.dtsi" #include "../gpio.dtsi" +#include "../i2c.dtsi" #include "../interrupts.dtsi" #include "../keyboard.dtsi" #include "../usbc.dtsi" /* Frostflow project DTS includes*/ -#include "frostflow.dtsi" -#include "battery.dtsi" #include "led_pins.dtsi" #include "led_policy.dtsi" #include "motionsense.dtsi" + +/* Frostflow overrides follow... */ +/ { + /* battery overrides */ + batteries { + default_battery: cdt_c340152 { + compatible = "cdt,c340152", "battery-smart"; + }; + }; + + named-gpios { + /* Frostflow-specific GPIO customizations */ + }; + + named-temp-sensors { + compatible = "cros-ec,temp-sensors"; + temp_soc: soc-pct2075 { + temp_host_high = <75>; + temp_host_halt = <80>; + temp_host_release_high = <65>; + temp_host_release_halt = <70>; + power-good-pin = <&gpio_pg_pwr_s5>; + sensor = <&soc_pct2075>; + }; + temp_amb: amb-pct2075 { + temp_host_high = <65>; + temp_host_halt = <70>; + temp_host_release_high = <55>; + temp_host_release_halt = <60>; + temp_fan_off = <32>; + temp_fan_max = <45>; + power-good-pin = <&gpio_pg_pwr_s5>; + sensor = <&amb_pct2075>; + }; + }; + + /* Rotation matrices for motion sensors. */ + motionsense-rotation-ref { + compatible = "cros-ec,motionsense-rotation-ref"; + lid_rot_ref: lid-rotation-ref { + mat33 = <1 0 0 + 0 1 0 + 0 0 1>; + }; + + base_rot_ref: base-rotation-ref { + mat33 = <0 1 0 + 1 0 0 + 0 0 (-1)>; + }; + }; + + ppc_port0: aoz1380 { + compatible = "aoz,aoz1380"; + status = "okay"; + }; + + fan_steps_clamshell: fan-steps-clamshell { + compatible = "cros-ec,fan-steps"; + level_0 { + temp_on = <(-1) (-1) (-1) (-1) 31>; + temp_off = <(-1) (-1) (-1) (-1) 99>; + rpm_target = <0>; + }; + level_1 { + temp_on = <(-1) (-1) (-1) (-1) 32>; + temp_off = <(-1) (-1) (-1) (-1) 30>; + rpm_target = <2600>; + }; + level_2 { + temp_on = <(-1) (-1) (-1) (-1) 34>; + temp_off = <(-1) (-1) (-1) (-1) 31>; + rpm_target = <2900>; + }; + level_3 { + temp_on = <(-1) (-1) (-1) (-1) 36>; + temp_off = <(-1) (-1) (-1) (-1) 33>; + rpm_target = <3600>; + }; + level_4 { + temp_on = <(-1) (-1) (-1) (-1) 38>; + temp_off = <(-1) (-1) (-1) (-1) 35>; + rpm_target = <4200>; + }; + level_5 { + temp_on = <(-1) (-1) (-1) (-1) 45>; + temp_off = <(-1) (-1) (-1) (-1) 37>; + rpm_target = <4600>; + }; + }; + + fan_steps_tablet: fan-steps-tablet { + compatible = "cros-ec,fan-steps"; + level_0 { + temp_on = <(-1) (-1) (-1) (-1) 31>; + temp_off = <(-1) (-1) (-1) (-1) 99>; + rpm_target = <0>; + }; + level_1 { + temp_on = <(-1) (-1) (-1) (-1) 32>; + temp_off = <(-1) (-1) (-1) (-1) 30>; + rpm_target = <2600>; + }; + level_2 { + temp_on = <(-1) (-1) (-1) (-1) 34>; + temp_off = <(-1) (-1) (-1) (-1) 31>; + rpm_target = <2900>; + }; + level_3 { + temp_on = <(-1) (-1) (-1) (-1) 36>; + temp_off = <(-1) (-1) (-1) (-1) 33>; + rpm_target = <3600>; + }; + level_4 { + temp_on = <(-1) (-1) (-1) (-1) 38>; + temp_off = <(-1) (-1) (-1) (-1) 35>; + rpm_target = <4200>; + }; + level_5 { + temp_on = <(-1) (-1) (-1) (-1) 45>; + temp_off = <(-1) (-1) (-1) (-1) 37>; + rpm_target = <4600>; + }; + }; +}; + +/* i2c overrides */ +&i2c0_0 { + /delete-node/ nx20p348x@71; + /delete-node/ anx7483@3e; +}; + +&i2c1_0 { + /delete-node/ anx7483@3e; +}; + +&i2c4_1 { + /delete-node/ isl9538@9; +}; + +&amd_fp6_port0 { + board-set = "board_c0_amd_fp6_mux_set"; +}; + +/* usbc overrides */ +&usbc_port0 { + /delete-property/ chg_alt; + usb-mux-chain-0 { + usb-muxes = <&amd_fp6_port0>; + }; +}; + +&usbc_port1 { + /delete-node/ usb-mux-chain-1-anx; + /delete-node/ usb-mux-chain-1-ps; + usb-mux-chain-1-ps8818 { + compatible = "cros-ec,usb-mux-chain"; + usb-muxes = <&amd_fp6_port1 &ps8818_port1>; + }; +}; + +&cros_kb_raw { + pinctrl-0 = < + &ksi0_gp31 + &ksi1_gp30 + &ksi2_gp27 + &ksi3_gp26 + &ksi4_gp25 + &ksi5_gp24 + &ksi6_gp23 + &ksi7_gp22 + &kso00_gp21 + &kso01_gp20 + &kso03_gp16 + &kso04_gp15 + &kso05_gp14 + &kso06_gp13 + &kso07_gp12 + &kso08_gp11 + &kso09_gp10 + &kso10_gp07 + &kso11_gp06 + &kso12_gp05 + &kso13_gp04 + &kso14_gp82 + >; +}; + +/* temperature sensor overrides */ +&temp_sensor_charger { + temp_host_high = <75>; + temp_host_halt = <80>; + temp_host_release_high = <65>; + temp_host_release_halt = <70>; +}; + +&temp_sensor_memory { + temp_host_high = <75>; + temp_host_halt = <80>; + temp_host_release_high = <65>; + temp_host_release_halt = <70>; +}; + +&temp_sensor_cpu { + /delete-property/ temp_host_high; + /delete-property/ temp_host_halt; + /delete-property/ temp_host_release_high; + /delete-property/ temp_fan_off; + /delete-property/ temp_fan_max; +}; + +/* fan overrides */ +&fan0 { + pwms = <&pwm0 0 PWM_KHZ(25) PWM_POLARITY_NORMAL>; + rpm_min = <2400>; + rpm_start = <2600>; + rpm_max = <4600>; +}; diff --git a/zephyr/program/skyrim/i2c.dtsi b/zephyr/program/skyrim/i2c.dtsi index 460a6bcfd2..35e8bbe40a 100644 --- a/zephyr/program/skyrim/i2c.dtsi +++ b/zephyr/program/skyrim/i2c.dtsi @@ -4,6 +4,7 @@ */ #include + #include / { aliases { @@ -119,6 +120,19 @@ nct38xx-dev = <&nct3807_C0>; label = "NCT3807_ALERT_0"; }; + + anx7483_port0: anx7483@3e { + compatible = "analogix,anx7483"; + reg = <0x3e>; + board-set = "board_anx7483_c0_mux_set"; + flags = ; + }; + + ppc_port0: nx20p348x@71 { + compatible = "nxp,nx20p348x"; + status = "okay"; + reg = <0x71>; + }; }; &i2c_ctrl0 { @@ -180,6 +194,26 @@ nct38xx-dev = <&nct3807_C1>; label = "NCT3807_ALERT_1"; }; + + anx7483_port1: anx7483@3e { + compatible = "analogix,anx7483"; + reg = <0x3e>; + board-set = "board_anx7483_c1_mux_set"; + flags = ; + }; + + ppc_port1: nx20p348x@71 { + compatible = "nxp,nx20p348x"; + status = "okay"; + reg = <0x71>; + }; + + ps8818_port1: ps8818@28 { + compatible = "parade,ps8818"; + reg = <0x28>; + flags = <(USB_MUX_FLAG_RESETS_IN_G3)>; + board-set = "board_c1_ps8818_mux_set"; + }; }; &i2c_ctrl1 { @@ -227,6 +261,18 @@ clock-frequency = ; pinctrl-0 = <&i2c4_1_sda_scl_gpf2_f3>; pinctrl-names = "default"; + + charger: isl9241@9 { + compatible = "intersil,isl9241"; + status = "okay"; + reg = <0x9>; + }; + + alt_charger: isl9538@9 { + compatible = "intersil,isl923x"; + status = "okay"; + reg = <0x9>; + }; }; &i2c_ctrl4 { diff --git a/zephyr/program/skyrim/morthal/battery.dtsi b/zephyr/program/skyrim/morthal/battery.dtsi deleted file mode 100644 index 8c87cef7f9..0000000000 --- a/zephyr/program/skyrim/morthal/battery.dtsi +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright 2021 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/ { - batteries { - default_battery: aec_5477109 { - compatible = "aec,5477109", "battery-smart"; - }; - smp_l20m3pg1 { - compatible = "smp,l20m3pg1", "battery-smart"; - }; - }; -}; diff --git a/zephyr/program/skyrim/morthal/morthal.dtsi b/zephyr/program/skyrim/morthal/morthal.dtsi deleted file mode 100644 index 99a062220d..0000000000 --- a/zephyr/program/skyrim/morthal/morthal.dtsi +++ /dev/null @@ -1,185 +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 - -#include "../i2c.dtsi" - -/ { - named-gpios { - /* Morthal-specific GPIO customizations */ - }; - - named-temp-sensors { - compatible = "cros-ec,temp-sensors"; - soc-pct2075 { - temp_host_high = <100>; - temp_host_halt = <105>; - temp_host_release_high = <80>; - temp_host_release_halt = <80>; - temp_fan_off = <0>; - temp_fan_max = <70>; - power-good-pin = <&gpio_pg_pwr_s5>; - sensor = <&soc_pct2075>; - }; - amb-pct2075 { - power-good-pin = <&gpio_pg_pwr_s5>; - sensor = <&amb_pct2075>; - }; - }; - - /* - * Note this is expected to vary per-board, so we keep it in the board - * dts files. - */ - morthal-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>; - }; - io-db-none-anx7483 { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_IO_DB_NONE_ANX7483"; - value = <1>; - default; - }; - }; - - /* - * 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; - }; - }; - }; - - /* Rotation matrices for motion sensors. */ - motionsense-rotation-ref { - compatible = "cros-ec,motionsense-rotation-ref"; - lid_rot_ref: lid-rotation-ref { - mat33 = <0 (-1) 0 - 1 0 0 - 0 0 1>; - }; - - lid_rot_ref1: lid-rotation-ref1 { - mat33 = <0 1 0 - (-1) 0 0 - 0 0 1>; - }; - - base_rot_ref: base-rotation-ref { - mat33 = <0 1 0 - (-1) 0 0 - 0 0 1>; - }; - }; - - ppc_port0: aoz1380 { - compatible = "aoz,aoz1380"; - status = "okay"; - }; -}; - -&i2c0_0 { - anx7483_port0: anx7483@3e { - compatible = "analogix,anx7483"; - reg = <0x3e>; - board-set = "board_anx7483_c0_mux_set"; - flags = ; - }; -}; - -&i2c1_0 { - anx7483_port1: anx7483@3e { - compatible = "analogix,anx7483"; - reg = <0x3e>; - board-set = "board_anx7483_c1_mux_set"; - flags = ; - }; - ppc_port1: nx20p348x@71 { - compatible = "nxp,nx20p348x"; - status = "okay"; - reg = <0x71>; - }; - ps8818_port1: ps8818@28 { - compatible = "parade,ps8818"; - reg = <0x28>; - flags = <(USB_MUX_FLAG_RESETS_IN_G3)>; - board-set = "board_c1_ps8818_mux_set"; - }; -}; - -&i2c4_1 { - charger: isl9241@9 { - compatible = "intersil,isl9241"; - status = "okay"; - reg = <0x9>; - }; -}; - -&usbc_port0 { - ppc = <&ppc_port0>; - usb-mux-chain-0 { - compatible = "cros-ec,usb-mux-chain"; - usb-muxes = <&amd_fp6_port0 &anx7483_port0>; - }; -}; - -&usbc_port1 { - ppc = <&ppc_port1>; - usb-mux-chain-1-anx { - compatible = "cros-ec,usb-mux-chain"; - usb-muxes = <&amd_fp6_port1 &anx7483_port1>; - }; - usb_mux_chain_ps8818_port1: usb-mux-chain-1-ps { - compatible = "cros-ec,usb-mux-chain"; - usb-muxes = <&amd_fp6_port1 &ps8818_port1>; - alternative-chain; - }; -}; diff --git a/zephyr/program/skyrim/morthal/project.overlay b/zephyr/program/skyrim/morthal/project.overlay index a41d358cce..0188699746 100644 --- a/zephyr/program/skyrim/morthal/project.overlay +++ b/zephyr/program/skyrim/morthal/project.overlay @@ -7,13 +7,156 @@ #include "../adc.dtsi" #include "../fan.dtsi" #include "../gpio.dtsi" +#include "../i2c.dtsi" #include "../interrupts.dtsi" #include "../keyboard.dtsi" #include "../usbc.dtsi" /* Morthal project DTS includes*/ -#include "morthal.dtsi" -#include "battery.dtsi" #include "led_pins.dtsi" #include "led_policy.dtsi" #include "motionsense.dtsi" + +/* Morthal overrides follow... */ +/ { + /* battery overrides */ + batteries { + default_battery: aec_5477109 { + compatible = "aec,5477109", "battery-smart"; + }; + smp_l20m3pg1 { + compatible = "smp,l20m3pg1", "battery-smart"; + }; + }; + + named-gpios { + /* Morthal-specific GPIO customizations */ + }; + + named-temp-sensors { + compatible = "cros-ec,temp-sensors"; + soc-pct2075 { + temp_host_high = <100>; + temp_host_halt = <105>; + temp_host_release_high = <80>; + temp_host_release_halt = <80>; + temp_fan_off = <0>; + temp_fan_max = <70>; + power-good-pin = <&gpio_pg_pwr_s5>; + sensor = <&soc_pct2075>; + }; + amb-pct2075 { + power-good-pin = <&gpio_pg_pwr_s5>; + sensor = <&amb_pct2075>; + }; + }; + + /* + * Note this is expected to vary per-board, so we keep it in the overlay + * files. + */ + morthal-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>; + }; + io-db-none-anx7483 { + compatible = "cros-ec,cbi-fw-config-value"; + enum-name = "FW_IO_DB_NONE_ANX7483"; + value = <1>; + default; + }; + }; + + /* + * 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; + }; + }; + }; + + /* Rotation matrices for motion sensors. */ + motionsense-rotation-ref { + compatible = "cros-ec,motionsense-rotation-ref"; + lid_rot_ref: lid-rotation-ref { + mat33 = <0 (-1) 0 + 1 0 0 + 0 0 1>; + }; + + lid_rot_ref1: lid-rotation-ref1 { + mat33 = <0 1 0 + (-1) 0 0 + 0 0 1>; + }; + + base_rot_ref: base-rotation-ref { + mat33 = <0 1 0 + (-1) 0 0 + 0 0 1>; + }; + }; + + ppc_port0: aoz1380 { + compatible = "aoz,aoz1380"; + status = "okay"; + }; +}; + +/* i2c overrides */ +&i2c0_0 { + /delete-node/ nx20p348x@71; +}; + +&i2c4_1 { + /delete-node/ isl9538@9; +}; + +/* usbc overrides */ +&usbc_port0 { + /delete-property/ chg_alt; +}; diff --git a/zephyr/program/skyrim/skyrim/battery.dtsi b/zephyr/program/skyrim/skyrim/battery.dtsi deleted file mode 100644 index 8c87cef7f9..0000000000 --- a/zephyr/program/skyrim/skyrim/battery.dtsi +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright 2021 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/ { - batteries { - default_battery: aec_5477109 { - compatible = "aec,5477109", "battery-smart"; - }; - smp_l20m3pg1 { - compatible = "smp,l20m3pg1", "battery-smart"; - }; - }; -}; diff --git a/zephyr/program/skyrim/skyrim/project.overlay b/zephyr/program/skyrim/skyrim/project.overlay index 9b61b2ac9b..508223641b 100644 --- a/zephyr/program/skyrim/skyrim/project.overlay +++ b/zephyr/program/skyrim/skyrim/project.overlay @@ -7,13 +7,165 @@ #include "../adc.dtsi" #include "../fan.dtsi" #include "../gpio.dtsi" +#include "../i2c.dtsi" #include "../interrupts.dtsi" #include "../keyboard.dtsi" #include "../usbc.dtsi" /* Skyrim project DTS includes*/ -#include "skyrim.dtsi" -#include "battery.dtsi" #include "led_pins.dtsi" #include "led_policy.dtsi" #include "motionsense.dtsi" + +/* Skyrim overrides follow... */ +/ { + /* battery overrides */ + batteries { + default_battery: aec_5477109 { + compatible = "aec,5477109", "battery-smart"; + }; + smp_l20m3pg1 { + compatible = "smp,l20m3pg1", "battery-smart"; + }; + }; + + named-gpios { + /* Skyrim-specific GPIO customizations */ + }; + + named-temp-sensors { + compatible = "cros-ec,temp-sensors"; + soc-pct2075 { + temp_host_high = <100>; + temp_host_halt = <105>; + temp_host_release_high = <80>; + temp_host_release_halt = <80>; + temp_fan_off = <35>; + temp_fan_max = <70>; + power-good-pin = <&gpio_pg_pwr_s5>; + sensor = <&soc_pct2075>; + }; + amb-pct2075 { + power-good-pin = <&gpio_pg_pwr_s5>; + sensor = <&amb_pct2075>; + }; + }; + + /* + * Note this is expected to vary per-board, so we keep it in the overlay + * files. + */ + skyrim-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>; + }; + io-db-none-anx7483 { + compatible = "cros-ec,cbi-fw-config-value"; + enum-name = "FW_IO_DB_NONE_ANX7483"; + value = <1>; + default; + }; + }; + + /* + * 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; + }; + charger-option-isl9538 { + compatible = "cros-ec,cbi-fw-config-value"; + enum-name = "FW_CHARGER_ISL9538"; + value = <1>; + }; + }; + }; + + /* Rotation matrices for motion sensors. */ + motionsense-rotation-ref { + compatible = "cros-ec,motionsense-rotation-ref"; + lid_rot_ref: lid-rotation-ref { + mat33 = <0 (-1) 0 + 1 0 0 + 0 0 1>; + }; + + lid_rot_ref1: lid-rotation-ref1 { + mat33 = <0 1 0 + (-1) 0 0 + 0 0 1>; + }; + + base_rot_ref: base-rotation-ref { + mat33 = <0 1 0 + (-1) 0 0 + 0 0 1>; + }; + }; + + ppc_port0: aoz1380 { + compatible = "aoz,aoz1380"; + status = "okay"; + }; +}; + +/* i2c overrides */ +&i2c0_0 { + /delete-node/ nx20p348x@71; +}; diff --git a/zephyr/program/skyrim/skyrim/skyrim.dtsi b/zephyr/program/skyrim/skyrim/skyrim.dtsi deleted file mode 100644 index 1037df1c8c..0000000000 --- a/zephyr/program/skyrim/skyrim/skyrim.dtsi +++ /dev/null @@ -1,209 +0,0 @@ -/* Copyright 2021 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include - -#include "../i2c.dtsi" - -/ { - named-gpios { - /* Skyrim-specific GPIO customizations */ - }; - - named-temp-sensors { - compatible = "cros-ec,temp-sensors"; - soc-pct2075 { - temp_host_high = <100>; - temp_host_halt = <105>; - temp_host_release_high = <80>; - temp_host_release_halt = <80>; - temp_fan_off = <35>; - temp_fan_max = <70>; - power-good-pin = <&gpio_pg_pwr_s5>; - sensor = <&soc_pct2075>; - }; - amb-pct2075 { - power-good-pin = <&gpio_pg_pwr_s5>; - sensor = <&amb_pct2075>; - }; - }; - - /* - * Note this is expected to vary per-board, so we keep it in the board - * dts files. - */ - skyrim-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>; - }; - io-db-none-anx7483 { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_IO_DB_NONE_ANX7483"; - value = <1>; - default; - }; - }; - - /* - * 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; - }; - charger-option-isl9538 { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_CHARGER_ISL9538"; - value = <1>; - }; - }; - }; - - /* Rotation matrices for motion sensors. */ - motionsense-rotation-ref { - compatible = "cros-ec,motionsense-rotation-ref"; - lid_rot_ref: lid-rotation-ref { - mat33 = <0 (-1) 0 - 1 0 0 - 0 0 1>; - }; - - lid_rot_ref1: lid-rotation-ref1 { - mat33 = <0 1 0 - (-1) 0 0 - 0 0 1>; - }; - - base_rot_ref: base-rotation-ref { - mat33 = <0 1 0 - (-1) 0 0 - 0 0 1>; - }; - }; - - ppc_port0: aoz1380 { - compatible = "aoz,aoz1380"; - status = "okay"; - }; -}; - -&i2c0_0 { - anx7483_port0: anx7483@3e { - compatible = "analogix,anx7483"; - reg = <0x3e>; - board-set = "board_anx7483_c0_mux_set"; - flags = ; - }; -}; - -&i2c1_0 { - anx7483_port1: anx7483@3e { - compatible = "analogix,anx7483"; - reg = <0x3e>; - board-set = "board_anx7483_c1_mux_set"; - flags = ; - }; - ppc_port1: nx20p348x@71 { - compatible = "nxp,nx20p348x"; - status = "okay"; - reg = <0x71>; - }; - ps8818_port1: ps8818@28 { - compatible = "parade,ps8818"; - reg = <0x28>; - flags = <(USB_MUX_FLAG_RESETS_IN_G3)>; - board-set = "board_c1_ps8818_mux_set"; - }; -}; - -&i2c4_1 { - charger: isl9241@9 { - compatible = "intersil,isl9241"; - 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"; - usb-muxes = <&amd_fp6_port0 &anx7483_port0>; - }; -}; - -&usbc_port1 { - ppc = <&ppc_port1>; - usb-mux-chain-1-anx { - compatible = "cros-ec,usb-mux-chain"; - usb-muxes = <&amd_fp6_port1 &anx7483_port1>; - }; - usb_mux_chain_ps8818_port1: usb-mux-chain-1-ps { - compatible = "cros-ec,usb-mux-chain"; - usb-muxes = <&amd_fp6_port1 &ps8818_port1>; - alternative-chain; - }; -}; diff --git a/zephyr/program/skyrim/usbc.dtsi b/zephyr/program/skyrim/usbc.dtsi index 8486927e8d..a5fb5a88af 100644 --- a/zephyr/program/skyrim/usbc.dtsi +++ b/zephyr/program/skyrim/usbc.dtsi @@ -14,6 +14,12 @@ bc12 = <&bc12_port0>; tcpc = <&tcpc_port0>; chg = <&charger>; + chg_alt = <&alt_charger>; + ppc = <&ppc_port0>; + usb-mux-chain-0 { + compatible = "cros-ec,usb-mux-chain"; + usb-muxes = <&amd_fp6_port0 &anx7483_port0>; + }; }; usbc_port1: port1@1 { @@ -21,6 +27,16 @@ reg = <1>; bc12 = <&bc12_port1>; tcpc = <&tcpc_port1>; + ppc = <&ppc_port1>; + usb-mux-chain-1-anx { + compatible = "cros-ec,usb-mux-chain"; + usb-muxes = <&amd_fp6_port1 &anx7483_port1>; + }; + usb_mux_chain_ps8818_port1: usb-mux-chain-1-ps { + compatible = "cros-ec,usb-mux-chain"; + usb-muxes = <&amd_fp6_port1 &ps8818_port1>; + alternative-chain; + }; }; }; }; diff --git a/zephyr/program/skyrim/winterhold/battery.dtsi b/zephyr/program/skyrim/winterhold/battery.dtsi deleted file mode 100644 index 8e82e0d1f2..0000000000 --- a/zephyr/program/skyrim/winterhold/battery.dtsi +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright 2021 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/ { - batteries { - default_battery: lgc_xphx8 { - compatible = "lgc,xphx8", "battery-smart"; - }; - smp_atlxdy9k { - compatible = "smp,atlxdy9k", "battery-smart"; - }; - smp_cosxdy9k { - compatible = "smp,cosxdy9k", "battery-smart"; - }; - byd_wv3k8 { - compatible = "byd,wv3k8", "battery-smart"; - }; - cosmx_mvk11 { - compatible = "cosmx,mvk11", "battery-smart"; - }; - sunwoda_atlvkyjx { - compatible = "sunwoda,atlvkyjx", "battery-smart"; - }; - sunwoda_cosvkyjx { - compatible = "sunwoda,cosvkyjx", "battery-smart"; - }; - atl_cfd72 { - compatible = "atl,cfd72", "battery-smart"; - }; - }; -}; diff --git a/zephyr/program/skyrim/winterhold/project.overlay b/zephyr/program/skyrim/winterhold/project.overlay index 9a13a1a3cd..4ff49e81cc 100644 --- a/zephyr/program/skyrim/winterhold/project.overlay +++ b/zephyr/program/skyrim/winterhold/project.overlay @@ -7,13 +7,175 @@ #include "../adc.dtsi" #include "../fan.dtsi" #include "../gpio.dtsi" +#include "../i2c.dtsi" #include "../interrupts.dtsi" #include "../keyboard.dtsi" #include "../usbc.dtsi" /* winterhold project DTS includes*/ -#include "winterhold.dtsi" -#include "battery.dtsi" #include "led_pins.dtsi" #include "led_policy.dtsi" #include "motionsense.dtsi" + +/* Winterhold overrides follow... */ +/ { + /* battery overrides */ + batteries { + default_battery: lgc_xphx8 { + compatible = "lgc,xphx8", "battery-smart"; + }; + smp_atlxdy9k { + compatible = "smp,atlxdy9k", "battery-smart"; + }; + smp_cosxdy9k { + compatible = "smp,cosxdy9k", "battery-smart"; + }; + byd_wv3k8 { + compatible = "byd,wv3k8", "battery-smart"; + }; + cosmx_mvk11 { + compatible = "cosmx,mvk11", "battery-smart"; + }; + sunwoda_atlvkyjx { + compatible = "sunwoda,atlvkyjx", "battery-smart"; + }; + sunwoda_cosvkyjx { + compatible = "sunwoda,cosvkyjx", "battery-smart"; + }; + atl_cfd72 { + compatible = "atl,cfd72", "battery-smart"; + }; + }; + + named-gpios { + /* Winterhold-specific GPIO customizations */ + }; + + named-temp-sensors { + compatible = "cros-ec,temp-sensors"; + soc-pct2075 { + temp_host_high = <105>; + temp_host_halt = <110>; + temp_host_release_high = <95>; + temp_host_release_halt = <100>; + power-good-pin = <&gpio_pg_pwr_s5>; + sensor = <&soc_pct2075>; + }; + amb-pct2075 { + temp_host_warn = <50>; + temp_host_high = <105>; + temp_host_halt = <110>; + temp_host_release_warn = <45>; + temp_host_release_high = <95>; + temp_host_release_halt = <100>; + temp_fan_off = <35>; + temp_fan_max = <40>; + power-good-pin = <&gpio_pg_pwr_s5>; + sensor = <&amb_pct2075>; + }; + }; + + /* + * Note this is expected to vary per-board, so we keep it in the overlay + * files. + */ + Winterhold-fw-config { + compatible = "cros-ec,cbi-fw-config"; + + /* + * FW_CONFIG field to enable KB back light or not. + */ + kb-bl { + enum-name = "FW_KB_BL"; + start = <1>; + size = <1>; + + no-kb-bl { + compatible = "cros-ec,cbi-fw-config-value"; + enum-name = "FW_KB_BL_NOT_PRESENT"; + value = <0>; + }; + kb-bl-present { + compatible = "cros-ec,cbi-fw-config-value"; + enum-name = "FW_KB_BL_PRESENT"; + value = <1>; + }; + }; + }; + + /* Rotation matrices for motion sensors. */ + motionsense-rotation-ref { + compatible = "cros-ec,motionsense-rotation-ref"; + lid_rot_ref: lid-rotation-ref { + mat33 = <0 (-1) 0 + 1 0 0 + 0 0 1>; + }; + + base_rot_ref: base-rotation-ref { + mat33 = <0 1 0 + (-1) 0 0 + 0 0 1>; + }; + }; +}; + +/*i2c overrides */ +&i2c1_0 { + /delete-node/ ps8818@28; +}; + +&i2c4_1 { + /delete-node/ isl9241@9; + /delete-node/ isl9538@9; + charger: isl9238@9 { + compatible = "intersil,isl923x"; + status = "okay"; + reg = <0x9>; + }; +}; + +/* usbc overrides */ +&usbc_port0 { + /delete-property/ chg_alt; +}; + +&usbc_port1 { + /delete-node/ usb-mux-chain-1-ps; +}; + +/* fan overrides */ +&fan0 { + pwms = <&pwm0 0 PWM_KHZ(2) PWM_POLARITY_NORMAL>; + rpm_min = <2100>; + rpm_start = <2600>; + rpm_max = <4800>; +}; + +/* temperature sensor overrides */ +&temp_sensor_charger { + temp_host_high = <100>; + temp_host_halt = <110>; + temp_host_release_high = <90>; + temp_host_release_halt = <100>; +}; + +&temp_sensor_memory { + temp_host_high = <91>; + temp_host_halt = <96>; + temp_host_release_high = <81>; + temp_host_release_halt = <86>; +}; + +&temp_sensor_cpu { + /delete-property/ temp_host_high; + /delete-property/ temp_host_halt; + /delete-property/ temp_host_release_high; + /delete-property/ temp_fan_off; + /delete-property/ temp_fan_max; +}; + +/* handler overrides */ +&int_accel_gyro { + handler = "base_accel_interrupt"; +}; diff --git a/zephyr/program/skyrim/winterhold/winterhold.dtsi b/zephyr/program/skyrim/winterhold/winterhold.dtsi deleted file mode 100644 index a831cd9500..0000000000 --- a/zephyr/program/skyrim/winterhold/winterhold.dtsi +++ /dev/null @@ -1,168 +0,0 @@ -/* Copyright 2021 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include - -#include "../i2c.dtsi" - -/ { - named-gpios { - /* Winterhold-specific GPIO customizations */ - }; - - named-temp-sensors { - compatible = "cros-ec,temp-sensors"; - soc-pct2075 { - temp_host_high = <105>; - temp_host_halt = <110>; - temp_host_release_high = <95>; - temp_host_release_halt = <100>; - power-good-pin = <&gpio_pg_pwr_s5>; - sensor = <&soc_pct2075>; - }; - amb-pct2075 { - temp_host_warn = <50>; - temp_host_high = <105>; - temp_host_halt = <110>; - temp_host_release_warn = <45>; - temp_host_release_high = <95>; - temp_host_release_halt = <100>; - temp_fan_off = <35>; - temp_fan_max = <40>; - power-good-pin = <&gpio_pg_pwr_s5>; - sensor = <&amb_pct2075>; - }; - }; - - /* - * Note this is expected to vary per-board, so we keep it in the board - * dts files. - */ - Winterhold-fw-config { - compatible = "cros-ec,cbi-fw-config"; - - /* - * FW_CONFIG field to enable KB back light or not. - */ - kb-bl { - enum-name = "FW_KB_BL"; - start = <1>; - size = <1>; - - no-kb-bl { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_KB_BL_NOT_PRESENT"; - value = <0>; - }; - kb-bl-present { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_KB_BL_PRESENT"; - value = <1>; - }; - }; - }; - - /* Rotation matrices for motion sensors. */ - motionsense-rotation-ref { - compatible = "cros-ec,motionsense-rotation-ref"; - lid_rot_ref: lid-rotation-ref { - mat33 = <0 (-1) 0 - 1 0 0 - 0 0 1>; - }; - - base_rot_ref: base-rotation-ref { - mat33 = <0 1 0 - (-1) 0 0 - 0 0 1>; - }; - }; -}; - -&i2c0_0 { - anx7483_port0: anx7483@3e { - compatible = "analogix,anx7483"; - reg = <0x3e>; - board-set = "board_anx7483_c0_mux_set"; - flags = ; - }; - ppc_port0: nx20p348x@71 { - compatible = "nxp,nx20p348x"; - status = "okay"; - reg = <0x71>; - }; -}; - -&i2c1_0 { - anx7483_port1: anx7483@3e { - compatible = "analogix,anx7483"; - reg = <0x3e>; - board-set = "board_anx7483_c1_mux_set"; - flags = ; - }; - ppc_port1: nx20p348x@71 { - compatible = "nxp,nx20p348x"; - status = "okay"; - reg = <0x71>; - }; -}; - -&i2c4_1 { - charger: isl9238@9 { - compatible = "intersil,isl923x"; - status = "okay"; - reg = <0x9>; - }; -}; - -&usbc_port0 { - ppc = <&ppc_port0>; - usb-mux-chain-0 { - compatible = "cros-ec,usb-mux-chain"; - usb-muxes = <&amd_fp6_port0 &anx7483_port0>; - }; -}; - -&usbc_port1 { - ppc = <&ppc_port1>; - usb-mux-chain-1-anx { - compatible = "cros-ec,usb-mux-chain"; - usb-muxes = <&amd_fp6_port1 &anx7483_port1>; - }; -}; - -&fan0 { - pwms = <&pwm0 0 PWM_KHZ(2) PWM_POLARITY_NORMAL>; - rpm_min = <2100>; - rpm_start = <2600>; - rpm_max = <4800>; -}; - -&temp_sensor_charger { - temp_host_high = <100>; - temp_host_halt = <110>; - temp_host_release_high = <90>; - temp_host_release_halt = <100>; -}; - -&temp_sensor_memory { - temp_host_high = <91>; - temp_host_halt = <96>; - temp_host_release_high = <81>; - temp_host_release_halt = <86>; -}; - -&temp_sensor_cpu { - /delete-property/ temp_host_high; - /delete-property/ temp_host_halt; - /delete-property/ temp_host_release_high; - /delete-property/ temp_fan_off; - /delete-property/ temp_fan_max; -}; - -/* Override handler */ -&int_accel_gyro { - handler = "base_accel_interrupt"; -}; -- cgit v1.2.1