Xenomai  3.0.8
calibration.h
1 /*
2  * Copyright (C) 2001,2002,2003,2004,2005 Philippe Gerum <rpm@xenomai.org>.
3  *
4  * ARM port
5  * Copyright (C) 2005 Stelian Pop
6  *
7  * Xenomai is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * Xenomai is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with Xenomai; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20  * 02111-1307, USA.
21  */
22 #ifndef _COBALT_ARM_ASM_CALIBRATION_H
23 #define _COBALT_ARM_ASM_CALIBRATION_H
24 
25 unsigned int omap_rev(void);
26 #define cpu_is_omap44xx() ((omap_rev() & 0xff) == 0x44)
27 
28 static inline void xnarch_get_latencies(struct xnclock_gravity *p)
29 {
30  unsigned int ulat;
31 #if CONFIG_XENO_OPT_TIMING_SCHEDLAT != 0
32  ulat = CONFIG_XENO_OPT_TIMING_SCHEDLAT;
33 #elif defined(CONFIG_ARCH_AT91RM9200)
34  ulat = 8500;
35 #elif defined(CONFIG_ARCH_AT91SAM9263)
36  ulat = 11000;
37 #elif defined(CONFIG_SOC_IMX6Q)
38  ulat = 6000;
39 #elif defined(CONFIG_ARCH_MX51)
40  ulat = 5000;
41 #elif defined(CONFIG_ARCH_MX53)
42  ulat = 5000;
43 #elif defined(CONFIG_ARCH_MX6)
44  ulat = 2000;
45 #elif defined(CONFIG_SOC_IMX7)
46  ulat = 2000;
47 #elif defined(CONFIG_SOC_LS1021A)
48  ulat = 2800;
49 #elif defined(CONFIG_ARCH_OMAP)
50  ulat = cpu_is_omap44xx() ? 2500 : 5000;
51 #elif defined(CONFIG_ARCH_STI)
52  ulat = 6000;
53 #elif defined(CONFIG_ARCH_SOCFPGA)
54  ulat = 4500;
55 #else
56  ulat = 9500; /* XXX sane? */
57 #endif
58  p->user = xnclock_ns_to_ticks(&nkclock, ulat);
59  p->kernel = xnclock_ns_to_ticks(&nkclock, CONFIG_XENO_OPT_TIMING_KSCHEDLAT);
60  p->irq = xnclock_ns_to_ticks(&nkclock, CONFIG_XENO_OPT_TIMING_IRQLAT);
61 }
62 
63 #endif /* !_COBALT_ARM_ASM_CALIBRATION_H */