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/morthal/project.overlay | 147 +++++++++++++++++++++++++- 1 file changed, 145 insertions(+), 2 deletions(-) (limited to 'zephyr/program/skyrim/morthal/project.overlay') 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; +}; -- cgit v1.2.1