diff options
Diffstat (limited to 'Documentation')
56 files changed, 3083 insertions, 334 deletions
diff --git a/Documentation/ABI/testing/sysfs-class-net b/Documentation/ABI/testing/sysfs-class-net index d922060e455d..416c5d59f52e 100644 --- a/Documentation/ABI/testing/sysfs-class-net +++ b/Documentation/ABI/testing/sysfs-class-net | |||
@@ -169,6 +169,14 @@ Description: | |||
169 | "unknown", "notpresent", "down", "lowerlayerdown", "testing", | 169 | "unknown", "notpresent", "down", "lowerlayerdown", "testing", |
170 | "dormant", "up". | 170 | "dormant", "up". |
171 | 171 | ||
172 | What: /sys/class/net/<iface>/phys_port_id | ||
173 | Date: July 2013 | ||
174 | KernelVersion: 3.12 | ||
175 | Contact: netdev@vger.kernel.org | ||
176 | Description: | ||
177 | Indicates the interface unique physical port identifier within | ||
178 | the NIC, as a string. | ||
179 | |||
172 | What: /sys/class/net/<iface>/speed | 180 | What: /sys/class/net/<iface>/speed |
173 | Date: October 2009 | 181 | Date: October 2009 |
174 | KernelVersion: 2.6.33 | 182 | KernelVersion: 2.6.33 |
diff --git a/Documentation/ABI/testing/sysfs-class-net-cdc_ncm b/Documentation/ABI/testing/sysfs-class-net-cdc_ncm new file mode 100644 index 000000000000..5cedf72df358 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-net-cdc_ncm | |||
@@ -0,0 +1,149 @@ | |||
1 | What: /sys/class/net/<iface>/cdc_ncm/min_tx_pkt | ||
2 | Date: May 2014 | ||
3 | KernelVersion: 3.16 | ||
4 | Contact: Bjørn Mork <bjorn@mork.no> | ||
5 | Description: | ||
6 | The driver will pad NCM Transfer Blocks (NTBs) longer | ||
7 | than this to tx_max, allowing the device to receive | ||
8 | tx_max sized frames with no terminating short | ||
9 | packet. NTBs shorter than this limit are transmitted | ||
10 | as-is, without any padding, and are terminated with a | ||
11 | short USB packet. | ||
12 | |||
13 | Padding to tx_max allows the driver to transmit NTBs | ||
14 | back-to-back without any interleaving short USB | ||
15 | packets. This reduces the number of short packet | ||
16 | interrupts in the device, and represents a tradeoff | ||
17 | between USB bus bandwidth and device DMA optimization. | ||
18 | |||
19 | Set to 0 to pad all frames. Set greater than tx_max to | ||
20 | disable all padding. | ||
21 | |||
22 | What: /sys/class/net/<iface>/cdc_ncm/rx_max | ||
23 | Date: May 2014 | ||
24 | KernelVersion: 3.16 | ||
25 | Contact: Bjørn Mork <bjorn@mork.no> | ||
26 | Description: | ||
27 | The maximum NTB size for RX. Cannot exceed the | ||
28 | maximum value supported by the device. Must allow at | ||
29 | least one max sized datagram plus headers. | ||
30 | |||
31 | The actual limits are device dependent. See | ||
32 | dwNtbInMaxSize. | ||
33 | |||
34 | Note: Some devices will silently ignore changes to | ||
35 | this value, resulting in oversized NTBs and | ||
36 | corresponding framing errors. | ||
37 | |||
38 | What: /sys/class/net/<iface>/cdc_ncm/tx_max | ||
39 | Date: May 2014 | ||
40 | KernelVersion: 3.16 | ||
41 | Contact: Bjørn Mork <bjorn@mork.no> | ||
42 | Description: | ||
43 | The maximum NTB size for TX. Cannot exceed the | ||
44 | maximum value supported by the device. Must allow at | ||
45 | least one max sized datagram plus headers. | ||
46 | |||
47 | The actual limits are device dependent. See | ||
48 | dwNtbOutMaxSize. | ||
49 | |||
50 | What: /sys/class/net/<iface>/cdc_ncm/tx_timer_usecs | ||
51 | Date: May 2014 | ||
52 | KernelVersion: 3.16 | ||
53 | Contact: Bjørn Mork <bjorn@mork.no> | ||
54 | Description: | ||
55 | Datagram aggregation timeout in µs. The driver will | ||
56 | wait up to 3 times this timeout for more datagrams to | ||
57 | aggregate before transmitting an NTB frame. | ||
58 | |||
59 | Valid range: 5 to 4000000 | ||
60 | |||
61 | Set to 0 to disable aggregation. | ||
62 | |||
63 | The following read-only attributes all represent fields of the | ||
64 | structure defined in section 6.2.1 "GetNtbParameters" of "Universal | ||
65 | Serial Bus Communications Class Subclass Specifications for Network | ||
66 | Control Model Devices" (CDC NCM), Revision 1.0 (Errata 1), November | ||
67 | 24, 2010 from USB Implementers Forum, Inc. The descriptions are | ||
68 | quoted from table 6-3 of CDC NCM: "NTB Parameter Structure". | ||
69 | |||
70 | What: /sys/class/net/<iface>/cdc_ncm/bmNtbFormatsSupported | ||
71 | Date: May 2014 | ||
72 | KernelVersion: 3.16 | ||
73 | Contact: Bjørn Mork <bjorn@mork.no> | ||
74 | Description: | ||
75 | Bit 0: 16-bit NTB supported (set to 1) | ||
76 | Bit 1: 32-bit NTB supported | ||
77 | Bits 2 – 15: reserved (reset to zero; must be ignored by host) | ||
78 | |||
79 | What: /sys/class/net/<iface>/cdc_ncm/dwNtbInMaxSize | ||
80 | Date: May 2014 | ||
81 | KernelVersion: 3.16 | ||
82 | Contact: Bjørn Mork <bjorn@mork.no> | ||
83 | Description: | ||
84 | IN NTB Maximum Size in bytes | ||
85 | |||
86 | What: /sys/class/net/<iface>/cdc_ncm/wNdpInDivisor | ||
87 | Date: May 2014 | ||
88 | KernelVersion: 3.16 | ||
89 | Contact: Bjørn Mork <bjorn@mork.no> | ||
90 | Description: | ||
91 | Divisor used for IN NTB Datagram payload alignment | ||
92 | |||
93 | What: /sys/class/net/<iface>/cdc_ncm/wNdpInPayloadRemainder | ||
94 | Date: May 2014 | ||
95 | KernelVersion: 3.16 | ||
96 | Contact: Bjørn Mork <bjorn@mork.no> | ||
97 | Description: | ||
98 | Remainder used to align input datagram payload within | ||
99 | the NTB: (Payload Offset) mod (wNdpInDivisor) = | ||
100 | wNdpInPayloadRemainder | ||
101 | |||
102 | What: /sys/class/net/<iface>/cdc_ncm/wNdpInAlignment | ||
103 | Date: May 2014 | ||
104 | KernelVersion: 3.16 | ||
105 | Contact: Bjørn Mork <bjorn@mork.no> | ||
106 | Description: | ||
107 | NDP alignment modulus for NTBs on the IN pipe. Shall | ||
108 | be a power of 2, and shall be at least 4. | ||
109 | |||
110 | What: /sys/class/net/<iface>/cdc_ncm/dwNtbOutMaxSize | ||
111 | Date: May 2014 | ||
112 | KernelVersion: 3.16 | ||
113 | Contact: Bjørn Mork <bjorn@mork.no> | ||
114 | Description: | ||
115 | OUT NTB Maximum Size | ||
116 | |||
117 | What: /sys/class/net/<iface>/cdc_ncm/wNdpOutDivisor | ||
118 | Date: May 2014 | ||
119 | KernelVersion: 3.16 | ||
120 | Contact: Bjørn Mork <bjorn@mork.no> | ||
121 | Description: | ||
122 | OUT NTB Datagram alignment modulus | ||
123 | |||
124 | What: /sys/class/net/<iface>/cdc_ncm/wNdpOutPayloadRemainder | ||
125 | Date: May 2014 | ||
126 | KernelVersion: 3.16 | ||
127 | Contact: Bjørn Mork <bjorn@mork.no> | ||
128 | Description: | ||
129 | Remainder used to align output datagram payload | ||
130 | offsets within the NTB: Padding, shall be transmitted | ||
131 | as zero by function, and ignored by host. (Payload | ||
132 | Offset) mod (wNdpOutDivisor) = wNdpOutPayloadRemainder | ||
133 | |||
134 | What: /sys/class/net/<iface>/cdc_ncm/wNdpOutAlignment | ||
135 | Date: May 2014 | ||
136 | KernelVersion: 3.16 | ||
137 | Contact: Bjørn Mork <bjorn@mork.no> | ||
138 | Description: | ||
139 | NDP alignment modulus for use in NTBs on the OUT | ||
140 | pipe. Shall be a power of 2, and shall be at least 4. | ||
141 | |||
142 | What: /sys/class/net/<iface>/cdc_ncm/wNtbOutMaxDatagrams | ||
143 | Date: May 2014 | ||
144 | KernelVersion: 3.16 | ||
145 | Contact: Bjørn Mork <bjorn@mork.no> | ||
146 | Description: | ||
147 | Maximum number of datagrams that the host may pack | ||
148 | into a single OUT NTB. Zero means that the device | ||
149 | imposes no limit. | ||
diff --git a/Documentation/ABI/testing/sysfs-class-net-queues b/Documentation/ABI/testing/sysfs-class-net-queues new file mode 100644 index 000000000000..5e9aeb91d355 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-net-queues | |||
@@ -0,0 +1,79 @@ | |||
1 | What: /sys/class/<iface>/queues/rx-<queue>/rps_cpus | ||
2 | Date: March 2010 | ||
3 | KernelVersion: 2.6.35 | ||
4 | Contact: netdev@vger.kernel.org | ||
5 | Description: | ||
6 | Mask of the CPU(s) currently enabled to participate into the | ||
7 | Receive Packet Steering packet processing flow for this | ||
8 | network device queue. Possible values depend on the number | ||
9 | of available CPU(s) in the system. | ||
10 | |||
11 | What: /sys/class/<iface>/queues/rx-<queue>/rps_flow_cnt | ||
12 | Date: April 2010 | ||
13 | KernelVersion: 2.6.35 | ||
14 | Contact: netdev@vger.kernel.org | ||
15 | Description: | ||
16 | Number of Receive Packet Steering flows being currently | ||
17 | processed by this particular network device receive queue. | ||
18 | |||
19 | What: /sys/class/<iface>/queues/tx-<queue>/tx_timeout | ||
20 | Date: November 2011 | ||
21 | KernelVersion: 3.3 | ||
22 | Contact: netdev@vger.kernel.org | ||
23 | Description: | ||
24 | Indicates the number of transmit timeout events seen by this | ||
25 | network interface transmit queue. | ||
26 | |||
27 | What: /sys/class/<iface>/queues/tx-<queue>/xps_cpus | ||
28 | Date: November 2010 | ||
29 | KernelVersion: 2.6.38 | ||
30 | Contact: netdev@vger.kernel.org | ||
31 | Description: | ||
32 | Mask of the CPU(s) currently enabled to participate into the | ||
33 | Transmit Packet Steering packet processing flow for this | ||
34 | network device transmit queue. Possible vaules depend on the | ||
35 | number of available CPU(s) in the system. | ||
36 | |||
37 | What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/hold_time | ||
38 | Date: November 2011 | ||
39 | KernelVersion: 3.3 | ||
40 | Contact: netdev@vger.kernel.org | ||
41 | Description: | ||
42 | Indicates the hold time in milliseconds to measure the slack | ||
43 | of this particular network device transmit queue. | ||
44 | Default value is 1000. | ||
45 | |||
46 | What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/inflight | ||
47 | Date: November 2011 | ||
48 | KernelVersion: 3.3 | ||
49 | Contact: netdev@vger.kernel.org | ||
50 | Description: | ||
51 | Indicates the number of bytes (objects) in flight on this | ||
52 | network device transmit queue. | ||
53 | |||
54 | What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit | ||
55 | Date: November 2011 | ||
56 | KernelVersion: 3.3 | ||
57 | Contact: netdev@vger.kernel.org | ||
58 | Description: | ||
59 | Indicates the current limit of bytes allowed to be queued | ||
60 | on this network device transmit queue. This value is clamped | ||
61 | to be within the bounds defined by limit_max and limit_min. | ||
62 | |||
63 | What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit_max | ||
64 | Date: November 2011 | ||
65 | KernelVersion: 3.3 | ||
66 | Contact: netdev@vger.kernel.org | ||
67 | Description: | ||
68 | Indicates the absolute maximum limit of bytes allowed to be | ||
69 | queued on this network device transmit queue. See | ||
70 | include/linux/dynamic_queue_limits.h for the default value. | ||
71 | |||
72 | What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit_min | ||
73 | Date: November 2011 | ||
74 | KernelVersion: 3.3 | ||
75 | Contact: netdev@vger.kernel.org | ||
76 | Description: | ||
77 | Indicates the absolute minimum limit of bytes allowed to be | ||
78 | queued on this network device transmit queue. Default value is | ||
79 | 0. | ||
diff --git a/Documentation/ABI/testing/sysfs-class-net-statistics b/Documentation/ABI/testing/sysfs-class-net-statistics new file mode 100644 index 000000000000..397118de7b5e --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-net-statistics | |||
@@ -0,0 +1,201 @@ | |||
1 | What: /sys/class/<iface>/statistics/collisions | ||
2 | Date: April 2005 | ||
3 | KernelVersion: 2.6.12 | ||
4 | Contact: netdev@vger.kernel.org | ||
5 | Description: | ||
6 | Indicates the number of collisions seen by this network device. | ||
7 | This value might not be relevant with all MAC layers. | ||
8 | |||
9 | What: /sys/class/<iface>/statistics/multicast | ||
10 | Date: April 2005 | ||
11 | KernelVersion: 2.6.12 | ||
12 | Contact: netdev@vger.kernel.org | ||
13 | Description: | ||
14 | Indicates the number of multicast packets received by this | ||
15 | network device. | ||
16 | |||
17 | What: /sys/class/<iface>/statistics/rx_bytes | ||
18 | Date: April 2005 | ||
19 | KernelVersion: 2.6.12 | ||
20 | Contact: netdev@vger.kernel.org | ||
21 | Description: | ||
22 | Indicates the number of bytes received by this network device. | ||
23 | See the network driver for the exact meaning of when this | ||
24 | value is incremented. | ||
25 | |||
26 | What: /sys/class/<iface>/statistics/rx_compressed | ||
27 | Date: April 2005 | ||
28 | KernelVersion: 2.6.12 | ||
29 | Contact: netdev@vger.kernel.org | ||
30 | Description: | ||
31 | Indicates the number of compressed packets received by this | ||
32 | network device. This value might only be relevant for interfaces | ||
33 | that support packet compression (e.g: PPP). | ||
34 | |||
35 | What: /sys/class/<iface>/statistics/rx_crc_errors | ||
36 | Date: April 2005 | ||
37 | KernelVersion: 2.6.12 | ||
38 | Contact: netdev@vger.kernel.org | ||
39 | Description: | ||
40 | Indicates the number of packets received with a CRC (FCS) error | ||
41 | by this network device. Note that the specific meaning might | ||
42 | depend on the MAC layer used by the interface. | ||
43 | |||
44 | What: /sys/class/<iface>/statistics/rx_dropped | ||
45 | Date: April 2005 | ||
46 | KernelVersion: 2.6.12 | ||
47 | Contact: netdev@vger.kernel.org | ||
48 | Description: | ||
49 | Indicates the number of packets received by the network device | ||
50 | but dropped, that are not forwarded to the upper layers for | ||
51 | packet processing. See the network driver for the exact | ||
52 | meaning of this value. | ||
53 | |||
54 | What: /sys/class/<iface>/statistics/rx_fifo_errors | ||
55 | Date: April 2005 | ||
56 | KernelVersion: 2.6.12 | ||
57 | Contact: netdev@vger.kernel.org | ||
58 | Description: | ||
59 | Indicates the number of receive FIFO errors seen by this | ||
60 | network device. See the network driver for the exact | ||
61 | meaning of this value. | ||
62 | |||
63 | What: /sys/class/<iface>/statistics/rx_frame_errors | ||
64 | Date: April 2005 | ||
65 | KernelVersion: 2.6.12 | ||
66 | Contact: netdev@vger.kernel.org | ||
67 | Description: | ||
68 | Indicates the number of received frames with error, such as | ||
69 | alignment errors. Note that the specific meaning depends on | ||
70 | on the MAC layer protocol used. See the network driver for | ||
71 | the exact meaning of this value. | ||
72 | |||
73 | What: /sys/class/<iface>/statistics/rx_length_errors | ||
74 | Date: April 2005 | ||
75 | KernelVersion: 2.6.12 | ||
76 | Contact: netdev@vger.kernel.org | ||
77 | Description: | ||
78 | Indicates the number of received error packet with a length | ||
79 | error, oversized or undersized. See the network driver for the | ||
80 | exact meaning of this value. | ||
81 | |||
82 | What: /sys/class/<iface>/statistics/rx_missed_errors | ||
83 | Date: April 2005 | ||
84 | KernelVersion: 2.6.12 | ||
85 | Contact: netdev@vger.kernel.org | ||
86 | Description: | ||
87 | Indicates the number of received packets that have been missed | ||
88 | due to lack of capacity in the receive side. See the network | ||
89 | driver for the exact meaning of this value. | ||
90 | |||
91 | What: /sys/class/<iface>/statistics/rx_over_errors | ||
92 | Date: April 2005 | ||
93 | KernelVersion: 2.6.12 | ||
94 | Contact: netdev@vger.kernel.org | ||
95 | Description: | ||
96 | Indicates the number of received packets that are oversized | ||
97 | compared to what the network device is configured to accept | ||
98 | (e.g: larger than MTU). See the network driver for the exact | ||
99 | meaning of this value. | ||
100 | |||
101 | What: /sys/class/<iface>/statistics/rx_packets | ||
102 | Date: April 2005 | ||
103 | KernelVersion: 2.6.12 | ||
104 | Contact: netdev@vger.kernel.org | ||
105 | Description: | ||
106 | Indicates the total number of good packets received by this | ||
107 | network device. | ||
108 | |||
109 | What: /sys/class/<iface>/statistics/tx_aborted_errors | ||
110 | Date: April 2005 | ||
111 | KernelVersion: 2.6.12 | ||
112 | Contact: netdev@vger.kernel.org | ||
113 | Description: | ||
114 | Indicates the number of packets that have been aborted | ||
115 | during transmission by a network device (e.g: because of | ||
116 | a medium collision). See the network driver for the exact | ||
117 | meaning of this value. | ||
118 | |||
119 | What: /sys/class/<iface>/statistics/tx_bytes | ||
120 | Date: April 2005 | ||
121 | KernelVersion: 2.6.12 | ||
122 | Contact: netdev@vger.kernel.org | ||
123 | Description: | ||
124 | Indicates the number of bytes transmitted by a network | ||
125 | device. See the network driver for the exact meaning of this | ||
126 | value, in particular whether this accounts for all successfully | ||
127 | transmitted packets or all packets that have been queued for | ||
128 | transmission. | ||
129 | |||
130 | What: /sys/class/<iface>/statistics/tx_carrier_errors | ||
131 | Date: April 2005 | ||
132 | KernelVersion: 2.6.12 | ||
133 | Contact: netdev@vger.kernel.org | ||
134 | Description: | ||
135 | Indicates the number of packets that could not be transmitted | ||
136 | because of carrier errors (e.g: physical link down). See the | ||
137 | network driver for the exact meaning of this value. | ||
138 | |||
139 | What: /sys/class/<iface>/statistics/tx_compressed | ||
140 | Date: April 2005 | ||
141 | KernelVersion: 2.6.12 | ||
142 | Contact: netdev@vger.kernel.org | ||
143 | Description: | ||
144 | Indicates the number of transmitted compressed packets. Note | ||
145 | this might only be relevant for devices that support | ||
146 | compression (e.g: PPP). | ||
147 | |||
148 | What: /sys/class/<iface>/statistics/tx_dropped | ||
149 | Date: April 2005 | ||
150 | KernelVersion: 2.6.12 | ||
151 | Contact: netdev@vger.kernel.org | ||
152 | Description: | ||
153 | Indicates the number of packets dropped during transmission. | ||
154 | See the driver for the exact reasons as to why the packets were | ||
155 | dropped. | ||
156 | |||
157 | What: /sys/class/<iface>/statistics/tx_errors | ||
158 | Date: April 2005 | ||
159 | KernelVersion: 2.6.12 | ||
160 | Contact: netdev@vger.kernel.org | ||
161 | Description: | ||
162 | Indicates the number of packets in error during transmission by | ||
163 | a network device. See the driver for the exact reasons as to | ||
164 | why the packets were dropped. | ||
165 | |||
166 | What: /sys/class/<iface>/statistics/tx_fifo_errors | ||
167 | Date: April 2005 | ||
168 | KernelVersion: 2.6.12 | ||
169 | Contact: netdev@vger.kernel.org | ||
170 | Description: | ||
171 | Indicates the number of packets having caused a transmit | ||
172 | FIFO error. See the driver for the exact reasons as to why the | ||
173 | packets were dropped. | ||
174 | |||
175 | What: /sys/class/<iface>/statistics/tx_heartbeat_errors | ||
176 | Date: April 2005 | ||
177 | KernelVersion: 2.6.12 | ||
178 | Contact: netdev@vger.kernel.org | ||
179 | Description: | ||
180 | Indicates the number of packets transmitted that have been | ||
181 | reported as heartbeat errors. See the driver for the exact | ||
182 | reasons as to why the packets were dropped. | ||
183 | |||
184 | What: /sys/class/<iface>/statistics/tx_packets | ||
185 | Date: April 2005 | ||
186 | KernelVersion: 2.6.12 | ||
187 | Contact: netdev@vger.kernel.org | ||
188 | Description: | ||
189 | Indicates the number of packets transmitted by a network | ||
190 | device. See the driver for whether this reports the number of all | ||
191 | attempted or successful transmissions. | ||
192 | |||
193 | What: /sys/class/<iface>/statistics/tx_window_errors | ||
194 | Date: April 2005 | ||
195 | KernelVersion: 2.6.12 | ||
196 | Contact: netdev@vger.kernel.org | ||
197 | Description: | ||
198 | Indicates the number of packets not successfully transmitted | ||
199 | due to a window collision. The specific meaning depends on the | ||
200 | MAC layer used. On Ethernet this is usually used to report | ||
201 | late collisions errors. | ||
diff --git a/Documentation/DocBook/80211.tmpl b/Documentation/DocBook/80211.tmpl index 044b76436e83..d9b9416c989f 100644 --- a/Documentation/DocBook/80211.tmpl +++ b/Documentation/DocBook/80211.tmpl | |||
@@ -100,6 +100,7 @@ | |||
100 | !Finclude/net/cfg80211.h wdev_priv | 100 | !Finclude/net/cfg80211.h wdev_priv |
101 | !Finclude/net/cfg80211.h ieee80211_iface_limit | 101 | !Finclude/net/cfg80211.h ieee80211_iface_limit |
102 | !Finclude/net/cfg80211.h ieee80211_iface_combination | 102 | !Finclude/net/cfg80211.h ieee80211_iface_combination |
103 | !Finclude/net/cfg80211.h cfg80211_check_combinations | ||
103 | </chapter> | 104 | </chapter> |
104 | <chapter> | 105 | <chapter> |
105 | <title>Actions and configuration</title> | 106 | <title>Actions and configuration</title> |
diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl index ba60d93c1855..7df3134ebc0e 100644 --- a/Documentation/DocBook/drm.tmpl +++ b/Documentation/DocBook/drm.tmpl | |||
@@ -142,6 +142,12 @@ | |||
142 | to register it with the DRM subsystem. | 142 | to register it with the DRM subsystem. |
143 | </para> | 143 | </para> |
144 | <para> | 144 | <para> |
145 | Newer drivers that no longer require a <structname>drm_bus</structname> | ||
146 | structure can alternatively use the low-level device initialization and | ||
147 | registration functions such as <function>drm_dev_alloc()</function> and | ||
148 | <function>drm_dev_register()</function> directly. | ||
149 | </para> | ||
150 | <para> | ||
145 | The <structname>drm_driver</structname> structure contains static | 151 | The <structname>drm_driver</structname> structure contains static |
146 | information that describes the driver and features it supports, and | 152 | information that describes the driver and features it supports, and |
147 | pointers to methods that the DRM core will call to implement the DRM API. | 153 | pointers to methods that the DRM core will call to implement the DRM API. |
@@ -282,6 +288,36 @@ char *date;</synopsis> | |||
282 | </sect3> | 288 | </sect3> |
283 | </sect2> | 289 | </sect2> |
284 | <sect2> | 290 | <sect2> |
291 | <title>Device Registration</title> | ||
292 | <para> | ||
293 | A number of functions are provided to help with device registration. | ||
294 | The functions deal with PCI, USB and platform devices, respectively. | ||
295 | </para> | ||
296 | !Edrivers/gpu/drm/drm_pci.c | ||
297 | !Edrivers/gpu/drm/drm_usb.c | ||
298 | !Edrivers/gpu/drm/drm_platform.c | ||
299 | <para> | ||
300 | New drivers that no longer rely on the services provided by the | ||
301 | <structname>drm_bus</structname> structure can call the low-level | ||
302 | device registration functions directly. The | ||
303 | <function>drm_dev_alloc()</function> function can be used to allocate | ||
304 | and initialize a new <structname>drm_device</structname> structure. | ||
305 | Drivers will typically want to perform some additional setup on this | ||
306 | structure, such as allocating driver-specific data and storing a | ||
307 | pointer to it in the DRM device's <structfield>dev_private</structfield> | ||
308 | field. Drivers should also set the device's unique name using the | ||
309 | <function>drm_dev_set_unique()</function> function. After it has been | ||
310 | set up a device can be registered with the DRM subsystem by calling | ||
311 | <function>drm_dev_register()</function>. This will cause the device to | ||
312 | be exposed to userspace and will call the driver's | ||
313 | <structfield>.load()</structfield> implementation. When a device is | ||
314 | removed, the DRM device can safely be unregistered and freed by calling | ||
315 | <function>drm_dev_unregister()</function> followed by a call to | ||
316 | <function>drm_dev_unref()</function>. | ||
317 | </para> | ||
318 | !Edrivers/gpu/drm/drm_stub.c | ||
319 | </sect2> | ||
320 | <sect2> | ||
285 | <title>Driver Load</title> | 321 | <title>Driver Load</title> |
286 | <para> | 322 | <para> |
287 | The <methodname>load</methodname> method is the driver and device | 323 | The <methodname>load</methodname> method is the driver and device |
@@ -342,21 +378,13 @@ char *date;</synopsis> | |||
342 | <sect4> | 378 | <sect4> |
343 | <title>Managed IRQ Registration</title> | 379 | <title>Managed IRQ Registration</title> |
344 | <para> | 380 | <para> |
345 | Both the <function>drm_irq_install</function> and | ||
346 | <function>drm_irq_uninstall</function> functions get the device IRQ by | ||
347 | calling <function>drm_dev_to_irq</function>. This inline function will | ||
348 | call a bus-specific operation to retrieve the IRQ number. For platform | ||
349 | devices, <function>platform_get_irq</function>(..., 0) is used to | ||
350 | retrieve the IRQ number. | ||
351 | </para> | ||
352 | <para> | ||
353 | <function>drm_irq_install</function> starts by calling the | 381 | <function>drm_irq_install</function> starts by calling the |
354 | <methodname>irq_preinstall</methodname> driver operation. The operation | 382 | <methodname>irq_preinstall</methodname> driver operation. The operation |
355 | is optional and must make sure that the interrupt will not get fired by | 383 | is optional and must make sure that the interrupt will not get fired by |
356 | clearing all pending interrupt flags or disabling the interrupt. | 384 | clearing all pending interrupt flags or disabling the interrupt. |
357 | </para> | 385 | </para> |
358 | <para> | 386 | <para> |
359 | The IRQ will then be requested by a call to | 387 | The passed-in IRQ will then be requested by a call to |
360 | <function>request_irq</function>. If the DRIVER_IRQ_SHARED driver | 388 | <function>request_irq</function>. If the DRIVER_IRQ_SHARED driver |
361 | feature flag is set, a shared (IRQF_SHARED) IRQ handler will be | 389 | feature flag is set, a shared (IRQF_SHARED) IRQ handler will be |
362 | requested. | 390 | requested. |
@@ -1799,6 +1827,12 @@ void intel_crt_init(struct drm_device *dev) | |||
1799 | <title>KMS API Functions</title> | 1827 | <title>KMS API Functions</title> |
1800 | !Edrivers/gpu/drm/drm_crtc.c | 1828 | !Edrivers/gpu/drm/drm_crtc.c |
1801 | </sect2> | 1829 | </sect2> |
1830 | <sect2> | ||
1831 | <title>KMS Locking</title> | ||
1832 | !Pdrivers/gpu/drm/drm_modeset_lock.c kms locking | ||
1833 | !Iinclude/drm/drm_modeset_lock.h | ||
1834 | !Edrivers/gpu/drm/drm_modeset_lock.c | ||
1835 | </sect2> | ||
1802 | </sect1> | 1836 | </sect1> |
1803 | 1837 | ||
1804 | <!-- Internals: kms helper functions --> | 1838 | <!-- Internals: kms helper functions --> |
@@ -1903,8 +1937,8 @@ void intel_crt_init(struct drm_device *dev) | |||
1903 | <para> | 1937 | <para> |
1904 | The function filters out modes larger than | 1938 | The function filters out modes larger than |
1905 | <parameter>max_width</parameter> and <parameter>max_height</parameter> | 1939 | <parameter>max_width</parameter> and <parameter>max_height</parameter> |
1906 | if specified. It then calls the connector | 1940 | if specified. It then calls the optional connector |
1907 | <methodname>mode_valid</methodname> helper operation for each mode in | 1941 | <methodname>mode_valid</methodname> helper operation for each mode in |
1908 | the probed list to check whether the mode is valid for the connector. | 1942 | the probed list to check whether the mode is valid for the connector. |
1909 | </para> | 1943 | </para> |
1910 | </listitem> | 1944 | </listitem> |
@@ -2265,7 +2299,7 @@ void intel_crt_init(struct drm_device *dev) | |||
2265 | <para> | 2299 | <para> |
2266 | Verify whether a mode is valid for the connector. Return MODE_OK for | 2300 | Verify whether a mode is valid for the connector. Return MODE_OK for |
2267 | supported modes and one of the enum drm_mode_status values (MODE_*) | 2301 | supported modes and one of the enum drm_mode_status values (MODE_*) |
2268 | for unsupported modes. This operation is mandatory. | 2302 | for unsupported modes. This operation is optional. |
2269 | </para> | 2303 | </para> |
2270 | <para> | 2304 | <para> |
2271 | As the mode rejection reason is currently not used beside for | 2305 | As the mode rejection reason is currently not used beside for |
@@ -2450,6 +2484,863 @@ void intel_crt_init(struct drm_device *dev) | |||
2450 | pointer to the target object, a pointer to the previously created property | 2484 | pointer to the target object, a pointer to the previously created property |
2451 | and an initial instance value. | 2485 | and an initial instance value. |
2452 | </para> | 2486 | </para> |
2487 | <sect2> | ||
2488 | <title>Existing KMS Properties</title> | ||
2489 | <para> | ||
2490 | The following table gives description of drm properties exposed by various | ||
2491 | modules/drivers. | ||
2492 | </para> | ||
2493 | <table border="1" cellpadding="0" cellspacing="0"> | ||
2494 | <tbody> | ||
2495 | <tr style="font-weight: bold;"> | ||
2496 | <td valign="top" >Owner Module/Drivers</td> | ||
2497 | <td valign="top" >Group</td> | ||
2498 | <td valign="top" >Property Name</td> | ||
2499 | <td valign="top" >Type</td> | ||
2500 | <td valign="top" >Property Values</td> | ||
2501 | <td valign="top" >Object attached</td> | ||
2502 | <td valign="top" >Description/Restrictions</td> | ||
2503 | </tr> | ||
2504 | <tr> | ||
2505 | <td rowspan="20" valign="top" >DRM</td> | ||
2506 | <td rowspan="2" valign="top" >Generic</td> | ||
2507 | <td valign="top" >“EDID”</td> | ||
2508 | <td valign="top" >BLOB | IMMUTABLE</td> | ||
2509 | <td valign="top" >0</td> | ||
2510 | <td valign="top" >Connector</td> | ||
2511 | <td valign="top" >Contains id of edid blob ptr object.</td> | ||
2512 | </tr> | ||
2513 | <tr> | ||
2514 | <td valign="top" >“DPMS”</td> | ||
2515 | <td valign="top" >ENUM</td> | ||
2516 | <td valign="top" >{ “On”, “Standby”, “Suspend”, “Off” }</td> | ||
2517 | <td valign="top" >Connector</td> | ||
2518 | <td valign="top" >Contains DPMS operation mode value.</td> | ||
2519 | </tr> | ||
2520 | <tr> | ||
2521 | <td rowspan="1" valign="top" >Plane</td> | ||
2522 | <td valign="top" >“type”</td> | ||
2523 | <td valign="top" >ENUM | IMMUTABLE</td> | ||
2524 | <td valign="top" >{ "Overlay", "Primary", "Cursor" }</td> | ||
2525 | <td valign="top" >Plane</td> | ||
2526 | <td valign="top" >Plane type</td> | ||
2527 | </tr> | ||
2528 | <tr> | ||
2529 | <td rowspan="2" valign="top" >DVI-I</td> | ||
2530 | <td valign="top" >“subconnector”</td> | ||
2531 | <td valign="top" >ENUM</td> | ||
2532 | <td valign="top" >{ “Unknown”, “DVI-D”, “DVI-A” }</td> | ||
2533 | <td valign="top" >Connector</td> | ||
2534 | <td valign="top" >TBD</td> | ||
2535 | </tr> | ||
2536 | <tr> | ||
2537 | <td valign="top" >“select subconnector”</td> | ||
2538 | <td valign="top" >ENUM</td> | ||
2539 | <td valign="top" >{ “Automatic”, “DVI-D”, “DVI-A” }</td> | ||
2540 | <td valign="top" >Connector</td> | ||
2541 | <td valign="top" >TBD</td> | ||
2542 | </tr> | ||
2543 | <tr> | ||
2544 | <td rowspan="13" valign="top" >TV</td> | ||
2545 | <td valign="top" >“subconnector”</td> | ||
2546 | <td valign="top" >ENUM</td> | ||
2547 | <td valign="top" >{ "Unknown", "Composite", "SVIDEO", "Component", "SCART" }</td> | ||
2548 | <td valign="top" >Connector</td> | ||
2549 | <td valign="top" >TBD</td> | ||
2550 | </tr> | ||
2551 | <tr> | ||
2552 | <td valign="top" >“select subconnector”</td> | ||
2553 | <td valign="top" >ENUM</td> | ||
2554 | <td valign="top" >{ "Automatic", "Composite", "SVIDEO", "Component", "SCART" }</td> | ||
2555 | <td valign="top" >Connector</td> | ||
2556 | <td valign="top" >TBD</td> | ||
2557 | </tr> | ||
2558 | <tr> | ||
2559 | <td valign="top" >“mode”</td> | ||
2560 | <td valign="top" >ENUM</td> | ||
2561 | <td valign="top" >{ "NTSC_M", "NTSC_J", "NTSC_443", "PAL_B" } etc.</td> | ||
2562 | <td valign="top" >Connector</td> | ||
2563 | <td valign="top" >TBD</td> | ||
2564 | </tr> | ||
2565 | <tr> | ||
2566 | <td valign="top" >“left margin”</td> | ||
2567 | <td valign="top" >RANGE</td> | ||
2568 | <td valign="top" >Min=0, Max=100</td> | ||
2569 | <td valign="top" >Connector</td> | ||
2570 | <td valign="top" >TBD</td> | ||
2571 | </tr> | ||
2572 | <tr> | ||
2573 | <td valign="top" >“right margin”</td> | ||
2574 | <td valign="top" >RANGE</td> | ||
2575 | <td valign="top" >Min=0, Max=100</td> | ||
2576 | <td valign="top" >Connector</td> | ||
2577 | <td valign="top" >TBD</td> | ||
2578 | </tr> | ||
2579 | <tr> | ||
2580 | <td valign="top" >“top margin”</td> | ||
2581 | <td valign="top" >RANGE</td> | ||
2582 | <td valign="top" >Min=0, Max=100</td> | ||
2583 | <td valign="top" >Connector</td> | ||
2584 | <td valign="top" >TBD</td> | ||
2585 | </tr> | ||
2586 | <tr> | ||
2587 | <td valign="top" >“bottom margin”</td> | ||
2588 | <td valign="top" >RANGE</td> | ||
2589 | <td valign="top" >Min=0, Max=100</td> | ||
2590 | <td valign="top" >Connector</td> | ||
2591 | <td valign="top" >TBD</td> | ||
2592 | </tr> | ||
2593 | <tr> | ||
2594 | <td valign="top" >“brightness”</td> | ||
2595 | <td valign="top" >RANGE</td> | ||
2596 | <td valign="top" >Min=0, Max=100</td> | ||
2597 | <td valign="top" >Connector</td> | ||
2598 | <td valign="top" >TBD</td> | ||
2599 | </tr> | ||
2600 | <tr> | ||
2601 | <td valign="top" >“contrast”</td> | ||
2602 | <td valign="top" >RANGE</td> | ||
2603 | <td valign="top" >Min=0, Max=100</td> | ||
2604 | <td valign="top" >Connector</td> | ||
2605 | <td valign="top" >TBD</td> | ||
2606 | </tr> | ||
2607 | <tr> | ||
2608 | <td valign="top" >“flicker reduction”</td> | ||
2609 | <td valign="top" >RANGE</td> | ||
2610 | <td valign="top" >Min=0, Max=100</td> | ||
2611 | <td valign="top" >Connector</td> | ||
2612 | <td valign="top" >TBD</td> | ||
2613 | </tr> | ||
2614 | <tr> | ||
2615 | <td valign="top" >“overscan”</td> | ||
2616 | <td valign="top" >RANGE</td> | ||
2617 | <td valign="top" >Min=0, Max=100</td> | ||
2618 | <td valign="top" >Connector</td> | ||
2619 | <td valign="top" >TBD</td> | ||
2620 | </tr> | ||
2621 | <tr> | ||
2622 | <td valign="top" >“saturation”</td> | ||
2623 | <td valign="top" >RANGE</td> | ||
2624 | <td valign="top" >Min=0, Max=100</td> | ||
2625 | <td valign="top" >Connector</td> | ||
2626 | <td valign="top" >TBD</td> | ||
2627 | </tr> | ||
2628 | <tr> | ||
2629 | <td valign="top" >“hue”</td> | ||
2630 | <td valign="top" >RANGE</td> | ||
2631 | <td valign="top" >Min=0, Max=100</td> | ||
2632 | <td valign="top" >Connector</td> | ||
2633 | <td valign="top" >TBD</td> | ||
2634 | </tr> | ||
2635 | <tr> | ||
2636 | <td rowspan="2" valign="top" >Optional</td> | ||
2637 | <td valign="top" >“scaling mode”</td> | ||
2638 | <td valign="top" >ENUM</td> | ||
2639 | <td valign="top" >{ "None", "Full", "Center", "Full aspect" }</td> | ||
2640 | <td valign="top" >Connector</td> | ||
2641 | <td valign="top" >TBD</td> | ||
2642 | </tr> | ||
2643 | <tr> | ||
2644 | <td valign="top" >“dirty”</td> | ||
2645 | <td valign="top" >ENUM | IMMUTABLE</td> | ||
2646 | <td valign="top" >{ "Off", "On", "Annotate" }</td> | ||
2647 | <td valign="top" >Connector</td> | ||
2648 | <td valign="top" >TBD</td> | ||
2649 | </tr> | ||
2650 | <tr> | ||
2651 | <td rowspan="21" valign="top" >i915</td> | ||
2652 | <td rowspan="3" valign="top" >Generic</td> | ||
2653 | <td valign="top" >"Broadcast RGB"</td> | ||
2654 | <td valign="top" >ENUM</td> | ||
2655 | <td valign="top" >{ "Automatic", "Full", "Limited 16:235" }</td> | ||
2656 | <td valign="top" >Connector</td> | ||
2657 | <td valign="top" >TBD</td> | ||
2658 | </tr> | ||
2659 | <tr> | ||
2660 | <td valign="top" >“audio”</td> | ||
2661 | <td valign="top" >ENUM</td> | ||
2662 | <td valign="top" >{ "force-dvi", "off", "auto", "on" }</td> | ||
2663 | <td valign="top" >Connector</td> | ||
2664 | <td valign="top" >TBD</td> | ||
2665 | </tr> | ||
2666 | <tr> | ||
2667 | <td valign="top" >Standard name as in DRM</td> | ||
2668 | <td valign="top" >Standard type as in DRM</td> | ||
2669 | <td valign="top" >Standard value as in DRM</td> | ||
2670 | <td valign="top" >Standard Object as in DRM</td> | ||
2671 | <td valign="top" >TBD</td> | ||
2672 | </tr> | ||
2673 | <tr> | ||
2674 | <td rowspan="17" valign="top" >SDVO-TV</td> | ||
2675 | <td valign="top" >“mode”</td> | ||
2676 | <td valign="top" >ENUM</td> | ||
2677 | <td valign="top" >{ "NTSC_M", "NTSC_J", "NTSC_443", "PAL_B" } etc.</td> | ||
2678 | <td valign="top" >Connector</td> | ||
2679 | <td valign="top" >TBD</td> | ||
2680 | </tr> | ||
2681 | <tr> | ||
2682 | <td valign="top" >"left_margin"</td> | ||
2683 | <td valign="top" >RANGE</td> | ||
2684 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2685 | <td valign="top" >Connector</td> | ||
2686 | <td valign="top" >TBD</td> | ||
2687 | </tr> | ||
2688 | <tr> | ||
2689 | <td valign="top" >"right_margin"</td> | ||
2690 | <td valign="top" >RANGE</td> | ||
2691 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2692 | <td valign="top" >Connector</td> | ||
2693 | <td valign="top" >TBD</td> | ||
2694 | </tr> | ||
2695 | <tr> | ||
2696 | <td valign="top" >"top_margin"</td> | ||
2697 | <td valign="top" >RANGE</td> | ||
2698 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2699 | <td valign="top" >Connector</td> | ||
2700 | <td valign="top" >TBD</td> | ||
2701 | </tr> | ||
2702 | <tr> | ||
2703 | <td valign="top" >"bottom_margin"</td> | ||
2704 | <td valign="top" >RANGE</td> | ||
2705 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2706 | <td valign="top" >Connector</td> | ||
2707 | <td valign="top" >TBD</td> | ||
2708 | </tr> | ||
2709 | <tr> | ||
2710 | <td valign="top" >“hpos”</td> | ||
2711 | <td valign="top" >RANGE</td> | ||
2712 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2713 | <td valign="top" >Connector</td> | ||
2714 | <td valign="top" >TBD</td> | ||
2715 | </tr> | ||
2716 | <tr> | ||
2717 | <td valign="top" >“vpos”</td> | ||
2718 | <td valign="top" >RANGE</td> | ||
2719 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2720 | <td valign="top" >Connector</td> | ||
2721 | <td valign="top" >TBD</td> | ||
2722 | </tr> | ||
2723 | <tr> | ||
2724 | <td valign="top" >“contrast”</td> | ||
2725 | <td valign="top" >RANGE</td> | ||
2726 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2727 | <td valign="top" >Connector</td> | ||
2728 | <td valign="top" >TBD</td> | ||
2729 | </tr> | ||
2730 | <tr> | ||
2731 | <td valign="top" >“saturation”</td> | ||
2732 | <td valign="top" >RANGE</td> | ||
2733 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2734 | <td valign="top" >Connector</td> | ||
2735 | <td valign="top" >TBD</td> | ||
2736 | </tr> | ||
2737 | <tr> | ||
2738 | <td valign="top" >“hue”</td> | ||
2739 | <td valign="top" >RANGE</td> | ||
2740 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2741 | <td valign="top" >Connector</td> | ||
2742 | <td valign="top" >TBD</td> | ||
2743 | </tr> | ||
2744 | <tr> | ||
2745 | <td valign="top" >“sharpness”</td> | ||
2746 | <td valign="top" >RANGE</td> | ||
2747 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2748 | <td valign="top" >Connector</td> | ||
2749 | <td valign="top" >TBD</td> | ||
2750 | </tr> | ||
2751 | <tr> | ||
2752 | <td valign="top" >“flicker_filter”</td> | ||
2753 | <td valign="top" >RANGE</td> | ||
2754 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2755 | <td valign="top" >Connector</td> | ||
2756 | <td valign="top" >TBD</td> | ||
2757 | </tr> | ||
2758 | <tr> | ||
2759 | <td valign="top" >“flicker_filter_adaptive”</td> | ||
2760 | <td valign="top" >RANGE</td> | ||
2761 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2762 | <td valign="top" >Connector</td> | ||
2763 | <td valign="top" >TBD</td> | ||
2764 | </tr> | ||
2765 | <tr> | ||
2766 | <td valign="top" >“flicker_filter_2d”</td> | ||
2767 | <td valign="top" >RANGE</td> | ||
2768 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2769 | <td valign="top" >Connector</td> | ||
2770 | <td valign="top" >TBD</td> | ||
2771 | </tr> | ||
2772 | <tr> | ||
2773 | <td valign="top" >“tv_chroma_filter”</td> | ||
2774 | <td valign="top" >RANGE</td> | ||
2775 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2776 | <td valign="top" >Connector</td> | ||
2777 | <td valign="top" >TBD</td> | ||
2778 | </tr> | ||
2779 | <tr> | ||
2780 | <td valign="top" >“tv_luma_filter”</td> | ||
2781 | <td valign="top" >RANGE</td> | ||
2782 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2783 | <td valign="top" >Connector</td> | ||
2784 | <td valign="top" >TBD</td> | ||
2785 | </tr> | ||
2786 | <tr> | ||
2787 | <td valign="top" >“dot_crawl”</td> | ||
2788 | <td valign="top" >RANGE</td> | ||
2789 | <td valign="top" >Min=0, Max=1</td> | ||
2790 | <td valign="top" >Connector</td> | ||
2791 | <td valign="top" >TBD</td> | ||
2792 | </tr> | ||
2793 | <tr> | ||
2794 | <td valign="top" >SDVO-TV/LVDS</td> | ||
2795 | <td valign="top" >“brightness”</td> | ||
2796 | <td valign="top" >RANGE</td> | ||
2797 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2798 | <td valign="top" >Connector</td> | ||
2799 | <td valign="top" >TBD</td> | ||
2800 | </tr> | ||
2801 | <tr> | ||
2802 | <td rowspan="3" valign="top" >CDV gma-500</td> | ||
2803 | <td rowspan="3" valign="top" >Generic</td> | ||
2804 | <td valign="top" >"Broadcast RGB"</td> | ||
2805 | <td valign="top" >ENUM</td> | ||
2806 | <td valign="top" >{ “Full”, “Limited 16:235” }</td> | ||
2807 | <td valign="top" >Connector</td> | ||
2808 | <td valign="top" >TBD</td> | ||
2809 | </tr> | ||
2810 | <tr> | ||
2811 | <td valign="top" >"Broadcast RGB"</td> | ||
2812 | <td valign="top" >ENUM</td> | ||
2813 | <td valign="top" >{ “off”, “auto”, “on” }</td> | ||
2814 | <td valign="top" >Connector</td> | ||
2815 | <td valign="top" >TBD</td> | ||
2816 | </tr> | ||
2817 | <tr> | ||
2818 | <td valign="top" >Standard name as in DRM</td> | ||
2819 | <td valign="top" >Standard type as in DRM</td> | ||
2820 | <td valign="top" >Standard value as in DRM</td> | ||
2821 | <td valign="top" >Standard Object as in DRM</td> | ||
2822 | <td valign="top" >TBD</td> | ||
2823 | </tr> | ||
2824 | <tr> | ||
2825 | <td rowspan="20" valign="top" >Poulsbo</td> | ||
2826 | <td rowspan="2" valign="top" >Generic</td> | ||
2827 | <td valign="top" >“backlight”</td> | ||
2828 | <td valign="top" >RANGE</td> | ||
2829 | <td valign="top" >Min=0, Max=100</td> | ||
2830 | <td valign="top" >Connector</td> | ||
2831 | <td valign="top" >TBD</td> | ||
2832 | </tr> | ||
2833 | <tr> | ||
2834 | <td valign="top" >Standard name as in DRM</td> | ||
2835 | <td valign="top" >Standard type as in DRM</td> | ||
2836 | <td valign="top" >Standard value as in DRM</td> | ||
2837 | <td valign="top" >Standard Object as in DRM</td> | ||
2838 | <td valign="top" >TBD</td> | ||
2839 | </tr> | ||
2840 | <tr> | ||
2841 | <td rowspan="17" valign="top" >SDVO-TV</td> | ||
2842 | <td valign="top" >“mode”</td> | ||
2843 | <td valign="top" >ENUM</td> | ||
2844 | <td valign="top" >{ "NTSC_M", "NTSC_J", "NTSC_443", "PAL_B" } etc.</td> | ||
2845 | <td valign="top" >Connector</td> | ||
2846 | <td valign="top" >TBD</td> | ||
2847 | </tr> | ||
2848 | <tr> | ||
2849 | <td valign="top" >"left_margin"</td> | ||
2850 | <td valign="top" >RANGE</td> | ||
2851 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2852 | <td valign="top" >Connector</td> | ||
2853 | <td valign="top" >TBD</td> | ||
2854 | </tr> | ||
2855 | <tr> | ||
2856 | <td valign="top" >"right_margin"</td> | ||
2857 | <td valign="top" >RANGE</td> | ||
2858 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2859 | <td valign="top" >Connector</td> | ||
2860 | <td valign="top" >TBD</td> | ||
2861 | </tr> | ||
2862 | <tr> | ||
2863 | <td valign="top" >"top_margin"</td> | ||
2864 | <td valign="top" >RANGE</td> | ||
2865 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2866 | <td valign="top" >Connector</td> | ||
2867 | <td valign="top" >TBD</td> | ||
2868 | </tr> | ||
2869 | <tr> | ||
2870 | <td valign="top" >"bottom_margin"</td> | ||
2871 | <td valign="top" >RANGE</td> | ||
2872 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2873 | <td valign="top" >Connector</td> | ||
2874 | <td valign="top" >TBD</td> | ||
2875 | </tr> | ||
2876 | <tr> | ||
2877 | <td valign="top" >“hpos”</td> | ||
2878 | <td valign="top" >RANGE</td> | ||
2879 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2880 | <td valign="top" >Connector</td> | ||
2881 | <td valign="top" >TBD</td> | ||
2882 | </tr> | ||
2883 | <tr> | ||
2884 | <td valign="top" >“vpos”</td> | ||
2885 | <td valign="top" >RANGE</td> | ||
2886 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2887 | <td valign="top" >Connector</td> | ||
2888 | <td valign="top" >TBD</td> | ||
2889 | </tr> | ||
2890 | <tr> | ||
2891 | <td valign="top" >“contrast”</td> | ||
2892 | <td valign="top" >RANGE</td> | ||
2893 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2894 | <td valign="top" >Connector</td> | ||
2895 | <td valign="top" >TBD</td> | ||
2896 | </tr> | ||
2897 | <tr> | ||
2898 | <td valign="top" >“saturation”</td> | ||
2899 | <td valign="top" >RANGE</td> | ||
2900 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2901 | <td valign="top" >Connector</td> | ||
2902 | <td valign="top" >TBD</td> | ||
2903 | </tr> | ||
2904 | <tr> | ||
2905 | <td valign="top" >“hue”</td> | ||
2906 | <td valign="top" >RANGE</td> | ||
2907 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2908 | <td valign="top" >Connector</td> | ||
2909 | <td valign="top" >TBD</td> | ||
2910 | </tr> | ||
2911 | <tr> | ||
2912 | <td valign="top" >“sharpness”</td> | ||
2913 | <td valign="top" >RANGE</td> | ||
2914 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2915 | <td valign="top" >Connector</td> | ||
2916 | <td valign="top" >TBD</td> | ||
2917 | </tr> | ||
2918 | <tr> | ||
2919 | <td valign="top" >“flicker_filter”</td> | ||
2920 | <td valign="top" >RANGE</td> | ||
2921 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2922 | <td valign="top" >Connector</td> | ||
2923 | <td valign="top" >TBD</td> | ||
2924 | </tr> | ||
2925 | <tr> | ||
2926 | <td valign="top" >“flicker_filter_adaptive”</td> | ||
2927 | <td valign="top" >RANGE</td> | ||
2928 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2929 | <td valign="top" >Connector</td> | ||
2930 | <td valign="top" >TBD</td> | ||
2931 | </tr> | ||
2932 | <tr> | ||
2933 | <td valign="top" >“flicker_filter_2d”</td> | ||
2934 | <td valign="top" >RANGE</td> | ||
2935 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2936 | <td valign="top" >Connector</td> | ||
2937 | <td valign="top" >TBD</td> | ||
2938 | </tr> | ||
2939 | <tr> | ||
2940 | <td valign="top" >“tv_chroma_filter”</td> | ||
2941 | <td valign="top" >RANGE</td> | ||
2942 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2943 | <td valign="top" >Connector</td> | ||
2944 | <td valign="top" >TBD</td> | ||
2945 | </tr> | ||
2946 | <tr> | ||
2947 | <td valign="top" >“tv_luma_filter”</td> | ||
2948 | <td valign="top" >RANGE</td> | ||
2949 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2950 | <td valign="top" >Connector</td> | ||
2951 | <td valign="top" >TBD</td> | ||
2952 | </tr> | ||
2953 | <tr> | ||
2954 | <td valign="top" >“dot_crawl”</td> | ||
2955 | <td valign="top" >RANGE</td> | ||
2956 | <td valign="top" >Min=0, Max=1</td> | ||
2957 | <td valign="top" >Connector</td> | ||
2958 | <td valign="top" >TBD</td> | ||
2959 | </tr> | ||
2960 | <tr> | ||
2961 | <td valign="top" >SDVO-TV/LVDS</td> | ||
2962 | <td valign="top" >“brightness”</td> | ||
2963 | <td valign="top" >RANGE</td> | ||
2964 | <td valign="top" >Min=0, Max= SDVO dependent</td> | ||
2965 | <td valign="top" >Connector</td> | ||
2966 | <td valign="top" >TBD</td> | ||
2967 | </tr> | ||
2968 | <tr> | ||
2969 | <td rowspan="11" valign="top" >armada</td> | ||
2970 | <td rowspan="2" valign="top" >CRTC</td> | ||
2971 | <td valign="top" >"CSC_YUV"</td> | ||
2972 | <td valign="top" >ENUM</td> | ||
2973 | <td valign="top" >{ "Auto" , "CCIR601", "CCIR709" }</td> | ||
2974 | <td valign="top" >CRTC</td> | ||
2975 | <td valign="top" >TBD</td> | ||
2976 | </tr> | ||
2977 | <tr> | ||
2978 | <td valign="top" >"CSC_RGB"</td> | ||
2979 | <td valign="top" >ENUM</td> | ||
2980 | <td valign="top" >{ "Auto", "Computer system", "Studio" }</td> | ||
2981 | <td valign="top" >CRTC</td> | ||
2982 | <td valign="top" >TBD</td> | ||
2983 | </tr> | ||
2984 | <tr> | ||
2985 | <td rowspan="9" valign="top" >Overlay</td> | ||
2986 | <td valign="top" >"colorkey"</td> | ||
2987 | <td valign="top" >RANGE</td> | ||
2988 | <td valign="top" >Min=0, Max=0xffffff</td> | ||
2989 | <td valign="top" >Plane</td> | ||
2990 | <td valign="top" >TBD</td> | ||
2991 | </tr> | ||
2992 | <tr> | ||
2993 | <td valign="top" >"colorkey_min"</td> | ||
2994 | <td valign="top" >RANGE</td> | ||
2995 | <td valign="top" >Min=0, Max=0xffffff</td> | ||
2996 | <td valign="top" >Plane</td> | ||
2997 | <td valign="top" >TBD</td> | ||
2998 | </tr> | ||
2999 | <tr> | ||
3000 | <td valign="top" >"colorkey_max"</td> | ||
3001 | <td valign="top" >RANGE</td> | ||
3002 | <td valign="top" >Min=0, Max=0xffffff</td> | ||
3003 | <td valign="top" >Plane</td> | ||
3004 | <td valign="top" >TBD</td> | ||
3005 | </tr> | ||
3006 | <tr> | ||
3007 | <td valign="top" >"colorkey_val"</td> | ||
3008 | <td valign="top" >RANGE</td> | ||
3009 | <td valign="top" >Min=0, Max=0xffffff</td> | ||
3010 | <td valign="top" >Plane</td> | ||
3011 | <td valign="top" >TBD</td> | ||
3012 | </tr> | ||
3013 | <tr> | ||
3014 | <td valign="top" >"colorkey_alpha"</td> | ||
3015 | <td valign="top" >RANGE</td> | ||
3016 | <td valign="top" >Min=0, Max=0xffffff</td> | ||
3017 | <td valign="top" >Plane</td> | ||
3018 | <td valign="top" >TBD</td> | ||
3019 | </tr> | ||
3020 | <tr> | ||
3021 | <td valign="top" >"colorkey_mode"</td> | ||
3022 | <td valign="top" >ENUM</td> | ||
3023 | <td valign="top" >{ "disabled", "Y component", "U component" | ||
3024 | , "V component", "RGB", “R component", "G component", "B component" }</td> | ||
3025 | <td valign="top" >Plane</td> | ||
3026 | <td valign="top" >TBD</td> | ||
3027 | </tr> | ||
3028 | <tr> | ||
3029 | <td valign="top" >"brightness"</td> | ||
3030 | <td valign="top" >RANGE</td> | ||
3031 | <td valign="top" >Min=0, Max=256 + 255</td> | ||
3032 | <td valign="top" >Plane</td> | ||
3033 | <td valign="top" >TBD</td> | ||
3034 | </tr> | ||
3035 | <tr> | ||
3036 | <td valign="top" >"contrast"</td> | ||
3037 | <td valign="top" >RANGE</td> | ||
3038 | <td valign="top" >Min=0, Max=0x7fff</td> | ||
3039 | <td valign="top" >Plane</td> | ||
3040 | <td valign="top" >TBD</td> | ||
3041 | </tr> | ||
3042 | <tr> | ||
3043 | <td valign="top" >"saturation"</td> | ||
3044 | <td valign="top" >RANGE</td> | ||
3045 | <td valign="top" >Min=0, Max=0x7fff</td> | ||
3046 | <td valign="top" >Plane</td> | ||
3047 | <td valign="top" >TBD</td> | ||
3048 | </tr> | ||
3049 | <tr> | ||
3050 | <td rowspan="2" valign="top" >exynos</td> | ||
3051 | <td valign="top" >CRTC</td> | ||
3052 | <td valign="top" >“mode”</td> | ||
3053 | <td valign="top" >ENUM</td> | ||
3054 | <td valign="top" >{ "normal", "blank" }</td> | ||
3055 | <td valign="top" >CRTC</td> | ||
3056 | <td valign="top" >TBD</td> | ||
3057 | </tr> | ||
3058 | <tr> | ||
3059 | <td valign="top" >Overlay</td> | ||
3060 | <td valign="top" >“zpos”</td> | ||
3061 | <td valign="top" >RANGE</td> | ||
3062 | <td valign="top" >Min=0, Max=MAX_PLANE-1</td> | ||
3063 | <td valign="top" >Plane</td> | ||
3064 | <td valign="top" >TBD</td> | ||
3065 | </tr> | ||
3066 | <tr> | ||
3067 | <td rowspan="3" valign="top" >i2c/ch7006_drv</td> | ||
3068 | <td valign="top" >Generic</td> | ||
3069 | <td valign="top" >“scale”</td> | ||
3070 | <td valign="top" >RANGE</td> | ||
3071 | <td valign="top" >Min=0, Max=2</td> | ||
3072 | <td valign="top" >Connector</td> | ||
3073 | <td valign="top" >TBD</td> | ||
3074 | </tr> | ||
3075 | <tr> | ||
3076 | <td rowspan="2" valign="top" >TV</td> | ||
3077 | <td valign="top" >Standard names as in DRM</td> | ||
3078 | <td valign="top" >Standard types as in DRM</td> | ||
3079 | <td valign="top" >Standard Values as in DRM</td> | ||
3080 | <td valign="top" >Standard object as in DRM</td> | ||
3081 | <td valign="top" >TBD</td> | ||
3082 | </tr> | ||
3083 | <tr> | ||
3084 | <td valign="top" >“mode”</td> | ||
3085 | <td valign="top" >ENUM</td> | ||
3086 | <td valign="top" >{ "PAL", "PAL-M","PAL-N"}, ”PAL-Nc" | ||
3087 | , "PAL-60", "NTSC-M", "NTSC-J" }</td> | ||
3088 | <td valign="top" >Connector</td> | ||
3089 | <td valign="top" >TBD</td> | ||
3090 | </tr> | ||
3091 | <tr> | ||
3092 | <td rowspan="16" valign="top" >nouveau</td> | ||
3093 | <td rowspan="6" valign="top" >NV10 Overlay</td> | ||
3094 | <td valign="top" >"colorkey"</td> | ||
3095 | <td valign="top" >RANGE</td> | ||
3096 | <td valign="top" >Min=0, Max=0x01ffffff</td> | ||
3097 | <td valign="top" >Plane</td> | ||
3098 | <td valign="top" >TBD</td> | ||
3099 | </tr> | ||
3100 | <tr> | ||
3101 | <td valign="top" >“contrast”</td> | ||
3102 | <td valign="top" >RANGE</td> | ||
3103 | <td valign="top" >Min=0, Max=8192-1</td> | ||
3104 | <td valign="top" >Plane</td> | ||
3105 | <td valign="top" >TBD</td> | ||
3106 | </tr> | ||
3107 | <tr> | ||
3108 | <td valign="top" >“brightness”</td> | ||
3109 | <td valign="top" >RANGE</td> | ||
3110 | <td valign="top" >Min=0, Max=1024</td> | ||
3111 | <td valign="top" >Plane</td> | ||
3112 | <td valign="top" >TBD</td> | ||
3113 | </tr> | ||
3114 | <tr> | ||
3115 | <td valign="top" >“hue”</td> | ||
3116 | <td valign="top" >RANGE</td> | ||
3117 | <td valign="top" >Min=0, Max=359</td> | ||
3118 | <td valign="top" >Plane</td> | ||
3119 | <td valign="top" >TBD</td> | ||
3120 | </tr> | ||
3121 | <tr> | ||
3122 | <td valign="top" >“saturation”</td> | ||
3123 | <td valign="top" >RANGE</td> | ||
3124 | <td valign="top" >Min=0, Max=8192-1</td> | ||
3125 | <td valign="top" >Plane</td> | ||
3126 | <td valign="top" >TBD</td> | ||
3127 | </tr> | ||
3128 | <tr> | ||
3129 | <td valign="top" >“iturbt_709”</td> | ||
3130 | <td valign="top" >RANGE</td> | ||
3131 | <td valign="top" >Min=0, Max=1</td> | ||
3132 | <td valign="top" >Plane</td> | ||
3133 | <td valign="top" >TBD</td> | ||
3134 | </tr> | ||
3135 | <tr> | ||
3136 | <td rowspan="2" valign="top" >Nv04 Overlay</td> | ||
3137 | <td valign="top" >“colorkey”</td> | ||
3138 | <td valign="top" >RANGE</td> | ||
3139 | <td valign="top" >Min=0, Max=0x01ffffff</td> | ||
3140 | <td valign="top" >Plane</td> | ||
3141 | <td valign="top" >TBD</td> | ||
3142 | </tr> | ||
3143 | <tr> | ||
3144 | <td valign="top" >“brightness”</td> | ||
3145 | <td valign="top" >RANGE</td> | ||
3146 | <td valign="top" >Min=0, Max=1024</td> | ||
3147 | <td valign="top" >Plane</td> | ||
3148 | <td valign="top" >TBD</td> | ||
3149 | </tr> | ||
3150 | <tr> | ||
3151 | <td rowspan="7" valign="top" >Display</td> | ||
3152 | <td valign="top" >“dithering mode”</td> | ||
3153 | <td valign="top" >ENUM</td> | ||
3154 | <td valign="top" >{ "auto", "off", "on" }</td> | ||
3155 | <td valign="top" >Connector</td> | ||
3156 | <td valign="top" >TBD</td> | ||
3157 | </tr> | ||
3158 | <tr> | ||
3159 | <td valign="top" >“dithering depth”</td> | ||
3160 | <td valign="top" >ENUM</td> | ||
3161 | <td valign="top" >{ "auto", "off", "on", "static 2x2", "dynamic 2x2", "temporal" }</td> | ||
3162 | <td valign="top" >Connector</td> | ||
3163 | <td valign="top" >TBD</td> | ||
3164 | </tr> | ||
3165 | <tr> | ||
3166 | <td valign="top" >“underscan”</td> | ||
3167 | <td valign="top" >ENUM</td> | ||
3168 | <td valign="top" >{ "auto", "6 bpc", "8 bpc" }</td> | ||
3169 | <td valign="top" >Connector</td> | ||
3170 | <td valign="top" >TBD</td> | ||
3171 | </tr> | ||
3172 | <tr> | ||
3173 | <td valign="top" >“underscan hborder”</td> | ||
3174 | <td valign="top" >RANGE</td> | ||
3175 | <td valign="top" >Min=0, Max=128</td> | ||
3176 | <td valign="top" >Connector</td> | ||
3177 | <td valign="top" >TBD</td> | ||
3178 | </tr> | ||
3179 | <tr> | ||
3180 | <td valign="top" >“underscan vborder”</td> | ||
3181 | <td valign="top" >RANGE</td> | ||
3182 | <td valign="top" >Min=0, Max=128</td> | ||
3183 | <td valign="top" >Connector</td> | ||
3184 | <td valign="top" >TBD</td> | ||
3185 | </tr> | ||
3186 | <tr> | ||
3187 | <td valign="top" >“vibrant hue”</td> | ||
3188 | <td valign="top" >RANGE</td> | ||
3189 | <td valign="top" >Min=0, Max=180</td> | ||
3190 | <td valign="top" >Connector</td> | ||
3191 | <td valign="top" >TBD</td> | ||
3192 | </tr> | ||
3193 | <tr> | ||
3194 | <td valign="top" >“color vibrance”</td> | ||
3195 | <td valign="top" >RANGE</td> | ||
3196 | <td valign="top" >Min=0, Max=200</td> | ||
3197 | <td valign="top" >Connector</td> | ||
3198 | <td valign="top" >TBD</td> | ||
3199 | </tr> | ||
3200 | <tr> | ||
3201 | <td valign="top" >Generic</td> | ||
3202 | <td valign="top" >Standard name as in DRM</td> | ||
3203 | <td valign="top" >Standard type as in DRM</td> | ||
3204 | <td valign="top" >Standard value as in DRM</td> | ||
3205 | <td valign="top" >Standard Object as in DRM</td> | ||
3206 | <td valign="top" >TBD</td> | ||
3207 | </tr> | ||
3208 | <tr> | ||
3209 | <td rowspan="2" valign="top" >omap</td> | ||
3210 | <td rowspan="2" valign="top" >Generic</td> | ||
3211 | <td valign="top" >“rotation”</td> | ||
3212 | <td valign="top" >BITMASK</td> | ||
3213 | <td valign="top" >{ 0, "rotate-0" }, | ||
3214 | { 1, "rotate-90" }, | ||
3215 | { 2, "rotate-180" }, | ||
3216 | { 3, "rotate-270" }, | ||
3217 | { 4, "reflect-x" }, | ||
3218 | { 5, "reflect-y" }</td> | ||
3219 | <td valign="top" >CRTC, Plane</td> | ||
3220 | <td valign="top" >TBD</td> | ||
3221 | </tr> | ||
3222 | <tr> | ||
3223 | <td valign="top" >“zorder”</td> | ||
3224 | <td valign="top" >RANGE</td> | ||
3225 | <td valign="top" >Min=0, Max=3</td> | ||
3226 | <td valign="top" >CRTC, Plane</td> | ||
3227 | <td valign="top" >TBD</td> | ||
3228 | </tr> | ||
3229 | <tr> | ||
3230 | <td valign="top" >qxl</td> | ||
3231 | <td valign="top" >Generic</td> | ||
3232 | <td valign="top" >“hotplug_mode_update"</td> | ||
3233 | <td valign="top" >RANGE</td> | ||
3234 | <td valign="top" >Min=0, Max=1</td> | ||
3235 | <td valign="top" >Connector</td> | ||
3236 | <td valign="top" >TBD</td> | ||
3237 | </tr> | ||
3238 | <tr> | ||
3239 | <td rowspan="10" valign="top" >radeon</td> | ||
3240 | <td valign="top" >DVI-I</td> | ||
3241 | <td valign="top" >“coherent”</td> | ||
3242 | <td valign="top" >RANGE</td> | ||
3243 | <td valign="top" >Min=0, Max=1</td> | ||
3244 | <td valign="top" >Connector</td> | ||
3245 | <td valign="top" >TBD</td> | ||
3246 | </tr> | ||
3247 | <tr> | ||
3248 | <td valign="top" >DAC enable load detect</td> | ||
3249 | <td valign="top" >“load detection”</td> | ||
3250 | <td valign="top" >RANGE</td> | ||
3251 | <td valign="top" >Min=0, Max=1</td> | ||
3252 | <td valign="top" >Connector</td> | ||
3253 | <td valign="top" >TBD</td> | ||
3254 | </tr> | ||
3255 | <tr> | ||
3256 | <td valign="top" >TV Standard</td> | ||
3257 | <td valign="top" >"tv standard"</td> | ||
3258 | <td valign="top" >ENUM</td> | ||
3259 | <td valign="top" >{ "ntsc", "pal", "pal-m", "pal-60", "ntsc-j" | ||
3260 | , "scart-pal", "pal-cn", "secam" }</td> | ||
3261 | <td valign="top" >Connector</td> | ||
3262 | <td valign="top" >TBD</td> | ||
3263 | </tr> | ||
3264 | <tr> | ||
3265 | <td valign="top" >legacy TMDS PLL detect</td> | ||
3266 | <td valign="top" >"tmds_pll"</td> | ||
3267 | <td valign="top" >ENUM</td> | ||
3268 | <td valign="top" >{ "driver", "bios" }</td> | ||
3269 | <td valign="top" >-</td> | ||
3270 | <td valign="top" >TBD</td> | ||
3271 | </tr> | ||
3272 | <tr> | ||
3273 | <td rowspan="3" valign="top" >Underscan</td> | ||
3274 | <td valign="top" >"underscan"</td> | ||
3275 | <td valign="top" >ENUM</td> | ||
3276 | <td valign="top" >{ "off", "on", "auto" }</td> | ||
3277 | <td valign="top" >Connector</td> | ||
3278 | <td valign="top" >TBD</td> | ||
3279 | </tr> | ||
3280 | <tr> | ||
3281 | <td valign="top" >"underscan hborder"</td> | ||
3282 | <td valign="top" >RANGE</td> | ||
3283 | <td valign="top" >Min=0, Max=128</td> | ||
3284 | <td valign="top" >Connector</td> | ||
3285 | <td valign="top" >TBD</td> | ||
3286 | </tr> | ||
3287 | <tr> | ||
3288 | <td valign="top" >"underscan vborder"</td> | ||
3289 | <td valign="top" >RANGE</td> | ||
3290 | <td valign="top" >Min=0, Max=128</td> | ||
3291 | <td valign="top" >Connector</td> | ||
3292 | <td valign="top" >TBD</td> | ||
3293 | </tr> | ||
3294 | <tr> | ||
3295 | <td valign="top" >Audio</td> | ||
3296 | <td valign="top" >“audio”</td> | ||
3297 | <td valign="top" >ENUM</td> | ||
3298 | <td valign="top" >{ "off", "on", "auto" }</td> | ||
3299 | <td valign="top" >Connector</td> | ||
3300 | <td valign="top" >TBD</td> | ||
3301 | </tr> | ||
3302 | <tr> | ||
3303 | <td valign="top" >FMT Dithering</td> | ||
3304 | <td valign="top" >“dither”</td> | ||
3305 | <td valign="top" >ENUM</td> | ||
3306 | <td valign="top" >{ "off", "on" }</td> | ||
3307 | <td valign="top" >Connector</td> | ||
3308 | <td valign="top" >TBD</td> | ||
3309 | </tr> | ||
3310 | <tr> | ||
3311 | <td valign="top" >Generic</td> | ||
3312 | <td valign="top" >Standard name as in DRM</td> | ||
3313 | <td valign="top" >Standard type as in DRM</td> | ||
3314 | <td valign="top" >Standard value as in DRM</td> | ||
3315 | <td valign="top" >Standard Object as in DRM</td> | ||
3316 | <td valign="top" >TBD</td> | ||
3317 | </tr> | ||
3318 | <tr> | ||
3319 | <td rowspan="3" valign="top" >rcar-du</td> | ||
3320 | <td rowspan="3" valign="top" >Generic</td> | ||
3321 | <td valign="top" >"alpha"</td> | ||
3322 | <td valign="top" >RANGE</td> | ||
3323 | <td valign="top" >Min=0, Max=255</td> | ||
3324 | <td valign="top" >Plane</td> | ||
3325 | <td valign="top" >TBD</td> | ||
3326 | </tr> | ||
3327 | <tr> | ||
3328 | <td valign="top" >"colorkey"</td> | ||
3329 | <td valign="top" >RANGE</td> | ||
3330 | <td valign="top" >Min=0, Max=0x01ffffff</td> | ||
3331 | <td valign="top" >Plane</td> | ||
3332 | <td valign="top" >TBD</td> | ||
3333 | </tr> | ||
3334 | <tr> | ||
3335 | <td valign="top" >"zpos"</td> | ||
3336 | <td valign="top" >RANGE</td> | ||
3337 | <td valign="top" >Min=1, Max=7</td> | ||
3338 | <td valign="top" >Plane</td> | ||
3339 | <td valign="top" >TBD</td> | ||
3340 | </tr> | ||
3341 | </tbody> | ||
3342 | </table> | ||
3343 | </sect2> | ||
2453 | </sect1> | 3344 | </sect1> |
2454 | 3345 | ||
2455 | <!-- Internals: vertical blanking --> | 3346 | <!-- Internals: vertical blanking --> |
@@ -2527,6 +3418,10 @@ void (*disable_vblank) (struct drm_device *dev, int crtc);</synopsis> | |||
2527 | with a call to <function>drm_vblank_cleanup</function> in the driver | 3418 | with a call to <function>drm_vblank_cleanup</function> in the driver |
2528 | <methodname>unload</methodname> operation handler. | 3419 | <methodname>unload</methodname> operation handler. |
2529 | </para> | 3420 | </para> |
3421 | <sect2> | ||
3422 | <title>Vertical Blanking and Interrupt Handling Functions Reference</title> | ||
3423 | !Edrivers/gpu/drm/drm_irq.c | ||
3424 | </sect2> | ||
2530 | </sect1> | 3425 | </sect1> |
2531 | 3426 | ||
2532 | <!-- Internals: open/close, file operations and ioctls --> | 3427 | <!-- Internals: open/close, file operations and ioctls --> |
@@ -2869,17 +3764,16 @@ int num_ioctls;</synopsis> | |||
2869 | <term>DRM_IOCTL_MODESET_CTL</term> | 3764 | <term>DRM_IOCTL_MODESET_CTL</term> |
2870 | <listitem> | 3765 | <listitem> |
2871 | <para> | 3766 | <para> |
2872 | This should be called by application level drivers before and | 3767 | This was only used for user-mode-settind drivers around |
2873 | after mode setting, since on many devices the vertical blank | 3768 | modesetting changes to allow the kernel to update the vblank |
2874 | counter is reset at that time. Internally, the DRM snapshots | 3769 | interrupt after mode setting, since on many devices the vertical |
2875 | the last vblank count when the ioctl is called with the | 3770 | blank counter is reset to 0 at some point during modeset. Modern |
2876 | _DRM_PRE_MODESET command, so that the counter won't go backwards | 3771 | drivers should not call this any more since with kernel mode |
2877 | (which is dealt with when _DRM_POST_MODESET is used). | 3772 | setting it is a no-op. |
2878 | </para> | 3773 | </para> |
2879 | </listitem> | 3774 | </listitem> |
2880 | </varlistentry> | 3775 | </varlistentry> |
2881 | </variablelist> | 3776 | </variablelist> |
2882 | <!--!Edrivers/char/drm/drm_irq.c--> | ||
2883 | </para> | 3777 | </para> |
2884 | </sect1> | 3778 | </sect1> |
2885 | 3779 | ||
@@ -2942,6 +3836,96 @@ int num_ioctls;</synopsis> | |||
2942 | probing, so those sections fully apply. | 3836 | probing, so those sections fully apply. |
2943 | </para> | 3837 | </para> |
2944 | </sect2> | 3838 | </sect2> |
3839 | <sect2> | ||
3840 | <title>DPIO</title> | ||
3841 | !Pdrivers/gpu/drm/i915/i915_reg.h DPIO | ||
3842 | <table id="dpiox2"> | ||
3843 | <title>Dual channel PHY (VLV/CHV)</title> | ||
3844 | <tgroup cols="8"> | ||
3845 | <colspec colname="c0" /> | ||
3846 | <colspec colname="c1" /> | ||
3847 | <colspec colname="c2" /> | ||
3848 | <colspec colname="c3" /> | ||
3849 | <colspec colname="c4" /> | ||
3850 | <colspec colname="c5" /> | ||
3851 | <colspec colname="c6" /> | ||
3852 | <colspec colname="c7" /> | ||
3853 | <spanspec spanname="ch0" namest="c0" nameend="c3" /> | ||
3854 | <spanspec spanname="ch1" namest="c4" nameend="c7" /> | ||
3855 | <spanspec spanname="ch0pcs01" namest="c0" nameend="c1" /> | ||
3856 | <spanspec spanname="ch0pcs23" namest="c2" nameend="c3" /> | ||
3857 | <spanspec spanname="ch1pcs01" namest="c4" nameend="c5" /> | ||
3858 | <spanspec spanname="ch1pcs23" namest="c6" nameend="c7" /> | ||
3859 | <thead> | ||
3860 | <row> | ||
3861 | <entry spanname="ch0">CH0</entry> | ||
3862 | <entry spanname="ch1">CH1</entry> | ||
3863 | </row> | ||
3864 | </thead> | ||
3865 | <tbody valign="top" align="center"> | ||
3866 | <row> | ||
3867 | <entry spanname="ch0">CMN/PLL/REF</entry> | ||
3868 | <entry spanname="ch1">CMN/PLL/REF</entry> | ||
3869 | </row> | ||
3870 | <row> | ||
3871 | <entry spanname="ch0pcs01">PCS01</entry> | ||
3872 | <entry spanname="ch0pcs23">PCS23</entry> | ||
3873 | <entry spanname="ch1pcs01">PCS01</entry> | ||
3874 | <entry spanname="ch1pcs23">PCS23</entry> | ||
3875 | </row> | ||
3876 | <row> | ||
3877 | <entry>TX0</entry> | ||
3878 | <entry>TX1</entry> | ||
3879 | <entry>TX2</entry> | ||
3880 | <entry>TX3</entry> | ||
3881 | <entry>TX0</entry> | ||
3882 | <entry>TX1</entry> | ||
3883 | <entry>TX2</entry> | ||
3884 | <entry>TX3</entry> | ||
3885 | </row> | ||
3886 | <row> | ||
3887 | <entry spanname="ch0">DDI0</entry> | ||
3888 | <entry spanname="ch1">DDI1</entry> | ||
3889 | </row> | ||
3890 | </tbody> | ||
3891 | </tgroup> | ||
3892 | </table> | ||
3893 | <table id="dpiox1"> | ||
3894 | <title>Single channel PHY (CHV)</title> | ||
3895 | <tgroup cols="4"> | ||
3896 | <colspec colname="c0" /> | ||
3897 | <colspec colname="c1" /> | ||
3898 | <colspec colname="c2" /> | ||
3899 | <colspec colname="c3" /> | ||
3900 | <spanspec spanname="ch0" namest="c0" nameend="c3" /> | ||
3901 | <spanspec spanname="ch0pcs01" namest="c0" nameend="c1" /> | ||
3902 | <spanspec spanname="ch0pcs23" namest="c2" nameend="c3" /> | ||
3903 | <thead> | ||
3904 | <row> | ||
3905 | <entry spanname="ch0">CH0</entry> | ||
3906 | </row> | ||
3907 | </thead> | ||
3908 | <tbody valign="top" align="center"> | ||
3909 | <row> | ||
3910 | <entry spanname="ch0">CMN/PLL/REF</entry> | ||
3911 | </row> | ||
3912 | <row> | ||
3913 | <entry spanname="ch0pcs01">PCS01</entry> | ||
3914 | <entry spanname="ch0pcs23">PCS23</entry> | ||
3915 | </row> | ||
3916 | <row> | ||
3917 | <entry>TX0</entry> | ||
3918 | <entry>TX1</entry> | ||
3919 | <entry>TX2</entry> | ||
3920 | <entry>TX3</entry> | ||
3921 | </row> | ||
3922 | <row> | ||
3923 | <entry spanname="ch0">DDI2</entry> | ||
3924 | </row> | ||
3925 | </tbody> | ||
3926 | </tgroup> | ||
3927 | </table> | ||
3928 | </sect2> | ||
2945 | </sect1> | 3929 | </sect1> |
2946 | 3930 | ||
2947 | <sect1> | 3931 | <sect1> |
@@ -2950,6 +3934,11 @@ int num_ioctls;</synopsis> | |||
2950 | This sections covers all things related to the GEM implementation in the | 3934 | This sections covers all things related to the GEM implementation in the |
2951 | i915 driver. | 3935 | i915 driver. |
2952 | </para> | 3936 | </para> |
3937 | <sect2> | ||
3938 | <title>Batchbuffer Parsing</title> | ||
3939 | !Pdrivers/gpu/drm/i915/i915_cmd_parser.c batch buffer command parser | ||
3940 | !Idrivers/gpu/drm/i915/i915_cmd_parser.c | ||
3941 | </sect2> | ||
2953 | </sect1> | 3942 | </sect1> |
2954 | </chapter> | 3943 | </chapter> |
2955 | </part> | 3944 | </part> |
diff --git a/Documentation/EDID/1024x768.S b/Documentation/EDID/1024x768.S index 4b486fe31b32..6f3e4b75e49e 100644 --- a/Documentation/EDID/1024x768.S +++ b/Documentation/EDID/1024x768.S | |||
@@ -36,7 +36,7 @@ | |||
36 | #define DPI 72 | 36 | #define DPI 72 |
37 | #define VFREQ 60 /* Hz */ | 37 | #define VFREQ 60 /* Hz */ |
38 | #define TIMING_NAME "Linux XGA" | 38 | #define TIMING_NAME "Linux XGA" |
39 | #define ESTABLISHED_TIMINGS_BITS 0x08 /* Bit 3 -> 1024x768 @60 Hz */ | 39 | #define ESTABLISHED_TIMING2_BITS 0x08 /* Bit 3 -> 1024x768 @60 Hz */ |
40 | #define HSYNC_POL 0 | 40 | #define HSYNC_POL 0 |
41 | #define VSYNC_POL 0 | 41 | #define VSYNC_POL 0 |
42 | #define CRC 0x55 | 42 | #define CRC 0x55 |
diff --git a/Documentation/EDID/1280x1024.S b/Documentation/EDID/1280x1024.S index a2799fe33a4d..bd9bef2a65af 100644 --- a/Documentation/EDID/1280x1024.S +++ b/Documentation/EDID/1280x1024.S | |||
@@ -36,7 +36,7 @@ | |||
36 | #define DPI 72 | 36 | #define DPI 72 |
37 | #define VFREQ 60 /* Hz */ | 37 | #define VFREQ 60 /* Hz */ |
38 | #define TIMING_NAME "Linux SXGA" | 38 | #define TIMING_NAME "Linux SXGA" |
39 | #define ESTABLISHED_TIMINGS_BITS 0x00 /* none */ | 39 | /* No ESTABLISHED_TIMINGx_BITS */ |
40 | #define HSYNC_POL 1 | 40 | #define HSYNC_POL 1 |
41 | #define VSYNC_POL 1 | 41 | #define VSYNC_POL 1 |
42 | #define CRC 0xa0 | 42 | #define CRC 0xa0 |
diff --git a/Documentation/EDID/1600x1200.S b/Documentation/EDID/1600x1200.S index 0ded64cfd1f5..a45101c6160c 100644 --- a/Documentation/EDID/1600x1200.S +++ b/Documentation/EDID/1600x1200.S | |||
@@ -36,7 +36,7 @@ | |||
36 | #define DPI 72 | 36 | #define DPI 72 |
37 | #define VFREQ 60 /* Hz */ | 37 | #define VFREQ 60 /* Hz */ |
38 | #define TIMING_NAME "Linux UXGA" | 38 | #define TIMING_NAME "Linux UXGA" |
39 | #define ESTABLISHED_TIMINGS_BITS 0x00 /* none */ | 39 | /* No ESTABLISHED_TIMINGx_BITS */ |
40 | #define HSYNC_POL 1 | 40 | #define HSYNC_POL 1 |
41 | #define VSYNC_POL 1 | 41 | #define VSYNC_POL 1 |
42 | #define CRC 0x9d | 42 | #define CRC 0x9d |
diff --git a/Documentation/EDID/1680x1050.S b/Documentation/EDID/1680x1050.S index 96f67cafcf2e..b0d7c69282b4 100644 --- a/Documentation/EDID/1680x1050.S +++ b/Documentation/EDID/1680x1050.S | |||
@@ -36,7 +36,7 @@ | |||
36 | #define DPI 96 | 36 | #define DPI 96 |
37 | #define VFREQ 60 /* Hz */ | 37 | #define VFREQ 60 /* Hz */ |
38 | #define TIMING_NAME "Linux WSXGA" | 38 | #define TIMING_NAME "Linux WSXGA" |
39 | #define ESTABLISHED_TIMINGS_BITS 0x00 /* none */ | 39 | /* No ESTABLISHED_TIMINGx_BITS */ |
40 | #define HSYNC_POL 1 | 40 | #define HSYNC_POL 1 |
41 | #define VSYNC_POL 1 | 41 | #define VSYNC_POL 1 |
42 | #define CRC 0x26 | 42 | #define CRC 0x26 |
diff --git a/Documentation/EDID/1920x1080.S b/Documentation/EDID/1920x1080.S index 36ed5d571d0a..3084355e81e7 100644 --- a/Documentation/EDID/1920x1080.S +++ b/Documentation/EDID/1920x1080.S | |||
@@ -36,7 +36,7 @@ | |||
36 | #define DPI 96 | 36 | #define DPI 96 |
37 | #define VFREQ 60 /* Hz */ | 37 | #define VFREQ 60 /* Hz */ |
38 | #define TIMING_NAME "Linux FHD" | 38 | #define TIMING_NAME "Linux FHD" |
39 | #define ESTABLISHED_TIMINGS_BITS 0x00 /* none */ | 39 | /* No ESTABLISHED_TIMINGx_BITS */ |
40 | #define HSYNC_POL 1 | 40 | #define HSYNC_POL 1 |
41 | #define VSYNC_POL 1 | 41 | #define VSYNC_POL 1 |
42 | #define CRC 0x05 | 42 | #define CRC 0x05 |
diff --git a/Documentation/EDID/800x600.S b/Documentation/EDID/800x600.S new file mode 100644 index 000000000000..6644e26d5801 --- /dev/null +++ b/Documentation/EDID/800x600.S | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | 800x600.S: EDID data set for standard 800x600 60 Hz monitor | ||
3 | |||
4 | Copyright (C) 2011 Carsten Emde <C.Emde@osadl.org> | ||
5 | Copyright (C) 2014 Linaro Limited | ||
6 | |||
7 | This program is free software; you can redistribute it and/or | ||
8 | modify it under the terms of the GNU General Public License | ||
9 | as published by the Free Software Foundation; either version 2 | ||
10 | of the License, or (at your option) any later version. | ||
11 | |||
12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | ||
16 | */ | ||
17 | |||
18 | /* EDID */ | ||
19 | #define VERSION 1 | ||
20 | #define REVISION 3 | ||
21 | |||
22 | /* Display */ | ||
23 | #define CLOCK 40000 /* kHz */ | ||
24 | #define XPIX 800 | ||
25 | #define YPIX 600 | ||
26 | #define XY_RATIO XY_RATIO_4_3 | ||
27 | #define XBLANK 256 | ||
28 | #define YBLANK 28 | ||
29 | #define XOFFSET 40 | ||
30 | #define XPULSE 128 | ||
31 | #define YOFFSET (63+1) | ||
32 | #define YPULSE (63+4) | ||
33 | #define DPI 72 | ||
34 | #define VFREQ 60 /* Hz */ | ||
35 | #define TIMING_NAME "Linux SVGA" | ||
36 | #define ESTABLISHED_TIMING1_BITS 0x01 /* Bit 0: 800x600 @ 60Hz */ | ||
37 | #define HSYNC_POL 1 | ||
38 | #define VSYNC_POL 1 | ||
39 | #define CRC 0xc2 | ||
40 | |||
41 | #include "edid.S" | ||
diff --git a/Documentation/EDID/HOWTO.txt b/Documentation/EDID/HOWTO.txt index 7146db1d9e8c..835db332289b 100644 --- a/Documentation/EDID/HOWTO.txt +++ b/Documentation/EDID/HOWTO.txt | |||
@@ -18,7 +18,7 @@ CONFIG_DRM_LOAD_EDID_FIRMWARE was introduced. It allows to provide an | |||
18 | individually prepared or corrected EDID data set in the /lib/firmware | 18 | individually prepared or corrected EDID data set in the /lib/firmware |
19 | directory from where it is loaded via the firmware interface. The code | 19 | directory from where it is loaded via the firmware interface. The code |
20 | (see drivers/gpu/drm/drm_edid_load.c) contains built-in data sets for | 20 | (see drivers/gpu/drm/drm_edid_load.c) contains built-in data sets for |
21 | commonly used screen resolutions (1024x768, 1280x1024, 1600x1200, | 21 | commonly used screen resolutions (800x600, 1024x768, 1280x1024, 1600x1200, |
22 | 1680x1050, 1920x1080) as binary blobs, but the kernel source tree does | 22 | 1680x1050, 1920x1080) as binary blobs, but the kernel source tree does |
23 | not contain code to create these data. In order to elucidate the origin | 23 | not contain code to create these data. In order to elucidate the origin |
24 | of the built-in binary EDID blobs and to facilitate the creation of | 24 | of the built-in binary EDID blobs and to facilitate the creation of |
diff --git a/Documentation/EDID/edid.S b/Documentation/EDID/edid.S index ea97ae275fca..7ac03276d7a2 100644 --- a/Documentation/EDID/edid.S +++ b/Documentation/EDID/edid.S | |||
@@ -33,6 +33,17 @@ | |||
33 | #define XY_RATIO_5_4 0b10 | 33 | #define XY_RATIO_5_4 0b10 |
34 | #define XY_RATIO_16_9 0b11 | 34 | #define XY_RATIO_16_9 0b11 |
35 | 35 | ||
36 | /* Provide defaults for the timing bits */ | ||
37 | #ifndef ESTABLISHED_TIMING1_BITS | ||
38 | #define ESTABLISHED_TIMING1_BITS 0x00 | ||
39 | #endif | ||
40 | #ifndef ESTABLISHED_TIMING2_BITS | ||
41 | #define ESTABLISHED_TIMING2_BITS 0x00 | ||
42 | #endif | ||
43 | #ifndef ESTABLISHED_TIMING3_BITS | ||
44 | #define ESTABLISHED_TIMING3_BITS 0x00 | ||
45 | #endif | ||
46 | |||
36 | #define mfgname2id(v1,v2,v3) \ | 47 | #define mfgname2id(v1,v2,v3) \ |
37 | ((((v1-'@')&0x1f)<<10)+(((v2-'@')&0x1f)<<5)+((v3-'@')&0x1f)) | 48 | ((((v1-'@')&0x1f)<<10)+(((v2-'@')&0x1f)<<5)+((v3-'@')&0x1f)) |
38 | #define swap16(v1) ((v1>>8)+((v1&0xff)<<8)) | 49 | #define swap16(v1) ((v1>>8)+((v1&0xff)<<8)) |
@@ -139,7 +150,7 @@ white_x_y_msb: .byte 0x50,0x54 | |||
139 | Bit 2 640x480 @ 75 Hz | 150 | Bit 2 640x480 @ 75 Hz |
140 | Bit 1 800x600 @ 56 Hz | 151 | Bit 1 800x600 @ 56 Hz |
141 | Bit 0 800x600 @ 60 Hz */ | 152 | Bit 0 800x600 @ 60 Hz */ |
142 | estbl_timing1: .byte 0x00 | 153 | estbl_timing1: .byte ESTABLISHED_TIMING1_BITS |
143 | 154 | ||
144 | /* Bit 7 800x600 @ 72 Hz | 155 | /* Bit 7 800x600 @ 72 Hz |
145 | Bit 6 800x600 @ 75 Hz | 156 | Bit 6 800x600 @ 75 Hz |
@@ -149,11 +160,11 @@ estbl_timing1: .byte 0x00 | |||
149 | Bit 2 1024x768 @ 72 Hz | 160 | Bit 2 1024x768 @ 72 Hz |
150 | Bit 1 1024x768 @ 75 Hz | 161 | Bit 1 1024x768 @ 75 Hz |
151 | Bit 0 1280x1024 @ 75 Hz */ | 162 | Bit 0 1280x1024 @ 75 Hz */ |
152 | estbl_timing2: .byte ESTABLISHED_TIMINGS_BITS | 163 | estbl_timing2: .byte ESTABLISHED_TIMING2_BITS |
153 | 164 | ||
154 | /* Bit 7 1152x870 @ 75 Hz (Apple Macintosh II) | 165 | /* Bit 7 1152x870 @ 75 Hz (Apple Macintosh II) |
155 | Bits 6-0 Other manufacturer-specific display mod */ | 166 | Bits 6-0 Other manufacturer-specific display mod */ |
156 | estbl_timing3: .byte 0x00 | 167 | estbl_timing3: .byte ESTABLISHED_TIMING3_BITS |
157 | 168 | ||
158 | /* Standard timing */ | 169 | /* Standard timing */ |
159 | /* X resolution, less 31, divided by 8 (256-2288 pixels) */ | 170 | /* X resolution, less 31, divided by 8 (256-2288 pixels) */ |
diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt index b045fe54986a..14f4e6336d88 100644 --- a/Documentation/cpu-freq/cpu-drivers.txt +++ b/Documentation/cpu-freq/cpu-drivers.txt | |||
@@ -26,6 +26,7 @@ Contents: | |||
26 | 1.4 target/target_index or setpolicy? | 26 | 1.4 target/target_index or setpolicy? |
27 | 1.5 target/target_index | 27 | 1.5 target/target_index |
28 | 1.6 setpolicy | 28 | 1.6 setpolicy |
29 | 1.7 get_intermediate and target_intermediate | ||
29 | 2. Frequency Table Helpers | 30 | 2. Frequency Table Helpers |
30 | 31 | ||
31 | 32 | ||
@@ -79,6 +80,10 @@ cpufreq_driver.attr - A pointer to a NULL-terminated list of | |||
79 | "struct freq_attr" which allow to | 80 | "struct freq_attr" which allow to |
80 | export values to sysfs. | 81 | export values to sysfs. |
81 | 82 | ||
83 | cpufreq_driver.get_intermediate | ||
84 | and target_intermediate Used to switch to stable frequency while | ||
85 | changing CPU frequency. | ||
86 | |||
82 | 87 | ||
83 | 1.2 Per-CPU Initialization | 88 | 1.2 Per-CPU Initialization |
84 | -------------------------- | 89 | -------------------------- |
@@ -151,7 +156,7 @@ Some cpufreq-capable processors switch the frequency between certain | |||
151 | limits on their own. These shall use the ->setpolicy call | 156 | limits on their own. These shall use the ->setpolicy call |
152 | 157 | ||
153 | 158 | ||
154 | 1.4. target/target_index | 159 | 1.5. target/target_index |
155 | ------------- | 160 | ------------- |
156 | 161 | ||
157 | The target_index call has two arguments: struct cpufreq_policy *policy, | 162 | The target_index call has two arguments: struct cpufreq_policy *policy, |
@@ -160,6 +165,9 @@ and unsigned int index (into the exposed frequency table). | |||
160 | The CPUfreq driver must set the new frequency when called here. The | 165 | The CPUfreq driver must set the new frequency when called here. The |
161 | actual frequency must be determined by freq_table[index].frequency. | 166 | actual frequency must be determined by freq_table[index].frequency. |
162 | 167 | ||
168 | It should always restore to earlier frequency (i.e. policy->restore_freq) in | ||
169 | case of errors, even if we switched to intermediate frequency earlier. | ||
170 | |||
163 | Deprecated: | 171 | Deprecated: |
164 | ---------- | 172 | ---------- |
165 | The target call has three arguments: struct cpufreq_policy *policy, | 173 | The target call has three arguments: struct cpufreq_policy *policy, |
@@ -179,7 +187,7 @@ Here again the frequency table helper might assist you - see section 2 | |||
179 | for details. | 187 | for details. |
180 | 188 | ||
181 | 189 | ||
182 | 1.5 setpolicy | 190 | 1.6 setpolicy |
183 | --------------- | 191 | --------------- |
184 | 192 | ||
185 | The setpolicy call only takes a struct cpufreq_policy *policy as | 193 | The setpolicy call only takes a struct cpufreq_policy *policy as |
@@ -190,6 +198,23 @@ setting when policy->policy is CPUFREQ_POLICY_PERFORMANCE, and a | |||
190 | powersaving-oriented setting when CPUFREQ_POLICY_POWERSAVE. Also check | 198 | powersaving-oriented setting when CPUFREQ_POLICY_POWERSAVE. Also check |
191 | the reference implementation in drivers/cpufreq/longrun.c | 199 | the reference implementation in drivers/cpufreq/longrun.c |
192 | 200 | ||
201 | 1.7 get_intermediate and target_intermediate | ||
202 | -------------------------------------------- | ||
203 | |||
204 | Only for drivers with target_index() and CPUFREQ_ASYNC_NOTIFICATION unset. | ||
205 | |||
206 | get_intermediate should return a stable intermediate frequency platform wants to | ||
207 | switch to, and target_intermediate() should set CPU to to that frequency, before | ||
208 | jumping to the frequency corresponding to 'index'. Core will take care of | ||
209 | sending notifications and driver doesn't have to handle them in | ||
210 | target_intermediate() or target_index(). | ||
211 | |||
212 | Drivers can return '0' from get_intermediate() in case they don't wish to switch | ||
213 | to intermediate frequency for some target frequency. In that case core will | ||
214 | directly call ->target_index(). | ||
215 | |||
216 | NOTE: ->target_index() should restore to policy->restore_freq in case of | ||
217 | failures as core would send notifications for that. | ||
193 | 218 | ||
194 | 219 | ||
195 | 2. Frequency Table Helpers | 220 | 2. Frequency Table Helpers |
diff --git a/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt b/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt index efa8b8451f93..b48f4ef31d93 100644 --- a/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt +++ b/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt | |||
@@ -136,6 +136,7 @@ of the following host1x client modules: | |||
136 | - compatible: "nvidia,tegra<chip>-hdmi" | 136 | - compatible: "nvidia,tegra<chip>-hdmi" |
137 | - reg: Physical base address and length of the controller's registers. | 137 | - reg: Physical base address and length of the controller's registers. |
138 | - interrupts: The interrupt outputs from the controller. | 138 | - interrupts: The interrupt outputs from the controller. |
139 | - hdmi-supply: supply for the +5V HDMI connector pin | ||
139 | - vdd-supply: regulator for supply voltage | 140 | - vdd-supply: regulator for supply voltage |
140 | - pll-supply: regulator for PLL | 141 | - pll-supply: regulator for PLL |
141 | - clocks: Must contain an entry for each entry in clock-names. | 142 | - clocks: Must contain an entry for each entry in clock-names. |
@@ -180,6 +181,7 @@ of the following host1x client modules: | |||
180 | See ../reset/reset.txt for details. | 181 | See ../reset/reset.txt for details. |
181 | - reset-names: Must include the following entries: | 182 | - reset-names: Must include the following entries: |
182 | - dsi | 183 | - dsi |
184 | - avdd-dsi-supply: phandle of a supply that powers the DSI controller | ||
183 | - nvidia,mipi-calibrate: Should contain a phandle and a specifier specifying | 185 | - nvidia,mipi-calibrate: Should contain a phandle and a specifier specifying |
184 | which pads are used by this DSI output and need to be calibrated. See also | 186 | which pads are used by this DSI output and need to be calibrated. See also |
185 | ../mipi/nvidia,tegra114-mipi.txt. | 187 | ../mipi/nvidia,tegra114-mipi.txt. |
diff --git a/Documentation/devicetree/bindings/leds/leds-lp55xx.txt b/Documentation/devicetree/bindings/leds/leds-lp55xx.txt index c55b8c016a9e..1b66a413fb9d 100644 --- a/Documentation/devicetree/bindings/leds/leds-lp55xx.txt +++ b/Documentation/devicetree/bindings/leds/leds-lp55xx.txt | |||
@@ -1,7 +1,13 @@ | |||
1 | Binding for TI/National Semiconductor LP55xx Led Drivers | 1 | Binding for TI/National Semiconductor LP55xx Led Drivers |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible: "national,lp5521" or "national,lp5523" or "ti,lp5562" or "ti,lp8501" | 4 | - compatible: one of |
5 | national,lp5521 | ||
6 | national,lp5523 | ||
7 | ti,lp55231 | ||
8 | ti,lp5562 | ||
9 | ti,lp8501 | ||
10 | |||
5 | - reg: I2C slave address | 11 | - reg: I2C slave address |
6 | - clock-mode: Input clock mode, (0: automode, 1: internal, 2: external) | 12 | - clock-mode: Input clock mode, (0: automode, 1: internal, 2: external) |
7 | 13 | ||
diff --git a/Documentation/devicetree/bindings/leds/leds-pwm.txt b/Documentation/devicetree/bindings/leds/leds-pwm.txt index 7297107cf832..6c6583c35f2f 100644 --- a/Documentation/devicetree/bindings/leds/leds-pwm.txt +++ b/Documentation/devicetree/bindings/leds/leds-pwm.txt | |||
@@ -13,6 +13,8 @@ LED sub-node properties: | |||
13 | For the pwms and pwm-names property please refer to: | 13 | For the pwms and pwm-names property please refer to: |
14 | Documentation/devicetree/bindings/pwm/pwm.txt | 14 | Documentation/devicetree/bindings/pwm/pwm.txt |
15 | - max-brightness : Maximum brightness possible for the LED | 15 | - max-brightness : Maximum brightness possible for the LED |
16 | - active-low : (optional) For PWMs where the LED is wired to supply | ||
17 | rather than ground. | ||
16 | - label : (optional) | 18 | - label : (optional) |
17 | see Documentation/devicetree/bindings/leds/common.txt | 19 | see Documentation/devicetree/bindings/leds/common.txt |
18 | - linux,default-trigger : (optional) | 20 | - linux,default-trigger : (optional) |
diff --git a/Documentation/devicetree/bindings/mfd/twl4030-power.txt b/Documentation/devicetree/bindings/mfd/twl4030-power.txt index 8e15ec35ac99..b9ee7b98d3e2 100644 --- a/Documentation/devicetree/bindings/mfd/twl4030-power.txt +++ b/Documentation/devicetree/bindings/mfd/twl4030-power.txt | |||
@@ -5,7 +5,22 @@ to control the power resources, including power scripts. For now, the | |||
5 | binding only supports the complete shutdown of the system after poweroff. | 5 | binding only supports the complete shutdown of the system after poweroff. |
6 | 6 | ||
7 | Required properties: | 7 | Required properties: |
8 | - compatible : must be "ti,twl4030-power" | 8 | - compatible : must be one of the following |
9 | "ti,twl4030-power" | ||
10 | "ti,twl4030-power-reset" | ||
11 | "ti,twl4030-power-idle" | ||
12 | "ti,twl4030-power-idle-osc-off" | ||
13 | |||
14 | The use of ti,twl4030-power-reset is recommended at least on | ||
15 | 3530 that needs a special configuration for warm reset to work. | ||
16 | |||
17 | When using ti,twl4030-power-idle, the TI recommended configuration | ||
18 | for idle modes is loaded to the tlw4030 PMIC. | ||
19 | |||
20 | When using ti,twl4030-power-idle-osc-off, the TI recommended | ||
21 | configuration is used with the external oscillator being shut | ||
22 | down during off-idle. Note that this does not work on all boards | ||
23 | depending on how the external oscillator is wired. | ||
9 | 24 | ||
10 | Optional properties: | 25 | Optional properties: |
11 | - ti,use_poweroff: With this flag, the chip will initiates an ACTIVE-to-OFF or | 26 | - ti,use_poweroff: With this flag, the chip will initiates an ACTIVE-to-OFF or |
diff --git a/Documentation/devicetree/bindings/net/amd-xgbe-phy.txt b/Documentation/devicetree/bindings/net/amd-xgbe-phy.txt new file mode 100644 index 000000000000..d01ed63d3ebb --- /dev/null +++ b/Documentation/devicetree/bindings/net/amd-xgbe-phy.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | * AMD 10GbE PHY driver (amd-xgbe-phy) | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Should be "amd,xgbe-phy-seattle-v1a" and | ||
5 | "ethernet-phy-ieee802.3-c45" | ||
6 | - reg: Address and length of the register sets for the device | ||
7 | - SerDes Rx/Tx registers | ||
8 | - SerDes integration registers (1/2) | ||
9 | - SerDes integration registers (2/2) | ||
10 | |||
11 | Example: | ||
12 | xgbe_phy@e1240800 { | ||
13 | compatible = "amd,xgbe-phy-seattle-v1a", "ethernet-phy-ieee802.3-c45"; | ||
14 | reg = <0 0xe1240800 0 0x00400>, | ||
15 | <0 0xe1250000 0 0x00060>, | ||
16 | <0 0xe1250080 0 0x00004>; | ||
17 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/amd-xgbe.txt b/Documentation/devicetree/bindings/net/amd-xgbe.txt new file mode 100644 index 000000000000..ea0c7908a3b8 --- /dev/null +++ b/Documentation/devicetree/bindings/net/amd-xgbe.txt | |||
@@ -0,0 +1,34 @@ | |||
1 | * AMD 10GbE driver (amd-xgbe) | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Should be "amd,xgbe-seattle-v1a" | ||
5 | - reg: Address and length of the register sets for the device | ||
6 | - MAC registers | ||
7 | - PCS registers | ||
8 | - interrupt-parent: Should be the phandle for the interrupt controller | ||
9 | that services interrupts for this device | ||
10 | - interrupts: Should contain the amd-xgbe interrupt | ||
11 | - clocks: Should be the DMA clock for the amd-xgbe device (used for | ||
12 | calculating the correct Rx interrupt watchdog timer value on a DMA | ||
13 | channel for coalescing) | ||
14 | - clock-names: Should be the name of the DMA clock, "dma_clk" | ||
15 | - phy-handle: See ethernet.txt file in the same directory | ||
16 | - phy-mode: See ethernet.txt file in the same directory | ||
17 | |||
18 | Optional properties: | ||
19 | - mac-address: mac address to be assigned to the device. Can be overridden | ||
20 | by UEFI. | ||
21 | |||
22 | Example: | ||
23 | xgbe@e0700000 { | ||
24 | compatible = "amd,xgbe-seattle-v1a"; | ||
25 | reg = <0 0xe0700000 0 0x80000>, | ||
26 | <0 0xe0780000 0 0x80000>; | ||
27 | interrupt-parent = <&gic>; | ||
28 | interrupts = <0 325 4>; | ||
29 | clocks = <&xgbe_clk>; | ||
30 | clock-names = "dma_clk"; | ||
31 | phy-handle = <&phy>; | ||
32 | phy-mode = "xgmii"; | ||
33 | mac-address = [ 02 a1 a2 a3 a4 a5 ]; | ||
34 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/broadcom-bcmgenet.txt b/Documentation/devicetree/bindings/net/broadcom-bcmgenet.txt index f2febb94550e..451fef26b4df 100644 --- a/Documentation/devicetree/bindings/net/broadcom-bcmgenet.txt +++ b/Documentation/devicetree/bindings/net/broadcom-bcmgenet.txt | |||
@@ -24,7 +24,7 @@ Optional properties: | |||
24 | - fixed-link: When the GENET interface is connected to a MoCA hardware block or | 24 | - fixed-link: When the GENET interface is connected to a MoCA hardware block or |
25 | when operating in a RGMII to RGMII type of connection, or when the MDIO bus is | 25 | when operating in a RGMII to RGMII type of connection, or when the MDIO bus is |
26 | voluntarily disabled, this property should be used to describe the "fixed link". | 26 | voluntarily disabled, this property should be used to describe the "fixed link". |
27 | See Documentation/devicetree/bindings/net/fsl-tsec-phy.txt for information on | 27 | See Documentation/devicetree/bindings/net/fixed-link.txt for information on |
28 | the property specifics | 28 | the property specifics |
29 | 29 | ||
30 | Required child nodes: | 30 | Required child nodes: |
diff --git a/Documentation/devicetree/bindings/net/broadcom-systemport.txt b/Documentation/devicetree/bindings/net/broadcom-systemport.txt new file mode 100644 index 000000000000..c183ea90d9bc --- /dev/null +++ b/Documentation/devicetree/bindings/net/broadcom-systemport.txt | |||
@@ -0,0 +1,29 @@ | |||
1 | * Broadcom BCM7xxx Ethernet Systemport Controller (SYSTEMPORT) | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be one of "brcm,systemport-v1.00" or "brcm,systemport" | ||
5 | - reg: address and length of the register set for the device. | ||
6 | - interrupts: interrupts for the device, first cell must be for the the rx | ||
7 | interrupts, and the second cell should be for the transmit queues | ||
8 | - local-mac-address: Ethernet MAC address (48 bits) of this adapter | ||
9 | - phy-mode: Should be a string describing the PHY interface to the | ||
10 | Ethernet switch/PHY, see Documentation/devicetree/bindings/net/ethernet.txt | ||
11 | - fixed-link: see Documentation/devicetree/bindings/net/fixed-link.txt for | ||
12 | the property specific details | ||
13 | |||
14 | Optional properties: | ||
15 | - systemport,num-tier2-arb: number of tier 2 arbiters, an integer | ||
16 | - systemport,num-tier1-arb: number of tier 1 arbiters, an integer | ||
17 | - systemport,num-txq: number of HW transmit queues, an integer | ||
18 | - systemport,num-rxq: number of HW receive queues, an integer | ||
19 | |||
20 | Example: | ||
21 | ethernet@f04a0000 { | ||
22 | compatible = "brcm,systemport-v1.00"; | ||
23 | reg = <0xf04a0000 0x4650>; | ||
24 | local-mac-address = [ 00 11 22 33 44 55 ]; | ||
25 | fixed-link = <0 1 1000 0 0>; | ||
26 | phy-mode = "gmii"; | ||
27 | interrupts = <0x0 0x16 0x0>, | ||
28 | <0x0 0x17 0x0>; | ||
29 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/can/xilinx_can.txt b/Documentation/devicetree/bindings/net/can/xilinx_can.txt new file mode 100644 index 000000000000..fe38847d8e26 --- /dev/null +++ b/Documentation/devicetree/bindings/net/can/xilinx_can.txt | |||
@@ -0,0 +1,44 @@ | |||
1 | Xilinx Axi CAN/Zynq CANPS controller Device Tree Bindings | ||
2 | --------------------------------------------------------- | ||
3 | |||
4 | Required properties: | ||
5 | - compatible : Should be "xlnx,zynq-can-1.0" for Zynq CAN | ||
6 | controllers and "xlnx,axi-can-1.00.a" for Axi CAN | ||
7 | controllers. | ||
8 | - reg : Physical base address and size of the Axi CAN/Zynq | ||
9 | CANPS registers map. | ||
10 | - interrupts : Property with a value describing the interrupt | ||
11 | number. | ||
12 | - interrupt-parent : Must be core interrupt controller | ||
13 | - clock-names : List of input clock names - "can_clk", "pclk" | ||
14 | (For CANPS), "can_clk" , "s_axi_aclk"(For AXI CAN) | ||
15 | (See clock bindings for details). | ||
16 | - clocks : Clock phandles (see clock bindings for details). | ||
17 | - tx-fifo-depth : Can Tx fifo depth. | ||
18 | - rx-fifo-depth : Can Rx fifo depth. | ||
19 | |||
20 | |||
21 | Example: | ||
22 | |||
23 | For Zynq CANPS Dts file: | ||
24 | zynq_can_0: can@e0008000 { | ||
25 | compatible = "xlnx,zynq-can-1.0"; | ||
26 | clocks = <&clkc 19>, <&clkc 36>; | ||
27 | clock-names = "can_clk", "pclk"; | ||
28 | reg = <0xe0008000 0x1000>; | ||
29 | interrupts = <0 28 4>; | ||
30 | interrupt-parent = <&intc>; | ||
31 | tx-fifo-depth = <0x40>; | ||
32 | rx-fifo-depth = <0x40>; | ||
33 | }; | ||
34 | For Axi CAN Dts file: | ||
35 | axi_can_0: axi-can@40000000 { | ||
36 | compatible = "xlnx,axi-can-1.00.a"; | ||
37 | clocks = <&clkc 0>, <&clkc 1>; | ||
38 | clock-names = "can_clk","s_axi_aclk" ; | ||
39 | reg = <0x40000000 0x10000>; | ||
40 | interrupt-parent = <&intc>; | ||
41 | interrupts = <0 59 1>; | ||
42 | tx-fifo-depth = <0x40>; | ||
43 | rx-fifo-depth = <0x40>; | ||
44 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/cpsw-phy-sel.txt b/Documentation/devicetree/bindings/net/cpsw-phy-sel.txt index 7ff57a119f81..764c0c79b43d 100644 --- a/Documentation/devicetree/bindings/net/cpsw-phy-sel.txt +++ b/Documentation/devicetree/bindings/net/cpsw-phy-sel.txt | |||
@@ -2,7 +2,9 @@ TI CPSW Phy mode Selection Device Tree Bindings | |||
2 | ----------------------------------------------- | 2 | ----------------------------------------------- |
3 | 3 | ||
4 | Required properties: | 4 | Required properties: |
5 | - compatible : Should be "ti,am3352-cpsw-phy-sel" | 5 | - compatible : Should be "ti,am3352-cpsw-phy-sel" for am335x platform and |
6 | "ti,dra7xx-cpsw-phy-sel" for dra7xx platform | ||
7 | "ti,am43xx-cpsw-phy-sel" for am43xx platform | ||
6 | - reg : physical base address and size of the cpsw | 8 | - reg : physical base address and size of the cpsw |
7 | registers map | 9 | registers map |
8 | - reg-names : names of the register map given in "reg" node | 10 | - reg-names : names of the register map given in "reg" node |
diff --git a/Documentation/devicetree/bindings/net/fixed-link.txt b/Documentation/devicetree/bindings/net/fixed-link.txt new file mode 100644 index 000000000000..82bf7e0f47b6 --- /dev/null +++ b/Documentation/devicetree/bindings/net/fixed-link.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | Fixed link Device Tree binding | ||
2 | ------------------------------ | ||
3 | |||
4 | Some Ethernet MACs have a "fixed link", and are not connected to a | ||
5 | normal MDIO-managed PHY device. For those situations, a Device Tree | ||
6 | binding allows to describe a "fixed link". | ||
7 | |||
8 | Such a fixed link situation is described by creating a 'fixed-link' | ||
9 | sub-node of the Ethernet MAC device node, with the following | ||
10 | properties: | ||
11 | |||
12 | * 'speed' (integer, mandatory), to indicate the link speed. Accepted | ||
13 | values are 10, 100 and 1000 | ||
14 | * 'full-duplex' (boolean, optional), to indicate that full duplex is | ||
15 | used. When absent, half duplex is assumed. | ||
16 | * 'pause' (boolean, optional), to indicate that pause should be | ||
17 | enabled. | ||
18 | * 'asym-pause' (boolean, optional), to indicate that asym_pause should | ||
19 | be enabled. | ||
20 | |||
21 | Old, deprecated 'fixed-link' binding: | ||
22 | |||
23 | * A 'fixed-link' property in the Ethernet MAC node, with 5 cells, of the | ||
24 | form <a b c d e> with the following accepted values: | ||
25 | - a: emulated PHY ID, choose any but but unique to the all specified | ||
26 | fixed-links, from 0 to 31 | ||
27 | - b: duplex configuration: 0 for half duplex, 1 for full duplex | ||
28 | - c: link speed in Mbits/sec, accepted values are: 10, 100 and 1000 | ||
29 | - d: pause configuration: 0 for no pause, 1 for pause | ||
30 | - e: asymmetric pause configuration: 0 for no asymmetric pause, 1 for | ||
31 | asymmetric pause | ||
32 | |||
33 | Example: | ||
34 | |||
35 | ethernet@0 { | ||
36 | ... | ||
37 | fixed-link { | ||
38 | speed = <1000>; | ||
39 | full-duplex; | ||
40 | }; | ||
41 | ... | ||
42 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt index 737cdef4f903..be6ea8960f20 100644 --- a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt +++ b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt | |||
@@ -42,10 +42,7 @@ Properties: | |||
42 | interrupt. For TSEC and eTSEC devices, the first interrupt is | 42 | interrupt. For TSEC and eTSEC devices, the first interrupt is |
43 | transmit, the second is receive, and the third is error. | 43 | transmit, the second is receive, and the third is error. |
44 | - phy-handle : See ethernet.txt file in the same directory. | 44 | - phy-handle : See ethernet.txt file in the same directory. |
45 | - fixed-link : <a b c d e> where a is emulated phy id - choose any, | 45 | - fixed-link : See fixed-link.txt in the same directory. |
46 | but unique to the all specified fixed-links, b is duplex - 0 half, | ||
47 | 1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no | ||
48 | pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause. | ||
49 | - phy-connection-type : See ethernet.txt file in the same directory. | 46 | - phy-connection-type : See ethernet.txt file in the same directory. |
50 | This property is only really needed if the connection is of type | 47 | This property is only really needed if the connection is of type |
51 | "rgmii-id", as all other connection types are detected by hardware. | 48 | "rgmii-id", as all other connection types are detected by hardware. |
diff --git a/Documentation/devicetree/bindings/net/hisilicon-hix5hd2-gmac.txt b/Documentation/devicetree/bindings/net/hisilicon-hix5hd2-gmac.txt new file mode 100644 index 000000000000..75d398bb1fbb --- /dev/null +++ b/Documentation/devicetree/bindings/net/hisilicon-hix5hd2-gmac.txt | |||
@@ -0,0 +1,36 @@ | |||
1 | Hisilicon hix5hd2 gmac controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be "hisilicon,hix5hd2-gmac". | ||
5 | - reg: specifies base physical address(s) and size of the device registers. | ||
6 | The first region is the MAC register base and size. | ||
7 | The second region is external interface control register. | ||
8 | - interrupts: should contain the MAC interrupt. | ||
9 | - #address-cells: must be <1>. | ||
10 | - #size-cells: must be <0>. | ||
11 | - phy-mode: see ethernet.txt [1]. | ||
12 | - phy-handle: see ethernet.txt [1]. | ||
13 | - mac-address: see ethernet.txt [1]. | ||
14 | - clocks: clock phandle and specifier pair. | ||
15 | |||
16 | - PHY subnode: inherits from phy binding [2] | ||
17 | |||
18 | [1] Documentation/devicetree/bindings/net/ethernet.txt | ||
19 | [2] Documentation/devicetree/bindings/net/phy.txt | ||
20 | |||
21 | Example: | ||
22 | gmac0: ethernet@f9840000 { | ||
23 | compatible = "hisilicon,hix5hd2-gmac"; | ||
24 | reg = <0xf9840000 0x1000>,<0xf984300c 0x4>; | ||
25 | interrupts = <0 71 4>; | ||
26 | #address-cells = <1>; | ||
27 | #size-cells = <0>; | ||
28 | phy-mode = "mii"; | ||
29 | phy-handle = <&phy2>; | ||
30 | mac-address = [00 00 00 00 00 00]; | ||
31 | clocks = <&clock HIX5HD2_MAC0_CLK>; | ||
32 | |||
33 | phy2: ethernet-phy@2 { | ||
34 | reg = <2>; | ||
35 | }; | ||
36 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/ieee802154/at86rf230.txt b/Documentation/devicetree/bindings/net/ieee802154/at86rf230.txt new file mode 100644 index 000000000000..d3bbdded4cbe --- /dev/null +++ b/Documentation/devicetree/bindings/net/ieee802154/at86rf230.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | * AT86RF230 IEEE 802.15.4 * | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be "atmel,at86rf230", "atmel,at86rf231", | ||
5 | "atmel,at86rf233" or "atmel,at86rf212" | ||
6 | - spi-max-frequency: maximal bus speed, should be set to 7500000 depends | ||
7 | sync or async operation mode | ||
8 | - reg: the chipselect index | ||
9 | - interrupts: the interrupt generated by the device | ||
10 | |||
11 | Optional properties: | ||
12 | - reset-gpio: GPIO spec for the rstn pin | ||
13 | - sleep-gpio: GPIO spec for the slp_tr pin | ||
14 | |||
15 | Example: | ||
16 | |||
17 | at86rf231@0 { | ||
18 | compatible = "atmel,at86rf231"; | ||
19 | spi-max-frequency = <7500000>; | ||
20 | reg = <0>; | ||
21 | interrupts = <19 1>; | ||
22 | interrupt-parent = <&gpio3>; | ||
23 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/micrel-ks8851.txt b/Documentation/devicetree/bindings/net/micrel-ks8851.txt index d54d0cc79487..bbdf9a7359a2 100644 --- a/Documentation/devicetree/bindings/net/micrel-ks8851.txt +++ b/Documentation/devicetree/bindings/net/micrel-ks8851.txt | |||
@@ -1,9 +1,18 @@ | |||
1 | Micrel KS8851 Ethernet mac | 1 | Micrel KS8851 Ethernet mac (MLL) |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible = "micrel,ks8851-ml" of parallel interface | 4 | - compatible = "micrel,ks8851-mll" of parallel interface |
5 | - reg : 2 physical address and size of registers for data and command | 5 | - reg : 2 physical address and size of registers for data and command |
6 | - interrupts : interrupt connection | 6 | - interrupts : interrupt connection |
7 | 7 | ||
8 | Micrel KS8851 Ethernet mac (SPI) | ||
9 | |||
10 | Required properties: | ||
11 | - compatible = "micrel,ks8851" or the deprecated "ks8851" | ||
12 | - reg : chip select number | ||
13 | - interrupts : interrupt connection | ||
14 | |||
8 | Optional properties: | 15 | Optional properties: |
9 | - vdd-supply: supply for Ethernet mac | 16 | - vdd-supply: analog 3.3V supply for Ethernet mac |
17 | - vdd-io-supply: digital 1.8V IO supply for Ethernet mac | ||
18 | - reset-gpios: reset_n input pin | ||
diff --git a/Documentation/devicetree/bindings/net/micrel-ksz9021.txt b/Documentation/devicetree/bindings/net/micrel-ksz9021.txt deleted file mode 100644 index 997a63f1aea1..000000000000 --- a/Documentation/devicetree/bindings/net/micrel-ksz9021.txt +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | Micrel KSZ9021 Gigabit Ethernet PHY | ||
2 | |||
3 | Some boards require special tuning values, particularly when it comes to | ||
4 | clock delays. You can specify clock delay values by adding | ||
5 | micrel-specific properties to an Ethernet OF device node. | ||
6 | |||
7 | All skew control options are specified in picoseconds. The minimum | ||
8 | value is 0, and the maximum value is 3000. | ||
9 | |||
10 | Optional properties: | ||
11 | - rxc-skew-ps : Skew control of RXC pad | ||
12 | - rxdv-skew-ps : Skew control of RX CTL pad | ||
13 | - txc-skew-ps : Skew control of TXC pad | ||
14 | - txen-skew-ps : Skew control of TX_CTL pad | ||
15 | - rxd0-skew-ps : Skew control of RX data 0 pad | ||
16 | - rxd1-skew-ps : Skew control of RX data 1 pad | ||
17 | - rxd2-skew-ps : Skew control of RX data 2 pad | ||
18 | - rxd3-skew-ps : Skew control of RX data 3 pad | ||
19 | - txd0-skew-ps : Skew control of TX data 0 pad | ||
20 | - txd1-skew-ps : Skew control of TX data 1 pad | ||
21 | - txd2-skew-ps : Skew control of TX data 2 pad | ||
22 | - txd3-skew-ps : Skew control of TX data 3 pad | ||
23 | |||
24 | Examples: | ||
25 | |||
26 | /* Attach to an Ethernet device with autodetected PHY */ | ||
27 | &enet { | ||
28 | rxc-skew-ps = <3000>; | ||
29 | rxdv-skew-ps = <0>; | ||
30 | txc-skew-ps = <3000>; | ||
31 | txen-skew-ps = <0>; | ||
32 | status = "okay"; | ||
33 | }; | ||
34 | |||
35 | /* Attach to an explicitly-specified PHY */ | ||
36 | mdio { | ||
37 | phy0: ethernet-phy@0 { | ||
38 | rxc-skew-ps = <3000>; | ||
39 | rxdv-skew-ps = <0>; | ||
40 | txc-skew-ps = <3000>; | ||
41 | txen-skew-ps = <0>; | ||
42 | reg = <0>; | ||
43 | }; | ||
44 | }; | ||
45 | ethernet@70000 { | ||
46 | status = "okay"; | ||
47 | phy = <&phy0>; | ||
48 | phy-mode = "rgmii-id"; | ||
49 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/micrel-ksz90x1.txt b/Documentation/devicetree/bindings/net/micrel-ksz90x1.txt new file mode 100644 index 000000000000..692076fda0e5 --- /dev/null +++ b/Documentation/devicetree/bindings/net/micrel-ksz90x1.txt | |||
@@ -0,0 +1,83 @@ | |||
1 | Micrel KSZ9021/KSZ9031 Gigabit Ethernet PHY | ||
2 | |||
3 | Some boards require special tuning values, particularly when it comes to | ||
4 | clock delays. You can specify clock delay values by adding | ||
5 | micrel-specific properties to an Ethernet OF device node. | ||
6 | |||
7 | Note that these settings are applied after any phy-specific fixup from | ||
8 | phy_fixup_list (see phy_init_hw() from drivers/net/phy/phy_device.c), | ||
9 | and therefore may overwrite them. | ||
10 | |||
11 | KSZ9021: | ||
12 | |||
13 | All skew control options are specified in picoseconds. The minimum | ||
14 | value is 0, the maximum value is 3000, and it is incremented by 200ps | ||
15 | steps. | ||
16 | |||
17 | Optional properties: | ||
18 | |||
19 | - rxc-skew-ps : Skew control of RXC pad | ||
20 | - rxdv-skew-ps : Skew control of RX CTL pad | ||
21 | - txc-skew-ps : Skew control of TXC pad | ||
22 | - txen-skew-ps : Skew control of TX CTL pad | ||
23 | - rxd0-skew-ps : Skew control of RX data 0 pad | ||
24 | - rxd1-skew-ps : Skew control of RX data 1 pad | ||
25 | - rxd2-skew-ps : Skew control of RX data 2 pad | ||
26 | - rxd3-skew-ps : Skew control of RX data 3 pad | ||
27 | - txd0-skew-ps : Skew control of TX data 0 pad | ||
28 | - txd1-skew-ps : Skew control of TX data 1 pad | ||
29 | - txd2-skew-ps : Skew control of TX data 2 pad | ||
30 | - txd3-skew-ps : Skew control of TX data 3 pad | ||
31 | |||
32 | KSZ9031: | ||
33 | |||
34 | All skew control options are specified in picoseconds. The minimum | ||
35 | value is 0, and the maximum is property-dependent. The increment | ||
36 | step is 60ps. | ||
37 | |||
38 | Optional properties: | ||
39 | |||
40 | Maximum value of 1860: | ||
41 | |||
42 | - rxc-skew-ps : Skew control of RX clock pad | ||
43 | - txc-skew-ps : Skew control of TX clock pad | ||
44 | |||
45 | Maximum value of 900: | ||
46 | |||
47 | - rxdv-skew-ps : Skew control of RX CTL pad | ||
48 | - txen-skew-ps : Skew control of TX CTL pad | ||
49 | - rxd0-skew-ps : Skew control of RX data 0 pad | ||
50 | - rxd1-skew-ps : Skew control of RX data 1 pad | ||
51 | - rxd2-skew-ps : Skew control of RX data 2 pad | ||
52 | - rxd3-skew-ps : Skew control of RX data 3 pad | ||
53 | - txd0-skew-ps : Skew control of TX data 0 pad | ||
54 | - txd1-skew-ps : Skew control of TX data 1 pad | ||
55 | - txd2-skew-ps : Skew control of TX data 2 pad | ||
56 | - txd3-skew-ps : Skew control of TX data 3 pad | ||
57 | |||
58 | Examples: | ||
59 | |||
60 | /* Attach to an Ethernet device with autodetected PHY */ | ||
61 | &enet { | ||
62 | rxc-skew-ps = <3000>; | ||
63 | rxdv-skew-ps = <0>; | ||
64 | txc-skew-ps = <3000>; | ||
65 | txen-skew-ps = <0>; | ||
66 | status = "okay"; | ||
67 | }; | ||
68 | |||
69 | /* Attach to an explicitly-specified PHY */ | ||
70 | mdio { | ||
71 | phy0: ethernet-phy@0 { | ||
72 | rxc-skew-ps = <3000>; | ||
73 | rxdv-skew-ps = <0>; | ||
74 | txc-skew-ps = <3000>; | ||
75 | txen-skew-ps = <0>; | ||
76 | reg = <0>; | ||
77 | }; | ||
78 | }; | ||
79 | ethernet@70000 { | ||
80 | status = "okay"; | ||
81 | phy = <&phy0>; | ||
82 | phy-mode = "rgmii-id"; | ||
83 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/nfc/pn544.txt b/Documentation/devicetree/bindings/net/nfc/pn544.txt new file mode 100644 index 000000000000..dab69f36167c --- /dev/null +++ b/Documentation/devicetree/bindings/net/nfc/pn544.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | * NXP Semiconductors PN544 NFC Controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Should be "nxp,pn544-i2c". | ||
5 | - clock-frequency: IC work frequency. | ||
6 | - reg: address on the bus | ||
7 | - interrupt-parent: phandle for the interrupt gpio controller | ||
8 | - interrupts: GPIO interrupt to which the chip is connected | ||
9 | - enable-gpios: Output GPIO pin used for enabling/disabling the PN544 | ||
10 | - firmware-gpios: Output GPIO pin used to enter firmware download mode | ||
11 | |||
12 | Optional SoC Specific Properties: | ||
13 | - pinctrl-names: Contains only one value - "default". | ||
14 | - pintctrl-0: Specifies the pin control groups used for this controller. | ||
15 | |||
16 | Example (for ARM-based BeagleBone with PN544 on I2C2): | ||
17 | |||
18 | &i2c2 { | ||
19 | |||
20 | status = "okay"; | ||
21 | |||
22 | pn544: pn544@28 { | ||
23 | |||
24 | compatible = "nxp,pn544-i2c"; | ||
25 | |||
26 | reg = <0x28>; | ||
27 | clock-frequency = <400000>; | ||
28 | |||
29 | interrupt-parent = <&gpio1>; | ||
30 | interrupts = <17 GPIO_ACTIVE_HIGH>; | ||
31 | |||
32 | enable-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>; | ||
33 | firmware-gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>; | ||
34 | }; | ||
35 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/nfc/st21nfca.txt b/Documentation/devicetree/bindings/net/nfc/st21nfca.txt new file mode 100644 index 000000000000..e4faa2e8dfeb --- /dev/null +++ b/Documentation/devicetree/bindings/net/nfc/st21nfca.txt | |||
@@ -0,0 +1,33 @@ | |||
1 | * STMicroelectronics SAS. ST21NFCA NFC Controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Should be "st,st21nfca_i2c". | ||
5 | - clock-frequency: I²C work frequency. | ||
6 | - reg: address on the bus | ||
7 | - interrupt-parent: phandle for the interrupt gpio controller | ||
8 | - interrupts: GPIO interrupt to which the chip is connected | ||
9 | - enable-gpios: Output GPIO pin used for enabling/disabling the ST21NFCA | ||
10 | |||
11 | Optional SoC Specific Properties: | ||
12 | - pinctrl-names: Contains only one value - "default". | ||
13 | - pintctrl-0: Specifies the pin control groups used for this controller. | ||
14 | |||
15 | Example (for ARM-based BeagleBoard xM with ST21NFCA on I2C2): | ||
16 | |||
17 | &i2c2 { | ||
18 | |||
19 | status = "okay"; | ||
20 | |||
21 | st21nfca: st21nfca@1 { | ||
22 | |||
23 | compatible = "st,st21nfca_i2c"; | ||
24 | |||
25 | reg = <0x01>; | ||
26 | clock-frequency = <400000>; | ||
27 | |||
28 | interrupt-parent = <&gpio5>; | ||
29 | interrupts = <2 IRQ_TYPE_LEVEL_LOW>; | ||
30 | |||
31 | enable-gpios = <&gpio5 29 GPIO_ACTIVE_HIGH>; | ||
32 | }; | ||
33 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt index 8dd3ef7bc56b..1e436133685f 100644 --- a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt +++ b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt | |||
@@ -12,6 +12,7 @@ Required properties: | |||
12 | Optional SoC Specific Properties: | 12 | Optional SoC Specific Properties: |
13 | - pinctrl-names: Contains only one value - "default". | 13 | - pinctrl-names: Contains only one value - "default". |
14 | - pintctrl-0: Specifies the pin control groups used for this controller. | 14 | - pintctrl-0: Specifies the pin control groups used for this controller. |
15 | - autosuspend-delay: Specify autosuspend delay in milliseconds. | ||
15 | 16 | ||
16 | Example (for ARM-based BeagleBone with TRF7970A on SPI1): | 17 | Example (for ARM-based BeagleBone with TRF7970A on SPI1): |
17 | 18 | ||
@@ -29,6 +30,7 @@ Example (for ARM-based BeagleBone with TRF7970A on SPI1): | |||
29 | ti,enable-gpios = <&gpio2 2 GPIO_ACTIVE_LOW>, | 30 | ti,enable-gpios = <&gpio2 2 GPIO_ACTIVE_LOW>, |
30 | <&gpio2 5 GPIO_ACTIVE_LOW>; | 31 | <&gpio2 5 GPIO_ACTIVE_LOW>; |
31 | vin-supply = <&ldo3_reg>; | 32 | vin-supply = <&ldo3_reg>; |
33 | autosuspend-delay = <30000>; | ||
32 | status = "okay"; | 34 | status = "okay"; |
33 | }; | 35 | }; |
34 | }; | 36 | }; |
diff --git a/Documentation/devicetree/bindings/net/via-rhine.txt b/Documentation/devicetree/bindings/net/via-rhine.txt new file mode 100644 index 000000000000..334eca2bf937 --- /dev/null +++ b/Documentation/devicetree/bindings/net/via-rhine.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | * VIA Rhine 10/100 Network Controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : Should be "via,vt8500-rhine" for integrated | ||
5 | Rhine controllers found in VIA VT8500, WonderMedia WM8950 | ||
6 | and similar. These are listed as 1106:3106 rev. 0x84 on the | ||
7 | virtual PCI bus under vendor-provided kernels | ||
8 | - reg : Address and length of the io space | ||
9 | - interrupts : Should contain the controller interrupt line | ||
10 | |||
11 | Examples: | ||
12 | |||
13 | ethernet@d8004000 { | ||
14 | compatible = "via,vt8500-rhine"; | ||
15 | reg = <0xd8004000 0x100>; | ||
16 | interrupts = <10>; | ||
17 | }; | ||
diff --git a/Documentation/devicetree/bindings/panel/auo,b133xtn01.txt b/Documentation/devicetree/bindings/panel/auo,b133xtn01.txt new file mode 100644 index 000000000000..7443b7c76769 --- /dev/null +++ b/Documentation/devicetree/bindings/panel/auo,b133xtn01.txt | |||
@@ -0,0 +1,7 @@ | |||
1 | AU Optronics Corporation 13.3" WXGA (1366x768) TFT LCD panel | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be "auo,b133xtn01" | ||
5 | |||
6 | This binding is compatible with the simple-panel binding, which is specified | ||
7 | in simple-panel.txt in this directory. | ||
diff --git a/Documentation/devicetree/bindings/panel/edt,et057090dhu.txt b/Documentation/devicetree/bindings/panel/edt,et057090dhu.txt new file mode 100644 index 000000000000..4903d7b1d947 --- /dev/null +++ b/Documentation/devicetree/bindings/panel/edt,et057090dhu.txt | |||
@@ -0,0 +1,7 @@ | |||
1 | Emerging Display Technology Corp. 5.7" VGA TFT LCD panel | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be "edt,et057090dhu" | ||
5 | |||
6 | This binding is compatible with the simple-panel binding, which is specified | ||
7 | in simple-panel.txt in this directory. | ||
diff --git a/Documentation/devicetree/bindings/panel/edt,et070080dh6.txt b/Documentation/devicetree/bindings/panel/edt,et070080dh6.txt new file mode 100644 index 000000000000..20cb38e836e4 --- /dev/null +++ b/Documentation/devicetree/bindings/panel/edt,et070080dh6.txt | |||
@@ -0,0 +1,10 @@ | |||
1 | Emerging Display Technology Corp. ET070080DH6 7.0" WVGA TFT LCD panel | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be "edt,et070080dh6" | ||
5 | |||
6 | This panel is the same as ETM0700G0DH6 except for the touchscreen. | ||
7 | ET070080DH6 is the model with resistive touch. | ||
8 | |||
9 | This binding is compatible with the simple-panel binding, which is specified | ||
10 | in simple-panel.txt in this directory. | ||
diff --git a/Documentation/devicetree/bindings/panel/edt,etm0700g0dh6.txt b/Documentation/devicetree/bindings/panel/edt,etm0700g0dh6.txt new file mode 100644 index 000000000000..ee4b18053e40 --- /dev/null +++ b/Documentation/devicetree/bindings/panel/edt,etm0700g0dh6.txt | |||
@@ -0,0 +1,10 @@ | |||
1 | Emerging Display Technology Corp. ETM0700G0DH6 7.0" WVGA TFT LCD panel | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be "edt,etm0700g0dh6" | ||
5 | |||
6 | This panel is the same as ET070080DH6 except for the touchscreen. | ||
7 | ETM0700G0DH6 is the model with capacitive multitouch. | ||
8 | |||
9 | This binding is compatible with the simple-panel binding, which is specified | ||
10 | in simple-panel.txt in this directory. | ||
diff --git a/Documentation/devicetree/bindings/pci/designware-pcie.txt b/Documentation/devicetree/bindings/pci/designware-pcie.txt index d6fae13ff062..d0d15ee42834 100644 --- a/Documentation/devicetree/bindings/pci/designware-pcie.txt +++ b/Documentation/devicetree/bindings/pci/designware-pcie.txt | |||
@@ -1,15 +1,7 @@ | |||
1 | * Synopsys Designware PCIe interface | 1 | * Synopsys Designware PCIe interface |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible: should contain "snps,dw-pcie" to identify the | 4 | - compatible: should contain "snps,dw-pcie" to identify the core. |
5 | core, plus an identifier for the specific instance, such | ||
6 | as "samsung,exynos5440-pcie" or "fsl,imx6q-pcie". | ||
7 | - reg: base addresses and lengths of the pcie controller, | ||
8 | the phy controller, additional register for the phy controller. | ||
9 | - interrupts: interrupt values for level interrupt, | ||
10 | pulse interrupt, special interrupt. | ||
11 | - clocks: from common clock binding: handle to pci clock. | ||
12 | - clock-names: from common clock binding: should be "pcie" and "pcie_bus". | ||
13 | - #address-cells: set to <3> | 5 | - #address-cells: set to <3> |
14 | - #size-cells: set to <2> | 6 | - #size-cells: set to <2> |
15 | - device_type: set to "pci" | 7 | - device_type: set to "pci" |
@@ -19,65 +11,11 @@ Required properties: | |||
19 | to define the mapping of the PCIe interface to interrupt | 11 | to define the mapping of the PCIe interface to interrupt |
20 | numbers. | 12 | numbers. |
21 | - num-lanes: number of lanes to use | 13 | - num-lanes: number of lanes to use |
14 | - clocks: Must contain an entry for each entry in clock-names. | ||
15 | See ../clocks/clock-bindings.txt for details. | ||
16 | - clock-names: Must include the following entries: | ||
17 | - "pcie" | ||
18 | - "pcie_bus" | ||
22 | 19 | ||
23 | Optional properties: | 20 | Optional properties: |
24 | - reset-gpio: gpio pin number of power good signal | 21 | - reset-gpio: gpio pin number of power good signal |
25 | |||
26 | Optional properties for fsl,imx6q-pcie | ||
27 | - power-on-gpio: gpio pin number of power-enable signal | ||
28 | - wake-up-gpio: gpio pin number of incoming wakeup signal | ||
29 | - disable-gpio: gpio pin number of outgoing rfkill/endpoint disable signal | ||
30 | |||
31 | Example: | ||
32 | |||
33 | SoC specific DT Entry: | ||
34 | |||
35 | pcie@290000 { | ||
36 | compatible = "samsung,exynos5440-pcie", "snps,dw-pcie"; | ||
37 | reg = <0x290000 0x1000 | ||
38 | 0x270000 0x1000 | ||
39 | 0x271000 0x40>; | ||
40 | interrupts = <0 20 0>, <0 21 0>, <0 22 0>; | ||
41 | clocks = <&clock 28>, <&clock 27>; | ||
42 | clock-names = "pcie", "pcie_bus"; | ||
43 | #address-cells = <3>; | ||
44 | #size-cells = <2>; | ||
45 | device_type = "pci"; | ||
46 | ranges = <0x00000800 0 0x40000000 0x40000000 0 0x00001000 /* configuration space */ | ||
47 | 0x81000000 0 0 0x40001000 0 0x00010000 /* downstream I/O */ | ||
48 | 0x82000000 0 0x40011000 0x40011000 0 0x1ffef000>; /* non-prefetchable memory */ | ||
49 | #interrupt-cells = <1>; | ||
50 | interrupt-map-mask = <0 0 0 0>; | ||
51 | interrupt-map = <0x0 0 &gic 53>; | ||
52 | num-lanes = <4>; | ||
53 | }; | ||
54 | |||
55 | pcie@2a0000 { | ||
56 | compatible = "samsung,exynos5440-pcie", "snps,dw-pcie"; | ||
57 | reg = <0x2a0000 0x1000 | ||
58 | 0x272000 0x1000 | ||
59 | 0x271040 0x40>; | ||
60 | interrupts = <0 23 0>, <0 24 0>, <0 25 0>; | ||
61 | clocks = <&clock 29>, <&clock 27>; | ||
62 | clock-names = "pcie", "pcie_bus"; | ||
63 | #address-cells = <3>; | ||
64 | #size-cells = <2>; | ||
65 | device_type = "pci"; | ||
66 | ranges = <0x00000800 0 0x60000000 0x60000000 0 0x00001000 /* configuration space */ | ||
67 | 0x81000000 0 0 0x60001000 0 0x00010000 /* downstream I/O */ | ||
68 | 0x82000000 0 0x60011000 0x60011000 0 0x1ffef000>; /* non-prefetchable memory */ | ||
69 | #interrupt-cells = <1>; | ||
70 | interrupt-map-mask = <0 0 0 0>; | ||
71 | interrupt-map = <0x0 0 &gic 56>; | ||
72 | num-lanes = <4>; | ||
73 | }; | ||
74 | |||
75 | Board specific DT Entry: | ||
76 | |||
77 | pcie@290000 { | ||
78 | reset-gpio = <&pin_ctrl 5 0>; | ||
79 | }; | ||
80 | |||
81 | pcie@2a0000 { | ||
82 | reset-gpio = <&pin_ctrl 22 0>; | ||
83 | }; | ||
diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt new file mode 100644 index 000000000000..9455fd0ec830 --- /dev/null +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | * Freescale i.MX6 PCIe interface | ||
2 | |||
3 | This PCIe host controller is based on the Synopsis Designware PCIe IP | ||
4 | and thus inherits all the common properties defined in designware-pcie.txt. | ||
5 | |||
6 | Required properties: | ||
7 | - compatible: "fsl,imx6q-pcie" | ||
8 | - reg: base addresse and length of the pcie controller | ||
9 | - interrupts: A list of interrupt outputs of the controller. Must contain an | ||
10 | entry for each entry in the interrupt-names property. | ||
11 | - interrupt-names: Must include the following entries: | ||
12 | - "msi": The interrupt that is asserted when an MSI is received | ||
13 | - clock-names: Must include the following additional entries: | ||
14 | - "pcie_phy" | ||
15 | |||
16 | Example: | ||
17 | |||
18 | pcie@0x01000000 { | ||
19 | compatible = "fsl,imx6q-pcie", "snps,dw-pcie"; | ||
20 | reg = <0x01ffc000 0x4000>; | ||
21 | #address-cells = <3>; | ||
22 | #size-cells = <2>; | ||
23 | device_type = "pci"; | ||
24 | ranges = <0x00000800 0 0x01f00000 0x01f00000 0 0x00080000 | ||
25 | 0x81000000 0 0 0x01f80000 0 0x00010000 | ||
26 | 0x82000000 0 0x01000000 0x01000000 0 0x00f00000>; | ||
27 | num-lanes = <1>; | ||
28 | interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; | ||
29 | interrupt-names = "msi"; | ||
30 | #interrupt-cells = <1>; | ||
31 | interrupt-map-mask = <0 0 0 0x7>; | ||
32 | interrupt-map = <0 0 0 1 &intc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, | ||
33 | <0 0 0 2 &intc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, | ||
34 | <0 0 0 3 &intc GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, | ||
35 | <0 0 0 4 &intc GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; | ||
36 | clocks = <&clks 144>, <&clks 206>, <&clks 189>; | ||
37 | clock-names = "pcie", "pcie_bus", "pcie_phy"; | ||
38 | }; | ||
diff --git a/Documentation/devicetree/bindings/pci/samsung,exynos5440-pcie.txt b/Documentation/devicetree/bindings/pci/samsung,exynos5440-pcie.txt new file mode 100644 index 000000000000..4f9d23d2ed67 --- /dev/null +++ b/Documentation/devicetree/bindings/pci/samsung,exynos5440-pcie.txt | |||
@@ -0,0 +1,65 @@ | |||
1 | * Samsung Exynos 5440 PCIe interface | ||
2 | |||
3 | This PCIe host controller is based on the Synopsis Designware PCIe IP | ||
4 | and thus inherits all the common properties defined in designware-pcie.txt. | ||
5 | |||
6 | Required properties: | ||
7 | - compatible: "samsung,exynos5440-pcie" | ||
8 | - reg: base addresses and lengths of the pcie controller, | ||
9 | the phy controller, additional register for the phy controller. | ||
10 | - interrupts: A list of interrupt outputs for level interrupt, | ||
11 | pulse interrupt, special interrupt. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | SoC specific DT Entry: | ||
16 | |||
17 | pcie@290000 { | ||
18 | compatible = "samsung,exynos5440-pcie", "snps,dw-pcie"; | ||
19 | reg = <0x290000 0x1000 | ||
20 | 0x270000 0x1000 | ||
21 | 0x271000 0x40>; | ||
22 | interrupts = <0 20 0>, <0 21 0>, <0 22 0>; | ||
23 | clocks = <&clock 28>, <&clock 27>; | ||
24 | clock-names = "pcie", "pcie_bus"; | ||
25 | #address-cells = <3>; | ||
26 | #size-cells = <2>; | ||
27 | device_type = "pci"; | ||
28 | ranges = <0x00000800 0 0x40000000 0x40000000 0 0x00001000 /* configuration space */ | ||
29 | 0x81000000 0 0 0x40001000 0 0x00010000 /* downstream I/O */ | ||
30 | 0x82000000 0 0x40011000 0x40011000 0 0x1ffef000>; /* non-prefetchable memory */ | ||
31 | #interrupt-cells = <1>; | ||
32 | interrupt-map-mask = <0 0 0 0>; | ||
33 | interrupt-map = <0 0 0 0 &gic GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; | ||
34 | num-lanes = <4>; | ||
35 | }; | ||
36 | |||
37 | pcie@2a0000 { | ||
38 | compatible = "samsung,exynos5440-pcie", "snps,dw-pcie"; | ||
39 | reg = <0x2a0000 0x1000 | ||
40 | 0x272000 0x1000 | ||
41 | 0x271040 0x40>; | ||
42 | interrupts = <0 23 0>, <0 24 0>, <0 25 0>; | ||
43 | clocks = <&clock 29>, <&clock 27>; | ||
44 | clock-names = "pcie", "pcie_bus"; | ||
45 | #address-cells = <3>; | ||
46 | #size-cells = <2>; | ||
47 | device_type = "pci"; | ||
48 | ranges = <0x00000800 0 0x60000000 0x60000000 0 0x00001000 /* configuration space */ | ||
49 | 0x81000000 0 0 0x60001000 0 0x00010000 /* downstream I/O */ | ||
50 | 0x82000000 0 0x60011000 0x60011000 0 0x1ffef000>; /* non-prefetchable memory */ | ||
51 | #interrupt-cells = <1>; | ||
52 | interrupt-map-mask = <0 0 0 0>; | ||
53 | interrupt-map = <0 0 0 0 &gic GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; | ||
54 | num-lanes = <4>; | ||
55 | }; | ||
56 | |||
57 | Board specific DT Entry: | ||
58 | |||
59 | pcie@290000 { | ||
60 | reset-gpio = <&pin_ctrl 5 0>; | ||
61 | }; | ||
62 | |||
63 | pcie@2a0000 { | ||
64 | reset-gpio = <&pin_ctrl 22 0>; | ||
65 | }; | ||
diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt b/Documentation/devicetree/bindings/video/exynos_dp.txt index 57ccdde02c3a..53dbccfa80ca 100644 --- a/Documentation/devicetree/bindings/video/exynos_dp.txt +++ b/Documentation/devicetree/bindings/video/exynos_dp.txt | |||
@@ -62,6 +62,10 @@ Optional properties for dp-controller: | |||
62 | -hsync-active-high: | 62 | -hsync-active-high: |
63 | HSYNC polarity configuration. | 63 | HSYNC polarity configuration. |
64 | High if defined, Low if not defined | 64 | High if defined, Low if not defined |
65 | -samsung,hpd-gpio: | ||
66 | Hotplug detect GPIO. | ||
67 | Indicates which GPIO should be used for hotplug | ||
68 | detection | ||
65 | 69 | ||
66 | Example: | 70 | Example: |
67 | 71 | ||
diff --git a/Documentation/devicetree/bindings/video/exynos_hdmi.txt b/Documentation/devicetree/bindings/video/exynos_hdmi.txt index f9187a259259..1fd8cf9cbfac 100644 --- a/Documentation/devicetree/bindings/video/exynos_hdmi.txt +++ b/Documentation/devicetree/bindings/video/exynos_hdmi.txt | |||
@@ -5,6 +5,7 @@ Required properties: | |||
5 | 1) "samsung,exynos5-hdmi" <DEPRECATED> | 5 | 1) "samsung,exynos5-hdmi" <DEPRECATED> |
6 | 2) "samsung,exynos4210-hdmi" | 6 | 2) "samsung,exynos4210-hdmi" |
7 | 3) "samsung,exynos4212-hdmi" | 7 | 3) "samsung,exynos4212-hdmi" |
8 | 4) "samsung,exynos5420-hdmi" | ||
8 | - reg: physical base address of the hdmi and length of memory mapped | 9 | - reg: physical base address of the hdmi and length of memory mapped |
9 | region. | 10 | region. |
10 | - interrupts: interrupt number to the cpu. | 11 | - interrupts: interrupt number to the cpu. |
@@ -27,6 +28,7 @@ Required properties: | |||
27 | "hdmi", "sclk_hdmi", "sclk_pixel", "sclk_hdmiphy" and "mout_hdmi". | 28 | "hdmi", "sclk_hdmi", "sclk_pixel", "sclk_hdmiphy" and "mout_hdmi". |
28 | - ddc: phandle to the hdmi ddc node | 29 | - ddc: phandle to the hdmi ddc node |
29 | - phy: phandle to the hdmi phy node | 30 | - phy: phandle to the hdmi phy node |
31 | - samsung,syscon-phandle: phandle for system controller node for PMU. | ||
30 | 32 | ||
31 | Example: | 33 | Example: |
32 | 34 | ||
@@ -37,4 +39,5 @@ Example: | |||
37 | hpd-gpio = <&gpx3 7 1>; | 39 | hpd-gpio = <&gpx3 7 1>; |
38 | ddc = <&hdmi_ddc_node>; | 40 | ddc = <&hdmi_ddc_node>; |
39 | phy = <&hdmi_phy_node>; | 41 | phy = <&hdmi_phy_node>; |
42 | samsung,syscon-phandle = <&pmu_system_controller>; | ||
40 | }; | 43 | }; |
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt index 89472558011e..1525e30483fd 100644 --- a/Documentation/driver-model/devres.txt +++ b/Documentation/driver-model/devres.txt | |||
@@ -318,3 +318,8 @@ GPIO | |||
318 | devm_gpiod_get_optional() | 318 | devm_gpiod_get_optional() |
319 | devm_gpiod_get_index_optional() | 319 | devm_gpiod_get_index_optional() |
320 | devm_gpiod_put() | 320 | devm_gpiod_put() |
321 | |||
322 | MDIO | ||
323 | devm_mdiobus_alloc() | ||
324 | devm_mdiobus_alloc_size() | ||
325 | devm_mdiobus_free() | ||
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index eba790134253..b18dd1779029 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -196,8 +196,7 @@ prototypes: | |||
196 | void (*invalidatepage) (struct page *, unsigned int, unsigned int); | 196 | void (*invalidatepage) (struct page *, unsigned int, unsigned int); |
197 | int (*releasepage) (struct page *, int); | 197 | int (*releasepage) (struct page *, int); |
198 | void (*freepage)(struct page *); | 198 | void (*freepage)(struct page *); |
199 | int (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 199 | int (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset); |
200 | loff_t offset, unsigned long nr_segs); | ||
201 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, void **, | 200 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, void **, |
202 | unsigned long *); | 201 | unsigned long *); |
203 | int (*migratepage)(struct address_space *, struct page *, struct page *); | 202 | int (*migratepage)(struct address_space *, struct page *, struct page *); |
@@ -431,6 +430,8 @@ prototypes: | |||
431 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); | 430 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); |
432 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | 431 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); |
433 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | 432 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); |
433 | ssize_t (*read_iter) (struct kiocb *, struct iov_iter *); | ||
434 | ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); | ||
434 | int (*iterate) (struct file *, struct dir_context *); | 435 | int (*iterate) (struct file *, struct dir_context *); |
435 | unsigned int (*poll) (struct file *, struct poll_table_struct *); | 436 | unsigned int (*poll) (struct file *, struct poll_table_struct *); |
436 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); | 437 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 617f6d70c077..a1d0d7a30165 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -589,8 +589,7 @@ struct address_space_operations { | |||
589 | void (*invalidatepage) (struct page *, unsigned int, unsigned int); | 589 | void (*invalidatepage) (struct page *, unsigned int, unsigned int); |
590 | int (*releasepage) (struct page *, int); | 590 | int (*releasepage) (struct page *, int); |
591 | void (*freepage)(struct page *); | 591 | void (*freepage)(struct page *); |
592 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 592 | ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset); |
593 | loff_t offset, unsigned long nr_segs); | ||
594 | struct page* (*get_xip_page)(struct address_space *, sector_t, | 593 | struct page* (*get_xip_page)(struct address_space *, sector_t, |
595 | int); | 594 | int); |
596 | /* migrate the contents of a page to the specified target */ | 595 | /* migrate the contents of a page to the specified target */ |
@@ -807,6 +806,8 @@ struct file_operations { | |||
807 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); | 806 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); |
808 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | 807 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); |
809 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | 808 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); |
809 | ssize_t (*read_iter) (struct kiocb *, struct iov_iter *); | ||
810 | ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); | ||
810 | int (*iterate) (struct file *, struct dir_context *); | 811 | int (*iterate) (struct file *, struct dir_context *); |
811 | unsigned int (*poll) (struct file *, struct poll_table_struct *); | 812 | unsigned int (*poll) (struct file *, struct poll_table_struct *); |
812 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); | 813 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
@@ -837,11 +838,15 @@ otherwise noted. | |||
837 | 838 | ||
838 | read: called by read(2) and related system calls | 839 | read: called by read(2) and related system calls |
839 | 840 | ||
840 | aio_read: called by io_submit(2) and other asynchronous I/O operations | 841 | aio_read: vectored, possibly asynchronous read |
842 | |||
843 | read_iter: possibly asynchronous read with iov_iter as destination | ||
841 | 844 | ||
842 | write: called by write(2) and related system calls | 845 | write: called by write(2) and related system calls |
843 | 846 | ||
844 | aio_write: called by io_submit(2) and other asynchronous I/O operations | 847 | aio_write: vectored, possibly asynchronous write |
848 | |||
849 | write_iter: possibly asynchronous write with iov_iter as source | ||
845 | 850 | ||
846 | iterate: called when the VFS needs to read the directory contents | 851 | iterate: called when the VFS needs to read the directory contents |
847 | 852 | ||
diff --git a/Documentation/kbuild/modules.txt b/Documentation/kbuild/modules.txt index 69372fb98cf8..3fb39e0116b4 100644 --- a/Documentation/kbuild/modules.txt +++ b/Documentation/kbuild/modules.txt | |||
@@ -470,7 +470,7 @@ build. | |||
470 | 470 | ||
471 | Sometimes, an external module uses exported symbols from | 471 | Sometimes, an external module uses exported symbols from |
472 | another external module. kbuild needs to have full knowledge of | 472 | another external module. kbuild needs to have full knowledge of |
473 | all symbols to avoid spliitting out warnings about undefined | 473 | all symbols to avoid spitting out warnings about undefined |
474 | symbols. Three solutions exist for this situation. | 474 | symbols. Three solutions exist for this situation. |
475 | 475 | ||
476 | NOTE: The method with a top-level kbuild file is recommended | 476 | NOTE: The method with a top-level kbuild file is recommended |
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index 0cfb00fd86ff..4bbeca8483ed 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt | |||
@@ -22,8 +22,9 @@ Appendix B: The kprobes sysctl interface | |||
22 | 22 | ||
23 | Kprobes enables you to dynamically break into any kernel routine and | 23 | Kprobes enables you to dynamically break into any kernel routine and |
24 | collect debugging and performance information non-disruptively. You | 24 | collect debugging and performance information non-disruptively. You |
25 | can trap at almost any kernel code address, specifying a handler | 25 | can trap at almost any kernel code address(*), specifying a handler |
26 | routine to be invoked when the breakpoint is hit. | 26 | routine to be invoked when the breakpoint is hit. |
27 | (*: some parts of the kernel code can not be trapped, see 1.5 Blacklist) | ||
27 | 28 | ||
28 | There are currently three types of probes: kprobes, jprobes, and | 29 | There are currently three types of probes: kprobes, jprobes, and |
29 | kretprobes (also called return probes). A kprobe can be inserted | 30 | kretprobes (also called return probes). A kprobe can be inserted |
@@ -273,6 +274,19 @@ using one of the following techniques: | |||
273 | or | 274 | or |
274 | - Execute 'sysctl -w debug.kprobes_optimization=n' | 275 | - Execute 'sysctl -w debug.kprobes_optimization=n' |
275 | 276 | ||
277 | 1.5 Blacklist | ||
278 | |||
279 | Kprobes can probe most of the kernel except itself. This means | ||
280 | that there are some functions where kprobes cannot probe. Probing | ||
281 | (trapping) such functions can cause a recursive trap (e.g. double | ||
282 | fault) or the nested probe handler may never be called. | ||
283 | Kprobes manages such functions as a blacklist. | ||
284 | If you want to add a function into the blacklist, you just need | ||
285 | to (1) include linux/kprobes.h and (2) use NOKPROBE_SYMBOL() macro | ||
286 | to specify a blacklisted function. | ||
287 | Kprobes checks the given probe address against the blacklist and | ||
288 | rejects registering it, if the given address is in the blacklist. | ||
289 | |||
276 | 2. Architectures Supported | 290 | 2. Architectures Supported |
277 | 291 | ||
278 | Kprobes, jprobes, and return probes are implemented on the following | 292 | Kprobes, jprobes, and return probes are implemented on the following |
diff --git a/Documentation/mutex-design.txt b/Documentation/mutex-design.txt index 1dfe62c3641d..ee231ed09ec6 100644 --- a/Documentation/mutex-design.txt +++ b/Documentation/mutex-design.txt | |||
@@ -1,139 +1,157 @@ | |||
1 | Generic Mutex Subsystem | 1 | Generic Mutex Subsystem |
2 | 2 | ||
3 | started by Ingo Molnar <mingo@redhat.com> | 3 | started by Ingo Molnar <mingo@redhat.com> |
4 | updated by Davidlohr Bueso <davidlohr@hp.com> | ||
4 | 5 | ||
5 | "Why on earth do we need a new mutex subsystem, and what's wrong | 6 | What are mutexes? |
6 | with semaphores?" | 7 | ----------------- |
7 | 8 | ||
8 | firstly, there's nothing wrong with semaphores. But if the simpler | 9 | In the Linux kernel, mutexes refer to a particular locking primitive |
9 | mutex semantics are sufficient for your code, then there are a couple | 10 | that enforces serialization on shared memory systems, and not only to |
10 | of advantages of mutexes: | 11 | the generic term referring to 'mutual exclusion' found in academia |
12 | or similar theoretical text books. Mutexes are sleeping locks which | ||
13 | behave similarly to binary semaphores, and were introduced in 2006[1] | ||
14 | as an alternative to these. This new data structure provided a number | ||
15 | of advantages, including simpler interfaces, and at that time smaller | ||
16 | code (see Disadvantages). | ||
11 | 17 | ||
12 | - 'struct mutex' is smaller on most architectures: E.g. on x86, | 18 | [1] http://lwn.net/Articles/164802/ |
13 | 'struct semaphore' is 20 bytes, 'struct mutex' is 16 bytes. | ||
14 | A smaller structure size means less RAM footprint, and better | ||
15 | CPU-cache utilization. | ||
16 | 19 | ||
17 | - tighter code. On x86 i get the following .text sizes when | 20 | Implementation |
18 | switching all mutex-alike semaphores in the kernel to the mutex | 21 | -------------- |
19 | subsystem: | ||
20 | 22 | ||
21 | text data bss dec hex filename | 23 | Mutexes are represented by 'struct mutex', defined in include/linux/mutex.h |
22 | 3280380 868188 396860 4545428 455b94 vmlinux-semaphore | 24 | and implemented in kernel/locking/mutex.c. These locks use a three |
23 | 3255329 865296 396732 4517357 44eded vmlinux-mutex | 25 | state atomic counter (->count) to represent the different possible |
26 | transitions that can occur during the lifetime of a lock: | ||
24 | 27 | ||
25 | that's 25051 bytes of code saved, or a 0.76% win - off the hottest | 28 | 1: unlocked |
26 | codepaths of the kernel. (The .data savings are 2892 bytes, or 0.33%) | 29 | 0: locked, no waiters |
27 | Smaller code means better icache footprint, which is one of the | 30 | negative: locked, with potential waiters |
28 | major optimization goals in the Linux kernel currently. | ||
29 | 31 | ||
30 | - the mutex subsystem is slightly faster and has better scalability for | 32 | In its most basic form it also includes a wait-queue and a spinlock |
31 | contended workloads. On an 8-way x86 system, running a mutex-based | 33 | that serializes access to it. CONFIG_SMP systems can also include |
32 | kernel and testing creat+unlink+close (of separate, per-task files) | 34 | a pointer to the lock task owner (->owner) as well as a spinner MCS |
33 | in /tmp with 16 parallel tasks, the average number of ops/sec is: | 35 | lock (->osq), both described below in (ii). |
34 | 36 | ||
35 | Semaphores: Mutexes: | 37 | When acquiring a mutex, there are three possible paths that can be |
38 | taken, depending on the state of the lock: | ||
36 | 39 | ||
37 | $ ./test-mutex V 16 10 $ ./test-mutex V 16 10 | 40 | (i) fastpath: tries to atomically acquire the lock by decrementing the |
38 | 8 CPUs, running 16 tasks. 8 CPUs, running 16 tasks. | 41 | counter. If it was already taken by another task it goes to the next |
39 | checking VFS performance. checking VFS performance. | 42 | possible path. This logic is architecture specific. On x86-64, the |
40 | avg loops/sec: 34713 avg loops/sec: 84153 | 43 | locking fastpath is 2 instructions: |
41 | CPU utilization: 63% CPU utilization: 22% | ||
42 | 44 | ||
43 | i.e. in this workload, the mutex based kernel was 2.4 times faster | 45 | 0000000000000e10 <mutex_lock>: |
44 | than the semaphore based kernel, _and_ it also had 2.8 times less CPU | 46 | e21: f0 ff 0b lock decl (%rbx) |
45 | utilization. (In terms of 'ops per CPU cycle', the semaphore kernel | 47 | e24: 79 08 jns e2e <mutex_lock+0x1e> |
46 | performed 551 ops/sec per 1% of CPU time used, while the mutex kernel | ||
47 | performed 3825 ops/sec per 1% of CPU time used - it was 6.9 times | ||
48 | more efficient.) | ||
49 | |||
50 | the scalability difference is visible even on a 2-way P4 HT box: | ||
51 | |||
52 | Semaphores: Mutexes: | ||
53 | |||
54 | $ ./test-mutex V 16 10 $ ./test-mutex V 16 10 | ||
55 | 4 CPUs, running 16 tasks. 8 CPUs, running 16 tasks. | ||
56 | checking VFS performance. checking VFS performance. | ||
57 | avg loops/sec: 127659 avg loops/sec: 181082 | ||
58 | CPU utilization: 100% CPU utilization: 34% | ||
59 | |||
60 | (the straight performance advantage of mutexes is 41%, the per-cycle | ||
61 | efficiency of mutexes is 4.1 times better.) | ||
62 | |||
63 | - there are no fastpath tradeoffs, the mutex fastpath is just as tight | ||
64 | as the semaphore fastpath. On x86, the locking fastpath is 2 | ||
65 | instructions: | ||
66 | |||
67 | c0377ccb <mutex_lock>: | ||
68 | c0377ccb: f0 ff 08 lock decl (%eax) | ||
69 | c0377cce: 78 0e js c0377cde <.text..lock.mutex> | ||
70 | c0377cd0: c3 ret | ||
71 | 48 | ||
72 | the unlocking fastpath is equally tight: | 49 | the unlocking fastpath is equally tight: |
73 | 50 | ||
74 | c0377cd1 <mutex_unlock>: | 51 | 0000000000000bc0 <mutex_unlock>: |
75 | c0377cd1: f0 ff 00 lock incl (%eax) | 52 | bc8: f0 ff 07 lock incl (%rdi) |
76 | c0377cd4: 7e 0f jle c0377ce5 <.text..lock.mutex+0x7> | 53 | bcb: 7f 0a jg bd7 <mutex_unlock+0x17> |
77 | c0377cd6: c3 ret | 54 | |
78 | 55 | ||
79 | - 'struct mutex' semantics are well-defined and are enforced if | 56 | (ii) midpath: aka optimistic spinning, tries to spin for acquisition |
80 | CONFIG_DEBUG_MUTEXES is turned on. Semaphores on the other hand have | 57 | while the lock owner is running and there are no other tasks ready |
81 | virtually no debugging code or instrumentation. The mutex subsystem | 58 | to run that have higher priority (need_resched). The rationale is |
82 | checks and enforces the following rules: | 59 | that if the lock owner is running, it is likely to release the lock |
83 | 60 | soon. The mutex spinners are queued up using MCS lock so that only | |
84 | * - only one task can hold the mutex at a time | 61 | one spinner can compete for the mutex. |
85 | * - only the owner can unlock the mutex | 62 | |
86 | * - multiple unlocks are not permitted | 63 | The MCS lock (proposed by Mellor-Crummey and Scott) is a simple spinlock |
87 | * - recursive locking is not permitted | 64 | with the desirable properties of being fair and with each cpu trying |
88 | * - a mutex object must be initialized via the API | 65 | to acquire the lock spinning on a local variable. It avoids expensive |
89 | * - a mutex object must not be initialized via memset or copying | 66 | cacheline bouncing that common test-and-set spinlock implementations |
90 | * - task may not exit with mutex held | 67 | incur. An MCS-like lock is specially tailored for optimistic spinning |
91 | * - memory areas where held locks reside must not be freed | 68 | for sleeping lock implementation. An important feature of the customized |
92 | * - held mutexes must not be reinitialized | 69 | MCS lock is that it has the extra property that spinners are able to exit |
93 | * - mutexes may not be used in hardware or software interrupt | 70 | the MCS spinlock queue when they need to reschedule. This further helps |
94 | * contexts such as tasklets and timers | 71 | avoid situations where MCS spinners that need to reschedule would continue |
95 | 72 | waiting to spin on mutex owner, only to go directly to slowpath upon | |
96 | furthermore, there are also convenience features in the debugging | 73 | obtaining the MCS lock. |
97 | code: | 74 | |
98 | 75 | ||
99 | * - uses symbolic names of mutexes, whenever they are printed in debug output | 76 | (iii) slowpath: last resort, if the lock is still unable to be acquired, |
100 | * - point-of-acquire tracking, symbolic lookup of function names | 77 | the task is added to the wait-queue and sleeps until woken up by the |
101 | * - list of all locks held in the system, printout of them | 78 | unlock path. Under normal circumstances it blocks as TASK_UNINTERRUPTIBLE. |
102 | * - owner tracking | 79 | |
103 | * - detects self-recursing locks and prints out all relevant info | 80 | While formally kernel mutexes are sleepable locks, it is path (ii) that |
104 | * - detects multi-task circular deadlocks and prints out all affected | 81 | makes them more practically a hybrid type. By simply not interrupting a |
105 | * locks and tasks (and only those tasks) | 82 | task and busy-waiting for a few cycles instead of immediately sleeping, |
83 | the performance of this lock has been seen to significantly improve a | ||
84 | number of workloads. Note that this technique is also used for rw-semaphores. | ||
85 | |||
86 | Semantics | ||
87 | --------- | ||
88 | |||
89 | The mutex subsystem checks and enforces the following rules: | ||
90 | |||
91 | - Only one task can hold the mutex at a time. | ||
92 | - Only the owner can unlock the mutex. | ||
93 | - Multiple unlocks are not permitted. | ||
94 | - Recursive locking/unlocking is not permitted. | ||
95 | - A mutex must only be initialized via the API (see below). | ||
96 | - A task may not exit with a mutex held. | ||
97 | - Memory areas where held locks reside must not be freed. | ||
98 | - Held mutexes must not be reinitialized. | ||
99 | - Mutexes may not be used in hardware or software interrupt | ||
100 | contexts such as tasklets and timers. | ||
101 | |||
102 | These semantics are fully enforced when CONFIG DEBUG_MUTEXES is enabled. | ||
103 | In addition, the mutex debugging code also implements a number of other | ||
104 | features that make lock debugging easier and faster: | ||
105 | |||
106 | - Uses symbolic names of mutexes, whenever they are printed | ||
107 | in debug output. | ||
108 | - Point-of-acquire tracking, symbolic lookup of function names, | ||
109 | list of all locks held in the system, printout of them. | ||
110 | - Owner tracking. | ||
111 | - Detects self-recursing locks and prints out all relevant info. | ||
112 | - Detects multi-task circular deadlocks and prints out all affected | ||
113 | locks and tasks (and only those tasks). | ||
114 | |||
115 | |||
116 | Interfaces | ||
117 | ---------- | ||
118 | Statically define the mutex: | ||
119 | DEFINE_MUTEX(name); | ||
120 | |||
121 | Dynamically initialize the mutex: | ||
122 | mutex_init(mutex); | ||
123 | |||
124 | Acquire the mutex, uninterruptible: | ||
125 | void mutex_lock(struct mutex *lock); | ||
126 | void mutex_lock_nested(struct mutex *lock, unsigned int subclass); | ||
127 | int mutex_trylock(struct mutex *lock); | ||
128 | |||
129 | Acquire the mutex, interruptible: | ||
130 | int mutex_lock_interruptible_nested(struct mutex *lock, | ||
131 | unsigned int subclass); | ||
132 | int mutex_lock_interruptible(struct mutex *lock); | ||
133 | |||
134 | Acquire the mutex, interruptible, if dec to 0: | ||
135 | int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); | ||
136 | |||
137 | Unlock the mutex: | ||
138 | void mutex_unlock(struct mutex *lock); | ||
139 | |||
140 | Test if the mutex is taken: | ||
141 | int mutex_is_locked(struct mutex *lock); | ||
106 | 142 | ||
107 | Disadvantages | 143 | Disadvantages |
108 | ------------- | 144 | ------------- |
109 | 145 | ||
110 | The stricter mutex API means you cannot use mutexes the same way you | 146 | Unlike its original design and purpose, 'struct mutex' is larger than |
111 | can use semaphores: e.g. they cannot be used from an interrupt context, | 147 | most locks in the kernel. E.g: on x86-64 it is 40 bytes, almost twice |
112 | nor can they be unlocked from a different context that which acquired | 148 | as large as 'struct semaphore' (24 bytes) and 8 bytes shy of the |
113 | it. [ I'm not aware of any other (e.g. performance) disadvantages from | 149 | 'struct rw_semaphore' variant. Larger structure sizes mean more CPU |
114 | using mutexes at the moment, please let me know if you find any. ] | 150 | cache and memory footprint. |
115 | |||
116 | Implementation of mutexes | ||
117 | ------------------------- | ||
118 | |||
119 | 'struct mutex' is the new mutex type, defined in include/linux/mutex.h and | ||
120 | implemented in kernel/locking/mutex.c. It is a counter-based mutex with a | ||
121 | spinlock and a wait-list. The counter has 3 states: 1 for "unlocked", 0 for | ||
122 | "locked" and negative numbers (usually -1) for "locked, potential waiters | ||
123 | queued". | ||
124 | |||
125 | the APIs of 'struct mutex' have been streamlined: | ||
126 | |||
127 | DEFINE_MUTEX(name); | ||
128 | 151 | ||
129 | mutex_init(mutex); | 152 | When to use mutexes |
153 | ------------------- | ||
130 | 154 | ||
131 | void mutex_lock(struct mutex *lock); | 155 | Unless the strict semantics of mutexes are unsuitable and/or the critical |
132 | int mutex_lock_interruptible(struct mutex *lock); | 156 | region prevents the lock from being shared, always prefer them to any other |
133 | int mutex_trylock(struct mutex *lock); | 157 | locking primitive. |
134 | void mutex_unlock(struct mutex *lock); | ||
135 | int mutex_is_locked(struct mutex *lock); | ||
136 | void mutex_lock_nested(struct mutex *lock, unsigned int subclass); | ||
137 | int mutex_lock_interruptible_nested(struct mutex *lock, | ||
138 | unsigned int subclass); | ||
139 | int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); | ||
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index a383c00392d0..9c723ecd0025 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt | |||
@@ -585,13 +585,19 @@ mode | |||
585 | balance-tlb or 5 | 585 | balance-tlb or 5 |
586 | 586 | ||
587 | Adaptive transmit load balancing: channel bonding that | 587 | Adaptive transmit load balancing: channel bonding that |
588 | does not require any special switch support. The | 588 | does not require any special switch support. |
589 | outgoing traffic is distributed according to the | 589 | |
590 | current load (computed relative to the speed) on each | 590 | In tlb_dynamic_lb=1 mode; the outgoing traffic is |
591 | slave. Incoming traffic is received by the current | 591 | distributed according to the current load (computed |
592 | slave. If the receiving slave fails, another slave | 592 | relative to the speed) on each slave. |
593 | takes over the MAC address of the failed receiving | 593 | |
594 | slave. | 594 | In tlb_dynamic_lb=0 mode; the load balancing based on |
595 | current load is disabled and the load is distributed | ||
596 | only using the hash distribution. | ||
597 | |||
598 | Incoming traffic is received by the current slave. | ||
599 | If the receiving slave fails, another slave takes over | ||
600 | the MAC address of the failed receiving slave. | ||
595 | 601 | ||
596 | Prerequisite: | 602 | Prerequisite: |
597 | 603 | ||
@@ -736,6 +742,28 @@ primary_reselect | |||
736 | 742 | ||
737 | This option was added for bonding version 3.6.0. | 743 | This option was added for bonding version 3.6.0. |
738 | 744 | ||
745 | tlb_dynamic_lb | ||
746 | |||
747 | Specifies if dynamic shuffling of flows is enabled in tlb | ||
748 | mode. The value has no effect on any other modes. | ||
749 | |||
750 | The default behavior of tlb mode is to shuffle active flows across | ||
751 | slaves based on the load in that interval. This gives nice lb | ||
752 | characteristics but can cause packet reordering. If re-ordering is | ||
753 | a concern use this variable to disable flow shuffling and rely on | ||
754 | load balancing provided solely by the hash distribution. | ||
755 | xmit-hash-policy can be used to select the appropriate hashing for | ||
756 | the setup. | ||
757 | |||
758 | The sysfs entry can be used to change the setting per bond device | ||
759 | and the initial value is derived from the module parameter. The | ||
760 | sysfs entry is allowed to be changed only if the bond device is | ||
761 | down. | ||
762 | |||
763 | The default value is "1" that enables flow shuffling while value "0" | ||
764 | disables it. This option was added in bonding driver 3.7.1 | ||
765 | |||
766 | |||
739 | updelay | 767 | updelay |
740 | 768 | ||
741 | Specifies the time, in milliseconds, to wait before enabling a | 769 | Specifies the time, in milliseconds, to wait before enabling a |
@@ -769,7 +797,7 @@ use_carrier | |||
769 | xmit_hash_policy | 797 | xmit_hash_policy |
770 | 798 | ||
771 | Selects the transmit hash policy to use for slave selection in | 799 | Selects the transmit hash policy to use for slave selection in |
772 | balance-xor and 802.3ad modes. Possible values are: | 800 | balance-xor, 802.3ad, and tlb modes. Possible values are: |
773 | 801 | ||
774 | layer2 | 802 | layer2 |
775 | 803 | ||
diff --git a/Documentation/networking/can.txt b/Documentation/networking/can.txt index 4f7ae5261364..2236d6dcb7da 100644 --- a/Documentation/networking/can.txt +++ b/Documentation/networking/can.txt | |||
@@ -469,6 +469,41 @@ solution for a couple of reasons: | |||
469 | having this 'send only' use-case we may remove the receive list in the | 469 | having this 'send only' use-case we may remove the receive list in the |
470 | Kernel to save a little (really a very little!) CPU usage. | 470 | Kernel to save a little (really a very little!) CPU usage. |
471 | 471 | ||
472 | 4.1.1.1 CAN filter usage optimisation | ||
473 | |||
474 | The CAN filters are processed in per-device filter lists at CAN frame | ||
475 | reception time. To reduce the number of checks that need to be performed | ||
476 | while walking through the filter lists the CAN core provides an optimized | ||
477 | filter handling when the filter subscription focusses on a single CAN ID. | ||
478 | |||
479 | For the possible 2048 SFF CAN identifiers the identifier is used as an index | ||
480 | to access the corresponding subscription list without any further checks. | ||
481 | For the 2^29 possible EFF CAN identifiers a 10 bit XOR folding is used as | ||
482 | hash function to retrieve the EFF table index. | ||
483 | |||
484 | To benefit from the optimized filters for single CAN identifiers the | ||
485 | CAN_SFF_MASK or CAN_EFF_MASK have to be set into can_filter.mask together | ||
486 | with set CAN_EFF_FLAG and CAN_RTR_FLAG bits. A set CAN_EFF_FLAG bit in the | ||
487 | can_filter.mask makes clear that it matters whether a SFF or EFF CAN ID is | ||
488 | subscribed. E.g. in the example from above | ||
489 | |||
490 | rfilter[0].can_id = 0x123; | ||
491 | rfilter[0].can_mask = CAN_SFF_MASK; | ||
492 | |||
493 | both SFF frames with CAN ID 0x123 and EFF frames with 0xXXXXX123 can pass. | ||
494 | |||
495 | To filter for only 0x123 (SFF) and 0x12345678 (EFF) CAN identifiers the | ||
496 | filter has to be defined in this way to benefit from the optimized filters: | ||
497 | |||
498 | struct can_filter rfilter[2]; | ||
499 | |||
500 | rfilter[0].can_id = 0x123; | ||
501 | rfilter[0].can_mask = (CAN_EFF_FLAG | CAN_RTR_FLAG | CAN_SFF_MASK); | ||
502 | rfilter[1].can_id = 0x12345678 | CAN_EFF_FLAG; | ||
503 | rfilter[1].can_mask = (CAN_EFF_FLAG | CAN_RTR_FLAG | CAN_EFF_MASK); | ||
504 | |||
505 | setsockopt(s, SOL_CAN_RAW, CAN_RAW_FILTER, &rfilter, sizeof(rfilter)); | ||
506 | |||
472 | 4.1.2 RAW socket option CAN_RAW_ERR_FILTER | 507 | 4.1.2 RAW socket option CAN_RAW_ERR_FILTER |
473 | 508 | ||
474 | As described in chapter 3.4 the CAN interface driver can generate so | 509 | As described in chapter 3.4 the CAN interface driver can generate so |
diff --git a/Documentation/networking/cdc_mbim.txt b/Documentation/networking/cdc_mbim.txt new file mode 100644 index 000000000000..a15ea602aa52 --- /dev/null +++ b/Documentation/networking/cdc_mbim.txt | |||
@@ -0,0 +1,339 @@ | |||
1 | cdc_mbim - Driver for CDC MBIM Mobile Broadband modems | ||
2 | ======================================================== | ||
3 | |||
4 | The cdc_mbim driver supports USB devices conforming to the "Universal | ||
5 | Serial Bus Communications Class Subclass Specification for Mobile | ||
6 | Broadband Interface Model" [1], which is a further development of | ||
7 | "Universal Serial Bus Communications Class Subclass Specifications for | ||
8 | Network Control Model Devices" [2] optimized for Mobile Broadband | ||
9 | devices, aka "3G/LTE modems". | ||
10 | |||
11 | |||
12 | Command Line Parameters | ||
13 | ======================= | ||
14 | |||
15 | The cdc_mbim driver has no parameters of its own. But the probing | ||
16 | behaviour for NCM 1.0 backwards compatible MBIM functions (an | ||
17 | "NCM/MBIM function" as defined in section 3.2 of [1]) is affected | ||
18 | by a cdc_ncm driver parameter: | ||
19 | |||
20 | prefer_mbim | ||
21 | ----------- | ||
22 | Type: Boolean | ||
23 | Valid Range: N/Y (0-1) | ||
24 | Default Value: Y (MBIM is preferred) | ||
25 | |||
26 | This parameter sets the system policy for NCM/MBIM functions. Such | ||
27 | functions will be handled by either the cdc_ncm driver or the cdc_mbim | ||
28 | driver depending on the prefer_mbim setting. Setting prefer_mbim=N | ||
29 | makes the cdc_mbim driver ignore these functions and lets the cdc_ncm | ||
30 | driver handle them instead. | ||
31 | |||
32 | The parameter is writable, and can be changed at any time. A manual | ||
33 | unbind/bind is required to make the change effective for NCM/MBIM | ||
34 | functions bound to the "wrong" driver | ||
35 | |||
36 | |||
37 | Basic usage | ||
38 | =========== | ||
39 | |||
40 | MBIM functions are inactive when unmanaged. The cdc_mbim driver only | ||
41 | provides an userspace interface to the MBIM control channel, and will | ||
42 | not participate in the management of the function. This implies that a | ||
43 | userspace MBIM management application always is required to enable a | ||
44 | MBIM function. | ||
45 | |||
46 | Such userspace applications includes, but are not limited to: | ||
47 | - mbimcli (included with the libmbim [3] library), and | ||
48 | - ModemManager [4] | ||
49 | |||
50 | Establishing a MBIM IP session reequires at least these actions by the | ||
51 | management application: | ||
52 | - open the control channel | ||
53 | - configure network connection settings | ||
54 | - connect to network | ||
55 | - configure IP interface | ||
56 | |||
57 | Management application development | ||
58 | ---------------------------------- | ||
59 | The driver <-> userspace interfaces are described below. The MBIM | ||
60 | control channel protocol is described in [1]. | ||
61 | |||
62 | |||
63 | MBIM control channel userspace ABI | ||
64 | ================================== | ||
65 | |||
66 | /dev/cdc-wdmX character device | ||
67 | ------------------------------ | ||
68 | The driver creates a two-way pipe to the MBIM function control channel | ||
69 | using the cdc-wdm driver as a subdriver. The userspace end of the | ||
70 | control channel pipe is a /dev/cdc-wdmX character device. | ||
71 | |||
72 | The cdc_mbim driver does not process or police messages on the control | ||
73 | channel. The channel is fully delegated to the userspace management | ||
74 | application. It is therefore up to this application to ensure that it | ||
75 | complies with all the control channel requirements in [1]. | ||
76 | |||
77 | The cdc-wdmX device is created as a child of the MBIM control | ||
78 | interface USB device. The character device associated with a specific | ||
79 | MBIM function can be looked up using sysfs. For example: | ||
80 | |||
81 | bjorn@nemi:~$ ls /sys/bus/usb/drivers/cdc_mbim/2-4:2.12/usbmisc | ||
82 | cdc-wdm0 | ||
83 | |||
84 | bjorn@nemi:~$ grep . /sys/bus/usb/drivers/cdc_mbim/2-4:2.12/usbmisc/cdc-wdm0/dev | ||
85 | 180:0 | ||
86 | |||
87 | |||
88 | USB configuration descriptors | ||
89 | ----------------------------- | ||
90 | The wMaxControlMessage field of the CDC MBIM functional descriptor | ||
91 | limits the maximum control message size. The managament application is | ||
92 | responsible for negotiating a control message size complying with the | ||
93 | requirements in section 9.3.1 of [1], taking this descriptor field | ||
94 | into consideration. | ||
95 | |||
96 | The userspace application can access the CDC MBIM functional | ||
97 | descriptor of a MBIM function using either of the two USB | ||
98 | configuration descriptor kernel interfaces described in [6] or [7]. | ||
99 | |||
100 | See also the ioctl documentation below. | ||
101 | |||
102 | |||
103 | Fragmentation | ||
104 | ------------- | ||
105 | The userspace application is responsible for all control message | ||
106 | fragmentation and defragmentaion, as described in section 9.5 of [1]. | ||
107 | |||
108 | |||
109 | /dev/cdc-wdmX write() | ||
110 | --------------------- | ||
111 | The MBIM control messages from the management application *must not* | ||
112 | exceed the negotiated control message size. | ||
113 | |||
114 | |||
115 | /dev/cdc-wdmX read() | ||
116 | -------------------- | ||
117 | The management application *must* accept control messages of up the | ||
118 | negotiated control message size. | ||
119 | |||
120 | |||
121 | /dev/cdc-wdmX ioctl() | ||
122 | -------------------- | ||
123 | IOCTL_WDM_MAX_COMMAND: Get Maximum Command Size | ||
124 | This ioctl returns the wMaxControlMessage field of the CDC MBIM | ||
125 | functional descriptor for MBIM devices. This is intended as a | ||
126 | convenience, eliminating the need to parse the USB descriptors from | ||
127 | userspace. | ||
128 | |||
129 | #include <stdio.h> | ||
130 | #include <fcntl.h> | ||
131 | #include <sys/ioctl.h> | ||
132 | #include <linux/types.h> | ||
133 | #include <linux/usb/cdc-wdm.h> | ||
134 | int main() | ||
135 | { | ||
136 | __u16 max; | ||
137 | int fd = open("/dev/cdc-wdm0", O_RDWR); | ||
138 | if (!ioctl(fd, IOCTL_WDM_MAX_COMMAND, &max)) | ||
139 | printf("wMaxControlMessage is %d\n", max); | ||
140 | } | ||
141 | |||
142 | |||
143 | Custom device services | ||
144 | ---------------------- | ||
145 | The MBIM specification allows vendors to freely define additional | ||
146 | services. This is fully supported by the cdc_mbim driver. | ||
147 | |||
148 | Support for new MBIM services, including vendor specified services, is | ||
149 | implemented entirely in userspace, like the rest of the MBIM control | ||
150 | protocol | ||
151 | |||
152 | New services should be registered in the MBIM Registry [5]. | ||
153 | |||
154 | |||
155 | |||
156 | MBIM data channel userspace ABI | ||
157 | =============================== | ||
158 | |||
159 | wwanY network device | ||
160 | -------------------- | ||
161 | The cdc_mbim driver represents the MBIM data channel as a single | ||
162 | network device of the "wwan" type. This network device is initially | ||
163 | mapped to MBIM IP session 0. | ||
164 | |||
165 | |||
166 | Multiplexed IP sessions (IPS) | ||
167 | ----------------------------- | ||
168 | MBIM allows multiplexing up to 256 IP sessions over a single USB data | ||
169 | channel. The cdc_mbim driver models such IP sessions as 802.1q VLAN | ||
170 | subdevices of the master wwanY device, mapping MBIM IP session Z to | ||
171 | VLAN ID Z for all values of Z greater than 0. | ||
172 | |||
173 | The device maximum Z is given in the MBIM_DEVICE_CAPS_INFO structure | ||
174 | described in section 10.5.1 of [1]. | ||
175 | |||
176 | The userspace management application is responsible for adding new | ||
177 | VLAN links prior to establishing MBIM IP sessions where the SessionId | ||
178 | is greater than 0. These links can be added by using the normal VLAN | ||
179 | kernel interfaces, either ioctl or netlink. | ||
180 | |||
181 | For example, adding a link for a MBIM IP session with SessionId 3: | ||
182 | |||
183 | ip link add link wwan0 name wwan0.3 type vlan id 3 | ||
184 | |||
185 | The driver will automatically map the "wwan0.3" network device to MBIM | ||
186 | IP session 3. | ||
187 | |||
188 | |||
189 | Device Service Streams (DSS) | ||
190 | ---------------------------- | ||
191 | MBIM also allows up to 256 non-IP data streams to be multiplexed over | ||
192 | the same shared USB data channel. The cdc_mbim driver models these | ||
193 | sessions as another set of 802.1q VLAN subdevices of the master wwanY | ||
194 | device, mapping MBIM DSS session A to VLAN ID (256 + A) for all values | ||
195 | of A. | ||
196 | |||
197 | The device maximum A is given in the MBIM_DEVICE_SERVICES_INFO | ||
198 | structure described in section 10.5.29 of [1]. | ||
199 | |||
200 | The DSS VLAN subdevices are used as a practical interface between the | ||
201 | shared MBIM data channel and a MBIM DSS aware userspace application. | ||
202 | It is not intended to be presented as-is to an end user. The | ||
203 | assumption is that an userspace application initiating a DSS session | ||
204 | also takes care of the necessary framing of the DSS data, presenting | ||
205 | the stream to the end user in an appropriate way for the stream type. | ||
206 | |||
207 | The network device ABI requires a dummy ethernet header for every DSS | ||
208 | data frame being transported. The contents of this header is | ||
209 | arbitrary, with the following exceptions: | ||
210 | - TX frames using an IP protocol (0x0800 or 0x86dd) will be dropped | ||
211 | - RX frames will have the protocol field set to ETH_P_802_3 (but will | ||
212 | not be properly formatted 802.3 frames) | ||
213 | - RX frames will have the destination address set to the hardware | ||
214 | address of the master device | ||
215 | |||
216 | The DSS supporting userspace management application is responsible for | ||
217 | adding the dummy ethernet header on TX and stripping it on RX. | ||
218 | |||
219 | This is a simple example using tools commonly available, exporting | ||
220 | DssSessionId 5 as a pty character device pointed to by a /dev/nmea | ||
221 | symlink: | ||
222 | |||
223 | ip link add link wwan0 name wwan0.dss5 type vlan id 261 | ||
224 | ip link set dev wwan0.dss5 up | ||
225 | socat INTERFACE:wwan0.dss5,type=2 PTY:,echo=0,link=/dev/nmea | ||
226 | |||
227 | This is only an example, most suitable for testing out a DSS | ||
228 | service. Userspace applications supporting specific MBIM DSS services | ||
229 | are expected to use the tools and programming interfaces required by | ||
230 | that service. | ||
231 | |||
232 | Note that adding VLAN links for DSS sessions is entirely optional. A | ||
233 | management application may instead choose to bind a packet socket | ||
234 | directly to the master network device, using the received VLAN tags to | ||
235 | map frames to the correct DSS session and adding 18 byte VLAN ethernet | ||
236 | headers with the appropriate tag on TX. In this case using a socket | ||
237 | filter is recommended, matching only the DSS VLAN subset. This avoid | ||
238 | unnecessary copying of unrelated IP session data to userspace. For | ||
239 | example: | ||
240 | |||
241 | static struct sock_filter dssfilter[] = { | ||
242 | /* use special negative offsets to get VLAN tag */ | ||
243 | BPF_STMT(BPF_LD|BPF_B|BPF_ABS, SKF_AD_OFF + SKF_AD_VLAN_TAG_PRESENT), | ||
244 | BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, 1, 0, 6), /* true */ | ||
245 | |||
246 | /* verify DSS VLAN range */ | ||
247 | BPF_STMT(BPF_LD|BPF_H|BPF_ABS, SKF_AD_OFF + SKF_AD_VLAN_TAG), | ||
248 | BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 256, 0, 4), /* 256 is first DSS VLAN */ | ||
249 | BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 512, 3, 0), /* 511 is last DSS VLAN */ | ||
250 | |||
251 | /* verify ethertype */ | ||
252 | BPF_STMT(BPF_LD|BPF_H|BPF_ABS, 2 * ETH_ALEN), | ||
253 | BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, ETH_P_802_3, 0, 1), | ||
254 | |||
255 | BPF_STMT(BPF_RET|BPF_K, (u_int)-1), /* accept */ | ||
256 | BPF_STMT(BPF_RET|BPF_K, 0), /* ignore */ | ||
257 | }; | ||
258 | |||
259 | |||
260 | |||
261 | Tagged IP session 0 VLAN | ||
262 | ------------------------ | ||
263 | As described above, MBIM IP session 0 is treated as special by the | ||
264 | driver. It is initially mapped to untagged frames on the wwanY | ||
265 | network device. | ||
266 | |||
267 | This mapping implies a few restrictions on multiplexed IPS and DSS | ||
268 | sessions, which may not always be practical: | ||
269 | - no IPS or DSS session can use a frame size greater than the MTU on | ||
270 | IP session 0 | ||
271 | - no IPS or DSS session can be in the up state unless the network | ||
272 | device representing IP session 0 also is up | ||
273 | |||
274 | These problems can be avoided by optionally making the driver map IP | ||
275 | session 0 to a VLAN subdevice, similar to all other IP sessions. This | ||
276 | behaviour is triggered by adding a VLAN link for the magic VLAN ID | ||
277 | 4094. The driver will then immediately start mapping MBIM IP session | ||
278 | 0 to this VLAN, and will drop untagged frames on the master wwanY | ||
279 | device. | ||
280 | |||
281 | Tip: It might be less confusing to the end user to name this VLAN | ||
282 | subdevice after the MBIM SessionID instead of the VLAN ID. For | ||
283 | example: | ||
284 | |||
285 | ip link add link wwan0 name wwan0.0 type vlan id 4094 | ||
286 | |||
287 | |||
288 | VLAN mapping | ||
289 | ------------ | ||
290 | |||
291 | Summarizing the cdc_mbim driver mapping described above, we have this | ||
292 | relationship between VLAN tags on the wwanY network device and MBIM | ||
293 | sessions on the shared USB data channel: | ||
294 | |||
295 | VLAN ID MBIM type MBIM SessionID Notes | ||
296 | --------------------------------------------------------- | ||
297 | untagged IPS 0 a) | ||
298 | 1 - 255 IPS 1 - 255 <VLANID> | ||
299 | 256 - 511 DSS 0 - 255 <VLANID - 256> | ||
300 | 512 - 4093 b) | ||
301 | 4094 IPS 0 c) | ||
302 | |||
303 | a) if no VLAN ID 4094 link exists, else dropped | ||
304 | b) unsupported VLAN range, unconditionally dropped | ||
305 | c) if a VLAN ID 4094 link exists, else dropped | ||
306 | |||
307 | |||
308 | |||
309 | |||
310 | References | ||
311 | ========== | ||
312 | |||
313 | [1] USB Implementers Forum, Inc. - "Universal Serial Bus | ||
314 | Communications Class Subclass Specification for Mobile Broadband | ||
315 | Interface Model", Revision 1.0 (Errata 1), May 1, 2013 | ||
316 | - http://www.usb.org/developers/docs/devclass_docs/ | ||
317 | |||
318 | [2] USB Implementers Forum, Inc. - "Universal Serial Bus | ||
319 | Communications Class Subclass Specifications for Network Control | ||
320 | Model Devices", Revision 1.0 (Errata 1), November 24, 2010 | ||
321 | - http://www.usb.org/developers/docs/devclass_docs/ | ||
322 | |||
323 | [3] libmbim - "a glib-based library for talking to WWAN modems and | ||
324 | devices which speak the Mobile Interface Broadband Model (MBIM) | ||
325 | protocol" | ||
326 | - http://www.freedesktop.org/wiki/Software/libmbim/ | ||
327 | |||
328 | [4] ModemManager - "a DBus-activated daemon which controls mobile | ||
329 | broadband (2G/3G/4G) devices and connections" | ||
330 | - http://www.freedesktop.org/wiki/Software/ModemManager/ | ||
331 | |||
332 | [5] "MBIM (Mobile Broadband Interface Model) Registry" | ||
333 | - http://compliance.usb.org/mbim/ | ||
334 | |||
335 | [6] "/proc/bus/usb filesystem output" | ||
336 | - Documentation/usb/proc_usb_info.txt | ||
337 | |||
338 | [7] "/sys/bus/usb/devices/.../descriptors" | ||
339 | - Documentation/ABI/stable/sysfs-bus-usb | ||
diff --git a/Documentation/networking/filter.txt b/Documentation/networking/filter.txt index e3ba753cb714..ee78eba78a9d 100644 --- a/Documentation/networking/filter.txt +++ b/Documentation/networking/filter.txt | |||
@@ -281,6 +281,7 @@ Possible BPF extensions are shown in the following table: | |||
281 | cpu raw_smp_processor_id() | 281 | cpu raw_smp_processor_id() |
282 | vlan_tci vlan_tx_tag_get(skb) | 282 | vlan_tci vlan_tx_tag_get(skb) |
283 | vlan_pr vlan_tx_tag_present(skb) | 283 | vlan_pr vlan_tx_tag_present(skb) |
284 | rand prandom_u32() | ||
284 | 285 | ||
285 | These extensions can also be prefixed with '#'. | 286 | These extensions can also be prefixed with '#'. |
286 | Examples for low-level BPF: | 287 | Examples for low-level BPF: |
@@ -308,6 +309,18 @@ Examples for low-level BPF: | |||
308 | ret #-1 | 309 | ret #-1 |
309 | drop: ret #0 | 310 | drop: ret #0 |
310 | 311 | ||
312 | ** icmp random packet sampling, 1 in 4 | ||
313 | ldh [12] | ||
314 | jne #0x800, drop | ||
315 | ldb [23] | ||
316 | jneq #1, drop | ||
317 | # get a random uint32 number | ||
318 | ld rand | ||
319 | mod #4 | ||
320 | jneq #1, drop | ||
321 | ret #-1 | ||
322 | drop: ret #0 | ||
323 | |||
311 | ** SECCOMP filter example: | 324 | ** SECCOMP filter example: |
312 | 325 | ||
313 | ld [4] /* offsetof(struct seccomp_data, arch) */ | 326 | ld [4] /* offsetof(struct seccomp_data, arch) */ |
@@ -548,42 +561,43 @@ toolchain for developing and testing the kernel's JIT compiler. | |||
548 | 561 | ||
549 | BPF kernel internals | 562 | BPF kernel internals |
550 | -------------------- | 563 | -------------------- |
551 | Internally, for the kernel interpreter, a different BPF instruction set | 564 | Internally, for the kernel interpreter, a different instruction set |
552 | format with similar underlying principles from BPF described in previous | 565 | format with similar underlying principles from BPF described in previous |
553 | paragraphs is being used. However, the instruction set format is modelled | 566 | paragraphs is being used. However, the instruction set format is modelled |
554 | closer to the underlying architecture to mimic native instruction sets, so | 567 | closer to the underlying architecture to mimic native instruction sets, so |
555 | that a better performance can be achieved (more details later). | 568 | that a better performance can be achieved (more details later). This new |
569 | ISA is called 'eBPF' or 'internal BPF' interchangeably. (Note: eBPF which | ||
570 | originates from [e]xtended BPF is not the same as BPF extensions! While | ||
571 | eBPF is an ISA, BPF extensions date back to classic BPF's 'overloading' | ||
572 | of BPF_LD | BPF_{B,H,W} | BPF_ABS instruction.) | ||
556 | 573 | ||
557 | It is designed to be JITed with one to one mapping, which can also open up | 574 | It is designed to be JITed with one to one mapping, which can also open up |
558 | the possibility for GCC/LLVM compilers to generate optimized BPF code through | 575 | the possibility for GCC/LLVM compilers to generate optimized eBPF code through |
559 | a BPF backend that performs almost as fast as natively compiled code. | 576 | an eBPF backend that performs almost as fast as natively compiled code. |
560 | 577 | ||
561 | The new instruction set was originally designed with the possible goal in | 578 | The new instruction set was originally designed with the possible goal in |
562 | mind to write programs in "restricted C" and compile into BPF with a optional | 579 | mind to write programs in "restricted C" and compile into eBPF with a optional |
563 | GCC/LLVM backend, so that it can just-in-time map to modern 64-bit CPUs with | 580 | GCC/LLVM backend, so that it can just-in-time map to modern 64-bit CPUs with |
564 | minimal performance overhead over two steps, that is, C -> BPF -> native code. | 581 | minimal performance overhead over two steps, that is, C -> eBPF -> native code. |
565 | 582 | ||
566 | Currently, the new format is being used for running user BPF programs, which | 583 | Currently, the new format is being used for running user BPF programs, which |
567 | includes seccomp BPF, classic socket filters, cls_bpf traffic classifier, | 584 | includes seccomp BPF, classic socket filters, cls_bpf traffic classifier, |
568 | team driver's classifier for its load-balancing mode, netfilter's xt_bpf | 585 | team driver's classifier for its load-balancing mode, netfilter's xt_bpf |
569 | extension, PTP dissector/classifier, and much more. They are all internally | 586 | extension, PTP dissector/classifier, and much more. They are all internally |
570 | converted by the kernel into the new instruction set representation and run | 587 | converted by the kernel into the new instruction set representation and run |
571 | in the extended interpreter. For in-kernel handlers, this all works | 588 | in the eBPF interpreter. For in-kernel handlers, this all works transparently |
572 | transparently by using sk_unattached_filter_create() for setting up the | 589 | by using sk_unattached_filter_create() for setting up the filter, resp. |
573 | filter, resp. sk_unattached_filter_destroy() for destroying it. The macro | 590 | sk_unattached_filter_destroy() for destroying it. The macro |
574 | SK_RUN_FILTER(filter, ctx) transparently invokes the right BPF function to | 591 | SK_RUN_FILTER(filter, ctx) transparently invokes eBPF interpreter or JITed |
575 | run the filter. 'filter' is a pointer to struct sk_filter that we got from | 592 | code to run the filter. 'filter' is a pointer to struct sk_filter that we |
576 | sk_unattached_filter_create(), and 'ctx' the given context (e.g. skb pointer). | 593 | got from sk_unattached_filter_create(), and 'ctx' the given context (e.g. |
577 | All constraints and restrictions from sk_chk_filter() apply before a | 594 | skb pointer). All constraints and restrictions from sk_chk_filter() apply |
578 | conversion to the new layout is being done behind the scenes! | 595 | before a conversion to the new layout is being done behind the scenes! |
579 | 596 | ||
580 | Currently, for JITing, the user BPF format is being used and current BPF JIT | 597 | Currently, the classic BPF format is being used for JITing on most of the |
581 | compilers reused whenever possible. In other words, we do not (yet!) perform | 598 | architectures. Only x86-64 performs JIT compilation from eBPF instruction set, |
582 | a JIT compilation in the new layout, however, future work will successively | 599 | however, future work will migrate other JIT compilers as well, so that they |
583 | migrate traditional JIT compilers into the new instruction format as well, so | 600 | will profit from the very same benefits. |
584 | that they will profit from the very same benefits. Thus, when speaking about | ||
585 | JIT in the following, a JIT compiler (TBD) for the new instruction format is | ||
586 | meant in this context. | ||
587 | 601 | ||
588 | Some core changes of the new internal format: | 602 | Some core changes of the new internal format: |
589 | 603 | ||
@@ -592,35 +606,35 @@ Some core changes of the new internal format: | |||
592 | The old format had two registers A and X, and a hidden frame pointer. The | 606 | The old format had two registers A and X, and a hidden frame pointer. The |
593 | new layout extends this to be 10 internal registers and a read-only frame | 607 | new layout extends this to be 10 internal registers and a read-only frame |
594 | pointer. Since 64-bit CPUs are passing arguments to functions via registers | 608 | pointer. Since 64-bit CPUs are passing arguments to functions via registers |
595 | the number of args from BPF program to in-kernel function is restricted | 609 | the number of args from eBPF program to in-kernel function is restricted |
596 | to 5 and one register is used to accept return value from an in-kernel | 610 | to 5 and one register is used to accept return value from an in-kernel |
597 | function. Natively, x86_64 passes first 6 arguments in registers, aarch64/ | 611 | function. Natively, x86_64 passes first 6 arguments in registers, aarch64/ |
598 | sparcv9/mips64 have 7 - 8 registers for arguments; x86_64 has 6 callee saved | 612 | sparcv9/mips64 have 7 - 8 registers for arguments; x86_64 has 6 callee saved |
599 | registers, and aarch64/sparcv9/mips64 have 11 or more callee saved registers. | 613 | registers, and aarch64/sparcv9/mips64 have 11 or more callee saved registers. |
600 | 614 | ||
601 | Therefore, BPF calling convention is defined as: | 615 | Therefore, eBPF calling convention is defined as: |
602 | 616 | ||
603 | * R0 - return value from in-kernel function | 617 | * R0 - return value from in-kernel function, and exit value for eBPF program |
604 | * R1 - R5 - arguments from BPF program to in-kernel function | 618 | * R1 - R5 - arguments from eBPF program to in-kernel function |
605 | * R6 - R9 - callee saved registers that in-kernel function will preserve | 619 | * R6 - R9 - callee saved registers that in-kernel function will preserve |
606 | * R10 - read-only frame pointer to access stack | 620 | * R10 - read-only frame pointer to access stack |
607 | 621 | ||
608 | Thus, all BPF registers map one to one to HW registers on x86_64, aarch64, | 622 | Thus, all eBPF registers map one to one to HW registers on x86_64, aarch64, |
609 | etc, and BPF calling convention maps directly to ABIs used by the kernel on | 623 | etc, and eBPF calling convention maps directly to ABIs used by the kernel on |
610 | 64-bit architectures. | 624 | 64-bit architectures. |
611 | 625 | ||
612 | On 32-bit architectures JIT may map programs that use only 32-bit arithmetic | 626 | On 32-bit architectures JIT may map programs that use only 32-bit arithmetic |
613 | and may let more complex programs to be interpreted. | 627 | and may let more complex programs to be interpreted. |
614 | 628 | ||
615 | R0 - R5 are scratch registers and BPF program needs spill/fill them if | 629 | R0 - R5 are scratch registers and eBPF program needs spill/fill them if |
616 | necessary across calls. Note that there is only one BPF program (== one BPF | 630 | necessary across calls. Note that there is only one eBPF program (== one |
617 | main routine) and it cannot call other BPF functions, it can only call | 631 | eBPF main routine) and it cannot call other eBPF functions, it can only |
618 | predefined in-kernel functions, though. | 632 | call predefined in-kernel functions, though. |
619 | 633 | ||
620 | - Register width increases from 32-bit to 64-bit: | 634 | - Register width increases from 32-bit to 64-bit: |
621 | 635 | ||
622 | Still, the semantics of the original 32-bit ALU operations are preserved | 636 | Still, the semantics of the original 32-bit ALU operations are preserved |
623 | via 32-bit subregisters. All BPF registers are 64-bit with 32-bit lower | 637 | via 32-bit subregisters. All eBPF registers are 64-bit with 32-bit lower |
624 | subregisters that zero-extend into 64-bit if they are being written to. | 638 | subregisters that zero-extend into 64-bit if they are being written to. |
625 | That behavior maps directly to x86_64 and arm64 subregister definition, but | 639 | That behavior maps directly to x86_64 and arm64 subregister definition, but |
626 | makes other JITs more difficult. | 640 | makes other JITs more difficult. |
@@ -631,8 +645,8 @@ Some core changes of the new internal format: | |||
631 | 645 | ||
632 | Operation is 64-bit, because on 64-bit architectures, pointers are also | 646 | Operation is 64-bit, because on 64-bit architectures, pointers are also |
633 | 64-bit wide, and we want to pass 64-bit values in/out of kernel functions, | 647 | 64-bit wide, and we want to pass 64-bit values in/out of kernel functions, |
634 | so 32-bit BPF registers would otherwise require to define register-pair | 648 | so 32-bit eBPF registers would otherwise require to define register-pair |
635 | ABI, thus, there won't be able to use a direct BPF register to HW register | 649 | ABI, thus, there won't be able to use a direct eBPF register to HW register |
636 | mapping and JIT would need to do combine/split/move operations for every | 650 | mapping and JIT would need to do combine/split/move operations for every |
637 | register in and out of the function, which is complex, bug prone and slow. | 651 | register in and out of the function, which is complex, bug prone and slow. |
638 | Another reason is the use of atomic 64-bit counters. | 652 | Another reason is the use of atomic 64-bit counters. |
@@ -646,14 +660,145 @@ Some core changes of the new internal format: | |||
646 | - Introduces bpf_call insn and register passing convention for zero overhead | 660 | - Introduces bpf_call insn and register passing convention for zero overhead |
647 | calls from/to other kernel functions: | 661 | calls from/to other kernel functions: |
648 | 662 | ||
649 | After a kernel function call, R1 - R5 are reset to unreadable and R0 has a | 663 | Before an in-kernel function call, the internal BPF program needs to |
650 | return type of the function. Since R6 - R9 are callee saved, their state is | 664 | place function arguments into R1 to R5 registers to satisfy calling |
651 | preserved across the call. | 665 | convention, then the interpreter will take them from registers and pass |
652 | 666 | to in-kernel function. If R1 - R5 registers are mapped to CPU registers | |
653 | Also in the new design, BPF is limited to 4096 insns, which means that any | 667 | that are used for argument passing on given architecture, the JIT compiler |
668 | doesn't need to emit extra moves. Function arguments will be in the correct | ||
669 | registers and BPF_CALL instruction will be JITed as single 'call' HW | ||
670 | instruction. This calling convention was picked to cover common call | ||
671 | situations without performance penalty. | ||
672 | |||
673 | After an in-kernel function call, R1 - R5 are reset to unreadable and R0 has | ||
674 | a return value of the function. Since R6 - R9 are callee saved, their state | ||
675 | is preserved across the call. | ||
676 | |||
677 | For example, consider three C functions: | ||
678 | |||
679 | u64 f1() { return (*_f2)(1); } | ||
680 | u64 f2(u64 a) { return f3(a + 1, a); } | ||
681 | u64 f3(u64 a, u64 b) { return a - b; } | ||
682 | |||
683 | GCC can compile f1, f3 into x86_64: | ||
684 | |||
685 | f1: | ||
686 | movl $1, %edi | ||
687 | movq _f2(%rip), %rax | ||
688 | jmp *%rax | ||
689 | f3: | ||
690 | movq %rdi, %rax | ||
691 | subq %rsi, %rax | ||
692 | ret | ||
693 | |||
694 | Function f2 in eBPF may look like: | ||
695 | |||
696 | f2: | ||
697 | bpf_mov R2, R1 | ||
698 | bpf_add R1, 1 | ||
699 | bpf_call f3 | ||
700 | bpf_exit | ||
701 | |||
702 | If f2 is JITed and the pointer stored to '_f2'. The calls f1 -> f2 -> f3 and | ||
703 | returns will be seamless. Without JIT, __sk_run_filter() interpreter needs to | ||
704 | be used to call into f2. | ||
705 | |||
706 | For practical reasons all eBPF programs have only one argument 'ctx' which is | ||
707 | already placed into R1 (e.g. on __sk_run_filter() startup) and the programs | ||
708 | can call kernel functions with up to 5 arguments. Calls with 6 or more arguments | ||
709 | are currently not supported, but these restrictions can be lifted if necessary | ||
710 | in the future. | ||
711 | |||
712 | On 64-bit architectures all register map to HW registers one to one. For | ||
713 | example, x86_64 JIT compiler can map them as ... | ||
714 | |||
715 | R0 - rax | ||
716 | R1 - rdi | ||
717 | R2 - rsi | ||
718 | R3 - rdx | ||
719 | R4 - rcx | ||
720 | R5 - r8 | ||
721 | R6 - rbx | ||
722 | R7 - r13 | ||
723 | R8 - r14 | ||
724 | R9 - r15 | ||
725 | R10 - rbp | ||
726 | |||
727 | ... since x86_64 ABI mandates rdi, rsi, rdx, rcx, r8, r9 for argument passing | ||
728 | and rbx, r12 - r15 are callee saved. | ||
729 | |||
730 | Then the following internal BPF pseudo-program: | ||
731 | |||
732 | bpf_mov R6, R1 /* save ctx */ | ||
733 | bpf_mov R2, 2 | ||
734 | bpf_mov R3, 3 | ||
735 | bpf_mov R4, 4 | ||
736 | bpf_mov R5, 5 | ||
737 | bpf_call foo | ||
738 | bpf_mov R7, R0 /* save foo() return value */ | ||
739 | bpf_mov R1, R6 /* restore ctx for next call */ | ||
740 | bpf_mov R2, 6 | ||
741 | bpf_mov R3, 7 | ||
742 | bpf_mov R4, 8 | ||
743 | bpf_mov R5, 9 | ||
744 | bpf_call bar | ||
745 | bpf_add R0, R7 | ||
746 | bpf_exit | ||
747 | |||
748 | After JIT to x86_64 may look like: | ||
749 | |||
750 | push %rbp | ||
751 | mov %rsp,%rbp | ||
752 | sub $0x228,%rsp | ||
753 | mov %rbx,-0x228(%rbp) | ||
754 | mov %r13,-0x220(%rbp) | ||
755 | mov %rdi,%rbx | ||
756 | mov $0x2,%esi | ||
757 | mov $0x3,%edx | ||
758 | mov $0x4,%ecx | ||
759 | mov $0x5,%r8d | ||
760 | callq foo | ||
761 | mov %rax,%r13 | ||
762 | mov %rbx,%rdi | ||
763 | mov $0x2,%esi | ||
764 | mov $0x3,%edx | ||
765 | mov $0x4,%ecx | ||
766 | mov $0x5,%r8d | ||
767 | callq bar | ||
768 | add %r13,%rax | ||
769 | mov -0x228(%rbp),%rbx | ||
770 | mov -0x220(%rbp),%r13 | ||
771 | leaveq | ||
772 | retq | ||
773 | |||
774 | Which is in this example equivalent in C to: | ||
775 | |||
776 | u64 bpf_filter(u64 ctx) | ||
777 | { | ||
778 | return foo(ctx, 2, 3, 4, 5) + bar(ctx, 6, 7, 8, 9); | ||
779 | } | ||
780 | |||
781 | In-kernel functions foo() and bar() with prototype: u64 (*)(u64 arg1, u64 | ||
782 | arg2, u64 arg3, u64 arg4, u64 arg5); will receive arguments in proper | ||
783 | registers and place their return value into '%rax' which is R0 in eBPF. | ||
784 | Prologue and epilogue are emitted by JIT and are implicit in the | ||
785 | interpreter. R0-R5 are scratch registers, so eBPF program needs to preserve | ||
786 | them across the calls as defined by calling convention. | ||
787 | |||
788 | For example the following program is invalid: | ||
789 | |||
790 | bpf_mov R1, 1 | ||
791 | bpf_call foo | ||
792 | bpf_mov R0, R1 | ||
793 | bpf_exit | ||
794 | |||
795 | After the call the registers R1-R5 contain junk values and cannot be read. | ||
796 | In the future an eBPF verifier can be used to validate internal BPF programs. | ||
797 | |||
798 | Also in the new design, eBPF is limited to 4096 insns, which means that any | ||
654 | program will terminate quickly and will only call a fixed number of kernel | 799 | program will terminate quickly and will only call a fixed number of kernel |
655 | functions. Original BPF and the new format are two operand instructions, | 800 | functions. Original BPF and the new format are two operand instructions, |
656 | which helps to do one-to-one mapping between BPF insn and x86 insn during JIT. | 801 | which helps to do one-to-one mapping between eBPF insn and x86 insn during JIT. |
657 | 802 | ||
658 | The input context pointer for invoking the interpreter function is generic, | 803 | The input context pointer for invoking the interpreter function is generic, |
659 | its content is defined by a specific use case. For seccomp register R1 points | 804 | its content is defined by a specific use case. For seccomp register R1 points |
@@ -661,7 +806,26 @@ to seccomp_data, for converted BPF filters R1 points to a skb. | |||
661 | 806 | ||
662 | A program, that is translated internally consists of the following elements: | 807 | A program, that is translated internally consists of the following elements: |
663 | 808 | ||
664 | op:16, jt:8, jf:8, k:32 ==> op:8, a_reg:4, x_reg:4, off:16, imm:32 | 809 | op:16, jt:8, jf:8, k:32 ==> op:8, dst_reg:4, src_reg:4, off:16, imm:32 |
810 | |||
811 | So far 87 internal BPF instructions were implemented. 8-bit 'op' opcode field | ||
812 | has room for new instructions. Some of them may use 16/24/32 byte encoding. New | ||
813 | instructions must be multiple of 8 bytes to preserve backward compatibility. | ||
814 | |||
815 | Internal BPF is a general purpose RISC instruction set. Not every register and | ||
816 | every instruction are used during translation from original BPF to new format. | ||
817 | For example, socket filters are not using 'exclusive add' instruction, but | ||
818 | tracing filters may do to maintain counters of events, for example. Register R9 | ||
819 | is not used by socket filters either, but more complex filters may be running | ||
820 | out of registers and would have to resort to spill/fill to stack. | ||
821 | |||
822 | Internal BPF can used as generic assembler for last step performance | ||
823 | optimizations, socket filters and seccomp are using it as assembler. Tracing | ||
824 | filters may use it as assembler to generate code from kernel. In kernel usage | ||
825 | may not be bounded by security considerations, since generated internal BPF code | ||
826 | may be optimizing internal code path and not being exposed to the user space. | ||
827 | Safety of internal BPF can come from a verifier (TBD). In such use cases as | ||
828 | described, it may be used as safe instruction set. | ||
665 | 829 | ||
666 | Just like the original BPF, the new format runs within a controlled environment, | 830 | Just like the original BPF, the new format runs within a controlled environment, |
667 | is deterministic and the kernel can easily prove that. The safety of the program | 831 | is deterministic and the kernel can easily prove that. The safety of the program |
@@ -670,6 +834,181 @@ loops and other CFG validation; second step starts from the first insn and | |||
670 | descends all possible paths. It simulates execution of every insn and observes | 834 | descends all possible paths. It simulates execution of every insn and observes |
671 | the state change of registers and stack. | 835 | the state change of registers and stack. |
672 | 836 | ||
837 | eBPF opcode encoding | ||
838 | -------------------- | ||
839 | |||
840 | eBPF is reusing most of the opcode encoding from classic to simplify conversion | ||
841 | of classic BPF to eBPF. For arithmetic and jump instructions the 8-bit 'code' | ||
842 | field is divided into three parts: | ||
843 | |||
844 | +----------------+--------+--------------------+ | ||
845 | | 4 bits | 1 bit | 3 bits | | ||
846 | | operation code | source | instruction class | | ||
847 | +----------------+--------+--------------------+ | ||
848 | (MSB) (LSB) | ||
849 | |||
850 | Three LSB bits store instruction class which is one of: | ||
851 | |||
852 | Classic BPF classes: eBPF classes: | ||
853 | |||
854 | BPF_LD 0x00 BPF_LD 0x00 | ||
855 | BPF_LDX 0x01 BPF_LDX 0x01 | ||
856 | BPF_ST 0x02 BPF_ST 0x02 | ||
857 | BPF_STX 0x03 BPF_STX 0x03 | ||
858 | BPF_ALU 0x04 BPF_ALU 0x04 | ||
859 | BPF_JMP 0x05 BPF_JMP 0x05 | ||
860 | BPF_RET 0x06 [ class 6 unused, for future if needed ] | ||
861 | BPF_MISC 0x07 BPF_ALU64 0x07 | ||
862 | |||
863 | When BPF_CLASS(code) == BPF_ALU or BPF_JMP, 4th bit encodes source operand ... | ||
864 | |||
865 | BPF_K 0x00 | ||
866 | BPF_X 0x08 | ||
867 | |||
868 | * in classic BPF, this means: | ||
869 | |||
870 | BPF_SRC(code) == BPF_X - use register X as source operand | ||
871 | BPF_SRC(code) == BPF_K - use 32-bit immediate as source operand | ||
872 | |||
873 | * in eBPF, this means: | ||
874 | |||
875 | BPF_SRC(code) == BPF_X - use 'src_reg' register as source operand | ||
876 | BPF_SRC(code) == BPF_K - use 32-bit immediate as source operand | ||
877 | |||
878 | ... and four MSB bits store operation code. | ||
879 | |||
880 | If BPF_CLASS(code) == BPF_ALU or BPF_ALU64 [ in eBPF ], BPF_OP(code) is one of: | ||
881 | |||
882 | BPF_ADD 0x00 | ||
883 | BPF_SUB 0x10 | ||
884 | BPF_MUL 0x20 | ||
885 | BPF_DIV 0x30 | ||
886 | BPF_OR 0x40 | ||
887 | BPF_AND 0x50 | ||
888 | BPF_LSH 0x60 | ||
889 | BPF_RSH 0x70 | ||
890 | BPF_NEG 0x80 | ||
891 | BPF_MOD 0x90 | ||
892 | BPF_XOR 0xa0 | ||
893 | BPF_MOV 0xb0 /* eBPF only: mov reg to reg */ | ||
894 | BPF_ARSH 0xc0 /* eBPF only: sign extending shift right */ | ||
895 | BPF_END 0xd0 /* eBPF only: endianness conversion */ | ||
896 | |||
897 | If BPF_CLASS(code) == BPF_JMP, BPF_OP(code) is one of: | ||
898 | |||
899 | BPF_JA 0x00 | ||
900 | BPF_JEQ 0x10 | ||
901 | BPF_JGT 0x20 | ||
902 | BPF_JGE 0x30 | ||
903 | BPF_JSET 0x40 | ||
904 | BPF_JNE 0x50 /* eBPF only: jump != */ | ||
905 | BPF_JSGT 0x60 /* eBPF only: signed '>' */ | ||
906 | BPF_JSGE 0x70 /* eBPF only: signed '>=' */ | ||
907 | BPF_CALL 0x80 /* eBPF only: function call */ | ||
908 | BPF_EXIT 0x90 /* eBPF only: function return */ | ||
909 | |||
910 | So BPF_ADD | BPF_X | BPF_ALU means 32-bit addition in both classic BPF | ||
911 | and eBPF. There are only two registers in classic BPF, so it means A += X. | ||
912 | In eBPF it means dst_reg = (u32) dst_reg + (u32) src_reg; similarly, | ||
913 | BPF_XOR | BPF_K | BPF_ALU means A ^= imm32 in classic BPF and analogous | ||
914 | src_reg = (u32) src_reg ^ (u32) imm32 in eBPF. | ||
915 | |||
916 | Classic BPF is using BPF_MISC class to represent A = X and X = A moves. | ||
917 | eBPF is using BPF_MOV | BPF_X | BPF_ALU code instead. Since there are no | ||
918 | BPF_MISC operations in eBPF, the class 7 is used as BPF_ALU64 to mean | ||
919 | exactly the same operations as BPF_ALU, but with 64-bit wide operands | ||
920 | instead. So BPF_ADD | BPF_X | BPF_ALU64 means 64-bit addition, i.e.: | ||
921 | dst_reg = dst_reg + src_reg | ||
922 | |||
923 | Classic BPF wastes the whole BPF_RET class to represent a single 'ret' | ||
924 | operation. Classic BPF_RET | BPF_K means copy imm32 into return register | ||
925 | and perform function exit. eBPF is modeled to match CPU, so BPF_JMP | BPF_EXIT | ||
926 | in eBPF means function exit only. The eBPF program needs to store return | ||
927 | value into register R0 before doing a BPF_EXIT. Class 6 in eBPF is currently | ||
928 | unused and reserved for future use. | ||
929 | |||
930 | For load and store instructions the 8-bit 'code' field is divided as: | ||
931 | |||
932 | +--------+--------+-------------------+ | ||
933 | | 3 bits | 2 bits | 3 bits | | ||
934 | | mode | size | instruction class | | ||
935 | +--------+--------+-------------------+ | ||
936 | (MSB) (LSB) | ||
937 | |||
938 | Size modifier is one of ... | ||
939 | |||
940 | BPF_W 0x00 /* word */ | ||
941 | BPF_H 0x08 /* half word */ | ||
942 | BPF_B 0x10 /* byte */ | ||
943 | BPF_DW 0x18 /* eBPF only, double word */ | ||
944 | |||
945 | ... which encodes size of load/store operation: | ||
946 | |||
947 | B - 1 byte | ||
948 | H - 2 byte | ||
949 | W - 4 byte | ||
950 | DW - 8 byte (eBPF only) | ||
951 | |||
952 | Mode modifier is one of: | ||
953 | |||
954 | BPF_IMM 0x00 /* classic BPF only, reserved in eBPF */ | ||
955 | BPF_ABS 0x20 | ||
956 | BPF_IND 0x40 | ||
957 | BPF_MEM 0x60 | ||
958 | BPF_LEN 0x80 /* classic BPF only, reserved in eBPF */ | ||
959 | BPF_MSH 0xa0 /* classic BPF only, reserved in eBPF */ | ||
960 | BPF_XADD 0xc0 /* eBPF only, exclusive add */ | ||
961 | |||
962 | eBPF has two non-generic instructions: (BPF_ABS | <size> | BPF_LD) and | ||
963 | (BPF_IND | <size> | BPF_LD) which are used to access packet data. | ||
964 | |||
965 | They had to be carried over from classic to have strong performance of | ||
966 | socket filters running in eBPF interpreter. These instructions can only | ||
967 | be used when interpreter context is a pointer to 'struct sk_buff' and | ||
968 | have seven implicit operands. Register R6 is an implicit input that must | ||
969 | contain pointer to sk_buff. Register R0 is an implicit output which contains | ||
970 | the data fetched from the packet. Registers R1-R5 are scratch registers | ||
971 | and must not be used to store the data across BPF_ABS | BPF_LD or | ||
972 | BPF_IND | BPF_LD instructions. | ||
973 | |||
974 | These instructions have implicit program exit condition as well. When | ||
975 | eBPF program is trying to access the data beyond the packet boundary, | ||
976 | the interpreter will abort the execution of the program. JIT compilers | ||
977 | therefore must preserve this property. src_reg and imm32 fields are | ||
978 | explicit inputs to these instructions. | ||
979 | |||
980 | For example: | ||
981 | |||
982 | BPF_IND | BPF_W | BPF_LD means: | ||
983 | |||
984 | R0 = ntohl(*(u32 *) (((struct sk_buff *) R6)->data + src_reg + imm32)) | ||
985 | and R1 - R5 were scratched. | ||
986 | |||
987 | Unlike classic BPF instruction set, eBPF has generic load/store operations: | ||
988 | |||
989 | BPF_MEM | <size> | BPF_STX: *(size *) (dst_reg + off) = src_reg | ||
990 | BPF_MEM | <size> | BPF_ST: *(size *) (dst_reg + off) = imm32 | ||
991 | BPF_MEM | <size> | BPF_LDX: dst_reg = *(size *) (src_reg + off) | ||
992 | BPF_XADD | BPF_W | BPF_STX: lock xadd *(u32 *)(dst_reg + off16) += src_reg | ||
993 | BPF_XADD | BPF_DW | BPF_STX: lock xadd *(u64 *)(dst_reg + off16) += src_reg | ||
994 | |||
995 | Where size is one of: BPF_B or BPF_H or BPF_W or BPF_DW. Note that 1 and | ||
996 | 2 byte atomic increments are not supported. | ||
997 | |||
998 | Testing | ||
999 | ------- | ||
1000 | |||
1001 | Next to the BPF toolchain, the kernel also ships a test module that contains | ||
1002 | various test cases for classic and internal BPF that can be executed against | ||
1003 | the BPF interpreter and JIT compiler. It can be found in lib/test_bpf.c and | ||
1004 | enabled via Kconfig: | ||
1005 | |||
1006 | CONFIG_TEST_BPF=m | ||
1007 | |||
1008 | After the module has been built and installed, the test suite can be executed | ||
1009 | via insmod or modprobe against 'test_bpf' module. Results of the test cases | ||
1010 | including timings in nsec can be found in the kernel log (dmesg). | ||
1011 | |||
673 | Misc | 1012 | Misc |
674 | ---- | 1013 | ---- |
675 | 1014 | ||
diff --git a/Documentation/power/suspend-and-cpuhotplug.txt b/Documentation/power/suspend-and-cpuhotplug.txt index e13dafc8e8f1..2850df3bf957 100644 --- a/Documentation/power/suspend-and-cpuhotplug.txt +++ b/Documentation/power/suspend-and-cpuhotplug.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | Interaction of Suspend code (S3) with the CPU hotplug infrastructure | 1 | Interaction of Suspend code (S3) with the CPU hotplug infrastructure |
2 | 2 | ||
3 | (C) 2011 Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> | 3 | (C) 2011 - 2014 Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> |
4 | 4 | ||
5 | 5 | ||
6 | I. How does the regular CPU hotplug code differ from how the Suspend-to-RAM | 6 | I. How does the regular CPU hotplug code differ from how the Suspend-to-RAM |