aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-02-06 07:43:13 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-02-06 07:43:13 -0500
commitb2faf597d93bdf5e2d12d93ea0815935a73f749e (patch)
tree1876616290ff282b8a0814e2429d23e0104f3701 /Documentation
parent638e174688f58200d0deb7435093435e7d737b09 (diff)
parent410c05427a69f53851637ccb85c2212131409fbd (diff)
Merge branch 'origin'
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/RCU/RTFP.txt25
-rw-r--r--Documentation/RCU/checklist.txt6
-rw-r--r--Documentation/RCU/listRCU.txt21
-rw-r--r--Documentation/RCU/rcu.txt5
-rw-r--r--Documentation/RCU/rcuref.txt31
-rw-r--r--Documentation/RCU/whatisRCU.txt29
-rw-r--r--Documentation/cputopology.txt41
-rw-r--r--Documentation/driver-model/overview.txt57
-rw-r--r--Documentation/feature-removal-schedule.txt14
-rw-r--r--Documentation/filesystems/configfs/configfs_example.c2
-rw-r--r--Documentation/filesystems/ocfs2.txt1
-rw-r--r--Documentation/kernel-doc-nano-HOWTO.txt39
-rw-r--r--Documentation/kernel-parameters.txt5
-rw-r--r--Documentation/networking/ip-sysctl.txt17
-rw-r--r--Documentation/parport-lowlevel.txt8
-rw-r--r--Documentation/pci-error-recovery.txt472
-rw-r--r--Documentation/power/interface.txt2
-rw-r--r--Documentation/power/swsusp.txt2
-rw-r--r--Documentation/powerpc/booting-without-of.txt1420
-rw-r--r--Documentation/scsi/ChangeLog.megaraid_sas24
-rw-r--r--Documentation/scsi/aic79xx.txt93
-rw-r--r--Documentation/scsi/aic7xxx.txt86
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt10
-rw-r--r--Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl4
-rw-r--r--Documentation/sysctl/vm.txt56
-rw-r--r--Documentation/usb/et61x251.txt306
-rw-r--r--Documentation/usb/sn9c102.txt95
-rw-r--r--Documentation/usb/w9968cf.txt30
-rw-r--r--Documentation/vm/page_migration129
-rw-r--r--Documentation/x86_64/boot-options.txt12
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
90following year [McKenney02a], and use of RCU in dcache was first 90following year [McKenney02a], and use of RCU in dcache was first
91described that same year [Linder02a]. 91described that same year [Linder02a].
92 92
93Also in 2002, Michael [Michael02b,Michael02a] presented techniques 93Also in 2002, Michael [Michael02b,Michael02a] presented "hazard-pointer"
94that defer the destruction of data structures to simplify non-blocking 94techniques that defer the destruction of data structures to simplify
95synchronization (wait-free synchronization, lock-free synchronization, 95non-blocking synchronization (wait-free synchronization, lock-free
96and obstruction-free synchronization are all examples of non-blocking 96synchronization, and obstruction-free synchronization are all examples of
97synchronization). In particular, this technique eliminates locking, 97non-blocking synchronization). In particular, this technique eliminates
98reduces contention, reduces memory latency for readers, and parallelizes 98locking, reduces contention, reduces memory latency for readers, and
99pipeline stalls and memory latency for writers. However, these 99parallelizes pipeline stalls and memory latency for writers. However,
100techniques still impose significant read-side overhead in the form of 100these techniques still impose significant read-side overhead in the
101memory barriers. Researchers at Sun worked along similar lines in the 101form of memory barriers. Researchers at Sun worked along similar lines
102same timeframe [HerlihyLM02,HerlihyLMS03]. 102in the same timeframe [HerlihyLM02,HerlihyLMS03]. These techniques
103can be thought of as inside-out reference counts, where the count is
104represented by the number of hazard pointers referencing a given data
105structure (rather than the more conventional counter field within the
106data structure itself).
103 107
104In 2003, the K42 group described how RCU could be used to create 108In 2003, the K42 group described how RCU could be used to create
105hot-pluggable implementations of operating-system functions. Later that 109hot-pluggable implementations of operating-system functions. Later that
@@ -113,7 +117,6 @@ number of operating-system kernels [PaulEdwardMcKenneyPhD], a paper
113describing how to make RCU safe for soft-realtime applications [Sarma04c], 117describing how to make RCU safe for soft-realtime applications [Sarma04c],
114and a paper describing SELinux performance with RCU [JamesMorris04b]. 118and a paper describing SELinux performance with RCU [JamesMorris04b].
115 119
116
1172005 has seen further adaptation of RCU to realtime use, permitting 1202005 has seen further adaptation of RCU to realtime use, permitting
118preemption of RCU realtime critical sections [PaulMcKenney05a, 121preemption of RCU realtime critical sections [PaulMcKenney05a,
119PaulMcKenney05b]. 122PaulMcKenney05b].
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
18112. 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
232return holding the per-entry spinlock, as ipc_lock() does in fact do. 232return holding the per-entry spinlock, as ipc_lock() does in fact do.
233 233
234Quick Quiz: Why does the search function need to return holding the 234Quick Quiz: Why does the search function need to return holding the
235per-entry lock for this deleted-flag technique to be helpful? 235 per-entry lock for this deleted-flag technique to be helpful?
236 236
237If the system-call audit module were to ever need to reject stale data, 237If the system-call audit module were to ever need to reject stale data,
238one way to accomplish this would be to add a "deleted" flag and a "lock" 238one 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
306Answer to Quick Quiz 306Answer to Quick Quiz
307 307 Why does the search function need to return holding the per-entry
308If the search function drops the per-entry lock before returning, then 308 lock for this deleted-flag technique to be helpful?
309the caller will be processing stale data in any case. If it is really 309
310OK 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,
311If 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
312per-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 @@
1Refcounter design for elements of lists/arrays protected by RCU. 1Reference-count design for elements of lists/arrays protected by RCU.
2 2
3Refcounting on elements of lists which are protected by traditional 3Reference counting on elements of lists which are protected by traditional
4reader/writer spinlocks or semaphores are straight forward as in: 4reader/writer spinlocks or semaphores are straightforward:
5 5
61. 2. 61. 2.
7add() search_and_reference() 7add() search_and_reference()
@@ -28,12 +28,12 @@ release_referenced() delete()
28 ... 28 ...
29 } 29 }
30 30
31If this list/array is made lock free using rcu as in changing the 31If this list/array is made lock free using RCU as in changing the
32write_lock in add() and delete() to spin_lock and changing read_lock 32write_lock() in add() and delete() to spin_lock and changing read_lock
33in search_and_reference to rcu_read_lock(), the atomic_get in 33in search_and_reference to rcu_read_lock(), the atomic_get in
34search_and_reference could potentially hold reference to an element which 34search_and_reference could potentially hold reference to an element which
35has already been deleted from the list/array. atomic_inc_not_zero takes 35has already been deleted from the list/array. Use atomic_inc_not_zero()
36care of this scenario. search_and_reference should look as; 36in this scenario as follows:
37 37
381. 2. 381. 2.
39add() search_and_reference() 39add() search_and_reference()
@@ -51,17 +51,16 @@ add() search_and_reference()
51release_referenced() delete() 51release_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
63Sometimes, reference to the element need to be obtained in the 63Sometimes, a reference to the element needs to be obtained in the
64update (write) stream. In such cases, atomic_inc_not_zero might be an 64update (write) stream. In such cases, atomic_inc_not_zero() might be
65overkill since the spinlock serialising list updates are held. atomic_inc 65overkill, since we hold the update-side spinlock. One might instead
66is to be used in such cases. 66use 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
208rcu_dereference() 209rcu_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
266The following diagram shows how each API communicates among the 269The following diagram shows how each API communicates among the
@@ -327,7 +330,7 @@ for specialized uses, but are relatively uncommon.
3273. WHAT ARE SOME EXAMPLE USES OF CORE RCU API? 3303. WHAT ARE SOME EXAMPLE USES OF CORE RCU API?
328 331
329This section shows a simple use of the core RCU API to protect a 332This section shows a simple use of the core RCU API to protect a
330global pointer to a dynamically allocated structure. More typical 333global pointer to a dynamically allocated structure. More-typical
331uses of RCU may be found in listRCU.txt, arrayRCU.txt, and NMI-RCU.txt. 334uses 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
412See checklist.txt for additional rules to follow when using RCU. 415See checklist.txt for additional rules to follow when using RCU.
416And again, more-typical uses of RCU may be found in listRCU.txt,
417arrayRCU.txt, and NMI-RCU.txt.
413 418
414 419
4154. WHAT IF MY UPDATING THREAD CANNOT BLOCK? 4204. WHAT IF MY UPDATING THREAD CANNOT BLOCK?
@@ -513,7 +518,7 @@ production-quality implementation, and see:
513 518
514for papers describing the Linux kernel RCU implementation. The OLS'01 519for papers describing the Linux kernel RCU implementation. The OLS'01
515and OLS'02 papers are a good introduction, and the dissertation provides 520and OLS'02 papers are a good introduction, and the dissertation provides
516more details on the current implementation. 521more details on the current implementation as of early 2004.
517 522
518 523
5195A. "TOY" IMPLEMENTATION #1: LOCKING 5245A. "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
807Answer: Consider the following sequence of events: 811Answer: 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
894ACKNOWLEDGEMENTS 899ACKNOWLEDGEMENTS
895 900
896My thanks to the people who helped make this human-readable, including 901My thanks to the people who helped make this human-readable, including
897Jon Walpole, Josh Triplett, Serge Hallyn, and Suzanne Wood. 902Jon Walpole, Josh Triplett, Serge Hallyn, Suzanne Wood, and Alan Stern.
898 903
899 904
900For more information, see http://www.rdrop.com/users/paulmck/RCU. 905For 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
2Export cpu topology info by sysfs. Items (attributes) are similar
3to /proc/cpuinfo.
4
51) /sys/devices/system/cpu/cpuX/topology/physical_package_id:
6represent the physical package id of cpu X;
72) /sys/devices/system/cpu/cpuX/topology/core_id:
8represent the cpu core id to cpu X;
93) /sys/devices/system/cpu/cpuX/topology/thread_siblings:
10represent the thread siblings to cpu X in the same core;
114) /sys/devices/system/cpu/cpuX/topology/core_siblings:
12represent the thread siblings to cpu X in the same physical package;
13
14To implement it in an architecture-neutral way, a new source file,
15driver/base/topology.c, is to export the 5 attributes.
16
17If one architecture wants to support this feature, it just needs to
18implement 4 defines, typically in file include/asm-XXX/topology.h.
19The 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
25The type of **_id is int.
26The type of siblings is cpumask_t.
27
28To be consistent on all architectures, the 4 attributes should have
29deafult values if their values are unavailable. Below is the rule.
301) physical_package_id: If cpu has no physical package id, -1 is the
31default value.
322) core_id: If cpu doesn't support multi-core, its core id is 0.
333) thread_siblings: Just include itself, if the cpu doesn't support
34HT/multi-thread.
354) core_siblings: Just include itself, if the cpu doesn't support
36multi-core and HT/Multi-thread.
37
38So be careful when declaring the 4 defines in include/asm-XXX/topology.h.
39
40If 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 @@
1The Linux Kernel Device Model 1The Linux Kernel Device Model
2 2
3Patrick Mochel <mochel@osdl.org> 3Patrick Mochel <mochel@digitalimplant.org>
4 4
526 August 2002 5Drafted 26 August 2002
6Updated 31 January 2006
6 7
7 8
8Overview 9Overview
9~~~~~~~~ 10~~~~~~~~
10 11
11This driver model is a unification of all the current, disparate driver models 12The Linux Kernel Driver Model is a unification of all the disparate driver
12that are currently in the kernel. It is intended to augment the 13models that were previously used in the kernel. It is intended to augment the
13bus-specific drivers for bridges and devices by consolidating a set of data 14bus-specific drivers for bridges and devices by consolidating a set of data
14and operations into globally accessible data structures. 15and operations into globally accessible data structures.
15 16
16Current driver models implement some sort of tree-like structure (sometimes 17Traditional driver models implemented some sort of tree-like structure
17just 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
18the different bus types. 19uniformity across the different bus types.
19 20
20A common data structure can provide this linkage with little overhead: when a 21The current driver model provides a comon, uniform data model for describing
21bus driver discovers a particular device, it can insert it into the global 22a bus and the devices that can appear under the bus. The unified bus
22tree as well as its local tree. In fact, the local tree becomes just a subset 23model includes a set of common attributes which all busses carry, and a set
23of the global tree. 24of common callbacks, such as device discovery during bus probing, bus
24 25shutdown, bus power management, etc.
25Common data fields can also be moved out of the local bus models into the
26global model. Some of the manipulations of these fields can also be
27consolidated. Most likely, manipulation functions will become a set
28of helper functions, which the bus drivers wrap around to include any
29bus-specific items.
30
31The common device and bridge interface currently reflects the goals of the
32modern PC: namely the ability to do seamless Plug and Play, power management,
33and hot plug. (The model dictated by Intel and Microsoft (read: ACPI) ensures
34us that any device in the system may fit any of these criteria.)
35
36In reality, not every bus will be able to support such operations. But, most
37buses will support a majority of those operations, and all future buses will.
38In other words, a bus that doesn't support an operation is the exception,
39instead of the other way around.
40 26
27The common device and bridge interface reflects the goals of the modern
28computer: namely the ability to do seamless device "plug and play", power
29management, and hot plug. In particular, the model dictated by Intel and
30Microsoft (namely ACPI) ensures that almost every device on almost any bus
31on an x86-compatible system can work within this paradigm. Of course,
32not every bus is able to support all such operations, although most
33buses support a most of those operations.
41 34
42 35
43Downstream Access 36Downstream Access
44~~~~~~~~~~~~~~~~~ 37~~~~~~~~~~~~~~~~~
45 38
46Common data fields have been moved out of individual bus layers into a common 39Common data fields have been moved out of individual bus layers into a common
47data structure. But, these fields must still be accessed by the bus layers, 40data structure. These fields must still be accessed by the bus layers,
48and sometimes by the device-specific drivers. 41and sometimes by the device-specific drivers.
49 42
50Other bus layers are encouraged to do what has been done for the PCI layer. 43Other 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:
53struct pci_dev { 46struct pci_dev {
54 ... 47 ...
55 48
56 struct device device; 49 struct device dev;
57}; 50};
58 51
59Note first that it is statically allocated. This means only one allocation on 52Note first that it is statically allocated. This means only one allocation on
@@ -64,9 +57,9 @@ the two.
64 57
65The PCI bus layer freely accesses the fields of struct device. It knows about 58The PCI bus layer freely accesses the fields of struct device. It knows about
66the structure of struct pci_dev, and it should know the structure of struct 59the structure of struct pci_dev, and it should know the structure of struct
67device. PCI devices that have been converted generally do not touch the fields 60device. Individual PCI device drivers that have been converted the the current
68of struct device. More precisely, device-specific drivers should not touch 61driver model generally do not and should not touch the fields of struct device,
69fields of struct device unless there is a strong compelling reason to do so. 62unless there is a strong compelling reason to do so.
70 63
71This abstraction is prevention of unnecessary pain during transitional phases. 64This abstraction is prevention of unnecessary pain during transitional phases.
72If the name of the field changes or is removed, then every downstream driver 65If 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.
150Who: Ralf Baechle <ralf@linux-mips.org> 150Who: Ralf Baechle <ralf@linux-mips.org>
151
152---------------------------
153
154What: Legacy /proc/pci interface (PCI_LEGACY_PROC)
155When: March 2006
156Why: deprecated since 2.5.53 in favor of lspci(8)
157Who: Adrian Bunk <bunk@stusta.de>
158
159---------------------------
160
161What: pci_module_init(driver)
162When: January 2007
163Why: Is replaced by pci_register_driver(pci_driver).
164Who: 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
325static struct configfs_subsystem simple_children_subsys = { 326static 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
408static struct configfs_subsystem group_children_subsys = { 410static 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
46If you just want to read the ready-made books on the various 46If you just want to read the ready-made books on the various
47subsystems (see Documentation/DocBook/*.tmpl), just type 'make 47subsystems (see Documentation/DocBook/*.tmpl), just type 'make
48psdocs', or 'make pdfdocs', or 'make htmldocs', depending on your 48psdocs', or 'make pdfdocs', or 'make htmldocs', depending on your
49preference. If you would rather read a different format, you can type 49preference. 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
51Documentation/DocBook/*.sgml to a format of your choice (for example, 51Documentation/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
54If you want to see man pages instead, you can do this: 54If you want to see man pages instead, you can do this:
@@ -124,6 +124,36 @@ patterns, which are highlighted appropriately.
124Take a look around the source tree for examples. 124Take a look around the source tree for examples.
125 125
126 126
127kernel-doc for structs, unions, enums, and typedefs
128---------------------------------------------------
129
130Beside functions you can also write documentation for structs, unions,
131enums and typedefs. Instead of the function name you must write the name
132of the declaration; the struct/union/enum/typedef must always precede
133the name. Nesting of declarations is not supported.
134Use the argument mechanism to document members or constants.
135
136Inside a struct description, you can use the "private:" and "public:"
137comment tags. Structure fields that are inside a "private:" area
138are not listed in the generated output documentation.
139
140Example:
141
142/**
143 * struct my_struct - short description
144 * @a: first member
145 * @b: second member
146 *
147 * Longer description
148 */
149struct my_struct {
150 int a;
151 int b;
152/* private: */
153 int c;
154};
155
156
127How to make new SGML template files 157How to make new SGML template files
128----------------------------------- 158-----------------------------------
129 159
@@ -147,4 +177,3 @@ documentation, in <filename>, for the functions listed.
147 177
148Tim. 178Tim.
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
430icmp_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
430igmp_max_memberships - INTEGER 447igmp_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
1069struct parport_operations { 1069struct 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
1098struct parport_operations { 1098struct 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
10Some PCI bus controllers are able to detect certain "hard" PCI errors 10Many PCI bus controllers are able to detect a variety of hardware
11on the bus, such as parity errors on the data and address busses, as 11PCI errors on the bus, such as parity errors on the data and address
12well as SERR and PERR errors. These chipsets are then able to disable 12busses, as well as SERR and PERR errors. Some of the more advanced
13I/O to/from the affected device, so that, for example, a bad DMA 13chipsets are able to deal with these errors; these include PCI-E chipsets,
14address doesn't end up corrupting system memory. These same chipsets 14and the PCI-host bridges found on IBM Power4 and Power5-based pSeries
15are also able to reset the affected PCI device, and return it to 15boxes. A typical action taken is to disconnect the affected device,
16working condition. This document describes a generic API form 16halting all I/O to it. The goal of a disconnection is to avoid system
17performing error recovery. 17corruption; for example, to halt system memory corruption due to DMA's
18 18to "wild" addresses. Typically, a reconnection mechanism is also
19The core idea is that after a PCI error has been detected, there must 19offered, so that the affected PCI device(s) are reset and put back
20be a way for the kernel to coordinate with all affected device drivers 20into working condition. The reset phase requires coordination
21so that the pci card can be made operational again, possibly after 21between the affected device drivers and the PCI controller chip.
22performing a full electrical #RST of the PCI card. The API below 22This document describes a generic API for notifying device drivers
23provides a generic API for device drivers to be notified of PCI 23of a bus disconnection, and then performing error recovery.
24errors, and to be notified of, and respond to, a reset sequence. 24This API is currently implemented in the 2.6.16 and later kernels.
25 25
26Preliminary sketch of API, cut-n-pasted-n-modified email from 26Reporting and recovery is performed in several steps. First, when
27Ben Herrenschmidt, circa 5 april 2005 27a PCI hardware error has resulted in a bus disconnect, that event
28is reported as soon as possible to all affected device drivers,
29including multiple instances of a device driver on multi-function
30cards. This allows device drivers to avoid deadlocking in spinloops,
31waiting for some i/o-space register to change, when it never will.
32It also gives the drivers a chance to defer incoming I/O as
33needed.
34
35Next, recovery is performed in several stages. Most of the complexity
36is forced by the need to handle multi-function devices, that is,
37devices that have multiple device drivers associated with them.
38In the first stage, each driver is allowed to indicate what type
39of reset it desires, the choices being a simple re-enabling of I/O
40or requesting a hard reset (a full electrical #RST of the PCI card).
41If any driver requests a full reset, that is what will be done.
42
43After a full reset and/or a re-enabling of I/O, all drivers are
44again notified, so that they may then perform any device setup/config
45that may be required. After these have all completed, a final
46"resume normal operations" event is sent out.
47
48The biggest reason for choosing a kernel-based implementation rather
49than a user-space implementation was the need to deal with bus
50disconnects of PCI devices attached to storage media, and, in particular,
51disconnects from devices holding the root file system. If the root
52file system is disconnected, a user-space mechanism would have to go
53through a large number of contortions to complete recovery. Almost all
54of the current Linux file systems are not tolerant of disconnection
55from/reconnection to their underlying block device. By contrast,
56bus errors are easy to manage in the device driver. Indeed, most
57device drivers already handle very similar recovery procedures;
58for example, the SCSI-generic layer already provides significant
59mechanisms for dealing with SCSI bus errors and SCSI bus resets.
60
61
62Detailed Design
63---------------
64Design and implementation details below, based on a chain of
65public email discussions with Ben Herrenschmidt, circa 5 April 2005.
28 66
29The error recovery API support is exposed to the driver in the form of 67The error recovery API support is exposed to the driver in the form of
30a structure of function pointers pointed to by a new field in struct 68a structure of function pointers pointed to by a new field in struct
31pci_driver. The absence of this pointer in pci_driver denotes an 69pci_driver. A driver that fails to provide the structure is "non-aware",
32"non-aware" driver, behaviour on these is platform dependant. 70and the actual recovery steps taken are platform dependent. The
33Platforms like ppc64 can try to simulate pci hotplug remove/add. 71arch/powerpc implementation will simulate a PCI hotplug remove/add.
34
35The definition of "pci_error_token" is not covered here. It is based on
36Seto's work on the synchronous error detection. We still need to define
37functions for extracting infos out of an opaque error token. This is
38separate from this API.
39 72
40This structure has the form: 73This structure has the form:
41
42struct pci_error_handlers 74struct 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
51A driver doesn't have to implement all of these callbacks. The 83The possible channel states are:
52only mandatory one is error_detected(). If a callback is not 84enum pci_channel_state {
53implemented, the corresponding feature is considered unsupported. 85 pci_channel_io_normal, /* I/O channel is in normal state */
54For example, if mmio_enabled() and resume() aren't there, then the 86 pci_channel_io_frozen, /* I/O to channel is blocked */
55driver is assumed as not doing any direct recovery and requires 87 pci_channel_io_perm_failure, /* PCI card is dead */
88};
89
90Possible return values are:
91enum 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
99A driver does not have to implement all of these callbacks; however,
100if it implements any, it must implement error_detected(). If a callback
101is not implemented, the corresponding feature is considered unsupported.
102For example, if mmio_enabled() and resume() aren't there, then it
103is assumed that the driver is not doing any direct recovery and requires
56a reset. If link_reset() is not implemented, the card is assumed as 104a reset. If link_reset() is not implemented, the card is assumed as
57not caring about link resets, in which case, if recover is supported, 105not care about link resets. Typically a driver will want to know about
58the core can try recover (but not slot_reset() unless it really did 106a slot_reset().
59reset the slot). If slot_reset() is not supported, link_reset() can 107
60be called instead on a slot reset. 108The actual steps taken by a platform to recover from a PCI error
61 109event will be platform-dependent, but will follow the general
62At first, the call will always be : 110sequence described below.
63 111
64 1) error_detected() 112STEP 0: Error Event
65 113-------------------
66 Error detected. This is sent once after an error has been detected. At 114PCI bus error is detect by the PCI hardware. On powerpc, the slot
67this point, the device might not be accessible anymore depending on the 115is isolated, in that all I/O is blocked: all reads return 0xffffffff,
68platform (the slot will be isolated on ppc64). The driver may already 116all writes are ignored.
69have "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
71cleanup, waiting for pending stuff (timers, whatever, etc...) to 119STEP 1: Notification
72complete; it can take semaphores, schedule, etc... everything but touch 120--------------------
73the device. Within this function and after it returns, the driver 121Platform calls the error_detected() callback on every instance of
122every driver affected by the error.
123
124At this point, the device might not be accessible anymore, depending on
125the platform (the slot will be isolated on powerpc). The driver may
126already have "noticed" the error because of a failing I/O, but this
127is the proper "synchronization point", that is, it gives the driver
128a chance to cleanup, waiting for pending stuff (timers, whatever, etc...)
129to complete; it can take semaphores, schedule, etc... everything but
130touch the device. Within this function and after it returns, the driver
74shouldn't do any new IOs. Called in task context. This is sort of a 131shouldn'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: 134All drivers participating in this system must implement this call.
78 - PCIERR_RESULT_CAN_RECOVER: 135The 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) 147The next step taken will depend on the result codes returned by the
90 148drivers.
91So at this point, we have called error_detected() for all drivers 149
92on the segment that had the error. On ppc64, the slot is isolated. What 150If all drivers on the segment/slot return PCI_ERS_RESULT_CAN_RECOVER,
93happens now typically depends on the result from the drivers. If all 151then the platform should re-enable IOs on the slot (or do nothing in
94drivers on the segment/slot return PCIERR_RESULT_CAN_RECOVER, we would 152particular, if the platform doesn't isolate slots), and recovery
95re-enable IOs on the slot (or do nothing special if the platform doesn't 153proceeds to STEP 2 (MMIO Enable).
96isolate slots) and call 2). If not and we can reset slots, we go to 4), 154
97if neither, we have a dead slot. If it's an hotplug slot, we might 155If any driver requested a slot reset (by returning PCI_ERS_RESULT_NEED_RESET),
98"simulate" reset by triggering HW unplug/replug though. 156then recovery proceeds to STEP 4 (Slot Reset).
99 157
100>>> Current ppc64 implementation assumes that a device driver will 158If the platform is unable to recover the slot, the next step
101>>> *not* schedule or semaphore in this routine; the current ppc64 159is 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() 178STEP 2: MMIO Enabled
179-------------------
180The platform re-enables MMIO to the device (but typically not the
181DMA), and then calls the mmio_enabled() callback on all affected
182device drivers.
117 183
118 This is the "early recovery" call. IOs are allowed again, but DMA is 184This is the "early recovery" call. IOs are allowed again, but DMA is
119not (hrm... to be discussed, I prefer not), with some restrictions. This 185not (hrm... to be discussed, I prefer not), with some restrictions. This
120is NOT a callback for the driver to start operations again, only to 186is NOT a callback for the driver to start operations again, only to
121peek/poke at the device, extract diagnostic information, if any, and 187peek/poke at the device, extract diagnostic information, if any, and
122eventually do things like trigger a device local reset or some such, 188eventually do things like trigger a device local reset or some such,
123but not restart operations. This is sent if all drivers on a segment 189but not restart operations. This is callback is made if all drivers on
124agree that they can try to recover and no automatic link reset was 190a segment agree that they can try to recover and if no automatic link reset
125performed by the HW. If the platform can't just re-enable IOs without 191was performed by the HW. If the platform can't just re-enable IOs without
126a slot reset or a link reset, it doesn't call this callback and goes 192a slot reset or a link reset, it wont call this callback, and instead
127directly to 3) or 4). All IOs should be done _synchronously_ from 193will have gone directly to STEP 3 (Link Reset) or STEP 4 (Slot Reset)
128within this callback, errors triggered by them will be returned via 194
129the normal pci_check_whatever() api, no new error_detected() callback 195>>> The following is proposed; no platform implements this yet:
130will be issued due to an error happening here. However, such an error 196>>> Proposal: All I/O's should be done _synchronously_ from within
131might cause IOs to be re-blocked for the whole segment, and thus 197>>> this callback, errors triggered by them will be returned via
132invalidate the recovery that other devices on the same segment might 198>>> the normal pci_check_whatever() API, no new error_detected()
133have done, forcing the whole segment into one of the next states, 199>>> callback will be issued due to an error happening here. However,
134that 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
205The 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. 224The next step taken depends on the results returned by the drivers.
225If all drivers returned PCI_ERS_RESULT_RECOVERED, then the platform
226proceeds to either STEP3 (Link Reset) or to STEP 5 (Resume Operations).
227
228If any driver returned PCI_ERS_RESULT_NEED_RESET, then the platform
229proceeds 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
160a PCI Express specific state at this point and is done whenever a 234STEP 3: Link Reset
161non-fatal error has been detected that can be "solved" by resetting 235------------------
162the link. This call informs the driver of the reset and the driver 236The platform resets the link, and then calls the link_reset() callback
163should check if the device appears to be in working condition. 237on all affected device drivers. This is a PCI-Express specific state
164This function acts a bit like 2) mmio_enabled(), in that the driver 238and is done whenever a non-fatal error has been detected that can be
165is not supposed to restart normal driver I/O operations right away. 239"solved" by resetting the link. This call informs the driver of the
166Instead, it should just "probe" the device to check it's recoverability 240reset and the driver should check to see if the device appears to be
167status. If all is right, then the core will call resume() once all 241in working condition.
168drivers have ack'd link_reset(). 242
243The driver is not supposed to restart normal driver I/O operations
244at this point. It should limit itself to "probing" the device to
245check it's recoverability status. If all is right, then the platform
246will 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
251The 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
257STEP 4: Slot Reset
258------------------
259The platform performs a soft or hard reset of the device, and then
260calls the slot_reset() callback.
261
262A soft reset consists of asserting the adapter #RST line and then
263restoring the PCI BAR's and PCI configuration header to a state
264that is equivalent to what it would be after a fresh system
265power-on followed by power-on BIOS/system firmware initialization.
266If the platform supports PCI hotplug, then the reset might be
267performed by toggling the slot electrical power off/on.
172 268
173>>> The current ppc64 implementation does not implement this callback. 269It is important for the platform to restore the PCI config space
270to the "fresh poweron" state, rather than the "last state". After
271a slot reset, the device driver will almost always use its standard
272device initialization routines, and an unusual config space setup
273may result in hung devices, kernel panics, or silent data corruption.
174 274
175 4) slot_reset() 275This call gives drivers the chance to re-initialize the hardware
276(re-download firmware, etc.). At this point, the driver may assume
277that he card is in a fresh state and is fully functional. In
278particular, interrupt generation should work normally.
176 279
177 This is called after the slot has been soft or hard reset by the 280Drivers should not yet restart normal I/O processing operations
178platform. A soft reset consists of asserting the adapter #RST line 281at this point. If all device drivers report success on this
179and then restoring the PCI BARs and PCI configuration header. If the 282callback, the platform will call resume() to complete the sequence,
180platform supports PCI hotplug, then it might instead perform a hard 283and let the driver restart normal I/O processing.
181reset by toggling power on the slot off/on. This call gives drivers
182the chance to re-initialize the hardware (re-download firmware, etc.),
183but drivers shouldn't restart normal I/O processing operations at
184this point. (See note about interrupts; interrupts aren't guaranteed
185to be delivered until the resume() callback has been called). If all
186device drivers report success on this callback, the patform will call
187resume() to complete the error handling and let the driver restart
188normal I/O processing.
189 284
190A driver can still return a critical failure for this function if 285A driver can still return a critical failure for this function if
191it can't get the device operational after reset. If the platform 286it can't get the device operational after reset. If the platform
192previously tried a soft reset, it migh now try a hard reset (power 287previously tried a soft reset, it might now try a hard reset (power
193cycle) and then call slot_reset() again. It the device still can't 288cycle) and then call slot_reset() again. It the device still can't
194be recovered, there is nothing more that can be done; the platform 289be recovered, there is nothing more that can be done; the platform
195will typically report a "permanent failure" in such a case. The 290will typically report a "permanent failure" in such a case. The
196device will be considered "dead" in this case. 291device will be considered "dead" in this case.
197 292
198 Result codes: 293Drivers for multi-function cards will need to coordinate among
199 - PCIERR_RESULT_DISCONNECT 294themselves as to which driver instance will perform any "one-shot"
200 Same as above. 295or global device initialization. For example, the Symbios sym53cxx2
296driver 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.
208PCIERR_RESULT_RECOVERED from one of the 3 prevous callbacks.
209That basically tells the driver to restart activity, tht everything
210is back and running. No result code is taken into account here. If
211a new error happens, it will restart a new error handling process.
212 304
213That's it. I think this covers all the possibilities. The way those 305Platform proceeds either to STEP 5 (Resume Operations) or STEP 6 (Permanent
214callbacks are called is platform policy. A platform with no slot reset 306Failure).
215capability 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
313STEP 5: Resume Operations
314-------------------------
315The platform will call the resume() callback on all affected device
316drivers if all drivers on the segment have returned
317PCI_ERS_RESULT_RECOVERED from one of the 3 previous callbacks.
318The goal of this callback is to tell the driver to restart activity,
319that everything is back and running. This callback does not return
320a result code.
321
322At this point, if a new error happens, the platform will restart
323a new error recovery sequence.
324
325STEP 6: Permanent Failure
326-------------------------
327A "permanent failure" has occurred, and the platform cannot recover
328the device. The platform will call error_detected() with a
329pci_channel_state value of pci_channel_io_perm_failure.
330
331The device driver should, at this point, assume the worst. It should
332cancel all pending I/O, refuse all new I/O, returning -EIO to
333higher layers. The device driver should then clean up all of its
334memory and remove itself from kernel operations, much as it would
335during system shutdown.
336
337The platform will typically notify the system operator of the
338permanent failure in some way. If the device is hotplug-capable,
339the operator will probably want to remove and replace the device.
340Note, however, not all failures are truly "permanent". Some are
341caused by over-heating, some by a poorly seated card. Many
342PCI error events are caused by software bugs, e.g. DMA's to
343wild addresses or bogus split transactions due to programming
344errors. See the discussion in powerpc/eeh-pci-error-recovery.txt
345for additional detail on real-life experience of the causes of
346software errors.
347
348
349Conclusion; General Remarks
350---------------------------
351The way those callbacks are called is platform policy. A platform with
352no slot reset capability may want to just "ignore" drivers that can't
216recover (disconnect them) and try to let other cards on the same segment 353recover (disconnect them) and try to let other cards on the same segment
217recover. Keep in mind that in most real life cases, though, there will 354recover. Keep in mind that in most real life cases, though, there will
218be only one driver per segment. 355be only one driver per segment.
219 356
220Now, there is a note about interrupts. If you get an interrupt and your 357Now, a note about interrupts. If you get an interrupt and your
221device is dead or has been isolated, there is a problem :) 358device is dead or has been isolated, there is a problem :)
222 359The current policy is to turn this into a platform policy.
223After much thinking, I decided to leave that to the platform. That is, 360That is, the recovery API only requires that:
224the 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
227device on the segment starting from the error detection and until the 363device on the segment starting from the error detection and until the
228restart callback is sent, at which point interrupts are expected to be 364resume callback is sent, at which point interrupts are expected to be
229fully operational. 365fully 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,
232river that gets an interrupts after detecting an error, or that detects 368a driver that gets an interrupt after detecting an error, or that detects
233and error within the interrupt handler such that it prevents proper 369an error within the interrupt handler such that it prevents proper
234ack'ing of the interrupt (and thus removal of the source) should just 370ack'ing of the interrupt (and thus removal of the source) should just
235return IRQ_NOTHANDLED. It's up to the platform to deal with taht 371return IRQ_NOTHANDLED. It's up to the platform to deal with that
236condition, typically by masking the irq source during the duration of 372condition, typically by masking the IRQ source during the duration of
237the error handling. It is expected that the platform "knows" which 373the error handling. It is expected that the platform "knows" which
238interrupts are routed to error-management capable slots and can deal 374interrupts are routed to error-management capable slots and can deal
239with temporarily disabling that irq number during error processing (this 375with temporarily disabling that IRQ number during error processing (this
240isn't terribly complex). That means some IRQ latency for other devices 376isn't terribly complex). That means some IRQ latency for other devices
241sharing the interrupt, but there is simply no other way. High end 377sharing the interrupt, but there is simply no other way. High end
242platforms aren't supposed to share interrupts between many devices 378platforms aren't supposed to share interrupts between many devices
243anyway :) 379anyway :)
244 380
245 381>>> Implementation details for the powerpc platform are discussed in
246Revised: 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
395The 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
45the suspend-to-disk mechanism. It can be written a string 45the suspend-to-disk mechanism. It can be written a string
46representing a non-negative integer that will be used as an upper 46representing a non-negative integer that will be used as an upper
47limit of the image size, in megabytes. The suspend-to-disk mechanism will 47limit of the image size, in bytes. The suspend-to-disk mechanism will
48do its best to ensure the image size will not exceed that number. However, 48do its best to ensure the image size will not exceed that number. However,
49if this turns out to be impossible, it will try to suspend anyway using the 49if this turns out to be impossible, it will try to suspend anyway using the
50smallest image possible. In particular, if "0" is written to this file, the 50smallest 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
28echo platform > /sys/power/disk; echo disk > /sys/power/state 28echo platform > /sys/power/disk; echo disk > /sys/power/state
29 29
30If you want to limit the suspend image size to N megabytes, do 30If you want to limit the suspend image size to N bytes, do
31 31
32echo N > /sys/power/image_size 32echo 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
68I - Introduction
69================
70
71During the recent development of the Linux/ppc64 kernel, and more
72specifically, the addition of new platform types outside of the old
73IBM pSeries/iSeries pair, it was decided to enforce some strict rules
74regarding the kernel entry and bootloader <-> kernel interfaces, in
75order to avoid the degeneration that had become the ppc32 kernel entry
76point and the way a new platform should be added to the kernel. The
77legacy iSeries platform breaks those rules as it predates this scheme,
78but no new board support will be accepted in the main tree that
79doesn't follows them properly. In addition, since the advent of the
80arch/powerpc merged architecture for ppc32 and ppc64, new 32-bit
81platforms and 32-bit platforms which move into arch/powerpc will be
82required to use these rules as well.
83
84The main requirement that will be defined in more detail below is
85the presence of a device-tree whose format is defined after Open
86Firmware specification. However, in order to make life easier
87to embedded board vendors, the kernel doesn't require the device-tree
88to represent every device in the system and only requires some nodes
89and properties to be present. This will be described in detail in
90section III, but, for example, the kernel does not require you to
91create a node for every PCI device in the system. It is a requirement
92to have a node for PCI host bridges in order to provide interrupt
93routing informations and memory/IO ranges, among others. It is also
94recommended to define nodes for on chip devices and other busses that
95don't specifically fit in an existing OF specification. This creates a
96great flexibility in the way the kernel can then probe those and match
97drivers to device, without having to hard code all sorts of tables. It
98also makes it more flexible for board vendors to do minor hardware
99upgrades without significantly impacting the kernel code or cluttering
100it with special cases.
101
102
1031) 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
1592) Board support
160----------------
161
16264-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
18932-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
207NOTE: I believe the above will be true once Ben's done with the merge
208of 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
217NOTE: If ben doesn't merge the setup files, may need to change this to
218point 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
225II - The DT block format
226========================
227
228
229This chapter defines the actual format of the flattened device-tree
230passed to the kernel. The actual content of it and kernel requirements
231are described later. You can find example of code manipulating that
232format in various places, including arch/powerpc/kernel/prom_init.c
233which will generate a flattened device-tree from the Open Firmware
234representation, or the fs2dt utility which is part of the kexec tools
235which will generate one from a filesystem representation. It is
236expected that a bootloader like uboot provides a bit more support,
237that will be discussed later as well.
238
239Note: The block has to be in main memory. It has to be accessible in
240both real mode and virtual mode with no mapping other than main
241memory. If you are writing a simple flash bootloader, it should copy
242the block to RAM before passing it to the kernel.
243
244
2451) 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
252struct 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
3962) Device tree generalities
397---------------------------
398
399This device-tree itself is separated in two different blocks, a
400structure block and a strings block. Both need to be aligned to a 4
401byte boundary.
402
403First, let's quickly describe the device-tree concept before detailing
404the storage format. This chapter does _not_ describe the detail of the
405required types of nodes & properties for the kernel, this is done
406later in chapter III.
407
408The device-tree layout is strongly inherited from the definition of
409the Open Firmware IEEE 1275 device-tree. It's basically a tree of
410nodes, each node having two or more named properties. A property can
411have a value or not.
412
413It is a tree, so each node has one and only one parent except for the
414root node who has no parent.
415
416A node has 2 names. The actual node name is generally contained in a
417property of type "name" in the node property list whose value is a
418zero terminated string and is mandatory for version 1 to 3 of the
419format definition (as it is in Open Firmware). Version 0x10 makes it
420optional as it can generate it from the unit name defined below.
421
422There is also a "unit name" that is used to differenciate nodes with
423the same name at the same level, it is usually made of the node
424name's, the "@" sign, and a "unit address", which definition is
425specific to the bus type the node sits on.
426
427The unit name doesn't exist as a property per-se but is included in
428the device-tree structure. It is typically used to represent "path" in
429the device-tree. More details about the actual format of these will be
430below.
431
432The kernel powerpc generic code does not make any formal use of the
433unit address (though some board support code may do) so the only real
434requirement here for the unit address is to ensure uniqueness of
435the node unit name at a given level of the tree. Nodes with no notion
436of 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,
438or use the "@0" default unit address. The unit name is used to define
439a node "full path", which is the concatenation of all parent node
440unit names separated with "/".
441
442The root node doesn't have a defined name, and isn't required to have
443a name property either if you are using version 3 or earlier of the
444format. It also has no unit address (no @ symbol followed by a unit
445address). The root node unit name is thus an empty string. The full
446path to the root node is "/".
447
448Every node which actually represents an actual device (that is, a node
449which isn't only a virtual "container" for more nodes, like "/cpus"
450is) is also required to have a "device_type" property indicating the
451type of node .
452
453Finally, every node that can be referenced from a property in another
454node is required to have a "linux,phandle" property. Real open
455firmware implementations provide a unique "phandle" value for every
456node that the "prom_init()" trampoline code turns into
457"linux,phandle" properties. However, this is made optional if the
458flattened device tree is used directly. An example of a node
459referencing another node via "phandle" is when laying out the
460interrupt tree which will be described in a further version of this
461document.
462
463This "linux, phandle" property is a 32 bit value that uniquely
464identifies a node. You are free to use whatever values or system of
465values, internal pointers, or whatever to generate these, the only
466requirement is that every node for which you provide that property has
467a unique value for it.
468
469Here is an example of a simple device-tree. In this example, an "o"
470designates a node followed by the node unit name. Properties are
471presented with their name followed by their content. "content"
472represents an ASCII string (zero terminated) value, while <content>
473represents a 32 bit hexadecimal value. The various nodes in this
474example will be discussed in a later chapter. At this point, it is
475only meant to give you a idea of what a device-tree looks like. I have
476purposefully kept the "name" and "linux,phandle" properties which
477aren't necessary in order to give you a better idea of what the tree
478looks 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
514This tree is almost a minimal tree. It pretty much contains the
515minimal set of required nodes and properties to boot a linux kernel;
516that is, some basic model informations at the root, the CPUs, and the
517physical memory layout. It also includes misc information passed
518through /chosen, like in this example, the platform type (mandatory)
519and the kernel command line arguments (optional).
520
521The /cpus/PowerPC,970@0/linux,boot-cpu property is an example of a
522property without a value. All other properties have a value. The
523significance of the #address-cells and #size-cells properties will be
524explained in chapter IV which defines precisely the required nodes and
525properties and their content.
526
527
5283) Device tree "structure" block
529
530The 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"
532ends 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
534bit value. The tree has to be "finished" with a OF_DT_END token
535
536Here'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
554So the node content can be summmarised as a start token, a full path,
555a list of properties, a list of child node and an end token. Every
556child node is a full node structure itself as defined above.
557
5584) Device tree 'strings" block
559
560In order to save space, property names, which are generally redundant,
561are stored separately in the "strings" block. This block is simply the
562whole bunch of zero terminated strings for all property names
563concatenated together. The device-tree property definitions in the
564structure block will contain offset values from the beginning of the
565strings block.
566
567
568III - Required content of the device tree
569=========================================
570
571WARNING: All "linux,*" properties defined in this document apply only
572to a flattened device-tree. If your platform uses a real
573implementation of Open Firmware or an implementation compatible with
574the Open Firmware client interface, those properties will be created
575by the trampoline code in the kernel's prom_init() file. For example,
576that's where you'll have to add code to detect your board model and
577set the platform number. However, when using the flatenned device-tree
578entry point, there is no prom_init() pass, and thus you have to
579provide those properties yourself.
580
581
5821) Note about cells and address representation
583----------------------------------------------
584
585The general rule is documented in the various Open Firmware
586documentations. If you chose to describe a bus with the device-tree
587and there exist an OF bus binding, then you should follow the
588specification. However, the kernel does not require every single
589device or bus to be described by the device tree.
590
591In general, the format of an address for a device is defined by the
592parent bus type, based on the #address-cells and #size-cells
593property. In the absence of such a property, the parent's parent
594values are used, etc... The kernel requires the root node to have
595those properties defining addresses format for devices directly mapped
596on the processor bus.
597
598Those 2 properties define 'cells' for representing an address and a
599size. A "cell" is a 32 bit number. For example, if both contain 2
600like the example tree given above, then an address and a size are both
601composed of 2 cells, and each is a 64 bit number (cells are
602concatenated and expected to be in big endian format). Another example
603is the way Apple firmware defines them, with 2 cells for an address
604and 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.
606Some 32-bit processors allow for physical addresses greater than 32
607bits; these processors should define #address-cells as 2.
608
609"reg" properties are always a tuple of the type "address size" where
610the number of cells of address and size is specified by the bus
611#address-cells and #size-cells. When a bus supports various address
612spaces and other flags relative to a given address allocation (like
613prefetchable, etc...) those flags are usually added to the top level
614bits of the physical address. For example, a PCI physical address is
615made of 3 cells, the bottom two containing the actual address itself
616while the top cell contains address space indication, flags, and pci
617bus & device numbers.
618
619For busses that support dynamic allocation, it's the accepted practice
620to then not provide the address in "reg" (keep it 0) though while
621providing a flag indicating the address is dynamically allocated, and
622then, to provide a separate "assigned-addresses" property that
623contains the fully allocated addresses. See the PCI OF bindings for
624details.
625
626In general, a simple bus with no address space bits and no dynamic
627allocation is preferred if it reflects your hardware, as the existing
628kernel address parsing functions will work out of the box. If you
629define a bus type with a more complex address format, including things
630like address space bits, you'll have to add a bus translator to the
631prom_parse.c file of the recent kernels for your bus type.
632
633The "reg" property only defines addresses and sizes (if #size-cells
634is
635non-0) within a given bus. In order to translate addresses upward
636(that is into parent bus addresses, and possibly into cpu physical
637addresses), all busses must contain a "ranges" property. If the
638"ranges" property is missing at a given level, it's assumed that
639translation isn't possible. The format of the "ranges" proprety for a
640bus 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,
645that is, for a PCI bridge, it would be a PCI address. Thus, (bus
646address, size) defines a range of addresses for child devices. "parent
647bus address" is in the format of the parent bus of this bus. For
648example, for a PCI host controller, that would be a CPU address. For a
649PCI<->ISA bridge, that would be a PCI address. It defines the base
650address in the parent bus where the beginning of that range is mapped.
651
652For a new 64 bit powerpc board, I recommend either the 2/2 format or
653Apple's 2/1 format which is slightly more compact since sizes usually
654fit in a single 32 bit word. New 32 bit powerpc boards should use a
6551/1 format, unless the processor supports physical addresses greater
656than 32-bits, in which case a 2/1 format is recommended.
657
658
6592) Note about "compatible" properties
660-------------------------------------
661
662These properties are optional, but recommended in devices and the root
663node. The format of a "compatible" property is a list of concatenated
664zero terminated strings. They allow a device to express its
665compatibility with a family of similar devices, in some cases,
666allowing a single driver to match against several devices regardless
667of their actual names.
668
6693) Note about "name" properties
670-------------------------------
671
672While earlier users of Open Firmware like OldWorld macintoshes tended
673to use the actual device name for the "name" property, it's nowadays
674considered a good practice to use a name that is closer to the device
675class (often equal to device_type). For example, nowadays, ethernet
676controllers are named "ethernet", an additional "model" property
677defining precisely the chip type/model, and "compatible" property
678defining the family in case a single driver can driver more than one
679of these chips. However, the kernel doesn't generally put any
680restriction on the "name" property; it is simply considered good
681practice to follow the standard and its evolutions as closely as
682possible.
683
684Note also that the new format version 16 makes the "name" property
685optional. If it's absent for a node, then the node's unit name is then
686used to reconstruct the name. That is, the part of the unit name
687before the "@" sign is used (or the entire unit name if no "@" sign
688is present).
689
6904) Note about node and property names and character set
691-------------------------------------------------------
692
693While open firmware provides more flexibe usage of 8859-1, this
694specification enforces more strict rules. Nodes and properties should
695be comprised only of ASCII characters 'a' to 'z', '0' to
696'9', ',', '.', '_', '+', '#', '?', and '-'. Node names additionally
697allow uppercase characters 'A' to 'Z' (property names should be
698lowercase. The fact that vendors like Apple don't respect this rule is
699irrelevant here). Additionally, node and property names should always
700begin with a character in the range 'a' to 'z' (or 'A' to 'Z' for node
701names).
702
703The maximum number of characters for both nodes and property names
704is 31. In the case of node names, this is only the leftmost part of
705a unit name (the pure "name" property), it doesn't include the unit
706address which can extend beyond that limit.
707
708
7095) 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
911SOC.
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
926IV - "dtc", the device tree compiler
927====================================
928
929
930dtc source code can be found at
931<http://ozlabs.org/~dgibson/dtc/dtc.tar.gz>
932
933WARNING: This version is still in early development stage; the
934resulting device-tree "blobs" have not yet been validated with the
935kernel. The current generated bloc lacks a useful reserve map (it will
936be fixed to generate an empty one, it's up to the bootloader to fill
937it up) among others. The error handling needs work, bugs are lurking,
938etc...
939
940dtc basically takes a device-tree in a given format and outputs a
941device-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
967The 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
973The "output_version" defines what versio of the "blob" format will be
974generated. Supported versions are 1,2,3 and 16. The default is
975currently version 3 but that may change in the future to version 16.
976
977Additionally, dtc performs various sanity checks on the tree, like the
978uniqueness of linux,phandle properties, validity of strings, etc...
979
980The format of the .dts "source" file is "C" like, supports C and C++
981style commments.
982
983/ {
984}
985
986The above is the "device-tree" definition. It's the only statement
987supported 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
1019Nodes can contain other nodes etc... thus defining the hierarchical
1020structure of the tree.
1021
1022Strings support common escape sequences from C: "\n", "\t", "\r",
1023"\(octal value)", "\x(hex value)".
1024
1025It is also suggested that you pipe your source file through cpp (gcc
1026preprocessor) so you can use #include's, #define for constants, etc...
1027
1028Finally, various options are planned but not yet implemented, like
1029automatic generation of phandles, labels (exported to the asm file so
1030you can point to a property content and change it easily from whatever
1031you link the device-tree with), label or path instead of numeric value
1032in some cells to "point" to a node (replaced by a phandle at compile
1033time), export of reserve map address to the asm file, ability to
1034specify reserve map content at compile time, etc...
1035
1036We may provide a .h include file with common definitions of that
1037proves useful for some properties (like building PCI properties or
1038interrupt maps) though it may be better to add a notion of struct
1039definitions to the compiler...
1040
1041
1042V - Recommendations for a bootloader
1043====================================
1044
1045
1046Here are some various ideas/recommendations that have been proposed
1047while 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
1074VI - System-on-a-chip devices and nodes
1075=======================================
1076
1077Many companies are now starting to develop system-on-a-chip
1078processors, where the processor core (cpu) and many peripheral devices
1079exist on a single piece of silicon. For these SOCs, an SOC node
1080should be used that defines child nodes for the devices that make
1081up the SOC. While platforms are not required to use this model in
1082order to boot the kernel, it is highly encouraged that all SOC
1083implementations define as complete a flat-device-tree as possible to
1084describe the devices on the SOC. This will allow for the
1085genericization of much of the kernel code.
1086
1087
10881) Defining child nodes of an SOC
1089---------------------------------
1090
1091Each device that is part of an SOC may have its own node entry inside
1092the SOC node. For each device that is included in the SOC, the unit
1093address property represents the address offset for this device's
1094memory-mapped registers in the parent's address space. The parent's
1095address space is defined by the "ranges" property in the top-level soc
1096node. The "reg" property for each node that exists directly under the
1097SOC node should contain the address mapping from the child address space
1098to the parent SOC address space and the size of the device's
1099memory-mapped register file.
1100
1101For many devices that may exist inside an SOC, there are predefined
1102specifications for the format of the device tree node. All SOC child
1103nodes should follow these specifications, except where noted in this
1104document.
1105
1106See appendix A for an example partial SOC node definition for the
1107MPC8540.
1108
1109
11102) Specifying interrupt information for SOC devices
1111---------------------------------------------------
1112
1113Each device that is part of an SOC and which generates interrupts
1114should 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
1122This information is used by the kernel to build the interrupt table
1123for the interrupt controllers in the system.
1124
1125Sense 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
11453) Representing devices without a current OF specification
1146----------------------------------------------------------
1147
1148Currently, there are many devices on SOCs that do not have a standard
1149representation pre-defined as part of the open firmware
1150specifications, mainly because the boards that contain these SOCs are
1151not currently booted using open firmware. This section contains
1152descriptions for the SOC devices for which new nodes have been
1153defined; this list will expand as more and more SOC-containing
1154platforms 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
1306Appendix A - Sample SOC node for MPC8540
1307========================================
1308
1309Note that the #address-cells and #size-cells for the SoC node
1310in this example have been explicitly listed; these are likely
1311not 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 @@
11 Release Date : Mon Jan 23 14:09:01 PST 2006 - Sumant Patro <Sumant.Patro@lsil.com>
22 Current Version : 00.00.02.02
33 Older Version : 00.00.02.01
4
5i. 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
101 Release Date : Mon Dec 19 14:36:26 PST 2005 - Sumant Patro <Sumant.Patro@lsil.com>
112 Current Version : 00.00.02.00-rc4
123 Older Version : 00.00.02.01
13
14i. 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
20ii. 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)
642. Version History 642. 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
4145. Contacting Adaptec 4195. 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
3163. Contacting Adaptec 3164. 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-&gt;dma_private. You can cast 5210 substream-&gt;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
127zone_reclaim_mode: 128zone_reclaim_mode:
128 129
129This is set during bootup to 1 if it is determined that pages from 130Zone_reclaim_mode allows to set more or less agressive approaches to
130remote zones will cause a significant performance reduction. The 131reclaim memory when a zone runs out of memory. If it is set to zero then no
132zone reclaim occurs. Allocations will be satisfied from other zones / nodes
133in the system.
134
135This is value ORed together of
136
1371 = Zone reclaim on
1382 = Zone reclaim writes dirty pages out
1394 = Zone reclaim swaps pages
1408 = Also do a global slab reclaim pass
141
142zone_reclaim_mode is set during bootup to 1 if it is determined that pages
143from remote zones will cause a measurable performance reduction. The
131page allocator will then reclaim easily reusable pages (those page 144page allocator will then reclaim easily reusable pages (those page
132cache pages that are currently not used) before going off node. 145cache pages that are currently not used) before allocating off node pages.
146
147It may be beneficial to switch off zone reclaim if the system is
148used for a file server and all of memory should be used for caching files
149from disk. In that case the caching effect is more important than
150data locality.
151
152Allowing zone reclaim to write out pages stops processes that are
153writing large amounts of data from dirtying pages on other nodes. Zone
154reclaim will write out dirty pages if a zone fills up and so effectively
155throttle the process. This may decrease the performance of a single process
156since it cannot use all of system memory to buffer the outgoing writes
157anymore but it preserve the memory on other nodes so that the performance
158of other processes running on other nodes will not be affected.
159
160Allowing regular swap effectively restricts allocations to the local
161node unless explicitly overridden by memory policies or cpuset
162configurations.
163
164It may be advisable to allow slab reclaim if the system makes heavy
165use of files and builds up large slab caches. However, the slab
166shrink operation is global, may take a long time and free slabs
167in all nodes of the system.
168
169================================================================
170
171zone_reclaim_interval:
172
173The time allowed for off node allocations after zone reclaim
174has failed to reclaim enough pages to allow a local allocation.
133 175
134The user can override this setting. It may be beneficial to switch 176Time is set in seconds and set by default to 30 seconds.
135off zone reclaim if the system is used for a file server and all
136of memory should be used for caching files from disk.
137 177
138It may be beneficial to switch this on if one wants to do zone 178Reduce the interval if undesired off node allocations occur. However, too
139reclaim regardless of the numa distances in the system. 179frequent 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
9Index
10=====
111. Copyright
122. Disclaimer
133. License
144. Overview and features
155. Module dependencies
166. Module loading
177. Module parameters
188. Optional device control through "sysfs"
199. Supported devices
2010. Notes for V4L2 application developers
2111. Contact information
22
23
241. Copyright
25============
26Copyright (C) 2006 by Luca Risolia <luca.risolia@studio.unibo.it>
27
28
292. Disclaimer
30=============
31Etoms is a trademark of Etoms Electronics Corp.
32This software is not developed or sponsored by Etoms Electronics.
33
34
353. License
36==========
37This program is free software; you can redistribute it and/or modify
38it under the terms of the GNU General Public License as published by
39the Free Software Foundation; either version 2 of the License, or
40(at your option) any later version.
41
42This program is distributed in the hope that it will be useful,
43but WITHOUT ANY WARRANTY; without even the implied warranty of
44MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45GNU General Public License for more details.
46
47You should have received a copy of the GNU General Public License
48along with this program; if not, write to the Free Software
49Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
50
51
524. Overview and features
53========================
54This driver supports the video interface of the devices mounting the ET61X151
55or ET61X251 PC Camera Controllers.
56
57It's worth to note that Etoms Electronics has never collaborated with the
58author during the development of this project; despite several requests,
59Etoms Electronics also refused to release enough detailed specifications of
60the video compression engine.
61
62The driver relies on the Video4Linux2 and USB core modules. It has been
63designed to run properly on SMP systems as well.
64
65The latest version of the ET61X[12]51 driver can be found at the following URL:
66http://www.linux-projects.org/
67
68Some 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
975. Module dependencies
98======================
99For it to work properly, the driver needs kernel support for Video4Linux and
100USB.
101
102The following options of the kernel configuration file must be enabled and
103corresponding modules must be compiled:
104
105 # Multimedia devices
106 #
107 CONFIG_VIDEO_DEV=m
108
109To 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
119In addition, depending on the hardware being used, the modules below are
120necessary:
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
128And finally:
129
130 # USB Multimedia devices
131 #
132 CONFIG_USB_ET61X251=m
133
134
1356. Module loading
136=================
137To use the driver, it is necessary to load the "et61x251" module into memory
138after every other module required: "videodev", "usbcore" and, depending on
139the USB host controller you have, "ehci-hcd", "uhci-hcd" or "ohci-hcd".
140
141Loading can be done as shown below:
142
143 [root@localhost home]# modprobe et61x251
144
145At this point the devices should be recognized. You can invoke "dmesg" to
146analyze kernel messages and verify that the loading process has gone well:
147
148 [user@localhost home]$ dmesg
149
150
1517. Module parameters
152====================
153Module parameters are listed below:
154-------------------------------------------------------------------------------
155Name: video_nr
156Type: short array (min = 0, max = 64)
157Syntax: <-1|n[,...]>
158Description: 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.
166Default: -1
167-------------------------------------------------------------------------------
168Name: force_munmap
169Type: bool array (min = 0, max = 64)
170Syntax: <0|1[,...]>
171Description: 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)
177Default: 0
178-------------------------------------------------------------------------------
179Name: debug
180Type: ushort
181Syntax: <n>
182Description: 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.
191Default: 2
192-------------------------------------------------------------------------------
193
194
1958. Optional device control through "sysfs"
196==========================================
197If the kernel has been compiled with the CONFIG_VIDEO_ADV_DEBUG option enabled,
198it is possible to read and write both the ET61X[12]51 and the image sensor
199registers by using the "sysfs" filesystem interface.
200
201There are four files in the /sys/class/video4linux/videoX directory for each
202registered camera: "reg", "val", "i2c_reg" and "i2c_val". The first two files
203control 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
205following 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
207are doing. Remember that you must be logged in as root before writing to them.
208
209As an example, suppose we were to want to read the value contained in the
210register number 1 of the sensor register table - which is usually the product
211identifier - 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
217Note that if the sensor registers can not be read, "cat" will fail.
218To avoid race conditions, all the I/O accesses to the files are serialized.
219
220
2219. Supported devices
222====================
223None of the names of the companies as well as their products will be mentioned
224here. They have never collaborated with the author, so no advertising.
225
226From the point of view of a driver, what unambiguously identify a device are
227its vendor and product USB identifiers. Below is a list of known identifiers of
228devices mounting the ET61X[12]51 PC camera controllers:
229
230Vendor ID Product ID
231--------- ----------
2320x102c 0x6151
2330x102c 0x6251
2340x102c 0x6253
2350x102c 0x6254
2360x102c 0x6255
2370x102c 0x6256
2380x102c 0x6257
2390x102c 0x6258
2400x102c 0x6259
2410x102c 0x625a
2420x102c 0x625b
2430x102c 0x625c
2440x102c 0x625d
2450x102c 0x625e
2460x102c 0x625f
2470x102c 0x6260
2480x102c 0x6261
2490x102c 0x6262
2500x102c 0x6263
2510x102c 0x6264
2520x102c 0x6265
2530x102c 0x6266
2540x102c 0x6267
2550x102c 0x6268
2560x102c 0x6269
257
258The following image sensors are supported:
259
260Model Manufacturer
261----- ------------
262TAS5130D1B Taiwan Advanced Sensor Corporation
263
264All the available control settings of each image sensor are supported through
265the V4L2 interface.
266
267
26810. Notes for V4L2 application developers
269========================================
270This driver follows the V4L2 API specifications. In particular, it enforces two
271rules:
272
273- exactly one I/O method, either "mmap" or "read", is associated with each
274file descriptor. Once it is selected, the application must close and reopen the
275device to switch to the other I/O method;
276
277- although it is not mandatory, previously mapped buffer memory should always
278be unmapped before calling any "VIDIOC_S_CROP" or "VIDIOC_S_FMT" ioctl's.
279The same number of buffers as before will be allocated again to match the size
280of the new video frames, so you have to map the buffers again before any I/O
281attempts on them.
282
283Consistently with the hardware limits, this driver also supports image
284downscaling with arbitrary scaling factors from 1 and 2 in both directions.
285However, the V4L2 API specifications don't correctly define how the scaling
286factor can be chosen arbitrarily by the "negotiation" of the "source" and
287"target" rectangles. To work around this flaw, we have added the convention
288that, during the negotiation, whenever the "VIDIOC_S_CROP" ioctl is issued, the
289scaling factor is restored to 1.
290
291This driver supports two different video formats: the first one is the "8-bit
292Sequential Bayer" format and can be used to obtain uncompressed video data
293from 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
295compressed data). The current compression quality may vary from 0 to 1 and can
296be selected or queried thanks to the VIDIOC_S_JPEGCOMP and VIDIOC_G_JPEGCOMP
297V4L2 ioctl's.
298
299
30011. Contact information
301=======================
302The author may be contacted by e-mail at <luca.risolia@studio.unibo.it>.
303
304GPG/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;
306the 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
177. Module parameters 177. Module parameters
188. Optional device control through "sysfs" 188. Optional device control through "sysfs"
199. Supported devices 199. Supported devices
2010. How to add plug-in's for new image sensors 2010. Notes for V4L2 application developers
2111. Notes for V4L2 application developers 2111. Video frame formats
2212. Video frame formats 2212. Contact information
2313. Contact information 2313. Credits
2414. Credits
25 24
26 25
271. Copyright 261. Copyright
28============ 27============
29Copyright (C) 2004-2005 by Luca Risolia <luca.risolia@studio.unibo.it> 28Copyright (C) 2004-2006 by Luca Risolia <luca.risolia@studio.unibo.it>
30 29
31 30
322. Disclaimer 312. Disclaimer
@@ -54,9 +53,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
54 53
554. Overview and features 544. Overview and features
56======================== 55========================
57This driver attempts to support the video and audio streaming capabilities of 56This driver attempts to support the video interface of the devices mounting the
58the devices mounting the SONiX SN9C101, SN9C102 and SN9C103 PC Camera 57SONiX SN9C101, SN9C102 and SN9C103 PC Camera Controllers.
59Controllers.
60 58
61It's worth to note that SONiX has never collaborated with the author during the 59It's worth to note that SONiX has never collaborated with the author during the
62development of this project, despite several requests for enough detailed 60development 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
114To 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
133The SN9C103 controller also provides a built-in microphone interface. It is
134supported 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
128And finally: 148And 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:
153Module parameters are listed below: 173Module parameters are listed below:
154------------------------------------------------------------------------------- 174-------------------------------------------------------------------------------
155Name: video_nr 175Name: video_nr
156Type: int array (min = 0, max = 64) 176Type: short array (min = 0, max = 64)
157Syntax: <-1|n[,...]> 177Syntax: <-1|n[,...]>
158Description: Specify V4L2 minor mode number: 178Description: 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.
166Default: -1 186Default: -1
167------------------------------------------------------------------------------- 187-------------------------------------------------------------------------------
168Name: force_munmap; 188Name: force_munmap
169Type: bool array (min = 0, max = 64) 189Type: bool array (min = 0, max = 64)
170Syntax: <0|1[,...]> 190Syntax: <0|1[,...]>
171Description: Force the application to unmap previously mapped buffer memory 191Description: 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)
177Default: 0 197Default: 0
178------------------------------------------------------------------------------- 198-------------------------------------------------------------------------------
179Name: debug 199Name: debug
180Type: int 200Type: ushort
181Syntax: <n> 201Syntax: <n>
182Description: Debugging information level, from 0 to 3: 202Description: 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.
191Default: 2 211Default: 2
192------------------------------------------------------------------------------- 212-------------------------------------------------------------------------------
193 213
194 214
1958. Optional device control through "sysfs" [1] 2158. Optional device control through "sysfs" [1]
196========================================== 216==========================================
197It is possible to read and write both the SN9C10x and the image sensor 217If the kernel has been compiled with the CONFIG_VIDEO_ADV_DEBUG option enabled,
218it is possible to read and write both the SN9C10x and the image sensor
198registers by using the "sysfs" filesystem interface. 219registers by using the "sysfs" filesystem interface.
199 220
200Every time a supported device is recognized, a write-only file named "green" is 221Every time a supported device is recognized, a write-only file named "green" is
@@ -236,7 +257,7 @@ serialized.
236 257
237The sysfs interface also provides the "frame_header" entry, which exports the 258The sysfs interface also provides the "frame_header" entry, which exports the
238frame header of the most recent requested and captured video frame. The header 259frame header of the most recent requested and captured video frame. The header
239is 12-bytes long and is appended to every video frame by the SN9C10x 260is always 18-bytes long and is appended to every video frame by the SN9C10x
240controllers. As an example, this additional information can be used by the user 261controllers. As an example, this additional information can be used by the user
241application for implementing auto-exposure features via software. 262application for implementing auto-exposure features via software.
242 263
@@ -250,7 +271,8 @@ Byte # Value Description
2500x03 0xC4 Frame synchronisation pattern. 2710x03 0xC4 Frame synchronisation pattern.
2510x04 0xC4 Frame synchronisation pattern. 2720x04 0xC4 Frame synchronisation pattern.
2520x05 0x96 Frame synchronisation pattern. 2730x05 0x96 Frame synchronisation pattern.
2530x06 0x00 or 0x01 Unknown meaning. The exact value depends on the chip. 2740x06 0xXX Unknown meaning. The exact value depends on the chip;
275 possible values are 0x00, 0x01 and 0x20.
2540x07 0xXX Variable value, whose bits are ff00uzzc, where ff is a 2760x07 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
294The following bytes are used by the SN9C103 bridge only:
295
2960x0C 0xXX Unknown meaning
2970x0D 0xXX Unknown meaning
2980x0E 0xXX Unknown meaning
2990x0F 0xXX Unknown meaning
3000x10 0xXX Unknown meaning
3010x11 0xXX Unknown meaning
270 302
271The AE area (sx, sy, ex, ey) in the active window can be set by programming the 303The AE area (sx, sy, ex, ey) in the active window can be set by programming the
272registers 0x1c, 0x1d, 0x1e and 0x1f of the SN9C10x controllers, where one unit 304registers 0x1c, 0x1d, 0x1e and 0x1f of the SN9C10x controllers, where one unit
273corresponds to 32 pixels. 305corresponds 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
2789. Supported devices 3119. Supported devices
@@ -298,6 +331,7 @@ Vendor ID Product ID
2980x0c45 0x602b 3310x0c45 0x602b
2990x0c45 0x602c 3320x0c45 0x602c
3000x0c45 0x602d 3330x0c45 0x602d
3340x0c45 0x602e
3010x0c45 0x6030 3350x0c45 0x6030
3020x0c45 0x6080 3360x0c45 0x6080
3030x0c45 0x6082 3370x0c45 0x6082
@@ -348,18 +382,7 @@ appreciated. Non-available hardware will not be supported by the author of this
348driver. 382driver.
349 383
350 384
35110. How to add plug-in's for new image sensors 38510. Notes for V4L2 application developers
352==============================================
353It should be easy to write plug-in's for new sensors by using the small API
354that 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
358At the moment, possible unsupported image sensors are: CIS-VF10 (VGA),
359OV7620 (VGA), OV7630 (VGA).
360
361
36211. Notes for V4L2 application developers
363========================================= 386=========================================
364This driver follows the V4L2 API specifications. In particular, it enforces two 387This driver follows the V4L2 API specifications. In particular, it enforces two
365rules: 388rules:
@@ -394,7 +417,7 @@ initialized (as described in the documentation of the API for the image sensors
394supplied by this driver). 417supplied by this driver).
395 418
396 419
39712. Video frame formats [1] 42011. Video frame formats [1]
398======================= 421=======================
399The SN9C10x PC Camera Controllers can send images in two possible video 422The SN9C10x PC Camera Controllers can send images in two possible video
400formats over the USB: either native "Sequential RGB Bayer" or Huffman 423formats 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
45813. Contact information 48112. Contact information
459======================= 482=======================
460The author may be contacted by e-mail at <luca.risolia@studio.unibo.it>. 483The 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
464the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'. 487the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'.
465 488
466 489
46714. Credits 49013. Credits
468=========== 491===========
469Many thanks to following persons for their contribute (listed in alphabetical 492Many thanks to following persons for their contribute (listed in alphabetical
470order): 493order):
@@ -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.
57The driver is divided into two modules: the basic one, "w9968cf", is needed for 57The driver is divided into two modules: the basic one, "w9968cf", is needed for
58the supported devices to work; the second one, "w9968cf-vpp", is an optional 58the supported devices to work; the second one, "w9968cf-vpp", is an optional
59module, which provides some useful video post-processing functions like video 59module, which provides some useful video post-processing functions like video
60decoding, up-scaling and colour conversions. Once the driver is installed, 60decoding, up-scaling and colour conversions.
61every time an application tries to open a recognized device, "w9968cf" checks
62the presence of the "w9968cf-vpp" module and loads it automatically by default.
63 61
64Please keep in mind that official kernels do not include the second module for 62Note that the official kernels do neither include nor support the second
65performance purposes. However it is always recommended to download and install 63module for performance purposes. Therefore, it is always recommended to
66the latest and complete release of the driver, replacing the existing one, if 64download and install the latest and complete release of the driver,
67present: it will be still even possible not to load the "w9968cf-vpp" module at 65replacing the existing one, if present.
68all, if you ever want to. Another important missing feature of the version in
69the official Linux 2.4 kernels is the writeable /proc filesystem interface.
70 66
71The latest and full-featured version of the W996[87]CF driver can be found at: 67The latest and full-featured version of the W996[87]CF driver can be found at:
72http://www.linux-projects.org. Please refer to the documentation included in 68http://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-------------------------------------------------------------------------------
204Name: vppmod_load
205Type: bool
206Syntax: <0|1>
207Description: 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.
215Default: 1
216Note: 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-------------------------------------------------------------------------------
220Name: simcams 200Name: simcams
221Type: int 201Type: int
222Syntax: <n> 202Syntax: <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 @@
1Page migration
2--------------
3
4Page migration allows the moving of the physical location of pages between
5nodes in a numa system while the process is running. This means that the
6virtual addresses that the process sees do not change. However, the
7system rearranges the physical location of those pages.
8
9The main intend of page migration is to reduce the latency of memory access
10by moving pages near to the processor where the process accessing that memory
11is running.
12
13Page migration allows a process to manually relocate the node on which its
14pages are located through the MF_MOVE and MF_MOVE_ALL options while setting
15a new memory policy. The pages of process can also be relocated
16from another process using the sys_migrate_pages() function call. The
17migrate_pages function call takes two sets of nodes and moves pages of a
18process that are located on the from nodes to the destination nodes.
19
20Manual migration is very useful if for example the scheduler has relocated
21a process to a processor on a distant node. A batch scheduler or an
22administrator may detect the situation and move the pages of the process
23nearer to the new processor. At some point in the future we may have
24some mechanism in the scheduler that will automatically move the pages.
25
26Larger installations usually partition the system using cpusets into
27sections of nodes. Paul Jackson has equipped cpusets with the ability to
28move pages when a task is moved to another cpuset. This allows automatic
29control over locality of a process. If a task is moved to a new cpuset
30then also all its pages are moved with it so that the performance of the
31process does not sink dramatically (as is the case today).
32
33Page migration allows the preservation of the relative location of pages
34within a group of nodes for all migration techniques which will preserve a
35particular memory allocation pattern generated even after migrating a
36process. This is necessary in order to preserve the memory latencies.
37Processes will run with similar performance after migration.
38
39Page migration occurs in several steps. First a high level
40description for those trying to use migrate_pages() and then
41a low level description of how the low level details work.
42
43A. Use of migrate_pages()
44-------------------------
45
461. 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
542. Generate a list of newly allocates page to move the contents
55 of the first list to.
56
573. 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
634. 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
68B. Operation of migrate_pages()
69--------------------------------
70
71migrate_pages does several passes over its list of pages. A page is moved
72if all references to a page are removable at the time.
73
74Steps:
75
761. Lock the page to be migrated
77
782. Insure that writeback is complete.
79
803. 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
844. 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
885. 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
926. The radix tree lock is taken
93
947. 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
978. The radix tree is checked and if it does not contain the pointer to this
98 page then we back out.
99
1009. The mapping is checked. If the mapping is gone then a truncate action may
101 be in progress and we back out.
102
10310. 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
10611. The radix tree is changed to point to the new page.
107
10812. The reference count of the old page is dropped because the reference has now
109 been removed.
110
11113. The radix tree lock is dropped.
112
11314. The page contents are copied to the new page.
114
11515. The remaining page flags are copied to the new page.
116
11716. The old page flags are cleared to indicate that the page does
118 not use any information anymore.
119
12017. Queued up writeback on the new page is triggered.
121
12218. If swap pte's were generated for the page then remove them again.
123
12419. The locks are dropped from the old and new page.
125
12620. The new page is moved to the LRU.
127
128Christoph 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
43Early Console 55Early Console
44 56
45 syntax: earlyprintk=vga 57 syntax: earlyprintk=vga