xref: /OK3568_Linux_fs/kernel/arch/m68k/include/asm/timex.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * linux/include/asm-m68k/timex.h
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * m68k architecture timex specifications
6*4882a593Smuzhiyun  */
7*4882a593Smuzhiyun #ifndef _ASMm68K_TIMEX_H
8*4882a593Smuzhiyun #define _ASMm68K_TIMEX_H
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #ifdef CONFIG_COLDFIRE
11*4882a593Smuzhiyun /*
12*4882a593Smuzhiyun  * CLOCK_TICK_RATE should give the underlying frequency of the tick timer
13*4882a593Smuzhiyun  * to make ntp work best.  For Coldfires, that's the main clock.
14*4882a593Smuzhiyun  */
15*4882a593Smuzhiyun #include <asm/coldfire.h>
16*4882a593Smuzhiyun #define CLOCK_TICK_RATE	MCF_CLK
17*4882a593Smuzhiyun #else
18*4882a593Smuzhiyun /*
19*4882a593Smuzhiyun  * This default CLOCK_TICK_RATE is probably wrong for many 68k boards
20*4882a593Smuzhiyun  * Users of those boards will need to check and modify accordingly
21*4882a593Smuzhiyun  */
22*4882a593Smuzhiyun #define CLOCK_TICK_RATE	1193180 /* Underlying HZ */
23*4882a593Smuzhiyun #endif
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun typedef unsigned long cycles_t;
26*4882a593Smuzhiyun 
get_cycles(void)27*4882a593Smuzhiyun static inline cycles_t get_cycles(void)
28*4882a593Smuzhiyun {
29*4882a593Smuzhiyun 	return 0;
30*4882a593Smuzhiyun }
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun extern unsigned long (*mach_random_get_entropy)(void);
33*4882a593Smuzhiyun 
random_get_entropy(void)34*4882a593Smuzhiyun static inline unsigned long random_get_entropy(void)
35*4882a593Smuzhiyun {
36*4882a593Smuzhiyun 	if (mach_random_get_entropy)
37*4882a593Smuzhiyun 		return mach_random_get_entropy();
38*4882a593Smuzhiyun 	return random_get_entropy_fallback();
39*4882a593Smuzhiyun }
40*4882a593Smuzhiyun #define random_get_entropy	random_get_entropy
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun #endif
43