summaryrefslogtreecommitdiff
path: root/include/mkbp_event.h
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: add MKBP supportHyungwoo Yang2021-01-261-0/+6
| | | | | | | | | | | | | | Add MKBP support to zephyr. BUG=b:173507858 BRANCH=none TEST=make buildall -j8 build volteer on zephyr Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.corp-partner.google.com> Change-Id: I9b7d979241b0df5dc0fa5d9741f05dc9875189ab Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2639854 Reviewed-by: Keith Short <keithshort@chromium.org>
* mkbp: take timestamp closer to hardware interruptJett Rink2019-04-241-1/+1
| | | | | | | | | | | | | | | | | We want to ensure that the timestamp we take for last mkbp is as close to the actual hardware interrupt from EC->AP. BRANCH=none BUG=b:129159505 TEST=passing CTS sensor run (except test 133 nullptr) with this change Change-Id: I94b214f021f0b63ff2883e5fe8e32acc83ce208f Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1560390 Tested-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Enrico Granata <egranata@chromium.org> Reviewed-by: Mathew King <mathewk@chromium.org> Commit-Queue: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
* mkbp: non-gpio-based mkbp events, leave interruptsJett Rink2019-03-261-29/+0
| | | | | | | | | | | | | | | | | | | | | | | For non-gpio-based mkbp event delivery, we do not want to temporarily disable interrupts as the code to send the mkbp events may use mutexes or task scheduling to perform the more complicated mkbp event delivery. For simple GPIO-based implementations, pausing interrupts gives the mkbp_last_event_time marker the best chance at matching the actual time the gpio was toggled on the EC. For other implementation, we are already at the mercy of bus delays and timing for delivery so it wasn't as reliable in that case to beginning with. BRANCH=none BUG=b:128862307 TEST=Ran AIDA64 sensor tab for a long time without seeing ISH communication issue. Change-Id: Id6e63a7f7b494559bd38b4659a580fa57666ecf1 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1531773 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Mathew King <mathewk@chromium.org>
* mkbp_event,include/config.h: Clarify MKBP delivery method.Yilun Lin2019-03-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we have two MKBP delivery methods: 1. define CONFIG_MKBP_USE_HOST_EVENT to notify via host event 2. undef CONFIG_MKBP_USE_HOST_EVENT to notify via GPIO interrupt It may become more complicated if new notification methods introduced. e.g.: mt_scp uses IPI, rather than host event and GPIO interrupt. This CL does: 1. add CONFIG_MKBP_USE_GPIO to explicilty declare that MKBP event are sent via GPIO interrupt. 2. CONFIG_MKBP_USE_CUSTOM for boards which have custmized methods. 3. Remove weak attribute in mkbp_set_host_active (which can be done with CONFIG_MKBP_USE_CUSTOM now. 4. Removes mkbp_set_host_active function in board Nocturne. It only deliver MKBP events through GPIO interrupt now. BRANCH=None BUG=b:120808999 TEST=grep -rn "CONFIG_MKBP_USE_GPIO\|EC_INT_L" board/ baseboard/ and see the result is reasonable: 1. EC_INT_L must be 1-to-1 mapped to define CONFIG_MKBP_USE_GPIO in every board, except that meep, yorp, ampton which are defined in baseboard octopus. 2. undef CONFIG_MKBP_USE_GPIO in bip and casta, which use host event, but also have baseboard octopus. Change-Id: I4af6110e4fd3c009968075c3623ef2d91cbd770b Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1490794 Commit-Ready: Jett Rink <jettrink@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* FIXUP: mkbp: add support for board-specific host notificationEnrico Granata2018-10-041-2/+28
| | | | | | | | | | | | | | This patch improves naming and documentation for the functionality introduced in crrev.com/c/1247000 TEST=build BRANCH=none BUG=b:112366846, b:112112483, b:112111610 Change-Id: Iedd2fc5492a5d35fa9c2475fe248c5aa41e83bb0 Signed-off-by: Enrico Granata <egranata@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1258562 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* mkbp: add support for board-specific host notificationEnrico Granata2018-10-021-0/+3
| | | | | | | | | | | | | | | | | | | | On Nocturne, we want to be able to decide whether MKBP events should be notified to the AP via host_set_single_event or gpio_set_level based upon runtime board-version detection instead of a static compile-time flag. Add support for this by marking the function that raises the actual IRQ to the host as weak, so that individual boards can override it with their own version. BRANCH=None BUG=b:112366846, b:112112483, b:112111610 TEST=see CL:1161546 for details Signed-off-by: Enrico Granata <egranata@chromium.org> Change-Id: Ide5ec12fbc6fea3cf23069f376066f225e1887b3 Reviewed-on: https://chromium-review.googlesource.com/1247000 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* ec: Make it possible to run tests with AddressSanitizer enabledNicolas Boichat2018-06-281-1/+2
| | | | | | | | | | | | | | | | | | | Automatically use CC=clang if TEST_ASAN is specified. Also, add a __no_sanitize_address attribute macro to prevent ASan from adding guards around host_command, mkbp_event, and hook "arrays" that are generated at link-time. Also, set ASAN_OPTIONS env variable in run_host_test. BRANCH=none BUG=chromium:854924 TEST=make TEST_ASAN=y runtests -j Change-Id: Iaf0ec405022760d757a8a9d62a5022460d1b16e1 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1109661 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* motion_sense: Lower jitter of EC->AP timestampAlexandru M Stan2018-05-141-0/+9
| | | | | | | | | | | | | | | | | | | | | When the EC sends an interrupt to the AP notifying it of new accelerometer data we need to make sure the spot we record the timestamp of the event is virtually identical to the spot the AP records the same point in time. Therefore a better spot for that is right next to the gpio toggling of the interrupt line. BUG=b:67743747 TEST=In the kernel, fifo_info->info.timestamp still has sane values. TEST=CTS should still pass BRANCH=master Change-Id: Ic77101a045123e779f576c46b401c765304976fd Signed-off-by: Alexandru M Stan <amstan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/802976 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* mkbp_event: Properly queue events during host sleepShawn Nematbakhsh2016-11-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Don't queue non-wake events, and ensure wake events (and all subsequent events) always get queued. BUG=chrome-os-partner:59248, chrome-os-partner:59336 BRANCH=gru TEST=Manual on kevin, go to suspend, press volume keys dozens of times, press 'shift', verify device wakes. Place cursor on URL bar, go to suspend, type "google" quickly, verify device wakes and "google" appears on URL bar. Go to suspend, press 'VolUp' key 5 times, press keyboard, verify device wakes and no volume meter is seen on display. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: Ibe761187fbcefd686776a512786550970a6fc067 Reviewed-on: https://chromium-review.googlesource.com/405717 Commit-Queue: Douglas Anderson <dianders@chromium.org> Tested-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> (cherry picked from commit aa2f01566314604404e104d7975c6c755c22a601) Reviewed-on: https://chromium-review.googlesource.com/407958 Commit-Ready: Douglas Anderson <dianders@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
* mkbp_event: Don't discard event source structures due to LTOShawn Nematbakhsh2016-05-251-3/+3
| | | | | | | | | | | | | | | BUG=chrome-os-partner:53729 BRANCH=None TEST=Manual on gru. Verify .rodata.evtsrcs section is non-empty in ec.RO.map. Verify that we're no longer spammed with HC 0x67 (due to constantly asserted interrupt). Change-Id: I57ad1ba7fbdd99dfab84341560aff094ce9bc5b6 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/347415 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* MKBP event signalling implementationVic Yang2014-10-241-0/+37
This implements a new API for EC modules to define MKBP event sources and send MKBP event to the AP. Also, a new host command EC_CMD_GET_NEXT_EVENT is added for the AP to query the pending MKBP events. Each event type may have custom event data sent along with the event. BRANCH=None BUG=chrome-os-partner:33194 TEST=Enable MKBP event on Ryu. Set a host event from EC console, run 'ectool nextevent', and see MKBP event 0x01 (HOST_EVENT) and the set host event. Signed-off-by: Vic Yang <victoryang@chromium.org> Change-Id: I28a1b7e826bcc102bbe39016c9bb3e37d125664c Reviewed-on: https://chromium-review.googlesource.com/224905 Reviewed-by: Randall Spangler <rspangler@chromium.org>