summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Guybrush: Add keyboard and volume buttonsstabilize-14238.B-mainDiana Z2021-09-233-3/+10
| | | | | | | | | | | | | | Add configuration for the keyboard and volume buttons. BRANCH=None BUG=b:195137794 TEST=load on guybrush, confirm volume up and down prints Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I89306402474ec72455ff999f9da8a35b3eb4139a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3176403 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* core/cortex-m: Disable warning in vecttable.c when building with clangTom Hughes2021-09-231-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | The vecttable logic explicitly routes unused IRQs to IRQ_UNUSED_OFFSET, and then assigns it to "null" at the very end. The result is something like: [8] = __attribute__((used, weak, alias("default_handler"))) irq_55_handler(void); [8] = __attribute__((used, weak, alias("default_handler"))) irq_56_handler(void); ... [8] = (void*)0 This is intentional so that it works with a varying values for CONFIG_IRQ_COUNT. BRANCH=none BUG=b:172020503 TEST=make buildall -j Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I3ba4eeaa46cd2c50c65c922f4c0c463ce1bb585e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3172038 Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
* test/utils: Switch to run-time test to fix clang buildTom Hughes2021-09-231-1/+4
| | | | | | | | | | | | | | | | | | | | | The BUILD_ASSERT that was used fails to compile with clang: error: static_assert expression is not an integral constant expression BUILD_ASSERT(str1 != str3) BRANCH=none BUG=b:172020503 TEST=make buildall -j TEST=./test/run_device_tests.py --board dartmonkey --compiler clang --tests=utils --remote 127.0.0.1:2551 TEST=./test/run_device_tests.py --board dartmonkey --compiler gcc --tests=utils --remote 127.0.0.1:2551 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Id93ea45b653b86fd5a79ed565e1fa94ffd317723 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3174596 Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
* driver: lsm6dsm: remove load_fifo_sensor_state_tGwendal Grignou2021-09-232-38/+0
| | | | | | | | | | | | | | | | Remove load_fifo_sensor_state_t since timestamp spreading is done in common code. Fixes: 4e6d315948 ("common: motion_sense: Spread timestamps in motion sense fifo") BUG=b:172342141 BRANCH=none TEST=buildall Change-Id: If47fdd5dc800e6b75bdea4fcef80cf6874debdaa Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3150052 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: guybrush: enable I2C controllersKeith Short2021-09-231-0/+32
| | | | | | | | | | | | | | | Explicitly enable all used I2C controllers. CL:3176841 disables the NPCX I2C controllers by default to save flash and RAM space. BUG=b:200292035 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: If2bbfbaee2e8392040776a9c87f0464274a7f2dd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3177580 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* nipperkin: support HDMI power controlZick Wei2021-09-232-2/+22
| | | | | | | | | | | | | | | | This patch add gpio: EN_PWR_HDMI, HDMI_DATA_EN control, set low when suspend, set high when resume. BUG=b:193395015 BRANCH=none TEST=check GPIO status in s0 and suspend. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I21155b5f572ed9d5a9ca01eb5dd9fc91c12b6344 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3167614 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
* tomato: board rev2 gpio updateTing Shen2021-09-232-7/+7
| | | | | | | | | | | | | | | | | | | GPA4/GPA5: kb backlight -> Programming I2C GPA3: Test point -> KB_BL_PWM GPA6: Test point -> EN_KB_BL Since the PWM pin changed, this CL breaks kb backlight on old boards. BUG=b:199829459 TEST=pass factory test BRANCH=main Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I33c42708b7694aeb625ea5b0879b3ac08ec81f67 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3160457 Reviewed-by: Eric Yilun Lin <yllin@google.com> Tested-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* Revert "DP/TBT/USB4: Retimer WA resolved Brya TBT lane bonding issue in AP mode"madhusudanarao amara2021-09-233-46/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit f0985f8a11585f6a704aa94a8354bd5b934619ac. Reason for revert: Issue is resolved after setting the Force BB Retimer GPIO (GPP_E4) to 0. It is a coreboot change. BUG=b:195375738 BRANCH=None TEST=TBT enumerated no lane bonding issue is observed with above coreboot code change with reverted EC WA. Signed-off-by: madhusudanarao amara <madhusudanarao.amara@intel.corp-partner.google.com> Change-Id: I09a8a53aec9ba3757189a091606922bc7a133ba7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3162936 Reviewed-by: Deepti Deshatty <deepti.deshatty@intel.corp-partner.google.com> Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Commit-Queue: caveh jalali <caveh@chromium.org>
* primus: update thermal tableTerry Chen2021-09-231-3/+15
| | | | | | | | | | | | | | | Update thermal table(V1) for settings provided by thermal team on 2021-09-23. BUG=b:200836803 TEST=make -j BOARD=primus TEST=test pass by thermal team Signed-off-by: Terry Chen <terry_chen@wistron.corp-partner.google.com> Change-Id: I1f72e26d9d6ae9b48738688e4331ebcd05949f18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3177900 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* cherry: enable CONFIG_USB_PORT_POWER_DUMB_CUSTOM_HOOKTing Shen2021-09-233-1/+5
| | | | | | | | | | | | | | | | | | | CL:3023017 does not work as expected because usb_port_power_dump module still controls the power power. This CL disables the hooks in usb_port_power_dump and enables the interrupt function usb_a0_interrupt instead. BUG=b:193499785 TEST=verify USB-A port works after this change BRANCH=main Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I56196f2a062d6b3358a9a4330e7f33ab546f5d1b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3174606 Reviewed-by: Rong Chang <rongchang@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* RTC: Zephyr IDT1337AG RTC driverSam Hurst2021-09-235-0/+566
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zephyr IDT1337AG RTC driver BRANCH=none BUG=b:197743934 TEST=ectool rtcset 30000 ectool rtcget Current time: 0x00007535 (30005) ectool rtcsetalarm 10 after ~10 (measured with a timer) printed on ec console: [160.248900 event set 0x0000000002000000] I tested the alarm up to one hour. Hibernation test: rtc_alarm 10 hibernate [339.906200 system hibernating] *** Booting Zephyr OS build zephyr-v2.6.0-110-g862339fbeda5 *** [Image: RO, herobrine_npcx9_v2.6.73690-ec:c87457 [Reset cause: power-on hibernate] Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: If5b936af2555915582ca38fee751f57bb2b8d10f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3173093 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* motion_sense: Fix ap_event_interval calculation.Gwendal Grignou2021-09-231-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [CONFIG_AP].ec_rate, populated with sysfs entry |hwfifo_timeout|, is used to calculate |ap_event_interval| the delay before sending a new event to the AP. When load_fifo() still existed (CL:938146), it was critical that a sample was available before gathering the data. When ODR and |hwfifo_timeout| are closed, |ap_event_interval| is increased by 5%. Now, since samples are collected after an interrupt triggers due to at least one element in the sensor FIFO or are scheduled based on the sensor data rate (forced mode), we are guaranteed to have an event. We should actually decreate |ap_event_interval| by 5% to be sure an event is triggered. When both an interrupt based sensor and a force sensor are at running at the same ODR, they will probably not be in phase, but there will be opportunity to send event to the host. One sensor will have a fix delay, guaranteed to be less than its ODR. BUG=b:195264765,b:129159505,b:73557414 BRANCH=many. TEST=Without the change, on gaybrush, we can see that events are sent 2 by 2, event when the AP asks for them immediately. Using 'iioservice_simpleclient --device_id=3 --channels="timestamp" --frequency=49 --samples=40' (50Hz ODR): : Before : After Latency tolerance: 0.070408 s : 0.070408 s Max latency : 0.024089 s : 0.004047 s Min latency : 0.003339 s : 0.003167 s Median latency : 0.02319 s : 0.003565 s Mean latency : 0.013644 s : 0.003567 s Change-Id: I9035dd535ff2895be5011335c5f44bd069c9421e Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3172269 Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* board/guybrush-dewat: Minor cleanupGwendal Grignou2021-09-233-36/+35
| | | | | | | | | | | | | | | Remove g_bmi323 static variable, use same structure as bmi160. Fill motion_sensors array with index in order. BUG=b:195264765 BRANCH=none TEST=compile Change-Id: I2c16fa64db7786bf5ff977cd6626c3d9de9b66b4 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3172268 Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* driver: bmi3xx: simplify irq handlerGwendal Grignou2021-09-232-261/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove unnecessary structure: - bmi3_fifo_data, bmi3xx_drv_data - put static buffer in local bmi3_fifo_frame - Tighten interrupt routine - Use word to avoid intermediate copy - Trust fifo configuration from fifo_enable. - Process FIFO until interrupt indicates it is empty. - Simplify bmi3_parse_fifo_data - Use loop to avoid code duplication. - Remove intermediate variable. - Use word to process FIFO. - Remove blank lines, use inverted christmas tree convention. - Use constant when appropriate. - Set FIFO watermark to 3 words to catch single acceleromter event when gyroscope is disabled. BUG=b:195264765,b:178398789 BRANCH=none TEST=Run `tast run guybrushlocal hardware.SensorIioserviceHard' in loop. Change-Id: I55da91a557b8c51f707dc29b4867cc715dce2cca Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170618 Reviewed-by: Diana Z <dzigterman@chromium.org>
* Revert "driver: bmi3xx: Set FIFO watermark to 6 words"Gwendal Grignou2021-09-231-1/+1
| | | | | | | | | | | | | | | | | | This reverts commit 5786cdd32f9d8ba7da8b2d9764b06dfeb991f5ff. FIFO is not always 6 words: When the gyroscope is disabled, the FIFO will only contains 3 words. BUG=b:178398789,b:195264765 BRANCH=none TEST=Compile Cq-Depend: chromium:3170618 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I1cc0f6e31bb06a2ea11a815ea1f360766fb5d474 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3172267 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Rob Barnes <robbarnes@google.com>
* Blipper: Add beetley related configurationwuzhongtian2021-09-235-24/+251
| | | | | | | | | | | | | | | | | Add the relevant configuration of beetley to the blipper ec code BUG=b:199479277 BRANCH=dedede TEST=make BOARD=blipper pass,and we have done some tests on the modified Blipper device,the basic functions are normal. Signed-off-by: wuzhongtian <wuzhongtian@huaqin.corp-partner.google.com> Change-Id: Ie6e246755779201faa12f6f48670b018b816351f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3151049 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org> Tested-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org>
* board: Do not enable gyroscope by defaultGwendal Grignou2021-09-237-60/+1
| | | | | | | | | | | | | | | | | | | | | Enable gyroscope only when the AP needs it. It is not used by the EC. For lid calculation, set frequency at 10HZ, the drivers will calculate higher frequencies when needed. Modify other boards as well: Use awk '/\.type = MOTIONSENSE_TYPE_GYRO,/ { check_config=1 } \ /\.config = / { if (check_config) { print FILENAME,$0 } } \ /\.type = MOTIONSENSE_TYPE_[^G]/ { check_config=0 }' board/*/sensors.c | \ cut -d ' ' -f 1' to locate the impacted files (board.c as well). BUG=none BRANCH=none TEST=Check rotation is still working on brya Change-Id: I45d82d00c30e35541df80d1b7805f8302b3d98ff Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170174 Reviewed-by: Keith Short <keithshort@chromium.org>
* Guybrush: Correct zephyr power interruptsDiana Z2021-09-231-1/+1
| | | | | | | | | | | | | | | Correct the S5 PGOOD interrupt to go to the baseboard function to process it. BRANCH=None BUG=b:195137794 TEST=builds, continues to "boot" to S0 Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I0fb631eb67b662698b889171c399d968da788cb8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3176393 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: shim: implement a generic led_get_brightness_rangeFabio Baltieri2021-09-225-4/+27
| | | | | | | | | | | | | | | | | | | Implement a generic led_get_brightness_range function using static values from the device tree. This is currently ignoring led_id, but no pwm_led based device is using it right now anyway, so this could cover all existing use cases. BRANCH=none BUG=b:177452529 TEST=called the function, verified the values in runtime Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I67dc7564eb6724e401961261ff5cc5892899ad5f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170401 Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: fix support for multiple fansMichał Barnaś2021-09-221-4/+4
| | | | | | | | | | | | | | | | | This commit fixes macros used to create named-fans instances. It will enable to have multiple named-fans declared in devicetree without raising "multiple definitions" error during compilation. BRANCH=main BUG=none TEST=Add named-fans instance in device tree and build firmware. Compilation with 2 or more names-fans should work correctly. Change-Id: If5c9a74f743749efc3a2872b0ced98500e96ca52 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3176200 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: test: remove unused functionYuval Peress2021-09-221-11/+0
| | | | | | | | | | | | | | | | Function was left over from a different approach to a test. BRANCH=none BUG=none TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I1fd3a1cf7da6725672cc35165e83bd60197358f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3176386 Tested-by: Yuval Peress <peress@google.com> Auto-Submit: Yuval Peress <peress@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* zephyr: shell: add alias for kernel threads commandMichał Barnaś2021-09-221-0/+9
| | | | | | | | | | | | | | | Add taskinfo command as alias for "kernel threads" for backward compatibility with CrOS EC. BRANCH=main BUG=b:190224781 TEST=Check that taskinfo correctly executes "kernel threads" command Change-Id: Ibdce9d8342fb7a99577b1f8d031c419fa485e7b0 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3174058 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: lazor: add history and kernel threads commandsMichał Barnaś2021-09-221-0/+8
| | | | | | | | | | | | | | Enable commands for displaying shell history and threads statistics. BRANCH=main BUG=b:190224781 TEST=Check if "history" and "kernel threads" commands work Change-Id: Iedfaa3856c065120966f4d683646fa51218f1e0a Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3174057 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: shim: define led_color_map from the devicetreeFabio Baltieri2021-09-224-2/+50
| | | | | | | | | | | | | | | | | | | This adds a set of properties for color mapping in the device tree for the pwm-leds device, and maps them to the internal "struct pwm_led_color_map". BRANCH=none BUG=b:177452529 TEST=compared the structure on gdb TEST=build and run on volteer Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ib3a704afccad40eab7115371dbf72c568f5602d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170400 Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: shim: add an example for the leds property and make it requiredFabio Baltieri2021-09-221-0/+17
| | | | | | | | | | | | | | | Add a complete example for the cros-ec,pwm-leds leds property, and mark it as required since the whole LED functionality depends on it. BRANCH=none BUG=none TEST=build and run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I6d875b1a3a436baa77b6c15b8018e4b37102bb46 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3174051 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: test: fix setup useYuval Peress2021-09-221-1/+1
| | | | | | | | | | | | | | BRANCH=none BUG=none TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Iae8c1a044b07849a2829fb43999621225824a2e7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3175621 Tested-by: Yuval Peress <peress@google.com> Auto-Submit: Yuval Peress <peress@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* mchp: Check parameter us in void usleep(unsigned us)martin yan2021-09-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Check parameter us in void usleep(unsigned us) under common, to avoid triggering ASSERT(us), it may be a good idea to figure out which caller to pass 0 parameter, but it may be difficult during run-time. remove ASSERT(us) in this usleep() routine BUG=none BRANCH=none TEST=Tested on ADL RVP and MCHP1727 MECC system without parameter 0 checking, ASSERT(us) is triggered as POR: [0.482657 power_chipset_init: power_signal=0x0] [0.484735 SW 0x01] ASSERTION FAILURE 'us' in usleep() at common/timer.c:184 === PROCESS EXCEPTION: 00 ====== xPSR: 000cfb43 === r0 :000000b8 r1 :000e9aa6 r2 :000e9ad0 r3 :000d1a51 r4 :dead6663 r5 :000000b8 r6 :000765f4 r7 :00040314 r8 :00118e00 r9 :000e4aa8 r10:000e456c r11:00000000 r12:00000000 sp :0011b420 lr :00000030 pc :00000030 after checking is added, ASSERT(us) is not hit Signed-off-by: martin yan <martin.yan@microchip.corp-partner.google.com> Change-Id: I2f58ea132da7bf7a5dd315a69675013617eb0a64 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3138620 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
* cherry: redesign RT1718S GPIO 1/2 behaviorTing Shen2021-09-223-48/+10
| | | | | | | | | | | | | | | | | | | | | | | Reimplement the logic of GPIO 1/2 such that the state of these pins does not tied together anymore. Instead, board_set_active_charge_port controls GPIO 1 only, and pd_power_supply_* functions controls GPIO 2 only. Also give these pins a readable name. BUG=b:198707662 TEST=1) pass faft_pd on port C1 2) able to boot with C1 plugged AC power and without battery BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Id33160a0c3ed202cdfe3666c2444098a3031229f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3168036 Reviewed-by: Rong Chang <rongchang@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* iteflash: fix sigactionDonald Huang2021-09-221-1/+5
| | | | | | | | | | | | | | | Clear sigaction to 0. BUG=none BRANCH=none TEST=Check it ok by cherry platform. Signed-off-by: Donald Huang <donald.huang@ite.com.tw> Change-Id: I5d08158bd1aa8262e2abe6917ac7c4732d22fd46 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3162463 Tested-by: Donald Huang <donald.huang@ite.corp-partner.google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* cappy2: Apply HOSTCMD_BATTERY_V2 to get battery infowangganxiang2021-09-221-0/+3
| | | | | | | | | | | | | | | | | Since the static information may be read error when the battery is initialized, so the battery information in share memory need update. BUG=b:199102576 BRANCH=keeby TEST=make BOARD=cappy2 pass Signed-off-by: wangganxiang <wangganxiang@huaqin.corp-partner.google.com> Change-Id: I408627ca9a61f8e5edd95297c09f165c5ac32524 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3168452 Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Henry Sun <henrysun@google.com> Commit-Queue: Henry Sun <henrysun@google.com>
* ccgxxf: Add correct I2C address flagsstabilize-14235.B-mainVijay Hiremath2021-09-221-2/+1
| | | | | | | | | | | | | | | | CCGXXF exposes I2C addresses 0x0B for 1st port & 0x1B for second port hence corrected the I2C address flags in header file. BUG=none BRANCH=none TEST=Able to initialize second Type-C port Change-Id: I9dc955d1035b1f488e92a47cdac49bdd6154f4ae Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3172253 Reviewed-by: Tanu Malhotra <tanu.malhotra@intel.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* byra: Disable ACPI messages on EC console by defaultGwendal Grignou2021-09-221-2/+5
| | | | | | | | | | | | | | | | | | When using sensors a lot of messages are sent, overwhelming the EC console port. BUG=none BRANCH=master TEST=When running "tast run <ip hardware.SensorIioserviceHard", check the EC console is not overflown with message like: 21-09-17 23:01:41.981 [444.007624 ACPI query = 27] 21-09-17 23:01:42.053 [444.086884 event set 0x0000000004000000] 21-09-17 23:01:42.057 [444.087864 event clear 0x0000000004000000] Change-Id: I825831d83ce468d719b4303abadec4e2e0a0d1af Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170173 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: shim: atomic_clear_bits should return a valueDenis Brockus2021-09-211-2/+2
| | | | | | | | | | | | | | | | | | | | | All of the other atomic operations return an atomic_val_t value. This should be so for atomic_clear_bits as well. The standard return value is the field value prior to applying the operation to it. BUG=b:141363146 BRANCH=none TEST=zmake configure -b $PROJ_HAYATO Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I7a64fddb1174e57ed0e04ef1502310d8494e860d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3173092 Auto-Submit: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* efs2: Add overridable packet mode functionVijay Hiremath2021-09-212-6/+11
| | | | | | | | | | | | | | | | | | To support multiple OS and to reduce the BOM stuffing options on Intel RVP, Packet mode GPIO is added on I/O expander hence added overridable function. BUG=b:200189880 BRANCH=none TEST=make buildall -j Change-Id: Ieea1129614258393f7c73712ed28ed50b9fbf8fb Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3087618 Reviewed-by: Li Feng <li1.feng@intel.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* ec: Exclude version test from coverage buildsJeremy Bettis2021-09-211-0/+2
| | | | | | | | | | | | | | | | | | | The version host test only works inside the chroot, and doesn't really contribute to coverage, so exclude it from coverage builds. BRANCH=None BUG=None TEST=in docker: make -j CRYPTOC_DIR="${MODULES_DIR}/cryptoc" \ FTDIVERSION=1 HOSTGCOV='gcov' \ CROSS_COMPILE_arm=/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi- \ coverage Change-Id: I05ee9968360d8e76199fc3ee65d0ca1f2eae7ed4 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3171940 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* test/run_device_tests.py: Allow specifying compilerTom Hughes2021-09-211-4/+16
| | | | | | | | | | | | | | | | | Default to using gcc, but allow selecting clang so that we can test it. BRANCH=none BUG=b:172020503 TEST=./test/run_device_tests.py --compiler clang --board dartmonkey --tests sha256 --remote 127.0.0.1:2551 TEST=./test/run_device_tests.py --board dartmonkey --tests sha256 --remote 127.0.0.1:2551 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I3cfd04825df8cac54fbee1ba1b084ea581e62e53 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3172037 Reviewed-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Patryk Duda <patrykd@google.com>
* led_pwm: split color map on a separate structureFabio Baltieri2021-09-2115-21/+27
| | | | | | | | | | | | | | | | Currently color map is reusing the same structure as the channel and callback selection, which is a bit wasteful and somewhat confusing. Split it to its own struct with just three uint8_t fields. BRANCH=none BUG=none TEST=build only Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I56992fa9525db46980e450eb6569ba8291987b9b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3168864 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Yuval Peress <peress@google.com>
* Revert "npcx: correct the image copies indication bits for npcx9"caveh jalali2021-09-215-32/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 20222d48571fa44c76fdb0ededd0ed042e9f8244. Reason for revert: brya thinks it's in EC-RW when it's really still in EC-RO. Original change's description: > npcx: correct the image copies indication bits for npcx9 > > In npcx5/7, we use two reserved bits in the BSC1 register (offset 0x07 > of the MDC register) to indicate what the current image copy is. > In npcx9, these two bits are used by the booter. We need to change them > to another two empty scratch bits which are not used by the booter. > > BUG=b:165777478 > BRANCH=none > TEST=pass "make buildall" > TEST=check the related bits changed by "sysump ro" and "sysjump rw" > > Signed-off-by: Jun Lin <CHLin56@nuvoton.com> > Change-Id: I6bcfe6d8752c6fa10022a21956d2e0ceb7f9418e > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3153119 > Tested-by: CH Lin <chlin56@nuvoton.com> > Reviewed-by: caveh jalali <caveh@chromium.org> > Auto-Submit: CH Lin <chlin56@nuvoton.com> > Commit-Queue: caveh jalali <caveh@chromium.org> Bug: b:165777478 Change-Id: I24cdfec0d5c8cd998f087525ae21b2a3daea43a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3172266 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Tested-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* zephyr: test: Add test for st_raw_read_nYuval Peress2021-09-214-0/+79
| | | | | | | | | | | | | | | | | Enable mocking and add a test using the I2C mock emulator for the st_raw_read_n function. BRANCH=none BUG=b:200589041 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I2554f1eab898942bc6d68860beba2e1eb02b5aa0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3171695 Tested-by: Yuval Peress <peress@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Yuval Peress <peress@google.com>
* zephyr: test: add a generic I2C mockYuval Peress2021-09-216-0/+141
| | | | | | | | | | | | | | | Add a simple mock with no state to test common i2c code. BRANCH=none BUG=b:200589041 TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I99730361a298708278106deb58890a0ed2c9febf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3171694 Tested-by: Yuval Peress <peress@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Yuval Peress <peress@google.com>
* zephyr: test: lis2dw12 fail setting bdu on initYuval Peress2021-09-213-3/+60
| | | | | | | | | | | | | | BRANCH=none BUG=b:200046770 TEST=zmake configure --test zephyr/projects/drivers Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I5e109001cf19010c2a4edc68be9b043a14070480 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170539 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Yuval Peress <peress@google.com> Tested-by: Yuval Peress <peress@google.com>
* zephyr: test: test lis2dw12_init timeoutYuval Peress2021-09-211-0/+16
| | | | | | | | | | | | | BRANCH=none BUG=b:200046770 TEST=zmake configure --test zephyr/projects/drivers Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Icae6ca1a5b5a222893380975880979e68c3d941b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170537 Commit-Queue: Yuval Peress <peress@google.com> Tested-by: Yuval Peress <peress@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: test: Test failed write on soft reset register (lis2dw12)Yuval Peress2021-09-212-0/+30
| | | | | | | | | | | | | | | Test the init code path that fails writing the soft reset register. BRANCH=none BUG=b:200046770 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Ic395c7dd749c4203800b72afbb024919a71d0eae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170535 Commit-Queue: Yuval Peress <peress@google.com> Tested-by: Yuval Peress <peress@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: test: Test failed read on who-am-i register (lis2dw12)Yuval Peress2021-09-213-4/+38
| | | | | | | | | | | | | | | Test the init code path that fails reading who-am-i register. BRANCH=none BUG=b:200046770 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I66c17d1d0f2e889c22ccecca8ecedd467174b764 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170534 Commit-Queue: Yuval Peress <peress@google.com> Tested-by: Yuval Peress <peress@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* driver: lis2dw12: fix init timeout loop conditionYuval Peress2021-09-211-3/+1
| | | | | | | | | | | | | | | | | | | | The loop condition for the soft reset was incorrect, on a failure to read the soft reset register, the loop would hit the `continue` command which would then test (status & LIS2DW12_SOFT_RESET_MASK) != 0 and leave us at the mercy of the status value left on the stack. BRANCH=none BUG=b:200046770 TEST=zmake configure --test zephyr/projects/drivers Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Iebeafe9c57c71713a1df5230e60ac067209ec5b2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170538 Commit-Queue: Yuval Peress <peress@google.com> Tested-by: Yuval Peress <peress@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* driver: accel_lis2dw12: use ret in init as the return valueYuval Peress2021-09-211-4/+4
| | | | | | | | | | | | | | | | Use the value in ret during the lis2dw12_init function to differentiate between errors. BRANCH=none BUG=b:200046770 TEST=make buildall -j Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Id31f01e09ff1305a4cd0ab14d56a05172a263760 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170536 Commit-Queue: Yuval Peress <peress@google.com> Tested-by: Yuval Peress <peress@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: i2c: Translate zephyr error to ecos errorsYuval Peress2021-09-216-149/+217
| | | | | | | | | | | | | BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I80f53103b3bb873da5627dec116386741b496a94 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3171693 Tested-by: Yuval Peress <peress@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Yuval Peress <peress@google.com>
* Revert "zmake: Trim short version on full hashes"Jack Rosenthal2021-09-214-104/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 695b3c909c4846493eacd324e9c26933847372d1. Reason for revert: Broke CQ See https://ci.chromium.org/ui/p/chromeos/builders/postsubmit/trogdor-zephyr-postsubmit/314 Original change's description: > zmake: Trim short version on full hashes > > The ec_version.h contains both a long build string and also a 31 char > string. Change the short string to omit the commit count, and only > include full hashes, i.e. hayato_v2.6-ec:5bd1aa,os:ade7b4 not > hayato_v2.6.73670-ec:5bd1aa,os: > > Change test to be a real version string with hashes of the right length. > > BUG=None > BRANCH=None > TEST=./zephyr/zmake/run_tests.sh > > Change-Id: I18d73345036933594b8c74187796c3727f868629 > Signed-off-by: Jeremy Bettis <jbettis@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3160464 > Tested-by: Jeremy Bettis <jbettis@chromium.org> > Auto-Submit: Jeremy Bettis <jbettis@chromium.org> > Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> > Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Bug: None Change-Id: Ib4282f761c514c0ca2da6249d38ccc9cba852f6d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3172040 Auto-Submit: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
* brya: Enable PS8815_FORCE_DIDCaveh Jalali2021-09-211-0/+1
| | | | | | | | | | | | | | | This enables a reliable way to determine the ps8815 chip revision even when its firmware is inoperative. BRANCH=none BUG=b:186189039 TEST=verified the brya EC reports the correct device ID when the firmware is corrupted. Change-Id: I60808c0ae3312b11ebaf0848eb77a8134a943b49 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3093035 Reviewed-by: Keith Short <keithshort@chromium.org>
* ps8xxx: Add support for ps8815 A2 with bad FWCaveh Jalali2021-09-211-0/+7
| | | | | | | | | | | | | | | | This adds the low level chip ID of the ps8815 A2 so we can recognize the chip when its main firmware is inoperative. BRANCH=none BUG=b:186189039 TEST=with next patch in series, verified the brya EC reports the correct device ID when the firmware is corrupted. Change-Id: I2696b9c20fdefd8afd02f7394a45f1c4c5636d71 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2857796 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>