diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-07-11 09:55:48 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-07-11 09:55:48 -0400 |
commit | db1b39d8b860e3716620c225bc86e0ec41764e34 (patch) | |
tree | 8739074db733ef767400ea92cfbfed9352ddb92d /include | |
parent | a6bc432e296dfa1f05d4b586ca5ca3085a2d42d7 (diff) | |
parent | 4eb6bf6bfb580afaf1e1a1d30cba17a078530cf4 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include')
116 files changed, 3765 insertions, 1783 deletions
diff --git a/include/asm-arm26/termbits.h b/include/asm-arm26/termbits.h index a3f4fe1742d0..f66b51804736 100644 --- a/include/asm-arm26/termbits.h +++ b/include/asm-arm26/termbits.h | |||
@@ -15,7 +15,7 @@ struct termios { | |||
15 | cc_t c_cc[NCCS]; /* control characters */ | 15 | cc_t c_cc[NCCS]; /* control characters */ |
16 | }; | 16 | }; |
17 | 17 | ||
18 | struct ktermios { | 18 | struct termios2 { |
19 | tcflag_t c_iflag; /* input mode flags */ | 19 | tcflag_t c_iflag; /* input mode flags */ |
20 | tcflag_t c_oflag; /* output mode flags */ | 20 | tcflag_t c_oflag; /* output mode flags */ |
21 | tcflag_t c_cflag; /* control mode flags */ | 21 | tcflag_t c_cflag; /* control mode flags */ |
@@ -26,6 +26,16 @@ struct ktermios { | |||
26 | speed_t c_ospeed; /* output speed */ | 26 | speed_t c_ospeed; /* output speed */ |
27 | }; | 27 | }; |
28 | 28 | ||
29 | struct ktermios { | ||
30 | tcflag_t c_iflag; /* input mode flags */ | ||
31 | tcflag_t c_oflag; /* output mode flags */ | ||
32 | tcflag_t c_cflag; /* control mode flags */ | ||
33 | tcflag_t c_lflag; /* local mode flags */ | ||
34 | cc_t c_line; /* line discipline */ | ||
35 | cc_t c_cc[NCCS]; /* control characters */ | ||
36 | speed_t c_ispeed; /* input speed */ | ||
37 | speed_t c_ospeed; /* output speed */ | ||
38 | }; | ||
29 | 39 | ||
30 | /* c_cc characters */ | 40 | /* c_cc characters */ |
31 | #define VINTR 0 | 41 | #define VINTR 0 |
diff --git a/include/asm-avr32/termbits.h b/include/asm-avr32/termbits.h index c215fafdae4d..db2daab31fdb 100644 --- a/include/asm-avr32/termbits.h +++ b/include/asm-avr32/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct termios2 { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | struct ktermios { | 31 | struct ktermios { |
21 | tcflag_t c_iflag; /* input mode flags */ | 32 | tcflag_t c_iflag; /* input mode flags */ |
22 | tcflag_t c_oflag; /* output mode flags */ | 33 | tcflag_t c_oflag; /* output mode flags */ |
diff --git a/include/asm-blackfin/termbits.h b/include/asm-blackfin/termbits.h index 2fd9dabdba77..4eac38de8ce1 100644 --- a/include/asm-blackfin/termbits.h +++ b/include/asm-blackfin/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct termios2 { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | struct ktermios { | 31 | struct ktermios { |
21 | tcflag_t c_iflag; /* input mode flags */ | 32 | tcflag_t c_iflag; /* input mode flags */ |
22 | tcflag_t c_oflag; /* output mode flags */ | 33 | tcflag_t c_oflag; /* output mode flags */ |
diff --git a/include/asm-cris/termbits.h b/include/asm-cris/termbits.h index 8d8cec225fe1..6cc2e2736f7b 100644 --- a/include/asm-cris/termbits.h +++ b/include/asm-cris/termbits.h | |||
@@ -19,6 +19,17 @@ struct termios { | |||
19 | cc_t c_cc[NCCS]; /* control characters */ | 19 | cc_t c_cc[NCCS]; /* control characters */ |
20 | }; | 20 | }; |
21 | 21 | ||
22 | struct termios2 { | ||
23 | tcflag_t c_iflag; /* input mode flags */ | ||
24 | tcflag_t c_oflag; /* output mode flags */ | ||
25 | tcflag_t c_cflag; /* control mode flags */ | ||
26 | tcflag_t c_lflag; /* local mode flags */ | ||
27 | cc_t c_line; /* line discipline */ | ||
28 | cc_t c_cc[NCCS]; /* control characters */ | ||
29 | speed_t c_ispeed; /* input speed */ | ||
30 | speed_t c_ospeed; /* output speed */ | ||
31 | }; | ||
32 | |||
22 | struct ktermios { | 33 | struct ktermios { |
23 | tcflag_t c_iflag; /* input mode flags */ | 34 | tcflag_t c_iflag; /* input mode flags */ |
24 | tcflag_t c_oflag; /* output mode flags */ | 35 | tcflag_t c_oflag; /* output mode flags */ |
diff --git a/include/asm-frv/termbits.h b/include/asm-frv/termbits.h index 2d6d389cff49..74851b424d4f 100644 --- a/include/asm-frv/termbits.h +++ b/include/asm-frv/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct termios2 { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | struct ktermios { | 31 | struct ktermios { |
21 | tcflag_t c_iflag; /* input mode flags */ | 32 | tcflag_t c_iflag; /* input mode flags */ |
22 | tcflag_t c_oflag; /* output mode flags */ | 33 | tcflag_t c_oflag; /* output mode flags */ |
diff --git a/include/asm-generic/bitops/sched.h b/include/asm-generic/bitops/sched.h index 815bb0148060..604fab7031a6 100644 --- a/include/asm-generic/bitops/sched.h +++ b/include/asm-generic/bitops/sched.h | |||
@@ -6,28 +6,23 @@ | |||
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Every architecture must define this function. It's the fastest | 8 | * Every architecture must define this function. It's the fastest |
9 | * way of searching a 140-bit bitmap where the first 100 bits are | 9 | * way of searching a 100-bit bitmap. It's guaranteed that at least |
10 | * unlikely to be set. It's guaranteed that at least one of the 140 | 10 | * one of the 100 bits is cleared. |
11 | * bits is cleared. | ||
12 | */ | 11 | */ |
13 | static inline int sched_find_first_bit(const unsigned long *b) | 12 | static inline int sched_find_first_bit(const unsigned long *b) |
14 | { | 13 | { |
15 | #if BITS_PER_LONG == 64 | 14 | #if BITS_PER_LONG == 64 |
16 | if (unlikely(b[0])) | 15 | if (b[0]) |
17 | return __ffs(b[0]); | 16 | return __ffs(b[0]); |
18 | if (likely(b[1])) | 17 | return __ffs(b[1]) + 64; |
19 | return __ffs(b[1]) + 64; | ||
20 | return __ffs(b[2]) + 128; | ||
21 | #elif BITS_PER_LONG == 32 | 18 | #elif BITS_PER_LONG == 32 |
22 | if (unlikely(b[0])) | 19 | if (b[0]) |
23 | return __ffs(b[0]); | 20 | return __ffs(b[0]); |
24 | if (unlikely(b[1])) | 21 | if (b[1]) |
25 | return __ffs(b[1]) + 32; | 22 | return __ffs(b[1]) + 32; |
26 | if (unlikely(b[2])) | 23 | if (b[2]) |
27 | return __ffs(b[2]) + 64; | 24 | return __ffs(b[2]) + 64; |
28 | if (b[3]) | 25 | return __ffs(b[3]) + 96; |
29 | return __ffs(b[3]) + 96; | ||
30 | return __ffs(b[4]) + 128; | ||
31 | #else | 26 | #else |
32 | #error BITS_PER_LONG not defined | 27 | #error BITS_PER_LONG not defined |
33 | #endif | 28 | #endif |
diff --git a/include/asm-h8300/termbits.h b/include/asm-h8300/termbits.h index 6a1f4d3807b4..e877b40ac5ba 100644 --- a/include/asm-h8300/termbits.h +++ b/include/asm-h8300/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct termios2 { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | struct ktermios { | 31 | struct ktermios { |
21 | tcflag_t c_iflag; /* input mode flags */ | 32 | tcflag_t c_iflag; /* input mode flags */ |
22 | tcflag_t c_oflag; /* output mode flags */ | 33 | tcflag_t c_oflag; /* output mode flags */ |
diff --git a/include/asm-i386/mach-es7000/mach_apic.h b/include/asm-i386/mach-es7000/mach_apic.h index 2d978928a395..caec64be516d 100644 --- a/include/asm-i386/mach-es7000/mach_apic.h +++ b/include/asm-i386/mach-es7000/mach_apic.h | |||
@@ -73,6 +73,10 @@ static inline void init_apic_ldr(void) | |||
73 | apic_write_around(APIC_LDR, val); | 73 | apic_write_around(APIC_LDR, val); |
74 | } | 74 | } |
75 | 75 | ||
76 | #ifndef CONFIG_X86_GENERICARCH | ||
77 | extern void enable_apic_mode(void); | ||
78 | #endif | ||
79 | |||
76 | extern int apic_version [MAX_APICS]; | 80 | extern int apic_version [MAX_APICS]; |
77 | static inline void setup_apic_routing(void) | 81 | static inline void setup_apic_routing(void) |
78 | { | 82 | { |
diff --git a/include/asm-i386/mach-es7000/mach_mpparse.h b/include/asm-i386/mach-es7000/mach_mpparse.h index b9fb784e1fd5..8aa10547b4b1 100644 --- a/include/asm-i386/mach-es7000/mach_mpparse.h +++ b/include/asm-i386/mach-es7000/mach_mpparse.h | |||
@@ -18,6 +18,12 @@ extern int parse_unisys_oem (char *oemptr); | |||
18 | extern int find_unisys_acpi_oem_table(unsigned long *oem_addr); | 18 | extern int find_unisys_acpi_oem_table(unsigned long *oem_addr); |
19 | extern void setup_unisys(void); | 19 | extern void setup_unisys(void); |
20 | 20 | ||
21 | #ifndef CONFIG_X86_GENERICARCH | ||
22 | extern int acpi_madt_oem_check(char *oem_id, char *oem_table_id); | ||
23 | extern int mps_oem_check(struct mp_config_table *mpc, char *oem, | ||
24 | char *productid); | ||
25 | #endif | ||
26 | |||
21 | #ifdef CONFIG_ACPI | 27 | #ifdef CONFIG_ACPI |
22 | 28 | ||
23 | static inline int es7000_check_dsdt(void) | 29 | static inline int es7000_check_dsdt(void) |
diff --git a/include/asm-ia64/termbits.h b/include/asm-ia64/termbits.h index 4531a511bde5..7fae3109ef47 100644 --- a/include/asm-ia64/termbits.h +++ b/include/asm-ia64/termbits.h | |||
@@ -26,6 +26,17 @@ struct termios { | |||
26 | cc_t c_cc[NCCS]; /* control characters */ | 26 | cc_t c_cc[NCCS]; /* control characters */ |
27 | }; | 27 | }; |
28 | 28 | ||
29 | struct termios2 { | ||
30 | tcflag_t c_iflag; /* input mode flags */ | ||
31 | tcflag_t c_oflag; /* output mode flags */ | ||
32 | tcflag_t c_cflag; /* control mode flags */ | ||
33 | tcflag_t c_lflag; /* local mode flags */ | ||
34 | cc_t c_line; /* line discipline */ | ||
35 | cc_t c_cc[NCCS]; /* control characters */ | ||
36 | speed_t c_ispeed; /* input speed */ | ||
37 | speed_t c_ospeed; /* output speed */ | ||
38 | }; | ||
39 | |||
29 | struct ktermios { | 40 | struct ktermios { |
30 | tcflag_t c_iflag; /* input mode flags */ | 41 | tcflag_t c_iflag; /* input mode flags */ |
31 | tcflag_t c_oflag; /* output mode flags */ | 42 | tcflag_t c_oflag; /* output mode flags */ |
diff --git a/include/asm-m32r/termbits.h b/include/asm-m32r/termbits.h index e402641dfbad..6be3b8a39841 100644 --- a/include/asm-m32r/termbits.h +++ b/include/asm-m32r/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct termios2 { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | struct ktermios { | 31 | struct ktermios { |
21 | tcflag_t c_iflag; /* input mode flags */ | 32 | tcflag_t c_iflag; /* input mode flags */ |
22 | tcflag_t c_oflag; /* output mode flags */ | 33 | tcflag_t c_oflag; /* output mode flags */ |
diff --git a/include/asm-m68k/termbits.h b/include/asm-m68k/termbits.h index a194092240fb..0e520f328f53 100644 --- a/include/asm-m68k/termbits.h +++ b/include/asm-m68k/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct termios2 { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | struct ktermios { | 31 | struct ktermios { |
21 | tcflag_t c_iflag; /* input mode flags */ | 32 | tcflag_t c_iflag; /* input mode flags */ |
22 | tcflag_t c_oflag; /* output mode flags */ | 33 | tcflag_t c_oflag; /* output mode flags */ |
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h index c6275088cf65..0b3ff9c48409 100644 --- a/include/asm-mips/addrspace.h +++ b/include/asm-mips/addrspace.h | |||
@@ -129,28 +129,12 @@ | |||
129 | #define PHYS_TO_XKPHYS(cm,a) (_CONST64_(0x8000000000000000) | \ | 129 | #define PHYS_TO_XKPHYS(cm,a) (_CONST64_(0x8000000000000000) | \ |
130 | ((cm)<<59) | (a)) | 130 | ((cm)<<59) | (a)) |
131 | 131 | ||
132 | #if defined (CONFIG_CPU_R4300) \ | 132 | /* |
133 | || defined (CONFIG_CPU_R4X00) \ | 133 | * The ultimate limited of the 64-bit MIPS architecture: 2 bits for selecting |
134 | || defined (CONFIG_CPU_R5000) \ | 134 | * the region, 3 bits for the CCA mode. This leaves 59 bits of which the |
135 | || defined (CONFIG_CPU_RM7000) \ | 135 | * R8000 implements most with its 48-bit physical address space. |
136 | || defined (CONFIG_CPU_NEVADA) \ | 136 | */ |
137 | || defined (CONFIG_CPU_TX49XX) \ | 137 | #define TO_PHYS_MASK _CONST64_(0x07ffffffffffffff) /* 2^^59 - 1 */ |
138 | || defined (CONFIG_CPU_MIPS64) | ||
139 | #define TO_PHYS_MASK _CONST64_(0x0000000fffffffff) /* 2^^36 - 1 */ | ||
140 | #endif | ||
141 | |||
142 | #if defined (CONFIG_CPU_R8000) | ||
143 | /* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */ | ||
144 | #define TO_PHYS_MASK _CONST64_(0x000000ffffffffff) /* 2^^40 - 1 */ | ||
145 | #endif | ||
146 | |||
147 | #if defined (CONFIG_CPU_R10000) | ||
148 | #define TO_PHYS_MASK _CONST64_(0x000000ffffffffff) /* 2^^40 - 1 */ | ||
149 | #endif | ||
150 | |||
151 | #if defined(CONFIG_CPU_SB1) || defined(CONFIG_CPU_SB1A) | ||
152 | #define TO_PHYS_MASK _CONST64_(0x00000fffffffffff) /* 2^^44 - 1 */ | ||
153 | #endif | ||
154 | 138 | ||
155 | #ifndef CONFIG_CPU_R8000 | 139 | #ifndef CONFIG_CPU_R8000 |
156 | 140 | ||
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h index b0c329783ac5..087126a5faf9 100644 --- a/include/asm-mips/bootinfo.h +++ b/include/asm-mips/bootinfo.h | |||
@@ -109,18 +109,12 @@ | |||
109 | #define MACH_COSINE_ORION 0 | 109 | #define MACH_COSINE_ORION 0 |
110 | 110 | ||
111 | /* | 111 | /* |
112 | * Valid machtype for group GALILEO | ||
113 | */ | ||
114 | #define MACH_GROUP_GALILEO 11 /* Galileo Eval Boards */ | ||
115 | #define MACH_EV64120A 0 /* EV64120A */ | ||
116 | |||
117 | /* | ||
118 | * Valid machtype for group MOMENCO | 112 | * Valid machtype for group MOMENCO |
119 | */ | 113 | */ |
120 | #define MACH_GROUP_MOMENCO 12 /* Momentum Boards */ | 114 | #define MACH_GROUP_MOMENCO 12 /* Momentum Boards */ |
121 | #define MACH_MOMENCO_OCELOT 0 | 115 | #define MACH_MOMENCO_OCELOT 0 |
122 | #define MACH_MOMENCO_OCELOT_G 1 /* no more supported (may 2007) */ | 116 | #define MACH_MOMENCO_OCELOT_G 1 /* no more supported (may 2007) */ |
123 | #define MACH_MOMENCO_OCELOT_C 2 | 117 | #define MACH_MOMENCO_OCELOT_C 2 /* no more supported (jun 2007) */ |
124 | #define MACH_MOMENCO_JAGUAR_ATX 3 /* no more supported (may 2007) */ | 118 | #define MACH_MOMENCO_JAGUAR_ATX 3 /* no more supported (may 2007) */ |
125 | #define MACH_MOMENCO_OCELOT_3 4 | 119 | #define MACH_MOMENCO_OCELOT_3 4 |
126 | 120 | ||
@@ -194,13 +188,6 @@ | |||
194 | #define MACH_HP_LASERJET 1 | 188 | #define MACH_HP_LASERJET 1 |
195 | 189 | ||
196 | /* | 190 | /* |
197 | * Valid machtype for group LASAT | ||
198 | */ | ||
199 | #define MACH_GROUP_LASAT 21 | ||
200 | #define MACH_LASAT_100 0 /* Masquerade II/SP100/SP50/SP25 */ | ||
201 | #define MACH_LASAT_200 1 /* Masquerade PRO/SP200 */ | ||
202 | |||
203 | /* | ||
204 | * Valid machtype for group TITAN | 191 | * Valid machtype for group TITAN |
205 | */ | 192 | */ |
206 | #define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */ | 193 | #define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */ |
@@ -213,6 +200,27 @@ | |||
213 | #define MACH_GROUP_NEC_EMMA2RH 25 /* NEC EMMA2RH (was 23) */ | 200 | #define MACH_GROUP_NEC_EMMA2RH 25 /* NEC EMMA2RH (was 23) */ |
214 | #define MACH_NEC_MARKEINS 0 /* NEC EMMA2RH Mark-eins */ | 201 | #define MACH_NEC_MARKEINS 0 /* NEC EMMA2RH Mark-eins */ |
215 | 202 | ||
203 | /* | ||
204 | * Valid machtype for group LEMOTE | ||
205 | */ | ||
206 | #define MACH_GROUP_LEMOTE 27 | ||
207 | #define MACH_LEMOTE_FULONG 0 | ||
208 | |||
209 | /* | ||
210 | * Valid machtype for group PMC-MSP | ||
211 | */ | ||
212 | #define MACH_GROUP_MSP 26 /* PMC-Sierra MSP boards/CPUs */ | ||
213 | #define MACH_MSP4200_EVAL 0 /* PMC-Sierra MSP4200 Evaluation */ | ||
214 | #define MACH_MSP4200_GW 1 /* PMC-Sierra MSP4200 Gateway demo */ | ||
215 | #define MACH_MSP4200_FPGA 2 /* PMC-Sierra MSP4200 Emulation */ | ||
216 | #define MACH_MSP7120_EVAL 3 /* PMC-Sierra MSP7120 Evaluation */ | ||
217 | #define MACH_MSP7120_GW 4 /* PMC-Sierra MSP7120 Residential GW */ | ||
218 | #define MACH_MSP7120_FPGA 5 /* PMC-Sierra MSP7120 Emulation */ | ||
219 | #define MACH_MSP_OTHER 255 /* PMC-Sierra unknown board type */ | ||
220 | |||
221 | #define MACH_GROUP_WINDRIVER 28 /* Windriver boards */ | ||
222 | #define MACH_WRPPMC 1 | ||
223 | |||
216 | #define CL_SIZE COMMAND_LINE_SIZE | 224 | #define CL_SIZE COMMAND_LINE_SIZE |
217 | 225 | ||
218 | const char *get_system_type(void); | 226 | const char *get_system_type(void); |
diff --git a/include/asm-mips/cacheops.h b/include/asm-mips/cacheops.h index c4a1ec31ff6a..df7f2deb3b56 100644 --- a/include/asm-mips/cacheops.h +++ b/include/asm-mips/cacheops.h | |||
@@ -20,7 +20,11 @@ | |||
20 | #define Index_Load_Tag_D 0x05 | 20 | #define Index_Load_Tag_D 0x05 |
21 | #define Index_Store_Tag_I 0x08 | 21 | #define Index_Store_Tag_I 0x08 |
22 | #define Index_Store_Tag_D 0x09 | 22 | #define Index_Store_Tag_D 0x09 |
23 | #if defined(CONFIG_CPU_LOONGSON2) | ||
24 | #define Hit_Invalidate_I 0x00 | ||
25 | #else | ||
23 | #define Hit_Invalidate_I 0x10 | 26 | #define Hit_Invalidate_I 0x10 |
27 | #endif | ||
24 | #define Hit_Invalidate_D 0x11 | 28 | #define Hit_Invalidate_D 0x11 |
25 | #define Hit_Writeback_Inv_D 0x15 | 29 | #define Hit_Writeback_Inv_D 0x15 |
26 | 30 | ||
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h index 5e4bed123b48..d95a83e3e1d7 100644 --- a/include/asm-mips/cpu-features.h +++ b/include/asm-mips/cpu-features.h | |||
@@ -150,6 +150,10 @@ | |||
150 | #define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT) | 150 | #define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT) |
151 | #endif | 151 | #endif |
152 | 152 | ||
153 | #ifndef cpu_has_userlocal | ||
154 | #define cpu_has_userlocal (cpu_data[0].options & MIPS_CPU_ULRI) | ||
155 | #endif | ||
156 | |||
153 | #ifdef CONFIG_32BIT | 157 | #ifdef CONFIG_32BIT |
154 | # ifndef cpu_has_nofpuex | 158 | # ifndef cpu_has_nofpuex |
155 | # define cpu_has_nofpuex (cpu_data[0].options & MIPS_CPU_NOFPUEX) | 159 | # define cpu_has_nofpuex (cpu_data[0].options & MIPS_CPU_NOFPUEX) |
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h index d38fdbf845b2..3857358fb6de 100644 --- a/include/asm-mips/cpu.h +++ b/include/asm-mips/cpu.h | |||
@@ -89,6 +89,8 @@ | |||
89 | #define PRID_IMP_34K 0x9500 | 89 | #define PRID_IMP_34K 0x9500 |
90 | #define PRID_IMP_24KE 0x9600 | 90 | #define PRID_IMP_24KE 0x9600 |
91 | #define PRID_IMP_74K 0x9700 | 91 | #define PRID_IMP_74K 0x9700 |
92 | #define PRID_IMP_LOONGSON1 0x4200 | ||
93 | #define PRID_IMP_LOONGSON2 0x6300 | ||
92 | 94 | ||
93 | /* | 95 | /* |
94 | * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE | 96 | * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE |
@@ -107,6 +109,7 @@ | |||
107 | * Definitions for 7:0 on legacy processors | 109 | * Definitions for 7:0 on legacy processors |
108 | */ | 110 | */ |
109 | 111 | ||
112 | #define PRID_REV_MASK 0x00ff | ||
110 | 113 | ||
111 | #define PRID_REV_TX4927 0x0022 | 114 | #define PRID_REV_TX4927 0x0022 |
112 | #define PRID_REV_TX4937 0x0030 | 115 | #define PRID_REV_TX4937 0x0030 |
@@ -123,6 +126,18 @@ | |||
123 | #define PRID_REV_VR4122 0x0070 | 126 | #define PRID_REV_VR4122 0x0070 |
124 | #define PRID_REV_VR4181A 0x0070 /* Same as VR4122 */ | 127 | #define PRID_REV_VR4181A 0x0070 /* Same as VR4122 */ |
125 | #define PRID_REV_VR4130 0x0080 | 128 | #define PRID_REV_VR4130 0x0080 |
129 | #define PRID_REV_34K_V1_0_2 0x0022 | ||
130 | |||
131 | /* | ||
132 | * Older processors used to encode processor version and revision in two | ||
133 | * 4-bit bitfields, the 4K seems to simply count up and even newer MTI cores | ||
134 | * have switched to use the 8-bits as 3:3:2 bitfield with the last field as | ||
135 | * the patch number. *ARGH* | ||
136 | */ | ||
137 | #define PRID_REV_ENCODE_44(ver, rev) \ | ||
138 | ((ver) << 4 | (rev)) | ||
139 | #define PRID_REV_ENCODE_332(ver, rev, patch) \ | ||
140 | ((ver) << 5 | (rev) << 2 | (patch)) | ||
126 | 141 | ||
127 | /* | 142 | /* |
128 | * FPU implementation/revision register (CP1 control register 0). | 143 | * FPU implementation/revision register (CP1 control register 0). |
@@ -200,7 +215,10 @@ | |||
200 | #define CPU_SB1A 62 | 215 | #define CPU_SB1A 62 |
201 | #define CPU_74K 63 | 216 | #define CPU_74K 63 |
202 | #define CPU_R14000 64 | 217 | #define CPU_R14000 64 |
203 | #define CPU_LAST 64 | 218 | #define CPU_LOONGSON1 65 |
219 | #define CPU_LOONGSON2 66 | ||
220 | |||
221 | #define CPU_LAST 66 | ||
204 | 222 | ||
205 | /* | 223 | /* |
206 | * ISA Level encodings | 224 | * ISA Level encodings |
@@ -246,6 +264,7 @@ | |||
246 | #define MIPS_CPU_PREFETCH 0x00080000 /* CPU has usable prefetch */ | 264 | #define MIPS_CPU_PREFETCH 0x00080000 /* CPU has usable prefetch */ |
247 | #define MIPS_CPU_VINT 0x00100000 /* CPU supports MIPSR2 vectored interrupts */ | 265 | #define MIPS_CPU_VINT 0x00100000 /* CPU supports MIPSR2 vectored interrupts */ |
248 | #define MIPS_CPU_VEIC 0x00200000 /* CPU supports MIPSR2 external interrupt controller mode */ | 266 | #define MIPS_CPU_VEIC 0x00200000 /* CPU supports MIPSR2 external interrupt controller mode */ |
267 | #define MIPS_CPU_ULRI 0x00400000 /* CPU has ULRI feature */ | ||
249 | 268 | ||
250 | /* | 269 | /* |
251 | * CPU ASE encodings | 270 | * CPU ASE encodings |
diff --git a/include/asm-mips/div64.h b/include/asm-mips/div64.h index 66189f5f6399..716371bd0980 100644 --- a/include/asm-mips/div64.h +++ b/include/asm-mips/div64.h | |||
@@ -20,7 +20,7 @@ | |||
20 | */ | 20 | */ |
21 | 21 | ||
22 | #define do_div64_32(res, high, low, base) ({ \ | 22 | #define do_div64_32(res, high, low, base) ({ \ |
23 | unsigned long __quot, __mod; \ | 23 | unsigned long __quot32, __mod32; \ |
24 | unsigned long __cf, __tmp, __tmp2, __i; \ | 24 | unsigned long __cf, __tmp, __tmp2, __i; \ |
25 | \ | 25 | \ |
26 | __asm__(".set push\n\t" \ | 26 | __asm__(".set push\n\t" \ |
@@ -48,12 +48,13 @@ | |||
48 | "bnez %4, 0b\n\t" \ | 48 | "bnez %4, 0b\n\t" \ |
49 | " srl %5, %1, 0x1f\n\t" \ | 49 | " srl %5, %1, 0x1f\n\t" \ |
50 | ".set pop" \ | 50 | ".set pop" \ |
51 | : "=&r" (__mod), "=&r" (__tmp), "=&r" (__quot), "=&r" (__cf), \ | 51 | : "=&r" (__mod32), "=&r" (__tmp), \ |
52 | "=&r" (__quot32), "=&r" (__cf), \ | ||
52 | "=&r" (__i), "=&r" (__tmp2) \ | 53 | "=&r" (__i), "=&r" (__tmp2) \ |
53 | : "Jr" (base), "0" (high), "1" (low)); \ | 54 | : "Jr" (base), "0" (high), "1" (low)); \ |
54 | \ | 55 | \ |
55 | (res) = __quot; \ | 56 | (res) = __quot32; \ |
56 | __mod; }) | 57 | __mod32; }) |
57 | 58 | ||
58 | #define do_div(n, base) ({ \ | 59 | #define do_div(n, base) ({ \ |
59 | unsigned long long __quot; \ | 60 | unsigned long long __quot; \ |
diff --git a/include/asm-mips/gpio.h b/include/asm-mips/gpio.h new file mode 100644 index 000000000000..06e46faf862d --- /dev/null +++ b/include/asm-mips/gpio.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef __ASM_MIPS_GPIO_H | ||
2 | #define __ASM_MIPS_GPIO_H | ||
3 | |||
4 | #include <gpio.h> | ||
5 | |||
6 | #endif /* __ASM_MIPS_GPIO_H */ | ||
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index 92ec2618560c..12bcc1f9fba9 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h | |||
@@ -178,6 +178,11 @@ extern void __iounmap(const volatile void __iomem *addr); | |||
178 | static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size, | 178 | static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size, |
179 | unsigned long flags) | 179 | unsigned long flags) |
180 | { | 180 | { |
181 | void __iomem *addr = plat_ioremap(offset, size, flags); | ||
182 | |||
183 | if (addr) | ||
184 | return addr; | ||
185 | |||
181 | #define __IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL)) | 186 | #define __IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL)) |
182 | 187 | ||
183 | if (cpu_has_64bit_addresses) { | 188 | if (cpu_has_64bit_addresses) { |
@@ -282,6 +287,9 @@ static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size, | |||
282 | 287 | ||
283 | static inline void iounmap(const volatile void __iomem *addr) | 288 | static inline void iounmap(const volatile void __iomem *addr) |
284 | { | 289 | { |
290 | if (plat_iounmap(addr)) | ||
291 | return; | ||
292 | |||
285 | #define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1) | 293 | #define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1) |
286 | 294 | ||
287 | if (cpu_has_64bit_addresses || | 295 | if (cpu_has_64bit_addresses || |
diff --git a/include/asm-mips/lasat/ds1603.h b/include/asm-mips/lasat/ds1603.h deleted file mode 100644 index edcd7544b358..000000000000 --- a/include/asm-mips/lasat/ds1603.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | #include <asm/addrspace.h> | ||
2 | |||
3 | /* Lasat 100 */ | ||
4 | #define DS1603_REG_100 (KSEG1ADDR(0x1c810000)) | ||
5 | #define DS1603_RST_100 (1 << 2) | ||
6 | #define DS1603_CLK_100 (1 << 0) | ||
7 | #define DS1603_DATA_SHIFT_100 1 | ||
8 | #define DS1603_DATA_100 (1 << DS1603_DATA_SHIFT_100) | ||
9 | |||
10 | /* Lasat 200 */ | ||
11 | #define DS1603_REG_200 (KSEG1ADDR(0x11000000)) | ||
12 | #define DS1603_RST_200 (1 << 3) | ||
13 | #define DS1603_CLK_200 (1 << 4) | ||
14 | #define DS1603_DATA_200 (1 << 5) | ||
15 | |||
16 | #define DS1603_DATA_REG_200 (DS1603_REG_200 + 0x10000) | ||
17 | #define DS1603_DATA_READ_SHIFT_200 9 | ||
18 | #define DS1603_DATA_READ_200 (1 << DS1603_DATA_READ_SHIFT_200) | ||
diff --git a/include/asm-mips/lasat/eeprom.h b/include/asm-mips/lasat/eeprom.h deleted file mode 100644 index 7b53edd5cd5f..000000000000 --- a/include/asm-mips/lasat/eeprom.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #include <asm/addrspace.h> | ||
2 | |||
3 | /* lasat 100 */ | ||
4 | #define AT93C_REG_100 KSEG1ADDR(0x1c810000) | ||
5 | #define AT93C_RDATA_REG_100 AT93C_REG_100 | ||
6 | #define AT93C_RDATA_SHIFT_100 4 | ||
7 | #define AT93C_WDATA_SHIFT_100 4 | ||
8 | #define AT93C_CS_M_100 ( 1 << 5 ) | ||
9 | #define AT93C_CLK_M_100 ( 1 << 3 ) | ||
10 | |||
11 | /* lasat 200 */ | ||
12 | #define AT93C_REG_200 KSEG1ADDR(0x11000000) | ||
13 | #define AT93C_RDATA_REG_200 (AT93C_REG_200+0x10000) | ||
14 | #define AT93C_RDATA_SHIFT_200 8 | ||
15 | #define AT93C_WDATA_SHIFT_200 2 | ||
16 | #define AT93C_CS_M_200 ( 1 << 0 ) | ||
17 | #define AT93C_CLK_M_200 ( 1 << 1 ) | ||
diff --git a/include/asm-mips/lasat/head.h b/include/asm-mips/lasat/head.h deleted file mode 100644 index f5589f31a197..000000000000 --- a/include/asm-mips/lasat/head.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * Image header stuff | ||
3 | */ | ||
4 | #ifndef _HEAD_H | ||
5 | #define _HEAD_H | ||
6 | |||
7 | #define LASAT_K_MAGIC0_VAL 0xfedeabba | ||
8 | #define LASAT_K_MAGIC1_VAL 0x00bedead | ||
9 | |||
10 | #ifndef _LANGUAGE_ASSEMBLY | ||
11 | #include <linux/types.h> | ||
12 | struct bootloader_header { | ||
13 | u32 magic[2]; | ||
14 | u32 version; | ||
15 | u32 image_start; | ||
16 | u32 image_size; | ||
17 | u32 kernel_start; | ||
18 | u32 kernel_entry; | ||
19 | }; | ||
20 | #endif | ||
21 | |||
22 | #endif /* _HEAD_H */ | ||
diff --git a/include/asm-mips/lasat/lasat.h b/include/asm-mips/lasat/lasat.h deleted file mode 100644 index 42077e367a5b..000000000000 --- a/include/asm-mips/lasat/lasat.h +++ /dev/null | |||
@@ -1,253 +0,0 @@ | |||
1 | /* | ||
2 | * lasat.h | ||
3 | * | ||
4 | * Thomas Horsten <thh@lasat.com> | ||
5 | * Copyright (C) 2000 LASAT Networks A/S. | ||
6 | * | ||
7 | * This program is free software; you can distribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License (Version 2) as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
14 | * for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
19 | * | ||
20 | * Configuration for LASAT boards, loads the appropriate include files. | ||
21 | */ | ||
22 | #ifndef _LASAT_H | ||
23 | #define _LASAT_H | ||
24 | |||
25 | #ifndef _LANGUAGE_ASSEMBLY | ||
26 | |||
27 | extern struct lasat_misc { | ||
28 | volatile u32 *reset_reg; | ||
29 | volatile u32 *flash_wp_reg; | ||
30 | u32 flash_wp_bit; | ||
31 | } *lasat_misc; | ||
32 | |||
33 | enum lasat_mtdparts { | ||
34 | LASAT_MTD_BOOTLOADER, | ||
35 | LASAT_MTD_SERVICE, | ||
36 | LASAT_MTD_NORMAL, | ||
37 | LASAT_MTD_CONFIG, | ||
38 | LASAT_MTD_FS, | ||
39 | LASAT_MTD_LAST | ||
40 | }; | ||
41 | |||
42 | /* | ||
43 | * The format of the data record in the EEPROM. | ||
44 | * See Documentation/LASAT/eeprom.txt for a detailed description | ||
45 | * of the fields in this struct, and the LASAT Hardware Configuration | ||
46 | * field specification for a detailed description of the config | ||
47 | * field. | ||
48 | */ | ||
49 | #include <linux/types.h> | ||
50 | |||
51 | #define LASAT_EEPROM_VERSION 7 | ||
52 | struct lasat_eeprom_struct { | ||
53 | unsigned int version; | ||
54 | unsigned int cfg[3]; | ||
55 | unsigned char hwaddr[6]; | ||
56 | unsigned char print_partno[12]; | ||
57 | unsigned char term0; | ||
58 | unsigned char print_serial[14]; | ||
59 | unsigned char term1; | ||
60 | unsigned char prod_partno[12]; | ||
61 | unsigned char term2; | ||
62 | unsigned char prod_serial[14]; | ||
63 | unsigned char term3; | ||
64 | unsigned char passwd_hash[16]; | ||
65 | unsigned char pwdnull; | ||
66 | unsigned char vendid; | ||
67 | unsigned char ts_ref; | ||
68 | unsigned char ts_signoff; | ||
69 | unsigned char reserved[11]; | ||
70 | unsigned char debugaccess; | ||
71 | unsigned short prid; | ||
72 | unsigned int serviceflag; | ||
73 | unsigned int ipaddr; | ||
74 | unsigned int netmask; | ||
75 | unsigned int crc32; | ||
76 | }; | ||
77 | |||
78 | struct lasat_eeprom_struct_pre7 { | ||
79 | unsigned int version; | ||
80 | unsigned int flags[3]; | ||
81 | unsigned char hwaddr0[6]; | ||
82 | unsigned char hwaddr1[6]; | ||
83 | unsigned char print_partno[9]; | ||
84 | unsigned char term0; | ||
85 | unsigned char print_serial[14]; | ||
86 | unsigned char term1; | ||
87 | unsigned char prod_partno[9]; | ||
88 | unsigned char term2; | ||
89 | unsigned char prod_serial[14]; | ||
90 | unsigned char term3; | ||
91 | unsigned char passwd_hash[24]; | ||
92 | unsigned char pwdnull; | ||
93 | unsigned char vendor; | ||
94 | unsigned char ts_ref; | ||
95 | unsigned char ts_signoff; | ||
96 | unsigned char reserved[6]; | ||
97 | unsigned int writecount; | ||
98 | unsigned int ipaddr; | ||
99 | unsigned int netmask; | ||
100 | unsigned int crc32; | ||
101 | }; | ||
102 | |||
103 | /* Configuration descriptor encoding - see the doc for details */ | ||
104 | |||
105 | #define LASAT_W0_DSCTYPE(v) ( ( (v) ) & 0xf ) | ||
106 | #define LASAT_W0_BMID(v) ( ( (v) >> 0x04 ) & 0xf ) | ||
107 | #define LASAT_W0_CPUTYPE(v) ( ( (v) >> 0x08 ) & 0xf ) | ||
108 | #define LASAT_W0_BUSSPEED(v) ( ( (v) >> 0x0c ) & 0xf ) | ||
109 | #define LASAT_W0_CPUCLK(v) ( ( (v) >> 0x10 ) & 0xf ) | ||
110 | #define LASAT_W0_SDRAMBANKSZ(v) ( ( (v) >> 0x14 ) & 0xf ) | ||
111 | #define LASAT_W0_SDRAMBANKS(v) ( ( (v) >> 0x18 ) & 0xf ) | ||
112 | #define LASAT_W0_L2CACHE(v) ( ( (v) >> 0x1c ) & 0xf ) | ||
113 | |||
114 | #define LASAT_W1_EDHAC(v) ( ( (v) ) & 0xf ) | ||
115 | #define LASAT_W1_HIFN(v) ( ( (v) >> 0x04 ) & 0x1 ) | ||
116 | #define LASAT_W1_ISDN(v) ( ( (v) >> 0x05 ) & 0x1 ) | ||
117 | #define LASAT_W1_IDE(v) ( ( (v) >> 0x06 ) & 0x1 ) | ||
118 | #define LASAT_W1_HDLC(v) ( ( (v) >> 0x07 ) & 0x1 ) | ||
119 | #define LASAT_W1_USVERSION(v) ( ( (v) >> 0x08 ) & 0x1 ) | ||
120 | #define LASAT_W1_4MACS(v) ( ( (v) >> 0x09 ) & 0x1 ) | ||
121 | #define LASAT_W1_EXTSERIAL(v) ( ( (v) >> 0x0a ) & 0x1 ) | ||
122 | #define LASAT_W1_FLASHSIZE(v) ( ( (v) >> 0x0c ) & 0xf ) | ||
123 | #define LASAT_W1_PCISLOTS(v) ( ( (v) >> 0x10 ) & 0xf ) | ||
124 | #define LASAT_W1_PCI1OPT(v) ( ( (v) >> 0x14 ) & 0xf ) | ||
125 | #define LASAT_W1_PCI2OPT(v) ( ( (v) >> 0x18 ) & 0xf ) | ||
126 | #define LASAT_W1_PCI3OPT(v) ( ( (v) >> 0x1c ) & 0xf ) | ||
127 | |||
128 | /* Routines specific to LASAT boards */ | ||
129 | |||
130 | #define LASAT_BMID_MASQUERADE2 0 | ||
131 | #define LASAT_BMID_MASQUERADEPRO 1 | ||
132 | #define LASAT_BMID_SAFEPIPE25 2 | ||
133 | #define LASAT_BMID_SAFEPIPE50 3 | ||
134 | #define LASAT_BMID_SAFEPIPE100 4 | ||
135 | #define LASAT_BMID_SAFEPIPE5000 5 | ||
136 | #define LASAT_BMID_SAFEPIPE7000 6 | ||
137 | #define LASAT_BMID_SAFEPIPE1000 7 | ||
138 | //#define LASAT_BMID_SAFEPIPE30 7 | ||
139 | //#define LASAT_BMID_SAFEPIPE5100 8 | ||
140 | //#define LASAT_BMID_SAFEPIPE7100 9 | ||
141 | #define LASAT_BMID_UNKNOWN 0xf | ||
142 | #define LASAT_MAX_BMID_NAMES 9 // no larger than 15! | ||
143 | |||
144 | #define LASAT_HAS_EDHAC ( 1 << 0 ) | ||
145 | #define LASAT_EDHAC_FAST ( 1 << 1 ) | ||
146 | #define LASAT_HAS_EADI ( 1 << 2 ) | ||
147 | #define LASAT_HAS_HIFN ( 1 << 3 ) | ||
148 | #define LASAT_HAS_ISDN ( 1 << 4 ) | ||
149 | #define LASAT_HAS_LEASEDLINE_IF ( 1 << 5 ) | ||
150 | #define LASAT_HAS_HDC ( 1 << 6 ) | ||
151 | |||
152 | #define LASAT_PRID_MASQUERADE2 0 | ||
153 | #define LASAT_PRID_MASQUERADEPRO 1 | ||
154 | #define LASAT_PRID_SAFEPIPE25 2 | ||
155 | #define LASAT_PRID_SAFEPIPE50 3 | ||
156 | #define LASAT_PRID_SAFEPIPE100 4 | ||
157 | #define LASAT_PRID_SAFEPIPE5000 5 | ||
158 | #define LASAT_PRID_SAFEPIPE7000 6 | ||
159 | #define LASAT_PRID_SAFEPIPE30 7 | ||
160 | #define LASAT_PRID_SAFEPIPE5100 8 | ||
161 | #define LASAT_PRID_SAFEPIPE7100 9 | ||
162 | |||
163 | #define LASAT_PRID_SAFEPIPE1110 10 | ||
164 | #define LASAT_PRID_SAFEPIPE3020 11 | ||
165 | #define LASAT_PRID_SAFEPIPE3030 12 | ||
166 | #define LASAT_PRID_SAFEPIPE5020 13 | ||
167 | #define LASAT_PRID_SAFEPIPE5030 14 | ||
168 | #define LASAT_PRID_SAFEPIPE1120 15 | ||
169 | #define LASAT_PRID_SAFEPIPE1130 16 | ||
170 | #define LASAT_PRID_SAFEPIPE6010 17 | ||
171 | #define LASAT_PRID_SAFEPIPE6110 18 | ||
172 | #define LASAT_PRID_SAFEPIPE6210 19 | ||
173 | #define LASAT_PRID_SAFEPIPE1020 20 | ||
174 | #define LASAT_PRID_SAFEPIPE1040 21 | ||
175 | #define LASAT_PRID_SAFEPIPE1060 22 | ||
176 | |||
177 | struct lasat_info { | ||
178 | unsigned int li_cpu_hz; | ||
179 | unsigned int li_bus_hz; | ||
180 | unsigned int li_bmid; | ||
181 | unsigned int li_memsize; | ||
182 | unsigned int li_flash_size; | ||
183 | unsigned int li_prid; | ||
184 | unsigned char li_bmstr[16]; | ||
185 | unsigned char li_namestr[32]; | ||
186 | unsigned char li_typestr[16]; | ||
187 | /* Info on the Flash layout */ | ||
188 | unsigned int li_flash_base; | ||
189 | unsigned long li_flashpart_base[LASAT_MTD_LAST]; | ||
190 | unsigned long li_flashpart_size[LASAT_MTD_LAST]; | ||
191 | struct lasat_eeprom_struct li_eeprom_info; | ||
192 | unsigned int li_eeprom_upgrade_version; | ||
193 | unsigned int li_debugaccess; | ||
194 | }; | ||
195 | |||
196 | extern struct lasat_info lasat_board_info; | ||
197 | |||
198 | static inline unsigned long lasat_flash_partition_start(int partno) | ||
199 | { | ||
200 | if (partno < 0 || partno >= LASAT_MTD_LAST) | ||
201 | return 0; | ||
202 | |||
203 | return lasat_board_info.li_flashpart_base[partno]; | ||
204 | } | ||
205 | |||
206 | static inline unsigned long lasat_flash_partition_size(int partno) | ||
207 | { | ||
208 | if (partno < 0 || partno >= LASAT_MTD_LAST) | ||
209 | return 0; | ||
210 | |||
211 | return lasat_board_info.li_flashpart_size[partno]; | ||
212 | } | ||
213 | |||
214 | /* Called from setup() to initialize the global board_info struct */ | ||
215 | extern int lasat_init_board_info(void); | ||
216 | |||
217 | /* Write the modified EEPROM info struct */ | ||
218 | extern void lasat_write_eeprom_info(void); | ||
219 | |||
220 | #define N_MACHTYPES 2 | ||
221 | /* for calibration of delays */ | ||
222 | |||
223 | /* the lasat_ndelay function is necessary because it is used at an | ||
224 | * early stage of the boot process where ndelay is not calibrated. | ||
225 | * It is used for the bit-banging rtc and eeprom drivers */ | ||
226 | |||
227 | #include <asm/delay.h> | ||
228 | /* calculating with the slowest board with 100 MHz clock */ | ||
229 | #define LASAT_100_DIVIDER 20 | ||
230 | /* All 200's run at 250 MHz clock */ | ||
231 | #define LASAT_200_DIVIDER 8 | ||
232 | |||
233 | extern unsigned int lasat_ndelay_divider; | ||
234 | |||
235 | static inline void lasat_ndelay(unsigned int ns) | ||
236 | { | ||
237 | __delay(ns / lasat_ndelay_divider); | ||
238 | } | ||
239 | |||
240 | #endif /* !defined (_LANGUAGE_ASSEMBLY) */ | ||
241 | |||
242 | #define LASAT_SERVICEMODE_MAGIC_1 0xdeadbeef | ||
243 | #define LASAT_SERVICEMODE_MAGIC_2 0xfedeabba | ||
244 | |||
245 | /* Lasat 100 boards */ | ||
246 | #define LASAT_GT_BASE (KSEG1ADDR(0x14000000)) | ||
247 | |||
248 | /* Lasat 200 boards */ | ||
249 | #define Vrc5074_PHYS_BASE 0x1fa00000 | ||
250 | #define Vrc5074_BASE (KSEG1ADDR(Vrc5074_PHYS_BASE)) | ||
251 | #define PCI_WINDOW1 0x1a000000 | ||
252 | |||
253 | #endif /* _LASAT_H */ | ||
diff --git a/include/asm-mips/lasat/lasatint.h b/include/asm-mips/lasat/lasatint.h deleted file mode 100644 index 065474feeccc..000000000000 --- a/include/asm-mips/lasat/lasatint.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #define LASATINT_END 16 | ||
2 | |||
3 | /* lasat 100 */ | ||
4 | #define LASAT_INT_STATUS_REG_100 (KSEG1ADDR(0x1c880000)) | ||
5 | #define LASAT_INT_MASK_REG_100 (KSEG1ADDR(0x1c890000)) | ||
6 | #define LASATINT_MASK_SHIFT_100 0 | ||
7 | |||
8 | /* lasat 200 */ | ||
9 | #define LASAT_INT_STATUS_REG_200 (KSEG1ADDR(0x1104003c)) | ||
10 | #define LASAT_INT_MASK_REG_200 (KSEG1ADDR(0x1104003c)) | ||
11 | #define LASATINT_MASK_SHIFT_200 16 | ||
12 | |||
diff --git a/include/asm-mips/lasat/picvue.h b/include/asm-mips/lasat/picvue.h deleted file mode 100644 index 42a492edc40e..000000000000 --- a/include/asm-mips/lasat/picvue.h +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | /* Lasat 100 */ | ||
2 | #define PVC_REG_100 KSEG1ADDR(0x1c820000) | ||
3 | #define PVC_DATA_SHIFT_100 0 | ||
4 | #define PVC_DATA_M_100 0xFF | ||
5 | #define PVC_E_100 (1 << 8) | ||
6 | #define PVC_RW_100 (1 << 9) | ||
7 | #define PVC_RS_100 (1 << 10) | ||
8 | |||
9 | /* Lasat 200 */ | ||
10 | #define PVC_REG_200 KSEG1ADDR(0x11000000) | ||
11 | #define PVC_DATA_SHIFT_200 24 | ||
12 | #define PVC_DATA_M_200 (0xFF << PVC_DATA_SHIFT_200) | ||
13 | #define PVC_E_200 (1 << 16) | ||
14 | #define PVC_RW_200 (1 << 17) | ||
15 | #define PVC_RS_200 (1 << 18) | ||
diff --git a/include/asm-mips/lasat/serial.h b/include/asm-mips/lasat/serial.h deleted file mode 100644 index 9e88c7669c7a..000000000000 --- a/include/asm-mips/lasat/serial.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | #include <asm/lasat/lasat.h> | ||
2 | |||
3 | /* Lasat 100 boards serial configuration */ | ||
4 | #define LASAT_BASE_BAUD_100 ( 7372800 / 16 ) | ||
5 | #define LASAT_UART_REGS_BASE_100 0x1c8b0000 | ||
6 | #define LASAT_UART_REGS_SHIFT_100 2 | ||
7 | #define LASATINT_UART_100 8 | ||
8 | |||
9 | /* * LASAT 200 boards serial configuration */ | ||
10 | #define LASAT_BASE_BAUD_200 (100000000 / 16 / 12) | ||
11 | #define LASAT_UART_REGS_BASE_200 (Vrc5074_PHYS_BASE + 0x0300) | ||
12 | #define LASAT_UART_REGS_SHIFT_200 3 | ||
13 | #define LASATINT_UART_200 13 | ||
diff --git a/include/asm-mips/mach-au1x00/au1xxx_gpio.h b/include/asm-mips/mach-au1x00/au1xxx_gpio.h deleted file mode 100644 index 27911e054ffc..000000000000 --- a/include/asm-mips/mach-au1x00/au1xxx_gpio.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef __AU1XXX_GPIO_H | ||
2 | #define __AU1XXX_GPIO_H | ||
3 | |||
4 | void au1xxx_gpio1_set_inputs(void); | ||
5 | void au1xxx_gpio_tristate(int signal); | ||
6 | void au1xxx_gpio_write(int signal, int value); | ||
7 | int au1xxx_gpio_read(int signal); | ||
8 | |||
9 | typedef volatile struct | ||
10 | { | ||
11 | u32 dir; | ||
12 | u32 reserved; | ||
13 | u32 output; | ||
14 | u32 pinstate; | ||
15 | u32 inten; | ||
16 | u32 enable; | ||
17 | |||
18 | } AU1X00_GPIO2; | ||
19 | |||
20 | #endif //__AU1XXX_GPIO_H | ||
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h index 8fcae21adbd5..4663e8b415c9 100644 --- a/include/asm-mips/mach-au1x00/au1xxx_ide.h +++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h | |||
@@ -88,26 +88,26 @@ static const struct drive_list_entry dma_white_list [] = { | |||
88 | /* | 88 | /* |
89 | * Hitachi | 89 | * Hitachi |
90 | */ | 90 | */ |
91 | { "HITACHI_DK14FA-20" , "ALL" }, | 91 | { "HITACHI_DK14FA-20" , NULL }, |
92 | { "HTS726060M9AT00" , "ALL" }, | 92 | { "HTS726060M9AT00" , NULL }, |
93 | /* | 93 | /* |
94 | * Maxtor | 94 | * Maxtor |
95 | */ | 95 | */ |
96 | { "Maxtor 6E040L0" , "ALL" }, | 96 | { "Maxtor 6E040L0" , NULL }, |
97 | { "Maxtor 6Y080P0" , "ALL" }, | 97 | { "Maxtor 6Y080P0" , NULL }, |
98 | { "Maxtor 6Y160P0" , "ALL" }, | 98 | { "Maxtor 6Y160P0" , NULL }, |
99 | /* | 99 | /* |
100 | * Seagate | 100 | * Seagate |
101 | */ | 101 | */ |
102 | { "ST3120026A" , "ALL" }, | 102 | { "ST3120026A" , NULL }, |
103 | { "ST320014A" , "ALL" }, | 103 | { "ST320014A" , NULL }, |
104 | { "ST94011A" , "ALL" }, | 104 | { "ST94011A" , NULL }, |
105 | { "ST340016A" , "ALL" }, | 105 | { "ST340016A" , NULL }, |
106 | /* | 106 | /* |
107 | * Western Digital | 107 | * Western Digital |
108 | */ | 108 | */ |
109 | { "WDC WD400UE-00HCT0" , "ALL" }, | 109 | { "WDC WD400UE-00HCT0" , NULL }, |
110 | { "WDC WD400JB-00JJC0" , "ALL" }, | 110 | { "WDC WD400JB-00JJC0" , NULL }, |
111 | { NULL , NULL } | 111 | { NULL , NULL } |
112 | }; | 112 | }; |
113 | 113 | ||
@@ -116,9 +116,9 @@ static const struct drive_list_entry dma_black_list [] = { | |||
116 | /* | 116 | /* |
117 | * Western Digital | 117 | * Western Digital |
118 | */ | 118 | */ |
119 | { "WDC WD100EB-00CGH0" , "ALL" }, | 119 | { "WDC WD100EB-00CGH0" , NULL }, |
120 | { "WDC WD200BB-00AUA1" , "ALL" }, | 120 | { "WDC WD200BB-00AUA1" , NULL }, |
121 | { "WDC AC24300L" , "ALL" }, | 121 | { "WDC AC24300L" , NULL }, |
122 | { NULL , NULL } | 122 | { NULL , NULL } |
123 | }; | 123 | }; |
124 | #endif | 124 | #endif |
diff --git a/include/asm-mips/mach-au1x00/gpio.h b/include/asm-mips/mach-au1x00/gpio.h new file mode 100644 index 000000000000..2dc61e009a08 --- /dev/null +++ b/include/asm-mips/mach-au1x00/gpio.h | |||
@@ -0,0 +1,69 @@ | |||
1 | #ifndef _AU1XXX_GPIO_H_ | ||
2 | #define _AU1XXX_GPIO_H_ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | #define AU1XXX_GPIO_BASE 200 | ||
7 | |||
8 | struct au1x00_gpio2 { | ||
9 | u32 dir; | ||
10 | u32 reserved; | ||
11 | u32 output; | ||
12 | u32 pinstate; | ||
13 | u32 inten; | ||
14 | u32 enable; | ||
15 | }; | ||
16 | |||
17 | extern int au1xxx_gpio_get_value(unsigned gpio); | ||
18 | extern void au1xxx_gpio_set_value(unsigned gpio, int value); | ||
19 | extern int au1xxx_gpio_direction_input(unsigned gpio); | ||
20 | extern int au1xxx_gpio_direction_output(unsigned gpio, int value); | ||
21 | |||
22 | |||
23 | /* Wrappers for the arch-neutral GPIO API */ | ||
24 | |||
25 | static inline int gpio_request(unsigned gpio, const char *label) | ||
26 | { | ||
27 | /* Not yet implemented */ | ||
28 | return 0; | ||
29 | } | ||
30 | |||
31 | static inline void gpio_free(unsigned gpio) | ||
32 | { | ||
33 | /* Not yet implemented */ | ||
34 | } | ||
35 | |||
36 | static inline int gpio_direction_input(unsigned gpio) | ||
37 | { | ||
38 | return au1xxx_gpio_direction_input(gpio); | ||
39 | } | ||
40 | |||
41 | static inline int gpio_direction_output(unsigned gpio, int value) | ||
42 | { | ||
43 | return au1xxx_gpio_direction_output(gpio, value); | ||
44 | } | ||
45 | |||
46 | static inline int gpio_get_value(unsigned gpio) | ||
47 | { | ||
48 | return au1xxx_gpio_get_value(gpio); | ||
49 | } | ||
50 | |||
51 | static inline void gpio_set_value(unsigned gpio, int value) | ||
52 | { | ||
53 | au1xxx_gpio_set_value(gpio, value); | ||
54 | } | ||
55 | |||
56 | static inline int gpio_to_irq(unsigned gpio) | ||
57 | { | ||
58 | return gpio; | ||
59 | } | ||
60 | |||
61 | static inline int irq_to_gpio(unsigned irq) | ||
62 | { | ||
63 | return irq; | ||
64 | } | ||
65 | |||
66 | /* For cansleep */ | ||
67 | #include <asm-generic/gpio.h> | ||
68 | |||
69 | #endif /* _AU1XXX_GPIO_H_ */ | ||
diff --git a/include/asm-mips/mach-au1x00/ioremap.h b/include/asm-mips/mach-au1x00/ioremap.h index 098fca4289bb..364cea2dc71f 100644 --- a/include/asm-mips/mach-au1x00/ioremap.h +++ b/include/asm-mips/mach-au1x00/ioremap.h | |||
@@ -28,4 +28,15 @@ static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) | |||
28 | return __fixup_bigphys_addr(phys_addr, size); | 28 | return __fixup_bigphys_addr(phys_addr, size); |
29 | } | 29 | } |
30 | 30 | ||
31 | static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size, | ||
32 | unsigned long flags) | ||
33 | { | ||
34 | return NULL; | ||
35 | } | ||
36 | |||
37 | static inline int plat_iounmap(const volatile void __iomem *addr) | ||
38 | { | ||
39 | return 0; | ||
40 | } | ||
41 | |||
31 | #endif /* __ASM_MACH_AU1X00_IOREMAP_H */ | 42 | #endif /* __ASM_MACH_AU1X00_IOREMAP_H */ |
diff --git a/include/asm-mips/mach-cobalt/cobalt.h b/include/asm-mips/mach-cobalt/cobalt.h index 684a501c04cf..9c9d2b998ca4 100644 --- a/include/asm-mips/mach-cobalt/cobalt.h +++ b/include/asm-mips/mach-cobalt/cobalt.h | |||
@@ -30,7 +30,6 @@ | |||
30 | #define COBALT_CPU_IRQ MIPS_CPU_IRQ_BASE | 30 | #define COBALT_CPU_IRQ MIPS_CPU_IRQ_BASE |
31 | 31 | ||
32 | #define COBALT_GALILEO_IRQ (COBALT_CPU_IRQ + 2) | 32 | #define COBALT_GALILEO_IRQ (COBALT_CPU_IRQ + 2) |
33 | #define COBALT_SCC_IRQ (COBALT_CPU_IRQ + 3) /* pre-production has 85C30 */ | ||
34 | #define COBALT_RAQ_SCSI_IRQ (COBALT_CPU_IRQ + 3) | 33 | #define COBALT_RAQ_SCSI_IRQ (COBALT_CPU_IRQ + 3) |
35 | #define COBALT_ETH0_IRQ (COBALT_CPU_IRQ + 3) | 34 | #define COBALT_ETH0_IRQ (COBALT_CPU_IRQ + 3) |
36 | #define COBALT_QUBE1_ETH0_IRQ (COBALT_CPU_IRQ + 4) | 35 | #define COBALT_QUBE1_ETH0_IRQ (COBALT_CPU_IRQ + 4) |
@@ -71,10 +70,6 @@ | |||
71 | 70 | ||
72 | extern int cobalt_board_id; | 71 | extern int cobalt_board_id; |
73 | 72 | ||
74 | #define PCI_CFG_SET(devfn,where) \ | ||
75 | GT_WRITE(GT_PCI0_CFGADDR_OFS, (0x80000000 | (PCI_SLOT (devfn) << 11) | \ | ||
76 | (PCI_FUNC (devfn) << 8) | (where))) | ||
77 | |||
78 | #define COBALT_LED_PORT (*(volatile unsigned char *) CKSEG1ADDR(0x1c000000)) | 73 | #define COBALT_LED_PORT (*(volatile unsigned char *) CKSEG1ADDR(0x1c000000)) |
79 | # define COBALT_LED_BAR_LEFT (1 << 0) /* Qube */ | 74 | # define COBALT_LED_BAR_LEFT (1 << 0) /* Qube */ |
80 | # define COBALT_LED_BAR_RIGHT (1 << 1) /* Qube */ | 75 | # define COBALT_LED_BAR_RIGHT (1 << 1) /* Qube */ |
diff --git a/include/asm-mips/mach-ev64120/mach-gt64120.h b/include/asm-mips/mach-ev64120/mach-gt64120.h deleted file mode 100644 index 7e272ce57ea3..000000000000 --- a/include/asm-mips/mach-ev64120/mach-gt64120.h +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | /* | ||
2 | * This is a direct copy of the ev96100.h file, with a global | ||
3 | * search and replace. The numbers are the same. | ||
4 | * | ||
5 | * The reason I'm duplicating this is so that the 64120/96100 | ||
6 | * defines won't be confusing in the source code. | ||
7 | */ | ||
8 | #ifndef __ASM_GALILEO_BOARDS_MIPS_EV64120_H | ||
9 | #define __ASM_GALILEO_BOARDS_MIPS_EV64120_H | ||
10 | |||
11 | /* | ||
12 | * GT64120 config space base address | ||
13 | */ | ||
14 | extern unsigned long gt64120_base; | ||
15 | |||
16 | #define GT64120_BASE (gt64120_base) | ||
17 | |||
18 | /* | ||
19 | * PCI Bus allocation | ||
20 | */ | ||
21 | #define GT_PCI_MEM_BASE 0x12000000UL | ||
22 | #define GT_PCI_MEM_SIZE 0x02000000UL | ||
23 | #define GT_PCI_IO_BASE 0x10000000UL | ||
24 | #define GT_PCI_IO_SIZE 0x02000000UL | ||
25 | #define GT_ISA_IO_BASE PCI_IO_BASE | ||
26 | |||
27 | /* | ||
28 | * Duart I/O ports. | ||
29 | */ | ||
30 | #define EV64120_COM1_BASE_ADDR (0x1d000000 + 0x20) | ||
31 | #define EV64120_COM2_BASE_ADDR (0x1d000000 + 0x00) | ||
32 | |||
33 | |||
34 | /* | ||
35 | * EV64120 interrupt controller register base. | ||
36 | */ | ||
37 | #define EV64120_ICTRL_REGS_BASE (KSEG1ADDR(0x1f000000)) | ||
38 | |||
39 | /* | ||
40 | * EV64120 UART register base. | ||
41 | */ | ||
42 | #define EV64120_UART0_REGS_BASE (KSEG1ADDR(EV64120_COM1_BASE_ADDR)) | ||
43 | #define EV64120_UART1_REGS_BASE (KSEG1ADDR(EV64120_COM2_BASE_ADDR)) | ||
44 | #define EV64120_BASE_BAUD ( 3686400 / 16 ) | ||
45 | #define EV64120_UART_IRQ 6 | ||
46 | |||
47 | /* | ||
48 | * PCI interrupts will come in on either the INTA or INTD interrups lines, | ||
49 | * which are mapped to the #2 and #5 interrupt pins of the MIPS. On our | ||
50 | * boards, they all either come in on IntD or they all come in on IntA, they | ||
51 | * aren't mixed. There can be numerous PCI interrupts, so we keep a list of the | ||
52 | * "requested" interrupt numbers and go through the list whenever we get an | ||
53 | * IntA/D. | ||
54 | * | ||
55 | * Interrupts < 8 are directly wired to the processor; PCI INTA is 8 and | ||
56 | * INTD is 11. | ||
57 | */ | ||
58 | #define GT_TIMER 4 | ||
59 | #define GT_INTA 2 | ||
60 | #define GT_INTD 5 | ||
61 | |||
62 | #endif /* __ASM_GALILEO_BOARDS_MIPS_EV64120_H */ | ||
diff --git a/include/asm-mips/mach-generic/gpio.h b/include/asm-mips/mach-generic/gpio.h new file mode 100644 index 000000000000..6eaf5efedf3a --- /dev/null +++ b/include/asm-mips/mach-generic/gpio.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef __ASM_MACH_GENERIC_GPIO_H | ||
2 | #define __ASM_MACH_GENERIC_GPIO_H | ||
3 | |||
4 | int gpio_request(unsigned gpio, const char *label); | ||
5 | void gpio_free(unsigned gpio); | ||
6 | int gpio_direction_input(unsigned gpio); | ||
7 | int gpio_direction_output(unsigned gpio, int value); | ||
8 | int gpio_get_value(unsigned gpio); | ||
9 | void gpio_set_value(unsigned gpio, int value); | ||
10 | int gpio_to_irq(unsigned gpio); | ||
11 | int irq_to_gpio(unsigned irq); | ||
12 | |||
13 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | ||
14 | |||
15 | #endif /* __ASM_MACH_GENERIC_GPIO_H */ | ||
diff --git a/include/asm-mips/mach-generic/ioremap.h b/include/asm-mips/mach-generic/ioremap.h index 9b64ff6e485d..b379938d47f0 100644 --- a/include/asm-mips/mach-generic/ioremap.h +++ b/include/asm-mips/mach-generic/ioremap.h | |||
@@ -20,4 +20,15 @@ static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) | |||
20 | return phys_addr; | 20 | return phys_addr; |
21 | } | 21 | } |
22 | 22 | ||
23 | static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size, | ||
24 | unsigned long flags) | ||
25 | { | ||
26 | return NULL; | ||
27 | } | ||
28 | |||
29 | static inline int plat_iounmap(const volatile void __iomem *addr) | ||
30 | { | ||
31 | return 0; | ||
32 | } | ||
33 | |||
23 | #endif /* __ASM_MACH_GENERIC_IOREMAP_H */ | 34 | #endif /* __ASM_MACH_GENERIC_IOREMAP_H */ |
diff --git a/include/asm-mips/mach-generic/spaces.h b/include/asm-mips/mach-generic/spaces.h index 0ae9997bc9a8..c9fa4b14968d 100644 --- a/include/asm-mips/mach-generic/spaces.h +++ b/include/asm-mips/mach-generic/spaces.h | |||
@@ -10,38 +10,54 @@ | |||
10 | #ifndef _ASM_MACH_GENERIC_SPACES_H | 10 | #ifndef _ASM_MACH_GENERIC_SPACES_H |
11 | #define _ASM_MACH_GENERIC_SPACES_H | 11 | #define _ASM_MACH_GENERIC_SPACES_H |
12 | 12 | ||
13 | #include <linux/const.h> | ||
14 | |||
15 | /* | ||
16 | * This gives the physical RAM offset. | ||
17 | */ | ||
18 | #ifndef PHYS_OFFSET | ||
19 | #define PHYS_OFFSET _AC(0, UL) | ||
20 | #endif | ||
13 | 21 | ||
14 | #ifdef CONFIG_32BIT | 22 | #ifdef CONFIG_32BIT |
15 | 23 | ||
16 | #define CAC_BASE 0x80000000 | 24 | #define CAC_BASE _AC(0x80000000, UL) |
17 | #define IO_BASE 0xa0000000 | 25 | #define IO_BASE _AC(0xa0000000, UL) |
18 | #define UNCAC_BASE 0xa0000000 | 26 | #define UNCAC_BASE _AC(0xa0000000, UL) |
19 | #define MAP_BASE 0xc0000000 | ||
20 | 27 | ||
21 | /* | 28 | #ifndef MAP_BASE |
22 | * This handles the memory map. | 29 | #define MAP_BASE _AC(0xc0000000, UL) |
23 | * We handle pages at KSEG0 for kernels with 32 bit address space. | 30 | #endif |
24 | */ | ||
25 | #define PAGE_OFFSET 0x80000000UL | ||
26 | 31 | ||
27 | /* | 32 | /* |
28 | * Memory above this physical address will be considered highmem. | 33 | * Memory above this physical address will be considered highmem. |
29 | */ | 34 | */ |
30 | #ifndef HIGHMEM_START | 35 | #ifndef HIGHMEM_START |
31 | #define HIGHMEM_START 0x20000000UL | 36 | #define HIGHMEM_START _AC(0x20000000, UL) |
32 | #endif | 37 | #endif |
33 | 38 | ||
34 | #endif /* CONFIG_32BIT */ | 39 | #endif /* CONFIG_32BIT */ |
35 | 40 | ||
36 | #ifdef CONFIG_64BIT | 41 | #ifdef CONFIG_64BIT |
37 | 42 | ||
38 | /* | 43 | #ifndef CAC_BASE |
39 | * This handles the memory map. | ||
40 | */ | ||
41 | #ifdef CONFIG_DMA_NONCOHERENT | 44 | #ifdef CONFIG_DMA_NONCOHERENT |
42 | #define PAGE_OFFSET 0x9800000000000000UL | 45 | #define CAC_BASE _AC(0x9800000000000000, UL) |
43 | #else | 46 | #else |
44 | #define PAGE_OFFSET 0xa800000000000000UL | 47 | #define CAC_BASE _AC(0xa800000000000000, UL) |
48 | #endif | ||
49 | #endif | ||
50 | |||
51 | #ifndef IO_BASE | ||
52 | #define IO_BASE _AC(0x9000000000000000, UL) | ||
53 | #endif | ||
54 | |||
55 | #ifndef UNCAC_BASE | ||
56 | #define UNCAC_BASE _AC(0x9000000000000000, UL) | ||
57 | #endif | ||
58 | |||
59 | #ifndef MAP_BASE | ||
60 | #define MAP_BASE _AC(0xc000000000000000, UL) | ||
45 | #endif | 61 | #endif |
46 | 62 | ||
47 | /* | 63 | /* |
@@ -50,22 +66,20 @@ | |||
50 | * in the distant future. Nobody will care for a few years :-) | 66 | * in the distant future. Nobody will care for a few years :-) |
51 | */ | 67 | */ |
52 | #ifndef HIGHMEM_START | 68 | #ifndef HIGHMEM_START |
53 | #define HIGHMEM_START (1UL << 59UL) | 69 | #define HIGHMEM_START (_AC(1, UL) << _AC(59, UL)) |
54 | #endif | 70 | #endif |
55 | 71 | ||
56 | #ifdef CONFIG_DMA_NONCOHERENT | ||
57 | #define CAC_BASE 0x9800000000000000UL | ||
58 | #else | ||
59 | #define CAC_BASE 0xa800000000000000UL | ||
60 | #endif | ||
61 | #define IO_BASE 0x9000000000000000UL | ||
62 | #define UNCAC_BASE 0x9000000000000000UL | ||
63 | #define MAP_BASE 0xc000000000000000UL | ||
64 | |||
65 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) | 72 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) |
66 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) | 73 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) |
67 | #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) | 74 | #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) |
68 | 75 | ||
69 | #endif /* CONFIG_64BIT */ | 76 | #endif /* CONFIG_64BIT */ |
70 | 77 | ||
78 | /* | ||
79 | * This handles the memory map. | ||
80 | */ | ||
81 | #ifndef PAGE_OFFSET | ||
82 | #define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET) | ||
83 | #endif | ||
84 | |||
71 | #endif /* __ASM_MACH_GENERIC_SPACES_H */ | 85 | #endif /* __ASM_MACH_GENERIC_SPACES_H */ |
diff --git a/include/asm-mips/mach-ip22/spaces.h b/include/asm-mips/mach-ip22/spaces.h index ab20c026fd19..7f9fa6f66059 100644 --- a/include/asm-mips/mach-ip22/spaces.h +++ b/include/asm-mips/mach-ip22/spaces.h | |||
@@ -11,44 +11,17 @@ | |||
11 | #define _ASM_MACH_IP22_SPACES_H | 11 | #define _ASM_MACH_IP22_SPACES_H |
12 | 12 | ||
13 | 13 | ||
14 | #ifdef CONFIG_32BIT | ||
15 | |||
16 | #define CAC_BASE 0x80000000 | ||
17 | #define IO_BASE 0xa0000000 | ||
18 | #define UNCAC_BASE 0xa0000000 | ||
19 | #define MAP_BASE 0xc0000000 | ||
20 | |||
21 | /* | ||
22 | * This handles the memory map. | ||
23 | * We handle pages at KSEG0 for kernels with 32 bit address space. | ||
24 | */ | ||
25 | #define PAGE_OFFSET 0x80000000UL | ||
26 | |||
27 | /* | ||
28 | * Memory above this physical address will be considered highmem. | ||
29 | */ | ||
30 | #ifndef HIGHMEM_START | ||
31 | #define HIGHMEM_START 0x20000000UL | ||
32 | #endif | ||
33 | |||
34 | #endif /* CONFIG_32BIT */ | ||
35 | |||
36 | #ifdef CONFIG_64BIT | 14 | #ifdef CONFIG_64BIT |
37 | #define PAGE_OFFSET 0xffffffff80000000UL | ||
38 | 15 | ||
39 | #ifndef HIGHMEM_START | 16 | #define PAGE_OFFSET 0xffffffff80000000UL |
40 | #define HIGHMEM_START (1UL << 59UL) | ||
41 | #endif | ||
42 | 17 | ||
43 | #define CAC_BASE 0xffffffff80000000 | 18 | #define CAC_BASE 0xffffffff80000000 |
44 | #define IO_BASE 0xffffffffa0000000 | 19 | #define IO_BASE 0xffffffffa0000000 |
45 | #define UNCAC_BASE 0xffffffffa0000000 | 20 | #define UNCAC_BASE 0xffffffffa0000000 |
46 | #define MAP_BASE 0xc000000000000000 | 21 | #define MAP_BASE 0xc000000000000000 |
47 | 22 | ||
48 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) | ||
49 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) | ||
50 | #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) | ||
51 | |||
52 | #endif /* CONFIG_64BIT */ | 23 | #endif /* CONFIG_64BIT */ |
53 | 24 | ||
25 | #include <asm/mach-generic/spaces.h> | ||
26 | |||
54 | #endif /* __ASM_MACH_IP22_SPACES_H */ | 27 | #endif /* __ASM_MACH_IP22_SPACES_H */ |
diff --git a/include/asm-mips/mach-ip27/spaces.h b/include/asm-mips/mach-ip27/spaces.h index 45e61785ef42..b18802a0b17e 100644 --- a/include/asm-mips/mach-ip27/spaces.h +++ b/include/asm-mips/mach-ip27/spaces.h | |||
@@ -14,22 +14,17 @@ | |||
14 | * IP27 uses the R10000's uncached attribute feature. Attribute 3 selects | 14 | * IP27 uses the R10000's uncached attribute feature. Attribute 3 selects |
15 | * uncached memory addressing. | 15 | * uncached memory addressing. |
16 | */ | 16 | */ |
17 | #define CAC_BASE 0xa800000000000000 | ||
18 | 17 | ||
19 | #define HSPEC_BASE 0x9000000000000000 | 18 | #define HSPEC_BASE 0x9000000000000000 |
20 | #define IO_BASE 0x9200000000000000 | 19 | #define IO_BASE 0x9200000000000000 |
21 | #define MSPEC_BASE 0x9400000000000000 | 20 | #define MSPEC_BASE 0x9400000000000000 |
22 | #define UNCAC_BASE 0x9600000000000000 | 21 | #define UNCAC_BASE 0x9600000000000000 |
23 | #define MAP_BASE 0xc000000000000000 | ||
24 | 22 | ||
25 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) | ||
26 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) | ||
27 | #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) | ||
28 | #define TO_MSPEC(x) (MSPEC_BASE | ((x) & TO_PHYS_MASK)) | 23 | #define TO_MSPEC(x) (MSPEC_BASE | ((x) & TO_PHYS_MASK)) |
29 | #define TO_HSPEC(x) (HSPEC_BASE | ((x) & TO_PHYS_MASK)) | 24 | #define TO_HSPEC(x) (HSPEC_BASE | ((x) & TO_PHYS_MASK)) |
30 | 25 | ||
31 | #define PAGE_OFFSET CAC_BASE | ||
32 | |||
33 | #define HIGHMEM_START (~0UL) | 26 | #define HIGHMEM_START (~0UL) |
34 | 27 | ||
28 | #include <asm/mach-generic/spaces.h> | ||
29 | |||
35 | #endif /* _ASM_MACH_IP27_SPACES_H */ | 30 | #endif /* _ASM_MACH_IP27_SPACES_H */ |
diff --git a/include/asm-mips/mach-ip32/spaces.h b/include/asm-mips/mach-ip32/spaces.h deleted file mode 100644 index 44abe5c02389..000000000000 --- a/include/asm-mips/mach-ip32/spaces.h +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994 - 1999, 2000, 03, 04, 05 Ralf Baechle (ralf@linux-mips.org) | ||
7 | * Copyright (C) 2000, 2002 Maciej W. Rozycki | ||
8 | * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc. | ||
9 | */ | ||
10 | #ifndef _ASM_MACH_IP32_SPACES_H | ||
11 | #define _ASM_MACH_IP32_SPACES_H | ||
12 | |||
13 | /* | ||
14 | * Memory above this physical address will be considered highmem. | ||
15 | * Fixme: 59 bits is a fictive number and makes assumptions about processors | ||
16 | * in the distant future. Nobody will care for a few years :-) | ||
17 | */ | ||
18 | #ifndef HIGHMEM_START | ||
19 | #define HIGHMEM_START (1UL << 59UL) | ||
20 | #endif | ||
21 | |||
22 | #define CAC_BASE 0x9800000000000000UL | ||
23 | #define IO_BASE 0x9000000000000000UL | ||
24 | #define UNCAC_BASE 0x9000000000000000UL | ||
25 | #define MAP_BASE 0xc000000000000000UL | ||
26 | |||
27 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) | ||
28 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) | ||
29 | #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) | ||
30 | |||
31 | /* | ||
32 | * This handles the memory map. | ||
33 | */ | ||
34 | #define PAGE_OFFSET CAC_BASE | ||
35 | |||
36 | #endif /* __ASM_MACH_IP32_SPACES_H */ | ||
diff --git a/include/asm-mips/mach-jmr3927/ioremap.h b/include/asm-mips/mach-jmr3927/ioremap.h new file mode 100644 index 000000000000..aa131ad7f717 --- /dev/null +++ b/include/asm-mips/mach-jmr3927/ioremap.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * include/asm-mips/mach-jmr3927/ioremap.h | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_JMR3927_IOREMAP_H | ||
10 | #define __ASM_MACH_JMR3927_IOREMAP_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | /* | ||
15 | * Allow physical addresses to be fixed up to help peripherals located | ||
16 | * outside the low 32-bit range -- generic pass-through version. | ||
17 | */ | ||
18 | static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) | ||
19 | { | ||
20 | return phys_addr; | ||
21 | } | ||
22 | |||
23 | static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size, | ||
24 | unsigned long flags) | ||
25 | { | ||
26 | #define TXX9_DIRECTMAP_BASE 0xff000000ul | ||
27 | if (offset >= TXX9_DIRECTMAP_BASE && | ||
28 | offset < TXX9_DIRECTMAP_BASE + 0xf0000) | ||
29 | return (void __iomem *)offset; | ||
30 | return NULL; | ||
31 | } | ||
32 | |||
33 | static inline int plat_iounmap(const volatile void __iomem *addr) | ||
34 | { | ||
35 | return (unsigned long)addr >= TXX9_DIRECTMAP_BASE; | ||
36 | } | ||
37 | |||
38 | #endif /* __ASM_MACH_JMR3927_IOREMAP_H */ | ||
diff --git a/include/asm-mips/mach-lasat/mach-gt64120.h b/include/asm-mips/mach-lasat/mach-gt64120.h deleted file mode 100644 index 1a9ad45cc135..000000000000 --- a/include/asm-mips/mach-lasat/mach-gt64120.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* | ||
2 | * This is a direct copy of the ev96100.h file, with a global | ||
3 | * search and replace. The numbers are the same. | ||
4 | * | ||
5 | * The reason I'm duplicating this is so that the 64120/96100 | ||
6 | * defines won't be confusing in the source code. | ||
7 | */ | ||
8 | #ifndef _ASM_GT64120_LASAT_GT64120_DEP_H | ||
9 | #define _ASM_GT64120_LASAT_GT64120_DEP_H | ||
10 | |||
11 | /* | ||
12 | * GT64120 config space base address on Lasat 100 | ||
13 | */ | ||
14 | #define GT64120_BASE (KSEG1ADDR(0x14000000)) | ||
15 | |||
16 | /* | ||
17 | * PCI Bus allocation | ||
18 | * | ||
19 | * (Guessing ...) | ||
20 | */ | ||
21 | #define GT_PCI_MEM_BASE 0x12000000UL | ||
22 | #define GT_PCI_MEM_SIZE 0x02000000UL | ||
23 | #define GT_PCI_IO_BASE 0x10000000UL | ||
24 | #define GT_PCI_IO_SIZE 0x02000000UL | ||
25 | #define GT_ISA_IO_BASE PCI_IO_BASE | ||
26 | |||
27 | #endif /* _ASM_GT64120_LASAT_GT64120_DEP_H */ | ||
diff --git a/include/asm-mips/mach-lemote/dma-coherence.h b/include/asm-mips/mach-lemote/dma-coherence.h new file mode 100644 index 000000000000..7e914777ebc4 --- /dev/null +++ b/include/asm-mips/mach-lemote/dma-coherence.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2006, 07 Ralf Baechle <ralf@linux-mips.org> | ||
7 | * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology | ||
8 | * Author: Fuxin Zhang, zhangfx@lemote.com | ||
9 | * | ||
10 | */ | ||
11 | #ifndef __ASM_MACH_LEMOTE_DMA_COHERENCE_H | ||
12 | #define __ASM_MACH_LEMOTE_DMA_COHERENCE_H | ||
13 | |||
14 | struct device; | ||
15 | |||
16 | static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, | ||
17 | size_t size) | ||
18 | { | ||
19 | return virt_to_phys(addr) | 0x80000000; | ||
20 | } | ||
21 | |||
22 | static inline dma_addr_t plat_map_dma_mem_page(struct device *dev, | ||
23 | struct page *page) | ||
24 | { | ||
25 | return page_to_phys(page) | 0x80000000; | ||
26 | } | ||
27 | |||
28 | static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | ||
29 | { | ||
30 | return dma_addr & 0x7fffffff; | ||
31 | } | ||
32 | |||
33 | static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) | ||
34 | { | ||
35 | } | ||
36 | |||
37 | static inline int plat_device_is_coherent(struct device *dev) | ||
38 | { | ||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | #endif /* __ASM_MACH_LEMOTE_DMA_COHERENCE_H */ | ||
diff --git a/include/asm-mips/mach-lemote/mc146818rtc.h b/include/asm-mips/mach-lemote/mc146818rtc.h new file mode 100644 index 000000000000..ed5147e11085 --- /dev/null +++ b/include/asm-mips/mach-lemote/mc146818rtc.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1998, 2001, 03, 07 by Ralf Baechle (ralf@linux-mips.org) | ||
7 | * | ||
8 | * RTC routines for PC style attached Dallas chip. | ||
9 | */ | ||
10 | #ifndef __ASM_MACH_LEMOTE_MC146818RTC_H | ||
11 | #define __ASM_MACH_LEMOTE_MC146818RTC_H | ||
12 | |||
13 | #include <linux/io.h> | ||
14 | |||
15 | #define RTC_PORT(x) (0x70 + (x)) | ||
16 | #define RTC_IRQ 8 | ||
17 | |||
18 | static inline unsigned char CMOS_READ(unsigned long addr) | ||
19 | { | ||
20 | outb_p(addr, RTC_PORT(0)); | ||
21 | return inb_p(RTC_PORT(1)); | ||
22 | } | ||
23 | |||
24 | static inline void CMOS_WRITE(unsigned char data, unsigned long addr) | ||
25 | { | ||
26 | outb_p(addr, RTC_PORT(0)); | ||
27 | outb_p(data, RTC_PORT(1)); | ||
28 | } | ||
29 | |||
30 | #define RTC_ALWAYS_BCD 0 | ||
31 | |||
32 | #ifndef mc146818_decode_year | ||
33 | #define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1970) | ||
34 | #endif | ||
35 | |||
36 | #endif /* __ASM_MACH_LEMOTE_MC146818RTC_H */ | ||
diff --git a/include/asm-mips/mach-mips/kernel-entry-init.h b/include/asm-mips/mach-mips/kernel-entry-init.h new file mode 100644 index 000000000000..0b793e7bf67e --- /dev/null +++ b/include/asm-mips/mach-mips/kernel-entry-init.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Chris Dearman (chris@mips.com) | ||
7 | * Copyright (C) 2007 Mips Technologies, Inc. | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H | ||
10 | #define __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H | ||
11 | |||
12 | .macro kernel_entry_setup | ||
13 | #ifdef CONFIG_MIPS_MT_SMTC | ||
14 | mfc0 t0, CP0_CONFIG | ||
15 | bgez t0, 9f | ||
16 | mfc0 t0, CP0_CONFIG, 1 | ||
17 | bgez t0, 9f | ||
18 | mfc0 t0, CP0_CONFIG, 2 | ||
19 | bgez t0, 9f | ||
20 | mfc0 t0, CP0_CONFIG, 3 | ||
21 | and t0, 1<<2 | ||
22 | bnez t0, 0f | ||
23 | 9: | ||
24 | /* Assume we came from YAMON... */ | ||
25 | PTR_LA v0, 0x9fc00534 /* YAMON print */ | ||
26 | lw v0, (v0) | ||
27 | move a0, zero | ||
28 | PTR_LA a1, nonmt_processor | ||
29 | jal v0 | ||
30 | |||
31 | PTR_LA v0, 0x9fc00520 /* YAMON exit */ | ||
32 | lw v0, (v0) | ||
33 | li a0, 1 | ||
34 | jal v0 | ||
35 | |||
36 | 1: b 1b | ||
37 | |||
38 | __INITDATA | ||
39 | nonmt_processor: | ||
40 | .asciz "SMTC kernel requires the MT ASE to run\n" | ||
41 | __FINIT | ||
42 | 0: | ||
43 | #endif | ||
44 | .endm | ||
45 | |||
46 | /* | ||
47 | * Do SMP slave processor setup necessary before we can safely execute C code. | ||
48 | */ | ||
49 | .macro smp_slave_setup | ||
50 | .endm | ||
51 | |||
52 | #endif /* __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H */ | ||
diff --git a/include/asm-mips/mach-sim/cpu-feature-overrides.h b/include/asm-mips/mach-mipssim/cpu-feature-overrides.h index 779b02205737..779b02205737 100644 --- a/include/asm-mips/mach-sim/cpu-feature-overrides.h +++ b/include/asm-mips/mach-mipssim/cpu-feature-overrides.h | |||
diff --git a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h deleted file mode 100644 index 57a12ded0613..000000000000 --- a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2004 MontaVista Software Inc. | ||
7 | * Author: Manish Lachwani, mlachwani@mvista.com | ||
8 | * Copyright (C) 2004 Ralf Baechle | ||
9 | */ | ||
10 | #ifndef __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H | ||
11 | #define __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H | ||
12 | |||
13 | /* | ||
14 | * Momentum Ocelot-3 is based on Rm7900 processor which | ||
15 | * is based on the E9000 core. | ||
16 | */ | ||
17 | #define cpu_has_watch 1 | ||
18 | #define cpu_has_mips16 0 | ||
19 | #define cpu_has_divec 0 | ||
20 | #define cpu_has_vce 0 | ||
21 | #define cpu_has_cache_cdex_p 0 | ||
22 | #define cpu_has_cache_cdex_s 0 | ||
23 | #define cpu_has_prefetch 1 | ||
24 | #define cpu_has_mcheck 0 | ||
25 | #define cpu_has_ejtag 0 | ||
26 | |||
27 | #define cpu_has_llsc 1 | ||
28 | #define cpu_has_vtag_icache 0 | ||
29 | #define cpu_has_dc_aliases 0 | ||
30 | #define cpu_has_ic_fills_f_dc 0 | ||
31 | #define cpu_has_dsp 0 | ||
32 | #define cpu_icache_snoops_remote_store 0 | ||
33 | |||
34 | #define cpu_has_nofpuex 0 | ||
35 | #define cpu_has_64bits 1 | ||
36 | |||
37 | #define cpu_has_inclusive_pcaches 0 | ||
38 | |||
39 | #define cpu_dcache_line_size() 32 | ||
40 | #define cpu_icache_line_size() 32 | ||
41 | #define cpu_scache_line_size() 32 | ||
42 | |||
43 | #define cpu_has_mips32r1 0 | ||
44 | #define cpu_has_mips32r2 0 | ||
45 | #define cpu_has_mips64r1 0 | ||
46 | #define cpu_has_mips64r2 0 | ||
47 | |||
48 | #endif /* __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-tx49xx/ioremap.h b/include/asm-mips/mach-tx49xx/ioremap.h new file mode 100644 index 000000000000..88cf546719b8 --- /dev/null +++ b/include/asm-mips/mach-tx49xx/ioremap.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * include/asm-mips/mach-tx49xx/ioremap.h | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_TX49XX_IOREMAP_H | ||
10 | #define __ASM_MACH_TX49XX_IOREMAP_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | /* | ||
15 | * Allow physical addresses to be fixed up to help peripherals located | ||
16 | * outside the low 32-bit range -- generic pass-through version. | ||
17 | */ | ||
18 | static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) | ||
19 | { | ||
20 | return phys_addr; | ||
21 | } | ||
22 | |||
23 | static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size, | ||
24 | unsigned long flags) | ||
25 | { | ||
26 | #ifdef CONFIG_64BIT | ||
27 | #define TXX9_DIRECTMAP_BASE 0xfff000000ul | ||
28 | #else | ||
29 | #define TXX9_DIRECTMAP_BASE 0xff000000ul | ||
30 | #endif | ||
31 | if (offset >= TXX9_DIRECTMAP_BASE && | ||
32 | offset < TXX9_DIRECTMAP_BASE + 0x400000) | ||
33 | return (void __iomem *)(unsigned long)(int)offset; | ||
34 | return NULL; | ||
35 | } | ||
36 | |||
37 | static inline int plat_iounmap(const volatile void __iomem *addr) | ||
38 | { | ||
39 | return (unsigned long)addr >= (unsigned long)(int)TXX9_DIRECTMAP_BASE; | ||
40 | } | ||
41 | |||
42 | #endif /* __ASM_MACH_TX49XX_IOREMAP_H */ | ||
diff --git a/include/asm-mips/mips-boards/bonito64.h b/include/asm-mips/mips-boards/bonito64.h index cd7125610100..dc3fc32eedd8 100644 --- a/include/asm-mips/mips-boards/bonito64.h +++ b/include/asm-mips/mips-boards/bonito64.h | |||
@@ -26,7 +26,12 @@ | |||
26 | /* offsets from base register */ | 26 | /* offsets from base register */ |
27 | #define BONITO(x) (x) | 27 | #define BONITO(x) (x) |
28 | 28 | ||
29 | #else /* !__ASSEMBLY__ */ | 29 | #elif defined(CONFIG_LEMOTE_FULONG) |
30 | |||
31 | #define BONITO(x) (*(volatile u32 *)((char *)CKSEG1ADDR(BONITO_REG_BASE) + (x))) | ||
32 | #define BONITO_IRQ_BASE 32 | ||
33 | |||
34 | #else | ||
30 | 35 | ||
31 | /* | 36 | /* |
32 | * Algorithmics Bonito64 system controller register base. | 37 | * Algorithmics Bonito64 system controller register base. |
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index 9985cb7c16e7..706b3691f57e 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * Copyright (C) 2000 Silicon Graphics, Inc. | 7 | * Copyright (C) 2000 Silicon Graphics, Inc. |
8 | * Modified for further R[236]000 support by Paul M. Antoine, 1996. | 8 | * Modified for further R[236]000 support by Paul M. Antoine, 1996. |
9 | * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com | 9 | * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com |
10 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. | 10 | * Copyright (C) 2000, 07 MIPS Technologies, Inc. |
11 | * Copyright (C) 2003, 2004 Maciej W. Rozycki | 11 | * Copyright (C) 2003, 2004 Maciej W. Rozycki |
12 | */ | 12 | */ |
13 | #ifndef _ASM_MIPSREGS_H | 13 | #ifndef _ASM_MIPSREGS_H |
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
17 | #include <asm/hazards.h> | 17 | #include <asm/hazards.h> |
18 | #include <asm/war.h> | ||
18 | 19 | ||
19 | /* | 20 | /* |
20 | * The following macros are especially useful for __asm__ | 21 | * The following macros are especially useful for __asm__ |
@@ -533,6 +534,12 @@ | |||
533 | #define MIPS_CONF3_VEIC (_ULCAST_(1) << 6) | 534 | #define MIPS_CONF3_VEIC (_ULCAST_(1) << 6) |
534 | #define MIPS_CONF3_LPA (_ULCAST_(1) << 7) | 535 | #define MIPS_CONF3_LPA (_ULCAST_(1) << 7) |
535 | #define MIPS_CONF3_DSP (_ULCAST_(1) << 10) | 536 | #define MIPS_CONF3_DSP (_ULCAST_(1) << 10) |
537 | #define MIPS_CONF3_ULRI (_ULCAST_(1) << 13) | ||
538 | |||
539 | #define MIPS_CONF7_WII (_ULCAST_(1) << 31) | ||
540 | |||
541 | #define MIPS_CONF7_RPS (_ULCAST_(1) << 2) | ||
542 | |||
536 | 543 | ||
537 | /* | 544 | /* |
538 | * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register. | 545 | * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register. |
@@ -770,6 +777,9 @@ do { \ | |||
770 | #define read_c0_context() __read_ulong_c0_register($4, 0) | 777 | #define read_c0_context() __read_ulong_c0_register($4, 0) |
771 | #define write_c0_context(val) __write_ulong_c0_register($4, 0, val) | 778 | #define write_c0_context(val) __write_ulong_c0_register($4, 0, val) |
772 | 779 | ||
780 | #define read_c0_userlocal() __read_ulong_c0_register($4, 2) | ||
781 | #define write_c0_userlocal(val) __write_ulong_c0_register($4, 2, val) | ||
782 | |||
773 | #define read_c0_pagemask() __read_32bit_c0_register($5, 0) | 783 | #define read_c0_pagemask() __read_32bit_c0_register($5, 0) |
774 | #define write_c0_pagemask(val) __write_32bit_c0_register($5, 0, val) | 784 | #define write_c0_pagemask(val) __write_32bit_c0_register($5, 0, val) |
775 | 785 | ||
@@ -1292,10 +1302,39 @@ static inline void tlb_probe(void) | |||
1292 | 1302 | ||
1293 | static inline void tlb_read(void) | 1303 | static inline void tlb_read(void) |
1294 | { | 1304 | { |
1305 | #if MIPS34K_MISSED_ITLB_WAR | ||
1306 | int res = 0; | ||
1307 | |||
1308 | __asm__ __volatile__( | ||
1309 | " .set push \n" | ||
1310 | " .set noreorder \n" | ||
1311 | " .set noat \n" | ||
1312 | " .set mips32r2 \n" | ||
1313 | " .word 0x41610001 # dvpe $1 \n" | ||
1314 | " move %0, $1 \n" | ||
1315 | " ehb \n" | ||
1316 | " .set pop \n" | ||
1317 | : "=r" (res)); | ||
1318 | |||
1319 | instruction_hazard(); | ||
1320 | #endif | ||
1321 | |||
1295 | __asm__ __volatile__( | 1322 | __asm__ __volatile__( |
1296 | ".set noreorder\n\t" | 1323 | ".set noreorder\n\t" |
1297 | "tlbr\n\t" | 1324 | "tlbr\n\t" |
1298 | ".set reorder"); | 1325 | ".set reorder"); |
1326 | |||
1327 | #if MIPS34K_MISSED_ITLB_WAR | ||
1328 | if ((res & _ULCAST_(1))) | ||
1329 | __asm__ __volatile__( | ||
1330 | " .set push \n" | ||
1331 | " .set noreorder \n" | ||
1332 | " .set noat \n" | ||
1333 | " .set mips32r2 \n" | ||
1334 | " .word 0x41600021 # evpe \n" | ||
1335 | " ehb \n" | ||
1336 | " .set pop \n"); | ||
1337 | #endif | ||
1299 | } | 1338 | } |
1300 | 1339 | ||
1301 | static inline void tlb_write_indexed(void) | 1340 | static inline void tlb_write_indexed(void) |
diff --git a/include/asm-mips/module.h b/include/asm-mips/module.h index c5ef324fd69f..de6d09ebbd80 100644 --- a/include/asm-mips/module.h +++ b/include/asm-mips/module.h | |||
@@ -112,6 +112,8 @@ search_module_dbetables(unsigned long addr) | |||
112 | #define MODULE_PROC_FAMILY "RM9000 " | 112 | #define MODULE_PROC_FAMILY "RM9000 " |
113 | #elif defined CONFIG_CPU_SB1 | 113 | #elif defined CONFIG_CPU_SB1 |
114 | #define MODULE_PROC_FAMILY "SB1 " | 114 | #define MODULE_PROC_FAMILY "SB1 " |
115 | #elif defined CONFIG_CPU_LOONGSON2 | ||
116 | #define MODULE_PROC_FAMILY "LOONGSON2 " | ||
115 | #else | 117 | #else |
116 | #error MODULE_PROC_FAMILY undefined for your processor configuration | 118 | #error MODULE_PROC_FAMILY undefined for your processor configuration |
117 | #endif | 119 | #endif |
diff --git a/include/asm-mips/nile4.h b/include/asm-mips/nile4.h deleted file mode 100644 index c3ca959aa4d9..000000000000 --- a/include/asm-mips/nile4.h +++ /dev/null | |||
@@ -1,310 +0,0 @@ | |||
1 | /* | ||
2 | * asm-mips/nile4.h -- NEC Vrc-5074 Nile 4 definitions | ||
3 | * | ||
4 | * Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com> | ||
5 | * Sony Software Development Center Europe (SDCE), Brussels | ||
6 | * | ||
7 | * This file is based on the following documentation: | ||
8 | * | ||
9 | * NEC Vrc 5074 System Controller Data Sheet, June 1998 | ||
10 | */ | ||
11 | |||
12 | #ifndef _ASM_NILE4_H | ||
13 | #define _ASM_NILE4_H | ||
14 | |||
15 | #define NILE4_BASE 0xbfa00000 | ||
16 | #define NILE4_SIZE 0x00200000 /* 2 MB */ | ||
17 | |||
18 | |||
19 | /* | ||
20 | * Physical Device Address Registers (PDARs) | ||
21 | */ | ||
22 | |||
23 | #define NILE4_SDRAM0 0x0000 /* SDRAM Bank 0 [R/W] */ | ||
24 | #define NILE4_SDRAM1 0x0008 /* SDRAM Bank 1 [R/W] */ | ||
25 | #define NILE4_DCS2 0x0010 /* Device Chip-Select 2 [R/W] */ | ||
26 | #define NILE4_DCS3 0x0018 /* Device Chip-Select 3 [R/W] */ | ||
27 | #define NILE4_DCS4 0x0020 /* Device Chip-Select 4 [R/W] */ | ||
28 | #define NILE4_DCS5 0x0028 /* Device Chip-Select 5 [R/W] */ | ||
29 | #define NILE4_DCS6 0x0030 /* Device Chip-Select 6 [R/W] */ | ||
30 | #define NILE4_DCS7 0x0038 /* Device Chip-Select 7 [R/W] */ | ||
31 | #define NILE4_DCS8 0x0040 /* Device Chip-Select 8 [R/W] */ | ||
32 | #define NILE4_PCIW0 0x0060 /* PCI Address Window 0 [R/W] */ | ||
33 | #define NILE4_PCIW1 0x0068 /* PCI Address Window 1 [R/W] */ | ||
34 | #define NILE4_INTCS 0x0070 /* Controller Internal Registers and Devices */ | ||
35 | /* [R/W] */ | ||
36 | #define NILE4_BOOTCS 0x0078 /* Boot ROM Chip-Select [R/W] */ | ||
37 | |||
38 | |||
39 | /* | ||
40 | * CPU Interface Registers | ||
41 | */ | ||
42 | |||
43 | #define NILE4_CPUSTAT 0x0080 /* CPU Status [R/W] */ | ||
44 | #define NILE4_INTCTRL 0x0088 /* Interrupt Control [R/W] */ | ||
45 | #define NILE4_INTSTAT0 0x0090 /* Interrupt Status 0 [R] */ | ||
46 | #define NILE4_INTSTAT1 0x0098 /* Interrupt Status 1 and CPU Interrupt */ | ||
47 | /* Enable [R/W] */ | ||
48 | #define NILE4_INTCLR 0x00A0 /* Interrupt Clear [R/W] */ | ||
49 | #define NILE4_INTPPES 0x00A8 /* PCI Interrupt Control [R/W] */ | ||
50 | |||
51 | |||
52 | /* | ||
53 | * Memory-Interface Registers | ||
54 | */ | ||
55 | |||
56 | #define NILE4_MEMCTRL 0x00C0 /* Memory Control */ | ||
57 | #define NILE4_ACSTIME 0x00C8 /* Memory Access Timing [R/W] */ | ||
58 | #define NILE4_CHKERR 0x00D0 /* Memory Check Error Status [R] */ | ||
59 | |||
60 | |||
61 | /* | ||
62 | * PCI-Bus Registers | ||
63 | */ | ||
64 | |||
65 | #define NILE4_PCICTRL 0x00E0 /* PCI Control [R/W] */ | ||
66 | #define NILE4_PCIARB 0x00E8 /* PCI Arbiter [R/W] */ | ||
67 | #define NILE4_PCIINIT0 0x00F0 /* PCI Master (Initiator) 0 [R/W] */ | ||
68 | #define NILE4_PCIINIT1 0x00F8 /* PCI Master (Initiator) 1 [R/W] */ | ||
69 | #define NILE4_PCIERR 0x00B8 /* PCI Error [R/W] */ | ||
70 | |||
71 | |||
72 | /* | ||
73 | * Local-Bus Registers | ||
74 | */ | ||
75 | |||
76 | #define NILE4_LCNFG 0x0100 /* Local Bus Configuration [R/W] */ | ||
77 | #define NILE4_LCST2 0x0110 /* Local Bus Chip-Select Timing 2 [R/W] */ | ||
78 | #define NILE4_LCST3 0x0118 /* Local Bus Chip-Select Timing 3 [R/W] */ | ||
79 | #define NILE4_LCST4 0x0120 /* Local Bus Chip-Select Timing 4 [R/W] */ | ||
80 | #define NILE4_LCST5 0x0128 /* Local Bus Chip-Select Timing 5 [R/W] */ | ||
81 | #define NILE4_LCST6 0x0130 /* Local Bus Chip-Select Timing 6 [R/W] */ | ||
82 | #define NILE4_LCST7 0x0138 /* Local Bus Chip-Select Timing 7 [R/W] */ | ||
83 | #define NILE4_LCST8 0x0140 /* Local Bus Chip-Select Timing 8 [R/W] */ | ||
84 | #define NILE4_DCSFN 0x0150 /* Device Chip-Select Muxing and Output */ | ||
85 | /* Enables [R/W] */ | ||
86 | #define NILE4_DCSIO 0x0158 /* Device Chip-Selects As I/O Bits [R/W] */ | ||
87 | #define NILE4_BCST 0x0178 /* Local Boot Chip-Select Timing [R/W] */ | ||
88 | |||
89 | |||
90 | /* | ||
91 | * DMA Registers | ||
92 | */ | ||
93 | |||
94 | #define NILE4_DMACTRL0 0x0180 /* DMA Control 0 [R/W] */ | ||
95 | #define NILE4_DMASRCA0 0x0188 /* DMA Source Address 0 [R/W] */ | ||
96 | #define NILE4_DMADESA0 0x0190 /* DMA Destination Address 0 [R/W] */ | ||
97 | #define NILE4_DMACTRL1 0x0198 /* DMA Control 1 [R/W] */ | ||
98 | #define NILE4_DMASRCA1 0x01A0 /* DMA Source Address 1 [R/W] */ | ||
99 | #define NILE4_DMADESA1 0x01A8 /* DMA Destination Address 1 [R/W] */ | ||
100 | |||
101 | |||
102 | /* | ||
103 | * Timer Registers | ||
104 | */ | ||
105 | |||
106 | #define NILE4_T0CTRL 0x01C0 /* SDRAM Refresh Control [R/W] */ | ||
107 | #define NILE4_T0CNTR 0x01C8 /* SDRAM Refresh Counter [R/W] */ | ||
108 | #define NILE4_T1CTRL 0x01D0 /* CPU-Bus Read Time-Out Control [R/W] */ | ||
109 | #define NILE4_T1CNTR 0x01D8 /* CPU-Bus Read Time-Out Counter [R/W] */ | ||
110 | #define NILE4_T2CTRL 0x01E0 /* General-Purpose Timer Control [R/W] */ | ||
111 | #define NILE4_T2CNTR 0x01E8 /* General-Purpose Timer Counter [R/W] */ | ||
112 | #define NILE4_T3CTRL 0x01F0 /* Watchdog Timer Control [R/W] */ | ||
113 | #define NILE4_T3CNTR 0x01F8 /* Watchdog Timer Counter [R/W] */ | ||
114 | |||
115 | |||
116 | /* | ||
117 | * PCI Configuration Space Registers | ||
118 | */ | ||
119 | |||
120 | #define NILE4_PCI_BASE 0x0200 | ||
121 | |||
122 | #define NILE4_VID 0x0200 /* PCI Vendor ID [R] */ | ||
123 | #define NILE4_DID 0x0202 /* PCI Device ID [R] */ | ||
124 | #define NILE4_PCICMD 0x0204 /* PCI Command [R/W] */ | ||
125 | #define NILE4_PCISTS 0x0206 /* PCI Status [R/W] */ | ||
126 | #define NILE4_REVID 0x0208 /* PCI Revision ID [R] */ | ||
127 | #define NILE4_CLASS 0x0209 /* PCI Class Code [R] */ | ||
128 | #define NILE4_CLSIZ 0x020C /* PCI Cache Line Size [R/W] */ | ||
129 | #define NILE4_MLTIM 0x020D /* PCI Latency Timer [R/W] */ | ||
130 | #define NILE4_HTYPE 0x020E /* PCI Header Type [R] */ | ||
131 | #define NILE4_BIST 0x020F /* BIST [R] (unimplemented) */ | ||
132 | #define NILE4_BARC 0x0210 /* PCI Base Address Register Control [R/W] */ | ||
133 | #define NILE4_BAR0 0x0218 /* PCI Base Address Register 0 [R/W] */ | ||
134 | #define NILE4_BAR1 0x0220 /* PCI Base Address Register 1 [R/W] */ | ||
135 | #define NILE4_CIS 0x0228 /* PCI Cardbus CIS Pointer [R] */ | ||
136 | /* (unimplemented) */ | ||
137 | #define NILE4_SSVID 0x022C /* PCI Sub-System Vendor ID [R/W] */ | ||
138 | #define NILE4_SSID 0x022E /* PCI Sub-System ID [R/W] */ | ||
139 | #define NILE4_ROM 0x0230 /* Expansion ROM Base Address [R] */ | ||
140 | /* (unimplemented) */ | ||
141 | #define NILE4_INTLIN 0x023C /* PCI Interrupt Line [R/W] */ | ||
142 | #define NILE4_INTPIN 0x023D /* PCI Interrupt Pin [R] */ | ||
143 | #define NILE4_MINGNT 0x023E /* PCI Min_Gnt [R] (unimplemented) */ | ||
144 | #define NILE4_MAXLAT 0x023F /* PCI Max_Lat [R] (unimplemented) */ | ||
145 | #define NILE4_BAR2 0x0240 /* PCI Base Address Register 2 [R/W] */ | ||
146 | #define NILE4_BAR3 0x0248 /* PCI Base Address Register 3 [R/W] */ | ||
147 | #define NILE4_BAR4 0x0250 /* PCI Base Address Register 4 [R/W] */ | ||
148 | #define NILE4_BAR5 0x0258 /* PCI Base Address Register 5 [R/W] */ | ||
149 | #define NILE4_BAR6 0x0260 /* PCI Base Address Register 6 [R/W] */ | ||
150 | #define NILE4_BAR7 0x0268 /* PCI Base Address Register 7 [R/W] */ | ||
151 | #define NILE4_BAR8 0x0270 /* PCI Base Address Register 8 [R/W] */ | ||
152 | #define NILE4_BARB 0x0278 /* PCI Base Address Register BOOT [R/W] */ | ||
153 | |||
154 | |||
155 | /* | ||
156 | * Serial-Port Registers | ||
157 | */ | ||
158 | |||
159 | #define NILE4_UART_BASE 0x0300 | ||
160 | |||
161 | #define NILE4_UARTRBR 0x0300 /* UART Receiver Data Buffer [R] */ | ||
162 | #define NILE4_UARTTHR 0x0300 /* UART Transmitter Data Holding [W] */ | ||
163 | #define NILE4_UARTIER 0x0308 /* UART Interrupt Enable [R/W] */ | ||
164 | #define NILE4_UARTDLL 0x0300 /* UART Divisor Latch LSB [R/W] */ | ||
165 | #define NILE4_UARTDLM 0x0308 /* UART Divisor Latch MSB [R/W] */ | ||
166 | #define NILE4_UARTIIR 0x0310 /* UART Interrupt ID [R] */ | ||
167 | #define NILE4_UARTFCR 0x0310 /* UART FIFO Control [W] */ | ||
168 | #define NILE4_UARTLCR 0x0318 /* UART Line Control [R/W] */ | ||
169 | #define NILE4_UARTMCR 0x0320 /* UART Modem Control [R/W] */ | ||
170 | #define NILE4_UARTLSR 0x0328 /* UART Line Status [R/W] */ | ||
171 | #define NILE4_UARTMSR 0x0330 /* UART Modem Status [R/W] */ | ||
172 | #define NILE4_UARTSCR 0x0338 /* UART Scratch [R/W] */ | ||
173 | |||
174 | #define NILE4_UART_BASE_BAUD 520833 /* 100 MHz / 12 / 16 */ | ||
175 | |||
176 | |||
177 | /* | ||
178 | * Interrupt Lines | ||
179 | */ | ||
180 | |||
181 | #define NILE4_INT_CPCE 0 /* CPU-Interface Parity-Error Interrupt */ | ||
182 | #define NILE4_INT_CNTD 1 /* CPU No-Target Decode Interrupt */ | ||
183 | #define NILE4_INT_MCE 2 /* Memory-Check Error Interrupt */ | ||
184 | #define NILE4_INT_DMA 3 /* DMA Controller Interrupt */ | ||
185 | #define NILE4_INT_UART 4 /* UART Interrupt */ | ||
186 | #define NILE4_INT_WDOG 5 /* Watchdog Timer Interrupt */ | ||
187 | #define NILE4_INT_GPT 6 /* General-Purpose Timer Interrupt */ | ||
188 | #define NILE4_INT_LBRTD 7 /* Local-Bus Ready Timer Interrupt */ | ||
189 | #define NILE4_INT_INTA 8 /* PCI Interrupt Signal INTA# */ | ||
190 | #define NILE4_INT_INTB 9 /* PCI Interrupt Signal INTB# */ | ||
191 | #define NILE4_INT_INTC 10 /* PCI Interrupt Signal INTC# */ | ||
192 | #define NILE4_INT_INTD 11 /* PCI Interrupt Signal INTD# */ | ||
193 | #define NILE4_INT_INTE 12 /* PCI Interrupt Signal INTE# (ISA cascade) */ | ||
194 | #define NILE4_INT_RESV 13 /* Reserved */ | ||
195 | #define NILE4_INT_PCIS 14 /* PCI SERR# Interrupt */ | ||
196 | #define NILE4_INT_PCIE 15 /* PCI Internal Error Interrupt */ | ||
197 | |||
198 | |||
199 | /* | ||
200 | * Nile 4 Register Access | ||
201 | */ | ||
202 | |||
203 | static inline void nile4_sync(void) | ||
204 | { | ||
205 | volatile u32 *p = (volatile u32 *)0xbfc00000; | ||
206 | (void)(*p); | ||
207 | } | ||
208 | |||
209 | static inline void nile4_out32(u32 offset, u32 val) | ||
210 | { | ||
211 | *(volatile u32 *)(NILE4_BASE+offset) = val; | ||
212 | nile4_sync(); | ||
213 | } | ||
214 | |||
215 | static inline u32 nile4_in32(u32 offset) | ||
216 | { | ||
217 | u32 val = *(volatile u32 *)(NILE4_BASE+offset); | ||
218 | nile4_sync(); | ||
219 | return val; | ||
220 | } | ||
221 | |||
222 | static inline void nile4_out16(u32 offset, u16 val) | ||
223 | { | ||
224 | *(volatile u16 *)(NILE4_BASE+offset) = val; | ||
225 | nile4_sync(); | ||
226 | } | ||
227 | |||
228 | static inline u16 nile4_in16(u32 offset) | ||
229 | { | ||
230 | u16 val = *(volatile u16 *)(NILE4_BASE+offset); | ||
231 | nile4_sync(); | ||
232 | return val; | ||
233 | } | ||
234 | |||
235 | static inline void nile4_out8(u32 offset, u8 val) | ||
236 | { | ||
237 | *(volatile u8 *)(NILE4_BASE+offset) = val; | ||
238 | nile4_sync(); | ||
239 | } | ||
240 | |||
241 | static inline u8 nile4_in8(u32 offset) | ||
242 | { | ||
243 | u8 val = *(volatile u8 *)(NILE4_BASE+offset); | ||
244 | nile4_sync(); | ||
245 | return val; | ||
246 | } | ||
247 | |||
248 | |||
249 | /* | ||
250 | * Physical Device Address Registers | ||
251 | */ | ||
252 | |||
253 | extern void nile4_set_pdar(u32 pdar, u32 phys, u32 size, int width, | ||
254 | int on_memory_bus, int visible); | ||
255 | |||
256 | |||
257 | /* | ||
258 | * PCI Master Registers | ||
259 | */ | ||
260 | |||
261 | #define NILE4_PCICMD_IACK 0 /* PCI Interrupt Acknowledge */ | ||
262 | #define NILE4_PCICMD_IO 1 /* PCI I/O Space */ | ||
263 | #define NILE4_PCICMD_MEM 3 /* PCI Memory Space */ | ||
264 | #define NILE4_PCICMD_CFG 5 /* PCI Configuration Space */ | ||
265 | |||
266 | |||
267 | /* | ||
268 | * PCI Address Spaces | ||
269 | * | ||
270 | * Note that these are multiplexed using PCIINIT[01]! | ||
271 | */ | ||
272 | |||
273 | #define NILE4_PCI_IO_BASE 0xa6000000 | ||
274 | #define NILE4_PCI_MEM_BASE 0xa8000000 | ||
275 | #define NILE4_PCI_CFG_BASE NILE4_PCI_MEM_BASE | ||
276 | #define NILE4_PCI_IACK_BASE NILE4_PCI_IO_BASE | ||
277 | |||
278 | |||
279 | extern void nile4_set_pmr(u32 pmr, u32 type, u32 addr); | ||
280 | |||
281 | |||
282 | /* | ||
283 | * Interrupt Programming | ||
284 | */ | ||
285 | |||
286 | #define NUM_I8259_INTERRUPTS 16 | ||
287 | #define NUM_NILE4_INTERRUPTS 16 | ||
288 | |||
289 | #define IRQ_I8259_CASCADE NILE4_INT_INTE | ||
290 | #define is_i8259_irq(irq) ((irq) < NUM_I8259_INTERRUPTS) | ||
291 | #define nile4_to_irq(n) ((n)+NUM_I8259_INTERRUPTS) | ||
292 | #define irq_to_nile4(n) ((n)-NUM_I8259_INTERRUPTS) | ||
293 | |||
294 | extern void nile4_map_irq(int nile4_irq, int cpu_irq); | ||
295 | extern void nile4_map_irq_all(int cpu_irq); | ||
296 | extern void nile4_enable_irq(unsigned int nile4_irq); | ||
297 | extern void nile4_disable_irq(unsigned int nile4_irq); | ||
298 | extern void nile4_disable_irq_all(void); | ||
299 | extern u16 nile4_get_irq_stat(int cpu_irq); | ||
300 | extern void nile4_enable_irq_output(int cpu_irq); | ||
301 | extern void nile4_disable_irq_output(int cpu_irq); | ||
302 | extern void nile4_set_pci_irq_polarity(int pci_irq, int high); | ||
303 | extern void nile4_set_pci_irq_level_or_edge(int pci_irq, int level); | ||
304 | extern void nile4_clear_irq(int nile4_irq); | ||
305 | extern void nile4_clear_irq_mask(u32 mask); | ||
306 | extern u8 nile4_i8259_iack(void); | ||
307 | extern void nile4_dump_irq_status(void); /* Debug */ | ||
308 | |||
309 | #endif | ||
310 | |||
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index 5c3239dad0f2..b92dd8c760da 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h | |||
@@ -34,12 +34,8 @@ | |||
34 | 34 | ||
35 | #ifndef __ASSEMBLY__ | 35 | #ifndef __ASSEMBLY__ |
36 | 36 | ||
37 | /* | 37 | #include <linux/pfn.h> |
38 | * This gives the physical RAM offset. | 38 | #include <asm/io.h> |
39 | */ | ||
40 | #ifndef PHYS_OFFSET | ||
41 | #define PHYS_OFFSET 0UL | ||
42 | #endif | ||
43 | 39 | ||
44 | /* | 40 | /* |
45 | * It's normally defined only for FLATMEM config but it's | 41 | * It's normally defined only for FLATMEM config but it's |
@@ -48,9 +44,6 @@ | |||
48 | */ | 44 | */ |
49 | #define ARCH_PFN_OFFSET PFN_UP(PHYS_OFFSET) | 45 | #define ARCH_PFN_OFFSET PFN_UP(PHYS_OFFSET) |
50 | 46 | ||
51 | #include <linux/pfn.h> | ||
52 | #include <asm/io.h> | ||
53 | |||
54 | extern void clear_page(void * page); | 47 | extern void clear_page(void * page); |
55 | extern void copy_page(void * to, void * from); | 48 | extern void copy_page(void * to, void * from); |
56 | 49 | ||
@@ -150,11 +143,15 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
150 | * __pa()/__va() should be used only during mem init. | 143 | * __pa()/__va() should be used only during mem init. |
151 | */ | 144 | */ |
152 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) | 145 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) |
153 | #define __pa_page_offset(x) ((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0) | 146 | #define __pa(x) \ |
147 | ({ \ | ||
148 | unsigned long __x = (unsigned long)(x); \ | ||
149 | __x < CKSEG0 ? XPHYSADDR(__x) : CPHYSADDR(__x); \ | ||
150 | }) | ||
154 | #else | 151 | #else |
155 | #define __pa_page_offset(x) PAGE_OFFSET | 152 | #define __pa(x) \ |
153 | ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET) | ||
156 | #endif | 154 | #endif |
157 | #define __pa(x) ((unsigned long)(x) - __pa_page_offset(x) + PHYS_OFFSET) | ||
158 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) | 155 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) |
159 | #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0)) | 156 | #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0)) |
160 | 157 | ||
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index 3eea3ba0fca5..a59d54749eef 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h | |||
@@ -56,7 +56,7 @@ extern void register_pci_controller(struct pci_controller *hose); | |||
56 | /* | 56 | /* |
57 | * board supplied pci irq fixup routine | 57 | * board supplied pci irq fixup routine |
58 | */ | 58 | */ |
59 | extern int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin); | 59 | extern int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); |
60 | 60 | ||
61 | 61 | ||
62 | /* Can be used to override the logic in pci_scan_bus for skipping | 62 | /* Can be used to override the logic in pci_scan_bus for skipping |
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_cic_int.h b/include/asm-mips/pmc-sierra/msp71xx/msp_cic_int.h new file mode 100644 index 000000000000..c84bcf9570b1 --- /dev/null +++ b/include/asm-mips/pmc-sierra/msp71xx/msp_cic_int.h | |||
@@ -0,0 +1,151 @@ | |||
1 | /* | ||
2 | * Defines for the MSP interrupt controller. | ||
3 | * | ||
4 | * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved. | ||
5 | * Author: Carsten Langgaard, carstenl@mips.com | ||
6 | * | ||
7 | * ######################################################################## | ||
8 | * | ||
9 | * This program is free software; you can distribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License (Version 2) as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
16 | * for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
21 | * | ||
22 | * ######################################################################## | ||
23 | */ | ||
24 | |||
25 | #ifndef _MSP_CIC_INT_H | ||
26 | #define _MSP_CIC_INT_H | ||
27 | |||
28 | /* | ||
29 | * The PMC-Sierra CIC interrupts are all centrally managed by the | ||
30 | * CIC sub-system. | ||
31 | * We attempt to keep the interrupt numbers as consistent as possible | ||
32 | * across all of the MSP devices, but some differences will creep in ... | ||
33 | * The interrupts which are directly forwarded to the MIPS core interrupts | ||
34 | * are assigned interrupts in the range 0-7, interrupts cascaded through | ||
35 | * the CIC are assigned interrupts 8-39. The cascade occurs on C_IRQ4 | ||
36 | * (MSP_INT_CIC). Currently we don't really distinguish between VPE1 | ||
37 | * and VPE0 (or thread contexts for that matter). Will have to fix. | ||
38 | * The PER interrupts are assigned interrupts in the range 40-71. | ||
39 | */ | ||
40 | |||
41 | |||
42 | /* | ||
43 | * IRQs directly forwarded to the CPU | ||
44 | */ | ||
45 | #define MSP_MIPS_INTBASE 0 | ||
46 | #define MSP_INT_SW0 0 /* IRQ for swint0, C_SW0 */ | ||
47 | #define MSP_INT_SW1 1 /* IRQ for swint1, C_SW1 */ | ||
48 | #define MSP_INT_MAC0 2 /* IRQ for MAC 0, C_IRQ0 */ | ||
49 | #define MSP_INT_MAC1 3 /* IRQ for MAC 1, C_IRQ1 */ | ||
50 | #define MSP_INT_USB 4 /* IRQ for USB, C_IRQ2 */ | ||
51 | #define MSP_INT_SAR 5 /* IRQ for ADSL2+ SAR, C_IRQ3 */ | ||
52 | #define MSP_INT_CIC 6 /* IRQ for CIC block, C_IRQ4 */ | ||
53 | #define MSP_INT_SEC 7 /* IRQ for Sec engine, C_IRQ5 */ | ||
54 | |||
55 | /* | ||
56 | * IRQs cascaded on CPU interrupt 4 (CAUSE bit 12, C_IRQ4) | ||
57 | * These defines should be tied to the register definitions for the CIC | ||
58 | * interrupt routine. For now, just use hard-coded values. | ||
59 | */ | ||
60 | #define MSP_CIC_INTBASE (MSP_MIPS_INTBASE + 8) | ||
61 | #define MSP_INT_EXT0 (MSP_CIC_INTBASE + 0) | ||
62 | /* External interrupt 0 */ | ||
63 | #define MSP_INT_EXT1 (MSP_CIC_INTBASE + 1) | ||
64 | /* External interrupt 1 */ | ||
65 | #define MSP_INT_EXT2 (MSP_CIC_INTBASE + 2) | ||
66 | /* External interrupt 2 */ | ||
67 | #define MSP_INT_EXT3 (MSP_CIC_INTBASE + 3) | ||
68 | /* External interrupt 3 */ | ||
69 | #define MSP_INT_CPUIF (MSP_CIC_INTBASE + 4) | ||
70 | /* CPU interface interrupt */ | ||
71 | #define MSP_INT_EXT4 (MSP_CIC_INTBASE + 5) | ||
72 | /* External interrupt 4 */ | ||
73 | #define MSP_INT_CIC_USB (MSP_CIC_INTBASE + 6) | ||
74 | /* Cascaded IRQ for USB */ | ||
75 | #define MSP_INT_MBOX (MSP_CIC_INTBASE + 7) | ||
76 | /* Sec engine mailbox IRQ */ | ||
77 | #define MSP_INT_EXT5 (MSP_CIC_INTBASE + 8) | ||
78 | /* External interrupt 5 */ | ||
79 | #define MSP_INT_TDM (MSP_CIC_INTBASE + 9) | ||
80 | /* TDM interrupt */ | ||
81 | #define MSP_INT_CIC_MAC0 (MSP_CIC_INTBASE + 10) | ||
82 | /* Cascaded IRQ for MAC 0 */ | ||
83 | #define MSP_INT_CIC_MAC1 (MSP_CIC_INTBASE + 11) | ||
84 | /* Cascaded IRQ for MAC 1 */ | ||
85 | #define MSP_INT_CIC_SEC (MSP_CIC_INTBASE + 12) | ||
86 | /* Cascaded IRQ for sec engine */ | ||
87 | #define MSP_INT_PER (MSP_CIC_INTBASE + 13) | ||
88 | /* Peripheral interrupt */ | ||
89 | #define MSP_INT_TIMER0 (MSP_CIC_INTBASE + 14) | ||
90 | /* SLP timer 0 */ | ||
91 | #define MSP_INT_TIMER1 (MSP_CIC_INTBASE + 15) | ||
92 | /* SLP timer 1 */ | ||
93 | #define MSP_INT_TIMER2 (MSP_CIC_INTBASE + 16) | ||
94 | /* SLP timer 2 */ | ||
95 | #define MSP_INT_VPE0_TIMER (MSP_CIC_INTBASE + 17) | ||
96 | /* VPE0 MIPS timer */ | ||
97 | #define MSP_INT_BLKCP (MSP_CIC_INTBASE + 18) | ||
98 | /* Block Copy */ | ||
99 | #define MSP_INT_UART0 (MSP_CIC_INTBASE + 19) | ||
100 | /* UART 0 */ | ||
101 | #define MSP_INT_PCI (MSP_CIC_INTBASE + 20) | ||
102 | /* PCI subsystem */ | ||
103 | #define MSP_INT_EXT6 (MSP_CIC_INTBASE + 21) | ||
104 | /* External interrupt 5 */ | ||
105 | #define MSP_INT_PCI_MSI (MSP_CIC_INTBASE + 22) | ||
106 | /* PCI Message Signal */ | ||
107 | #define MSP_INT_CIC_SAR (MSP_CIC_INTBASE + 23) | ||
108 | /* Cascaded ADSL2+ SAR IRQ */ | ||
109 | #define MSP_INT_DSL (MSP_CIC_INTBASE + 24) | ||
110 | /* ADSL2+ IRQ */ | ||
111 | #define MSP_INT_CIC_ERR (MSP_CIC_INTBASE + 25) | ||
112 | /* SLP error condition */ | ||
113 | #define MSP_INT_VPE1_TIMER (MSP_CIC_INTBASE + 26) | ||
114 | /* VPE1 MIPS timer */ | ||
115 | #define MSP_INT_VPE0_PC (MSP_CIC_INTBASE + 27) | ||
116 | /* VPE0 Performance counter */ | ||
117 | #define MSP_INT_VPE1_PC (MSP_CIC_INTBASE + 28) | ||
118 | /* VPE1 Performance counter */ | ||
119 | #define MSP_INT_EXT7 (MSP_CIC_INTBASE + 29) | ||
120 | /* External interrupt 5 */ | ||
121 | #define MSP_INT_VPE0_SW (MSP_CIC_INTBASE + 30) | ||
122 | /* VPE0 Software interrupt */ | ||
123 | #define MSP_INT_VPE1_SW (MSP_CIC_INTBASE + 31) | ||
124 | /* VPE0 Software interrupt */ | ||
125 | |||
126 | /* | ||
127 | * IRQs cascaded on CIC PER interrupt (MSP_INT_PER) | ||
128 | */ | ||
129 | #define MSP_PER_INTBASE (MSP_CIC_INTBASE + 32) | ||
130 | /* Reserved 0-1 */ | ||
131 | #define MSP_INT_UART1 (MSP_PER_INTBASE + 2) | ||
132 | /* UART 1 */ | ||
133 | /* Reserved 3-5 */ | ||
134 | #define MSP_INT_2WIRE (MSP_PER_INTBASE + 6) | ||
135 | /* 2-wire */ | ||
136 | #define MSP_INT_TM0 (MSP_PER_INTBASE + 7) | ||
137 | /* Peripheral timer block out 0 */ | ||
138 | #define MSP_INT_TM1 (MSP_PER_INTBASE + 8) | ||
139 | /* Peripheral timer block out 1 */ | ||
140 | /* Reserved 9 */ | ||
141 | #define MSP_INT_SPRX (MSP_PER_INTBASE + 10) | ||
142 | /* SPI RX complete */ | ||
143 | #define MSP_INT_SPTX (MSP_PER_INTBASE + 11) | ||
144 | /* SPI TX complete */ | ||
145 | #define MSP_INT_GPIO (MSP_PER_INTBASE + 12) | ||
146 | /* GPIO */ | ||
147 | #define MSP_INT_PER_ERR (MSP_PER_INTBASE + 13) | ||
148 | /* Peripheral error */ | ||
149 | /* Reserved 14-31 */ | ||
150 | |||
151 | #endif /* !_MSP_CIC_INT_H */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_int.h b/include/asm-mips/pmc-sierra/msp71xx/msp_int.h new file mode 100644 index 000000000000..1d9f05474820 --- /dev/null +++ b/include/asm-mips/pmc-sierra/msp71xx/msp_int.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Defines for the MSP interrupt handlers. | ||
3 | * | ||
4 | * Copyright (C) 2005, PMC-Sierra, Inc. All rights reserved. | ||
5 | * Author: Andrew Hughes, Andrew_Hughes@pmc-sierra.com | ||
6 | * | ||
7 | * ######################################################################## | ||
8 | * | ||
9 | * This program is free software; you can distribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License (Version 2) as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
16 | * for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
21 | * | ||
22 | * ######################################################################## | ||
23 | */ | ||
24 | |||
25 | #ifndef _MSP_INT_H | ||
26 | #define _MSP_INT_H | ||
27 | |||
28 | /* | ||
29 | * The PMC-Sierra MSP product line has at least two different interrupt | ||
30 | * controllers, the SLP register based scheme and the CIC interrupt | ||
31 | * controller block mechanism. This file distinguishes between them | ||
32 | * so that devices see a uniform interface. | ||
33 | */ | ||
34 | |||
35 | #if defined(CONFIG_IRQ_MSP_SLP) | ||
36 | #include "msp_slp_int.h" | ||
37 | #elif defined(CONFIG_IRQ_MSP_CIC) | ||
38 | #include "msp_cic_int.h" | ||
39 | #else | ||
40 | #error "What sort of interrupt controller does *your* MSP have?" | ||
41 | #endif | ||
42 | |||
43 | #endif /* !_MSP_INT_H */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_pci.h b/include/asm-mips/pmc-sierra/msp71xx/msp_pci.h new file mode 100644 index 000000000000..415606903617 --- /dev/null +++ b/include/asm-mips/pmc-sierra/msp71xx/msp_pci.h | |||
@@ -0,0 +1,205 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2000-2006 PMC-Sierra INC. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it | ||
5 | * and/or modify it under the terms of the GNU General | ||
6 | * Public License as published by the Free Software | ||
7 | * Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be | ||
11 | * useful, but WITHOUT ANY WARRANTY; without even the implied | ||
12 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | ||
13 | * PURPOSE. See the GNU General Public License for more | ||
14 | * details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public | ||
17 | * License along with this program; if not, write to the Free | ||
18 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA | ||
19 | * 02139, USA. | ||
20 | * | ||
21 | * PMC-SIERRA INC. DISCLAIMS ANY LIABILITY OF ANY KIND | ||
22 | * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS | ||
23 | * SOFTWARE. | ||
24 | */ | ||
25 | |||
26 | #ifndef _MSP_PCI_H_ | ||
27 | #define _MSP_PCI_H_ | ||
28 | |||
29 | #define MSP_HAS_PCI(ID) (((u32)(ID) <= 0x4236) && ((u32)(ID) >= 0x4220)) | ||
30 | |||
31 | /* | ||
32 | * It is convenient to program the OATRAN register so that | ||
33 | * Athena virtual address space and PCI address space are | ||
34 | * the same. This is not a requirement, just a convenience. | ||
35 | * | ||
36 | * The only hard restrictions on the value of OATRAN is that | ||
37 | * OATRAN must not be programmed to allow translated memory | ||
38 | * addresses to fall within the lowest 512MB of | ||
39 | * PCI address space. This region is hardcoded | ||
40 | * for use as Athena PCI Host Controller target | ||
41 | * access memory space to the Athena's SDRAM. | ||
42 | * | ||
43 | * Note that OATRAN applies only to memory accesses, not | ||
44 | * to I/O accesses. | ||
45 | * | ||
46 | * To program OATRAN to make Athena virtual address space | ||
47 | * and PCI address space have the same values, OATRAN | ||
48 | * is to be programmed to 0xB8000000. The top seven | ||
49 | * bits of the value mimic the seven bits clipped off | ||
50 | * by the PCI Host controller. | ||
51 | * | ||
52 | * With OATRAN at the said value, when the CPU does | ||
53 | * an access to its virtual address at, say 0xB900_5000, | ||
54 | * the address appearing on the PCI bus will be | ||
55 | * 0xB900_5000. | ||
56 | * - Michael Penner | ||
57 | */ | ||
58 | #define MSP_PCI_OATRAN 0xB8000000UL | ||
59 | |||
60 | #define MSP_PCI_SPACE_BASE (MSP_PCI_OATRAN + 0x1002000UL) | ||
61 | #define MSP_PCI_SPACE_SIZE (0x3000000UL - 0x2000) | ||
62 | #define MSP_PCI_SPACE_END \ | ||
63 | (MSP_PCI_SPACE_BASE + MSP_PCI_SPACE_SIZE - 1) | ||
64 | #define MSP_PCI_IOSPACE_BASE (MSP_PCI_OATRAN + 0x1001000UL) | ||
65 | #define MSP_PCI_IOSPACE_SIZE 0x1000 | ||
66 | #define MSP_PCI_IOSPACE_END \ | ||
67 | (MSP_PCI_IOSPACE_BASE + MSP_PCI_IOSPACE_SIZE - 1) | ||
68 | |||
69 | /* IRQ for PCI status interrupts */ | ||
70 | #define PCI_STAT_IRQ 20 | ||
71 | |||
72 | #define QFLUSH_REG_1 0xB7F40000 | ||
73 | |||
74 | typedef volatile unsigned int pcireg; | ||
75 | typedef void * volatile ppcireg; | ||
76 | |||
77 | struct pci_block_copy | ||
78 | { | ||
79 | pcireg unused1; /* +0x00 */ | ||
80 | pcireg unused2; /* +0x04 */ | ||
81 | ppcireg unused3; /* +0x08 */ | ||
82 | ppcireg unused4; /* +0x0C */ | ||
83 | pcireg unused5; /* +0x10 */ | ||
84 | pcireg unused6; /* +0x14 */ | ||
85 | pcireg unused7; /* +0x18 */ | ||
86 | ppcireg unused8; /* +0x1C */ | ||
87 | ppcireg unused9; /* +0x20 */ | ||
88 | pcireg unusedA; /* +0x24 */ | ||
89 | ppcireg unusedB; /* +0x28 */ | ||
90 | ppcireg unusedC; /* +0x2C */ | ||
91 | }; | ||
92 | |||
93 | enum | ||
94 | { | ||
95 | config_device_vendor, /* 0 */ | ||
96 | config_status_command, /* 1 */ | ||
97 | config_class_revision, /* 2 */ | ||
98 | config_BIST_header_latency_cache, /* 3 */ | ||
99 | config_BAR0, /* 4 */ | ||
100 | config_BAR1, /* 5 */ | ||
101 | config_BAR2, /* 6 */ | ||
102 | config_not_used7, /* 7 */ | ||
103 | config_not_used8, /* 8 */ | ||
104 | config_not_used9, /* 9 */ | ||
105 | config_CIS, /* 10 */ | ||
106 | config_subsystem, /* 11 */ | ||
107 | config_not_used12, /* 12 */ | ||
108 | config_capabilities, /* 13 */ | ||
109 | config_not_used14, /* 14 */ | ||
110 | config_lat_grant_irq, /* 15 */ | ||
111 | config_message_control,/* 16 */ | ||
112 | config_message_addr, /* 17 */ | ||
113 | config_message_data, /* 18 */ | ||
114 | config_VPD_addr, /* 19 */ | ||
115 | config_VPD_data, /* 20 */ | ||
116 | config_maxregs /* 21 - number of registers */ | ||
117 | }; | ||
118 | |||
119 | struct msp_pci_regs | ||
120 | { | ||
121 | pcireg hop_unused_00; /* +0x00 */ | ||
122 | pcireg hop_unused_04; /* +0x04 */ | ||
123 | pcireg hop_unused_08; /* +0x08 */ | ||
124 | pcireg hop_unused_0C; /* +0x0C */ | ||
125 | pcireg hop_unused_10; /* +0x10 */ | ||
126 | pcireg hop_unused_14; /* +0x14 */ | ||
127 | pcireg hop_unused_18; /* +0x18 */ | ||
128 | pcireg hop_unused_1C; /* +0x1C */ | ||
129 | pcireg hop_unused_20; /* +0x20 */ | ||
130 | pcireg hop_unused_24; /* +0x24 */ | ||
131 | pcireg hop_unused_28; /* +0x28 */ | ||
132 | pcireg hop_unused_2C; /* +0x2C */ | ||
133 | pcireg hop_unused_30; /* +0x30 */ | ||
134 | pcireg hop_unused_34; /* +0x34 */ | ||
135 | pcireg if_control; /* +0x38 */ | ||
136 | pcireg oatran; /* +0x3C */ | ||
137 | pcireg reset_ctl; /* +0x40 */ | ||
138 | pcireg config_addr; /* +0x44 */ | ||
139 | pcireg hop_unused_48; /* +0x48 */ | ||
140 | pcireg msg_signaled_int_status; /* +0x4C */ | ||
141 | pcireg msg_signaled_int_mask; /* +0x50 */ | ||
142 | pcireg if_status; /* +0x54 */ | ||
143 | pcireg if_mask; /* +0x58 */ | ||
144 | pcireg hop_unused_5C; /* +0x5C */ | ||
145 | pcireg hop_unused_60; /* +0x60 */ | ||
146 | pcireg hop_unused_64; /* +0x64 */ | ||
147 | pcireg hop_unused_68; /* +0x68 */ | ||
148 | pcireg hop_unused_6C; /* +0x6C */ | ||
149 | pcireg hop_unused_70; /* +0x70 */ | ||
150 | |||
151 | struct pci_block_copy pci_bc[2] __attribute__((aligned(64))); | ||
152 | |||
153 | pcireg error_hdr1; /* +0xE0 */ | ||
154 | pcireg error_hdr2; /* +0xE4 */ | ||
155 | |||
156 | pcireg config[config_maxregs] __attribute__((aligned(256))); | ||
157 | |||
158 | }; | ||
159 | |||
160 | #define BPCI_CFGADDR_BUSNUM_SHF 16 | ||
161 | #define BPCI_CFGADDR_FUNCTNUM_SHF 8 | ||
162 | #define BPCI_CFGADDR_REGNUM_SHF 2 | ||
163 | #define BPCI_CFGADDR_ENABLE (1<<31) | ||
164 | |||
165 | #define BPCI_IFCONTROL_RTO (1<<20) /* Retry timeout */ | ||
166 | #define BPCI_IFCONTROL_HCE (1<<16) /* Host configuration enable */ | ||
167 | #define BPCI_IFCONTROL_CTO_SHF 12 /* Shift count for CTO bits */ | ||
168 | #define BPCI_IFCONTROL_SE (1<<5) /* Enable exceptions on errors */ | ||
169 | #define BPCI_IFCONTROL_BIST (1<<4) /* Use BIST in per. mode */ | ||
170 | #define BPCI_IFCONTROL_CAP (1<<3) /* Enable capabilities */ | ||
171 | #define BPCI_IFCONTROL_MMC_SHF 0 /* Shift count for MMC bits */ | ||
172 | |||
173 | #define BPCI_IFSTATUS_MGT (1<<8) /* Master Grant timeout */ | ||
174 | #define BPCI_IFSTATUS_MTT (1<<9) /* Master TRDY timeout */ | ||
175 | #define BPCI_IFSTATUS_MRT (1<<10) /* Master retry timeout */ | ||
176 | #define BPCI_IFSTATUS_BC0F (1<<13) /* Block copy 0 fault */ | ||
177 | #define BPCI_IFSTATUS_BC1F (1<<14) /* Block copy 1 fault */ | ||
178 | #define BPCI_IFSTATUS_PCIU (1<<15) /* PCI unable to respond */ | ||
179 | #define BPCI_IFSTATUS_BSIZ (1<<16) /* PCI access with illegal size */ | ||
180 | #define BPCI_IFSTATUS_BADD (1<<17) /* PCI access with illegal addr */ | ||
181 | #define BPCI_IFSTATUS_RTO (1<<18) /* Retry time out */ | ||
182 | #define BPCI_IFSTATUS_SER (1<<19) /* System error */ | ||
183 | #define BPCI_IFSTATUS_PER (1<<20) /* Parity error */ | ||
184 | #define BPCI_IFSTATUS_LCA (1<<21) /* Local CPU abort */ | ||
185 | #define BPCI_IFSTATUS_MEM (1<<22) /* Memory prot. violation */ | ||
186 | #define BPCI_IFSTATUS_ARB (1<<23) /* Arbiter timed out */ | ||
187 | #define BPCI_IFSTATUS_STA (1<<27) /* Signaled target abort */ | ||
188 | #define BPCI_IFSTATUS_TA (1<<28) /* Target abort */ | ||
189 | #define BPCI_IFSTATUS_MA (1<<29) /* Master abort */ | ||
190 | #define BPCI_IFSTATUS_PEI (1<<30) /* Parity error as initiator */ | ||
191 | #define BPCI_IFSTATUS_PET (1<<31) /* Parity error as target */ | ||
192 | |||
193 | #define BPCI_RESETCTL_PR (1<<0) /* True if reset asserted */ | ||
194 | #define BPCI_RESETCTL_RT (1<<4) /* Release time */ | ||
195 | #define BPCI_RESETCTL_CT (1<<8) /* Config time */ | ||
196 | #define BPCI_RESETCTL_PE (1<<12) /* PCI enabled */ | ||
197 | #define BPCI_RESETCTL_HM (1<<13) /* PCI host mode */ | ||
198 | #define BPCI_RESETCTL_RI (1<<14) /* PCI reset in */ | ||
199 | |||
200 | extern struct msp_pci_regs msp_pci_regs | ||
201 | __attribute__((section(".register"))); | ||
202 | extern unsigned long msp_pci_config_space | ||
203 | __attribute__((section(".register"))); | ||
204 | |||
205 | #endif /* !_MSP_PCI_H_ */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_prom.h b/include/asm-mips/pmc-sierra/msp71xx/msp_prom.h new file mode 100644 index 000000000000..14ca7dc382a8 --- /dev/null +++ b/include/asm-mips/pmc-sierra/msp71xx/msp_prom.h | |||
@@ -0,0 +1,176 @@ | |||
1 | /* | ||
2 | * MIPS boards bootprom interface for the Linux kernel. | ||
3 | * | ||
4 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. | ||
5 | * Author: Carsten Langgaard, carstenl@mips.com | ||
6 | * | ||
7 | * ######################################################################## | ||
8 | * | ||
9 | * This program is free software; you can distribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License (Version 2) as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
16 | * for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
21 | * | ||
22 | * ######################################################################## | ||
23 | */ | ||
24 | |||
25 | #ifndef _ASM_MSP_PROM_H | ||
26 | #define _ASM_MSP_PROM_H | ||
27 | |||
28 | #include <linux/types.h> | ||
29 | |||
30 | #define DEVICEID "deviceid" | ||
31 | #define FEATURES "features" | ||
32 | #define PROM_ENV "prom_env" | ||
33 | #define PROM_ENV_FILE "/proc/"PROM_ENV | ||
34 | #define PROM_ENV_SIZE 256 | ||
35 | |||
36 | #define CPU_DEVID_FAMILY 0x0000ff00 | ||
37 | #define CPU_DEVID_REVISION 0x000000ff | ||
38 | |||
39 | #define FPGA_IS_POLO(revision) \ | ||
40 | (((revision >= 0xb0) && (revision < 0xd0))) | ||
41 | #define FPGA_IS_5000(revision) \ | ||
42 | ((revision >= 0x80) && (revision <= 0x90)) | ||
43 | #define FPGA_IS_ZEUS(revision) ((revision < 0x7f)) | ||
44 | #define FPGA_IS_DUET(revision) \ | ||
45 | (((revision >= 0xa0) && (revision < 0xb0))) | ||
46 | #define FPGA_IS_MSP4200(revision) ((revision >= 0xd0)) | ||
47 | #define FPGA_IS_MSP7100(revision) ((revision >= 0xd0)) | ||
48 | |||
49 | #define MACHINE_TYPE_POLO "POLO" | ||
50 | #define MACHINE_TYPE_DUET "DUET" | ||
51 | #define MACHINE_TYPE_ZEUS "ZEUS" | ||
52 | #define MACHINE_TYPE_MSP2000REVB "MSP2000REVB" | ||
53 | #define MACHINE_TYPE_MSP5000 "MSP5000" | ||
54 | #define MACHINE_TYPE_MSP4200 "MSP4200" | ||
55 | #define MACHINE_TYPE_MSP7120 "MSP7120" | ||
56 | #define MACHINE_TYPE_MSP7130 "MSP7130" | ||
57 | #define MACHINE_TYPE_OTHER "OTHER" | ||
58 | |||
59 | #define MACHINE_TYPE_POLO_FPGA "POLO-FPGA" | ||
60 | #define MACHINE_TYPE_DUET_FPGA "DUET-FPGA" | ||
61 | #define MACHINE_TYPE_ZEUS_FPGA "ZEUS_FPGA" | ||
62 | #define MACHINE_TYPE_MSP2000REVB_FPGA "MSP2000REVB-FPGA" | ||
63 | #define MACHINE_TYPE_MSP5000_FPGA "MSP5000-FPGA" | ||
64 | #define MACHINE_TYPE_MSP4200_FPGA "MSP4200-FPGA" | ||
65 | #define MACHINE_TYPE_MSP7100_FPGA "MSP7100-FPGA" | ||
66 | #define MACHINE_TYPE_OTHER_FPGA "OTHER-FPGA" | ||
67 | |||
68 | /* Device Family definitions */ | ||
69 | #define FAMILY_FPGA 0x0000 | ||
70 | #define FAMILY_ZEUS 0x1000 | ||
71 | #define FAMILY_POLO 0x2000 | ||
72 | #define FAMILY_DUET 0x4000 | ||
73 | #define FAMILY_TRIAD 0x5000 | ||
74 | #define FAMILY_MSP4200 0x4200 | ||
75 | #define FAMILY_MSP4200_FPGA 0x4f00 | ||
76 | #define FAMILY_MSP7100 0x7100 | ||
77 | #define FAMILY_MSP7100_FPGA 0x7f00 | ||
78 | |||
79 | /* Device Type definitions */ | ||
80 | #define TYPE_MSP7120 0x7120 | ||
81 | #define TYPE_MSP7130 0x7130 | ||
82 | |||
83 | #define ENET_KEY 'E' | ||
84 | #define ENETTXD_KEY 'e' | ||
85 | #define PCI_KEY 'P' | ||
86 | #define PCIMUX_KEY 'p' | ||
87 | #define SEC_KEY 'S' | ||
88 | #define SPAD_KEY 'D' | ||
89 | #define TDM_KEY 'T' | ||
90 | #define ZSP_KEY 'Z' | ||
91 | |||
92 | #define FEATURE_NOEXIST '-' | ||
93 | #define FEATURE_EXIST '+' | ||
94 | |||
95 | #define ENET_MII 'M' | ||
96 | #define ENET_RMII 'R' | ||
97 | |||
98 | #define ENETTXD_FALLING 'F' | ||
99 | #define ENETTXD_RISING 'R' | ||
100 | |||
101 | #define PCI_HOST 'H' | ||
102 | #define PCI_PERIPHERAL 'P' | ||
103 | |||
104 | #define PCIMUX_FULL 'F' | ||
105 | #define PCIMUX_SINGLE 'S' | ||
106 | |||
107 | #define SEC_DUET 'D' | ||
108 | #define SEC_POLO 'P' | ||
109 | #define SEC_SLOW 'S' | ||
110 | #define SEC_TRIAD 'T' | ||
111 | |||
112 | #define SPAD_POLO 'P' | ||
113 | |||
114 | #define TDM_DUET 'D' /* DUET TDMs might exist */ | ||
115 | #define TDM_POLO 'P' /* POLO TDMs might exist */ | ||
116 | #define TDM_TRIAD 'T' /* TRIAD TDMs might exist */ | ||
117 | |||
118 | #define ZSP_DUET 'D' /* one DUET zsp engine */ | ||
119 | #define ZSP_TRIAD 'T' /* two TRIAD zsp engines */ | ||
120 | |||
121 | extern char *prom_getcmdline(void); | ||
122 | extern char *prom_getenv(char *name); | ||
123 | extern void prom_init_cmdline(void); | ||
124 | extern void prom_meminit(void); | ||
125 | extern void prom_fixup_mem_map(unsigned long start_mem, | ||
126 | unsigned long end_mem); | ||
127 | |||
128 | #ifdef CONFIG_MTD_PMC_MSP_RAMROOT | ||
129 | extern bool get_ramroot(void **start, unsigned long *size); | ||
130 | #endif | ||
131 | |||
132 | extern int get_ethernet_addr(char *ethaddr_name, char *ethernet_addr); | ||
133 | extern unsigned long get_deviceid(void); | ||
134 | extern char identify_enet(unsigned long interface_num); | ||
135 | extern char identify_enetTxD(unsigned long interface_num); | ||
136 | extern char identify_pci(void); | ||
137 | extern char identify_sec(void); | ||
138 | extern char identify_spad(void); | ||
139 | extern char identify_sec(void); | ||
140 | extern char identify_tdm(void); | ||
141 | extern char identify_zsp(void); | ||
142 | extern unsigned long identify_family(void); | ||
143 | extern unsigned long identify_revision(void); | ||
144 | |||
145 | /* | ||
146 | * The following macro calls prom_printf and puts the format string | ||
147 | * into an init section so it can be reclaimed. | ||
148 | */ | ||
149 | #define ppfinit(f, x...) \ | ||
150 | do { \ | ||
151 | static char _f[] __initdata = KERN_INFO f; \ | ||
152 | printk(_f, ## x); \ | ||
153 | } while (0) | ||
154 | |||
155 | /* Memory descriptor management. */ | ||
156 | #define PROM_MAX_PMEMBLOCKS 7 /* 6 used */ | ||
157 | |||
158 | enum yamon_memtypes { | ||
159 | yamon_dontuse, | ||
160 | yamon_prom, | ||
161 | yamon_free, | ||
162 | }; | ||
163 | |||
164 | struct prom_pmemblock { | ||
165 | unsigned long base; /* Within KSEG0. */ | ||
166 | unsigned int size; /* In bytes. */ | ||
167 | unsigned int type; /* free or prom memory */ | ||
168 | }; | ||
169 | |||
170 | extern int prom_argc; | ||
171 | extern char **prom_argv; | ||
172 | extern char **prom_envp; | ||
173 | extern int *prom_vec; | ||
174 | extern struct prom_pmemblock *prom_getmdesc(void); | ||
175 | |||
176 | #endif /* !_ASM_MSP_PROM_H */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_regops.h b/include/asm-mips/pmc-sierra/msp71xx/msp_regops.h new file mode 100644 index 000000000000..60a5a38dd5b2 --- /dev/null +++ b/include/asm-mips/pmc-sierra/msp71xx/msp_regops.h | |||
@@ -0,0 +1,236 @@ | |||
1 | /* | ||
2 | * SMP/VPE-safe functions to access "registers" (see note). | ||
3 | * | ||
4 | * NOTES: | ||
5 | * - These macros use ll/sc instructions, so it is your responsibility to | ||
6 | * ensure these are available on your platform before including this file. | ||
7 | * - The MIPS32 spec states that ll/sc results are undefined for uncached | ||
8 | * accesses. This means they can't be used on HW registers accessed | ||
9 | * through kseg1. Code which requires these macros for this purpose must | ||
10 | * front-end the registers with cached memory "registers" and have a single | ||
11 | * thread update the actual HW registers. | ||
12 | * - A maximum of 2k of code can be inserted between ll and sc. Every | ||
13 | * memory accesses between the instructions will increase the chance of | ||
14 | * sc failing and having to loop. | ||
15 | * - When using custom_read_reg32/custom_write_reg32 only perform the | ||
16 | * necessary logical operations on the register value in between these | ||
17 | * two calls. All other logic should be performed before the first call. | ||
18 | * - There is a bug on the R10000 chips which has a workaround. If you | ||
19 | * are affected by this bug, make sure to define the symbol 'R10000_LLSC_WAR' | ||
20 | * to be non-zero. If you are using this header from within linux, you may | ||
21 | * include <asm/war.h> before including this file to have this defined | ||
22 | * appropriately for you. | ||
23 | * | ||
24 | * Copyright 2005-2007 PMC-Sierra, Inc. | ||
25 | * | ||
26 | * This program is free software; you can redistribute it and/or modify it | ||
27 | * under the terms of the GNU General Public License as published by the | ||
28 | * Free Software Foundation; either version 2 of the License, or (at your | ||
29 | * option) any later version. | ||
30 | * | ||
31 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
32 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
33 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | ||
34 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
35 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
36 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
37 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
38 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
39 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
40 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
41 | * | ||
42 | * You should have received a copy of the GNU General Public License along | ||
43 | * with this program; if not, write to the Free Software Foundation, Inc., 675 | ||
44 | * Mass Ave, Cambridge, MA 02139, USA. | ||
45 | */ | ||
46 | |||
47 | #ifndef __ASM_REGOPS_H__ | ||
48 | #define __ASM_REGOPS_H__ | ||
49 | |||
50 | #include <linux/types.h> | ||
51 | |||
52 | #include <asm/war.h> | ||
53 | |||
54 | #ifndef R10000_LLSC_WAR | ||
55 | #define R10000_LLSC_WAR 0 | ||
56 | #endif | ||
57 | |||
58 | #if R10000_LLSC_WAR == 1 | ||
59 | #define __beqz "beqzl " | ||
60 | #else | ||
61 | #define __beqz "beqz " | ||
62 | #endif | ||
63 | |||
64 | #ifndef _LINUX_TYPES_H | ||
65 | typedef unsigned int u32; | ||
66 | #endif | ||
67 | |||
68 | /* | ||
69 | * Sets all the masked bits to the corresponding value bits | ||
70 | */ | ||
71 | static inline void set_value_reg32(volatile u32 *const addr, | ||
72 | u32 const mask, | ||
73 | u32 const value) | ||
74 | { | ||
75 | u32 temp; | ||
76 | |||
77 | __asm__ __volatile__( | ||
78 | " .set push \n" | ||
79 | " .set mips3 \n" | ||
80 | "1: ll %0, %1 # set_value_reg32 \n" | ||
81 | " and %0, %2 \n" | ||
82 | " or %0, %3 \n" | ||
83 | " sc %0, %1 \n" | ||
84 | " "__beqz"%0, 1b \n" | ||
85 | " nop \n" | ||
86 | " .set pop \n" | ||
87 | : "=&r" (temp), "=m" (*addr) | ||
88 | : "ir" (~mask), "ir" (value), "m" (*addr)); | ||
89 | } | ||
90 | |||
91 | /* | ||
92 | * Sets all the masked bits to '1' | ||
93 | */ | ||
94 | static inline void set_reg32(volatile u32 *const addr, | ||
95 | u32 const mask) | ||
96 | { | ||
97 | u32 temp; | ||
98 | |||
99 | __asm__ __volatile__( | ||
100 | " .set push \n" | ||
101 | " .set mips3 \n" | ||
102 | "1: ll %0, %1 # set_reg32 \n" | ||
103 | " or %0, %2 \n" | ||
104 | " sc %0, %1 \n" | ||
105 | " "__beqz"%0, 1b \n" | ||
106 | " nop \n" | ||
107 | " .set pop \n" | ||
108 | : "=&r" (temp), "=m" (*addr) | ||
109 | : "ir" (mask), "m" (*addr)); | ||
110 | } | ||
111 | |||
112 | /* | ||
113 | * Sets all the masked bits to '0' | ||
114 | */ | ||
115 | static inline void clear_reg32(volatile u32 *const addr, | ||
116 | u32 const mask) | ||
117 | { | ||
118 | u32 temp; | ||
119 | |||
120 | __asm__ __volatile__( | ||
121 | " .set push \n" | ||
122 | " .set mips3 \n" | ||
123 | "1: ll %0, %1 # clear_reg32 \n" | ||
124 | " and %0, %2 \n" | ||
125 | " sc %0, %1 \n" | ||
126 | " "__beqz"%0, 1b \n" | ||
127 | " nop \n" | ||
128 | " .set pop \n" | ||
129 | : "=&r" (temp), "=m" (*addr) | ||
130 | : "ir" (~mask), "m" (*addr)); | ||
131 | } | ||
132 | |||
133 | /* | ||
134 | * Toggles all masked bits from '0' to '1' and '1' to '0' | ||
135 | */ | ||
136 | static inline void toggle_reg32(volatile u32 *const addr, | ||
137 | u32 const mask) | ||
138 | { | ||
139 | u32 temp; | ||
140 | |||
141 | __asm__ __volatile__( | ||
142 | " .set push \n" | ||
143 | " .set mips3 \n" | ||
144 | "1: ll %0, %1 # toggle_reg32 \n" | ||
145 | " xor %0, %2 \n" | ||
146 | " sc %0, %1 \n" | ||
147 | " "__beqz"%0, 1b \n" | ||
148 | " nop \n" | ||
149 | " .set pop \n" | ||
150 | : "=&r" (temp), "=m" (*addr) | ||
151 | : "ir" (mask), "m" (*addr)); | ||
152 | } | ||
153 | |||
154 | /* | ||
155 | * Read all masked bits others are returned as '0' | ||
156 | */ | ||
157 | static inline u32 read_reg32(volatile u32 *const addr, | ||
158 | u32 const mask) | ||
159 | { | ||
160 | u32 temp; | ||
161 | |||
162 | __asm__ __volatile__( | ||
163 | " .set push \n" | ||
164 | " .set noreorder \n" | ||
165 | " lw %0, %1 # read \n" | ||
166 | " and %0, %2 # mask \n" | ||
167 | " .set pop \n" | ||
168 | : "=&r" (temp) | ||
169 | : "m" (*addr), "ir" (mask)); | ||
170 | |||
171 | return temp; | ||
172 | } | ||
173 | |||
174 | /* | ||
175 | * blocking_read_reg32 - Read address with blocking load | ||
176 | * | ||
177 | * Uncached writes need to be read back to ensure they reach RAM. | ||
178 | * The returned value must be 'used' to prevent from becoming a | ||
179 | * non-blocking load. | ||
180 | */ | ||
181 | static inline u32 blocking_read_reg32(volatile u32 *const addr) | ||
182 | { | ||
183 | u32 temp; | ||
184 | |||
185 | __asm__ __volatile__( | ||
186 | " .set push \n" | ||
187 | " .set noreorder \n" | ||
188 | " lw %0, %1 # read \n" | ||
189 | " move %0, %0 # block \n" | ||
190 | " .set pop \n" | ||
191 | : "=&r" (temp) | ||
192 | : "m" (*addr)); | ||
193 | |||
194 | return temp; | ||
195 | } | ||
196 | |||
197 | /* | ||
198 | * For special strange cases only: | ||
199 | * | ||
200 | * If you need custom processing within a ll/sc loop, use the following macros | ||
201 | * VERY CAREFULLY: | ||
202 | * | ||
203 | * u32 tmp; <-- Define a variable to hold the data | ||
204 | * | ||
205 | * custom_read_reg32(address, tmp); <-- Reads the address and put the value | ||
206 | * in the 'tmp' variable given | ||
207 | * | ||
208 | * From here on out, you are (basicly) atomic, so don't do anything too | ||
209 | * fancy! | ||
210 | * Also, this code may loop if the end of this block fails to write | ||
211 | * everything back safely due do the other CPU, so do NOT do anything | ||
212 | * with side-effects! | ||
213 | * | ||
214 | * custom_write_reg32(address, tmp); <-- Writes back 'tmp' safely. | ||
215 | */ | ||
216 | #define custom_read_reg32(address, tmp) \ | ||
217 | __asm__ __volatile__( \ | ||
218 | " .set push \n" \ | ||
219 | " .set mips3 \n" \ | ||
220 | "1: ll %0, %1 #custom_read_reg32 \n" \ | ||
221 | " .set pop \n" \ | ||
222 | : "=r" (tmp), "=m" (*address) \ | ||
223 | : "m" (*address)) | ||
224 | |||
225 | #define custom_write_reg32(address, tmp) \ | ||
226 | __asm__ __volatile__( \ | ||
227 | " .set push \n" \ | ||
228 | " .set mips3 \n" \ | ||
229 | " sc %0, %1 #custom_write_reg32 \n" \ | ||
230 | " "__beqz"%0, 1b \n" \ | ||
231 | " nop \n" \ | ||
232 | " .set pop \n" \ | ||
233 | : "=&r" (tmp), "=m" (*address) \ | ||
234 | : "0" (tmp), "m" (*address)) | ||
235 | |||
236 | #endif /* __ASM_REGOPS_H__ */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_regs.h b/include/asm-mips/pmc-sierra/msp71xx/msp_regs.h new file mode 100644 index 000000000000..0b56f55206c6 --- /dev/null +++ b/include/asm-mips/pmc-sierra/msp71xx/msp_regs.h | |||
@@ -0,0 +1,667 @@ | |||
1 | /* | ||
2 | * Defines for the address space, registers and register configuration | ||
3 | * (bit masks, access macros etc) for the PMC-Sierra line of MSP products. | ||
4 | * This file contains addess maps for all the devices in the line of | ||
5 | * products but only has register definitions and configuration masks for | ||
6 | * registers which aren't definitely associated with any device. Things | ||
7 | * like clock settings, reset access, the ELB etc. Individual device | ||
8 | * drivers will reference the appropriate XXX_BASE value defined here | ||
9 | * and have individual registers offset from that. | ||
10 | * | ||
11 | * Copyright (C) 2005-2007 PMC-Sierra, Inc. All rights reserved. | ||
12 | * Author: Andrew Hughes, Andrew_Hughes@pmc-sierra.com | ||
13 | * | ||
14 | * ######################################################################## | ||
15 | * | ||
16 | * This program is free software; you can distribute it and/or modify it | ||
17 | * under the terms of the GNU General Public License (Version 2) as | ||
18 | * published by the Free Software Foundation. | ||
19 | * | ||
20 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
21 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
22 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
23 | * for more details. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License along | ||
26 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
27 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
28 | * | ||
29 | * ######################################################################## | ||
30 | */ | ||
31 | |||
32 | #include <asm/addrspace.h> | ||
33 | #include <linux/types.h> | ||
34 | |||
35 | #ifndef _ASM_MSP_REGS_H | ||
36 | #define _ASM_MSP_REGS_H | ||
37 | |||
38 | /* | ||
39 | ######################################################################## | ||
40 | # Address space and device base definitions # | ||
41 | ######################################################################## | ||
42 | */ | ||
43 | |||
44 | /* | ||
45 | *************************************************************************** | ||
46 | * System Logic and Peripherals (ELB, UART0, etc) device address space * | ||
47 | *************************************************************************** | ||
48 | */ | ||
49 | #define MSP_SLP_BASE 0x1c000000 | ||
50 | /* System Logic and Peripherals */ | ||
51 | #define MSP_RST_BASE (MSP_SLP_BASE + 0x10) | ||
52 | /* System reset register base */ | ||
53 | #define MSP_RST_SIZE 0x0C /* System reset register space */ | ||
54 | |||
55 | #define MSP_WTIMER_BASE (MSP_SLP_BASE + 0x04C) | ||
56 | /* watchdog timer base */ | ||
57 | #define MSP_ITIMER_BASE (MSP_SLP_BASE + 0x054) | ||
58 | /* internal timer base */ | ||
59 | #define MSP_UART0_BASE (MSP_SLP_BASE + 0x100) | ||
60 | /* UART0 controller base */ | ||
61 | #define MSP_BCPY_CTRL_BASE (MSP_SLP_BASE + 0x120) | ||
62 | /* Block Copy controller base */ | ||
63 | #define MSP_BCPY_DESC_BASE (MSP_SLP_BASE + 0x160) | ||
64 | /* Block Copy descriptor base */ | ||
65 | |||
66 | /* | ||
67 | *************************************************************************** | ||
68 | * PCI address space * | ||
69 | *************************************************************************** | ||
70 | */ | ||
71 | #define MSP_PCI_BASE 0x19000000 | ||
72 | |||
73 | /* | ||
74 | *************************************************************************** | ||
75 | * MSbus device address space * | ||
76 | *************************************************************************** | ||
77 | */ | ||
78 | #define MSP_MSB_BASE 0x18000000 | ||
79 | /* MSbus address start */ | ||
80 | #define MSP_PER_BASE (MSP_MSB_BASE + 0x400000) | ||
81 | /* Peripheral device registers */ | ||
82 | #define MSP_MAC0_BASE (MSP_MSB_BASE + 0x600000) | ||
83 | /* MAC A device registers */ | ||
84 | #define MSP_MAC1_BASE (MSP_MSB_BASE + 0x700000) | ||
85 | /* MAC B device registers */ | ||
86 | #define MSP_MAC_SIZE 0xE0 /* MAC register space */ | ||
87 | |||
88 | #define MSP_SEC_BASE (MSP_MSB_BASE + 0x800000) | ||
89 | /* Security Engine registers */ | ||
90 | #define MSP_MAC2_BASE (MSP_MSB_BASE + 0x900000) | ||
91 | /* MAC C device registers */ | ||
92 | #define MSP_ADSL2_BASE (MSP_MSB_BASE + 0xA80000) | ||
93 | /* ADSL2 device registers */ | ||
94 | #define MSP_USB_BASE (MSP_MSB_BASE + 0xB40000) | ||
95 | /* USB device registers */ | ||
96 | #define MSP_USB_BASE_START (MSP_MSB_BASE + 0xB40100) | ||
97 | /* USB device registers */ | ||
98 | #define MSP_USB_BASE_END (MSP_MSB_BASE + 0xB401FF) | ||
99 | /* USB device registers */ | ||
100 | #define MSP_CPUIF_BASE (MSP_MSB_BASE + 0xC00000) | ||
101 | /* CPU interface registers */ | ||
102 | |||
103 | /* Devices within the MSbus peripheral block */ | ||
104 | #define MSP_UART1_BASE (MSP_PER_BASE + 0x030) | ||
105 | /* UART1 controller base */ | ||
106 | #define MSP_SPI_BASE (MSP_PER_BASE + 0x058) | ||
107 | /* SPI/MPI control registers */ | ||
108 | #define MSP_TWI_BASE (MSP_PER_BASE + 0x090) | ||
109 | /* Two-wire control registers */ | ||
110 | #define MSP_PTIMER_BASE (MSP_PER_BASE + 0x0F0) | ||
111 | /* Programmable timer control */ | ||
112 | |||
113 | /* | ||
114 | *************************************************************************** | ||
115 | * Physical Memory configuration address space * | ||
116 | *************************************************************************** | ||
117 | */ | ||
118 | #define MSP_MEM_CFG_BASE 0x17f00000 | ||
119 | |||
120 | #define MSP_MEM_INDIRECT_CTL_10 0x10 | ||
121 | |||
122 | /* | ||
123 | * Notes: | ||
124 | * 1) The SPI registers are split into two blocks, one offset from the | ||
125 | * MSP_SPI_BASE by 0x00 and the other offset from the MSP_SPI_BASE by | ||
126 | * 0x68. The SPI driver definitions for the register must be aware | ||
127 | * of this. | ||
128 | * 2) The block copy engine register are divided into two regions, one | ||
129 | * for the control/configuration of the engine proper and one for the | ||
130 | * values of the descriptors used in the copy process. These have | ||
131 | * different base defines (CTRL_BASE vs DESC_BASE) | ||
132 | * 3) These constants are for physical addresses which means that they | ||
133 | * work correctly with "ioremap" and friends. This means that device | ||
134 | * drivers will need to remap these addresses using ioremap and perhaps | ||
135 | * the readw/writew macros. Or they could use the regptr() macro | ||
136 | * defined below, but the readw/writew calls are the correct thing. | ||
137 | * 4) The UARTs have an additional status register offset from the base | ||
138 | * address. This register isn't used in the standard 8250 driver but | ||
139 | * may be used in other software. Consult the hardware datasheet for | ||
140 | * offset details. | ||
141 | * 5) For some unknown reason the security engine (MSP_SEC_BASE) registers | ||
142 | * start at an offset of 0x84 from the base address but the block of | ||
143 | * registers before this is reserved for the security engine. The | ||
144 | * driver will have to be aware of this but it makes the register | ||
145 | * definitions line up better with the documentation. | ||
146 | */ | ||
147 | |||
148 | /* | ||
149 | ######################################################################## | ||
150 | # System register definitions. Not associated with a specific device # | ||
151 | ######################################################################## | ||
152 | */ | ||
153 | |||
154 | /* | ||
155 | * This macro maps the physical register number into uncached space | ||
156 | * and (for C code) casts it into a u32 pointer so it can be dereferenced | ||
157 | * Normally these would be accessed with ioremap and readX/writeX, but | ||
158 | * these are convenient for a lot of internal kernel code. | ||
159 | */ | ||
160 | #ifdef __ASSEMBLER__ | ||
161 | #define regptr(addr) (KSEG1ADDR(addr)) | ||
162 | #else | ||
163 | #define regptr(addr) ((volatile u32 *const)(KSEG1ADDR(addr))) | ||
164 | #endif | ||
165 | |||
166 | /* | ||
167 | *************************************************************************** | ||
168 | * System Logic and Peripherals (RESET, ELB, etc) registers * | ||
169 | *************************************************************************** | ||
170 | */ | ||
171 | |||
172 | /* System Control register definitions */ | ||
173 | #define DEV_ID_REG regptr(MSP_SLP_BASE + 0x00) | ||
174 | /* Device-ID RO */ | ||
175 | #define FWR_ID_REG regptr(MSP_SLP_BASE + 0x04) | ||
176 | /* Firmware-ID Register RW */ | ||
177 | #define SYS_ID_REG0 regptr(MSP_SLP_BASE + 0x08) | ||
178 | /* System-ID Register-0 RW */ | ||
179 | #define SYS_ID_REG1 regptr(MSP_SLP_BASE + 0x0C) | ||
180 | /* System-ID Register-1 RW */ | ||
181 | |||
182 | /* System Reset register definitions */ | ||
183 | #define RST_STS_REG regptr(MSP_SLP_BASE + 0x10) | ||
184 | /* System Reset Status RO */ | ||
185 | #define RST_SET_REG regptr(MSP_SLP_BASE + 0x14) | ||
186 | /* System Set Reset WO */ | ||
187 | #define RST_CLR_REG regptr(MSP_SLP_BASE + 0x18) | ||
188 | /* System Clear Reset WO */ | ||
189 | |||
190 | /* System Clock Registers */ | ||
191 | #define PCI_SLP_REG regptr(MSP_SLP_BASE + 0x1C) | ||
192 | /* PCI clock generator RW */ | ||
193 | #define URT_SLP_REG regptr(MSP_SLP_BASE + 0x20) | ||
194 | /* UART clock generator RW */ | ||
195 | /* reserved (MSP_SLP_BASE + 0x24) */ | ||
196 | /* reserved (MSP_SLP_BASE + 0x28) */ | ||
197 | #define PLL1_SLP_REG regptr(MSP_SLP_BASE + 0x2C) | ||
198 | /* PLL1 clock generator RW */ | ||
199 | #define PLL0_SLP_REG regptr(MSP_SLP_BASE + 0x30) | ||
200 | /* PLL0 clock generator RW */ | ||
201 | #define MIPS_SLP_REG regptr(MSP_SLP_BASE + 0x34) | ||
202 | /* MIPS clock generator RW */ | ||
203 | #define VE_SLP_REG regptr(MSP_SLP_BASE + 0x38) | ||
204 | /* Voice Eng clock generator RW */ | ||
205 | /* reserved (MSP_SLP_BASE + 0x3C) */ | ||
206 | #define MSB_SLP_REG regptr(MSP_SLP_BASE + 0x40) | ||
207 | /* MS-Bus clock generator RW */ | ||
208 | #define SMAC_SLP_REG regptr(MSP_SLP_BASE + 0x44) | ||
209 | /* Sec & MAC clock generator RW */ | ||
210 | #define PERF_SLP_REG regptr(MSP_SLP_BASE + 0x48) | ||
211 | /* Per & TDM clock generator RW */ | ||
212 | |||
213 | /* Interrupt Controller Registers */ | ||
214 | #define SLP_INT_STS_REG regptr(MSP_SLP_BASE + 0x70) | ||
215 | /* Interrupt status register RW */ | ||
216 | #define SLP_INT_MSK_REG regptr(MSP_SLP_BASE + 0x74) | ||
217 | /* Interrupt enable/mask RW */ | ||
218 | #define SE_MBOX_REG regptr(MSP_SLP_BASE + 0x78) | ||
219 | /* Security Engine mailbox RW */ | ||
220 | #define VE_MBOX_REG regptr(MSP_SLP_BASE + 0x7C) | ||
221 | /* Voice Engine mailbox RW */ | ||
222 | |||
223 | /* ELB Controller Registers */ | ||
224 | #define CS0_CNFG_REG regptr(MSP_SLP_BASE + 0x80) | ||
225 | /* ELB CS0 Configuration Reg */ | ||
226 | #define CS0_ADDR_REG regptr(MSP_SLP_BASE + 0x84) | ||
227 | /* ELB CS0 Base Address Reg */ | ||
228 | #define CS0_MASK_REG regptr(MSP_SLP_BASE + 0x88) | ||
229 | /* ELB CS0 Mask Register */ | ||
230 | #define CS0_ACCESS_REG regptr(MSP_SLP_BASE + 0x8C) | ||
231 | /* ELB CS0 access register */ | ||
232 | |||
233 | #define CS1_CNFG_REG regptr(MSP_SLP_BASE + 0x90) | ||
234 | /* ELB CS1 Configuration Reg */ | ||
235 | #define CS1_ADDR_REG regptr(MSP_SLP_BASE + 0x94) | ||
236 | /* ELB CS1 Base Address Reg */ | ||
237 | #define CS1_MASK_REG regptr(MSP_SLP_BASE + 0x98) | ||
238 | /* ELB CS1 Mask Register */ | ||
239 | #define CS1_ACCESS_REG regptr(MSP_SLP_BASE + 0x9C) | ||
240 | /* ELB CS1 access register */ | ||
241 | |||
242 | #define CS2_CNFG_REG regptr(MSP_SLP_BASE + 0xA0) | ||
243 | /* ELB CS2 Configuration Reg */ | ||
244 | #define CS2_ADDR_REG regptr(MSP_SLP_BASE + 0xA4) | ||
245 | /* ELB CS2 Base Address Reg */ | ||
246 | #define CS2_MASK_REG regptr(MSP_SLP_BASE + 0xA8) | ||
247 | /* ELB CS2 Mask Register */ | ||
248 | #define CS2_ACCESS_REG regptr(MSP_SLP_BASE + 0xAC) | ||
249 | /* ELB CS2 access register */ | ||
250 | |||
251 | #define CS3_CNFG_REG regptr(MSP_SLP_BASE + 0xB0) | ||
252 | /* ELB CS3 Configuration Reg */ | ||
253 | #define CS3_ADDR_REG regptr(MSP_SLP_BASE + 0xB4) | ||
254 | /* ELB CS3 Base Address Reg */ | ||
255 | #define CS3_MASK_REG regptr(MSP_SLP_BASE + 0xB8) | ||
256 | /* ELB CS3 Mask Register */ | ||
257 | #define CS3_ACCESS_REG regptr(MSP_SLP_BASE + 0xBC) | ||
258 | /* ELB CS3 access register */ | ||
259 | |||
260 | #define CS4_CNFG_REG regptr(MSP_SLP_BASE + 0xC0) | ||
261 | /* ELB CS4 Configuration Reg */ | ||
262 | #define CS4_ADDR_REG regptr(MSP_SLP_BASE + 0xC4) | ||
263 | /* ELB CS4 Base Address Reg */ | ||
264 | #define CS4_MASK_REG regptr(MSP_SLP_BASE + 0xC8) | ||
265 | /* ELB CS4 Mask Register */ | ||
266 | #define CS4_ACCESS_REG regptr(MSP_SLP_BASE + 0xCC) | ||
267 | /* ELB CS4 access register */ | ||
268 | |||
269 | #define CS5_CNFG_REG regptr(MSP_SLP_BASE + 0xD0) | ||
270 | /* ELB CS5 Configuration Reg */ | ||
271 | #define CS5_ADDR_REG regptr(MSP_SLP_BASE + 0xD4) | ||
272 | /* ELB CS5 Base Address Reg */ | ||
273 | #define CS5_MASK_REG regptr(MSP_SLP_BASE + 0xD8) | ||
274 | /* ELB CS5 Mask Register */ | ||
275 | #define CS5_ACCESS_REG regptr(MSP_SLP_BASE + 0xDC) | ||
276 | /* ELB CS5 access register */ | ||
277 | |||
278 | /* reserved 0xE0 - 0xE8 */ | ||
279 | #define ELB_1PC_EN_REG regptr(MSP_SLP_BASE + 0xEC) | ||
280 | /* ELB single PC card detect */ | ||
281 | |||
282 | /* reserved 0xF0 - 0xF8 */ | ||
283 | #define ELB_CLK_CFG_REG regptr(MSP_SLP_BASE + 0xFC) | ||
284 | /* SDRAM read/ELB timing Reg */ | ||
285 | |||
286 | /* Extended UART status registers */ | ||
287 | #define UART0_STATUS_REG regptr(MSP_UART0_BASE + 0x0c0) | ||
288 | /* UART Status Register 0 */ | ||
289 | #define UART1_STATUS_REG regptr(MSP_UART1_BASE + 0x170) | ||
290 | /* UART Status Register 1 */ | ||
291 | |||
292 | /* Performance monitoring registers */ | ||
293 | #define PERF_MON_CTRL_REG regptr(MSP_SLP_BASE + 0x140) | ||
294 | /* Performance monitor control */ | ||
295 | #define PERF_MON_CLR_REG regptr(MSP_SLP_BASE + 0x144) | ||
296 | /* Performance monitor clear */ | ||
297 | #define PERF_MON_CNTH_REG regptr(MSP_SLP_BASE + 0x148) | ||
298 | /* Perf monitor counter high */ | ||
299 | #define PERF_MON_CNTL_REG regptr(MSP_SLP_BASE + 0x14C) | ||
300 | /* Perf monitor counter low */ | ||
301 | |||
302 | /* System control registers */ | ||
303 | #define SYS_CTRL_REG regptr(MSP_SLP_BASE + 0x150) | ||
304 | /* System control register */ | ||
305 | #define SYS_ERR1_REG regptr(MSP_SLP_BASE + 0x154) | ||
306 | /* System Error status 1 */ | ||
307 | #define SYS_ERR2_REG regptr(MSP_SLP_BASE + 0x158) | ||
308 | /* System Error status 2 */ | ||
309 | #define SYS_INT_CFG_REG regptr(MSP_SLP_BASE + 0x15C) | ||
310 | /* System Interrupt config */ | ||
311 | |||
312 | /* Voice Engine Memory configuration */ | ||
313 | #define VE_MEM_REG regptr(MSP_SLP_BASE + 0x17C) | ||
314 | /* Voice engine memory config */ | ||
315 | |||
316 | /* CPU/SLP Error Status registers */ | ||
317 | #define CPU_ERR1_REG regptr(MSP_SLP_BASE + 0x180) | ||
318 | /* CPU/SLP Error status 1 */ | ||
319 | #define CPU_ERR2_REG regptr(MSP_SLP_BASE + 0x184) | ||
320 | /* CPU/SLP Error status 1 */ | ||
321 | |||
322 | #define EXTENDED_GPIO_REG regptr(MSP_SLP_BASE + 0x188) | ||
323 | /* Extended GPIO register */ | ||
324 | |||
325 | /* System Error registers */ | ||
326 | #define SLP_ERR_STS_REG regptr(MSP_SLP_BASE + 0x190) | ||
327 | /* Int status for SLP errors */ | ||
328 | #define SLP_ERR_MSK_REG regptr(MSP_SLP_BASE + 0x194) | ||
329 | /* Int mask for SLP errors */ | ||
330 | #define SLP_ELB_ERST_REG regptr(MSP_SLP_BASE + 0x198) | ||
331 | /* External ELB reset */ | ||
332 | #define SLP_BOOT_STS_REG regptr(MSP_SLP_BASE + 0x19C) | ||
333 | /* Boot Status */ | ||
334 | |||
335 | /* Extended ELB addressing */ | ||
336 | #define CS0_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A0) | ||
337 | /* CS0 Extended address */ | ||
338 | #define CS1_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A4) | ||
339 | /* CS1 Extended address */ | ||
340 | #define CS2_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A8) | ||
341 | /* CS2 Extended address */ | ||
342 | #define CS3_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1AC) | ||
343 | /* CS3 Extended address */ | ||
344 | /* reserved 0x1B0 */ | ||
345 | #define CS5_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1B4) | ||
346 | /* CS5 Extended address */ | ||
347 | |||
348 | /* PLL Adjustment registers */ | ||
349 | #define PLL_LOCK_REG regptr(MSP_SLP_BASE + 0x200) | ||
350 | /* PLL0 lock status */ | ||
351 | #define PLL_ARST_REG regptr(MSP_SLP_BASE + 0x204) | ||
352 | /* PLL Analog reset status */ | ||
353 | #define PLL0_ADJ_REG regptr(MSP_SLP_BASE + 0x208) | ||
354 | /* PLL0 Adjustment value */ | ||
355 | #define PLL1_ADJ_REG regptr(MSP_SLP_BASE + 0x20C) | ||
356 | /* PLL1 Adjustment value */ | ||
357 | |||
358 | /* | ||
359 | *************************************************************************** | ||
360 | * Peripheral Register definitions * | ||
361 | *************************************************************************** | ||
362 | */ | ||
363 | |||
364 | /* Peripheral status */ | ||
365 | #define PER_CTRL_REG regptr(MSP_PER_BASE + 0x50) | ||
366 | /* Peripheral control register */ | ||
367 | #define PER_STS_REG regptr(MSP_PER_BASE + 0x54) | ||
368 | /* Peripheral status register */ | ||
369 | |||
370 | /* SPI/MPI Registers */ | ||
371 | #define SMPI_TX_SZ_REG regptr(MSP_PER_BASE + 0x58) | ||
372 | /* SPI/MPI Tx Size register */ | ||
373 | #define SMPI_RX_SZ_REG regptr(MSP_PER_BASE + 0x5C) | ||
374 | /* SPI/MPI Rx Size register */ | ||
375 | #define SMPI_CTL_REG regptr(MSP_PER_BASE + 0x60) | ||
376 | /* SPI/MPI Control register */ | ||
377 | #define SMPI_MS_REG regptr(MSP_PER_BASE + 0x64) | ||
378 | /* SPI/MPI Chip Select reg */ | ||
379 | #define SMPI_CORE_DATA_REG regptr(MSP_PER_BASE + 0xC0) | ||
380 | /* SPI/MPI Core Data reg */ | ||
381 | #define SMPI_CORE_CTRL_REG regptr(MSP_PER_BASE + 0xC4) | ||
382 | /* SPI/MPI Core Control reg */ | ||
383 | #define SMPI_CORE_STAT_REG regptr(MSP_PER_BASE + 0xC8) | ||
384 | /* SPI/MPI Core Status reg */ | ||
385 | #define SMPI_CORE_SSEL_REG regptr(MSP_PER_BASE + 0xCC) | ||
386 | /* SPI/MPI Core Ssel reg */ | ||
387 | #define SMPI_FIFO_REG regptr(MSP_PER_BASE + 0xD0) | ||
388 | /* SPI/MPI Data FIFO reg */ | ||
389 | |||
390 | /* Peripheral Block Error Registers */ | ||
391 | #define PER_ERR_STS_REG regptr(MSP_PER_BASE + 0x70) | ||
392 | /* Error Bit Status Register */ | ||
393 | #define PER_ERR_MSK_REG regptr(MSP_PER_BASE + 0x74) | ||
394 | /* Error Bit Mask Register */ | ||
395 | #define PER_HDR1_REG regptr(MSP_PER_BASE + 0x78) | ||
396 | /* Error Header 1 Register */ | ||
397 | #define PER_HDR2_REG regptr(MSP_PER_BASE + 0x7C) | ||
398 | /* Error Header 2 Register */ | ||
399 | |||
400 | /* Peripheral Block Interrupt Registers */ | ||
401 | #define PER_INT_STS_REG regptr(MSP_PER_BASE + 0x80) | ||
402 | /* Interrupt status register */ | ||
403 | #define PER_INT_MSK_REG regptr(MSP_PER_BASE + 0x84) | ||
404 | /* Interrupt Mask Register */ | ||
405 | #define GPIO_INT_STS_REG regptr(MSP_PER_BASE + 0x88) | ||
406 | /* GPIO interrupt status reg */ | ||
407 | #define GPIO_INT_MSK_REG regptr(MSP_PER_BASE + 0x8C) | ||
408 | /* GPIO interrupt MASK Reg */ | ||
409 | |||
410 | /* POLO GPIO registers */ | ||
411 | #define POLO_GPIO_DAT1_REG regptr(MSP_PER_BASE + 0x0E0) | ||
412 | /* Polo GPIO[8:0] data reg */ | ||
413 | #define POLO_GPIO_CFG1_REG regptr(MSP_PER_BASE + 0x0E4) | ||
414 | /* Polo GPIO[7:0] config reg */ | ||
415 | #define POLO_GPIO_CFG2_REG regptr(MSP_PER_BASE + 0x0E8) | ||
416 | /* Polo GPIO[15:8] config reg */ | ||
417 | #define POLO_GPIO_OD1_REG regptr(MSP_PER_BASE + 0x0EC) | ||
418 | /* Polo GPIO[31:0] output drive */ | ||
419 | #define POLO_GPIO_CFG3_REG regptr(MSP_PER_BASE + 0x170) | ||
420 | /* Polo GPIO[23:16] config reg */ | ||
421 | #define POLO_GPIO_DAT2_REG regptr(MSP_PER_BASE + 0x174) | ||
422 | /* Polo GPIO[15:9] data reg */ | ||
423 | #define POLO_GPIO_DAT3_REG regptr(MSP_PER_BASE + 0x178) | ||
424 | /* Polo GPIO[23:16] data reg */ | ||
425 | #define POLO_GPIO_DAT4_REG regptr(MSP_PER_BASE + 0x17C) | ||
426 | /* Polo GPIO[31:24] data reg */ | ||
427 | #define POLO_GPIO_DAT5_REG regptr(MSP_PER_BASE + 0x180) | ||
428 | /* Polo GPIO[39:32] data reg */ | ||
429 | #define POLO_GPIO_DAT6_REG regptr(MSP_PER_BASE + 0x184) | ||
430 | /* Polo GPIO[47:40] data reg */ | ||
431 | #define POLO_GPIO_DAT7_REG regptr(MSP_PER_BASE + 0x188) | ||
432 | /* Polo GPIO[54:48] data reg */ | ||
433 | #define POLO_GPIO_CFG4_REG regptr(MSP_PER_BASE + 0x18C) | ||
434 | /* Polo GPIO[31:24] config reg */ | ||
435 | #define POLO_GPIO_CFG5_REG regptr(MSP_PER_BASE + 0x190) | ||
436 | /* Polo GPIO[39:32] config reg */ | ||
437 | #define POLO_GPIO_CFG6_REG regptr(MSP_PER_BASE + 0x194) | ||
438 | /* Polo GPIO[47:40] config reg */ | ||
439 | #define POLO_GPIO_CFG7_REG regptr(MSP_PER_BASE + 0x198) | ||
440 | /* Polo GPIO[54:48] config reg */ | ||
441 | #define POLO_GPIO_OD2_REG regptr(MSP_PER_BASE + 0x19C) | ||
442 | /* Polo GPIO[54:32] output drive */ | ||
443 | |||
444 | /* Generic GPIO registers */ | ||
445 | #define GPIO_DATA1_REG regptr(MSP_PER_BASE + 0x170) | ||
446 | /* GPIO[1:0] data register */ | ||
447 | #define GPIO_DATA2_REG regptr(MSP_PER_BASE + 0x174) | ||
448 | /* GPIO[5:2] data register */ | ||
449 | #define GPIO_DATA3_REG regptr(MSP_PER_BASE + 0x178) | ||
450 | /* GPIO[9:6] data register */ | ||
451 | #define GPIO_DATA4_REG regptr(MSP_PER_BASE + 0x17C) | ||
452 | /* GPIO[15:10] data register */ | ||
453 | #define GPIO_CFG1_REG regptr(MSP_PER_BASE + 0x180) | ||
454 | /* GPIO[1:0] config register */ | ||
455 | #define GPIO_CFG2_REG regptr(MSP_PER_BASE + 0x184) | ||
456 | /* GPIO[5:2] config register */ | ||
457 | #define GPIO_CFG3_REG regptr(MSP_PER_BASE + 0x188) | ||
458 | /* GPIO[9:6] config register */ | ||
459 | #define GPIO_CFG4_REG regptr(MSP_PER_BASE + 0x18C) | ||
460 | /* GPIO[15:10] config register */ | ||
461 | #define GPIO_OD_REG regptr(MSP_PER_BASE + 0x190) | ||
462 | /* GPIO[15:0] output drive */ | ||
463 | |||
464 | /* | ||
465 | *************************************************************************** | ||
466 | * CPU Interface register definitions * | ||
467 | *************************************************************************** | ||
468 | */ | ||
469 | #define PCI_FLUSH_REG regptr(MSP_CPUIF_BASE + 0x00) | ||
470 | /* PCI-SDRAM queue flush trigger */ | ||
471 | #define OCP_ERR1_REG regptr(MSP_CPUIF_BASE + 0x04) | ||
472 | /* OCP Error Attribute 1 */ | ||
473 | #define OCP_ERR2_REG regptr(MSP_CPUIF_BASE + 0x08) | ||
474 | /* OCP Error Attribute 2 */ | ||
475 | #define OCP_STS_REG regptr(MSP_CPUIF_BASE + 0x0C) | ||
476 | /* OCP Error Status */ | ||
477 | #define CPUIF_PM_REG regptr(MSP_CPUIF_BASE + 0x10) | ||
478 | /* CPU policy configuration */ | ||
479 | #define CPUIF_CFG_REG regptr(MSP_CPUIF_BASE + 0x10) | ||
480 | /* Misc configuration options */ | ||
481 | |||
482 | /* Central Interrupt Controller Registers */ | ||
483 | #define MSP_CIC_BASE (MSP_CPUIF_BASE + 0x8000) | ||
484 | /* Central Interrupt registers */ | ||
485 | #define CIC_EXT_CFG_REG regptr(MSP_CIC_BASE + 0x00) | ||
486 | /* External interrupt config */ | ||
487 | #define CIC_STS_REG regptr(MSP_CIC_BASE + 0x04) | ||
488 | /* CIC Interrupt Status */ | ||
489 | #define CIC_VPE0_MSK_REG regptr(MSP_CIC_BASE + 0x08) | ||
490 | /* VPE0 Interrupt Mask */ | ||
491 | #define CIC_VPE1_MSK_REG regptr(MSP_CIC_BASE + 0x0C) | ||
492 | /* VPE1 Interrupt Mask */ | ||
493 | #define CIC_TC0_MSK_REG regptr(MSP_CIC_BASE + 0x10) | ||
494 | /* Thread Context 0 Int Mask */ | ||
495 | #define CIC_TC1_MSK_REG regptr(MSP_CIC_BASE + 0x14) | ||
496 | /* Thread Context 1 Int Mask */ | ||
497 | #define CIC_TC2_MSK_REG regptr(MSP_CIC_BASE + 0x18) | ||
498 | /* Thread Context 2 Int Mask */ | ||
499 | #define CIC_TC3_MSK_REG regptr(MSP_CIC_BASE + 0x18) | ||
500 | /* Thread Context 3 Int Mask */ | ||
501 | #define CIC_TC4_MSK_REG regptr(MSP_CIC_BASE + 0x18) | ||
502 | /* Thread Context 4 Int Mask */ | ||
503 | #define CIC_PCIMSI_STS_REG regptr(MSP_CIC_BASE + 0x18) | ||
504 | #define CIC_PCIMSI_MSK_REG regptr(MSP_CIC_BASE + 0x18) | ||
505 | #define CIC_PCIFLSH_REG regptr(MSP_CIC_BASE + 0x18) | ||
506 | #define CIC_VPE0_SWINT_REG regptr(MSP_CIC_BASE + 0x08) | ||
507 | |||
508 | |||
509 | /* | ||
510 | *************************************************************************** | ||
511 | * Memory controller registers * | ||
512 | *************************************************************************** | ||
513 | */ | ||
514 | #define MEM_CFG1_REG regptr(MSP_MEM_CFG_BASE + 0x00) | ||
515 | #define MEM_SS_ADDR regptr(MSP_MEM_CFG_BASE + 0x00) | ||
516 | #define MEM_SS_DATA regptr(MSP_MEM_CFG_BASE + 0x04) | ||
517 | #define MEM_SS_WRITE regptr(MSP_MEM_CFG_BASE + 0x08) | ||
518 | |||
519 | /* | ||
520 | *************************************************************************** | ||
521 | * PCI controller registers * | ||
522 | *************************************************************************** | ||
523 | */ | ||
524 | #define PCI_BASE_REG regptr(MSP_PCI_BASE + 0x00) | ||
525 | #define PCI_CONFIG_SPACE_REG regptr(MSP_PCI_BASE + 0x800) | ||
526 | #define PCI_JTAG_DEVID_REG regptr(MSP_SLP_BASE + 0x13c) | ||
527 | |||
528 | /* | ||
529 | ######################################################################## | ||
530 | # Register content & macro definitions # | ||
531 | ######################################################################## | ||
532 | */ | ||
533 | |||
534 | /* | ||
535 | *************************************************************************** | ||
536 | * DEV_ID defines * | ||
537 | *************************************************************************** | ||
538 | */ | ||
539 | #define DEV_ID_PCI_DIS (1 << 26) /* Set if PCI disabled */ | ||
540 | #define DEV_ID_PCI_HOST (1 << 20) /* Set if PCI host */ | ||
541 | #define DEV_ID_SINGLE_PC (1 << 19) /* Set if single PC Card */ | ||
542 | #define DEV_ID_FAMILY (0xff << 8) /* family ID code */ | ||
543 | #define POLO_ZEUS_SUB_FAMILY (0x7 << 16) /* sub family for Polo/Zeus */ | ||
544 | |||
545 | #define MSPFPGA_ID (0x00 << 8) /* you are on your own here */ | ||
546 | #define MSP5000_ID (0x50 << 8) | ||
547 | #define MSP4F00_ID (0x4f << 8) /* FPGA version of MSP4200 */ | ||
548 | #define MSP4E00_ID (0x4f << 8) /* FPGA version of MSP7120 */ | ||
549 | #define MSP4200_ID (0x42 << 8) | ||
550 | #define MSP4000_ID (0x40 << 8) | ||
551 | #define MSP2XXX_ID (0x20 << 8) | ||
552 | #define MSPZEUS_ID (0x10 << 8) | ||
553 | |||
554 | #define MSP2004_SUB_ID (0x0 << 16) | ||
555 | #define MSP2005_SUB_ID (0x1 << 16) | ||
556 | #define MSP2006_SUB_ID (0x1 << 16) | ||
557 | #define MSP2007_SUB_ID (0x2 << 16) | ||
558 | #define MSP2010_SUB_ID (0x3 << 16) | ||
559 | #define MSP2015_SUB_ID (0x4 << 16) | ||
560 | #define MSP2020_SUB_ID (0x5 << 16) | ||
561 | #define MSP2100_SUB_ID (0x6 << 16) | ||
562 | |||
563 | /* | ||
564 | *************************************************************************** | ||
565 | * RESET defines * | ||
566 | *************************************************************************** | ||
567 | */ | ||
568 | #define MSP_GR_RST (0x01 << 0) /* Global reset bit */ | ||
569 | #define MSP_MR_RST (0x01 << 1) /* MIPS reset bit */ | ||
570 | #define MSP_PD_RST (0x01 << 2) /* PVC DMA reset bit */ | ||
571 | #define MSP_PP_RST (0x01 << 3) /* PVC reset bit */ | ||
572 | /* reserved */ | ||
573 | #define MSP_EA_RST (0x01 << 6) /* Mac A reset bit */ | ||
574 | #define MSP_EB_RST (0x01 << 7) /* Mac B reset bit */ | ||
575 | #define MSP_SE_RST (0x01 << 8) /* Security Eng reset bit */ | ||
576 | #define MSP_PB_RST (0x01 << 9) /* Per block reset bit */ | ||
577 | #define MSP_EC_RST (0x01 << 10) /* Mac C reset bit */ | ||
578 | #define MSP_TW_RST (0x01 << 11) /* TWI reset bit */ | ||
579 | #define MSP_SPI_RST (0x01 << 12) /* SPI/MPI reset bit */ | ||
580 | #define MSP_U1_RST (0x01 << 13) /* UART1 reset bit */ | ||
581 | #define MSP_U0_RST (0x01 << 14) /* UART0 reset bit */ | ||
582 | |||
583 | /* | ||
584 | *************************************************************************** | ||
585 | * UART defines * | ||
586 | *************************************************************************** | ||
587 | */ | ||
588 | #ifndef CONFIG_MSP_FPGA | ||
589 | #define MSP_BASE_BAUD 25000000 | ||
590 | #else | ||
591 | #define MSP_BASE_BAUD 6000000 | ||
592 | #endif | ||
593 | #define MSP_UART_REG_LEN 0x20 | ||
594 | |||
595 | /* | ||
596 | *************************************************************************** | ||
597 | * ELB defines * | ||
598 | *************************************************************************** | ||
599 | */ | ||
600 | #define PCCARD_32 0x02 /* Set if is PCCARD 32 (Cardbus) */ | ||
601 | #define SINGLE_PCCARD 0x01 /* Set to enable single PC card */ | ||
602 | |||
603 | /* | ||
604 | *************************************************************************** | ||
605 | * CIC defines * | ||
606 | *************************************************************************** | ||
607 | */ | ||
608 | |||
609 | /* CIC_EXT_CFG_REG */ | ||
610 | #define EXT_INT_POL(eirq) (1 << (eirq + 8)) | ||
611 | #define EXT_INT_EDGE(eirq) (1 << eirq) | ||
612 | |||
613 | #define CIC_EXT_SET_TRIGGER_LEVEL(reg, eirq) (reg &= ~EXT_INT_EDGE(eirq)) | ||
614 | #define CIC_EXT_SET_TRIGGER_EDGE(reg, eirq) (reg |= EXT_INT_EDGE(eirq)) | ||
615 | #define CIC_EXT_SET_ACTIVE_HI(reg, eirq) (reg |= EXT_INT_POL(eirq)) | ||
616 | #define CIC_EXT_SET_ACTIVE_LO(reg, eirq) (reg &= ~EXT_INT_POL(eirq)) | ||
617 | #define CIC_EXT_SET_ACTIVE_RISING CIC_EXT_SET_ACTIVE_HI | ||
618 | #define CIC_EXT_SET_ACTIVE_FALLING CIC_EXT_SET_ACTIVE_LO | ||
619 | |||
620 | #define CIC_EXT_IS_TRIGGER_LEVEL(reg, eirq) \ | ||
621 | ((reg & EXT_INT_EDGE(eirq)) == 0) | ||
622 | #define CIC_EXT_IS_TRIGGER_EDGE(reg, eirq) (reg & EXT_INT_EDGE(eirq)) | ||
623 | #define CIC_EXT_IS_ACTIVE_HI(reg, eirq) (reg & EXT_INT_POL(eirq)) | ||
624 | #define CIC_EXT_IS_ACTIVE_LO(reg, eirq) \ | ||
625 | ((reg & EXT_INT_POL(eirq)) == 0) | ||
626 | #define CIC_EXT_IS_ACTIVE_RISING CIC_EXT_IS_ACTIVE_HI | ||
627 | #define CIC_EXT_IS_ACTIVE_FALLING CIC_EXT_IS_ACTIVE_LO | ||
628 | |||
629 | /* | ||
630 | *************************************************************************** | ||
631 | * Memory Controller defines * | ||
632 | *************************************************************************** | ||
633 | */ | ||
634 | |||
635 | /* Indirect memory controller registers */ | ||
636 | #define DDRC_CFG(n) (n) | ||
637 | #define DDRC_DEBUG(n) (0x04 + n) | ||
638 | #define DDRC_CTL(n) (0x40 + n) | ||
639 | |||
640 | /* Macro to perform DDRC indirect write */ | ||
641 | #define DDRC_INDIRECT_WRITE(reg, mask, value) \ | ||
642 | ({ \ | ||
643 | *MEM_SS_ADDR = (((mask) & 0xf) << 8) | ((reg) & 0xff); \ | ||
644 | *MEM_SS_DATA = (value); \ | ||
645 | *MEM_SS_WRITE = 1; \ | ||
646 | }) | ||
647 | |||
648 | /* | ||
649 | *************************************************************************** | ||
650 | * SPI/MPI Mode * | ||
651 | *************************************************************************** | ||
652 | */ | ||
653 | #define SPI_MPI_RX_BUSY 0x00008000 /* SPI/MPI Receive Busy */ | ||
654 | #define SPI_MPI_FIFO_EMPTY 0x00004000 /* SPI/MPI Fifo Empty */ | ||
655 | #define SPI_MPI_TX_BUSY 0x00002000 /* SPI/MPI Transmit Busy */ | ||
656 | #define SPI_MPI_FIFO_FULL 0x00001000 /* SPI/MPU FIFO full */ | ||
657 | |||
658 | /* | ||
659 | *************************************************************************** | ||
660 | * SPI/MPI Control Register * | ||
661 | *************************************************************************** | ||
662 | */ | ||
663 | #define SPI_MPI_RX_START 0x00000004 /* Start receive command */ | ||
664 | #define SPI_MPI_FLUSH_Q 0x00000002 /* Flush SPI/MPI Queue */ | ||
665 | #define SPI_MPI_TX_START 0x00000001 /* Start Transmit Command */ | ||
666 | |||
667 | #endif /* !_ASM_MSP_REGS_H */ | ||
diff --git a/include/asm-mips/pmc-sierra/msp71xx/msp_slp_int.h b/include/asm-mips/pmc-sierra/msp71xx/msp_slp_int.h new file mode 100644 index 000000000000..96d4c8ce8c83 --- /dev/null +++ b/include/asm-mips/pmc-sierra/msp71xx/msp_slp_int.h | |||
@@ -0,0 +1,141 @@ | |||
1 | /* | ||
2 | * Defines for the MSP interrupt controller. | ||
3 | * | ||
4 | * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved. | ||
5 | * Author: Carsten Langgaard, carstenl@mips.com | ||
6 | * | ||
7 | * ######################################################################## | ||
8 | * | ||
9 | * This program is free software; you can distribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License (Version 2) as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
16 | * for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
21 | * | ||
22 | * ######################################################################## | ||
23 | */ | ||
24 | |||
25 | #ifndef _MSP_SLP_INT_H | ||
26 | #define _MSP_SLP_INT_H | ||
27 | |||
28 | /* | ||
29 | * The PMC-Sierra SLP interrupts are arranged in a 3 level cascaded | ||
30 | * hierarchical system. The first level are the direct MIPS interrupts | ||
31 | * and are assigned the interrupt range 0-7. The second level is the SLM | ||
32 | * interrupt controller and is assigned the range 8-39. The third level | ||
33 | * comprises the Peripherial block, the PCI block, the PCI MSI block and | ||
34 | * the SLP. The PCI interrupts and the SLP errors are handled by the | ||
35 | * relevant subsystems so the core interrupt code needs only concern | ||
36 | * itself with the Peripheral block. These are assigned interrupts in | ||
37 | * the range 40-71. | ||
38 | */ | ||
39 | |||
40 | /* | ||
41 | * IRQs directly connected to CPU | ||
42 | */ | ||
43 | #define MSP_MIPS_INTBASE 0 | ||
44 | #define MSP_INT_SW0 0 /* IRQ for swint0, C_SW0 */ | ||
45 | #define MSP_INT_SW1 1 /* IRQ for swint1, C_SW1 */ | ||
46 | #define MSP_INT_MAC0 2 /* IRQ for MAC 0, C_IRQ0 */ | ||
47 | #define MSP_INT_MAC1 3 /* IRQ for MAC 1, C_IRQ1 */ | ||
48 | #define MSP_INT_C_IRQ2 4 /* Wired off, C_IRQ2 */ | ||
49 | #define MSP_INT_VE 5 /* IRQ for Voice Engine, C_IRQ3 */ | ||
50 | #define MSP_INT_SLP 6 /* IRQ for SLM block, C_IRQ4 */ | ||
51 | #define MSP_INT_TIMER 7 /* IRQ for the MIPS timer, C_IRQ5 */ | ||
52 | |||
53 | /* | ||
54 | * IRQs cascaded on CPU interrupt 4 (CAUSE bit 12, C_IRQ4) | ||
55 | * These defines should be tied to the register definition for the SLM | ||
56 | * interrupt routine. For now, just use hard-coded values. | ||
57 | */ | ||
58 | #define MSP_SLP_INTBASE (MSP_MIPS_INTBASE + 8) | ||
59 | #define MSP_INT_EXT0 (MSP_SLP_INTBASE + 0) | ||
60 | /* External interrupt 0 */ | ||
61 | #define MSP_INT_EXT1 (MSP_SLP_INTBASE + 1) | ||
62 | /* External interrupt 1 */ | ||
63 | #define MSP_INT_EXT2 (MSP_SLP_INTBASE + 2) | ||
64 | /* External interrupt 2 */ | ||
65 | #define MSP_INT_EXT3 (MSP_SLP_INTBASE + 3) | ||
66 | /* External interrupt 3 */ | ||
67 | /* Reserved 4-7 */ | ||
68 | |||
69 | /* | ||
70 | ************************************************************************* | ||
71 | * DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER/DANGER * | ||
72 | * Some MSP produces have this interrupt labelled as Voice and some are * | ||
73 | * SEC mbox ... * | ||
74 | ************************************************************************* | ||
75 | */ | ||
76 | #define MSP_INT_SLP_VE (MSP_SLP_INTBASE + 8) | ||
77 | /* Cascaded IRQ for Voice Engine*/ | ||
78 | #define MSP_INT_SLP_TDM (MSP_SLP_INTBASE + 9) | ||
79 | /* TDM interrupt */ | ||
80 | #define MSP_INT_SLP_MAC0 (MSP_SLP_INTBASE + 10) | ||
81 | /* Cascaded IRQ for MAC 0 */ | ||
82 | #define MSP_INT_SLP_MAC1 (MSP_SLP_INTBASE + 11) | ||
83 | /* Cascaded IRQ for MAC 1 */ | ||
84 | #define MSP_INT_SEC (MSP_SLP_INTBASE + 12) | ||
85 | /* IRQ for security engine */ | ||
86 | #define MSP_INT_PER (MSP_SLP_INTBASE + 13) | ||
87 | /* Peripheral interrupt */ | ||
88 | #define MSP_INT_TIMER0 (MSP_SLP_INTBASE + 14) | ||
89 | /* SLP timer 0 */ | ||
90 | #define MSP_INT_TIMER1 (MSP_SLP_INTBASE + 15) | ||
91 | /* SLP timer 1 */ | ||
92 | #define MSP_INT_TIMER2 (MSP_SLP_INTBASE + 16) | ||
93 | /* SLP timer 2 */ | ||
94 | #define MSP_INT_SLP_TIMER (MSP_SLP_INTBASE + 17) | ||
95 | /* Cascaded MIPS timer */ | ||
96 | #define MSP_INT_BLKCP (MSP_SLP_INTBASE + 18) | ||
97 | /* Block Copy */ | ||
98 | #define MSP_INT_UART0 (MSP_SLP_INTBASE + 19) | ||
99 | /* UART 0 */ | ||
100 | #define MSP_INT_PCI (MSP_SLP_INTBASE + 20) | ||
101 | /* PCI subsystem */ | ||
102 | #define MSP_INT_PCI_DBELL (MSP_SLP_INTBASE + 21) | ||
103 | /* PCI doorbell */ | ||
104 | #define MSP_INT_PCI_MSI (MSP_SLP_INTBASE + 22) | ||
105 | /* PCI Message Signal */ | ||
106 | #define MSP_INT_PCI_BC0 (MSP_SLP_INTBASE + 23) | ||
107 | /* PCI Block Copy 0 */ | ||
108 | #define MSP_INT_PCI_BC1 (MSP_SLP_INTBASE + 24) | ||
109 | /* PCI Block Copy 1 */ | ||
110 | #define MSP_INT_SLP_ERR (MSP_SLP_INTBASE + 25) | ||
111 | /* SLP error condition */ | ||
112 | #define MSP_INT_MAC2 (MSP_SLP_INTBASE + 26) | ||
113 | /* IRQ for MAC2 */ | ||
114 | /* Reserved 26-31 */ | ||
115 | |||
116 | /* | ||
117 | * IRQs cascaded on SLP PER interrupt (MSP_INT_PER) | ||
118 | */ | ||
119 | #define MSP_PER_INTBASE (MSP_SLP_INTBASE + 32) | ||
120 | /* Reserved 0-1 */ | ||
121 | #define MSP_INT_UART1 (MSP_PER_INTBASE + 2) | ||
122 | /* UART 1 */ | ||
123 | /* Reserved 3-5 */ | ||
124 | #define MSP_INT_2WIRE (MSP_PER_INTBASE + 6) | ||
125 | /* 2-wire */ | ||
126 | #define MSP_INT_TM0 (MSP_PER_INTBASE + 7) | ||
127 | /* Peripheral timer block out 0 */ | ||
128 | #define MSP_INT_TM1 (MSP_PER_INTBASE + 8) | ||
129 | /* Peripheral timer block out 1 */ | ||
130 | /* Reserved 9 */ | ||
131 | #define MSP_INT_SPRX (MSP_PER_INTBASE + 10) | ||
132 | /* SPI RX complete */ | ||
133 | #define MSP_INT_SPTX (MSP_PER_INTBASE + 11) | ||
134 | /* SPI TX complete */ | ||
135 | #define MSP_INT_GPIO (MSP_PER_INTBASE + 12) | ||
136 | /* GPIO */ | ||
137 | #define MSP_INT_PER_ERR (MSP_PER_INTBASE + 13) | ||
138 | /* Peripheral error */ | ||
139 | /* Reserved 14-31 */ | ||
140 | |||
141 | #endif /* !_MSP_SLP_INT_H */ | ||
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index 5f80ba71ab92..1d8b9a8ae324 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h | |||
@@ -82,10 +82,6 @@ struct mips_fpu_struct { | |||
82 | unsigned int fcr31; | 82 | unsigned int fcr31; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | #define INIT_FPU { \ | ||
86 | {0,} \ | ||
87 | } | ||
88 | |||
89 | #define NUM_DSP_REGS 6 | 85 | #define NUM_DSP_REGS 6 |
90 | 86 | ||
91 | typedef __u32 dspreg_t; | 87 | typedef __u32 dspreg_t; |
@@ -95,8 +91,6 @@ struct mips_dsp_state { | |||
95 | unsigned int dspcontrol; | 91 | unsigned int dspcontrol; |
96 | }; | 92 | }; |
97 | 93 | ||
98 | #define INIT_DSP {{0,},} | ||
99 | |||
100 | #define INIT_CPUMASK { \ | 94 | #define INIT_CPUMASK { \ |
101 | {0,} \ | 95 | {0,} \ |
102 | } | 96 | } |
@@ -155,41 +149,63 @@ struct thread_struct { | |||
155 | #define MF_N64 0 | 149 | #define MF_N64 0 |
156 | 150 | ||
157 | #ifdef CONFIG_MIPS_MT_FPAFF | 151 | #ifdef CONFIG_MIPS_MT_FPAFF |
158 | #define FPAFF_INIT 0, INIT_CPUMASK, | 152 | #define FPAFF_INIT \ |
153 | .emulated_fp = 0, \ | ||
154 | .user_cpus_allowed = INIT_CPUMASK, | ||
159 | #else | 155 | #else |
160 | #define FPAFF_INIT | 156 | #define FPAFF_INIT |
161 | #endif /* CONFIG_MIPS_MT_FPAFF */ | 157 | #endif /* CONFIG_MIPS_MT_FPAFF */ |
162 | 158 | ||
163 | #define INIT_THREAD { \ | 159 | #define INIT_THREAD { \ |
164 | /* \ | 160 | /* \ |
165 | * saved main processor registers \ | 161 | * Saved main processor registers \ |
166 | */ \ | 162 | */ \ |
167 | 0, 0, 0, 0, 0, 0, 0, 0, \ | 163 | .reg16 = 0, \ |
168 | 0, 0, 0, \ | 164 | .reg17 = 0, \ |
169 | /* \ | 165 | .reg18 = 0, \ |
170 | * saved cp0 stuff \ | 166 | .reg19 = 0, \ |
171 | */ \ | 167 | .reg20 = 0, \ |
172 | 0, \ | 168 | .reg21 = 0, \ |
173 | /* \ | 169 | .reg22 = 0, \ |
174 | * saved fpu/fpu emulator stuff \ | 170 | .reg23 = 0, \ |
175 | */ \ | 171 | .reg29 = 0, \ |
176 | INIT_FPU, \ | 172 | .reg30 = 0, \ |
177 | /* \ | 173 | .reg31 = 0, \ |
178 | * fpu affinity state (null if not FPAFF) \ | 174 | /* \ |
179 | */ \ | 175 | * Saved cp0 stuff \ |
180 | FPAFF_INIT \ | 176 | */ \ |
181 | /* \ | 177 | .cp0_status = 0, \ |
182 | * saved dsp/dsp emulator stuff \ | 178 | /* \ |
183 | */ \ | 179 | * Saved FPU/FPU emulator stuff \ |
184 | INIT_DSP, \ | 180 | */ \ |
185 | /* \ | 181 | .fpu = { \ |
186 | * Other stuff associated with the process \ | 182 | .fpr = {0,}, \ |
187 | */ \ | 183 | .fcr31 = 0, \ |
188 | 0, 0, 0, 0, \ | 184 | }, \ |
189 | /* \ | 185 | /* \ |
190 | * For now the default is to fix address errors \ | 186 | * FPU affinity state (null if not FPAFF) \ |
191 | */ \ | 187 | */ \ |
192 | MF_FIXADE, 0, 0 \ | 188 | FPAFF_INIT \ |
189 | /* \ | ||
190 | * Saved DSP stuff \ | ||
191 | */ \ | ||
192 | .dsp = { \ | ||
193 | .dspr = {0, }, \ | ||
194 | .dspcontrol = 0, \ | ||
195 | }, \ | ||
196 | /* \ | ||
197 | * Other stuff associated with the process \ | ||
198 | */ \ | ||
199 | .cp0_badvaddr = 0, \ | ||
200 | .cp0_baduaddr = 0, \ | ||
201 | .error_code = 0, \ | ||
202 | .trap_no = 0, \ | ||
203 | /* \ | ||
204 | * For now the default is to fix address errors \ | ||
205 | */ \ | ||
206 | .mflags = MF_FIXADE, \ | ||
207 | .irix_trampoline = 0, \ | ||
208 | .irix_oldctx = 0, \ | ||
193 | } | 209 | } |
194 | 210 | ||
195 | struct task_struct; | 211 | struct task_struct; |
@@ -237,7 +253,7 @@ unsigned long get_wchan(struct task_struct *p); | |||
237 | 253 | ||
238 | #define ARCH_HAS_PREFETCH | 254 | #define ARCH_HAS_PREFETCH |
239 | 255 | ||
240 | extern inline void prefetch(const void *addr) | 256 | static inline void prefetch(const void *addr) |
241 | { | 257 | { |
242 | __asm__ __volatile__( | 258 | __asm__ __volatile__( |
243 | " .set mips4 \n" | 259 | " .set mips4 \n" |
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h index ce51213d84f9..c07ebd8eb9e7 100644 --- a/include/asm-mips/serial.h +++ b/include/asm-mips/serial.h | |||
@@ -19,159 +19,4 @@ | |||
19 | */ | 19 | */ |
20 | #define BASE_BAUD (1843200 / 16) | 20 | #define BASE_BAUD (1843200 / 16) |
21 | 21 | ||
22 | /* Standard COM flags (except for COM4, because of the 8514 problem) */ | ||
23 | #ifdef CONFIG_SERIAL_DETECT_IRQ | ||
24 | #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ) | ||
25 | #define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ) | ||
26 | #else | ||
27 | #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) | ||
28 | #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF | ||
29 | #endif | ||
30 | |||
31 | #ifdef CONFIG_MACH_JAZZ | ||
32 | #include <asm/jazz.h> | ||
33 | |||
34 | #ifndef CONFIG_OLIVETTI_M700 | ||
35 | /* Some Jazz machines seem to have an 8MHz crystal clock but I don't know | ||
36 | exactly which ones ... XXX */ | ||
37 | #define JAZZ_BASE_BAUD ( 8000000 / 16 ) /* ( 3072000 / 16) */ | ||
38 | #else | ||
39 | /* but the M700 isn't such a strange beast */ | ||
40 | #define JAZZ_BASE_BAUD BASE_BAUD | ||
41 | #endif | ||
42 | |||
43 | #define _JAZZ_SERIAL_INIT(int, base) \ | ||
44 | { .baud_base = JAZZ_BASE_BAUD, .irq = int, .flags = STD_COM_FLAGS, \ | ||
45 | .iomem_base = (u8 *) base, .iomem_reg_shift = 0, \ | ||
46 | .io_type = SERIAL_IO_MEM } | ||
47 | #define JAZZ_SERIAL_PORT_DEFNS \ | ||
48 | _JAZZ_SERIAL_INIT(JAZZ_SERIAL1_IRQ, JAZZ_SERIAL1_BASE), \ | ||
49 | _JAZZ_SERIAL_INIT(JAZZ_SERIAL2_IRQ, JAZZ_SERIAL2_BASE), | ||
50 | #else | ||
51 | #define JAZZ_SERIAL_PORT_DEFNS | ||
52 | #endif | ||
53 | |||
54 | /* | ||
55 | * Galileo EV64120 evaluation board | ||
56 | */ | ||
57 | #ifdef CONFIG_MIPS_EV64120 | ||
58 | #include <mach-gt64120.h> | ||
59 | #define EV64120_SERIAL_PORT_DEFNS \ | ||
60 | { .baud_base = EV64120_BASE_BAUD, .irq = EV64120_UART_IRQ, \ | ||
61 | .flags = STD_COM_FLAGS, \ | ||
62 | .iomem_base = EV64120_UART0_REGS_BASE, .iomem_reg_shift = 2, \ | ||
63 | .io_type = SERIAL_IO_MEM }, \ | ||
64 | { .baud_base = EV64120_BASE_BAUD, .irq = EV64120_UART_IRQ, \ | ||
65 | .flags = STD_COM_FLAGS, \ | ||
66 | .iomem_base = EV64120_UART1_REGS_BASE, .iomem_reg_shift = 2, \ | ||
67 | .io_type = SERIAL_IO_MEM }, | ||
68 | #else | ||
69 | #define EV64120_SERIAL_PORT_DEFNS | ||
70 | #endif | ||
71 | |||
72 | #ifdef CONFIG_HAVE_STD_PC_SERIAL_PORT | ||
73 | #define STD_SERIAL_PORT_DEFNS \ | ||
74 | /* UART CLK PORT IRQ FLAGS */ \ | ||
75 | { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ | ||
76 | { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ | ||
77 | { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ | ||
78 | { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ | ||
79 | |||
80 | #else /* CONFIG_HAVE_STD_PC_SERIAL_PORTS */ | ||
81 | #define STD_SERIAL_PORT_DEFNS | ||
82 | #endif /* CONFIG_HAVE_STD_PC_SERIAL_PORTS */ | ||
83 | |||
84 | #ifdef CONFIG_MOMENCO_OCELOT_3 | ||
85 | #define OCELOT_3_BASE_BAUD ( 20000000 / 16 ) | ||
86 | #define OCELOT_3_SERIAL_IRQ 6 | ||
87 | #define OCELOT_3_SERIAL_BASE (signed)0xfd000020 | ||
88 | |||
89 | #define _OCELOT_3_SERIAL_INIT(int, base) \ | ||
90 | { .baud_base = OCELOT_3_BASE_BAUD, irq: int, \ | ||
91 | .flags = STD_COM_FLAGS, \ | ||
92 | .iomem_base = (u8 *) base, iomem_reg_shift: 2, \ | ||
93 | io_type: SERIAL_IO_MEM } | ||
94 | |||
95 | #define MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS \ | ||
96 | _OCELOT_3_SERIAL_INIT(OCELOT_3_SERIAL_IRQ, OCELOT_3_SERIAL_BASE) | ||
97 | #else | ||
98 | #define MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS | ||
99 | #endif | ||
100 | |||
101 | #ifdef CONFIG_MOMENCO_OCELOT | ||
102 | /* Ordinary NS16552 duart with a 20MHz crystal. */ | ||
103 | #define OCELOT_BASE_BAUD ( 20000000 / 16 ) | ||
104 | |||
105 | #define OCELOT_SERIAL1_IRQ 4 | ||
106 | #define OCELOT_SERIAL1_BASE 0xe0001020 | ||
107 | |||
108 | #define _OCELOT_SERIAL_INIT(int, base) \ | ||
109 | { .baud_base = OCELOT_BASE_BAUD, .irq = int, .flags = STD_COM_FLAGS, \ | ||
110 | .iomem_base = (u8 *) base, .iomem_reg_shift = 2, \ | ||
111 | .io_type = SERIAL_IO_MEM } | ||
112 | #define MOMENCO_OCELOT_SERIAL_PORT_DEFNS \ | ||
113 | _OCELOT_SERIAL_INIT(OCELOT_SERIAL1_IRQ, OCELOT_SERIAL1_BASE) | ||
114 | #else | ||
115 | #define MOMENCO_OCELOT_SERIAL_PORT_DEFNS | ||
116 | #endif | ||
117 | |||
118 | #ifdef CONFIG_MOMENCO_OCELOT_C | ||
119 | /* Ordinary NS16552 duart with a 20MHz crystal. */ | ||
120 | #define OCELOT_C_BASE_BAUD ( 20000000 / 16 ) | ||
121 | |||
122 | #define OCELOT_C_SERIAL1_IRQ 80 | ||
123 | #define OCELOT_C_SERIAL1_BASE 0xfd000020 | ||
124 | |||
125 | #define OCELOT_C_SERIAL2_IRQ 81 | ||
126 | #define OCELOT_C_SERIAL2_BASE 0xfd000000 | ||
127 | |||
128 | #define _OCELOT_C_SERIAL_INIT(int, base) \ | ||
129 | { .baud_base = OCELOT_C_BASE_BAUD, \ | ||
130 | .irq = (int), \ | ||
131 | .flags = STD_COM_FLAGS, \ | ||
132 | .iomem_base = (u8 *) base, \ | ||
133 | .iomem_reg_shift = 2, \ | ||
134 | .io_type = SERIAL_IO_MEM \ | ||
135 | } | ||
136 | #define MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS \ | ||
137 | _OCELOT_C_SERIAL_INIT(OCELOT_C_SERIAL1_IRQ, OCELOT_C_SERIAL1_BASE), \ | ||
138 | _OCELOT_C_SERIAL_INIT(OCELOT_C_SERIAL2_IRQ, OCELOT_C_SERIAL2_BASE) | ||
139 | #else | ||
140 | #define MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS | ||
141 | #endif | ||
142 | |||
143 | #ifdef CONFIG_DDB5477 | ||
144 | #include <asm/ddb5xxx/ddb5477.h> | ||
145 | #define DDB5477_SERIAL_PORT_DEFNS \ | ||
146 | { .baud_base = BASE_BAUD, .irq = VRC5477_IRQ_UART0, \ | ||
147 | .flags = STD_COM_FLAGS, .iomem_base = (u8*)0xbfa04200, \ | ||
148 | .iomem_reg_shift = 3, .io_type = SERIAL_IO_MEM}, \ | ||
149 | { .baud_base = BASE_BAUD, .irq = VRC5477_IRQ_UART1, \ | ||
150 | .flags = STD_COM_FLAGS, .iomem_base = (u8*)0xbfa04240, \ | ||
151 | .iomem_reg_shift = 3, .io_type = SERIAL_IO_MEM}, | ||
152 | #else | ||
153 | #define DDB5477_SERIAL_PORT_DEFNS | ||
154 | #endif | ||
155 | |||
156 | #ifdef CONFIG_SGI_IP32 | ||
157 | /* | ||
158 | * The IP32 (SGI O2) has standard serial ports (UART 16550A) mapped in memory | ||
159 | * They are initialized in ip32_setup | ||
160 | */ | ||
161 | #define IP32_SERIAL_PORT_DEFNS \ | ||
162 | {},{}, | ||
163 | #else | ||
164 | #define IP32_SERIAL_PORT_DEFNS | ||
165 | #endif /* CONFIG_SGI_IP32 */ | ||
166 | |||
167 | #define SERIAL_PORT_DFNS \ | ||
168 | DDB5477_SERIAL_PORT_DEFNS \ | ||
169 | EV64120_SERIAL_PORT_DEFNS \ | ||
170 | IP32_SERIAL_PORT_DEFNS \ | ||
171 | JAZZ_SERIAL_PORT_DEFNS \ | ||
172 | STD_SERIAL_PORT_DEFNS \ | ||
173 | MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS \ | ||
174 | MOMENCO_OCELOT_SERIAL_PORT_DEFNS \ | ||
175 | MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS | ||
176 | |||
177 | #endif /* _ASM_SERIAL_H */ | 22 | #endif /* _ASM_SERIAL_H */ |
diff --git a/include/asm-mips/smp.h b/include/asm-mips/smp.h index 1608fd71d6f7..13aef6af422c 100644 --- a/include/asm-mips/smp.h +++ b/include/asm-mips/smp.h | |||
@@ -49,13 +49,6 @@ extern struct call_data_struct *call_data; | |||
49 | extern cpumask_t phys_cpu_present_map; | 49 | extern cpumask_t phys_cpu_present_map; |
50 | #define cpu_possible_map phys_cpu_present_map | 50 | #define cpu_possible_map phys_cpu_present_map |
51 | 51 | ||
52 | extern cpumask_t cpu_callout_map; | ||
53 | /* We don't mark CPUs online until __cpu_up(), so we need another measure */ | ||
54 | static inline int num_booting_cpus(void) | ||
55 | { | ||
56 | return cpus_weight(cpu_callout_map); | ||
57 | } | ||
58 | |||
59 | /* | 52 | /* |
60 | * These are defined by the board-specific code. | 53 | * These are defined by the board-specific code. |
61 | */ | 54 | */ |
diff --git a/include/asm-mips/sni.h b/include/asm-mips/sni.h index f257509b914f..ddaf36a1e389 100644 --- a/include/asm-mips/sni.h +++ b/include/asm-mips/sni.h | |||
@@ -146,9 +146,6 @@ extern unsigned int sni_brd_type; | |||
146 | #define SNI_A20R_IRQ_BASE MIPS_CPU_IRQ_BASE | 146 | #define SNI_A20R_IRQ_BASE MIPS_CPU_IRQ_BASE |
147 | #define SNI_A20R_IRQ_TIMER (SNI_A20R_IRQ_BASE+5) | 147 | #define SNI_A20R_IRQ_TIMER (SNI_A20R_IRQ_BASE+5) |
148 | 148 | ||
149 | #define SNI_DS1216_A20R_BASE 0xbc081ffc | ||
150 | #define SNI_DS1216_RM200_BASE 0xbcd41ffc | ||
151 | |||
152 | #define SNI_PCIT_INT_REG 0xbfff000c | 149 | #define SNI_PCIT_INT_REG 0xbfff000c |
153 | 150 | ||
154 | #define SNI_PCIT_INT_START 24 | 151 | #define SNI_PCIT_INT_START 24 |
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index bb0b289dbc9e..46bdb3f566f9 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h | |||
@@ -44,7 +44,7 @@ struct task_struct; | |||
44 | * different thread. | 44 | * different thread. |
45 | */ | 45 | */ |
46 | 46 | ||
47 | #define switch_to(prev,next,last) \ | 47 | #define __mips_mt_fpaff_switch_to(prev) \ |
48 | do { \ | 48 | do { \ |
49 | if (cpu_has_fpu && \ | 49 | if (cpu_has_fpu && \ |
50 | (prev->thread.mflags & MF_FPUBOUND) && \ | 50 | (prev->thread.mflags & MF_FPUBOUND) && \ |
@@ -52,24 +52,24 @@ do { \ | |||
52 | prev->thread.mflags &= ~MF_FPUBOUND; \ | 52 | prev->thread.mflags &= ~MF_FPUBOUND; \ |
53 | prev->cpus_allowed = prev->thread.user_cpus_allowed; \ | 53 | prev->cpus_allowed = prev->thread.user_cpus_allowed; \ |
54 | } \ | 54 | } \ |
55 | if (cpu_has_dsp) \ | ||
56 | __save_dsp(prev); \ | ||
57 | next->thread.emulated_fp = 0; \ | 55 | next->thread.emulated_fp = 0; \ |
58 | (last) = resume(prev, next, task_thread_info(next)); \ | ||
59 | if (cpu_has_dsp) \ | ||
60 | __restore_dsp(current); \ | ||
61 | } while(0) | 56 | } while(0) |
62 | 57 | ||
63 | #else | 58 | #else |
59 | #define __mips_mt_fpaff_switch_to(prev) do { (void) (prev); } while (0) | ||
60 | #endif | ||
61 | |||
64 | #define switch_to(prev,next,last) \ | 62 | #define switch_to(prev,next,last) \ |
65 | do { \ | 63 | do { \ |
64 | __mips_mt_fpaff_switch_to(prev); \ | ||
66 | if (cpu_has_dsp) \ | 65 | if (cpu_has_dsp) \ |
67 | __save_dsp(prev); \ | 66 | __save_dsp(prev); \ |
68 | (last) = resume(prev, next, task_thread_info(next)); \ | 67 | (last) = resume(prev, next, task_thread_info(next)); \ |
69 | if (cpu_has_dsp) \ | 68 | if (cpu_has_dsp) \ |
70 | __restore_dsp(current); \ | 69 | __restore_dsp(current); \ |
70 | if (cpu_has_userlocal) \ | ||
71 | write_c0_userlocal(task_thread_info(current)->tp_value);\ | ||
71 | } while(0) | 72 | } while(0) |
72 | #endif | ||
73 | 73 | ||
74 | /* | 74 | /* |
75 | * On SMP systems, when the scheduler does migration-cost autodetection, | 75 | * On SMP systems, when the scheduler does migration-cost autodetection, |
diff --git a/include/asm-mips/termbits.h b/include/asm-mips/termbits.h index 0bbe07b42a07..5bfdc3b64510 100644 --- a/include/asm-mips/termbits.h +++ b/include/asm-mips/termbits.h | |||
@@ -30,6 +30,17 @@ struct termios { | |||
30 | cc_t c_cc[NCCS]; /* control characters */ | 30 | cc_t c_cc[NCCS]; /* control characters */ |
31 | }; | 31 | }; |
32 | 32 | ||
33 | struct termios2 { | ||
34 | tcflag_t c_iflag; /* input mode flags */ | ||
35 | tcflag_t c_oflag; /* output mode flags */ | ||
36 | tcflag_t c_cflag; /* control mode flags */ | ||
37 | tcflag_t c_lflag; /* local mode flags */ | ||
38 | cc_t c_line; /* line discipline */ | ||
39 | cc_t c_cc[NCCS]; /* control characters */ | ||
40 | speed_t c_ispeed; /* input speed */ | ||
41 | speed_t c_ospeed; /* output speed */ | ||
42 | }; | ||
43 | |||
33 | struct ktermios { | 44 | struct ktermios { |
34 | tcflag_t c_iflag; /* input mode flags */ | 45 | tcflag_t c_iflag; /* input mode flags */ |
35 | tcflag_t c_oflag; /* output mode flags */ | 46 | tcflag_t c_oflag; /* output mode flags */ |
diff --git a/include/asm-mips/tx4938/rbtx4938.h b/include/asm-mips/tx4938/rbtx4938.h index 0fbedafdcea8..74e7d8061e58 100644 --- a/include/asm-mips/tx4938/rbtx4938.h +++ b/include/asm-mips/tx4938/rbtx4938.h | |||
@@ -105,12 +105,6 @@ | |||
105 | #define rbtx4938_pcireset_ptr \ | 105 | #define rbtx4938_pcireset_ptr \ |
106 | ((volatile unsigned char *)RBTX4938_PCIRESET_ADDR) | 106 | ((volatile unsigned char *)RBTX4938_PCIRESET_ADDR) |
107 | 107 | ||
108 | /* SPI */ | ||
109 | #define RBTX4938_SEEPROM1_CHIPID 0 | ||
110 | #define RBTX4938_SEEPROM2_CHIPID 1 | ||
111 | #define RBTX4938_SEEPROM3_CHIPID 2 | ||
112 | #define RBTX4938_SRTC_CHIPID 3 | ||
113 | |||
114 | /* | 108 | /* |
115 | * IRQ mappings | 109 | * IRQ mappings |
116 | */ | 110 | */ |
diff --git a/include/asm-mips/tx4938/spi.h b/include/asm-mips/tx4938/spi.h index 0dbbab820a5a..6a60c83e152b 100644 --- a/include/asm-mips/tx4938/spi.h +++ b/include/asm-mips/tx4938/spi.h | |||
@@ -14,61 +14,7 @@ | |||
14 | #ifndef __ASM_TX_BOARDS_TX4938_SPI_H | 14 | #ifndef __ASM_TX_BOARDS_TX4938_SPI_H |
15 | #define __ASM_TX_BOARDS_TX4938_SPI_H | 15 | #define __ASM_TX_BOARDS_TX4938_SPI_H |
16 | 16 | ||
17 | /* SPI */ | 17 | extern int spi_eeprom_register(int chipid); |
18 | struct spi_dev_desc { | ||
19 | unsigned int baud; | ||
20 | unsigned short tcss, tcsh, tcsr; /* CS setup/hold/recovery time */ | ||
21 | unsigned int byteorder:1; /* 0:LSB-First, 1:MSB-First */ | ||
22 | unsigned int polarity:1; /* 0:High-Active */ | ||
23 | unsigned int phase:1; /* 0:Sample-Then-Shift */ | ||
24 | }; | ||
25 | |||
26 | extern void txx9_spi_init(unsigned long base, int (*cs_func)(int chipid, int on)) __init; | ||
27 | extern void txx9_spi_irqinit(int irc_irq) __init; | ||
28 | extern int txx9_spi_io(int chipid, struct spi_dev_desc *desc, | ||
29 | unsigned char **inbufs, unsigned int *incounts, | ||
30 | unsigned char **outbufs, unsigned int *outcounts, | ||
31 | int cansleep); | ||
32 | extern int spi_eeprom_write_enable(int chipid, int enable); | ||
33 | extern int spi_eeprom_read_status(int chipid); | ||
34 | extern int spi_eeprom_read(int chipid, int address, unsigned char *buf, int len); | 18 | extern int spi_eeprom_read(int chipid, int address, unsigned char *buf, int len); |
35 | extern int spi_eeprom_write(int chipid, int address, unsigned char *buf, int len); | ||
36 | extern void spi_eeprom_proc_create(struct proc_dir_entry *dir, int chipid) __init; | ||
37 | |||
38 | #define TXX9_IMCLK (txx9_gbus_clock / 2) | ||
39 | |||
40 | /* | ||
41 | * SPI | ||
42 | */ | ||
43 | |||
44 | /* SPMCR : SPI Master Control */ | ||
45 | #define TXx9_SPMCR_OPMODE 0xc0 | ||
46 | #define TXx9_SPMCR_CONFIG 0x40 | ||
47 | #define TXx9_SPMCR_ACTIVE 0x80 | ||
48 | #define TXx9_SPMCR_SPSTP 0x02 | ||
49 | #define TXx9_SPMCR_BCLR 0x01 | ||
50 | |||
51 | /* SPCR0 : SPI Status */ | ||
52 | #define TXx9_SPCR0_TXIFL_MASK 0xc000 | ||
53 | #define TXx9_SPCR0_RXIFL_MASK 0x3000 | ||
54 | #define TXx9_SPCR0_SIDIE 0x0800 | ||
55 | #define TXx9_SPCR0_SOEIE 0x0400 | ||
56 | #define TXx9_SPCR0_RBSIE 0x0200 | ||
57 | #define TXx9_SPCR0_TBSIE 0x0100 | ||
58 | #define TXx9_SPCR0_IFSPSE 0x0010 | ||
59 | #define TXx9_SPCR0_SBOS 0x0004 | ||
60 | #define TXx9_SPCR0_SPHA 0x0002 | ||
61 | #define TXx9_SPCR0_SPOL 0x0001 | ||
62 | |||
63 | /* SPSR : SPI Status */ | ||
64 | #define TXx9_SPSR_TBSI 0x8000 | ||
65 | #define TXx9_SPSR_RBSI 0x4000 | ||
66 | #define TXx9_SPSR_TBS_MASK 0x3800 | ||
67 | #define TXx9_SPSR_RBS_MASK 0x0700 | ||
68 | #define TXx9_SPSR_SPOE 0x0080 | ||
69 | #define TXx9_SPSR_IFSD 0x0008 | ||
70 | #define TXx9_SPSR_SIDLE 0x0004 | ||
71 | #define TXx9_SPSR_STRDY 0x0002 | ||
72 | #define TXx9_SPSR_SRRDY 0x0001 | ||
73 | 19 | ||
74 | #endif /* __ASM_TX_BOARDS_TX4938_SPI_H */ | 20 | #endif /* __ASM_TX_BOARDS_TX4938_SPI_H */ |
diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h index 13a3502eef44..9de52a5b0f3d 100644 --- a/include/asm-mips/war.h +++ b/include/asm-mips/war.h | |||
@@ -169,26 +169,28 @@ | |||
169 | 169 | ||
170 | /* | 170 | /* |
171 | * On the RM9000 there is a problem which makes the CreateDirtyExclusive | 171 | * On the RM9000 there is a problem which makes the CreateDirtyExclusive |
172 | * cache operation unusable on SMP systems. | 172 | * eache operation unusable on SMP systems. |
173 | */ | 173 | */ |
174 | #if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_PMC_YOSEMITE) || \ | 174 | #if defined(CONFIG_PMC_YOSEMITE) || defined(CONFIG_BASLER_EXCITE) |
175 | defined(CONFIG_BASLER_EXCITE) | ||
176 | #define RM9000_CDEX_SMP_WAR 1 | 175 | #define RM9000_CDEX_SMP_WAR 1 |
177 | #endif | 176 | #endif |
178 | 177 | ||
179 | /* | 178 | /* |
180 | * The RM9000 has a bug (though PMC-Sierra opposes it being called that) | 179 | * The RM7000 processors and the E9000 cores have a bug (though PMC-Sierra |
181 | * where invalid instructions in the same I-cache line worth of instructions | 180 | * opposes it being called that) where invalid instructions in the same |
182 | * being fetched may case spurious exceptions. | 181 | * I-cache line worth of instructions being fetched may case spurious |
182 | * exceptions. | ||
183 | */ | 183 | */ |
184 | #if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_MOMENCO_OCELOT_3) || \ | 184 | #if defined(CONFIG_BASLER_EXCITE) || defined(CONFIG_MIPS_ATLAS) || \ |
185 | defined(CONFIG_PMC_YOSEMITE) || defined(CONFIG_BASLER_EXCITE) | 185 | defined(CONFIG_MIPS_MALTA) || defined(CONFIG_MOMENCO_OCELOT) || \ |
186 | defined(CONFIG_PMC_YOSEMITE) || defined(CONFIG_SGI_IP32) || \ | ||
187 | defined(CONFIG_WR_PPMC) | ||
186 | #define ICACHE_REFILLS_WORKAROUND_WAR 1 | 188 | #define ICACHE_REFILLS_WORKAROUND_WAR 1 |
187 | #endif | 189 | #endif |
188 | 190 | ||
189 | 191 | ||
190 | /* | 192 | /* |
191 | * ON the R10000 upto version 2.6 (not sure about 2.7) there is a bug that | 193 | * On the R10000 upto version 2.6 (not sure about 2.7) there is a bug that |
192 | * may cause ll / sc and lld / scd sequences to execute non-atomically. | 194 | * may cause ll / sc and lld / scd sequences to execute non-atomically. |
193 | */ | 195 | */ |
194 | #ifdef CONFIG_SGI_IP27 | 196 | #ifdef CONFIG_SGI_IP27 |
@@ -196,6 +198,14 @@ | |||
196 | #endif | 198 | #endif |
197 | 199 | ||
198 | /* | 200 | /* |
201 | * 34K core erratum: "Problems Executing the TLBR Instruction" | ||
202 | */ | ||
203 | #if defined(CONFIG_PMC_MSP7120_EVAL) || defined(CONFIG_PMC_MSP7120_GW) || \ | ||
204 | defined(CONFIG_PMC_MSP7120_FPGA) | ||
205 | #define MIPS34K_MISSED_ITLB_WAR 1 | ||
206 | #endif | ||
207 | |||
208 | /* | ||
199 | * Workarounds default to off | 209 | * Workarounds default to off |
200 | */ | 210 | */ |
201 | #ifndef ICACHE_REFILLS_WORKAROUND_WAR | 211 | #ifndef ICACHE_REFILLS_WORKAROUND_WAR |
@@ -234,5 +244,8 @@ | |||
234 | #ifndef R10000_LLSC_WAR | 244 | #ifndef R10000_LLSC_WAR |
235 | #define R10000_LLSC_WAR 0 | 245 | #define R10000_LLSC_WAR 0 |
236 | #endif | 246 | #endif |
247 | #ifndef MIPS34K_MISSED_ITLB_WAR | ||
248 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
249 | #endif | ||
237 | 250 | ||
238 | #endif /* _ASM_WAR_H */ | 251 | #endif /* _ASM_WAR_H */ |
diff --git a/include/asm-mips/watch.h b/include/asm-mips/watch.h deleted file mode 100644 index 6aa90cae1114..000000000000 --- a/include/asm-mips/watch.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1996, 1997, 1998, 2000, 2001 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef _ASM_WATCH_H | ||
9 | #define _ASM_WATCH_H | ||
10 | |||
11 | #include <linux/linkage.h> | ||
12 | |||
13 | /* | ||
14 | * Types of reference for watch_set() | ||
15 | */ | ||
16 | enum wref_type { | ||
17 | wr_save = 1, | ||
18 | wr_load = 2 | ||
19 | }; | ||
20 | |||
21 | extern asmlinkage void __watch_set(unsigned long addr, enum wref_type ref); | ||
22 | extern asmlinkage void __watch_clear(void); | ||
23 | extern asmlinkage void __watch_reenable(void); | ||
24 | |||
25 | #define watch_set(addr, ref) \ | ||
26 | if (cpu_has_watch) \ | ||
27 | __watch_set(addr, ref) | ||
28 | #define watch_clear() \ | ||
29 | if (cpu_has_watch) \ | ||
30 | __watch_clear() | ||
31 | #define watch_reenable() \ | ||
32 | if (cpu_has_watch) \ | ||
33 | __watch_reenable() | ||
34 | |||
35 | #endif /* _ASM_WATCH_H */ | ||
diff --git a/include/asm-parisc/termbits.h b/include/asm-parisc/termbits.h index a46e299a9391..e847fe979684 100644 --- a/include/asm-parisc/termbits.h +++ b/include/asm-parisc/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct termios2 { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | struct ktermios { | 31 | struct ktermios { |
21 | tcflag_t c_iflag; /* input mode flags */ | 32 | tcflag_t c_iflag; /* input mode flags */ |
22 | tcflag_t c_oflag; /* output mode flags */ | 33 | tcflag_t c_oflag; /* output mode flags */ |
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h index 4734cc178db5..05dd5a3eb3aa 100644 --- a/include/asm-powerpc/irq.h +++ b/include/asm-powerpc/irq.h | |||
@@ -138,10 +138,7 @@ struct irq_map_entry { | |||
138 | 138 | ||
139 | extern struct irq_map_entry irq_map[NR_IRQS]; | 139 | extern struct irq_map_entry irq_map[NR_IRQS]; |
140 | 140 | ||
141 | static inline irq_hw_number_t virq_to_hw(unsigned int virq) | 141 | extern irq_hw_number_t virq_to_hw(unsigned int virq); |
142 | { | ||
143 | return irq_map[virq].hwirq; | ||
144 | } | ||
145 | 142 | ||
146 | /** | 143 | /** |
147 | * irq_alloc_host - Allocate a new irq_host data structure | 144 | * irq_alloc_host - Allocate a new irq_host data structure |
diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h index c17bdbf22067..ea486952f778 100644 --- a/include/asm-s390/atomic.h +++ b/include/asm-s390/atomic.h | |||
@@ -24,7 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | typedef struct { | 26 | typedef struct { |
27 | volatile int counter; | 27 | int counter; |
28 | } __attribute__ ((aligned (4))) atomic_t; | 28 | } __attribute__ ((aligned (4))) atomic_t; |
29 | #define ATOMIC_INIT(i) { (i) } | 29 | #define ATOMIC_INIT(i) { (i) } |
30 | 30 | ||
@@ -141,7 +141,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) | |||
141 | 141 | ||
142 | #ifdef __s390x__ | 142 | #ifdef __s390x__ |
143 | typedef struct { | 143 | typedef struct { |
144 | volatile long long counter; | 144 | long long counter; |
145 | } __attribute__ ((aligned (8))) atomic64_t; | 145 | } __attribute__ ((aligned (8))) atomic64_t; |
146 | #define ATOMIC64_INIT(i) { (i) } | 146 | #define ATOMIC64_INIT(i) { (i) } |
147 | 147 | ||
diff --git a/include/asm-s390/cmb.h b/include/asm-s390/cmb.h index 241756f80df3..021e7c3223ec 100644 --- a/include/asm-s390/cmb.h +++ b/include/asm-s390/cmb.h | |||
@@ -88,7 +88,6 @@ extern u64 cmf_read(struct ccw_device *cdev, int index); | |||
88 | * any | 88 | * any |
89 | **/ | 89 | **/ |
90 | extern int cmf_readall(struct ccw_device *cdev, struct cmbdata*data); | 90 | extern int cmf_readall(struct ccw_device *cdev, struct cmbdata*data); |
91 | extern void cmf_reset(struct ccw_device *cdev); | ||
92 | 91 | ||
93 | #endif /* __KERNEL__ */ | 92 | #endif /* __KERNEL__ */ |
94 | #endif /* S390_CMB_H */ | 93 | #endif /* S390_CMB_H */ |
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index 5cb480af65d5..3b972d4c6b29 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h | |||
@@ -357,8 +357,8 @@ extern void (*s390_base_ext_handler_fn)(void); | |||
357 | /* | 357 | /* |
358 | * CPU idle notifier chain. | 358 | * CPU idle notifier chain. |
359 | */ | 359 | */ |
360 | #define CPU_IDLE 0 | 360 | #define S390_CPU_IDLE 0 |
361 | #define CPU_NOT_IDLE 1 | 361 | #define S390_CPU_NOT_IDLE 1 |
362 | 362 | ||
363 | struct notifier_block; | 363 | struct notifier_block; |
364 | int register_idle_notifier(struct notifier_block *nb); | 364 | int register_idle_notifier(struct notifier_block *nb); |
diff --git a/include/asm-s390/sclp.h b/include/asm-s390/sclp.h index 21ed64773210..cb9faf1ea5cf 100644 --- a/include/asm-s390/sclp.h +++ b/include/asm-s390/sclp.h | |||
@@ -11,29 +11,6 @@ | |||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <asm/chpid.h> | 12 | #include <asm/chpid.h> |
13 | 13 | ||
14 | struct sccb_header { | ||
15 | u16 length; | ||
16 | u8 function_code; | ||
17 | u8 control_mask[3]; | ||
18 | u16 response_code; | ||
19 | } __attribute__((packed)); | ||
20 | |||
21 | #define LOADPARM_LEN 8 | ||
22 | |||
23 | struct sclp_readinfo_sccb { | ||
24 | struct sccb_header header; /* 0-7 */ | ||
25 | u16 rnmax; /* 8-9 */ | ||
26 | u8 rnsize; /* 10 */ | ||
27 | u8 _reserved0[24 - 11]; /* 11-23 */ | ||
28 | u8 loadparm[LOADPARM_LEN]; /* 24-31 */ | ||
29 | u8 _reserved1[91 - 32]; /* 32-90 */ | ||
30 | u8 flags; /* 91 */ | ||
31 | u8 _reserved2[100 - 92]; /* 92-99 */ | ||
32 | u32 rnsize2; /* 100-103 */ | ||
33 | u64 rnmax2; /* 104-111 */ | ||
34 | u8 _reserved3[4096 - 112]; /* 112-4095 */ | ||
35 | } __attribute__((packed, aligned(4096))); | ||
36 | |||
37 | #define SCLP_CHP_INFO_MASK_SIZE 32 | 14 | #define SCLP_CHP_INFO_MASK_SIZE 32 |
38 | 15 | ||
39 | struct sclp_chp_info { | 16 | struct sclp_chp_info { |
@@ -42,12 +19,22 @@ struct sclp_chp_info { | |||
42 | u8 configured[SCLP_CHP_INFO_MASK_SIZE]; | 19 | u8 configured[SCLP_CHP_INFO_MASK_SIZE]; |
43 | }; | 20 | }; |
44 | 21 | ||
45 | extern struct sclp_readinfo_sccb s390_readinfo_sccb; | 22 | #define LOADPARM_LEN 8 |
46 | extern void sclp_readinfo_early(void); | 23 | |
47 | extern int sclp_sdias_blk_count(void); | 24 | struct sclp_ipl_info { |
48 | extern int sclp_sdias_copy(void *dest, int blk_num, int nr_blks); | 25 | int is_valid; |
49 | extern int sclp_chp_configure(struct chp_id chpid); | 26 | int has_dump; |
50 | extern int sclp_chp_deconfigure(struct chp_id chpid); | 27 | char loadparm[LOADPARM_LEN]; |
51 | extern int sclp_chp_read_info(struct sclp_chp_info *info); | 28 | }; |
29 | |||
30 | void sclp_readinfo_early(void); | ||
31 | void sclp_facilities_detect(void); | ||
32 | unsigned long long sclp_memory_detect(void); | ||
33 | int sclp_sdias_blk_count(void); | ||
34 | int sclp_sdias_copy(void *dest, int blk_num, int nr_blks); | ||
35 | int sclp_chp_configure(struct chp_id chpid); | ||
36 | int sclp_chp_deconfigure(struct chp_id chpid); | ||
37 | int sclp_chp_read_info(struct sclp_chp_info *info); | ||
38 | void sclp_get_ipl_info(struct sclp_ipl_info *info); | ||
52 | 39 | ||
53 | #endif /* _ASM_S390_SCLP_H */ | 40 | #endif /* _ASM_S390_SCLP_H */ |
diff --git a/include/asm-s390/sfp-machine.h b/include/asm-s390/sfp-machine.h index 8ca8c77b2d04..4e16aede4b06 100644 --- a/include/asm-s390/sfp-machine.h +++ b/include/asm-s390/sfp-machine.h | |||
@@ -27,9 +27,9 @@ | |||
27 | 27 | ||
28 | 28 | ||
29 | #define _FP_W_TYPE_SIZE 32 | 29 | #define _FP_W_TYPE_SIZE 32 |
30 | #define _FP_W_TYPE unsigned long | 30 | #define _FP_W_TYPE unsigned int |
31 | #define _FP_WS_TYPE signed long | 31 | #define _FP_WS_TYPE signed int |
32 | #define _FP_I_TYPE long | 32 | #define _FP_I_TYPE int |
33 | 33 | ||
34 | #define _FP_MUL_MEAT_S(R,X,Y) \ | 34 | #define _FP_MUL_MEAT_S(R,X,Y) \ |
35 | _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm) | 35 | _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm) |
diff --git a/include/asm-s390/sfp-util.h b/include/asm-s390/sfp-util.h index 8cabcd23d976..0addc6466d95 100644 --- a/include/asm-s390/sfp-util.h +++ b/include/asm-s390/sfp-util.h | |||
@@ -51,6 +51,16 @@ | |||
51 | wl = __wl; \ | 51 | wl = __wl; \ |
52 | }) | 52 | }) |
53 | 53 | ||
54 | #ifdef __s390x__ | ||
55 | #define udiv_qrnnd(q, r, n1, n0, d) \ | ||
56 | do { unsigned long __n; \ | ||
57 | unsigned int __r, __d; \ | ||
58 | __n = ((unsigned long)(n1) << 32) + n0; \ | ||
59 | __d = (d); \ | ||
60 | (q) = __n / __d; \ | ||
61 | (r) = __n % __d; \ | ||
62 | } while (0) | ||
63 | #else | ||
54 | #define udiv_qrnnd(q, r, n1, n0, d) \ | 64 | #define udiv_qrnnd(q, r, n1, n0, d) \ |
55 | do { unsigned int __r; \ | 65 | do { unsigned int __r; \ |
56 | (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \ | 66 | (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \ |
@@ -58,6 +68,7 @@ | |||
58 | } while (0) | 68 | } while (0) |
59 | extern unsigned long __udiv_qrnnd (unsigned int *, unsigned int, | 69 | extern unsigned long __udiv_qrnnd (unsigned int *, unsigned int, |
60 | unsigned int , unsigned int); | 70 | unsigned int , unsigned int); |
71 | #endif | ||
61 | 72 | ||
62 | #define UDIV_NEEDS_NORMALIZATION 0 | 73 | #define UDIV_NEEDS_NORMALIZATION 0 |
63 | 74 | ||
diff --git a/include/asm-s390/termbits.h b/include/asm-s390/termbits.h index 585c78a6e407..811b9a9cdc08 100644 --- a/include/asm-s390/termbits.h +++ b/include/asm-s390/termbits.h | |||
@@ -25,6 +25,17 @@ struct termios { | |||
25 | cc_t c_cc[NCCS]; /* control characters */ | 25 | cc_t c_cc[NCCS]; /* control characters */ |
26 | }; | 26 | }; |
27 | 27 | ||
28 | struct termios2 { | ||
29 | tcflag_t c_iflag; /* input mode flags */ | ||
30 | tcflag_t c_oflag; /* output mode flags */ | ||
31 | tcflag_t c_cflag; /* control mode flags */ | ||
32 | tcflag_t c_lflag; /* local mode flags */ | ||
33 | cc_t c_line; /* line discipline */ | ||
34 | cc_t c_cc[NCCS]; /* control characters */ | ||
35 | speed_t c_ispeed; /* input speed */ | ||
36 | speed_t c_ospeed; /* output speed */ | ||
37 | }; | ||
38 | |||
28 | struct ktermios { | 39 | struct ktermios { |
29 | tcflag_t c_iflag; /* input mode flags */ | 40 | tcflag_t c_iflag; /* input mode flags */ |
30 | tcflag_t c_oflag; /* output mode flags */ | 41 | tcflag_t c_oflag; /* output mode flags */ |
diff --git a/include/asm-sh/termbits.h b/include/asm-sh/termbits.h index f1b7b46f4e9a..7ee1b42eeab0 100644 --- a/include/asm-sh/termbits.h +++ b/include/asm-sh/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct termios2 { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | struct ktermios { | 31 | struct ktermios { |
21 | tcflag_t c_iflag; /* input mode flags */ | 32 | tcflag_t c_iflag; /* input mode flags */ |
22 | tcflag_t c_oflag; /* output mode flags */ | 33 | tcflag_t c_oflag; /* output mode flags */ |
diff --git a/include/asm-v850/termbits.h b/include/asm-v850/termbits.h index f3b433032089..35412f7f3eea 100644 --- a/include/asm-v850/termbits.h +++ b/include/asm-v850/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct termios2 { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | struct ktermios { | 31 | struct ktermios { |
21 | tcflag_t c_iflag; /* input mode flags */ | 32 | tcflag_t c_iflag; /* input mode flags */ |
22 | tcflag_t c_oflag; /* output mode flags */ | 33 | tcflag_t c_oflag; /* output mode flags */ |
diff --git a/include/asm-xtensa/termbits.h b/include/asm-xtensa/termbits.h index 057b9a3d8f83..9972c25ec86f 100644 --- a/include/asm-xtensa/termbits.h +++ b/include/asm-xtensa/termbits.h | |||
@@ -30,6 +30,17 @@ struct termios { | |||
30 | cc_t c_cc[NCCS]; /* control characters */ | 30 | cc_t c_cc[NCCS]; /* control characters */ |
31 | }; | 31 | }; |
32 | 32 | ||
33 | struct termios2 { | ||
34 | tcflag_t c_iflag; /* input mode flags */ | ||
35 | tcflag_t c_oflag; /* output mode flags */ | ||
36 | tcflag_t c_cflag; /* control mode flags */ | ||
37 | tcflag_t c_lflag; /* local mode flags */ | ||
38 | cc_t c_line; /* line discipline */ | ||
39 | cc_t c_cc[NCCS]; /* control characters */ | ||
40 | speed_t c_ispeed; /* input speed */ | ||
41 | speed_t c_ospeed; /* output speed */ | ||
42 | }; | ||
43 | |||
33 | struct ktermios { | 44 | struct ktermios { |
34 | tcflag_t c_iflag; /* input mode flags */ | 45 | tcflag_t c_iflag; /* input mode flags */ |
35 | tcflag_t c_oflag; /* output mode flags */ | 46 | tcflag_t c_oflag; /* output mode flags */ |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index f317c270d4bf..afae306b177c 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -49,6 +49,7 @@ header-y += consolemap.h | |||
49 | header-y += const.h | 49 | header-y += const.h |
50 | header-y += cycx_cfm.h | 50 | header-y += cycx_cfm.h |
51 | header-y += dlm_device.h | 51 | header-y += dlm_device.h |
52 | header-y += dlm_netlink.h | ||
52 | header-y += dm-ioctl.h | 53 | header-y += dm-ioctl.h |
53 | header-y += dn.h | 54 | header-y += dn.h |
54 | header-y += dqblk_v1.h | 55 | header-y += dqblk_v1.h |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 703febb2df31..407dc7e098bc 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -126,6 +126,7 @@ enum { | |||
126 | ATA_REG_IRQ = ATA_REG_NSECT, | 126 | ATA_REG_IRQ = ATA_REG_NSECT, |
127 | 127 | ||
128 | /* ATA device commands */ | 128 | /* ATA device commands */ |
129 | ATA_CMD_DEV_RESET = 0x08, /* ATAPI device reset */ | ||
129 | ATA_CMD_CHK_POWER = 0xE5, /* check power mode */ | 130 | ATA_CMD_CHK_POWER = 0xE5, /* check power mode */ |
130 | ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */ | 131 | ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */ |
131 | ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ | 132 | ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index db5b00a792f5..fae138bd2207 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -868,11 +868,6 @@ void kblockd_flush_work(struct work_struct *work); | |||
868 | */ | 868 | */ |
869 | #define buffer_heads_over_limit 0 | 869 | #define buffer_heads_over_limit 0 |
870 | 870 | ||
871 | static inline long blk_congestion_wait(int rw, long timeout) | ||
872 | { | ||
873 | return io_schedule_timeout(timeout); | ||
874 | } | ||
875 | |||
876 | static inline long nr_blockdev_pages(void) | 871 | static inline long nr_blockdev_pages(void) |
877 | { | 872 | { |
878 | return 0; | 873 | return 0; |
diff --git a/include/linux/dlm.h b/include/linux/dlm.h index 1b1dcb9a40bb..be9d278761e0 100644 --- a/include/linux/dlm.h +++ b/include/linux/dlm.h | |||
@@ -2,7 +2,7 @@ | |||
2 | ******************************************************************************* | 2 | ******************************************************************************* |
3 | ** | 3 | ** |
4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | 4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
5 | ** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. | 5 | ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. |
6 | ** | 6 | ** |
7 | ** This copyrighted material is made available to anyone wishing to use, | 7 | ** This copyrighted material is made available to anyone wishing to use, |
8 | ** modify, copy, or redistribute it subject to the terms and conditions | 8 | ** modify, copy, or redistribute it subject to the terms and conditions |
@@ -85,7 +85,11 @@ | |||
85 | * Only relevant to locks originating in userspace. A persistent lock will not | 85 | * Only relevant to locks originating in userspace. A persistent lock will not |
86 | * be removed if the process holding the lock exits. | 86 | * be removed if the process holding the lock exits. |
87 | * | 87 | * |
88 | * DLM_LKF_NODLKWT | 88 | * DLM_LKF_NODLCKWT |
89 | * | ||
90 | * Do not cancel the lock if it gets into conversion deadlock. | ||
91 | * Exclude this lock from being monitored due to DLM_LSFL_TIMEWARN. | ||
92 | * | ||
89 | * DLM_LKF_NODLCKBLK | 93 | * DLM_LKF_NODLCKBLK |
90 | * | 94 | * |
91 | * net yet implemented | 95 | * net yet implemented |
@@ -149,6 +153,7 @@ | |||
149 | #define DLM_LKF_ALTPR 0x00008000 | 153 | #define DLM_LKF_ALTPR 0x00008000 |
150 | #define DLM_LKF_ALTCW 0x00010000 | 154 | #define DLM_LKF_ALTCW 0x00010000 |
151 | #define DLM_LKF_FORCEUNLOCK 0x00020000 | 155 | #define DLM_LKF_FORCEUNLOCK 0x00020000 |
156 | #define DLM_LKF_TIMEOUT 0x00040000 | ||
152 | 157 | ||
153 | /* | 158 | /* |
154 | * Some return codes that are not in errno.h | 159 | * Some return codes that are not in errno.h |
@@ -199,11 +204,12 @@ struct dlm_lksb { | |||
199 | char * sb_lvbptr; | 204 | char * sb_lvbptr; |
200 | }; | 205 | }; |
201 | 206 | ||
207 | #define DLM_LSFL_NODIR 0x00000001 | ||
208 | #define DLM_LSFL_TIMEWARN 0x00000002 | ||
209 | #define DLM_LSFL_FS 0x00000004 | ||
202 | 210 | ||
203 | #ifdef __KERNEL__ | 211 | #ifdef __KERNEL__ |
204 | 212 | ||
205 | #define DLM_LSFL_NODIR 0x00000001 | ||
206 | |||
207 | /* | 213 | /* |
208 | * dlm_new_lockspace | 214 | * dlm_new_lockspace |
209 | * | 215 | * |
diff --git a/include/linux/dlm_device.h b/include/linux/dlm_device.h index c2735cab2ebf..9642277a152a 100644 --- a/include/linux/dlm_device.h +++ b/include/linux/dlm_device.h | |||
@@ -2,7 +2,7 @@ | |||
2 | ******************************************************************************* | 2 | ******************************************************************************* |
3 | ** | 3 | ** |
4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | 4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
5 | ** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. | 5 | ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. |
6 | ** | 6 | ** |
7 | ** This copyrighted material is made available to anyone wishing to use, | 7 | ** This copyrighted material is made available to anyone wishing to use, |
8 | ** modify, copy, or redistribute it subject to the terms and conditions | 8 | ** modify, copy, or redistribute it subject to the terms and conditions |
@@ -18,21 +18,24 @@ | |||
18 | #define DLM_USER_LVB_LEN 32 | 18 | #define DLM_USER_LVB_LEN 32 |
19 | 19 | ||
20 | /* Version of the device interface */ | 20 | /* Version of the device interface */ |
21 | #define DLM_DEVICE_VERSION_MAJOR 5 | 21 | #define DLM_DEVICE_VERSION_MAJOR 6 |
22 | #define DLM_DEVICE_VERSION_MINOR 1 | 22 | #define DLM_DEVICE_VERSION_MINOR 0 |
23 | #define DLM_DEVICE_VERSION_PATCH 0 | 23 | #define DLM_DEVICE_VERSION_PATCH 0 |
24 | 24 | ||
25 | /* struct passed to the lock write */ | 25 | /* struct passed to the lock write */ |
26 | struct dlm_lock_params { | 26 | struct dlm_lock_params { |
27 | __u8 mode; | 27 | __u8 mode; |
28 | __u8 namelen; | 28 | __u8 namelen; |
29 | __u16 flags; | 29 | __u16 unused; |
30 | __u32 flags; | ||
30 | __u32 lkid; | 31 | __u32 lkid; |
31 | __u32 parent; | 32 | __u32 parent; |
32 | void __user *castparam; | 33 | __u64 xid; |
34 | __u64 timeout; | ||
35 | void __user *castparam; | ||
33 | void __user *castaddr; | 36 | void __user *castaddr; |
34 | void __user *bastparam; | 37 | void __user *bastparam; |
35 | void __user *bastaddr; | 38 | void __user *bastaddr; |
36 | struct dlm_lksb __user *lksb; | 39 | struct dlm_lksb __user *lksb; |
37 | char lvb[DLM_USER_LVB_LEN]; | 40 | char lvb[DLM_USER_LVB_LEN]; |
38 | char name[0]; | 41 | char name[0]; |
@@ -62,9 +65,15 @@ struct dlm_write_request { | |||
62 | } i; | 65 | } i; |
63 | }; | 66 | }; |
64 | 67 | ||
68 | struct dlm_device_version { | ||
69 | __u32 version[3]; | ||
70 | }; | ||
71 | |||
65 | /* struct read from the "device" fd, | 72 | /* struct read from the "device" fd, |
66 | consists mainly of userspace pointers for the library to use */ | 73 | consists mainly of userspace pointers for the library to use */ |
74 | |||
67 | struct dlm_lock_result { | 75 | struct dlm_lock_result { |
76 | __u32 version[3]; | ||
68 | __u32 length; | 77 | __u32 length; |
69 | void __user * user_astaddr; | 78 | void __user * user_astaddr; |
70 | void __user * user_astparam; | 79 | void __user * user_astparam; |
@@ -83,6 +92,7 @@ struct dlm_lock_result { | |||
83 | #define DLM_USER_CREATE_LOCKSPACE 4 | 92 | #define DLM_USER_CREATE_LOCKSPACE 4 |
84 | #define DLM_USER_REMOVE_LOCKSPACE 5 | 93 | #define DLM_USER_REMOVE_LOCKSPACE 5 |
85 | #define DLM_USER_PURGE 6 | 94 | #define DLM_USER_PURGE 6 |
95 | #define DLM_USER_DEADLOCK 7 | ||
86 | 96 | ||
87 | /* Arbitrary length restriction */ | 97 | /* Arbitrary length restriction */ |
88 | #define MAX_LS_NAME_LEN 64 | 98 | #define MAX_LS_NAME_LEN 64 |
diff --git a/include/linux/dlm_netlink.h b/include/linux/dlm_netlink.h new file mode 100644 index 000000000000..19276332707a --- /dev/null +++ b/include/linux/dlm_netlink.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007 Red Hat, Inc. All rights reserved. | ||
3 | * | ||
4 | * This copyrighted material is made available to anyone wishing to use, | ||
5 | * modify, copy, or redistribute it subject to the terms and conditions | ||
6 | * of the GNU General Public License v.2. | ||
7 | */ | ||
8 | |||
9 | #ifndef _DLM_NETLINK_H | ||
10 | #define _DLM_NETLINK_H | ||
11 | |||
12 | enum { | ||
13 | DLM_STATUS_WAITING = 1, | ||
14 | DLM_STATUS_GRANTED = 2, | ||
15 | DLM_STATUS_CONVERT = 3, | ||
16 | }; | ||
17 | |||
18 | #define DLM_LOCK_DATA_VERSION 1 | ||
19 | |||
20 | struct dlm_lock_data { | ||
21 | uint16_t version; | ||
22 | uint32_t lockspace_id; | ||
23 | int nodeid; | ||
24 | int ownpid; | ||
25 | uint32_t id; | ||
26 | uint32_t remid; | ||
27 | uint64_t xid; | ||
28 | int8_t status; | ||
29 | int8_t grmode; | ||
30 | int8_t rqmode; | ||
31 | unsigned long timestamp; | ||
32 | int resource_namelen; | ||
33 | char resource_name[DLM_RESNAME_MAXLEN]; | ||
34 | }; | ||
35 | |||
36 | enum { | ||
37 | DLM_CMD_UNSPEC = 0, | ||
38 | DLM_CMD_HELLO, /* user->kernel */ | ||
39 | DLM_CMD_TIMEOUT, /* kernel->user */ | ||
40 | __DLM_CMD_MAX, | ||
41 | }; | ||
42 | |||
43 | #define DLM_CMD_MAX (__DLM_CMD_MAX - 1) | ||
44 | |||
45 | enum { | ||
46 | DLM_TYPE_UNSPEC = 0, | ||
47 | DLM_TYPE_LOCK, | ||
48 | __DLM_TYPE_MAX, | ||
49 | }; | ||
50 | |||
51 | #define DLM_TYPE_MAX (__DLM_TYPE_MAX - 1) | ||
52 | |||
53 | #define DLM_GENL_VERSION 0x1 | ||
54 | #define DLM_GENL_NAME "DLM" | ||
55 | |||
56 | #endif /* _DLM_NETLINK_H */ | ||
diff --git a/include/linux/eeprom_93cx6.h b/include/linux/eeprom_93cx6.h new file mode 100644 index 000000000000..d774b7778c91 --- /dev/null +++ b/include/linux/eeprom_93cx6.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | Copyright (C) 2004 - 2006 rt2x00 SourceForge Project | ||
3 | <http://rt2x00.serialmonkey.com> | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation; either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program; if not, write to the | ||
17 | Free Software Foundation, Inc., | ||
18 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | /* | ||
22 | Module: eeprom_93cx6 | ||
23 | Abstract: EEPROM reader datastructures for 93cx6 chipsets. | ||
24 | Supported chipsets: 93c46 & 93c66. | ||
25 | */ | ||
26 | |||
27 | /* | ||
28 | * EEPROM operation defines. | ||
29 | */ | ||
30 | #define PCI_EEPROM_WIDTH_93C46 6 | ||
31 | #define PCI_EEPROM_WIDTH_93C66 8 | ||
32 | #define PCI_EEPROM_WIDTH_OPCODE 3 | ||
33 | #define PCI_EEPROM_WRITE_OPCODE 0x05 | ||
34 | #define PCI_EEPROM_READ_OPCODE 0x06 | ||
35 | #define PCI_EEPROM_EWDS_OPCODE 0x10 | ||
36 | #define PCI_EEPROM_EWEN_OPCODE 0x13 | ||
37 | |||
38 | /** | ||
39 | * struct eeprom_93cx6 - control structure for setting the commands | ||
40 | * for reading the eeprom data. | ||
41 | * @data: private pointer for the driver. | ||
42 | * @register_read(struct eeprom_93cx6 *eeprom): handler to | ||
43 | * read the eeprom register, this function should set all reg_* fields. | ||
44 | * @register_write(struct eeprom_93cx6 *eeprom): handler to | ||
45 | * write to the eeprom register by using all reg_* fields. | ||
46 | * @width: eeprom width, should be one of the PCI_EEPROM_WIDTH_* defines | ||
47 | * @reg_data_in: register field to indicate data input | ||
48 | * @reg_data_out: register field to indicate data output | ||
49 | * @reg_data_clock: register field to set the data clock | ||
50 | * @reg_chip_select: register field to set the chip select | ||
51 | * | ||
52 | * This structure is used for the communication between the driver | ||
53 | * and the eeprom_93cx6 handlers for reading the eeprom. | ||
54 | */ | ||
55 | struct eeprom_93cx6 { | ||
56 | void *data; | ||
57 | |||
58 | void (*register_read)(struct eeprom_93cx6 *eeprom); | ||
59 | void (*register_write)(struct eeprom_93cx6 *eeprom); | ||
60 | |||
61 | int width; | ||
62 | |||
63 | char reg_data_in; | ||
64 | char reg_data_out; | ||
65 | char reg_data_clock; | ||
66 | char reg_chip_select; | ||
67 | }; | ||
68 | |||
69 | extern void eeprom_93cx6_read(struct eeprom_93cx6 *eeprom, | ||
70 | const u8 word, u16 *data); | ||
71 | extern void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom, | ||
72 | const u8 word, __le16 *data, const u16 words); | ||
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index efbe1fda1a22..1a45d6f41b09 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
@@ -30,16 +30,38 @@ | |||
30 | #define FW_CDEV_EVENT_REQUEST 0x02 | 30 | #define FW_CDEV_EVENT_REQUEST 0x02 |
31 | #define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 | 31 | #define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 |
32 | 32 | ||
33 | /* The 'closure' fields are for user space to use. Data passed in the | 33 | /** |
34 | * 'closure' field for a request will be returned in the corresponding | 34 | * struct fw_cdev_event_common - Common part of all fw_cdev_event_ types |
35 | * event. It's a 64-bit type so that it's a fixed size type big | 35 | * @closure: For arbitrary use by userspace |
36 | * enough to hold a pointer on all platforms. */ | 36 | * @type: Discriminates the fw_cdev_event_ types |
37 | 37 | * | |
38 | * This struct may be used to access generic members of all fw_cdev_event_ | ||
39 | * types regardless of the specific type. | ||
40 | * | ||
41 | * Data passed in the @closure field for a request will be returned in the | ||
42 | * corresponding event. It is big enough to hold a pointer on all platforms. | ||
43 | * The ioctl used to set @closure depends on the @type of event. | ||
44 | */ | ||
38 | struct fw_cdev_event_common { | 45 | struct fw_cdev_event_common { |
39 | __u64 closure; | 46 | __u64 closure; |
40 | __u32 type; | 47 | __u32 type; |
41 | }; | 48 | }; |
42 | 49 | ||
50 | /** | ||
51 | * struct fw_cdev_event_bus_reset - Sent when a bus reset occurred | ||
52 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_GET_INFO ioctl | ||
53 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_BUS_RESET | ||
54 | * @node_id: New node ID of this node | ||
55 | * @local_node_id: Node ID of the local node, i.e. of the controller | ||
56 | * @bm_node_id: Node ID of the bus manager | ||
57 | * @irm_node_id: Node ID of the iso resource manager | ||
58 | * @root_node_id: Node ID of the root node | ||
59 | * @generation: New bus generation | ||
60 | * | ||
61 | * This event is sent when the bus the device belongs to goes through a bus | ||
62 | * reset. It provides information about the new bus configuration, such as | ||
63 | * new node ID for this device, new root ID, and others. | ||
64 | */ | ||
43 | struct fw_cdev_event_bus_reset { | 65 | struct fw_cdev_event_bus_reset { |
44 | __u64 closure; | 66 | __u64 closure; |
45 | __u32 type; | 67 | __u32 type; |
@@ -51,6 +73,20 @@ struct fw_cdev_event_bus_reset { | |||
51 | __u32 generation; | 73 | __u32 generation; |
52 | }; | 74 | }; |
53 | 75 | ||
76 | /** | ||
77 | * struct fw_cdev_event_response - Sent when a response packet was received | ||
78 | * @closure: See &fw_cdev_event_common; | ||
79 | * set by %FW_CDEV_IOC_SEND_REQUEST ioctl | ||
80 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_RESPONSE | ||
81 | * @rcode: Response code returned by the remote node | ||
82 | * @length: Data length, i.e. the response's payload size in bytes | ||
83 | * @data: Payload data, if any | ||
84 | * | ||
85 | * This event is sent when the stack receives a response to an outgoing request | ||
86 | * sent by %FW_CDEV_IOC_SEND_REQUEST ioctl. The payload data for responses | ||
87 | * carrying data (read and lock responses) follows immediately and can be | ||
88 | * accessed through the @data field. | ||
89 | */ | ||
54 | struct fw_cdev_event_response { | 90 | struct fw_cdev_event_response { |
55 | __u64 closure; | 91 | __u64 closure; |
56 | __u32 type; | 92 | __u32 type; |
@@ -59,6 +95,25 @@ struct fw_cdev_event_response { | |||
59 | __u32 data[0]; | 95 | __u32 data[0]; |
60 | }; | 96 | }; |
61 | 97 | ||
98 | /** | ||
99 | * struct fw_cdev_event_request - Sent on incoming request to an address region | ||
100 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl | ||
101 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST | ||
102 | * @tcode: Transaction code of the incoming request | ||
103 | * @offset: The offset into the 48-bit per-node address space | ||
104 | * @handle: Reference to the kernel-side pending request | ||
105 | * @length: Data length, i.e. the request's payload size in bytes | ||
106 | * @data: Incoming data, if any | ||
107 | * | ||
108 | * This event is sent when the stack receives an incoming request to an address | ||
109 | * region registered using the %FW_CDEV_IOC_ALLOCATE ioctl. The request is | ||
110 | * guaranteed to be completely contained in the specified region. Userspace is | ||
111 | * responsible for sending the response by %FW_CDEV_IOC_SEND_RESPONSE ioctl, | ||
112 | * using the same @handle. | ||
113 | * | ||
114 | * The payload data for requests carrying data (write and lock requests) | ||
115 | * follows immediately and can be accessed through the @data field. | ||
116 | */ | ||
62 | struct fw_cdev_event_request { | 117 | struct fw_cdev_event_request { |
63 | __u64 closure; | 118 | __u64 closure; |
64 | __u32 type; | 119 | __u32 type; |
@@ -69,14 +124,39 @@ struct fw_cdev_event_request { | |||
69 | __u32 data[0]; | 124 | __u32 data[0]; |
70 | }; | 125 | }; |
71 | 126 | ||
127 | /** | ||
128 | * struct fw_cdev_event_iso_interrupt - Sent when an iso packet was completed | ||
129 | * @closure: See &fw_cdev_event_common; | ||
130 | * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl | ||
131 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_ISO_INTERRUPT | ||
132 | * @cycle: Cycle counter of the interrupt packet | ||
133 | * @header_length: Total length of following headers, in bytes | ||
134 | * @header: Stripped headers, if any | ||
135 | * | ||
136 | * This event is sent when the controller has completed an &fw_cdev_iso_packet | ||
137 | * with the %FW_CDEV_ISO_INTERRUPT bit set. In the receive case, the headers | ||
138 | * stripped of all packets up until and including the interrupt packet are | ||
139 | * returned in the @header field. | ||
140 | */ | ||
72 | struct fw_cdev_event_iso_interrupt { | 141 | struct fw_cdev_event_iso_interrupt { |
73 | __u64 closure; | 142 | __u64 closure; |
74 | __u32 type; | 143 | __u32 type; |
75 | __u32 cycle; | 144 | __u32 cycle; |
76 | __u32 header_length; /* Length in bytes of following headers. */ | 145 | __u32 header_length; |
77 | __u32 header[0]; | 146 | __u32 header[0]; |
78 | }; | 147 | }; |
79 | 148 | ||
149 | /** | ||
150 | * union fw_cdev_event - Convenience union of fw_cdev_event_ types | ||
151 | * @common: Valid for all types | ||
152 | * @bus_reset: Valid if @common.type == %FW_CDEV_EVENT_BUS_RESET | ||
153 | * @response: Valid if @common.type == %FW_CDEV_EVENT_RESPONSE | ||
154 | * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST | ||
155 | * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT | ||
156 | * | ||
157 | * Convenience union for userspace use. Events could be read(2) into a char | ||
158 | * buffer and then cast to this union for further processing. | ||
159 | */ | ||
80 | union fw_cdev_event { | 160 | union fw_cdev_event { |
81 | struct fw_cdev_event_common common; | 161 | struct fw_cdev_event_common common; |
82 | struct fw_cdev_event_bus_reset bus_reset; | 162 | struct fw_cdev_event_bus_reset bus_reset; |
@@ -105,35 +185,47 @@ union fw_cdev_event { | |||
105 | */ | 185 | */ |
106 | #define FW_CDEV_VERSION 1 | 186 | #define FW_CDEV_VERSION 1 |
107 | 187 | ||
188 | /** | ||
189 | * struct fw_cdev_get_info - General purpose information ioctl | ||
190 | * @version: The version field is just a running serial number. | ||
191 | * We never break backwards compatibility, but may add more | ||
192 | * structs and ioctls in later revisions. | ||
193 | * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration | ||
194 | * ROM will be copied into that user space address. In either | ||
195 | * case, @rom_length is updated with the actual length of the | ||
196 | * configuration ROM. | ||
197 | * @rom: If non-zero, address of a buffer to be filled by a copy of the | ||
198 | * local node's configuration ROM | ||
199 | * @bus_reset: If non-zero, address of a buffer to be filled by a | ||
200 | * &struct fw_cdev_event_bus_reset with the current state | ||
201 | * of the bus. This does not cause a bus reset to happen. | ||
202 | * @bus_reset_closure: Value of &closure in this and subsequent bus reset events | ||
203 | * @card: The index of the card this device belongs to | ||
204 | */ | ||
108 | struct fw_cdev_get_info { | 205 | struct fw_cdev_get_info { |
109 | /* The version field is just a running serial number. We | ||
110 | * never break backwards compatibility. Userspace passes in | ||
111 | * the version it expects and the kernel passes back the | ||
112 | * highest version it can provide. Even if the structs in | ||
113 | * this interface are extended in a later version, the kernel | ||
114 | * will not copy back more data than what was present in the | ||
115 | * interface version userspace expects. */ | ||
116 | __u32 version; | 206 | __u32 version; |
117 | |||
118 | /* If non-zero, at most rom_length bytes of config rom will be | ||
119 | * copied into that user space address. In either case, | ||
120 | * rom_length is updated with the actual length of the config | ||
121 | * rom. */ | ||
122 | __u32 rom_length; | 207 | __u32 rom_length; |
123 | __u64 rom; | 208 | __u64 rom; |
124 | |||
125 | /* If non-zero, a fw_cdev_event_bus_reset struct will be | ||
126 | * copied here with the current state of the bus. This does | ||
127 | * not cause a bus reset to happen. The value of closure in | ||
128 | * this and sub-sequent bus reset events is set to | ||
129 | * bus_reset_closure. */ | ||
130 | __u64 bus_reset; | 209 | __u64 bus_reset; |
131 | __u64 bus_reset_closure; | 210 | __u64 bus_reset_closure; |
132 | |||
133 | /* The index of the card this devices belongs to. */ | ||
134 | __u32 card; | 211 | __u32 card; |
135 | }; | 212 | }; |
136 | 213 | ||
214 | /** | ||
215 | * struct fw_cdev_send_request - Send an asynchronous request packet | ||
216 | * @tcode: Transaction code of the request | ||
217 | * @length: Length of outgoing payload, in bytes | ||
218 | * @offset: 48-bit offset at destination node | ||
219 | * @closure: Passed back to userspace in the response event | ||
220 | * @data: Userspace pointer to payload | ||
221 | * @generation: The bus generation where packet is valid | ||
222 | * | ||
223 | * Send a request to the device. This ioctl implements all outgoing requests. | ||
224 | * Both quadlet and block request specify the payload as a pointer to the data | ||
225 | * in the @data field. Once the transaction completes, the kernel writes an | ||
226 | * &fw_cdev_event_request event back. The @closure field is passed back to | ||
227 | * user space in the response event. | ||
228 | */ | ||
137 | struct fw_cdev_send_request { | 229 | struct fw_cdev_send_request { |
138 | __u32 tcode; | 230 | __u32 tcode; |
139 | __u32 length; | 231 | __u32 length; |
@@ -143,6 +235,19 @@ struct fw_cdev_send_request { | |||
143 | __u32 generation; | 235 | __u32 generation; |
144 | }; | 236 | }; |
145 | 237 | ||
238 | /** | ||
239 | * struct fw_cdev_send_response - Send an asynchronous response packet | ||
240 | * @rcode: Response code as determined by the userspace handler | ||
241 | * @length: Length of outgoing payload, in bytes | ||
242 | * @data: Userspace pointer to payload | ||
243 | * @handle: The handle from the &fw_cdev_event_request | ||
244 | * | ||
245 | * Send a response to an incoming request. By setting up an address range using | ||
246 | * the %FW_CDEV_IOC_ALLOCATE ioctl, userspace can listen for incoming requests. An | ||
247 | * incoming request will generate an %FW_CDEV_EVENT_REQUEST, and userspace must | ||
248 | * send a reply using this ioctl. The event has a handle to the kernel-side | ||
249 | * pending transaction, which should be used with this ioctl. | ||
250 | */ | ||
146 | struct fw_cdev_send_response { | 251 | struct fw_cdev_send_response { |
147 | __u32 rcode; | 252 | __u32 rcode; |
148 | __u32 length; | 253 | __u32 length; |
@@ -150,6 +255,21 @@ struct fw_cdev_send_response { | |||
150 | __u32 handle; | 255 | __u32 handle; |
151 | }; | 256 | }; |
152 | 257 | ||
258 | /** | ||
259 | * struct fw_cdev_allocate - Allocate a CSR address range | ||
260 | * @offset: Start offset of the address range | ||
261 | * @closure: To be passed back to userspace in request events | ||
262 | * @length: Length of the address range, in bytes | ||
263 | * @handle: Handle to the allocation, written by the kernel | ||
264 | * | ||
265 | * Allocate an address range in the 48-bit address space on the local node | ||
266 | * (the controller). This allows userspace to listen for requests with an | ||
267 | * offset within that address range. When the kernel receives a request | ||
268 | * within the range, an &fw_cdev_event_request event will be written back. | ||
269 | * The @closure field is passed back to userspace in the response event. | ||
270 | * The @handle field is an out parameter, returning a handle to the allocated | ||
271 | * range to be used for later deallocation of the range. | ||
272 | */ | ||
153 | struct fw_cdev_allocate { | 273 | struct fw_cdev_allocate { |
154 | __u64 offset; | 274 | __u64 offset; |
155 | __u64 closure; | 275 | __u64 closure; |
@@ -157,6 +277,11 @@ struct fw_cdev_allocate { | |||
157 | __u32 handle; | 277 | __u32 handle; |
158 | }; | 278 | }; |
159 | 279 | ||
280 | /** | ||
281 | * struct fw_cdev_deallocate - Free an address range allocation | ||
282 | * @handle: Handle to the address range, as returned by the kernel when the | ||
283 | * range was allocated | ||
284 | */ | ||
160 | struct fw_cdev_deallocate { | 285 | struct fw_cdev_deallocate { |
161 | __u32 handle; | 286 | __u32 handle; |
162 | }; | 287 | }; |
@@ -164,10 +289,41 @@ struct fw_cdev_deallocate { | |||
164 | #define FW_CDEV_LONG_RESET 0 | 289 | #define FW_CDEV_LONG_RESET 0 |
165 | #define FW_CDEV_SHORT_RESET 1 | 290 | #define FW_CDEV_SHORT_RESET 1 |
166 | 291 | ||
292 | /** | ||
293 | * struct fw_cdev_initiate_bus_reset - Initiate a bus reset | ||
294 | * @type: %FW_CDEV_SHORT_RESET or %FW_CDEV_LONG_RESET | ||
295 | * | ||
296 | * Initiate a bus reset for the bus this device is on. The bus reset can be | ||
297 | * either the original (long) bus reset or the arbitrated (short) bus reset | ||
298 | * introduced in 1394a-2000. | ||
299 | */ | ||
167 | struct fw_cdev_initiate_bus_reset { | 300 | struct fw_cdev_initiate_bus_reset { |
168 | __u32 type; | 301 | __u32 type; /* FW_CDEV_SHORT_RESET or FW_CDEV_LONG_RESET */ |
169 | }; | 302 | }; |
170 | 303 | ||
304 | /** | ||
305 | * struct fw_cdev_add_descriptor - Add contents to the local node's config ROM | ||
306 | * @immediate: If non-zero, immediate key to insert before pointer | ||
307 | * @key: Upper 8 bits of root directory pointer | ||
308 | * @data: Userspace pointer to contents of descriptor block | ||
309 | * @length: Length of descriptor block data, in bytes | ||
310 | * @handle: Handle to the descriptor, written by the kernel | ||
311 | * | ||
312 | * Add a descriptor block and optionally a preceding immediate key to the local | ||
313 | * node's configuration ROM. | ||
314 | * | ||
315 | * The @key field specifies the upper 8 bits of the descriptor root directory | ||
316 | * pointer and the @data and @length fields specify the contents. The @key | ||
317 | * should be of the form 0xXX000000. The offset part of the root directory entry | ||
318 | * will be filled in by the kernel. | ||
319 | * | ||
320 | * If not 0, the @immediate field specifies an immediate key which will be | ||
321 | * inserted before the root directory pointer. | ||
322 | * | ||
323 | * If successful, the kernel adds the descriptor and writes back a handle to the | ||
324 | * kernel-side object to be used for later removal of the descriptor block and | ||
325 | * immediate key. | ||
326 | */ | ||
171 | struct fw_cdev_add_descriptor { | 327 | struct fw_cdev_add_descriptor { |
172 | __u32 immediate; | 328 | __u32 immediate; |
173 | __u32 key; | 329 | __u32 key; |
@@ -176,6 +332,14 @@ struct fw_cdev_add_descriptor { | |||
176 | __u32 handle; | 332 | __u32 handle; |
177 | }; | 333 | }; |
178 | 334 | ||
335 | /** | ||
336 | * struct fw_cdev_remove_descriptor - Remove contents from the configuration ROM | ||
337 | * @handle: Handle to the descriptor, as returned by the kernel when the | ||
338 | * descriptor was added | ||
339 | * | ||
340 | * Remove a descriptor block and accompanying immediate key from the local | ||
341 | * node's configuration ROM. | ||
342 | */ | ||
179 | struct fw_cdev_remove_descriptor { | 343 | struct fw_cdev_remove_descriptor { |
180 | __u32 handle; | 344 | __u32 handle; |
181 | }; | 345 | }; |
@@ -183,12 +347,24 @@ struct fw_cdev_remove_descriptor { | |||
183 | #define FW_CDEV_ISO_CONTEXT_TRANSMIT 0 | 347 | #define FW_CDEV_ISO_CONTEXT_TRANSMIT 0 |
184 | #define FW_CDEV_ISO_CONTEXT_RECEIVE 1 | 348 | #define FW_CDEV_ISO_CONTEXT_RECEIVE 1 |
185 | 349 | ||
186 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1 | 350 | /** |
187 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2 | 351 | * struct fw_cdev_create_iso_context - Create a context for isochronous IO |
188 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4 | 352 | * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE |
189 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8 | 353 | * @header_size: Header size to strip for receive contexts |
190 | #define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15 | 354 | * @channel: Channel to bind to |
191 | 355 | * @speed: Speed to transmit at | |
356 | * @closure: To be returned in &fw_cdev_event_iso_interrupt | ||
357 | * @handle: Handle to context, written back by kernel | ||
358 | * | ||
359 | * Prior to sending or receiving isochronous I/O, a context must be created. | ||
360 | * The context records information about the transmit or receive configuration | ||
361 | * and typically maps to an underlying hardware resource. A context is set up | ||
362 | * for either sending or receiving. It is bound to a specific isochronous | ||
363 | * channel. | ||
364 | * | ||
365 | * If a context was successfully created, the kernel writes back a handle to the | ||
366 | * context, which must be passed in for subsequent operations on that context. | ||
367 | */ | ||
192 | struct fw_cdev_create_iso_context { | 368 | struct fw_cdev_create_iso_context { |
193 | __u32 type; | 369 | __u32 type; |
194 | __u32 header_size; | 370 | __u32 header_size; |
@@ -201,15 +377,49 @@ struct fw_cdev_create_iso_context { | |||
201 | #define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v) | 377 | #define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v) |
202 | #define FW_CDEV_ISO_INTERRUPT (1 << 16) | 378 | #define FW_CDEV_ISO_INTERRUPT (1 << 16) |
203 | #define FW_CDEV_ISO_SKIP (1 << 17) | 379 | #define FW_CDEV_ISO_SKIP (1 << 17) |
380 | #define FW_CDEV_ISO_SYNC (1 << 17) | ||
204 | #define FW_CDEV_ISO_TAG(v) ((v) << 18) | 381 | #define FW_CDEV_ISO_TAG(v) ((v) << 18) |
205 | #define FW_CDEV_ISO_SY(v) ((v) << 20) | 382 | #define FW_CDEV_ISO_SY(v) ((v) << 20) |
206 | #define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24) | 383 | #define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24) |
207 | 384 | ||
385 | /** | ||
386 | * struct fw_cdev_iso_packet - Isochronous packet | ||
387 | * @control: Contains the header length (8 uppermost bits), the sy field | ||
388 | * (4 bits), the tag field (2 bits), a sync flag (1 bit), | ||
389 | * a skip flag (1 bit), an interrupt flag (1 bit), and the | ||
390 | * payload length (16 lowermost bits) | ||
391 | * @header: Header and payload | ||
392 | * | ||
393 | * &struct fw_cdev_iso_packet is used to describe isochronous packet queues. | ||
394 | * | ||
395 | * Use the FW_CDEV_ISO_ macros to fill in @control. The sy and tag fields are | ||
396 | * specified by IEEE 1394a and IEC 61883. | ||
397 | * | ||
398 | * FIXME - finish this documentation | ||
399 | */ | ||
208 | struct fw_cdev_iso_packet { | 400 | struct fw_cdev_iso_packet { |
209 | __u32 control; | 401 | __u32 control; |
210 | __u32 header[0]; | 402 | __u32 header[0]; |
211 | }; | 403 | }; |
212 | 404 | ||
405 | /** | ||
406 | * struct fw_cdev_queue_iso - Queue isochronous packets for I/O | ||
407 | * @packets: Userspace pointer to packet data | ||
408 | * @data: Pointer into mmap()'ed payload buffer | ||
409 | * @size: Size of packet data in bytes | ||
410 | * @handle: Isochronous context handle | ||
411 | * | ||
412 | * Queue a number of isochronous packets for reception or transmission. | ||
413 | * This ioctl takes a pointer to an array of &fw_cdev_iso_packet structs, | ||
414 | * which describe how to transmit from or receive into a contiguous region | ||
415 | * of a mmap()'ed payload buffer. As part of the packet descriptors, | ||
416 | * a series of headers can be supplied, which will be prepended to the | ||
417 | * payload during DMA. | ||
418 | * | ||
419 | * The kernel may or may not queue all packets, but will write back updated | ||
420 | * values of the @packets, @data and @size fields, so the ioctl can be | ||
421 | * resubmitted easily. | ||
422 | */ | ||
213 | struct fw_cdev_queue_iso { | 423 | struct fw_cdev_queue_iso { |
214 | __u64 packets; | 424 | __u64 packets; |
215 | __u64 data; | 425 | __u64 data; |
@@ -217,6 +427,23 @@ struct fw_cdev_queue_iso { | |||
217 | __u32 handle; | 427 | __u32 handle; |
218 | }; | 428 | }; |
219 | 429 | ||
430 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1 | ||
431 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2 | ||
432 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4 | ||
433 | #define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8 | ||
434 | #define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15 | ||
435 | |||
436 | /** | ||
437 | * struct fw_cdev_start_iso - Start an isochronous transmission or reception | ||
438 | * @cycle: Cycle in which to start I/O. If @cycle is greater than or | ||
439 | * equal to 0, the I/O will start on that cycle. | ||
440 | * @sync: Determines the value to wait for for receive packets that have | ||
441 | * the %FW_CDEV_ISO_SYNC bit set | ||
442 | * @tags: Tag filter bit mask. Only valid for isochronous reception. | ||
443 | * Determines the tag values for which packets will be accepted. | ||
444 | * Use FW_CDEV_ISO_CONTEXT_MATCH_ macros to set @tags. | ||
445 | * @handle: Isochronous context handle within which to transmit or receive | ||
446 | */ | ||
220 | struct fw_cdev_start_iso { | 447 | struct fw_cdev_start_iso { |
221 | __s32 cycle; | 448 | __s32 cycle; |
222 | __u32 sync; | 449 | __u32 sync; |
@@ -224,6 +451,10 @@ struct fw_cdev_start_iso { | |||
224 | __u32 handle; | 451 | __u32 handle; |
225 | }; | 452 | }; |
226 | 453 | ||
454 | /** | ||
455 | * struct fw_cdev_stop_iso - Stop an isochronous transmission or reception | ||
456 | * @handle: Handle of isochronous context to stop | ||
457 | */ | ||
227 | struct fw_cdev_stop_iso { | 458 | struct fw_cdev_stop_iso { |
228 | __u32 handle; | 459 | __u32 handle; |
229 | }; | 460 | }; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 6a41f4cab14c..4f0b3bf5983c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1054,7 +1054,7 @@ struct block_device_operations { | |||
1054 | }; | 1054 | }; |
1055 | 1055 | ||
1056 | /* | 1056 | /* |
1057 | * "descriptor" for what we're up to with a read for sendfile(). | 1057 | * "descriptor" for what we're up to with a read. |
1058 | * This allows us to use the same read code yet | 1058 | * This allows us to use the same read code yet |
1059 | * have multiple different users of the data that | 1059 | * have multiple different users of the data that |
1060 | * we read from a file. | 1060 | * we read from a file. |
@@ -1105,7 +1105,6 @@ struct file_operations { | |||
1105 | int (*aio_fsync) (struct kiocb *, int datasync); | 1105 | int (*aio_fsync) (struct kiocb *, int datasync); |
1106 | int (*fasync) (int, struct file *, int); | 1106 | int (*fasync) (int, struct file *, int); |
1107 | int (*lock) (struct file *, int, struct file_lock *); | 1107 | int (*lock) (struct file *, int, struct file_lock *); |
1108 | ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *); | ||
1109 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); | 1108 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); |
1110 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | 1109 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); |
1111 | int (*check_flags)(int); | 1110 | int (*check_flags)(int); |
@@ -1762,7 +1761,6 @@ extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, | |||
1762 | unsigned long, loff_t, loff_t *, size_t, ssize_t); | 1761 | unsigned long, loff_t, loff_t *, size_t, ssize_t); |
1763 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); | 1762 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); |
1764 | extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); | 1763 | extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); |
1765 | extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); | ||
1766 | extern void do_generic_mapping_read(struct address_space *mapping, | 1764 | extern void do_generic_mapping_read(struct address_space *mapping, |
1767 | struct file_ra_state *, struct file *, | 1765 | struct file_ra_state *, struct file *, |
1768 | loff_t *, read_descriptor_t *, read_actor_t); | 1766 | loff_t *, read_descriptor_t *, read_actor_t); |
@@ -1792,9 +1790,6 @@ extern int nonseekable_open(struct inode * inode, struct file * filp); | |||
1792 | #ifdef CONFIG_FS_XIP | 1790 | #ifdef CONFIG_FS_XIP |
1793 | extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len, | 1791 | extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len, |
1794 | loff_t *ppos); | 1792 | loff_t *ppos); |
1795 | extern ssize_t xip_file_sendfile(struct file *in_file, loff_t *ppos, | ||
1796 | size_t count, read_actor_t actor, | ||
1797 | void *target); | ||
1798 | extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma); | 1793 | extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma); |
1799 | extern ssize_t xip_file_write(struct file *filp, const char __user *buf, | 1794 | extern ssize_t xip_file_write(struct file *filp, const char __user *buf, |
1800 | size_t len, loff_t *ppos); | 1795 | size_t len, loff_t *ppos); |
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h index 8b7e4c1e32ae..a44a6a078f0a 100644 --- a/include/linux/gfs2_ondisk.h +++ b/include/linux/gfs2_ondisk.h | |||
@@ -54,18 +54,6 @@ struct gfs2_inum { | |||
54 | __be64 no_addr; | 54 | __be64 no_addr; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | struct gfs2_inum_host { | ||
58 | __u64 no_formal_ino; | ||
59 | __u64 no_addr; | ||
60 | }; | ||
61 | |||
62 | static inline int gfs2_inum_equal(const struct gfs2_inum_host *ino1, | ||
63 | const struct gfs2_inum_host *ino2) | ||
64 | { | ||
65 | return ino1->no_formal_ino == ino2->no_formal_ino && | ||
66 | ino1->no_addr == ino2->no_addr; | ||
67 | } | ||
68 | |||
69 | /* | 57 | /* |
70 | * Generic metadata head structure | 58 | * Generic metadata head structure |
71 | * Every inplace buffer logged in the journal must start with this. | 59 | * Every inplace buffer logged in the journal must start with this. |
@@ -94,12 +82,6 @@ struct gfs2_meta_header { | |||
94 | __be32 __pad1; /* Was incarnation number in gfs1 */ | 82 | __be32 __pad1; /* Was incarnation number in gfs1 */ |
95 | }; | 83 | }; |
96 | 84 | ||
97 | struct gfs2_meta_header_host { | ||
98 | __u32 mh_magic; | ||
99 | __u32 mh_type; | ||
100 | __u32 mh_format; | ||
101 | }; | ||
102 | |||
103 | /* | 85 | /* |
104 | * super-block structure | 86 | * super-block structure |
105 | * | 87 | * |
@@ -139,23 +121,6 @@ struct gfs2_sb { | |||
139 | /* In gfs1, quota and license dinodes followed */ | 121 | /* In gfs1, quota and license dinodes followed */ |
140 | }; | 122 | }; |
141 | 123 | ||
142 | struct gfs2_sb_host { | ||
143 | struct gfs2_meta_header_host sb_header; | ||
144 | |||
145 | __u32 sb_fs_format; | ||
146 | __u32 sb_multihost_format; | ||
147 | |||
148 | __u32 sb_bsize; | ||
149 | __u32 sb_bsize_shift; | ||
150 | |||
151 | struct gfs2_inum_host sb_master_dir; /* Was jindex dinode in gfs1 */ | ||
152 | struct gfs2_inum_host sb_root_dir; | ||
153 | |||
154 | char sb_lockproto[GFS2_LOCKNAME_LEN]; | ||
155 | char sb_locktable[GFS2_LOCKNAME_LEN]; | ||
156 | /* In gfs1, quota and license dinodes followed */ | ||
157 | }; | ||
158 | |||
159 | /* | 124 | /* |
160 | * resource index structure | 125 | * resource index structure |
161 | */ | 126 | */ |
@@ -173,14 +138,6 @@ struct gfs2_rindex { | |||
173 | __u8 ri_reserved[64]; | 138 | __u8 ri_reserved[64]; |
174 | }; | 139 | }; |
175 | 140 | ||
176 | struct gfs2_rindex_host { | ||
177 | __u64 ri_addr; /* grp block disk address */ | ||
178 | __u64 ri_data0; /* first data location */ | ||
179 | __u32 ri_length; /* length of rgrp header in fs blocks */ | ||
180 | __u32 ri_data; /* num of data blocks in rgrp */ | ||
181 | __u32 ri_bitbytes; /* number of bytes in data bitmaps */ | ||
182 | }; | ||
183 | |||
184 | /* | 141 | /* |
185 | * resource group header structure | 142 | * resource group header structure |
186 | */ | 143 | */ |
@@ -212,13 +169,6 @@ struct gfs2_rgrp { | |||
212 | __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */ | 169 | __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */ |
213 | }; | 170 | }; |
214 | 171 | ||
215 | struct gfs2_rgrp_host { | ||
216 | __u32 rg_flags; | ||
217 | __u32 rg_free; | ||
218 | __u32 rg_dinodes; | ||
219 | __u64 rg_igeneration; | ||
220 | }; | ||
221 | |||
222 | /* | 172 | /* |
223 | * quota structure | 173 | * quota structure |
224 | */ | 174 | */ |
@@ -230,12 +180,6 @@ struct gfs2_quota { | |||
230 | __u8 qu_reserved[64]; | 180 | __u8 qu_reserved[64]; |
231 | }; | 181 | }; |
232 | 182 | ||
233 | struct gfs2_quota_host { | ||
234 | __u64 qu_limit; | ||
235 | __u64 qu_warn; | ||
236 | __u64 qu_value; | ||
237 | }; | ||
238 | |||
239 | /* | 183 | /* |
240 | * dinode structure | 184 | * dinode structure |
241 | */ | 185 | */ |
@@ -315,29 +259,11 @@ struct gfs2_dinode { | |||
315 | struct gfs2_inum __pad4; /* Unused even in current gfs1 */ | 259 | struct gfs2_inum __pad4; /* Unused even in current gfs1 */ |
316 | 260 | ||
317 | __be64 di_eattr; /* extended attribute block number */ | 261 | __be64 di_eattr; /* extended attribute block number */ |
262 | __be32 di_atime_nsec; /* nsec portion of atime */ | ||
263 | __be32 di_mtime_nsec; /* nsec portion of mtime */ | ||
264 | __be32 di_ctime_nsec; /* nsec portion of ctime */ | ||
318 | 265 | ||
319 | __u8 di_reserved[56]; | 266 | __u8 di_reserved[44]; |
320 | }; | ||
321 | |||
322 | struct gfs2_dinode_host { | ||
323 | __u64 di_size; /* number of bytes in file */ | ||
324 | __u64 di_blocks; /* number of blocks in file */ | ||
325 | |||
326 | /* This section varies from gfs1. Padding added to align with | ||
327 | * remainder of dinode | ||
328 | */ | ||
329 | __u64 di_goal_meta; /* rgrp to alloc from next */ | ||
330 | __u64 di_goal_data; /* data block goal */ | ||
331 | __u64 di_generation; /* generation number for NFS */ | ||
332 | |||
333 | __u32 di_flags; /* GFS2_DIF_... */ | ||
334 | __u16 di_height; /* height of metadata */ | ||
335 | |||
336 | /* These only apply to directories */ | ||
337 | __u16 di_depth; /* Number of bits in the table */ | ||
338 | __u32 di_entries; /* The number of entries in the directory */ | ||
339 | |||
340 | __u64 di_eattr; /* extended attribute block number */ | ||
341 | }; | 267 | }; |
342 | 268 | ||
343 | /* | 269 | /* |
@@ -414,16 +340,6 @@ struct gfs2_log_header { | |||
414 | __be32 lh_hash; | 340 | __be32 lh_hash; |
415 | }; | 341 | }; |
416 | 342 | ||
417 | struct gfs2_log_header_host { | ||
418 | struct gfs2_meta_header_host lh_header; | ||
419 | |||
420 | __u64 lh_sequence; /* Sequence number of this transaction */ | ||
421 | __u32 lh_flags; /* GFS2_LOG_HEAD_... */ | ||
422 | __u32 lh_tail; /* Block number of log tail */ | ||
423 | __u32 lh_blkno; | ||
424 | __u32 lh_hash; | ||
425 | }; | ||
426 | |||
427 | /* | 343 | /* |
428 | * Log type descriptor | 344 | * Log type descriptor |
429 | */ | 345 | */ |
@@ -464,11 +380,6 @@ struct gfs2_inum_range { | |||
464 | __be64 ir_length; | 380 | __be64 ir_length; |
465 | }; | 381 | }; |
466 | 382 | ||
467 | struct gfs2_inum_range_host { | ||
468 | __u64 ir_start; | ||
469 | __u64 ir_length; | ||
470 | }; | ||
471 | |||
472 | /* | 383 | /* |
473 | * Statfs change | 384 | * Statfs change |
474 | * Describes an change to the pool of free and allocated | 385 | * Describes an change to the pool of free and allocated |
@@ -481,12 +392,6 @@ struct gfs2_statfs_change { | |||
481 | __be64 sc_dinodes; | 392 | __be64 sc_dinodes; |
482 | }; | 393 | }; |
483 | 394 | ||
484 | struct gfs2_statfs_change_host { | ||
485 | __u64 sc_total; | ||
486 | __u64 sc_free; | ||
487 | __u64 sc_dinodes; | ||
488 | }; | ||
489 | |||
490 | /* | 395 | /* |
491 | * Quota change | 396 | * Quota change |
492 | * Describes an allocation change for a particular | 397 | * Describes an allocation change for a particular |
@@ -501,39 +406,12 @@ struct gfs2_quota_change { | |||
501 | __be32 qc_id; | 406 | __be32 qc_id; |
502 | }; | 407 | }; |
503 | 408 | ||
504 | struct gfs2_quota_change_host { | 409 | struct gfs2_quota_lvb { |
505 | __u64 qc_change; | 410 | __be32 qb_magic; |
506 | __u32 qc_flags; /* GFS2_QCF_... */ | 411 | __u32 __pad; |
507 | __u32 qc_id; | 412 | __be64 qb_limit; /* Hard limit of # blocks to alloc */ |
413 | __be64 qb_warn; /* Warn user when alloc is above this # */ | ||
414 | __be64 qb_value; /* Current # blocks allocated */ | ||
508 | }; | 415 | }; |
509 | 416 | ||
510 | #ifdef __KERNEL__ | ||
511 | /* Translation functions */ | ||
512 | |||
513 | extern void gfs2_inum_in(struct gfs2_inum_host *no, const void *buf); | ||
514 | extern void gfs2_inum_out(const struct gfs2_inum_host *no, void *buf); | ||
515 | extern void gfs2_sb_in(struct gfs2_sb_host *sb, const void *buf); | ||
516 | extern void gfs2_rindex_in(struct gfs2_rindex_host *ri, const void *buf); | ||
517 | extern void gfs2_rindex_out(const struct gfs2_rindex_host *ri, void *buf); | ||
518 | extern void gfs2_rgrp_in(struct gfs2_rgrp_host *rg, const void *buf); | ||
519 | extern void gfs2_rgrp_out(const struct gfs2_rgrp_host *rg, void *buf); | ||
520 | extern void gfs2_quota_in(struct gfs2_quota_host *qu, const void *buf); | ||
521 | struct gfs2_inode; | ||
522 | extern void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf); | ||
523 | extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, const void *buf); | ||
524 | extern void gfs2_ea_header_out(const struct gfs2_ea_header *ea, void *buf); | ||
525 | extern void gfs2_log_header_in(struct gfs2_log_header_host *lh, const void *buf); | ||
526 | extern void gfs2_inum_range_in(struct gfs2_inum_range_host *ir, const void *buf); | ||
527 | extern void gfs2_inum_range_out(const struct gfs2_inum_range_host *ir, void *buf); | ||
528 | extern void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf); | ||
529 | extern void gfs2_statfs_change_out(const struct gfs2_statfs_change_host *sc, void *buf); | ||
530 | extern void gfs2_quota_change_in(struct gfs2_quota_change_host *qc, const void *buf); | ||
531 | |||
532 | /* Printing functions */ | ||
533 | |||
534 | extern void gfs2_rindex_print(const struct gfs2_rindex_host *ri); | ||
535 | extern void gfs2_dinode_print(const struct gfs2_inode *ip); | ||
536 | |||
537 | #endif /* __KERNEL__ */ | ||
538 | |||
539 | #endif /* __GFS2_ONDISK_DOT_H__ */ | 417 | #endif /* __GFS2_ONDISK_DOT_H__ */ |
diff --git a/include/linux/gpio_mouse.h b/include/linux/gpio_mouse.h new file mode 100644 index 000000000000..44ed7aa14d85 --- /dev/null +++ b/include/linux/gpio_mouse.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * Driver for simulating a mouse on GPIO lines. | ||
3 | * | ||
4 | * Copyright (C) 2007 Atmel Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef _GPIO_MOUSE_H | ||
12 | #define _GPIO_MOUSE_H | ||
13 | |||
14 | #define GPIO_MOUSE_POLARITY_ACT_HIGH 0x00 | ||
15 | #define GPIO_MOUSE_POLARITY_ACT_LOW 0x01 | ||
16 | |||
17 | #define GPIO_MOUSE_PIN_UP 0 | ||
18 | #define GPIO_MOUSE_PIN_DOWN 1 | ||
19 | #define GPIO_MOUSE_PIN_LEFT 2 | ||
20 | #define GPIO_MOUSE_PIN_RIGHT 3 | ||
21 | #define GPIO_MOUSE_PIN_BLEFT 4 | ||
22 | #define GPIO_MOUSE_PIN_BMIDDLE 5 | ||
23 | #define GPIO_MOUSE_PIN_BRIGHT 6 | ||
24 | #define GPIO_MOUSE_PIN_MAX 7 | ||
25 | |||
26 | /** | ||
27 | * struct gpio_mouse_platform_data | ||
28 | * @scan_ms: integer in ms specifying the scan periode. | ||
29 | * @polarity: Pin polarity, active high or low. | ||
30 | * @up: GPIO line for up value. | ||
31 | * @down: GPIO line for down value. | ||
32 | * @left: GPIO line for left value. | ||
33 | * @right: GPIO line for right value. | ||
34 | * @bleft: GPIO line for left button. | ||
35 | * @bmiddle: GPIO line for middle button. | ||
36 | * @bright: GPIO line for right button. | ||
37 | * | ||
38 | * This struct must be added to the platform_device in the board code. | ||
39 | * It is used by the gpio_mouse driver to setup GPIO lines and to | ||
40 | * calculate mouse movement. | ||
41 | */ | ||
42 | struct gpio_mouse_platform_data { | ||
43 | int scan_ms; | ||
44 | int polarity; | ||
45 | |||
46 | union { | ||
47 | struct { | ||
48 | int up; | ||
49 | int down; | ||
50 | int left; | ||
51 | int right; | ||
52 | |||
53 | int bleft; | ||
54 | int bmiddle; | ||
55 | int bright; | ||
56 | }; | ||
57 | int pins[GPIO_MOUSE_PIN_MAX]; | ||
58 | }; | ||
59 | }; | ||
60 | |||
61 | #endif /* _GPIO_MOUSE_H */ | ||
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 7803014f3a11..8d302298a161 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -79,6 +79,19 @@ | |||
79 | #endif | 79 | #endif |
80 | 80 | ||
81 | #ifdef CONFIG_PREEMPT | 81 | #ifdef CONFIG_PREEMPT |
82 | # define PREEMPT_CHECK_OFFSET 1 | ||
83 | #else | ||
84 | # define PREEMPT_CHECK_OFFSET 0 | ||
85 | #endif | ||
86 | |||
87 | /* | ||
88 | * Check whether we were atomic before we did preempt_disable(): | ||
89 | * (used by the scheduler) | ||
90 | */ | ||
91 | #define in_atomic_preempt_off() \ | ||
92 | ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET) | ||
93 | |||
94 | #ifdef CONFIG_PREEMPT | ||
82 | # define preemptible() (preempt_count() == 0 && !irqs_disabled()) | 95 | # define preemptible() (preempt_count() == 0 && !irqs_disabled()) |
83 | # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) | 96 | # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) |
84 | #else | 97 | #else |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 827ee748fd4c..898103b401f1 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -263,19 +263,28 @@ struct hid_item { | |||
263 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 | 263 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 |
264 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 | 264 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 |
265 | #define HID_QUIRK_MIGHTYMOUSE 0x00000400 | 265 | #define HID_QUIRK_MIGHTYMOUSE 0x00000400 |
266 | #define HID_QUIRK_CYMOTION 0x00000800 | 266 | #define HID_QUIRK_POWERBOOK_HAS_FN 0x00000800 |
267 | #define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 | 267 | #define HID_QUIRK_POWERBOOK_FN_ON 0x00001000 |
268 | #define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 | 268 | #define HID_QUIRK_INVERT_HWHEEL 0x00002000 |
269 | #define HID_QUIRK_INVERT_HWHEEL 0x00004000 | 269 | #define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00004000 |
270 | #define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000 | 270 | #define HID_QUIRK_BAD_RELATIVE_KEYS 0x00008000 |
271 | #define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000 | 271 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 |
272 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00020000 | 272 | #define HID_QUIRK_IGNORE_MOUSE 0x00020000 |
273 | #define HID_QUIRK_IGNORE_MOUSE 0x00040000 | 273 | #define HID_QUIRK_SONY_PS3_CONTROLLER 0x00040000 |
274 | #define HID_QUIRK_SONY_PS3_CONTROLLER 0x00080000 | 274 | #define HID_QUIRK_DUPLICATE_USAGES 0x00080000 |
275 | #define HID_QUIRK_LOGITECH_DESCRIPTOR 0x00100000 | 275 | #define HID_QUIRK_RESET_LEDS 0x00100000 |
276 | #define HID_QUIRK_DUPLICATE_USAGES 0x00200000 | 276 | #define HID_QUIRK_HIDINPUT 0x00200000 |
277 | #define HID_QUIRK_RESET_LEDS 0x00400000 | 277 | #define HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL 0x00400000 |
278 | #define HID_QUIRK_SWAPPED_MIN_MAX 0x00800000 | 278 | #define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000 |
279 | |||
280 | /* | ||
281 | * Separate quirks for runtime report descriptor fixup | ||
282 | */ | ||
283 | |||
284 | #define HID_QUIRK_RDESC_CYMOTION 0x00000001 | ||
285 | #define HID_QUIRK_RDESC_LOGITECH 0x00000002 | ||
286 | #define HID_QUIRK_RDESC_SWAPPED_MIN_MAX 0x00000004 | ||
287 | #define HID_QUIRK_RDESC_PETALYNX 0x00000008 | ||
279 | 288 | ||
280 | /* | 289 | /* |
281 | * This is the global environment of the parser. This information is | 290 | * This is the global environment of the parser. This information is |
@@ -488,6 +497,11 @@ struct hid_descriptor { | |||
488 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) | 497 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) |
489 | 498 | ||
490 | /* HID core API */ | 499 | /* HID core API */ |
500 | |||
501 | #ifdef CONFIG_HID_DEBUG | ||
502 | extern int hid_debug; | ||
503 | #endif | ||
504 | |||
491 | extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); | 505 | extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); |
492 | extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); | 506 | extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); |
493 | extern int hidinput_connect(struct hid_device *); | 507 | extern int hidinput_connect(struct hid_device *); |
@@ -506,6 +520,7 @@ u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); | |||
506 | int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, const u32 quirks); | 520 | int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, const u32 quirks); |
507 | int usbhid_quirks_init(char **quirks_param); | 521 | int usbhid_quirks_init(char **quirks_param); |
508 | void usbhid_quirks_exit(void); | 522 | void usbhid_quirks_exit(void); |
523 | void usbhid_fixup_report_descriptor(const u16, const u16, char *, unsigned, char **); | ||
509 | 524 | ||
510 | #ifdef CONFIG_HID_FF | 525 | #ifdef CONFIG_HID_FF |
511 | int hid_ff_init(struct hid_device *hid); | 526 | int hid_ff_init(struct hid_device *hid); |
@@ -523,14 +538,19 @@ static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; } | |||
523 | #else | 538 | #else |
524 | static inline int hid_ff_init(struct hid_device *hid) { return -1; } | 539 | static inline int hid_ff_init(struct hid_device *hid) { return -1; } |
525 | #endif | 540 | #endif |
526 | #ifdef DEBUG | 541 | |
527 | #define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \ | 542 | #ifdef CONFIG_HID_DEBUG |
528 | __FILE__ , ## arg) | 543 | #define dbg_hid(format, arg...) if (hid_debug) \ |
544 | printk(KERN_DEBUG "%s: " format ,\ | ||
545 | __FILE__ , ## arg) | ||
546 | #define dbg_hid_line(format, arg...) if (hid_debug) \ | ||
547 | printk(format, ## arg) | ||
529 | #else | 548 | #else |
530 | #define dbg(format, arg...) do {} while (0) | 549 | #define dbg_hid(format, arg...) do {} while (0) |
550 | #define dbg_hid_line dbg_hid | ||
531 | #endif | 551 | #endif |
532 | 552 | ||
533 | #define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ | 553 | #define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ |
534 | __FILE__ , ## arg) | 554 | __FILE__ , ## arg) |
535 | #endif | 555 | #endif |
536 | 556 | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 1e365acdd369..19ab25804056 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <asm/system.h> | 25 | #include <asm/system.h> |
26 | #include <asm/io.h> | 26 | #include <asm/io.h> |
27 | #include <asm/semaphore.h> | 27 | #include <asm/semaphore.h> |
28 | #include <asm/mutex.h> | ||
28 | 29 | ||
29 | /****************************************************************************** | 30 | /****************************************************************************** |
30 | * IDE driver configuration options (play with these as desired): | 31 | * IDE driver configuration options (play with these as desired): |
@@ -685,6 +686,8 @@ typedef struct hwif_s { | |||
685 | u8 mwdma_mask; | 686 | u8 mwdma_mask; |
686 | u8 swdma_mask; | 687 | u8 swdma_mask; |
687 | 688 | ||
689 | u8 cbl; /* cable type */ | ||
690 | |||
688 | hwif_chipset_t chipset; /* sub-module for tuning.. */ | 691 | hwif_chipset_t chipset; /* sub-module for tuning.. */ |
689 | 692 | ||
690 | struct pci_dev *pci_dev; /* for pci chipsets */ | 693 | struct pci_dev *pci_dev; /* for pci chipsets */ |
@@ -735,8 +738,8 @@ typedef struct hwif_s { | |||
735 | void (*ide_dma_clear_irq)(ide_drive_t *drive); | 738 | void (*ide_dma_clear_irq)(ide_drive_t *drive); |
736 | void (*dma_host_on)(ide_drive_t *drive); | 739 | void (*dma_host_on)(ide_drive_t *drive); |
737 | void (*dma_host_off)(ide_drive_t *drive); | 740 | void (*dma_host_off)(ide_drive_t *drive); |
738 | int (*ide_dma_lostirq)(ide_drive_t *drive); | 741 | void (*dma_lost_irq)(ide_drive_t *drive); |
739 | int (*ide_dma_timeout)(ide_drive_t *drive); | 742 | void (*dma_timeout)(ide_drive_t *drive); |
740 | 743 | ||
741 | void (*OUTB)(u8 addr, unsigned long port); | 744 | void (*OUTB)(u8 addr, unsigned long port); |
742 | void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); | 745 | void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); |
@@ -791,7 +794,6 @@ typedef struct hwif_s { | |||
791 | unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ | 794 | unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ |
792 | unsigned reset : 1; /* reset after probe */ | 795 | unsigned reset : 1; /* reset after probe */ |
793 | unsigned autodma : 1; /* auto-attempt using DMA at boot */ | 796 | unsigned autodma : 1; /* auto-attempt using DMA at boot */ |
794 | unsigned udma_four : 1; /* 1=ATA-66 capable, 0=default */ | ||
795 | unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */ | 797 | unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */ |
796 | unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */ | 798 | unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */ |
797 | unsigned auto_poll : 1; /* supports nop auto-poll */ | 799 | unsigned auto_poll : 1; /* supports nop auto-poll */ |
@@ -863,7 +865,7 @@ typedef struct hwgroup_s { | |||
863 | 865 | ||
864 | typedef struct ide_driver_s ide_driver_t; | 866 | typedef struct ide_driver_s ide_driver_t; |
865 | 867 | ||
866 | extern struct semaphore ide_setting_sem; | 868 | extern struct mutex ide_setting_mtx; |
867 | 869 | ||
868 | int set_io_32bit(ide_drive_t *, int); | 870 | int set_io_32bit(ide_drive_t *, int); |
869 | int set_pio_mode(ide_drive_t *, int); | 871 | int set_pio_mode(ide_drive_t *, int); |
@@ -1304,8 +1306,8 @@ extern int __ide_dma_check(ide_drive_t *); | |||
1304 | extern int ide_dma_setup(ide_drive_t *); | 1306 | extern int ide_dma_setup(ide_drive_t *); |
1305 | extern void ide_dma_start(ide_drive_t *); | 1307 | extern void ide_dma_start(ide_drive_t *); |
1306 | extern int __ide_dma_end(ide_drive_t *); | 1308 | extern int __ide_dma_end(ide_drive_t *); |
1307 | extern int __ide_dma_lostirq(ide_drive_t *); | 1309 | extern void ide_dma_lost_irq(ide_drive_t *); |
1308 | extern int __ide_dma_timeout(ide_drive_t *); | 1310 | extern void ide_dma_timeout(ide_drive_t *); |
1309 | #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ | 1311 | #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ |
1310 | 1312 | ||
1311 | #else | 1313 | #else |
@@ -1382,11 +1384,11 @@ extern const ide_pio_timings_t ide_pio_timings[6]; | |||
1382 | 1384 | ||
1383 | 1385 | ||
1384 | extern spinlock_t ide_lock; | 1386 | extern spinlock_t ide_lock; |
1385 | extern struct semaphore ide_cfg_sem; | 1387 | extern struct mutex ide_cfg_mtx; |
1386 | /* | 1388 | /* |
1387 | * Structure locking: | 1389 | * Structure locking: |
1388 | * | 1390 | * |
1389 | * ide_cfg_sem and ide_lock together protect changes to | 1391 | * ide_cfg_mtx and ide_lock together protect changes to |
1390 | * ide_hwif_t->{next,hwgroup} | 1392 | * ide_hwif_t->{next,hwgroup} |
1391 | * ide_drive_t->next | 1393 | * ide_drive_t->next |
1392 | * | 1394 | * |
diff --git a/include/linux/input.h b/include/linux/input.h index be2bf3a2b031..18c98b543030 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -108,6 +108,13 @@ struct input_absinfo { | |||
108 | 108 | ||
109 | /* | 109 | /* |
110 | * Keys and buttons | 110 | * Keys and buttons |
111 | * | ||
112 | * Most of the keys/buttons are modeled after USB HUT 1.12 | ||
113 | * (see http://www.usb.org/developers/hidpage). | ||
114 | * Abbreviations in the comments: | ||
115 | * AC - Application Control | ||
116 | * AL - Application Launch Button | ||
117 | * SC - System Control | ||
111 | */ | 118 | */ |
112 | 119 | ||
113 | #define KEY_RESERVED 0 | 120 | #define KEY_RESERVED 0 |
@@ -226,7 +233,7 @@ struct input_absinfo { | |||
226 | #define KEY_MUTE 113 | 233 | #define KEY_MUTE 113 |
227 | #define KEY_VOLUMEDOWN 114 | 234 | #define KEY_VOLUMEDOWN 114 |
228 | #define KEY_VOLUMEUP 115 | 235 | #define KEY_VOLUMEUP 115 |
229 | #define KEY_POWER 116 | 236 | #define KEY_POWER 116 /* SC System Power Down */ |
230 | #define KEY_KPEQUAL 117 | 237 | #define KEY_KPEQUAL 117 |
231 | #define KEY_KPPLUSMINUS 118 | 238 | #define KEY_KPPLUSMINUS 118 |
232 | #define KEY_PAUSE 119 | 239 | #define KEY_PAUSE 119 |
@@ -240,38 +247,39 @@ struct input_absinfo { | |||
240 | #define KEY_RIGHTMETA 126 | 247 | #define KEY_RIGHTMETA 126 |
241 | #define KEY_COMPOSE 127 | 248 | #define KEY_COMPOSE 127 |
242 | 249 | ||
243 | #define KEY_STOP 128 | 250 | #define KEY_STOP 128 /* AC Stop */ |
244 | #define KEY_AGAIN 129 | 251 | #define KEY_AGAIN 129 |
245 | #define KEY_PROPS 130 | 252 | #define KEY_PROPS 130 /* AC Properties */ |
246 | #define KEY_UNDO 131 | 253 | #define KEY_UNDO 131 /* AC Undo */ |
247 | #define KEY_FRONT 132 | 254 | #define KEY_FRONT 132 |
248 | #define KEY_COPY 133 | 255 | #define KEY_COPY 133 /* AC Copy */ |
249 | #define KEY_OPEN 134 | 256 | #define KEY_OPEN 134 /* AC Open */ |
250 | #define KEY_PASTE 135 | 257 | #define KEY_PASTE 135 /* AC Paste */ |
251 | #define KEY_FIND 136 | 258 | #define KEY_FIND 136 /* AC Search */ |
252 | #define KEY_CUT 137 | 259 | #define KEY_CUT 137 /* AC Cut */ |
253 | #define KEY_HELP 138 | 260 | #define KEY_HELP 138 /* AL Integrated Help Center */ |
254 | #define KEY_MENU 139 | 261 | #define KEY_MENU 139 /* Menu (show menu) */ |
255 | #define KEY_CALC 140 | 262 | #define KEY_CALC 140 /* AL Calculator */ |
256 | #define KEY_SETUP 141 | 263 | #define KEY_SETUP 141 |
257 | #define KEY_SLEEP 142 | 264 | #define KEY_SLEEP 142 /* SC System Sleep */ |
258 | #define KEY_WAKEUP 143 | 265 | #define KEY_WAKEUP 143 /* System Wake Up */ |
259 | #define KEY_FILE 144 | 266 | #define KEY_FILE 144 /* AL Local Machine Browser */ |
260 | #define KEY_SENDFILE 145 | 267 | #define KEY_SENDFILE 145 |
261 | #define KEY_DELETEFILE 146 | 268 | #define KEY_DELETEFILE 146 |
262 | #define KEY_XFER 147 | 269 | #define KEY_XFER 147 |
263 | #define KEY_PROG1 148 | 270 | #define KEY_PROG1 148 |
264 | #define KEY_PROG2 149 | 271 | #define KEY_PROG2 149 |
265 | #define KEY_WWW 150 | 272 | #define KEY_WWW 150 /* AL Internet Browser */ |
266 | #define KEY_MSDOS 151 | 273 | #define KEY_MSDOS 151 |
267 | #define KEY_COFFEE 152 | 274 | #define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */ |
275 | #define KEY_SCREENLOCK KEY_COFFEE | ||
268 | #define KEY_DIRECTION 153 | 276 | #define KEY_DIRECTION 153 |
269 | #define KEY_CYCLEWINDOWS 154 | 277 | #define KEY_CYCLEWINDOWS 154 |
270 | #define KEY_MAIL 155 | 278 | #define KEY_MAIL 155 |
271 | #define KEY_BOOKMARKS 156 | 279 | #define KEY_BOOKMARKS 156 /* AC Bookmarks */ |
272 | #define KEY_COMPUTER 157 | 280 | #define KEY_COMPUTER 157 |
273 | #define KEY_BACK 158 | 281 | #define KEY_BACK 158 /* AC Back */ |
274 | #define KEY_FORWARD 159 | 282 | #define KEY_FORWARD 159 /* AC Forward */ |
275 | #define KEY_CLOSECD 160 | 283 | #define KEY_CLOSECD 160 |
276 | #define KEY_EJECTCD 161 | 284 | #define KEY_EJECTCD 161 |
277 | #define KEY_EJECTCLOSECD 162 | 285 | #define KEY_EJECTCLOSECD 162 |
@@ -281,20 +289,20 @@ struct input_absinfo { | |||
281 | #define KEY_STOPCD 166 | 289 | #define KEY_STOPCD 166 |
282 | #define KEY_RECORD 167 | 290 | #define KEY_RECORD 167 |
283 | #define KEY_REWIND 168 | 291 | #define KEY_REWIND 168 |
284 | #define KEY_PHONE 169 | 292 | #define KEY_PHONE 169 /* Media Select Telephone */ |
285 | #define KEY_ISO 170 | 293 | #define KEY_ISO 170 |
286 | #define KEY_CONFIG 171 | 294 | #define KEY_CONFIG 171 /* AL Consumer Control Configuration */ |
287 | #define KEY_HOMEPAGE 172 | 295 | #define KEY_HOMEPAGE 172 /* AC Home */ |
288 | #define KEY_REFRESH 173 | 296 | #define KEY_REFRESH 173 /* AC Refresh */ |
289 | #define KEY_EXIT 174 | 297 | #define KEY_EXIT 174 /* AC Exit */ |
290 | #define KEY_MOVE 175 | 298 | #define KEY_MOVE 175 |
291 | #define KEY_EDIT 176 | 299 | #define KEY_EDIT 176 |
292 | #define KEY_SCROLLUP 177 | 300 | #define KEY_SCROLLUP 177 |
293 | #define KEY_SCROLLDOWN 178 | 301 | #define KEY_SCROLLDOWN 178 |
294 | #define KEY_KPLEFTPAREN 179 | 302 | #define KEY_KPLEFTPAREN 179 |
295 | #define KEY_KPRIGHTPAREN 180 | 303 | #define KEY_KPRIGHTPAREN 180 |
296 | #define KEY_NEW 181 | 304 | #define KEY_NEW 181 /* AC New */ |
297 | #define KEY_REDO 182 | 305 | #define KEY_REDO 182 /* AC Redo/Repeat */ |
298 | 306 | ||
299 | #define KEY_F13 183 | 307 | #define KEY_F13 183 |
300 | #define KEY_F14 184 | 308 | #define KEY_F14 184 |
@@ -314,11 +322,11 @@ struct input_absinfo { | |||
314 | #define KEY_PROG3 202 | 322 | #define KEY_PROG3 202 |
315 | #define KEY_PROG4 203 | 323 | #define KEY_PROG4 203 |
316 | #define KEY_SUSPEND 205 | 324 | #define KEY_SUSPEND 205 |
317 | #define KEY_CLOSE 206 | 325 | #define KEY_CLOSE 206 /* AC Close */ |
318 | #define KEY_PLAY 207 | 326 | #define KEY_PLAY 207 |
319 | #define KEY_FASTFORWARD 208 | 327 | #define KEY_FASTFORWARD 208 |
320 | #define KEY_BASSBOOST 209 | 328 | #define KEY_BASSBOOST 209 |
321 | #define KEY_PRINT 210 | 329 | #define KEY_PRINT 210 /* AC Print */ |
322 | #define KEY_HP 211 | 330 | #define KEY_HP 211 |
323 | #define KEY_CAMERA 212 | 331 | #define KEY_CAMERA 212 |
324 | #define KEY_SOUND 213 | 332 | #define KEY_SOUND 213 |
@@ -327,11 +335,11 @@ struct input_absinfo { | |||
327 | #define KEY_CHAT 216 | 335 | #define KEY_CHAT 216 |
328 | #define KEY_SEARCH 217 | 336 | #define KEY_SEARCH 217 |
329 | #define KEY_CONNECT 218 | 337 | #define KEY_CONNECT 218 |
330 | #define KEY_FINANCE 219 | 338 | #define KEY_FINANCE 219 /* AL Checkbook/Finance */ |
331 | #define KEY_SPORT 220 | 339 | #define KEY_SPORT 220 |
332 | #define KEY_SHOP 221 | 340 | #define KEY_SHOP 221 |
333 | #define KEY_ALTERASE 222 | 341 | #define KEY_ALTERASE 222 |
334 | #define KEY_CANCEL 223 | 342 | #define KEY_CANCEL 223 /* AC Cancel */ |
335 | #define KEY_BRIGHTNESSDOWN 224 | 343 | #define KEY_BRIGHTNESSDOWN 224 |
336 | #define KEY_BRIGHTNESSUP 225 | 344 | #define KEY_BRIGHTNESSUP 225 |
337 | #define KEY_MEDIA 226 | 345 | #define KEY_MEDIA 226 |
@@ -341,10 +349,10 @@ struct input_absinfo { | |||
341 | #define KEY_KBDILLUMDOWN 229 | 349 | #define KEY_KBDILLUMDOWN 229 |
342 | #define KEY_KBDILLUMUP 230 | 350 | #define KEY_KBDILLUMUP 230 |
343 | 351 | ||
344 | #define KEY_SEND 231 | 352 | #define KEY_SEND 231 /* AC Send */ |
345 | #define KEY_REPLY 232 | 353 | #define KEY_REPLY 232 /* AC Reply */ |
346 | #define KEY_FORWARDMAIL 233 | 354 | #define KEY_FORWARDMAIL 233 /* AC Forward Msg */ |
347 | #define KEY_SAVE 234 | 355 | #define KEY_SAVE 234 /* AC Save */ |
348 | #define KEY_DOCUMENTS 235 | 356 | #define KEY_DOCUMENTS 235 |
349 | 357 | ||
350 | #define KEY_BATTERY 236 | 358 | #define KEY_BATTERY 236 |
@@ -433,15 +441,15 @@ struct input_absinfo { | |||
433 | #define KEY_CLEAR 0x163 | 441 | #define KEY_CLEAR 0x163 |
434 | #define KEY_POWER2 0x164 | 442 | #define KEY_POWER2 0x164 |
435 | #define KEY_OPTION 0x165 | 443 | #define KEY_OPTION 0x165 |
436 | #define KEY_INFO 0x166 | 444 | #define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */ |
437 | #define KEY_TIME 0x167 | 445 | #define KEY_TIME 0x167 |
438 | #define KEY_VENDOR 0x168 | 446 | #define KEY_VENDOR 0x168 |
439 | #define KEY_ARCHIVE 0x169 | 447 | #define KEY_ARCHIVE 0x169 |
440 | #define KEY_PROGRAM 0x16a | 448 | #define KEY_PROGRAM 0x16a /* Media Select Program Guide */ |
441 | #define KEY_CHANNEL 0x16b | 449 | #define KEY_CHANNEL 0x16b |
442 | #define KEY_FAVORITES 0x16c | 450 | #define KEY_FAVORITES 0x16c |
443 | #define KEY_EPG 0x16d | 451 | #define KEY_EPG 0x16d |
444 | #define KEY_PVR 0x16e | 452 | #define KEY_PVR 0x16e /* Media Select Home */ |
445 | #define KEY_MHP 0x16f | 453 | #define KEY_MHP 0x16f |
446 | #define KEY_LANGUAGE 0x170 | 454 | #define KEY_LANGUAGE 0x170 |
447 | #define KEY_TITLE 0x171 | 455 | #define KEY_TITLE 0x171 |
@@ -451,36 +459,36 @@ struct input_absinfo { | |||
451 | #define KEY_MODE 0x175 | 459 | #define KEY_MODE 0x175 |
452 | #define KEY_KEYBOARD 0x176 | 460 | #define KEY_KEYBOARD 0x176 |
453 | #define KEY_SCREEN 0x177 | 461 | #define KEY_SCREEN 0x177 |
454 | #define KEY_PC 0x178 | 462 | #define KEY_PC 0x178 /* Media Select Computer */ |
455 | #define KEY_TV 0x179 | 463 | #define KEY_TV 0x179 /* Media Select TV */ |
456 | #define KEY_TV2 0x17a | 464 | #define KEY_TV2 0x17a /* Media Select Cable */ |
457 | #define KEY_VCR 0x17b | 465 | #define KEY_VCR 0x17b /* Media Select VCR */ |
458 | #define KEY_VCR2 0x17c | 466 | #define KEY_VCR2 0x17c /* VCR Plus */ |
459 | #define KEY_SAT 0x17d | 467 | #define KEY_SAT 0x17d /* Media Select Satellite */ |
460 | #define KEY_SAT2 0x17e | 468 | #define KEY_SAT2 0x17e |
461 | #define KEY_CD 0x17f | 469 | #define KEY_CD 0x17f /* Media Select CD */ |
462 | #define KEY_TAPE 0x180 | 470 | #define KEY_TAPE 0x180 /* Media Select Tape */ |
463 | #define KEY_RADIO 0x181 | 471 | #define KEY_RADIO 0x181 |
464 | #define KEY_TUNER 0x182 | 472 | #define KEY_TUNER 0x182 /* Media Select Tuner */ |
465 | #define KEY_PLAYER 0x183 | 473 | #define KEY_PLAYER 0x183 |
466 | #define KEY_TEXT 0x184 | 474 | #define KEY_TEXT 0x184 |
467 | #define KEY_DVD 0x185 | 475 | #define KEY_DVD 0x185 /* Media Select DVD */ |
468 | #define KEY_AUX 0x186 | 476 | #define KEY_AUX 0x186 |
469 | #define KEY_MP3 0x187 | 477 | #define KEY_MP3 0x187 |
470 | #define KEY_AUDIO 0x188 | 478 | #define KEY_AUDIO 0x188 |
471 | #define KEY_VIDEO 0x189 | 479 | #define KEY_VIDEO 0x189 |
472 | #define KEY_DIRECTORY 0x18a | 480 | #define KEY_DIRECTORY 0x18a |
473 | #define KEY_LIST 0x18b | 481 | #define KEY_LIST 0x18b |
474 | #define KEY_MEMO 0x18c | 482 | #define KEY_MEMO 0x18c /* Media Select Messages */ |
475 | #define KEY_CALENDAR 0x18d | 483 | #define KEY_CALENDAR 0x18d |
476 | #define KEY_RED 0x18e | 484 | #define KEY_RED 0x18e |
477 | #define KEY_GREEN 0x18f | 485 | #define KEY_GREEN 0x18f |
478 | #define KEY_YELLOW 0x190 | 486 | #define KEY_YELLOW 0x190 |
479 | #define KEY_BLUE 0x191 | 487 | #define KEY_BLUE 0x191 |
480 | #define KEY_CHANNELUP 0x192 | 488 | #define KEY_CHANNELUP 0x192 /* Channel Increment */ |
481 | #define KEY_CHANNELDOWN 0x193 | 489 | #define KEY_CHANNELDOWN 0x193 /* Channel Decrement */ |
482 | #define KEY_FIRST 0x194 | 490 | #define KEY_FIRST 0x194 |
483 | #define KEY_LAST 0x195 | 491 | #define KEY_LAST 0x195 /* Recall Last */ |
484 | #define KEY_AB 0x196 | 492 | #define KEY_AB 0x196 |
485 | #define KEY_NEXT 0x197 | 493 | #define KEY_NEXT 0x197 |
486 | #define KEY_RESTART 0x198 | 494 | #define KEY_RESTART 0x198 |
@@ -491,21 +499,21 @@ struct input_absinfo { | |||
491 | #define KEY_DIGITS 0x19d | 499 | #define KEY_DIGITS 0x19d |
492 | #define KEY_TEEN 0x19e | 500 | #define KEY_TEEN 0x19e |
493 | #define KEY_TWEN 0x19f | 501 | #define KEY_TWEN 0x19f |
494 | #define KEY_VIDEOPHONE 0x1a0 | 502 | #define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */ |
495 | #define KEY_GAMES 0x1a1 | 503 | #define KEY_GAMES 0x1a1 /* Media Select Games */ |
496 | #define KEY_ZOOMIN 0x1a2 | 504 | #define KEY_ZOOMIN 0x1a2 /* AC Zoom In */ |
497 | #define KEY_ZOOMOUT 0x1a3 | 505 | #define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */ |
498 | #define KEY_ZOOMRESET 0x1a4 | 506 | #define KEY_ZOOMRESET 0x1a4 /* AC Zoom */ |
499 | #define KEY_WORDPROCESSOR 0x1a5 | 507 | #define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */ |
500 | #define KEY_EDITOR 0x1a6 | 508 | #define KEY_EDITOR 0x1a6 /* AL Text Editor */ |
501 | #define KEY_SPREADSHEET 0x1a7 | 509 | #define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */ |
502 | #define KEY_GRAPHICSEDITOR 0x1a8 | 510 | #define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */ |
503 | #define KEY_PRESENTATION 0x1a9 | 511 | #define KEY_PRESENTATION 0x1a9 /* AL Presentation App */ |
504 | #define KEY_DATABASE 0x1aa | 512 | #define KEY_DATABASE 0x1aa /* AL Database App */ |
505 | #define KEY_NEWS 0x1ab | 513 | #define KEY_NEWS 0x1ab /* AL Newsreader */ |
506 | #define KEY_VOICEMAIL 0x1ac | 514 | #define KEY_VOICEMAIL 0x1ac /* AL Voicemail */ |
507 | #define KEY_ADDRESSBOOK 0x1ad | 515 | #define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */ |
508 | #define KEY_MESSENGER 0x1ae | 516 | #define KEY_MESSENGER 0x1ae /* AL Instant Messaging */ |
509 | #define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ | 517 | #define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ |
510 | 518 | ||
511 | #define KEY_DEL_EOL 0x1c0 | 519 | #define KEY_DEL_EOL 0x1c0 |
@@ -603,6 +611,7 @@ struct input_absinfo { | |||
603 | #define SW_LID 0x00 /* set = lid shut */ | 611 | #define SW_LID 0x00 /* set = lid shut */ |
604 | #define SW_TABLET_MODE 0x01 /* set = tablet mode */ | 612 | #define SW_TABLET_MODE 0x01 /* set = tablet mode */ |
605 | #define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ | 613 | #define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ |
614 | #define SW_RADIO 0x03 /* set = radio enabled */ | ||
606 | #define SW_MAX 0x0f | 615 | #define SW_MAX 0x0f |
607 | 616 | ||
608 | /* | 617 | /* |
@@ -972,15 +981,15 @@ struct input_dev { | |||
972 | struct mutex mutex; /* serializes open and close operations */ | 981 | struct mutex mutex; /* serializes open and close operations */ |
973 | unsigned int users; | 982 | unsigned int users; |
974 | 983 | ||
975 | struct class_device cdev; | 984 | struct device dev; |
976 | union { /* temporarily so while we switching to struct device */ | 985 | union { /* temporarily so while we switching to struct device */ |
977 | struct device *parent; | 986 | struct device *dev; |
978 | } dev; | 987 | } cdev; |
979 | 988 | ||
980 | struct list_head h_list; | 989 | struct list_head h_list; |
981 | struct list_head node; | 990 | struct list_head node; |
982 | }; | 991 | }; |
983 | #define to_input_dev(d) container_of(d, struct input_dev, cdev) | 992 | #define to_input_dev(d) container_of(d, struct input_dev, dev) |
984 | 993 | ||
985 | /* | 994 | /* |
986 | * Verify that we are in sync with input_device_id mod_devicetable.h #defines | 995 | * Verify that we are in sync with input_device_id mod_devicetable.h #defines |
@@ -1087,22 +1096,22 @@ struct input_handle { | |||
1087 | struct list_head h_node; | 1096 | struct list_head h_node; |
1088 | }; | 1097 | }; |
1089 | 1098 | ||
1090 | #define to_dev(n) container_of(n,struct input_dev,node) | 1099 | #define to_dev(n) container_of(n, struct input_dev, node) |
1091 | #define to_handler(n) container_of(n,struct input_handler,node) | 1100 | #define to_handler(n) container_of(n, struct input_handler, node) |
1092 | #define to_handle(n) container_of(n,struct input_handle,d_node) | 1101 | #define to_handle(n) container_of(n, struct input_handle, d_node) |
1093 | #define to_handle_h(n) container_of(n,struct input_handle,h_node) | 1102 | #define to_handle_h(n) container_of(n, struct input_handle, h_node) |
1094 | 1103 | ||
1095 | struct input_dev *input_allocate_device(void); | 1104 | struct input_dev *input_allocate_device(void); |
1096 | void input_free_device(struct input_dev *dev); | 1105 | void input_free_device(struct input_dev *dev); |
1097 | 1106 | ||
1098 | static inline struct input_dev *input_get_device(struct input_dev *dev) | 1107 | static inline struct input_dev *input_get_device(struct input_dev *dev) |
1099 | { | 1108 | { |
1100 | return to_input_dev(class_device_get(&dev->cdev)); | 1109 | return to_input_dev(get_device(&dev->dev)); |
1101 | } | 1110 | } |
1102 | 1111 | ||
1103 | static inline void input_put_device(struct input_dev *dev) | 1112 | static inline void input_put_device(struct input_dev *dev) |
1104 | { | 1113 | { |
1105 | class_device_put(&dev->cdev); | 1114 | put_device(&dev->dev); |
1106 | } | 1115 | } |
1107 | 1116 | ||
1108 | static inline void *input_get_drvdata(struct input_dev *dev) | 1117 | static inline void *input_get_drvdata(struct input_dev *dev) |
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h index 8e2042b9d471..2eaa142cd061 100644 --- a/include/linux/ioprio.h +++ b/include/linux/ioprio.h | |||
@@ -47,8 +47,10 @@ enum { | |||
47 | #define IOPRIO_NORM (4) | 47 | #define IOPRIO_NORM (4) |
48 | static inline int task_ioprio(struct task_struct *task) | 48 | static inline int task_ioprio(struct task_struct *task) |
49 | { | 49 | { |
50 | WARN_ON(!ioprio_valid(task->ioprio)); | 50 | if (ioprio_valid(task->ioprio)) |
51 | return IOPRIO_PRIO_DATA(task->ioprio); | 51 | return IOPRIO_PRIO_DATA(task->ioprio); |
52 | |||
53 | return IOPRIO_NORM; | ||
52 | } | 54 | } |
53 | 55 | ||
54 | static inline int task_nice_ioprio(struct task_struct *task) | 56 | static inline int task_nice_ioprio(struct task_struct *task) |
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 12178d2c882b..5f06527dca21 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #ifndef _LINUX_KALLSYMS_H | 5 | #ifndef _LINUX_KALLSYMS_H |
6 | #define _LINUX_KALLSYMS_H | 6 | #define _LINUX_KALLSYMS_H |
7 | 7 | ||
8 | #include <linux/errno.h> | ||
8 | 9 | ||
9 | #define KSYM_NAME_LEN 127 | 10 | #define KSYM_NAME_LEN 127 |
10 | #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + KSYM_NAME_LEN + \ | 11 | #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + KSYM_NAME_LEN + \ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 620da7be07b7..a3df64677ac3 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -116,6 +116,7 @@ static inline struct device *pci_dev_to_dev(struct pci_dev *pdev) | |||
116 | enum { | 116 | enum { |
117 | /* various global constants */ | 117 | /* various global constants */ |
118 | LIBATA_MAX_PRD = ATA_MAX_PRD / 2, | 118 | LIBATA_MAX_PRD = ATA_MAX_PRD / 2, |
119 | LIBATA_DUMB_MAX_PRD = ATA_MAX_PRD / 4, /* Worst case */ | ||
119 | ATA_MAX_PORTS = 8, | 120 | ATA_MAX_PORTS = 8, |
120 | ATA_DEF_QUEUE = 1, | 121 | ATA_DEF_QUEUE = 1, |
121 | /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */ | 122 | /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */ |
@@ -136,6 +137,8 @@ enum { | |||
136 | ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */ | 137 | ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */ |
137 | ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */ | 138 | ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */ |
138 | ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */ | 139 | ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */ |
140 | ATA_DFLAG_ACPI_PENDING = (1 << 5), /* ACPI resume action pending */ | ||
141 | ATA_DFLAG_ACPI_FAILED = (1 << 6), /* ACPI on devcfg has failed */ | ||
139 | ATA_DFLAG_CFG_MASK = (1 << 8) - 1, | 142 | ATA_DFLAG_CFG_MASK = (1 << 8) - 1, |
140 | 143 | ||
141 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ | 144 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ |
@@ -196,6 +199,7 @@ enum { | |||
196 | ATA_PFLAG_FLUSH_PORT_TASK = (1 << 16), /* flush port task */ | 199 | ATA_PFLAG_FLUSH_PORT_TASK = (1 << 16), /* flush port task */ |
197 | ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ | 200 | ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ |
198 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ | 201 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ |
202 | ATA_PFLAG_GTM_VALID = (1 << 19), /* acpi_gtm data valid */ | ||
199 | 203 | ||
200 | /* struct ata_queued_cmd flags */ | 204 | /* struct ata_queued_cmd flags */ |
201 | ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ | 205 | ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ |
@@ -363,6 +367,9 @@ struct ata_host { | |||
363 | void *private_data; | 367 | void *private_data; |
364 | const struct ata_port_operations *ops; | 368 | const struct ata_port_operations *ops; |
365 | unsigned long flags; | 369 | unsigned long flags; |
370 | #ifdef CONFIG_ATA_ACPI | ||
371 | acpi_handle acpi_handle; | ||
372 | #endif | ||
366 | struct ata_port *simplex_claimed; /* channel owning the DMA */ | 373 | struct ata_port *simplex_claimed; /* channel owning the DMA */ |
367 | struct ata_port *ports[0]; | 374 | struct ata_port *ports[0]; |
368 | }; | 375 | }; |
@@ -429,6 +436,9 @@ struct ata_device { | |||
429 | unsigned int devno; /* 0 or 1 */ | 436 | unsigned int devno; /* 0 or 1 */ |
430 | unsigned long flags; /* ATA_DFLAG_xxx */ | 437 | unsigned long flags; /* ATA_DFLAG_xxx */ |
431 | struct scsi_device *sdev; /* attached SCSI device */ | 438 | struct scsi_device *sdev; /* attached SCSI device */ |
439 | #ifdef CONFIG_ATA_ACPI | ||
440 | acpi_handle acpi_handle; | ||
441 | #endif | ||
432 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ | 442 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ |
433 | u64 n_sectors; /* size of device, if ATA */ | 443 | u64 n_sectors; /* size of device, if ATA */ |
434 | unsigned int class; /* ATA_DEV_xxx */ | 444 | unsigned int class; /* ATA_DEV_xxx */ |
@@ -457,10 +467,6 @@ struct ata_device { | |||
457 | struct ata_ering ering; | 467 | struct ata_ering ering; |
458 | int spdn_cnt; | 468 | int spdn_cnt; |
459 | unsigned int horkage; /* List of broken features */ | 469 | unsigned int horkage; /* List of broken features */ |
460 | #ifdef CONFIG_ATA_ACPI | ||
461 | /* ACPI objects info */ | ||
462 | acpi_handle obj_handle; | ||
463 | #endif | ||
464 | }; | 470 | }; |
465 | 471 | ||
466 | /* Offset into struct ata_device. Fields above it are maintained | 472 | /* Offset into struct ata_device. Fields above it are maintained |
@@ -489,6 +495,17 @@ struct ata_eh_context { | |||
489 | unsigned int did_probe_mask; | 495 | unsigned int did_probe_mask; |
490 | }; | 496 | }; |
491 | 497 | ||
498 | struct ata_acpi_drive | ||
499 | { | ||
500 | u32 pio; | ||
501 | u32 dma; | ||
502 | } __packed; | ||
503 | |||
504 | struct ata_acpi_gtm { | ||
505 | struct ata_acpi_drive drive[2]; | ||
506 | u32 flags; | ||
507 | } __packed; | ||
508 | |||
492 | struct ata_port { | 509 | struct ata_port { |
493 | struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ | 510 | struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ |
494 | const struct ata_port_operations *ops; | 511 | const struct ata_port_operations *ops; |
@@ -549,6 +566,10 @@ struct ata_port { | |||
549 | 566 | ||
550 | void *private_data; | 567 | void *private_data; |
551 | 568 | ||
569 | #ifdef CONFIG_ATA_ACPI | ||
570 | acpi_handle acpi_handle; | ||
571 | struct ata_acpi_gtm acpi_gtm; | ||
572 | #endif | ||
552 | u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ | 573 | u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ |
553 | }; | 574 | }; |
554 | 575 | ||
@@ -758,6 +779,7 @@ extern void ata_data_xfer(struct ata_device *adev, unsigned char *buf, | |||
758 | unsigned int buflen, int write_data); | 779 | unsigned int buflen, int write_data); |
759 | extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf, | 780 | extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf, |
760 | unsigned int buflen, int write_data); | 781 | unsigned int buflen, int write_data); |
782 | extern void ata_dumb_qc_prep(struct ata_queued_cmd *qc); | ||
761 | extern void ata_qc_prep(struct ata_queued_cmd *qc); | 783 | extern void ata_qc_prep(struct ata_queued_cmd *qc); |
762 | extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); | 784 | extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); |
763 | extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); | 785 | extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); |
diff --git a/include/linux/lzo.h b/include/linux/lzo.h new file mode 100644 index 000000000000..582d8b711a13 --- /dev/null +++ b/include/linux/lzo.h | |||
@@ -0,0 +1,44 @@ | |||
1 | #ifndef __LZO_H__ | ||
2 | #define __LZO_H__ | ||
3 | /* | ||
4 | * LZO Public Kernel Interface | ||
5 | * A mini subset of the LZO real-time data compression library | ||
6 | * | ||
7 | * Copyright (C) 1996-2005 Markus F.X.J. Oberhumer <markus@oberhumer.com> | ||
8 | * | ||
9 | * The full LZO package can be found at: | ||
10 | * http://www.oberhumer.com/opensource/lzo/ | ||
11 | * | ||
12 | * Changed for kernel use by: | ||
13 | * Nitin Gupta <nitingupta910@gmail.com> | ||
14 | * Richard Purdie <rpurdie@openedhand.com> | ||
15 | */ | ||
16 | |||
17 | #define LZO1X_MEM_COMPRESS (16384 * sizeof(unsigned char *)) | ||
18 | #define LZO1X_1_MEM_COMPRESS LZO1X_MEM_COMPRESS | ||
19 | |||
20 | #define lzo1x_worst_compress(x) (x + (x / 64) + 16 + 3) | ||
21 | |||
22 | /* This requires 'workmem' of size LZO1X_1_MEM_COMPRESS */ | ||
23 | int lzo1x_1_compress(const unsigned char *src, size_t src_len, | ||
24 | unsigned char *dst, size_t *dst_len, void *wrkmem); | ||
25 | |||
26 | /* safe decompression with overrun testing */ | ||
27 | int lzo1x_decompress_safe(const unsigned char *src, size_t src_len, | ||
28 | unsigned char *dst, size_t *dst_len); | ||
29 | |||
30 | /* | ||
31 | * Return values (< 0 = Error) | ||
32 | */ | ||
33 | #define LZO_E_OK 0 | ||
34 | #define LZO_E_ERROR (-1) | ||
35 | #define LZO_E_OUT_OF_MEMORY (-2) | ||
36 | #define LZO_E_NOT_COMPRESSIBLE (-3) | ||
37 | #define LZO_E_INPUT_OVERRUN (-4) | ||
38 | #define LZO_E_OUTPUT_OVERRUN (-5) | ||
39 | #define LZO_E_LOOKBEHIND_OVERRUN (-6) | ||
40 | #define LZO_E_EOF_NOT_FOUND (-7) | ||
41 | #define LZO_E_INPUT_NOT_CONSUMED (-8) | ||
42 | #define LZO_E_NOT_YET_IMPLEMENTED (-9) | ||
43 | |||
44 | #endif | ||
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h index c6d4ab86b83c..b021b3a2b65a 100644 --- a/include/linux/mv643xx.h +++ b/include/linux/mv643xx.h | |||
@@ -13,10 +13,6 @@ | |||
13 | #ifndef __ASM_MV643XX_H | 13 | #ifndef __ASM_MV643XX_H |
14 | #define __ASM_MV643XX_H | 14 | #define __ASM_MV643XX_H |
15 | 15 | ||
16 | #ifdef __mips__ | ||
17 | #include <asm/addrspace.h> | ||
18 | #include <asm/marvell.h> | ||
19 | #endif | ||
20 | #include <asm/types.h> | 16 | #include <asm/types.h> |
21 | 17 | ||
22 | /****************************************/ | 18 | /****************************************/ |
diff --git a/include/linux/pata_platform.h b/include/linux/pata_platform.h index 2d5fd647e0e9..5799e8d50623 100644 --- a/include/linux/pata_platform.h +++ b/include/linux/pata_platform.h | |||
@@ -8,6 +8,11 @@ struct pata_platform_info { | |||
8 | * spacing used by ata_std_ports(). | 8 | * spacing used by ata_std_ports(). |
9 | */ | 9 | */ |
10 | unsigned int ioport_shift; | 10 | unsigned int ioport_shift; |
11 | /* | ||
12 | * Indicate platform specific irq types and initial | ||
13 | * IRQ flags when call request_irq() | ||
14 | */ | ||
15 | unsigned int irq_flags; | ||
11 | }; | 16 | }; |
12 | 17 | ||
13 | #endif /* __LINUX_PATA_PLATFORM_H */ | 18 | #endif /* __LINUX_PATA_PLATFORM_H */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 9a03b47da603..75c4d4d06892 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -661,6 +661,7 @@ | |||
661 | #define PCI_DEVICE_ID_SI_965 0x0965 | 661 | #define PCI_DEVICE_ID_SI_965 0x0965 |
662 | #define PCI_DEVICE_ID_SI_966 0x0966 | 662 | #define PCI_DEVICE_ID_SI_966 0x0966 |
663 | #define PCI_DEVICE_ID_SI_968 0x0968 | 663 | #define PCI_DEVICE_ID_SI_968 0x0968 |
664 | #define PCI_DEVICE_ID_SI_1180 0x1180 | ||
664 | #define PCI_DEVICE_ID_SI_5511 0x5511 | 665 | #define PCI_DEVICE_ID_SI_5511 0x5511 |
665 | #define PCI_DEVICE_ID_SI_5513 0x5513 | 666 | #define PCI_DEVICE_ID_SI_5513 0x5513 |
666 | #define PCI_DEVICE_ID_SI_5517 0x5517 | 667 | #define PCI_DEVICE_ID_SI_5517 0x5517 |
@@ -1999,6 +2000,7 @@ | |||
1999 | 2000 | ||
2000 | #define PCI_VENDOR_ID_ENE 0x1524 | 2001 | #define PCI_VENDOR_ID_ENE 0x1524 |
2001 | #define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 | 2002 | #define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 |
2003 | #define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551 | ||
2002 | #define PCI_DEVICE_ID_ENE_1211 0x1211 | 2004 | #define PCI_DEVICE_ID_ENE_1211 0x1211 |
2003 | #define PCI_DEVICE_ID_ENE_1225 0x1225 | 2005 | #define PCI_DEVICE_ID_ENE_1225 0x1225 |
2004 | #define PCI_DEVICE_ID_ENE_1410 0x1410 | 2006 | #define PCI_DEVICE_ID_ENE_1410 0x1410 |
diff --git a/include/linux/pda_power.h b/include/linux/pda_power.h new file mode 100644 index 000000000000..1375f15797e7 --- /dev/null +++ b/include/linux/pda_power.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Common power driver for PDAs and phones with one or two external | ||
3 | * power supplies (AC/USB) connected to main and backup batteries, | ||
4 | * and optional builtin charger. | ||
5 | * | ||
6 | * Copyright © 2007 Anton Vorontsov <cbou@mail.ru> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __PDA_POWER_H__ | ||
14 | #define __PDA_POWER_H__ | ||
15 | |||
16 | #define PDA_POWER_CHARGE_AC (1 << 0) | ||
17 | #define PDA_POWER_CHARGE_USB (1 << 1) | ||
18 | |||
19 | struct pda_power_pdata { | ||
20 | int (*is_ac_online)(void); | ||
21 | int (*is_usb_online)(void); | ||
22 | void (*set_charge)(int flags); | ||
23 | |||
24 | char **supplied_to; | ||
25 | size_t num_supplicants; | ||
26 | |||
27 | unsigned int wait_for_status; /* msecs, default is 500 */ | ||
28 | unsigned int wait_for_charger; /* msecs, default is 500 */ | ||
29 | }; | ||
30 | |||
31 | #endif /* __PDA_POWER_H__ */ | ||
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index c8884f971228..8e4120285f72 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
@@ -9,13 +9,39 @@ | |||
9 | #define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */ | 9 | #define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */ |
10 | #define PIPE_BUF_FLAG_GIFT 0x04 /* page is a gift */ | 10 | #define PIPE_BUF_FLAG_GIFT 0x04 /* page is a gift */ |
11 | 11 | ||
12 | /** | ||
13 | * struct pipe_buffer - a linux kernel pipe buffer | ||
14 | * @page: the page containing the data for the pipe buffer | ||
15 | * @offset: offset of data inside the @page | ||
16 | * @len: length of data inside the @page | ||
17 | * @ops: operations associated with this buffer. See @pipe_buf_operations. | ||
18 | * @flags: pipe buffer flags. See above. | ||
19 | * @private: private data owned by the ops. | ||
20 | **/ | ||
12 | struct pipe_buffer { | 21 | struct pipe_buffer { |
13 | struct page *page; | 22 | struct page *page; |
14 | unsigned int offset, len; | 23 | unsigned int offset, len; |
15 | const struct pipe_buf_operations *ops; | 24 | const struct pipe_buf_operations *ops; |
16 | unsigned int flags; | 25 | unsigned int flags; |
26 | unsigned long private; | ||
17 | }; | 27 | }; |
18 | 28 | ||
29 | /** | ||
30 | * struct pipe_inode_info - a linux kernel pipe | ||
31 | * @wait: reader/writer wait point in case of empty/full pipe | ||
32 | * @nrbufs: the number of non-empty pipe buffers in this pipe | ||
33 | * @curbuf: the current pipe buffer entry | ||
34 | * @tmp_page: cached released page | ||
35 | * @readers: number of current readers of this pipe | ||
36 | * @writers: number of current writers of this pipe | ||
37 | * @waiting_writers: number of writers blocked waiting for room | ||
38 | * @r_counter: reader counter | ||
39 | * @w_counter: writer counter | ||
40 | * @fasync_readers: reader side fasync | ||
41 | * @fasync_writers: writer side fasync | ||
42 | * @inode: inode this pipe is attached to | ||
43 | * @bufs: the circular array of pipe buffers | ||
44 | **/ | ||
19 | struct pipe_inode_info { | 45 | struct pipe_inode_info { |
20 | wait_queue_head_t wait; | 46 | wait_queue_head_t wait; |
21 | unsigned int nrbufs, curbuf; | 47 | unsigned int nrbufs, curbuf; |
@@ -34,22 +60,73 @@ struct pipe_inode_info { | |||
34 | /* | 60 | /* |
35 | * Note on the nesting of these functions: | 61 | * Note on the nesting of these functions: |
36 | * | 62 | * |
37 | * ->pin() | 63 | * ->confirm() |
38 | * ->steal() | 64 | * ->steal() |
39 | * ... | 65 | * ... |
40 | * ->map() | 66 | * ->map() |
41 | * ... | 67 | * ... |
42 | * ->unmap() | 68 | * ->unmap() |
43 | * | 69 | * |
44 | * That is, ->map() must be called on a pinned buffer, same goes for ->steal(). | 70 | * That is, ->map() must be called on a confirmed buffer, |
71 | * same goes for ->steal(). See below for the meaning of each | ||
72 | * operation. Also see kerneldoc in fs/pipe.c for the pipe | ||
73 | * and generic variants of these hooks. | ||
45 | */ | 74 | */ |
46 | struct pipe_buf_operations { | 75 | struct pipe_buf_operations { |
76 | /* | ||
77 | * This is set to 1, if the generic pipe read/write may coalesce | ||
78 | * data into an existing buffer. If this is set to 0, a new pipe | ||
79 | * page segment is always used for new data. | ||
80 | */ | ||
47 | int can_merge; | 81 | int can_merge; |
82 | |||
83 | /* | ||
84 | * ->map() returns a virtual address mapping of the pipe buffer. | ||
85 | * The last integer flag reflects whether this should be an atomic | ||
86 | * mapping or not. The atomic map is faster, however you can't take | ||
87 | * page faults before calling ->unmap() again. So if you need to eg | ||
88 | * access user data through copy_to/from_user(), then you must get | ||
89 | * a non-atomic map. ->map() uses the KM_USER0 atomic slot for | ||
90 | * atomic maps, so you can't map more than one pipe_buffer at once | ||
91 | * and you have to be careful if mapping another page as source | ||
92 | * or destination for a copy (IOW, it has to use something else | ||
93 | * than KM_USER0). | ||
94 | */ | ||
48 | void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int); | 95 | void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int); |
96 | |||
97 | /* | ||
98 | * Undoes ->map(), finishes the virtual mapping of the pipe buffer. | ||
99 | */ | ||
49 | void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *, void *); | 100 | void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *, void *); |
50 | int (*pin)(struct pipe_inode_info *, struct pipe_buffer *); | 101 | |
102 | /* | ||
103 | * ->confirm() verifies that the data in the pipe buffer is there | ||
104 | * and that the contents are good. If the pages in the pipe belong | ||
105 | * to a file system, we may need to wait for IO completion in this | ||
106 | * hook. Returns 0 for good, or a negative error value in case of | ||
107 | * error. | ||
108 | */ | ||
109 | int (*confirm)(struct pipe_inode_info *, struct pipe_buffer *); | ||
110 | |||
111 | /* | ||
112 | * When the contents of this pipe buffer has been completely | ||
113 | * consumed by a reader, ->release() is called. | ||
114 | */ | ||
51 | void (*release)(struct pipe_inode_info *, struct pipe_buffer *); | 115 | void (*release)(struct pipe_inode_info *, struct pipe_buffer *); |
116 | |||
117 | /* | ||
118 | * Attempt to take ownership of the pipe buffer and its contents. | ||
119 | * ->steal() returns 0 for success, in which case the contents | ||
120 | * of the pipe (the buf->page) is locked and now completely owned | ||
121 | * by the caller. The page may then be transferred to a different | ||
122 | * mapping, the most often used case is insertion into different | ||
123 | * file address space cache. | ||
124 | */ | ||
52 | int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); | 125 | int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); |
126 | |||
127 | /* | ||
128 | * Get a reference to the pipe buffer. | ||
129 | */ | ||
53 | void (*get)(struct pipe_inode_info *, struct pipe_buffer *); | 130 | void (*get)(struct pipe_inode_info *, struct pipe_buffer *); |
54 | }; | 131 | }; |
55 | 132 | ||
@@ -68,39 +145,7 @@ void __free_pipe_info(struct pipe_inode_info *); | |||
68 | void *generic_pipe_buf_map(struct pipe_inode_info *, struct pipe_buffer *, int); | 145 | void *generic_pipe_buf_map(struct pipe_inode_info *, struct pipe_buffer *, int); |
69 | void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void *); | 146 | void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void *); |
70 | void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *); | 147 | void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *); |
71 | int generic_pipe_buf_pin(struct pipe_inode_info *, struct pipe_buffer *); | 148 | int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *); |
72 | int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); | 149 | int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); |
73 | 150 | ||
74 | /* | ||
75 | * splice is tied to pipes as a transport (at least for now), so we'll just | ||
76 | * add the splice flags here. | ||
77 | */ | ||
78 | #define SPLICE_F_MOVE (0x01) /* move pages instead of copying */ | ||
79 | #define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */ | ||
80 | /* we may still block on the fd we splice */ | ||
81 | /* from/to, of course */ | ||
82 | #define SPLICE_F_MORE (0x04) /* expect more data */ | ||
83 | #define SPLICE_F_GIFT (0x08) /* pages passed in are a gift */ | ||
84 | |||
85 | /* | ||
86 | * Passed to the actors | ||
87 | */ | ||
88 | struct splice_desc { | ||
89 | unsigned int len, total_len; /* current and remaining length */ | ||
90 | unsigned int flags; /* splice flags */ | ||
91 | struct file *file; /* file to read/write */ | ||
92 | loff_t pos; /* file position */ | ||
93 | }; | ||
94 | |||
95 | typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *, | ||
96 | struct splice_desc *); | ||
97 | |||
98 | extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *, | ||
99 | loff_t *, size_t, unsigned int, | ||
100 | splice_actor *); | ||
101 | |||
102 | extern ssize_t __splice_from_pipe(struct pipe_inode_info *, struct file *, | ||
103 | loff_t *, size_t, unsigned int, | ||
104 | splice_actor *); | ||
105 | |||
106 | #endif | 151 | #endif |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h new file mode 100644 index 000000000000..606c0957997f --- /dev/null +++ b/include/linux/power_supply.h | |||
@@ -0,0 +1,180 @@ | |||
1 | /* | ||
2 | * Universal power supply monitor class | ||
3 | * | ||
4 | * Copyright © 2007 Anton Vorontsov <cbou@mail.ru> | ||
5 | * Copyright © 2004 Szabolcs Gyurko | ||
6 | * Copyright © 2003 Ian Molton <spyro@f2s.com> | ||
7 | * | ||
8 | * Modified: 2004, Oct Szabolcs Gyurko | ||
9 | * | ||
10 | * You may use this code as per GPL version 2 | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_POWER_SUPPLY_H__ | ||
14 | #define __LINUX_POWER_SUPPLY_H__ | ||
15 | |||
16 | #include <linux/device.h> | ||
17 | #include <linux/workqueue.h> | ||
18 | #include <linux/leds.h> | ||
19 | |||
20 | /* | ||
21 | * All voltages, currents, charges, energies, time and temperatures in uV, | ||
22 | * µA, µAh, µWh, seconds and tenths of degree Celsius unless otherwise | ||
23 | * stated. It's driver's job to convert its raw values to units in which | ||
24 | * this class operates. | ||
25 | */ | ||
26 | |||
27 | /* | ||
28 | * For systems where the charger determines the maximum battery capacity | ||
29 | * the min and max fields should be used to present these values to user | ||
30 | * space. Unused/unknown fields will not appear in sysfs. | ||
31 | */ | ||
32 | |||
33 | enum { | ||
34 | POWER_SUPPLY_STATUS_UNKNOWN = 0, | ||
35 | POWER_SUPPLY_STATUS_CHARGING, | ||
36 | POWER_SUPPLY_STATUS_DISCHARGING, | ||
37 | POWER_SUPPLY_STATUS_NOT_CHARGING, | ||
38 | POWER_SUPPLY_STATUS_FULL, | ||
39 | }; | ||
40 | |||
41 | enum { | ||
42 | POWER_SUPPLY_HEALTH_UNKNOWN = 0, | ||
43 | POWER_SUPPLY_HEALTH_GOOD, | ||
44 | POWER_SUPPLY_HEALTH_OVERHEAT, | ||
45 | POWER_SUPPLY_HEALTH_DEAD, | ||
46 | POWER_SUPPLY_HEALTH_OVERVOLTAGE, | ||
47 | POWER_SUPPLY_HEALTH_UNSPEC_FAILURE, | ||
48 | }; | ||
49 | |||
50 | enum { | ||
51 | POWER_SUPPLY_TECHNOLOGY_UNKNOWN = 0, | ||
52 | POWER_SUPPLY_TECHNOLOGY_NiMH, | ||
53 | POWER_SUPPLY_TECHNOLOGY_LION, | ||
54 | POWER_SUPPLY_TECHNOLOGY_LIPO, | ||
55 | POWER_SUPPLY_TECHNOLOGY_LiFe, | ||
56 | POWER_SUPPLY_TECHNOLOGY_NiCd, | ||
57 | }; | ||
58 | |||
59 | enum { | ||
60 | POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN = 0, | ||
61 | POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL, | ||
62 | POWER_SUPPLY_CAPACITY_LEVEL_LOW, | ||
63 | POWER_SUPPLY_CAPACITY_LEVEL_NORMAL, | ||
64 | POWER_SUPPLY_CAPACITY_LEVEL_HIGH, | ||
65 | POWER_SUPPLY_CAPACITY_LEVEL_FULL, | ||
66 | }; | ||
67 | |||
68 | enum power_supply_property { | ||
69 | /* Properties of type `int' */ | ||
70 | POWER_SUPPLY_PROP_STATUS = 0, | ||
71 | POWER_SUPPLY_PROP_HEALTH, | ||
72 | POWER_SUPPLY_PROP_PRESENT, | ||
73 | POWER_SUPPLY_PROP_ONLINE, | ||
74 | POWER_SUPPLY_PROP_TECHNOLOGY, | ||
75 | POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, | ||
76 | POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, | ||
77 | POWER_SUPPLY_PROP_VOLTAGE_NOW, | ||
78 | POWER_SUPPLY_PROP_VOLTAGE_AVG, | ||
79 | POWER_SUPPLY_PROP_CURRENT_NOW, | ||
80 | POWER_SUPPLY_PROP_CURRENT_AVG, | ||
81 | POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, | ||
82 | POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN, | ||
83 | POWER_SUPPLY_PROP_CHARGE_FULL, | ||
84 | POWER_SUPPLY_PROP_CHARGE_EMPTY, | ||
85 | POWER_SUPPLY_PROP_CHARGE_NOW, | ||
86 | POWER_SUPPLY_PROP_CHARGE_AVG, | ||
87 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, | ||
88 | POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, | ||
89 | POWER_SUPPLY_PROP_ENERGY_FULL, | ||
90 | POWER_SUPPLY_PROP_ENERGY_EMPTY, | ||
91 | POWER_SUPPLY_PROP_ENERGY_NOW, | ||
92 | POWER_SUPPLY_PROP_ENERGY_AVG, | ||
93 | POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ | ||
94 | POWER_SUPPLY_PROP_CAPACITY_LEVEL, | ||
95 | POWER_SUPPLY_PROP_TEMP, | ||
96 | POWER_SUPPLY_PROP_TEMP_AMBIENT, | ||
97 | POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, | ||
98 | POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG, | ||
99 | POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, | ||
100 | POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, | ||
101 | /* Properties of type `const char *' */ | ||
102 | POWER_SUPPLY_PROP_MODEL_NAME, | ||
103 | POWER_SUPPLY_PROP_MANUFACTURER, | ||
104 | }; | ||
105 | |||
106 | enum power_supply_type { | ||
107 | POWER_SUPPLY_TYPE_BATTERY = 0, | ||
108 | POWER_SUPPLY_TYPE_UPS, | ||
109 | POWER_SUPPLY_TYPE_MAINS, | ||
110 | POWER_SUPPLY_TYPE_USB, | ||
111 | }; | ||
112 | |||
113 | union power_supply_propval { | ||
114 | int intval; | ||
115 | const char *strval; | ||
116 | }; | ||
117 | |||
118 | struct power_supply { | ||
119 | const char *name; | ||
120 | enum power_supply_type type; | ||
121 | enum power_supply_property *properties; | ||
122 | size_t num_properties; | ||
123 | |||
124 | char **supplied_to; | ||
125 | size_t num_supplicants; | ||
126 | |||
127 | int (*get_property)(struct power_supply *psy, | ||
128 | enum power_supply_property psp, | ||
129 | union power_supply_propval *val); | ||
130 | void (*external_power_changed)(struct power_supply *psy); | ||
131 | |||
132 | /* For APM emulation, think legacy userspace. */ | ||
133 | int use_for_apm; | ||
134 | |||
135 | /* private */ | ||
136 | struct device *dev; | ||
137 | struct work_struct changed_work; | ||
138 | |||
139 | #ifdef CONFIG_LEDS_TRIGGERS | ||
140 | struct led_trigger *charging_full_trig; | ||
141 | char *charging_full_trig_name; | ||
142 | struct led_trigger *charging_trig; | ||
143 | char *charging_trig_name; | ||
144 | struct led_trigger *full_trig; | ||
145 | char *full_trig_name; | ||
146 | struct led_trigger *online_trig; | ||
147 | char *online_trig_name; | ||
148 | #endif | ||
149 | }; | ||
150 | |||
151 | /* | ||
152 | * This is recommended structure to specify static power supply parameters. | ||
153 | * Generic one, parametrizable for different power supplies. Power supply | ||
154 | * class itself does not use it, but that's what implementing most platform | ||
155 | * drivers, should try reuse for consistency. | ||
156 | */ | ||
157 | |||
158 | struct power_supply_info { | ||
159 | const char *name; | ||
160 | int technology; | ||
161 | int voltage_max_design; | ||
162 | int voltage_min_design; | ||
163 | int charge_full_design; | ||
164 | int charge_empty_design; | ||
165 | int energy_full_design; | ||
166 | int energy_empty_design; | ||
167 | int use_for_apm; | ||
168 | }; | ||
169 | |||
170 | extern void power_supply_changed(struct power_supply *psy); | ||
171 | extern int power_supply_am_i_supplied(struct power_supply *psy); | ||
172 | |||
173 | extern int power_supply_register(struct device *parent, | ||
174 | struct power_supply *psy); | ||
175 | extern void power_supply_unregister(struct power_supply *psy); | ||
176 | |||
177 | /* For APM emulation, think legacy userspace. */ | ||
178 | extern struct class *power_supply_class; | ||
179 | |||
180 | #endif /* __LINUX_POWER_SUPPLY_H__ */ | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 693f0e6c54d4..cfb680585ab8 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -34,6 +34,8 @@ | |||
34 | #define SCHED_FIFO 1 | 34 | #define SCHED_FIFO 1 |
35 | #define SCHED_RR 2 | 35 | #define SCHED_RR 2 |
36 | #define SCHED_BATCH 3 | 36 | #define SCHED_BATCH 3 |
37 | /* SCHED_ISO: reserved but not implemented yet */ | ||
38 | #define SCHED_IDLE 5 | ||
37 | 39 | ||
38 | #ifdef __KERNEL__ | 40 | #ifdef __KERNEL__ |
39 | 41 | ||
@@ -130,6 +132,26 @@ extern unsigned long nr_active(void); | |||
130 | extern unsigned long nr_iowait(void); | 132 | extern unsigned long nr_iowait(void); |
131 | extern unsigned long weighted_cpuload(const int cpu); | 133 | extern unsigned long weighted_cpuload(const int cpu); |
132 | 134 | ||
135 | struct seq_file; | ||
136 | struct cfs_rq; | ||
137 | #ifdef CONFIG_SCHED_DEBUG | ||
138 | extern void proc_sched_show_task(struct task_struct *p, struct seq_file *m); | ||
139 | extern void proc_sched_set_task(struct task_struct *p); | ||
140 | extern void | ||
141 | print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq, u64 now); | ||
142 | #else | ||
143 | static inline void | ||
144 | proc_sched_show_task(struct task_struct *p, struct seq_file *m) | ||
145 | { | ||
146 | } | ||
147 | static inline void proc_sched_set_task(struct task_struct *p) | ||
148 | { | ||
149 | } | ||
150 | static inline void | ||
151 | print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq, u64 now) | ||
152 | { | ||
153 | } | ||
154 | #endif | ||
133 | 155 | ||
134 | /* | 156 | /* |
135 | * Task state bitmask. NOTE! These bits are also | 157 | * Task state bitmask. NOTE! These bits are also |
@@ -193,6 +215,7 @@ struct task_struct; | |||
193 | extern void sched_init(void); | 215 | extern void sched_init(void); |
194 | extern void sched_init_smp(void); | 216 | extern void sched_init_smp(void); |
195 | extern void init_idle(struct task_struct *idle, int cpu); | 217 | extern void init_idle(struct task_struct *idle, int cpu); |
218 | extern void init_idle_bootup_task(struct task_struct *idle); | ||
196 | 219 | ||
197 | extern cpumask_t nohz_cpu_mask; | 220 | extern cpumask_t nohz_cpu_mask; |
198 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) | 221 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) |
@@ -479,7 +502,7 @@ struct signal_struct { | |||
479 | * from jiffies_to_ns(utime + stime) if sched_clock uses something | 502 | * from jiffies_to_ns(utime + stime) if sched_clock uses something |
480 | * other than jiffies.) | 503 | * other than jiffies.) |
481 | */ | 504 | */ |
482 | unsigned long long sched_time; | 505 | unsigned long long sum_sched_runtime; |
483 | 506 | ||
484 | /* | 507 | /* |
485 | * We don't bother to synchronize most readers of this at all, | 508 | * We don't bother to synchronize most readers of this at all, |
@@ -521,31 +544,6 @@ struct signal_struct { | |||
521 | #define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ | 544 | #define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ |
522 | #define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */ | 545 | #define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */ |
523 | 546 | ||
524 | |||
525 | /* | ||
526 | * Priority of a process goes from 0..MAX_PRIO-1, valid RT | ||
527 | * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH | ||
528 | * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority | ||
529 | * values are inverted: lower p->prio value means higher priority. | ||
530 | * | ||
531 | * The MAX_USER_RT_PRIO value allows the actual maximum | ||
532 | * RT priority to be separate from the value exported to | ||
533 | * user-space. This allows kernel threads to set their | ||
534 | * priority to a value higher than any user task. Note: | ||
535 | * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO. | ||
536 | */ | ||
537 | |||
538 | #define MAX_USER_RT_PRIO 100 | ||
539 | #define MAX_RT_PRIO MAX_USER_RT_PRIO | ||
540 | |||
541 | #define MAX_PRIO (MAX_RT_PRIO + 40) | ||
542 | |||
543 | #define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO) | ||
544 | #define rt_task(p) rt_prio((p)->prio) | ||
545 | #define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) | ||
546 | #define is_rt_policy(p) ((p) != SCHED_NORMAL && (p) != SCHED_BATCH) | ||
547 | #define has_rt_policy(p) unlikely(is_rt_policy((p)->policy)) | ||
548 | |||
549 | /* | 547 | /* |
550 | * Some day this will be a full-fledged user tracking system.. | 548 | * Some day this will be a full-fledged user tracking system.. |
551 | */ | 549 | */ |
@@ -583,13 +581,13 @@ struct reclaim_state; | |||
583 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) | 581 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) |
584 | struct sched_info { | 582 | struct sched_info { |
585 | /* cumulative counters */ | 583 | /* cumulative counters */ |
586 | unsigned long cpu_time, /* time spent on the cpu */ | 584 | unsigned long pcnt; /* # of times run on this cpu */ |
587 | run_delay, /* time spent waiting on a runqueue */ | 585 | unsigned long long cpu_time, /* time spent on the cpu */ |
588 | pcnt; /* # of timeslices run on this cpu */ | 586 | run_delay; /* time spent waiting on a runqueue */ |
589 | 587 | ||
590 | /* timestamps */ | 588 | /* timestamps */ |
591 | unsigned long last_arrival, /* when we last ran on a cpu */ | 589 | unsigned long long last_arrival,/* when we last ran on a cpu */ |
592 | last_queued; /* when we were last queued to run */ | 590 | last_queued; /* when we were last queued to run */ |
593 | }; | 591 | }; |
594 | #endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ | 592 | #endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ |
595 | 593 | ||
@@ -639,18 +637,24 @@ static inline int sched_info_on(void) | |||
639 | #endif | 637 | #endif |
640 | } | 638 | } |
641 | 639 | ||
642 | enum idle_type | 640 | enum cpu_idle_type { |
643 | { | 641 | CPU_IDLE, |
644 | SCHED_IDLE, | 642 | CPU_NOT_IDLE, |
645 | NOT_IDLE, | 643 | CPU_NEWLY_IDLE, |
646 | NEWLY_IDLE, | 644 | CPU_MAX_IDLE_TYPES |
647 | MAX_IDLE_TYPES | ||
648 | }; | 645 | }; |
649 | 646 | ||
650 | /* | 647 | /* |
651 | * sched-domains (multiprocessor balancing) declarations: | 648 | * sched-domains (multiprocessor balancing) declarations: |
652 | */ | 649 | */ |
653 | #define SCHED_LOAD_SCALE 128UL /* increase resolution of load */ | 650 | |
651 | /* | ||
652 | * Increase resolution of nice-level calculations: | ||
653 | */ | ||
654 | #define SCHED_LOAD_SHIFT 10 | ||
655 | #define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT) | ||
656 | |||
657 | #define SCHED_LOAD_SCALE_FUZZ (SCHED_LOAD_SCALE >> 5) | ||
654 | 658 | ||
655 | #ifdef CONFIG_SMP | 659 | #ifdef CONFIG_SMP |
656 | #define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ | 660 | #define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ |
@@ -719,14 +723,14 @@ struct sched_domain { | |||
719 | 723 | ||
720 | #ifdef CONFIG_SCHEDSTATS | 724 | #ifdef CONFIG_SCHEDSTATS |
721 | /* load_balance() stats */ | 725 | /* load_balance() stats */ |
722 | unsigned long lb_cnt[MAX_IDLE_TYPES]; | 726 | unsigned long lb_cnt[CPU_MAX_IDLE_TYPES]; |
723 | unsigned long lb_failed[MAX_IDLE_TYPES]; | 727 | unsigned long lb_failed[CPU_MAX_IDLE_TYPES]; |
724 | unsigned long lb_balanced[MAX_IDLE_TYPES]; | 728 | unsigned long lb_balanced[CPU_MAX_IDLE_TYPES]; |
725 | unsigned long lb_imbalance[MAX_IDLE_TYPES]; | 729 | unsigned long lb_imbalance[CPU_MAX_IDLE_TYPES]; |
726 | unsigned long lb_gained[MAX_IDLE_TYPES]; | 730 | unsigned long lb_gained[CPU_MAX_IDLE_TYPES]; |
727 | unsigned long lb_hot_gained[MAX_IDLE_TYPES]; | 731 | unsigned long lb_hot_gained[CPU_MAX_IDLE_TYPES]; |
728 | unsigned long lb_nobusyg[MAX_IDLE_TYPES]; | 732 | unsigned long lb_nobusyg[CPU_MAX_IDLE_TYPES]; |
729 | unsigned long lb_nobusyq[MAX_IDLE_TYPES]; | 733 | unsigned long lb_nobusyq[CPU_MAX_IDLE_TYPES]; |
730 | 734 | ||
731 | /* Active load balancing */ | 735 | /* Active load balancing */ |
732 | unsigned long alb_cnt; | 736 | unsigned long alb_cnt; |
@@ -753,12 +757,6 @@ struct sched_domain { | |||
753 | extern int partition_sched_domains(cpumask_t *partition1, | 757 | extern int partition_sched_domains(cpumask_t *partition1, |
754 | cpumask_t *partition2); | 758 | cpumask_t *partition2); |
755 | 759 | ||
756 | /* | ||
757 | * Maximum cache size the migration-costs auto-tuning code will | ||
758 | * search from: | ||
759 | */ | ||
760 | extern unsigned int max_cache_size; | ||
761 | |||
762 | #endif /* CONFIG_SMP */ | 760 | #endif /* CONFIG_SMP */ |
763 | 761 | ||
764 | 762 | ||
@@ -809,14 +807,86 @@ struct mempolicy; | |||
809 | struct pipe_inode_info; | 807 | struct pipe_inode_info; |
810 | struct uts_namespace; | 808 | struct uts_namespace; |
811 | 809 | ||
812 | enum sleep_type { | 810 | struct rq; |
813 | SLEEP_NORMAL, | 811 | struct sched_domain; |
814 | SLEEP_NONINTERACTIVE, | 812 | |
815 | SLEEP_INTERACTIVE, | 813 | struct sched_class { |
816 | SLEEP_INTERRUPTED, | 814 | struct sched_class *next; |
815 | |||
816 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, | ||
817 | int wakeup, u64 now); | ||
818 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, | ||
819 | int sleep, u64 now); | ||
820 | void (*yield_task) (struct rq *rq, struct task_struct *p); | ||
821 | |||
822 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p); | ||
823 | |||
824 | struct task_struct * (*pick_next_task) (struct rq *rq, u64 now); | ||
825 | void (*put_prev_task) (struct rq *rq, struct task_struct *p, u64 now); | ||
826 | |||
827 | int (*load_balance) (struct rq *this_rq, int this_cpu, | ||
828 | struct rq *busiest, | ||
829 | unsigned long max_nr_move, unsigned long max_load_move, | ||
830 | struct sched_domain *sd, enum cpu_idle_type idle, | ||
831 | int *all_pinned, unsigned long *total_load_moved); | ||
832 | |||
833 | void (*set_curr_task) (struct rq *rq); | ||
834 | void (*task_tick) (struct rq *rq, struct task_struct *p); | ||
835 | void (*task_new) (struct rq *rq, struct task_struct *p); | ||
817 | }; | 836 | }; |
818 | 837 | ||
819 | struct prio_array; | 838 | struct load_weight { |
839 | unsigned long weight, inv_weight; | ||
840 | }; | ||
841 | |||
842 | /* | ||
843 | * CFS stats for a schedulable entity (task, task-group etc) | ||
844 | * | ||
845 | * Current field usage histogram: | ||
846 | * | ||
847 | * 4 se->block_start | ||
848 | * 4 se->run_node | ||
849 | * 4 se->sleep_start | ||
850 | * 4 se->sleep_start_fair | ||
851 | * 6 se->load.weight | ||
852 | * 7 se->delta_fair | ||
853 | * 15 se->wait_runtime | ||
854 | */ | ||
855 | struct sched_entity { | ||
856 | long wait_runtime; | ||
857 | unsigned long delta_fair_run; | ||
858 | unsigned long delta_fair_sleep; | ||
859 | unsigned long delta_exec; | ||
860 | s64 fair_key; | ||
861 | struct load_weight load; /* for load-balancing */ | ||
862 | struct rb_node run_node; | ||
863 | unsigned int on_rq; | ||
864 | |||
865 | u64 wait_start_fair; | ||
866 | u64 wait_start; | ||
867 | u64 exec_start; | ||
868 | u64 sleep_start; | ||
869 | u64 sleep_start_fair; | ||
870 | u64 block_start; | ||
871 | u64 sleep_max; | ||
872 | u64 block_max; | ||
873 | u64 exec_max; | ||
874 | u64 wait_max; | ||
875 | u64 last_ran; | ||
876 | |||
877 | u64 sum_exec_runtime; | ||
878 | s64 sum_wait_runtime; | ||
879 | s64 sum_sleep_runtime; | ||
880 | unsigned long wait_runtime_overruns; | ||
881 | unsigned long wait_runtime_underruns; | ||
882 | #ifdef CONFIG_FAIR_GROUP_SCHED | ||
883 | struct sched_entity *parent; | ||
884 | /* rq on which this entity is (to be) queued: */ | ||
885 | struct cfs_rq *cfs_rq; | ||
886 | /* rq "owned" by this entity/group: */ | ||
887 | struct cfs_rq *my_q; | ||
888 | #endif | ||
889 | }; | ||
820 | 890 | ||
821 | struct task_struct { | 891 | struct task_struct { |
822 | volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ | 892 | volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ |
@@ -832,23 +902,20 @@ struct task_struct { | |||
832 | int oncpu; | 902 | int oncpu; |
833 | #endif | 903 | #endif |
834 | #endif | 904 | #endif |
835 | int load_weight; /* for niceness load balancing purposes */ | 905 | |
836 | int prio, static_prio, normal_prio; | 906 | int prio, static_prio, normal_prio; |
837 | struct list_head run_list; | 907 | struct list_head run_list; |
838 | struct prio_array *array; | 908 | struct sched_class *sched_class; |
909 | struct sched_entity se; | ||
839 | 910 | ||
840 | unsigned short ioprio; | 911 | unsigned short ioprio; |
841 | #ifdef CONFIG_BLK_DEV_IO_TRACE | 912 | #ifdef CONFIG_BLK_DEV_IO_TRACE |
842 | unsigned int btrace_seq; | 913 | unsigned int btrace_seq; |
843 | #endif | 914 | #endif |
844 | unsigned long sleep_avg; | ||
845 | unsigned long long timestamp, last_ran; | ||
846 | unsigned long long sched_time; /* sched_clock time spent running */ | ||
847 | enum sleep_type sleep_type; | ||
848 | 915 | ||
849 | unsigned int policy; | 916 | unsigned int policy; |
850 | cpumask_t cpus_allowed; | 917 | cpumask_t cpus_allowed; |
851 | unsigned int time_slice, first_time_slice; | 918 | unsigned int time_slice; |
852 | 919 | ||
853 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) | 920 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) |
854 | struct sched_info sched_info; | 921 | struct sched_info sched_info; |
@@ -1078,6 +1145,37 @@ struct task_struct { | |||
1078 | #endif | 1145 | #endif |
1079 | }; | 1146 | }; |
1080 | 1147 | ||
1148 | /* | ||
1149 | * Priority of a process goes from 0..MAX_PRIO-1, valid RT | ||
1150 | * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH | ||
1151 | * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority | ||
1152 | * values are inverted: lower p->prio value means higher priority. | ||
1153 | * | ||
1154 | * The MAX_USER_RT_PRIO value allows the actual maximum | ||
1155 | * RT priority to be separate from the value exported to | ||
1156 | * user-space. This allows kernel threads to set their | ||
1157 | * priority to a value higher than any user task. Note: | ||
1158 | * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO. | ||
1159 | */ | ||
1160 | |||
1161 | #define MAX_USER_RT_PRIO 100 | ||
1162 | #define MAX_RT_PRIO MAX_USER_RT_PRIO | ||
1163 | |||
1164 | #define MAX_PRIO (MAX_RT_PRIO + 40) | ||
1165 | #define DEFAULT_PRIO (MAX_RT_PRIO + 20) | ||
1166 | |||
1167 | static inline int rt_prio(int prio) | ||
1168 | { | ||
1169 | if (unlikely(prio < MAX_RT_PRIO)) | ||
1170 | return 1; | ||
1171 | return 0; | ||
1172 | } | ||
1173 | |||
1174 | static inline int rt_task(struct task_struct *p) | ||
1175 | { | ||
1176 | return rt_prio(p->prio); | ||
1177 | } | ||
1178 | |||
1081 | static inline pid_t process_group(struct task_struct *tsk) | 1179 | static inline pid_t process_group(struct task_struct *tsk) |
1082 | { | 1180 | { |
1083 | return tsk->signal->pgrp; | 1181 | return tsk->signal->pgrp; |
@@ -1223,7 +1321,7 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | |||
1223 | 1321 | ||
1224 | extern unsigned long long sched_clock(void); | 1322 | extern unsigned long long sched_clock(void); |
1225 | extern unsigned long long | 1323 | extern unsigned long long |
1226 | current_sched_time(const struct task_struct *current_task); | 1324 | task_sched_runtime(struct task_struct *task); |
1227 | 1325 | ||
1228 | /* sched_exec is called by processes performing an exec */ | 1326 | /* sched_exec is called by processes performing an exec */ |
1229 | #ifdef CONFIG_SMP | 1327 | #ifdef CONFIG_SMP |
@@ -1232,6 +1330,8 @@ extern void sched_exec(void); | |||
1232 | #define sched_exec() {} | 1330 | #define sched_exec() {} |
1233 | #endif | 1331 | #endif |
1234 | 1332 | ||
1333 | extern void sched_clock_unstable_event(void); | ||
1334 | |||
1235 | #ifdef CONFIG_HOTPLUG_CPU | 1335 | #ifdef CONFIG_HOTPLUG_CPU |
1236 | extern void idle_task_exit(void); | 1336 | extern void idle_task_exit(void); |
1237 | #else | 1337 | #else |
@@ -1240,6 +1340,14 @@ static inline void idle_task_exit(void) {} | |||
1240 | 1340 | ||
1241 | extern void sched_idle_next(void); | 1341 | extern void sched_idle_next(void); |
1242 | 1342 | ||
1343 | extern unsigned int sysctl_sched_granularity; | ||
1344 | extern unsigned int sysctl_sched_wakeup_granularity; | ||
1345 | extern unsigned int sysctl_sched_batch_wakeup_granularity; | ||
1346 | extern unsigned int sysctl_sched_stat_granularity; | ||
1347 | extern unsigned int sysctl_sched_runtime_limit; | ||
1348 | extern unsigned int sysctl_sched_child_runs_first; | ||
1349 | extern unsigned int sysctl_sched_features; | ||
1350 | |||
1243 | #ifdef CONFIG_RT_MUTEXES | 1351 | #ifdef CONFIG_RT_MUTEXES |
1244 | extern int rt_mutex_getprio(struct task_struct *p); | 1352 | extern int rt_mutex_getprio(struct task_struct *p); |
1245 | extern void rt_mutex_setprio(struct task_struct *p, int prio); | 1353 | extern void rt_mutex_setprio(struct task_struct *p, int prio); |
@@ -1317,8 +1425,8 @@ extern void FASTCALL(wake_up_new_task(struct task_struct * tsk, | |||
1317 | #else | 1425 | #else |
1318 | static inline void kick_process(struct task_struct *tsk) { } | 1426 | static inline void kick_process(struct task_struct *tsk) { } |
1319 | #endif | 1427 | #endif |
1320 | extern void FASTCALL(sched_fork(struct task_struct * p, int clone_flags)); | 1428 | extern void sched_fork(struct task_struct *p, int clone_flags); |
1321 | extern void FASTCALL(sched_exit(struct task_struct * p)); | 1429 | extern void sched_dead(struct task_struct *p); |
1322 | 1430 | ||
1323 | extern int in_group_p(gid_t); | 1431 | extern int in_group_p(gid_t); |
1324 | extern int in_egroup_p(gid_t); | 1432 | extern int in_egroup_p(gid_t); |
@@ -1406,7 +1514,7 @@ extern struct mm_struct * mm_alloc(void); | |||
1406 | extern void FASTCALL(__mmdrop(struct mm_struct *)); | 1514 | extern void FASTCALL(__mmdrop(struct mm_struct *)); |
1407 | static inline void mmdrop(struct mm_struct * mm) | 1515 | static inline void mmdrop(struct mm_struct * mm) |
1408 | { | 1516 | { |
1409 | if (atomic_dec_and_test(&mm->mm_count)) | 1517 | if (unlikely(atomic_dec_and_test(&mm->mm_count))) |
1410 | __mmdrop(mm); | 1518 | __mmdrop(mm); |
1411 | } | 1519 | } |
1412 | 1520 | ||
@@ -1638,10 +1746,7 @@ static inline unsigned int task_cpu(const struct task_struct *p) | |||
1638 | return task_thread_info(p)->cpu; | 1746 | return task_thread_info(p)->cpu; |
1639 | } | 1747 | } |
1640 | 1748 | ||
1641 | static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) | 1749 | extern void set_task_cpu(struct task_struct *p, unsigned int cpu); |
1642 | { | ||
1643 | task_thread_info(p)->cpu = cpu; | ||
1644 | } | ||
1645 | 1750 | ||
1646 | #else | 1751 | #else |
1647 | 1752 | ||
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 3e3cccbb1cac..83783ab0f552 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -50,5 +50,16 @@ int seq_release_private(struct inode *, struct file *); | |||
50 | 50 | ||
51 | #define SEQ_START_TOKEN ((void *)1) | 51 | #define SEQ_START_TOKEN ((void *)1) |
52 | 52 | ||
53 | /* | ||
54 | * Helpers for iteration over list_head-s in seq_files | ||
55 | */ | ||
56 | |||
57 | extern struct list_head *seq_list_start(struct list_head *head, | ||
58 | loff_t pos); | ||
59 | extern struct list_head *seq_list_start_head(struct list_head *head, | ||
60 | loff_t pos); | ||
61 | extern struct list_head *seq_list_next(void *v, struct list_head *head, | ||
62 | loff_t *ppos); | ||
63 | |||
53 | #endif | 64 | #endif |
54 | #endif | 65 | #endif |
diff --git a/include/linux/splice.h b/include/linux/splice.h new file mode 100644 index 000000000000..33e447f98a54 --- /dev/null +++ b/include/linux/splice.h | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | * Function declerations and data structures related to the splice | ||
3 | * implementation. | ||
4 | * | ||
5 | * Copyright (C) 2007 Jens Axboe <jens.axboe@oracle.com> | ||
6 | * | ||
7 | */ | ||
8 | #ifndef SPLICE_H | ||
9 | #define SPLICE_H | ||
10 | |||
11 | #include <linux/pipe_fs_i.h> | ||
12 | |||
13 | /* | ||
14 | * splice is tied to pipes as a transport (at least for now), so we'll just | ||
15 | * add the splice flags here. | ||
16 | */ | ||
17 | #define SPLICE_F_MOVE (0x01) /* move pages instead of copying */ | ||
18 | #define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */ | ||
19 | /* we may still block on the fd we splice */ | ||
20 | /* from/to, of course */ | ||
21 | #define SPLICE_F_MORE (0x04) /* expect more data */ | ||
22 | #define SPLICE_F_GIFT (0x08) /* pages passed in are a gift */ | ||
23 | |||
24 | /* | ||
25 | * Passed to the actors | ||
26 | */ | ||
27 | struct splice_desc { | ||
28 | unsigned int len, total_len; /* current and remaining length */ | ||
29 | unsigned int flags; /* splice flags */ | ||
30 | /* | ||
31 | * actor() private data | ||
32 | */ | ||
33 | union { | ||
34 | void __user *userptr; /* memory to write to */ | ||
35 | struct file *file; /* file to read/write */ | ||
36 | void *data; /* cookie */ | ||
37 | } u; | ||
38 | loff_t pos; /* file position */ | ||
39 | }; | ||
40 | |||
41 | struct partial_page { | ||
42 | unsigned int offset; | ||
43 | unsigned int len; | ||
44 | unsigned long private; | ||
45 | }; | ||
46 | |||
47 | /* | ||
48 | * Passed to splice_to_pipe | ||
49 | */ | ||
50 | struct splice_pipe_desc { | ||
51 | struct page **pages; /* page map */ | ||
52 | struct partial_page *partial; /* pages[] may not be contig */ | ||
53 | int nr_pages; /* number of pages in map */ | ||
54 | unsigned int flags; /* splice flags */ | ||
55 | const struct pipe_buf_operations *ops;/* ops associated with output pipe */ | ||
56 | }; | ||
57 | |||
58 | typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *, | ||
59 | struct splice_desc *); | ||
60 | typedef int (splice_direct_actor)(struct pipe_inode_info *, | ||
61 | struct splice_desc *); | ||
62 | |||
63 | extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *, | ||
64 | loff_t *, size_t, unsigned int, | ||
65 | splice_actor *); | ||
66 | extern ssize_t __splice_from_pipe(struct pipe_inode_info *, | ||
67 | struct splice_desc *, splice_actor *); | ||
68 | extern ssize_t splice_to_pipe(struct pipe_inode_info *, | ||
69 | struct splice_pipe_desc *); | ||
70 | extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *, | ||
71 | splice_direct_actor *); | ||
72 | |||
73 | #endif | ||
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 4a7ae8ab6eb8..129d50f2225c 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -253,7 +253,7 @@ struct svc_rqst { | |||
253 | * determine what device number | 253 | * determine what device number |
254 | * to report (real or virtual) | 254 | * to report (real or virtual) |
255 | */ | 255 | */ |
256 | int rq_sendfile_ok; /* turned off in gss privacy | 256 | int rq_splice_ok; /* turned off in gss privacy |
257 | * to prevent encrypting page | 257 | * to prevent encrypting page |
258 | * cache pages */ | 258 | * cache pages */ |
259 | wait_queue_head_t rq_wait; /* synchronization */ | 259 | wait_queue_head_t rq_wait; /* synchronization */ |
diff --git a/include/linux/topology.h b/include/linux/topology.h index a9d1f049cc15..da6c39b2d051 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -98,7 +98,7 @@ | |||
98 | .cache_nice_tries = 0, \ | 98 | .cache_nice_tries = 0, \ |
99 | .busy_idx = 0, \ | 99 | .busy_idx = 0, \ |
100 | .idle_idx = 0, \ | 100 | .idle_idx = 0, \ |
101 | .newidle_idx = 1, \ | 101 | .newidle_idx = 0, \ |
102 | .wake_idx = 0, \ | 102 | .wake_idx = 0, \ |
103 | .forkexec_idx = 0, \ | 103 | .forkexec_idx = 0, \ |
104 | .flags = SD_LOAD_BALANCE \ | 104 | .flags = SD_LOAD_BALANCE \ |
@@ -128,14 +128,15 @@ | |||
128 | .imbalance_pct = 125, \ | 128 | .imbalance_pct = 125, \ |
129 | .cache_nice_tries = 1, \ | 129 | .cache_nice_tries = 1, \ |
130 | .busy_idx = 2, \ | 130 | .busy_idx = 2, \ |
131 | .idle_idx = 1, \ | 131 | .idle_idx = 0, \ |
132 | .newidle_idx = 2, \ | 132 | .newidle_idx = 0, \ |
133 | .wake_idx = 1, \ | 133 | .wake_idx = 1, \ |
134 | .forkexec_idx = 1, \ | 134 | .forkexec_idx = 1, \ |
135 | .flags = SD_LOAD_BALANCE \ | 135 | .flags = SD_LOAD_BALANCE \ |
136 | | SD_BALANCE_NEWIDLE \ | 136 | | SD_BALANCE_NEWIDLE \ |
137 | | SD_BALANCE_EXEC \ | 137 | | SD_BALANCE_EXEC \ |
138 | | SD_WAKE_AFFINE \ | 138 | | SD_WAKE_AFFINE \ |
139 | | SD_WAKE_IDLE \ | ||
139 | | SD_SHARE_PKG_RESOURCES\ | 140 | | SD_SHARE_PKG_RESOURCES\ |
140 | | BALANCE_FOR_MC_POWER, \ | 141 | | BALANCE_FOR_MC_POWER, \ |
141 | .last_balance = jiffies, \ | 142 | .last_balance = jiffies, \ |
@@ -158,14 +159,15 @@ | |||
158 | .imbalance_pct = 125, \ | 159 | .imbalance_pct = 125, \ |
159 | .cache_nice_tries = 1, \ | 160 | .cache_nice_tries = 1, \ |
160 | .busy_idx = 2, \ | 161 | .busy_idx = 2, \ |
161 | .idle_idx = 1, \ | 162 | .idle_idx = 0, \ |
162 | .newidle_idx = 2, \ | 163 | .newidle_idx = 0, \ |
163 | .wake_idx = 1, \ | 164 | .wake_idx = 1, \ |
164 | .forkexec_idx = 1, \ | 165 | .forkexec_idx = 1, \ |
165 | .flags = SD_LOAD_BALANCE \ | 166 | .flags = SD_LOAD_BALANCE \ |
166 | | SD_BALANCE_NEWIDLE \ | 167 | | SD_BALANCE_NEWIDLE \ |
167 | | SD_BALANCE_EXEC \ | 168 | | SD_BALANCE_EXEC \ |
168 | | SD_WAKE_AFFINE \ | 169 | | SD_WAKE_AFFINE \ |
170 | | SD_WAKE_IDLE \ | ||
169 | | BALANCE_FOR_PKG_POWER,\ | 171 | | BALANCE_FOR_PKG_POWER,\ |
170 | .last_balance = jiffies, \ | 172 | .last_balance = jiffies, \ |
171 | .balance_interval = 1, \ | 173 | .balance_interval = 1, \ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 94bd38a6d947..56aa2ee21f1b 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -729,6 +729,22 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor | |||
729 | .bcdDevice_lo = (lo), .bcdDevice_hi = (hi) | 729 | .bcdDevice_lo = (lo), .bcdDevice_hi = (hi) |
730 | 730 | ||
731 | /** | 731 | /** |
732 | * USB_DEVICE_INTERFACE_PROTOCOL - macro used to describe a usb | ||
733 | * device with a specific interface protocol | ||
734 | * @vend: the 16 bit USB Vendor ID | ||
735 | * @prod: the 16 bit USB Product ID | ||
736 | * @pr: bInterfaceProtocol value | ||
737 | * | ||
738 | * This macro is used to create a struct usb_device_id that matches a | ||
739 | * specific interface protocol of devices. | ||
740 | */ | ||
741 | #define USB_DEVICE_INTERFACE_PROTOCOL(vend,prod,pr) \ | ||
742 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_PROTOCOL, \ | ||
743 | .idVendor = (vend), \ | ||
744 | .idProduct = (prod), \ | ||
745 | .bInterfaceProtocol = (pr) | ||
746 | |||
747 | /** | ||
732 | * USB_DEVICE_INFO - macro used to describe a class of usb devices | 748 | * USB_DEVICE_INFO - macro used to describe a class of usb devices |
733 | * @cl: bDeviceClass value | 749 | * @cl: bDeviceClass value |
734 | * @sc: bDeviceSubClass value | 750 | * @sc: bDeviceSubClass value |
diff --git a/include/linux/wait.h b/include/linux/wait.h index e820d00e1383..0e686280450b 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -366,15 +366,15 @@ static inline void remove_wait_queue_locked(wait_queue_head_t *q, | |||
366 | 366 | ||
367 | /* | 367 | /* |
368 | * These are the old interfaces to sleep waiting for an event. | 368 | * These are the old interfaces to sleep waiting for an event. |
369 | * They are racy. DO NOT use them, use the wait_event* interfaces above. | 369 | * They are racy. DO NOT use them, use the wait_event* interfaces above. |
370 | * We plan to remove these interfaces during 2.7. | 370 | * We plan to remove these interfaces. |
371 | */ | 371 | */ |
372 | extern void FASTCALL(sleep_on(wait_queue_head_t *q)); | 372 | extern void sleep_on(wait_queue_head_t *q); |
373 | extern long FASTCALL(sleep_on_timeout(wait_queue_head_t *q, | 373 | extern long sleep_on_timeout(wait_queue_head_t *q, |
374 | signed long timeout)); | 374 | signed long timeout); |
375 | extern void FASTCALL(interruptible_sleep_on(wait_queue_head_t *q)); | 375 | extern void interruptible_sleep_on(wait_queue_head_t *q); |
376 | extern long FASTCALL(interruptible_sleep_on_timeout(wait_queue_head_t *q, | 376 | extern long interruptible_sleep_on_timeout(wait_queue_head_t *q, |
377 | signed long timeout)); | 377 | signed long timeout); |
378 | 378 | ||
379 | /* | 379 | /* |
380 | * Waitqueues which are removed from the waitqueue_head at wakeup time | 380 | * Waitqueues which are removed from the waitqueue_head at wakeup time |
diff --git a/include/net/ax88796.h b/include/net/ax88796.h new file mode 100644 index 000000000000..ee786a043b3d --- /dev/null +++ b/include/net/ax88796.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* include/net/ax88796.h | ||
2 | * | ||
3 | * Copyright 2005 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #ifndef __NET_AX88796_PLAT_H | ||
13 | #define __NET_AX88796_PLAT_H | ||
14 | |||
15 | #define AXFLG_HAS_EEPROM (1<<0) | ||
16 | #define AXFLG_MAC_FROMDEV (1<<1) /* device already has MAC */ | ||
17 | |||
18 | struct ax_plat_data { | ||
19 | unsigned int flags; | ||
20 | unsigned char wordlength; /* 1 or 2 */ | ||
21 | unsigned char dcr_val; /* default value for DCR */ | ||
22 | unsigned char rcr_val; /* default value for RCR */ | ||
23 | unsigned char gpoc_val; /* default value for GPOC */ | ||
24 | u32 *reg_offsets; /* register offsets */ | ||
25 | }; | ||
26 | |||
27 | #endif /* __NET_AX88796_PLAT_H */ | ||
diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h index eae7e2e84497..ad6e278ba7f2 100644 --- a/include/pcmcia/ciscode.h +++ b/include/pcmcia/ciscode.h | |||
@@ -126,4 +126,6 @@ | |||
126 | #define MANFID_POSSIO 0x030c | 126 | #define MANFID_POSSIO 0x030c |
127 | #define PRODID_POSSIO_GCC 0x0003 | 127 | #define PRODID_POSSIO_GCC 0x0003 |
128 | 128 | ||
129 | #define MANFID_NEC 0x0010 | ||
130 | |||
129 | #endif /* _LINUX_CISCODE_H */ | 131 | #endif /* _LINUX_CISCODE_H */ |