Use busy wait for LPC clock start delay

This avoids switching to another task and potentially
violating timing / sequencing requirements in the process.

Test case: pressing power button instead of using obmcutil
no longer crashes Zephyr when powering on the host platform.
parent bccea670
......@@ -2541,7 +2541,7 @@ int power_on_chassis(int has_lock)
gpio1_out_write(gpio1_out_read() | (0x01 << 12));
// Wait a few ms for the external clock buffer to stabilize
k_usleep(16 * 1000);
k_busy_wait(16 * 1000);
// Bring the LPC PLL back out of reset, if present
// If no PLL is present, this operation does nothing
......@@ -2555,11 +2555,12 @@ int power_on_chassis(int has_lock)
{
if ((k_uptime_get() - clock_valid_timer) > 1000)
{
printf("LPC clock did not come online, aborting!\n");
KESTREL_LOG("LPC clock did not come online, aborting!");
power_off_chassis(1);
return -6;
}
} while (!((read_aquila_register(HOSTLPCSLAVE_BASE, AQUILA_LPC_REG_STATUS4) >> AQUILA_LPC_CLOCK_VALID_SHIFT) & AQUILA_LPC_CLOCK_VALID_MASK));
KESTREL_LOG("LPC bus clock online!");
host_power_status = HOST_POWER_STATUS_IPLING;
host_power_status_changed();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment