summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2022-04-28 15:24:07 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-05-09 17:20:02 +0000
commita6fcdc3cffaf8d987514fcac48645869f171ac3e (patch)
tree6548faa9abfcbf362534c03c0a49f00671b779ac
parent1f7729ef769edef30b973df227f9acf4344ad295 (diff)
downloadchrome-ec-a6fcdc3cffaf8d987514fcac48645869f171ac3e.tar.gz
nissa: enable PROCHOT monitoring
The EC_PROCHOT_ODL signal was connected to the throttle_ap_prochot_input_interrupt, but the interrupt was never enabled. Configure the PROCHOT input and enable the interrupt, which will log to the EC console when PROCHOT is detected. If the board provides fans, then the fans are also enabled during PROCHOT conditions. BUG=b:230783041 BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I686a684e86d3c9897e7c980e41c3d4a2995e0ccc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3615481 Reviewed-by: Andrew McRae <amcrae@google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
-rw-r--r--zephyr/projects/nissa/src/common.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/zephyr/projects/nissa/src/common.c b/zephyr/projects/nissa/src/common.c
index 741702a7b2..cd6c4fb502 100644
--- a/zephyr/projects/nissa/src/common.c
+++ b/zephyr/projects/nissa/src/common.c
@@ -11,15 +11,24 @@
#include "charge_state_v2.h"
#include "chipset.h"
#include "cros_cbi.h"
+#include "gpio/gpio_int.h"
#include "hooks.h"
#include "usb_mux.h"
#include "system.h"
+#include "throttle_ap.h"
#include "nissa_common.h"
#include <logging/log.h>
LOG_MODULE_REGISTER(nissa, CONFIG_NISSA_LOG_LEVEL);
+#define PROCHOT_GPIO_ENUM \
+ GPIO_SIGNAL(DT_PROP(DT_NODELABEL(int_prochot), irq_pin))
+
+static const struct prochot_cfg nissa_prochot_cfg = {
+ .gpio_prochot_in = PROCHOT_GPIO_ENUM,
+};
+
struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
{
.usb_port = 0,
@@ -79,6 +88,10 @@ static void board_setup_init(void)
cached_usb_pd_port_count = 2;
break;
}
+
+ /* Enable PROCHOT monitoring */
+ throttle_ap_config_prochot(&nissa_prochot_cfg);
+ gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_prochot));
}
/*
* Make sure setup is done after EEPROM is readable.