1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
/* 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.
*/
#include "clock.h"
#include "hooks.h"
#include "registers.h"
int rbox_is_asserting_ec_reset(void)
{
return GREAD(RBOX, ASSERT_EC_RST);
}
static void rbox_release_ec_reset(void)
{
/* Let the EC go (the RO bootloader asserts it ASAP after POR) */
GREG32(RBOX, ASSERT_EC_RST) = 0;
/* And unfreeze the PINMUX */
GREG32(PINMUX, HOLD) = 0;
}
DECLARE_HOOK(HOOK_INIT, rbox_release_ec_reset, HOOK_PRIO_LAST);
static void rbox_init(void)
{
/* Enable RBOX */
clock_enable_module(MODULE_RBOX, 1);
/* Clear existing interrupts */
GWRITE(RBOX, WAKEUP_CLEAR, 1);
GWRITE(RBOX, WAKEUP_CLEAR, 0);
GWRITE(RBOX, INT_STATE, 1);
}
DECLARE_HOOK(HOOK_INIT, rbox_init, HOOK_PRIO_DEFAULT - 1);
|