g: Remove unused CONFIG_RBOX_DEBUG feature

This feature is not enabled, is awkwardly written, and shouldn't
be left lying around to use as a bad example. This CL doesn't
change any compiled code.

A followup CL will add a working RBOX interrupt handler.

BUG=none
BRANCH=none
TEST=make buildall; test on Cr50 hardware

Change-Id: I5d0701f55ab9521bf1f29e7ec18994c4401d68fb
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373600
Tested-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
This commit is contained in:
Bill Richardson
2016-08-19 17:57:55 -07:00
committed by chrome-bot
parent 0f5f4862e2
commit 9a59b5ea9c
3 changed files with 2 additions and 95 deletions

View File

@@ -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);

View File

@@ -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 */

View File

@@ -1560,9 +1560,6 @@
/* Enable rbox peripheral */
#undef CONFIG_RBOX
/* Enable rbox debug interrupts */
#undef CONFIG_RBOX_DEBUG
/* Enable RDD peripheral */
#undef CONFIG_RDD