diff options
author | YH Lin <yueherngl@chromium.org> | 2022-12-03 00:19:30 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-12-05 17:43:05 +0000 |
commit | c8af732351cc5c7167f27e8390e26f0556f53a5a (patch) | |
tree | bdff671e5ad3e71e30ab56f4f084f34a2fd72e28 /zephyr/projects/npcx_evb/npcx9 | |
parent | af25602b15b22b9ef5821dcba9934311f2157c48 (diff) | |
download | chrome-ec-factory-brya-14517.B-main.tar.gz |
Revert "Merge remote-tracking branch cros/main into factory-brya-14517.B-main"factory-brya-14517.B-main
This reverts commit af25602b15b22b9ef5821dcba9934311f2157c48.
Reason for revert: broken build due to ec-utils.
Original change's description:
> Merge remote-tracking branch cros/main into factory-brya-14517.B-main
>
> Generated by: util/update_release_branch.py --baseboard brya --relevant_paths_file
> baseboard/brya/relevant-paths.txt factory-brya-14517.B-main
>
> Relevant changes:
>
> git log --oneline 54462f034b..aa40b859b3 -- baseboard/brya board/agah
> board/anahera board/banshee board/brya board/crota board/felwinter
> board/gimble board/kano board/mithrax board/osiris board/primus
> board/redrix board/taeko board/taniks board/vell board/volmar
> driver/bc12/pi3usb9201_public.* driver/charger/bq25710.*
> driver/ppc/nx20p348x.* driver/ppc/syv682x_public.*
> driver/retimer/bb_retimer_public.* driver/tcpm/nct38xx.*
> driver/tcpm/ps8xxx_public.* driver/tcpm/tcpci.* include/power/alderlake*
> include/intel_x86.h power/alderlake* power/intel_x86.c
> util/getversion.sh
>
> e6da633c38 driver: Sort header files
> 234a87ae2d tcpci: Add FRS enable to driver structure
> a56be59ccd tcpm_header: add test for tcpm_dump_registers
> 57b3256963 Rename CONFIG_CHARGER_INPUT_CURRENT to _CHARGER_DEFAULT_CURRENT_LIMIT
> e420c8ff9a marasov: Modify TypeC and TypeA configuration.
> 43b53e0045 Add default implementation of board_set_charge_limit
> b75dc90677 Add CONFIG_CHARGER_MIN_INPUT_CURRENT_LIMIT
> f1b563c350 baseboard: Sort header files
> 7d01b1e58d driver/retimer/ps8818.h: Add I2C ADDR FLAGS 0x30, 0x58, 0x70
> ec31407993 Add CONFIG_CHARGER_INPUT_CURRENT_DERATE_PCT
> 8f89f69a5b crota: disable lid angle sensor for clamshell
>
> BRANCH=None
> BUG=b:259002141 b:255184961 b:247100970 b:259354679 b:260630630
> BUG=b:163093572 b:254328661
> TEST=`emerge-brya chromeos-ec`
>
> Force-Relevant-Builds: all
> Change-Id: Ia85a701fbf6b8e67ec214b9e25e0e55e980a6f47
> Signed-off-by: YH Lin <yueherngl@google.com>
Bug: b:259002141 b:255184961 b:247100970 b:259354679 b:260630630
Bug: b:163093572 b:254328661
Change-Id: I48d5aa4cc67a69ee1f6ac9255ac3087d34da4c72
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4077248
Tested-by: YH Lin <yueherngl@chromium.org>
Commit-Queue: YH Lin <yueherngl@chromium.org>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Auto-Submit: YH Lin <yueherngl@chromium.org>
Diffstat (limited to 'zephyr/projects/npcx_evb/npcx9')
-rw-r--r-- | zephyr/projects/npcx_evb/npcx9/BUILD.py | 16 | ||||
-rw-r--r-- | zephyr/projects/npcx_evb/npcx9/CMakeLists.txt | 10 | ||||
-rw-r--r-- | zephyr/projects/npcx_evb/npcx9/fan.dts | 39 | ||||
-rw-r--r-- | zephyr/projects/npcx_evb/npcx9/gpio.dts | 72 | ||||
-rw-r--r-- | zephyr/projects/npcx_evb/npcx9/interrupts.dts | 26 | ||||
-rw-r--r-- | zephyr/projects/npcx_evb/npcx9/keyboard.dts | 42 | ||||
-rw-r--r-- | zephyr/projects/npcx_evb/npcx9/prj.conf | 64 |
7 files changed, 269 insertions, 0 deletions
diff --git a/zephyr/projects/npcx_evb/npcx9/BUILD.py b/zephyr/projects/npcx_evb/npcx9/BUILD.py new file mode 100644 index 0000000000..335f410d9b --- /dev/null +++ b/zephyr/projects/npcx_evb/npcx9/BUILD.py @@ -0,0 +1,16 @@ +# 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. + +"""Define zmake projects for npcx9_evb.""" + +register_npcx_project( + project_name="npcx9", + zephyr_board="npcx9_evb", + dts_overlays=[ + "gpio.dts", + "interrupts.dts", + "fan.dts", + "keyboard.dts", + ], +) diff --git a/zephyr/projects/npcx_evb/npcx9/CMakeLists.txt b/zephyr/projects/npcx_evb/npcx9/CMakeLists.txt new file mode 100644 index 0000000000..ef734c06f6 --- /dev/null +++ b/zephyr/projects/npcx_evb/npcx9/CMakeLists.txt @@ -0,0 +1,10 @@ +# 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. + +cmake_minimum_required(VERSION 3.13.1) + +find_package(Zephyr REQUIRED HINTS "${ZEPHYR_BASE}") +project(npcx9) + +zephyr_include_directories(include) diff --git a/zephyr/projects/npcx_evb/npcx9/fan.dts b/zephyr/projects/npcx_evb/npcx9/fan.dts new file mode 100644 index 0000000000..dc4debdcb9 --- /dev/null +++ b/zephyr/projects/npcx_evb/npcx9/fan.dts @@ -0,0 +1,39 @@ +/* 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. + */ + +/ { + fans { + compatible = "cros-ec,fans"; + + fan_0 { + pwms = <&pwm0 0 PWM_KHZ(25) PWM_POLARITY_NORMAL>; + rpm_min = <1000>; + rpm_start = <1000>; + rpm_max = <5200>; + tach = <&tach1>; + pgood_gpio = <&gpio_pgood_fan>; + }; + }; +}; + +/* Tachometer for fan speed measurement */ +&tach1 { + status = "okay"; + pinctrl-0 = <&ta1_1_in_gp40>; + pinctrl-names = "default"; + port = <NPCX_TACH_PORT_A>; /* port-A is selected */ + sample-clk = <NPCX_TACH_FREQ_LFCLK>; /* Use LFCLK as sampling clock */ + pulses-per-round = <2>; /* number of pulses per round of encoder */ +}; + +&pwm0_gpc3 { + drive-open-drain; +}; + +&pwm0 { + status = "okay"; + pinctrl-0 = <&pwm0_gpc3>; + pinctrl-names = "default"; +}; diff --git a/zephyr/projects/npcx_evb/npcx9/gpio.dts b/zephyr/projects/npcx_evb/npcx9/gpio.dts new file mode 100644 index 0000000000..9a32112471 --- /dev/null +++ b/zephyr/projects/npcx_evb/npcx9/gpio.dts @@ -0,0 +1,72 @@ +/* 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. + */ + +/ { + aliases { + gpio-wp = &gpio_wp; + }; + + named-gpios { + compatible = "named-gpios"; + + recovery_l { + gpios = <&gpio0 3 GPIO_INPUT_PULL_UP>; + }; + gpio_wp: wp_l { + gpios = <&gpio9 3 (GPIO_INPUT_PULL_UP | + GPIO_ACTIVE_LOW)>; + }; + gpio_ac_present: ac_present { + gpios = <&gpiod 2 GPIO_INPUT>; + enum-name = "GPIO_AC_PRESENT"; + }; + gpio_power_button_l: power_button_l { + gpios = <&gpio0 0 GPIO_INPUT>; + enum-name = "GPIO_POWER_BUTTON_L"; + }; + gpio_lid_open: lid_open { + gpios = <&gpio0 1 GPIO_INPUT>; + enum-name = "GPIO_LID_OPEN"; + }; + entering_rw { + gpios = <&gpio3 6 GPIO_OUTPUT_LOW>; + enum-name = "GPIO_ENTERING_RW"; + }; + gpio_ec_pch_wake_odl: pch_wake_l { + gpios = <&gpio5 0 GPIO_OUTPUT_HIGH>; + }; + gpio_pgood_fan: pgood_fan { + gpios = <&gpioc 7 GPIO_INPUT_PULL_UP>; + }; + spi_cs_l { + gpios = <&gpioa 5 GPIO_OUTPUT_HIGH>; + }; + board_version1 { + gpios = <&gpio6 4 GPIO_INPUT>; + enum-name = "GPIO_BOARD_VERSION1"; + }; + board_version2 { + gpios = <&gpio6 5 GPIO_INPUT>; + enum-name = "GPIO_BOARD_VERSION2"; + }; + board_version3 { + gpios = <&gpio6 6 GPIO_INPUT>; + enum-name = "GPIO_BOARD_VERSION3"; + }; + }; +}; + +/* A falling edge detection type for PSL_IN2 */ +&psl_in2_gp00 { + psl-in-mode = "edge"; + psl-in-pol = "low-falling"; +}; + +/* Power domain device controlled by PSL (Power Switch Logic) IO pads */ +&power_ctrl_psl { + status = "okay"; + pinctrl-names = "sleep"; + pinctrl-0 = <&psl_in2_gp00>; +}; diff --git a/zephyr/projects/npcx_evb/npcx9/interrupts.dts b/zephyr/projects/npcx_evb/npcx9/interrupts.dts new file mode 100644 index 0000000000..3e92428ef4 --- /dev/null +++ b/zephyr/projects/npcx_evb/npcx9/interrupts.dts @@ -0,0 +1,26 @@ +/* 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. + */ + +/ { + gpio-interrupts { + compatible = "cros-ec,gpio-interrupts"; + + int_ac_present: ac_present { + irq-pin = <&gpio_ac_present>; + flags = <GPIO_INT_EDGE_BOTH>; + handler = "extpower_interrupt"; + }; + int_lid_open: lid_open { + irq-pin = <&gpio_lid_open>; + flags = <GPIO_INT_EDGE_BOTH>; + handler = "lid_interrupt"; + }; + int_power_button: power_button { + irq-pin = <&gpio_power_button_l>; + flags = <GPIO_INT_EDGE_BOTH>; + handler = "power_button_interrupt"; + }; + }; +}; diff --git a/zephyr/projects/npcx_evb/npcx9/keyboard.dts b/zephyr/projects/npcx_evb/npcx9/keyboard.dts new file mode 100644 index 0000000000..3fb6986f1a --- /dev/null +++ b/zephyr/projects/npcx_evb/npcx9/keyboard.dts @@ -0,0 +1,42 @@ +/* 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. + */ + +/ { + cros-keyscan { + compatible = "cros-keyscan"; + + output-settle = <40>; + debounce-down = <6000>; + scan-period = <1500>; + poll-timeout = <1000000>; + + actual-key-mask = < + 0x14 /* C0 */ + 0xff /* C1 */ + 0xff /* C2 */ + 0xff /* C3 */ + 0xff /* C4 */ + 0xf5 /* C5 */ + 0xff /* C6 */ + 0xa4 /* C7 */ + 0xff /* C8 */ + 0xf6 /* C9 */ + 0x55 /* C10 */ + 0xfa /* C11 */ + 0xc8 /* C12 */ + >; + }; + + kblight { + compatible = "cros-ec,kblight-pwm"; + pwms = <&pwm2 0 PWM_KHZ(10) PWM_POLARITY_NORMAL>; + }; +}; + +&pwm2 { + status = "okay"; + pinctrl-0 = <&pwm2_gpc4>; + pinctrl-names = "default"; +}; diff --git a/zephyr/projects/npcx_evb/npcx9/prj.conf b/zephyr/projects/npcx_evb/npcx9/prj.conf new file mode 100644 index 0000000000..827b6366c6 --- /dev/null +++ b/zephyr/projects/npcx_evb/npcx9/prj.conf @@ -0,0 +1,64 @@ +# 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. + +CONFIG_CROS_EC=y +CONFIG_PLATFORM_EC=y +CONFIG_PLATFORM_EC_BRINGUP=y +CONFIG_PLATFORM_EC_EXTPOWER_GPIO=y +CONFIG_PLATFORM_EC_LID_SWITCH=y +CONFIG_PLATFORM_EC_POWER_BUTTON=y +CONFIG_SHIMMED_TASKS=y + +CONFIG_PLATFORM_EC_BACKLIGHT_LID=n +CONFIG_PLATFORM_EC_SWITCH=n +CONFIG_PLATFORM_EC_VBOOT_EFS2=n +CONFIG_PLATFORM_EC_VSTORE=n + +# Workaround npcx9 A1 chip's bug for download_from_flash API in th booter. +# This can be removed when A2 chip is available. +CONFIG_PLATFORM_EC_WORKAROUND_FLASH_DOWNLOAD_API=y + +# Board version is selected over GPIO board ID pins. +CONFIG_PLATFORM_EC_BOARD_VERSION_GPIO=y + +# PWM +CONFIG_PWM=y + +# Sensors +CONFIG_SENSOR=y +CONFIG_SENSOR_SHELL=n + +# Console command +CONFIG_PLATFORM_EC_CONSOLE_CMD_SCRATCHPAD=y + +CONFIG_TRACING=y +CONFIG_TRACING_ISR=y +CONFIG_TRACING_USER=y +CONFIG_PLATFORM_EC_CONSOLE_CMD_IRQ=y + +# eSPI +CONFIG_ESPI=y +CONFIG_PLATFORM_EC_HOST_INTERFACE_ESPI_VW_SLP_S3=y +CONFIG_PLATFORM_EC_HOST_INTERFACE_ESPI_VW_SLP_S4=y + +# Keyboard +CONFIG_CROS_KB_RAW_NPCX_KSO_HIGH_DRIVE=y + +# RTC +CONFIG_PLATFORM_EC_RTC=y +CONFIG_PLATFORM_EC_CONSOLE_CMD_RTC=y + +# USB-C +CONFIG_PLATFORM_EC_USB_PD_TBT_COMPAT_MODE=n +CONFIG_PLATFORM_EC_USB_PD_USB4=n + +# Zephyr feature +CONFIG_ASSERT=y +CONFIG_SHELL_MINIMAL=n +CONFIG_LOG=y + +# Avoid underflow info from tachometer +CONFIG_SENSOR_LOG_LEVEL_ERR=y + +CONFIG_SYSCON=y |