blob: c0945bf2b7578e67a7ca4c84ced62140983ebcdd [file] [log] [blame]
/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
/*
* arch/arm/cpu/armv8/gxl/firmware/scp_task/lib/delay.c
*
* Copyright (C) 2020 Amlogic, Inc. All rights reserved.
*
*/
#define P_EE_TIMER_E (*((volatile unsigned *)(0xc1100000 + (0x2662 << 2))))
unsigned int get_time(void)
{
return P_EE_TIMER_E;
}
void _udelay(unsigned int us)
{
unsigned int t0 = get_time();
while (get_time() - t0 <= us)
;
}