initial commit with v2.6.9
[linux-2.6.9-moxart.git] / include / asm-m68knommu / nap.h
blob9ac7ccf686286a69e3a47c9541736b7f081bdcda
1 /****************************************************************************/
3 /*
4 * nap.h -- Marconi/NAP support.
6 * (C) Copyright 2001, SnapGear (www.snapgear.com)
7 */
9 /****************************************************************************/
10 #ifndef nap_h
11 #define nap_h
12 /****************************************************************************/
14 #include <linux/config.h>
16 /****************************************************************************/
17 #ifdef CONFIG_MARCONINAP
18 /****************************************************************************/
20 #ifdef CONFIG_COLDFIRE
21 #include <asm/coldfire.h>
22 #include <asm/mcfsim.h>
23 #endif
26 * Command to support selecting RS232 or RS422 mode on the
27 * second COM port.
29 #define TIOCSET422 0x4d01 /* Set port mode 232 or 422 */
30 #define TIOCGET422 0x4d02 /* Get current port mode */
33 * Low level control of the RS232/422 enable.
35 #define MCFPP_PA11 0x0800
37 #ifndef __ASSEMBLY__
39 * RS232/422 control is via the single PA11 line. Low is the RS422
40 * enable, high is RS232 mode.
42 static __inline__ unsigned int mcf_getpa(void)
44 volatile unsigned short *pp;
45 pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PADAT);
46 return((unsigned int) *pp);
49 static __inline__ void mcf_setpa(unsigned int mask, unsigned int bits)
51 volatile unsigned short *pp;
52 unsigned long flags;
54 pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PADAT);
55 save_flags(flags); cli();
56 *pp = (*pp & ~mask) | bits;
57 restore_flags(flags);
59 #endif /* __ASSEMBLY__ */
61 /****************************************************************************/
63 #if defined(CONFIG_M5272)
65 * Marconi/NAP based hardware. DTR/DCD lines are wired to GPB lines.
67 #define MCFPP_DCD0 0x0080
68 #define MCFPP_DCD1 0x0020
69 #define MCFPP_DTR0 0x0040
70 #define MCFPP_DTR1 0x0010
72 #ifndef __ASSEMBLY__
74 * These functions defined to give quasi generic access to the
75 * PPIO bits used for DTR/DCD.
77 static __inline__ unsigned int mcf_getppdata(void)
79 volatile unsigned short *pp;
80 pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDAT);
81 return((unsigned int) *pp);
84 static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)
86 volatile unsigned short *pp;
87 pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDAT);
88 *pp = (*pp & ~mask) | bits;
90 #endif /* __ASSEMBLY__ */
91 #endif /* CONFIG_M5272 */
93 /****************************************************************************/
94 #endif /* CONFIG_MARCONINAP */
95 /****************************************************************************/
96 #endif /* nap_h */