soc/intel/alderlake: Add ADL-P 4+4 with 28W TDP
[coreboot.git] / src / lib / timer.c
blob8a06f57bc7b14145a24d4b6047f5d788e1ead130
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <timer.h>
4 #include <delay.h>
5 #include <thread.h>
7 __weak void init_timer(void) { /* do nothing */ }
9 void udelay(unsigned int usec)
11 struct stopwatch sw;
14 * As the timer granularity is in microseconds pad the
15 * requested delay by one to get at least >= requested usec delay.
17 usec += 1;
19 if (!thread_yield_microseconds(usec))
20 return;
22 stopwatch_init_usecs_expire(&sw, usec);
23 stopwatch_wait_until_expired(&sw);