summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrathmesh Prabhu <pprabhu@chromium.org>2014-08-13 17:47:31 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-08-14 17:38:54 +0000
commit8fc6f22b4d87d79b59e17c6b31a13256ab077354 (patch)
tree026ed20c39f4a8f1c271c23031781ba77ee87a30
parent8ce7b3cd334e3b7e257325822225143fafb5c916 (diff)
downloadchrome-ec-8fc6f22b4d87d79b59e17c6b31a13256ab077354.tar.gz
Kip: Power cycle cellular modem on AP warm reboot
We want to power cycle the cellular modem on AP reboot because the modem does not handle the kernel/USB reboot well. This is a board specific hack that keys in on the LPC bus reset caused by the AP reboot to power cycle the modem. BUG=chrome-os-partner:31217 BRANCH=kip TEST=(1) Verify reboot is sane -- no panic from EC/Kernel. (2) Verify that modem does not disappear from USB across DUT reboots. This is a flaky failure -- reboot the DUT >200 times. Change-Id: I86dd6df908f215f18780cdc439d656e98e398cf1 Signed-off-by: Prathmesh Prabhu <pprabhu@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/212143 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--board/kip/board.c25
-rw-r--r--board/kip/board.h3
-rw-r--r--chip/lm4/lpc.c4
3 files changed, 32 insertions, 0 deletions
diff --git a/board/kip/board.c b/board/kip/board.c
index 074ab671b2..6949464dbb 100644
--- a/board/kip/board.c
+++ b/board/kip/board.c
@@ -7,13 +7,16 @@
#include "adc.h"
#include "adc_chip.h"
#include "backlight.h"
+#include "board.h"
#include "charge_state.h"
#include "charger.h"
#include "common.h"
+#include "console.h"
#include "driver/temp_sensor/tmp432.h"
#include "extpower.h"
#include "gpio.h"
#include "host_command.h"
+#include "hooks.h"
#include "i2c.h"
#include "jtag.h"
#include "keyboard_scan.h"
@@ -224,3 +227,25 @@ int board_discharge_on_ac(int enable)
{
return charger_discharge_on_ac(enable);
}
+
+static void modem_power_on(void)
+{
+ cprintf(CC_HOOK, "[%T GPIO_PP3300_LTE_EN %d->1]\n",
+ gpio_get_level(GPIO_PP3300_LTE_EN));
+ gpio_set_level(GPIO_PP3300_LTE_EN, 1);
+}
+DECLARE_DEFERRED(modem_power_on);
+
+static void modem_power_cycle(void)
+{
+ cprintf(CC_HOOK, "[%T GPIO_PP3300_LTE_EN %d->0]\n",
+ gpio_get_level(GPIO_PP3300_LTE_EN));
+ gpio_set_level(GPIO_PP3300_LTE_EN, 0);
+ hook_call_deferred(modem_power_on, 30 * MSEC);
+}
+
+/* Reset the modem when AP is reset. */
+void board_ap_warm_reset(void)
+{
+ modem_power_cycle();
+}
diff --git a/board/kip/board.h b/board/kip/board.h
index b19cca115c..13e0827c1f 100644
--- a/board/kip/board.h
+++ b/board/kip/board.h
@@ -197,6 +197,9 @@ enum temp_sensor_id {
/* Discharge battery when on AC power for factory test. */
int board_discharge_on_ac(int enable);
+/* Reset the modem when the AP is reset. */
+void board_ap_warm_reset(void);
+
#endif /* !__ASSEMBLER__ */
#endif /* __BOARD_H */
diff --git a/chip/lm4/lpc.c b/chip/lm4/lpc.c
index 99f212af19..bee266987e 100644
--- a/chip/lm4/lpc.c
+++ b/chip/lm4/lpc.c
@@ -625,6 +625,10 @@ static void lpc_interrupt(void)
CPRINTF("[%T LPC RESET# %sasserted]\n",
lpc_get_pltrst_asserted() ? "" : "de");
+#ifdef BOARD_KIP
+ if (!lpc_get_pltrst_asserted())
+ board_ap_warm_reset();
+#endif
}
}
DECLARE_IRQ(LM4_IRQ_LPC, lpc_interrupt, 2);