mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-05 22:41:44 +00:00
Currently, chip/g uses jtag_pre_init() to do some chip
pre-initialization that isn't actually related to JTAG. This has been
harmless, but it's currently the only chip which actually does "JTAG"
pre-init, and we'd like to get rid of that. So, move that
functionality to a new optional chip_pre_init() function.
BUG=chromium:747629
BRANCH=cr50
TEST=make buildall
boot cr50
make all dis; confirm chip_pre_init() is called early in <main>
Change-Id: I3cae0747ab0c3cc974fce9f108947207b38e035f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/629876
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
29 lines
869 B
C
29 lines
869 B
C
/* Copyright 2017 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 "board_config.h"
|
|
#include "registers.h"
|
|
|
|
void chip_pre_init(void)
|
|
{
|
|
/*
|
|
* If we're resuming from deep sleep we need to undo some stuff as soon
|
|
* as possible and this is the first init function that's called.
|
|
*
|
|
* It doesn't hurt anything if this setup is not needed, but we don't
|
|
* investigate the reset cause until much later (and doing so is
|
|
* destructive), so we'll just do the post-deep-sleep setup every time.
|
|
*/
|
|
|
|
/* Disable the deep sleep triggers */
|
|
GR_PMU_LOW_POWER_DIS = 0;
|
|
GR_PMU_EXITPD_MASK = 0;
|
|
|
|
/* Unfreeze the USB module */
|
|
GWRITE_FIELD(USB, PCGCCTL, STOPPCLK, 0);
|
|
GWRITE_FIELD(USB, PCGCCTL, RSTPDWNMODULE, 0);
|
|
GWRITE_FIELD(USB, PCGCCTL, PWRCLMP, 0);
|
|
}
|