arm64: dts: Revert "specify console via command line"
[linux/fpc-iii.git] / arch / unicore32 / include / asm / delay.h
blob934193edfa6680b0a85da4af41edaa0dec30306c
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * linux/arch/unicore32/include/asm/delay.h
5 * Code specific to PKUnity SoC and UniCore ISA
7 * Copyright (C) 2001-2010 GUAN Xue-tao
9 * Delay routines, using a pre-computed "loops_per_second" value.
11 #ifndef __UNICORE_DELAY_H__
12 #define __UNICORE_DELAY_H__
14 #include <asm/param.h> /* HZ */
16 extern void __delay(int loops);
19 * This function intentionally does not exist; if you see references to
20 * it, it means that you're calling udelay() with an out of range value.
22 * With currently imposed limits, this means that we support a max delay
23 * of 2000us. Further limits: HZ<=1000 and bogomips<=3355
25 extern void __bad_udelay(void);
28 * division by multiplication: you don't have to worry about
29 * loss of precision.
31 * Use only for very small delays ( < 1 msec). Should probably use a
32 * lookup table, really, as the multiplications take much too long with
33 * short delays. This is a "reasonable" implementation, though (and the
34 * first constant multiplications gets optimized away if the delay is
35 * a constant)
37 extern void __udelay(unsigned long usecs);
38 extern void __const_udelay(unsigned long);
40 #define MAX_UDELAY_MS 2
42 #define udelay(n) \
43 (__builtin_constant_p(n) ? \
44 ((n) > (MAX_UDELAY_MS * 1000) ? __bad_udelay() : \
45 __const_udelay((n) * ((2199023U*HZ)>>11))) : \
46 __udelay(n))
48 #endif /* __UNICORE_DELAY_H__ */