diff options
Diffstat (limited to 'include')
352 files changed, 6492 insertions, 2302 deletions
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h index ce7c9d653910..73967c8152d3 100644 --- a/include/acpi/acinterp.h +++ b/include/acpi/acinterp.h | |||
@@ -253,7 +253,8 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, | |||
253 | 253 | ||
254 | void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread); | 254 | void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread); |
255 | 255 | ||
256 | void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc); | 256 | void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc, |
257 | struct acpi_thread_state *thread); | ||
257 | 258 | ||
258 | /* | 259 | /* |
259 | * exprep - ACPI AML execution - prep utilities | 260 | * exprep - ACPI AML execution - prep utilities |
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index 04e9735a6742..5206d61d74a6 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h | |||
@@ -155,7 +155,7 @@ struct acpi_object_event { | |||
155 | struct acpi_object_mutex { | 155 | struct acpi_object_mutex { |
156 | ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ | 156 | ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ |
157 | u16 acquisition_depth; /* Allow multiple Acquires, same thread */ | 157 | u16 acquisition_depth; /* Allow multiple Acquires, same thread */ |
158 | struct acpi_thread_state *owner_thread; /* Current owner of the mutex */ | 158 | acpi_thread_id owner_thread_id; /* Current owner of the mutex */ |
159 | acpi_mutex os_mutex; /* Actual OS synchronization object */ | 159 | acpi_mutex os_mutex; /* Actual OS synchronization object */ |
160 | union acpi_operand_object *prev; /* Link for list of acquired mutexes */ | 160 | union acpi_operand_object *prev; /* Link for list of acquired mutexes */ |
161 | union acpi_operand_object *next; /* Link for list of acquired mutexes */ | 161 | union acpi_operand_object *next; /* Link for list of acquired mutexes */ |
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 4dc8a5043ef0..f6275b0e66dd 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -105,12 +105,6 @@ int acpi_ec_ecdt_probe(void); | |||
105 | 105 | ||
106 | int acpi_processor_set_thermal_limit(acpi_handle handle, int type); | 106 | int acpi_processor_set_thermal_limit(acpi_handle handle, int type); |
107 | 107 | ||
108 | /* -------------------------------------------------------------------------- | ||
109 | Hot Keys | ||
110 | -------------------------------------------------------------------------- */ | ||
111 | |||
112 | extern int acpi_specific_hotkey_enabled; | ||
113 | |||
114 | /*-------------------------------------------------------------------------- | 108 | /*-------------------------------------------------------------------------- |
115 | Dock Station | 109 | Dock Station |
116 | -------------------------------------------------------------------------- */ | 110 | -------------------------------------------------------------------------- */ |
@@ -122,10 +116,34 @@ extern int register_hotplug_dock_device(acpi_handle handle, | |||
122 | acpi_notify_handler handler, void *context); | 116 | acpi_notify_handler handler, void *context); |
123 | extern void unregister_hotplug_dock_device(acpi_handle handle); | 117 | extern void unregister_hotplug_dock_device(acpi_handle handle); |
124 | #else | 118 | #else |
125 | #define is_dock_device(h) (0) | 119 | static inline int is_dock_device(acpi_handle handle) |
126 | #define register_dock_notifier(nb) (-ENODEV) | 120 | { |
127 | #define unregister_dock_notifier(nb) do { } while(0) | 121 | return 0; |
128 | #define register_hotplug_dock_device(h1, h2, c) (-ENODEV) | 122 | } |
129 | #define unregister_hotplug_dock_device(h) do { } while(0) | 123 | static inline int register_dock_notifier(struct notifier_block *nb) |
124 | { | ||
125 | return -ENODEV; | ||
126 | } | ||
127 | static inline void unregister_dock_notifier(struct notifier_block *nb) | ||
128 | { | ||
129 | } | ||
130 | static inline int register_hotplug_dock_device(acpi_handle handle, | ||
131 | acpi_notify_handler handler, void *context) | ||
132 | { | ||
133 | return -ENODEV; | ||
134 | } | ||
135 | static inline void unregister_hotplug_dock_device(acpi_handle handle) | ||
136 | { | ||
137 | } | ||
138 | #endif | ||
139 | |||
140 | /*-------------------------------------------------------------------------- | ||
141 | Suspend/Resume | ||
142 | -------------------------------------------------------------------------- */ | ||
143 | #ifdef CONFIG_ACPI_SLEEP | ||
144 | extern int acpi_sleep_init(void); | ||
145 | #else | ||
146 | #define acpi_sleep_init() do {} while (0) | ||
130 | #endif | 147 | #endif |
148 | |||
131 | #endif /*__ACPI_DRIVERS_H__*/ | 149 | #endif /*__ACPI_DRIVERS_H__*/ |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 781394b9efe0..2785058c82ab 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -240,12 +240,6 @@ acpi_status | |||
240 | acpi_os_validate_address(u8 space_id, | 240 | acpi_os_validate_address(u8 space_id, |
241 | acpi_physical_address address, acpi_size length); | 241 | acpi_physical_address address, acpi_size length); |
242 | 242 | ||
243 | u8 acpi_os_readable(void *pointer, acpi_size length); | ||
244 | |||
245 | #ifdef ACPI_FUTURE_USAGE | ||
246 | u8 acpi_os_writable(void *pointer, acpi_size length); | ||
247 | #endif | ||
248 | |||
249 | u64 acpi_os_get_timer(void); | 243 | u64 acpi_os_get_timer(void); |
250 | 244 | ||
251 | acpi_status acpi_os_signal(u32 function, void *info); | 245 | acpi_status acpi_os_signal(u32 function, void *info); |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 7798d2a9f793..916c0102db5b 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -79,6 +79,7 @@ struct acpi_processor_power { | |||
79 | u32 bm_activity; | 79 | u32 bm_activity; |
80 | int count; | 80 | int count; |
81 | struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; | 81 | struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; |
82 | int timer_broadcast_on_state; | ||
82 | }; | 83 | }; |
83 | 84 | ||
84 | /* Performance Management */ | 85 | /* Performance Management */ |
diff --git a/include/asm-arm/.gitignore b/include/asm-arm/.gitignore new file mode 100644 index 000000000000..e02c15d158fc --- /dev/null +++ b/include/asm-arm/.gitignore | |||
@@ -0,0 +1,2 @@ | |||
1 | arch | ||
2 | mach-types.h | ||
diff --git a/include/asm-arm/arch-aaec2000/entry-macro.S b/include/asm-arm/arch-aaec2000/entry-macro.S index 1eb3503bd16e..83fdf68f6b7c 100644 --- a/include/asm-arm/arch-aaec2000/entry-macro.S +++ b/include/asm-arm/arch-aaec2000/entry-macro.S | |||
@@ -15,6 +15,12 @@ | |||
15 | .macro disable_fiq | 15 | .macro disable_fiq |
16 | .endm | 16 | .endm |
17 | 17 | ||
18 | .macro get_irqnr_preamble, base, tmp | ||
19 | .endm | ||
20 | |||
21 | .macro arch_ret_to_user, tmp1, tmp2 | ||
22 | .endm | ||
23 | |||
18 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 24 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
19 | mov r4, #0xf8000000 | 25 | mov r4, #0xf8000000 |
20 | add r4, r4, #0x00000500 | 26 | add r4, r4, #0x00000500 |
diff --git a/include/asm-arm/arch-at91rm9200/at91_aic.h b/include/asm-arm/arch-at91/at91_aic.h index 267e69812e26..df44c12a12d4 100644 --- a/include/asm-arm/arch-at91rm9200/at91_aic.h +++ b/include/asm-arm/arch-at91/at91_aic.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_aic.h | 2 | * include/asm-arm/arch-at91/at91_aic.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Ivan Kokshaysky | 4 | * Copyright (C) 2005 Ivan Kokshaysky |
5 | * Copyright (C) SAN People | 5 | * Copyright (C) SAN People |
diff --git a/include/asm-arm/arch-at91rm9200/at91_dbgu.h b/include/asm-arm/arch-at91/at91_dbgu.h index e4b8b27acfca..b0369e176f7b 100644 --- a/include/asm-arm/arch-at91rm9200/at91_dbgu.h +++ b/include/asm-arm/arch-at91/at91_dbgu.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_dbgu.h | 2 | * include/asm-arm/arch-at91/at91_dbgu.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Ivan Kokshaysky | 4 | * Copyright (C) 2005 Ivan Kokshaysky |
5 | * Copyright (C) SAN People | 5 | * Copyright (C) SAN People |
@@ -35,6 +35,20 @@ | |||
35 | #define AT91_CIDR_NVPSIZ (0xf << 8) /* Nonvolatile Program Memory Size */ | 35 | #define AT91_CIDR_NVPSIZ (0xf << 8) /* Nonvolatile Program Memory Size */ |
36 | #define AT91_CIDR_NVPSIZ2 (0xf << 12) /* Second Nonvolatile Program Memory Size */ | 36 | #define AT91_CIDR_NVPSIZ2 (0xf << 12) /* Second Nonvolatile Program Memory Size */ |
37 | #define AT91_CIDR_SRAMSIZ (0xf << 16) /* Internal SRAM Size */ | 37 | #define AT91_CIDR_SRAMSIZ (0xf << 16) /* Internal SRAM Size */ |
38 | #define AT91_CIDR_SRAMSIZ_1K (1 << 16) | ||
39 | #define AT91_CIDR_SRAMSIZ_2K (2 << 16) | ||
40 | #define AT91_CIDR_SRAMSIZ_112K (4 << 16) | ||
41 | #define AT91_CIDR_SRAMSIZ_4K (5 << 16) | ||
42 | #define AT91_CIDR_SRAMSIZ_80K (6 << 16) | ||
43 | #define AT91_CIDR_SRAMSIZ_160K (7 << 16) | ||
44 | #define AT91_CIDR_SRAMSIZ_8K (8 << 16) | ||
45 | #define AT91_CIDR_SRAMSIZ_16K (9 << 16) | ||
46 | #define AT91_CIDR_SRAMSIZ_32K (10 << 16) | ||
47 | #define AT91_CIDR_SRAMSIZ_64K (11 << 16) | ||
48 | #define AT91_CIDR_SRAMSIZ_128K (12 << 16) | ||
49 | #define AT91_CIDR_SRAMSIZ_256K (13 << 16) | ||
50 | #define AT91_CIDR_SRAMSIZ_96K (14 << 16) | ||
51 | #define AT91_CIDR_SRAMSIZ_512K (15 << 16) | ||
38 | #define AT91_CIDR_ARCH (0xff << 20) /* Architecture Identifier */ | 52 | #define AT91_CIDR_ARCH (0xff << 20) /* Architecture Identifier */ |
39 | #define AT91_CIDR_NVPTYP (7 << 28) /* Nonvolatile Program Memory Type */ | 53 | #define AT91_CIDR_NVPTYP (7 << 28) /* Nonvolatile Program Memory Type */ |
40 | #define AT91_CIDR_EXT (1 << 31) /* Extension Flag */ | 54 | #define AT91_CIDR_EXT (1 << 31) /* Extension Flag */ |
diff --git a/include/asm-arm/arch-at91rm9200/at91_ecc.h b/include/asm-arm/arch-at91/at91_ecc.h index 5c564ede5c5d..ff93df516d6d 100644 --- a/include/asm-arm/arch-at91rm9200/at91_ecc.h +++ b/include/asm-arm/arch-at91/at91_ecc.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_ecc.h | 2 | * include/asm-arm/arch-at91/at91_ecc.h |
3 | * | 3 | * |
4 | * Error Corrected Code Controller (ECC) - System peripherals regsters. | 4 | * Error Corrected Code Controller (ECC) - System peripherals regsters. |
5 | * Based on AT91SAM9260 datasheet revision B. | 5 | * Based on AT91SAM9260 datasheet revision B. |
diff --git a/include/asm-arm/arch-at91rm9200/at91_lcdc.h b/include/asm-arm/arch-at91/at91_lcdc.h index 9cbfcdd3c471..ab040a40d37b 100644 --- a/include/asm-arm/arch-at91rm9200/at91_lcdc.h +++ b/include/asm-arm/arch-at91/at91_lcdc.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_lcdc.h | 2 | * include/asm-arm/arch-at91/at91_lcdc.h |
3 | * | 3 | * |
4 | * LCD Controller (LCDC). | 4 | * LCD Controller (LCDC). |
5 | * Based on AT91SAM9261 datasheet revision E. | 5 | * Based on AT91SAM9261 datasheet revision E. |
diff --git a/include/asm-arm/arch-at91rm9200/at91_mci.h b/include/asm-arm/arch-at91/at91_mci.h index 9a552cb743c0..40a9876b661a 100644 --- a/include/asm-arm/arch-at91rm9200/at91_mci.h +++ b/include/asm-arm/arch-at91/at91_mci.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_mci.h | 2 | * include/asm-arm/arch-at91/at91_mci.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Ivan Kokshaysky | 4 | * Copyright (C) 2005 Ivan Kokshaysky |
5 | * Copyright (C) SAN People | 5 | * Copyright (C) SAN People |
diff --git a/include/asm-arm/arch-at91rm9200/at91_pio.h b/include/asm-arm/arch-at91/at91_pio.h index 680eaa1f5915..84c3866d309f 100644 --- a/include/asm-arm/arch-at91rm9200/at91_pio.h +++ b/include/asm-arm/arch-at91/at91_pio.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_pio.h | 2 | * include/asm-arm/arch-at91/at91_pio.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Ivan Kokshaysky | 4 | * Copyright (C) 2005 Ivan Kokshaysky |
5 | * Copyright (C) SAN People | 5 | * Copyright (C) SAN People |
diff --git a/include/asm-arm/arch-at91rm9200/at91_pit.h b/include/asm-arm/arch-at91/at91_pit.h index 4a30d009c588..5026325a5ae4 100644 --- a/include/asm-arm/arch-at91rm9200/at91_pit.h +++ b/include/asm-arm/arch-at91/at91_pit.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_pit.h | 2 | * include/asm-arm/arch-at91/at91_pit.h |
3 | * | 3 | * |
4 | * Periodic Interval Timer (PIT) - System peripherals regsters. | 4 | * Periodic Interval Timer (PIT) - System peripherals regsters. |
5 | * Based on AT91SAM9261 datasheet revision D. | 5 | * Based on AT91SAM9261 datasheet revision D. |
diff --git a/include/asm-arm/arch-at91rm9200/at91_pmc.h b/include/asm-arm/arch-at91/at91_pmc.h index c3b489d09b6c..33ff5b6798ee 100644 --- a/include/asm-arm/arch-at91rm9200/at91_pmc.h +++ b/include/asm-arm/arch-at91/at91_pmc.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_pmc.h | 2 | * include/asm-arm/arch-at91/at91_pmc.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Ivan Kokshaysky | 4 | * Copyright (C) 2005 Ivan Kokshaysky |
5 | * Copyright (C) SAN People | 5 | * Copyright (C) SAN People |
diff --git a/include/asm-arm/arch-at91rm9200/at91_rstc.h b/include/asm-arm/arch-at91/at91_rstc.h index 237d3c40b318..fb8d1618a231 100644 --- a/include/asm-arm/arch-at91rm9200/at91_rstc.h +++ b/include/asm-arm/arch-at91/at91_rstc.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_rstc.h | 2 | * include/asm-arm/arch-at91/at91_rstc.h |
3 | * | 3 | * |
4 | * Reset Controller (RSTC) - System peripherals regsters. | 4 | * Reset Controller (RSTC) - System peripherals regsters. |
5 | * Based on AT91SAM9261 datasheet revision D. | 5 | * Based on AT91SAM9261 datasheet revision D. |
@@ -17,7 +17,7 @@ | |||
17 | #define AT91_RSTC_PROCRST (1 << 0) /* Processor Reset */ | 17 | #define AT91_RSTC_PROCRST (1 << 0) /* Processor Reset */ |
18 | #define AT91_RSTC_PERRST (1 << 2) /* Peripheral Reset */ | 18 | #define AT91_RSTC_PERRST (1 << 2) /* Peripheral Reset */ |
19 | #define AT91_RSTC_EXTRST (1 << 3) /* External Reset */ | 19 | #define AT91_RSTC_EXTRST (1 << 3) /* External Reset */ |
20 | #define AT91_RSTC_KEY (0xff << 24) /* KEY Password */ | 20 | #define AT91_RSTC_KEY (0xa5 << 24) /* KEY Password */ |
21 | 21 | ||
22 | #define AT91_RSTC_SR (AT91_RSTC + 0x04) /* Reset Controller Status Register */ | 22 | #define AT91_RSTC_SR (AT91_RSTC + 0x04) /* Reset Controller Status Register */ |
23 | #define AT91_RSTC_URSTS (1 << 0) /* User Reset Status */ | 23 | #define AT91_RSTC_URSTS (1 << 0) /* User Reset Status */ |
@@ -34,6 +34,5 @@ | |||
34 | #define AT91_RSTC_URSTEN (1 << 0) /* User Reset Enable */ | 34 | #define AT91_RSTC_URSTEN (1 << 0) /* User Reset Enable */ |
35 | #define AT91_RSTC_URSTIEN (1 << 4) /* User Reset Interrupt Enable */ | 35 | #define AT91_RSTC_URSTIEN (1 << 4) /* User Reset Interrupt Enable */ |
36 | #define AT91_RSTC_ERSTL (0xf << 8) /* External Reset Length */ | 36 | #define AT91_RSTC_ERSTL (0xf << 8) /* External Reset Length */ |
37 | #define AT91_RSTC_KEY (0xff << 24) /* KEY Password */ | ||
38 | 37 | ||
39 | #endif | 38 | #endif |
diff --git a/include/asm-arm/arch-at91rm9200/at91_rtc.h b/include/asm-arm/arch-at91/at91_rtc.h index 095fe0883102..af9bd28174c0 100644 --- a/include/asm-arm/arch-at91rm9200/at91_rtc.h +++ b/include/asm-arm/arch-at91/at91_rtc.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_rtc.h | 2 | * include/asm-arm/arch-at91/at91_rtc.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Ivan Kokshaysky | 4 | * Copyright (C) 2005 Ivan Kokshaysky |
5 | * Copyright (C) SAN People | 5 | * Copyright (C) SAN People |
diff --git a/include/asm-arm/arch-at91rm9200/at91_rtt.h b/include/asm-arm/arch-at91/at91_rtt.h index c6751ba3cccc..bae1103fbbb2 100644 --- a/include/asm-arm/arch-at91rm9200/at91_rtt.h +++ b/include/asm-arm/arch-at91/at91_rtt.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_rtt.h | 2 | * include/asm-arm/arch-at91/at91_rtt.h |
3 | * | 3 | * |
4 | * Real-time Timer (RTT) - System peripherals regsters. | 4 | * Real-time Timer (RTT) - System peripherals regsters. |
5 | * Based on AT91SAM9261 datasheet revision D. | 5 | * Based on AT91SAM9261 datasheet revision D. |
diff --git a/include/asm-arm/arch-at91rm9200/at91_shdwc.h b/include/asm-arm/arch-at91/at91_shdwc.h index 0439250553c9..795fcc266228 100644 --- a/include/asm-arm/arch-at91rm9200/at91_shdwc.h +++ b/include/asm-arm/arch-at91/at91_shdwc.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_shdwc.h | 2 | * include/asm-arm/arch-at91/at91_shdwc.h |
3 | * | 3 | * |
4 | * Shutdown Controller (SHDWC) - System peripherals regsters. | 4 | * Shutdown Controller (SHDWC) - System peripherals regsters. |
5 | * Based on AT91SAM9261 datasheet revision D. | 5 | * Based on AT91SAM9261 datasheet revision D. |
diff --git a/include/asm-arm/arch-at91rm9200/at91_spi.h b/include/asm-arm/arch-at91/at91_spi.h index bec48ca89bba..f9b9a8464997 100644 --- a/include/asm-arm/arch-at91rm9200/at91_spi.h +++ b/include/asm-arm/arch-at91/at91_spi.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_spi.h | 2 | * include/asm-arm/arch-at91/at91_spi.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Ivan Kokshaysky | 4 | * Copyright (C) 2005 Ivan Kokshaysky |
5 | * Copyright (C) SAN People | 5 | * Copyright (C) SAN People |
diff --git a/include/asm-arm/arch-at91rm9200/at91_ssc.h b/include/asm-arm/arch-at91/at91_ssc.h index 694bcaa8f7c2..0ecc73460b50 100644 --- a/include/asm-arm/arch-at91rm9200/at91_ssc.h +++ b/include/asm-arm/arch-at91/at91_ssc.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_ssc.h | 2 | * include/asm-arm/arch-at91/at91_ssc.h |
3 | * | 3 | * |
4 | * Copyright (C) SAN People | 4 | * Copyright (C) SAN People |
5 | * | 5 | * |
diff --git a/include/asm-arm/arch-at91rm9200/at91_st.h b/include/asm-arm/arch-at91/at91_st.h index 2432ddfc6c47..30446e2ea772 100644 --- a/include/asm-arm/arch-at91rm9200/at91_st.h +++ b/include/asm-arm/arch-at91/at91_st.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_st.h | 2 | * include/asm-arm/arch-at91/at91_st.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Ivan Kokshaysky | 4 | * Copyright (C) 2005 Ivan Kokshaysky |
5 | * Copyright (C) SAN People | 5 | * Copyright (C) SAN People |
diff --git a/include/asm-arm/arch-at91rm9200/at91_tc.h b/include/asm-arm/arch-at91/at91_tc.h index 8d06eb078e1d..b85d3faeef5c 100644 --- a/include/asm-arm/arch-at91rm9200/at91_tc.h +++ b/include/asm-arm/arch-at91/at91_tc.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_tc.h | 2 | * include/asm-arm/arch-at91/at91_tc.h |
3 | * | 3 | * |
4 | * Copyright (C) SAN People | 4 | * Copyright (C) SAN People |
5 | * | 5 | * |
diff --git a/include/asm-arm/arch-at91rm9200/at91_twi.h b/include/asm-arm/arch-at91/at91_twi.h index cda914f1e740..ca9a90733456 100644 --- a/include/asm-arm/arch-at91rm9200/at91_twi.h +++ b/include/asm-arm/arch-at91/at91_twi.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_twi.h | 2 | * include/asm-arm/arch-at91/at91_twi.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Ivan Kokshaysky | 4 | * Copyright (C) 2005 Ivan Kokshaysky |
5 | * Copyright (C) SAN People | 5 | * Copyright (C) SAN People |
diff --git a/include/asm-arm/arch-at91rm9200/at91_wdt.h b/include/asm-arm/arch-at91/at91_wdt.h index ac63e775772c..7251a344c740 100644 --- a/include/asm-arm/arch-at91rm9200/at91_wdt.h +++ b/include/asm-arm/arch-at91/at91_wdt.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91_wdt.h | 2 | * include/asm-arm/arch-at91/at91_wdt.h |
3 | * | 3 | * |
4 | * Watchdog Timer (WDT) - System peripherals regsters. | 4 | * Watchdog Timer (WDT) - System peripherals regsters. |
5 | * Based on AT91SAM9261 datasheet revision D. | 5 | * Based on AT91SAM9261 datasheet revision D. |
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200.h b/include/asm-arm/arch-at91/at91rm9200.h index c569b6a21a42..a12ac8ab2ad0 100644 --- a/include/asm-arm/arch-at91rm9200/at91rm9200.h +++ b/include/asm-arm/arch-at91/at91rm9200.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91rm9200.h | 2 | * include/asm-arm/arch-at91/at91rm9200.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Ivan Kokshaysky | 4 | * Copyright (C) 2005 Ivan Kokshaysky |
5 | * Copyright (C) SAN People | 5 | * Copyright (C) SAN People |
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_emac.h b/include/asm-arm/arch-at91/at91rm9200_emac.h index fbc091e61e2f..0c417af5fe7f 100644 --- a/include/asm-arm/arch-at91rm9200/at91rm9200_emac.h +++ b/include/asm-arm/arch-at91/at91rm9200_emac.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91rm9200_emac.h | 2 | * include/asm-arm/arch-at91/at91rm9200_emac.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Ivan Kokshaysky | 4 | * Copyright (C) 2005 Ivan Kokshaysky |
5 | * Copyright (C) SAN People | 5 | * Copyright (C) SAN People |
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_mc.h b/include/asm-arm/arch-at91/at91rm9200_mc.h index 0c0d81480b3a..24d012939cc4 100644 --- a/include/asm-arm/arch-at91rm9200/at91rm9200_mc.h +++ b/include/asm-arm/arch-at91/at91rm9200_mc.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91rm9200_mc.h | 2 | * include/asm-arm/arch-at91/at91rm9200_mc.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Ivan Kokshaysky | 4 | * Copyright (C) 2005 Ivan Kokshaysky |
5 | * Copyright (C) SAN People | 5 | * Copyright (C) SAN People |
diff --git a/include/asm-arm/arch-at91rm9200/at91sam9260.h b/include/asm-arm/arch-at91/at91sam9260.h index 46f4dd65c035..2cadebc36af7 100644 --- a/include/asm-arm/arch-at91rm9200/at91sam9260.h +++ b/include/asm-arm/arch-at91/at91sam9260.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91sam9260.h | 2 | * include/asm-arm/arch-at91/at91sam9260.h |
3 | * | 3 | * |
4 | * (C) 2006 Andrew Victor | 4 | * (C) 2006 Andrew Victor |
5 | * | 5 | * |
@@ -113,6 +113,10 @@ | |||
113 | 113 | ||
114 | #define AT91SAM9260_UHP_BASE 0x00500000 /* USB Host controller */ | 114 | #define AT91SAM9260_UHP_BASE 0x00500000 /* USB Host controller */ |
115 | 115 | ||
116 | #define AT91SAM9XE_FLASH_BASE 0x00200000 /* Internal FLASH base address */ | ||
117 | #define AT91SAM9XE_SRAM_BASE 0x00300000 /* Internal SRAM base address */ | ||
118 | |||
119 | |||
116 | #if 0 | 120 | #if 0 |
117 | /* | 121 | /* |
118 | * PIO pin definitions (peripheral A/B multiplexing). | 122 | * PIO pin definitions (peripheral A/B multiplexing). |
diff --git a/include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h b/include/asm-arm/arch-at91/at91sam9260_matrix.h index 78f6b4917b8b..aacb1e976422 100644 --- a/include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h +++ b/include/asm-arm/arch-at91/at91sam9260_matrix.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h | 2 | * include/asm-arm/arch-at91/at91sam9260_matrix.h |
3 | * | 3 | * |
4 | * Memory Controllers (MATRIX, EBI) - System peripherals registers. | 4 | * Memory Controllers (MATRIX, EBI) - System peripherals registers. |
5 | * Based on AT91SAM9260 datasheet revision B. | 5 | * Based on AT91SAM9260 datasheet revision B. |
@@ -18,7 +18,7 @@ | |||
18 | #define AT91_MATRIX_MCFG2 (AT91_MATRIX + 0x08) /* Master Configuration Register 2 */ | 18 | #define AT91_MATRIX_MCFG2 (AT91_MATRIX + 0x08) /* Master Configuration Register 2 */ |
19 | #define AT91_MATRIX_MCFG3 (AT91_MATRIX + 0x0C) /* Master Configuration Register 3 */ | 19 | #define AT91_MATRIX_MCFG3 (AT91_MATRIX + 0x0C) /* Master Configuration Register 3 */ |
20 | #define AT91_MATRIX_MCFG4 (AT91_MATRIX + 0x10) /* Master Configuration Register 4 */ | 20 | #define AT91_MATRIX_MCFG4 (AT91_MATRIX + 0x10) /* Master Configuration Register 4 */ |
21 | #define AT91_MATRIX_MCFG5 (AT91_MATRIX + 0x04) /* Master Configuration Register 5 */ | 21 | #define AT91_MATRIX_MCFG5 (AT91_MATRIX + 0x14) /* Master Configuration Register 5 */ |
22 | #define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */ | 22 | #define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */ |
23 | #define AT91_MATRIX_ULBT_INFINITE (0 << 0) | 23 | #define AT91_MATRIX_ULBT_INFINITE (0 << 0) |
24 | #define AT91_MATRIX_ULBT_SINGLE (1 << 0) | 24 | #define AT91_MATRIX_ULBT_SINGLE (1 << 0) |
diff --git a/include/asm-arm/arch-at91rm9200/at91sam9261.h b/include/asm-arm/arch-at91/at91sam9261.h index 8d39672d5b82..01b58ffe2e27 100644 --- a/include/asm-arm/arch-at91rm9200/at91sam9261.h +++ b/include/asm-arm/arch-at91/at91sam9261.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91sam9261.h | 2 | * include/asm-arm/arch-at91/at91sam9261.h |
3 | * | 3 | * |
4 | * Copyright (C) SAN People | 4 | * Copyright (C) SAN People |
5 | * | 5 | * |
diff --git a/include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h b/include/asm-arm/arch-at91/at91sam9261_matrix.h index ec88efabbe6c..6f072421be5b 100644 --- a/include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h +++ b/include/asm-arm/arch-at91/at91sam9261_matrix.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h | 2 | * include/asm-arm/arch-at91/at91sam9261_matrix.h |
3 | * | 3 | * |
4 | * Memory Controllers (MATRIX, EBI) - System peripherals registers. | 4 | * Memory Controllers (MATRIX, EBI) - System peripherals registers. |
5 | * Based on AT91SAM9261 datasheet revision D. | 5 | * Based on AT91SAM9261 datasheet revision D. |
diff --git a/include/asm-arm/arch-at91/at91sam9263.h b/include/asm-arm/arch-at91/at91sam9263.h new file mode 100644 index 000000000000..f4af68ae0ea9 --- /dev/null +++ b/include/asm-arm/arch-at91/at91sam9263.h | |||
@@ -0,0 +1,131 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-at91/at91sam9263.h | ||
3 | * | ||
4 | * (C) 2007 Atmel Corporation. | ||
5 | * | ||
6 | * Common definitions. | ||
7 | * Based on AT91SAM9263 datasheet revision B (Preliminary). | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | */ | ||
14 | |||
15 | #ifndef AT91SAM9263_H | ||
16 | #define AT91SAM9263_H | ||
17 | |||
18 | /* | ||
19 | * Peripheral identifiers/interrupts. | ||
20 | */ | ||
21 | #define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */ | ||
22 | #define AT91_ID_SYS 1 /* System Peripherals */ | ||
23 | #define AT91SAM9263_ID_PIOA 2 /* Parallel IO Controller A */ | ||
24 | #define AT91SAM9263_ID_PIOB 3 /* Parallel IO Controller B */ | ||
25 | #define AT91SAM9263_ID_PIOCDE 4 /* Parallel IO Controller C, D and E */ | ||
26 | #define AT91SAM9263_ID_US0 7 /* USART 0 */ | ||
27 | #define AT91SAM9263_ID_US1 8 /* USART 1 */ | ||
28 | #define AT91SAM9263_ID_US2 9 /* USART 2 */ | ||
29 | #define AT91SAM9263_ID_MCI0 10 /* Multimedia Card Interface 0 */ | ||
30 | #define AT91SAM9263_ID_MCI1 11 /* Multimedia Card Interface 1 */ | ||
31 | #define AT91SAM9263_ID_CAN 12 /* CAN */ | ||
32 | #define AT91SAM9263_ID_TWI 13 /* Two-Wire Interface */ | ||
33 | #define AT91SAM9263_ID_SPI0 14 /* Serial Peripheral Interface 0 */ | ||
34 | #define AT91SAM9263_ID_SPI1 15 /* Serial Peripheral Interface 1 */ | ||
35 | #define AT91SAM9263_ID_SSC0 16 /* Serial Synchronous Controller 0 */ | ||
36 | #define AT91SAM9263_ID_SSC1 17 /* Serial Synchronous Controller 1 */ | ||
37 | #define AT91SAM9263_ID_AC97C 18 /* AC97 Controller */ | ||
38 | #define AT91SAM9263_ID_TCB 19 /* Timer Counter 0, 1 and 2 */ | ||
39 | #define AT91SAM9263_ID_PWMC 20 /* Pulse Width Modulation Controller */ | ||
40 | #define AT91SAM9263_ID_EMAC 21 /* Ethernet */ | ||
41 | #define AT91SAM9263_ID_2DGE 23 /* 2D Graphic Engine */ | ||
42 | #define AT91SAM9263_ID_UDP 24 /* USB Device Port */ | ||
43 | #define AT91SAM9263_ID_ISI 25 /* Image Sensor Interface */ | ||
44 | #define AT91SAM9263_ID_LCDC 26 /* LCD Controller */ | ||
45 | #define AT91SAM9263_ID_DMA 27 /* DMA Controller */ | ||
46 | #define AT91SAM9263_ID_UHP 29 /* USB Host port */ | ||
47 | #define AT91SAM9263_ID_IRQ0 30 /* Advanced Interrupt Controller (IRQ0) */ | ||
48 | #define AT91SAM9263_ID_IRQ1 31 /* Advanced Interrupt Controller (IRQ1) */ | ||
49 | |||
50 | |||
51 | /* | ||
52 | * User Peripheral physical base addresses. | ||
53 | */ | ||
54 | #define AT91SAM9263_BASE_UDP 0xfff78000 | ||
55 | #define AT91SAM9263_BASE_TCB0 0xfff7c000 | ||
56 | #define AT91SAM9263_BASE_TC0 0xfff7c000 | ||
57 | #define AT91SAM9263_BASE_TC1 0xfff7c040 | ||
58 | #define AT91SAM9263_BASE_TC2 0xfff7c080 | ||
59 | #define AT91SAM9263_BASE_MCI0 0xfff80000 | ||
60 | #define AT91SAM9263_BASE_MCI1 0xfff84000 | ||
61 | #define AT91SAM9263_BASE_TWI 0xfff88000 | ||
62 | #define AT91SAM9263_BASE_US0 0xfff8c000 | ||
63 | #define AT91SAM9263_BASE_US1 0xfff90000 | ||
64 | #define AT91SAM9263_BASE_US2 0xfff94000 | ||
65 | #define AT91SAM9263_BASE_SSC0 0xfff98000 | ||
66 | #define AT91SAM9263_BASE_SSC1 0xfff9c000 | ||
67 | #define AT91SAM9263_BASE_AC97C 0xfffa0000 | ||
68 | #define AT91SAM9263_BASE_SPI0 0xfffa4000 | ||
69 | #define AT91SAM9263_BASE_SPI1 0xfffa8000 | ||
70 | #define AT91SAM9263_BASE_CAN 0xfffac000 | ||
71 | #define AT91SAM9263_BASE_PWMC 0xfffb8000 | ||
72 | #define AT91SAM9263_BASE_EMAC 0xfffbc000 | ||
73 | #define AT91SAM9263_BASE_ISI 0xfffc4000 | ||
74 | #define AT91SAM9263_BASE_2DGE 0xfffc8000 | ||
75 | #define AT91_BASE_SYS 0xffffe000 | ||
76 | |||
77 | /* | ||
78 | * System Peripherals (offset from AT91_BASE_SYS) | ||
79 | */ | ||
80 | #define AT91_ECC0 (0xffffe000 - AT91_BASE_SYS) | ||
81 | #define AT91_SDRAMC0 (0xffffe200 - AT91_BASE_SYS) | ||
82 | #define AT91_SMC0 (0xffffe400 - AT91_BASE_SYS) | ||
83 | #define AT91_ECC1 (0xffffe600 - AT91_BASE_SYS) | ||
84 | #define AT91_SDRAMC1 (0xffffe800 - AT91_BASE_SYS) | ||
85 | #define AT91_SMC1 (0xffffea00 - AT91_BASE_SYS) | ||
86 | #define AT91_MATRIX (0xffffec00 - AT91_BASE_SYS) | ||
87 | #define AT91_CCFG (0xffffed10 - AT91_BASE_SYS) | ||
88 | #define AT91_DBGU (0xffffee00 - AT91_BASE_SYS) | ||
89 | #define AT91_AIC (0xfffff000 - AT91_BASE_SYS) | ||
90 | #define AT91_PIOA (0xfffff200 - AT91_BASE_SYS) | ||
91 | #define AT91_PIOB (0xfffff400 - AT91_BASE_SYS) | ||
92 | #define AT91_PIOC (0xfffff600 - AT91_BASE_SYS) | ||
93 | #define AT91_PIOD (0xfffff800 - AT91_BASE_SYS) | ||
94 | #define AT91_PIOE (0xfffffa00 - AT91_BASE_SYS) | ||
95 | #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) | ||
96 | #define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS) | ||
97 | #define AT91_SHDWC (0xfffffd10 - AT91_BASE_SYS) | ||
98 | #define AT91_RTT0 (0xfffffd20 - AT91_BASE_SYS) | ||
99 | #define AT91_PIT (0xfffffd30 - AT91_BASE_SYS) | ||
100 | #define AT91_WDT (0xfffffd40 - AT91_BASE_SYS) | ||
101 | #define AT91_RTT1 (0xfffffd50 - AT91_BASE_SYS) | ||
102 | #define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS) | ||
103 | |||
104 | #define AT91_SMC AT91_SMC0 | ||
105 | |||
106 | /* | ||
107 | * Internal Memory. | ||
108 | */ | ||
109 | #define AT91SAM9263_SRAM0_BASE 0x00300000 /* Internal SRAM 0 base address */ | ||
110 | #define AT91SAM9263_SRAM0_SIZE (80 * SZ_1K) /* Internal SRAM 0 size (80Kb) */ | ||
111 | |||
112 | #define AT91SAM9263_ROM_BASE 0x00400000 /* Internal ROM base address */ | ||
113 | #define AT91SAM9263_ROM_SIZE SZ_128K /* Internal ROM size (128Kb) */ | ||
114 | |||
115 | #define AT91SAM9263_SRAM1_BASE 0x00500000 /* Internal SRAM 1 base address */ | ||
116 | #define AT91SAM9263_SRAM1_SIZE SZ_16K /* Internal SRAM 1 size (16Kb) */ | ||
117 | |||
118 | #define AT91SAM9263_LCDC_BASE 0x00700000 /* LCD Controller */ | ||
119 | #define AT91SAM9263_DMAC_BASE 0x00800000 /* DMA Controller */ | ||
120 | #define AT91SAM9263_UHP_BASE 0x00a00000 /* USB Host controller */ | ||
121 | |||
122 | #if 0 | ||
123 | /* | ||
124 | * PIO pin definitions (peripheral A/B multiplexing). | ||
125 | */ | ||
126 | |||
127 | // TODO: Add | ||
128 | |||
129 | #endif | ||
130 | |||
131 | #endif | ||
diff --git a/include/asm-arm/arch-at91/at91sam9263_matrix.h b/include/asm-arm/arch-at91/at91sam9263_matrix.h new file mode 100644 index 000000000000..6fc6e4be624e --- /dev/null +++ b/include/asm-arm/arch-at91/at91sam9263_matrix.h | |||
@@ -0,0 +1,129 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-at91/at91sam9263_matrix.h | ||
3 | * | ||
4 | * Copyright (C) 2006 Atmel Corporation. | ||
5 | * | ||
6 | * Memory Controllers (MATRIX, EBI) - System peripherals registers. | ||
7 | * Based on AT91SAM9263 datasheet revision B (Preliminary). | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | */ | ||
14 | |||
15 | #ifndef AT91SAM9263_MATRIX_H | ||
16 | #define AT91SAM9263_MATRIX_H | ||
17 | |||
18 | #define AT91_MATRIX_MCFG0 (AT91_MATRIX + 0x00) /* Master Configuration Register 0 */ | ||
19 | #define AT91_MATRIX_MCFG1 (AT91_MATRIX + 0x04) /* Master Configuration Register 1 */ | ||
20 | #define AT91_MATRIX_MCFG2 (AT91_MATRIX + 0x08) /* Master Configuration Register 2 */ | ||
21 | #define AT91_MATRIX_MCFG3 (AT91_MATRIX + 0x0C) /* Master Configuration Register 3 */ | ||
22 | #define AT91_MATRIX_MCFG4 (AT91_MATRIX + 0x10) /* Master Configuration Register 4 */ | ||
23 | #define AT91_MATRIX_MCFG5 (AT91_MATRIX + 0x14) /* Master Configuration Register 5 */ | ||
24 | #define AT91_MATRIX_MCFG6 (AT91_MATRIX + 0x18) /* Master Configuration Register 6 */ | ||
25 | #define AT91_MATRIX_MCFG7 (AT91_MATRIX + 0x1C) /* Master Configuration Register 7 */ | ||
26 | #define AT91_MATRIX_MCFG8 (AT91_MATRIX + 0x20) /* Master Configuration Register 8 */ | ||
27 | #define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */ | ||
28 | #define AT91_MATRIX_ULBT_INFINITE (0 << 0) | ||
29 | #define AT91_MATRIX_ULBT_SINGLE (1 << 0) | ||
30 | #define AT91_MATRIX_ULBT_FOUR (2 << 0) | ||
31 | #define AT91_MATRIX_ULBT_EIGHT (3 << 0) | ||
32 | #define AT91_MATRIX_ULBT_SIXTEEN (4 << 0) | ||
33 | |||
34 | #define AT91_MATRIX_SCFG0 (AT91_MATRIX + 0x40) /* Slave Configuration Register 0 */ | ||
35 | #define AT91_MATRIX_SCFG1 (AT91_MATRIX + 0x44) /* Slave Configuration Register 1 */ | ||
36 | #define AT91_MATRIX_SCFG2 (AT91_MATRIX + 0x48) /* Slave Configuration Register 2 */ | ||
37 | #define AT91_MATRIX_SCFG3 (AT91_MATRIX + 0x4C) /* Slave Configuration Register 3 */ | ||
38 | #define AT91_MATRIX_SCFG4 (AT91_MATRIX + 0x50) /* Slave Configuration Register 4 */ | ||
39 | #define AT91_MATRIX_SCFG5 (AT91_MATRIX + 0x54) /* Slave Configuration Register 5 */ | ||
40 | #define AT91_MATRIX_SCFG6 (AT91_MATRIX + 0x58) /* Slave Configuration Register 6 */ | ||
41 | #define AT91_MATRIX_SCFG7 (AT91_MATRIX + 0x5C) /* Slave Configuration Register 7 */ | ||
42 | #define AT91_MATRIX_SLOT_CYCLE (0xff << 0) /* Maximum Number of Allowed Cycles for a Burst */ | ||
43 | #define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */ | ||
44 | #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) | ||
45 | #define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16) | ||
46 | #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) | ||
47 | #define AT91_MATRIX_FIXED_DEFMSTR (7 << 18) /* Fixed Index of Default Master */ | ||
48 | #define AT91_MATRIX_ARBT (3 << 24) /* Arbitration Type */ | ||
49 | #define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24) | ||
50 | #define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24) | ||
51 | |||
52 | #define AT91_MATRIX_PRAS0 (AT91_MATRIX + 0x80) /* Priority Register A for Slave 0 */ | ||
53 | #define AT91_MATRIX_PRBS0 (AT91_MATRIX + 0x84) /* Priority Register B for Slave 0 */ | ||
54 | #define AT91_MATRIX_PRAS1 (AT91_MATRIX + 0x88) /* Priority Register A for Slave 1 */ | ||
55 | #define AT91_MATRIX_PRBS1 (AT91_MATRIX + 0x8C) /* Priority Register B for Slave 1 */ | ||
56 | #define AT91_MATRIX_PRAS2 (AT91_MATRIX + 0x90) /* Priority Register A for Slave 2 */ | ||
57 | #define AT91_MATRIX_PRBS2 (AT91_MATRIX + 0x94) /* Priority Register B for Slave 2 */ | ||
58 | #define AT91_MATRIX_PRAS3 (AT91_MATRIX + 0x98) /* Priority Register A for Slave 3 */ | ||
59 | #define AT91_MATRIX_PRBS3 (AT91_MATRIX + 0x9C) /* Priority Register B for Slave 3 */ | ||
60 | #define AT91_MATRIX_PRAS4 (AT91_MATRIX + 0xA0) /* Priority Register A for Slave 4 */ | ||
61 | #define AT91_MATRIX_PRBS4 (AT91_MATRIX + 0xA4) /* Priority Register B for Slave 4 */ | ||
62 | #define AT91_MATRIX_PRAS5 (AT91_MATRIX + 0xA8) /* Priority Register A for Slave 5 */ | ||
63 | #define AT91_MATRIX_PRBS5 (AT91_MATRIX + 0xAC) /* Priority Register B for Slave 5 */ | ||
64 | #define AT91_MATRIX_PRAS6 (AT91_MATRIX + 0xB0) /* Priority Register A for Slave 6 */ | ||
65 | #define AT91_MATRIX_PRBS6 (AT91_MATRIX + 0xB4) /* Priority Register B for Slave 6 */ | ||
66 | #define AT91_MATRIX_PRAS7 (AT91_MATRIX + 0xB8) /* Priority Register A for Slave 7 */ | ||
67 | #define AT91_MATRIX_PRBS7 (AT91_MATRIX + 0xBC) /* Priority Register B for Slave 7 */ | ||
68 | #define AT91_MATRIX_M0PR (3 << 0) /* Master 0 Priority */ | ||
69 | #define AT91_MATRIX_M1PR (3 << 4) /* Master 1 Priority */ | ||
70 | #define AT91_MATRIX_M2PR (3 << 8) /* Master 2 Priority */ | ||
71 | #define AT91_MATRIX_M3PR (3 << 12) /* Master 3 Priority */ | ||
72 | #define AT91_MATRIX_M4PR (3 << 16) /* Master 4 Priority */ | ||
73 | #define AT91_MATRIX_M5PR (3 << 20) /* Master 5 Priority */ | ||
74 | #define AT91_MATRIX_M6PR (3 << 24) /* Master 6 Priority */ | ||
75 | #define AT91_MATRIX_M7PR (3 << 28) /* Master 7 Priority */ | ||
76 | #define AT91_MATRIX_M8PR (3 << 0) /* Master 8 Priority (in Register B) */ | ||
77 | |||
78 | #define AT91_MATRIX_MRCR (AT91_MATRIX + 0x100) /* Master Remap Control Register */ | ||
79 | #define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ | ||
80 | #define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ | ||
81 | #define AT91_MATRIX_RCB2 (1 << 2) | ||
82 | #define AT91_MATRIX_RCB3 (1 << 3) | ||
83 | #define AT91_MATRIX_RCB4 (1 << 4) | ||
84 | #define AT91_MATRIX_RCB5 (1 << 5) | ||
85 | #define AT91_MATRIX_RCB6 (1 << 6) | ||
86 | #define AT91_MATRIX_RCB7 (1 << 7) | ||
87 | #define AT91_MATRIX_RCB8 (1 << 8) | ||
88 | |||
89 | #define AT91_MATRIX_TCMR (AT91_MATRIX + 0x114) /* TCM Configuration Register */ | ||
90 | #define AT91_MATRIX_ITCM_SIZE (0xf << 0) /* Size of ITCM enabled memory block */ | ||
91 | #define AT91_MATRIX_ITCM_0 (0 << 0) | ||
92 | #define AT91_MATRIX_ITCM_16 (5 << 0) | ||
93 | #define AT91_MATRIX_ITCM_32 (6 << 0) | ||
94 | #define AT91_MATRIX_DTCM_SIZE (0xf << 4) /* Size of DTCM enabled memory block */ | ||
95 | #define AT91_MATRIX_DTCM_0 (0 << 4) | ||
96 | #define AT91_MATRIX_DTCM_16 (5 << 4) | ||
97 | #define AT91_MATRIX_DTCM_32 (6 << 4) | ||
98 | |||
99 | #define AT91_MATRIX_EBI0CSA (AT91_MATRIX + 0x120) /* EBI0 Chip Select Assignment Register */ | ||
100 | #define AT91_MATRIX_EBI0_CS1A (1 << 1) /* Chip Select 1 Assignment */ | ||
101 | #define AT91_MATRIX_EBI0_CS1A_SMC (0 << 1) | ||
102 | #define AT91_MATRIX_EBI0_CS1A_SDRAMC (1 << 1) | ||
103 | #define AT91_MATRIX_EBI0_CS3A (1 << 3) /* Chip Select 3 Assignment */ | ||
104 | #define AT91_MATRIX_EBI0_CS3A_SMC (0 << 3) | ||
105 | #define AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA (1 << 3) | ||
106 | #define AT91_MATRIX_EBI0_CS4A (1 << 4) /* Chip Select 4 Assignment */ | ||
107 | #define AT91_MATRIX_EBI0_CS4A_SMC (0 << 4) | ||
108 | #define AT91_MATRIX_EBI0_CS4A_SMC_CF1 (1 << 4) | ||
109 | #define AT91_MATRIX_EBI0_CS5A (1 << 5) /* Chip Select 5 Assignment */ | ||
110 | #define AT91_MATRIX_EBI0_CS5A_SMC (0 << 5) | ||
111 | #define AT91_MATRIX_EBI0_CS5A_SMC_CF2 (1 << 5) | ||
112 | #define AT91_MATRIX_EBI0_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ | ||
113 | #define AT91_MATRIX_EBI0_VDDIOMSEL (1 << 16) /* Memory voltage selection */ | ||
114 | #define AT91_MATRIX_EBI0_VDDIOMSEL_1_8V (0 << 16) | ||
115 | #define AT91_MATRIX_EBI0_VDDIOMSEL_3_3V (1 << 16) | ||
116 | |||
117 | #define AT91_MATRIX_EBI1CSA (AT91_MATRIX + 0x124) /* EBI1 Chip Select Assignment Register */ | ||
118 | #define AT91_MATRIX_EBI1_CS1A (1 << 1) /* Chip Select 1 Assignment */ | ||
119 | #define AT91_MATRIX_EBI1_CS1A_SMC (0 << 1) | ||
120 | #define AT91_MATRIX_EBI1_CS1A_SDRAMC (1 << 1) | ||
121 | #define AT91_MATRIX_EBI1_CS2A (1 << 3) /* Chip Select 3 Assignment */ | ||
122 | #define AT91_MATRIX_EBI1_CS2A_SMC (0 << 3) | ||
123 | #define AT91_MATRIX_EBI1_CS2A_SMC_SMARTMEDIA (1 << 3) | ||
124 | #define AT91_MATRIX_EBI1_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ | ||
125 | #define AT91_MATRIX_EBI1_VDDIOMSEL (1 << 16) /* Memory voltage selection */ | ||
126 | #define AT91_MATRIX_EBI1_VDDIOMSEL_1_8V (0 << 16) | ||
127 | #define AT91_MATRIX_EBI1_VDDIOMSEL_3_3V (1 << 16) | ||
128 | |||
129 | #endif | ||
diff --git a/include/asm-arm/arch-at91rm9200/at91sam926x_mc.h b/include/asm-arm/arch-at91/at91sam926x_mc.h index 972e7531c7f4..d82631c251f1 100644 --- a/include/asm-arm/arch-at91rm9200/at91sam926x_mc.h +++ b/include/asm-arm/arch-at91/at91sam926x_mc.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/at91sam926x_mc.h | 2 | * include/asm-arm/arch-at91/at91sam926x_mc.h |
3 | * | 3 | * |
4 | * Memory Controllers (SMC, SDRAMC) - System peripherals registers. | 4 | * Memory Controllers (SMC, SDRAMC) - System peripherals registers. |
5 | * Based on AT91SAM9261 datasheet revision D. | 5 | * Based on AT91SAM9261 datasheet revision D. |
@@ -131,4 +131,11 @@ | |||
131 | #define AT91_SMC_PS_16 (2 << 28) | 131 | #define AT91_SMC_PS_16 (2 << 28) |
132 | #define AT91_SMC_PS_32 (3 << 28) | 132 | #define AT91_SMC_PS_32 (3 << 28) |
133 | 133 | ||
134 | #if defined(AT91_SMC1) /* The AT91SAM9263 has 2 Static Memory contollers */ | ||
135 | #define AT91_SMC1_SETUP(n) (AT91_SMC1 + 0x00 + ((n)*0x10)) /* Setup Register for CS n */ | ||
136 | #define AT91_SMC1_PULSE(n) (AT91_SMC1 + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */ | ||
137 | #define AT91_SMC1_CYCLE(n) (AT91_SMC1 + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */ | ||
138 | #define AT91_SMC1_MODE(n) (AT91_SMC1 + 0x0c + ((n)*0x10)) /* Mode Register for CS n */ | ||
139 | #endif | ||
140 | |||
134 | #endif | 141 | #endif |
diff --git a/include/asm-arm/arch-at91rm9200/board.h b/include/asm-arm/arch-at91/board.h index 768e0fc6aa2f..7b9903c2c447 100644 --- a/include/asm-arm/arch-at91rm9200/board.h +++ b/include/asm-arm/arch-at91/board.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/board.h | 2 | * include/asm-arm/arch-at91/board.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 HP Labs | 4 | * Copyright (C) 2005 HP Labs |
5 | * | 5 | * |
@@ -60,7 +60,7 @@ struct at91_mmc_data { | |||
60 | u8 wp_pin; /* (SD) writeprotect detect */ | 60 | u8 wp_pin; /* (SD) writeprotect detect */ |
61 | u8 vcc_pin; /* power switching (high == on) */ | 61 | u8 vcc_pin; /* power switching (high == on) */ |
62 | }; | 62 | }; |
63 | extern void __init at91_add_device_mmc(struct at91_mmc_data *data); | 63 | extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data); |
64 | 64 | ||
65 | /* Ethernet */ | 65 | /* Ethernet */ |
66 | struct at91_eth_data { | 66 | struct at91_eth_data { |
@@ -69,9 +69,14 @@ struct at91_eth_data { | |||
69 | }; | 69 | }; |
70 | extern void __init at91_add_device_eth(struct at91_eth_data *data); | 70 | extern void __init at91_add_device_eth(struct at91_eth_data *data); |
71 | 71 | ||
72 | #if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9263) | ||
73 | #define eth_platform_data at91_eth_data | ||
74 | #endif | ||
75 | |||
72 | /* USB Host */ | 76 | /* USB Host */ |
73 | struct at91_usbh_data { | 77 | struct at91_usbh_data { |
74 | u8 ports; /* number of ports on root hub */ | 78 | u8 ports; /* number of ports on root hub */ |
79 | u8 vbus_pin[]; /* port power-control pin */ | ||
75 | }; | 80 | }; |
76 | extern void __init at91_add_device_usbh(struct at91_usbh_data *data); | 81 | extern void __init at91_add_device_usbh(struct at91_usbh_data *data); |
77 | 82 | ||
diff --git a/include/asm-arm/arch-at91rm9200/cpu.h b/include/asm-arm/arch-at91/cpu.h index 6f8d09b08692..d464ca58cdbc 100644 --- a/include/asm-arm/arch-at91rm9200/cpu.h +++ b/include/asm-arm/arch-at91/cpu.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/cpu.h | 2 | * include/asm-arm/arch-at91/cpu.h |
3 | * | 3 | * |
4 | * Copyright (C) 2006 SAN People | 4 | * Copyright (C) 2006 SAN People |
5 | * | 5 | * |
@@ -20,7 +20,11 @@ | |||
20 | #define ARCH_ID_AT91RM9200 0x09290780 | 20 | #define ARCH_ID_AT91RM9200 0x09290780 |
21 | #define ARCH_ID_AT91SAM9260 0x019803a0 | 21 | #define ARCH_ID_AT91SAM9260 0x019803a0 |
22 | #define ARCH_ID_AT91SAM9261 0x019703a0 | 22 | #define ARCH_ID_AT91SAM9261 0x019703a0 |
23 | #define ARCH_ID_AT91SAM9263 0x019607a0 | ||
23 | 24 | ||
25 | #define ARCH_ID_AT91SAM9XE128 0x329973a0 | ||
26 | #define ARCH_ID_AT91SAM9XE256 0x329a93a0 | ||
27 | #define ARCH_ID_AT91SAM9XE512 0x329aa3a0 | ||
24 | 28 | ||
25 | static inline unsigned long at91_cpu_identify(void) | 29 | static inline unsigned long at91_cpu_identify(void) |
26 | { | 30 | { |
@@ -28,6 +32,16 @@ static inline unsigned long at91_cpu_identify(void) | |||
28 | } | 32 | } |
29 | 33 | ||
30 | 34 | ||
35 | #define ARCH_FAMILY_AT91X92 0x09200000 | ||
36 | #define ARCH_FAMILY_AT91SAM9 0x01900000 | ||
37 | #define ARCH_FAMILY_AT91SAM9XE 0x02900000 | ||
38 | |||
39 | static inline unsigned long at91_arch_identify(void) | ||
40 | { | ||
41 | return (at91_sys_read(AT91_DBGU_CIDR) & AT91_CIDR_ARCH); | ||
42 | } | ||
43 | |||
44 | |||
31 | #ifdef CONFIG_ARCH_AT91RM9200 | 45 | #ifdef CONFIG_ARCH_AT91RM9200 |
32 | #define cpu_is_at91rm9200() (at91_cpu_identify() == ARCH_ID_AT91RM9200) | 46 | #define cpu_is_at91rm9200() (at91_cpu_identify() == ARCH_ID_AT91RM9200) |
33 | #else | 47 | #else |
@@ -35,8 +49,10 @@ static inline unsigned long at91_cpu_identify(void) | |||
35 | #endif | 49 | #endif |
36 | 50 | ||
37 | #ifdef CONFIG_ARCH_AT91SAM9260 | 51 | #ifdef CONFIG_ARCH_AT91SAM9260 |
38 | #define cpu_is_at91sam9260() (at91_cpu_identify() == ARCH_ID_AT91SAM9260) | 52 | #define cpu_is_at91sam9xe() (at91_arch_identify() == ARCH_FAMILY_AT91SAM9XE) |
53 | #define cpu_is_at91sam9260() ((at91_cpu_identify() == ARCH_ID_AT91SAM9260) || cpu_is_at91sam9xe()) | ||
39 | #else | 54 | #else |
55 | #define cpu_is_at91sam9xe() (0) | ||
40 | #define cpu_is_at91sam9260() (0) | 56 | #define cpu_is_at91sam9260() (0) |
41 | #endif | 57 | #endif |
42 | 58 | ||
@@ -46,4 +62,10 @@ static inline unsigned long at91_cpu_identify(void) | |||
46 | #define cpu_is_at91sam9261() (0) | 62 | #define cpu_is_at91sam9261() (0) |
47 | #endif | 63 | #endif |
48 | 64 | ||
65 | #ifdef CONFIG_ARCH_AT91SAM9263 | ||
66 | #define cpu_is_at91sam9263() (at91_cpu_identify() == ARCH_ID_AT91SAM9263) | ||
67 | #else | ||
68 | #define cpu_is_at91sam9263() (0) | ||
69 | #endif | ||
70 | |||
49 | #endif | 71 | #endif |
diff --git a/include/asm-arm/arch-at91/debug-macro.S b/include/asm-arm/arch-at91/debug-macro.S new file mode 100644 index 000000000000..13e9f5e1d4ff --- /dev/null +++ b/include/asm-arm/arch-at91/debug-macro.S | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-at91/debug-macro.S | ||
3 | * | ||
4 | * Copyright (C) 2003-2005 SAN People | ||
5 | * | ||
6 | * Debugging macro include header | ||
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 | |||
14 | #include <asm/hardware.h> | ||
15 | #include <asm/arch/at91_dbgu.h> | ||
16 | |||
17 | .macro addruart,rx | ||
18 | mrc p15, 0, \rx, c1, c0 | ||
19 | tst \rx, #1 @ MMU enabled? | ||
20 | ldreq \rx, =(AT91_BASE_SYS + AT91_DBGU) @ System peripherals (phys address) | ||
21 | ldrne \rx, =(AT91_VA_BASE_SYS + AT91_DBGU) @ System peripherals (virt address) | ||
22 | .endm | ||
23 | |||
24 | .macro senduart,rd,rx | ||
25 | strb \rd, [\rx, #(AT91_DBGU_THR - AT91_DBGU)] @ Write to Transmitter Holding Register | ||
26 | .endm | ||
27 | |||
28 | .macro waituart,rd,rx | ||
29 | 1001: ldr \rd, [\rx, #(AT91_DBGU_SR - AT91_DBGU)] @ Read Status Register | ||
30 | tst \rd, #AT91_DBGU_TXRDY @ DBGU_TXRDY = 1 when ready to transmit | ||
31 | beq 1001b | ||
32 | .endm | ||
33 | |||
34 | .macro busyuart,rd,rx | ||
35 | 1001: ldr \rd, [\rx, #(AT91_DBGU_SR - AT91_DBGU)] @ Read Status Register | ||
36 | tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete | ||
37 | beq 1001b | ||
38 | .endm | ||
39 | |||
diff --git a/include/asm-arm/arch-at91rm9200/dma.h b/include/asm-arm/arch-at91/dma.h index 22c1dfdd8da3..774565412beb 100644 --- a/include/asm-arm/arch-at91rm9200/dma.h +++ b/include/asm-arm/arch-at91/dma.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/dma.h | 2 | * include/asm-arm/arch-at91/dma.h |
3 | * | 3 | * |
4 | * Copyright (C) 2003 SAN People | 4 | * Copyright (C) 2003 SAN People |
5 | * | 5 | * |
diff --git a/include/asm-arm/arch-at91/entry-macro.S b/include/asm-arm/arch-at91/entry-macro.S new file mode 100644 index 000000000000..cc1d850a0788 --- /dev/null +++ b/include/asm-arm/arch-at91/entry-macro.S | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-at91/entry-macro.S | ||
3 | * | ||
4 | * Copyright (C) 2003-2005 SAN People | ||
5 | * | ||
6 | * Low-level IRQ helper macros for AT91RM9200 platforms | ||
7 | * | ||
8 | * This file is licensed under the terms of the GNU General Public | ||
9 | * License version 2. This program is licensed "as is" without any | ||
10 | * warranty of any kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #include <asm/hardware.h> | ||
14 | #include <asm/arch/at91_aic.h> | ||
15 | |||
16 | .macro disable_fiq | ||
17 | .endm | ||
18 | |||
19 | .macro get_irqnr_preamble, base, tmp | ||
20 | .endm | ||
21 | |||
22 | .macro arch_ret_to_user, tmp1, tmp2 | ||
23 | .endm | ||
24 | |||
25 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
26 | ldr \base, =(AT91_VA_BASE_SYS + AT91_AIC) @ base virtual address of AIC peripheral | ||
27 | ldr \irqnr, [\base, #(AT91_AIC_IVR - AT91_AIC)] @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt) | ||
28 | ldr \irqstat, [\base, #(AT91_AIC_ISR - AT91_AIC)] @ read interrupt source number | ||
29 | teq \irqstat, #0 @ ISR is 0 when no current interrupt, or spurious interrupt | ||
30 | streq \tmp, [\base, #(AT91_AIC_EOICR - AT91_AIC)] @ not going to be handled further, then ACK it now. | ||
31 | .endm | ||
32 | |||
diff --git a/include/asm-arm/arch-at91rm9200/gpio.h b/include/asm-arm/arch-at91/gpio.h index e09d6528fadf..98ad2114f43a 100644 --- a/include/asm-arm/arch-at91rm9200/gpio.h +++ b/include/asm-arm/arch-at91/gpio.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/gpio.h | 2 | * include/asm-arm/arch-at91/gpio.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 HP Labs | 4 | * Copyright (C) 2005 HP Labs |
5 | * | 5 | * |
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | #define PIN_BASE NR_AIC_IRQS | 18 | #define PIN_BASE NR_AIC_IRQS |
19 | 19 | ||
20 | #define MAX_GPIO_BANKS 4 | 20 | #define MAX_GPIO_BANKS 5 |
21 | 21 | ||
22 | /* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */ | 22 | /* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */ |
23 | 23 | ||
@@ -26,37 +26,31 @@ | |||
26 | #define AT91_PIN_PA2 (PIN_BASE + 0x00 + 2) | 26 | #define AT91_PIN_PA2 (PIN_BASE + 0x00 + 2) |
27 | #define AT91_PIN_PA3 (PIN_BASE + 0x00 + 3) | 27 | #define AT91_PIN_PA3 (PIN_BASE + 0x00 + 3) |
28 | #define AT91_PIN_PA4 (PIN_BASE + 0x00 + 4) | 28 | #define AT91_PIN_PA4 (PIN_BASE + 0x00 + 4) |
29 | |||
30 | #define AT91_PIN_PA5 (PIN_BASE + 0x00 + 5) | 29 | #define AT91_PIN_PA5 (PIN_BASE + 0x00 + 5) |
31 | #define AT91_PIN_PA6 (PIN_BASE + 0x00 + 6) | 30 | #define AT91_PIN_PA6 (PIN_BASE + 0x00 + 6) |
32 | #define AT91_PIN_PA7 (PIN_BASE + 0x00 + 7) | 31 | #define AT91_PIN_PA7 (PIN_BASE + 0x00 + 7) |
33 | #define AT91_PIN_PA8 (PIN_BASE + 0x00 + 8) | 32 | #define AT91_PIN_PA8 (PIN_BASE + 0x00 + 8) |
34 | #define AT91_PIN_PA9 (PIN_BASE + 0x00 + 9) | 33 | #define AT91_PIN_PA9 (PIN_BASE + 0x00 + 9) |
35 | |||
36 | #define AT91_PIN_PA10 (PIN_BASE + 0x00 + 10) | 34 | #define AT91_PIN_PA10 (PIN_BASE + 0x00 + 10) |
37 | #define AT91_PIN_PA11 (PIN_BASE + 0x00 + 11) | 35 | #define AT91_PIN_PA11 (PIN_BASE + 0x00 + 11) |
38 | #define AT91_PIN_PA12 (PIN_BASE + 0x00 + 12) | 36 | #define AT91_PIN_PA12 (PIN_BASE + 0x00 + 12) |
39 | #define AT91_PIN_PA13 (PIN_BASE + 0x00 + 13) | 37 | #define AT91_PIN_PA13 (PIN_BASE + 0x00 + 13) |
40 | #define AT91_PIN_PA14 (PIN_BASE + 0x00 + 14) | 38 | #define AT91_PIN_PA14 (PIN_BASE + 0x00 + 14) |
41 | |||
42 | #define AT91_PIN_PA15 (PIN_BASE + 0x00 + 15) | 39 | #define AT91_PIN_PA15 (PIN_BASE + 0x00 + 15) |
43 | #define AT91_PIN_PA16 (PIN_BASE + 0x00 + 16) | 40 | #define AT91_PIN_PA16 (PIN_BASE + 0x00 + 16) |
44 | #define AT91_PIN_PA17 (PIN_BASE + 0x00 + 17) | 41 | #define AT91_PIN_PA17 (PIN_BASE + 0x00 + 17) |
45 | #define AT91_PIN_PA18 (PIN_BASE + 0x00 + 18) | 42 | #define AT91_PIN_PA18 (PIN_BASE + 0x00 + 18) |
46 | #define AT91_PIN_PA19 (PIN_BASE + 0x00 + 19) | 43 | #define AT91_PIN_PA19 (PIN_BASE + 0x00 + 19) |
47 | |||
48 | #define AT91_PIN_PA20 (PIN_BASE + 0x00 + 20) | 44 | #define AT91_PIN_PA20 (PIN_BASE + 0x00 + 20) |
49 | #define AT91_PIN_PA21 (PIN_BASE + 0x00 + 21) | 45 | #define AT91_PIN_PA21 (PIN_BASE + 0x00 + 21) |
50 | #define AT91_PIN_PA22 (PIN_BASE + 0x00 + 22) | 46 | #define AT91_PIN_PA22 (PIN_BASE + 0x00 + 22) |
51 | #define AT91_PIN_PA23 (PIN_BASE + 0x00 + 23) | 47 | #define AT91_PIN_PA23 (PIN_BASE + 0x00 + 23) |
52 | #define AT91_PIN_PA24 (PIN_BASE + 0x00 + 24) | 48 | #define AT91_PIN_PA24 (PIN_BASE + 0x00 + 24) |
53 | |||
54 | #define AT91_PIN_PA25 (PIN_BASE + 0x00 + 25) | 49 | #define AT91_PIN_PA25 (PIN_BASE + 0x00 + 25) |
55 | #define AT91_PIN_PA26 (PIN_BASE + 0x00 + 26) | 50 | #define AT91_PIN_PA26 (PIN_BASE + 0x00 + 26) |
56 | #define AT91_PIN_PA27 (PIN_BASE + 0x00 + 27) | 51 | #define AT91_PIN_PA27 (PIN_BASE + 0x00 + 27) |
57 | #define AT91_PIN_PA28 (PIN_BASE + 0x00 + 28) | 52 | #define AT91_PIN_PA28 (PIN_BASE + 0x00 + 28) |
58 | #define AT91_PIN_PA29 (PIN_BASE + 0x00 + 29) | 53 | #define AT91_PIN_PA29 (PIN_BASE + 0x00 + 29) |
59 | |||
60 | #define AT91_PIN_PA30 (PIN_BASE + 0x00 + 30) | 54 | #define AT91_PIN_PA30 (PIN_BASE + 0x00 + 30) |
61 | #define AT91_PIN_PA31 (PIN_BASE + 0x00 + 31) | 55 | #define AT91_PIN_PA31 (PIN_BASE + 0x00 + 31) |
62 | 56 | ||
@@ -65,37 +59,31 @@ | |||
65 | #define AT91_PIN_PB2 (PIN_BASE + 0x20 + 2) | 59 | #define AT91_PIN_PB2 (PIN_BASE + 0x20 + 2) |
66 | #define AT91_PIN_PB3 (PIN_BASE + 0x20 + 3) | 60 | #define AT91_PIN_PB3 (PIN_BASE + 0x20 + 3) |
67 | #define AT91_PIN_PB4 (PIN_BASE + 0x20 + 4) | 61 | #define AT91_PIN_PB4 (PIN_BASE + 0x20 + 4) |
68 | |||
69 | #define AT91_PIN_PB5 (PIN_BASE + 0x20 + 5) | 62 | #define AT91_PIN_PB5 (PIN_BASE + 0x20 + 5) |
70 | #define AT91_PIN_PB6 (PIN_BASE + 0x20 + 6) | 63 | #define AT91_PIN_PB6 (PIN_BASE + 0x20 + 6) |
71 | #define AT91_PIN_PB7 (PIN_BASE + 0x20 + 7) | 64 | #define AT91_PIN_PB7 (PIN_BASE + 0x20 + 7) |
72 | #define AT91_PIN_PB8 (PIN_BASE + 0x20 + 8) | 65 | #define AT91_PIN_PB8 (PIN_BASE + 0x20 + 8) |
73 | #define AT91_PIN_PB9 (PIN_BASE + 0x20 + 9) | 66 | #define AT91_PIN_PB9 (PIN_BASE + 0x20 + 9) |
74 | |||
75 | #define AT91_PIN_PB10 (PIN_BASE + 0x20 + 10) | 67 | #define AT91_PIN_PB10 (PIN_BASE + 0x20 + 10) |
76 | #define AT91_PIN_PB11 (PIN_BASE + 0x20 + 11) | 68 | #define AT91_PIN_PB11 (PIN_BASE + 0x20 + 11) |
77 | #define AT91_PIN_PB12 (PIN_BASE + 0x20 + 12) | 69 | #define AT91_PIN_PB12 (PIN_BASE + 0x20 + 12) |
78 | #define AT91_PIN_PB13 (PIN_BASE + 0x20 + 13) | 70 | #define AT91_PIN_PB13 (PIN_BASE + 0x20 + 13) |
79 | #define AT91_PIN_PB14 (PIN_BASE + 0x20 + 14) | 71 | #define AT91_PIN_PB14 (PIN_BASE + 0x20 + 14) |
80 | |||
81 | #define AT91_PIN_PB15 (PIN_BASE + 0x20 + 15) | 72 | #define AT91_PIN_PB15 (PIN_BASE + 0x20 + 15) |
82 | #define AT91_PIN_PB16 (PIN_BASE + 0x20 + 16) | 73 | #define AT91_PIN_PB16 (PIN_BASE + 0x20 + 16) |
83 | #define AT91_PIN_PB17 (PIN_BASE + 0x20 + 17) | 74 | #define AT91_PIN_PB17 (PIN_BASE + 0x20 + 17) |
84 | #define AT91_PIN_PB18 (PIN_BASE + 0x20 + 18) | 75 | #define AT91_PIN_PB18 (PIN_BASE + 0x20 + 18) |
85 | #define AT91_PIN_PB19 (PIN_BASE + 0x20 + 19) | 76 | #define AT91_PIN_PB19 (PIN_BASE + 0x20 + 19) |
86 | |||
87 | #define AT91_PIN_PB20 (PIN_BASE + 0x20 + 20) | 77 | #define AT91_PIN_PB20 (PIN_BASE + 0x20 + 20) |
88 | #define AT91_PIN_PB21 (PIN_BASE + 0x20 + 21) | 78 | #define AT91_PIN_PB21 (PIN_BASE + 0x20 + 21) |
89 | #define AT91_PIN_PB22 (PIN_BASE + 0x20 + 22) | 79 | #define AT91_PIN_PB22 (PIN_BASE + 0x20 + 22) |
90 | #define AT91_PIN_PB23 (PIN_BASE + 0x20 + 23) | 80 | #define AT91_PIN_PB23 (PIN_BASE + 0x20 + 23) |
91 | #define AT91_PIN_PB24 (PIN_BASE + 0x20 + 24) | 81 | #define AT91_PIN_PB24 (PIN_BASE + 0x20 + 24) |
92 | |||
93 | #define AT91_PIN_PB25 (PIN_BASE + 0x20 + 25) | 82 | #define AT91_PIN_PB25 (PIN_BASE + 0x20 + 25) |
94 | #define AT91_PIN_PB26 (PIN_BASE + 0x20 + 26) | 83 | #define AT91_PIN_PB26 (PIN_BASE + 0x20 + 26) |
95 | #define AT91_PIN_PB27 (PIN_BASE + 0x20 + 27) | 84 | #define AT91_PIN_PB27 (PIN_BASE + 0x20 + 27) |
96 | #define AT91_PIN_PB28 (PIN_BASE + 0x20 + 28) | 85 | #define AT91_PIN_PB28 (PIN_BASE + 0x20 + 28) |
97 | #define AT91_PIN_PB29 (PIN_BASE + 0x20 + 29) | 86 | #define AT91_PIN_PB29 (PIN_BASE + 0x20 + 29) |
98 | |||
99 | #define AT91_PIN_PB30 (PIN_BASE + 0x20 + 30) | 87 | #define AT91_PIN_PB30 (PIN_BASE + 0x20 + 30) |
100 | #define AT91_PIN_PB31 (PIN_BASE + 0x20 + 31) | 88 | #define AT91_PIN_PB31 (PIN_BASE + 0x20 + 31) |
101 | 89 | ||
@@ -104,37 +92,31 @@ | |||
104 | #define AT91_PIN_PC2 (PIN_BASE + 0x40 + 2) | 92 | #define AT91_PIN_PC2 (PIN_BASE + 0x40 + 2) |
105 | #define AT91_PIN_PC3 (PIN_BASE + 0x40 + 3) | 93 | #define AT91_PIN_PC3 (PIN_BASE + 0x40 + 3) |
106 | #define AT91_PIN_PC4 (PIN_BASE + 0x40 + 4) | 94 | #define AT91_PIN_PC4 (PIN_BASE + 0x40 + 4) |
107 | |||
108 | #define AT91_PIN_PC5 (PIN_BASE + 0x40 + 5) | 95 | #define AT91_PIN_PC5 (PIN_BASE + 0x40 + 5) |
109 | #define AT91_PIN_PC6 (PIN_BASE + 0x40 + 6) | 96 | #define AT91_PIN_PC6 (PIN_BASE + 0x40 + 6) |
110 | #define AT91_PIN_PC7 (PIN_BASE + 0x40 + 7) | 97 | #define AT91_PIN_PC7 (PIN_BASE + 0x40 + 7) |
111 | #define AT91_PIN_PC8 (PIN_BASE + 0x40 + 8) | 98 | #define AT91_PIN_PC8 (PIN_BASE + 0x40 + 8) |
112 | #define AT91_PIN_PC9 (PIN_BASE + 0x40 + 9) | 99 | #define AT91_PIN_PC9 (PIN_BASE + 0x40 + 9) |
113 | |||
114 | #define AT91_PIN_PC10 (PIN_BASE + 0x40 + 10) | 100 | #define AT91_PIN_PC10 (PIN_BASE + 0x40 + 10) |
115 | #define AT91_PIN_PC11 (PIN_BASE + 0x40 + 11) | 101 | #define AT91_PIN_PC11 (PIN_BASE + 0x40 + 11) |
116 | #define AT91_PIN_PC12 (PIN_BASE + 0x40 + 12) | 102 | #define AT91_PIN_PC12 (PIN_BASE + 0x40 + 12) |
117 | #define AT91_PIN_PC13 (PIN_BASE + 0x40 + 13) | 103 | #define AT91_PIN_PC13 (PIN_BASE + 0x40 + 13) |
118 | #define AT91_PIN_PC14 (PIN_BASE + 0x40 + 14) | 104 | #define AT91_PIN_PC14 (PIN_BASE + 0x40 + 14) |
119 | |||
120 | #define AT91_PIN_PC15 (PIN_BASE + 0x40 + 15) | 105 | #define AT91_PIN_PC15 (PIN_BASE + 0x40 + 15) |
121 | #define AT91_PIN_PC16 (PIN_BASE + 0x40 + 16) | 106 | #define AT91_PIN_PC16 (PIN_BASE + 0x40 + 16) |
122 | #define AT91_PIN_PC17 (PIN_BASE + 0x40 + 17) | 107 | #define AT91_PIN_PC17 (PIN_BASE + 0x40 + 17) |
123 | #define AT91_PIN_PC18 (PIN_BASE + 0x40 + 18) | 108 | #define AT91_PIN_PC18 (PIN_BASE + 0x40 + 18) |
124 | #define AT91_PIN_PC19 (PIN_BASE + 0x40 + 19) | 109 | #define AT91_PIN_PC19 (PIN_BASE + 0x40 + 19) |
125 | |||
126 | #define AT91_PIN_PC20 (PIN_BASE + 0x40 + 20) | 110 | #define AT91_PIN_PC20 (PIN_BASE + 0x40 + 20) |
127 | #define AT91_PIN_PC21 (PIN_BASE + 0x40 + 21) | 111 | #define AT91_PIN_PC21 (PIN_BASE + 0x40 + 21) |
128 | #define AT91_PIN_PC22 (PIN_BASE + 0x40 + 22) | 112 | #define AT91_PIN_PC22 (PIN_BASE + 0x40 + 22) |
129 | #define AT91_PIN_PC23 (PIN_BASE + 0x40 + 23) | 113 | #define AT91_PIN_PC23 (PIN_BASE + 0x40 + 23) |
130 | #define AT91_PIN_PC24 (PIN_BASE + 0x40 + 24) | 114 | #define AT91_PIN_PC24 (PIN_BASE + 0x40 + 24) |
131 | |||
132 | #define AT91_PIN_PC25 (PIN_BASE + 0x40 + 25) | 115 | #define AT91_PIN_PC25 (PIN_BASE + 0x40 + 25) |
133 | #define AT91_PIN_PC26 (PIN_BASE + 0x40 + 26) | 116 | #define AT91_PIN_PC26 (PIN_BASE + 0x40 + 26) |
134 | #define AT91_PIN_PC27 (PIN_BASE + 0x40 + 27) | 117 | #define AT91_PIN_PC27 (PIN_BASE + 0x40 + 27) |
135 | #define AT91_PIN_PC28 (PIN_BASE + 0x40 + 28) | 118 | #define AT91_PIN_PC28 (PIN_BASE + 0x40 + 28) |
136 | #define AT91_PIN_PC29 (PIN_BASE + 0x40 + 29) | 119 | #define AT91_PIN_PC29 (PIN_BASE + 0x40 + 29) |
137 | |||
138 | #define AT91_PIN_PC30 (PIN_BASE + 0x40 + 30) | 120 | #define AT91_PIN_PC30 (PIN_BASE + 0x40 + 30) |
139 | #define AT91_PIN_PC31 (PIN_BASE + 0x40 + 31) | 121 | #define AT91_PIN_PC31 (PIN_BASE + 0x40 + 31) |
140 | 122 | ||
@@ -143,40 +125,67 @@ | |||
143 | #define AT91_PIN_PD2 (PIN_BASE + 0x60 + 2) | 125 | #define AT91_PIN_PD2 (PIN_BASE + 0x60 + 2) |
144 | #define AT91_PIN_PD3 (PIN_BASE + 0x60 + 3) | 126 | #define AT91_PIN_PD3 (PIN_BASE + 0x60 + 3) |
145 | #define AT91_PIN_PD4 (PIN_BASE + 0x60 + 4) | 127 | #define AT91_PIN_PD4 (PIN_BASE + 0x60 + 4) |
146 | |||
147 | #define AT91_PIN_PD5 (PIN_BASE + 0x60 + 5) | 128 | #define AT91_PIN_PD5 (PIN_BASE + 0x60 + 5) |
148 | #define AT91_PIN_PD6 (PIN_BASE + 0x60 + 6) | 129 | #define AT91_PIN_PD6 (PIN_BASE + 0x60 + 6) |
149 | #define AT91_PIN_PD7 (PIN_BASE + 0x60 + 7) | 130 | #define AT91_PIN_PD7 (PIN_BASE + 0x60 + 7) |
150 | #define AT91_PIN_PD8 (PIN_BASE + 0x60 + 8) | 131 | #define AT91_PIN_PD8 (PIN_BASE + 0x60 + 8) |
151 | #define AT91_PIN_PD9 (PIN_BASE + 0x60 + 9) | 132 | #define AT91_PIN_PD9 (PIN_BASE + 0x60 + 9) |
152 | |||
153 | #define AT91_PIN_PD10 (PIN_BASE + 0x60 + 10) | 133 | #define AT91_PIN_PD10 (PIN_BASE + 0x60 + 10) |
154 | #define AT91_PIN_PD11 (PIN_BASE + 0x60 + 11) | 134 | #define AT91_PIN_PD11 (PIN_BASE + 0x60 + 11) |
155 | #define AT91_PIN_PD12 (PIN_BASE + 0x60 + 12) | 135 | #define AT91_PIN_PD12 (PIN_BASE + 0x60 + 12) |
156 | #define AT91_PIN_PD13 (PIN_BASE + 0x60 + 13) | 136 | #define AT91_PIN_PD13 (PIN_BASE + 0x60 + 13) |
157 | #define AT91_PIN_PD14 (PIN_BASE + 0x60 + 14) | 137 | #define AT91_PIN_PD14 (PIN_BASE + 0x60 + 14) |
158 | |||
159 | #define AT91_PIN_PD15 (PIN_BASE + 0x60 + 15) | 138 | #define AT91_PIN_PD15 (PIN_BASE + 0x60 + 15) |
160 | #define AT91_PIN_PD16 (PIN_BASE + 0x60 + 16) | 139 | #define AT91_PIN_PD16 (PIN_BASE + 0x60 + 16) |
161 | #define AT91_PIN_PD17 (PIN_BASE + 0x60 + 17) | 140 | #define AT91_PIN_PD17 (PIN_BASE + 0x60 + 17) |
162 | #define AT91_PIN_PD18 (PIN_BASE + 0x60 + 18) | 141 | #define AT91_PIN_PD18 (PIN_BASE + 0x60 + 18) |
163 | #define AT91_PIN_PD19 (PIN_BASE + 0x60 + 19) | 142 | #define AT91_PIN_PD19 (PIN_BASE + 0x60 + 19) |
164 | |||
165 | #define AT91_PIN_PD20 (PIN_BASE + 0x60 + 20) | 143 | #define AT91_PIN_PD20 (PIN_BASE + 0x60 + 20) |
166 | #define AT91_PIN_PD21 (PIN_BASE + 0x60 + 21) | 144 | #define AT91_PIN_PD21 (PIN_BASE + 0x60 + 21) |
167 | #define AT91_PIN_PD22 (PIN_BASE + 0x60 + 22) | 145 | #define AT91_PIN_PD22 (PIN_BASE + 0x60 + 22) |
168 | #define AT91_PIN_PD23 (PIN_BASE + 0x60 + 23) | 146 | #define AT91_PIN_PD23 (PIN_BASE + 0x60 + 23) |
169 | #define AT91_PIN_PD24 (PIN_BASE + 0x60 + 24) | 147 | #define AT91_PIN_PD24 (PIN_BASE + 0x60 + 24) |
170 | |||
171 | #define AT91_PIN_PD25 (PIN_BASE + 0x60 + 25) | 148 | #define AT91_PIN_PD25 (PIN_BASE + 0x60 + 25) |
172 | #define AT91_PIN_PD26 (PIN_BASE + 0x60 + 26) | 149 | #define AT91_PIN_PD26 (PIN_BASE + 0x60 + 26) |
173 | #define AT91_PIN_PD27 (PIN_BASE + 0x60 + 27) | 150 | #define AT91_PIN_PD27 (PIN_BASE + 0x60 + 27) |
174 | #define AT91_PIN_PD28 (PIN_BASE + 0x60 + 28) | 151 | #define AT91_PIN_PD28 (PIN_BASE + 0x60 + 28) |
175 | #define AT91_PIN_PD29 (PIN_BASE + 0x60 + 29) | 152 | #define AT91_PIN_PD29 (PIN_BASE + 0x60 + 29) |
176 | |||
177 | #define AT91_PIN_PD30 (PIN_BASE + 0x60 + 30) | 153 | #define AT91_PIN_PD30 (PIN_BASE + 0x60 + 30) |
178 | #define AT91_PIN_PD31 (PIN_BASE + 0x60 + 31) | 154 | #define AT91_PIN_PD31 (PIN_BASE + 0x60 + 31) |
179 | 155 | ||
156 | #define AT91_PIN_PE0 (PIN_BASE + 0x80 + 0) | ||
157 | #define AT91_PIN_PE1 (PIN_BASE + 0x80 + 1) | ||
158 | #define AT91_PIN_PE2 (PIN_BASE + 0x80 + 2) | ||
159 | #define AT91_PIN_PE3 (PIN_BASE + 0x80 + 3) | ||
160 | #define AT91_PIN_PE4 (PIN_BASE + 0x80 + 4) | ||
161 | #define AT91_PIN_PE5 (PIN_BASE + 0x80 + 5) | ||
162 | #define AT91_PIN_PE6 (PIN_BASE + 0x80 + 6) | ||
163 | #define AT91_PIN_PE7 (PIN_BASE + 0x80 + 7) | ||
164 | #define AT91_PIN_PE8 (PIN_BASE + 0x80 + 8) | ||
165 | #define AT91_PIN_PE9 (PIN_BASE + 0x80 + 9) | ||
166 | #define AT91_PIN_PE10 (PIN_BASE + 0x80 + 10) | ||
167 | #define AT91_PIN_PE11 (PIN_BASE + 0x80 + 11) | ||
168 | #define AT91_PIN_PE12 (PIN_BASE + 0x80 + 12) | ||
169 | #define AT91_PIN_PE13 (PIN_BASE + 0x80 + 13) | ||
170 | #define AT91_PIN_PE14 (PIN_BASE + 0x80 + 14) | ||
171 | #define AT91_PIN_PE15 (PIN_BASE + 0x80 + 15) | ||
172 | #define AT91_PIN_PE16 (PIN_BASE + 0x80 + 16) | ||
173 | #define AT91_PIN_PE17 (PIN_BASE + 0x80 + 17) | ||
174 | #define AT91_PIN_PE18 (PIN_BASE + 0x80 + 18) | ||
175 | #define AT91_PIN_PE19 (PIN_BASE + 0x80 + 19) | ||
176 | #define AT91_PIN_PE20 (PIN_BASE + 0x80 + 20) | ||
177 | #define AT91_PIN_PE21 (PIN_BASE + 0x80 + 21) | ||
178 | #define AT91_PIN_PE22 (PIN_BASE + 0x80 + 22) | ||
179 | #define AT91_PIN_PE23 (PIN_BASE + 0x80 + 23) | ||
180 | #define AT91_PIN_PE24 (PIN_BASE + 0x80 + 24) | ||
181 | #define AT91_PIN_PE25 (PIN_BASE + 0x80 + 25) | ||
182 | #define AT91_PIN_PE26 (PIN_BASE + 0x80 + 26) | ||
183 | #define AT91_PIN_PE27 (PIN_BASE + 0x80 + 27) | ||
184 | #define AT91_PIN_PE28 (PIN_BASE + 0x80 + 28) | ||
185 | #define AT91_PIN_PE29 (PIN_BASE + 0x80 + 29) | ||
186 | #define AT91_PIN_PE30 (PIN_BASE + 0x80 + 30) | ||
187 | #define AT91_PIN_PE31 (PIN_BASE + 0x80 + 31) | ||
188 | |||
180 | #ifndef __ASSEMBLY__ | 189 | #ifndef __ASSEMBLY__ |
181 | /* setup setup routines, called from board init or driver probe() */ | 190 | /* setup setup routines, called from board init or driver probe() */ |
182 | extern int __init_or_module at91_set_GPIO_periph(unsigned pin, int use_pullup); | 191 | extern int __init_or_module at91_set_GPIO_periph(unsigned pin, int use_pullup); |
diff --git a/include/asm-arm/arch-at91rm9200/hardware.h b/include/asm-arm/arch-at91/hardware.h index 9ea5bfe06320..eaaf1c12b753 100644 --- a/include/asm-arm/arch-at91rm9200/hardware.h +++ b/include/asm-arm/arch-at91/hardware.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/hardware.h | 2 | * include/asm-arm/arch-at91/hardware.h |
3 | * | 3 | * |
4 | * Copyright (C) 2003 SAN People | 4 | * Copyright (C) 2003 SAN People |
5 | * Copyright (C) 2003 ATMEL | 5 | * Copyright (C) 2003 ATMEL |
@@ -22,21 +22,23 @@ | |||
22 | #include <asm/arch/at91sam9260.h> | 22 | #include <asm/arch/at91sam9260.h> |
23 | #elif defined(CONFIG_ARCH_AT91SAM9261) | 23 | #elif defined(CONFIG_ARCH_AT91SAM9261) |
24 | #include <asm/arch/at91sam9261.h> | 24 | #include <asm/arch/at91sam9261.h> |
25 | #elif defined(CONFIG_ARCH_AT91SAM9263) | ||
26 | #include <asm/arch/at91sam9263.h> | ||
25 | #else | 27 | #else |
26 | #error "Unsupported AT91 processor" | 28 | #error "Unsupported AT91 processor" |
27 | #endif | 29 | #endif |
28 | 30 | ||
29 | 31 | ||
30 | /* | 32 | /* |
31 | * Remap the peripherals from address 0xFFFA0000 .. 0xFFFFFFFF | 33 | * Remap the peripherals from address 0xFFF78000 .. 0xFFFFFFFF |
32 | * to 0xFEFA0000 .. 0xFF000000. (384Kb) | 34 | * to 0xFEF78000 .. 0xFF000000. (5444Kb) |
33 | */ | 35 | */ |
34 | #define AT91_IO_PHYS_BASE 0xFFFA0000 | 36 | #define AT91_IO_PHYS_BASE 0xFFF78000 |
35 | #define AT91_IO_SIZE (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1) | 37 | #define AT91_IO_SIZE (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1) |
36 | #define AT91_IO_VIRT_BASE (0xFF000000 - AT91_IO_SIZE) | 38 | #define AT91_IO_VIRT_BASE (0xFF000000 - AT91_IO_SIZE) |
37 | 39 | ||
38 | /* Convert a physical IO address to virtual IO address */ | 40 | /* Convert a physical IO address to virtual IO address */ |
39 | #define AT91_IO_P2V(x) ((x) - AT91_IO_PHYS_BASE + AT91_IO_VIRT_BASE) | 41 | #define AT91_IO_P2V(x) ((x) - AT91_IO_PHYS_BASE + AT91_IO_VIRT_BASE) |
40 | 42 | ||
41 | /* | 43 | /* |
42 | * Virtual to Physical Address mapping for IO devices. | 44 | * Virtual to Physical Address mapping for IO devices. |
diff --git a/include/asm-arm/arch-at91rm9200/io.h b/include/asm-arm/arch-at91/io.h index 88fd1bebcef3..401f327ec047 100644 --- a/include/asm-arm/arch-at91rm9200/io.h +++ b/include/asm-arm/arch-at91/io.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/io.h | 2 | * include/asm-arm/arch-at91/io.h |
3 | * | 3 | * |
4 | * Copyright (C) 2003 SAN People | 4 | * Copyright (C) 2003 SAN People |
5 | * | 5 | * |
diff --git a/include/asm-arm/arch-at91rm9200/irqs.h b/include/asm-arm/arch-at91/irqs.h index c0679eaefaf2..1ffa3bb9a9c1 100644 --- a/include/asm-arm/arch-at91rm9200/irqs.h +++ b/include/asm-arm/arch-at91/irqs.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/irqs.h | 2 | * include/asm-arm/arch-at91/irqs.h |
3 | * | 3 | * |
4 | * Copyright (C) 2004 SAN People | 4 | * Copyright (C) 2004 SAN People |
5 | * | 5 | * |
@@ -37,8 +37,8 @@ | |||
37 | * IRQ interrupt symbols are the AT91xxx_ID_* symbols | 37 | * IRQ interrupt symbols are the AT91xxx_ID_* symbols |
38 | * for IRQs handled directly through the AIC, or else the AT91_PIN_* | 38 | * for IRQs handled directly through the AIC, or else the AT91_PIN_* |
39 | * symbols in gpio.h for ones handled indirectly as GPIOs. | 39 | * symbols in gpio.h for ones handled indirectly as GPIOs. |
40 | * We make provision for 4 banks of GPIO. | 40 | * We make provision for 5 banks of GPIO. |
41 | */ | 41 | */ |
42 | #define NR_IRQS (NR_AIC_IRQS + (4 * 32)) | 42 | #define NR_IRQS (NR_AIC_IRQS + (5 * 32)) |
43 | 43 | ||
44 | #endif | 44 | #endif |
diff --git a/include/asm-arm/arch-at91rm9200/memory.h b/include/asm-arm/arch-at91/memory.h index f985069e6d01..4835d6784509 100644 --- a/include/asm-arm/arch-at91rm9200/memory.h +++ b/include/asm-arm/arch-at91/memory.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/memory.h | 2 | * include/asm-arm/arch-at91/memory.h |
3 | * | 3 | * |
4 | * Copyright (C) 2004 SAN People | 4 | * Copyright (C) 2004 SAN People |
5 | * | 5 | * |
diff --git a/include/asm-arm/arch-at91rm9200/system.h b/include/asm-arm/arch-at91/system.h index 9c67130603b2..6bf846098ea9 100644 --- a/include/asm-arm/arch-at91rm9200/system.h +++ b/include/asm-arm/arch-at91/system.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/system.h | 2 | * include/asm-arm/arch-at91/system.h |
3 | * | 3 | * |
4 | * Copyright (C) 2003 SAN People | 4 | * Copyright (C) 2003 SAN People |
5 | * | 5 | * |
diff --git a/include/asm-arm/arch-at91rm9200/timex.h b/include/asm-arm/arch-at91/timex.h index faeca45a8d44..f41636d607a2 100644 --- a/include/asm-arm/arch-at91rm9200/timex.h +++ b/include/asm-arm/arch-at91/timex.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/timex.h | 2 | * include/asm-arm/arch-at91/timex.h |
3 | * | 3 | * |
4 | * Copyright (C) 2003 SAN People | 4 | * Copyright (C) 2003 SAN People |
5 | * | 5 | * |
@@ -32,6 +32,11 @@ | |||
32 | #define AT91SAM9_MASTER_CLOCK 99300000 | 32 | #define AT91SAM9_MASTER_CLOCK 99300000 |
33 | #define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16) | 33 | #define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16) |
34 | 34 | ||
35 | #elif defined(CONFIG_ARCH_AT91SAM9263) | ||
36 | |||
37 | #define AT91SAM9_MASTER_CLOCK 99959500 | ||
38 | #define CLOCK_TICK_RATE (AT91SAM9_MASTER_CLOCK/16) | ||
39 | |||
35 | #endif | 40 | #endif |
36 | 41 | ||
37 | #endif | 42 | #endif |
diff --git a/include/asm-arm/arch-at91rm9200/uncompress.h b/include/asm-arm/arch-at91/uncompress.h index 34b4b93fa015..a193d28304b6 100644 --- a/include/asm-arm/arch-at91rm9200/uncompress.h +++ b/include/asm-arm/arch-at91/uncompress.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/uncompress.h | 2 | * include/asm-arm/arch-at91/uncompress.h |
3 | * | 3 | * |
4 | * Copyright (C) 2003 SAN People | 4 | * Copyright (C) 2003 SAN People |
5 | * | 5 | * |
diff --git a/include/asm-arm/arch-at91rm9200/vmalloc.h b/include/asm-arm/arch-at91/vmalloc.h index 0a23b8c562b9..bb05e70e932a 100644 --- a/include/asm-arm/arch-at91rm9200/vmalloc.h +++ b/include/asm-arm/arch-at91/vmalloc.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-arm/arch-at91rm9200/vmalloc.h | 2 | * include/asm-arm/arch-at91/vmalloc.h |
3 | * | 3 | * |
4 | * Copyright (C) 2003 SAN People | 4 | * Copyright (C) 2003 SAN People |
5 | * | 5 | * |
diff --git a/include/asm-arm/arch-at91rm9200/at91_pdc.h b/include/asm-arm/arch-at91rm9200/at91_pdc.h deleted file mode 100644 index 79d6e02fa45e..000000000000 --- a/include/asm-arm/arch-at91rm9200/at91_pdc.h +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-at91rm9200/at91_pdc.h | ||
3 | * | ||
4 | * Copyright (C) 2005 Ivan Kokshaysky | ||
5 | * Copyright (C) SAN People | ||
6 | * | ||
7 | * Peripheral Data Controller (PDC) registers. | ||
8 | * Based on AT91RM9200 datasheet revision E. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | */ | ||
15 | |||
16 | #ifndef AT91_PDC_H | ||
17 | #define AT91_PDC_H | ||
18 | |||
19 | #define AT91_PDC_RPR 0x100 /* Receive Pointer Register */ | ||
20 | #define AT91_PDC_RCR 0x104 /* Receive Counter Register */ | ||
21 | #define AT91_PDC_TPR 0x108 /* Transmit Pointer Register */ | ||
22 | #define AT91_PDC_TCR 0x10c /* Transmit Counter Register */ | ||
23 | #define AT91_PDC_RNPR 0x110 /* Receive Next Pointer Register */ | ||
24 | #define AT91_PDC_RNCR 0x114 /* Receive Next Counter Register */ | ||
25 | #define AT91_PDC_TNPR 0x118 /* Transmit Next Pointer Register */ | ||
26 | #define AT91_PDC_TNCR 0x11c /* Transmit Next Counter Register */ | ||
27 | |||
28 | #define AT91_PDC_PTCR 0x120 /* Transfer Control Register */ | ||
29 | #define AT91_PDC_RXTEN (1 << 0) /* Receiver Transfer Enable */ | ||
30 | #define AT91_PDC_RXTDIS (1 << 1) /* Receiver Transfer Disable */ | ||
31 | #define AT91_PDC_TXTEN (1 << 8) /* Transmitter Transfer Enable */ | ||
32 | #define AT91_PDC_TXTDIS (1 << 9) /* Transmitter Transfer Disable */ | ||
33 | |||
34 | #define AT91_PDC_PTSR 0x124 /* Transfer Status Register */ | ||
35 | |||
36 | #endif | ||
diff --git a/include/asm-arm/arch-at91rm9200/debug-macro.S b/include/asm-arm/arch-at91rm9200/debug-macro.S deleted file mode 100644 index 85cdadf26634..000000000000 --- a/include/asm-arm/arch-at91rm9200/debug-macro.S +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-at91rm9200/debug-macro.S | ||
3 | * | ||
4 | * Copyright (C) 2003-2005 SAN People | ||
5 | * | ||
6 | * Debugging macro include header | ||
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 | |||
14 | #include <asm/hardware.h> | ||
15 | #include <asm/arch/at91_dbgu.h> | ||
16 | |||
17 | .macro addruart,rx | ||
18 | mrc p15, 0, \rx, c1, c0 | ||
19 | tst \rx, #1 @ MMU enabled? | ||
20 | ldreq \rx, =AT91_BASE_SYS @ System peripherals (phys address) | ||
21 | ldrne \rx, =AT91_VA_BASE_SYS @ System peripherals (virt address) | ||
22 | .endm | ||
23 | |||
24 | .macro senduart,rd,rx | ||
25 | strb \rd, [\rx, #AT91_DBGU_THR] @ Write to Transmitter Holding Register | ||
26 | .endm | ||
27 | |||
28 | .macro waituart,rd,rx | ||
29 | 1001: ldr \rd, [\rx, #AT91_DBGU_SR] @ Read Status Register | ||
30 | tst \rd, #AT91_DBGU_TXRDY @ DBGU_TXRDY = 1 when ready to transmit | ||
31 | beq 1001b | ||
32 | .endm | ||
33 | |||
34 | .macro busyuart,rd,rx | ||
35 | 1001: ldr \rd, [\rx, #AT91_DBGU_SR] @ Read Status Register | ||
36 | tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete | ||
37 | beq 1001b | ||
38 | .endm | ||
39 | |||
diff --git a/include/asm-arm/arch-at91rm9200/entry-macro.S b/include/asm-arm/arch-at91rm9200/entry-macro.S index 57248a796472..0e0aadf2a175 100644 --- a/include/asm-arm/arch-at91rm9200/entry-macro.S +++ b/include/asm-arm/arch-at91rm9200/entry-macro.S | |||
@@ -16,6 +16,12 @@ | |||
16 | .macro disable_fiq | 16 | .macro disable_fiq |
17 | .endm | 17 | .endm |
18 | 18 | ||
19 | .macro get_irqnr_preamble, base, tmp | ||
20 | .endm | ||
21 | |||
22 | .macro arch_ret_to_user, tmp1, tmp2 | ||
23 | .endm | ||
24 | |||
19 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 25 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
20 | ldr \base, =(AT91_VA_BASE_SYS) @ base virtual address of SYS peripherals | 26 | ldr \base, =(AT91_VA_BASE_SYS) @ base virtual address of SYS peripherals |
21 | ldr \irqnr, [\base, #AT91_AIC_IVR] @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt) | 27 | ldr \irqnr, [\base, #AT91_AIC_IVR] @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt) |
diff --git a/include/asm-arm/arch-cl7500/entry-macro.S b/include/asm-arm/arch-cl7500/entry-macro.S index c9e5395e5106..0cfb89b229d1 100644 --- a/include/asm-arm/arch-cl7500/entry-macro.S +++ b/include/asm-arm/arch-cl7500/entry-macro.S | |||
@@ -1,3 +1,8 @@ | |||
1 | #include <asm/hardware.h> | 1 | #include <asm/hardware.h> |
2 | #include <asm/hardware/entry-macro-iomd.S> | 2 | #include <asm/hardware/entry-macro-iomd.S> |
3 | .macro get_irqnr_preamble, base, tmp | ||
4 | .endm | ||
5 | |||
6 | .macro arch_ret_to_user, tmp1, tmp2 | ||
7 | .endm | ||
3 | 8 | ||
diff --git a/include/asm-arm/arch-clps711x/entry-macro.S b/include/asm-arm/arch-clps711x/entry-macro.S index de4481dd8ba0..cd8c5a0bc7bc 100644 --- a/include/asm-arm/arch-clps711x/entry-macro.S +++ b/include/asm-arm/arch-clps711x/entry-macro.S | |||
@@ -13,6 +13,12 @@ | |||
13 | .macro disable_fiq | 13 | .macro disable_fiq |
14 | .endm | 14 | .endm |
15 | 15 | ||
16 | .macro get_irqnr_preamble, base, tmp | ||
17 | .endm | ||
18 | |||
19 | .macro arch_ret_to_user, tmp1, tmp2 | ||
20 | .endm | ||
21 | |||
16 | #if (INTSR2 - INTSR1) != (INTMR2 - INTMR1) | 22 | #if (INTSR2 - INTSR1) != (INTMR2 - INTMR1) |
17 | #error INTSR stride != INTMR stride | 23 | #error INTSR stride != INTMR stride |
18 | #endif | 24 | #endif |
diff --git a/include/asm-arm/arch-ebsa110/entry-macro.S b/include/asm-arm/arch-ebsa110/entry-macro.S index b12ca04f998c..aa23c5d6c69e 100644 --- a/include/asm-arm/arch-ebsa110/entry-macro.S +++ b/include/asm-arm/arch-ebsa110/entry-macro.S | |||
@@ -15,6 +15,12 @@ | |||
15 | .macro disable_fiq | 15 | .macro disable_fiq |
16 | .endm | 16 | .endm |
17 | 17 | ||
18 | .macro get_irqnr_preamble, base, tmp | ||
19 | .endm | ||
20 | |||
21 | .macro arch_ret_to_user, tmp1, tmp2 | ||
22 | .endm | ||
23 | |||
18 | .macro get_irqnr_and_base, irqnr, stat, base, tmp | 24 | .macro get_irqnr_and_base, irqnr, stat, base, tmp |
19 | mov \base, #IRQ_STAT | 25 | mov \base, #IRQ_STAT |
20 | ldrb \stat, [\base] @ get interrupts | 26 | ldrb \stat, [\base] @ get interrupts |
diff --git a/include/asm-arm/arch-ebsa285/entry-macro.S b/include/asm-arm/arch-ebsa285/entry-macro.S index ce812d4f4a33..4203dbf10662 100644 --- a/include/asm-arm/arch-ebsa285/entry-macro.S +++ b/include/asm-arm/arch-ebsa285/entry-macro.S | |||
@@ -14,6 +14,12 @@ | |||
14 | .macro disable_fiq | 14 | .macro disable_fiq |
15 | .endm | 15 | .endm |
16 | 16 | ||
17 | .macro get_irqnr_preamble, base, tmp | ||
18 | .endm | ||
19 | |||
20 | .macro arch_ret_to_user, tmp1, tmp2 | ||
21 | .endm | ||
22 | |||
17 | .equ dc21285_high, ARMCSR_BASE & 0xff000000 | 23 | .equ dc21285_high, ARMCSR_BASE & 0xff000000 |
18 | .equ dc21285_low, ARMCSR_BASE & 0x00ffffff | 24 | .equ dc21285_low, ARMCSR_BASE & 0x00ffffff |
19 | 25 | ||
diff --git a/include/asm-arm/arch-ep93xx/entry-macro.S b/include/asm-arm/arch-ep93xx/entry-macro.S index 84140a28dfcf..241ec221a047 100644 --- a/include/asm-arm/arch-ep93xx/entry-macro.S +++ b/include/asm-arm/arch-ep93xx/entry-macro.S | |||
@@ -14,6 +14,12 @@ | |||
14 | .macro disable_fiq | 14 | .macro disable_fiq |
15 | .endm | 15 | .endm |
16 | 16 | ||
17 | .macro get_irqnr_preamble, base, tmp | ||
18 | .endm | ||
19 | |||
20 | .macro arch_ret_to_user, tmp1, tmp2 | ||
21 | .endm | ||
22 | |||
17 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 23 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
18 | ldr \base, =(EP93XX_AHB_VIRT_BASE) | 24 | ldr \base, =(EP93XX_AHB_VIRT_BASE) |
19 | orr \base, \base, #0x000b0000 | 25 | orr \base, \base, #0x000b0000 |
diff --git a/include/asm-arm/arch-ep93xx/ep93xx-regs.h b/include/asm-arm/arch-ep93xx/ep93xx-regs.h index 593f562f85c3..625c6f0abc03 100644 --- a/include/asm-arm/arch-ep93xx/ep93xx-regs.h +++ b/include/asm-arm/arch-ep93xx/ep93xx-regs.h | |||
@@ -73,6 +73,11 @@ | |||
73 | 73 | ||
74 | #define EP93XX_GPIO_BASE (EP93XX_APB_VIRT_BASE + 0x00040000) | 74 | #define EP93XX_GPIO_BASE (EP93XX_APB_VIRT_BASE + 0x00040000) |
75 | #define EP93XX_GPIO_REG(x) (EP93XX_GPIO_BASE + (x)) | 75 | #define EP93XX_GPIO_REG(x) (EP93XX_GPIO_BASE + (x)) |
76 | #define EP93XX_GPIO_F_INT_TYPE1 EP93XX_GPIO_REG(0x4c) | ||
77 | #define EP93XX_GPIO_F_INT_TYPE2 EP93XX_GPIO_REG(0x50) | ||
78 | #define EP93XX_GPIO_F_INT_ACK EP93XX_GPIO_REG(0x54) | ||
79 | #define EP93XX_GPIO_F_INT_ENABLE EP93XX_GPIO_REG(0x58) | ||
80 | #define EP93XX_GPIO_F_INT_STATUS EP93XX_GPIO_REG(0x5c) | ||
76 | #define EP93XX_GPIO_A_INT_TYPE1 EP93XX_GPIO_REG(0x90) | 81 | #define EP93XX_GPIO_A_INT_TYPE1 EP93XX_GPIO_REG(0x90) |
77 | #define EP93XX_GPIO_A_INT_TYPE2 EP93XX_GPIO_REG(0x94) | 82 | #define EP93XX_GPIO_A_INT_TYPE2 EP93XX_GPIO_REG(0x94) |
78 | #define EP93XX_GPIO_A_INT_ACK EP93XX_GPIO_REG(0x98) | 83 | #define EP93XX_GPIO_A_INT_ACK EP93XX_GPIO_REG(0x98) |
diff --git a/include/asm-arm/arch-ep93xx/irqs.h b/include/asm-arm/arch-ep93xx/irqs.h index ae532e304bf1..2a8c63638c5e 100644 --- a/include/asm-arm/arch-ep93xx/irqs.h +++ b/include/asm-arm/arch-ep93xx/irqs.h | |||
@@ -67,9 +67,13 @@ | |||
67 | #define IRQ_EP93XX_SAI 60 | 67 | #define IRQ_EP93XX_SAI 60 |
68 | #define EP93XX_VIC2_VALID_IRQ_MASK 0x1fffffff | 68 | #define EP93XX_VIC2_VALID_IRQ_MASK 0x1fffffff |
69 | 69 | ||
70 | #define IRQ_EP93XX_GPIO(x) (64 + (x)) | 70 | /* |
71 | * Map GPIO A0..A7 to irq 64..71, B0..B7 to 72..79, and | ||
72 | * F0..F7 to 80..87. | ||
73 | */ | ||
74 | #define IRQ_EP93XX_GPIO(x) (64 + (((x) + (((x) >> 2) & 8)) & 0x1f)) | ||
71 | 75 | ||
72 | #define NR_EP93XX_IRQS IRQ_EP93XX_GPIO(16) | 76 | #define NR_EP93XX_IRQS (64 + 24) |
73 | 77 | ||
74 | #define EP93XX_BOARD_IRQ(x) (NR_EP93XX_IRQS + (x)) | 78 | #define EP93XX_BOARD_IRQ(x) (NR_EP93XX_IRQS + (x)) |
75 | #define EP93XX_BOARD_IRQS 32 | 79 | #define EP93XX_BOARD_IRQS 32 |
diff --git a/include/asm-arm/arch-ep93xx/platform.h b/include/asm-arm/arch-ep93xx/platform.h index b4a8deb8bdef..44eccec2cba4 100644 --- a/include/asm-arm/arch-ep93xx/platform.h +++ b/include/asm-arm/arch-ep93xx/platform.h | |||
@@ -8,7 +8,6 @@ void ep93xx_map_io(void); | |||
8 | void ep93xx_init_irq(void); | 8 | void ep93xx_init_irq(void); |
9 | void ep93xx_init_time(unsigned long); | 9 | void ep93xx_init_time(unsigned long); |
10 | void ep93xx_init_devices(void); | 10 | void ep93xx_init_devices(void); |
11 | void ep93xx_clock_init(void); | ||
12 | extern struct sys_timer ep93xx_timer; | 11 | extern struct sys_timer ep93xx_timer; |
13 | 12 | ||
14 | struct ep93xx_eth_data | 13 | struct ep93xx_eth_data |
diff --git a/include/asm-arm/arch-h720x/entry-macro.S b/include/asm-arm/arch-h720x/entry-macro.S index 8f165648e2af..38dd63ae104e 100644 --- a/include/asm-arm/arch-h720x/entry-macro.S +++ b/include/asm-arm/arch-h720x/entry-macro.S | |||
@@ -11,6 +11,12 @@ | |||
11 | .macro disable_fiq | 11 | .macro disable_fiq |
12 | .endm | 12 | .endm |
13 | 13 | ||
14 | .macro get_irqnr_preamble, base, tmp | ||
15 | .endm | ||
16 | |||
17 | .macro arch_ret_to_user, tmp1, tmp2 | ||
18 | .endm | ||
19 | |||
14 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 20 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
15 | #if defined (CONFIG_CPU_H7201) || defined (CONFIG_CPU_H7202) | 21 | #if defined (CONFIG_CPU_H7201) || defined (CONFIG_CPU_H7202) |
16 | @ we could use the id register on H7202, but this is not | 22 | @ we could use the id register on H7202, but this is not |
diff --git a/include/asm-arm/arch-imx/entry-macro.S b/include/asm-arm/arch-imx/entry-macro.S index 3b9ef6914627..0b84e81031c3 100644 --- a/include/asm-arm/arch-imx/entry-macro.S +++ b/include/asm-arm/arch-imx/entry-macro.S | |||
@@ -11,21 +11,22 @@ | |||
11 | 11 | ||
12 | .macro disable_fiq | 12 | .macro disable_fiq |
13 | .endm | 13 | .endm |
14 | |||
15 | .macro get_irqnr_preamble, base, tmp | ||
16 | .endm | ||
17 | |||
18 | .macro arch_ret_to_user, tmp1, tmp2 | ||
19 | .endm | ||
20 | |||
14 | #define AITC_NIVECSR 0x40 | 21 | #define AITC_NIVECSR 0x40 |
15 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 22 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
16 | ldr \irqstat, =IO_ADDRESS(IMX_AITC_BASE) | 23 | ldr \base, =IO_ADDRESS(IMX_AITC_BASE) |
17 | @ Load offset & priority of the highest priority | 24 | @ Load offset & priority of the highest priority |
18 | @ interrupt pending. | 25 | @ interrupt pending. |
19 | ldr \irqnr, [\irqstat, #AITC_NIVECSR] | 26 | ldr \irqstat, [\base, #AITC_NIVECSR] |
20 | @ Shift off the priority leaving the offset or | 27 | @ Shift off the priority leaving the offset or |
21 | @ "interrupt number" | 28 | @ "interrupt number", use arithmetic shift to |
22 | mov \irqnr, \irqnr, lsr #16 | 29 | @ transform illegal source (0xffff) as -1 |
23 | ldr \irqstat, =1 @ dummy compare | 30 | mov \irqnr, \irqstat, asr #16 |
24 | ldr \base, =0xFFFF // invalid interrupt | 31 | adds \tmp, \irqnr, #1 |
25 | cmp \irqnr, \base | ||
26 | bne 1001f | ||
27 | ldr \irqstat, =0 | ||
28 | 1001: | ||
29 | tst \irqstat, #1 @ to make the condition code = TRUE | ||
30 | .endm | 32 | .endm |
31 | |||
diff --git a/include/asm-arm/arch-integrator/entry-macro.S b/include/asm-arm/arch-integrator/entry-macro.S index 69838d04f90b..491af1a23de5 100644 --- a/include/asm-arm/arch-integrator/entry-macro.S +++ b/include/asm-arm/arch-integrator/entry-macro.S | |||
@@ -13,6 +13,12 @@ | |||
13 | .macro disable_fiq | 13 | .macro disable_fiq |
14 | .endm | 14 | .endm |
15 | 15 | ||
16 | .macro get_irqnr_preamble, base, tmp | ||
17 | .endm | ||
18 | |||
19 | .macro arch_ret_to_user, tmp1, tmp2 | ||
20 | .endm | ||
21 | |||
16 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 22 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
17 | /* FIXME: should not be using soo many LDRs here */ | 23 | /* FIXME: should not be using soo many LDRs here */ |
18 | ldr \base, =IO_ADDRESS(INTEGRATOR_IC_BASE) | 24 | ldr \base, =IO_ADDRESS(INTEGRATOR_IC_BASE) |
diff --git a/include/asm-arm/arch-iop13xx/entry-macro.S b/include/asm-arm/arch-iop13xx/entry-macro.S index 94c50283dc56..a624a7870c64 100644 --- a/include/asm-arm/arch-iop13xx/entry-macro.S +++ b/include/asm-arm/arch-iop13xx/entry-macro.S | |||
@@ -19,21 +19,27 @@ | |||
19 | .macro disable_fiq | 19 | .macro disable_fiq |
20 | .endm | 20 | .endm |
21 | 21 | ||
22 | .macro get_irqnr_preamble, base, tmp | ||
23 | mrc p15, 0, \tmp, c15, c1, 0 | ||
24 | orr \tmp, \tmp, #(1 << 6) | ||
25 | mcr p15, 0, \tmp, c15, c1, 0 @ Enable cp6 access | ||
26 | .endm | ||
27 | |||
22 | /* | 28 | /* |
23 | * Note: a 1-cycle window exists where iintvec will return the value | 29 | * Note: a 1-cycle window exists where iintvec will return the value |
24 | * of iintbase, so we explicitly check for "bad zeros" | 30 | * of iintbase, so we explicitly check for "bad zeros" |
25 | */ | 31 | */ |
26 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 32 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
27 | mrc p15, 0, \tmp, c15, c1, 0 | ||
28 | orr \tmp, \tmp, #(1 << 6) | ||
29 | mcr p15, 0, \tmp, c15, c1, 0 @ Enable cp6 access | ||
30 | |||
31 | mrc p6, 0, \irqnr, c3, c2, 0 @ Read IINTVEC | 33 | mrc p6, 0, \irqnr, c3, c2, 0 @ Read IINTVEC |
32 | cmp \irqnr, #0 | 34 | cmp \irqnr, #0 |
33 | mrceq p6, 0, \irqnr, c3, c2, 0 @ Re-read on potentially bad zero | 35 | mrceq p6, 0, \irqnr, c3, c2, 0 @ Re-read on potentially bad zero |
34 | adds \irqstat, \irqnr, #1 @ Check for 0xffffffff | 36 | adds \irqstat, \irqnr, #1 @ Check for 0xffffffff |
35 | movne \irqnr, \irqnr, lsr #2 @ Convert to irqnr | 37 | movne \irqnr, \irqnr, lsr #2 @ Convert to irqnr |
38 | .endm | ||
36 | 39 | ||
37 | biceq \tmp, \tmp, #(1 << 6) | 40 | .macro arch_ret_to_user, tmp1, tmp2 |
38 | mcreq p15, 0, \tmp, c15, c1, 0 @ Disable cp6 access if no more interrupts | 41 | mrc p15, 0, \tmp1, c15, c1, 0 |
42 | ands \tmp2, \tmp1, #(1 << 6) | ||
43 | bicne \tmp1, \tmp1, #(1 << 6) | ||
44 | mcrne p15, 0, \tmp1, c15, c1, 0 @ Disable cp6 access | ||
39 | .endm | 45 | .endm |
diff --git a/include/asm-arm/arch-iop13xx/iop13xx.h b/include/asm-arm/arch-iop13xx/iop13xx.h index a88522a0ff8e..d26b755a9879 100644 --- a/include/asm-arm/arch-iop13xx/iop13xx.h +++ b/include/asm-arm/arch-iop13xx/iop13xx.h | |||
@@ -9,34 +9,6 @@ void iop13xx_init_irq(void); | |||
9 | void iop13xx_map_io(void); | 9 | void iop13xx_map_io(void); |
10 | void iop13xx_platform_init(void); | 10 | void iop13xx_platform_init(void); |
11 | void iop13xx_init_irq(void); | 11 | void iop13xx_init_irq(void); |
12 | void iop13xx_init_time(unsigned long tickrate); | ||
13 | unsigned long iop13xx_gettimeoffset(void); | ||
14 | |||
15 | /* handle cp6 access | ||
16 | * to do: handle access in entry-armv5.S and unify with | ||
17 | * the iop3xx implementation | ||
18 | * note: use iop13xx_cp6_enable_irq_save and iop13xx_cp6_irq_restore (irq.h) | ||
19 | * when interrupts are enabled | ||
20 | */ | ||
21 | static inline unsigned long iop13xx_cp6_save(void) | ||
22 | { | ||
23 | u32 temp, cp_flags; | ||
24 | |||
25 | asm volatile ( | ||
26 | "mrc p15, 0, %1, c15, c1, 0\n\t" | ||
27 | "orr %0, %1, #(1 << 6)\n\t" | ||
28 | "mcr p15, 0, %0, c15, c1, 0\n\t" | ||
29 | : "=r" (temp), "=r"(cp_flags)); | ||
30 | |||
31 | return cp_flags; | ||
32 | } | ||
33 | |||
34 | static inline void iop13xx_cp6_restore(unsigned long cp_flags) | ||
35 | { | ||
36 | asm volatile ( | ||
37 | "mcr p15, 0, %0, c15, c1, 0\n\t" | ||
38 | : : "r" (cp_flags) ); | ||
39 | } | ||
40 | 12 | ||
41 | /* CPUID CP6 R0 Page 0 */ | 13 | /* CPUID CP6 R0 Page 0 */ |
42 | static inline int iop13xx_cpu_id(void) | 14 | static inline int iop13xx_cpu_id(void) |
@@ -479,14 +451,4 @@ static inline int iop13xx_cpu_id(void) | |||
479 | #define IOP13XX_PBI_BAR1 IOP13XX_PBI_OFFSET(0x10) | 451 | #define IOP13XX_PBI_BAR1 IOP13XX_PBI_OFFSET(0x10) |
480 | #define IOP13XX_PBI_LR1 IOP13XX_PBI_OFFSET(0x14) | 452 | #define IOP13XX_PBI_LR1 IOP13XX_PBI_OFFSET(0x14) |
481 | 453 | ||
482 | #define IOP13XX_TMR_TC 0x01 | ||
483 | #define IOP13XX_TMR_EN 0x02 | ||
484 | #define IOP13XX_TMR_RELOAD 0x04 | ||
485 | #define IOP13XX_TMR_PRIVILEGED 0x08 | ||
486 | |||
487 | #define IOP13XX_TMR_RATIO_1_1 0x00 | ||
488 | #define IOP13XX_TMR_RATIO_4_1 0x10 | ||
489 | #define IOP13XX_TMR_RATIO_8_1 0x20 | ||
490 | #define IOP13XX_TMR_RATIO_16_1 0x30 | ||
491 | |||
492 | #endif /* _IOP13XX_HW_H_ */ | 454 | #endif /* _IOP13XX_HW_H_ */ |
diff --git a/include/asm-arm/arch-iop13xx/irqs.h b/include/asm-arm/arch-iop13xx/irqs.h index 442e35a40359..5c6fac2a4004 100644 --- a/include/asm-arm/arch-iop13xx/irqs.h +++ b/include/asm-arm/arch-iop13xx/irqs.h | |||
@@ -3,8 +3,6 @@ | |||
3 | 3 | ||
4 | #ifndef __ASSEMBLER__ | 4 | #ifndef __ASSEMBLER__ |
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <asm/system.h> /* local_irq_save */ | ||
7 | #include <asm/arch/iop13xx.h> /* iop13xx_cp6_* */ | ||
8 | 6 | ||
9 | /* INTPND0 CP6 R0 Page 3 | 7 | /* INTPND0 CP6 R0 Page 3 |
10 | */ | 8 | */ |
@@ -41,21 +39,6 @@ static inline u32 read_intpnd_3(void) | |||
41 | asm volatile("mrc p6, 0, %0, c3, c3, 0":"=r" (val)); | 39 | asm volatile("mrc p6, 0, %0, c3, c3, 0":"=r" (val)); |
42 | return val; | 40 | return val; |
43 | } | 41 | } |
44 | |||
45 | static inline void | ||
46 | iop13xx_cp6_enable_irq_save(unsigned long *cp_flags, unsigned long *irq_flags) | ||
47 | { | ||
48 | local_irq_save(*irq_flags); | ||
49 | *cp_flags = iop13xx_cp6_save(); | ||
50 | } | ||
51 | |||
52 | static inline void | ||
53 | iop13xx_cp6_irq_restore(unsigned long *cp_flags, | ||
54 | unsigned long *irq_flags) | ||
55 | { | ||
56 | iop13xx_cp6_restore(*cp_flags); | ||
57 | local_irq_restore(*irq_flags); | ||
58 | } | ||
59 | #endif | 42 | #endif |
60 | 43 | ||
61 | #define INTBASE 0 | 44 | #define INTBASE 0 |
diff --git a/include/asm-arm/arch-iop13xx/system.h b/include/asm-arm/arch-iop13xx/system.h index ee3a62530af2..127827058e1f 100644 --- a/include/asm-arm/arch-iop13xx/system.h +++ b/include/asm-arm/arch-iop13xx/system.h | |||
@@ -48,12 +48,10 @@ static inline void arch_reset(char mode) | |||
48 | /* | 48 | /* |
49 | * Reset the internal bus (warning both cores are reset) | 49 | * Reset the internal bus (warning both cores are reset) |
50 | */ | 50 | */ |
51 | u32 cp_flags = iop13xx_cp6_save(); | ||
52 | write_wdtcr(IOP13XX_WDTCR_EN_ARM); | 51 | write_wdtcr(IOP13XX_WDTCR_EN_ARM); |
53 | write_wdtcr(IOP13XX_WDTCR_EN); | 52 | write_wdtcr(IOP13XX_WDTCR_EN); |
54 | write_wdtsr(IOP13XX_WDTSR_WRITE_EN | IOP13XX_WDTCR_IB_RESET); | 53 | write_wdtsr(IOP13XX_WDTSR_WRITE_EN | IOP13XX_WDTCR_IB_RESET); |
55 | write_wdtcr(0x1000); | 54 | write_wdtcr(0x1000); |
56 | iop13xx_cp6_restore(cp_flags); | ||
57 | 55 | ||
58 | for(;;); | 56 | for(;;); |
59 | } | 57 | } |
diff --git a/include/asm-arm/arch-iop13xx/time.h b/include/asm-arm/arch-iop13xx/time.h new file mode 100644 index 000000000000..77a837a02dec --- /dev/null +++ b/include/asm-arm/arch-iop13xx/time.h | |||
@@ -0,0 +1,51 @@ | |||
1 | #ifndef _IOP13XX_TIME_H_ | ||
2 | #define _IOP13XX_TIME_H_ | ||
3 | #define IRQ_IOP_TIMER0 IRQ_IOP13XX_TIMER0 | ||
4 | |||
5 | #define IOP_TMR_EN 0x02 | ||
6 | #define IOP_TMR_RELOAD 0x04 | ||
7 | #define IOP_TMR_PRIVILEGED 0x08 | ||
8 | #define IOP_TMR_RATIO_1_1 0x00 | ||
9 | |||
10 | void iop_init_time(unsigned long tickrate); | ||
11 | unsigned long iop_gettimeoffset(void); | ||
12 | |||
13 | static inline void write_tmr0(u32 val) | ||
14 | { | ||
15 | asm volatile("mcr p6, 0, %0, c0, c9, 0" : : "r" (val)); | ||
16 | } | ||
17 | |||
18 | static inline void write_tmr1(u32 val) | ||
19 | { | ||
20 | asm volatile("mcr p6, 0, %0, c1, c9, 0" : : "r" (val)); | ||
21 | } | ||
22 | |||
23 | static inline u32 read_tcr0(void) | ||
24 | { | ||
25 | u32 val; | ||
26 | asm volatile("mrc p6, 0, %0, c2, c9, 0" : "=r" (val)); | ||
27 | return val; | ||
28 | } | ||
29 | |||
30 | static inline u32 read_tcr1(void) | ||
31 | { | ||
32 | u32 val; | ||
33 | asm volatile("mrc p6, 0, %0, c3, c9, 0" : "=r" (val)); | ||
34 | return val; | ||
35 | } | ||
36 | |||
37 | static inline void write_trr0(u32 val) | ||
38 | { | ||
39 | asm volatile("mcr p6, 0, %0, c4, c9, 0" : : "r" (val)); | ||
40 | } | ||
41 | |||
42 | static inline void write_trr1(u32 val) | ||
43 | { | ||
44 | asm volatile("mcr p6, 0, %0, c5, c9, 0" : : "r" (val)); | ||
45 | } | ||
46 | |||
47 | static inline void write_tisr(u32 val) | ||
48 | { | ||
49 | asm volatile("mcr p6, 0, %0, c6, c9, 0" : : "r" (val)); | ||
50 | } | ||
51 | #endif | ||
diff --git a/include/asm-arm/arch-iop32x/entry-macro.S b/include/asm-arm/arch-iop32x/entry-macro.S index 1500cbbd2295..207db99dfbd2 100644 --- a/include/asm-arm/arch-iop32x/entry-macro.S +++ b/include/asm-arm/arch-iop32x/entry-macro.S | |||
@@ -9,13 +9,28 @@ | |||
9 | */ | 9 | */ |
10 | #include <asm/arch/iop32x.h> | 10 | #include <asm/arch/iop32x.h> |
11 | 11 | ||
12 | .macro disable_fiq | 12 | .macro disable_fiq |
13 | .endm | 13 | .endm |
14 | 14 | ||
15 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 15 | .macro get_irqnr_preamble, base, tmp |
16 | ldr \base, =IOP3XX_REG_ADDR(0x07D8) | 16 | mrc p15, 0, \tmp, c15, c1, 0 |
17 | ldr \irqstat, [\base] @ Read IINTSRC | 17 | orr \tmp, \tmp, #(1 << 6) |
18 | cmp \irqstat, #0 | 18 | mcr p15, 0, \tmp, c15, c1, 0 @ Enable cp6 access |
19 | clzne \irqnr, \irqstat | 19 | mrc p15, 0, \tmp, c15, c1, 0 |
20 | rsbne \irqnr, \irqnr, #31 | 20 | mov \tmp, \tmp |
21 | .endm | 21 | sub pc, pc, #4 @ cp_wait |
22 | .endm | ||
23 | |||
24 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
25 | mrc p6, 0, \irqstat, c8, c0, 0 @ Read IINTSRC | ||
26 | cmp \irqstat, #0 | ||
27 | clzne \irqnr, \irqstat | ||
28 | rsbne \irqnr, \irqnr, #31 | ||
29 | .endm | ||
30 | |||
31 | .macro arch_ret_to_user, tmp1, tmp2 | ||
32 | mrc p15, 0, \tmp1, c15, c1, 0 | ||
33 | ands \tmp2, \tmp1, #(1 << 6) | ||
34 | bicne \tmp1, \tmp1, #(1 << 6) | ||
35 | mcrne p15, 0, \tmp1, c15, c1, 0 @ Disable cp6 access | ||
36 | .endm | ||
diff --git a/include/asm-arm/arch-iop32x/io.h b/include/asm-arm/arch-iop32x/io.h index 12d9ee02cde3..5f570a598a37 100644 --- a/include/asm-arm/arch-iop32x/io.h +++ b/include/asm-arm/arch-iop32x/io.h | |||
@@ -13,10 +13,16 @@ | |||
13 | 13 | ||
14 | #include <asm/hardware.h> | 14 | #include <asm/hardware.h> |
15 | 15 | ||
16 | #define IO_SPACE_LIMIT 0xffffffff | 16 | extern void __iomem * __ioremap(unsigned long, size_t, unsigned long); |
17 | extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size, | ||
18 | unsigned long flags); | ||
19 | extern void __iop3xx_iounmap(void __iomem *addr); | ||
17 | 20 | ||
18 | #define __io(p) ((void __iomem *)(p)) | 21 | #define IO_SPACE_LIMIT 0xffffffff |
22 | #define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p)) | ||
19 | #define __mem_pci(a) (a) | 23 | #define __mem_pci(a) (a) |
20 | 24 | ||
25 | #define __arch_ioremap(a, s, f) __iop3xx_ioremap(a, s, f) | ||
26 | #define __arch_iounmap(a) __iop3xx_iounmap(a) | ||
21 | 27 | ||
22 | #endif | 28 | #endif |
diff --git a/include/asm-arm/arch-iop32x/time.h b/include/asm-arm/arch-iop32x/time.h new file mode 100644 index 000000000000..0f28c9949623 --- /dev/null +++ b/include/asm-arm/arch-iop32x/time.h | |||
@@ -0,0 +1,4 @@ | |||
1 | #ifndef _IOP32X_TIME_H_ | ||
2 | #define _IOP32X_TIME_H_ | ||
3 | #define IRQ_IOP_TIMER0 IRQ_IOP32X_TIMER0 | ||
4 | #endif | ||
diff --git a/include/asm-arm/arch-iop33x/entry-macro.S b/include/asm-arm/arch-iop33x/entry-macro.S index 92b791702e34..b8e3d449e882 100644 --- a/include/asm-arm/arch-iop33x/entry-macro.S +++ b/include/asm-arm/arch-iop33x/entry-macro.S | |||
@@ -9,14 +9,29 @@ | |||
9 | */ | 9 | */ |
10 | #include <asm/arch/iop33x.h> | 10 | #include <asm/arch/iop33x.h> |
11 | 11 | ||
12 | .macro disable_fiq | 12 | .macro disable_fiq |
13 | .endm | 13 | .endm |
14 | 14 | ||
15 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 15 | .macro get_irqnr_preamble, base, tmp |
16 | ldr \base, =IOP3XX_REG_ADDR(0x07C8) | 16 | mrc p15, 0, \tmp, c15, c1, 0 |
17 | ldr \irqstat, [\base] @ Read IINTVEC | 17 | orr \tmp, \tmp, #(1 << 6) |
18 | cmp \irqstat, #0 | 18 | mcr p15, 0, \tmp, c15, c1, 0 @ Enable cp6 access |
19 | ldreq \irqstat, [\base] @ erratum 63 workaround | 19 | mrc p15, 0, \tmp, c15, c1, 0 |
20 | adds \irqnr, \irqstat, #1 | 20 | mov \tmp, \tmp |
21 | movne \irqnr, \irqstat, lsr #2 | 21 | sub pc, pc, #4 @ cp_wait |
22 | .endm | 22 | .endm |
23 | |||
24 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
25 | mrc p6, 0, \irqstat, c14, c0, 0 @ Read IINTVEC | ||
26 | cmp \irqstat, #0 | ||
27 | mrceq p6, 0, \irqstat, c14, c0, 0 @ erratum 63 workaround | ||
28 | adds \irqnr, \irqstat, #1 | ||
29 | movne \irqnr, \irqstat, lsr #2 | ||
30 | .endm | ||
31 | |||
32 | .macro arch_ret_to_user, tmp1, tmp2 | ||
33 | mrc p15, 0, \tmp1, c15, c1, 0 | ||
34 | ands \tmp2, \tmp1, #(1 << 6) | ||
35 | bicne \tmp1, \tmp1, #(1 << 6) | ||
36 | mcrne p15, 0, \tmp1, c15, c1, 0 @ Disable cp6 access | ||
37 | .endm | ||
diff --git a/include/asm-arm/arch-iop33x/io.h b/include/asm-arm/arch-iop33x/io.h index c017402bab96..1bb5071e1fa8 100644 --- a/include/asm-arm/arch-iop33x/io.h +++ b/include/asm-arm/arch-iop33x/io.h | |||
@@ -13,9 +13,16 @@ | |||
13 | 13 | ||
14 | #include <asm/hardware.h> | 14 | #include <asm/hardware.h> |
15 | 15 | ||
16 | extern void __iomem * __ioremap(unsigned long, size_t, unsigned long); | ||
17 | extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size, | ||
18 | unsigned long flags); | ||
19 | extern void __iop3xx_iounmap(void __iomem *addr); | ||
20 | |||
16 | #define IO_SPACE_LIMIT 0xffffffff | 21 | #define IO_SPACE_LIMIT 0xffffffff |
17 | #define __io(p) ((void __iomem *)(p)) | 22 | #define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p)) |
18 | #define __mem_pci(a) (a) | 23 | #define __mem_pci(a) (a) |
19 | 24 | ||
25 | #define __arch_ioremap(a, s, f) __iop3xx_ioremap(a, s, f) | ||
26 | #define __arch_iounmap(a) __iop3xx_iounmap(a) | ||
20 | 27 | ||
21 | #endif | 28 | #endif |
diff --git a/include/asm-arm/arch-iop33x/time.h b/include/asm-arm/arch-iop33x/time.h new file mode 100644 index 000000000000..4ac4d7664f85 --- /dev/null +++ b/include/asm-arm/arch-iop33x/time.h | |||
@@ -0,0 +1,4 @@ | |||
1 | #ifndef _IOP33X_TIME_H_ | ||
2 | #define _IOP33X_TIME_H_ | ||
3 | #define IRQ_IOP_TIMER0 IRQ_IOP33X_TIMER0 | ||
4 | #endif | ||
diff --git a/include/asm-arm/arch-ixp2000/entry-macro.S b/include/asm-arm/arch-ixp2000/entry-macro.S index 16e1e6124b31..11d512ad5945 100644 --- a/include/asm-arm/arch-ixp2000/entry-macro.S +++ b/include/asm-arm/arch-ixp2000/entry-macro.S | |||
@@ -12,6 +12,12 @@ | |||
12 | .macro disable_fiq | 12 | .macro disable_fiq |
13 | .endm | 13 | .endm |
14 | 14 | ||
15 | .macro get_irqnr_preamble, base, tmp | ||
16 | .endm | ||
17 | |||
18 | .macro arch_ret_to_user, tmp1, tmp2 | ||
19 | .endm | ||
20 | |||
15 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 21 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
16 | 22 | ||
17 | mov \irqnr, #0x0 @clear out irqnr as default | 23 | mov \irqnr, #0x0 @clear out irqnr as default |
diff --git a/include/asm-arm/arch-ixp23xx/entry-macro.S b/include/asm-arm/arch-ixp23xx/entry-macro.S index 867761677b57..ec9dd6fc2d0f 100644 --- a/include/asm-arm/arch-ixp23xx/entry-macro.S +++ b/include/asm-arm/arch-ixp23xx/entry-macro.S | |||
@@ -5,6 +5,12 @@ | |||
5 | .macro disable_fiq | 5 | .macro disable_fiq |
6 | .endm | 6 | .endm |
7 | 7 | ||
8 | .macro get_irqnr_preamble, base, tmp | ||
9 | .endm | ||
10 | |||
11 | .macro arch_ret_to_user, tmp1, tmp2 | ||
12 | .endm | ||
13 | |||
8 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 14 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
9 | ldr \irqnr, =(IXP23XX_INTC_VIRT + IXP23XX_INTR_IRQ_ENC_ST_OFFSET) | 15 | ldr \irqnr, =(IXP23XX_INTC_VIRT + IXP23XX_INTR_IRQ_ENC_ST_OFFSET) |
10 | ldr \irqnr, [\irqnr] @ get interrupt number | 16 | ldr \irqnr, [\irqnr] @ get interrupt number |
diff --git a/include/asm-arm/arch-ixp23xx/ixdp2351.h b/include/asm-arm/arch-ixp23xx/ixdp2351.h index 4a24f8f15655..d5e8a43d7bbd 100644 --- a/include/asm-arm/arch-ixp23xx/ixdp2351.h +++ b/include/asm-arm/arch-ixp23xx/ixdp2351.h | |||
@@ -46,7 +46,7 @@ | |||
46 | #define IXDP2351_VIRT_NVRAM_BASE IXDP2351_BB_AREA_BASE(0x0) | 46 | #define IXDP2351_VIRT_NVRAM_BASE IXDP2351_BB_AREA_BASE(0x0) |
47 | #define IXDP2351_NVRAM_SIZE (0x20000) | 47 | #define IXDP2351_NVRAM_SIZE (0x20000) |
48 | 48 | ||
49 | #define IXDP2351_VIRT_MB_IXF1104_BASE IXDP3251_BB_AREA_BASE(0x00020000) | 49 | #define IXDP2351_VIRT_MB_IXF1104_BASE IXDP2351_BB_AREA_BASE(0x00020000) |
50 | #define IXDP2351_VIRT_ADD_UART_BASE IXDP2351_BB_AREA_BASE(0x000240C0) | 50 | #define IXDP2351_VIRT_ADD_UART_BASE IXDP2351_BB_AREA_BASE(0x000240C0) |
51 | #define IXDP2351_VIRT_FIC_BASE IXDP2351_BB_AREA_BASE(0x00200000) | 51 | #define IXDP2351_VIRT_FIC_BASE IXDP2351_BB_AREA_BASE(0x00200000) |
52 | #define IXDP2351_VIRT_DB0_BASE IXDP2351_BB_AREA_BASE(0x00400000) | 52 | #define IXDP2351_VIRT_DB0_BASE IXDP2351_BB_AREA_BASE(0x00400000) |
diff --git a/include/asm-arm/arch-ixp4xx/avila.h b/include/asm-arm/arch-ixp4xx/avila.h new file mode 100644 index 000000000000..0dfea0ccd6ba --- /dev/null +++ b/include/asm-arm/arch-ixp4xx/avila.h | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ixp4xx/avila.h | ||
3 | * | ||
4 | * Gateworks Avila platform specific definitions | ||
5 | * | ||
6 | * Author: Michael-Luke Jones <mlj28@cam.ac.uk> | ||
7 | * | ||
8 | * Based on ixdp425.h | ||
9 | * Author: Deepak Saxena <dsaxena@plexity.net> | ||
10 | * | ||
11 | * Copyright 2004 (c) MontaVista, Software, Inc. | ||
12 | * | ||
13 | * This file is licensed under the terms of the GNU General Public | ||
14 | * License version 2. This program is licensed "as is" without any | ||
15 | * warranty of any kind, whether express or implied. | ||
16 | */ | ||
17 | |||
18 | #ifndef __ASM_ARCH_HARDWARE_H__ | ||
19 | #error "Do not include this directly, instead #include <asm/hardware.h>" | ||
20 | #endif | ||
21 | |||
22 | #define AVILA_SDA_PIN 7 | ||
23 | #define AVILA_SCL_PIN 6 | ||
24 | |||
25 | /* | ||
26 | * AVILA PCI IRQs | ||
27 | */ | ||
28 | #define AVILA_PCI_MAX_DEV 4 | ||
29 | #define LOFT_PCI_MAX_DEV 6 | ||
30 | #define AVILA_PCI_IRQ_LINES 4 | ||
31 | |||
32 | |||
33 | /* PCI controller GPIO to IRQ pin mappings */ | ||
34 | #define AVILA_PCI_INTA_PIN 11 | ||
35 | #define AVILA_PCI_INTB_PIN 10 | ||
36 | #define AVILA_PCI_INTC_PIN 9 | ||
37 | #define AVILA_PCI_INTD_PIN 8 | ||
38 | |||
39 | |||
diff --git a/include/asm-arm/arch-ixp4xx/entry-macro.S b/include/asm-arm/arch-ixp4xx/entry-macro.S index 27e124132e4c..dadb568b7ef0 100644 --- a/include/asm-arm/arch-ixp4xx/entry-macro.S +++ b/include/asm-arm/arch-ixp4xx/entry-macro.S | |||
@@ -12,6 +12,12 @@ | |||
12 | .macro disable_fiq | 12 | .macro disable_fiq |
13 | .endm | 13 | .endm |
14 | 14 | ||
15 | .macro get_irqnr_preamble, base, tmp | ||
16 | .endm | ||
17 | |||
18 | .macro arch_ret_to_user, tmp1, tmp2 | ||
19 | .endm | ||
20 | |||
15 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 21 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
16 | ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP_OFFSET) | 22 | ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP_OFFSET) |
17 | ldr \irqstat, [\irqstat] @ get interrupts | 23 | ldr \irqstat, [\irqstat] @ get interrupts |
diff --git a/include/asm-arm/arch-ixp4xx/hardware.h b/include/asm-arm/arch-ixp4xx/hardware.h index 6acb69c95ef9..88fd0877dcc1 100644 --- a/include/asm-arm/arch-ixp4xx/hardware.h +++ b/include/asm-arm/arch-ixp4xx/hardware.h | |||
@@ -42,6 +42,7 @@ extern unsigned int processor_id; | |||
42 | 42 | ||
43 | /* Platform specific details */ | 43 | /* Platform specific details */ |
44 | #include "ixdp425.h" | 44 | #include "ixdp425.h" |
45 | #include "avila.h" | ||
45 | #include "coyote.h" | 46 | #include "coyote.h" |
46 | #include "prpmc1100.h" | 47 | #include "prpmc1100.h" |
47 | #include "nslu2.h" | 48 | #include "nslu2.h" |
diff --git a/include/asm-arm/arch-ixp4xx/irqs.h b/include/asm-arm/arch-ixp4xx/irqs.h index f24b763ca18e..e44a563d00ff 100644 --- a/include/asm-arm/arch-ixp4xx/irqs.h +++ b/include/asm-arm/arch-ixp4xx/irqs.h | |||
@@ -79,6 +79,15 @@ | |||
79 | #define IRQ_IXDP425_PCI_INTD IRQ_IXP4XX_GPIO8 | 79 | #define IRQ_IXDP425_PCI_INTD IRQ_IXP4XX_GPIO8 |
80 | 80 | ||
81 | /* | 81 | /* |
82 | * Gateworks Avila board IRQs | ||
83 | */ | ||
84 | #define IRQ_AVILA_PCI_INTA IRQ_IXP4XX_GPIO11 | ||
85 | #define IRQ_AVILA_PCI_INTB IRQ_IXP4XX_GPIO10 | ||
86 | #define IRQ_AVILA_PCI_INTC IRQ_IXP4XX_GPIO9 | ||
87 | #define IRQ_AVILA_PCI_INTD IRQ_IXP4XX_GPIO8 | ||
88 | |||
89 | |||
90 | /* | ||
82 | * PrPMC1100 Board IRQs | 91 | * PrPMC1100 Board IRQs |
83 | */ | 92 | */ |
84 | #define IRQ_PRPMC1100_PCI_INTA IRQ_IXP4XX_GPIO11 | 93 | #define IRQ_PRPMC1100_PCI_INTA IRQ_IXP4XX_GPIO11 |
diff --git a/include/asm-arm/arch-ixp4xx/udc.h b/include/asm-arm/arch-ixp4xx/udc.h index dbdec36ff0d1..79b850a3be47 100644 --- a/include/asm-arm/arch-ixp4xx/udc.h +++ b/include/asm-arm/arch-ixp4xx/udc.h | |||
@@ -6,3 +6,25 @@ | |||
6 | 6 | ||
7 | extern void ixp4xx_set_udc_info(struct pxa2xx_udc_mach_info *info); | 7 | extern void ixp4xx_set_udc_info(struct pxa2xx_udc_mach_info *info); |
8 | 8 | ||
9 | static inline int udc_gpio_to_irq(unsigned gpio) | ||
10 | { | ||
11 | return 0; | ||
12 | } | ||
13 | |||
14 | static inline void udc_gpio_init_vbus(unsigned gpio) | ||
15 | { | ||
16 | } | ||
17 | |||
18 | static inline void udc_gpio_init_pullup(unsigned gpio) | ||
19 | { | ||
20 | } | ||
21 | |||
22 | static inline int udc_gpio_get(unsigned gpio) | ||
23 | { | ||
24 | return 0; | ||
25 | } | ||
26 | |||
27 | static inline void udc_gpio_set(unsigned gpio, int is_on) | ||
28 | { | ||
29 | } | ||
30 | |||
diff --git a/include/asm-arm/arch-l7200/entry-macro.S b/include/asm-arm/arch-l7200/entry-macro.S index 8b6342dc4be2..63411d3e9df4 100644 --- a/include/asm-arm/arch-l7200/entry-macro.S +++ b/include/asm-arm/arch-l7200/entry-macro.S | |||
@@ -14,6 +14,12 @@ | |||
14 | .macro disable_fiq | 14 | .macro disable_fiq |
15 | .endm | 15 | .endm |
16 | 16 | ||
17 | .macro get_irqnr_preamble, base, tmp | ||
18 | .endm | ||
19 | |||
20 | .macro arch_ret_to_user, tmp1, tmp2 | ||
21 | .endm | ||
22 | |||
17 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 23 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
18 | mov \irqstat, #irq_base_addr @ Virt addr IRQ regs | 24 | mov \irqstat, #irq_base_addr @ Virt addr IRQ regs |
19 | add \irqstat, \irqstat, #0x00001000 @ Status reg | 25 | add \irqstat, \irqstat, #0x00001000 @ Status reg |
diff --git a/include/asm-arm/arch-lh7a40x/entry-macro.S b/include/asm-arm/arch-lh7a40x/entry-macro.S index 9fc7f4988124..502700604e00 100644 --- a/include/asm-arm/arch-lh7a40x/entry-macro.S +++ b/include/asm-arm/arch-lh7a40x/entry-macro.S | |||
@@ -26,6 +26,12 @@ | |||
26 | .macro disable_fiq | 26 | .macro disable_fiq |
27 | .endm | 27 | .endm |
28 | 28 | ||
29 | .macro get_irqnr_preamble, base, tmp | ||
30 | .endm | ||
31 | |||
32 | .macro arch_ret_to_user, tmp1, tmp2 | ||
33 | .endm | ||
34 | |||
29 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 35 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
30 | 36 | ||
31 | branch_irq_lh7a400: b 1000f | 37 | branch_irq_lh7a400: b 1000f |
diff --git a/include/asm-arm/arch-netx/entry-macro.S b/include/asm-arm/arch-netx/entry-macro.S index 658df4d60ff3..83ad188a0847 100644 --- a/include/asm-arm/arch-netx/entry-macro.S +++ b/include/asm-arm/arch-netx/entry-macro.S | |||
@@ -23,6 +23,12 @@ | |||
23 | .macro disable_fiq | 23 | .macro disable_fiq |
24 | .endm | 24 | .endm |
25 | 25 | ||
26 | .macro get_irqnr_preamble, base, tmp | ||
27 | .endm | ||
28 | |||
29 | .macro arch_ret_to_user, tmp1, tmp2 | ||
30 | .endm | ||
31 | |||
26 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 32 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
27 | mov \base, #io_p2v(0x00100000) | 33 | mov \base, #io_p2v(0x00100000) |
28 | add \base, \base, #0x000ff000 | 34 | add \base, \base, #0x000ff000 |
diff --git a/include/asm-arm/arch-ns9xxx/board.h b/include/asm-arm/arch-ns9xxx/board.h new file mode 100644 index 000000000000..91dc8fb1027f --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/board.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/board.h | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_BOARD_H | ||
12 | #define __ASM_ARCH_BOARD_H | ||
13 | |||
14 | #include <asm/mach-types.h> | ||
15 | |||
16 | #define board_is_a9m9750dev() (machine_is_cc9p9360dev()) | ||
17 | |||
18 | #endif /* ifndef __ASM_ARCH_BOARD_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/clock.h b/include/asm-arm/arch-ns9xxx/clock.h new file mode 100644 index 000000000000..4371a485db47 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/clock.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/clock.h | ||
3 | * | ||
4 | * Copyright (C) 2007 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_CLOCK_H | ||
12 | #define __ASM_ARCH_CLOCK_H | ||
13 | |||
14 | static inline u32 ns9xxx_systemclock(void) | ||
15 | { | ||
16 | /* | ||
17 | * This should be a multiple of HZ * TIMERCLOCKSELECT (in time.c) | ||
18 | */ | ||
19 | return 353894400; | ||
20 | } | ||
21 | |||
22 | static inline const u32 ns9xxx_cpuclock(void) | ||
23 | { | ||
24 | return ns9xxx_systemclock() / 2; | ||
25 | } | ||
26 | |||
27 | static inline const u32 ns9xxx_ahbclock(void) | ||
28 | { | ||
29 | return ns9xxx_systemclock() / 4; | ||
30 | } | ||
31 | |||
32 | static inline const u32 ns9xxx_bbusclock(void) | ||
33 | { | ||
34 | return ns9xxx_systemclock() / 8; | ||
35 | } | ||
36 | |||
37 | #endif /* ifndef __ASM_ARCH_CLOCK_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/debug-macro.S b/include/asm-arm/arch-ns9xxx/debug-macro.S new file mode 100644 index 000000000000..b21b93eb2dbc --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/debug-macro.S | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/debug-macro.S | ||
3 | * Copyright (C) 2006 by Digi International Inc. | ||
4 | * All rights reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License version 2 as published by | ||
8 | * the Free Software Foundation. | ||
9 | */ | ||
10 | #include <asm/hardware.h> | ||
11 | |||
12 | #include <asm/arch-ns9xxx/regs-board-a9m9750dev.h> | ||
13 | |||
14 | .macro addruart,rx | ||
15 | mrc p15, 0, \rx, c1, c0 | ||
16 | tst \rx, #1 | ||
17 | ldreq \rx, =NS9XXX_CSxSTAT_PHYS(0) | ||
18 | ldrne \rx, =io_p2v(NS9XXX_CSxSTAT_PHYS(0)) | ||
19 | .endm | ||
20 | |||
21 | #define UART_SHIFT 2 | ||
22 | #include <asm/hardware/debug-8250.S> | ||
diff --git a/include/asm-arm/arch-ns9xxx/dma.h b/include/asm-arm/arch-ns9xxx/dma.h new file mode 100644 index 000000000000..a67cbbe009c4 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/dma.h | |||
@@ -0,0 +1,14 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/dma.h | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_DMA_H | ||
12 | #define __ASM_ARCH_DMA_H | ||
13 | |||
14 | #endif /* ifndef __ASM_ARCH_DMA_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/entry-macro.S b/include/asm-arm/arch-ns9xxx/entry-macro.S new file mode 100644 index 000000000000..467a1986d259 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/entry-macro.S | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/entry-macro.S | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #include <asm/hardware.h> | ||
12 | #include <asm/arch-ns9xxx/regs-sys.h> | ||
13 | |||
14 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
15 | ldr \base, =SYS_ISRADDR | ||
16 | ldr \irqstat, [\base, #(SYS_ISA - SYS_ISRADDR)] | ||
17 | cmp \irqstat, #0 | ||
18 | ldrne \irqnr, [\base] | ||
19 | .endm | ||
20 | |||
21 | .macro disable_fiq | ||
22 | .endm | ||
diff --git a/include/asm-arm/arch-ns9xxx/hardware.h b/include/asm-arm/arch-ns9xxx/hardware.h new file mode 100644 index 000000000000..6819da7c48d4 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/hardware.h | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/hardware.h | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_HARDWARE_H | ||
12 | #define __ASM_ARCH_HARDWARE_H | ||
13 | |||
14 | #include <asm/memory.h> | ||
15 | |||
16 | /* | ||
17 | * NetSilicon NS9xxx internal mapping: | ||
18 | * | ||
19 | * physical <--> virtual | ||
20 | * 0x90000000 - 0x906fffff <--> 0xf9000000 - 0xf96fffff | ||
21 | * 0xa0100000 - 0xa0afffff <--> 0xfa100000 - 0xfaafffff | ||
22 | */ | ||
23 | #define io_p2v(x) (0xf0000000 \ | ||
24 | + (((x) & 0xf0000000) >> 4) \ | ||
25 | + ((x) & 0x00ffffff)) | ||
26 | |||
27 | #define io_v2p(x) ((((x) & 0x0f000000) << 4) \ | ||
28 | + ((x) & 0x00ffffff)) | ||
29 | |||
30 | #define __REGBIT(bit) ((u32)1 << (bit)) | ||
31 | #define __REGBITS(hbit, lbit) ((((u32)1 << ((hbit) - (lbit) + 1)) - 1) << (lbit)) | ||
32 | #define __REGVAL(mask, value) (((value) * ((mask) & (-(mask))) & (mask))) | ||
33 | |||
34 | #ifndef __ASSEMBLY__ | ||
35 | |||
36 | # define __REG(x) (*((volatile u32 *)io_p2v((x)))) | ||
37 | # define __REG2(x, y) (*((volatile u32 *)io_p2v((x)) + (y))) | ||
38 | |||
39 | # define __REGB(x) (*((volatile u8 *)io_p2v((x)))) | ||
40 | # define __REGB2(x) (*((volatile u8 *)io_p2v((x)) + (y))) | ||
41 | |||
42 | # define REGSET(var, reg, field, value) \ | ||
43 | ((var) = (((var) \ | ||
44 | & ~(reg ## _ ## field & \ | ||
45 | ~ reg ## _ ## field ## _ ## value)) \ | ||
46 | | (reg ## _ ## field ## _ ## value))) | ||
47 | |||
48 | # define REGSETIM(var, reg, field, value) \ | ||
49 | ((var) = (((var) \ | ||
50 | & ~(reg ## _ ## field & \ | ||
51 | ~(__REGVAL(reg ## _ ## field, value)))) \ | ||
52 | | (__REGVAL(reg ## _ ## field, value)))) | ||
53 | |||
54 | # define REGGET(reg, field) \ | ||
55 | ((reg & (reg ## _ ## field)) / (field & (-field))) | ||
56 | |||
57 | #else | ||
58 | |||
59 | # define __REG(x) io_p2v(x) | ||
60 | # define __REG2(x, y) io_p2v((x) + (y)) | ||
61 | |||
62 | # define __REGB(x) __REG((x)) | ||
63 | # define __REGB2(x, y) __REG2((x), (y)) | ||
64 | |||
65 | #endif | ||
66 | |||
67 | #endif /* ifndef __ASM_ARCH_HARDWARE_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/io.h b/include/asm-arm/arch-ns9xxx/io.h new file mode 100644 index 000000000000..6f82d28af120 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/io.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/io.h | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_IO_H | ||
12 | #define __ASM_ARCH_IO_H | ||
13 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff /* XXX */ | ||
15 | |||
16 | #define __io(a) ((void __iomem *)(a)) | ||
17 | #define __mem_pci(a) (a) | ||
18 | #define __mem_isa(a) (IO_BASE + (a)) | ||
19 | |||
20 | #endif /* ifndef __ASM_ARCH_IO_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/irqs.h b/include/asm-arm/arch-ns9xxx/irqs.h new file mode 100644 index 000000000000..25d8d28b27f3 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/irqs.h | |||
@@ -0,0 +1,85 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/irqs.h | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_IRQS_H | ||
12 | #define __ASM_ARCH_IRQS_H | ||
13 | |||
14 | #define IRQ_WATCHDOG 0 | ||
15 | #define IRQ_AHBBUSERR 1 | ||
16 | #define IRQ_BBUSAGG 2 | ||
17 | /* irq 3 is reserved for NS9360 */ | ||
18 | #define IRQ_ETHRX 4 | ||
19 | #define IRQ_ETHTX 5 | ||
20 | #define IRQ_ETHPHY 6 | ||
21 | #define IRQ_LCD 7 | ||
22 | #define IRQ_SERBRX 8 | ||
23 | #define IRQ_SERBTX 9 | ||
24 | #define IRQ_SERARX 10 | ||
25 | #define IRQ_SERATX 11 | ||
26 | #define IRQ_SERCRX 12 | ||
27 | #define IRQ_SERCTX 13 | ||
28 | #define IRQ_I2C 14 | ||
29 | #define IRQ_BBUSDMA 15 | ||
30 | #define IRQ_TIMER0 16 | ||
31 | #define IRQ_TIMER1 17 | ||
32 | #define IRQ_TIMER2 18 | ||
33 | #define IRQ_TIMER3 19 | ||
34 | #define IRQ_TIMER4 20 | ||
35 | #define IRQ_TIMER5 21 | ||
36 | #define IRQ_TIMER6 22 | ||
37 | #define IRQ_TIMER7 23 | ||
38 | #define IRQ_RTC 24 | ||
39 | #define IRQ_USBHOST 25 | ||
40 | #define IRQ_USBDEVICE 26 | ||
41 | #define IRQ_IEEE1284 27 | ||
42 | #define IRQ_EXT0 28 | ||
43 | #define IRQ_EXT1 29 | ||
44 | #define IRQ_EXT2 30 | ||
45 | #define IRQ_EXT3 31 | ||
46 | |||
47 | #define BBUS_IRQ(irq) (32 + irq) | ||
48 | |||
49 | #define IRQ_BBUS_DMA BBUS_IRQ(0) | ||
50 | #define IRQ_BBUS_SERBRX BBUS_IRQ(2) | ||
51 | #define IRQ_BBUS_SERBTX BBUS_IRQ(3) | ||
52 | #define IRQ_BBUS_SERARX BBUS_IRQ(4) | ||
53 | #define IRQ_BBUS_SERATX BBUS_IRQ(5) | ||
54 | #define IRQ_BBUS_SERCRX BBUS_IRQ(6) | ||
55 | #define IRQ_BBUS_SERCTX BBUS_IRQ(7) | ||
56 | #define IRQ_BBUS_SERDRX BBUS_IRQ(8) | ||
57 | #define IRQ_BBUS_SERDTX BBUS_IRQ(9) | ||
58 | #define IRQ_BBUS_I2C BBUS_IRQ(10) | ||
59 | #define IRQ_BBUS_1284 BBUS_IRQ(11) | ||
60 | #define IRQ_BBUS_UTIL BBUS_IRQ(12) | ||
61 | #define IRQ_BBUS_RTC BBUS_IRQ(13) | ||
62 | #define IRQ_BBUS_USBHST BBUS_IRQ(14) | ||
63 | #define IRQ_BBUS_USBDEV BBUS_IRQ(15) | ||
64 | #define IRQ_BBUS_AHBDMA1 BBUS_IRQ(24) | ||
65 | #define IRQ_BBUS_AHBDMA2 BBUS_IRQ(25) | ||
66 | |||
67 | /* | ||
68 | * these Interrupts are specific for the a9m9750dev board. | ||
69 | * They are generated by an FPGA that interrupts the CPU on | ||
70 | * IRQ_EXT2 | ||
71 | */ | ||
72 | #define FPGA_IRQ(irq) (64 + irq) | ||
73 | |||
74 | #define IRQ_FPGA_UARTA FPGA_IRQ(0) | ||
75 | #define IRQ_FPGA_UARTB FPGA_IRQ(1) | ||
76 | #define IRQ_FPGA_UARTC FPGA_IRQ(2) | ||
77 | #define IRQ_FPGA_UARTD FPGA_IRQ(3) | ||
78 | #define IRQ_FPGA_TOUCH FPGA_IRQ(4) | ||
79 | #define IRQ_FPGA_CF FPGA_IRQ(5) | ||
80 | #define IRQ_FPGA_CAN0 FPGA_IRQ(6) | ||
81 | #define IRQ_FPGA_CAN1 FPGA_IRQ(7) | ||
82 | |||
83 | #define NR_IRQS 72 | ||
84 | |||
85 | #endif /* __ASM_ARCH_IRQS_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/memory.h b/include/asm-arm/arch-ns9xxx/memory.h new file mode 100644 index 000000000000..ce1343e593e1 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/memory.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/memory.h | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_MEMORY_H | ||
12 | #define __ASM_ARCH_MEMORY_H | ||
13 | |||
14 | /* x in [0..3] */ | ||
15 | #define NS9XXX_CSxSTAT_PHYS(x) UL(((x) + 4) << 28) | ||
16 | |||
17 | #define NS9XXX_CS0STAT_LENGTH UL(0x1000) | ||
18 | #define NS9XXX_CS1STAT_LENGTH UL(0x1000) | ||
19 | #define NS9XXX_CS2STAT_LENGTH UL(0x1000) | ||
20 | #define NS9XXX_CS3STAT_LENGTH UL(0x1000) | ||
21 | |||
22 | #define PHYS_OFFSET UL(0x00000000) | ||
23 | |||
24 | #define __virt_to_bus(x) __virt_to_phys(x) | ||
25 | #define __bus_to_virt(x) __phys_to_virt(x) | ||
26 | |||
27 | #endif | ||
diff --git a/include/asm-arm/arch-ns9xxx/processor.h b/include/asm-arm/arch-ns9xxx/processor.h new file mode 100644 index 000000000000..716c106ac0bf --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/processor.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/processor.h | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_PROCESSOR_H | ||
12 | #define __ASM_ARCH_PROCESSOR_H | ||
13 | |||
14 | #include <asm/mach-types.h> | ||
15 | |||
16 | #define processor_is_ns9360() (machine_is_cc9p9360dev()) | ||
17 | |||
18 | #endif /* ifndef __ASM_ARCH_PROCESSOR_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/regs-bbu.h b/include/asm-arm/arch-ns9xxx/regs-bbu.h new file mode 100644 index 000000000000..e26269546240 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/regs-bbu.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/regs-bbu.h | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_REGSBBU_H | ||
12 | #define __ASM_ARCH_REGSBBU_H | ||
13 | |||
14 | #include <asm/hardware.h> | ||
15 | |||
16 | /* BBus Utility */ | ||
17 | |||
18 | /* GPIO Configuration Register */ | ||
19 | #define BBU_GC(x) __REG2(0x9060000c, (x)) | ||
20 | |||
21 | #endif /* ifndef __ASM_ARCH_REGSBBU_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/regs-board-a9m9750dev.h b/include/asm-arm/arch-ns9xxx/regs-board-a9m9750dev.h new file mode 100644 index 000000000000..c3dc532dd20c --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/regs-board-a9m9750dev.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/regs-board-a9m9750dev.h | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_REGSBOARDA9M9750_H | ||
12 | #define __ASM_ARCH_REGSBOARDA9M9750_H | ||
13 | |||
14 | #include <asm/hardware.h> | ||
15 | |||
16 | #define FPGA_UARTA_BASE io_p2v(NS9XXX_CSxSTAT_PHYS(0)) | ||
17 | #define FPGA_UARTB_BASE io_p2v(NS9XXX_CSxSTAT_PHYS(0) + 0x08) | ||
18 | #define FPGA_UARTC_BASE io_p2v(NS9XXX_CSxSTAT_PHYS(0) + 0x10) | ||
19 | #define FPGA_UARTD_BASE io_p2v(NS9XXX_CSxSTAT_PHYS(0) + 0x18) | ||
20 | |||
21 | #define FPGA_IER __REGB(NS9XXX_CSxSTAT_PHYS(0) + 0x50) | ||
22 | #define FPGA_ISR __REGB(NS9XXX_CSxSTAT_PHYS(0) + 0x60) | ||
23 | |||
24 | #endif /* ifndef __ASM_ARCH_REGSBOARDA9M9750_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/regs-mem.h b/include/asm-arm/arch-ns9xxx/regs-mem.h new file mode 100644 index 000000000000..8ed8448767b9 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/regs-mem.h | |||
@@ -0,0 +1,135 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/regs-mem.h | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_REGSMEM_H | ||
12 | #define __ASM_ARCH_REGSMEM_H | ||
13 | |||
14 | #include <asm/hardware.h> | ||
15 | |||
16 | /* Memory Module */ | ||
17 | |||
18 | /* Control register */ | ||
19 | #define MEM_CTRL __REG(0xa0700000) | ||
20 | |||
21 | /* Status register */ | ||
22 | #define MEM_STAT __REG(0xa0700004) | ||
23 | |||
24 | /* Configuration register */ | ||
25 | #define MEM_CONF __REG(0xa0700008) | ||
26 | |||
27 | /* Dynamic Memory Control register */ | ||
28 | #define MEM_DMCTRL __REG(0xa0700020) | ||
29 | |||
30 | /* Dynamic Memory Refresh Timer */ | ||
31 | #define MEM_DMRT __REG(0xa0700024) | ||
32 | |||
33 | /* Dynamic Memory Read Configuration register */ | ||
34 | #define MEM_DMRC __REG(0xa0700028) | ||
35 | |||
36 | /* Dynamic Memory Precharge Command Period (tRP) */ | ||
37 | #define MEM_DMPCP __REG(0xa0700030) | ||
38 | |||
39 | /* Dynamic Memory Active to Precharge Command Period (tRAS) */ | ||
40 | #define MEM_DMAPCP __REG(0xa0700034) | ||
41 | |||
42 | /* Dynamic Memory Self-Refresh Exit Time (tSREX) */ | ||
43 | #define MEM_DMSRET __REG(0xa0700038) | ||
44 | |||
45 | /* Dynamic Memory Last Data Out to Active Time (tAPR) */ | ||
46 | #define MEM_DMLDOAT __REG(0xa070003c) | ||
47 | |||
48 | /* Dynamic Memory Data-in to Active Command Time (tDAL or TAPW) */ | ||
49 | #define MEM_DMDIACT __REG(0xa0700040) | ||
50 | |||
51 | /* Dynamic Memory Write Recovery Time (tWR, tDPL, tRWL, tRDL) */ | ||
52 | #define MEM_DMWRT __REG(0xa0700044) | ||
53 | |||
54 | /* Dynamic Memory Active to Active Command Period (tRC) */ | ||
55 | #define MEM_DMAACP __REG(0xa0700048) | ||
56 | |||
57 | /* Dynamic Memory Auto Refresh Period, and Auto Refresh to Active Command Period (tRFC) */ | ||
58 | #define MEM_DMARP __REG(0xa070004c) | ||
59 | |||
60 | /* Dynamic Memory Exit Self-Refresh to Active Command (tXSR) */ | ||
61 | #define MEM_DMESRAC __REG(0xa0700050) | ||
62 | |||
63 | /* Dynamic Memory Active Bank A to Active B Time (tRRD) */ | ||
64 | #define MEM_DMABAABT __REG(0xa0700054) | ||
65 | |||
66 | /* Dynamic Memory Load Mode register to Active Command Time (tMRD) */ | ||
67 | #define MEM_DMLMACT __REG(0xa0700058) | ||
68 | |||
69 | /* Static Memory Extended Wait */ | ||
70 | #define MEM_SMEW __REG(0xa0700080) | ||
71 | |||
72 | /* Dynamic Memory Configuration Register x */ | ||
73 | #define MEM_DMCONF(x) __REG2(0xa0700100, (x) << 3) | ||
74 | |||
75 | /* Dynamic Memory RAS and CAS Delay x */ | ||
76 | #define MEM_DMRCD(x) __REG2(0xa0700104, (x) << 3) | ||
77 | |||
78 | /* Static Memory Configuration Register x */ | ||
79 | #define MEM_SMC(x) __REG2(0xa0700200, (x) << 3) | ||
80 | |||
81 | /* Static Memory Configuration Register x: Write protect */ | ||
82 | #define MEM_SMC_WSMC __REGBIT(20) | ||
83 | #define MEM_SMC_WSMC_OFF __REGVAL(MEM_SMC_WSMC, 0) | ||
84 | #define MEM_SMC_WSMC_ON __REGVAL(MEM_SMC_WSMC, 1) | ||
85 | |||
86 | /* Static Memory Configuration Register x: Buffer enable */ | ||
87 | #define MEM_SMC_BSMC __REGBIT(19) | ||
88 | #define MEM_SMC_BSMC_OFF __REGVAL(MEM_SMC_BSMC, 0) | ||
89 | #define MEM_SMC_BSMC_ON __REGVAL(MEM_SMC_BSMC, 1) | ||
90 | |||
91 | /* Static Memory Configuration Register x: Extended Wait */ | ||
92 | #define MEM_SMC_EW __REGBIT(8) | ||
93 | #define MEM_SMC_EW_OFF __REGVAL(MEM_SMC_EW, 0) | ||
94 | #define MEM_SMC_EW_ON __REGVAL(MEM_SMC_EW, 1) | ||
95 | |||
96 | /* Static Memory Configuration Register x: Byte lane state */ | ||
97 | #define MEM_SMC_PB __REGBIT(7) | ||
98 | #define MEM_SMC_PB_0 __REGVAL(MEM_SMC_PB, 0) | ||
99 | #define MEM_SMC_PB_1 __REGVAL(MEM_SMC_PB, 1) | ||
100 | |||
101 | /* Static Memory Configuration Register x: Chip select polarity */ | ||
102 | #define MEM_SMC_PC __REGBIT(6) | ||
103 | #define MEM_SMC_PC_AL __REGVAL(MEM_SMC_PC, 0) | ||
104 | #define MEM_SMC_PC_AH __REGVAL(MEM_SMC_PC, 1) | ||
105 | |||
106 | /* static memory configuration register x: page mode*/ | ||
107 | #define MEM_SMC_PM __REGBIT(3) | ||
108 | #define MEM_SMC_PM_DIS __REGVAL(MEM_SMC_PM, 0) | ||
109 | #define MEM_SMC_PM_ASYNC __REGVAL(MEM_SMC_PM, 1) | ||
110 | |||
111 | /* static memory configuration register x: Memory width */ | ||
112 | #define MEM_SMC_MW __REGBITS(1, 0) | ||
113 | #define MEM_SMC_MW_8 __REGVAL(MEM_SMC_MW, 0) | ||
114 | #define MEM_SMC_MW_16 __REGVAL(MEM_SMC_MW, 1) | ||
115 | #define MEM_SMC_MW_32 __REGVAL(MEM_SMC_MW, 2) | ||
116 | |||
117 | /* Static Memory Write Enable Delay x */ | ||
118 | #define MEM_SMWED(x) __REG2(0xa0700204, (x) << 3) | ||
119 | |||
120 | /* Static Memory Output Enable Delay x */ | ||
121 | #define MEM_SMOED(x) __REG2(0xa0700208, (x) << 3) | ||
122 | |||
123 | /* Static Memory Read Delay x */ | ||
124 | #define MEM_SMRD(x) __REG2(0xa070020c, (x) << 3) | ||
125 | |||
126 | /* Static Memory Page Mode Read Delay 0 */ | ||
127 | #define MEM_SMPMRD(x) __REG2(0xa0700210, (x) << 3) | ||
128 | |||
129 | /* Static Memory Write Delay */ | ||
130 | #define MEM_SMWD(x) __REG2(0xa0700214, (x) << 3) | ||
131 | |||
132 | /* Static Memory Turn Round Delay x */ | ||
133 | #define MEM_SWT(x) __REG2(0xa0700218, (x) << 3) | ||
134 | |||
135 | #endif /* ifndef __ASM_ARCH_REGSMEM_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/regs-sys.h b/include/asm-arm/arch-ns9xxx/regs-sys.h new file mode 100644 index 000000000000..8162a50bb273 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/regs-sys.h | |||
@@ -0,0 +1,157 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/regs-sys.h | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_REGSSYS_H | ||
12 | #define __ASM_ARCH_REGSSYS_H | ||
13 | |||
14 | #include <asm/hardware.h> | ||
15 | |||
16 | /* System Control Module */ | ||
17 | |||
18 | /* AHB Arbiter Gen Configuration */ | ||
19 | #define SYS_AHBAGENCONF __REG(0xa0900000) | ||
20 | |||
21 | /* BRC */ | ||
22 | #define SYS_BRC(x) __REG2(0xa0900004, (x)) | ||
23 | |||
24 | /* Timer x Reload Count register */ | ||
25 | #define SYS_TRC(x) __REG2(0xa0900044, (x)) | ||
26 | |||
27 | /* Timer x Read register */ | ||
28 | #define SYS_TR(x) __REG2(0xa0900084, (x)) | ||
29 | |||
30 | /* Interrupt Vector Address Register Level x */ | ||
31 | #define SYS_IVA(x) __REG2(0xa09000c4, (x)) | ||
32 | |||
33 | /* Interrupt Configuration registers */ | ||
34 | #define SYS_IC(x) __REG2(0xa0900144, (x)) | ||
35 | |||
36 | /* ISRADDR */ | ||
37 | #define SYS_ISRADDR __REG(0xa0900164) | ||
38 | |||
39 | /* Interrupt Status Active */ | ||
40 | #define SYS_ISA __REG(0xa0900168) | ||
41 | |||
42 | /* Interrupt Status Raw */ | ||
43 | #define SYS_ISR __REG(0xa090016c) | ||
44 | |||
45 | /* Timer Interrupt Status register */ | ||
46 | #define SYS_TIS __REG(0xa0900170) | ||
47 | |||
48 | /* PLL Configuration register */ | ||
49 | #define SYS_PLL __REG(0xa0900188) | ||
50 | |||
51 | /* PLL Configuration register: PLL SW change */ | ||
52 | #define SYS_PLL_SWC __REGBIT(15) | ||
53 | #define SYS_PLL_SWC_NO __REGVAL(SYS_PLL_SWC, 0) | ||
54 | #define SYS_PLL_SWC_YES __REGVAL(SYS_PLL_SWC, 1) | ||
55 | |||
56 | /* Timer x Control register */ | ||
57 | #define SYS_TC(x) __REG2(0xa0900190, (x)) | ||
58 | |||
59 | /* Timer x Control register: Timer enable */ | ||
60 | #define SYS_TCx_TEN __REGBIT(15) | ||
61 | #define SYS_TCx_TEN_DIS __REGVAL(SYS_TCx_TEN, 1) | ||
62 | #define SYS_TCx_TEN_EN __REGVAL(SYS_TCx_TEN, 1) | ||
63 | |||
64 | /* Timer x Control register: CPU debug mode */ | ||
65 | #define SYS_TCx_TDBG __REGBIT(10) | ||
66 | #define SYS_TCx_TDBG_CONT __REGVAL(SYS_TCx_TDBG, 0) | ||
67 | #define SYS_TCx_TDBG_STOP __REGVAL(SYS_TCx_TDBG, 1) | ||
68 | |||
69 | /* Timer x Control register: Interrupt clear */ | ||
70 | #define SYS_TCx_INTC __REGBIT(9) | ||
71 | #define SYS_TCx_INTC_UNSET __REGVAL(SYS_TCx_INTC, 0) | ||
72 | #define SYS_TCx_INTC_SET __REGVAL(SYS_TCx_INTC, 1) | ||
73 | |||
74 | /* Timer x Control register: Timer clock select */ | ||
75 | #define SYS_TCx_TLCS __REGBITS(8, 6) | ||
76 | #define SYS_TCx_TLCS_CPU __REGVAL(SYS_TCx_TLCS, 0) /* CPU clock */ | ||
77 | #define SYS_TCx_TLCS_DIV2 __REGVAL(SYS_TCx_TLCS, 1) /* CPU clock / 2 */ | ||
78 | #define SYS_TCx_TLCS_DIV4 __REGVAL(SYS_TCx_TLCS, 2) /* CPU clock / 4 */ | ||
79 | #define SYS_TCx_TLCS_DIV8 __REGVAL(SYS_TCx_TLCS, 3) /* CPU clock / 8 */ | ||
80 | #define SYS_TCx_TLCS_DIV16 __REGVAL(SYS_TCx_TLCS, 4) /* CPU clock / 16 */ | ||
81 | #define SYS_TCx_TLCS_DIV32 __REGVAL(SYS_TCx_TLCS, 5) /* CPU clock / 32 */ | ||
82 | #define SYS_TCx_TLCS_DIV64 __REGVAL(SYS_TCx_TLCS, 6) /* CPU clock / 64 */ | ||
83 | #define SYS_TCx_TLCS_EXT __REGVAL(SYS_TCx_TLCS, 7) | ||
84 | |||
85 | /* Timer x Control register: Timer mode */ | ||
86 | #define SYS_TCx_TM __REGBITS(5, 4) | ||
87 | #define SYS_TCx_TM_IEE __REGVAL(SYS_TCx_TM, 0) /* Internal timer or external event */ | ||
88 | #define SYS_TCx_TM_ELL __REGVAL(SYS_TCx_TM, 1) /* External low-level, gated timer */ | ||
89 | #define SYS_TCx_TM_EHL __REGVAL(SYS_TCx_TM, 2) /* External high-level, gated timer */ | ||
90 | #define SYS_TCx_TM_CONCAT __REGVAL(SYS_TCx_TM, 3) /* Concatenate the lower timer. */ | ||
91 | |||
92 | /* Timer x Control register: Interrupt select */ | ||
93 | #define SYS_TCx_INTS __REGBIT(3) | ||
94 | #define SYS_TCx_INTS_DIS __REGVAL(SYS_TCx_INTS, 0) | ||
95 | #define SYS_TCx_INTS_EN __REGVAL(SYS_TCx_INTS, 1) | ||
96 | |||
97 | /* Timer x Control register: Up/down select */ | ||
98 | #define SYS_TCx_UDS __REGBIT(2) | ||
99 | #define SYS_TCx_UDS_UP __REGVAL(SYS_TCx_UDS, 0) | ||
100 | #define SYS_TCx_UDS_DOWN __REGVAL(SYS_TCx_UDS, 1) | ||
101 | |||
102 | /* Timer x Control register: 32- or 16-bit timer */ | ||
103 | #define SYS_TCx_TSZ __REGBIT(1) | ||
104 | #define SYS_TCx_TSZ_16 __REGVAL(SYS_TCx_TSZ, 0) | ||
105 | #define SYS_TCx_TSZ_32 __REGVAL(SYS_TCx_TSZ, 1) | ||
106 | |||
107 | /* Timer x Control register: Reload enable */ | ||
108 | #define SYS_TCx_REN __REGBIT(0) | ||
109 | #define SYS_TCx_REN_DIS __REGVAL(SYS_TCx_REN, 0) | ||
110 | #define SYS_TCx_REN_EN __REGVAL(SYS_TCx_REN, 1) | ||
111 | |||
112 | /* System Memory Chip Select x Dynamic Memory Base */ | ||
113 | #define SYS_SMCSDMB(x) __REG2(0xa09001d0, (x) << 1) | ||
114 | |||
115 | /* System Memory Chip Select x Dynamic Memory Mask */ | ||
116 | #define SYS_SMCSDMM(x) __REG2(0xa09001d4, (x) << 1) | ||
117 | |||
118 | /* System Memory Chip Select x Static Memory Base */ | ||
119 | #define SYS_SMCSSMB(x) __REG2(0xa09001f0, (x) << 1) | ||
120 | |||
121 | /* System Memory Chip Select x Static Memory Base: Chip select x base */ | ||
122 | #define SYS_SMCSSMB_CSxB __REGBITS(31, 12) | ||
123 | |||
124 | /* System Memory Chip Select x Static Memory Mask */ | ||
125 | #define SYS_SMCSSMM(x) __REG2(0xa09001f4, (x) << 1) | ||
126 | |||
127 | /* System Memory Chip Select x Static Memory Mask: Chip select x mask */ | ||
128 | #define SYS_SMCSSMM_CSxM __REGBITS(31, 12) | ||
129 | |||
130 | /* System Memory Chip Select x Static Memory Mask: Chip select x enable */ | ||
131 | #define SYS_SMCSSMM_CSEx __REGBIT(0) | ||
132 | #define SYS_SMCSSMM_CSEx_DIS __REGVAL(SYS_SMCSSMM_CSEx, 0) | ||
133 | #define SYS_SMCSSMM_CSEx_EN __REGVAL(SYS_SMCSSMM_CSEx, 1) | ||
134 | |||
135 | /* General purpose, user-defined ID register */ | ||
136 | #define SYS_GENID __REG(0xa0900210) | ||
137 | |||
138 | /* External Interrupt x Control register */ | ||
139 | #define SYS_EIC(x) __REG2(0xa0900214, (x)) | ||
140 | |||
141 | /* External Interrupt x Control register: Status */ | ||
142 | #define SYS_EIC_STS __REGBIT(3) | ||
143 | |||
144 | /* External Interrupt x Control register: Clear */ | ||
145 | #define SYS_EIC_CLR __REGBIT(2) | ||
146 | |||
147 | /* External Interrupt x Control register: Polarity */ | ||
148 | #define SYS_EIC_PLTY __REGBIT(1) | ||
149 | #define SYS_EIC_PLTY_AH __REGVAL(SYS_EIC_PLTY, 0) | ||
150 | #define SYS_EIC_PLTY_AL __REGVAL(SYS_EIC_PLTY, 1) | ||
151 | |||
152 | /* External Interrupt x Control register: Level edge */ | ||
153 | #define SYS_EIC_LVEDG __REGBIT(0) | ||
154 | #define SYS_EIC_LVEDG_LEVEL __REGVAL(SYS_EIC_LVEDG, 0) | ||
155 | #define SYS_EIC_LVEDG_EDGE __REGVAL(SYS_EIC_LVEDG, 1) | ||
156 | |||
157 | #endif /* ifndef __ASM_ARCH_REGSSYS_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/system.h b/include/asm-arm/arch-ns9xxx/system.h new file mode 100644 index 000000000000..e3cd4d31b3f3 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/system.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/system.h | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_SYSTEM_H | ||
12 | #define __ASM_ARCH_SYSTEM_H | ||
13 | |||
14 | #include <asm/proc-fns.h> | ||
15 | #include <asm/arch-ns9xxx/regs-sys.h> | ||
16 | #include <asm/mach-types.h> | ||
17 | |||
18 | static inline void arch_idle(void) | ||
19 | { | ||
20 | cpu_do_idle(); | ||
21 | } | ||
22 | |||
23 | static inline void arch_reset(char mode) | ||
24 | { | ||
25 | u32 reg; | ||
26 | |||
27 | reg = SYS_PLL >> 16; | ||
28 | REGSET(reg, SYS_PLL, SWC, YES); | ||
29 | SYS_PLL = reg; | ||
30 | |||
31 | BUG(); | ||
32 | } | ||
33 | |||
34 | #endif /* ifndef __ASM_ARCH_SYSTEM_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/timex.h b/include/asm-arm/arch-ns9xxx/timex.h new file mode 100644 index 000000000000..f776cbd2622d --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/timex.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/timex.h | ||
3 | * | ||
4 | * Copyright (C) 2005-2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_TIMEX_H | ||
12 | #define __ASM_ARCH_TIMEX_H | ||
13 | |||
14 | /* | ||
15 | * value for CLOCK_TICK_RATE stolen from include/asm-arm/arch-s3c2410/timex.h. | ||
16 | * See there for an explanation. | ||
17 | */ | ||
18 | #define CLOCK_TICK_RATE 12000000 | ||
19 | |||
20 | #endif /* ifndef __ASM_ARCH_TIMEX_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/uncompress.h b/include/asm-arm/arch-ns9xxx/uncompress.h new file mode 100644 index 000000000000..961ca7dc9954 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/uncompress.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/uncompress.h | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_UNCOMPRESS_H | ||
12 | #define __ASM_ARCH_UNCOMPRESS_H | ||
13 | |||
14 | static void putc(char c) | ||
15 | { | ||
16 | volatile u8 *base = (volatile u8 *)0x40000000; | ||
17 | int t = 0x10000; | ||
18 | |||
19 | do { | ||
20 | if (base[5] & 0x20) { | ||
21 | base[0] = c; | ||
22 | break; | ||
23 | } | ||
24 | } while (--t); | ||
25 | } | ||
26 | |||
27 | #define arch_decomp_setup() | ||
28 | #define arch_decomp_wdog() | ||
29 | |||
30 | static void flush(void) | ||
31 | { | ||
32 | /* nothing */ | ||
33 | } | ||
34 | |||
35 | #endif /* ifndef __ASM_ARCH_UNCOMPRESS_H */ | ||
diff --git a/include/asm-arm/arch-ns9xxx/vmalloc.h b/include/asm-arm/arch-ns9xxx/vmalloc.h new file mode 100644 index 000000000000..2f3cb6f6be24 --- /dev/null +++ b/include/asm-arm/arch-ns9xxx/vmalloc.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ns9xxx/vmalloc.h | ||
3 | * | ||
4 | * Copyright (C) 2006 by Digi International Inc. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_VMALLOC_H | ||
12 | #define __ASM_ARCH_VMALLOC_H | ||
13 | |||
14 | #define VMALLOC_END (0xf0000000) | ||
15 | |||
16 | #endif /* ifndef __ASM_ARCH_VMALLOC_H */ | ||
diff --git a/include/asm-arm/arch-omap/entry-macro.S b/include/asm-arm/arch-omap/entry-macro.S index 0ffb1185f1ac..c90dff4828f7 100644 --- a/include/asm-arm/arch-omap/entry-macro.S +++ b/include/asm-arm/arch-omap/entry-macro.S | |||
@@ -29,6 +29,12 @@ | |||
29 | .macro disable_fiq | 29 | .macro disable_fiq |
30 | .endm | 30 | .endm |
31 | 31 | ||
32 | .macro get_irqnr_preamble, base, tmp | ||
33 | .endm | ||
34 | |||
35 | .macro arch_ret_to_user, tmp1, tmp2 | ||
36 | .endm | ||
37 | |||
32 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 38 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
33 | ldr \base, =IO_ADDRESS(OMAP_IH1_BASE) | 39 | ldr \base, =IO_ADDRESS(OMAP_IH1_BASE) |
34 | ldr \irqnr, [\base, #IRQ_ITR_REG_OFFSET] | 40 | ldr \irqnr, [\base, #IRQ_ITR_REG_OFFSET] |
diff --git a/include/asm-arm/arch-pnx4008/entry-macro.S b/include/asm-arm/arch-pnx4008/entry-macro.S index c1c198e3680b..f11731974e5d 100644 --- a/include/asm-arm/arch-pnx4008/entry-macro.S +++ b/include/asm-arm/arch-pnx4008/entry-macro.S | |||
@@ -28,6 +28,12 @@ | |||
28 | .macro disable_fiq | 28 | .macro disable_fiq |
29 | .endm | 29 | .endm |
30 | 30 | ||
31 | .macro get_irqnr_preamble, base, tmp | ||
32 | .endm | ||
33 | |||
34 | .macro arch_ret_to_user, tmp1, tmp2 | ||
35 | .endm | ||
36 | |||
31 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 37 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
32 | /* decode the MIC interrupt numbers */ | 38 | /* decode the MIC interrupt numbers */ |
33 | ldr \base, =IO_ADDRESS(PNX4008_INTCTRLMIC_BASE) | 39 | ldr \base, =IO_ADDRESS(PNX4008_INTCTRLMIC_BASE) |
diff --git a/include/asm-arm/arch-pxa/entry-macro.S b/include/asm-arm/arch-pxa/entry-macro.S index 4985e33afc12..1d5fbb9b379a 100644 --- a/include/asm-arm/arch-pxa/entry-macro.S +++ b/include/asm-arm/arch-pxa/entry-macro.S | |||
@@ -13,6 +13,12 @@ | |||
13 | .macro disable_fiq | 13 | .macro disable_fiq |
14 | .endm | 14 | .endm |
15 | 15 | ||
16 | .macro get_irqnr_preamble, base, tmp | ||
17 | .endm | ||
18 | |||
19 | .macro arch_ret_to_user, tmp1, tmp2 | ||
20 | .endm | ||
21 | |||
16 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 22 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
17 | #ifdef CONFIG_PXA27x | 23 | #ifdef CONFIG_PXA27x |
18 | mrc p6, 0, \irqstat, c0, c0, 0 @ ICIP | 24 | mrc p6, 0, \irqstat, c0, c0, 0 @ ICIP |
diff --git a/include/asm-arm/arch-pxa/gpio.h b/include/asm-arm/arch-pxa/gpio.h index e67c23821017..3d348a351157 100644 --- a/include/asm-arm/arch-pxa/gpio.h +++ b/include/asm-arm/arch-pxa/gpio.h | |||
@@ -25,10 +25,8 @@ | |||
25 | #define __ASM_ARCH_PXA_GPIO_H | 25 | #define __ASM_ARCH_PXA_GPIO_H |
26 | 26 | ||
27 | #include <asm/arch/pxa-regs.h> | 27 | #include <asm/arch/pxa-regs.h> |
28 | #include <asm/arch/irqs.h> | 28 | #include <asm/irq.h> |
29 | #include <asm/arch/hardware.h> | 29 | #include <asm/hardware.h> |
30 | |||
31 | #include <asm/errno.h> | ||
32 | 30 | ||
33 | static inline int gpio_request(unsigned gpio, const char *label) | 31 | static inline int gpio_request(unsigned gpio, const char *label) |
34 | { | 32 | { |
@@ -42,26 +40,36 @@ static inline void gpio_free(unsigned gpio) | |||
42 | 40 | ||
43 | static inline int gpio_direction_input(unsigned gpio) | 41 | static inline int gpio_direction_input(unsigned gpio) |
44 | { | 42 | { |
45 | if (gpio > PXA_LAST_GPIO) | 43 | return pxa_gpio_mode(gpio | GPIO_IN); |
46 | return -EINVAL; | ||
47 | pxa_gpio_mode(gpio | GPIO_IN); | ||
48 | } | 44 | } |
49 | 45 | ||
50 | static inline int gpio_direction_output(unsigned gpio) | 46 | static inline int gpio_direction_output(unsigned gpio) |
51 | { | 47 | { |
52 | if (gpio > PXA_LAST_GPIO) | 48 | return pxa_gpio_mode(gpio | GPIO_OUT); |
53 | return -EINVAL; | ||
54 | pxa_gpio_mode(gpio | GPIO_OUT); | ||
55 | } | 49 | } |
56 | 50 | ||
57 | /* REVISIT these macros are correct, but suffer code explosion | 51 | static inline int __gpio_get_value(unsigned gpio) |
58 | * for non-constant parameters. Provide out-line versions too. | 52 | { |
59 | */ | 53 | return GPLR(gpio) & GPIO_bit(gpio); |
60 | #define gpio_get_value(gpio) \ | 54 | } |
61 | (GPLR(gpio) & GPIO_bit(gpio)) | 55 | |
56 | #define gpio_get_value(gpio) \ | ||
57 | (__builtin_constant_p(gpio) ? \ | ||
58 | __gpio_get_value(gpio) : \ | ||
59 | pxa_gpio_get_value(gpio)) | ||
60 | |||
61 | static inline void __gpio_set_value(unsigned gpio, int value) | ||
62 | { | ||
63 | if (value) | ||
64 | GPSR(gpio) = GPIO_bit(gpio); | ||
65 | else | ||
66 | GPCR(gpio) = GPIO_bit(gpio); | ||
67 | } | ||
62 | 68 | ||
63 | #define gpio_set_value(gpio,value) \ | 69 | #define gpio_set_value(gpio,value) \ |
64 | ((value) ? (GPSR(gpio) = GPIO_bit(gpio)):(GPCR(gpio) = GPIO_bit(gpio))) | 70 | (__builtin_constant_p(gpio) ? \ |
71 | __gpio_set_value(gpio, value) : \ | ||
72 | pxa_gpio_set_value(gpio, value)) | ||
65 | 73 | ||
66 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | 74 | #include <asm-generic/gpio.h> /* cansleep wrappers */ |
67 | 75 | ||
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h index 3e70bd95472c..e2bdc2fbede1 100644 --- a/include/asm-arm/arch-pxa/hardware.h +++ b/include/asm-arm/arch-pxa/hardware.h | |||
@@ -65,7 +65,17 @@ | |||
65 | /* | 65 | /* |
66 | * Handy routine to set GPIO alternate functions | 66 | * Handy routine to set GPIO alternate functions |
67 | */ | 67 | */ |
68 | extern void pxa_gpio_mode( int gpio_mode ); | 68 | extern int pxa_gpio_mode( int gpio_mode ); |
69 | |||
70 | /* | ||
71 | * Return GPIO level, nonzero means high, zero is low | ||
72 | */ | ||
73 | extern int pxa_gpio_get_value(unsigned gpio); | ||
74 | |||
75 | /* | ||
76 | * Set output GPIO level | ||
77 | */ | ||
78 | extern void pxa_gpio_set_value(unsigned gpio, int value); | ||
69 | 79 | ||
70 | /* | 80 | /* |
71 | * Routine to enable or disable CKEN | 81 | * Routine to enable or disable CKEN |
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h index e24f6b6c79ae..aec835b6f057 100644 --- a/include/asm-arm/arch-pxa/pxa-regs.h +++ b/include/asm-arm/arch-pxa/pxa-regs.h | |||
@@ -463,9 +463,6 @@ | |||
463 | * Serial Audio Controller | 463 | * Serial Audio Controller |
464 | */ | 464 | */ |
465 | 465 | ||
466 | /* FIXME: This clash with SA1111 defines */ | ||
467 | #ifndef _ASM_ARCH_SA1111 | ||
468 | |||
469 | #define SACR0 __REG(0x40400000) /* Global Control Register */ | 466 | #define SACR0 __REG(0x40400000) /* Global Control Register */ |
470 | #define SACR1 __REG(0x40400004) /* Serial Audio I 2 S/MSB-Justified Control Register */ | 467 | #define SACR1 __REG(0x40400004) /* Serial Audio I 2 S/MSB-Justified Control Register */ |
471 | #define SASR0 __REG(0x4040000C) /* Serial Audio I 2 S/MSB-Justified Interface and FIFO Status Register */ | 468 | #define SASR0 __REG(0x4040000C) /* Serial Audio I 2 S/MSB-Justified Interface and FIFO Status Register */ |
@@ -474,8 +471,8 @@ | |||
474 | #define SADIV __REG(0x40400060) /* Audio Clock Divider Register. */ | 471 | #define SADIV __REG(0x40400060) /* Audio Clock Divider Register. */ |
475 | #define SADR __REG(0x40400080) /* Serial Audio Data Register (TX and RX FIFO access Register). */ | 472 | #define SADR __REG(0x40400080) /* Serial Audio Data Register (TX and RX FIFO access Register). */ |
476 | 473 | ||
477 | #define SACR0_RFTH(x) (x << 12) /* Rx FIFO Interrupt or DMA Trigger Threshold */ | 474 | #define SACR0_RFTH(x) ((x) << 12) /* Rx FIFO Interrupt or DMA Trigger Threshold */ |
478 | #define SACR0_TFTH(x) (x << 8) /* Tx FIFO Interrupt or DMA Trigger Threshold */ | 475 | #define SACR0_TFTH(x) ((x) << 8) /* Tx FIFO Interrupt or DMA Trigger Threshold */ |
479 | #define SACR0_STRF (1 << 5) /* FIFO Select for EFWR Special Function */ | 476 | #define SACR0_STRF (1 << 5) /* FIFO Select for EFWR Special Function */ |
480 | #define SACR0_EFWR (1 << 4) /* Enable EFWR Function */ | 477 | #define SACR0_EFWR (1 << 4) /* Enable EFWR Function */ |
481 | #define SACR0_RST (1 << 3) /* FIFO, i2s Register Reset */ | 478 | #define SACR0_RST (1 << 3) /* FIFO, i2s Register Reset */ |
@@ -503,8 +500,6 @@ | |||
503 | #define SAIMR_RFS (1 << 4) /* Enable Rx FIFO Service Interrupt */ | 500 | #define SAIMR_RFS (1 << 4) /* Enable Rx FIFO Service Interrupt */ |
504 | #define SAIMR_TFS (1 << 3) /* Enable Tx FIFO Service Interrupt */ | 501 | #define SAIMR_TFS (1 << 3) /* Enable Tx FIFO Service Interrupt */ |
505 | 502 | ||
506 | #endif | ||
507 | |||
508 | /* | 503 | /* |
509 | * AC97 Controller registers | 504 | * AC97 Controller registers |
510 | */ | 505 | */ |
@@ -1682,15 +1677,18 @@ | |||
1682 | #define SSSR_PINT (1 << 18) /* Peripheral Trailing Byte Interrupt */ | 1677 | #define SSSR_PINT (1 << 18) /* Peripheral Trailing Byte Interrupt */ |
1683 | 1678 | ||
1684 | #define SSPSP_FSRT (1 << 25) /* Frame Sync Relative Timing */ | 1679 | #define SSPSP_FSRT (1 << 25) /* Frame Sync Relative Timing */ |
1685 | #define SSPSP_DMYSTOP(x) (x << 23) /* Dummy Stop */ | 1680 | #define SSPSP_DMYSTOP(x) ((x) << 23) /* Dummy Stop */ |
1686 | #define SSPSP_SFRMWDTH(x) (x << 16) /* Serial Frame Width */ | 1681 | #define SSPSP_SFRMWDTH(x) ((x) << 16) /* Serial Frame Width */ |
1687 | #define SSPSP_SFRMDLY(x) (x << 9) /* Serial Frame Delay */ | 1682 | #define SSPSP_SFRMDLY(x) ((x) << 9) /* Serial Frame Delay */ |
1688 | #define SSPSP_DMYSTRT(x) (x << 7) /* Dummy Start */ | 1683 | #define SSPSP_DMYSTRT(x) ((x) << 7) /* Dummy Start */ |
1689 | #define SSPSP_STRTDLY(x) (x << 4) /* Start Delay */ | 1684 | #define SSPSP_STRTDLY(x) ((x) << 4) /* Start Delay */ |
1690 | #define SSPSP_ETDS (1 << 3) /* End of Transfer data State */ | 1685 | #define SSPSP_ETDS (1 << 3) /* End of Transfer data State */ |
1691 | #define SSPSP_SFRMP (1 << 2) /* Serial Frame Polarity */ | 1686 | #define SSPSP_SFRMP (1 << 2) /* Serial Frame Polarity */ |
1692 | #define SSPSP_SCMODE(x) (x << 0) /* Serial Bit Rate Clock Mode */ | 1687 | #define SSPSP_SCMODE(x) ((x) << 0) /* Serial Bit Rate Clock Mode */ |
1693 | 1688 | ||
1689 | #define SSACD_SCDB (1 << 3) /* SSPSYSCLK Divider Bypass */ | ||
1690 | #define SSACD_ACPS(x) ((x) << 4) /* Audio clock PLL select */ | ||
1691 | #define SSACD_ACDS(x) ((x) << 0) /* Audio clock divider select */ | ||
1694 | 1692 | ||
1695 | #define SSCR0_P1 __REG(0x41000000) /* SSP Port 1 Control Register 0 */ | 1693 | #define SSCR0_P1 __REG(0x41000000) /* SSP Port 1 Control Register 0 */ |
1696 | #define SSCR1_P1 __REG(0x41000004) /* SSP Port 1 Control Register 1 */ | 1694 | #define SSCR1_P1 __REG(0x41000004) /* SSP Port 1 Control Register 1 */ |
diff --git a/include/asm-arm/arch-pxa/udc.h b/include/asm-arm/arch-pxa/udc.h index 646480d37256..8bc6f9c3e3ea 100644 --- a/include/asm-arm/arch-pxa/udc.h +++ b/include/asm-arm/arch-pxa/udc.h | |||
@@ -9,3 +9,33 @@ | |||
9 | 9 | ||
10 | extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info); | 10 | extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info); |
11 | 11 | ||
12 | static inline int udc_gpio_to_irq(unsigned gpio) | ||
13 | { | ||
14 | return IRQ_GPIO(gpio & GPIO_MD_MASK_NR); | ||
15 | } | ||
16 | |||
17 | static inline void udc_gpio_init_vbus(unsigned gpio) | ||
18 | { | ||
19 | pxa_gpio_mode((gpio & GPIO_MD_MASK_NR) | GPIO_IN); | ||
20 | } | ||
21 | |||
22 | static inline void udc_gpio_init_pullup(unsigned gpio) | ||
23 | { | ||
24 | pxa_gpio_mode((gpio & GPIO_MD_MASK_NR) | GPIO_OUT | GPIO_DFLT_LOW); | ||
25 | } | ||
26 | |||
27 | static inline int udc_gpio_get(unsigned gpio) | ||
28 | { | ||
29 | return (GPLR(gpio) & GPIO_bit(gpio)) != 0; | ||
30 | } | ||
31 | |||
32 | static inline void udc_gpio_set(unsigned gpio, int is_on) | ||
33 | { | ||
34 | int mask = GPIO_bit(gpio); | ||
35 | |||
36 | if (is_on) | ||
37 | GPSR(gpio) = mask; | ||
38 | else | ||
39 | GPCR(gpio) = mask; | ||
40 | } | ||
41 | |||
diff --git a/include/asm-arm/arch-realview/entry-macro.S b/include/asm-arm/arch-realview/entry-macro.S index 1a6eec86bd47..138838d4ad75 100644 --- a/include/asm-arm/arch-realview/entry-macro.S +++ b/include/asm-arm/arch-realview/entry-macro.S | |||
@@ -13,6 +13,12 @@ | |||
13 | .macro disable_fiq | 13 | .macro disable_fiq |
14 | .endm | 14 | .endm |
15 | 15 | ||
16 | .macro get_irqnr_preamble, base, tmp | ||
17 | .endm | ||
18 | |||
19 | .macro arch_ret_to_user, tmp1, tmp2 | ||
20 | .endm | ||
21 | |||
16 | /* | 22 | /* |
17 | * The interrupt numbering scheme is defined in the | 23 | * The interrupt numbering scheme is defined in the |
18 | * interrupt controller spec. To wit: | 24 | * interrupt controller spec. To wit: |
diff --git a/include/asm-arm/arch-realview/hardware.h b/include/asm-arm/arch-realview/hardware.h index 9ca76dc3a7af..aa78fe087ab2 100644 --- a/include/asm-arm/arch-realview/hardware.h +++ b/include/asm-arm/arch-realview/hardware.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <asm/arch/platform.h> | 26 | #include <asm/arch/platform.h> |
27 | 27 | ||
28 | /* macro to get at IO space when running virtually */ | 28 | /* macro to get at IO space when running virtually */ |
29 | #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) | 29 | #define IO_ADDRESS(x) ((((x) & 0x0effffff) | (((x) >> 4) & 0x0f000000)) + 0xf0000000) |
30 | #define __io_address(n) __io(IO_ADDRESS(n)) | 30 | #define __io_address(n) __io(IO_ADDRESS(n)) |
31 | 31 | ||
32 | #endif | 32 | #endif |
diff --git a/include/asm-arm/arch-realview/irqs.h b/include/asm-arm/arch-realview/irqs.h index c16223c9588d..5a5db56f86b8 100644 --- a/include/asm-arm/arch-realview/irqs.h +++ b/include/asm-arm/arch-realview/irqs.h | |||
@@ -65,6 +65,21 @@ | |||
65 | #define IRQ_AACI (IRQ_GIC_START + INT_AACI) | 65 | #define IRQ_AACI (IRQ_GIC_START + INT_AACI) |
66 | #define IRQ_ETH (IRQ_GIC_START + INT_ETH) | 66 | #define IRQ_ETH (IRQ_GIC_START + INT_ETH) |
67 | #define IRQ_USB (IRQ_GIC_START + INT_USB) | 67 | #define IRQ_USB (IRQ_GIC_START + INT_USB) |
68 | #define IRQ_PMU_CPU0 (IRQ_GIC_START + INT_PMU_CPU0) | ||
69 | #define IRQ_PMU_CPU1 (IRQ_GIC_START + INT_PMU_CPU1) | ||
70 | #define IRQ_PMU_CPU2 (IRQ_GIC_START + INT_PMU_CPU2) | ||
71 | #define IRQ_PMU_CPU3 (IRQ_GIC_START + INT_PMU_CPU3) | ||
72 | #define IRQ_PMU_SCU0 (IRQ_GIC_START + INT_PMU_SCU0) | ||
73 | #define IRQ_PMU_SCU1 (IRQ_GIC_START + INT_PMU_SCU1) | ||
74 | #define IRQ_PMU_SCU2 (IRQ_GIC_START + INT_PMU_SCU2) | ||
75 | #define IRQ_PMU_SCU3 (IRQ_GIC_START + INT_PMU_SCU3) | ||
76 | #define IRQ_PMU_SCU4 (IRQ_GIC_START + INT_PMU_SCU4) | ||
77 | #define IRQ_PMU_SCU5 (IRQ_GIC_START + INT_PMU_SCU5) | ||
78 | #define IRQ_PMU_SCU6 (IRQ_GIC_START + INT_PMU_SCU6) | ||
79 | #define IRQ_PMU_SCU7 (IRQ_GIC_START + INT_PMU_SCU7) | ||
80 | |||
81 | #define IRQ_EB_IRQ1 (IRQ_GIC_START + INT_EB_IRQ1) | ||
82 | #define IRQ_EB_IRQ2 (IRQ_GIC_START + INT_EB_IRQ2) | ||
68 | 83 | ||
69 | #define IRQMASK_WDOGINT INTMASK_WDOGINT | 84 | #define IRQMASK_WDOGINT INTMASK_WDOGINT |
70 | #define IRQMASK_SOFTINT INTMASK_SOFTINT | 85 | #define IRQMASK_SOFTINT INTMASK_SOFTINT |
@@ -103,4 +118,4 @@ | |||
103 | #define IRQMASK_ETH INTMASK_ETH | 118 | #define IRQMASK_ETH INTMASK_ETH |
104 | #define IRQMASK_USB INTMASK_USB | 119 | #define IRQMASK_USB INTMASK_USB |
105 | 120 | ||
106 | #define NR_IRQS (IRQ_GIC_START + 64) | 121 | #define NR_IRQS (IRQ_GIC_START + 96) |
diff --git a/include/asm-arm/arch-realview/platform.h b/include/asm-arm/arch-realview/platform.h index 18d7c18b738c..6e0eab95a3a2 100644 --- a/include/asm-arm/arch-realview/platform.h +++ b/include/asm-arm/arch-realview/platform.h | |||
@@ -207,11 +207,25 @@ | |||
207 | #define REALVIEW_GIC_CPU_BASE 0x10040000 /* Generic interrupt controller CPU interface */ | 207 | #define REALVIEW_GIC_CPU_BASE 0x10040000 /* Generic interrupt controller CPU interface */ |
208 | #define REALVIEW_GIC_DIST_BASE 0x10041000 /* Generic interrupt controller distributor */ | 208 | #define REALVIEW_GIC_DIST_BASE 0x10041000 /* Generic interrupt controller distributor */ |
209 | #else | 209 | #else |
210 | #ifdef CONFIG_REALVIEW_MPCORE_REVB | ||
210 | #define REALVIEW_MPCORE_SCU_BASE 0x10100000 /* SCU registers */ | 211 | #define REALVIEW_MPCORE_SCU_BASE 0x10100000 /* SCU registers */ |
211 | #define REALVIEW_GIC_CPU_BASE 0x10100100 /* Generic interrupt controller CPU interface */ | 212 | #define REALVIEW_GIC_CPU_BASE 0x10100100 /* Generic interrupt controller CPU interface */ |
212 | #define REALVIEW_TWD_BASE 0x10100700 | 213 | #define REALVIEW_TWD_BASE 0x10100700 |
213 | #define REALVIEW_TWD_SIZE 0x00000100 | 214 | #define REALVIEW_TWD_SIZE 0x00000100 |
214 | #define REALVIEW_GIC_DIST_BASE 0x10101000 /* Generic interrupt controller distributor */ | 215 | #define REALVIEW_GIC_DIST_BASE 0x10101000 /* Generic interrupt controller distributor */ |
216 | #define REALVIEW_MPCORE_L220_BASE 0x10102000 /* L220 registers */ | ||
217 | #define REALVIEW_MPCORE_SYS_PLD_CTRL1 0xD8 /* Register offset for MPCore sysctl */ | ||
218 | #else | ||
219 | #define REALVIEW_MPCORE_SCU_BASE 0x1F000000 /* SCU registers */ | ||
220 | #define REALVIEW_GIC_CPU_BASE 0x1F000100 /* Generic interrupt controller CPU interface */ | ||
221 | #define REALVIEW_TWD_BASE 0x1F000700 | ||
222 | #define REALVIEW_TWD_SIZE 0x00000100 | ||
223 | #define REALVIEW_GIC_DIST_BASE 0x1F001000 /* Generic interrupt controller distributor */ | ||
224 | #define REALVIEW_MPCORE_L220_BASE 0x1F002000 /* L220 registers */ | ||
225 | #define REALVIEW_MPCORE_SYS_PLD_CTRL1 0x74 /* Register offset for MPCore sysctl */ | ||
226 | #endif | ||
227 | #define REALVIEW_GIC1_CPU_BASE 0x10040000 /* Generic interrupt controller CPU interface */ | ||
228 | #define REALVIEW_GIC1_DIST_BASE 0x10041000 /* Generic interrupt controller distributor */ | ||
215 | #endif | 229 | #endif |
216 | #define REALVIEW_SMC_BASE 0x10080000 /* SMC */ | 230 | #define REALVIEW_SMC_BASE 0x10080000 /* SMC */ |
217 | /* Reserved 0x10090000 - 0x100EFFFF */ | 231 | /* Reserved 0x10090000 - 0x100EFFFF */ |
@@ -306,7 +320,11 @@ | |||
306 | #define INT_USB 29 /* USB controller */ | 320 | #define INT_USB 29 /* USB controller */ |
307 | #define INT_TSPENINT 30 /* Touchscreen pen */ | 321 | #define INT_TSPENINT 30 /* Touchscreen pen */ |
308 | #define INT_TSKPADINT 31 /* Touchscreen keypad */ | 322 | #define INT_TSKPADINT 31 /* Touchscreen keypad */ |
323 | |||
309 | #else | 324 | #else |
325 | |||
326 | #define MAX_GIC_NR 2 | ||
327 | |||
310 | #define INT_AACI 0 | 328 | #define INT_AACI 0 |
311 | #define INT_TIMERINT0_1 1 | 329 | #define INT_TIMERINT0_1 1 |
312 | #define INT_TIMERINT2_3 2 | 330 | #define INT_TIMERINT2_3 2 |
diff --git a/include/asm-arm/arch-realview/scu.h b/include/asm-arm/arch-realview/scu.h new file mode 100644 index 000000000000..cc293640178e --- /dev/null +++ b/include/asm-arm/arch-realview/scu.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef __ASMARM_ARCH_SCU_H | ||
2 | #define __ASMARM_ARCH_SCU_H | ||
3 | |||
4 | #include <asm/arch/platform.h> | ||
5 | |||
6 | #define SCU_BASE REALVIEW_MPCORE_SCU_BASE | ||
7 | |||
8 | #endif | ||
diff --git a/include/asm-arm/arch-rpc/entry-macro.S b/include/asm-arm/arch-rpc/entry-macro.S index c9e5395e5106..0cfb89b229d1 100644 --- a/include/asm-arm/arch-rpc/entry-macro.S +++ b/include/asm-arm/arch-rpc/entry-macro.S | |||
@@ -1,3 +1,8 @@ | |||
1 | #include <asm/hardware.h> | 1 | #include <asm/hardware.h> |
2 | #include <asm/hardware/entry-macro-iomd.S> | 2 | #include <asm/hardware/entry-macro-iomd.S> |
3 | .macro get_irqnr_preamble, base, tmp | ||
4 | .endm | ||
5 | |||
6 | .macro arch_ret_to_user, tmp1, tmp2 | ||
7 | .endm | ||
3 | 8 | ||
diff --git a/include/asm-arm/arch-s3c2410/audio.h b/include/asm-arm/arch-s3c2410/audio.h index 65e0acffa1ad..0a6977fb5770 100644 --- a/include/asm-arm/arch-s3c2410/audio.h +++ b/include/asm-arm/arch-s3c2410/audio.h | |||
@@ -31,9 +31,9 @@ struct s3c24xx_iis_ops { | |||
31 | int (*suspend)(struct s3c24xx_iis_ops *me); | 31 | int (*suspend)(struct s3c24xx_iis_ops *me); |
32 | int (*resume)(struct s3c24xx_iis_ops *me); | 32 | int (*resume)(struct s3c24xx_iis_ops *me); |
33 | 33 | ||
34 | int (*open)(struct s3c24xx_iis_ops *me, snd_pcm_substream_t *strm); | 34 | int (*open)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm); |
35 | int (*close)(struct s3c24xx_iis_ops *me, snd_pcm_substream_t *strm); | 35 | int (*close)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm); |
36 | int (*prepare)(struct s3c24xx_iis_ops *me, snd_pcm_substream_t *strm, snd_pcm_runtime_t *rt); | 36 | int (*prepare)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm, struct snd_pcm_runtime *rt); |
37 | }; | 37 | }; |
38 | 38 | ||
39 | struct s3c24xx_platdata_iis { | 39 | struct s3c24xx_platdata_iis { |
diff --git a/include/asm-arm/arch-s3c2410/dma.h b/include/asm-arm/arch-s3c2410/dma.h index 58ffa7ba3c88..c6e8d8f64938 100644 --- a/include/asm-arm/arch-s3c2410/dma.h +++ b/include/asm-arm/arch-s3c2410/dma.h | |||
@@ -51,13 +51,19 @@ enum dma_ch { | |||
51 | DMACH_UART0_SRC2, /* s3c2412 second uart sources */ | 51 | DMACH_UART0_SRC2, /* s3c2412 second uart sources */ |
52 | DMACH_UART1_SRC2, | 52 | DMACH_UART1_SRC2, |
53 | DMACH_UART2_SRC2, | 53 | DMACH_UART2_SRC2, |
54 | DMACH_UART3, /* s3c2443 has extra uart */ | ||
55 | DMACH_UART3_SRC2, | ||
54 | DMACH_MAX, /* the end entry */ | 56 | DMACH_MAX, /* the end entry */ |
55 | }; | 57 | }; |
56 | 58 | ||
57 | #define DMACH_LOW_LEVEL (1<<28) /* use this to specifiy hardware ch no */ | 59 | #define DMACH_LOW_LEVEL (1<<28) /* use this to specifiy hardware ch no */ |
58 | 60 | ||
59 | /* we have 4 dma channels */ | 61 | /* we have 4 dma channels */ |
60 | #define S3C2410_DMA_CHANNELS (4) | 62 | #ifndef CONFIG_CPU_S3C2443 |
63 | #define S3C2410_DMA_CHANNELS (4) | ||
64 | #else | ||
65 | #define S3C2410_DMA_CHANNELS (6) | ||
66 | #endif | ||
61 | 67 | ||
62 | /* types */ | 68 | /* types */ |
63 | 69 | ||
@@ -321,6 +327,7 @@ extern int s3c2410_dma_set_buffdone_fn(dmach_t, s3c2410_dma_cbfn_t rtn); | |||
321 | #define S3C2410_DMA_DCDST (0x1C) | 327 | #define S3C2410_DMA_DCDST (0x1C) |
322 | #define S3C2410_DMA_DMASKTRIG (0x20) | 328 | #define S3C2410_DMA_DMASKTRIG (0x20) |
323 | #define S3C2412_DMA_DMAREQSEL (0x24) | 329 | #define S3C2412_DMA_DMAREQSEL (0x24) |
330 | #define S3C2443_DMA_DMAREQSEL (0x24) | ||
324 | 331 | ||
325 | #define S3C2410_DISRCC_INC (1<<0) | 332 | #define S3C2410_DISRCC_INC (1<<0) |
326 | #define S3C2410_DISRCC_APB (1<<1) | 333 | #define S3C2410_DISRCC_APB (1<<1) |
@@ -415,4 +422,31 @@ extern int s3c2410_dma_set_buffdone_fn(dmach_t, s3c2410_dma_cbfn_t rtn); | |||
415 | #define S3C2412_DMAREQSEL_UART2_1 S3C2412_DMAREQSEL_SRC(24) | 422 | #define S3C2412_DMAREQSEL_UART2_1 S3C2412_DMAREQSEL_SRC(24) |
416 | 423 | ||
417 | #endif | 424 | #endif |
425 | |||
426 | #define S3C2443_DMAREQSEL_SRC(x) ((x)<<1) | ||
427 | |||
428 | #define S3C2443_DMAREQSEL_HW (1) | ||
429 | |||
430 | #define S3C2443_DMAREQSEL_SPI0TX S3C2443_DMAREQSEL_SRC(0) | ||
431 | #define S3C2443_DMAREQSEL_SPI0RX S3C2443_DMAREQSEL_SRC(1) | ||
432 | #define S3C2443_DMAREQSEL_SPI1TX S3C2443_DMAREQSEL_SRC(2) | ||
433 | #define S3C2443_DMAREQSEL_SPI1RX S3C2443_DMAREQSEL_SRC(3) | ||
434 | #define S3C2443_DMAREQSEL_I2STX S3C2443_DMAREQSEL_SRC(4) | ||
435 | #define S3C2443_DMAREQSEL_I2SRX S3C2443_DMAREQSEL_SRC(5) | ||
436 | #define S3C2443_DMAREQSEL_TIMER S3C2443_DMAREQSEL_SRC(9) | ||
437 | #define S3C2443_DMAREQSEL_SDI S3C2443_DMAREQSEL_SRC(10) | ||
438 | #define S3C2443_DMAREQSEL_XDREQ0 S3C2443_DMAREQSEL_SRC(17) | ||
439 | #define S3C2443_DMAREQSEL_XDREQ1 S3C2443_DMAREQSEL_SRC(18) | ||
440 | #define S3C2443_DMAREQSEL_UART0_0 S3C2443_DMAREQSEL_SRC(19) | ||
441 | #define S3C2443_DMAREQSEL_UART0_1 S3C2443_DMAREQSEL_SRC(20) | ||
442 | #define S3C2443_DMAREQSEL_UART1_0 S3C2443_DMAREQSEL_SRC(21) | ||
443 | #define S3C2443_DMAREQSEL_UART1_1 S3C2443_DMAREQSEL_SRC(22) | ||
444 | #define S3C2443_DMAREQSEL_UART2_0 S3C2443_DMAREQSEL_SRC(23) | ||
445 | #define S3C2443_DMAREQSEL_UART2_1 S3C2443_DMAREQSEL_SRC(24) | ||
446 | #define S3C2443_DMAREQSEL_UART3_0 S3C2443_DMAREQSEL_SRC(25) | ||
447 | #define S3C2443_DMAREQSEL_UART3_1 S3C2443_DMAREQSEL_SRC(26) | ||
448 | #define S3C2443_DMAREQSEL_PCMOUT S3C2443_DMAREQSEL_SRC(27) | ||
449 | #define S3C2443_DMAREQSEL_PCMIN S3C2443_DMAREQSEL_SRC(28) | ||
450 | #define S3C2443_DMAREQSEL_MICIN S3C2443_DMAREQSEL_SRC(29) | ||
451 | |||
418 | #endif /* __ASM_ARCH_DMA_H */ | 452 | #endif /* __ASM_ARCH_DMA_H */ |
diff --git a/include/asm-arm/arch-s3c2410/entry-macro.S b/include/asm-arm/arch-s3c2410/entry-macro.S index 1eb4e6b8d249..bbec0a8ff158 100644 --- a/include/asm-arm/arch-s3c2410/entry-macro.S +++ b/include/asm-arm/arch-s3c2410/entry-macro.S | |||
@@ -22,6 +22,12 @@ | |||
22 | #include <asm/hardware.h> | 22 | #include <asm/hardware.h> |
23 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
24 | 24 | ||
25 | .macro get_irqnr_preamble, base, tmp | ||
26 | .endm | ||
27 | |||
28 | .macro arch_ret_to_user, tmp1, tmp2 | ||
29 | .endm | ||
30 | |||
25 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 31 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
26 | 32 | ||
27 | mov \base, #S3C24XX_VA_IRQ | 33 | mov \base, #S3C24XX_VA_IRQ |
diff --git a/include/asm-arm/arch-s3c2410/gpio.h b/include/asm-arm/arch-s3c2410/gpio.h index 67b8b9ab22e9..d47ae453f8ca 100644 --- a/include/asm-arm/arch-s3c2410/gpio.h +++ b/include/asm-arm/arch-s3c2410/gpio.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/asm-arm/arch-pxa/gpio.h | 2 | * linux/include/asm-arm/arch-s3c2410/gpio.h |
3 | * | 3 | * |
4 | * S3C2400 GPIO wrappers for arch-neutral GPIO calls | 4 | * S3C2410 GPIO wrappers for arch-neutral GPIO calls |
5 | * | 5 | * |
6 | * Written by Philipp Zabel <philipp.zabel@gmail.com> | 6 | * Written by Philipp Zabel <philipp.zabel@gmail.com> |
7 | * | 7 | * |
@@ -21,14 +21,12 @@ | |||
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef __ASM_ARCH_PXA_GPIO_H | 24 | #ifndef __ASM_ARCH_S3C2410_GPIO_H |
25 | #define __ASM_ARCH_PXA_GPIO_H | 25 | #define __ASM_ARCH_S3C2410_GPIO_H |
26 | 26 | ||
27 | #include <asm/arch/pxa-regs.h> | 27 | #include <asm/irq.h> |
28 | #include <asm/arch/irqs.h> | 28 | #include <asm/hardware.h> |
29 | #include <asm/arch/hardware.h> | 29 | #include <asm/arch/regs-gpio.h> |
30 | |||
31 | #include <asm/errno.h> | ||
32 | 30 | ||
33 | static inline int gpio_request(unsigned gpio, const char *label) | 31 | static inline int gpio_request(unsigned gpio, const char *label) |
34 | { | 32 | { |
@@ -57,8 +55,11 @@ static inline int gpio_direction_output(unsigned gpio) | |||
57 | 55 | ||
58 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | 56 | #include <asm-generic/gpio.h> /* cansleep wrappers */ |
59 | 57 | ||
60 | /* FIXME or maybe s3c2400_gpio_getirq() ... */ | 58 | #ifdef CONFIG_CPU_S3C2400 |
59 | #define gpio_to_irq(gpio) s3c2400_gpio_getirq(gpio) | ||
60 | #else | ||
61 | #define gpio_to_irq(gpio) s3c2410_gpio_getirq(gpio) | 61 | #define gpio_to_irq(gpio) s3c2410_gpio_getirq(gpio) |
62 | #endif | ||
62 | 63 | ||
63 | /* FIXME implement irq_to_gpio() */ | 64 | /* FIXME implement irq_to_gpio() */ |
64 | 65 | ||
diff --git a/include/asm-arm/arch-s3c2410/irqs.h b/include/asm-arm/arch-s3c2410/irqs.h index 4b7cff456c4e..c79cb1819913 100644 --- a/include/asm-arm/arch-s3c2410/irqs.h +++ b/include/asm-arm/arch-s3c2410/irqs.h | |||
@@ -34,10 +34,10 @@ | |||
34 | #define IRQ_EINT4t7 S3C2410_IRQ(4) /* 20 */ | 34 | #define IRQ_EINT4t7 S3C2410_IRQ(4) /* 20 */ |
35 | #define IRQ_EINT8t23 S3C2410_IRQ(5) | 35 | #define IRQ_EINT8t23 S3C2410_IRQ(5) |
36 | #define IRQ_RESERVED6 S3C2410_IRQ(6) /* for s3c2410 */ | 36 | #define IRQ_RESERVED6 S3C2410_IRQ(6) /* for s3c2410 */ |
37 | #define IRQ_CAM S3C2410_IRQ(6) /* for s3c2440 */ | 37 | #define IRQ_CAM S3C2410_IRQ(6) /* for s3c2440,s3c2443 */ |
38 | #define IRQ_BATT_FLT S3C2410_IRQ(7) | 38 | #define IRQ_BATT_FLT S3C2410_IRQ(7) |
39 | #define IRQ_TICK S3C2410_IRQ(8) /* 24 */ | 39 | #define IRQ_TICK S3C2410_IRQ(8) /* 24 */ |
40 | #define IRQ_WDT S3C2410_IRQ(9) | 40 | #define IRQ_WDT S3C2410_IRQ(9) /* WDT/AC97 for s3c2443 */ |
41 | #define IRQ_TIMER0 S3C2410_IRQ(10) | 41 | #define IRQ_TIMER0 S3C2410_IRQ(10) |
42 | #define IRQ_TIMER1 S3C2410_IRQ(11) | 42 | #define IRQ_TIMER1 S3C2410_IRQ(11) |
43 | #define IRQ_TIMER2 S3C2410_IRQ(12) | 43 | #define IRQ_TIMER2 S3C2410_IRQ(12) |
@@ -45,7 +45,7 @@ | |||
45 | #define IRQ_TIMER4 S3C2410_IRQ(14) | 45 | #define IRQ_TIMER4 S3C2410_IRQ(14) |
46 | #define IRQ_UART2 S3C2410_IRQ(15) | 46 | #define IRQ_UART2 S3C2410_IRQ(15) |
47 | #define IRQ_LCD S3C2410_IRQ(16) /* 32 */ | 47 | #define IRQ_LCD S3C2410_IRQ(16) /* 32 */ |
48 | #define IRQ_DMA0 S3C2410_IRQ(17) | 48 | #define IRQ_DMA0 S3C2410_IRQ(17) /* IRQ_DMA for s3c2443 */ |
49 | #define IRQ_DMA1 S3C2410_IRQ(18) | 49 | #define IRQ_DMA1 S3C2410_IRQ(18) |
50 | #define IRQ_DMA2 S3C2410_IRQ(19) | 50 | #define IRQ_DMA2 S3C2410_IRQ(19) |
51 | #define IRQ_DMA3 S3C2410_IRQ(20) | 51 | #define IRQ_DMA3 S3C2410_IRQ(20) |
@@ -94,29 +94,63 @@ | |||
94 | * these need to be ordered in number of appearance in the | 94 | * these need to be ordered in number of appearance in the |
95 | * SUBSRC mask register | 95 | * SUBSRC mask register |
96 | */ | 96 | */ |
97 | #define IRQ_S3CUART_RX0 S3C2410_IRQ(54) /* 70 */ | ||
98 | #define IRQ_S3CUART_TX0 S3C2410_IRQ(55) /* 71 */ | ||
99 | #define IRQ_S3CUART_ERR0 S3C2410_IRQ(56) | ||
100 | 97 | ||
101 | #define IRQ_S3CUART_RX1 S3C2410_IRQ(57) | 98 | #define S3C2410_IRQSUB(x) S3C2410_IRQ((x)+54) |
102 | #define IRQ_S3CUART_TX1 S3C2410_IRQ(58) | ||
103 | #define IRQ_S3CUART_ERR1 S3C2410_IRQ(59) | ||
104 | 99 | ||
105 | #define IRQ_S3CUART_RX2 S3C2410_IRQ(60) | 100 | #define IRQ_S3CUART_RX0 S3C2410_IRQSUB(0) /* 70 */ |
106 | #define IRQ_S3CUART_TX2 S3C2410_IRQ(61) | 101 | #define IRQ_S3CUART_TX0 S3C2410_IRQSUB(1) |
107 | #define IRQ_S3CUART_ERR2 S3C2410_IRQ(62) | 102 | #define IRQ_S3CUART_ERR0 S3C2410_IRQSUB(2) |
108 | 103 | ||
109 | #define IRQ_TC S3C2410_IRQ(63) | 104 | #define IRQ_S3CUART_RX1 S3C2410_IRQSUB(3) /* 73 */ |
110 | #define IRQ_ADC S3C2410_IRQ(64) | 105 | #define IRQ_S3CUART_TX1 S3C2410_IRQSUB(4) |
106 | #define IRQ_S3CUART_ERR1 S3C2410_IRQSUB(5) | ||
111 | 107 | ||
112 | /* extra irqs for s3c2440 */ | 108 | #define IRQ_S3CUART_RX2 S3C2410_IRQSUB(6) /* 76 */ |
109 | #define IRQ_S3CUART_TX2 S3C2410_IRQSUB(7) | ||
110 | #define IRQ_S3CUART_ERR2 S3C2410_IRQSUB(8) | ||
113 | 111 | ||
114 | #define IRQ_S3C2440_CAM_C S3C2410_IRQ(65) | 112 | #define IRQ_TC S3C2410_IRQSUB(9) |
115 | #define IRQ_S3C2440_CAM_P S3C2410_IRQ(66) | 113 | #define IRQ_ADC S3C2410_IRQSUB(10) |
116 | #define IRQ_S3C2440_WDT S3C2410_IRQ(67) | ||
117 | #define IRQ_S3C2440_AC97 S3C2410_IRQ(68) | ||
118 | 114 | ||
119 | #define NR_IRQS (IRQ_S3C2440_AC97+1) | 115 | /* extra irqs for s3c2440 */ |
120 | 116 | ||
117 | #define IRQ_S3C2440_CAM_C S3C2410_IRQSUB(11) /* S3C2443 too */ | ||
118 | #define IRQ_S3C2440_CAM_P S3C2410_IRQSUB(12) /* S3C2443 too */ | ||
119 | #define IRQ_S3C2440_WDT S3C2410_IRQSUB(13) | ||
120 | #define IRQ_S3C2440_AC97 S3C2410_IRQSUB(14) | ||
121 | |||
122 | /* irqs for s3c2443 */ | ||
123 | |||
124 | #define IRQ_S3C2443_DMA S3C2410_IRQ(17) /* IRQ_DMA1 */ | ||
125 | #define IRQ_S3C2443_UART3 S3C2410_IRQ(18) /* IRQ_DMA2 */ | ||
126 | #define IRQ_S3C2443_CFCON S3C2410_IRQ(19) /* IRQ_DMA3 */ | ||
127 | #define IRQ_S3C2443_SDI1 S3C2410_IRQ(20) /* IRQ_SDI */ | ||
128 | #define IRQ_S3C2443_NAND S3C2410_IRQ(24) /* reserved */ | ||
129 | |||
130 | #define IRQ_S3C2443_LCD1 S3C2410_IRQSUB(14) | ||
131 | #define IRQ_S3C2443_LCD2 S3C2410_IRQSUB(15) | ||
132 | #define IRQ_S3C2443_LCD3 S3C2410_IRQSUB(16) | ||
133 | #define IRQ_S3C2443_LCD4 S3C2410_IRQSUB(17) | ||
134 | |||
135 | #define IRQ_S3C2443_DMA0 S3C2410_IRQSUB(18) | ||
136 | #define IRQ_S3C2443_DMA1 S3C2410_IRQSUB(19) | ||
137 | #define IRQ_S3C2443_DMA2 S3C2410_IRQSUB(20) | ||
138 | #define IRQ_S3C2443_DMA3 S3C2410_IRQSUB(21) | ||
139 | #define IRQ_S3C2443_DMA4 S3C2410_IRQSUB(22) | ||
140 | #define IRQ_S3C2443_DMA5 S3C2410_IRQSUB(23) | ||
141 | |||
142 | /* UART3 */ | ||
143 | #define IRQ_S3C2443_RX3 S3C2410_IRQSUB(24) | ||
144 | #define IRQ_S3C2443_TX3 S3C2410_IRQSUB(25) | ||
145 | #define IRQ_S3C2443_ERR3 S3C2410_IRQSUB(26) | ||
146 | |||
147 | #define IRQ_S3C2443_WDT S3C2410_IRQSUB(27) | ||
148 | #define IRQ_S3C2443_AC97 S3C2410_IRQSUB(28) | ||
149 | |||
150 | #ifdef CONFIG_CPU_S3C2443 | ||
151 | #define NR_IRQS (IRQ_S3C2443_AC97+1) | ||
152 | #else | ||
153 | #define NR_IRQS (IRQ_S3C2440_AC97+1) | ||
154 | #endif | ||
121 | 155 | ||
122 | #endif /* __ASM_ARCH_IRQ_H */ | 156 | #endif /* __ASM_ARCH_IRQ_H */ |
diff --git a/include/asm-arm/arch-s3c2410/regs-adc.h b/include/asm-arm/arch-s3c2410/regs-adc.h index 3196a2849e8a..c7f231963e76 100644 --- a/include/asm-arm/arch-s3c2410/regs-adc.h +++ b/include/asm-arm/arch-s3c2410/regs-adc.h | |||
@@ -41,7 +41,7 @@ | |||
41 | #define S3C2410_ADCTSC_XP_SEN (1<<4) | 41 | #define S3C2410_ADCTSC_XP_SEN (1<<4) |
42 | #define S3C2410_ADCTSC_PULL_UP_DISABLE (1<<3) | 42 | #define S3C2410_ADCTSC_PULL_UP_DISABLE (1<<3) |
43 | #define S3C2410_ADCTSC_AUTO_PST (1<<2) | 43 | #define S3C2410_ADCTSC_AUTO_PST (1<<2) |
44 | #define S3C2410_ADCTSC_XY_PST (0x3<<0) | 44 | #define S3C2410_ADCTSC_XY_PST(x) (((x)&0x3)<<0) |
45 | 45 | ||
46 | /* ADCDAT0 Bits */ | 46 | /* ADCDAT0 Bits */ |
47 | #define S3C2410_ADCDAT0_UPDOWN (1<<15) | 47 | #define S3C2410_ADCDAT0_UPDOWN (1<<15) |
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h index eae91694edcd..dea578b8f7f6 100644 --- a/include/asm-arm/arch-s3c2410/regs-gpio.h +++ b/include/asm-arm/arch-s3c2410/regs-gpio.h | |||
@@ -201,7 +201,7 @@ | |||
201 | #define S3C2400_GPBDAT S3C2410_GPIOREG(0x0C) | 201 | #define S3C2400_GPBDAT S3C2410_GPIOREG(0x0C) |
202 | #define S3C2400_GPBUP S3C2410_GPIOREG(0x10) | 202 | #define S3C2400_GPBUP S3C2410_GPIOREG(0x10) |
203 | 203 | ||
204 | /* no i/o pin in port b can have value 3! */ | 204 | /* no i/o pin in port b can have value 3 (unless it is a s3c2443) ! */ |
205 | 205 | ||
206 | #define S3C2410_GPB0 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 0) | 206 | #define S3C2410_GPB0 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 0) |
207 | #define S3C2410_GPB0_INP (0x00 << 0) | 207 | #define S3C2410_GPB0_INP (0x00 << 0) |
@@ -242,6 +242,7 @@ | |||
242 | #define S3C2410_GPB5_INP (0x00 << 10) | 242 | #define S3C2410_GPB5_INP (0x00 << 10) |
243 | #define S3C2410_GPB5_OUTP (0x01 << 10) | 243 | #define S3C2410_GPB5_OUTP (0x01 << 10) |
244 | #define S3C2410_GPB5_nXBACK (0x02 << 10) | 244 | #define S3C2410_GPB5_nXBACK (0x02 << 10) |
245 | #define S3C2443_GPB5_XBACK (0x03 << 10) | ||
245 | #define S3C2400_GPB5_DATA21 (0x02 << 10) | 246 | #define S3C2400_GPB5_DATA21 (0x02 << 10) |
246 | #define S3C2400_GPB5_nCTS1 (0x03 << 10) | 247 | #define S3C2400_GPB5_nCTS1 (0x03 << 10) |
247 | 248 | ||
@@ -249,6 +250,7 @@ | |||
249 | #define S3C2410_GPB6_INP (0x00 << 12) | 250 | #define S3C2410_GPB6_INP (0x00 << 12) |
250 | #define S3C2410_GPB6_OUTP (0x01 << 12) | 251 | #define S3C2410_GPB6_OUTP (0x01 << 12) |
251 | #define S3C2410_GPB6_nXBREQ (0x02 << 12) | 252 | #define S3C2410_GPB6_nXBREQ (0x02 << 12) |
253 | #define S3C2443_GPB6_XBREQ (0x03 << 12) | ||
252 | #define S3C2400_GPB6_DATA22 (0x02 << 12) | 254 | #define S3C2400_GPB6_DATA22 (0x02 << 12) |
253 | #define S3C2400_GPB6_nRTS1 (0x03 << 12) | 255 | #define S3C2400_GPB6_nRTS1 (0x03 << 12) |
254 | 256 | ||
@@ -256,6 +258,7 @@ | |||
256 | #define S3C2410_GPB7_INP (0x00 << 14) | 258 | #define S3C2410_GPB7_INP (0x00 << 14) |
257 | #define S3C2410_GPB7_OUTP (0x01 << 14) | 259 | #define S3C2410_GPB7_OUTP (0x01 << 14) |
258 | #define S3C2410_GPB7_nXDACK1 (0x02 << 14) | 260 | #define S3C2410_GPB7_nXDACK1 (0x02 << 14) |
261 | #define S3C2443_GPB7_XDACK1 (0x03 << 14) | ||
259 | #define S3C2400_GPB7_DATA23 (0x02 << 14) | 262 | #define S3C2400_GPB7_DATA23 (0x02 << 14) |
260 | 263 | ||
261 | #define S3C2410_GPB8 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 8) | 264 | #define S3C2410_GPB8 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 8) |
@@ -268,6 +271,7 @@ | |||
268 | #define S3C2410_GPB9_INP (0x00 << 18) | 271 | #define S3C2410_GPB9_INP (0x00 << 18) |
269 | #define S3C2410_GPB9_OUTP (0x01 << 18) | 272 | #define S3C2410_GPB9_OUTP (0x01 << 18) |
270 | #define S3C2410_GPB9_nXDACK0 (0x02 << 18) | 273 | #define S3C2410_GPB9_nXDACK0 (0x02 << 18) |
274 | #define S3C2443_GPB9_XDACK0 (0x03 << 18) | ||
271 | #define S3C2400_GPB9_DATA25 (0x02 << 18) | 275 | #define S3C2400_GPB9_DATA25 (0x02 << 18) |
272 | #define S3C2400_GPB9_I2SSDI (0x03 << 18) | 276 | #define S3C2400_GPB9_I2SSDI (0x03 << 18) |
273 | 277 | ||
@@ -275,6 +279,7 @@ | |||
275 | #define S3C2410_GPB10_INP (0x00 << 20) | 279 | #define S3C2410_GPB10_INP (0x00 << 20) |
276 | #define S3C2410_GPB10_OUTP (0x01 << 20) | 280 | #define S3C2410_GPB10_OUTP (0x01 << 20) |
277 | #define S3C2410_GPB10_nXDRE0 (0x02 << 20) | 281 | #define S3C2410_GPB10_nXDRE0 (0x02 << 20) |
282 | #define S3C2443_GPB10_XDREQ0 (0x03 << 20) | ||
278 | #define S3C2400_GPB10_DATA26 (0x02 << 20) | 283 | #define S3C2400_GPB10_DATA26 (0x02 << 20) |
279 | #define S3C2400_GPB10_nSS (0x03 << 20) | 284 | #define S3C2400_GPB10_nSS (0x03 << 20) |
280 | 285 | ||
@@ -556,6 +561,7 @@ | |||
556 | #define S3C2410_GPE0_INP (0x00 << 0) | 561 | #define S3C2410_GPE0_INP (0x00 << 0) |
557 | #define S3C2410_GPE0_OUTP (0x01 << 0) | 562 | #define S3C2410_GPE0_OUTP (0x01 << 0) |
558 | #define S3C2410_GPE0_I2SLRCK (0x02 << 0) | 563 | #define S3C2410_GPE0_I2SLRCK (0x02 << 0) |
564 | #define S3C2443_GPE0_AC_nRESET (0x03 << 0) | ||
559 | #define S3C2400_GPE0_EINT0 (0x02 << 0) | 565 | #define S3C2400_GPE0_EINT0 (0x02 << 0) |
560 | #define S3C2410_GPE0_MASK (0x03 << 0) | 566 | #define S3C2410_GPE0_MASK (0x03 << 0) |
561 | 567 | ||
@@ -563,6 +569,7 @@ | |||
563 | #define S3C2410_GPE1_INP (0x00 << 2) | 569 | #define S3C2410_GPE1_INP (0x00 << 2) |
564 | #define S3C2410_GPE1_OUTP (0x01 << 2) | 570 | #define S3C2410_GPE1_OUTP (0x01 << 2) |
565 | #define S3C2410_GPE1_I2SSCLK (0x02 << 2) | 571 | #define S3C2410_GPE1_I2SSCLK (0x02 << 2) |
572 | #define S3C2443_GPE1_AC_SYNC (0x03 << 2) | ||
566 | #define S3C2400_GPE1_EINT1 (0x02 << 2) | 573 | #define S3C2400_GPE1_EINT1 (0x02 << 2) |
567 | #define S3C2400_GPE1_nSS (0x03 << 2) | 574 | #define S3C2400_GPE1_nSS (0x03 << 2) |
568 | #define S3C2410_GPE1_MASK (0x03 << 2) | 575 | #define S3C2410_GPE1_MASK (0x03 << 2) |
@@ -571,6 +578,7 @@ | |||
571 | #define S3C2410_GPE2_INP (0x00 << 4) | 578 | #define S3C2410_GPE2_INP (0x00 << 4) |
572 | #define S3C2410_GPE2_OUTP (0x01 << 4) | 579 | #define S3C2410_GPE2_OUTP (0x01 << 4) |
573 | #define S3C2410_GPE2_CDCLK (0x02 << 4) | 580 | #define S3C2410_GPE2_CDCLK (0x02 << 4) |
581 | #define S3C2443_GPE2_AC_BITCLK (0x03 << 4) | ||
574 | #define S3C2400_GPE2_EINT2 (0x02 << 4) | 582 | #define S3C2400_GPE2_EINT2 (0x02 << 4) |
575 | #define S3C2400_GPE2_I2SSDI (0x03 << 4) | 583 | #define S3C2400_GPE2_I2SSDI (0x03 << 4) |
576 | 584 | ||
@@ -578,6 +586,7 @@ | |||
578 | #define S3C2410_GPE3_INP (0x00 << 6) | 586 | #define S3C2410_GPE3_INP (0x00 << 6) |
579 | #define S3C2410_GPE3_OUTP (0x01 << 6) | 587 | #define S3C2410_GPE3_OUTP (0x01 << 6) |
580 | #define S3C2410_GPE3_I2SSDI (0x02 << 6) | 588 | #define S3C2410_GPE3_I2SSDI (0x02 << 6) |
589 | #define S3C2443_GPE3_AC_SDI (0x03 << 6) | ||
581 | #define S3C2400_GPE3_EINT3 (0x02 << 6) | 590 | #define S3C2400_GPE3_EINT3 (0x02 << 6) |
582 | #define S3C2400_GPE3_nCTS1 (0x03 << 6) | 591 | #define S3C2400_GPE3_nCTS1 (0x03 << 6) |
583 | #define S3C2410_GPE3_nSS0 (0x03 << 6) | 592 | #define S3C2410_GPE3_nSS0 (0x03 << 6) |
@@ -587,6 +596,7 @@ | |||
587 | #define S3C2410_GPE4_INP (0x00 << 8) | 596 | #define S3C2410_GPE4_INP (0x00 << 8) |
588 | #define S3C2410_GPE4_OUTP (0x01 << 8) | 597 | #define S3C2410_GPE4_OUTP (0x01 << 8) |
589 | #define S3C2410_GPE4_I2SSDO (0x02 << 8) | 598 | #define S3C2410_GPE4_I2SSDO (0x02 << 8) |
599 | #define S3C2443_GPE4_AC_SDO (0x03 << 8) | ||
590 | #define S3C2400_GPE4_EINT4 (0x02 << 8) | 600 | #define S3C2400_GPE4_EINT4 (0x02 << 8) |
591 | #define S3C2400_GPE4_nRTS1 (0x03 << 8) | 601 | #define S3C2400_GPE4_nRTS1 (0x03 << 8) |
592 | #define S3C2410_GPE4_I2SSDI (0x03 << 8) | 602 | #define S3C2410_GPE4_I2SSDI (0x03 << 8) |
@@ -596,6 +606,7 @@ | |||
596 | #define S3C2410_GPE5_INP (0x00 << 10) | 606 | #define S3C2410_GPE5_INP (0x00 << 10) |
597 | #define S3C2410_GPE5_OUTP (0x01 << 10) | 607 | #define S3C2410_GPE5_OUTP (0x01 << 10) |
598 | #define S3C2410_GPE5_SDCLK (0x02 << 10) | 608 | #define S3C2410_GPE5_SDCLK (0x02 << 10) |
609 | #define S3C2443_GPE5_SD1_CLK (0x02 << 10) | ||
599 | #define S3C2400_GPE5_EINT5 (0x02 << 10) | 610 | #define S3C2400_GPE5_EINT5 (0x02 << 10) |
600 | #define S3C2400_GPE5_TCLK1 (0x03 << 10) | 611 | #define S3C2400_GPE5_TCLK1 (0x03 << 10) |
601 | 612 | ||
@@ -603,24 +614,32 @@ | |||
603 | #define S3C2410_GPE6_INP (0x00 << 12) | 614 | #define S3C2410_GPE6_INP (0x00 << 12) |
604 | #define S3C2410_GPE6_OUTP (0x01 << 12) | 615 | #define S3C2410_GPE6_OUTP (0x01 << 12) |
605 | #define S3C2410_GPE6_SDCMD (0x02 << 12) | 616 | #define S3C2410_GPE6_SDCMD (0x02 << 12) |
617 | #define S3C2443_GPE6_SD1_CMD (0x02 << 12) | ||
618 | #define S3C2443_GPE6_AC_BITCLK (0x03 << 12) | ||
606 | #define S3C2400_GPE6_EINT6 (0x02 << 12) | 619 | #define S3C2400_GPE6_EINT6 (0x02 << 12) |
607 | 620 | ||
608 | #define S3C2410_GPE7 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 7) | 621 | #define S3C2410_GPE7 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 7) |
609 | #define S3C2410_GPE7_INP (0x00 << 14) | 622 | #define S3C2410_GPE7_INP (0x00 << 14) |
610 | #define S3C2410_GPE7_OUTP (0x01 << 14) | 623 | #define S3C2410_GPE7_OUTP (0x01 << 14) |
611 | #define S3C2410_GPE7_SDDAT0 (0x02 << 14) | 624 | #define S3C2410_GPE7_SDDAT0 (0x02 << 14) |
625 | #define S3C2443_GPE5_SD1_DAT0 (0x02 << 14) | ||
626 | #define S3C2443_GPE7_AC_SDI (0x03 << 14) | ||
612 | #define S3C2400_GPE7_EINT7 (0x02 << 14) | 627 | #define S3C2400_GPE7_EINT7 (0x02 << 14) |
613 | 628 | ||
614 | #define S3C2410_GPE8 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 8) | 629 | #define S3C2410_GPE8 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 8) |
615 | #define S3C2410_GPE8_INP (0x00 << 16) | 630 | #define S3C2410_GPE8_INP (0x00 << 16) |
616 | #define S3C2410_GPE8_OUTP (0x01 << 16) | 631 | #define S3C2410_GPE8_OUTP (0x01 << 16) |
617 | #define S3C2410_GPE8_SDDAT1 (0x02 << 16) | 632 | #define S3C2410_GPE8_SDDAT1 (0x02 << 16) |
633 | #define S3C2443_GPE8_SD1_DAT1 (0x02 << 16) | ||
634 | #define S3C2443_GPE8_AC_SDO (0x03 << 16) | ||
618 | #define S3C2400_GPE8_nXDACK0 (0x02 << 16) | 635 | #define S3C2400_GPE8_nXDACK0 (0x02 << 16) |
619 | 636 | ||
620 | #define S3C2410_GPE9 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 9) | 637 | #define S3C2410_GPE9 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 9) |
621 | #define S3C2410_GPE9_INP (0x00 << 18) | 638 | #define S3C2410_GPE9_INP (0x00 << 18) |
622 | #define S3C2410_GPE9_OUTP (0x01 << 18) | 639 | #define S3C2410_GPE9_OUTP (0x01 << 18) |
623 | #define S3C2410_GPE9_SDDAT2 (0x02 << 18) | 640 | #define S3C2410_GPE9_SDDAT2 (0x02 << 18) |
641 | #define S3C2443_GPE9_SD1_DAT2 (0x02 << 18) | ||
642 | #define S3C2443_GPE9_AC_SYNC (0x03 << 18) | ||
624 | #define S3C2400_GPE9_nXDACK1 (0x02 << 18) | 643 | #define S3C2400_GPE9_nXDACK1 (0x02 << 18) |
625 | #define S3C2400_GPE9_nXBACK (0x03 << 18) | 644 | #define S3C2400_GPE9_nXBACK (0x03 << 18) |
626 | 645 | ||
@@ -628,6 +647,8 @@ | |||
628 | #define S3C2410_GPE10_INP (0x00 << 20) | 647 | #define S3C2410_GPE10_INP (0x00 << 20) |
629 | #define S3C2410_GPE10_OUTP (0x01 << 20) | 648 | #define S3C2410_GPE10_OUTP (0x01 << 20) |
630 | #define S3C2410_GPE10_SDDAT3 (0x02 << 20) | 649 | #define S3C2410_GPE10_SDDAT3 (0x02 << 20) |
650 | #define S3C2443_GPE10_SD1_DAT3 (0x02 << 20) | ||
651 | #define S3C2443_GPE10_AC_nRESET (0x03 << 20) | ||
631 | #define S3C2400_GPE10_nXDREQ0 (0x02 << 20) | 652 | #define S3C2400_GPE10_nXDREQ0 (0x02 << 20) |
632 | 653 | ||
633 | #define S3C2410_GPE11 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 11) | 654 | #define S3C2410_GPE11 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 11) |
@@ -796,6 +817,7 @@ | |||
796 | #define S3C2400_GPG4_MMCCLK (0x02 << 8) | 817 | #define S3C2400_GPG4_MMCCLK (0x02 << 8) |
797 | #define S3C2400_GPG4_I2SSDI (0x03 << 8) | 818 | #define S3C2400_GPG4_I2SSDI (0x03 << 8) |
798 | #define S3C2410_GPG4_LCDPWREN (0x03 << 8) | 819 | #define S3C2410_GPG4_LCDPWREN (0x03 << 8) |
820 | #define S3C2443_GPG4_LCDPWRDN (0x03 << 8) | ||
799 | 821 | ||
800 | #define S3C2410_GPG5 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 5) | 822 | #define S3C2410_GPG5 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 5) |
801 | #define S3C2410_GPG5_INP (0x00 << 10) | 823 | #define S3C2410_GPG5_INP (0x00 << 10) |
@@ -803,7 +825,7 @@ | |||
803 | #define S3C2410_GPG5_EINT13 (0x02 << 10) | 825 | #define S3C2410_GPG5_EINT13 (0x02 << 10) |
804 | #define S3C2400_GPG5_MMCCMD (0x02 << 10) | 826 | #define S3C2400_GPG5_MMCCMD (0x02 << 10) |
805 | #define S3C2400_GPG5_IICSDA (0x03 << 10) | 827 | #define S3C2400_GPG5_IICSDA (0x03 << 10) |
806 | #define S3C2410_GPG5_SPIMISO1 (0x03 << 10) | 828 | #define S3C2410_GPG5_SPIMISO1 (0x03 << 10) /* not s3c2443 */ |
807 | 829 | ||
808 | #define S3C2410_GPG6 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 6) | 830 | #define S3C2410_GPG6 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 6) |
809 | #define S3C2410_GPG6_INP (0x00 << 12) | 831 | #define S3C2410_GPG6_INP (0x00 << 12) |
@@ -845,6 +867,7 @@ | |||
845 | #define S3C2410_GPG11_OUTP (0x01 << 22) | 867 | #define S3C2410_GPG11_OUTP (0x01 << 22) |
846 | #define S3C2410_GPG11_EINT19 (0x02 << 22) | 868 | #define S3C2410_GPG11_EINT19 (0x02 << 22) |
847 | #define S3C2410_GPG11_TCLK1 (0x03 << 22) | 869 | #define S3C2410_GPG11_TCLK1 (0x03 << 22) |
870 | #define S3C2443_GPG11_CF_nIREQ (0x03 << 22) | ||
848 | 871 | ||
849 | #define S3C2410_GPG12 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 12) | 872 | #define S3C2410_GPG12 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 12) |
850 | #define S3C2410_GPG12_INP (0x00 << 24) | 873 | #define S3C2410_GPG12_INP (0x00 << 24) |
@@ -852,25 +875,28 @@ | |||
852 | #define S3C2410_GPG12_EINT20 (0x02 << 24) | 875 | #define S3C2410_GPG12_EINT20 (0x02 << 24) |
853 | #define S3C2410_GPG12_XMON (0x03 << 24) | 876 | #define S3C2410_GPG12_XMON (0x03 << 24) |
854 | #define S3C2442_GPG12_nSPICS0 (0x03 << 24) | 877 | #define S3C2442_GPG12_nSPICS0 (0x03 << 24) |
878 | #define S3C2443_GPG12_nINPACK (0x03 << 24) | ||
855 | 879 | ||
856 | #define S3C2410_GPG13 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 13) | 880 | #define S3C2410_GPG13 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 13) |
857 | #define S3C2410_GPG13_INP (0x00 << 26) | 881 | #define S3C2410_GPG13_INP (0x00 << 26) |
858 | #define S3C2410_GPG13_OUTP (0x01 << 26) | 882 | #define S3C2410_GPG13_OUTP (0x01 << 26) |
859 | #define S3C2410_GPG13_EINT21 (0x02 << 26) | 883 | #define S3C2410_GPG13_EINT21 (0x02 << 26) |
860 | #define S3C2410_GPG13_nXPON (0x03 << 26) | 884 | #define S3C2410_GPG13_nXPON (0x03 << 26) |
885 | #define S3C2443_GPG13_CF_nREG (0x03 << 26) | ||
861 | 886 | ||
862 | #define S3C2410_GPG14 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 14) | 887 | #define S3C2410_GPG14 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 14) |
863 | #define S3C2410_GPG14_INP (0x00 << 28) | 888 | #define S3C2410_GPG14_INP (0x00 << 28) |
864 | #define S3C2410_GPG14_OUTP (0x01 << 28) | 889 | #define S3C2410_GPG14_OUTP (0x01 << 28) |
865 | #define S3C2410_GPG14_EINT22 (0x02 << 28) | 890 | #define S3C2410_GPG14_EINT22 (0x02 << 28) |
866 | #define S3C2410_GPG14_YMON (0x03 << 28) | 891 | #define S3C2410_GPG14_YMON (0x03 << 28) |
892 | #define S3C2443_GPG14_CF_RESET (0x03 << 28) | ||
867 | 893 | ||
868 | #define S3C2410_GPG15 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 15) | 894 | #define S3C2410_GPG15 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 15) |
869 | #define S3C2410_GPG15_INP (0x00 << 30) | 895 | #define S3C2410_GPG15_INP (0x00 << 30) |
870 | #define S3C2410_GPG15_OUTP (0x01 << 30) | 896 | #define S3C2410_GPG15_OUTP (0x01 << 30) |
871 | #define S3C2410_GPG15_EINT23 (0x02 << 30) | 897 | #define S3C2410_GPG15_EINT23 (0x02 << 30) |
872 | #define S3C2410_GPG15_nYPON (0x03 << 30) | 898 | #define S3C2410_GPG15_nYPON (0x03 << 30) |
873 | 899 | #define S3C2443_GPG15_CF_PWR (0x03 << 30) | |
874 | 900 | ||
875 | #define S3C2410_GPG_PUPDIS(x) (1<<(x)) | 901 | #define S3C2410_GPG_PUPDIS(x) (1<<(x)) |
876 | 902 | ||
diff --git a/include/asm-arm/arch-s3c2410/regs-s3c2443-clock.h b/include/asm-arm/arch-s3c2410/regs-s3c2443-clock.h new file mode 100644 index 000000000000..ff0536d2de42 --- /dev/null +++ b/include/asm-arm/arch-s3c2410/regs-s3c2443-clock.h | |||
@@ -0,0 +1,194 @@ | |||
1 | /* linux/include/asm-arm/arch-s3c2410/regs-clock.h | ||
2 | * | ||
3 | * Copyright (c) 2007 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * http://armlinux.simtec.co.uk/ | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * S3C2443 clock register definitions | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARM_REGS_S3C2443_CLOCK | ||
15 | #define __ASM_ARM_REGS_S3C2443_CLOCK | ||
16 | |||
17 | #define S3C2443_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR) | ||
18 | |||
19 | #define S3C2443_PLLCON_MDIVSHIFT 16 | ||
20 | #define S3C2443_PLLCON_PDIVSHIFT 8 | ||
21 | #define S3C2443_PLLCON_SDIVSHIFT 0 | ||
22 | #define S3C2443_PLLCON_MDIVMASK ((1<<(1+(23-16)))-1) | ||
23 | #define S3C2443_PLLCON_PDIVMASK ((1<<(1+(9-8)))-1) | ||
24 | #define S3C2443_PLLCON_SDIVMASK (3) | ||
25 | |||
26 | #define S3C2443_MPLLCON S3C2443_CLKREG(0x10) | ||
27 | #define S3C2443_EPLLCON S3C2443_CLKREG(0x18) | ||
28 | #define S3C2443_CLKSRC S3C2443_CLKREG(0x20) | ||
29 | #define S3C2443_CLKDIV0 S3C2443_CLKREG(0x24) | ||
30 | #define S3C2443_CLKDIV1 S3C2443_CLKREG(0x28) | ||
31 | #define S3C2443_HCLKCON S3C2443_CLKREG(0x30) | ||
32 | #define S3C2443_PCLKCON S3C2443_CLKREG(0x34) | ||
33 | #define S3C2443_SCLKCON S3C2443_CLKREG(0x38) | ||
34 | #define S3C2443_PWRMODE S3C2443_CLKREG(0x40) | ||
35 | #define S3C2443_SWRST S3C2443_CLKREG(0x44) | ||
36 | #define S3C2443_BUSPRI0 S3C2443_CLKREG(0x50) | ||
37 | #define S3C2443_SYSID S3C2443_CLKREG(0x5C) | ||
38 | #define S3C2443_PWRCFG S3C2443_CLKREG(0x60) | ||
39 | #define S3C2443_RSTCON S3C2443_CLKREG(0x64) | ||
40 | |||
41 | #define S3C2443_SWRST_RESET (0x533c2443) | ||
42 | |||
43 | #define S3C2443_PLLCON_OFF (1<<24) | ||
44 | |||
45 | #define S3C2443_CLKSRC_I2S_EXT (1<<14) | ||
46 | #define S3C2443_CLKSRC_I2S_EPLLDIV (0<<14) | ||
47 | #define S3C2443_CLKSRC_I2S_EPLLREF (2<<14) | ||
48 | #define S3C2443_CLKSRC_I2S_EPLLREF3 (3<<14) | ||
49 | #define S3C2443_CLKSRC_I2S_MASK (3<<14) | ||
50 | |||
51 | #define S3C2443_CLKSRC_EPLLREF_XTAL (2<<8) | ||
52 | #define S3C2443_CLKSRC_EPLLREF_EXTCLK (3<<8) | ||
53 | #define S3C2443_CLKSRC_EPLLREF_MPLLREF (0<<8) | ||
54 | #define S3C2443_CLKSRC_EPLLREF_MPLLREF2 (1<<8) | ||
55 | #define S3C2443_CLKSRC_EPLLREF_MASK (3<<8) | ||
56 | |||
57 | #define S3C2443_CLKSRC_ESYSCLK_EPLL (1<<6) | ||
58 | #define S3C2443_CLKSRC_MSYSCLK_MPLL (1<<4) | ||
59 | #define S3C2443_CLKSRC_EXTCLK_DIV (1<<3) | ||
60 | |||
61 | #define S3C2443_CLKDIV0_DVS (1<<13) | ||
62 | #define S3C2443_CLKDIV0_HALF_HCLK (1<<3) | ||
63 | #define S3C2443_CLKDIV0_HALF_PCLK (1<<2) | ||
64 | |||
65 | #define S3C2443_CLKDIV0_HCLKDIV_MASK (3<<0) | ||
66 | |||
67 | #define S3C2443_CLKDIV0_EXTDIV_MASK (3<<6) | ||
68 | #define S3C2443_CLKDIV0_EXTDIV_SHIFT (6) | ||
69 | |||
70 | #define S3C2443_CLKDIV0_PREDIV_MASK (3<<4) | ||
71 | #define S3C2443_CLKDIV0_PREDIV_SHIFT (4) | ||
72 | |||
73 | #define S3C2443_CLKDIV0_ARMDIV_MASK (15<<9) | ||
74 | #define S3C2443_CLKDIV0_ARMDIV_SHIFT (9) | ||
75 | #define S3C2443_CLKDIV0_ARMDIV_1 (0<<9) | ||
76 | #define S3C2443_CLKDIV0_ARMDIV_2 (8<<9) | ||
77 | #define S3C2443_CLKDIV0_ARMDIV_3 (2<<9) | ||
78 | #define S3C2443_CLKDIV0_ARMDIV_4 (9<<9) | ||
79 | #define S3C2443_CLKDIV0_ARMDIV_6 (10<<9) | ||
80 | #define S3C2443_CLKDIV0_ARMDIV_8 (11<<9) | ||
81 | #define S3C2443_CLKDIV0_ARMDIV_12 (13<<9) | ||
82 | #define S3C2443_CLKDIV0_ARMDIV_16 (15<<9) | ||
83 | |||
84 | /* S3C2443_CLKDIV1 */ | ||
85 | |||
86 | #define S3C2443_CLKDIV1_CAMDIV_MASK (15<<26) | ||
87 | #define S3C2443_CLKDIV1_CAMDIV_SHIFT (26) | ||
88 | |||
89 | #define S3C2443_CLKDIV1_HSSPIDIV_MASK (3<<24) | ||
90 | #define S3C2443_CLKDIV1_HSSPIDIV_SHIFT (24) | ||
91 | |||
92 | #define S3C2443_CLKDIV1_DISPDIV_MASK (0xff<<16) | ||
93 | #define S3C2443_CLKDIV1_DISPDIV_SHIFT (16) | ||
94 | |||
95 | #define S3C2443_CLKDIV1_I2SDIV_MASK (15<<12) | ||
96 | #define S3C2443_CLKDIV1_I2SDIV_SHIFT (12) | ||
97 | |||
98 | #define S3C2443_CLKDIV1_UARTDIV_MASK (15<<8) | ||
99 | #define S3C2443_CLKDIV1_UARTDIV_SHIFT (8) | ||
100 | |||
101 | #define S3C2443_CLKDIV1_HSMMCDIV_MASK (3<<6) | ||
102 | #define S3C2443_CLKDIV1_HSMMCDIV_SHIFT (6) | ||
103 | |||
104 | #define S3C2443_CLKDIV1_USBHOSTDIV_MASK (3<<4) | ||
105 | #define S3C2443_CLKDIV1_USBHOSTDIV_SHIFT (4) | ||
106 | |||
107 | #define S3C2443_CLKCON_NAND | ||
108 | |||
109 | #define S3C2443_HCLKCON_DMA0 (1<<0) | ||
110 | #define S3C2443_HCLKCON_DMA1 (1<<1) | ||
111 | #define S3C2443_HCLKCON_DMA2 (1<<2) | ||
112 | #define S3C2443_HCLKCON_DMA3 (1<<3) | ||
113 | #define S3C2443_HCLKCON_DMA4 (1<<4) | ||
114 | #define S3C2443_HCLKCON_DMA5 (1<<5) | ||
115 | #define S3C2443_HCLKCON_CAMIF (1<<8) | ||
116 | #define S3C2443_HCLKCON_DISP (1<<9) | ||
117 | #define S3C2443_HCLKCON_LCDC (1<<10) | ||
118 | #define S3C2443_HCLKCON_USBH (1<<11) | ||
119 | #define S3C2443_HCLKCON_USBD (1<<12) | ||
120 | #define S3C2443_HCLKCON_HSMMC (1<<16) | ||
121 | #define S3C2443_HCLKCON_CFC (1<<17) | ||
122 | #define S3C2443_HCLKCON_SSMC (1<<18) | ||
123 | #define S3C2443_HCLKCON_DRAMC (1<<19) | ||
124 | |||
125 | #define S3C2443_PCLKCON_UART0 (1<<0) | ||
126 | #define S3C2443_PCLKCON_UART1 (1<<1) | ||
127 | #define S3C2443_PCLKCON_UART2 (1<<2) | ||
128 | #define S3C2443_PCLKCON_UART3 (1<<3) | ||
129 | #define S3C2443_PCLKCON_IIC (1<<4) | ||
130 | #define S3C2443_PCLKCON_SDI (1<<5) | ||
131 | #define S3C2443_PCLKCON_ADC (1<<7) | ||
132 | #define S3C2443_PCLKCON_IIS (1<<9) | ||
133 | #define S3C2443_PCLKCON_PWMT (1<<10) | ||
134 | #define S3C2443_PCLKCON_WDT (1<<11) | ||
135 | #define S3C2443_PCLKCON_RTC (1<<12) | ||
136 | #define S3C2443_PCLKCON_GPIO (1<<13) | ||
137 | #define S3C2443_PCLKCON_SPI0 (1<<14) | ||
138 | #define S3C2443_PCLKCON_SPI1 (1<<15) | ||
139 | |||
140 | #define S3C2443_SCLKCON_DDRCLK (1<<16) | ||
141 | #define S3C2443_SCLKCON_SSMCCLK (1<<15) | ||
142 | #define S3C2443_SCLKCON_HSSPICLK (1<<14) | ||
143 | #define S3C2443_SCLKCON_HSMMCCLK_EXT (1<<13) | ||
144 | #define S3C2443_SCLKCON_HSMMCCLK_EPLL (1<<12) | ||
145 | #define S3C2443_SCLKCON_CAMCLK (1<<11) | ||
146 | #define S3C2443_SCLKCON_DISPCLK (1<<10) | ||
147 | #define S3C2443_SCLKCON_I2SCLK (1<<9) | ||
148 | #define S3C2443_SCLKCON_UARTCLK (1<<8) | ||
149 | #define S3C2443_SCLKCON_USBHOST (1<<1) | ||
150 | |||
151 | #include <asm/div64.h> | ||
152 | |||
153 | static inline unsigned int | ||
154 | s3c2443_get_mpll(unsigned int pllval, unsigned int baseclk) | ||
155 | { | ||
156 | unsigned int mdiv, pdiv, sdiv; | ||
157 | uint64_t fvco; | ||
158 | |||
159 | mdiv = pllval >> S3C2443_PLLCON_MDIVSHIFT; | ||
160 | pdiv = pllval >> S3C2443_PLLCON_PDIVSHIFT; | ||
161 | sdiv = pllval >> S3C2443_PLLCON_SDIVSHIFT; | ||
162 | |||
163 | mdiv &= S3C2443_PLLCON_MDIVMASK; | ||
164 | pdiv &= S3C2443_PLLCON_PDIVMASK; | ||
165 | sdiv &= S3C2443_PLLCON_SDIVMASK; | ||
166 | |||
167 | fvco = (uint64_t)baseclk * (2 * (mdiv + 8)); | ||
168 | do_div(fvco, pdiv << sdiv); | ||
169 | |||
170 | return (unsigned int)fvco; | ||
171 | } | ||
172 | |||
173 | static inline unsigned int | ||
174 | s3c2443_get_epll(unsigned int pllval, unsigned int baseclk) | ||
175 | { | ||
176 | unsigned int mdiv, pdiv, sdiv; | ||
177 | uint64_t fvco; | ||
178 | |||
179 | mdiv = pllval >> S3C2443_PLLCON_MDIVSHIFT; | ||
180 | pdiv = pllval >> S3C2443_PLLCON_PDIVSHIFT; | ||
181 | sdiv = pllval >> S3C2443_PLLCON_SDIVSHIFT; | ||
182 | |||
183 | mdiv &= S3C2443_PLLCON_MDIVMASK; | ||
184 | pdiv &= S3C2443_PLLCON_PDIVMASK; | ||
185 | sdiv &= S3C2443_PLLCON_SDIVMASK; | ||
186 | |||
187 | fvco = (uint64_t)baseclk * (mdiv + 8); | ||
188 | do_div(fvco, (pdiv + 2) << sdiv); | ||
189 | |||
190 | return (unsigned int)fvco; | ||
191 | } | ||
192 | |||
193 | #endif /* __ASM_ARM_REGS_S3C2443_CLOCK */ | ||
194 | |||
diff --git a/include/asm-arm/arch-s3c2410/regs-serial.h b/include/asm-arm/arch-s3c2410/regs-serial.h index 46f52401d132..8946702a87f5 100644 --- a/include/asm-arm/arch-s3c2410/regs-serial.h +++ b/include/asm-arm/arch-s3c2410/regs-serial.h | |||
@@ -35,10 +35,12 @@ | |||
35 | #define S3C24XX_VA_UART0 (S3C24XX_VA_UART) | 35 | #define S3C24XX_VA_UART0 (S3C24XX_VA_UART) |
36 | #define S3C24XX_VA_UART1 (S3C24XX_VA_UART + 0x4000 ) | 36 | #define S3C24XX_VA_UART1 (S3C24XX_VA_UART + 0x4000 ) |
37 | #define S3C24XX_VA_UART2 (S3C24XX_VA_UART + 0x8000 ) | 37 | #define S3C24XX_VA_UART2 (S3C24XX_VA_UART + 0x8000 ) |
38 | #define S3C24XX_VA_UART3 (S3C24XX_VA_UART + 0xC000 ) | ||
38 | 39 | ||
39 | #define S3C2410_PA_UART0 (S3C24XX_PA_UART) | 40 | #define S3C2410_PA_UART0 (S3C24XX_PA_UART) |
40 | #define S3C2410_PA_UART1 (S3C24XX_PA_UART + 0x4000 ) | 41 | #define S3C2410_PA_UART1 (S3C24XX_PA_UART + 0x4000 ) |
41 | #define S3C2410_PA_UART2 (S3C24XX_PA_UART + 0x8000 ) | 42 | #define S3C2410_PA_UART2 (S3C24XX_PA_UART + 0x8000 ) |
43 | #define S3C2443_PA_UART3 (S3C24XX_PA_UART + 0xC000 ) | ||
42 | 44 | ||
43 | #define S3C2410_URXH (0x24) | 45 | #define S3C2410_URXH (0x24) |
44 | #define S3C2410_UTXH (0x20) | 46 | #define S3C2410_UTXH (0x20) |
@@ -73,6 +75,8 @@ | |||
73 | #define S3C2440_UCON_UCLK (1<<10) | 75 | #define S3C2440_UCON_UCLK (1<<10) |
74 | #define S3C2440_UCON_PCLK2 (2<<10) | 76 | #define S3C2440_UCON_PCLK2 (2<<10) |
75 | #define S3C2440_UCON_FCLK (3<<10) | 77 | #define S3C2440_UCON_FCLK (3<<10) |
78 | #define S3C2443_UCON_EPLL (3<<10) | ||
79 | |||
76 | #define S3C2440_UCON2_FCLK_EN (1<<15) | 80 | #define S3C2440_UCON2_FCLK_EN (1<<15) |
77 | #define S3C2440_UCON0_DIVMASK (15 << 12) | 81 | #define S3C2440_UCON0_DIVMASK (15 << 12) |
78 | #define S3C2440_UCON1_DIVMASK (15 << 12) | 82 | #define S3C2440_UCON1_DIVMASK (15 << 12) |
@@ -93,6 +97,8 @@ | |||
93 | #define S3C2410_UCON_TXIRQMODE (1<<2) | 97 | #define S3C2410_UCON_TXIRQMODE (1<<2) |
94 | #define S3C2410_UCON_RXIRQMODE (1<<0) | 98 | #define S3C2410_UCON_RXIRQMODE (1<<0) |
95 | #define S3C2410_UCON_RXFIFO_TOI (1<<7) | 99 | #define S3C2410_UCON_RXFIFO_TOI (1<<7) |
100 | #define S3C2443_UCON_RXERR_IRQEN (1<<6) | ||
101 | #define S3C2443_UCON_LOOPBACK (1<<5) | ||
96 | 102 | ||
97 | #define S3C2410_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | 103 | #define S3C2410_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
98 | S3C2410_UCON_RXILEVEL | \ | 104 | S3C2410_UCON_RXILEVEL | \ |
@@ -127,7 +133,7 @@ | |||
127 | #define S3C2410_UMCOM_AFC (1<<4) | 133 | #define S3C2410_UMCOM_AFC (1<<4) |
128 | #define S3C2410_UMCOM_RTS_LOW (1<<0) | 134 | #define S3C2410_UMCOM_RTS_LOW (1<<0) |
129 | 135 | ||
130 | #define S3C2412_UMCON_AFC_63 (0<<5) | 136 | #define S3C2412_UMCON_AFC_63 (0<<5) /* same as s3c2443 */ |
131 | #define S3C2412_UMCON_AFC_56 (1<<5) | 137 | #define S3C2412_UMCON_AFC_56 (1<<5) |
132 | #define S3C2412_UMCON_AFC_48 (2<<5) | 138 | #define S3C2412_UMCON_AFC_48 (2<<5) |
133 | #define S3C2412_UMCON_AFC_40 (3<<5) | 139 | #define S3C2412_UMCON_AFC_40 (3<<5) |
@@ -143,6 +149,7 @@ | |||
143 | #define S3C2410_UFSTAT_RXMASK (15<<0) | 149 | #define S3C2410_UFSTAT_RXMASK (15<<0) |
144 | #define S3C2410_UFSTAT_RXSHIFT (0) | 150 | #define S3C2410_UFSTAT_RXSHIFT (0) |
145 | 151 | ||
152 | /* UFSTAT S3C2443 same as S3C2440 */ | ||
146 | #define S3C2440_UFSTAT_TXFULL (1<<14) | 153 | #define S3C2440_UFSTAT_TXFULL (1<<14) |
147 | #define S3C2440_UFSTAT_RXFULL (1<<6) | 154 | #define S3C2440_UFSTAT_RXFULL (1<<6) |
148 | #define S3C2440_UFSTAT_TXSHIFT (8) | 155 | #define S3C2440_UFSTAT_TXSHIFT (8) |
@@ -157,6 +164,8 @@ | |||
157 | #define S3C2410_UERSTAT_OVERRUN (1<<0) | 164 | #define S3C2410_UERSTAT_OVERRUN (1<<0) |
158 | #define S3C2410_UERSTAT_FRAME (1<<2) | 165 | #define S3C2410_UERSTAT_FRAME (1<<2) |
159 | #define S3C2410_UERSTAT_BREAK (1<<3) | 166 | #define S3C2410_UERSTAT_BREAK (1<<3) |
167 | #define S3C2443_UERSTAT_PARITY (1<<1) | ||
168 | |||
160 | #define S3C2410_UERSTAT_ANY (S3C2410_UERSTAT_OVERRUN | \ | 169 | #define S3C2410_UERSTAT_ANY (S3C2410_UERSTAT_OVERRUN | \ |
161 | S3C2410_UERSTAT_FRAME | \ | 170 | S3C2410_UERSTAT_FRAME | \ |
162 | S3C2410_UERSTAT_BREAK) | 171 | S3C2410_UERSTAT_BREAK) |
@@ -164,6 +173,8 @@ | |||
164 | #define S3C2410_UMSTAT_CTS (1<<0) | 173 | #define S3C2410_UMSTAT_CTS (1<<0) |
165 | #define S3C2410_UMSTAT_DeltaCTS (1<<2) | 174 | #define S3C2410_UMSTAT_DeltaCTS (1<<2) |
166 | 175 | ||
176 | #define S3C2443_DIVSLOT (0x2C) | ||
177 | |||
167 | #ifndef __ASSEMBLY__ | 178 | #ifndef __ASSEMBLY__ |
168 | 179 | ||
169 | /* struct s3c24xx_uart_clksrc | 180 | /* struct s3c24xx_uart_clksrc |
diff --git a/include/asm-arm/arch-s3c2410/reset.h b/include/asm-arm/arch-s3c2410/reset.h new file mode 100644 index 000000000000..4f866cdecab0 --- /dev/null +++ b/include/asm-arm/arch-s3c2410/reset.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* linux/include/asm-arm/arch-s3c2410/reset.h | ||
2 | * | ||
3 | * Copyright (c) 2007 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * http://armlinux.simtec.co.uk/ | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * S3C2410 CPU reset controls | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_RESET_H | ||
15 | #define __ASM_ARCH_RESET_H __FILE__ | ||
16 | |||
17 | /* This allows the over-ride of the default reset code | ||
18 | */ | ||
19 | |||
20 | extern void (*s3c24xx_reset_hook)(void); | ||
21 | |||
22 | #endif /* __ASM_ARCH_RESET_H */ | ||
diff --git a/include/asm-arm/arch-s3c2410/system.h b/include/asm-arm/arch-s3c2410/system.h index ecf250db45fb..1c74ef17da33 100644 --- a/include/asm-arm/arch-s3c2410/system.h +++ b/include/asm-arm/arch-s3c2410/system.h | |||
@@ -15,15 +15,16 @@ | |||
15 | 15 | ||
16 | #include <asm/arch/map.h> | 16 | #include <asm/arch/map.h> |
17 | #include <asm/arch/idle.h> | 17 | #include <asm/arch/idle.h> |
18 | #include <asm/arch/reset.h> | ||
18 | 19 | ||
19 | #include <asm/arch/regs-watchdog.h> | 20 | #include <asm/arch/regs-watchdog.h> |
20 | #include <asm/arch/regs-clock.h> | 21 | #include <asm/arch/regs-clock.h> |
21 | 22 | ||
22 | void (*s3c24xx_idle)(void); | 23 | void (*s3c24xx_idle)(void); |
24 | void (*s3c24xx_reset_hook)(void); | ||
23 | 25 | ||
24 | void s3c24xx_default_idle(void) | 26 | void s3c24xx_default_idle(void) |
25 | { | 27 | { |
26 | void __iomem *reg = S3C2410_CLKCON; | ||
27 | unsigned long tmp; | 28 | unsigned long tmp; |
28 | int i; | 29 | int i; |
29 | 30 | ||
@@ -33,16 +34,18 @@ void s3c24xx_default_idle(void) | |||
33 | 34 | ||
34 | /* Warning: going into idle state upsets jtag scanning */ | 35 | /* Warning: going into idle state upsets jtag scanning */ |
35 | 36 | ||
36 | __raw_writel(__raw_readl(reg) | (1<<2), reg); | 37 | __raw_writel(__raw_readl(S3C2410_CLKCON) | S3C2410_CLKCON_IDLE, |
38 | S3C2410_CLKCON); | ||
37 | 39 | ||
38 | /* the samsung port seems to do a loop and then unset idle.. */ | 40 | /* the samsung port seems to do a loop and then unset idle.. */ |
39 | for (i = 0; i < 50; i++) { | 41 | for (i = 0; i < 50; i++) { |
40 | tmp += __raw_readl(reg); /* ensure loop not optimised out */ | 42 | tmp += __raw_readl(S3C2410_CLKCON); /* ensure loop not optimised out */ |
41 | } | 43 | } |
42 | 44 | ||
43 | /* this bit is not cleared on re-start... */ | 45 | /* this bit is not cleared on re-start... */ |
44 | 46 | ||
45 | __raw_writel(__raw_readl(reg) & ~(1<<2), reg); | 47 | __raw_writel(__raw_readl(S3C2410_CLKCON) & ~S3C2410_CLKCON_IDLE, |
48 | S3C2410_CLKCON); | ||
46 | } | 49 | } |
47 | 50 | ||
48 | static void arch_idle(void) | 51 | static void arch_idle(void) |
@@ -53,7 +56,6 @@ static void arch_idle(void) | |||
53 | s3c24xx_default_idle(); | 56 | s3c24xx_default_idle(); |
54 | } | 57 | } |
55 | 58 | ||
56 | |||
57 | static void | 59 | static void |
58 | arch_reset(char mode) | 60 | arch_reset(char mode) |
59 | { | 61 | { |
@@ -61,6 +63,9 @@ arch_reset(char mode) | |||
61 | cpu_reset(0); | 63 | cpu_reset(0); |
62 | } | 64 | } |
63 | 65 | ||
66 | if (s3c24xx_reset_hook) | ||
67 | s3c24xx_reset_hook(); | ||
68 | |||
64 | printk("arch_reset: attempting watchdog reset\n"); | 69 | printk("arch_reset: attempting watchdog reset\n"); |
65 | 70 | ||
66 | __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */ | 71 | __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */ |
diff --git a/include/asm-arm/arch-s3c2410/udc.h b/include/asm-arm/arch-s3c2410/udc.h new file mode 100644 index 000000000000..e59ec339d614 --- /dev/null +++ b/include/asm-arm/arch-s3c2410/udc.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* linux/include/asm/arch-s3c2410/udc.h | ||
2 | * | ||
3 | * Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org> | ||
4 | * | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * | ||
11 | * Changelog: | ||
12 | * 14-Mar-2005 RTP Created file | ||
13 | * 02-Aug-2005 RTP File rename | ||
14 | * 07-Sep-2005 BJD Minor cleanups, changed cmd to enum | ||
15 | * 18-Jan-2007 HMW Add per-platform vbus_draw function | ||
16 | */ | ||
17 | |||
18 | #ifndef __ASM_ARM_ARCH_UDC_H | ||
19 | #define __ASM_ARM_ARCH_UDC_H | ||
20 | |||
21 | enum s3c2410_udc_cmd_e { | ||
22 | S3C2410_UDC_P_ENABLE = 1, /* Pull-up enable */ | ||
23 | S3C2410_UDC_P_DISABLE = 2, /* Pull-up disable */ | ||
24 | S3C2410_UDC_P_RESET = 3, /* UDC reset, in case of */ | ||
25 | }; | ||
26 | |||
27 | struct s3c2410_udc_mach_info { | ||
28 | void (*udc_command)(enum s3c2410_udc_cmd_e); | ||
29 | void (*vbus_draw)(unsigned int ma); | ||
30 | unsigned int vbus_pin; | ||
31 | unsigned char vbus_pin_inverted; | ||
32 | }; | ||
33 | |||
34 | extern void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *); | ||
35 | |||
36 | #endif /* __ASM_ARM_ARCH_UDC_H */ | ||
diff --git a/include/asm-arm/arch-sa1100/entry-macro.S b/include/asm-arm/arch-sa1100/entry-macro.S index 51fb50ce1169..028967629340 100644 --- a/include/asm-arm/arch-sa1100/entry-macro.S +++ b/include/asm-arm/arch-sa1100/entry-macro.S | |||
@@ -11,6 +11,12 @@ | |||
11 | .macro disable_fiq | 11 | .macro disable_fiq |
12 | .endm | 12 | .endm |
13 | 13 | ||
14 | .macro get_irqnr_preamble, base, tmp | ||
15 | .endm | ||
16 | |||
17 | .macro arch_ret_to_user, tmp1, tmp2 | ||
18 | .endm | ||
19 | |||
14 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 20 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
15 | mov r4, #0xfa000000 @ ICIP = 0xfa050000 | 21 | mov r4, #0xfa000000 @ ICIP = 0xfa050000 |
16 | add r4, r4, #0x00050000 | 22 | add r4, r4, #0x00050000 |
diff --git a/include/asm-arm/arch-sa1100/gpio.h b/include/asm-arm/arch-sa1100/gpio.h index a331fe3f6e48..da7575b0e5d0 100644 --- a/include/asm-arm/arch-sa1100/gpio.h +++ b/include/asm-arm/arch-sa1100/gpio.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/asm-arm/arch-pxa/gpio.h | 2 | * linux/include/asm-arm/arch-sa1100/gpio.h |
3 | * | 3 | * |
4 | * SA1100 GPIO wrappers for arch-neutral GPIO calls | 4 | * SA1100 GPIO wrappers for arch-neutral GPIO calls |
5 | * | 5 | * |
@@ -24,11 +24,8 @@ | |||
24 | #ifndef __ASM_ARCH_SA1100_GPIO_H | 24 | #ifndef __ASM_ARCH_SA1100_GPIO_H |
25 | #define __ASM_ARCH_SA1100_GPIO_H | 25 | #define __ASM_ARCH_SA1100_GPIO_H |
26 | 26 | ||
27 | #include <asm/arch/SA-1100.h> | 27 | #include <asm/hardware.h> |
28 | #include <asm/arch/irqs.h> | 28 | #include <asm/irq.h> |
29 | #include <asm/arch/hardware.h> | ||
30 | |||
31 | #include <asm/errno.h> | ||
32 | 29 | ||
33 | static inline int gpio_request(unsigned gpio, const char *label) | 30 | static inline int gpio_request(unsigned gpio, const char *label) |
34 | { | 31 | { |
@@ -40,26 +37,23 @@ static inline void gpio_free(unsigned gpio) | |||
40 | return; | 37 | return; |
41 | } | 38 | } |
42 | 39 | ||
43 | static inline int gpio_direction_input(unsigned gpio) | 40 | extern int gpio_direction_input(unsigned gpio); |
41 | extern int gpio_direction_output(unsigned gpio); | ||
42 | |||
43 | |||
44 | static inline int gpio_get_value(unsigned gpio) | ||
44 | { | 45 | { |
45 | if (gpio > GPIO_MAX) | 46 | return GPLR & GPIO_GPIO(gpio); |
46 | return -EINVAL; | ||
47 | GPDR = (GPDR_In << gpio) 0 | ||
48 | } | 47 | } |
49 | 48 | ||
50 | static inline int gpio_direction_output(unsigned gpio) | 49 | static inline void gpio_set_value(unsigned gpio, int value) |
51 | { | 50 | { |
52 | if (gpio > GPIO_MAX) | 51 | if (value) |
53 | return -EINVAL; | 52 | GPSR = GPIO_GPIO(gpio); |
54 | GPDR = (GPDR_Out << gpio) 0 | 53 | else |
54 | GPCR = GPIO_GPIO(gpio); | ||
55 | } | 55 | } |
56 | 56 | ||
57 | #define gpio_get_value(gpio) \ | ||
58 | (GPLR & GPIO_GPIO(gpio)) | ||
59 | |||
60 | #define gpio_set_value(gpio,value) \ | ||
61 | ((value) ? (GPSR = GPIO_GPIO(gpio)) : (GPCR(gpio) = GPIO_GPIO(gpio))) | ||
62 | |||
63 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | 57 | #include <asm-generic/gpio.h> /* cansleep wrappers */ |
64 | 58 | ||
65 | static inline unsigned gpio_to_irq(unsigned gpio) | 59 | static inline unsigned gpio_to_irq(unsigned gpio) |
diff --git a/include/asm-arm/arch-shark/entry-macro.S b/include/asm-arm/arch-shark/entry-macro.S index a924f27fb8d9..82463f30f3df 100644 --- a/include/asm-arm/arch-shark/entry-macro.S +++ b/include/asm-arm/arch-shark/entry-macro.S | |||
@@ -10,6 +10,12 @@ | |||
10 | .macro disable_fiq | 10 | .macro disable_fiq |
11 | .endm | 11 | .endm |
12 | 12 | ||
13 | .macro get_irqnr_preamble, base, tmp | ||
14 | .endm | ||
15 | |||
16 | .macro arch_ret_to_user, tmp1, tmp2 | ||
17 | .endm | ||
18 | |||
13 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 19 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
14 | mov r4, #0xe0000000 | 20 | mov r4, #0xe0000000 |
15 | 21 | ||
diff --git a/include/asm-arm/arch-versatile/entry-macro.S b/include/asm-arm/arch-versatile/entry-macro.S index feff771c0a0a..0fae002637a0 100644 --- a/include/asm-arm/arch-versatile/entry-macro.S +++ b/include/asm-arm/arch-versatile/entry-macro.S | |||
@@ -13,6 +13,12 @@ | |||
13 | .macro disable_fiq | 13 | .macro disable_fiq |
14 | .endm | 14 | .endm |
15 | 15 | ||
16 | .macro get_irqnr_preamble, base, tmp | ||
17 | .endm | ||
18 | |||
19 | .macro arch_ret_to_user, tmp1, tmp2 | ||
20 | .endm | ||
21 | |||
16 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 22 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
17 | ldr \base, =IO_ADDRESS(VERSATILE_VIC_BASE) | 23 | ldr \base, =IO_ADDRESS(VERSATILE_VIC_BASE) |
18 | ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status | 24 | ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status |
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h index 5f531ea03059..afad32c76e6c 100644 --- a/include/asm-arm/cacheflush.h +++ b/include/asm-arm/cacheflush.h | |||
@@ -185,9 +185,15 @@ struct cpu_cache_fns { | |||
185 | void (*coherent_user_range)(unsigned long, unsigned long); | 185 | void (*coherent_user_range)(unsigned long, unsigned long); |
186 | void (*flush_kern_dcache_page)(void *); | 186 | void (*flush_kern_dcache_page)(void *); |
187 | 187 | ||
188 | void (*dma_inv_range)(unsigned long, unsigned long); | 188 | void (*dma_inv_range)(const void *, const void *); |
189 | void (*dma_clean_range)(unsigned long, unsigned long); | 189 | void (*dma_clean_range)(const void *, const void *); |
190 | void (*dma_flush_range)(unsigned long, unsigned long); | 190 | void (*dma_flush_range)(const void *, const void *); |
191 | }; | ||
192 | |||
193 | struct outer_cache_fns { | ||
194 | void (*inv_range)(unsigned long, unsigned long); | ||
195 | void (*clean_range)(unsigned long, unsigned long); | ||
196 | void (*flush_range)(unsigned long, unsigned long); | ||
191 | }; | 197 | }; |
192 | 198 | ||
193 | /* | 199 | /* |
@@ -240,9 +246,40 @@ extern void __cpuc_flush_dcache_page(void *); | |||
240 | #define dmac_clean_range __glue(_CACHE,_dma_clean_range) | 246 | #define dmac_clean_range __glue(_CACHE,_dma_clean_range) |
241 | #define dmac_flush_range __glue(_CACHE,_dma_flush_range) | 247 | #define dmac_flush_range __glue(_CACHE,_dma_flush_range) |
242 | 248 | ||
243 | extern void dmac_inv_range(unsigned long, unsigned long); | 249 | extern void dmac_inv_range(const void *, const void *); |
244 | extern void dmac_clean_range(unsigned long, unsigned long); | 250 | extern void dmac_clean_range(const void *, const void *); |
245 | extern void dmac_flush_range(unsigned long, unsigned long); | 251 | extern void dmac_flush_range(const void *, const void *); |
252 | |||
253 | #endif | ||
254 | |||
255 | #ifdef CONFIG_OUTER_CACHE | ||
256 | |||
257 | extern struct outer_cache_fns outer_cache; | ||
258 | |||
259 | static inline void outer_inv_range(unsigned long start, unsigned long end) | ||
260 | { | ||
261 | if (outer_cache.inv_range) | ||
262 | outer_cache.inv_range(start, end); | ||
263 | } | ||
264 | static inline void outer_clean_range(unsigned long start, unsigned long end) | ||
265 | { | ||
266 | if (outer_cache.clean_range) | ||
267 | outer_cache.clean_range(start, end); | ||
268 | } | ||
269 | static inline void outer_flush_range(unsigned long start, unsigned long end) | ||
270 | { | ||
271 | if (outer_cache.flush_range) | ||
272 | outer_cache.flush_range(start, end); | ||
273 | } | ||
274 | |||
275 | #else | ||
276 | |||
277 | static inline void outer_inv_range(unsigned long start, unsigned long end) | ||
278 | { } | ||
279 | static inline void outer_clean_range(unsigned long start, unsigned long end) | ||
280 | { } | ||
281 | static inline void outer_flush_range(unsigned long start, unsigned long end) | ||
282 | { } | ||
246 | 283 | ||
247 | #endif | 284 | #endif |
248 | 285 | ||
diff --git a/include/asm-arm/checksum.h b/include/asm-arm/checksum.h index 8c0bb5bb14ee..eaa0efd8d0d4 100644 --- a/include/asm-arm/checksum.h +++ b/include/asm-arm/checksum.h | |||
@@ -40,13 +40,27 @@ __wsum | |||
40 | csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr); | 40 | csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr); |
41 | 41 | ||
42 | /* | 42 | /* |
43 | * Fold a partial checksum without adding pseudo headers | ||
44 | */ | ||
45 | static inline __sum16 csum_fold(__wsum sum) | ||
46 | { | ||
47 | __asm__( | ||
48 | "add %0, %1, %1, ror #16 @ csum_fold" | ||
49 | : "=r" (sum) | ||
50 | : "r" (sum) | ||
51 | : "cc"); | ||
52 | return (__force __sum16)(~(__force u32)sum >> 16); | ||
53 | } | ||
54 | |||
55 | /* | ||
43 | * This is a version of ip_compute_csum() optimized for IP headers, | 56 | * This is a version of ip_compute_csum() optimized for IP headers, |
44 | * which always checksum on 4 octet boundaries. | 57 | * which always checksum on 4 octet boundaries. |
45 | */ | 58 | */ |
46 | static inline __sum16 | 59 | static inline __sum16 |
47 | ip_fast_csum(const void *iph, unsigned int ihl) | 60 | ip_fast_csum(const void *iph, unsigned int ihl) |
48 | { | 61 | { |
49 | unsigned int sum, tmp1; | 62 | unsigned int tmp1; |
63 | __wsum sum; | ||
50 | 64 | ||
51 | __asm__ __volatile__( | 65 | __asm__ __volatile__( |
52 | "ldr %0, [%1], #4 @ ip_fast_csum \n\ | 66 | "ldr %0, [%1], #4 @ ip_fast_csum \n\ |
@@ -62,29 +76,11 @@ ip_fast_csum(const void *iph, unsigned int ihl) | |||
62 | subne %2, %2, #1 @ without destroying \n\ | 76 | subne %2, %2, #1 @ without destroying \n\ |
63 | bne 1b @ the carry flag \n\ | 77 | bne 1b @ the carry flag \n\ |
64 | adcs %0, %0, %3 \n\ | 78 | adcs %0, %0, %3 \n\ |
65 | adc %0, %0, #0 \n\ | 79 | adc %0, %0, #0" |
66 | adds %0, %0, %0, lsl #16 \n\ | ||
67 | addcs %0, %0, #0x10000 \n\ | ||
68 | mvn %0, %0 \n\ | ||
69 | mov %0, %0, lsr #16" | ||
70 | : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1) | 80 | : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1) |
71 | : "1" (iph), "2" (ihl) | 81 | : "1" (iph), "2" (ihl) |
72 | : "cc", "memory"); | 82 | : "cc", "memory"); |
73 | return (__force __sum16)sum; | 83 | return csum_fold(sum); |
74 | } | ||
75 | |||
76 | /* | ||
77 | * Fold a partial checksum without adding pseudo headers | ||
78 | */ | ||
79 | static inline __sum16 csum_fold(__wsum sum) | ||
80 | { | ||
81 | __asm__( | ||
82 | "adds %0, %1, %1, lsl #16 @ csum_fold \n\ | ||
83 | addcs %0, %0, #0x10000" | ||
84 | : "=r" (sum) | ||
85 | : "r" (sum) | ||
86 | : "cc"); | ||
87 | return (__force __sum16)(~(__force u32)sum >> 16); | ||
88 | } | 84 | } |
89 | 85 | ||
90 | static inline __wsum | 86 | static inline __wsum |
@@ -114,23 +110,7 @@ static inline __sum16 | |||
114 | csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len, | 110 | csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len, |
115 | unsigned short proto, __wsum sum) | 111 | unsigned short proto, __wsum sum) |
116 | { | 112 | { |
117 | __asm__( | 113 | return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); |
118 | "adds %0, %1, %2 @ csum_tcpudp_magic \n\ | ||
119 | adcs %0, %0, %3 \n" | ||
120 | #ifdef __ARMEB__ | ||
121 | "adcs %0, %0, %4 \n" | ||
122 | #else | ||
123 | "adcs %0, %0, %4, lsl #8 \n" | ||
124 | #endif | ||
125 | "adcs %0, %0, %5 \n\ | ||
126 | adc %0, %0, #0 \n\ | ||
127 | adds %0, %0, %0, lsl #16 \n\ | ||
128 | addcs %0, %0, #0x10000 \n\ | ||
129 | mvn %0, %0" | ||
130 | : "=&r"(sum) | ||
131 | : "r" (sum), "r" (daddr), "r" (saddr), "r" (len), "Ir" (htons(proto)) | ||
132 | : "cc"); | ||
133 | return (__force __sum16)((__force u32)sum >> 16); | ||
134 | } | 114 | } |
135 | 115 | ||
136 | 116 | ||
diff --git a/include/asm-arm/device.h b/include/asm-arm/device.h index d8f9872b0e2d..c61642b40603 100644 --- a/include/asm-arm/device.h +++ b/include/asm-arm/device.h | |||
@@ -3,5 +3,13 @@ | |||
3 | * | 3 | * |
4 | * This file is released under the GPLv2 | 4 | * This file is released under the GPLv2 |
5 | */ | 5 | */ |
6 | #include <asm-generic/device.h> | 6 | #ifndef ASMARM_DEVICE_H |
7 | #define ASMARM_DEVICE_H | ||
7 | 8 | ||
9 | struct dev_archdata { | ||
10 | #ifdef CONFIG_DMABOUNCE | ||
11 | struct dmabounce_device_info *dmabounce; | ||
12 | #endif | ||
13 | }; | ||
14 | |||
15 | #endif | ||
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h index 9bc46b486afb..abfb75b654c7 100644 --- a/include/asm-arm/dma-mapping.h +++ b/include/asm-arm/dma-mapping.h | |||
@@ -17,7 +17,7 @@ | |||
17 | * platforms with CONFIG_DMABOUNCE. | 17 | * platforms with CONFIG_DMABOUNCE. |
18 | * Use the driver DMA support - see dma-mapping.h (dma_sync_*) | 18 | * Use the driver DMA support - see dma-mapping.h (dma_sync_*) |
19 | */ | 19 | */ |
20 | extern void consistent_sync(void *kaddr, size_t size, int rw); | 20 | extern void consistent_sync(const void *kaddr, size_t size, int rw); |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * Return whether the given device DMA address mask can be supported | 23 | * Return whether the given device DMA address mask can be supported |
@@ -61,6 +61,22 @@ static inline int dma_mapping_error(dma_addr_t dma_addr) | |||
61 | return dma_addr == ~0; | 61 | return dma_addr == ~0; |
62 | } | 62 | } |
63 | 63 | ||
64 | /* | ||
65 | * Dummy noncoherent implementation. We don't provide a dma_cache_sync | ||
66 | * function so drivers using this API are highlighted with build warnings. | ||
67 | */ | ||
68 | static inline void * | ||
69 | dma_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp) | ||
70 | { | ||
71 | return NULL; | ||
72 | } | ||
73 | |||
74 | static inline void | ||
75 | dma_free_noncoherent(struct device *dev, size_t size, void *cpu_addr, | ||
76 | dma_addr_t handle) | ||
77 | { | ||
78 | } | ||
79 | |||
64 | /** | 80 | /** |
65 | * dma_alloc_coherent - allocate consistent memory for DMA | 81 | * dma_alloc_coherent - allocate consistent memory for DMA |
66 | * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices | 82 | * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices |
diff --git a/include/asm-arm/domain.h b/include/asm-arm/domain.h index 4c2885abbe6c..3c12a7625304 100644 --- a/include/asm-arm/domain.h +++ b/include/asm-arm/domain.h | |||
@@ -57,6 +57,7 @@ | |||
57 | __asm__ __volatile__( \ | 57 | __asm__ __volatile__( \ |
58 | "mcr p15, 0, %0, c3, c0 @ set domain" \ | 58 | "mcr p15, 0, %0, c3, c0 @ set domain" \ |
59 | : : "r" (x)); \ | 59 | : : "r" (x)); \ |
60 | isb(); \ | ||
60 | } while (0) | 61 | } while (0) |
61 | 62 | ||
62 | #define modify_domain(dom,type) \ | 63 | #define modify_domain(dom,type) \ |
diff --git a/include/asm-arm/hardware/arm_scu.h b/include/asm-arm/hardware/arm_scu.h index 9903f60c84b7..7d28eb5a1758 100644 --- a/include/asm-arm/hardware/arm_scu.h +++ b/include/asm-arm/hardware/arm_scu.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef ASMARM_HARDWARE_ARM_SCU_H | 1 | #ifndef ASMARM_HARDWARE_ARM_SCU_H |
2 | #define ASMARM_HARDWARE_ARM_SCU_H | 2 | #define ASMARM_HARDWARE_ARM_SCU_H |
3 | 3 | ||
4 | #include <asm/arch/scu.h> | ||
5 | |||
4 | /* | 6 | /* |
5 | * SCU registers | 7 | * SCU registers |
6 | */ | 8 | */ |
diff --git a/include/asm-arm/hardware/cache-l2x0.h b/include/asm-arm/hardware/cache-l2x0.h new file mode 100644 index 000000000000..54029a740396 --- /dev/null +++ b/include/asm-arm/hardware/cache-l2x0.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * include/asm-arm/hardware/cache-l2x0.h | ||
3 | * | ||
4 | * Copyright (C) 2007 ARM Limited | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef __ASM_ARM_HARDWARE_L2X0_H | ||
21 | #define __ASM_ARM_HARDWARE_L2X0_H | ||
22 | |||
23 | #define L2X0_CACHE_ID 0x000 | ||
24 | #define L2X0_CACHE_TYPE 0x004 | ||
25 | #define L2X0_CTRL 0x100 | ||
26 | #define L2X0_AUX_CTRL 0x104 | ||
27 | #define L2X0_EVENT_CNT_CTRL 0x200 | ||
28 | #define L2X0_EVENT_CNT1_CFG 0x204 | ||
29 | #define L2X0_EVENT_CNT0_CFG 0x208 | ||
30 | #define L2X0_EVENT_CNT1_VAL 0x20C | ||
31 | #define L2X0_EVENT_CNT0_VAL 0x210 | ||
32 | #define L2X0_INTR_MASK 0x214 | ||
33 | #define L2X0_MASKED_INTR_STAT 0x218 | ||
34 | #define L2X0_RAW_INTR_STAT 0x21C | ||
35 | #define L2X0_INTR_CLEAR 0x220 | ||
36 | #define L2X0_CACHE_SYNC 0x730 | ||
37 | #define L2X0_INV_LINE_PA 0x770 | ||
38 | #define L2X0_INV_WAY 0x77C | ||
39 | #define L2X0_CLEAN_LINE_PA 0x7B0 | ||
40 | #define L2X0_CLEAN_LINE_IDX 0x7B8 | ||
41 | #define L2X0_CLEAN_WAY 0x7BC | ||
42 | #define L2X0_CLEAN_INV_LINE_PA 0x7F0 | ||
43 | #define L2X0_CLEAN_INV_LINE_IDX 0x7F8 | ||
44 | #define L2X0_CLEAN_INV_WAY 0x7FC | ||
45 | #define L2X0_LOCKDOWN_WAY_D 0x900 | ||
46 | #define L2X0_LOCKDOWN_WAY_I 0x904 | ||
47 | #define L2X0_TEST_OPERATION 0xF00 | ||
48 | #define L2X0_LINE_DATA 0xF10 | ||
49 | #define L2X0_LINE_TAG 0xF30 | ||
50 | #define L2X0_DEBUG_CTRL 0xF40 | ||
51 | |||
52 | #ifndef __ASSEMBLY__ | ||
53 | extern void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask); | ||
54 | #endif | ||
55 | |||
56 | #endif | ||
diff --git a/include/asm-arm/hardware/gic.h b/include/asm-arm/hardware/gic.h index 3fa5eb70f64e..966e428ad32c 100644 --- a/include/asm-arm/hardware/gic.h +++ b/include/asm-arm/hardware/gic.h | |||
@@ -33,8 +33,9 @@ | |||
33 | #define GIC_DIST_SOFTINT 0xf00 | 33 | #define GIC_DIST_SOFTINT 0xf00 |
34 | 34 | ||
35 | #ifndef __ASSEMBLY__ | 35 | #ifndef __ASSEMBLY__ |
36 | void gic_dist_init(void __iomem *base); | 36 | void gic_dist_init(unsigned int gic_nr, void __iomem *base, unsigned int irq_start); |
37 | void gic_cpu_init(void __iomem *base); | 37 | void gic_cpu_init(unsigned int gic_nr, void __iomem *base); |
38 | void gic_cascade_irq(unsigned int gic_nr, unsigned int irq); | ||
38 | void gic_raise_softirq(cpumask_t cpumask, unsigned int irq); | 39 | void gic_raise_softirq(cpumask_t cpumask, unsigned int irq); |
39 | #endif | 40 | #endif |
40 | 41 | ||
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h index 13ac8a4cd01f..15141a9caca8 100644 --- a/include/asm-arm/hardware/iop3xx.h +++ b/include/asm-arm/hardware/iop3xx.h | |||
@@ -37,6 +37,13 @@ extern void gpio_line_set(int line, int value); | |||
37 | #define IOP3XX_PERIPHERAL_PHYS_BASE 0xffffe000 | 37 | #define IOP3XX_PERIPHERAL_PHYS_BASE 0xffffe000 |
38 | #define IOP3XX_PERIPHERAL_VIRT_BASE 0xfeffe000 | 38 | #define IOP3XX_PERIPHERAL_VIRT_BASE 0xfeffe000 |
39 | #define IOP3XX_PERIPHERAL_SIZE 0x00002000 | 39 | #define IOP3XX_PERIPHERAL_SIZE 0x00002000 |
40 | #define IOP3XX_PERIPHERAL_UPPER_PA (IOP3XX_PERIPHERAL_PHYS_BASE +\ | ||
41 | IOP3XX_PERIPHERAL_SIZE - 1) | ||
42 | #define IOP3XX_PERIPHERAL_UPPER_VA (IOP3XX_PERIPHERAL_VIRT_BASE +\ | ||
43 | IOP3XX_PERIPHERAL_SIZE - 1) | ||
44 | #define IOP3XX_PMMR_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\ | ||
45 | (IOP3XX_PERIPHERAL_PHYS_BASE\ | ||
46 | - IOP3XX_PERIPHERAL_VIRT_BASE)) | ||
40 | #define IOP3XX_REG_ADDR(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + (reg)) | 47 | #define IOP3XX_REG_ADDR(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + (reg)) |
41 | 48 | ||
42 | /* Address Translation Unit */ | 49 | /* Address Translation Unit */ |
@@ -181,14 +188,10 @@ extern void gpio_line_set(int line, int value); | |||
181 | #define IOP3XX_TU_TRR1 (volatile u32 *)IOP3XX_TIMER_REG(0x0014) | 188 | #define IOP3XX_TU_TRR1 (volatile u32 *)IOP3XX_TIMER_REG(0x0014) |
182 | #define IOP3XX_TU_TISR (volatile u32 *)IOP3XX_TIMER_REG(0x0018) | 189 | #define IOP3XX_TU_TISR (volatile u32 *)IOP3XX_TIMER_REG(0x0018) |
183 | #define IOP3XX_TU_WDTCR (volatile u32 *)IOP3XX_TIMER_REG(0x001c) | 190 | #define IOP3XX_TU_WDTCR (volatile u32 *)IOP3XX_TIMER_REG(0x001c) |
184 | #define IOP3XX_TMR_TC 0x01 | 191 | #define IOP_TMR_EN 0x02 |
185 | #define IOP3XX_TMR_EN 0x02 | 192 | #define IOP_TMR_RELOAD 0x04 |
186 | #define IOP3XX_TMR_RELOAD 0x04 | 193 | #define IOP_TMR_PRIVILEGED 0x08 |
187 | #define IOP3XX_TMR_PRIVILEGED 0x09 | 194 | #define IOP_TMR_RATIO_1_1 0x00 |
188 | #define IOP3XX_TMR_RATIO_1_1 0x00 | ||
189 | #define IOP3XX_TMR_RATIO_4_1 0x10 | ||
190 | #define IOP3XX_TMR_RATIO_8_1 0x20 | ||
191 | #define IOP3XX_TMR_RATIO_16_1 0x30 | ||
192 | 195 | ||
193 | /* Application accelerator unit */ | 196 | /* Application accelerator unit */ |
194 | #define IOP3XX_AAU_ACR (volatile u32 *)IOP3XX_REG_ADDR(0x0800) | 197 | #define IOP3XX_AAU_ACR (volatile u32 *)IOP3XX_REG_ADDR(0x0800) |
@@ -258,43 +261,63 @@ extern void gpio_line_set(int line, int value); | |||
258 | #define IOP3XX_PCI_LOWER_IO_PA 0x90000000 | 261 | #define IOP3XX_PCI_LOWER_IO_PA 0x90000000 |
259 | #define IOP3XX_PCI_LOWER_IO_VA 0xfe000000 | 262 | #define IOP3XX_PCI_LOWER_IO_VA 0xfe000000 |
260 | #define IOP3XX_PCI_LOWER_IO_BA (*IOP3XX_OIOWTVR) | 263 | #define IOP3XX_PCI_LOWER_IO_BA (*IOP3XX_OIOWTVR) |
264 | #define IOP3XX_PCI_UPPER_IO_PA (IOP3XX_PCI_LOWER_IO_PA +\ | ||
265 | IOP3XX_PCI_IO_WINDOW_SIZE - 1) | ||
266 | #define IOP3XX_PCI_UPPER_IO_VA (IOP3XX_PCI_LOWER_IO_VA +\ | ||
267 | IOP3XX_PCI_IO_WINDOW_SIZE - 1) | ||
268 | #define IOP3XX_PCI_IO_PHYS_TO_VIRT(addr) (((u32) addr -\ | ||
269 | IOP3XX_PCI_LOWER_IO_PA) +\ | ||
270 | IOP3XX_PCI_LOWER_IO_VA) | ||
261 | 271 | ||
262 | 272 | ||
263 | #ifndef __ASSEMBLY__ | 273 | #ifndef __ASSEMBLY__ |
264 | void iop3xx_map_io(void); | 274 | void iop3xx_map_io(void); |
265 | void iop3xx_init_time(unsigned long); | 275 | void iop_init_cp6_handler(void); |
266 | unsigned long iop3xx_gettimeoffset(void); | 276 | void iop_init_time(unsigned long tickrate); |
277 | unsigned long iop_gettimeoffset(void); | ||
267 | 278 | ||
268 | extern struct platform_device iop3xx_i2c0_device; | 279 | static inline void write_tmr0(u32 val) |
269 | extern struct platform_device iop3xx_i2c1_device; | 280 | { |
281 | asm volatile("mcr p6, 0, %0, c0, c1, 0" : : "r" (val)); | ||
282 | } | ||
283 | |||
284 | static inline void write_tmr1(u32 val) | ||
285 | { | ||
286 | asm volatile("mcr p6, 0, %0, c1, c1, 0" : : "r" (val)); | ||
287 | } | ||
288 | |||
289 | static inline u32 read_tcr0(void) | ||
290 | { | ||
291 | u32 val; | ||
292 | asm volatile("mrc p6, 0, %0, c2, c1, 0" : "=r" (val)); | ||
293 | return val; | ||
294 | } | ||
270 | 295 | ||
271 | extern inline void iop3xx_cp6_enable(void) | 296 | static inline u32 read_tcr1(void) |
272 | { | 297 | { |
273 | u32 temp; | 298 | u32 val; |
299 | asm volatile("mrc p6, 0, %0, c3, c1, 0" : "=r" (val)); | ||
300 | return val; | ||
301 | } | ||
274 | 302 | ||
275 | asm volatile ( | 303 | static inline void write_trr0(u32 val) |
276 | "mrc p15, 0, %0, c15, c1, 0\n\t" | 304 | { |
277 | "orr %0, %0, #(1 << 6)\n\t" | 305 | asm volatile("mcr p6, 0, %0, c4, c1, 0" : : "r" (val)); |
278 | "mcr p15, 0, %0, c15, c1, 0\n\t" | ||
279 | "mrc p15, 0, %0, c15, c1, 0\n\t" | ||
280 | "mov %0, %0\n\t" | ||
281 | "sub pc, pc, #4\n\t" | ||
282 | : "=r" (temp) ); | ||
283 | } | 306 | } |
284 | 307 | ||
285 | extern inline void iop3xx_cp6_disable(void) | 308 | static inline void write_trr1(u32 val) |
286 | { | 309 | { |
287 | u32 temp; | 310 | asm volatile("mcr p6, 0, %0, c5, c1, 0" : : "r" (val)); |
311 | } | ||
288 | 312 | ||
289 | asm volatile ( | 313 | static inline void write_tisr(u32 val) |
290 | "mrc p15, 0, %0, c15, c1, 0\n\t" | 314 | { |
291 | "bic %0, %0, #(1 << 6)\n\t" | 315 | asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (val)); |
292 | "mcr p15, 0, %0, c15, c1, 0\n\t" | ||
293 | "mrc p15, 0, %0, c15, c1, 0\n\t" | ||
294 | "mov %0, %0\n\t" | ||
295 | "sub pc, pc, #4\n\t" | ||
296 | : "=r" (temp) ); | ||
297 | } | 316 | } |
317 | |||
318 | extern struct platform_device iop3xx_i2c0_device; | ||
319 | extern struct platform_device iop3xx_i2c1_device; | ||
320 | |||
298 | #endif | 321 | #endif |
299 | 322 | ||
300 | 323 | ||
diff --git a/include/asm-arm/hardware/sa1111.h b/include/asm-arm/hardware/sa1111.h index 6aa0a5b75b69..61b1d05c7df7 100644 --- a/include/asm-arm/hardware/sa1111.h +++ b/include/asm-arm/hardware/sa1111.h | |||
@@ -29,6 +29,9 @@ | |||
29 | #define _SA1111(x) ((x) + sa1111->resource.start) | 29 | #define _SA1111(x) ((x) + sa1111->resource.start) |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #define sa1111_writel(val,addr) __raw_writel(val, addr) | ||
33 | #define sa1111_readl(addr) __raw_readl(addr) | ||
34 | |||
32 | /* | 35 | /* |
33 | * 26 bits of the SA-1110 address bus are available to the SA-1111. | 36 | * 26 bits of the SA-1110 address bus are available to the SA-1111. |
34 | * Use these when feeding target addresses to the DMA engines. | 37 | * Use these when feeding target addresses to the DMA engines. |
@@ -45,14 +48,6 @@ | |||
45 | #define SA1111_SAC_DMA_MIN_XFER (0x800) | 48 | #define SA1111_SAC_DMA_MIN_XFER (0x800) |
46 | 49 | ||
47 | /* | 50 | /* |
48 | * SA1111 register definitions. | ||
49 | */ | ||
50 | #define __CCREG(x) __REGP(SA1111_VBASE + (x)) | ||
51 | |||
52 | #define sa1111_writel(val,addr) __raw_writel(val, addr) | ||
53 | #define sa1111_readl(addr) __raw_readl(addr) | ||
54 | |||
55 | /* | ||
56 | * System Bus Interface (SBI) | 51 | * System Bus Interface (SBI) |
57 | * | 52 | * |
58 | * Registers | 53 | * Registers |
@@ -194,55 +189,37 @@ | |||
194 | * SADR Serial Audio Data Register (16 x 32-bit) | 189 | * SADR Serial Audio Data Register (16 x 32-bit) |
195 | */ | 190 | */ |
196 | 191 | ||
197 | #define _SACR0 _SA1111( 0x0600 ) | 192 | #define SA1111_SERAUDIO 0x0600 |
198 | #define _SACR1 _SA1111( 0x0604 ) | 193 | |
199 | #define _SACR2 _SA1111( 0x0608 ) | 194 | /* |
200 | #define _SASR0 _SA1111( 0x060c ) | 195 | * These are offsets from the above base. |
201 | #define _SASR1 _SA1111( 0x0610 ) | 196 | */ |
202 | #define _SASCR _SA1111( 0x0618 ) | 197 | #define SA1111_SACR0 0x00 |
203 | #define _L3_CAR _SA1111( 0x061c ) | 198 | #define SA1111_SACR1 0x04 |
204 | #define _L3_CDR _SA1111( 0x0620 ) | 199 | #define SA1111_SACR2 0x08 |
205 | #define _ACCAR _SA1111( 0x0624 ) | 200 | #define SA1111_SASR0 0x0c |
206 | #define _ACCDR _SA1111( 0x0628 ) | 201 | #define SA1111_SASR1 0x10 |
207 | #define _ACSAR _SA1111( 0x062c ) | 202 | #define SA1111_SASCR 0x18 |
208 | #define _ACSDR _SA1111( 0x0630 ) | 203 | #define SA1111_L3_CAR 0x1c |
209 | #define _SADTCS _SA1111( 0x0634 ) | 204 | #define SA1111_L3_CDR 0x20 |
210 | #define _SADTSA _SA1111( 0x0638 ) | 205 | #define SA1111_ACCAR 0x24 |
211 | #define _SADTCA _SA1111( 0x063c ) | 206 | #define SA1111_ACCDR 0x28 |
212 | #define _SADTSB _SA1111( 0x0640 ) | 207 | #define SA1111_ACSAR 0x2c |
213 | #define _SADTCB _SA1111( 0x0644 ) | 208 | #define SA1111_ACSDR 0x30 |
214 | #define _SADRCS _SA1111( 0x0648 ) | 209 | #define SA1111_SADTCS 0x34 |
215 | #define _SADRSA _SA1111( 0x064c ) | 210 | #define SA1111_SADTSA 0x38 |
216 | #define _SADRCA _SA1111( 0x0650 ) | 211 | #define SA1111_SADTCA 0x3c |
217 | #define _SADRSB _SA1111( 0x0654 ) | 212 | #define SA1111_SADTSB 0x40 |
218 | #define _SADRCB _SA1111( 0x0658 ) | 213 | #define SA1111_SADTCB 0x44 |
219 | #define _SAITR _SA1111( 0x065c ) | 214 | #define SA1111_SADRCS 0x48 |
220 | #define _SADR _SA1111( 0x0680 ) | 215 | #define SA1111_SADRSA 0x4c |
221 | 216 | #define SA1111_SADRCA 0x50 | |
222 | #define SACR0 __CCREG(0x0600) | 217 | #define SA1111_SADRSB 0x54 |
223 | #define SACR1 __CCREG(0x0604) | 218 | #define SA1111_SADRCB 0x58 |
224 | #define SACR2 __CCREG(0x0608) | 219 | #define SA1111_SAITR 0x5c |
225 | #define SASR0 __CCREG(0x060c) | 220 | #define SA1111_SADR 0x80 |
226 | #define SASR1 __CCREG(0x0610) | 221 | |
227 | #define SASCR __CCREG(0x0618) | 222 | #ifndef CONFIG_ARCH_PXA |
228 | #define L3_CAR __CCREG(0x061c) | ||
229 | #define L3_CDR __CCREG(0x0620) | ||
230 | #define ACCAR __CCREG(0x0624) | ||
231 | #define ACCDR __CCREG(0x0628) | ||
232 | #define ACSAR __CCREG(0x062c) | ||
233 | #define ACSDR __CCREG(0x0630) | ||
234 | #define SADTCS __CCREG(0x0634) | ||
235 | #define SADTSA __CCREG(0x0638) | ||
236 | #define SADTCA __CCREG(0x063c) | ||
237 | #define SADTSB __CCREG(0x0640) | ||
238 | #define SADTCB __CCREG(0x0644) | ||
239 | #define SADRCS __CCREG(0x0648) | ||
240 | #define SADRSA __CCREG(0x064c) | ||
241 | #define SADRCA __CCREG(0x0650) | ||
242 | #define SADRSB __CCREG(0x0654) | ||
243 | #define SADRCB __CCREG(0x0658) | ||
244 | #define SAITR __CCREG(0x065c) | ||
245 | #define SADR __CCREG(0x0680) | ||
246 | 223 | ||
247 | #define SACR0_ENB (1<<0) | 224 | #define SACR0_ENB (1<<0) |
248 | #define SACR0_BCKD (1<<2) | 225 | #define SACR0_BCKD (1<<2) |
@@ -330,6 +307,8 @@ | |||
330 | #define SAITR_RDBDA (1<<10) | 307 | #define SAITR_RDBDA (1<<10) |
331 | #define SAITR_RDBDB (1<<11) | 308 | #define SAITR_RDBDB (1<<11) |
332 | 309 | ||
310 | #endif /* !CONFIG_ARCH_PXA */ | ||
311 | |||
333 | /* | 312 | /* |
334 | * General-Purpose I/O Interface | 313 | * General-Purpose I/O Interface |
335 | * | 314 | * |
diff --git a/include/asm-arm/kexec.h b/include/asm-arm/kexec.h new file mode 100644 index 000000000000..8c1c6162a80c --- /dev/null +++ b/include/asm-arm/kexec.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef _ARM_KEXEC_H | ||
2 | #define _ARM_KEXEC_H | ||
3 | |||
4 | #ifdef CONFIG_KEXEC | ||
5 | |||
6 | /* Maximum physical address we can use pages from */ | ||
7 | #define KEXEC_SOURCE_MEMORY_LIMIT (-1UL) | ||
8 | /* Maximum address we can reach in physical address mode */ | ||
9 | #define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL) | ||
10 | /* Maximum address we can use for the control code buffer */ | ||
11 | #define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE | ||
12 | |||
13 | #define KEXEC_CONTROL_CODE_SIZE 4096 | ||
14 | |||
15 | #define KEXEC_ARCH KEXEC_ARCH_ARM | ||
16 | |||
17 | #ifndef __ASSEMBLY__ | ||
18 | |||
19 | #define MAX_NOTE_BYTES 1024 | ||
20 | |||
21 | struct kimage; | ||
22 | /* Provide a dummy definition to avoid build failures. */ | ||
23 | static inline void crash_setup_regs(struct pt_regs *newregs, | ||
24 | struct pt_regs *oldregs) { } | ||
25 | |||
26 | #endif /* __ASSEMBLY__ */ | ||
27 | |||
28 | #endif /* CONFIG_KEXEC */ | ||
29 | |||
30 | #endif /* _ARM_KEXEC_H */ | ||
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index b8cf2d5ec304..7b2bafce21a2 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h | |||
@@ -175,19 +175,29 @@ extern void __pgd_error(const char *file, int line, unsigned long val); | |||
175 | #ifndef __ASSEMBLY__ | 175 | #ifndef __ASSEMBLY__ |
176 | 176 | ||
177 | /* | 177 | /* |
178 | * The following macros handle the cache and bufferable bits... | 178 | * The pgprot_* and protection_map entries will be fixed up in runtime |
179 | * to include the cachable and bufferable bits based on memory policy, | ||
180 | * as well as any architecture dependent bits like global/ASID and SMP | ||
181 | * shared mapping bits. | ||
179 | */ | 182 | */ |
180 | #define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_CACHEABLE | L_PTE_BUFFERABLE | 183 | #define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_CACHEABLE | L_PTE_BUFFERABLE |
181 | #define _L_PTE_READ L_PTE_USER | L_PTE_EXEC | 184 | #define _L_PTE_READ L_PTE_USER | L_PTE_EXEC |
182 | 185 | ||
186 | extern pgprot_t pgprot_user; | ||
183 | extern pgprot_t pgprot_kernel; | 187 | extern pgprot_t pgprot_kernel; |
184 | 188 | ||
185 | #define PAGE_NONE __pgprot(_L_PTE_DEFAULT) | 189 | #define PAGE_NONE pgprot_user |
186 | #define PAGE_COPY __pgprot(_L_PTE_DEFAULT | _L_PTE_READ) | 190 | #define PAGE_COPY __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ) |
187 | #define PAGE_SHARED __pgprot(_L_PTE_DEFAULT | _L_PTE_READ | L_PTE_WRITE) | 191 | #define PAGE_SHARED __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ | \ |
188 | #define PAGE_READONLY __pgprot(_L_PTE_DEFAULT | _L_PTE_READ) | 192 | L_PTE_WRITE) |
193 | #define PAGE_READONLY __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ) | ||
189 | #define PAGE_KERNEL pgprot_kernel | 194 | #define PAGE_KERNEL pgprot_kernel |
190 | 195 | ||
196 | #define __PAGE_NONE __pgprot(_L_PTE_DEFAULT) | ||
197 | #define __PAGE_COPY __pgprot(_L_PTE_DEFAULT | _L_PTE_READ) | ||
198 | #define __PAGE_SHARED __pgprot(_L_PTE_DEFAULT | _L_PTE_READ | L_PTE_WRITE) | ||
199 | #define __PAGE_READONLY __pgprot(_L_PTE_DEFAULT | _L_PTE_READ) | ||
200 | |||
191 | #endif /* __ASSEMBLY__ */ | 201 | #endif /* __ASSEMBLY__ */ |
192 | 202 | ||
193 | /* | 203 | /* |
@@ -198,23 +208,23 @@ extern pgprot_t pgprot_kernel; | |||
198 | * 2) If we could do execute protection, then read is implied | 208 | * 2) If we could do execute protection, then read is implied |
199 | * 3) write implies read permissions | 209 | * 3) write implies read permissions |
200 | */ | 210 | */ |
201 | #define __P000 PAGE_NONE | 211 | #define __P000 __PAGE_NONE |
202 | #define __P001 PAGE_READONLY | 212 | #define __P001 __PAGE_READONLY |
203 | #define __P010 PAGE_COPY | 213 | #define __P010 __PAGE_COPY |
204 | #define __P011 PAGE_COPY | 214 | #define __P011 __PAGE_COPY |
205 | #define __P100 PAGE_READONLY | 215 | #define __P100 __PAGE_READONLY |
206 | #define __P101 PAGE_READONLY | 216 | #define __P101 __PAGE_READONLY |
207 | #define __P110 PAGE_COPY | 217 | #define __P110 __PAGE_COPY |
208 | #define __P111 PAGE_COPY | 218 | #define __P111 __PAGE_COPY |
209 | 219 | ||
210 | #define __S000 PAGE_NONE | 220 | #define __S000 __PAGE_NONE |
211 | #define __S001 PAGE_READONLY | 221 | #define __S001 __PAGE_READONLY |
212 | #define __S010 PAGE_SHARED | 222 | #define __S010 __PAGE_SHARED |
213 | #define __S011 PAGE_SHARED | 223 | #define __S011 __PAGE_SHARED |
214 | #define __S100 PAGE_READONLY | 224 | #define __S100 __PAGE_READONLY |
215 | #define __S101 PAGE_READONLY | 225 | #define __S101 __PAGE_READONLY |
216 | #define __S110 PAGE_SHARED | 226 | #define __S110 __PAGE_SHARED |
217 | #define __S111 PAGE_SHARED | 227 | #define __S111 __PAGE_SHARED |
218 | 228 | ||
219 | #ifndef __ASSEMBLY__ | 229 | #ifndef __ASSEMBLY__ |
220 | /* | 230 | /* |
diff --git a/include/asm-arm/plat-s3c24xx/clock.h b/include/asm-arm/plat-s3c24xx/clock.h new file mode 100644 index 000000000000..f6135dbb9fa9 --- /dev/null +++ b/include/asm-arm/plat-s3c24xx/clock.h | |||
@@ -0,0 +1,63 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/clock.h | ||
2 | * linux/arch/arm/mach-s3c2410/clock.h | ||
3 | * | ||
4 | * Copyright (c) 2004-2005 Simtec Electronics | ||
5 | * http://www.simtec.co.uk/products/SWLINUX/ | ||
6 | * Written by Ben Dooks, <ben@simtec.co.uk> | ||
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 | struct clk { | ||
14 | struct list_head list; | ||
15 | struct module *owner; | ||
16 | struct clk *parent; | ||
17 | const char *name; | ||
18 | int id; | ||
19 | int usage; | ||
20 | unsigned long rate; | ||
21 | unsigned long ctrlbit; | ||
22 | |||
23 | int (*enable)(struct clk *, int enable); | ||
24 | int (*set_rate)(struct clk *c, unsigned long rate); | ||
25 | unsigned long (*get_rate)(struct clk *c); | ||
26 | unsigned long (*round_rate)(struct clk *c, unsigned long rate); | ||
27 | int (*set_parent)(struct clk *c, struct clk *parent); | ||
28 | }; | ||
29 | |||
30 | /* other clocks which may be registered by board support */ | ||
31 | |||
32 | extern struct clk s3c24xx_dclk0; | ||
33 | extern struct clk s3c24xx_dclk1; | ||
34 | extern struct clk s3c24xx_clkout0; | ||
35 | extern struct clk s3c24xx_clkout1; | ||
36 | extern struct clk s3c24xx_uclk; | ||
37 | |||
38 | extern struct clk clk_usb_bus; | ||
39 | |||
40 | /* core clock support */ | ||
41 | |||
42 | extern struct clk clk_f; | ||
43 | extern struct clk clk_h; | ||
44 | extern struct clk clk_p; | ||
45 | extern struct clk clk_mpll; | ||
46 | extern struct clk clk_upll; | ||
47 | extern struct clk clk_xtal; | ||
48 | |||
49 | /* exports for arch/arm/mach-s3c2410 | ||
50 | * | ||
51 | * Please DO NOT use these outside of arch/arm/mach-s3c2410 | ||
52 | */ | ||
53 | |||
54 | extern struct mutex clocks_mutex; | ||
55 | |||
56 | extern int s3c2410_clkcon_enable(struct clk *clk, int enable); | ||
57 | |||
58 | extern int s3c24xx_register_clock(struct clk *clk); | ||
59 | |||
60 | extern int s3c24xx_setup_clocks(unsigned long xtal, | ||
61 | unsigned long fclk, | ||
62 | unsigned long hclk, | ||
63 | unsigned long pclk); | ||
diff --git a/include/asm-arm/plat-s3c24xx/common-smdk.h b/include/asm-arm/plat-s3c24xx/common-smdk.h new file mode 100644 index 000000000000..58d9094c935c --- /dev/null +++ b/include/asm-arm/plat-s3c24xx/common-smdk.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/common-smdk.h | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Common code for SMDK2410 and SMDK2440 boards | ||
7 | * | ||
8 | * http://www.fluff.org/ben/smdk2440/ | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | extern void smdk_machine_init(void); | ||
diff --git a/include/asm-arm/plat-s3c24xx/cpu.h b/include/asm-arm/plat-s3c24xx/cpu.h new file mode 100644 index 000000000000..15dd18810905 --- /dev/null +++ b/include/asm-arm/plat-s3c24xx/cpu.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/cpu.h | ||
2 | * | ||
3 | * Copyright (c) 2004-2005 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for S3C24XX CPU support | ||
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 | /* todo - fix when rmk changes iodescs to use `void __iomem *` */ | ||
14 | |||
15 | #define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE } | ||
16 | |||
17 | #ifndef MHZ | ||
18 | #define MHZ (1000*1000) | ||
19 | #endif | ||
20 | |||
21 | #define print_mhz(m) ((m) / MHZ), ((m / 1000) % 1000) | ||
22 | |||
23 | /* forward declaration */ | ||
24 | struct s3c24xx_uart_resources; | ||
25 | struct platform_device; | ||
26 | struct s3c2410_uartcfg; | ||
27 | struct map_desc; | ||
28 | |||
29 | /* core initialisation functions */ | ||
30 | |||
31 | extern void s3c24xx_init_irq(void); | ||
32 | |||
33 | extern void s3c24xx_init_io(struct map_desc *mach_desc, int size); | ||
34 | |||
35 | extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
36 | |||
37 | extern void s3c24xx_init_clocks(int xtal); | ||
38 | |||
39 | extern void s3c24xx_init_uartdevs(char *name, | ||
40 | struct s3c24xx_uart_resources *res, | ||
41 | struct s3c2410_uartcfg *cfg, int no); | ||
42 | |||
43 | /* the board structure is used at first initialsation time | ||
44 | * to get info such as the devices to register for this | ||
45 | * board. This is done because platfrom_add_devices() cannot | ||
46 | * be called from the map_io entry. | ||
47 | */ | ||
48 | |||
49 | struct s3c24xx_board { | ||
50 | struct platform_device **devices; | ||
51 | unsigned int devices_count; | ||
52 | |||
53 | struct clk **clocks; | ||
54 | unsigned int clocks_count; | ||
55 | }; | ||
56 | |||
57 | extern void s3c24xx_set_board(struct s3c24xx_board *board); | ||
58 | |||
59 | /* timer for 2410/2440 */ | ||
60 | |||
61 | struct sys_timer; | ||
62 | extern struct sys_timer s3c24xx_timer; | ||
63 | |||
64 | /* system device classes */ | ||
65 | |||
66 | extern struct sysdev_class s3c2410_sysclass; | ||
67 | extern struct sysdev_class s3c2412_sysclass; | ||
68 | extern struct sysdev_class s3c2440_sysclass; | ||
69 | extern struct sysdev_class s3c2442_sysclass; | ||
70 | extern struct sysdev_class s3c2443_sysclass; | ||
diff --git a/include/asm-arm/plat-s3c24xx/devs.h b/include/asm-arm/plat-s3c24xx/devs.h new file mode 100644 index 000000000000..dddf485fc067 --- /dev/null +++ b/include/asm-arm/plat-s3c24xx/devs.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/devs.h | ||
2 | * | ||
3 | * Copyright (c) 2004 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for s3c2410 standard platform devices | ||
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 | #include <linux/platform_device.h> | ||
13 | |||
14 | struct s3c24xx_uart_resources { | ||
15 | struct resource *resources; | ||
16 | unsigned long nr_resources; | ||
17 | }; | ||
18 | |||
19 | extern struct s3c24xx_uart_resources s3c2410_uart_resources[]; | ||
20 | |||
21 | extern struct platform_device *s3c24xx_uart_devs[]; | ||
22 | extern struct platform_device *s3c24xx_uart_src[]; | ||
23 | |||
24 | extern struct platform_device s3c_device_usb; | ||
25 | extern struct platform_device s3c_device_lcd; | ||
26 | extern struct platform_device s3c_device_wdt; | ||
27 | extern struct platform_device s3c_device_i2c; | ||
28 | extern struct platform_device s3c_device_iis; | ||
29 | extern struct platform_device s3c_device_rtc; | ||
30 | extern struct platform_device s3c_device_adc; | ||
31 | extern struct platform_device s3c_device_sdi; | ||
32 | |||
33 | extern struct platform_device s3c_device_spi0; | ||
34 | extern struct platform_device s3c_device_spi1; | ||
35 | |||
36 | extern struct platform_device s3c_device_nand; | ||
37 | |||
38 | extern struct platform_device s3c_device_timer0; | ||
39 | extern struct platform_device s3c_device_timer1; | ||
40 | extern struct platform_device s3c_device_timer2; | ||
41 | extern struct platform_device s3c_device_timer3; | ||
42 | |||
43 | extern struct platform_device s3c_device_usbgadget; | ||
44 | |||
45 | /* s3c2440 specific devices */ | ||
46 | |||
47 | #ifdef CONFIG_CPU_S3C2440 | ||
48 | |||
49 | extern struct platform_device s3c_device_camif; | ||
50 | |||
51 | #endif | ||
diff --git a/include/asm-arm/plat-s3c24xx/dma.h b/include/asm-arm/plat-s3c24xx/dma.h new file mode 100644 index 000000000000..2c59406435e5 --- /dev/null +++ b/include/asm-arm/plat-s3c24xx/dma.h | |||
@@ -0,0 +1,77 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/dma.h | ||
2 | * | ||
3 | * Copyright (C) 2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Samsung S3C24XX DMA support | ||
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 | extern struct sysdev_class dma_sysclass; | ||
14 | extern struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS]; | ||
15 | |||
16 | #define DMA_CH_VALID (1<<31) | ||
17 | #define DMA_CH_NEVER (1<<30) | ||
18 | |||
19 | struct s3c24xx_dma_addr { | ||
20 | unsigned long from; | ||
21 | unsigned long to; | ||
22 | }; | ||
23 | |||
24 | /* struct s3c24xx_dma_map | ||
25 | * | ||
26 | * this holds the mapping information for the channel selected | ||
27 | * to be connected to the specified device | ||
28 | */ | ||
29 | |||
30 | struct s3c24xx_dma_map { | ||
31 | const char *name; | ||
32 | struct s3c24xx_dma_addr hw_addr; | ||
33 | |||
34 | unsigned long channels[S3C2410_DMA_CHANNELS]; | ||
35 | }; | ||
36 | |||
37 | struct s3c24xx_dma_selection { | ||
38 | struct s3c24xx_dma_map *map; | ||
39 | unsigned long map_size; | ||
40 | unsigned long dcon_mask; | ||
41 | |||
42 | void (*select)(struct s3c2410_dma_chan *chan, | ||
43 | struct s3c24xx_dma_map *map); | ||
44 | }; | ||
45 | |||
46 | extern int s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel); | ||
47 | |||
48 | /* struct s3c24xx_dma_order_ch | ||
49 | * | ||
50 | * channel map for one of the `enum dma_ch` dma channels. the list | ||
51 | * entry contains a set of low-level channel numbers, orred with | ||
52 | * DMA_CH_VALID, which are checked in the order in the array. | ||
53 | */ | ||
54 | |||
55 | struct s3c24xx_dma_order_ch { | ||
56 | unsigned int list[S3C2410_DMA_CHANNELS]; /* list of channels */ | ||
57 | unsigned int flags; /* flags */ | ||
58 | }; | ||
59 | |||
60 | /* struct s3c24xx_dma_order | ||
61 | * | ||
62 | * information provided by either the core or the board to give the | ||
63 | * dma system a hint on how to allocate channels | ||
64 | */ | ||
65 | |||
66 | struct s3c24xx_dma_order { | ||
67 | struct s3c24xx_dma_order_ch channels[DMACH_MAX]; | ||
68 | }; | ||
69 | |||
70 | extern int s3c24xx_dma_order_set(struct s3c24xx_dma_order *map); | ||
71 | |||
72 | /* DMA init code, called from the cpu support code */ | ||
73 | |||
74 | extern int s3c2410_dma_init(void); | ||
75 | |||
76 | extern int s3c24xx_dma_init(unsigned int channels, unsigned int irq, | ||
77 | unsigned int stride); | ||
diff --git a/include/asm-arm/plat-s3c24xx/irq.h b/include/asm-arm/plat-s3c24xx/irq.h new file mode 100644 index 000000000000..8af6d9579b31 --- /dev/null +++ b/include/asm-arm/plat-s3c24xx/irq.h | |||
@@ -0,0 +1,107 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/irq.h | ||
2 | * | ||
3 | * Copyright (c) 2004-2005 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for S3C24XX CPU IRQ support | ||
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 | #define irqdbf(x...) | ||
14 | #define irqdbf2(x...) | ||
15 | |||
16 | #define EXTINT_OFF (IRQ_EINT4 - 4) | ||
17 | |||
18 | extern struct irq_chip s3c_irq_level_chip; | ||
19 | |||
20 | static inline void | ||
21 | s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit, | ||
22 | int subcheck) | ||
23 | { | ||
24 | unsigned long mask; | ||
25 | unsigned long submask; | ||
26 | |||
27 | submask = __raw_readl(S3C2410_INTSUBMSK); | ||
28 | mask = __raw_readl(S3C2410_INTMSK); | ||
29 | |||
30 | submask |= (1UL << (irqno - IRQ_S3CUART_RX0)); | ||
31 | |||
32 | /* check to see if we need to mask the parent IRQ */ | ||
33 | |||
34 | if ((submask & subcheck) == subcheck) { | ||
35 | __raw_writel(mask | parentbit, S3C2410_INTMSK); | ||
36 | } | ||
37 | |||
38 | /* write back masks */ | ||
39 | __raw_writel(submask, S3C2410_INTSUBMSK); | ||
40 | |||
41 | } | ||
42 | |||
43 | static inline void | ||
44 | s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit) | ||
45 | { | ||
46 | unsigned long mask; | ||
47 | unsigned long submask; | ||
48 | |||
49 | submask = __raw_readl(S3C2410_INTSUBMSK); | ||
50 | mask = __raw_readl(S3C2410_INTMSK); | ||
51 | |||
52 | submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0)); | ||
53 | mask &= ~parentbit; | ||
54 | |||
55 | /* write back masks */ | ||
56 | __raw_writel(submask, S3C2410_INTSUBMSK); | ||
57 | __raw_writel(mask, S3C2410_INTMSK); | ||
58 | } | ||
59 | |||
60 | |||
61 | static inline void | ||
62 | s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group) | ||
63 | { | ||
64 | unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0); | ||
65 | |||
66 | s3c_irqsub_mask(irqno, parentmask, group); | ||
67 | |||
68 | __raw_writel(bit, S3C2410_SUBSRCPND); | ||
69 | |||
70 | /* only ack parent if we've got all the irqs (seems we must | ||
71 | * ack, all and hope that the irq system retriggers ok when | ||
72 | * the interrupt goes off again) | ||
73 | */ | ||
74 | |||
75 | if (1) { | ||
76 | __raw_writel(parentmask, S3C2410_SRCPND); | ||
77 | __raw_writel(parentmask, S3C2410_INTPND); | ||
78 | } | ||
79 | } | ||
80 | |||
81 | static inline void | ||
82 | s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group) | ||
83 | { | ||
84 | unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0); | ||
85 | |||
86 | __raw_writel(bit, S3C2410_SUBSRCPND); | ||
87 | |||
88 | /* only ack parent if we've got all the irqs (seems we must | ||
89 | * ack, all and hope that the irq system retriggers ok when | ||
90 | * the interrupt goes off again) | ||
91 | */ | ||
92 | |||
93 | if (1) { | ||
94 | __raw_writel(parentmask, S3C2410_SRCPND); | ||
95 | __raw_writel(parentmask, S3C2410_INTPND); | ||
96 | } | ||
97 | } | ||
98 | |||
99 | /* exported for use in arch/arm/mach-s3c2410 */ | ||
100 | |||
101 | #ifdef CONFIG_PM | ||
102 | extern int s3c_irq_wake(unsigned int irqno, unsigned int state); | ||
103 | #else | ||
104 | #define s3c_irq_wake NULL | ||
105 | #endif | ||
106 | |||
107 | extern int s3c_irqext_type(unsigned int irq, unsigned int type); | ||
diff --git a/include/asm-arm/plat-s3c24xx/pm.h b/include/asm-arm/plat-s3c24xx/pm.h new file mode 100644 index 000000000000..cc623667e48a --- /dev/null +++ b/include/asm-arm/plat-s3c24xx/pm.h | |||
@@ -0,0 +1,73 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/pm.h | ||
2 | * | ||
3 | * Copyright (c) 2004 Simtec Electronics | ||
4 | * Written by Ben Dooks, <ben@simtec.co.uk> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | /* s3c2410_pm_init | ||
12 | * | ||
13 | * called from board at initialisation time to setup the power | ||
14 | * management | ||
15 | */ | ||
16 | |||
17 | #ifdef CONFIG_PM | ||
18 | |||
19 | extern __init int s3c2410_pm_init(void); | ||
20 | |||
21 | #else | ||
22 | |||
23 | static inline int s3c2410_pm_init(void) | ||
24 | { | ||
25 | return 0; | ||
26 | } | ||
27 | #endif | ||
28 | |||
29 | /* configuration for the IRQ mask over sleep */ | ||
30 | extern unsigned long s3c_irqwake_intmask; | ||
31 | extern unsigned long s3c_irqwake_eintmask; | ||
32 | |||
33 | /* IRQ masks for IRQs allowed to go to sleep (see irq.c) */ | ||
34 | extern unsigned long s3c_irqwake_intallow; | ||
35 | extern unsigned long s3c_irqwake_eintallow; | ||
36 | |||
37 | /* per-cpu sleep functions */ | ||
38 | |||
39 | extern void (*pm_cpu_prep)(void); | ||
40 | extern void (*pm_cpu_sleep)(void); | ||
41 | |||
42 | /* Flags for PM Control */ | ||
43 | |||
44 | extern unsigned long s3c_pm_flags; | ||
45 | |||
46 | /* from sleep.S */ | ||
47 | |||
48 | extern int s3c2410_cpu_save(unsigned long *saveblk); | ||
49 | extern void s3c2410_cpu_suspend(void); | ||
50 | extern void s3c2410_cpu_resume(void); | ||
51 | |||
52 | extern unsigned long s3c2410_sleep_save_phys; | ||
53 | |||
54 | /* sleep save info */ | ||
55 | |||
56 | struct sleep_save { | ||
57 | void __iomem *reg; | ||
58 | unsigned long val; | ||
59 | }; | ||
60 | |||
61 | #define SAVE_ITEM(x) \ | ||
62 | { .reg = (x) } | ||
63 | |||
64 | extern void s3c2410_pm_do_save(struct sleep_save *ptr, int count); | ||
65 | extern void s3c2410_pm_do_restore(struct sleep_save *ptr, int count); | ||
66 | |||
67 | #ifdef CONFIG_PM | ||
68 | extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state); | ||
69 | extern int s3c24xx_irq_resume(struct sys_device *dev); | ||
70 | #else | ||
71 | #define s3c24xx_irq_suspend NULL | ||
72 | #define s3c24xx_irq_resume NULL | ||
73 | #endif | ||
diff --git a/include/asm-arm/plat-s3c24xx/s3c2400.h b/include/asm-arm/plat-s3c24xx/s3c2400.h new file mode 100644 index 000000000000..3a5a16821af8 --- /dev/null +++ b/include/asm-arm/plat-s3c24xx/s3c2400.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/s3c2400.h | ||
2 | * | ||
3 | * Copyright (c) 2004 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for S3C2400 cpu support | ||
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 | * Modifications: | ||
13 | * 09-Fev-2006 LCVR First version, based on s3c2410.h | ||
14 | */ | ||
15 | |||
16 | #ifdef CONFIG_CPU_S3C2400 | ||
17 | |||
18 | extern int s3c2400_init(void); | ||
19 | |||
20 | extern void s3c2400_map_io(struct map_desc *mach_desc, int size); | ||
21 | |||
22 | extern void s3c2400_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
23 | |||
24 | extern void s3c2400_init_clocks(int xtal); | ||
25 | |||
26 | #else | ||
27 | #define s3c2400_init_clocks NULL | ||
28 | #define s3c2400_init_uarts NULL | ||
29 | #define s3c2400_map_io NULL | ||
30 | #define s3c2400_init NULL | ||
31 | #endif | ||
diff --git a/include/asm-arm/plat-s3c24xx/s3c2410.h b/include/asm-arm/plat-s3c24xx/s3c2410.h new file mode 100644 index 000000000000..36de0b835873 --- /dev/null +++ b/include/asm-arm/plat-s3c24xx/s3c2410.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/s3c2410.h | ||
2 | * | ||
3 | * Copyright (c) 2004 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for s3c2410 machine directory | ||
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 | |||
14 | #ifdef CONFIG_CPU_S3C2410 | ||
15 | |||
16 | extern int s3c2410_init(void); | ||
17 | |||
18 | extern void s3c2410_map_io(struct map_desc *mach_desc, int size); | ||
19 | |||
20 | extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
21 | |||
22 | extern void s3c2410_init_clocks(int xtal); | ||
23 | |||
24 | extern int s3c2410_baseclk_add(void); | ||
25 | |||
26 | #else | ||
27 | #define s3c2410_init_clocks NULL | ||
28 | #define s3c2410_init_uarts NULL | ||
29 | #define s3c2410_map_io NULL | ||
30 | #define s3c2410_init NULL | ||
31 | #endif | ||
diff --git a/include/asm-arm/plat-s3c24xx/s3c2412.h b/include/asm-arm/plat-s3c24xx/s3c2412.h new file mode 100644 index 000000000000..3ec97685e781 --- /dev/null +++ b/include/asm-arm/plat-s3c24xx/s3c2412.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/s3c2412.h | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for s3c2412 cpu support | ||
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 | #ifdef CONFIG_CPU_S3C2412 | ||
14 | |||
15 | extern int s3c2412_init(void); | ||
16 | |||
17 | extern void s3c2412_map_io(struct map_desc *mach_desc, int size); | ||
18 | |||
19 | extern void s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
20 | |||
21 | extern void s3c2412_init_clocks(int xtal); | ||
22 | |||
23 | extern int s3c2412_baseclk_add(void); | ||
24 | #else | ||
25 | #define s3c2412_init_clocks NULL | ||
26 | #define s3c2412_init_uarts NULL | ||
27 | #define s3c2412_map_io NULL | ||
28 | #define s3c2412_init NULL | ||
29 | #endif | ||
diff --git a/include/asm-arm/plat-s3c24xx/s3c2440.h b/include/asm-arm/plat-s3c24xx/s3c2440.h new file mode 100644 index 000000000000..107853bf9481 --- /dev/null +++ b/include/asm-arm/plat-s3c24xx/s3c2440.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/s3c2440.h | ||
2 | * | ||
3 | * Copyright (c) 2004-2005 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for s3c2440 cpu support | ||
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 | #ifdef CONFIG_CPU_S3C2440 | ||
14 | extern int s3c2440_init(void); | ||
15 | #else | ||
16 | #define s3c2440_init NULL | ||
17 | #endif | ||
diff --git a/include/asm-arm/plat-s3c24xx/s3c2442.h b/include/asm-arm/plat-s3c24xx/s3c2442.h new file mode 100644 index 000000000000..451a23a2092a --- /dev/null +++ b/include/asm-arm/plat-s3c24xx/s3c2442.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/s3c2442.h | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for s3c2442 cpu support | ||
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 | #ifdef CONFIG_CPU_S3C2442 | ||
14 | extern int s3c2442_init(void); | ||
15 | #else | ||
16 | #define s3c2442_init NULL | ||
17 | #endif | ||
diff --git a/include/asm-arm/plat-s3c24xx/s3c2443.h b/include/asm-arm/plat-s3c24xx/s3c2443.h new file mode 100644 index 000000000000..11d83b5c84e6 --- /dev/null +++ b/include/asm-arm/plat-s3c24xx/s3c2443.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/s3c2443.h | ||
2 | * | ||
3 | * Copyright (c) 2004-2005 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for s3c2443 cpu support | ||
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 | #ifdef CONFIG_CPU_S3C2443 | ||
14 | |||
15 | struct s3c2410_uartcfg; | ||
16 | |||
17 | extern int s3c2443_init(void); | ||
18 | |||
19 | extern void s3c2443_map_io(struct map_desc *mach_desc, int size); | ||
20 | |||
21 | extern void s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
22 | |||
23 | extern void s3c2443_init_clocks(int xtal); | ||
24 | |||
25 | extern int s3c2443_baseclk_add(void); | ||
26 | |||
27 | #else | ||
28 | #define s3c2443_init_clocks NULL | ||
29 | #define s3c2443_init_uarts NULL | ||
30 | #define s3c2443_map_io NULL | ||
31 | #define s3c2443_init NULL | ||
32 | #endif | ||
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index aa223fc546af..f4386906b200 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h | |||
@@ -140,6 +140,40 @@ static inline int cpu_is_xsc3(void) | |||
140 | #define cpu_is_xscale() 1 | 140 | #define cpu_is_xscale() 1 |
141 | #endif | 141 | #endif |
142 | 142 | ||
143 | #define UDBG_UNDEFINED (1 << 0) | ||
144 | #define UDBG_SYSCALL (1 << 1) | ||
145 | #define UDBG_BADABORT (1 << 2) | ||
146 | #define UDBG_SEGV (1 << 3) | ||
147 | #define UDBG_BUS (1 << 4) | ||
148 | |||
149 | extern unsigned int user_debug; | ||
150 | |||
151 | #if __LINUX_ARM_ARCH__ >= 4 | ||
152 | #define vectors_high() (cr_alignment & CR_V) | ||
153 | #else | ||
154 | #define vectors_high() (0) | ||
155 | #endif | ||
156 | |||
157 | #if __LINUX_ARM_ARCH__ >= 6 | ||
158 | #define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \ | ||
159 | : : "r" (0) : "memory") | ||
160 | #define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \ | ||
161 | : : "r" (0) : "memory") | ||
162 | #define dmb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \ | ||
163 | : : "r" (0) : "memory") | ||
164 | #else | ||
165 | #define isb() __asm__ __volatile__ ("" : : : "memory") | ||
166 | #define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \ | ||
167 | : : "r" (0) : "memory") | ||
168 | #define dmb() __asm__ __volatile__ ("" : : : "memory") | ||
169 | #endif | ||
170 | #define mb() dmb() | ||
171 | #define rmb() mb() | ||
172 | #define wmb() mb() | ||
173 | #define read_barrier_depends() do { } while(0) | ||
174 | #define set_mb(var, value) do { var = value; mb(); } while (0) | ||
175 | #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); | ||
176 | |||
143 | extern unsigned long cr_no_alignment; /* defined in entry-armv.S */ | 177 | extern unsigned long cr_no_alignment; /* defined in entry-armv.S */ |
144 | extern unsigned long cr_alignment; /* defined in entry-armv.S */ | 178 | extern unsigned long cr_alignment; /* defined in entry-armv.S */ |
145 | 179 | ||
@@ -154,6 +188,7 @@ static inline void set_cr(unsigned int val) | |||
154 | { | 188 | { |
155 | asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR" | 189 | asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR" |
156 | : : "r" (val) : "cc"); | 190 | : : "r" (val) : "cc"); |
191 | isb(); | ||
157 | } | 192 | } |
158 | 193 | ||
159 | #ifndef CONFIG_SMP | 194 | #ifndef CONFIG_SMP |
@@ -176,34 +211,9 @@ static inline void set_copro_access(unsigned int val) | |||
176 | { | 211 | { |
177 | asm volatile("mcr p15, 0, %0, c1, c0, 2 @ set copro access" | 212 | asm volatile("mcr p15, 0, %0, c1, c0, 2 @ set copro access" |
178 | : : "r" (val) : "cc"); | 213 | : : "r" (val) : "cc"); |
214 | isb(); | ||
179 | } | 215 | } |
180 | 216 | ||
181 | #define UDBG_UNDEFINED (1 << 0) | ||
182 | #define UDBG_SYSCALL (1 << 1) | ||
183 | #define UDBG_BADABORT (1 << 2) | ||
184 | #define UDBG_SEGV (1 << 3) | ||
185 | #define UDBG_BUS (1 << 4) | ||
186 | |||
187 | extern unsigned int user_debug; | ||
188 | |||
189 | #if __LINUX_ARM_ARCH__ >= 4 | ||
190 | #define vectors_high() (cr_alignment & CR_V) | ||
191 | #else | ||
192 | #define vectors_high() (0) | ||
193 | #endif | ||
194 | |||
195 | #if __LINUX_ARM_ARCH__ >= 6 | ||
196 | #define mb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \ | ||
197 | : : "r" (0) : "memory") | ||
198 | #else | ||
199 | #define mb() __asm__ __volatile__ ("" : : : "memory") | ||
200 | #endif | ||
201 | #define rmb() mb() | ||
202 | #define wmb() mb() | ||
203 | #define read_barrier_depends() do { } while(0) | ||
204 | #define set_mb(var, value) do { var = value; mb(); } while (0) | ||
205 | #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); | ||
206 | |||
207 | /* | 217 | /* |
208 | * switch_mm() may do a full cache flush over the context switch, | 218 | * switch_mm() may do a full cache flush over the context switch, |
209 | * so enable interrupts over the context switch to avoid high | 219 | * so enable interrupts over the context switch to avoid high |
diff --git a/include/asm-arm/tlbflush.h b/include/asm-arm/tlbflush.h index cd10a0b5f8ae..08c6991dc9c9 100644 --- a/include/asm-arm/tlbflush.h +++ b/include/asm-arm/tlbflush.h | |||
@@ -247,7 +247,7 @@ static inline void local_flush_tlb_all(void) | |||
247 | const unsigned int __tlb_flag = __cpu_tlb_flags; | 247 | const unsigned int __tlb_flag = __cpu_tlb_flags; |
248 | 248 | ||
249 | if (tlb_flag(TLB_WB)) | 249 | if (tlb_flag(TLB_WB)) |
250 | asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc"); | 250 | dsb(); |
251 | 251 | ||
252 | if (tlb_flag(TLB_V3_FULL)) | 252 | if (tlb_flag(TLB_V3_FULL)) |
253 | asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc"); | 253 | asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc"); |
@@ -257,6 +257,15 @@ static inline void local_flush_tlb_all(void) | |||
257 | asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc"); | 257 | asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc"); |
258 | if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL)) | 258 | if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL)) |
259 | asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc"); | 259 | asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc"); |
260 | |||
261 | if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL | | ||
262 | TLB_V6_I_PAGE | TLB_V6_D_PAGE | | ||
263 | TLB_V6_I_ASID | TLB_V6_D_ASID)) { | ||
264 | /* flush the branch target cache */ | ||
265 | asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc"); | ||
266 | dsb(); | ||
267 | isb(); | ||
268 | } | ||
260 | } | 269 | } |
261 | 270 | ||
262 | static inline void local_flush_tlb_mm(struct mm_struct *mm) | 271 | static inline void local_flush_tlb_mm(struct mm_struct *mm) |
@@ -266,7 +275,7 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm) | |||
266 | const unsigned int __tlb_flag = __cpu_tlb_flags; | 275 | const unsigned int __tlb_flag = __cpu_tlb_flags; |
267 | 276 | ||
268 | if (tlb_flag(TLB_WB)) | 277 | if (tlb_flag(TLB_WB)) |
269 | asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc"); | 278 | dsb(); |
270 | 279 | ||
271 | if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) { | 280 | if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) { |
272 | if (tlb_flag(TLB_V3_FULL)) | 281 | if (tlb_flag(TLB_V3_FULL)) |
@@ -285,6 +294,14 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm) | |||
285 | asm("mcr p15, 0, %0, c8, c6, 2" : : "r" (asid) : "cc"); | 294 | asm("mcr p15, 0, %0, c8, c6, 2" : : "r" (asid) : "cc"); |
286 | if (tlb_flag(TLB_V6_I_ASID)) | 295 | if (tlb_flag(TLB_V6_I_ASID)) |
287 | asm("mcr p15, 0, %0, c8, c5, 2" : : "r" (asid) : "cc"); | 296 | asm("mcr p15, 0, %0, c8, c5, 2" : : "r" (asid) : "cc"); |
297 | |||
298 | if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL | | ||
299 | TLB_V6_I_PAGE | TLB_V6_D_PAGE | | ||
300 | TLB_V6_I_ASID | TLB_V6_D_ASID)) { | ||
301 | /* flush the branch target cache */ | ||
302 | asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc"); | ||
303 | dsb(); | ||
304 | } | ||
288 | } | 305 | } |
289 | 306 | ||
290 | static inline void | 307 | static inline void |
@@ -296,7 +313,7 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) | |||
296 | uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm); | 313 | uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm); |
297 | 314 | ||
298 | if (tlb_flag(TLB_WB)) | 315 | if (tlb_flag(TLB_WB)) |
299 | asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero)); | 316 | dsb(); |
300 | 317 | ||
301 | if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) { | 318 | if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) { |
302 | if (tlb_flag(TLB_V3_PAGE)) | 319 | if (tlb_flag(TLB_V3_PAGE)) |
@@ -317,6 +334,14 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) | |||
317 | asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc"); | 334 | asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc"); |
318 | if (tlb_flag(TLB_V6_I_PAGE)) | 335 | if (tlb_flag(TLB_V6_I_PAGE)) |
319 | asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc"); | 336 | asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc"); |
337 | |||
338 | if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL | | ||
339 | TLB_V6_I_PAGE | TLB_V6_D_PAGE | | ||
340 | TLB_V6_I_ASID | TLB_V6_D_ASID)) { | ||
341 | /* flush the branch target cache */ | ||
342 | asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc"); | ||
343 | dsb(); | ||
344 | } | ||
320 | } | 345 | } |
321 | 346 | ||
322 | static inline void local_flush_tlb_kernel_page(unsigned long kaddr) | 347 | static inline void local_flush_tlb_kernel_page(unsigned long kaddr) |
@@ -327,7 +352,7 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr) | |||
327 | kaddr &= PAGE_MASK; | 352 | kaddr &= PAGE_MASK; |
328 | 353 | ||
329 | if (tlb_flag(TLB_WB)) | 354 | if (tlb_flag(TLB_WB)) |
330 | asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc"); | 355 | dsb(); |
331 | 356 | ||
332 | if (tlb_flag(TLB_V3_PAGE)) | 357 | if (tlb_flag(TLB_V3_PAGE)) |
333 | asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (kaddr) : "cc"); | 358 | asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (kaddr) : "cc"); |
@@ -347,11 +372,14 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr) | |||
347 | if (tlb_flag(TLB_V6_I_PAGE)) | 372 | if (tlb_flag(TLB_V6_I_PAGE)) |
348 | asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc"); | 373 | asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc"); |
349 | 374 | ||
350 | /* The ARM ARM states that the completion of a TLB maintenance | 375 | if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL | |
351 | * operation is only guaranteed by a DSB instruction | 376 | TLB_V6_I_PAGE | TLB_V6_D_PAGE | |
352 | */ | 377 | TLB_V6_I_ASID | TLB_V6_D_ASID)) { |
353 | if (tlb_flag(TLB_V6_U_PAGE | TLB_V6_D_PAGE | TLB_V6_I_PAGE)) | 378 | /* flush the branch target cache */ |
354 | asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc"); | 379 | asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc"); |
380 | dsb(); | ||
381 | isb(); | ||
382 | } | ||
355 | } | 383 | } |
356 | 384 | ||
357 | /* | 385 | /* |
@@ -369,15 +397,13 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr) | |||
369 | */ | 397 | */ |
370 | static inline void flush_pmd_entry(pmd_t *pmd) | 398 | static inline void flush_pmd_entry(pmd_t *pmd) |
371 | { | 399 | { |
372 | const unsigned int zero = 0; | ||
373 | const unsigned int __tlb_flag = __cpu_tlb_flags; | 400 | const unsigned int __tlb_flag = __cpu_tlb_flags; |
374 | 401 | ||
375 | if (tlb_flag(TLB_DCLEAN)) | 402 | if (tlb_flag(TLB_DCLEAN)) |
376 | asm("mcr p15, 0, %0, c7, c10, 1 @ flush_pmd" | 403 | asm("mcr p15, 0, %0, c7, c10, 1 @ flush_pmd" |
377 | : : "r" (pmd) : "cc"); | 404 | : : "r" (pmd) : "cc"); |
378 | if (tlb_flag(TLB_WB)) | 405 | if (tlb_flag(TLB_WB)) |
379 | asm("mcr p15, 0, %0, c7, c10, 4 @ flush_pmd" | 406 | dsb(); |
380 | : : "r" (zero) : "cc"); | ||
381 | } | 407 | } |
382 | 408 | ||
383 | static inline void clean_pmd_entry(pmd_t *pmd) | 409 | static inline void clean_pmd_entry(pmd_t *pmd) |
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h index c92df958802e..4c1a3fa9f259 100644 --- a/include/asm-arm/uaccess.h +++ b/include/asm-arm/uaccess.h | |||
@@ -109,7 +109,7 @@ extern int __get_user_4(void *); | |||
109 | 109 | ||
110 | #define get_user(x,p) \ | 110 | #define get_user(x,p) \ |
111 | ({ \ | 111 | ({ \ |
112 | const register typeof(*(p)) __user *__p asm("r0") = (p);\ | 112 | register const typeof(*(p)) __user *__p asm("r0") = (p);\ |
113 | register unsigned long __r2 asm("r2"); \ | 113 | register unsigned long __r2 asm("r2"); \ |
114 | register int __e asm("r0"); \ | 114 | register int __e asm("r0"); \ |
115 | switch (sizeof(*(__p))) { \ | 115 | switch (sizeof(*(__p))) { \ |
@@ -143,8 +143,8 @@ extern int __put_user_8(void *, unsigned long long); | |||
143 | 143 | ||
144 | #define put_user(x,p) \ | 144 | #define put_user(x,p) \ |
145 | ({ \ | 145 | ({ \ |
146 | const register typeof(*(p)) __r2 asm("r2") = (x); \ | 146 | register const typeof(*(p)) __r2 asm("r2") = (x); \ |
147 | const register typeof(*(p)) __user *__p asm("r0") = (p);\ | 147 | register const typeof(*(p)) __user *__p asm("r0") = (p);\ |
148 | register int __e asm("r0"); \ | 148 | register int __e asm("r0"); \ |
149 | switch (sizeof(*(__p))) { \ | 149 | switch (sizeof(*(__p))) { \ |
150 | case 1: \ | 150 | case 1: \ |
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h index 97e7060000cf..0991b7bc3f78 100644 --- a/include/asm-arm/unistd.h +++ b/include/asm-arm/unistd.h | |||
@@ -372,6 +372,7 @@ | |||
372 | #define __NR_move_pages (__NR_SYSCALL_BASE+344) | 372 | #define __NR_move_pages (__NR_SYSCALL_BASE+344) |
373 | #define __NR_getcpu (__NR_SYSCALL_BASE+345) | 373 | #define __NR_getcpu (__NR_SYSCALL_BASE+345) |
374 | /* 346 for epoll_pwait */ | 374 | /* 346 for epoll_pwait */ |
375 | #define __NR_sys_kexec_load (__NR_SYSCALL_BASE+347) | ||
375 | 376 | ||
376 | /* | 377 | /* |
377 | * The following SWIs are ARM private. | 378 | * The following SWIs are ARM private. |
diff --git a/include/asm-arm26/uaccess.h b/include/asm-arm26/uaccess.h index 3f2dd1093e58..d64ed84cb2d3 100644 --- a/include/asm-arm26/uaccess.h +++ b/include/asm-arm26/uaccess.h | |||
@@ -74,7 +74,7 @@ extern int __get_user_bad(void); | |||
74 | 74 | ||
75 | #define get_user(x,p) \ | 75 | #define get_user(x,p) \ |
76 | ({ \ | 76 | ({ \ |
77 | const register typeof(*(p)) *__p asm("r0") = (p); \ | 77 | register const typeof(*(p)) *__p asm("r0") = (p); \ |
78 | register typeof(*(p)) __r1 asm("r1"); \ | 78 | register typeof(*(p)) __r1 asm("r1"); \ |
79 | register int __e asm("r0"); \ | 79 | register int __e asm("r0"); \ |
80 | switch (sizeof(*(p))) { \ | 80 | switch (sizeof(*(p))) { \ |
@@ -139,8 +139,8 @@ extern int __put_user_bad(void); | |||
139 | 139 | ||
140 | #define put_user(x,p) \ | 140 | #define put_user(x,p) \ |
141 | ({ \ | 141 | ({ \ |
142 | const register typeof(*(p)) __r1 asm("r1") = (x); \ | 142 | register const typeof(*(p)) __r1 asm("r1") = (x); \ |
143 | const register typeof(*(p)) *__p asm("r0") = (p); \ | 143 | register const typeof(*(p)) *__p asm("r0") = (p); \ |
144 | register int __e asm("r0"); \ | 144 | register int __e asm("r0"); \ |
145 | switch (sizeof(*(__p))) { \ | 145 | switch (sizeof(*(__p))) { \ |
146 | case 1: \ | 146 | case 1: \ |
@@ -170,8 +170,8 @@ extern int __put_user_bad(void); | |||
170 | 170 | ||
171 | #define put_user(x,p) \ | 171 | #define put_user(x,p) \ |
172 | ({ \ | 172 | ({ \ |
173 | const register typeof(*(p)) __r1 asm("r1") = (x); \ | 173 | register const typeof(*(p)) __r1 asm("r1") = (x); \ |
174 | const register typeof(*(p)) *__p asm("r0") = (p); \ | 174 | register const typeof(*(p)) *__p asm("r0") = (p); \ |
175 | register int __e asm("r0"); \ | 175 | register int __e asm("r0"); \ |
176 | switch (sizeof(*(p))) { \ | 176 | switch (sizeof(*(p))) { \ |
177 | case 1: \ | 177 | case 1: \ |
diff --git a/include/asm-avr32/arch-at32ap/at91_pdc.h b/include/asm-avr32/arch-at32ap/at91_pdc.h deleted file mode 100644 index 79d6e02fa45e..000000000000 --- a/include/asm-avr32/arch-at32ap/at91_pdc.h +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-at91rm9200/at91_pdc.h | ||
3 | * | ||
4 | * Copyright (C) 2005 Ivan Kokshaysky | ||
5 | * Copyright (C) SAN People | ||
6 | * | ||
7 | * Peripheral Data Controller (PDC) registers. | ||
8 | * Based on AT91RM9200 datasheet revision E. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | */ | ||
15 | |||
16 | #ifndef AT91_PDC_H | ||
17 | #define AT91_PDC_H | ||
18 | |||
19 | #define AT91_PDC_RPR 0x100 /* Receive Pointer Register */ | ||
20 | #define AT91_PDC_RCR 0x104 /* Receive Counter Register */ | ||
21 | #define AT91_PDC_TPR 0x108 /* Transmit Pointer Register */ | ||
22 | #define AT91_PDC_TCR 0x10c /* Transmit Counter Register */ | ||
23 | #define AT91_PDC_RNPR 0x110 /* Receive Next Pointer Register */ | ||
24 | #define AT91_PDC_RNCR 0x114 /* Receive Next Counter Register */ | ||
25 | #define AT91_PDC_TNPR 0x118 /* Transmit Next Pointer Register */ | ||
26 | #define AT91_PDC_TNCR 0x11c /* Transmit Next Counter Register */ | ||
27 | |||
28 | #define AT91_PDC_PTCR 0x120 /* Transfer Control Register */ | ||
29 | #define AT91_PDC_RXTEN (1 << 0) /* Receiver Transfer Enable */ | ||
30 | #define AT91_PDC_RXTDIS (1 << 1) /* Receiver Transfer Disable */ | ||
31 | #define AT91_PDC_TXTEN (1 << 8) /* Transmitter Transfer Enable */ | ||
32 | #define AT91_PDC_TXTDIS (1 << 9) /* Transmitter Transfer Disable */ | ||
33 | |||
34 | #define AT91_PDC_PTSR 0x124 /* Transfer Status Register */ | ||
35 | |||
36 | #endif | ||
diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h index b120ee030c86..1a7b07d436ff 100644 --- a/include/asm-avr32/arch-at32ap/board.h +++ b/include/asm-avr32/arch-at32ap/board.h | |||
@@ -26,7 +26,9 @@ struct eth_platform_data { | |||
26 | struct platform_device * | 26 | struct platform_device * |
27 | at32_add_device_eth(unsigned int id, struct eth_platform_data *data); | 27 | at32_add_device_eth(unsigned int id, struct eth_platform_data *data); |
28 | 28 | ||
29 | struct platform_device *at32_add_device_spi(unsigned int id); | 29 | struct spi_board_info; |
30 | struct platform_device * | ||
31 | at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n); | ||
30 | 32 | ||
31 | struct lcdc_platform_data { | 33 | struct lcdc_platform_data { |
32 | unsigned long fbmem_start; | 34 | unsigned long fbmem_start; |
diff --git a/include/asm-avr32/io.h b/include/asm-avr32/io.h index eec47500fa66..c08e81048393 100644 --- a/include/asm-avr32/io.h +++ b/include/asm-avr32/io.h | |||
@@ -28,13 +28,13 @@ static __inline__ void * phys_to_virt(unsigned long address) | |||
28 | * Generic IO read/write. These perform native-endian accesses. Note | 28 | * Generic IO read/write. These perform native-endian accesses. Note |
29 | * that some architectures will want to re-define __raw_{read,write}w. | 29 | * that some architectures will want to re-define __raw_{read,write}w. |
30 | */ | 30 | */ |
31 | extern void __raw_writesb(unsigned int addr, const void *data, int bytelen); | 31 | extern void __raw_writesb(void __iomem *addr, const void *data, int bytelen); |
32 | extern void __raw_writesw(unsigned int addr, const void *data, int wordlen); | 32 | extern void __raw_writesw(void __iomem *addr, const void *data, int wordlen); |
33 | extern void __raw_writesl(unsigned int addr, const void *data, int longlen); | 33 | extern void __raw_writesl(void __iomem *addr, const void *data, int longlen); |
34 | 34 | ||
35 | extern void __raw_readsb(unsigned int addr, void *data, int bytelen); | 35 | extern void __raw_readsb(const void __iomem *addr, void *data, int bytelen); |
36 | extern void __raw_readsw(unsigned int addr, void *data, int wordlen); | 36 | extern void __raw_readsw(const void __iomem *addr, void *data, int wordlen); |
37 | extern void __raw_readsl(unsigned int addr, void *data, int longlen); | 37 | extern void __raw_readsl(const void __iomem *addr, void *data, int longlen); |
38 | 38 | ||
39 | static inline void writeb(unsigned char b, volatile void __iomem *addr) | 39 | static inline void writeb(unsigned char b, volatile void __iomem *addr) |
40 | { | 40 | { |
@@ -252,6 +252,9 @@ extern void __iounmap(void __iomem *addr); | |||
252 | #define ioremap(offset, size) \ | 252 | #define ioremap(offset, size) \ |
253 | __ioremap((offset), (size), 0) | 253 | __ioremap((offset), (size), 0) |
254 | 254 | ||
255 | #define ioremap_nocache(offset, size) \ | ||
256 | __ioremap((offset), (size), 0) | ||
257 | |||
255 | #define iounmap(addr) \ | 258 | #define iounmap(addr) \ |
256 | __iounmap(addr) | 259 | __iounmap(addr) |
257 | 260 | ||
@@ -263,6 +266,14 @@ extern void __iounmap(void __iomem *addr); | |||
263 | #define page_to_bus page_to_phys | 266 | #define page_to_bus page_to_phys |
264 | #define bus_to_page phys_to_page | 267 | #define bus_to_page phys_to_page |
265 | 268 | ||
269 | /* | ||
270 | * Create a virtual mapping cookie for an IO port range. There exists | ||
271 | * no such thing as port-based I/O on AVR32, so a regular ioremap() | ||
272 | * should do what we need. | ||
273 | */ | ||
274 | #define ioport_map(port, nr) ioremap(port, nr) | ||
275 | #define ioport_unmap(port) iounmap(port) | ||
276 | |||
266 | #define dma_cache_wback_inv(_start, _size) \ | 277 | #define dma_cache_wback_inv(_start, _size) \ |
267 | flush_dcache_region(_start, _size) | 278 | flush_dcache_region(_start, _size) |
268 | #define dma_cache_inv(_start, _size) \ | 279 | #define dma_cache_inv(_start, _size) \ |
diff --git a/include/asm-avr32/unistd.h b/include/asm-avr32/unistd.h index 56ed1f9d348a..8f5120471819 100644 --- a/include/asm-avr32/unistd.h +++ b/include/asm-avr32/unistd.h | |||
@@ -120,7 +120,7 @@ | |||
120 | #define __NR_getitimer 105 | 120 | #define __NR_getitimer 105 |
121 | #define __NR_swapoff 106 | 121 | #define __NR_swapoff 106 |
122 | #define __NR_sysinfo 107 | 122 | #define __NR_sysinfo 107 |
123 | #define __NR_ipc 108 | 123 | /* 108 was __NR_ipc for a little while */ |
124 | #define __NR_sendfile 109 | 124 | #define __NR_sendfile 109 |
125 | #define __NR_setdomainname 110 | 125 | #define __NR_setdomainname 110 |
126 | #define __NR_uname 111 | 126 | #define __NR_uname 111 |
@@ -282,8 +282,21 @@ | |||
282 | #define __NR_vmsplice 264 | 282 | #define __NR_vmsplice 264 |
283 | #define __NR_epoll_pwait 265 | 283 | #define __NR_epoll_pwait 265 |
284 | 284 | ||
285 | #define __NR_msgget 266 | ||
286 | #define __NR_msgsnd 267 | ||
287 | #define __NR_msgrcv 268 | ||
288 | #define __NR_msgctl 269 | ||
289 | #define __NR_semget 270 | ||
290 | #define __NR_semop 271 | ||
291 | #define __NR_semctl 272 | ||
292 | #define __NR_semtimedop 273 | ||
293 | #define __NR_shmat 274 | ||
294 | #define __NR_shmget 275 | ||
295 | #define __NR_shmdt 276 | ||
296 | #define __NR_shmctl 277 | ||
297 | |||
285 | #ifdef __KERNEL__ | 298 | #ifdef __KERNEL__ |
286 | #define NR_syscalls 266 | 299 | #define NR_syscalls 278 |
287 | 300 | ||
288 | 301 | ||
289 | #define __ARCH_WANT_IPC_PARSE_VERSION | 302 | #define __ARCH_WANT_IPC_PARSE_VERSION |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 9d774d07d95b..00c23433b39f 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -183,6 +183,19 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
183 | #endif | 183 | #endif |
184 | 184 | ||
185 | /* | 185 | /* |
186 | * A facility to provide batching of the reload of page tables with the | ||
187 | * actual context switch code for paravirtualized guests. By convention, | ||
188 | * only one of the lazy modes (CPU, MMU) should be active at any given | ||
189 | * time, entry should never be nested, and entry and exits should always | ||
190 | * be paired. This is for sanity of maintaining and reasoning about the | ||
191 | * kernel code. | ||
192 | */ | ||
193 | #ifndef __HAVE_ARCH_ENTER_LAZY_CPU_MODE | ||
194 | #define arch_enter_lazy_cpu_mode() do {} while (0) | ||
195 | #define arch_leave_lazy_cpu_mode() do {} while (0) | ||
196 | #endif | ||
197 | |||
198 | /* | ||
186 | * When walking page tables, get the address of the next boundary, | 199 | * When walking page tables, get the address of the next boundary, |
187 | * or the end address of the range if that comes earlier. Although no | 200 | * or the end address of the range if that comes earlier. Although no |
188 | * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout. | 201 | * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout. |
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h index 5e657eb8946c..449f3f272e07 100644 --- a/include/asm-i386/acpi.h +++ b/include/asm-i386/acpi.h | |||
@@ -127,6 +127,7 @@ extern int acpi_irq_balance_set(char *str); | |||
127 | #define acpi_ioapic 0 | 127 | #define acpi_ioapic 0 |
128 | static inline void acpi_noirq_set(void) { } | 128 | static inline void acpi_noirq_set(void) { } |
129 | static inline void acpi_disable_pci(void) { } | 129 | static inline void acpi_disable_pci(void) { } |
130 | static inline void disable_acpi(void) { } | ||
130 | 131 | ||
131 | #endif /* !CONFIG_ACPI */ | 132 | #endif /* !CONFIG_ACPI */ |
132 | 133 | ||
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index 41a44319905f..cc6b1652249a 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h | |||
@@ -43,6 +43,8 @@ extern void generic_apic_probe(void); | |||
43 | #define apic_write native_apic_write | 43 | #define apic_write native_apic_write |
44 | #define apic_write_atomic native_apic_write_atomic | 44 | #define apic_write_atomic native_apic_write_atomic |
45 | #define apic_read native_apic_read | 45 | #define apic_read native_apic_read |
46 | #define setup_boot_clock setup_boot_APIC_clock | ||
47 | #define setup_secondary_clock setup_secondary_APIC_clock | ||
46 | #endif | 48 | #endif |
47 | 49 | ||
48 | static __inline fastcall void native_apic_write(unsigned long reg, | 50 | static __inline fastcall void native_apic_write(unsigned long reg, |
@@ -93,9 +95,7 @@ static inline void ack_APIC_irq(void) | |||
93 | apic_write_around(APIC_EOI, 0); | 95 | apic_write_around(APIC_EOI, 0); |
94 | } | 96 | } |
95 | 97 | ||
96 | extern void (*wait_timer_tick)(void); | 98 | extern int lapic_get_maxlvt(void); |
97 | |||
98 | extern int get_maxlvt(void); | ||
99 | extern void clear_local_APIC(void); | 99 | extern void clear_local_APIC(void); |
100 | extern void connect_bsp_APIC (void); | 100 | extern void connect_bsp_APIC (void); |
101 | extern void disconnect_bsp_APIC (int virt_wire_setup); | 101 | extern void disconnect_bsp_APIC (int virt_wire_setup); |
@@ -111,14 +111,9 @@ extern void smp_local_timer_interrupt (void); | |||
111 | extern void setup_boot_APIC_clock (void); | 111 | extern void setup_boot_APIC_clock (void); |
112 | extern void setup_secondary_APIC_clock (void); | 112 | extern void setup_secondary_APIC_clock (void); |
113 | extern int APIC_init_uniprocessor (void); | 113 | extern int APIC_init_uniprocessor (void); |
114 | extern void disable_APIC_timer(void); | ||
115 | extern void enable_APIC_timer(void); | ||
116 | 114 | ||
117 | extern void enable_NMI_through_LVT0 (void * dummy); | 115 | extern void enable_NMI_through_LVT0 (void * dummy); |
118 | 116 | ||
119 | void smp_send_timer_broadcast_ipi(void); | ||
120 | void switch_APIC_timer_to_ipi(void *cpumask); | ||
121 | void switch_ipi_to_APIC_timer(void *cpumask); | ||
122 | #define ARCH_APICTIMER_STOPS_ON_C3 1 | 117 | #define ARCH_APICTIMER_STOPS_ON_C3 1 |
123 | 118 | ||
124 | extern int timer_over_8254; | 119 | extern int timer_over_8254; |
diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h index 38f1aebbbdb5..c90c7c499302 100644 --- a/include/asm-i386/bugs.h +++ b/include/asm-i386/bugs.h | |||
@@ -160,7 +160,7 @@ static void __init check_config(void) | |||
160 | * If we configured ourselves for a TSC, we'd better have one! | 160 | * If we configured ourselves for a TSC, we'd better have one! |
161 | */ | 161 | */ |
162 | #ifdef CONFIG_X86_TSC | 162 | #ifdef CONFIG_X86_TSC |
163 | if (!cpu_has_tsc) | 163 | if (!cpu_has_tsc && !tsc_disable) |
164 | panic("Kernel compiled for Pentium+, requires TSC feature!"); | 164 | panic("Kernel compiled for Pentium+, requires TSC feature!"); |
165 | #endif | 165 | #endif |
166 | 166 | ||
diff --git a/include/asm-i386/desc.h b/include/asm-i386/desc.h index f398cc456448..050831f34f71 100644 --- a/include/asm-i386/desc.h +++ b/include/asm-i386/desc.h | |||
@@ -22,7 +22,7 @@ struct Xgt_desc_struct { | |||
22 | 22 | ||
23 | extern struct Xgt_desc_struct idt_descr; | 23 | extern struct Xgt_desc_struct idt_descr; |
24 | DECLARE_PER_CPU(struct Xgt_desc_struct, cpu_gdt_descr); | 24 | DECLARE_PER_CPU(struct Xgt_desc_struct, cpu_gdt_descr); |
25 | 25 | extern struct Xgt_desc_struct early_gdt_descr; | |
26 | 26 | ||
27 | static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu) | 27 | static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu) |
28 | { | 28 | { |
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h index 369035dfe4b6..8d33c9bb7c1c 100644 --- a/include/asm-i386/elf.h +++ b/include/asm-i386/elf.h | |||
@@ -90,8 +90,8 @@ typedef struct user_fxsr_struct elf_fpxregset_t; | |||
90 | pr_reg[6] = regs->eax; \ | 90 | pr_reg[6] = regs->eax; \ |
91 | pr_reg[7] = regs->xds; \ | 91 | pr_reg[7] = regs->xds; \ |
92 | pr_reg[8] = regs->xes; \ | 92 | pr_reg[8] = regs->xes; \ |
93 | savesegment(fs,pr_reg[9]); \ | 93 | pr_reg[9] = regs->xfs; \ |
94 | pr_reg[10] = regs->xgs; \ | 94 | savesegment(gs,pr_reg[10]); \ |
95 | pr_reg[11] = regs->orig_eax; \ | 95 | pr_reg[11] = regs->orig_eax; \ |
96 | pr_reg[12] = regs->eip; \ | 96 | pr_reg[12] = regs->eip; \ |
97 | pr_reg[13] = regs->xcs; \ | 97 | pr_reg[13] = regs->xcs; \ |
diff --git a/include/asm-i386/hpet.h b/include/asm-i386/hpet.h index e47be9a56cc2..fc03cf9de5c4 100644 --- a/include/asm-i386/hpet.h +++ b/include/asm-i386/hpet.h | |||
@@ -90,16 +90,19 @@ | |||
90 | #define HPET_MIN_PERIOD (100000UL) | 90 | #define HPET_MIN_PERIOD (100000UL) |
91 | #define HPET_TICK_RATE (HZ * 100000UL) | 91 | #define HPET_TICK_RATE (HZ * 100000UL) |
92 | 92 | ||
93 | extern unsigned long hpet_tick; /* hpet clks count per tick */ | ||
94 | extern unsigned long hpet_address; /* hpet memory map physical address */ | 93 | extern unsigned long hpet_address; /* hpet memory map physical address */ |
95 | extern int hpet_use_timer; | 94 | extern int is_hpet_enabled(void); |
96 | 95 | ||
96 | #ifdef CONFIG_X86_64 | ||
97 | extern unsigned long hpet_tick; /* hpet clks count per tick */ | ||
98 | extern int hpet_use_timer; | ||
97 | extern int hpet_rtc_timer_init(void); | 99 | extern int hpet_rtc_timer_init(void); |
98 | extern int hpet_enable(void); | 100 | extern int hpet_enable(void); |
99 | extern int hpet_reenable(void); | ||
100 | extern int is_hpet_enabled(void); | ||
101 | extern int is_hpet_capable(void); | 101 | extern int is_hpet_capable(void); |
102 | extern int hpet_readl(unsigned long a); | 102 | extern int hpet_readl(unsigned long a); |
103 | #else | ||
104 | extern int hpet_enable(void); | ||
105 | #endif | ||
103 | 106 | ||
104 | #ifdef CONFIG_HPET_EMULATE_RTC | 107 | #ifdef CONFIG_HPET_EMULATE_RTC |
105 | extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask); | 108 | extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask); |
@@ -110,5 +113,10 @@ extern int hpet_rtc_dropped_irq(void); | |||
110 | extern int hpet_rtc_timer_init(void); | 113 | extern int hpet_rtc_timer_init(void); |
111 | extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id); | 114 | extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id); |
112 | #endif /* CONFIG_HPET_EMULATE_RTC */ | 115 | #endif /* CONFIG_HPET_EMULATE_RTC */ |
116 | |||
117 | #else | ||
118 | |||
119 | static inline int hpet_enable(void) { return 0; } | ||
120 | |||
113 | #endif /* CONFIG_HPET_TIMER */ | 121 | #endif /* CONFIG_HPET_TIMER */ |
114 | #endif /* _I386_HPET_H */ | 122 | #endif /* _I386_HPET_H */ |
diff --git a/include/asm-i386/i8253.h b/include/asm-i386/i8253.h index 015d8df07690..6cb0dd4dcdde 100644 --- a/include/asm-i386/i8253.h +++ b/include/asm-i386/i8253.h | |||
@@ -1,6 +1,21 @@ | |||
1 | #ifndef __ASM_I8253_H__ | 1 | #ifndef __ASM_I8253_H__ |
2 | #define __ASM_I8253_H__ | 2 | #define __ASM_I8253_H__ |
3 | 3 | ||
4 | #include <linux/clockchips.h> | ||
5 | |||
4 | extern spinlock_t i8253_lock; | 6 | extern spinlock_t i8253_lock; |
5 | 7 | ||
8 | extern struct clock_event_device *global_clock_event; | ||
9 | |||
10 | /** | ||
11 | * pit_interrupt_hook - hook into timer tick | ||
12 | * @regs: standard registers from interrupt | ||
13 | * | ||
14 | * Call the global clock event handler. | ||
15 | **/ | ||
16 | static inline void pit_interrupt_hook(void) | ||
17 | { | ||
18 | global_clock_event->event_handler(global_clock_event); | ||
19 | } | ||
20 | |||
6 | #endif /* __ASM_I8253_H__ */ | 21 | #endif /* __ASM_I8253_H__ */ |
diff --git a/include/asm-i386/idle.h b/include/asm-i386/idle.h new file mode 100644 index 000000000000..87ab93911199 --- /dev/null +++ b/include/asm-i386/idle.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _ASM_I386_IDLE_H | ||
2 | #define _ASM_I386_IDLE_H 1 | ||
3 | |||
4 | #define IDLE_START 1 | ||
5 | #define IDLE_END 2 | ||
6 | |||
7 | struct notifier_block; | ||
8 | void idle_notifier_register(struct notifier_block *n); | ||
9 | void idle_notifier_unregister(struct notifier_block *n); | ||
10 | |||
11 | void exit_idle(void); | ||
12 | void enter_idle(void); | ||
13 | |||
14 | #endif | ||
diff --git a/include/asm-i386/mach-default/do_timer.h b/include/asm-i386/mach-default/do_timer.h index 7d606e3364ae..56e5689863ae 100644 --- a/include/asm-i386/mach-default/do_timer.h +++ b/include/asm-i386/mach-default/do_timer.h | |||
@@ -1,86 +1,16 @@ | |||
1 | /* defines for inline arch setup functions */ | 1 | /* defines for inline arch setup functions */ |
2 | #include <linux/clockchips.h> | ||
2 | 3 | ||
3 | #include <asm/apic.h> | ||
4 | #include <asm/i8259.h> | 4 | #include <asm/i8259.h> |
5 | #include <asm/i8253.h> | ||
5 | 6 | ||
6 | /** | 7 | /** |
7 | * do_timer_interrupt_hook - hook into timer tick | 8 | * do_timer_interrupt_hook - hook into timer tick |
8 | * @regs: standard registers from interrupt | ||
9 | * | 9 | * |
10 | * Description: | 10 | * Call the pit clock event handler. see asm/i8253.h |
11 | * This hook is called immediately after the timer interrupt is ack'd. | ||
12 | * It's primary purpose is to allow architectures that don't possess | ||
13 | * individual per CPU clocks (like the CPU APICs supply) to broadcast the | ||
14 | * timer interrupt as a means of triggering reschedules etc. | ||
15 | **/ | 11 | **/ |
16 | 12 | ||
17 | static inline void do_timer_interrupt_hook(void) | 13 | static inline void do_timer_interrupt_hook(void) |
18 | { | 14 | { |
19 | do_timer(1); | 15 | pit_interrupt_hook(); |
20 | #ifndef CONFIG_SMP | ||
21 | update_process_times(user_mode_vm(get_irq_regs())); | ||
22 | #endif | ||
23 | /* | ||
24 | * In the SMP case we use the local APIC timer interrupt to do the | ||
25 | * profiling, except when we simulate SMP mode on a uniprocessor | ||
26 | * system, in that case we have to call the local interrupt handler. | ||
27 | */ | ||
28 | #ifndef CONFIG_X86_LOCAL_APIC | ||
29 | profile_tick(CPU_PROFILING); | ||
30 | #else | ||
31 | if (!using_apic_timer) | ||
32 | smp_local_timer_interrupt(); | ||
33 | #endif | ||
34 | } | ||
35 | |||
36 | |||
37 | /* you can safely undefine this if you don't have the Neptune chipset */ | ||
38 | |||
39 | #define BUGGY_NEPTUN_TIMER | ||
40 | |||
41 | /** | ||
42 | * do_timer_overflow - process a detected timer overflow condition | ||
43 | * @count: hardware timer interrupt count on overflow | ||
44 | * | ||
45 | * Description: | ||
46 | * This call is invoked when the jiffies count has not incremented but | ||
47 | * the hardware timer interrupt has. It means that a timer tick interrupt | ||
48 | * came along while the previous one was pending, thus a tick was missed | ||
49 | **/ | ||
50 | static inline int do_timer_overflow(int count) | ||
51 | { | ||
52 | int i; | ||
53 | |||
54 | spin_lock(&i8259A_lock); | ||
55 | /* | ||
56 | * This is tricky when I/O APICs are used; | ||
57 | * see do_timer_interrupt(). | ||
58 | */ | ||
59 | i = inb(0x20); | ||
60 | spin_unlock(&i8259A_lock); | ||
61 | |||
62 | /* assumption about timer being IRQ0 */ | ||
63 | if (i & 0x01) { | ||
64 | /* | ||
65 | * We cannot detect lost timer interrupts ... | ||
66 | * well, that's why we call them lost, don't we? :) | ||
67 | * [hmm, on the Pentium and Alpha we can ... sort of] | ||
68 | */ | ||
69 | count -= LATCH; | ||
70 | } else { | ||
71 | #ifdef BUGGY_NEPTUN_TIMER | ||
72 | /* | ||
73 | * for the Neptun bug we know that the 'latch' | ||
74 | * command doesn't latch the high and low value | ||
75 | * of the counter atomically. Thus we have to | ||
76 | * substract 256 from the counter | ||
77 | * ... funny, isnt it? :) | ||
78 | */ | ||
79 | |||
80 | count -= 256; | ||
81 | #else | ||
82 | printk("do_slow_gettimeoffset(): hardware timer problem?\n"); | ||
83 | #endif | ||
84 | } | ||
85 | return count; | ||
86 | } | 16 | } |
diff --git a/include/asm-i386/mach-voyager/do_timer.h b/include/asm-i386/mach-voyager/do_timer.h index 04e69c104a74..60f9dcc15d54 100644 --- a/include/asm-i386/mach-voyager/do_timer.h +++ b/include/asm-i386/mach-voyager/do_timer.h | |||
@@ -1,25 +1,18 @@ | |||
1 | /* defines for inline arch setup functions */ | 1 | /* defines for inline arch setup functions */ |
2 | #include <linux/clockchips.h> | ||
3 | |||
2 | #include <asm/voyager.h> | 4 | #include <asm/voyager.h> |
5 | #include <asm/i8253.h> | ||
3 | 6 | ||
7 | /** | ||
8 | * do_timer_interrupt_hook - hook into timer tick | ||
9 | * @regs: standard registers from interrupt | ||
10 | * | ||
11 | * Call the pit clock event handler. see asm/i8253.h | ||
12 | **/ | ||
4 | static inline void do_timer_interrupt_hook(void) | 13 | static inline void do_timer_interrupt_hook(void) |
5 | { | 14 | { |
6 | do_timer(1); | 15 | pit_interrupt_hook(); |
7 | #ifndef CONFIG_SMP | ||
8 | update_process_times(user_mode_vm(irq_regs)); | ||
9 | #endif | ||
10 | |||
11 | voyager_timer_interrupt(); | 16 | voyager_timer_interrupt(); |
12 | } | 17 | } |
13 | 18 | ||
14 | static inline int do_timer_overflow(int count) | ||
15 | { | ||
16 | /* can't read the ISR, just assume 1 tick | ||
17 | overflow */ | ||
18 | if(count > LATCH || count < 0) { | ||
19 | printk(KERN_ERR "VOYAGER PROBLEM: count is %d, latch is %d\n", count, LATCH); | ||
20 | count = LATCH; | ||
21 | } | ||
22 | count -= LATCH; | ||
23 | |||
24 | return count; | ||
25 | } | ||
diff --git a/include/asm-i386/mce.h b/include/asm-i386/mce.h index 7cc1a973bf00..b0a02ee34ffd 100644 --- a/include/asm-i386/mce.h +++ b/include/asm-i386/mce.h | |||
@@ -3,3 +3,5 @@ extern void mcheck_init(struct cpuinfo_x86 *c); | |||
3 | #else | 3 | #else |
4 | #define mcheck_init(c) do {} while(0) | 4 | #define mcheck_init(c) do {} while(0) |
5 | #endif | 5 | #endif |
6 | |||
7 | extern int mce_disabled; | ||
diff --git a/include/asm-i386/mmu_context.h b/include/asm-i386/mmu_context.h index 68ff102d6f5e..e6aa30f8de5b 100644 --- a/include/asm-i386/mmu_context.h +++ b/include/asm-i386/mmu_context.h | |||
@@ -63,7 +63,7 @@ static inline void switch_mm(struct mm_struct *prev, | |||
63 | } | 63 | } |
64 | 64 | ||
65 | #define deactivate_mm(tsk, mm) \ | 65 | #define deactivate_mm(tsk, mm) \ |
66 | asm("movl %0,%%fs": :"r" (0)); | 66 | asm("movl %0,%%gs": :"r" (0)); |
67 | 67 | ||
68 | #define activate_mm(prev, next) \ | 68 | #define activate_mm(prev, next) \ |
69 | switch_mm((prev),(next),NULL) | 69 | switch_mm((prev),(next),NULL) |
diff --git a/include/asm-i386/mpspec.h b/include/asm-i386/mpspec.h index 770bf6da8c3d..f21349399d14 100644 --- a/include/asm-i386/mpspec.h +++ b/include/asm-i386/mpspec.h | |||
@@ -23,7 +23,6 @@ extern struct mpc_config_intsrc mp_irqs [MAX_IRQ_SOURCES]; | |||
23 | extern int mpc_default_type; | 23 | extern int mpc_default_type; |
24 | extern unsigned long mp_lapic_addr; | 24 | extern unsigned long mp_lapic_addr; |
25 | extern int pic_mode; | 25 | extern int pic_mode; |
26 | extern int using_apic_timer; | ||
27 | 26 | ||
28 | #ifdef CONFIG_ACPI | 27 | #ifdef CONFIG_ACPI |
29 | extern void mp_register_lapic (u8 id, u8 enabled); | 28 | extern void mp_register_lapic (u8 id, u8 enabled); |
diff --git a/include/asm-i386/msr.h b/include/asm-i386/msr.h index 609a3899475c..6db40d0583f1 100644 --- a/include/asm-i386/msr.h +++ b/include/asm-i386/msr.h | |||
@@ -307,4 +307,7 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val) | |||
307 | #define MSR_CORE_PERF_GLOBAL_CTRL 0x38f | 307 | #define MSR_CORE_PERF_GLOBAL_CTRL 0x38f |
308 | #define MSR_CORE_PERF_GLOBAL_OVF_CTRL 0x390 | 308 | #define MSR_CORE_PERF_GLOBAL_OVF_CTRL 0x390 |
309 | 309 | ||
310 | /* Geode defined MSRs */ | ||
311 | #define MSR_GEODE_BUSCONT_CONF0 0x1900 | ||
312 | |||
310 | #endif /* __ASM_MSR_H */ | 313 | #endif /* __ASM_MSR_H */ |
diff --git a/include/asm-i386/paravirt.h b/include/asm-i386/paravirt.h index 9f06265065f4..6317e0a4d735 100644 --- a/include/asm-i386/paravirt.h +++ b/include/asm-i386/paravirt.h | |||
@@ -59,90 +59,102 @@ struct paravirt_ops | |||
59 | convention. This makes it easier to implement inline | 59 | convention. This makes it easier to implement inline |
60 | assembler replacements. */ | 60 | assembler replacements. */ |
61 | 61 | ||
62 | void (fastcall *cpuid)(unsigned int *eax, unsigned int *ebx, | 62 | void (*cpuid)(unsigned int *eax, unsigned int *ebx, |
63 | unsigned int *ecx, unsigned int *edx); | 63 | unsigned int *ecx, unsigned int *edx); |
64 | 64 | ||
65 | unsigned long (fastcall *get_debugreg)(int regno); | 65 | unsigned long (*get_debugreg)(int regno); |
66 | void (fastcall *set_debugreg)(int regno, unsigned long value); | 66 | void (*set_debugreg)(int regno, unsigned long value); |
67 | 67 | ||
68 | void (fastcall *clts)(void); | 68 | void (*clts)(void); |
69 | 69 | ||
70 | unsigned long (fastcall *read_cr0)(void); | 70 | unsigned long (*read_cr0)(void); |
71 | void (fastcall *write_cr0)(unsigned long); | 71 | void (*write_cr0)(unsigned long); |
72 | 72 | ||
73 | unsigned long (fastcall *read_cr2)(void); | 73 | unsigned long (*read_cr2)(void); |
74 | void (fastcall *write_cr2)(unsigned long); | 74 | void (*write_cr2)(unsigned long); |
75 | 75 | ||
76 | unsigned long (fastcall *read_cr3)(void); | 76 | unsigned long (*read_cr3)(void); |
77 | void (fastcall *write_cr3)(unsigned long); | 77 | void (*write_cr3)(unsigned long); |
78 | 78 | ||
79 | unsigned long (fastcall *read_cr4_safe)(void); | 79 | unsigned long (*read_cr4_safe)(void); |
80 | unsigned long (fastcall *read_cr4)(void); | 80 | unsigned long (*read_cr4)(void); |
81 | void (fastcall *write_cr4)(unsigned long); | 81 | void (*write_cr4)(unsigned long); |
82 | 82 | ||
83 | unsigned long (fastcall *save_fl)(void); | 83 | unsigned long (*save_fl)(void); |
84 | void (fastcall *restore_fl)(unsigned long); | 84 | void (*restore_fl)(unsigned long); |
85 | void (fastcall *irq_disable)(void); | 85 | void (*irq_disable)(void); |
86 | void (fastcall *irq_enable)(void); | 86 | void (*irq_enable)(void); |
87 | void (fastcall *safe_halt)(void); | 87 | void (*safe_halt)(void); |
88 | void (fastcall *halt)(void); | 88 | void (*halt)(void); |
89 | void (fastcall *wbinvd)(void); | 89 | void (*wbinvd)(void); |
90 | 90 | ||
91 | /* err = 0/-EFAULT. wrmsr returns 0/-EFAULT. */ | 91 | /* err = 0/-EFAULT. wrmsr returns 0/-EFAULT. */ |
92 | u64 (fastcall *read_msr)(unsigned int msr, int *err); | 92 | u64 (*read_msr)(unsigned int msr, int *err); |
93 | int (fastcall *write_msr)(unsigned int msr, u64 val); | 93 | int (*write_msr)(unsigned int msr, u64 val); |
94 | 94 | ||
95 | u64 (fastcall *read_tsc)(void); | 95 | u64 (*read_tsc)(void); |
96 | u64 (fastcall *read_pmc)(void); | 96 | u64 (*read_pmc)(void); |
97 | 97 | ||
98 | void (fastcall *load_tr_desc)(void); | 98 | void (*load_tr_desc)(void); |
99 | void (fastcall *load_gdt)(const struct Xgt_desc_struct *); | 99 | void (*load_gdt)(const struct Xgt_desc_struct *); |
100 | void (fastcall *load_idt)(const struct Xgt_desc_struct *); | 100 | void (*load_idt)(const struct Xgt_desc_struct *); |
101 | void (fastcall *store_gdt)(struct Xgt_desc_struct *); | 101 | void (*store_gdt)(struct Xgt_desc_struct *); |
102 | void (fastcall *store_idt)(struct Xgt_desc_struct *); | 102 | void (*store_idt)(struct Xgt_desc_struct *); |
103 | void (fastcall *set_ldt)(const void *desc, unsigned entries); | 103 | void (*set_ldt)(const void *desc, unsigned entries); |
104 | unsigned long (fastcall *store_tr)(void); | 104 | unsigned long (*store_tr)(void); |
105 | void (fastcall *load_tls)(struct thread_struct *t, unsigned int cpu); | 105 | void (*load_tls)(struct thread_struct *t, unsigned int cpu); |
106 | void (fastcall *write_ldt_entry)(void *dt, int entrynum, | 106 | void (*write_ldt_entry)(void *dt, int entrynum, |
107 | u32 low, u32 high); | 107 | u32 low, u32 high); |
108 | void (fastcall *write_gdt_entry)(void *dt, int entrynum, | 108 | void (*write_gdt_entry)(void *dt, int entrynum, |
109 | u32 low, u32 high); | 109 | u32 low, u32 high); |
110 | void (fastcall *write_idt_entry)(void *dt, int entrynum, | 110 | void (*write_idt_entry)(void *dt, int entrynum, |
111 | u32 low, u32 high); | 111 | u32 low, u32 high); |
112 | void (fastcall *load_esp0)(struct tss_struct *tss, | 112 | void (*load_esp0)(struct tss_struct *tss, |
113 | struct thread_struct *thread); | 113 | struct thread_struct *thread); |
114 | 114 | ||
115 | void (fastcall *set_iopl_mask)(unsigned mask); | 115 | void (*set_iopl_mask)(unsigned mask); |
116 | 116 | ||
117 | void (fastcall *io_delay)(void); | 117 | void (*io_delay)(void); |
118 | void (*const_udelay)(unsigned long loops); | 118 | void (*const_udelay)(unsigned long loops); |
119 | 119 | ||
120 | #ifdef CONFIG_X86_LOCAL_APIC | 120 | #ifdef CONFIG_X86_LOCAL_APIC |
121 | void (fastcall *apic_write)(unsigned long reg, unsigned long v); | 121 | void (*apic_write)(unsigned long reg, unsigned long v); |
122 | void (fastcall *apic_write_atomic)(unsigned long reg, unsigned long v); | 122 | void (*apic_write_atomic)(unsigned long reg, unsigned long v); |
123 | unsigned long (fastcall *apic_read)(unsigned long reg); | 123 | unsigned long (*apic_read)(unsigned long reg); |
124 | void (*setup_boot_clock)(void); | ||
125 | void (*setup_secondary_clock)(void); | ||
124 | #endif | 126 | #endif |
125 | 127 | ||
126 | void (fastcall *flush_tlb_user)(void); | 128 | void (*flush_tlb_user)(void); |
127 | void (fastcall *flush_tlb_kernel)(void); | 129 | void (*flush_tlb_kernel)(void); |
128 | void (fastcall *flush_tlb_single)(u32 addr); | 130 | void (*flush_tlb_single)(u32 addr); |
129 | 131 | ||
130 | void (fastcall *set_pte)(pte_t *ptep, pte_t pteval); | 132 | void (*alloc_pt)(u32 pfn); |
131 | void (fastcall *set_pte_at)(struct mm_struct *mm, u32 addr, pte_t *ptep, pte_t pteval); | 133 | void (*alloc_pd)(u32 pfn); |
132 | void (fastcall *set_pmd)(pmd_t *pmdp, pmd_t pmdval); | 134 | void (*alloc_pd_clone)(u32 pfn, u32 clonepfn, u32 start, u32 count); |
133 | void (fastcall *pte_update)(struct mm_struct *mm, u32 addr, pte_t *ptep); | 135 | void (*release_pt)(u32 pfn); |
134 | void (fastcall *pte_update_defer)(struct mm_struct *mm, u32 addr, pte_t *ptep); | 136 | void (*release_pd)(u32 pfn); |
137 | |||
138 | void (*set_pte)(pte_t *ptep, pte_t pteval); | ||
139 | void (*set_pte_at)(struct mm_struct *mm, u32 addr, pte_t *ptep, pte_t pteval); | ||
140 | void (*set_pmd)(pmd_t *pmdp, pmd_t pmdval); | ||
141 | void (*pte_update)(struct mm_struct *mm, u32 addr, pte_t *ptep); | ||
142 | void (*pte_update_defer)(struct mm_struct *mm, u32 addr, pte_t *ptep); | ||
135 | #ifdef CONFIG_X86_PAE | 143 | #ifdef CONFIG_X86_PAE |
136 | void (fastcall *set_pte_atomic)(pte_t *ptep, pte_t pteval); | 144 | void (*set_pte_atomic)(pte_t *ptep, pte_t pteval); |
137 | void (fastcall *set_pte_present)(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte); | 145 | void (*set_pte_present)(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte); |
138 | void (fastcall *set_pud)(pud_t *pudp, pud_t pudval); | 146 | void (*set_pud)(pud_t *pudp, pud_t pudval); |
139 | void (fastcall *pte_clear)(struct mm_struct *mm, unsigned long addr, pte_t *ptep); | 147 | void (*pte_clear)(struct mm_struct *mm, unsigned long addr, pte_t *ptep); |
140 | void (fastcall *pmd_clear)(pmd_t *pmdp); | 148 | void (*pmd_clear)(pmd_t *pmdp); |
141 | #endif | 149 | #endif |
142 | 150 | ||
151 | void (*set_lazy_mode)(int mode); | ||
152 | |||
143 | /* These two are jmp to, not actually called. */ | 153 | /* These two are jmp to, not actually called. */ |
144 | void (fastcall *irq_enable_sysexit)(void); | 154 | void (*irq_enable_sysexit)(void); |
145 | void (fastcall *iret)(void); | 155 | void (*iret)(void); |
156 | |||
157 | void (*startup_ipi_hook)(int phys_apicid, unsigned long start_eip, unsigned long start_esp); | ||
146 | }; | 158 | }; |
147 | 159 | ||
148 | /* Mark a paravirt probe function. */ | 160 | /* Mark a paravirt probe function. */ |
@@ -313,13 +325,38 @@ static inline unsigned long apic_read(unsigned long reg) | |||
313 | { | 325 | { |
314 | return paravirt_ops.apic_read(reg); | 326 | return paravirt_ops.apic_read(reg); |
315 | } | 327 | } |
328 | |||
329 | static inline void setup_boot_clock(void) | ||
330 | { | ||
331 | paravirt_ops.setup_boot_clock(); | ||
332 | } | ||
333 | |||
334 | static inline void setup_secondary_clock(void) | ||
335 | { | ||
336 | paravirt_ops.setup_secondary_clock(); | ||
337 | } | ||
316 | #endif | 338 | #endif |
317 | 339 | ||
340 | #ifdef CONFIG_SMP | ||
341 | static inline void startup_ipi_hook(int phys_apicid, unsigned long start_eip, | ||
342 | unsigned long start_esp) | ||
343 | { | ||
344 | return paravirt_ops.startup_ipi_hook(phys_apicid, start_eip, start_esp); | ||
345 | } | ||
346 | #endif | ||
318 | 347 | ||
319 | #define __flush_tlb() paravirt_ops.flush_tlb_user() | 348 | #define __flush_tlb() paravirt_ops.flush_tlb_user() |
320 | #define __flush_tlb_global() paravirt_ops.flush_tlb_kernel() | 349 | #define __flush_tlb_global() paravirt_ops.flush_tlb_kernel() |
321 | #define __flush_tlb_single(addr) paravirt_ops.flush_tlb_single(addr) | 350 | #define __flush_tlb_single(addr) paravirt_ops.flush_tlb_single(addr) |
322 | 351 | ||
352 | #define paravirt_alloc_pt(pfn) paravirt_ops.alloc_pt(pfn) | ||
353 | #define paravirt_release_pt(pfn) paravirt_ops.release_pt(pfn) | ||
354 | |||
355 | #define paravirt_alloc_pd(pfn) paravirt_ops.alloc_pd(pfn) | ||
356 | #define paravirt_alloc_pd_clone(pfn, clonepfn, start, count) \ | ||
357 | paravirt_ops.alloc_pd_clone(pfn, clonepfn, start, count) | ||
358 | #define paravirt_release_pd(pfn) paravirt_ops.release_pd(pfn) | ||
359 | |||
323 | static inline void set_pte(pte_t *ptep, pte_t pteval) | 360 | static inline void set_pte(pte_t *ptep, pte_t pteval) |
324 | { | 361 | { |
325 | paravirt_ops.set_pte(ptep, pteval); | 362 | paravirt_ops.set_pte(ptep, pteval); |
@@ -372,6 +409,19 @@ static inline void pmd_clear(pmd_t *pmdp) | |||
372 | } | 409 | } |
373 | #endif | 410 | #endif |
374 | 411 | ||
412 | /* Lazy mode for batching updates / context switch */ | ||
413 | #define PARAVIRT_LAZY_NONE 0 | ||
414 | #define PARAVIRT_LAZY_MMU 1 | ||
415 | #define PARAVIRT_LAZY_CPU 2 | ||
416 | |||
417 | #define __HAVE_ARCH_ENTER_LAZY_CPU_MODE | ||
418 | #define arch_enter_lazy_cpu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_CPU) | ||
419 | #define arch_leave_lazy_cpu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_NONE) | ||
420 | |||
421 | #define __HAVE_ARCH_ENTER_LAZY_MMU_MODE | ||
422 | #define arch_enter_lazy_mmu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_MMU) | ||
423 | #define arch_leave_lazy_mmu_mode() paravirt_ops.set_lazy_mode(PARAVIRT_LAZY_NONE) | ||
424 | |||
375 | /* These all sit in the .parainstructions section to tell us what to patch. */ | 425 | /* These all sit in the .parainstructions section to tell us what to patch. */ |
376 | struct paravirt_patch { | 426 | struct paravirt_patch { |
377 | u8 *instr; /* original instructions */ | 427 | u8 *instr; /* original instructions */ |
diff --git a/include/asm-i386/pda.h b/include/asm-i386/pda.h index 2ba2736aa109..b12d59a318b7 100644 --- a/include/asm-i386/pda.h +++ b/include/asm-i386/pda.h | |||
@@ -39,19 +39,19 @@ extern struct i386_pda _proxy_pda; | |||
39 | if (0) { T__ tmp__; tmp__ = (val); } \ | 39 | if (0) { T__ tmp__; tmp__ = (val); } \ |
40 | switch (sizeof(_proxy_pda.field)) { \ | 40 | switch (sizeof(_proxy_pda.field)) { \ |
41 | case 1: \ | 41 | case 1: \ |
42 | asm(op "b %1,%%gs:%c2" \ | 42 | asm(op "b %1,%%fs:%c2" \ |
43 | : "+m" (_proxy_pda.field) \ | 43 | : "+m" (_proxy_pda.field) \ |
44 | :"ri" ((T__)val), \ | 44 | :"ri" ((T__)val), \ |
45 | "i"(pda_offset(field))); \ | 45 | "i"(pda_offset(field))); \ |
46 | break; \ | 46 | break; \ |
47 | case 2: \ | 47 | case 2: \ |
48 | asm(op "w %1,%%gs:%c2" \ | 48 | asm(op "w %1,%%fs:%c2" \ |
49 | : "+m" (_proxy_pda.field) \ | 49 | : "+m" (_proxy_pda.field) \ |
50 | :"ri" ((T__)val), \ | 50 | :"ri" ((T__)val), \ |
51 | "i"(pda_offset(field))); \ | 51 | "i"(pda_offset(field))); \ |
52 | break; \ | 52 | break; \ |
53 | case 4: \ | 53 | case 4: \ |
54 | asm(op "l %1,%%gs:%c2" \ | 54 | asm(op "l %1,%%fs:%c2" \ |
55 | : "+m" (_proxy_pda.field) \ | 55 | : "+m" (_proxy_pda.field) \ |
56 | :"ri" ((T__)val), \ | 56 | :"ri" ((T__)val), \ |
57 | "i"(pda_offset(field))); \ | 57 | "i"(pda_offset(field))); \ |
@@ -65,19 +65,19 @@ extern struct i386_pda _proxy_pda; | |||
65 | typeof(_proxy_pda.field) ret__; \ | 65 | typeof(_proxy_pda.field) ret__; \ |
66 | switch (sizeof(_proxy_pda.field)) { \ | 66 | switch (sizeof(_proxy_pda.field)) { \ |
67 | case 1: \ | 67 | case 1: \ |
68 | asm(op "b %%gs:%c1,%0" \ | 68 | asm(op "b %%fs:%c1,%0" \ |
69 | : "=r" (ret__) \ | 69 | : "=r" (ret__) \ |
70 | : "i" (pda_offset(field)), \ | 70 | : "i" (pda_offset(field)), \ |
71 | "m" (_proxy_pda.field)); \ | 71 | "m" (_proxy_pda.field)); \ |
72 | break; \ | 72 | break; \ |
73 | case 2: \ | 73 | case 2: \ |
74 | asm(op "w %%gs:%c1,%0" \ | 74 | asm(op "w %%fs:%c1,%0" \ |
75 | : "=r" (ret__) \ | 75 | : "=r" (ret__) \ |
76 | : "i" (pda_offset(field)), \ | 76 | : "i" (pda_offset(field)), \ |
77 | "m" (_proxy_pda.field)); \ | 77 | "m" (_proxy_pda.field)); \ |
78 | break; \ | 78 | break; \ |
79 | case 4: \ | 79 | case 4: \ |
80 | asm(op "l %%gs:%c1,%0" \ | 80 | asm(op "l %%fs:%c1,%0" \ |
81 | : "=r" (ret__) \ | 81 | : "=r" (ret__) \ |
82 | : "i" (pda_offset(field)), \ | 82 | : "i" (pda_offset(field)), \ |
83 | "m" (_proxy_pda.field)); \ | 83 | "m" (_proxy_pda.field)); \ |
diff --git a/include/asm-i386/pgalloc.h b/include/asm-i386/pgalloc.h index 4b1e61359f89..c8dc2d0141a7 100644 --- a/include/asm-i386/pgalloc.h +++ b/include/asm-i386/pgalloc.h | |||
@@ -5,13 +5,31 @@ | |||
5 | #include <linux/threads.h> | 5 | #include <linux/threads.h> |
6 | #include <linux/mm.h> /* for struct page */ | 6 | #include <linux/mm.h> /* for struct page */ |
7 | 7 | ||
8 | #define pmd_populate_kernel(mm, pmd, pte) \ | 8 | #ifdef CONFIG_PARAVIRT |
9 | set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))) | 9 | #include <asm/paravirt.h> |
10 | #else | ||
11 | #define paravirt_alloc_pt(pfn) do { } while (0) | ||
12 | #define paravirt_alloc_pd(pfn) do { } while (0) | ||
13 | #define paravirt_alloc_pd(pfn) do { } while (0) | ||
14 | #define paravirt_alloc_pd_clone(pfn, clonepfn, start, count) do { } while (0) | ||
15 | #define paravirt_release_pt(pfn) do { } while (0) | ||
16 | #define paravirt_release_pd(pfn) do { } while (0) | ||
17 | #endif | ||
18 | |||
19 | #define pmd_populate_kernel(mm, pmd, pte) \ | ||
20 | do { \ | ||
21 | paravirt_alloc_pt(__pa(pte) >> PAGE_SHIFT); \ | ||
22 | set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))); \ | ||
23 | } while (0) | ||
10 | 24 | ||
11 | #define pmd_populate(mm, pmd, pte) \ | 25 | #define pmd_populate(mm, pmd, pte) \ |
26 | do { \ | ||
27 | paravirt_alloc_pt(page_to_pfn(pte)); \ | ||
12 | set_pmd(pmd, __pmd(_PAGE_TABLE + \ | 28 | set_pmd(pmd, __pmd(_PAGE_TABLE + \ |
13 | ((unsigned long long)page_to_pfn(pte) << \ | 29 | ((unsigned long long)page_to_pfn(pte) << \ |
14 | (unsigned long long) PAGE_SHIFT))) | 30 | (unsigned long long) PAGE_SHIFT))); \ |
31 | } while (0) | ||
32 | |||
15 | /* | 33 | /* |
16 | * Allocate and free page tables. | 34 | * Allocate and free page tables. |
17 | */ | 35 | */ |
@@ -32,7 +50,11 @@ static inline void pte_free(struct page *pte) | |||
32 | } | 50 | } |
33 | 51 | ||
34 | 52 | ||
35 | #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) | 53 | #define __pte_free_tlb(tlb,pte) \ |
54 | do { \ | ||
55 | paravirt_release_pt(page_to_pfn(pte)); \ | ||
56 | tlb_remove_page((tlb),(pte)); \ | ||
57 | } while (0) | ||
36 | 58 | ||
37 | #ifdef CONFIG_X86_PAE | 59 | #ifdef CONFIG_X86_PAE |
38 | /* | 60 | /* |
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 359f10b54f59..edfbe46a5e13 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h | |||
@@ -257,6 +257,14 @@ static inline void __mwait(unsigned long eax, unsigned long ecx) | |||
257 | : :"a" (eax), "c" (ecx)); | 257 | : :"a" (eax), "c" (ecx)); |
258 | } | 258 | } |
259 | 259 | ||
260 | static inline void __sti_mwait(unsigned long eax, unsigned long ecx) | ||
261 | { | ||
262 | /* "mwait %eax,%ecx;" */ | ||
263 | asm volatile( | ||
264 | "sti; .byte 0x0f,0x01,0xc9;" | ||
265 | : :"a" (eax), "c" (ecx)); | ||
266 | } | ||
267 | |||
260 | extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx); | 268 | extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx); |
261 | 269 | ||
262 | /* from system description table in BIOS. Mostly for MCA use, but | 270 | /* from system description table in BIOS. Mostly for MCA use, but |
@@ -424,7 +432,7 @@ struct thread_struct { | |||
424 | .vm86_info = NULL, \ | 432 | .vm86_info = NULL, \ |
425 | .sysenter_cs = __KERNEL_CS, \ | 433 | .sysenter_cs = __KERNEL_CS, \ |
426 | .io_bitmap_ptr = NULL, \ | 434 | .io_bitmap_ptr = NULL, \ |
427 | .gs = __KERNEL_PDA, \ | 435 | .fs = __KERNEL_PDA, \ |
428 | } | 436 | } |
429 | 437 | ||
430 | /* | 438 | /* |
@@ -442,8 +450,8 @@ struct thread_struct { | |||
442 | } | 450 | } |
443 | 451 | ||
444 | #define start_thread(regs, new_eip, new_esp) do { \ | 452 | #define start_thread(regs, new_eip, new_esp) do { \ |
445 | __asm__("movl %0,%%fs": :"r" (0)); \ | 453 | __asm__("movl %0,%%gs": :"r" (0)); \ |
446 | regs->xgs = 0; \ | 454 | regs->xfs = 0; \ |
447 | set_fs(USER_DS); \ | 455 | set_fs(USER_DS); \ |
448 | regs->xds = __USER_DS; \ | 456 | regs->xds = __USER_DS; \ |
449 | regs->xes = __USER_DS; \ | 457 | regs->xes = __USER_DS; \ |
diff --git a/include/asm-i386/ptrace.h b/include/asm-i386/ptrace.h index bdbc894339b4..6002597b9e12 100644 --- a/include/asm-i386/ptrace.h +++ b/include/asm-i386/ptrace.h | |||
@@ -16,8 +16,8 @@ struct pt_regs { | |||
16 | long eax; | 16 | long eax; |
17 | int xds; | 17 | int xds; |
18 | int xes; | 18 | int xes; |
19 | /* int xfs; */ | 19 | int xfs; |
20 | int xgs; | 20 | /* int xgs; */ |
21 | long orig_eax; | 21 | long orig_eax; |
22 | long eip; | 22 | long eip; |
23 | int xcs; | 23 | int xcs; |
@@ -49,6 +49,10 @@ static inline int user_mode_vm(struct pt_regs *regs) | |||
49 | { | 49 | { |
50 | return ((regs->xcs & SEGMENT_RPL_MASK) | (regs->eflags & VM_MASK)) >= USER_RPL; | 50 | return ((regs->xcs & SEGMENT_RPL_MASK) | (regs->eflags & VM_MASK)) >= USER_RPL; |
51 | } | 51 | } |
52 | static inline int v8086_mode(struct pt_regs *regs) | ||
53 | { | ||
54 | return (regs->eflags & VM_MASK); | ||
55 | } | ||
52 | 56 | ||
53 | #define instruction_pointer(regs) ((regs)->eip) | 57 | #define instruction_pointer(regs) ((regs)->eip) |
54 | #define regs_return_value(regs) ((regs)->eax) | 58 | #define regs_return_value(regs) ((regs)->eax) |
diff --git a/include/asm-i386/segment.h b/include/asm-i386/segment.h index 3c796af33776..065f10bfa487 100644 --- a/include/asm-i386/segment.h +++ b/include/asm-i386/segment.h | |||
@@ -83,14 +83,8 @@ | |||
83 | * The GDT has 32 entries | 83 | * The GDT has 32 entries |
84 | */ | 84 | */ |
85 | #define GDT_ENTRIES 32 | 85 | #define GDT_ENTRIES 32 |
86 | |||
87 | #define GDT_SIZE (GDT_ENTRIES * 8) | 86 | #define GDT_SIZE (GDT_ENTRIES * 8) |
88 | 87 | ||
89 | /* Matches __KERNEL_CS and __USER_CS (they must be 2 entries apart) */ | ||
90 | #define SEGMENT_IS_FLAT_CODE(x) (((x) & 0xec) == GDT_ENTRY_KERNEL_CS * 8) | ||
91 | /* Matches PNP_CS32 and PNP_CS16 (they must be consecutive) */ | ||
92 | #define SEGMENT_IS_PNP_CODE(x) (((x) & 0xf4) == GDT_ENTRY_PNPBIOS_BASE * 8) | ||
93 | |||
94 | /* Simple and small GDT entries for booting only */ | 88 | /* Simple and small GDT entries for booting only */ |
95 | 89 | ||
96 | #define GDT_ENTRY_BOOT_CS 2 | 90 | #define GDT_ENTRY_BOOT_CS 2 |
@@ -134,4 +128,17 @@ | |||
134 | #ifndef CONFIG_PARAVIRT | 128 | #ifndef CONFIG_PARAVIRT |
135 | #define get_kernel_rpl() 0 | 129 | #define get_kernel_rpl() 0 |
136 | #endif | 130 | #endif |
131 | /* | ||
132 | * Matching rules for certain types of segments. | ||
133 | */ | ||
134 | |||
135 | /* Matches only __KERNEL_CS, ignoring PnP / USER / APM segments */ | ||
136 | #define SEGMENT_IS_KERNEL_CODE(x) (((x) & 0xfc) == GDT_ENTRY_KERNEL_CS * 8) | ||
137 | |||
138 | /* Matches __KERNEL_CS and __USER_CS (they must be 2 entries apart) */ | ||
139 | #define SEGMENT_IS_FLAT_CODE(x) (((x) & 0xec) == GDT_ENTRY_KERNEL_CS * 8) | ||
140 | |||
141 | /* Matches PNP_CS32 and PNP_CS16 (they must be consecutive) */ | ||
142 | #define SEGMENT_IS_PNP_CODE(x) (((x) & 0xf4) == GDT_ENTRY_PNPBIOS_BASE * 8) | ||
143 | |||
137 | #endif | 144 | #endif |
diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h index 76316275d6f9..0e8077cbfdac 100644 --- a/include/asm-i386/setup.h +++ b/include/asm-i386/setup.h | |||
@@ -77,6 +77,8 @@ int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map); | |||
77 | void __init add_memory_region(unsigned long long start, | 77 | void __init add_memory_region(unsigned long long start, |
78 | unsigned long long size, int type); | 78 | unsigned long long size, int type); |
79 | 79 | ||
80 | extern unsigned long init_pg_tables_end; | ||
81 | |||
80 | #endif /* __ASSEMBLY__ */ | 82 | #endif /* __ASSEMBLY__ */ |
81 | 83 | ||
82 | #endif /* __KERNEL__ */ | 84 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h index 64fe624c02ca..6bf0033a301c 100644 --- a/include/asm-i386/smp.h +++ b/include/asm-i386/smp.h | |||
@@ -52,6 +52,11 @@ extern void cpu_exit_clear(void); | |||
52 | extern void cpu_uninit(void); | 52 | extern void cpu_uninit(void); |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | #ifndef CONFIG_PARAVIRT | ||
56 | #define startup_ipi_hook(phys_apicid, start_eip, start_esp) \ | ||
57 | do { } while (0) | ||
58 | #endif | ||
59 | |||
55 | /* | 60 | /* |
56 | * This function is needed by all SMP systems. It must _always_ be valid | 61 | * This function is needed by all SMP systems. It must _always_ be valid |
57 | * from the initial startup. We map APIC_BASE very early in page_setup(), | 62 | * from the initial startup. We map APIC_BASE very early in page_setup(), |
diff --git a/include/asm-i386/time.h b/include/asm-i386/time.h index ea8065af825a..571b4294dc2e 100644 --- a/include/asm-i386/time.h +++ b/include/asm-i386/time.h | |||
@@ -30,6 +30,7 @@ static inline int native_set_wallclock(unsigned long nowtime) | |||
30 | 30 | ||
31 | #ifdef CONFIG_PARAVIRT | 31 | #ifdef CONFIG_PARAVIRT |
32 | #include <asm/paravirt.h> | 32 | #include <asm/paravirt.h> |
33 | extern unsigned long long native_sched_clock(void); | ||
33 | #else /* !CONFIG_PARAVIRT */ | 34 | #else /* !CONFIG_PARAVIRT */ |
34 | 35 | ||
35 | #define get_wallclock() native_get_wallclock() | 36 | #define get_wallclock() native_get_wallclock() |
diff --git a/include/asm-i386/timer.h b/include/asm-i386/timer.h index d0ebd05f8516..4752c3a6a708 100644 --- a/include/asm-i386/timer.h +++ b/include/asm-i386/timer.h | |||
@@ -8,6 +8,9 @@ void setup_pit_timer(void); | |||
8 | /* Modifiers for buggy PIT handling */ | 8 | /* Modifiers for buggy PIT handling */ |
9 | extern int pit_latch_buggy; | 9 | extern int pit_latch_buggy; |
10 | extern int timer_ack; | 10 | extern int timer_ack; |
11 | extern int no_timer_check; | ||
12 | extern unsigned long long (*custom_sched_clock)(void); | ||
13 | extern int no_sync_cmos_clock; | ||
11 | extern int recalibrate_cpu_khz(void); | 14 | extern int recalibrate_cpu_khz(void); |
12 | 15 | ||
13 | #endif | 16 | #endif |
diff --git a/include/asm-i386/tsc.h b/include/asm-i386/tsc.h index c13933185c1c..e997891cc7cc 100644 --- a/include/asm-i386/tsc.h +++ b/include/asm-i386/tsc.h | |||
@@ -1,48 +1 @@ | |||
1 | /* | #include <asm-x86_64/tsc.h> | |
2 | * linux/include/asm-i386/tsc.h | ||
3 | * | ||
4 | * i386 TSC related functions | ||
5 | */ | ||
6 | #ifndef _ASM_i386_TSC_H | ||
7 | #define _ASM_i386_TSC_H | ||
8 | |||
9 | #include <asm/processor.h> | ||
10 | |||
11 | /* | ||
12 | * Standard way to access the cycle counter on i586+ CPUs. | ||
13 | * Currently only used on SMP. | ||
14 | * | ||
15 | * If you really have a SMP machine with i486 chips or older, | ||
16 | * compile for that, and this will just always return zero. | ||
17 | * That's ok, it just means that the nicer scheduling heuristics | ||
18 | * won't work for you. | ||
19 | * | ||
20 | * We only use the low 32 bits, and we'd simply better make sure | ||
21 | * that we reschedule before that wraps. Scheduling at least every | ||
22 | * four billion cycles just basically sounds like a good idea, | ||
23 | * regardless of how fast the machine is. | ||
24 | */ | ||
25 | typedef unsigned long long cycles_t; | ||
26 | |||
27 | extern unsigned int cpu_khz; | ||
28 | extern unsigned int tsc_khz; | ||
29 | |||
30 | static inline cycles_t get_cycles(void) | ||
31 | { | ||
32 | unsigned long long ret = 0; | ||
33 | |||
34 | #ifndef CONFIG_X86_TSC | ||
35 | if (!cpu_has_tsc) | ||
36 | return 0; | ||
37 | #endif | ||
38 | |||
39 | #if defined(CONFIG_X86_GENERIC) || defined(CONFIG_X86_TSC) | ||
40 | rdtscll(ret); | ||
41 | #endif | ||
42 | return ret; | ||
43 | } | ||
44 | |||
45 | extern void tsc_init(void); | ||
46 | extern void mark_tsc_unstable(void); | ||
47 | |||
48 | #endif | ||
diff --git a/include/asm-i386/vmi.h b/include/asm-i386/vmi.h new file mode 100644 index 000000000000..43c89333037e --- /dev/null +++ b/include/asm-i386/vmi.h | |||
@@ -0,0 +1,262 @@ | |||
1 | /* | ||
2 | * VMI interface definition | ||
3 | * | ||
4 | * Copyright (C) 2005, VMware, Inc. | ||
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 | * This program is distributed in the hope that it will be useful, but | ||
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
14 | * NON INFRINGEMENT. See the GNU General Public License for more | ||
15 | * details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | * | ||
21 | * Maintained by: Zachary Amsden zach@vmware.com | ||
22 | * | ||
23 | */ | ||
24 | #include <linux/types.h> | ||
25 | |||
26 | /* | ||
27 | *--------------------------------------------------------------------- | ||
28 | * | ||
29 | * VMI Option ROM API | ||
30 | * | ||
31 | *--------------------------------------------------------------------- | ||
32 | */ | ||
33 | #define VMI_SIGNATURE 0x696d5663 /* "cVmi" */ | ||
34 | |||
35 | #define PCI_VENDOR_ID_VMWARE 0x15AD | ||
36 | #define PCI_DEVICE_ID_VMWARE_VMI 0x0801 | ||
37 | |||
38 | /* | ||
39 | * We use two version numbers for compatibility, with the major | ||
40 | * number signifying interface breakages, and the minor number | ||
41 | * interface extensions. | ||
42 | */ | ||
43 | #define VMI_API_REV_MAJOR 3 | ||
44 | #define VMI_API_REV_MINOR 0 | ||
45 | |||
46 | #define VMI_CALL_CPUID 0 | ||
47 | #define VMI_CALL_WRMSR 1 | ||
48 | #define VMI_CALL_RDMSR 2 | ||
49 | #define VMI_CALL_SetGDT 3 | ||
50 | #define VMI_CALL_SetLDT 4 | ||
51 | #define VMI_CALL_SetIDT 5 | ||
52 | #define VMI_CALL_SetTR 6 | ||
53 | #define VMI_CALL_GetGDT 7 | ||
54 | #define VMI_CALL_GetLDT 8 | ||
55 | #define VMI_CALL_GetIDT 9 | ||
56 | #define VMI_CALL_GetTR 10 | ||
57 | #define VMI_CALL_WriteGDTEntry 11 | ||
58 | #define VMI_CALL_WriteLDTEntry 12 | ||
59 | #define VMI_CALL_WriteIDTEntry 13 | ||
60 | #define VMI_CALL_UpdateKernelStack 14 | ||
61 | #define VMI_CALL_SetCR0 15 | ||
62 | #define VMI_CALL_SetCR2 16 | ||
63 | #define VMI_CALL_SetCR3 17 | ||
64 | #define VMI_CALL_SetCR4 18 | ||
65 | #define VMI_CALL_GetCR0 19 | ||
66 | #define VMI_CALL_GetCR2 20 | ||
67 | #define VMI_CALL_GetCR3 21 | ||
68 | #define VMI_CALL_GetCR4 22 | ||
69 | #define VMI_CALL_WBINVD 23 | ||
70 | #define VMI_CALL_SetDR 24 | ||
71 | #define VMI_CALL_GetDR 25 | ||
72 | #define VMI_CALL_RDPMC 26 | ||
73 | #define VMI_CALL_RDTSC 27 | ||
74 | #define VMI_CALL_CLTS 28 | ||
75 | #define VMI_CALL_EnableInterrupts 29 | ||
76 | #define VMI_CALL_DisableInterrupts 30 | ||
77 | #define VMI_CALL_GetInterruptMask 31 | ||
78 | #define VMI_CALL_SetInterruptMask 32 | ||
79 | #define VMI_CALL_IRET 33 | ||
80 | #define VMI_CALL_SYSEXIT 34 | ||
81 | #define VMI_CALL_Halt 35 | ||
82 | #define VMI_CALL_Reboot 36 | ||
83 | #define VMI_CALL_Shutdown 37 | ||
84 | #define VMI_CALL_SetPxE 38 | ||
85 | #define VMI_CALL_SetPxELong 39 | ||
86 | #define VMI_CALL_UpdatePxE 40 | ||
87 | #define VMI_CALL_UpdatePxELong 41 | ||
88 | #define VMI_CALL_MachineToPhysical 42 | ||
89 | #define VMI_CALL_PhysicalToMachine 43 | ||
90 | #define VMI_CALL_AllocatePage 44 | ||
91 | #define VMI_CALL_ReleasePage 45 | ||
92 | #define VMI_CALL_InvalPage 46 | ||
93 | #define VMI_CALL_FlushTLB 47 | ||
94 | #define VMI_CALL_SetLinearMapping 48 | ||
95 | |||
96 | #define VMI_CALL_SetIOPLMask 61 | ||
97 | #define VMI_CALL_SetInitialAPState 62 | ||
98 | #define VMI_CALL_APICWrite 63 | ||
99 | #define VMI_CALL_APICRead 64 | ||
100 | #define VMI_CALL_SetLazyMode 73 | ||
101 | |||
102 | /* | ||
103 | *--------------------------------------------------------------------- | ||
104 | * | ||
105 | * MMU operation flags | ||
106 | * | ||
107 | *--------------------------------------------------------------------- | ||
108 | */ | ||
109 | |||
110 | /* Flags used by VMI_{Allocate|Release}Page call */ | ||
111 | #define VMI_PAGE_PAE 0x10 /* Allocate PAE shadow */ | ||
112 | #define VMI_PAGE_CLONE 0x20 /* Clone from another shadow */ | ||
113 | #define VMI_PAGE_ZEROED 0x40 /* Page is pre-zeroed */ | ||
114 | |||
115 | |||
116 | /* Flags shared by Allocate|Release Page and PTE updates */ | ||
117 | #define VMI_PAGE_PT 0x01 | ||
118 | #define VMI_PAGE_PD 0x02 | ||
119 | #define VMI_PAGE_PDP 0x04 | ||
120 | #define VMI_PAGE_PML4 0x08 | ||
121 | |||
122 | #define VMI_PAGE_NORMAL 0x00 /* for debugging */ | ||
123 | |||
124 | /* Flags used by PTE updates */ | ||
125 | #define VMI_PAGE_CURRENT_AS 0x10 /* implies VMI_PAGE_VA_MASK is valid */ | ||
126 | #define VMI_PAGE_DEFER 0x20 /* may queue update until TLB inval */ | ||
127 | #define VMI_PAGE_VA_MASK 0xfffff000 | ||
128 | |||
129 | #ifdef CONFIG_X86_PAE | ||
130 | #define VMI_PAGE_L1 (VMI_PAGE_PT | VMI_PAGE_PAE | VMI_PAGE_ZEROED) | ||
131 | #define VMI_PAGE_L2 (VMI_PAGE_PD | VMI_PAGE_PAE | VMI_PAGE_ZEROED) | ||
132 | #else | ||
133 | #define VMI_PAGE_L1 (VMI_PAGE_PT | VMI_PAGE_ZEROED) | ||
134 | #define VMI_PAGE_L2 (VMI_PAGE_PD | VMI_PAGE_ZEROED) | ||
135 | #endif | ||
136 | |||
137 | /* Flags used by VMI_FlushTLB call */ | ||
138 | #define VMI_FLUSH_TLB 0x01 | ||
139 | #define VMI_FLUSH_GLOBAL 0x02 | ||
140 | |||
141 | /* | ||
142 | *--------------------------------------------------------------------- | ||
143 | * | ||
144 | * VMI relocation definitions for ROM call get_reloc | ||
145 | * | ||
146 | *--------------------------------------------------------------------- | ||
147 | */ | ||
148 | |||
149 | /* VMI Relocation types */ | ||
150 | #define VMI_RELOCATION_NONE 0 | ||
151 | #define VMI_RELOCATION_CALL_REL 1 | ||
152 | #define VMI_RELOCATION_JUMP_REL 2 | ||
153 | #define VMI_RELOCATION_NOP 3 | ||
154 | |||
155 | #ifndef __ASSEMBLY__ | ||
156 | struct vmi_relocation_info { | ||
157 | unsigned char *eip; | ||
158 | unsigned char type; | ||
159 | unsigned char reserved[3]; | ||
160 | }; | ||
161 | #endif | ||
162 | |||
163 | |||
164 | /* | ||
165 | *--------------------------------------------------------------------- | ||
166 | * | ||
167 | * Generic ROM structures and definitions | ||
168 | * | ||
169 | *--------------------------------------------------------------------- | ||
170 | */ | ||
171 | |||
172 | #ifndef __ASSEMBLY__ | ||
173 | |||
174 | struct vrom_header { | ||
175 | u16 rom_signature; // option ROM signature | ||
176 | u8 rom_length; // ROM length in 512 byte chunks | ||
177 | u8 rom_entry[4]; // 16-bit code entry point | ||
178 | u8 rom_pad0; // 4-byte align pad | ||
179 | u32 vrom_signature; // VROM identification signature | ||
180 | u8 api_version_min;// Minor version of API | ||
181 | u8 api_version_maj;// Major version of API | ||
182 | u8 jump_slots; // Number of jump slots | ||
183 | u8 reserved1; // Reserved for expansion | ||
184 | u32 virtual_top; // Hypervisor virtual address start | ||
185 | u16 reserved2; // Reserved for expansion | ||
186 | u16 license_offs; // Offset to License string | ||
187 | u16 pci_header_offs;// Offset to PCI OPROM header | ||
188 | u16 pnp_header_offs;// Offset to PnP OPROM header | ||
189 | u32 rom_pad3; // PnP reserverd / VMI reserved | ||
190 | u8 reserved[96]; // Reserved for headers | ||
191 | char vmi_init[8]; // VMI_Init jump point | ||
192 | char get_reloc[8]; // VMI_GetRelocationInfo jump point | ||
193 | } __attribute__((packed)); | ||
194 | |||
195 | struct pnp_header { | ||
196 | char sig[4]; | ||
197 | char rev; | ||
198 | char size; | ||
199 | short next; | ||
200 | short res; | ||
201 | long devID; | ||
202 | unsigned short manufacturer_offset; | ||
203 | unsigned short product_offset; | ||
204 | } __attribute__((packed)); | ||
205 | |||
206 | struct pci_header { | ||
207 | char sig[4]; | ||
208 | short vendorID; | ||
209 | short deviceID; | ||
210 | short vpdData; | ||
211 | short size; | ||
212 | char rev; | ||
213 | char class; | ||
214 | char subclass; | ||
215 | char interface; | ||
216 | short chunks; | ||
217 | char rom_version_min; | ||
218 | char rom_version_maj; | ||
219 | char codetype; | ||
220 | char lastRom; | ||
221 | short reserved; | ||
222 | } __attribute__((packed)); | ||
223 | |||
224 | /* Function prototypes for bootstrapping */ | ||
225 | extern void vmi_init(void); | ||
226 | extern void vmi_bringup(void); | ||
227 | extern void vmi_apply_boot_page_allocations(void); | ||
228 | |||
229 | /* State needed to start an application processor in an SMP system. */ | ||
230 | struct vmi_ap_state { | ||
231 | u32 cr0; | ||
232 | u32 cr2; | ||
233 | u32 cr3; | ||
234 | u32 cr4; | ||
235 | |||
236 | u64 efer; | ||
237 | |||
238 | u32 eip; | ||
239 | u32 eflags; | ||
240 | u32 eax; | ||
241 | u32 ebx; | ||
242 | u32 ecx; | ||
243 | u32 edx; | ||
244 | u32 esp; | ||
245 | u32 ebp; | ||
246 | u32 esi; | ||
247 | u32 edi; | ||
248 | u16 cs; | ||
249 | u16 ss; | ||
250 | u16 ds; | ||
251 | u16 es; | ||
252 | u16 fs; | ||
253 | u16 gs; | ||
254 | u16 ldtr; | ||
255 | |||
256 | u16 gdtr_limit; | ||
257 | u32 gdtr_base; | ||
258 | u32 idtr_base; | ||
259 | u16 idtr_limit; | ||
260 | }; | ||
261 | |||
262 | #endif | ||
diff --git a/include/asm-i386/vmi_time.h b/include/asm-i386/vmi_time.h new file mode 100644 index 000000000000..c12931211007 --- /dev/null +++ b/include/asm-i386/vmi_time.h | |||
@@ -0,0 +1,103 @@ | |||
1 | /* | ||
2 | * VMI Time wrappers | ||
3 | * | ||
4 | * Copyright (C) 2006, VMware, Inc. | ||
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 | * This program is distributed in the hope that it will be useful, but | ||
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
14 | * NON INFRINGEMENT. See the GNU General Public License for more | ||
15 | * details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | * | ||
21 | * Send feedback to dhecht@vmware.com | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #ifndef __VMI_TIME_H | ||
26 | #define __VMI_TIME_H | ||
27 | |||
28 | /* | ||
29 | * Raw VMI call indices for timer functions | ||
30 | */ | ||
31 | #define VMI_CALL_GetCycleFrequency 66 | ||
32 | #define VMI_CALL_GetCycleCounter 67 | ||
33 | #define VMI_CALL_SetAlarm 68 | ||
34 | #define VMI_CALL_CancelAlarm 69 | ||
35 | #define VMI_CALL_GetWallclockTime 70 | ||
36 | #define VMI_CALL_WallclockUpdated 71 | ||
37 | |||
38 | /* Cached VMI timer operations */ | ||
39 | extern struct vmi_timer_ops { | ||
40 | u64 (*get_cycle_frequency)(void); | ||
41 | u64 (*get_cycle_counter)(int); | ||
42 | u64 (*get_wallclock)(void); | ||
43 | int (*wallclock_updated)(void); | ||
44 | void (*set_alarm)(u32 flags, u64 expiry, u64 period); | ||
45 | void (*cancel_alarm)(u32 flags); | ||
46 | } vmi_timer_ops; | ||
47 | |||
48 | /* Prototypes */ | ||
49 | extern void __init vmi_time_init(void); | ||
50 | extern unsigned long vmi_get_wallclock(void); | ||
51 | extern int vmi_set_wallclock(unsigned long now); | ||
52 | extern unsigned long long vmi_sched_clock(void); | ||
53 | |||
54 | #ifdef CONFIG_X86_LOCAL_APIC | ||
55 | extern void __init vmi_timer_setup_boot_alarm(void); | ||
56 | extern void __init vmi_timer_setup_secondary_alarm(void); | ||
57 | extern void apic_vmi_timer_interrupt(void); | ||
58 | #endif | ||
59 | |||
60 | #ifdef CONFIG_NO_IDLE_HZ | ||
61 | extern int vmi_stop_hz_timer(void); | ||
62 | extern void vmi_account_time_restart_hz_timer(void); | ||
63 | #endif | ||
64 | |||
65 | /* | ||
66 | * When run under a hypervisor, a vcpu is always in one of three states: | ||
67 | * running, halted, or ready. The vcpu is in the 'running' state if it | ||
68 | * is executing. When the vcpu executes the halt interface, the vcpu | ||
69 | * enters the 'halted' state and remains halted until there is some work | ||
70 | * pending for the vcpu (e.g. an alarm expires, host I/O completes on | ||
71 | * behalf of virtual I/O). At this point, the vcpu enters the 'ready' | ||
72 | * state (waiting for the hypervisor to reschedule it). Finally, at any | ||
73 | * time when the vcpu is not in the 'running' state nor the 'halted' | ||
74 | * state, it is in the 'ready' state. | ||
75 | * | ||
76 | * Real time is advances while the vcpu is 'running', 'ready', or | ||
77 | * 'halted'. Stolen time is the time in which the vcpu is in the | ||
78 | * 'ready' state. Available time is the remaining time -- the vcpu is | ||
79 | * either 'running' or 'halted'. | ||
80 | * | ||
81 | * All three views of time are accessible through the VMI cycle | ||
82 | * counters. | ||
83 | */ | ||
84 | |||
85 | /* The cycle counters. */ | ||
86 | #define VMI_CYCLES_REAL 0 | ||
87 | #define VMI_CYCLES_AVAILABLE 1 | ||
88 | #define VMI_CYCLES_STOLEN 2 | ||
89 | |||
90 | /* The alarm interface 'flags' bits */ | ||
91 | #define VMI_ALARM_COUNTERS 2 | ||
92 | |||
93 | #define VMI_ALARM_COUNTER_MASK 0x000000ff | ||
94 | |||
95 | #define VMI_ALARM_WIRED_IRQ0 0x00000000 | ||
96 | #define VMI_ALARM_WIRED_LVTT 0x00010000 | ||
97 | |||
98 | #define VMI_ALARM_IS_ONESHOT 0x00000000 | ||
99 | #define VMI_ALARM_IS_PERIODIC 0x00000100 | ||
100 | |||
101 | #define CONFIG_VMI_ALARM_HZ 100 | ||
102 | |||
103 | #endif | ||
diff --git a/include/asm-ia64/kexec.h b/include/asm-ia64/kexec.h index 01c36b004747..f2ad469a6ddf 100644 --- a/include/asm-ia64/kexec.h +++ b/include/asm-ia64/kexec.h | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | extern struct kimage *ia64_kimage; | 24 | extern struct kimage *ia64_kimage; |
25 | DECLARE_PER_CPU(u64, ia64_mca_pal_base); | 25 | DECLARE_PER_CPU(u64, ia64_mca_pal_base); |
26 | const extern unsigned int relocate_new_kernel_size; | 26 | extern const unsigned int relocate_new_kernel_size; |
27 | extern void relocate_new_kernel(unsigned long, unsigned long, | 27 | extern void relocate_new_kernel(unsigned long, unsigned long, |
28 | struct ia64_boot_param *, unsigned long); | 28 | struct ia64_boot_param *, unsigned long); |
29 | static inline void | 29 | static inline void |
diff --git a/include/asm-ia64/libata-portmap.h b/include/asm-ia64/libata-portmap.h new file mode 100644 index 000000000000..0e00c9a9f410 --- /dev/null +++ b/include/asm-ia64/libata-portmap.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef __ASM_IA64_LIBATA_PORTMAP_H | ||
2 | #define __ASM_IA64_LIBATA_PORTMAP_H | ||
3 | |||
4 | #define ATA_PRIMARY_CMD 0x1F0 | ||
5 | #define ATA_PRIMARY_CTL 0x3F6 | ||
6 | #define ATA_PRIMARY_IRQ(dev) isa_irq_to_vector(14) | ||
7 | |||
8 | #define ATA_SECONDARY_CMD 0x170 | ||
9 | #define ATA_SECONDARY_CTL 0x376 | ||
10 | #define ATA_SECONDARY_IRQ(dev) isa_irq_to_vector(15) | ||
11 | |||
12 | #endif | ||
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h index bc768153f3c9..e43021a99a20 100644 --- a/include/asm-ia64/pal.h +++ b/include/asm-ia64/pal.h | |||
@@ -32,7 +32,7 @@ | |||
32 | #define PAL_CACHE_FLUSH 1 /* flush i/d cache */ | 32 | #define PAL_CACHE_FLUSH 1 /* flush i/d cache */ |
33 | #define PAL_CACHE_INFO 2 /* get detailed i/d cache info */ | 33 | #define PAL_CACHE_INFO 2 /* get detailed i/d cache info */ |
34 | #define PAL_CACHE_INIT 3 /* initialize i/d cache */ | 34 | #define PAL_CACHE_INIT 3 /* initialize i/d cache */ |
35 | #define PAL_CACHE_SUMMARY 4 /* get summary of cache heirarchy */ | 35 | #define PAL_CACHE_SUMMARY 4 /* get summary of cache hierarchy */ |
36 | #define PAL_MEM_ATTRIB 5 /* list supported memory attributes */ | 36 | #define PAL_MEM_ATTRIB 5 /* list supported memory attributes */ |
37 | #define PAL_PTCE_INFO 6 /* purge TLB info */ | 37 | #define PAL_PTCE_INFO 6 /* purge TLB info */ |
38 | #define PAL_VM_INFO 7 /* return supported virtual memory features */ | 38 | #define PAL_VM_INFO 7 /* return supported virtual memory features */ |
@@ -113,14 +113,14 @@ typedef s64 pal_status_t; | |||
113 | */ | 113 | */ |
114 | #define PAL_STATUS_REQUIRES_MEMORY (-9) /* Call requires PAL memory buffer */ | 114 | #define PAL_STATUS_REQUIRES_MEMORY (-9) /* Call requires PAL memory buffer */ |
115 | 115 | ||
116 | /* Processor cache level in the heirarchy */ | 116 | /* Processor cache level in the hierarchy */ |
117 | typedef u64 pal_cache_level_t; | 117 | typedef u64 pal_cache_level_t; |
118 | #define PAL_CACHE_LEVEL_L0 0 /* L0 */ | 118 | #define PAL_CACHE_LEVEL_L0 0 /* L0 */ |
119 | #define PAL_CACHE_LEVEL_L1 1 /* L1 */ | 119 | #define PAL_CACHE_LEVEL_L1 1 /* L1 */ |
120 | #define PAL_CACHE_LEVEL_L2 2 /* L2 */ | 120 | #define PAL_CACHE_LEVEL_L2 2 /* L2 */ |
121 | 121 | ||
122 | 122 | ||
123 | /* Processor cache type at a particular level in the heirarchy */ | 123 | /* Processor cache type at a particular level in the hierarchy */ |
124 | 124 | ||
125 | typedef u64 pal_cache_type_t; | 125 | typedef u64 pal_cache_type_t; |
126 | #define PAL_CACHE_TYPE_INSTRUCTION 1 /* Instruction cache */ | 126 | #define PAL_CACHE_TYPE_INSTRUCTION 1 /* Instruction cache */ |
@@ -272,14 +272,14 @@ typedef struct pal_cache_protection_info_s { | |||
272 | #define PAL_CACHE_PROT_METHOD_ECC 3 /* ECC protection */ | 272 | #define PAL_CACHE_PROT_METHOD_ECC 3 /* ECC protection */ |
273 | 273 | ||
274 | 274 | ||
275 | /* Processor cache line identification in the heirarchy */ | 275 | /* Processor cache line identification in the hierarchy */ |
276 | typedef union pal_cache_line_id_u { | 276 | typedef union pal_cache_line_id_u { |
277 | u64 pclid_data; | 277 | u64 pclid_data; |
278 | struct { | 278 | struct { |
279 | u64 cache_type : 8, /* 7-0 cache type */ | 279 | u64 cache_type : 8, /* 7-0 cache type */ |
280 | level : 8, /* 15-8 level of the | 280 | level : 8, /* 15-8 level of the |
281 | * cache in the | 281 | * cache in the |
282 | * heirarchy. | 282 | * hierarchy. |
283 | */ | 283 | */ |
284 | way : 8, /* 23-16 way in the set | 284 | way : 8, /* 23-16 way in the set |
285 | */ | 285 | */ |
@@ -292,7 +292,7 @@ typedef union pal_cache_line_id_u { | |||
292 | u64 cache_type : 8, /* 7-0 cache type */ | 292 | u64 cache_type : 8, /* 7-0 cache type */ |
293 | level : 8, /* 15-8 level of the | 293 | level : 8, /* 15-8 level of the |
294 | * cache in the | 294 | * cache in the |
295 | * heirarchy. | 295 | * hierarchy. |
296 | */ | 296 | */ |
297 | way : 8, /* 23-16 way in the set | 297 | way : 8, /* 23-16 way in the set |
298 | */ | 298 | */ |
@@ -978,7 +978,7 @@ ia64_pal_cache_read (pal_cache_line_id_u_t line_id, u64 physical_addr) | |||
978 | return iprv.status; | 978 | return iprv.status; |
979 | } | 979 | } |
980 | 980 | ||
981 | /* Return summary information about the heirarchy of caches controlled by the processor */ | 981 | /* Return summary information about the hierarchy of caches controlled by the processor */ |
982 | static inline s64 | 982 | static inline s64 |
983 | ia64_pal_cache_summary (u64 *cache_levels, u64 *unique_caches) | 983 | ia64_pal_cache_summary (u64 *cache_levels, u64 *unique_caches) |
984 | { | 984 | { |
diff --git a/include/asm-mips/abi.h b/include/asm-mips/abi.h index 1ce0518ace2e..1dd74fbdc09b 100644 --- a/include/asm-mips/abi.h +++ b/include/asm-mips/abi.h | |||
@@ -13,13 +13,13 @@ | |||
13 | #include <asm/siginfo.h> | 13 | #include <asm/siginfo.h> |
14 | 14 | ||
15 | struct mips_abi { | 15 | struct mips_abi { |
16 | void (* const do_signal)(struct pt_regs *regs); | ||
17 | int (* const setup_frame)(struct k_sigaction * ka, | 16 | int (* const setup_frame)(struct k_sigaction * ka, |
18 | struct pt_regs *regs, int signr, | 17 | struct pt_regs *regs, int signr, |
19 | sigset_t *set); | 18 | sigset_t *set); |
20 | int (* const setup_rt_frame)(struct k_sigaction * ka, | 19 | int (* const setup_rt_frame)(struct k_sigaction * ka, |
21 | struct pt_regs *regs, int signr, | 20 | struct pt_regs *regs, int signr, |
22 | sigset_t *set, siginfo_t *info); | 21 | sigset_t *set, siginfo_t *info); |
22 | const unsigned long restart; | ||
23 | }; | 23 | }; |
24 | 24 | ||
25 | #endif /* _ASM_ABI_H */ | 25 | #endif /* _ASM_ABI_H */ |
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h index 06c08228a525..89436b96ad66 100644 --- a/include/asm-mips/bitops.h +++ b/include/asm-mips/bitops.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (c) 1994 - 1997, 1999, 2000, 06 Ralf Baechle (ralf@linux-mips.org) | 6 | * Copyright (c) 1994 - 1997, 99, 2000, 06, 07 Ralf Baechle (ralf@linux-mips.org) |
7 | * Copyright (c) 1999, 2000 Silicon Graphics, Inc. | 7 | * Copyright (c) 1999, 2000 Silicon Graphics, Inc. |
8 | */ | 8 | */ |
9 | #ifndef _ASM_BITOPS_H | 9 | #ifndef _ASM_BITOPS_H |
@@ -24,11 +24,15 @@ | |||
24 | #define SZLONG_MASK 31UL | 24 | #define SZLONG_MASK 31UL |
25 | #define __LL "ll " | 25 | #define __LL "ll " |
26 | #define __SC "sc " | 26 | #define __SC "sc " |
27 | #define __INS "ins " | ||
28 | #define __EXT "ext " | ||
27 | #elif (_MIPS_SZLONG == 64) | 29 | #elif (_MIPS_SZLONG == 64) |
28 | #define SZLONG_LOG 6 | 30 | #define SZLONG_LOG 6 |
29 | #define SZLONG_MASK 63UL | 31 | #define SZLONG_MASK 63UL |
30 | #define __LL "lld " | 32 | #define __LL "lld " |
31 | #define __SC "scd " | 33 | #define __SC "scd " |
34 | #define __INS "dins " | ||
35 | #define __EXT "dext " | ||
32 | #endif | 36 | #endif |
33 | 37 | ||
34 | /* | 38 | /* |
@@ -62,6 +66,19 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) | |||
62 | " .set mips0 \n" | 66 | " .set mips0 \n" |
63 | : "=&r" (temp), "=m" (*m) | 67 | : "=&r" (temp), "=m" (*m) |
64 | : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); | 68 | : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); |
69 | #ifdef CONFIG_CPU_MIPSR2 | ||
70 | } else if (__builtin_constant_p(nr)) { | ||
71 | __asm__ __volatile__( | ||
72 | "1: " __LL "%0, %1 # set_bit \n" | ||
73 | " " __INS "%0, %4, %2, 1 \n" | ||
74 | " " __SC "%0, %1 \n" | ||
75 | " beqz %0, 2f \n" | ||
76 | " .subsection 2 \n" | ||
77 | "2: b 1b \n" | ||
78 | " .previous \n" | ||
79 | : "=&r" (temp), "=m" (*m) | ||
80 | : "ir" (nr & SZLONG_MASK), "m" (*m), "r" (~0)); | ||
81 | #endif /* CONFIG_CPU_MIPSR2 */ | ||
65 | } else if (cpu_has_llsc) { | 82 | } else if (cpu_has_llsc) { |
66 | __asm__ __volatile__( | 83 | __asm__ __volatile__( |
67 | " .set mips3 \n" | 84 | " .set mips3 \n" |
@@ -113,6 +130,19 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) | |||
113 | " .set mips0 \n" | 130 | " .set mips0 \n" |
114 | : "=&r" (temp), "=m" (*m) | 131 | : "=&r" (temp), "=m" (*m) |
115 | : "ir" (~(1UL << (nr & SZLONG_MASK))), "m" (*m)); | 132 | : "ir" (~(1UL << (nr & SZLONG_MASK))), "m" (*m)); |
133 | #ifdef CONFIG_CPU_MIPSR2 | ||
134 | } else if (__builtin_constant_p(nr)) { | ||
135 | __asm__ __volatile__( | ||
136 | "1: " __LL "%0, %1 # clear_bit \n" | ||
137 | " " __INS "%0, $0, %2, 1 \n" | ||
138 | " " __SC "%0, %1 \n" | ||
139 | " beqz %0, 2f \n" | ||
140 | " .subsection 2 \n" | ||
141 | "2: b 1b \n" | ||
142 | " .previous \n" | ||
143 | : "=&r" (temp), "=m" (*m) | ||
144 | : "ir" (nr & SZLONG_MASK), "m" (*m)); | ||
145 | #endif /* CONFIG_CPU_MIPSR2 */ | ||
116 | } else if (cpu_has_llsc) { | 146 | } else if (cpu_has_llsc) { |
117 | __asm__ __volatile__( | 147 | __asm__ __volatile__( |
118 | " .set mips3 \n" | 148 | " .set mips3 \n" |
@@ -291,6 +321,26 @@ static inline int test_and_clear_bit(unsigned long nr, | |||
291 | : "memory"); | 321 | : "memory"); |
292 | 322 | ||
293 | return res != 0; | 323 | return res != 0; |
324 | #ifdef CONFIG_CPU_MIPSR2 | ||
325 | } else if (__builtin_constant_p(nr)) { | ||
326 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | ||
327 | unsigned long temp, res; | ||
328 | |||
329 | __asm__ __volatile__( | ||
330 | "1: " __LL "%0, %1 # test_and_clear_bit \n" | ||
331 | " " __EXT "%2, %0, %3, 1 \n" | ||
332 | " " __INS "%0, $0, %3, 1 \n" | ||
333 | " " __SC "%0, %1 \n" | ||
334 | " beqz %0, 2f \n" | ||
335 | " .subsection 2 \n" | ||
336 | "2: b 1b \n" | ||
337 | " .previous \n" | ||
338 | : "=&r" (temp), "=m" (*m), "=&r" (res) | ||
339 | : "ri" (nr & SZLONG_MASK), "m" (*m) | ||
340 | : "memory"); | ||
341 | |||
342 | return res; | ||
343 | #endif | ||
294 | } else if (cpu_has_llsc) { | 344 | } else if (cpu_has_llsc) { |
295 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | 345 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); |
296 | unsigned long temp, res; | 346 | unsigned long temp, res; |
diff --git a/include/asm-mips/compat-signal.h b/include/asm-mips/compat-signal.h index 672077084aa1..6599a901b63e 100644 --- a/include/asm-mips/compat-signal.h +++ b/include/asm-mips/compat-signal.h | |||
@@ -5,6 +5,11 @@ | |||
5 | #include <linux/compat.h> | 5 | #include <linux/compat.h> |
6 | #include <linux/compiler.h> | 6 | #include <linux/compiler.h> |
7 | 7 | ||
8 | #include <asm/signal.h> | ||
9 | #include <asm/siginfo.h> | ||
10 | |||
11 | #include <asm/uaccess.h> | ||
12 | |||
8 | static inline int __copy_conv_sigset_to_user(compat_sigset_t __user *d, | 13 | static inline int __copy_conv_sigset_to_user(compat_sigset_t __user *d, |
9 | const sigset_t *s) | 14 | const sigset_t *s) |
10 | { | 15 | { |
@@ -33,9 +38,6 @@ static inline int __copy_conv_sigset_from_user(sigset_t *d, | |||
33 | BUG_ON(sizeof(*d) != sizeof(*s)); | 38 | BUG_ON(sizeof(*d) != sizeof(*s)); |
34 | BUG_ON(_NSIG_WORDS != 2); | 39 | BUG_ON(_NSIG_WORDS != 2); |
35 | 40 | ||
36 | if (unlikely(!access_ok(VERIFY_READ, d, sizeof(*d)))) | ||
37 | return -EFAULT; | ||
38 | |||
39 | #ifdef CONFIG_CPU_BIG_ENDIAN | 41 | #ifdef CONFIG_CPU_BIG_ENDIAN |
40 | err = __get_user(u->c.sig[1], &s->sig[0]); | 42 | err = __get_user(u->c.sig[1], &s->sig[0]); |
41 | err |= __get_user(u->c.sig[0], &s->sig[1]); | 43 | err |= __get_user(u->c.sig[0], &s->sig[1]); |
diff --git a/include/asm-mips/ds1216.h b/include/asm-mips/ds1216.h new file mode 100644 index 000000000000..1ff8b73f7a6a --- /dev/null +++ b/include/asm-mips/ds1216.h | |||
@@ -0,0 +1,31 @@ | |||
1 | #ifndef _DS1216_H | ||
2 | #define _DS1216_H | ||
3 | |||
4 | extern volatile unsigned char *ds1216_base; | ||
5 | unsigned long ds1216_get_cmos_time(void); | ||
6 | int ds1216_set_rtc_mmss(unsigned long nowtime); | ||
7 | |||
8 | #define DS1216_SEC_BYTE 1 | ||
9 | #define DS1216_MIN_BYTE 2 | ||
10 | #define DS1216_HOUR_BYTE 3 | ||
11 | #define DS1216_HOUR_MASK (0x1f) | ||
12 | #define DS1216_AMPM_MASK (1<<5) | ||
13 | #define DS1216_1224_MASK (1<<7) | ||
14 | #define DS1216_DAY_BYTE 4 | ||
15 | #define DS1216_DAY_MASK (0x7) | ||
16 | #define DS1216_DATE_BYTE 5 | ||
17 | #define DS1216_DATE_MASK (0x3f) | ||
18 | #define DS1216_MONTH_BYTE 6 | ||
19 | #define DS1216_MONTH_MASK (0x1f) | ||
20 | #define DS1216_YEAR_BYTE 7 | ||
21 | |||
22 | #define DS1216_SEC(buf) (buf[DS1216_SEC_BYTE]) | ||
23 | #define DS1216_MIN(buf) (buf[DS1216_MIN_BYTE]) | ||
24 | #define DS1216_HOUR(buf) (buf[DS1216_HOUR_BYTE] & DS1216_HOUR_MASK) | ||
25 | #define DS1216_AMPM(buf) (buf[DS1216_HOUR_BYTE] & DS1216_AMPM_MASK) | ||
26 | #define DS1216_1224(buf) (buf[DS1216_HOUR_BYTE] & DS1216_1224_MASK) | ||
27 | #define DS1216_DATE(buf) (buf[DS1216_DATE_BYTE] & DS1216_DATE_MASK) | ||
28 | #define DS1216_MONTH(buf) (buf[DS1216_MONTH_BYTE] & DS1216_MONTH_MASK) | ||
29 | #define DS1216_YEAR(buf) (buf[DS1216_YEAR_BYTE]) | ||
30 | |||
31 | #endif | ||
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index b6a2eb816628..92ec2618560c 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <asm/byteorder.h> | 20 | #include <asm/byteorder.h> |
21 | #include <asm/cpu.h> | 21 | #include <asm/cpu.h> |
22 | #include <asm/cpu-features.h> | 22 | #include <asm/cpu-features.h> |
23 | #include <asm-generic/iomap.h> | ||
23 | #include <asm/page.h> | 24 | #include <asm/page.h> |
24 | #include <asm/pgtable-bits.h> | 25 | #include <asm/pgtable-bits.h> |
25 | #include <asm/processor.h> | 26 | #include <asm/processor.h> |
@@ -518,34 +519,6 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int | |||
518 | } | 519 | } |
519 | 520 | ||
520 | /* | 521 | /* |
521 | * Memory Mapped I/O | ||
522 | */ | ||
523 | #define ioread8(addr) readb(addr) | ||
524 | #define ioread16(addr) readw(addr) | ||
525 | #define ioread32(addr) readl(addr) | ||
526 | |||
527 | #define iowrite8(b,addr) writeb(b,addr) | ||
528 | #define iowrite16(w,addr) writew(w,addr) | ||
529 | #define iowrite32(l,addr) writel(l,addr) | ||
530 | |||
531 | #define ioread8_rep(a,b,c) readsb(a,b,c) | ||
532 | #define ioread16_rep(a,b,c) readsw(a,b,c) | ||
533 | #define ioread32_rep(a,b,c) readsl(a,b,c) | ||
534 | |||
535 | #define iowrite8_rep(a,b,c) writesb(a,b,c) | ||
536 | #define iowrite16_rep(a,b,c) writesw(a,b,c) | ||
537 | #define iowrite32_rep(a,b,c) writesl(a,b,c) | ||
538 | |||
539 | /* Create a virtual mapping cookie for an IO port range */ | ||
540 | extern void __iomem *ioport_map(unsigned long port, unsigned int nr); | ||
541 | extern void ioport_unmap(void __iomem *); | ||
542 | |||
543 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | ||
544 | struct pci_dev; | ||
545 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
546 | extern void pci_iounmap(struct pci_dev *dev, void __iomem *); | ||
547 | |||
548 | /* | ||
549 | * ISA space is 'always mapped' on currently supported MIPS systems, no need | 522 | * ISA space is 'always mapped' on currently supported MIPS systems, no need |
550 | * to explicitly ioremap() it. The fact that the ISA IO space is mapped | 523 | * to explicitly ioremap() it. The fact that the ISA IO space is mapped |
551 | * to PAGE_OFFSET is pure coincidence - it does not mean ISA values | 524 | * to PAGE_OFFSET is pure coincidence - it does not mean ISA values |
diff --git a/include/asm-mips/mach-rm/cpu-feature-overrides.h b/include/asm-mips/mach-rm/cpu-feature-overrides.h index 11410ae10d36..7e07283140a3 100644 --- a/include/asm-mips/mach-rm/cpu-feature-overrides.h +++ b/include/asm-mips/mach-rm/cpu-feature-overrides.h | |||
@@ -21,9 +21,7 @@ | |||
21 | #define cpu_has_watch 0 | 21 | #define cpu_has_watch 0 |
22 | #define cpu_has_mips16 0 | 22 | #define cpu_has_mips16 0 |
23 | #define cpu_has_divec 0 | 23 | #define cpu_has_divec 0 |
24 | #define cpu_has_vce 0 | ||
25 | #define cpu_has_cache_cdex_p 1 | 24 | #define cpu_has_cache_cdex_p 1 |
26 | #define cpu_has_cache_cdex_s 0 | ||
27 | #define cpu_has_prefetch 0 | 25 | #define cpu_has_prefetch 0 |
28 | #define cpu_has_mcheck 0 | 26 | #define cpu_has_mcheck 0 |
29 | #define cpu_has_ejtag 0 | 27 | #define cpu_has_ejtag 0 |
@@ -35,9 +33,6 @@ | |||
35 | #define cpu_has_nofpuex 0 | 33 | #define cpu_has_nofpuex 0 |
36 | #define cpu_has_64bits 1 | 34 | #define cpu_has_64bits 1 |
37 | 35 | ||
38 | #define cpu_dcache_line_size() 32 | ||
39 | #define cpu_icache_line_size() 32 | ||
40 | |||
41 | #define cpu_has_mips32r1 0 | 36 | #define cpu_has_mips32r1 0 |
42 | #define cpu_has_mips32r2 0 | 37 | #define cpu_has_mips32r2 0 |
43 | #define cpu_has_mips64r1 0 | 38 | #define cpu_has_mips64r1 0 |
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index 7f0f120ca07c..3eea3ba0fca5 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h | |||
@@ -32,6 +32,7 @@ struct pci_controller { | |||
32 | unsigned long mem_offset; | 32 | unsigned long mem_offset; |
33 | struct resource *io_resource; | 33 | struct resource *io_resource; |
34 | unsigned long io_offset; | 34 | unsigned long io_offset; |
35 | unsigned long io_map_base; | ||
35 | 36 | ||
36 | unsigned int index; | 37 | unsigned int index; |
37 | /* For compatibility with current (as of July 2003) pciutils | 38 | /* For compatibility with current (as of July 2003) pciutils |
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h index af121c67dc71..5685d4fc7881 100644 --- a/include/asm-mips/pgalloc.h +++ b/include/asm-mips/pgalloc.h | |||
@@ -130,4 +130,6 @@ static inline void pmd_free(pmd_t *pmd) | |||
130 | 130 | ||
131 | #define check_pgt_cache() do { } while (0) | 131 | #define check_pgt_cache() do { } while (0) |
132 | 132 | ||
133 | extern void pagetable_init(void); | ||
134 | |||
133 | #endif /* _ASM_PGALLOC_H */ | 135 | #endif /* _ASM_PGALLOC_H */ |
diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h index 3c175a7e4345..972947474eb7 100644 --- a/include/asm-mips/sigcontext.h +++ b/include/asm-mips/sigcontext.h | |||
@@ -42,6 +42,7 @@ struct sigcontext { | |||
42 | 42 | ||
43 | #if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 | 43 | #if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 |
44 | 44 | ||
45 | #include <linux/posix_types.h> | ||
45 | /* | 46 | /* |
46 | * Keep this struct definition in sync with the sigcontext fragment | 47 | * Keep this struct definition in sync with the sigcontext fragment |
47 | * in arch/mips/tools/offset.c | 48 | * in arch/mips/tools/offset.c |
@@ -53,27 +54,25 @@ struct sigcontext { | |||
53 | * entries, add sc_dsp and sc_reserved for padding. No prisoners. | 54 | * entries, add sc_dsp and sc_reserved for padding. No prisoners. |
54 | */ | 55 | */ |
55 | struct sigcontext { | 56 | struct sigcontext { |
56 | unsigned long sc_regs[32]; | 57 | __u64 sc_regs[32]; |
57 | unsigned long sc_fpregs[32]; | 58 | __u64 sc_fpregs[32]; |
58 | unsigned long sc_mdhi; | 59 | __u64 sc_mdhi; |
59 | unsigned long sc_hi1; | 60 | __u64 sc_hi1; |
60 | unsigned long sc_hi2; | 61 | __u64 sc_hi2; |
61 | unsigned long sc_hi3; | 62 | __u64 sc_hi3; |
62 | unsigned long sc_mdlo; | 63 | __u64 sc_mdlo; |
63 | unsigned long sc_lo1; | 64 | __u64 sc_lo1; |
64 | unsigned long sc_lo2; | 65 | __u64 sc_lo2; |
65 | unsigned long sc_lo3; | 66 | __u64 sc_lo3; |
66 | unsigned long sc_pc; | 67 | __u64 sc_pc; |
67 | unsigned int sc_fpc_csr; | 68 | __u32 sc_fpc_csr; |
68 | unsigned int sc_used_math; | 69 | __u32 sc_used_math; |
69 | unsigned int sc_dsp; | 70 | __u32 sc_dsp; |
70 | unsigned int sc_reserved; | 71 | __u32 sc_reserved; |
71 | }; | 72 | }; |
72 | 73 | ||
73 | #ifdef __KERNEL__ | 74 | #ifdef __KERNEL__ |
74 | 75 | ||
75 | #include <linux/posix_types.h> | ||
76 | |||
77 | struct sigcontext32 { | 76 | struct sigcontext32 { |
78 | __u32 sc_regmask; /* Unused */ | 77 | __u32 sc_regmask; /* Unused */ |
79 | __u32 sc_status; /* Unused */ | 78 | __u32 sc_status; /* Unused */ |
diff --git a/include/asm-mips/signal.h b/include/asm-mips/signal.h index 8b391a2f0814..7a28989f7ee3 100644 --- a/include/asm-mips/signal.h +++ b/include/asm-mips/signal.h | |||
@@ -137,23 +137,6 @@ typedef struct sigaltstack { | |||
137 | 137 | ||
138 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) | 138 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) |
139 | 139 | ||
140 | struct pt_regs; | ||
141 | extern void do_signal(struct pt_regs *regs); | ||
142 | extern void do_signal32(struct pt_regs *regs); | ||
143 | |||
144 | extern int setup_frame(struct k_sigaction * ka, struct pt_regs *regs, | ||
145 | int signr, sigset_t *set); | ||
146 | extern int setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs, | ||
147 | int signr, sigset_t *set, siginfo_t *info); | ||
148 | |||
149 | extern int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs, | ||
150 | int signr, sigset_t *set); | ||
151 | extern int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs, | ||
152 | int signr, sigset_t *set, siginfo_t *info); | ||
153 | |||
154 | extern int setup_rt_frame_n32(struct k_sigaction * ka, struct pt_regs *regs, | ||
155 | int signr, sigset_t *set, siginfo_t *info); | ||
156 | |||
157 | #endif /* __KERNEL__ */ | 140 | #endif /* __KERNEL__ */ |
158 | 141 | ||
159 | #endif /* _ASM_SIGNAL_H */ | 142 | #endif /* _ASM_SIGNAL_H */ |
diff --git a/include/asm-mips/sni.h b/include/asm-mips/sni.h index b9ba54d0dd35..62f9be6f7320 100644 --- a/include/asm-mips/sni.h +++ b/include/asm-mips/sni.h | |||
@@ -6,12 +6,72 @@ | |||
6 | * for more details. | 6 | * for more details. |
7 | * | 7 | * |
8 | * Copyright (C) 1997, 1998 by Ralf Baechle | 8 | * Copyright (C) 1997, 1998 by Ralf Baechle |
9 | * Copyright (C) 2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de) | ||
9 | */ | 10 | */ |
10 | #ifndef __ASM_SNI_H | 11 | #ifndef __ASM_SNI_H |
11 | #define __ASM_SNI_H | 12 | #define __ASM_SNI_H |
12 | 13 | ||
14 | extern unsigned int sni_brd_type; | ||
15 | |||
16 | #define SNI_BRD_10 2 | ||
17 | #define SNI_BRD_10NEW 3 | ||
18 | #define SNI_BRD_TOWER_OASIC 4 | ||
19 | #define SNI_BRD_MINITOWER 5 | ||
20 | #define SNI_BRD_PCI_TOWER 6 | ||
21 | #define SNI_BRD_RM200 7 | ||
22 | #define SNI_BRD_PCI_MTOWER 8 | ||
23 | #define SNI_BRD_PCI_DESKTOP 9 | ||
24 | #define SNI_BRD_PCI_TOWER_CPLUS 10 | ||
25 | #define SNI_BRD_PCI_MTOWER_CPLUS 11 | ||
26 | |||
27 | /* RM400 cpu types */ | ||
28 | #define SNI_CPU_M8021 0x01 | ||
29 | #define SNI_CPU_M8030 0x04 | ||
30 | #define SNI_CPU_M8031 0x06 | ||
31 | #define SNI_CPU_M8034 0x0f | ||
32 | #define SNI_CPU_M8037 0x07 | ||
33 | #define SNI_CPU_M8040 0x05 | ||
34 | #define SNI_CPU_M8043 0x09 | ||
35 | #define SNI_CPU_M8050 0x0b | ||
36 | #define SNI_CPU_M8053 0x0d | ||
37 | |||
13 | #define SNI_PORT_BASE 0xb4000000 | 38 | #define SNI_PORT_BASE 0xb4000000 |
14 | 39 | ||
40 | #ifndef __MIPSEL__ | ||
41 | /* | ||
42 | * ASIC PCI registers for big endian configuration. | ||
43 | */ | ||
44 | #define PCIMT_UCONF 0xbfff0004 | ||
45 | #define PCIMT_IOADTIMEOUT2 0xbfff000c | ||
46 | #define PCIMT_IOMEMCONF 0xbfff0014 | ||
47 | #define PCIMT_IOMMU 0xbfff001c | ||
48 | #define PCIMT_IOADTIMEOUT1 0xbfff0024 | ||
49 | #define PCIMT_DMAACCESS 0xbfff002c | ||
50 | #define PCIMT_DMAHIT 0xbfff0034 | ||
51 | #define PCIMT_ERRSTATUS 0xbfff003c | ||
52 | #define PCIMT_ERRADDR 0xbfff0044 | ||
53 | #define PCIMT_SYNDROME 0xbfff004c | ||
54 | #define PCIMT_ITPEND 0xbfff0054 | ||
55 | #define IT_INT2 0x01 | ||
56 | #define IT_INTD 0x02 | ||
57 | #define IT_INTC 0x04 | ||
58 | #define IT_INTB 0x08 | ||
59 | #define IT_INTA 0x10 | ||
60 | #define IT_EISA 0x20 | ||
61 | #define IT_SCSI 0x40 | ||
62 | #define IT_ETH 0x80 | ||
63 | #define PCIMT_IRQSEL 0xbfff005c | ||
64 | #define PCIMT_TESTMEM 0xbfff0064 | ||
65 | #define PCIMT_ECCREG 0xbfff006c | ||
66 | #define PCIMT_CONFIG_ADDRESS 0xbfff0074 | ||
67 | #define PCIMT_ASIC_ID 0xbfff007c /* read */ | ||
68 | #define PCIMT_SOFT_RESET 0xbfff007c /* write */ | ||
69 | #define PCIMT_PIA_OE 0xbfff0084 | ||
70 | #define PCIMT_PIA_DATAOUT 0xbfff008c | ||
71 | #define PCIMT_PIA_DATAIN 0xbfff0094 | ||
72 | #define PCIMT_CACHECONF 0xbfff009c | ||
73 | #define PCIMT_INVSPACE 0xbfff00a4 | ||
74 | #else | ||
15 | /* | 75 | /* |
16 | * ASIC PCI registers for little endian configuration. | 76 | * ASIC PCI registers for little endian configuration. |
17 | */ | 77 | */ |
@@ -45,6 +105,8 @@ | |||
45 | #define PCIMT_PIA_DATAIN 0xbfff0090 | 105 | #define PCIMT_PIA_DATAIN 0xbfff0090 |
46 | #define PCIMT_CACHECONF 0xbfff0098 | 106 | #define PCIMT_CACHECONF 0xbfff0098 |
47 | #define PCIMT_INVSPACE 0xbfff00a0 | 107 | #define PCIMT_INVSPACE 0xbfff00a0 |
108 | #endif | ||
109 | |||
48 | #define PCIMT_PCI_CONF 0xbfff0100 | 110 | #define PCIMT_PCI_CONF 0xbfff0100 |
49 | 111 | ||
50 | /* | 112 | /* |
@@ -73,6 +135,36 @@ | |||
73 | #define PCIMT_PWDN 0xbfdf0000 | 135 | #define PCIMT_PWDN 0xbfdf0000 |
74 | 136 | ||
75 | /* | 137 | /* |
138 | * A20R based boards | ||
139 | */ | ||
140 | #define A20R_PT_CLOCK_BASE 0xbc040000 | ||
141 | #define A20R_PT_TIM0_ACK 0xbc050000 | ||
142 | #define A20R_PT_TIM1_ACK 0xbc060000 | ||
143 | |||
144 | #define SNI_MIPS_IRQ_CPU_BASE 16 | ||
145 | #define SNI_MIPS_IRQ_CPU_TIMER (SNI_MIPS_IRQ_CPU_BASE+7) | ||
146 | |||
147 | #define SNI_A20R_IRQ_BASE SNI_MIPS_IRQ_CPU_BASE | ||
148 | #define SNI_A20R_IRQ_TIMER (SNI_A20R_IRQ_BASE+5) | ||
149 | |||
150 | #define SNI_DS1216_A20R_BASE 0xbc081ffc | ||
151 | #define SNI_DS1216_RM200_BASE 0xbcd41ffc | ||
152 | |||
153 | #define SNI_PCIT_INT_REG 0xbfff000c | ||
154 | |||
155 | #define SNI_PCIT_INT_START 24 | ||
156 | #define SNI_PCIT_INT_END 30 | ||
157 | |||
158 | #define PCIT_IRQ_ETHERNET (SNI_MIPS_IRQ_CPU_BASE + 5) | ||
159 | #define PCIT_IRQ_INTA (SNI_PCIT_INT_START + 0) | ||
160 | #define PCIT_IRQ_INTB (SNI_PCIT_INT_START + 1) | ||
161 | #define PCIT_IRQ_INTC (SNI_PCIT_INT_START + 2) | ||
162 | #define PCIT_IRQ_INTD (SNI_PCIT_INT_START + 3) | ||
163 | #define PCIT_IRQ_SCSI0 (SNI_PCIT_INT_START + 4) | ||
164 | #define PCIT_IRQ_SCSI1 (SNI_PCIT_INT_START + 5) | ||
165 | |||
166 | |||
167 | /* | ||
76 | * Interrupt 0-16 are EISA interrupts. Interrupts from 16 on are assigned | 168 | * Interrupt 0-16 are EISA interrupts. Interrupts from 16 on are assigned |
77 | * to the other interrupts generated by ASIC PCI. | 169 | * to the other interrupts generated by ASIC PCI. |
78 | * | 170 | * |
@@ -80,18 +172,22 @@ | |||
80 | * ASIC PCI interrupt. | 172 | * ASIC PCI interrupt. |
81 | */ | 173 | */ |
82 | #define PCIMT_KEYBOARD_IRQ 1 | 174 | #define PCIMT_KEYBOARD_IRQ 1 |
83 | #define PCIMT_IRQ_INT2 16 | 175 | #define PCIMT_IRQ_INT2 24 |
84 | #define PCIMT_IRQ_INTD 17 | 176 | #define PCIMT_IRQ_INTD 25 |
85 | #define PCIMT_IRQ_INTC 18 | 177 | #define PCIMT_IRQ_INTC 26 |
86 | #define PCIMT_IRQ_INTB 19 | 178 | #define PCIMT_IRQ_INTB 27 |
87 | #define PCIMT_IRQ_INTA 20 | 179 | #define PCIMT_IRQ_INTA 28 |
88 | #define PCIMT_IRQ_EISA 21 | 180 | #define PCIMT_IRQ_EISA 29 |
89 | #define PCIMT_IRQ_SCSI 22 | 181 | #define PCIMT_IRQ_SCSI 30 |
90 | #define PCIMT_IRQ_ETHERNET 23 | 182 | |
183 | #define PCIMT_IRQ_ETHERNET (SNI_MIPS_IRQ_CPU_BASE+6) | ||
184 | |||
185 | #if 0 | ||
91 | #define PCIMT_IRQ_TEMPERATURE 24 | 186 | #define PCIMT_IRQ_TEMPERATURE 24 |
92 | #define PCIMT_IRQ_EISA_NMI 25 | 187 | #define PCIMT_IRQ_EISA_NMI 25 |
93 | #define PCIMT_IRQ_POWER_OFF 26 | 188 | #define PCIMT_IRQ_POWER_OFF 26 |
94 | #define PCIMT_IRQ_BUTTON 27 | 189 | #define PCIMT_IRQ_BUTTON 27 |
190 | #endif | ||
95 | 191 | ||
96 | /* | 192 | /* |
97 | * Base address for the mapped 16mb EISA bus segment. | 193 | * Base address for the mapped 16mb EISA bus segment. |
@@ -101,4 +197,24 @@ | |||
101 | /* PCI EISA Interrupt acknowledge */ | 197 | /* PCI EISA Interrupt acknowledge */ |
102 | #define PCIMT_INT_ACKNOWLEDGE 0xba000000 | 198 | #define PCIMT_INT_ACKNOWLEDGE 0xba000000 |
103 | 199 | ||
200 | /* board specific init functions */ | ||
201 | extern void sni_a20r_init (void); | ||
202 | extern void sni_pcit_init (void); | ||
203 | extern void sni_rm200_init (void); | ||
204 | extern void sni_pcimt_init (void); | ||
205 | |||
206 | /* board specific irq init functions */ | ||
207 | extern void sni_a20r_irq_init (void); | ||
208 | extern void sni_pcit_irq_init (void); | ||
209 | extern void sni_pcit_cplus_irq_init (void); | ||
210 | extern void sni_rm200_irq_init (void); | ||
211 | extern void sni_pcimt_irq_init (void); | ||
212 | |||
213 | /* timer inits */ | ||
214 | extern void sni_cpu_time_init(void); | ||
215 | |||
216 | /* common irq stuff */ | ||
217 | extern void (*sni_hwint)(void); | ||
218 | extern struct irqaction sni_isa_irq; | ||
219 | |||
104 | #endif /* __ASM_SNI_H */ | 220 | #endif /* __ASM_SNI_H */ |
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h index 3eff8d8fe28a..c62c20e7b5c6 100644 --- a/include/asm-mips/uaccess.h +++ b/include/asm-mips/uaccess.h | |||
@@ -435,8 +435,32 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); | |||
435 | __cu_len; \ | 435 | __cu_len; \ |
436 | }) | 436 | }) |
437 | 437 | ||
438 | #define __copy_to_user_inatomic __copy_to_user | 438 | #define __copy_to_user_inatomic(to,from,n) \ |
439 | #define __copy_from_user_inatomic __copy_from_user | 439 | ({ \ |
440 | void __user *__cu_to; \ | ||
441 | const void *__cu_from; \ | ||
442 | long __cu_len; \ | ||
443 | \ | ||
444 | __cu_to = (to); \ | ||
445 | __cu_from = (from); \ | ||
446 | __cu_len = (n); \ | ||
447 | __cu_len = __invoke_copy_to_user(__cu_to, __cu_from, __cu_len); \ | ||
448 | __cu_len; \ | ||
449 | }) | ||
450 | |||
451 | #define __copy_from_user_inatomic(to,from,n) \ | ||
452 | ({ \ | ||
453 | void *__cu_to; \ | ||
454 | const void __user *__cu_from; \ | ||
455 | long __cu_len; \ | ||
456 | \ | ||
457 | __cu_to = (to); \ | ||
458 | __cu_from = (from); \ | ||
459 | __cu_len = (n); \ | ||
460 | __cu_len = __invoke_copy_from_user_inatomic(__cu_to, __cu_from, \ | ||
461 | __cu_len); \ | ||
462 | __cu_len; \ | ||
463 | }) | ||
440 | 464 | ||
441 | /* | 465 | /* |
442 | * copy_to_user: - Copy a block of data into user space. | 466 | * copy_to_user: - Copy a block of data into user space. |
@@ -490,6 +514,29 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); | |||
490 | __cu_len_r; \ | 514 | __cu_len_r; \ |
491 | }) | 515 | }) |
492 | 516 | ||
517 | #define __invoke_copy_from_user_inatomic(to,from,n) \ | ||
518 | ({ \ | ||
519 | register void *__cu_to_r __asm__ ("$4"); \ | ||
520 | register const void __user *__cu_from_r __asm__ ("$5"); \ | ||
521 | register long __cu_len_r __asm__ ("$6"); \ | ||
522 | \ | ||
523 | __cu_to_r = (to); \ | ||
524 | __cu_from_r = (from); \ | ||
525 | __cu_len_r = (n); \ | ||
526 | __asm__ __volatile__( \ | ||
527 | ".set\tnoreorder\n\t" \ | ||
528 | __MODULE_JAL(__copy_user_inatomic) \ | ||
529 | ".set\tnoat\n\t" \ | ||
530 | __UA_ADDU "\t$1, %1, %2\n\t" \ | ||
531 | ".set\tat\n\t" \ | ||
532 | ".set\treorder" \ | ||
533 | : "+r" (__cu_to_r), "+r" (__cu_from_r), "+r" (__cu_len_r) \ | ||
534 | : \ | ||
535 | : "$8", "$9", "$10", "$11", "$12", "$15", "$24", "$31", \ | ||
536 | "memory"); \ | ||
537 | __cu_len_r; \ | ||
538 | }) | ||
539 | |||
493 | /* | 540 | /* |
494 | * __copy_from_user: - Copy a block of data from user space, with less checking. | 541 | * __copy_from_user: - Copy a block of data from user space, with less checking. |
495 | * @to: Destination address, in kernel space. | 542 | * @to: Destination address, in kernel space. |
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h index f038e33e6d48..2ce4b6b7b348 100644 --- a/include/asm-powerpc/atomic.h +++ b/include/asm-powerpc/atomic.h | |||
@@ -165,7 +165,8 @@ static __inline__ int atomic_dec_return(atomic_t *v) | |||
165 | return t; | 165 | return t; |
166 | } | 166 | } |
167 | 167 | ||
168 | #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) | 168 | #define atomic_cmpxchg(v, o, n) \ |
169 | ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n))) | ||
169 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | 170 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) |
170 | 171 | ||
171 | /** | 172 | /** |
@@ -413,6 +414,43 @@ static __inline__ long atomic64_dec_if_positive(atomic64_t *v) | |||
413 | return t; | 414 | return t; |
414 | } | 415 | } |
415 | 416 | ||
417 | #define atomic64_cmpxchg(v, o, n) \ | ||
418 | ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n))) | ||
419 | #define atomic64_xchg(v, new) (xchg(&((v)->counter), new)) | ||
420 | |||
421 | /** | ||
422 | * atomic64_add_unless - add unless the number is a given value | ||
423 | * @v: pointer of type atomic64_t | ||
424 | * @a: the amount to add to v... | ||
425 | * @u: ...unless v is equal to u. | ||
426 | * | ||
427 | * Atomically adds @a to @v, so long as it was not @u. | ||
428 | * Returns non-zero if @v was not @u, and zero otherwise. | ||
429 | */ | ||
430 | static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) | ||
431 | { | ||
432 | long t; | ||
433 | |||
434 | __asm__ __volatile__ ( | ||
435 | LWSYNC_ON_SMP | ||
436 | "1: ldarx %0,0,%1 # atomic_add_unless\n\ | ||
437 | cmpd 0,%0,%3 \n\ | ||
438 | beq- 2f \n\ | ||
439 | add %0,%2,%0 \n" | ||
440 | " stdcx. %0,0,%1 \n\ | ||
441 | bne- 1b \n" | ||
442 | ISYNC_ON_SMP | ||
443 | " subf %0,%2,%0 \n\ | ||
444 | 2:" | ||
445 | : "=&r" (t) | ||
446 | : "r" (&v->counter), "r" (a), "r" (u) | ||
447 | : "cc", "memory"); | ||
448 | |||
449 | return t != u; | ||
450 | } | ||
451 | |||
452 | #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) | ||
453 | |||
416 | #endif /* __powerpc64__ */ | 454 | #endif /* __powerpc64__ */ |
417 | 455 | ||
418 | #include <asm-generic/atomic.h> | 456 | #include <asm-generic/atomic.h> |
diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h index d7a1bc1551c6..05af081222f6 100644 --- a/include/asm-powerpc/dcr-native.h +++ b/include/asm-powerpc/dcr-native.h | |||
@@ -26,8 +26,8 @@ typedef struct {} dcr_host_t; | |||
26 | 26 | ||
27 | #define DCR_MAP_OK(host) (1) | 27 | #define DCR_MAP_OK(host) (1) |
28 | 28 | ||
29 | #define dcr_map(dev, dcr_n, dcr_c) {} | 29 | #define dcr_map(dev, dcr_n, dcr_c) ((dcr_host_t){}) |
30 | #define dcr_unmap(host, dcr_n, dcr_c) {} | 30 | #define dcr_unmap(host, dcr_n, dcr_c) do {} while (0) |
31 | #define dcr_read(host, dcr_n) mfdcr(dcr_n) | 31 | #define dcr_read(host, dcr_n) mfdcr(dcr_n) |
32 | #define dcr_write(host, dcr_n, value) mtdcr(dcr_n, value) | 32 | #define dcr_write(host, dcr_n, value) mtdcr(dcr_n, value) |
33 | 33 | ||
diff --git a/include/asm-powerpc/pmi.h b/include/asm-powerpc/pmi.h new file mode 100644 index 000000000000..cb0f8aa43088 --- /dev/null +++ b/include/asm-powerpc/pmi.h | |||
@@ -0,0 +1,67 @@ | |||
1 | #ifndef _POWERPC_PMI_H | ||
2 | #define _POWERPC_PMI_H | ||
3 | |||
4 | /* | ||
5 | * Definitions for talking with PMI device on PowerPC | ||
6 | * | ||
7 | * PMI (Platform Management Interrupt) is a way to communicate | ||
8 | * with the BMC (Baseboard Management Controller) via interrupts. | ||
9 | * Unlike IPMI it is bidirectional and has a low latency. | ||
10 | * | ||
11 | * (C) Copyright IBM Deutschland Entwicklung GmbH 2005 | ||
12 | * | ||
13 | * Author: Christian Krafft <krafft@de.ibm.com> | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License as published by | ||
17 | * the Free Software Foundation; either version 2, or (at your option) | ||
18 | * any later version. | ||
19 | * | ||
20 | * This program is distributed in the hope that it will be useful, | ||
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
23 | * GNU General Public License for more details. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License | ||
26 | * along with this program; if not, write to the Free Software | ||
27 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
28 | */ | ||
29 | |||
30 | #ifdef __KERNEL__ | ||
31 | |||
32 | #include <asm/of_device.h> | ||
33 | |||
34 | #define PMI_TYPE_FREQ_CHANGE 0x01 | ||
35 | #define PMI_READ_TYPE 0 | ||
36 | #define PMI_READ_DATA0 1 | ||
37 | #define PMI_READ_DATA1 2 | ||
38 | #define PMI_READ_DATA2 3 | ||
39 | #define PMI_WRITE_TYPE 4 | ||
40 | #define PMI_WRITE_DATA0 5 | ||
41 | #define PMI_WRITE_DATA1 6 | ||
42 | #define PMI_WRITE_DATA2 7 | ||
43 | |||
44 | #define PMI_ACK 0x80 | ||
45 | |||
46 | #define PMI_TIMEOUT 100 | ||
47 | |||
48 | typedef struct { | ||
49 | u8 type; | ||
50 | u8 data0; | ||
51 | u8 data1; | ||
52 | u8 data2; | ||
53 | } pmi_message_t; | ||
54 | |||
55 | struct pmi_handler { | ||
56 | struct list_head node; | ||
57 | u8 type; | ||
58 | void (*handle_pmi_message) (struct of_device *, pmi_message_t); | ||
59 | }; | ||
60 | |||
61 | void pmi_register_handler(struct of_device *, struct pmi_handler *); | ||
62 | void pmi_unregister_handler(struct of_device *, struct pmi_handler *); | ||
63 | |||
64 | void pmi_send_message(struct of_device *, pmi_message_t); | ||
65 | |||
66 | #endif /* __KERNEL__ */ | ||
67 | #endif /* _POWERPC_PMI_H */ | ||
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 0afee17f33b4..020ed015a94b 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h | |||
@@ -255,6 +255,8 @@ extern void kdump_move_device_tree(void); | |||
255 | /* CPU OF node matching */ | 255 | /* CPU OF node matching */ |
256 | struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); | 256 | struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); |
257 | 257 | ||
258 | /* Get the MAC address */ | ||
259 | extern const void *of_get_mac_address(struct device_node *np); | ||
258 | 260 | ||
259 | /* | 261 | /* |
260 | * OF interrupt mapping | 262 | * OF interrupt mapping |
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h index e5982ad46576..821581a8b643 100644 --- a/include/asm-powerpc/ps3.h +++ b/include/asm-powerpc/ps3.h | |||
@@ -355,13 +355,7 @@ extern struct bus_type ps3_system_bus_type; | |||
355 | 355 | ||
356 | /* vuart routines */ | 356 | /* vuart routines */ |
357 | 357 | ||
358 | struct ps3_vuart_stats { | 358 | struct ps3_vuart_port_priv; |
359 | unsigned long bytes_written; | ||
360 | unsigned long bytes_read; | ||
361 | unsigned long tx_interrupts; | ||
362 | unsigned long rx_interrupts; | ||
363 | unsigned long disconnect_interrupts; | ||
364 | }; | ||
365 | 359 | ||
366 | /** | 360 | /** |
367 | * struct ps3_vuart_port_device - a device on a vuart port | 361 | * struct ps3_vuart_port_device - a device on a vuart port |
@@ -370,24 +364,17 @@ struct ps3_vuart_stats { | |||
370 | struct ps3_vuart_port_device { | 364 | struct ps3_vuart_port_device { |
371 | enum ps3_match_id match_id; | 365 | enum ps3_match_id match_id; |
372 | struct device core; | 366 | struct device core; |
367 | struct ps3_vuart_port_priv* priv; /* private driver variables */ | ||
373 | 368 | ||
374 | /* private driver variables */ | ||
375 | unsigned int port_number; | ||
376 | u64 interrupt_mask; | ||
377 | struct { | ||
378 | spinlock_t lock; | ||
379 | struct list_head head; | ||
380 | } tx_list; | ||
381 | struct { | ||
382 | unsigned long bytes_held; | ||
383 | spinlock_t lock; | ||
384 | struct list_head head; | ||
385 | } rx_list; | ||
386 | struct ps3_vuart_stats stats; | ||
387 | }; | 369 | }; |
388 | 370 | ||
389 | int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev); | 371 | int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev); |
390 | 372 | ||
373 | /* system manager */ | ||
374 | |||
375 | void ps3_sys_manager_restart(void); | ||
376 | void ps3_sys_manager_power_off(void); | ||
377 | |||
391 | struct ps3_prealloc { | 378 | struct ps3_prealloc { |
392 | const char *name; | 379 | const char *name; |
393 | void *address; | 380 | void *address; |
diff --git a/include/asm-powerpc/ucc_slow.h b/include/asm-powerpc/ucc_slow.h index 1babad99c719..fdaac9d762bb 100644 --- a/include/asm-powerpc/ucc_slow.h +++ b/include/asm-powerpc/ucc_slow.h | |||
@@ -150,7 +150,7 @@ struct ucc_slow_info { | |||
150 | int ucc_num; | 150 | int ucc_num; |
151 | enum qe_clock rx_clock; | 151 | enum qe_clock rx_clock; |
152 | enum qe_clock tx_clock; | 152 | enum qe_clock tx_clock; |
153 | struct ucc_slow *regs; | 153 | u32 regs; |
154 | int irq; | 154 | int irq; |
155 | u16 uccm_mask; | 155 | u16 uccm_mask; |
156 | int data_mem_part; | 156 | int data_mem_part; |
@@ -199,9 +199,9 @@ struct ucc_slow_private { | |||
199 | and length for first BD in a frame */ | 199 | and length for first BD in a frame */ |
200 | u32 tx_base_offset; /* first BD in Tx BD table offset (In MURAM) */ | 200 | u32 tx_base_offset; /* first BD in Tx BD table offset (In MURAM) */ |
201 | u32 rx_base_offset; /* first BD in Rx BD table offset (In MURAM) */ | 201 | u32 rx_base_offset; /* first BD in Rx BD table offset (In MURAM) */ |
202 | u8 *confBd; /* next BD for confirm after Tx */ | 202 | struct qe_bd *confBd; /* next BD for confirm after Tx */ |
203 | u8 *tx_bd; /* next BD for new Tx request */ | 203 | struct qe_bd *tx_bd; /* next BD for new Tx request */ |
204 | u8 *rx_bd; /* next BD to collect after Rx */ | 204 | struct qe_bd *rx_bd; /* next BD to collect after Rx */ |
205 | void *p_rx_frame; /* accumulating receive frame */ | 205 | void *p_rx_frame; /* accumulating receive frame */ |
206 | u16 *p_ucce; /* a pointer to the event register in memory. | 206 | u16 *p_ucce; /* a pointer to the event register in memory. |
207 | */ | 207 | */ |
diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h index af20c7462485..c17bdbf22067 100644 --- a/include/asm-s390/atomic.h +++ b/include/asm-s390/atomic.h | |||
@@ -215,6 +215,8 @@ static __inline__ void atomic64_set_mask(unsigned long mask, atomic64_t * v) | |||
215 | __CSG_LOOP(v, mask, "ogr"); | 215 | __CSG_LOOP(v, mask, "ogr"); |
216 | } | 216 | } |
217 | 217 | ||
218 | #define atomic64_xchg(v, new) (xchg(&((v)->counter), new)) | ||
219 | |||
218 | static __inline__ long long atomic64_cmpxchg(atomic64_t *v, | 220 | static __inline__ long long atomic64_cmpxchg(atomic64_t *v, |
219 | long long old, long long new) | 221 | long long old, long long new) |
220 | { | 222 | { |
diff --git a/include/asm-s390/ipl.h b/include/asm-s390/ipl.h new file mode 100644 index 000000000000..5650d3d4ae46 --- /dev/null +++ b/include/asm-s390/ipl.h | |||
@@ -0,0 +1,113 @@ | |||
1 | /* | ||
2 | * s390 (re)ipl support | ||
3 | * | ||
4 | * Copyright IBM Corp. 2007 | ||
5 | */ | ||
6 | |||
7 | #ifndef _ASM_S390_IPL_H | ||
8 | #define _ASM_S390_IPL_H | ||
9 | |||
10 | #include <asm/types.h> | ||
11 | |||
12 | #define IPL_PARMBLOCK_ORIGIN 0x2000 | ||
13 | |||
14 | #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \ | ||
15 | sizeof(struct ipl_block_fcp)) | ||
16 | |||
17 | #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \ | ||
18 | sizeof(struct ipl_block_ccw)) | ||
19 | |||
20 | #define IPL_MAX_SUPPORTED_VERSION (0) | ||
21 | |||
22 | #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \ | ||
23 | IPL_PARMBLOCK_ORIGIN) | ||
24 | #define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len) | ||
25 | |||
26 | struct ipl_list_hdr { | ||
27 | u32 len; | ||
28 | u8 reserved1[3]; | ||
29 | u8 version; | ||
30 | u32 blk0_len; | ||
31 | u8 pbt; | ||
32 | u8 flags; | ||
33 | u16 reserved2; | ||
34 | } __attribute__((packed)); | ||
35 | |||
36 | struct ipl_block_fcp { | ||
37 | u8 reserved1[313-1]; | ||
38 | u8 opt; | ||
39 | u8 reserved2[3]; | ||
40 | u16 reserved3; | ||
41 | u16 devno; | ||
42 | u8 reserved4[4]; | ||
43 | u64 wwpn; | ||
44 | u64 lun; | ||
45 | u32 bootprog; | ||
46 | u8 reserved5[12]; | ||
47 | u64 br_lba; | ||
48 | u32 scp_data_len; | ||
49 | u8 reserved6[260]; | ||
50 | u8 scp_data[]; | ||
51 | } __attribute__((packed)); | ||
52 | |||
53 | struct ipl_block_ccw { | ||
54 | u8 load_param[8]; | ||
55 | u8 reserved1[84]; | ||
56 | u8 reserved2[2]; | ||
57 | u16 devno; | ||
58 | u8 vm_flags; | ||
59 | u8 reserved3[3]; | ||
60 | u32 vm_parm_len; | ||
61 | } __attribute__((packed)); | ||
62 | |||
63 | struct ipl_parameter_block { | ||
64 | struct ipl_list_hdr hdr; | ||
65 | union { | ||
66 | struct ipl_block_fcp fcp; | ||
67 | struct ipl_block_ccw ccw; | ||
68 | } ipl_info; | ||
69 | } __attribute__((packed)); | ||
70 | |||
71 | /* | ||
72 | * IPL validity flags and parameters as detected in head.S | ||
73 | */ | ||
74 | extern u32 ipl_flags; | ||
75 | extern u16 ipl_devno; | ||
76 | |||
77 | extern void do_reipl(void); | ||
78 | extern void ipl_save_parameters(void); | ||
79 | |||
80 | enum { | ||
81 | IPL_DEVNO_VALID = 1, | ||
82 | IPL_PARMBLOCK_VALID = 2, | ||
83 | IPL_NSS_VALID = 4, | ||
84 | }; | ||
85 | |||
86 | /* | ||
87 | * DIAG 308 support | ||
88 | */ | ||
89 | enum diag308_subcode { | ||
90 | DIAG308_REL_HSA = 2, | ||
91 | DIAG308_IPL = 3, | ||
92 | DIAG308_DUMP = 4, | ||
93 | DIAG308_SET = 5, | ||
94 | DIAG308_STORE = 6, | ||
95 | }; | ||
96 | |||
97 | enum diag308_ipl_type { | ||
98 | DIAG308_IPL_TYPE_FCP = 0, | ||
99 | DIAG308_IPL_TYPE_CCW = 2, | ||
100 | }; | ||
101 | |||
102 | enum diag308_opt { | ||
103 | DIAG308_IPL_OPT_IPL = 0x10, | ||
104 | DIAG308_IPL_OPT_DUMP = 0x20, | ||
105 | }; | ||
106 | |||
107 | enum diag308_rc { | ||
108 | DIAG308_RC_OK = 1, | ||
109 | }; | ||
110 | |||
111 | extern int diag308(unsigned long subcode, void *addr); | ||
112 | |||
113 | #endif /* _ASM_S390_IPL_H */ | ||
diff --git a/include/asm-s390/local.h b/include/asm-s390/local.h index 86745a1b29bb..c11c530f74d0 100644 --- a/include/asm-s390/local.h +++ b/include/asm-s390/local.h | |||
@@ -1,58 +1 @@ | |||
1 | #ifndef _ASM_LOCAL_H | #include <asm-generic/local.h> | |
2 | #define _ASM_LOCAL_H | ||
3 | |||
4 | #include <linux/percpu.h> | ||
5 | #include <asm/atomic.h> | ||
6 | |||
7 | #ifndef __s390x__ | ||
8 | |||
9 | typedef atomic_t local_t; | ||
10 | |||
11 | #define LOCAL_INIT(i) ATOMIC_INIT(i) | ||
12 | #define local_read(v) atomic_read(v) | ||
13 | #define local_set(v,i) atomic_set(v,i) | ||
14 | |||
15 | #define local_inc(v) atomic_inc(v) | ||
16 | #define local_dec(v) atomic_dec(v) | ||
17 | #define local_add(i, v) atomic_add(i, v) | ||
18 | #define local_sub(i, v) atomic_sub(i, v) | ||
19 | |||
20 | #else | ||
21 | |||
22 | typedef atomic64_t local_t; | ||
23 | |||
24 | #define LOCAL_INIT(i) ATOMIC64_INIT(i) | ||
25 | #define local_read(v) atomic64_read(v) | ||
26 | #define local_set(v,i) atomic64_set(v,i) | ||
27 | |||
28 | #define local_inc(v) atomic64_inc(v) | ||
29 | #define local_dec(v) atomic64_dec(v) | ||
30 | #define local_add(i, v) atomic64_add(i, v) | ||
31 | #define local_sub(i, v) atomic64_sub(i, v) | ||
32 | |||
33 | #endif | ||
34 | |||
35 | #define __local_inc(v) ((v)->counter++) | ||
36 | #define __local_dec(v) ((v)->counter--) | ||
37 | #define __local_add(i,v) ((v)->counter+=(i)) | ||
38 | #define __local_sub(i,v) ((v)->counter-=(i)) | ||
39 | |||
40 | /* | ||
41 | * Use these for per-cpu local_t variables: on some archs they are | ||
42 | * much more efficient than these naive implementations. Note they take | ||
43 | * a variable, not an address. | ||
44 | */ | ||
45 | #define cpu_local_read(v) local_read(&__get_cpu_var(v)) | ||
46 | #define cpu_local_set(v, i) local_set(&__get_cpu_var(v), (i)) | ||
47 | |||
48 | #define cpu_local_inc(v) local_inc(&__get_cpu_var(v)) | ||
49 | #define cpu_local_dec(v) local_dec(&__get_cpu_var(v)) | ||
50 | #define cpu_local_add(i, v) local_add((i), &__get_cpu_var(v)) | ||
51 | #define cpu_local_sub(i, v) local_sub((i), &__get_cpu_var(v)) | ||
52 | |||
53 | #define __cpu_local_inc(v) __local_inc(&__get_cpu_var(v)) | ||
54 | #define __cpu_local_dec(v) __local_dec(&__get_cpu_var(v)) | ||
55 | #define __cpu_local_add(i, v) __local_add((i), &__get_cpu_var(v)) | ||
56 | #define __cpu_local_sub(i, v) __local_sub((i), &__get_cpu_var(v)) | ||
57 | |||
58 | #endif /* _ASM_LOCAL_H */ | ||
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index 4c1b73940351..33b80ced4bc1 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h | |||
@@ -36,6 +36,11 @@ typedef struct | |||
36 | unsigned int unused : 16; | 36 | unsigned int unused : 16; |
37 | } __attribute__ ((packed)) cpuid_t; | 37 | } __attribute__ ((packed)) cpuid_t; |
38 | 38 | ||
39 | static inline void get_cpu_id(cpuid_t *ptr) | ||
40 | { | ||
41 | asm volatile("stidp 0(%1)" : "=m" (*ptr) : "a" (ptr)); | ||
42 | } | ||
43 | |||
39 | struct cpuinfo_S390 | 44 | struct cpuinfo_S390 |
40 | { | 45 | { |
41 | cpuid_t cpu_id; | 46 | cpuid_t cpu_id; |
diff --git a/include/asm-s390/sections.h b/include/asm-s390/sections.h index 1c5a2c4ccdad..fbd9116eb17b 100644 --- a/include/asm-s390/sections.h +++ b/include/asm-s390/sections.h | |||
@@ -3,6 +3,6 @@ | |||
3 | 3 | ||
4 | #include <asm-generic/sections.h> | 4 | #include <asm-generic/sections.h> |
5 | 5 | ||
6 | extern char _eshared[]; | 6 | extern char _eshared[], _ehead[]; |
7 | 7 | ||
8 | #endif | 8 | #endif |
diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h index 3388bb52597c..44c7aee2bd34 100644 --- a/include/asm-s390/setup.h +++ b/include/asm-s390/setup.h | |||
@@ -16,7 +16,6 @@ | |||
16 | 16 | ||
17 | #define PARMAREA 0x10400 | 17 | #define PARMAREA 0x10400 |
18 | #define MEMORY_CHUNKS 16 /* max 0x7fff */ | 18 | #define MEMORY_CHUNKS 16 /* max 0x7fff */ |
19 | #define IPL_PARMBLOCK_ORIGIN 0x2000 | ||
20 | 19 | ||
21 | #ifndef __ASSEMBLY__ | 20 | #ifndef __ASSEMBLY__ |
22 | 21 | ||
@@ -97,82 +96,9 @@ extern char vmpoff_cmd[]; | |||
97 | #define SET_CONSOLE_3215 do { console_mode = 2; } while (0) | 96 | #define SET_CONSOLE_3215 do { console_mode = 2; } while (0) |
98 | #define SET_CONSOLE_3270 do { console_mode = 3; } while (0) | 97 | #define SET_CONSOLE_3270 do { console_mode = 3; } while (0) |
99 | 98 | ||
100 | struct ipl_list_hdr { | ||
101 | u32 len; | ||
102 | u8 reserved1[3]; | ||
103 | u8 version; | ||
104 | u32 blk0_len; | ||
105 | u8 pbt; | ||
106 | u8 flags; | ||
107 | u16 reserved2; | ||
108 | } __attribute__((packed)); | ||
109 | |||
110 | struct ipl_block_fcp { | ||
111 | u8 reserved1[313-1]; | ||
112 | u8 opt; | ||
113 | u8 reserved2[3]; | ||
114 | u16 reserved3; | ||
115 | u16 devno; | ||
116 | u8 reserved4[4]; | ||
117 | u64 wwpn; | ||
118 | u64 lun; | ||
119 | u32 bootprog; | ||
120 | u8 reserved5[12]; | ||
121 | u64 br_lba; | ||
122 | u32 scp_data_len; | ||
123 | u8 reserved6[260]; | ||
124 | u8 scp_data[]; | ||
125 | } __attribute__((packed)); | ||
126 | |||
127 | struct ipl_block_ccw { | ||
128 | u8 load_param[8]; | ||
129 | u8 reserved1[84]; | ||
130 | u8 reserved2[2]; | ||
131 | u16 devno; | ||
132 | u8 vm_flags; | ||
133 | u8 reserved3[3]; | ||
134 | u32 vm_parm_len; | ||
135 | } __attribute__((packed)); | ||
136 | |||
137 | struct ipl_parameter_block { | ||
138 | struct ipl_list_hdr hdr; | ||
139 | union { | ||
140 | struct ipl_block_fcp fcp; | ||
141 | struct ipl_block_ccw ccw; | ||
142 | } ipl_info; | ||
143 | } __attribute__((packed)); | ||
144 | |||
145 | #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \ | ||
146 | sizeof(struct ipl_block_fcp)) | ||
147 | |||
148 | #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \ | ||
149 | sizeof(struct ipl_block_ccw)) | ||
150 | |||
151 | #define IPL_MAX_SUPPORTED_VERSION (0) | ||
152 | |||
153 | /* | ||
154 | * IPL validity flags and parameters as detected in head.S | ||
155 | */ | ||
156 | extern u32 ipl_flags; | ||
157 | extern u16 ipl_devno; | ||
158 | |||
159 | extern void do_reipl(void); | ||
160 | extern void ipl_save_parameters(void); | ||
161 | |||
162 | enum { | ||
163 | IPL_DEVNO_VALID = 1, | ||
164 | IPL_PARMBLOCK_VALID = 2, | ||
165 | IPL_NSS_VALID = 4, | ||
166 | }; | ||
167 | |||
168 | #define NSS_NAME_SIZE 8 | 99 | #define NSS_NAME_SIZE 8 |
169 | |||
170 | extern char kernel_nss_name[]; | 100 | extern char kernel_nss_name[]; |
171 | 101 | ||
172 | #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \ | ||
173 | IPL_PARMBLOCK_ORIGIN) | ||
174 | #define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len) | ||
175 | |||
176 | #else /* __ASSEMBLY__ */ | 102 | #else /* __ASSEMBLY__ */ |
177 | 103 | ||
178 | #ifndef __s390x__ | 104 | #ifndef __s390x__ |
diff --git a/include/asm-sh/Kbuild b/include/asm-sh/Kbuild index c68e1680da01..76a8ccf254a5 100644 --- a/include/asm-sh/Kbuild +++ b/include/asm-sh/Kbuild | |||
@@ -1 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | |||
3 | header-y += cpu-features.h | ||
diff --git a/include/asm-sh/bigsur/bigsur.h b/include/asm-sh/bigsur/bigsur.h deleted file mode 100644 index 427245f93589..000000000000 --- a/include/asm-sh/bigsur/bigsur.h +++ /dev/null | |||
@@ -1,80 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * Hitachi Big Sur Eval Board support | ||
4 | * | ||
5 | * Dustin McIntire (dustin@sensoria.com) | ||
6 | * | ||
7 | * May be copied or modified under the terms of the GNU General Public | ||
8 | * License. See linux/COPYING for more information. | ||
9 | * | ||
10 | * Derived from Hitachi SH7751 reference manual | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef _ASM_BIGSUR_H_ | ||
15 | #define _ASM_BIGSUR_H_ | ||
16 | |||
17 | #include <asm/irq.h> | ||
18 | #include <asm/hd64465/hd64465.h> | ||
19 | |||
20 | /* 7751 Internal IRQ's used by external CPLD controller */ | ||
21 | #define BIGSUR_IRQ_LOW 0 | ||
22 | #define BIGSUR_IRQ_NUM 14 /* External CPLD level 1 IRQs */ | ||
23 | #define BIGSUR_IRQ_HIGH (BIGSUR_IRQ_LOW + BIGSUR_IRQ_NUM) | ||
24 | #define BIGSUR_2NDLVL_IRQ_LOW (HD64465_IRQ_BASE+HD64465_IRQ_NUM) | ||
25 | #define BIGSUR_2NDLVL_IRQ_NUM 32 /* Level 2 IRQs = 4 regs * 8 bits */ | ||
26 | #define BIGSUR_2NDLVL_IRQ_HIGH (BIGSUR_2NDLVL_IRQ_LOW + \ | ||
27 | BIGSUR_2NDLVL_IRQ_NUM) | ||
28 | |||
29 | /* PCI interrupt base number (A_INTA-A_INTD) */ | ||
30 | #define BIGSUR_SH7751_PCI_IRQ_BASE (BIGSUR_2NDLVL_IRQ_LOW+10) | ||
31 | |||
32 | /* CPLD registers and external chip addresses */ | ||
33 | #define BIGSUR_HD64464_ADDR 0xB2000000 | ||
34 | #define BIGSUR_DGDR 0xB1FFFE00 | ||
35 | #define BIGSUR_BIDR 0xB1FFFD00 | ||
36 | #define BIGSUR_CSLR 0xB1FFFC00 | ||
37 | #define BIGSUR_SW1R 0xB1FFFB00 | ||
38 | #define BIGSUR_DBGR 0xB1FFFA00 | ||
39 | #define BIGSUR_BDTR 0xB1FFF900 | ||
40 | #define BIGSUR_BDRR 0xB1FFF800 | ||
41 | #define BIGSUR_PPR1 0xB1FFF700 | ||
42 | #define BIGSUR_PPR2 0xB1FFF600 | ||
43 | #define BIGSUR_IDE2 0xB1FFF500 | ||
44 | #define BIGSUR_IDE3 0xB1FFF400 | ||
45 | #define BIGSUR_SPCR 0xB1FFF300 | ||
46 | #define BIGSUR_ETHR 0xB1FE0000 | ||
47 | #define BIGSUR_PPDR 0xB1FDFF00 | ||
48 | #define BIGSUR_ICTL 0xB1FDFE00 | ||
49 | #define BIGSUR_ICMD 0xB1FDFD00 | ||
50 | #define BIGSUR_DMA0 0xB1FDFC00 | ||
51 | #define BIGSUR_DMA1 0xB1FDFB00 | ||
52 | #define BIGSUR_IRQ0 0xB1FDFA00 | ||
53 | #define BIGSUR_IRQ1 0xB1FDF900 | ||
54 | #define BIGSUR_IRQ2 0xB1FDF800 | ||
55 | #define BIGSUR_IRQ3 0xB1FDF700 | ||
56 | #define BIGSUR_IMR0 0xB1FDF600 | ||
57 | #define BIGSUR_IMR1 0xB1FDF500 | ||
58 | #define BIGSUR_IMR2 0xB1FDF400 | ||
59 | #define BIGSUR_IMR3 0xB1FDF300 | ||
60 | #define BIGSUR_IRLMR0 0xB1FDF200 | ||
61 | #define BIGSUR_IRLMR1 0xB1FDF100 | ||
62 | #define BIGSUR_V320USC_ADDR 0xB1000000 | ||
63 | #define BIGSUR_HD64465_ADDR 0xB0000000 | ||
64 | #define BIGSUR_INTERNAL_BASE 0xB0000000 | ||
65 | |||
66 | /* SMC ethernet card parameters */ | ||
67 | #define BIGSUR_ETHER_IOPORT 0x220 | ||
68 | |||
69 | /* IDE register paramters */ | ||
70 | #define BIGSUR_IDECMD_IOPORT 0x1f0 | ||
71 | #define BIGSUR_IDECTL_IOPORT 0x1f8 | ||
72 | |||
73 | /* LED bit position in BIGSUR_CSLR */ | ||
74 | #define BIGSUR_LED (1<<4) | ||
75 | |||
76 | /* PCI: default LOCAL memory window sizes (seen from PCI bus) */ | ||
77 | #define BIGSUR_LSR0_SIZE (64*(1<<20)) //64MB | ||
78 | #define BIGSUR_LSR1_SIZE (64*(1<<20)) //64MB | ||
79 | |||
80 | #endif /* _ASM_BIGSUR_H_ */ | ||
diff --git a/include/asm-sh/bigsur/io.h b/include/asm-sh/bigsur/io.h deleted file mode 100644 index 1470ac8d4a39..000000000000 --- a/include/asm-sh/bigsur/io.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-sh/bigsur/io.h | ||
3 | * | ||
4 | * By Dustin McIntire (dustin@sensoria.com) (c)2001 | ||
5 | * Derived from io_hd64465.h, which bore the message: | ||
6 | * By Greg Banks <gbanks@pocketpenguins.com> | ||
7 | * (c) 2000 PocketPenguins Inc. | ||
8 | * and from io_hd64461.h, which bore the message: | ||
9 | * Copyright 2000 Stuart Menefy (stuart.menefy@st.com) | ||
10 | * | ||
11 | * May be copied or modified under the terms of the GNU General Public | ||
12 | * License. See linux/COPYING for more information. | ||
13 | * | ||
14 | * IO functions for a Hitachi Big Sur Evaluation Board. | ||
15 | */ | ||
16 | |||
17 | #ifndef _ASM_SH_IO_BIGSUR_H | ||
18 | #define _ASM_SH_IO_BIGSUR_H | ||
19 | |||
20 | #include <linux/types.h> | ||
21 | |||
22 | extern unsigned long bigsur_isa_port2addr(unsigned long offset); | ||
23 | extern int bigsur_irq_demux(int irq); | ||
24 | /* Provision for generic secondary demux step -- used by PCMCIA code */ | ||
25 | extern void bigsur_register_irq_demux(int irq, | ||
26 | int (*demux)(int irq, void *dev), void *dev); | ||
27 | extern void bigsur_unregister_irq_demux(int irq); | ||
28 | /* Set this variable to 1 to see port traffic */ | ||
29 | extern int bigsur_io_debug; | ||
30 | /* Map a range of ports to a range of kernel virtual memory. */ | ||
31 | extern void bigsur_port_map(u32 baseport, u32 nports, u32 addr, u8 shift); | ||
32 | extern void bigsur_port_unmap(u32 baseport, u32 nports); | ||
33 | |||
34 | #endif /* _ASM_SH_IO_BIGSUR_H */ | ||
35 | |||
diff --git a/include/asm-sh/bigsur/serial.h b/include/asm-sh/bigsur/serial.h deleted file mode 100644 index a08fa82fe45a..000000000000 --- a/include/asm-sh/bigsur/serial.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-sh/bigsur/serial.h | ||
3 | * | ||
4 | * Configuration details for Big Sur 16550 based serial ports | ||
5 | * i.e. HD64465, PCMCIA, etc. | ||
6 | */ | ||
7 | |||
8 | #ifndef _ASM_SERIAL_BIGSUR_H | ||
9 | #define _ASM_SERIAL_BIGSUR_H | ||
10 | #include <asm/hd64465.h> | ||
11 | |||
12 | #define BASE_BAUD (3379200 / 16) | ||
13 | |||
14 | #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) | ||
15 | |||
16 | |||
17 | #define SERIAL_PORT_DFNS \ | ||
18 | /* UART CLK PORT IRQ FLAGS */ \ | ||
19 | { 0, BASE_BAUD, 0x3F8, HD64465_IRQ_UART, STD_COM_FLAGS } /* ttyS0 */ | ||
20 | |||
21 | /* XXX: This should be moved ino irq.h */ | ||
22 | #define irq_cannonicalize(x) (x) | ||
23 | |||
24 | #endif /* _ASM_SERIAL_BIGSUR_H */ | ||
diff --git a/include/asm-sh/bugs.h b/include/asm-sh/bugs.h index a294997a8412..5a117ec43c77 100644 --- a/include/asm-sh/bugs.h +++ b/include/asm-sh/bugs.h | |||
@@ -19,9 +19,9 @@ static void __init check_bugs(void) | |||
19 | extern unsigned long loops_per_jiffy; | 19 | extern unsigned long loops_per_jiffy; |
20 | char *p = &init_utsname()->machine[2]; /* "sh" */ | 20 | char *p = &init_utsname()->machine[2]; /* "sh" */ |
21 | 21 | ||
22 | cpu_data->loops_per_jiffy = loops_per_jiffy; | 22 | current_cpu_data.loops_per_jiffy = loops_per_jiffy; |
23 | 23 | ||
24 | switch (cpu_data->type) { | 24 | switch (current_cpu_data.type) { |
25 | case CPU_SH7604 ... CPU_SH7619: | 25 | case CPU_SH7604 ... CPU_SH7619: |
26 | *p++ = '2'; | 26 | *p++ = '2'; |
27 | break; | 27 | break; |
@@ -54,7 +54,7 @@ static void __init check_bugs(void) | |||
54 | break; | 54 | break; |
55 | } | 55 | } |
56 | 56 | ||
57 | printk("CPU: %s\n", get_cpu_subtype()); | 57 | printk("CPU: %s\n", get_cpu_subtype(¤t_cpu_data)); |
58 | 58 | ||
59 | #ifndef __LITTLE_ENDIAN__ | 59 | #ifndef __LITTLE_ENDIAN__ |
60 | /* 'eb' means 'Endian Big' */ | 60 | /* 'eb' means 'Endian Big' */ |
diff --git a/include/asm-sh/cacheflush.h b/include/asm-sh/cacheflush.h index 07f62ec9ff0c..22f12634975b 100644 --- a/include/asm-sh/cacheflush.h +++ b/include/asm-sh/cacheflush.h | |||
@@ -30,5 +30,8 @@ extern void __flush_invalidate_region(void *start, int size); | |||
30 | 30 | ||
31 | #define HAVE_ARCH_UNMAPPED_AREA | 31 | #define HAVE_ARCH_UNMAPPED_AREA |
32 | 32 | ||
33 | /* Page flag for lazy dcache write-back for the aliasing UP caches */ | ||
34 | #define PG_dcache_dirty PG_arch_1 | ||
35 | |||
33 | #endif /* __KERNEL__ */ | 36 | #endif /* __KERNEL__ */ |
34 | #endif /* __ASM_SH_CACHEFLUSH_H */ | 37 | #endif /* __ASM_SH_CACHEFLUSH_H */ |
diff --git a/include/asm-sh/cpu-sh3/cacheflush.h b/include/asm-sh/cpu-sh3/cacheflush.h index f70d8ef76a15..6fabbba228de 100644 --- a/include/asm-sh/cpu-sh3/cacheflush.h +++ b/include/asm-sh/cpu-sh3/cacheflush.h | |||
@@ -36,8 +36,6 @@ | |||
36 | /* 32KB cache, 4kb PAGE sizes need to check bit 12 */ | 36 | /* 32KB cache, 4kb PAGE sizes need to check bit 12 */ |
37 | #define CACHE_ALIAS 0x00001000 | 37 | #define CACHE_ALIAS 0x00001000 |
38 | 38 | ||
39 | #define PG_mapped PG_arch_1 | ||
40 | |||
41 | void flush_cache_all(void); | 39 | void flush_cache_all(void); |
42 | void flush_cache_mm(struct mm_struct *mm); | 40 | void flush_cache_mm(struct mm_struct *mm); |
43 | #define flush_cache_dup_mm(mm) flush_cache_mm(mm) | 41 | #define flush_cache_dup_mm(mm) flush_cache_mm(mm) |
diff --git a/include/asm-sh/cpu-sh4/cacheflush.h b/include/asm-sh/cpu-sh4/cacheflush.h index b01a10f31225..b3746a936a09 100644 --- a/include/asm-sh/cpu-sh4/cacheflush.h +++ b/include/asm-sh/cpu-sh4/cacheflush.h | |||
@@ -17,6 +17,7 @@ | |||
17 | * so we need them. | 17 | * so we need them. |
18 | */ | 18 | */ |
19 | void flush_cache_all(void); | 19 | void flush_cache_all(void); |
20 | void flush_dcache_all(void); | ||
20 | void flush_cache_mm(struct mm_struct *mm); | 21 | void flush_cache_mm(struct mm_struct *mm); |
21 | #define flush_cache_dup_mm(mm) flush_cache_mm(mm) | 22 | #define flush_cache_dup_mm(mm) flush_cache_mm(mm) |
22 | void flush_cache_range(struct vm_area_struct *vma, unsigned long start, | 23 | void flush_cache_range(struct vm_area_struct *vma, unsigned long start, |
@@ -38,16 +39,4 @@ void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, | |||
38 | /* Initialization of P3 area for copy_user_page */ | 39 | /* Initialization of P3 area for copy_user_page */ |
39 | void p3_cache_init(void); | 40 | void p3_cache_init(void); |
40 | 41 | ||
41 | #define PG_mapped PG_arch_1 | ||
42 | |||
43 | #ifdef CONFIG_MMU | ||
44 | extern int remap_area_pages(unsigned long addr, unsigned long phys_addr, | ||
45 | unsigned long size, unsigned long flags); | ||
46 | #else /* CONFIG_MMU */ | ||
47 | static inline int remap_area_pages(unsigned long addr, unsigned long phys_addr, | ||
48 | unsigned long size, unsigned long flags) | ||
49 | { | ||
50 | return 0; | ||
51 | } | ||
52 | #endif /* CONFIG_MMU */ | ||
53 | #endif /* __ASM_CPU_SH4_CACHEFLUSH_H */ | 42 | #endif /* __ASM_CPU_SH4_CACHEFLUSH_H */ |
diff --git a/include/asm-sh/cpu-sh4/dma.h b/include/asm-sh/cpu-sh4/dma.h index 3e4b3e6d80c0..c135e9cebd9c 100644 --- a/include/asm-sh/cpu-sh4/dma.h +++ b/include/asm-sh/cpu-sh4/dma.h | |||
@@ -3,6 +3,17 @@ | |||
3 | 3 | ||
4 | #define DMAOR_INIT ( 0x8000 | DMAOR_DME ) | 4 | #define DMAOR_INIT ( 0x8000 | DMAOR_DME ) |
5 | 5 | ||
6 | /* SH7751/7760/7780 DMA IRQ sources */ | ||
7 | #define DMTE0_IRQ 34 | ||
8 | #define DMTE1_IRQ 35 | ||
9 | #define DMTE2_IRQ 36 | ||
10 | #define DMTE3_IRQ 37 | ||
11 | #define DMTE4_IRQ 44 | ||
12 | #define DMTE5_IRQ 45 | ||
13 | #define DMTE6_IRQ 46 | ||
14 | #define DMTE7_IRQ 47 | ||
15 | #define DMAE_IRQ 38 | ||
16 | |||
6 | #ifdef CONFIG_CPU_SH4A | 17 | #ifdef CONFIG_CPU_SH4A |
7 | #define SH_DMAC_BASE 0xfc808020 | 18 | #define SH_DMAC_BASE 0xfc808020 |
8 | 19 | ||
diff --git a/include/asm-sh/dma-mapping.h b/include/asm-sh/dma-mapping.h index 8d0867b98e05..d3bc7818bbbe 100644 --- a/include/asm-sh/dma-mapping.h +++ b/include/asm-sh/dma-mapping.h | |||
@@ -53,6 +53,10 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
53 | consistent_free(vaddr, size); | 53 | consistent_free(vaddr, size); |
54 | } | 54 | } |
55 | 55 | ||
56 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | ||
57 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | ||
58 | #define dma_is_consistent(d, h) (1) | ||
59 | |||
56 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 60 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
57 | enum dma_data_direction dir) | 61 | enum dma_data_direction dir) |
58 | { | 62 | { |
diff --git a/include/asm-sh/ec3104/ec3104.h b/include/asm-sh/ec3104/ec3104.h deleted file mode 100644 index 639cfa489c8f..000000000000 --- a/include/asm-sh/ec3104/ec3104.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | #ifndef __ASM_EC3104_H | ||
2 | #define __ASM_EC3104_H | ||
3 | |||
4 | |||
5 | /* | ||
6 | * Most of the register set is at 0xb0ec0000 - 0xb0ecffff. | ||
7 | * | ||
8 | * as far as I've figured it out the register map is: | ||
9 | * 0xb0ec0000 - id string | ||
10 | * 0xb0ec0XXX - power management | ||
11 | * 0xb0ec1XXX - interrupt control | ||
12 | * 0xb0ec3XXX - ps2 port (touch pad on aero 8000) | ||
13 | * 0xb0ec6XXX - i2c | ||
14 | * 0xb0ec7000 - first serial port (proprietary connector on aero 8000) | ||
15 | * 0xb0ec8000 - second serial port | ||
16 | * 0xb0ec9000 - third serial port | ||
17 | * 0xb0eca000 - fourth serial port (keyboard controller on aero 8000) | ||
18 | * 0xb0eccXXX - GPIO | ||
19 | * 0xb0ecdXXX - GPIO | ||
20 | */ | ||
21 | |||
22 | #define EC3104_BASE 0xb0ec0000 | ||
23 | |||
24 | #define EC3104_SER4_DATA (EC3104_BASE+0xa000) | ||
25 | #define EC3104_SER4_IIR (EC3104_BASE+0xa008) | ||
26 | #define EC3104_SER4_MCR (EC3104_BASE+0xa010) | ||
27 | #define EC3104_SER4_LSR (EC3104_BASE+0xa014) | ||
28 | #define EC3104_SER4_MSR (EC3104_BASE+0xa018) | ||
29 | |||
30 | /* | ||
31 | * our ISA bus. this seems to be real ISA. | ||
32 | */ | ||
33 | #define EC3104_ISA_BASE 0xa5000000 | ||
34 | |||
35 | #define EC3104_IRQ 11 | ||
36 | #define EC3104_IRQBASE 64 | ||
37 | |||
38 | #define EC3104_IRQ_SER1 EC3104_IRQBASE + 7 | ||
39 | #define EC3104_IRQ_SER2 EC3104_IRQBASE + 8 | ||
40 | #define EC3104_IRQ_SER3 EC3104_IRQBASE + 9 | ||
41 | #define EC3104_IRQ_SER4 EC3104_IRQBASE + 10 | ||
42 | |||
43 | #endif /* __ASM_EC3104_H */ | ||
diff --git a/include/asm-sh/ec3104/io.h b/include/asm-sh/ec3104/io.h deleted file mode 100644 index ea5c8e65ac11..000000000000 --- a/include/asm-sh/ec3104/io.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | #ifndef _ASM_SH_IO_EC3104_H | ||
2 | #define _ASM_SH_IO_EC3104_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | extern unsigned char ec3104_inb(unsigned long port); | ||
7 | extern unsigned short ec3104_inw(unsigned long port); | ||
8 | extern unsigned long ec3104_inl(unsigned long port); | ||
9 | |||
10 | extern void ec3104_outb(unsigned char value, unsigned long port); | ||
11 | extern void ec3104_outw(unsigned short value, unsigned long port); | ||
12 | extern void ec3104_outl(unsigned long value, unsigned long port); | ||
13 | |||
14 | extern int ec3104_irq_demux(int irq); | ||
15 | |||
16 | #endif /* _ASM_SH_IO_EC3104_H */ | ||
diff --git a/include/asm-sh/ec3104/keyboard.h b/include/asm-sh/ec3104/keyboard.h deleted file mode 100644 index c1253a683197..000000000000 --- a/include/asm-sh/ec3104/keyboard.h +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | extern unsigned char ec3104_kbd_sysrq_xlate[]; | ||
2 | extern int ec3104_kbd_setkeycode(unsigned int scancode, unsigned int keycode); | ||
3 | extern int ec3104_kbd_getkeycode(unsigned int scancode); | ||
4 | extern int ec3104_kbd_translate(unsigned char, unsigned char *, char); | ||
5 | extern char ec3104_kbd_unexpected_up(unsigned char); | ||
6 | extern void ec3104_kbd_leds(unsigned char); | ||
7 | extern void ec3104_kbd_init_hw(void); | ||
8 | |||
9 | #define kbd_sysrq_xlate ec3104_kbd_sysrq_xlate | ||
10 | #define kbd_setkeycode ec3104_kbd_setkeycode | ||
11 | #define kbd_getkeycode ec3104_kbd_getkeycode | ||
12 | #define kbd_translate ec3104_kbd_translate | ||
13 | #define kbd_unexpected_up ec3104_kbd_unexpected_up | ||
14 | #define kbd_leds ec3104_kbd_leds | ||
15 | #define kbd_init_hw ec3104_kbd_init_hw | ||
diff --git a/include/asm-sh/ec3104/serial.h b/include/asm-sh/ec3104/serial.h deleted file mode 100644 index cfe4d78ec1ee..000000000000 --- a/include/asm-sh/ec3104/serial.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #include <asm/ec3104.h> | ||
2 | /* Naturally we don't know the exact value but 115200 baud has a divisor | ||
3 | * of 9 and 19200 baud has a divisor of 52, so this seems like a good | ||
4 | * guess. */ | ||
5 | #define BASE_BAUD (16800000 / 16) | ||
6 | |||
7 | #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) | ||
8 | |||
9 | /* there is a fourth serial port with the expected values as well, but | ||
10 | * it's got the keyboard controller behind it so we can't really use it | ||
11 | * (without moving the keyboard driver to userspace, which doesn't sound | ||
12 | * like a very good idea) */ | ||
13 | #define SERIAL_PORT_DFNS \ | ||
14 | /* UART CLK PORT IRQ FLAGS */ \ | ||
15 | { 0, BASE_BAUD, 0x11C00, EC3104_IRQBASE+7, STD_COM_FLAGS }, /* ttyS0 */ \ | ||
16 | { 0, BASE_BAUD, 0x12000, EC3104_IRQBASE+8, STD_COM_FLAGS }, /* ttyS1 */ \ | ||
17 | { 0, BASE_BAUD, 0x12400, EC3104_IRQBASE+9, STD_COM_FLAGS }, /* ttyS2 */ | ||
18 | |||
19 | /* XXX: This should be moved ino irq.h */ | ||
20 | #define irq_cannonicalize(x) (x) | ||
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h index bff965ef4b95..8ccf7ae593ef 100644 --- a/include/asm-sh/irq.h +++ b/include/asm-sh/irq.h | |||
@@ -66,12 +66,8 @@ | |||
66 | /* 3. OFFCHIP_NR_IRQS */ | 66 | /* 3. OFFCHIP_NR_IRQS */ |
67 | #if defined(CONFIG_HD64461) | 67 | #if defined(CONFIG_HD64461) |
68 | # define OFFCHIP_NR_IRQS 18 | 68 | # define OFFCHIP_NR_IRQS 18 |
69 | #elif defined (CONFIG_SH_BIGSUR) /* must be before CONFIG_HD64465 */ | ||
70 | # define OFFCHIP_NR_IRQS 48 | ||
71 | #elif defined(CONFIG_HD64465) | 69 | #elif defined(CONFIG_HD64465) |
72 | # define OFFCHIP_NR_IRQS 16 | 70 | # define OFFCHIP_NR_IRQS 16 |
73 | #elif defined (CONFIG_SH_EC3104) | ||
74 | # define OFFCHIP_NR_IRQS 16 | ||
75 | #elif defined (CONFIG_SH_DREAMCAST) | 71 | #elif defined (CONFIG_SH_DREAMCAST) |
76 | # define OFFCHIP_NR_IRQS 96 | 72 | # define OFFCHIP_NR_IRQS 96 |
77 | #elif defined (CONFIG_SH_TITAN) | 73 | #elif defined (CONFIG_SH_TITAN) |
diff --git a/include/asm-sh/kgdb.h b/include/asm-sh/kgdb.h index 7b26f53fe343..0095c665d272 100644 --- a/include/asm-sh/kgdb.h +++ b/include/asm-sh/kgdb.h | |||
@@ -85,10 +85,10 @@ extern int setjmp(jmp_buf __jmpb); | |||
85 | #define KGDB_PRINTK(...) printk("KGDB: " __VA_ARGS__) | 85 | #define KGDB_PRINTK(...) printk("KGDB: " __VA_ARGS__) |
86 | 86 | ||
87 | /* Forced breakpoint */ | 87 | /* Forced breakpoint */ |
88 | #define BREAKPOINT() do { \ | 88 | #define BREAKPOINT() \ |
89 | if (kgdb_enabled) { \ | 89 | do { \ |
90 | asm volatile("trapa #0xff"); \ | 90 | if (kgdb_enabled) \ |
91 | } \ | 91 | __asm__ __volatile__("trapa #0x3c"); \ |
92 | } while (0) | 92 | } while (0) |
93 | 93 | ||
94 | /* KGDB should be able to flush all kernel text space */ | 94 | /* KGDB should be able to flush all kernel text space */ |
diff --git a/include/asm-sh/mmu.h b/include/asm-sh/mmu.h index cf47df79bb94..eb0358c097d0 100644 --- a/include/asm-sh/mmu.h +++ b/include/asm-sh/mmu.h | |||
@@ -1,25 +1,19 @@ | |||
1 | #ifndef __MMU_H | 1 | #ifndef __MMU_H |
2 | #define __MMU_H | 2 | #define __MMU_H |
3 | 3 | ||
4 | #if !defined(CONFIG_MMU) | 4 | /* Default "unsigned long" context */ |
5 | typedef unsigned long mm_context_id_t[NR_CPUS]; | ||
5 | 6 | ||
6 | typedef struct { | 7 | typedef struct { |
8 | #ifdef CONFIG_MMU | ||
9 | mm_context_id_t id; | ||
10 | void *vdso; | ||
11 | #else | ||
7 | struct vm_list_struct *vmlist; | 12 | struct vm_list_struct *vmlist; |
8 | unsigned long end_brk; | 13 | unsigned long end_brk; |
14 | #endif | ||
9 | } mm_context_t; | 15 | } mm_context_t; |
10 | 16 | ||
11 | #else | ||
12 | |||
13 | /* Default "unsigned long" context */ | ||
14 | typedef unsigned long mm_context_id_t; | ||
15 | |||
16 | typedef struct { | ||
17 | mm_context_id_t id; | ||
18 | void *vdso; | ||
19 | } mm_context_t; | ||
20 | |||
21 | #endif /* CONFIG_MMU */ | ||
22 | |||
23 | /* | 17 | /* |
24 | * Privileged Space Mapping Buffer (PMB) definitions | 18 | * Privileged Space Mapping Buffer (PMB) definitions |
25 | */ | 19 | */ |
diff --git a/include/asm-sh/mmu_context.h b/include/asm-sh/mmu_context.h index 46f04e23bd45..342024425b7d 100644 --- a/include/asm-sh/mmu_context.h +++ b/include/asm-sh/mmu_context.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 1999 Niibe Yutaka | 2 | * Copyright (C) 1999 Niibe Yutaka |
3 | * Copyright (C) 2003 Paul Mundt | 3 | * Copyright (C) 2003 - 2006 Paul Mundt |
4 | * | 4 | * |
5 | * ASID handling idea taken from MIPS implementation. | 5 | * ASID handling idea taken from MIPS implementation. |
6 | */ | 6 | */ |
@@ -19,11 +19,6 @@ | |||
19 | * (b) ASID (Address Space IDentifier) | 19 | * (b) ASID (Address Space IDentifier) |
20 | */ | 20 | */ |
21 | 21 | ||
22 | /* | ||
23 | * Cache of MMU context last used. | ||
24 | */ | ||
25 | extern unsigned long mmu_context_cache; | ||
26 | |||
27 | #define MMU_CONTEXT_ASID_MASK 0x000000ff | 22 | #define MMU_CONTEXT_ASID_MASK 0x000000ff |
28 | #define MMU_CONTEXT_VERSION_MASK 0xffffff00 | 23 | #define MMU_CONTEXT_VERSION_MASK 0xffffff00 |
29 | #define MMU_CONTEXT_FIRST_VERSION 0x00000100 | 24 | #define MMU_CONTEXT_FIRST_VERSION 0x00000100 |
@@ -32,6 +27,11 @@ extern unsigned long mmu_context_cache; | |||
32 | /* ASID is 8-bit value, so it can't be 0x100 */ | 27 | /* ASID is 8-bit value, so it can't be 0x100 */ |
33 | #define MMU_NO_ASID 0x100 | 28 | #define MMU_NO_ASID 0x100 |
34 | 29 | ||
30 | #define cpu_context(cpu, mm) ((mm)->context.id[cpu]) | ||
31 | #define cpu_asid(cpu, mm) (cpu_context((cpu), (mm)) & \ | ||
32 | MMU_CONTEXT_ASID_MASK) | ||
33 | #define asid_cache(cpu) (cpu_data[cpu].asid_cache) | ||
34 | |||
35 | /* | 35 | /* |
36 | * Virtual Page Number mask | 36 | * Virtual Page Number mask |
37 | */ | 37 | */ |
@@ -41,18 +41,17 @@ extern unsigned long mmu_context_cache; | |||
41 | /* | 41 | /* |
42 | * Get MMU context if needed. | 42 | * Get MMU context if needed. |
43 | */ | 43 | */ |
44 | static inline void get_mmu_context(struct mm_struct *mm) | 44 | static inline void get_mmu_context(struct mm_struct *mm, unsigned int cpu) |
45 | { | 45 | { |
46 | unsigned long mc = mmu_context_cache; | 46 | unsigned long asid = asid_cache(cpu); |
47 | 47 | ||
48 | /* Check if we have old version of context. */ | 48 | /* Check if we have old version of context. */ |
49 | if (((mm->context.id ^ mc) & MMU_CONTEXT_VERSION_MASK) == 0) | 49 | if (((cpu_context(cpu, mm) ^ asid) & MMU_CONTEXT_VERSION_MASK) == 0) |
50 | /* It's up to date, do nothing */ | 50 | /* It's up to date, do nothing */ |
51 | return; | 51 | return; |
52 | 52 | ||
53 | /* It's old, we need to get new context with new version. */ | 53 | /* It's old, we need to get new context with new version. */ |
54 | mc = ++mmu_context_cache; | 54 | if (!(++asid & MMU_CONTEXT_ASID_MASK)) { |
55 | if (!(mc & MMU_CONTEXT_ASID_MASK)) { | ||
56 | /* | 55 | /* |
57 | * We exhaust ASID of this version. | 56 | * We exhaust ASID of this version. |
58 | * Flush all TLB and start new cycle. | 57 | * Flush all TLB and start new cycle. |
@@ -63,10 +62,11 @@ static inline void get_mmu_context(struct mm_struct *mm) | |||
63 | * Fix version; Note that we avoid version #0 | 62 | * Fix version; Note that we avoid version #0 |
64 | * to distingush NO_CONTEXT. | 63 | * to distingush NO_CONTEXT. |
65 | */ | 64 | */ |
66 | if (!mc) | 65 | if (!asid) |
67 | mmu_context_cache = mc = MMU_CONTEXT_FIRST_VERSION; | 66 | asid = MMU_CONTEXT_FIRST_VERSION; |
68 | } | 67 | } |
69 | mm->context.id = mc; | 68 | |
69 | cpu_context(cpu, mm) = asid_cache(cpu) = asid; | ||
70 | } | 70 | } |
71 | 71 | ||
72 | /* | 72 | /* |
@@ -74,9 +74,13 @@ static inline void get_mmu_context(struct mm_struct *mm) | |||
74 | * instance. | 74 | * instance. |
75 | */ | 75 | */ |
76 | static inline int init_new_context(struct task_struct *tsk, | 76 | static inline int init_new_context(struct task_struct *tsk, |
77 | struct mm_struct *mm) | 77 | struct mm_struct *mm) |
78 | { | 78 | { |
79 | mm->context.id = NO_CONTEXT; | 79 | int i; |
80 | |||
81 | for (i = 0; i < num_online_cpus(); i++) | ||
82 | cpu_context(i, mm) = NO_CONTEXT; | ||
83 | |||
80 | return 0; | 84 | return 0; |
81 | } | 85 | } |
82 | 86 | ||
@@ -117,10 +121,10 @@ static inline unsigned long get_asid(void) | |||
117 | * After we have set current->mm to a new value, this activates | 121 | * After we have set current->mm to a new value, this activates |
118 | * the context for the new mm so we see the new mappings. | 122 | * the context for the new mm so we see the new mappings. |
119 | */ | 123 | */ |
120 | static inline void activate_context(struct mm_struct *mm) | 124 | static inline void activate_context(struct mm_struct *mm, unsigned int cpu) |
121 | { | 125 | { |
122 | get_mmu_context(mm); | 126 | get_mmu_context(mm, cpu); |
123 | set_asid(mm->context.id & MMU_CONTEXT_ASID_MASK); | 127 | set_asid(cpu_asid(cpu, mm)); |
124 | } | 128 | } |
125 | 129 | ||
126 | /* MMU_TTB is used for optimizing the fault handling. */ | 130 | /* MMU_TTB is used for optimizing the fault handling. */ |
@@ -138,10 +142,15 @@ static inline void switch_mm(struct mm_struct *prev, | |||
138 | struct mm_struct *next, | 142 | struct mm_struct *next, |
139 | struct task_struct *tsk) | 143 | struct task_struct *tsk) |
140 | { | 144 | { |
145 | unsigned int cpu = smp_processor_id(); | ||
146 | |||
141 | if (likely(prev != next)) { | 147 | if (likely(prev != next)) { |
148 | cpu_set(cpu, next->cpu_vm_mask); | ||
142 | set_TTB(next->pgd); | 149 | set_TTB(next->pgd); |
143 | activate_context(next); | 150 | activate_context(next, cpu); |
144 | } | 151 | } else |
152 | if (!cpu_test_and_set(cpu, next->cpu_vm_mask)) | ||
153 | activate_context(next, cpu); | ||
145 | } | 154 | } |
146 | 155 | ||
147 | #define deactivate_mm(tsk,mm) do { } while (0) | 156 | #define deactivate_mm(tsk,mm) do { } while (0) |
@@ -159,7 +168,7 @@ enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | |||
159 | #define destroy_context(mm) do { } while (0) | 168 | #define destroy_context(mm) do { } while (0) |
160 | #define set_asid(asid) do { } while (0) | 169 | #define set_asid(asid) do { } while (0) |
161 | #define get_asid() (0) | 170 | #define get_asid() (0) |
162 | #define activate_context(mm) do { } while (0) | 171 | #define activate_context(mm,cpu) do { } while (0) |
163 | #define switch_mm(prev,next,tsk) do { } while (0) | 172 | #define switch_mm(prev,next,tsk) do { } while (0) |
164 | #define deactivate_mm(tsk,mm) do { } while (0) | 173 | #define deactivate_mm(tsk,mm) do { } while (0) |
165 | #define activate_mm(prev,next) do { } while (0) | 174 | #define activate_mm(prev,next) do { } while (0) |
@@ -174,14 +183,16 @@ enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | |||
174 | */ | 183 | */ |
175 | static inline void enable_mmu(void) | 184 | static inline void enable_mmu(void) |
176 | { | 185 | { |
186 | unsigned int cpu = smp_processor_id(); | ||
187 | |||
177 | /* Enable MMU */ | 188 | /* Enable MMU */ |
178 | ctrl_outl(MMU_CONTROL_INIT, MMUCR); | 189 | ctrl_outl(MMU_CONTROL_INIT, MMUCR); |
179 | ctrl_barrier(); | 190 | ctrl_barrier(); |
180 | 191 | ||
181 | if (mmu_context_cache == NO_CONTEXT) | 192 | if (asid_cache(cpu) == NO_CONTEXT) |
182 | mmu_context_cache = MMU_CONTEXT_FIRST_VERSION; | 193 | asid_cache(cpu) = MMU_CONTEXT_FIRST_VERSION; |
183 | 194 | ||
184 | set_asid(mmu_context_cache & MMU_CONTEXT_ASID_MASK); | 195 | set_asid(asid_cache(cpu) & MMU_CONTEXT_ASID_MASK); |
185 | } | 196 | } |
186 | 197 | ||
187 | static inline void disable_mmu(void) | 198 | static inline void disable_mmu(void) |
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 380fd62dd05a..ac4b4677f28c 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h | |||
@@ -13,6 +13,8 @@ | |||
13 | [ P4 control ] 0xE0000000 | 13 | [ P4 control ] 0xE0000000 |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #ifdef __KERNEL__ | ||
17 | |||
16 | /* PAGE_SHIFT determines the page size */ | 18 | /* PAGE_SHIFT determines the page size */ |
17 | #if defined(CONFIG_PAGE_SIZE_4KB) | 19 | #if defined(CONFIG_PAGE_SIZE_4KB) |
18 | # define PAGE_SHIFT 12 | 20 | # define PAGE_SHIFT 12 |
@@ -51,7 +53,6 @@ | |||
51 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT-PAGE_SHIFT) | 53 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT-PAGE_SHIFT) |
52 | #endif | 54 | #endif |
53 | 55 | ||
54 | #ifdef __KERNEL__ | ||
55 | #ifndef __ASSEMBLY__ | 56 | #ifndef __ASSEMBLY__ |
56 | 57 | ||
57 | extern void (*clear_page)(void *to); | 58 | extern void (*clear_page)(void *to); |
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h index 036ca2843866..9214c015fe14 100644 --- a/include/asm-sh/pgtable.h +++ b/include/asm-sh/pgtable.h | |||
@@ -43,17 +43,17 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]; | |||
43 | /* PGD bits */ | 43 | /* PGD bits */ |
44 | #define PGDIR_SHIFT (PTE_SHIFT + PTE_BITS) | 44 | #define PGDIR_SHIFT (PTE_SHIFT + PTE_BITS) |
45 | #define PGDIR_BITS (32 - PGDIR_SHIFT) | 45 | #define PGDIR_BITS (32 - PGDIR_SHIFT) |
46 | #define PGDIR_SIZE (1 << PGDIR_SHIFT) | 46 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) |
47 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | 47 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) |
48 | 48 | ||
49 | /* Entries per level */ | 49 | /* Entries per level */ |
50 | #define PTRS_PER_PTE (PAGE_SIZE / 4) | 50 | #define PTRS_PER_PTE (PAGE_SIZE / (1 << PTE_MAGNITUDE)) |
51 | #define PTRS_PER_PGD (PAGE_SIZE / 4) | 51 | #define PTRS_PER_PGD (PAGE_SIZE / 4) |
52 | 52 | ||
53 | #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) | 53 | #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) |
54 | #define FIRST_USER_ADDRESS 0 | 54 | #define FIRST_USER_ADDRESS 0 |
55 | 55 | ||
56 | #define PTE_PHYS_MASK 0x1ffff000 | 56 | #define PTE_PHYS_MASK (0x20000000 - PAGE_SIZE) |
57 | 57 | ||
58 | /* | 58 | /* |
59 | * First 1MB map is used by fixed purpose. | 59 | * First 1MB map is used by fixed purpose. |
@@ -583,11 +583,6 @@ struct mm_struct; | |||
583 | extern unsigned int kobjsize(const void *objp); | 583 | extern unsigned int kobjsize(const void *objp); |
584 | #endif /* !CONFIG_MMU */ | 584 | #endif /* !CONFIG_MMU */ |
585 | 585 | ||
586 | #if defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB) | ||
587 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR | ||
588 | extern pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep); | ||
589 | #endif | ||
590 | |||
591 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | 586 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; |
592 | extern void paging_init(void); | 587 | extern void paging_init(void); |
593 | 588 | ||
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h index e29f2abb92de..3e46a7afe764 100644 --- a/include/asm-sh/processor.h +++ b/include/asm-sh/processor.h | |||
@@ -27,8 +27,6 @@ | |||
27 | #define CCN_CVR 0xff000040 | 27 | #define CCN_CVR 0xff000040 |
28 | #define CCN_PRR 0xff000044 | 28 | #define CCN_PRR 0xff000044 |
29 | 29 | ||
30 | const char *get_cpu_subtype(void); | ||
31 | |||
32 | /* | 30 | /* |
33 | * CPU type and hardware bug flags. Kept separately for each CPU. | 31 | * CPU type and hardware bug flags. Kept separately for each CPU. |
34 | * | 32 | * |
@@ -66,6 +64,7 @@ enum cpu_type { | |||
66 | struct sh_cpuinfo { | 64 | struct sh_cpuinfo { |
67 | unsigned int type; | 65 | unsigned int type; |
68 | unsigned long loops_per_jiffy; | 66 | unsigned long loops_per_jiffy; |
67 | unsigned long asid_cache; | ||
69 | 68 | ||
70 | struct cache_info icache; /* Primary I-cache */ | 69 | struct cache_info icache; /* Primary I-cache */ |
71 | struct cache_info dcache; /* Primary D-cache */ | 70 | struct cache_info dcache; /* Primary D-cache */ |
@@ -288,5 +287,8 @@ extern int vsyscall_init(void); | |||
288 | #define vsyscall_init() do { } while (0) | 287 | #define vsyscall_init() do { } while (0) |
289 | #endif | 288 | #endif |
290 | 289 | ||
290 | /* arch/sh/kernel/setup.c */ | ||
291 | const char *get_cpu_subtype(struct sh_cpuinfo *c); | ||
292 | |||
291 | #endif /* __KERNEL__ */ | 293 | #endif /* __KERNEL__ */ |
292 | #endif /* __ASM_SH_PROCESSOR_H */ | 294 | #endif /* __ASM_SH_PROCESSOR_H */ |
diff --git a/include/asm-sh/rts7751r2d.h b/include/asm-sh/rts7751r2d.h index 796b8fcb81a8..10565ac7966a 100644 --- a/include/asm-sh/rts7751r2d.h +++ b/include/asm-sh/rts7751r2d.h | |||
@@ -68,6 +68,10 @@ | |||
68 | #define IRQ_PCISLOT2 10 /* PCI Slot #2 IRQ */ | 68 | #define IRQ_PCISLOT2 10 /* PCI Slot #2 IRQ */ |
69 | #define IRQ_EXTENTION 11 /* EXTn IRQ */ | 69 | #define IRQ_EXTENTION 11 /* EXTn IRQ */ |
70 | 70 | ||
71 | /* arch/sh/boards/renesas/rts7751r2d/irq.c */ | ||
72 | void init_rts7751r2d_IRQ(void); | ||
73 | int rts7751r2d_irq_demux(int); | ||
74 | |||
71 | #define __IO_PREFIX rts7751r2d | 75 | #define __IO_PREFIX rts7751r2d |
72 | #include <asm/io_generic.h> | 76 | #include <asm/io_generic.h> |
73 | 77 | ||
diff --git a/include/asm-sh/serial.h b/include/asm-sh/serial.h index 8734590d27e8..21f6d330f189 100644 --- a/include/asm-sh/serial.h +++ b/include/asm-sh/serial.h | |||
@@ -9,11 +9,6 @@ | |||
9 | 9 | ||
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | 11 | ||
12 | #ifdef CONFIG_SH_EC3104 | ||
13 | #include <asm/serial-ec3104.h> | ||
14 | #elif defined (CONFIG_SH_BIGSUR) | ||
15 | #include <asm/serial-bigsur.h> | ||
16 | #else | ||
17 | /* | 12 | /* |
18 | * This assumes you have a 1.8432 MHz clock for your UART. | 13 | * This assumes you have a 1.8432 MHz clock for your UART. |
19 | * | 14 | * |
@@ -34,12 +29,8 @@ | |||
34 | 29 | ||
35 | #else | 30 | #else |
36 | 31 | ||
37 | #define SERIAL_PORT_DFNS \ | 32 | #define SERIAL_PORT_DFNS |
38 | /* UART CLK PORT IRQ FLAGS */ \ | ||
39 | { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ | ||
40 | { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS } /* ttyS1 */ | ||
41 | 33 | ||
42 | #endif | 34 | #endif |
43 | 35 | ||
44 | #endif | ||
45 | #endif /* _ASM_SERIAL_H */ | 36 | #endif /* _ASM_SERIAL_H */ |
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h index 879f741105db..279e70a77c75 100644 --- a/include/asm-sh/thread_info.h +++ b/include/asm-sh/thread_info.h | |||
@@ -32,12 +32,20 @@ struct thread_info { | |||
32 | 32 | ||
33 | #define PREEMPT_ACTIVE 0x10000000 | 33 | #define PREEMPT_ACTIVE 0x10000000 |
34 | 34 | ||
35 | #ifdef CONFIG_4KSTACKS | 35 | #if defined(CONFIG_4KSTACKS) |
36 | #define THREAD_SIZE (PAGE_SIZE) | 36 | #define THREAD_SIZE_ORDER (0) |
37 | #elif defined(CONFIG_PAGE_SIZE_4KB) | ||
38 | #define THREAD_SIZE_ORDER (1) | ||
39 | #elif defined(CONFIG_PAGE_SIZE_8KB) | ||
40 | #define THREAD_SIZE_ORDER (1) | ||
41 | #elif defined(CONFIG_PAGE_SIZE_64KB) | ||
42 | #define THREAD_SIZE_ORDER (0) | ||
37 | #else | 43 | #else |
38 | #define THREAD_SIZE (PAGE_SIZE * 2) | 44 | #error "Unknown thread size" |
39 | #endif | 45 | #endif |
40 | #define STACK_WARN (THREAD_SIZE / 8) | 46 | |
47 | #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) | ||
48 | #define STACK_WARN (THREAD_SIZE >> 3) | ||
41 | 49 | ||
42 | /* | 50 | /* |
43 | * macros/functions for gaining access to the thread information structure | 51 | * macros/functions for gaining access to the thread information structure |
diff --git a/include/asm-sh/tlbflush.h b/include/asm-sh/tlbflush.h index 28c073b0fbab..455fb8da441e 100644 --- a/include/asm-sh/tlbflush.h +++ b/include/asm-sh/tlbflush.h | |||
@@ -4,7 +4,6 @@ | |||
4 | /* | 4 | /* |
5 | * TLB flushing: | 5 | * TLB flushing: |
6 | * | 6 | * |
7 | * - flush_tlb() flushes the current mm struct TLBs | ||
8 | * - flush_tlb_all() flushes all processes TLBs | 7 | * - flush_tlb_all() flushes all processes TLBs |
9 | * - flush_tlb_mm(mm) flushes the specified mm context TLB's | 8 | * - flush_tlb_mm(mm) flushes the specified mm context TLB's |
10 | * - flush_tlb_page(vma, vmaddr) flushes one page | 9 | * - flush_tlb_page(vma, vmaddr) flushes one page |
@@ -12,20 +11,45 @@ | |||
12 | * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages | 11 | * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages |
13 | * - flush_tlb_pgtables(mm, start, end) flushes a range of page tables | 12 | * - flush_tlb_pgtables(mm, start, end) flushes a range of page tables |
14 | */ | 13 | */ |
14 | extern void local_flush_tlb_all(void); | ||
15 | extern void local_flush_tlb_mm(struct mm_struct *mm); | ||
16 | extern void local_flush_tlb_range(struct vm_area_struct *vma, | ||
17 | unsigned long start, | ||
18 | unsigned long end); | ||
19 | extern void local_flush_tlb_page(struct vm_area_struct *vma, | ||
20 | unsigned long page); | ||
21 | extern void local_flush_tlb_kernel_range(unsigned long start, | ||
22 | unsigned long end); | ||
23 | extern void local_flush_tlb_one(unsigned long asid, unsigned long page); | ||
24 | |||
25 | #ifdef CONFIG_SMP | ||
15 | 26 | ||
16 | extern void flush_tlb(void); | ||
17 | extern void flush_tlb_all(void); | 27 | extern void flush_tlb_all(void); |
18 | extern void flush_tlb_mm(struct mm_struct *mm); | 28 | extern void flush_tlb_mm(struct mm_struct *mm); |
19 | extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, | 29 | extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, |
20 | unsigned long end); | 30 | unsigned long end); |
21 | extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page); | 31 | extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page); |
22 | extern void __flush_tlb_page(unsigned long asid, unsigned long page); | 32 | extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); |
33 | extern void flush_tlb_one(unsigned long asid, unsigned long page); | ||
34 | |||
35 | #else | ||
36 | |||
37 | #define flush_tlb_all() local_flush_tlb_all() | ||
38 | #define flush_tlb_mm(mm) local_flush_tlb_mm(mm) | ||
39 | #define flush_tlb_page(vma, page) local_flush_tlb_page(vma, page) | ||
40 | #define flush_tlb_one(asid, page) local_flush_tlb_one(asid, page) | ||
41 | |||
42 | #define flush_tlb_range(vma, start, end) \ | ||
43 | local_flush_tlb_range(vma, start, end) | ||
44 | |||
45 | #define flush_tlb_kernel_range(start, end) \ | ||
46 | local_flush_tlb_kernel_range(start, end) | ||
47 | |||
48 | #endif /* CONFIG_SMP */ | ||
23 | 49 | ||
24 | static inline void flush_tlb_pgtables(struct mm_struct *mm, | 50 | static inline void flush_tlb_pgtables(struct mm_struct *mm, |
25 | unsigned long start, unsigned long end) | 51 | unsigned long start, unsigned long end) |
26 | { /* Nothing to do */ | 52 | { |
53 | /* Nothing to do */ | ||
27 | } | 54 | } |
28 | |||
29 | extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); | ||
30 | |||
31 | #endif /* __ASM_SH_TLBFLUSH_H */ | 55 | #endif /* __ASM_SH_TLBFLUSH_H */ |
diff --git a/include/asm-sh/ubc.h b/include/asm-sh/ubc.h index 694f51f47941..ae9bbdeefbe1 100644 --- a/include/asm-sh/ubc.h +++ b/include/asm-sh/ubc.h | |||
@@ -17,7 +17,7 @@ | |||
17 | /* User Break Controller */ | 17 | /* User Break Controller */ |
18 | #if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \ | 18 | #if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \ |
19 | defined(CONFIG_CPU_SUBTYPE_SH7300) | 19 | defined(CONFIG_CPU_SUBTYPE_SH7300) |
20 | #define UBC_TYPE_SH7729 (cpu_data->type == CPU_SH7729) | 20 | #define UBC_TYPE_SH7729 (current_cpu_data.type == CPU_SH7729) |
21 | #else | 21 | #else |
22 | #define UBC_TYPE_SH7729 0 | 22 | #define UBC_TYPE_SH7729 0 |
23 | #endif | 23 | #endif |
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h index f982073dc6c6..17f527bfd455 100644 --- a/include/asm-sh/unistd.h +++ b/include/asm-sh/unistd.h | |||
@@ -292,22 +292,22 @@ | |||
292 | #define __NR_mq_getsetattr (__NR_mq_open+5) | 292 | #define __NR_mq_getsetattr (__NR_mq_open+5) |
293 | #define __NR_kexec_load 283 | 293 | #define __NR_kexec_load 283 |
294 | #define __NR_waitid 284 | 294 | #define __NR_waitid 284 |
295 | /* #define __NR_sys_setaltroot 285 */ | 295 | #define __NR_add_key 285 |
296 | #define __NR_add_key 286 | 296 | #define __NR_request_key 286 |
297 | #define __NR_request_key 287 | 297 | #define __NR_keyctl 287 |
298 | #define __NR_keyctl 288 | 298 | #define __NR_ioprio_set 288 |
299 | #define __NR_ioprio_set 289 | 299 | #define __NR_ioprio_get 289 |
300 | #define __NR_ioprio_get 290 | 300 | #define __NR_inotify_init 290 |
301 | #define __NR_inotify_init 291 | 301 | #define __NR_inotify_add_watch 291 |
302 | #define __NR_inotify_add_watch 292 | 302 | #define __NR_inotify_rm_watch 292 |
303 | #define __NR_inotify_rm_watch 293 | 303 | /* 293 is unused */ |
304 | #define __NR_migrate_pages 294 | 304 | #define __NR_migrate_pages 294 |
305 | #define __NR_openat 295 | 305 | #define __NR_openat 295 |
306 | #define __NR_mkdirat 296 | 306 | #define __NR_mkdirat 296 |
307 | #define __NR_mknodat 297 | 307 | #define __NR_mknodat 297 |
308 | #define __NR_fchownat 298 | 308 | #define __NR_fchownat 298 |
309 | #define __NR_futimesat 299 | 309 | #define __NR_futimesat 299 |
310 | #define __NR_newfstatat 300 | 310 | #define __NR_fstatat64 300 |
311 | #define __NR_unlinkat 301 | 311 | #define __NR_unlinkat 301 |
312 | #define __NR_renameat 302 | 312 | #define __NR_renameat 302 |
313 | #define __NR_linkat 303 | 313 | #define __NR_linkat 303 |
diff --git a/include/asm-sh/voyagergx.h b/include/asm-sh/voyagergx.h index 99b0807d1c9f..64c936b22715 100644 --- a/include/asm-sh/voyagergx.h +++ b/include/asm-sh/voyagergx.h | |||
@@ -308,6 +308,9 @@ | |||
308 | #define AC97C_READ (1 << 19) | 308 | #define AC97C_READ (1 << 19) |
309 | #define AC97C_WD_BIT (1 << 2) | 309 | #define AC97C_WD_BIT (1 << 2) |
310 | #define AC97C_INDEX_MASK 0x7f | 310 | #define AC97C_INDEX_MASK 0x7f |
311 | /* -------------------------------------------------------------------- */ | 311 | |
312 | /* arch/sh/cchips/voyagergx/consistent.c */ | ||
313 | void *voyagergx_consistent_alloc(struct device *, size_t, dma_addr_t *, gfp_t); | ||
314 | int voyagergx_consistent_free(struct device *, size_t, void *, dma_addr_t); | ||
312 | 315 | ||
313 | #endif /* _VOYAGER_GX_REG_H */ | 316 | #endif /* _VOYAGER_GX_REG_H */ |
diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86_64/bitops.h index 8da9609070f4..d4dbbe5f7bd9 100644 --- a/include/asm-x86_64/bitops.h +++ b/include/asm-x86_64/bitops.h | |||
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | #include <asm/alternative.h> | 8 | #include <asm/alternative.h> |
9 | 9 | ||
10 | #if __GNUC__ < 4 || __GNUC_MINOR__ < 1 | 10 | #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1) |
11 | /* Technically wrong, but this avoids compilation errors on some gcc | 11 | /* Technically wrong, but this avoids compilation errors on some gcc |
12 | versions. */ | 12 | versions. */ |
13 | #define ADDR "=m" (*(volatile long *) addr) | 13 | #define ADDR "=m" (*(volatile long *) addr) |
diff --git a/include/asm-x86_64/dma-mapping.h b/include/asm-x86_64/dma-mapping.h index 49dbab09ef2b..d2af227f06d0 100644 --- a/include/asm-x86_64/dma-mapping.h +++ b/include/asm-x86_64/dma-mapping.h | |||
@@ -66,6 +66,9 @@ static inline int dma_mapping_error(dma_addr_t dma_addr) | |||
66 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 66 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
67 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | 67 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
68 | 68 | ||
69 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | ||
70 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | ||
71 | |||
69 | extern void *dma_alloc_coherent(struct device *dev, size_t size, | 72 | extern void *dma_alloc_coherent(struct device *dev, size_t size, |
70 | dma_addr_t *dma_handle, gfp_t gfp); | 73 | dma_addr_t *dma_handle, gfp_t gfp); |
71 | extern void dma_free_coherent(struct device *dev, size_t size, void *vaddr, | 74 | extern void dma_free_coherent(struct device *dev, size_t size, void *vaddr, |
diff --git a/include/asm-x86_64/e820.h b/include/asm-x86_64/e820.h index fa2086774105..6216fa3f2802 100644 --- a/include/asm-x86_64/e820.h +++ b/include/asm-x86_64/e820.h | |||
@@ -46,6 +46,7 @@ extern void e820_mark_nosave_regions(void); | |||
46 | extern void e820_print_map(char *who); | 46 | extern void e820_print_map(char *who); |
47 | extern int e820_any_mapped(unsigned long start, unsigned long end, unsigned type); | 47 | extern int e820_any_mapped(unsigned long start, unsigned long end, unsigned type); |
48 | extern int e820_all_mapped(unsigned long start, unsigned long end, unsigned type); | 48 | extern int e820_all_mapped(unsigned long start, unsigned long end, unsigned type); |
49 | extern unsigned long e820_hole_size(unsigned long start, unsigned long end); | ||
49 | 50 | ||
50 | extern void e820_setup_gap(void); | 51 | extern void e820_setup_gap(void); |
51 | extern void e820_register_active_regions(int nid, | 52 | extern void e820_register_active_regions(int nid, |
@@ -56,6 +57,7 @@ extern void finish_e820_parsing(void); | |||
56 | extern struct e820map e820; | 57 | extern struct e820map e820; |
57 | 58 | ||
58 | extern unsigned ebda_addr, ebda_size; | 59 | extern unsigned ebda_addr, ebda_size; |
60 | extern unsigned long nodemap_addr, nodemap_size; | ||
59 | #endif/*!__ASSEMBLY__*/ | 61 | #endif/*!__ASSEMBLY__*/ |
60 | 62 | ||
61 | #endif/*__E820_HEADER*/ | 63 | #endif/*__E820_HEADER*/ |
diff --git a/include/asm-x86_64/hpet.h b/include/asm-x86_64/hpet.h index b39098408b69..59a66f084611 100644 --- a/include/asm-x86_64/hpet.h +++ b/include/asm-x86_64/hpet.h | |||
@@ -56,8 +56,15 @@ | |||
56 | extern int is_hpet_enabled(void); | 56 | extern int is_hpet_enabled(void); |
57 | extern int hpet_rtc_timer_init(void); | 57 | extern int hpet_rtc_timer_init(void); |
58 | extern int apic_is_clustered_box(void); | 58 | extern int apic_is_clustered_box(void); |
59 | extern int hpet_arch_init(void); | ||
60 | extern int hpet_timer_stop_set_go(unsigned long tick); | ||
61 | extern int hpet_reenable(void); | ||
62 | extern unsigned int hpet_calibrate_tsc(void); | ||
59 | 63 | ||
60 | extern int hpet_use_timer; | 64 | extern int hpet_use_timer; |
65 | extern unsigned long hpet_address; | ||
66 | extern unsigned long hpet_period; | ||
67 | extern unsigned long hpet_tick; | ||
61 | 68 | ||
62 | #ifdef CONFIG_HPET_EMULATE_RTC | 69 | #ifdef CONFIG_HPET_EMULATE_RTC |
63 | extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask); | 70 | extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask); |
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h index 179cce755aa7..552df5f10a6d 100644 --- a/include/asm-x86_64/hw_irq.h +++ b/include/asm-x86_64/hw_irq.h | |||
@@ -91,7 +91,7 @@ extern void enable_8259A_irq(unsigned int irq); | |||
91 | extern int i8259A_irq_pending(unsigned int irq); | 91 | extern int i8259A_irq_pending(unsigned int irq); |
92 | extern void make_8259A_irq(unsigned int irq); | 92 | extern void make_8259A_irq(unsigned int irq); |
93 | extern void init_8259A(int aeoi); | 93 | extern void init_8259A(int aeoi); |
94 | extern void FASTCALL(send_IPI_self(int vector)); | 94 | extern void send_IPI_self(int vector); |
95 | extern void init_VISWS_APIC_irqs(void); | 95 | extern void init_VISWS_APIC_irqs(void); |
96 | extern void setup_IO_APIC(void); | 96 | extern void setup_IO_APIC(void); |
97 | extern void disable_IO_APIC(void); | 97 | extern void disable_IO_APIC(void); |
diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h index f5d84bb7c948..de2cd9a2303a 100644 --- a/include/asm-x86_64/io.h +++ b/include/asm-x86_64/io.h | |||
@@ -100,7 +100,7 @@ __OUTS(l) | |||
100 | 100 | ||
101 | #define IO_SPACE_LIMIT 0xffff | 101 | #define IO_SPACE_LIMIT 0xffff |
102 | 102 | ||
103 | #if defined(__KERNEL__) && __x86_64__ | 103 | #if defined(__KERNEL__) && defined(__x86_64__) |
104 | 104 | ||
105 | #include <linux/vmalloc.h> | 105 | #include <linux/vmalloc.h> |
106 | 106 | ||
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h index 561ecbfd4cb5..f4fb238c89f1 100644 --- a/include/asm-x86_64/io_apic.h +++ b/include/asm-x86_64/io_apic.h | |||
@@ -85,18 +85,8 @@ struct IO_APIC_route_entry { | |||
85 | mask : 1, /* 0: enabled, 1: disabled */ | 85 | mask : 1, /* 0: enabled, 1: disabled */ |
86 | __reserved_2 : 15; | 86 | __reserved_2 : 15; |
87 | 87 | ||
88 | union { struct { __u32 | 88 | __u32 __reserved_3 : 24, |
89 | __reserved_1 : 24, | 89 | dest : 8; |
90 | physical_dest : 4, | ||
91 | __reserved_2 : 4; | ||
92 | } physical; | ||
93 | |||
94 | struct { __u32 | ||
95 | __reserved_1 : 24, | ||
96 | logical_dest : 8; | ||
97 | } logical; | ||
98 | } dest; | ||
99 | |||
100 | } __attribute__ ((packed)); | 90 | } __attribute__ ((packed)); |
101 | 91 | ||
102 | /* | 92 | /* |
diff --git a/include/asm-x86_64/mce.h b/include/asm-x86_64/mce.h index 5a11146d6d9c..177e92b4019b 100644 --- a/include/asm-x86_64/mce.h +++ b/include/asm-x86_64/mce.h | |||
@@ -103,6 +103,8 @@ void mce_log_therm_throt_event(unsigned int cpu, __u64 status); | |||
103 | 103 | ||
104 | extern atomic_t mce_entry; | 104 | extern atomic_t mce_entry; |
105 | 105 | ||
106 | extern void do_machine_check(struct pt_regs *, long); | ||
107 | |||
106 | #endif | 108 | #endif |
107 | 109 | ||
108 | #endif | 110 | #endif |
diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h index c38ebdf6f426..fb558fb1d211 100644 --- a/include/asm-x86_64/mmzone.h +++ b/include/asm-x86_64/mmzone.h | |||
@@ -11,24 +11,25 @@ | |||
11 | 11 | ||
12 | #include <asm/smp.h> | 12 | #include <asm/smp.h> |
13 | 13 | ||
14 | /* Should really switch to dynamic allocation at some point */ | ||
15 | #define NODEMAPSIZE 0x4fff | ||
16 | |||
17 | /* Simple perfect hash to map physical addresses to node numbers */ | 14 | /* Simple perfect hash to map physical addresses to node numbers */ |
18 | struct memnode { | 15 | struct memnode { |
19 | int shift; | 16 | int shift; |
20 | u8 map[NODEMAPSIZE]; | 17 | unsigned int mapsize; |
21 | } ____cacheline_aligned; | 18 | u8 *map; |
19 | u8 embedded_map[64-16]; | ||
20 | } ____cacheline_aligned; /* total size = 64 bytes */ | ||
22 | extern struct memnode memnode; | 21 | extern struct memnode memnode; |
23 | #define memnode_shift memnode.shift | 22 | #define memnode_shift memnode.shift |
24 | #define memnodemap memnode.map | 23 | #define memnodemap memnode.map |
24 | #define memnodemapsize memnode.mapsize | ||
25 | 25 | ||
26 | extern struct pglist_data *node_data[]; | 26 | extern struct pglist_data *node_data[]; |
27 | 27 | ||
28 | static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) | 28 | static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) |
29 | { | 29 | { |
30 | unsigned nid; | 30 | unsigned nid; |
31 | VIRTUAL_BUG_ON((addr >> memnode_shift) >= NODEMAPSIZE); | 31 | VIRTUAL_BUG_ON(!memnodemap); |
32 | VIRTUAL_BUG_ON((addr >> memnode_shift) >= memnodemapsize); | ||
32 | nid = memnodemap[addr >> memnode_shift]; | 33 | nid = memnodemap[addr >> memnode_shift]; |
33 | VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]); | 34 | VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]); |
34 | return nid; | 35 | return nid; |
@@ -46,5 +47,10 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) | |||
46 | extern int pfn_valid(unsigned long pfn); | 47 | extern int pfn_valid(unsigned long pfn); |
47 | #endif | 48 | #endif |
48 | 49 | ||
50 | #ifdef CONFIG_NUMA_EMU | ||
51 | #define FAKE_NODE_MIN_SIZE (64*1024*1024) | ||
52 | #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1ul)) | ||
53 | #endif | ||
54 | |||
49 | #endif | 55 | #endif |
50 | #endif | 56 | #endif |
diff --git a/include/asm-x86_64/mutex.h b/include/asm-x86_64/mutex.h index 16396b1de3e4..6c2949a3c677 100644 --- a/include/asm-x86_64/mutex.h +++ b/include/asm-x86_64/mutex.h | |||
@@ -21,7 +21,7 @@ do { \ | |||
21 | unsigned long dummy; \ | 21 | unsigned long dummy; \ |
22 | \ | 22 | \ |
23 | typecheck(atomic_t *, v); \ | 23 | typecheck(atomic_t *, v); \ |
24 | typecheck_fn(fastcall void (*)(atomic_t *), fail_fn); \ | 24 | typecheck_fn(void (*)(atomic_t *), fail_fn); \ |
25 | \ | 25 | \ |
26 | __asm__ __volatile__( \ | 26 | __asm__ __volatile__( \ |
27 | LOCK_PREFIX " decl (%%rdi) \n" \ | 27 | LOCK_PREFIX " decl (%%rdi) \n" \ |
@@ -47,7 +47,7 @@ do { \ | |||
47 | */ | 47 | */ |
48 | static inline int | 48 | static inline int |
49 | __mutex_fastpath_lock_retval(atomic_t *count, | 49 | __mutex_fastpath_lock_retval(atomic_t *count, |
50 | int fastcall (*fail_fn)(atomic_t *)) | 50 | int (*fail_fn)(atomic_t *)) |
51 | { | 51 | { |
52 | if (unlikely(atomic_dec_return(count) < 0)) | 52 | if (unlikely(atomic_dec_return(count) < 0)) |
53 | return fail_fn(count); | 53 | return fail_fn(count); |
@@ -67,7 +67,7 @@ do { \ | |||
67 | unsigned long dummy; \ | 67 | unsigned long dummy; \ |
68 | \ | 68 | \ |
69 | typecheck(atomic_t *, v); \ | 69 | typecheck(atomic_t *, v); \ |
70 | typecheck_fn(fastcall void (*)(atomic_t *), fail_fn); \ | 70 | typecheck_fn(void (*)(atomic_t *), fail_fn); \ |
71 | \ | 71 | \ |
72 | __asm__ __volatile__( \ | 72 | __asm__ __volatile__( \ |
73 | LOCK_PREFIX " incl (%%rdi) \n" \ | 73 | LOCK_PREFIX " incl (%%rdi) \n" \ |
diff --git a/include/asm-x86_64/pgalloc.h b/include/asm-x86_64/pgalloc.h index 43d4c333a8b1..4e28b6060a5e 100644 --- a/include/asm-x86_64/pgalloc.h +++ b/include/asm-x86_64/pgalloc.h | |||
@@ -18,11 +18,6 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *p | |||
18 | set_pmd(pmd, __pmd(_PAGE_TABLE | (page_to_pfn(pte) << PAGE_SHIFT))); | 18 | set_pmd(pmd, __pmd(_PAGE_TABLE | (page_to_pfn(pte) << PAGE_SHIFT))); |
19 | } | 19 | } |
20 | 20 | ||
21 | static inline pmd_t *get_pmd(void) | ||
22 | { | ||
23 | return (pmd_t *)get_zeroed_page(GFP_KERNEL); | ||
24 | } | ||
25 | |||
26 | static inline void pmd_free(pmd_t *pmd) | 21 | static inline void pmd_free(pmd_t *pmd) |
27 | { | 22 | { |
28 | BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); | 23 | BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); |
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 59901c690a0d..730bd6028416 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -359,15 +359,6 @@ static inline int pmd_large(pmd_t pte) { | |||
359 | #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) | 359 | #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) |
360 | #define mk_pte_huge(entry) (pte_val(entry) |= _PAGE_PRESENT | _PAGE_PSE) | 360 | #define mk_pte_huge(entry) (pte_val(entry) |= _PAGE_PRESENT | _PAGE_PSE) |
361 | 361 | ||
362 | /* physical address -> PTE */ | ||
363 | static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot) | ||
364 | { | ||
365 | pte_t pte; | ||
366 | pte_val(pte) = physpage | pgprot_val(pgprot); | ||
367 | pte_val(pte) &= __supported_pte_mask; | ||
368 | return pte; | ||
369 | } | ||
370 | |||
371 | /* Change flags of a PTE */ | 362 | /* Change flags of a PTE */ |
372 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 363 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
373 | { | 364 | { |
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h index a6d2ff5c69b7..f54f3abf93ce 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86_64/proto.h | |||
@@ -45,11 +45,7 @@ extern u32 pmtmr_ioport; | |||
45 | #else | 45 | #else |
46 | #define pmtmr_ioport 0 | 46 | #define pmtmr_ioport 0 |
47 | #endif | 47 | #endif |
48 | extern unsigned long long monotonic_base; | ||
49 | extern int sysctl_vsyscall; | ||
50 | extern int nohpet; | 48 | extern int nohpet; |
51 | extern unsigned long vxtime_hz; | ||
52 | extern void time_init_gtod(void); | ||
53 | 49 | ||
54 | extern void early_printk(const char *fmt, ...) __attribute__((format(printf,1,2))); | 50 | extern void early_printk(const char *fmt, ...) __attribute__((format(printf,1,2))); |
55 | 51 | ||
@@ -91,8 +87,6 @@ extern void check_efer(void); | |||
91 | 87 | ||
92 | extern int unhandled_signal(struct task_struct *tsk, int sig); | 88 | extern int unhandled_signal(struct task_struct *tsk, int sig); |
93 | 89 | ||
94 | extern int unsynchronized_tsc(void); | ||
95 | |||
96 | extern void select_idle_routine(const struct cpuinfo_x86 *c); | 90 | extern void select_idle_routine(const struct cpuinfo_x86 *c); |
97 | 91 | ||
98 | extern unsigned long table_start, table_end; | 92 | extern unsigned long table_start, table_end; |
diff --git a/include/asm-x86_64/timex.h b/include/asm-x86_64/timex.h index b9e5320b7625..8c6808a3fba4 100644 --- a/include/asm-x86_64/timex.h +++ b/include/asm-x86_64/timex.h | |||
@@ -12,38 +12,21 @@ | |||
12 | #include <asm/hpet.h> | 12 | #include <asm/hpet.h> |
13 | #include <asm/system.h> | 13 | #include <asm/system.h> |
14 | #include <asm/processor.h> | 14 | #include <asm/processor.h> |
15 | #include <asm/tsc.h> | ||
15 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
16 | 17 | ||
17 | #define CLOCK_TICK_RATE PIT_TICK_RATE /* Underlying HZ */ | 18 | #define CLOCK_TICK_RATE PIT_TICK_RATE /* Underlying HZ */ |
18 | 19 | ||
19 | typedef unsigned long long cycles_t; | ||
20 | |||
21 | static inline cycles_t get_cycles (void) | ||
22 | { | ||
23 | unsigned long long ret; | ||
24 | |||
25 | rdtscll(ret); | ||
26 | return ret; | ||
27 | } | ||
28 | |||
29 | /* Like get_cycles, but make sure the CPU is synchronized. */ | ||
30 | static __always_inline cycles_t get_cycles_sync(void) | ||
31 | { | ||
32 | unsigned long long ret; | ||
33 | unsigned eax; | ||
34 | /* Don't do an additional sync on CPUs where we know | ||
35 | RDTSC is already synchronous. */ | ||
36 | alternative_io("cpuid", ASM_NOP2, X86_FEATURE_SYNC_RDTSC, | ||
37 | "=a" (eax), "0" (1) : "ebx","ecx","edx","memory"); | ||
38 | rdtscll(ret); | ||
39 | return ret; | ||
40 | } | ||
41 | |||
42 | extern unsigned int cpu_khz; | ||
43 | |||
44 | extern int read_current_timer(unsigned long *timer_value); | 20 | extern int read_current_timer(unsigned long *timer_value); |
45 | #define ARCH_HAS_READ_CURRENT_TIMER 1 | 21 | #define ARCH_HAS_READ_CURRENT_TIMER 1 |
46 | 22 | ||
47 | extern struct vxtime_data vxtime; | 23 | #define USEC_PER_TICK (USEC_PER_SEC / HZ) |
24 | #define NSEC_PER_TICK (NSEC_PER_SEC / HZ) | ||
25 | #define FSEC_PER_TICK (FSEC_PER_SEC / HZ) | ||
26 | |||
27 | #define NS_SCALE 10 /* 2^10, carefully chosen */ | ||
28 | #define US_SCALE 32 /* 2^32, arbitralrily chosen */ | ||
48 | 29 | ||
30 | extern void mark_tsc_unstable(void); | ||
31 | extern void set_cyc2ns_scale(unsigned long khz); | ||
49 | #endif | 32 | #endif |
diff --git a/include/asm-x86_64/tsc.h b/include/asm-x86_64/tsc.h new file mode 100644 index 000000000000..9a0a368852c7 --- /dev/null +++ b/include/asm-x86_64/tsc.h | |||
@@ -0,0 +1,66 @@ | |||
1 | /* | ||
2 | * linux/include/asm-x86_64/tsc.h | ||
3 | * | ||
4 | * x86_64 TSC related functions | ||
5 | */ | ||
6 | #ifndef _ASM_x86_64_TSC_H | ||
7 | #define _ASM_x86_64_TSC_H | ||
8 | |||
9 | #include <asm/processor.h> | ||
10 | |||
11 | /* | ||
12 | * Standard way to access the cycle counter. | ||
13 | */ | ||
14 | typedef unsigned long long cycles_t; | ||
15 | |||
16 | extern unsigned int cpu_khz; | ||
17 | extern unsigned int tsc_khz; | ||
18 | |||
19 | static inline cycles_t get_cycles(void) | ||
20 | { | ||
21 | unsigned long long ret = 0; | ||
22 | |||
23 | #ifndef CONFIG_X86_TSC | ||
24 | if (!cpu_has_tsc) | ||
25 | return 0; | ||
26 | #endif | ||
27 | |||
28 | #if defined(CONFIG_X86_GENERIC) || defined(CONFIG_X86_TSC) | ||
29 | rdtscll(ret); | ||
30 | #endif | ||
31 | return ret; | ||
32 | } | ||
33 | |||
34 | /* Like get_cycles, but make sure the CPU is synchronized. */ | ||
35 | static __always_inline cycles_t get_cycles_sync(void) | ||
36 | { | ||
37 | unsigned long long ret; | ||
38 | #ifdef X86_FEATURE_SYNC_RDTSC | ||
39 | unsigned eax; | ||
40 | |||
41 | /* | ||
42 | * Don't do an additional sync on CPUs where we know | ||
43 | * RDTSC is already synchronous: | ||
44 | */ | ||
45 | alternative_io("cpuid", ASM_NOP2, X86_FEATURE_SYNC_RDTSC, | ||
46 | "=a" (eax), "0" (1) : "ebx","ecx","edx","memory"); | ||
47 | #else | ||
48 | sync_core(); | ||
49 | #endif | ||
50 | rdtscll(ret); | ||
51 | |||
52 | return ret; | ||
53 | } | ||
54 | |||
55 | extern void tsc_init(void); | ||
56 | extern void mark_tsc_unstable(void); | ||
57 | extern int unsynchronized_tsc(void); | ||
58 | |||
59 | /* | ||
60 | * Boot-time check whether the TSCs are synchronized across | ||
61 | * all CPUs/cores: | ||
62 | */ | ||
63 | extern void check_tsc_sync_source(int cpu); | ||
64 | extern void check_tsc_sync_target(void); | ||
65 | |||
66 | #endif | ||
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h index 8079e29c14fd..1981f70fcad1 100644 --- a/include/asm-x86_64/uaccess.h +++ b/include/asm-x86_64/uaccess.h | |||
@@ -367,4 +367,18 @@ __copy_to_user_inatomic(void __user *dst, const void *src, unsigned size) | |||
367 | return copy_user_generic((__force void *)dst, src, size); | 367 | return copy_user_generic((__force void *)dst, src, size); |
368 | } | 368 | } |
369 | 369 | ||
370 | #define ARCH_HAS_NOCACHE_UACCESS 1 | ||
371 | extern long __copy_user_nocache(void *dst, const void __user *src, unsigned size, int zerorest); | ||
372 | |||
373 | static inline int __copy_from_user_nocache(void *dst, const void __user *src, unsigned size) | ||
374 | { | ||
375 | might_sleep(); | ||
376 | return __copy_user_nocache(dst, (__force void *)src, size, 1); | ||
377 | } | ||
378 | |||
379 | static inline int __copy_from_user_inatomic_nocache(void *dst, const void __user *src, unsigned size) | ||
380 | { | ||
381 | return __copy_user_nocache(dst, (__force void *)src, size, 0); | ||
382 | } | ||
383 | |||
370 | #endif /* __X86_64_UACCESS_H */ | 384 | #endif /* __X86_64_UACCESS_H */ |
diff --git a/include/asm-x86_64/vsyscall.h b/include/asm-x86_64/vsyscall.h index 05cb8dd200de..82b4afe65c91 100644 --- a/include/asm-x86_64/vsyscall.h +++ b/include/asm-x86_64/vsyscall.h | |||
@@ -16,51 +16,27 @@ enum vsyscall_num { | |||
16 | #ifdef __KERNEL__ | 16 | #ifdef __KERNEL__ |
17 | #include <linux/seqlock.h> | 17 | #include <linux/seqlock.h> |
18 | 18 | ||
19 | #define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16))) | ||
20 | #define __section_vgetcpu_mode __attribute__ ((unused, __section__ (".vgetcpu_mode"), aligned(16))) | 19 | #define __section_vgetcpu_mode __attribute__ ((unused, __section__ (".vgetcpu_mode"), aligned(16))) |
21 | #define __section_jiffies __attribute__ ((unused, __section__ (".jiffies"), aligned(16))) | 20 | #define __section_jiffies __attribute__ ((unused, __section__ (".jiffies"), aligned(16))) |
22 | #define __section_sys_tz __attribute__ ((unused, __section__ (".sys_tz"), aligned(16))) | ||
23 | #define __section_sysctl_vsyscall __attribute__ ((unused, __section__ (".sysctl_vsyscall"), aligned(16))) | ||
24 | #define __section_xtime __attribute__ ((unused, __section__ (".xtime"), aligned(16))) | ||
25 | #define __section_xtime_lock __attribute__ ((unused, __section__ (".xtime_lock"), aligned(16))) | ||
26 | 21 | ||
27 | #define VXTIME_TSC 1 | 22 | /* Definitions for CONFIG_GENERIC_TIME definitions */ |
28 | #define VXTIME_HPET 2 | 23 | #define __section_vsyscall_gtod_data __attribute__ \ |
29 | #define VXTIME_PMTMR 3 | 24 | ((unused, __section__ (".vsyscall_gtod_data"),aligned(16))) |
25 | #define __vsyscall_fn __attribute__ ((unused,__section__(".vsyscall_fn"))) | ||
30 | 26 | ||
31 | #define VGETCPU_RDTSCP 1 | 27 | #define VGETCPU_RDTSCP 1 |
32 | #define VGETCPU_LSL 2 | 28 | #define VGETCPU_LSL 2 |
33 | 29 | ||
34 | struct vxtime_data { | ||
35 | long hpet_address; /* HPET base address */ | ||
36 | int last; | ||
37 | unsigned long last_tsc; | ||
38 | long quot; | ||
39 | long tsc_quot; | ||
40 | int mode; | ||
41 | }; | ||
42 | |||
43 | #define hpet_readl(a) readl((const void __iomem *)fix_to_virt(FIX_HPET_BASE) + a) | 30 | #define hpet_readl(a) readl((const void __iomem *)fix_to_virt(FIX_HPET_BASE) + a) |
44 | #define hpet_writel(d,a) writel(d, (void __iomem *)fix_to_virt(FIX_HPET_BASE) + a) | 31 | #define hpet_writel(d,a) writel(d, (void __iomem *)fix_to_virt(FIX_HPET_BASE) + a) |
45 | 32 | ||
46 | /* vsyscall space (readonly) */ | ||
47 | extern struct vxtime_data __vxtime; | ||
48 | extern int __vgetcpu_mode; | 33 | extern int __vgetcpu_mode; |
49 | extern struct timespec __xtime; | ||
50 | extern volatile unsigned long __jiffies; | 34 | extern volatile unsigned long __jiffies; |
51 | extern struct timezone __sys_tz; | ||
52 | extern seqlock_t __xtime_lock; | ||
53 | 35 | ||
54 | /* kernel space (writeable) */ | 36 | /* kernel space (writeable) */ |
55 | extern struct vxtime_data vxtime; | ||
56 | extern int vgetcpu_mode; | 37 | extern int vgetcpu_mode; |
57 | extern struct timezone sys_tz; | 38 | extern struct timezone sys_tz; |
58 | extern int sysctl_vsyscall; | 39 | extern struct vsyscall_gtod_data_t vsyscall_gtod_data; |
59 | extern seqlock_t xtime_lock; | ||
60 | |||
61 | extern int sysctl_vsyscall; | ||
62 | |||
63 | #define ARCH_HAVE_XTIME_LOCK 1 | ||
64 | 40 | ||
65 | #endif /* __KERNEL__ */ | 41 | #endif /* __KERNEL__ */ |
66 | 42 | ||
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 815f1fb4ce21..8bcfaa4c66ae 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -75,7 +75,7 @@ enum acpi_address_range_id { | |||
75 | 75 | ||
76 | typedef int (*acpi_table_handler) (struct acpi_table_header *table); | 76 | typedef int (*acpi_table_handler) (struct acpi_table_header *table); |
77 | 77 | ||
78 | typedef int (*acpi_madt_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); | 78 | typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); |
79 | 79 | ||
80 | char * __acpi_map_table (unsigned long phys_addr, unsigned long size); | 80 | char * __acpi_map_table (unsigned long phys_addr, unsigned long size); |
81 | unsigned long acpi_find_rsdp (void); | 81 | unsigned long acpi_find_rsdp (void); |
@@ -85,8 +85,10 @@ int acpi_numa_init (void); | |||
85 | 85 | ||
86 | int acpi_table_init (void); | 86 | int acpi_table_init (void); |
87 | int acpi_table_parse (char *id, acpi_table_handler handler); | 87 | int acpi_table_parse (char *id, acpi_table_handler handler); |
88 | int acpi_table_parse_madt (enum acpi_madt_type id, acpi_madt_entry_handler handler, unsigned int max_entries); | 88 | int __init acpi_table_parse_entries(char *id, unsigned long table_size, |
89 | int acpi_table_parse_srat (enum acpi_srat_type id, acpi_madt_entry_handler handler, unsigned int max_entries); | 89 | int entry_id, acpi_table_entry_handler handler, unsigned int max_entries); |
90 | int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries); | ||
91 | int acpi_table_parse_srat (enum acpi_srat_type id, acpi_table_entry_handler handler, unsigned int max_entries); | ||
90 | int acpi_parse_mcfg (struct acpi_table_header *header); | 92 | int acpi_parse_mcfg (struct acpi_table_header *header); |
91 | void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); | 93 | void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); |
92 | void acpi_table_print_srat_entry (struct acpi_subtable_header *srat); | 94 | void acpi_table_print_srat_entry (struct acpi_subtable_header *srat); |
diff --git a/include/linux/acpi_pmtmr.h b/include/linux/acpi_pmtmr.h new file mode 100644 index 000000000000..1d0ef1ae8036 --- /dev/null +++ b/include/linux/acpi_pmtmr.h | |||
@@ -0,0 +1,38 @@ | |||
1 | #ifndef _ACPI_PMTMR_H_ | ||
2 | #define _ACPI_PMTMR_H_ | ||
3 | |||
4 | #include <linux/clocksource.h> | ||
5 | |||
6 | /* Number of PMTMR ticks expected during calibration run */ | ||
7 | #define PMTMR_TICKS_PER_SEC 3579545 | ||
8 | |||
9 | /* limit it to 24 bits */ | ||
10 | #define ACPI_PM_MASK CLOCKSOURCE_MASK(24) | ||
11 | |||
12 | /* Overrun value */ | ||
13 | #define ACPI_PM_OVRRUN (1<<24) | ||
14 | |||
15 | #ifdef CONFIG_X86_PM_TIMER | ||
16 | |||
17 | extern u32 acpi_pm_read_verified(void); | ||
18 | extern u32 pmtmr_ioport; | ||
19 | |||
20 | static inline u32 acpi_pm_read_early(void) | ||
21 | { | ||
22 | if (!pmtmr_ioport) | ||
23 | return 0; | ||
24 | /* mask the output to 24 bits */ | ||
25 | return acpi_pm_read_verified() & ACPI_PM_MASK; | ||
26 | } | ||
27 | |||
28 | #else | ||
29 | |||
30 | static inline u32 acpi_pm_read_early(void) | ||
31 | { | ||
32 | return 0; | ||
33 | } | ||
34 | |||
35 | #endif | ||
36 | |||
37 | #endif | ||
38 | |||
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h index a5c8bb5d80ba..abc521cfb084 100644 --- a/include/linux/agp_backend.h +++ b/include/linux/agp_backend.h | |||
@@ -87,10 +87,15 @@ struct agp_memory { | |||
87 | u32 physical; | 87 | u32 physical; |
88 | u8 is_bound; | 88 | u8 is_bound; |
89 | u8 is_flushed; | 89 | u8 is_flushed; |
90 | u8 vmalloc_flag; | ||
90 | }; | 91 | }; |
91 | 92 | ||
92 | #define AGP_NORMAL_MEMORY 0 | 93 | #define AGP_NORMAL_MEMORY 0 |
93 | 94 | ||
95 | #define AGP_USER_TYPES (1 << 16) | ||
96 | #define AGP_USER_MEMORY (AGP_USER_TYPES) | ||
97 | #define AGP_USER_CACHED_MEMORY (AGP_USER_TYPES + 1) | ||
98 | |||
94 | extern struct agp_bridge_data *agp_bridge; | 99 | extern struct agp_bridge_data *agp_bridge; |
95 | extern struct list_head agp_bridges; | 100 | extern struct list_head agp_bridges; |
96 | 101 | ||
diff --git a/include/linux/ata.h b/include/linux/ata.h index 18e401ff7eaf..272736e37990 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -352,7 +352,7 @@ static inline int ata_drive_40wire(const u16 *dev_id) | |||
352 | { | 352 | { |
353 | if (ata_id_major_version(dev_id) >= 5 && ata_id_is_sata(dev_id)) | 353 | if (ata_id_major_version(dev_id) >= 5 && ata_id_is_sata(dev_id)) |
354 | return 0; /* SATA */ | 354 | return 0; /* SATA */ |
355 | if (dev_id[93] & 0x4000) | 355 | if ((dev_id[93] & 0xE000) == 0x6000) |
356 | return 0; /* 80 wire */ | 356 | return 0; /* 80 wire */ |
357 | return 1; | 357 | return 1; |
358 | } | 358 | } |
diff --git a/include/linux/atmel_pdc.h b/include/linux/atmel_pdc.h new file mode 100644 index 000000000000..5058a31d2ce8 --- /dev/null +++ b/include/linux/atmel_pdc.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * include/linux/atmel_pdc.h | ||
3 | * | ||
4 | * Copyright (C) 2005 Ivan Kokshaysky | ||
5 | * Copyright (C) SAN People | ||
6 | * | ||
7 | * Peripheral Data Controller (PDC) registers. | ||
8 | * Based on AT91RM9200 datasheet revision E. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | */ | ||
15 | |||
16 | #ifndef ATMEL_PDC_H | ||
17 | #define ATMEL_PDC_H | ||
18 | |||
19 | #define ATMEL_PDC_RPR 0x100 /* Receive Pointer Register */ | ||
20 | #define ATMEL_PDC_RCR 0x104 /* Receive Counter Register */ | ||
21 | #define ATMEL_PDC_TPR 0x108 /* Transmit Pointer Register */ | ||
22 | #define ATMEL_PDC_TCR 0x10c /* Transmit Counter Register */ | ||
23 | #define ATMEL_PDC_RNPR 0x110 /* Receive Next Pointer Register */ | ||
24 | #define ATMEL_PDC_RNCR 0x114 /* Receive Next Counter Register */ | ||
25 | #define ATMEL_PDC_TNPR 0x118 /* Transmit Next Pointer Register */ | ||
26 | #define ATMEL_PDC_TNCR 0x11c /* Transmit Next Counter Register */ | ||
27 | |||
28 | #define ATMEL_PDC_PTCR 0x120 /* Transfer Control Register */ | ||
29 | #define ATMEL_PDC_RXTEN (1 << 0) /* Receiver Transfer Enable */ | ||
30 | #define ATMEL_PDC_RXTDIS (1 << 1) /* Receiver Transfer Disable */ | ||
31 | #define ATMEL_PDC_TXTEN (1 << 8) /* Transmitter Transfer Enable */ | ||
32 | #define ATMEL_PDC_TXTDIS (1 << 9) /* Transmitter Transfer Disable */ | ||
33 | |||
34 | #define ATMEL_PDC_PTSR 0x124 /* Transfer Status Register */ | ||
35 | |||
36 | #endif | ||
diff --git a/include/linux/audit.h b/include/linux/audit.h index 0e07db6cc0d0..229fa012c893 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -89,6 +89,7 @@ | |||
89 | #define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */ | 89 | #define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */ |
90 | #define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */ | 90 | #define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */ |
91 | #define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */ | 91 | #define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */ |
92 | #define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */ | ||
92 | 93 | ||
93 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ | 94 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ |
94 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ | 95 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ |
@@ -387,6 +388,7 @@ extern int __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode | |||
387 | extern int audit_bprm(struct linux_binprm *bprm); | 388 | extern int audit_bprm(struct linux_binprm *bprm); |
388 | extern int audit_socketcall(int nargs, unsigned long *args); | 389 | extern int audit_socketcall(int nargs, unsigned long *args); |
389 | extern int audit_sockaddr(int len, void *addr); | 390 | extern int audit_sockaddr(int len, void *addr); |
391 | extern int __audit_fd_pair(int fd1, int fd2); | ||
390 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); | 392 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); |
391 | extern int audit_set_macxattr(const char *name); | 393 | extern int audit_set_macxattr(const char *name); |
392 | extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr); | 394 | extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr); |
@@ -401,6 +403,12 @@ static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp) | |||
401 | return __audit_ipc_obj(ipcp); | 403 | return __audit_ipc_obj(ipcp); |
402 | return 0; | 404 | return 0; |
403 | } | 405 | } |
406 | static inline int audit_fd_pair(int fd1, int fd2) | ||
407 | { | ||
408 | if (unlikely(!audit_dummy_context())) | ||
409 | return __audit_fd_pair(fd1, fd2); | ||
410 | return 0; | ||
411 | } | ||
404 | static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) | 412 | static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) |
405 | { | 413 | { |
406 | if (unlikely(!audit_dummy_context())) | 414 | if (unlikely(!audit_dummy_context())) |
@@ -459,6 +467,7 @@ extern int audit_n_rules; | |||
459 | #define audit_ipc_set_perm(q,u,g,m) ({ 0; }) | 467 | #define audit_ipc_set_perm(q,u,g,m) ({ 0; }) |
460 | #define audit_bprm(p) ({ 0; }) | 468 | #define audit_bprm(p) ({ 0; }) |
461 | #define audit_socketcall(n,a) ({ 0; }) | 469 | #define audit_socketcall(n,a) ({ 0; }) |
470 | #define audit_fd_pair(n,a) ({ 0; }) | ||
462 | #define audit_sockaddr(len, addr) ({ 0; }) | 471 | #define audit_sockaddr(len, addr) ({ 0; }) |
463 | #define audit_avc_path(dentry, mnt) ({ 0; }) | 472 | #define audit_avc_path(dentry, mnt) ({ 0; }) |
464 | #define audit_set_macxattr(n) do { ; } while (0) | 473 | #define audit_set_macxattr(n) do { ; } while (0) |
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h index 0a6bc52ffe88..31a29541b504 100644 --- a/include/linux/auto_fs4.h +++ b/include/linux/auto_fs4.h | |||
@@ -59,6 +59,13 @@ struct autofs_packet_expire_multi { | |||
59 | char name[NAME_MAX+1]; | 59 | char name[NAME_MAX+1]; |
60 | }; | 60 | }; |
61 | 61 | ||
62 | union autofs_packet_union { | ||
63 | struct autofs_packet_hdr hdr; | ||
64 | struct autofs_packet_missing missing; | ||
65 | struct autofs_packet_expire expire; | ||
66 | struct autofs_packet_expire_multi expire_multi; | ||
67 | }; | ||
68 | |||
62 | /* autofs v5 common packet struct */ | 69 | /* autofs v5 common packet struct */ |
63 | struct autofs_v5_packet { | 70 | struct autofs_v5_packet { |
64 | struct autofs_packet_hdr hdr; | 71 | struct autofs_packet_hdr hdr; |
@@ -78,12 +85,13 @@ typedef struct autofs_v5_packet autofs_packet_expire_indirect_t; | |||
78 | typedef struct autofs_v5_packet autofs_packet_missing_direct_t; | 85 | typedef struct autofs_v5_packet autofs_packet_missing_direct_t; |
79 | typedef struct autofs_v5_packet autofs_packet_expire_direct_t; | 86 | typedef struct autofs_v5_packet autofs_packet_expire_direct_t; |
80 | 87 | ||
81 | union autofs_packet_union { | 88 | union autofs_v5_packet_union { |
82 | struct autofs_packet_hdr hdr; | 89 | struct autofs_packet_hdr hdr; |
83 | struct autofs_packet_missing missing; | ||
84 | struct autofs_packet_expire expire; | ||
85 | struct autofs_packet_expire_multi expire_multi; | ||
86 | struct autofs_v5_packet v5_packet; | 90 | struct autofs_v5_packet v5_packet; |
91 | autofs_packet_missing_indirect_t missing_indirect; | ||
92 | autofs_packet_expire_indirect_t expire_indirect; | ||
93 | autofs_packet_missing_direct_t missing_direct; | ||
94 | autofs_packet_expire_direct_t expire_direct; | ||
87 | }; | 95 | }; |
88 | 96 | ||
89 | #define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int) | 97 | #define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int) |
diff --git a/include/linux/backlight.h b/include/linux/backlight.h index a5cf1beacb44..1023ba0d6e55 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h | |||
@@ -9,17 +9,28 @@ | |||
9 | #define _LINUX_BACKLIGHT_H | 9 | #define _LINUX_BACKLIGHT_H |
10 | 10 | ||
11 | #include <linux/device.h> | 11 | #include <linux/device.h> |
12 | #include <linux/mutex.h> | ||
12 | #include <linux/notifier.h> | 13 | #include <linux/notifier.h> |
13 | 14 | ||
15 | /* Notes on locking: | ||
16 | * | ||
17 | * backlight_device->ops_lock is an internal backlight lock protecting the | ||
18 | * ops pointer and no code outside the core should need to touch it. | ||
19 | * | ||
20 | * Access to update_status() is serialised by the update_lock mutex since | ||
21 | * most drivers seem to need this and historically get it wrong. | ||
22 | * | ||
23 | * Most drivers don't need locking on their get_brightness() method. | ||
24 | * If yours does, you need to implement it in the driver. You can use the | ||
25 | * update_lock mutex if appropriate. | ||
26 | * | ||
27 | * Any other use of the locks below is probably wrong. | ||
28 | */ | ||
29 | |||
14 | struct backlight_device; | 30 | struct backlight_device; |
15 | struct fb_info; | 31 | struct fb_info; |
16 | 32 | ||
17 | /* This structure defines all the properties of a backlight | 33 | struct backlight_ops { |
18 | (usually attached to a LCD). */ | ||
19 | struct backlight_properties { | ||
20 | /* Owner module */ | ||
21 | struct module *owner; | ||
22 | |||
23 | /* Notify the backlight driver some property has changed */ | 34 | /* Notify the backlight driver some property has changed */ |
24 | int (*update_status)(struct backlight_device *); | 35 | int (*update_status)(struct backlight_device *); |
25 | /* Return the current backlight brightness (accounting for power, | 36 | /* Return the current backlight brightness (accounting for power, |
@@ -28,7 +39,10 @@ struct backlight_properties { | |||
28 | /* Check if given framebuffer device is the one bound to this backlight; | 39 | /* Check if given framebuffer device is the one bound to this backlight; |
29 | return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ | 40 | return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ |
30 | int (*check_fb)(struct fb_info *); | 41 | int (*check_fb)(struct fb_info *); |
42 | }; | ||
31 | 43 | ||
44 | /* This structure defines all the properties of a backlight */ | ||
45 | struct backlight_properties { | ||
32 | /* Current User requested brightness (0 - max_brightness) */ | 46 | /* Current User requested brightness (0 - max_brightness) */ |
33 | int brightness; | 47 | int brightness; |
34 | /* Maximal value for brightness (read-only) */ | 48 | /* Maximal value for brightness (read-only) */ |
@@ -41,20 +55,34 @@ struct backlight_properties { | |||
41 | }; | 55 | }; |
42 | 56 | ||
43 | struct backlight_device { | 57 | struct backlight_device { |
44 | /* This protects the 'props' field. If 'props' is NULL, the driver that | 58 | /* Backlight properties */ |
59 | struct backlight_properties props; | ||
60 | |||
61 | /* Serialise access to update_status method */ | ||
62 | struct mutex update_lock; | ||
63 | |||
64 | /* This protects the 'ops' field. If 'ops' is NULL, the driver that | ||
45 | registered this device has been unloaded, and if class_get_devdata() | 65 | registered this device has been unloaded, and if class_get_devdata() |
46 | points to something in the body of that driver, it is also invalid. */ | 66 | points to something in the body of that driver, it is also invalid. */ |
47 | struct semaphore sem; | 67 | struct mutex ops_lock; |
48 | /* If this is NULL, the backing module is unloaded */ | 68 | struct backlight_ops *ops; |
49 | struct backlight_properties *props; | 69 | |
50 | /* The framebuffer notifier block */ | 70 | /* The framebuffer notifier block */ |
51 | struct notifier_block fb_notif; | 71 | struct notifier_block fb_notif; |
52 | /* The class device structure */ | 72 | /* The class device structure */ |
53 | struct class_device class_dev; | 73 | struct class_device class_dev; |
54 | }; | 74 | }; |
55 | 75 | ||
76 | static inline void backlight_update_status(struct backlight_device *bd) | ||
77 | { | ||
78 | mutex_lock(&bd->update_lock); | ||
79 | if (bd->ops && bd->ops->update_status) | ||
80 | bd->ops->update_status(bd); | ||
81 | mutex_unlock(&bd->update_lock); | ||
82 | } | ||
83 | |||
56 | extern struct backlight_device *backlight_device_register(const char *name, | 84 | extern struct backlight_device *backlight_device_register(const char *name, |
57 | struct device *dev,void *devdata,struct backlight_properties *bp); | 85 | struct device *dev, void *devdata, struct backlight_ops *ops); |
58 | extern void backlight_device_unregister(struct backlight_device *bd); | 86 | extern void backlight_device_unregister(struct backlight_device *bd); |
59 | 87 | ||
60 | #define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev) | 88 | #define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev) |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index c1e82c514443..2d956cd566ae 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -59,6 +59,7 @@ struct linux_binfmt { | |||
59 | int (*load_shlib)(struct file *); | 59 | int (*load_shlib)(struct file *); |
60 | int (*core_dump)(long signr, struct pt_regs * regs, struct file * file); | 60 | int (*core_dump)(long signr, struct pt_regs * regs, struct file * file); |
61 | unsigned long min_coredump; /* minimal dump size */ | 61 | unsigned long min_coredump; /* minimal dump size */ |
62 | int hasvdso; | ||
62 | }; | 63 | }; |
63 | 64 | ||
64 | extern int register_binfmt(struct linux_binfmt *); | 65 | extern int register_binfmt(struct linux_binfmt *); |
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index bbbe7b4da0bb..f50f04bdbc16 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h | |||
@@ -939,7 +939,7 @@ struct cdrom_device_info { | |||
939 | int speed; /* maximum speed for reading data */ | 939 | int speed; /* maximum speed for reading data */ |
940 | int capacity; /* number of discs in jukebox */ | 940 | int capacity; /* number of discs in jukebox */ |
941 | /* device-related storage */ | 941 | /* device-related storage */ |
942 | int options : 30; /* options flags */ | 942 | unsigned int options : 30; /* options flags */ |
943 | unsigned mc_flags : 2; /* media change buffer flags */ | 943 | unsigned mc_flags : 2; /* media change buffer flags */ |
944 | int use_count; /* number of times device opened */ | 944 | int use_count; /* number of times device opened */ |
945 | char name[20]; /* name of the device type */ | 945 | char name[20]; /* name of the device type */ |
diff --git a/include/linux/cfag12864b.h b/include/linux/cfag12864b.h index 0bc45e69da5a..1605dd8aa646 100644 --- a/include/linux/cfag12864b.h +++ b/include/linux/cfag12864b.h | |||
@@ -73,5 +73,10 @@ extern void cfag12864b_disable(void); | |||
73 | */ | 73 | */ |
74 | extern unsigned char cfag12864b_isenabled(void); | 74 | extern unsigned char cfag12864b_isenabled(void); |
75 | 75 | ||
76 | /* | ||
77 | * Is the module inited? | ||
78 | */ | ||
79 | extern unsigned char cfag12864b_isinited(void); | ||
80 | |||
76 | #endif /* _CFAG12864B_H_ */ | 81 | #endif /* _CFAG12864B_H_ */ |
77 | 82 | ||
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h new file mode 100644 index 000000000000..4ea7e7bcfafe --- /dev/null +++ b/include/linux/clockchips.h | |||
@@ -0,0 +1,142 @@ | |||
1 | /* linux/include/linux/clockchips.h | ||
2 | * | ||
3 | * This file contains the structure definitions for clockchips. | ||
4 | * | ||
5 | * If you are not a clockchip, or the time of day code, you should | ||
6 | * not be including this file! | ||
7 | */ | ||
8 | #ifndef _LINUX_CLOCKCHIPS_H | ||
9 | #define _LINUX_CLOCKCHIPS_H | ||
10 | |||
11 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | ||
12 | |||
13 | #include <linux/clocksource.h> | ||
14 | #include <linux/cpumask.h> | ||
15 | #include <linux/ktime.h> | ||
16 | #include <linux/notifier.h> | ||
17 | |||
18 | struct clock_event_device; | ||
19 | |||
20 | /* Clock event mode commands */ | ||
21 | enum clock_event_mode { | ||
22 | CLOCK_EVT_MODE_UNUSED = 0, | ||
23 | CLOCK_EVT_MODE_SHUTDOWN, | ||
24 | CLOCK_EVT_MODE_PERIODIC, | ||
25 | CLOCK_EVT_MODE_ONESHOT, | ||
26 | }; | ||
27 | |||
28 | /* Clock event notification values */ | ||
29 | enum clock_event_nofitiers { | ||
30 | CLOCK_EVT_NOTIFY_ADD, | ||
31 | CLOCK_EVT_NOTIFY_BROADCAST_ON, | ||
32 | CLOCK_EVT_NOTIFY_BROADCAST_OFF, | ||
33 | CLOCK_EVT_NOTIFY_BROADCAST_ENTER, | ||
34 | CLOCK_EVT_NOTIFY_BROADCAST_EXIT, | ||
35 | CLOCK_EVT_NOTIFY_SUSPEND, | ||
36 | CLOCK_EVT_NOTIFY_RESUME, | ||
37 | CLOCK_EVT_NOTIFY_CPU_DEAD, | ||
38 | }; | ||
39 | |||
40 | /* | ||
41 | * Clock event features | ||
42 | */ | ||
43 | #define CLOCK_EVT_FEAT_PERIODIC 0x000001 | ||
44 | #define CLOCK_EVT_FEAT_ONESHOT 0x000002 | ||
45 | /* | ||
46 | * x86(64) specific misfeatures: | ||
47 | * | ||
48 | * - Clockevent source stops in C3 State and needs broadcast support. | ||
49 | * - Local APIC timer is used as a dummy device. | ||
50 | */ | ||
51 | #define CLOCK_EVT_FEAT_C3STOP 0x000004 | ||
52 | #define CLOCK_EVT_FEAT_DUMMY 0x000008 | ||
53 | |||
54 | /** | ||
55 | * struct clock_event_device - clock event device descriptor | ||
56 | * @name: ptr to clock event name | ||
57 | * @hints: usage hints | ||
58 | * @max_delta_ns: maximum delta value in ns | ||
59 | * @min_delta_ns: minimum delta value in ns | ||
60 | * @mult: nanosecond to cycles multiplier | ||
61 | * @shift: nanoseconds to cycles divisor (power of two) | ||
62 | * @rating: variable to rate clock event devices | ||
63 | * @irq: irq number (only for non cpu local devices) | ||
64 | * @cpumask: cpumask to indicate for which cpus this device works | ||
65 | * @set_next_event: set next event | ||
66 | * @set_mode: set mode function | ||
67 | * @evthandler: Assigned by the framework to be called by the low | ||
68 | * level handler of the event source | ||
69 | * @broadcast: function to broadcast events | ||
70 | * @list: list head for the management code | ||
71 | * @mode: operating mode assigned by the management code | ||
72 | * @next_event: local storage for the next event in oneshot mode | ||
73 | */ | ||
74 | struct clock_event_device { | ||
75 | const char *name; | ||
76 | unsigned int features; | ||
77 | unsigned long max_delta_ns; | ||
78 | unsigned long min_delta_ns; | ||
79 | unsigned long mult; | ||
80 | int shift; | ||
81 | int rating; | ||
82 | int irq; | ||
83 | cpumask_t cpumask; | ||
84 | int (*set_next_event)(unsigned long evt, | ||
85 | struct clock_event_device *); | ||
86 | void (*set_mode)(enum clock_event_mode mode, | ||
87 | struct clock_event_device *); | ||
88 | void (*event_handler)(struct clock_event_device *); | ||
89 | void (*broadcast)(cpumask_t mask); | ||
90 | struct list_head list; | ||
91 | enum clock_event_mode mode; | ||
92 | ktime_t next_event; | ||
93 | }; | ||
94 | |||
95 | /* | ||
96 | * Calculate a multiplication factor for scaled math, which is used to convert | ||
97 | * nanoseconds based values to clock ticks: | ||
98 | * | ||
99 | * clock_ticks = (nanoseconds * factor) >> shift. | ||
100 | * | ||
101 | * div_sc is the rearranged equation to calculate a factor from a given clock | ||
102 | * ticks / nanoseconds ratio: | ||
103 | * | ||
104 | * factor = (clock_ticks << shift) / nanoseconds | ||
105 | */ | ||
106 | static inline unsigned long div_sc(unsigned long ticks, unsigned long nsec, | ||
107 | int shift) | ||
108 | { | ||
109 | uint64_t tmp = ((uint64_t)ticks) << shift; | ||
110 | |||
111 | do_div(tmp, nsec); | ||
112 | return (unsigned long) tmp; | ||
113 | } | ||
114 | |||
115 | /* Clock event layer functions */ | ||
116 | extern unsigned long clockevent_delta2ns(unsigned long latch, | ||
117 | struct clock_event_device *evt); | ||
118 | extern void clockevents_register_device(struct clock_event_device *dev); | ||
119 | |||
120 | extern void clockevents_exchange_device(struct clock_event_device *old, | ||
121 | struct clock_event_device *new); | ||
122 | extern | ||
123 | struct clock_event_device *clockevents_request_device(unsigned int features, | ||
124 | cpumask_t cpumask); | ||
125 | extern void clockevents_release_device(struct clock_event_device *dev); | ||
126 | extern void clockevents_set_mode(struct clock_event_device *dev, | ||
127 | enum clock_event_mode mode); | ||
128 | extern int clockevents_register_notifier(struct notifier_block *nb); | ||
129 | extern void clockevents_unregister_notifier(struct notifier_block *nb); | ||
130 | extern int clockevents_program_event(struct clock_event_device *dev, | ||
131 | ktime_t expires, ktime_t now); | ||
132 | |||
133 | extern void clockevents_notify(unsigned long reason, void *arg); | ||
134 | |||
135 | #else | ||
136 | |||
137 | static inline void clockevents_resume_events(void) { } | ||
138 | #define clockevents_notify(reason, arg) do { } while (0) | ||
139 | |||
140 | #endif | ||
141 | |||
142 | #endif | ||
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 1622d23a8dc3..daa4940cc0f1 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -12,11 +12,13 @@ | |||
12 | #include <linux/timex.h> | 12 | #include <linux/timex.h> |
13 | #include <linux/time.h> | 13 | #include <linux/time.h> |
14 | #include <linux/list.h> | 14 | #include <linux/list.h> |
15 | #include <linux/timer.h> | ||
15 | #include <asm/div64.h> | 16 | #include <asm/div64.h> |
16 | #include <asm/io.h> | 17 | #include <asm/io.h> |
17 | 18 | ||
18 | /* clocksource cycle base type */ | 19 | /* clocksource cycle base type */ |
19 | typedef u64 cycle_t; | 20 | typedef u64 cycle_t; |
21 | struct clocksource; | ||
20 | 22 | ||
21 | /** | 23 | /** |
22 | * struct clocksource - hardware abstraction for a free running counter | 24 | * struct clocksource - hardware abstraction for a free running counter |
@@ -44,8 +46,8 @@ typedef u64 cycle_t; | |||
44 | * subtraction of non 64 bit counters | 46 | * subtraction of non 64 bit counters |
45 | * @mult: cycle to nanosecond multiplier | 47 | * @mult: cycle to nanosecond multiplier |
46 | * @shift: cycle to nanosecond divisor (power of two) | 48 | * @shift: cycle to nanosecond divisor (power of two) |
47 | * @update_callback: called when safe to alter clocksource values | 49 | * @flags: flags describing special properties |
48 | * @is_continuous: defines if clocksource is free-running. | 50 | * @vread: vsyscall based read |
49 | * @cycle_interval: Used internally by timekeeping core, please ignore. | 51 | * @cycle_interval: Used internally by timekeeping core, please ignore. |
50 | * @xtime_interval: Used internally by timekeeping core, please ignore. | 52 | * @xtime_interval: Used internally by timekeeping core, please ignore. |
51 | */ | 53 | */ |
@@ -57,15 +59,30 @@ struct clocksource { | |||
57 | cycle_t mask; | 59 | cycle_t mask; |
58 | u32 mult; | 60 | u32 mult; |
59 | u32 shift; | 61 | u32 shift; |
60 | int (*update_callback)(void); | 62 | unsigned long flags; |
61 | int is_continuous; | 63 | cycle_t (*vread)(void); |
62 | 64 | ||
63 | /* timekeeping specific data, ignore */ | 65 | /* timekeeping specific data, ignore */ |
64 | cycle_t cycle_last, cycle_interval; | 66 | cycle_t cycle_last, cycle_interval; |
65 | u64 xtime_nsec, xtime_interval; | 67 | u64 xtime_nsec, xtime_interval; |
66 | s64 error; | 68 | s64 error; |
69 | |||
70 | #ifdef CONFIG_CLOCKSOURCE_WATCHDOG | ||
71 | /* Watchdog related data, used by the framework */ | ||
72 | struct list_head wd_list; | ||
73 | cycle_t wd_last; | ||
74 | #endif | ||
67 | }; | 75 | }; |
68 | 76 | ||
77 | /* | ||
78 | * Clock source flags bits:: | ||
79 | */ | ||
80 | #define CLOCK_SOURCE_IS_CONTINUOUS 0x01 | ||
81 | #define CLOCK_SOURCE_MUST_VERIFY 0x02 | ||
82 | |||
83 | #define CLOCK_SOURCE_WATCHDOG 0x10 | ||
84 | #define CLOCK_SOURCE_VALID_FOR_HRES 0x20 | ||
85 | |||
69 | /* simplify initialization of mask field */ | 86 | /* simplify initialization of mask field */ |
70 | #define CLOCKSOURCE_MASK(bits) (cycle_t)(bits<64 ? ((1ULL<<bits)-1) : -1) | 87 | #define CLOCKSOURCE_MASK(bits) (cycle_t)(bits<64 ? ((1ULL<<bits)-1) : -1) |
71 | 88 | ||
@@ -178,8 +195,16 @@ static inline void clocksource_calculate_interval(struct clocksource *c, | |||
178 | 195 | ||
179 | 196 | ||
180 | /* used to install a new clocksource */ | 197 | /* used to install a new clocksource */ |
181 | int clocksource_register(struct clocksource*); | 198 | extern int clocksource_register(struct clocksource*); |
182 | void clocksource_reselect(void); | 199 | extern struct clocksource* clocksource_get_next(void); |
183 | struct clocksource* clocksource_get_next(void); | 200 | extern void clocksource_change_rating(struct clocksource *cs, int rating); |
201 | |||
202 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL | ||
203 | extern void update_vsyscall(struct timespec *ts, struct clocksource *c); | ||
204 | #else | ||
205 | static inline void update_vsyscall(struct timespec *ts, struct clocksource *c) | ||
206 | { | ||
207 | } | ||
208 | #endif | ||
184 | 209 | ||
185 | #endif /* _LINUX_CLOCKSOURCE_H */ | 210 | #endif /* _LINUX_CLOCKSOURCE_H */ |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 7f008f6bfdc3..0899e2cdcdd1 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -84,9 +84,6 @@ struct cpufreq_policy { | |||
84 | unsigned int policy; /* see above */ | 84 | unsigned int policy; /* see above */ |
85 | struct cpufreq_governor *governor; /* see below */ | 85 | struct cpufreq_governor *governor; /* see below */ |
86 | 86 | ||
87 | struct mutex lock; /* CPU ->setpolicy or ->target may | ||
88 | only be called once a time */ | ||
89 | |||
90 | struct work_struct update; /* if update_policy() needs to be | 87 | struct work_struct update; /* if update_policy() needs to be |
91 | * called, but you're in IRQ context */ | 88 | * called, but you're in IRQ context */ |
92 | 89 | ||
@@ -172,11 +169,16 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy, | |||
172 | unsigned int relation); | 169 | unsigned int relation); |
173 | 170 | ||
174 | 171 | ||
175 | extern int cpufreq_driver_getavg(struct cpufreq_policy *policy); | 172 | extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy); |
176 | 173 | ||
177 | int cpufreq_register_governor(struct cpufreq_governor *governor); | 174 | int cpufreq_register_governor(struct cpufreq_governor *governor); |
178 | void cpufreq_unregister_governor(struct cpufreq_governor *governor); | 175 | void cpufreq_unregister_governor(struct cpufreq_governor *governor); |
179 | 176 | ||
177 | int lock_policy_rwsem_read(int cpu); | ||
178 | int lock_policy_rwsem_write(int cpu); | ||
179 | void unlock_policy_rwsem_read(int cpu); | ||
180 | void unlock_policy_rwsem_write(int cpu); | ||
181 | |||
180 | 182 | ||
181 | /********************************************************************* | 183 | /********************************************************************* |
182 | * CPUFREQ DRIVER INTERFACE * | 184 | * CPUFREQ DRIVER INTERFACE * |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index d0e8c8b0e34d..23f55140ccd5 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -398,11 +398,11 @@ extern cpumask_t cpu_present_map; | |||
398 | #endif | 398 | #endif |
399 | 399 | ||
400 | #ifdef CONFIG_SMP | 400 | #ifdef CONFIG_SMP |
401 | int highest_possible_processor_id(void); | 401 | extern int nr_cpu_ids; |
402 | #define any_online_cpu(mask) __any_online_cpu(&(mask)) | 402 | #define any_online_cpu(mask) __any_online_cpu(&(mask)) |
403 | int __any_online_cpu(const cpumask_t *mask); | 403 | int __any_online_cpu(const cpumask_t *mask); |
404 | #else | 404 | #else |
405 | #define highest_possible_processor_id() 0 | 405 | #define nr_cpu_ids 1 |
406 | #define any_online_cpu(mask) 0 | 406 | #define any_online_cpu(mask) 0 |
407 | #endif | 407 | #endif |
408 | 408 | ||
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 047567d34ca7..9fa0983d1aa8 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -33,6 +33,9 @@ struct dentry *debugfs_create_file(const char *name, mode_t mode, | |||
33 | 33 | ||
34 | struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); | 34 | struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); |
35 | 35 | ||
36 | struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, | ||
37 | const char *dest); | ||
38 | |||
36 | void debugfs_remove(struct dentry *dentry); | 39 | void debugfs_remove(struct dentry *dentry); |
37 | 40 | ||
38 | struct dentry *debugfs_create_u8(const char *name, mode_t mode, | 41 | struct dentry *debugfs_create_u8(const char *name, mode_t mode, |
@@ -70,6 +73,13 @@ static inline struct dentry *debugfs_create_dir(const char *name, | |||
70 | return ERR_PTR(-ENODEV); | 73 | return ERR_PTR(-ENODEV); |
71 | } | 74 | } |
72 | 75 | ||
76 | static inline struct dentry *debugfs_create_symlink(const char *name, | ||
77 | struct dentry *parent, | ||
78 | const char *dest) | ||
79 | { | ||
80 | return ERR_PTR(-ENODEV); | ||
81 | } | ||
82 | |||
73 | static inline void debugfs_remove(struct dentry *dentry) | 83 | static inline void debugfs_remove(struct dentry *dentry) |
74 | { } | 84 | { } |
75 | 85 | ||
diff --git a/include/linux/device.h b/include/linux/device.h index 26e4692f2d1a..d1a3a27c3988 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -2,6 +2,7 @@ | |||
2 | * device.h - generic, centralized driver model | 2 | * device.h - generic, centralized driver model |
3 | * | 3 | * |
4 | * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org> | 4 | * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org> |
5 | * Copyright (c) 2004-2007 Greg Kroah-Hartman <gregkh@suse.de> | ||
5 | * | 6 | * |
6 | * This file is released under the GPLv2 | 7 | * This file is released under the GPLv2 |
7 | * | 8 | * |
@@ -101,7 +102,7 @@ extern int bus_unregister_notifier(struct bus_type *bus, | |||
101 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be | 102 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be |
102 | unbound */ | 103 | unbound */ |
103 | 104 | ||
104 | /* driverfs interface for exporting bus attributes */ | 105 | /* sysfs interface for exporting bus attributes */ |
105 | 106 | ||
106 | struct bus_attribute { | 107 | struct bus_attribute { |
107 | struct attribute attr; | 108 | struct attribute attr; |
@@ -146,7 +147,7 @@ extern void put_driver(struct device_driver * drv); | |||
146 | extern struct device_driver *driver_find(const char *name, struct bus_type *bus); | 147 | extern struct device_driver *driver_find(const char *name, struct bus_type *bus); |
147 | extern int driver_probe_done(void); | 148 | extern int driver_probe_done(void); |
148 | 149 | ||
149 | /* driverfs interface for exporting driver attributes */ | 150 | /* sysfs interface for exporting driver attributes */ |
150 | 151 | ||
151 | struct driver_attribute { | 152 | struct driver_attribute { |
152 | struct attribute attr; | 153 | struct attribute attr; |
diff --git a/include/linux/ext4_fs_extents.h b/include/linux/ext4_fs_extents.h index a41cc24568ca..7eb1d73fc5d1 100644 --- a/include/linux/ext4_fs_extents.h +++ b/include/linux/ext4_fs_extents.h | |||
@@ -22,12 +22,12 @@ | |||
22 | #include <linux/ext4_fs.h> | 22 | #include <linux/ext4_fs.h> |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * With AGRESSIVE_TEST defined, the capacity of index/leaf blocks | 25 | * With AGGRESSIVE_TEST defined, the capacity of index/leaf blocks |
26 | * becomes very small, so index split, in-depth growing and | 26 | * becomes very small, so index split, in-depth growing and |
27 | * other hard changes happen much more often. | 27 | * other hard changes happen much more often. |
28 | * This is for debug purposes only. | 28 | * This is for debug purposes only. |
29 | */ | 29 | */ |
30 | #define AGRESSIVE_TEST_ | 30 | #define AGGRESSIVE_TEST_ |
31 | 31 | ||
32 | /* | 32 | /* |
33 | * With EXTENTS_STATS defined, the number of blocks and extents | 33 | * With EXTENTS_STATS defined, the number of blocks and extents |
diff --git a/include/linux/fb.h b/include/linux/fb.h index a78e25683f82..be913ec87169 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -516,13 +516,15 @@ struct fb_cursor_user { | |||
516 | #define FB_EVENT_GET_CONSOLE_MAP 0x07 | 516 | #define FB_EVENT_GET_CONSOLE_MAP 0x07 |
517 | /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ | 517 | /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ |
518 | #define FB_EVENT_SET_CONSOLE_MAP 0x08 | 518 | #define FB_EVENT_SET_CONSOLE_MAP 0x08 |
519 | /* A display blank is requested */ | 519 | /* A hardware display blank change occured */ |
520 | #define FB_EVENT_BLANK 0x09 | 520 | #define FB_EVENT_BLANK 0x09 |
521 | /* Private modelist is to be replaced */ | 521 | /* Private modelist is to be replaced */ |
522 | #define FB_EVENT_NEW_MODELIST 0x0A | 522 | #define FB_EVENT_NEW_MODELIST 0x0A |
523 | /* The resolution of the passed in fb_info about to change and | 523 | /* The resolution of the passed in fb_info about to change and |
524 | all vc's should be changed */ | 524 | all vc's should be changed */ |
525 | #define FB_EVENT_MODE_CHANGE_ALL 0x0B | 525 | #define FB_EVENT_MODE_CHANGE_ALL 0x0B |
526 | /* A software display blank change occured */ | ||
527 | #define FB_EVENT_CONBLANK 0x0C | ||
526 | 528 | ||
527 | struct fb_event { | 529 | struct fb_event { |
528 | struct fb_info *info; | 530 | struct fb_info *info; |
@@ -767,16 +769,13 @@ struct fb_info { | |||
767 | struct fb_videomode *mode; /* current mode */ | 769 | struct fb_videomode *mode; /* current mode */ |
768 | 770 | ||
769 | #ifdef CONFIG_FB_BACKLIGHT | 771 | #ifdef CONFIG_FB_BACKLIGHT |
770 | /* Lock ordering: | ||
771 | * bl_mutex (protects bl_dev and bl_curve) | ||
772 | * bl_dev->sem (backlight class) | ||
773 | */ | ||
774 | struct mutex bl_mutex; | ||
775 | |||
776 | /* assigned backlight device */ | 772 | /* assigned backlight device */ |
773 | /* set before framebuffer registration, | ||
774 | remove after unregister */ | ||
777 | struct backlight_device *bl_dev; | 775 | struct backlight_device *bl_dev; |
778 | 776 | ||
779 | /* Backlight level curve */ | 777 | /* Backlight level curve */ |
778 | struct mutex bl_curve_mutex; | ||
780 | u8 bl_curve[FB_BACKLIGHT_LEVELS]; | 779 | u8 bl_curve[FB_BACKLIGHT_LEVELS]; |
781 | #endif | 780 | #endif |
782 | 781 | ||
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 612472aaa79c..7803014f3a11 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -106,7 +106,7 @@ static inline void account_system_vtime(struct task_struct *tsk) | |||
106 | * always balanced, so the interrupted value of ->hardirq_context | 106 | * always balanced, so the interrupted value of ->hardirq_context |
107 | * will always be restored. | 107 | * will always be restored. |
108 | */ | 108 | */ |
109 | #define irq_enter() \ | 109 | #define __irq_enter() \ |
110 | do { \ | 110 | do { \ |
111 | account_system_vtime(current); \ | 111 | account_system_vtime(current); \ |
112 | add_preempt_count(HARDIRQ_OFFSET); \ | 112 | add_preempt_count(HARDIRQ_OFFSET); \ |
@@ -114,6 +114,11 @@ static inline void account_system_vtime(struct task_struct *tsk) | |||
114 | } while (0) | 114 | } while (0) |
115 | 115 | ||
116 | /* | 116 | /* |
117 | * Enter irq context (on NO_HZ, update jiffies): | ||
118 | */ | ||
119 | extern void irq_enter(void); | ||
120 | |||
121 | /* | ||
117 | * Exit irq context without processing softirqs: | 122 | * Exit irq context without processing softirqs: |
118 | */ | 123 | */ |
119 | #define __irq_exit() \ | 124 | #define __irq_exit() \ |
@@ -128,7 +133,7 @@ static inline void account_system_vtime(struct task_struct *tsk) | |||
128 | */ | 133 | */ |
129 | extern void irq_exit(void); | 134 | extern void irq_exit(void); |
130 | 135 | ||
131 | #define nmi_enter() do { lockdep_off(); irq_enter(); } while (0) | 136 | #define nmi_enter() do { lockdep_off(); __irq_enter(); } while (0) |
132 | #define nmi_exit() do { __irq_exit(); lockdep_on(); } while (0) | 137 | #define nmi_exit() do { __irq_exit(); lockdep_on(); } while (0) |
133 | 138 | ||
134 | #endif /* LINUX_HARDIRQ_H */ | 139 | #endif /* LINUX_HARDIRQ_H */ |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index fca93025ab51..37f9279192a9 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -21,22 +21,72 @@ | |||
21 | #include <linux/list.h> | 21 | #include <linux/list.h> |
22 | #include <linux/wait.h> | 22 | #include <linux/wait.h> |
23 | 23 | ||
24 | struct hrtimer_clock_base; | ||
25 | struct hrtimer_cpu_base; | ||
26 | |||
24 | /* | 27 | /* |
25 | * Mode arguments of xxx_hrtimer functions: | 28 | * Mode arguments of xxx_hrtimer functions: |
26 | */ | 29 | */ |
27 | enum hrtimer_mode { | 30 | enum hrtimer_mode { |
28 | HRTIMER_ABS, /* Time value is absolute */ | 31 | HRTIMER_MODE_ABS, /* Time value is absolute */ |
29 | HRTIMER_REL, /* Time value is relative to now */ | 32 | HRTIMER_MODE_REL, /* Time value is relative to now */ |
30 | }; | 33 | }; |
31 | 34 | ||
35 | /* | ||
36 | * Return values for the callback function | ||
37 | */ | ||
32 | enum hrtimer_restart { | 38 | enum hrtimer_restart { |
33 | HRTIMER_NORESTART, | 39 | HRTIMER_NORESTART, /* Timer is not restarted */ |
34 | HRTIMER_RESTART, | 40 | HRTIMER_RESTART, /* Timer must be restarted */ |
35 | }; | 41 | }; |
36 | 42 | ||
37 | #define HRTIMER_INACTIVE ((void *)1UL) | 43 | /* |
44 | * hrtimer callback modes: | ||
45 | * | ||
46 | * HRTIMER_CB_SOFTIRQ: Callback must run in softirq context | ||
47 | * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context | ||
48 | * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and | ||
49 | * does not restart the timer | ||
50 | * HRTIMER_CB_IRQSAFE_NO_SOFTIRQ: Callback must run in softirq context | ||
51 | * Special mode for tick emultation | ||
52 | */ | ||
53 | enum hrtimer_cb_mode { | ||
54 | HRTIMER_CB_SOFTIRQ, | ||
55 | HRTIMER_CB_IRQSAFE, | ||
56 | HRTIMER_CB_IRQSAFE_NO_RESTART, | ||
57 | HRTIMER_CB_IRQSAFE_NO_SOFTIRQ, | ||
58 | }; | ||
38 | 59 | ||
39 | struct hrtimer_base; | 60 | /* |
61 | * Values to track state of the timer | ||
62 | * | ||
63 | * Possible states: | ||
64 | * | ||
65 | * 0x00 inactive | ||
66 | * 0x01 enqueued into rbtree | ||
67 | * 0x02 callback function running | ||
68 | * 0x04 callback pending (high resolution mode) | ||
69 | * | ||
70 | * Special case: | ||
71 | * 0x03 callback function running and enqueued | ||
72 | * (was requeued on another CPU) | ||
73 | * The "callback function running and enqueued" status is only possible on | ||
74 | * SMP. It happens for example when a posix timer expired and the callback | ||
75 | * queued a signal. Between dropping the lock which protects the posix timer | ||
76 | * and reacquiring the base lock of the hrtimer, another CPU can deliver the | ||
77 | * signal and rearm the timer. We have to preserve the callback running state, | ||
78 | * as otherwise the timer could be removed before the softirq code finishes the | ||
79 | * the handling of the timer. | ||
80 | * | ||
81 | * The HRTIMER_STATE_ENQUEUE bit is always or'ed to the current state to | ||
82 | * preserve the HRTIMER_STATE_CALLBACK bit in the above scenario. | ||
83 | * | ||
84 | * All state transitions are protected by cpu_base->lock. | ||
85 | */ | ||
86 | #define HRTIMER_STATE_INACTIVE 0x00 | ||
87 | #define HRTIMER_STATE_ENQUEUED 0x01 | ||
88 | #define HRTIMER_STATE_CALLBACK 0x02 | ||
89 | #define HRTIMER_STATE_PENDING 0x04 | ||
40 | 90 | ||
41 | /** | 91 | /** |
42 | * struct hrtimer - the basic hrtimer structure | 92 | * struct hrtimer - the basic hrtimer structure |
@@ -46,14 +96,34 @@ struct hrtimer_base; | |||
46 | * which the timer is based. | 96 | * which the timer is based. |
47 | * @function: timer expiry callback function | 97 | * @function: timer expiry callback function |
48 | * @base: pointer to the timer base (per cpu and per clock) | 98 | * @base: pointer to the timer base (per cpu and per clock) |
99 | * @state: state information (See bit values above) | ||
100 | * @cb_mode: high resolution timer feature to select the callback execution | ||
101 | * mode | ||
102 | * @cb_entry: list head to enqueue an expired timer into the callback list | ||
103 | * @start_site: timer statistics field to store the site where the timer | ||
104 | * was started | ||
105 | * @start_comm: timer statistics field to store the name of the process which | ||
106 | * started the timer | ||
107 | * @start_pid: timer statistics field to store the pid of the task which | ||
108 | * started the timer | ||
49 | * | 109 | * |
50 | * The hrtimer structure must be initialized by init_hrtimer_#CLOCKTYPE() | 110 | * The hrtimer structure must be initialized by hrtimer_init() |
51 | */ | 111 | */ |
52 | struct hrtimer { | 112 | struct hrtimer { |
53 | struct rb_node node; | 113 | struct rb_node node; |
54 | ktime_t expires; | 114 | ktime_t expires; |
55 | int (*function)(struct hrtimer *); | 115 | enum hrtimer_restart (*function)(struct hrtimer *); |
56 | struct hrtimer_base *base; | 116 | struct hrtimer_clock_base *base; |
117 | unsigned long state; | ||
118 | #ifdef CONFIG_HIGH_RES_TIMERS | ||
119 | enum hrtimer_cb_mode cb_mode; | ||
120 | struct list_head cb_entry; | ||
121 | #endif | ||
122 | #ifdef CONFIG_TIMER_STATS | ||
123 | void *start_site; | ||
124 | char start_comm[16]; | ||
125 | int start_pid; | ||
126 | #endif | ||
57 | }; | 127 | }; |
58 | 128 | ||
59 | /** | 129 | /** |
@@ -70,37 +140,114 @@ struct hrtimer_sleeper { | |||
70 | 140 | ||
71 | /** | 141 | /** |
72 | * struct hrtimer_base - the timer base for a specific clock | 142 | * struct hrtimer_base - the timer base for a specific clock |
73 | * @index: clock type index for per_cpu support when moving a timer | 143 | * @index: clock type index for per_cpu support when moving a |
74 | * to a base on another cpu. | 144 | * timer to a base on another cpu. |
75 | * @lock: lock protecting the base and associated timers | ||
76 | * @active: red black tree root node for the active timers | 145 | * @active: red black tree root node for the active timers |
77 | * @first: pointer to the timer node which expires first | 146 | * @first: pointer to the timer node which expires first |
78 | * @resolution: the resolution of the clock, in nanoseconds | 147 | * @resolution: the resolution of the clock, in nanoseconds |
79 | * @get_time: function to retrieve the current time of the clock | 148 | * @get_time: function to retrieve the current time of the clock |
80 | * @get_softirq_time: function to retrieve the current time from the softirq | 149 | * @get_softirq_time: function to retrieve the current time from the softirq |
81 | * @curr_timer: the timer which is executing a callback right now | ||
82 | * @softirq_time: the time when running the hrtimer queue in the softirq | 150 | * @softirq_time: the time when running the hrtimer queue in the softirq |
83 | * @lock_key: the lock_class_key for use with lockdep | 151 | * @cb_pending: list of timers where the callback is pending |
152 | * @offset: offset of this clock to the monotonic base | ||
153 | * @reprogram: function to reprogram the timer event | ||
84 | */ | 154 | */ |
85 | struct hrtimer_base { | 155 | struct hrtimer_clock_base { |
156 | struct hrtimer_cpu_base *cpu_base; | ||
86 | clockid_t index; | 157 | clockid_t index; |
87 | spinlock_t lock; | ||
88 | struct rb_root active; | 158 | struct rb_root active; |
89 | struct rb_node *first; | 159 | struct rb_node *first; |
90 | ktime_t resolution; | 160 | ktime_t resolution; |
91 | ktime_t (*get_time)(void); | 161 | ktime_t (*get_time)(void); |
92 | ktime_t (*get_softirq_time)(void); | 162 | ktime_t (*get_softirq_time)(void); |
93 | struct hrtimer *curr_timer; | ||
94 | ktime_t softirq_time; | 163 | ktime_t softirq_time; |
95 | struct lock_class_key lock_key; | 164 | #ifdef CONFIG_HIGH_RES_TIMERS |
165 | ktime_t offset; | ||
166 | int (*reprogram)(struct hrtimer *t, | ||
167 | struct hrtimer_clock_base *b, | ||
168 | ktime_t n); | ||
169 | #endif | ||
170 | }; | ||
171 | |||
172 | #define HRTIMER_MAX_CLOCK_BASES 2 | ||
173 | |||
174 | /* | ||
175 | * struct hrtimer_cpu_base - the per cpu clock bases | ||
176 | * @lock: lock protecting the base and associated clock bases | ||
177 | * and timers | ||
178 | * @lock_key: the lock_class_key for use with lockdep | ||
179 | * @clock_base: array of clock bases for this cpu | ||
180 | * @curr_timer: the timer which is executing a callback right now | ||
181 | * @expires_next: absolute time of the next event which was scheduled | ||
182 | * via clock_set_next_event() | ||
183 | * @hres_active: State of high resolution mode | ||
184 | * @check_clocks: Indictator, when set evaluate time source and clock | ||
185 | * event devices whether high resolution mode can be | ||
186 | * activated. | ||
187 | * @cb_pending: Expired timers are moved from the rbtree to this | ||
188 | * list in the timer interrupt. The list is processed | ||
189 | * in the softirq. | ||
190 | * @nr_events: Total number of timer interrupt events | ||
191 | */ | ||
192 | struct hrtimer_cpu_base { | ||
193 | spinlock_t lock; | ||
194 | struct lock_class_key lock_key; | ||
195 | struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; | ||
196 | #ifdef CONFIG_HIGH_RES_TIMERS | ||
197 | ktime_t expires_next; | ||
198 | int hres_active; | ||
199 | struct list_head cb_pending; | ||
200 | unsigned long nr_events; | ||
201 | #endif | ||
96 | }; | 202 | }; |
97 | 203 | ||
204 | #ifdef CONFIG_HIGH_RES_TIMERS | ||
205 | struct clock_event_device; | ||
206 | |||
207 | extern void clock_was_set(void); | ||
208 | extern void hrtimer_interrupt(struct clock_event_device *dev); | ||
209 | |||
210 | /* | ||
211 | * In high resolution mode the time reference must be read accurate | ||
212 | */ | ||
213 | static inline ktime_t hrtimer_cb_get_time(struct hrtimer *timer) | ||
214 | { | ||
215 | return timer->base->get_time(); | ||
216 | } | ||
217 | |||
218 | /* | ||
219 | * The resolution of the clocks. The resolution value is returned in | ||
220 | * the clock_getres() system call to give application programmers an | ||
221 | * idea of the (in)accuracy of timers. Timer values are rounded up to | ||
222 | * this resolution values. | ||
223 | */ | ||
224 | # define KTIME_HIGH_RES (ktime_t) { .tv64 = 1 } | ||
225 | # define KTIME_MONOTONIC_RES KTIME_HIGH_RES | ||
226 | |||
227 | #else | ||
228 | |||
229 | # define KTIME_MONOTONIC_RES KTIME_LOW_RES | ||
230 | |||
98 | /* | 231 | /* |
99 | * clock_was_set() is a NOP for non- high-resolution systems. The | 232 | * clock_was_set() is a NOP for non- high-resolution systems. The |
100 | * time-sorted order guarantees that a timer does not expire early and | 233 | * time-sorted order guarantees that a timer does not expire early and |
101 | * is expired in the next softirq when the clock was advanced. | 234 | * is expired in the next softirq when the clock was advanced. |
102 | */ | 235 | */ |
103 | #define clock_was_set() do { } while (0) | 236 | static inline void clock_was_set(void) { } |
237 | |||
238 | /* | ||
239 | * In non high resolution mode the time reference is taken from | ||
240 | * the base softirq time variable. | ||
241 | */ | ||
242 | static inline ktime_t hrtimer_cb_get_time(struct hrtimer *timer) | ||
243 | { | ||
244 | return timer->base->softirq_time; | ||
245 | } | ||
246 | |||
247 | #endif | ||
248 | |||
249 | extern ktime_t ktime_get(void); | ||
250 | extern ktime_t ktime_get_real(void); | ||
104 | 251 | ||
105 | /* Exported timer functions: */ | 252 | /* Exported timer functions: */ |
106 | 253 | ||
@@ -114,19 +261,33 @@ extern int hrtimer_start(struct hrtimer *timer, ktime_t tim, | |||
114 | extern int hrtimer_cancel(struct hrtimer *timer); | 261 | extern int hrtimer_cancel(struct hrtimer *timer); |
115 | extern int hrtimer_try_to_cancel(struct hrtimer *timer); | 262 | extern int hrtimer_try_to_cancel(struct hrtimer *timer); |
116 | 263 | ||
117 | #define hrtimer_restart(timer) hrtimer_start((timer), (timer)->expires, HRTIMER_ABS) | 264 | static inline int hrtimer_restart(struct hrtimer *timer) |
265 | { | ||
266 | return hrtimer_start(timer, timer->expires, HRTIMER_MODE_ABS); | ||
267 | } | ||
118 | 268 | ||
119 | /* Query timers: */ | 269 | /* Query timers: */ |
120 | extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer); | 270 | extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer); |
121 | extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp); | 271 | extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp); |
122 | 272 | ||
123 | #ifdef CONFIG_NO_IDLE_HZ | ||
124 | extern ktime_t hrtimer_get_next_event(void); | 273 | extern ktime_t hrtimer_get_next_event(void); |
125 | #endif | ||
126 | 274 | ||
275 | /* | ||
276 | * A timer is active, when it is enqueued into the rbtree or the callback | ||
277 | * function is running. | ||
278 | */ | ||
127 | static inline int hrtimer_active(const struct hrtimer *timer) | 279 | static inline int hrtimer_active(const struct hrtimer *timer) |
128 | { | 280 | { |
129 | return rb_parent(&timer->node) != &timer->node; | 281 | return timer->state != HRTIMER_STATE_INACTIVE; |
282 | } | ||
283 | |||
284 | /* | ||
285 | * Helper function to check, whether the timer is on one of the queues | ||
286 | */ | ||
287 | static inline int hrtimer_is_queued(struct hrtimer *timer) | ||
288 | { | ||
289 | return timer->state & | ||
290 | (HRTIMER_STATE_ENQUEUED | HRTIMER_STATE_PENDING); | ||
130 | } | 291 | } |
131 | 292 | ||
132 | /* Forward a hrtimer so it expires after now: */ | 293 | /* Forward a hrtimer so it expires after now: */ |
@@ -149,4 +310,53 @@ extern void hrtimer_run_queues(void); | |||
149 | /* Bootup initialization: */ | 310 | /* Bootup initialization: */ |
150 | extern void __init hrtimers_init(void); | 311 | extern void __init hrtimers_init(void); |
151 | 312 | ||
313 | #if BITS_PER_LONG < 64 | ||
314 | extern unsigned long ktime_divns(const ktime_t kt, s64 div); | ||
315 | #else /* BITS_PER_LONG < 64 */ | ||
316 | # define ktime_divns(kt, div) (unsigned long)((kt).tv64 / (div)) | ||
317 | #endif | ||
318 | |||
319 | /* Show pending timers: */ | ||
320 | extern void sysrq_timer_list_show(void); | ||
321 | |||
322 | /* | ||
323 | * Timer-statistics info: | ||
324 | */ | ||
325 | #ifdef CONFIG_TIMER_STATS | ||
326 | |||
327 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | ||
328 | void *timerf, char * comm); | ||
329 | |||
330 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) | ||
331 | { | ||
332 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, | ||
333 | timer->function, timer->start_comm); | ||
334 | } | ||
335 | |||
336 | extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, | ||
337 | void *addr); | ||
338 | |||
339 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) | ||
340 | { | ||
341 | __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0)); | ||
342 | } | ||
343 | |||
344 | static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer) | ||
345 | { | ||
346 | timer->start_site = NULL; | ||
347 | } | ||
348 | #else | ||
349 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) | ||
350 | { | ||
351 | } | ||
352 | |||
353 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) | ||
354 | { | ||
355 | } | ||
356 | |||
357 | static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer) | ||
358 | { | ||
359 | } | ||
360 | #endif | ||
361 | |||
152 | #endif | 362 | #endif |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 04e0fa97ac99..79c028251c70 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -636,7 +636,6 @@ typedef struct ide_drive_s { | |||
636 | unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ | 636 | unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ |
637 | unsigned int cyl; /* "real" number of cyls */ | 637 | unsigned int cyl; /* "real" number of cyls */ |
638 | unsigned int drive_data; /* use by tuneproc/selectproc */ | 638 | unsigned int drive_data; /* use by tuneproc/selectproc */ |
639 | unsigned int usage; /* current "open()" count for drive */ | ||
640 | unsigned int failures; /* current failure count */ | 639 | unsigned int failures; /* current failure count */ |
641 | unsigned int max_failures; /* maximum allowed failure count */ | 640 | unsigned int max_failures; /* maximum allowed failure count */ |
642 | u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ | 641 | u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ |
@@ -736,23 +735,22 @@ typedef struct hwif_s { | |||
736 | int (*ide_dma_end)(ide_drive_t *drive); | 735 | int (*ide_dma_end)(ide_drive_t *drive); |
737 | int (*ide_dma_check)(ide_drive_t *drive); | 736 | int (*ide_dma_check)(ide_drive_t *drive); |
738 | int (*ide_dma_on)(ide_drive_t *drive); | 737 | int (*ide_dma_on)(ide_drive_t *drive); |
739 | int (*ide_dma_off_quietly)(ide_drive_t *drive); | 738 | void (*dma_off_quietly)(ide_drive_t *drive); |
740 | int (*ide_dma_test_irq)(ide_drive_t *drive); | 739 | int (*ide_dma_test_irq)(ide_drive_t *drive); |
741 | int (*ide_dma_host_on)(ide_drive_t *drive); | 740 | void (*ide_dma_clear_irq)(ide_drive_t *drive); |
742 | int (*ide_dma_host_off)(ide_drive_t *drive); | 741 | void (*dma_host_on)(ide_drive_t *drive); |
742 | void (*dma_host_off)(ide_drive_t *drive); | ||
743 | int (*ide_dma_lostirq)(ide_drive_t *drive); | 743 | int (*ide_dma_lostirq)(ide_drive_t *drive); |
744 | int (*ide_dma_timeout)(ide_drive_t *drive); | 744 | int (*ide_dma_timeout)(ide_drive_t *drive); |
745 | 745 | ||
746 | void (*OUTB)(u8 addr, unsigned long port); | 746 | void (*OUTB)(u8 addr, unsigned long port); |
747 | void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); | 747 | void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); |
748 | void (*OUTW)(u16 addr, unsigned long port); | 748 | void (*OUTW)(u16 addr, unsigned long port); |
749 | void (*OUTL)(u32 addr, unsigned long port); | ||
750 | void (*OUTSW)(unsigned long port, void *addr, u32 count); | 749 | void (*OUTSW)(unsigned long port, void *addr, u32 count); |
751 | void (*OUTSL)(unsigned long port, void *addr, u32 count); | 750 | void (*OUTSL)(unsigned long port, void *addr, u32 count); |
752 | 751 | ||
753 | u8 (*INB)(unsigned long port); | 752 | u8 (*INB)(unsigned long port); |
754 | u16 (*INW)(unsigned long port); | 753 | u16 (*INW)(unsigned long port); |
755 | u32 (*INL)(unsigned long port); | ||
756 | void (*INSW)(unsigned long port, void *addr, u32 count); | 754 | void (*INSW)(unsigned long port, void *addr, u32 count); |
757 | void (*INSL)(unsigned long port, void *addr, u32 count); | 755 | void (*INSL)(unsigned long port, void *addr, u32 count); |
758 | 756 | ||
@@ -774,7 +772,6 @@ typedef struct hwif_s { | |||
774 | unsigned int cursg; | 772 | unsigned int cursg; |
775 | unsigned int cursg_ofs; | 773 | unsigned int cursg_ofs; |
776 | 774 | ||
777 | int mmio; /* hosts iomio (0) or custom (2) select */ | ||
778 | int rqsize; /* max sectors per request */ | 775 | int rqsize; /* max sectors per request */ |
779 | int irq; /* our irq number */ | 776 | int irq; /* our irq number */ |
780 | 777 | ||
@@ -802,12 +799,11 @@ typedef struct hwif_s { | |||
802 | unsigned udma_four : 1; /* 1=ATA-66 capable, 0=default */ | 799 | unsigned udma_four : 1; /* 1=ATA-66 capable, 0=default */ |
803 | unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */ | 800 | unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */ |
804 | unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */ | 801 | unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */ |
805 | unsigned no_dsc : 1; /* 0 default, 1 dsc_overlap disabled */ | ||
806 | unsigned auto_poll : 1; /* supports nop auto-poll */ | 802 | unsigned auto_poll : 1; /* supports nop auto-poll */ |
807 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ | 803 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ |
808 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ | 804 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ |
809 | unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */ | 805 | unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */ |
810 | unsigned atapi_irq_bogon : 1; /* Generates spurious DMA interrupts in PIO mode */ | 806 | unsigned mmio : 1; /* host uses MMIO */ |
811 | 807 | ||
812 | struct device gendev; | 808 | struct device gendev; |
813 | struct completion gendev_rel_comp; /* To deal with device release() */ | 809 | struct completion gendev_rel_comp; /* To deal with device release() */ |
@@ -1280,8 +1276,9 @@ int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); | |||
1280 | int __ide_dma_bad_drive(ide_drive_t *); | 1276 | int __ide_dma_bad_drive(ide_drive_t *); |
1281 | int __ide_dma_good_drive(ide_drive_t *); | 1277 | int __ide_dma_good_drive(ide_drive_t *); |
1282 | int ide_use_dma(ide_drive_t *); | 1278 | int ide_use_dma(ide_drive_t *); |
1283 | int __ide_dma_off(ide_drive_t *); | 1279 | void ide_dma_off(ide_drive_t *); |
1284 | void ide_dma_verbose(ide_drive_t *); | 1280 | void ide_dma_verbose(ide_drive_t *); |
1281 | int ide_set_dma(ide_drive_t *); | ||
1285 | ide_startstop_t ide_dma_intr(ide_drive_t *); | 1282 | ide_startstop_t ide_dma_intr(ide_drive_t *); |
1286 | 1283 | ||
1287 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1284 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
@@ -1291,9 +1288,9 @@ extern void ide_destroy_dmatable(ide_drive_t *); | |||
1291 | extern int ide_release_dma(ide_hwif_t *); | 1288 | extern int ide_release_dma(ide_hwif_t *); |
1292 | extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int); | 1289 | extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int); |
1293 | 1290 | ||
1294 | extern int __ide_dma_host_off(ide_drive_t *); | 1291 | void ide_dma_host_off(ide_drive_t *); |
1295 | extern int __ide_dma_off_quietly(ide_drive_t *); | 1292 | void ide_dma_off_quietly(ide_drive_t *); |
1296 | extern int __ide_dma_host_on(ide_drive_t *); | 1293 | void ide_dma_host_on(ide_drive_t *); |
1297 | extern int __ide_dma_on(ide_drive_t *); | 1294 | extern int __ide_dma_on(ide_drive_t *); |
1298 | extern int __ide_dma_check(ide_drive_t *); | 1295 | extern int __ide_dma_check(ide_drive_t *); |
1299 | extern int ide_dma_setup(ide_drive_t *); | 1296 | extern int ide_dma_setup(ide_drive_t *); |
@@ -1305,8 +1302,9 @@ extern int __ide_dma_timeout(ide_drive_t *); | |||
1305 | 1302 | ||
1306 | #else | 1303 | #else |
1307 | static inline int ide_use_dma(ide_drive_t *drive) { return 0; } | 1304 | static inline int ide_use_dma(ide_drive_t *drive) { return 0; } |
1308 | static inline int __ide_dma_off(ide_drive_t *drive) { return 0; } | 1305 | static inline void ide_dma_off(ide_drive_t *drive) { ; } |
1309 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } | 1306 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } |
1307 | static inline int ide_set_dma(ide_drive_t *drive) { return 1; } | ||
1310 | #endif /* CONFIG_BLK_DEV_IDEDMA */ | 1308 | #endif /* CONFIG_BLK_DEV_IDEDMA */ |
1311 | 1309 | ||
1312 | #ifndef CONFIG_BLK_DEV_IDEDMA_PCI | 1310 | #ifndef CONFIG_BLK_DEV_IDEDMA_PCI |
@@ -1354,6 +1352,7 @@ extern int ide_dma_enable(ide_drive_t *drive); | |||
1354 | extern char *ide_xfer_verbose(u8 xfer_rate); | 1352 | extern char *ide_xfer_verbose(u8 xfer_rate); |
1355 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); | 1353 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); |
1356 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); | 1354 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); |
1355 | int ide_use_fast_pio(ide_drive_t *); | ||
1357 | 1356 | ||
1358 | u8 ide_dump_status(ide_drive_t *, const char *, u8); | 1357 | u8 ide_dump_status(ide_drive_t *, const char *, u8); |
1359 | 1358 | ||
@@ -1367,7 +1366,6 @@ typedef struct ide_pio_data_s { | |||
1367 | u8 pio_mode; | 1366 | u8 pio_mode; |
1368 | u8 use_iordy; | 1367 | u8 use_iordy; |
1369 | u8 overridden; | 1368 | u8 overridden; |
1370 | u8 blacklisted; | ||
1371 | unsigned int cycle_time; | 1369 | unsigned int cycle_time; |
1372 | } ide_pio_data_t; | 1370 | } ide_pio_data_t; |
1373 | 1371 | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 5a8ba0b8ccba..838cf5a5bd7f 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -42,6 +42,8 @@ | |||
42 | * IRQF_SHARED - allow sharing the irq among several devices | 42 | * IRQF_SHARED - allow sharing the irq among several devices |
43 | * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur | 43 | * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur |
44 | * IRQF_TIMER - Flag to mark this interrupt as timer interrupt | 44 | * IRQF_TIMER - Flag to mark this interrupt as timer interrupt |
45 | * IRQF_PERCPU - Interrupt is per cpu | ||
46 | * IRQF_NOBALANCING - Flag to exclude this interrupt from irq balancing | ||
45 | */ | 47 | */ |
46 | #define IRQF_DISABLED 0x00000020 | 48 | #define IRQF_DISABLED 0x00000020 |
47 | #define IRQF_SAMPLE_RANDOM 0x00000040 | 49 | #define IRQF_SAMPLE_RANDOM 0x00000040 |
@@ -49,6 +51,7 @@ | |||
49 | #define IRQF_PROBE_SHARED 0x00000100 | 51 | #define IRQF_PROBE_SHARED 0x00000100 |
50 | #define IRQF_TIMER 0x00000200 | 52 | #define IRQF_TIMER 0x00000200 |
51 | #define IRQF_PERCPU 0x00000400 | 53 | #define IRQF_PERCPU 0x00000400 |
54 | #define IRQF_NOBALANCING 0x00000800 | ||
52 | 55 | ||
53 | /* | 56 | /* |
54 | * Migration helpers. Scheduled for removal in 1/2007 | 57 | * Migration helpers. Scheduled for removal in 1/2007 |
@@ -239,6 +242,9 @@ enum | |||
239 | BLOCK_SOFTIRQ, | 242 | BLOCK_SOFTIRQ, |
240 | TASKLET_SOFTIRQ, | 243 | TASKLET_SOFTIRQ, |
241 | SCHED_SOFTIRQ, | 244 | SCHED_SOFTIRQ, |
245 | #ifdef CONFIG_HIGH_RES_TIMERS | ||
246 | HRTIMER_SOFTIRQ, | ||
247 | #endif | ||
242 | }; | 248 | }; |
243 | 249 | ||
244 | /* softirq mask and active fields moved to irq_cpustat_t in | 250 | /* softirq mask and active fields moved to irq_cpustat_t in |
@@ -417,4 +423,13 @@ extern int probe_irq_off(unsigned long); /* returns 0 or negative on failure */ | |||
417 | extern unsigned int probe_irq_mask(unsigned long); /* returns mask of ISA interrupts */ | 423 | extern unsigned int probe_irq_mask(unsigned long); /* returns mask of ISA interrupts */ |
418 | #endif | 424 | #endif |
419 | 425 | ||
426 | #ifdef CONFIG_PROC_FS | ||
427 | /* Initialize /proc/irq/ */ | ||
428 | extern void init_irq_proc(void); | ||
429 | #else | ||
430 | static inline void init_irq_proc(void) | ||
431 | { | ||
432 | } | ||
433 | #endif | ||
434 | |||
420 | #endif | 435 | #endif |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 5504b671357f..aa5b3e6178a0 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -31,7 +31,7 @@ typedef void fastcall (*irq_flow_handler_t)(unsigned int irq, | |||
31 | /* | 31 | /* |
32 | * IRQ line status. | 32 | * IRQ line status. |
33 | * | 33 | * |
34 | * Bits 0-16 are reserved for the IRQF_* bits in linux/interrupt.h | 34 | * Bits 0-7 are reserved for the IRQF_* bits in linux/interrupt.h |
35 | * | 35 | * |
36 | * IRQ types | 36 | * IRQ types |
37 | */ | 37 | */ |
@@ -45,28 +45,30 @@ typedef void fastcall (*irq_flow_handler_t)(unsigned int irq, | |||
45 | #define IRQ_TYPE_PROBE 0x00000010 /* Probing in progress */ | 45 | #define IRQ_TYPE_PROBE 0x00000010 /* Probing in progress */ |
46 | 46 | ||
47 | /* Internal flags */ | 47 | /* Internal flags */ |
48 | #define IRQ_INPROGRESS 0x00010000 /* IRQ handler active - do not enter! */ | 48 | #define IRQ_INPROGRESS 0x00000100 /* IRQ handler active - do not enter! */ |
49 | #define IRQ_DISABLED 0x00020000 /* IRQ disabled - do not enter! */ | 49 | #define IRQ_DISABLED 0x00000200 /* IRQ disabled - do not enter! */ |
50 | #define IRQ_PENDING 0x00040000 /* IRQ pending - replay on enable */ | 50 | #define IRQ_PENDING 0x00000400 /* IRQ pending - replay on enable */ |
51 | #define IRQ_REPLAY 0x00080000 /* IRQ has been replayed but not acked yet */ | 51 | #define IRQ_REPLAY 0x00000800 /* IRQ has been replayed but not acked yet */ |
52 | #define IRQ_AUTODETECT 0x00100000 /* IRQ is being autodetected */ | 52 | #define IRQ_AUTODETECT 0x00001000 /* IRQ is being autodetected */ |
53 | #define IRQ_WAITING 0x00200000 /* IRQ not yet seen - for autodetection */ | 53 | #define IRQ_WAITING 0x00002000 /* IRQ not yet seen - for autodetection */ |
54 | #define IRQ_LEVEL 0x00400000 /* IRQ level triggered */ | 54 | #define IRQ_LEVEL 0x00004000 /* IRQ level triggered */ |
55 | #define IRQ_MASKED 0x00800000 /* IRQ masked - shouldn't be seen again */ | 55 | #define IRQ_MASKED 0x00008000 /* IRQ masked - shouldn't be seen again */ |
56 | #define IRQ_PER_CPU 0x01000000 /* IRQ is per CPU */ | 56 | #define IRQ_PER_CPU 0x00010000 /* IRQ is per CPU */ |
57 | #define IRQ_NOPROBE 0x00020000 /* IRQ is not valid for probing */ | ||
58 | #define IRQ_NOREQUEST 0x00040000 /* IRQ cannot be requested */ | ||
59 | #define IRQ_NOAUTOEN 0x00080000 /* IRQ will not be enabled on request irq */ | ||
60 | #define IRQ_WAKEUP 0x00100000 /* IRQ triggers system wakeup */ | ||
61 | #define IRQ_MOVE_PENDING 0x00200000 /* need to re-target IRQ destination */ | ||
62 | #define IRQ_NO_BALANCING 0x00400000 /* IRQ is excluded from balancing */ | ||
63 | |||
57 | #ifdef CONFIG_IRQ_PER_CPU | 64 | #ifdef CONFIG_IRQ_PER_CPU |
58 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) | 65 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) |
66 | # define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) | ||
59 | #else | 67 | #else |
60 | # define CHECK_IRQ_PER_CPU(var) 0 | 68 | # define CHECK_IRQ_PER_CPU(var) 0 |
69 | # define IRQ_NO_BALANCING_MASK IRQ_NO_BALANCING | ||
61 | #endif | 70 | #endif |
62 | 71 | ||
63 | #define IRQ_NOPROBE 0x02000000 /* IRQ is not valid for probing */ | ||
64 | #define IRQ_NOREQUEST 0x04000000 /* IRQ cannot be requested */ | ||
65 | #define IRQ_NOAUTOEN 0x08000000 /* IRQ will not be enabled on request irq */ | ||
66 | #define IRQ_DELAYED_DISABLE 0x10000000 /* IRQ disable (masking) happens delayed. */ | ||
67 | #define IRQ_WAKEUP 0x20000000 /* IRQ triggers system wakeup */ | ||
68 | #define IRQ_MOVE_PENDING 0x40000000 /* need to re-target IRQ destination */ | ||
69 | |||
70 | struct proc_dir_entry; | 72 | struct proc_dir_entry; |
71 | struct msi_desc; | 73 | struct msi_desc; |
72 | 74 | ||
@@ -127,6 +129,7 @@ struct irq_chip { | |||
127 | * | 129 | * |
128 | * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()] | 130 | * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()] |
129 | * @chip: low level interrupt hardware access | 131 | * @chip: low level interrupt hardware access |
132 | * @msi_desc: MSI descriptor | ||
130 | * @handler_data: per-IRQ data for the irq_chip methods | 133 | * @handler_data: per-IRQ data for the irq_chip methods |
131 | * @chip_data: platform-specific per-chip private data for the chip | 134 | * @chip_data: platform-specific per-chip private data for the chip |
132 | * methods, to allow shared chip implementations | 135 | * methods, to allow shared chip implementations |
@@ -235,11 +238,21 @@ static inline void set_pending_irq(unsigned int irq, cpumask_t mask) | |||
235 | 238 | ||
236 | #endif /* CONFIG_GENERIC_PENDING_IRQ */ | 239 | #endif /* CONFIG_GENERIC_PENDING_IRQ */ |
237 | 240 | ||
241 | extern int irq_set_affinity(unsigned int irq, cpumask_t cpumask); | ||
242 | extern int irq_can_set_affinity(unsigned int irq); | ||
243 | |||
238 | #else /* CONFIG_SMP */ | 244 | #else /* CONFIG_SMP */ |
239 | 245 | ||
240 | #define move_native_irq(x) | 246 | #define move_native_irq(x) |
241 | #define move_masked_irq(x) | 247 | #define move_masked_irq(x) |
242 | 248 | ||
249 | static inline int irq_set_affinity(unsigned int irq, cpumask_t cpumask) | ||
250 | { | ||
251 | return -EINVAL; | ||
252 | } | ||
253 | |||
254 | static inline int irq_can_set_affinity(unsigned int irq) { return 0; } | ||
255 | |||
243 | #endif /* CONFIG_SMP */ | 256 | #endif /* CONFIG_SMP */ |
244 | 257 | ||
245 | #ifdef CONFIG_IRQBALANCE | 258 | #ifdef CONFIG_IRQBALANCE |
@@ -261,6 +274,11 @@ static inline int select_smp_affinity(unsigned int irq) | |||
261 | 274 | ||
262 | extern int no_irq_affinity; | 275 | extern int no_irq_affinity; |
263 | 276 | ||
277 | static inline int irq_balancing_disabled(unsigned int irq) | ||
278 | { | ||
279 | return irq_desc[irq].status & IRQ_NO_BALANCING_MASK; | ||
280 | } | ||
281 | |||
264 | /* Handle irq action chains: */ | 282 | /* Handle irq action chains: */ |
265 | extern int handle_IRQ_event(unsigned int irq, struct irqaction *action); | 283 | extern int handle_IRQ_event(unsigned int irq, struct irqaction *action); |
266 | 284 | ||
@@ -310,9 +328,6 @@ extern void note_interrupt(unsigned int irq, struct irq_desc *desc, | |||
310 | /* Resending of interrupts :*/ | 328 | /* Resending of interrupts :*/ |
311 | void check_irq_resend(struct irq_desc *desc, unsigned int irq); | 329 | void check_irq_resend(struct irq_desc *desc, unsigned int irq); |
312 | 330 | ||
313 | /* Initialize /proc/irq/ */ | ||
314 | extern void init_irq_proc(void); | ||
315 | |||
316 | /* Enable/disable irq debugging output: */ | 331 | /* Enable/disable irq debugging output: */ |
317 | extern int noirqdebug_setup(char *str); | 332 | extern int noirqdebug_setup(char *str); |
318 | 333 | ||
diff --git a/include/linux/jffs.h b/include/linux/jffs.h deleted file mode 100644 index 92213215277f..000000000000 --- a/include/linux/jffs.h +++ /dev/null | |||
@@ -1,224 +0,0 @@ | |||
1 | /* | ||
2 | * JFFS -- Journalling Flash File System, Linux implementation. | ||
3 | * | ||
4 | * Copyright (C) 1999, 2000 Axis Communications AB. | ||
5 | * | ||
6 | * Created by Finn Hakansson <finn@axis.com>. | ||
7 | * | ||
8 | * This is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * $Id: jffs.h,v 1.20 2001/09/18 21:33:37 dwmw2 Exp $ | ||
14 | * | ||
15 | * Ported to Linux 2.3.x and MTD: | ||
16 | * Copyright (C) 2000 Alexander Larsson (alex@cendio.se), Cendio Systems AB | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #ifndef __LINUX_JFFS_H__ | ||
21 | #define __LINUX_JFFS_H__ | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | #include <linux/completion.h> | ||
25 | |||
26 | #define JFFS_VERSION_STRING "1.0" | ||
27 | |||
28 | /* This is a magic number that is used as an identification number for | ||
29 | this file system. It is written to the super_block structure. */ | ||
30 | #define JFFS_MAGIC_SB_BITMASK 0x07c0 /* 1984 */ | ||
31 | |||
32 | /* This is a magic number that every on-flash raw inode begins with. */ | ||
33 | #define JFFS_MAGIC_BITMASK 0x34383931 /* "1984" */ | ||
34 | |||
35 | /* These two bitmasks are the valid ones for the flash memories we have | ||
36 | for the moment. */ | ||
37 | #define JFFS_EMPTY_BITMASK 0xffffffff | ||
38 | #define JFFS_DIRTY_BITMASK 0x00000000 | ||
39 | |||
40 | /* This is the inode number of the root node. */ | ||
41 | #define JFFS_MIN_INO 1 | ||
42 | |||
43 | /* How many slots in the file hash table should we have? */ | ||
44 | #define JFFS_HASH_SIZE 40 | ||
45 | |||
46 | /* Don't use more than 254 bytes as the maximum allowed length of a file's | ||
47 | name due to errors that could occur during the scanning of the flash | ||
48 | memory. In fact, a name length of 255 or 0xff, could be the result of | ||
49 | an uncompleted write. For instance, if a raw inode is written to the | ||
50 | flash memory and there is a power lossage just before the length of | ||
51 | the name is written, the length 255 would be interpreted as an illegal | ||
52 | value. */ | ||
53 | #define JFFS_MAX_NAME_LEN 254 | ||
54 | |||
55 | /* Commands for ioctl(). */ | ||
56 | #define JFFS_IOCTL_MAGIC 't' | ||
57 | #define JFFS_PRINT_HASH _IO(JFFS_IOCTL_MAGIC, 90) | ||
58 | #define JFFS_PRINT_TREE _IO(JFFS_IOCTL_MAGIC, 91) | ||
59 | #define JFFS_GET_STATUS _IO(JFFS_IOCTL_MAGIC, 92) | ||
60 | |||
61 | /* XXX: This is something that we should try to get rid of in the future. */ | ||
62 | #define JFFS_MODIFY_INODE 0x01 | ||
63 | #define JFFS_MODIFY_NAME 0x02 | ||
64 | #define JFFS_MODIFY_DATA 0x04 | ||
65 | #define JFFS_MODIFY_EXIST 0x08 | ||
66 | |||
67 | struct jffs_control; | ||
68 | |||
69 | /* The JFFS raw inode structure: Used for storage on physical media. */ | ||
70 | /* Perhaps the uid, gid, atime, mtime and ctime members should have | ||
71 | more space due to future changes in the Linux kernel. Anyhow, since | ||
72 | a user of this filesystem probably have to fix a large number of | ||
73 | other things, we have decided to not be forward compatible. */ | ||
74 | struct jffs_raw_inode | ||
75 | { | ||
76 | __u32 magic; /* A constant magic number. */ | ||
77 | __u32 ino; /* Inode number. */ | ||
78 | __u32 pino; /* Parent's inode number. */ | ||
79 | __u32 version; /* Version number. */ | ||
80 | __u32 mode; /* The file's type or mode. */ | ||
81 | __u16 uid; /* The file's owner. */ | ||
82 | __u16 gid; /* The file's group. */ | ||
83 | __u32 atime; /* Last access time. */ | ||
84 | __u32 mtime; /* Last modification time. */ | ||
85 | __u32 ctime; /* Creation time. */ | ||
86 | __u32 offset; /* Where to begin to write. */ | ||
87 | __u32 dsize; /* Size of the node's data. */ | ||
88 | __u32 rsize; /* How much are going to be replaced? */ | ||
89 | __u8 nsize; /* Name length. */ | ||
90 | __u8 nlink; /* Number of links. */ | ||
91 | __u8 spare : 6; /* For future use. */ | ||
92 | __u8 rename : 1; /* Rename to a name of an already existing file? */ | ||
93 | __u8 deleted : 1; /* Has this file been deleted? */ | ||
94 | __u8 accurate; /* The inode is obsolete if accurate == 0. */ | ||
95 | __u32 dchksum; /* Checksum for the data. */ | ||
96 | __u16 nchksum; /* Checksum for the name. */ | ||
97 | __u16 chksum; /* Checksum for the raw inode. */ | ||
98 | }; | ||
99 | |||
100 | /* Define the offset of the accurate byte in struct jffs_raw_inode. */ | ||
101 | #define JFFS_RAW_INODE_ACCURATE_OFFSET (sizeof(struct jffs_raw_inode) \ | ||
102 | - 2 * sizeof(__u32) - sizeof(__u8)) | ||
103 | |||
104 | /* Define the offset of the chksum member in struct jffs_raw_inode. */ | ||
105 | #define JFFS_RAW_INODE_CHKSUM_OFFSET (sizeof(struct jffs_raw_inode) \ | ||
106 | - sizeof(__u16)) | ||
107 | |||
108 | /* Define the offset of the dchksum member in struct jffs_raw_inode. */ | ||
109 | #define JFFS_RAW_INODE_DCHKSUM_OFFSET (sizeof(struct jffs_raw_inode) \ | ||
110 | - sizeof(__u16) - sizeof(__u16) \ | ||
111 | - sizeof(__u32)) | ||
112 | |||
113 | |||
114 | /* The RAM representation of the node. The names of pointers to | ||
115 | jffs_nodes are very often just called `n' in the source code. */ | ||
116 | struct jffs_node | ||
117 | { | ||
118 | __u32 ino; /* Inode number. */ | ||
119 | __u32 version; /* Version number. */ | ||
120 | __u32 data_offset; /* Logic location of the data to insert. */ | ||
121 | __u32 data_size; /* The amount of data this node inserts. */ | ||
122 | __u32 removed_size; /* The amount of data that this node removes. */ | ||
123 | __u32 fm_offset; /* Physical location of the data in the actual | ||
124 | flash memory data chunk. */ | ||
125 | __u8 name_size; /* Size of the name. */ | ||
126 | struct jffs_fm *fm; /* Physical memory information. */ | ||
127 | struct jffs_node *version_prev; | ||
128 | struct jffs_node *version_next; | ||
129 | struct jffs_node *range_prev; | ||
130 | struct jffs_node *range_next; | ||
131 | }; | ||
132 | |||
133 | |||
134 | /* The RAM representation of a file (plain files, directories, | ||
135 | links, etc.). Pointers to jffs_files are normally named `f' | ||
136 | in the JFFS source code. */ | ||
137 | struct jffs_file | ||
138 | { | ||
139 | __u32 ino; /* Inode number. */ | ||
140 | __u32 pino; /* Parent's inode number. */ | ||
141 | __u32 mode; /* file_type, mode */ | ||
142 | __u16 uid; /* owner */ | ||
143 | __u16 gid; /* group */ | ||
144 | __u32 atime; /* Last access time. */ | ||
145 | __u32 mtime; /* Last modification time. */ | ||
146 | __u32 ctime; /* Creation time. */ | ||
147 | __u8 nsize; /* Name length. */ | ||
148 | __u8 nlink; /* Number of links. */ | ||
149 | __u8 deleted; /* Has this file been deleted? */ | ||
150 | char *name; /* The name of this file; NULL-terminated. */ | ||
151 | __u32 size; /* The total size of the file's data. */ | ||
152 | __u32 highest_version; /* The highest version number of this file. */ | ||
153 | struct jffs_control *c; | ||
154 | struct jffs_file *parent; /* Reference to the parent directory. */ | ||
155 | struct jffs_file *children; /* Always NULL for plain files. */ | ||
156 | struct jffs_file *sibling_prev; /* Siblings in the same directory. */ | ||
157 | struct jffs_file *sibling_next; | ||
158 | struct list_head hash; /* hash list. */ | ||
159 | struct jffs_node *range_head; /* The final data. */ | ||
160 | struct jffs_node *range_tail; /* The first data. */ | ||
161 | struct jffs_node *version_head; /* The youngest node. */ | ||
162 | struct jffs_node *version_tail; /* The oldest node. */ | ||
163 | }; | ||
164 | |||
165 | |||
166 | /* This is just a definition of a simple list used for keeping track of | ||
167 | files deleted due to a rename. This list is only used during the | ||
168 | mounting of the file system and only if there have been rename operations | ||
169 | earlier. */ | ||
170 | struct jffs_delete_list | ||
171 | { | ||
172 | __u32 ino; | ||
173 | struct jffs_delete_list *next; | ||
174 | }; | ||
175 | |||
176 | |||
177 | /* A struct for the overall file system control. Pointers to | ||
178 | jffs_control structs are named `c' in the source code. */ | ||
179 | struct jffs_control | ||
180 | { | ||
181 | struct super_block *sb; /* Reference to the VFS super block. */ | ||
182 | struct jffs_file *root; /* The root directory file. */ | ||
183 | struct list_head *hash; /* Hash table for finding files by ino. */ | ||
184 | struct jffs_fmcontrol *fmc; /* Flash memory control structure. */ | ||
185 | __u32 hash_len; /* The size of the hash table. */ | ||
186 | __u32 next_ino; /* Next inode number to use for new files. */ | ||
187 | __u16 building_fs; /* Is the file system being built right now? */ | ||
188 | struct jffs_delete_list *delete_list; /* Track deleted files. */ | ||
189 | pid_t thread_pid; /* GC thread's PID */ | ||
190 | struct task_struct *gc_task; /* GC task struct */ | ||
191 | struct completion gc_thread_comp; /* GC thread exit mutex */ | ||
192 | __u32 gc_minfree_threshold; /* GC trigger thresholds */ | ||
193 | __u32 gc_maxdirty_threshold; | ||
194 | }; | ||
195 | |||
196 | |||
197 | /* Used to inform about flash status. */ | ||
198 | struct jffs_flash_status | ||
199 | { | ||
200 | __u32 size; | ||
201 | __u32 used; | ||
202 | __u32 dirty; | ||
203 | __u32 begin; | ||
204 | __u32 end; | ||
205 | }; | ||
206 | |||
207 | /* This stuff could be used for finding memory leaks. */ | ||
208 | #define JFFS_MEMORY_DEBUG 0 | ||
209 | |||
210 | extern long no_jffs_node; | ||
211 | #if defined(JFFS_MEMORY_DEBUG) && JFFS_MEMORY_DEBUG | ||
212 | extern long no_jffs_control; | ||
213 | extern long no_jffs_raw_inode; | ||
214 | extern long no_jffs_node_ref; | ||
215 | extern long no_jffs_fm; | ||
216 | extern long no_jffs_fmcontrol; | ||
217 | extern long no_hash; | ||
218 | extern long no_name; | ||
219 | #define DJM(x) x | ||
220 | #else | ||
221 | #define DJM(x) | ||
222 | #endif | ||
223 | |||
224 | #endif /* __LINUX_JFFS_H__ */ | ||
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 0ec6e28bccd2..c080f61fb024 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -142,13 +142,13 @@ static inline u64 get_jiffies_64(void) | |||
142 | * | 142 | * |
143 | * And some not so obvious. | 143 | * And some not so obvious. |
144 | * | 144 | * |
145 | * Note that we don't want to return MAX_LONG, because | 145 | * Note that we don't want to return LONG_MAX, because |
146 | * for various timeout reasons we often end up having | 146 | * for various timeout reasons we often end up having |
147 | * to wait "jiffies+1" in order to guarantee that we wait | 147 | * to wait "jiffies+1" in order to guarantee that we wait |
148 | * at _least_ "jiffies" - so "jiffies+1" had better still | 148 | * at _least_ "jiffies" - so "jiffies+1" had better still |
149 | * be positive. | 149 | * be positive. |
150 | */ | 150 | */ |
151 | #define MAX_JIFFY_OFFSET ((~0UL >> 1)-1) | 151 | #define MAX_JIFFY_OFFSET ((LONG_MAX >> 1)-1) |
152 | 152 | ||
153 | /* | 153 | /* |
154 | * We want to do realistic conversions of time so we need to use the same | 154 | * We want to do realistic conversions of time so we need to use the same |
@@ -259,207 +259,23 @@ static inline u64 get_jiffies_64(void) | |||
259 | #endif | 259 | #endif |
260 | 260 | ||
261 | /* | 261 | /* |
262 | * Convert jiffies to milliseconds and back. | 262 | * Convert various time units to each other: |
263 | * | ||
264 | * Avoid unnecessary multiplications/divisions in the | ||
265 | * two most common HZ cases: | ||
266 | */ | ||
267 | static inline unsigned int jiffies_to_msecs(const unsigned long j) | ||
268 | { | ||
269 | #if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ) | ||
270 | return (MSEC_PER_SEC / HZ) * j; | ||
271 | #elif HZ > MSEC_PER_SEC && !(HZ % MSEC_PER_SEC) | ||
272 | return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC); | ||
273 | #else | ||
274 | return (j * MSEC_PER_SEC) / HZ; | ||
275 | #endif | ||
276 | } | ||
277 | |||
278 | static inline unsigned int jiffies_to_usecs(const unsigned long j) | ||
279 | { | ||
280 | #if HZ <= USEC_PER_SEC && !(USEC_PER_SEC % HZ) | ||
281 | return (USEC_PER_SEC / HZ) * j; | ||
282 | #elif HZ > USEC_PER_SEC && !(HZ % USEC_PER_SEC) | ||
283 | return (j + (HZ / USEC_PER_SEC) - 1)/(HZ / USEC_PER_SEC); | ||
284 | #else | ||
285 | return (j * USEC_PER_SEC) / HZ; | ||
286 | #endif | ||
287 | } | ||
288 | |||
289 | static inline unsigned long msecs_to_jiffies(const unsigned int m) | ||
290 | { | ||
291 | if (m > jiffies_to_msecs(MAX_JIFFY_OFFSET)) | ||
292 | return MAX_JIFFY_OFFSET; | ||
293 | #if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ) | ||
294 | return (m + (MSEC_PER_SEC / HZ) - 1) / (MSEC_PER_SEC / HZ); | ||
295 | #elif HZ > MSEC_PER_SEC && !(HZ % MSEC_PER_SEC) | ||
296 | return m * (HZ / MSEC_PER_SEC); | ||
297 | #else | ||
298 | return (m * HZ + MSEC_PER_SEC - 1) / MSEC_PER_SEC; | ||
299 | #endif | ||
300 | } | ||
301 | |||
302 | static inline unsigned long usecs_to_jiffies(const unsigned int u) | ||
303 | { | ||
304 | if (u > jiffies_to_usecs(MAX_JIFFY_OFFSET)) | ||
305 | return MAX_JIFFY_OFFSET; | ||
306 | #if HZ <= USEC_PER_SEC && !(USEC_PER_SEC % HZ) | ||
307 | return (u + (USEC_PER_SEC / HZ) - 1) / (USEC_PER_SEC / HZ); | ||
308 | #elif HZ > USEC_PER_SEC && !(HZ % USEC_PER_SEC) | ||
309 | return u * (HZ / USEC_PER_SEC); | ||
310 | #else | ||
311 | return (u * HZ + USEC_PER_SEC - 1) / USEC_PER_SEC; | ||
312 | #endif | ||
313 | } | ||
314 | |||
315 | /* | ||
316 | * The TICK_NSEC - 1 rounds up the value to the next resolution. Note | ||
317 | * that a remainder subtract here would not do the right thing as the | ||
318 | * resolution values don't fall on second boundries. I.e. the line: | ||
319 | * nsec -= nsec % TICK_NSEC; is NOT a correct resolution rounding. | ||
320 | * | ||
321 | * Rather, we just shift the bits off the right. | ||
322 | * | ||
323 | * The >> (NSEC_JIFFIE_SC - SEC_JIFFIE_SC) converts the scaled nsec | ||
324 | * value to a scaled second value. | ||
325 | */ | ||
326 | static __inline__ unsigned long | ||
327 | timespec_to_jiffies(const struct timespec *value) | ||
328 | { | ||
329 | unsigned long sec = value->tv_sec; | ||
330 | long nsec = value->tv_nsec + TICK_NSEC - 1; | ||
331 | |||
332 | if (sec >= MAX_SEC_IN_JIFFIES){ | ||
333 | sec = MAX_SEC_IN_JIFFIES; | ||
334 | nsec = 0; | ||
335 | } | ||
336 | return (((u64)sec * SEC_CONVERSION) + | ||
337 | (((u64)nsec * NSEC_CONVERSION) >> | ||
338 | (NSEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC; | ||
339 | |||
340 | } | ||
341 | |||
342 | static __inline__ void | ||
343 | jiffies_to_timespec(const unsigned long jiffies, struct timespec *value) | ||
344 | { | ||
345 | /* | ||
346 | * Convert jiffies to nanoseconds and separate with | ||
347 | * one divide. | ||
348 | */ | ||
349 | u64 nsec = (u64)jiffies * TICK_NSEC; | ||
350 | value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_nsec); | ||
351 | } | ||
352 | |||
353 | /* Same for "timeval" | ||
354 | * | ||
355 | * Well, almost. The problem here is that the real system resolution is | ||
356 | * in nanoseconds and the value being converted is in micro seconds. | ||
357 | * Also for some machines (those that use HZ = 1024, in-particular), | ||
358 | * there is a LARGE error in the tick size in microseconds. | ||
359 | |||
360 | * The solution we use is to do the rounding AFTER we convert the | ||
361 | * microsecond part. Thus the USEC_ROUND, the bits to be shifted off. | ||
362 | * Instruction wise, this should cost only an additional add with carry | ||
363 | * instruction above the way it was done above. | ||
364 | */ | ||
365 | static __inline__ unsigned long | ||
366 | timeval_to_jiffies(const struct timeval *value) | ||
367 | { | ||
368 | unsigned long sec = value->tv_sec; | ||
369 | long usec = value->tv_usec; | ||
370 | |||
371 | if (sec >= MAX_SEC_IN_JIFFIES){ | ||
372 | sec = MAX_SEC_IN_JIFFIES; | ||
373 | usec = 0; | ||
374 | } | ||
375 | return (((u64)sec * SEC_CONVERSION) + | ||
376 | (((u64)usec * USEC_CONVERSION + USEC_ROUND) >> | ||
377 | (USEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC; | ||
378 | } | ||
379 | |||
380 | static __inline__ void | ||
381 | jiffies_to_timeval(const unsigned long jiffies, struct timeval *value) | ||
382 | { | ||
383 | /* | ||
384 | * Convert jiffies to nanoseconds and separate with | ||
385 | * one divide. | ||
386 | */ | ||
387 | u64 nsec = (u64)jiffies * TICK_NSEC; | ||
388 | long tv_usec; | ||
389 | |||
390 | value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &tv_usec); | ||
391 | tv_usec /= NSEC_PER_USEC; | ||
392 | value->tv_usec = tv_usec; | ||
393 | } | ||
394 | |||
395 | /* | ||
396 | * Convert jiffies/jiffies_64 to clock_t and back. | ||
397 | */ | 263 | */ |
398 | static inline clock_t jiffies_to_clock_t(long x) | 264 | extern unsigned int jiffies_to_msecs(const unsigned long j); |
399 | { | 265 | extern unsigned int jiffies_to_usecs(const unsigned long j); |
400 | #if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0 | 266 | extern unsigned long msecs_to_jiffies(const unsigned int m); |
401 | return x / (HZ / USER_HZ); | 267 | extern unsigned long usecs_to_jiffies(const unsigned int u); |
402 | #else | 268 | extern unsigned long timespec_to_jiffies(const struct timespec *value); |
403 | u64 tmp = (u64)x * TICK_NSEC; | 269 | extern void jiffies_to_timespec(const unsigned long jiffies, |
404 | do_div(tmp, (NSEC_PER_SEC / USER_HZ)); | 270 | struct timespec *value); |
405 | return (long)tmp; | 271 | extern unsigned long timeval_to_jiffies(const struct timeval *value); |
406 | #endif | 272 | extern void jiffies_to_timeval(const unsigned long jiffies, |
407 | } | 273 | struct timeval *value); |
408 | 274 | extern clock_t jiffies_to_clock_t(long x); | |
409 | static inline unsigned long clock_t_to_jiffies(unsigned long x) | 275 | extern unsigned long clock_t_to_jiffies(unsigned long x); |
410 | { | 276 | extern u64 jiffies_64_to_clock_t(u64 x); |
411 | #if (HZ % USER_HZ)==0 | 277 | extern u64 nsec_to_clock_t(u64 x); |
412 | if (x >= ~0UL / (HZ / USER_HZ)) | 278 | |
413 | return ~0UL; | 279 | #define TIMESTAMP_SIZE 30 |
414 | return x * (HZ / USER_HZ); | ||
415 | #else | ||
416 | u64 jif; | ||
417 | |||
418 | /* Don't worry about loss of precision here .. */ | ||
419 | if (x >= ~0UL / HZ * USER_HZ) | ||
420 | return ~0UL; | ||
421 | |||
422 | /* .. but do try to contain it here */ | ||
423 | jif = x * (u64) HZ; | ||
424 | do_div(jif, USER_HZ); | ||
425 | return jif; | ||
426 | #endif | ||
427 | } | ||
428 | |||
429 | static inline u64 jiffies_64_to_clock_t(u64 x) | ||
430 | { | ||
431 | #if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0 | ||
432 | do_div(x, HZ / USER_HZ); | ||
433 | #else | ||
434 | /* | ||
435 | * There are better ways that don't overflow early, | ||
436 | * but even this doesn't overflow in hundreds of years | ||
437 | * in 64 bits, so.. | ||
438 | */ | ||
439 | x *= TICK_NSEC; | ||
440 | do_div(x, (NSEC_PER_SEC / USER_HZ)); | ||
441 | #endif | ||
442 | return x; | ||
443 | } | ||
444 | |||
445 | static inline u64 nsec_to_clock_t(u64 x) | ||
446 | { | ||
447 | #if (NSEC_PER_SEC % USER_HZ) == 0 | ||
448 | do_div(x, (NSEC_PER_SEC / USER_HZ)); | ||
449 | #elif (USER_HZ % 512) == 0 | ||
450 | x *= USER_HZ/512; | ||
451 | do_div(x, (NSEC_PER_SEC / 512)); | ||
452 | #else | ||
453 | /* | ||
454 | * max relative error 5.7e-8 (1.8s per year) for USER_HZ <= 1024, | ||
455 | * overflow after 64.99 years. | ||
456 | * exact for HZ=60, 72, 90, 120, 144, 180, 300, 600, 900, ... | ||
457 | */ | ||
458 | x *= 9; | ||
459 | do_div(x, (unsigned long)((9ull * NSEC_PER_SEC + (USER_HZ/2)) | ||
460 | / USER_HZ)); | ||
461 | #endif | ||
462 | return x; | ||
463 | } | ||
464 | 280 | ||
465 | #endif | 281 | #endif |
diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h index bceea527dd37..4c2c3737e415 100644 --- a/include/linux/kdev_t.h +++ b/include/linux/kdev_t.h | |||
@@ -87,6 +87,7 @@ static inline unsigned sysv_minor(u32 dev) | |||
87 | return dev & 0x3ffff; | 87 | return dev & 0x3ffff; |
88 | } | 88 | } |
89 | 89 | ||
90 | bool is_lanana_major(unsigned int major); | ||
90 | 91 | ||
91 | #else /* __KERNEL__ */ | 92 | #else /* __KERNEL__ */ |
92 | 93 | ||
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d02425cdd801..696e5ec63f77 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -125,6 +125,7 @@ extern struct kimage *kexec_crash_image; | |||
125 | #define KEXEC_ARCH_PPC (20 << 16) | 125 | #define KEXEC_ARCH_PPC (20 << 16) |
126 | #define KEXEC_ARCH_PPC64 (21 << 16) | 126 | #define KEXEC_ARCH_PPC64 (21 << 16) |
127 | #define KEXEC_ARCH_IA_64 (50 << 16) | 127 | #define KEXEC_ARCH_IA_64 (50 << 16) |
128 | #define KEXEC_ARCH_ARM (40 << 16) | ||
128 | #define KEXEC_ARCH_S390 (22 << 16) | 129 | #define KEXEC_ARCH_S390 (22 << 16) |
129 | #define KEXEC_ARCH_SH (42 << 16) | 130 | #define KEXEC_ARCH_SH (42 << 16) |
130 | #define KEXEC_ARCH_MIPS_LE (10 << 16) | 131 | #define KEXEC_ARCH_MIPS_LE (10 << 16) |
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 10f505c8431d..cc8e674ae27a 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
@@ -28,8 +28,10 @@ | |||
28 | #ifdef CONFIG_KMOD | 28 | #ifdef CONFIG_KMOD |
29 | /* modprobe exit status on success, -ve on error. Return value | 29 | /* modprobe exit status on success, -ve on error. Return value |
30 | * usually useless though. */ | 30 | * usually useless though. */ |
31 | extern void kmod_sysfs_init(void); | ||
31 | extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2))); | 32 | extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2))); |
32 | #else | 33 | #else |
34 | static inline void kmod_sysfs_init(void) {}; | ||
33 | static inline int request_module(const char * name, ...) { return -ENOSYS; } | 35 | static inline int request_module(const char * name, ...) { return -ENOSYS; } |
34 | #endif | 36 | #endif |
35 | 37 | ||
diff --git a/include/linux/ks0108.h b/include/linux/ks0108.h index 8047d4b17bf1..a2c54acceb4e 100644 --- a/include/linux/ks0108.h +++ b/include/linux/ks0108.h | |||
@@ -43,4 +43,7 @@ extern void ks0108_address(unsigned char address); | |||
43 | /* Set the controller's current page (0..7) */ | 43 | /* Set the controller's current page (0..7) */ |
44 | extern void ks0108_page(unsigned char page); | 44 | extern void ks0108_page(unsigned char page); |
45 | 45 | ||
46 | /* Is the module inited? */ | ||
47 | extern unsigned char ks0108_isinited(void); | ||
48 | |||
46 | #endif /* _KS0108_H_ */ | 49 | #endif /* _KS0108_H_ */ |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 7444a6326231..c68c7ac6b232 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -261,8 +261,7 @@ static inline s64 ktime_to_ns(const ktime_t kt) | |||
261 | * idea of the (in)accuracy of timers. Timer values are rounded up to | 261 | * idea of the (in)accuracy of timers. Timer values are rounded up to |
262 | * this resolution values. | 262 | * this resolution values. |
263 | */ | 263 | */ |
264 | #define KTIME_REALTIME_RES (ktime_t){ .tv64 = TICK_NSEC } | 264 | #define KTIME_LOW_RES (ktime_t){ .tv64 = TICK_NSEC } |
265 | #define KTIME_MONOTONIC_RES (ktime_t){ .tv64 = TICK_NSEC } | ||
266 | 265 | ||
267 | /* Get the monotonic time in timespec format: */ | 266 | /* Get the monotonic time in timespec format: */ |
268 | extern void ktime_get_ts(struct timespec *ts); | 267 | extern void ktime_get_ts(struct timespec *ts); |
diff --git a/include/linux/lcd.h b/include/linux/lcd.h index d739b2e7eac2..598793c0745b 100644 --- a/include/linux/lcd.h +++ b/include/linux/lcd.h | |||
@@ -9,22 +9,38 @@ | |||
9 | #define _LINUX_LCD_H | 9 | #define _LINUX_LCD_H |
10 | 10 | ||
11 | #include <linux/device.h> | 11 | #include <linux/device.h> |
12 | #include <linux/mutex.h> | ||
12 | #include <linux/notifier.h> | 13 | #include <linux/notifier.h> |
13 | 14 | ||
15 | /* Notes on locking: | ||
16 | * | ||
17 | * lcd_device->ops_lock is an internal backlight lock protecting the ops | ||
18 | * field and no code outside the core should need to touch it. | ||
19 | * | ||
20 | * Access to set_power() is serialised by the update_lock mutex since | ||
21 | * most drivers seem to need this and historically get it wrong. | ||
22 | * | ||
23 | * Most drivers don't need locking on their get_power() method. | ||
24 | * If yours does, you need to implement it in the driver. You can use the | ||
25 | * update_lock mutex if appropriate. | ||
26 | * | ||
27 | * Any other use of the locks below is probably wrong. | ||
28 | */ | ||
29 | |||
14 | struct lcd_device; | 30 | struct lcd_device; |
15 | struct fb_info; | 31 | struct fb_info; |
16 | 32 | ||
17 | /* This structure defines all the properties of a LCD flat panel. */ | ||
18 | struct lcd_properties { | 33 | struct lcd_properties { |
19 | /* Owner module */ | 34 | /* The maximum value for contrast (read-only) */ |
20 | struct module *owner; | 35 | int max_contrast; |
36 | }; | ||
37 | |||
38 | struct lcd_ops { | ||
21 | /* Get the LCD panel power status (0: full on, 1..3: controller | 39 | /* Get the LCD panel power status (0: full on, 1..3: controller |
22 | power on, flat panel power off, 4: full off), see FB_BLANK_XXX */ | 40 | power on, flat panel power off, 4: full off), see FB_BLANK_XXX */ |
23 | int (*get_power)(struct lcd_device *); | 41 | int (*get_power)(struct lcd_device *); |
24 | /* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */ | 42 | /* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */ |
25 | int (*set_power)(struct lcd_device *, int power); | 43 | int (*set_power)(struct lcd_device *, int power); |
26 | /* The maximum value for contrast (read-only) */ | ||
27 | int max_contrast; | ||
28 | /* Get the current contrast setting (0-max_contrast) */ | 44 | /* Get the current contrast setting (0-max_contrast) */ |
29 | int (*get_contrast)(struct lcd_device *); | 45 | int (*get_contrast)(struct lcd_device *); |
30 | /* Set LCD panel contrast */ | 46 | /* Set LCD panel contrast */ |
@@ -35,20 +51,31 @@ struct lcd_properties { | |||
35 | }; | 51 | }; |
36 | 52 | ||
37 | struct lcd_device { | 53 | struct lcd_device { |
38 | /* This protects the 'props' field. If 'props' is NULL, the driver that | 54 | struct lcd_properties props; |
55 | /* This protects the 'ops' field. If 'ops' is NULL, the driver that | ||
39 | registered this device has been unloaded, and if class_get_devdata() | 56 | registered this device has been unloaded, and if class_get_devdata() |
40 | points to something in the body of that driver, it is also invalid. */ | 57 | points to something in the body of that driver, it is also invalid. */ |
41 | struct semaphore sem; | 58 | struct mutex ops_lock; |
42 | /* If this is NULL, the backing module is unloaded */ | 59 | /* If this is NULL, the backing module is unloaded */ |
43 | struct lcd_properties *props; | 60 | struct lcd_ops *ops; |
61 | /* Serialise access to set_power method */ | ||
62 | struct mutex update_lock; | ||
44 | /* The framebuffer notifier block */ | 63 | /* The framebuffer notifier block */ |
45 | struct notifier_block fb_notif; | 64 | struct notifier_block fb_notif; |
46 | /* The class device structure */ | 65 | /* The class device structure */ |
47 | struct class_device class_dev; | 66 | struct class_device class_dev; |
48 | }; | 67 | }; |
49 | 68 | ||
69 | static inline void lcd_set_power(struct lcd_device *ld, int power) | ||
70 | { | ||
71 | mutex_lock(&ld->update_lock); | ||
72 | if (ld->ops && ld->ops->set_power) | ||
73 | ld->ops->set_power(ld, power); | ||
74 | mutex_unlock(&ld->update_lock); | ||
75 | } | ||
76 | |||
50 | extern struct lcd_device *lcd_device_register(const char *name, | 77 | extern struct lcd_device *lcd_device_register(const char *name, |
51 | void *devdata, struct lcd_properties *lp); | 78 | void *devdata, struct lcd_ops *ops); |
52 | extern void lcd_device_unregister(struct lcd_device *ld); | 79 | extern void lcd_device_unregister(struct lcd_device *ld); |
53 | 80 | ||
54 | #define to_lcd_device(obj) container_of(obj, struct lcd_device, class_dev) | 81 | #define to_lcd_device(obj) container_of(obj, struct lcd_device, class_dev) |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 596e0c18887d..86762a9f52ba 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/ata.h> | 35 | #include <linux/ata.h> |
36 | #include <linux/workqueue.h> | 36 | #include <linux/workqueue.h> |
37 | #include <scsi/scsi_host.h> | 37 | #include <scsi/scsi_host.h> |
38 | #include <linux/acpi.h> | ||
38 | 39 | ||
39 | /* | 40 | /* |
40 | * Define if arch has non-standard setup. This is a _PCI_ standard | 41 | * Define if arch has non-standard setup. This is a _PCI_ standard |
@@ -172,6 +173,7 @@ enum { | |||
172 | ATA_FLAG_DEBUGMSG = (1 << 13), | 173 | ATA_FLAG_DEBUGMSG = (1 << 13), |
173 | ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */ | 174 | ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */ |
174 | ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ | 175 | ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ |
176 | ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ | ||
175 | 177 | ||
176 | /* The following flag belongs to ap->pflags but is kept in | 178 | /* The following flag belongs to ap->pflags but is kept in |
177 | * ap->flags because it's referenced in many LLDs and will be | 179 | * ap->flags because it's referenced in many LLDs and will be |
@@ -494,6 +496,10 @@ struct ata_device { | |||
494 | /* error history */ | 496 | /* error history */ |
495 | struct ata_ering ering; | 497 | struct ata_ering ering; |
496 | unsigned int horkage; /* List of broken features */ | 498 | unsigned int horkage; /* List of broken features */ |
499 | #ifdef CONFIG_SATA_ACPI | ||
500 | /* ACPI objects info */ | ||
501 | acpi_handle obj_handle; | ||
502 | #endif | ||
497 | }; | 503 | }; |
498 | 504 | ||
499 | /* Offset into struct ata_device. Fields above it are maintained | 505 | /* Offset into struct ata_device. Fields above it are maintained |
diff --git a/include/linux/log2.h b/include/linux/log2.h index 99922bedfcc9..57e641e19a81 100644 --- a/include/linux/log2.h +++ b/include/linux/log2.h | |||
@@ -152,7 +152,7 @@ unsigned long __roundup_pow_of_two(unsigned long n) | |||
152 | * roundup_pow_of_two - round the given value up to nearest power of two | 152 | * roundup_pow_of_two - round the given value up to nearest power of two |
153 | * @n - parameter | 153 | * @n - parameter |
154 | * | 154 | * |
155 | * round the given balue up to the nearest power of two | 155 | * round the given value up to the nearest power of two |
156 | * - the result is undefined when n == 0 | 156 | * - the result is undefined when n == 0 |
157 | * - this can be used to initialise global variables from constant data | 157 | * - this can be used to initialise global variables from constant data |
158 | */ | 158 | */ |
diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h index 9850d513ff60..0e39745f5111 100644 --- a/include/linux/minix_fs.h +++ b/include/linux/minix_fs.h | |||
@@ -78,8 +78,7 @@ struct minix_super_block { | |||
78 | * V3 minix super-block data on disk | 78 | * V3 minix super-block data on disk |
79 | */ | 79 | */ |
80 | struct minix3_super_block { | 80 | struct minix3_super_block { |
81 | __u16 s_ninodes; | 81 | __u32 s_ninodes; |
82 | __u16 s_nzones; | ||
83 | __u16 s_pad0; | 82 | __u16 s_pad0; |
84 | __u16 s_imap_blocks; | 83 | __u16 s_imap_blocks; |
85 | __u16 s_zmap_blocks; | 84 | __u16 s_zmap_blocks; |
diff --git a/include/linux/module.h b/include/linux/module.h index 419d3ef293dd..95679eb8571e 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -76,8 +76,6 @@ void sort_extable(struct exception_table_entry *start, | |||
76 | struct exception_table_entry *finish); | 76 | struct exception_table_entry *finish); |
77 | void sort_main_extable(void); | 77 | void sort_main_extable(void); |
78 | 78 | ||
79 | extern struct subsystem module_subsys; | ||
80 | |||
81 | #ifdef MODULE | 79 | #ifdef MODULE |
82 | #define MODULE_GENERIC_TABLE(gtype,name) \ | 80 | #define MODULE_GENERIC_TABLE(gtype,name) \ |
83 | extern const struct gtype##_id __mod_##gtype##_table \ | 81 | extern const struct gtype##_id __mod_##gtype##_table \ |
@@ -467,10 +465,6 @@ int unregister_module_notifier(struct notifier_block * nb); | |||
467 | 465 | ||
468 | extern void print_modules(void); | 466 | extern void print_modules(void); |
469 | 467 | ||
470 | struct device_driver; | ||
471 | void module_add_driver(struct module *, struct device_driver *); | ||
472 | void module_remove_driver(struct device_driver *); | ||
473 | |||
474 | #else /* !CONFIG_MODULES... */ | 468 | #else /* !CONFIG_MODULES... */ |
475 | #define EXPORT_SYMBOL(sym) | 469 | #define EXPORT_SYMBOL(sym) |
476 | #define EXPORT_SYMBOL_GPL(sym) | 470 | #define EXPORT_SYMBOL_GPL(sym) |
@@ -568,18 +562,59 @@ static inline void print_modules(void) | |||
568 | { | 562 | { |
569 | } | 563 | } |
570 | 564 | ||
565 | #endif /* CONFIG_MODULES */ | ||
566 | |||
571 | struct device_driver; | 567 | struct device_driver; |
568 | #ifdef CONFIG_SYSFS | ||
572 | struct module; | 569 | struct module; |
573 | 570 | ||
574 | static inline void module_add_driver(struct module *module, struct device_driver *driver) | 571 | extern struct subsystem module_subsys; |
572 | |||
573 | int mod_sysfs_init(struct module *mod); | ||
574 | int mod_sysfs_setup(struct module *mod, | ||
575 | struct kernel_param *kparam, | ||
576 | unsigned int num_params); | ||
577 | int module_add_modinfo_attrs(struct module *mod); | ||
578 | void module_remove_modinfo_attrs(struct module *mod); | ||
579 | |||
580 | #else /* !CONFIG_SYSFS */ | ||
581 | |||
582 | static inline int mod_sysfs_init(struct module *mod) | ||
575 | { | 583 | { |
584 | return 0; | ||
576 | } | 585 | } |
577 | 586 | ||
578 | static inline void module_remove_driver(struct device_driver *driver) | 587 | static inline int mod_sysfs_setup(struct module *mod, |
588 | struct kernel_param *kparam, | ||
589 | unsigned int num_params) | ||
579 | { | 590 | { |
591 | return 0; | ||
580 | } | 592 | } |
581 | 593 | ||
582 | #endif /* CONFIG_MODULES */ | 594 | static inline int module_add_modinfo_attrs(struct module *mod) |
595 | { | ||
596 | return 0; | ||
597 | } | ||
598 | |||
599 | static inline void module_remove_modinfo_attrs(struct module *mod) | ||
600 | { } | ||
601 | |||
602 | #endif /* CONFIG_SYSFS */ | ||
603 | |||
604 | #if defined(CONFIG_SYSFS) && defined(CONFIG_MODULES) | ||
605 | |||
606 | void module_add_driver(struct module *mod, struct device_driver *drv); | ||
607 | void module_remove_driver(struct device_driver *drv); | ||
608 | |||
609 | #else /* not both CONFIG_SYSFS && CONFIG_MODULES */ | ||
610 | |||
611 | static inline void module_add_driver(struct module *mod, struct device_driver *drv) | ||
612 | { } | ||
613 | |||
614 | static inline void module_remove_driver(struct device_driver *drv) | ||
615 | { } | ||
616 | |||
617 | #endif | ||
583 | 618 | ||
584 | #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) | 619 | #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) |
585 | 620 | ||
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 4a189dadb160..c83588c8d08b 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
@@ -59,7 +59,7 @@ struct kparam_array | |||
59 | }; | 59 | }; |
60 | 60 | ||
61 | /* This is the fundamental function for registering boot/module | 61 | /* This is the fundamental function for registering boot/module |
62 | parameters. perm sets the visibility in driverfs: 000 means it's | 62 | parameters. perm sets the visibility in sysfs: 000 means it's |
63 | not there, read bits mean it's readable, write bits mean it's | 63 | not there, read bits mean it's readable, write bits mean it's |
64 | writable. */ | 64 | writable. */ |
65 | #define __module_param_call(prefix, name, set, get, arg, perm) \ | 65 | #define __module_param_call(prefix, name, set, get, arg, perm) \ |
@@ -169,10 +169,22 @@ extern int param_get_string(char *buffer, struct kernel_param *kp); | |||
169 | 169 | ||
170 | struct module; | 170 | struct module; |
171 | 171 | ||
172 | #if defined(CONFIG_SYSFS) && defined(CONFIG_MODULES) | ||
172 | extern int module_param_sysfs_setup(struct module *mod, | 173 | extern int module_param_sysfs_setup(struct module *mod, |
173 | struct kernel_param *kparam, | 174 | struct kernel_param *kparam, |
174 | unsigned int num_params); | 175 | unsigned int num_params); |
175 | 176 | ||
176 | extern void module_param_sysfs_remove(struct module *mod); | 177 | extern void module_param_sysfs_remove(struct module *mod); |
178 | #else | ||
179 | static inline int module_param_sysfs_setup(struct module *mod, | ||
180 | struct kernel_param *kparam, | ||
181 | unsigned int num_params) | ||
182 | { | ||
183 | return 0; | ||
184 | } | ||
185 | |||
186 | static inline void module_param_sysfs_remove(struct module *mod) | ||
187 | { } | ||
188 | #endif | ||
177 | 189 | ||
178 | #endif /* _LINUX_MODULE_PARAMS_H */ | 190 | #endif /* _LINUX_MODULE_PARAMS_H */ |
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h index 1221b7c44158..fff8c53e5434 100644 --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h | |||
@@ -92,6 +92,13 @@ struct nand_bbt_descr { | |||
92 | */ | 92 | */ |
93 | #define ONENAND_BADBLOCK_POS 0 | 93 | #define ONENAND_BADBLOCK_POS 0 |
94 | 94 | ||
95 | /* | ||
96 | * Bad block scanning errors | ||
97 | */ | ||
98 | #define ONENAND_BBT_READ_ERROR 1 | ||
99 | #define ONENAND_BBT_READ_ECC_ERROR 2 | ||
100 | #define ONENAND_BBT_READ_FATAL_ERROR 4 | ||
101 | |||
95 | /** | 102 | /** |
96 | * struct bbm_info - [GENERIC] Bad Block Table data structure | 103 | * struct bbm_info - [GENERIC] Bad Block Table data structure |
97 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry | 104 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry |
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index 28d461d862bd..81f3a314dd76 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
@@ -183,7 +183,7 @@ typedef union { | |||
183 | struct map_info { | 183 | struct map_info { |
184 | char *name; | 184 | char *name; |
185 | unsigned long size; | 185 | unsigned long size; |
186 | unsigned long phys; | 186 | resource_size_t phys; |
187 | #define NO_XIP (-1UL) | 187 | #define NO_XIP (-1UL) |
188 | 188 | ||
189 | void __iomem *virt; | 189 | void __iomem *virt; |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index d644e57703ad..6a8570be331b 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -85,6 +85,10 @@ typedef enum { | |||
85 | * mode = MTD_OOB_PLACE) | 85 | * mode = MTD_OOB_PLACE) |
86 | * @datbuf: data buffer - if NULL only oob data are read/written | 86 | * @datbuf: data buffer - if NULL only oob data are read/written |
87 | * @oobbuf: oob data buffer | 87 | * @oobbuf: oob data buffer |
88 | * | ||
89 | * Note, it is allowed to read more then one OOB area at one go, but not write. | ||
90 | * The interface assumes that the OOB write requests program only one page's | ||
91 | * OOB area. | ||
88 | */ | 92 | */ |
89 | struct mtd_oob_ops { | 93 | struct mtd_oob_ops { |
90 | mtd_oob_mode_t mode; | 94 | mtd_oob_mode_t mode; |
@@ -117,18 +121,6 @@ struct mtd_info { | |||
117 | u_int32_t writesize; | 121 | u_int32_t writesize; |
118 | 122 | ||
119 | u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) | 123 | u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) |
120 | u_int32_t ecctype; | ||
121 | u_int32_t eccsize; | ||
122 | |||
123 | /* | ||
124 | * Reuse some of the above unused fields in the case of NOR flash | ||
125 | * with configurable programming regions to avoid modifying the | ||
126 | * user visible structure layout/size. Only valid when the | ||
127 | * MTD_PROGRAM_REGIONS flag is set. | ||
128 | * (Maybe we should have an union for those?) | ||
129 | */ | ||
130 | #define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize | ||
131 | #define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype | ||
132 | 124 | ||
133 | // Kernel-only stuff starts here. | 125 | // Kernel-only stuff starts here. |
134 | char *name; | 126 | char *name; |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 2071b02f0526..97523887fe5d 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -343,6 +343,7 @@ struct nand_buffers { | |||
343 | * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about | 343 | * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about |
344 | * special functionality. See the defines for further explanation | 344 | * special functionality. See the defines for further explanation |
345 | * @badblockpos: [INTERN] position of the bad block marker in the oob area | 345 | * @badblockpos: [INTERN] position of the bad block marker in the oob area |
346 | * @cellinfo: [INTERN] MLC/multichip data from chip ident | ||
346 | * @numchips: [INTERN] number of physical chips | 347 | * @numchips: [INTERN] number of physical chips |
347 | * @chipsize: [INTERN] the size of one chip for multichip arrays | 348 | * @chipsize: [INTERN] the size of one chip for multichip arrays |
348 | * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 | 349 | * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index f775a7af3890..d8af8a95e58d 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/mtd/onenand.h | 2 | * linux/include/linux/mtd/onenand.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2006 Samsung Electronics | 4 | * Copyright (C) 2005-2007 Samsung Electronics |
5 | * Kyungmin Park <kyungmin.park@samsung.com> | 5 | * Kyungmin Park <kyungmin.park@samsung.com> |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -42,14 +42,10 @@ typedef enum { | |||
42 | 42 | ||
43 | /** | 43 | /** |
44 | * struct onenand_bufferram - OneNAND BufferRAM Data | 44 | * struct onenand_bufferram - OneNAND BufferRAM Data |
45 | * @block: block address in BufferRAM | 45 | * @blockpage: block & page address in BufferRAM |
46 | * @page: page address in BufferRAM | ||
47 | * @valid: valid flag | ||
48 | */ | 46 | */ |
49 | struct onenand_bufferram { | 47 | struct onenand_bufferram { |
50 | int block; | 48 | int blockpage; |
51 | int page; | ||
52 | int valid; | ||
53 | }; | 49 | }; |
54 | 50 | ||
55 | /** | 51 | /** |
@@ -63,7 +59,6 @@ struct onenand_bufferram { | |||
63 | * partly be set to inform onenand_scan about | 59 | * partly be set to inform onenand_scan about |
64 | * @erase_shift: [INTERN] number of address bits in a block | 60 | * @erase_shift: [INTERN] number of address bits in a block |
65 | * @page_shift: [INTERN] number of address bits in a page | 61 | * @page_shift: [INTERN] number of address bits in a page |
66 | * @ppb_shift: [INTERN] number of address bits in a pages per block | ||
67 | * @page_mask: [INTERN] a page per block mask | 62 | * @page_mask: [INTERN] a page per block mask |
68 | * @bufferram_index: [INTERN] BufferRAM index | 63 | * @bufferram_index: [INTERN] BufferRAM index |
69 | * @bufferram: [INTERN] BufferRAM info | 64 | * @bufferram: [INTERN] BufferRAM info |
@@ -103,7 +98,6 @@ struct onenand_chip { | |||
103 | 98 | ||
104 | unsigned int erase_shift; | 99 | unsigned int erase_shift; |
105 | unsigned int page_shift; | 100 | unsigned int page_shift; |
106 | unsigned int ppb_shift; /* Pages per block shift */ | ||
107 | unsigned int page_mask; | 101 | unsigned int page_mask; |
108 | 102 | ||
109 | unsigned int bufferram_index; | 103 | unsigned int bufferram_index; |
@@ -150,6 +144,9 @@ struct onenand_chip { | |||
150 | #define ONENAND_SET_SYS_CFG1(v, this) \ | 144 | #define ONENAND_SET_SYS_CFG1(v, this) \ |
151 | (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1)) | 145 | (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1)) |
152 | 146 | ||
147 | #define ONENAND_IS_DDP(this) \ | ||
148 | (this->device_id & ONENAND_DEVICE_IS_DDP) | ||
149 | |||
153 | /* Check byte access in OneNAND */ | 150 | /* Check byte access in OneNAND */ |
154 | #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) | 151 | #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) |
155 | 152 | ||
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index e31c8f5d4271..af94719890e7 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
@@ -3,7 +3,8 @@ | |||
3 | * | 3 | * |
4 | * OneNAND Register header file | 4 | * OneNAND Register header file |
5 | * | 5 | * |
6 | * Copyright (C) 2005-2006 Samsung Electronics | 6 | * Copyright (C) 2005-2007 Samsung Electronics |
7 | * Kyungmin Park <kyungmin.park@samsung.com> | ||
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify | 9 | * 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 | * it under the terms of the GNU General Public License version 2 as |
@@ -80,9 +81,11 @@ | |||
80 | #define ONENAND_VERSION_PROCESS_SHIFT (8) | 81 | #define ONENAND_VERSION_PROCESS_SHIFT (8) |
81 | 82 | ||
82 | /* | 83 | /* |
83 | * Start Address 1 F100h (R/W) | 84 | * Start Address 1 F100h (R/W) & Start Address 2 F101h (R/W) |
84 | */ | 85 | */ |
85 | #define ONENAND_DDP_SHIFT (15) | 86 | #define ONENAND_DDP_SHIFT (15) |
87 | #define ONENAND_DDP_CHIP0 (0) | ||
88 | #define ONENAND_DDP_CHIP1 (1 << ONENAND_DDP_SHIFT) | ||
86 | 89 | ||
87 | /* | 90 | /* |
88 | * Start Address 8 F107h (R/W) | 91 | * Start Address 8 F107h (R/W) |
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h index 86831e3594f6..0dc07d5f3354 100644 --- a/include/linux/mtd/physmap.h +++ b/include/linux/mtd/physmap.h | |||
@@ -18,9 +18,10 @@ | |||
18 | #define __LINUX_MTD_PHYSMAP__ | 18 | #define __LINUX_MTD_PHYSMAP__ |
19 | 19 | ||
20 | #include <linux/mtd/mtd.h> | 20 | #include <linux/mtd/mtd.h> |
21 | #include <linux/mtd/map.h> | ||
22 | #include <linux/mtd/partitions.h> | 21 | #include <linux/mtd/partitions.h> |
23 | 22 | ||
23 | struct map_info; | ||
24 | |||
24 | struct physmap_flash_data { | 25 | struct physmap_flash_data { |
25 | unsigned int width; | 26 | unsigned int width; |
26 | void (*set_vpp)(struct map_info *, int); | 27 | void (*set_vpp)(struct map_info *, int); |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index db05182ca0e8..1be5be88debe 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -105,12 +105,11 @@ struct nfs4_ace { | |||
105 | uint32_t access_mask; | 105 | uint32_t access_mask; |
106 | int whotype; | 106 | int whotype; |
107 | uid_t who; | 107 | uid_t who; |
108 | struct list_head l_ace; | ||
109 | }; | 108 | }; |
110 | 109 | ||
111 | struct nfs4_acl { | 110 | struct nfs4_acl { |
112 | uint32_t naces; | 111 | uint32_t naces; |
113 | struct list_head ace_head; | 112 | struct nfs4_ace aces[0]; |
114 | }; | 113 | }; |
115 | 114 | ||
116 | typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; | 115 | typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; |
diff --git a/include/linux/nfs4_acl.h b/include/linux/nfs4_acl.h index 22aff4d01f20..409b6e02f337 100644 --- a/include/linux/nfs4_acl.h +++ b/include/linux/nfs4_acl.h | |||
@@ -39,9 +39,12 @@ | |||
39 | 39 | ||
40 | #include <linux/posix_acl.h> | 40 | #include <linux/posix_acl.h> |
41 | 41 | ||
42 | struct nfs4_acl *nfs4_acl_new(void); | 42 | /* Maximum ACL we'll accept from client; chosen (somewhat arbitrarily) to |
43 | void nfs4_acl_free(struct nfs4_acl *); | 43 | * fit in a page: */ |
44 | int nfs4_acl_add_ace(struct nfs4_acl *, u32, u32, u32, int, uid_t); | 44 | #define NFS4_ACL_MAX 170 |
45 | |||
46 | struct nfs4_acl *nfs4_acl_new(int); | ||
47 | void nfs4_acl_add_ace(struct nfs4_acl *, u32, u32, u32, int, uid_t); | ||
45 | int nfs4_acl_get_whotype(char *, u32); | 48 | int nfs4_acl_get_whotype(char *, u32); |
46 | int nfs4_acl_write_who(int who, char *p); | 49 | int nfs4_acl_write_who(int who, char *p); |
47 | int nfs4_acl_permission(struct nfs4_acl *acl, uid_t owner, gid_t group, | 50 | int nfs4_acl_permission(struct nfs4_acl *acl, uid_t owner, gid_t group, |
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index acb4ed130247..29af2d5df097 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h | |||
@@ -17,8 +17,15 @@ | |||
17 | #ifdef ARCH_HAS_NMI_WATCHDOG | 17 | #ifdef ARCH_HAS_NMI_WATCHDOG |
18 | #include <asm/nmi.h> | 18 | #include <asm/nmi.h> |
19 | extern void touch_nmi_watchdog(void); | 19 | extern void touch_nmi_watchdog(void); |
20 | extern void acpi_nmi_disable(void); | ||
21 | extern void acpi_nmi_enable(void); | ||
20 | #else | 22 | #else |
21 | # define touch_nmi_watchdog() touch_softlockup_watchdog() | 23 | static inline void touch_nmi_watchdog(void) |
24 | { | ||
25 | touch_softlockup_watchdog(); | ||
26 | } | ||
27 | static inline void acpi_nmi_disable(void) { } | ||
28 | static inline void acpi_nmi_enable(void) { } | ||
22 | #endif | 29 | #endif |
23 | 30 | ||
24 | #ifndef trigger_all_cpu_backtrace | 31 | #ifndef trigger_all_cpu_backtrace |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index b1063e9cdb1b..52c54a5720f3 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
@@ -352,7 +352,7 @@ extern nodemask_t node_possible_map; | |||
352 | #define node_possible(node) node_isset((node), node_possible_map) | 352 | #define node_possible(node) node_isset((node), node_possible_map) |
353 | #define first_online_node first_node(node_online_map) | 353 | #define first_online_node first_node(node_online_map) |
354 | #define next_online_node(nid) next_node((nid), node_online_map) | 354 | #define next_online_node(nid) next_node((nid), node_online_map) |
355 | int highest_possible_node_id(void); | 355 | extern int nr_node_ids; |
356 | #else | 356 | #else |
357 | #define num_online_nodes() 1 | 357 | #define num_online_nodes() 1 |
358 | #define num_possible_nodes() 1 | 358 | #define num_possible_nodes() 1 |
@@ -360,7 +360,7 @@ int highest_possible_node_id(void); | |||
360 | #define node_possible(node) ((node) == 0) | 360 | #define node_possible(node) ((node) == 0) |
361 | #define first_online_node 0 | 361 | #define first_online_node 0 |
362 | #define next_online_node(nid) (MAX_NUMNODES) | 362 | #define next_online_node(nid) (MAX_NUMNODES) |
363 | #define highest_possible_node_id() 0 | 363 | #define nr_node_ids 1 |
364 | #endif | 364 | #endif |
365 | 365 | ||
366 | #define any_online_node(mask) \ | 366 | #define any_online_node(mask) \ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 98c8765a488e..2c4b6842dfb9 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -854,5 +854,8 @@ extern int pci_pci_problems; | |||
854 | #define PCIPCI_ALIMAGIK 32 /* Need low latency setting */ | 854 | #define PCIPCI_ALIMAGIK 32 /* Need low latency setting */ |
855 | #define PCIAGP_FAIL 64 /* No PCI to AGP DMA */ | 855 | #define PCIAGP_FAIL 64 /* No PCI to AGP DMA */ |
856 | 856 | ||
857 | extern unsigned long pci_cardbus_io_size; | ||
858 | extern unsigned long pci_cardbus_mem_size; | ||
859 | |||
857 | #endif /* __KERNEL__ */ | 860 | #endif /* __KERNEL__ */ |
858 | #endif /* LINUX_PCI_H */ | 861 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 182a96f77c84..600308fdf9ce 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2089,6 +2089,7 @@ | |||
2089 | #define PCI_VENDOR_ID_PASEMI 0x1959 | 2089 | #define PCI_VENDOR_ID_PASEMI 0x1959 |
2090 | 2090 | ||
2091 | #define PCI_VENDOR_ID_ATTANSIC 0x1969 | 2091 | #define PCI_VENDOR_ID_ATTANSIC 0x1969 |
2092 | #define PCI_DEVICE_ID_ATTANSIC_L1 0x1048 | ||
2092 | 2093 | ||
2093 | #define PCI_VENDOR_ID_JMICRON 0x197B | 2094 | #define PCI_VENDOR_ID_JMICRON 0x197B |
2094 | #define PCI_DEVICE_ID_JMICRON_JMB360 0x2360 | 2095 | #define PCI_DEVICE_ID_JMICRON_JMB360 0x2360 |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 6b0648cfdffc..52c9eb9b6df2 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define __LINUX_SEQLOCK_H | 2 | #define __LINUX_SEQLOCK_H |
3 | /* | 3 | /* |
4 | * Reader/writer consistent mechanism without starving writers. This type of | 4 | * Reader/writer consistent mechanism without starving writers. This type of |
5 | * lock for data where the reader wants a consitent set of information | 5 | * lock for data where the reader wants a consistent set of information |
6 | * and is willing to retry if the information changes. Readers never | 6 | * and is willing to retry if the information changes. Readers never |
7 | * block but they may have to retry if a writer is in | 7 | * block but they may have to retry if a writer is in |
8 | * progress. Writers do not wait for readers. | 8 | * progress. Writers do not wait for readers. |
diff --git a/include/linux/serio.h b/include/linux/serio.h index ac2c70e7f760..1ebf0455e224 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -108,12 +108,6 @@ static inline void serio_drv_write_wakeup(struct serio *serio) | |||
108 | serio->drv->write_wakeup(serio); | 108 | serio->drv->write_wakeup(serio); |
109 | } | 109 | } |
110 | 110 | ||
111 | static inline void serio_cleanup(struct serio *serio) | ||
112 | { | ||
113 | if (serio->drv && serio->drv->cleanup) | ||
114 | serio->drv->cleanup(serio); | ||
115 | } | ||
116 | |||
117 | /* | 111 | /* |
118 | * Use the following functions to manipulate serio's per-port | 112 | * Use the following functions to manipulate serio's per-port |
119 | * driver-specific data. | 113 | * driver-specific data. |
diff --git a/include/linux/sm501-regs.h b/include/linux/sm501-regs.h new file mode 100644 index 000000000000..cc9be4a11861 --- /dev/null +++ b/include/linux/sm501-regs.h | |||
@@ -0,0 +1,357 @@ | |||
1 | /* sm501-regs.h | ||
2 | * | ||
3 | * Copyright 2006 Simtec Electronics | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * Silicon Motion SM501 register definitions | ||
10 | */ | ||
11 | |||
12 | /* System Configuration area */ | ||
13 | /* System config base */ | ||
14 | #define SM501_SYS_CONFIG (0x000000) | ||
15 | |||
16 | /* config 1 */ | ||
17 | #define SM501_SYSTEM_CONTROL (0x000000) | ||
18 | #define SM501_MISC_CONTROL (0x000004) | ||
19 | |||
20 | #define SM501_MISC_BUS_SH (0x0) | ||
21 | #define SM501_MISC_BUS_PCI (0x1) | ||
22 | #define SM501_MISC_BUS_XSCALE (0x2) | ||
23 | #define SM501_MISC_BUS_NEC (0x6) | ||
24 | #define SM501_MISC_BUS_MASK (0x7) | ||
25 | |||
26 | #define SM501_MISC_VR_62MB (1<<3) | ||
27 | #define SM501_MISC_CDR_RESET (1<<7) | ||
28 | #define SM501_MISC_USB_LB (1<<8) | ||
29 | #define SM501_MISC_USB_SLAVE (1<<9) | ||
30 | #define SM501_MISC_BL_1 (1<<10) | ||
31 | #define SM501_MISC_MC (1<<11) | ||
32 | #define SM501_MISC_DAC_POWER (1<<12) | ||
33 | #define SM501_MISC_IRQ_INVERT (1<<16) | ||
34 | #define SM501_MISC_SH (1<<17) | ||
35 | |||
36 | #define SM501_MISC_HOLD_EMPTY (0<<18) | ||
37 | #define SM501_MISC_HOLD_8 (1<<18) | ||
38 | #define SM501_MISC_HOLD_16 (2<<18) | ||
39 | #define SM501_MISC_HOLD_24 (3<<18) | ||
40 | #define SM501_MISC_HOLD_32 (4<<18) | ||
41 | #define SM501_MISC_HOLD_MASK (7<<18) | ||
42 | |||
43 | #define SM501_MISC_FREQ_12 (1<<24) | ||
44 | #define SM501_MISC_PNL_24BIT (1<<25) | ||
45 | #define SM501_MISC_8051_LE (1<<26) | ||
46 | |||
47 | |||
48 | |||
49 | #define SM501_GPIO31_0_CONTROL (0x000008) | ||
50 | #define SM501_GPIO63_32_CONTROL (0x00000C) | ||
51 | #define SM501_DRAM_CONTROL (0x000010) | ||
52 | |||
53 | /* command list */ | ||
54 | #define SM501_ARBTRTN_CONTROL (0x000014) | ||
55 | |||
56 | /* command list */ | ||
57 | #define SM501_COMMAND_LIST_STATUS (0x000024) | ||
58 | |||
59 | /* interrupt debug */ | ||
60 | #define SM501_RAW_IRQ_STATUS (0x000028) | ||
61 | #define SM501_RAW_IRQ_CLEAR (0x000028) | ||
62 | #define SM501_IRQ_STATUS (0x00002C) | ||
63 | #define SM501_IRQ_MASK (0x000030) | ||
64 | #define SM501_DEBUG_CONTROL (0x000034) | ||
65 | |||
66 | /* power management */ | ||
67 | #define SM501_CURRENT_GATE (0x000038) | ||
68 | #define SM501_CURRENT_CLOCK (0x00003C) | ||
69 | #define SM501_POWER_MODE_0_GATE (0x000040) | ||
70 | #define SM501_POWER_MODE_0_CLOCK (0x000044) | ||
71 | #define SM501_POWER_MODE_1_GATE (0x000048) | ||
72 | #define SM501_POWER_MODE_1_CLOCK (0x00004C) | ||
73 | #define SM501_SLEEP_MODE_GATE (0x000050) | ||
74 | #define SM501_POWER_MODE_CONTROL (0x000054) | ||
75 | |||
76 | /* power gates for units within the 501 */ | ||
77 | #define SM501_GATE_HOST (0) | ||
78 | #define SM501_GATE_MEMORY (1) | ||
79 | #define SM501_GATE_DISPLAY (2) | ||
80 | #define SM501_GATE_2D_ENGINE (3) | ||
81 | #define SM501_GATE_CSC (4) | ||
82 | #define SM501_GATE_ZVPORT (5) | ||
83 | #define SM501_GATE_GPIO (6) | ||
84 | #define SM501_GATE_UART0 (7) | ||
85 | #define SM501_GATE_UART1 (8) | ||
86 | #define SM501_GATE_SSP (10) | ||
87 | #define SM501_GATE_USB_HOST (11) | ||
88 | #define SM501_GATE_USB_GADGET (12) | ||
89 | #define SM501_GATE_UCONTROLLER (17) | ||
90 | #define SM501_GATE_AC97 (18) | ||
91 | |||
92 | /* panel clock */ | ||
93 | #define SM501_CLOCK_P2XCLK (24) | ||
94 | /* crt clock */ | ||
95 | #define SM501_CLOCK_V2XCLK (16) | ||
96 | /* main clock */ | ||
97 | #define SM501_CLOCK_MCLK (8) | ||
98 | /* SDRAM controller clock */ | ||
99 | #define SM501_CLOCK_M1XCLK (0) | ||
100 | |||
101 | /* config 2 */ | ||
102 | #define SM501_PCI_MASTER_BASE (0x000058) | ||
103 | #define SM501_ENDIAN_CONTROL (0x00005C) | ||
104 | #define SM501_DEVICEID (0x000060) | ||
105 | /* 0x050100A0 */ | ||
106 | |||
107 | #define SM501_PLLCLOCK_COUNT (0x000064) | ||
108 | #define SM501_MISC_TIMING (0x000068) | ||
109 | #define SM501_CURRENT_SDRAM_CLOCK (0x00006C) | ||
110 | |||
111 | /* GPIO base */ | ||
112 | #define SM501_GPIO (0x010000) | ||
113 | #define SM501_GPIO_DATA_LOW (0x00) | ||
114 | #define SM501_GPIO_DATA_HIGH (0x04) | ||
115 | #define SM501_GPIO_DDR_LOW (0x08) | ||
116 | #define SM501_GPIO_DDR_HIGH (0x0C) | ||
117 | #define SM501_GPIO_IRQ_SETUP (0x10) | ||
118 | #define SM501_GPIO_IRQ_STATUS (0x14) | ||
119 | #define SM501_GPIO_IRQ_RESET (0x14) | ||
120 | |||
121 | /* I2C controller base */ | ||
122 | #define SM501_I2C (0x010040) | ||
123 | #define SM501_I2C_BYTE_COUNT (0x00) | ||
124 | #define SM501_I2C_CONTROL (0x01) | ||
125 | #define SM501_I2C_STATUS (0x02) | ||
126 | #define SM501_I2C_RESET (0x02) | ||
127 | #define SM501_I2C_SLAVE_ADDRESS (0x03) | ||
128 | #define SM501_I2C_DATA (0x04) | ||
129 | |||
130 | /* SSP base */ | ||
131 | #define SM501_SSP (0x020000) | ||
132 | |||
133 | /* Uart 0 base */ | ||
134 | #define SM501_UART0 (0x030000) | ||
135 | |||
136 | /* Uart 1 base */ | ||
137 | #define SM501_UART1 (0x030020) | ||
138 | |||
139 | /* USB host port base */ | ||
140 | #define SM501_USB_HOST (0x040000) | ||
141 | |||
142 | /* USB slave/gadget base */ | ||
143 | #define SM501_USB_GADGET (0x060000) | ||
144 | |||
145 | /* USB slave/gadget data port base */ | ||
146 | #define SM501_USB_GADGET_DATA (0x070000) | ||
147 | |||
148 | /* Display contoller/video engine base */ | ||
149 | #define SM501_DC (0x080000) | ||
150 | |||
151 | /* common defines for the SM501 address registers */ | ||
152 | #define SM501_ADDR_FLIP (1<<31) | ||
153 | #define SM501_ADDR_EXT (1<<27) | ||
154 | #define SM501_ADDR_CS1 (1<<26) | ||
155 | #define SM501_ADDR_MASK (0x3f << 26) | ||
156 | |||
157 | #define SM501_FIFO_MASK (0x3 << 16) | ||
158 | #define SM501_FIFO_1 (0x0 << 16) | ||
159 | #define SM501_FIFO_3 (0x1 << 16) | ||
160 | #define SM501_FIFO_7 (0x2 << 16) | ||
161 | #define SM501_FIFO_11 (0x3 << 16) | ||
162 | |||
163 | /* common registers for panel and the crt */ | ||
164 | #define SM501_OFF_DC_H_TOT (0x000) | ||
165 | #define SM501_OFF_DC_V_TOT (0x008) | ||
166 | #define SM501_OFF_DC_H_SYNC (0x004) | ||
167 | #define SM501_OFF_DC_V_SYNC (0x00C) | ||
168 | |||
169 | #define SM501_DC_PANEL_CONTROL (0x000) | ||
170 | |||
171 | #define SM501_DC_PANEL_CONTROL_FPEN (1<<27) | ||
172 | #define SM501_DC_PANEL_CONTROL_BIAS (1<<26) | ||
173 | #define SM501_DC_PANEL_CONTROL_DATA (1<<25) | ||
174 | #define SM501_DC_PANEL_CONTROL_VDD (1<<24) | ||
175 | #define SM501_DC_PANEL_CONTROL_DP (1<<23) | ||
176 | |||
177 | #define SM501_DC_PANEL_CONTROL_TFT_888 (0<<21) | ||
178 | #define SM501_DC_PANEL_CONTROL_TFT_333 (1<<21) | ||
179 | #define SM501_DC_PANEL_CONTROL_TFT_444 (2<<21) | ||
180 | |||
181 | #define SM501_DC_PANEL_CONTROL_DE (1<<20) | ||
182 | |||
183 | #define SM501_DC_PANEL_CONTROL_LCD_TFT (0<<18) | ||
184 | #define SM501_DC_PANEL_CONTROL_LCD_STN8 (1<<18) | ||
185 | #define SM501_DC_PANEL_CONTROL_LCD_STN12 (2<<18) | ||
186 | |||
187 | #define SM501_DC_PANEL_CONTROL_CP (1<<14) | ||
188 | #define SM501_DC_PANEL_CONTROL_VSP (1<<13) | ||
189 | #define SM501_DC_PANEL_CONTROL_HSP (1<<12) | ||
190 | #define SM501_DC_PANEL_CONTROL_CK (1<<9) | ||
191 | #define SM501_DC_PANEL_CONTROL_TE (1<<8) | ||
192 | #define SM501_DC_PANEL_CONTROL_VPD (1<<7) | ||
193 | #define SM501_DC_PANEL_CONTROL_VP (1<<6) | ||
194 | #define SM501_DC_PANEL_CONTROL_HPD (1<<5) | ||
195 | #define SM501_DC_PANEL_CONTROL_HP (1<<4) | ||
196 | #define SM501_DC_PANEL_CONTROL_GAMMA (1<<3) | ||
197 | #define SM501_DC_PANEL_CONTROL_EN (1<<2) | ||
198 | |||
199 | #define SM501_DC_PANEL_CONTROL_8BPP (0<<0) | ||
200 | #define SM501_DC_PANEL_CONTROL_16BPP (1<<0) | ||
201 | #define SM501_DC_PANEL_CONTROL_32BPP (2<<0) | ||
202 | |||
203 | |||
204 | #define SM501_DC_PANEL_PANNING_CONTROL (0x004) | ||
205 | #define SM501_DC_PANEL_COLOR_KEY (0x008) | ||
206 | #define SM501_DC_PANEL_FB_ADDR (0x00C) | ||
207 | #define SM501_DC_PANEL_FB_OFFSET (0x010) | ||
208 | #define SM501_DC_PANEL_FB_WIDTH (0x014) | ||
209 | #define SM501_DC_PANEL_FB_HEIGHT (0x018) | ||
210 | #define SM501_DC_PANEL_TL_LOC (0x01C) | ||
211 | #define SM501_DC_PANEL_BR_LOC (0x020) | ||
212 | #define SM501_DC_PANEL_H_TOT (0x024) | ||
213 | #define SM501_DC_PANEL_H_SYNC (0x028) | ||
214 | #define SM501_DC_PANEL_V_TOT (0x02C) | ||
215 | #define SM501_DC_PANEL_V_SYNC (0x030) | ||
216 | #define SM501_DC_PANEL_CUR_LINE (0x034) | ||
217 | |||
218 | #define SM501_DC_VIDEO_CONTROL (0x040) | ||
219 | #define SM501_DC_VIDEO_FB0_ADDR (0x044) | ||
220 | #define SM501_DC_VIDEO_FB_WIDTH (0x048) | ||
221 | #define SM501_DC_VIDEO_FB0_LAST_ADDR (0x04C) | ||
222 | #define SM501_DC_VIDEO_TL_LOC (0x050) | ||
223 | #define SM501_DC_VIDEO_BR_LOC (0x054) | ||
224 | #define SM501_DC_VIDEO_SCALE (0x058) | ||
225 | #define SM501_DC_VIDEO_INIT_SCALE (0x05C) | ||
226 | #define SM501_DC_VIDEO_YUV_CONSTANTS (0x060) | ||
227 | #define SM501_DC_VIDEO_FB1_ADDR (0x064) | ||
228 | #define SM501_DC_VIDEO_FB1_LAST_ADDR (0x068) | ||
229 | |||
230 | #define SM501_DC_VIDEO_ALPHA_CONTROL (0x080) | ||
231 | #define SM501_DC_VIDEO_ALPHA_FB_ADDR (0x084) | ||
232 | #define SM501_DC_VIDEO_ALPHA_FB_OFFSET (0x088) | ||
233 | #define SM501_DC_VIDEO_ALPHA_FB_LAST_ADDR (0x08C) | ||
234 | #define SM501_DC_VIDEO_ALPHA_TL_LOC (0x090) | ||
235 | #define SM501_DC_VIDEO_ALPHA_BR_LOC (0x094) | ||
236 | #define SM501_DC_VIDEO_ALPHA_SCALE (0x098) | ||
237 | #define SM501_DC_VIDEO_ALPHA_INIT_SCALE (0x09C) | ||
238 | #define SM501_DC_VIDEO_ALPHA_CHROMA_KEY (0x0A0) | ||
239 | #define SM501_DC_VIDEO_ALPHA_COLOR_LOOKUP (0x0A4) | ||
240 | |||
241 | #define SM501_DC_PANEL_HWC_BASE (0x0F0) | ||
242 | #define SM501_DC_PANEL_HWC_ADDR (0x0F0) | ||
243 | #define SM501_DC_PANEL_HWC_LOC (0x0F4) | ||
244 | #define SM501_DC_PANEL_HWC_COLOR_1_2 (0x0F8) | ||
245 | #define SM501_DC_PANEL_HWC_COLOR_3 (0x0FC) | ||
246 | |||
247 | #define SM501_HWC_EN (1<<31) | ||
248 | |||
249 | #define SM501_OFF_HWC_ADDR (0x00) | ||
250 | #define SM501_OFF_HWC_LOC (0x04) | ||
251 | #define SM501_OFF_HWC_COLOR_1_2 (0x08) | ||
252 | #define SM501_OFF_HWC_COLOR_3 (0x0C) | ||
253 | |||
254 | #define SM501_DC_ALPHA_CONTROL (0x100) | ||
255 | #define SM501_DC_ALPHA_FB_ADDR (0x104) | ||
256 | #define SM501_DC_ALPHA_FB_OFFSET (0x108) | ||
257 | #define SM501_DC_ALPHA_TL_LOC (0x10C) | ||
258 | #define SM501_DC_ALPHA_BR_LOC (0x110) | ||
259 | #define SM501_DC_ALPHA_CHROMA_KEY (0x114) | ||
260 | #define SM501_DC_ALPHA_COLOR_LOOKUP (0x118) | ||
261 | |||
262 | #define SM501_DC_CRT_CONTROL (0x200) | ||
263 | |||
264 | #define SM501_DC_CRT_CONTROL_TVP (1<<15) | ||
265 | #define SM501_DC_CRT_CONTROL_CP (1<<14) | ||
266 | #define SM501_DC_CRT_CONTROL_VSP (1<<13) | ||
267 | #define SM501_DC_CRT_CONTROL_HSP (1<<12) | ||
268 | #define SM501_DC_CRT_CONTROL_VS (1<<11) | ||
269 | #define SM501_DC_CRT_CONTROL_BLANK (1<<10) | ||
270 | #define SM501_DC_CRT_CONTROL_SEL (1<<9) | ||
271 | #define SM501_DC_CRT_CONTROL_TE (1<<8) | ||
272 | #define SM501_DC_CRT_CONTROL_PIXEL_MASK (0xF << 4) | ||
273 | #define SM501_DC_CRT_CONTROL_GAMMA (1<<3) | ||
274 | #define SM501_DC_CRT_CONTROL_ENABLE (1<<2) | ||
275 | |||
276 | #define SM501_DC_CRT_CONTROL_8BPP (0<<0) | ||
277 | #define SM501_DC_CRT_CONTROL_16BPP (1<<0) | ||
278 | #define SM501_DC_CRT_CONTROL_32BPP (2<<0) | ||
279 | |||
280 | #define SM501_DC_CRT_FB_ADDR (0x204) | ||
281 | #define SM501_DC_CRT_FB_OFFSET (0x208) | ||
282 | #define SM501_DC_CRT_H_TOT (0x20C) | ||
283 | #define SM501_DC_CRT_H_SYNC (0x210) | ||
284 | #define SM501_DC_CRT_V_TOT (0x214) | ||
285 | #define SM501_DC_CRT_V_SYNC (0x218) | ||
286 | #define SM501_DC_CRT_SIGNATURE_ANALYZER (0x21C) | ||
287 | #define SM501_DC_CRT_CUR_LINE (0x220) | ||
288 | #define SM501_DC_CRT_MONITOR_DETECT (0x224) | ||
289 | |||
290 | #define SM501_DC_CRT_HWC_BASE (0x230) | ||
291 | #define SM501_DC_CRT_HWC_ADDR (0x230) | ||
292 | #define SM501_DC_CRT_HWC_LOC (0x234) | ||
293 | #define SM501_DC_CRT_HWC_COLOR_1_2 (0x238) | ||
294 | #define SM501_DC_CRT_HWC_COLOR_3 (0x23C) | ||
295 | |||
296 | #define SM501_DC_PANEL_PALETTE (0x400) | ||
297 | |||
298 | #define SM501_DC_VIDEO_PALETTE (0x800) | ||
299 | |||
300 | #define SM501_DC_CRT_PALETTE (0xC00) | ||
301 | |||
302 | /* Zoom Video port base */ | ||
303 | #define SM501_ZVPORT (0x090000) | ||
304 | |||
305 | /* AC97/I2S base */ | ||
306 | #define SM501_AC97 (0x0A0000) | ||
307 | |||
308 | /* 8051 micro controller base */ | ||
309 | #define SM501_UCONTROLLER (0x0B0000) | ||
310 | |||
311 | /* 8051 micro controller SRAM base */ | ||
312 | #define SM501_UCONTROLLER_SRAM (0x0C0000) | ||
313 | |||
314 | /* DMA base */ | ||
315 | #define SM501_DMA (0x0D0000) | ||
316 | |||
317 | /* 2d engine base */ | ||
318 | #define SM501_2D_ENGINE (0x100000) | ||
319 | #define SM501_2D_SOURCE (0x00) | ||
320 | #define SM501_2D_DESTINATION (0x04) | ||
321 | #define SM501_2D_DIMENSION (0x08) | ||
322 | #define SM501_2D_CONTROL (0x0C) | ||
323 | #define SM501_2D_PITCH (0x10) | ||
324 | #define SM501_2D_FOREGROUND (0x14) | ||
325 | #define SM501_2D_BACKGROUND (0x18) | ||
326 | #define SM501_2D_STRETCH (0x1C) | ||
327 | #define SM501_2D_COLOR_COMPARE (0x20) | ||
328 | #define SM501_2D_COLOR_COMPARE_MASK (0x24) | ||
329 | #define SM501_2D_MASK (0x28) | ||
330 | #define SM501_2D_CLIP_TL (0x2C) | ||
331 | #define SM501_2D_CLIP_BR (0x30) | ||
332 | #define SM501_2D_MONO_PATTERN_LOW (0x34) | ||
333 | #define SM501_2D_MONO_PATTERN_HIGH (0x38) | ||
334 | #define SM501_2D_WINDOW_WIDTH (0x3C) | ||
335 | #define SM501_2D_SOURCE_BASE (0x40) | ||
336 | #define SM501_2D_DESTINATION_BASE (0x44) | ||
337 | #define SM501_2D_ALPHA (0x48) | ||
338 | #define SM501_2D_WRAP (0x4C) | ||
339 | #define SM501_2D_STATUS (0x50) | ||
340 | |||
341 | #define SM501_CSC_Y_SOURCE_BASE (0xC8) | ||
342 | #define SM501_CSC_CONSTANTS (0xCC) | ||
343 | #define SM501_CSC_Y_SOURCE_X (0xD0) | ||
344 | #define SM501_CSC_Y_SOURCE_Y (0xD4) | ||
345 | #define SM501_CSC_U_SOURCE_BASE (0xD8) | ||
346 | #define SM501_CSC_V_SOURCE_BASE (0xDC) | ||
347 | #define SM501_CSC_SOURCE_DIMENSION (0xE0) | ||
348 | #define SM501_CSC_SOURCE_PITCH (0xE4) | ||
349 | #define SM501_CSC_DESTINATION (0xE8) | ||
350 | #define SM501_CSC_DESTINATION_DIMENSION (0xEC) | ||
351 | #define SM501_CSC_DESTINATION_PITCH (0xF0) | ||
352 | #define SM501_CSC_SCALE_FACTOR (0xF4) | ||
353 | #define SM501_CSC_DESTINATION_BASE (0xF8) | ||
354 | #define SM501_CSC_CONTROL (0xFC) | ||
355 | |||
356 | /* 2d engine data port base */ | ||
357 | #define SM501_2D_ENGINE_DATA (0x110000) | ||
diff --git a/include/linux/sm501.h b/include/linux/sm501.h new file mode 100644 index 000000000000..9e3aaad6fe4d --- /dev/null +++ b/include/linux/sm501.h | |||
@@ -0,0 +1,170 @@ | |||
1 | /* include/linux/sm501.h | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * Vincent Sanders <vince@simtec.co.uk> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | extern int sm501_unit_power(struct device *dev, | ||
22 | unsigned int unit, unsigned int to); | ||
23 | |||
24 | extern unsigned long sm501_set_clock(struct device *dev, | ||
25 | int clksrc, unsigned long freq); | ||
26 | |||
27 | extern unsigned long sm501_find_clock(int clksrc, unsigned long req_freq); | ||
28 | |||
29 | /* sm501_misc_control | ||
30 | * | ||
31 | * Modify the SM501's MISC_CONTROL register | ||
32 | */ | ||
33 | |||
34 | extern int sm501_misc_control(struct device *dev, | ||
35 | unsigned long set, unsigned long clear); | ||
36 | |||
37 | /* sm501_modify_reg | ||
38 | * | ||
39 | * Modify a register in the SM501 which may be shared with other | ||
40 | * drivers. | ||
41 | */ | ||
42 | |||
43 | extern unsigned long sm501_modify_reg(struct device *dev, | ||
44 | unsigned long reg, | ||
45 | unsigned long set, | ||
46 | unsigned long clear); | ||
47 | |||
48 | /* sm501_gpio_set | ||
49 | * | ||
50 | * set the state of the given GPIO line | ||
51 | */ | ||
52 | |||
53 | extern void sm501_gpio_set(struct device *dev, | ||
54 | unsigned long gpio, | ||
55 | unsigned int to, | ||
56 | unsigned int dir); | ||
57 | |||
58 | /* sm501_gpio_get | ||
59 | * | ||
60 | * get the state of the given GPIO line | ||
61 | */ | ||
62 | |||
63 | extern unsigned long sm501_gpio_get(struct device *dev, | ||
64 | unsigned long gpio); | ||
65 | |||
66 | |||
67 | /* Platform data definitions */ | ||
68 | |||
69 | #define SM501FB_FLAG_USE_INIT_MODE (1<<0) | ||
70 | #define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1) | ||
71 | #define SM501FB_FLAG_USE_HWCURSOR (1<<2) | ||
72 | #define SM501FB_FLAG_USE_HWACCEL (1<<3) | ||
73 | |||
74 | struct sm501_platdata_fbsub { | ||
75 | struct fb_videomode *def_mode; | ||
76 | unsigned int def_bpp; | ||
77 | unsigned long max_mem; | ||
78 | unsigned int flags; | ||
79 | }; | ||
80 | |||
81 | enum sm501_fb_routing { | ||
82 | SM501_FB_OWN = 0, /* CRT=>CRT, Panel=>Panel */ | ||
83 | SM501_FB_CRT_PANEL = 1, /* Panel=>CRT, Panel=>Panel */ | ||
84 | }; | ||
85 | |||
86 | /* sm501_platdata_fb flag field bit definitions */ | ||
87 | |||
88 | #define SM501_FBPD_SWAP_FB_ENDIAN (1<<0) /* need to endian swap */ | ||
89 | |||
90 | /* sm501_platdata_fb | ||
91 | * | ||
92 | * configuration data for the framebuffer driver | ||
93 | */ | ||
94 | |||
95 | struct sm501_platdata_fb { | ||
96 | enum sm501_fb_routing fb_route; | ||
97 | unsigned int flags; | ||
98 | struct sm501_platdata_fbsub *fb_crt; | ||
99 | struct sm501_platdata_fbsub *fb_pnl; | ||
100 | }; | ||
101 | |||
102 | /* gpio i2c */ | ||
103 | |||
104 | struct sm501_platdata_gpio_i2c { | ||
105 | unsigned int pin_sda; | ||
106 | unsigned int pin_scl; | ||
107 | }; | ||
108 | |||
109 | /* sm501_initdata | ||
110 | * | ||
111 | * use for initialising values that may not have been setup | ||
112 | * before the driver is loaded. | ||
113 | */ | ||
114 | |||
115 | struct sm501_reg_init { | ||
116 | unsigned long set; | ||
117 | unsigned long mask; | ||
118 | }; | ||
119 | |||
120 | #define SM501_USE_USB_HOST (1<<0) | ||
121 | #define SM501_USE_USB_SLAVE (1<<1) | ||
122 | #define SM501_USE_SSP0 (1<<2) | ||
123 | #define SM501_USE_SSP1 (1<<3) | ||
124 | #define SM501_USE_UART0 (1<<4) | ||
125 | #define SM501_USE_UART1 (1<<5) | ||
126 | #define SM501_USE_FBACCEL (1<<6) | ||
127 | #define SM501_USE_AC97 (1<<7) | ||
128 | #define SM501_USE_I2S (1<<8) | ||
129 | |||
130 | #define SM501_USE_ALL (0xffffffff) | ||
131 | |||
132 | struct sm501_initdata { | ||
133 | struct sm501_reg_init gpio_low; | ||
134 | struct sm501_reg_init gpio_high; | ||
135 | struct sm501_reg_init misc_timing; | ||
136 | struct sm501_reg_init misc_control; | ||
137 | |||
138 | unsigned long devices; | ||
139 | unsigned long mclk; /* non-zero to modify */ | ||
140 | unsigned long m1xclk; /* non-zero to modify */ | ||
141 | }; | ||
142 | |||
143 | /* sm501_init_gpio | ||
144 | * | ||
145 | * default gpio settings | ||
146 | */ | ||
147 | |||
148 | struct sm501_init_gpio { | ||
149 | struct sm501_reg_init gpio_data_low; | ||
150 | struct sm501_reg_init gpio_data_high; | ||
151 | struct sm501_reg_init gpio_ddr_low; | ||
152 | struct sm501_reg_init gpio_ddr_high; | ||
153 | }; | ||
154 | |||
155 | /* sm501_platdata | ||
156 | * | ||
157 | * This is passed with the platform device to allow the board | ||
158 | * to control the behaviour of the SM501 driver(s) which attach | ||
159 | * to the device. | ||
160 | * | ||
161 | */ | ||
162 | |||
163 | struct sm501_platdata { | ||
164 | struct sm501_initdata *init; | ||
165 | struct sm501_init_gpio *init_gpiop; | ||
166 | struct sm501_platdata_fb *fb; | ||
167 | |||
168 | struct sm501_platdata_gpio_i2c *gpio_i2c; | ||
169 | unsigned int gpio_i2c_nr; | ||
170 | }; | ||
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index de9fc576fa1c..3069ecca0129 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -150,10 +150,10 @@ struct rpc_call_ops { | |||
150 | #define RPC_TASK_HAS_TIMER 3 | 150 | #define RPC_TASK_HAS_TIMER 3 |
151 | #define RPC_TASK_ACTIVE 4 | 151 | #define RPC_TASK_ACTIVE 4 |
152 | 152 | ||
153 | #define RPC_IS_RUNNING(t) (test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) | 153 | #define RPC_IS_RUNNING(t) test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate) |
154 | #define rpc_set_running(t) (set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) | 154 | #define rpc_set_running(t) set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate) |
155 | #define rpc_test_and_set_running(t) \ | 155 | #define rpc_test_and_set_running(t) \ |
156 | (test_and_set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) | 156 | test_and_set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate) |
157 | #define rpc_clear_running(t) \ | 157 | #define rpc_clear_running(t) \ |
158 | do { \ | 158 | do { \ |
159 | smp_mb__before_clear_bit(); \ | 159 | smp_mb__before_clear_bit(); \ |
@@ -161,8 +161,8 @@ struct rpc_call_ops { | |||
161 | smp_mb__after_clear_bit(); \ | 161 | smp_mb__after_clear_bit(); \ |
162 | } while (0) | 162 | } while (0) |
163 | 163 | ||
164 | #define RPC_IS_QUEUED(t) (test_bit(RPC_TASK_QUEUED, &(t)->tk_runstate)) | 164 | #define RPC_IS_QUEUED(t) test_bit(RPC_TASK_QUEUED, &(t)->tk_runstate) |
165 | #define rpc_set_queued(t) (set_bit(RPC_TASK_QUEUED, &(t)->tk_runstate)) | 165 | #define rpc_set_queued(t) set_bit(RPC_TASK_QUEUED, &(t)->tk_runstate) |
166 | #define rpc_clear_queued(t) \ | 166 | #define rpc_clear_queued(t) \ |
167 | do { \ | 167 | do { \ |
168 | smp_mb__before_clear_bit(); \ | 168 | smp_mb__before_clear_bit(); \ |
@@ -179,7 +179,7 @@ struct rpc_call_ops { | |||
179 | smp_mb__after_clear_bit(); \ | 179 | smp_mb__after_clear_bit(); \ |
180 | } while (0) | 180 | } while (0) |
181 | 181 | ||
182 | #define RPC_IS_ACTIVATED(t) (test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate)) | 182 | #define RPC_IS_ACTIVATED(t) test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate) |
183 | 183 | ||
184 | /* | 184 | /* |
185 | * Task priorities. | 185 | * Task priorities. |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index ec639aa3a1d3..ceb6cc5ceebb 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
@@ -108,7 +108,10 @@ extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | |||
108 | #else | 108 | #else |
109 | 109 | ||
110 | #define make_migration_entry(page, write) swp_entry(0, 0) | 110 | #define make_migration_entry(page, write) swp_entry(0, 0) |
111 | #define is_migration_entry(swp) 0 | 111 | static inline int is_migration_entry(swp_entry_t swp) |
112 | { | ||
113 | return 0; | ||
114 | } | ||
112 | #define migration_entry_to_page(swp) NULL | 115 | #define migration_entry_to_page(swp) NULL |
113 | static inline void make_migration_entry_read(swp_entry_t *entryp) { } | 116 | static inline void make_migration_entry_read(swp_entry_t *entryp) { } |
114 | static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | 117 | static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, |
diff --git a/include/linux/tick.h b/include/linux/tick.h new file mode 100644 index 000000000000..9a7252e089b9 --- /dev/null +++ b/include/linux/tick.h | |||
@@ -0,0 +1,109 @@ | |||
1 | /* linux/include/linux/tick.h | ||
2 | * | ||
3 | * This file contains the structure definitions for tick related functions | ||
4 | * | ||
5 | */ | ||
6 | #ifndef _LINUX_TICK_H | ||
7 | #define _LINUX_TICK_H | ||
8 | |||
9 | #include <linux/clockchips.h> | ||
10 | |||
11 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | ||
12 | |||
13 | enum tick_device_mode { | ||
14 | TICKDEV_MODE_PERIODIC, | ||
15 | TICKDEV_MODE_ONESHOT, | ||
16 | }; | ||
17 | |||
18 | struct tick_device { | ||
19 | struct clock_event_device *evtdev; | ||
20 | enum tick_device_mode mode; | ||
21 | }; | ||
22 | |||
23 | enum tick_nohz_mode { | ||
24 | NOHZ_MODE_INACTIVE, | ||
25 | NOHZ_MODE_LOWRES, | ||
26 | NOHZ_MODE_HIGHRES, | ||
27 | }; | ||
28 | |||
29 | /** | ||
30 | * struct tick_sched - sched tick emulation and no idle tick control/stats | ||
31 | * @sched_timer: hrtimer to schedule the periodic tick in high | ||
32 | * resolution mode | ||
33 | * @idle_tick: Store the last idle tick expiry time when the tick | ||
34 | * timer is modified for idle sleeps. This is necessary | ||
35 | * to resume the tick timer operation in the timeline | ||
36 | * when the CPU returns from idle | ||
37 | * @tick_stopped: Indicator that the idle tick has been stopped | ||
38 | * @idle_jiffies: jiffies at the entry to idle for idle time accounting | ||
39 | * @idle_calls: Total number of idle calls | ||
40 | * @idle_sleeps: Number of idle calls, where the sched tick was stopped | ||
41 | * @idle_entrytime: Time when the idle call was entered | ||
42 | * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped | ||
43 | */ | ||
44 | struct tick_sched { | ||
45 | struct hrtimer sched_timer; | ||
46 | unsigned long check_clocks; | ||
47 | enum tick_nohz_mode nohz_mode; | ||
48 | ktime_t idle_tick; | ||
49 | int tick_stopped; | ||
50 | unsigned long idle_jiffies; | ||
51 | unsigned long idle_calls; | ||
52 | unsigned long idle_sleeps; | ||
53 | ktime_t idle_entrytime; | ||
54 | ktime_t idle_sleeptime; | ||
55 | unsigned long last_jiffies; | ||
56 | unsigned long next_jiffies; | ||
57 | ktime_t idle_expires; | ||
58 | }; | ||
59 | |||
60 | extern void __init tick_init(void); | ||
61 | extern int tick_is_oneshot_available(void); | ||
62 | extern struct tick_device *tick_get_device(int cpu); | ||
63 | |||
64 | # ifdef CONFIG_HIGH_RES_TIMERS | ||
65 | extern int tick_init_highres(void); | ||
66 | extern int tick_program_event(ktime_t expires, int force); | ||
67 | extern void tick_setup_sched_timer(void); | ||
68 | extern void tick_cancel_sched_timer(int cpu); | ||
69 | # else | ||
70 | static inline void tick_cancel_sched_timer(int cpu) { } | ||
71 | # endif /* HIGHRES */ | ||
72 | |||
73 | # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST | ||
74 | extern struct tick_device *tick_get_broadcast_device(void); | ||
75 | extern cpumask_t *tick_get_broadcast_mask(void); | ||
76 | |||
77 | # ifdef CONFIG_TICK_ONESHOT | ||
78 | extern cpumask_t *tick_get_broadcast_oneshot_mask(void); | ||
79 | # endif | ||
80 | |||
81 | # endif /* BROADCAST */ | ||
82 | |||
83 | # ifdef CONFIG_TICK_ONESHOT | ||
84 | extern void tick_clock_notify(void); | ||
85 | extern int tick_check_oneshot_change(int allow_nohz); | ||
86 | extern struct tick_sched *tick_get_tick_sched(int cpu); | ||
87 | # else | ||
88 | static inline void tick_clock_notify(void) { } | ||
89 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | ||
90 | # endif | ||
91 | |||
92 | #else /* CONFIG_GENERIC_CLOCKEVENTS */ | ||
93 | static inline void tick_init(void) { } | ||
94 | static inline void tick_cancel_sched_timer(int cpu) { } | ||
95 | static inline void tick_clock_notify(void) { } | ||
96 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | ||
97 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ | ||
98 | |||
99 | # ifdef CONFIG_NO_HZ | ||
100 | extern void tick_nohz_stop_sched_tick(void); | ||
101 | extern void tick_nohz_restart_sched_tick(void); | ||
102 | extern void tick_nohz_update_jiffies(void); | ||
103 | # else | ||
104 | static inline void tick_nohz_stop_sched_tick(void) { } | ||
105 | static inline void tick_nohz_restart_sched_tick(void) { } | ||
106 | static inline void tick_nohz_update_jiffies(void) { } | ||
107 | # endif /* !NO_HZ */ | ||
108 | |||
109 | #endif | ||
diff --git a/include/linux/time.h b/include/linux/time.h index 55cee172d723..8ea8dea713c7 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -90,8 +90,9 @@ static inline struct timespec timespec_sub(struct timespec lhs, | |||
90 | 90 | ||
91 | extern struct timespec xtime; | 91 | extern struct timespec xtime; |
92 | extern struct timespec wall_to_monotonic; | 92 | extern struct timespec wall_to_monotonic; |
93 | extern seqlock_t xtime_lock; | 93 | extern seqlock_t xtime_lock __attribute__((weak)); |
94 | 94 | ||
95 | extern unsigned long read_persistent_clock(void); | ||
95 | void timekeeping_init(void); | 96 | void timekeeping_init(void); |
96 | 97 | ||
97 | static inline unsigned long get_seconds(void) | 98 | static inline unsigned long get_seconds(void) |
diff --git a/include/linux/timer.h b/include/linux/timer.h index fb5edaaf0ebd..719113b652dd 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_TIMER_H | 2 | #define _LINUX_TIMER_H |
3 | 3 | ||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/ktime.h> | ||
5 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
6 | #include <linux/stddef.h> | 7 | #include <linux/stddef.h> |
7 | 8 | ||
@@ -15,6 +16,11 @@ struct timer_list { | |||
15 | unsigned long data; | 16 | unsigned long data; |
16 | 17 | ||
17 | struct tvec_t_base_s *base; | 18 | struct tvec_t_base_s *base; |
19 | #ifdef CONFIG_TIMER_STATS | ||
20 | void *start_site; | ||
21 | char start_comm[16]; | ||
22 | int start_pid; | ||
23 | #endif | ||
18 | }; | 24 | }; |
19 | 25 | ||
20 | extern struct tvec_t_base_s boot_tvec_bases; | 26 | extern struct tvec_t_base_s boot_tvec_bases; |
@@ -61,7 +67,65 @@ extern int del_timer(struct timer_list * timer); | |||
61 | extern int __mod_timer(struct timer_list *timer, unsigned long expires); | 67 | extern int __mod_timer(struct timer_list *timer, unsigned long expires); |
62 | extern int mod_timer(struct timer_list *timer, unsigned long expires); | 68 | extern int mod_timer(struct timer_list *timer, unsigned long expires); |
63 | 69 | ||
70 | /* | ||
71 | * Return when the next timer-wheel timeout occurs (in absolute jiffies), | ||
72 | * locks the timer base: | ||
73 | */ | ||
64 | extern unsigned long next_timer_interrupt(void); | 74 | extern unsigned long next_timer_interrupt(void); |
75 | /* | ||
76 | * Return when the next timer-wheel timeout occurs (in absolute jiffies), | ||
77 | * locks the timer base and does the comparison against the given | ||
78 | * jiffie. | ||
79 | */ | ||
80 | extern unsigned long get_next_timer_interrupt(unsigned long now); | ||
81 | |||
82 | /* | ||
83 | * Timer-statistics info: | ||
84 | */ | ||
85 | #ifdef CONFIG_TIMER_STATS | ||
86 | |||
87 | extern void init_timer_stats(void); | ||
88 | |||
89 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | ||
90 | void *timerf, char * comm); | ||
91 | |||
92 | static inline void timer_stats_account_timer(struct timer_list *timer) | ||
93 | { | ||
94 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, | ||
95 | timer->function, timer->start_comm); | ||
96 | } | ||
97 | |||
98 | extern void __timer_stats_timer_set_start_info(struct timer_list *timer, | ||
99 | void *addr); | ||
100 | |||
101 | static inline void timer_stats_timer_set_start_info(struct timer_list *timer) | ||
102 | { | ||
103 | __timer_stats_timer_set_start_info(timer, __builtin_return_address(0)); | ||
104 | } | ||
105 | |||
106 | static inline void timer_stats_timer_clear_start_info(struct timer_list *timer) | ||
107 | { | ||
108 | timer->start_site = NULL; | ||
109 | } | ||
110 | #else | ||
111 | static inline void init_timer_stats(void) | ||
112 | { | ||
113 | } | ||
114 | |||
115 | static inline void timer_stats_account_timer(struct timer_list *timer) | ||
116 | { | ||
117 | } | ||
118 | |||
119 | static inline void timer_stats_timer_set_start_info(struct timer_list *timer) | ||
120 | { | ||
121 | } | ||
122 | |||
123 | static inline void timer_stats_timer_clear_start_info(struct timer_list *timer) | ||
124 | { | ||
125 | } | ||
126 | #endif | ||
127 | |||
128 | extern void delayed_work_timer_fn(unsigned long __data); | ||
65 | 129 | ||
66 | /** | 130 | /** |
67 | * add_timer - start a timer | 131 | * add_timer - start a timer |
@@ -96,7 +160,7 @@ static inline void add_timer(struct timer_list *timer) | |||
96 | extern void init_timers(void); | 160 | extern void init_timers(void); |
97 | extern void run_local_timers(void); | 161 | extern void run_local_timers(void); |
98 | struct hrtimer; | 162 | struct hrtimer; |
99 | extern int it_real_fn(struct hrtimer *); | 163 | extern enum hrtimer_restart it_real_fn(struct hrtimer *); |
100 | 164 | ||
101 | unsigned long __round_jiffies(unsigned long j, int cpu); | 165 | unsigned long __round_jiffies(unsigned long j, int cpu); |
102 | unsigned long __round_jiffies_relative(unsigned long j, int cpu); | 166 | unsigned long __round_jiffies_relative(unsigned long j, int cpu); |
diff --git a/include/linux/timex.h b/include/linux/timex.h index 9a24e500c311..da929dbbea2a 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -286,6 +286,13 @@ static inline void time_interpolator_update(long delta_nsec) | |||
286 | 286 | ||
287 | #define TICK_LENGTH_SHIFT 32 | 287 | #define TICK_LENGTH_SHIFT 32 |
288 | 288 | ||
289 | #ifdef CONFIG_NO_HZ | ||
290 | #define NTP_INTERVAL_FREQ (2) | ||
291 | #else | ||
292 | #define NTP_INTERVAL_FREQ (HZ) | ||
293 | #endif | ||
294 | #define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) | ||
295 | |||
289 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ | 296 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ |
290 | extern u64 current_tick_length(void); | 297 | extern u64 current_tick_length(void); |
291 | 298 | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index b5c226a87ed8..a8e8d1ecebb1 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -935,7 +935,7 @@ struct usb_iso_packet_descriptor { | |||
935 | unsigned int offset; | 935 | unsigned int offset; |
936 | unsigned int length; /* expected length */ | 936 | unsigned int length; /* expected length */ |
937 | unsigned int actual_length; | 937 | unsigned int actual_length; |
938 | unsigned int status; | 938 | int status; |
939 | }; | 939 | }; |
940 | 940 | ||
941 | struct urb; | 941 | struct urb; |
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h index ba617c372455..956edf3bbecb 100644 --- a/include/linux/usb/cdc.h +++ b/include/linux/usb/cdc.h | |||
@@ -73,6 +73,13 @@ struct usb_cdc_acm_descriptor { | |||
73 | __u8 bmCapabilities; | 73 | __u8 bmCapabilities; |
74 | } __attribute__ ((packed)); | 74 | } __attribute__ ((packed)); |
75 | 75 | ||
76 | /* capabilities from 5.2.3.3 */ | ||
77 | |||
78 | #define USB_CDC_COMM_FEATURE 0x01 | ||
79 | #define USB_CDC_CAP_LINE 0x02 | ||
80 | #define USB_CDC_CAP_BRK 0x04 | ||
81 | #define USB_CDC_CAP_NOTIFY 0x08 | ||
82 | |||
76 | /* "Union Functional Descriptor" from CDC spec 5.2.3.8 */ | 83 | /* "Union Functional Descriptor" from CDC spec 5.2.3.8 */ |
77 | struct usb_cdc_union_desc { | 84 | struct usb_cdc_union_desc { |
78 | __u8 bLength; | 85 | __u8 bLength; |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index ae7833749fa2..245c72531228 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -367,7 +367,7 @@ struct usb_debug_descriptor { | |||
367 | /* bulk endpoints with 8 byte maxpacket */ | 367 | /* bulk endpoints with 8 byte maxpacket */ |
368 | __u8 bDebugInEndpoint; | 368 | __u8 bDebugInEndpoint; |
369 | __u8 bDebugOutEndpoint; | 369 | __u8 bDebugOutEndpoint; |
370 | }; | 370 | } __attribute__((packed)); |
371 | 371 | ||
372 | /*-------------------------------------------------------------------------*/ | 372 | /*-------------------------------------------------------------------------*/ |
373 | 373 | ||
@@ -396,7 +396,7 @@ struct usb_security_descriptor { | |||
396 | 396 | ||
397 | __le16 wTotalLength; | 397 | __le16 wTotalLength; |
398 | __u8 bNumEncryptionTypes; | 398 | __u8 bNumEncryptionTypes; |
399 | }; | 399 | } __attribute__((packed)); |
400 | 400 | ||
401 | /*-------------------------------------------------------------------------*/ | 401 | /*-------------------------------------------------------------------------*/ |
402 | 402 | ||
@@ -410,7 +410,7 @@ struct usb_key_descriptor { | |||
410 | __u8 tTKID[3]; | 410 | __u8 tTKID[3]; |
411 | __u8 bReserved; | 411 | __u8 bReserved; |
412 | __u8 bKeyData[0]; | 412 | __u8 bKeyData[0]; |
413 | }; | 413 | } __attribute__((packed)); |
414 | 414 | ||
415 | /*-------------------------------------------------------------------------*/ | 415 | /*-------------------------------------------------------------------------*/ |
416 | 416 | ||
@@ -426,7 +426,7 @@ struct usb_encryption_descriptor { | |||
426 | #define USB_ENC_TYPE_RSA_1 3 /* rsa3072/sha1 auth */ | 426 | #define USB_ENC_TYPE_RSA_1 3 /* rsa3072/sha1 auth */ |
427 | __u8 bEncryptionValue; /* use in SET_ENCRYPTION */ | 427 | __u8 bEncryptionValue; /* use in SET_ENCRYPTION */ |
428 | __u8 bAuthKeyIndex; | 428 | __u8 bAuthKeyIndex; |
429 | }; | 429 | } __attribute__((packed)); |
430 | 430 | ||
431 | 431 | ||
432 | /*-------------------------------------------------------------------------*/ | 432 | /*-------------------------------------------------------------------------*/ |
@@ -438,7 +438,7 @@ struct usb_bos_descriptor { | |||
438 | 438 | ||
439 | __le16 wTotalLength; | 439 | __le16 wTotalLength; |
440 | __u8 bNumDeviceCaps; | 440 | __u8 bNumDeviceCaps; |
441 | }; | 441 | } __attribute__((packed)); |
442 | 442 | ||
443 | /*-------------------------------------------------------------------------*/ | 443 | /*-------------------------------------------------------------------------*/ |
444 | 444 | ||
@@ -447,7 +447,7 @@ struct usb_dev_cap_header { | |||
447 | __u8 bLength; | 447 | __u8 bLength; |
448 | __u8 bDescriptorType; | 448 | __u8 bDescriptorType; |
449 | __u8 bDevCapabilityType; | 449 | __u8 bDevCapabilityType; |
450 | }; | 450 | } __attribute__((packed)); |
451 | 451 | ||
452 | #define USB_CAP_TYPE_WIRELESS_USB 1 | 452 | #define USB_CAP_TYPE_WIRELESS_USB 1 |
453 | 453 | ||
@@ -475,7 +475,7 @@ struct usb_wireless_cap_descriptor { /* Ultra Wide Band */ | |||
475 | __u8 bmFFITXPowerInfo; /* FFI power levels */ | 475 | __u8 bmFFITXPowerInfo; /* FFI power levels */ |
476 | __le16 bmBandGroup; | 476 | __le16 bmBandGroup; |
477 | __u8 bReserved; | 477 | __u8 bReserved; |
478 | }; | 478 | } __attribute__((packed)); |
479 | 479 | ||
480 | /*-------------------------------------------------------------------------*/ | 480 | /*-------------------------------------------------------------------------*/ |
481 | 481 | ||
@@ -496,7 +496,7 @@ struct usb_wireless_ep_comp_descriptor { | |||
496 | #define USB_ENDPOINT_SWITCH_NO 0 | 496 | #define USB_ENDPOINT_SWITCH_NO 0 |
497 | #define USB_ENDPOINT_SWITCH_SWITCH 1 | 497 | #define USB_ENDPOINT_SWITCH_SWITCH 1 |
498 | #define USB_ENDPOINT_SWITCH_SCALE 2 | 498 | #define USB_ENDPOINT_SWITCH_SCALE 2 |
499 | }; | 499 | } __attribute__((packed)); |
500 | 500 | ||
501 | /*-------------------------------------------------------------------------*/ | 501 | /*-------------------------------------------------------------------------*/ |
502 | 502 | ||
@@ -512,7 +512,7 @@ struct usb_handshake { | |||
512 | __u8 CDID[16]; | 512 | __u8 CDID[16]; |
513 | __u8 nonce[16]; | 513 | __u8 nonce[16]; |
514 | __u8 MIC[8]; | 514 | __u8 MIC[8]; |
515 | }; | 515 | } __attribute__((packed)); |
516 | 516 | ||
517 | /*-------------------------------------------------------------------------*/ | 517 | /*-------------------------------------------------------------------------*/ |
518 | 518 | ||
@@ -524,7 +524,7 @@ struct usb_connection_context { | |||
524 | __u8 CHID[16]; /* persistent host id */ | 524 | __u8 CHID[16]; /* persistent host id */ |
525 | __u8 CDID[16]; /* device id (unique w/in host context) */ | 525 | __u8 CDID[16]; /* device id (unique w/in host context) */ |
526 | __u8 CK[16]; /* connection key */ | 526 | __u8 CK[16]; /* connection key */ |
527 | }; | 527 | } __attribute__((packed)); |
528 | 528 | ||
529 | /*-------------------------------------------------------------------------*/ | 529 | /*-------------------------------------------------------------------------*/ |
530 | 530 | ||
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 33dcd8576696..32acbae28d24 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -54,6 +54,8 @@ | |||
54 | * @write_wait: a wait_queue_head_t used by the port. | 54 | * @write_wait: a wait_queue_head_t used by the port. |
55 | * @work: work queue entry for the line discipline waking up. | 55 | * @work: work queue entry for the line discipline waking up. |
56 | * @open_count: number of times this port has been opened. | 56 | * @open_count: number of times this port has been opened. |
57 | * @throttled: nonzero if the read urb is inactive to throttle the device | ||
58 | * @throttle_req: nonzero if the tty wants to throttle us | ||
57 | * | 59 | * |
58 | * This structure is used by the usb-serial core and drivers for the specific | 60 | * This structure is used by the usb-serial core and drivers for the specific |
59 | * ports of a device. | 61 | * ports of a device. |
@@ -88,6 +90,8 @@ struct usb_serial_port { | |||
88 | wait_queue_head_t write_wait; | 90 | wait_queue_head_t write_wait; |
89 | struct work_struct work; | 91 | struct work_struct work; |
90 | int open_count; | 92 | int open_count; |
93 | char throttled; | ||
94 | char throttle_req; | ||
91 | struct device dev; | 95 | struct device dev; |
92 | }; | 96 | }; |
93 | #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) | 97 | #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) |
@@ -269,6 +273,8 @@ extern int usb_serial_generic_write_room (struct usb_serial_port *port); | |||
269 | extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); | 273 | extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); |
270 | extern void usb_serial_generic_read_bulk_callback (struct urb *urb); | 274 | extern void usb_serial_generic_read_bulk_callback (struct urb *urb); |
271 | extern void usb_serial_generic_write_bulk_callback (struct urb *urb); | 275 | extern void usb_serial_generic_write_bulk_callback (struct urb *urb); |
276 | extern void usb_serial_generic_throttle (struct usb_serial_port *port); | ||
277 | extern void usb_serial_generic_unthrottle (struct usb_serial_port *port); | ||
272 | extern void usb_serial_generic_shutdown (struct usb_serial *serial); | 278 | extern void usb_serial_generic_shutdown (struct usb_serial *serial); |
273 | extern int usb_serial_generic_register (int debug); | 279 | extern int usb_serial_generic_register (int debug); |
274 | extern void usb_serial_generic_deregister (void); | 280 | extern void usb_serial_generic_deregister (void); |
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index 2ae76fe52ff7..1b792b9286ba 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
@@ -46,7 +46,9 @@ | |||
46 | US_FLAG(MAX_SECTORS_64, 0x00000400) \ | 46 | US_FLAG(MAX_SECTORS_64, 0x00000400) \ |
47 | /* Sets max_sectors to 64 */ \ | 47 | /* Sets max_sectors to 64 */ \ |
48 | US_FLAG(IGNORE_DEVICE, 0x00000800) \ | 48 | US_FLAG(IGNORE_DEVICE, 0x00000800) \ |
49 | /* Don't claim device */ | 49 | /* Don't claim device */ \ |
50 | US_FLAG(CAPACITY_HEURISTICS, 0x00001000) \ | ||
51 | /* sometimes sizes is too big */ | ||
50 | 52 | ||
51 | #define US_FLAG(name, value) US_FL_##name = value , | 53 | #define US_FLAG(name, value) US_FL_##name = value , |
52 | enum { US_DO_ALL_FLAGS }; | 54 | enum { US_DO_ALL_FLAGS }; |
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index 617d8a1c59ae..342dd5a7e8bb 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
@@ -159,9 +159,9 @@ struct usbdevfs_ioctl32 { | |||
159 | #define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32) | 159 | #define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32) |
160 | #define USBDEVFS_DISCARDURB _IO('U', 11) | 160 | #define USBDEVFS_DISCARDURB _IO('U', 11) |
161 | #define USBDEVFS_REAPURB _IOW('U', 12, void *) | 161 | #define USBDEVFS_REAPURB _IOW('U', 12, void *) |
162 | #define USBDEVFS_REAPURB32 _IOW('U', 12, u32) | 162 | #define USBDEVFS_REAPURB32 _IOW('U', 12, __u32) |
163 | #define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *) | 163 | #define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *) |
164 | #define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, u32) | 164 | #define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32) |
165 | #define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal) | 165 | #define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal) |
166 | #define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int) | 166 | #define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int) |
167 | #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) | 167 | #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index d94e2683be52..65a165f918c9 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -1,5 +1,45 @@ | |||
1 | /* | 1 | /* |
2 | * Video for Linux Two | 2 | * Video for Linux Two header file |
3 | * | ||
4 | * Copyright (C) 1999-2007 the contributors | ||
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 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * Alternatively you can redistribute this file under the terms of the | ||
17 | * BSD license as stated below: | ||
18 | * | ||
19 | * Redistribution and use in source and binary forms, with or without | ||
20 | * modification, are permitted provided that the following conditions | ||
21 | * are met: | ||
22 | * 1. Redistributions of source code must retain the above copyright | ||
23 | * notice, this list of conditions and the following disclaimer. | ||
24 | * 2. Redistributions in binary form must reproduce the above copyright | ||
25 | * notice, this list of conditions and the following disclaimer in | ||
26 | * the documentation and/or other materials provided with the | ||
27 | * distribution. | ||
28 | * 3. The names of its contributors may not be used to endorse or promote | ||
29 | * products derived from this software without specific prior written | ||
30 | * permission. | ||
31 | * | ||
32 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
33 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
34 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
35 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
36 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
37 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | ||
38 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
39 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
40 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
41 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
42 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
3 | * | 43 | * |
4 | * Header file for v4l or V4L2 drivers and applications | 44 | * Header file for v4l or V4L2 drivers and applications |
5 | * with public API. | 45 | * with public API. |
@@ -8,8 +48,9 @@ | |||
8 | * | 48 | * |
9 | * See http://linuxtv.org for more info | 49 | * See http://linuxtv.org for more info |
10 | * | 50 | * |
11 | * Author: Bill Dirks <bdirks@pacbell.net> | 51 | * Author: Bill Dirks <bill@thedirks.org> |
12 | * Justin Schoeman | 52 | * Justin Schoeman |
53 | * Hans Verkuil <hverkuil@xs4all.nl> | ||
13 | * et al. | 54 | * et al. |
14 | */ | 55 | */ |
15 | #ifndef __LINUX_VIDEODEV2_H | 56 | #ifndef __LINUX_VIDEODEV2_H |
@@ -90,11 +131,8 @@ enum v4l2_buf_type { | |||
90 | V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, | 131 | V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, |
91 | V4L2_BUF_TYPE_VBI_CAPTURE = 4, | 132 | V4L2_BUF_TYPE_VBI_CAPTURE = 4, |
92 | V4L2_BUF_TYPE_VBI_OUTPUT = 5, | 133 | V4L2_BUF_TYPE_VBI_OUTPUT = 5, |
93 | #if 1 | ||
94 | /* Experimental Sliced VBI */ | ||
95 | V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, | 134 | V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, |
96 | V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, | 135 | V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, |
97 | #endif | ||
98 | V4L2_BUF_TYPE_PRIVATE = 0x80, | 136 | V4L2_BUF_TYPE_PRIVATE = 0x80, |
99 | }; | 137 | }; |
100 | 138 | ||
@@ -186,10 +224,8 @@ struct v4l2_capability | |||
186 | #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ | 224 | #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ |
187 | #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ | 225 | #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ |
188 | #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ | 226 | #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ |
189 | #if 1 | ||
190 | #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ | 227 | #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ |
191 | #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ | 228 | #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ |
192 | #endif | ||
193 | #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ | 229 | #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ |
194 | 230 | ||
195 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ | 231 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ |
@@ -1179,7 +1215,6 @@ struct v4l2_vbi_format | |||
1179 | #define V4L2_VBI_UNSYNC (1<< 0) | 1215 | #define V4L2_VBI_UNSYNC (1<< 0) |
1180 | #define V4L2_VBI_INTERLACED (1<< 1) | 1216 | #define V4L2_VBI_INTERLACED (1<< 1) |
1181 | 1217 | ||
1182 | #if 1 | ||
1183 | /* Sliced VBI | 1218 | /* Sliced VBI |
1184 | * | 1219 | * |
1185 | * This implements is a proposal V4L2 API to allow SLICED VBI | 1220 | * This implements is a proposal V4L2 API to allow SLICED VBI |
@@ -1212,7 +1247,6 @@ struct v4l2_sliced_vbi_format | |||
1212 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) | 1247 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) |
1213 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) | 1248 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) |
1214 | 1249 | ||
1215 | |||
1216 | struct v4l2_sliced_vbi_cap | 1250 | struct v4l2_sliced_vbi_cap |
1217 | { | 1251 | { |
1218 | __u16 service_set; | 1252 | __u16 service_set; |
@@ -1233,7 +1267,6 @@ struct v4l2_sliced_vbi_data | |||
1233 | __u32 reserved; /* must be 0 */ | 1267 | __u32 reserved; /* must be 0 */ |
1234 | __u8 data[48]; | 1268 | __u8 data[48]; |
1235 | }; | 1269 | }; |
1236 | #endif | ||
1237 | 1270 | ||
1238 | /* | 1271 | /* |
1239 | * A G G R E G A T E S T R U C T U R E S | 1272 | * A G G R E G A T E S T R U C T U R E S |
@@ -1249,9 +1282,7 @@ struct v4l2_format | |||
1249 | struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE | 1282 | struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE |
1250 | struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY | 1283 | struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY |
1251 | struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE | 1284 | struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE |
1252 | #if 1 | ||
1253 | struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE | 1285 | struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE |
1254 | #endif | ||
1255 | __u8 raw_data[200]; // user-defined | 1286 | __u8 raw_data[200]; // user-defined |
1256 | } fmt; | 1287 | } fmt; |
1257 | }; | 1288 | }; |
@@ -1271,6 +1302,17 @@ struct v4l2_streamparm | |||
1271 | }; | 1302 | }; |
1272 | 1303 | ||
1273 | /* | 1304 | /* |
1305 | * A D V A N C E D D E B U G G I N G | ||
1306 | */ | ||
1307 | |||
1308 | /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ | ||
1309 | struct v4l2_register { | ||
1310 | __u64 reg; | ||
1311 | __u32 i2c_id; /* I2C driver ID of the I2C chip, or 0 for the host */ | ||
1312 | __u32 val; | ||
1313 | }; | ||
1314 | |||
1315 | /* | ||
1274 | * I O C T L C O D E S F O R V I D E O D E V I C E S | 1316 | * I O C T L C O D E S F O R V I D E O D E V I C E S |
1275 | * | 1317 | * |
1276 | */ | 1318 | */ |
@@ -1328,9 +1370,7 @@ struct v4l2_streamparm | |||
1328 | #define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout) | 1370 | #define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout) |
1329 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) | 1371 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) |
1330 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) | 1372 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) |
1331 | #if 1 | ||
1332 | #define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap) | 1373 | #define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap) |
1333 | #endif | ||
1334 | #define VIDIOC_LOG_STATUS _IO ('V', 70) | 1374 | #define VIDIOC_LOG_STATUS _IO ('V', 70) |
1335 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) | 1375 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) |
1336 | #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) | 1376 | #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) |
@@ -1339,6 +1379,9 @@ struct v4l2_streamparm | |||
1339 | #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) | 1379 | #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) |
1340 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) | 1380 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) |
1341 | #endif | 1381 | #endif |
1382 | /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | ||
1383 | #define VIDIOC_DBG_S_REGISTER _IOW ('d', 100, struct v4l2_register) | ||
1384 | #define VIDIOC_DBG_G_REGISTER _IOWR('d', 101, struct v4l2_register) | ||
1342 | 1385 | ||
1343 | #ifdef __OLD_VIDIOC_ | 1386 | #ifdef __OLD_VIDIOC_ |
1344 | /* for compatibility, will go away some day */ | 1387 | /* for compatibility, will go away some day */ |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index 7c269f4992eb..447c52beb691 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
@@ -334,7 +334,7 @@ | |||
334 | * separate range because of collisions with other tools such as | 334 | * separate range because of collisions with other tools such as |
335 | * 'mii-tool'. | 335 | * 'mii-tool'. |
336 | * We now have 32 commands, so a bit more space ;-). | 336 | * We now have 32 commands, so a bit more space ;-). |
337 | * Also, all 'odd' commands are only usable by root and don't return the | 337 | * Also, all 'even' commands are only usable by root and don't return the |
338 | * content of ifr/iwr to user (but you are not obliged to use the set/get | 338 | * content of ifr/iwr to user (but you are not obliged to use the set/get |
339 | * convention, just use every other two command). More details in iwpriv.c. | 339 | * convention, just use every other two command). More details in iwpriv.c. |
340 | * And I repeat : you are not forced to use them with iwpriv, but you | 340 | * And I repeat : you are not forced to use them with iwpriv, but you |
@@ -348,7 +348,7 @@ | |||
348 | #define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */ | 348 | #define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */ |
349 | #define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST) | 349 | #define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST) |
350 | 350 | ||
351 | /* Even : get (world access), odd : set (root access) */ | 351 | /* Odd : get (world access), even : set (root access) */ |
352 | #define IW_IS_SET(cmd) (!((cmd) & 0x1)) | 352 | #define IW_IS_SET(cmd) (!((cmd) & 0x1)) |
353 | #define IW_IS_GET(cmd) ((cmd) & 0x1) | 353 | #define IW_IS_GET(cmd) ((cmd) & 0x1) |
354 | 354 | ||
diff --git a/include/media/cx2341x.h b/include/media/cx2341x.h index ecad55bf0162..d758a52cf556 100644 --- a/include/media/cx2341x.h +++ b/include/media/cx2341x.h | |||
@@ -57,7 +57,6 @@ struct cx2341x_mpeg_params { | |||
57 | u16 video_b_frames; | 57 | u16 video_b_frames; |
58 | u16 video_gop_size; | 58 | u16 video_gop_size; |
59 | u16 video_gop_closure; | 59 | u16 video_gop_closure; |
60 | u16 video_pulldown; | ||
61 | enum v4l2_mpeg_video_bitrate_mode video_bitrate_mode; | 60 | enum v4l2_mpeg_video_bitrate_mode video_bitrate_mode; |
62 | u32 video_bitrate; | 61 | u32 video_bitrate; |
63 | u32 video_bitrate_peak; | 62 | u32 video_bitrate_peak; |
@@ -121,8 +120,6 @@ void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix); | |||
121 | #define CX2341X_DEC_SET_DISPLAY_BUFFERS 0x18 | 120 | #define CX2341X_DEC_SET_DISPLAY_BUFFERS 0x18 |
122 | #define CX2341X_DEC_EXTRACT_VBI 0x19 | 121 | #define CX2341X_DEC_EXTRACT_VBI 0x19 |
123 | #define CX2341X_DEC_SET_DECODER_SOURCE 0x1a | 122 | #define CX2341X_DEC_SET_DECODER_SOURCE 0x1a |
124 | #define CX2341X_DEC_SET_AUDIO_OUTPUT 0x1b | ||
125 | #define CX2341X_DEC_SET_AV_DELAY 0x1c | ||
126 | #define CX2341X_DEC_SET_PREBUFFERING 0x1e | 123 | #define CX2341X_DEC_SET_PREBUFFERING 0x1e |
127 | 124 | ||
128 | /* MPEG encoder API */ | 125 | /* MPEG encoder API */ |
@@ -141,7 +138,6 @@ void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix); | |||
141 | #define CX2341X_ENC_SET_DNR_FILTER_PROPS 0x9d | 138 | #define CX2341X_ENC_SET_DNR_FILTER_PROPS 0x9d |
142 | #define CX2341X_ENC_SET_CORING_LEVELS 0x9f | 139 | #define CX2341X_ENC_SET_CORING_LEVELS 0x9f |
143 | #define CX2341X_ENC_SET_SPATIAL_FILTER_TYPE 0xa1 | 140 | #define CX2341X_ENC_SET_SPATIAL_FILTER_TYPE 0xa1 |
144 | #define CX2341X_ENC_SET_3_2_PULLDOWN 0xb1 | ||
145 | #define CX2341X_ENC_SET_VBI_LINE 0xb7 | 141 | #define CX2341X_ENC_SET_VBI_LINE 0xb7 |
146 | #define CX2341X_ENC_SET_STREAM_TYPE 0xb9 | 142 | #define CX2341X_ENC_SET_STREAM_TYPE 0xb9 |
147 | #define CX2341X_ENC_SET_OUTPUT_PORT 0xbb | 143 | #define CX2341X_ENC_SET_OUTPUT_PORT 0xbb |
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 4bb0ad810179..9807a7c15830 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h | |||
@@ -36,6 +36,11 @@ | |||
36 | #define IR_KEYCODE(tab,code) (((unsigned)code < IR_KEYTAB_SIZE) \ | 36 | #define IR_KEYCODE(tab,code) (((unsigned)code < IR_KEYTAB_SIZE) \ |
37 | ? tab[code] : KEY_RESERVED) | 37 | ? tab[code] : KEY_RESERVED) |
38 | 38 | ||
39 | #define RC5_START(x) (((x)>>12)&3) | ||
40 | #define RC5_TOGGLE(x) (((x)>>11)&1) | ||
41 | #define RC5_ADDR(x) (((x)>>6)&31) | ||
42 | #define RC5_INSTR(x) ((x)&63) | ||
43 | |||
39 | struct ir_input_state { | 44 | struct ir_input_state { |
40 | /* configuration */ | 45 | /* configuration */ |
41 | int ir_type; | 46 | int ir_type; |
@@ -48,6 +53,40 @@ struct ir_input_state { | |||
48 | int keypressed; /* current state */ | 53 | int keypressed; /* current state */ |
49 | }; | 54 | }; |
50 | 55 | ||
56 | /* this was saa7134_ir and bttv_ir, moved here for | ||
57 | * rc5 decoding. */ | ||
58 | struct card_ir { | ||
59 | struct input_dev *dev; | ||
60 | struct ir_input_state ir; | ||
61 | char name[32]; | ||
62 | char phys[32]; | ||
63 | |||
64 | /* Usual gpio signalling */ | ||
65 | |||
66 | u32 mask_keycode; | ||
67 | u32 mask_keydown; | ||
68 | u32 mask_keyup; | ||
69 | u32 polling; | ||
70 | u32 last_gpio; | ||
71 | int shift_by; | ||
72 | int start; // What should RC5_START() be | ||
73 | int addr; // What RC5_ADDR() should be. | ||
74 | int rc5_key_timeout; | ||
75 | int rc5_remote_gap; | ||
76 | struct work_struct work; | ||
77 | struct timer_list timer; | ||
78 | |||
79 | /* RC5 gpio */ | ||
80 | u32 rc5_gpio; | ||
81 | struct timer_list timer_end; /* timer_end for code completion */ | ||
82 | struct timer_list timer_keyup; /* timer_end for key release */ | ||
83 | u32 last_rc5; /* last good rc5 code */ | ||
84 | u32 last_bit; /* last raw bit seen */ | ||
85 | u32 code; /* raw code under construction */ | ||
86 | struct timeval base_time; /* time of last seen code */ | ||
87 | int active; /* building raw code */ | ||
88 | }; | ||
89 | |||
51 | void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | 90 | void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, |
52 | int ir_type, IR_KEYTAB_TYPE *ir_codes); | 91 | int ir_type, IR_KEYTAB_TYPE *ir_codes); |
53 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); | 92 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); |
@@ -58,6 +97,10 @@ int ir_dump_samples(u32 *samples, int count); | |||
58 | int ir_decode_biphase(u32 *samples, int count, int low, int high); | 97 | int ir_decode_biphase(u32 *samples, int count, int low, int high); |
59 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); | 98 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); |
60 | 99 | ||
100 | u32 ir_rc5_decode(unsigned int code); | ||
101 | void ir_rc5_timer_end(unsigned long data); | ||
102 | void ir_rc5_timer_keyup(unsigned long data); | ||
103 | |||
61 | /* Keymaps to be used by other modules */ | 104 | /* Keymaps to be used by other modules */ |
62 | 105 | ||
63 | extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE]; | 106 | extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE]; |
@@ -94,6 +137,9 @@ extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE]; | |||
94 | extern IR_KEYTAB_TYPE ir_codes_norwood[IR_KEYTAB_SIZE]; | 137 | extern IR_KEYTAB_TYPE ir_codes_norwood[IR_KEYTAB_SIZE]; |
95 | extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE]; | 138 | extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE]; |
96 | extern IR_KEYTAB_TYPE ir_codes_budget_ci_old[IR_KEYTAB_SIZE]; | 139 | extern IR_KEYTAB_TYPE ir_codes_budget_ci_old[IR_KEYTAB_SIZE]; |
140 | extern IR_KEYTAB_TYPE ir_codes_asus_pc39[IR_KEYTAB_SIZE]; | ||
141 | extern IR_KEYTAB_TYPE ir_codes_encore_enltv[IR_KEYTAB_SIZE]; | ||
142 | extern IR_KEYTAB_TYPE ir_codes_tt_1500[IR_KEYTAB_SIZE]; | ||
97 | 143 | ||
98 | #endif | 144 | #endif |
99 | 145 | ||
diff --git a/include/media/saa7115.h b/include/media/saa7115.h index 9f0e2285a099..f677dfb9d373 100644 --- a/include/media/saa7115.h +++ b/include/media/saa7115.h | |||
@@ -42,5 +42,8 @@ | |||
42 | #define SAA7115_FREQ_FL_CGCDIV (1 << 1) /* SA 3A[6], CGCDIV, SAA7115 only */ | 42 | #define SAA7115_FREQ_FL_CGCDIV (1 << 1) /* SA 3A[6], CGCDIV, SAA7115 only */ |
43 | #define SAA7115_FREQ_FL_APLL (1 << 2) /* SA 3A[3], APLL, SAA7114/5 only */ | 43 | #define SAA7115_FREQ_FL_APLL (1 << 2) /* SA 3A[3], APLL, SAA7114/5 only */ |
44 | 44 | ||
45 | #define SAA7115_IPORT_ON 1 | ||
46 | #define SAA7115_IPORT_OFF 0 | ||
47 | |||
45 | #endif | 48 | #endif |
46 | 49 | ||
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 91b19921f958..244e440edb53 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -64,9 +64,6 @@ | |||
64 | /* Prints the ioctl in a human-readable format */ | 64 | /* Prints the ioctl in a human-readable format */ |
65 | extern void v4l_printk_ioctl(unsigned int cmd); | 65 | extern void v4l_printk_ioctl(unsigned int cmd); |
66 | 66 | ||
67 | /* Prints the ioctl and arg in a human-readable format */ | ||
68 | extern void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg); | ||
69 | |||
70 | /* Use this macro for non-I2C drivers. Pass the driver name as the first arg. */ | 67 | /* Use this macro for non-I2C drivers. Pass the driver name as the first arg. */ |
71 | #define v4l_print_ioctl(name, cmd) \ | 68 | #define v4l_print_ioctl(name, cmd) \ |
72 | do { \ | 69 | do { \ |
@@ -99,13 +96,6 @@ u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id); | |||
99 | 96 | ||
100 | /* Internal ioctls */ | 97 | /* Internal ioctls */ |
101 | 98 | ||
102 | /* VIDIOC_INT_G_REGISTER and VIDIOC_INT_S_REGISTER */ | ||
103 | struct v4l2_register { | ||
104 | u32 i2c_id; /* I2C driver ID of the I2C chip. 0 for the I2C adapter. */ | ||
105 | unsigned long reg; | ||
106 | u32 val; | ||
107 | }; | ||
108 | |||
109 | /* VIDIOC_INT_DECODE_VBI_LINE */ | 99 | /* VIDIOC_INT_DECODE_VBI_LINE */ |
110 | struct v4l2_decode_vbi_line { | 100 | struct v4l2_decode_vbi_line { |
111 | u32 is_second_field; /* Set to 0 for the first (odd) field, | 101 | u32 is_second_field; /* Set to 0 for the first (odd) field, |
@@ -175,9 +165,7 @@ enum v4l2_chip_ident { | |||
175 | Replacement of TUNER_SET_STANDBY. */ | 165 | Replacement of TUNER_SET_STANDBY. */ |
176 | #define VIDIOC_INT_S_STANDBY _IOW('d', 94, u32) | 166 | #define VIDIOC_INT_S_STANDBY _IOW('d', 94, u32) |
177 | 167 | ||
178 | /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | 168 | /* 100, 101 used by VIDIOC_DBG_[SG]_REGISTER */ |
179 | #define VIDIOC_INT_S_REGISTER _IOW ('d', 100, struct v4l2_register) | ||
180 | #define VIDIOC_INT_G_REGISTER _IOWR('d', 101, struct v4l2_register) | ||
181 | 169 | ||
182 | /* Generic reset command. The argument selects which subsystems to reset. | 170 | /* Generic reset command. The argument selects which subsystems to reset. |
183 | Passing 0 will always reset the whole chip. */ | 171 | Passing 0 will always reset the whole chip. */ |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index fb96472a1bd3..aeec56992ef5 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -296,6 +296,15 @@ struct video_device | |||
296 | int (*vidioc_log_status) (struct file *file, void *fh); | 296 | int (*vidioc_log_status) (struct file *file, void *fh); |
297 | 297 | ||
298 | 298 | ||
299 | /* Debugging ioctls */ | ||
300 | #ifdef CONFIG_VIDEO_ADV_DEBUG | ||
301 | int (*vidioc_g_register) (struct file *file, void *fh, | ||
302 | struct v4l2_register *reg); | ||
303 | int (*vidioc_s_register) (struct file *file, void *fh, | ||
304 | struct v4l2_register *reg); | ||
305 | #endif | ||
306 | |||
307 | |||
299 | #ifdef OBSOLETE_OWNER /* to be removed soon */ | 308 | #ifdef OBSOLETE_OWNER /* to be removed soon */ |
300 | /* obsolete -- fops->owner is used instead */ | 309 | /* obsolete -- fops->owner is used instead */ |
301 | struct module *owner; | 310 | struct module *owner; |
diff --git a/include/media/video-buf.h b/include/media/video-buf.h index 1115a256969f..d6f079476db3 100644 --- a/include/media/video-buf.h +++ b/include/media/video-buf.h | |||
@@ -78,6 +78,9 @@ struct videobuf_dmabuf { | |||
78 | /* for kernel buffers */ | 78 | /* for kernel buffers */ |
79 | void *vmalloc; | 79 | void *vmalloc; |
80 | 80 | ||
81 | /* Stores the userspace pointer to vmalloc area */ | ||
82 | void *varea; | ||
83 | |||
81 | /* for overlay buffers (pci-pci dma) */ | 84 | /* for overlay buffers (pci-pci dma) */ |
82 | dma_addr_t bus_addr; | 85 | dma_addr_t bus_addr; |
83 | 86 | ||
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h index f913c30d7b89..8e501a75a764 100644 --- a/include/mtd/mtd-abi.h +++ b/include/mtd/mtd-abi.h | |||
@@ -36,12 +36,6 @@ struct mtd_oob_buf { | |||
36 | #define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE) | 36 | #define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE) |
37 | #define MTD_CAP_NANDFLASH (MTD_WRITEABLE) | 37 | #define MTD_CAP_NANDFLASH (MTD_WRITEABLE) |
38 | 38 | ||
39 | |||
40 | // Types of automatic ECC/Checksum available | ||
41 | #define MTD_ECC_NONE 0 // No automatic ECC available | ||
42 | #define MTD_ECC_RS_DiskOnChip 1 // Automatic ECC on DiskOnChip | ||
43 | #define MTD_ECC_SW 2 // SW ECC for Toshiba & Samsung devices | ||
44 | |||
45 | /* ECC byte placement */ | 39 | /* ECC byte placement */ |
46 | #define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended) | 40 | #define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended) |
47 | #define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode) | 41 | #define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode) |
@@ -61,6 +55,8 @@ struct mtd_info_user { | |||
61 | uint32_t erasesize; | 55 | uint32_t erasesize; |
62 | uint32_t writesize; | 56 | uint32_t writesize; |
63 | uint32_t oobsize; // Amount of OOB data per block (e.g. 16) | 57 | uint32_t oobsize; // Amount of OOB data per block (e.g. 16) |
58 | /* The below two fields are obsolete and broken, do not use them | ||
59 | * (TODO: remove at some point) */ | ||
64 | uint32_t ecctype; | 60 | uint32_t ecctype; |
65 | uint32_t eccsize; | 61 | uint32_t eccsize; |
66 | }; | 62 | }; |
diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h index c1da8558339a..eae7e2e84497 100644 --- a/include/pcmcia/ciscode.h +++ b/include/pcmcia/ciscode.h | |||
@@ -95,6 +95,7 @@ | |||
95 | #define PRODID_QUATECH_DUAL_RS232 0x0012 | 95 | #define PRODID_QUATECH_DUAL_RS232 0x0012 |
96 | #define PRODID_QUATECH_DUAL_RS232_D1 0x0007 | 96 | #define PRODID_QUATECH_DUAL_RS232_D1 0x0007 |
97 | #define PRODID_QUATECH_DUAL_RS232_D2 0x0052 | 97 | #define PRODID_QUATECH_DUAL_RS232_D2 0x0052 |
98 | #define PRODID_QUATECH_DUAL_RS232_G 0x004d | ||
98 | #define PRODID_QUATECH_QUAD_RS232 0x001b | 99 | #define PRODID_QUATECH_QUAD_RS232 0x001b |
99 | #define PRODID_QUATECH_DUAL_RS422 0x000e | 100 | #define PRODID_QUATECH_DUAL_RS422 0x000e |
100 | #define PRODID_QUATECH_QUAD_RS422 0x0045 | 101 | #define PRODID_QUATECH_QUAD_RS422 0x0045 |
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h index c094e5012862..c36750ff6ae8 100644 --- a/include/rdma/ib_addr.h +++ b/include/rdma/ib_addr.h | |||
@@ -110,6 +110,12 @@ static inline void ib_addr_set_pkey(struct rdma_dev_addr *dev_addr, u16 pkey) | |||
110 | dev_addr->broadcast[9] = (unsigned char) pkey; | 110 | dev_addr->broadcast[9] = (unsigned char) pkey; |
111 | } | 111 | } |
112 | 112 | ||
113 | static inline void ib_addr_get_mgid(struct rdma_dev_addr *dev_addr, | ||
114 | union ib_gid *gid) | ||
115 | { | ||
116 | memcpy(gid, dev_addr->broadcast + 4, sizeof *gid); | ||
117 | } | ||
118 | |||
113 | static inline void ib_addr_get_sgid(struct rdma_dev_addr *dev_addr, | 119 | static inline void ib_addr_get_sgid(struct rdma_dev_addr *dev_addr, |
114 | union ib_gid *gid) | 120 | union ib_gid *gid) |
115 | { | 121 | { |
diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h index 97715b0c20b6..5e26b2f53f86 100644 --- a/include/rdma/ib_sa.h +++ b/include/rdma/ib_sa.h | |||
@@ -285,18 +285,6 @@ int ib_sa_path_rec_get(struct ib_sa_client *client, | |||
285 | void *context, | 285 | void *context, |
286 | struct ib_sa_query **query); | 286 | struct ib_sa_query **query); |
287 | 287 | ||
288 | int ib_sa_mcmember_rec_query(struct ib_sa_client *client, | ||
289 | struct ib_device *device, u8 port_num, | ||
290 | u8 method, | ||
291 | struct ib_sa_mcmember_rec *rec, | ||
292 | ib_sa_comp_mask comp_mask, | ||
293 | int timeout_ms, gfp_t gfp_mask, | ||
294 | void (*callback)(int status, | ||
295 | struct ib_sa_mcmember_rec *resp, | ||
296 | void *context), | ||
297 | void *context, | ||
298 | struct ib_sa_query **query); | ||
299 | |||
300 | int ib_sa_service_rec_query(struct ib_sa_client *client, | 288 | int ib_sa_service_rec_query(struct ib_sa_client *client, |
301 | struct ib_device *device, u8 port_num, | 289 | struct ib_device *device, u8 port_num, |
302 | u8 method, | 290 | u8 method, |
@@ -309,93 +297,82 @@ int ib_sa_service_rec_query(struct ib_sa_client *client, | |||
309 | void *context, | 297 | void *context, |
310 | struct ib_sa_query **sa_query); | 298 | struct ib_sa_query **sa_query); |
311 | 299 | ||
300 | struct ib_sa_multicast { | ||
301 | struct ib_sa_mcmember_rec rec; | ||
302 | ib_sa_comp_mask comp_mask; | ||
303 | int (*callback)(int status, | ||
304 | struct ib_sa_multicast *multicast); | ||
305 | void *context; | ||
306 | }; | ||
307 | |||
312 | /** | 308 | /** |
313 | * ib_sa_mcmember_rec_set - Start an MCMember set query | 309 | * ib_sa_join_multicast - Initiates a join request to the specified multicast |
314 | * @client:SA client | 310 | * group. |
315 | * @device:device to send query on | 311 | * @client: SA client |
316 | * @port_num: port number to send query on | 312 | * @device: Device associated with the multicast group. |
317 | * @rec:MCMember Record to send in query | 313 | * @port_num: Port on the specified device to associate with the multicast |
318 | * @comp_mask:component mask to send in query | 314 | * group. |
319 | * @timeout_ms:time to wait for response | 315 | * @rec: SA multicast member record specifying group attributes. |
320 | * @gfp_mask:GFP mask to use for internal allocations | 316 | * @comp_mask: Component mask indicating which group attributes of %rec are |
321 | * @callback:function called when query completes, times out or is | 317 | * valid. |
322 | * canceled | 318 | * @gfp_mask: GFP mask for memory allocations. |
323 | * @context:opaque user context passed to callback | 319 | * @callback: User callback invoked once the join operation completes. |
324 | * @sa_query:query context, used to cancel query | 320 | * @context: User specified context stored with the ib_sa_multicast structure. |
325 | * | 321 | * |
326 | * Send an MCMember Set query to the SA (eg to join a multicast | 322 | * This call initiates a multicast join request with the SA for the specified |
327 | * group). The callback function will be called when the query | 323 | * multicast group. If the join operation is started successfully, it returns |
328 | * completes (or fails); status is 0 for a successful response, -EINTR | 324 | * an ib_sa_multicast structure that is used to track the multicast operation. |
329 | * if the query is canceled, -ETIMEDOUT is the query timed out, or | 325 | * Users must free this structure by calling ib_free_multicast, even if the |
330 | * -EIO if an error occurred sending the query. The resp parameter of | 326 | * join operation later fails. (The callback status is non-zero.) |
331 | * the callback is only valid if status is 0. | ||
332 | * | 327 | * |
333 | * If the return value of ib_sa_mcmember_rec_set() is negative, it is | 328 | * If the join operation fails; status will be non-zero, with the following |
334 | * an error code. Otherwise it is a query ID that can be used to | 329 | * failures possible: |
335 | * cancel the query. | 330 | * -ETIMEDOUT: The request timed out. |
331 | * -EIO: An error occurred sending the query. | ||
332 | * -EINVAL: The MCMemberRecord values differed from the existing group's. | ||
333 | * -ENETRESET: Indicates that an fatal error has occurred on the multicast | ||
334 | * group, and the user must rejoin the group to continue using it. | ||
336 | */ | 335 | */ |
337 | static inline int | 336 | struct ib_sa_multicast *ib_sa_join_multicast(struct ib_sa_client *client, |
338 | ib_sa_mcmember_rec_set(struct ib_sa_client *client, | 337 | struct ib_device *device, u8 port_num, |
339 | struct ib_device *device, u8 port_num, | 338 | struct ib_sa_mcmember_rec *rec, |
340 | struct ib_sa_mcmember_rec *rec, | 339 | ib_sa_comp_mask comp_mask, gfp_t gfp_mask, |
341 | ib_sa_comp_mask comp_mask, | 340 | int (*callback)(int status, |
342 | int timeout_ms, gfp_t gfp_mask, | 341 | struct ib_sa_multicast |
343 | void (*callback)(int status, | 342 | *multicast), |
344 | struct ib_sa_mcmember_rec *resp, | 343 | void *context); |
345 | void *context), | ||
346 | void *context, | ||
347 | struct ib_sa_query **query) | ||
348 | { | ||
349 | return ib_sa_mcmember_rec_query(client, device, port_num, | ||
350 | IB_MGMT_METHOD_SET, | ||
351 | rec, comp_mask, | ||
352 | timeout_ms, gfp_mask, callback, | ||
353 | context, query); | ||
354 | } | ||
355 | 344 | ||
356 | /** | 345 | /** |
357 | * ib_sa_mcmember_rec_delete - Start an MCMember delete query | 346 | * ib_free_multicast - Frees the multicast tracking structure, and releases |
358 | * @client:SA client | 347 | * any reference on the multicast group. |
359 | * @device:device to send query on | 348 | * @multicast: Multicast tracking structure allocated by ib_join_multicast. |
360 | * @port_num: port number to send query on | ||
361 | * @rec:MCMember Record to send in query | ||
362 | * @comp_mask:component mask to send in query | ||
363 | * @timeout_ms:time to wait for response | ||
364 | * @gfp_mask:GFP mask to use for internal allocations | ||
365 | * @callback:function called when query completes, times out or is | ||
366 | * canceled | ||
367 | * @context:opaque user context passed to callback | ||
368 | * @sa_query:query context, used to cancel query | ||
369 | * | ||
370 | * Send an MCMember Delete query to the SA (eg to leave a multicast | ||
371 | * group). The callback function will be called when the query | ||
372 | * completes (or fails); status is 0 for a successful response, -EINTR | ||
373 | * if the query is canceled, -ETIMEDOUT is the query timed out, or | ||
374 | * -EIO if an error occurred sending the query. The resp parameter of | ||
375 | * the callback is only valid if status is 0. | ||
376 | * | 349 | * |
377 | * If the return value of ib_sa_mcmember_rec_delete() is negative, it | 350 | * This call blocks until the multicast identifier is destroyed. It may |
378 | * is an error code. Otherwise it is a query ID that can be used to | 351 | * not be called from within the multicast callback; however, returning a non- |
379 | * cancel the query. | 352 | * zero value from the callback will result in destroying the multicast |
353 | * tracking structure. | ||
354 | */ | ||
355 | void ib_sa_free_multicast(struct ib_sa_multicast *multicast); | ||
356 | |||
357 | /** | ||
358 | * ib_get_mcmember_rec - Looks up a multicast member record by its MGID and | ||
359 | * returns it if found. | ||
360 | * @device: Device associated with the multicast group. | ||
361 | * @port_num: Port on the specified device to associate with the multicast | ||
362 | * group. | ||
363 | * @mgid: MGID of multicast group. | ||
364 | * @rec: Location to copy SA multicast member record. | ||
380 | */ | 365 | */ |
381 | static inline int | 366 | int ib_sa_get_mcmember_rec(struct ib_device *device, u8 port_num, |
382 | ib_sa_mcmember_rec_delete(struct ib_sa_client *client, | 367 | union ib_gid *mgid, struct ib_sa_mcmember_rec *rec); |
383 | struct ib_device *device, u8 port_num, | 368 | |
384 | struct ib_sa_mcmember_rec *rec, | 369 | /** |
385 | ib_sa_comp_mask comp_mask, | 370 | * ib_init_ah_from_mcmember - Initialize address handle attributes based on |
386 | int timeout_ms, gfp_t gfp_mask, | 371 | * an SA multicast member record. |
387 | void (*callback)(int status, | 372 | */ |
388 | struct ib_sa_mcmember_rec *resp, | 373 | int ib_init_ah_from_mcmember(struct ib_device *device, u8 port_num, |
389 | void *context), | 374 | struct ib_sa_mcmember_rec *rec, |
390 | void *context, | 375 | struct ib_ah_attr *ah_attr); |
391 | struct ib_sa_query **query) | ||
392 | { | ||
393 | return ib_sa_mcmember_rec_query(client, device, port_num, | ||
394 | IB_SA_METHOD_DELETE, | ||
395 | rec, comp_mask, | ||
396 | timeout_ms, gfp_mask, callback, | ||
397 | context, query); | ||
398 | } | ||
399 | 376 | ||
400 | /** | 377 | /** |
401 | * ib_init_ah_from_path - Initialize address handle attributes based on an SA | 378 | * ib_init_ah_from_path - Initialize address handle attributes based on an SA |
diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h index 36cd8a8526a0..2d6a7705eae7 100644 --- a/include/rdma/rdma_cm.h +++ b/include/rdma/rdma_cm.h | |||
@@ -52,10 +52,13 @@ enum rdma_cm_event_type { | |||
52 | RDMA_CM_EVENT_ESTABLISHED, | 52 | RDMA_CM_EVENT_ESTABLISHED, |
53 | RDMA_CM_EVENT_DISCONNECTED, | 53 | RDMA_CM_EVENT_DISCONNECTED, |
54 | RDMA_CM_EVENT_DEVICE_REMOVAL, | 54 | RDMA_CM_EVENT_DEVICE_REMOVAL, |
55 | RDMA_CM_EVENT_MULTICAST_JOIN, | ||
56 | RDMA_CM_EVENT_MULTICAST_ERROR | ||
55 | }; | 57 | }; |
56 | 58 | ||
57 | enum rdma_port_space { | 59 | enum rdma_port_space { |
58 | RDMA_PS_SDP = 0x0001, | 60 | RDMA_PS_SDP = 0x0001, |
61 | RDMA_PS_IPOIB= 0x0002, | ||
59 | RDMA_PS_TCP = 0x0106, | 62 | RDMA_PS_TCP = 0x0106, |
60 | RDMA_PS_UDP = 0x0111, | 63 | RDMA_PS_UDP = 0x0111, |
61 | RDMA_PS_SCTP = 0x0183 | 64 | RDMA_PS_SCTP = 0x0183 |
@@ -294,5 +297,21 @@ int rdma_reject(struct rdma_cm_id *id, const void *private_data, | |||
294 | */ | 297 | */ |
295 | int rdma_disconnect(struct rdma_cm_id *id); | 298 | int rdma_disconnect(struct rdma_cm_id *id); |
296 | 299 | ||
297 | #endif /* RDMA_CM_H */ | 300 | /** |
301 | * rdma_join_multicast - Join the multicast group specified by the given | ||
302 | * address. | ||
303 | * @id: Communication identifier associated with the request. | ||
304 | * @addr: Multicast address identifying the group to join. | ||
305 | * @context: User-defined context associated with the join request, returned | ||
306 | * to the user through the private_data pointer in multicast events. | ||
307 | */ | ||
308 | int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr, | ||
309 | void *context); | ||
298 | 310 | ||
311 | /** | ||
312 | * rdma_leave_multicast - Leave the multicast group specified by the given | ||
313 | * address. | ||
314 | */ | ||
315 | void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr); | ||
316 | |||
317 | #endif /* RDMA_CM_H */ | ||
diff --git a/include/rdma/rdma_cm_ib.h b/include/rdma/rdma_cm_ib.h index 9b176df1d667..950424b38f16 100644 --- a/include/rdma/rdma_cm_ib.h +++ b/include/rdma/rdma_cm_ib.h | |||
@@ -44,7 +44,7 @@ | |||
44 | int rdma_set_ib_paths(struct rdma_cm_id *id, | 44 | int rdma_set_ib_paths(struct rdma_cm_id *id, |
45 | struct ib_sa_path_rec *path_rec, int num_paths); | 45 | struct ib_sa_path_rec *path_rec, int num_paths); |
46 | 46 | ||
47 | /* Global qkey for UD QPs and multicast groups. */ | 47 | /* Global qkey for UDP QPs and multicast groups. */ |
48 | #define RDMA_UD_QKEY 0x01234567 | 48 | #define RDMA_UDP_QKEY 0x01234567 |
49 | 49 | ||
50 | #endif /* RDMA_CM_IB_H */ | 50 | #endif /* RDMA_CM_IB_H */ |
diff --git a/include/rdma/rdma_user_cm.h b/include/rdma/rdma_user_cm.h index 9572ab8eeac1..f632b0c007c9 100644 --- a/include/rdma/rdma_user_cm.h +++ b/include/rdma/rdma_user_cm.h | |||
@@ -38,7 +38,7 @@ | |||
38 | #include <rdma/ib_user_verbs.h> | 38 | #include <rdma/ib_user_verbs.h> |
39 | #include <rdma/ib_user_sa.h> | 39 | #include <rdma/ib_user_sa.h> |
40 | 40 | ||
41 | #define RDMA_USER_CM_ABI_VERSION 3 | 41 | #define RDMA_USER_CM_ABI_VERSION 4 |
42 | 42 | ||
43 | #define RDMA_MAX_PRIVATE_DATA 256 | 43 | #define RDMA_MAX_PRIVATE_DATA 256 |
44 | 44 | ||
@@ -58,7 +58,9 @@ enum { | |||
58 | RDMA_USER_CM_CMD_GET_EVENT, | 58 | RDMA_USER_CM_CMD_GET_EVENT, |
59 | RDMA_USER_CM_CMD_GET_OPTION, | 59 | RDMA_USER_CM_CMD_GET_OPTION, |
60 | RDMA_USER_CM_CMD_SET_OPTION, | 60 | RDMA_USER_CM_CMD_SET_OPTION, |
61 | RDMA_USER_CM_CMD_NOTIFY | 61 | RDMA_USER_CM_CMD_NOTIFY, |
62 | RDMA_USER_CM_CMD_JOIN_MCAST, | ||
63 | RDMA_USER_CM_CMD_LEAVE_MCAST | ||
62 | }; | 64 | }; |
63 | 65 | ||
64 | /* | 66 | /* |
@@ -188,6 +190,13 @@ struct rdma_ucm_notify { | |||
188 | __u32 event; | 190 | __u32 event; |
189 | }; | 191 | }; |
190 | 192 | ||
193 | struct rdma_ucm_join_mcast { | ||
194 | __u64 response; /* rdma_ucm_create_id_resp */ | ||
195 | __u64 uid; | ||
196 | struct sockaddr_in6 addr; | ||
197 | __u32 id; | ||
198 | }; | ||
199 | |||
191 | struct rdma_ucm_get_event { | 200 | struct rdma_ucm_get_event { |
192 | __u64 response; | 201 | __u64 response; |
193 | }; | 202 | }; |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index ebf31b16dc49..9dd37e2f5a84 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -122,6 +122,7 @@ struct scsi_device { | |||
122 | unsigned no_uld_attach:1; /* disable connecting to upper level drivers */ | 122 | unsigned no_uld_attach:1; /* disable connecting to upper level drivers */ |
123 | unsigned select_no_atn:1; | 123 | unsigned select_no_atn:1; |
124 | unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */ | 124 | unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */ |
125 | unsigned guess_capacity:1; /* READ_CAPACITY might be too high by 1 */ | ||
125 | unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */ | 126 | unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */ |
126 | 127 | ||
127 | unsigned int device_blocked; /* Device returned QUEUE_FULL. */ | 128 | unsigned int device_blocked; /* Device returned QUEUE_FULL. */ |
diff --git a/include/scsi/scsi_tgt_if.h b/include/scsi/scsi_tgt_if.h index 46d5e70d7215..07d6e77ae895 100644 --- a/include/scsi/scsi_tgt_if.h +++ b/include/scsi/scsi_tgt_if.h | |||
@@ -83,8 +83,5 @@ struct tgt_event { | |||
83 | } __attribute__ ((aligned (sizeof(uint64_t)))); | 83 | } __attribute__ ((aligned (sizeof(uint64_t)))); |
84 | 84 | ||
85 | #define TGT_RING_SIZE (1UL << 16) | 85 | #define TGT_RING_SIZE (1UL << 16) |
86 | #define TGT_RING_PAGES (TGT_RING_SIZE >> PAGE_SHIFT) | ||
87 | #define TGT_EVENT_PER_PAGE (PAGE_SIZE / sizeof(struct tgt_event)) | ||
88 | #define TGT_MAX_EVENTS (TGT_EVENT_PER_PAGE * TGT_RING_PAGES) | ||
89 | 86 | ||
90 | #endif | 87 | #endif |
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h index cca1d4926d2a..3c18baa65a72 100644 --- a/include/scsi/scsi_transport.h +++ b/include/scsi/scsi_transport.h | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <linux/transport_class.h> | 23 | #include <linux/transport_class.h> |
24 | #include <scsi/scsi_host.h> | 24 | #include <scsi/scsi_host.h> |
25 | #include <scsi/scsi_device.h> | ||
25 | 26 | ||
26 | struct scsi_transport_template { | 27 | struct scsi_transport_template { |
27 | /* the attribute containers */ | 28 | /* the attribute containers */ |
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index eb7ce96ddf3a..23e45a4cf0e4 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h | |||
@@ -628,7 +628,7 @@ | |||
628 | #define FXWC_SPDIFLEFT (1<<22) /* 0x00400000 */ | 628 | #define FXWC_SPDIFLEFT (1<<22) /* 0x00400000 */ |
629 | #define FXWC_SPDIFRIGHT (1<<23) /* 0x00800000 */ | 629 | #define FXWC_SPDIFRIGHT (1<<23) /* 0x00800000 */ |
630 | 630 | ||
631 | #define A_TBLSZ ` 0x43 /* Effects Tank Internal Table Size. Only low byte or register used */ | 631 | #define A_TBLSZ 0x43 /* Effects Tank Internal Table Size. Only low byte or register used */ |
632 | 632 | ||
633 | #define TCBS 0x44 /* Tank cache buffer size register */ | 633 | #define TCBS 0x44 /* Tank cache buffer size register */ |
634 | #define TCBS_MASK 0x00000007 /* Tank cache buffer size field */ | 634 | #define TCBS_MASK 0x00000007 /* Tank cache buffer size field */ |
diff --git a/include/sound/version.h b/include/sound/version.h index c39b3802cf18..a9ba7ee69939 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* include/version.h. Generated by alsa/ksync script. */ | 1 | /* include/version.h. Generated by alsa/ksync script. */ |
2 | #define CONFIG_SND_VERSION "1.0.14rc2" | 2 | #define CONFIG_SND_VERSION "1.0.14rc2" |
3 | #define CONFIG_SND_DATE " (Fri Feb 09 13:50:10 2007 UTC)" | 3 | #define CONFIG_SND_DATE " (Wed Feb 14 07:42:13 2007 UTC)" |