Exemplo n.º 1
0
void chipset_reset(int is_cold)
{
	if (is_cold) {
		CPRINTS("EC triggered cold reboot");
		power_off();
		/* After POWER_GOOD is dropped off,
		 * the system will be on again
		 */
		power_request = POWER_REQ_ON;
	} else {
		CPRINTS("EC triggered warm reboot");
		CPRINTS("assert GPIO_PMIC_WARM_RESET_L for %d ms",
				PMIC_WARM_RESET_L_HOLD_TIME / MSEC);
		set_pmic_warm_reset(1);
		usleep(PMIC_WARM_RESET_L_HOLD_TIME);
		set_pmic_warm_reset(0);
	}
}
Exemplo n.º 2
0
static void chipset_turn_off_power_rails(void)
{
	/* Release the power on pin, if it was asserted */
	set_pmic_pwron(0);
	/* Close the pmic power source immediately */
	set_pmic_source(0);

	/* Keep AP and PMIC in reset the whole time */
	set_pmic_warm_reset(1);
}
Exemplo n.º 3
0
/**
 * Power on the AP
 */
static void power_on(void)
{
	int i;

	set_pmic_source(1);
	usleep(PMIC_SOURCE_STARTUP_TIME);

	set_pmic_pwron(1);
	/*
	 * BUG Workaround(crosbug.com/p/31635): usleep hangs in task when using
	 * big delays.
	 */
	for (i = 0; i < PMIC_STARTUP_MS; i++)
		usleep(1 * MSEC);

	set_pmic_warm_reset(0);
}
Exemplo n.º 4
0
/**
 * Power on the AP
 */
static void power_on(void)
{
	int i;

	set_pmic_source(1);
	usleep(PMIC_SOURCE_STARTUP_TIME);

	set_pmic_pwron(1);
	/*
	 * BUG Workaround(crosbug.com/p/31635): usleep hangs in task when using
	 * big delays.
	 */
	for (i = 0; i < PMIC_STARTUP_MS; i++)
		usleep(1 * MSEC);

	/* Reset the PMIC to make sure it's in a known state. */
	set_pmic_reset(1);
	usleep(PMIC_RESET_HOLD_TIME);
	set_pmic_reset(0);
	set_pmic_warm_reset(0);
}