summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/g/rbox.c59
-rw-r--r--chip/g/rbox.h35
-rw-r--r--include/config.h3
3 files changed, 2 insertions, 95 deletions
diff --git a/chip/g/rbox.c b/chip/g/rbox.c
index ec10643728..d4c01b27ce 100644
--- a/chip/g/rbox.c
+++ b/chip/g/rbox.c
@@ -4,63 +4,12 @@
*/
#include "clock.h"
-#include "gpio.h"
#include "hooks.h"
-#include "rbox.h"
-#include "task.h"
-
-#ifdef CONFIG_RBOX_DEBUG
-RBOX_INT(KEY0_IN_FED, "KEY0 pressed");
-RBOX_INT(KEY0_IN_RED, "KEY0 released");
-RBOX_INT(KEY1_IN_FED, "KEY1 pressed");
-RBOX_INT(KEY1_IN_RED, "KEY1 released");
-RBOX_INT(PWRB_IN_FED, "PWRB pressed");
-RBOX_INT(PWRB_IN_RED, "PWRB released");
-RBOX_INT(EC_RST_RED, "EC RST rising");
-RBOX_INT(EC_RST_FED, "EC RST falling");
-RBOX_INT(AC_PRESENT_RED, "AC attached");
-RBOX_INT(AC_PRESENT_FED, "AC detached");
-
-RBOX_INT(BUTTON_COMBO0_RDY, "COMBO0");
-RBOX_INT(BUTTON_COMBO1_RDY, "COMBO1");
-RBOX_INT(BUTTON_COMBO2_RDY, "COMBO2");
-
-static void enable_interrupts(void)
-{
- ENABLE_INT_RF(ENTERING_RW);
- ENABLE_INT_RF(AC_PRESENT);
- ENABLE_INT_RF(PWRB_IN);
- ENABLE_INT_RF(KEY1_IN);
- ENABLE_INT_RF(KEY0_IN);
- ENABLE_INT_RF(EC_RST);
- ENABLE_INT(BUTTON_COMBO0_RDY);
- ENABLE_INT(BUTTON_COMBO1_RDY);
- ENABLE_INT(BUTTON_COMBO2_RDY);
-
- task_enable_irq(GC_IRQNUM_RBOX0_INTR_AC_PRESENT_FED_INT);
- task_enable_irq(GC_IRQNUM_RBOX0_INTR_AC_PRESENT_RED_INT);
-
- task_enable_irq(GC_IRQNUM_RBOX0_INTR_PWRB_IN_FED_INT);
- task_enable_irq(GC_IRQNUM_RBOX0_INTR_PWRB_IN_RED_INT);
-
- task_enable_irq(GC_IRQNUM_RBOX0_INTR_KEY0_IN_RED_INT);
- task_enable_irq(GC_IRQNUM_RBOX0_INTR_KEY0_IN_FED_INT);
-
- task_enable_irq(GC_IRQNUM_RBOX0_INTR_KEY1_IN_RED_INT);
- task_enable_irq(GC_IRQNUM_RBOX0_INTR_KEY1_IN_FED_INT);
-
- task_enable_irq(GC_IRQNUM_RBOX0_INTR_EC_RST_RED_INT);
- task_enable_irq(GC_IRQNUM_RBOX0_INTR_EC_RST_FED_INT);
-
- task_enable_irq(GC_IRQNUM_RBOX0_INTR_BUTTON_COMBO0_RDY_INT);
- task_enable_irq(GC_IRQNUM_RBOX0_INTR_BUTTON_COMBO1_RDY_INT);
- task_enable_irq(GC_IRQNUM_RBOX0_INTR_BUTTON_COMBO2_RDY_INT);
-}
-#endif
+#include "registers.h"
static void rbox_release_ec_reset(void)
{
- /* Let the EC go. */
+ /* Let the EC go (the RO bootloader asserts it ASAP after POR) */
GREG32(RBOX, ASSERT_EC_RST) = 0;
/* And unfreeze the PINMUX */
@@ -77,9 +26,5 @@ static void rbox_init(void)
GWRITE(RBOX, WAKEUP_CLEAR, 1);
GWRITE(RBOX, WAKEUP_CLEAR, 0);
GWRITE(RBOX, INT_STATE, 1);
-
-#ifdef CONFIG_RBOX_DEBUG
- enable_interrupts();
-#endif
}
DECLARE_HOOK(HOOK_INIT, rbox_init, HOOK_PRIO_DEFAULT - 1);
diff --git a/chip/g/rbox.h b/chip/g/rbox.h
deleted file mode 100644
index 20e9b1ecba..0000000000
--- a/chip/g/rbox.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright 2016 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef __CROS_RBOX_H
-#define __CROS_RBOX_H
-
-#include "console.h"
-#include "registers.h"
-
-/* Console output macros */
-#define CPUTS(outstr) cputs(CC_RBOX, outstr)
-#define CPRINTS(format, args...) cprints(CC_RBOX, format, ## args)
-
-#ifdef CONFIG_RBOX_DEBUG
-#define INTR(field) CONCAT2(INTR_, field)
-
-#define ENABLE_INT(field) GWRITE_FIELD(RBOX, INT_ENABLE, INTR(field), 1)
-#define ENABLE_INT_RF(field) (ENABLE_INT(CONCAT2(field, _RED)) && \
- ENABLE_INT(CONCAT2(field, _FED)))
-
-#define RBOX_INT(NAME, NAME_STR) \
- \
- DECLARE_IRQ(CONCAT3(GC_IRQNUM_RBOX0_INTR_, NAME, _INT), \
- CONCAT2(NAME, _int_), 1); \
- void CONCAT2(NAME, _int_)(void) \
- { \
- CPRINTS("%s", NAME_STR); \
- /* Clear interrupt */ \
- GWRITE_FIELD(RBOX, INT_STATE, INTR(NAME), 1); \
- }
-
-#endif /* DEBUG_RBOX */
-#endif /* __CROS_RBOX_H */
diff --git a/include/config.h b/include/config.h
index 66bbf22e94..b9ca01831c 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1560,9 +1560,6 @@
/* Enable rbox peripheral */
#undef CONFIG_RBOX
-/* Enable rbox debug interrupts */
-#undef CONFIG_RBOX_DEBUG
-
/* Enable RDD peripheral */
#undef CONFIG_RDD