summaryrefslogtreecommitdiff
path: root/zephyr/program/nissa
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/program/nissa')
-rw-r--r--zephyr/program/nissa/craask/project.conf5
-rw-r--r--zephyr/program/nissa/craask/src/usbc.c4
-rw-r--r--zephyr/program/nissa/joxer/keyboard.dtsi26
-rw-r--r--zephyr/program/nissa/nereid/keyboard.dtsi26
-rw-r--r--zephyr/program/nissa/program.conf3
-rw-r--r--zephyr/program/nissa/shi.dtsi3
-rw-r--r--zephyr/program/nissa/src/common.c11
-rw-r--r--zephyr/program/nissa/xivur/project.conf1
-rw-r--r--zephyr/program/nissa/yaviks/fan.dtsi22
-rw-r--r--zephyr/program/nissa/yaviks/gpio.dtsi4
-rw-r--r--zephyr/program/nissa/yaviks/keyboard.dtsi50
-rw-r--r--zephyr/program/nissa/yaviks/overlay.dtsi18
-rw-r--r--zephyr/program/nissa/yaviks/project.conf6
-rw-r--r--zephyr/program/nissa/yaviks/src/keyboard.c19
14 files changed, 185 insertions, 13 deletions
diff --git a/zephyr/program/nissa/craask/project.conf b/zephyr/program/nissa/craask/project.conf
index f530f0f54e..7bcc64e6a5 100644
--- a/zephyr/program/nissa/craask/project.conf
+++ b/zephyr/program/nissa/craask/project.conf
@@ -14,6 +14,11 @@ CONFIG_PLATFORM_EC_DYNAMIC_MOTION_SENSOR_COUNT=y
CONFIG_PLATFORM_EC_BUTTONS_RUNTIME_CONFIG=y
+# Increase PD max power from default
+CONFIG_PLATFORM_EC_PD_MAX_POWER_MW=65000
+CONFIG_PLATFORM_EC_PD_MAX_VOLTAGE_MV=20000
+CONFIG_PLATFORM_EC_PD_MAX_CURRENT_MA=3250
+
# Flash space saving
# Turning off extended console help saves ~3500 bytes
CONFIG_SHELL_HELP=n
diff --git a/zephyr/program/nissa/craask/src/usbc.c b/zephyr/program/nissa/craask/src/usbc.c
index 8655bde95b..1304ae03bb 100644
--- a/zephyr/program/nissa/craask/src/usbc.c
+++ b/zephyr/program/nissa/craask/src/usbc.c
@@ -208,6 +208,10 @@ static void usbc_interrupt_trigger(int port)
static inline void poll_usb_gpio(int port, const struct gpio_dt_spec *gpio,
const struct deferred_data *ud)
{
+ /*
+ * TODO(b/267537103): Migrate named-gpios to Zephyr's GPIO hogs. Verify
+ * the active high/active low setting once GPIO hogs are used.
+ */
if (!gpio_pin_get_dt(gpio)) {
usbc_interrupt_trigger(port);
hook_call_deferred(ud, USBC_INT_POLL_DELAY_US);
diff --git a/zephyr/program/nissa/joxer/keyboard.dtsi b/zephyr/program/nissa/joxer/keyboard.dtsi
index 04a620767a..1742e1a50f 100644
--- a/zephyr/program/nissa/joxer/keyboard.dtsi
+++ b/zephyr/program/nissa/joxer/keyboard.dtsi
@@ -20,3 +20,29 @@
pinctrl-0 = <&pwm0_gpa0_default>;
pinctrl-names = "default";
};
+
+&cros_kb_raw {
+ status = "okay";
+ /* No KSO2 (it's inverted and implemented by GPIO) */
+ pinctrl-0 = <&ksi0_default
+ &ksi1_default
+ &ksi2_default
+ &ksi3_default
+ &ksi4_default
+ &ksi5_default
+ &ksi6_default
+ &ksi7_default
+ &kso0_default
+ &kso1_default
+ &kso3_default
+ &kso4_default
+ &kso5_default
+ &kso6_default
+ &kso7_default
+ &kso8_default
+ &kso9_default
+ &kso10_default
+ &kso11_default
+ &kso12_default>;
+ pinctrl-names = "default";
+};
diff --git a/zephyr/program/nissa/nereid/keyboard.dtsi b/zephyr/program/nissa/nereid/keyboard.dtsi
index 04a620767a..1742e1a50f 100644
--- a/zephyr/program/nissa/nereid/keyboard.dtsi
+++ b/zephyr/program/nissa/nereid/keyboard.dtsi
@@ -20,3 +20,29 @@
pinctrl-0 = <&pwm0_gpa0_default>;
pinctrl-names = "default";
};
+
+&cros_kb_raw {
+ status = "okay";
+ /* No KSO2 (it's inverted and implemented by GPIO) */
+ pinctrl-0 = <&ksi0_default
+ &ksi1_default
+ &ksi2_default
+ &ksi3_default
+ &ksi4_default
+ &ksi5_default
+ &ksi6_default
+ &ksi7_default
+ &kso0_default
+ &kso1_default
+ &kso3_default
+ &kso4_default
+ &kso5_default
+ &kso6_default
+ &kso7_default
+ &kso8_default
+ &kso9_default
+ &kso10_default
+ &kso11_default
+ &kso12_default>;
+ pinctrl-names = "default";
+};
diff --git a/zephyr/program/nissa/program.conf b/zephyr/program/nissa/program.conf
index e22cbb4c0c..d773f4f690 100644
--- a/zephyr/program/nissa/program.conf
+++ b/zephyr/program/nissa/program.conf
@@ -94,6 +94,9 @@ CONFIG_PLATFORM_EC_USB_PID=0x505a
CONFIG_PLATFORM_EC_USB_PD_USB4=n
CONFIG_PLATFORM_EC_USB_PD_TBT_COMPAT_MODE=n
CONFIG_PLATFORM_EC_USB_PD_REQUIRE_AP_MODE_ENTRY=n
+# TCPC interrupts are shared with BC1.2 and require additional processing
+# to ensure interrupts can't be lost due to shared use.
+CONFIG_PLATFORM_EC_TCPC_INTERRUPT=n
CONFIG_PLATFORM_EC_USB_MUX_RUNTIME_CONFIG=y
# ADL integrated muxes are slow: unblock PD
diff --git a/zephyr/program/nissa/shi.dtsi b/zephyr/program/nissa/shi.dtsi
index 12c0c6ca5b..cf531f7418 100644
--- a/zephyr/program/nissa/shi.dtsi
+++ b/zephyr/program/nissa/shi.dtsi
@@ -5,9 +5,10 @@
#include <ite/it8xxx2-pinctrl-map.dtsi>
-&shi {
+&shi0 {
status = "okay";
pinctrl-0 = <&shi_mosi_gpm0_default &shi_miso_gpm1_default
&shi_clk_gpm4_default &shi_cs_gpm5_default>;
pinctrl-names = "default";
+ cs-gpios = <&gpiom 5 0>; /* unused but needed by dt binding */
};
diff --git a/zephyr/program/nissa/src/common.c b/zephyr/program/nissa/src/common.c
index e03b82bca3..435ef95e29 100644
--- a/zephyr/program/nissa/src/common.c
+++ b/zephyr/program/nissa/src/common.c
@@ -131,3 +131,14 @@ __override void board_hibernate_late(void)
* a small delay, so return.
*/
}
+
+#ifdef CONFIG_OCPC
+__override void board_ocpc_init(struct ocpc_data *ocpc)
+{
+ /* Ensure board has at least 2 charger chips. */
+ if (board_get_charger_chip_count() > 1) {
+ /* There's no provision to measure Isys */
+ ocpc->chg_flags[CHARGER_SECONDARY] |= OCPC_NO_ISYS_MEAS_CAP;
+ }
+}
+#endif
diff --git a/zephyr/program/nissa/xivur/project.conf b/zephyr/program/nissa/xivur/project.conf
index 1cc6230d06..f6e1adf93c 100644
--- a/zephyr/program/nissa/xivur/project.conf
+++ b/zephyr/program/nissa/xivur/project.conf
@@ -4,7 +4,6 @@
CONFIG_BOARD_XIVUR=y
CONFIG_PLATFORM_EC_OCPC=y
-CONFIG_PLATFORM_EC_FAN=y
CONFIG_NISSA_SUB_BOARD=n
# Battery Configuration
diff --git a/zephyr/program/nissa/yaviks/fan.dtsi b/zephyr/program/nissa/yaviks/fan.dtsi
index 24e551f43b..6a3fc0288a 100644
--- a/zephyr/program/nissa/yaviks/fan.dtsi
+++ b/zephyr/program/nissa/yaviks/fan.dtsi
@@ -23,33 +23,33 @@
rpm_target = <0>;
};
level_1 {
- temp_on = <45 48 0>;
- temp_off = <34 45 99>;
+ temp_on = <46 48 0>;
+ temp_off = <40 45 99>;
rpm_target = <2600>;
};
level_2 {
- temp_on = <47 49 0>;
- temp_off = <41 46 99>;
+ temp_on = <49 49 0>;
+ temp_off = <44 46 99>;
rpm_target = <2800>;
};
level_3 {
- temp_on = <49 50 54>;
- temp_off = <44 47 51>;
+ temp_on = <53 50 54>;
+ temp_off = <47 47 51>;
rpm_target = <3100>;
};
level_4 {
- temp_on = <50 56 60>;
- temp_off = <46 48 52>;
+ temp_on = <56 56 60>;
+ temp_off = <51 48 52>;
rpm_target = <3300>;
};
level_5 {
- temp_on = <52 60 64>;
- temp_off = <48 52 56>;
+ temp_on = <60 60 64>;
+ temp_off = <54 52 56>;
rpm_target = <3600>;
};
level_6 {
temp_on = <100 100 100>;
- temp_off = <49 54 58>;
+ temp_off = <58 54 58>;
rpm_target = <4000>;
};
};
diff --git a/zephyr/program/nissa/yaviks/gpio.dtsi b/zephyr/program/nissa/yaviks/gpio.dtsi
index 1ce123b42f..d063b897d9 100644
--- a/zephyr/program/nissa/yaviks/gpio.dtsi
+++ b/zephyr/program/nissa/yaviks/gpio.dtsi
@@ -209,6 +209,10 @@
gpio_c0_charger_led_amber_l: c0_charger_led_amber_l {
gpios = <&gpioj 7 GPIO_OUTPUT_HIGH>;
};
+ gpio_ec_kso_02_inv: ec_kso_02_inv {
+ gpios = <&gpioksol 2 GPIO_OUTPUT_HIGH>;
+ enum-name = "GPIO_KBD_KSO2";
+ };
};
named-i2c-ports {
diff --git a/zephyr/program/nissa/yaviks/keyboard.dtsi b/zephyr/program/nissa/yaviks/keyboard.dtsi
index 04a620767a..87d7d718fa 100644
--- a/zephyr/program/nissa/yaviks/keyboard.dtsi
+++ b/zephyr/program/nissa/yaviks/keyboard.dtsi
@@ -20,3 +20,53 @@
pinctrl-0 = <&pwm0_gpa0_default>;
pinctrl-names = "default";
};
+
+&cros_kb_raw {
+ status = "okay";
+ /* No KSO2 (it's inverted and implemented by GPIO) */
+ pinctrl-0 = <&ksi0_default
+ &ksi1_default
+ &ksi2_default
+ &ksi3_default
+ &ksi4_default
+ &ksi5_default
+ &ksi6_default
+ &ksi7_default
+ &kso0_default
+ &kso1_default
+ &kso3_default
+ &kso4_default
+ &kso5_default
+ &kso6_default
+ &kso7_default
+ &kso8_default
+ &kso9_default
+ &kso10_default
+ &kso11_default
+ &kso12_default
+ &kso13_default
+ &kso14_default>;
+ pinctrl-1 = <&ksi0_sleep
+ &ksi1_sleep
+ &ksi2_sleep
+ &ksi3_sleep
+ &ksi4_sleep
+ &ksi5_sleep
+ &ksi6_sleep
+ &ksi7_sleep
+ &kso0_sleep
+ &kso1_sleep
+ &kso3_sleep
+ &kso4_sleep
+ &kso5_sleep
+ &kso6_sleep
+ &kso7_sleep
+ &kso8_sleep
+ &kso9_sleep
+ &kso10_sleep
+ &kso11_sleep
+ &kso12_sleep
+ &kso13_sleep
+ &kso14_sleep>;
+ pinctrl-names = "default", "sleep";
+};
diff --git a/zephyr/program/nissa/yaviks/overlay.dtsi b/zephyr/program/nissa/yaviks/overlay.dtsi
index 00fb132fab..663b538953 100644
--- a/zephyr/program/nissa/yaviks/overlay.dtsi
+++ b/zephyr/program/nissa/yaviks/overlay.dtsi
@@ -213,6 +213,24 @@
};
};
};
+
+ binman {
+ ec-rw {
+ size = <0x50000>;
+ rw-fw {
+ rw-fwid {
+ /* Fix the lcoation of the FWID to the
+ * last 32 bytes of the flash. This
+ * ensures the RW entries in the FMAP
+ * stored in the RO section of flash
+ * are always correct.
+ */
+ offset = <(0x50000 - 32)>;
+ };
+ };
+ };
+ pad-after = <0x50000>;
+ };
};
&thermistor_3V3_51K1_47K_4050B {
diff --git a/zephyr/program/nissa/yaviks/project.conf b/zephyr/program/nissa/yaviks/project.conf
index 4c83972b8c..2e52005cad 100644
--- a/zephyr/program/nissa/yaviks/project.conf
+++ b/zephyr/program/nissa/yaviks/project.conf
@@ -4,6 +4,11 @@
CONFIG_BOARD_YAVIKS=y
+# FW image
+# TODO: Once this configuration is configured with binman's size property
+# by default, it can be removed.
+CONFIG_CROS_EC_RW_SIZE=0x50000
+
# Ensure recovery key combination (esc+refresh+power) is reliable: b/236580049
CONFIG_PLATFORM_EC_KEYBOARD_PWRBTN_ASSERTS_KSI3=y
CONFIG_PLATFORM_EC_KEYBOARD_REFRESH_ROW3=y
@@ -24,6 +29,7 @@ CONFIG_PLATFORM_EC_MAX_SENSOR_FREQ_MILLIHZ=100000
# Keyboard
CONFIG_PLATFORM_EC_KEYBOARD_KEYPAD=y
CONFIG_PLATFORM_EC_KBLIGHT_ENABLE_PIN=n
+CONFIG_PLATFORM_EC_KEYBOARD_FACTORY_TEST=y
# Fan
CONFIG_PLATFORM_EC_CUSTOM_FAN_CONTROL=y
diff --git a/zephyr/program/nissa/yaviks/src/keyboard.c b/zephyr/program/nissa/yaviks/src/keyboard.c
index 54f8750e98..22fa2df996 100644
--- a/zephyr/program/nissa/yaviks/src/keyboard.c
+++ b/zephyr/program/nissa/yaviks/src/keyboard.c
@@ -4,6 +4,7 @@
*/
#include "cros_cbi.h"
#include "ec_commands.h"
+#include "gpio_it8xxx2.h"
#include "hooks.h"
#include "keyboard_8042_sharedlib.h"
#include "keyboard_scan.h"
@@ -104,3 +105,21 @@ static void kb_layout_init(void)
set_scancode_set2(4, 0, get_scancode_set2(2, 7));
}
DECLARE_HOOK(HOOK_INIT, kb_layout_init, HOOK_PRIO_POST_FIRST);
+
+/*
+ * Map keyboard connector pins to EC GPIO pins for factory test.
+ * Pins mapped to {-1, -1} are skipped.
+ * The connector has 30 pins total, and there is no pin 0.
+ */
+const int keyboard_factory_scan_pins[][2] = {
+ { -1, -1 }, { GPIO_KSOH, 4 }, { GPIO_KSOH, 0 }, { GPIO_KSOH, 1 },
+ { GPIO_KSOH, 3 }, { GPIO_KSOH, 2 }, { -1, -1 }, { -1, -1 },
+ { GPIO_KSOL, 5 }, { GPIO_KSOL, 6 }, { -1, -1 }, { GPIO_KSOL, 3 },
+ { GPIO_KSOL, 2 }, { GPIO_KSI, 0 }, { GPIO_KSOL, 1 }, { GPIO_KSOL, 4 },
+ { GPIO_KSI, 3 }, { GPIO_KSI, 2 }, { GPIO_KSOL, 0 }, { GPIO_KSI, 5 },
+ { GPIO_KSI, 4 }, { GPIO_KSOL, 7 }, { GPIO_KSI, 6 }, { GPIO_KSI, 7 },
+ { GPIO_KSI, 1 }, { -1, -1 }, { GPIO_KSOH, 5 }, { -1, -1 },
+ { GPIO_KSOH, 6 }, { -1, -1 }, { -1, -1 },
+};
+const int keyboard_factory_scan_pins_used =
+ ARRAY_SIZE(keyboard_factory_scan_pins);