mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
mec1322: clock: Use full-speed 48MHz processor clock during EC boot
EC boot / hash computing can be a bottleneck for system boot time. Reduce this bottleneck by running our processor at 48 MHz through boot, until vboot hashing of RW completes. BUG=chrome-os-partner:49583 TEST=Boot chell, verify vboot hash completes within 1 sec of EC boot and 'cbmem' delta between 'vboot select&load kernel' and 'finished EC verification' is reduced to ~250 ms (which includes sysjump time). BRANCH=glados Change-Id: I18d87e685b89decef761e51517bfcfc43dcf8ef0 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/326792 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
c7b96d514d
commit
9c053ea898
@@ -134,7 +134,7 @@
|
||||
#undef CONFIG_CONSOLE_CMDHELP
|
||||
|
||||
#undef DEFERRABLE_MAX_COUNT
|
||||
#define DEFERRABLE_MAX_COUNT 14
|
||||
#define DEFERRABLE_MAX_COUNT 15
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
#undef CONFIG_CONSOLE_CMDHELP
|
||||
|
||||
#undef DEFERRABLE_MAX_COUNT
|
||||
#define DEFERRABLE_MAX_COUNT 15
|
||||
#define DEFERRABLE_MAX_COUNT 16
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
#define I2C_PORT_USB_CHARGER_2 MEC1322_I2C0_0
|
||||
|
||||
#undef DEFERRABLE_MAX_COUNT
|
||||
#define DEFERRABLE_MAX_COUNT 15
|
||||
#define DEFERRABLE_MAX_COUNT 16
|
||||
|
||||
#define CONFIG_ALS
|
||||
#define CONFIG_ALS_OPT3001
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "common.h"
|
||||
#include "console.h"
|
||||
#include "cpu.h"
|
||||
#include "hooks.h"
|
||||
#include "hwtimer.h"
|
||||
#include "registers.h"
|
||||
#include "shared_mem.h"
|
||||
@@ -17,6 +18,7 @@
|
||||
#include "timer.h"
|
||||
#include "uart.h"
|
||||
#include "util.h"
|
||||
#include "vboot_hash.h"
|
||||
|
||||
/* Console output macros */
|
||||
#define CPUTS(outstr) cputs(CC_CLOCK, outstr)
|
||||
@@ -74,6 +76,23 @@ void clock_init(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Speed through boot + vboot hash calculation, dropping our processor clock
|
||||
* only after vboot hashing is completed.
|
||||
*/
|
||||
static void clock_turbo_disable(void)
|
||||
{
|
||||
#ifdef CONFIG_VBOOT_HASH
|
||||
if (vboot_hash_in_progress())
|
||||
hook_call_deferred(clock_turbo_disable, 100 * MSEC);
|
||||
else
|
||||
#endif
|
||||
/* Use 12 MHz processor clock for power savings */
|
||||
MEC1322_PCR_PROC_CLK_CTL = 4;
|
||||
}
|
||||
DECLARE_HOOK(HOOK_INIT, clock_turbo_disable, HOOK_PRIO_INIT_VBOOT_HASH + 1);
|
||||
DECLARE_DEFERRED(clock_turbo_disable);
|
||||
|
||||
#ifdef CONFIG_LOW_POWER_IDLE
|
||||
/**
|
||||
* initialization of Hibernation timer
|
||||
|
||||
@@ -235,6 +235,9 @@ void lfw_main()
|
||||
/* install vector table */
|
||||
*((uintptr_t *) 0xe000ed08) = (uintptr_t) &hdr_int_vect;
|
||||
|
||||
/* Use 48 MHz processor clock to power through boot */
|
||||
MEC1322_PCR_PROC_CLK_CTL = 1;
|
||||
|
||||
#ifdef CONFIG_WATCHDOG
|
||||
/* Reload watchdog which may be running in case of sysjump */
|
||||
MEC1322_WDG_KICK = 1;
|
||||
|
||||
@@ -235,7 +235,7 @@ static void vboot_hash_init(void)
|
||||
NULL, 0);
|
||||
}
|
||||
}
|
||||
DECLARE_HOOK(HOOK_INIT, vboot_hash_init, HOOK_PRIO_DEFAULT);
|
||||
DECLARE_HOOK(HOOK_INIT, vboot_hash_init, HOOK_PRIO_INIT_VBOOT_HASH);
|
||||
|
||||
#ifdef CONFIG_SAVE_VBOOT_HASH
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@ enum hook_priority {
|
||||
HOOK_PRIO_INIT_PWM = HOOK_PRIO_FIRST + 6,
|
||||
/* Extpower inits before modules which might use it (battery, LEDs) */
|
||||
HOOK_PRIO_INIT_EXTPOWER = HOOK_PRIO_FIRST + 7,
|
||||
/* Init VBOOT hash later, since it depends on deferred functions */
|
||||
HOOK_PRIO_INIT_VBOOT_HASH = HOOK_PRIO_FIRST + 8,
|
||||
|
||||
/* Specific values to lump temperature-related hooks together */
|
||||
HOOK_PRIO_TEMP_SENSOR = 6000,
|
||||
|
||||
Reference in New Issue
Block a user