mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
This counter will count the number of times the system enters deep sleep. This is mainly for debugging purposes. With access to the deep sleep count you can start a s3 suspend stress for hundreds of iterations and verify that cr50 entered and resumed from deep sleep the right number of times. BUG=none BRANCH=cr50 TEST=Wait until cr50 enters deep sleep. Wake it up and verify the counter increased. Run 'idle C' and verify it is reset to 0. Change-Id: Icb70a2fefedd82ea10934093f4c917da16b8d4ea Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/448334 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
/* 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_EC_INIT_CHIP_H
|
|
#define __CROS_EC_INIT_CHIP_H
|
|
|
|
/**
|
|
* This is the current state of the PMU persistent registers. There are two
|
|
* types: long life and pwrdn scratch. Long life will persist through any
|
|
* reset other than POR. PWRDN scratch only survives deep sleep.
|
|
*
|
|
* LONG_LIFE_SCRATCH 0 - 2
|
|
* SCRATCH0 - Rollback counter
|
|
* SCRATCH1 - Board properties
|
|
* SCRATCH2
|
|
*
|
|
* PWRDN_SCRATCH 0 - 15 - Locked
|
|
*
|
|
* PWRDN_SCRATCH 16 - 27 - Can be used by RW
|
|
* SCRATCH16 - Indicator that firmware is running for debug purposes
|
|
* SCRATCH17 - deep sleep count
|
|
* SCRATCH18 - Preserving USB_DCFG through deep sleep
|
|
*
|
|
* PWRDN_SCRATCH 28 - 31 - Reserved for boot rom
|
|
*/
|
|
|
|
|
|
enum permission_level {
|
|
PERMISSION_LOW = 0x00,
|
|
PERMISSION_MEDIUM = 0x33, /* APPS run at medium */
|
|
PERMISSION_HIGH = 0x3C,
|
|
PERMISSION_HIGHEST = 0x55
|
|
};
|
|
|
|
int runlevel_is_high(void);
|
|
void init_runlevel(const enum permission_level desired_level);
|
|
|
|
void init_jittery_clock(int highsec);
|
|
void init_sof_clock(void);
|
|
|
|
#endif /* __CROS_EC_INIT_CHIP_H */
|