diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-02-06 07:43:13 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-02-06 07:43:13 -0500 |
commit | b2faf597d93bdf5e2d12d93ea0815935a73f749e (patch) | |
tree | 1876616290ff282b8a0814e2429d23e0104f3701 /Documentation | |
parent | 638e174688f58200d0deb7435093435e7d737b09 (diff) | |
parent | 410c05427a69f53851637ccb85c2212131409fbd (diff) |
Merge branch 'origin'
Diffstat (limited to 'Documentation')
30 files changed, 2607 insertions, 435 deletions
diff --git a/Documentation/RCU/RTFP.txt b/Documentation/RCU/RTFP.txt index fcbcbc35b122..6221464d1a7e 100644 --- a/Documentation/RCU/RTFP.txt +++ b/Documentation/RCU/RTFP.txt | |||
@@ -90,16 +90,20 @@ at OLS. The resulting abundance of RCU patches was presented the | |||
90 | following year [McKenney02a], and use of RCU in dcache was first | 90 | following year [McKenney02a], and use of RCU in dcache was first |
91 | described that same year [Linder02a]. | 91 | described that same year [Linder02a]. |
92 | 92 | ||
93 | Also in 2002, Michael [Michael02b,Michael02a] presented techniques | 93 | Also in 2002, Michael [Michael02b,Michael02a] presented "hazard-pointer" |
94 | that defer the destruction of data structures to simplify non-blocking | 94 | techniques that defer the destruction of data structures to simplify |
95 | synchronization (wait-free synchronization, lock-free synchronization, | 95 | non-blocking synchronization (wait-free synchronization, lock-free |
96 | and obstruction-free synchronization are all examples of non-blocking | 96 | synchronization, and obstruction-free synchronization are all examples of |
97 | synchronization). In particular, this technique eliminates locking, | 97 | non-blocking synchronization). In particular, this technique eliminates |
98 | reduces contention, reduces memory latency for readers, and parallelizes | 98 | locking, reduces contention, reduces memory latency for readers, and |
99 | pipeline stalls and memory latency for writers. However, these | 99 | parallelizes pipeline stalls and memory latency for writers. However, |
100 | techniques still impose significant read-side overhead in the form of | 100 | these techniques still impose significant read-side overhead in the |
101 | memory barriers. Researchers at Sun worked along similar lines in the | 101 | form of memory barriers. Researchers at Sun worked along similar lines |
102 | same timeframe [HerlihyLM02,HerlihyLMS03]. | 102 | in the same timeframe [HerlihyLM02,HerlihyLMS03]. These techniques |
103 | can be thought of as inside-out reference counts, where the count is | ||
104 | represented by the number of hazard pointers referencing a given data | ||
105 | structure (rather than the more conventional counter field within the | ||
106 | data structure itself). | ||
103 | 107 | ||
104 | In 2003, the K42 group described how RCU could be used to create | 108 | In 2003, the K42 group described how RCU could be used to create |
105 | hot-pluggable implementations of operating-system functions. Later that | 109 | hot-pluggable implementations of operating-system functions. Later that |
@@ -113,7 +117,6 @@ number of operating-system kernels [PaulEdwardMcKenneyPhD], a paper | |||
113 | describing how to make RCU safe for soft-realtime applications [Sarma04c], | 117 | describing how to make RCU safe for soft-realtime applications [Sarma04c], |
114 | and a paper describing SELinux performance with RCU [JamesMorris04b]. | 118 | and a paper describing SELinux performance with RCU [JamesMorris04b]. |
115 | 119 | ||
116 | |||
117 | 2005 has seen further adaptation of RCU to realtime use, permitting | 120 | 2005 has seen further adaptation of RCU to realtime use, permitting |
118 | preemption of RCU realtime critical sections [PaulMcKenney05a, | 121 | preemption of RCU realtime critical sections [PaulMcKenney05a, |
119 | PaulMcKenney05b]. | 122 | PaulMcKenney05b]. |
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt index e118a7c1a092..49e27cc19385 100644 --- a/Documentation/RCU/checklist.txt +++ b/Documentation/RCU/checklist.txt | |||
@@ -177,3 +177,9 @@ over a rather long period of time, but improvements are always welcome! | |||
177 | 177 | ||
178 | If you want to wait for some of these other things, you might | 178 | If you want to wait for some of these other things, you might |
179 | instead need to use synchronize_irq() or synchronize_sched(). | 179 | instead need to use synchronize_irq() or synchronize_sched(). |
180 | |||
181 | 12. Any lock acquired by an RCU callback must be acquired elsewhere | ||
182 | with irq disabled, e.g., via spin_lock_irqsave(). Failing to | ||
183 | disable irq on a given acquisition of that lock will result in | ||
184 | deadlock as soon as the RCU callback happens to interrupt that | ||
185 | acquisition's critical section. | ||
diff --git a/Documentation/RCU/listRCU.txt b/Documentation/RCU/listRCU.txt index f8a54fa0d8ab..1fd175368a87 100644 --- a/Documentation/RCU/listRCU.txt +++ b/Documentation/RCU/listRCU.txt | |||
@@ -232,7 +232,7 @@ entry does not exist. For this to be helpful, the search function must | |||
232 | return holding the per-entry spinlock, as ipc_lock() does in fact do. | 232 | return holding the per-entry spinlock, as ipc_lock() does in fact do. |
233 | 233 | ||
234 | Quick Quiz: Why does the search function need to return holding the | 234 | Quick Quiz: Why does the search function need to return holding the |
235 | per-entry lock for this deleted-flag technique to be helpful? | 235 | per-entry lock for this deleted-flag technique to be helpful? |
236 | 236 | ||
237 | If the system-call audit module were to ever need to reject stale data, | 237 | If the system-call audit module were to ever need to reject stale data, |
238 | one way to accomplish this would be to add a "deleted" flag and a "lock" | 238 | one way to accomplish this would be to add a "deleted" flag and a "lock" |
@@ -275,8 +275,8 @@ flag under the spinlock as follows: | |||
275 | { | 275 | { |
276 | struct audit_entry *e; | 276 | struct audit_entry *e; |
277 | 277 | ||
278 | /* Do not use the _rcu iterator here, since this is the only | 278 | /* Do not need to use the _rcu iterator here, since this |
279 | * deletion routine. */ | 279 | * is the only deletion routine. */ |
280 | list_for_each_entry(e, list, list) { | 280 | list_for_each_entry(e, list, list) { |
281 | if (!audit_compare_rule(rule, &e->rule)) { | 281 | if (!audit_compare_rule(rule, &e->rule)) { |
282 | spin_lock(&e->lock); | 282 | spin_lock(&e->lock); |
@@ -304,9 +304,12 @@ function to reject newly deleted data. | |||
304 | 304 | ||
305 | 305 | ||
306 | Answer to Quick Quiz | 306 | Answer to Quick Quiz |
307 | 307 | Why does the search function need to return holding the per-entry | |
308 | If the search function drops the per-entry lock before returning, then | 308 | lock for this deleted-flag technique to be helpful? |
309 | the caller will be processing stale data in any case. If it is really | 309 | |
310 | OK to be processing stale data, then you don't need a "deleted" flag. | 310 | If the search function drops the per-entry lock before returning, |
311 | If processing stale data really is a problem, then you need to hold the | 311 | then the caller will be processing stale data in any case. If it |
312 | per-entry lock across all of the code that uses the value looked up. | 312 | is really OK to be processing stale data, then you don't need a |
313 | "deleted" flag. If processing stale data really is a problem, | ||
314 | then you need to hold the per-entry lock across all of the code | ||
315 | that uses the value that was returned. | ||
diff --git a/Documentation/RCU/rcu.txt b/Documentation/RCU/rcu.txt index 6fa092251586..02e27bf1d365 100644 --- a/Documentation/RCU/rcu.txt +++ b/Documentation/RCU/rcu.txt | |||
@@ -111,6 +111,11 @@ o What are all these files in this directory? | |||
111 | 111 | ||
112 | You are reading it! | 112 | You are reading it! |
113 | 113 | ||
114 | rcuref.txt | ||
115 | |||
116 | Describes how to combine use of reference counts | ||
117 | with RCU. | ||
118 | |||
114 | whatisRCU.txt | 119 | whatisRCU.txt |
115 | 120 | ||
116 | Overview of how the RCU implementation works. Along | 121 | Overview of how the RCU implementation works. Along |
diff --git a/Documentation/RCU/rcuref.txt b/Documentation/RCU/rcuref.txt index 3f60db41b2f0..451de2ad8329 100644 --- a/Documentation/RCU/rcuref.txt +++ b/Documentation/RCU/rcuref.txt | |||
@@ -1,7 +1,7 @@ | |||
1 | Refcounter design for elements of lists/arrays protected by RCU. | 1 | Reference-count design for elements of lists/arrays protected by RCU. |
2 | 2 | ||
3 | Refcounting on elements of lists which are protected by traditional | 3 | Reference counting on elements of lists which are protected by traditional |
4 | reader/writer spinlocks or semaphores are straight forward as in: | 4 | reader/writer spinlocks or semaphores are straightforward: |
5 | 5 | ||
6 | 1. 2. | 6 | 1. 2. |
7 | add() search_and_reference() | 7 | add() search_and_reference() |
@@ -28,12 +28,12 @@ release_referenced() delete() | |||
28 | ... | 28 | ... |
29 | } | 29 | } |
30 | 30 | ||
31 | If this list/array is made lock free using rcu as in changing the | 31 | If this list/array is made lock free using RCU as in changing the |
32 | write_lock in add() and delete() to spin_lock and changing read_lock | 32 | write_lock() in add() and delete() to spin_lock and changing read_lock |
33 | in search_and_reference to rcu_read_lock(), the atomic_get in | 33 | in search_and_reference to rcu_read_lock(), the atomic_get in |
34 | search_and_reference could potentially hold reference to an element which | 34 | search_and_reference could potentially hold reference to an element which |
35 | has already been deleted from the list/array. atomic_inc_not_zero takes | 35 | has already been deleted from the list/array. Use atomic_inc_not_zero() |
36 | care of this scenario. search_and_reference should look as; | 36 | in this scenario as follows: |
37 | 37 | ||
38 | 1. 2. | 38 | 1. 2. |
39 | add() search_and_reference() | 39 | add() search_and_reference() |
@@ -51,17 +51,16 @@ add() search_and_reference() | |||
51 | release_referenced() delete() | 51 | release_referenced() delete() |
52 | { { | 52 | { { |
53 | ... write_lock(&list_lock); | 53 | ... write_lock(&list_lock); |
54 | atomic_dec(&el->rc, relfunc) ... | 54 | if (atomic_dec_and_test(&el->rc)) ... |
55 | ... delete_element | 55 | call_rcu(&el->head, el_free); delete_element |
56 | } write_unlock(&list_lock); | 56 | ... write_unlock(&list_lock); |
57 | ... | 57 | } ... |
58 | if (atomic_dec_and_test(&el->rc)) | 58 | if (atomic_dec_and_test(&el->rc)) |
59 | call_rcu(&el->head, el_free); | 59 | call_rcu(&el->head, el_free); |
60 | ... | 60 | ... |
61 | } | 61 | } |
62 | 62 | ||
63 | Sometimes, reference to the element need to be obtained in the | 63 | Sometimes, a reference to the element needs to be obtained in the |
64 | update (write) stream. In such cases, atomic_inc_not_zero might be an | 64 | update (write) stream. In such cases, atomic_inc_not_zero() might be |
65 | overkill since the spinlock serialising list updates are held. atomic_inc | 65 | overkill, since we hold the update-side spinlock. One might instead |
66 | is to be used in such cases. | 66 | use atomic_inc() in such cases. |
67 | |||
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt index 15da16861fa3..5ed85af88789 100644 --- a/Documentation/RCU/whatisRCU.txt +++ b/Documentation/RCU/whatisRCU.txt | |||
@@ -200,10 +200,11 @@ rcu_assign_pointer() | |||
200 | the new value, and also executes any memory-barrier instructions | 200 | the new value, and also executes any memory-barrier instructions |
201 | required for a given CPU architecture. | 201 | required for a given CPU architecture. |
202 | 202 | ||
203 | Perhaps more important, it serves to document which pointers | 203 | Perhaps just as important, it serves to document (1) which |
204 | are protected by RCU. That said, rcu_assign_pointer() is most | 204 | pointers are protected by RCU and (2) the point at which a |
205 | frequently used indirectly, via the _rcu list-manipulation | 205 | given structure becomes accessible to other CPUs. That said, |
206 | primitives such as list_add_rcu(). | 206 | rcu_assign_pointer() is most frequently used indirectly, via |
207 | the _rcu list-manipulation primitives such as list_add_rcu(). | ||
207 | 208 | ||
208 | rcu_dereference() | 209 | rcu_dereference() |
209 | 210 | ||
@@ -258,9 +259,11 @@ rcu_dereference() | |||
258 | locking. | 259 | locking. |
259 | 260 | ||
260 | As with rcu_assign_pointer(), an important function of | 261 | As with rcu_assign_pointer(), an important function of |
261 | rcu_dereference() is to document which pointers are protected | 262 | rcu_dereference() is to document which pointers are protected by |
262 | by RCU. And, again like rcu_assign_pointer(), rcu_dereference() | 263 | RCU, in particular, flagging a pointer that is subject to changing |
263 | is typically used indirectly, via the _rcu list-manipulation | 264 | at any time, including immediately after the rcu_dereference(). |
265 | And, again like rcu_assign_pointer(), rcu_dereference() is | ||
266 | typically used indirectly, via the _rcu list-manipulation | ||
264 | primitives, such as list_for_each_entry_rcu(). | 267 | primitives, such as list_for_each_entry_rcu(). |
265 | 268 | ||
266 | The following diagram shows how each API communicates among the | 269 | The following diagram shows how each API communicates among the |
@@ -327,7 +330,7 @@ for specialized uses, but are relatively uncommon. | |||
327 | 3. WHAT ARE SOME EXAMPLE USES OF CORE RCU API? | 330 | 3. WHAT ARE SOME EXAMPLE USES OF CORE RCU API? |
328 | 331 | ||
329 | This section shows a simple use of the core RCU API to protect a | 332 | This section shows a simple use of the core RCU API to protect a |
330 | global pointer to a dynamically allocated structure. More typical | 333 | global pointer to a dynamically allocated structure. More-typical |
331 | uses of RCU may be found in listRCU.txt, arrayRCU.txt, and NMI-RCU.txt. | 334 | uses of RCU may be found in listRCU.txt, arrayRCU.txt, and NMI-RCU.txt. |
332 | 335 | ||
333 | struct foo { | 336 | struct foo { |
@@ -410,6 +413,8 @@ o Use synchronize_rcu() -after- removing a data element from an | |||
410 | data item. | 413 | data item. |
411 | 414 | ||
412 | See checklist.txt for additional rules to follow when using RCU. | 415 | See checklist.txt for additional rules to follow when using RCU. |
416 | And again, more-typical uses of RCU may be found in listRCU.txt, | ||
417 | arrayRCU.txt, and NMI-RCU.txt. | ||
413 | 418 | ||
414 | 419 | ||
415 | 4. WHAT IF MY UPDATING THREAD CANNOT BLOCK? | 420 | 4. WHAT IF MY UPDATING THREAD CANNOT BLOCK? |
@@ -513,7 +518,7 @@ production-quality implementation, and see: | |||
513 | 518 | ||
514 | for papers describing the Linux kernel RCU implementation. The OLS'01 | 519 | for papers describing the Linux kernel RCU implementation. The OLS'01 |
515 | and OLS'02 papers are a good introduction, and the dissertation provides | 520 | and OLS'02 papers are a good introduction, and the dissertation provides |
516 | more details on the current implementation. | 521 | more details on the current implementation as of early 2004. |
517 | 522 | ||
518 | 523 | ||
519 | 5A. "TOY" IMPLEMENTATION #1: LOCKING | 524 | 5A. "TOY" IMPLEMENTATION #1: LOCKING |
@@ -768,7 +773,6 @@ RCU pointer/list traversal: | |||
768 | rcu_dereference | 773 | rcu_dereference |
769 | list_for_each_rcu (to be deprecated in favor of | 774 | list_for_each_rcu (to be deprecated in favor of |
770 | list_for_each_entry_rcu) | 775 | list_for_each_entry_rcu) |
771 | list_for_each_safe_rcu (deprecated, not used) | ||
772 | list_for_each_entry_rcu | 776 | list_for_each_entry_rcu |
773 | list_for_each_continue_rcu (to be deprecated in favor of new | 777 | list_for_each_continue_rcu (to be deprecated in favor of new |
774 | list_for_each_entry_continue_rcu) | 778 | list_for_each_entry_continue_rcu) |
@@ -807,7 +811,8 @@ Quick Quiz #1: Why is this argument naive? How could a deadlock | |||
807 | Answer: Consider the following sequence of events: | 811 | Answer: Consider the following sequence of events: |
808 | 812 | ||
809 | 1. CPU 0 acquires some unrelated lock, call it | 813 | 1. CPU 0 acquires some unrelated lock, call it |
810 | "problematic_lock". | 814 | "problematic_lock", disabling irq via |
815 | spin_lock_irqsave(). | ||
811 | 816 | ||
812 | 2. CPU 1 enters synchronize_rcu(), write-acquiring | 817 | 2. CPU 1 enters synchronize_rcu(), write-acquiring |
813 | rcu_gp_mutex. | 818 | rcu_gp_mutex. |
@@ -894,7 +899,7 @@ Answer: Just as PREEMPT_RT permits preemption of spinlock | |||
894 | ACKNOWLEDGEMENTS | 899 | ACKNOWLEDGEMENTS |
895 | 900 | ||
896 | My thanks to the people who helped make this human-readable, including | 901 | My thanks to the people who helped make this human-readable, including |
897 | Jon Walpole, Josh Triplett, Serge Hallyn, and Suzanne Wood. | 902 | Jon Walpole, Josh Triplett, Serge Hallyn, Suzanne Wood, and Alan Stern. |
898 | 903 | ||
899 | 904 | ||
900 | For more information, see http://www.rdrop.com/users/paulmck/RCU. | 905 | For more information, see http://www.rdrop.com/users/paulmck/RCU. |
diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt new file mode 100644 index 000000000000..ff280e2e1613 --- /dev/null +++ b/Documentation/cputopology.txt | |||
@@ -0,0 +1,41 @@ | |||
1 | |||
2 | Export cpu topology info by sysfs. Items (attributes) are similar | ||
3 | to /proc/cpuinfo. | ||
4 | |||
5 | 1) /sys/devices/system/cpu/cpuX/topology/physical_package_id: | ||
6 | represent the physical package id of cpu X; | ||
7 | 2) /sys/devices/system/cpu/cpuX/topology/core_id: | ||
8 | represent the cpu core id to cpu X; | ||
9 | 3) /sys/devices/system/cpu/cpuX/topology/thread_siblings: | ||
10 | represent the thread siblings to cpu X in the same core; | ||
11 | 4) /sys/devices/system/cpu/cpuX/topology/core_siblings: | ||
12 | represent the thread siblings to cpu X in the same physical package; | ||
13 | |||
14 | To implement it in an architecture-neutral way, a new source file, | ||
15 | driver/base/topology.c, is to export the 5 attributes. | ||
16 | |||
17 | If one architecture wants to support this feature, it just needs to | ||
18 | implement 4 defines, typically in file include/asm-XXX/topology.h. | ||
19 | The 4 defines are: | ||
20 | #define topology_physical_package_id(cpu) | ||
21 | #define topology_core_id(cpu) | ||
22 | #define topology_thread_siblings(cpu) | ||
23 | #define topology_core_siblings(cpu) | ||
24 | |||
25 | The type of **_id is int. | ||
26 | The type of siblings is cpumask_t. | ||
27 | |||
28 | To be consistent on all architectures, the 4 attributes should have | ||
29 | deafult values if their values are unavailable. Below is the rule. | ||
30 | 1) physical_package_id: If cpu has no physical package id, -1 is the | ||
31 | default value. | ||
32 | 2) core_id: If cpu doesn't support multi-core, its core id is 0. | ||
33 | 3) thread_siblings: Just include itself, if the cpu doesn't support | ||
34 | HT/multi-thread. | ||
35 | 4) core_siblings: Just include itself, if the cpu doesn't support | ||
36 | multi-core and HT/Multi-thread. | ||
37 | |||
38 | So be careful when declaring the 4 defines in include/asm-XXX/topology.h. | ||
39 | |||
40 | If an attribute isn't defined on an architecture, it won't be exported. | ||
41 | |||
diff --git a/Documentation/driver-model/overview.txt b/Documentation/driver-model/overview.txt index 44662735cf81..ac4a7a737e43 100644 --- a/Documentation/driver-model/overview.txt +++ b/Documentation/driver-model/overview.txt | |||
@@ -1,50 +1,43 @@ | |||
1 | The Linux Kernel Device Model | 1 | The Linux Kernel Device Model |
2 | 2 | ||
3 | Patrick Mochel <mochel@osdl.org> | 3 | Patrick Mochel <mochel@digitalimplant.org> |
4 | 4 | ||
5 | 26 August 2002 | 5 | Drafted 26 August 2002 |
6 | Updated 31 January 2006 | ||
6 | 7 | ||
7 | 8 | ||
8 | Overview | 9 | Overview |
9 | ~~~~~~~~ | 10 | ~~~~~~~~ |
10 | 11 | ||
11 | This driver model is a unification of all the current, disparate driver models | 12 | The Linux Kernel Driver Model is a unification of all the disparate driver |
12 | that are currently in the kernel. It is intended to augment the | 13 | models that were previously used in the kernel. It is intended to augment the |
13 | bus-specific drivers for bridges and devices by consolidating a set of data | 14 | bus-specific drivers for bridges and devices by consolidating a set of data |
14 | and operations into globally accessible data structures. | 15 | and operations into globally accessible data structures. |
15 | 16 | ||
16 | Current driver models implement some sort of tree-like structure (sometimes | 17 | Traditional driver models implemented some sort of tree-like structure |
17 | just a list) for the devices they control. But, there is no linkage between | 18 | (sometimes just a list) for the devices they control. There wasn't any |
18 | the different bus types. | 19 | uniformity across the different bus types. |
19 | 20 | ||
20 | A common data structure can provide this linkage with little overhead: when a | 21 | The current driver model provides a comon, uniform data model for describing |
21 | bus driver discovers a particular device, it can insert it into the global | 22 | a bus and the devices that can appear under the bus. The unified bus |
22 | tree as well as its local tree. In fact, the local tree becomes just a subset | 23 | model includes a set of common attributes which all busses carry, and a set |
23 | of the global tree. | 24 | of common callbacks, such as device discovery during bus probing, bus |
24 | 25 | shutdown, bus power management, etc. | |
25 | Common data fields can also be moved out of the local bus models into the | ||
26 | global model. Some of the manipulations of these fields can also be | ||
27 | consolidated. Most likely, manipulation functions will become a set | ||
28 | of helper functions, which the bus drivers wrap around to include any | ||
29 | bus-specific items. | ||
30 | |||
31 | The common device and bridge interface currently reflects the goals of the | ||
32 | modern PC: namely the ability to do seamless Plug and Play, power management, | ||
33 | and hot plug. (The model dictated by Intel and Microsoft (read: ACPI) ensures | ||
34 | us that any device in the system may fit any of these criteria.) | ||
35 | |||
36 | In reality, not every bus will be able to support such operations. But, most | ||
37 | buses will support a majority of those operations, and all future buses will. | ||
38 | In other words, a bus that doesn't support an operation is the exception, | ||
39 | instead of the other way around. | ||
40 | 26 | ||
27 | The common device and bridge interface reflects the goals of the modern | ||
28 | computer: namely the ability to do seamless device "plug and play", power | ||
29 | management, and hot plug. In particular, the model dictated by Intel and | ||
30 | Microsoft (namely ACPI) ensures that almost every device on almost any bus | ||
31 | on an x86-compatible system can work within this paradigm. Of course, | ||
32 | not every bus is able to support all such operations, although most | ||
33 | buses support a most of those operations. | ||
41 | 34 | ||
42 | 35 | ||
43 | Downstream Access | 36 | Downstream Access |
44 | ~~~~~~~~~~~~~~~~~ | 37 | ~~~~~~~~~~~~~~~~~ |
45 | 38 | ||
46 | Common data fields have been moved out of individual bus layers into a common | 39 | Common data fields have been moved out of individual bus layers into a common |
47 | data structure. But, these fields must still be accessed by the bus layers, | 40 | data structure. These fields must still be accessed by the bus layers, |
48 | and sometimes by the device-specific drivers. | 41 | and sometimes by the device-specific drivers. |
49 | 42 | ||
50 | Other bus layers are encouraged to do what has been done for the PCI layer. | 43 | Other bus layers are encouraged to do what has been done for the PCI layer. |
@@ -53,7 +46,7 @@ struct pci_dev now looks like this: | |||
53 | struct pci_dev { | 46 | struct pci_dev { |
54 | ... | 47 | ... |
55 | 48 | ||
56 | struct device device; | 49 | struct device dev; |
57 | }; | 50 | }; |
58 | 51 | ||
59 | Note first that it is statically allocated. This means only one allocation on | 52 | Note first that it is statically allocated. This means only one allocation on |
@@ -64,9 +57,9 @@ the two. | |||
64 | 57 | ||
65 | The PCI bus layer freely accesses the fields of struct device. It knows about | 58 | The PCI bus layer freely accesses the fields of struct device. It knows about |
66 | the structure of struct pci_dev, and it should know the structure of struct | 59 | the structure of struct pci_dev, and it should know the structure of struct |
67 | device. PCI devices that have been converted generally do not touch the fields | 60 | device. Individual PCI device drivers that have been converted the the current |
68 | of struct device. More precisely, device-specific drivers should not touch | 61 | driver model generally do not and should not touch the fields of struct device, |
69 | fields of struct device unless there is a strong compelling reason to do so. | 62 | unless there is a strong compelling reason to do so. |
70 | 63 | ||
71 | This abstraction is prevention of unnecessary pain during transitional phases. | 64 | This abstraction is prevention of unnecessary pain during transitional phases. |
72 | If the name of the field changes or is removed, then every downstream driver | 65 | If the name of the field changes or is removed, then every downstream driver |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index b4a1ea762698..4d4897c8ef96 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -148,3 +148,17 @@ Why: The 8250 serial driver now has the ability to deal with the differences | |||
148 | brother on Alchemy SOCs. The loss of features is not considered an | 148 | brother on Alchemy SOCs. The loss of features is not considered an |
149 | issue. | 149 | issue. |
150 | Who: Ralf Baechle <ralf@linux-mips.org> | 150 | Who: Ralf Baechle <ralf@linux-mips.org> |
151 | |||
152 | --------------------------- | ||
153 | |||
154 | What: Legacy /proc/pci interface (PCI_LEGACY_PROC) | ||
155 | When: March 2006 | ||
156 | Why: deprecated since 2.5.53 in favor of lspci(8) | ||
157 | Who: Adrian Bunk <bunk@stusta.de> | ||
158 | |||
159 | --------------------------- | ||
160 | |||
161 | What: pci_module_init(driver) | ||
162 | When: January 2007 | ||
163 | Why: Is replaced by pci_register_driver(pci_driver). | ||
164 | Who: Richard Knutsson <ricknu-0@student.ltu.se> and Greg Kroah-Hartman <gregkh@suse.de> | ||
diff --git a/Documentation/filesystems/configfs/configfs_example.c b/Documentation/filesystems/configfs/configfs_example.c index f3c6e4946f98..3d4713a6c207 100644 --- a/Documentation/filesystems/configfs/configfs_example.c +++ b/Documentation/filesystems/configfs/configfs_example.c | |||
@@ -320,6 +320,7 @@ static struct config_item_type simple_children_type = { | |||
320 | .ct_item_ops = &simple_children_item_ops, | 320 | .ct_item_ops = &simple_children_item_ops, |
321 | .ct_group_ops = &simple_children_group_ops, | 321 | .ct_group_ops = &simple_children_group_ops, |
322 | .ct_attrs = simple_children_attrs, | 322 | .ct_attrs = simple_children_attrs, |
323 | .ct_owner = THIS_MODULE, | ||
323 | }; | 324 | }; |
324 | 325 | ||
325 | static struct configfs_subsystem simple_children_subsys = { | 326 | static struct configfs_subsystem simple_children_subsys = { |
@@ -403,6 +404,7 @@ static struct config_item_type group_children_type = { | |||
403 | .ct_item_ops = &group_children_item_ops, | 404 | .ct_item_ops = &group_children_item_ops, |
404 | .ct_group_ops = &group_children_group_ops, | 405 | .ct_group_ops = &group_children_group_ops, |
405 | .ct_attrs = group_children_attrs, | 406 | .ct_attrs = group_children_attrs, |
407 | .ct_owner = THIS_MODULE, | ||
406 | }; | 408 | }; |
407 | 409 | ||
408 | static struct configfs_subsystem group_children_subsys = { | 410 | static struct configfs_subsystem group_children_subsys = { |
diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt index f2595caf052e..4389c684a80a 100644 --- a/Documentation/filesystems/ocfs2.txt +++ b/Documentation/filesystems/ocfs2.txt | |||
@@ -35,6 +35,7 @@ Features which OCFS2 does not support yet: | |||
35 | be cluster coherent. | 35 | be cluster coherent. |
36 | - quotas | 36 | - quotas |
37 | - cluster aware flock | 37 | - cluster aware flock |
38 | - cluster aware lockf | ||
38 | - Directory change notification (F_NOTIFY) | 39 | - Directory change notification (F_NOTIFY) |
39 | - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease) | 40 | - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease) |
40 | - POSIX ACLs | 41 | - POSIX ACLs |
diff --git a/Documentation/kernel-doc-nano-HOWTO.txt b/Documentation/kernel-doc-nano-HOWTO.txt index c406ce67edd0..c65233d430f0 100644 --- a/Documentation/kernel-doc-nano-HOWTO.txt +++ b/Documentation/kernel-doc-nano-HOWTO.txt | |||
@@ -45,10 +45,10 @@ How to extract the documentation | |||
45 | 45 | ||
46 | If you just want to read the ready-made books on the various | 46 | If you just want to read the ready-made books on the various |
47 | subsystems (see Documentation/DocBook/*.tmpl), just type 'make | 47 | subsystems (see Documentation/DocBook/*.tmpl), just type 'make |
48 | psdocs', or 'make pdfdocs', or 'make htmldocs', depending on your | 48 | psdocs', or 'make pdfdocs', or 'make htmldocs', depending on your |
49 | preference. If you would rather read a different format, you can type | 49 | preference. If you would rather read a different format, you can type |
50 | 'make sgmldocs' and then use DocBook tools to convert | 50 | 'make sgmldocs' and then use DocBook tools to convert |
51 | Documentation/DocBook/*.sgml to a format of your choice (for example, | 51 | Documentation/DocBook/*.sgml to a format of your choice (for example, |
52 | 'db2html ...' if 'make htmldocs' was not defined). | 52 | 'db2html ...' if 'make htmldocs' was not defined). |
53 | 53 | ||
54 | If you want to see man pages instead, you can do this: | 54 | If you want to see man pages instead, you can do this: |
@@ -124,6 +124,36 @@ patterns, which are highlighted appropriately. | |||
124 | Take a look around the source tree for examples. | 124 | Take a look around the source tree for examples. |
125 | 125 | ||
126 | 126 | ||
127 | kernel-doc for structs, unions, enums, and typedefs | ||
128 | --------------------------------------------------- | ||
129 | |||
130 | Beside functions you can also write documentation for structs, unions, | ||
131 | enums and typedefs. Instead of the function name you must write the name | ||
132 | of the declaration; the struct/union/enum/typedef must always precede | ||
133 | the name. Nesting of declarations is not supported. | ||
134 | Use the argument mechanism to document members or constants. | ||
135 | |||
136 | Inside a struct description, you can use the "private:" and "public:" | ||
137 | comment tags. Structure fields that are inside a "private:" area | ||
138 | are not listed in the generated output documentation. | ||
139 | |||
140 | Example: | ||
141 | |||
142 | /** | ||
143 | * struct my_struct - short description | ||
144 | * @a: first member | ||
145 | * @b: second member | ||
146 | * | ||
147 | * Longer description | ||
148 | */ | ||
149 | struct my_struct { | ||
150 | int a; | ||
151 | int b; | ||
152 | /* private: */ | ||
153 | int c; | ||
154 | }; | ||
155 | |||
156 | |||
127 | How to make new SGML template files | 157 | How to make new SGML template files |
128 | ----------------------------------- | 158 | ----------------------------------- |
129 | 159 | ||
@@ -147,4 +177,3 @@ documentation, in <filename>, for the functions listed. | |||
147 | 177 | ||
148 | Tim. | 178 | Tim. |
149 | */ <twaugh@redhat.com> | 179 | */ <twaugh@redhat.com> |
150 | |||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 1cbcf65b764b..84370363da80 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -452,6 +452,11 @@ running once the system is up. | |||
452 | 452 | ||
453 | eata= [HW,SCSI] | 453 | eata= [HW,SCSI] |
454 | 454 | ||
455 | ec_intr= [HW,ACPI] ACPI Embedded Controller interrupt mode | ||
456 | Format: <int> | ||
457 | 0: polling mode | ||
458 | non-0: interrupt mode (default) | ||
459 | |||
455 | eda= [HW,PS2] | 460 | eda= [HW,PS2] |
456 | 461 | ||
457 | edb= [HW,PS2] | 462 | edb= [HW,PS2] |
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index 2b7cf19a06ad..26364d06ae92 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -427,6 +427,23 @@ icmp_ignore_bogus_error_responses - BOOLEAN | |||
427 | will avoid log file clutter. | 427 | will avoid log file clutter. |
428 | Default: FALSE | 428 | Default: FALSE |
429 | 429 | ||
430 | icmp_errors_use_inbound_ifaddr - BOOLEAN | ||
431 | |||
432 | If zero, icmp error messages are sent with the primary address of | ||
433 | the exiting interface. | ||
434 | |||
435 | If non-zero, the message will be sent with the primary address of | ||
436 | the interface that received the packet that caused the icmp error. | ||
437 | This is the behaviour network many administrators will expect from | ||
438 | a router. And it can make debugging complicated network layouts | ||
439 | much easier. | ||
440 | |||
441 | Note that if no primary address exists for the interface selected, | ||
442 | then the primary address of the first non-loopback interface that | ||
443 | has one will be used regarldess of this setting. | ||
444 | |||
445 | Default: 0 | ||
446 | |||
430 | igmp_max_memberships - INTEGER | 447 | igmp_max_memberships - INTEGER |
431 | Change the maximum number of multicast groups we can subscribe to. | 448 | Change the maximum number of multicast groups we can subscribe to. |
432 | Default: 20 | 449 | Default: 20 |
diff --git a/Documentation/parport-lowlevel.txt b/Documentation/parport-lowlevel.txt index 1d40008a1926..8f2302415eff 100644 --- a/Documentation/parport-lowlevel.txt +++ b/Documentation/parport-lowlevel.txt | |||
@@ -1068,7 +1068,7 @@ SYNOPSIS | |||
1068 | 1068 | ||
1069 | struct parport_operations { | 1069 | struct parport_operations { |
1070 | ... | 1070 | ... |
1071 | void (*write_status) (struct parport *port, unsigned char s); | 1071 | void (*write_control) (struct parport *port, unsigned char s); |
1072 | ... | 1072 | ... |
1073 | }; | 1073 | }; |
1074 | 1074 | ||
@@ -1097,9 +1097,9 @@ SYNOPSIS | |||
1097 | 1097 | ||
1098 | struct parport_operations { | 1098 | struct parport_operations { |
1099 | ... | 1099 | ... |
1100 | void (*frob_control) (struct parport *port, | 1100 | unsigned char (*frob_control) (struct parport *port, |
1101 | unsigned char mask, | 1101 | unsigned char mask, |
1102 | unsigned char val); | 1102 | unsigned char val); |
1103 | ... | 1103 | ... |
1104 | }; | 1104 | }; |
1105 | 1105 | ||
diff --git a/Documentation/pci-error-recovery.txt b/Documentation/pci-error-recovery.txt index d089967e4948..634d3e5b5756 100644 --- a/Documentation/pci-error-recovery.txt +++ b/Documentation/pci-error-recovery.txt | |||
@@ -1,246 +1,396 @@ | |||
1 | 1 | ||
2 | PCI Error Recovery | 2 | PCI Error Recovery |
3 | ------------------ | 3 | ------------------ |
4 | May 31, 2005 | 4 | February 2, 2006 |
5 | 5 | ||
6 | Current document maintainer: | 6 | Current document maintainer: |
7 | Linas Vepstas <linas@austin.ibm.com> | 7 | Linas Vepstas <linas@austin.ibm.com> |
8 | 8 | ||
9 | 9 | ||
10 | Some PCI bus controllers are able to detect certain "hard" PCI errors | 10 | Many PCI bus controllers are able to detect a variety of hardware |
11 | on the bus, such as parity errors on the data and address busses, as | 11 | PCI errors on the bus, such as parity errors on the data and address |
12 | well as SERR and PERR errors. These chipsets are then able to disable | 12 | busses, as well as SERR and PERR errors. Some of the more advanced |
13 | I/O to/from the affected device, so that, for example, a bad DMA | 13 | chipsets are able to deal with these errors; these include PCI-E chipsets, |
14 | address doesn't end up corrupting system memory. These same chipsets | 14 | and the PCI-host bridges found on IBM Power4 and Power5-based pSeries |
15 | are also able to reset the affected PCI device, and return it to | 15 | boxes. A typical action taken is to disconnect the affected device, |
16 | working condition. This document describes a generic API form | 16 | halting all I/O to it. The goal of a disconnection is to avoid system |
17 | performing error recovery. | 17 | corruption; for example, to halt system memory corruption due to DMA's |
18 | 18 | to "wild" addresses. Typically, a reconnection mechanism is also | |
19 | The core idea is that after a PCI error has been detected, there must | 19 | offered, so that the affected PCI device(s) are reset and put back |
20 | be a way for the kernel to coordinate with all affected device drivers | 20 | into working condition. The reset phase requires coordination |
21 | so that the pci card can be made operational again, possibly after | 21 | between the affected device drivers and the PCI controller chip. |
22 | performing a full electrical #RST of the PCI card. The API below | 22 | This document describes a generic API for notifying device drivers |
23 | provides a generic API for device drivers to be notified of PCI | 23 | of a bus disconnection, and then performing error recovery. |
24 | errors, and to be notified of, and respond to, a reset sequence. | 24 | This API is currently implemented in the 2.6.16 and later kernels. |
25 | 25 | ||
26 | Preliminary sketch of API, cut-n-pasted-n-modified email from | 26 | Reporting and recovery is performed in several steps. First, when |
27 | Ben Herrenschmidt, circa 5 april 2005 | 27 | a PCI hardware error has resulted in a bus disconnect, that event |
28 | is reported as soon as possible to all affected device drivers, | ||
29 | including multiple instances of a device driver on multi-function | ||
30 | cards. This allows device drivers to avoid deadlocking in spinloops, | ||
31 | waiting for some i/o-space register to change, when it never will. | ||
32 | It also gives the drivers a chance to defer incoming I/O as | ||
33 | needed. | ||
34 | |||
35 | Next, recovery is performed in several stages. Most of the complexity | ||
36 | is forced by the need to handle multi-function devices, that is, | ||
37 | devices that have multiple device drivers associated with them. | ||
38 | In the first stage, each driver is allowed to indicate what type | ||
39 | of reset it desires, the choices being a simple re-enabling of I/O | ||
40 | or requesting a hard reset (a full electrical #RST of the PCI card). | ||
41 | If any driver requests a full reset, that is what will be done. | ||
42 | |||
43 | After a full reset and/or a re-enabling of I/O, all drivers are | ||
44 | again notified, so that they may then perform any device setup/config | ||
45 | that may be required. After these have all completed, a final | ||
46 | "resume normal operations" event is sent out. | ||
47 | |||
48 | The biggest reason for choosing a kernel-based implementation rather | ||
49 | than a user-space implementation was the need to deal with bus | ||
50 | disconnects of PCI devices attached to storage media, and, in particular, | ||
51 | disconnects from devices holding the root file system. If the root | ||
52 | file system is disconnected, a user-space mechanism would have to go | ||
53 | through a large number of contortions to complete recovery. Almost all | ||
54 | of the current Linux file systems are not tolerant of disconnection | ||
55 | from/reconnection to their underlying block device. By contrast, | ||
56 | bus errors are easy to manage in the device driver. Indeed, most | ||
57 | device drivers already handle very similar recovery procedures; | ||
58 | for example, the SCSI-generic layer already provides significant | ||
59 | mechanisms for dealing with SCSI bus errors and SCSI bus resets. | ||
60 | |||
61 | |||
62 | Detailed Design | ||
63 | --------------- | ||
64 | Design and implementation details below, based on a chain of | ||
65 | public email discussions with Ben Herrenschmidt, circa 5 April 2005. | ||
28 | 66 | ||
29 | The error recovery API support is exposed to the driver in the form of | 67 | The error recovery API support is exposed to the driver in the form of |
30 | a structure of function pointers pointed to by a new field in struct | 68 | a structure of function pointers pointed to by a new field in struct |
31 | pci_driver. The absence of this pointer in pci_driver denotes an | 69 | pci_driver. A driver that fails to provide the structure is "non-aware", |
32 | "non-aware" driver, behaviour on these is platform dependant. | 70 | and the actual recovery steps taken are platform dependent. The |
33 | Platforms like ppc64 can try to simulate pci hotplug remove/add. | 71 | arch/powerpc implementation will simulate a PCI hotplug remove/add. |
34 | |||
35 | The definition of "pci_error_token" is not covered here. It is based on | ||
36 | Seto's work on the synchronous error detection. We still need to define | ||
37 | functions for extracting infos out of an opaque error token. This is | ||
38 | separate from this API. | ||
39 | 72 | ||
40 | This structure has the form: | 73 | This structure has the form: |
41 | |||
42 | struct pci_error_handlers | 74 | struct pci_error_handlers |
43 | { | 75 | { |
44 | int (*error_detected)(struct pci_dev *dev, pci_error_token error); | 76 | int (*error_detected)(struct pci_dev *dev, enum pci_channel_state); |
45 | int (*mmio_enabled)(struct pci_dev *dev); | 77 | int (*mmio_enabled)(struct pci_dev *dev); |
46 | int (*resume)(struct pci_dev *dev); | ||
47 | int (*link_reset)(struct pci_dev *dev); | 78 | int (*link_reset)(struct pci_dev *dev); |
48 | int (*slot_reset)(struct pci_dev *dev); | 79 | int (*slot_reset)(struct pci_dev *dev); |
80 | void (*resume)(struct pci_dev *dev); | ||
49 | }; | 81 | }; |
50 | 82 | ||
51 | A driver doesn't have to implement all of these callbacks. The | 83 | The possible channel states are: |
52 | only mandatory one is error_detected(). If a callback is not | 84 | enum pci_channel_state { |
53 | implemented, the corresponding feature is considered unsupported. | 85 | pci_channel_io_normal, /* I/O channel is in normal state */ |
54 | For example, if mmio_enabled() and resume() aren't there, then the | 86 | pci_channel_io_frozen, /* I/O to channel is blocked */ |
55 | driver is assumed as not doing any direct recovery and requires | 87 | pci_channel_io_perm_failure, /* PCI card is dead */ |
88 | }; | ||
89 | |||
90 | Possible return values are: | ||
91 | enum pci_ers_result { | ||
92 | PCI_ERS_RESULT_NONE, /* no result/none/not supported in device driver */ | ||
93 | PCI_ERS_RESULT_CAN_RECOVER, /* Device driver can recover without slot reset */ | ||
94 | PCI_ERS_RESULT_NEED_RESET, /* Device driver wants slot to be reset. */ | ||
95 | PCI_ERS_RESULT_DISCONNECT, /* Device has completely failed, is unrecoverable */ | ||
96 | PCI_ERS_RESULT_RECOVERED, /* Device driver is fully recovered and operational */ | ||
97 | }; | ||
98 | |||
99 | A driver does not have to implement all of these callbacks; however, | ||
100 | if it implements any, it must implement error_detected(). If a callback | ||
101 | is not implemented, the corresponding feature is considered unsupported. | ||
102 | For example, if mmio_enabled() and resume() aren't there, then it | ||
103 | is assumed that the driver is not doing any direct recovery and requires | ||
56 | a reset. If link_reset() is not implemented, the card is assumed as | 104 | a reset. If link_reset() is not implemented, the card is assumed as |
57 | not caring about link resets, in which case, if recover is supported, | 105 | not care about link resets. Typically a driver will want to know about |
58 | the core can try recover (but not slot_reset() unless it really did | 106 | a slot_reset(). |
59 | reset the slot). If slot_reset() is not supported, link_reset() can | 107 | |
60 | be called instead on a slot reset. | 108 | The actual steps taken by a platform to recover from a PCI error |
61 | 109 | event will be platform-dependent, but will follow the general | |
62 | At first, the call will always be : | 110 | sequence described below. |
63 | 111 | ||
64 | 1) error_detected() | 112 | STEP 0: Error Event |
65 | 113 | ------------------- | |
66 | Error detected. This is sent once after an error has been detected. At | 114 | PCI bus error is detect by the PCI hardware. On powerpc, the slot |
67 | this point, the device might not be accessible anymore depending on the | 115 | is isolated, in that all I/O is blocked: all reads return 0xffffffff, |
68 | platform (the slot will be isolated on ppc64). The driver may already | 116 | all writes are ignored. |
69 | have "noticed" the error because of a failing IO, but this is the proper | 117 | |
70 | "synchronisation point", that is, it gives a chance to the driver to | 118 | |
71 | cleanup, waiting for pending stuff (timers, whatever, etc...) to | 119 | STEP 1: Notification |
72 | complete; it can take semaphores, schedule, etc... everything but touch | 120 | -------------------- |
73 | the device. Within this function and after it returns, the driver | 121 | Platform calls the error_detected() callback on every instance of |
122 | every driver affected by the error. | ||
123 | |||
124 | At this point, the device might not be accessible anymore, depending on | ||
125 | the platform (the slot will be isolated on powerpc). The driver may | ||
126 | already have "noticed" the error because of a failing I/O, but this | ||
127 | is the proper "synchronization point", that is, it gives the driver | ||
128 | a chance to cleanup, waiting for pending stuff (timers, whatever, etc...) | ||
129 | to complete; it can take semaphores, schedule, etc... everything but | ||
130 | touch the device. Within this function and after it returns, the driver | ||
74 | shouldn't do any new IOs. Called in task context. This is sort of a | 131 | shouldn't do any new IOs. Called in task context. This is sort of a |
75 | "quiesce" point. See note about interrupts at the end of this doc. | 132 | "quiesce" point. See note about interrupts at the end of this doc. |
76 | 133 | ||
77 | Result codes: | 134 | All drivers participating in this system must implement this call. |
78 | - PCIERR_RESULT_CAN_RECOVER: | 135 | The driver must return one of the following result codes: |
79 | Driever returns this if it thinks it might be able to recover | 136 | - PCI_ERS_RESULT_CAN_RECOVER: |
137 | Driver returns this if it thinks it might be able to recover | ||
80 | the HW by just banging IOs or if it wants to be given | 138 | the HW by just banging IOs or if it wants to be given |
81 | a chance to extract some diagnostic informations (see | 139 | a chance to extract some diagnostic information (see |
82 | below). | 140 | mmio_enable, below). |
83 | - PCIERR_RESULT_NEED_RESET: | 141 | - PCI_ERS_RESULT_NEED_RESET: |
84 | Driver returns this if it thinks it can't recover unless the | 142 | Driver returns this if it can't recover without a hard |
85 | slot is reset. | 143 | slot reset. |
86 | - PCIERR_RESULT_DISCONNECT: | 144 | - PCI_ERS_RESULT_DISCONNECT: |
87 | Return this if driver thinks it won't recover at all, | 145 | Driver returns this if it doesn't want to recover at all. |
88 | (this will detach the driver ? or just leave it | 146 | |
89 | dangling ? to be decided) | 147 | The next step taken will depend on the result codes returned by the |
90 | 148 | drivers. | |
91 | So at this point, we have called error_detected() for all drivers | 149 | |
92 | on the segment that had the error. On ppc64, the slot is isolated. What | 150 | If all drivers on the segment/slot return PCI_ERS_RESULT_CAN_RECOVER, |
93 | happens now typically depends on the result from the drivers. If all | 151 | then the platform should re-enable IOs on the slot (or do nothing in |
94 | drivers on the segment/slot return PCIERR_RESULT_CAN_RECOVER, we would | 152 | particular, if the platform doesn't isolate slots), and recovery |
95 | re-enable IOs on the slot (or do nothing special if the platform doesn't | 153 | proceeds to STEP 2 (MMIO Enable). |
96 | isolate slots) and call 2). If not and we can reset slots, we go to 4), | 154 | |
97 | if neither, we have a dead slot. If it's an hotplug slot, we might | 155 | If any driver requested a slot reset (by returning PCI_ERS_RESULT_NEED_RESET), |
98 | "simulate" reset by triggering HW unplug/replug though. | 156 | then recovery proceeds to STEP 4 (Slot Reset). |
99 | 157 | ||
100 | >>> Current ppc64 implementation assumes that a device driver will | 158 | If the platform is unable to recover the slot, the next step |
101 | >>> *not* schedule or semaphore in this routine; the current ppc64 | 159 | is STEP 6 (Permanent Failure). |
160 | |||
161 | >>> The current powerpc implementation assumes that a device driver will | ||
162 | >>> *not* schedule or semaphore in this routine; the current powerpc | ||
102 | >>> implementation uses one kernel thread to notify all devices; | 163 | >>> implementation uses one kernel thread to notify all devices; |
103 | >>> thus, of one device sleeps/schedules, all devices are affected. | 164 | >>> thus, if one device sleeps/schedules, all devices are affected. |
104 | >>> Doing better requires complex multi-threaded logic in the error | 165 | >>> Doing better requires complex multi-threaded logic in the error |
105 | >>> recovery implementation (e.g. waiting for all notification threads | 166 | >>> recovery implementation (e.g. waiting for all notification threads |
106 | >>> to "join" before proceeding with recovery.) This seems excessively | 167 | >>> to "join" before proceeding with recovery.) This seems excessively |
107 | >>> complex and not worth implementing. | 168 | >>> complex and not worth implementing. |
108 | 169 | ||
109 | >>> The current ppc64 implementation doesn't much care if the device | 170 | >>> The current powerpc implementation doesn't much care if the device |
110 | >>> attempts i/o at this point, or not. I/O's will fail, returning | 171 | >>> attempts I/O at this point, or not. I/O's will fail, returning |
111 | >>> a value of 0xff on read, and writes will be dropped. If the device | 172 | >>> a value of 0xff on read, and writes will be dropped. If the device |
112 | >>> driver attempts more than 10K I/O's to a frozen adapter, it will | 173 | >>> driver attempts more than 10K I/O's to a frozen adapter, it will |
113 | >>> assume that the device driver has gone into an infinite loop, and | 174 | >>> assume that the device driver has gone into an infinite loop, and |
114 | >>> it will panic the the kernel. | 175 | >>> it will panic the the kernel. There doesn't seem to be any other |
176 | >>> way of stopping a device driver that insists on spinning on I/O. | ||
115 | 177 | ||
116 | 2) mmio_enabled() | 178 | STEP 2: MMIO Enabled |
179 | ------------------- | ||
180 | The platform re-enables MMIO to the device (but typically not the | ||
181 | DMA), and then calls the mmio_enabled() callback on all affected | ||
182 | device drivers. | ||
117 | 183 | ||
118 | This is the "early recovery" call. IOs are allowed again, but DMA is | 184 | This is the "early recovery" call. IOs are allowed again, but DMA is |
119 | not (hrm... to be discussed, I prefer not), with some restrictions. This | 185 | not (hrm... to be discussed, I prefer not), with some restrictions. This |
120 | is NOT a callback for the driver to start operations again, only to | 186 | is NOT a callback for the driver to start operations again, only to |
121 | peek/poke at the device, extract diagnostic information, if any, and | 187 | peek/poke at the device, extract diagnostic information, if any, and |
122 | eventually do things like trigger a device local reset or some such, | 188 | eventually do things like trigger a device local reset or some such, |
123 | but not restart operations. This is sent if all drivers on a segment | 189 | but not restart operations. This is callback is made if all drivers on |
124 | agree that they can try to recover and no automatic link reset was | 190 | a segment agree that they can try to recover and if no automatic link reset |
125 | performed by the HW. If the platform can't just re-enable IOs without | 191 | was performed by the HW. If the platform can't just re-enable IOs without |
126 | a slot reset or a link reset, it doesn't call this callback and goes | 192 | a slot reset or a link reset, it wont call this callback, and instead |
127 | directly to 3) or 4). All IOs should be done _synchronously_ from | 193 | will have gone directly to STEP 3 (Link Reset) or STEP 4 (Slot Reset) |
128 | within this callback, errors triggered by them will be returned via | 194 | |
129 | the normal pci_check_whatever() api, no new error_detected() callback | 195 | >>> The following is proposed; no platform implements this yet: |
130 | will be issued due to an error happening here. However, such an error | 196 | >>> Proposal: All I/O's should be done _synchronously_ from within |
131 | might cause IOs to be re-blocked for the whole segment, and thus | 197 | >>> this callback, errors triggered by them will be returned via |
132 | invalidate the recovery that other devices on the same segment might | 198 | >>> the normal pci_check_whatever() API, no new error_detected() |
133 | have done, forcing the whole segment into one of the next states, | 199 | >>> callback will be issued due to an error happening here. However, |
134 | that is link reset or slot reset. | 200 | >>> such an error might cause IOs to be re-blocked for the whole |
135 | 201 | >>> segment, and thus invalidate the recovery that other devices | |
136 | Result codes: | 202 | >>> on the same segment might have done, forcing the whole segment |
137 | - PCIERR_RESULT_RECOVERED | 203 | >>> into one of the next states, that is, link reset or slot reset. |
204 | |||
205 | The driver should return one of the following result codes: | ||
206 | - PCI_ERS_RESULT_RECOVERED | ||
138 | Driver returns this if it thinks the device is fully | 207 | Driver returns this if it thinks the device is fully |
139 | functionnal and thinks it is ready to start | 208 | functional and thinks it is ready to start |
140 | normal driver operations again. There is no | 209 | normal driver operations again. There is no |
141 | guarantee that the driver will actually be | 210 | guarantee that the driver will actually be |
142 | allowed to proceed, as another driver on the | 211 | allowed to proceed, as another driver on the |
143 | same segment might have failed and thus triggered a | 212 | same segment might have failed and thus triggered a |
144 | slot reset on platforms that support it. | 213 | slot reset on platforms that support it. |
145 | 214 | ||
146 | - PCIERR_RESULT_NEED_RESET | 215 | - PCI_ERS_RESULT_NEED_RESET |
147 | Driver returns this if it thinks the device is not | 216 | Driver returns this if it thinks the device is not |
148 | recoverable in it's current state and it needs a slot | 217 | recoverable in it's current state and it needs a slot |
149 | reset to proceed. | 218 | reset to proceed. |
150 | 219 | ||
151 | - PCIERR_RESULT_DISCONNECT | 220 | - PCI_ERS_RESULT_DISCONNECT |
152 | Same as above. Total failure, no recovery even after | 221 | Same as above. Total failure, no recovery even after |
153 | reset driver dead. (To be defined more precisely) | 222 | reset driver dead. (To be defined more precisely) |
154 | 223 | ||
155 | >>> The current ppc64 implementation does not implement this callback. | 224 | The next step taken depends on the results returned by the drivers. |
225 | If all drivers returned PCI_ERS_RESULT_RECOVERED, then the platform | ||
226 | proceeds to either STEP3 (Link Reset) or to STEP 5 (Resume Operations). | ||
227 | |||
228 | If any driver returned PCI_ERS_RESULT_NEED_RESET, then the platform | ||
229 | proceeds to STEP 4 (Slot Reset) | ||
156 | 230 | ||
157 | 3) link_reset() | 231 | >>> The current powerpc implementation does not implement this callback. |
158 | 232 | ||
159 | This is called after the link has been reset. This is typically | 233 | |
160 | a PCI Express specific state at this point and is done whenever a | 234 | STEP 3: Link Reset |
161 | non-fatal error has been detected that can be "solved" by resetting | 235 | ------------------ |
162 | the link. This call informs the driver of the reset and the driver | 236 | The platform resets the link, and then calls the link_reset() callback |
163 | should check if the device appears to be in working condition. | 237 | on all affected device drivers. This is a PCI-Express specific state |
164 | This function acts a bit like 2) mmio_enabled(), in that the driver | 238 | and is done whenever a non-fatal error has been detected that can be |
165 | is not supposed to restart normal driver I/O operations right away. | 239 | "solved" by resetting the link. This call informs the driver of the |
166 | Instead, it should just "probe" the device to check it's recoverability | 240 | reset and the driver should check to see if the device appears to be |
167 | status. If all is right, then the core will call resume() once all | 241 | in working condition. |
168 | drivers have ack'd link_reset(). | 242 | |
243 | The driver is not supposed to restart normal driver I/O operations | ||
244 | at this point. It should limit itself to "probing" the device to | ||
245 | check it's recoverability status. If all is right, then the platform | ||
246 | will call resume() once all drivers have ack'd link_reset(). | ||
169 | 247 | ||
170 | Result codes: | 248 | Result codes: |
171 | (identical to mmio_enabled) | 249 | (identical to STEP 3 (MMIO Enabled) |
250 | |||
251 | The platform then proceeds to either STEP 4 (Slot Reset) or STEP 5 | ||
252 | (Resume Operations). | ||
253 | |||
254 | >>> The current powerpc implementation does not implement this callback. | ||
255 | |||
256 | |||
257 | STEP 4: Slot Reset | ||
258 | ------------------ | ||
259 | The platform performs a soft or hard reset of the device, and then | ||
260 | calls the slot_reset() callback. | ||
261 | |||
262 | A soft reset consists of asserting the adapter #RST line and then | ||
263 | restoring the PCI BAR's and PCI configuration header to a state | ||
264 | that is equivalent to what it would be after a fresh system | ||
265 | power-on followed by power-on BIOS/system firmware initialization. | ||
266 | If the platform supports PCI hotplug, then the reset might be | ||
267 | performed by toggling the slot electrical power off/on. | ||
172 | 268 | ||
173 | >>> The current ppc64 implementation does not implement this callback. | 269 | It is important for the platform to restore the PCI config space |
270 | to the "fresh poweron" state, rather than the "last state". After | ||
271 | a slot reset, the device driver will almost always use its standard | ||
272 | device initialization routines, and an unusual config space setup | ||
273 | may result in hung devices, kernel panics, or silent data corruption. | ||
174 | 274 | ||
175 | 4) slot_reset() | 275 | This call gives drivers the chance to re-initialize the hardware |
276 | (re-download firmware, etc.). At this point, the driver may assume | ||
277 | that he card is in a fresh state and is fully functional. In | ||
278 | particular, interrupt generation should work normally. | ||
176 | 279 | ||
177 | This is called after the slot has been soft or hard reset by the | 280 | Drivers should not yet restart normal I/O processing operations |
178 | platform. A soft reset consists of asserting the adapter #RST line | 281 | at this point. If all device drivers report success on this |
179 | and then restoring the PCI BARs and PCI configuration header. If the | 282 | callback, the platform will call resume() to complete the sequence, |
180 | platform supports PCI hotplug, then it might instead perform a hard | 283 | and let the driver restart normal I/O processing. |
181 | reset by toggling power on the slot off/on. This call gives drivers | ||
182 | the chance to re-initialize the hardware (re-download firmware, etc.), | ||
183 | but drivers shouldn't restart normal I/O processing operations at | ||
184 | this point. (See note about interrupts; interrupts aren't guaranteed | ||
185 | to be delivered until the resume() callback has been called). If all | ||
186 | device drivers report success on this callback, the patform will call | ||
187 | resume() to complete the error handling and let the driver restart | ||
188 | normal I/O processing. | ||
189 | 284 | ||
190 | A driver can still return a critical failure for this function if | 285 | A driver can still return a critical failure for this function if |
191 | it can't get the device operational after reset. If the platform | 286 | it can't get the device operational after reset. If the platform |
192 | previously tried a soft reset, it migh now try a hard reset (power | 287 | previously tried a soft reset, it might now try a hard reset (power |
193 | cycle) and then call slot_reset() again. It the device still can't | 288 | cycle) and then call slot_reset() again. It the device still can't |
194 | be recovered, there is nothing more that can be done; the platform | 289 | be recovered, there is nothing more that can be done; the platform |
195 | will typically report a "permanent failure" in such a case. The | 290 | will typically report a "permanent failure" in such a case. The |
196 | device will be considered "dead" in this case. | 291 | device will be considered "dead" in this case. |
197 | 292 | ||
198 | Result codes: | 293 | Drivers for multi-function cards will need to coordinate among |
199 | - PCIERR_RESULT_DISCONNECT | 294 | themselves as to which driver instance will perform any "one-shot" |
200 | Same as above. | 295 | or global device initialization. For example, the Symbios sym53cxx2 |
296 | driver performs device init only from PCI function 0: | ||
201 | 297 | ||
202 | >>> The current ppc64 implementation does not try a power-cycle reset | 298 | + if (PCI_FUNC(pdev->devfn) == 0) |
203 | >>> if the driver returned PCIERR_RESULT_DISCONNECT. However, it should. | 299 | + sym_reset_scsi_bus(np, 0); |
204 | 300 | ||
205 | 5) resume() | 301 | Result codes: |
206 | 302 | - PCI_ERS_RESULT_DISCONNECT | |
207 | This is called if all drivers on the segment have returned | 303 | Same as above. |
208 | PCIERR_RESULT_RECOVERED from one of the 3 prevous callbacks. | ||
209 | That basically tells the driver to restart activity, tht everything | ||
210 | is back and running. No result code is taken into account here. If | ||
211 | a new error happens, it will restart a new error handling process. | ||
212 | 304 | ||
213 | That's it. I think this covers all the possibilities. The way those | 305 | Platform proceeds either to STEP 5 (Resume Operations) or STEP 6 (Permanent |
214 | callbacks are called is platform policy. A platform with no slot reset | 306 | Failure). |
215 | capability for example may want to just "ignore" drivers that can't | 307 | |
308 | >>> The current powerpc implementation does not currently try a | ||
309 | >>> power-cycle reset if the driver returned PCI_ERS_RESULT_DISCONNECT. | ||
310 | >>> However, it probably should. | ||
311 | |||
312 | |||
313 | STEP 5: Resume Operations | ||
314 | ------------------------- | ||
315 | The platform will call the resume() callback on all affected device | ||
316 | drivers if all drivers on the segment have returned | ||
317 | PCI_ERS_RESULT_RECOVERED from one of the 3 previous callbacks. | ||
318 | The goal of this callback is to tell the driver to restart activity, | ||
319 | that everything is back and running. This callback does not return | ||
320 | a result code. | ||
321 | |||
322 | At this point, if a new error happens, the platform will restart | ||
323 | a new error recovery sequence. | ||
324 | |||
325 | STEP 6: Permanent Failure | ||
326 | ------------------------- | ||
327 | A "permanent failure" has occurred, and the platform cannot recover | ||
328 | the device. The platform will call error_detected() with a | ||
329 | pci_channel_state value of pci_channel_io_perm_failure. | ||
330 | |||
331 | The device driver should, at this point, assume the worst. It should | ||
332 | cancel all pending I/O, refuse all new I/O, returning -EIO to | ||
333 | higher layers. The device driver should then clean up all of its | ||
334 | memory and remove itself from kernel operations, much as it would | ||
335 | during system shutdown. | ||
336 | |||
337 | The platform will typically notify the system operator of the | ||
338 | permanent failure in some way. If the device is hotplug-capable, | ||
339 | the operator will probably want to remove and replace the device. | ||
340 | Note, however, not all failures are truly "permanent". Some are | ||
341 | caused by over-heating, some by a poorly seated card. Many | ||
342 | PCI error events are caused by software bugs, e.g. DMA's to | ||
343 | wild addresses or bogus split transactions due to programming | ||
344 | errors. See the discussion in powerpc/eeh-pci-error-recovery.txt | ||
345 | for additional detail on real-life experience of the causes of | ||
346 | software errors. | ||
347 | |||
348 | |||
349 | Conclusion; General Remarks | ||
350 | --------------------------- | ||
351 | The way those callbacks are called is platform policy. A platform with | ||
352 | no slot reset capability may want to just "ignore" drivers that can't | ||
216 | recover (disconnect them) and try to let other cards on the same segment | 353 | recover (disconnect them) and try to let other cards on the same segment |
217 | recover. Keep in mind that in most real life cases, though, there will | 354 | recover. Keep in mind that in most real life cases, though, there will |
218 | be only one driver per segment. | 355 | be only one driver per segment. |
219 | 356 | ||
220 | Now, there is a note about interrupts. If you get an interrupt and your | 357 | Now, a note about interrupts. If you get an interrupt and your |
221 | device is dead or has been isolated, there is a problem :) | 358 | device is dead or has been isolated, there is a problem :) |
222 | 359 | The current policy is to turn this into a platform policy. | |
223 | After much thinking, I decided to leave that to the platform. That is, | 360 | That is, the recovery API only requires that: |
224 | the recovery API only precies that: | ||
225 | 361 | ||
226 | - There is no guarantee that interrupt delivery can proceed from any | 362 | - There is no guarantee that interrupt delivery can proceed from any |
227 | device on the segment starting from the error detection and until the | 363 | device on the segment starting from the error detection and until the |
228 | restart callback is sent, at which point interrupts are expected to be | 364 | resume callback is sent, at which point interrupts are expected to be |
229 | fully operational. | 365 | fully operational. |
230 | 366 | ||
231 | - There is no guarantee that interrupt delivery is stopped, that is, ad | 367 | - There is no guarantee that interrupt delivery is stopped, that is, |
232 | river that gets an interrupts after detecting an error, or that detects | 368 | a driver that gets an interrupt after detecting an error, or that detects |
233 | and error within the interrupt handler such that it prevents proper | 369 | an error within the interrupt handler such that it prevents proper |
234 | ack'ing of the interrupt (and thus removal of the source) should just | 370 | ack'ing of the interrupt (and thus removal of the source) should just |
235 | return IRQ_NOTHANDLED. It's up to the platform to deal with taht | 371 | return IRQ_NOTHANDLED. It's up to the platform to deal with that |
236 | condition, typically by masking the irq source during the duration of | 372 | condition, typically by masking the IRQ source during the duration of |
237 | the error handling. It is expected that the platform "knows" which | 373 | the error handling. It is expected that the platform "knows" which |
238 | interrupts are routed to error-management capable slots and can deal | 374 | interrupts are routed to error-management capable slots and can deal |
239 | with temporarily disabling that irq number during error processing (this | 375 | with temporarily disabling that IRQ number during error processing (this |
240 | isn't terribly complex). That means some IRQ latency for other devices | 376 | isn't terribly complex). That means some IRQ latency for other devices |
241 | sharing the interrupt, but there is simply no other way. High end | 377 | sharing the interrupt, but there is simply no other way. High end |
242 | platforms aren't supposed to share interrupts between many devices | 378 | platforms aren't supposed to share interrupts between many devices |
243 | anyway :) | 379 | anyway :) |
244 | 380 | ||
245 | 381 | >>> Implementation details for the powerpc platform are discussed in | |
246 | Revised: 31 May 2005 Linas Vepstas <linas@austin.ibm.com> | 382 | >>> the file Documentation/powerpc/eeh-pci-error-recovery.txt |
383 | |||
384 | >>> As of this writing, there are six device drivers with patches | ||
385 | >>> implementing error recovery. Not all of these patches are in | ||
386 | >>> mainline yet. These may be used as "examples": | ||
387 | >>> | ||
388 | >>> drivers/scsi/ipr.c | ||
389 | >>> drivers/scsi/sym53cxx_2 | ||
390 | >>> drivers/next/e100.c | ||
391 | >>> drivers/net/e1000 | ||
392 | >>> drivers/net/ixgb | ||
393 | >>> drivers/net/s2io.c | ||
394 | |||
395 | The End | ||
396 | ------- | ||
diff --git a/Documentation/power/interface.txt b/Documentation/power/interface.txt index bd4ffb5bd49a..4117802af0f8 100644 --- a/Documentation/power/interface.txt +++ b/Documentation/power/interface.txt | |||
@@ -44,7 +44,7 @@ it. | |||
44 | /sys/power/image_size controls the size of the image created by | 44 | /sys/power/image_size controls the size of the image created by |
45 | the suspend-to-disk mechanism. It can be written a string | 45 | the suspend-to-disk mechanism. It can be written a string |
46 | representing a non-negative integer that will be used as an upper | 46 | representing a non-negative integer that will be used as an upper |
47 | limit of the image size, in megabytes. The suspend-to-disk mechanism will | 47 | limit of the image size, in bytes. The suspend-to-disk mechanism will |
48 | do its best to ensure the image size will not exceed that number. However, | 48 | do its best to ensure the image size will not exceed that number. However, |
49 | if this turns out to be impossible, it will try to suspend anyway using the | 49 | if this turns out to be impossible, it will try to suspend anyway using the |
50 | smallest image possible. In particular, if "0" is written to this file, the | 50 | smallest image possible. In particular, if "0" is written to this file, the |
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt index 08c79d4dc540..b28b7f04abb8 100644 --- a/Documentation/power/swsusp.txt +++ b/Documentation/power/swsusp.txt | |||
@@ -27,7 +27,7 @@ echo shutdown > /sys/power/disk; echo disk > /sys/power/state | |||
27 | 27 | ||
28 | echo platform > /sys/power/disk; echo disk > /sys/power/state | 28 | echo platform > /sys/power/disk; echo disk > /sys/power/state |
29 | 29 | ||
30 | If you want to limit the suspend image size to N megabytes, do | 30 | If you want to limit the suspend image size to N bytes, do |
31 | 31 | ||
32 | echo N > /sys/power/image_size | 32 | echo N > /sys/power/image_size |
33 | 33 | ||
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt new file mode 100644 index 000000000000..1284498e847c --- /dev/null +++ b/Documentation/powerpc/booting-without-of.txt | |||
@@ -0,0 +1,1420 @@ | |||
1 | Booting the Linux/ppc kernel without Open Firmware | ||
2 | -------------------------------------------------- | ||
3 | |||
4 | |||
5 | (c) 2005 Benjamin Herrenschmidt <benh at kernel.crashing.org>, | ||
6 | IBM Corp. | ||
7 | (c) 2005 Becky Bruce <becky.bruce at freescale.com>, | ||
8 | Freescale Semiconductor, FSL SOC and 32-bit additions | ||
9 | |||
10 | May 18, 2005: Rev 0.1 - Initial draft, no chapter III yet. | ||
11 | |||
12 | May 19, 2005: Rev 0.2 - Add chapter III and bits & pieces here or | ||
13 | clarifies the fact that a lot of things are | ||
14 | optional, the kernel only requires a very | ||
15 | small device tree, though it is encouraged | ||
16 | to provide an as complete one as possible. | ||
17 | |||
18 | May 24, 2005: Rev 0.3 - Precise that DT block has to be in RAM | ||
19 | - Misc fixes | ||
20 | - Define version 3 and new format version 16 | ||
21 | for the DT block (version 16 needs kernel | ||
22 | patches, will be fwd separately). | ||
23 | String block now has a size, and full path | ||
24 | is replaced by unit name for more | ||
25 | compactness. | ||
26 | linux,phandle is made optional, only nodes | ||
27 | that are referenced by other nodes need it. | ||
28 | "name" property is now automatically | ||
29 | deduced from the unit name | ||
30 | |||
31 | June 1, 2005: Rev 0.4 - Correct confusion between OF_DT_END and | ||
32 | OF_DT_END_NODE in structure definition. | ||
33 | - Change version 16 format to always align | ||
34 | property data to 4 bytes. Since tokens are | ||
35 | already aligned, that means no specific | ||
36 | required alignement between property size | ||
37 | and property data. The old style variable | ||
38 | alignment would make it impossible to do | ||
39 | "simple" insertion of properties using | ||
40 | memove (thanks Milton for | ||
41 | noticing). Updated kernel patch as well | ||
42 | - Correct a few more alignement constraints | ||
43 | - Add a chapter about the device-tree | ||
44 | compiler and the textural representation of | ||
45 | the tree that can be "compiled" by dtc. | ||
46 | |||
47 | |||
48 | November 21, 2005: Rev 0.5 | ||
49 | - Additions/generalizations for 32-bit | ||
50 | - Changed to reflect the new arch/powerpc | ||
51 | structure | ||
52 | - Added chapter VI | ||
53 | |||
54 | |||
55 | ToDo: | ||
56 | - Add some definitions of interrupt tree (simple/complex) | ||
57 | - Add some definitions for pci host bridges | ||
58 | - Add some common address format examples | ||
59 | - Add definitions for standard properties and "compatible" | ||
60 | names for cells that are not already defined by the existing | ||
61 | OF spec. | ||
62 | - Compare FSL SOC use of PCI to standard and make sure no new | ||
63 | node definition required. | ||
64 | - Add more information about node definitions for SOC devices | ||
65 | that currently have no standard, like the FSL CPM. | ||
66 | |||
67 | |||
68 | I - Introduction | ||
69 | ================ | ||
70 | |||
71 | During the recent development of the Linux/ppc64 kernel, and more | ||
72 | specifically, the addition of new platform types outside of the old | ||
73 | IBM pSeries/iSeries pair, it was decided to enforce some strict rules | ||
74 | regarding the kernel entry and bootloader <-> kernel interfaces, in | ||
75 | order to avoid the degeneration that had become the ppc32 kernel entry | ||
76 | point and the way a new platform should be added to the kernel. The | ||
77 | legacy iSeries platform breaks those rules as it predates this scheme, | ||
78 | but no new board support will be accepted in the main tree that | ||
79 | doesn't follows them properly. In addition, since the advent of the | ||
80 | arch/powerpc merged architecture for ppc32 and ppc64, new 32-bit | ||
81 | platforms and 32-bit platforms which move into arch/powerpc will be | ||
82 | required to use these rules as well. | ||
83 | |||
84 | The main requirement that will be defined in more detail below is | ||
85 | the presence of a device-tree whose format is defined after Open | ||
86 | Firmware specification. However, in order to make life easier | ||
87 | to embedded board vendors, the kernel doesn't require the device-tree | ||
88 | to represent every device in the system and only requires some nodes | ||
89 | and properties to be present. This will be described in detail in | ||
90 | section III, but, for example, the kernel does not require you to | ||
91 | create a node for every PCI device in the system. It is a requirement | ||
92 | to have a node for PCI host bridges in order to provide interrupt | ||
93 | routing informations and memory/IO ranges, among others. It is also | ||
94 | recommended to define nodes for on chip devices and other busses that | ||
95 | don't specifically fit in an existing OF specification. This creates a | ||
96 | great flexibility in the way the kernel can then probe those and match | ||
97 | drivers to device, without having to hard code all sorts of tables. It | ||
98 | also makes it more flexible for board vendors to do minor hardware | ||
99 | upgrades without significantly impacting the kernel code or cluttering | ||
100 | it with special cases. | ||
101 | |||
102 | |||
103 | 1) Entry point for arch/powerpc | ||
104 | ------------------------------- | ||
105 | |||
106 | There is one and one single entry point to the kernel, at the start | ||
107 | of the kernel image. That entry point supports two calling | ||
108 | conventions: | ||
109 | |||
110 | a) Boot from Open Firmware. If your firmware is compatible | ||
111 | with Open Firmware (IEEE 1275) or provides an OF compatible | ||
112 | client interface API (support for "interpret" callback of | ||
113 | forth words isn't required), you can enter the kernel with: | ||
114 | |||
115 | r5 : OF callback pointer as defined by IEEE 1275 | ||
116 | bindings to powerpc. Only the 32 bit client interface | ||
117 | is currently supported | ||
118 | |||
119 | r3, r4 : address & length of an initrd if any or 0 | ||
120 | |||
121 | The MMU is either on or off; the kernel will run the | ||
122 | trampoline located in arch/powerpc/kernel/prom_init.c to | ||
123 | extract the device-tree and other information from open | ||
124 | firmware and build a flattened device-tree as described | ||
125 | in b). prom_init() will then re-enter the kernel using | ||
126 | the second method. This trampoline code runs in the | ||
127 | context of the firmware, which is supposed to handle all | ||
128 | exceptions during that time. | ||
129 | |||
130 | b) Direct entry with a flattened device-tree block. This entry | ||
131 | point is called by a) after the OF trampoline and can also be | ||
132 | called directly by a bootloader that does not support the Open | ||
133 | Firmware client interface. It is also used by "kexec" to | ||
134 | implement "hot" booting of a new kernel from a previous | ||
135 | running one. This method is what I will describe in more | ||
136 | details in this document, as method a) is simply standard Open | ||
137 | Firmware, and thus should be implemented according to the | ||
138 | various standard documents defining it and its binding to the | ||
139 | PowerPC platform. The entry point definition then becomes: | ||
140 | |||
141 | r3 : physical pointer to the device-tree block | ||
142 | (defined in chapter II) in RAM | ||
143 | |||
144 | r4 : physical pointer to the kernel itself. This is | ||
145 | used by the assembly code to properly disable the MMU | ||
146 | in case you are entering the kernel with MMU enabled | ||
147 | and a non-1:1 mapping. | ||
148 | |||
149 | r5 : NULL (as to differenciate with method a) | ||
150 | |||
151 | Note about SMP entry: Either your firmware puts your other | ||
152 | CPUs in some sleep loop or spin loop in ROM where you can get | ||
153 | them out via a soft reset or some other means, in which case | ||
154 | you don't need to care, or you'll have to enter the kernel | ||
155 | with all CPUs. The way to do that with method b) will be | ||
156 | described in a later revision of this document. | ||
157 | |||
158 | |||
159 | 2) Board support | ||
160 | ---------------- | ||
161 | |||
162 | 64-bit kernels: | ||
163 | |||
164 | Board supports (platforms) are not exclusive config options. An | ||
165 | arbitrary set of board supports can be built in a single kernel | ||
166 | image. The kernel will "know" what set of functions to use for a | ||
167 | given platform based on the content of the device-tree. Thus, you | ||
168 | should: | ||
169 | |||
170 | a) add your platform support as a _boolean_ option in | ||
171 | arch/powerpc/Kconfig, following the example of PPC_PSERIES, | ||
172 | PPC_PMAC and PPC_MAPLE. The later is probably a good | ||
173 | example of a board support to start from. | ||
174 | |||
175 | b) create your main platform file as | ||
176 | "arch/powerpc/platforms/myplatform/myboard_setup.c" and add it | ||
177 | to the Makefile under the condition of your CONFIG_ | ||
178 | option. This file will define a structure of type "ppc_md" | ||
179 | containing the various callbacks that the generic code will | ||
180 | use to get to your platform specific code | ||
181 | |||
182 | c) Add a reference to your "ppc_md" structure in the | ||
183 | "machines" table in arch/powerpc/kernel/setup_64.c if you are | ||
184 | a 64-bit platform. | ||
185 | |||
186 | d) request and get assigned a platform number (see PLATFORM_* | ||
187 | constants in include/asm-powerpc/processor.h | ||
188 | |||
189 | 32-bit embedded kernels: | ||
190 | |||
191 | Currently, board support is essentially an exclusive config option. | ||
192 | The kernel is configured for a single platform. Part of the reason | ||
193 | for this is to keep kernels on embedded systems small and efficient; | ||
194 | part of this is due to the fact the code is already that way. In the | ||
195 | future, a kernel may support multiple platforms, but only if the | ||
196 | platforms feature the same core architectire. A single kernel build | ||
197 | cannot support both configurations with Book E and configurations | ||
198 | with classic Powerpc architectures. | ||
199 | |||
200 | 32-bit embedded platforms that are moved into arch/powerpc using a | ||
201 | flattened device tree should adopt the merged tree practice of | ||
202 | setting ppc_md up dynamically, even though the kernel is currently | ||
203 | built with support for only a single platform at a time. This allows | ||
204 | unification of the setup code, and will make it easier to go to a | ||
205 | multiple-platform-support model in the future. | ||
206 | |||
207 | NOTE: I believe the above will be true once Ben's done with the merge | ||
208 | of the boot sequences.... someone speak up if this is wrong! | ||
209 | |||
210 | To add a 32-bit embedded platform support, follow the instructions | ||
211 | for 64-bit platforms above, with the exception that the Kconfig | ||
212 | option should be set up such that the kernel builds exclusively for | ||
213 | the platform selected. The processor type for the platform should | ||
214 | enable another config option to select the specific board | ||
215 | supported. | ||
216 | |||
217 | NOTE: If ben doesn't merge the setup files, may need to change this to | ||
218 | point to setup_32.c | ||
219 | |||
220 | |||
221 | I will describe later the boot process and various callbacks that | ||
222 | your platform should implement. | ||
223 | |||
224 | |||
225 | II - The DT block format | ||
226 | ======================== | ||
227 | |||
228 | |||
229 | This chapter defines the actual format of the flattened device-tree | ||
230 | passed to the kernel. The actual content of it and kernel requirements | ||
231 | are described later. You can find example of code manipulating that | ||
232 | format in various places, including arch/powerpc/kernel/prom_init.c | ||
233 | which will generate a flattened device-tree from the Open Firmware | ||
234 | representation, or the fs2dt utility which is part of the kexec tools | ||
235 | which will generate one from a filesystem representation. It is | ||
236 | expected that a bootloader like uboot provides a bit more support, | ||
237 | that will be discussed later as well. | ||
238 | |||
239 | Note: The block has to be in main memory. It has to be accessible in | ||
240 | both real mode and virtual mode with no mapping other than main | ||
241 | memory. If you are writing a simple flash bootloader, it should copy | ||
242 | the block to RAM before passing it to the kernel. | ||
243 | |||
244 | |||
245 | 1) Header | ||
246 | --------- | ||
247 | |||
248 | The kernel is entered with r3 pointing to an area of memory that is | ||
249 | roughtly described in include/asm-powerpc/prom.h by the structure | ||
250 | boot_param_header: | ||
251 | |||
252 | struct boot_param_header { | ||
253 | u32 magic; /* magic word OF_DT_HEADER */ | ||
254 | u32 totalsize; /* total size of DT block */ | ||
255 | u32 off_dt_struct; /* offset to structure */ | ||
256 | u32 off_dt_strings; /* offset to strings */ | ||
257 | u32 off_mem_rsvmap; /* offset to memory reserve map | ||
258 | */ | ||
259 | u32 version; /* format version */ | ||
260 | u32 last_comp_version; /* last compatible version */ | ||
261 | |||
262 | /* version 2 fields below */ | ||
263 | u32 boot_cpuid_phys; /* Which physical CPU id we're | ||
264 | booting on */ | ||
265 | /* version 3 fields below */ | ||
266 | u32 size_dt_strings; /* size of the strings block */ | ||
267 | }; | ||
268 | |||
269 | Along with the constants: | ||
270 | |||
271 | /* Definitions used by the flattened device tree */ | ||
272 | #define OF_DT_HEADER 0xd00dfeed /* 4: version, | ||
273 | 4: total size */ | ||
274 | #define OF_DT_BEGIN_NODE 0x1 /* Start node: full name | ||
275 | */ | ||
276 | #define OF_DT_END_NODE 0x2 /* End node */ | ||
277 | #define OF_DT_PROP 0x3 /* Property: name off, | ||
278 | size, content */ | ||
279 | #define OF_DT_END 0x9 | ||
280 | |||
281 | All values in this header are in big endian format, the various | ||
282 | fields in this header are defined more precisely below. All | ||
283 | "offset" values are in bytes from the start of the header; that is | ||
284 | from the value of r3. | ||
285 | |||
286 | - magic | ||
287 | |||
288 | This is a magic value that "marks" the beginning of the | ||
289 | device-tree block header. It contains the value 0xd00dfeed and is | ||
290 | defined by the constant OF_DT_HEADER | ||
291 | |||
292 | - totalsize | ||
293 | |||
294 | This is the total size of the DT block including the header. The | ||
295 | "DT" block should enclose all data structures defined in this | ||
296 | chapter (who are pointed to by offsets in this header). That is, | ||
297 | the device-tree structure, strings, and the memory reserve map. | ||
298 | |||
299 | - off_dt_struct | ||
300 | |||
301 | This is an offset from the beginning of the header to the start | ||
302 | of the "structure" part the device tree. (see 2) device tree) | ||
303 | |||
304 | - off_dt_strings | ||
305 | |||
306 | This is an offset from the beginning of the header to the start | ||
307 | of the "strings" part of the device-tree | ||
308 | |||
309 | - off_mem_rsvmap | ||
310 | |||
311 | This is an offset from the beginning of the header to the start | ||
312 | of the reserved memory map. This map is a list of pairs of 64 | ||
313 | bit integers. Each pair is a physical address and a size. The | ||
314 | |||
315 | list is terminated by an entry of size 0. This map provides the | ||
316 | kernel with a list of physical memory areas that are "reserved" | ||
317 | and thus not to be used for memory allocations, especially during | ||
318 | early initialization. The kernel needs to allocate memory during | ||
319 | boot for things like un-flattening the device-tree, allocating an | ||
320 | MMU hash table, etc... Those allocations must be done in such a | ||
321 | way to avoid overriding critical things like, on Open Firmware | ||
322 | capable machines, the RTAS instance, or on some pSeries, the TCE | ||
323 | tables used for the iommu. Typically, the reserve map should | ||
324 | contain _at least_ this DT block itself (header,total_size). If | ||
325 | you are passing an initrd to the kernel, you should reserve it as | ||
326 | well. You do not need to reserve the kernel image itself. The map | ||
327 | should be 64 bit aligned. | ||
328 | |||
329 | - version | ||
330 | |||
331 | This is the version of this structure. Version 1 stops | ||
332 | here. Version 2 adds an additional field boot_cpuid_phys. | ||
333 | Version 3 adds the size of the strings block, allowing the kernel | ||
334 | to reallocate it easily at boot and free up the unused flattened | ||
335 | structure after expansion. Version 16 introduces a new more | ||
336 | "compact" format for the tree itself that is however not backward | ||
337 | compatible. You should always generate a structure of the highest | ||
338 | version defined at the time of your implementation. Currently | ||
339 | that is version 16, unless you explicitely aim at being backward | ||
340 | compatible. | ||
341 | |||
342 | - last_comp_version | ||
343 | |||
344 | Last compatible version. This indicates down to what version of | ||
345 | the DT block you are backward compatible. For example, version 2 | ||
346 | is backward compatible with version 1 (that is, a kernel build | ||
347 | for version 1 will be able to boot with a version 2 format). You | ||
348 | should put a 1 in this field if you generate a device tree of | ||
349 | version 1 to 3, or 0x10 if you generate a tree of version 0x10 | ||
350 | using the new unit name format. | ||
351 | |||
352 | - boot_cpuid_phys | ||
353 | |||
354 | This field only exist on version 2 headers. It indicate which | ||
355 | physical CPU ID is calling the kernel entry point. This is used, | ||
356 | among others, by kexec. If you are on an SMP system, this value | ||
357 | should match the content of the "reg" property of the CPU node in | ||
358 | the device-tree corresponding to the CPU calling the kernel entry | ||
359 | point (see further chapters for more informations on the required | ||
360 | device-tree contents) | ||
361 | |||
362 | |||
363 | So the typical layout of a DT block (though the various parts don't | ||
364 | need to be in that order) looks like this (addresses go from top to | ||
365 | bottom): | ||
366 | |||
367 | |||
368 | ------------------------------ | ||
369 | r3 -> | struct boot_param_header | | ||
370 | ------------------------------ | ||
371 | | (alignment gap) (*) | | ||
372 | ------------------------------ | ||
373 | | memory reserve map | | ||
374 | ------------------------------ | ||
375 | | (alignment gap) | | ||
376 | ------------------------------ | ||
377 | | | | ||
378 | | device-tree structure | | ||
379 | | | | ||
380 | ------------------------------ | ||
381 | | (alignment gap) | | ||
382 | ------------------------------ | ||
383 | | | | ||
384 | | device-tree strings | | ||
385 | | | | ||
386 | -----> ------------------------------ | ||
387 | | | ||
388 | | | ||
389 | --- (r3 + totalsize) | ||
390 | |||
391 | (*) The alignment gaps are not necessarily present; their presence | ||
392 | and size are dependent on the various alignment requirements of | ||
393 | the individual data blocks. | ||
394 | |||
395 | |||
396 | 2) Device tree generalities | ||
397 | --------------------------- | ||
398 | |||
399 | This device-tree itself is separated in two different blocks, a | ||
400 | structure block and a strings block. Both need to be aligned to a 4 | ||
401 | byte boundary. | ||
402 | |||
403 | First, let's quickly describe the device-tree concept before detailing | ||
404 | the storage format. This chapter does _not_ describe the detail of the | ||
405 | required types of nodes & properties for the kernel, this is done | ||
406 | later in chapter III. | ||
407 | |||
408 | The device-tree layout is strongly inherited from the definition of | ||
409 | the Open Firmware IEEE 1275 device-tree. It's basically a tree of | ||
410 | nodes, each node having two or more named properties. A property can | ||
411 | have a value or not. | ||
412 | |||
413 | It is a tree, so each node has one and only one parent except for the | ||
414 | root node who has no parent. | ||
415 | |||
416 | A node has 2 names. The actual node name is generally contained in a | ||
417 | property of type "name" in the node property list whose value is a | ||
418 | zero terminated string and is mandatory for version 1 to 3 of the | ||
419 | format definition (as it is in Open Firmware). Version 0x10 makes it | ||
420 | optional as it can generate it from the unit name defined below. | ||
421 | |||
422 | There is also a "unit name" that is used to differenciate nodes with | ||
423 | the same name at the same level, it is usually made of the node | ||
424 | name's, the "@" sign, and a "unit address", which definition is | ||
425 | specific to the bus type the node sits on. | ||
426 | |||
427 | The unit name doesn't exist as a property per-se but is included in | ||
428 | the device-tree structure. It is typically used to represent "path" in | ||
429 | the device-tree. More details about the actual format of these will be | ||
430 | below. | ||
431 | |||
432 | The kernel powerpc generic code does not make any formal use of the | ||
433 | unit address (though some board support code may do) so the only real | ||
434 | requirement here for the unit address is to ensure uniqueness of | ||
435 | the node unit name at a given level of the tree. Nodes with no notion | ||
436 | of address and no possible sibling of the same name (like /memory or | ||
437 | /cpus) may omit the unit address in the context of this specification, | ||
438 | or use the "@0" default unit address. The unit name is used to define | ||
439 | a node "full path", which is the concatenation of all parent node | ||
440 | unit names separated with "/". | ||
441 | |||
442 | The root node doesn't have a defined name, and isn't required to have | ||
443 | a name property either if you are using version 3 or earlier of the | ||
444 | format. It also has no unit address (no @ symbol followed by a unit | ||
445 | address). The root node unit name is thus an empty string. The full | ||
446 | path to the root node is "/". | ||
447 | |||
448 | Every node which actually represents an actual device (that is, a node | ||
449 | which isn't only a virtual "container" for more nodes, like "/cpus" | ||
450 | is) is also required to have a "device_type" property indicating the | ||
451 | type of node . | ||
452 | |||
453 | Finally, every node that can be referenced from a property in another | ||
454 | node is required to have a "linux,phandle" property. Real open | ||
455 | firmware implementations provide a unique "phandle" value for every | ||
456 | node that the "prom_init()" trampoline code turns into | ||
457 | "linux,phandle" properties. However, this is made optional if the | ||
458 | flattened device tree is used directly. An example of a node | ||
459 | referencing another node via "phandle" is when laying out the | ||
460 | interrupt tree which will be described in a further version of this | ||
461 | document. | ||
462 | |||
463 | This "linux, phandle" property is a 32 bit value that uniquely | ||
464 | identifies a node. You are free to use whatever values or system of | ||
465 | values, internal pointers, or whatever to generate these, the only | ||
466 | requirement is that every node for which you provide that property has | ||
467 | a unique value for it. | ||
468 | |||
469 | Here is an example of a simple device-tree. In this example, an "o" | ||
470 | designates a node followed by the node unit name. Properties are | ||
471 | presented with their name followed by their content. "content" | ||
472 | represents an ASCII string (zero terminated) value, while <content> | ||
473 | represents a 32 bit hexadecimal value. The various nodes in this | ||
474 | example will be discussed in a later chapter. At this point, it is | ||
475 | only meant to give you a idea of what a device-tree looks like. I have | ||
476 | purposefully kept the "name" and "linux,phandle" properties which | ||
477 | aren't necessary in order to give you a better idea of what the tree | ||
478 | looks like in practice. | ||
479 | |||
480 | / o device-tree | ||
481 | |- name = "device-tree" | ||
482 | |- model = "MyBoardName" | ||
483 | |- compatible = "MyBoardFamilyName" | ||
484 | |- #address-cells = <2> | ||
485 | |- #size-cells = <2> | ||
486 | |- linux,phandle = <0> | ||
487 | | | ||
488 | o cpus | ||
489 | | | - name = "cpus" | ||
490 | | | - linux,phandle = <1> | ||
491 | | | - #address-cells = <1> | ||
492 | | | - #size-cells = <0> | ||
493 | | | | ||
494 | | o PowerPC,970@0 | ||
495 | | |- name = "PowerPC,970" | ||
496 | | |- device_type = "cpu" | ||
497 | | |- reg = <0> | ||
498 | | |- clock-frequency = <5f5e1000> | ||
499 | | |- linux,boot-cpu | ||
500 | | |- linux,phandle = <2> | ||
501 | | | ||
502 | o memory@0 | ||
503 | | |- name = "memory" | ||
504 | | |- device_type = "memory" | ||
505 | | |- reg = <00000000 00000000 00000000 20000000> | ||
506 | | |- linux,phandle = <3> | ||
507 | | | ||
508 | o chosen | ||
509 | |- name = "chosen" | ||
510 | |- bootargs = "root=/dev/sda2" | ||
511 | |- linux,platform = <00000600> | ||
512 | |- linux,phandle = <4> | ||
513 | |||
514 | This tree is almost a minimal tree. It pretty much contains the | ||
515 | minimal set of required nodes and properties to boot a linux kernel; | ||
516 | that is, some basic model informations at the root, the CPUs, and the | ||
517 | physical memory layout. It also includes misc information passed | ||
518 | through /chosen, like in this example, the platform type (mandatory) | ||
519 | and the kernel command line arguments (optional). | ||
520 | |||
521 | The /cpus/PowerPC,970@0/linux,boot-cpu property is an example of a | ||
522 | property without a value. All other properties have a value. The | ||
523 | significance of the #address-cells and #size-cells properties will be | ||
524 | explained in chapter IV which defines precisely the required nodes and | ||
525 | properties and their content. | ||
526 | |||
527 | |||
528 | 3) Device tree "structure" block | ||
529 | |||
530 | The structure of the device tree is a linearized tree structure. The | ||
531 | "OF_DT_BEGIN_NODE" token starts a new node, and the "OF_DT_END_NODE" | ||
532 | ends that node definition. Child nodes are simply defined before | ||
533 | "OF_DT_END_NODE" (that is nodes within the node). A 'token' is a 32 | ||
534 | bit value. The tree has to be "finished" with a OF_DT_END token | ||
535 | |||
536 | Here's the basic structure of a single node: | ||
537 | |||
538 | * token OF_DT_BEGIN_NODE (that is 0x00000001) | ||
539 | * for version 1 to 3, this is the node full path as a zero | ||
540 | terminated string, starting with "/". For version 16 and later, | ||
541 | this is the node unit name only (or an empty string for the | ||
542 | root node) | ||
543 | * [align gap to next 4 bytes boundary] | ||
544 | * for each property: | ||
545 | * token OF_DT_PROP (that is 0x00000003) | ||
546 | * 32 bit value of property value size in bytes (or 0 of no | ||
547 | * value) | ||
548 | * 32 bit value of offset in string block of property name | ||
549 | * property value data if any | ||
550 | * [align gap to next 4 bytes boundary] | ||
551 | * [child nodes if any] | ||
552 | * token OF_DT_END_NODE (that is 0x00000002) | ||
553 | |||
554 | So the node content can be summmarised as a start token, a full path, | ||
555 | a list of properties, a list of child node and an end token. Every | ||
556 | child node is a full node structure itself as defined above. | ||
557 | |||
558 | 4) Device tree 'strings" block | ||
559 | |||
560 | In order to save space, property names, which are generally redundant, | ||
561 | are stored separately in the "strings" block. This block is simply the | ||
562 | whole bunch of zero terminated strings for all property names | ||
563 | concatenated together. The device-tree property definitions in the | ||
564 | structure block will contain offset values from the beginning of the | ||
565 | strings block. | ||
566 | |||
567 | |||
568 | III - Required content of the device tree | ||
569 | ========================================= | ||
570 | |||
571 | WARNING: All "linux,*" properties defined in this document apply only | ||
572 | to a flattened device-tree. If your platform uses a real | ||
573 | implementation of Open Firmware or an implementation compatible with | ||
574 | the Open Firmware client interface, those properties will be created | ||
575 | by the trampoline code in the kernel's prom_init() file. For example, | ||
576 | that's where you'll have to add code to detect your board model and | ||
577 | set the platform number. However, when using the flatenned device-tree | ||
578 | entry point, there is no prom_init() pass, and thus you have to | ||
579 | provide those properties yourself. | ||
580 | |||
581 | |||
582 | 1) Note about cells and address representation | ||
583 | ---------------------------------------------- | ||
584 | |||
585 | The general rule is documented in the various Open Firmware | ||
586 | documentations. If you chose to describe a bus with the device-tree | ||
587 | and there exist an OF bus binding, then you should follow the | ||
588 | specification. However, the kernel does not require every single | ||
589 | device or bus to be described by the device tree. | ||
590 | |||
591 | In general, the format of an address for a device is defined by the | ||
592 | parent bus type, based on the #address-cells and #size-cells | ||
593 | property. In the absence of such a property, the parent's parent | ||
594 | values are used, etc... The kernel requires the root node to have | ||
595 | those properties defining addresses format for devices directly mapped | ||
596 | on the processor bus. | ||
597 | |||
598 | Those 2 properties define 'cells' for representing an address and a | ||
599 | size. A "cell" is a 32 bit number. For example, if both contain 2 | ||
600 | like the example tree given above, then an address and a size are both | ||
601 | composed of 2 cells, and each is a 64 bit number (cells are | ||
602 | concatenated and expected to be in big endian format). Another example | ||
603 | is the way Apple firmware defines them, with 2 cells for an address | ||
604 | and one cell for a size. Most 32-bit implementations should define | ||
605 | #address-cells and #size-cells to 1, which represents a 32-bit value. | ||
606 | Some 32-bit processors allow for physical addresses greater than 32 | ||
607 | bits; these processors should define #address-cells as 2. | ||
608 | |||
609 | "reg" properties are always a tuple of the type "address size" where | ||
610 | the number of cells of address and size is specified by the bus | ||
611 | #address-cells and #size-cells. When a bus supports various address | ||
612 | spaces and other flags relative to a given address allocation (like | ||
613 | prefetchable, etc...) those flags are usually added to the top level | ||
614 | bits of the physical address. For example, a PCI physical address is | ||
615 | made of 3 cells, the bottom two containing the actual address itself | ||
616 | while the top cell contains address space indication, flags, and pci | ||
617 | bus & device numbers. | ||
618 | |||
619 | For busses that support dynamic allocation, it's the accepted practice | ||
620 | to then not provide the address in "reg" (keep it 0) though while | ||
621 | providing a flag indicating the address is dynamically allocated, and | ||
622 | then, to provide a separate "assigned-addresses" property that | ||
623 | contains the fully allocated addresses. See the PCI OF bindings for | ||
624 | details. | ||
625 | |||
626 | In general, a simple bus with no address space bits and no dynamic | ||
627 | allocation is preferred if it reflects your hardware, as the existing | ||
628 | kernel address parsing functions will work out of the box. If you | ||
629 | define a bus type with a more complex address format, including things | ||
630 | like address space bits, you'll have to add a bus translator to the | ||
631 | prom_parse.c file of the recent kernels for your bus type. | ||
632 | |||
633 | The "reg" property only defines addresses and sizes (if #size-cells | ||
634 | is | ||
635 | non-0) within a given bus. In order to translate addresses upward | ||
636 | (that is into parent bus addresses, and possibly into cpu physical | ||
637 | addresses), all busses must contain a "ranges" property. If the | ||
638 | "ranges" property is missing at a given level, it's assumed that | ||
639 | translation isn't possible. The format of the "ranges" proprety for a | ||
640 | bus is a list of: | ||
641 | |||
642 | bus address, parent bus address, size | ||
643 | |||
644 | "bus address" is in the format of the bus this bus node is defining, | ||
645 | that is, for a PCI bridge, it would be a PCI address. Thus, (bus | ||
646 | address, size) defines a range of addresses for child devices. "parent | ||
647 | bus address" is in the format of the parent bus of this bus. For | ||
648 | example, for a PCI host controller, that would be a CPU address. For a | ||
649 | PCI<->ISA bridge, that would be a PCI address. It defines the base | ||
650 | address in the parent bus where the beginning of that range is mapped. | ||
651 | |||
652 | For a new 64 bit powerpc board, I recommend either the 2/2 format or | ||
653 | Apple's 2/1 format which is slightly more compact since sizes usually | ||
654 | fit in a single 32 bit word. New 32 bit powerpc boards should use a | ||
655 | 1/1 format, unless the processor supports physical addresses greater | ||
656 | than 32-bits, in which case a 2/1 format is recommended. | ||
657 | |||
658 | |||
659 | 2) Note about "compatible" properties | ||
660 | ------------------------------------- | ||
661 | |||
662 | These properties are optional, but recommended in devices and the root | ||
663 | node. The format of a "compatible" property is a list of concatenated | ||
664 | zero terminated strings. They allow a device to express its | ||
665 | compatibility with a family of similar devices, in some cases, | ||
666 | allowing a single driver to match against several devices regardless | ||
667 | of their actual names. | ||
668 | |||
669 | 3) Note about "name" properties | ||
670 | ------------------------------- | ||
671 | |||
672 | While earlier users of Open Firmware like OldWorld macintoshes tended | ||
673 | to use the actual device name for the "name" property, it's nowadays | ||
674 | considered a good practice to use a name that is closer to the device | ||
675 | class (often equal to device_type). For example, nowadays, ethernet | ||
676 | controllers are named "ethernet", an additional "model" property | ||
677 | defining precisely the chip type/model, and "compatible" property | ||
678 | defining the family in case a single driver can driver more than one | ||
679 | of these chips. However, the kernel doesn't generally put any | ||
680 | restriction on the "name" property; it is simply considered good | ||
681 | practice to follow the standard and its evolutions as closely as | ||
682 | possible. | ||
683 | |||
684 | Note also that the new format version 16 makes the "name" property | ||
685 | optional. If it's absent for a node, then the node's unit name is then | ||
686 | used to reconstruct the name. That is, the part of the unit name | ||
687 | before the "@" sign is used (or the entire unit name if no "@" sign | ||
688 | is present). | ||
689 | |||
690 | 4) Note about node and property names and character set | ||
691 | ------------------------------------------------------- | ||
692 | |||
693 | While open firmware provides more flexibe usage of 8859-1, this | ||
694 | specification enforces more strict rules. Nodes and properties should | ||
695 | be comprised only of ASCII characters 'a' to 'z', '0' to | ||
696 | '9', ',', '.', '_', '+', '#', '?', and '-'. Node names additionally | ||
697 | allow uppercase characters 'A' to 'Z' (property names should be | ||
698 | lowercase. The fact that vendors like Apple don't respect this rule is | ||
699 | irrelevant here). Additionally, node and property names should always | ||
700 | begin with a character in the range 'a' to 'z' (or 'A' to 'Z' for node | ||
701 | names). | ||
702 | |||
703 | The maximum number of characters for both nodes and property names | ||
704 | is 31. In the case of node names, this is only the leftmost part of | ||
705 | a unit name (the pure "name" property), it doesn't include the unit | ||
706 | address which can extend beyond that limit. | ||
707 | |||
708 | |||
709 | 5) Required nodes and properties | ||
710 | -------------------------------- | ||
711 | These are all that are currently required. However, it is strongly | ||
712 | recommended that you expose PCI host bridges as documented in the | ||
713 | PCI binding to open firmware, and your interrupt tree as documented | ||
714 | in OF interrupt tree specification. | ||
715 | |||
716 | a) The root node | ||
717 | |||
718 | The root node requires some properties to be present: | ||
719 | |||
720 | - model : this is your board name/model | ||
721 | - #address-cells : address representation for "root" devices | ||
722 | - #size-cells: the size representation for "root" devices | ||
723 | |||
724 | Additionally, some recommended properties are: | ||
725 | |||
726 | - compatible : the board "family" generally finds its way here, | ||
727 | for example, if you have 2 board models with a similar layout, | ||
728 | that typically get driven by the same platform code in the | ||
729 | kernel, you would use a different "model" property but put a | ||
730 | value in "compatible". The kernel doesn't directly use that | ||
731 | value (see /chosen/linux,platform for how the kernel choses a | ||
732 | platform type) but it is generally useful. | ||
733 | |||
734 | The root node is also generally where you add additional properties | ||
735 | specific to your board like the serial number if any, that sort of | ||
736 | thing. it is recommended that if you add any "custom" property whose | ||
737 | name may clash with standard defined ones, you prefix them with your | ||
738 | vendor name and a comma. | ||
739 | |||
740 | b) The /cpus node | ||
741 | |||
742 | This node is the parent of all individual CPU nodes. It doesn't | ||
743 | have any specific requirements, though it's generally good practice | ||
744 | to have at least: | ||
745 | |||
746 | #address-cells = <00000001> | ||
747 | #size-cells = <00000000> | ||
748 | |||
749 | This defines that the "address" for a CPU is a single cell, and has | ||
750 | no meaningful size. This is not necessary but the kernel will assume | ||
751 | that format when reading the "reg" properties of a CPU node, see | ||
752 | below | ||
753 | |||
754 | c) The /cpus/* nodes | ||
755 | |||
756 | So under /cpus, you are supposed to create a node for every CPU on | ||
757 | the machine. There is no specific restriction on the name of the | ||
758 | CPU, though It's common practice to call it PowerPC,<name>. For | ||
759 | example, Apple uses PowerPC,G5 while IBM uses PowerPC,970FX. | ||
760 | |||
761 | Required properties: | ||
762 | |||
763 | - device_type : has to be "cpu" | ||
764 | - reg : This is the physical cpu number, it's a single 32 bit cell | ||
765 | and is also used as-is as the unit number for constructing the | ||
766 | unit name in the full path. For example, with 2 CPUs, you would | ||
767 | have the full path: | ||
768 | /cpus/PowerPC,970FX@0 | ||
769 | /cpus/PowerPC,970FX@1 | ||
770 | (unit addresses do not require leading zeroes) | ||
771 | - d-cache-line-size : one cell, L1 data cache line size in bytes | ||
772 | - i-cache-line-size : one cell, L1 instruction cache line size in | ||
773 | bytes | ||
774 | - d-cache-size : one cell, size of L1 data cache in bytes | ||
775 | - i-cache-size : one cell, size of L1 instruction cache in bytes | ||
776 | - linux, boot-cpu : Should be defined if this cpu is the boot cpu. | ||
777 | |||
778 | Recommended properties: | ||
779 | |||
780 | - timebase-frequency : a cell indicating the frequency of the | ||
781 | timebase in Hz. This is not directly used by the generic code, | ||
782 | but you are welcome to copy/paste the pSeries code for setting | ||
783 | the kernel timebase/decrementer calibration based on this | ||
784 | value. | ||
785 | - clock-frequency : a cell indicating the CPU core clock frequency | ||
786 | in Hz. A new property will be defined for 64 bit values, but if | ||
787 | your frequency is < 4Ghz, one cell is enough. Here as well as | ||
788 | for the above, the common code doesn't use that property, but | ||
789 | you are welcome to re-use the pSeries or Maple one. A future | ||
790 | kernel version might provide a common function for this. | ||
791 | |||
792 | You are welcome to add any property you find relevant to your board, | ||
793 | like some information about the mechanism used to soft-reset the | ||
794 | CPUs. For example, Apple puts the GPIO number for CPU soft reset | ||
795 | lines in there as a "soft-reset" property since they start secondary | ||
796 | CPUs by soft-resetting them. | ||
797 | |||
798 | |||
799 | d) the /memory node(s) | ||
800 | |||
801 | To define the physical memory layout of your board, you should | ||
802 | create one or more memory node(s). You can either create a single | ||
803 | node with all memory ranges in its reg property, or you can create | ||
804 | several nodes, as you wish. The unit address (@ part) used for the | ||
805 | full path is the address of the first range of memory defined by a | ||
806 | given node. If you use a single memory node, this will typically be | ||
807 | @0. | ||
808 | |||
809 | Required properties: | ||
810 | |||
811 | - device_type : has to be "memory" | ||
812 | - reg : This property contains all the physical memory ranges of | ||
813 | your board. It's a list of addresses/sizes concatenated | ||
814 | together, with the number of cells of each defined by the | ||
815 | #address-cells and #size-cells of the root node. For example, | ||
816 | with both of these properties beeing 2 like in the example given | ||
817 | earlier, a 970 based machine with 6Gb of RAM could typically | ||
818 | have a "reg" property here that looks like: | ||
819 | |||
820 | 00000000 00000000 00000000 80000000 | ||
821 | 00000001 00000000 00000001 00000000 | ||
822 | |||
823 | That is a range starting at 0 of 0x80000000 bytes and a range | ||
824 | starting at 0x100000000 and of 0x100000000 bytes. You can see | ||
825 | that there is no memory covering the IO hole between 2Gb and | ||
826 | 4Gb. Some vendors prefer splitting those ranges into smaller | ||
827 | segments, but the kernel doesn't care. | ||
828 | |||
829 | e) The /chosen node | ||
830 | |||
831 | This node is a bit "special". Normally, that's where open firmware | ||
832 | puts some variable environment information, like the arguments, or | ||
833 | phandle pointers to nodes like the main interrupt controller, or the | ||
834 | default input/output devices. | ||
835 | |||
836 | This specification makes a few of these mandatory, but also defines | ||
837 | some linux-specific properties that would be normally constructed by | ||
838 | the prom_init() trampoline when booting with an OF client interface, | ||
839 | but that you have to provide yourself when using the flattened format. | ||
840 | |||
841 | Required properties: | ||
842 | |||
843 | - linux,platform : This is your platform number as assigned by the | ||
844 | architecture maintainers | ||
845 | |||
846 | Recommended properties: | ||
847 | |||
848 | - bootargs : This zero-terminated string is passed as the kernel | ||
849 | command line | ||
850 | - linux,stdout-path : This is the full path to your standard | ||
851 | console device if any. Typically, if you have serial devices on | ||
852 | your board, you may want to put the full path to the one set as | ||
853 | the default console in the firmware here, for the kernel to pick | ||
854 | it up as it's own default console. If you look at the funciton | ||
855 | set_preferred_console() in arch/ppc64/kernel/setup.c, you'll see | ||
856 | that the kernel tries to find out the default console and has | ||
857 | knowledge of various types like 8250 serial ports. You may want | ||
858 | to extend this function to add your own. | ||
859 | - interrupt-controller : This is one cell containing a phandle | ||
860 | value that matches the "linux,phandle" property of your main | ||
861 | interrupt controller node. May be used for interrupt routing. | ||
862 | |||
863 | |||
864 | Note that u-boot creates and fills in the chosen node for platforms | ||
865 | that use it. | ||
866 | |||
867 | f) the /soc<SOCname> node | ||
868 | |||
869 | This node is used to represent a system-on-a-chip (SOC) and must be | ||
870 | present if the processor is a SOC. The top-level soc node contains | ||
871 | information that is global to all devices on the SOC. The node name | ||
872 | should contain a unit address for the SOC, which is the base address | ||
873 | of the memory-mapped register set for the SOC. The name of an soc | ||
874 | node should start with "soc", and the remainder of the name should | ||
875 | represent the part number for the soc. For example, the MPC8540's | ||
876 | soc node would be called "soc8540". | ||
877 | |||
878 | Required properties: | ||
879 | |||
880 | - device_type : Should be "soc" | ||
881 | - ranges : Should be defined as specified in 1) to describe the | ||
882 | translation of SOC addresses for memory mapped SOC registers. | ||
883 | |||
884 | Recommended properties: | ||
885 | |||
886 | - reg : This property defines the address and size of the | ||
887 | memory-mapped registers that are used for the SOC node itself. | ||
888 | It does not include the child device registers - these will be | ||
889 | defined inside each child node. The address specified in the | ||
890 | "reg" property should match the unit address of the SOC node. | ||
891 | - #address-cells : Address representation for "soc" devices. The | ||
892 | format of this field may vary depending on whether or not the | ||
893 | device registers are memory mapped. For memory mapped | ||
894 | registers, this field represents the number of cells needed to | ||
895 | represent the address of the registers. For SOCs that do not | ||
896 | use MMIO, a special address format should be defined that | ||
897 | contains enough cells to represent the required information. | ||
898 | See 1) above for more details on defining #address-cells. | ||
899 | - #size-cells : Size representation for "soc" devices | ||
900 | - #interrupt-cells : Defines the width of cells used to represent | ||
901 | interrupts. Typically this value is <2>, which includes a | ||
902 | 32-bit number that represents the interrupt number, and a | ||
903 | 32-bit number that represents the interrupt sense and level. | ||
904 | This field is only needed if the SOC contains an interrupt | ||
905 | controller. | ||
906 | |||
907 | The SOC node may contain child nodes for each SOC device that the | ||
908 | platform uses. Nodes should not be created for devices which exist | ||
909 | on the SOC but are not used by a particular platform. See chapter VI | ||
910 | for more information on how to specify devices that are part of an | ||
911 | SOC. | ||
912 | |||
913 | Example SOC node for the MPC8540: | ||
914 | |||
915 | soc8540@e0000000 { | ||
916 | #address-cells = <1>; | ||
917 | #size-cells = <1>; | ||
918 | #interrupt-cells = <2>; | ||
919 | device_type = "soc"; | ||
920 | ranges = <00000000 e0000000 00100000> | ||
921 | reg = <e0000000 00003000>; | ||
922 | } | ||
923 | |||
924 | |||
925 | |||
926 | IV - "dtc", the device tree compiler | ||
927 | ==================================== | ||
928 | |||
929 | |||
930 | dtc source code can be found at | ||
931 | <http://ozlabs.org/~dgibson/dtc/dtc.tar.gz> | ||
932 | |||
933 | WARNING: This version is still in early development stage; the | ||
934 | resulting device-tree "blobs" have not yet been validated with the | ||
935 | kernel. The current generated bloc lacks a useful reserve map (it will | ||
936 | be fixed to generate an empty one, it's up to the bootloader to fill | ||
937 | it up) among others. The error handling needs work, bugs are lurking, | ||
938 | etc... | ||
939 | |||
940 | dtc basically takes a device-tree in a given format and outputs a | ||
941 | device-tree in another format. The currently supported formats are: | ||
942 | |||
943 | Input formats: | ||
944 | ------------- | ||
945 | |||
946 | - "dtb": "blob" format, that is a flattened device-tree block | ||
947 | with | ||
948 | header all in a binary blob. | ||
949 | - "dts": "source" format. This is a text file containing a | ||
950 | "source" for a device-tree. The format is defined later in this | ||
951 | chapter. | ||
952 | - "fs" format. This is a representation equivalent to the | ||
953 | output of /proc/device-tree, that is nodes are directories and | ||
954 | properties are files | ||
955 | |||
956 | Output formats: | ||
957 | --------------- | ||
958 | |||
959 | - "dtb": "blob" format | ||
960 | - "dts": "source" format | ||
961 | - "asm": assembly language file. This is a file that can be | ||
962 | sourced by gas to generate a device-tree "blob". That file can | ||
963 | then simply be added to your Makefile. Additionally, the | ||
964 | assembly file exports some symbols that can be use | ||
965 | |||
966 | |||
967 | The syntax of the dtc tool is | ||
968 | |||
969 | dtc [-I <input-format>] [-O <output-format>] | ||
970 | [-o output-filename] [-V output_version] input_filename | ||
971 | |||
972 | |||
973 | The "output_version" defines what versio of the "blob" format will be | ||
974 | generated. Supported versions are 1,2,3 and 16. The default is | ||
975 | currently version 3 but that may change in the future to version 16. | ||
976 | |||
977 | Additionally, dtc performs various sanity checks on the tree, like the | ||
978 | uniqueness of linux,phandle properties, validity of strings, etc... | ||
979 | |||
980 | The format of the .dts "source" file is "C" like, supports C and C++ | ||
981 | style commments. | ||
982 | |||
983 | / { | ||
984 | } | ||
985 | |||
986 | The above is the "device-tree" definition. It's the only statement | ||
987 | supported currently at the toplevel. | ||
988 | |||
989 | / { | ||
990 | property1 = "string_value"; /* define a property containing a 0 | ||
991 | * terminated string | ||
992 | */ | ||
993 | |||
994 | property2 = <1234abcd>; /* define a property containing a | ||
995 | * numerical 32 bits value (hexadecimal) | ||
996 | */ | ||
997 | |||
998 | property3 = <12345678 12345678 deadbeef>; | ||
999 | /* define a property containing 3 | ||
1000 | * numerical 32 bits values (cells) in | ||
1001 | * hexadecimal | ||
1002 | */ | ||
1003 | property4 = [0a 0b 0c 0d de ea ad be ef]; | ||
1004 | /* define a property whose content is | ||
1005 | * an arbitrary array of bytes | ||
1006 | */ | ||
1007 | |||
1008 | childnode@addresss { /* define a child node named "childnode" | ||
1009 | * whose unit name is "childnode at | ||
1010 | * address" | ||
1011 | */ | ||
1012 | |||
1013 | childprop = "hello\n"; /* define a property "childprop" of | ||
1014 | * childnode (in this case, a string) | ||
1015 | */ | ||
1016 | }; | ||
1017 | }; | ||
1018 | |||
1019 | Nodes can contain other nodes etc... thus defining the hierarchical | ||
1020 | structure of the tree. | ||
1021 | |||
1022 | Strings support common escape sequences from C: "\n", "\t", "\r", | ||
1023 | "\(octal value)", "\x(hex value)". | ||
1024 | |||
1025 | It is also suggested that you pipe your source file through cpp (gcc | ||
1026 | preprocessor) so you can use #include's, #define for constants, etc... | ||
1027 | |||
1028 | Finally, various options are planned but not yet implemented, like | ||
1029 | automatic generation of phandles, labels (exported to the asm file so | ||
1030 | you can point to a property content and change it easily from whatever | ||
1031 | you link the device-tree with), label or path instead of numeric value | ||
1032 | in some cells to "point" to a node (replaced by a phandle at compile | ||
1033 | time), export of reserve map address to the asm file, ability to | ||
1034 | specify reserve map content at compile time, etc... | ||
1035 | |||
1036 | We may provide a .h include file with common definitions of that | ||
1037 | proves useful for some properties (like building PCI properties or | ||
1038 | interrupt maps) though it may be better to add a notion of struct | ||
1039 | definitions to the compiler... | ||
1040 | |||
1041 | |||
1042 | V - Recommendations for a bootloader | ||
1043 | ==================================== | ||
1044 | |||
1045 | |||
1046 | Here are some various ideas/recommendations that have been proposed | ||
1047 | while all this has been defined and implemented. | ||
1048 | |||
1049 | - The bootloader may want to be able to use the device-tree itself | ||
1050 | and may want to manipulate it (to add/edit some properties, | ||
1051 | like physical memory size or kernel arguments). At this point, 2 | ||
1052 | choices can be made. Either the bootloader works directly on the | ||
1053 | flattened format, or the bootloader has its own internal tree | ||
1054 | representation with pointers (similar to the kernel one) and | ||
1055 | re-flattens the tree when booting the kernel. The former is a bit | ||
1056 | more difficult to edit/modify, the later requires probably a bit | ||
1057 | more code to handle the tree structure. Note that the structure | ||
1058 | format has been designed so it's relatively easy to "insert" | ||
1059 | properties or nodes or delete them by just memmoving things | ||
1060 | around. It contains no internal offsets or pointers for this | ||
1061 | purpose. | ||
1062 | |||
1063 | - An example of code for iterating nodes & retreiving properties | ||
1064 | directly from the flattened tree format can be found in the kernel | ||
1065 | file arch/ppc64/kernel/prom.c, look at scan_flat_dt() function, | ||
1066 | it's usage in early_init_devtree(), and the corresponding various | ||
1067 | early_init_dt_scan_*() callbacks. That code can be re-used in a | ||
1068 | GPL bootloader, and as the author of that code, I would be happy | ||
1069 | do discuss possible free licencing to any vendor who wishes to | ||
1070 | integrate all or part of this code into a non-GPL bootloader. | ||
1071 | |||
1072 | |||
1073 | |||
1074 | VI - System-on-a-chip devices and nodes | ||
1075 | ======================================= | ||
1076 | |||
1077 | Many companies are now starting to develop system-on-a-chip | ||
1078 | processors, where the processor core (cpu) and many peripheral devices | ||
1079 | exist on a single piece of silicon. For these SOCs, an SOC node | ||
1080 | should be used that defines child nodes for the devices that make | ||
1081 | up the SOC. While platforms are not required to use this model in | ||
1082 | order to boot the kernel, it is highly encouraged that all SOC | ||
1083 | implementations define as complete a flat-device-tree as possible to | ||
1084 | describe the devices on the SOC. This will allow for the | ||
1085 | genericization of much of the kernel code. | ||
1086 | |||
1087 | |||
1088 | 1) Defining child nodes of an SOC | ||
1089 | --------------------------------- | ||
1090 | |||
1091 | Each device that is part of an SOC may have its own node entry inside | ||
1092 | the SOC node. For each device that is included in the SOC, the unit | ||
1093 | address property represents the address offset for this device's | ||
1094 | memory-mapped registers in the parent's address space. The parent's | ||
1095 | address space is defined by the "ranges" property in the top-level soc | ||
1096 | node. The "reg" property for each node that exists directly under the | ||
1097 | SOC node should contain the address mapping from the child address space | ||
1098 | to the parent SOC address space and the size of the device's | ||
1099 | memory-mapped register file. | ||
1100 | |||
1101 | For many devices that may exist inside an SOC, there are predefined | ||
1102 | specifications for the format of the device tree node. All SOC child | ||
1103 | nodes should follow these specifications, except where noted in this | ||
1104 | document. | ||
1105 | |||
1106 | See appendix A for an example partial SOC node definition for the | ||
1107 | MPC8540. | ||
1108 | |||
1109 | |||
1110 | 2) Specifying interrupt information for SOC devices | ||
1111 | --------------------------------------------------- | ||
1112 | |||
1113 | Each device that is part of an SOC and which generates interrupts | ||
1114 | should have the following properties: | ||
1115 | |||
1116 | - interrupt-parent : contains the phandle of the interrupt | ||
1117 | controller which handles interrupts for this device | ||
1118 | - interrupts : a list of tuples representing the interrupt | ||
1119 | number and the interrupt sense and level for each interupt | ||
1120 | for this device. | ||
1121 | |||
1122 | This information is used by the kernel to build the interrupt table | ||
1123 | for the interrupt controllers in the system. | ||
1124 | |||
1125 | Sense and level information should be encoded as follows: | ||
1126 | |||
1127 | Devices connected to openPIC-compatible controllers should encode | ||
1128 | sense and polarity as follows: | ||
1129 | |||
1130 | 0 = high to low edge sensitive type enabled | ||
1131 | 1 = active low level sensitive type enabled | ||
1132 | 2 = low to high edge sensitive type enabled | ||
1133 | 3 = active high level sensitive type enabled | ||
1134 | |||
1135 | ISA PIC interrupt controllers should adhere to the ISA PIC | ||
1136 | encodings listed below: | ||
1137 | |||
1138 | 0 = active low level sensitive type enabled | ||
1139 | 1 = active high level sensitive type enabled | ||
1140 | 2 = high to low edge sensitive type enabled | ||
1141 | 3 = low to high edge sensitive type enabled | ||
1142 | |||
1143 | |||
1144 | |||
1145 | 3) Representing devices without a current OF specification | ||
1146 | ---------------------------------------------------------- | ||
1147 | |||
1148 | Currently, there are many devices on SOCs that do not have a standard | ||
1149 | representation pre-defined as part of the open firmware | ||
1150 | specifications, mainly because the boards that contain these SOCs are | ||
1151 | not currently booted using open firmware. This section contains | ||
1152 | descriptions for the SOC devices for which new nodes have been | ||
1153 | defined; this list will expand as more and more SOC-containing | ||
1154 | platforms are moved over to use the flattened-device-tree model. | ||
1155 | |||
1156 | a) MDIO IO device | ||
1157 | |||
1158 | The MDIO is a bus to which the PHY devices are connected. For each | ||
1159 | device that exists on this bus, a child node should be created. See | ||
1160 | the definition of the PHY node below for an example of how to define | ||
1161 | a PHY. | ||
1162 | |||
1163 | Required properties: | ||
1164 | - reg : Offset and length of the register set for the device | ||
1165 | - device_type : Should be "mdio" | ||
1166 | - compatible : Should define the compatible device type for the | ||
1167 | mdio. Currently, this is most likely to be "gianfar" | ||
1168 | |||
1169 | Example: | ||
1170 | |||
1171 | mdio@24520 { | ||
1172 | reg = <24520 20>; | ||
1173 | |||
1174 | ethernet-phy@0 { | ||
1175 | ...... | ||
1176 | }; | ||
1177 | }; | ||
1178 | |||
1179 | |||
1180 | b) Gianfar-compatible ethernet nodes | ||
1181 | |||
1182 | Required properties: | ||
1183 | |||
1184 | - device_type : Should be "network" | ||
1185 | - model : Model of the device. Can be "TSEC", "eTSEC", or "FEC" | ||
1186 | - compatible : Should be "gianfar" | ||
1187 | - reg : Offset and length of the register set for the device | ||
1188 | - address : List of bytes representing the ethernet address of | ||
1189 | this controller | ||
1190 | - interrupts : <a b> where a is the interrupt number and b is a | ||
1191 | field that represents an encoding of the sense and level | ||
1192 | information for the interrupt. This should be encoded based on | ||
1193 | the information in section 2) depending on the type of interrupt | ||
1194 | controller you have. | ||
1195 | - interrupt-parent : the phandle for the interrupt controller that | ||
1196 | services interrupts for this device. | ||
1197 | - phy-handle : The phandle for the PHY connected to this ethernet | ||
1198 | controller. | ||
1199 | |||
1200 | Example: | ||
1201 | |||
1202 | ethernet@24000 { | ||
1203 | #size-cells = <0>; | ||
1204 | device_type = "network"; | ||
1205 | model = "TSEC"; | ||
1206 | compatible = "gianfar"; | ||
1207 | reg = <24000 1000>; | ||
1208 | address = [ 00 E0 0C 00 73 00 ]; | ||
1209 | interrupts = <d 3 e 3 12 3>; | ||
1210 | interrupt-parent = <40000>; | ||
1211 | phy-handle = <2452000> | ||
1212 | }; | ||
1213 | |||
1214 | |||
1215 | |||
1216 | c) PHY nodes | ||
1217 | |||
1218 | Required properties: | ||
1219 | |||
1220 | - device_type : Should be "ethernet-phy" | ||
1221 | - interrupts : <a b> where a is the interrupt number and b is a | ||
1222 | field that represents an encoding of the sense and level | ||
1223 | information for the interrupt. This should be encoded based on | ||
1224 | the information in section 2) depending on the type of interrupt | ||
1225 | controller you have. | ||
1226 | - interrupt-parent : the phandle for the interrupt controller that | ||
1227 | services interrupts for this device. | ||
1228 | - reg : The ID number for the phy, usually a small integer | ||
1229 | - linux,phandle : phandle for this node; likely referenced by an | ||
1230 | ethernet controller node. | ||
1231 | |||
1232 | |||
1233 | Example: | ||
1234 | |||
1235 | ethernet-phy@0 { | ||
1236 | linux,phandle = <2452000> | ||
1237 | interrupt-parent = <40000>; | ||
1238 | interrupts = <35 1>; | ||
1239 | reg = <0>; | ||
1240 | device_type = "ethernet-phy"; | ||
1241 | }; | ||
1242 | |||
1243 | |||
1244 | d) Interrupt controllers | ||
1245 | |||
1246 | Some SOC devices contain interrupt controllers that are different | ||
1247 | from the standard Open PIC specification. The SOC device nodes for | ||
1248 | these types of controllers should be specified just like a standard | ||
1249 | OpenPIC controller. Sense and level information should be encoded | ||
1250 | as specified in section 2) of this chapter for each device that | ||
1251 | specifies an interrupt. | ||
1252 | |||
1253 | Example : | ||
1254 | |||
1255 | pic@40000 { | ||
1256 | linux,phandle = <40000>; | ||
1257 | clock-frequency = <0>; | ||
1258 | interrupt-controller; | ||
1259 | #address-cells = <0>; | ||
1260 | reg = <40000 40000>; | ||
1261 | built-in; | ||
1262 | compatible = "chrp,open-pic"; | ||
1263 | device_type = "open-pic"; | ||
1264 | big-endian; | ||
1265 | }; | ||
1266 | |||
1267 | |||
1268 | e) I2C | ||
1269 | |||
1270 | Required properties : | ||
1271 | |||
1272 | - device_type : Should be "i2c" | ||
1273 | - reg : Offset and length of the register set for the device | ||
1274 | |||
1275 | Recommended properties : | ||
1276 | |||
1277 | - compatible : Should be "fsl-i2c" for parts compatible with | ||
1278 | Freescale I2C specifications. | ||
1279 | - interrupts : <a b> where a is the interrupt number and b is a | ||
1280 | field that represents an encoding of the sense and level | ||
1281 | information for the interrupt. This should be encoded based on | ||
1282 | the information in section 2) depending on the type of interrupt | ||
1283 | controller you have. | ||
1284 | - interrupt-parent : the phandle for the interrupt controller that | ||
1285 | services interrupts for this device. | ||
1286 | - dfsrr : boolean; if defined, indicates that this I2C device has | ||
1287 | a digital filter sampling rate register | ||
1288 | - fsl5200-clocking : boolean; if defined, indicated that this device | ||
1289 | uses the FSL 5200 clocking mechanism. | ||
1290 | |||
1291 | Example : | ||
1292 | |||
1293 | i2c@3000 { | ||
1294 | interrupt-parent = <40000>; | ||
1295 | interrupts = <1b 3>; | ||
1296 | reg = <3000 18>; | ||
1297 | device_type = "i2c"; | ||
1298 | compatible = "fsl-i2c"; | ||
1299 | dfsrr; | ||
1300 | }; | ||
1301 | |||
1302 | |||
1303 | More devices will be defined as this spec matures. | ||
1304 | |||
1305 | |||
1306 | Appendix A - Sample SOC node for MPC8540 | ||
1307 | ======================================== | ||
1308 | |||
1309 | Note that the #address-cells and #size-cells for the SoC node | ||
1310 | in this example have been explicitly listed; these are likely | ||
1311 | not necessary as they are usually the same as the root node. | ||
1312 | |||
1313 | soc8540@e0000000 { | ||
1314 | #address-cells = <1>; | ||
1315 | #size-cells = <1>; | ||
1316 | #interrupt-cells = <2>; | ||
1317 | device_type = "soc"; | ||
1318 | ranges = <00000000 e0000000 00100000> | ||
1319 | reg = <e0000000 00003000>; | ||
1320 | |||
1321 | mdio@24520 { | ||
1322 | reg = <24520 20>; | ||
1323 | device_type = "mdio"; | ||
1324 | compatible = "gianfar"; | ||
1325 | |||
1326 | ethernet-phy@0 { | ||
1327 | linux,phandle = <2452000> | ||
1328 | interrupt-parent = <40000>; | ||
1329 | interrupts = <35 1>; | ||
1330 | reg = <0>; | ||
1331 | device_type = "ethernet-phy"; | ||
1332 | }; | ||
1333 | |||
1334 | ethernet-phy@1 { | ||
1335 | linux,phandle = <2452001> | ||
1336 | interrupt-parent = <40000>; | ||
1337 | interrupts = <35 1>; | ||
1338 | reg = <1>; | ||
1339 | device_type = "ethernet-phy"; | ||
1340 | }; | ||
1341 | |||
1342 | ethernet-phy@3 { | ||
1343 | linux,phandle = <2452002> | ||
1344 | interrupt-parent = <40000>; | ||
1345 | interrupts = <35 1>; | ||
1346 | reg = <3>; | ||
1347 | device_type = "ethernet-phy"; | ||
1348 | }; | ||
1349 | |||
1350 | }; | ||
1351 | |||
1352 | ethernet@24000 { | ||
1353 | #size-cells = <0>; | ||
1354 | device_type = "network"; | ||
1355 | model = "TSEC"; | ||
1356 | compatible = "gianfar"; | ||
1357 | reg = <24000 1000>; | ||
1358 | address = [ 00 E0 0C 00 73 00 ]; | ||
1359 | interrupts = <d 3 e 3 12 3>; | ||
1360 | interrupt-parent = <40000>; | ||
1361 | phy-handle = <2452000>; | ||
1362 | }; | ||
1363 | |||
1364 | ethernet@25000 { | ||
1365 | #address-cells = <1>; | ||
1366 | #size-cells = <0>; | ||
1367 | device_type = "network"; | ||
1368 | model = "TSEC"; | ||
1369 | compatible = "gianfar"; | ||
1370 | reg = <25000 1000>; | ||
1371 | address = [ 00 E0 0C 00 73 01 ]; | ||
1372 | interrupts = <13 3 14 3 18 3>; | ||
1373 | interrupt-parent = <40000>; | ||
1374 | phy-handle = <2452001>; | ||
1375 | }; | ||
1376 | |||
1377 | ethernet@26000 { | ||
1378 | #address-cells = <1>; | ||
1379 | #size-cells = <0>; | ||
1380 | device_type = "network"; | ||
1381 | model = "FEC"; | ||
1382 | compatible = "gianfar"; | ||
1383 | reg = <26000 1000>; | ||
1384 | address = [ 00 E0 0C 00 73 02 ]; | ||
1385 | interrupts = <19 3>; | ||
1386 | interrupt-parent = <40000>; | ||
1387 | phy-handle = <2452002>; | ||
1388 | }; | ||
1389 | |||
1390 | serial@4500 { | ||
1391 | device_type = "serial"; | ||
1392 | compatible = "ns16550"; | ||
1393 | reg = <4500 100>; | ||
1394 | clock-frequency = <0>; | ||
1395 | interrupts = <1a 3>; | ||
1396 | interrupt-parent = <40000>; | ||
1397 | }; | ||
1398 | |||
1399 | pic@40000 { | ||
1400 | linux,phandle = <40000>; | ||
1401 | clock-frequency = <0>; | ||
1402 | interrupt-controller; | ||
1403 | #address-cells = <0>; | ||
1404 | reg = <40000 40000>; | ||
1405 | built-in; | ||
1406 | compatible = "chrp,open-pic"; | ||
1407 | device_type = "open-pic"; | ||
1408 | big-endian; | ||
1409 | }; | ||
1410 | |||
1411 | i2c@3000 { | ||
1412 | interrupt-parent = <40000>; | ||
1413 | interrupts = <1b 3>; | ||
1414 | reg = <3000 18>; | ||
1415 | device_type = "i2c"; | ||
1416 | compatible = "fsl-i2c"; | ||
1417 | dfsrr; | ||
1418 | }; | ||
1419 | |||
1420 | }; | ||
diff --git a/Documentation/scsi/ChangeLog.megaraid_sas b/Documentation/scsi/ChangeLog.megaraid_sas new file mode 100644 index 000000000000..f8c16cbf56ba --- /dev/null +++ b/Documentation/scsi/ChangeLog.megaraid_sas | |||
@@ -0,0 +1,24 @@ | |||
1 | 1 Release Date : Mon Jan 23 14:09:01 PST 2006 - Sumant Patro <Sumant.Patro@lsil.com> | ||
2 | 2 Current Version : 00.00.02.02 | ||
3 | 3 Older Version : 00.00.02.01 | ||
4 | |||
5 | i. New template defined to represent each family of controllers (identified by processor used). | ||
6 | The template will have defintions that will be initialised to appropritae values for a specific family of controllers. The template definition has four function pointers. During driver initialisation the function pointers will be set based on the controller family type. This change is done to support new controllers that has different processors and thus different register set. | ||
7 | |||
8 | -Sumant Patro <Sumant.Patro@lsil.com> | ||
9 | |||
10 | 1 Release Date : Mon Dec 19 14:36:26 PST 2005 - Sumant Patro <Sumant.Patro@lsil.com> | ||
11 | 2 Current Version : 00.00.02.00-rc4 | ||
12 | 3 Older Version : 00.00.02.01 | ||
13 | |||
14 | i. Code reorganized to remove code duplication in megasas_build_cmd. | ||
15 | |||
16 | "There's a lot of duplicate code megasas_build_cmd. Move that out of the different codepathes and merge the reminder of megasas_build_cmd into megasas_queue_command" | ||
17 | |||
18 | - Christoph Hellwig <hch@lst.de> | ||
19 | |||
20 | ii. Defined MEGASAS_IOC_FIRMWARE32 for code paths that handles 32 bit applications in 64 bit systems. | ||
21 | |||
22 | "MEGASAS_IOC_FIRMWARE can't be redefined if CONFIG_COMPAT is set, we need to define a MEGASAS_IOC_FIRMWARE32 define so native binaries continue to work" | ||
23 | |||
24 | - Christoph Hellwig <hch@lst.de> | ||
diff --git a/Documentation/scsi/aic79xx.txt b/Documentation/scsi/aic79xx.txt index 0aeef740a95a..382b439b439e 100644 --- a/Documentation/scsi/aic79xx.txt +++ b/Documentation/scsi/aic79xx.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | ==================================================================== | 1 | ==================================================================== |
2 | = Adaptec Ultra320 Family Manager Set v1.3.11 = | 2 | = Adaptec Ultra320 Family Manager Set = |
3 | = = | 3 | = = |
4 | = README for = | 4 | = README for = |
5 | = The Linux Operating System = | 5 | = The Linux Operating System = |
@@ -63,6 +63,11 @@ The following information is available in this file: | |||
63 | 68-pin) | 63 | 68-pin) |
64 | 2. Version History | 64 | 2. Version History |
65 | 65 | ||
66 | 3.0 (December 1st, 2005) | ||
67 | - Updated driver to use SCSI transport class infrastructure | ||
68 | - Upported sequencer and core fixes from adaptec released | ||
69 | version 2.0.15 of the driver. | ||
70 | |||
66 | 1.3.11 (July 11, 2003) | 71 | 1.3.11 (July 11, 2003) |
67 | - Fix several deadlock issues. | 72 | - Fix several deadlock issues. |
68 | - Add 29320ALP and 39320B Id's. | 73 | - Add 29320ALP and 39320B Id's. |
@@ -194,7 +199,7 @@ The following information is available in this file: | |||
194 | supported) | 199 | supported) |
195 | - Support for the PCI-X standard up to 133MHz | 200 | - Support for the PCI-X standard up to 133MHz |
196 | - Support for the PCI v2.2 standard | 201 | - Support for the PCI v2.2 standard |
197 | - Domain Validation | 202 | - Domain Validation |
198 | 203 | ||
199 | 2.2. Operating System Support: | 204 | 2.2. Operating System Support: |
200 | - Redhat Linux 7.2, 7.3, 8.0, Advanced Server 2.1 | 205 | - Redhat Linux 7.2, 7.3, 8.0, Advanced Server 2.1 |
@@ -411,77 +416,53 @@ The following information is available in this file: | |||
411 | http://www.adaptec.com. | 416 | http://www.adaptec.com. |
412 | 417 | ||
413 | 418 | ||
414 | 5. Contacting Adaptec | 419 | 5. Adaptec Customer Support |
415 | 420 | ||
416 | A Technical Support Identification (TSID) Number is required for | 421 | A Technical Support Identification (TSID) Number is required for |
417 | Adaptec technical support. | 422 | Adaptec technical support. |
418 | - The 12-digit TSID can be found on the white barcode-type label | 423 | - The 12-digit TSID can be found on the white barcode-type label |
419 | included inside the box with your product. The TSID helps us | 424 | included inside the box with your product. The TSID helps us |
420 | provide more efficient service by accurately identifying your | 425 | provide more efficient service by accurately identifying your |
421 | product and support status. | 426 | product and support status. |
427 | |||
422 | Support Options | 428 | Support Options |
423 | - Search the Adaptec Support Knowledgebase (ASK) at | 429 | - Search the Adaptec Support Knowledgebase (ASK) at |
424 | http://ask.adaptec.com for articles, troubleshooting tips, and | 430 | http://ask.adaptec.com for articles, troubleshooting tips, and |
425 | frequently asked questions for your product. | 431 | frequently asked questions about your product. |
426 | - For support via Email, submit your question to Adaptec's | 432 | - For support via Email, submit your question to Adaptec's |
427 | Technical Support Specialists at http://ask.adaptec.com. | 433 | Technical Support Specialists at http://ask.adaptec.com/. |
428 | 434 | ||
429 | North America | 435 | North America |
430 | - Visit our Web site at http://www.adaptec.com. | 436 | - Visit our Web site at http://www.adaptec.com/. |
431 | - To speak with a Fibre Channel/RAID/External Storage Technical | 437 | - For information about Adaptec's support options, call |
432 | Support Specialist, call 1-321-207-2000, | 438 | 408-957-2550, 24 hours a day, 7 days a week. |
433 | Hours: Monday-Friday, 3:00 A.M. to 5:00 P.M., PST. | 439 | - To speak with a Technical Support Specialist, |
434 | (Not open on holidays) | 440 | * For hardware products, call 408-934-7274, |
435 | - For Technical Support in all other technologies including | 441 | Monday to Friday, 3:00 am to 5:00 pm, PDT. |
436 | SCSI, call 1-408-934-7274, | 442 | * For RAID and Fibre Channel products, call 321-207-2000, |
437 | Hours: Monday-Friday, 6:00 A.M. to 5:00 P.M., PST. | 443 | Monday to Friday, 3:00 am to 5:00 pm, PDT. |
438 | (Not open on holidays) | 444 | To expedite your service, have your computer with you. |
439 | - For after hours support, call 1-800-416-8066 ($99/call, | 445 | - To order Adaptec products, including accessories and cables, |
440 | $149/call on holidays) | 446 | call 408-957-7274. To order cables online go to |
441 | - To order Adaptec products including software and cables, call | 447 | http://www.adaptec.com/buy-cables/. |
442 | 1-800-442-7274 or 1-408-957-7274. You can also visit our | ||
443 | online store at http://www.adaptecstore.com | ||
444 | 448 | ||
445 | Europe | 449 | Europe |
446 | - Visit our Web site at http://www.adaptec-europe.com. | 450 | - Visit our Web site at http://www.adaptec-europe.com/. |
447 | - English and French: To speak with a Technical Support | 451 | - To speak with a Technical Support Specialist, call, or email, |
448 | Specialist, call one of the following numbers: | 452 | * German: +49 89 4366 5522, Monday-Friday, 9:00-17:00 CET, |
449 | - English: +32-2-352-3470 | 453 | http://ask-de.adaptec.com/. |
450 | - French: +32-2-352-3460 | 454 | * French: +49 89 4366 5533, Monday-Friday, 9:00-17:00 CET, |
451 | Hours: Monday-Thursday, 10:00 to 12:30, 13:30 to 17:30 CET | 455 | http://ask-fr.adaptec.com/. |
452 | Friday, 10:00 to 12:30, 13:30 to 16:30 CET | 456 | * English: +49 89 4366 5544, Monday-Friday, 9:00-17:00 GMT, |
453 | - German: To speak with a Technical Support Specialist, | 457 | http://ask.adaptec.com/. |
454 | call +49-89-456-40660 | 458 | - You can order Adaptec cables online at |
455 | Hours: Monday-Thursday, 09:30 to 12:30, 13:30 to 16:30 CET | 459 | http://www.adaptec.com/buy-cables/. |
456 | Friday, 09:30 to 12:30, 13:30 to 15:00 CET | ||
457 | - To order Adaptec products, including accessories and cables: | ||
458 | - UK: +0800-96-65-26 or fax +0800-731-02-95 | ||
459 | - Other European countries: +32-11-300-379 | ||
460 | |||
461 | Australia and New Zealand | ||
462 | - Visit our Web site at http://www.adaptec.com.au. | ||
463 | - To speak with a Technical Support Specialist, call | ||
464 | +612-9416-0698 | ||
465 | Hours: Monday-Friday, 10:00 A.M. to 4:30 P.M., EAT | ||
466 | (Not open on holidays) | ||
467 | 460 | ||
468 | Japan | 461 | Japan |
462 | - Visit our web site at http://www.adaptec.co.jp/. | ||
469 | - To speak with a Technical Support Specialist, call | 463 | - To speak with a Technical Support Specialist, call |
470 | +81-3-5308-6120 | 464 | +81 3 5308 6120, Monday-Friday, 9:00 a.m. to 12:00 p.m., |
471 | Hours: Monday-Friday, 9:00 a.m. to 12:00 p.m., 1:00 p.m. to | 465 | 1:00 p.m. to 6:00 p.m. |
472 | 6:00 p.m. TSC | ||
473 | |||
474 | Hong Kong and China | ||
475 | - To speak with a Technical Support Specialist, call | ||
476 | +852-2869-7200 | ||
477 | Hours: Monday-Friday, 10:00 to 17:00. | ||
478 | - Fax Technical Support at +852-2869-7100. | ||
479 | |||
480 | Singapore | ||
481 | - To speak with a Technical Support Specialist, call | ||
482 | +65-245-7470 | ||
483 | Hours: Monday-Friday, 10:00 to 17:00. | ||
484 | - Fax Technical Support at +852-2869-7100 | ||
485 | 466 | ||
486 | ------------------------------------------------------------------- | 467 | ------------------------------------------------------------------- |
487 | /* | 468 | /* |
diff --git a/Documentation/scsi/aic7xxx.txt b/Documentation/scsi/aic7xxx.txt index 47e74ddc4bc9..3481fcded4c2 100644 --- a/Documentation/scsi/aic7xxx.txt +++ b/Documentation/scsi/aic7xxx.txt | |||
@@ -309,81 +309,57 @@ The following information is available in this file: | |||
309 | ----------------------------------------------------------------- | 309 | ----------------------------------------------------------------- |
310 | 310 | ||
311 | Example: | 311 | Example: |
312 | 'options aic7xxx aic7xxx=verbose,no_probe,tag_info:{{},{,,10}},seltime:1" | 312 | 'options aic7xxx aic7xxx=verbose,no_probe,tag_info:{{},{,,10}},seltime:1' |
313 | enables verbose logging, Disable EISA/VLB probing, | 313 | enables verbose logging, Disable EISA/VLB probing, |
314 | and set tag depth on Controller 1/Target 2 to 10 tags. | 314 | and set tag depth on Controller 1/Target 2 to 10 tags. |
315 | 315 | ||
316 | 3. Contacting Adaptec | 316 | 4. Adaptec Customer Support |
317 | 317 | ||
318 | A Technical Support Identification (TSID) Number is required for | 318 | A Technical Support Identification (TSID) Number is required for |
319 | Adaptec technical support. | 319 | Adaptec technical support. |
320 | - The 12-digit TSID can be found on the white barcode-type label | 320 | - The 12-digit TSID can be found on the white barcode-type label |
321 | included inside the box with your product. The TSID helps us | 321 | included inside the box with your product. The TSID helps us |
322 | provide more efficient service by accurately identifying your | 322 | provide more efficient service by accurately identifying your |
323 | product and support status. | 323 | product and support status. |
324 | |||
324 | Support Options | 325 | Support Options |
325 | - Search the Adaptec Support Knowledgebase (ASK) at | 326 | - Search the Adaptec Support Knowledgebase (ASK) at |
326 | http://ask.adaptec.com for articles, troubleshooting tips, and | 327 | http://ask.adaptec.com for articles, troubleshooting tips, and |
327 | frequently asked questions for your product. | 328 | frequently asked questions about your product. |
328 | - For support via Email, submit your question to Adaptec's | 329 | - For support via Email, submit your question to Adaptec's |
329 | Technical Support Specialists at http://ask.adaptec.com. | 330 | Technical Support Specialists at http://ask.adaptec.com/. |
330 | 331 | ||
331 | North America | 332 | North America |
332 | - Visit our Web site at http://www.adaptec.com. | 333 | - Visit our Web site at http://www.adaptec.com/. |
333 | - To speak with a Fibre Channel/RAID/External Storage Technical | 334 | - For information about Adaptec's support options, call |
334 | Support Specialist, call 1-321-207-2000, | 335 | 408-957-2550, 24 hours a day, 7 days a week. |
335 | Hours: Monday-Friday, 3:00 A.M. to 5:00 P.M., PST. | 336 | - To speak with a Technical Support Specialist, |
336 | (Not open on holidays) | 337 | * For hardware products, call 408-934-7274, |
337 | - For Technical Support in all other technologies including | 338 | Monday to Friday, 3:00 am to 5:00 pm, PDT. |
338 | SCSI, call 1-408-934-7274, | 339 | * For RAID and Fibre Channel products, call 321-207-2000, |
339 | Hours: Monday-Friday, 6:00 A.M. to 5:00 P.M., PST. | 340 | Monday to Friday, 3:00 am to 5:00 pm, PDT. |
340 | (Not open on holidays) | 341 | To expedite your service, have your computer with you. |
341 | - For after hours support, call 1-800-416-8066 ($99/call, | 342 | - To order Adaptec products, including accessories and cables, |
342 | $149/call on holidays) | 343 | call 408-957-7274. To order cables online go to |
343 | - To order Adaptec products including software and cables, call | 344 | http://www.adaptec.com/buy-cables/. |
344 | 1-800-442-7274 or 1-408-957-7274. You can also visit our | ||
345 | online store at http://www.adaptecstore.com | ||
346 | 345 | ||
347 | Europe | 346 | Europe |
348 | - Visit our Web site at http://www.adaptec-europe.com. | 347 | - Visit our Web site at http://www.adaptec-europe.com/. |
349 | - English and French: To speak with a Technical Support | 348 | - To speak with a Technical Support Specialist, call, or email, |
350 | Specialist, call one of the following numbers: | 349 | * German: +49 89 4366 5522, Monday-Friday, 9:00-17:00 CET, |
351 | - English: +32-2-352-3470 | 350 | http://ask-de.adaptec.com/. |
352 | - French: +32-2-352-3460 | 351 | * French: +49 89 4366 5533, Monday-Friday, 9:00-17:00 CET, |
353 | Hours: Monday-Thursday, 10:00 to 12:30, 13:30 to 17:30 CET | 352 | http://ask-fr.adaptec.com/. |
354 | Friday, 10:00 to 12:30, 13:30 to 16:30 CET | 353 | * English: +49 89 4366 5544, Monday-Friday, 9:00-17:00 GMT, |
355 | - German: To speak with a Technical Support Specialist, | 354 | http://ask.adaptec.com/. |
356 | call +49-89-456-40660 | 355 | - You can order Adaptec cables online at |
357 | Hours: Monday-Thursday, 09:30 to 12:30, 13:30 to 16:30 CET | 356 | http://www.adaptec.com/buy-cables/. |
358 | Friday, 09:30 to 12:30, 13:30 to 15:00 CET | ||
359 | - To order Adaptec products, including accessories and cables: | ||
360 | - UK: +0800-96-65-26 or fax +0800-731-02-95 | ||
361 | - Other European countries: +32-11-300-379 | ||
362 | |||
363 | Australia and New Zealand | ||
364 | - Visit our Web site at http://www.adaptec.com.au. | ||
365 | - To speak with a Technical Support Specialist, call | ||
366 | +612-9416-0698 | ||
367 | Hours: Monday-Friday, 10:00 A.M. to 4:30 P.M., EAT | ||
368 | (Not open on holidays) | ||
369 | 357 | ||
370 | Japan | 358 | Japan |
359 | - Visit our web site at http://www.adaptec.co.jp/. | ||
371 | - To speak with a Technical Support Specialist, call | 360 | - To speak with a Technical Support Specialist, call |
372 | +81-3-5308-6120 | 361 | +81 3 5308 6120, Monday-Friday, 9:00 a.m. to 12:00 p.m., |
373 | Hours: Monday-Friday, 9:00 a.m. to 12:00 p.m., 1:00 p.m. to | 362 | 1:00 p.m. to 6:00 p.m. |
374 | 6:00 p.m. TSC | ||
375 | |||
376 | Hong Kong and China | ||
377 | - To speak with a Technical Support Specialist, call | ||
378 | +852-2869-7200 | ||
379 | Hours: Monday-Friday, 10:00 to 17:00. | ||
380 | - Fax Technical Support at +852-2869-7100. | ||
381 | |||
382 | Singapore | ||
383 | - To speak with a Technical Support Specialist, call | ||
384 | +65-245-7470 | ||
385 | Hours: Monday-Friday, 10:00 to 17:00. | ||
386 | - Fax Technical Support at +852-2869-7100 | ||
387 | 363 | ||
388 | ------------------------------------------------------------------- | 364 | ------------------------------------------------------------------- |
389 | /* | 365 | /* |
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index d2578013e829..36b511c7cade 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -837,8 +837,10 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
837 | 837 | ||
838 | Module for AC'97 motherboards from Intel and compatibles. | 838 | Module for AC'97 motherboards from Intel and compatibles. |
839 | * Intel i810/810E, i815, i820, i830, i84x, MX440 | 839 | * Intel i810/810E, i815, i820, i830, i84x, MX440 |
840 | ICH5, ICH6, ICH7, ESB2 | ||
840 | * SiS 7012 (SiS 735) | 841 | * SiS 7012 (SiS 735) |
841 | * NVidia NForce, NForce2 | 842 | * NVidia NForce, NForce2, NForce3, MCP04, CK804 |
843 | CK8, CK8S, MCP501 | ||
842 | * AMD AMD768, AMD8111 | 844 | * AMD AMD768, AMD8111 |
843 | * ALi m5455 | 845 | * ALi m5455 |
844 | 846 | ||
@@ -868,6 +870,12 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
868 | -------------------- | 870 | -------------------- |
869 | 871 | ||
870 | Module for Intel ICH (i8x0) chipset MC97 modems. | 872 | Module for Intel ICH (i8x0) chipset MC97 modems. |
873 | * Intel i810/810E, i815, i820, i830, i84x, MX440 | ||
874 | ICH5, ICH6, ICH7 | ||
875 | * SiS 7013 (SiS 735) | ||
876 | * NVidia NForce, NForce2, NForce2s, NForce3 | ||
877 | * AMD AMD8111 | ||
878 | * ALi m5455 | ||
871 | 879 | ||
872 | ac97_clock - AC'97 codec clock base (0 = auto-detect) | 880 | ac97_clock - AC'97 codec clock base (0 = auto-detect) |
873 | 881 | ||
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl index e651ed8d1e6f..4251085d38d3 100644 --- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl +++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl | |||
@@ -5206,14 +5206,14 @@ struct _snd_pcm_runtime { | |||
5206 | You need to pass the <function>snd_dma_pci_data(pci)</function>, | 5206 | You need to pass the <function>snd_dma_pci_data(pci)</function>, |
5207 | where pci is the struct <structname>pci_dev</structname> pointer | 5207 | where pci is the struct <structname>pci_dev</structname> pointer |
5208 | of the chip as well. | 5208 | of the chip as well. |
5209 | The <type>snd_sg_buf_t</type> instance is created as | 5209 | The <type>struct snd_sg_buf</type> instance is created as |
5210 | substream->dma_private. You can cast | 5210 | substream->dma_private. You can cast |
5211 | the pointer like: | 5211 | the pointer like: |
5212 | 5212 | ||
5213 | <informalexample> | 5213 | <informalexample> |
5214 | <programlisting> | 5214 | <programlisting> |
5215 | <![CDATA[ | 5215 | <![CDATA[ |
5216 | struct snd_sg_buf *sgbuf = (struct snd_sg_buf_t*)substream->dma_private; | 5216 | struct snd_sg_buf *sgbuf = (struct snd_sg_buf *)substream->dma_private; |
5217 | ]]> | 5217 | ]]> |
5218 | </programlisting> | 5218 | </programlisting> |
5219 | </informalexample> | 5219 | </informalexample> |
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index 391dd64363e7..a46c10fcddfc 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -28,6 +28,7 @@ Currently, these files are in /proc/sys/vm: | |||
28 | - block_dump | 28 | - block_dump |
29 | - drop-caches | 29 | - drop-caches |
30 | - zone_reclaim_mode | 30 | - zone_reclaim_mode |
31 | - zone_reclaim_interval | ||
31 | 32 | ||
32 | ============================================================== | 33 | ============================================================== |
33 | 34 | ||
@@ -126,15 +127,54 @@ the high water marks for each per cpu page list. | |||
126 | 127 | ||
127 | zone_reclaim_mode: | 128 | zone_reclaim_mode: |
128 | 129 | ||
129 | This is set during bootup to 1 if it is determined that pages from | 130 | Zone_reclaim_mode allows to set more or less agressive approaches to |
130 | remote zones will cause a significant performance reduction. The | 131 | reclaim memory when a zone runs out of memory. If it is set to zero then no |
132 | zone reclaim occurs. Allocations will be satisfied from other zones / nodes | ||
133 | in the system. | ||
134 | |||
135 | This is value ORed together of | ||
136 | |||
137 | 1 = Zone reclaim on | ||
138 | 2 = Zone reclaim writes dirty pages out | ||
139 | 4 = Zone reclaim swaps pages | ||
140 | 8 = Also do a global slab reclaim pass | ||
141 | |||
142 | zone_reclaim_mode is set during bootup to 1 if it is determined that pages | ||
143 | from remote zones will cause a measurable performance reduction. The | ||
131 | page allocator will then reclaim easily reusable pages (those page | 144 | page allocator will then reclaim easily reusable pages (those page |
132 | cache pages that are currently not used) before going off node. | 145 | cache pages that are currently not used) before allocating off node pages. |
146 | |||
147 | It may be beneficial to switch off zone reclaim if the system is | ||
148 | used for a file server and all of memory should be used for caching files | ||
149 | from disk. In that case the caching effect is more important than | ||
150 | data locality. | ||
151 | |||
152 | Allowing zone reclaim to write out pages stops processes that are | ||
153 | writing large amounts of data from dirtying pages on other nodes. Zone | ||
154 | reclaim will write out dirty pages if a zone fills up and so effectively | ||
155 | throttle the process. This may decrease the performance of a single process | ||
156 | since it cannot use all of system memory to buffer the outgoing writes | ||
157 | anymore but it preserve the memory on other nodes so that the performance | ||
158 | of other processes running on other nodes will not be affected. | ||
159 | |||
160 | Allowing regular swap effectively restricts allocations to the local | ||
161 | node unless explicitly overridden by memory policies or cpuset | ||
162 | configurations. | ||
163 | |||
164 | It may be advisable to allow slab reclaim if the system makes heavy | ||
165 | use of files and builds up large slab caches. However, the slab | ||
166 | shrink operation is global, may take a long time and free slabs | ||
167 | in all nodes of the system. | ||
168 | |||
169 | ================================================================ | ||
170 | |||
171 | zone_reclaim_interval: | ||
172 | |||
173 | The time allowed for off node allocations after zone reclaim | ||
174 | has failed to reclaim enough pages to allow a local allocation. | ||
133 | 175 | ||
134 | The user can override this setting. It may be beneficial to switch | 176 | Time is set in seconds and set by default to 30 seconds. |
135 | off zone reclaim if the system is used for a file server and all | ||
136 | of memory should be used for caching files from disk. | ||
137 | 177 | ||
138 | It may be beneficial to switch this on if one wants to do zone | 178 | Reduce the interval if undesired off node allocations occur. However, too |
139 | reclaim regardless of the numa distances in the system. | 179 | frequent scans will have a negative impact onoff node allocation performance. |
140 | 180 | ||
diff --git a/Documentation/usb/et61x251.txt b/Documentation/usb/et61x251.txt new file mode 100644 index 000000000000..b44dda407ce2 --- /dev/null +++ b/Documentation/usb/et61x251.txt | |||
@@ -0,0 +1,306 @@ | |||
1 | |||
2 | ET61X[12]51 PC Camera Controllers | ||
3 | Driver for Linux | ||
4 | ================================= | ||
5 | |||
6 | - Documentation - | ||
7 | |||
8 | |||
9 | Index | ||
10 | ===== | ||
11 | 1. Copyright | ||
12 | 2. Disclaimer | ||
13 | 3. License | ||
14 | 4. Overview and features | ||
15 | 5. Module dependencies | ||
16 | 6. Module loading | ||
17 | 7. Module parameters | ||
18 | 8. Optional device control through "sysfs" | ||
19 | 9. Supported devices | ||
20 | 10. Notes for V4L2 application developers | ||
21 | 11. Contact information | ||
22 | |||
23 | |||
24 | 1. Copyright | ||
25 | ============ | ||
26 | Copyright (C) 2006 by Luca Risolia <luca.risolia@studio.unibo.it> | ||
27 | |||
28 | |||
29 | 2. Disclaimer | ||
30 | ============= | ||
31 | Etoms is a trademark of Etoms Electronics Corp. | ||
32 | This software is not developed or sponsored by Etoms Electronics. | ||
33 | |||
34 | |||
35 | 3. License | ||
36 | ========== | ||
37 | This program is free software; you can redistribute it and/or modify | ||
38 | it under the terms of the GNU General Public License as published by | ||
39 | the Free Software Foundation; either version 2 of the License, or | ||
40 | (at your option) any later version. | ||
41 | |||
42 | This program is distributed in the hope that it will be useful, | ||
43 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
44 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
45 | GNU General Public License for more details. | ||
46 | |||
47 | You should have received a copy of the GNU General Public License | ||
48 | along with this program; if not, write to the Free Software | ||
49 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
50 | |||
51 | |||
52 | 4. Overview and features | ||
53 | ======================== | ||
54 | This driver supports the video interface of the devices mounting the ET61X151 | ||
55 | or ET61X251 PC Camera Controllers. | ||
56 | |||
57 | It's worth to note that Etoms Electronics has never collaborated with the | ||
58 | author during the development of this project; despite several requests, | ||
59 | Etoms Electronics also refused to release enough detailed specifications of | ||
60 | the video compression engine. | ||
61 | |||
62 | The driver relies on the Video4Linux2 and USB core modules. It has been | ||
63 | designed to run properly on SMP systems as well. | ||
64 | |||
65 | The latest version of the ET61X[12]51 driver can be found at the following URL: | ||
66 | http://www.linux-projects.org/ | ||
67 | |||
68 | Some of the features of the driver are: | ||
69 | |||
70 | - full compliance with the Video4Linux2 API (see also "Notes for V4L2 | ||
71 | application developers" paragraph); | ||
72 | - available mmap or read/poll methods for video streaming through isochronous | ||
73 | data transfers; | ||
74 | - automatic detection of image sensor; | ||
75 | - support for any window resolutions and optional panning within the maximum | ||
76 | pixel area of image sensor; | ||
77 | - image downscaling with arbitrary scaling factors from 1 and 2 in both | ||
78 | directions (see "Notes for V4L2 application developers" paragraph); | ||
79 | - two different video formats for uncompressed or compressed data in low or | ||
80 | high compression quality (see also "Notes for V4L2 application developers" | ||
81 | paragraph); | ||
82 | - full support for the capabilities of every possible image sensors that can | ||
83 | be connected to the ET61X[12]51 bridges, including, for istance, red, green, | ||
84 | blue and global gain adjustments and exposure control (see "Supported | ||
85 | devices" paragraph for details); | ||
86 | - use of default color settings for sunlight conditions; | ||
87 | - dynamic I/O interface for both ET61X[12]51 and image sensor control (see | ||
88 | "Optional device control through 'sysfs'" paragraph); | ||
89 | - dynamic driver control thanks to various module parameters (see "Module | ||
90 | parameters" paragraph); | ||
91 | - up to 64 cameras can be handled at the same time; they can be connected and | ||
92 | disconnected from the host many times without turning off the computer, if | ||
93 | the system supports hotplugging; | ||
94 | - no known bugs. | ||
95 | |||
96 | |||
97 | 5. Module dependencies | ||
98 | ====================== | ||
99 | For it to work properly, the driver needs kernel support for Video4Linux and | ||
100 | USB. | ||
101 | |||
102 | The following options of the kernel configuration file must be enabled and | ||
103 | corresponding modules must be compiled: | ||
104 | |||
105 | # Multimedia devices | ||
106 | # | ||
107 | CONFIG_VIDEO_DEV=m | ||
108 | |||
109 | To enable advanced debugging functionality on the device through /sysfs: | ||
110 | |||
111 | # Multimedia devices | ||
112 | # | ||
113 | CONFIG_VIDEO_ADV_DEBUG=y | ||
114 | |||
115 | # USB support | ||
116 | # | ||
117 | CONFIG_USB=m | ||
118 | |||
119 | In addition, depending on the hardware being used, the modules below are | ||
120 | necessary: | ||
121 | |||
122 | # USB Host Controller Drivers | ||
123 | # | ||
124 | CONFIG_USB_EHCI_HCD=m | ||
125 | CONFIG_USB_UHCI_HCD=m | ||
126 | CONFIG_USB_OHCI_HCD=m | ||
127 | |||
128 | And finally: | ||
129 | |||
130 | # USB Multimedia devices | ||
131 | # | ||
132 | CONFIG_USB_ET61X251=m | ||
133 | |||
134 | |||
135 | 6. Module loading | ||
136 | ================= | ||
137 | To use the driver, it is necessary to load the "et61x251" module into memory | ||
138 | after every other module required: "videodev", "usbcore" and, depending on | ||
139 | the USB host controller you have, "ehci-hcd", "uhci-hcd" or "ohci-hcd". | ||
140 | |||
141 | Loading can be done as shown below: | ||
142 | |||
143 | [root@localhost home]# modprobe et61x251 | ||
144 | |||
145 | At this point the devices should be recognized. You can invoke "dmesg" to | ||
146 | analyze kernel messages and verify that the loading process has gone well: | ||
147 | |||
148 | [user@localhost home]$ dmesg | ||
149 | |||
150 | |||
151 | 7. Module parameters | ||
152 | ==================== | ||
153 | Module parameters are listed below: | ||
154 | ------------------------------------------------------------------------------- | ||
155 | Name: video_nr | ||
156 | Type: short array (min = 0, max = 64) | ||
157 | Syntax: <-1|n[,...]> | ||
158 | Description: Specify V4L2 minor mode number: | ||
159 | -1 = use next available | ||
160 | n = use minor number n | ||
161 | You can specify up to 64 cameras this way. | ||
162 | For example: | ||
163 | video_nr=-1,2,-1 would assign minor number 2 to the second | ||
164 | registered camera and use auto for the first one and for every | ||
165 | other camera. | ||
166 | Default: -1 | ||
167 | ------------------------------------------------------------------------------- | ||
168 | Name: force_munmap | ||
169 | Type: bool array (min = 0, max = 64) | ||
170 | Syntax: <0|1[,...]> | ||
171 | Description: Force the application to unmap previously mapped buffer memory | ||
172 | before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not | ||
173 | all the applications support this feature. This parameter is | ||
174 | specific for each detected camera. | ||
175 | 0 = do not force memory unmapping | ||
176 | 1 = force memory unmapping (save memory) | ||
177 | Default: 0 | ||
178 | ------------------------------------------------------------------------------- | ||
179 | Name: debug | ||
180 | Type: ushort | ||
181 | Syntax: <n> | ||
182 | Description: Debugging information level, from 0 to 3: | ||
183 | 0 = none (use carefully) | ||
184 | 1 = critical errors | ||
185 | 2 = significant informations | ||
186 | 3 = more verbose messages | ||
187 | Level 3 is useful for testing only, when only one device | ||
188 | is used at the same time. It also shows some more informations | ||
189 | about the hardware being detected. This module parameter can be | ||
190 | changed at runtime thanks to the /sys filesystem interface. | ||
191 | Default: 2 | ||
192 | ------------------------------------------------------------------------------- | ||
193 | |||
194 | |||
195 | 8. Optional device control through "sysfs" | ||
196 | ========================================== | ||
197 | If the kernel has been compiled with the CONFIG_VIDEO_ADV_DEBUG option enabled, | ||
198 | it is possible to read and write both the ET61X[12]51 and the image sensor | ||
199 | registers by using the "sysfs" filesystem interface. | ||
200 | |||
201 | There are four files in the /sys/class/video4linux/videoX directory for each | ||
202 | registered camera: "reg", "val", "i2c_reg" and "i2c_val". The first two files | ||
203 | control the ET61X[12]51 bridge, while the other two control the sensor chip. | ||
204 | "reg" and "i2c_reg" hold the values of the current register index where the | ||
205 | following reading/writing operations are addressed at through "val" and | ||
206 | "i2c_val". Their use is not intended for end-users, unless you know what you | ||
207 | are doing. Remember that you must be logged in as root before writing to them. | ||
208 | |||
209 | As an example, suppose we were to want to read the value contained in the | ||
210 | register number 1 of the sensor register table - which is usually the product | ||
211 | identifier - of the camera registered as "/dev/video0": | ||
212 | |||
213 | [root@localhost #] cd /sys/class/video4linux/video0 | ||
214 | [root@localhost #] echo 1 > i2c_reg | ||
215 | [root@localhost #] cat i2c_val | ||
216 | |||
217 | Note that if the sensor registers can not be read, "cat" will fail. | ||
218 | To avoid race conditions, all the I/O accesses to the files are serialized. | ||
219 | |||
220 | |||
221 | 9. Supported devices | ||
222 | ==================== | ||
223 | None of the names of the companies as well as their products will be mentioned | ||
224 | here. They have never collaborated with the author, so no advertising. | ||
225 | |||
226 | From the point of view of a driver, what unambiguously identify a device are | ||
227 | its vendor and product USB identifiers. Below is a list of known identifiers of | ||
228 | devices mounting the ET61X[12]51 PC camera controllers: | ||
229 | |||
230 | Vendor ID Product ID | ||
231 | --------- ---------- | ||
232 | 0x102c 0x6151 | ||
233 | 0x102c 0x6251 | ||
234 | 0x102c 0x6253 | ||
235 | 0x102c 0x6254 | ||
236 | 0x102c 0x6255 | ||
237 | 0x102c 0x6256 | ||
238 | 0x102c 0x6257 | ||
239 | 0x102c 0x6258 | ||
240 | 0x102c 0x6259 | ||
241 | 0x102c 0x625a | ||
242 | 0x102c 0x625b | ||
243 | 0x102c 0x625c | ||
244 | 0x102c 0x625d | ||
245 | 0x102c 0x625e | ||
246 | 0x102c 0x625f | ||
247 | 0x102c 0x6260 | ||
248 | 0x102c 0x6261 | ||
249 | 0x102c 0x6262 | ||
250 | 0x102c 0x6263 | ||
251 | 0x102c 0x6264 | ||
252 | 0x102c 0x6265 | ||
253 | 0x102c 0x6266 | ||
254 | 0x102c 0x6267 | ||
255 | 0x102c 0x6268 | ||
256 | 0x102c 0x6269 | ||
257 | |||
258 | The following image sensors are supported: | ||
259 | |||
260 | Model Manufacturer | ||
261 | ----- ------------ | ||
262 | TAS5130D1B Taiwan Advanced Sensor Corporation | ||
263 | |||
264 | All the available control settings of each image sensor are supported through | ||
265 | the V4L2 interface. | ||
266 | |||
267 | |||
268 | 10. Notes for V4L2 application developers | ||
269 | ======================================== | ||
270 | This driver follows the V4L2 API specifications. In particular, it enforces two | ||
271 | rules: | ||
272 | |||
273 | - exactly one I/O method, either "mmap" or "read", is associated with each | ||
274 | file descriptor. Once it is selected, the application must close and reopen the | ||
275 | device to switch to the other I/O method; | ||
276 | |||
277 | - although it is not mandatory, previously mapped buffer memory should always | ||
278 | be unmapped before calling any "VIDIOC_S_CROP" or "VIDIOC_S_FMT" ioctl's. | ||
279 | The same number of buffers as before will be allocated again to match the size | ||
280 | of the new video frames, so you have to map the buffers again before any I/O | ||
281 | attempts on them. | ||
282 | |||
283 | Consistently with the hardware limits, this driver also supports image | ||
284 | downscaling with arbitrary scaling factors from 1 and 2 in both directions. | ||
285 | However, the V4L2 API specifications don't correctly define how the scaling | ||
286 | factor can be chosen arbitrarily by the "negotiation" of the "source" and | ||
287 | "target" rectangles. To work around this flaw, we have added the convention | ||
288 | that, during the negotiation, whenever the "VIDIOC_S_CROP" ioctl is issued, the | ||
289 | scaling factor is restored to 1. | ||
290 | |||
291 | This driver supports two different video formats: the first one is the "8-bit | ||
292 | Sequential Bayer" format and can be used to obtain uncompressed video data | ||
293 | from the device through the current I/O method, while the second one provides | ||
294 | "raw" compressed video data (without frame headers not related to the | ||
295 | compressed data). The current compression quality may vary from 0 to 1 and can | ||
296 | be selected or queried thanks to the VIDIOC_S_JPEGCOMP and VIDIOC_G_JPEGCOMP | ||
297 | V4L2 ioctl's. | ||
298 | |||
299 | |||
300 | 11. Contact information | ||
301 | ======================= | ||
302 | The author may be contacted by e-mail at <luca.risolia@studio.unibo.it>. | ||
303 | |||
304 | GPG/PGP encrypted e-mail's are accepted. The GPG key ID of the author is | ||
305 | 'FCE635A4'; the public 1024-bit key should be available at any keyserver; | ||
306 | the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'. | ||
diff --git a/Documentation/usb/sn9c102.txt b/Documentation/usb/sn9c102.txt index 3f8a119db31b..c6b76414172c 100644 --- a/Documentation/usb/sn9c102.txt +++ b/Documentation/usb/sn9c102.txt | |||
@@ -17,16 +17,15 @@ Index | |||
17 | 7. Module parameters | 17 | 7. Module parameters |
18 | 8. Optional device control through "sysfs" | 18 | 8. Optional device control through "sysfs" |
19 | 9. Supported devices | 19 | 9. Supported devices |
20 | 10. How to add plug-in's for new image sensors | 20 | 10. Notes for V4L2 application developers |
21 | 11. Notes for V4L2 application developers | 21 | 11. Video frame formats |
22 | 12. Video frame formats | 22 | 12. Contact information |
23 | 13. Contact information | 23 | 13. Credits |
24 | 14. Credits | ||
25 | 24 | ||
26 | 25 | ||
27 | 1. Copyright | 26 | 1. Copyright |
28 | ============ | 27 | ============ |
29 | Copyright (C) 2004-2005 by Luca Risolia <luca.risolia@studio.unibo.it> | 28 | Copyright (C) 2004-2006 by Luca Risolia <luca.risolia@studio.unibo.it> |
30 | 29 | ||
31 | 30 | ||
32 | 2. Disclaimer | 31 | 2. Disclaimer |
@@ -54,9 +53,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
54 | 53 | ||
55 | 4. Overview and features | 54 | 4. Overview and features |
56 | ======================== | 55 | ======================== |
57 | This driver attempts to support the video and audio streaming capabilities of | 56 | This driver attempts to support the video interface of the devices mounting the |
58 | the devices mounting the SONiX SN9C101, SN9C102 and SN9C103 PC Camera | 57 | SONiX SN9C101, SN9C102 and SN9C103 PC Camera Controllers. |
59 | Controllers. | ||
60 | 58 | ||
61 | It's worth to note that SONiX has never collaborated with the author during the | 59 | It's worth to note that SONiX has never collaborated with the author during the |
62 | development of this project, despite several requests for enough detailed | 60 | development of this project, despite several requests for enough detailed |
@@ -78,6 +76,7 @@ Some of the features of the driver are: | |||
78 | - available mmap or read/poll methods for video streaming through isochronous | 76 | - available mmap or read/poll methods for video streaming through isochronous |
79 | data transfers; | 77 | data transfers; |
80 | - automatic detection of image sensor; | 78 | - automatic detection of image sensor; |
79 | - support for built-in microphone interface; | ||
81 | - support for any window resolutions and optional panning within the maximum | 80 | - support for any window resolutions and optional panning within the maximum |
82 | pixel area of image sensor; | 81 | pixel area of image sensor; |
83 | - image downscaling with arbitrary scaling factors from 1, 2 and 4 in both | 82 | - image downscaling with arbitrary scaling factors from 1, 2 and 4 in both |
@@ -96,7 +95,7 @@ Some of the features of the driver are: | |||
96 | parameters" paragraph); | 95 | parameters" paragraph); |
97 | - up to 64 cameras can be handled at the same time; they can be connected and | 96 | - up to 64 cameras can be handled at the same time; they can be connected and |
98 | disconnected from the host many times without turning off the computer, if | 97 | disconnected from the host many times without turning off the computer, if |
99 | your system supports hotplugging; | 98 | the system supports hotplugging; |
100 | - no known bugs. | 99 | - no known bugs. |
101 | 100 | ||
102 | 101 | ||
@@ -112,6 +111,12 @@ corresponding modules must be compiled: | |||
112 | # | 111 | # |
113 | CONFIG_VIDEO_DEV=m | 112 | CONFIG_VIDEO_DEV=m |
114 | 113 | ||
114 | To enable advanced debugging functionality on the device through /sysfs: | ||
115 | |||
116 | # Multimedia devices | ||
117 | # | ||
118 | CONFIG_VIDEO_ADV_DEBUG=y | ||
119 | |||
115 | # USB support | 120 | # USB support |
116 | # | 121 | # |
117 | CONFIG_USB=m | 122 | CONFIG_USB=m |
@@ -125,6 +130,21 @@ necessary: | |||
125 | CONFIG_USB_UHCI_HCD=m | 130 | CONFIG_USB_UHCI_HCD=m |
126 | CONFIG_USB_OHCI_HCD=m | 131 | CONFIG_USB_OHCI_HCD=m |
127 | 132 | ||
133 | The SN9C103 controller also provides a built-in microphone interface. It is | ||
134 | supported by the USB Audio driver thanks to the ALSA API: | ||
135 | |||
136 | # Sound | ||
137 | # | ||
138 | CONFIG_SOUND=y | ||
139 | |||
140 | # Advanced Linux Sound Architecture | ||
141 | # | ||
142 | CONFIG_SND=m | ||
143 | |||
144 | # USB devices | ||
145 | # | ||
146 | CONFIG_SND_USB_AUDIO=m | ||
147 | |||
128 | And finally: | 148 | And finally: |
129 | 149 | ||
130 | # USB Multimedia devices | 150 | # USB Multimedia devices |
@@ -153,7 +173,7 @@ analyze kernel messages and verify that the loading process has gone well: | |||
153 | Module parameters are listed below: | 173 | Module parameters are listed below: |
154 | ------------------------------------------------------------------------------- | 174 | ------------------------------------------------------------------------------- |
155 | Name: video_nr | 175 | Name: video_nr |
156 | Type: int array (min = 0, max = 64) | 176 | Type: short array (min = 0, max = 64) |
157 | Syntax: <-1|n[,...]> | 177 | Syntax: <-1|n[,...]> |
158 | Description: Specify V4L2 minor mode number: | 178 | Description: Specify V4L2 minor mode number: |
159 | -1 = use next available | 179 | -1 = use next available |
@@ -165,19 +185,19 @@ Description: Specify V4L2 minor mode number: | |||
165 | other camera. | 185 | other camera. |
166 | Default: -1 | 186 | Default: -1 |
167 | ------------------------------------------------------------------------------- | 187 | ------------------------------------------------------------------------------- |
168 | Name: force_munmap; | 188 | Name: force_munmap |
169 | Type: bool array (min = 0, max = 64) | 189 | Type: bool array (min = 0, max = 64) |
170 | Syntax: <0|1[,...]> | 190 | Syntax: <0|1[,...]> |
171 | Description: Force the application to unmap previously mapped buffer memory | 191 | Description: Force the application to unmap previously mapped buffer memory |
172 | before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not | 192 | before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not |
173 | all the applications support this feature. This parameter is | 193 | all the applications support this feature. This parameter is |
174 | specific for each detected camera. | 194 | specific for each detected camera. |
175 | 0 = do not force memory unmapping" | 195 | 0 = do not force memory unmapping |
176 | 1 = force memory unmapping (save memory)" | 196 | 1 = force memory unmapping (save memory) |
177 | Default: 0 | 197 | Default: 0 |
178 | ------------------------------------------------------------------------------- | 198 | ------------------------------------------------------------------------------- |
179 | Name: debug | 199 | Name: debug |
180 | Type: int | 200 | Type: ushort |
181 | Syntax: <n> | 201 | Syntax: <n> |
182 | Description: Debugging information level, from 0 to 3: | 202 | Description: Debugging information level, from 0 to 3: |
183 | 0 = none (use carefully) | 203 | 0 = none (use carefully) |
@@ -187,14 +207,15 @@ Description: Debugging information level, from 0 to 3: | |||
187 | Level 3 is useful for testing only, when only one device | 207 | Level 3 is useful for testing only, when only one device |
188 | is used. It also shows some more informations about the | 208 | is used. It also shows some more informations about the |
189 | hardware being detected. This parameter can be changed at | 209 | hardware being detected. This parameter can be changed at |
190 | runtime thanks to the /sys filesystem. | 210 | runtime thanks to the /sys filesystem interface. |
191 | Default: 2 | 211 | Default: 2 |
192 | ------------------------------------------------------------------------------- | 212 | ------------------------------------------------------------------------------- |
193 | 213 | ||
194 | 214 | ||
195 | 8. Optional device control through "sysfs" [1] | 215 | 8. Optional device control through "sysfs" [1] |
196 | ========================================== | 216 | ========================================== |
197 | It is possible to read and write both the SN9C10x and the image sensor | 217 | If the kernel has been compiled with the CONFIG_VIDEO_ADV_DEBUG option enabled, |
218 | it is possible to read and write both the SN9C10x and the image sensor | ||
198 | registers by using the "sysfs" filesystem interface. | 219 | registers by using the "sysfs" filesystem interface. |
199 | 220 | ||
200 | Every time a supported device is recognized, a write-only file named "green" is | 221 | Every time a supported device is recognized, a write-only file named "green" is |
@@ -236,7 +257,7 @@ serialized. | |||
236 | 257 | ||
237 | The sysfs interface also provides the "frame_header" entry, which exports the | 258 | The sysfs interface also provides the "frame_header" entry, which exports the |
238 | frame header of the most recent requested and captured video frame. The header | 259 | frame header of the most recent requested and captured video frame. The header |
239 | is 12-bytes long and is appended to every video frame by the SN9C10x | 260 | is always 18-bytes long and is appended to every video frame by the SN9C10x |
240 | controllers. As an example, this additional information can be used by the user | 261 | controllers. As an example, this additional information can be used by the user |
241 | application for implementing auto-exposure features via software. | 262 | application for implementing auto-exposure features via software. |
242 | 263 | ||
@@ -250,7 +271,8 @@ Byte # Value Description | |||
250 | 0x03 0xC4 Frame synchronisation pattern. | 271 | 0x03 0xC4 Frame synchronisation pattern. |
251 | 0x04 0xC4 Frame synchronisation pattern. | 272 | 0x04 0xC4 Frame synchronisation pattern. |
252 | 0x05 0x96 Frame synchronisation pattern. | 273 | 0x05 0x96 Frame synchronisation pattern. |
253 | 0x06 0x00 or 0x01 Unknown meaning. The exact value depends on the chip. | 274 | 0x06 0xXX Unknown meaning. The exact value depends on the chip; |
275 | possible values are 0x00, 0x01 and 0x20. | ||
254 | 0x07 0xXX Variable value, whose bits are ff00uzzc, where ff is a | 276 | 0x07 0xXX Variable value, whose bits are ff00uzzc, where ff is a |
255 | frame counter, u is unknown, zz is a size indicator | 277 | frame counter, u is unknown, zz is a size indicator |
256 | (00 = VGA, 01 = SIF, 10 = QSIF) and c stands for | 278 | (00 = VGA, 01 = SIF, 10 = QSIF) and c stands for |
@@ -267,12 +289,23 @@ Byte # Value Description | |||
267 | times the area outside of the specified AE area. For | 289 | times the area outside of the specified AE area. For |
268 | images that are not pure white, the value scales down | 290 | images that are not pure white, the value scales down |
269 | according to relative whiteness. | 291 | according to relative whiteness. |
292 | according to relative whiteness. | ||
293 | |||
294 | The following bytes are used by the SN9C103 bridge only: | ||
295 | |||
296 | 0x0C 0xXX Unknown meaning | ||
297 | 0x0D 0xXX Unknown meaning | ||
298 | 0x0E 0xXX Unknown meaning | ||
299 | 0x0F 0xXX Unknown meaning | ||
300 | 0x10 0xXX Unknown meaning | ||
301 | 0x11 0xXX Unknown meaning | ||
270 | 302 | ||
271 | The AE area (sx, sy, ex, ey) in the active window can be set by programming the | 303 | The AE area (sx, sy, ex, ey) in the active window can be set by programming the |
272 | registers 0x1c, 0x1d, 0x1e and 0x1f of the SN9C10x controllers, where one unit | 304 | registers 0x1c, 0x1d, 0x1e and 0x1f of the SN9C10x controllers, where one unit |
273 | corresponds to 32 pixels. | 305 | corresponds to 32 pixels. |
274 | 306 | ||
275 | [1] The frame header has been documented by Bertrik Sikken. | 307 | [1] Part of the meaning of the frame header has been documented by Bertrik |
308 | Sikken. | ||
276 | 309 | ||
277 | 310 | ||
278 | 9. Supported devices | 311 | 9. Supported devices |
@@ -298,6 +331,7 @@ Vendor ID Product ID | |||
298 | 0x0c45 0x602b | 331 | 0x0c45 0x602b |
299 | 0x0c45 0x602c | 332 | 0x0c45 0x602c |
300 | 0x0c45 0x602d | 333 | 0x0c45 0x602d |
334 | 0x0c45 0x602e | ||
301 | 0x0c45 0x6030 | 335 | 0x0c45 0x6030 |
302 | 0x0c45 0x6080 | 336 | 0x0c45 0x6080 |
303 | 0x0c45 0x6082 | 337 | 0x0c45 0x6082 |
@@ -348,18 +382,7 @@ appreciated. Non-available hardware will not be supported by the author of this | |||
348 | driver. | 382 | driver. |
349 | 383 | ||
350 | 384 | ||
351 | 10. How to add plug-in's for new image sensors | 385 | 10. Notes for V4L2 application developers |
352 | ============================================== | ||
353 | It should be easy to write plug-in's for new sensors by using the small API | ||
354 | that has been created for this purpose, which is present in "sn9c102_sensor.h" | ||
355 | (documentation is included there). As an example, have a look at the code in | ||
356 | "sn9c102_pas106b.c", which uses the mentioned interface. | ||
357 | |||
358 | At the moment, possible unsupported image sensors are: CIS-VF10 (VGA), | ||
359 | OV7620 (VGA), OV7630 (VGA). | ||
360 | |||
361 | |||
362 | 11. Notes for V4L2 application developers | ||
363 | ========================================= | 386 | ========================================= |
364 | This driver follows the V4L2 API specifications. In particular, it enforces two | 387 | This driver follows the V4L2 API specifications. In particular, it enforces two |
365 | rules: | 388 | rules: |
@@ -394,7 +417,7 @@ initialized (as described in the documentation of the API for the image sensors | |||
394 | supplied by this driver). | 417 | supplied by this driver). |
395 | 418 | ||
396 | 419 | ||
397 | 12. Video frame formats [1] | 420 | 11. Video frame formats [1] |
398 | ======================= | 421 | ======================= |
399 | The SN9C10x PC Camera Controllers can send images in two possible video | 422 | The SN9C10x PC Camera Controllers can send images in two possible video |
400 | formats over the USB: either native "Sequential RGB Bayer" or Huffman | 423 | formats over the USB: either native "Sequential RGB Bayer" or Huffman |
@@ -455,7 +478,7 @@ The following Huffman codes have been found: | |||
455 | documented by Bertrik Sikken. | 478 | documented by Bertrik Sikken. |
456 | 479 | ||
457 | 480 | ||
458 | 13. Contact information | 481 | 12. Contact information |
459 | ======================= | 482 | ======================= |
460 | The author may be contacted by e-mail at <luca.risolia@studio.unibo.it>. | 483 | The author may be contacted by e-mail at <luca.risolia@studio.unibo.it>. |
461 | 484 | ||
@@ -464,7 +487,7 @@ GPG/PGP encrypted e-mail's are accepted. The GPG key ID of the author is | |||
464 | the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'. | 487 | the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'. |
465 | 488 | ||
466 | 489 | ||
467 | 14. Credits | 490 | 13. Credits |
468 | =========== | 491 | =========== |
469 | Many thanks to following persons for their contribute (listed in alphabetical | 492 | Many thanks to following persons for their contribute (listed in alphabetical |
470 | order): | 493 | order): |
@@ -480,5 +503,5 @@ order): | |||
480 | - Bertrik Sikken, who reverse-engineered and documented the Huffman compression | 503 | - Bertrik Sikken, who reverse-engineered and documented the Huffman compression |
481 | algorithm used in the SN9C10x controllers and implemented the first decoder; | 504 | algorithm used in the SN9C10x controllers and implemented the first decoder; |
482 | - Mizuno Takafumi for the donation of a webcam; | 505 | - Mizuno Takafumi for the donation of a webcam; |
483 | - An "anonymous" donator (who didn't want his name to be revealed) for the | 506 | - an "anonymous" donator (who didn't want his name to be revealed) for the |
484 | donation of a webcam. | 507 | donation of a webcam. |
diff --git a/Documentation/usb/w9968cf.txt b/Documentation/usb/w9968cf.txt index 18a47738d56c..9d46cd0b19e3 100644 --- a/Documentation/usb/w9968cf.txt +++ b/Documentation/usb/w9968cf.txt | |||
@@ -57,16 +57,12 @@ based cameras should be supported as well. | |||
57 | The driver is divided into two modules: the basic one, "w9968cf", is needed for | 57 | The driver is divided into two modules: the basic one, "w9968cf", is needed for |
58 | the supported devices to work; the second one, "w9968cf-vpp", is an optional | 58 | the supported devices to work; the second one, "w9968cf-vpp", is an optional |
59 | module, which provides some useful video post-processing functions like video | 59 | module, which provides some useful video post-processing functions like video |
60 | decoding, up-scaling and colour conversions. Once the driver is installed, | 60 | decoding, up-scaling and colour conversions. |
61 | every time an application tries to open a recognized device, "w9968cf" checks | ||
62 | the presence of the "w9968cf-vpp" module and loads it automatically by default. | ||
63 | 61 | ||
64 | Please keep in mind that official kernels do not include the second module for | 62 | Note that the official kernels do neither include nor support the second |
65 | performance purposes. However it is always recommended to download and install | 63 | module for performance purposes. Therefore, it is always recommended to |
66 | the latest and complete release of the driver, replacing the existing one, if | 64 | download and install the latest and complete release of the driver, |
67 | present: it will be still even possible not to load the "w9968cf-vpp" module at | 65 | replacing the existing one, if present. |
68 | all, if you ever want to. Another important missing feature of the version in | ||
69 | the official Linux 2.4 kernels is the writeable /proc filesystem interface. | ||
70 | 66 | ||
71 | The latest and full-featured version of the W996[87]CF driver can be found at: | 67 | The latest and full-featured version of the W996[87]CF driver can be found at: |
72 | http://www.linux-projects.org. Please refer to the documentation included in | 68 | http://www.linux-projects.org. Please refer to the documentation included in |
@@ -201,22 +197,6 @@ Note: The kernel must be compiled with the CONFIG_KMOD option | |||
201 | enabled for the 'ovcamchip' module to be loaded and for | 197 | enabled for the 'ovcamchip' module to be loaded and for |
202 | this parameter to be present. | 198 | this parameter to be present. |
203 | ------------------------------------------------------------------------------- | 199 | ------------------------------------------------------------------------------- |
204 | Name: vppmod_load | ||
205 | Type: bool | ||
206 | Syntax: <0|1> | ||
207 | Description: Automatic 'w9968cf-vpp' module loading: 0 disabled, 1 enabled. | ||
208 | If enabled, every time an application attempts to open a | ||
209 | camera, 'insmod' searches for the video post-processing module | ||
210 | in the system and loads it automatically (if present). | ||
211 | The optional 'w9968cf-vpp' module adds extra image manipulation | ||
212 | capabilities to the 'w9968cf' module,like software up-scaling, | ||
213 | colour conversions and video decompression for very high frame | ||
214 | rates. | ||
215 | Default: 1 | ||
216 | Note: The kernel must be compiled with the CONFIG_KMOD option | ||
217 | enabled for the 'w9968cf-vpp' module to be loaded and for | ||
218 | this parameter to be present. | ||
219 | ------------------------------------------------------------------------------- | ||
220 | Name: simcams | 200 | Name: simcams |
221 | Type: int | 201 | Type: int |
222 | Syntax: <n> | 202 | Syntax: <n> |
diff --git a/Documentation/vm/page_migration b/Documentation/vm/page_migration new file mode 100644 index 000000000000..c52820fcf500 --- /dev/null +++ b/Documentation/vm/page_migration | |||
@@ -0,0 +1,129 @@ | |||
1 | Page migration | ||
2 | -------------- | ||
3 | |||
4 | Page migration allows the moving of the physical location of pages between | ||
5 | nodes in a numa system while the process is running. This means that the | ||
6 | virtual addresses that the process sees do not change. However, the | ||
7 | system rearranges the physical location of those pages. | ||
8 | |||
9 | The main intend of page migration is to reduce the latency of memory access | ||
10 | by moving pages near to the processor where the process accessing that memory | ||
11 | is running. | ||
12 | |||
13 | Page migration allows a process to manually relocate the node on which its | ||
14 | pages are located through the MF_MOVE and MF_MOVE_ALL options while setting | ||
15 | a new memory policy. The pages of process can also be relocated | ||
16 | from another process using the sys_migrate_pages() function call. The | ||
17 | migrate_pages function call takes two sets of nodes and moves pages of a | ||
18 | process that are located on the from nodes to the destination nodes. | ||
19 | |||
20 | Manual migration is very useful if for example the scheduler has relocated | ||
21 | a process to a processor on a distant node. A batch scheduler or an | ||
22 | administrator may detect the situation and move the pages of the process | ||
23 | nearer to the new processor. At some point in the future we may have | ||
24 | some mechanism in the scheduler that will automatically move the pages. | ||
25 | |||
26 | Larger installations usually partition the system using cpusets into | ||
27 | sections of nodes. Paul Jackson has equipped cpusets with the ability to | ||
28 | move pages when a task is moved to another cpuset. This allows automatic | ||
29 | control over locality of a process. If a task is moved to a new cpuset | ||
30 | then also all its pages are moved with it so that the performance of the | ||
31 | process does not sink dramatically (as is the case today). | ||
32 | |||
33 | Page migration allows the preservation of the relative location of pages | ||
34 | within a group of nodes for all migration techniques which will preserve a | ||
35 | particular memory allocation pattern generated even after migrating a | ||
36 | process. This is necessary in order to preserve the memory latencies. | ||
37 | Processes will run with similar performance after migration. | ||
38 | |||
39 | Page migration occurs in several steps. First a high level | ||
40 | description for those trying to use migrate_pages() and then | ||
41 | a low level description of how the low level details work. | ||
42 | |||
43 | A. Use of migrate_pages() | ||
44 | ------------------------- | ||
45 | |||
46 | 1. Remove pages from the LRU. | ||
47 | |||
48 | Lists of pages to be migrated are generated by scanning over | ||
49 | pages and moving them into lists. This is done by | ||
50 | calling isolate_lru_page() or __isolate_lru_page(). | ||
51 | Calling isolate_lru_page increases the references to the page | ||
52 | so that it cannot vanish under us. | ||
53 | |||
54 | 2. Generate a list of newly allocates page to move the contents | ||
55 | of the first list to. | ||
56 | |||
57 | 3. The migrate_pages() function is called which attempts | ||
58 | to do the migration. It returns the moved pages in the | ||
59 | list specified as the third parameter and the failed | ||
60 | migrations in the fourth parameter. The first parameter | ||
61 | will contain the pages that could still be retried. | ||
62 | |||
63 | 4. The leftover pages of various types are returned | ||
64 | to the LRU using putback_to_lru_pages() or otherwise | ||
65 | disposed of. The pages will still have the refcount as | ||
66 | increased by isolate_lru_pages()! | ||
67 | |||
68 | B. Operation of migrate_pages() | ||
69 | -------------------------------- | ||
70 | |||
71 | migrate_pages does several passes over its list of pages. A page is moved | ||
72 | if all references to a page are removable at the time. | ||
73 | |||
74 | Steps: | ||
75 | |||
76 | 1. Lock the page to be migrated | ||
77 | |||
78 | 2. Insure that writeback is complete. | ||
79 | |||
80 | 3. Make sure that the page has assigned swap cache entry if | ||
81 | it is an anonyous page. The swap cache reference is necessary | ||
82 | to preserve the information contain in the page table maps. | ||
83 | |||
84 | 4. Prep the new page that we want to move to. It is locked | ||
85 | and set to not being uptodate so that all accesses to the new | ||
86 | page immediately lock while we are moving references. | ||
87 | |||
88 | 5. All the page table references to the page are either dropped (file backed) | ||
89 | or converted to swap references (anonymous pages). This should decrease the | ||
90 | reference count. | ||
91 | |||
92 | 6. The radix tree lock is taken | ||
93 | |||
94 | 7. The refcount of the page is examined and we back out if references remain | ||
95 | otherwise we know that we are the only one referencing this page. | ||
96 | |||
97 | 8. The radix tree is checked and if it does not contain the pointer to this | ||
98 | page then we back out. | ||
99 | |||
100 | 9. The mapping is checked. If the mapping is gone then a truncate action may | ||
101 | be in progress and we back out. | ||
102 | |||
103 | 10. The new page is prepped with some settings from the old page so that accesses | ||
104 | to the new page will be discovered to have the correct settings. | ||
105 | |||
106 | 11. The radix tree is changed to point to the new page. | ||
107 | |||
108 | 12. The reference count of the old page is dropped because the reference has now | ||
109 | been removed. | ||
110 | |||
111 | 13. The radix tree lock is dropped. | ||
112 | |||
113 | 14. The page contents are copied to the new page. | ||
114 | |||
115 | 15. The remaining page flags are copied to the new page. | ||
116 | |||
117 | 16. The old page flags are cleared to indicate that the page does | ||
118 | not use any information anymore. | ||
119 | |||
120 | 17. Queued up writeback on the new page is triggered. | ||
121 | |||
122 | 18. If swap pte's were generated for the page then remove them again. | ||
123 | |||
124 | 19. The locks are dropped from the old and new page. | ||
125 | |||
126 | 20. The new page is moved to the LRU. | ||
127 | |||
128 | Christoph Lameter, December 19, 2005. | ||
129 | |||
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt index 9c5fc15d03d1..153740f460a6 100644 --- a/Documentation/x86_64/boot-options.txt +++ b/Documentation/x86_64/boot-options.txt | |||
@@ -40,6 +40,18 @@ APICs | |||
40 | no_timer_check Don't check the IO-APIC timer. This can work around | 40 | no_timer_check Don't check the IO-APIC timer. This can work around |
41 | problems with incorrect timer initialization on some boards. | 41 | problems with incorrect timer initialization on some boards. |
42 | 42 | ||
43 | apicmaintimer Run time keeping from the local APIC timer instead | ||
44 | of using the PIT/HPET interrupt for this. This is useful | ||
45 | when the PIT/HPET interrupts are unreliable. | ||
46 | |||
47 | noapicmaintimer Don't do time keeping using the APIC timer. | ||
48 | Useful when this option was auto selected, but doesn't work. | ||
49 | |||
50 | apicpmtimer | ||
51 | Do APIC timer calibration using the pmtimer. Implies | ||
52 | apicmaintimer. Useful when your PIT timer is totally | ||
53 | broken. | ||
54 | |||
43 | Early Console | 55 | Early Console |
44 | 56 | ||
45 | syntax: earlyprintk=vga | 57 | syntax: earlyprintk=vga |