OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-m68knommu/] [nettel.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
/****************************************************************************/
2
 
3
/*
4
 *      nettel.h -- Moreton Bay NETtel support.
5
 *
6
 *      (C) Copyright 1999, Moreton Bay (www.moreton.com.au)
7
 */
8
 
9
/****************************************************************************/
10
#ifndef nettel_h
11
#define nettel_h
12
/****************************************************************************/
13
 
14
#include <linux/config.h>
15
#include <asm/coldfire.h>
16
 
17
#ifdef CONFIG_NETtel
18
 
19
/*
20
 *      Define LED bank address and flags...
21
 *      Different NETtel modems are configured a little differently.
22
 */
23
 
24
#ifdef CONFIG_M5307
25
#define NETtel_LEDADDR          0x30400000
26
 
27
#define NETtel_LEDVPN           0x01
28
#define NETtel_LEDUSB2          0x02
29
#define NETtel_LEDTX1           0x04
30
#define NETtel_LEDRX1           0x08
31
#define NETtel_LEDTX2           0x10
32
#define NETtel_LEDRX2           0x20
33
#define NETtel_LEDUSB1          0x40
34
#define NETtel_LEDETH           0x80
35
 
36
/*
37
 *      The POWER and DIAG LEDs are on parallel I/O pins of 5307.
38
 *      The serial port DTR and DCD lines are also on the Parallel I/O.
39
 */
40
#define NETtel_LEDPWR           0x0040
41
#define NETtel_LEDDIAG          0x0020
42
 
43
#define NETtel_DCD1             0x0001
44
#define NETtel_DCD0             0x0002
45
#define NETtel_DTR1             0x0004
46
#define NETtel_DTR0             0x0008
47
#endif /* CONFIG_M5307 */
48
 
49
 
50
#ifdef CONFIG_M5206e
51
/*
52
 *      NETtel 1500 only has 4 LEDs.
53
 */
54
#define NETtel_LEDADDR          0x50000000
55
 
56
#define NETtel_LEDDIAG          0x01
57
#define NETtel_LEDDCD           0x02
58
#define NETtel_LEDOH            0x04
59
#define NETtel_LEDDATA          0x08
60
#endif /* CONFIG_M5206e */
61
 
62
 
63
/*
64
 *      User space routines for back door access to the LEDs :-)
65
 *      This is a complete and utter bastard hack... But quick...
66
 *      The "on" pattern turns on some LEDs permanently. The "off"
67
 *      pattern turns some LEDs off permantly. The "flash" pattern
68
 *      will flash a particular led pattern.
69
 */
70
#define LEDON(x)        *((unsigned char *) 0x3fe) |= (x)
71
#define LEDOFF(x)       *((unsigned char *) 0x3fe) &= ~(x)
72
#define LEDFLASH(x)     *((unsigned char *) 0x3ff) = (x)
73
 
74
#define GETLED()        *((unsigned char *) 0x3fe)
75
#define GETFLASH()      *((unsigned char *) 0x3ff)
76
 
77
 
78
/*
79
 *      Kernel macros to set and unset the LEDs.
80
 */
81
#ifndef __ASSEMBLY__
82
extern unsigned char    ledbank;
83
#ifdef CONFIG_M5307
84
extern unsigned short   ppdata;
85
#endif /* CONFIG_M5307 */
86
#endif /* __ASSEMBLY__ */
87
 
88
/*
89
 *      The following macros apply to the basic latched LEDs.
90
 *      (Not any other LEDs hanging of PP bits)
91
 */
92
#define setled(x)                                                       \
93
        *((volatile unsigned char *) NETtel_LEDADDR) = (ledbank &= ~(x))
94
 
95
#define unsetled(x)                                                     \
96
        *((volatile unsigned char *) NETtel_LEDADDR) = (ledbank |= (x))
97
 
98
#define writeled(x)                                                     \
99
        *((volatile unsigned char *) NETtel_LEDADDR) = (ledbank & ~(x))
100
 
101
#define rewriteled()                                                    \
102
        *((volatile unsigned char *) NETtel_LEDADDR) = ledbank
103
 
104
 
105
/*
106
 *      The following macros set and unset the POWER and DIAG LEDS.
107
 *      They are treated separate since they are on ColdFire PP lines
108
 *      on the NETtels > 2500.
109
 */
110
#ifdef CONFIG_M5206e
111
#define setledpp(x)     setled(x)
112
#define unsetledpp(x)   unsetled(x)
113
#else
114
 
115
#define setledpp(x)                                                     \
116
        *((volatile unsigned short *) (MCF_MBAR + MCFSIM_PADAT)) =      \
117
                (ppdata &= ~(x))
118
 
119
#define unsetledpp(x)                                                   \
120
        *((volatile unsigned short *) (MCF_MBAR + MCFSIM_PADAT)) =      \
121
                (ppdata |= (x))
122
 
123
#endif
124
 
125
 
126
/*
127
 *      Panic setup for NETtel. No console on the NETtel so it may be
128
 *      difficult to tell if the unit has paniced or not. So this little
129
 *      macro will turn on all the LEDS - for a visual indicator of panic.
130
 */
131
#define nettel_panic()          { cli(); setled(0xff); setledpp(0x60); }
132
 
133
#endif  /* CONFIG_NETtel */
134
 
135
/****************************************************************************/
136
#endif  /* nettel_h */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.