diff options
Diffstat (limited to 'Documentation')
39 files changed, 2169 insertions, 67 deletions
diff --git a/Documentation/ABI/testing/sysfs-block-dm b/Documentation/ABI/testing/sysfs-block-dm new file mode 100644 index 000000000000..87ca5691e29b --- /dev/null +++ b/Documentation/ABI/testing/sysfs-block-dm | |||
@@ -0,0 +1,25 @@ | |||
1 | What: /sys/block/dm-<num>/dm/name | ||
2 | Date: January 2009 | ||
3 | KernelVersion: 2.6.29 | ||
4 | Contact: dm-devel@redhat.com | ||
5 | Description: Device-mapper device name. | ||
6 | Read-only string containing mapped device name. | ||
7 | Users: util-linux, device-mapper udev rules | ||
8 | |||
9 | What: /sys/block/dm-<num>/dm/uuid | ||
10 | Date: January 2009 | ||
11 | KernelVersion: 2.6.29 | ||
12 | Contact: dm-devel@redhat.com | ||
13 | Description: Device-mapper device UUID. | ||
14 | Read-only string containing DM-UUID or empty string | ||
15 | if DM-UUID is not set. | ||
16 | Users: util-linux, device-mapper udev rules | ||
17 | |||
18 | What: /sys/block/dm-<num>/dm/suspended | ||
19 | Date: June 2009 | ||
20 | KernelVersion: 2.6.31 | ||
21 | Contact: dm-devel@redhat.com | ||
22 | Description: Device-mapper device suspend state. | ||
23 | Contains the value 1 while the device is suspended. | ||
24 | Otherwise it contains 0. Read-only attribute. | ||
25 | Users: util-linux, device-mapper udev rules | ||
diff --git a/Documentation/ABI/testing/sysfs-bus-rpmsg b/Documentation/ABI/testing/sysfs-bus-rpmsg new file mode 100644 index 000000000000..189e419a5a2d --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-rpmsg | |||
@@ -0,0 +1,75 @@ | |||
1 | What: /sys/bus/rpmsg/devices/.../name | ||
2 | Date: June 2011 | ||
3 | KernelVersion: 3.3 | ||
4 | Contact: Ohad Ben-Cohen <ohad@wizery.com> | ||
5 | Description: | ||
6 | Every rpmsg device is a communication channel with a remote | ||
7 | processor. Channels are identified with a (textual) name, | ||
8 | which is maximum 32 bytes long (defined as RPMSG_NAME_SIZE in | ||
9 | rpmsg.h). | ||
10 | |||
11 | This sysfs entry contains the name of this channel. | ||
12 | |||
13 | What: /sys/bus/rpmsg/devices/.../src | ||
14 | Date: June 2011 | ||
15 | KernelVersion: 3.3 | ||
16 | Contact: Ohad Ben-Cohen <ohad@wizery.com> | ||
17 | Description: | ||
18 | Every rpmsg device is a communication channel with a remote | ||
19 | processor. Channels have a local ("source") rpmsg address, | ||
20 | and remote ("destination") rpmsg address. When an entity | ||
21 | starts listening on one end of a channel, it assigns it with | ||
22 | a unique rpmsg address (a 32 bits integer). This way when | ||
23 | inbound messages arrive to this address, the rpmsg core | ||
24 | dispatches them to the listening entity (a kernel driver). | ||
25 | |||
26 | This sysfs entry contains the src (local) rpmsg address | ||
27 | of this channel. If it contains 0xffffffff, then an address | ||
28 | wasn't assigned (can happen if no driver exists for this | ||
29 | channel). | ||
30 | |||
31 | What: /sys/bus/rpmsg/devices/.../dst | ||
32 | Date: June 2011 | ||
33 | KernelVersion: 3.3 | ||
34 | Contact: Ohad Ben-Cohen <ohad@wizery.com> | ||
35 | Description: | ||
36 | Every rpmsg device is a communication channel with a remote | ||
37 | processor. Channels have a local ("source") rpmsg address, | ||
38 | and remote ("destination") rpmsg address. When an entity | ||
39 | starts listening on one end of a channel, it assigns it with | ||
40 | a unique rpmsg address (a 32 bits integer). This way when | ||
41 | inbound messages arrive to this address, the rpmsg core | ||
42 | dispatches them to the listening entity. | ||
43 | |||
44 | This sysfs entry contains the dst (remote) rpmsg address | ||
45 | of this channel. If it contains 0xffffffff, then an address | ||
46 | wasn't assigned (can happen if the kernel driver that | ||
47 | is attached to this channel is exposing a service to the | ||
48 | remote processor. This make it a local rpmsg server, | ||
49 | and it is listening for inbound messages that may be sent | ||
50 | from any remote rpmsg client; it is not bound to a single | ||
51 | remote entity). | ||
52 | |||
53 | What: /sys/bus/rpmsg/devices/.../announce | ||
54 | Date: June 2011 | ||
55 | KernelVersion: 3.3 | ||
56 | Contact: Ohad Ben-Cohen <ohad@wizery.com> | ||
57 | Description: | ||
58 | Every rpmsg device is a communication channel with a remote | ||
59 | processor. Channels are identified by a textual name (see | ||
60 | /sys/bus/rpmsg/devices/.../name above) and have a local | ||
61 | ("source") rpmsg address, and remote ("destination") rpmsg | ||
62 | address. | ||
63 | |||
64 | A channel is first created when an entity, whether local | ||
65 | or remote, starts listening on it for messages (and is thus | ||
66 | called an rpmsg server). | ||
67 | |||
68 | When that happens, a "name service" announcement is sent | ||
69 | to the other processor, in order to let it know about the | ||
70 | creation of the channel (this way remote clients know they | ||
71 | can start sending messages). | ||
72 | |||
73 | This sysfs entry tells us whether the channel is a local | ||
74 | server channel that is announced (values are either | ||
75 | true or false). | ||
diff --git a/Documentation/clk.txt b/Documentation/clk.txt new file mode 100644 index 000000000000..1943fae014fd --- /dev/null +++ b/Documentation/clk.txt | |||
@@ -0,0 +1,233 @@ | |||
1 | The Common Clk Framework | ||
2 | Mike Turquette <mturquette@ti.com> | ||
3 | |||
4 | This document endeavours to explain the common clk framework details, | ||
5 | and how to port a platform over to this framework. It is not yet a | ||
6 | detailed explanation of the clock api in include/linux/clk.h, but | ||
7 | perhaps someday it will include that information. | ||
8 | |||
9 | Part 1 - introduction and interface split | ||
10 | |||
11 | The common clk framework is an interface to control the clock nodes | ||
12 | available on various devices today. This may come in the form of clock | ||
13 | gating, rate adjustment, muxing or other operations. This framework is | ||
14 | enabled with the CONFIG_COMMON_CLK option. | ||
15 | |||
16 | The interface itself is divided into two halves, each shielded from the | ||
17 | details of its counterpart. First is the common definition of struct | ||
18 | clk which unifies the framework-level accounting and infrastructure that | ||
19 | has traditionally been duplicated across a variety of platforms. Second | ||
20 | is a common implementation of the clk.h api, defined in | ||
21 | drivers/clk/clk.c. Finally there is struct clk_ops, whose operations | ||
22 | are invoked by the clk api implementation. | ||
23 | |||
24 | The second half of the interface is comprised of the hardware-specific | ||
25 | callbacks registered with struct clk_ops and the corresponding | ||
26 | hardware-specific structures needed to model a particular clock. For | ||
27 | the remainder of this document any reference to a callback in struct | ||
28 | clk_ops, such as .enable or .set_rate, implies the hardware-specific | ||
29 | implementation of that code. Likewise, references to struct clk_foo | ||
30 | serve as a convenient shorthand for the implementation of the | ||
31 | hardware-specific bits for the hypothetical "foo" hardware. | ||
32 | |||
33 | Tying the two halves of this interface together is struct clk_hw, which | ||
34 | is defined in struct clk_foo and pointed to within struct clk. This | ||
35 | allows easy for navigation between the two discrete halves of the common | ||
36 | clock interface. | ||
37 | |||
38 | Part 2 - common data structures and api | ||
39 | |||
40 | Below is the common struct clk definition from | ||
41 | include/linux/clk-private.h, modified for brevity: | ||
42 | |||
43 | struct clk { | ||
44 | const char *name; | ||
45 | const struct clk_ops *ops; | ||
46 | struct clk_hw *hw; | ||
47 | char **parent_names; | ||
48 | struct clk **parents; | ||
49 | struct clk *parent; | ||
50 | struct hlist_head children; | ||
51 | struct hlist_node child_node; | ||
52 | ... | ||
53 | }; | ||
54 | |||
55 | The members above make up the core of the clk tree topology. The clk | ||
56 | api itself defines several driver-facing functions which operate on | ||
57 | struct clk. That api is documented in include/linux/clk.h. | ||
58 | |||
59 | Platforms and devices utilizing the common struct clk use the struct | ||
60 | clk_ops pointer in struct clk to perform the hardware-specific parts of | ||
61 | the operations defined in clk.h: | ||
62 | |||
63 | struct clk_ops { | ||
64 | int (*prepare)(struct clk_hw *hw); | ||
65 | void (*unprepare)(struct clk_hw *hw); | ||
66 | int (*enable)(struct clk_hw *hw); | ||
67 | void (*disable)(struct clk_hw *hw); | ||
68 | int (*is_enabled)(struct clk_hw *hw); | ||
69 | unsigned long (*recalc_rate)(struct clk_hw *hw, | ||
70 | unsigned long parent_rate); | ||
71 | long (*round_rate)(struct clk_hw *hw, unsigned long, | ||
72 | unsigned long *); | ||
73 | int (*set_parent)(struct clk_hw *hw, u8 index); | ||
74 | u8 (*get_parent)(struct clk_hw *hw); | ||
75 | int (*set_rate)(struct clk_hw *hw, unsigned long); | ||
76 | void (*init)(struct clk_hw *hw); | ||
77 | }; | ||
78 | |||
79 | Part 3 - hardware clk implementations | ||
80 | |||
81 | The strength of the common struct clk comes from its .ops and .hw pointers | ||
82 | which abstract the details of struct clk from the hardware-specific bits, and | ||
83 | vice versa. To illustrate consider the simple gateable clk implementation in | ||
84 | drivers/clk/clk-gate.c: | ||
85 | |||
86 | struct clk_gate { | ||
87 | struct clk_hw hw; | ||
88 | void __iomem *reg; | ||
89 | u8 bit_idx; | ||
90 | ... | ||
91 | }; | ||
92 | |||
93 | struct clk_gate contains struct clk_hw hw as well as hardware-specific | ||
94 | knowledge about which register and bit controls this clk's gating. | ||
95 | Nothing about clock topology or accounting, such as enable_count or | ||
96 | notifier_count, is needed here. That is all handled by the common | ||
97 | framework code and struct clk. | ||
98 | |||
99 | Let's walk through enabling this clk from driver code: | ||
100 | |||
101 | struct clk *clk; | ||
102 | clk = clk_get(NULL, "my_gateable_clk"); | ||
103 | |||
104 | clk_prepare(clk); | ||
105 | clk_enable(clk); | ||
106 | |||
107 | The call graph for clk_enable is very simple: | ||
108 | |||
109 | clk_enable(clk); | ||
110 | clk->ops->enable(clk->hw); | ||
111 | [resolves to...] | ||
112 | clk_gate_enable(hw); | ||
113 | [resolves struct clk gate with to_clk_gate(hw)] | ||
114 | clk_gate_set_bit(gate); | ||
115 | |||
116 | And the definition of clk_gate_set_bit: | ||
117 | |||
118 | static void clk_gate_set_bit(struct clk_gate *gate) | ||
119 | { | ||
120 | u32 reg; | ||
121 | |||
122 | reg = __raw_readl(gate->reg); | ||
123 | reg |= BIT(gate->bit_idx); | ||
124 | writel(reg, gate->reg); | ||
125 | } | ||
126 | |||
127 | Note that to_clk_gate is defined as: | ||
128 | |||
129 | #define to_clk_gate(_hw) container_of(_hw, struct clk_gate, clk) | ||
130 | |||
131 | This pattern of abstraction is used for every clock hardware | ||
132 | representation. | ||
133 | |||
134 | Part 4 - supporting your own clk hardware | ||
135 | |||
136 | When implementing support for a new type of clock it only necessary to | ||
137 | include the following header: | ||
138 | |||
139 | #include <linux/clk-provider.h> | ||
140 | |||
141 | include/linux/clk.h is included within that header and clk-private.h | ||
142 | must never be included from the code which implements the operations for | ||
143 | a clock. More on that below in Part 5. | ||
144 | |||
145 | To construct a clk hardware structure for your platform you must define | ||
146 | the following: | ||
147 | |||
148 | struct clk_foo { | ||
149 | struct clk_hw hw; | ||
150 | ... hardware specific data goes here ... | ||
151 | }; | ||
152 | |||
153 | To take advantage of your data you'll need to support valid operations | ||
154 | for your clk: | ||
155 | |||
156 | struct clk_ops clk_foo_ops { | ||
157 | .enable = &clk_foo_enable; | ||
158 | .disable = &clk_foo_disable; | ||
159 | }; | ||
160 | |||
161 | Implement the above functions using container_of: | ||
162 | |||
163 | #define to_clk_foo(_hw) container_of(_hw, struct clk_foo, hw) | ||
164 | |||
165 | int clk_foo_enable(struct clk_hw *hw) | ||
166 | { | ||
167 | struct clk_foo *foo; | ||
168 | |||
169 | foo = to_clk_foo(hw); | ||
170 | |||
171 | ... perform magic on foo ... | ||
172 | |||
173 | return 0; | ||
174 | }; | ||
175 | |||
176 | Below is a matrix detailing which clk_ops are mandatory based upon the | ||
177 | hardware capbilities of that clock. A cell marked as "y" means | ||
178 | mandatory, a cell marked as "n" implies that either including that | ||
179 | callback is invalid or otherwise uneccesary. Empty cells are either | ||
180 | optional or must be evaluated on a case-by-case basis. | ||
181 | |||
182 | clock hardware characteristics | ||
183 | ----------------------------------------------------------- | ||
184 | | gate | change rate | single parent | multiplexer | root | | ||
185 | |------|-------------|---------------|-------------|------| | ||
186 | .prepare | | | | | | | ||
187 | .unprepare | | | | | | | ||
188 | | | | | | | | ||
189 | .enable | y | | | | | | ||
190 | .disable | y | | | | | | ||
191 | .is_enabled | y | | | | | | ||
192 | | | | | | | | ||
193 | .recalc_rate | | y | | | | | ||
194 | .round_rate | | y | | | | | ||
195 | .set_rate | | y | | | | | ||
196 | | | | | | | | ||
197 | .set_parent | | | n | y | n | | ||
198 | .get_parent | | | n | y | n | | ||
199 | | | | | | | | ||
200 | .init | | | | | | | ||
201 | ----------------------------------------------------------- | ||
202 | |||
203 | Finally, register your clock at run-time with a hardware-specific | ||
204 | registration function. This function simply populates struct clk_foo's | ||
205 | data and then passes the common struct clk parameters to the framework | ||
206 | with a call to: | ||
207 | |||
208 | clk_register(...) | ||
209 | |||
210 | See the basic clock types in drivers/clk/clk-*.c for examples. | ||
211 | |||
212 | Part 5 - static initialization of clock data | ||
213 | |||
214 | For platforms with many clocks (often numbering into the hundreds) it | ||
215 | may be desirable to statically initialize some clock data. This | ||
216 | presents a problem since the definition of struct clk should be hidden | ||
217 | from everyone except for the clock core in drivers/clk/clk.c. | ||
218 | |||
219 | To get around this problem struct clk's definition is exposed in | ||
220 | include/linux/clk-private.h along with some macros for more easily | ||
221 | initializing instances of the basic clock types. These clocks must | ||
222 | still be initialized with the common clock framework via a call to | ||
223 | __clk_init. | ||
224 | |||
225 | clk-private.h must NEVER be included by code which implements struct | ||
226 | clk_ops callbacks, nor must it be included by any logic which pokes | ||
227 | around inside of struct clk at run-time. To do so is a layering | ||
228 | violation. | ||
229 | |||
230 | To better enforce this policy, always follow this simple rule: any | ||
231 | statically initialized clock data MUST be defined in a separate file | ||
232 | from the logic that implements its ops. Basically separate the logic | ||
233 | from the data and all is well. | ||
diff --git a/Documentation/device-mapper/thin-provisioning.txt b/Documentation/device-mapper/thin-provisioning.txt index 1ff044d87ca4..3370bc4d7b98 100644 --- a/Documentation/device-mapper/thin-provisioning.txt +++ b/Documentation/device-mapper/thin-provisioning.txt | |||
@@ -75,10 +75,12 @@ less sharing than average you'll need a larger-than-average metadata device. | |||
75 | 75 | ||
76 | As a guide, we suggest you calculate the number of bytes to use in the | 76 | As a guide, we suggest you calculate the number of bytes to use in the |
77 | metadata device as 48 * $data_dev_size / $data_block_size but round it up | 77 | metadata device as 48 * $data_dev_size / $data_block_size but round it up |
78 | to 2MB if the answer is smaller. The largest size supported is 16GB. | 78 | to 2MB if the answer is smaller. If you're creating large numbers of |
79 | snapshots which are recording large amounts of change, you may find you | ||
80 | need to increase this. | ||
79 | 81 | ||
80 | If you're creating large numbers of snapshots which are recording large | 82 | The largest size supported is 16GB: If the device is larger, |
81 | amounts of change, you may need find you need to increase this. | 83 | a warning will be issued and the excess space will not be used. |
82 | 84 | ||
83 | Reloading a pool table | 85 | Reloading a pool table |
84 | ---------------------- | 86 | ---------------------- |
@@ -167,6 +169,38 @@ ii) Using an internal snapshot. | |||
167 | 169 | ||
168 | dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 1" | 170 | dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 1" |
169 | 171 | ||
172 | External snapshots | ||
173 | ------------------ | ||
174 | |||
175 | You can use an external _read only_ device as an origin for a | ||
176 | thinly-provisioned volume. Any read to an unprovisioned area of the | ||
177 | thin device will be passed through to the origin. Writes trigger | ||
178 | the allocation of new blocks as usual. | ||
179 | |||
180 | One use case for this is VM hosts that want to run guests on | ||
181 | thinly-provisioned volumes but have the base image on another device | ||
182 | (possibly shared between many VMs). | ||
183 | |||
184 | You must not write to the origin device if you use this technique! | ||
185 | Of course, you may write to the thin device and take internal snapshots | ||
186 | of the thin volume. | ||
187 | |||
188 | i) Creating a snapshot of an external device | ||
189 | |||
190 | This is the same as creating a thin device. | ||
191 | You don't mention the origin at this stage. | ||
192 | |||
193 | dmsetup message /dev/mapper/pool 0 "create_thin 0" | ||
194 | |||
195 | ii) Using a snapshot of an external device. | ||
196 | |||
197 | Append an extra parameter to the thin target specifying the origin: | ||
198 | |||
199 | dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 0 /dev/image" | ||
200 | |||
201 | N.B. All descendants (internal snapshots) of this snapshot require the | ||
202 | same extra origin parameter. | ||
203 | |||
170 | Deactivation | 204 | Deactivation |
171 | ------------ | 205 | ------------ |
172 | 206 | ||
@@ -189,7 +223,13 @@ i) Constructor | |||
189 | <low water mark (blocks)> [<number of feature args> [<arg>]*] | 223 | <low water mark (blocks)> [<number of feature args> [<arg>]*] |
190 | 224 | ||
191 | Optional feature arguments: | 225 | Optional feature arguments: |
192 | - 'skip_block_zeroing': skips the zeroing of newly-provisioned blocks. | 226 | |
227 | skip_block_zeroing: Skip the zeroing of newly-provisioned blocks. | ||
228 | |||
229 | ignore_discard: Disable discard support. | ||
230 | |||
231 | no_discard_passdown: Don't pass discards down to the underlying | ||
232 | data device, but just remove the mapping. | ||
193 | 233 | ||
194 | Data block size must be between 64KB (128 sectors) and 1GB | 234 | Data block size must be between 64KB (128 sectors) and 1GB |
195 | (2097152 sectors) inclusive. | 235 | (2097152 sectors) inclusive. |
@@ -237,16 +277,6 @@ iii) Messages | |||
237 | 277 | ||
238 | Deletes a thin device. Irreversible. | 278 | Deletes a thin device. Irreversible. |
239 | 279 | ||
240 | trim <dev id> <new size in sectors> | ||
241 | |||
242 | Delete mappings from the end of a thin device. Irreversible. | ||
243 | You might want to use this if you're reducing the size of | ||
244 | your thinly-provisioned device. In many cases, due to the | ||
245 | sharing of blocks between devices, it is not possible to | ||
246 | determine in advance how much space 'trim' will release. (In | ||
247 | future a userspace tool might be able to perform this | ||
248 | calculation.) | ||
249 | |||
250 | set_transaction_id <current id> <new id> | 280 | set_transaction_id <current id> <new id> |
251 | 281 | ||
252 | Userland volume managers, such as LVM, need a way to | 282 | Userland volume managers, such as LVM, need a way to |
@@ -262,7 +292,7 @@ iii) Messages | |||
262 | 292 | ||
263 | i) Constructor | 293 | i) Constructor |
264 | 294 | ||
265 | thin <pool dev> <dev id> | 295 | thin <pool dev> <dev id> [<external origin dev>] |
266 | 296 | ||
267 | pool dev: | 297 | pool dev: |
268 | the thin-pool device, e.g. /dev/mapper/my_pool or 253:0 | 298 | the thin-pool device, e.g. /dev/mapper/my_pool or 253:0 |
@@ -271,6 +301,11 @@ i) Constructor | |||
271 | the internal device identifier of the device to be | 301 | the internal device identifier of the device to be |
272 | activated. | 302 | activated. |
273 | 303 | ||
304 | external origin dev: | ||
305 | an optional block device outside the pool to be treated as a | ||
306 | read-only snapshot origin: reads to unprovisioned areas of the | ||
307 | thin target will be mapped to this device. | ||
308 | |||
274 | The pool doesn't store any size against the thin devices. If you | 309 | The pool doesn't store any size against the thin devices. If you |
275 | load a thin target that is smaller than you've been using previously, | 310 | load a thin target that is smaller than you've been using previously, |
276 | then you'll have no access to blocks mapped beyond the end. If you | 311 | then you'll have no access to blocks mapped beyond the end. If you |
diff --git a/Documentation/device-mapper/verity.txt b/Documentation/device-mapper/verity.txt new file mode 100644 index 000000000000..32e48797a14f --- /dev/null +++ b/Documentation/device-mapper/verity.txt | |||
@@ -0,0 +1,194 @@ | |||
1 | dm-verity | ||
2 | ========== | ||
3 | |||
4 | Device-Mapper's "verity" target provides transparent integrity checking of | ||
5 | block devices using a cryptographic digest provided by the kernel crypto API. | ||
6 | This target is read-only. | ||
7 | |||
8 | Construction Parameters | ||
9 | ======================= | ||
10 | <version> <dev> <hash_dev> <hash_start> | ||
11 | <data_block_size> <hash_block_size> | ||
12 | <num_data_blocks> <hash_start_block> | ||
13 | <algorithm> <digest> <salt> | ||
14 | |||
15 | <version> | ||
16 | This is the version number of the on-disk format. | ||
17 | |||
18 | 0 is the original format used in the Chromium OS. | ||
19 | The salt is appended when hashing, digests are stored continuously and | ||
20 | the rest of the block is padded with zeros. | ||
21 | |||
22 | 1 is the current format that should be used for new devices. | ||
23 | The salt is prepended when hashing and each digest is | ||
24 | padded with zeros to the power of two. | ||
25 | |||
26 | <dev> | ||
27 | This is the device containing the data the integrity of which needs to be | ||
28 | checked. It may be specified as a path, like /dev/sdaX, or a device number, | ||
29 | <major>:<minor>. | ||
30 | |||
31 | <hash_dev> | ||
32 | This is the device that that supplies the hash tree data. It may be | ||
33 | specified similarly to the device path and may be the same device. If the | ||
34 | same device is used, the hash_start should be outside of the dm-verity | ||
35 | configured device size. | ||
36 | |||
37 | <data_block_size> | ||
38 | The block size on a data device. Each block corresponds to one digest on | ||
39 | the hash device. | ||
40 | |||
41 | <hash_block_size> | ||
42 | The size of a hash block. | ||
43 | |||
44 | <num_data_blocks> | ||
45 | The number of data blocks on the data device. Additional blocks are | ||
46 | inaccessible. You can place hashes to the same partition as data, in this | ||
47 | case hashes are placed after <num_data_blocks>. | ||
48 | |||
49 | <hash_start_block> | ||
50 | This is the offset, in <hash_block_size>-blocks, from the start of hash_dev | ||
51 | to the root block of the hash tree. | ||
52 | |||
53 | <algorithm> | ||
54 | The cryptographic hash algorithm used for this device. This should | ||
55 | be the name of the algorithm, like "sha1". | ||
56 | |||
57 | <digest> | ||
58 | The hexadecimal encoding of the cryptographic hash of the root hash block | ||
59 | and the salt. This hash should be trusted as there is no other authenticity | ||
60 | beyond this point. | ||
61 | |||
62 | <salt> | ||
63 | The hexadecimal encoding of the salt value. | ||
64 | |||
65 | Theory of operation | ||
66 | =================== | ||
67 | |||
68 | dm-verity is meant to be setup as part of a verified boot path. This | ||
69 | may be anything ranging from a boot using tboot or trustedgrub to just | ||
70 | booting from a known-good device (like a USB drive or CD). | ||
71 | |||
72 | When a dm-verity device is configured, it is expected that the caller | ||
73 | has been authenticated in some way (cryptographic signatures, etc). | ||
74 | After instantiation, all hashes will be verified on-demand during | ||
75 | disk access. If they cannot be verified up to the root node of the | ||
76 | tree, the root hash, then the I/O will fail. This should identify | ||
77 | tampering with any data on the device and the hash data. | ||
78 | |||
79 | Cryptographic hashes are used to assert the integrity of the device on a | ||
80 | per-block basis. This allows for a lightweight hash computation on first read | ||
81 | into the page cache. Block hashes are stored linearly-aligned to the nearest | ||
82 | block the size of a page. | ||
83 | |||
84 | Hash Tree | ||
85 | --------- | ||
86 | |||
87 | Each node in the tree is a cryptographic hash. If it is a leaf node, the hash | ||
88 | is of some block data on disk. If it is an intermediary node, then the hash is | ||
89 | of a number of child nodes. | ||
90 | |||
91 | Each entry in the tree is a collection of neighboring nodes that fit in one | ||
92 | block. The number is determined based on block_size and the size of the | ||
93 | selected cryptographic digest algorithm. The hashes are linearly-ordered in | ||
94 | this entry and any unaligned trailing space is ignored but included when | ||
95 | calculating the parent node. | ||
96 | |||
97 | The tree looks something like: | ||
98 | |||
99 | alg = sha256, num_blocks = 32768, block_size = 4096 | ||
100 | |||
101 | [ root ] | ||
102 | / . . . \ | ||
103 | [entry_0] [entry_1] | ||
104 | / . . . \ . . . \ | ||
105 | [entry_0_0] . . . [entry_0_127] . . . . [entry_1_127] | ||
106 | / ... \ / . . . \ / \ | ||
107 | blk_0 ... blk_127 blk_16256 blk_16383 blk_32640 . . . blk_32767 | ||
108 | |||
109 | |||
110 | On-disk format | ||
111 | ============== | ||
112 | |||
113 | Below is the recommended on-disk format. The verity kernel code does not | ||
114 | read the on-disk header. It only reads the hash blocks which directly | ||
115 | follow the header. It is expected that a user-space tool will verify the | ||
116 | integrity of the verity_header and then call dmsetup with the correct | ||
117 | parameters. Alternatively, the header can be omitted and the dmsetup | ||
118 | parameters can be passed via the kernel command-line in a rooted chain | ||
119 | of trust where the command-line is verified. | ||
120 | |||
121 | The on-disk format is especially useful in cases where the hash blocks | ||
122 | are on a separate partition. The magic number allows easy identification | ||
123 | of the partition contents. Alternatively, the hash blocks can be stored | ||
124 | in the same partition as the data to be verified. In such a configuration | ||
125 | the filesystem on the partition would be sized a little smaller than | ||
126 | the full-partition, leaving room for the hash blocks. | ||
127 | |||
128 | struct superblock { | ||
129 | uint8_t signature[8] | ||
130 | "verity\0\0"; | ||
131 | |||
132 | uint8_t version; | ||
133 | 1 - current format | ||
134 | |||
135 | uint8_t data_block_bits; | ||
136 | log2(data block size) | ||
137 | |||
138 | uint8_t hash_block_bits; | ||
139 | log2(hash block size) | ||
140 | |||
141 | uint8_t pad1[1]; | ||
142 | zero padding | ||
143 | |||
144 | uint16_t salt_size; | ||
145 | big-endian salt size | ||
146 | |||
147 | uint8_t pad2[2]; | ||
148 | zero padding | ||
149 | |||
150 | uint32_t data_blocks_hi; | ||
151 | big-endian high 32 bits of the 64-bit number of data blocks | ||
152 | |||
153 | uint32_t data_blocks_lo; | ||
154 | big-endian low 32 bits of the 64-bit number of data blocks | ||
155 | |||
156 | uint8_t algorithm[16]; | ||
157 | cryptographic algorithm | ||
158 | |||
159 | uint8_t salt[384]; | ||
160 | salt (the salt size is specified above) | ||
161 | |||
162 | uint8_t pad3[88]; | ||
163 | zero padding to 512-byte boundary | ||
164 | } | ||
165 | |||
166 | Directly following the header (and with sector number padded to the next hash | ||
167 | block boundary) are the hash blocks which are stored a depth at a time | ||
168 | (starting from the root), sorted in order of increasing index. | ||
169 | |||
170 | Status | ||
171 | ====== | ||
172 | V (for Valid) is returned if every check performed so far was valid. | ||
173 | If any check failed, C (for Corruption) is returned. | ||
174 | |||
175 | Example | ||
176 | ======= | ||
177 | |||
178 | Setup a device: | ||
179 | dmsetup create vroot --table \ | ||
180 | "0 2097152 "\ | ||
181 | "verity 1 /dev/sda1 /dev/sda2 4096 4096 2097152 1 "\ | ||
182 | "4392712ba01368efdf14b05c76f9e4df0d53664630b5d48632ed17a137f39076 "\ | ||
183 | "1234000000000000000000000000000000000000000000000000000000000000" | ||
184 | |||
185 | A command line tool veritysetup is available to compute or verify | ||
186 | the hash tree or activate the kernel driver. This is available from | ||
187 | the LVM2 upstream repository and may be supplied as a package called | ||
188 | device-mapper-verity-tools: | ||
189 | git://sources.redhat.com/git/lvm2 | ||
190 | http://sourceware.org/git/?p=lvm2.git | ||
191 | http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/verity?cvsroot=lvm2 | ||
192 | |||
193 | veritysetup -a vroot /dev/sda1 /dev/sda2 \ | ||
194 | 4392712ba01368efdf14b05c76f9e4df0d53664630b5d48632ed17a137f39076 | ||
diff --git a/Documentation/devicetree/bindings/arm/atmel-aic.txt b/Documentation/devicetree/bindings/arm/atmel-aic.txt new file mode 100644 index 000000000000..aabca4f83402 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/atmel-aic.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | * Advanced Interrupt Controller (AIC) | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Should be "atmel,<chip>-aic" | ||
5 | - interrupt-controller: Identifies the node as an interrupt controller. | ||
6 | - interrupt-parent: For single AIC system, it is an empty property. | ||
7 | - #interrupt-cells: The number of cells to define the interrupts. It sould be 2. | ||
8 | The first cell is the IRQ number (aka "Peripheral IDentifier" on datasheet). | ||
9 | The second cell is used to specify flags: | ||
10 | bits[3:0] trigger type and level flags: | ||
11 | 1 = low-to-high edge triggered. | ||
12 | 2 = high-to-low edge triggered. | ||
13 | 4 = active high level-sensitive. | ||
14 | 8 = active low level-sensitive. | ||
15 | Valid combinations are 1, 2, 3, 4, 8. | ||
16 | Default flag for internal sources should be set to 4 (active high). | ||
17 | - reg: Should contain AIC registers location and length | ||
18 | |||
19 | Examples: | ||
20 | /* | ||
21 | * AIC | ||
22 | */ | ||
23 | aic: interrupt-controller@fffff000 { | ||
24 | compatible = "atmel,at91rm9200-aic"; | ||
25 | interrupt-controller; | ||
26 | interrupt-parent; | ||
27 | #interrupt-cells = <2>; | ||
28 | reg = <0xfffff000 0x200>; | ||
29 | }; | ||
30 | |||
31 | /* | ||
32 | * An interrupt generating device that is wired to an AIC. | ||
33 | */ | ||
34 | dma: dma-controller@ffffec00 { | ||
35 | compatible = "atmel,at91sam9g45-dma"; | ||
36 | reg = <0xffffec00 0x200>; | ||
37 | interrupts = <21 4>; | ||
38 | }; | ||
diff --git a/Documentation/devicetree/bindings/arm/atmel-at91.txt b/Documentation/devicetree/bindings/arm/atmel-at91.txt new file mode 100644 index 000000000000..ecc81e368715 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/atmel-at91.txt | |||
@@ -0,0 +1,92 @@ | |||
1 | Atmel AT91 device tree bindings. | ||
2 | ================================ | ||
3 | |||
4 | PIT Timer required properties: | ||
5 | - compatible: Should be "atmel,at91sam9260-pit" | ||
6 | - reg: Should contain registers location and length | ||
7 | - interrupts: Should contain interrupt for the PIT which is the IRQ line | ||
8 | shared across all System Controller members. | ||
9 | |||
10 | TC/TCLIB Timer required properties: | ||
11 | - compatible: Should be "atmel,<chip>-pit". | ||
12 | <chip> can be "at91rm9200" or "at91sam9x5" | ||
13 | - reg: Should contain registers location and length | ||
14 | - interrupts: Should contain all interrupts for the TC block | ||
15 | Note that you can specify several interrupt cells if the TC | ||
16 | block has one interrupt per channel. | ||
17 | |||
18 | Examples: | ||
19 | |||
20 | One interrupt per TC block: | ||
21 | tcb0: timer@fff7c000 { | ||
22 | compatible = "atmel,at91rm9200-tcb"; | ||
23 | reg = <0xfff7c000 0x100>; | ||
24 | interrupts = <18 4>; | ||
25 | }; | ||
26 | |||
27 | One interrupt per TC channel in a TC block: | ||
28 | tcb1: timer@fffdc000 { | ||
29 | compatible = "atmel,at91rm9200-tcb"; | ||
30 | reg = <0xfffdc000 0x100>; | ||
31 | interrupts = <26 4 27 4 28 4>; | ||
32 | }; | ||
33 | |||
34 | RSTC Reset Controller required properties: | ||
35 | - compatible: Should be "atmel,<chip>-rstc". | ||
36 | <chip> can be "at91sam9260" or "at91sam9g45" | ||
37 | - reg: Should contain registers location and length | ||
38 | |||
39 | Example: | ||
40 | |||
41 | rstc@fffffd00 { | ||
42 | compatible = "atmel,at91sam9260-rstc"; | ||
43 | reg = <0xfffffd00 0x10>; | ||
44 | }; | ||
45 | |||
46 | RAMC SDRAM/DDR Controller required properties: | ||
47 | - compatible: Should be "atmel,at91sam9260-sdramc", | ||
48 | "atmel,at91sam9g45-ddramc", | ||
49 | - reg: Should contain registers location and length | ||
50 | For at91sam9263 and at91sam9g45 you must specify 2 entries. | ||
51 | |||
52 | Examples: | ||
53 | |||
54 | ramc0: ramc@ffffe800 { | ||
55 | compatible = "atmel,at91sam9g45-ddramc"; | ||
56 | reg = <0xffffe800 0x200>; | ||
57 | }; | ||
58 | |||
59 | ramc0: ramc@ffffe400 { | ||
60 | compatible = "atmel,at91sam9g45-ddramc"; | ||
61 | reg = <0xffffe400 0x200 | ||
62 | 0xffffe600 0x200>; | ||
63 | }; | ||
64 | |||
65 | SHDWC Shutdown Controller | ||
66 | |||
67 | required properties: | ||
68 | - compatible: Should be "atmel,<chip>-shdwc". | ||
69 | <chip> can be "at91sam9260", "at91sam9rl" or "at91sam9x5". | ||
70 | - reg: Should contain registers location and length | ||
71 | |||
72 | optional properties: | ||
73 | - atmel,wakeup-mode: String, operation mode of the wakeup mode. | ||
74 | Supported values are: "none", "high", "low", "any". | ||
75 | - atmel,wakeup-counter: Counter on Wake-up 0 (between 0x0 and 0xf). | ||
76 | |||
77 | optional at91sam9260 properties: | ||
78 | - atmel,wakeup-rtt-timer: boolean to enable Real-time Timer Wake-up. | ||
79 | |||
80 | optional at91sam9rl properties: | ||
81 | - atmel,wakeup-rtc-timer: boolean to enable Real-time Clock Wake-up. | ||
82 | - atmel,wakeup-rtt-timer: boolean to enable Real-time Timer Wake-up. | ||
83 | |||
84 | optional at91sam9x5 properties: | ||
85 | - atmel,wakeup-rtc-timer: boolean to enable Real-time Clock Wake-up. | ||
86 | |||
87 | Example: | ||
88 | |||
89 | rstc@fffffd00 { | ||
90 | compatible = "atmel,at91sam9260-rstc"; | ||
91 | reg = <0xfffffd00 0x10>; | ||
92 | }; | ||
diff --git a/Documentation/devicetree/bindings/arm/atmel-pmc.txt b/Documentation/devicetree/bindings/arm/atmel-pmc.txt new file mode 100644 index 000000000000..389bed5056e8 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/atmel-pmc.txt | |||
@@ -0,0 +1,11 @@ | |||
1 | * Power Management Controller (PMC) | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Should be "atmel,at91rm9200-pmc" | ||
5 | - reg: Should contain PMC registers location and length | ||
6 | |||
7 | Examples: | ||
8 | pmc: pmc@fffffc00 { | ||
9 | compatible = "atmel,at91rm9200-pmc"; | ||
10 | reg = <0xfffffc00 0x100>; | ||
11 | }; | ||
diff --git a/Documentation/devicetree/bindings/arm/fsl.txt b/Documentation/devicetree/bindings/arm/fsl.txt index 54bdddadf1cf..bfbc771a65f8 100644 --- a/Documentation/devicetree/bindings/arm/fsl.txt +++ b/Documentation/devicetree/bindings/arm/fsl.txt | |||
@@ -28,3 +28,25 @@ Required root node properties: | |||
28 | i.MX6 Quad SABRE Lite Board | 28 | i.MX6 Quad SABRE Lite Board |
29 | Required root node properties: | 29 | Required root node properties: |
30 | - compatible = "fsl,imx6q-sabrelite", "fsl,imx6q"; | 30 | - compatible = "fsl,imx6q-sabrelite", "fsl,imx6q"; |
31 | |||
32 | Generic i.MX boards | ||
33 | ------------------- | ||
34 | |||
35 | No iomux setup is done for these boards, so this must have been configured | ||
36 | by the bootloader for boards to work with the generic bindings. | ||
37 | |||
38 | i.MX27 generic board | ||
39 | Required root node properties: | ||
40 | - compatible = "fsl,imx27"; | ||
41 | |||
42 | i.MX51 generic board | ||
43 | Required root node properties: | ||
44 | - compatible = "fsl,imx51"; | ||
45 | |||
46 | i.MX53 generic board | ||
47 | Required root node properties: | ||
48 | - compatible = "fsl,imx53"; | ||
49 | |||
50 | i.MX6q generic board | ||
51 | Required root node properties: | ||
52 | - compatible = "fsl,imx6q"; | ||
diff --git a/Documentation/devicetree/bindings/arm/mrvl.txt b/Documentation/devicetree/bindings/arm/mrvl.txt new file mode 100644 index 000000000000..d8de933e9d81 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/mrvl.txt | |||
@@ -0,0 +1,6 @@ | |||
1 | Marvell Platforms Device Tree Bindings | ||
2 | ---------------------------------------------------- | ||
3 | |||
4 | PXA168 Aspenite Board | ||
5 | Required root node properties: | ||
6 | - compatible = "mrvl,pxa168-aspenite", "mrvl,pxa168"; | ||
diff --git a/Documentation/devicetree/bindings/arm/omap/intc.txt b/Documentation/devicetree/bindings/arm/omap/intc.txt new file mode 100644 index 000000000000..f2583e6ec060 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/omap/intc.txt | |||
@@ -0,0 +1,27 @@ | |||
1 | * OMAP Interrupt Controller | ||
2 | |||
3 | OMAP2/3 are using a TI interrupt controller that can support several | ||
4 | configurable number of interrupts. | ||
5 | |||
6 | Main node required properties: | ||
7 | |||
8 | - compatible : should be: | ||
9 | "ti,omap2-intc" | ||
10 | - interrupt-controller : Identifies the node as an interrupt controller | ||
11 | - #interrupt-cells : Specifies the number of cells needed to encode an | ||
12 | interrupt source. The type shall be a <u32> and the value shall be 1. | ||
13 | |||
14 | The cell contains the interrupt number in the range [0-128]. | ||
15 | - ti,intc-size: Number of interrupts handled by the interrupt controller. | ||
16 | - reg: physical base address and size of the intc registers map. | ||
17 | |||
18 | Example: | ||
19 | |||
20 | intc: interrupt-controller@1 { | ||
21 | compatible = "ti,omap2-intc"; | ||
22 | interrupt-controller; | ||
23 | #interrupt-cells = <1>; | ||
24 | ti,intc-size = <96>; | ||
25 | reg = <0x48200000 0x1000>; | ||
26 | }; | ||
27 | |||
diff --git a/Documentation/devicetree/bindings/arm/spear.txt b/Documentation/devicetree/bindings/arm/spear.txt new file mode 100644 index 000000000000..f8e54f092328 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/spear.txt | |||
@@ -0,0 +1,8 @@ | |||
1 | ST SPEAr Platforms Device Tree Bindings | ||
2 | --------------------------------------- | ||
3 | |||
4 | Boards with the ST SPEAr600 SoC shall have the following properties: | ||
5 | |||
6 | Required root node property: | ||
7 | |||
8 | compatible = "st,spear600"; | ||
diff --git a/Documentation/devicetree/bindings/arm/tegra/emc.txt b/Documentation/devicetree/bindings/arm/tegra/emc.txt new file mode 100644 index 000000000000..09335f8eee00 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/tegra/emc.txt | |||
@@ -0,0 +1,100 @@ | |||
1 | Embedded Memory Controller | ||
2 | |||
3 | Properties: | ||
4 | - name : Should be emc | ||
5 | - #address-cells : Should be 1 | ||
6 | - #size-cells : Should be 0 | ||
7 | - compatible : Should contain "nvidia,tegra20-emc". | ||
8 | - reg : Offset and length of the register set for the device | ||
9 | - nvidia,use-ram-code : If present, the sub-nodes will be addressed | ||
10 | and chosen using the ramcode board selector. If omitted, only one | ||
11 | set of tables can be present and said tables will be used | ||
12 | irrespective of ram-code configuration. | ||
13 | |||
14 | Child device nodes describe the memory settings for different configurations and clock rates. | ||
15 | |||
16 | Example: | ||
17 | |||
18 | emc@7000f400 { | ||
19 | #address-cells = < 1 >; | ||
20 | #size-cells = < 0 >; | ||
21 | compatible = "nvidia,tegra20-emc"; | ||
22 | reg = <0x7000f4000 0x200>; | ||
23 | } | ||
24 | |||
25 | |||
26 | Embedded Memory Controller ram-code table | ||
27 | |||
28 | If the emc node has the nvidia,use-ram-code property present, then the | ||
29 | next level of nodes below the emc table are used to specify which settings | ||
30 | apply for which ram-code settings. | ||
31 | |||
32 | If the emc node lacks the nvidia,use-ram-code property, this level is omitted | ||
33 | and the tables are stored directly under the emc node (see below). | ||
34 | |||
35 | Properties: | ||
36 | |||
37 | - name : Should be emc-tables | ||
38 | - nvidia,ram-code : the binary representation of the ram-code board strappings | ||
39 | for which this node (and children) are valid. | ||
40 | |||
41 | |||
42 | |||
43 | Embedded Memory Controller configuration table | ||
44 | |||
45 | This is a table containing the EMC register settings for the various | ||
46 | operating speeds of the memory controller. They are always located as | ||
47 | subnodes of the emc controller node. | ||
48 | |||
49 | There are two ways of specifying which tables to use: | ||
50 | |||
51 | * The simplest is if there is just one set of tables in the device tree, | ||
52 | and they will always be used (based on which frequency is used). | ||
53 | This is the preferred method, especially when firmware can fill in | ||
54 | this information based on the specific system information and just | ||
55 | pass it on to the kernel. | ||
56 | |||
57 | * The slightly more complex one is when more than one memory configuration | ||
58 | might exist on the system. The Tegra20 platform handles this during | ||
59 | early boot by selecting one out of possible 4 memory settings based | ||
60 | on a 2-pin "ram code" bootstrap setting on the board. The values of | ||
61 | these strappings can be read through a register in the SoC, and thus | ||
62 | used to select which tables to use. | ||
63 | |||
64 | Properties: | ||
65 | - name : Should be emc-table | ||
66 | - compatible : Should contain "nvidia,tegra20-emc-table". | ||
67 | - reg : either an opaque enumerator to tell different tables apart, or | ||
68 | the valid frequency for which the table should be used (in kHz). | ||
69 | - clock-frequency : the clock frequency for the EMC at which this | ||
70 | table should be used (in kHz). | ||
71 | - nvidia,emc-registers : a 46 word array of EMC registers to be programmed | ||
72 | for operation at the 'clock-frequency' setting. | ||
73 | The order and contents of the registers are: | ||
74 | RC, RFC, RAS, RP, R2W, W2R, R2P, W2P, RD_RCD, WR_RCD, RRD, REXT, | ||
75 | WDV, QUSE, QRST, QSAFE, RDV, REFRESH, BURST_REFRESH_NUM, PDEX2WR, | ||
76 | PDEX2RD, PCHG2PDEN, ACT2PDEN, AR2PDEN, RW2PDEN, TXSR, TCKE, TFAW, | ||
77 | TRPAB, TCLKSTABLE, TCLKSTOP, TREFBW, QUSE_EXTRA, FBIO_CFG6, ODT_WRITE, | ||
78 | ODT_READ, FBIO_CFG5, CFG_DIG_DLL, DLL_XFORM_DQS, DLL_XFORM_QUSE, | ||
79 | ZCAL_REF_CNT, ZCAL_WAIT_CNT, AUTO_CAL_INTERVAL, CFG_CLKTRIM_0, | ||
80 | CFG_CLKTRIM_1, CFG_CLKTRIM_2 | ||
81 | |||
82 | emc-table@166000 { | ||
83 | reg = <166000>; | ||
84 | compatible = "nvidia,tegra20-emc-table"; | ||
85 | clock-frequency = < 166000 >; | ||
86 | nvidia,emc-registers = < 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ||
87 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ||
88 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ||
89 | 0 0 0 0 >; | ||
90 | }; | ||
91 | |||
92 | emc-table@333000 { | ||
93 | reg = <333000>; | ||
94 | compatible = "nvidia,tegra20-emc-table"; | ||
95 | clock-frequency = < 333000 >; | ||
96 | nvidia,emc-registers = < 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ||
97 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ||
98 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ||
99 | 0 0 0 0 >; | ||
100 | }; | ||
diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt new file mode 100644 index 000000000000..b5846e21cc2e --- /dev/null +++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | NVIDIA Tegra Power Management Controller (PMC) | ||
2 | |||
3 | Properties: | ||
4 | - name : Should be pmc | ||
5 | - compatible : Should contain "nvidia,tegra<chip>-pmc". | ||
6 | - reg : Offset and length of the register set for the device | ||
7 | - nvidia,invert-interrupt : If present, inverts the PMU interrupt signal. | ||
8 | The PMU is an external Power Management Unit, whose interrupt output | ||
9 | signal is fed into the PMC. This signal is optionally inverted, and then | ||
10 | fed into the ARM GIC. The PMC is not involved in the detection or | ||
11 | handling of this interrupt signal, merely its inversion. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | pmc@7000f400 { | ||
16 | compatible = "nvidia,tegra20-pmc"; | ||
17 | reg = <0x7000e400 0x400>; | ||
18 | nvidia,invert-interrupt; | ||
19 | }; | ||
diff --git a/Documentation/devicetree/bindings/arm/twd.txt b/Documentation/devicetree/bindings/arm/twd.txt new file mode 100644 index 000000000000..75b8610939fa --- /dev/null +++ b/Documentation/devicetree/bindings/arm/twd.txt | |||
@@ -0,0 +1,48 @@ | |||
1 | * ARM Timer Watchdog | ||
2 | |||
3 | ARM 11MP, Cortex-A5 and Cortex-A9 are often associated with a per-core | ||
4 | Timer-Watchdog (aka TWD), which provides both a per-cpu local timer | ||
5 | and watchdog. | ||
6 | |||
7 | The TWD is usually attached to a GIC to deliver its two per-processor | ||
8 | interrupts. | ||
9 | |||
10 | ** Timer node required properties: | ||
11 | |||
12 | - compatible : Should be one of: | ||
13 | "arm,cortex-a9-twd-timer" | ||
14 | "arm,cortex-a5-twd-timer" | ||
15 | "arm,arm11mp-twd-timer" | ||
16 | |||
17 | - interrupts : One interrupt to each core | ||
18 | |||
19 | - reg : Specify the base address and the size of the TWD timer | ||
20 | register window. | ||
21 | |||
22 | Example: | ||
23 | |||
24 | twd-timer@2c000600 { | ||
25 | compatible = "arm,arm11mp-twd-timer""; | ||
26 | reg = <0x2c000600 0x20>; | ||
27 | interrupts = <1 13 0xf01>; | ||
28 | }; | ||
29 | |||
30 | ** Watchdog node properties: | ||
31 | |||
32 | - compatible : Should be one of: | ||
33 | "arm,cortex-a9-twd-wdt" | ||
34 | "arm,cortex-a5-twd-wdt" | ||
35 | "arm,arm11mp-twd-wdt" | ||
36 | |||
37 | - interrupts : One interrupt to each core | ||
38 | |||
39 | - reg : Specify the base address and the size of the TWD watchdog | ||
40 | register window. | ||
41 | |||
42 | Example: | ||
43 | |||
44 | twd-watchdog@2c000620 { | ||
45 | compatible = "arm,arm11mp-twd-wdt"; | ||
46 | reg = <0x2c000620 0x20>; | ||
47 | interrupts = <1 14 0xf01>; | ||
48 | }; | ||
diff --git a/Documentation/devicetree/bindings/arm/vexpress.txt b/Documentation/devicetree/bindings/arm/vexpress.txt new file mode 100644 index 000000000000..ec8b50cbb2e8 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/vexpress.txt | |||
@@ -0,0 +1,146 @@ | |||
1 | ARM Versatile Express boards family | ||
2 | ----------------------------------- | ||
3 | |||
4 | ARM's Versatile Express platform consists of a motherboard and one | ||
5 | or more daughterboards (tiles). The motherboard provides a set of | ||
6 | peripherals. Processor and RAM "live" on the tiles. | ||
7 | |||
8 | The motherboard and each core tile should be described by a separate | ||
9 | Device Tree source file, with the tile's description including | ||
10 | the motherboard file using a /include/ directive. As the motherboard | ||
11 | can be initialized in one of two different configurations ("memory | ||
12 | maps"), care must be taken to include the correct one. | ||
13 | |||
14 | Required properties in the root node: | ||
15 | - compatible value: | ||
16 | compatible = "arm,vexpress,<model>", "arm,vexpress"; | ||
17 | where <model> is the full tile model name (as used in the tile's | ||
18 | Technical Reference Manual), eg.: | ||
19 | - for Coretile Express A5x2 (V2P-CA5s): | ||
20 | compatible = "arm,vexpress,v2p-ca5s", "arm,vexpress"; | ||
21 | - for Coretile Express A9x4 (V2P-CA9): | ||
22 | compatible = "arm,vexpress,v2p-ca9", "arm,vexpress"; | ||
23 | If a tile comes in several variants or can be used in more then one | ||
24 | configuration, the compatible value should be: | ||
25 | compatible = "arm,vexpress,<model>,<variant>", \ | ||
26 | "arm,vexpress,<model>", "arm,vexpress"; | ||
27 | eg: | ||
28 | - Coretile Express A15x2 (V2P-CA15) with Tech Chip 1: | ||
29 | compatible = "arm,vexpress,v2p-ca15,tc1", \ | ||
30 | "arm,vexpress,v2p-ca15", "arm,vexpress"; | ||
31 | - LogicTile Express 13MG (V2F-2XV6) running Cortex-A7 (3 cores) SMM: | ||
32 | compatible = "arm,vexpress,v2f-2xv6,ca7x3", \ | ||
33 | "arm,vexpress,v2f-2xv6", "arm,vexpress"; | ||
34 | |||
35 | Optional properties in the root node: | ||
36 | - tile model name (use name from the tile's Technical Reference | ||
37 | Manual, eg. "V2P-CA5s") | ||
38 | model = "<model>"; | ||
39 | - tile's HBI number (unique ARM's board model ID, visible on the | ||
40 | PCB's silkscreen) in hexadecimal transcription: | ||
41 | arm,hbi = <0xhbi> | ||
42 | eg: | ||
43 | - for Coretile Express A5x2 (V2P-CA5s) HBI-0191: | ||
44 | arm,hbi = <0x191>; | ||
45 | - Coretile Express A9x4 (V2P-CA9) HBI-0225: | ||
46 | arm,hbi = <0x225>; | ||
47 | |||
48 | Top-level standard "cpus" node is required. It must contain a node | ||
49 | with device_type = "cpu" property for every available core, eg.: | ||
50 | |||
51 | cpus { | ||
52 | #address-cells = <1>; | ||
53 | #size-cells = <0>; | ||
54 | |||
55 | cpu@0 { | ||
56 | device_type = "cpu"; | ||
57 | compatible = "arm,cortex-a5"; | ||
58 | reg = <0>; | ||
59 | }; | ||
60 | }; | ||
61 | |||
62 | The motherboard description file provides a single "motherboard" node | ||
63 | using 2 address cells corresponding to the Static Memory Bus used | ||
64 | between the motherboard and the tile. The first cell defines the Chip | ||
65 | Select (CS) line number, the second cell address offset within the CS. | ||
66 | All interrupt lines between the motherboard and the tile are active | ||
67 | high and are described using single cell. | ||
68 | |||
69 | Optional properties of the "motherboard" node: | ||
70 | - motherboard's memory map variant: | ||
71 | arm,v2m-memory-map = "<name>"; | ||
72 | where name is one of: | ||
73 | - "rs1" - for RS1 map (i.a. peripherals on CS3); this map is also | ||
74 | referred to as "ARM Cortex-A Series memory map": | ||
75 | arm,v2m-memory-map = "rs1"; | ||
76 | When this property is missing, the motherboard is using the original | ||
77 | memory map (also known as the "Legacy memory map", primarily used | ||
78 | with the original CoreTile Express A9x4) with peripherals on CS7. | ||
79 | |||
80 | Motherboard .dtsi files provide a set of labelled peripherals that | ||
81 | can be used to obtain required phandle in the tile's "aliases" node: | ||
82 | - UARTs, note that the numbers correspond to the physical connectors | ||
83 | on the motherboard's back panel: | ||
84 | v2m_serial0, v2m_serial1, v2m_serial2 and v2m_serial3 | ||
85 | - I2C controllers: | ||
86 | v2m_i2c_dvi and v2m_i2c_pcie | ||
87 | - SP804 timers: | ||
88 | v2m_timer01 and v2m_timer23 | ||
89 | |||
90 | Current Linux implementation requires a "arm,v2m_timer" alias | ||
91 | pointing at one of the motherboard's SP804 timers, if it is to be | ||
92 | used as the system timer. This alias should be defined in the | ||
93 | motherboard files. | ||
94 | |||
95 | The tile description must define "ranges", "interrupt-map-mask" and | ||
96 | "interrupt-map" properties to translate the motherboard's address | ||
97 | and interrupt space into one used by the tile's processor. | ||
98 | |||
99 | Abbreviated example: | ||
100 | |||
101 | /dts-v1/; | ||
102 | |||
103 | / { | ||
104 | model = "V2P-CA5s"; | ||
105 | arm,hbi = <0x225>; | ||
106 | compatible = "arm,vexpress-v2p-ca5s", "arm,vexpress"; | ||
107 | interrupt-parent = <&gic>; | ||
108 | #address-cells = <1>; | ||
109 | #size-cells = <1>; | ||
110 | |||
111 | chosen { }; | ||
112 | |||
113 | aliases { | ||
114 | serial0 = &v2m_serial0; | ||
115 | }; | ||
116 | |||
117 | cpus { | ||
118 | #address-cells = <1>; | ||
119 | #size-cells = <0>; | ||
120 | |||
121 | cpu@0 { | ||
122 | device_type = "cpu"; | ||
123 | compatible = "arm,cortex-a5"; | ||
124 | reg = <0>; | ||
125 | }; | ||
126 | }; | ||
127 | |||
128 | gic: interrupt-controller@2c001000 { | ||
129 | compatible = "arm,cortex-a9-gic"; | ||
130 | #interrupt-cells = <3>; | ||
131 | #address-cells = <0>; | ||
132 | interrupt-controller; | ||
133 | reg = <0x2c001000 0x1000>, | ||
134 | <0x2c000100 0x100>; | ||
135 | }; | ||
136 | |||
137 | motherboard { | ||
138 | /* CS0 is visible at 0x08000000 */ | ||
139 | ranges = <0 0 0x08000000 0x04000000>; | ||
140 | interrupt-map-mask = <0 0 63>; | ||
141 | /* Active high IRQ 0 is connected to GIC's SPI0 */ | ||
142 | interrupt-map = <0 0 0 &gic 0 0 4>; | ||
143 | }; | ||
144 | }; | ||
145 | |||
146 | /include/ "vexpress-v2m-rs1.dtsi" | ||
diff --git a/Documentation/devicetree/bindings/dma/tegra20-apbdma.txt b/Documentation/devicetree/bindings/dma/tegra20-apbdma.txt new file mode 100644 index 000000000000..90fa7da525b8 --- /dev/null +++ b/Documentation/devicetree/bindings/dma/tegra20-apbdma.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | * NVIDIA Tegra APB DMA controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Should be "nvidia,<chip>-apbdma" | ||
5 | - reg: Should contain DMA registers location and length. This shuld include | ||
6 | all of the per-channel registers. | ||
7 | - interrupts: Should contain all of the per-channel DMA interrupts. | ||
8 | |||
9 | Examples: | ||
10 | |||
11 | apbdma: dma@6000a000 { | ||
12 | compatible = "nvidia,tegra20-apbdma"; | ||
13 | reg = <0x6000a000 0x1200>; | ||
14 | interrupts = < 0 136 0x04 | ||
15 | 0 137 0x04 | ||
16 | 0 138 0x04 | ||
17 | 0 139 0x04 | ||
18 | 0 140 0x04 | ||
19 | 0 141 0x04 | ||
20 | 0 142 0x04 | ||
21 | 0 143 0x04 | ||
22 | 0 144 0x04 | ||
23 | 0 145 0x04 | ||
24 | 0 146 0x04 | ||
25 | 0 147 0x04 | ||
26 | 0 148 0x04 | ||
27 | 0 149 0x04 | ||
28 | 0 150 0x04 | ||
29 | 0 151 0x04 >; | ||
30 | }; | ||
diff --git a/Documentation/devicetree/bindings/gpio/gpio-omap.txt b/Documentation/devicetree/bindings/gpio/gpio-omap.txt new file mode 100644 index 000000000000..bff51a2fee1e --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-omap.txt | |||
@@ -0,0 +1,36 @@ | |||
1 | OMAP GPIO controller bindings | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: | ||
5 | - "ti,omap2-gpio" for OMAP2 controllers | ||
6 | - "ti,omap3-gpio" for OMAP3 controllers | ||
7 | - "ti,omap4-gpio" for OMAP4 controllers | ||
8 | - #gpio-cells : Should be two. | ||
9 | - first cell is the pin number | ||
10 | - second cell is used to specify optional parameters (unused) | ||
11 | - gpio-controller : Marks the device node as a GPIO controller. | ||
12 | - #interrupt-cells : Should be 2. | ||
13 | - interrupt-controller: Mark the device node as an interrupt controller | ||
14 | The first cell is the GPIO number. | ||
15 | The second cell is used to specify flags: | ||
16 | bits[3:0] trigger type and level flags: | ||
17 | 1 = low-to-high edge triggered. | ||
18 | 2 = high-to-low edge triggered. | ||
19 | 4 = active high level-sensitive. | ||
20 | 8 = active low level-sensitive. | ||
21 | |||
22 | OMAP specific properties: | ||
23 | - ti,hwmods: Name of the hwmod associated to the GPIO: | ||
24 | "gpio<X>", <X> being the 1-based instance number from the HW spec | ||
25 | |||
26 | |||
27 | Example: | ||
28 | |||
29 | gpio4: gpio4 { | ||
30 | compatible = "ti,omap4-gpio"; | ||
31 | ti,hwmods = "gpio4"; | ||
32 | #gpio-cells = <2>; | ||
33 | gpio-controller; | ||
34 | #interrupt-cells = <2>; | ||
35 | interrupt-controller; | ||
36 | }; | ||
diff --git a/Documentation/devicetree/bindings/gpio/gpio-twl4030.txt b/Documentation/devicetree/bindings/gpio/gpio-twl4030.txt new file mode 100644 index 000000000000..16695d9cf1e8 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-twl4030.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | twl4030 GPIO controller bindings | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: | ||
5 | - "ti,twl4030-gpio" for twl4030 GPIO controller | ||
6 | - #gpio-cells : Should be two. | ||
7 | - first cell is the pin number | ||
8 | - second cell is used to specify optional parameters (unused) | ||
9 | - gpio-controller : Marks the device node as a GPIO controller. | ||
10 | - #interrupt-cells : Should be 2. | ||
11 | - interrupt-controller: Mark the device node as an interrupt controller | ||
12 | The first cell is the GPIO number. | ||
13 | The second cell is not used. | ||
14 | |||
15 | Example: | ||
16 | |||
17 | twl_gpio: gpio { | ||
18 | compatible = "ti,twl4030-gpio"; | ||
19 | #gpio-cells = <2>; | ||
20 | gpio-controller; | ||
21 | #interrupt-cells = <2>; | ||
22 | interrupt-controller; | ||
23 | }; | ||
diff --git a/Documentation/devicetree/bindings/gpio/gpio_atmel.txt b/Documentation/devicetree/bindings/gpio/gpio_atmel.txt new file mode 100644 index 000000000000..66efc804806a --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio_atmel.txt | |||
@@ -0,0 +1,20 @@ | |||
1 | * Atmel GPIO controller (PIO) | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: "atmel,<chip>-gpio", where <chip> is at91rm9200 or at91sam9x5. | ||
5 | - reg: Should contain GPIO controller registers location and length | ||
6 | - interrupts: Should be the port interrupt shared by all the pins. | ||
7 | - #gpio-cells: Should be two. The first cell is the pin number and | ||
8 | the second cell is used to specify optional parameters (currently | ||
9 | unused). | ||
10 | - gpio-controller: Marks the device node as a GPIO controller. | ||
11 | |||
12 | Example: | ||
13 | pioA: gpio@fffff200 { | ||
14 | compatible = "atmel,at91rm9200-gpio"; | ||
15 | reg = <0xfffff200 0x100>; | ||
16 | interrupts = <2 4>; | ||
17 | #gpio-cells = <2>; | ||
18 | gpio-controller; | ||
19 | }; | ||
20 | |||
diff --git a/Documentation/devicetree/bindings/gpio/gpio_i2c.txt b/Documentation/devicetree/bindings/gpio/gpio_i2c.txt new file mode 100644 index 000000000000..4f8ec947c6bd --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio_i2c.txt | |||
@@ -0,0 +1,32 @@ | |||
1 | Device-Tree bindings for i2c gpio driver | ||
2 | |||
3 | Required properties: | ||
4 | - compatible = "i2c-gpio"; | ||
5 | - gpios: sda and scl gpio | ||
6 | |||
7 | |||
8 | Optional properties: | ||
9 | - i2c-gpio,sda-open-drain: sda as open drain | ||
10 | - i2c-gpio,scl-open-drain: scl as open drain | ||
11 | - i2c-gpio,scl-output-only: scl as output only | ||
12 | - i2c-gpio,delay-us: delay between GPIO operations (may depend on each platform) | ||
13 | - i2c-gpio,timeout-ms: timeout to get data | ||
14 | |||
15 | Example nodes: | ||
16 | |||
17 | i2c@0 { | ||
18 | compatible = "i2c-gpio"; | ||
19 | gpios = <&pioA 23 0 /* sda */ | ||
20 | &pioA 24 0 /* scl */ | ||
21 | >; | ||
22 | i2c-gpio,sda-open-drain; | ||
23 | i2c-gpio,scl-open-drain; | ||
24 | i2c-gpio,delay-us = <2>; /* ~100 kHz */ | ||
25 | #address-cells = <1>; | ||
26 | #size-cells = <0>; | ||
27 | |||
28 | rv3029c2@56 { | ||
29 | compatible = "rv3029c2"; | ||
30 | reg = <0x56>; | ||
31 | }; | ||
32 | }; | ||
diff --git a/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt b/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt index eb4b530d64e1..023c9526e5f8 100644 --- a/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt +++ b/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt | |||
@@ -1,8 +1,40 @@ | |||
1 | NVIDIA Tegra 2 GPIO controller | 1 | NVIDIA Tegra GPIO controller |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible : "nvidia,tegra20-gpio" | 4 | - compatible : "nvidia,tegra<chip>-gpio" |
5 | - reg : Physical base address and length of the controller's registers. | ||
6 | - interrupts : The interrupt outputs from the controller. For Tegra20, | ||
7 | there should be 7 interrupts specified, and for Tegra30, there should | ||
8 | be 8 interrupts specified. | ||
5 | - #gpio-cells : Should be two. The first cell is the pin number and the | 9 | - #gpio-cells : Should be two. The first cell is the pin number and the |
6 | second cell is used to specify optional parameters: | 10 | second cell is used to specify optional parameters: |
7 | - bit 0 specifies polarity (0 for normal, 1 for inverted) | 11 | - bit 0 specifies polarity (0 for normal, 1 for inverted) |
8 | - gpio-controller : Marks the device node as a GPIO controller. | 12 | - gpio-controller : Marks the device node as a GPIO controller. |
13 | - #interrupt-cells : Should be 2. | ||
14 | The first cell is the GPIO number. | ||
15 | The second cell is used to specify flags: | ||
16 | bits[3:0] trigger type and level flags: | ||
17 | 1 = low-to-high edge triggered. | ||
18 | 2 = high-to-low edge triggered. | ||
19 | 4 = active high level-sensitive. | ||
20 | 8 = active low level-sensitive. | ||
21 | Valid combinations are 1, 2, 3, 4, 8. | ||
22 | - interrupt-controller : Marks the device node as an interrupt controller. | ||
23 | |||
24 | Example: | ||
25 | |||
26 | gpio: gpio@6000d000 { | ||
27 | compatible = "nvidia,tegra20-gpio"; | ||
28 | reg = < 0x6000d000 0x1000 >; | ||
29 | interrupts = < 0 32 0x04 | ||
30 | 0 33 0x04 | ||
31 | 0 34 0x04 | ||
32 | 0 35 0x04 | ||
33 | 0 55 0x04 | ||
34 | 0 87 0x04 | ||
35 | 0 89 0x04 >; | ||
36 | #gpio-cells = <2>; | ||
37 | gpio-controller; | ||
38 | #interrupt-cells = <2>; | ||
39 | interrupt-controller; | ||
40 | }; | ||
diff --git a/Documentation/devicetree/bindings/gpio/mrvl-gpio.txt b/Documentation/devicetree/bindings/gpio/mrvl-gpio.txt new file mode 100644 index 000000000000..1e34cfe5ebea --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/mrvl-gpio.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | * Marvell PXA GPIO controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : Should be "mrvl,pxa-gpio" or "mrvl,mmp-gpio" | ||
5 | - reg : Address and length of the register set for the device | ||
6 | - interrupts : Should be the port interrupt shared by all gpio pins, if | ||
7 | - interrupt-name : Should be the name of irq resource. | ||
8 | one number. | ||
9 | - gpio-controller : Marks the device node as a gpio controller. | ||
10 | - #gpio-cells : Should be one. It is the pin number. | ||
11 | |||
12 | Example: | ||
13 | |||
14 | gpio: gpio@d4019000 { | ||
15 | compatible = "mrvl,mmp-gpio", "mrvl,pxa-gpio"; | ||
16 | reg = <0xd4019000 0x1000>; | ||
17 | interrupts = <49>, <17>, <18>; | ||
18 | interrupt-name = "gpio_mux", "gpio0", "gpio1"; | ||
19 | gpio-controller; | ||
20 | #gpio-cells = <1>; | ||
21 | interrupt-controller; | ||
22 | #interrupt-cells = <1>; | ||
23 | }; | ||
diff --git a/Documentation/devicetree/bindings/gpio/sodaville.txt b/Documentation/devicetree/bindings/gpio/sodaville.txt new file mode 100644 index 000000000000..563eff22b975 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/sodaville.txt | |||
@@ -0,0 +1,48 @@ | |||
1 | GPIO controller on CE4100 / Sodaville SoCs | ||
2 | ========================================== | ||
3 | |||
4 | The bindings for CE4100's GPIO controller match the generic description | ||
5 | which is covered by the gpio.txt file in this folder. | ||
6 | |||
7 | The only additional property is the intel,muxctl property which holds the | ||
8 | value which is written into the MUXCNTL register. | ||
9 | |||
10 | There is no compatible property for now because the driver is probed via | ||
11 | PCI id (vendor 0x8086 device 0x2e67). | ||
12 | |||
13 | The interrupt specifier consists of two cells encoded as follows: | ||
14 | - <1st cell>: The interrupt-number that identifies the interrupt source. | ||
15 | - <2nd cell>: The level-sense information, encoded as follows: | ||
16 | 4 - active high level-sensitive | ||
17 | 8 - active low level-sensitive | ||
18 | |||
19 | Example of the GPIO device and one user: | ||
20 | |||
21 | pcigpio: gpio@b,1 { | ||
22 | /* two cells for GPIO and interrupt */ | ||
23 | #gpio-cells = <2>; | ||
24 | #interrupt-cells = <2>; | ||
25 | compatible = "pci8086,2e67.2", | ||
26 | "pci8086,2e67", | ||
27 | "pciclassff0000", | ||
28 | "pciclassff00"; | ||
29 | |||
30 | reg = <0x15900 0x0 0x0 0x0 0x0>; | ||
31 | /* Interrupt line of the gpio device */ | ||
32 | interrupts = <15 1>; | ||
33 | /* It is an interrupt and GPIO controller itself */ | ||
34 | interrupt-controller; | ||
35 | gpio-controller; | ||
36 | intel,muxctl = <0>; | ||
37 | }; | ||
38 | |||
39 | testuser@20 { | ||
40 | compatible = "example,testuser"; | ||
41 | /* User the 11th GPIO line as an active high triggered | ||
42 | * level interrupt | ||
43 | */ | ||
44 | interrupts = <11 8>; | ||
45 | interrupt-parent = <&pcigpio>; | ||
46 | /* Use this GPIO also with the gpio functions */ | ||
47 | gpios = <&pcigpio 11 0>; | ||
48 | }; | ||
diff --git a/Documentation/devicetree/bindings/i2c/mrvl-i2c.txt b/Documentation/devicetree/bindings/i2c/mrvl-i2c.txt new file mode 100644 index 000000000000..071eb3caae91 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/mrvl-i2c.txt | |||
@@ -0,0 +1,37 @@ | |||
1 | * I2C | ||
2 | |||
3 | Required properties : | ||
4 | |||
5 | - reg : Offset and length of the register set for the device | ||
6 | - compatible : should be "mrvl,mmp-twsi" where CHIP is the name of a | ||
7 | compatible processor, e.g. pxa168, pxa910, mmp2, mmp3. | ||
8 | For the pxa2xx/pxa3xx, an additional node "mrvl,pxa-i2c" is required | ||
9 | as shown in the example below. | ||
10 | |||
11 | Recommended properties : | ||
12 | |||
13 | - interrupts : <a b> where a is the interrupt number and b is a | ||
14 | field that represents an encoding of the sense and level | ||
15 | information for the interrupt. This should be encoded based on | ||
16 | the information in section 2) depending on the type of interrupt | ||
17 | controller you have. | ||
18 | - interrupt-parent : the phandle for the interrupt controller that | ||
19 | services interrupts for this device. | ||
20 | - mrvl,i2c-polling : Disable interrupt of i2c controller. Polling | ||
21 | status register of i2c controller instead. | ||
22 | - mrvl,i2c-fast-mode : Enable fast mode of i2c controller. | ||
23 | |||
24 | Examples: | ||
25 | twsi1: i2c@d4011000 { | ||
26 | compatible = "mrvl,mmp-twsi", "mrvl,pxa-i2c"; | ||
27 | reg = <0xd4011000 0x1000>; | ||
28 | interrupts = <7>; | ||
29 | mrvl,i2c-fast-mode; | ||
30 | }; | ||
31 | |||
32 | twsi2: i2c@d4025000 { | ||
33 | compatible = "mrvl,mmp-twsi", "mrvl,pxa-i2c"; | ||
34 | reg = <0xd4025000 0x1000>; | ||
35 | interrupts = <58>; | ||
36 | }; | ||
37 | |||
diff --git a/Documentation/devicetree/bindings/mtd/atmel-nand.txt b/Documentation/devicetree/bindings/mtd/atmel-nand.txt new file mode 100644 index 000000000000..5903ecf6e895 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/atmel-nand.txt | |||
@@ -0,0 +1,41 @@ | |||
1 | Atmel NAND flash | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "atmel,at91rm9200-nand". | ||
5 | - reg : should specify localbus address and size used for the chip, | ||
6 | and if availlable the ECC. | ||
7 | - atmel,nand-addr-offset : offset for the address latch. | ||
8 | - atmel,nand-cmd-offset : offset for the command latch. | ||
9 | - #address-cells, #size-cells : Must be present if the device has sub-nodes | ||
10 | representing partitions. | ||
11 | |||
12 | - gpios : specifies the gpio pins to control the NAND device. detect is an | ||
13 | optional gpio and may be set to 0 if not present. | ||
14 | |||
15 | Optional properties: | ||
16 | - nand-ecc-mode : String, operation mode of the NAND ecc mode, soft by default. | ||
17 | Supported values are: "none", "soft", "hw", "hw_syndrome", "hw_oob_first", | ||
18 | "soft_bch". | ||
19 | - nand-bus-width : 8 or 16 bus width if not present 8 | ||
20 | - nand-on-flash-bbt: boolean to enable on flash bbt option if not present false | ||
21 | |||
22 | Examples: | ||
23 | nand0: nand@40000000,0 { | ||
24 | compatible = "atmel,at91rm9200-nand"; | ||
25 | #address-cells = <1>; | ||
26 | #size-cells = <1>; | ||
27 | reg = <0x40000000 0x10000000 | ||
28 | 0xffffe800 0x200 | ||
29 | >; | ||
30 | atmel,nand-addr-offset = <21>; | ||
31 | atmel,nand-cmd-offset = <22>; | ||
32 | nand-on-flash-bbt; | ||
33 | nand-ecc-mode = "soft"; | ||
34 | gpios = <&pioC 13 0 | ||
35 | &pioC 14 0 | ||
36 | 0 | ||
37 | >; | ||
38 | partition@0 { | ||
39 | ... | ||
40 | }; | ||
41 | }; | ||
diff --git a/Documentation/devicetree/bindings/mtd/nand.txt b/Documentation/devicetree/bindings/mtd/nand.txt new file mode 100644 index 000000000000..03855c8c492a --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/nand.txt | |||
@@ -0,0 +1,7 @@ | |||
1 | * MTD generic binding | ||
2 | |||
3 | - nand-ecc-mode : String, operation mode of the NAND ecc mode. | ||
4 | Supported values are: "none", "soft", "hw", "hw_syndrome", "hw_oob_first", | ||
5 | "soft_bch". | ||
6 | - nand-bus-width : 8 or 16 bus width if not present 8 | ||
7 | - nand-on-flash-bbt: boolean to enable on flash bbt option if not present false | ||
diff --git a/Documentation/devicetree/bindings/rtc/sa1100-rtc.txt b/Documentation/devicetree/bindings/rtc/sa1100-rtc.txt new file mode 100644 index 000000000000..0cda19ad4859 --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/sa1100-rtc.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | * Marvell Real Time Clock controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be "mrvl,sa1100-rtc" | ||
5 | - reg: physical base address of the controller and length of memory mapped | ||
6 | region. | ||
7 | - interrupts: Should be two. The first interrupt number is the rtc alarm | ||
8 | interrupt and the second interrupt number is the rtc hz interrupt. | ||
9 | - interrupt-names: Assign name of irq resource. | ||
10 | |||
11 | Example: | ||
12 | rtc: rtc@d4010000 { | ||
13 | compatible = "mrvl,mmp-rtc"; | ||
14 | reg = <0xd4010000 0x1000>; | ||
15 | interrupts = <5>, <6>; | ||
16 | interrupt-name = "rtc 1Hz", "rtc alarm"; | ||
17 | }; | ||
diff --git a/Documentation/devicetree/bindings/serial/mrvl-serial.txt b/Documentation/devicetree/bindings/serial/mrvl-serial.txt new file mode 100644 index 000000000000..d744340de887 --- /dev/null +++ b/Documentation/devicetree/bindings/serial/mrvl-serial.txt | |||
@@ -0,0 +1,4 @@ | |||
1 | PXA UART controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : should be "mrvl,mmp-uart" or "mrvl,pxa-uart". | ||
diff --git a/Documentation/devicetree/bindings/usb/atmel-usb.txt b/Documentation/devicetree/bindings/usb/atmel-usb.txt new file mode 100644 index 000000000000..60bd2150a3e6 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/atmel-usb.txt | |||
@@ -0,0 +1,49 @@ | |||
1 | Atmel SOC USB controllers | ||
2 | |||
3 | OHCI | ||
4 | |||
5 | Required properties: | ||
6 | - compatible: Should be "atmel,at91rm9200-ohci" for USB controllers | ||
7 | used in host mode. | ||
8 | - num-ports: Number of ports. | ||
9 | - atmel,vbus-gpio: If present, specifies a gpio that needs to be | ||
10 | activated for the bus to be powered. | ||
11 | - atmel,oc-gpio: If present, specifies a gpio that needs to be | ||
12 | activated for the overcurrent detection. | ||
13 | |||
14 | usb0: ohci@00500000 { | ||
15 | compatible = "atmel,at91rm9200-ohci", "usb-ohci"; | ||
16 | reg = <0x00500000 0x100000>; | ||
17 | interrupts = <20 4>; | ||
18 | num-ports = <2>; | ||
19 | }; | ||
20 | |||
21 | EHCI | ||
22 | |||
23 | Required properties: | ||
24 | - compatible: Should be "atmel,at91sam9g45-ehci" for USB controllers | ||
25 | used in host mode. | ||
26 | |||
27 | usb1: ehci@00800000 { | ||
28 | compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; | ||
29 | reg = <0x00800000 0x100000>; | ||
30 | interrupts = <22 4>; | ||
31 | }; | ||
32 | |||
33 | AT91 USB device controller | ||
34 | |||
35 | Required properties: | ||
36 | - compatible: Should be "atmel,at91rm9200-udc" | ||
37 | - reg: Address and length of the register set for the device | ||
38 | - interrupts: Should contain macb interrupt | ||
39 | |||
40 | Optional properties: | ||
41 | - atmel,vbus-gpio: If present, specifies a gpio that needs to be | ||
42 | activated for the bus to be powered. | ||
43 | |||
44 | usb1: gadget@fffa4000 { | ||
45 | compatible = "atmel,at91rm9200-udc"; | ||
46 | reg = <0xfffa4000 0x4000>; | ||
47 | interrupts = <10 4>; | ||
48 | atmel,vbus-gpio = <&pioC 5 0>; | ||
49 | }; | ||
diff --git a/Documentation/devicetree/bindings/usb/tegra-usb.txt b/Documentation/devicetree/bindings/usb/tegra-usb.txt index 035d63d5646d..007005ddbe12 100644 --- a/Documentation/devicetree/bindings/usb/tegra-usb.txt +++ b/Documentation/devicetree/bindings/usb/tegra-usb.txt | |||
@@ -11,3 +11,16 @@ Required properties : | |||
11 | - phy_type : Should be one of "ulpi" or "utmi". | 11 | - phy_type : Should be one of "ulpi" or "utmi". |
12 | - nvidia,vbus-gpio : If present, specifies a gpio that needs to be | 12 | - nvidia,vbus-gpio : If present, specifies a gpio that needs to be |
13 | activated for the bus to be powered. | 13 | activated for the bus to be powered. |
14 | |||
15 | Optional properties: | ||
16 | - dr_mode : dual role mode. Indicates the working mode for | ||
17 | nvidia,tegra20-ehci compatible controllers. Can be "host", "peripheral", | ||
18 | or "otg". Default to "host" if not defined for backward compatibility. | ||
19 | host means this is a host controller | ||
20 | peripheral means it is device controller | ||
21 | otg means it can operate as either ("on the go") | ||
22 | - nvidia,has-legacy-mode : boolean indicates whether this controller can | ||
23 | operate in legacy mode (as APX 2500 / 2600). In legacy mode some | ||
24 | registers are accessed through the APB_MISC base address instead of | ||
25 | the USB controller. Since this is a legacy issue it probably does not | ||
26 | warrant a compatible string of its own. | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 4bfd982f8080..0cad4803ffac 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -513,20 +513,6 @@ Who: Bjorn Helgaas <bhelgaas@google.com> | |||
513 | 513 | ||
514 | ---------------------------- | 514 | ---------------------------- |
515 | 515 | ||
516 | What: The CAP9 SoC family will be removed | ||
517 | When: 3.4 | ||
518 | Files: arch/arm/mach-at91/at91cap9.c | ||
519 | arch/arm/mach-at91/at91cap9_devices.c | ||
520 | arch/arm/mach-at91/include/mach/at91cap9.h | ||
521 | arch/arm/mach-at91/include/mach/at91cap9_matrix.h | ||
522 | arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h | ||
523 | arch/arm/mach-at91/board-cap9adk.c | ||
524 | Why: The code is not actively maintained and platforms are now hard to find. | ||
525 | Who: Nicolas Ferre <nicolas.ferre@atmel.com> | ||
526 | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | ||
527 | |||
528 | ---------------------------- | ||
529 | |||
530 | What: Low Performance USB Block driver ("CONFIG_BLK_DEV_UB") | 516 | What: Low Performance USB Block driver ("CONFIG_BLK_DEV_UB") |
531 | When: 3.6 | 517 | When: 3.6 |
532 | Why: This driver provides support for USB storage devices like "USB | 518 | Why: This driver provides support for USB storage devices like "USB |
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt index 8c10bf375c73..1b7f9acbcbbe 100644 --- a/Documentation/filesystems/ext4.txt +++ b/Documentation/filesystems/ext4.txt | |||
@@ -144,9 +144,6 @@ journal_async_commit Commit block can be written to disk without waiting | |||
144 | mount the device. This will enable 'journal_checksum' | 144 | mount the device. This will enable 'journal_checksum' |
145 | internally. | 145 | internally. |
146 | 146 | ||
147 | journal=update Update the ext4 file system's journal to the current | ||
148 | format. | ||
149 | |||
150 | journal_dev=devnum When the external journal device's major/minor numbers | 147 | journal_dev=devnum When the external journal device's major/minor numbers |
151 | have changed, this option allows the user to specify | 148 | have changed, this option allows the user to specify |
152 | the new journal location. The journal device is | 149 | the new journal location. The journal device is |
@@ -356,11 +353,6 @@ nouid32 Disables 32-bit UIDs and GIDs. This is for | |||
356 | interoperability with older kernels which only | 353 | interoperability with older kernels which only |
357 | store and expect 16-bit values. | 354 | store and expect 16-bit values. |
358 | 355 | ||
359 | resize Allows to resize filesystem to the end of the last | ||
360 | existing block group, further resize has to be done | ||
361 | with resize2fs either online, or offline. It can be | ||
362 | used only with conjunction with remount. | ||
363 | |||
364 | block_validity This options allows to enables/disables the in-kernel | 356 | block_validity This options allows to enables/disables the in-kernel |
365 | noblock_validity facility for tracking filesystem metadata blocks | 357 | noblock_validity facility for tracking filesystem metadata blocks |
366 | within internal data structures. This allows multi- | 358 | within internal data structures. This allows multi- |
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index 792faa3c06cf..620a07844e8c 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt | |||
@@ -271,9 +271,26 @@ Some platforms may also use knowledge about what GPIOs are active for | |||
271 | power management, such as by powering down unused chip sectors and, more | 271 | power management, such as by powering down unused chip sectors and, more |
272 | easily, gating off unused clocks. | 272 | easily, gating off unused clocks. |
273 | 273 | ||
274 | Note that requesting a GPIO does NOT cause it to be configured in any | 274 | For GPIOs that use pins known to the pinctrl subsystem, that subsystem should |
275 | way; it just marks that GPIO as in use. Separate code must handle any | 275 | be informed of their use; a gpiolib driver's .request() operation may call |
276 | pin setup (e.g. controlling which pin the GPIO uses, pullup/pulldown). | 276 | pinctrl_request_gpio(), and a gpiolib driver's .free() operation may call |
277 | pinctrl_free_gpio(). The pinctrl subsystem allows a pinctrl_request_gpio() | ||
278 | to succeed concurrently with a pin or pingroup being "owned" by a device for | ||
279 | pin multiplexing. | ||
280 | |||
281 | Any programming of pin multiplexing hardware that is needed to route the | ||
282 | GPIO signal to the appropriate pin should occur within a GPIO driver's | ||
283 | .direction_input() or .direction_output() operations, and occur after any | ||
284 | setup of an output GPIO's value. This allows a glitch-free migration from a | ||
285 | pin's special function to GPIO. This is sometimes required when using a GPIO | ||
286 | to implement a workaround on signals typically driven by a non-GPIO HW block. | ||
287 | |||
288 | Some platforms allow some or all GPIO signals to be routed to different pins. | ||
289 | Similarly, other aspects of the GPIO or pin may need to be configured, such as | ||
290 | pullup/pulldown. Platform software should arrange that any such details are | ||
291 | configured prior to gpio_request() being called for those GPIOs, e.g. using | ||
292 | the pinctrl subsystem's mapping table, so that GPIO users need not be aware | ||
293 | of these details. | ||
277 | 294 | ||
278 | Also note that it's your responsibility to have stopped using a GPIO | 295 | Also note that it's your responsibility to have stopped using a GPIO |
279 | before you free it. | 296 | before you free it. |
@@ -302,6 +319,8 @@ where 'flags' is currently defined to specify the following properties: | |||
302 | 319 | ||
303 | * GPIOF_INIT_LOW - as output, set initial level to LOW | 320 | * GPIOF_INIT_LOW - as output, set initial level to LOW |
304 | * GPIOF_INIT_HIGH - as output, set initial level to HIGH | 321 | * GPIOF_INIT_HIGH - as output, set initial level to HIGH |
322 | * GPIOF_OPEN_DRAIN - gpio pin is open drain type. | ||
323 | * GPIOF_OPEN_SOURCE - gpio pin is open source type. | ||
305 | 324 | ||
306 | since GPIOF_INIT_* are only valid when configured as output, so group valid | 325 | since GPIOF_INIT_* are only valid when configured as output, so group valid |
307 | combinations as: | 326 | combinations as: |
@@ -310,8 +329,19 @@ combinations as: | |||
310 | * GPIOF_OUT_INIT_LOW - configured as output, initial level LOW | 329 | * GPIOF_OUT_INIT_LOW - configured as output, initial level LOW |
311 | * GPIOF_OUT_INIT_HIGH - configured as output, initial level HIGH | 330 | * GPIOF_OUT_INIT_HIGH - configured as output, initial level HIGH |
312 | 331 | ||
313 | In the future, these flags can be extended to support more properties such | 332 | When setting the flag as GPIOF_OPEN_DRAIN then it will assume that pins is |
314 | as open-drain status. | 333 | open drain type. Such pins will not be driven to 1 in output mode. It is |
334 | require to connect pull-up on such pins. By enabling this flag, gpio lib will | ||
335 | make the direction to input when it is asked to set value of 1 in output mode | ||
336 | to make the pin HIGH. The pin is make to LOW by driving value 0 in output mode. | ||
337 | |||
338 | When setting the flag as GPIOF_OPEN_SOURCE then it will assume that pins is | ||
339 | open source type. Such pins will not be driven to 0 in output mode. It is | ||
340 | require to connect pull-down on such pin. By enabling this flag, gpio lib will | ||
341 | make the direction to input when it is asked to set value of 0 in output mode | ||
342 | to make the pin LOW. The pin is make to HIGH by driving value 1 in output mode. | ||
343 | |||
344 | In the future, these flags can be extended to support more properties. | ||
315 | 345 | ||
316 | Further more, to ease the claim/release of multiple GPIOs, 'struct gpio' is | 346 | Further more, to ease the claim/release of multiple GPIOs, 'struct gpio' is |
317 | introduced to encapsulate all three fields as: | 347 | introduced to encapsulate all three fields as: |
diff --git a/Documentation/remoteproc.txt b/Documentation/remoteproc.txt new file mode 100644 index 000000000000..70a048cd3fa3 --- /dev/null +++ b/Documentation/remoteproc.txt | |||
@@ -0,0 +1,322 @@ | |||
1 | Remote Processor Framework | ||
2 | |||
3 | 1. Introduction | ||
4 | |||
5 | Modern SoCs typically have heterogeneous remote processor devices in asymmetric | ||
6 | multiprocessing (AMP) configurations, which may be running different instances | ||
7 | of operating system, whether it's Linux or any other flavor of real-time OS. | ||
8 | |||
9 | OMAP4, for example, has dual Cortex-A9, dual Cortex-M3 and a C64x+ DSP. | ||
10 | In a typical configuration, the dual cortex-A9 is running Linux in a SMP | ||
11 | configuration, and each of the other three cores (two M3 cores and a DSP) | ||
12 | is running its own instance of RTOS in an AMP configuration. | ||
13 | |||
14 | The remoteproc framework allows different platforms/architectures to | ||
15 | control (power on, load firmware, power off) those remote processors while | ||
16 | abstracting the hardware differences, so the entire driver doesn't need to be | ||
17 | duplicated. In addition, this framework also adds rpmsg virtio devices | ||
18 | for remote processors that supports this kind of communication. This way, | ||
19 | platform-specific remoteproc drivers only need to provide a few low-level | ||
20 | handlers, and then all rpmsg drivers will then just work | ||
21 | (for more information about the virtio-based rpmsg bus and its drivers, | ||
22 | please read Documentation/rpmsg.txt). | ||
23 | Registration of other types of virtio devices is now also possible. Firmwares | ||
24 | just need to publish what kind of virtio devices do they support, and then | ||
25 | remoteproc will add those devices. This makes it possible to reuse the | ||
26 | existing virtio drivers with remote processor backends at a minimal development | ||
27 | cost. | ||
28 | |||
29 | 2. User API | ||
30 | |||
31 | int rproc_boot(struct rproc *rproc) | ||
32 | - Boot a remote processor (i.e. load its firmware, power it on, ...). | ||
33 | If the remote processor is already powered on, this function immediately | ||
34 | returns (successfully). | ||
35 | Returns 0 on success, and an appropriate error value otherwise. | ||
36 | Note: to use this function you should already have a valid rproc | ||
37 | handle. There are several ways to achieve that cleanly (devres, pdata, | ||
38 | the way remoteproc_rpmsg.c does this, or, if this becomes prevalent, we | ||
39 | might also consider using dev_archdata for this). See also | ||
40 | rproc_get_by_name() below. | ||
41 | |||
42 | void rproc_shutdown(struct rproc *rproc) | ||
43 | - Power off a remote processor (previously booted with rproc_boot()). | ||
44 | In case @rproc is still being used by an additional user(s), then | ||
45 | this function will just decrement the power refcount and exit, | ||
46 | without really powering off the device. | ||
47 | Every call to rproc_boot() must (eventually) be accompanied by a call | ||
48 | to rproc_shutdown(). Calling rproc_shutdown() redundantly is a bug. | ||
49 | Notes: | ||
50 | - we're not decrementing the rproc's refcount, only the power refcount. | ||
51 | which means that the @rproc handle stays valid even after | ||
52 | rproc_shutdown() returns, and users can still use it with a subsequent | ||
53 | rproc_boot(), if needed. | ||
54 | - don't call rproc_shutdown() to unroll rproc_get_by_name(), exactly | ||
55 | because rproc_shutdown() _does not_ decrement the refcount of @rproc. | ||
56 | To decrement the refcount of @rproc, use rproc_put() (but _only_ if | ||
57 | you acquired @rproc using rproc_get_by_name()). | ||
58 | |||
59 | struct rproc *rproc_get_by_name(const char *name) | ||
60 | - Find an rproc handle using the remote processor's name, and then | ||
61 | boot it. If it's already powered on, then just immediately return | ||
62 | (successfully). Returns the rproc handle on success, and NULL on failure. | ||
63 | This function increments the remote processor's refcount, so always | ||
64 | use rproc_put() to decrement it back once rproc isn't needed anymore. | ||
65 | Note: currently rproc_get_by_name() and rproc_put() are not used anymore | ||
66 | by the rpmsg bus and its drivers. We need to scrutinize the use cases | ||
67 | that still need them, and see if we can migrate them to use the non | ||
68 | name-based boot/shutdown interface. | ||
69 | |||
70 | void rproc_put(struct rproc *rproc) | ||
71 | - Decrement @rproc's power refcount and shut it down if it reaches zero | ||
72 | (essentially by just calling rproc_shutdown), and then decrement @rproc's | ||
73 | validity refcount too. | ||
74 | After this function returns, @rproc may _not_ be used anymore, and its | ||
75 | handle should be considered invalid. | ||
76 | This function should be called _iff_ the @rproc handle was grabbed by | ||
77 | calling rproc_get_by_name(). | ||
78 | |||
79 | 3. Typical usage | ||
80 | |||
81 | #include <linux/remoteproc.h> | ||
82 | |||
83 | /* in case we were given a valid 'rproc' handle */ | ||
84 | int dummy_rproc_example(struct rproc *my_rproc) | ||
85 | { | ||
86 | int ret; | ||
87 | |||
88 | /* let's power on and boot our remote processor */ | ||
89 | ret = rproc_boot(my_rproc); | ||
90 | if (ret) { | ||
91 | /* | ||
92 | * something went wrong. handle it and leave. | ||
93 | */ | ||
94 | } | ||
95 | |||
96 | /* | ||
97 | * our remote processor is now powered on... give it some work | ||
98 | */ | ||
99 | |||
100 | /* let's shut it down now */ | ||
101 | rproc_shutdown(my_rproc); | ||
102 | } | ||
103 | |||
104 | 4. API for implementors | ||
105 | |||
106 | struct rproc *rproc_alloc(struct device *dev, const char *name, | ||
107 | const struct rproc_ops *ops, | ||
108 | const char *firmware, int len) | ||
109 | - Allocate a new remote processor handle, but don't register | ||
110 | it yet. Required parameters are the underlying device, the | ||
111 | name of this remote processor, platform-specific ops handlers, | ||
112 | the name of the firmware to boot this rproc with, and the | ||
113 | length of private data needed by the allocating rproc driver (in bytes). | ||
114 | |||
115 | This function should be used by rproc implementations during | ||
116 | initialization of the remote processor. | ||
117 | After creating an rproc handle using this function, and when ready, | ||
118 | implementations should then call rproc_register() to complete | ||
119 | the registration of the remote processor. | ||
120 | On success, the new rproc is returned, and on failure, NULL. | ||
121 | |||
122 | Note: _never_ directly deallocate @rproc, even if it was not registered | ||
123 | yet. Instead, if you just need to unroll rproc_alloc(), use rproc_free(). | ||
124 | |||
125 | void rproc_free(struct rproc *rproc) | ||
126 | - Free an rproc handle that was allocated by rproc_alloc. | ||
127 | This function should _only_ be used if @rproc was only allocated, | ||
128 | but not registered yet. | ||
129 | If @rproc was already successfully registered (by calling | ||
130 | rproc_register()), then use rproc_unregister() instead. | ||
131 | |||
132 | int rproc_register(struct rproc *rproc) | ||
133 | - Register @rproc with the remoteproc framework, after it has been | ||
134 | allocated with rproc_alloc(). | ||
135 | This is called by the platform-specific rproc implementation, whenever | ||
136 | a new remote processor device is probed. | ||
137 | Returns 0 on success and an appropriate error code otherwise. | ||
138 | Note: this function initiates an asynchronous firmware loading | ||
139 | context, which will look for virtio devices supported by the rproc's | ||
140 | firmware. | ||
141 | If found, those virtio devices will be created and added, so as a result | ||
142 | of registering this remote processor, additional virtio drivers might get | ||
143 | probed. | ||
144 | |||
145 | int rproc_unregister(struct rproc *rproc) | ||
146 | - Unregister a remote processor, and decrement its refcount. | ||
147 | If its refcount drops to zero, then @rproc will be freed. If not, | ||
148 | it will be freed later once the last reference is dropped. | ||
149 | |||
150 | This function should be called when the platform specific rproc | ||
151 | implementation decides to remove the rproc device. it should | ||
152 | _only_ be called if a previous invocation of rproc_register() | ||
153 | has completed successfully. | ||
154 | |||
155 | After rproc_unregister() returns, @rproc is _not_ valid anymore and | ||
156 | it shouldn't be used. More specifically, don't call rproc_free() | ||
157 | or try to directly free @rproc after rproc_unregister() returns; | ||
158 | none of these are needed, and calling them is a bug. | ||
159 | |||
160 | Returns 0 on success and -EINVAL if @rproc isn't valid. | ||
161 | |||
162 | 5. Implementation callbacks | ||
163 | |||
164 | These callbacks should be provided by platform-specific remoteproc | ||
165 | drivers: | ||
166 | |||
167 | /** | ||
168 | * struct rproc_ops - platform-specific device handlers | ||
169 | * @start: power on the device and boot it | ||
170 | * @stop: power off the device | ||
171 | * @kick: kick a virtqueue (virtqueue id given as a parameter) | ||
172 | */ | ||
173 | struct rproc_ops { | ||
174 | int (*start)(struct rproc *rproc); | ||
175 | int (*stop)(struct rproc *rproc); | ||
176 | void (*kick)(struct rproc *rproc, int vqid); | ||
177 | }; | ||
178 | |||
179 | Every remoteproc implementation should at least provide the ->start and ->stop | ||
180 | handlers. If rpmsg/virtio functionality is also desired, then the ->kick handler | ||
181 | should be provided as well. | ||
182 | |||
183 | The ->start() handler takes an rproc handle and should then power on the | ||
184 | device and boot it (use rproc->priv to access platform-specific private data). | ||
185 | The boot address, in case needed, can be found in rproc->bootaddr (remoteproc | ||
186 | core puts there the ELF entry point). | ||
187 | On success, 0 should be returned, and on failure, an appropriate error code. | ||
188 | |||
189 | The ->stop() handler takes an rproc handle and powers the device down. | ||
190 | On success, 0 is returned, and on failure, an appropriate error code. | ||
191 | |||
192 | The ->kick() handler takes an rproc handle, and an index of a virtqueue | ||
193 | where new message was placed in. Implementations should interrupt the remote | ||
194 | processor and let it know it has pending messages. Notifying remote processors | ||
195 | the exact virtqueue index to look in is optional: it is easy (and not | ||
196 | too expensive) to go through the existing virtqueues and look for new buffers | ||
197 | in the used rings. | ||
198 | |||
199 | 6. Binary Firmware Structure | ||
200 | |||
201 | At this point remoteproc only supports ELF32 firmware binaries. However, | ||
202 | it is quite expected that other platforms/devices which we'd want to | ||
203 | support with this framework will be based on different binary formats. | ||
204 | |||
205 | When those use cases show up, we will have to decouple the binary format | ||
206 | from the framework core, so we can support several binary formats without | ||
207 | duplicating common code. | ||
208 | |||
209 | When the firmware is parsed, its various segments are loaded to memory | ||
210 | according to the specified device address (might be a physical address | ||
211 | if the remote processor is accessing memory directly). | ||
212 | |||
213 | In addition to the standard ELF segments, most remote processors would | ||
214 | also include a special section which we call "the resource table". | ||
215 | |||
216 | The resource table contains system resources that the remote processor | ||
217 | requires before it should be powered on, such as allocation of physically | ||
218 | contiguous memory, or iommu mapping of certain on-chip peripherals. | ||
219 | Remotecore will only power up the device after all the resource table's | ||
220 | requirement are met. | ||
221 | |||
222 | In addition to system resources, the resource table may also contain | ||
223 | resource entries that publish the existence of supported features | ||
224 | or configurations by the remote processor, such as trace buffers and | ||
225 | supported virtio devices (and their configurations). | ||
226 | |||
227 | The resource table begins with this header: | ||
228 | |||
229 | /** | ||
230 | * struct resource_table - firmware resource table header | ||
231 | * @ver: version number | ||
232 | * @num: number of resource entries | ||
233 | * @reserved: reserved (must be zero) | ||
234 | * @offset: array of offsets pointing at the various resource entries | ||
235 | * | ||
236 | * The header of the resource table, as expressed by this structure, | ||
237 | * contains a version number (should we need to change this format in the | ||
238 | * future), the number of available resource entries, and their offsets | ||
239 | * in the table. | ||
240 | */ | ||
241 | struct resource_table { | ||
242 | u32 ver; | ||
243 | u32 num; | ||
244 | u32 reserved[2]; | ||
245 | u32 offset[0]; | ||
246 | } __packed; | ||
247 | |||
248 | Immediately following this header are the resource entries themselves, | ||
249 | each of which begins with the following resource entry header: | ||
250 | |||
251 | /** | ||
252 | * struct fw_rsc_hdr - firmware resource entry header | ||
253 | * @type: resource type | ||
254 | * @data: resource data | ||
255 | * | ||
256 | * Every resource entry begins with a 'struct fw_rsc_hdr' header providing | ||
257 | * its @type. The content of the entry itself will immediately follow | ||
258 | * this header, and it should be parsed according to the resource type. | ||
259 | */ | ||
260 | struct fw_rsc_hdr { | ||
261 | u32 type; | ||
262 | u8 data[0]; | ||
263 | } __packed; | ||
264 | |||
265 | Some resources entries are mere announcements, where the host is informed | ||
266 | of specific remoteproc configuration. Other entries require the host to | ||
267 | do something (e.g. allocate a system resource). Sometimes a negotiation | ||
268 | is expected, where the firmware requests a resource, and once allocated, | ||
269 | the host should provide back its details (e.g. address of an allocated | ||
270 | memory region). | ||
271 | |||
272 | Here are the various resource types that are currently supported: | ||
273 | |||
274 | /** | ||
275 | * enum fw_resource_type - types of resource entries | ||
276 | * | ||
277 | * @RSC_CARVEOUT: request for allocation of a physically contiguous | ||
278 | * memory region. | ||
279 | * @RSC_DEVMEM: request to iommu_map a memory-based peripheral. | ||
280 | * @RSC_TRACE: announces the availability of a trace buffer into which | ||
281 | * the remote processor will be writing logs. | ||
282 | * @RSC_VDEV: declare support for a virtio device, and serve as its | ||
283 | * virtio header. | ||
284 | * @RSC_LAST: just keep this one at the end | ||
285 | * | ||
286 | * Please note that these values are used as indices to the rproc_handle_rsc | ||
287 | * lookup table, so please keep them sane. Moreover, @RSC_LAST is used to | ||
288 | * check the validity of an index before the lookup table is accessed, so | ||
289 | * please update it as needed. | ||
290 | */ | ||
291 | enum fw_resource_type { | ||
292 | RSC_CARVEOUT = 0, | ||
293 | RSC_DEVMEM = 1, | ||
294 | RSC_TRACE = 2, | ||
295 | RSC_VDEV = 3, | ||
296 | RSC_LAST = 4, | ||
297 | }; | ||
298 | |||
299 | For more details regarding a specific resource type, please see its | ||
300 | dedicated structure in include/linux/remoteproc.h. | ||
301 | |||
302 | We also expect that platform-specific resource entries will show up | ||
303 | at some point. When that happens, we could easily add a new RSC_PLATFORM | ||
304 | type, and hand those resources to the platform-specific rproc driver to handle. | ||
305 | |||
306 | 7. Virtio and remoteproc | ||
307 | |||
308 | The firmware should provide remoteproc information about virtio devices | ||
309 | that it supports, and their configurations: a RSC_VDEV resource entry | ||
310 | should specify the virtio device id (as in virtio_ids.h), virtio features, | ||
311 | virtio config space, vrings information, etc. | ||
312 | |||
313 | When a new remote processor is registered, the remoteproc framework | ||
314 | will look for its resource table and will register the virtio devices | ||
315 | it supports. A firmware may support any number of virtio devices, and | ||
316 | of any type (a single remote processor can also easily support several | ||
317 | rpmsg virtio devices this way, if desired). | ||
318 | |||
319 | Of course, RSC_VDEV resource entries are only good enough for static | ||
320 | allocation of virtio devices. Dynamic allocations will also be made possible | ||
321 | using the rpmsg bus (similar to how we already do dynamic allocations of | ||
322 | rpmsg channels; read more about it in rpmsg.txt). | ||
diff --git a/Documentation/rpmsg.txt b/Documentation/rpmsg.txt new file mode 100644 index 000000000000..409d9f964c5b --- /dev/null +++ b/Documentation/rpmsg.txt | |||
@@ -0,0 +1,293 @@ | |||
1 | Remote Processor Messaging (rpmsg) Framework | ||
2 | |||
3 | Note: this document describes the rpmsg bus and how to write rpmsg drivers. | ||
4 | To learn how to add rpmsg support for new platforms, check out remoteproc.txt | ||
5 | (also a resident of Documentation/). | ||
6 | |||
7 | 1. Introduction | ||
8 | |||
9 | Modern SoCs typically employ heterogeneous remote processor devices in | ||
10 | asymmetric multiprocessing (AMP) configurations, which may be running | ||
11 | different instances of operating system, whether it's Linux or any other | ||
12 | flavor of real-time OS. | ||
13 | |||
14 | OMAP4, for example, has dual Cortex-A9, dual Cortex-M3 and a C64x+ DSP. | ||
15 | Typically, the dual cortex-A9 is running Linux in a SMP configuration, | ||
16 | and each of the other three cores (two M3 cores and a DSP) is running | ||
17 | its own instance of RTOS in an AMP configuration. | ||
18 | |||
19 | Typically AMP remote processors employ dedicated DSP codecs and multimedia | ||
20 | hardware accelerators, and therefore are often used to offload CPU-intensive | ||
21 | multimedia tasks from the main application processor. | ||
22 | |||
23 | These remote processors could also be used to control latency-sensitive | ||
24 | sensors, drive random hardware blocks, or just perform background tasks | ||
25 | while the main CPU is idling. | ||
26 | |||
27 | Users of those remote processors can either be userland apps (e.g. multimedia | ||
28 | frameworks talking with remote OMX components) or kernel drivers (controlling | ||
29 | hardware accessible only by the remote processor, reserving kernel-controlled | ||
30 | resources on behalf of the remote processor, etc..). | ||
31 | |||
32 | Rpmsg is a virtio-based messaging bus that allows kernel drivers to communicate | ||
33 | with remote processors available on the system. In turn, drivers could then | ||
34 | expose appropriate user space interfaces, if needed. | ||
35 | |||
36 | When writing a driver that exposes rpmsg communication to userland, please | ||
37 | keep in mind that remote processors might have direct access to the | ||
38 | system's physical memory and other sensitive hardware resources (e.g. on | ||
39 | OMAP4, remote cores and hardware accelerators may have direct access to the | ||
40 | physical memory, gpio banks, dma controllers, i2c bus, gptimers, mailbox | ||
41 | devices, hwspinlocks, etc..). Moreover, those remote processors might be | ||
42 | running RTOS where every task can access the entire memory/devices exposed | ||
43 | to the processor. To minimize the risks of rogue (or buggy) userland code | ||
44 | exploiting remote bugs, and by that taking over the system, it is often | ||
45 | desired to limit userland to specific rpmsg channels (see definition below) | ||
46 | it can send messages on, and if possible, minimize how much control | ||
47 | it has over the content of the messages. | ||
48 | |||
49 | Every rpmsg device is a communication channel with a remote processor (thus | ||
50 | rpmsg devices are called channels). Channels are identified by a textual name | ||
51 | and have a local ("source") rpmsg address, and remote ("destination") rpmsg | ||
52 | address. | ||
53 | |||
54 | When a driver starts listening on a channel, its rx callback is bound with | ||
55 | a unique rpmsg local address (a 32-bit integer). This way when inbound messages | ||
56 | arrive, the rpmsg core dispatches them to the appropriate driver according | ||
57 | to their destination address (this is done by invoking the driver's rx handler | ||
58 | with the payload of the inbound message). | ||
59 | |||
60 | |||
61 | 2. User API | ||
62 | |||
63 | int rpmsg_send(struct rpmsg_channel *rpdev, void *data, int len); | ||
64 | - sends a message across to the remote processor on a given channel. | ||
65 | The caller should specify the channel, the data it wants to send, | ||
66 | and its length (in bytes). The message will be sent on the specified | ||
67 | channel, i.e. its source and destination address fields will be | ||
68 | set to the channel's src and dst addresses. | ||
69 | |||
70 | In case there are no TX buffers available, the function will block until | ||
71 | one becomes available (i.e. until the remote processor consumes | ||
72 | a tx buffer and puts it back on virtio's used descriptor ring), | ||
73 | or a timeout of 15 seconds elapses. When the latter happens, | ||
74 | -ERESTARTSYS is returned. | ||
75 | The function can only be called from a process context (for now). | ||
76 | Returns 0 on success and an appropriate error value on failure. | ||
77 | |||
78 | int rpmsg_sendto(struct rpmsg_channel *rpdev, void *data, int len, u32 dst); | ||
79 | - sends a message across to the remote processor on a given channel, | ||
80 | to a destination address provided by the caller. | ||
81 | The caller should specify the channel, the data it wants to send, | ||
82 | its length (in bytes), and an explicit destination address. | ||
83 | The message will then be sent to the remote processor to which the | ||
84 | channel belongs, using the channel's src address, and the user-provided | ||
85 | dst address (thus the channel's dst address will be ignored). | ||
86 | |||
87 | In case there are no TX buffers available, the function will block until | ||
88 | one becomes available (i.e. until the remote processor consumes | ||
89 | a tx buffer and puts it back on virtio's used descriptor ring), | ||
90 | or a timeout of 15 seconds elapses. When the latter happens, | ||
91 | -ERESTARTSYS is returned. | ||
92 | The function can only be called from a process context (for now). | ||
93 | Returns 0 on success and an appropriate error value on failure. | ||
94 | |||
95 | int rpmsg_send_offchannel(struct rpmsg_channel *rpdev, u32 src, u32 dst, | ||
96 | void *data, int len); | ||
97 | - sends a message across to the remote processor, using the src and dst | ||
98 | addresses provided by the user. | ||
99 | The caller should specify the channel, the data it wants to send, | ||
100 | its length (in bytes), and explicit source and destination addresses. | ||
101 | The message will then be sent to the remote processor to which the | ||
102 | channel belongs, but the channel's src and dst addresses will be | ||
103 | ignored (and the user-provided addresses will be used instead). | ||
104 | |||
105 | In case there are no TX buffers available, the function will block until | ||
106 | one becomes available (i.e. until the remote processor consumes | ||
107 | a tx buffer and puts it back on virtio's used descriptor ring), | ||
108 | or a timeout of 15 seconds elapses. When the latter happens, | ||
109 | -ERESTARTSYS is returned. | ||
110 | The function can only be called from a process context (for now). | ||
111 | Returns 0 on success and an appropriate error value on failure. | ||
112 | |||
113 | int rpmsg_trysend(struct rpmsg_channel *rpdev, void *data, int len); | ||
114 | - sends a message across to the remote processor on a given channel. | ||
115 | The caller should specify the channel, the data it wants to send, | ||
116 | and its length (in bytes). The message will be sent on the specified | ||
117 | channel, i.e. its source and destination address fields will be | ||
118 | set to the channel's src and dst addresses. | ||
119 | |||
120 | In case there are no TX buffers available, the function will immediately | ||
121 | return -ENOMEM without waiting until one becomes available. | ||
122 | The function can only be called from a process context (for now). | ||
123 | Returns 0 on success and an appropriate error value on failure. | ||
124 | |||
125 | int rpmsg_trysendto(struct rpmsg_channel *rpdev, void *data, int len, u32 dst) | ||
126 | - sends a message across to the remote processor on a given channel, | ||
127 | to a destination address provided by the user. | ||
128 | The user should specify the channel, the data it wants to send, | ||
129 | its length (in bytes), and an explicit destination address. | ||
130 | The message will then be sent to the remote processor to which the | ||
131 | channel belongs, using the channel's src address, and the user-provided | ||
132 | dst address (thus the channel's dst address will be ignored). | ||
133 | |||
134 | In case there are no TX buffers available, the function will immediately | ||
135 | return -ENOMEM without waiting until one becomes available. | ||
136 | The function can only be called from a process context (for now). | ||
137 | Returns 0 on success and an appropriate error value on failure. | ||
138 | |||
139 | int rpmsg_trysend_offchannel(struct rpmsg_channel *rpdev, u32 src, u32 dst, | ||
140 | void *data, int len); | ||
141 | - sends a message across to the remote processor, using source and | ||
142 | destination addresses provided by the user. | ||
143 | The user should specify the channel, the data it wants to send, | ||
144 | its length (in bytes), and explicit source and destination addresses. | ||
145 | The message will then be sent to the remote processor to which the | ||
146 | channel belongs, but the channel's src and dst addresses will be | ||
147 | ignored (and the user-provided addresses will be used instead). | ||
148 | |||
149 | In case there are no TX buffers available, the function will immediately | ||
150 | return -ENOMEM without waiting until one becomes available. | ||
151 | The function can only be called from a process context (for now). | ||
152 | Returns 0 on success and an appropriate error value on failure. | ||
153 | |||
154 | struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_channel *rpdev, | ||
155 | void (*cb)(struct rpmsg_channel *, void *, int, void *, u32), | ||
156 | void *priv, u32 addr); | ||
157 | - every rpmsg address in the system is bound to an rx callback (so when | ||
158 | inbound messages arrive, they are dispatched by the rpmsg bus using the | ||
159 | appropriate callback handler) by means of an rpmsg_endpoint struct. | ||
160 | |||
161 | This function allows drivers to create such an endpoint, and by that, | ||
162 | bind a callback, and possibly some private data too, to an rpmsg address | ||
163 | (either one that is known in advance, or one that will be dynamically | ||
164 | assigned for them). | ||
165 | |||
166 | Simple rpmsg drivers need not call rpmsg_create_ept, because an endpoint | ||
167 | is already created for them when they are probed by the rpmsg bus | ||
168 | (using the rx callback they provide when they registered to the rpmsg bus). | ||
169 | |||
170 | So things should just work for simple drivers: they already have an | ||
171 | endpoint, their rx callback is bound to their rpmsg address, and when | ||
172 | relevant inbound messages arrive (i.e. messages which their dst address | ||
173 | equals to the src address of their rpmsg channel), the driver's handler | ||
174 | is invoked to process it. | ||
175 | |||
176 | That said, more complicated drivers might do need to allocate | ||
177 | additional rpmsg addresses, and bind them to different rx callbacks. | ||
178 | To accomplish that, those drivers need to call this function. | ||
179 | Drivers should provide their channel (so the new endpoint would bind | ||
180 | to the same remote processor their channel belongs to), an rx callback | ||
181 | function, an optional private data (which is provided back when the | ||
182 | rx callback is invoked), and an address they want to bind with the | ||
183 | callback. If addr is RPMSG_ADDR_ANY, then rpmsg_create_ept will | ||
184 | dynamically assign them an available rpmsg address (drivers should have | ||
185 | a very good reason why not to always use RPMSG_ADDR_ANY here). | ||
186 | |||
187 | Returns a pointer to the endpoint on success, or NULL on error. | ||
188 | |||
189 | void rpmsg_destroy_ept(struct rpmsg_endpoint *ept); | ||
190 | - destroys an existing rpmsg endpoint. user should provide a pointer | ||
191 | to an rpmsg endpoint that was previously created with rpmsg_create_ept(). | ||
192 | |||
193 | int register_rpmsg_driver(struct rpmsg_driver *rpdrv); | ||
194 | - registers an rpmsg driver with the rpmsg bus. user should provide | ||
195 | a pointer to an rpmsg_driver struct, which contains the driver's | ||
196 | ->probe() and ->remove() functions, an rx callback, and an id_table | ||
197 | specifying the names of the channels this driver is interested to | ||
198 | be probed with. | ||
199 | |||
200 | void unregister_rpmsg_driver(struct rpmsg_driver *rpdrv); | ||
201 | - unregisters an rpmsg driver from the rpmsg bus. user should provide | ||
202 | a pointer to a previously-registered rpmsg_driver struct. | ||
203 | Returns 0 on success, and an appropriate error value on failure. | ||
204 | |||
205 | |||
206 | 3. Typical usage | ||
207 | |||
208 | The following is a simple rpmsg driver, that sends an "hello!" message | ||
209 | on probe(), and whenever it receives an incoming message, it dumps its | ||
210 | content to the console. | ||
211 | |||
212 | #include <linux/kernel.h> | ||
213 | #include <linux/module.h> | ||
214 | #include <linux/rpmsg.h> | ||
215 | |||
216 | static void rpmsg_sample_cb(struct rpmsg_channel *rpdev, void *data, int len, | ||
217 | void *priv, u32 src) | ||
218 | { | ||
219 | print_hex_dump(KERN_INFO, "incoming message:", DUMP_PREFIX_NONE, | ||
220 | 16, 1, data, len, true); | ||
221 | } | ||
222 | |||
223 | static int rpmsg_sample_probe(struct rpmsg_channel *rpdev) | ||
224 | { | ||
225 | int err; | ||
226 | |||
227 | dev_info(&rpdev->dev, "chnl: 0x%x -> 0x%x\n", rpdev->src, rpdev->dst); | ||
228 | |||
229 | /* send a message on our channel */ | ||
230 | err = rpmsg_send(rpdev, "hello!", 6); | ||
231 | if (err) { | ||
232 | pr_err("rpmsg_send failed: %d\n", err); | ||
233 | return err; | ||
234 | } | ||
235 | |||
236 | return 0; | ||
237 | } | ||
238 | |||
239 | static void __devexit rpmsg_sample_remove(struct rpmsg_channel *rpdev) | ||
240 | { | ||
241 | dev_info(&rpdev->dev, "rpmsg sample client driver is removed\n"); | ||
242 | } | ||
243 | |||
244 | static struct rpmsg_device_id rpmsg_driver_sample_id_table[] = { | ||
245 | { .name = "rpmsg-client-sample" }, | ||
246 | { }, | ||
247 | }; | ||
248 | MODULE_DEVICE_TABLE(rpmsg, rpmsg_driver_sample_id_table); | ||
249 | |||
250 | static struct rpmsg_driver rpmsg_sample_client = { | ||
251 | .drv.name = KBUILD_MODNAME, | ||
252 | .drv.owner = THIS_MODULE, | ||
253 | .id_table = rpmsg_driver_sample_id_table, | ||
254 | .probe = rpmsg_sample_probe, | ||
255 | .callback = rpmsg_sample_cb, | ||
256 | .remove = __devexit_p(rpmsg_sample_remove), | ||
257 | }; | ||
258 | |||
259 | static int __init init(void) | ||
260 | { | ||
261 | return register_rpmsg_driver(&rpmsg_sample_client); | ||
262 | } | ||
263 | module_init(init); | ||
264 | |||
265 | static void __exit fini(void) | ||
266 | { | ||
267 | unregister_rpmsg_driver(&rpmsg_sample_client); | ||
268 | } | ||
269 | module_exit(fini); | ||
270 | |||
271 | Note: a similar sample which can be built and loaded can be found | ||
272 | in samples/rpmsg/. | ||
273 | |||
274 | 4. Allocations of rpmsg channels: | ||
275 | |||
276 | At this point we only support dynamic allocations of rpmsg channels. | ||
277 | |||
278 | This is possible only with remote processors that have the VIRTIO_RPMSG_F_NS | ||
279 | virtio device feature set. This feature bit means that the remote | ||
280 | processor supports dynamic name service announcement messages. | ||
281 | |||
282 | When this feature is enabled, creation of rpmsg devices (i.e. channels) | ||
283 | is completely dynamic: the remote processor announces the existence of a | ||
284 | remote rpmsg service by sending a name service message (which contains | ||
285 | the name and rpmsg addr of the remote service, see struct rpmsg_ns_msg). | ||
286 | |||
287 | This message is then handled by the rpmsg bus, which in turn dynamically | ||
288 | creates and registers an rpmsg channel (which represents the remote service). | ||
289 | If/when a relevant rpmsg driver is registered, it will be immediately probed | ||
290 | by the bus, and can then start sending messages to the remote service. | ||
291 | |||
292 | The plan is also to add static creation of rpmsg channels via the virtio | ||
293 | config space, but it's not implemented yet. | ||
diff --git a/Documentation/watchdog/00-INDEX b/Documentation/watchdog/00-INDEX deleted file mode 100644 index fc9082a1477a..000000000000 --- a/Documentation/watchdog/00-INDEX +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | 00-INDEX | ||
2 | - this file. | ||
3 | convert_drivers_to_kernel_api.txt | ||
4 | - how-to for converting old watchdog drivers to the new kernel API. | ||
5 | hpwdt.txt | ||
6 | - information on the HP iLO2 NMI watchdog | ||
7 | pcwd-watchdog.txt | ||
8 | - documentation for Berkshire Products PC Watchdog ISA cards. | ||
9 | src/ | ||
10 | - directory holding watchdog related example programs. | ||
11 | watchdog-api.txt | ||
12 | - description of the Linux Watchdog driver API. | ||
13 | watchdog-kernel-api.txt | ||
14 | - description of the Linux WatchDog Timer Driver Core kernel API. | ||
15 | watchdog-parameters.txt | ||
16 | - information on driver parameters (for drivers other than | ||
17 | the ones that have driver-specific files here) | ||
18 | wdt.txt | ||
19 | - description of the Watchdog Timer Interfaces for Linux. | ||
diff --git a/Documentation/watchdog/convert_drivers_to_kernel_api.txt b/Documentation/watchdog/convert_drivers_to_kernel_api.txt index be8119bb15d2..271b8850dde7 100644 --- a/Documentation/watchdog/convert_drivers_to_kernel_api.txt +++ b/Documentation/watchdog/convert_drivers_to_kernel_api.txt | |||
@@ -59,6 +59,10 @@ Here is a overview of the functions and probably needed actions: | |||
59 | WDIOC_GETTIMEOUT: | 59 | WDIOC_GETTIMEOUT: |
60 | No preparations needed | 60 | No preparations needed |
61 | 61 | ||
62 | WDIOC_GETTIMELEFT: | ||
63 | It needs get_timeleft() callback to be defined. Otherwise it | ||
64 | will return EOPNOTSUPP | ||
65 | |||
62 | Other IOCTLs can be served using the ioctl-callback. Note that this is mainly | 66 | Other IOCTLs can be served using the ioctl-callback. Note that this is mainly |
63 | intended for porting old drivers; new drivers should not invent private IOCTLs. | 67 | intended for porting old drivers; new drivers should not invent private IOCTLs. |
64 | Private IOCTLs are processed first. When the callback returns with | 68 | Private IOCTLs are processed first. When the callback returns with |
diff --git a/Documentation/watchdog/watchdog-kernel-api.txt b/Documentation/watchdog/watchdog-kernel-api.txt index 9e162465b0cf..227f6cd0e5fa 100644 --- a/Documentation/watchdog/watchdog-kernel-api.txt +++ b/Documentation/watchdog/watchdog-kernel-api.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | The Linux WatchDog Timer Driver Core kernel API. | 1 | The Linux WatchDog Timer Driver Core kernel API. |
2 | =============================================== | 2 | =============================================== |
3 | Last reviewed: 29-Nov-2011 | 3 | Last reviewed: 16-Mar-2012 |
4 | 4 | ||
5 | Wim Van Sebroeck <wim@iguana.be> | 5 | Wim Van Sebroeck <wim@iguana.be> |
6 | 6 | ||
@@ -77,6 +77,7 @@ struct watchdog_ops { | |||
77 | int (*ping)(struct watchdog_device *); | 77 | int (*ping)(struct watchdog_device *); |
78 | unsigned int (*status)(struct watchdog_device *); | 78 | unsigned int (*status)(struct watchdog_device *); |
79 | int (*set_timeout)(struct watchdog_device *, unsigned int); | 79 | int (*set_timeout)(struct watchdog_device *, unsigned int); |
80 | unsigned int (*get_timeleft)(struct watchdog_device *); | ||
80 | long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long); | 81 | long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long); |
81 | }; | 82 | }; |
82 | 83 | ||
@@ -117,11 +118,13 @@ they are supported. These optional routines/operations are: | |||
117 | status of the device is reported with watchdog WDIOF_* status flags/bits. | 118 | status of the device is reported with watchdog WDIOF_* status flags/bits. |
118 | * set_timeout: this routine checks and changes the timeout of the watchdog | 119 | * set_timeout: this routine checks and changes the timeout of the watchdog |
119 | timer device. It returns 0 on success, -EINVAL for "parameter out of range" | 120 | timer device. It returns 0 on success, -EINVAL for "parameter out of range" |
120 | and -EIO for "could not write value to the watchdog". On success the timeout | 121 | and -EIO for "could not write value to the watchdog". On success this |
121 | value of the watchdog_device will be changed to the value that was just used | 122 | routine should set the timeout value of the watchdog_device to the |
122 | to re-program the watchdog timer device. | 123 | achieved timeout value (which may be different from the requested one |
124 | because the watchdog does not necessarily has a 1 second resolution). | ||
123 | (Note: the WDIOF_SETTIMEOUT needs to be set in the options field of the | 125 | (Note: the WDIOF_SETTIMEOUT needs to be set in the options field of the |
124 | watchdog's info structure). | 126 | watchdog's info structure). |
127 | * get_timeleft: this routines returns the time that's left before a reset. | ||
125 | * ioctl: if this routine is present then it will be called first before we do | 128 | * ioctl: if this routine is present then it will be called first before we do |
126 | our own internal ioctl call handling. This routine should return -ENOIOCTLCMD | 129 | our own internal ioctl call handling. This routine should return -ENOIOCTLCMD |
127 | if a command is not supported. The parameters that are passed to the ioctl | 130 | if a command is not supported. The parameters that are passed to the ioctl |