base/include/asm-arm/arch-pxa/rtai_arch.h

Go to the documentation of this file.
00001 /* rtai/include/asm-arm/arch-pxa/rtai_arch.h 00002 ------------------------------------------------------------- 00003 DON´T include directly - it's included through asm-arm/rtai.h 00004 ------------------------------------------------------------- 00005 COPYRIGHT (C) 2002 Guennadi Liakhovetski, DSA GmbH (gl@dsa-ac.de) 00006 COPYRIGHT (C) 2002 Wolfgang Müller (wolfgang.mueller@dsa-ac.de) 00007 Copyright (c) 2001 Alex Züpke, SYSGO RTS GmbH (azu@sysgo.de) 00008 Copyright (c) 2005 Luca Pizzi, (lucapizzi@hotmail.com) 00009 Copyright (c) 2005 Stefano Gafforelli, (stefano.gafforelli@tiscali.it) 00010 00011 This program is free software; you can redistribute it and/or modify 00012 it under the terms of version 2 of the GNU General Public License as 00013 published by the Free Software Foundation. 00014 00015 This program is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the Free Software 00022 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 */ 00024 /* 00025 -------------------------------------------------------------------------- 00026 Acknowledgements 00027 - Paolo Mantegazza (mantegazza@aero.polimi.it) 00028 creator of RTAI 00029 */ 00030 00031 #ifndef _ASM_ARCH_RTAI_ARCH_H_ 00032 #define _ASM_ARCH_RTAI_ARCH_H_ 00033 00034 #define FREQ_SYS_CLK 3686400 00035 #define LATENCY_MATCH_REG 2000 00036 #define SETUP_TIME_MATCH_REG 600 00037 #define LATENCY_TICKS (LATENCY_MATCH_REG/(1000000000/FREQ_SYS_CLK)) 00038 #define SETUP_TIME_TICKS (SETUP_TIME_MATCH_REG/(1000000000/FREQ_SYS_CLK)) 00039 00040 #define RTAI_TIMER_IRQ IRQ_OST0 00041 00042 #define ARCH_MUX_IRQ IRQ_GPIO_2_80 00043 #define RTAI_TIMER_MAXVAL 0xFFFF 00044 00045 /* clock frequency of timer that generates timer-interrupt [Hz] */ 00046 #define RTAI_TIMER_FREQ CLOCK_TICK_RATE 00047 #include <asm/arch/irq.h> 00048 00049 #define RTAI_TSC_FREQ FREQ_SYS_CLK 00050 00051 #define RTAI_CALIBRATED_CPU_FREQ RTAI_TSC_FREQ 00052 00053 /* name of timer */ 00054 #define RTAI_TIMER_NAME "TIMER1" 00055 00056 /* - oneshot timer latency (is subtracted from oneshot delay) [nanoseconds] 00057 * (specify it with TSC resolution (because it is used this way in the scheduler)) */ 00058 #define RTAI_TIMER_LATENCY \ 00059 0 00060 // ((int)((6 * 1000000000LL + RTAI_TSC_FREQ/2) / (long long)RTAI_TSC_FREQ)) 00061 00062 /* - oneshot timer setup delay (i.e. minimal oneshot delay) [nanoseconds] 00063 * (specify it with TSC resolution) */ 00064 #define RTAI_TIMER_SETUP_TIME \ 00065 0 00066 // ((int)((3 * 1000000000LL + RTAI_TSC_FREQ/2) / (long long)RTAI_TSC_FREQ)) 00067 00068 static unsigned long rtai_cpufreq_arg = RTAI_CALIBRATED_CPU_FREQ; 00069 00070 extern struct calibration_data rtai_tunables; 00071 00072 void rtai_pxa_GPIO_2_80_demux( int irq, void *dev_id, struct pt_regs *regs ); 00073 00074 #if 0 00075 static inline void arch_mount_rtai( void ) 00076 { 00077 /* Let's take care about our "special" IRQ11 */ 00078 // free_irq( IRQ_GPIO_2_80 ); 00079 rt_request_irq( IRQ_GPIO_2_80, (void *) rtai_pxa_GPIO_2_80_demux, 0, 0); 00080 } 00081 00082 static inline void arch_umount_rtai( void ) 00083 { 00084 rt_release_irq( IRQ_GPIO_2_80 ); 00085 // request_irq( IRQ_GPIO_2_80, pxa_GPIO_2_80_demux, SA_INTERRUPT, "GPIO 2-80", NULL ); 00086 } 00087 #endif 00088 00089 extern inline void 00090 rtai_archdep_init(void) 00091 { 00092 if (rtai_cpufreq_arg == 0) { 00093 adsysinfo_t sysinfo; 00094 adeos_get_sysinfo(&sysinfo); 00095 rtai_cpufreq_arg = (unsigned long)sysinfo.cpufreq; 00096 } 00097 } 00098 00099 extern inline void 00100 rtai_archdep_exit(void) 00101 { 00102 /* nothing to do */ 00103 } 00104 00105 /* Check, if this is a demultiplexed irq */ 00106 #define isdemuxirq(irq) (irq >= IRQ_GPIO(2)) 00107 00108 #endif 00109

Generated on Thu Nov 20 11:49:48 2008 for RTAI API by doxygen 1.3.8