From 0dea801e9a72f4eb7b34dded8aeca80bda584fd0 Mon Sep 17 00:00:00 2001 From: Andrew McRae Date: Tue, 19 Jul 2022 15:42:17 +1000 Subject: nissa: Rearrange projects into sub-directories Rearrange the projects into separate sub-directories to improve clarity and separation. BUG=none TEST=zmake testall BRANCH=none Signed-off-by: Andrew McRae Change-Id: I14c3324760d195807f831bd72bdbc129fe76912b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3771363 Reviewed-by: Peter Marheine --- zephyr/projects/nissa/craask/overlay.dts | 321 +++++++++++++++++++++++++++++++ 1 file changed, 321 insertions(+) create mode 100644 zephyr/projects/nissa/craask/overlay.dts (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts new file mode 100644 index 0000000000..6a83ee70ad --- /dev/null +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -0,0 +1,321 @@ +/* Copyright 2022 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 + +/ { + aliases { + gpio-cbi-wp = &gpio_ec_cbi_wp; + gpio-wp = &gpio_ec_wp_odl; + int-wp = &int_wp_l; + gpio-kbd-kso2 = &gpio_ec_kso_02_inv; + }; + + ec-console { + compatible = "ec-console"; + disabled = "events", "lpc", "hostcmd"; + }; + + batteries { + default_battery: lgc { + compatible = "lgc,ap18c8k", "battery-smart"; + }; + cosmx { + compatible = "cosmx,ap20cbl", "battery-smart"; + }; + }; + + hibernate-wake-pins { + compatible = "cros-ec,hibernate-wake-pins"; + wakeup-irqs = < + &int_power_button + &int_lid_open + >; + }; + + gpio-interrupts { + compatible = "cros-ec,gpio-interrupts"; + + int_power_button: power_button { + irq-pin = <&gpio_gsc_ec_pwr_btn_odl>; + flags = ; + handler = "power_button_interrupt"; + }; + int_wp_l: wp_l { + irq-pin = <&gpio_ec_wp_odl>; + flags = ; + handler = "switch_interrupt"; + }; + int_lid_open: lid_open { + irq-pin = <&gpio_lid_open>; + flags = ; + handler = "lid_interrupt"; + }; + int_tablet_mode: tablet_mode { + irq-pin = <&gpio_tablet_mode_l>; + flags = ; + handler = "gmr_tablet_switch_isr"; + }; + int_imu: ec_imu { + irq-pin = <&gpio_imu_int_l>; + flags = ; + handler = "lsm6dso_interrupt"; + }; + int_vol_down: vol_down { + irq-pin = <&gpio_voldn_btn_odl>; + flags = ; + handler = "button_interrupt"; + }; + int_vol_up: vol_up { + irq-pin = <&gpio_volup_btn_odl>; + flags = ; + handler = "button_interrupt"; + }; + int_usb_c0: usb_c0 { + irq-pin = <&gpio_usb_c0_int_odl>; + flags = ; + handler = "usb_interrupt"; + }; + int_usb_c1: usb_c1 { + irq-pin = <&gpio_sb_1>; + flags = ; + handler = "usb_interrupt"; + }; + }; + + named-gpios { + gpio_sb_1: sb_1 { + gpios = <&gpio0 2 GPIO_PULL_UP>; + no-auto-init; + }; + + gpio_sb_2: sb_2 { + gpios = <&gpiod 4 GPIO_OUTPUT>; + no-auto-init; + }; + + gpio_sb_3: sb_3 { + gpios = <&gpiof 4 GPIO_OPEN_DRAIN>; + no-auto-init; + }; + gpio_sb_4: sb_4 { + gpios = <&gpiof 5 GPIO_INPUT>; + no-auto-init; + }; + }; + + /* + * Aliases used for sub-board GPIOs. + */ + aliases { + /* + * Input GPIO when used with type-C port 1 + * Output when used with HDMI sub-board + */ + gpio-usb-c1-int-odl = &gpio_sb_1; + gpio-en-rails-odl = &gpio_sb_1; + /* + * Sub-board with type A USB, enable. + */ + gpio-en-usb-a1-vbus = &gpio_sb_2; + /* + * HPD pins for HDMI sub-board. + */ + gpio-hdmi-en-odl = &gpio_sb_3; + gpio-hpd-odl = &gpio_sb_4; + /* + * Enable S5 rails for LTE sub-board + */ + gpio-en-sub-s5-rails = &gpio_sb_2; + }; + + named-temp-sensors { + memory { + compatible = "cros-ec,temp-sensor-thermistor", + "cros-ec,temp-sensor"; + thermistor = <&thermistor_3V3_51K1_47K_4050B>; + enum-name = "TEMP_SENSOR_1"; + temp_fan_off = <35>; + temp_fan_max = <60>; + temp_host_high = <85>; + temp_host_halt = <90>; + temp_host_release_high = <80>; + adc = <&adc_temp_sensor_1>; + power-good-pin = <&gpio_ec_soc_dsw_pwrok>; + }; + charger { + compatible = "cros-ec,temp-sensor-thermistor", + "cros-ec,temp-sensor"; + thermistor = <&thermistor_3V3_51K1_47K_4050B>; + enum-name = "TEMP_SENSOR_2"; + temp_fan_off = <35>; + temp_fan_max = <60>; + temp_host_high = <85>; + temp_host_halt = <90>; + temp_host_release_high = <80>; + adc = <&adc_temp_sensor_2>; + power-good-pin = <&gpio_ec_soc_dsw_pwrok>; + }; + }; + + usba { + compatible = "cros-ec,usba-port-enable-pins"; + /* + * sb_2 is only configured as GPIO when USB-A1 is present, + * but it's still safe to control when disabled. + * + * ILIM_SEL pins are referred to by legacy enum name, + * GPIO_USB*_ILIM_SEL. The one for port A1 is unused on + * sub-boards that don't have USB-A so is safe to control + * regardless of system configuration. + */ + enable-pins = <&gpio_en_usb_a0_vbus &gpio_sb_2>; + status = "okay"; + }; + + usbc { + #address-cells = <1>; + #size-cells = <0>; + + port0@0 { + compatible = "named-usbc-port"; + reg = <0>; + bc12 { + compatible = "pericom,pi3usb9201"; + port = <&i2c_ec_i2c_usb_c0>; + /* + * BC1.2 interrupt is shared with TCPC, so + * IRQ is not specified here and handled by + * usb_c0_interrupt. + */ + }; + chg { + compatible = "intersil,isl923x"; + status = "okay"; + port = <&i2c_ec_i2c_usb_c0>; + }; + usb-muxes = <&virtual_mux_0>; + }; + port0-muxes { + virtual_mux_0: virtual-mux-0 { + compatible = "cros-ec,usbc-mux-virtual"; + }; + }; + /* + * TODO(b:211693800): port1 may not be present on some + * sub-boards. + */ + port1@1 { + compatible = "named-usbc-port"; + reg = <1>; + bc12 { + compatible = "pericom,pi3usb9201"; + port = <&i2c_ec_i2c_sub_usb_c1>; + }; + chg { + compatible = "intersil,isl923x"; + status = "okay"; + port = <&i2c_ec_i2c_sub_usb_c1>; + }; + /* + * Some sub-boards may disable all usb muxes in chain + * except virtual_mux_1 + */ + usb-muxes = <&virtual_mux_1 &anx7483_mux_1>; + }; + port1-muxes { + virtual_mux_1: virtual-mux-1 { + compatible = "cros-ec,usbc-mux-virtual"; + }; + anx7483_mux_1: anx7483-mux-1 { + compatible = "analogix,anx7483"; + port = <&i2c_ec_i2c_sub_usb_c1>; + i2c-addr-flags = "ANX7483_I2C_ADDR0_FLAGS"; + }; + }; + }; + + kblight { + compatible = "cros-ec,kblight-pwm"; + pwms = <&pwm6 6 PWM_KHZ(10) PWM_POLARITY_NORMAL>; + }; + + /* + * Set I2C pins for type C sub-board to be + * low voltage (I2C5_1). + * We do this for all boards, since the pins are + * 3.3V tolerant, and the only 2 types of sub-boards + * used on nivviks both have type-C ports on them. + */ + def-lvol-io-list { + compatible = "nuvoton,npcx-lvolctrl-def"; + lvol-io-pads = <&lvol_iof5 &lvol_iof4>; + }; +}; + +&thermistor_3V3_51K1_47K_4050B { + status = "okay"; +}; + +&adc_ec_vsense_pp3300_s5 { + /* + * Voltage divider on input has 47k upper and 220k lower legs with + * 2714 mV full-scale reading on the ADC. Apply the largest possible + * multiplier (without overflowing int32) to get the best possible + * approximation of the actual ratio, but derate by a factor of two to + * ensure unexpectedly high values won't overflow. + */ + mul = <(791261 / 2)>; + div = <(651975 / 2)>; +}; + +/* Set bus speeds for I2C */ +&i2c0_0 { + label = "I2C_EEPROM"; + clock-frequency = ; + + cbi_eeprom: eeprom@50 { + compatible = "atmel,at24"; + reg = <0x50>; + label = "EEPROM_CBI"; + size = <2048>; + pagesize = <16>; + address-width = <8>; + timeout = <5>; + }; +}; + +&i2c1_0 { + label = "I2C_SENSOR"; + clock-frequency = ; +}; + +&i2c3_0 { + label = "I2C_USB_C0_TCPC"; + clock-frequency = ; +}; + +&i2c5_1 { + label = "I2C_SUB_C1_TCPC"; + clock-frequency = ; +}; + +&i2c7_0 { + label = "I2C_BATTERY"; + clock-frequency = ; +}; + +&pwm6 { + status = "okay"; + pinctrl-0 = <&pwm6_gpc0>; + pinctrl-names = "default"; +}; + +/* host interface */ +&espi0 { + status = "okay"; + pinctrl-0 = <&espi_lpc_gp46_47_51_52_53_54_55_57>; + pinctrl-names = "default"; +}; -- cgit v1.2.1 From 5643b1b844ec73d02e8d8b1702c0385379e7e453 Mon Sep 17 00:00:00 2001 From: Andrew McRae Date: Wed, 20 Jul 2022 18:19:37 +1000 Subject: nissa: Use low freq clock for keyboard backlight Use low frequency clock for keyboard backlight so that PWM clock does not get turned off when power management turns off the main clocks. BUG=b:230427574 TEST=zmake build nivviks; flash & run on Nirwen BRANCH=none Change-Id: I48bfe4cfaf2095b2b208a0ff6161cd868e6b31f4 Signed-off-by: Andrew McRae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3775276 Reviewed-by: Peter Marheine --- zephyr/projects/nissa/craask/overlay.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index 6a83ee70ad..de191cba3a 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -239,7 +239,7 @@ kblight { compatible = "cros-ec,kblight-pwm"; - pwms = <&pwm6 6 PWM_KHZ(10) PWM_POLARITY_NORMAL>; + pwms = <&pwm6 6 PWM_HZ(2400) PWM_POLARITY_NORMAL>; }; /* @@ -309,6 +309,7 @@ &pwm6 { status = "okay"; + clock-bus = "NPCX_CLOCK_BUS_LFCLK"; pinctrl-0 = <&pwm6_gpc0>; pinctrl-names = "default"; }; -- cgit v1.2.1 From aa38dd8c6aa0f72d947fc1559a93ac3f531eae34 Mon Sep 17 00:00:00 2001 From: Mulin Chao Date: Tue, 19 Jul 2022 23:33:57 -0700 Subject: zephyr: craask: add GPIO_VOLTAGE_1P8 flag support Add GPIO_VOLTAGE_1P8 flag support at the related board DT file and remove unused def-lvol-io-list node. BRANCH=none BUG=b:239636081 TEST=Passed 'zmake build craask --clobber' Signed-off-by: Mulin Chao Cq-Depend: chromium:3782768, chromium:3782769, chromium:3782770 Change-Id: Ib57a17e73ba5de19c36b12d06ade04898da9a4a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3775792 Reviewed-by: Jack Rosenthal Reviewed-by: Fabio Baltieri Commit-Queue: Keith Short Reviewed-by: Keith Short --- zephyr/projects/nissa/craask/overlay.dts | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index de191cba3a..7fa09ec99c 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -86,22 +86,28 @@ }; named-gpios { - gpio_sb_1: sb_1 { + gpio_sb_1: sb-1 { gpios = <&gpio0 2 GPIO_PULL_UP>; no-auto-init; }; - gpio_sb_2: sb_2 { + gpio_sb_2: sb-2 { gpios = <&gpiod 4 GPIO_OUTPUT>; no-auto-init; }; - gpio_sb_3: sb_3 { - gpios = <&gpiof 4 GPIO_OPEN_DRAIN>; + /* + * Set I2C pins for type C sub-board to be low voltage (I2C5_1). + * We do this for all boards, since the pins are 3.3V tolerant, + * and the only 2 types of sub-boards used on nivviks both have + * type-C ports on them. + */ + gpio_sb_3: sb-3 { + gpios = <&gpiof 4 (GPIO_OPEN_DRAIN | GPIO_VOLTAGE_1P8)>; no-auto-init; }; - gpio_sb_4: sb_4 { - gpios = <&gpiof 5 GPIO_INPUT>; + gpio_sb_4: sb-4 { + gpios = <&gpiof 5 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>; no-auto-init; }; }; @@ -241,18 +247,6 @@ compatible = "cros-ec,kblight-pwm"; pwms = <&pwm6 6 PWM_HZ(2400) PWM_POLARITY_NORMAL>; }; - - /* - * Set I2C pins for type C sub-board to be - * low voltage (I2C5_1). - * We do this for all boards, since the pins are - * 3.3V tolerant, and the only 2 types of sub-boards - * used on nivviks both have type-C ports on them. - */ - def-lvol-io-list { - compatible = "nuvoton,npcx-lvolctrl-def"; - lvol-io-pads = <&lvol_iof5 &lvol_iof4>; - }; }; &thermistor_3V3_51K1_47K_4050B { -- cgit v1.2.1 From 6d9aa696047593d686b4cbf7c80504584d6fdb81 Mon Sep 17 00:00:00 2001 From: Dawid Niedzwiecki Date: Fri, 15 Jul 2022 14:30:33 +0200 Subject: zephyr: move bc12 node under i2c bus Move all bc12 nodes under the i2c bus nodes instead of named-usbc-port nodes. The change should simplify the upstream process of the bc12 chip drivers. BUG=b:228240586 TEST=zmake testall; make sure all bc12 chip works BRANCH=main Signed-off-by: Dawid Niedzwiecki Change-Id: Icbf961ccc3846da53c3841bb616c3706a1876b53 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3763906 Reviewed-by: Keith Short Commit-Queue: Keith Short --- zephyr/projects/nissa/craask/overlay.dts | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index 7fa09ec99c..d3614a6946 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -188,15 +188,7 @@ port0@0 { compatible = "named-usbc-port"; reg = <0>; - bc12 { - compatible = "pericom,pi3usb9201"; - port = <&i2c_ec_i2c_usb_c0>; - /* - * BC1.2 interrupt is shared with TCPC, so - * IRQ is not specified here and handled by - * usb_c0_interrupt. - */ - }; + bc12 = <&bc12_port0>; chg { compatible = "intersil,isl923x"; status = "okay"; @@ -216,10 +208,7 @@ port1@1 { compatible = "named-usbc-port"; reg = <1>; - bc12 { - compatible = "pericom,pi3usb9201"; - port = <&i2c_ec_i2c_sub_usb_c1>; - }; + bc12 = <&bc12_port1>; chg { compatible = "intersil,isl923x"; status = "okay"; @@ -289,11 +278,28 @@ &i2c3_0 { label = "I2C_USB_C0_TCPC"; clock-frequency = ; + + bc12_port0: pi3usb9201@5f { + compatible = "pericom,pi3usb9201"; + status = "okay"; + reg = <0x5f>; + /* + * BC1.2 interrupt is shared with TCPC, so + * IRQ is not specified here and handled by + * usb_c0_interrupt. + */ + }; }; &i2c5_1 { label = "I2C_SUB_C1_TCPC"; clock-frequency = ; + + bc12_port1: pi3usb9201@5f { + compatible = "pericom,pi3usb9201"; + status = "okay"; + reg = <0x5f>; + }; }; &i2c7_0 { -- cgit v1.2.1 From 1e2bbe54e05fc53aa99a9f5b76c2e6563ce483c7 Mon Sep 17 00:00:00 2001 From: Andrew McRae Date: Tue, 26 Jul 2022 23:52:56 +1000 Subject: nissa: craask: Add config for temp sensor 3 Add configuration for temp sensor 3 BUG=b:240234369 TEST=zmake build craask BRANCH=none Signed-off-by: Andrew McRae Change-Id: I9246b863308d3c56badb02d4b94b578a530909cd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3787979 Reviewed-by: Peter Marheine --- zephyr/projects/nissa/craask/overlay.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index d3614a6946..2d7c904a9d 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -164,6 +164,19 @@ adc = <&adc_temp_sensor_2>; power-good-pin = <&gpio_ec_soc_dsw_pwrok>; }; + ambient { + compatible = "cros-ec,temp-sensor-thermistor", + "cros-ec,temp-sensor"; + thermistor = <&thermistor_3V3_51K1_47K_4050B>; + enum-name = "TEMP_SENSOR_3"; + temp_fan_off = <35>; + temp_fan_max = <60>; + temp_host_high = <85>; + temp_host_halt = <90>; + temp_host_release_high = <80>; + adc = <&adc_temp_sensor_3>; + power-good-pin = <&gpio_ec_soc_dsw_pwrok>; + }; }; usba { -- cgit v1.2.1 From 8c95f2bd1e4ec646ca5c39fe625c5e9701b4245a Mon Sep 17 00:00:00 2001 From: Dawid Niedzwiecki Date: Tue, 2 Aug 2022 15:27:55 +0200 Subject: zephyr: move charger nodes onto i2c buses Move all charger nodes onto the i2c buses from named-usbc-port nodes. The change should simplify the upstream process of the charger chips drivers. BUG=b:241062565 TEST=zmake testall; make sure charging works BRANCH=main Signed-off-by: Dawid Niedzwiecki Change-Id: I5c8e358cc56d5fd7b5a91971d41e4269e84e949e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3805199 Reviewed-by: Keith Short Commit-Queue: Keith Short --- zephyr/projects/nissa/craask/overlay.dts | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index 2d7c904a9d..180a2596a5 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -202,11 +202,7 @@ compatible = "named-usbc-port"; reg = <0>; bc12 = <&bc12_port0>; - chg { - compatible = "intersil,isl923x"; - status = "okay"; - port = <&i2c_ec_i2c_usb_c0>; - }; + chg = <&chg_port0>; usb-muxes = <&virtual_mux_0>; }; port0-muxes { @@ -222,11 +218,7 @@ compatible = "named-usbc-port"; reg = <1>; bc12 = <&bc12_port1>; - chg { - compatible = "intersil,isl923x"; - status = "okay"; - port = <&i2c_ec_i2c_sub_usb_c1>; - }; + chg = <&chg_port1>; /* * Some sub-boards may disable all usb muxes in chain * except virtual_mux_1 @@ -302,6 +294,12 @@ * usb_c0_interrupt. */ }; + + chg_port0: isl923x@9 { + compatible = "intersil,isl923x"; + status = "okay"; + reg = <0x9>; + }; }; &i2c5_1 { @@ -313,6 +311,12 @@ status = "okay"; reg = <0x5f>; }; + + chg_port1: isl923x@9 { + compatible = "intersil,isl923x"; + status = "okay"; + reg = <0x9>; + }; }; &i2c7_0 { -- cgit v1.2.1 From 1de7776337965b5174215579fcc12bc40cea2826 Mon Sep 17 00:00:00 2001 From: Sue Chen Date: Fri, 5 Aug 2022 16:47:43 +0800 Subject: Craask: Setting few GPIOs to 1.8V Few GPIO's which operate at 1.8v need to set GPIO_VOLTAGE_1P8. This improves in EC power consumption in S0ix mode. For b/228222441, there is no difference on hardware design of these GPIOs between Nivviks and Craask so Craask also need the change CL:3702877. BUG=none BRANCH=none TEST=Verified S0ix on nivviks Signed-off-by: Sue Chen Change-Id: Ie41aebf5511ab7f72cc5ffedec5b47aa9a807f5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3813234 Reviewed-by: Andrew McRae --- zephyr/projects/nissa/craask/overlay.dts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index 180a2596a5..4ffbf2dc01 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -110,6 +110,12 @@ gpios = <&gpiof 5 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>; no-auto-init; }; + ec-i2c-sensor-scl { + gpios = <&gpio9 0 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>; + }; + ec-i2c-sensor-sda { + gpios = <&gpio8 7 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>; + }; }; /* -- cgit v1.2.1 From 86906e94b2bd9a1e6b012225680e12cd266d4686 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Tue, 19 Jul 2022 13:40:05 +0000 Subject: zephyr: shim: drop the EEPROM_CBI label The node is referenced using the cbi_eeprom nodelabel already so the label here is redundant. BRANCH=none BUG=b:239165779 TEST=zmake testall Signed-off-by: Fabio Baltieri Cq-Depend: chromium:3776882 Change-Id: Ice9f3df7ed9874176252872dcd31a3adb25fac7b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3776917 Reviewed-by: Jeremy Bettis --- zephyr/projects/nissa/craask/overlay.dts | 1 - 1 file changed, 1 deletion(-) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index 4ffbf2dc01..bb2c5977d2 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -273,7 +273,6 @@ cbi_eeprom: eeprom@50 { compatible = "atmel,at24"; reg = <0x50>; - label = "EEPROM_CBI"; size = <2048>; pagesize = <16>; address-width = <8>; -- cgit v1.2.1 From 3f4f5eed97ee6160b676fc396af63b2503c9c734 Mon Sep 17 00:00:00 2001 From: Sue Chen Date: Fri, 26 Aug 2022 09:07:21 +0800 Subject: Craask: New gauge IC for battery AP20CBL AP20CBL new gauge IC to solve watchdog timeout issue. Add cosmx,ap20cbl-2.yaml to define it as another battery for Craask. BUG=b:243772306 BRANCH=none TEST=battery information, cut off and resume work fine Signed-off-by: Sue Chen Change-Id: I23d340578a4f28bfcbf774baf2bb6bbcedfff2c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3858764 Reviewed-by: Andrew McRae --- zephyr/projects/nissa/craask/overlay.dts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index bb2c5977d2..de53e07d46 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -25,6 +25,9 @@ cosmx { compatible = "cosmx,ap20cbl", "battery-smart"; }; + cosmx-2 { + compatible = "cosmx,ap20cbl-2", "battery-smart"; + }; }; hibernate-wake-pins { -- cgit v1.2.1 From 8a6b84e62e3d717646bfc8764755a21c1b9a68c5 Mon Sep 17 00:00:00 2001 From: Dawid Niedzwiecki Date: Wed, 10 Aug 2022 14:11:20 +0200 Subject: zephyr: move mux nodes onto i2c buses Move all USB-C mux nodes onto the i2c buses from named-usbc-port nodes. The change should simplify the upstream process of the mux chips drivers. BUG=b:240618099 TEST=zmake build -a; make sure usb-c works BRANCH=main Signed-off-by: Dawid Niedzwiecki Change-Id: Ieab80f2ccf2f47f93597e90f5afbda8072b71d49 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3827181 Reviewed-by: Tomasz Michalec Commit-Queue: Keith Short Reviewed-by: Keith Short --- zephyr/projects/nissa/craask/overlay.dts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index de53e07d46..da13800082 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -238,11 +238,6 @@ virtual_mux_1: virtual-mux-1 { compatible = "cros-ec,usbc-mux-virtual"; }; - anx7483_mux_1: anx7483-mux-1 { - compatible = "analogix,anx7483"; - port = <&i2c_ec_i2c_sub_usb_c1>; - i2c-addr-flags = "ANX7483_I2C_ADDR0_FLAGS"; - }; }; }; @@ -325,6 +320,11 @@ status = "okay"; reg = <0x9>; }; + + anx7483_mux_1: anx7483-mux-1@3e { + compatible = "analogix,anx7483"; + reg = <0x3e>; + }; }; &i2c7_0 { -- cgit v1.2.1 From 2effa3959bcc08845eb095d978b3186fea8a7d60 Mon Sep 17 00:00:00 2001 From: Sue Chen Date: Thu, 11 Aug 2022 10:00:04 +0800 Subject: Craask: add 2nd source for BASE sensor Use SSFC bit 4-5 to identify BASE SENEOR 0: lsm6dso 1: bmi323 BUG=b:240040384 BRANCH=none TEST=can read raw data from bmi323 after setting ssfc=0x10 Signed-off-by: Sue Chen Change-Id: Ie9109cd8a13e782718b3abeb931c6b707804794c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3823545 Reviewed-by: Andrew McRae --- zephyr/projects/nissa/craask/overlay.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index da13800082..24cce5b561 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -64,7 +64,7 @@ int_imu: ec_imu { irq-pin = <&gpio_imu_int_l>; flags = ; - handler = "lsm6dso_interrupt"; + handler = "motion_interrupt"; }; int_vol_down: vol_down { irq-pin = <&gpio_voldn_btn_odl>; -- cgit v1.2.1 From 71b2ef709dcb14260f5fdaa3ab4ced005a29fb46 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 12 Sep 2022 14:54:36 -0400 Subject: Update license boilerplate text in source code files Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis Reviewed-by: Jack Rosenthal --- zephyr/projects/nissa/craask/overlay.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index 24cce5b561..e1f58ef395 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -1,4 +1,4 @@ -/* Copyright 2022 The Chromium OS Authors. All rights reserved. +/* 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. */ -- cgit v1.2.1 From 713e44a1648853db8b4fb936faa6d349e858ec01 Mon Sep 17 00:00:00 2001 From: Tomasz Michalec Date: Wed, 20 Jul 2022 14:02:43 +0200 Subject: zephyr: nissa: usb_mux: Split struct usb_mux in nissa boards Update nissa boards to use new struct usb_mux_chain. BUG=b:236274003 TEST=zmake build -a TEST=./twister -T zephyr/test BRANCH=None Cq-Depend: chromium:3779618 Signed-off-by: Tomasz Michalec Change-Id: Icf0dbef327d8cc5172fef960b6cecb792e1eb887 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3780417 Reviewed-by: Keith Short Code-Coverage: Zoss Tested-by: Tomasz Michalec Commit-Queue: Tomasz Michalec --- zephyr/projects/nissa/craask/overlay.dts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index e1f58ef395..908fd2411d 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -212,7 +212,10 @@ reg = <0>; bc12 = <&bc12_port0>; chg = <&chg_port0>; - usb-muxes = <&virtual_mux_0>; + usb-mux-chain-0 { + compatible = "cros-ec,usb-mux-chain"; + usb-muxes = <&virtual_mux_0>; + }; }; port0-muxes { virtual_mux_0: virtual-mux-0 { @@ -228,11 +231,14 @@ reg = <1>; bc12 = <&bc12_port1>; chg = <&chg_port1>; - /* - * Some sub-boards may disable all usb muxes in chain - * except virtual_mux_1 - */ - usb-muxes = <&virtual_mux_1 &anx7483_mux_1>; + usb-mux-chain-1 { + compatible = "cros-ec,usb-mux-chain"; + /* + * Some sub-boards may disable all usb muxes in + * chain except virtual_mux_1 + */ + usb-muxes = <&virtual_mux_1 &anx7483_mux_1>; + }; }; port1-muxes { virtual_mux_1: virtual-mux-1 { -- cgit v1.2.1 From 3d9a7315e04871a8e5694dd9f53499086dcb1211 Mon Sep 17 00:00:00 2001 From: Tomasz Michalec Date: Mon, 5 Sep 2022 19:30:42 +0200 Subject: zephyr: Add alternative usb_mux_chain config for nissa Add alternative USB mux configuration in DTS for nissa. LOW_COVERAGE_REASON=no test for nissa board yet BUG=b:234482311 TEST=zmake build -a TEST=./twister -T zephyr/test BRANCH=none Signed-off-by: Tomasz Michalec Change-Id: Id367005334cc378c7495b615bab5333a72d39bf8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3875325 Commit-Queue: Tomasz Michalec Tested-by: Tomasz Michalec Reviewed-by: Keith Short Reviewed-by: Adam Mills --- zephyr/projects/nissa/craask/overlay.dts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index 908fd2411d..3c54941e9c 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -233,12 +233,13 @@ chg = <&chg_port1>; usb-mux-chain-1 { compatible = "cros-ec,usb-mux-chain"; - /* - * Some sub-boards may disable all usb muxes in - * chain except virtual_mux_1 - */ usb-muxes = <&virtual_mux_1 &anx7483_mux_1>; }; + usb_mux_chain_1_no_mux: usb-mux-chain-1-no-mux { + compatible = "cros-ec,usb-mux-chain"; + alternative-chain; + usb-muxes = <&virtual_mux_1>; + }; }; port1-muxes { virtual_mux_1: virtual-mux-1 { -- cgit v1.2.1 From a95526e34496644c0af54f09ce2de82a1f2661fc Mon Sep 17 00:00:00 2001 From: Dawid Niedzwiecki Date: Wed, 7 Sep 2022 08:24:56 +0200 Subject: zephyr: rework temperature sensors Rework how the temperature sensors are presented in dts files. A temperature sensor has to be declared independently from the named-temp-sensors node. The sensor nodes have to specify all properties that are handled by driver- i2c port/address, used adc channel etc. Children nodes of the named-temp-sensors set meta values needed for EC code like enum-names, power-good-pin and temperature thresholds. Also, every child node has a pointer to a physical temperature sensor. It implicates a different way of indexing the temperature sensors. This change is done to separate defining physical sensors from metadata for EC application and move some sensors onto i2c buses BUG=b:240619570 TEST=zmake build -a && ./twister -T zephyr/test/ && make sure temperature sensors work with the "temps" EC CC BRANCH=main Signed-off-by: Dawid Niedzwiecki Change-Id: Ia0dfc0b98455e8e28233c17d5feff27a7cc5b96d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3879364 Commit-Queue: Dawid Niedzwiecki Code-Coverage: Zoss Reviewed-by: Keith Short --- zephyr/projects/nissa/craask/overlay.dts | 35 ++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index 3c54941e9c..4dab00610c 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -146,45 +146,50 @@ gpio-en-sub-s5-rails = &gpio_sb_2; }; + temp_memory: memory { + compatible = "cros-ec,temp-sensor-thermistor"; + thermistor = <&thermistor_3V3_51K1_47K_4050B>; + adc = <&adc_temp_sensor_1>; + }; + temp_charger: charger { + compatible = "cros-ec,temp-sensor-thermistor"; + thermistor = <&thermistor_3V3_51K1_47K_4050B>; + adc = <&adc_temp_sensor_2>; + }; + temp_ambient: ambient { + compatible = "cros-ec,temp-sensor-thermistor"; + thermistor = <&thermistor_3V3_51K1_47K_4050B>; + adc = <&adc_temp_sensor_3>; + }; + named-temp-sensors { + compatible = "cros-ec,temp-sensors"; memory { - compatible = "cros-ec,temp-sensor-thermistor", - "cros-ec,temp-sensor"; - thermistor = <&thermistor_3V3_51K1_47K_4050B>; - enum-name = "TEMP_SENSOR_1"; temp_fan_off = <35>; temp_fan_max = <60>; temp_host_high = <85>; temp_host_halt = <90>; temp_host_release_high = <80>; - adc = <&adc_temp_sensor_1>; power-good-pin = <&gpio_ec_soc_dsw_pwrok>; + sensor = <&temp_memory>; }; charger { - compatible = "cros-ec,temp-sensor-thermistor", - "cros-ec,temp-sensor"; - thermistor = <&thermistor_3V3_51K1_47K_4050B>; - enum-name = "TEMP_SENSOR_2"; temp_fan_off = <35>; temp_fan_max = <60>; temp_host_high = <85>; temp_host_halt = <90>; temp_host_release_high = <80>; - adc = <&adc_temp_sensor_2>; power-good-pin = <&gpio_ec_soc_dsw_pwrok>; + sensor = <&temp_charger>; }; ambient { - compatible = "cros-ec,temp-sensor-thermistor", - "cros-ec,temp-sensor"; - thermistor = <&thermistor_3V3_51K1_47K_4050B>; - enum-name = "TEMP_SENSOR_3"; temp_fan_off = <35>; temp_fan_max = <60>; temp_host_high = <85>; temp_host_halt = <90>; temp_host_release_high = <80>; - adc = <&adc_temp_sensor_3>; power-good-pin = <&gpio_ec_soc_dsw_pwrok>; + sensor = <&temp_ambient>; }; }; -- cgit v1.2.1 From 60fca7c2143af0f15eb843a6fc57185102b5a7fb Mon Sep 17 00:00:00 2001 From: Diana Z Date: Mon, 19 Sep 2022 18:28:10 -0600 Subject: Zephyr: Remove default anx7483 board set Remove the default declaration of board_set, as boards may need their own tuning in addition to the default tuning. BRANCH=None BUG=b:244457125 TEST=zmake build affected boards Signed-off-by: Diana Z Change-Id: Iedacdfb92417076841fd3c1c0178653c0a58cc60 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3905900 Reviewed-by: Andrew McRae --- zephyr/projects/nissa/craask/overlay.dts | 1 + 1 file changed, 1 insertion(+) (limited to 'zephyr/projects/nissa/craask/overlay.dts') diff --git a/zephyr/projects/nissa/craask/overlay.dts b/zephyr/projects/nissa/craask/overlay.dts index 4dab00610c..b3a510c111 100644 --- a/zephyr/projects/nissa/craask/overlay.dts +++ b/zephyr/projects/nissa/craask/overlay.dts @@ -336,6 +336,7 @@ anx7483_mux_1: anx7483-mux-1@3e { compatible = "analogix,anx7483"; reg = <0x3e>; + board-set = "anx7483_set_default_tuning"; }; }; -- cgit v1.2.1