diff options
Diffstat (limited to 'zephyr/program/nissa/yaviks')
-rw-r--r-- | zephyr/program/nissa/yaviks/fan.dtsi | 22 | ||||
-rw-r--r-- | zephyr/program/nissa/yaviks/gpio.dtsi | 4 | ||||
-rw-r--r-- | zephyr/program/nissa/yaviks/keyboard.dtsi | 50 | ||||
-rw-r--r-- | zephyr/program/nissa/yaviks/overlay.dtsi | 18 | ||||
-rw-r--r-- | zephyr/program/nissa/yaviks/project.conf | 6 | ||||
-rw-r--r-- | zephyr/program/nissa/yaviks/src/keyboard.c | 19 |
6 files changed, 108 insertions, 11 deletions
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); |