diff options
Diffstat (limited to 'include')
76 files changed, 1907 insertions, 393 deletions
diff --git a/include/asm-arm/arch-aaec2000/aaec2000.h b/include/asm-arm/arch-aaec2000/aaec2000.h index 0e9b7e18af05..002227924b9f 100644 --- a/include/asm-arm/arch-aaec2000/aaec2000.h +++ b/include/asm-arm/arch-aaec2000/aaec2000.h | |||
@@ -17,6 +17,16 @@ | |||
17 | #error You must include hardware.h not this file | 17 | #error You must include hardware.h not this file |
18 | #endif /* __ASM_ARCH_HARDWARE_H */ | 18 | #endif /* __ASM_ARCH_HARDWARE_H */ |
19 | 19 | ||
20 | /* Chip selects */ | ||
21 | #define AAEC_CS0 0x00000000 | ||
22 | #define AAEC_CS1 0x10000000 | ||
23 | #define AAEC_CS2 0x20000000 | ||
24 | #define AAEC_CS3 0x30000000 | ||
25 | |||
26 | /* Flash */ | ||
27 | #define AAEC_FLASH_BASE AAEC_CS0 | ||
28 | #define AAEC_FLASH_SIZE SZ_64M | ||
29 | |||
20 | /* Interrupt controller */ | 30 | /* Interrupt controller */ |
21 | #define IRQ_BASE __REG(0x80000500) | 31 | #define IRQ_BASE __REG(0x80000500) |
22 | #define IRQ_INTSR __REG(0x80000500) /* Int Status Register */ | 32 | #define IRQ_INTSR __REG(0x80000500) /* Int Status Register */ |
@@ -148,4 +158,50 @@ | |||
148 | #define POWER_STFCLR __REG(0x8000041c) /* NbFlg, RSTFlg, PFFlg, CLDFlg Clear */ | 158 | #define POWER_STFCLR __REG(0x8000041c) /* NbFlg, RSTFlg, PFFlg, CLDFlg Clear */ |
149 | #define POWER_CLKSET __REG(0x80000420) /* Clock Speed Control */ | 159 | #define POWER_CLKSET __REG(0x80000420) /* Clock Speed Control */ |
150 | 160 | ||
161 | /* GPIO Registers */ | ||
162 | #define AAEC_GPIO_PHYS 0x80000e00 | ||
163 | |||
164 | #define AAEC_GPIO_PADR __REG(AAEC_GPIO_PHYS + 0x00) | ||
165 | #define AAEC_GPIO_PBDR __REG(AAEC_GPIO_PHYS + 0x04) | ||
166 | #define AAEC_GPIO_PCDR __REG(AAEC_GPIO_PHYS + 0x08) | ||
167 | #define AAEC_GPIO_PDDR __REG(AAEC_GPIO_PHYS + 0x0c) | ||
168 | #define AAEC_GPIO_PADDR __REG(AAEC_GPIO_PHYS + 0x10) | ||
169 | #define AAEC_GPIO_PBDDR __REG(AAEC_GPIO_PHYS + 0x14) | ||
170 | #define AAEC_GPIO_PCDDR __REG(AAEC_GPIO_PHYS + 0x18) | ||
171 | #define AAEC_GPIO_PDDDR __REG(AAEC_GPIO_PHYS + 0x1c) | ||
172 | #define AAEC_GPIO_PEDR __REG(AAEC_GPIO_PHYS + 0x20) | ||
173 | #define AAEC_GPIO_PEDDR __REG(AAEC_GPIO_PHYS + 0x24) | ||
174 | #define AAEC_GPIO_KSCAN __REG(AAEC_GPIO_PHYS + 0x28) | ||
175 | #define AAEC_GPIO_PINMUX __REG(AAEC_GPIO_PHYS + 0x2c) | ||
176 | #define AAEC_GPIO_PFDR __REG(AAEC_GPIO_PHYS + 0x30) | ||
177 | #define AAEC_GPIO_PFDDR __REG(AAEC_GPIO_PHYS + 0x34) | ||
178 | #define AAEC_GPIO_PGDR __REG(AAEC_GPIO_PHYS + 0x38) | ||
179 | #define AAEC_GPIO_PGDDR __REG(AAEC_GPIO_PHYS + 0x3c) | ||
180 | #define AAEC_GPIO_PHDR __REG(AAEC_GPIO_PHYS + 0x40) | ||
181 | #define AAEC_GPIO_PHDDR __REG(AAEC_GPIO_PHYS + 0x44) | ||
182 | #define AAEC_GPIO_RAZ __REG(AAEC_GPIO_PHYS + 0x48) | ||
183 | #define AAEC_GPIO_INTTYPE1 __REG(AAEC_GPIO_PHYS + 0x4c) | ||
184 | #define AAEC_GPIO_INTTYPE2 __REG(AAEC_GPIO_PHYS + 0x50) | ||
185 | #define AAEC_GPIO_FEOI __REG(AAEC_GPIO_PHYS + 0x54) | ||
186 | #define AAEC_GPIO_INTEN __REG(AAEC_GPIO_PHYS + 0x58) | ||
187 | #define AAEC_GPIO_INTSTATUS __REG(AAEC_GPIO_PHYS + 0x5c) | ||
188 | #define AAEC_GPIO_RAWINTSTATUS __REG(AAEC_GPIO_PHYS + 0x60) | ||
189 | #define AAEC_GPIO_DB __REG(AAEC_GPIO_PHYS + 0x64) | ||
190 | #define AAEC_GPIO_PAPINDR __REG(AAEC_GPIO_PHYS + 0x68) | ||
191 | #define AAEC_GPIO_PBPINDR __REG(AAEC_GPIO_PHYS + 0x6c) | ||
192 | #define AAEC_GPIO_PCPINDR __REG(AAEC_GPIO_PHYS + 0x70) | ||
193 | #define AAEC_GPIO_PDPINDR __REG(AAEC_GPIO_PHYS + 0x74) | ||
194 | #define AAEC_GPIO_PEPINDR __REG(AAEC_GPIO_PHYS + 0x78) | ||
195 | #define AAEC_GPIO_PFPINDR __REG(AAEC_GPIO_PHYS + 0x7c) | ||
196 | #define AAEC_GPIO_PGPINDR __REG(AAEC_GPIO_PHYS + 0x80) | ||
197 | #define AAEC_GPIO_PHPINDR __REG(AAEC_GPIO_PHYS + 0x84) | ||
198 | |||
199 | #define AAEC_GPIO_PINMUX_PE0CON (1 << 0) | ||
200 | #define AAEC_GPIO_PINMUX_PD0CON (1 << 1) | ||
201 | #define AAEC_GPIO_PINMUX_CODECON (1 << 2) | ||
202 | #define AAEC_GPIO_PINMUX_UART3CON (1 << 3) | ||
203 | |||
204 | /* LCD Controller */ | ||
205 | #define AAEC_CLCD_PHYS 0x80003000 | ||
206 | |||
151 | #endif /* __ARM_ARCH_AAEC2000_H */ | 207 | #endif /* __ARM_ARCH_AAEC2000_H */ |
diff --git a/include/asm-arm/arch-aaec2000/aaed2000.h b/include/asm-arm/arch-aaec2000/aaed2000.h new file mode 100644 index 000000000000..bc76d2badb91 --- /dev/null +++ b/include/asm-arm/arch-aaec2000/aaed2000.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaec2000/aaed2000.h | ||
3 | * | ||
4 | * AAED-2000 specific bits definition | ||
5 | * | ||
6 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
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 __ASM_ARCH_AAED2000_H | ||
14 | #define __ASM_ARCH_AAED2000_H | ||
15 | |||
16 | /* External GPIOs. */ | ||
17 | |||
18 | #define EXT_GPIO_PBASE AAEC_CS3 | ||
19 | #define EXT_GPIO_VBASE 0xf8100000 | ||
20 | #define EXT_GPIO_LENGTH 0x00001000 | ||
21 | |||
22 | #define __ext_gpio_p2v(x) ((x) - EXT_GPIO_PBASE + EXT_GPIO_VBASE) | ||
23 | #define __ext_gpio_v2p(x) ((x) + EXT_GPIO_PBASE - EXT_GPIO_VBASE) | ||
24 | |||
25 | #define __EXT_GPIO_REG(x) (*((volatile u32 *)__ext_gpio_p2v(x))) | ||
26 | #define __EXT_GPIO_PREG(x) (__ext_gpio_v2p((u32)&(x))) | ||
27 | |||
28 | #define AAED_EXT_GPIO __EXT_GPIO_REG(EXT_GPIO_PBASE) | ||
29 | |||
30 | #define AAED_EGPIO_KBD_SCAN 0x00003fff /* Keyboard scan data */ | ||
31 | #define AAED_EGPIO_PWR_INT 0x00008fff /* Smart battery charger interrupt */ | ||
32 | #define AAED_EGPIO_SWITCHED 0x000f0000 /* DIP Switches */ | ||
33 | #define AAED_EGPIO_USB_VBUS 0x00400000 /* USB Vbus sense */ | ||
34 | #define AAED_EGPIO_LCD_PWR_EN 0x02000000 /* LCD and backlight PWR enable */ | ||
35 | #define AAED_EGPIO_nLED0 0x20000000 /* LED 0 */ | ||
36 | #define AAED_EGPIO_nLED1 0x20000000 /* LED 1 */ | ||
37 | #define AAED_EGPIO_nLED2 0x20000000 /* LED 2 */ | ||
38 | |||
39 | |||
40 | #endif /* __ARM_ARCH_AAED2000_H */ | ||
diff --git a/include/asm-arm/arch-aaec2000/hardware.h b/include/asm-arm/arch-aaec2000/hardware.h index 4c37219e030e..153506fd06ed 100644 --- a/include/asm-arm/arch-aaec2000/hardware.h +++ b/include/asm-arm/arch-aaec2000/hardware.h | |||
@@ -11,7 +11,8 @@ | |||
11 | #ifndef __ASM_ARCH_HARDWARE_H | 11 | #ifndef __ASM_ARCH_HARDWARE_H |
12 | #define __ASM_ARCH_HARDWARE_H | 12 | #define __ASM_ARCH_HARDWARE_H |
13 | 13 | ||
14 | #include <linux/config.h> | 14 | #include <asm/sizes.h> |
15 | #include <asm/arch/aaec2000.h> | ||
15 | 16 | ||
16 | /* The kernel is loaded at physical address 0xf8000000. | 17 | /* The kernel is loaded at physical address 0xf8000000. |
17 | * We map the IO space a bit after | 18 | * We map the IO space a bit after |
diff --git a/include/asm-arm/arch-aaec2000/io.h b/include/asm-arm/arch-aaec2000/io.h index c58a8d10425a..8d67907fd4f0 100644 --- a/include/asm-arm/arch-aaec2000/io.h +++ b/include/asm-arm/arch-aaec2000/io.h | |||
@@ -6,6 +6,8 @@ | |||
6 | #ifndef __ASM_ARM_ARCH_IO_H | 6 | #ifndef __ASM_ARM_ARCH_IO_H |
7 | #define __ASM_ARM_ARCH_IO_H | 7 | #define __ASM_ARM_ARCH_IO_H |
8 | 8 | ||
9 | #include <asm/hardware.h> | ||
10 | |||
9 | #define IO_SPACE_LIMIT 0xffffffff | 11 | #define IO_SPACE_LIMIT 0xffffffff |
10 | 12 | ||
11 | /* | 13 | /* |
diff --git a/include/asm-arm/arch-cl7500/io.h b/include/asm-arm/arch-cl7500/io.h index f0113bc75630..89a33287f4fe 100644 --- a/include/asm-arm/arch-cl7500/io.h +++ b/include/asm-arm/arch-cl7500/io.h | |||
@@ -10,6 +10,8 @@ | |||
10 | #ifndef __ASM_ARM_ARCH_IO_H | 10 | #ifndef __ASM_ARM_ARCH_IO_H |
11 | #define __ASM_ARM_ARCH_IO_H | 11 | #define __ASM_ARM_ARCH_IO_H |
12 | 12 | ||
13 | #include <asm/hardware.h> | ||
14 | |||
13 | #define IO_SPACE_LIMIT 0xffffffff | 15 | #define IO_SPACE_LIMIT 0xffffffff |
14 | 16 | ||
15 | /* | 17 | /* |
diff --git a/include/asm-arm/arch-clps711x/hardware.h b/include/asm-arm/arch-clps711x/hardware.h index 1386871e1a5a..f864c367c934 100644 --- a/include/asm-arm/arch-clps711x/hardware.h +++ b/include/asm-arm/arch-clps711x/hardware.h | |||
@@ -235,4 +235,121 @@ | |||
235 | #define CEIVA_PB0_BLK_BTN (1<<0) | 235 | #define CEIVA_PB0_BLK_BTN (1<<0) |
236 | #endif // #if defined (CONFIG_ARCH_CEIVA) | 236 | #endif // #if defined (CONFIG_ARCH_CEIVA) |
237 | 237 | ||
238 | #if defined (CONFIG_MACH_MP1000) | ||
239 | /* NOR FLASH */ | ||
240 | #define MP1000_NIO_BASE 0xf9000000 /* virtual */ | ||
241 | #define MP1000_NIO_START CS0_PHYS_BASE /* physical */ | ||
242 | #define MP1000_NIO_SIZE 0x00400000 | ||
243 | |||
244 | /* DSP Interface */ | ||
245 | #define MP1000_DSP_BASE 0xfa000000 /* virtual */ | ||
246 | #define MP1000_DSP_START CS1_PHYS_BASE /* physical */ | ||
247 | #define MP1000_DSP_SIZE 0x00100000 | ||
248 | |||
249 | /* LCD, DAA/DSP, RTC, DAA RW Reg all in CS2 */ | ||
250 | #define MP1000_LIO_BASE 0xfb000000 /* virtual */ | ||
251 | #define MP1000_LIO_START CS2_PHYS_BASE /* physical */ | ||
252 | #define MP1000_LIO_SIZE 0x00100000 | ||
253 | |||
254 | /* NAND FLASH */ | ||
255 | #define MP1000_FIO_BASE 0xfc000000 /* virtual */ | ||
256 | #define MP1000_FIO_START CS3_PHYS_BASE /* physical */ | ||
257 | #define MP1000_FIO_SIZE 0x00800000 | ||
258 | |||
259 | /* Ethernet */ | ||
260 | #define MP1000_EIO_BASE 0xfd000000 /* virtual */ | ||
261 | #define MP1000_EIO_START CS4_PHYS_BASE /* physical */ | ||
262 | #define MP1000_EIO_SIZE 0x00100000 | ||
263 | |||
264 | #define MP1000_LCD_OFFSET 0x00000000 /* LCD offset in CS2 */ | ||
265 | #define MP1000_DDD_OFFSET 0x00001000 /* DAA/DAI/DSP sft reset offst*/ | ||
266 | #define MP1000_RTC_OFFSET 0x00002000 /* RTC offset in CS2 */ | ||
267 | #define MP1000_DAA_OFFSET 0x00003000 /* DAA RW reg offset in CS2 */ | ||
268 | |||
269 | /* IDE */ | ||
270 | #define MP1000_IDE_BASE 0xfe000000 /* virtual */ | ||
271 | #define MP1000_IDE_START CS5_PHYS_BASE /* physical */ | ||
272 | #define MP1000_IDE_SIZE 0x00100000 /* actually it's only 0x1000 */ | ||
273 | |||
274 | #define IRQ_HARDDISK IRQ_EINT2 | ||
275 | |||
276 | /* | ||
277 | * IDE registers definition | ||
278 | */ | ||
279 | |||
280 | #define IDE_CONTROL_BASE (MP1000_IDE_BASE + 0x1000) | ||
281 | #define IDE_BASE_OFF (MP1000_IDE_BASE) | ||
282 | |||
283 | #define IDE_WRITE_DEVICE_DATA (IDE_BASE_OFF + 0x0) | ||
284 | #define IDE_FEATURES_REGISTER (IDE_BASE_OFF + 0x2) | ||
285 | #define IDE_SECTOR_COUNT_REGISTER (IDE_BASE_OFF + 0x4) | ||
286 | #define IDE_SECTOR_NUMBER_REGISTER (IDE_BASE_OFF + 0x6) | ||
287 | #define IDE_CYLINDER_LOW_REGISTER (IDE_BASE_OFF + 0x8) | ||
288 | #define IDE_CYLINDER_HIGH_REGISTER (IDE_BASE_OFF + 0xa) | ||
289 | #define IDE_DEVICE_HEAD_REGISTER (IDE_BASE_OFF + 0xc) | ||
290 | #define IDE_COMMAND_DATA_REGISTER (IDE_BASE_OFF + 0xe) | ||
291 | #define IDE_DEVICE_CONTROL_REGISTER (IDE_CONTROL_BASE + 0xc) | ||
292 | |||
293 | #define IDE_IRQ IRQ_EINT2 | ||
294 | |||
295 | |||
296 | #define RTC_PORT(x) (MP1000_LIO_BASE+0x2000 + (x*2)) | ||
297 | #define RTC_ALWAYS_BCD 0 | ||
298 | |||
299 | /* | ||
300 | // Definitions of the bit fields in the HwPortA register for the | ||
301 | // MP1000 board. | ||
302 | */ | ||
303 | #define HwPortAKeyboardRow1 0x00000001 | ||
304 | #define HwPortAKeyboardRow2 0x00000002 | ||
305 | #define HwPortAKeyboardRow3 0x00000004 | ||
306 | #define HwPortAKeyboardRow4 0x00000008 | ||
307 | #define HwPortAKeyboardRow5 0x00000010 | ||
308 | #define HwPortAKeyboardRow6 0x00000020 | ||
309 | #define HwPortALCDEnable 0x00000040 | ||
310 | #define HwPortAOffhook 0x00000080 | ||
311 | |||
312 | /* | ||
313 | // Definitions of the bit fields in the HwPortB register for the | ||
314 | // MP1000 board. | ||
315 | */ | ||
316 | #define HwPortBL3Mode 0x00000001 | ||
317 | #define HwPortBL3Clk 0x00000002 | ||
318 | #define HwPortBSClk 0x00000001 | ||
319 | #define HwPortBSData 0x00000002 | ||
320 | #define HwPortBL3Data 0x00000004 | ||
321 | #define HwPortBMute 0x00000008 | ||
322 | #define HwPortBQD0 0x00000010 | ||
323 | #define HwPortBQD1 0x00000020 | ||
324 | #define HwPortBQD2 0x00000040 | ||
325 | #define HwPortBQD3 0x00000080 | ||
326 | |||
327 | /* | ||
328 | // Definitions of the bit fields in the HwPortD register for the | ||
329 | // MP1000 board. | ||
330 | */ | ||
331 | #define HwPortDLED1 0x00000001 | ||
332 | #define HwPortDLED2 0x00000002 | ||
333 | #define HwPortDLED3 0x00000004 | ||
334 | #define HwPortDLED4 0x00000008 | ||
335 | #define HwPortDLED5 0x00000010 | ||
336 | #define HwPortDEECS 0x00000020 | ||
337 | #define HwPortBRTS 0x00000040 | ||
338 | #define HwPortBRI 0x00000080 | ||
339 | |||
340 | |||
341 | /* | ||
342 | // Definitions of the bit fields in the HwPortE register for the | ||
343 | // MP1000 board. | ||
344 | */ | ||
345 | |||
346 | #define HwPortECLE 0x00000001 | ||
347 | #define HwPortESepromDOut 0x00000001 | ||
348 | #define HwPortEALE 0x00000002 | ||
349 | #define HwPortESepromDIn 0x00000002 | ||
350 | #define HwPortENANDCS 0x00000004 | ||
351 | #define HwPortESepromCLK 0x00000004 | ||
352 | |||
353 | #endif // #if defined (CONFIG_MACH_MP1000) | ||
354 | |||
238 | #endif | 355 | #endif |
diff --git a/include/asm-arm/arch-clps711x/io.h b/include/asm-arm/arch-clps711x/io.h index 14d7e8da5453..62613b0e2d96 100644 --- a/include/asm-arm/arch-clps711x/io.h +++ b/include/asm-arm/arch-clps711x/io.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef __ASM_ARM_ARCH_IO_H | 20 | #ifndef __ASM_ARM_ARCH_IO_H |
21 | #define __ASM_ARM_ARCH_IO_H | 21 | #define __ASM_ARM_ARCH_IO_H |
22 | 22 | ||
23 | #include <asm/hardware.h> | ||
24 | |||
23 | #define IO_SPACE_LIMIT 0xffffffff | 25 | #define IO_SPACE_LIMIT 0xffffffff |
24 | 26 | ||
25 | #define __io(a) ((void __iomem *)(a)) | 27 | #define __io(a) ((void __iomem *)(a)) |
diff --git a/include/asm-arm/arch-clps711x/mp1000-seprom.h b/include/asm-arm/arch-clps711x/mp1000-seprom.h new file mode 100644 index 000000000000..3e5566cf9666 --- /dev/null +++ b/include/asm-arm/arch-clps711x/mp1000-seprom.h | |||
@@ -0,0 +1,77 @@ | |||
1 | #ifndef MP1000_SEPROM_H | ||
2 | #define MP1000_SEPROM_H | ||
3 | |||
4 | /* | ||
5 | * mp1000-seprom.h | ||
6 | * | ||
7 | * | ||
8 | * This file contains the Serial EEPROM definitions for the MP1000 board | ||
9 | * | ||
10 | * Copyright (C) 2005 Comdial Corporation | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License as published by | ||
14 | * the Free Software Foundation; either version 2 of the License, or | ||
15 | * (at your option) any later version. | ||
16 | * | ||
17 | * This program is distributed in the hope that it will be useful, | ||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | * GNU General Public License for more details. | ||
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
25 | * | ||
26 | */ | ||
27 | |||
28 | #define COMMAND_ERASE (0x1C0) | ||
29 | #define COMMAND_ERASE_ALL (0x120) | ||
30 | #define COMMAND_WRITE_DISABLE (0x100) | ||
31 | #define COMMAND_WRITE_ENABLE (0x130) | ||
32 | #define COMMAND_READ (0x180) | ||
33 | #define COMMAND_WRITE (0x140) | ||
34 | #define COMMAND_WRITE_ALL (0x110) | ||
35 | |||
36 | // | ||
37 | // Serial EEPROM data format | ||
38 | // | ||
39 | |||
40 | #define PACKED __attribute__ ((packed)) | ||
41 | |||
42 | typedef struct _EEPROM { | ||
43 | union { | ||
44 | unsigned char eprom_byte_data[128]; | ||
45 | unsigned short eprom_short_data[64]; | ||
46 | struct { | ||
47 | unsigned char version PACKED; // EEPROM Version "1" for now | ||
48 | unsigned char box_id PACKED; // Box ID (Standalone, SOHO, embedded, etc) | ||
49 | unsigned char major_hw_version PACKED; // Major Hardware version (Hex) | ||
50 | unsigned char minor_hw_version PACKED; // Minor Hardware Version (Hex) | ||
51 | unsigned char mfg_id[3] PACKED; // Manufacturer ID (3 character Alphabetic) | ||
52 | unsigned char mfg_serial_number[10] PACKED; // Manufacturer Serial number | ||
53 | unsigned char mfg_date[3] PACKED; // Date of Mfg (Formatted YY:MM:DD) | ||
54 | unsigned char country PACKED; // Country of deployment | ||
55 | unsigned char mac_Address[6] PACKED; // MAC Address | ||
56 | unsigned char oem_string[20] PACKED; // OEM ID string | ||
57 | unsigned short feature_bits1 PACKED; // Feature Bits 1 | ||
58 | unsigned short feature_bits2 PACKED; // Feature Bits 2 | ||
59 | unsigned char filler[75] PACKED; // Unused/Undefined “0” initialized | ||
60 | unsigned short checksum PACKED; // byte accumulated short checksum | ||
61 | } eprom_struct; | ||
62 | } variant; | ||
63 | } eeprom_struct; | ||
64 | |||
65 | /* These settings must be mutually exclusive */ | ||
66 | #define FEATURE_BITS1_DRAMSIZE_16MEG 0x0001 /* 0 signifies 4 MEG system */ | ||
67 | #define FEATURE_BITS1_DRAMSIZE_8MEG 0x0002 /* 1 in bit 1 = 8MEG system */ | ||
68 | #define FEATURE_BITS1_DRAMSIZE_64MEG 0x0004 /* 1 in bit 2 = 64MEG system */ | ||
69 | |||
70 | #define FEATURE_BITS1_CPUIS90MEG 0x0010 | ||
71 | |||
72 | extern void seprom_init(void); | ||
73 | extern eeprom_struct* get_seprom_ptr(void); | ||
74 | extern unsigned char* get_eeprom_mac_address(void); | ||
75 | |||
76 | #endif /* MP1000_SEPROM_H */ | ||
77 | |||
diff --git a/include/asm-arm/arch-ebsa285/io.h b/include/asm-arm/arch-ebsa285/io.h index 70576b17f922..776f9d377057 100644 --- a/include/asm-arm/arch-ebsa285/io.h +++ b/include/asm-arm/arch-ebsa285/io.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #ifndef __ASM_ARM_ARCH_IO_H | 14 | #ifndef __ASM_ARM_ARCH_IO_H |
15 | #define __ASM_ARM_ARCH_IO_H | 15 | #define __ASM_ARM_ARCH_IO_H |
16 | 16 | ||
17 | #include <asm/hardware.h> | ||
18 | |||
17 | #define IO_SPACE_LIMIT 0xffff | 19 | #define IO_SPACE_LIMIT 0xffff |
18 | 20 | ||
19 | /* | 21 | /* |
diff --git a/include/asm-arm/arch-epxa10db/io.h b/include/asm-arm/arch-epxa10db/io.h index 1f0afa257621..9fe100c9d6be 100644 --- a/include/asm-arm/arch-epxa10db/io.h +++ b/include/asm-arm/arch-epxa10db/io.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef __ASM_ARM_ARCH_IO_H | 20 | #ifndef __ASM_ARM_ARCH_IO_H |
21 | #define __ASM_ARM_ARCH_IO_H | 21 | #define __ASM_ARM_ARCH_IO_H |
22 | 22 | ||
23 | #include <asm/hardware.h> | ||
24 | |||
23 | #define IO_SPACE_LIMIT 0xffff | 25 | #define IO_SPACE_LIMIT 0xffff |
24 | 26 | ||
25 | 27 | ||
diff --git a/include/asm-arm/arch-h720x/io.h b/include/asm-arm/arch-h720x/io.h index 68814828c9a7..d3ccfd8172b7 100644 --- a/include/asm-arm/arch-h720x/io.h +++ b/include/asm-arm/arch-h720x/io.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #ifndef __ASM_ARM_ARCH_IO_H | 14 | #ifndef __ASM_ARM_ARCH_IO_H |
15 | #define __ASM_ARM_ARCH_IO_H | 15 | #define __ASM_ARM_ARCH_IO_H |
16 | 16 | ||
17 | #include <asm/arch/hardware.h> | 17 | #include <asm/hardware.h> |
18 | 18 | ||
19 | #define IO_SPACE_LIMIT 0xffffffff | 19 | #define IO_SPACE_LIMIT 0xffffffff |
20 | 20 | ||
diff --git a/include/asm-arm/arch-imx/io.h b/include/asm-arm/arch-imx/io.h index 28a4cca6a4cb..b191cdd05576 100644 --- a/include/asm-arm/arch-imx/io.h +++ b/include/asm-arm/arch-imx/io.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef __ASM_ARM_ARCH_IO_H | 20 | #ifndef __ASM_ARM_ARCH_IO_H |
21 | #define __ASM_ARM_ARCH_IO_H | 21 | #define __ASM_ARM_ARCH_IO_H |
22 | 22 | ||
23 | #include <asm/hardware.h> | ||
24 | |||
23 | #define IO_SPACE_LIMIT 0xffffffff | 25 | #define IO_SPACE_LIMIT 0xffffffff |
24 | 26 | ||
25 | #define __io(a) ((void __iomem *)(a)) | 27 | #define __io(a) ((void __iomem *)(a)) |
diff --git a/include/asm-arm/arch-integrator/hardware.h b/include/asm-arm/arch-integrator/hardware.h index be2716eeaa02..6f0947bc500d 100644 --- a/include/asm-arm/arch-integrator/hardware.h +++ b/include/asm-arm/arch-integrator/hardware.h | |||
@@ -33,15 +33,6 @@ | |||
33 | #define IO_SIZE 0x0B000000 // How much? | 33 | #define IO_SIZE 0x0B000000 // How much? |
34 | #define IO_START INTEGRATOR_HDR_BASE // PA of IO | 34 | #define IO_START INTEGRATOR_HDR_BASE // PA of IO |
35 | 35 | ||
36 | /* | ||
37 | * Similar to above, but for PCI addresses (memory, IO, Config and the | ||
38 | * V3 chip itself). WARNING: this has to mirror definitions in platform.h | ||
39 | */ | ||
40 | #define PCI_MEMORY_VADDR 0xe8000000 | ||
41 | #define PCI_CONFIG_VADDR 0xec000000 | ||
42 | #define PCI_V3_VADDR 0xed000000 | ||
43 | #define PCI_IO_VADDR 0xee000000 | ||
44 | |||
45 | #define PCIO_BASE PCI_IO_VADDR | 36 | #define PCIO_BASE PCI_IO_VADDR |
46 | #define PCIMEM_BASE PCI_MEMORY_VADDR | 37 | #define PCIMEM_BASE PCI_MEMORY_VADDR |
47 | 38 | ||
diff --git a/include/asm-arm/arch-integrator/io.h b/include/asm-arm/arch-integrator/io.h index fbea8be67d26..31f2deab51b0 100644 --- a/include/asm-arm/arch-integrator/io.h +++ b/include/asm-arm/arch-integrator/io.h | |||
@@ -22,6 +22,14 @@ | |||
22 | 22 | ||
23 | #define IO_SPACE_LIMIT 0xffff | 23 | #define IO_SPACE_LIMIT 0xffff |
24 | 24 | ||
25 | /* | ||
26 | * WARNING: this has to mirror definitions in platform.h | ||
27 | */ | ||
28 | #define PCI_MEMORY_VADDR 0xe8000000 | ||
29 | #define PCI_CONFIG_VADDR 0xec000000 | ||
30 | #define PCI_V3_VADDR 0xed000000 | ||
31 | #define PCI_IO_VADDR 0xee000000 | ||
32 | |||
25 | #define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a))) | 33 | #define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a))) |
26 | #define __mem_pci(a) (a) | 34 | #define __mem_pci(a) (a) |
27 | #define __mem_isa(a) ((a) + PCI_MEMORY_VADDR) | 35 | #define __mem_isa(a) ((a) + PCI_MEMORY_VADDR) |
diff --git a/include/asm-arm/arch-iop3xx/io.h b/include/asm-arm/arch-iop3xx/io.h index 2761dfd8694d..f39046a6ab14 100644 --- a/include/asm-arm/arch-iop3xx/io.h +++ b/include/asm-arm/arch-iop3xx/io.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __ASM_ARM_ARCH_IO_H | 11 | #ifndef __ASM_ARM_ARCH_IO_H |
12 | #define __ASM_ARM_ARCH_IO_H | 12 | #define __ASM_ARM_ARCH_IO_H |
13 | 13 | ||
14 | #include <asm/hardware.h> | ||
15 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | 16 | #define IO_SPACE_LIMIT 0xffffffff |
15 | 17 | ||
16 | #define __io(p) ((void __iomem *)(p)) | 18 | #define __io(p) ((void __iomem *)(p)) |
diff --git a/include/asm-arm/arch-ixp2000/io.h b/include/asm-arm/arch-ixp2000/io.h index 3241cd6f0778..7fbcdf9931ee 100644 --- a/include/asm-arm/arch-ixp2000/io.h +++ b/include/asm-arm/arch-ixp2000/io.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #ifndef __ASM_ARM_ARCH_IO_H | 15 | #ifndef __ASM_ARM_ARCH_IO_H |
16 | #define __ASM_ARM_ARCH_IO_H | 16 | #define __ASM_ARM_ARCH_IO_H |
17 | 17 | ||
18 | #include <asm/hardware.h> | ||
19 | |||
18 | #define IO_SPACE_LIMIT 0xffffffff | 20 | #define IO_SPACE_LIMIT 0xffffffff |
19 | #define __mem_pci(a) (a) | 21 | #define __mem_pci(a) (a) |
20 | 22 | ||
diff --git a/include/asm-arm/arch-ixp2000/ixp2000-regs.h b/include/asm-arm/arch-ixp2000/ixp2000-regs.h index 32aece069869..def089d693d2 100644 --- a/include/asm-arm/arch-ixp2000/ixp2000-regs.h +++ b/include/asm-arm/arch-ixp2000/ixp2000-regs.h | |||
@@ -392,4 +392,47 @@ | |||
392 | #define WDT_RESET_ENABLE 0x01000000 | 392 | #define WDT_RESET_ENABLE 0x01000000 |
393 | 393 | ||
394 | 394 | ||
395 | /* | ||
396 | * MSF registers. The IXP2400 and IXP2800 have somewhat different MSF | ||
397 | * units, but the registers that differ between the two don't overlap, | ||
398 | * so we can have one register list for both. | ||
399 | */ | ||
400 | #define IXP2000_MSF_REG(x) ((volatile unsigned long*)(IXP2000_MSF_VIRT_BASE + (x))) | ||
401 | #define IXP2000_MSF_RX_CONTROL IXP2000_MSF_REG(0x0000) | ||
402 | #define IXP2000_MSF_TX_CONTROL IXP2000_MSF_REG(0x0004) | ||
403 | #define IXP2000_MSF_INTERRUPT_STATUS IXP2000_MSF_REG(0x0008) | ||
404 | #define IXP2000_MSF_INTERRUPT_ENABLE IXP2000_MSF_REG(0x000c) | ||
405 | #define IXP2000_MSF_CSIX_TYPE_MAP IXP2000_MSF_REG(0x0010) | ||
406 | #define IXP2000_MSF_FC_EGRESS_STATUS IXP2000_MSF_REG(0x0014) | ||
407 | #define IXP2000_MSF_FC_INGRESS_STATUS IXP2000_MSF_REG(0x0018) | ||
408 | #define IXP2000_MSF_HWM_CONTROL IXP2000_MSF_REG(0x0024) | ||
409 | #define IXP2000_MSF_FC_STATUS_OVERRIDE IXP2000_MSF_REG(0x0028) | ||
410 | #define IXP2000_MSF_CLOCK_CONTROL IXP2000_MSF_REG(0x002c) | ||
411 | #define IXP2000_MSF_RX_PORT_MAP IXP2000_MSF_REG(0x0040) | ||
412 | #define IXP2000_MSF_RBUF_ELEMENT_DONE IXP2000_MSF_REG(0x0044) | ||
413 | #define IXP2000_MSF_RX_MPHY_POLL_LIMIT IXP2000_MSF_REG(0x0048) | ||
414 | #define IXP2000_MSF_RX_CALENDAR_LENGTH IXP2000_MSF_REG(0x0048) | ||
415 | #define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_0 IXP2000_MSF_REG(0x0050) | ||
416 | #define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_1 IXP2000_MSF_REG(0x0054) | ||
417 | #define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_2 IXP2000_MSF_REG(0x0058) | ||
418 | #define IXP2000_MSF_TX_SEQUENCE_0 IXP2000_MSF_REG(0x0060) | ||
419 | #define IXP2000_MSF_TX_SEQUENCE_1 IXP2000_MSF_REG(0x0064) | ||
420 | #define IXP2000_MSF_TX_SEQUENCE_2 IXP2000_MSF_REG(0x0068) | ||
421 | #define IXP2000_MSF_TX_MPHY_POLL_LIMIT IXP2000_MSF_REG(0x0070) | ||
422 | #define IXP2000_MSF_TX_CALENDAR_LENGTH IXP2000_MSF_REG(0x0070) | ||
423 | #define IXP2000_MSF_RX_UP_CONTROL_0 IXP2000_MSF_REG(0x0080) | ||
424 | #define IXP2000_MSF_RX_UP_CONTROL_1 IXP2000_MSF_REG(0x0084) | ||
425 | #define IXP2000_MSF_RX_UP_CONTROL_2 IXP2000_MSF_REG(0x0088) | ||
426 | #define IXP2000_MSF_RX_UP_CONTROL_3 IXP2000_MSF_REG(0x008c) | ||
427 | #define IXP2000_MSF_TX_UP_CONTROL_0 IXP2000_MSF_REG(0x0090) | ||
428 | #define IXP2000_MSF_TX_UP_CONTROL_1 IXP2000_MSF_REG(0x0094) | ||
429 | #define IXP2000_MSF_TX_UP_CONTROL_2 IXP2000_MSF_REG(0x0098) | ||
430 | #define IXP2000_MSF_TX_UP_CONTROL_3 IXP2000_MSF_REG(0x009c) | ||
431 | #define IXP2000_MSF_TRAIN_DATA IXP2000_MSF_REG(0x00a0) | ||
432 | #define IXP2000_MSF_TRAIN_CALENDAR IXP2000_MSF_REG(0x00a4) | ||
433 | #define IXP2000_MSF_TRAIN_FLOW_CONTROL IXP2000_MSF_REG(0x00a8) | ||
434 | #define IXP2000_MSF_TX_CALENDAR_0 IXP2000_MSF_REG(0x1000) | ||
435 | #define IXP2000_MSF_RX_PORT_CALENDAR_STATUS IXP2000_MSF_REG(0x1400) | ||
436 | |||
437 | |||
395 | #endif /* _IXP2000_H_ */ | 438 | #endif /* _IXP2000_H_ */ |
diff --git a/include/asm-arm/arch-l7200/io.h b/include/asm-arm/arch-l7200/io.h index fc012a39e2cb..cab8ad0adf09 100644 --- a/include/asm-arm/arch-l7200/io.h +++ b/include/asm-arm/arch-l7200/io.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #ifndef __ASM_ARM_ARCH_IO_H | 10 | #ifndef __ASM_ARM_ARCH_IO_H |
11 | #define __ASM_ARM_ARCH_IO_H | 11 | #define __ASM_ARM_ARCH_IO_H |
12 | 12 | ||
13 | #include <asm/arch/hardware.h> | 13 | #include <asm/hardware.h> |
14 | 14 | ||
15 | #define IO_SPACE_LIMIT 0xffffffff | 15 | #define IO_SPACE_LIMIT 0xffffffff |
16 | 16 | ||
diff --git a/include/asm-arm/arch-lh7a40x/io.h b/include/asm-arm/arch-lh7a40x/io.h index c13bdd9add92..bbcd4335f441 100644 --- a/include/asm-arm/arch-lh7a40x/io.h +++ b/include/asm-arm/arch-lh7a40x/io.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __ASM_ARCH_IO_H | 11 | #ifndef __ASM_ARCH_IO_H |
12 | #define __ASM_ARCH_IO_H | 12 | #define __ASM_ARCH_IO_H |
13 | 13 | ||
14 | #include <asm/hardware.h> | ||
15 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | 16 | #define IO_SPACE_LIMIT 0xffffffff |
15 | 17 | ||
16 | /* No ISA or PCI bus on this machine. */ | 18 | /* No ISA or PCI bus on this machine. */ |
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h index 11fbf629bf75..3d5bcd545082 100644 --- a/include/asm-arm/arch-omap/io.h +++ b/include/asm-arm/arch-omap/io.h | |||
@@ -34,6 +34,8 @@ | |||
34 | #ifndef __ASM_ARM_ARCH_IO_H | 34 | #ifndef __ASM_ARM_ARCH_IO_H |
35 | #define __ASM_ARM_ARCH_IO_H | 35 | #define __ASM_ARM_ARCH_IO_H |
36 | 36 | ||
37 | #include <asm/hardware.h> | ||
38 | |||
37 | #define IO_SPACE_LIMIT 0xffffffff | 39 | #define IO_SPACE_LIMIT 0xffffffff |
38 | 40 | ||
39 | /* | 41 | /* |
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h index cf35721cfa45..3e70bd95472c 100644 --- a/include/asm-arm/arch-pxa/hardware.h +++ b/include/asm-arm/arch-pxa/hardware.h | |||
@@ -44,12 +44,12 @@ | |||
44 | 44 | ||
45 | #ifndef __ASSEMBLY__ | 45 | #ifndef __ASSEMBLY__ |
46 | 46 | ||
47 | # define __REG(x) (*((volatile unsigned long *)io_p2v(x))) | 47 | # define __REG(x) (*((volatile u32 *)io_p2v(x))) |
48 | 48 | ||
49 | /* With indexed regs we don't want to feed the index through io_p2v() | 49 | /* With indexed regs we don't want to feed the index through io_p2v() |
50 | especially if it is a variable, otherwise horrible code will result. */ | 50 | especially if it is a variable, otherwise horrible code will result. */ |
51 | # define __REG2(x,y) \ | 51 | # define __REG2(x,y) \ |
52 | (*(volatile unsigned long *)((unsigned long)&__REG(x) + (y))) | 52 | (*(volatile u32 *)((u32)&__REG(x) + (y))) |
53 | 53 | ||
54 | # define __PREG(x) (io_v2p((u32)&(x))) | 54 | # define __PREG(x) (io_v2p((u32)&(x))) |
55 | 55 | ||
diff --git a/include/asm-arm/arch-pxa/io.h b/include/asm-arm/arch-pxa/io.h index c3bdbe44e21f..eb2dd58d397f 100644 --- a/include/asm-arm/arch-pxa/io.h +++ b/include/asm-arm/arch-pxa/io.h | |||
@@ -6,6 +6,8 @@ | |||
6 | #ifndef __ASM_ARM_ARCH_IO_H | 6 | #ifndef __ASM_ARM_ARCH_IO_H |
7 | #define __ASM_ARM_ARCH_IO_H | 7 | #define __ASM_ARM_ARCH_IO_H |
8 | 8 | ||
9 | #include <asm/hardware.h> | ||
10 | |||
9 | #define IO_SPACE_LIMIT 0xffffffff | 11 | #define IO_SPACE_LIMIT 0xffffffff |
10 | 12 | ||
11 | /* | 13 | /* |
diff --git a/include/asm-arm/arch-pxa/irda.h b/include/asm-arm/arch-pxa/irda.h new file mode 100644 index 000000000000..748406f384c2 --- /dev/null +++ b/include/asm-arm/arch-pxa/irda.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef ASMARM_ARCH_IRDA_H | ||
2 | #define ASMARM_ARCH_IRDA_H | ||
3 | |||
4 | /* board specific transceiver capabilities */ | ||
5 | |||
6 | #define IR_OFF 1 | ||
7 | #define IR_SIRMODE 2 | ||
8 | #define IR_FIRMODE 4 | ||
9 | |||
10 | struct pxaficp_platform_data { | ||
11 | int transceiver_cap; | ||
12 | void (*transceiver_mode)(struct device *dev, int mode); | ||
13 | }; | ||
14 | |||
15 | extern void pxa_set_ficp_info(struct pxaficp_platform_data *info); | ||
16 | |||
17 | #endif | ||
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h index 3af7165ab0d7..a75a2470f4f5 100644 --- a/include/asm-arm/arch-pxa/pxa-regs.h +++ b/include/asm-arm/arch-pxa/pxa-regs.h | |||
@@ -326,6 +326,25 @@ | |||
326 | #define STDLL __REG(0x40700000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */ | 326 | #define STDLL __REG(0x40700000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */ |
327 | #define STDLH __REG(0x40700004) /* Divisor Latch High Register (DLAB = 1) (read/write) */ | 327 | #define STDLH __REG(0x40700004) /* Divisor Latch High Register (DLAB = 1) (read/write) */ |
328 | 328 | ||
329 | /* Hardware UART (HWUART) */ | ||
330 | #define HWUART HWRBR | ||
331 | #define HWRBR __REG(0x41600000) /* Receive Buffer Register (read only) */ | ||
332 | #define HWTHR __REG(0x41600000) /* Transmit Holding Register (write only) */ | ||
333 | #define HWIER __REG(0x41600004) /* Interrupt Enable Register (read/write) */ | ||
334 | #define HWIIR __REG(0x41600008) /* Interrupt ID Register (read only) */ | ||
335 | #define HWFCR __REG(0x41600008) /* FIFO Control Register (write only) */ | ||
336 | #define HWLCR __REG(0x4160000C) /* Line Control Register (read/write) */ | ||
337 | #define HWMCR __REG(0x41600010) /* Modem Control Register (read/write) */ | ||
338 | #define HWLSR __REG(0x41600014) /* Line Status Register (read only) */ | ||
339 | #define HWMSR __REG(0x41600018) /* Modem Status Register (read only) */ | ||
340 | #define HWSPR __REG(0x4160001C) /* Scratch Pad Register (read/write) */ | ||
341 | #define HWISR __REG(0x41600020) /* Infrared Selection Register (read/write) */ | ||
342 | #define HWFOR __REG(0x41600024) /* Receive FIFO Occupancy Register (read only) */ | ||
343 | #define HWABR __REG(0x41600028) /* Auto-Baud Control Register (read/write) */ | ||
344 | #define HWACR __REG(0x4160002C) /* Auto-Baud Count Register (read only) */ | ||
345 | #define HWDLL __REG(0x41600000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */ | ||
346 | #define HWDLH __REG(0x41600004) /* Divisor Latch High Register (DLAB = 1) (read/write) */ | ||
347 | |||
329 | #define IER_DMAE (1 << 7) /* DMA Requests Enable */ | 348 | #define IER_DMAE (1 << 7) /* DMA Requests Enable */ |
330 | #define IER_UUE (1 << 6) /* UART Unit Enable */ | 349 | #define IER_UUE (1 << 6) /* UART Unit Enable */ |
331 | #define IER_NRZE (1 << 5) /* NRZ coding Enable */ | 350 | #define IER_NRZE (1 << 5) /* NRZ coding Enable */ |
@@ -1013,14 +1032,12 @@ | |||
1013 | #define ICCR0_LBM (1 << 1) /* Loopback mode */ | 1032 | #define ICCR0_LBM (1 << 1) /* Loopback mode */ |
1014 | #define ICCR0_ITR (1 << 0) /* IrDA transmission */ | 1033 | #define ICCR0_ITR (1 << 0) /* IrDA transmission */ |
1015 | 1034 | ||
1016 | #ifdef CONFIG_PXA27x | ||
1017 | #define ICCR2_RXP (1 << 3) /* Receive Pin Polarity select */ | 1035 | #define ICCR2_RXP (1 << 3) /* Receive Pin Polarity select */ |
1018 | #define ICCR2_TXP (1 << 2) /* Transmit Pin Polarity select */ | 1036 | #define ICCR2_TXP (1 << 2) /* Transmit Pin Polarity select */ |
1019 | #define ICCR2_TRIG (3 << 0) /* Receive FIFO Trigger threshold */ | 1037 | #define ICCR2_TRIG (3 << 0) /* Receive FIFO Trigger threshold */ |
1020 | #define ICCR2_TRIG_8 (0 << 0) /* >= 8 bytes */ | 1038 | #define ICCR2_TRIG_8 (0 << 0) /* >= 8 bytes */ |
1021 | #define ICCR2_TRIG_16 (1 << 0) /* >= 16 bytes */ | 1039 | #define ICCR2_TRIG_16 (1 << 0) /* >= 16 bytes */ |
1022 | #define ICCR2_TRIG_32 (2 << 0) /* >= 32 bytes */ | 1040 | #define ICCR2_TRIG_32 (2 << 0) /* >= 32 bytes */ |
1023 | #endif | ||
1024 | 1041 | ||
1025 | #ifdef CONFIG_PXA27x | 1042 | #ifdef CONFIG_PXA27x |
1026 | #define ICSR0_EOC (1 << 6) /* DMA End of Descriptor Chain */ | 1043 | #define ICSR0_EOC (1 << 6) /* DMA End of Descriptor Chain */ |
@@ -1250,9 +1267,13 @@ | |||
1250 | #define GPIO40_FFDTR 40 /* FFUART data terminal Ready */ | 1267 | #define GPIO40_FFDTR 40 /* FFUART data terminal Ready */ |
1251 | #define GPIO41_FFRTS 41 /* FFUART request to send */ | 1268 | #define GPIO41_FFRTS 41 /* FFUART request to send */ |
1252 | #define GPIO42_BTRXD 42 /* BTUART receive data */ | 1269 | #define GPIO42_BTRXD 42 /* BTUART receive data */ |
1270 | #define GPIO42_HWRXD 42 /* HWUART receive data */ | ||
1253 | #define GPIO43_BTTXD 43 /* BTUART transmit data */ | 1271 | #define GPIO43_BTTXD 43 /* BTUART transmit data */ |
1272 | #define GPIO43_HWTXD 43 /* HWUART transmit data */ | ||
1254 | #define GPIO44_BTCTS 44 /* BTUART clear to send */ | 1273 | #define GPIO44_BTCTS 44 /* BTUART clear to send */ |
1274 | #define GPIO44_HWCTS 44 /* HWUART clear to send */ | ||
1255 | #define GPIO45_BTRTS 45 /* BTUART request to send */ | 1275 | #define GPIO45_BTRTS 45 /* BTUART request to send */ |
1276 | #define GPIO45_HWRTS 45 /* HWUART request to send */ | ||
1256 | #define GPIO45_AC97_SYSCLK 45 /* AC97 System Clock */ | 1277 | #define GPIO45_AC97_SYSCLK 45 /* AC97 System Clock */ |
1257 | #define GPIO46_ICPRXD 46 /* ICP receive data */ | 1278 | #define GPIO46_ICPRXD 46 /* ICP receive data */ |
1258 | #define GPIO46_STRXD 46 /* STD_UART receive data */ | 1279 | #define GPIO46_STRXD 46 /* STD_UART receive data */ |
@@ -1378,17 +1399,26 @@ | |||
1378 | #define GPIO40_FFDTR_MD (40 | GPIO_ALT_FN_2_OUT) | 1399 | #define GPIO40_FFDTR_MD (40 | GPIO_ALT_FN_2_OUT) |
1379 | #define GPIO41_FFRTS_MD (41 | GPIO_ALT_FN_2_OUT) | 1400 | #define GPIO41_FFRTS_MD (41 | GPIO_ALT_FN_2_OUT) |
1380 | #define GPIO42_BTRXD_MD (42 | GPIO_ALT_FN_1_IN) | 1401 | #define GPIO42_BTRXD_MD (42 | GPIO_ALT_FN_1_IN) |
1402 | #define GPIO42_HWRXD_MD (42 | GPIO_ALT_FN_3_IN) | ||
1381 | #define GPIO43_BTTXD_MD (43 | GPIO_ALT_FN_2_OUT) | 1403 | #define GPIO43_BTTXD_MD (43 | GPIO_ALT_FN_2_OUT) |
1404 | #define GPIO43_HWTXD_MD (43 | GPIO_ALT_FN_3_OUT) | ||
1382 | #define GPIO44_BTCTS_MD (44 | GPIO_ALT_FN_1_IN) | 1405 | #define GPIO44_BTCTS_MD (44 | GPIO_ALT_FN_1_IN) |
1406 | #define GPIO44_HWCTS_MD (44 | GPIO_ALT_FN_3_IN) | ||
1383 | #define GPIO45_BTRTS_MD (45 | GPIO_ALT_FN_2_OUT) | 1407 | #define GPIO45_BTRTS_MD (45 | GPIO_ALT_FN_2_OUT) |
1408 | #define GPIO45_HWRTS_MD (45 | GPIO_ALT_FN_3_OUT) | ||
1384 | #define GPIO45_SYSCLK_AC97_MD (45 | GPIO_ALT_FN_1_OUT) | 1409 | #define GPIO45_SYSCLK_AC97_MD (45 | GPIO_ALT_FN_1_OUT) |
1385 | #define GPIO46_ICPRXD_MD (46 | GPIO_ALT_FN_1_IN) | 1410 | #define GPIO46_ICPRXD_MD (46 | GPIO_ALT_FN_1_IN) |
1386 | #define GPIO46_STRXD_MD (46 | GPIO_ALT_FN_2_IN) | 1411 | #define GPIO46_STRXD_MD (46 | GPIO_ALT_FN_2_IN) |
1387 | #define GPIO47_ICPTXD_MD (47 | GPIO_ALT_FN_2_OUT) | 1412 | #define GPIO47_ICPTXD_MD (47 | GPIO_ALT_FN_2_OUT) |
1388 | #define GPIO47_STTXD_MD (47 | GPIO_ALT_FN_1_OUT) | 1413 | #define GPIO47_STTXD_MD (47 | GPIO_ALT_FN_1_OUT) |
1389 | #define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT) | 1414 | #define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT) |
1415 | #define GPIO48_HWTXD_MD (48 | GPIO_ALT_FN_1_OUT) | ||
1416 | #define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT) | ||
1417 | #define GPIO49_HWRXD_MD (49 | GPIO_ALT_FN_1_IN) | ||
1390 | #define GPIO49_nPWE_MD (49 | GPIO_ALT_FN_2_OUT) | 1418 | #define GPIO49_nPWE_MD (49 | GPIO_ALT_FN_2_OUT) |
1391 | #define GPIO50_nPIOR_MD (50 | GPIO_ALT_FN_2_OUT) | 1419 | #define GPIO50_nPIOR_MD (50 | GPIO_ALT_FN_2_OUT) |
1420 | #define GPIO50_HWCTS_MD (50 | GPIO_ALT_FN_1_IN) | ||
1421 | #define GPIO51_HWRTS_MD (51 | GPIO_ALT_FN_1_OUT) | ||
1392 | #define GPIO51_nPIOW_MD (51 | GPIO_ALT_FN_2_OUT) | 1422 | #define GPIO51_nPIOW_MD (51 | GPIO_ALT_FN_2_OUT) |
1393 | #define GPIO52_nPCE_1_MD (52 | GPIO_ALT_FN_2_OUT) | 1423 | #define GPIO52_nPCE_1_MD (52 | GPIO_ALT_FN_2_OUT) |
1394 | #define GPIO53_nPCE_2_MD (53 | GPIO_ALT_FN_2_OUT) | 1424 | #define GPIO53_nPCE_2_MD (53 | GPIO_ALT_FN_2_OUT) |
@@ -1763,6 +1793,7 @@ | |||
1763 | #define CKEN7_BTUART (1 << 7) /* BTUART Unit Clock Enable */ | 1793 | #define CKEN7_BTUART (1 << 7) /* BTUART Unit Clock Enable */ |
1764 | #define CKEN6_FFUART (1 << 6) /* FFUART Unit Clock Enable */ | 1794 | #define CKEN6_FFUART (1 << 6) /* FFUART Unit Clock Enable */ |
1765 | #define CKEN5_STUART (1 << 5) /* STUART Unit Clock Enable */ | 1795 | #define CKEN5_STUART (1 << 5) /* STUART Unit Clock Enable */ |
1796 | #define CKEN4_HWUART (1 << 4) /* HWUART Unit Clock Enable */ | ||
1766 | #define CKEN4_SSP3 (1 << 4) /* SSP3 Unit Clock Enable */ | 1797 | #define CKEN4_SSP3 (1 << 4) /* SSP3 Unit Clock Enable */ |
1767 | #define CKEN3_SSP (1 << 3) /* SSP Unit Clock Enable */ | 1798 | #define CKEN3_SSP (1 << 3) /* SSP Unit Clock Enable */ |
1768 | #define CKEN3_SSP2 (1 << 3) /* SSP2 Unit Clock Enable */ | 1799 | #define CKEN3_SSP2 (1 << 3) /* SSP2 Unit Clock Enable */ |
@@ -2282,4 +2313,11 @@ | |||
2282 | 2313 | ||
2283 | #endif | 2314 | #endif |
2284 | 2315 | ||
2316 | /* PWRMODE register M field values */ | ||
2317 | |||
2318 | #define PWRMODE_IDLE 0x1 | ||
2319 | #define PWRMODE_STANDBY 0x2 | ||
2320 | #define PWRMODE_SLEEP 0x3 | ||
2321 | #define PWRMODE_DEEPSLEEP 0x7 | ||
2322 | |||
2285 | #endif | 2323 | #endif |
diff --git a/include/asm-arm/arch-pxa/uncompress.h b/include/asm-arm/arch-pxa/uncompress.h index 4428d3eb7432..fe38090444e0 100644 --- a/include/asm-arm/arch-pxa/uncompress.h +++ b/include/asm-arm/arch-pxa/uncompress.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #define FFUART ((volatile unsigned long *)0x40100000) | 12 | #define FFUART ((volatile unsigned long *)0x40100000) |
13 | #define BTUART ((volatile unsigned long *)0x40200000) | 13 | #define BTUART ((volatile unsigned long *)0x40200000) |
14 | #define STUART ((volatile unsigned long *)0x40700000) | 14 | #define STUART ((volatile unsigned long *)0x40700000) |
15 | #define HWUART ((volatile unsigned long *)0x41600000) | ||
15 | 16 | ||
16 | #define UART FFUART | 17 | #define UART FFUART |
17 | 18 | ||
diff --git a/include/asm-arm/arch-rpc/io.h b/include/asm-arm/arch-rpc/io.h index 24453c405a87..b4da08d7a336 100644 --- a/include/asm-arm/arch-rpc/io.h +++ b/include/asm-arm/arch-rpc/io.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #ifndef __ASM_ARM_ARCH_IO_H | 13 | #ifndef __ASM_ARM_ARCH_IO_H |
14 | #define __ASM_ARM_ARCH_IO_H | 14 | #define __ASM_ARM_ARCH_IO_H |
15 | 15 | ||
16 | #include <asm/hardware.h> | ||
17 | |||
16 | #define IO_SPACE_LIMIT 0xffffffff | 18 | #define IO_SPACE_LIMIT 0xffffffff |
17 | 19 | ||
18 | /* | 20 | /* |
diff --git a/include/asm-arm/arch-s3c2410/fb.h b/include/asm-arm/arch-s3c2410/fb.h index ac57bc887d82..4790491ba9d0 100644 --- a/include/asm-arm/arch-s3c2410/fb.h +++ b/include/asm-arm/arch-s3c2410/fb.h | |||
@@ -13,6 +13,7 @@ | |||
13 | * 07-Sep-2004 RTP Created file | 13 | * 07-Sep-2004 RTP Created file |
14 | * 03-Nov-2004 BJD Updated and minor cleanups | 14 | * 03-Nov-2004 BJD Updated and minor cleanups |
15 | * 03-Aug-2005 RTP Renamed to fb.h | 15 | * 03-Aug-2005 RTP Renamed to fb.h |
16 | * 26-Oct-2005 BJD Changed name of platdata init | ||
16 | */ | 17 | */ |
17 | 18 | ||
18 | #ifndef __ASM_ARM_FB_H | 19 | #ifndef __ASM_ARM_FB_H |
@@ -64,6 +65,6 @@ struct s3c2410fb_mach_info { | |||
64 | unsigned long lpcsel; | 65 | unsigned long lpcsel; |
65 | }; | 66 | }; |
66 | 67 | ||
67 | void __init set_s3c2410fb_info(struct s3c2410fb_mach_info *hard_s3c2410fb_info); | 68 | extern void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *); |
68 | 69 | ||
69 | #endif /* __ASM_ARM_FB_H */ | 70 | #endif /* __ASM_ARM_FB_H */ |
diff --git a/include/asm-arm/arch-s3c2410/io.h b/include/asm-arm/arch-s3c2410/io.h index 4bf272ed9add..16fbc8afffd9 100644 --- a/include/asm-arm/arch-s3c2410/io.h +++ b/include/asm-arm/arch-s3c2410/io.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #ifndef __ASM_ARM_ARCH_IO_H | 15 | #ifndef __ASM_ARM_ARCH_IO_H |
16 | #define __ASM_ARM_ARCH_IO_H | 16 | #define __ASM_ARM_ARCH_IO_H |
17 | 17 | ||
18 | #include <asm/hardware.h> | ||
19 | |||
18 | #define IO_SPACE_LIMIT 0xffffffff | 20 | #define IO_SPACE_LIMIT 0xffffffff |
19 | 21 | ||
20 | /* | 22 | /* |
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h index 2053cbacffc3..cb33d57c146c 100644 --- a/include/asm-arm/arch-s3c2410/regs-gpio.h +++ b/include/asm-arm/arch-s3c2410/regs-gpio.h | |||
@@ -20,6 +20,7 @@ | |||
20 | * 18-11-2004 BJD Added S3C2440 AC97 controls | 20 | * 18-11-2004 BJD Added S3C2440 AC97 controls |
21 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA | 21 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA |
22 | * 28-Mar-2005 LCVR Fixed definition of GPB10 | 22 | * 28-Mar-2005 LCVR Fixed definition of GPB10 |
23 | * 26-Oct-2005 BJD Added generic configuration types | ||
23 | */ | 24 | */ |
24 | 25 | ||
25 | 26 | ||
@@ -43,6 +44,11 @@ | |||
43 | /* general configuration options */ | 44 | /* general configuration options */ |
44 | 45 | ||
45 | #define S3C2410_GPIO_LEAVE (0xFFFFFFFF) | 46 | #define S3C2410_GPIO_LEAVE (0xFFFFFFFF) |
47 | #define S3C2410_GPIO_INPUT (0xFFFFFFF0) | ||
48 | #define S3C2410_GPIO_OUTPUT (0xFFFFFFF1) | ||
49 | #define S3C2410_GPIO_IRQ (0xFFFFFFF2) /* not available for all */ | ||
50 | #define S3C2410_GPIO_SFN2 (0xFFFFFFF2) /* not available on A */ | ||
51 | #define S3C2410_GPIO_SFN3 (0xFFFFFFF3) /* not available on A */ | ||
46 | 52 | ||
47 | /* configure GPIO ports A..G */ | 53 | /* configure GPIO ports A..G */ |
48 | 54 | ||
diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h index 19c3b1e186bb..28711aaa4968 100644 --- a/include/asm-arm/arch-sa1100/hardware.h +++ b/include/asm-arm/arch-sa1100/hardware.h | |||
@@ -22,13 +22,6 @@ | |||
22 | 22 | ||
23 | 23 | ||
24 | /* | 24 | /* |
25 | * We requires absolute addresses i.e. (PCMCIA_IO_0_BASE + 0x3f8) for | ||
26 | * in*()/out*() macros to be usable for all cases. | ||
27 | */ | ||
28 | #define PCIO_BASE 0 | ||
29 | |||
30 | |||
31 | /* | ||
32 | * SA1100 internal I/O mappings | 25 | * SA1100 internal I/O mappings |
33 | * | 26 | * |
34 | * We have the following mapping: | 27 | * We have the following mapping: |
diff --git a/include/asm-arm/arch-sa1100/io.h b/include/asm-arm/arch-sa1100/io.h index 7d969ffbd3bb..9d4fe6cf205b 100644 --- a/include/asm-arm/arch-sa1100/io.h +++ b/include/asm-arm/arch-sa1100/io.h | |||
@@ -10,13 +10,19 @@ | |||
10 | #ifndef __ASM_ARM_ARCH_IO_H | 10 | #ifndef __ASM_ARM_ARCH_IO_H |
11 | #define __ASM_ARM_ARCH_IO_H | 11 | #define __ASM_ARM_ARCH_IO_H |
12 | 12 | ||
13 | #include <asm/hardware.h> | ||
14 | |||
13 | #define IO_SPACE_LIMIT 0xffffffff | 15 | #define IO_SPACE_LIMIT 0xffffffff |
14 | 16 | ||
15 | /* | 17 | /* |
16 | * We don't actually have real ISA nor PCI buses, but there is so many | 18 | * We don't actually have real ISA nor PCI buses, but there is so many |
17 | * drivers out there that might just work if we fake them... | 19 | * drivers out there that might just work if we fake them... |
18 | */ | 20 | */ |
19 | #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) | 21 | static inline void __iomem *__io(unsigned long addr) |
22 | { | ||
23 | return (void __iomem *)addr; | ||
24 | } | ||
25 | #define __io(a) __io(a) | ||
20 | #define __mem_pci(a) (a) | 26 | #define __mem_pci(a) (a) |
21 | #define __mem_isa(a) (a) | 27 | #define __mem_isa(a) (a) |
22 | 28 | ||
diff --git a/include/asm-arm/arch-sa1100/system.h b/include/asm-arm/arch-sa1100/system.h index 6f52118ba1a4..0f0612f79b2b 100644 --- a/include/asm-arm/arch-sa1100/system.h +++ b/include/asm-arm/arch-sa1100/system.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * Copyright (c) 1999 Nicolas Pitre <nico@cam.org> | 4 | * Copyright (c) 1999 Nicolas Pitre <nico@cam.org> |
5 | */ | 5 | */ |
6 | #include <linux/config.h> | 6 | #include <linux/config.h> |
7 | #include <asm/hardware.h> | ||
7 | 8 | ||
8 | static inline void arch_idle(void) | 9 | static inline void arch_idle(void) |
9 | { | 10 | { |
diff --git a/include/asm-arm/arch-shark/io.h b/include/asm-arm/arch-shark/io.h index 5e6ed0038b2b..87ffa27f2962 100644 --- a/include/asm-arm/arch-shark/io.h +++ b/include/asm-arm/arch-shark/io.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __ASM_ARM_ARCH_IO_H | 11 | #ifndef __ASM_ARM_ARCH_IO_H |
12 | #define __ASM_ARM_ARCH_IO_H | 12 | #define __ASM_ARM_ARCH_IO_H |
13 | 13 | ||
14 | #include <asm/hardware.h> | ||
15 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | 16 | #define IO_SPACE_LIMIT 0xffffffff |
15 | 17 | ||
16 | /* | 18 | /* |
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index 5c4ae8f5dbb0..2e6799632f12 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/types.h> | 26 | #include <linux/types.h> |
27 | #include <asm/byteorder.h> | 27 | #include <asm/byteorder.h> |
28 | #include <asm/memory.h> | 28 | #include <asm/memory.h> |
29 | #include <asm/arch/hardware.h> | ||
30 | 29 | ||
31 | /* | 30 | /* |
32 | * ISA I/O bus memory addresses are 1:1 with the physical address. | 31 | * ISA I/O bus memory addresses are 1:1 with the physical address. |
diff --git a/include/asm-arm/mach/arch.h b/include/asm-arm/mach/arch.h index 4fa95084a8c0..7273c6fd95b5 100644 --- a/include/asm-arm/mach/arch.h +++ b/include/asm-arm/mach/arch.h | |||
@@ -48,10 +48,10 @@ struct machine_desc { | |||
48 | * Set of macros to define architecture features. This is built into | 48 | * Set of macros to define architecture features. This is built into |
49 | * a table by the linker. | 49 | * a table by the linker. |
50 | */ | 50 | */ |
51 | #define MACHINE_START(_type,_name) \ | 51 | #define MACHINE_START(_type,_name) \ |
52 | const struct machine_desc __mach_desc_##_type \ | 52 | static const struct machine_desc __mach_desc_##_type \ |
53 | __attribute__((__section__(".arch.info.init"))) = { \ | 53 | __attribute__((__section__(".arch.info.init"))) = { \ |
54 | .nr = MACH_TYPE_##_type, \ | 54 | .nr = MACH_TYPE_##_type, \ |
55 | .name = _name, | 55 | .name = _name, |
56 | 56 | ||
57 | #define MACHINE_END \ | 57 | #define MACHINE_END \ |
diff --git a/include/asm-arm/mach/map.h b/include/asm-arm/mach/map.h index 9ac47cf8d2e4..0619522bd926 100644 --- a/include/asm-arm/mach/map.h +++ b/include/asm-arm/mach/map.h | |||
@@ -11,7 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | struct map_desc { | 12 | struct map_desc { |
13 | unsigned long virtual; | 13 | unsigned long virtual; |
14 | unsigned long physical; | 14 | unsigned long pfn; |
15 | unsigned long length; | 15 | unsigned long length; |
16 | unsigned int type; | 16 | unsigned int type; |
17 | }; | 17 | }; |
@@ -27,6 +27,9 @@ struct meminfo; | |||
27 | #define MT_ROM 6 | 27 | #define MT_ROM 6 |
28 | #define MT_IXP2000_DEVICE 7 | 28 | #define MT_IXP2000_DEVICE 7 |
29 | 29 | ||
30 | #define __phys_to_pfn(paddr) (paddr >> PAGE_SHIFT) | ||
31 | #define __pfn_to_phys(pfn) (pfn << PAGE_SHIFT) | ||
32 | |||
30 | extern void create_memmap_holes(struct meminfo *); | 33 | extern void create_memmap_holes(struct meminfo *); |
31 | extern void memtable_init(struct meminfo *); | 34 | extern void memtable_init(struct meminfo *); |
32 | extern void iotable_init(struct map_desc *, int); | 35 | extern void iotable_init(struct map_desc *, int); |
diff --git a/include/asm-parisc/assembly.h b/include/asm-parisc/assembly.h index 30b023411fef..3ce3440d1b0c 100644 --- a/include/asm-parisc/assembly.h +++ b/include/asm-parisc/assembly.h | |||
@@ -21,7 +21,9 @@ | |||
21 | #ifndef _PARISC_ASSEMBLY_H | 21 | #ifndef _PARISC_ASSEMBLY_H |
22 | #define _PARISC_ASSEMBLY_H | 22 | #define _PARISC_ASSEMBLY_H |
23 | 23 | ||
24 | #ifdef __LP64__ | 24 | #define CALLEE_FLOAT_FRAME_SIZE 80 |
25 | |||
26 | #ifdef CONFIG_64BIT | ||
25 | #define LDREG ldd | 27 | #define LDREG ldd |
26 | #define STREG std | 28 | #define STREG std |
27 | #define LDREGX ldd,s | 29 | #define LDREGX ldd,s |
@@ -30,8 +32,8 @@ | |||
30 | #define SHRREG shrd | 32 | #define SHRREG shrd |
31 | #define RP_OFFSET 16 | 33 | #define RP_OFFSET 16 |
32 | #define FRAME_SIZE 128 | 34 | #define FRAME_SIZE 128 |
33 | #define CALLEE_SAVE_FRAME_SIZE 144 | 35 | #define CALLEE_REG_FRAME_SIZE 144 |
34 | #else | 36 | #else /* CONFIG_64BIT */ |
35 | #define LDREG ldw | 37 | #define LDREG ldw |
36 | #define STREG stw | 38 | #define STREG stw |
37 | #define LDREGX ldwx,s | 39 | #define LDREGX ldwx,s |
@@ -40,9 +42,11 @@ | |||
40 | #define SHRREG shr | 42 | #define SHRREG shr |
41 | #define RP_OFFSET 20 | 43 | #define RP_OFFSET 20 |
42 | #define FRAME_SIZE 64 | 44 | #define FRAME_SIZE 64 |
43 | #define CALLEE_SAVE_FRAME_SIZE 128 | 45 | #define CALLEE_REG_FRAME_SIZE 128 |
44 | #endif | 46 | #endif |
45 | 47 | ||
48 | #define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE) | ||
49 | |||
46 | #ifdef CONFIG_PA20 | 50 | #ifdef CONFIG_PA20 |
47 | #define BL b,l | 51 | #define BL b,l |
48 | # ifdef CONFIG_64BIT | 52 | # ifdef CONFIG_64BIT |
@@ -300,9 +304,35 @@ | |||
300 | fldd,mb -8(\regs), %fr0 | 304 | fldd,mb -8(\regs), %fr0 |
301 | .endm | 305 | .endm |
302 | 306 | ||
307 | .macro callee_save_float | ||
308 | fstd,ma %fr12, 8(%r30) | ||
309 | fstd,ma %fr13, 8(%r30) | ||
310 | fstd,ma %fr14, 8(%r30) | ||
311 | fstd,ma %fr15, 8(%r30) | ||
312 | fstd,ma %fr16, 8(%r30) | ||
313 | fstd,ma %fr17, 8(%r30) | ||
314 | fstd,ma %fr18, 8(%r30) | ||
315 | fstd,ma %fr19, 8(%r30) | ||
316 | fstd,ma %fr20, 8(%r30) | ||
317 | fstd,ma %fr21, 8(%r30) | ||
318 | .endm | ||
319 | |||
320 | .macro callee_rest_float | ||
321 | fldd,mb -8(%r30), %fr21 | ||
322 | fldd,mb -8(%r30), %fr20 | ||
323 | fldd,mb -8(%r30), %fr19 | ||
324 | fldd,mb -8(%r30), %fr18 | ||
325 | fldd,mb -8(%r30), %fr17 | ||
326 | fldd,mb -8(%r30), %fr16 | ||
327 | fldd,mb -8(%r30), %fr15 | ||
328 | fldd,mb -8(%r30), %fr14 | ||
329 | fldd,mb -8(%r30), %fr13 | ||
330 | fldd,mb -8(%r30), %fr12 | ||
331 | .endm | ||
332 | |||
303 | #ifdef __LP64__ | 333 | #ifdef __LP64__ |
304 | .macro callee_save | 334 | .macro callee_save |
305 | std,ma %r3, CALLEE_SAVE_FRAME_SIZE(%r30) | 335 | std,ma %r3, CALLEE_REG_FRAME_SIZE(%r30) |
306 | mfctl %cr27, %r3 | 336 | mfctl %cr27, %r3 |
307 | std %r4, -136(%r30) | 337 | std %r4, -136(%r30) |
308 | std %r5, -128(%r30) | 338 | std %r5, -128(%r30) |
@@ -340,13 +370,13 @@ | |||
340 | ldd -128(%r30), %r5 | 370 | ldd -128(%r30), %r5 |
341 | ldd -136(%r30), %r4 | 371 | ldd -136(%r30), %r4 |
342 | mtctl %r3, %cr27 | 372 | mtctl %r3, %cr27 |
343 | ldd,mb -CALLEE_SAVE_FRAME_SIZE(%r30), %r3 | 373 | ldd,mb -CALLEE_REG_FRAME_SIZE(%r30), %r3 |
344 | .endm | 374 | .endm |
345 | 375 | ||
346 | #else /* ! __LP64__ */ | 376 | #else /* ! __LP64__ */ |
347 | 377 | ||
348 | .macro callee_save | 378 | .macro callee_save |
349 | stw,ma %r3, CALLEE_SAVE_FRAME_SIZE(%r30) | 379 | stw,ma %r3, CALLEE_REG_FRAME_SIZE(%r30) |
350 | mfctl %cr27, %r3 | 380 | mfctl %cr27, %r3 |
351 | stw %r4, -124(%r30) | 381 | stw %r4, -124(%r30) |
352 | stw %r5, -120(%r30) | 382 | stw %r5, -120(%r30) |
@@ -384,7 +414,7 @@ | |||
384 | ldw -120(%r30), %r5 | 414 | ldw -120(%r30), %r5 |
385 | ldw -124(%r30), %r4 | 415 | ldw -124(%r30), %r4 |
386 | mtctl %r3, %cr27 | 416 | mtctl %r3, %cr27 |
387 | ldw,mb -CALLEE_SAVE_FRAME_SIZE(%r30), %r3 | 417 | ldw,mb -CALLEE_REG_FRAME_SIZE(%r30), %r3 |
388 | .endm | 418 | .endm |
389 | #endif /* ! __LP64__ */ | 419 | #endif /* ! __LP64__ */ |
390 | 420 | ||
@@ -450,5 +480,30 @@ | |||
450 | REST_CR (%cr22, PT_PSW (\regs)) | 480 | REST_CR (%cr22, PT_PSW (\regs)) |
451 | .endm | 481 | .endm |
452 | 482 | ||
483 | |||
484 | /* First step to create a "relied upon translation" | ||
485 | * See PA 2.0 Arch. page F-4 and F-5. | ||
486 | * | ||
487 | * The ssm was originally necessary due to a "PCxT bug". | ||
488 | * But someone decided it needed to be added to the architecture | ||
489 | * and this "feature" went into rev3 of PA-RISC 1.1 Arch Manual. | ||
490 | * It's been carried forward into PA 2.0 Arch as well. :^( | ||
491 | * | ||
492 | * "ssm 0,%r0" is a NOP with side effects (prefetch barrier). | ||
493 | * rsm/ssm prevents the ifetch unit from speculatively fetching | ||
494 | * instructions past this line in the code stream. | ||
495 | * PA 2.0 processor will single step all insn in the same QUAD (4 insn). | ||
496 | */ | ||
497 | .macro pcxt_ssm_bug | ||
498 | rsm PSW_SM_I,%r0 | ||
499 | nop /* 1 */ | ||
500 | nop /* 2 */ | ||
501 | nop /* 3 */ | ||
502 | nop /* 4 */ | ||
503 | nop /* 5 */ | ||
504 | nop /* 6 */ | ||
505 | nop /* 7 */ | ||
506 | .endm | ||
507 | |||
453 | #endif /* __ASSEMBLY__ */ | 508 | #endif /* __ASSEMBLY__ */ |
454 | #endif | 509 | #endif |
diff --git a/include/asm-parisc/bitops.h b/include/asm-parisc/bitops.h index af7db694b22d..55b98c67fd82 100644 --- a/include/asm-parisc/bitops.h +++ b/include/asm-parisc/bitops.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _PARISC_BITOPS_H | 2 | #define _PARISC_BITOPS_H |
3 | 3 | ||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | #include <asm/spinlock.h> | 5 | #include <asm/types.h> /* for BITS_PER_LONG/SHIFT_PER_LONG */ |
6 | #include <asm/byteorder.h> | 6 | #include <asm/byteorder.h> |
7 | #include <asm/atomic.h> | 7 | #include <asm/atomic.h> |
8 | 8 | ||
@@ -12,193 +12,157 @@ | |||
12 | * to include/asm-i386/bitops.h or kerneldoc | 12 | * to include/asm-i386/bitops.h or kerneldoc |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #ifdef __LP64__ | 15 | #define CHOP_SHIFTCOUNT(x) (((unsigned long) (x)) & (BITS_PER_LONG - 1)) |
16 | # define SHIFT_PER_LONG 6 | ||
17 | #ifndef BITS_PER_LONG | ||
18 | # define BITS_PER_LONG 64 | ||
19 | #endif | ||
20 | #else | ||
21 | # define SHIFT_PER_LONG 5 | ||
22 | #ifndef BITS_PER_LONG | ||
23 | # define BITS_PER_LONG 32 | ||
24 | #endif | ||
25 | #endif | ||
26 | |||
27 | #define CHOP_SHIFTCOUNT(x) ((x) & (BITS_PER_LONG - 1)) | ||
28 | 16 | ||
29 | 17 | ||
30 | #define smp_mb__before_clear_bit() smp_mb() | 18 | #define smp_mb__before_clear_bit() smp_mb() |
31 | #define smp_mb__after_clear_bit() smp_mb() | 19 | #define smp_mb__after_clear_bit() smp_mb() |
32 | 20 | ||
33 | static __inline__ void set_bit(int nr, volatile unsigned long * address) | 21 | /* See http://marc.theaimsgroup.com/?t=108826637900003 for discussion |
22 | * on use of volatile and __*_bit() (set/clear/change): | ||
23 | * *_bit() want use of volatile. | ||
24 | * __*_bit() are "relaxed" and don't use spinlock or volatile. | ||
25 | */ | ||
26 | |||
27 | static __inline__ void set_bit(int nr, volatile unsigned long * addr) | ||
34 | { | 28 | { |
35 | unsigned long mask; | 29 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
36 | unsigned long *addr = (unsigned long *) address; | ||
37 | unsigned long flags; | 30 | unsigned long flags; |
38 | 31 | ||
39 | addr += (nr >> SHIFT_PER_LONG); | 32 | addr += (nr >> SHIFT_PER_LONG); |
40 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
41 | _atomic_spin_lock_irqsave(addr, flags); | 33 | _atomic_spin_lock_irqsave(addr, flags); |
42 | *addr |= mask; | 34 | *addr |= mask; |
43 | _atomic_spin_unlock_irqrestore(addr, flags); | 35 | _atomic_spin_unlock_irqrestore(addr, flags); |
44 | } | 36 | } |
45 | 37 | ||
46 | static __inline__ void __set_bit(int nr, volatile unsigned long * address) | 38 | static __inline__ void __set_bit(unsigned long nr, volatile unsigned long * addr) |
47 | { | 39 | { |
48 | unsigned long mask; | 40 | unsigned long *m = (unsigned long *) addr + (nr >> SHIFT_PER_LONG); |
49 | unsigned long *addr = (unsigned long *) address; | ||
50 | 41 | ||
51 | addr += (nr >> SHIFT_PER_LONG); | 42 | *m |= 1UL << CHOP_SHIFTCOUNT(nr); |
52 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
53 | *addr |= mask; | ||
54 | } | 43 | } |
55 | 44 | ||
56 | static __inline__ void clear_bit(int nr, volatile unsigned long * address) | 45 | static __inline__ void clear_bit(int nr, volatile unsigned long * addr) |
57 | { | 46 | { |
58 | unsigned long mask; | 47 | unsigned long mask = ~(1UL << CHOP_SHIFTCOUNT(nr)); |
59 | unsigned long *addr = (unsigned long *) address; | ||
60 | unsigned long flags; | 48 | unsigned long flags; |
61 | 49 | ||
62 | addr += (nr >> SHIFT_PER_LONG); | 50 | addr += (nr >> SHIFT_PER_LONG); |
63 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
64 | _atomic_spin_lock_irqsave(addr, flags); | 51 | _atomic_spin_lock_irqsave(addr, flags); |
65 | *addr &= ~mask; | 52 | *addr &= mask; |
66 | _atomic_spin_unlock_irqrestore(addr, flags); | 53 | _atomic_spin_unlock_irqrestore(addr, flags); |
67 | } | 54 | } |
68 | 55 | ||
69 | static __inline__ void __clear_bit(unsigned long nr, volatile unsigned long * address) | 56 | static __inline__ void __clear_bit(unsigned long nr, volatile unsigned long * addr) |
70 | { | 57 | { |
71 | unsigned long mask; | 58 | unsigned long *m = (unsigned long *) addr + (nr >> SHIFT_PER_LONG); |
72 | unsigned long *addr = (unsigned long *) address; | ||
73 | 59 | ||
74 | addr += (nr >> SHIFT_PER_LONG); | 60 | *m &= ~(1UL << CHOP_SHIFTCOUNT(nr)); |
75 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
76 | *addr &= ~mask; | ||
77 | } | 61 | } |
78 | 62 | ||
79 | static __inline__ void change_bit(int nr, volatile unsigned long * address) | 63 | static __inline__ void change_bit(int nr, volatile unsigned long * addr) |
80 | { | 64 | { |
81 | unsigned long mask; | 65 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
82 | unsigned long *addr = (unsigned long *) address; | ||
83 | unsigned long flags; | 66 | unsigned long flags; |
84 | 67 | ||
85 | addr += (nr >> SHIFT_PER_LONG); | 68 | addr += (nr >> SHIFT_PER_LONG); |
86 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
87 | _atomic_spin_lock_irqsave(addr, flags); | 69 | _atomic_spin_lock_irqsave(addr, flags); |
88 | *addr ^= mask; | 70 | *addr ^= mask; |
89 | _atomic_spin_unlock_irqrestore(addr, flags); | 71 | _atomic_spin_unlock_irqrestore(addr, flags); |
90 | } | 72 | } |
91 | 73 | ||
92 | static __inline__ void __change_bit(int nr, volatile unsigned long * address) | 74 | static __inline__ void __change_bit(unsigned long nr, volatile unsigned long * addr) |
93 | { | 75 | { |
94 | unsigned long mask; | 76 | unsigned long *m = (unsigned long *) addr + (nr >> SHIFT_PER_LONG); |
95 | unsigned long *addr = (unsigned long *) address; | ||
96 | 77 | ||
97 | addr += (nr >> SHIFT_PER_LONG); | 78 | *m ^= 1UL << CHOP_SHIFTCOUNT(nr); |
98 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
99 | *addr ^= mask; | ||
100 | } | 79 | } |
101 | 80 | ||
102 | static __inline__ int test_and_set_bit(int nr, volatile unsigned long * address) | 81 | static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr) |
103 | { | 82 | { |
104 | unsigned long mask; | 83 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
105 | unsigned long *addr = (unsigned long *) address; | 84 | unsigned long oldbit; |
106 | int oldbit; | ||
107 | unsigned long flags; | 85 | unsigned long flags; |
108 | 86 | ||
109 | addr += (nr >> SHIFT_PER_LONG); | 87 | addr += (nr >> SHIFT_PER_LONG); |
110 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
111 | _atomic_spin_lock_irqsave(addr, flags); | 88 | _atomic_spin_lock_irqsave(addr, flags); |
112 | oldbit = (*addr & mask) ? 1 : 0; | 89 | oldbit = *addr; |
113 | *addr |= mask; | 90 | *addr = oldbit | mask; |
114 | _atomic_spin_unlock_irqrestore(addr, flags); | 91 | _atomic_spin_unlock_irqrestore(addr, flags); |
115 | 92 | ||
116 | return oldbit; | 93 | return (oldbit & mask) ? 1 : 0; |
117 | } | 94 | } |
118 | 95 | ||
119 | static __inline__ int __test_and_set_bit(int nr, volatile unsigned long * address) | 96 | static __inline__ int __test_and_set_bit(int nr, volatile unsigned long * address) |
120 | { | 97 | { |
121 | unsigned long mask; | 98 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
122 | unsigned long *addr = (unsigned long *) address; | 99 | unsigned long oldbit; |
123 | int oldbit; | 100 | unsigned long *addr = (unsigned long *)address + (nr >> SHIFT_PER_LONG); |
124 | 101 | ||
125 | addr += (nr >> SHIFT_PER_LONG); | 102 | oldbit = *addr; |
126 | mask = 1L << CHOP_SHIFTCOUNT(nr); | 103 | *addr = oldbit | mask; |
127 | oldbit = (*addr & mask) ? 1 : 0; | ||
128 | *addr |= mask; | ||
129 | 104 | ||
130 | return oldbit; | 105 | return (oldbit & mask) ? 1 : 0; |
131 | } | 106 | } |
132 | 107 | ||
133 | static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * address) | 108 | static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr) |
134 | { | 109 | { |
135 | unsigned long mask; | 110 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
136 | unsigned long *addr = (unsigned long *) address; | 111 | unsigned long oldbit; |
137 | int oldbit; | ||
138 | unsigned long flags; | 112 | unsigned long flags; |
139 | 113 | ||
140 | addr += (nr >> SHIFT_PER_LONG); | 114 | addr += (nr >> SHIFT_PER_LONG); |
141 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
142 | _atomic_spin_lock_irqsave(addr, flags); | 115 | _atomic_spin_lock_irqsave(addr, flags); |
143 | oldbit = (*addr & mask) ? 1 : 0; | 116 | oldbit = *addr; |
144 | *addr &= ~mask; | 117 | *addr = oldbit & ~mask; |
145 | _atomic_spin_unlock_irqrestore(addr, flags); | 118 | _atomic_spin_unlock_irqrestore(addr, flags); |
146 | 119 | ||
147 | return oldbit; | 120 | return (oldbit & mask) ? 1 : 0; |
148 | } | 121 | } |
149 | 122 | ||
150 | static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long * address) | 123 | static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long * address) |
151 | { | 124 | { |
152 | unsigned long mask; | 125 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
153 | unsigned long *addr = (unsigned long *) address; | 126 | unsigned long *addr = (unsigned long *)address + (nr >> SHIFT_PER_LONG); |
154 | int oldbit; | 127 | unsigned long oldbit; |
155 | 128 | ||
156 | addr += (nr >> SHIFT_PER_LONG); | 129 | oldbit = *addr; |
157 | mask = 1L << CHOP_SHIFTCOUNT(nr); | 130 | *addr = oldbit & ~mask; |
158 | oldbit = (*addr & mask) ? 1 : 0; | ||
159 | *addr &= ~mask; | ||
160 | 131 | ||
161 | return oldbit; | 132 | return (oldbit & mask) ? 1 : 0; |
162 | } | 133 | } |
163 | 134 | ||
164 | static __inline__ int test_and_change_bit(int nr, volatile unsigned long * address) | 135 | static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr) |
165 | { | 136 | { |
166 | unsigned long mask; | 137 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
167 | unsigned long *addr = (unsigned long *) address; | 138 | unsigned long oldbit; |
168 | int oldbit; | ||
169 | unsigned long flags; | 139 | unsigned long flags; |
170 | 140 | ||
171 | addr += (nr >> SHIFT_PER_LONG); | 141 | addr += (nr >> SHIFT_PER_LONG); |
172 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
173 | _atomic_spin_lock_irqsave(addr, flags); | 142 | _atomic_spin_lock_irqsave(addr, flags); |
174 | oldbit = (*addr & mask) ? 1 : 0; | 143 | oldbit = *addr; |
175 | *addr ^= mask; | 144 | *addr = oldbit ^ mask; |
176 | _atomic_spin_unlock_irqrestore(addr, flags); | 145 | _atomic_spin_unlock_irqrestore(addr, flags); |
177 | 146 | ||
178 | return oldbit; | 147 | return (oldbit & mask) ? 1 : 0; |
179 | } | 148 | } |
180 | 149 | ||
181 | static __inline__ int __test_and_change_bit(int nr, volatile unsigned long * address) | 150 | static __inline__ int __test_and_change_bit(int nr, volatile unsigned long * address) |
182 | { | 151 | { |
183 | unsigned long mask; | 152 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
184 | unsigned long *addr = (unsigned long *) address; | 153 | unsigned long *addr = (unsigned long *)address + (nr >> SHIFT_PER_LONG); |
185 | int oldbit; | 154 | unsigned long oldbit; |
186 | 155 | ||
187 | addr += (nr >> SHIFT_PER_LONG); | 156 | oldbit = *addr; |
188 | mask = 1L << CHOP_SHIFTCOUNT(nr); | 157 | *addr = oldbit ^ mask; |
189 | oldbit = (*addr & mask) ? 1 : 0; | ||
190 | *addr ^= mask; | ||
191 | 158 | ||
192 | return oldbit; | 159 | return (oldbit & mask) ? 1 : 0; |
193 | } | 160 | } |
194 | 161 | ||
195 | static __inline__ int test_bit(int nr, const volatile unsigned long *address) | 162 | static __inline__ int test_bit(int nr, const volatile unsigned long *address) |
196 | { | 163 | { |
197 | unsigned long mask; | 164 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
198 | const unsigned long *addr = (const unsigned long *)address; | 165 | const unsigned long *addr = (const unsigned long *)address + (nr >> SHIFT_PER_LONG); |
199 | |||
200 | addr += (nr >> SHIFT_PER_LONG); | ||
201 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
202 | 166 | ||
203 | return !!(*addr & mask); | 167 | return !!(*addr & mask); |
204 | } | 168 | } |
@@ -229,7 +193,7 @@ static __inline__ unsigned long __ffs(unsigned long x) | |||
229 | unsigned long ret; | 193 | unsigned long ret; |
230 | 194 | ||
231 | __asm__( | 195 | __asm__( |
232 | #if BITS_PER_LONG > 32 | 196 | #ifdef __LP64__ |
233 | " ldi 63,%1\n" | 197 | " ldi 63,%1\n" |
234 | " extrd,u,*<> %0,63,32,%%r0\n" | 198 | " extrd,u,*<> %0,63,32,%%r0\n" |
235 | " extrd,u,*TR %0,31,32,%0\n" /* move top 32-bits down */ | 199 | " extrd,u,*TR %0,31,32,%0\n" /* move top 32-bits down */ |
@@ -304,14 +268,7 @@ static __inline__ int fls(int x) | |||
304 | * hweightN: returns the hamming weight (i.e. the number | 268 | * hweightN: returns the hamming weight (i.e. the number |
305 | * of bits set) of a N-bit word | 269 | * of bits set) of a N-bit word |
306 | */ | 270 | */ |
307 | #define hweight64(x) \ | 271 | #define hweight64(x) generic_hweight64(x) |
308 | ({ \ | ||
309 | unsigned long __x = (x); \ | ||
310 | unsigned int __w; \ | ||
311 | __w = generic_hweight32((unsigned int) __x); \ | ||
312 | __w += generic_hweight32((unsigned int) (__x>>32)); \ | ||
313 | __w; \ | ||
314 | }) | ||
315 | #define hweight32(x) generic_hweight32(x) | 272 | #define hweight32(x) generic_hweight32(x) |
316 | #define hweight16(x) generic_hweight16(x) | 273 | #define hweight16(x) generic_hweight16(x) |
317 | #define hweight8(x) generic_hweight8(x) | 274 | #define hweight8(x) generic_hweight8(x) |
@@ -324,7 +281,13 @@ static __inline__ int fls(int x) | |||
324 | */ | 281 | */ |
325 | static inline int sched_find_first_bit(const unsigned long *b) | 282 | static inline int sched_find_first_bit(const unsigned long *b) |
326 | { | 283 | { |
327 | #ifndef __LP64__ | 284 | #ifdef __LP64__ |
285 | if (unlikely(b[0])) | ||
286 | return __ffs(b[0]); | ||
287 | if (unlikely(b[1])) | ||
288 | return __ffs(b[1]) + 64; | ||
289 | return __ffs(b[2]) + 128; | ||
290 | #else | ||
328 | if (unlikely(b[0])) | 291 | if (unlikely(b[0])) |
329 | return __ffs(b[0]); | 292 | return __ffs(b[0]); |
330 | if (unlikely(b[1])) | 293 | if (unlikely(b[1])) |
@@ -334,14 +297,6 @@ static inline int sched_find_first_bit(const unsigned long *b) | |||
334 | if (b[3]) | 297 | if (b[3]) |
335 | return __ffs(b[3]) + 96; | 298 | return __ffs(b[3]) + 96; |
336 | return __ffs(b[4]) + 128; | 299 | return __ffs(b[4]) + 128; |
337 | #else | ||
338 | if (unlikely(b[0])) | ||
339 | return __ffs(b[0]); | ||
340 | if (unlikely(((unsigned int)b[1]))) | ||
341 | return __ffs(b[1]) + 64; | ||
342 | if (b[1] >> 32) | ||
343 | return __ffs(b[1] >> 32) + 96; | ||
344 | return __ffs(b[2]) + 128; | ||
345 | #endif | 300 | #endif |
346 | } | 301 | } |
347 | 302 | ||
@@ -391,7 +346,7 @@ found_middle: | |||
391 | 346 | ||
392 | static __inline__ unsigned long find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset) | 347 | static __inline__ unsigned long find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset) |
393 | { | 348 | { |
394 | const unsigned long *p = addr + (offset >> 6); | 349 | const unsigned long *p = addr + (offset >> SHIFT_PER_LONG); |
395 | unsigned long result = offset & ~(BITS_PER_LONG-1); | 350 | unsigned long result = offset & ~(BITS_PER_LONG-1); |
396 | unsigned long tmp; | 351 | unsigned long tmp; |
397 | 352 | ||
@@ -445,71 +400,90 @@ found_middle: | |||
445 | * test_and_{set,clear}_bit guarantee atomicity without | 400 | * test_and_{set,clear}_bit guarantee atomicity without |
446 | * disabling interrupts. | 401 | * disabling interrupts. |
447 | */ | 402 | */ |
448 | #ifdef __LP64__ | ||
449 | #define ext2_set_bit(nr, addr) __test_and_set_bit((nr) ^ 0x38, (unsigned long *)addr) | ||
450 | #define ext2_set_bit_atomic(l,nr,addr) test_and_set_bit((nr) ^ 0x38, (unsigned long *)addr) | ||
451 | #define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 0x38, (unsigned long *)addr) | ||
452 | #define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x38, (unsigned long *)addr) | ||
453 | #else | ||
454 | #define ext2_set_bit(nr, addr) __test_and_set_bit((nr) ^ 0x18, (unsigned long *)addr) | ||
455 | #define ext2_set_bit_atomic(l,nr,addr) test_and_set_bit((nr) ^ 0x18, (unsigned long *)addr) | ||
456 | #define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 0x18, (unsigned long *)addr) | ||
457 | #define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x18, (unsigned long *)addr) | ||
458 | #endif | ||
459 | 403 | ||
460 | #endif /* __KERNEL__ */ | 404 | /* '3' is bits per byte */ |
405 | #define LE_BYTE_ADDR ((sizeof(unsigned long) - 1) << 3) | ||
461 | 406 | ||
462 | static __inline__ int ext2_test_bit(int nr, __const__ void * addr) | 407 | #define ext2_test_bit(nr, addr) \ |
463 | { | 408 | test_bit((nr) ^ LE_BYTE_ADDR, (unsigned long *)addr) |
464 | __const__ unsigned char *ADDR = (__const__ unsigned char *) addr; | 409 | #define ext2_set_bit(nr, addr) \ |
410 | __test_and_set_bit((nr) ^ LE_BYTE_ADDR, (unsigned long *)addr) | ||
411 | #define ext2_clear_bit(nr, addr) \ | ||
412 | __test_and_clear_bit((nr) ^ LE_BYTE_ADDR, (unsigned long *)addr) | ||
465 | 413 | ||
466 | return (ADDR[nr >> 3] >> (nr & 7)) & 1; | 414 | #define ext2_set_bit_atomic(l,nr,addr) \ |
467 | } | 415 | test_and_set_bit((nr) ^ LE_BYTE_ADDR, (unsigned long *)addr) |
416 | #define ext2_clear_bit_atomic(l,nr,addr) \ | ||
417 | test_and_clear_bit( (nr) ^ LE_BYTE_ADDR, (unsigned long *)addr) | ||
418 | |||
419 | #endif /* __KERNEL__ */ | ||
468 | 420 | ||
469 | /* | ||
470 | * This implementation of ext2_find_{first,next}_zero_bit was stolen from | ||
471 | * Linus' asm-alpha/bitops.h and modified for a big-endian machine. | ||
472 | */ | ||
473 | 421 | ||
474 | #define ext2_find_first_zero_bit(addr, size) \ | 422 | #define ext2_find_first_zero_bit(addr, size) \ |
475 | ext2_find_next_zero_bit((addr), (size), 0) | 423 | ext2_find_next_zero_bit((addr), (size), 0) |
476 | 424 | ||
477 | extern __inline__ unsigned long ext2_find_next_zero_bit(void *addr, | 425 | /* include/linux/byteorder does not support "unsigned long" type */ |
478 | unsigned long size, unsigned long offset) | 426 | static inline unsigned long ext2_swabp(unsigned long * x) |
479 | { | 427 | { |
480 | unsigned int *p = ((unsigned int *) addr) + (offset >> 5); | 428 | #ifdef __LP64__ |
481 | unsigned int result = offset & ~31UL; | 429 | return (unsigned long) __swab64p((u64 *) x); |
482 | unsigned int tmp; | 430 | #else |
431 | return (unsigned long) __swab32p((u32 *) x); | ||
432 | #endif | ||
433 | } | ||
434 | |||
435 | /* include/linux/byteorder doesn't support "unsigned long" type */ | ||
436 | static inline unsigned long ext2_swab(unsigned long y) | ||
437 | { | ||
438 | #ifdef __LP64__ | ||
439 | return (unsigned long) __swab64((u64) y); | ||
440 | #else | ||
441 | return (unsigned long) __swab32((u32) y); | ||
442 | #endif | ||
443 | } | ||
444 | |||
445 | static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset) | ||
446 | { | ||
447 | unsigned long *p = (unsigned long *) addr + (offset >> SHIFT_PER_LONG); | ||
448 | unsigned long result = offset & ~(BITS_PER_LONG - 1); | ||
449 | unsigned long tmp; | ||
483 | 450 | ||
484 | if (offset >= size) | 451 | if (offset >= size) |
485 | return size; | 452 | return size; |
486 | size -= result; | 453 | size -= result; |
487 | offset &= 31UL; | 454 | offset &= (BITS_PER_LONG - 1UL); |
488 | if (offset) { | 455 | if (offset) { |
489 | tmp = cpu_to_le32p(p++); | 456 | tmp = ext2_swabp(p++); |
490 | tmp |= ~0UL >> (32-offset); | 457 | tmp |= (~0UL >> (BITS_PER_LONG - offset)); |
491 | if (size < 32) | 458 | if (size < BITS_PER_LONG) |
492 | goto found_first; | 459 | goto found_first; |
493 | if (tmp != ~0U) | 460 | if (~tmp) |
494 | goto found_middle; | 461 | goto found_middle; |
495 | size -= 32; | 462 | size -= BITS_PER_LONG; |
496 | result += 32; | 463 | result += BITS_PER_LONG; |
497 | } | 464 | } |
498 | while (size >= 32) { | 465 | |
499 | if ((tmp = cpu_to_le32p(p++)) != ~0U) | 466 | while (size & ~(BITS_PER_LONG - 1)) { |
500 | goto found_middle; | 467 | if (~(tmp = *(p++))) |
501 | result += 32; | 468 | goto found_middle_swap; |
502 | size -= 32; | 469 | result += BITS_PER_LONG; |
470 | size -= BITS_PER_LONG; | ||
503 | } | 471 | } |
504 | if (!size) | 472 | if (!size) |
505 | return result; | 473 | return result; |
506 | tmp = cpu_to_le32p(p); | 474 | tmp = ext2_swabp(p); |
507 | found_first: | 475 | found_first: |
508 | tmp |= ~0U << size; | 476 | tmp |= ~0UL << size; |
477 | if (tmp == ~0UL) /* Are any bits zero? */ | ||
478 | return result + size; /* Nope. Skip ffz */ | ||
509 | found_middle: | 479 | found_middle: |
510 | return result + ffz(tmp); | 480 | return result + ffz(tmp); |
481 | |||
482 | found_middle_swap: | ||
483 | return result + ffz(ext2_swab(tmp)); | ||
511 | } | 484 | } |
512 | 485 | ||
486 | |||
513 | /* Bitmap functions for the minix filesystem. */ | 487 | /* Bitmap functions for the minix filesystem. */ |
514 | #define minix_test_and_set_bit(nr,addr) ext2_set_bit(nr,addr) | 488 | #define minix_test_and_set_bit(nr,addr) ext2_set_bit(nr,addr) |
515 | #define minix_set_bit(nr,addr) ((void)ext2_set_bit(nr,addr)) | 489 | #define minix_set_bit(nr,addr) ((void)ext2_set_bit(nr,addr)) |
diff --git a/include/asm-parisc/errno.h b/include/asm-parisc/errno.h index 08464c405471..e2f3ddc796be 100644 --- a/include/asm-parisc/errno.h +++ b/include/asm-parisc/errno.h | |||
@@ -114,6 +114,7 @@ | |||
114 | 114 | ||
115 | #define ENOTSUP 252 /* Function not implemented (POSIX.4 / HPUX) */ | 115 | #define ENOTSUP 252 /* Function not implemented (POSIX.4 / HPUX) */ |
116 | #define ECANCELLED 253 /* aio request was canceled before complete (POSIX.4 / HPUX) */ | 116 | #define ECANCELLED 253 /* aio request was canceled before complete (POSIX.4 / HPUX) */ |
117 | #define ECANCELED ECANCELLED /* SuSv3 and Solaris wants one 'L' */ | ||
117 | 118 | ||
118 | /* for robust mutexes */ | 119 | /* for robust mutexes */ |
119 | #define EOWNERDEAD 254 /* Owner died */ | 120 | #define EOWNERDEAD 254 /* Owner died */ |
diff --git a/include/asm-parisc/grfioctl.h b/include/asm-parisc/grfioctl.h index d3cfc0168fb1..6a910311b56b 100644 --- a/include/asm-parisc/grfioctl.h +++ b/include/asm-parisc/grfioctl.h | |||
@@ -69,6 +69,8 @@ | |||
69 | #define CRT_ID_TVRX S9000_ID_98765 /* TVRX (gto/falcon) */ | 69 | #define CRT_ID_TVRX S9000_ID_98765 /* TVRX (gto/falcon) */ |
70 | #define CRT_ID_ARTIST S9000_ID_ARTIST /* Artist */ | 70 | #define CRT_ID_ARTIST S9000_ID_ARTIST /* Artist */ |
71 | #define CRT_ID_SUMMIT 0x2FC1066B /* Summit FX2, FX4, FX6 ... */ | 71 | #define CRT_ID_SUMMIT 0x2FC1066B /* Summit FX2, FX4, FX6 ... */ |
72 | #define CRT_ID_LEGO 0x35ACDA30 /* Lego FX5, FX10 ... */ | ||
73 | #define CRT_ID_PINNACLE 0x35ACDA16 /* Pinnacle FXe */ | ||
72 | 74 | ||
73 | /* structure for ioctl(GCDESCRIBE) */ | 75 | /* structure for ioctl(GCDESCRIBE) */ |
74 | 76 | ||
diff --git a/include/asm-parisc/led.h b/include/asm-parisc/led.h index 1ac8ab6c580d..efadfd543ec6 100644 --- a/include/asm-parisc/led.h +++ b/include/asm-parisc/led.h | |||
@@ -23,9 +23,6 @@ | |||
23 | 23 | ||
24 | #define LED_CMD_REG_NONE 0 /* NULL == no addr for the cmd register */ | 24 | #define LED_CMD_REG_NONE 0 /* NULL == no addr for the cmd register */ |
25 | 25 | ||
26 | /* led tasklet struct */ | ||
27 | extern struct tasklet_struct led_tasklet; | ||
28 | |||
29 | /* register_led_driver() */ | 26 | /* register_led_driver() */ |
30 | int __init register_led_driver(int model, unsigned long cmd_reg, unsigned long data_reg); | 27 | int __init register_led_driver(int model, unsigned long cmd_reg, unsigned long data_reg); |
31 | 28 | ||
diff --git a/include/asm-parisc/parisc-device.h b/include/asm-parisc/parisc-device.h index ef69ab4b17a9..1d247e32a608 100644 --- a/include/asm-parisc/parisc-device.h +++ b/include/asm-parisc/parisc-device.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #include <linux/device.h> | 1 | #include <linux/device.h> |
2 | 2 | ||
3 | struct parisc_device { | 3 | struct parisc_device { |
4 | unsigned long hpa; /* Hard Physical Address */ | 4 | struct resource hpa; /* Hard Physical Address */ |
5 | struct parisc_device_id id; | 5 | struct parisc_device_id id; |
6 | struct parisc_driver *driver; /* Driver for this device */ | 6 | struct parisc_driver *driver; /* Driver for this device */ |
7 | char name[80]; /* The hardware description */ | 7 | char name[80]; /* The hardware description */ |
@@ -39,6 +39,11 @@ struct parisc_driver { | |||
39 | #define to_parisc_driver(d) container_of(d, struct parisc_driver, drv) | 39 | #define to_parisc_driver(d) container_of(d, struct parisc_driver, drv) |
40 | #define parisc_parent(d) to_parisc_device(d->dev.parent) | 40 | #define parisc_parent(d) to_parisc_device(d->dev.parent) |
41 | 41 | ||
42 | static inline char *parisc_pathname(struct parisc_device *d) | ||
43 | { | ||
44 | return d->dev.bus_id; | ||
45 | } | ||
46 | |||
42 | static inline void | 47 | static inline void |
43 | parisc_set_drvdata(struct parisc_device *d, void *p) | 48 | parisc_set_drvdata(struct parisc_device *d, void *p) |
44 | { | 49 | { |
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h index d0b761f690b5..fa39d07d49e9 100644 --- a/include/asm-parisc/pci.h +++ b/include/asm-parisc/pci.h | |||
@@ -69,7 +69,7 @@ struct pci_hba_data { | |||
69 | #define PCI_PORT_HBA(a) ((a) >> HBA_PORT_SPACE_BITS) | 69 | #define PCI_PORT_HBA(a) ((a) >> HBA_PORT_SPACE_BITS) |
70 | #define PCI_PORT_ADDR(a) ((a) & (HBA_PORT_SPACE_SIZE - 1)) | 70 | #define PCI_PORT_ADDR(a) ((a) & (HBA_PORT_SPACE_SIZE - 1)) |
71 | 71 | ||
72 | #if CONFIG_64BIT | 72 | #ifdef CONFIG_64BIT |
73 | #define PCI_F_EXTEND 0xffffffff00000000UL | 73 | #define PCI_F_EXTEND 0xffffffff00000000UL |
74 | #define PCI_IS_LMMIO(hba,a) pci_is_lmmio(hba,a) | 74 | #define PCI_IS_LMMIO(hba,a) pci_is_lmmio(hba,a) |
75 | 75 | ||
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h index 820c6e712cd7..c28fb6f48c6c 100644 --- a/include/asm-parisc/pgtable.h +++ b/include/asm-parisc/pgtable.h | |||
@@ -501,6 +501,8 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
501 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ | 501 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ |
502 | remap_pfn_range(vma, vaddr, pfn, size, prot) | 502 | remap_pfn_range(vma, vaddr, pfn, size, prot) |
503 | 503 | ||
504 | #define pgprot_noncached(prot) __pgprot(pgprot_val(prot) | _PAGE_NO_CACHE) | ||
505 | |||
504 | #define MK_IOSPACE_PFN(space, pfn) (pfn) | 506 | #define MK_IOSPACE_PFN(space, pfn) (pfn) |
505 | #define GET_IOSPACE(pfn) 0 | 507 | #define GET_IOSPACE(pfn) 0 |
506 | #define GET_PFN(pfn) (pfn) | 508 | #define GET_PFN(pfn) (pfn) |
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h index a9dfadd05658..aae40e8c3aa8 100644 --- a/include/asm-parisc/processor.h +++ b/include/asm-parisc/processor.h | |||
@@ -122,8 +122,27 @@ struct thread_struct { | |||
122 | }; | 122 | }; |
123 | 123 | ||
124 | /* Thread struct flags. */ | 124 | /* Thread struct flags. */ |
125 | #define PARISC_UAC_NOPRINT (1UL << 0) /* see prctl and unaligned.c */ | ||
126 | #define PARISC_UAC_SIGBUS (1UL << 1) | ||
125 | #define PARISC_KERNEL_DEATH (1UL << 31) /* see die_if_kernel()... */ | 127 | #define PARISC_KERNEL_DEATH (1UL << 31) /* see die_if_kernel()... */ |
126 | 128 | ||
129 | #define PARISC_UAC_SHIFT 0 | ||
130 | #define PARISC_UAC_MASK (PARISC_UAC_NOPRINT|PARISC_UAC_SIGBUS) | ||
131 | |||
132 | #define SET_UNALIGN_CTL(task,value) \ | ||
133 | ({ \ | ||
134 | (task)->thread.flags = (((task)->thread.flags & ~PARISC_UAC_MASK) \ | ||
135 | | (((value) << PARISC_UAC_SHIFT) & \ | ||
136 | PARISC_UAC_MASK)); \ | ||
137 | 0; \ | ||
138 | }) | ||
139 | |||
140 | #define GET_UNALIGN_CTL(task,addr) \ | ||
141 | ({ \ | ||
142 | put_user(((task)->thread.flags & PARISC_UAC_MASK) \ | ||
143 | >> PARISC_UAC_SHIFT, (int __user *) (addr)); \ | ||
144 | }) | ||
145 | |||
127 | #define INIT_THREAD { \ | 146 | #define INIT_THREAD { \ |
128 | regs: { gr: { 0, }, \ | 147 | regs: { gr: { 0, }, \ |
129 | fr: { 0, }, \ | 148 | fr: { 0, }, \ |
diff --git a/include/asm-parisc/psw.h b/include/asm-parisc/psw.h index 51323029f377..4334d6ca2add 100644 --- a/include/asm-parisc/psw.h +++ b/include/asm-parisc/psw.h | |||
@@ -1,4 +1,7 @@ | |||
1 | #ifndef _PARISC_PSW_H | 1 | #ifndef _PARISC_PSW_H |
2 | |||
3 | #include <linux/config.h> | ||
4 | |||
2 | #define PSW_I 0x00000001 | 5 | #define PSW_I 0x00000001 |
3 | #define PSW_D 0x00000002 | 6 | #define PSW_D 0x00000002 |
4 | #define PSW_P 0x00000004 | 7 | #define PSW_P 0x00000004 |
@@ -9,6 +12,16 @@ | |||
9 | #define PSW_G 0x00000040 /* PA1.x only */ | 12 | #define PSW_G 0x00000040 /* PA1.x only */ |
10 | #define PSW_O 0x00000080 /* PA2.0 only */ | 13 | #define PSW_O 0x00000080 /* PA2.0 only */ |
11 | 14 | ||
15 | /* ssm/rsm instructions number PSW_W and PSW_E differently */ | ||
16 | #define PSW_SM_I PSW_I /* Enable External Interrupts */ | ||
17 | #define PSW_SM_D PSW_D | ||
18 | #define PSW_SM_P PSW_P | ||
19 | #define PSW_SM_Q PSW_Q /* Enable Interrupt State Collection */ | ||
20 | #define PSW_SM_R PSW_R /* Enable Recover Counter Trap */ | ||
21 | #define PSW_SM_W 0x200 /* PA2.0 only : Enable Wide Mode */ | ||
22 | |||
23 | #define PSW_SM_QUIET PSW_SM_R+PSW_SM_Q+PSW_SM_P+PSW_SM_D+PSW_SM_I | ||
24 | |||
12 | #define PSW_CB 0x0000ff00 | 25 | #define PSW_CB 0x0000ff00 |
13 | 26 | ||
14 | #define PSW_M 0x00010000 | 27 | #define PSW_M 0x00010000 |
@@ -30,33 +43,21 @@ | |||
30 | #define PSW_Z 0x40000000 /* PA1.x only */ | 43 | #define PSW_Z 0x40000000 /* PA1.x only */ |
31 | #define PSW_Y 0x80000000 /* PA1.x only */ | 44 | #define PSW_Y 0x80000000 /* PA1.x only */ |
32 | 45 | ||
33 | #ifdef __LP64__ | 46 | #ifdef CONFIG_64BIT |
34 | #define PSW_HI_CB 0x000000ff /* PA2.0 only */ | 47 | # define PSW_HI_CB 0x000000ff /* PA2.0 only */ |
35 | #endif | 48 | #endif |
36 | 49 | ||
37 | /* PSW bits to be used with ssm/rsm */ | 50 | #ifdef CONFIG_64BIT |
38 | #define PSW_SM_I 0x1 | 51 | # define USER_PSW_HI_MASK PSW_HI_CB |
39 | #define PSW_SM_D 0x2 | 52 | # define WIDE_PSW PSW_W |
40 | #define PSW_SM_P 0x4 | 53 | #else |
41 | #define PSW_SM_Q 0x8 | 54 | # define WIDE_PSW 0 |
42 | #define PSW_SM_R 0x10 | ||
43 | #define PSW_SM_F 0x20 | ||
44 | #define PSW_SM_G 0x40 | ||
45 | #define PSW_SM_O 0x80 | ||
46 | #define PSW_SM_E 0x100 | ||
47 | #define PSW_SM_W 0x200 | ||
48 | |||
49 | #ifdef __LP64__ | ||
50 | # define USER_PSW (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I) | ||
51 | # define KERNEL_PSW (PSW_W | PSW_C | PSW_Q | PSW_P | PSW_D) | ||
52 | # define REAL_MODE_PSW (PSW_W | PSW_Q) | ||
53 | # define USER_PSW_MASK (PSW_W | PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB) | ||
54 | # define USER_PSW_HI_MASK (PSW_HI_CB) | ||
55 | #else | ||
56 | # define USER_PSW (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I) | ||
57 | # define KERNEL_PSW (PSW_C | PSW_Q | PSW_P | PSW_D) | ||
58 | # define REAL_MODE_PSW (PSW_Q) | ||
59 | # define USER_PSW_MASK (PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB) | ||
60 | #endif | 55 | #endif |
61 | 56 | ||
57 | /* Used when setting up for rfi */ | ||
58 | #define KERNEL_PSW (WIDE_PSW | PSW_C | PSW_Q | PSW_P | PSW_D) | ||
59 | #define REAL_MODE_PSW (WIDE_PSW | PSW_Q) | ||
60 | #define USER_PSW_MASK (WIDE_PSW | PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB) | ||
61 | #define USER_PSW (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I) | ||
62 | |||
62 | #endif | 63 | #endif |
diff --git a/include/asm-parisc/ptrace.h b/include/asm-parisc/ptrace.h index 3f428aa371a4..93f990e418f1 100644 --- a/include/asm-parisc/ptrace.h +++ b/include/asm-parisc/ptrace.h | |||
@@ -49,7 +49,7 @@ struct pt_regs { | |||
49 | #define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) | 49 | #define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) |
50 | #define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0) | 50 | #define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0) |
51 | #define instruction_pointer(regs) ((regs)->iaoq[0] & ~3) | 51 | #define instruction_pointer(regs) ((regs)->iaoq[0] & ~3) |
52 | #define profile_pc(regs) instruction_pointer(regs) | 52 | unsigned long profile_pc(struct pt_regs *); |
53 | extern void show_regs(struct pt_regs *); | 53 | extern void show_regs(struct pt_regs *); |
54 | #endif | 54 | #endif |
55 | 55 | ||
diff --git a/include/asm-parisc/spinlock.h b/include/asm-parisc/spinlock.h index 43eaa6e742e0..7c3f406a746a 100644 --- a/include/asm-parisc/spinlock.h +++ b/include/asm-parisc/spinlock.h | |||
@@ -5,11 +5,6 @@ | |||
5 | #include <asm/processor.h> | 5 | #include <asm/processor.h> |
6 | #include <asm/spinlock_types.h> | 6 | #include <asm/spinlock_types.h> |
7 | 7 | ||
8 | /* Note that PA-RISC has to use `1' to mean unlocked and `0' to mean locked | ||
9 | * since it only has load-and-zero. Moreover, at least on some PA processors, | ||
10 | * the semaphore address has to be 16-byte aligned. | ||
11 | */ | ||
12 | |||
13 | static inline int __raw_spin_is_locked(raw_spinlock_t *x) | 8 | static inline int __raw_spin_is_locked(raw_spinlock_t *x) |
14 | { | 9 | { |
15 | volatile unsigned int *a = __ldcw_align(x); | 10 | volatile unsigned int *a = __ldcw_align(x); |
diff --git a/include/asm-parisc/spinlock_types.h b/include/asm-parisc/spinlock_types.h index 785bba822fbf..d6b479bdb886 100644 --- a/include/asm-parisc/spinlock_types.h +++ b/include/asm-parisc/spinlock_types.h | |||
@@ -6,11 +6,15 @@ | |||
6 | #endif | 6 | #endif |
7 | 7 | ||
8 | typedef struct { | 8 | typedef struct { |
9 | #ifdef CONFIG_PA20 | ||
10 | volatile unsigned int slock; | ||
11 | # define __RAW_SPIN_LOCK_UNLOCKED { 1 } | ||
12 | #else | ||
9 | volatile unsigned int lock[4]; | 13 | volatile unsigned int lock[4]; |
14 | # define __RAW_SPIN_LOCK_UNLOCKED { { 1, 1, 1, 1 } } | ||
15 | #endif | ||
10 | } raw_spinlock_t; | 16 | } raw_spinlock_t; |
11 | 17 | ||
12 | #define __RAW_SPIN_LOCK_UNLOCKED { { 1, 1, 1, 1 } } | ||
13 | |||
14 | typedef struct { | 18 | typedef struct { |
15 | raw_spinlock_t lock; | 19 | raw_spinlock_t lock; |
16 | volatile int counter; | 20 | volatile int counter; |
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h index 26ff844a21c1..f3928d3a80cb 100644 --- a/include/asm-parisc/system.h +++ b/include/asm-parisc/system.h | |||
@@ -138,13 +138,7 @@ static inline void set_eiem(unsigned long val) | |||
138 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | 138 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) |
139 | 139 | ||
140 | 140 | ||
141 | /* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */ | 141 | #ifndef CONFIG_PA20 |
142 | #define __ldcw(a) ({ \ | ||
143 | unsigned __ret; \ | ||
144 | __asm__ __volatile__("ldcw 0(%1),%0" : "=r" (__ret) : "r" (a)); \ | ||
145 | __ret; \ | ||
146 | }) | ||
147 | |||
148 | /* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data, | 142 | /* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data, |
149 | and GCC only guarantees 8-byte alignment for stack locals, we can't | 143 | and GCC only guarantees 8-byte alignment for stack locals, we can't |
150 | be assured of 16-byte alignment for atomic lock data even if we | 144 | be assured of 16-byte alignment for atomic lock data even if we |
@@ -152,37 +146,41 @@ static inline void set_eiem(unsigned long val) | |||
152 | we use a struct containing an array of four ints for the atomic lock | 146 | we use a struct containing an array of four ints for the atomic lock |
153 | type and dynamically select the 16-byte aligned int from the array | 147 | type and dynamically select the 16-byte aligned int from the array |
154 | for the semaphore. */ | 148 | for the semaphore. */ |
149 | |||
155 | #define __PA_LDCW_ALIGNMENT 16 | 150 | #define __PA_LDCW_ALIGNMENT 16 |
156 | #define __ldcw_align(a) ({ \ | 151 | #define __ldcw_align(a) ({ \ |
157 | unsigned long __ret = (unsigned long) &(a)->lock[0]; \ | 152 | unsigned long __ret = (unsigned long) &(a)->lock[0]; \ |
158 | __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) & ~(__PA_LDCW_ALIGNMENT - 1); \ | 153 | __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) & ~(__PA_LDCW_ALIGNMENT - 1); \ |
159 | (volatile unsigned int *) __ret; \ | 154 | (volatile unsigned int *) __ret; \ |
160 | }) | 155 | }) |
156 | #define LDCW "ldcw" | ||
161 | 157 | ||
162 | #ifdef CONFIG_SMP | 158 | #else /*CONFIG_PA20*/ |
163 | # define __lock_aligned __attribute__((__section__(".data.lock_aligned"))) | 159 | /* From: "Jim Hull" <jim.hull of hp.com> |
164 | #endif | 160 | I've attached a summary of the change, but basically, for PA 2.0, as |
161 | long as the ",CO" (coherent operation) completer is specified, then the | ||
162 | 16-byte alignment requirement for ldcw and ldcd is relaxed, and instead | ||
163 | they only require "natural" alignment (4-byte for ldcw, 8-byte for | ||
164 | ldcd). */ | ||
165 | 165 | ||
166 | #define KERNEL_START (0x10100000 - 0x1000) | 166 | #define __PA_LDCW_ALIGNMENT 4 |
167 | #define __ldcw_align(a) ((volatile unsigned int *)a) | ||
168 | #define LDCW "ldcw,co" | ||
167 | 169 | ||
168 | /* This is for the serialisation of PxTLB broadcasts. At least on the | 170 | #endif /*!CONFIG_PA20*/ |
169 | * N class systems, only one PxTLB inter processor broadcast can be | ||
170 | * active at any one time on the Merced bus. This tlb purge | ||
171 | * synchronisation is fairly lightweight and harmless so we activate | ||
172 | * it on all SMP systems not just the N class. */ | ||
173 | #ifdef CONFIG_SMP | ||
174 | extern spinlock_t pa_tlb_lock; | ||
175 | 171 | ||
176 | #define purge_tlb_start(x) spin_lock(&pa_tlb_lock) | 172 | /* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */ |
177 | #define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) | 173 | #define __ldcw(a) ({ \ |
178 | 174 | unsigned __ret; \ | |
179 | #else | 175 | __asm__ __volatile__(LDCW " 0(%1),%0" : "=r" (__ret) : "r" (a)); \ |
180 | 176 | __ret; \ | |
181 | #define purge_tlb_start(x) do { } while(0) | 177 | }) |
182 | #define purge_tlb_end(x) do { } while (0) | ||
183 | 178 | ||
179 | #ifdef CONFIG_SMP | ||
180 | # define __lock_aligned __attribute__((__section__(".data.lock_aligned"))) | ||
184 | #endif | 181 | #endif |
185 | 182 | ||
183 | #define KERNEL_START (0x10100000 - 0x1000) | ||
186 | #define arch_align_stack(x) (x) | 184 | #define arch_align_stack(x) (x) |
187 | 185 | ||
188 | #endif | 186 | #endif |
diff --git a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h index eb27b78930e8..84af4ab1fe51 100644 --- a/include/asm-parisc/tlbflush.h +++ b/include/asm-parisc/tlbflush.h | |||
@@ -7,6 +7,26 @@ | |||
7 | #include <linux/mm.h> | 7 | #include <linux/mm.h> |
8 | #include <asm/mmu_context.h> | 8 | #include <asm/mmu_context.h> |
9 | 9 | ||
10 | |||
11 | /* This is for the serialisation of PxTLB broadcasts. At least on the | ||
12 | * N class systems, only one PxTLB inter processor broadcast can be | ||
13 | * active at any one time on the Merced bus. This tlb purge | ||
14 | * synchronisation is fairly lightweight and harmless so we activate | ||
15 | * it on all SMP systems not just the N class. */ | ||
16 | #ifdef CONFIG_SMP | ||
17 | extern spinlock_t pa_tlb_lock; | ||
18 | |||
19 | #define purge_tlb_start(x) spin_lock(&pa_tlb_lock) | ||
20 | #define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) | ||
21 | |||
22 | #else | ||
23 | |||
24 | #define purge_tlb_start(x) do { } while(0) | ||
25 | #define purge_tlb_end(x) do { } while (0) | ||
26 | |||
27 | #endif | ||
28 | |||
29 | |||
10 | extern void flush_tlb_all(void); | 30 | extern void flush_tlb_all(void); |
11 | 31 | ||
12 | /* | 32 | /* |
@@ -64,29 +84,26 @@ static inline void flush_tlb_range(struct vm_area_struct *vma, | |||
64 | { | 84 | { |
65 | unsigned long npages; | 85 | unsigned long npages; |
66 | 86 | ||
67 | |||
68 | npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT; | 87 | npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT; |
69 | if (npages >= 512) /* XXX arbitrary, should be tuned */ | 88 | if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */ |
70 | flush_tlb_all(); | 89 | flush_tlb_all(); |
71 | else { | 90 | else { |
72 | 91 | ||
73 | mtsp(vma->vm_mm->context,1); | 92 | mtsp(vma->vm_mm->context,1); |
93 | purge_tlb_start(); | ||
74 | if (split_tlb) { | 94 | if (split_tlb) { |
75 | purge_tlb_start(); | ||
76 | while (npages--) { | 95 | while (npages--) { |
77 | pdtlb(start); | 96 | pdtlb(start); |
78 | pitlb(start); | 97 | pitlb(start); |
79 | start += PAGE_SIZE; | 98 | start += PAGE_SIZE; |
80 | } | 99 | } |
81 | purge_tlb_end(); | ||
82 | } else { | 100 | } else { |
83 | purge_tlb_start(); | ||
84 | while (npages--) { | 101 | while (npages--) { |
85 | pdtlb(start); | 102 | pdtlb(start); |
86 | start += PAGE_SIZE; | 103 | start += PAGE_SIZE; |
87 | } | 104 | } |
88 | purge_tlb_end(); | ||
89 | } | 105 | } |
106 | purge_tlb_end(); | ||
90 | } | 107 | } |
91 | } | 108 | } |
92 | 109 | ||
diff --git a/include/asm-parisc/types.h b/include/asm-parisc/types.h index d21b9d0d63ea..34fdce361a5a 100644 --- a/include/asm-parisc/types.h +++ b/include/asm-parisc/types.h | |||
@@ -33,8 +33,10 @@ typedef unsigned long long __u64; | |||
33 | 33 | ||
34 | #ifdef __LP64__ | 34 | #ifdef __LP64__ |
35 | #define BITS_PER_LONG 64 | 35 | #define BITS_PER_LONG 64 |
36 | #define SHIFT_PER_LONG 6 | ||
36 | #else | 37 | #else |
37 | #define BITS_PER_LONG 32 | 38 | #define BITS_PER_LONG 32 |
39 | #define SHIFT_PER_LONG 5 | ||
38 | #endif | 40 | #endif |
39 | 41 | ||
40 | #ifndef __ASSEMBLY__ | 42 | #ifndef __ASSEMBLY__ |
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h index 6a9f0cadff58..e7a620c5c5e6 100644 --- a/include/asm-parisc/unistd.h +++ b/include/asm-parisc/unistd.h | |||
@@ -687,8 +687,8 @@ | |||
687 | #define __NR_shmget (__NR_Linux + 194) | 687 | #define __NR_shmget (__NR_Linux + 194) |
688 | #define __NR_shmctl (__NR_Linux + 195) | 688 | #define __NR_shmctl (__NR_Linux + 195) |
689 | 689 | ||
690 | #define __NR_getpmsg (__NR_Linux + 196) /* some people actually want streams */ | 690 | #define __NR_getpmsg (__NR_Linux + 196) /* Somebody *wants* streams? */ |
691 | #define __NR_putpmsg (__NR_Linux + 197) /* some people actually want streams */ | 691 | #define __NR_putpmsg (__NR_Linux + 197) |
692 | 692 | ||
693 | #define __NR_lstat64 (__NR_Linux + 198) | 693 | #define __NR_lstat64 (__NR_Linux + 198) |
694 | #define __NR_truncate64 (__NR_Linux + 199) | 694 | #define __NR_truncate64 (__NR_Linux + 199) |
@@ -755,8 +755,14 @@ | |||
755 | #define __NR_mbind (__NR_Linux + 260) | 755 | #define __NR_mbind (__NR_Linux + 260) |
756 | #define __NR_get_mempolicy (__NR_Linux + 261) | 756 | #define __NR_get_mempolicy (__NR_Linux + 261) |
757 | #define __NR_set_mempolicy (__NR_Linux + 262) | 757 | #define __NR_set_mempolicy (__NR_Linux + 262) |
758 | #define __NR_vserver (__NR_Linux + 263) | ||
759 | #define __NR_add_key (__NR_Linux + 264) | ||
760 | #define __NR_request_key (__NR_Linux + 265) | ||
761 | #define __NR_keyctl (__NR_Linux + 266) | ||
762 | #define __NR_ioprio_set (__NR_Linux + 267) | ||
763 | #define __NR_ioprio_get (__NR_Linux + 268) | ||
758 | 764 | ||
759 | #define __NR_Linux_syscalls 263 | 765 | #define __NR_Linux_syscalls 269 |
760 | 766 | ||
761 | #define HPUX_GATEWAY_ADDR 0xC0000004 | 767 | #define HPUX_GATEWAY_ADDR 0xC0000004 |
762 | #define LINUX_GATEWAY_ADDR 0x100 | 768 | #define LINUX_GATEWAY_ADDR 0x100 |
@@ -807,10 +813,10 @@ | |||
807 | #define K_INLINE_SYSCALL(name, nr, args...) ({ \ | 813 | #define K_INLINE_SYSCALL(name, nr, args...) ({ \ |
808 | long __sys_res; \ | 814 | long __sys_res; \ |
809 | { \ | 815 | { \ |
810 | register unsigned long __res asm("r28"); \ | 816 | register unsigned long __res __asm__("r28"); \ |
811 | K_LOAD_ARGS_##nr(args) \ | 817 | K_LOAD_ARGS_##nr(args) \ |
812 | /* FIXME: HACK stw/ldw r19 around syscall */ \ | 818 | /* FIXME: HACK stw/ldw r19 around syscall */ \ |
813 | asm volatile( \ | 819 | __asm__ volatile( \ |
814 | K_STW_ASM_PIC \ | 820 | K_STW_ASM_PIC \ |
815 | " ble 0x100(%%sr2, %%r0)\n" \ | 821 | " ble 0x100(%%sr2, %%r0)\n" \ |
816 | " ldi %1, %%r20\n" \ | 822 | " ldi %1, %%r20\n" \ |
diff --git a/include/linux/device.h b/include/linux/device.h index 95d607a48f06..a9e72ac3fb9f 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -28,19 +28,6 @@ | |||
28 | #define BUS_ID_SIZE KOBJ_NAME_LEN | 28 | #define BUS_ID_SIZE KOBJ_NAME_LEN |
29 | 29 | ||
30 | 30 | ||
31 | enum { | ||
32 | SUSPEND_NOTIFY, | ||
33 | SUSPEND_SAVE_STATE, | ||
34 | SUSPEND_DISABLE, | ||
35 | SUSPEND_POWER_DOWN, | ||
36 | }; | ||
37 | |||
38 | enum { | ||
39 | RESUME_POWER_ON, | ||
40 | RESUME_RESTORE_STATE, | ||
41 | RESUME_ENABLE, | ||
42 | }; | ||
43 | |||
44 | struct device; | 31 | struct device; |
45 | struct device_driver; | 32 | struct device_driver; |
46 | struct class; | 33 | struct class; |
@@ -115,8 +102,8 @@ struct device_driver { | |||
115 | int (*probe) (struct device * dev); | 102 | int (*probe) (struct device * dev); |
116 | int (*remove) (struct device * dev); | 103 | int (*remove) (struct device * dev); |
117 | void (*shutdown) (struct device * dev); | 104 | void (*shutdown) (struct device * dev); |
118 | int (*suspend) (struct device * dev, pm_message_t state, u32 level); | 105 | int (*suspend) (struct device * dev, pm_message_t state); |
119 | int (*resume) (struct device * dev, u32 level); | 106 | int (*resume) (struct device * dev); |
120 | }; | 107 | }; |
121 | 108 | ||
122 | 109 | ||
@@ -190,7 +177,43 @@ struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store) | |||
190 | extern int class_create_file(struct class *, const struct class_attribute *); | 177 | extern int class_create_file(struct class *, const struct class_attribute *); |
191 | extern void class_remove_file(struct class *, const struct class_attribute *); | 178 | extern void class_remove_file(struct class *, const struct class_attribute *); |
192 | 179 | ||
180 | struct class_device_attribute { | ||
181 | struct attribute attr; | ||
182 | ssize_t (*show)(struct class_device *, char * buf); | ||
183 | ssize_t (*store)(struct class_device *, const char * buf, size_t count); | ||
184 | }; | ||
185 | |||
186 | #define CLASS_DEVICE_ATTR(_name,_mode,_show,_store) \ | ||
187 | struct class_device_attribute class_device_attr_##_name = \ | ||
188 | __ATTR(_name,_mode,_show,_store) | ||
189 | |||
190 | extern int class_device_create_file(struct class_device *, | ||
191 | const struct class_device_attribute *); | ||
193 | 192 | ||
193 | /** | ||
194 | * struct class_device - class devices | ||
195 | * @class: pointer to the parent class for this class device. This is required. | ||
196 | * @devt: for internal use by the driver core only. | ||
197 | * @node: for internal use by the driver core only. | ||
198 | * @kobj: for internal use by the driver core only. | ||
199 | * @devt_attr: for internal use by the driver core only. | ||
200 | * @dev: if set, a symlink to the struct device is created in the sysfs | ||
201 | * directory for this struct class device. | ||
202 | * @class_data: pointer to whatever you want to store here for this struct | ||
203 | * class_device. Use class_get_devdata() and class_set_devdata() to get and | ||
204 | * set this pointer. | ||
205 | * @parent: pointer to a struct class_device that is the parent of this struct | ||
206 | * class_device. If NULL, this class_device will show up at the root of the | ||
207 | * struct class in sysfs (which is probably what you want to have happen.) | ||
208 | * @release: pointer to a release function for this struct class_device. If | ||
209 | * set, this will be called instead of the class specific release function. | ||
210 | * Only use this if you want to override the default release function, like | ||
211 | * when you are nesting class_device structures. | ||
212 | * @hotplug: pointer to a hotplug function for this struct class_device. If | ||
213 | * set, this will be called instead of the class specific hotplug function. | ||
214 | * Only use this if you want to override the default hotplug function, like | ||
215 | * when you are nesting class_device structures. | ||
216 | */ | ||
194 | struct class_device { | 217 | struct class_device { |
195 | struct list_head node; | 218 | struct list_head node; |
196 | 219 | ||
@@ -198,9 +221,14 @@ struct class_device { | |||
198 | struct class * class; /* required */ | 221 | struct class * class; /* required */ |
199 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 222 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
200 | struct class_device_attribute *devt_attr; | 223 | struct class_device_attribute *devt_attr; |
224 | struct class_device_attribute uevent_attr; | ||
201 | struct device * dev; /* not necessary, but nice to have */ | 225 | struct device * dev; /* not necessary, but nice to have */ |
202 | void * class_data; /* class-specific data */ | 226 | void * class_data; /* class-specific data */ |
227 | struct class_device *parent; /* parent of this child device, if there is one */ | ||
203 | 228 | ||
229 | void (*release)(struct class_device *dev); | ||
230 | int (*hotplug)(struct class_device *dev, char **envp, | ||
231 | int num_envp, char *buffer, int buffer_size); | ||
204 | char class_id[BUS_ID_SIZE]; /* unique to this class */ | 232 | char class_id[BUS_ID_SIZE]; /* unique to this class */ |
205 | }; | 233 | }; |
206 | 234 | ||
@@ -228,18 +256,6 @@ extern int class_device_rename(struct class_device *, char *); | |||
228 | extern struct class_device * class_device_get(struct class_device *); | 256 | extern struct class_device * class_device_get(struct class_device *); |
229 | extern void class_device_put(struct class_device *); | 257 | extern void class_device_put(struct class_device *); |
230 | 258 | ||
231 | struct class_device_attribute { | ||
232 | struct attribute attr; | ||
233 | ssize_t (*show)(struct class_device *, char * buf); | ||
234 | ssize_t (*store)(struct class_device *, const char * buf, size_t count); | ||
235 | }; | ||
236 | |||
237 | #define CLASS_DEVICE_ATTR(_name,_mode,_show,_store) \ | ||
238 | struct class_device_attribute class_device_attr_##_name = \ | ||
239 | __ATTR(_name,_mode,_show,_store) | ||
240 | |||
241 | extern int class_device_create_file(struct class_device *, | ||
242 | const struct class_device_attribute *); | ||
243 | extern void class_device_remove_file(struct class_device *, | 259 | extern void class_device_remove_file(struct class_device *, |
244 | const struct class_device_attribute *); | 260 | const struct class_device_attribute *); |
245 | extern int class_device_create_bin_file(struct class_device *, | 261 | extern int class_device_create_bin_file(struct class_device *, |
@@ -251,8 +267,8 @@ struct class_interface { | |||
251 | struct list_head node; | 267 | struct list_head node; |
252 | struct class *class; | 268 | struct class *class; |
253 | 269 | ||
254 | int (*add) (struct class_device *); | 270 | int (*add) (struct class_device *, struct class_interface *); |
255 | void (*remove) (struct class_device *); | 271 | void (*remove) (struct class_device *, struct class_interface *); |
256 | }; | 272 | }; |
257 | 273 | ||
258 | extern int class_interface_register(struct class_interface *); | 274 | extern int class_interface_register(struct class_interface *); |
@@ -260,12 +276,29 @@ extern void class_interface_unregister(struct class_interface *); | |||
260 | 276 | ||
261 | extern struct class *class_create(struct module *owner, char *name); | 277 | extern struct class *class_create(struct module *owner, char *name); |
262 | extern void class_destroy(struct class *cls); | 278 | extern void class_destroy(struct class *cls); |
263 | extern struct class_device *class_device_create(struct class *cls, dev_t devt, | 279 | extern struct class_device *class_device_create(struct class *cls, |
264 | struct device *device, char *fmt, ...) | 280 | struct class_device *parent, |
265 | __attribute__((format(printf,4,5))); | 281 | dev_t devt, |
282 | struct device *device, | ||
283 | char *fmt, ...) | ||
284 | __attribute__((format(printf,5,6))); | ||
266 | extern void class_device_destroy(struct class *cls, dev_t devt); | 285 | extern void class_device_destroy(struct class *cls, dev_t devt); |
267 | 286 | ||
268 | 287 | ||
288 | /* interface for exporting device attributes */ | ||
289 | struct device_attribute { | ||
290 | struct attribute attr; | ||
291 | ssize_t (*show)(struct device *dev, struct device_attribute *attr, | ||
292 | char *buf); | ||
293 | ssize_t (*store)(struct device *dev, struct device_attribute *attr, | ||
294 | const char *buf, size_t count); | ||
295 | }; | ||
296 | |||
297 | #define DEVICE_ATTR(_name,_mode,_show,_store) \ | ||
298 | struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store) | ||
299 | |||
300 | extern int device_create_file(struct device *device, struct device_attribute * entry); | ||
301 | extern void device_remove_file(struct device * dev, struct device_attribute * attr); | ||
269 | struct device { | 302 | struct device { |
270 | struct klist klist_children; | 303 | struct klist klist_children; |
271 | struct klist_node knode_parent; /* node in sibling list */ | 304 | struct klist_node knode_parent; /* node in sibling list */ |
@@ -275,6 +308,7 @@ struct device { | |||
275 | 308 | ||
276 | struct kobject kobj; | 309 | struct kobject kobj; |
277 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | 310 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ |
311 | struct device_attribute uevent_attr; | ||
278 | 312 | ||
279 | struct semaphore sem; /* semaphore to synchronize calls to | 313 | struct semaphore sem; /* semaphore to synchronize calls to |
280 | * its driver. | 314 | * its driver. |
@@ -343,23 +377,6 @@ extern int device_attach(struct device * dev); | |||
343 | extern void driver_attach(struct device_driver * drv); | 377 | extern void driver_attach(struct device_driver * drv); |
344 | 378 | ||
345 | 379 | ||
346 | /* driverfs interface for exporting device attributes */ | ||
347 | |||
348 | struct device_attribute { | ||
349 | struct attribute attr; | ||
350 | ssize_t (*show)(struct device *dev, struct device_attribute *attr, | ||
351 | char *buf); | ||
352 | ssize_t (*store)(struct device *dev, struct device_attribute *attr, | ||
353 | const char *buf, size_t count); | ||
354 | }; | ||
355 | |||
356 | #define DEVICE_ATTR(_name,_mode,_show,_store) \ | ||
357 | struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store) | ||
358 | |||
359 | |||
360 | extern int device_create_file(struct device *device, struct device_attribute * entry); | ||
361 | extern void device_remove_file(struct device * dev, struct device_attribute * attr); | ||
362 | |||
363 | /* | 380 | /* |
364 | * Platform "fixup" functions - allow the platform to have their say | 381 | * Platform "fixup" functions - allow the platform to have their say |
365 | * about devices and actions that the general device layer doesn't | 382 | * about devices and actions that the general device layer doesn't |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index ed1440ea4c91..d2c390eff1b2 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -269,6 +269,8 @@ u32 ethtool_op_get_tso(struct net_device *dev); | |||
269 | int ethtool_op_set_tso(struct net_device *dev, u32 data); | 269 | int ethtool_op_set_tso(struct net_device *dev, u32 data); |
270 | int ethtool_op_get_perm_addr(struct net_device *dev, | 270 | int ethtool_op_get_perm_addr(struct net_device *dev, |
271 | struct ethtool_perm_addr *addr, u8 *data); | 271 | struct ethtool_perm_addr *addr, u8 *data); |
272 | u32 ethtool_op_get_ufo(struct net_device *dev); | ||
273 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); | ||
272 | 274 | ||
273 | /** | 275 | /** |
274 | * ðtool_ops - Alter and report network device settings | 276 | * ðtool_ops - Alter and report network device settings |
@@ -298,6 +300,8 @@ int ethtool_op_get_perm_addr(struct net_device *dev, | |||
298 | * set_sg: Turn scatter-gather on or off | 300 | * set_sg: Turn scatter-gather on or off |
299 | * get_tso: Report whether TCP segmentation offload is enabled | 301 | * get_tso: Report whether TCP segmentation offload is enabled |
300 | * set_tso: Turn TCP segmentation offload on or off | 302 | * set_tso: Turn TCP segmentation offload on or off |
303 | * get_ufo: Report whether UDP fragmentation offload is enabled | ||
304 | * set_ufo: Turn UDP fragmentation offload on or off | ||
301 | * self_test: Run specified self-tests | 305 | * self_test: Run specified self-tests |
302 | * get_strings: Return a set of strings that describe the requested objects | 306 | * get_strings: Return a set of strings that describe the requested objects |
303 | * phys_id: Identify the device | 307 | * phys_id: Identify the device |
@@ -364,6 +368,8 @@ struct ethtool_ops { | |||
364 | int (*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *); | 368 | int (*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *); |
365 | int (*begin)(struct net_device *); | 369 | int (*begin)(struct net_device *); |
366 | void (*complete)(struct net_device *); | 370 | void (*complete)(struct net_device *); |
371 | u32 (*get_ufo)(struct net_device *); | ||
372 | int (*set_ufo)(struct net_device *, u32); | ||
367 | }; | 373 | }; |
368 | 374 | ||
369 | /* CMDs currently supported */ | 375 | /* CMDs currently supported */ |
@@ -400,6 +406,8 @@ struct ethtool_ops { | |||
400 | #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ | 406 | #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ |
401 | #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ | 407 | #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ |
402 | #define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ | 408 | #define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ |
409 | #define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */ | ||
410 | #define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */ | ||
403 | 411 | ||
404 | /* compatibility with older code */ | 412 | /* compatibility with older code */ |
405 | #define SPARC_ETH_GSET ETHTOOL_GSET | 413 | #define SPARC_ETH_GSET ETHTOOL_GSET |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 142e1c1e0689..eabdb5cce357 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -132,6 +132,7 @@ struct gendisk { | |||
132 | struct disk_attribute { | 132 | struct disk_attribute { |
133 | struct attribute attr; | 133 | struct attribute attr; |
134 | ssize_t (*show)(struct gendisk *, char *); | 134 | ssize_t (*show)(struct gendisk *, char *); |
135 | ssize_t (*store)(struct gendisk *, const char *, size_t); | ||
135 | }; | 136 | }; |
136 | 137 | ||
137 | /* | 138 | /* |
diff --git a/include/linux/hil.h b/include/linux/hil.h new file mode 100644 index 000000000000..13352d7d0caf --- /dev/null +++ b/include/linux/hil.h | |||
@@ -0,0 +1,483 @@ | |||
1 | #ifndef _HIL_H_ | ||
2 | #define _HIL_H_ | ||
3 | |||
4 | /* | ||
5 | * Hewlett Packard Human Interface Loop (HP-HIL) Protocol -- header. | ||
6 | * | ||
7 | * Copyright (c) 2001 Brian S. Julin | ||
8 | * All rights reserved. | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or without | ||
11 | * modification, are permitted provided that the following conditions | ||
12 | * are met: | ||
13 | * 1. Redistributions of source code must retain the above copyright | ||
14 | * notice, this list of conditions, and the following disclaimer, | ||
15 | * without modification. | ||
16 | * 2. The name of the author may not be used to endorse or promote products | ||
17 | * derived from this software without specific prior written permission. | ||
18 | * | ||
19 | * Alternatively, this software may be distributed under the terms of the | ||
20 | * GNU General Public License ("GPL"). | ||
21 | * | ||
22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR | ||
26 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
31 | * | ||
32 | * References: | ||
33 | * HP-HIL Technical Reference Manual. Hewlett Packard Product No. 45918A | ||
34 | * | ||
35 | * A note of thanks to HP for providing and shipping reference materials | ||
36 | * free of charge to help in the development of HIL support for Linux. | ||
37 | * | ||
38 | */ | ||
39 | |||
40 | #include <asm/types.h> | ||
41 | |||
42 | /* Physical constants relevant to raw loop/device timing. | ||
43 | */ | ||
44 | |||
45 | #define HIL_CLOCK 8MHZ | ||
46 | #define HIL_EK1_CLOCK 30HZ | ||
47 | #define HIL_EK2_CLOCK 60HZ | ||
48 | |||
49 | #define HIL_TIMEOUT_DEV 5 /* ms */ | ||
50 | #define HIL_TIMEOUT_DEVS 10 /* ms */ | ||
51 | #define HIL_TIMEOUT_NORESP 10 /* ms */ | ||
52 | #define HIL_TIMEOUT_DEVS_DATA 16 /* ms */ | ||
53 | #define HIL_TIMEOUT_SELFTEST 200 /* ms */ | ||
54 | |||
55 | |||
56 | /* Actual wire line coding. These will only be useful if someone is | ||
57 | * implementing a software MLC to run HIL devices on a non-parisc machine. | ||
58 | */ | ||
59 | |||
60 | #define HIL_WIRE_PACKET_LEN 15 | ||
61 | enum hil_wire_bitpos { | ||
62 | HIL_WIRE_START = 0, | ||
63 | HIL_WIRE_ADDR2, | ||
64 | HIL_WIRE_ADDR1, | ||
65 | HIL_WIRE_ADDR0, | ||
66 | HIL_WIRE_COMMAND, | ||
67 | HIL_WIRE_DATA7, | ||
68 | HIL_WIRE_DATA6, | ||
69 | HIL_WIRE_DATA5, | ||
70 | HIL_WIRE_DATA4, | ||
71 | HIL_WIRE_DATA3, | ||
72 | HIL_WIRE_DATA2, | ||
73 | HIL_WIRE_DATA1, | ||
74 | HIL_WIRE_DATA0, | ||
75 | HIL_WIRE_PARITY, | ||
76 | HIL_WIRE_STOP | ||
77 | }; | ||
78 | |||
79 | /* HP documentation uses these bit positions to refer to commands; | ||
80 | * we will call these "packets". | ||
81 | */ | ||
82 | enum hil_pkt_bitpos { | ||
83 | HIL_PKT_CMD = 0x00000800, | ||
84 | HIL_PKT_ADDR2 = 0x00000400, | ||
85 | HIL_PKT_ADDR1 = 0x00000200, | ||
86 | HIL_PKT_ADDR0 = 0x00000100, | ||
87 | HIL_PKT_ADDR_MASK = 0x00000700, | ||
88 | HIL_PKT_ADDR_SHIFT = 8, | ||
89 | HIL_PKT_DATA7 = 0x00000080, | ||
90 | HIL_PKT_DATA6 = 0x00000040, | ||
91 | HIL_PKT_DATA5 = 0x00000020, | ||
92 | HIL_PKT_DATA4 = 0x00000010, | ||
93 | HIL_PKT_DATA3 = 0x00000008, | ||
94 | HIL_PKT_DATA2 = 0x00000004, | ||
95 | HIL_PKT_DATA1 = 0x00000002, | ||
96 | HIL_PKT_DATA0 = 0x00000001, | ||
97 | HIL_PKT_DATA_MASK = 0x000000FF, | ||
98 | HIL_PKT_DATA_SHIFT = 0 | ||
99 | }; | ||
100 | |||
101 | /* The HIL MLC also has several error/status/control bits. We extend the | ||
102 | * "packet" to include these when direct access to the MLC is available, | ||
103 | * or emulate them in cases where they are not available. | ||
104 | * | ||
105 | * This way the device driver knows that the underlying MLC driver | ||
106 | * has had to deal with loop errors. | ||
107 | */ | ||
108 | enum hil_error_bitpos { | ||
109 | HIL_ERR_OB = 0x00000800, /* MLC is busy sending an auto-poll, | ||
110 | or we have filled up the output | ||
111 | buffer and must wait. */ | ||
112 | HIL_ERR_INT = 0x00010000, /* A normal interrupt has occurred. */ | ||
113 | HIL_ERR_NMI = 0x00020000, /* An NMI has occurred. */ | ||
114 | HIL_ERR_LERR = 0x00040000, /* A poll didn't come back. */ | ||
115 | HIL_ERR_PERR = 0x01000000, /* There was a Parity Error. */ | ||
116 | HIL_ERR_FERR = 0x02000000, /* There was a Framing Error. */ | ||
117 | HIL_ERR_FOF = 0x04000000 /* Input FIFO Overflowed. */ | ||
118 | }; | ||
119 | |||
120 | enum hil_control_bitpos { | ||
121 | HIL_CTRL_TEST = 0x00010000, | ||
122 | HIL_CTRL_IPF = 0x00040000, | ||
123 | HIL_CTRL_APE = 0x02000000 | ||
124 | }; | ||
125 | |||
126 | /* Bits 30,31 are unused, we use them to control write behavior. */ | ||
127 | #define HIL_DO_ALTER_CTRL 0x40000000 /* Write MSW of packet to control | ||
128 | before writing LSW to loop */ | ||
129 | #define HIL_CTRL_ONLY 0xc0000000 /* *Only* alter the control registers */ | ||
130 | |||
131 | /* This gives us a 32-bit "packet" | ||
132 | */ | ||
133 | typedef u32 hil_packet; | ||
134 | |||
135 | |||
136 | /* HIL Loop commands | ||
137 | */ | ||
138 | enum hil_command { | ||
139 | HIL_CMD_IFC = 0x00, /* Interface Clear */ | ||
140 | HIL_CMD_EPT = 0x01, /* Enter Pass-Thru Mode */ | ||
141 | HIL_CMD_ELB = 0x02, /* Enter Loop-Back Mode */ | ||
142 | HIL_CMD_IDD = 0x03, /* Identify and Describe */ | ||
143 | HIL_CMD_DSR = 0x04, /* Device Soft Reset */ | ||
144 | HIL_CMD_PST = 0x05, /* Perform Self Test */ | ||
145 | HIL_CMD_RRG = 0x06, /* Read Register */ | ||
146 | HIL_CMD_WRG = 0x07, /* Write Register */ | ||
147 | HIL_CMD_ACF = 0x08, /* Auto Configure */ | ||
148 | HIL_CMDID_ACF = 0x07, /* Auto Configure bits with incremented ID */ | ||
149 | HIL_CMD_POL = 0x10, /* Poll */ | ||
150 | HIL_CMDCT_POL = 0x0f, /* Poll command bits with item count */ | ||
151 | HIL_CMD_RPL = 0x20, /* RePoll */ | ||
152 | HIL_CMDCT_RPL = 0x0f, /* RePoll command bits with item count */ | ||
153 | HIL_CMD_RNM = 0x30, /* Report Name */ | ||
154 | HIL_CMD_RST = 0x31, /* Report Status */ | ||
155 | HIL_CMD_EXD = 0x32, /* Extended Describe */ | ||
156 | HIL_CMD_RSC = 0x33, /* Report Security Code */ | ||
157 | |||
158 | /* 0x34 to 0x3c reserved for future use */ | ||
159 | |||
160 | HIL_CMD_DKA = 0x3d, /* Disable Keyswitch Autorepeat */ | ||
161 | HIL_CMD_EK1 = 0x3e, /* Enable Keyswitch Autorepeat 1 */ | ||
162 | HIL_CMD_EK2 = 0x3f, /* Enable Keyswitch Autorepeat 2 */ | ||
163 | HIL_CMD_PR1 = 0x40, /* Prompt1 */ | ||
164 | HIL_CMD_PR2 = 0x41, /* Prompt2 */ | ||
165 | HIL_CMD_PR3 = 0x42, /* Prompt3 */ | ||
166 | HIL_CMD_PR4 = 0x43, /* Prompt4 */ | ||
167 | HIL_CMD_PR5 = 0x44, /* Prompt5 */ | ||
168 | HIL_CMD_PR6 = 0x45, /* Prompt6 */ | ||
169 | HIL_CMD_PR7 = 0x46, /* Prompt7 */ | ||
170 | HIL_CMD_PRM = 0x47, /* Prompt (General Purpose) */ | ||
171 | HIL_CMD_AK1 = 0x48, /* Acknowlege1 */ | ||
172 | HIL_CMD_AK2 = 0x49, /* Acknowlege2 */ | ||
173 | HIL_CMD_AK3 = 0x4a, /* Acknowlege3 */ | ||
174 | HIL_CMD_AK4 = 0x4b, /* Acknowlege4 */ | ||
175 | HIL_CMD_AK5 = 0x4c, /* Acknowlege5 */ | ||
176 | HIL_CMD_AK6 = 0x4d, /* Acknowlege6 */ | ||
177 | HIL_CMD_AK7 = 0x4e, /* Acknowlege7 */ | ||
178 | HIL_CMD_ACK = 0x4f, /* Acknowlege (General Purpose) */ | ||
179 | |||
180 | /* 0x50 to 0x78 reserved for future use */ | ||
181 | /* 0x80 to 0xEF device-specific commands */ | ||
182 | /* 0xf0 to 0xf9 reserved for future use */ | ||
183 | |||
184 | HIL_CMD_RIO = 0xfa, /* Register I/O Error */ | ||
185 | HIL_CMD_SHR = 0xfb, /* System Hard Reset */ | ||
186 | HIL_CMD_TER = 0xfc, /* Transmission Error */ | ||
187 | HIL_CMD_CAE = 0xfd, /* Configuration Address Error */ | ||
188 | HIL_CMD_DHR = 0xfe, /* Device Hard Reset */ | ||
189 | |||
190 | /* 0xff is prohibited from use. */ | ||
191 | }; | ||
192 | |||
193 | |||
194 | /* | ||
195 | * Response "records" to HIL commands | ||
196 | */ | ||
197 | |||
198 | /* Device ID byte | ||
199 | */ | ||
200 | #define HIL_IDD_DID_TYPE_MASK 0xe0 /* Primary type bits */ | ||
201 | #define HIL_IDD_DID_TYPE_KB_INTEGRAL 0xa0 /* Integral keyboard */ | ||
202 | #define HIL_IDD_DID_TYPE_KB_ITF 0xc0 /* ITD keyboard */ | ||
203 | #define HIL_IDD_DID_TYPE_KB_RSVD 0xe0 /* Reserved keyboard type */ | ||
204 | #define HIL_IDD_DID_TYPE_KB_LANG_MASK 0x1f /* Keyboard locale bits */ | ||
205 | #define HIL_IDD_DID_KBLANG_USE_ESD 0x00 /* Use ESD Locale instead */ | ||
206 | #define HIL_IDD_DID_TYPE_ABS 0x80 /* Absolute Positioners */ | ||
207 | #define HIL_IDD_DID_ABS_RSVD1_MASK 0xf8 /* Reserved */ | ||
208 | #define HIL_IDD_DID_ABS_RSVD1 0x98 | ||
209 | #define HIL_IDD_DID_ABS_TABLET_MASK 0xf8 /* Tablets and digitizers */ | ||
210 | #define HIL_IDD_DID_ABS_TABLET 0x90 | ||
211 | #define HIL_IDD_DID_ABS_TSCREEN_MASK 0xfc /* Touch screens */ | ||
212 | #define HIL_IDD_DID_ABS_TSCREEN 0x8c | ||
213 | #define HIL_IDD_DID_ABS_RSVD2_MASK 0xfc /* Reserved */ | ||
214 | #define HIL_IDD_DID_ABS_RSVD2 0x88 | ||
215 | #define HIL_IDD_DID_ABS_RSVD3_MASK 0xfc /* Reserved */ | ||
216 | #define HIL_IDD_DID_ABS_RSVD3 0x80 | ||
217 | #define HIL_IDD_DID_TYPE_REL 0x60 /* Relative Positioners */ | ||
218 | #define HIL_IDD_DID_REL_RSVD1_MASK 0xf0 /* Reserved */ | ||
219 | #define HIL_IDD_DID_REL_RSVD1 0x70 | ||
220 | #define HIL_IDD_DID_REL_RSVD2_MASK 0xfc /* Reserved */ | ||
221 | #define HIL_IDD_DID_REL_RSVD2 0x6c | ||
222 | #define HIL_IDD_DID_REL_MOUSE_MASK 0xfc /* Mouse */ | ||
223 | #define HIL_IDD_DID_REL_MOUSE 0x68 | ||
224 | #define HIL_IDD_DID_REL_QUAD_MASK 0xf8 /* Other Quadrature Devices */ | ||
225 | #define HIL_IDD_DID_REL_QUAD 0x60 | ||
226 | #define HIL_IDD_DID_TYPE_CHAR 0x40 /* Character Entry */ | ||
227 | #define HIL_IDD_DID_CHAR_BARCODE_MASK 0xfc /* Barcode Reader */ | ||
228 | #define HIL_IDD_DID_CHAR_BARCODE 0x5c | ||
229 | #define HIL_IDD_DID_CHAR_RSVD1_MASK 0xfc /* Reserved */ | ||
230 | #define HIL_IDD_DID_CHAR_RSVD1 0x58 | ||
231 | #define HIL_IDD_DID_CHAR_RSVD2_MASK 0xf8 /* Reserved */ | ||
232 | #define HIL_IDD_DID_CHAR_RSVD2 0x50 | ||
233 | #define HIL_IDD_DID_CHAR_RSVD3_MASK 0xf0 /* Reserved */ | ||
234 | #define HIL_IDD_DID_CHAR_RSVD3 0x40 | ||
235 | #define HIL_IDD_DID_TYPE_OTHER 0x20 /* Miscellaneous */ | ||
236 | #define HIL_IDD_DID_OTHER_RSVD1_MASK 0xf0 /* Reserved */ | ||
237 | #define HIL_IDD_DID_OTHER_RSVD1 0x30 | ||
238 | #define HIL_IDD_DID_OTHER_BARCODE_MASK 0xfc /* Tone Generator */ | ||
239 | #define HIL_IDD_DID_OTHER_BARCODE 0x2c | ||
240 | #define HIL_IDD_DID_OTHER_RSVD2_MASK 0xfc /* Reserved */ | ||
241 | #define HIL_IDD_DID_OTHER_RSVD2 0x28 | ||
242 | #define HIL_IDD_DID_OTHER_RSVD3_MASK 0xf8 /* Reserved */ | ||
243 | #define HIL_IDD_DID_OTHER_RSVD3 0x20 | ||
244 | #define HIL_IDD_DID_TYPE_KEYPAD 0x00 /* Vectra Keyboard */ | ||
245 | |||
246 | /* IDD record header | ||
247 | */ | ||
248 | #define HIL_IDD_HEADER_AXSET_MASK 0x03 /* Number of axis in a set */ | ||
249 | #define HIL_IDD_HEADER_RSC 0x04 /* Supports RSC command */ | ||
250 | #define HIL_IDD_HEADER_EXD 0x08 /* Supports EXD command */ | ||
251 | #define HIL_IDD_HEADER_IOD 0x10 /* IOD byte to follow */ | ||
252 | #define HIL_IDD_HEADER_16BIT 0x20 /* 16 (vs. 8) bit resolution */ | ||
253 | #define HIL_IDD_HEADER_ABS 0x40 /* Reports Absolute Position */ | ||
254 | #define HIL_IDD_HEADER_2X_AXIS 0x80 /* Two sets of 1-3 axis */ | ||
255 | |||
256 | /* I/O Descriptor | ||
257 | */ | ||
258 | #define HIL_IDD_IOD_NBUTTON_MASK 0x07 /* Number of buttons */ | ||
259 | #define HIL_IDD_IOD_PROXIMITY 0x08 /* Proximity in/out events */ | ||
260 | #define HIL_IDD_IOD_PROMPT_MASK 0x70 /* Number of prompts/acks */ | ||
261 | #define HIL_IDD_IOD_PROMPT_SHIFT 4 | ||
262 | #define HIL_IDD_IOD_PROMPT 0x80 /* Generic prompt/ack */ | ||
263 | |||
264 | #define HIL_IDD_NUM_AXES_PER_SET(header_packet) \ | ||
265 | ((header_packet) & HIL_IDD_HEADER_AXSET_MASK) | ||
266 | |||
267 | #define HIL_IDD_NUM_AXSETS(header_packet) \ | ||
268 | (2 - !((header_packet) & HIL_IDD_HEADER_2X_AXIS)) | ||
269 | |||
270 | #define HIL_IDD_LEN(header_packet) \ | ||
271 | ((4 - !(header_packet & HIL_IDD_HEADER_IOD) - \ | ||
272 | 2 * !(HIL_IDD_NUM_AXES_PER_SET(header_packet))) + \ | ||
273 | 2 * HIL_IDD_NUM_AXES_PER_SET(header_packet) * \ | ||
274 | !!((header_packet) & HIL_IDD_HEADER_ABS)) | ||
275 | |||
276 | /* The following HIL_IDD_* macros assume you have an array of | ||
277 | * packets and/or unpacked 8-bit data in the order that they | ||
278 | * were received. | ||
279 | */ | ||
280 | |||
281 | #define HIL_IDD_AXIS_COUNTS_PER_M(header_ptr) \ | ||
282 | (!(HIL_IDD_NUM_AXSETS(*(header_ptr))) ? -1 : \ | ||
283 | (((*(header_ptr + 1) & HIL_PKT_DATA_MASK) + \ | ||
284 | ((*(header_ptr + 2) & HIL_PKT_DATA_MASK)) << 8) \ | ||
285 | * ((*(header_ptr) & HIL_IDD_HEADER_16BIT) ? 100 : 1))) | ||
286 | |||
287 | #define HIL_IDD_AXIS_MAX(header_ptr, __axnum) \ | ||
288 | ((!(*(header_ptr) & HIL_IDD_HEADER_ABS) || \ | ||
289 | (HIL_IDD_NUM_AXES_PER_SET(*(header_ptr)) <= __axnum)) ? 0 : \ | ||
290 | ((HIL_PKT_DATA_MASK & *((header_ptr) + 3 + 2 * __axnum)) + \ | ||
291 | ((HIL_PKT_DATA_MASK & *((header_ptr) + 4 + 2 * __axnum)) << 8))) | ||
292 | |||
293 | #define HIL_IDD_IOD(header_ptr) \ | ||
294 | (*(header_ptr + HIL_IDD_LEN((*header_ptr)) - 1)) | ||
295 | |||
296 | #define HIL_IDD_HAS_GEN_PROMPT(header_ptr) \ | ||
297 | ((*header_ptr & HIL_IDD_HEADER_IOD) && \ | ||
298 | (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROMPT)) | ||
299 | |||
300 | #define HIL_IDD_HAS_GEN_PROXIMITY(header_ptr) \ | ||
301 | ((*header_ptr & HIL_IDD_HEADER_IOD) && \ | ||
302 | (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROXIMITY)) | ||
303 | |||
304 | #define HIL_IDD_NUM_BUTTONS(header_ptr) \ | ||
305 | ((*header_ptr & HIL_IDD_HEADER_IOD) ? \ | ||
306 | (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NBUTTON_MASK) : 0) | ||
307 | |||
308 | #define HIL_IDD_NUM_PROMPTS(header_ptr) \ | ||
309 | ((*header_ptr & HIL_IDD_HEADER_IOD) ? \ | ||
310 | ((HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NPROMPT_MASK) \ | ||
311 | >> HIL_IDD_IOD_PROMPT_SHIFT) : 0) | ||
312 | |||
313 | /* The response to HIL EXD commands -- the "extended describe record" */ | ||
314 | #define HIL_EXD_HEADER_WRG 0x03 /* Supports type2 WRG */ | ||
315 | #define HIL_EXD_HEADER_WRG_TYPE1 0x01 /* Supports type1 WRG */ | ||
316 | #define HIL_EXD_HEADER_WRG_TYPE2 0x02 /* Supports type2 WRG */ | ||
317 | #define HIL_EXD_HEADER_RRG 0x04 /* Supports RRG command */ | ||
318 | #define HIL_EXD_HEADER_RNM 0x10 /* Supports RNM command */ | ||
319 | #define HIL_EXD_HEADER_RST 0x20 /* Supports RST command */ | ||
320 | #define HIL_EXD_HEADER_LOCALE 0x40 /* Contains locale code */ | ||
321 | |||
322 | #define HIL_EXD_NUM_RRG(header_ptr) \ | ||
323 | ((*header_ptr & HIL_EXD_HEADER_RRG) ? \ | ||
324 | (*(header_ptr + 1) & HIL_PKT_DATA_MASK) : 0) | ||
325 | |||
326 | #define HIL_EXD_NUM_WWG(header_ptr) \ | ||
327 | ((*header_ptr & HIL_EXD_HEADER_WRG) ? \ | ||
328 | (*(header_ptr + 2 - !(*header_ptr & HIL_EXD_HEADER_RRG)) & \ | ||
329 | HIL_PKT_DATA_MASK) : 0) | ||
330 | |||
331 | #define HIL_EXD_LEN(header_ptr) \ | ||
332 | (!!(*header_ptr & HIL_EXD_HEADER_RRG) + \ | ||
333 | !!(*header_ptr & HIL_EXD_HEADER_WRG) + \ | ||
334 | !!(*header_ptr & HIL_EXD_HEADER_LOCALE) + \ | ||
335 | 2 * !!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) + 1) | ||
336 | |||
337 | #define HIL_EXD_LOCALE(header_ptr) \ | ||
338 | (!(*header_ptr & HIL_EXD_HEADER_LOCALE) ? -1 : \ | ||
339 | (*(header_ptr + HIL_EXD_LEN(header_ptr) - 1) & HIL_PKT_DATA_MASK)) | ||
340 | |||
341 | #define HIL_EXD_WRG_TYPE2_LEN(header_ptr) \ | ||
342 | (!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) ? -1 : \ | ||
343 | (*(header_ptr + HIL_EXD_LEN(header_ptr) - 2 - \ | ||
344 | !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) + \ | ||
345 | ((*(header_ptr + HIL_EXD_LEN(header_ptr) - 1 - \ | ||
346 | !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) << 8)) | ||
347 | |||
348 | /* Device locale codes. */ | ||
349 | |||
350 | /* Last defined locale code. Everything above this is "Reserved", | ||
351 | and note that this same table applies to the Device ID Byte where | ||
352 | keyboards may have a nationality code which is only 5 bits. */ | ||
353 | #define HIL_LOCALE_MAX 0x1f | ||
354 | |||
355 | /* Map to hopefully useful strings. I was trying to make these look | ||
356 | like locale.aliases strings do; maybe that isn't the right table to | ||
357 | emulate. In either case, I didn't have much to work on. */ | ||
358 | #define HIL_LOCALE_MAP \ | ||
359 | "", /* 0x00 Reserved */ \ | ||
360 | "", /* 0x01 Reserved */ \ | ||
361 | "", /* 0x02 Reserved */ \ | ||
362 | "swiss.french", /* 0x03 Swiss/French */ \ | ||
363 | "portuguese", /* 0x04 Portuguese */ \ | ||
364 | "arabic", /* 0x05 Arabic */ \ | ||
365 | "hebrew", /* 0x06 Hebrew */ \ | ||
366 | "english.canadian", /* 0x07 Canadian English */ \ | ||
367 | "turkish", /* 0x08 Turkish */ \ | ||
368 | "greek", /* 0x09 Greek */ \ | ||
369 | "thai", /* 0x0a Thai (Thailand) */ \ | ||
370 | "italian", /* 0x0b Italian */ \ | ||
371 | "korean", /* 0x0c Hangul (Korea) */ \ | ||
372 | "dutch", /* 0x0d Dutch */ \ | ||
373 | "swedish", /* 0x0e Swedish */ \ | ||
374 | "german", /* 0x0f German */ \ | ||
375 | "chinese", /* 0x10 Chinese-PRC */ \ | ||
376 | "chinese", /* 0x11 Chinese-ROC */ \ | ||
377 | "swiss.french", /* 0x12 Swiss/French II */ \ | ||
378 | "spanish", /* 0x13 Spanish */ \ | ||
379 | "swiss.german", /* 0x14 Swiss/German II */ \ | ||
380 | "flemish", /* 0x15 Belgian (Flemish) */ \ | ||
381 | "finnish", /* 0x16 Finnish */ \ | ||
382 | "english.uk", /* 0x17 United Kingdom */ \ | ||
383 | "french.canadian", /* 0x18 French/Canadian */ \ | ||
384 | "swiss.german", /* 0x19 Swiss/German */ \ | ||
385 | "norwegian", /* 0x1a Norwegian */ \ | ||
386 | "french", /* 0x1b French */ \ | ||
387 | "danish", /* 0x1c Danish */ \ | ||
388 | "japanese", /* 0x1d Katakana */ \ | ||
389 | "spanish", /* 0x1e Latin American/Spanish*/\ | ||
390 | "english.us" /* 0x1f United States */ \ | ||
391 | |||
392 | |||
393 | /* HIL keycodes */ | ||
394 | #define HIL_KEYCODES_SET1_TBLSIZE 128 | ||
395 | #define HIL_KEYCODES_SET1 \ | ||
396 | KEY_5, KEY_RESERVED, KEY_RIGHTALT, KEY_LEFTALT, \ | ||
397 | KEY_RIGHTSHIFT, KEY_LEFTSHIFT, KEY_LEFTCTRL, KEY_SYSRQ, \ | ||
398 | KEY_KP4, KEY_KP8, KEY_KP5, KEY_KP9, \ | ||
399 | KEY_KP6, KEY_KP7, KEY_KPCOMMA, KEY_KPENTER, \ | ||
400 | KEY_KP1, KEY_KPSLASH, KEY_KP2, KEY_KPPLUS, \ | ||
401 | KEY_KP3, KEY_KPASTERISK, KEY_KP0, KEY_KPMINUS, \ | ||
402 | KEY_B, KEY_V, KEY_C, KEY_X, \ | ||
403 | KEY_Z, KEY_RESERVED, KEY_RESERVED, KEY_ESC, \ | ||
404 | KEY_6, KEY_F10, KEY_3, KEY_F11, \ | ||
405 | KEY_KPDOT, KEY_F9, KEY_TAB /*KP*/, KEY_F12, \ | ||
406 | KEY_H, KEY_G, KEY_F, KEY_D, \ | ||
407 | KEY_S, KEY_A, KEY_RESERVED, KEY_CAPSLOCK, \ | ||
408 | KEY_U, KEY_Y, KEY_T, KEY_R, \ | ||
409 | KEY_E, KEY_W, KEY_Q, KEY_TAB, \ | ||
410 | KEY_7, KEY_6, KEY_5, KEY_4, \ | ||
411 | KEY_3, KEY_2, KEY_1, KEY_GRAVE, \ | ||
412 | KEY_F13, KEY_F14, KEY_F15, KEY_F16, \ | ||
413 | KEY_F17, KEY_F18, KEY_F19, KEY_F20, \ | ||
414 | KEY_MENU, KEY_F4, KEY_F3, KEY_F2, \ | ||
415 | KEY_F1, KEY_VOLUMEUP, KEY_STOP, KEY_SENDFILE, \ | ||
416 | KEY_SYSRQ, KEY_F5, KEY_F6, KEY_F7, \ | ||
417 | KEY_F8, KEY_VOLUMEDOWN, KEY_DEL_EOL, KEY_DEL_EOS, \ | ||
418 | KEY_8, KEY_9, KEY_0, KEY_MINUS, \ | ||
419 | KEY_EQUAL, KEY_BACKSPACE, KEY_INS_LINE, KEY_DEL_LINE, \ | ||
420 | KEY_I, KEY_O, KEY_P, KEY_LEFTBRACE, \ | ||
421 | KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_INSERT, KEY_DELETE, \ | ||
422 | KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, \ | ||
423 | KEY_APOSTROPHE, KEY_ENTER, KEY_HOME, KEY_PAGEUP, \ | ||
424 | KEY_M, KEY_COMMA, KEY_DOT, KEY_SLASH, \ | ||
425 | KEY_BACKSLASH, KEY_SELECT, KEY_102ND, KEY_PAGEDOWN, \ | ||
426 | KEY_N, KEY_SPACE, KEY_NEXT, KEY_RESERVED, \ | ||
427 | KEY_LEFT, KEY_DOWN, KEY_UP, KEY_RIGHT | ||
428 | |||
429 | |||
430 | #define HIL_KEYCODES_SET3_TBLSIZE 128 | ||
431 | #define HIL_KEYCODES_SET3 \ | ||
432 | KEY_RESERVED, KEY_ESC, KEY_1, KEY_2, \ | ||
433 | KEY_3, KEY_4, KEY_5, KEY_6, \ | ||
434 | KEY_7, KEY_8, KEY_9, KEY_0, \ | ||
435 | KEY_MINUS, KEY_EQUAL, KEY_BACKSPACE, KEY_TAB, \ | ||
436 | KEY_Q, KEY_W, KEY_E, KEY_R, \ | ||
437 | KEY_T, KEY_Y, KEY_U, KEY_I, \ | ||
438 | KEY_O, KEY_P, KEY_LEFTBRACE, KEY_RIGHTBRACE, \ | ||
439 | KEY_ENTER, KEY_LEFTCTRL, KEY_A, KEY_S, \ | ||
440 | KEY_D, KEY_F, KEY_G, KEY_H, \ | ||
441 | KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, \ | ||
442 | KEY_APOSTROPHE,KEY_GRAVE, KEY_LEFTSHIFT, KEY_BACKSLASH, \ | ||
443 | KEY_Z, KEY_X, KEY_C, KEY_V, \ | ||
444 | KEY_B, KEY_N, KEY_M, KEY_COMMA, \ | ||
445 | KEY_DOT, KEY_SLASH, KEY_RIGHTSHIFT, KEY_KPASTERISK, \ | ||
446 | KEY_LEFTALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, \ | ||
447 | KEY_F2, KEY_F3, KEY_F4, KEY_F5, \ | ||
448 | KEY_F6, KEY_F7, KEY_F8, KEY_F9, \ | ||
449 | KEY_F10, KEY_NUMLOCK, KEY_SCROLLLOCK, KEY_KP7, \ | ||
450 | KEY_KP8, KEY_KP9, KEY_KPMINUS, KEY_KP4, \ | ||
451 | KEY_KP5, KEY_KP6, KEY_KPPLUS, KEY_KP1, \ | ||
452 | KEY_KP2, KEY_KP3, KEY_KP0, KEY_KPDOT, \ | ||
453 | KEY_SYSRQ, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \ | ||
454 | KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \ | ||
455 | KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \ | ||
456 | KEY_UP, KEY_LEFT, KEY_DOWN, KEY_RIGHT, \ | ||
457 | KEY_HOME, KEY_PAGEUP, KEY_END, KEY_PAGEDOWN, \ | ||
458 | KEY_INSERT, KEY_DELETE, KEY_102ND, KEY_RESERVED, \ | ||
459 | KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \ | ||
460 | KEY_F1, KEY_F2, KEY_F3, KEY_F4, \ | ||
461 | KEY_F5, KEY_F6, KEY_F7, KEY_F8, \ | ||
462 | KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \ | ||
463 | KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED | ||
464 | |||
465 | |||
466 | /* Response to POL command, the "poll record header" */ | ||
467 | |||
468 | #define HIL_POL_NUM_AXES_MASK 0x03 /* Number of axis reported */ | ||
469 | #define HIL_POL_CTS 0x04 /* Device ready to receive data */ | ||
470 | #define HIL_POL_STATUS_PENDING 0x08 /* Device has status to report */ | ||
471 | #define HIL_POL_CHARTYPE_MASK 0x70 /* Type of character data to follow */ | ||
472 | #define HIL_POL_CHARTYPE_NONE 0x00 /* No character data to follow */ | ||
473 | #define HIL_POL_CHARTYPE_RSVD1 0x10 /* Reserved Set 1 */ | ||
474 | #define HIL_POL_CHARTYPE_ASCII 0x20 /* U.S. ASCII */ | ||
475 | #define HIL_POL_CHARTYPE_BINARY 0x30 /* Binary data */ | ||
476 | #define HIL_POL_CHARTYPE_SET1 0x40 /* Keycode Set 1 */ | ||
477 | #define HIL_POL_CHARTYPE_RSVD2 0x50 /* Reserved Set 2 */ | ||
478 | #define HIL_POL_CHARTYPE_SET2 0x60 /* Keycode Set 2 */ | ||
479 | #define HIL_POL_CHARTYPE_SET3 0x70 /* Keycode Set 3 */ | ||
480 | #define HIL_POL_AXIS_ALT 0x80 /* Data is from axis set 2 */ | ||
481 | |||
482 | |||
483 | #endif /* _HIL_H_ */ | ||
diff --git a/include/linux/hil_mlc.h b/include/linux/hil_mlc.h new file mode 100644 index 000000000000..8df29ca48a13 --- /dev/null +++ b/include/linux/hil_mlc.h | |||
@@ -0,0 +1,168 @@ | |||
1 | /* | ||
2 | * HP Human Interface Loop Master Link Controller driver. | ||
3 | * | ||
4 | * Copyright (c) 2001 Brian S. Julin | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Redistribution and use in source and binary forms, with or without | ||
8 | * modification, are permitted provided that the following conditions | ||
9 | * are met: | ||
10 | * 1. Redistributions of source code must retain the above copyright | ||
11 | * notice, this list of conditions, and the following disclaimer, | ||
12 | * without modification. | ||
13 | * 2. The name of the author may not be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * Alternatively, this software may be distributed under the terms of the | ||
17 | * GNU General Public License ("GPL"). | ||
18 | * | ||
19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR | ||
23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
28 | * | ||
29 | * References: | ||
30 | * HP-HIL Technical Reference Manual. Hewlett Packard Product No. 45918A | ||
31 | * | ||
32 | */ | ||
33 | |||
34 | #include <linux/hil.h> | ||
35 | #include <linux/time.h> | ||
36 | #include <linux/interrupt.h> | ||
37 | #include <asm/semaphore.h> | ||
38 | #include <linux/serio.h> | ||
39 | #include <linux/list.h> | ||
40 | |||
41 | typedef struct hil_mlc hil_mlc; | ||
42 | |||
43 | /* The HIL has a complicated state engine. | ||
44 | * We define the structure of nodes in the state engine here. | ||
45 | */ | ||
46 | enum hilse_act { | ||
47 | /* HILSE_OUT prepares to receive input if the next node | ||
48 | * is an IN or EXPECT, and then sends the given packet. | ||
49 | */ | ||
50 | HILSE_OUT = 0, | ||
51 | |||
52 | /* HILSE_CTS checks if the loop is busy. */ | ||
53 | HILSE_CTS, | ||
54 | |||
55 | /* HILSE_OUT_LAST sends the given command packet to | ||
56 | * the last configured/running device on the loop. | ||
57 | */ | ||
58 | HILSE_OUT_LAST, | ||
59 | |||
60 | /* HILSE_OUT_DISC sends the given command packet to | ||
61 | * the next device past the last configured/running one. | ||
62 | */ | ||
63 | HILSE_OUT_DISC, | ||
64 | |||
65 | /* HILSE_FUNC runs a callback function with given arguments. | ||
66 | * a positive return value causes the "ugly" branch to be taken. | ||
67 | */ | ||
68 | HILSE_FUNC, | ||
69 | |||
70 | /* HILSE_IN simply expects any non-errored packet to arrive | ||
71 | * within arg usecs. | ||
72 | */ | ||
73 | HILSE_IN = 0x100, | ||
74 | |||
75 | /* HILSE_EXPECT expects a particular packet to arrive | ||
76 | * within arg usecs, any other packet is considered an error. | ||
77 | */ | ||
78 | HILSE_EXPECT, | ||
79 | |||
80 | /* HILSE_EXPECT_LAST as above but dev field should be last | ||
81 | * discovered/operational device. | ||
82 | */ | ||
83 | HILSE_EXPECT_LAST, | ||
84 | |||
85 | /* HILSE_EXPECT_LAST as above but dev field should be first | ||
86 | * undiscovered/inoperational device. | ||
87 | */ | ||
88 | HILSE_EXPECT_DISC | ||
89 | }; | ||
90 | |||
91 | typedef int (hilse_func) (hil_mlc *mlc, int arg); | ||
92 | struct hilse_node { | ||
93 | enum hilse_act act; /* How to process this node */ | ||
94 | union { | ||
95 | hilse_func *func; /* Function to call if HILSE_FUNC */ | ||
96 | hil_packet packet; /* Packet to send or to compare */ | ||
97 | } object; | ||
98 | int arg; /* Timeout in usec or parm for func */ | ||
99 | int good; /* Node to jump to on success */ | ||
100 | int bad; /* Node to jump to on error */ | ||
101 | int ugly; /* Node to jump to on timeout */ | ||
102 | }; | ||
103 | |||
104 | /* Methods for back-end drivers, e.g. hp_sdc_mlc */ | ||
105 | typedef int (hil_mlc_cts) (hil_mlc *mlc); | ||
106 | typedef void (hil_mlc_out) (hil_mlc *mlc); | ||
107 | typedef int (hil_mlc_in) (hil_mlc *mlc, suseconds_t timeout); | ||
108 | |||
109 | struct hil_mlc_devinfo { | ||
110 | uint8_t idd[16]; /* Device ID Byte and Describe Record */ | ||
111 | uint8_t rsc[16]; /* Security Code Header and Record */ | ||
112 | uint8_t exd[16]; /* Extended Describe Record */ | ||
113 | uint8_t rnm[16]; /* Device name as returned by RNM command */ | ||
114 | }; | ||
115 | |||
116 | struct hil_mlc_serio_map { | ||
117 | hil_mlc *mlc; | ||
118 | int di_revmap; | ||
119 | int didx; | ||
120 | }; | ||
121 | |||
122 | /* How many (possibly old/detached) devices the we try to keep track of */ | ||
123 | #define HIL_MLC_DEVMEM 16 | ||
124 | |||
125 | struct hil_mlc { | ||
126 | struct list_head list; /* hil_mlc is organized as linked list */ | ||
127 | |||
128 | rwlock_t lock; | ||
129 | |||
130 | void *priv; /* Data specific to a particular type of MLC */ | ||
131 | |||
132 | int seidx; /* Current node in state engine */ | ||
133 | int istarted, ostarted; | ||
134 | |||
135 | hil_mlc_cts *cts; | ||
136 | struct semaphore csem; /* Raised when loop idle */ | ||
137 | |||
138 | hil_mlc_out *out; | ||
139 | struct semaphore osem; /* Raised when outpacket dispatched */ | ||
140 | hil_packet opacket; | ||
141 | |||
142 | hil_mlc_in *in; | ||
143 | struct semaphore isem; /* Raised when a packet arrives */ | ||
144 | hil_packet ipacket[16]; | ||
145 | hil_packet imatch; | ||
146 | int icount; | ||
147 | struct timeval instart; | ||
148 | suseconds_t intimeout; | ||
149 | |||
150 | int ddi; /* Last operational device id */ | ||
151 | int lcv; /* LCV to throttle loops */ | ||
152 | struct timeval lcv_tv; /* Time loop was started */ | ||
153 | |||
154 | int di_map[7]; /* Maps below items to live devs */ | ||
155 | struct hil_mlc_devinfo di[HIL_MLC_DEVMEM]; | ||
156 | struct serio *serio[HIL_MLC_DEVMEM]; | ||
157 | struct hil_mlc_serio_map serio_map[HIL_MLC_DEVMEM]; | ||
158 | hil_packet serio_opacket[HIL_MLC_DEVMEM]; | ||
159 | int serio_oidx[HIL_MLC_DEVMEM]; | ||
160 | struct hil_mlc_devinfo di_scratch; /* Temporary area */ | ||
161 | |||
162 | int opercnt; | ||
163 | |||
164 | struct tasklet_struct *tasklet; | ||
165 | }; | ||
166 | |||
167 | int hil_mlc_register(hil_mlc *mlc); | ||
168 | int hil_mlc_unregister(hil_mlc *mlc); | ||
diff --git a/include/linux/hp_sdc.h b/include/linux/hp_sdc.h new file mode 100644 index 000000000000..debd71515312 --- /dev/null +++ b/include/linux/hp_sdc.h | |||
@@ -0,0 +1,300 @@ | |||
1 | /* | ||
2 | * HP i8042 System Device Controller -- header | ||
3 | * | ||
4 | * Copyright (c) 2001 Brian S. Julin | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Redistribution and use in source and binary forms, with or without | ||
8 | * modification, are permitted provided that the following conditions | ||
9 | * are met: | ||
10 | * 1. Redistributions of source code must retain the above copyright | ||
11 | * notice, this list of conditions, and the following disclaimer, | ||
12 | * without modification. | ||
13 | * 2. The name of the author may not be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * Alternatively, this software may be distributed under the terms of the | ||
17 | * GNU General Public License ("GPL"). | ||
18 | * | ||
19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR | ||
23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
28 | * | ||
29 | * References: | ||
30 | * | ||
31 | * HP-HIL Technical Reference Manual. Hewlett Packard Product No. 45918A | ||
32 | * | ||
33 | * System Device Controller Microprocessor Firmware Theory of Operation | ||
34 | * for Part Number 1820-4784 Revision B. Dwg No. A-1820-4784-2 | ||
35 | * | ||
36 | */ | ||
37 | |||
38 | #ifndef _LINUX_HP_SDC_H | ||
39 | #define _LINUX_HP_SDC_H | ||
40 | |||
41 | #include <linux/interrupt.h> | ||
42 | #include <linux/types.h> | ||
43 | #include <linux/time.h> | ||
44 | #include <linux/timer.h> | ||
45 | #if defined(__hppa__) | ||
46 | #include <asm/hardware.h> | ||
47 | #endif | ||
48 | |||
49 | |||
50 | /* No 4X status reads take longer than this (in usec). | ||
51 | */ | ||
52 | #define HP_SDC_MAX_REG_DELAY 20000 | ||
53 | |||
54 | typedef void (hp_sdc_irqhook) (int irq, void *dev_id, | ||
55 | uint8_t status, uint8_t data); | ||
56 | |||
57 | int hp_sdc_request_timer_irq(hp_sdc_irqhook *callback); | ||
58 | int hp_sdc_request_hil_irq(hp_sdc_irqhook *callback); | ||
59 | int hp_sdc_request_cooked_irq(hp_sdc_irqhook *callback); | ||
60 | int hp_sdc_release_timer_irq(hp_sdc_irqhook *callback); | ||
61 | int hp_sdc_release_hil_irq(hp_sdc_irqhook *callback); | ||
62 | int hp_sdc_release_cooked_irq(hp_sdc_irqhook *callback); | ||
63 | |||
64 | typedef struct { | ||
65 | int actidx; /* Start of act. Acts are atomic WRT I/O to SDC */ | ||
66 | int idx; /* Index within the act */ | ||
67 | int endidx; /* transaction is over and done if idx == endidx */ | ||
68 | uint8_t *seq; /* commands/data for the transaction */ | ||
69 | union { | ||
70 | hp_sdc_irqhook *irqhook; /* Callback, isr or tasklet context */ | ||
71 | struct semaphore *semaphore; /* Semaphore to sleep on. */ | ||
72 | } act; | ||
73 | } hp_sdc_transaction; | ||
74 | int hp_sdc_enqueue_transaction(hp_sdc_transaction *this); | ||
75 | int hp_sdc_dequeue_transaction(hp_sdc_transaction *this); | ||
76 | |||
77 | /* The HP_SDC_ACT* values are peculiar to this driver. | ||
78 | * Nuance: never HP_SDC_ACT_DATAIN | HP_SDC_ACT_DEALLOC, use another | ||
79 | * act to perform the dealloc. | ||
80 | */ | ||
81 | #define HP_SDC_ACT_PRECMD 0x01 /* Send a command first */ | ||
82 | #define HP_SDC_ACT_DATAREG 0x02 /* Set data registers */ | ||
83 | #define HP_SDC_ACT_DATAOUT 0x04 /* Send data bytes */ | ||
84 | #define HP_SDC_ACT_POSTCMD 0x08 /* Send command after */ | ||
85 | #define HP_SDC_ACT_DATAIN 0x10 /* Collect data after */ | ||
86 | #define HP_SDC_ACT_DURING 0x1f | ||
87 | #define HP_SDC_ACT_SEMAPHORE 0x20 /* Raise semaphore after */ | ||
88 | #define HP_SDC_ACT_CALLBACK 0x40 /* Pass data to IRQ handler */ | ||
89 | #define HP_SDC_ACT_DEALLOC 0x80 /* Destroy transaction after */ | ||
90 | #define HP_SDC_ACT_AFTER 0xe0 | ||
91 | #define HP_SDC_ACT_DEAD 0x60 /* Act timed out. */ | ||
92 | |||
93 | /* Rest of the flags are straightforward representation of the SDC interface */ | ||
94 | #define HP_SDC_STATUS_IBF 0x02 /* Input buffer full */ | ||
95 | |||
96 | #define HP_SDC_STATUS_IRQMASK 0xf0 /* Bits containing "level 1" irq */ | ||
97 | #define HP_SDC_STATUS_PERIODIC 0x10 /* Periodic 10ms timer */ | ||
98 | #define HP_SDC_STATUS_USERTIMER 0x20 /* "Special purpose" timer */ | ||
99 | #define HP_SDC_STATUS_TIMER 0x30 /* Both PERIODIC and USERTIMER */ | ||
100 | #define HP_SDC_STATUS_REG 0x40 /* Data from an i8042 register */ | ||
101 | #define HP_SDC_STATUS_HILCMD 0x50 /* Command from HIL MLC */ | ||
102 | #define HP_SDC_STATUS_HILDATA 0x60 /* Data from HIL MLC */ | ||
103 | #define HP_SDC_STATUS_PUP 0x70 /* Sucessful power-up self test */ | ||
104 | #define HP_SDC_STATUS_KCOOKED 0x80 /* Key from cooked kbd */ | ||
105 | #define HP_SDC_STATUS_KRPG 0xc0 /* Key from Repeat Gen */ | ||
106 | #define HP_SDC_STATUS_KMOD_SUP 0x10 /* Shift key is up */ | ||
107 | #define HP_SDC_STATUS_KMOD_CUP 0x20 /* Control key is up */ | ||
108 | |||
109 | #define HP_SDC_NMISTATUS_FHS 0x40 /* NMI is a fast handshake irq */ | ||
110 | |||
111 | /* Internal i8042 registers (there are more, but they are not too useful). */ | ||
112 | |||
113 | #define HP_SDC_USE 0x02 /* Resource usage (including OB bit) */ | ||
114 | #define HP_SDC_IM 0x04 /* Interrupt mask */ | ||
115 | #define HP_SDC_CFG 0x11 /* Configuration register */ | ||
116 | #define HP_SDC_KBLANGUAGE 0x12 /* Keyboard language */ | ||
117 | |||
118 | #define HP_SDC_D0 0x70 /* General purpose data buffer 0 */ | ||
119 | #define HP_SDC_D1 0x71 /* General purpose data buffer 1 */ | ||
120 | #define HP_SDC_D2 0x72 /* General purpose data buffer 2 */ | ||
121 | #define HP_SDC_D3 0x73 /* General purpose data buffer 3 */ | ||
122 | #define HP_SDC_VT1 0x74 /* Timer for voice 1 */ | ||
123 | #define HP_SDC_VT2 0x75 /* Timer for voice 2 */ | ||
124 | #define HP_SDC_VT3 0x76 /* Timer for voice 3 */ | ||
125 | #define HP_SDC_VT4 0x77 /* Timer for voice 4 */ | ||
126 | #define HP_SDC_KBN 0x78 /* Which HIL devs are Nimitz */ | ||
127 | #define HP_SDC_KBC 0x79 /* Which HIL devs are cooked kbds */ | ||
128 | #define HP_SDC_LPS 0x7a /* i8042's view of HIL status */ | ||
129 | #define HP_SDC_LPC 0x7b /* i8042's view of HIL "control" */ | ||
130 | #define HP_SDC_RSV 0x7c /* Reserved "for testing" */ | ||
131 | #define HP_SDC_LPR 0x7d /* i8042 count of HIL reconfigs */ | ||
132 | #define HP_SDC_XTD 0x7e /* "Extended Configuration" register */ | ||
133 | #define HP_SDC_STR 0x7f /* i8042 self-test result */ | ||
134 | |||
135 | /* Bitfields for above registers */ | ||
136 | #define HP_SDC_USE_LOOP 0x04 /* Command is currently on the loop. */ | ||
137 | |||
138 | #define HP_SDC_IM_MASK 0x1f /* these bits not part of cmd/status */ | ||
139 | #define HP_SDC_IM_FH 0x10 /* Mask the fast handshake irq */ | ||
140 | #define HP_SDC_IM_PT 0x08 /* Mask the periodic timer irq */ | ||
141 | #define HP_SDC_IM_TIMERS 0x04 /* Mask the MT/DT/CT irq */ | ||
142 | #define HP_SDC_IM_RESET 0x02 /* Mask the reset key irq */ | ||
143 | #define HP_SDC_IM_HIL 0x01 /* Mask the HIL MLC irq */ | ||
144 | |||
145 | #define HP_SDC_CFG_ROLLOVER 0x08 /* WTF is "N-key rollover"? */ | ||
146 | #define HP_SDC_CFG_KBD 0x10 /* There is a keyboard */ | ||
147 | #define HP_SDC_CFG_NEW 0x20 /* Supports/uses HIL MLC */ | ||
148 | #define HP_SDC_CFG_KBD_OLD 0x03 /* keyboard code for non-HIL */ | ||
149 | #define HP_SDC_CFG_KBD_NEW 0x07 /* keyboard code from HIL autoconfig */ | ||
150 | #define HP_SDC_CFG_REV 0x40 /* Code revision bit */ | ||
151 | #define HP_SDC_CFG_IDPROM 0x80 /* IDPROM present in kbd (not HIL) */ | ||
152 | |||
153 | #define HP_SDC_LPS_NDEV 0x07 /* # devices autoconfigured on HIL */ | ||
154 | #define HP_SDC_LPS_ACSUCC 0x08 /* loop autoconfigured successfully */ | ||
155 | #define HP_SDC_LPS_ACFAIL 0x80 /* last loop autoconfigure failed */ | ||
156 | |||
157 | #define HP_SDC_LPC_APE_IPF 0x01 /* HIL MLC APE/IPF (autopoll) set */ | ||
158 | #define HP_SDC_LPC_ARCONERR 0x02 /* i8042 autoreconfigs loop on err */ | ||
159 | #define HP_SDC_LPC_ARCQUIET 0x03 /* i8042 doesn't report autoreconfigs*/ | ||
160 | #define HP_SDC_LPC_COOK 0x10 /* i8042 cooks devices in _KBN */ | ||
161 | #define HP_SDC_LPC_RC 0x80 /* causes autoreconfig */ | ||
162 | |||
163 | #define HP_SDC_XTD_REV 0x07 /* contains revision code */ | ||
164 | #define HP_SDC_XTD_REV_STRINGS(val, str) \ | ||
165 | switch (val) { \ | ||
166 | case 0x1: str = "1820-3712"; break; \ | ||
167 | case 0x2: str = "1820-4379"; break; \ | ||
168 | case 0x3: str = "1820-4784"; break; \ | ||
169 | default: str = "unknown"; \ | ||
170 | }; | ||
171 | #define HP_SDC_XTD_BEEPER 0x08 /* TI SN76494 beeper available */ | ||
172 | #define HP_SDC_XTD_BBRTC 0x20 /* OKI MSM-58321 BBRTC present */ | ||
173 | |||
174 | #define HP_SDC_CMD_LOAD_RT 0x31 /* Load real time (from 8042) */ | ||
175 | #define HP_SDC_CMD_LOAD_FHS 0x36 /* Load the fast handshake timer */ | ||
176 | #define HP_SDC_CMD_LOAD_MT 0x38 /* Load the match timer */ | ||
177 | #define HP_SDC_CMD_LOAD_DT 0x3B /* Load the delay timer */ | ||
178 | #define HP_SDC_CMD_LOAD_CT 0x3E /* Load the cycle timer */ | ||
179 | |||
180 | #define HP_SDC_CMD_SET_IM 0x40 /* 010xxxxx == set irq mask */ | ||
181 | |||
182 | /* The documents provided do not explicitly state that all registers betweem | ||
183 | * 0x01 and 0x1f inclusive can be read by sending their register index as a | ||
184 | * command, but this is implied and appears to be the case. | ||
185 | */ | ||
186 | #define HP_SDC_CMD_READ_RAM 0x00 /* Load from i8042 RAM (autoinc) */ | ||
187 | #define HP_SDC_CMD_READ_USE 0x02 /* Undocumented! Load from usage reg */ | ||
188 | #define HP_SDC_CMD_READ_IM 0x04 /* Load current interrupt mask */ | ||
189 | #define HP_SDC_CMD_READ_KCC 0x11 /* Load primary kbd config code */ | ||
190 | #define HP_SDC_CMD_READ_KLC 0x12 /* Load primary kbd language code */ | ||
191 | #define HP_SDC_CMD_READ_T1 0x13 /* Load timer output buffer byte 1 */ | ||
192 | #define HP_SDC_CMD_READ_T2 0x14 /* Load timer output buffer byte 1 */ | ||
193 | #define HP_SDC_CMD_READ_T3 0x15 /* Load timer output buffer byte 1 */ | ||
194 | #define HP_SDC_CMD_READ_T4 0x16 /* Load timer output buffer byte 1 */ | ||
195 | #define HP_SDC_CMD_READ_T5 0x17 /* Load timer output buffer byte 1 */ | ||
196 | #define HP_SDC_CMD_READ_D0 0xf0 /* Load from i8042 RAM location 0x70 */ | ||
197 | #define HP_SDC_CMD_READ_D1 0xf1 /* Load from i8042 RAM location 0x71 */ | ||
198 | #define HP_SDC_CMD_READ_D2 0xf2 /* Load from i8042 RAM location 0x72 */ | ||
199 | #define HP_SDC_CMD_READ_D3 0xf3 /* Load from i8042 RAM location 0x73 */ | ||
200 | #define HP_SDC_CMD_READ_VT1 0xf4 /* Load from i8042 RAM location 0x74 */ | ||
201 | #define HP_SDC_CMD_READ_VT2 0xf5 /* Load from i8042 RAM location 0x75 */ | ||
202 | #define HP_SDC_CMD_READ_VT3 0xf6 /* Load from i8042 RAM location 0x76 */ | ||
203 | #define HP_SDC_CMD_READ_VT4 0xf7 /* Load from i8042 RAM location 0x77 */ | ||
204 | #define HP_SDC_CMD_READ_KBN 0xf8 /* Load from i8042 RAM location 0x78 */ | ||
205 | #define HP_SDC_CMD_READ_KBC 0xf9 /* Load from i8042 RAM location 0x79 */ | ||
206 | #define HP_SDC_CMD_READ_LPS 0xfa /* Load from i8042 RAM location 0x7a */ | ||
207 | #define HP_SDC_CMD_READ_LPC 0xfb /* Load from i8042 RAM location 0x7b */ | ||
208 | #define HP_SDC_CMD_READ_RSV 0xfc /* Load from i8042 RAM location 0x7c */ | ||
209 | #define HP_SDC_CMD_READ_LPR 0xfd /* Load from i8042 RAM location 0x7d */ | ||
210 | #define HP_SDC_CMD_READ_XTD 0xfe /* Load from i8042 RAM location 0x7e */ | ||
211 | #define HP_SDC_CMD_READ_STR 0xff /* Load from i8042 RAM location 0x7f */ | ||
212 | |||
213 | #define HP_SDC_CMD_SET_ARD 0xA0 /* Set emulated autorepeat delay */ | ||
214 | #define HP_SDC_CMD_SET_ARR 0xA2 /* Set emulated autorepeat rate */ | ||
215 | #define HP_SDC_CMD_SET_BELL 0xA3 /* Set voice 3 params for "beep" cmd */ | ||
216 | #define HP_SDC_CMD_SET_RPGR 0xA6 /* Set "RPG" irq rate (doesn't work) */ | ||
217 | #define HP_SDC_CMD_SET_RTMS 0xAD /* Set the RTC time (milliseconds) */ | ||
218 | #define HP_SDC_CMD_SET_RTD 0xAF /* Set the RTC time (days) */ | ||
219 | #define HP_SDC_CMD_SET_FHS 0xB2 /* Set fast handshake timer */ | ||
220 | #define HP_SDC_CMD_SET_MT 0xB4 /* Set match timer */ | ||
221 | #define HP_SDC_CMD_SET_DT 0xB7 /* Set delay timer */ | ||
222 | #define HP_SDC_CMD_SET_CT 0xBA /* Set cycle timer */ | ||
223 | #define HP_SDC_CMD_SET_RAMP 0xC1 /* Reset READ_RAM autoinc counter */ | ||
224 | #define HP_SDC_CMD_SET_D0 0xe0 /* Load to i8042 RAM location 0x70 */ | ||
225 | #define HP_SDC_CMD_SET_D1 0xe1 /* Load to i8042 RAM location 0x71 */ | ||
226 | #define HP_SDC_CMD_SET_D2 0xe2 /* Load to i8042 RAM location 0x72 */ | ||
227 | #define HP_SDC_CMD_SET_D3 0xe3 /* Load to i8042 RAM location 0x73 */ | ||
228 | #define HP_SDC_CMD_SET_VT1 0xe4 /* Load to i8042 RAM location 0x74 */ | ||
229 | #define HP_SDC_CMD_SET_VT2 0xe5 /* Load to i8042 RAM location 0x75 */ | ||
230 | #define HP_SDC_CMD_SET_VT3 0xe6 /* Load to i8042 RAM location 0x76 */ | ||
231 | #define HP_SDC_CMD_SET_VT4 0xe7 /* Load to i8042 RAM location 0x77 */ | ||
232 | #define HP_SDC_CMD_SET_KBN 0xe8 /* Load to i8042 RAM location 0x78 */ | ||
233 | #define HP_SDC_CMD_SET_KBC 0xe9 /* Load to i8042 RAM location 0x79 */ | ||
234 | #define HP_SDC_CMD_SET_LPS 0xea /* Load to i8042 RAM location 0x7a */ | ||
235 | #define HP_SDC_CMD_SET_LPC 0xeb /* Load to i8042 RAM location 0x7b */ | ||
236 | #define HP_SDC_CMD_SET_RSV 0xec /* Load to i8042 RAM location 0x7c */ | ||
237 | #define HP_SDC_CMD_SET_LPR 0xed /* Load to i8042 RAM location 0x7d */ | ||
238 | #define HP_SDC_CMD_SET_XTD 0xee /* Load to i8042 RAM location 0x7e */ | ||
239 | #define HP_SDC_CMD_SET_STR 0xef /* Load to i8042 RAM location 0x7f */ | ||
240 | |||
241 | #define HP_SDC_CMD_DO_RTCW 0xc2 /* i8042 RAM 0x70 --> RTC */ | ||
242 | #define HP_SDC_CMD_DO_RTCR 0xc3 /* RTC[0x70 0:3] --> irq/status/data */ | ||
243 | #define HP_SDC_CMD_DO_BEEP 0xc4 /* i8042 RAM 0x70-74 --> beeper,VT3 */ | ||
244 | #define HP_SDC_CMD_DO_HIL 0xc5 /* i8042 RAM 0x70-73 --> | ||
245 | HIL MLC R0,R1 i8042 HIL watchdog */ | ||
246 | |||
247 | /* Values used to (de)mangle input/output to/from the HIL MLC */ | ||
248 | #define HP_SDC_DATA 0x40 /* Data from an 8042 register */ | ||
249 | #define HP_SDC_HIL_CMD 0x50 /* Data from HIL MLC R1/8042 */ | ||
250 | #define HP_SDC_HIL_R1MASK 0x0f /* Contents of HIL MLC R1 0:3 */ | ||
251 | #define HP_SDC_HIL_AUTO 0x10 /* Set if POL results from i8042 */ | ||
252 | #define HP_SDC_HIL_ISERR 0x80 /* Has meaning as in next 4 values */ | ||
253 | #define HP_SDC_HIL_RC_DONE 0x80 /* i8042 auto-configured loop */ | ||
254 | #define HP_SDC_HIL_ERR 0x81 /* HIL MLC R2 had a bit set */ | ||
255 | #define HP_SDC_HIL_TO 0x82 /* i8042 HIL watchdog expired */ | ||
256 | #define HP_SDC_HIL_RC 0x84 /* i8042 is auto-configuring loop */ | ||
257 | #define HP_SDC_HIL_DAT 0x60 /* Data from HIL MLC R0 */ | ||
258 | |||
259 | |||
260 | typedef struct { | ||
261 | rwlock_t ibf_lock; | ||
262 | rwlock_t lock; /* user/tasklet lock */ | ||
263 | rwlock_t rtq_lock; /* isr/tasklet lock */ | ||
264 | rwlock_t hook_lock; /* isr/user lock for handler add/del */ | ||
265 | |||
266 | unsigned int irq, nmi; /* Our IRQ lines */ | ||
267 | unsigned long base_io, status_io, data_io; /* Our IO ports */ | ||
268 | |||
269 | uint8_t im; /* Interrupt mask */ | ||
270 | int set_im; /* Interrupt mask needs to be set. */ | ||
271 | |||
272 | int ibf; /* Last known status of IBF flag */ | ||
273 | uint8_t wi; /* current i8042 write index */ | ||
274 | uint8_t r7[4]; /* current i8042[0x70 - 0x74] values */ | ||
275 | uint8_t r11, r7e; /* Values from version/revision regs */ | ||
276 | |||
277 | hp_sdc_irqhook *timer, *reg, *hil, *pup, *cooked; | ||
278 | |||
279 | #define HP_SDC_QUEUE_LEN 16 | ||
280 | hp_sdc_transaction *tq[HP_SDC_QUEUE_LEN]; /* All pending read/writes */ | ||
281 | |||
282 | int rcurr, rqty; /* Current read transact in process */ | ||
283 | struct timeval rtv; /* Time when current read started */ | ||
284 | int wcurr; /* Current write transact in process */ | ||
285 | |||
286 | int dev_err; /* carries status from registration */ | ||
287 | #if defined(__hppa__) | ||
288 | struct parisc_device *dev; | ||
289 | #elif defined(__mc68000__) | ||
290 | void *dev; | ||
291 | #else | ||
292 | #error No support for device registration on this arch yet. | ||
293 | #endif | ||
294 | |||
295 | struct timer_list kicker; /* Keeps below task alive */ | ||
296 | struct tasklet_struct task; | ||
297 | |||
298 | } hp_i8042_sdc; | ||
299 | |||
300 | #endif /* _LINUX_HP_SDC_H */ | ||
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h index 110904481238..c0e7fab28ce3 100644 --- a/include/linux/i2c-algo-bit.h +++ b/include/linux/i2c-algo-bit.h | |||
@@ -21,8 +21,6 @@ | |||
21 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even | 21 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even |
22 | Frodo Looijaard <frodol@dds.nl> */ | 22 | Frodo Looijaard <frodol@dds.nl> */ |
23 | 23 | ||
24 | /* $Id: i2c-algo-bit.h,v 1.10 2003/01/21 08:08:16 kmalkki Exp $ */ | ||
25 | |||
26 | #ifndef _LINUX_I2C_ALGO_BIT_H | 24 | #ifndef _LINUX_I2C_ALGO_BIT_H |
27 | #define _LINUX_I2C_ALGO_BIT_H | 25 | #define _LINUX_I2C_ALGO_BIT_H |
28 | 26 | ||
@@ -46,8 +44,6 @@ struct i2c_algo_bit_data { | |||
46 | int timeout; /* in jiffies */ | 44 | int timeout; /* in jiffies */ |
47 | }; | 45 | }; |
48 | 46 | ||
49 | #define I2C_BIT_ADAP_MAX 16 | ||
50 | |||
51 | int i2c_bit_add_bus(struct i2c_adapter *); | 47 | int i2c_bit_add_bus(struct i2c_adapter *); |
52 | int i2c_bit_del_bus(struct i2c_adapter *); | 48 | int i2c_bit_del_bus(struct i2c_adapter *); |
53 | 49 | ||
diff --git a/include/linux/i2c-algo-pca.h b/include/linux/i2c-algo-pca.h index 941b786c5732..226693e0d88b 100644 --- a/include/linux/i2c-algo-pca.h +++ b/include/linux/i2c-algo-pca.h | |||
@@ -9,8 +9,6 @@ struct i2c_algo_pca_data { | |||
9 | int (*wait_for_interrupt) (struct i2c_algo_pca_data *adap); | 9 | int (*wait_for_interrupt) (struct i2c_algo_pca_data *adap); |
10 | }; | 10 | }; |
11 | 11 | ||
12 | #define I2C_PCA_ADAP_MAX 16 | ||
13 | |||
14 | int i2c_pca_add_bus(struct i2c_adapter *); | 12 | int i2c_pca_add_bus(struct i2c_adapter *); |
15 | int i2c_pca_del_bus(struct i2c_adapter *); | 13 | int i2c_pca_del_bus(struct i2c_adapter *); |
16 | 14 | ||
diff --git a/include/linux/i2c-algo-pcf.h b/include/linux/i2c-algo-pcf.h index 2a508562255f..18b0adf57a3d 100644 --- a/include/linux/i2c-algo-pcf.h +++ b/include/linux/i2c-algo-pcf.h | |||
@@ -22,8 +22,6 @@ | |||
22 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even | 22 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even |
23 | Frodo Looijaard <frodol@dds.nl> */ | 23 | Frodo Looijaard <frodol@dds.nl> */ |
24 | 24 | ||
25 | /* $Id: i2c-algo-pcf.h,v 1.8 2003/01/21 08:08:16 kmalkki Exp $ */ | ||
26 | |||
27 | #ifndef _LINUX_I2C_ALGO_PCF_H | 25 | #ifndef _LINUX_I2C_ALGO_PCF_H |
28 | #define _LINUX_I2C_ALGO_PCF_H | 26 | #define _LINUX_I2C_ALGO_PCF_H |
29 | 27 | ||
@@ -41,8 +39,6 @@ struct i2c_algo_pcf_data { | |||
41 | int timeout; | 39 | int timeout; |
42 | }; | 40 | }; |
43 | 41 | ||
44 | #define I2C_PCF_ADAP_MAX 16 | ||
45 | |||
46 | int i2c_pcf_add_bus(struct i2c_adapter *); | 42 | int i2c_pcf_add_bus(struct i2c_adapter *); |
47 | int i2c_pcf_del_bus(struct i2c_adapter *); | 43 | int i2c_pcf_del_bus(struct i2c_adapter *); |
48 | 44 | ||
diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h index 541695679762..81c229a0fbca 100644 --- a/include/linux/i2c-dev.h +++ b/include/linux/i2c-dev.h | |||
@@ -19,8 +19,6 @@ | |||
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | /* $Id: i2c-dev.h,v 1.13 2003/01/21 08:08:16 kmalkki Exp $ */ | ||
23 | |||
24 | #ifndef _LINUX_I2C_DEV_H | 22 | #ifndef _LINUX_I2C_DEV_H |
25 | #define _LINUX_I2C_DEV_H | 23 | #define _LINUX_I2C_DEV_H |
26 | 24 | ||
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 44f30876a1c9..1ce4b54caa21 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -164,10 +164,7 @@ | |||
164 | 164 | ||
165 | /* --- Bit algorithm adapters */ | 165 | /* --- Bit algorithm adapters */ |
166 | #define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ | 166 | #define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ |
167 | #define I2C_HW_B_LPC 0x010001 /* Parallel port control reg. */ | ||
168 | #define I2C_HW_B_SER 0x010002 /* Serial line interface */ | 167 | #define I2C_HW_B_SER 0x010002 /* Serial line interface */ |
169 | #define I2C_HW_B_ELV 0x010003 /* ELV Card */ | ||
170 | #define I2C_HW_B_VELLE 0x010004 /* Vellemann K8000 */ | ||
171 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ | 168 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ |
172 | #define I2C_HW_B_WNV 0x010006 /* Winnov Videums */ | 169 | #define I2C_HW_B_WNV 0x010006 /* Winnov Videums */ |
173 | #define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */ | 170 | #define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 3d49a305bf88..f88577ca3b3a 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -23,14 +23,13 @@ | |||
23 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and | 23 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and |
24 | Frodo Looijaard <frodol@dds.nl> */ | 24 | Frodo Looijaard <frodol@dds.nl> */ |
25 | 25 | ||
26 | /* $Id: i2c.h,v 1.68 2003/01/21 08:08:16 kmalkki Exp $ */ | ||
27 | |||
28 | #ifndef _LINUX_I2C_H | 26 | #ifndef _LINUX_I2C_H |
29 | #define _LINUX_I2C_H | 27 | #define _LINUX_I2C_H |
30 | 28 | ||
31 | #include <linux/module.h> | 29 | #include <linux/module.h> |
32 | #include <linux/types.h> | 30 | #include <linux/types.h> |
33 | #include <linux/i2c-id.h> | 31 | #include <linux/i2c-id.h> |
32 | #include <linux/mod_devicetable.h> | ||
34 | #include <linux/device.h> /* for struct device */ | 33 | #include <linux/device.h> /* for struct device */ |
35 | #include <asm/semaphore.h> | 34 | #include <asm/semaphore.h> |
36 | 35 | ||
@@ -94,10 +93,10 @@ extern s32 i2c_smbus_write_byte_data(struct i2c_client * client, | |||
94 | extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); | 93 | extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); |
95 | extern s32 i2c_smbus_write_word_data(struct i2c_client * client, | 94 | extern s32 i2c_smbus_write_word_data(struct i2c_client * client, |
96 | u8 command, u16 value); | 95 | u8 command, u16 value); |
97 | /* Returns the number of bytes transferred */ | ||
98 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, | 96 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, |
99 | u8 command, u8 length, | 97 | u8 command, u8 length, |
100 | u8 *values); | 98 | u8 *values); |
99 | /* Returns the number of read bytes */ | ||
101 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, | 100 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, |
102 | u8 command, u8 *values); | 101 | u8 command, u8 *values); |
103 | 102 | ||
@@ -391,10 +390,6 @@ struct i2c_msg { | |||
391 | #define I2C_FUNC_10BIT_ADDR 0x00000002 | 390 | #define I2C_FUNC_10BIT_ADDR 0x00000002 |
392 | #define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ | 391 | #define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ |
393 | #define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ | 392 | #define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ |
394 | #define I2C_FUNC_SMBUS_READ_WORD_DATA_PEC 0x00000800 /* SMBus 2.0 */ | ||
395 | #define I2C_FUNC_SMBUS_WRITE_WORD_DATA_PEC 0x00001000 /* SMBus 2.0 */ | ||
396 | #define I2C_FUNC_SMBUS_PROC_CALL_PEC 0x00002000 /* SMBus 2.0 */ | ||
397 | #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL_PEC 0x00004000 /* SMBus 2.0 */ | ||
398 | #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ | 393 | #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ |
399 | #define I2C_FUNC_SMBUS_QUICK 0x00010000 | 394 | #define I2C_FUNC_SMBUS_QUICK 0x00010000 |
400 | #define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 | 395 | #define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 |
@@ -410,8 +405,6 @@ struct i2c_msg { | |||
410 | #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ | 405 | #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ |
411 | #define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */ | 406 | #define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */ |
412 | #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */ | 407 | #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */ |
413 | #define I2C_FUNC_SMBUS_READ_BLOCK_DATA_PEC 0x40000000 /* SMBus 2.0 */ | ||
414 | #define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC 0x80000000 /* SMBus 2.0 */ | ||
415 | 408 | ||
416 | #define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \ | 409 | #define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \ |
417 | I2C_FUNC_SMBUS_WRITE_BYTE) | 410 | I2C_FUNC_SMBUS_WRITE_BYTE) |
@@ -425,17 +418,6 @@ struct i2c_msg { | |||
425 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK) | 418 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK) |
426 | #define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \ | 419 | #define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \ |
427 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2) | 420 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2) |
428 | #define I2C_FUNC_SMBUS_BLOCK_DATA_PEC (I2C_FUNC_SMBUS_READ_BLOCK_DATA_PEC | \ | ||
429 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC) | ||
430 | #define I2C_FUNC_SMBUS_WORD_DATA_PEC (I2C_FUNC_SMBUS_READ_WORD_DATA_PEC | \ | ||
431 | I2C_FUNC_SMBUS_WRITE_WORD_DATA_PEC) | ||
432 | |||
433 | #define I2C_FUNC_SMBUS_READ_BYTE_PEC I2C_FUNC_SMBUS_READ_BYTE_DATA | ||
434 | #define I2C_FUNC_SMBUS_WRITE_BYTE_PEC I2C_FUNC_SMBUS_WRITE_BYTE_DATA | ||
435 | #define I2C_FUNC_SMBUS_READ_BYTE_DATA_PEC I2C_FUNC_SMBUS_READ_WORD_DATA | ||
436 | #define I2C_FUNC_SMBUS_WRITE_BYTE_DATA_PEC I2C_FUNC_SMBUS_WRITE_WORD_DATA | ||
437 | #define I2C_FUNC_SMBUS_BYTE_PEC I2C_FUNC_SMBUS_BYTE_DATA | ||
438 | #define I2C_FUNC_SMBUS_BYTE_DATA_PEC I2C_FUNC_SMBUS_WORD_DATA | ||
439 | 421 | ||
440 | #define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \ | 422 | #define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \ |
441 | I2C_FUNC_SMBUS_BYTE | \ | 423 | I2C_FUNC_SMBUS_BYTE | \ |
@@ -443,20 +425,17 @@ struct i2c_msg { | |||
443 | I2C_FUNC_SMBUS_WORD_DATA | \ | 425 | I2C_FUNC_SMBUS_WORD_DATA | \ |
444 | I2C_FUNC_SMBUS_PROC_CALL | \ | 426 | I2C_FUNC_SMBUS_PROC_CALL | \ |
445 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ | 427 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ |
446 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC | \ | ||
447 | I2C_FUNC_SMBUS_I2C_BLOCK) | 428 | I2C_FUNC_SMBUS_I2C_BLOCK) |
448 | 429 | ||
449 | /* | 430 | /* |
450 | * Data for SMBus Messages | 431 | * Data for SMBus Messages |
451 | */ | 432 | */ |
452 | #define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ | 433 | #define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ |
453 | #define I2C_SMBUS_I2C_BLOCK_MAX 32 /* Not specified but we use same structure */ | ||
454 | union i2c_smbus_data { | 434 | union i2c_smbus_data { |
455 | __u8 byte; | 435 | __u8 byte; |
456 | __u16 word; | 436 | __u16 word; |
457 | __u8 block[I2C_SMBUS_BLOCK_MAX + 3]; /* block[0] is used for length */ | 437 | __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */ |
458 | /* one more for read length in block process call */ | 438 | /* and one more for user-space compatibility */ |
459 | /* and one more for PEC */ | ||
460 | }; | 439 | }; |
461 | 440 | ||
462 | /* smbus_access read or write markers */ | 441 | /* smbus_access read or write markers */ |
@@ -473,10 +452,6 @@ union i2c_smbus_data { | |||
473 | #define I2C_SMBUS_BLOCK_DATA 5 | 452 | #define I2C_SMBUS_BLOCK_DATA 5 |
474 | #define I2C_SMBUS_I2C_BLOCK_DATA 6 | 453 | #define I2C_SMBUS_I2C_BLOCK_DATA 6 |
475 | #define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ | 454 | #define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ |
476 | #define I2C_SMBUS_BLOCK_DATA_PEC 8 /* SMBus 2.0 */ | ||
477 | #define I2C_SMBUS_PROC_CALL_PEC 9 /* SMBus 2.0 */ | ||
478 | #define I2C_SMBUS_BLOCK_PROC_CALL_PEC 10 /* SMBus 2.0 */ | ||
479 | #define I2C_SMBUS_WORD_DATA_PEC 11 /* SMBus 2.0 */ | ||
480 | 455 | ||
481 | 456 | ||
482 | /* ----- commands for the ioctl like i2c_command call: | 457 | /* ----- commands for the ioctl like i2c_command call: |
@@ -506,11 +481,6 @@ union i2c_smbus_data { | |||
506 | 481 | ||
507 | #define I2C_SMBUS 0x0720 /* SMBus-level access */ | 482 | #define I2C_SMBUS 0x0720 /* SMBus-level access */ |
508 | 483 | ||
509 | /* ... algo-bit.c recognizes */ | ||
510 | #define I2C_UDELAY 0x0705 /* set delay in microsecs between each */ | ||
511 | /* written byte (except address) */ | ||
512 | #define I2C_MDELAY 0x0706 /* millisec delay between written bytes */ | ||
513 | |||
514 | /* ----- I2C-DEV: char device interface stuff ------------------------- */ | 484 | /* ----- I2C-DEV: char device interface stuff ------------------------- */ |
515 | 485 | ||
516 | #define I2C_MAJOR 89 /* Device major number */ | 486 | #define I2C_MAJOR 89 /* Device major number */ |
diff --git a/include/linux/i2o.h b/include/linux/i2o.h index b4af45aad25d..92300325dbcd 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h | |||
@@ -66,8 +66,6 @@ struct i2o_device { | |||
66 | struct device device; | 66 | struct device device; |
67 | 67 | ||
68 | struct semaphore lock; /* device lock */ | 68 | struct semaphore lock; /* device lock */ |
69 | |||
70 | struct class_device classdev; /* i2o device class */ | ||
71 | }; | 69 | }; |
72 | 70 | ||
73 | /* | 71 | /* |
@@ -194,7 +192,7 @@ struct i2o_controller { | |||
194 | struct resource mem_resource; /* Mem resource allocated to the IOP */ | 192 | struct resource mem_resource; /* Mem resource allocated to the IOP */ |
195 | 193 | ||
196 | struct device device; | 194 | struct device device; |
197 | struct class_device classdev; /* I2O controller class */ | 195 | struct class_device *classdev; /* I2O controller class device */ |
198 | struct i2o_device *exec; /* Executive */ | 196 | struct i2o_device *exec; /* Executive */ |
199 | #if BITS_PER_LONG == 64 | 197 | #if BITS_PER_LONG == 64 |
200 | spinlock_t context_list_lock; /* lock for context_list */ | 198 | spinlock_t context_list_lock; /* lock for context_list */ |
diff --git a/include/linux/input.h b/include/linux/input.h index e8c296ff6257..f623c745c21c 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
13 | #include <linux/time.h> | 13 | #include <linux/time.h> |
14 | #include <linux/list.h> | 14 | #include <linux/list.h> |
15 | #include <linux/device.h> | ||
15 | #else | 16 | #else |
16 | #include <sys/time.h> | 17 | #include <sys/time.h> |
17 | #include <sys/ioctl.h> | 18 | #include <sys/ioctl.h> |
@@ -644,6 +645,7 @@ struct input_absinfo { | |||
644 | #define BUS_ADB 0x17 | 645 | #define BUS_ADB 0x17 |
645 | #define BUS_I2C 0x18 | 646 | #define BUS_I2C 0x18 |
646 | #define BUS_HOST 0x19 | 647 | #define BUS_HOST 0x19 |
648 | #define BUS_GSC 0x1A | ||
647 | 649 | ||
648 | /* | 650 | /* |
649 | * Values describing the status of an effect | 651 | * Values describing the status of an effect |
@@ -889,11 +891,15 @@ struct input_dev { | |||
889 | struct semaphore sem; /* serializes open and close operations */ | 891 | struct semaphore sem; /* serializes open and close operations */ |
890 | unsigned int users; | 892 | unsigned int users; |
891 | 893 | ||
892 | struct device *dev; | 894 | struct class_device cdev; |
895 | struct device *dev; /* will be removed soon */ | ||
896 | |||
897 | int dynalloc; /* temporarily */ | ||
893 | 898 | ||
894 | struct list_head h_list; | 899 | struct list_head h_list; |
895 | struct list_head node; | 900 | struct list_head node; |
896 | }; | 901 | }; |
902 | #define to_input_dev(d) container_of(d, struct input_dev, cdev) | ||
897 | 903 | ||
898 | /* | 904 | /* |
899 | * Structure for hotplug & device<->driver matching. | 905 | * Structure for hotplug & device<->driver matching. |
@@ -984,6 +990,23 @@ static inline void init_input_dev(struct input_dev *dev) | |||
984 | INIT_LIST_HEAD(&dev->node); | 990 | INIT_LIST_HEAD(&dev->node); |
985 | } | 991 | } |
986 | 992 | ||
993 | struct input_dev *input_allocate_device(void); | ||
994 | |||
995 | static inline void input_free_device(struct input_dev *dev) | ||
996 | { | ||
997 | kfree(dev); | ||
998 | } | ||
999 | |||
1000 | static inline struct input_dev *input_get_device(struct input_dev *dev) | ||
1001 | { | ||
1002 | return to_input_dev(class_device_get(&dev->cdev)); | ||
1003 | } | ||
1004 | |||
1005 | static inline void input_put_device(struct input_dev *dev) | ||
1006 | { | ||
1007 | class_device_put(&dev->cdev); | ||
1008 | } | ||
1009 | |||
987 | void input_register_device(struct input_dev *); | 1010 | void input_register_device(struct input_dev *); |
988 | void input_unregister_device(struct input_dev *); | 1011 | void input_unregister_device(struct input_dev *); |
989 | 1012 | ||
@@ -1052,7 +1075,7 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min | |||
1052 | dev->absbit[LONG(axis)] |= BIT(axis); | 1075 | dev->absbit[LONG(axis)] |= BIT(axis); |
1053 | } | 1076 | } |
1054 | 1077 | ||
1055 | extern struct class *input_class; | 1078 | extern struct class input_class; |
1056 | 1079 | ||
1057 | #endif | 1080 | #endif |
1058 | #endif | 1081 | #endif |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 1ab78e8d6c53..aef6042f8f0b 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -50,7 +50,7 @@ struct mmc_command { | |||
50 | #define MMC_ERR_INVALID 5 | 50 | #define MMC_ERR_INVALID 5 |
51 | 51 | ||
52 | struct mmc_data *data; /* data segment associated with cmd */ | 52 | struct mmc_data *data; /* data segment associated with cmd */ |
53 | struct mmc_request *mrq; /* assoicated request */ | 53 | struct mmc_request *mrq; /* associated request */ |
54 | }; | 54 | }; |
55 | 55 | ||
56 | struct mmc_data { | 56 | struct mmc_data { |
@@ -68,7 +68,7 @@ struct mmc_data { | |||
68 | unsigned int bytes_xfered; | 68 | unsigned int bytes_xfered; |
69 | 69 | ||
70 | struct mmc_command *stop; /* stop command */ | 70 | struct mmc_command *stop; /* stop command */ |
71 | struct mmc_request *mrq; /* assoicated request */ | 71 | struct mmc_request *mrq; /* associated request */ |
72 | 72 | ||
73 | unsigned int sg_len; /* size of scatter list */ | 73 | unsigned int sg_len; /* size of scatter list */ |
74 | struct scatterlist *sg; /* I/O scatter list */ | 74 | struct scatterlist *sg; /* I/O scatter list */ |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 2f0299a448f6..7b08c11ec4cc 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -244,4 +244,9 @@ struct pcmcia_device_id { | |||
244 | #define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200 | 244 | #define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200 |
245 | #define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400 | 245 | #define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400 |
246 | 246 | ||
247 | /* I2C */ | ||
248 | struct i2c_device_id { | ||
249 | __u16 id; | ||
250 | }; | ||
251 | |||
247 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 252 | #endif /* LINUX_MOD_DEVICETABLE_H */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index a9281b24c40b..c6efce4a04a4 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -308,6 +308,7 @@ struct net_device | |||
308 | #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ | 308 | #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ |
309 | #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ | 309 | #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ |
310 | #define NETIF_F_LLTX 4096 /* LockLess TX */ | 310 | #define NETIF_F_LLTX 4096 /* LockLess TX */ |
311 | #define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/ | ||
311 | 312 | ||
312 | struct net_device *next_sched; | 313 | struct net_device *next_sched; |
313 | 314 | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 5cfb07648eca..7897cf500c51 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -219,7 +219,9 @@ typedef struct pm_message { | |||
219 | 219 | ||
220 | struct dev_pm_info { | 220 | struct dev_pm_info { |
221 | pm_message_t power_state; | 221 | pm_message_t power_state; |
222 | unsigned can_wakeup:1; | ||
222 | #ifdef CONFIG_PM | 223 | #ifdef CONFIG_PM |
224 | unsigned should_wakeup:1; | ||
223 | pm_message_t prev_state; | 225 | pm_message_t prev_state; |
224 | void * saved_state; | 226 | void * saved_state; |
225 | atomic_t pm_users; | 227 | atomic_t pm_users; |
@@ -236,13 +238,35 @@ extern void device_resume(void); | |||
236 | 238 | ||
237 | #ifdef CONFIG_PM | 239 | #ifdef CONFIG_PM |
238 | extern int device_suspend(pm_message_t state); | 240 | extern int device_suspend(pm_message_t state); |
239 | #else | 241 | |
242 | #define device_set_wakeup_enable(dev,val) \ | ||
243 | ((dev)->power.should_wakeup = !!(val)) | ||
244 | #define device_may_wakeup(dev) \ | ||
245 | (device_can_wakeup(dev) && (dev)->power.should_wakeup) | ||
246 | |||
247 | #else /* !CONFIG_PM */ | ||
248 | |||
240 | static inline int device_suspend(pm_message_t state) | 249 | static inline int device_suspend(pm_message_t state) |
241 | { | 250 | { |
242 | return 0; | 251 | return 0; |
243 | } | 252 | } |
253 | |||
254 | #define device_set_wakeup_enable(dev,val) do{}while(0) | ||
255 | #define device_may_wakeup(dev) (0) | ||
256 | |||
244 | #endif | 257 | #endif |
245 | 258 | ||
259 | /* changes to device_may_wakeup take effect on the next pm state change. | ||
260 | * by default, devices should wakeup if they can. | ||
261 | */ | ||
262 | #define device_can_wakeup(dev) \ | ||
263 | ((dev)->power.can_wakeup) | ||
264 | #define device_init_wakeup(dev,val) \ | ||
265 | do { \ | ||
266 | device_can_wakeup(dev) = !!(val); \ | ||
267 | device_set_wakeup_enable(dev,val); \ | ||
268 | } while(0) | ||
269 | |||
246 | #endif /* __KERNEL__ */ | 270 | #endif /* __KERNEL__ */ |
247 | 271 | ||
248 | #endif /* _LINUX_PM_H */ | 272 | #endif /* _LINUX_PM_H */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index b756935da9c8..4286d832166f 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -137,6 +137,8 @@ struct skb_shared_info { | |||
137 | unsigned int nr_frags; | 137 | unsigned int nr_frags; |
138 | unsigned short tso_size; | 138 | unsigned short tso_size; |
139 | unsigned short tso_segs; | 139 | unsigned short tso_segs; |
140 | unsigned short ufo_size; | ||
141 | unsigned int ip6_frag_id; | ||
140 | struct sk_buff *frag_list; | 142 | struct sk_buff *frag_list; |
141 | skb_frag_t frags[MAX_SKB_FRAGS]; | 143 | skb_frag_t frags[MAX_SKB_FRAGS]; |
142 | }; | 144 | }; |
@@ -341,6 +343,11 @@ extern void skb_over_panic(struct sk_buff *skb, int len, | |||
341 | extern void skb_under_panic(struct sk_buff *skb, int len, | 343 | extern void skb_under_panic(struct sk_buff *skb, int len, |
342 | void *here); | 344 | void *here); |
343 | 345 | ||
346 | extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, | ||
347 | int getfrag(void *from, char *to, int offset, | ||
348 | int len,int odd, struct sk_buff *skb), | ||
349 | void *from, int length); | ||
350 | |||
344 | struct skb_seq_state | 351 | struct skb_seq_state |
345 | { | 352 | { |
346 | __u32 lower_offset; | 353 | __u32 lower_offset; |
diff --git a/include/linux/x1205.h b/include/linux/x1205.h new file mode 100644 index 000000000000..64fd3af894a5 --- /dev/null +++ b/include/linux/x1205.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * x1205.h - defines for drivers/i2c/chips/x1205.c | ||
3 | * Copyright 2004 Karen Spearel | ||
4 | * Copyright 2005 Alessandro Zummo | ||
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 as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_X1205_H__ | ||
13 | #define __LINUX_X1205_H__ | ||
14 | |||
15 | /* commands */ | ||
16 | |||
17 | #define X1205_CMD_GETDATETIME 0 | ||
18 | #define X1205_CMD_SETTIME 1 | ||
19 | #define X1205_CMD_SETDATETIME 2 | ||
20 | #define X1205_CMD_GETALARM 3 | ||
21 | #define X1205_CMD_SETALARM 4 | ||
22 | #define X1205_CMD_GETDTRIM 5 | ||
23 | #define X1205_CMD_SETDTRIM 6 | ||
24 | #define X1205_CMD_GETATRIM 7 | ||
25 | #define X1205_CMD_SETATRIM 8 | ||
26 | |||
27 | extern int x1205_do_command(unsigned int cmd, void *arg); | ||
28 | extern int x1205_direct_attach(int adapter_id, | ||
29 | struct i2c_client_address_data *address_data); | ||
30 | |||
31 | #endif /* __LINUX_X1205_H__ */ | ||
diff --git a/include/media/ovcamchip.h b/include/media/ovcamchip.h index cb7c0aa96f22..8138983adced 100644 --- a/include/media/ovcamchip.h +++ b/include/media/ovcamchip.h | |||
@@ -17,20 +17,6 @@ | |||
17 | #include <linux/videodev.h> | 17 | #include <linux/videodev.h> |
18 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
19 | 19 | ||
20 | /* Remove these once they are officially defined */ | ||
21 | #ifndef I2C_DRIVERID_OVCAMCHIP | ||
22 | #define I2C_DRIVERID_OVCAMCHIP 0xf00f | ||
23 | #endif | ||
24 | #ifndef I2C_HW_SMBUS_OV511 | ||
25 | #define I2C_HW_SMBUS_OV511 0xfe | ||
26 | #endif | ||
27 | #ifndef I2C_HW_SMBUS_OV518 | ||
28 | #define I2C_HW_SMBUS_OV518 0xff | ||
29 | #endif | ||
30 | #ifndef I2C_HW_SMBUS_OVFX2 | ||
31 | #define I2C_HW_SMBUS_OVFX2 0xfd | ||
32 | #endif | ||
33 | |||
34 | /* --------------------------------- */ | 20 | /* --------------------------------- */ |
35 | /* ENUMERATIONS */ | 21 | /* ENUMERATIONS */ |
36 | /* --------------------------------- */ | 22 | /* --------------------------------- */ |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 210458624840..e42d728b1620 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -171,4 +171,10 @@ static inline int skb_frags_no(struct sk_buff *skb) | |||
171 | 171 | ||
172 | int bt_err(__u16 code); | 172 | int bt_err(__u16 code); |
173 | 173 | ||
174 | extern int hci_sock_init(void); | ||
175 | extern int hci_sock_cleanup(void); | ||
176 | |||
177 | extern int bt_sysfs_init(void); | ||
178 | extern void bt_sysfs_cleanup(void); | ||
179 | |||
174 | #endif /* __BLUETOOTH_H */ | 180 | #endif /* __BLUETOOTH_H */ |
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index fbe557f7ea1d..e656be7c001a 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
@@ -275,9 +275,6 @@ static inline void rfcomm_session_hold(struct rfcomm_session *s) | |||
275 | atomic_inc(&s->refcnt); | 275 | atomic_inc(&s->refcnt); |
276 | } | 276 | } |
277 | 277 | ||
278 | /* ---- RFCOMM chechsum ---- */ | ||
279 | extern u8 rfcomm_crc_table[]; | ||
280 | |||
281 | /* ---- RFCOMM sockets ---- */ | 278 | /* ---- RFCOMM sockets ---- */ |
282 | struct sockaddr_rc { | 279 | struct sockaddr_rc { |
283 | sa_family_t rc_family; | 280 | sa_family_t rc_family; |