]>
Commit | Line | Data |
---|---|---|
f6908fc6 AM |
1 | diff -Nru a/CREDITS b/CREDITS |
2 | --- a/CREDITS Wed Aug 20 04:45:18 2003 | |
3 | +++ b/CREDITS Tue Sep 2 11:40:27 2003 | |
4 | @@ -281,6 +281,14 @@ | |
5 | S: Greenbelt, Maryland 20771 | |
6 | S: USA | |
7 | ||
8 | +N: Daniele Bellucci | |
9 | +E: bellucda@tiscali.it | |
10 | +D: Various Janitor work. | |
11 | +W: http://web.tiscali.it/bellucda | |
12 | +S: Via Delle Palme, 9 | |
13 | +S: Terni 05100 | |
14 | +S: Italy | |
15 | + | |
16 | N: Randolph Bentson | |
17 | E: bentson@grieg.seaslug.org | |
18 | W: http://www.aa.net/~bentson/ | |
19 | @@ -1279,14 +1287,13 @@ | |
20 | ||
21 | N: Christoph Hellwig | |
22 | E: hch@infradead.org | |
23 | -E: hch@sgi.com | |
24 | D: all kinds of driver, filesystem & core kernel hacking | |
25 | D: freevxfs driver | |
26 | D: sysvfs maintainer | |
27 | D: chief codingstyle nitpicker | |
28 | -S: Auweg 38 | |
29 | -S: 85748 Garching | |
30 | -S: Germany | |
31 | +S: Ampferstr. 50 / 4 | |
32 | +S: 6020 Innsbruck | |
33 | +S: Austria | |
34 | ||
35 | N: Richard Henderson | |
36 | E: rth@twiddle.net | |
37 | diff -Nru a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl | |
38 | --- a/Documentation/DocBook/kernel-locking.tmpl Thu Dec 5 18:56:55 2002 | |
39 | +++ b/Documentation/DocBook/kernel-locking.tmpl Sun Aug 31 16:14:01 2003 | |
40 | @@ -463,7 +463,7 @@ | |
41 | <function>spin_lock_irqsave()</function> | |
42 | (<filename>include/linux/spinlock.h</filename>) is a variant | |
43 | which saves whether interrupts were on or off in a flags word, | |
44 | - which is passed to <function>spin_lock_irqrestore()</function>. This | |
45 | + which is passed to <function>spin_unlock_irqrestore()</function>. This | |
46 | means that the same code can be used inside an hard irq handler (where | |
47 | interrupts are already off) and in softirqs (where the irq | |
48 | disabling is required). | |
49 | diff -Nru a/Documentation/DocBook/writing_usb_driver.tmpl b/Documentation/DocBook/writing_usb_driver.tmpl | |
50 | --- a/Documentation/DocBook/writing_usb_driver.tmpl Tue Oct 29 09:47:57 2002 | |
51 | +++ b/Documentation/DocBook/writing_usb_driver.tmpl Wed Aug 20 09:40:22 2003 | |
52 | @@ -111,12 +111,12 @@ | |
53 | </para> | |
54 | <programlisting> | |
55 | static struct usb_driver skel_driver = { | |
56 | - name: "skeleton", | |
57 | - probe: skel_probe, | |
58 | - disconnect: skel_disconnect, | |
59 | - fops: &skel_fops, | |
60 | - minor: USB_SKEL_MINOR_BASE, | |
61 | - id_table: skel_table, | |
62 | + .name = "skeleton", | |
63 | + .probe = skel_probe, | |
64 | + .disconnect = skel_disconnect, | |
65 | + .fops = &skel_fops, | |
66 | + .minor = USB_SKEL_MINOR_BASE, | |
67 | + .id_table = skel_table, | |
68 | }; | |
69 | </programlisting> | |
70 | <para> | |
71 | @@ -202,41 +202,21 @@ | |
72 | are passed to the function: | |
73 | </para> | |
74 | <programlisting> | |
75 | -static void * skel_probe(struct usb_device *dev, | |
76 | -unsigned int ifnum, const struct usb_device_id *id) | |
77 | +static int skel_probe(struct usb_interface *interface, | |
78 | + const struct usb_device_id *id) | |
79 | </programlisting> | |
80 | <para> | |
81 | The driver now needs to verify that this device is actually one that it | |
82 | - can accept. If not, or if any error occurs during initialization, a NULL | |
83 | - value is returned from the probe function. Otherwise a pointer to a | |
84 | - private data structure containing the driver's state for this device is | |
85 | - returned. That pointer is stored in the usb_device structure, and all | |
86 | - callbacks to the driver pass that pointer. | |
87 | + can accept. If so, it returns 0. | |
88 | + If not, or if any error occurs during initialization, an errorcode | |
89 | + (such as <literal>-ENOMEM<literal> or <literal>-ENODEV<literal>) | |
90 | + is returned from the probe function. | |
91 | </para> | |
92 | <para> | |
93 | In the skeleton driver, we determine what end points are marked as bulk-in | |
94 | and bulk-out. We create buffers to hold the data that will be sent and | |
95 | received from the device, and a USB urb to write data to the device is | |
96 | - initialized. Also, we register the device with the devfs subsystem, | |
97 | - allowing users of devfs to access our device. That registration looks like | |
98 | - the following: | |
99 | - </para> | |
100 | - <programlisting> | |
101 | -/* initialize the devfs node for this device and register it */ | |
102 | -sprintf(name, "skel%d", skel->minor); | |
103 | -skel->devfs = devfs_register (usb_devfs_handle, | |
104 | - name, | |
105 | - DEVFS_FL_DEFAULT, | |
106 | - USB_MAJOR, | |
107 | - USB_SKEL_MINOR_BASE + skel->minor, | |
108 | - S_IFCHR | S_IRUSR | S_IWUSR | | |
109 | - S_IRGRP | S_IWGRP | S_IROTH, | |
110 | - &skel_fops, | |
111 | - NULL); | |
112 | - </programlisting> | |
113 | - <para> | |
114 | - If the devfs_register function fails, we do not care, as the devfs | |
115 | - subsystem will report this to the user. | |
116 | + initialized. | |
117 | </para> | |
118 | <para> | |
119 | Conversely, when the device is removed from the USB bus, the disconnect | |
120 | @@ -254,23 +234,18 @@ | |
121 | the device, any of the functions in the file_operations structure that | |
122 | were passed to the USB subsystem will be called from a user program trying | |
123 | to talk to the device. The first function called will be open, as the | |
124 | - program tries to open the device for I/O. Within the skeleton driver's | |
125 | - open function we increment the driver's usage count if it is a module with | |
126 | - a call to MODULE_INC_USE_COUNT. With this macro call, if the driver is | |
127 | - compiled as a module, the driver cannot be unloaded until a corresponding | |
128 | - MODULE_DEC_USE_COUNT macro is called. We also increment our private usage | |
129 | + program tries to open the device for I/O. We increment our private usage | |
130 | count and save off a pointer to our internal structure in the file | |
131 | structure. This is done so that future calls to file operations will | |
132 | - enable the driver to determine which device the user is addressing. All of | |
133 | - this is done with the following code: | |
134 | + enable the driver to determine which device the user is addressing. All | |
135 | + of this is done with the following code: | |
136 | </para> | |
137 | <programlisting> | |
138 | /* increment our usage count for the module */ | |
139 | -MOD_INC_USE_COUNT; | |
140 | ++skel->open_count; | |
141 | ||
142 | /* save our object in the file's private structure */ | |
143 | -file->private_data = skel; | |
144 | +file->private_data = dev; | |
145 | </programlisting> | |
146 | <para> | |
147 | After the open function is called, the read and write functions are called | |
148 | @@ -349,75 +324,47 @@ | |
149 | </para> | |
150 | <para> | |
151 | When the user program releases the file handle that it has been using to | |
152 | - talk to the device, the release function in the driver is called. In this | |
153 | - function we decrement the module usage count with a call to | |
154 | - MOD_DEC_USE_COUNT (to match our previous call to MOD_INC_USE_COUNT). We | |
155 | - also determine if there are any other programs that are currently talking | |
156 | - to the device (a device may be opened by more than one program at one | |
157 | - time). If this is the last user of the device, then we shut down any | |
158 | - possible pending writes that might be currently occurring. This is all | |
159 | - done with: | |
160 | - </para> | |
161 | + talk to the device, the release function in the driver is called. In this | |
162 | + function we decrement our private usage count and wait for possible | |
163 | + pending writes: | |
164 | <programlisting> | |
165 | /* decrement our usage count for the device */ | |
166 | --skel->open_count; | |
167 | -if (skel->open_count <= 0) { | |
168 | - /* shutdown any bulk writes that might be going on */ | |
169 | - usb_unlink_urb (skel->write_urb); | |
170 | - skel->open_count = 0; | |
171 | -} | |
172 | -/* decrement our usage count for the module */ | |
173 | -MOD_DEC_USE_COUNT; | |
174 | </programlisting> | |
175 | <para> | |
176 | One of the more difficult problems that USB drivers must be able to handle | |
177 | smoothly is the fact that the USB device may be removed from the system at | |
178 | any point in time, even if a program is currently talking to it. It needs | |
179 | to be able to shut down any current reads and writes and notify the | |
180 | - user-space programs that the device is no longer there. The following | |
181 | - code is an example of how to do this: </para> | |
182 | + user-space programs that the device is no longer there. The following | |
183 | + code (function <function>skel_delete</function>) | |
184 | + is an example of how to do this: </para> | |
185 | <programlisting> | |
186 | -/* if the device is not opened, then we clean right now */ | |
187 | -if (skel->open_count) { | |
188 | - minor_table[skel->minor] = NULL; | |
189 | - if (skel->bulk_in_buffer != NULL) | |
190 | - kfree (skel->bulk_in_buffer); | |
191 | - if (skel->bulk_out_buffer != NULL) | |
192 | - kfree (skel->bulk_out_buffer); | |
193 | - if (skel->write_urb != NULL) | |
194 | - usb_free_urb (skel->write_urb); | |
195 | - kfree (skel); | |
196 | -} else { | |
197 | - skel->dev = NULL; | |
198 | - up (&skel->sem); | |
199 | +static inline void skel_delete (struct usb_skel *dev) | |
200 | +{ | |
201 | + if (dev->bulk_in_buffer != NULL) | |
202 | + kfree (dev->bulk_in_buffer); | |
203 | + if (dev->bulk_out_buffer != NULL) | |
204 | + usb_buffer_free (dev->udev, dev->bulk_out_size, | |
205 | + dev->bulk_out_buffer, | |
206 | + dev->write_urb->transfer_dma); | |
207 | + if (dev->write_urb != NULL) | |
208 | + usb_free_urb (dev->write_urb); | |
209 | + kfree (dev); | |
210 | } | |
211 | </programlisting> | |
212 | <para> | |
213 | - If a program currently has an open handle to the device, we only null the | |
214 | - usb_device structure in our local structure, as it has now gone away. For | |
215 | + If a program currently has an open handle to the device, we reset the flag | |
216 | + <literal>device_present</literal>. For | |
217 | every read, write, release and other functions that expect a device to be | |
218 | - present, the driver first checks to see if this usb_device structure is | |
219 | + present, the driver first checks this flag to see if the device is | |
220 | still present. If not, it releases that the device has disappeared, and a | |
221 | - -ENODEV error is returned to the user-space program. When the release | |
222 | - function is eventually called, it determines if there is no usb_device | |
223 | - structure and if not, it does the cleanup that the skel_disconnect | |
224 | + -ENODEV error is returned to the user-space program. When the release | |
225 | + function is eventually called, it determines if there is no device | |
226 | + and if not, it does the cleanup that the skel_disconnect | |
227 | function normally does if there are no open files on the device (see | |
228 | Listing 5). | |
229 | </para> | |
230 | - <programlisting> | |
231 | -if (skel->dev == NULL) { | |
232 | - /* the device was unplugged before the file was released */ | |
233 | - minor_table[skel->minor] = NULL; | |
234 | - if (skel->bulk_in_buffer != NULL) | |
235 | - kfree (skel->bulk_in_buffer); | |
236 | - if (skel->bulk_out_buffer != NULL) | |
237 | - kfree (skel->bulk_out_buffer); | |
238 | - if (skel->write_urb != NULL) | |
239 | - usb_free_urb (skel->write_urb); | |
240 | - kfree (skel); | |
241 | - goto exit; | |
242 | -} | |
243 | - </programlisting> | |
244 | </chapter> | |
245 | ||
246 | <chapter id="iso"> | |
247 | diff -Nru a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt | |
248 | --- a/Documentation/filesystems/proc.txt Sun Jun 1 14:12:47 2003 | |
249 | +++ b/Documentation/filesystems/proc.txt Sun Aug 31 16:15:48 2003 | |
250 | @@ -25,6 +25,7 @@ | |
251 | 1.5 SCSI info | |
252 | 1.6 Parallel port info in /proc/parport | |
253 | 1.7 TTY info in /proc/tty | |
254 | + 1.8 Miscellaneous kernel statistics in /proc/stat | |
255 | ||
256 | 2 Modifying System Parameters | |
257 | 2.1 /proc/sys/fs - File system data | |
258 | @@ -702,6 +703,58 @@ | |
259 | /dev/console /dev/console 5 1 system:console | |
260 | /dev/tty /dev/tty 5 0 system:/dev/tty | |
261 | unknown /dev/tty 4 1-63 console | |
262 | + | |
263 | + | |
264 | +1.8 Miscellaneous kernel statistics in /proc/stat | |
265 | +------------------------------------------------- | |
266 | + | |
267 | +Various pieces of information about kernel activity are available in the | |
268 | +/proc/stat file. All of the numbers reported in this file are aggregates | |
269 | +since the system first booted. For a quick look, simply cat the file: | |
270 | + | |
271 | + > cat /proc/stat | |
272 | + cpu 2255 34 2290 22625563 6290 127 456 | |
273 | + cpu0 1132 34 1441 11311718 3675 127 438 | |
274 | + cpu1 1123 0 849 11313845 2614 0 18 | |
275 | + intr 114930548 113199788 3 0 5 263 0 4 [... lots more numbers ...] | |
276 | + ctxt 1990473 | |
277 | + btime 1062191376 | |
278 | + processes 2915 | |
279 | + procs_running 1 | |
280 | + procs_blocked 0 | |
281 | + | |
282 | +The very first "cpu" line aggregates the numbers in all of the other "cpuN" | |
283 | +lines. These numbers identify the amount of time the CPU has spent performing | |
284 | +different kinds of work. Time units are in USER_HZ (typically hundredths of a | |
285 | +second). The meanings of the columns are as follows, from left to right: | |
286 | + | |
287 | +- user: normal processes executing in user mode | |
288 | +- nice: niced processes executing in user mode | |
289 | +- system: processes executing in kernel mode | |
290 | +- idle: twiddling thumbs | |
291 | +- iowait: waiting for I/O to complete | |
292 | +- irq: servicing interrupts | |
293 | +- softirq: servicing softirqs | |
294 | + | |
295 | +The "intr" line gives counts of interrupts serviced since boot time, for each | |
296 | +of the possible system interrupts. The first column is the total of all | |
297 | +interrupts serviced; each subsequent column is the total for that particular | |
298 | +interrupt. | |
299 | + | |
300 | +The "ctxt" line gives the total number of context switches across all CPUs. | |
301 | + | |
302 | +The "btime" line gives the time at which the system booted, in seconds since | |
303 | +the Unix epoch. | |
304 | + | |
305 | +The "processes" line gives the number of processes and threads created, which | |
306 | +includes (but is not limited to) those created by calls to the fork() and | |
307 | +clone() system calls. | |
308 | + | |
309 | +The "procs_running" line gives the number of processes currently running on | |
310 | +CPUs. | |
311 | + | |
312 | +The "procs_blocked" line gives the number of processes currently blocked, | |
313 | +waiting for I/O to complete. | |
314 | ||
315 | ||
316 | ------------------------------------------------------------------------------ | |
317 | diff -Nru a/Documentation/ide.txt b/Documentation/ide.txt | |
318 | --- a/Documentation/ide.txt Mon May 26 17:48:43 2003 | |
319 | +++ b/Documentation/ide.txt Sun Aug 31 16:13:57 2003 | |
320 | @@ -1,5 +1,5 @@ | |
321 | ||
322 | - Information regarding the Enhanced IDE drive in Linux 2.5 | |
323 | + Information regarding the Enhanced IDE drive in Linux 2.6 | |
324 | ||
325 | ============================================================================== | |
326 | ||
327 | @@ -242,8 +242,23 @@ | |
328 | and quite likely to cause trouble with | |
329 | older/odd IDE drives. | |
330 | ||
331 | + "hdx=biostimings" : driver will NOT attempt to tune interface speed | |
332 | + (DMA/PIO) but always honour BIOS timings. | |
333 | + | |
334 | "hdx=slow" : insert a huge pause after each access to the data | |
335 | port. Should be used only as a last resort. | |
336 | + | |
337 | + "hdx=swapdata" : when the drive is a disk, byte swap all data | |
338 | + | |
339 | + "hdx=bswap" : same as above.......... | |
340 | + | |
341 | + "hdx=flash" : allows for more than one ata_flash disk to be | |
342 | + registered. In most cases, only one device | |
343 | + will be present. | |
344 | + | |
345 | + "hdx=scsi" : the return of the ide-scsi flag, this is useful for | |
346 | + allowing ide-floppy, ide-tape, and ide-cdrom|writers | |
347 | + to use ide-scsi emulation on a device specific option. | |
348 | ||
349 | "hdxlun=xx" : set the drive last logical unit | |
350 | ||
351 | @@ -277,27 +292,41 @@ | |
352 | "idex=noautotune" : driver will NOT attempt to tune interface speed | |
353 | This is the default for most chipsets, | |
354 | except the cmd640. | |
355 | + | |
356 | + "idex=biostimings" : driver will NOT attempt to tune interface speed | |
357 | + (DMA/PIO) but always honour BIOS timings. | |
358 | ||
359 | "idex=serialize" : do not overlap operations on idex. Please note | |
360 | that you will have to specify this option for | |
361 | both the respecitve primary and secondary channel | |
362 | to take effect. | |
363 | + | |
364 | + "idex=four" : four drives on idex and ide(x^1) share same ports | |
365 | ||
366 | "idex=reset" : reset interface after probe | |
367 | ||
368 | "idex=dma" : automatically configure/use DMA if possible. | |
369 | ||
370 | -The following are valid ONLY on ide0, which usually corresponds to the first | |
371 | -ATA interface found on the particular host, and the defaults for the base,ctl | |
372 | -ports must not be altered. | |
373 | + "idex=ata66" : informs the interface that it has an 80c cable | |
374 | + for chipsets that are ATA-66 capable, but the | |
375 | + ability to bit test for detection is currently | |
376 | + unknown. | |
377 | + | |
378 | + "ide=reverse" : formerly called to pci sub-system, but now local. | |
379 | + | |
380 | +The following are valid ONLY on ide0 (except dc4030), which usually corresponds | |
381 | +to the first ATA interface found on the particular host, and the defaults for | |
382 | +the base,ctl ports must not be altered. | |
383 | ||
384 | "ide0=dtc2278" : probe/support DTC2278 interface | |
385 | "ide0=ht6560b" : probe/support HT6560B interface | |
386 | "ide0=cmd640_vlb" : *REQUIRED* for VLB cards with the CMD640 chip | |
387 | (not for PCI -- automatically detected) | |
388 | "ide0=qd65xx" : probe/support qd65xx interface | |
389 | - "ide0=ali14xx" : probe/support ali14xx chipsets (ALI M1439/M1445) | |
390 | + "ide0=ali14xx" : probe/support ali14xx chipsets (ALI M1439/M1443/M1445) | |
391 | "ide0=umc8672" : probe/support umc8672 chipsets | |
392 | + "idex=dc4030" : probe/support Promise DC4030VL interface | |
393 | + "ide=doubler" : probe/support IDE doublers on Amiga | |
394 | ||
395 | There may be more options than shown -- use the source, Luke! | |
396 | ||
397 | @@ -375,3 +404,6 @@ | |
398 | ||
399 | Wed Apr 17 22:52:44 CEST 2002 edited by Marcin Dalecki, the current | |
400 | maintainer. | |
401 | + | |
402 | +Wed Aug 20 22:31:29 CEST 2003 updated ide boot uptions to current ide.c | |
403 | +comments at 2.6.0-test4 time. Maciej Soltysiak <solt@dns.toxicfilms.tv> | |
404 | diff -Nru a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt | |
405 | --- a/Documentation/kernel-parameters.txt Mon Aug 18 22:27:07 2003 | |
406 | +++ b/Documentation/kernel-parameters.txt Sun Aug 31 16:14:50 2003 | |
407 | @@ -215,7 +215,10 @@ | |
408 | when calculating gettimeofday(). If specicified timesource | |
409 | is not avalible, it defaults to PIT. | |
410 | Format: { pit | tsc | cyclone | ... } | |
411 | - | |
412 | + | |
413 | + hpet= [IA-32,HPET] option to disable HPET and use PIT. | |
414 | + Format: disable | |
415 | + | |
416 | cm206= [HW,CD] | |
417 | Format: { auto | [<io>,][<irq>] } | |
418 | ||
419 | diff -Nru a/Documentation/kmod.txt b/Documentation/kmod.txt | |
420 | --- a/Documentation/kmod.txt Tue Feb 5 09:40:37 2002 | |
421 | +++ /dev/null Wed Dec 31 16:00:00 1969 | |
422 | @@ -1,68 +0,0 @@ | |
423 | -Kmod: The Kernel Module Loader | |
424 | -Kirk Petersen | |
425 | - | |
426 | -Kmod is a simple replacement for kerneld. It consists of a | |
427 | -request_module() replacement and a kernel thread called kmod. When the | |
428 | -kernel requests a module, the kmod wakes up and execve()s modprobe, | |
429 | -passing it the name that was requested. | |
430 | - | |
431 | -If you have the /proc filesystem mounted, you can set the path of | |
432 | -modprobe (where the kernel looks for it) by doing: | |
433 | - | |
434 | - echo "/sbin/modprobe" > /proc/sys/kernel/modprobe | |
435 | - | |
436 | -To periodically unload unused modules, put something like the following | |
437 | -in root's crontab entry: | |
438 | - | |
439 | - 0-59/5 * * * * /sbin/rmmod -a | |
440 | - | |
441 | -Kmod only loads modules. Kerneld could do more (although | |
442 | -nothing in the standard kernel used its other features). If you | |
443 | -require features such as request_route, we suggest that you take | |
444 | -a similar approach. A simple request_route function could be called, | |
445 | -and a kroute kernel thread could be sent off to do the work. But | |
446 | -we should probably keep this to a minimum. | |
447 | - | |
448 | -Kerneld also had a mechanism for storing device driver settings. This | |
449 | -can easily be done with modprobe. When a module is unloaded, modprobe | |
450 | -could look at a per-driver-configurable location (/proc/sys/drivers/blah) | |
451 | -for device driver settings and save them to a file. When a module | |
452 | -is loaded, simply cat that file back to that location in the proc | |
453 | -filesystem. Or perhaps a script could be a setting in /etc/modules.conf. | |
454 | -There are many user-land methods that will work (I prefer using /proc, | |
455 | -myself). | |
456 | - | |
457 | -If kerneld worked, why replace it? | |
458 | - | |
459 | -- kerneld used SysV IPC, which can now be made into a module. Besides, | |
460 | - SysV IPC is ugly and should therefore be avoided (well, certainly for | |
461 | - kernel level stuff) | |
462 | - | |
463 | -- both kmod and kerneld end up doing the same thing (calling modprobe), | |
464 | - so why not skip the middle man? | |
465 | - | |
466 | -- removing kerneld related stuff from ipc/msg.c made it 40% smaller | |
467 | - | |
468 | -- kmod reports errors through the normal kernel mechanisms, which avoids | |
469 | - the chicken and egg problem of kerneld and modular Unix domain sockets | |
470 | - | |
471 | - | |
472 | -Keith Owens <kaos@ocs.com.au> December 1999 | |
473 | - | |
474 | -The combination of kmod and modprobe can loop, especially if modprobe uses a | |
475 | -system call that requires a module. If modules.dep does not exist and modprobe | |
476 | -was started with the -s option (kmod does this), modprobe tries to syslog() a | |
477 | -message. syslog() needs Unix sockets, if Unix sockets are modular then kmod | |
478 | -runs "modprobe -s net-pf-1". This runs a second copy of modprobe which | |
479 | -complains that modules.dep does not exist, tries to use syslog() and starts yet | |
480 | -another copy of modprobe. This is not the only possible kmod/modprobe loop, | |
481 | -just the most common. | |
482 | - | |
483 | -To detect loops caused by "modprobe needs a service which is in a module", kmod | |
484 | -limits the number of concurrent kmod issued modprobes. See MAX_KMOD_CONCURRENT | |
485 | -in kernel/kmod.c. When this limit is exceeded, the kernel issues message "kmod: | |
486 | -runaway modprobe loop assumed and stopped". | |
487 | - | |
488 | -Note for users building a heavily modularised system. It is a good idea to | |
489 | -create modules.dep after installing the modules and before booting a kernel for | |
490 | -the first time. "depmod -ae m.n.p" where m.n.p is the new kernel version. | |
491 | diff -Nru a/Documentation/kobject.txt b/Documentation/kobject.txt | |
492 | --- a/Documentation/kobject.txt Tue Jun 17 15:59:07 2003 | |
493 | +++ b/Documentation/kobject.txt Sun Aug 31 16:14:13 2003 | |
494 | @@ -245,7 +245,9 @@ | |
495 | see the sysfs documentation for more information. | |
496 | ||
497 | - default_attrs: Default attributes to be exported via sysfs when the | |
498 | - object is registered. | |
499 | + object is registered.Note that the last attribute has to be | |
500 | + initialized to NULL ! You can find a complete implementation | |
501 | + in drivers/block/genhd.c | |
502 | ||
503 | ||
504 | Instances of struct kobj_type are not registered; only referenced by | |
505 | diff -Nru a/Documentation/sonypi.txt b/Documentation/sonypi.txt | |
506 | --- a/Documentation/sonypi.txt Tue Mar 11 10:20:18 2003 | |
507 | +++ b/Documentation/sonypi.txt Tue Aug 26 09:02:05 2003 | |
508 | @@ -8,7 +8,9 @@ | |
509 | Copyright (C) 2000 Andrew Tridgell <tridge@samba.org> | |
510 | ||
511 | This driver enables access to the Sony Programmable I/O Control Device which | |
512 | -can be found in many (all ?) Sony Vaio laptops. | |
513 | +can be found in many Sony Vaio laptops. Some newer Sony laptops (seems to be | |
514 | +limited to new FX series laptops, at least the FX501 and the FX702) lack a | |
515 | +sonypi device and are not supported at all by this driver. | |
516 | ||
517 | It will give access (through a user space utility) to some events those laptops | |
518 | generate, like: | |
519 | @@ -96,6 +98,7 @@ | |
520 | SONYPI_THUMBPHRASE_MASK 0x0200 | |
521 | SONYPI_MEYE_MASK 0x0400 | |
522 | SONYPI_MEMORYSTICK_MASK 0x0800 | |
523 | + SONYPI_BATTERY_MASK 0x1000 | |
524 | ||
525 | useinput: if set (which is the default) jogdial events are | |
526 | forwarded to the input subsystem as mouse wheel | |
527 | diff -Nru a/Documentation/sysctl/README b/Documentation/sysctl/README | |
528 | --- a/Documentation/sysctl/README Tue Feb 5 09:40:37 2002 | |
529 | +++ b/Documentation/sysctl/README Sun Aug 31 16:14:14 2003 | |
530 | @@ -55,6 +55,7 @@ | |
531 | by piece basis, or just some 'thematic frobbing'. | |
532 | ||
533 | The subdirs are about: | |
534 | +abi/ execution domains & personalities | |
535 | debug/ <empty> | |
536 | dev/ device specific information (eg dev/cdrom/info) | |
537 | fs/ specific filesystems | |
538 | diff -Nru a/Documentation/sysctl/abi.txt b/Documentation/sysctl/abi.txt | |
539 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
540 | +++ b/Documentation/sysctl/abi.txt Sun Aug 31 16:14:14 2003 | |
541 | @@ -0,0 +1,54 @@ | |
542 | +Documentation for /proc/sys/abi/* kernel version 2.6.0.test2 | |
543 | + (c) 2003, Fabian Frederick <ffrederick@users.sourceforge.net> | |
544 | + | |
545 | +For general info : README. | |
546 | + | |
547 | +============================================================== | |
548 | + | |
549 | +This path is binary emulation relevant aka personality types aka abi. | |
550 | +When a process is executed, it's linked to an exec_domain whose | |
551 | +personality is defined using values available from /proc/sys/abi. | |
552 | +You can find further details about abi in include/linux/personality.h. | |
553 | + | |
554 | +Here are the files featuring in 2.6 kernel : | |
555 | + | |
556 | +- defhandler_coff | |
557 | +- defhandler_elf | |
558 | +- defhandler_lcall7 | |
559 | +- defhandler_libcso | |
560 | +- fake_utsname | |
561 | +- trace | |
562 | + | |
563 | +=========================================================== | |
564 | +defhandler_coff: | |
565 | +defined value : | |
566 | +PER_SCOSVR3 | |
567 | +0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE | |
568 | + | |
569 | +=========================================================== | |
570 | +defhandler_elf: | |
571 | +defined value : | |
572 | +PER_LINUX | |
573 | +0 | |
574 | + | |
575 | +=========================================================== | |
576 | +defhandler_lcall7: | |
577 | +defined value : | |
578 | +PER_SVR4 | |
579 | +0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, | |
580 | + | |
581 | +=========================================================== | |
582 | +defhandler_libsco: | |
583 | +defined value: | |
584 | +PER_SVR4 | |
585 | +0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, | |
586 | + | |
587 | +=========================================================== | |
588 | +fake_utsname: | |
589 | +Unused | |
590 | + | |
591 | +=========================================================== | |
592 | +trace: | |
593 | +Unused | |
594 | + | |
595 | +=========================================================== | |
596 | diff -Nru a/Documentation/usb/hotplug.txt b/Documentation/usb/hotplug.txt | |
597 | --- a/Documentation/usb/hotplug.txt Fri Dec 27 03:00:19 2002 | |
598 | +++ b/Documentation/usb/hotplug.txt Wed Aug 20 09:40:22 2003 | |
599 | @@ -122,17 +122,17 @@ | |
600 | something like this: | |
601 | ||
602 | static struct usb_driver mydriver = { | |
603 | - name: "mydriver", | |
604 | - id_table: mydriver_id_table, | |
605 | - probe: my_probe, | |
606 | - disconnect: my_disconnect, | |
607 | + .name = "mydriver", | |
608 | + .id_table = mydriver_id_table, | |
609 | + .probe = my_probe, | |
610 | + .disconnect = my_disconnect, | |
611 | ||
612 | /* | |
613 | if using the usb chardev framework: | |
614 | - minor: MY_USB_MINOR_START, | |
615 | - fops: my_file_ops, | |
616 | + .minor = MY_USB_MINOR_START, | |
617 | + .fops = my_file_ops, | |
618 | if exposing any operations through usbdevfs: | |
619 | - ioctl: my_ioctl, | |
620 | + .ioctl = my_ioctl, | |
621 | */ | |
622 | } | |
623 | ||
624 | diff -Nru a/Documentation/video4linux/meye.txt b/Documentation/video4linux/meye.txt | |
625 | --- a/Documentation/video4linux/meye.txt Tue Feb 18 03:32:29 2003 | |
626 | +++ b/Documentation/video4linux/meye.txt Fri Aug 1 05:47:51 2003 | |
627 | @@ -16,6 +16,23 @@ | |
628 | ||
629 | MJPEG hardware grabbing is supported via a private API (see below). | |
630 | ||
631 | +Hardware supported: | |
632 | +------------------- | |
633 | + | |
634 | +This driver supports the 'second' version of the MotionEye camera :) | |
635 | + | |
636 | +The first version was connected directly on the video bus of the Neomagic | |
637 | +video card and is unsupported. | |
638 | + | |
639 | +The second one, made by Kawasaki Steel is fully supported by this | |
640 | +driver (PCI vendor/device is 0x136b/0xff01) | |
641 | + | |
642 | +The third one, present in recent (more or less last year) Picturebooks | |
643 | +(C1M* models), is not supported. The manufacturer has given the specs | |
644 | +to the developers under a NDA (which allows the develoment of a GPL | |
645 | +driver however), but things are not moving very fast (see | |
646 | +http://r-engine.sourceforge.net/) (PCI vendor/device is 0x10cf/0x2011). | |
647 | + | |
648 | Driver options: | |
649 | --------------- | |
650 | ||
651 | diff -Nru a/MAINTAINERS b/MAINTAINERS | |
652 | --- a/MAINTAINERS Thu Aug 21 09:09:26 2003 | |
653 | +++ b/MAINTAINERS Wed Sep 3 23:39:56 2003 | |
654 | @@ -615,8 +615,6 @@ | |
655 | S: Maintained | |
656 | ||
657 | DRM DRIVERS | |
658 | -P: Rik Faith | |
659 | -M: faith@redhat.com | |
660 | L: dri-devel@lists.sourceforge.net | |
661 | S: Supported | |
662 | ||
663 | @@ -1087,6 +1085,14 @@ | |
664 | L: kbuild-devel@lists.sourceforge.net | |
665 | W: http://kbuild.sourceforge.net | |
666 | S: Maintained | |
667 | + | |
668 | +KERNEL JANITORS | |
669 | +P: Several | |
670 | +L: kernel-janitors@osdl.org | |
671 | +W: http://www.kerneljanitors.org/ | |
672 | +W: http://sf.net/projects/kernel-janitor/ | |
673 | +W: http://developer.osdl.org/rddunlap/kj-patches/ | |
674 | +S: Maintained | |
675 | ||
676 | KERNEL NFSD | |
677 | P: Neil Brown | |
678 | diff -Nru a/Makefile b/Makefile | |
679 | --- a/Makefile Fri Aug 22 16:38:51 2003 | |
680 | +++ b/Makefile Thu Sep 4 04:34:53 2003 | |
681 | @@ -268,8 +268,19 @@ | |
682 | # Detect when mixed targets is specified, and make a second invocation | |
683 | # of make so .config is not included in this case either (for *config). | |
684 | ||
685 | +no-dot-config-targets := clean mrproper distclean \ | |
686 | + cscope TAGS tags help %docs check% | |
687 | + | |
688 | config-targets := 0 | |
689 | mixed-targets := 0 | |
690 | +dot-config := 1 | |
691 | + | |
692 | +ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),) | |
693 | + ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),) | |
694 | + dot-config := 0 | |
695 | + endif | |
696 | +endif | |
697 | + | |
698 | ifneq ($(filter config %config,$(MAKECMDGOALS)),) | |
699 | config-targets := 1 | |
700 | ifneq ($(filter-out config %config,$(MAKECMDGOALS)),) | |
701 | @@ -309,7 +320,26 @@ | |
702 | core-y := usr/ | |
703 | SUBDIRS := | |
704 | ||
705 | --include .config | |
706 | +ifeq ($(dot-config),1) | |
707 | +# In this section, we need .config | |
708 | + | |
709 | +# Read in dependencies to all Kconfig* files, make sure to run | |
710 | +# oldconfig if changes are detected. | |
711 | +-include .config.cmd | |
712 | + | |
713 | +include .config | |
714 | + | |
715 | +# If .config needs to be updated, it will be done via the dependency | |
716 | +# that autoconf has on .config. | |
717 | +# To avoid any implicit rule to kick in, define an empty command | |
718 | +.config: ; | |
719 | + | |
720 | +# If .config is newer than include/linux/autoconf.h, someone tinkered | |
721 | +# with it and forgot to run make oldconfig | |
722 | +include/linux/autoconf.h: scripts/fixdep .config | |
723 | + $(Q)$(MAKE) $(build)=scripts/kconfig silentoldconfig | |
724 | + | |
725 | +endif | |
726 | ||
727 | include arch/$(ARCH)/Makefile | |
728 | ||
729 | @@ -338,15 +368,7 @@ | |
730 | ||
731 | # Here goes the main Makefile | |
732 | # --------------------------------------------------------------------------- | |
733 | -# | |
734 | -# If the user gave a *config target, it'll be handled in another | |
735 | -# section below, since in this case we cannot include .config | |
736 | -# Same goes for other targets like clean/mrproper etc, which | |
737 | -# don't need .config, either | |
738 | ||
739 | -# In this section, we need .config | |
740 | - | |
741 | --include .config.cmd | |
742 | ||
743 | ifndef CONFIG_FRAME_POINTER | |
744 | CFLAGS += -fomit-frame-pointer | |
745 | @@ -521,13 +543,6 @@ | |
746 | @scripts/split-include include/linux/autoconf.h include/config | |
747 | @touch $@ | |
748 | ||
749 | -# if .config is newer than include/linux/autoconf.h, someone tinkered | |
750 | -# with it and forgot to run make oldconfig | |
751 | - | |
752 | -include/linux/autoconf.h: .config scripts/fixdep | |
753 | - $(Q)$(MAKE) $(build)=scripts/kconfig scripts/kconfig/conf | |
754 | - ./scripts/kconfig/conf -s arch/$(ARCH)/Kconfig | |
755 | - | |
756 | # Generate some files | |
757 | # --------------------------------------------------------------------------- | |
758 | ||
759 | @@ -579,6 +594,11 @@ | |
760 | ||
761 | .PHONY: _modinst_ | |
762 | _modinst_: | |
763 | + @if [ -z "`$(DEPMOD) -V | grep module-init-tools`" ]; then \ | |
764 | + echo "Warning: you may need to install module-init-tools"; \ | |
765 | + echo "See http://www.codemonkey.org.uk/post-halloween-2.5.txt";\ | |
766 | + sleep 1; \ | |
767 | + fi | |
768 | @rm -rf $(MODLIB)/kernel | |
769 | @rm -f $(MODLIB)/build | |
770 | @mkdir -p $(MODLIB)/kernel | |
771 | diff -Nru a/arch/alpha/Kconfig b/arch/alpha/Kconfig | |
772 | --- a/arch/alpha/Kconfig Sun Aug 17 01:06:24 2003 | |
773 | +++ b/arch/alpha/Kconfig Sun Aug 31 16:14:22 2003 | |
774 | @@ -597,40 +597,6 @@ | |
775 | ||
776 | source "drivers/pcmcia/Kconfig" | |
777 | ||
778 | -choice | |
779 | - prompt "Kernel core (/proc/kcore) format" | |
780 | - depends on PROC_FS | |
781 | - default KCORE_ELF | |
782 | - | |
783 | -config KCORE_ELF | |
784 | - bool "ELF" | |
785 | - ---help--- | |
786 | - If you enabled support for /proc file system then the file | |
787 | - /proc/kcore will contain the kernel core image. This can be used | |
788 | - in gdb: | |
789 | - | |
790 | - $ cd /usr/src/linux ; gdb vmlinux /proc/kcore | |
791 | - | |
792 | - You have two choices here: ELF and A.OUT. Selecting ELF will make | |
793 | - /proc/kcore appear in ELF core format as defined by the Executable | |
794 | - and Linking Format specification. Selecting A.OUT will choose the | |
795 | - old "a.out" format which may be necessary for some old versions | |
796 | - of binutils or on some architectures. | |
797 | - | |
798 | - This is especially useful if you have compiled the kernel with the | |
799 | - "-g" option to preserve debugging information. It is mainly used | |
800 | - for examining kernel data structures on the live kernel so if you | |
801 | - don't understand what this means or are not a kernel hacker, just | |
802 | - leave it at its default value ELF. | |
803 | - | |
804 | -config KCORE_AOUT | |
805 | - bool "A.OUT" | |
806 | - help | |
807 | - Not necessary unless you're using a very out-of-date binutils | |
808 | - version. You probably want KCORE_ELF. | |
809 | - | |
810 | -endchoice | |
811 | - | |
812 | config SRM_ENV | |
813 | tristate "SRM environment through procfs" | |
814 | depends on PROC_FS | |
815 | diff -Nru a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c | |
816 | --- a/arch/alpha/kernel/core_titan.c Sun Aug 17 00:57:42 2003 | |
817 | +++ b/arch/alpha/kernel/core_titan.c Sun Aug 31 16:14:08 2003 | |
818 | @@ -717,12 +717,12 @@ | |
819 | ||
820 | struct alpha_agp_ops titan_agp_ops = | |
821 | { | |
822 | - setup: titan_agp_setup, | |
823 | - cleanup: titan_agp_cleanup, | |
824 | - configure: titan_agp_configure, | |
825 | - bind: titan_agp_bind_memory, | |
826 | - unbind: titan_agp_unbind_memory, | |
827 | - translate: titan_agp_translate | |
828 | + .setup = titan_agp_setup, | |
829 | + .cleanup = titan_agp_cleanup, | |
830 | + .configure = titan_agp_configure, | |
831 | + .bind = titan_agp_bind_memory, | |
832 | + .unbind = titan_agp_unbind_memory, | |
833 | + .translate = titan_agp_translate | |
834 | }; | |
835 | ||
836 | alpha_agp_info * | |
837 | diff -Nru a/arch/arm/Kconfig b/arch/arm/Kconfig | |
838 | --- a/arch/arm/Kconfig Tue Aug 19 11:44:53 2003 | |
839 | +++ b/arch/arm/Kconfig Sun Aug 31 16:14:22 2003 | |
840 | @@ -654,39 +654,6 @@ | |
841 | If you do not feel you need a faster FP emulation you should better | |
842 | choose NWFPE. | |
843 | ||
844 | -choice | |
845 | - prompt "Kernel core (/proc/kcore) format" | |
846 | - default KCORE_ELF | |
847 | - | |
848 | -config KCORE_ELF | |
849 | - bool "ELF" | |
850 | - ---help--- | |
851 | - If you enabled support for /proc file system then the file | |
852 | - /proc/kcore will contain the kernel core image. This can be used | |
853 | - in gdb: | |
854 | - | |
855 | - $ cd /usr/src/linux ; gdb vmlinux /proc/kcore | |
856 | - | |
857 | - You have two choices here: ELF and A.OUT. Selecting ELF will make | |
858 | - /proc/kcore appear in ELF core format as defined by the Executable | |
859 | - and Linking Format specification. Selecting A.OUT will choose the | |
860 | - old "a.out" format which may be necessary for some old versions | |
861 | - of binutils or on some architectures. | |
862 | - | |
863 | - This is especially useful if you have compiled the kernel with the | |
864 | - "-g" option to preserve debugging information. It is mainly used | |
865 | - for examining kernel data structures on the live kernel so if you | |
866 | - don't understand what this means or are not a kernel hacker, just | |
867 | - leave it at its default value ELF. | |
868 | - | |
869 | -config KCORE_AOUT | |
870 | - bool "A.OUT" | |
871 | - help | |
872 | - Not necessary unless you're using a very out-of-date binutils | |
873 | - version. You probably want KCORE_ELF. | |
874 | - | |
875 | -endchoice | |
876 | - | |
877 | source "fs/Kconfig.binfmt" | |
878 | ||
879 | source "drivers/base/Kconfig" | |
880 | diff -Nru a/arch/arm/Makefile b/arch/arm/Makefile | |
881 | --- a/arch/arm/Makefile Tue Aug 19 11:44:53 2003 | |
882 | +++ b/arch/arm/Makefile Wed Sep 3 10:17:53 2003 | |
883 | @@ -24,17 +24,12 @@ | |
884 | CFLAGS += -mbig-endian | |
885 | AS += -EB | |
886 | LD += -EB | |
887 | +AFLAGS += -mbig-endian | |
888 | endif | |
889 | ||
890 | check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi) | |
891 | comma = , | |
892 | ||
893 | -# Select CPU dependent flags. Note that order of declaration is important; | |
894 | -# the options further down the list override previous items. | |
895 | -# | |
896 | -apcs-$(CONFIG_CPU_32) :=-mapcs-32 | |
897 | -apcs-$(CONFIG_CPU_26) :=-mapcs-26 -mcpu=arm3 | |
898 | - | |
899 | # This selects which instruction set is used. | |
900 | # Note that GCC does not numerically define an architecture version | |
901 | # macro, but instead defines a whole series of macros which makes | |
902 | @@ -54,37 +49,21 @@ | |
903 | tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100 | |
904 | tune-$(CONFIG_CPU_XSCALE) :=$(call check_gcc,-mtune=xscale,-mtune=strongarm110) | |
905 | ||
906 | -# Force -mno-fpu to be passed to the assembler. Some versions of gcc don't | |
907 | -# do this with -msoft-float | |
908 | -CFLAGS_BOOT :=$(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Wa,-mno-fpu -Uarm | |
909 | -CFLAGS +=$(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Wa,-mno-fpu -Uarm | |
910 | -AFLAGS +=$(apcs-y) $(arch-y) $(tune-y) -msoft-float -Wa,-mno-fpu | |
911 | +CFLAGS_BOOT :=-mapcs-32 $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Wa,-mno-fpu -Uarm | |
912 | +CFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Wa,-mno-fpu -Uarm | |
913 | +AFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -msoft-float -Wa,-mno-fpu | |
914 | ||
915 | #Default value | |
916 | DATAADDR := . | |
917 | ||
918 | -ifeq ($(CONFIG_CPU_26),y) | |
919 | -PROCESSOR := armo | |
920 | -head-y := arch/arm/mach-arc/head.o arch/arm/kernel/init_task.o | |
921 | -LDFLAGS_BLOB += --oformat elf26-littlearm | |
922 | - ifeq ($(CONFIG_ROM_KERNEL),y) | |
923 | - DATAADDR := 0x02080000 | |
924 | - textaddr-y := 0x03800000 | |
925 | - else | |
926 | - textaddr-y := 0x02080000 | |
927 | - endif | |
928 | -endif | |
929 | - | |
930 | -ifeq ($(CONFIG_CPU_32),y) | |
931 | PROCESSOR := armv | |
932 | head-y := arch/arm/kernel/head.o arch/arm/kernel/init_task.o | |
933 | - ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) | |
934 | - LDFLAGS_BLOB += --oformat elf32-bigarm | |
935 | - else | |
936 | - LDFLAGS_BLOB += --oformat elf32-littlearm | |
937 | - endif | |
938 | -textaddr-y := 0xC0008000 | |
939 | +ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) | |
940 | + LDFLAGS_BLOB += --oformat elf32-bigarm | |
941 | +else | |
942 | + LDFLAGS_BLOB += --oformat elf32-littlearm | |
943 | endif | |
944 | +textaddr-y := 0xC0008000 | |
945 | ||
946 | machine-$(CONFIG_ARCH_ARCA5K) := arc | |
947 | machine-$(CONFIG_ARCH_RPC) := rpc | |
948 | @@ -159,16 +138,10 @@ | |
949 | @ln -sf arch-$(INCDIR) include/asm-arm/arch | |
950 | @touch $@ | |
951 | ||
952 | -include/asm-arm/.proc: $(wildcard include/config/cpu/32.h) $(wildcard include/config/cpu/26.h) | |
953 | - @echo ' Making asm-arm/proc -> asm-arm/proc-$(PROCESSOR) symlink' | |
954 | - @rm -f include/asm-arm/proc | |
955 | - @ln -sf proc-$(PROCESSOR) include/asm-arm/proc | |
956 | - @touch $@ | |
957 | - | |
958 | prepare: maketools | |
959 | ||
960 | .PHONY: maketools FORCE | |
961 | -maketools: include/asm-arm/.arch include/asm-arm/.proc \ | |
962 | +maketools: include/asm-arm/.arch \ | |
963 | include/asm-arm/constants.h include/linux/version.h FORCE | |
964 | $(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h | |
965 | ||
966 | @@ -184,7 +157,6 @@ | |
967 | ||
968 | MRPROPER_FILES += \ | |
969 | include/asm-arm/arch include/asm-arm/.arch \ | |
970 | - include/asm-arm/proc include/asm-arm/.proc \ | |
971 | include/asm-arm/constants.h* \ | |
972 | include/asm-arm/mach-types.h | |
973 | ||
974 | @@ -216,7 +188,7 @@ | |
975 | ) | |
976 | ||
977 | arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ | |
978 | - include/asm-arm/.arch include/asm-arm/.proc \ | |
979 | + include/asm-arm/.arch \ | |
980 | include/config/MARKER | |
981 | ||
982 | include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s | |
983 | diff -Nru a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile | |
984 | --- a/arch/arm/boot/Makefile Tue Apr 15 08:12:47 2003 | |
985 | +++ b/arch/arm/boot/Makefile Wed Aug 13 16:46:20 2003 | |
986 | @@ -42,11 +42,12 @@ | |
987 | ifeq ($(CONFIG_ARCH_SA1100),y) | |
988 | zreladdr-$(CONFIG_SA1111) := 0xc0208000 | |
989 | endif | |
990 | - zreladdr-$(CONFIG_ARCH_PXA) := 0xa0008000 | |
991 | - zreladdr-$(CONFIG_ARCH_ANAKIN) := 0x20008000 | |
992 | - zreladdr-$(CONFIG_ARCH_IQ80310) := 0xa0008000 | |
993 | - zreladdr-$(CONFIG_ARCH_IQ80321) := 0xa0008000 | |
994 | - zreladdr-$(CONFIG_ARCH_ADIFCC) := 0xc0008000 | |
995 | + zreladdr-$(CONFIG_ARCH_PXA) := 0xa0008000 | |
996 | + zreladdr-$(CONFIG_ARCH_ANAKIN) := 0x20008000 | |
997 | + zreladdr-$(CONFIG_ARCH_IOP3XX) := 0xa0008000 | |
998 | +params-phys-$(CONFIG_ARCH_IOP3XX) := 0xa0000100 | |
999 | + zreladdr-$(CONFIG_ARCH_ADIFCC) := 0xc0008000 | |
1000 | +params-phys-$(CONFIG_ARCH_ADIFCC) := 0xc0000100 | |
1001 | ||
1002 | ZRELADDR := $(zreladdr-y) | |
1003 | ZTEXTADDR := $(ztextaddr-y) | |
1004 | diff -Nru a/arch/arm/common/amba.c b/arch/arm/common/amba.c | |
1005 | --- a/arch/arm/common/amba.c Fri Aug 15 15:22:52 2003 | |
1006 | +++ b/arch/arm/common/amba.c Sun Aug 24 07:16:13 2003 | |
1007 | @@ -41,13 +41,35 @@ | |
1008 | return amba_lookup(pcdrv->id_table, pcdev) != NULL; | |
1009 | } | |
1010 | ||
1011 | +static int amba_suspend(struct device *dev, u32 state) | |
1012 | +{ | |
1013 | + struct amba_driver *drv = to_amba_driver(dev->driver); | |
1014 | + int ret = 0; | |
1015 | + | |
1016 | + if (dev->driver && drv->suspend) | |
1017 | + ret = drv->suspend(to_amba_device(dev), state); | |
1018 | + return ret; | |
1019 | +} | |
1020 | + | |
1021 | +static int amba_resume(struct device *dev) | |
1022 | +{ | |
1023 | + struct amba_driver *drv = to_amba_driver(dev->driver); | |
1024 | + int ret = 0; | |
1025 | + | |
1026 | + if (dev->driver && drv->resume) | |
1027 | + ret = drv->resume(to_amba_device(dev)); | |
1028 | + return ret; | |
1029 | +} | |
1030 | + | |
1031 | /* | |
1032 | * Primecells are part of the Advanced Microcontroller Bus Architecture, | |
1033 | * so we call the bus "amba". | |
1034 | */ | |
1035 | -struct bus_type amba_bustype = { | |
1036 | - .name = "amba", | |
1037 | - .match = amba_match, | |
1038 | +static struct bus_type amba_bustype = { | |
1039 | + .name = "amba", | |
1040 | + .match = amba_match, | |
1041 | + .suspend = amba_suspend, | |
1042 | + .resume = amba_resume, | |
1043 | }; | |
1044 | ||
1045 | static int __init amba_init(void) | |
1046 | @@ -84,18 +106,6 @@ | |
1047 | drv->shutdown(to_amba_device(dev)); | |
1048 | } | |
1049 | ||
1050 | -static int amba_suspend(struct device *dev, u32 state, u32 level) | |
1051 | -{ | |
1052 | - struct amba_driver *drv = to_amba_driver(dev->driver); | |
1053 | - return drv->suspend(to_amba_device(dev), state, level); | |
1054 | -} | |
1055 | - | |
1056 | -static int amba_resume(struct device *dev, u32 level) | |
1057 | -{ | |
1058 | - struct amba_driver *drv = to_amba_driver(dev->driver); | |
1059 | - return drv->resume(to_amba_device(dev), level); | |
1060 | -} | |
1061 | - | |
1062 | /** | |
1063 | * amba_driver_register - register an AMBA device driver | |
1064 | * @drv: amba device driver structure | |
1065 | @@ -112,8 +122,6 @@ | |
1066 | SETFN(probe); | |
1067 | SETFN(remove); | |
1068 | SETFN(shutdown); | |
1069 | - SETFN(suspend); | |
1070 | - SETFN(resume); | |
1071 | ||
1072 | return driver_register(&drv->drv); | |
1073 | } | |
1074 | diff -Nru a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c | |
1075 | --- a/arch/arm/common/sa1111.c Fri Aug 15 15:22:52 2003 | |
1076 | +++ b/arch/arm/common/sa1111.c Sun Aug 24 07:45:04 2003 | |
1077 | @@ -790,10 +790,13 @@ | |
1078 | struct sa1111 *sachip = dev_get_drvdata(dev); | |
1079 | struct sa1111_save_data *save; | |
1080 | unsigned long flags; | |
1081 | + unsigned int val; | |
1082 | char *base; | |
1083 | ||
1084 | - if (!dev->saved_state && level == SUSPEND_NOTIFY) | |
1085 | - dev->saved_state = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL); | |
1086 | + if (level != SUSPEND_DISABLE) | |
1087 | + return 0; | |
1088 | + | |
1089 | + dev->saved_state = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL); | |
1090 | if (!dev->saved_state) | |
1091 | return -ENOMEM; | |
1092 | ||
1093 | @@ -804,36 +807,31 @@ | |
1094 | /* | |
1095 | * Save state. | |
1096 | */ | |
1097 | - if (level == SUSPEND_SAVE_STATE) { | |
1098 | - base = sachip->base; | |
1099 | - save->skcr = sa1111_readl(base + SA1111_SKCR); | |
1100 | - save->skpcr = sa1111_readl(base + SA1111_SKPCR); | |
1101 | - save->skcdr = sa1111_readl(base + SA1111_SKCDR); | |
1102 | - save->skaud = sa1111_readl(base + SA1111_SKAUD); | |
1103 | - save->skpwm0 = sa1111_readl(base + SA1111_SKPWM0); | |
1104 | - save->skpwm1 = sa1111_readl(base + SA1111_SKPWM1); | |
1105 | - | |
1106 | - base = sachip->base + SA1111_INTC; | |
1107 | - save->intpol0 = sa1111_readl(base + SA1111_INTPOL0); | |
1108 | - save->intpol1 = sa1111_readl(base + SA1111_INTPOL1); | |
1109 | - save->inten0 = sa1111_readl(base + SA1111_INTEN0); | |
1110 | - save->inten1 = sa1111_readl(base + SA1111_INTEN1); | |
1111 | - save->wakepol0 = sa1111_readl(base + SA1111_WAKEPOL0); | |
1112 | - save->wakepol1 = sa1111_readl(base + SA1111_WAKEPOL1); | |
1113 | - save->wakeen0 = sa1111_readl(base + SA1111_WAKEEN0); | |
1114 | - save->wakeen1 = sa1111_readl(base + SA1111_WAKEEN1); | |
1115 | - } | |
1116 | + base = sachip->base; | |
1117 | + save->skcr = sa1111_readl(base + SA1111_SKCR); | |
1118 | + save->skpcr = sa1111_readl(base + SA1111_SKPCR); | |
1119 | + save->skcdr = sa1111_readl(base + SA1111_SKCDR); | |
1120 | + save->skaud = sa1111_readl(base + SA1111_SKAUD); | |
1121 | + save->skpwm0 = sa1111_readl(base + SA1111_SKPWM0); | |
1122 | + save->skpwm1 = sa1111_readl(base + SA1111_SKPWM1); | |
1123 | + | |
1124 | + base = sachip->base + SA1111_INTC; | |
1125 | + save->intpol0 = sa1111_readl(base + SA1111_INTPOL0); | |
1126 | + save->intpol1 = sa1111_readl(base + SA1111_INTPOL1); | |
1127 | + save->inten0 = sa1111_readl(base + SA1111_INTEN0); | |
1128 | + save->inten1 = sa1111_readl(base + SA1111_INTEN1); | |
1129 | + save->wakepol0 = sa1111_readl(base + SA1111_WAKEPOL0); | |
1130 | + save->wakepol1 = sa1111_readl(base + SA1111_WAKEPOL1); | |
1131 | + save->wakeen0 = sa1111_readl(base + SA1111_WAKEEN0); | |
1132 | + save->wakeen1 = sa1111_readl(base + SA1111_WAKEEN1); | |
1133 | ||
1134 | /* | |
1135 | * Disable. | |
1136 | */ | |
1137 | - if (level == SUSPEND_POWER_DOWN && state == 4) { | |
1138 | - unsigned int val = sa1111_readl(sachip->base + SA1111_SKCR); | |
1139 | - | |
1140 | - sa1111_writel(val | SKCR_SLEEP, sachip->base + SA1111_SKCR); | |
1141 | - sa1111_writel(0, sachip->base + SA1111_SKPWM0); | |
1142 | - sa1111_writel(0, sachip->base + SA1111_SKPWM1); | |
1143 | - } | |
1144 | + val = sa1111_readl(sachip->base + SA1111_SKCR); | |
1145 | + sa1111_writel(val | SKCR_SLEEP, sachip->base + SA1111_SKCR); | |
1146 | + sa1111_writel(0, sachip->base + SA1111_SKPWM0); | |
1147 | + sa1111_writel(0, sachip->base + SA1111_SKPWM1); | |
1148 | ||
1149 | spin_unlock_irqrestore(&sachip->lock, flags); | |
1150 | ||
1151 | @@ -857,6 +855,9 @@ | |
1152 | unsigned long flags, id; | |
1153 | char *base; | |
1154 | ||
1155 | + if (level != RESUME_ENABLE) | |
1156 | + return 0; | |
1157 | + | |
1158 | save = (struct sa1111_save_data *)dev->saved_state; | |
1159 | if (!save) | |
1160 | return 0; | |
1161 | @@ -878,39 +879,32 @@ | |
1162 | /* | |
1163 | * First of all, wake up the chip. | |
1164 | */ | |
1165 | - if (level == RESUME_POWER_ON) { | |
1166 | - sa1111_wake(sachip); | |
1167 | - | |
1168 | - sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN0); | |
1169 | - sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN1); | |
1170 | - } | |
1171 | - | |
1172 | - if (level == RESUME_RESTORE_STATE) { | |
1173 | - base = sachip->base; | |
1174 | - sa1111_writel(save->skcr, base + SA1111_SKCR); | |
1175 | - sa1111_writel(save->skpcr, base + SA1111_SKPCR); | |
1176 | - sa1111_writel(save->skcdr, base + SA1111_SKCDR); | |
1177 | - sa1111_writel(save->skaud, base + SA1111_SKAUD); | |
1178 | - sa1111_writel(save->skpwm0, base + SA1111_SKPWM0); | |
1179 | - sa1111_writel(save->skpwm1, base + SA1111_SKPWM1); | |
1180 | - | |
1181 | - base = sachip->base + SA1111_INTC; | |
1182 | - sa1111_writel(save->intpol0, base + SA1111_INTPOL0); | |
1183 | - sa1111_writel(save->intpol1, base + SA1111_INTPOL1); | |
1184 | - sa1111_writel(save->inten0, base + SA1111_INTEN0); | |
1185 | - sa1111_writel(save->inten1, base + SA1111_INTEN1); | |
1186 | - sa1111_writel(save->wakepol0, base + SA1111_WAKEPOL0); | |
1187 | - sa1111_writel(save->wakepol1, base + SA1111_WAKEPOL1); | |
1188 | - sa1111_writel(save->wakeen0, base + SA1111_WAKEEN0); | |
1189 | - sa1111_writel(save->wakeen1, base + SA1111_WAKEEN1); | |
1190 | - } | |
1191 | + sa1111_wake(sachip); | |
1192 | + sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN0); | |
1193 | + sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN1); | |
1194 | + | |
1195 | + base = sachip->base; | |
1196 | + sa1111_writel(save->skcr, base + SA1111_SKCR); | |
1197 | + sa1111_writel(save->skpcr, base + SA1111_SKPCR); | |
1198 | + sa1111_writel(save->skcdr, base + SA1111_SKCDR); | |
1199 | + sa1111_writel(save->skaud, base + SA1111_SKAUD); | |
1200 | + sa1111_writel(save->skpwm0, base + SA1111_SKPWM0); | |
1201 | + sa1111_writel(save->skpwm1, base + SA1111_SKPWM1); | |
1202 | + | |
1203 | + base = sachip->base + SA1111_INTC; | |
1204 | + sa1111_writel(save->intpol0, base + SA1111_INTPOL0); | |
1205 | + sa1111_writel(save->intpol1, base + SA1111_INTPOL1); | |
1206 | + sa1111_writel(save->inten0, base + SA1111_INTEN0); | |
1207 | + sa1111_writel(save->inten1, base + SA1111_INTEN1); | |
1208 | + sa1111_writel(save->wakepol0, base + SA1111_WAKEPOL0); | |
1209 | + sa1111_writel(save->wakepol1, base + SA1111_WAKEPOL1); | |
1210 | + sa1111_writel(save->wakeen0, base + SA1111_WAKEEN0); | |
1211 | + sa1111_writel(save->wakeen1, base + SA1111_WAKEEN1); | |
1212 | ||
1213 | spin_unlock_irqrestore(&sachip->lock, flags); | |
1214 | ||
1215 | - if (level == RESUME_ENABLE) { | |
1216 | - dev->saved_state = NULL; | |
1217 | - kfree(save); | |
1218 | - } | |
1219 | + dev->saved_state = NULL; | |
1220 | + kfree(save); | |
1221 | ||
1222 | return 0; | |
1223 | } | |
1224 | @@ -1135,9 +1129,55 @@ | |
1225 | return dev->devid == drv->devid; | |
1226 | } | |
1227 | ||
1228 | +static int sa1111_bus_suspend(struct device *dev, u32 state) | |
1229 | +{ | |
1230 | + struct sa1111_dev *sadev = SA1111_DEV(dev); | |
1231 | + struct sa1111_driver *drv = SA1111_DRV(dev->driver); | |
1232 | + int ret = 0; | |
1233 | + | |
1234 | + if (drv && drv->suspend) | |
1235 | + ret = drv->suspend(sadev, state); | |
1236 | + return ret; | |
1237 | +} | |
1238 | + | |
1239 | +static int sa1111_bus_resume(struct device *dev) | |
1240 | +{ | |
1241 | + struct sa1111_dev *sadev = SA1111_DEV(dev); | |
1242 | + struct sa1111_driver *drv = SA1111_DRV(dev->driver); | |
1243 | + int ret = 0; | |
1244 | + | |
1245 | + if (drv && drv->resume) | |
1246 | + ret = drv->resume(sadev); | |
1247 | + return ret; | |
1248 | +} | |
1249 | + | |
1250 | +static int sa1111_bus_probe(struct device *dev) | |
1251 | +{ | |
1252 | + struct sa1111_dev *sadev = SA1111_DEV(dev); | |
1253 | + struct sa1111_driver *drv = SA1111_DRV(dev->driver); | |
1254 | + int ret = -ENODEV; | |
1255 | + | |
1256 | + if (drv->probe) | |
1257 | + ret = drv->probe(sadev); | |
1258 | + return ret; | |
1259 | +} | |
1260 | + | |
1261 | +static int sa1111_bus_remove(struct device *dev) | |
1262 | +{ | |
1263 | + struct sa1111_dev *sadev = SA1111_DEV(dev); | |
1264 | + struct sa1111_driver *drv = SA1111_DRV(dev->driver); | |
1265 | + int ret = 0; | |
1266 | + | |
1267 | + if (drv->remove) | |
1268 | + ret = drv->remove(sadev); | |
1269 | + return ret; | |
1270 | +} | |
1271 | + | |
1272 | struct bus_type sa1111_bus_type = { | |
1273 | - .name = "RAB", | |
1274 | - .match = sa1111_match, | |
1275 | + .name = "sa1111-rab", | |
1276 | + .match = sa1111_match, | |
1277 | + .suspend = sa1111_bus_suspend, | |
1278 | + .resume = sa1111_bus_resume, | |
1279 | }; | |
1280 | ||
1281 | static int sa1111_rab_bus_init(void) | |
1282 | @@ -1147,6 +1187,19 @@ | |
1283 | ||
1284 | postcore_initcall(sa1111_rab_bus_init); | |
1285 | ||
1286 | +int sa1111_driver_register(struct sa1111_driver *driver) | |
1287 | +{ | |
1288 | + driver->drv.probe = sa1111_bus_probe; | |
1289 | + driver->drv.remove = sa1111_bus_remove; | |
1290 | + driver->drv.bus = &sa1111_bus_type; | |
1291 | + return driver_register(&driver->drv); | |
1292 | +} | |
1293 | + | |
1294 | +void sa1111_driver_unregister(struct sa1111_driver *driver) | |
1295 | +{ | |
1296 | + driver_unregister(&driver->drv); | |
1297 | +} | |
1298 | + | |
1299 | EXPORT_SYMBOL(sa1111_check_dma_bug); | |
1300 | EXPORT_SYMBOL(sa1111_select_audio_mode); | |
1301 | EXPORT_SYMBOL(sa1111_set_audio_rate); | |
1302 | @@ -1155,3 +1208,5 @@ | |
1303 | EXPORT_SYMBOL(sa1111_disable_device); | |
1304 | EXPORT_SYMBOL(sa1111_pll_clock); | |
1305 | EXPORT_SYMBOL(sa1111_bus_type); | |
1306 | +EXPORT_SYMBOL(sa1111_driver_register); | |
1307 | +EXPORT_SYMBOL(sa1111_driver_unregister); | |
1308 | diff -Nru a/arch/arm/def-configs/iq80310 b/arch/arm/def-configs/iq80310 | |
1309 | --- a/arch/arm/def-configs/iq80310 Tue Apr 15 07:34:41 2003 | |
1310 | +++ b/arch/arm/def-configs/iq80310 Wed Aug 13 16:46:20 2003 | |
1311 | @@ -19,6 +19,12 @@ | |
1312 | # CONFIG_BSD_PROCESS_ACCT is not set | |
1313 | CONFIG_SYSCTL=y | |
1314 | CONFIG_LOG_BUF_SHIFT=14 | |
1315 | +# CONFIG_EMBEDDED is not set | |
1316 | +CONFIG_KALLSYMS=y | |
1317 | +CONFIG_FUTEX=y | |
1318 | +CONFIG_EPOLL=y | |
1319 | +CONFIG_IOSCHED_AS=y | |
1320 | +CONFIG_IOSCHED_DEADLINE=y | |
1321 | ||
1322 | # | |
1323 | # Loadable module support | |
1324 | @@ -34,7 +40,6 @@ | |
1325 | # | |
1326 | # CONFIG_ARCH_ADIFCC is not set | |
1327 | # CONFIG_ARCH_ANAKIN is not set | |
1328 | -# CONFIG_ARCH_ARCA5K is not set | |
1329 | # CONFIG_ARCH_CLPS7500 is not set | |
1330 | # CONFIG_ARCH_CLPS711X is not set | |
1331 | # CONFIG_ARCH_CO285 is not set | |
1332 | @@ -50,14 +55,6 @@ | |
1333 | # CONFIG_ARCH_SHARK is not set | |
1334 | ||
1335 | # | |
1336 | -# Archimedes/A5000 Implementations | |
1337 | -# | |
1338 | - | |
1339 | -# | |
1340 | -# Archimedes/A5000 Implementations (select only ONE) | |
1341 | -# | |
1342 | - | |
1343 | -# | |
1344 | # CLPS711X/EP721X Implementations | |
1345 | # | |
1346 | ||
1347 | @@ -73,7 +70,9 @@ | |
1348 | # IOP3xx Implementation Options | |
1349 | # | |
1350 | CONFIG_ARCH_IQ80310=y | |
1351 | +# CONFIG_ARCH_IQ80321 is not set | |
1352 | CONFIG_ARCH_IOP310=y | |
1353 | +# CONFIG_ARCH_IOP321 is not set | |
1354 | ||
1355 | # | |
1356 | # IOP3xx Chipset Features | |
1357 | @@ -84,6 +83,14 @@ | |
1358 | # CONFIG_IOP3XX_PMON is not set | |
1359 | ||
1360 | # | |
1361 | +# ADIFCC Implementation Options | |
1362 | +# | |
1363 | + | |
1364 | +# | |
1365 | +# ADI Board Types | |
1366 | +# | |
1367 | + | |
1368 | +# | |
1369 | # Intel PXA250/210 Implementations | |
1370 | # | |
1371 | ||
1372 | @@ -96,6 +103,7 @@ | |
1373 | # | |
1374 | CONFIG_CPU_32=y | |
1375 | CONFIG_CPU_XSCALE=y | |
1376 | +CONFIG_XS80200=y | |
1377 | CONFIG_CPU_32v5=y | |
1378 | ||
1379 | # | |
1380 | @@ -116,9 +124,15 @@ | |
1381 | # CONFIG_HOTPLUG is not set | |
1382 | ||
1383 | # | |
1384 | +# MMC/SD Card support | |
1385 | +# | |
1386 | +# CONFIG_MMC is not set | |
1387 | + | |
1388 | +# | |
1389 | # At least one math emulation must be selected | |
1390 | # | |
1391 | CONFIG_FPE_NWFPE=y | |
1392 | +# CONFIG_FPE_NWFPE_XP is not set | |
1393 | # CONFIG_FPE_FASTFPE is not set | |
1394 | CONFIG_KCORE_ELF=y | |
1395 | # CONFIG_KCORE_AOUT is not set | |
1396 | @@ -154,6 +168,7 @@ | |
1397 | CONFIG_MTD_BLOCK=y | |
1398 | # CONFIG_FTL is not set | |
1399 | # CONFIG_NFTL is not set | |
1400 | +# CONFIG_INFTL is not set | |
1401 | ||
1402 | # | |
1403 | # RAM/ROM/Flash chip drivers | |
1404 | @@ -164,6 +179,7 @@ | |
1405 | # CONFIG_MTD_CFI_ADV_OPTIONS is not set | |
1406 | CONFIG_MTD_CFI_INTELEXT=y | |
1407 | # CONFIG_MTD_CFI_AMDSTD is not set | |
1408 | +# CONFIG_MTD_CFI_STAA is not set | |
1409 | # CONFIG_MTD_RAM is not set | |
1410 | # CONFIG_MTD_ROM is not set | |
1411 | # CONFIG_MTD_ABSENT is not set | |
1412 | @@ -172,13 +188,11 @@ | |
1413 | # | |
1414 | # Mapping drivers for chip access | |
1415 | # | |
1416 | +# CONFIG_MTD_COMPLEX_MAPPINGS is not set | |
1417 | # CONFIG_MTD_PHYSMAP is not set | |
1418 | -# CONFIG_MTD_NORA is not set | |
1419 | # CONFIG_MTD_ARM_INTEGRATOR is not set | |
1420 | CONFIG_MTD_IQ80310=y | |
1421 | # CONFIG_MTD_EDB7312 is not set | |
1422 | -# CONFIG_MTD_PCI is not set | |
1423 | -# CONFIG_MTD_UCLINUX is not set | |
1424 | ||
1425 | # | |
1426 | # Self-contained MTD device drivers | |
1427 | @@ -191,9 +205,9 @@ | |
1428 | # | |
1429 | # Disk-On-Chip Device Drivers | |
1430 | # | |
1431 | -# CONFIG_MTD_DOC1000 is not set | |
1432 | # CONFIG_MTD_DOC2000 is not set | |
1433 | # CONFIG_MTD_DOC2001 is not set | |
1434 | +# CONFIG_MTD_DOC2001PLUS is not set | |
1435 | ||
1436 | # | |
1437 | # NAND Flash Device Drivers | |
1438 | @@ -236,7 +250,6 @@ | |
1439 | # CONFIG_NETLINK_DEV is not set | |
1440 | CONFIG_NETFILTER=y | |
1441 | # CONFIG_NETFILTER_DEBUG is not set | |
1442 | -# CONFIG_FILTER is not set | |
1443 | CONFIG_UNIX=y | |
1444 | # CONFIG_NET_KEY is not set | |
1445 | CONFIG_INET=y | |
1446 | @@ -253,7 +266,7 @@ | |
1447 | # CONFIG_SYN_COOKIES is not set | |
1448 | # CONFIG_INET_AH is not set | |
1449 | # CONFIG_INET_ESP is not set | |
1450 | -# CONFIG_XFRM_USER is not set | |
1451 | +# CONFIG_INET_IPCOMP is not set | |
1452 | ||
1453 | # | |
1454 | # IP: Netfilter Configuration | |
1455 | @@ -264,7 +277,13 @@ | |
1456 | # CONFIG_IP_NF_ARPTABLES is not set | |
1457 | # CONFIG_IP_NF_COMPAT_IPCHAINS is not set | |
1458 | # CONFIG_IP_NF_COMPAT_IPFWADM is not set | |
1459 | + | |
1460 | +# | |
1461 | +# IP: Virtual Server Configuration | |
1462 | +# | |
1463 | +# CONFIG_IP_VS is not set | |
1464 | # CONFIG_IPV6 is not set | |
1465 | +# CONFIG_XFRM_USER is not set | |
1466 | ||
1467 | # | |
1468 | # SCTP Configuration (EXPERIMENTAL) | |
1469 | @@ -310,6 +329,7 @@ | |
1470 | # | |
1471 | CONFIG_NET_ETHERNET=y | |
1472 | CONFIG_MII=y | |
1473 | +# CONFIG_SMC91X is not set | |
1474 | # CONFIG_HAPPYMEAL is not set | |
1475 | # CONFIG_SUNGEM is not set | |
1476 | # CONFIG_NET_VENDOR_3COM is not set | |
1477 | @@ -351,6 +371,11 @@ | |
1478 | # CONFIG_R8169 is not set | |
1479 | # CONFIG_SK98LIN is not set | |
1480 | # CONFIG_TIGON3 is not set | |
1481 | + | |
1482 | +# | |
1483 | +# Ethernet (10000 Mbit) | |
1484 | +# | |
1485 | +# CONFIG_IXGB is not set | |
1486 | # CONFIG_FDDI is not set | |
1487 | # CONFIG_HIPPI is not set | |
1488 | # CONFIG_PPP is not set | |
1489 | @@ -402,6 +427,7 @@ | |
1490 | CONFIG_BLK_DEV_IDECD=y | |
1491 | # CONFIG_BLK_DEV_IDEFLOPPY is not set | |
1492 | # CONFIG_IDE_TASK_IOCTL is not set | |
1493 | +# CONFIG_IDE_TASKFILE_IO is not set | |
1494 | ||
1495 | # | |
1496 | # IDE chipset support/bugfixes | |
1497 | @@ -409,7 +435,7 @@ | |
1498 | # CONFIG_BLK_DEV_IDEPCI is not set | |
1499 | ||
1500 | # | |
1501 | -# SCSI support | |
1502 | +# SCSI device support | |
1503 | # | |
1504 | # CONFIG_SCSI is not set | |
1505 | ||
1506 | @@ -481,6 +507,7 @@ | |
1507 | # | |
1508 | # I2C Hardware Sensors Chip support | |
1509 | # | |
1510 | +# CONFIG_I2C_SENSOR is not set | |
1511 | ||
1512 | # | |
1513 | # L3 serial bus support | |
1514 | @@ -534,6 +561,8 @@ | |
1515 | # CONFIG_VIDEO_PMS is not set | |
1516 | # CONFIG_VIDEO_CPIA is not set | |
1517 | # CONFIG_VIDEO_STRADIS is not set | |
1518 | +# CONFIG_VIDEO_HEXIUM_ORION is not set | |
1519 | +# CONFIG_VIDEO_HEXIUM_GEMINI is not set | |
1520 | ||
1521 | # | |
1522 | # Radio Adapters | |
1523 | @@ -551,18 +580,29 @@ | |
1524 | # | |
1525 | # Supported Frontend Modules | |
1526 | # | |
1527 | -CONFIG_DVB_ALPS_BSRU6=y | |
1528 | +# CONFIG_DVB_STV0299 is not set | |
1529 | # CONFIG_DVB_ALPS_BSRV2 is not set | |
1530 | # CONFIG_DVB_ALPS_TDLB7 is not set | |
1531 | # CONFIG_DVB_ALPS_TDMB7 is not set | |
1532 | +# CONFIG_DVB_ATMEL_AT76C651 is not set | |
1533 | +# CONFIG_DVB_CX24110 is not set | |
1534 | # CONFIG_DVB_GRUNDIG_29504_491 is not set | |
1535 | # CONFIG_DVB_GRUNDIG_29504_401 is not set | |
1536 | +# CONFIG_DVB_MT312 is not set | |
1537 | # CONFIG_DVB_VES1820 is not set | |
1538 | +# CONFIG_DVB_TDA1004X is not set | |
1539 | ||
1540 | # | |
1541 | -# Supported DVB Adapters | |
1542 | +# Supported SAA7146 based PCI Adapters | |
1543 | # | |
1544 | # CONFIG_DVB_AV7110 is not set | |
1545 | +# CONFIG_DVB_BUDGET is not set | |
1546 | + | |
1547 | +# | |
1548 | +# Supported FlexCopII (B2C2) Adapters | |
1549 | +# | |
1550 | +# CONFIG_DVB_B2C2_SKYSTAR is not set | |
1551 | +# CONFIG_VIDEO_BTCX is not set | |
1552 | ||
1553 | # | |
1554 | # File systems | |
1555 | @@ -598,6 +638,7 @@ | |
1556 | CONFIG_PROC_FS=y | |
1557 | # CONFIG_DEVFS_FS is not set | |
1558 | CONFIG_DEVPTS_FS=y | |
1559 | +# CONFIG_DEVPTS_FS_XATTR is not set | |
1560 | CONFIG_TMPFS=y | |
1561 | CONFIG_RAMFS=y | |
1562 | ||
1563 | @@ -631,13 +672,13 @@ | |
1564 | CONFIG_ROOT_NFS=y | |
1565 | CONFIG_LOCKD=y | |
1566 | # CONFIG_EXPORTFS is not set | |
1567 | +CONFIG_SUNRPC=y | |
1568 | +# CONFIG_SUNRPC_GSS is not set | |
1569 | # CONFIG_SMB_FS is not set | |
1570 | # CONFIG_CIFS is not set | |
1571 | # CONFIG_NCP_FS is not set | |
1572 | # CONFIG_CODA_FS is not set | |
1573 | # CONFIG_INTERMEZZO_FS is not set | |
1574 | -CONFIG_SUNRPC=y | |
1575 | -# CONFIG_SUNRPC_GSS is not set | |
1576 | # CONFIG_AFS_FS is not set | |
1577 | ||
1578 | # | |
1579 | @@ -655,6 +696,7 @@ | |
1580 | # CONFIG_SOLARIS_X86_PARTITION is not set | |
1581 | # CONFIG_UNIXWARE_DISKLABEL is not set | |
1582 | # CONFIG_LDM_PARTITION is not set | |
1583 | +# CONFIG_NEC98_PARTITION is not set | |
1584 | # CONFIG_SGI_PARTITION is not set | |
1585 | # CONFIG_ULTRIX_PARTITION is not set | |
1586 | # CONFIG_SUN_PARTITION is not set | |
1587 | @@ -666,13 +708,6 @@ | |
1588 | # CONFIG_FB is not set | |
1589 | ||
1590 | # | |
1591 | -# Console display driver support | |
1592 | -# | |
1593 | -# CONFIG_VGA_CONSOLE is not set | |
1594 | -# CONFIG_MDA_CONSOLE is not set | |
1595 | -CONFIG_DUMMY_CONSOLE=y | |
1596 | - | |
1597 | -# | |
1598 | # Sound | |
1599 | # | |
1600 | # CONFIG_SOUND is not set | |
1601 | @@ -695,6 +730,7 @@ | |
1602 | # USB support | |
1603 | # | |
1604 | # CONFIG_USB is not set | |
1605 | +# CONFIG_USB_GADGET is not set | |
1606 | ||
1607 | # | |
1608 | # Bluetooth support | |
1609 | @@ -714,7 +750,6 @@ | |
1610 | # CONFIG_DEBUG_WAITQ is not set | |
1611 | CONFIG_DEBUG_BUGVERBOSE=y | |
1612 | CONFIG_DEBUG_ERRORS=y | |
1613 | -CONFIG_KALLSYMS=y | |
1614 | CONFIG_DEBUG_LL=y | |
1615 | ||
1616 | # | |
1617 | diff -Nru a/arch/arm/def-configs/iq80321 b/arch/arm/def-configs/iq80321 | |
1618 | --- a/arch/arm/def-configs/iq80321 Sat Aug 2 12:59:32 2003 | |
1619 | +++ b/arch/arm/def-configs/iq80321 Wed Aug 13 16:46:20 2003 | |
1620 | @@ -9,7 +9,7 @@ | |
1621 | # | |
1622 | # Code maturity level options | |
1623 | # | |
1624 | -# CONFIG_EXPERIMENTAL is not set | |
1625 | +CONFIG_EXPERIMENTAL=y | |
1626 | ||
1627 | # | |
1628 | # General setup | |
1629 | @@ -19,6 +19,12 @@ | |
1630 | # CONFIG_BSD_PROCESS_ACCT is not set | |
1631 | CONFIG_SYSCTL=y | |
1632 | CONFIG_LOG_BUF_SHIFT=14 | |
1633 | +# CONFIG_EMBEDDED is not set | |
1634 | +CONFIG_KALLSYMS=y | |
1635 | +CONFIG_FUTEX=y | |
1636 | +CONFIG_EPOLL=y | |
1637 | +CONFIG_IOSCHED_AS=y | |
1638 | +CONFIG_IOSCHED_DEADLINE=y | |
1639 | ||
1640 | # | |
1641 | # Loadable module support | |
1642 | @@ -26,6 +32,7 @@ | |
1643 | CONFIG_MODULES=y | |
1644 | # CONFIG_MODULE_UNLOAD is not set | |
1645 | CONFIG_OBSOLETE_MODPARM=y | |
1646 | +# CONFIG_MODVERSIONS is not set | |
1647 | CONFIG_KMOD=y | |
1648 | ||
1649 | # | |
1650 | @@ -33,7 +40,6 @@ | |
1651 | # | |
1652 | # CONFIG_ARCH_ADIFCC is not set | |
1653 | # CONFIG_ARCH_ANAKIN is not set | |
1654 | -# CONFIG_ARCH_ARCA5K is not set | |
1655 | # CONFIG_ARCH_CLPS7500 is not set | |
1656 | # CONFIG_ARCH_CLPS711X is not set | |
1657 | # CONFIG_ARCH_CO285 is not set | |
1658 | @@ -49,14 +55,6 @@ | |
1659 | # CONFIG_ARCH_SHARK is not set | |
1660 | ||
1661 | # | |
1662 | -# Archimedes/A5000 Implementations | |
1663 | -# | |
1664 | - | |
1665 | -# | |
1666 | -# Archimedes/A5000 Implementations (select only ONE) | |
1667 | -# | |
1668 | - | |
1669 | -# | |
1670 | # CLPS711X/EP721X Implementations | |
1671 | # | |
1672 | ||
1673 | @@ -79,6 +77,18 @@ | |
1674 | # | |
1675 | # IOP3xx Chipset Features | |
1676 | # | |
1677 | +# CONFIG_IOP3XX_AAU is not set | |
1678 | +# CONFIG_IOP3XX_DMA is not set | |
1679 | +# CONFIG_IOP3XX_MU is not set | |
1680 | +# CONFIG_IOP3XX_PMON is not set | |
1681 | + | |
1682 | +# | |
1683 | +# ADIFCC Implementation Options | |
1684 | +# | |
1685 | + | |
1686 | +# | |
1687 | +# ADI Board Types | |
1688 | +# | |
1689 | ||
1690 | # | |
1691 | # Intel PXA250/210 Implementations | |
1692 | @@ -98,6 +108,7 @@ | |
1693 | # | |
1694 | # Processor Features | |
1695 | # | |
1696 | +# CONFIG_ARM_THUMB is not set | |
1697 | CONFIG_XSCALE_PMU=y | |
1698 | ||
1699 | # | |
1700 | @@ -112,17 +123,25 @@ | |
1701 | # CONFIG_HOTPLUG is not set | |
1702 | ||
1703 | # | |
1704 | +# MMC/SD Card support | |
1705 | +# | |
1706 | +# CONFIG_MMC is not set | |
1707 | + | |
1708 | +# | |
1709 | # At least one math emulation must be selected | |
1710 | # | |
1711 | CONFIG_FPE_NWFPE=y | |
1712 | +# CONFIG_FPE_NWFPE_XP is not set | |
1713 | +# CONFIG_FPE_FASTFPE is not set | |
1714 | CONFIG_KCORE_ELF=y | |
1715 | # CONFIG_KCORE_AOUT is not set | |
1716 | CONFIG_BINFMT_AOUT=y | |
1717 | CONFIG_BINFMT_ELF=y | |
1718 | # CONFIG_BINFMT_MISC is not set | |
1719 | # CONFIG_PM is not set | |
1720 | +# CONFIG_PREEMPT is not set | |
1721 | # CONFIG_ARTHUR is not set | |
1722 | -CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200" | |
1723 | +CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200 mem=128M@0xa0000000" | |
1724 | CONFIG_ALIGNMENT_TRAP=y | |
1725 | ||
1726 | # | |
1727 | @@ -148,6 +167,7 @@ | |
1728 | CONFIG_MTD_BLOCK=y | |
1729 | # CONFIG_FTL is not set | |
1730 | # CONFIG_NFTL is not set | |
1731 | +# CONFIG_INFTL is not set | |
1732 | ||
1733 | # | |
1734 | # RAM/ROM/Flash chip drivers | |
1735 | @@ -158,6 +178,7 @@ | |
1736 | # CONFIG_MTD_CFI_ADV_OPTIONS is not set | |
1737 | CONFIG_MTD_CFI_INTELEXT=y | |
1738 | # CONFIG_MTD_CFI_AMDSTD is not set | |
1739 | +# CONFIG_MTD_CFI_STAA is not set | |
1740 | # CONFIG_MTD_RAM is not set | |
1741 | # CONFIG_MTD_ROM is not set | |
1742 | # CONFIG_MTD_ABSENT is not set | |
1743 | @@ -166,13 +187,10 @@ | |
1744 | # | |
1745 | # Mapping drivers for chip access | |
1746 | # | |
1747 | +# CONFIG_MTD_COMPLEX_MAPPINGS is not set | |
1748 | # CONFIG_MTD_PHYSMAP is not set | |
1749 | -# CONFIG_MTD_NORA is not set | |
1750 | # CONFIG_MTD_ARM_INTEGRATOR is not set | |
1751 | -CONFIG_MTD_IQ80321=y | |
1752 | # CONFIG_MTD_EDB7312 is not set | |
1753 | -# CONFIG_MTD_PCI is not set | |
1754 | -# CONFIG_MTD_UCLINUX is not set | |
1755 | ||
1756 | # | |
1757 | # Self-contained MTD device drivers | |
1758 | @@ -185,9 +203,9 @@ | |
1759 | # | |
1760 | # Disk-On-Chip Device Drivers | |
1761 | # | |
1762 | -# CONFIG_MTD_DOC1000 is not set | |
1763 | # CONFIG_MTD_DOC2000 is not set | |
1764 | # CONFIG_MTD_DOC2001 is not set | |
1765 | +# CONFIG_MTD_DOC2001PLUS is not set | |
1766 | ||
1767 | # | |
1768 | # NAND Flash Device Drivers | |
1769 | @@ -206,6 +224,7 @@ | |
1770 | # CONFIG_BLK_CPQ_DA is not set | |
1771 | # CONFIG_BLK_CPQ_CISS_DA is not set | |
1772 | # CONFIG_BLK_DEV_DAC960 is not set | |
1773 | +# CONFIG_BLK_DEV_UMEM is not set | |
1774 | # CONFIG_BLK_DEV_LOOP is not set | |
1775 | # CONFIG_BLK_DEV_NBD is not set | |
1776 | CONFIG_BLK_DEV_RAM=y | |
1777 | @@ -229,7 +248,6 @@ | |
1778 | # CONFIG_NETLINK_DEV is not set | |
1779 | CONFIG_NETFILTER=y | |
1780 | # CONFIG_NETFILTER_DEBUG is not set | |
1781 | -# CONFIG_FILTER is not set | |
1782 | CONFIG_UNIX=y | |
1783 | # CONFIG_NET_KEY is not set | |
1784 | CONFIG_INET=y | |
1785 | @@ -241,24 +259,47 @@ | |
1786 | # CONFIG_IP_PNP_RARP is not set | |
1787 | # CONFIG_NET_IPIP is not set | |
1788 | # CONFIG_NET_IPGRE is not set | |
1789 | +# CONFIG_ARPD is not set | |
1790 | # CONFIG_INET_ECN is not set | |
1791 | # CONFIG_SYN_COOKIES is not set | |
1792 | # CONFIG_INET_AH is not set | |
1793 | # CONFIG_INET_ESP is not set | |
1794 | -# CONFIG_XFRM_USER is not set | |
1795 | +# CONFIG_INET_IPCOMP is not set | |
1796 | ||
1797 | # | |
1798 | # IP: Netfilter Configuration | |
1799 | # | |
1800 | # CONFIG_IP_NF_CONNTRACK is not set | |
1801 | +# CONFIG_IP_NF_QUEUE is not set | |
1802 | # CONFIG_IP_NF_IPTABLES is not set | |
1803 | # CONFIG_IP_NF_ARPTABLES is not set | |
1804 | # CONFIG_IP_NF_COMPAT_IPCHAINS is not set | |
1805 | # CONFIG_IP_NF_COMPAT_IPFWADM is not set | |
1806 | + | |
1807 | +# | |
1808 | +# IP: Virtual Server Configuration | |
1809 | +# | |
1810 | +# CONFIG_IP_VS is not set | |
1811 | +# CONFIG_IPV6 is not set | |
1812 | +# CONFIG_XFRM_USER is not set | |
1813 | + | |
1814 | +# | |
1815 | +# SCTP Configuration (EXPERIMENTAL) | |
1816 | +# | |
1817 | +CONFIG_IPV6_SCTP__=y | |
1818 | +# CONFIG_IP_SCTP is not set | |
1819 | +# CONFIG_ATM is not set | |
1820 | # CONFIG_VLAN_8021Q is not set | |
1821 | # CONFIG_LLC is not set | |
1822 | # CONFIG_DECNET is not set | |
1823 | # CONFIG_BRIDGE is not set | |
1824 | +# CONFIG_X25 is not set | |
1825 | +# CONFIG_LAPB is not set | |
1826 | +# CONFIG_NET_DIVERT is not set | |
1827 | +# CONFIG_ECONET is not set | |
1828 | +# CONFIG_WAN_ROUTER is not set | |
1829 | +# CONFIG_NET_FASTROUTE is not set | |
1830 | +# CONFIG_NET_HW_FLOWCONTROL is not set | |
1831 | ||
1832 | # | |
1833 | # QoS and/or fair queueing | |
1834 | @@ -279,12 +320,14 @@ | |
1835 | # CONFIG_BONDING is not set | |
1836 | # CONFIG_EQUALIZER is not set | |
1837 | # CONFIG_TUN is not set | |
1838 | +# CONFIG_ETHERTAP is not set | |
1839 | ||
1840 | # | |
1841 | # Ethernet (10 or 100Mbit) | |
1842 | # | |
1843 | CONFIG_NET_ETHERNET=y | |
1844 | # CONFIG_MII is not set | |
1845 | +# CONFIG_SMC91X is not set | |
1846 | # CONFIG_HAPPYMEAL is not set | |
1847 | # CONFIG_SUNGEM is not set | |
1848 | # CONFIG_NET_VENDOR_3COM is not set | |
1849 | @@ -298,6 +341,7 @@ | |
1850 | # CONFIG_PCNET32 is not set | |
1851 | # CONFIG_AMD8111_ETH is not set | |
1852 | # CONFIG_ADAPTEC_STARFIRE is not set | |
1853 | +# CONFIG_B44 is not set | |
1854 | # CONFIG_DGRS is not set | |
1855 | CONFIG_EEPRO100=y | |
1856 | # CONFIG_EEPRO100_PIO is not set | |
1857 | @@ -305,6 +349,7 @@ | |
1858 | # CONFIG_FEALNX is not set | |
1859 | # CONFIG_NATSEMI is not set | |
1860 | # CONFIG_NE2K_PCI is not set | |
1861 | +# CONFIG_8139CP is not set | |
1862 | # CONFIG_8139TOO is not set | |
1863 | # CONFIG_SIS900 is not set | |
1864 | # CONFIG_EPIC100 is not set | |
1865 | @@ -317,13 +362,21 @@ | |
1866 | # | |
1867 | # CONFIG_ACENIC is not set | |
1868 | # CONFIG_DL2K is not set | |
1869 | -# CONFIG_E1000 is not set | |
1870 | +CONFIG_E1000=y | |
1871 | +CONFIG_E1000_NAPI=y | |
1872 | # CONFIG_NS83820 is not set | |
1873 | # CONFIG_HAMACHI is not set | |
1874 | +# CONFIG_YELLOWFIN is not set | |
1875 | # CONFIG_R8169 is not set | |
1876 | # CONFIG_SK98LIN is not set | |
1877 | # CONFIG_TIGON3 is not set | |
1878 | + | |
1879 | +# | |
1880 | +# Ethernet (10000 Mbit) | |
1881 | +# | |
1882 | +# CONFIG_IXGB is not set | |
1883 | # CONFIG_FDDI is not set | |
1884 | +# CONFIG_HIPPI is not set | |
1885 | # CONFIG_PPP is not set | |
1886 | # CONFIG_SLIP is not set | |
1887 | ||
1888 | @@ -335,6 +388,8 @@ | |
1889 | # | |
1890 | # Token Ring devices (depends on LLC=y) | |
1891 | # | |
1892 | +# CONFIG_RCPCI is not set | |
1893 | +# CONFIG_SHAPER is not set | |
1894 | ||
1895 | # | |
1896 | # Wan interfaces | |
1897 | @@ -371,6 +426,7 @@ | |
1898 | CONFIG_BLK_DEV_IDECD=y | |
1899 | # CONFIG_BLK_DEV_IDEFLOPPY is not set | |
1900 | # CONFIG_IDE_TASK_IOCTL is not set | |
1901 | +# CONFIG_IDE_TASKFILE_IO is not set | |
1902 | ||
1903 | # | |
1904 | # IDE chipset support/bugfixes | |
1905 | @@ -379,11 +435,13 @@ | |
1906 | # CONFIG_BLK_DEV_GENERIC is not set | |
1907 | # CONFIG_IDEPCI_SHARE_IRQ is not set | |
1908 | CONFIG_BLK_DEV_IDEDMA_PCI=y | |
1909 | +# CONFIG_BLK_DEV_IDE_TCQ is not set | |
1910 | # CONFIG_BLK_DEV_OFFBOARD is not set | |
1911 | # CONFIG_BLK_DEV_IDEDMA_FORCED is not set | |
1912 | CONFIG_IDEDMA_PCI_AUTO=y | |
1913 | # CONFIG_IDEDMA_ONLYDISK is not set | |
1914 | CONFIG_BLK_DEV_IDEDMA=y | |
1915 | +# CONFIG_IDEDMA_PCI_WIP is not set | |
1916 | CONFIG_BLK_DEV_ADMA=y | |
1917 | # CONFIG_BLK_DEV_AEC62XX is not set | |
1918 | # CONFIG_BLK_DEV_ALI15X3 is not set | |
1919 | @@ -391,11 +449,13 @@ | |
1920 | CONFIG_BLK_DEV_CMD64X=y | |
1921 | # CONFIG_BLK_DEV_TRIFLEX is not set | |
1922 | # CONFIG_BLK_DEV_CY82C693 is not set | |
1923 | +# CONFIG_BLK_DEV_CS5520 is not set | |
1924 | # CONFIG_BLK_DEV_HPT34X is not set | |
1925 | # CONFIG_BLK_DEV_HPT366 is not set | |
1926 | # CONFIG_BLK_DEV_SC1200 is not set | |
1927 | # CONFIG_BLK_DEV_PIIX is not set | |
1928 | # CONFIG_BLK_DEV_NS87415 is not set | |
1929 | +# CONFIG_BLK_DEV_OPTI621 is not set | |
1930 | # CONFIG_BLK_DEV_PDC202XX_OLD is not set | |
1931 | # CONFIG_BLK_DEV_PDC202XX_NEW is not set | |
1932 | # CONFIG_BLK_DEV_SVWKS is not set | |
1933 | @@ -408,11 +468,16 @@ | |
1934 | # CONFIG_IDEDMA_IVB is not set | |
1935 | ||
1936 | # | |
1937 | -# SCSI support | |
1938 | +# SCSI device support | |
1939 | # | |
1940 | # CONFIG_SCSI is not set | |
1941 | ||
1942 | # | |
1943 | +# IEEE 1394 (FireWire) support (EXPERIMENTAL) | |
1944 | +# | |
1945 | +# CONFIG_IEEE1394 is not set | |
1946 | + | |
1947 | +# | |
1948 | # I2O device support | |
1949 | # | |
1950 | # CONFIG_I2O is not set | |
1951 | @@ -450,11 +515,16 @@ | |
1952 | # | |
1953 | # Serial drivers | |
1954 | # | |
1955 | +CONFIG_SERIAL_8250=y | |
1956 | +CONFIG_SERIAL_8250_CONSOLE=y | |
1957 | +# CONFIG_SERIAL_8250_EXTENDED is not set | |
1958 | ||
1959 | # | |
1960 | # Non-8250 serial port support | |
1961 | # | |
1962 | # CONFIG_SERIAL_DZ is not set | |
1963 | +CONFIG_SERIAL_CORE=y | |
1964 | +CONFIG_SERIAL_CORE_CONSOLE=y | |
1965 | CONFIG_UNIX98_PTYS=y | |
1966 | CONFIG_UNIX98_PTY_COUNT=256 | |
1967 | ||
1968 | @@ -470,6 +540,7 @@ | |
1969 | # | |
1970 | # I2C Hardware Sensors Chip support | |
1971 | # | |
1972 | +# CONFIG_I2C_SENSOR is not set | |
1973 | ||
1974 | # | |
1975 | # L3 serial bus support | |
1976 | @@ -522,6 +593,9 @@ | |
1977 | # | |
1978 | # CONFIG_VIDEO_PMS is not set | |
1979 | # CONFIG_VIDEO_CPIA is not set | |
1980 | +# CONFIG_VIDEO_STRADIS is not set | |
1981 | +# CONFIG_VIDEO_HEXIUM_ORION is not set | |
1982 | +# CONFIG_VIDEO_HEXIUM_GEMINI is not set | |
1983 | ||
1984 | # | |
1985 | # Radio Adapters | |
1986 | @@ -534,6 +608,7 @@ | |
1987 | # Digital Video Broadcasting Devices | |
1988 | # | |
1989 | # CONFIG_DVB is not set | |
1990 | +# CONFIG_VIDEO_BTCX is not set | |
1991 | ||
1992 | # | |
1993 | # File systems | |
1994 | @@ -567,16 +642,25 @@ | |
1995 | # Pseudo filesystems | |
1996 | # | |
1997 | CONFIG_PROC_FS=y | |
1998 | +# CONFIG_DEVFS_FS is not set | |
1999 | CONFIG_DEVPTS_FS=y | |
2000 | +# CONFIG_DEVPTS_FS_XATTR is not set | |
2001 | CONFIG_TMPFS=y | |
2002 | CONFIG_RAMFS=y | |
2003 | ||
2004 | # | |
2005 | # Miscellaneous filesystems | |
2006 | # | |
2007 | +# CONFIG_ADFS_FS is not set | |
2008 | +# CONFIG_AFFS_FS is not set | |
2009 | +# CONFIG_HFS_FS is not set | |
2010 | +# CONFIG_BEFS_FS is not set | |
2011 | +# CONFIG_BFS_FS is not set | |
2012 | +# CONFIG_EFS_FS is not set | |
2013 | # CONFIG_JFFS_FS is not set | |
2014 | CONFIG_JFFS2_FS=y | |
2015 | CONFIG_JFFS2_FS_DEBUG=0 | |
2016 | +# CONFIG_JFFS2_FS_NAND is not set | |
2017 | # CONFIG_CRAMFS is not set | |
2018 | # CONFIG_VXFS_FS is not set | |
2019 | # CONFIG_HPFS_FS is not set | |
2020 | @@ -589,15 +673,19 @@ | |
2021 | # | |
2022 | CONFIG_NFS_FS=y | |
2023 | # CONFIG_NFS_V3 is not set | |
2024 | +# CONFIG_NFS_V4 is not set | |
2025 | # CONFIG_NFSD is not set | |
2026 | CONFIG_ROOT_NFS=y | |
2027 | CONFIG_LOCKD=y | |
2028 | # CONFIG_EXPORTFS is not set | |
2029 | +CONFIG_SUNRPC=y | |
2030 | +# CONFIG_SUNRPC_GSS is not set | |
2031 | # CONFIG_SMB_FS is not set | |
2032 | # CONFIG_CIFS is not set | |
2033 | # CONFIG_NCP_FS is not set | |
2034 | # CONFIG_CODA_FS is not set | |
2035 | -CONFIG_SUNRPC=y | |
2036 | +# CONFIG_INTERMEZZO_FS is not set | |
2037 | +# CONFIG_AFS_FS is not set | |
2038 | ||
2039 | # | |
2040 | # Partition Types | |
2041 | @@ -614,6 +702,7 @@ | |
2042 | # CONFIG_SOLARIS_X86_PARTITION is not set | |
2043 | # CONFIG_UNIXWARE_DISKLABEL is not set | |
2044 | # CONFIG_LDM_PARTITION is not set | |
2045 | +# CONFIG_NEC98_PARTITION is not set | |
2046 | # CONFIG_SGI_PARTITION is not set | |
2047 | # CONFIG_ULTRIX_PARTITION is not set | |
2048 | # CONFIG_SUN_PARTITION is not set | |
2049 | @@ -625,13 +714,6 @@ | |
2050 | # CONFIG_FB is not set | |
2051 | ||
2052 | # | |
2053 | -# Console display driver support | |
2054 | -# | |
2055 | -# CONFIG_VGA_CONSOLE is not set | |
2056 | -# CONFIG_MDA_CONSOLE is not set | |
2057 | -CONFIG_DUMMY_CONSOLE=y | |
2058 | - | |
2059 | -# | |
2060 | # Sound | |
2061 | # | |
2062 | # CONFIG_SOUND is not set | |
2063 | @@ -654,6 +736,7 @@ | |
2064 | # USB support | |
2065 | # | |
2066 | # CONFIG_USB is not set | |
2067 | +# CONFIG_USB_GADGET is not set | |
2068 | ||
2069 | # | |
2070 | # Bluetooth support | |
2071 | @@ -664,7 +747,7 @@ | |
2072 | # Kernel hacking | |
2073 | # | |
2074 | CONFIG_FRAME_POINTER=y | |
2075 | -CONFIG_DEBUG_USER=y | |
2076 | +# CONFIG_DEBUG_USER is not set | |
2077 | # CONFIG_DEBUG_INFO is not set | |
2078 | CONFIG_DEBUG_KERNEL=y | |
2079 | # CONFIG_DEBUG_SLAB is not set | |
2080 | @@ -673,7 +756,6 @@ | |
2081 | # CONFIG_DEBUG_WAITQ is not set | |
2082 | CONFIG_DEBUG_BUGVERBOSE=y | |
2083 | CONFIG_DEBUG_ERRORS=y | |
2084 | -# CONFIG_KALLSYMS is not set | |
2085 | CONFIG_DEBUG_LL=y | |
2086 | ||
2087 | # | |
2088 | diff -Nru a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile | |
2089 | --- a/arch/arm/kernel/Makefile Mon Aug 4 20:55:17 2003 | |
2090 | +++ b/arch/arm/kernel/Makefile Wed Sep 3 01:25:59 2003 | |
2091 | @@ -2,13 +2,11 @@ | |
2092 | # Makefile for the linux kernel. | |
2093 | # | |
2094 | ||
2095 | -ENTRY_OBJ = entry-$(PROCESSOR).o | |
2096 | - | |
2097 | AFLAGS_head.o := -DTEXTADDR=$(TEXTADDR) | |
2098 | ||
2099 | # Object file lists. | |
2100 | ||
2101 | -obj-y := arch.o compat.o dma.o $(ENTRY_OBJ) entry-common.o irq.o \ | |
2102 | +obj-y := arch.o compat.o dma.o entry-armv.o entry-common.o irq.o \ | |
2103 | process.o ptrace.o semaphore.o setup.o signal.o sys_arm.o \ | |
2104 | time.o traps.o | |
2105 | ||
2106 | @@ -34,6 +32,5 @@ | |
2107 | ||
2108 | # Spell out some dependencies that `make dep' doesn't spot | |
2109 | $(obj)/entry-armv.o: $(obj)/entry-header.S include/asm-arm/constants.h | |
2110 | -$(obj)/entry-armo.o: $(obj)/entry-header.S include/asm-arm/constants.h | |
2111 | $(obj)/entry-common.o: $(obj)/entry-header.S include/asm-arm/constants.h \ | |
2112 | $(obj)/calls.S | |
2113 | diff -Nru a/arch/arm/kernel/apm.c b/arch/arm/kernel/apm.c | |
2114 | --- a/arch/arm/kernel/apm.c Wed Mar 26 05:00:46 2003 | |
2115 | +++ b/arch/arm/kernel/apm.c Sun Aug 31 16:14:08 2003 | |
2116 | @@ -26,6 +26,7 @@ | |
2117 | #include <linux/init.h> | |
2118 | #include <linux/completion.h> | |
2119 | ||
2120 | +#include <asm/apm.h> /* apm_power_info */ | |
2121 | #include <asm/system.h> | |
2122 | ||
2123 | /* | |
2124 | @@ -93,18 +94,7 @@ | |
2125 | ||
2126 | static const char driver_version[] = "1.13"; /* no spaces */ | |
2127 | ||
2128 | -/* | |
2129 | - * This structure gets filled in by the machine specific 'get_power_status' | |
2130 | - * implementation. Any fields which are not set default to a safe value. | |
2131 | - */ | |
2132 | -struct apm_power_info { | |
2133 | - unsigned char ac_line_status; | |
2134 | - unsigned char battery_status; | |
2135 | - unsigned char battery_flag; | |
2136 | - unsigned char battery_life; | |
2137 | - int time; | |
2138 | - int units; | |
2139 | -}; | |
2140 | + | |
2141 | ||
2142 | /* | |
2143 | * Compatibility cruft until the IPAQ people move over to the new | |
2144 | @@ -388,18 +378,18 @@ | |
2145 | } | |
2146 | ||
2147 | static struct file_operations apm_bios_fops = { | |
2148 | - owner: THIS_MODULE, | |
2149 | - read: apm_read, | |
2150 | - poll: apm_poll, | |
2151 | - ioctl: apm_ioctl, | |
2152 | - open: apm_open, | |
2153 | - release: apm_release, | |
2154 | + .owner = THIS_MODULE, | |
2155 | + .read = apm_read, | |
2156 | + .poll = apm_poll, | |
2157 | + .ioctl = apm_ioctl, | |
2158 | + .open = apm_open, | |
2159 | + .release = apm_release, | |
2160 | }; | |
2161 | ||
2162 | static struct miscdevice apm_device = { | |
2163 | - minor: APM_MINOR_DEV, | |
2164 | - name: "apm_bios", | |
2165 | - fops: &apm_bios_fops | |
2166 | + .minor = APM_MINOR_DEV, | |
2167 | + .name = "apm_bios", | |
2168 | + .fops = &apm_bios_fops | |
2169 | }; | |
2170 | ||
2171 | ||
2172 | diff -Nru a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c | |
2173 | --- a/arch/arm/kernel/bios32.c Thu Jul 31 16:47:19 2003 | |
2174 | +++ b/arch/arm/kernel/bios32.c Sun Aug 24 06:12:42 2003 | |
2175 | @@ -263,7 +263,7 @@ | |
2176 | void __devinit pcibios_update_irq(struct pci_dev *dev, int irq) | |
2177 | { | |
2178 | if (debug_pci) | |
2179 | - printk("PCI: Assigning IRQ %02d to %s\n", irq, dev->dev.name); | |
2180 | + printk("PCI: Assigning IRQ %02d to %s\n", irq, pci_name(dev)); | |
2181 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | |
2182 | } | |
2183 | ||
2184 | @@ -362,6 +362,19 @@ | |
2185 | isa_bridge = dev; | |
2186 | break; | |
2187 | #endif | |
2188 | + case PCI_CLASS_BRIDGE_PCI: | |
2189 | + pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &status); | |
2190 | + status |= PCI_BRIDGE_CTL_PARITY|PCI_BRIDGE_CTL_MASTER_ABORT; | |
2191 | + status &= ~(PCI_BRIDGE_CTL_BUS_RESET|PCI_BRIDGE_CTL_FAST_BACK); | |
2192 | + pci_write_config_word(dev, PCI_BRIDGE_CONTROL, status); | |
2193 | + break; | |
2194 | + | |
2195 | + case PCI_CLASS_BRIDGE_CARDBUS: | |
2196 | + pci_read_config_word(dev, PCI_CB_BRIDGE_CONTROL, &status); | |
2197 | + status |= PCI_CB_BRIDGE_CTL_PARITY|PCI_CB_BRIDGE_CTL_MASTER_ABORT; | |
2198 | + pci_write_config_word(dev, PCI_CB_BRIDGE_CONTROL, status); | |
2199 | + break; | |
2200 | + } | |
2201 | } | |
2202 | ||
2203 | /* | |
2204 | diff -Nru a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c | |
2205 | --- a/arch/arm/kernel/ecard.c Fri Aug 15 15:22:53 2003 | |
2206 | +++ b/arch/arm/kernel/ecard.c Sun Aug 24 05:44:40 2003 | |
2207 | @@ -896,7 +896,7 @@ | |
2208 | static ssize_t ecard_show_vendor(struct device *dev, char *buf) | |
2209 | { | |
2210 | struct expansion_card *ec = ECARD_DEV(dev); | |
2211 | - return sprintf(buf, "%u\n", ec->manufacturer); | |
2212 | + return sprintf(buf, "%u\n", ec->cid.manufacturer); | |
2213 | } | |
2214 | ||
2215 | static DEVICE_ATTR(vendor, S_IRUGO, ecard_show_vendor, NULL); | |
2216 | @@ -904,7 +904,7 @@ | |
2217 | static ssize_t ecard_show_device(struct device *dev, char *buf) | |
2218 | { | |
2219 | struct expansion_card *ec = ECARD_DEV(dev); | |
2220 | - return sprintf(buf, "%u\n", ec->product); | |
2221 | + return sprintf(buf, "%u\n", ec->cid.product); | |
2222 | } | |
2223 | ||
2224 | static DEVICE_ATTR(device, S_IRUGO, ecard_show_device, NULL); | |
2225 | diff -Nru a/arch/arm/kernel/entry-armo.S b/arch/arm/kernel/entry-armo.S | |
2226 | --- a/arch/arm/kernel/entry-armo.S Mon Feb 24 12:42:23 2003 | |
2227 | +++ /dev/null Wed Dec 31 16:00:00 1969 | |
2228 | @@ -1,633 +0,0 @@ | |
2229 | -/* | |
2230 | - * linux/arch/arm/kernel/entry-armo.S | |
2231 | - * | |
2232 | - * Copyright (C) 1995,1996,1997,1998 Russell King. | |
2233 | - * | |
2234 | - * This program is free software; you can redistribute it and/or modify | |
2235 | - * it under the terms of the GNU General Public License version 2 as | |
2236 | - * published by the Free Software Foundation. | |
2237 | - * | |
2238 | - * Low-level vector interface routines | |
2239 | - * | |
2240 | - * Design issues: | |
2241 | - * - We have several modes that each vector can be called from, | |
2242 | - * each with its own set of registers. On entry to any vector, | |
2243 | - * we *must* save the registers used in *that* mode. | |
2244 | - * | |
2245 | - * - This code must be as fast as possible. | |
2246 | - * | |
2247 | - * There are a few restrictions on the vectors: | |
2248 | - * - the SWI vector cannot be called from *any* non-user mode | |
2249 | - * | |
2250 | - * - the FP emulator is *never* called from *any* non-user mode undefined | |
2251 | - * instruction. | |
2252 | - * | |
2253 | - * Ok, so this file may be a mess, but its as efficient as possible while | |
2254 | - * adhering to the above criteria. | |
2255 | - */ | |
2256 | -#include <linux/config.h> | |
2257 | -#include <linux/init.h> | |
2258 | -#include "entry-header.S" | |
2259 | - | |
2260 | - .text | |
2261 | - | |
2262 | -#ifdef IOC_BASE | |
2263 | -/* IOC / IOMD based hardware */ | |
2264 | - .equ ioc_base_high, IOC_BASE & 0xff000000 | |
2265 | - .equ ioc_base_low, IOC_BASE & 0x00ff0000 | |
2266 | - .macro disable_fiq | |
2267 | - mov r12, #ioc_base_high | |
2268 | - .if ioc_base_low | |
2269 | - orr r12, r12, #ioc_base_low | |
2270 | - .endif | |
2271 | - strb r12, [r12, #0x38] @ Disable FIQ register | |
2272 | - .endm | |
2273 | - | |
2274 | - .macro get_irqnr_and_base, irqnr, base | |
2275 | - mov r4, #ioc_base_high @ point at IOC | |
2276 | - .if ioc_base_low | |
2277 | - orr r4, r4, #ioc_base_low | |
2278 | - .endif | |
2279 | - ldrb \irqnr, [r4, #0x24] @ get high priority first | |
2280 | - adr \base, irq_prio_h | |
2281 | - teq \irqnr, #0 | |
2282 | - ldreqb \irqnr, [r4, #0x14] @ get low priority | |
2283 | - adreq \base, irq_prio_l | |
2284 | - .endm | |
2285 | - | |
2286 | -/* | |
2287 | - * Interrupt table (incorporates priority) | |
2288 | - */ | |
2289 | - .macro irq_prio_table | |
2290 | -irq_prio_l: .byte 0, 0, 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3 | |
2291 | - .byte 4, 0, 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3 | |
2292 | - .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 | |
2293 | - .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 | |
2294 | - .byte 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3 | |
2295 | - .byte 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3 | |
2296 | - .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 | |
2297 | - .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 | |
2298 | - .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 | |
2299 | - .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 | |
2300 | - .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 | |
2301 | - .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 | |
2302 | - .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 | |
2303 | - .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 | |
2304 | - .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 | |
2305 | - .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 | |
2306 | -irq_prio_h: .byte 0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10 | |
2307 | - .byte 12, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10 | |
2308 | - .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10 | |
2309 | - .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10 | |
2310 | - .byte 14,14,14,14,10,10,10,10,11,11,11,11,10,10,10,10 | |
2311 | - .byte 14,14,14,14,10,10,10,10,11,11,11,11,10,10,10,10 | |
2312 | - .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10 | |
2313 | - .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10 | |
2314 | - .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10 | |
2315 | - .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10 | |
2316 | - .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10 | |
2317 | - .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10 | |
2318 | - .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10 | |
2319 | - .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10 | |
2320 | - .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10 | |
2321 | - .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10 | |
2322 | - .endm | |
2323 | -#else | |
2324 | -#error Unknown architecture | |
2325 | -#endif | |
2326 | - | |
2327 | -/*============================================================================= | |
2328 | - * For entry-common.S | |
2329 | - */ | |
2330 | - | |
2331 | -#if 0 | |
2332 | -/* | |
2333 | - * Uncomment these if you wish to get more debugging into about data aborts. | |
2334 | - */ | |
2335 | -#define FAULT_CODE_LDRSTRPOST 0x80 | |
2336 | -#define FAULT_CODE_LDRSTRPRE 0x40 | |
2337 | -#define FAULT_CODE_LDRSTRREG 0x20 | |
2338 | -#define FAULT_CODE_LDMSTM 0x10 | |
2339 | -#define FAULT_CODE_LDCSTC 0x08 | |
2340 | -#endif | |
2341 | -#define FAULT_CODE_PREFETCH 0x04 | |
2342 | -#define FAULT_CODE_WRITE 0x02 | |
2343 | -#define FAULT_CODE_FORCECOW 0x01 | |
2344 | - | |
2345 | -#define SVC_SAVE_ALL \ | |
2346 | - str sp, [sp, #-16]! ;\ | |
2347 | - str lr, [sp, #8] ;\ | |
2348 | - str lr, [sp, #4] ;\ | |
2349 | - stmfd sp!, {r0 - r12} ;\ | |
2350 | - mov r0, #-1 ;\ | |
2351 | - str r0, [sp, #S_OLD_R0] ;\ | |
2352 | - zero_fp | |
2353 | - | |
2354 | -#define SVC_IRQ_SAVE_ALL \ | |
2355 | - str sp, [sp, #-16]! ;\ | |
2356 | - str lr, [sp, #4] ;\ | |
2357 | - ldr lr, .LCirq ;\ | |
2358 | - ldr lr, [lr] ;\ | |
2359 | - str lr, [sp, #8] ;\ | |
2360 | - stmfd sp!, {r0 - r12} ;\ | |
2361 | - mov r0, #-1 ;\ | |
2362 | - str r0, [sp, #S_OLD_R0] ;\ | |
2363 | - zero_fp | |
2364 | - | |
2365 | -#define SVC_RESTORE_ALL \ | |
2366 | - ldmfd sp, {r0 - pc}^ | |
2367 | - | |
2368 | -/*============================================================================= | |
2369 | - * Undefined FIQs | |
2370 | - *----------------------------------------------------------------------------- | |
2371 | - */ | |
2372 | -_unexp_fiq: ldr sp, .LCfiq | |
2373 | - mov r12, #IOC_BASE | |
2374 | - strb r12, [r12, #0x38] @ Disable FIQ register | |
2375 | - teqp pc, #0x0c000003 | |
2376 | - mov r0, r0 | |
2377 | - stmfd sp!, {r0 - r3, ip, lr} | |
2378 | - adr r0, Lfiqmsg | |
2379 | - bl printk | |
2380 | - ldmfd sp!, {r0 - r3, ip, lr} | |
2381 | - teqp pc, #0x0c000001 | |
2382 | - mov r0, r0 | |
2383 | - movs pc, lr | |
2384 | - | |
2385 | -Lfiqmsg: .ascii "*** Unexpected FIQ\n\0" | |
2386 | - .align | |
2387 | - | |
2388 | -.LCfiq: .word __temp_fiq | |
2389 | -.LCirq: .word __temp_irq | |
2390 | - | |
2391 | -/*============================================================================= | |
2392 | - * Undefined instruction handler | |
2393 | - *----------------------------------------------------------------------------- | |
2394 | - * Handles floating point instructions | |
2395 | - */ | |
2396 | -vector_undefinstr: | |
2397 | - tst lr,#3 | |
2398 | - bne __und_svc | |
2399 | - save_user_regs | |
2400 | - zero_fp | |
2401 | - teqp pc, #PSR_I_BIT | MODE_SVC | |
2402 | -.Lbug_undef: | |
2403 | - ldr r4, .LC2 | |
2404 | - ldr pc, [r4] @ Call FP module USR entry point | |
2405 | - | |
2406 | - .globl fpundefinstr | |
2407 | -fpundefinstr: @ Called by FP module on undefined instr | |
2408 | - mov r0, lr | |
2409 | - mov r1, sp | |
2410 | - teqp pc, #MODE_SVC | |
2411 | - bl do_undefinstr | |
2412 | - b ret_from_exception @ Normal FP exit | |
2413 | - | |
2414 | -__und_svc: SVC_SAVE_ALL @ Non-user mode | |
2415 | - mask_pc r0, lr | |
2416 | - and r2, lr, #3 | |
2417 | - sub r0, r0, #4 | |
2418 | - mov r1, sp | |
2419 | - bl do_undefinstr | |
2420 | - SVC_RESTORE_ALL | |
2421 | - | |
2422 | -#if defined CONFIG_FPE_NWFPE || defined CONFIG_FPE_FASTFPE | |
2423 | - /* The FPE is always present */ | |
2424 | - .equ fpe_not_present, 0 | |
2425 | -#else | |
2426 | -/* We get here if an undefined instruction happens and the floating | |
2427 | - * point emulator is not present. If the offending instruction was | |
2428 | - * a WFS, we just perform a normal return as if we had emulated the | |
2429 | - * operation. This is a hack to allow some basic userland binaries | |
2430 | - * to run so that the emulator module proper can be loaded. --philb | |
2431 | - */ | |
2432 | -fpe_not_present: | |
2433 | - adr r10, wfs_mask_data | |
2434 | - ldmia r10, {r4, r5, r6, r7, r8} | |
2435 | - ldr r10, [sp, #S_PC] @ Load PC | |
2436 | - sub r10, r10, #4 | |
2437 | - mask_pc r10, r10 | |
2438 | - ldrt r10, [r10] @ get instruction | |
2439 | - and r5, r10, r5 | |
2440 | - teq r5, r4 @ Is it WFS? | |
2441 | - beq ret_from_exception | |
2442 | - and r5, r10, r8 | |
2443 | - teq r5, r6 @ Is it LDF/STF on sp or fp? | |
2444 | - teqne r5, r7 | |
2445 | - bne fpundefinstr | |
2446 | - tst r10, #0x00200000 @ Does it have WB | |
2447 | - beq ret_from_exception | |
2448 | - and r4, r10, #255 @ get offset | |
2449 | - and r6, r10, #0x000f0000 | |
2450 | - tst r10, #0x00800000 @ +/- | |
2451 | - ldr r5, [sp, r6, lsr #14] @ Load reg | |
2452 | - rsbeq r4, r4, #0 | |
2453 | - add r5, r5, r4, lsl #2 | |
2454 | - str r5, [sp, r6, lsr #14] @ Save reg | |
2455 | - b ret_from_exception | |
2456 | - | |
2457 | -wfs_mask_data: .word 0x0e200110 @ WFS/RFS | |
2458 | - .word 0x0fef0fff | |
2459 | - .word 0x0d0d0100 @ LDF [sp]/STF [sp] | |
2460 | - .word 0x0d0b0100 @ LDF [fp]/STF [fp] | |
2461 | - .word 0x0f0f0f00 | |
2462 | -#endif | |
2463 | - | |
2464 | -.LC2: .word fp_enter | |
2465 | - | |
2466 | -/*============================================================================= | |
2467 | - * Prefetch abort handler | |
2468 | - *----------------------------------------------------------------------------- | |
2469 | - */ | |
2470 | - | |
2471 | -vector_prefetch: | |
2472 | - sub lr, lr, #4 | |
2473 | - tst lr, #3 | |
2474 | - bne __pabt_invalid | |
2475 | - save_user_regs | |
2476 | - teqp pc, #0x00000003 @ NOT a problem - doesn't change mode | |
2477 | - mask_pc r0, lr @ Address of abort | |
2478 | - mov r1, sp @ Tasks registers | |
2479 | - bl do_PrefetchAbort | |
2480 | - teq r0, #0 @ If non-zero, we believe this abort.. | |
2481 | - bne ret_from_exception | |
2482 | -#ifdef DEBUG_UNDEF | |
2483 | - adr r0, t | |
2484 | - bl printk | |
2485 | -#endif | |
2486 | - ldr lr, [sp,#S_PC] @ program to test this on. I think its | |
2487 | - b .Lbug_undef @ broken at the moment though!) | |
2488 | - | |
2489 | -__pabt_invalid: SVC_SAVE_ALL | |
2490 | - mov r0, sp @ Prefetch aborts are definitely *not* | |
2491 | - mov r1, #BAD_PREFETCH @ allowed in non-user modes. We cant | |
2492 | - and r2, lr, #3 @ recover from this problem. | |
2493 | - b bad_mode | |
2494 | - | |
2495 | -#ifdef DEBUG_UNDEF | |
2496 | -t: .ascii "*** undef ***\r\n\0" | |
2497 | - .align | |
2498 | -#endif | |
2499 | - | |
2500 | -/*============================================================================= | |
2501 | - * Address exception handler | |
2502 | - *----------------------------------------------------------------------------- | |
2503 | - * These aren't too critical. | |
2504 | - * (they're not supposed to happen). | |
2505 | - * In order to debug the reason for address exceptions in non-user modes, | |
2506 | - * we have to obtain all the registers so that we can see what's going on. | |
2507 | - */ | |
2508 | - | |
2509 | -vector_addrexcptn: | |
2510 | - sub lr, lr, #8 | |
2511 | - tst lr, #3 | |
2512 | - bne Laddrexcptn_not_user | |
2513 | - save_user_regs | |
2514 | - teq pc, #0x00000003 | |
2515 | - mask_pc r0, lr @ Point to instruction | |
2516 | - mov r1, sp @ Point to registers | |
2517 | - mov r2, #0x400 | |
2518 | - mov lr, pc | |
2519 | - bl do_excpt | |
2520 | - b ret_from_exception | |
2521 | - | |
2522 | -Laddrexcptn_not_user: | |
2523 | - SVC_SAVE_ALL | |
2524 | - and r2, lr, #3 | |
2525 | - teq r2, #3 | |
2526 | - bne Laddrexcptn_illegal_mode | |
2527 | - teqp pc, #0x00000003 @ NOT a problem - doesn't change mode | |
2528 | - mask_pc r0, lr | |
2529 | - mov r1, sp | |
2530 | - orr r2, r2, #0x400 | |
2531 | - bl do_excpt | |
2532 | - ldmia sp, {r0 - lr} @ I cant remember the reason I changed this... | |
2533 | - add sp, sp, #15*4 | |
2534 | - movs pc, lr | |
2535 | - | |
2536 | -Laddrexcptn_illegal_mode: | |
2537 | - mov r0, sp | |
2538 | - str lr, [sp, #-4]! | |
2539 | - orr r1, r2, #0x0c000000 | |
2540 | - teqp r1, #0 @ change into mode (wont be user mode) | |
2541 | - mov r0, r0 | |
2542 | - mov r1, r8 @ Any register from r8 - r14 can be banked | |
2543 | - mov r2, r9 | |
2544 | - mov r3, r10 | |
2545 | - mov r4, r11 | |
2546 | - mov r5, r12 | |
2547 | - mov r6, r13 | |
2548 | - mov r7, r14 | |
2549 | - teqp pc, #0x04000003 @ back to svc | |
2550 | - mov r0, r0 | |
2551 | - stmfd sp!, {r1-r7} | |
2552 | - ldmia r0, {r0-r7} | |
2553 | - stmfd sp!, {r0-r7} | |
2554 | - mov r0, sp | |
2555 | - mov r1, #BAD_ADDREXCPTN | |
2556 | - b bad_mode | |
2557 | - | |
2558 | -/*============================================================================= | |
2559 | - * Interrupt (IRQ) handler | |
2560 | - *----------------------------------------------------------------------------- | |
2561 | - * Note: if in user mode, then *no* kernel routine is running, so do not have | |
2562 | - * to save svc lr | |
2563 | - * (r13 points to irq temp save area) | |
2564 | - */ | |
2565 | - | |
2566 | -vector_IRQ: ldr r13, .LCirq @ I will leave this one in just in case... | |
2567 | - sub lr, lr, #4 | |
2568 | - str lr, [r13] | |
2569 | - tst lr, #3 | |
2570 | - bne __irq_svc | |
2571 | - teqp pc, #0x08000003 | |
2572 | - mov r0, r0 | |
2573 | - ldr lr, .LCirq | |
2574 | - ldr lr, [lr] | |
2575 | - save_user_regs | |
2576 | - | |
2577 | -1: get_irqnr_and_base r6, r5 | |
2578 | - teq r6, #0 | |
2579 | - ldrneb r0, [r5, r6] @ get IRQ number | |
2580 | - movne r1, sp | |
2581 | - @ | |
2582 | - @ routine called with r0 = irq number, r1 = struct pt_regs * | |
2583 | - @ | |
2584 | - adr lr, 1b | |
2585 | - orr lr, lr, #0x08000003 @ Force SVC | |
2586 | - bne asm_do_IRQ | |
2587 | - | |
2588 | - mov why, #0 | |
2589 | - get_current_task r5 | |
2590 | - b ret_to_user | |
2591 | - | |
2592 | - irq_prio_table | |
2593 | - | |
2594 | -__irq_svc: teqp pc, #0x08000003 | |
2595 | - mov r0, r0 | |
2596 | - SVC_IRQ_SAVE_ALL | |
2597 | - and r2, lr, #3 | |
2598 | - teq r2, #3 | |
2599 | - bne __irq_invalid | |
2600 | -1: get_irqnr_and_base r6, r5 | |
2601 | - teq r6, #0 | |
2602 | - ldrneb r0, [r5, r6] @ get IRQ number | |
2603 | - movne r1, sp | |
2604 | - @ | |
2605 | - @ routine called with r0 = irq number, r1 = struct pt_regs * | |
2606 | - @ | |
2607 | - adr lr, 1b | |
2608 | - orr lr, lr, #0x08000003 @ Force SVC | |
2609 | - bne asm_do_IRQ @ Returns to 1b | |
2610 | - SVC_RESTORE_ALL | |
2611 | - | |
2612 | -__irq_invalid: mov r0, sp | |
2613 | - mov r1, #BAD_IRQ | |
2614 | - b bad_mode | |
2615 | - | |
2616 | -/*============================================================================= | |
2617 | - * Data abort handler code | |
2618 | - *----------------------------------------------------------------------------- | |
2619 | - * | |
2620 | - * This handles both exceptions from user and SVC modes, computes the address | |
2621 | - * range of the problem, and does any correction that is required. It then | |
2622 | - * calls the kernel data abort routine. | |
2623 | - * | |
2624 | - * This is where I wish that the ARM would tell you which address aborted. | |
2625 | - */ | |
2626 | - | |
2627 | -vector_data: sub lr, lr, #8 @ Correct lr | |
2628 | - tst lr, #3 | |
2629 | - bne Ldata_not_user | |
2630 | - save_user_regs | |
2631 | - teqp pc, #0x00000003 @ NOT a problem - doesn't change mode | |
2632 | - mask_pc r0, lr | |
2633 | - bl Ldata_do | |
2634 | - b ret_from_exception | |
2635 | - | |
2636 | -Ldata_not_user: | |
2637 | - SVC_SAVE_ALL | |
2638 | - and r2, lr, #3 | |
2639 | - teq r2, #3 | |
2640 | - bne Ldata_illegal_mode | |
2641 | - tst lr, #0x08000000 | |
2642 | - teqeqp pc, #0x00000003 @ NOT a problem - doesn't change mode | |
2643 | - mask_pc r0, lr | |
2644 | - bl Ldata_do | |
2645 | - SVC_RESTORE_ALL | |
2646 | - | |
2647 | -Ldata_illegal_mode: | |
2648 | - mov r0, sp | |
2649 | - mov r1, #BAD_DATA | |
2650 | - b bad_mode | |
2651 | - | |
2652 | -Ldata_do: mov r3, sp | |
2653 | - ldr r4, [r0] @ Get instruction | |
2654 | - mov r2, #0 | |
2655 | - tst r4, #1 << 20 @ Check to see if it is a write instruction | |
2656 | - orreq r2, r2, #FAULT_CODE_WRITE @ Indicate write instruction | |
2657 | - mov r1, r4, lsr #22 @ Now branch to the relevant processing routine | |
2658 | - and r1, r1, #15 << 2 | |
2659 | - add pc, pc, r1 | |
2660 | - movs pc, lr | |
2661 | - b Ldata_unknown | |
2662 | - b Ldata_unknown | |
2663 | - b Ldata_unknown | |
2664 | - b Ldata_unknown | |
2665 | - b Ldata_ldrstr_post @ ldr rd, [rn], #m | |
2666 | - b Ldata_ldrstr_numindex @ ldr rd, [rn, #m] @ RegVal | |
2667 | - b Ldata_ldrstr_post @ ldr rd, [rn], rm | |
2668 | - b Ldata_ldrstr_regindex @ ldr rd, [rn, rm] | |
2669 | - b Ldata_ldmstm @ ldm*a rn, <rlist> | |
2670 | - b Ldata_ldmstm @ ldm*b rn, <rlist> | |
2671 | - b Ldata_unknown | |
2672 | - b Ldata_unknown | |
2673 | - b Ldata_ldrstr_post @ ldc rd, [rn], #m @ Same as ldr rd, [rn], #m | |
2674 | - b Ldata_ldcstc_pre @ ldc rd, [rn, #m] | |
2675 | - b Ldata_unknown | |
2676 | -Ldata_unknown: @ Part of jumptable | |
2677 | - mov r0, r1 | |
2678 | - mov r1, r4 | |
2679 | - mov r2, r3 | |
2680 | - b baddataabort | |
2681 | - | |
2682 | -Ldata_ldrstr_post: | |
2683 | - mov r0, r4, lsr #14 @ Get Rn | |
2684 | - and r0, r0, #15 << 2 @ Mask out reg. | |
2685 | - teq r0, #15 << 2 | |
2686 | - ldr r0, [r3, r0] @ Get register | |
2687 | - biceq r0, r0, #PCMASK | |
2688 | - mov r1, r0 | |
2689 | -#ifdef FAULT_CODE_LDRSTRPOST | |
2690 | - orr r2, r2, #FAULT_CODE_LDRSTRPOST | |
2691 | -#endif | |
2692 | - b do_DataAbort | |
2693 | - | |
2694 | -Ldata_ldrstr_numindex: | |
2695 | - mov r0, r4, lsr #14 @ Get Rn | |
2696 | - and r0, r0, #15 << 2 @ Mask out reg. | |
2697 | - teq r0, #15 << 2 | |
2698 | - ldr r0, [r3, r0] @ Get register | |
2699 | - mov r1, r4, lsl #20 | |
2700 | - biceq r0, r0, #PCMASK | |
2701 | - tst r4, #1 << 23 | |
2702 | - addne r0, r0, r1, lsr #20 | |
2703 | - subeq r0, r0, r1, lsr #20 | |
2704 | - mov r1, r0 | |
2705 | -#ifdef FAULT_CODE_LDRSTRPRE | |
2706 | - orr r2, r2, #FAULT_CODE_LDRSTRPRE | |
2707 | -#endif | |
2708 | - b do_DataAbort | |
2709 | - | |
2710 | -Ldata_ldrstr_regindex: | |
2711 | - mov r0, r4, lsr #14 @ Get Rn | |
2712 | - and r0, r0, #15 << 2 @ Mask out reg. | |
2713 | - teq r0, #15 << 2 | |
2714 | - ldr r0, [r3, r0] @ Get register | |
2715 | - and r7, r4, #15 | |
2716 | - biceq r0, r0, #PCMASK | |
2717 | - teq r7, #15 @ Check for PC | |
2718 | - ldr r7, [r3, r7, lsl #2] @ Get Rm | |
2719 | - and r8, r4, #0x60 @ Get shift types | |
2720 | - biceq r7, r7, #PCMASK | |
2721 | - mov r9, r4, lsr #7 @ Get shift amount | |
2722 | - and r9, r9, #31 | |
2723 | - teq r8, #0 | |
2724 | - moveq r7, r7, lsl r9 | |
2725 | - teq r8, #0x20 @ LSR shift | |
2726 | - moveq r7, r7, lsr r9 | |
2727 | - teq r8, #0x40 @ ASR shift | |
2728 | - moveq r7, r7, asr r9 | |
2729 | - teq r8, #0x60 @ ROR shift | |
2730 | - moveq r7, r7, ror r9 | |
2731 | - tst r4, #1 << 23 | |
2732 | - addne r0, r0, r7 | |
2733 | - subeq r0, r0, r7 @ Apply correction | |
2734 | - mov r1, r0 | |
2735 | -#ifdef FAULT_CODE_LDRSTRREG | |
2736 | - orr r2, r2, #FAULT_CODE_LDRSTRREG | |
2737 | -#endif | |
2738 | - b do_DataAbort | |
2739 | - | |
2740 | -Ldata_ldmstm: | |
2741 | - mov r7, #0x11 | |
2742 | - orr r7, r7, r7, lsl #8 | |
2743 | - and r0, r4, r7 | |
2744 | - and r1, r4, r7, lsl #1 | |
2745 | - add r0, r0, r1, lsr #1 | |
2746 | - and r1, r4, r7, lsl #2 | |
2747 | - add r0, r0, r1, lsr #2 | |
2748 | - and r1, r4, r7, lsl #3 | |
2749 | - add r0, r0, r1, lsr #3 | |
2750 | - add r0, r0, r0, lsr #8 | |
2751 | - add r0, r0, r0, lsr #4 | |
2752 | - and r7, r0, #15 @ r7 = no. of registers to transfer. | |
2753 | - mov r5, r4, lsr #14 @ Get Rn | |
2754 | - and r5, r5, #15 << 2 | |
2755 | - ldr r0, [r3, r5] @ Get reg | |
2756 | - eor r6, r4, r4, lsl #2 | |
2757 | - tst r6, #1 << 23 @ Check inc/dec ^ writeback | |
2758 | - rsbeq r7, r7, #0 | |
2759 | - add r7, r0, r7, lsl #2 @ Do correction (signed) | |
2760 | - subne r1, r7, #1 | |
2761 | - subeq r1, r0, #1 | |
2762 | - moveq r0, r7 | |
2763 | - tst r4, #1 << 21 @ Check writeback | |
2764 | - strne r7, [r3, r5] | |
2765 | - eor r6, r4, r4, lsl #1 | |
2766 | - tst r6, #1 << 24 @ Check Pre/Post ^ inc/dec | |
2767 | - addeq r0, r0, #4 | |
2768 | - addeq r1, r1, #4 | |
2769 | - teq r5, #15*4 @ CHECK FOR PC | |
2770 | - biceq r1, r1, #PCMASK | |
2771 | - biceq r0, r0, #PCMASK | |
2772 | -#ifdef FAULT_CODE_LDMSTM | |
2773 | - orr r2, r2, #FAULT_CODE_LDMSTM | |
2774 | -#endif | |
2775 | - b do_DataAbort | |
2776 | - | |
2777 | -Ldata_ldcstc_pre: | |
2778 | - mov r0, r4, lsr #14 @ Get Rn | |
2779 | - and r0, r0, #15 << 2 @ Mask out reg. | |
2780 | - teq r0, #15 << 2 | |
2781 | - ldr r0, [r3, r0] @ Get register | |
2782 | - mov r1, r4, lsl #24 @ Get offset | |
2783 | - biceq r0, r0, #PCMASK | |
2784 | - tst r4, #1 << 23 | |
2785 | - addne r0, r0, r1, lsr #24 | |
2786 | - subeq r0, r0, r1, lsr #24 | |
2787 | - mov r1, r0 | |
2788 | -#ifdef FAULT_CODE_LDCSTC | |
2789 | - orr r2, r2, #FAULT_CODE_LDCSTC | |
2790 | -#endif | |
2791 | - b do_DataAbort | |
2792 | - | |
2793 | - | |
2794 | -/* | |
2795 | - * This is the return code to user mode for abort handlers | |
2796 | - */ | |
2797 | -ENTRY(ret_from_exception) | |
2798 | - get_current_task tsk | |
2799 | - mov why, #0 | |
2800 | - b ret_to_user | |
2801 | - | |
2802 | - .data | |
2803 | -ENTRY(fp_enter) | |
2804 | - .word fpe_not_present | |
2805 | - .text | |
2806 | -/* | |
2807 | - * Register switch for older 26-bit only ARMs | |
2808 | - */ | |
2809 | -ENTRY(__switch_to) | |
2810 | - stmfd sp!, {r4 - sl, fp, lr} @ Store most regs on stack | |
2811 | - str sp, [r0, #TSS_SAVE] @ Save sp_SVC | |
2812 | - ldr sp, [r1, #TSS_SAVE] @ Get saved sp_SVC | |
2813 | - ldmfd sp!, {r4 - sl, fp, pc}^ @ Load all regs saved previously | |
2814 | - | |
2815 | -/* | |
2816 | - *============================================================================= | |
2817 | - * Low-level interface code | |
2818 | - *----------------------------------------------------------------------------- | |
2819 | - * Trap initialisation | |
2820 | - *----------------------------------------------------------------------------- | |
2821 | - * | |
2822 | - * Note - FIQ code has changed. The default is a couple of words in 0x1c, 0x20 | |
2823 | - * that call _unexp_fiq. Nowever, we now copy the FIQ routine to 0x1c (removes | |
2824 | - * some excess cycles). | |
2825 | - * | |
2826 | - * What we need to put into 0-0x1c are branches to branch to the kernel. | |
2827 | - */ | |
2828 | - | |
2829 | - __INIT | |
2830 | - | |
2831 | -.Ljump_addresses: | |
2832 | - swi SYS_ERROR0 | |
2833 | - .word vector_undefinstr - 12 | |
2834 | - .word vector_swi - 16 | |
2835 | - .word vector_prefetch - 20 | |
2836 | - .word vector_data - 24 | |
2837 | - .word vector_addrexcptn - 28 | |
2838 | - .word vector_IRQ - 32 | |
2839 | - .word _unexp_fiq - 36 | |
2840 | - b . + 8 | |
2841 | -/* | |
2842 | - * initialise the trap system | |
2843 | - */ | |
2844 | -ENTRY(__trap_init) | |
2845 | - stmfd sp!, {r4 - r7, lr} | |
2846 | - adr r1, .Ljump_addresses | |
2847 | - ldmia r1, {r1 - r7, ip, lr} | |
2848 | - orr r2, lr, r2, lsr #2 | |
2849 | - orr r3, lr, r3, lsr #2 | |
2850 | - orr r4, lr, r4, lsr #2 | |
2851 | - orr r5, lr, r5, lsr #2 | |
2852 | - orr r6, lr, r6, lsr #2 | |
2853 | - orr r7, lr, r7, lsr #2 | |
2854 | - orr ip, lr, ip, lsr #2 | |
2855 | - mov r0, #0 | |
2856 | - stmia r0, {r1 - r7, ip} | |
2857 | - ldmfd sp!, {r4 - r7, pc}^ | |
2858 | - | |
2859 | - .bss | |
2860 | -__temp_irq: .space 4 @ saved lr_irq | |
2861 | -__temp_fiq: .space 128 | |
2862 | diff -Nru a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S | |
2863 | --- a/arch/arm/kernel/entry-armv.S Tue Apr 22 05:39:46 2003 | |
2864 | +++ b/arch/arm/kernel/entry-armv.S Wed Sep 3 10:17:53 2003 | |
2865 | @@ -15,10 +15,12 @@ | |
2866 | */ | |
2867 | #include <linux/config.h> | |
2868 | #include <linux/init.h> | |
2869 | -#include "entry-header.S" | |
2870 | + | |
2871 | #include <asm/thread_info.h> | |
2872 | #include <asm/glue.h> | |
2873 | +#include <asm/ptrace.h> | |
2874 | ||
2875 | +#include "entry-header.S" | |
2876 | ||
2877 | #ifdef IOC_BASE | |
2878 | /* IOC / IOMD based hardware */ | |
2879 | diff -Nru a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S | |
2880 | --- a/arch/arm/kernel/entry-common.S Wed Mar 26 05:13:45 2003 | |
2881 | +++ b/arch/arm/kernel/entry-common.S Wed Sep 3 10:17:54 2003 | |
2882 | @@ -8,8 +8,11 @@ | |
2883 | * published by the Free Software Foundation. | |
2884 | */ | |
2885 | #include <linux/config.h> | |
2886 | -#include "entry-header.S" | |
2887 | + | |
2888 | #include <asm/thread_info.h> | |
2889 | +#include <asm/ptrace.h> | |
2890 | + | |
2891 | +#include "entry-header.S" | |
2892 | ||
2893 | /* | |
2894 | * We rely on the fact that R0 is at the bottom of the stack (due to | |
2895 | diff -Nru a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S | |
2896 | --- a/arch/arm/kernel/entry-header.S Tue Mar 4 16:47:50 2003 | |
2897 | +++ b/arch/arm/kernel/entry-header.S Sun Aug 24 06:17:52 2003 | |
2898 | @@ -63,13 +63,7 @@ | |
2899 | #define S_OFF 8 | |
2900 | ||
2901 | .macro set_cpsr_c, reg, mode | |
2902 | -#if 1 | |
2903 | - /* broken binutils */ | |
2904 | - mov \reg, \mode | |
2905 | - msr cpsr_c, \reg | |
2906 | -#else | |
2907 | msr cpsr_c, \mode | |
2908 | -#endif | |
2909 | .endm | |
2910 | ||
2911 | .macro disable_irq, temp | |
2912 | diff -Nru a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S | |
2913 | --- a/arch/arm/kernel/head.S Tue Apr 8 01:29:38 2003 | |
2914 | +++ b/arch/arm/kernel/head.S Wed Sep 3 10:17:54 2003 | |
2915 | @@ -16,6 +16,7 @@ | |
2916 | #include <asm/assembler.h> | |
2917 | #include <asm/mach-types.h> | |
2918 | #include <asm/procinfo.h> | |
2919 | +#include <asm/ptrace.h> | |
2920 | #include <asm/mach/arch.h> | |
2921 | ||
2922 | /* | |
2923 | diff -Nru a/arch/arm/kernel/pm.c b/arch/arm/kernel/pm.c | |
2924 | --- a/arch/arm/kernel/pm.c Sat Jun 21 03:42:03 2003 | |
2925 | +++ b/arch/arm/kernel/pm.c Sun Aug 24 05:40:01 2003 | |
2926 | @@ -36,23 +36,7 @@ | |
2927 | if (ret != 0) | |
2928 | goto out; | |
2929 | ||
2930 | - /* | |
2931 | - * Tell LDM devices we're going to suspend. | |
2932 | - */ | |
2933 | - ret = device_suspend(4, SUSPEND_NOTIFY); | |
2934 | - if (ret != 0) | |
2935 | - goto resume_legacy; | |
2936 | - | |
2937 | - /* | |
2938 | - * Disable, devices, and save state. | |
2939 | - */ | |
2940 | - device_suspend(4, SUSPEND_DISABLE); | |
2941 | - device_suspend(4, SUSPEND_SAVE_STATE); | |
2942 | - | |
2943 | - /* | |
2944 | - * Tell devices that they're going to be powered off. | |
2945 | - */ | |
2946 | - device_suspend(4, SUSPEND_POWER_DOWN); | |
2947 | + device_suspend(3); | |
2948 | ||
2949 | local_irq_disable(); | |
2950 | leds_event(led_stop); | |
2951 | @@ -62,21 +46,8 @@ | |
2952 | leds_event(led_start); | |
2953 | local_irq_enable(); | |
2954 | ||
2955 | - /* | |
2956 | - * Tell devices that they now have power. | |
2957 | - */ | |
2958 | - device_resume(RESUME_POWER_ON); | |
2959 | - | |
2960 | - /* | |
2961 | - * Resume LDM devices. | |
2962 | - */ | |
2963 | - device_resume(RESUME_RESTORE_STATE); | |
2964 | - device_resume(RESUME_ENABLE); | |
2965 | + device_resume(); | |
2966 | ||
2967 | - resume_legacy: | |
2968 | - /* | |
2969 | - * Resume "legacy" devices. | |
2970 | - */ | |
2971 | pm_send_all(PM_RESUME, (void *)0); | |
2972 | ||
2973 | out: | |
2974 | diff -Nru a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S | |
2975 | --- a/arch/arm/kernel/vmlinux.lds.S Mon Aug 4 20:39:42 2003 | |
2976 | +++ b/arch/arm/kernel/vmlinux.lds.S Sun Aug 24 04:26:29 2003 | |
2977 | @@ -1,21 +1,134 @@ | |
2978 | -#include <linux/config.h> | |
2979 | - | |
2980 | -#ifdef CONFIG_CPU_26 | |
2981 | - | |
2982 | -#ifdef CONFIG_ROM_KERNEL | |
2983 | - | |
2984 | -#include "vmlinux-armo-rom.lds.in" | |
2985 | - | |
2986 | +/* ld script to make ARM Linux kernel | |
2987 | + * taken from the i386 version by Russell King | |
2988 | + * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> | |
2989 | + */ | |
2990 | + | |
2991 | +#include <asm-generic/vmlinux.lds.h> | |
2992 | + | |
2993 | +OUTPUT_ARCH(arm) | |
2994 | +ENTRY(stext) | |
2995 | +#ifndef __ARMEB__ | |
2996 | +jiffies = jiffies_64; | |
2997 | #else | |
2998 | - | |
2999 | -#include "vmlinux-armo.lds.in" | |
3000 | - | |
3001 | -#endif | |
3002 | - | |
3003 | -#endif | |
3004 | - | |
3005 | -#ifdef CONFIG_CPU_32 | |
3006 | - | |
3007 | -#include "vmlinux-armv.lds.in" | |
3008 | - | |
3009 | +jiffies = jiffies_64 + 4; | |
3010 | #endif | |
3011 | +SECTIONS | |
3012 | +{ | |
3013 | + . = TEXTADDR; | |
3014 | + .init : { /* Init code and data */ | |
3015 | + _stext = .; | |
3016 | + __init_begin = .; | |
3017 | + _sinittext = .; | |
3018 | + *(.init.text) | |
3019 | + _einittext = .; | |
3020 | + __proc_info_begin = .; | |
3021 | + *(.proc.info) | |
3022 | + __proc_info_end = .; | |
3023 | + __arch_info_begin = .; | |
3024 | + *(.arch.info) | |
3025 | + __arch_info_end = .; | |
3026 | + __tagtable_begin = .; | |
3027 | + *(.taglist) | |
3028 | + __tagtable_end = .; | |
3029 | + *(.init.data) | |
3030 | + . = ALIGN(16); | |
3031 | + __setup_start = .; | |
3032 | + *(.init.setup) | |
3033 | + __setup_end = .; | |
3034 | + __early_begin = .; | |
3035 | + *(__early_param) | |
3036 | + __early_end = .; | |
3037 | + __start___param = .; | |
3038 | + *(__param) | |
3039 | + __stop___param = .; | |
3040 | + __initcall_start = .; | |
3041 | + *(.initcall1.init) | |
3042 | + *(.initcall2.init) | |
3043 | + *(.initcall3.init) | |
3044 | + *(.initcall4.init) | |
3045 | + *(.initcall5.init) | |
3046 | + *(.initcall6.init) | |
3047 | + *(.initcall7.init) | |
3048 | + __initcall_end = .; | |
3049 | + __con_initcall_start = .; | |
3050 | + *(.con_initcall.init) | |
3051 | + __con_initcall_end = .; | |
3052 | + __security_initcall_start = .; | |
3053 | + *(.security_initcall.init) | |
3054 | + __security_initcall_end = .; | |
3055 | + . = ALIGN(32); | |
3056 | + __initramfs_start = .; | |
3057 | + usr/built-in.o(.init.ramfs) | |
3058 | + __initramfs_end = .; | |
3059 | + . = ALIGN(4096); | |
3060 | + __init_end = .; | |
3061 | + } | |
3062 | + | |
3063 | + /DISCARD/ : { /* Exit code and data */ | |
3064 | + *(.exit.text) | |
3065 | + *(.exit.data) | |
3066 | + *(.exitcall.exit) | |
3067 | + } | |
3068 | + | |
3069 | + .text : { /* Real text segment */ | |
3070 | + _text = .; /* Text and read-only data */ | |
3071 | + *(.text) | |
3072 | + *(.fixup) | |
3073 | + *(.gnu.warning) | |
3074 | + *(.rodata) | |
3075 | + *(.rodata.*) | |
3076 | + *(.glue_7) | |
3077 | + *(.glue_7t) | |
3078 | + *(.got) /* Global offset table */ | |
3079 | + | |
3080 | + _etext = .; /* End of text section */ | |
3081 | + } | |
3082 | + | |
3083 | + . = ALIGN(16); | |
3084 | + __ex_table : { /* Exception table */ | |
3085 | + __start___ex_table = .; | |
3086 | + *(__ex_table) | |
3087 | + __stop___ex_table = .; | |
3088 | + } | |
3089 | + | |
3090 | + RODATA | |
3091 | + | |
3092 | + . = ALIGN(8192); | |
3093 | + | |
3094 | + .data : { | |
3095 | + /* | |
3096 | + * first, the init task union, aligned | |
3097 | + * to an 8192 byte boundary. | |
3098 | + */ | |
3099 | + *(.init.task) | |
3100 | + | |
3101 | + /* | |
3102 | + * then the cacheline aligned data | |
3103 | + */ | |
3104 | + . = ALIGN(32); | |
3105 | + *(.data.cacheline_aligned) | |
3106 | + | |
3107 | + /* | |
3108 | + * and the usual data section | |
3109 | + */ | |
3110 | + *(.data) | |
3111 | + CONSTRUCTORS | |
3112 | + | |
3113 | + _edata = .; | |
3114 | + } | |
3115 | + | |
3116 | + .bss : { | |
3117 | + __bss_start = .; /* BSS */ | |
3118 | + *(.bss) | |
3119 | + *(COMMON) | |
3120 | + _end = . ; | |
3121 | + } | |
3122 | + /* Stabs debugging sections. */ | |
3123 | + .stab 0 : { *(.stab) } | |
3124 | + .stabstr 0 : { *(.stabstr) } | |
3125 | + .stab.excl 0 : { *(.stab.excl) } | |
3126 | + .stab.exclstr 0 : { *(.stab.exclstr) } | |
3127 | + .stab.index 0 : { *(.stab.index) } | |
3128 | + .stab.indexstr 0 : { *(.stab.indexstr) } | |
3129 | + .comment 0 : { *(.comment) } | |
3130 | +} | |
3131 | diff -Nru a/arch/arm/mach-footbridge/netwinder-pci.c b/arch/arm/mach-footbridge/netwinder-pci.c | |
3132 | --- a/arch/arm/mach-footbridge/netwinder-pci.c Thu Jul 31 16:47:19 2003 | |
3133 | +++ b/arch/arm/mach-footbridge/netwinder-pci.c Sun Aug 24 04:37:15 2003 | |
3134 | @@ -36,8 +36,8 @@ | |
3135 | return IRQ_NETWINDER_ETHER10; | |
3136 | ||
3137 | default: | |
3138 | - printk(KERN_ERR "PCI: unknown device in slot %s: %s\n", | |
3139 | - pci_name(dev), dev->dev.name); | |
3140 | + printk(KERN_ERR "PCI: unknown device in slot %s\n", | |
3141 | + pci_name(dev)); | |
3142 | return 0; | |
3143 | } | |
3144 | } | |
3145 | diff -Nru a/arch/arm/mach-iop3xx/iop321-time.c b/arch/arm/mach-iop3xx/iop321-time.c | |
3146 | --- a/arch/arm/mach-iop3xx/iop321-time.c Tue Apr 15 08:12:47 2003 | |
3147 | +++ b/arch/arm/mach-iop3xx/iop321-time.c Wed Aug 13 16:46:20 2003 | |
3148 | @@ -51,7 +51,8 @@ | |
3149 | return usec; | |
3150 | } | |
3151 | ||
3152 | -static void iop321_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |
3153 | +static irqreturn_t | |
3154 | +iop321_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |
3155 | { | |
3156 | u32 tisr; | |
3157 | ||
3158 | @@ -62,6 +63,8 @@ | |
3159 | asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (tisr)); | |
3160 | ||
3161 | do_timer(regs); | |
3162 | + | |
3163 | + return IRQ_HANDLED; | |
3164 | } | |
3165 | ||
3166 | extern unsigned long (*gettimeoffset)(void); | |
3167 | diff -Nru a/arch/arm/mach-iop3xx/iq80310-time.c b/arch/arm/mach-iop3xx/iq80310-time.c | |
3168 | --- a/arch/arm/mach-iop3xx/iq80310-time.c Mon Apr 21 15:43:40 2003 | |
3169 | +++ b/arch/arm/mach-iop3xx/iq80310-time.c Wed Aug 13 16:46:20 2003 | |
3170 | @@ -88,7 +88,8 @@ | |
3171 | } | |
3172 | ||
3173 | ||
3174 | -static void iq80310_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |
3175 | +static irqreturn_t | |
3176 | +iq80310_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |
3177 | { | |
3178 | volatile u_char *timer_en = (volatile u_char *)IQ80310_TIMER_EN; | |
3179 | ||
3180 | @@ -96,21 +97,9 @@ | |
3181 | *timer_en &= ~2; | |
3182 | *timer_en |= 2; | |
3183 | ||
3184 | - /* | |
3185 | - * AHEM..HACK | |
3186 | - * | |
3187 | - * Since the timer interrupt is cascaded through the CPLD and | |
3188 | - * the 80312 and the demux code calls do_IRQ, the irq count is | |
3189 | - * going to be at least 2 when we get here and this will cause the | |
3190 | - * kernel to increment the system tick counter even if we're | |
3191 | - * idle. This causes it to look like there's always 100% system | |
3192 | - * time, which is not the case. To get around it, we just decrement | |
3193 | - * the IRQ count before calling do_timer. We increment it again | |
3194 | - * b/c otherwise it will go negative and than bad things happen. | |
3195 | - * | |
3196 | - * -DS | |
3197 | - */ | |
3198 | do_timer(regs); | |
3199 | + | |
3200 | + return IRQ_HANDLED; | |
3201 | } | |
3202 | ||
3203 | extern unsigned long (*gettimeoffset)(void); | |
3204 | @@ -126,7 +115,9 @@ | |
3205 | volatile u_char *timer_en = (volatile u_char *)IQ80310_TIMER_EN; | |
3206 | ||
3207 | gettimeoffset = iq80310_gettimeoffset; | |
3208 | + | |
3209 | setup_irq(IRQ_IQ80310_TIMER, &timer_irq); | |
3210 | + | |
3211 | *timer_en = 0; | |
3212 | iq80310_write_timer(LATCH); | |
3213 | *timer_en |= 2; | |
3214 | diff -Nru a/arch/arm/mach-l7200/core.c b/arch/arm/mach-l7200/core.c | |
3215 | --- a/arch/arm/mach-l7200/core.c Tue Jun 4 16:19:02 2002 | |
3216 | +++ b/arch/arm/mach-l7200/core.c Wed Sep 3 10:17:54 2003 | |
3217 | @@ -11,7 +11,6 @@ | |
3218 | ||
3219 | #include <asm/hardware.h> | |
3220 | #include <asm/page.h> | |
3221 | -#include <asm/proc/domain.h> | |
3222 | ||
3223 | #include <asm/mach/map.h> | |
3224 | #include <asm/arch/hardware.h> | |
3225 | diff -Nru a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c | |
3226 | --- a/arch/arm/mach-rpc/riscpc.c Sun Sep 29 09:11:41 2002 | |
3227 | +++ b/arch/arm/mach-rpc/riscpc.c Wed Sep 3 10:17:54 2003 | |
3228 | @@ -21,7 +21,7 @@ | |
3229 | #include <asm/mach-types.h> | |
3230 | #include <asm/hardware.h> | |
3231 | #include <asm/page.h> | |
3232 | -#include <asm/proc/domain.h> | |
3233 | +#include <asm/domain.h> | |
3234 | #include <asm/setup.h> | |
3235 | ||
3236 | #include <asm/mach/map.h> | |
3237 | diff -Nru a/arch/arm/mach-sa1100/leds-simpad.c b/arch/arm/mach-sa1100/leds-simpad.c | |
3238 | --- a/arch/arm/mach-sa1100/leds-simpad.c Mon Feb 4 23:53:46 2002 | |
3239 | +++ b/arch/arm/mach-sa1100/leds-simpad.c Thu Aug 7 11:40:46 2003 | |
3240 | @@ -9,6 +9,7 @@ | |
3241 | #include <asm/hardware.h> | |
3242 | #include <asm/leds.h> | |
3243 | #include <asm/system.h> | |
3244 | +#include <asm/arch/simpad.h> | |
3245 | ||
3246 | #include "leds.h" | |
3247 | ||
3248 | diff -Nru a/arch/arm/mach-sa1100/leds.c b/arch/arm/mach-sa1100/leds.c | |
3249 | --- a/arch/arm/mach-sa1100/leds.c Wed Dec 11 06:27:36 2002 | |
3250 | +++ b/arch/arm/mach-sa1100/leds.c Thu Aug 7 11:40:46 2003 | |
3251 | @@ -41,6 +41,8 @@ | |
3252 | leds_event = adsbitsy_leds_event; | |
3253 | if (machine_is_pt_system3()) | |
3254 | leds_event = system3_leds_event; | |
3255 | + if (machine_is_simpad()) | |
3256 | + leds_event = simpad_leds_event; /* what about machine registry? including led, apm... -zecke */ | |
3257 | ||
3258 | leds_event(led_start); | |
3259 | return 0; | |
3260 | diff -Nru a/arch/arm/mach-sa1100/leds.h b/arch/arm/mach-sa1100/leds.h | |
3261 | --- a/arch/arm/mach-sa1100/leds.h Wed Dec 11 06:27:36 2002 | |
3262 | +++ b/arch/arm/mach-sa1100/leds.h Thu Aug 7 11:40:46 2003 | |
3263 | @@ -11,3 +11,4 @@ | |
3264 | extern void graphicsmaster_leds_event(led_event_t evt); | |
3265 | extern void adsbitsy_leds_event(led_event_t evt); | |
3266 | extern void system3_leds_event(led_event_t evt); | |
3267 | +extern void simpad_leds_event(led_event_t evt); | |
3268 | diff -Nru a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile | |
3269 | --- a/arch/arm/mm/Makefile Sun Apr 27 16:46:31 2003 | |
3270 | +++ b/arch/arm/mm/Makefile Wed Sep 3 01:25:59 2003 | |
3271 | @@ -4,20 +4,12 @@ | |
3272 | ||
3273 | # Object file lists. | |
3274 | ||
3275 | -obj-y := init.o extable.o fault-common.o | |
3276 | -obj-m := | |
3277 | -obj-n := | |
3278 | -obj- := | |
3279 | -ifeq ($(CONFIG_CPU_32),y) | |
3280 | -obj-y += consistent.o fault-armv.o ioremap.o mm-armv.o | |
3281 | +obj-y := consistent.o extable.o fault-armv.o fault-common.o \ | |
3282 | + init.o ioremap.o mm-armv.o | |
3283 | obj-$(CONFIG_MODULES) += proc-syms.o | |
3284 | -endif | |
3285 | ||
3286 | obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o | |
3287 | obj-$(CONFIG_DISCONTIGMEM) += discontig.o | |
3288 | - | |
3289 | -# Select the processor-specific files | |
3290 | -p-$(CONFIG_CPU_26) += proc-arm2_3.o | |
3291 | ||
3292 | # ARMv3 | |
3293 | p-$(CONFIG_CPU_ARM610) += proc-arm6_7.o tlb-v3.o cache-v3.o copypage-v3.o | |
3294 | diff -Nru a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c | |
3295 | --- a/arch/arm/mm/mm-armv.c Thu Aug 14 07:58:33 2003 | |
3296 | +++ b/arch/arm/mm/mm-armv.c Wed Sep 3 10:17:54 2003 | |
3297 | @@ -34,8 +34,8 @@ | |
3298 | }; | |
3299 | ||
3300 | static struct cachepolicy cache_policies[] __initdata = { | |
3301 | - { "uncached", CR1_W|CR1_C, PMD_SECT_UNCACHED }, | |
3302 | - { "buffered", CR1_C, PMD_SECT_BUFFERED }, | |
3303 | + { "uncached", CR_W|CR_C, PMD_SECT_UNCACHED }, | |
3304 | + { "buffered", CR_C, PMD_SECT_BUFFERED }, | |
3305 | { "writethrough", 0, PMD_SECT_WT }, | |
3306 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH | |
3307 | { "writeback", 0, PMD_SECT_WB }, | |
3308 | @@ -102,8 +102,8 @@ | |
3309 | ||
3310 | static int __init noalign_setup(char *__unused) | |
3311 | { | |
3312 | - cr_alignment &= ~CR1_A; | |
3313 | - cr_no_alignment &= ~CR1_A; | |
3314 | + cr_alignment &= ~CR_A; | |
3315 | + cr_no_alignment &= ~CR_A; | |
3316 | set_cr(cr_alignment); | |
3317 | return 1; | |
3318 | } | |
3319 | diff -Nru a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S | |
3320 | --- a/arch/arm/mm/proc-arm1020.S Sun Apr 27 17:16:24 2003 | |
3321 | +++ b/arch/arm/mm/proc-arm1020.S Wed Sep 3 10:17:54 2003 | |
3322 | @@ -30,6 +30,7 @@ | |
3323 | #include <asm/assembler.h> | |
3324 | #include <asm/constants.h> | |
3325 | #include <asm/procinfo.h> | |
3326 | +#include <asm/ptrace.h> | |
3327 | #include <asm/hardware.h> | |
3328 | ||
3329 | /* | |
3330 | diff -Nru a/arch/arm/mm/proc-arm2_3.S b/arch/arm/mm/proc-arm2_3.S | |
3331 | --- a/arch/arm/mm/proc-arm2_3.S Mon Apr 28 14:55:34 2003 | |
3332 | +++ /dev/null Wed Dec 31 16:00:00 1969 | |
3333 | @@ -1,360 +0,0 @@ | |
3334 | -/* | |
3335 | - * linux/arch/arm/mm/proc-arm2,3.S | |
3336 | - * | |
3337 | - * Copyright (C) 1997-1999 Russell King | |
3338 | - * | |
3339 | - * This program is free software; you can redistribute it and/or modify | |
3340 | - * it under the terms of the GNU General Public License version 2 as | |
3341 | - * published by the Free Software Foundation. | |
3342 | - * | |
3343 | - * MMU functions for ARM2,3 | |
3344 | - * | |
3345 | - * These are the low level assembler for performing cache | |
3346 | - * and memory functions on ARM2, ARM250 and ARM3 processors. | |
3347 | - */ | |
3348 | -#include <linux/linkage.h> | |
3349 | -#include <linux/init.h> | |
3350 | -#include <asm/assembler.h> | |
3351 | -#include <asm/constants.h> | |
3352 | -#include <asm/procinfo.h> | |
3353 | - | |
3354 | -/* | |
3355 | - * MEMC workhorse code. It's both a horse which things it's a pig. | |
3356 | - */ | |
3357 | -/* | |
3358 | - * Function: cpu_memc_update_entry(pgd_t *pgd, unsigned long phys_pte, unsigned long addr) | |
3359 | - * Params : pgd Page tables/MEMC mapping | |
3360 | - * : phys_pte physical address, or PTE | |
3361 | - * : addr virtual address | |
3362 | - */ | |
3363 | -ENTRY(cpu_memc_update_entry) | |
3364 | - tst r1, #PAGE_PRESENT @ is the page present | |
3365 | - orreq r1, r1, #PAGE_OLD | PAGE_CLEAN | |
3366 | - moveq r2, #0x01f00000 | |
3367 | - mov r3, r1, lsr #13 @ convert to physical page nr | |
3368 | - and r3, r3, #0x3fc | |
3369 | - adr ip, memc_phys_table_32 | |
3370 | - ldr r3, [ip, r3] | |
3371 | - tst r1, #PAGE_OLD | PAGE_NOT_USER | |
3372 | - biceq r3, r3, #0x200 | |
3373 | - tsteq r1, #PAGE_READONLY | PAGE_CLEAN | |
3374 | - biceq r3, r3, #0x300 | |
3375 | - mov r2, r2, lsr #15 @ virtual -> nr | |
3376 | - orr r3, r3, r2, lsl #15 | |
3377 | - and r2, r2, #0x300 | |
3378 | - orr r3, r3, r2, lsl #2 | |
3379 | - and r2, r3, #255 | |
3380 | - sub r0, r0, #256 * 4 | |
3381 | - str r3, [r0, r2, lsl #2] | |
3382 | - strb r3, [r3] | |
3383 | - movs pc, lr | |
3384 | -/* | |
3385 | - * Params : r0 = preserved | |
3386 | - * : r1 = memc table base (preserved) | |
3387 | - * : r2 = page table entry | |
3388 | - * : r3 = preserved | |
3389 | - * : r4 = unused | |
3390 | - * : r5 = memc physical address translation table | |
3391 | - * : ip = virtual address (preserved) | |
3392 | - */ | |
3393 | -update_pte: | |
3394 | - mov r4, r2, lsr #13 | |
3395 | - and r4, r4, #0x3fc | |
3396 | - ldr r4, [r5, r4] @ covert to MEMC page | |
3397 | - | |
3398 | - tst r2, #PAGE_OLD | PAGE_NOT_USER @ check for MEMC read | |
3399 | - biceq r4, r4, #0x200 | |
3400 | - tsteq r2, #PAGE_READONLY | PAGE_CLEAN @ check for MEMC write | |
3401 | - biceq r4, r4, #0x300 | |
3402 | - | |
3403 | - orr r4, r4, ip | |
3404 | - and r2, ip, #0x01800000 | |
3405 | - orr r4, r4, r2, lsr #13 | |
3406 | - | |
3407 | - and r2, r4, #255 | |
3408 | - str r4, [r1, r2, lsl #2] | |
3409 | - movs pc, lr | |
3410 | - | |
3411 | -/* | |
3412 | - * Params : r0 = preserved | |
3413 | - * : r1 = memc table base (preserved) | |
3414 | - * : r2 = page table base | |
3415 | - * : r3 = preserved | |
3416 | - * : r4 = unused | |
3417 | - * : r5 = memc physical address translation table | |
3418 | - * : ip = virtual address (updated) | |
3419 | - */ | |
3420 | -update_pte_table: | |
3421 | - stmfd sp!, {r0, lr} | |
3422 | - bic r0, r2, #3 | |
3423 | -1: ldr r2, [r0], #4 @ get entry | |
3424 | - tst r2, #PAGE_PRESENT @ page present | |
3425 | - blne update_pte @ process pte | |
3426 | - add ip, ip, #32768 @ increment virt addr | |
3427 | - ldr r2, [r0], #4 @ get entry | |
3428 | - tst r2, #PAGE_PRESENT @ page present | |
3429 | - blne update_pte @ process pte | |
3430 | - add ip, ip, #32768 @ increment virt addr | |
3431 | - ldr r2, [r0], #4 @ get entry | |
3432 | - tst r2, #PAGE_PRESENT @ page present | |
3433 | - blne update_pte @ process pte | |
3434 | - add ip, ip, #32768 @ increment virt addr | |
3435 | - ldr r2, [r0], #4 @ get entry | |
3436 | - tst r2, #PAGE_PRESENT @ page present | |
3437 | - blne update_pte @ process pte | |
3438 | - add ip, ip, #32768 @ increment virt addr | |
3439 | - tst ip, #32768 * 31 @ finished? | |
3440 | - bne 1b | |
3441 | - ldmfd sp!, {r0, pc}^ | |
3442 | - | |
3443 | -/* | |
3444 | - * Function: cpu_memc_update_all(pgd_t *pgd) | |
3445 | - * Params : pgd Page tables/MEMC mapping | |
3446 | - * Notes : this is optimised for 32k pages | |
3447 | - */ | |
3448 | -ENTRY(cpu_memc_update_all) | |
3449 | - stmfd sp!, {r4, r5, lr} | |
3450 | - bl clear_tables | |
3451 | - sub r1, r0, #256 * 4 @ start of MEMC tables | |
3452 | - adr r5, memc_phys_table_32 @ Convert to logical page number | |
3453 | - mov ip, #0 @ virtual address | |
3454 | -1: ldmia r0!, {r2, r3} | |
3455 | - tst r2, #PAGE_PRESENT | |
3456 | - addeq ip, ip, #1048576 | |
3457 | - blne update_pte_table | |
3458 | - mov r2, r3 | |
3459 | - tst r2, #PAGE_PRESENT | |
3460 | - addeq ip, ip, #1048576 | |
3461 | - blne update_pte_table | |
3462 | - teq ip, #32 * 1048576 | |
3463 | - bne 1b | |
3464 | - ldmfd sp!, {r4, r5, pc}^ | |
3465 | - | |
3466 | -/* | |
3467 | - * Build the table to map from physical page number to memc page number | |
3468 | - */ | |
3469 | - .type memc_phys_table_32, #object | |
3470 | -memc_phys_table_32: | |
3471 | - .irp b7, 0x00, 0x80 | |
3472 | - .irp b6, 0x00, 0x02 | |
3473 | - .irp b5, 0x00, 0x04 | |
3474 | - .irp b4, 0x00, 0x01 | |
3475 | - | |
3476 | - .irp b3, 0x00, 0x40 | |
3477 | - .irp b2, 0x00, 0x20 | |
3478 | - .irp b1, 0x00, 0x10 | |
3479 | - .irp b0, 0x00, 0x08 | |
3480 | - .long 0x03800300 + \b7 + \b6 + \b5 + \b4 + \b3 + \b2 + \b1 + \b0 | |
3481 | - .endr | |
3482 | - .endr | |
3483 | - .endr | |
3484 | - .endr | |
3485 | - | |
3486 | - .endr | |
3487 | - .endr | |
3488 | - .endr | |
3489 | - .endr | |
3490 | - .size memc_phys_table_32, . - memc_phys_table_32 | |
3491 | - | |
3492 | -/* | |
3493 | - * helper for cpu_memc_update_all, this clears out all | |
3494 | - * mappings, setting them close to the top of memory, | |
3495 | - * and inaccessible (0x01f00000). | |
3496 | - * Params : r0 = page table pointer | |
3497 | - */ | |
3498 | -clear_tables: ldr r1, _arm3_switch_mm - 4 | |
3499 | - ldr r2, [r1] | |
3500 | - sub r1, r0, #256 * 4 @ start of MEMC tables | |
3501 | - add r2, r1, r2, lsl #2 @ end of tables | |
3502 | - mov r3, #0x03f00000 @ Default mapping (null mapping) | |
3503 | - orr r3, r3, #0x00000f00 | |
3504 | - orr r4, r3, #1 | |
3505 | - orr r5, r3, #2 | |
3506 | - orr ip, r3, #3 | |
3507 | -1: stmia r1!, {r3, r4, r5, ip} | |
3508 | - add r3, r3, #4 | |
3509 | - add r4, r4, #4 | |
3510 | - add r5, r5, #4 | |
3511 | - add ip, ip, #4 | |
3512 | - stmia r1!, {r3, r4, r5, ip} | |
3513 | - add r3, r3, #4 | |
3514 | - add r4, r4, #4 | |
3515 | - add r5, r5, #4 | |
3516 | - add ip, ip, #4 | |
3517 | - teq r1, r2 | |
3518 | - bne 1b | |
3519 | - mov pc, lr | |
3520 | - | |
3521 | -/* | |
3522 | - * Function: *_switch_mm(pgd_t *pgd) | |
3523 | - * Params : pgd New page tables/MEMC mapping | |
3524 | - * Purpose : update MEMC hardware with new mapping | |
3525 | - */ | |
3526 | - .word page_nr | |
3527 | -_arm3_switch_mm: | |
3528 | - mcr p15, 0, r1, c1, c0, 0 @ flush cache | |
3529 | -_arm2_switch_mm: | |
3530 | - stmfd sp!, {lr} | |
3531 | - ldr r1, _arm3_switch_mm - 4 | |
3532 | - ldr r2, [r1] | |
3533 | - sub r0, r0, #256 * 4 @ start of MEMC tables | |
3534 | - add r1, r0, r2, lsl #2 @ end of tables | |
3535 | -1: ldmia r0!, {r2, r3, ip, lr} | |
3536 | - strb r2, [r2] | |
3537 | - strb r3, [r3] | |
3538 | - strb ip, [ip] | |
3539 | - strb lr, [lr] | |
3540 | - ldmia r0!, {r2, r3, ip, lr} | |
3541 | - strb r2, [r2] | |
3542 | - strb r3, [r3] | |
3543 | - strb ip, [ip] | |
3544 | - strb lr, [lr] | |
3545 | - teq r0, r1 | |
3546 | - bne 1b | |
3547 | - ldmfd sp!, {pc}^ | |
3548 | - | |
3549 | -/* | |
3550 | - * Function: *_proc_init (void) | |
3551 | - * Purpose : Initialise the cache control registers | |
3552 | - */ | |
3553 | -_arm3_proc_init: | |
3554 | - mov r0, #0x001f0000 | |
3555 | - orr r0, r0, #0x0000ff00 | |
3556 | - orr r0, r0, #0x000000ff | |
3557 | - mcr p15, 0, r0, c3, c0 @ ARM3 Cacheable | |
3558 | - mcr p15, 0, r0, c4, c0 @ ARM3 Updateable | |
3559 | - mov r0, #0 | |
3560 | - mcr p15, 0, r0, c5, c0 @ ARM3 Disruptive | |
3561 | - mcr p15, 0, r0, c1, c0 @ ARM3 Flush | |
3562 | - mov r0, #3 | |
3563 | - mcr p15, 0, r0, c2, c0 @ ARM3 Control | |
3564 | -_arm2_proc_init: | |
3565 | - movs pc, lr | |
3566 | - | |
3567 | -/* | |
3568 | - * Function: *_proc_fin (void) | |
3569 | - * Purpose : Finalise processor (disable caches) | |
3570 | - */ | |
3571 | -_arm3_proc_fin: mov r0, #2 | |
3572 | - mcr p15, 0, r0, c2, c0 | |
3573 | -_arm2_proc_fin: orrs pc, lr, #PSR_I_BIT|PSR_F_BIT | |
3574 | - | |
3575 | -/* | |
3576 | - * Function: *_xchg_1 (int new, volatile void *ptr) | |
3577 | - * Params : new New value to store at... | |
3578 | - * : ptr pointer to byte-wide location | |
3579 | - * Purpose : Performs an exchange operation | |
3580 | - * Returns : Original byte data at 'ptr' | |
3581 | - */ | |
3582 | -_arm2_xchg_1: mov r2, pc | |
3583 | - orr r2, r2, #PSR_I_BIT | |
3584 | - teqp r2, #0 | |
3585 | - ldrb r2, [r1] | |
3586 | - strb r0, [r1] | |
3587 | - mov r0, r2 | |
3588 | - movs pc, lr | |
3589 | - | |
3590 | -_arm3_xchg_1: swpb r0, r0, [r1] | |
3591 | - movs pc, lr | |
3592 | - | |
3593 | -/* | |
3594 | - * Function: *_xchg_4 (int new, volatile void *ptr) | |
3595 | - * Params : new New value to store at... | |
3596 | - * : ptr pointer to word-wide location | |
3597 | - * Purpose : Performs an exchange operation | |
3598 | - * Returns : Original word data at 'ptr' | |
3599 | - */ | |
3600 | -_arm2_xchg_4: mov r2, pc | |
3601 | - orr r2, r2, #PSR_I_BIT | |
3602 | - teqp r2, #0 | |
3603 | - ldr r2, [r1] | |
3604 | - str r0, [r1] | |
3605 | - mov r0, r2 | |
3606 | - movs pc, lr | |
3607 | - | |
3608 | -_arm3_xchg_4: swp r0, r0, [r1] | |
3609 | - movs pc, lr | |
3610 | - | |
3611 | -cpu_arm2_name: | |
3612 | - .asciz "ARM 2" | |
3613 | -cpu_arm250_name: | |
3614 | - .asciz "ARM 250" | |
3615 | -cpu_arm3_name: | |
3616 | - .asciz "ARM 3" | |
3617 | - | |
3618 | - __INIT | |
3619 | -/* | |
3620 | - * Purpose : Function pointers used to access above functions - all calls | |
3621 | - * come through these | |
3622 | - */ | |
3623 | - .globl arm2_processor_functions | |
3624 | -arm2_processor_functions: | |
3625 | - .word _arm2_proc_init | |
3626 | - .word _arm2_proc_fin | |
3627 | - .word _arm2_switch_mm | |
3628 | - .word _arm2_xchg_1 | |
3629 | - .word _arm2_xchg_4 | |
3630 | - | |
3631 | - .globl arm250_processor_functions | |
3632 | -arm250_processor_functions: | |
3633 | - .word _arm2_proc_init | |
3634 | - .word _arm2_proc_fin | |
3635 | - .word _arm2_switch_mm | |
3636 | - .word _arm3_xchg_1 | |
3637 | - .word _arm3_xchg_4 | |
3638 | - | |
3639 | - .globl arm3_processor_functions | |
3640 | -arm3_processor_functions: | |
3641 | - .word _arm3_proc_init | |
3642 | - .word _arm3_proc_fin | |
3643 | - .word _arm3_switch_mm | |
3644 | - .word _arm3_xchg_1 | |
3645 | - .word _arm3_xchg_4 | |
3646 | - | |
3647 | -arm2_arch_name: .asciz "armv1" | |
3648 | -arm3_arch_name: .asciz "armv2" | |
3649 | -arm2_elf_name: .asciz "v1" | |
3650 | -arm3_elf_name: .asciz "v2" | |
3651 | - .align | |
3652 | - | |
3653 | - .section ".proc.info", #alloc, #execinstr | |
3654 | - | |
3655 | - .long 0x41560200 | |
3656 | - .long 0xfffffff0 | |
3657 | - .long 0 | |
3658 | - mov pc, lr | |
3659 | - .long arm2_arch_name | |
3660 | - .long arm2_elf_name | |
3661 | - .long 0 | |
3662 | - .long cpu_arm2_name | |
3663 | - .long arm2_processor_functions | |
3664 | - .long 0 | |
3665 | - .long 0 | |
3666 | - .long 0 | |
3667 | - | |
3668 | - .long 0x41560250 | |
3669 | - .long 0xfffffff0 | |
3670 | - .long 0 | |
3671 | - mov pc, lr | |
3672 | - .long arm3_arch_name | |
3673 | - .long arm3_elf_name | |
3674 | - .long 0 | |
3675 | - .long cpu_arm250_name | |
3676 | - .long arm250_processor_functions | |
3677 | - .long 0 | |
3678 | - .long 0 | |
3679 | - .long 0 | |
3680 | - | |
3681 | - .long 0x41560300 | |
3682 | - .long 0xfffffff0 | |
3683 | - .long 0 | |
3684 | - mov pc, lr | |
3685 | - .long arm3_arch_name | |
3686 | - .long arm3_elf_name | |
3687 | - .long 0 | |
3688 | - .long cpu_arm3_name | |
3689 | - .long arm3_processor_functions | |
3690 | - .long 0 | |
3691 | - .long 0 | |
3692 | - .long 0 | |
3693 | - | |
3694 | diff -Nru a/arch/arm/mm/proc-arm6_7.S b/arch/arm/mm/proc-arm6_7.S | |
3695 | --- a/arch/arm/mm/proc-arm6_7.S Mon Apr 28 14:55:34 2003 | |
3696 | +++ b/arch/arm/mm/proc-arm6_7.S Wed Sep 3 10:17:55 2003 | |
3697 | @@ -15,6 +15,7 @@ | |
3698 | #include <asm/assembler.h> | |
3699 | #include <asm/constants.h> | |
3700 | #include <asm/procinfo.h> | |
3701 | +#include <asm/ptrace.h> | |
3702 | ||
3703 | ENTRY(cpu_arm6_dcache_clean_area) | |
3704 | ENTRY(cpu_arm7_dcache_clean_area) | |
3705 | diff -Nru a/arch/arm/mm/proc-arm720.S b/arch/arm/mm/proc-arm720.S | |
3706 | --- a/arch/arm/mm/proc-arm720.S Sun Apr 27 17:16:25 2003 | |
3707 | +++ b/arch/arm/mm/proc-arm720.S Wed Sep 3 10:17:55 2003 | |
3708 | @@ -35,6 +35,7 @@ | |
3709 | #include <asm/assembler.h> | |
3710 | #include <asm/constants.h> | |
3711 | #include <asm/procinfo.h> | |
3712 | +#include <asm/ptrace.h> | |
3713 | #include <asm/hardware.h> | |
3714 | ||
3715 | /* | |
3716 | diff -Nru a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S | |
3717 | --- a/arch/arm/mm/proc-arm920.S Sun Apr 27 17:16:25 2003 | |
3718 | +++ b/arch/arm/mm/proc-arm920.S Wed Sep 3 10:17:55 2003 | |
3719 | @@ -31,6 +31,7 @@ | |
3720 | #include <asm/procinfo.h> | |
3721 | #include <asm/hardware.h> | |
3722 | #include <asm/page.h> | |
3723 | +#include <asm/ptrace.h> | |
3724 | #include "proc-macros.S" | |
3725 | ||
3726 | /* | |
3727 | diff -Nru a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S | |
3728 | --- a/arch/arm/mm/proc-arm922.S Sun Apr 27 17:16:25 2003 | |
3729 | +++ b/arch/arm/mm/proc-arm922.S Wed Sep 3 10:17:55 2003 | |
3730 | @@ -32,6 +32,7 @@ | |
3731 | #include <asm/procinfo.h> | |
3732 | #include <asm/hardware.h> | |
3733 | #include <asm/page.h> | |
3734 | +#include <asm/ptrace.h> | |
3735 | #include "proc-macros.S" | |
3736 | ||
3737 | /* | |
3738 | diff -Nru a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S | |
3739 | --- a/arch/arm/mm/proc-arm926.S Sun Apr 27 17:16:25 2003 | |
3740 | +++ b/arch/arm/mm/proc-arm926.S Wed Sep 3 10:17:55 2003 | |
3741 | @@ -31,6 +31,7 @@ | |
3742 | #include <asm/procinfo.h> | |
3743 | #include <asm/hardware.h> | |
3744 | #include <asm/page.h> | |
3745 | +#include <asm/ptrace.h> | |
3746 | #include "proc-macros.S" | |
3747 | ||
3748 | /* | |
3749 | diff -Nru a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S | |
3750 | --- a/arch/arm/mm/proc-sa110.S Sun Apr 27 17:16:25 2003 | |
3751 | +++ b/arch/arm/mm/proc-sa110.S Wed Sep 3 10:17:55 2003 | |
3752 | @@ -18,7 +18,8 @@ | |
3753 | #include <asm/constants.h> | |
3754 | #include <asm/procinfo.h> | |
3755 | #include <asm/hardware.h> | |
3756 | -#include <asm/proc/pgtable.h> | |
3757 | +#include <asm/pgtable.h> | |
3758 | +#include <asm/ptrace.h> | |
3759 | ||
3760 | /* | |
3761 | * the cache line size of the I and D cache | |
3762 | diff -Nru a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S | |
3763 | --- a/arch/arm/mm/proc-sa1100.S Sun Apr 27 17:16:25 2003 | |
3764 | +++ b/arch/arm/mm/proc-sa1100.S Wed Sep 3 10:17:56 2003 | |
3765 | @@ -23,7 +23,8 @@ | |
3766 | #include <asm/constants.h> | |
3767 | #include <asm/procinfo.h> | |
3768 | #include <asm/hardware.h> | |
3769 | -#include <asm/proc/pgtable.h> | |
3770 | +#include <asm/pgtable.h> | |
3771 | +#include <asm/ptrace.h> | |
3772 | ||
3773 | /* | |
3774 | * the cache line size of the I and D cache | |
3775 | diff -Nru a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S | |
3776 | --- a/arch/arm/mm/proc-xscale.S Sun Apr 27 17:16:26 2003 | |
3777 | +++ b/arch/arm/mm/proc-xscale.S Wed Sep 3 10:17:56 2003 | |
3778 | @@ -25,8 +25,9 @@ | |
3779 | #include <asm/assembler.h> | |
3780 | #include <asm/procinfo.h> | |
3781 | #include <asm/hardware.h> | |
3782 | -#include <asm/proc/pgtable.h> | |
3783 | +#include <asm/pgtable.h> | |
3784 | #include <asm/page.h> | |
3785 | +#include <asm/ptrace.h> | |
3786 | #include "proc-macros.S" | |
3787 | ||
3788 | /* | |
3789 | diff -Nru a/arch/arm/vmlinux-armo.lds.in b/arch/arm/vmlinux-armo.lds.in | |
3790 | --- a/arch/arm/vmlinux-armo.lds.in Wed Jun 11 17:40:04 2003 | |
3791 | +++ /dev/null Wed Dec 31 16:00:00 1969 | |
3792 | @@ -1,114 +0,0 @@ | |
3793 | -/* ld script to make ARM Linux kernel | |
3794 | - * taken from the i386 version by Russell King | |
3795 | - * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> | |
3796 | - */ | |
3797 | - | |
3798 | -#include <asm-generic/vmlinux.lds.h> | |
3799 | - | |
3800 | -OUTPUT_ARCH(arm) | |
3801 | -ENTRY(stext) | |
3802 | -jiffies = jiffies_64; | |
3803 | -SECTIONS | |
3804 | -{ | |
3805 | - . = TEXTADDR; | |
3806 | - .init : { /* Init code and data */ | |
3807 | - _stext = .; | |
3808 | - __init_begin = .; | |
3809 | - _sinittext = .; | |
3810 | - *(.init.text) | |
3811 | - _einittext = .; | |
3812 | - __proc_info_begin = .; | |
3813 | - *(.proc.info) | |
3814 | - __proc_info_end = .; | |
3815 | - __arch_info_begin = .; | |
3816 | - *(.arch.info) | |
3817 | - __arch_info_end = .; | |
3818 | - __tagtable_begin = .; | |
3819 | - *(.taglist) | |
3820 | - __tagtable_end = .; | |
3821 | - *(.init.data) | |
3822 | - . = ALIGN(16); | |
3823 | - __setup_start = .; | |
3824 | - *(.init.setup) | |
3825 | - __setup_end = .; | |
3826 | - __initcall_start = .; | |
3827 | - *(.initcall1.init) | |
3828 | - *(.initcall2.init) | |
3829 | - *(.initcall3.init) | |
3830 | - *(.initcall4.init) | |
3831 | - *(.initcall5.init) | |
3832 | - *(.initcall6.init) | |
3833 | - *(.initcall7.init) | |
3834 | - __initcall_end = .; | |
3835 | - __con_initcall_start = .; | |
3836 | - *(.con_initcall.init) | |
3837 | - __con_initcall_end = .; | |
3838 | - SECURITY_INIT | |
3839 | - . = ALIGN(32768); | |
3840 | - __init_end = .; | |
3841 | - } | |
3842 | - | |
3843 | - .init.task : { | |
3844 | - *(.init.task) | |
3845 | - } | |
3846 | - | |
3847 | - /DISCARD/ : { /* Exit code and data */ | |
3848 | - *(.exit.text) | |
3849 | - *(.exit.data) | |
3850 | - *(.exitcall.exit) | |
3851 | - } | |
3852 | - | |
3853 | - .text : { /* Real text segment */ | |
3854 | - _text = .; /* Text and read-only data */ | |
3855 | - *(.text) | |
3856 | - *(.fixup) | |
3857 | - *(.gnu.warning) | |
3858 | - *(.rodata) | |
3859 | - *(.rodata.*) | |
3860 | - *(.glue_7) | |
3861 | - *(.glue_7t) | |
3862 | - *(.got) /* Global offset table */ | |
3863 | - | |
3864 | - _etext = .; /* End of text section */ | |
3865 | - } | |
3866 | - | |
3867 | - . = ALIGN(16); | |
3868 | - __ex_table : { /* Exception table */ | |
3869 | - __start___ex_table = .; | |
3870 | - *(__ex_table) | |
3871 | - __stop___ex_table = .; | |
3872 | - } | |
3873 | - | |
3874 | - RODATA | |
3875 | - | |
3876 | - .data : { | |
3877 | - /* | |
3878 | - * The cacheline aligned data | |
3879 | - */ | |
3880 | - . = ALIGN(32); | |
3881 | - *(.data.cacheline_aligned) | |
3882 | - | |
3883 | - /* | |
3884 | - * and the usual data section | |
3885 | - */ | |
3886 | - *(.data) | |
3887 | - CONSTRUCTORS | |
3888 | - | |
3889 | - _edata = .; | |
3890 | - } | |
3891 | - | |
3892 | - .bss : { | |
3893 | - __bss_start = .; /* BSS */ | |
3894 | - *(.bss) | |
3895 | - *(COMMON) | |
3896 | - _end = . ; | |
3897 | - } | |
3898 | - /* Stabs debugging sections. */ | |
3899 | - .stab 0 : { *(.stab) } | |
3900 | - .stabstr 0 : { *(.stabstr) } | |
3901 | - .stab.excl 0 : { *(.stab.excl) } | |
3902 | - .stab.exclstr 0 : { *(.stab.exclstr) } | |
3903 | - .stab.index 0 : { *(.stab.index) } | |
3904 | - .stab.indexstr 0 : { *(.stab.indexstr) } | |
3905 | - .comment 0 : { *(.comment) } | |
3906 | -} | |
3907 | diff -Nru a/arch/arm/vmlinux-armv.lds.in b/arch/arm/vmlinux-armv.lds.in | |
3908 | --- a/arch/arm/vmlinux-armv.lds.in Wed Jun 18 16:33:31 2003 | |
3909 | +++ /dev/null Wed Dec 31 16:00:00 1969 | |
3910 | @@ -1,134 +0,0 @@ | |
3911 | -/* ld script to make ARM Linux kernel | |
3912 | - * taken from the i386 version by Russell King | |
3913 | - * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> | |
3914 | - */ | |
3915 | - | |
3916 | -#include <asm-generic/vmlinux.lds.h> | |
3917 | - | |
3918 | -OUTPUT_ARCH(arm) | |
3919 | -ENTRY(stext) | |
3920 | -#ifndef __ARMEB__ | |
3921 | -jiffies = jiffies_64; | |
3922 | -#else | |
3923 | -jiffies = jiffies_64 + 4; | |
3924 | -#endif | |
3925 | -SECTIONS | |
3926 | -{ | |
3927 | - . = TEXTADDR; | |
3928 | - .init : { /* Init code and data */ | |
3929 | - _stext = .; | |
3930 | - __init_begin = .; | |
3931 | - _sinittext = .; | |
3932 | - *(.init.text) | |
3933 | - _einittext = .; | |
3934 | - __proc_info_begin = .; | |
3935 | - *(.proc.info) | |
3936 | - __proc_info_end = .; | |
3937 | - __arch_info_begin = .; | |
3938 | - *(.arch.info) | |
3939 | - __arch_info_end = .; | |
3940 | - __tagtable_begin = .; | |
3941 | - *(.taglist) | |
3942 | - __tagtable_end = .; | |
3943 | - *(.init.data) | |
3944 | - . = ALIGN(16); | |
3945 | - __setup_start = .; | |
3946 | - *(.init.setup) | |
3947 | - __setup_end = .; | |
3948 | - __early_begin = .; | |
3949 | - *(__early_param) | |
3950 | - __early_end = .; | |
3951 | - __start___param = .; | |
3952 | - *(__param) | |
3953 | - __stop___param = .; | |
3954 | - __initcall_start = .; | |
3955 | - *(.initcall1.init) | |
3956 | - *(.initcall2.init) | |
3957 | - *(.initcall3.init) | |
3958 | - *(.initcall4.init) | |
3959 | - *(.initcall5.init) | |
3960 | - *(.initcall6.init) | |
3961 | - *(.initcall7.init) | |
3962 | - __initcall_end = .; | |
3963 | - __con_initcall_start = .; | |
3964 | - *(.con_initcall.init) | |
3965 | - __con_initcall_end = .; | |
3966 | - __security_initcall_start = .; | |
3967 | - *(.security_initcall.init) | |
3968 | - __security_initcall_end = .; | |
3969 | - . = ALIGN(32); | |
3970 | - __initramfs_start = .; | |
3971 | - usr/built-in.o(.init.ramfs) | |
3972 | - __initramfs_end = .; | |
3973 | - . = ALIGN(4096); | |
3974 | - __init_end = .; | |
3975 | - } | |
3976 | - | |
3977 | - /DISCARD/ : { /* Exit code and data */ | |
3978 | - *(.exit.text) | |
3979 | - *(.exit.data) | |
3980 | - *(.exitcall.exit) | |
3981 | - } | |
3982 | - | |
3983 | - .text : { /* Real text segment */ | |
3984 | - _text = .; /* Text and read-only data */ | |
3985 | - *(.text) | |
3986 | - *(.fixup) | |
3987 | - *(.gnu.warning) | |
3988 | - *(.rodata) | |
3989 | - *(.rodata.*) | |
3990 | - *(.glue_7) | |
3991 | - *(.glue_7t) | |
3992 | - *(.got) /* Global offset table */ | |
3993 | - | |
3994 | - _etext = .; /* End of text section */ | |
3995 | - } | |
3996 | - | |
3997 | - . = ALIGN(16); | |
3998 | - __ex_table : { /* Exception table */ | |
3999 | - __start___ex_table = .; | |
4000 | - *(__ex_table) | |
4001 | - __stop___ex_table = .; | |
4002 | - } | |
4003 | - | |
4004 | - RODATA | |
4005 | - | |
4006 | - . = ALIGN(8192); | |
4007 | - | |
4008 | - .data : { | |
4009 | - /* | |
4010 | - * first, the init task union, aligned | |
4011 | - * to an 8192 byte boundary. | |
4012 | - */ | |
4013 | - *(.init.task) | |
4014 | - | |
4015 | - /* | |
4016 | - * then the cacheline aligned data | |
4017 | - */ | |
4018 | - . = ALIGN(32); | |
4019 | - *(.data.cacheline_aligned) | |
4020 | - | |
4021 | - /* | |
4022 | - * and the usual data section | |
4023 | - */ | |
4024 | - *(.data) | |
4025 | - CONSTRUCTORS | |
4026 | - | |
4027 | - _edata = .; | |
4028 | - } | |
4029 | - | |
4030 | - .bss : { | |
4031 | - __bss_start = .; /* BSS */ | |
4032 | - *(.bss) | |
4033 | - *(COMMON) | |
4034 | - _end = . ; | |
4035 | - } | |
4036 | - /* Stabs debugging sections. */ | |
4037 | - .stab 0 : { *(.stab) } | |
4038 | - .stabstr 0 : { *(.stabstr) } | |
4039 | - .stab.excl 0 : { *(.stab.excl) } | |
4040 | - .stab.exclstr 0 : { *(.stab.exclstr) } | |
4041 | - .stab.index 0 : { *(.stab.index) } | |
4042 | - .stab.indexstr 0 : { *(.stab.indexstr) } | |
4043 | - .comment 0 : { *(.comment) } | |
4044 | -} | |
4045 | diff -Nru a/arch/arm26/Kconfig b/arch/arm26/Kconfig | |
4046 | --- a/arch/arm26/Kconfig Sat Aug 2 14:26:16 2003 | |
4047 | +++ b/arch/arm26/Kconfig Sun Aug 31 16:14:22 2003 | |
4048 | @@ -146,39 +146,6 @@ | |
4049 | You may say N here if you are going to load the Acorn FPEmulator | |
4050 | early in the bootup. | |
4051 | ||
4052 | -choice | |
4053 | - prompt "Kernel core (/proc/kcore) format" | |
4054 | - default KCORE_ELF | |
4055 | - | |
4056 | -config KCORE_ELF | |
4057 | - bool "ELF" | |
4058 | - ---help--- | |
4059 | - If you enabled support for /proc file system then the file | |
4060 | - /proc/kcore will contain the kernel core image. This can be used | |
4061 | - in gdb: | |
4062 | - | |
4063 | - $ cd /usr/src/linux ; gdb vmlinux /proc/kcore | |
4064 | - | |
4065 | - You have two choices here: ELF and A.OUT. Selecting ELF will make | |
4066 | - /proc/kcore appear in ELF core format as defined by the Executable | |
4067 | - and Linking Format specification. Selecting A.OUT will choose the | |
4068 | - old "a.out" format which may be necessary for some old versions | |
4069 | - of binutils or on some architectures. | |
4070 | - | |
4071 | - This is especially useful if you have compiled the kernel with the | |
4072 | - "-g" option to preserve debugging information. It is mainly used | |
4073 | - for examining kernel data structures on the live kernel so if you | |
4074 | - don't understand what this means or are not a kernel hacker, just | |
4075 | - leave it at its default value ELF. | |
4076 | - | |
4077 | -config KCORE_AOUT | |
4078 | - bool "A.OUT" | |
4079 | - help | |
4080 | - Not necessary unless you're using a very out-of-date binutils | |
4081 | - version. You probably want KCORE_ELF. | |
4082 | - | |
4083 | -endchoice | |
4084 | - | |
4085 | source "fs/Kconfig.binfmt" | |
4086 | ||
4087 | config PREEMPT | |
4088 | diff -Nru a/arch/arm26/kernel/setup.c b/arch/arm26/kernel/setup.c | |
4089 | --- a/arch/arm26/kernel/setup.c Thu Jul 3 15:03:57 2003 | |
4090 | +++ b/arch/arm26/kernel/setup.c Sun Aug 31 16:14:08 2003 | |
4091 | @@ -304,12 +304,12 @@ | |
4092 | ||
4093 | #if defined(CONFIG_DUMMY_CONSOLE) | |
4094 | struct screen_info screen_info = { | |
4095 | - orig_video_lines: 30, | |
4096 | - orig_video_cols: 80, | |
4097 | - orig_video_mode: 0, | |
4098 | - orig_video_ega_bx: 0, | |
4099 | - orig_video_isVGA: 1, | |
4100 | - orig_video_points: 8 | |
4101 | + .orig_video_lines = 30, | |
4102 | + .orig_video_cols = 80, | |
4103 | + .orig_video_mode = 0, | |
4104 | + .orig_video_ega_bx = 0, | |
4105 | + .orig_video_isVGA = 1, | |
4106 | + .orig_video_points = 8 | |
4107 | }; | |
4108 | ||
4109 | static int __init parse_tag_videotext(const struct tag *tag) | |
4110 | diff -Nru a/arch/cris/arch-v10/drivers/eeprom.c b/arch/cris/arch-v10/drivers/eeprom.c | |
4111 | --- a/arch/cris/arch-v10/drivers/eeprom.c Fri Jul 4 03:27:37 2003 | |
4112 | +++ b/arch/cris/arch-v10/drivers/eeprom.c Tue Aug 26 09:25:41 2003 | |
4113 | @@ -441,9 +441,9 @@ | |
4114 | static int eeprom_open(struct inode * inode, struct file * file) | |
4115 | { | |
4116 | ||
4117 | - if(minor(inode->i_rdev) != EEPROM_MINOR_NR) | |
4118 | + if(iminor(inode) != EEPROM_MINOR_NR) | |
4119 | return -ENXIO; | |
4120 | - if(major(inode->i_rdev) != EEPROM_MAJOR_NR) | |
4121 | + if(imajor(inode) != EEPROM_MAJOR_NR) | |
4122 | return -ENXIO; | |
4123 | ||
4124 | if( eeprom.size > 0 ) | |
4125 | diff -Nru a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c | |
4126 | --- a/arch/cris/arch-v10/drivers/gpio.c Fri Jul 4 03:27:37 2003 | |
4127 | +++ b/arch/cris/arch-v10/drivers/gpio.c Tue Aug 26 09:25:40 2003 | |
4128 | @@ -386,7 +386,7 @@ | |
4129 | gpio_open(struct inode *inode, struct file *filp) | |
4130 | { | |
4131 | struct gpio_private *priv; | |
4132 | - int p = minor(inode->i_rdev); | |
4133 | + int p = iminor(inode); | |
4134 | ||
4135 | if (p > GPIO_MINOR_LAST) | |
4136 | return -EINVAL; | |
4137 | diff -Nru a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c | |
4138 | --- a/arch/cris/arch-v10/drivers/pcf8563.c Wed Jul 23 07:38:45 2003 | |
4139 | +++ b/arch/cris/arch-v10/drivers/pcf8563.c Sun Aug 31 16:14:08 2003 | |
4140 | @@ -57,10 +57,10 @@ | |
4141 | int pcf8563_release(struct inode *, struct file *); | |
4142 | ||
4143 | static struct file_operations pcf8563_fops = { | |
4144 | - owner: THIS_MODULE, | |
4145 | - ioctl: pcf8563_ioctl, | |
4146 | - open: pcf8563_open, | |
4147 | - release: pcf8563_release, | |
4148 | + .owner = THIS_MODULE, | |
4149 | + .ioctl = pcf8563_ioctl, | |
4150 | + .open = pcf8563_open, | |
4151 | + .release = pcf8563_release, | |
4152 | }; | |
4153 | ||
4154 | unsigned char | |
4155 | diff -Nru a/arch/h8300/Kconfig b/arch/h8300/Kconfig | |
4156 | --- a/arch/h8300/Kconfig Thu Aug 21 08:42:22 2003 | |
4157 | +++ b/arch/h8300/Kconfig Sun Aug 31 16:14:22 2003 | |
4158 | @@ -177,13 +177,6 @@ | |
4159 | ||
4160 | menu "Executable file formats" | |
4161 | ||
4162 | -config KCORE_AOUT | |
4163 | - bool | |
4164 | - default y | |
4165 | - | |
4166 | -config KCORE_ELF | |
4167 | - default y | |
4168 | - | |
4169 | source "fs/Kconfig.binfmt" | |
4170 | ||
4171 | endmenu | |
4172 | diff -Nru a/arch/h8300/kernel/setup.c b/arch/h8300/kernel/setup.c | |
4173 | --- a/arch/h8300/kernel/setup.c Sun Jul 27 20:40:08 2003 | |
4174 | +++ b/arch/h8300/kernel/setup.c Sun Aug 31 16:14:08 2003 | |
4175 | @@ -91,12 +91,12 @@ | |
4176 | } | |
4177 | ||
4178 | static const struct console gdb_console = { | |
4179 | - name: "gdb_con", | |
4180 | - write: gdb_console_output, | |
4181 | - device: NULL, | |
4182 | - setup: gdb_console_setup, | |
4183 | - flags: CON_PRINTBUFFER, | |
4184 | - index: -1, | |
4185 | + .name = "gdb_con", | |
4186 | + .write = gdb_console_output, | |
4187 | + .device = NULL, | |
4188 | + .setup = gdb_console_setup, | |
4189 | + .flags = CON_PRINTBUFFER, | |
4190 | + .index = -1, | |
4191 | }; | |
4192 | #endif | |
4193 | ||
4194 | @@ -260,8 +260,8 @@ | |
4195 | } | |
4196 | ||
4197 | struct seq_operations cpuinfo_op = { | |
4198 | - start: c_start, | |
4199 | - next: c_next, | |
4200 | - stop: c_stop, | |
4201 | - show: show_cpuinfo, | |
4202 | + .start = c_start, | |
4203 | + .next = c_next, | |
4204 | + .stop = c_stop, | |
4205 | + .show = show_cpuinfo, | |
4206 | }; | |
4207 | diff -Nru a/arch/h8300/platform/h8300h/ints.c b/arch/h8300/platform/h8300h/ints.c | |
4208 | --- a/arch/h8300/platform/h8300h/ints.c Thu Aug 21 08:42:22 2003 | |
4209 | +++ b/arch/h8300/platform/h8300h/ints.c Wed Aug 27 08:10:22 2003 | |
4210 | @@ -32,15 +32,6 @@ | |
4211 | #include <asm/regs306x.h> | |
4212 | #include <asm/errno.h> | |
4213 | ||
4214 | -#define EXT_IRQ0 12 | |
4215 | -#define EXT_IRQ1 13 | |
4216 | -#define EXT_IRQ2 14 | |
4217 | -#define EXT_IRQ3 15 | |
4218 | -#define EXT_IRQ4 16 | |
4219 | -#define EXT_IRQ5 17 | |
4220 | -#define EXT_IRQ6 18 | |
4221 | -#define EXT_IRQ7 19 | |
4222 | - | |
4223 | /* | |
4224 | * This structure has only 4 elements for speed reasons | |
4225 | */ | |
4226 | @@ -57,17 +48,20 @@ | |
4227 | ||
4228 | extern unsigned long *interrupt_redirect_table; | |
4229 | ||
4230 | +#define CPU_VECTOR ((unsigned long *)0x000000) | |
4231 | +#define ADDR_MASK (0xffffff) | |
4232 | + | |
4233 | static inline unsigned long *get_vector_address(void) | |
4234 | { | |
4235 | - unsigned long *rom_vector = (unsigned long *)0x000000; | |
4236 | + unsigned long *rom_vector = CPU_VECTOR; | |
4237 | unsigned long base,tmp; | |
4238 | int vec_no; | |
4239 | ||
4240 | - base = rom_vector[EXT_IRQ0]; | |
4241 | + base = rom_vector[EXT_IRQ0] & ADDR_MASK; | |
4242 | ||
4243 | /* check romvector format */ | |
4244 | for (vec_no = EXT_IRQ1; vec_no <= EXT_IRQ5; vec_no++) { | |
4245 | - if ((base+(vec_no - EXT_IRQ0)*4) != rom_vector[vec_no]) | |
4246 | + if ((base+(vec_no - EXT_IRQ0)*4) != (rom_vector[vec_no] & ADDR_MASK)) | |
4247 | return NULL; | |
4248 | } | |
4249 | ||
4250 | @@ -171,7 +165,7 @@ | |
4251 | irq, irq_list[irq]->devname); | |
4252 | if (irq >= EXT_IRQ0 && irq <= EXT_IRQ5) | |
4253 | *(volatile unsigned char *)IER &= ~(1 << (irq - EXT_IRQ0)); | |
4254 | - if ((irq_list[irq] & 0x80000000) == 0) { | |
4255 | + if (((unsigned long)irq_list[irq] & 0x80000000) == 0) { | |
4256 | kfree(irq_list[irq]); | |
4257 | irq_list[irq] = NULL; | |
4258 | } | |
4259 | @@ -241,8 +235,9 @@ | |
4260 | { | |
4261 | } | |
4262 | ||
4263 | -static void __init enable_kmalloc(void) | |
4264 | +static int __init enable_kmalloc(void) | |
4265 | { | |
4266 | use_kmalloc = 1; | |
4267 | + return 0; | |
4268 | } | |
4269 | -__initcall(enable_kmalloc); | |
4270 | +core_initcall(enable_kmalloc); | |
4271 | diff -Nru a/arch/h8300/platform/h8s/ints.c b/arch/h8300/platform/h8s/ints.c | |
4272 | --- a/arch/h8300/platform/h8s/ints.c Thu Aug 21 08:42:22 2003 | |
4273 | +++ b/arch/h8300/platform/h8s/ints.c Wed Aug 27 08:10:22 2003 | |
4274 | @@ -33,23 +33,6 @@ | |
4275 | #include <asm/regs267x.h> | |
4276 | #include <asm/errno.h> | |
4277 | ||
4278 | -#define EXT_IRQ0 16 | |
4279 | -#define EXT_IRQ1 17 | |
4280 | -#define EXT_IRQ2 18 | |
4281 | -#define EXT_IRQ3 19 | |
4282 | -#define EXT_IRQ4 20 | |
4283 | -#define EXT_IRQ5 21 | |
4284 | -#define EXT_IRQ6 22 | |
4285 | -#define EXT_IRQ7 23 | |
4286 | -#define EXT_IRQ8 24 | |
4287 | -#define EXT_IRQ9 25 | |
4288 | -#define EXT_IRQ10 26 | |
4289 | -#define EXT_IRQ11 27 | |
4290 | -#define EXT_IRQ12 28 | |
4291 | -#define EXT_IRQ13 29 | |
4292 | -#define EXT_IRQ14 30 | |
4293 | -#define EXT_IRQ15 31 | |
4294 | - | |
4295 | /* | |
4296 | * This structure has only 4 elements for speed reasons | |
4297 | */ | |
4298 | @@ -95,17 +78,20 @@ | |
4299 | ||
4300 | extern unsigned long *interrupt_redirect_table; | |
4301 | ||
4302 | +#define CPU_VECTOR ((unsigned long *)0x000000) | |
4303 | +#define ADDR_MASK (0xffffff) | |
4304 | + | |
4305 | static inline unsigned long *get_vector_address(void) | |
4306 | { | |
4307 | - volatile unsigned long *rom_vector = (unsigned long *)0x000000; | |
4308 | + volatile unsigned long *rom_vector = CPU_VECTOR; | |
4309 | unsigned long base,tmp; | |
4310 | int vec_no; | |
4311 | ||
4312 | - base = rom_vector[EXT_IRQ0]; | |
4313 | + base = rom_vector[EXT_IRQ0] & ADDR_MASK; | |
4314 | ||
4315 | /* check romvector format */ | |
4316 | for (vec_no = EXT_IRQ1; vec_no <= EXT_IRQ15; vec_no++) { | |
4317 | - if ((base+(vec_no - EXT_IRQ0)*4) != rom_vector[vec_no]) | |
4318 | + if ((base+(vec_no - EXT_IRQ0)*4) != (rom_vector[vec_no] & ADDR_MASK)) | |
4319 | return NULL; | |
4320 | } | |
4321 | ||
4322 | @@ -307,4 +293,4 @@ | |
4323 | use_kmalloc = 1; | |
4324 | return 0; | |
4325 | } | |
4326 | -__initcall(enable_kmalloc); | |
4327 | +core_initcall(enable_kmalloc); | |
4328 | diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig | |
4329 | --- a/arch/i386/Kconfig Wed Aug 20 12:16:36 2003 | |
4330 | +++ b/arch/i386/Kconfig Wed Sep 3 23:40:07 2003 | |
4331 | @@ -408,6 +408,20 @@ | |
4332 | ||
4333 | Otherwise, say N. | |
4334 | ||
4335 | +config HPET_TIMER | |
4336 | + bool "HPET Timer Support" | |
4337 | + help | |
4338 | + This enables the use of the HPET for the kernel's internal timer. | |
4339 | + HPET is the next generation timer replacing legacy 8254s. | |
4340 | + You can safely choose Y here. However, HPET will only be | |
4341 | + activated if the platform and the BIOS support this feature. | |
4342 | + Otherwise the 8254 will be used for timing services. | |
4343 | + | |
4344 | + Choose N to continue using the legacy 8254 timer. | |
4345 | + | |
4346 | +config HPET_EMULATE_RTC | |
4347 | + def_bool HPET_TIMER && RTC=y | |
4348 | + | |
4349 | config SMP | |
4350 | bool "Symmetric multi-processing support" | |
4351 | ---help--- | |
4352 | @@ -1155,40 +1169,6 @@ | |
4353 | ||
4354 | ||
4355 | menu "Executable file formats" | |
4356 | - | |
4357 | -choice | |
4358 | - prompt "Kernel core (/proc/kcore) format" | |
4359 | - depends on PROC_FS | |
4360 | - default KCORE_ELF | |
4361 | - | |
4362 | -config KCORE_ELF | |
4363 | - bool "ELF" | |
4364 | - ---help--- | |
4365 | - If you enabled support for /proc file system then the file | |
4366 | - /proc/kcore will contain the kernel core image. This can be used | |
4367 | - in gdb: | |
4368 | - | |
4369 | - $ cd /usr/src/linux ; gdb vmlinux /proc/kcore | |
4370 | - | |
4371 | - You have two choices here: ELF and A.OUT. Selecting ELF will make | |
4372 | - /proc/kcore appear in ELF core format as defined by the Executable | |
4373 | - and Linking Format specification. Selecting A.OUT will choose the | |
4374 | - old "a.out" format which may be necessary for some old versions | |
4375 | - of binutils or on some architectures. | |
4376 | - | |
4377 | - This is especially useful if you have compiled the kernel with the | |
4378 | - "-g" option to preserve debugging information. It is mainly used | |
4379 | - for examining kernel data structures on the live kernel so if you | |
4380 | - don't understand what this means or are not a kernel hacker, just | |
4381 | - leave it at its default value ELF. | |
4382 | - | |
4383 | -config KCORE_AOUT | |
4384 | - bool "A.OUT" | |
4385 | - help | |
4386 | - Not necessary unless you're using a very out-of-date binutils | |
4387 | - version. You probably want KCORE_ELF. | |
4388 | - | |
4389 | -endchoice | |
4390 | ||
4391 | source "fs/Kconfig.binfmt" | |
4392 | ||
4393 | diff -Nru a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile | |
4394 | --- a/arch/i386/kernel/Makefile Mon Aug 18 11:16:59 2003 | |
4395 | +++ b/arch/i386/kernel/Makefile Sun Aug 31 16:14:50 2003 | |
4396 | @@ -31,6 +31,7 @@ | |
4397 | obj-$(CONFIG_MODULES) += module.o | |
4398 | obj-y += sysenter.o vsyscall.o | |
4399 | obj-$(CONFIG_ACPI_SRAT) += srat.o | |
4400 | +obj-$(CONFIG_HPET_TIMER) += time_hpet.o | |
4401 | ||
4402 | EXTRA_AFLAGS := -traditional | |
4403 | ||
4404 | diff -Nru a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c | |
4405 | --- a/arch/i386/kernel/acpi/boot.c Thu Aug 21 11:08:59 2003 | |
4406 | +++ b/arch/i386/kernel/acpi/boot.c Sun Aug 31 16:14:49 2003 | |
4407 | @@ -41,6 +41,7 @@ | |
4408 | #define PREFIX "ACPI: " | |
4409 | ||
4410 | extern int acpi_disabled; | |
4411 | +extern int acpi_irq; | |
4412 | extern int acpi_ht; | |
4413 | ||
4414 | int acpi_lapic = 0; | |
4415 | @@ -269,6 +270,27 @@ | |
4416 | return 0; | |
4417 | } | |
4418 | ||
4419 | +#ifdef CONFIG_HPET_TIMER | |
4420 | +extern unsigned long hpet_address; | |
4421 | + | |
4422 | +static int __init acpi_parse_hpet(unsigned long phys, unsigned long size) | |
4423 | +{ | |
4424 | + struct acpi_table_hpet *hpet_tbl; | |
4425 | + | |
4426 | + hpet_tbl = __va(phys); | |
4427 | + | |
4428 | + if (hpet_tbl->addr.space_id != ACPI_SPACE_MEM) { | |
4429 | + printk(KERN_WARNING PREFIX "HPET timers must be located in " | |
4430 | + "memory.\n"); | |
4431 | + return -1; | |
4432 | + } | |
4433 | + | |
4434 | + hpet_address = hpet_tbl->addr.addrl; | |
4435 | + printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", hpet_tbl->id, | |
4436 | + hpet_address); | |
4437 | + return 0; | |
4438 | +} | |
4439 | +#endif | |
4440 | ||
4441 | unsigned long __init | |
4442 | acpi_find_rsdp (void) | |
4443 | @@ -407,7 +429,7 @@ | |
4444 | * If MPS is present, it will handle them, | |
4445 | * otherwise the system will stay in PIC mode | |
4446 | */ | |
4447 | - if (acpi_disabled) { | |
4448 | + if (acpi_disabled || !acpi_irq) { | |
4449 | return 1; | |
4450 | } | |
4451 | ||
4452 | @@ -457,6 +479,9 @@ | |
4453 | smp_found_config = 1; | |
4454 | clustered_apic_check(); | |
4455 | } | |
4456 | +#endif | |
4457 | +#ifdef CONFIG_HPET_TIMER | |
4458 | + acpi_table_parse(ACPI_HPET, acpi_parse_hpet); | |
4459 | #endif | |
4460 | ||
4461 | return 0; | |
4462 | diff -Nru a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c | |
4463 | --- a/arch/i386/kernel/apic.c Mon Aug 18 22:27:07 2003 | |
4464 | +++ b/arch/i386/kernel/apic.c Fri Aug 29 03:51:17 2003 | |
4465 | @@ -34,6 +34,7 @@ | |
4466 | #include <asm/pgalloc.h> | |
4467 | #include <asm/desc.h> | |
4468 | #include <asm/arch_hooks.h> | |
4469 | +#include <asm/hpet.h> | |
4470 | ||
4471 | #include <mach_apic.h> | |
4472 | ||
4473 | @@ -779,7 +780,8 @@ | |
4474 | return count; | |
4475 | } | |
4476 | ||
4477 | -void __init wait_8254_wraparound(void) | |
4478 | +/* next tick in 8254 can be caught by catching timer wraparound */ | |
4479 | +static void __init wait_8254_wraparound(void) | |
4480 | { | |
4481 | unsigned int curr_count, prev_count=~0; | |
4482 | int delta; | |
4483 | @@ -801,6 +803,12 @@ | |
4484 | } | |
4485 | ||
4486 | /* | |
4487 | + * Default initialization for 8254 timers. If we use other timers like HPET, | |
4488 | + * we override this later | |
4489 | + */ | |
4490 | +void (*wait_timer_tick)(void) = wait_8254_wraparound; | |
4491 | + | |
4492 | +/* | |
4493 | * This function sets up the local APIC timer, with a timeout of | |
4494 | * 'clocks' APIC bus clock. During calibration we actually call | |
4495 | * this function twice on the boot CPU, once with a bogus timeout | |
4496 | @@ -841,7 +849,7 @@ | |
4497 | /* | |
4498 | * Wait for IRQ0's slice: | |
4499 | */ | |
4500 | - wait_8254_wraparound(); | |
4501 | + wait_timer_tick(); | |
4502 | ||
4503 | __setup_APIC_LVTT(clocks); | |
4504 | ||
4505 | @@ -884,7 +892,7 @@ | |
4506 | * (the current tick might have been already half done) | |
4507 | */ | |
4508 | ||
4509 | - wait_8254_wraparound(); | |
4510 | + wait_timer_tick(); | |
4511 | ||
4512 | /* | |
4513 | * We wrapped around just now. Let's start: | |
4514 | @@ -897,7 +905,7 @@ | |
4515 | * Let's wait LOOPS wraprounds: | |
4516 | */ | |
4517 | for (i = 0; i < LOOPS; i++) | |
4518 | - wait_8254_wraparound(); | |
4519 | + wait_timer_tick(); | |
4520 | ||
4521 | tt2 = apic_read(APIC_TMCCT); | |
4522 | if (cpu_has_tsc) | |
4523 | diff -Nru a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c | |
4524 | --- a/arch/i386/kernel/apm.c Thu Aug 21 14:15:08 2003 | |
4525 | +++ b/arch/i386/kernel/apm.c Wed Sep 3 23:40:14 2003 | |
4526 | @@ -2080,4 +2080,4 @@ | |
4527 | MODULE_PARM(smp, "i"); | |
4528 | MODULE_PARM_DESC(smp, | |
4529 | "Set this to enable APM use on an SMP platform. Use with caution on older systems"); | |
4530 | - | |
4531 | +MODULE_ALIAS_MISCDEV(APM_MINOR_DEV); | |
4532 | diff -Nru a/arch/i386/kernel/cpu/mcheck/non-fatal.c b/arch/i386/kernel/cpu/mcheck/non-fatal.c | |
4533 | --- a/arch/i386/kernel/cpu/mcheck/non-fatal.c Mon Apr 14 12:08:32 2003 | |
4534 | +++ b/arch/i386/kernel/cpu/mcheck/non-fatal.c Wed Sep 3 23:39:56 2003 | |
4535 | @@ -1,5 +1,5 @@ | |
4536 | /* | |
4537 | - * P4 specific Machine Check Exception Reporting | |
4538 | + * Non Fatal Machine Check Exception Reporting | |
4539 | */ | |
4540 | ||
4541 | #include <linux/init.h> | |
4542 | diff -Nru a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c | |
4543 | --- a/arch/i386/kernel/cpu/mtrr/if.c Wed May 14 23:43:54 2003 | |
4544 | +++ b/arch/i386/kernel/cpu/mtrr/if.c Sun Aug 31 16:14:43 2003 | |
4545 | @@ -17,6 +17,22 @@ | |
4546 | ||
4547 | #define FILE_FCOUNT(f) (((struct seq_file *)((f)->private_data))->private) | |
4548 | ||
4549 | +static char *mtrr_strings[MTRR_NUM_TYPES] = | |
4550 | +{ | |
4551 | + "uncachable", /* 0 */ | |
4552 | + "write-combining", /* 1 */ | |
4553 | + "?", /* 2 */ | |
4554 | + "?", /* 3 */ | |
4555 | + "write-through", /* 4 */ | |
4556 | + "write-protect", /* 5 */ | |
4557 | + "write-back", /* 6 */ | |
4558 | +}; | |
4559 | + | |
4560 | +char *mtrr_attrib_to_str(int x) | |
4561 | +{ | |
4562 | + return (x <= 6) ? mtrr_strings[x] : "?"; | |
4563 | +} | |
4564 | + | |
4565 | static int | |
4566 | mtrr_file_add(unsigned long base, unsigned long size, | |
4567 | unsigned int type, char increment, struct file *file, int page) | |
4568 | @@ -300,11 +316,6 @@ | |
4569 | ||
4570 | # endif /* CONFIG_PROC_FS */ | |
4571 | ||
4572 | -char * attrib_to_str(int x) | |
4573 | -{ | |
4574 | - return (x <= 6) ? mtrr_strings[x] : "?"; | |
4575 | -} | |
4576 | - | |
4577 | static int mtrr_seq_show(struct seq_file *seq, void *offset) | |
4578 | { | |
4579 | char factor; | |
4580 | @@ -332,7 +343,7 @@ | |
4581 | len += seq_printf(seq, | |
4582 | "reg%02i: base=0x%05lx000 (%4liMB), size=%4i%cB: %s, count=%d\n", | |
4583 | i, base, base >> (20 - PAGE_SHIFT), size, factor, | |
4584 | - attrib_to_str(type), usage_table[i]); | |
4585 | + mtrr_attrib_to_str(type), usage_table[i]); | |
4586 | } | |
4587 | } | |
4588 | return 0; | |
4589 | diff -Nru a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c | |
4590 | --- a/arch/i386/kernel/cpu/mtrr/main.c Thu Aug 21 11:48:14 2003 | |
4591 | +++ b/arch/i386/kernel/cpu/mtrr/main.c Sun Aug 31 16:14:43 2003 | |
4592 | @@ -111,11 +111,6 @@ | |
4593 | num_var_ranges = config & 0xff; | |
4594 | } | |
4595 | ||
4596 | -static char * attrib_to_str(int x) | |
4597 | -{ | |
4598 | - return (x <= 6) ? mtrr_strings[x] : "?"; | |
4599 | -} | |
4600 | - | |
4601 | static void init_table(void) | |
4602 | { | |
4603 | int i, max; | |
4604 | @@ -362,8 +357,8 @@ | |
4605 | if (type == MTRR_TYPE_UNCACHABLE) | |
4606 | continue; | |
4607 | printk (KERN_WARNING "mtrr: type mismatch for %lx000,%lx000 old: %s new: %s\n", | |
4608 | - base, size, attrib_to_str(ltype), | |
4609 | - attrib_to_str(type)); | |
4610 | + base, size, mtrr_attrib_to_str(ltype), | |
4611 | + mtrr_attrib_to_str(type)); | |
4612 | goto out; | |
4613 | } | |
4614 | if (increment) | |
4615 | @@ -703,16 +698,4 @@ | |
4616 | return -ENXIO; | |
4617 | } | |
4618 | ||
4619 | -char *mtrr_strings[MTRR_NUM_TYPES] = | |
4620 | -{ | |
4621 | - "uncachable", /* 0 */ | |
4622 | - "write-combining", /* 1 */ | |
4623 | - "?", /* 2 */ | |
4624 | - "?", /* 3 */ | |
4625 | - "write-through", /* 4 */ | |
4626 | - "write-protect", /* 5 */ | |
4627 | - "write-back", /* 6 */ | |
4628 | -}; | |
4629 | - | |
4630 | subsys_initcall(mtrr_init); | |
4631 | - | |
4632 | diff -Nru a/arch/i386/kernel/cpu/mtrr/mtrr.h b/arch/i386/kernel/cpu/mtrr/mtrr.h | |
4633 | --- a/arch/i386/kernel/cpu/mtrr/mtrr.h Wed Nov 27 22:37:22 2002 | |
4634 | +++ b/arch/i386/kernel/cpu/mtrr/mtrr.h Sun Aug 31 16:14:43 2003 | |
4635 | @@ -95,5 +95,6 @@ | |
4636 | ||
4637 | void finalize_mtrr_state(void); | |
4638 | void mtrr_state_warn(void); | |
4639 | +char *mtrr_attrib_to_str(int x); | |
4640 | ||
4641 | extern char * mtrr_if_name[]; | |
4642 | diff -Nru a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c | |
4643 | --- a/arch/i386/kernel/cpuid.c Mon Aug 18 19:46:23 2003 | |
4644 | +++ b/arch/i386/kernel/cpuid.c Tue Aug 26 09:25:40 2003 | |
4645 | @@ -115,7 +115,7 @@ | |
4646 | u32 data[4]; | |
4647 | size_t rv; | |
4648 | u32 reg = *ppos; | |
4649 | - int cpu = minor(file->f_dentry->d_inode->i_rdev); | |
4650 | + int cpu = iminor(file->f_dentry->d_inode); | |
4651 | ||
4652 | if ( count % 16 ) | |
4653 | return -EINVAL; /* Invalid chunk size */ | |
4654 | @@ -133,7 +133,7 @@ | |
4655 | ||
4656 | static int cpuid_open(struct inode *inode, struct file *file) | |
4657 | { | |
4658 | - int cpu = minor(file->f_dentry->d_inode->i_rdev); | |
4659 | + int cpu = iminor(file->f_dentry->d_inode); | |
4660 | struct cpuinfo_x86 *c = &(cpu_data)[cpu]; | |
4661 | ||
4662 | if (!cpu_online(cpu)) | |
4663 | diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c | |
4664 | --- a/arch/i386/kernel/mpparse.c Tue Aug 19 21:21:36 2003 | |
4665 | +++ b/arch/i386/kernel/mpparse.c Sun Aug 31 16:14:25 2003 | |
4666 | @@ -850,7 +850,7 @@ | |
4667 | return i; | |
4668 | } | |
4669 | ||
4670 | - printk(KERN_ERR "ERROR: Unable to locate IOAPIC for IRQ %d/n", irq); | |
4671 | + printk(KERN_ERR "ERROR: Unable to locate IOAPIC for IRQ %d\n", irq); | |
4672 | ||
4673 | return -1; | |
4674 | } | |
4675 | diff -Nru a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c | |
4676 | --- a/arch/i386/kernel/msr.c Mon Aug 18 19:46:23 2003 | |
4677 | +++ b/arch/i386/kernel/msr.c Tue Aug 26 09:25:40 2003 | |
4678 | @@ -194,7 +194,7 @@ | |
4679 | u32 data[2]; | |
4680 | size_t rv; | |
4681 | u32 reg = *ppos; | |
4682 | - int cpu = minor(file->f_dentry->d_inode->i_rdev); | |
4683 | + int cpu = iminor(file->f_dentry->d_inode); | |
4684 | int err; | |
4685 | ||
4686 | if ( count % 8 ) | |
4687 | @@ -219,7 +219,7 @@ | |
4688 | u32 data[2]; | |
4689 | size_t rv; | |
4690 | u32 reg = *ppos; | |
4691 | - int cpu = minor(file->f_dentry->d_inode->i_rdev); | |
4692 | + int cpu = iminor(file->f_dentry->d_inode); | |
4693 | int err; | |
4694 | ||
4695 | if ( count % 8 ) | |
4696 | @@ -239,7 +239,7 @@ | |
4697 | ||
4698 | static int msr_open(struct inode *inode, struct file *file) | |
4699 | { | |
4700 | - int cpu = minor(file->f_dentry->d_inode->i_rdev); | |
4701 | + int cpu = iminor(file->f_dentry->d_inode); | |
4702 | struct cpuinfo_x86 *c = &(cpu_data)[cpu]; | |
4703 | ||
4704 | if (!cpu_online(cpu)) | |
4705 | diff -Nru a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c | |
4706 | --- a/arch/i386/kernel/process.c Wed Aug 20 10:43:52 2003 | |
4707 | +++ b/arch/i386/kernel/process.c Tue Sep 2 00:37:21 2003 | |
4708 | @@ -452,7 +452,7 @@ | |
4709 | ||
4710 | /* never put a printk in __switch_to... printk() calls wake_up*() indirectly */ | |
4711 | ||
4712 | - unlazy_fpu(prev_p); | |
4713 | + __unlazy_fpu(prev_p); | |
4714 | ||
4715 | /* | |
4716 | * Reload esp0, LDT and the page table pointer: | |
4717 | diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c | |
4718 | --- a/arch/i386/kernel/setup.c Thu Aug 21 11:08:59 2003 | |
4719 | +++ b/arch/i386/kernel/setup.c Sun Aug 31 16:14:11 2003 | |
4720 | @@ -71,6 +71,7 @@ | |
4721 | EXPORT_SYMBOL(acpi_disabled); | |
4722 | ||
4723 | #ifdef CONFIG_ACPI_BOOT | |
4724 | + int acpi_irq __initdata = 1; /* enable IRQ */ | |
4725 | int acpi_ht __initdata = 1; /* enable HT */ | |
4726 | #endif | |
4727 | ||
4728 | @@ -542,6 +543,11 @@ | |
4729 | else if (!memcmp(from, "acpi=ht", 7)) { | |
4730 | acpi_ht = 1; | |
4731 | if (!acpi_force) acpi_disabled = 1; | |
4732 | + } | |
4733 | + | |
4734 | + /* "pci=noacpi" disables ACPI interrupt routing */ | |
4735 | + else if (!memcmp(from, "pci=noacpi", 10)) { | |
4736 | + acpi_irq = 0; | |
4737 | } | |
4738 | ||
4739 | #ifdef CONFIG_X86_LOCAL_APIC | |
4740 | diff -Nru a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c | |
4741 | --- a/arch/i386/kernel/time.c Thu Jul 10 22:22:57 2003 | |
4742 | +++ b/arch/i386/kernel/time.c Fri Aug 29 03:51:17 2003 | |
4743 | @@ -60,6 +60,8 @@ | |
4744 | #include <linux/timex.h> | |
4745 | #include <linux/config.h> | |
4746 | ||
4747 | +#include <asm/hpet.h> | |
4748 | + | |
4749 | #include <asm/arch_hooks.h> | |
4750 | ||
4751 | #include "io_ports.h" | |
4752 | @@ -291,8 +293,38 @@ | |
4753 | ||
4754 | device_initcall(time_init_device); | |
4755 | ||
4756 | +#ifdef CONFIG_HPET_TIMER | |
4757 | +extern void (*late_time_init)(void); | |
4758 | +/* Duplicate of time_init() below, with hpet_enable part added */ | |
4759 | +void __init hpet_time_init(void) | |
4760 | +{ | |
4761 | + xtime.tv_sec = get_cmos_time(); | |
4762 | + wall_to_monotonic.tv_sec = -xtime.tv_sec; | |
4763 | + xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); | |
4764 | + wall_to_monotonic.tv_nsec = -xtime.tv_nsec; | |
4765 | + | |
4766 | + if (hpet_enable() >= 0) { | |
4767 | + printk("Using HPET for base-timer\n"); | |
4768 | + } | |
4769 | + | |
4770 | + cur_timer = select_timer(); | |
4771 | + time_init_hook(); | |
4772 | +} | |
4773 | +#endif | |
4774 | + | |
4775 | void __init time_init(void) | |
4776 | { | |
4777 | +#ifdef CONFIG_HPET_TIMER | |
4778 | + if (is_hpet_capable()) { | |
4779 | + /* | |
4780 | + * HPET initialization needs to do memory-mapped io. So, let | |
4781 | + * us do a late initialization after mem_init(). | |
4782 | + */ | |
4783 | + late_time_init = hpet_time_init; | |
4784 | + return; | |
4785 | + } | |
4786 | +#endif | |
4787 | + | |
4788 | xtime.tv_sec = get_cmos_time(); | |
4789 | wall_to_monotonic.tv_sec = -xtime.tv_sec; | |
4790 | xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); | |
4791 | diff -Nru a/arch/i386/kernel/time_hpet.c b/arch/i386/kernel/time_hpet.c | |
4792 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
4793 | +++ b/arch/i386/kernel/time_hpet.c Wed Sep 3 23:40:07 2003 | |
4794 | @@ -0,0 +1,391 @@ | |
4795 | +/* | |
4796 | + * linux/arch/i386/kernel/time_hpet.c | |
4797 | + * This code largely copied from arch/x86_64/kernel/time.c | |
4798 | + * See that file for credits. | |
4799 | + * | |
4800 | + * 2003-06-30 Venkatesh Pallipadi - Additional changes for HPET support | |
4801 | + */ | |
4802 | + | |
4803 | +#include <linux/errno.h> | |
4804 | +#include <linux/kernel.h> | |
4805 | +#include <linux/param.h> | |
4806 | +#include <linux/string.h> | |
4807 | +#include <linux/init.h> | |
4808 | +#include <linux/smp.h> | |
4809 | + | |
4810 | +#include <asm/timer.h> | |
4811 | +#include <asm/fixmap.h> | |
4812 | +#include <asm/apic.h> | |
4813 | + | |
4814 | +#include <linux/timex.h> | |
4815 | +#include <linux/config.h> | |
4816 | + | |
4817 | +#include <asm/hpet.h> | |
4818 | + | |
4819 | +unsigned long hpet_period; /* fsecs / HPET clock */ | |
4820 | +unsigned long hpet_tick; /* hpet clks count per tick */ | |
4821 | +unsigned long hpet_address; /* hpet memory map physical address */ | |
4822 | + | |
4823 | +static int use_hpet; /* can be used for runtime check of hpet */ | |
4824 | +static int boot_hpet_disable; /* boottime override for HPET timer */ | |
4825 | +static unsigned long hpet_virt_address; /* hpet kernel virtual address */ | |
4826 | + | |
4827 | +#define FSEC_TO_USEC (1000000000UL) | |
4828 | + | |
4829 | +int hpet_readl(unsigned long a) | |
4830 | +{ | |
4831 | + return readl(hpet_virt_address + a); | |
4832 | +} | |
4833 | + | |
4834 | +void hpet_writel(unsigned long d, unsigned long a) | |
4835 | +{ | |
4836 | + writel(d, hpet_virt_address + a); | |
4837 | +} | |
4838 | + | |
4839 | +#ifdef CONFIG_X86_LOCAL_APIC | |
4840 | +/* | |
4841 | + * HPET counters dont wrap around on every tick. They just change the | |
4842 | + * comparator value and continue. Next tick can be caught by checking | |
4843 | + * for a change in the comparator value. Used in apic.c. | |
4844 | + */ | |
4845 | +void __init wait_hpet_tick(void) | |
4846 | +{ | |
4847 | + unsigned int start_cmp_val, end_cmp_val; | |
4848 | + | |
4849 | + start_cmp_val = hpet_readl(HPET_T0_CMP); | |
4850 | + do { | |
4851 | + end_cmp_val = hpet_readl(HPET_T0_CMP); | |
4852 | + } while (start_cmp_val == end_cmp_val); | |
4853 | +} | |
4854 | +#endif | |
4855 | + | |
4856 | +/* | |
4857 | + * Check whether HPET was found by ACPI boot parse. If yes setup HPET | |
4858 | + * counter 0 for kernel base timer. | |
4859 | + */ | |
4860 | +int __init hpet_enable(void) | |
4861 | +{ | |
4862 | + unsigned int cfg, id; | |
4863 | + unsigned long tick_fsec_low, tick_fsec_high; /* tick in femto sec */ | |
4864 | + unsigned long hpet_tick_rem; | |
4865 | + | |
4866 | + if (boot_hpet_disable) | |
4867 | + return -1; | |
4868 | + | |
4869 | + if (!hpet_address) { | |
4870 | + return -1; | |
4871 | + } | |
4872 | + hpet_virt_address = (unsigned long) ioremap_nocache(hpet_address, | |
4873 | + HPET_MMAP_SIZE); | |
4874 | + /* | |
4875 | + * Read the period, compute tick and quotient. | |
4876 | + */ | |
4877 | + id = hpet_readl(HPET_ID); | |
4878 | + | |
4879 | + /* | |
4880 | + * We are checking for value '1' or more in number field. | |
4881 | + * So, we are OK with HPET_EMULATE_RTC part too, where we need | |
4882 | + * to have atleast 2 timers. | |
4883 | + */ | |
4884 | + if (!(id & HPET_ID_NUMBER) || | |
4885 | + !(id & HPET_ID_LEGSUP)) | |
4886 | + return -1; | |
4887 | + | |
4888 | + if (((id & HPET_ID_VENDOR) >> HPET_ID_VENDOR_SHIFT) != | |
4889 | + HPET_ID_VENDOR_8086) | |
4890 | + return -1; | |
4891 | + | |
4892 | + hpet_period = hpet_readl(HPET_PERIOD); | |
4893 | + if ((hpet_period < HPET_MIN_PERIOD) || (hpet_period > HPET_MAX_PERIOD)) | |
4894 | + return -1; | |
4895 | + | |
4896 | + /* | |
4897 | + * 64 bit math | |
4898 | + * First changing tick into fsec | |
4899 | + * Then 64 bit div to find number of hpet clk per tick | |
4900 | + */ | |
4901 | + ASM_MUL64_REG(tick_fsec_low, tick_fsec_high, | |
4902 | + KERNEL_TICK_USEC, FSEC_TO_USEC); | |
4903 | + ASM_DIV64_REG(hpet_tick, hpet_tick_rem, | |
4904 | + hpet_period, tick_fsec_low, tick_fsec_high); | |
4905 | + | |
4906 | + if (hpet_tick_rem > (hpet_period >> 1)) | |
4907 | + hpet_tick++; /* rounding the result */ | |
4908 | + | |
4909 | + /* | |
4910 | + * Stop the timers and reset the main counter. | |
4911 | + */ | |
4912 | + cfg = hpet_readl(HPET_CFG); | |
4913 | + cfg &= ~HPET_CFG_ENABLE; | |
4914 | + hpet_writel(cfg, HPET_CFG); | |
4915 | + hpet_writel(0, HPET_COUNTER); | |
4916 | + hpet_writel(0, HPET_COUNTER + 4); | |
4917 | + | |
4918 | + /* | |
4919 | + * Set up timer 0, as periodic with first interrupt to happen at | |
4920 | + * hpet_tick, and period also hpet_tick. | |
4921 | + */ | |
4922 | + cfg = hpet_readl(HPET_T0_CFG); | |
4923 | + cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC | | |
4924 | + HPET_TN_SETVAL | HPET_TN_32BIT; | |
4925 | + hpet_writel(cfg, HPET_T0_CFG); | |
4926 | + hpet_writel(hpet_tick, HPET_T0_CMP); | |
4927 | + | |
4928 | + /* | |
4929 | + * Go! | |
4930 | + */ | |
4931 | + cfg = hpet_readl(HPET_CFG); | |
4932 | + cfg |= HPET_CFG_ENABLE | HPET_CFG_LEGACY; | |
4933 | + hpet_writel(cfg, HPET_CFG); | |
4934 | + | |
4935 | + use_hpet = 1; | |
4936 | +#ifdef CONFIG_X86_LOCAL_APIC | |
4937 | + wait_timer_tick = wait_hpet_tick; | |
4938 | +#endif | |
4939 | + return 0; | |
4940 | +} | |
4941 | + | |
4942 | +int is_hpet_enabled(void) | |
4943 | +{ | |
4944 | + return use_hpet; | |
4945 | +} | |
4946 | + | |
4947 | +int is_hpet_capable(void) | |
4948 | +{ | |
4949 | + if (!boot_hpet_disable && hpet_address) | |
4950 | + return 1; | |
4951 | + return 0; | |
4952 | +} | |
4953 | + | |
4954 | +static int __init hpet_setup(char* str) | |
4955 | +{ | |
4956 | + if (str) { | |
4957 | + if (!strncmp("disable", str, 7)) | |
4958 | + boot_hpet_disable = 1; | |
4959 | + } | |
4960 | + return 1; | |
4961 | +} | |
4962 | + | |
4963 | +__setup("hpet=", hpet_setup); | |
4964 | + | |
4965 | +#ifdef CONFIG_HPET_EMULATE_RTC | |
4966 | +/* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET | |
4967 | + * is enabled, we support RTC interrupt functionality in software. | |
4968 | + * RTC has 3 kinds of interrupts: | |
4969 | + * 1) Update Interrupt - generate an interrupt, every sec, when RTC clock | |
4970 | + * is updated | |
4971 | + * 2) Alarm Interrupt - generate an interrupt at a specific time of day | |
4972 | + * 3) Periodic Interrupt - generate periodic interrupt, with frequencies | |
4973 | + * 2Hz-8192Hz (2Hz-64Hz for non-root user) (all freqs in powers of 2) | |
4974 | + * (1) and (2) above are implemented using polling at a frequency of | |
4975 | + * 64 Hz. The exact frequency is a tradeoff between accuracy and interrupt | |
4976 | + * overhead. (DEFAULT_RTC_INT_FREQ) | |
4977 | + * For (3), we use interrupts at 64Hz or user specified periodic | |
4978 | + * frequency, whichever is higher. | |
4979 | + */ | |
4980 | +#include <linux/mc146818rtc.h> | |
4981 | +#include <linux/rtc.h> | |
4982 | + | |
4983 | +extern irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs); | |
4984 | + | |
4985 | +#define DEFAULT_RTC_INT_FREQ 64 | |
4986 | +#define RTC_NUM_INTS 1 | |
4987 | + | |
4988 | +static unsigned long UIE_on; | |
4989 | +static unsigned long prev_update_sec; | |
4990 | + | |
4991 | +static unsigned long AIE_on; | |
4992 | +static struct rtc_time alarm_time; | |
4993 | + | |
4994 | +static unsigned long PIE_on; | |
4995 | +static unsigned long PIE_freq = DEFAULT_RTC_INT_FREQ; | |
4996 | +static unsigned long PIE_count; | |
4997 | + | |
4998 | +static unsigned long hpet_rtc_int_freq; /* RTC interrupt frequency */ | |
4999 | + | |
5000 | +/* | |
5001 | + * Timer 1 for RTC, we do not use periodic interrupt feature, | |
5002 | + * even if HPET supports periodic interrupts on Timer 1. | |
5003 | + * The reason being, to set up a periodic interrupt in HPET, we need to | |
5004 | + * stop the main counter. And if we do that everytime someone diables/enables | |
5005 | + * RTC, we will have adverse effect on main kernel timer running on Timer 0. | |
5006 | + * So, for the time being, simulate the periodic interrupt in software. | |
5007 | + * | |
5008 | + * hpet_rtc_timer_init() is called for the first time and during subsequent | |
5009 | + * interuppts reinit happens through hpet_rtc_timer_reinit(). | |
5010 | + */ | |
5011 | +int hpet_rtc_timer_init(void) | |
5012 | +{ | |
5013 | + unsigned int cfg, cnt; | |
5014 | + unsigned long flags; | |
5015 | + | |
5016 | + if (!is_hpet_enabled()) | |
5017 | + return 0; | |
5018 | + /* | |
5019 | + * Set the counter 1 and enable the interrupts. | |
5020 | + */ | |
5021 | + if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ)) | |
5022 | + hpet_rtc_int_freq = PIE_freq; | |
5023 | + else | |
5024 | + hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ; | |
5025 | + | |
5026 | + local_irq_save(flags); | |
5027 | + cnt = hpet_readl(HPET_COUNTER); | |
5028 | + cnt += ((hpet_tick*HZ)/hpet_rtc_int_freq); | |
5029 | + hpet_writel(cnt, HPET_T1_CMP); | |
5030 | + local_irq_restore(flags); | |
5031 | + | |
5032 | + cfg = hpet_readl(HPET_T1_CFG); | |
5033 | + cfg |= HPET_TN_ENABLE | HPET_TN_SETVAL | HPET_TN_32BIT; | |
5034 | + hpet_writel(cfg, HPET_T1_CFG); | |
5035 | + | |
5036 | + return 1; | |
5037 | +} | |
5038 | + | |
5039 | +static void hpet_rtc_timer_reinit(void) | |
5040 | +{ | |
5041 | + unsigned int cfg, cnt; | |
5042 | + | |
5043 | + if (!(PIE_on | AIE_on | UIE_on)) | |
5044 | + return; | |
5045 | + | |
5046 | + if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ)) | |
5047 | + hpet_rtc_int_freq = PIE_freq; | |
5048 | + else | |
5049 | + hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ; | |
5050 | + | |
5051 | + /* It is more accurate to use the comparator value than current count.*/ | |
5052 | + cnt = hpet_readl(HPET_T1_CMP); | |
5053 | + cnt += hpet_tick*HZ/hpet_rtc_int_freq; | |
5054 | + hpet_writel(cnt, HPET_T1_CMP); | |
5055 | + | |
5056 | + cfg = hpet_readl(HPET_T1_CFG); | |
5057 | + cfg |= HPET_TN_ENABLE | HPET_TN_SETVAL | HPET_TN_32BIT; | |
5058 | + hpet_writel(cfg, HPET_T1_CFG); | |
5059 | + | |
5060 | + return; | |
5061 | +} | |
5062 | + | |
5063 | +/* | |
5064 | + * The functions below are called from rtc driver. | |
5065 | + * Return 0 if HPET is not being used. | |
5066 | + * Otherwise do the necessary changes and return 1. | |
5067 | + */ | |
5068 | +int hpet_mask_rtc_irq_bit(unsigned long bit_mask) | |
5069 | +{ | |
5070 | + if (!is_hpet_enabled()) | |
5071 | + return 0; | |
5072 | + | |
5073 | + if (bit_mask & RTC_UIE) | |
5074 | + UIE_on = 0; | |
5075 | + if (bit_mask & RTC_PIE) | |
5076 | + PIE_on = 0; | |
5077 | + if (bit_mask & RTC_AIE) | |
5078 | + AIE_on = 0; | |
5079 | + | |
5080 | + return 1; | |
5081 | +} | |
5082 | + | |
5083 | +int hpet_set_rtc_irq_bit(unsigned long bit_mask) | |
5084 | +{ | |
5085 | + int timer_init_reqd = 0; | |
5086 | + | |
5087 | + if (!is_hpet_enabled()) | |
5088 | + return 0; | |
5089 | + | |
5090 | + if (!(PIE_on | AIE_on | UIE_on)) | |
5091 | + timer_init_reqd = 1; | |
5092 | + | |
5093 | + if (bit_mask & RTC_UIE) { | |
5094 | + UIE_on = 1; | |
5095 | + } | |
5096 | + if (bit_mask & RTC_PIE) { | |
5097 | + PIE_on = 1; | |
5098 | + PIE_count = 0; | |
5099 | + } | |
5100 | + if (bit_mask & RTC_AIE) { | |
5101 | + AIE_on = 1; | |
5102 | + } | |
5103 | + | |
5104 | + if (timer_init_reqd) | |
5105 | + hpet_rtc_timer_init(); | |
5106 | + | |
5107 | + return 1; | |
5108 | +} | |
5109 | + | |
5110 | +int hpet_set_alarm_time(unsigned char hrs, unsigned char min, unsigned char sec) | |
5111 | +{ | |
5112 | + if (!is_hpet_enabled()) | |
5113 | + return 0; | |
5114 | + | |
5115 | + alarm_time.tm_hour = hrs; | |
5116 | + alarm_time.tm_min = min; | |
5117 | + alarm_time.tm_sec = sec; | |
5118 | + | |
5119 | + return 1; | |
5120 | +} | |
5121 | + | |
5122 | +int hpet_set_periodic_freq(unsigned long freq) | |
5123 | +{ | |
5124 | + if (!is_hpet_enabled()) | |
5125 | + return 0; | |
5126 | + | |
5127 | + PIE_freq = freq; | |
5128 | + PIE_count = 0; | |
5129 | + | |
5130 | + return 1; | |
5131 | +} | |
5132 | + | |
5133 | +int hpet_rtc_dropped_irq(void) | |
5134 | +{ | |
5135 | + if (!is_hpet_enabled()) | |
5136 | + return 0; | |
5137 | + | |
5138 | + return 1; | |
5139 | +} | |
5140 | + | |
5141 | +irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |
5142 | +{ | |
5143 | + struct rtc_time curr_time; | |
5144 | + unsigned long rtc_int_flag = 0; | |
5145 | + int call_rtc_interrupt = 0; | |
5146 | + | |
5147 | + hpet_rtc_timer_reinit(); | |
5148 | + | |
5149 | + if (UIE_on | AIE_on) { | |
5150 | + rtc_get_rtc_time(&curr_time); | |
5151 | + } | |
5152 | + if (UIE_on) { | |
5153 | + if (curr_time.tm_sec != prev_update_sec) { | |
5154 | + /* Set update int info, call real rtc int routine */ | |
5155 | + call_rtc_interrupt = 1; | |
5156 | + rtc_int_flag = RTC_UF; | |
5157 | + prev_update_sec = curr_time.tm_sec; | |
5158 | + } | |
5159 | + } | |
5160 | + if (PIE_on) { | |
5161 | + PIE_count++; | |
5162 | + if (PIE_count >= hpet_rtc_int_freq/PIE_freq) { | |
5163 | + /* Set periodic int info, call real rtc int routine */ | |
5164 | + call_rtc_interrupt = 1; | |
5165 | + rtc_int_flag |= RTC_PF; | |
5166 | + PIE_count = 0; | |
5167 | + } | |
5168 | + } | |
5169 | + if (AIE_on) { | |
5170 | + if ((curr_time.tm_sec == alarm_time.tm_sec) && | |
5171 | + (curr_time.tm_min == alarm_time.tm_min) && | |
5172 | + (curr_time.tm_hour == alarm_time.tm_hour)) { | |
5173 | + /* Set alarm int info, call real rtc int routine */ | |
5174 | + call_rtc_interrupt = 1; | |
5175 | + rtc_int_flag |= RTC_AF; | |
5176 | + } | |
5177 | + } | |
5178 | + if (call_rtc_interrupt) { | |
5179 | + rtc_int_flag |= (RTC_IRQF | (RTC_NUM_INTS << 8)); | |
5180 | + rtc_interrupt(rtc_int_flag, dev_id, regs); | |
5181 | + } | |
5182 | + return IRQ_HANDLED; | |
5183 | +} | |
5184 | +#endif | |
5185 | + | |
5186 | diff -Nru a/arch/i386/kernel/timers/Makefile b/arch/i386/kernel/timers/Makefile | |
5187 | --- a/arch/i386/kernel/timers/Makefile Sun May 4 23:38:34 2003 | |
5188 | +++ b/arch/i386/kernel/timers/Makefile Sun Aug 31 16:14:50 2003 | |
5189 | @@ -5,3 +5,4 @@ | |
5190 | obj-y := timer.o timer_none.o timer_tsc.o timer_pit.o | |
5191 | ||
5192 | obj-$(CONFIG_X86_CYCLONE_TIMER) += timer_cyclone.o | |
5193 | +obj-$(CONFIG_HPET_TIMER) += timer_hpet.o | |
5194 | diff -Nru a/arch/i386/kernel/timers/timer.c b/arch/i386/kernel/timers/timer.c | |
5195 | --- a/arch/i386/kernel/timers/timer.c Wed Jul 2 21:21:34 2003 | |
5196 | +++ b/arch/i386/kernel/timers/timer.c Sun Aug 31 16:15:21 2003 | |
5197 | @@ -3,10 +3,21 @@ | |
5198 | #include <linux/string.h> | |
5199 | #include <asm/timer.h> | |
5200 | ||
5201 | +#ifdef CONFIG_HPET_TIMER | |
5202 | +/* | |
5203 | + * HPET memory read is slower than tsc reads, but is more dependable as it | |
5204 | + * always runs at constant frequency and reduces complexity due to | |
5205 | + * cpufreq. So, we prefer HPET timer to tsc based one. Also, we cannot use | |
5206 | + * timer_pit when HPET is active. So, we default to timer_tsc. | |
5207 | + */ | |
5208 | +#endif | |
5209 | /* list of timers, ordered by preference, NULL terminated */ | |
5210 | static struct timer_opts* timers[] = { | |
5211 | #ifdef CONFIG_X86_CYCLONE_TIMER | |
5212 | &timer_cyclone, | |
5213 | +#endif | |
5214 | +#ifdef CONFIG_HPET_TIMER | |
5215 | + &timer_hpet, | |
5216 | #endif | |
5217 | &timer_tsc, | |
5218 | &timer_pit, | |
5219 | diff -Nru a/arch/i386/kernel/timers/timer_hpet.c b/arch/i386/kernel/timers/timer_hpet.c | |
5220 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
5221 | +++ b/arch/i386/kernel/timers/timer_hpet.c Sun Aug 31 16:15:29 2003 | |
5222 | @@ -0,0 +1,241 @@ | |
5223 | +/* | |
5224 | + * This code largely moved from arch/i386/kernel/time.c. | |
5225 | + * See comments there for proper credits. | |
5226 | + */ | |
5227 | + | |
5228 | +#include <linux/spinlock.h> | |
5229 | +#include <linux/init.h> | |
5230 | +#include <linux/timex.h> | |
5231 | +#include <linux/errno.h> | |
5232 | +#include <linux/string.h> | |
5233 | +#include <linux/jiffies.h> | |
5234 | + | |
5235 | +#include <asm/timer.h> | |
5236 | +#include <asm/io.h> | |
5237 | +#include <asm/processor.h> | |
5238 | + | |
5239 | +#include "io_ports.h" | |
5240 | +#include "mach_timer.h" | |
5241 | +#include <asm/hpet.h> | |
5242 | + | |
5243 | +static unsigned long hpet_usec_quotient; /* convert hpet clks to usec */ | |
5244 | +static unsigned long tsc_hpet_quotient; /* convert tsc to hpet clks */ | |
5245 | +static unsigned long hpet_last; /* hpet counter value at last tick*/ | |
5246 | +static unsigned long last_tsc_low; /* lsb 32 bits of Time Stamp Counter */ | |
5247 | +static unsigned long last_tsc_high; /* msb 32 bits of Time Stamp Counter */ | |
5248 | +static unsigned long long monotonic_base; | |
5249 | +static rwlock_t monotonic_lock = RW_LOCK_UNLOCKED; | |
5250 | + | |
5251 | +/* convert from cycles(64bits) => nanoseconds (64bits) | |
5252 | + * basic equation: | |
5253 | + * ns = cycles / (freq / ns_per_sec) | |
5254 | + * ns = cycles * (ns_per_sec / freq) | |
5255 | + * ns = cycles * (10^9 / (cpu_mhz * 10^6)) | |
5256 | + * ns = cycles * (10^3 / cpu_mhz) | |
5257 | + * | |
5258 | + * Then we use scaling math (suggested by george@mvista.com) to get: | |
5259 | + * ns = cycles * (10^3 * SC / cpu_mhz) / SC | |
5260 | + * ns = cycles * cyc2ns_scale / SC | |
5261 | + * | |
5262 | + * And since SC is a constant power of two, we can convert the div | |
5263 | + * into a shift. | |
5264 | + * -johnstul@us.ibm.com "math is hard, lets go shopping!" | |
5265 | + */ | |
5266 | +static unsigned long cyc2ns_scale; | |
5267 | +#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */ | |
5268 | + | |
5269 | +static inline void set_cyc2ns_scale(unsigned long cpu_mhz) | |
5270 | +{ | |
5271 | + cyc2ns_scale = (1000 << CYC2NS_SCALE_FACTOR)/cpu_mhz; | |
5272 | +} | |
5273 | + | |
5274 | +static inline unsigned long long cycles_2_ns(unsigned long long cyc) | |
5275 | +{ | |
5276 | + return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR; | |
5277 | +} | |
5278 | + | |
5279 | +static unsigned long long monotonic_clock_hpet(void) | |
5280 | +{ | |
5281 | + unsigned long long last_offset, this_offset, base; | |
5282 | + | |
5283 | + /* atomically read monotonic base & last_offset */ | |
5284 | + read_lock_irq(&monotonic_lock); | |
5285 | + last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; | |
5286 | + base = monotonic_base; | |
5287 | + read_unlock_irq(&monotonic_lock); | |
5288 | + | |
5289 | + /* Read the Time Stamp Counter */ | |
5290 | + rdtscll(this_offset); | |
5291 | + | |
5292 | + /* return the value in ns */ | |
5293 | + return base + cycles_2_ns(this_offset - last_offset); | |
5294 | +} | |
5295 | + | |
5296 | +static unsigned long get_offset_hpet(void) | |
5297 | +{ | |
5298 | + register unsigned long eax, edx; | |
5299 | + | |
5300 | + eax = hpet_readl(HPET_COUNTER); | |
5301 | + eax -= hpet_last; /* hpet delta */ | |
5302 | + | |
5303 | + /* | |
5304 | + * Time offset = (hpet delta) * ( usecs per HPET clock ) | |
5305 | + * = (hpet delta) * ( usecs per tick / HPET clocks per tick) | |
5306 | + * = (hpet delta) * ( hpet_usec_quotient ) / (2^32) | |
5307 | + * | |
5308 | + * Where, | |
5309 | + * hpet_usec_quotient = (2^32 * usecs per tick)/HPET clocks per tick | |
5310 | + * | |
5311 | + * Using a mull instead of a divl saves some cycles in critical path. | |
5312 | + */ | |
5313 | + ASM_MUL64_REG(eax, edx, hpet_usec_quotient, eax); | |
5314 | + | |
5315 | + /* our adjusted time offset in microseconds */ | |
5316 | + return edx; | |
5317 | +} | |
5318 | + | |
5319 | +static void mark_offset_hpet(void) | |
5320 | +{ | |
5321 | + unsigned long long this_offset, last_offset; | |
5322 | + unsigned long offset; | |
5323 | + | |
5324 | + write_lock(&monotonic_lock); | |
5325 | + last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; | |
5326 | + rdtsc(last_tsc_low, last_tsc_high); | |
5327 | + | |
5328 | + offset = hpet_readl(HPET_T0_CMP) - hpet_tick; | |
5329 | + if (unlikely(((offset - hpet_last) > hpet_tick) && (hpet_last != 0))) { | |
5330 | + int lost_ticks = (offset - hpet_last) / hpet_tick; | |
5331 | + jiffies += lost_ticks; | |
5332 | + } | |
5333 | + hpet_last = offset; | |
5334 | + | |
5335 | + /* update the monotonic base value */ | |
5336 | + this_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; | |
5337 | + monotonic_base += cycles_2_ns(this_offset - last_offset); | |
5338 | + write_unlock(&monotonic_lock); | |
5339 | +} | |
5340 | + | |
5341 | +void delay_hpet(unsigned long loops) | |
5342 | +{ | |
5343 | + unsigned long hpet_start, hpet_end; | |
5344 | + unsigned long eax; | |
5345 | + | |
5346 | + /* loops is the number of cpu cycles. Convert it to hpet clocks */ | |
5347 | + ASM_MUL64_REG(eax, loops, tsc_hpet_quotient, loops); | |
5348 | + | |
5349 | + hpet_start = hpet_readl(HPET_COUNTER); | |
5350 | + do { | |
5351 | + rep_nop(); | |
5352 | + hpet_end = hpet_readl(HPET_COUNTER); | |
5353 | + } while ((hpet_end - hpet_start) < (loops)); | |
5354 | +} | |
5355 | + | |
5356 | +/* ------ Calibrate the TSC ------- | |
5357 | + * Return 2^32 * (1 / (TSC clocks per usec)) for getting the CPU freq. | |
5358 | + * Set 2^32 * (1 / (tsc per HPET clk)) for delay_hpet(). | |
5359 | + * calibrate_tsc() calibrates the processor TSC by comparing | |
5360 | + * it to the HPET timer of known frequency. | |
5361 | + * Too much 64-bit arithmetic here to do this cleanly in C | |
5362 | + */ | |
5363 | +#define CALIBRATE_CNT_HPET (5 * hpet_tick) | |
5364 | +#define CALIBRATE_TIME_HPET (5 * KERNEL_TICK_USEC) | |
5365 | + | |
5366 | +static unsigned long __init calibrate_tsc(void) | |
5367 | +{ | |
5368 | + unsigned long tsc_startlow, tsc_starthigh; | |
5369 | + unsigned long tsc_endlow, tsc_endhigh; | |
5370 | + unsigned long hpet_start, hpet_end; | |
5371 | + unsigned long result, remain; | |
5372 | + | |
5373 | + hpet_start = hpet_readl(HPET_COUNTER); | |
5374 | + rdtsc(tsc_startlow, tsc_starthigh); | |
5375 | + do { | |
5376 | + hpet_end = hpet_readl(HPET_COUNTER); | |
5377 | + } while ((hpet_end - hpet_start) < CALIBRATE_CNT_HPET); | |
5378 | + rdtsc(tsc_endlow, tsc_endhigh); | |
5379 | + | |
5380 | + /* 64-bit subtract - gcc just messes up with long longs */ | |
5381 | + __asm__("subl %2,%0\n\t" | |
5382 | + "sbbl %3,%1" | |
5383 | + :"=a" (tsc_endlow), "=d" (tsc_endhigh) | |
5384 | + :"g" (tsc_startlow), "g" (tsc_starthigh), | |
5385 | + "0" (tsc_endlow), "1" (tsc_endhigh)); | |
5386 | + | |
5387 | + /* Error: ECPUTOOFAST */ | |
5388 | + if (tsc_endhigh) | |
5389 | + goto bad_calibration; | |
5390 | + | |
5391 | + /* Error: ECPUTOOSLOW */ | |
5392 | + if (tsc_endlow <= CALIBRATE_TIME_HPET) | |
5393 | + goto bad_calibration; | |
5394 | + | |
5395 | + ASM_DIV64_REG(result, remain, tsc_endlow, 0, CALIBRATE_TIME_HPET); | |
5396 | + if (remain > (tsc_endlow >> 1)) | |
5397 | + result++; /* rounding the result */ | |
5398 | + | |
5399 | + ASM_DIV64_REG(tsc_hpet_quotient, remain, tsc_endlow, 0, | |
5400 | + CALIBRATE_CNT_HPET); | |
5401 | + if (remain > (tsc_endlow >> 1)) | |
5402 | + tsc_hpet_quotient++; /* rounding the result */ | |
5403 | + | |
5404 | + return result; | |
5405 | +bad_calibration: | |
5406 | + /* | |
5407 | + * the CPU was so fast/slow that the quotient wouldn't fit in | |
5408 | + * 32 bits.. | |
5409 | + */ | |
5410 | + return 0; | |
5411 | +} | |
5412 | + | |
5413 | +static int __init init_hpet(char* override) | |
5414 | +{ | |
5415 | + unsigned long result, remain; | |
5416 | + | |
5417 | + /* check clock override */ | |
5418 | + if (override[0] && strncmp(override,"hpet",4)) | |
5419 | + return -ENODEV; | |
5420 | + | |
5421 | + if (!is_hpet_enabled()) | |
5422 | + return -ENODEV; | |
5423 | + | |
5424 | + printk("Using HPET for gettimeofday\n"); | |
5425 | + if (cpu_has_tsc) { | |
5426 | + unsigned long tsc_quotient = calibrate_tsc(); | |
5427 | + if (tsc_quotient) { | |
5428 | + /* report CPU clock rate in Hz. | |
5429 | + * The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) = | |
5430 | + * clock/second. Our precision is about 100 ppm. | |
5431 | + */ | |
5432 | + { unsigned long eax=0, edx=1000; | |
5433 | + ASM_DIV64_REG(cpu_khz, edx, tsc_quotient, | |
5434 | + eax, edx); | |
5435 | + printk("Detected %lu.%03lu MHz processor.\n", | |
5436 | + cpu_khz / 1000, cpu_khz % 1000); | |
5437 | + } | |
5438 | + set_cyc2ns_scale(cpu_khz/1000); | |
5439 | + } | |
5440 | + } | |
5441 | + | |
5442 | + /* | |
5443 | + * Math to calculate hpet to usec multiplier | |
5444 | + * Look for the comments at get_offset_hpet() | |
5445 | + */ | |
5446 | + ASM_DIV64_REG(result, remain, hpet_tick, 0, KERNEL_TICK_USEC); | |
5447 | + if (remain > (hpet_tick >> 1)) | |
5448 | + result++; /* rounding the result */ | |
5449 | + hpet_usec_quotient = result; | |
5450 | + | |
5451 | + return 0; | |
5452 | +} | |
5453 | + | |
5454 | +/************************************************************/ | |
5455 | + | |
5456 | +/* tsc timer_opts struct */ | |
5457 | +struct timer_opts timer_hpet = { | |
5458 | + .init = init_hpet, | |
5459 | + .mark_offset = mark_offset_hpet, | |
5460 | + .get_offset = get_offset_hpet, | |
5461 | + .monotonic_clock = monotonic_clock_hpet, | |
5462 | + .delay = delay_hpet, | |
5463 | +}; | |
5464 | diff -Nru a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c | |
5465 | --- a/arch/i386/kernel/timers/timer_tsc.c Mon Aug 18 06:40:02 2003 | |
5466 | +++ b/arch/i386/kernel/timers/timer_tsc.c Sun Aug 31 16:15:21 2003 | |
5467 | @@ -19,9 +19,18 @@ | |
5468 | #include "io_ports.h" | |
5469 | #include "mach_timer.h" | |
5470 | ||
5471 | +#include <asm/hpet.h> | |
5472 | + | |
5473 | +#ifdef CONFIG_HPET_TIMER | |
5474 | +static unsigned long hpet_usec_quotient; | |
5475 | +static unsigned long hpet_last; | |
5476 | +struct timer_opts timer_tsc; | |
5477 | +#endif | |
5478 | + | |
5479 | int tsc_disable __initdata = 0; | |
5480 | ||
5481 | extern spinlock_t i8253_lock; | |
5482 | +extern volatile unsigned long jiffies; | |
5483 | ||
5484 | static int use_tsc; | |
5485 | /* Number of usecs that the last interrupt was delayed */ | |
5486 | @@ -232,7 +241,7 @@ | |
5487 | ||
5488 | #define CALIBRATE_TIME (5 * 1000020/HZ) | |
5489 | ||
5490 | -unsigned long __init calibrate_tsc(void) | |
5491 | +static unsigned long __init calibrate_tsc(void) | |
5492 | { | |
5493 | mach_prepare_counter(); | |
5494 | ||
5495 | @@ -282,6 +291,107 @@ | |
5496 | return 0; | |
5497 | } | |
5498 | ||
5499 | +#ifdef CONFIG_HPET_TIMER | |
5500 | +static void mark_offset_tsc_hpet(void) | |
5501 | +{ | |
5502 | + unsigned long long this_offset, last_offset; | |
5503 | + unsigned long offset, temp, hpet_current; | |
5504 | + | |
5505 | + write_lock(&monotonic_lock); | |
5506 | + last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; | |
5507 | + /* | |
5508 | + * It is important that these two operations happen almost at | |
5509 | + * the same time. We do the RDTSC stuff first, since it's | |
5510 | + * faster. To avoid any inconsistencies, we need interrupts | |
5511 | + * disabled locally. | |
5512 | + */ | |
5513 | + /* | |
5514 | + * Interrupts are just disabled locally since the timer irq | |
5515 | + * has the SA_INTERRUPT flag set. -arca | |
5516 | + */ | |
5517 | + /* read Pentium cycle counter */ | |
5518 | + | |
5519 | + hpet_current = hpet_readl(HPET_COUNTER); | |
5520 | + rdtsc(last_tsc_low, last_tsc_high); | |
5521 | + | |
5522 | + /* lost tick compensation */ | |
5523 | + offset = hpet_readl(HPET_T0_CMP) - hpet_tick; | |
5524 | + if (unlikely(((offset - hpet_last) > hpet_tick) && (hpet_last != 0))) { | |
5525 | + int lost_ticks = (offset - hpet_last) / hpet_tick; | |
5526 | + jiffies += lost_ticks; | |
5527 | + } | |
5528 | + hpet_last = hpet_current; | |
5529 | + | |
5530 | + /* update the monotonic base value */ | |
5531 | + this_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; | |
5532 | + monotonic_base += cycles_2_ns(this_offset - last_offset); | |
5533 | + write_unlock(&monotonic_lock); | |
5534 | + | |
5535 | + /* calculate delay_at_last_interrupt */ | |
5536 | + /* | |
5537 | + * Time offset = (hpet delta) * ( usecs per HPET clock ) | |
5538 | + * = (hpet delta) * ( usecs per tick / HPET clocks per tick) | |
5539 | + * = (hpet delta) * ( hpet_usec_quotient ) / (2^32) | |
5540 | + * Where, | |
5541 | + * hpet_usec_quotient = (2^32 * usecs per tick)/HPET clocks per tick | |
5542 | + */ | |
5543 | + delay_at_last_interrupt = hpet_current - offset; | |
5544 | + ASM_MUL64_REG(temp, delay_at_last_interrupt, | |
5545 | + hpet_usec_quotient, delay_at_last_interrupt); | |
5546 | +} | |
5547 | + | |
5548 | +/* ------ Calibrate the TSC based on HPET timer ------- | |
5549 | + * Return 2^32 * (1 / (TSC clocks per usec)) for do_fast_gettimeoffset(). | |
5550 | + * calibrate_tsc() calibrates the processor TSC by comparing | |
5551 | + * it to the HPET timer of known frequency. | |
5552 | + * Too much 64-bit arithmetic here to do this cleanly in C | |
5553 | + */ | |
5554 | + | |
5555 | +#define CALIBRATE_CNT_HPET (5 * hpet_tick) | |
5556 | +#define CALIBRATE_TIME_HPET (5 * KERNEL_TICK_USEC) | |
5557 | + | |
5558 | +unsigned long __init calibrate_tsc_hpet(void) | |
5559 | +{ | |
5560 | + unsigned long tsc_startlow, tsc_starthigh; | |
5561 | + unsigned long tsc_endlow, tsc_endhigh; | |
5562 | + unsigned long hpet_start, hpet_end; | |
5563 | + unsigned long result, remain; | |
5564 | + | |
5565 | + hpet_start = hpet_readl(HPET_COUNTER); | |
5566 | + rdtsc(tsc_startlow, tsc_starthigh); | |
5567 | + do { | |
5568 | + hpet_end = hpet_readl(HPET_COUNTER); | |
5569 | + } while ((hpet_end - hpet_start) < CALIBRATE_CNT_HPET); | |
5570 | + rdtsc(tsc_endlow, tsc_endhigh); | |
5571 | + | |
5572 | + /* 64-bit subtract - gcc just messes up with long longs */ | |
5573 | + __asm__("subl %2,%0\n\t" | |
5574 | + "sbbl %3,%1" | |
5575 | + :"=a" (tsc_endlow), "=d" (tsc_endhigh) | |
5576 | + :"g" (tsc_startlow), "g" (tsc_starthigh), | |
5577 | + "0" (tsc_endlow), "1" (tsc_endhigh)); | |
5578 | + | |
5579 | + /* Error: ECPUTOOFAST */ | |
5580 | + if (tsc_endhigh) | |
5581 | + goto bad_calibration; | |
5582 | + | |
5583 | + /* Error: ECPUTOOSLOW */ | |
5584 | + if (tsc_endlow <= CALIBRATE_TIME_HPET) | |
5585 | + goto bad_calibration; | |
5586 | + | |
5587 | + ASM_DIV64_REG(result, remain, tsc_endlow, 0, CALIBRATE_TIME_HPET); | |
5588 | + if (remain > (tsc_endlow >> 1)) | |
5589 | + result++; /* rounding the result */ | |
5590 | + | |
5591 | + return result; | |
5592 | +bad_calibration: | |
5593 | + /* | |
5594 | + * the CPU was so fast/slow that the quotient wouldn't fit in | |
5595 | + * 32 bits.. | |
5596 | + */ | |
5597 | + return 0; | |
5598 | +} | |
5599 | +#endif | |
5600 | ||
5601 | #ifdef CONFIG_CPU_FREQ | |
5602 | static unsigned int ref_freq = 0; | |
5603 | @@ -333,8 +443,16 @@ | |
5604 | { | |
5605 | ||
5606 | /* check clock override */ | |
5607 | - if (override[0] && strncmp(override,"tsc",3)) | |
5608 | + if (override[0] && strncmp(override,"tsc",3)) { | |
5609 | +#ifdef CONFIG_HPET_TIMER | |
5610 | + if (is_hpet_enabled()) { | |
5611 | + printk(KERN_ERR "Warning: clock= override failed. Defaulting to tsc\n"); | |
5612 | + } else | |
5613 | +#endif | |
5614 | + { | |
5615 | return -ENODEV; | |
5616 | + } | |
5617 | + } | |
5618 | ||
5619 | /* | |
5620 | * If we have APM enabled or the CPU clock speed is variable | |
5621 | @@ -368,7 +486,29 @@ | |
5622 | count2 = LATCH; /* initialize counter for mark_offset_tsc() */ | |
5623 | ||
5624 | if (cpu_has_tsc) { | |
5625 | - unsigned long tsc_quotient = calibrate_tsc(); | |
5626 | + unsigned long tsc_quotient; | |
5627 | +#ifdef CONFIG_HPET_TIMER | |
5628 | + if (is_hpet_enabled()){ | |
5629 | + unsigned long result, remain; | |
5630 | + printk("Using TSC for gettimeofday\n"); | |
5631 | + tsc_quotient = calibrate_tsc_hpet(); | |
5632 | + timer_tsc.mark_offset = &mark_offset_tsc_hpet; | |
5633 | + /* | |
5634 | + * Math to calculate hpet to usec multiplier | |
5635 | + * Look for the comments at get_offset_tsc_hpet() | |
5636 | + */ | |
5637 | + ASM_DIV64_REG(result, remain, hpet_tick, | |
5638 | + 0, KERNEL_TICK_USEC); | |
5639 | + if (remain > (hpet_tick >> 1)) | |
5640 | + result++; /* rounding the result */ | |
5641 | + | |
5642 | + hpet_usec_quotient = result; | |
5643 | + } else | |
5644 | +#endif | |
5645 | + { | |
5646 | + tsc_quotient = calibrate_tsc(); | |
5647 | + } | |
5648 | + | |
5649 | if (tsc_quotient) { | |
5650 | fast_gettimeoffset_quotient = tsc_quotient; | |
5651 | use_tsc = 1; | |
5652 | diff -Nru a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c | |
5653 | --- a/arch/i386/kernel/traps.c Thu Jun 26 12:11:29 2003 | |
5654 | +++ b/arch/i386/kernel/traps.c Tue Sep 2 00:37:21 2003 | |
5655 | @@ -745,7 +745,8 @@ | |
5656 | * Careful.. There are problems with IBM-designed IRQ13 behaviour. | |
5657 | * Don't touch unless you *really* know how it works. | |
5658 | * | |
5659 | - * Must be called with kernel preemption disabled. | |
5660 | + * Must be called with kernel preemption disabled (in this case, | |
5661 | + * local interrupts are disabled at the call-site in entry.S). | |
5662 | */ | |
5663 | asmlinkage void math_state_restore(struct pt_regs regs) | |
5664 | { | |
5665 | diff -Nru a/arch/i386/mach-visws/mpparse.c b/arch/i386/mach-visws/mpparse.c | |
5666 | --- a/arch/i386/mach-visws/mpparse.c Mon Aug 18 19:46:23 2003 | |
5667 | +++ b/arch/i386/mach-visws/mpparse.c Sun Aug 31 16:14:17 2003 | |
5668 | @@ -38,7 +38,7 @@ | |
5669 | void __init MP_processor_info (struct mpc_config_processor *m) | |
5670 | { | |
5671 | int ver, logical_apicid; | |
5672 | - cpumask_t apic_cpus; | |
5673 | + physid_mask_t apic_cpus; | |
5674 | ||
5675 | if (!(m->mpc_cpuflag & CPU_ENABLED)) | |
5676 | return; | |
5677 | diff -Nru a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c | |
5678 | --- a/arch/i386/mach-voyager/voyager_smp.c Mon Aug 18 19:46:23 2003 | |
5679 | +++ b/arch/i386/mach-voyager/voyager_smp.c Sun Aug 31 16:14:42 2003 | |
5680 | @@ -130,7 +130,7 @@ | |
5681 | { | |
5682 | int cpu; | |
5683 | ||
5684 | - for_each_cpu(cpu, mk_cpumask_const(cpu_online_map)) { | |
5685 | + for_each_cpu(cpu, cpu_online_map) { | |
5686 | if(cpuset & (1<<cpu)) { | |
5687 | #ifdef VOYAGER_DEBUG | |
5688 | if(!cpu_isset(cpu, cpu_online_map)) | |
5689 | @@ -874,10 +874,10 @@ | |
5690 | asmlinkage void | |
5691 | smp_invalidate_interrupt(void) | |
5692 | { | |
5693 | - __u8 cpu = get_cpu(); | |
5694 | + __u8 cpu = smp_processor_id(); | |
5695 | ||
5696 | - if (!(smp_invalidate_needed & (1UL << cpu))) | |
5697 | - goto out; | |
5698 | + if (!test_bit(cpu, &smp_invalidate_needed)) | |
5699 | + return; | |
5700 | /* This will flood messages. Don't uncomment unless you see | |
5701 | * Problems with cross cpu invalidation | |
5702 | VDEBUG(("VOYAGER SMP: CPU%d received INVALIDATE_CPI\n", | |
5703 | @@ -893,9 +893,9 @@ | |
5704 | } else | |
5705 | leave_mm(cpu); | |
5706 | } | |
5707 | - smp_invalidate_needed |= 1UL << cpu; | |
5708 | - out: | |
5709 | - put_cpu_no_resched(); | |
5710 | + smp_mb__before_clear_bit(); | |
5711 | + clear_bit(cpu, &smp_invalidate_needed); | |
5712 | + smp_mb__after_clear_bit(); | |
5713 | } | |
5714 | ||
5715 | /* All the new flush operations for 2.4 */ | |
5716 | @@ -929,6 +929,7 @@ | |
5717 | send_CPI(cpumask, VIC_INVALIDATE_CPI); | |
5718 | ||
5719 | while (smp_invalidate_needed) { | |
5720 | + mb(); | |
5721 | if(--stuck == 0) { | |
5722 | printk("***WARNING*** Stuck doing invalidate CPI (CPU%d)\n", smp_processor_id()); | |
5723 | break; | |
5724 | @@ -1464,7 +1465,7 @@ | |
5725 | cpuset &= 0xff; /* only first 8 CPUs vaild for VIC CPI */ | |
5726 | if(cpuset == 0) | |
5727 | return; | |
5728 | - for_each_cpu(cpu, mk_cpumask_const(cpu_online_map)) { | |
5729 | + for_each_cpu(cpu, cpu_online_map) { | |
5730 | if(cpuset & (1<<cpu)) | |
5731 | set_bit(cpi, &vic_cpi_mailbox[cpu]); | |
5732 | } | |
5733 | @@ -1578,7 +1579,7 @@ | |
5734 | VDEBUG(("VOYAGER: enable_vic_irq(%d) CPU%d affinity 0x%lx\n", | |
5735 | irq, cpu, cpu_irq_affinity[cpu])); | |
5736 | spin_lock_irqsave(&vic_irq_lock, flags); | |
5737 | - for_each_cpu(real_cpu, mk_cpumask_const(cpu_online_map)) { | |
5738 | + for_each_cpu(real_cpu, cpu_online_map) { | |
5739 | if(!(voyager_extended_vic_processors & (1<<real_cpu))) | |
5740 | continue; | |
5741 | if(!(cpu_irq_affinity[real_cpu] & mask)) { | |
5742 | @@ -1723,7 +1724,7 @@ | |
5743 | ||
5744 | printk("VOYAGER SMP: CPU%d lost interrupt %d\n", | |
5745 | cpu, irq); | |
5746 | - for_each_cpu(real_cpu, mk_cpumask_const(mask)) { | |
5747 | + for_each_cpu(real_cpu, mask) { | |
5748 | ||
5749 | outb(VIC_CPU_MASQUERADE_ENABLE | real_cpu, | |
5750 | VIC_PROCESSOR_ID); | |
5751 | @@ -1808,7 +1809,7 @@ | |
5752 | * bus) */ | |
5753 | return; | |
5754 | ||
5755 | - for_each_cpu(cpu, mk_cpumask_const(cpu_online_map)) { | |
5756 | + for_each_cpu(cpu, cpu_online_map) { | |
5757 | unsigned long cpu_mask = 1 << cpu; | |
5758 | ||
5759 | if(cpu_mask & real_mask) { | |
5760 | @@ -1874,7 +1875,7 @@ | |
5761 | int old_cpu = smp_processor_id(), cpu; | |
5762 | ||
5763 | /* dump the interrupt masks of each processor */ | |
5764 | - for_each_cpu(cpu, mk_cpumask_const(cpu_online_map)) { | |
5765 | + for_each_cpu(cpu, cpu_online_map) { | |
5766 | __u16 imr, isr, irr; | |
5767 | unsigned long flags; | |
5768 | ||
5769 | diff -Nru a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c | |
5770 | --- a/arch/i386/oprofile/nmi_int.c Thu Jul 17 17:21:06 2003 | |
5771 | +++ b/arch/i386/oprofile/nmi_int.c Fri Aug 29 09:02:20 2003 | |
5772 | @@ -364,10 +364,21 @@ | |
5773 | switch (vendor) { | |
5774 | case X86_VENDOR_AMD: | |
5775 | /* Needs to be at least an Athlon (or hammer in 32bit mode) */ | |
5776 | - if (family < 6) | |
5777 | + | |
5778 | + switch (family) { | |
5779 | + default: | |
5780 | return -ENODEV; | |
5781 | - model = &op_athlon_spec; | |
5782 | - nmi_ops.cpu_type = "i386/athlon"; | |
5783 | + case 6: | |
5784 | + model = &op_athlon_spec; | |
5785 | + nmi_ops.cpu_type = "i386/athlon"; | |
5786 | + break; | |
5787 | +#if defined(CONFIG_X86_64) | |
5788 | + case 0xf: | |
5789 | + model = &op_athlon_spec; | |
5790 | + nmi_ops.cpu_type = "x86-64/hammer"; | |
5791 | + break; | |
5792 | +#endif /* CONFIG_X86_64 */ | |
5793 | + } | |
5794 | break; | |
5795 | ||
5796 | #if !defined(CONFIG_X86_64) | |
5797 | diff -Nru a/arch/i386/pci/common.c b/arch/i386/pci/common.c | |
5798 | --- a/arch/i386/pci/common.c Mon Jun 23 12:31:05 2003 | |
5799 | +++ b/arch/i386/pci/common.c Mon Sep 1 17:58:12 2003 | |
5800 | @@ -152,7 +152,7 @@ | |
5801 | pci_cache_line_size = 32 >> 2; | |
5802 | if (c->x86 >= 6 && c->x86_vendor == X86_VENDOR_AMD) | |
5803 | pci_cache_line_size = 64 >> 2; /* K7 & K8 */ | |
5804 | - else if (c->x86 > 6) | |
5805 | + else if (c->x86 > 6 && c->x86_vendor == X86_VENDOR_INTEL) | |
5806 | pci_cache_line_size = 128 >> 2; /* P4 */ | |
5807 | ||
5808 | pcibios_resource_survey(); | |
5809 | diff -Nru a/arch/ia64/Kconfig b/arch/ia64/Kconfig | |
5810 | --- a/arch/ia64/Kconfig Fri Aug 8 10:02:34 2003 | |
5811 | +++ b/arch/ia64/Kconfig Sun Aug 31 16:14:22 2003 | |
5812 | @@ -234,8 +234,8 @@ | |
5813 | endchoice | |
5814 | ||
5815 | config DISCONTIGMEM | |
5816 | - bool "Discontiguous memory support" if (IA64_DIG && NUMA) | |
5817 | - default y if IA64_SGI_SN2 || IA64_GENERIC | |
5818 | + bool "Discontiguous memory support" if (IA64_DIG || IA64_SGI_SN2 || IA64_GENERIC) && NUMA | |
5819 | + default y if (IA64_SGI_SN2 || IA64_GENERIC) && NUMA | |
5820 | help | |
5821 | Say Y to support efficient handling of discontiguous physical memory, | |
5822 | for architectures which are either NUMA (Non-Uniform Memory Access) | |
5823 | @@ -296,29 +296,6 @@ | |
5824 | help | |
5825 | If you are compiling a kernel that will run under SGI's IA-64 | |
5826 | simulator (Medusa) then say Y, otherwise say N. | |
5827 | - | |
5828 | -# On IA-64, we always want an ELF /proc/kcore. | |
5829 | -config KCORE_ELF | |
5830 | - bool | |
5831 | - default y | |
5832 | - ---help--- | |
5833 | - If you enabled support for /proc file system then the file | |
5834 | - /proc/kcore will contain the kernel core image. This can be used | |
5835 | - in gdb: | |
5836 | - | |
5837 | - $ cd /usr/src/linux ; gdb vmlinux /proc/kcore | |
5838 | - | |
5839 | - You have two choices here: ELF and A.OUT. Selecting ELF will make | |
5840 | - /proc/kcore appear in ELF core format as defined by the Executable | |
5841 | - and Linking Format specification. Selecting A.OUT will choose the | |
5842 | - old "a.out" format which may be necessary for some old versions | |
5843 | - of binutils or on some architectures. | |
5844 | - | |
5845 | - This is especially useful if you have compiled the kernel with the | |
5846 | - "-g" option to preserve debugging information. It is mainly used | |
5847 | - for examining kernel data structures on the live kernel so if you | |
5848 | - don't understand what this means or are not a kernel hacker, just | |
5849 | - leave it at its default value ELF. | |
5850 | ||
5851 | config FORCE_MAX_ZONEORDER | |
5852 | int | |
5853 | diff -Nru a/arch/ia64/Makefile b/arch/ia64/Makefile | |
5854 | --- a/arch/ia64/Makefile Tue Aug 19 23:13:39 2003 | |
5855 | +++ b/arch/ia64/Makefile Sat Aug 23 10:28:23 2003 | |
5856 | @@ -70,6 +70,8 @@ | |
5857 | ||
5858 | .PHONY: boot compressed check | |
5859 | ||
5860 | +all: compressed | |
5861 | + | |
5862 | compressed: vmlinux.gz | |
5863 | ||
5864 | vmlinux.gz: vmlinux | |
5865 | @@ -100,6 +102,6 @@ | |
5866 | ||
5867 | ||
5868 | define archhelp | |
5869 | - echo ' compressed - Build compressed kernel image' | |
5870 | + echo '* compressed - Build compressed kernel image' | |
5871 | echo ' boot - Build vmlinux and bootloader for Ski simulator' | |
5872 | endef | |
5873 | diff -Nru a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c | |
5874 | --- a/arch/ia64/hp/common/sba_iommu.c Sun Jul 27 12:01:33 2003 | |
5875 | +++ b/arch/ia64/hp/common/sba_iommu.c Sun Aug 31 16:14:08 2003 | |
5876 | @@ -1935,10 +1935,10 @@ | |
5877 | } | |
5878 | ||
5879 | static struct acpi_driver acpi_sba_ioc_driver = { | |
5880 | - name: "IOC IOMMU Driver", | |
5881 | - ids: "HWP0001,HWP0004", | |
5882 | - ops: { | |
5883 | - add: acpi_sba_ioc_add, | |
5884 | + .name = "IOC IOMMU Driver", | |
5885 | + .ids = "HWP0001,HWP0004", | |
5886 | + .ops = { | |
5887 | + .add = acpi_sba_ioc_add, | |
5888 | }, | |
5889 | }; | |
5890 | ||
5891 | diff -Nru a/arch/ia64/ia32/ia32_ioctl.c b/arch/ia64/ia32/ia32_ioctl.c | |
5892 | --- a/arch/ia64/ia32/ia32_ioctl.c Thu Aug 7 17:00:00 2003 | |
5893 | +++ b/arch/ia64/ia32/ia32_ioctl.c Sun Aug 31 16:14:44 2003 | |
5894 | @@ -70,7 +70,7 @@ | |
5895 | #define IOCTL_TABLE_START \ | |
5896 | struct ioctl_trans ioctl_start[] = { | |
5897 | #define IOCTL_TABLE_END \ | |
5898 | - }; struct ioctl_trans ioctl_end[0]; | |
5899 | + }; | |
5900 | ||
5901 | IOCTL_TABLE_START | |
5902 | HANDLE_IOCTL(VFAT_IOCTL_READDIR_BOTH32, vfat_ioctl32) | |
5903 | @@ -79,3 +79,5 @@ | |
5904 | #include "compat_ioctl.c" | |
5905 | #include <linux/compat_ioctl.h> | |
5906 | IOCTL_TABLE_END | |
5907 | + | |
5908 | +int ioctl_table_size = ARRAY_SIZE(ioctl_start); | |
5909 | diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c | |
5910 | --- a/arch/ia64/ia32/sys_ia32.c Tue Aug 19 23:13:39 2003 | |
5911 | +++ b/arch/ia64/ia32/sys_ia32.c Mon Aug 25 14:45:43 2003 | |
5912 | @@ -76,7 +76,6 @@ | |
5913 | ||
5914 | #define OFFSET4K(a) ((a) & 0xfff) | |
5915 | #define PAGE_START(addr) ((addr) & PAGE_MASK) | |
5916 | -#define PAGE_OFF(addr) ((addr) & ~PAGE_MASK) | |
5917 | ||
5918 | #define high2lowuid(uid) ((uid) > 65535 ? 65534 : (uid)) | |
5919 | #define high2lowgid(gid) ((gid) > 65535 ? 65534 : (gid)) | |
5920 | @@ -170,9 +169,9 @@ | |
5921 | current->thread.map_base = old_map_base; | |
5922 | current->thread.task_size = old_task_size; | |
5923 | set_fs(USER_DS); /* establish new task-size as the address-limit */ | |
5924 | - out: | |
5925 | - kfree(av); | |
5926 | } | |
5927 | + out: | |
5928 | + kfree(av); | |
5929 | return r; | |
5930 | } | |
5931 | ||
5932 | @@ -271,11 +270,11 @@ | |
5933 | ||
5934 | if (old_prot) { | |
5935 | /* copy back the old page contents. */ | |
5936 | - if (PAGE_OFF(start)) | |
5937 | - copy_to_user((void *) PAGE_START(start), page, PAGE_OFF(start)); | |
5938 | - if (PAGE_OFF(end)) | |
5939 | - copy_to_user((void *) end, page + PAGE_OFF(end), | |
5940 | - PAGE_SIZE - PAGE_OFF(end)); | |
5941 | + if (offset_in_page(start)) | |
5942 | + copy_to_user((void *) PAGE_START(start), page, offset_in_page(start)); | |
5943 | + if (offset_in_page(end)) | |
5944 | + copy_to_user((void *) end, page + offset_in_page(end), | |
5945 | + PAGE_SIZE - offset_in_page(end)); | |
5946 | } | |
5947 | ||
5948 | if (!(flags & MAP_ANONYMOUS)) { | |
5949 | @@ -330,7 +329,7 @@ | |
5950 | "%s(%d): emulate_mmap() can't share tail (end=0x%lx)\n", | |
5951 | current->comm, current->pid, end); | |
5952 | ret = mmap_subpage(file, max(start, PAGE_START(end)), end, prot, flags, | |
5953 | - (off + len) - PAGE_OFF(end)); | |
5954 | + (off + len) - offset_in_page(end)); | |
5955 | if (IS_ERR((void *) ret)) | |
5956 | return ret; | |
5957 | pend -= PAGE_SIZE; | |
5958 | @@ -347,14 +346,14 @@ | |
5959 | tmp = arch_get_unmapped_area(file, pstart - fudge, pend - pstart, 0, flags); | |
5960 | if (tmp != pstart) { | |
5961 | pstart = tmp; | |
5962 | - start = pstart + PAGE_OFF(off); /* make start congruent with off */ | |
5963 | + start = pstart + offset_in_page(off); /* make start congruent with off */ | |
5964 | end = start + len; | |
5965 | pend = PAGE_ALIGN(end); | |
5966 | } | |
5967 | } | |
5968 | ||
5969 | poff = off + (pstart - start); /* note: (pstart - start) may be negative */ | |
5970 | - is_congruent = (flags & MAP_ANONYMOUS) || (PAGE_OFF(poff) == 0); | |
5971 | + is_congruent = (flags & MAP_ANONYMOUS) || (offset_in_page(poff) == 0); | |
5972 | ||
5973 | if ((flags & MAP_SHARED) && !is_congruent) | |
5974 | printk(KERN_INFO "%s(%d): emulate_mmap() can't share contents of incongruent mmap " | |
5975 | @@ -588,7 +587,7 @@ | |
5976 | ||
5977 | down(&ia32_mmap_sem); | |
5978 | { | |
5979 | - if (PAGE_OFF(start)) { | |
5980 | + if (offset_in_page(start)) { | |
5981 | /* start address is 4KB aligned but not page aligned. */ | |
5982 | retval = mprotect_subpage(PAGE_START(start), prot); | |
5983 | if (retval < 0) | |
5984 | @@ -599,7 +598,7 @@ | |
5985 | goto out; /* retval is already zero... */ | |
5986 | } | |
5987 | ||
5988 | - if (PAGE_OFF(end)) { | |
5989 | + if (offset_in_page(end)) { | |
5990 | /* end address is 4KB aligned but not page aligned. */ | |
5991 | retval = mprotect_subpage(PAGE_START(end), prot); | |
5992 | if (retval < 0) | |
5993 | diff -Nru a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c | |
5994 | --- a/arch/ia64/kernel/acpi.c Wed Aug 6 12:37:03 2003 | |
5995 | +++ b/arch/ia64/kernel/acpi.c Tue Aug 26 15:09:18 2003 | |
5996 | @@ -130,7 +130,7 @@ | |
5997 | int vector = -1; | |
5998 | ||
5999 | if (int_type < ACPI_MAX_PLATFORM_INTERRUPTS) { | |
6000 | - /* correctable platform error interrupt */ | |
6001 | + /* corrected platform error interrupt */ | |
6002 | vector = platform_intr_list[int_type]; | |
6003 | } else | |
6004 | printk(KERN_ERR "acpi_request_vector(): invalid interrupt type\n"); | |
6005 | diff -Nru a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S | |
6006 | --- a/arch/ia64/kernel/entry.S Sat Aug 16 17:16:48 2003 | |
6007 | +++ b/arch/ia64/kernel/entry.S Mon Aug 25 14:47:33 2003 | |
6008 | @@ -1473,7 +1473,7 @@ | |
6009 | data8 sys_clock_nanosleep | |
6010 | data8 sys_fstatfs64 | |
6011 | data8 sys_statfs64 | |
6012 | - data8 ia64_ni_syscall | |
6013 | + data8 sys_fadvise64_64 | |
6014 | data8 ia64_ni_syscall // 1260 | |
6015 | data8 ia64_ni_syscall | |
6016 | data8 ia64_ni_syscall | |
6017 | diff -Nru a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S | |
6018 | --- a/arch/ia64/kernel/fsys.S Thu Jul 10 18:16:32 2003 | |
6019 | +++ b/arch/ia64/kernel/fsys.S Mon Aug 25 14:47:33 2003 | |
6020 | @@ -678,9 +678,9 @@ | |
6021 | data8 0 // clock_gettime | |
6022 | data8 0 // clock_getres // 1255 | |
6023 | data8 0 // clock_nanosleep | |
6024 | - data8 0 | |
6025 | - data8 0 | |
6026 | - data8 0 | |
6027 | + data8 0 // fstatfs64 | |
6028 | + data8 0 // statfs64 | |
6029 | + data8 0 // fadvise64_64 | |
6030 | data8 0 // 1260 | |
6031 | data8 0 | |
6032 | data8 0 | |
6033 | diff -Nru a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c | |
6034 | --- a/arch/ia64/kernel/mca.c Tue Aug 19 23:13:39 2003 | |
6035 | +++ b/arch/ia64/kernel/mca.c Tue Aug 26 13:42:37 2003 | |
6036 | @@ -1145,7 +1145,7 @@ | |
6037 | ||
6038 | ia64_mca_cmc_int_handler(cpe_irq, arg, ptregs); | |
6039 | ||
6040 | - for (++cpuid ; !cpu_online(cpuid) && cpuid < NR_CPUS ; cpuid++); | |
6041 | + for (++cpuid ; cpuid < NR_CPUS && !cpu_online(cpuid) ; cpuid++); | |
6042 | ||
6043 | if (cpuid < NR_CPUS) { | |
6044 | platform_send_ipi(cpuid, IA64_CMCP_VECTOR, IA64_IPI_DM_INT, 0); | |
6045 | @@ -1225,7 +1225,7 @@ | |
6046 | ||
6047 | ia64_mca_cpe_int_handler(cpe_irq, arg, ptregs); | |
6048 | ||
6049 | - for (++cpuid ; !cpu_online(cpuid) && cpuid < NR_CPUS ; cpuid++); | |
6050 | + for (++cpuid ; cpuid < NR_CPUS && !cpu_online(cpuid) ; cpuid++); | |
6051 | ||
6052 | if (cpuid < NR_CPUS) { | |
6053 | platform_send_ipi(cpuid, IA64_CPEP_VECTOR, IA64_IPI_DM_INT, 0); | |
6054 | diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c | |
6055 | --- a/arch/ia64/kernel/perfmon.c Thu Aug 21 15:45:04 2003 | |
6056 | +++ b/arch/ia64/kernel/perfmon.c Sun Aug 31 16:14:08 2003 | |
6057 | @@ -2109,7 +2109,7 @@ | |
6058 | return 1; | |
6059 | } | |
6060 | static struct dentry_operations pfmfs_dentry_operations = { | |
6061 | - d_delete: pfmfs_delete_dentry, | |
6062 | + .d_delete = pfmfs_delete_dentry, | |
6063 | }; | |
6064 | ||
6065 | ||
6066 | diff -Nru a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c | |
6067 | --- a/arch/ia64/kernel/smpboot.c Mon Aug 18 19:46:23 2003 | |
6068 | +++ b/arch/ia64/kernel/smpboot.c Fri Aug 22 15:20:52 2003 | |
6069 | @@ -560,7 +560,7 @@ | |
6070 | if (cpu_online(cpu)) | |
6071 | bogosum += cpu_data(cpu)->loops_per_jiffy; | |
6072 | ||
6073 | - printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n", | |
6074 | + printk(KERN_INFO "Total of %lu processors activated (%lu.%02lu BogoMIPS).\n", | |
6075 | num_online_cpus(), bogosum/(500000/HZ), (bogosum/(5000/HZ))%100); | |
6076 | } | |
6077 | ||
6078 | diff -Nru a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c | |
6079 | --- a/arch/ia64/kernel/sys_ia64.c Wed Jul 9 09:56:58 2003 | |
6080 | +++ b/arch/ia64/kernel/sys_ia64.c Mon Aug 25 14:45:43 2003 | |
6081 | @@ -242,7 +242,7 @@ | |
6082 | asmlinkage unsigned long | |
6083 | sys_mmap (unsigned long addr, unsigned long len, int prot, int flags, int fd, long off) | |
6084 | { | |
6085 | - if ((off & ~PAGE_MASK) != 0) | |
6086 | + if (offset_in_page(off) != 0) | |
6087 | return -EINVAL; | |
6088 | ||
6089 | addr = do_mmap2(addr, len, prot, flags, fd, off >> PAGE_SHIFT); | |
6090 | diff -Nru a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile | |
6091 | --- a/arch/ia64/lib/Makefile Fri Jun 20 12:48:24 2003 | |
6092 | +++ b/arch/ia64/lib/Makefile Mon Aug 25 09:56:27 2003 | |
6093 | @@ -14,9 +14,6 @@ | |
6094 | lib-$(CONFIG_PERFMON) += carta_random.o | |
6095 | lib-$(CONFIG_MD_RAID5) += xor.o | |
6096 | ||
6097 | -IGNORE_FLAGS_OBJS = __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \ | |
6098 | - __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o | |
6099 | - | |
6100 | AFLAGS___divdi3.o = | |
6101 | AFLAGS___udivdi3.o = -DUNSIGNED | |
6102 | AFLAGS___moddi3.o = -DMODULO | |
6103 | @@ -27,26 +24,26 @@ | |
6104 | AFLAGS___modsi3.o = -DMODULO | |
6105 | AFLAGS___umodsi3.o = -DUNSIGNED -DMODULO | |
6106 | ||
6107 | -$(obj)/__divdi3.o: $(src)/idiv64.S | |
6108 | - $(cmd_as_o_S) | |
6109 | +$(obj)/__divdi3.o: $(src)/idiv64.S FORCE | |
6110 | + $(call if_changed_dep,as_o_S) | |
6111 | ||
6112 | -$(obj)/__udivdi3.o: $(src)/idiv64.S | |
6113 | - $(cmd_as_o_S) | |
6114 | +$(obj)/__udivdi3.o: $(src)/idiv64.S FORCE | |
6115 | + $(call if_changed_dep,as_o_S) | |
6116 | ||
6117 | -$(obj)/__moddi3.o: $(src)/idiv64.S | |
6118 | - $(cmd_as_o_S) | |
6119 | +$(obj)/__moddi3.o: $(src)/idiv64.S FORCE | |
6120 | + $(call if_changed_dep,as_o_S) | |
6121 | ||
6122 | -$(obj)/__umoddi3.o: $(src)/idiv64.S | |
6123 | - $(cmd_as_o_S) | |
6124 | +$(obj)/__umoddi3.o: $(src)/idiv64.S FORCE | |
6125 | + $(call if_changed_dep,as_o_S) | |
6126 | ||
6127 | -$(obj)/__divsi3.o: $(src)/idiv32.S | |
6128 | - $(cmd_as_o_S) | |
6129 | +$(obj)/__divsi3.o: $(src)/idiv32.S FORCE | |
6130 | + $(call if_changed_dep,as_o_S) | |
6131 | ||
6132 | -$(obj)/__udivsi3.o: $(src)/idiv32.S | |
6133 | - $(cmd_as_o_S) | |
6134 | +$(obj)/__udivsi3.o: $(src)/idiv32.S FORCE | |
6135 | + $(call if_changed_dep,as_o_S) | |
6136 | ||
6137 | -$(obj)/__modsi3.o: $(src)/idiv32.S | |
6138 | - $(cmd_as_o_S) | |
6139 | +$(obj)/__modsi3.o: $(src)/idiv32.S FORCE | |
6140 | + $(call if_changed_dep,as_o_S) | |
6141 | ||
6142 | -$(obj)/__umodsi3.o: $(src)/idiv32.S | |
6143 | - $(cmd_as_o_S) | |
6144 | +$(obj)/__umodsi3.o: $(src)/idiv32.S FORCE | |
6145 | + $(call if_changed_dep,as_o_S) | |
6146 | diff -Nru a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c | |
6147 | --- a/arch/ia64/mm/numa.c Mon Sep 30 06:38:28 2002 | |
6148 | +++ b/arch/ia64/mm/numa.c Thu Aug 21 05:02:28 2003 | |
6149 | @@ -42,5 +42,5 @@ | |
6150 | paddr < node_memblk[i].start_paddr + node_memblk[i].size) | |
6151 | break; | |
6152 | ||
6153 | - return (i < num_memblks) ? node_memblk[i].nid : -1; | |
6154 | + return (i < num_memblks) ? node_memblk[i].nid : (num_memblks ? -1 : 0); | |
6155 | } | |
6156 | diff -Nru a/arch/ia64/sn/io/drivers/ioconfig_bus.c b/arch/ia64/sn/io/drivers/ioconfig_bus.c | |
6157 | --- a/arch/ia64/sn/io/drivers/ioconfig_bus.c Mon May 19 05:42:35 2003 | |
6158 | +++ b/arch/ia64/sn/io/drivers/ioconfig_bus.c Sun Aug 31 16:14:08 2003 | |
6159 | @@ -346,9 +346,9 @@ | |
6160 | } | |
6161 | ||
6162 | struct file_operations ioconfig_bus_fops = { | |
6163 | - ioctl:ioconfig_bus_ioctl, | |
6164 | - open:ioconfig_bus_open, /* open */ | |
6165 | - release:ioconfig_bus_close /* release */ | |
6166 | + .ioctl = ioconfig_bus_ioctl, | |
6167 | + .open = ioconfig_bus_open, /* open */ | |
6168 | + .release = ioconfig_bus_close /* release */ | |
6169 | }; | |
6170 | ||
6171 | ||
6172 | diff -Nru a/arch/ia64/sn/io/sn2/shub.c b/arch/ia64/sn/io/sn2/shub.c | |
6173 | --- a/arch/ia64/sn/io/sn2/shub.c Mon Aug 4 10:02:37 2003 | |
6174 | +++ b/arch/ia64/sn/io/sn2/shub.c Sun Aug 31 16:14:08 2003 | |
6175 | @@ -243,7 +243,7 @@ | |
6176 | } | |
6177 | ||
6178 | struct file_operations shub_mon_fops = { | |
6179 | - ioctl: shubstats_ioctl, | |
6180 | + .ioctl = shubstats_ioctl, | |
6181 | }; | |
6182 | ||
6183 | /* | |
6184 | diff -Nru a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c | |
6185 | --- a/arch/ia64/sn/kernel/setup.c Sat Aug 16 16:26:35 2003 | |
6186 | +++ b/arch/ia64/sn/kernel/setup.c Sun Aug 31 16:14:08 2003 | |
6187 | @@ -117,14 +117,14 @@ | |
6188 | * VGA color display. | |
6189 | */ | |
6190 | struct screen_info sn_screen_info = { | |
6191 | - orig_x: 0, | |
6192 | - orig_y: 0, | |
6193 | - orig_video_mode: 3, | |
6194 | - orig_video_cols: 80, | |
6195 | - orig_video_ega_bx: 3, | |
6196 | - orig_video_lines: 25, | |
6197 | - orig_video_isVGA: 1, | |
6198 | - orig_video_points: 16 | |
6199 | + .orig_x = 0, | |
6200 | + .orig_y = 0, | |
6201 | + .orig_video_mode = 3, | |
6202 | + .orig_video_cols = 80, | |
6203 | + .orig_video_ega_bx = 3, | |
6204 | + .orig_video_lines = 25, | |
6205 | + .orig_video_isVGA = 1, | |
6206 | + .orig_video_points = 16 | |
6207 | }; | |
6208 | ||
6209 | /* | |
6210 | diff -Nru a/arch/m68k/Kconfig b/arch/m68k/Kconfig | |
6211 | --- a/arch/m68k/Kconfig Sat Aug 2 14:26:16 2003 | |
6212 | +++ b/arch/m68k/Kconfig Sun Aug 31 16:14:22 2003 | |
6213 | @@ -342,40 +342,6 @@ | |
6214 | ||
6215 | menu "General setup" | |
6216 | ||
6217 | -choice | |
6218 | - prompt "Kernel core (/proc/kcore) format" | |
6219 | - depends on PROC_FS | |
6220 | - default KCORE_ELF | |
6221 | - | |
6222 | -config KCORE_ELF | |
6223 | - bool "ELF" | |
6224 | - ---help--- | |
6225 | - If you enabled support for /proc file system then the file | |
6226 | - /proc/kcore will contain the kernel core image. This can be used | |
6227 | - in gdb: | |
6228 | - | |
6229 | - $ cd /usr/src/linux ; gdb vmlinux /proc/kcore | |
6230 | - | |
6231 | - You have two choices here: ELF and A.OUT. Selecting ELF will make | |
6232 | - /proc/kcore appear in ELF core format as defined by the Executable | |
6233 | - and Linking Format specification. Selecting A.OUT will choose the | |
6234 | - old "a.out" format which may be necessary for some old versions | |
6235 | - of binutils or on some architectures. | |
6236 | - | |
6237 | - This is especially useful if you have compiled the kernel with the | |
6238 | - "-g" option to preserve debugging information. It is mainly used | |
6239 | - for examining kernel data structures on the live kernel so if you | |
6240 | - don't understand what this means or are not a kernel hacker, just | |
6241 | - leave it at its default value ELF. | |
6242 | - | |
6243 | -config KCORE_AOUT | |
6244 | - bool "A.OUT" | |
6245 | - help | |
6246 | - Not necessary unless you're using a very out-of-date binutils | |
6247 | - version. You probably want KCORE_ELF. | |
6248 | - | |
6249 | -endchoice | |
6250 | - | |
6251 | source "fs/Kconfig.binfmt" | |
6252 | ||
6253 | config ZORRO | |
6254 | diff -Nru a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds | |
6255 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
6256 | +++ b/arch/m68k/kernel/vmlinux-std.lds Sun Jun 15 03:46:43 2003 | |
6257 | @@ -0,0 +1,97 @@ | |
6258 | +/* ld script to make m68k Linux kernel */ | |
6259 | + | |
6260 | +#include <asm-generic/vmlinux.lds.h> | |
6261 | + | |
6262 | +OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") | |
6263 | +OUTPUT_ARCH(m68k) | |
6264 | +ENTRY(_start) | |
6265 | +jiffies = jiffies_64 + 4; | |
6266 | +SECTIONS | |
6267 | +{ | |
6268 | + . = 0x1000; | |
6269 | + _text = .; /* Text and read-only data */ | |
6270 | + .text : { | |
6271 | + *(.text) | |
6272 | + *(.fixup) | |
6273 | + *(.gnu.warning) | |
6274 | + } = 0x4e75 | |
6275 | + | |
6276 | + . = ALIGN(16); /* Exception table */ | |
6277 | + __start___ex_table = .; | |
6278 | + __ex_table : { *(__ex_table) } | |
6279 | + __stop___ex_table = .; | |
6280 | + | |
6281 | + RODATA | |
6282 | + | |
6283 | + _etext = .; /* End of text section */ | |
6284 | + | |
6285 | + .data : { /* Data */ | |
6286 | + *(.data) | |
6287 | + CONSTRUCTORS | |
6288 | + } | |
6289 | + | |
6290 | + .bss : { *(.bss) } /* BSS */ | |
6291 | + | |
6292 | + . = ALIGN(16); | |
6293 | + .data.cacheline_aligned : { *(.data.cacheline_aligned) } | |
6294 | + | |
6295 | + _edata = .; /* End of data section */ | |
6296 | + | |
6297 | + /* will be freed after init */ | |
6298 | + . = ALIGN(4096); /* Init code and data */ | |
6299 | + __init_begin = .; | |
6300 | + .init.text : { | |
6301 | + _sinittext = .; | |
6302 | + *(.init.text) | |
6303 | + _einittext = .; | |
6304 | + } | |
6305 | + .init.data : { *(.init.data) } | |
6306 | + . = ALIGN(16); | |
6307 | + __setup_start = .; | |
6308 | + .init.setup : { *(.init.setup) } | |
6309 | + __setup_end = .; | |
6310 | + __start___param = .; | |
6311 | + __param : { *(__param) } | |
6312 | + __stop___param = .; | |
6313 | + __initcall_start = .; | |
6314 | + .initcall.init : { | |
6315 | + *(.initcall1.init) | |
6316 | + *(.initcall2.init) | |
6317 | + *(.initcall3.init) | |
6318 | + *(.initcall4.init) | |
6319 | + *(.initcall5.init) | |
6320 | + *(.initcall6.init) | |
6321 | + *(.initcall7.init) | |
6322 | + } | |
6323 | + __initcall_end = .; | |
6324 | + __con_initcall_start = .; | |
6325 | + .con_initcall.init : { *(.con_initcall.init) } | |
6326 | + __con_initcall_end = .; | |
6327 | + SECURITY_INIT | |
6328 | + . = ALIGN(8192); | |
6329 | + __initramfs_start = .; | |
6330 | + .init.ramfs : { *(.init.ramfs) } | |
6331 | + __initramfs_end = .; | |
6332 | + . = ALIGN(8192); | |
6333 | + __init_end = .; | |
6334 | + | |
6335 | + .data.init_task : { *(.data.init_task) } /* The initial task and kernel stack */ | |
6336 | + | |
6337 | + _end = . ; | |
6338 | + | |
6339 | + /* Sections to be discarded */ | |
6340 | + /DISCARD/ : { | |
6341 | + *(.exit.text) | |
6342 | + *(.exit.data) | |
6343 | + *(.exitcall.exit) | |
6344 | + } | |
6345 | + | |
6346 | + /* Stabs debugging sections. */ | |
6347 | + .stab 0 : { *(.stab) } | |
6348 | + .stabstr 0 : { *(.stabstr) } | |
6349 | + .stab.excl 0 : { *(.stab.excl) } | |
6350 | + .stab.exclstr 0 : { *(.stab.exclstr) } | |
6351 | + .stab.index 0 : { *(.stab.index) } | |
6352 | + .stab.indexstr 0 : { *(.stab.indexstr) } | |
6353 | + .comment 0 : { *(.comment) } | |
6354 | +} | |
6355 | diff -Nru a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds | |
6356 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
6357 | +++ b/arch/m68k/kernel/vmlinux-sun3.lds Sun Jun 15 03:46:43 2003 | |
6358 | @@ -0,0 +1,97 @@ | |
6359 | +/* ld script to make m68k Linux kernel */ | |
6360 | + | |
6361 | +#include <asm-generic/vmlinux.lds.h> | |
6362 | + | |
6363 | +OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") | |
6364 | +OUTPUT_ARCH(m68k) | |
6365 | +ENTRY(_start) | |
6366 | +jiffies = jiffies_64 + 4; | |
6367 | +SECTIONS | |
6368 | +{ | |
6369 | + . = 0xE004000; | |
6370 | + _text = .; /* Text and read-only data */ | |
6371 | + .text : { | |
6372 | + *(.head) | |
6373 | + *(.text) | |
6374 | + *(.fixup) | |
6375 | + *(.gnu.warning) | |
6376 | + } = 0x4e75 | |
6377 | + RODATA | |
6378 | + | |
6379 | + _etext = .; /* End of text section */ | |
6380 | + | |
6381 | + .data : { /* Data */ | |
6382 | + *(.data) | |
6383 | + CONSTRUCTORS | |
6384 | + . = ALIGN(16); /* Exception table */ | |
6385 | + __start___ex_table = .; | |
6386 | + *(__ex_table) | |
6387 | + __stop___ex_table = .; | |
6388 | + } | |
6389 | + /* End of data goes *here* so that freeing init code works properly. */ | |
6390 | + _edata = .; | |
6391 | + | |
6392 | + /* will be freed after init */ | |
6393 | + . = ALIGN(8192); /* Init code and data */ | |
6394 | +__init_begin = .; | |
6395 | + .init.text : { | |
6396 | + _sinittext = .; | |
6397 | + *(.init.text) | |
6398 | + _einittext = .; | |
6399 | + } | |
6400 | + .init.data : { *(.init.data) } | |
6401 | + . = ALIGN(16); | |
6402 | + __setup_start = .; | |
6403 | + .init.setup : { *(.init.setup) } | |
6404 | + __setup_end = .; | |
6405 | + __start___param = .; | |
6406 | + __param : { *(__param) } | |
6407 | + __stop___param = .; | |
6408 | + __initcall_start = .; | |
6409 | + .initcall.init : { | |
6410 | + *(.initcall1.init) | |
6411 | + *(.initcall2.init) | |
6412 | + *(.initcall3.init) | |
6413 | + *(.initcall4.init) | |
6414 | + *(.initcall5.init) | |
6415 | + *(.initcall6.init) | |
6416 | + *(.initcall7.init) | |
6417 | + } | |
6418 | + __initcall_end = .; | |
6419 | + __con_initcall_start = .; | |
6420 | + .con_initcall.init : { *(.con_initcall.init) } | |
6421 | + __con_initcall_end = .; | |
6422 | + SECURITY_INIT | |
6423 | + . = ALIGN(8192); | |
6424 | + __initramfs_start = .; | |
6425 | + .init.ramfs : { *(.init.ramfs) } | |
6426 | + __initramfs_end = .; | |
6427 | + . = ALIGN(8192); | |
6428 | + __init_end = .; | |
6429 | + .init.task : { *(init_task) } | |
6430 | + | |
6431 | + | |
6432 | + .bss : { *(.bss) } /* BSS */ | |
6433 | + | |
6434 | + _end = . ; | |
6435 | + | |
6436 | + /* Sections to be discarded */ | |
6437 | + /DISCARD/ : { | |
6438 | + *(.exit.text) | |
6439 | + *(.exit.data) | |
6440 | + *(.exitcall.exit) | |
6441 | + } | |
6442 | + | |
6443 | + .crap : { | |
6444 | + /* Stabs debugging sections. */ | |
6445 | + *(.stab) | |
6446 | + *(.stabstr) | |
6447 | + *(.stab.excl) | |
6448 | + *(.stab.exclstr) | |
6449 | + *(.stab.index) | |
6450 | + *(.stab.indexstr) | |
6451 | + *(.comment) | |
6452 | + *(.note) | |
6453 | + } | |
6454 | + | |
6455 | +} | |
6456 | diff -Nru a/arch/m68k/vmlinux-std.lds b/arch/m68k/vmlinux-std.lds | |
6457 | --- a/arch/m68k/vmlinux-std.lds Wed Jun 11 17:40:05 2003 | |
6458 | +++ /dev/null Wed Dec 31 16:00:00 1969 | |
6459 | @@ -1,97 +0,0 @@ | |
6460 | -/* ld script to make m68k Linux kernel */ | |
6461 | - | |
6462 | -#include <asm-generic/vmlinux.lds.h> | |
6463 | - | |
6464 | -OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") | |
6465 | -OUTPUT_ARCH(m68k) | |
6466 | -ENTRY(_start) | |
6467 | -jiffies = jiffies_64 + 4; | |
6468 | -SECTIONS | |
6469 | -{ | |
6470 | - . = 0x1000; | |
6471 | - _text = .; /* Text and read-only data */ | |
6472 | - .text : { | |
6473 | - *(.text) | |
6474 | - *(.fixup) | |
6475 | - *(.gnu.warning) | |
6476 | - } = 0x4e75 | |
6477 | - | |
6478 | - . = ALIGN(16); /* Exception table */ | |
6479 | - __start___ex_table = .; | |
6480 | - __ex_table : { *(__ex_table) } | |
6481 | - __stop___ex_table = .; | |
6482 | - | |
6483 | - RODATA | |
6484 | - | |
6485 | - _etext = .; /* End of text section */ | |
6486 | - | |
6487 | - .data : { /* Data */ | |
6488 | - *(.data) | |
6489 | - CONSTRUCTORS | |
6490 | - } | |
6491 | - | |
6492 | - .bss : { *(.bss) } /* BSS */ | |
6493 | - | |
6494 | - . = ALIGN(16); | |
6495 | - .data.cacheline_aligned : { *(.data.cacheline_aligned) } | |
6496 | - | |
6497 | - _edata = .; /* End of data section */ | |
6498 | - | |
6499 | - /* will be freed after init */ | |
6500 | - . = ALIGN(4096); /* Init code and data */ | |
6501 | - __init_begin = .; | |
6502 | - .init.text : { | |
6503 | - _sinittext = .; | |
6504 | - *(.init.text) | |
6505 | - _einittext = .; | |
6506 | - } | |
6507 | - .init.data : { *(.init.data) } | |
6508 | - . = ALIGN(16); | |
6509 | - __setup_start = .; | |
6510 | - .init.setup : { *(.init.setup) } | |
6511 | - __setup_end = .; | |
6512 | - __start___param = .; | |
6513 | - __param : { *(__param) } | |
6514 | - __stop___param = .; | |
6515 | - __initcall_start = .; | |
6516 | - .initcall.init : { | |
6517 | - *(.initcall1.init) | |
6518 | - *(.initcall2.init) | |
6519 | - *(.initcall3.init) | |
6520 | - *(.initcall4.init) | |
6521 | - *(.initcall5.init) | |
6522 | - *(.initcall6.init) | |
6523 | - *(.initcall7.init) | |
6524 | - } | |
6525 | - __initcall_end = .; | |
6526 | - __con_initcall_start = .; | |
6527 | - .con_initcall.init : { *(.con_initcall.init) } | |
6528 | - __con_initcall_end = .; | |
6529 | - SECURITY_INIT | |
6530 | - . = ALIGN(8192); | |
6531 | - __initramfs_start = .; | |
6532 | - .init.ramfs : { *(.init.ramfs) } | |
6533 | - __initramfs_end = .; | |
6534 | - . = ALIGN(8192); | |
6535 | - __init_end = .; | |
6536 | - | |
6537 | - .data.init_task : { *(.data.init_task) } /* The initial task and kernel stack */ | |
6538 | - | |
6539 | - _end = . ; | |
6540 | - | |
6541 | - /* Sections to be discarded */ | |
6542 | - /DISCARD/ : { | |
6543 | - *(.exit.text) | |
6544 | - *(.exit.data) | |
6545 | - *(.exitcall.exit) | |
6546 | - } | |
6547 | - | |
6548 | - /* Stabs debugging sections. */ | |
6549 | - .stab 0 : { *(.stab) } | |
6550 | - .stabstr 0 : { *(.stabstr) } | |
6551 | - .stab.excl 0 : { *(.stab.excl) } | |
6552 | - .stab.exclstr 0 : { *(.stab.exclstr) } | |
6553 | - .stab.index 0 : { *(.stab.index) } | |
6554 | - .stab.indexstr 0 : { *(.stab.indexstr) } | |
6555 | - .comment 0 : { *(.comment) } | |
6556 | -} | |
6557 | diff -Nru a/arch/m68k/vmlinux-sun3.lds b/arch/m68k/vmlinux-sun3.lds | |
6558 | --- a/arch/m68k/vmlinux-sun3.lds Wed Jun 11 17:40:05 2003 | |
6559 | +++ /dev/null Wed Dec 31 16:00:00 1969 | |
6560 | @@ -1,97 +0,0 @@ | |
6561 | -/* ld script to make m68k Linux kernel */ | |
6562 | - | |
6563 | -#include <asm-generic/vmlinux.lds.h> | |
6564 | - | |
6565 | -OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") | |
6566 | -OUTPUT_ARCH(m68k) | |
6567 | -ENTRY(_start) | |
6568 | -jiffies = jiffies_64 + 4; | |
6569 | -SECTIONS | |
6570 | -{ | |
6571 | - . = 0xE004000; | |
6572 | - _text = .; /* Text and read-only data */ | |
6573 | - .text : { | |
6574 | - *(.head) | |
6575 | - *(.text) | |
6576 | - *(.fixup) | |
6577 | - *(.gnu.warning) | |
6578 | - } = 0x4e75 | |
6579 | - RODATA | |
6580 | - | |
6581 | - _etext = .; /* End of text section */ | |
6582 | - | |
6583 | - .data : { /* Data */ | |
6584 | - *(.data) | |
6585 | - CONSTRUCTORS | |
6586 | - . = ALIGN(16); /* Exception table */ | |
6587 | - __start___ex_table = .; | |
6588 | - *(__ex_table) | |
6589 | - __stop___ex_table = .; | |
6590 | - } | |
6591 | - /* End of data goes *here* so that freeing init code works properly. */ | |
6592 | - _edata = .; | |
6593 | - | |
6594 | - /* will be freed after init */ | |
6595 | - . = ALIGN(8192); /* Init code and data */ | |
6596 | -__init_begin = .; | |
6597 | - .init.text : { | |
6598 | - _sinittext = .; | |
6599 | - *(.init.text) | |
6600 | - _einittext = .; | |
6601 | - } | |
6602 | - .init.data : { *(.init.data) } | |
6603 | - . = ALIGN(16); | |
6604 | - __setup_start = .; | |
6605 | - .init.setup : { *(.init.setup) } | |
6606 | - __setup_end = .; | |
6607 | - __start___param = .; | |
6608 | - __param : { *(__param) } | |
6609 | - __stop___param = .; | |
6610 | - __initcall_start = .; | |
6611 | - .initcall.init : { | |
6612 | - *(.initcall1.init) | |
6613 | - *(.initcall2.init) | |
6614 | - *(.initcall3.init) | |
6615 | - *(.initcall4.init) | |
6616 | - *(.initcall5.init) | |
6617 | - *(.initcall6.init) | |
6618 | - *(.initcall7.init) | |
6619 | - } | |
6620 | - __initcall_end = .; | |
6621 | - __con_initcall_start = .; | |
6622 | - .con_initcall.init : { *(.con_initcall.init) } | |
6623 | - __con_initcall_end = .; | |
6624 | - SECURITY_INIT | |
6625 | - . = ALIGN(8192); | |
6626 | - __initramfs_start = .; | |
6627 | - .init.ramfs : { *(.init.ramfs) } | |
6628 | - __initramfs_end = .; | |
6629 | - . = ALIGN(8192); | |
6630 | - __init_end = .; | |
6631 | - .init.task : { *(init_task) } | |
6632 | - | |
6633 | - | |
6634 | - .bss : { *(.bss) } /* BSS */ | |
6635 | - | |
6636 | - _end = . ; | |
6637 | - | |
6638 | - /* Sections to be discarded */ | |
6639 | - /DISCARD/ : { | |
6640 | - *(.exit.text) | |
6641 | - *(.exit.data) | |
6642 | - *(.exitcall.exit) | |
6643 | - } | |
6644 | - | |
6645 | - .crap : { | |
6646 | - /* Stabs debugging sections. */ | |
6647 | - *(.stab) | |
6648 | - *(.stabstr) | |
6649 | - *(.stab.excl) | |
6650 | - *(.stab.exclstr) | |
6651 | - *(.stab.index) | |
6652 | - *(.stab.indexstr) | |
6653 | - *(.comment) | |
6654 | - *(.note) | |
6655 | - } | |
6656 | - | |
6657 | -} | |
6658 | diff -Nru a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig | |
6659 | --- a/arch/m68knommu/Kconfig Sat Aug 2 14:26:16 2003 | |
6660 | +++ b/arch/m68knommu/Kconfig Sun Aug 31 16:14:22 2003 | |
6661 | @@ -490,14 +490,6 @@ | |
6662 | ||
6663 | menu "Executable file formats" | |
6664 | ||
6665 | -config KCORE_AOUT | |
6666 | - bool | |
6667 | - default y | |
6668 | - | |
6669 | -config KCORE_ELF | |
6670 | - bool | |
6671 | - default y | |
6672 | - | |
6673 | source "fs/Kconfig.binfmt" | |
6674 | ||
6675 | endmenu | |
6676 | diff -Nru a/arch/m68knommu/platform/5206/config.c b/arch/m68knommu/platform/5206/config.c | |
6677 | --- a/arch/m68knommu/platform/5206/config.c Tue May 27 20:13:12 2003 | |
6678 | +++ b/arch/m68knommu/platform/5206/config.c Sat Aug 23 06:07:40 2003 | |
6679 | @@ -14,6 +14,7 @@ | |
6680 | #include <linux/sched.h> | |
6681 | #include <linux/param.h> | |
6682 | #include <linux/init.h> | |
6683 | +#include <linux/interrupt.h> | |
6684 | #include <asm/irq.h> | |
6685 | #include <asm/dma.h> | |
6686 | #include <asm/traps.h> | |
6687 | @@ -26,7 +27,7 @@ | |
6688 | /***************************************************************************/ | |
6689 | ||
6690 | void coldfire_tick(void); | |
6691 | -void coldfire_timer_init(void (*handler)(int, void *, struct pt_regs *)); | |
6692 | +void coldfire_timer_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); | |
6693 | unsigned long coldfire_timer_offset(void); | |
6694 | void coldfire_trap_init(void); | |
6695 | void coldfire_reset(void); | |
6696 | diff -Nru a/arch/m68knommu/platform/5206e/config.c b/arch/m68knommu/platform/5206e/config.c | |
6697 | --- a/arch/m68knommu/platform/5206e/config.c Tue May 27 20:13:12 2003 | |
6698 | +++ b/arch/m68knommu/platform/5206e/config.c Sat Aug 23 06:07:40 2003 | |
6699 | @@ -12,6 +12,7 @@ | |
6700 | #include <linux/kernel.h> | |
6701 | #include <linux/sched.h> | |
6702 | #include <linux/param.h> | |
6703 | +#include <linux/interrupt.h> | |
6704 | #include <asm/irq.h> | |
6705 | #include <asm/dma.h> | |
6706 | #include <asm/traps.h> | |
6707 | @@ -26,7 +27,7 @@ | |
6708 | /***************************************************************************/ | |
6709 | ||
6710 | void coldfire_tick(void); | |
6711 | -void coldfire_timer_init(void (*handler)(int, void *, struct pt_regs *)); | |
6712 | +void coldfire_timer_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); | |
6713 | unsigned long coldfire_timer_offset(void); | |
6714 | void coldfire_trap_init(void); | |
6715 | void coldfire_reset(void); | |
6716 | diff -Nru a/arch/m68knommu/platform/5249/config.c b/arch/m68knommu/platform/5249/config.c | |
6717 | --- a/arch/m68knommu/platform/5249/config.c Tue Jun 17 06:35:38 2003 | |
6718 | +++ b/arch/m68knommu/platform/5249/config.c Sat Aug 23 06:07:40 2003 | |
6719 | @@ -26,7 +26,7 @@ | |
6720 | /***************************************************************************/ | |
6721 | ||
6722 | void coldfire_tick(void); | |
6723 | -void coldfire_timer_init(void (*handler)(int, void *, struct pt_regs *)); | |
6724 | +void coldfire_timer_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); | |
6725 | unsigned long coldfire_timer_offset(void); | |
6726 | void coldfire_trap_init(void); | |
6727 | void coldfire_reset(void); | |
6728 | diff -Nru a/arch/m68knommu/platform/5272/config.c b/arch/m68knommu/platform/5272/config.c | |
6729 | --- a/arch/m68knommu/platform/5272/config.c Tue Jun 17 06:35:38 2003 | |
6730 | +++ b/arch/m68knommu/platform/5272/config.c Sat Aug 23 06:07:40 2003 | |
6731 | @@ -14,6 +14,7 @@ | |
6732 | #include <linux/sched.h> | |
6733 | #include <linux/param.h> | |
6734 | #include <linux/init.h> | |
6735 | +#include <linux/interrupt.h> | |
6736 | #include <asm/irq.h> | |
6737 | #include <asm/dma.h> | |
6738 | #include <asm/traps.h> | |
6739 | @@ -27,7 +28,7 @@ | |
6740 | /***************************************************************************/ | |
6741 | ||
6742 | void coldfire_tick(void); | |
6743 | -void coldfire_timer_init(void (*handler)(int, void *, struct pt_regs *)); | |
6744 | +void coldfire_timer_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); | |
6745 | unsigned long coldfire_timer_offset(void); | |
6746 | void coldfire_trap_init(void); | |
6747 | void coldfire_reset(void); | |
6748 | diff -Nru a/arch/mips/Kconfig b/arch/mips/Kconfig | |
6749 | --- a/arch/mips/Kconfig Mon Jul 28 04:57:50 2003 | |
6750 | +++ b/arch/mips/Kconfig Sun Aug 31 16:14:22 2003 | |
6751 | @@ -1126,31 +1126,6 @@ | |
6752 | ||
6753 | menu "Executable file formats" | |
6754 | ||
6755 | -config KCORE_ELF | |
6756 | - bool | |
6757 | - default y | |
6758 | - ---help--- | |
6759 | - If you enabled support for /proc file system then the file | |
6760 | - /proc/kcore will contain the kernel core image. This can be used | |
6761 | - in gdb: | |
6762 | - | |
6763 | - $ cd /usr/src/linux ; gdb vmlinux /proc/kcore | |
6764 | - | |
6765 | - You have two choices here: ELF and A.OUT. Selecting ELF will make | |
6766 | - /proc/kcore appear in ELF core format as defined by the Executable | |
6767 | - and Linking Format specification. Selecting A.OUT will choose the | |
6768 | - old "a.out" format which may be necessary for some old versions | |
6769 | - of binutils or on some architectures. | |
6770 | - | |
6771 | - This is especially useful if you have compiled the kernel with the | |
6772 | - "-g" option to preserve debugging information. It is mainly used | |
6773 | - for examining kernel data structures on the live kernel so if you | |
6774 | - don't understand what this means or are not a kernel hacker, just | |
6775 | - leave it at its default value ELF. | |
6776 | - | |
6777 | -config KCORE_AOUT | |
6778 | - bool | |
6779 | - | |
6780 | source "fs/Kconfig.binfmt" | |
6781 | ||
6782 | config TRAD_SIGNALS | |
6783 | diff -Nru a/arch/mips/au1000/common/dma.c b/arch/mips/au1000/common/dma.c | |
6784 | --- a/arch/mips/au1000/common/dma.c Mon Jun 23 12:12:26 2003 | |
6785 | +++ b/arch/mips/au1000/common/dma.c Sun Aug 31 16:14:08 2003 | |
6786 | @@ -62,14 +62,14 @@ | |
6787 | spinlock_t au1000_dma_spin_lock = SPIN_LOCK_UNLOCKED; | |
6788 | ||
6789 | struct dma_chan au1000_dma_table[NUM_AU1000_DMA_CHANNELS] = { | |
6790 | - {dev_id:-1,}, | |
6791 | - {dev_id:-1,}, | |
6792 | - {dev_id:-1,}, | |
6793 | - {dev_id:-1,}, | |
6794 | - {dev_id:-1,}, | |
6795 | - {dev_id:-1,}, | |
6796 | - {dev_id:-1,}, | |
6797 | - {dev_id:-1,} | |
6798 | + {.dev_id = -1,}, | |
6799 | + {.dev_id = -1,}, | |
6800 | + {.dev_id = -1,}, | |
6801 | + {.dev_id = -1,}, | |
6802 | + {.dev_id = -1,}, | |
6803 | + {.dev_id = -1,}, | |
6804 | + {.dev_id = -1,}, | |
6805 | + {.dev_id = -1,} | |
6806 | }; | |
6807 | ||
6808 | // Device FIFO addresses and default DMA modes | |
6809 | diff -Nru a/arch/mips/kernel/ioctl32.c b/arch/mips/kernel/ioctl32.c | |
6810 | --- a/arch/mips/kernel/ioctl32.c Mon Jul 28 04:57:50 2003 | |
6811 | +++ b/arch/mips/kernel/ioctl32.c Sun Aug 31 16:14:44 2003 | |
6812 | @@ -810,8 +810,7 @@ | |
6813 | #define IOCTL_TABLE_START \ | |
6814 | struct ioctl_trans ioctl_start[] = { | |
6815 | #define IOCTL_TABLE_END \ | |
6816 | - }; struct ioctl_trans ioctl_end[0]; | |
6817 | - | |
6818 | + }; | |
6819 | ||
6820 | IOCTL_TABLE_START | |
6821 | #include <linux/compat_ioctl.h> | |
6822 | @@ -1205,6 +1204,8 @@ | |
6823 | COMPATIBLE_IOCTL(RTC_WKALM_SET) | |
6824 | COMPATIBLE_IOCTL(RTC_WKALM_RD) | |
6825 | IOCTL_TABLE_END | |
6826 | + | |
6827 | +int ioctl_table_size = ARRAY_SIZE(ioctl_start); | |
6828 | ||
6829 | #define NR_IOCTL_TRANS (sizeof(ioctl_translations) / \ | |
6830 | sizeof(ioctl_translations[0])) | |
6831 | diff -Nru a/arch/mips/sibyte/cfe/console.c b/arch/mips/sibyte/cfe/console.c | |
6832 | --- a/arch/mips/sibyte/cfe/console.c Mon Jul 28 04:57:50 2003 | |
6833 | +++ b/arch/mips/sibyte/cfe/console.c Sun Aug 31 16:14:08 2003 | |
6834 | @@ -9,7 +9,6 @@ | |
6835 | #include "cfe_error.h" | |
6836 | ||
6837 | extern int cfe_cons_handle; | |
6838 | -static kdev_t cfe_consdev; | |
6839 | ||
6840 | static void cfe_console_write(struct console *cons, const char *str, | |
6841 | unsigned int count) | |
6842 | @@ -57,15 +56,12 @@ | |
6843 | #ifdef CONFIG_SIBYTE_SB1250_DUART | |
6844 | if (!strcmp(consdev, "uart0")) { | |
6845 | setleds("u0cn"); | |
6846 | -// cfe_consdev = MKDEV(TTY_MAJOR, SB1250_DUART_MINOR_BASE + 0); | |
6847 | } else if (!strcmp(consdev, "uart1")) { | |
6848 | setleds("u1cn"); | |
6849 | -// cfe_consdev = MKDEV(TTY_MAJOR, SB1250_DUART_MINOR_BASE + 1); | |
6850 | #endif | |
6851 | #ifdef CONFIG_VGA_CONSOLE | |
6852 | } else if (!strcmp(consdev, "pcconsole0")) { | |
6853 | setleds("pccn"); | |
6854 | -// cfe_consdev = MKDEV(TTY_MAJOR, 0); | |
6855 | #endif | |
6856 | } else | |
6857 | return -ENODEV; | |
6858 | @@ -74,12 +70,12 @@ | |
6859 | } | |
6860 | ||
6861 | static struct console sb1250_cfe_cons = { | |
6862 | - name: "cfe", | |
6863 | - write: cfe_console_write, | |
6864 | - device: cfe_console_device, | |
6865 | - setup: cfe_console_setup, | |
6866 | - flags: CON_PRINTBUFFER, | |
6867 | - index: -1, | |
6868 | + .name = "cfe", | |
6869 | + .write = cfe_console_write, | |
6870 | + .device = cfe_console_device, | |
6871 | + .setup = cfe_console_setup, | |
6872 | + .flags = CON_PRINTBUFFER, | |
6873 | + .index = -1, | |
6874 | }; | |
6875 | ||
6876 | static int __init sb1250_cfe_console_init(void) | |
6877 | diff -Nru a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c | |
6878 | --- a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c Mon Jul 28 04:57:50 2003 | |
6879 | +++ b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c Tue Aug 26 09:25:40 2003 | |
6880 | @@ -253,7 +253,7 @@ | |
6881 | { | |
6882 | int minor; | |
6883 | ||
6884 | - minor = minor(inode->i_rdev); | |
6885 | + minor = iminor(inode); | |
6886 | if (minor != 0) { | |
6887 | return -ENODEV; | |
6888 | } | |
6889 | @@ -278,7 +278,7 @@ | |
6890 | { | |
6891 | int minor; | |
6892 | ||
6893 | - minor = minor(inode->i_rdev); | |
6894 | + minor = iminor(inode); | |
6895 | if (minor != 0 || !sbp.open) { | |
6896 | return -ENODEV; | |
6897 | } | |
6898 | diff -Nru a/arch/mips/tx4927/common/tx4927_irq.c b/arch/mips/tx4927/common/tx4927_irq.c | |
6899 | --- a/arch/mips/tx4927/common/tx4927_irq.c Mon Apr 14 20:10:10 2003 | |
6900 | +++ b/arch/mips/tx4927/common/tx4927_irq.c Sun Aug 31 16:14:08 2003 | |
6901 | @@ -149,26 +149,26 @@ | |
6902 | ||
6903 | #define TX4927_CP0_NAME "TX4927-CP0" | |
6904 | static struct hw_interrupt_type tx4927_irq_cp0_type = { | |
6905 | - typename: TX4927_CP0_NAME, | |
6906 | - startup: tx4927_irq_cp0_startup, | |
6907 | - shutdown: tx4927_irq_cp0_shutdown, | |
6908 | - enable: tx4927_irq_cp0_enable, | |
6909 | - disable: tx4927_irq_cp0_disable, | |
6910 | - ack: tx4927_irq_cp0_mask_and_ack, | |
6911 | - end: tx4927_irq_cp0_end, | |
6912 | - set_affinity: NULL | |
6913 | + .typename = TX4927_CP0_NAME, | |
6914 | + .startup = tx4927_irq_cp0_startup, | |
6915 | + .shutdown = tx4927_irq_cp0_shutdown, | |
6916 | + .enable = tx4927_irq_cp0_enable, | |
6917 | + .disable = tx4927_irq_cp0_disable, | |
6918 | + .ack = tx4927_irq_cp0_mask_and_ack, | |
6919 | + .end = tx4927_irq_cp0_end, | |
6920 | + .set_affinity = NULL | |
6921 | }; | |
6922 | ||
6923 | #define TX4927_PIC_NAME "TX4927-PIC" | |
6924 | static struct hw_interrupt_type tx4927_irq_pic_type = { | |
6925 | - typename: TX4927_PIC_NAME, | |
6926 | - startup: tx4927_irq_pic_startup, | |
6927 | - shutdown: tx4927_irq_pic_shutdown, | |
6928 | - enable: tx4927_irq_pic_enable, | |
6929 | - disable: tx4927_irq_pic_disable, | |
6930 | - ack: tx4927_irq_pic_mask_and_ack, | |
6931 | - end: tx4927_irq_pic_end, | |
6932 | - set_affinity: NULL | |
6933 | + .typename = TX4927_PIC_NAME, | |
6934 | + .startup = tx4927_irq_pic_startup, | |
6935 | + .shutdown = tx4927_irq_pic_shutdown, | |
6936 | + .enable = tx4927_irq_pic_enable, | |
6937 | + .disable = tx4927_irq_pic_disable, | |
6938 | + .ack = tx4927_irq_pic_mask_and_ack, | |
6939 | + .end = tx4927_irq_pic_end, | |
6940 | + .set_affinity = NULL | |
6941 | }; | |
6942 | ||
6943 | #define TX4927_PIC_ACTION(s) { no_action, 0, 0, s, NULL, NULL } | |
6944 | diff -Nru a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c | |
6945 | --- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c Thu Jul 3 15:17:43 2003 | |
6946 | +++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c Sun Aug 31 16:14:08 2003 | |
6947 | @@ -255,14 +255,14 @@ | |
6948 | ||
6949 | #define TOSHIBA_RBTX4927_IOC_NAME "RBTX4927-IOC" | |
6950 | static struct hw_interrupt_type toshiba_rbtx4927_irq_ioc_type = { | |
6951 | - typename:TOSHIBA_RBTX4927_IOC_NAME, | |
6952 | - startup:toshiba_rbtx4927_irq_ioc_startup, | |
6953 | - shutdown:toshiba_rbtx4927_irq_ioc_shutdown, | |
6954 | - enable:toshiba_rbtx4927_irq_ioc_enable, | |
6955 | - disable:toshiba_rbtx4927_irq_ioc_disable, | |
6956 | - ack:toshiba_rbtx4927_irq_ioc_mask_and_ack, | |
6957 | - end:toshiba_rbtx4927_irq_ioc_end, | |
6958 | - set_affinity:NULL | |
6959 | + .typename = TOSHIBA_RBTX4927_IOC_NAME, | |
6960 | + .startup = toshiba_rbtx4927_irq_ioc_startup, | |
6961 | + .shutdown = toshiba_rbtx4927_irq_ioc_shutdown, | |
6962 | + .enable = toshiba_rbtx4927_irq_ioc_enable, | |
6963 | + .disable = toshiba_rbtx4927_irq_ioc_disable, | |
6964 | + .ack = toshiba_rbtx4927_irq_ioc_mask_and_ack, | |
6965 | + .end = toshiba_rbtx4927_irq_ioc_end, | |
6966 | + .set_affinity = NULL | |
6967 | }; | |
6968 | #define TOSHIBA_RBTX4927_IOC_INTR_ENAB 0xbc002000 | |
6969 | #define TOSHIBA_RBTX4927_IOC_INTR_STAT 0xbc002006 | |
6970 | @@ -271,14 +271,14 @@ | |
6971 | #ifdef CONFIG_TOSHIBA_FPCIB0 | |
6972 | #define TOSHIBA_RBTX4927_ISA_NAME "RBTX4927-ISA" | |
6973 | static struct hw_interrupt_type toshiba_rbtx4927_irq_isa_type = { | |
6974 | - typename:TOSHIBA_RBTX4927_ISA_NAME, | |
6975 | - startup:toshiba_rbtx4927_irq_isa_startup, | |
6976 | - shutdown:toshiba_rbtx4927_irq_isa_shutdown, | |
6977 | - enable:toshiba_rbtx4927_irq_isa_enable, | |
6978 | - disable:toshiba_rbtx4927_irq_isa_disable, | |
6979 | - ack:toshiba_rbtx4927_irq_isa_mask_and_ack, | |
6980 | - end:toshiba_rbtx4927_irq_isa_end, | |
6981 | - set_affinity:NULL | |
6982 | + .typename = TOSHIBA_RBTX4927_ISA_NAME, | |
6983 | + .startup = toshiba_rbtx4927_irq_isa_startup, | |
6984 | + .shutdown = toshiba_rbtx4927_irq_isa_shutdown, | |
6985 | + .enable = toshiba_rbtx4927_irq_isa_enable, | |
6986 | + .disable = toshiba_rbtx4927_irq_isa_disable, | |
6987 | + .ack = toshiba_rbtx4927_irq_isa_mask_and_ack, | |
6988 | + .end = toshiba_rbtx4927_irq_isa_end, | |
6989 | + .set_affinity = NULL | |
6990 | }; | |
6991 | #endif | |
6992 | ||
6993 | diff -Nru a/arch/mips/vr41xx/common/vrc4173.c b/arch/mips/vr41xx/common/vrc4173.c | |
6994 | --- a/arch/mips/vr41xx/common/vrc4173.c Thu Jul 31 08:59:17 2003 | |
6995 | +++ b/arch/mips/vr41xx/common/vrc4173.c Sun Aug 31 16:14:08 2003 | |
6996 | @@ -250,10 +250,10 @@ | |
6997 | } | |
6998 | ||
6999 | static struct pci_driver vrc4173_driver = { | |
7000 | - name: "NEC VRC4173", | |
7001 | - probe: vrc4173_probe, | |
7002 | - remove: NULL, | |
7003 | - id_table: vrc4173_table, | |
7004 | + .name = "NEC VRC4173", | |
7005 | + .probe = vrc4173_probe, | |
7006 | + .remove = NULL, | |
7007 | + .id_table = vrc4173_table, | |
7008 | }; | |
7009 | ||
7010 | static int __devinit vrc4173_init(void) | |
7011 | diff -Nru a/arch/parisc/Kconfig b/arch/parisc/Kconfig | |
7012 | --- a/arch/parisc/Kconfig Sat Aug 2 14:26:16 2003 | |
7013 | +++ b/arch/parisc/Kconfig Sun Aug 31 16:14:22 2003 | |
7014 | @@ -161,11 +161,6 @@ | |
7015 | ||
7016 | menu "Executable file formats" | |
7017 | ||
7018 | -config KCORE_ELF | |
7019 | - bool | |
7020 | - depends on PROC_FS | |
7021 | - default y | |
7022 | - | |
7023 | source "fs/Kconfig.binfmt" | |
7024 | ||
7025 | endmenu | |
7026 | diff -Nru a/arch/parisc/kernel/ioctl32.c b/arch/parisc/kernel/ioctl32.c | |
7027 | --- a/arch/parisc/kernel/ioctl32.c Fri May 2 10:22:56 2003 | |
7028 | +++ b/arch/parisc/kernel/ioctl32.c Sun Aug 31 16:14:44 2003 | |
7029 | @@ -1426,7 +1426,7 @@ | |
7030 | return -EINVAL; | |
7031 | ||
7032 | tty = (struct tty_struct *)file->private_data; | |
7033 | - if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl")) | |
7034 | + if (tty_paranoia_check(tty, inode, "tty_ioctl")) | |
7035 | return -EINVAL; | |
7036 | ||
7037 | if (tty->driver->ioctl != vt_ioctl) | |
7038 | @@ -2458,7 +2458,7 @@ | |
7039 | #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd, sys_ioctl) | |
7040 | ||
7041 | #define IOCTL_TABLE_START struct ioctl_trans ioctl_start[] = { | |
7042 | -#define IOCTL_TABLE_END }; struct ioctl_trans ioctl_end[0]; | |
7043 | +#define IOCTL_TABLE_END }; | |
7044 | ||
7045 | IOCTL_TABLE_START | |
7046 | #include <linux/compat_ioctl.h> | |
7047 | @@ -2631,3 +2631,4 @@ | |
7048 | #endif /* DRM */ | |
7049 | IOCTL_TABLE_END | |
7050 | ||
7051 | +int ioctl_table_size = ARRAY_SIZE(ioctl_start); | |
7052 | diff -Nru a/arch/ppc/8260_io/uart.c b/arch/ppc/8260_io/uart.c | |
7053 | --- a/arch/ppc/8260_io/uart.c Wed Jun 11 12:32:53 2003 | |
7054 | +++ b/arch/ppc/8260_io/uart.c Tue Aug 26 09:25:39 2003 | |
7055 | @@ -50,6 +50,10 @@ | |
7056 | #include <asm/cpm_8260.h> | |
7057 | #include <asm/irq.h> | |
7058 | ||
7059 | +#ifdef CONFIG_MAGIC_SYSRQ | |
7060 | +#include <linux/sysrq.h> | |
7061 | +#endif | |
7062 | + | |
7063 | #ifdef CONFIG_SERIAL_CONSOLE | |
7064 | #include <linux/console.h> | |
7065 | ||
7066 | @@ -77,6 +81,14 @@ | |
7067 | static struct tty_driver *serial_driver; | |
7068 | static int serial_console_setup(struct console *co, char *options); | |
7069 | ||
7070 | +static void serial_console_write(struct console *c, const char *s, | |
7071 | + unsigned count); | |
7072 | +static kdev_t serial_console_device(struct console *c); | |
7073 | + | |
7074 | +#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) | |
7075 | +static unsigned long break_pressed; /* break, really ... */ | |
7076 | +#endif | |
7077 | + | |
7078 | /* | |
7079 | * Serial driver configuration section. Here are the various options: | |
7080 | */ | |
7081 | @@ -208,6 +220,15 @@ | |
7082 | cbd_t *tx_cur; | |
7083 | } ser_info_t; | |
7084 | ||
7085 | +static struct console sercons = { | |
7086 | + .name = "ttyS", | |
7087 | + .write = serial_console_write, | |
7088 | + .device = serial_console_device, | |
7089 | + .setup = serial_console_setup, | |
7090 | + .flags = CON_PRINTBUFFER, | |
7091 | + .index = CONFIG_SERIAL_CONSOLE_PORT, | |
7092 | +}; | |
7093 | + | |
7094 | static void change_speed(ser_info_t *info); | |
7095 | static void rs_8xx_wait_until_sent(struct tty_struct *tty, int timeout); | |
7096 | ||
7097 | @@ -328,7 +349,7 @@ | |
7098 | schedule_work(&info->tqueue); | |
7099 | } | |
7100 | ||
7101 | -static _INLINE_ void receive_chars(ser_info_t *info) | |
7102 | +static _INLINE_ void receive_chars(ser_info_t *info, struct pt_regs *regs) | |
7103 | { | |
7104 | struct tty_struct *tty = info->tty; | |
7105 | unsigned char ch, *cp; | |
7106 | @@ -450,6 +471,19 @@ | |
7107 | } | |
7108 | } | |
7109 | } | |
7110 | + | |
7111 | +#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) | |
7112 | + if (break_pressed && info->line == sercons.index) { | |
7113 | + if (ch != 0 && time_before(jiffies, | |
7114 | + break_pressed + HZ*5)) { | |
7115 | + handle_sysrq(ch, regs, NULL, NULL); | |
7116 | + break_pressed = 0; | |
7117 | + goto ignore_char; | |
7118 | + } else | |
7119 | + break_pressed = 0; | |
7120 | + } | |
7121 | +#endif | |
7122 | + | |
7123 | if (tty->flip.count >= TTY_FLIPBUF_SIZE) | |
7124 | break; | |
7125 | ||
7126 | @@ -458,6 +492,10 @@ | |
7127 | tty->flip.count++; | |
7128 | } | |
7129 | ||
7130 | +#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) | |
7131 | + ignore_char: | |
7132 | +#endif | |
7133 | + | |
7134 | /* This BD is ready to be used again. Clear status. | |
7135 | * Get next BD. | |
7136 | */ | |
7137 | @@ -475,7 +513,36 @@ | |
7138 | schedule_delayed_work(&tty->flip.work, 1); | |
7139 | } | |
7140 | ||
7141 | -static _INLINE_ void transmit_chars(ser_info_t *info) | |
7142 | +static _INLINE_ void receive_break(ser_info_t *info, struct pt_regs *regs) | |
7143 | +{ | |
7144 | + struct tty_struct *tty = info->tty; | |
7145 | + | |
7146 | + info->state->icount.brk++; | |
7147 | + | |
7148 | +#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) | |
7149 | + if (info->line == sercons.index) { | |
7150 | + if (!break_pressed) { | |
7151 | + break_pressed = jiffies; | |
7152 | + return; | |
7153 | + } else | |
7154 | + break_pressed = 0; | |
7155 | + } | |
7156 | +#endif | |
7157 | + | |
7158 | + /* Check to see if there is room in the tty buffer for | |
7159 | + * the break. If not, we exit now, losing the break. FIXME | |
7160 | + */ | |
7161 | + if ((tty->flip.count + 1) >= TTY_FLIPBUF_SIZE) | |
7162 | + return; | |
7163 | + *(tty->flip.flag_buf_ptr++) = TTY_BREAK; | |
7164 | + *(tty->flip.char_buf_ptr++) = 0; | |
7165 | + tty->flip.count++; | |
7166 | + | |
7167 | + queue_task(&tty->flip.tqueue, &tq_timer); | |
7168 | +} | |
7169 | + | |
7170 | + | |
7171 | +static _INLINE_ void transmit_chars(ser_info_t *info, struct pt_regs *regs) | |
7172 | { | |
7173 | ||
7174 | if (info->flags & TX_WAKEUP) { | |
7175 | @@ -575,19 +642,23 @@ | |
7176 | if ((idx = info->state->smc_scc_num) < SCC_NUM_BASE) { | |
7177 | smcp = &immr->im_smc[idx]; | |
7178 | events = smcp->smc_smce; | |
7179 | + if (events & SMCM_BRKE) | |
7180 | + receive_break(info, regs); | |
7181 | if (events & SMCM_RX) | |
7182 | - receive_chars(info); | |
7183 | + receive_chars(info, regs); | |
7184 | if (events & SMCM_TX) | |
7185 | - transmit_chars(info); | |
7186 | + transmit_chars(info, regs); | |
7187 | smcp->smc_smce = events; | |
7188 | } | |
7189 | else { | |
7190 | sccp = &immr->im_scc[idx - SCC_IDX_BASE]; | |
7191 | events = sccp->scc_scce; | |
7192 | + if (events & SMCM_BRKE) | |
7193 | + receive_break(info, regs); | |
7194 | if (events & SCCM_RX) | |
7195 | - receive_chars(info); | |
7196 | + receive_chars(info, regs); | |
7197 | if (events & SCCM_TX) | |
7198 | - transmit_chars(info); | |
7199 | + transmit_chars(info, regs); | |
7200 | sccp->scc_scce = events; | |
7201 | } | |
7202 | ||
7203 | @@ -2207,7 +2278,7 @@ | |
7204 | static void serial_console_write(struct console *c, const char *s, | |
7205 | unsigned count) | |
7206 | { | |
7207 | -#if defined(CONFIG_KGDB) && !defined(CONFIG_USE_SERIAL2_KGDB) | |
7208 | +#if defined(CONFIG_KGDB_CONSOLE) && !defined(CONFIG_USE_SERIAL2_KGDB) | |
7209 | /* Try to let stub handle output. Returns true if it did. */ | |
7210 | if (kgdb_output_string(s, count)) | |
7211 | return; | |
7212 | @@ -2391,21 +2462,11 @@ | |
7213 | } | |
7214 | #endif | |
7215 | ||
7216 | -static kdev_t serial_console_device(struct console *c) | |
7217 | +static struct tty_driver *serial_console_device(struct console *c, int *index) | |
7218 | { | |
7219 | *index = c->index; | |
7220 | return serial_driver; | |
7221 | } | |
7222 | - | |
7223 | - | |
7224 | -static struct console sercons = { | |
7225 | - .name = "ttyS", | |
7226 | - .write = serial_console_write, | |
7227 | - .device = serial_console_device, | |
7228 | - .setup = serial_console_setup, | |
7229 | - .flags = CON_PRINTBUFFER, | |
7230 | - .index = CONFIG_SERIAL_CONSOLE_PORT, | |
7231 | -}; | |
7232 | ||
7233 | /* | |
7234 | * Register console. | |
7235 | diff -Nru a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c | |
7236 | --- a/arch/ppc/8xx_io/cs4218_tdm.c Tue Jul 15 10:01:29 2003 | |
7237 | +++ b/arch/ppc/8xx_io/cs4218_tdm.c Tue Aug 26 09:25:40 2003 | |
7238 | @@ -2106,11 +2106,11 @@ | |
7239 | */ | |
7240 | cs4218_ctl_write(cs4218_control); | |
7241 | ||
7242 | - sound.minDev = MINOR(inode->i_rdev) & 0x0f; | |
7243 | + sound.minDev = iminor(inode) & 0x0f; | |
7244 | sound.soft = sound.dsp; | |
7245 | sound.hard = sound.dsp; | |
7246 | sound_init(); | |
7247 | - if ((MINOR(inode->i_rdev) & 0x0f) == SND_DEV_AUDIO) { | |
7248 | + if ((iminor(inode) & 0x0f) == SND_DEV_AUDIO) { | |
7249 | sound_set_speed(8000); | |
7250 | sound_set_stereo(0); | |
7251 | sound_set_format(AFMT_MU_LAW); | |
7252 | diff -Nru a/arch/ppc/8xx_io/uart.c b/arch/ppc/8xx_io/uart.c | |
7253 | --- a/arch/ppc/8xx_io/uart.c Wed Jun 11 12:32:54 2003 | |
7254 | +++ b/arch/ppc/8xx_io/uart.c Thu Aug 21 15:10:37 2003 | |
7255 | @@ -1068,7 +1068,7 @@ | |
7256 | volatile cbd_t *bdp; | |
7257 | unsigned char *cp; | |
7258 | ||
7259 | -#ifdef CONFIG_KGDB | |
7260 | +#ifdef CONFIG_KGDB_CONSOLE | |
7261 | /* Try to let stub handle output. Returns true if it did. */ | |
7262 | if (kgdb_output_string(buf, count)) | |
7263 | return ret; | |
7264 | @@ -2271,7 +2271,7 @@ | |
7265 | static void serial_console_write(struct console *c, const char *s, | |
7266 | unsigned count) | |
7267 | { | |
7268 | -#ifdef CONFIG_KGDB | |
7269 | +#ifdef CONFIG_KGDB_CONSOLE | |
7270 | /* Try to let stub handle output. Returns true if it did. */ | |
7271 | if (kgdb_output_string(s, count)) | |
7272 | return; | |
7273 | diff -Nru a/arch/ppc/Kconfig b/arch/ppc/Kconfig | |
7274 | --- a/arch/ppc/Kconfig Mon Aug 4 16:10:57 2003 | |
7275 | +++ b/arch/ppc/Kconfig Wed Sep 3 05:16:34 2003 | |
7276 | @@ -66,6 +66,9 @@ | |
7277 | config 40x | |
7278 | bool "40x" | |
7279 | ||
7280 | +config 44x | |
7281 | + bool "44x" | |
7282 | + | |
7283 | config POWER3 | |
7284 | bool "POWER3" | |
7285 | ||
7286 | @@ -74,6 +77,11 @@ | |
7287 | ||
7288 | endchoice | |
7289 | ||
7290 | +config PTE_64BIT | |
7291 | + bool | |
7292 | + depends on 44x | |
7293 | + default y | |
7294 | + | |
7295 | source arch/ppc/platforms/4xx/Kconfig | |
7296 | ||
7297 | config 8260 | |
7298 | @@ -766,8 +774,8 @@ | |
7299 | RS/6000 machines are currently not supported by Linux. | |
7300 | ||
7301 | config PCI | |
7302 | - bool "PCI support" if 4xx || 8260 | |
7303 | - default y if !4xx && !8260 && !8xx && !APUS | |
7304 | + bool "PCI support" if 40x || 8260 | |
7305 | + default y if !40x && !8260 && !8xx && !APUS | |
7306 | default PCI_PERMEDIA if !4xx && !8260 && !8xx && APUS | |
7307 | default PCI_QSPAN if !4xx && !8260 && 8xx | |
7308 | help | |
7309 | @@ -795,22 +803,6 @@ | |
7310 | bool "PCI for Permedia2" | |
7311 | depends on !4xx && !8xx && APUS | |
7312 | ||
7313 | -# only elf supported, a.out is not -- Cort | |
7314 | -config KCORE_ELF | |
7315 | - bool | |
7316 | - depends on PROC_FS | |
7317 | - default y | |
7318 | - help | |
7319 | - If you enabled support for /proc file system then the file | |
7320 | - /proc/kcore will contain the kernel core image in ELF format. This | |
7321 | - can be used in gdb: | |
7322 | - | |
7323 | - $ cd /usr/src/linux ; gdb vmlinux /proc/kcore | |
7324 | - | |
7325 | - This is especially useful if you have compiled the kernel with the | |
7326 | - "-g" option to preserve debugging information. It is mainly used | |
7327 | - for examining kernel data structures on the live kernel. | |
7328 | - | |
7329 | config KERNEL_ELF | |
7330 | bool | |
7331 | default y | |
7332 | @@ -1159,6 +1151,7 @@ | |
7333 | config BOOT_LOAD | |
7334 | hex "Link/load address for booting" if BOOT_LOAD_BOOL | |
7335 | default "0x00400000" if 40x || 8xx || 8260 | |
7336 | + default "0x01000000" if 44x | |
7337 | default "0x00800000" | |
7338 | ||
7339 | config PIN_TLB | |
7340 | @@ -1277,16 +1270,11 @@ | |
7341 | floppy controller, say Y here. Most commonly found in PowerMacs. | |
7342 | ||
7343 | config MAC_SERIAL | |
7344 | - tristate "Support for PowerMac serial ports" | |
7345 | + tristate "Support for PowerMac serial ports (OBSOLETE DRIVER)" | |
7346 | depends on PPC_PMAC | |
7347 | help | |
7348 | - If you have Macintosh style serial ports (8 pin mini-DIN), say Y | |
7349 | - here. If you also have regular serial ports and enable the driver | |
7350 | - for them, you can't currently use the serial console feature. | |
7351 | - | |
7352 | -config SERIAL_CONSOLE | |
7353 | - bool "Support for console on serial port" | |
7354 | - depends on PPC_PMAC && MAC_SERIAL=y | |
7355 | + This driver is obsolete. Use CONFIG_SERIAL_PMACZILOG in | |
7356 | + "Character devices --> Serial drivers --> PowerMac z85c30" option. | |
7357 | ||
7358 | config ADB | |
7359 | bool "Apple Desktop Bus (ADB) support" | |
7360 | @@ -1426,20 +1414,12 @@ | |
7361 | config KGDB | |
7362 | bool "Include kgdb kernel debugger" | |
7363 | depends on DEBUG_KERNEL | |
7364 | + select DEBUG_INFO | |
7365 | help | |
7366 | Include in-kernel hooks for kgdb, the Linux kernel source level | |
7367 | debugger. See <http://kgdb.sourceforge.net/> for more information. | |
7368 | Unless you are intending to debug the kernel, say N here. | |
7369 | ||
7370 | -config DEBUG_INFO | |
7371 | - bool "Compile the kernel with debug info" | |
7372 | - depends on DEBUG_KERNEL | |
7373 | - help | |
7374 | - If you say Y here the resulting kernel image will include | |
7375 | - debugging info resulting in a larger kernel image. | |
7376 | - Say Y here only if you plan to use gdb to debug the kernel. | |
7377 | - If you don't debug the kernel, you can say N. | |
7378 | - | |
7379 | choice | |
7380 | prompt "Serial Port" | |
7381 | depends on KGDB | |
7382 | @@ -1459,6 +1439,14 @@ | |
7383 | ||
7384 | endchoice | |
7385 | ||
7386 | +config KGDB_CONSOLE | |
7387 | + bool "Enable serial console thru kgdb port" | |
7388 | + depends on KGDB && 8xx || 8260 | |
7389 | + help | |
7390 | + If you enable this, all serial console messages will be sent | |
7391 | + over the gdb stub. | |
7392 | + If unsure, say N. | |
7393 | + | |
7394 | config XMON | |
7395 | bool "Include xmon kernel debugger" | |
7396 | depends on DEBUG_KERNEL | |
7397 | @@ -1474,18 +1462,16 @@ | |
7398 | Unless you are intending to debug the kernel with one of these | |
7399 | machines, say N here. | |
7400 | ||
7401 | -config MORE_COMPILE_OPTIONS | |
7402 | - bool "Add any additional compile options" | |
7403 | - depends on DEBUG_KERNEL && (KGDB || XMON || BDI_SWITCH) | |
7404 | - help | |
7405 | - If you want to add additional CFLAGS to the kernel build, such as -g | |
7406 | - for KGDB or the BDI2000, enable this option and then enter what you | |
7407 | - would like to add in the next question. | |
7408 | - | |
7409 | -config COMPILE_OPTIONS | |
7410 | - string "Additional compile arguments" | |
7411 | - depends on MORE_COMPILE_OPTIONS | |
7412 | - default "-g -ggdb" | |
7413 | +config DEBUG_INFO | |
7414 | + bool "Compile the kernel with debug info" | |
7415 | + depends on DEBUG_KERNEL | |
7416 | + default y if BDI_SWITCH || XMON | |
7417 | + help | |
7418 | + If you say Y here the resulting kernel image will include | |
7419 | + debugging info resulting in a larger kernel image. | |
7420 | + Say Y here only if you plan to use some sort of debugger to | |
7421 | + debug the kernel. | |
7422 | + If you don't debug the kernel, you can say N. | |
7423 | ||
7424 | config BOOTX_TEXT | |
7425 | bool "Support for early boot text console (BootX or OpenFirmware only)" | |
7426 | diff -Nru a/arch/ppc/Makefile b/arch/ppc/Makefile | |
7427 | --- a/arch/ppc/Makefile Sun Jul 27 15:52:30 2003 | |
7428 | +++ b/arch/ppc/Makefile Wed Sep 3 05:16:34 2003 | |
7429 | @@ -22,9 +22,6 @@ | |
7430 | ||
7431 | cflags-$(CONFIG_4xx) += -Wa,-m405 | |
7432 | cflags-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge | |
7433 | -# Use sed to remove the quotes. | |
7434 | -cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ | |
7435 | - $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') | |
7436 | ||
7437 | CFLAGS += $(cflags-y) | |
7438 | ||
7439 | @@ -32,7 +29,7 @@ | |
7440 | head-y := arch/ppc/kernel/head.o | |
7441 | head-$(CONFIG_8xx) := arch/ppc/kernel/head_8xx.o | |
7442 | head-$(CONFIG_4xx) := arch/ppc/kernel/head_4xx.o | |
7443 | -head-$(CONFIG_440) := arch/ppc/kernel/head_44x.o | |
7444 | +head-$(CONFIG_44x) := arch/ppc/kernel/head_44x.o | |
7445 | ||
7446 | head-$(CONFIG_6xx) += arch/ppc/kernel/idle_6xx.o | |
7447 | ||
7448 | diff -Nru a/arch/ppc/boot/common/ns16550.c b/arch/ppc/boot/common/ns16550.c | |
7449 | --- a/arch/ppc/boot/common/ns16550.c Sat Jun 28 11:06:53 2003 | |
7450 | +++ b/arch/ppc/boot/common/ns16550.c Wed Aug 20 10:24:16 2003 | |
7451 | @@ -60,7 +60,7 @@ | |
7452 | else { | |
7453 | /* Input clock. */ | |
7454 | outb(com_port + (UART_DLL << shift), | |
7455 | - (BASE_BAUD / SERIAL_BAUD)); | |
7456 | + (BASE_BAUD / SERIAL_BAUD) & 0xFF); | |
7457 | outb(com_port + (UART_DLM << shift), | |
7458 | (BASE_BAUD / SERIAL_BAUD) >> 8); | |
7459 | /* 8 data, 1 stop, no parity */ | |
7460 | diff -Nru a/arch/ppc/boot/common/util.S b/arch/ppc/boot/common/util.S | |
7461 | --- a/arch/ppc/boot/common/util.S Tue Feb 25 11:37:43 2003 | |
7462 | +++ b/arch/ppc/boot/common/util.S Thu Aug 21 10:17:00 2003 | |
7463 | @@ -160,9 +160,22 @@ | |
7464 | blr | |
7465 | ||
7466 | ||
7467 | +/* udelay (on non-601 processors) needs to know the period of the | |
7468 | + * timebase in nanoseconds. This used to be hardcoded to be 60ns | |
7469 | + * (period of 66MHz/4). Now a variable is used that is initialized to | |
7470 | + * 60 for backward compatibility, but it can be overridden as necessary | |
7471 | + * with code something like this: | |
7472 | + * extern unsigned long timebase_period_ns; | |
7473 | + * timebase_period_ns = 1000000000 / bd->bi_tbfreq; | |
7474 | + */ | |
7475 | + .data | |
7476 | + .globl timebase_period_ns | |
7477 | +timebase_period_ns: | |
7478 | + .long 60 | |
7479 | + | |
7480 | + .text | |
7481 | /* | |
7482 | * Delay for a number of microseconds | |
7483 | - * -- Use the BUS timer (assumes 66MHz) | |
7484 | */ | |
7485 | .globl udelay | |
7486 | udelay: | |
7487 | @@ -180,8 +193,13 @@ | |
7488 | ||
7489 | .udelay_not_601: | |
7490 | mulli r4,r3,1000 /* nanoseconds */ | |
7491 | - addi r4,r4,59 | |
7492 | - li r5,60 | |
7493 | + /* Change r4 to be the number of ticks using: | |
7494 | + * (nanoseconds + (timebase_period_ns - 1 )) / timebase_period_ns | |
7495 | + * timebase_period_ns defaults to 60 (16.6MHz) */ | |
7496 | + lis r5,timebase_period_ns@h | |
7497 | + lwz r5,timebase_period_ns@l(r5) | |
7498 | + addi r4,r4,r5 | |
7499 | + addi r4,r4,-1 | |
7500 | divw r4,r4,r5 /* BUS ticks */ | |
7501 | 1: mftbu r5 | |
7502 | mftb r6 | |
7503 | diff -Nru a/arch/ppc/boot/include/of1275.h b/arch/ppc/boot/include/of1275.h | |
7504 | --- a/arch/ppc/boot/include/of1275.h Mon Sep 16 21:58:06 2002 | |
7505 | +++ b/arch/ppc/boot/include/of1275.h Mon Aug 25 05:13:38 2003 | |
7506 | @@ -20,6 +20,7 @@ | |
7507 | /* function declarations */ | |
7508 | ||
7509 | void * claim(unsigned int virt, unsigned int size, unsigned int align); | |
7510 | +int map(unsigned int phys, unsigned int virt, unsigned int size); | |
7511 | void enter(void); | |
7512 | void exit(void); | |
7513 | phandle finddevice(const char *name); | |
7514 | diff -Nru a/arch/ppc/boot/ld.script b/arch/ppc/boot/ld.script | |
7515 | --- a/arch/ppc/boot/ld.script Thu May 29 04:06:53 2003 | |
7516 | +++ b/arch/ppc/boot/ld.script Mon Aug 25 05:13:38 2003 | |
7517 | @@ -66,7 +66,7 @@ | |
7518 | _edata = .; | |
7519 | PROVIDE (edata = .); | |
7520 | ||
7521 | - . = ALIGN(8); | |
7522 | + . = ALIGN(4096); | |
7523 | __bss_start = .; | |
7524 | .bss : | |
7525 | { | |
7526 | diff -Nru a/arch/ppc/boot/of1275/Makefile b/arch/ppc/boot/of1275/Makefile | |
7527 | --- a/arch/ppc/boot/of1275/Makefile Sun Jun 8 01:12:49 2003 | |
7528 | +++ b/arch/ppc/boot/of1275/Makefile Mon Aug 25 09:36:40 2003 | |
7529 | @@ -3,4 +3,4 @@ | |
7530 | # | |
7531 | ||
7532 | lib-y := claim.o enter.o exit.o finddevice.o getprop.o ofinit.o \ | |
7533 | - ofstdio.o read.o release.o write.o | |
7534 | + ofstdio.o read.o release.o write.o map.o | |
7535 | diff -Nru a/arch/ppc/boot/of1275/map.c b/arch/ppc/boot/of1275/map.c | |
7536 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
7537 | +++ b/arch/ppc/boot/of1275/map.c Mon Aug 25 09:36:40 2003 | |
7538 | @@ -0,0 +1,50 @@ | |
7539 | + | |
7540 | +/* | |
7541 | + * Copyright (C) Paul Mackerras 1997. | |
7542 | + * Copyright (C) Leigh Brown 2002. | |
7543 | + * | |
7544 | + * This program is free software; you can redistribute it and/or | |
7545 | + * modify it under the terms of the GNU General Public License | |
7546 | + * as published by the Free Software Foundation; either version | |
7547 | + * 2 of the License, or (at your option) any later version. | |
7548 | + */ | |
7549 | + | |
7550 | +#include "of1275.h" | |
7551 | +#include "nonstdio.h" | |
7552 | + | |
7553 | +extern ihandle of_prom_mmu; | |
7554 | + | |
7555 | +int | |
7556 | +map(unsigned int phys, unsigned int virt, unsigned int size) | |
7557 | +{ | |
7558 | + struct prom_args { | |
7559 | + char *service; | |
7560 | + int nargs; | |
7561 | + int nret; | |
7562 | + char *method; | |
7563 | + ihandle mmu_ihandle; | |
7564 | + int misc; | |
7565 | + unsigned int phys; | |
7566 | + unsigned int virt; | |
7567 | + unsigned int size; | |
7568 | + int ret0; | |
7569 | + int ret1; | |
7570 | + } args; | |
7571 | + | |
7572 | + if (of_prom_mmu == 0) { | |
7573 | + printf("map() called, no MMU found\n"); | |
7574 | + return -1; | |
7575 | + } | |
7576 | + args.service = "call-method"; | |
7577 | + args.nargs = 6; | |
7578 | + args.nret = 2; | |
7579 | + args.method = "map"; | |
7580 | + args.mmu_ihandle = of_prom_mmu; | |
7581 | + args.misc = -1; | |
7582 | + args.phys = phys; | |
7583 | + args.virt = virt; | |
7584 | + args.size = size; | |
7585 | + (*of_prom_entry)(&args); | |
7586 | + | |
7587 | + return (int)args.ret0; | |
7588 | +} | |
7589 | diff -Nru a/arch/ppc/boot/of1275/ofinit.c b/arch/ppc/boot/of1275/ofinit.c | |
7590 | --- a/arch/ppc/boot/of1275/ofinit.c Mon Sep 16 22:18:13 2002 | |
7591 | +++ b/arch/ppc/boot/of1275/ofinit.c Mon Aug 25 05:13:38 2003 | |
7592 | @@ -11,9 +11,17 @@ | |
7593 | #include "of1275.h" | |
7594 | ||
7595 | prom_entry of_prom_entry; | |
7596 | +ihandle of_prom_mmu; | |
7597 | ||
7598 | void | |
7599 | ofinit(prom_entry prom_ptr) | |
7600 | { | |
7601 | + phandle chosen; | |
7602 | + | |
7603 | of_prom_entry = prom_ptr; | |
7604 | + | |
7605 | + if ((chosen = finddevice("/chosen")) == OF_INVALID_HANDLE) | |
7606 | + return; | |
7607 | + if (getprop(chosen, "mmu", &of_prom_mmu, sizeof(ihandle)) != 4) | |
7608 | + return; | |
7609 | } | |
7610 | diff -Nru a/arch/ppc/boot/openfirmware/Makefile b/arch/ppc/boot/openfirmware/Makefile | |
7611 | --- a/arch/ppc/boot/openfirmware/Makefile Wed Jul 23 08:39:58 2003 | |
7612 | +++ b/arch/ppc/boot/openfirmware/Makefile Mon Aug 25 05:13:38 2003 | |
7613 | @@ -22,7 +22,7 @@ | |
7614 | images := $(boot)/images | |
7615 | ||
7616 | OBJCOPY_ARGS := -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment | |
7617 | -COFF_LD_ARGS := -T $(boot)/ld.script -e _start -Ttext 0x00700000 -Bstatic | |
7618 | +COFF_LD_ARGS := -T $(boot)/ld.script -e _start -Ttext 0x00500000 -Bstatic | |
7619 | CHRP_LD_ARGS := -T $(boot)/ld.script -e _start -Ttext 0x00800000 | |
7620 | NEWWORLD_LD_ARGS:= -T $(boot)/ld.script -e _start -Ttext 0x01000000 | |
7621 | ||
7622 | diff -Nru a/arch/ppc/boot/openfirmware/coffmain.c b/arch/ppc/boot/openfirmware/coffmain.c | |
7623 | --- a/arch/ppc/boot/openfirmware/coffmain.c Thu Nov 7 03:31:11 2002 | |
7624 | +++ b/arch/ppc/boot/openfirmware/coffmain.c Mon Aug 25 05:13:38 2003 | |
7625 | @@ -32,16 +32,16 @@ | |
7626 | char *begin_avail, *end_avail; | |
7627 | char *avail_high; | |
7628 | ||
7629 | -#define RAM_START 0 | |
7630 | -#define RAM_END (RAM_START + 0x800000) /* only 8M mapped with BATs */ | |
7631 | - | |
7632 | -#define PROG_START RAM_START | |
7633 | -#define PROG_SIZE 0x00700000 | |
7634 | - | |
7635 | #define SCRATCH_SIZE (128 << 10) | |
7636 | ||
7637 | static char heap[SCRATCH_SIZE]; | |
7638 | ||
7639 | +static unsigned long ram_start = 0; | |
7640 | +static unsigned long ram_end = 0x1000000; | |
7641 | +static unsigned long prog_start = 0x800000; | |
7642 | +static unsigned long prog_size = 0x800000; | |
7643 | + | |
7644 | + | |
7645 | typedef void (*kernel_start_t)(int, int, void *); | |
7646 | ||
7647 | void boot(int a1, int a2, void *prom) | |
7648 | @@ -52,32 +52,34 @@ | |
7649 | unsigned initrd_start, initrd_size; | |
7650 | ||
7651 | printf("coffboot starting: loaded at 0x%p\n", &_start); | |
7652 | - setup_bats(RAM_START); | |
7653 | + setup_bats(ram_start); | |
7654 | ||
7655 | initrd_size = (char *)(&__ramdisk_end) - (char *)(&__ramdisk_begin); | |
7656 | if (initrd_size) { | |
7657 | - initrd_start = (RAM_END - initrd_size) & ~0xFFF; | |
7658 | + initrd_start = (ram_end - initrd_size) & ~0xFFF; | |
7659 | a1 = initrd_start; | |
7660 | a2 = initrd_size; | |
7661 | - claim(initrd_start, RAM_END - initrd_start, 0); | |
7662 | + claim(initrd_start, ram_end - initrd_start, 0); | |
7663 | printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n\r", | |
7664 | initrd_start, (char *)(&__ramdisk_begin), initrd_size); | |
7665 | memcpy((char *)initrd_start, (char *)(&__ramdisk_begin), initrd_size); | |
7666 | + prog_size = initrd_start - prog_start; | |
7667 | } else | |
7668 | a2 = 0xdeadbeef; | |
7669 | ||
7670 | im = (char *)(&__image_begin); | |
7671 | len = (char *)(&__image_end) - (char *)(&__image_begin); | |
7672 | - /* claim 4MB starting at 0 */ | |
7673 | - claim(0, PROG_SIZE, 0); | |
7674 | - dst = (void *) RAM_START; | |
7675 | + /* claim 4MB starting at PROG_START */ | |
7676 | + claim(prog_start, prog_size, 0); | |
7677 | + map(prog_start, prog_start, prog_size); | |
7678 | + dst = (void *) prog_start; | |
7679 | if (im[0] == 0x1f && im[1] == 0x8b) { | |
7680 | /* set up scratch space */ | |
7681 | begin_avail = avail_high = avail_ram = heap; | |
7682 | end_avail = heap + sizeof(heap); | |
7683 | printf("heap at 0x%p\n", avail_ram); | |
7684 | printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len); | |
7685 | - gunzip(dst, PROG_SIZE, im, &len); | |
7686 | + gunzip(dst, prog_size, im, &len); | |
7687 | printf("done %u bytes\n", len); | |
7688 | printf("%u bytes of heap consumed, max in use %u\n", | |
7689 | avail_high - begin_avail, heap_max); | |
7690 | @@ -87,9 +89,9 @@ | |
7691 | ||
7692 | flush_cache(dst, len); | |
7693 | make_bi_recs(((unsigned long) dst + len), "coffboot", _MACH_Pmac, | |
7694 | - (PROG_START + PROG_SIZE)); | |
7695 | + (prog_start + prog_size)); | |
7696 | ||
7697 | - sa = (unsigned long)PROG_START; | |
7698 | + sa = (unsigned long)prog_start; | |
7699 | printf("start address = 0x%x\n", sa); | |
7700 | ||
7701 | (*(kernel_start_t)sa)(a1, a2, prom); | |
7702 | diff -Nru a/arch/ppc/boot/openfirmware/misc.S b/arch/ppc/boot/openfirmware/misc.S | |
7703 | --- a/arch/ppc/boot/openfirmware/misc.S Mon Sep 16 21:54:12 2002 | |
7704 | +++ b/arch/ppc/boot/openfirmware/misc.S Mon Aug 25 05:13:38 2003 | |
7705 | @@ -9,7 +9,7 @@ | |
7706 | .text | |
7707 | ||
7708 | /* | |
7709 | - * Use the BAT3 registers to map the 1st 8MB of RAM to | |
7710 | + * Use the BAT2 & 3 registers to map the 1st 16MB of RAM to | |
7711 | * the address given as the 1st argument. | |
7712 | */ | |
7713 | .globl setup_bats | |
7714 | @@ -22,6 +22,10 @@ | |
7715 | mtibatl 3,0 /* invalidate BAT first */ | |
7716 | ori 3,3,4 /* set up BAT registers for 601 */ | |
7717 | li 4,0x7f | |
7718 | + mtibatu 2,3 | |
7719 | + mtibatl 2,4 | |
7720 | + oris 3,3,0x80 | |
7721 | + oris 4,4,0x80 | |
7722 | mtibatu 3,3 | |
7723 | mtibatl 3,4 | |
7724 | b 5f | |
7725 | @@ -29,6 +33,12 @@ | |
7726 | mtibatu 3,0 | |
7727 | ori 3,3,0xff /* set up BAT registers for 604 */ | |
7728 | li 4,2 | |
7729 | + mtdbatl 2,4 | |
7730 | + mtdbatu 2,3 | |
7731 | + mtibatl 2,4 | |
7732 | + mtibatu 2,3 | |
7733 | + oris 3,3,0x80 | |
7734 | + oris 4,4,0x80 | |
7735 | mtdbatl 3,4 | |
7736 | mtdbatu 3,3 | |
7737 | mtibatl 3,4 | |
7738 | diff -Nru a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile | |
7739 | --- a/arch/ppc/boot/simple/Makefile Tue Jul 1 17:01:18 2003 | |
7740 | +++ b/arch/ppc/boot/simple/Makefile Wed Sep 3 05:16:34 2003 | |
7741 | @@ -22,7 +22,6 @@ | |
7742 | # get_mem_size(), which is memory controller dependent. Add in the correct | |
7743 | # XXX_memory.o file for this to work, as well as editing the $(MISC) file. | |
7744 | ||
7745 | -boot: zImage | |
7746 | ||
7747 | boot := arch/ppc/boot | |
7748 | common := $(boot)/common | |
7749 | @@ -32,86 +31,95 @@ | |
7750 | ||
7751 | # Normally, we use the 'misc.c' file for decompress_kernel and | |
7752 | # whatnot. Sometimes we need to override this however. | |
7753 | -MISC := misc.o | |
7754 | -ifeq ($(CONFIG_IBM_OPENBIOS),y) | |
7755 | -ZIMAGE := zImage-TREE | |
7756 | -ZIMAGEINITRD := zImage.initrd-TREE | |
7757 | -END := treeboot | |
7758 | -TFTPIMAGE := /tftpboot/zImage.$(END) | |
7759 | -MISC := misc-embedded.o | |
7760 | -endif | |
7761 | -ifeq ($(CONFIG_EMBEDDEDBOOT),y) | |
7762 | -TFTPIMAGE := /tftpboot/zImage.embedded | |
7763 | -MISC := misc-embedded.o | |
7764 | -endif | |
7765 | -ifeq ($(CONFIG_EBONY),y) | |
7766 | -ZIMAGE := zImage-TREE | |
7767 | -ZIMAGEINITRD := zImage.initrd-TREE | |
7768 | -END := ebony | |
7769 | -ENTRYPOINT := 0x01000000 | |
7770 | -TFTPIMAGE := /tftpboot/zImage.$(END) | |
7771 | -endif | |
7772 | -ifeq ($(CONFIG_EV64260),y) | |
7773 | -EXTRA := misc-ev64260.o | |
7774 | -TFTPIMAGE := /tftpboot/zImage.ev64260 | |
7775 | -endif | |
7776 | -ifeq ($(CONFIG_GEMINI),y) | |
7777 | -ZIMAGE := zImage-STRIPELF | |
7778 | -ZIMAGEINITRD := zImage.initrd-STRIPELF | |
7779 | -END := gemini | |
7780 | -TFTPIMAGE := /tftpboot/zImage.$(END) | |
7781 | -endif | |
7782 | -ifeq ($(CONFIG_K2),y) | |
7783 | -EXTRA := legacy.o | |
7784 | -TFTPIMAGE := /tftpboot/zImage.k2 | |
7785 | -endif | |
7786 | -# kbuild-2.4 'feature', only one of these will ever by 'y' at a time. | |
7787 | +misc-y := misc.o | |
7788 | + | |
7789 | +# | |
7790 | +# See arch/ppc/kconfig and arch/ppc/platforms/Kconfig | |
7791 | +# for definition of what platform each config option refer to. | |
7792 | +#---------------------------------------------------------------------------- | |
7793 | + zimage-$(CONFIG_IBM_OPENBIOS) := zImage-TREE | |
7794 | +zimageinitrd-$(CONFIG_IBM_OPENBIOS) := zImage.initrd-TREE | |
7795 | + end-$(CONFIG_IBM_OPENBIOS) := treeboot | |
7796 | + tftpimage-$(CONFIG_IBM_OPENBIOS) := /tftpboot/zImage.$(end-y) | |
7797 | + misc-$(CONFIG_IBM_OPENBIOS) := misc-embedded.o | |
7798 | + | |
7799 | + tftpimage-$(CONFIG_EMBEDDEDBOOT) := /tftpboot/zImage.embedded | |
7800 | + misc-$(CONFIG_EMBEDDEDBOOT) := misc-embedded.o | |
7801 | + | |
7802 | + zimage-$(CONFIG_EBONY) := zImage-TREE | |
7803 | +zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE | |
7804 | + end-$(CONFIG_EBONY) := ebony | |
7805 | + entrypoint-$(CONFIG_EBONY) := 0x01000000 | |
7806 | + tftpimage-$(CONFIG_EBONY) := /tftpboot/zImage.$(end-y) | |
7807 | + | |
7808 | + zimage-$(CONFIG_OCOTEA) := zImage-TREE | |
7809 | +zimageinitrd-$(CONFIG_OCOTEA) := zImage.initrd-TREE | |
7810 | + end-$(CONFIG_OCOTEA) := ocotea | |
7811 | + entrypoint-$(CONFIG_OCOTEA) := 0x01000000 | |
7812 | + tftpimage-$(CONFIG_OCOTEA) := /tftpboot/zImage.$(end-y) | |
7813 | + | |
7814 | + extra.o-$(CONFIG_EV64260) := direct.o misc-ev64260.o | |
7815 | + tftpimage-$(CONFIG_EV64260) := /tftpboot/zImage.ev64260 | |
7816 | + | |
7817 | + zimage-$(CONFIG_GEMINI) := zImage-STRIPELF | |
7818 | +zimageinitrd-$(CONFIG_GEMINI) := zImage.initrd-STRIPELF | |
7819 | + end-$(CONFIG_GEMINI) := gemini | |
7820 | + tftpimage-$(CONFIG_GEMINI) := /tftpboot/zImage.$(end-y) | |
7821 | + | |
7822 | + extra.o-$(CONFIG_K2) := legacy.o | |
7823 | + tftpimage-$(CONFIG_K2) := /tftpboot/zImage.k2 | |
7824 | + | |
7825 | +# kconfig 'feature', only one of these will ever by 'y' at a time. | |
7826 | # The rest will be unset. | |
7827 | -ifeq ($(CONFIG_MCPN765)$(CONFIG_MVME5100)$(CONFIG_PRPMC750)$(CONFIG_PRPMC800)$(CONFIG_LOPEC)$(CONFIG_PPLUS),y) | |
7828 | -ZIMAGE := zImage-PPLUS | |
7829 | -ZIMAGEINITRD := zImage.initrd-PPLUS | |
7830 | -TFTPIMAGE := /tftpboot/zImage.pplus | |
7831 | -ZNETBOOT := zImage.pplus | |
7832 | -ZNETBOOTRD := zImage.initrd.pplus | |
7833 | -endif | |
7834 | -ifeq ($(CONFIG_PPLUS),y) | |
7835 | -EXTRA := legacy.o | |
7836 | -endif | |
7837 | -ifeq ($(CONFIG_PCORE)$(CONFIG_POWERPMC250),y) | |
7838 | -ZIMAGE := zImage-STRIPELF | |
7839 | -ZIMAGEINITRD := zImage.initrd-STRIPELF | |
7840 | -EXTRA := chrpmap.o | |
7841 | -END := pcore | |
7842 | -TFTPIMAGE := /tftpboot/zImage.$(END) | |
7843 | -endif | |
7844 | -ifeq ($(CONFIG_SANDPOINT),y) | |
7845 | -TFTPIMAGE := /tftpboot/zImage.sandpoint | |
7846 | -endif | |
7847 | -ifeq ($(CONFIG_SPRUCE),y) | |
7848 | -ZIMAGE := zImage-TREE | |
7849 | -ZIMAGEINITRD := zImage.initrd-TREE | |
7850 | -END := spruce | |
7851 | -ENTRYPOINT := 0x00800000 | |
7852 | -MISC := misc-spruce.o | |
7853 | -TFTPIMAGE := /tftpboot/zImage.$(END) | |
7854 | -endif | |
7855 | -ifeq ($(CONFIG_SMP),y) | |
7856 | -TFTPIMAGE += .smp | |
7857 | -endif | |
7858 | -ifeq ($(CONFIG_REDWOOD_4),y) | |
7859 | +multi := $(CONFIG_MCPN765)$(CONFIG_MVME5100)$(CONFIG_PRPMC750) \ | |
7860 | +$(CONFIG_PRPMC800)$(CONFIG_LOPEC)$(CONFIG_PPLUS) | |
7861 | + zimage-$(multi) := zImage-PPLUS | |
7862 | +zimageinitrd-$(multi) := zImage.initrd-PPLUS | |
7863 | + tftpimage-$(multi) := /tftpboot/zImage.pplus | |
7864 | + znetboot-$(multi) := zImage.pplus | |
7865 | + znetbootrd-$(multi) := zImage.initrd.pplus | |
7866 | + | |
7867 | +# Overrides previous assingment | |
7868 | + extra.o-$(CONFIG_PPLUS) := legacy.o | |
7869 | + | |
7870 | + zimage-$(CONFIG_PCORE) := zImage-STRIPELF | |
7871 | +zimageinitrd-$(CONFIG_PCORE) := zImage.initrd-STRIPELF | |
7872 | + extra.o-$(CONFIG_PCORE) := chrpmap.o | |
7873 | + end-$(CONFIG_PCORE) := pcore | |
7874 | + tftpimage-$(CONFIG_PCORE) := /tftpboot/zImage.$(end-y) | |
7875 | + | |
7876 | + zimage-$(CONFIG_POWERPMC250) := zImage-STRIPELF | |
7877 | +zimageinitrd-$(CONFIG_POWERPMC250) := zImage.initrd-STRIPELF | |
7878 | + extra.o-$(CONFIG_POWERPMC250) := chrpmap.o | |
7879 | + end-$(CONFIG_POWERPMC250) := pcore | |
7880 | + tftpimage-$(CONFIG_POWERPMC250) := /tftpboot/zImage.$(end-y) | |
7881 | + | |
7882 | + tftpimage-$(CONFIG_SANDPOINT) := /tftpboot/zImage.sandpoint | |
7883 | + | |
7884 | + zimage-$(CONFIG_SPRUCE) := zImage-TREE | |
7885 | +zimageinitrd-$(CONFIG_SPRUCE) := zImage.initrd-TREE | |
7886 | + end-$(CONFIG_SPRUCE) := spruce | |
7887 | + entrypoint-$(CONFIG_SPRUCE) := 0x00800000 | |
7888 | + misc-$(CONFIG_SPRUCE) := misc-spruce.o | |
7889 | + tftpimage-$(CONFIG_SPRUCE) := /tftpboot/zImage.$(end-y) | |
7890 | + | |
7891 | + | |
7892 | +# tftp image is prefixed with .smp if compiled for SMP | |
7893 | +tftpimage-$(CONFIG_SMP) += .smp | |
7894 | + | |
7895 | # This is a treeboot that needs init functions until the | |
7896 | # boot rom is sorted out (i.e. this is short lived) | |
7897 | -EXTRA_AFLAGS := -Wa,-m405 | |
7898 | -EXTRA := rw4/rw4_init.o rw4/rw4_init_brd.o | |
7899 | -endif | |
7900 | +extra-aflags-$(CONFIG_REDWOOD_4) := -Wa,-m405 | |
7901 | +extra.o-$(CONFIG_REDWOOD_4) := rw4/rw4_init.o rw4/rw4_init_brd.o | |
7902 | +EXTRA_AFLAGS := $(extra-aflags-y) | |
7903 | ||
7904 | # Linker args. This specifies where the image will be run at. | |
7905 | -LD_ARGS = -T $(boot)/ld.script \ | |
7906 | - -Ttext $(CONFIG_BOOT_LOAD) -Bstatic | |
7907 | +LD_ARGS := -T $(boot)/ld.script \ | |
7908 | + -Ttext $(CONFIG_BOOT_LOAD) -Bstatic | |
7909 | OBJCOPY_ARGS := -O elf32-powerpc | |
7910 | ||
7911 | # head.o and relocate.o must be at the start. | |
7912 | -boot-y := head.o relocate.o $(EXTRA) $(MISC) | |
7913 | +boot-y := head.o relocate.o $(extra.o-y) $(misc-y) | |
7914 | boot-$(CONFIG_40x) += embed_config.o | |
7915 | boot-$(CONFIG_8xx) += embed_config.o | |
7916 | boot-$(CONFIG_8260) += embed_config.o | |
7917 | @@ -160,40 +168,40 @@ | |
7918 | -R .stabstr -R .sysmap | |
7919 | ||
7920 | # Sort-of dummy rules, that let us format the image we want. | |
7921 | -zImage: $(images)/$(ZIMAGE) $(obj)/zvmlinux | |
7922 | +zImage: $(images)/$(zimage-y) $(obj)/zvmlinux | |
7923 | cp -f $(obj)/zvmlinux $(images)/zImage.elf | |
7924 | rm -f $(obj)/zvmlinux | |
7925 | ||
7926 | -zImage.initrd: $(images)/$(ZIMAGEINITRD) $(obj)/zvmlinux.initrd | |
7927 | +zImage.initrd: $(images)/$(zimageinitrd-y) $(obj)/zvmlinux.initrd | |
7928 | cp -f $(obj)/zvmlinux.initrd $(images)/zImage.initrd.elf | |
7929 | rm -f $(obj)/zvmlinux.initrd | |
7930 | ||
7931 | znetboot: zImage | |
7932 | ifneq ($(ZNETBOOT),) | |
7933 | - cp $(images)/$(ZNETBOOT) $(TFTPIMAGE) | |
7934 | + cp $(images)/$(ZNETBOOT) $(tftpimage-y) | |
7935 | else | |
7936 | - cp $(images)/zImage.* $(TFTPIMAGE) | |
7937 | + cp $(images)/zImage.* $(tftpimage-y) | |
7938 | endif | |
7939 | ||
7940 | znetboot.initrd: zImage.initrd | |
7941 | -ifneq ($(ZNETBOOTRD),) | |
7942 | - cp $(images)/$(ZNETBOOTRD) $(TFTPIMAGE) | |
7943 | +ifneq ($(znetbootrd-y),) | |
7944 | + cp $(images)/$(znetbootrd-y) $(tftpimage-y) | |
7945 | else | |
7946 | - cp $(images)/zImage.* $(TFTPIMAGE) | |
7947 | + cp $(images)/zImage.* $(tftpimage-y) | |
7948 | endif | |
7949 | ||
7950 | $(images)/zImage-STRIPELF: $(obj)/zvmlinux | |
7951 | - dd if=$(obj)/zvmlinux of=$(images)/zImage.$(END) skip=64 bs=1k | |
7952 | + dd if=$(obj)/zvmlinux of=$(images)/zImage.$(end-y) skip=64 bs=1k | |
7953 | ||
7954 | $(images)/zImage.initrd-STRIPELF: $(obj)/zvmlinux.initrd | |
7955 | - dd if=$(obj)/zvmlinux.initrd of=$(images)/zImage.initrd.$(END) \ | |
7956 | + dd if=$(obj)/zvmlinux.initrd of=$(images)/zImage.initrd.$(end-y) \ | |
7957 | skip=64 bs=1k | |
7958 | ||
7959 | $(images)/zImage-TREE: $(obj)/zvmlinux $(MKTREE) | |
7960 | - $(MKTREE) $(obj)/zvmlinux $(images)/zImage.$(END) $(ENTRYPOINT) | |
7961 | + $(MKTREE) $(obj)/zvmlinux $(images)/zImage.$(end-y) $(ENTRYPOINT) | |
7962 | ||
7963 | $(images)/zImage.initrd-TREE: $(obj)/zvmlinux.initrd $(MKTREE) | |
7964 | - $(MKTREE) $(obj)/zvmlinux.initrd $(images)/zImage.initrd.$(END) \ | |
7965 | + $(MKTREE) $(obj)/zvmlinux.initrd $(images)/zImage.initrd.$(end-y) \ | |
7966 | $(ENTRYPOINT) | |
7967 | ||
7968 | $(images)/zImage-PPLUS: $(obj)/zvmlinux $(MKPREP) $(MKBUGBOOT) | |
7969 | diff -Nru a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c | |
7970 | --- a/arch/ppc/boot/simple/embed_config.c Sat Mar 22 17:18:48 2003 | |
7971 | +++ b/arch/ppc/boot/simple/embed_config.c Thu Aug 21 10:17:00 2003 | |
7972 | @@ -20,6 +20,7 @@ | |
7973 | #ifdef CONFIG_40x | |
7974 | #include <asm/io.h> | |
7975 | #endif | |
7976 | +extern unsigned long timebase_period_ns; | |
7977 | ||
7978 | /* For those boards that don't provide one. | |
7979 | */ | |
7980 | @@ -768,6 +769,7 @@ | |
7981 | #if defined(CONFIG_REDWOOD_5) || defined (CONFIG_REDWOOD_6) | |
7982 | bd->bi_tbfreq = 27 * 1000 * 1000; | |
7983 | #endif | |
7984 | + timebase_period_ns = 1000000000 / bd->bi_tbfreq; | |
7985 | } | |
7986 | #endif /* CONFIG_BEECH */ | |
7987 | #endif /* CONFIG_IBM_OPENBIOS */ | |
7988 | diff -Nru a/arch/ppc/boot/simple/misc-embedded.c b/arch/ppc/boot/simple/misc-embedded.c | |
7989 | --- a/arch/ppc/boot/simple/misc-embedded.c Thu Jun 5 18:06:12 2003 | |
7990 | +++ b/arch/ppc/boot/simple/misc-embedded.c Wed Aug 20 15:44:31 2003 | |
7991 | @@ -75,7 +75,7 @@ | |
7992 | extern void embed_config(bd_t **bp); | |
7993 | ||
7994 | unsigned long | |
7995 | -decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *bp) | |
7996 | +load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *bp) | |
7997 | { | |
7998 | char *cp, ch; | |
7999 | int timer = 0, zimage_size; | |
8000 | diff -Nru a/arch/ppc/boot/simple/misc-spruce.c b/arch/ppc/boot/simple/misc-spruce.c | |
8001 | --- a/arch/ppc/boot/simple/misc-spruce.c Tue Feb 11 15:48:52 2003 | |
8002 | +++ b/arch/ppc/boot/simple/misc-spruce.c Wed Aug 20 15:44:31 2003 | |
8003 | @@ -147,7 +147,7 @@ | |
8004 | #define MEM_B2EA 0x60 | |
8005 | ||
8006 | unsigned long | |
8007 | -decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum) | |
8008 | +load_kernel(unsigned long load_addr, int num_words, unsigned long cksum) | |
8009 | { | |
8010 | int timer = 0; | |
8011 | char *cp, ch; | |
8012 | diff -Nru a/arch/ppc/boot/simple/misc.c b/arch/ppc/boot/simple/misc.c | |
8013 | --- a/arch/ppc/boot/simple/misc.c Tue Feb 11 15:48:52 2003 | |
8014 | +++ b/arch/ppc/boot/simple/misc.c Wed Sep 3 05:16:34 2003 | |
8015 | @@ -25,6 +25,9 @@ | |
8016 | #include <asm/processor.h> | |
8017 | #include <asm/mmu.h> | |
8018 | #include <asm/bootinfo.h> | |
8019 | +#ifdef CONFIG_44x | |
8020 | +#include <asm/ibm4xx.h> | |
8021 | +#endif | |
8022 | ||
8023 | #include "nonstdio.h" | |
8024 | #include "zlib.h" | |
8025 | @@ -80,6 +83,16 @@ | |
8026 | serial_fixups(); | |
8027 | com_port = serial_init(0, NULL); | |
8028 | ||
8029 | +#ifdef CONFIG_44x | |
8030 | + /* Reset MAL */ | |
8031 | + mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR); | |
8032 | + /* Wait for reset */ | |
8033 | + while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {}; | |
8034 | + /* Reset EMAC */ | |
8035 | + *(volatile unsigned long *)PPC44x_EMAC0_MR0 = 0x20000000; | |
8036 | + __asm__ __volatile__("eieio"); | |
8037 | +#endif | |
8038 | + | |
8039 | #if defined(CONFIG_LOPEC) || defined(CONFIG_PAL4) | |
8040 | /* | |
8041 | * Call get_mem_size(), which is memory controller dependent, | |
8042 | @@ -251,4 +264,11 @@ | |
8043 | serial_close(com_port); | |
8044 | ||
8045 | return (struct bi_record *)rec_loc; | |
8046 | +} | |
8047 | + | |
8048 | +/* Allow decompress_kernel to be hooked into. This is the default. */ | |
8049 | +void * __attribute__ ((weak)) | |
8050 | +load_kernel(unsigned long load_addr, int num_words, unsigned long cksum) | |
8051 | +{ | |
8052 | + return decompress_kernel(load_addr, num_words, cksum); | |
8053 | } | |
8054 | diff -Nru a/arch/ppc/boot/simple/relocate.S b/arch/ppc/boot/simple/relocate.S | |
8055 | --- a/arch/ppc/boot/simple/relocate.S Tue Feb 11 15:48:52 2003 | |
8056 | +++ b/arch/ppc/boot/simple/relocate.S Wed Aug 20 15:44:31 2003 | |
8057 | @@ -183,7 +183,7 @@ | |
8058 | mr r4,r7 /* Program length */ | |
8059 | mr r5,r6 /* Checksum */ | |
8060 | mr r6,r11 /* Residual data */ | |
8061 | - bl decompress_kernel | |
8062 | + bl load_kernel | |
8063 | ||
8064 | /* | |
8065 | * Make sure the kernel knows we don't have things set in | |
8066 | diff -Nru a/arch/ppc/boot/utils/mktree.c b/arch/ppc/boot/utils/mktree.c | |
8067 | --- a/arch/ppc/boot/utils/mktree.c Sun Sep 15 21:51:58 2002 | |
8068 | +++ b/arch/ppc/boot/utils/mktree.c Thu Aug 21 15:00:42 2003 | |
8069 | @@ -86,7 +86,7 @@ | |
8070 | } | |
8071 | ||
8072 | cksum = 0; | |
8073 | - cp = (uint *)&bt; | |
8074 | + cp = (void *)&bt; | |
8075 | for (i=0; i<sizeof(bt)/sizeof(uint); i++) | |
8076 | cksum += *cp++; | |
8077 | ||
8078 | diff -Nru a/arch/ppc/configs/common_defconfig b/arch/ppc/configs/common_defconfig | |
8079 | --- a/arch/ppc/configs/common_defconfig Sat Aug 2 13:06:57 2003 | |
8080 | +++ b/arch/ppc/configs/common_defconfig Sat Aug 23 02:33:38 2003 | |
8081 | @@ -9,6 +9,7 @@ | |
8082 | # Code maturity level options | |
8083 | # | |
8084 | CONFIG_EXPERIMENTAL=y | |
8085 | +# CONFIG_BROKEN is not set | |
8086 | ||
8087 | # | |
8088 | # General setup | |
8089 | @@ -18,9 +19,15 @@ | |
8090 | # CONFIG_BSD_PROCESS_ACCT is not set | |
8091 | CONFIG_SYSCTL=y | |
8092 | CONFIG_LOG_BUF_SHIFT=14 | |
8093 | +CONFIG_IKCONFIG=y | |
8094 | +CONFIG_IKCONFIG_PROC=y | |
8095 | # CONFIG_EMBEDDED is not set | |
8096 | +CONFIG_KALLSYMS=y | |
8097 | CONFIG_FUTEX=y | |
8098 | CONFIG_EPOLL=y | |
8099 | +CONFIG_IOSCHED_NOOP=y | |
8100 | +CONFIG_IOSCHED_AS=y | |
8101 | +CONFIG_IOSCHED_DEADLINE=y | |
8102 | ||
8103 | # | |
8104 | # Loadable module support | |
8105 | @@ -86,8 +93,8 @@ | |
8106 | CONFIG_PCI=y | |
8107 | CONFIG_PCI_DOMAINS=y | |
8108 | CONFIG_KCORE_ELF=y | |
8109 | -CONFIG_BINFMT_ELF=y | |
8110 | CONFIG_KERNEL_ELF=y | |
8111 | +CONFIG_BINFMT_ELF=y | |
8112 | CONFIG_BINFMT_MISC=m | |
8113 | CONFIG_PCI_LEGACY_PROC=y | |
8114 | CONFIG_PCI_NAMES=y | |
8115 | @@ -126,6 +133,11 @@ | |
8116 | CONFIG_BOOT_LOAD=0x00800000 | |
8117 | ||
8118 | # | |
8119 | +# Generic Driver Options | |
8120 | +# | |
8121 | +# CONFIG_FW_LOADER is not set | |
8122 | + | |
8123 | +# | |
8124 | # Memory Technology Devices (MTD) | |
8125 | # | |
8126 | # CONFIG_MTD is not set | |
8127 | @@ -144,10 +156,12 @@ | |
8128 | # CONFIG_BLK_DEV_DAC960 is not set | |
8129 | # CONFIG_BLK_DEV_UMEM is not set | |
8130 | CONFIG_BLK_DEV_LOOP=y | |
8131 | +# CONFIG_BLK_DEV_CRYPTOLOOP is not set | |
8132 | # CONFIG_BLK_DEV_NBD is not set | |
8133 | CONFIG_BLK_DEV_RAM=y | |
8134 | CONFIG_BLK_DEV_RAM_SIZE=4096 | |
8135 | CONFIG_BLK_DEV_INITRD=y | |
8136 | +CONFIG_LBD=y | |
8137 | ||
8138 | # | |
8139 | # Multi-device support (RAID and LVM) | |
8140 | @@ -155,40 +169,38 @@ | |
8141 | # CONFIG_MD is not set | |
8142 | ||
8143 | # | |
8144 | -# ATA/IDE/MFM/RLL support | |
8145 | +# ATA/ATAPI/MFM/RLL support | |
8146 | # | |
8147 | CONFIG_IDE=y | |
8148 | - | |
8149 | -# | |
8150 | -# IDE, ATA and ATAPI Block devices | |
8151 | -# | |
8152 | CONFIG_BLK_DEV_IDE=y | |
8153 | ||
8154 | # | |
8155 | # Please see Documentation/ide.txt for help/info on IDE drives | |
8156 | # | |
8157 | -# CONFIG_BLK_DEV_HD is not set | |
8158 | CONFIG_BLK_DEV_IDEDISK=y | |
8159 | # CONFIG_IDEDISK_MULTI_MODE is not set | |
8160 | # CONFIG_IDEDISK_STROKE is not set | |
8161 | CONFIG_BLK_DEV_IDECD=y | |
8162 | +# CONFIG_BLK_DEV_IDETAPE is not set | |
8163 | CONFIG_BLK_DEV_IDEFLOPPY=y | |
8164 | CONFIG_BLK_DEV_IDESCSI=y | |
8165 | # CONFIG_IDE_TASK_IOCTL is not set | |
8166 | +# CONFIG_IDE_TASKFILE_IO is not set | |
8167 | ||
8168 | # | |
8169 | # IDE chipset support/bugfixes | |
8170 | # | |
8171 | CONFIG_BLK_DEV_IDEPCI=y | |
8172 | -CONFIG_BLK_DEV_GENERIC=y | |
8173 | CONFIG_IDEPCI_SHARE_IRQ=y | |
8174 | +# CONFIG_BLK_DEV_OFFBOARD is not set | |
8175 | +CONFIG_BLK_DEV_GENERIC=y | |
8176 | +# CONFIG_BLK_DEV_OPTI621 is not set | |
8177 | +CONFIG_BLK_DEV_SL82C105=y | |
8178 | CONFIG_BLK_DEV_IDEDMA_PCI=y | |
8179 | # CONFIG_BLK_DEV_IDE_TCQ is not set | |
8180 | -# CONFIG_BLK_DEV_OFFBOARD is not set | |
8181 | # CONFIG_BLK_DEV_IDEDMA_FORCED is not set | |
8182 | CONFIG_IDEDMA_PCI_AUTO=y | |
8183 | # CONFIG_IDEDMA_ONLYDISK is not set | |
8184 | -CONFIG_BLK_DEV_IDEDMA=y | |
8185 | # CONFIG_IDEDMA_PCI_WIP is not set | |
8186 | CONFIG_BLK_DEV_ADMA=y | |
8187 | # CONFIG_BLK_DEV_AEC62XX is not set | |
8188 | @@ -198,12 +210,12 @@ | |
8189 | # CONFIG_BLK_DEV_TRIFLEX is not set | |
8190 | # CONFIG_BLK_DEV_CY82C693 is not set | |
8191 | # CONFIG_BLK_DEV_CS5520 is not set | |
8192 | +# CONFIG_BLK_DEV_CS5530 is not set | |
8193 | # CONFIG_BLK_DEV_HPT34X is not set | |
8194 | # CONFIG_BLK_DEV_HPT366 is not set | |
8195 | # CONFIG_BLK_DEV_SC1200 is not set | |
8196 | # CONFIG_BLK_DEV_PIIX is not set | |
8197 | # CONFIG_BLK_DEV_NS87415 is not set | |
8198 | -# CONFIG_BLK_DEV_OPTI621 is not set | |
8199 | # CONFIG_BLK_DEV_PDC202XX_OLD is not set | |
8200 | CONFIG_BLK_DEV_PDC202XX_NEW=y | |
8201 | # CONFIG_PDC202XX_FORCE is not set | |
8202 | @@ -212,15 +224,17 @@ | |
8203 | # CONFIG_BLK_DEV_SLC90E66 is not set | |
8204 | # CONFIG_BLK_DEV_TRM290 is not set | |
8205 | # CONFIG_BLK_DEV_VIA82CXXX is not set | |
8206 | -CONFIG_BLK_DEV_SL82C105=y | |
8207 | CONFIG_BLK_DEV_IDE_PMAC=y | |
8208 | CONFIG_BLK_DEV_IDEDMA_PMAC=y | |
8209 | CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO=y | |
8210 | -CONFIG_IDEDMA_AUTO=y | |
8211 | +CONFIG_BLK_DEV_IDEDMA=y | |
8212 | # CONFIG_IDEDMA_IVB is not set | |
8213 | +CONFIG_IDEDMA_AUTO=y | |
8214 | +# CONFIG_DMA_NONPCI is not set | |
8215 | +# CONFIG_BLK_DEV_HD is not set | |
8216 | ||
8217 | # | |
8218 | -# SCSI support | |
8219 | +# SCSI device support | |
8220 | # | |
8221 | CONFIG_SCSI=y | |
8222 | ||
8223 | @@ -260,8 +274,6 @@ | |
8224 | # CONFIG_SCSI_AIC79XX is not set | |
8225 | # CONFIG_SCSI_DPT_I2O is not set | |
8226 | CONFIG_SCSI_ADVANSYS=m | |
8227 | -# CONFIG_SCSI_IN2000 is not set | |
8228 | -# CONFIG_SCSI_AM53C974 is not set | |
8229 | # CONFIG_SCSI_MEGARAID is not set | |
8230 | # CONFIG_SCSI_BUSLOGIC is not set | |
8231 | # CONFIG_SCSI_CPQFCTS is not set | |
8232 | @@ -270,11 +282,8 @@ | |
8233 | # CONFIG_SCSI_EATA_PIO is not set | |
8234 | # CONFIG_SCSI_FUTURE_DOMAIN is not set | |
8235 | # CONFIG_SCSI_GDTH is not set | |
8236 | -# CONFIG_SCSI_GENERIC_NCR5380 is not set | |
8237 | -# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set | |
8238 | # CONFIG_SCSI_INITIO is not set | |
8239 | # CONFIG_SCSI_INIA100 is not set | |
8240 | -# CONFIG_SCSI_NCR53C7xx is not set | |
8241 | CONFIG_SCSI_SYM53C8XX_2=y | |
8242 | CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 | |
8243 | CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 | |
8244 | @@ -287,7 +296,6 @@ | |
8245 | # CONFIG_SCSI_QLOGIC_1280 is not set | |
8246 | # CONFIG_SCSI_DC395x is not set | |
8247 | # CONFIG_SCSI_DC390T is not set | |
8248 | -# CONFIG_SCSI_U14_34F is not set | |
8249 | # CONFIG_SCSI_NSP32 is not set | |
8250 | # CONFIG_SCSI_DEBUG is not set | |
8251 | CONFIG_SCSI_MESH=y | |
8252 | @@ -321,8 +329,6 @@ | |
8253 | CONFIG_PACKET=y | |
8254 | # CONFIG_PACKET_MMAP is not set | |
8255 | # CONFIG_NETLINK_DEV is not set | |
8256 | -CONFIG_NETFILTER=y | |
8257 | -# CONFIG_NETFILTER_DEBUG is not set | |
8258 | CONFIG_UNIX=y | |
8259 | # CONFIG_NET_KEY is not set | |
8260 | CONFIG_INET=y | |
8261 | @@ -340,6 +346,16 @@ | |
8262 | # CONFIG_INET_IPCOMP is not set | |
8263 | ||
8264 | # | |
8265 | +# IP: Virtual Server Configuration | |
8266 | +# | |
8267 | +# CONFIG_IP_VS is not set | |
8268 | +# CONFIG_IPV6 is not set | |
8269 | +# CONFIG_DECNET is not set | |
8270 | +# CONFIG_BRIDGE is not set | |
8271 | +CONFIG_NETFILTER=y | |
8272 | +# CONFIG_NETFILTER_DEBUG is not set | |
8273 | + | |
8274 | +# | |
8275 | # IP: Netfilter Configuration | |
8276 | # | |
8277 | CONFIG_IP_NF_CONNTRACK=m | |
8278 | @@ -355,6 +371,7 @@ | |
8279 | CONFIG_IP_NF_MATCH_MARK=m | |
8280 | CONFIG_IP_NF_MATCH_MULTIPORT=m | |
8281 | CONFIG_IP_NF_MATCH_TOS=m | |
8282 | +CONFIG_IP_NF_MATCH_RECENT=m | |
8283 | CONFIG_IP_NF_MATCH_ECN=m | |
8284 | CONFIG_IP_NF_MATCH_DSCP=m | |
8285 | CONFIG_IP_NF_MATCH_AH_ESP=m | |
8286 | @@ -386,8 +403,6 @@ | |
8287 | # CONFIG_IP_NF_ARPTABLES is not set | |
8288 | CONFIG_IP_NF_COMPAT_IPCHAINS=m | |
8289 | # CONFIG_IP_NF_COMPAT_IPFWADM is not set | |
8290 | -# CONFIG_IPV6 is not set | |
8291 | -# CONFIG_XFRM_USER is not set | |
8292 | ||
8293 | # | |
8294 | # SCTP Configuration (EXPERIMENTAL) | |
8295 | @@ -397,8 +412,6 @@ | |
8296 | # CONFIG_ATM is not set | |
8297 | # CONFIG_VLAN_8021Q is not set | |
8298 | # CONFIG_LLC is not set | |
8299 | -# CONFIG_DECNET is not set | |
8300 | -# CONFIG_BRIDGE is not set | |
8301 | # CONFIG_X25 is not set | |
8302 | # CONFIG_LAPB is not set | |
8303 | # CONFIG_NET_DIVERT is not set | |
8304 | @@ -482,6 +495,7 @@ | |
8305 | # CONFIG_HAMACHI is not set | |
8306 | # CONFIG_YELLOWFIN is not set | |
8307 | # CONFIG_R8169 is not set | |
8308 | +# CONFIG_SIS190 is not set | |
8309 | # CONFIG_SK98LIN is not set | |
8310 | # CONFIG_TIGON3 is not set | |
8311 | ||
8312 | @@ -553,7 +567,7 @@ | |
8313 | # Graphics support | |
8314 | # | |
8315 | CONFIG_FB=y | |
8316 | -CONFIG_FB_CIRRUS=y | |
8317 | +# CONFIG_FB_CIRRUS is not set | |
8318 | # CONFIG_FB_PM2 is not set | |
8319 | # CONFIG_FB_CYBER2000 is not set | |
8320 | CONFIG_FB_OF=y | |
8321 | @@ -606,11 +620,6 @@ | |
8322 | CONFIG_LOGO_LINUX_CLUT224=y | |
8323 | ||
8324 | # | |
8325 | -# Old CD-ROM drivers (not SCSI, not IDE) | |
8326 | -# | |
8327 | -# CONFIG_CD_NO_IDESCSI is not set | |
8328 | - | |
8329 | -# | |
8330 | # Input device support | |
8331 | # | |
8332 | CONFIG_INPUT=y | |
8333 | @@ -636,6 +645,7 @@ | |
8334 | CONFIG_SERIO_I8042=y | |
8335 | # CONFIG_SERIO_SERPORT is not set | |
8336 | # CONFIG_SERIO_CT82C710 is not set | |
8337 | +# CONFIG_SERIO_PCIPS2 is not set | |
8338 | ||
8339 | # | |
8340 | # Input Device Drivers | |
8341 | @@ -703,10 +713,12 @@ | |
8342 | # | |
8343 | # I2C Hardware Sensors Mainboard support | |
8344 | # | |
8345 | +# CONFIG_I2C_ALI1535 is not set | |
8346 | # CONFIG_I2C_ALI15X3 is not set | |
8347 | # CONFIG_I2C_AMD756 is not set | |
8348 | # CONFIG_I2C_AMD8111 is not set | |
8349 | # CONFIG_I2C_I801 is not set | |
8350 | +# CONFIG_I2C_NFORCE2 is not set | |
8351 | # CONFIG_I2C_PIIX4 is not set | |
8352 | # CONFIG_I2C_SIS96X is not set | |
8353 | # CONFIG_I2C_VIAPRO is not set | |
8354 | @@ -718,6 +730,7 @@ | |
8355 | # CONFIG_SENSORS_IT87 is not set | |
8356 | # CONFIG_SENSORS_LM75 is not set | |
8357 | # CONFIG_SENSORS_LM85 is not set | |
8358 | +# CONFIG_SENSORS_LM78 is not set | |
8359 | # CONFIG_SENSORS_VIA686A is not set | |
8360 | # CONFIG_SENSORS_W83781D is not set | |
8361 | # CONFIG_I2C_SENSOR is not set | |
8362 | @@ -913,13 +926,70 @@ | |
8363 | # Sound | |
8364 | # | |
8365 | CONFIG_SOUND=m | |
8366 | -CONFIG_DMASOUND_AWACS=m | |
8367 | -CONFIG_DMASOUND=m | |
8368 | +# CONFIG_DMASOUND_AWACS is not set | |
8369 | ||
8370 | # | |
8371 | # Advanced Linux Sound Architecture | |
8372 | # | |
8373 | -# CONFIG_SND is not set | |
8374 | +CONFIG_SND=m | |
8375 | +CONFIG_SND_SEQUENCER=m | |
8376 | +# CONFIG_SND_SEQ_DUMMY is not set | |
8377 | +CONFIG_SND_OSSEMUL=y | |
8378 | +CONFIG_SND_MIXER_OSS=m | |
8379 | +CONFIG_SND_PCM_OSS=m | |
8380 | +CONFIG_SND_SEQUENCER_OSS=y | |
8381 | +# CONFIG_SND_VERBOSE_PRINTK is not set | |
8382 | +# CONFIG_SND_DEBUG is not set | |
8383 | + | |
8384 | +# | |
8385 | +# Generic devices | |
8386 | +# | |
8387 | +# CONFIG_SND_DUMMY is not set | |
8388 | +# CONFIG_SND_VIRMIDI is not set | |
8389 | +# CONFIG_SND_MTPAV is not set | |
8390 | +# CONFIG_SND_SERIAL_U16550 is not set | |
8391 | +# CONFIG_SND_MPU401 is not set | |
8392 | + | |
8393 | +# | |
8394 | +# PCI devices | |
8395 | +# | |
8396 | +# CONFIG_SND_ALI5451 is not set | |
8397 | +# CONFIG_SND_AZT3328 is not set | |
8398 | +# CONFIG_SND_CS46XX is not set | |
8399 | +# CONFIG_SND_CS4281 is not set | |
8400 | +# CONFIG_SND_EMU10K1 is not set | |
8401 | +# CONFIG_SND_KORG1212 is not set | |
8402 | +# CONFIG_SND_NM256 is not set | |
8403 | +# CONFIG_SND_RME32 is not set | |
8404 | +# CONFIG_SND_RME96 is not set | |
8405 | +# CONFIG_SND_RME9652 is not set | |
8406 | +# CONFIG_SND_HDSP is not set | |
8407 | +# CONFIG_SND_TRIDENT is not set | |
8408 | +# CONFIG_SND_YMFPCI is not set | |
8409 | +# CONFIG_SND_ALS4000 is not set | |
8410 | +# CONFIG_SND_CMIPCI is not set | |
8411 | +# CONFIG_SND_ENS1370 is not set | |
8412 | +# CONFIG_SND_ENS1371 is not set | |
8413 | +# CONFIG_SND_ES1938 is not set | |
8414 | +# CONFIG_SND_ES1968 is not set | |
8415 | +# CONFIG_SND_MAESTRO3 is not set | |
8416 | +# CONFIG_SND_FM801 is not set | |
8417 | +# CONFIG_SND_ICE1712 is not set | |
8418 | +# CONFIG_SND_ICE1724 is not set | |
8419 | +# CONFIG_SND_INTEL8X0 is not set | |
8420 | +# CONFIG_SND_SONICVIBES is not set | |
8421 | +# CONFIG_SND_VIA82XX is not set | |
8422 | +# CONFIG_SND_VX222 is not set | |
8423 | + | |
8424 | +# | |
8425 | +# ALSA PowerMac devices | |
8426 | +# | |
8427 | +CONFIG_SND_POWERMAC=m | |
8428 | + | |
8429 | +# | |
8430 | +# ALSA USB devices | |
8431 | +# | |
8432 | +CONFIG_SND_USB_AUDIO=m | |
8433 | ||
8434 | # | |
8435 | # Open Sound System | |
8436 | @@ -998,6 +1068,7 @@ | |
8437 | # | |
8438 | # USB Network adaptors | |
8439 | # | |
8440 | +# CONFIG_USB_AX8817X is not set | |
8441 | # CONFIG_USB_CATC is not set | |
8442 | # CONFIG_USB_KAWETH is not set | |
8443 | # CONFIG_USB_PEGASUS is not set | |
8444 | @@ -1074,7 +1145,6 @@ | |
8445 | # Kernel hacking | |
8446 | # | |
8447 | # CONFIG_DEBUG_KERNEL is not set | |
8448 | -CONFIG_KALLSYMS=y | |
8449 | CONFIG_BOOTX_TEXT=y | |
8450 | ||
8451 | # | |
8452 | diff -Nru a/arch/ppc/configs/ebony_defconfig b/arch/ppc/configs/ebony_defconfig | |
8453 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
8454 | +++ b/arch/ppc/configs/ebony_defconfig Wed Sep 3 05:16:34 2003 | |
8455 | @@ -0,0 +1,560 @@ | |
8456 | +# | |
8457 | +# Automatically generated make config: don't edit | |
8458 | +# | |
8459 | +CONFIG_MMU=y | |
8460 | +CONFIG_RWSEM_XCHGADD_ALGORITHM=y | |
8461 | +CONFIG_HAVE_DEC_LOCK=y | |
8462 | + | |
8463 | +# | |
8464 | +# Code maturity level options | |
8465 | +# | |
8466 | +CONFIG_EXPERIMENTAL=y | |
8467 | +CONFIG_CLEAN_COMPILE=y | |
8468 | +CONFIG_BROKEN_ON_SMP=y | |
8469 | + | |
8470 | +# | |
8471 | +# General setup | |
8472 | +# | |
8473 | +CONFIG_SWAP=y | |
8474 | +CONFIG_SYSVIPC=y | |
8475 | +# CONFIG_BSD_PROCESS_ACCT is not set | |
8476 | +CONFIG_SYSCTL=y | |
8477 | +CONFIG_LOG_BUF_SHIFT=14 | |
8478 | +# CONFIG_IKCONFIG is not set | |
8479 | +# CONFIG_EMBEDDED is not set | |
8480 | +CONFIG_KALLSYMS=y | |
8481 | +CONFIG_FUTEX=y | |
8482 | +CONFIG_EPOLL=y | |
8483 | +CONFIG_IOSCHED_NOOP=y | |
8484 | +CONFIG_IOSCHED_AS=y | |
8485 | +CONFIG_IOSCHED_DEADLINE=y | |
8486 | + | |
8487 | +# | |
8488 | +# Loadable module support | |
8489 | +# | |
8490 | +CONFIG_MODULES=y | |
8491 | +# CONFIG_MODULE_UNLOAD is not set | |
8492 | +CONFIG_OBSOLETE_MODPARM=y | |
8493 | +# CONFIG_MODVERSIONS is not set | |
8494 | +CONFIG_KMOD=y | |
8495 | + | |
8496 | +# | |
8497 | +# Platform support | |
8498 | +# | |
8499 | +CONFIG_PPC=y | |
8500 | +CONFIG_PPC32=y | |
8501 | +# CONFIG_6xx is not set | |
8502 | +# CONFIG_40x is not set | |
8503 | +CONFIG_44x=y | |
8504 | +# CONFIG_POWER3 is not set | |
8505 | +# CONFIG_8xx is not set | |
8506 | +CONFIG_PTE_64BIT=y | |
8507 | +CONFIG_4xx=y | |
8508 | + | |
8509 | +# | |
8510 | +# IBM 4xx options | |
8511 | +# | |
8512 | +CONFIG_EBONY=y | |
8513 | +# CONFIG_OCOTEA is not set | |
8514 | +CONFIG_440GP=y | |
8515 | +CONFIG_440=y | |
8516 | +CONFIG_PIN_TLB=y | |
8517 | +CONFIG_BOOKE=y | |
8518 | +CONFIG_IBM_OCP=y | |
8519 | +# CONFIG_PM is not set | |
8520 | +CONFIG_NOT_COHERENT_CACHE=y | |
8521 | +# CONFIG_SMP is not set | |
8522 | +# CONFIG_PREEMPT is not set | |
8523 | +# CONFIG_MATH_EMULATION is not set | |
8524 | +# CONFIG_CPU_FREQ is not set | |
8525 | + | |
8526 | +# | |
8527 | +# General setup | |
8528 | +# | |
8529 | +# CONFIG_HIGHMEM is not set | |
8530 | +CONFIG_PCI=y | |
8531 | +CONFIG_PCI_DOMAINS=y | |
8532 | +# CONFIG_PC_KEYBOARD is not set | |
8533 | +CONFIG_KERNEL_ELF=y | |
8534 | +CONFIG_BINFMT_ELF=y | |
8535 | +# CONFIG_BINFMT_MISC is not set | |
8536 | +# CONFIG_PCI_LEGACY_PROC is not set | |
8537 | +# CONFIG_PCI_NAMES is not set | |
8538 | +# CONFIG_HOTPLUG is not set | |
8539 | + | |
8540 | +# | |
8541 | +# Parallel port support | |
8542 | +# | |
8543 | +# CONFIG_PARPORT is not set | |
8544 | +CONFIG_CMDLINE_BOOL=y | |
8545 | +CONFIG_CMDLINE="ip=on" | |
8546 | + | |
8547 | +# | |
8548 | +# Advanced setup | |
8549 | +# | |
8550 | +# CONFIG_ADVANCED_OPTIONS is not set | |
8551 | + | |
8552 | +# | |
8553 | +# Default settings for advanced configuration options are used | |
8554 | +# | |
8555 | +CONFIG_HIGHMEM_START=0xfe000000 | |
8556 | +CONFIG_LOWMEM_SIZE=0x30000000 | |
8557 | +CONFIG_KERNEL_START=0xc0000000 | |
8558 | +CONFIG_TASK_SIZE=0x80000000 | |
8559 | +CONFIG_BOOT_LOAD=0x01000000 | |
8560 | + | |
8561 | +# | |
8562 | +# Generic Driver Options | |
8563 | +# | |
8564 | + | |
8565 | +# | |
8566 | +# Memory Technology Devices (MTD) | |
8567 | +# | |
8568 | +# CONFIG_MTD is not set | |
8569 | + | |
8570 | +# | |
8571 | +# Plug and Play support | |
8572 | +# | |
8573 | +# CONFIG_PNP is not set | |
8574 | + | |
8575 | +# | |
8576 | +# Block devices | |
8577 | +# | |
8578 | +# CONFIG_BLK_DEV_FD is not set | |
8579 | +# CONFIG_BLK_CPQ_DA is not set | |
8580 | +# CONFIG_BLK_CPQ_CISS_DA is not set | |
8581 | +# CONFIG_BLK_DEV_DAC960 is not set | |
8582 | +# CONFIG_BLK_DEV_UMEM is not set | |
8583 | +# CONFIG_BLK_DEV_LOOP is not set | |
8584 | +# CONFIG_BLK_DEV_NBD is not set | |
8585 | +# CONFIG_BLK_DEV_RAM is not set | |
8586 | +# CONFIG_BLK_DEV_INITRD is not set | |
8587 | +CONFIG_LBD=y | |
8588 | + | |
8589 | +# | |
8590 | +# Multi-device support (RAID and LVM) | |
8591 | +# | |
8592 | +# CONFIG_MD is not set | |
8593 | + | |
8594 | +# | |
8595 | +# ATA/ATAPI/MFM/RLL support | |
8596 | +# | |
8597 | +# CONFIG_IDE is not set | |
8598 | + | |
8599 | +# | |
8600 | +# SCSI device support | |
8601 | +# | |
8602 | +# CONFIG_SCSI is not set | |
8603 | + | |
8604 | +# | |
8605 | +# Fusion MPT device support | |
8606 | +# | |
8607 | + | |
8608 | +# | |
8609 | +# IEEE 1394 (FireWire) support (EXPERIMENTAL) | |
8610 | +# | |
8611 | +# CONFIG_IEEE1394 is not set | |
8612 | + | |
8613 | +# | |
8614 | +# I2O device support | |
8615 | +# | |
8616 | +# CONFIG_I2O is not set | |
8617 | + | |
8618 | +# | |
8619 | +# Networking support | |
8620 | +# | |
8621 | +CONFIG_NET=y | |
8622 | + | |
8623 | +# | |
8624 | +# Networking options | |
8625 | +# | |
8626 | +CONFIG_PACKET=y | |
8627 | +# CONFIG_PACKET_MMAP is not set | |
8628 | +# CONFIG_NETLINK_DEV is not set | |
8629 | +CONFIG_UNIX=y | |
8630 | +# CONFIG_NET_KEY is not set | |
8631 | +CONFIG_INET=y | |
8632 | +# CONFIG_IP_MULTICAST is not set | |
8633 | +# CONFIG_IP_ADVANCED_ROUTER is not set | |
8634 | +CONFIG_IP_PNP=y | |
8635 | +# CONFIG_IP_PNP_DHCP is not set | |
8636 | +CONFIG_IP_PNP_BOOTP=y | |
8637 | +# CONFIG_IP_PNP_RARP is not set | |
8638 | +# CONFIG_NET_IPIP is not set | |
8639 | +# CONFIG_NET_IPGRE is not set | |
8640 | +# CONFIG_ARPD is not set | |
8641 | +# CONFIG_INET_ECN is not set | |
8642 | +# CONFIG_SYN_COOKIES is not set | |
8643 | +# CONFIG_INET_AH is not set | |
8644 | +# CONFIG_INET_ESP is not set | |
8645 | +# CONFIG_INET_IPCOMP is not set | |
8646 | + | |
8647 | +# | |
8648 | +# IP: Virtual Server Configuration | |
8649 | +# | |
8650 | +# CONFIG_IP_VS is not set | |
8651 | +# CONFIG_IPV6 is not set | |
8652 | +# CONFIG_DECNET is not set | |
8653 | +# CONFIG_BRIDGE is not set | |
8654 | +CONFIG_NETFILTER=y | |
8655 | +# CONFIG_NETFILTER_DEBUG is not set | |
8656 | + | |
8657 | +# | |
8658 | +# IP: Netfilter Configuration | |
8659 | +# | |
8660 | +# CONFIG_IP_NF_CONNTRACK is not set | |
8661 | +# CONFIG_IP_NF_QUEUE is not set | |
8662 | +# CONFIG_IP_NF_IPTABLES is not set | |
8663 | +# CONFIG_IP_NF_ARPTABLES is not set | |
8664 | +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set | |
8665 | +# CONFIG_IP_NF_COMPAT_IPFWADM is not set | |
8666 | + | |
8667 | +# | |
8668 | +# SCTP Configuration (EXPERIMENTAL) | |
8669 | +# | |
8670 | +CONFIG_IPV6_SCTP__=y | |
8671 | +# CONFIG_IP_SCTP is not set | |
8672 | +# CONFIG_ATM is not set | |
8673 | +# CONFIG_VLAN_8021Q is not set | |
8674 | +# CONFIG_LLC is not set | |
8675 | +# CONFIG_X25 is not set | |
8676 | +# CONFIG_LAPB is not set | |
8677 | +# CONFIG_NET_DIVERT is not set | |
8678 | +# CONFIG_ECONET is not set | |
8679 | +# CONFIG_WAN_ROUTER is not set | |
8680 | +# CONFIG_NET_FASTROUTE is not set | |
8681 | +# CONFIG_NET_HW_FLOWCONTROL is not set | |
8682 | + | |
8683 | +# | |
8684 | +# QoS and/or fair queueing | |
8685 | +# | |
8686 | +# CONFIG_NET_SCHED is not set | |
8687 | + | |
8688 | +# | |
8689 | +# Network testing | |
8690 | +# | |
8691 | +# CONFIG_NET_PKTGEN is not set | |
8692 | +CONFIG_NETDEVICES=y | |
8693 | + | |
8694 | +# | |
8695 | +# ARCnet devices | |
8696 | +# | |
8697 | +# CONFIG_ARCNET is not set | |
8698 | +# CONFIG_DUMMY is not set | |
8699 | +# CONFIG_BONDING is not set | |
8700 | +# CONFIG_EQUALIZER is not set | |
8701 | +# CONFIG_TUN is not set | |
8702 | + | |
8703 | +# | |
8704 | +# Ethernet (10 or 100Mbit) | |
8705 | +# | |
8706 | +# CONFIG_NET_ETHERNET is not set | |
8707 | + | |
8708 | +# | |
8709 | +# Ethernet (1000 Mbit) | |
8710 | +# | |
8711 | +# CONFIG_ACENIC is not set | |
8712 | +# CONFIG_DL2K is not set | |
8713 | +# CONFIG_E1000 is not set | |
8714 | +# CONFIG_NS83820 is not set | |
8715 | +# CONFIG_HAMACHI is not set | |
8716 | +# CONFIG_YELLOWFIN is not set | |
8717 | +# CONFIG_R8169 is not set | |
8718 | +# CONFIG_SIS190 is not set | |
8719 | +# CONFIG_SK98LIN is not set | |
8720 | +# CONFIG_TIGON3 is not set | |
8721 | + | |
8722 | +# | |
8723 | +# Ethernet (10000 Mbit) | |
8724 | +# | |
8725 | +# CONFIG_IXGB is not set | |
8726 | +# CONFIG_FDDI is not set | |
8727 | +# CONFIG_HIPPI is not set | |
8728 | +# CONFIG_PPP is not set | |
8729 | +# CONFIG_SLIP is not set | |
8730 | + | |
8731 | +# | |
8732 | +# Wireless LAN (non-hamradio) | |
8733 | +# | |
8734 | +# CONFIG_NET_RADIO is not set | |
8735 | + | |
8736 | +# | |
8737 | +# Token Ring devices (depends on LLC=y) | |
8738 | +# | |
8739 | +# CONFIG_RCPCI is not set | |
8740 | +# CONFIG_SHAPER is not set | |
8741 | + | |
8742 | +# | |
8743 | +# Wan interfaces | |
8744 | +# | |
8745 | +# CONFIG_WAN is not set | |
8746 | + | |
8747 | +# | |
8748 | +# Amateur Radio support | |
8749 | +# | |
8750 | +# CONFIG_HAMRADIO is not set | |
8751 | + | |
8752 | +# | |
8753 | +# IrDA (infrared) support | |
8754 | +# | |
8755 | +# CONFIG_IRDA is not set | |
8756 | + | |
8757 | +# | |
8758 | +# ISDN subsystem | |
8759 | +# | |
8760 | +# CONFIG_ISDN_BOOL is not set | |
8761 | + | |
8762 | +# | |
8763 | +# Graphics support | |
8764 | +# | |
8765 | +# CONFIG_FB is not set | |
8766 | + | |
8767 | +# | |
8768 | +# Console display driver support | |
8769 | +# | |
8770 | +# CONFIG_VGA_CONSOLE is not set | |
8771 | +# CONFIG_MDA_CONSOLE is not set | |
8772 | +CONFIG_DUMMY_CONSOLE=y | |
8773 | + | |
8774 | +# | |
8775 | +# Input device support | |
8776 | +# | |
8777 | +CONFIG_INPUT=y | |
8778 | + | |
8779 | +# | |
8780 | +# Userland interfaces | |
8781 | +# | |
8782 | +CONFIG_INPUT_MOUSEDEV=y | |
8783 | +CONFIG_INPUT_MOUSEDEV_PSAUX=y | |
8784 | +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | |
8785 | +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | |
8786 | +# CONFIG_INPUT_JOYDEV is not set | |
8787 | +# CONFIG_INPUT_TSDEV is not set | |
8788 | +# CONFIG_INPUT_EVDEV is not set | |
8789 | +# CONFIG_INPUT_EVBUG is not set | |
8790 | + | |
8791 | +# | |
8792 | +# Input I/O drivers | |
8793 | +# | |
8794 | +# CONFIG_GAMEPORT is not set | |
8795 | +CONFIG_SOUND_GAMEPORT=y | |
8796 | +# CONFIG_SERIO is not set | |
8797 | + | |
8798 | +# | |
8799 | +# Input Device Drivers | |
8800 | +# | |
8801 | +# CONFIG_INPUT_KEYBOARD is not set | |
8802 | +# CONFIG_INPUT_MOUSE is not set | |
8803 | +# CONFIG_INPUT_JOYSTICK is not set | |
8804 | +# CONFIG_INPUT_TOUCHSCREEN is not set | |
8805 | +# CONFIG_INPUT_MISC is not set | |
8806 | + | |
8807 | +# | |
8808 | +# Macintosh device drivers | |
8809 | +# | |
8810 | + | |
8811 | +# | |
8812 | +# Character devices | |
8813 | +# | |
8814 | +CONFIG_VT=y | |
8815 | +CONFIG_VT_CONSOLE=y | |
8816 | +CONFIG_HW_CONSOLE=y | |
8817 | +# CONFIG_SERIAL_NONSTANDARD is not set | |
8818 | + | |
8819 | +# | |
8820 | +# Serial drivers | |
8821 | +# | |
8822 | +CONFIG_SERIAL_8250=y | |
8823 | +CONFIG_SERIAL_8250_CONSOLE=y | |
8824 | +CONFIG_SERIAL_8250_EXTENDED=y | |
8825 | +CONFIG_SERIAL_8250_MANY_PORTS=y | |
8826 | +CONFIG_SERIAL_8250_SHARE_IRQ=y | |
8827 | +# CONFIG_SERIAL_8250_DETECT_IRQ is not set | |
8828 | +# CONFIG_SERIAL_8250_MULTIPORT is not set | |
8829 | +# CONFIG_SERIAL_8250_RSA is not set | |
8830 | + | |
8831 | +# | |
8832 | +# Non-8250 serial port support | |
8833 | +# | |
8834 | +CONFIG_SERIAL_CORE=y | |
8835 | +CONFIG_SERIAL_CORE_CONSOLE=y | |
8836 | +CONFIG_UNIX98_PTYS=y | |
8837 | +CONFIG_UNIX98_PTY_COUNT=256 | |
8838 | + | |
8839 | +# | |
8840 | +# I2C support | |
8841 | +# | |
8842 | +# CONFIG_I2C is not set | |
8843 | + | |
8844 | +# | |
8845 | +# I2C Hardware Sensors Mainboard support | |
8846 | +# | |
8847 | + | |
8848 | +# | |
8849 | +# I2C Hardware Sensors Chip support | |
8850 | +# | |
8851 | +# CONFIG_I2C_SENSOR is not set | |
8852 | + | |
8853 | +# | |
8854 | +# Mice | |
8855 | +# | |
8856 | +# CONFIG_BUSMOUSE is not set | |
8857 | +# CONFIG_QIC02_TAPE is not set | |
8858 | + | |
8859 | +# | |
8860 | +# IPMI | |
8861 | +# | |
8862 | +# CONFIG_IPMI_HANDLER is not set | |
8863 | + | |
8864 | +# | |
8865 | +# Watchdog Cards | |
8866 | +# | |
8867 | +# CONFIG_WATCHDOG is not set | |
8868 | +# CONFIG_NVRAM is not set | |
8869 | +# CONFIG_GEN_RTC is not set | |
8870 | +# CONFIG_DTLK is not set | |
8871 | +# CONFIG_R3964 is not set | |
8872 | +# CONFIG_APPLICOM is not set | |
8873 | + | |
8874 | +# | |
8875 | +# Ftape, the floppy tape device driver | |
8876 | +# | |
8877 | +# CONFIG_FTAPE is not set | |
8878 | +# CONFIG_AGP is not set | |
8879 | +# CONFIG_DRM is not set | |
8880 | +# CONFIG_RAW_DRIVER is not set | |
8881 | +# CONFIG_HANGCHECK_TIMER is not set | |
8882 | + | |
8883 | +# | |
8884 | +# Multimedia devices | |
8885 | +# | |
8886 | +# CONFIG_VIDEO_DEV is not set | |
8887 | + | |
8888 | +# | |
8889 | +# Digital Video Broadcasting Devices | |
8890 | +# | |
8891 | +# CONFIG_DVB is not set | |
8892 | + | |
8893 | +# | |
8894 | +# File systems | |
8895 | +# | |
8896 | +# CONFIG_EXT2_FS is not set | |
8897 | +# CONFIG_EXT3_FS is not set | |
8898 | +# CONFIG_JBD is not set | |
8899 | +# CONFIG_REISERFS_FS is not set | |
8900 | +# CONFIG_JFS_FS is not set | |
8901 | +# CONFIG_XFS_FS is not set | |
8902 | +# CONFIG_MINIX_FS is not set | |
8903 | +# CONFIG_ROMFS_FS is not set | |
8904 | +# CONFIG_QUOTA is not set | |
8905 | +# CONFIG_AUTOFS_FS is not set | |
8906 | +# CONFIG_AUTOFS4_FS is not set | |
8907 | + | |
8908 | +# | |
8909 | +# CD-ROM/DVD Filesystems | |
8910 | +# | |
8911 | +# CONFIG_ISO9660_FS is not set | |
8912 | +# CONFIG_UDF_FS is not set | |
8913 | + | |
8914 | +# | |
8915 | +# DOS/FAT/NT Filesystems | |
8916 | +# | |
8917 | +# CONFIG_FAT_FS is not set | |
8918 | +# CONFIG_NTFS_FS is not set | |
8919 | + | |
8920 | +# | |
8921 | +# Pseudo filesystems | |
8922 | +# | |
8923 | +CONFIG_PROC_FS=y | |
8924 | +# CONFIG_DEVFS_FS is not set | |
8925 | +CONFIG_DEVPTS_FS=y | |
8926 | +# CONFIG_DEVPTS_FS_XATTR is not set | |
8927 | +# CONFIG_TMPFS is not set | |
8928 | +CONFIG_RAMFS=y | |
8929 | + | |
8930 | +# | |
8931 | +# Miscellaneous filesystems | |
8932 | +# | |
8933 | +# CONFIG_ADFS_FS is not set | |
8934 | +# CONFIG_AFFS_FS is not set | |
8935 | +# CONFIG_HFS_FS is not set | |
8936 | +# CONFIG_BEFS_FS is not set | |
8937 | +# CONFIG_BFS_FS is not set | |
8938 | +# CONFIG_EFS_FS is not set | |
8939 | +# CONFIG_CRAMFS is not set | |
8940 | +# CONFIG_VXFS_FS is not set | |
8941 | +# CONFIG_HPFS_FS is not set | |
8942 | +# CONFIG_QNX4FS_FS is not set | |
8943 | +# CONFIG_SYSV_FS is not set | |
8944 | +# CONFIG_UFS_FS is not set | |
8945 | + | |
8946 | +# | |
8947 | +# Network File Systems | |
8948 | +# | |
8949 | +CONFIG_NFS_FS=y | |
8950 | +# CONFIG_NFS_V3 is not set | |
8951 | +# CONFIG_NFS_V4 is not set | |
8952 | +# CONFIG_NFSD is not set | |
8953 | +CONFIG_ROOT_NFS=y | |
8954 | +CONFIG_LOCKD=y | |
8955 | +# CONFIG_EXPORTFS is not set | |
8956 | +CONFIG_SUNRPC=y | |
8957 | +# CONFIG_SUNRPC_GSS is not set | |
8958 | +# CONFIG_SMB_FS is not set | |
8959 | +# CONFIG_CIFS is not set | |
8960 | +# CONFIG_NCP_FS is not set | |
8961 | +# CONFIG_CODA_FS is not set | |
8962 | +# CONFIG_INTERMEZZO_FS is not set | |
8963 | +# CONFIG_AFS_FS is not set | |
8964 | + | |
8965 | +# | |
8966 | +# Partition Types | |
8967 | +# | |
8968 | +# CONFIG_PARTITION_ADVANCED is not set | |
8969 | +CONFIG_MSDOS_PARTITION=y | |
8970 | + | |
8971 | +# | |
8972 | +# Sound | |
8973 | +# | |
8974 | +# CONFIG_SOUND is not set | |
8975 | + | |
8976 | +# | |
8977 | +# USB support | |
8978 | +# | |
8979 | +# CONFIG_USB is not set | |
8980 | +# CONFIG_USB_GADGET is not set | |
8981 | + | |
8982 | +# | |
8983 | +# Bluetooth support | |
8984 | +# | |
8985 | +# CONFIG_BT is not set | |
8986 | + | |
8987 | +# | |
8988 | +# Library routines | |
8989 | +# | |
8990 | +CONFIG_CRC32=y | |
8991 | + | |
8992 | +# | |
8993 | +# Kernel hacking | |
8994 | +# | |
8995 | +CONFIG_DEBUG_KERNEL=y | |
8996 | +# CONFIG_DEBUG_SLAB is not set | |
8997 | +# CONFIG_MAGIC_SYSRQ is not set | |
8998 | +# CONFIG_DEBUG_SPINLOCK is not set | |
8999 | +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set | |
9000 | +# CONFIG_KGDB is not set | |
9001 | +# CONFIG_XMON is not set | |
9002 | +CONFIG_BDI_SWITCH=y | |
9003 | +# CONFIG_DEBUG_INFO is not set | |
9004 | +# CONFIG_SERIAL_TEXT_DEBUG is not set | |
9005 | +CONFIG_OCP=y | |
9006 | + | |
9007 | +# | |
9008 | +# Security options | |
9009 | +# | |
9010 | +# CONFIG_SECURITY is not set | |
9011 | + | |
9012 | +# | |
9013 | +# Cryptographic options | |
9014 | +# | |
9015 | +# CONFIG_CRYPTO is not set | |
9016 | diff -Nru a/arch/ppc/configs/ibmchrp_defconfig b/arch/ppc/configs/ibmchrp_defconfig | |
9017 | --- a/arch/ppc/configs/ibmchrp_defconfig Tue Jul 1 17:01:18 2003 | |
9018 | +++ b/arch/ppc/configs/ibmchrp_defconfig Sat Aug 23 02:33:38 2003 | |
9019 | @@ -9,6 +9,7 @@ | |
9020 | # Code maturity level options | |
9021 | # | |
9022 | CONFIG_EXPERIMENTAL=y | |
9023 | +# CONFIG_BROKEN is not set | |
9024 | ||
9025 | # | |
9026 | # General setup | |
9027 | @@ -18,9 +19,15 @@ | |
9028 | # CONFIG_BSD_PROCESS_ACCT is not set | |
9029 | CONFIG_SYSCTL=y | |
9030 | CONFIG_LOG_BUF_SHIFT=14 | |
9031 | +CONFIG_IKCONFIG=y | |
9032 | +CONFIG_IKCONFIG_PROC=y | |
9033 | # CONFIG_EMBEDDED is not set | |
9034 | +CONFIG_KALLSYMS=y | |
9035 | CONFIG_FUTEX=y | |
9036 | CONFIG_EPOLL=y | |
9037 | +CONFIG_IOSCHED_NOOP=y | |
9038 | +CONFIG_IOSCHED_AS=y | |
9039 | +CONFIG_IOSCHED_DEADLINE=y | |
9040 | ||
9041 | # | |
9042 | # Loadable module support | |
9043 | @@ -83,8 +90,8 @@ | |
9044 | CONFIG_PCI=y | |
9045 | CONFIG_PCI_DOMAINS=y | |
9046 | CONFIG_KCORE_ELF=y | |
9047 | -CONFIG_BINFMT_ELF=y | |
9048 | CONFIG_KERNEL_ELF=y | |
9049 | +CONFIG_BINFMT_ELF=y | |
9050 | CONFIG_BINFMT_MISC=y | |
9051 | CONFIG_PCI_LEGACY_PROC=y | |
9052 | CONFIG_PCI_NAMES=y | |
9053 | @@ -116,6 +123,10 @@ | |
9054 | CONFIG_BOOT_LOAD=0x00800000 | |
9055 | ||
9056 | # | |
9057 | +# Generic Driver Options | |
9058 | +# | |
9059 | + | |
9060 | +# | |
9061 | # Memory Technology Devices (MTD) | |
9062 | # | |
9063 | # CONFIG_MTD is not set | |
9064 | @@ -134,10 +145,12 @@ | |
9065 | # CONFIG_BLK_DEV_DAC960 is not set | |
9066 | # CONFIG_BLK_DEV_UMEM is not set | |
9067 | CONFIG_BLK_DEV_LOOP=y | |
9068 | +# CONFIG_BLK_DEV_CRYPTOLOOP is not set | |
9069 | # CONFIG_BLK_DEV_NBD is not set | |
9070 | CONFIG_BLK_DEV_RAM=y | |
9071 | CONFIG_BLK_DEV_RAM_SIZE=4096 | |
9072 | CONFIG_BLK_DEV_INITRD=y | |
9073 | +CONFIG_LBD=y | |
9074 | ||
9075 | # | |
9076 | # Multi-device support (RAID and LVM) | |
9077 | @@ -145,12 +158,12 @@ | |
9078 | # CONFIG_MD is not set | |
9079 | ||
9080 | # | |
9081 | -# ATA/IDE/MFM/RLL support | |
9082 | +# ATA/ATAPI/MFM/RLL support | |
9083 | # | |
9084 | # CONFIG_IDE is not set | |
9085 | ||
9086 | # | |
9087 | -# SCSI support | |
9088 | +# SCSI device support | |
9089 | # | |
9090 | CONFIG_SCSI=y | |
9091 | ||
9092 | @@ -183,8 +196,6 @@ | |
9093 | # CONFIG_SCSI_AIC79XX is not set | |
9094 | # CONFIG_SCSI_DPT_I2O is not set | |
9095 | # CONFIG_SCSI_ADVANSYS is not set | |
9096 | -# CONFIG_SCSI_IN2000 is not set | |
9097 | -# CONFIG_SCSI_AM53C974 is not set | |
9098 | # CONFIG_SCSI_MEGARAID is not set | |
9099 | # CONFIG_SCSI_BUSLOGIC is not set | |
9100 | # CONFIG_SCSI_CPQFCTS is not set | |
9101 | @@ -193,11 +204,8 @@ | |
9102 | # CONFIG_SCSI_EATA_PIO is not set | |
9103 | # CONFIG_SCSI_FUTURE_DOMAIN is not set | |
9104 | # CONFIG_SCSI_GDTH is not set | |
9105 | -# CONFIG_SCSI_GENERIC_NCR5380 is not set | |
9106 | -# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set | |
9107 | # CONFIG_SCSI_INITIO is not set | |
9108 | # CONFIG_SCSI_INIA100 is not set | |
9109 | -# CONFIG_SCSI_NCR53C7xx is not set | |
9110 | CONFIG_SCSI_SYM53C8XX_2=y | |
9111 | CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 | |
9112 | CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 | |
9113 | @@ -210,7 +218,6 @@ | |
9114 | # CONFIG_SCSI_QLOGIC_1280 is not set | |
9115 | # CONFIG_SCSI_DC395x is not set | |
9116 | # CONFIG_SCSI_DC390T is not set | |
9117 | -# CONFIG_SCSI_U14_34F is not set | |
9118 | # CONFIG_SCSI_NSP32 is not set | |
9119 | # CONFIG_SCSI_DEBUG is not set | |
9120 | # CONFIG_SCSI_MESH is not set | |
9121 | @@ -242,8 +249,6 @@ | |
9122 | CONFIG_PACKET=y | |
9123 | # CONFIG_PACKET_MMAP is not set | |
9124 | # CONFIG_NETLINK_DEV is not set | |
9125 | -CONFIG_NETFILTER=y | |
9126 | -# CONFIG_NETFILTER_DEBUG is not set | |
9127 | CONFIG_UNIX=y | |
9128 | # CONFIG_NET_KEY is not set | |
9129 | CONFIG_INET=y | |
9130 | @@ -261,6 +266,16 @@ | |
9131 | # CONFIG_INET_IPCOMP is not set | |
9132 | ||
9133 | # | |
9134 | +# IP: Virtual Server Configuration | |
9135 | +# | |
9136 | +# CONFIG_IP_VS is not set | |
9137 | +# CONFIG_IPV6 is not set | |
9138 | +# CONFIG_DECNET is not set | |
9139 | +# CONFIG_BRIDGE is not set | |
9140 | +CONFIG_NETFILTER=y | |
9141 | +# CONFIG_NETFILTER_DEBUG is not set | |
9142 | + | |
9143 | +# | |
9144 | # IP: Netfilter Configuration | |
9145 | # | |
9146 | CONFIG_IP_NF_CONNTRACK=m | |
9147 | @@ -276,6 +291,7 @@ | |
9148 | CONFIG_IP_NF_MATCH_MARK=m | |
9149 | CONFIG_IP_NF_MATCH_MULTIPORT=m | |
9150 | CONFIG_IP_NF_MATCH_TOS=m | |
9151 | +CONFIG_IP_NF_MATCH_RECENT=m | |
9152 | CONFIG_IP_NF_MATCH_ECN=m | |
9153 | CONFIG_IP_NF_MATCH_DSCP=m | |
9154 | CONFIG_IP_NF_MATCH_AH_ESP=m | |
9155 | @@ -306,10 +322,9 @@ | |
9156 | CONFIG_IP_NF_TARGET_TCPMSS=m | |
9157 | CONFIG_IP_NF_ARPTABLES=m | |
9158 | CONFIG_IP_NF_ARPFILTER=m | |
9159 | +CONFIG_IP_NF_ARP_MANGLE=m | |
9160 | CONFIG_IP_NF_COMPAT_IPCHAINS=m | |
9161 | # CONFIG_IP_NF_COMPAT_IPFWADM is not set | |
9162 | -# CONFIG_IPV6 is not set | |
9163 | -# CONFIG_XFRM_USER is not set | |
9164 | ||
9165 | # | |
9166 | # SCTP Configuration (EXPERIMENTAL) | |
9167 | @@ -319,8 +334,6 @@ | |
9168 | # CONFIG_ATM is not set | |
9169 | # CONFIG_VLAN_8021Q is not set | |
9170 | # CONFIG_LLC is not set | |
9171 | -# CONFIG_DECNET is not set | |
9172 | -# CONFIG_BRIDGE is not set | |
9173 | # CONFIG_X25 is not set | |
9174 | # CONFIG_LAPB is not set | |
9175 | # CONFIG_NET_DIVERT is not set | |
9176 | @@ -396,6 +409,7 @@ | |
9177 | # CONFIG_HAMACHI is not set | |
9178 | # CONFIG_YELLOWFIN is not set | |
9179 | # CONFIG_R8169 is not set | |
9180 | +# CONFIG_SIS190 is not set | |
9181 | # CONFIG_SK98LIN is not set | |
9182 | # CONFIG_TIGON3 is not set | |
9183 | ||
9184 | @@ -495,11 +509,6 @@ | |
9185 | CONFIG_LOGO_LINUX_CLUT224=y | |
9186 | ||
9187 | # | |
9188 | -# Old CD-ROM drivers (not SCSI, not IDE) | |
9189 | -# | |
9190 | -# CONFIG_CD_NO_IDESCSI is not set | |
9191 | - | |
9192 | -# | |
9193 | # Input device support | |
9194 | # | |
9195 | CONFIG_INPUT=y | |
9196 | @@ -525,6 +534,7 @@ | |
9197 | CONFIG_SERIO_I8042=y | |
9198 | CONFIG_SERIO_SERPORT=y | |
9199 | # CONFIG_SERIO_CT82C710 is not set | |
9200 | +# CONFIG_SERIO_PCIPS2 is not set | |
9201 | ||
9202 | # | |
9203 | # Input Device Drivers | |
9204 | @@ -791,7 +801,6 @@ | |
9205 | # Kernel hacking | |
9206 | # | |
9207 | # CONFIG_DEBUG_KERNEL is not set | |
9208 | -CONFIG_KALLSYMS=y | |
9209 | # CONFIG_BOOTX_TEXT is not set | |
9210 | ||
9211 | # | |
9212 | diff -Nru a/arch/ppc/configs/mcpn765_defconfig b/arch/ppc/configs/mcpn765_defconfig | |
9213 | --- a/arch/ppc/configs/mcpn765_defconfig Tue Jul 1 17:01:18 2003 | |
9214 | +++ b/arch/ppc/configs/mcpn765_defconfig Mon Jul 21 09:05:22 2003 | |
9215 | @@ -19,6 +19,7 @@ | |
9216 | CONFIG_SYSCTL=y | |
9217 | CONFIG_LOG_BUF_SHIFT=14 | |
9218 | # CONFIG_EMBEDDED is not set | |
9219 | +CONFIG_KALLSYMS=y | |
9220 | CONFIG_FUTEX=y | |
9221 | CONFIG_EPOLL=y | |
9222 | ||
9223 | @@ -74,8 +75,8 @@ | |
9224 | CONFIG_PCI=y | |
9225 | CONFIG_PCI_DOMAINS=y | |
9226 | CONFIG_KCORE_ELF=y | |
9227 | -CONFIG_BINFMT_ELF=y | |
9228 | CONFIG_KERNEL_ELF=y | |
9229 | +CONFIG_BINFMT_ELF=y | |
9230 | # CONFIG_BINFMT_MISC is not set | |
9231 | # CONFIG_PCI_LEGACY_PROC is not set | |
9232 | # CONFIG_PCI_NAMES is not set | |
9233 | @@ -104,6 +105,11 @@ | |
9234 | CONFIG_BOOT_LOAD=0x00800000 | |
9235 | ||
9236 | # | |
9237 | +# Generic Driver Options | |
9238 | +# | |
9239 | +# CONFIG_FW_LOADER is not set | |
9240 | + | |
9241 | +# | |
9242 | # Memory Technology Devices (MTD) | |
9243 | # | |
9244 | # CONFIG_MTD is not set | |
9245 | @@ -122,10 +128,12 @@ | |
9246 | # CONFIG_BLK_DEV_DAC960 is not set | |
9247 | # CONFIG_BLK_DEV_UMEM is not set | |
9248 | CONFIG_BLK_DEV_LOOP=y | |
9249 | +# CONFIG_BLK_DEV_CRYPTOLOOP is not set | |
9250 | # CONFIG_BLK_DEV_NBD is not set | |
9251 | CONFIG_BLK_DEV_RAM=y | |
9252 | CONFIG_BLK_DEV_RAM_SIZE=4096 | |
9253 | CONFIG_BLK_DEV_INITRD=y | |
9254 | +# CONFIG_LBD is not set | |
9255 | ||
9256 | # | |
9257 | # Multi-device support (RAID and LVM) | |
9258 | @@ -133,12 +141,12 @@ | |
9259 | # CONFIG_MD is not set | |
9260 | ||
9261 | # | |
9262 | -# ATA/IDE/MFM/RLL support | |
9263 | +# ATA/ATAPI/MFM/RLL support | |
9264 | # | |
9265 | # CONFIG_IDE is not set | |
9266 | ||
9267 | # | |
9268 | -# SCSI support | |
9269 | +# SCSI device support | |
9270 | # | |
9271 | # CONFIG_SCSI is not set | |
9272 | ||
9273 | @@ -320,11 +328,6 @@ | |
9274 | # CONFIG_FB is not set | |
9275 | ||
9276 | # | |
9277 | -# Old CD-ROM drivers (not SCSI, not IDE) | |
9278 | -# | |
9279 | -# CONFIG_CD_NO_IDESCSI is not set | |
9280 | - | |
9281 | -# | |
9282 | # Input device support | |
9283 | # | |
9284 | # CONFIG_INPUT is not set | |
9285 | @@ -526,7 +529,6 @@ | |
9286 | # Kernel hacking | |
9287 | # | |
9288 | # CONFIG_DEBUG_KERNEL is not set | |
9289 | -# CONFIG_KALLSYMS is not set | |
9290 | # CONFIG_SERIAL_TEXT_DEBUG is not set | |
9291 | ||
9292 | # | |
9293 | diff -Nru a/arch/ppc/configs/ocotea_defconfig b/arch/ppc/configs/ocotea_defconfig | |
9294 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
9295 | +++ b/arch/ppc/configs/ocotea_defconfig Wed Sep 3 05:16:34 2003 | |
9296 | @@ -0,0 +1,574 @@ | |
9297 | +# | |
9298 | +# Automatically generated make config: don't edit | |
9299 | +# | |
9300 | +CONFIG_MMU=y | |
9301 | +CONFIG_RWSEM_XCHGADD_ALGORITHM=y | |
9302 | +CONFIG_HAVE_DEC_LOCK=y | |
9303 | + | |
9304 | +# | |
9305 | +# Code maturity level options | |
9306 | +# | |
9307 | +CONFIG_EXPERIMENTAL=y | |
9308 | +CONFIG_CLEAN_COMPILE=y | |
9309 | +CONFIG_BROKEN_ON_SMP=y | |
9310 | + | |
9311 | +# | |
9312 | +# General setup | |
9313 | +# | |
9314 | +CONFIG_SWAP=y | |
9315 | +CONFIG_SYSVIPC=y | |
9316 | +# CONFIG_BSD_PROCESS_ACCT is not set | |
9317 | +CONFIG_SYSCTL=y | |
9318 | +CONFIG_LOG_BUF_SHIFT=14 | |
9319 | +# CONFIG_IKCONFIG is not set | |
9320 | +# CONFIG_EMBEDDED is not set | |
9321 | +CONFIG_KALLSYMS=y | |
9322 | +CONFIG_FUTEX=y | |
9323 | +CONFIG_EPOLL=y | |
9324 | +CONFIG_IOSCHED_NOOP=y | |
9325 | +CONFIG_IOSCHED_AS=y | |
9326 | +CONFIG_IOSCHED_DEADLINE=y | |
9327 | + | |
9328 | +# | |
9329 | +# Loadable module support | |
9330 | +# | |
9331 | +CONFIG_MODULES=y | |
9332 | +CONFIG_MODULE_UNLOAD=y | |
9333 | +# CONFIG_MODULE_FORCE_UNLOAD is not set | |
9334 | +CONFIG_OBSOLETE_MODPARM=y | |
9335 | +# CONFIG_MODVERSIONS is not set | |
9336 | +CONFIG_KMOD=y | |
9337 | + | |
9338 | +# | |
9339 | +# Platform support | |
9340 | +# | |
9341 | +CONFIG_PPC=y | |
9342 | +CONFIG_PPC32=y | |
9343 | +# CONFIG_6xx is not set | |
9344 | +# CONFIG_40x is not set | |
9345 | +CONFIG_44x=y | |
9346 | +# CONFIG_POWER3 is not set | |
9347 | +# CONFIG_8xx is not set | |
9348 | +CONFIG_PTE_64BIT=y | |
9349 | +CONFIG_4xx=y | |
9350 | + | |
9351 | +# | |
9352 | +# IBM 4xx options | |
9353 | +# | |
9354 | +# CONFIG_EBONY is not set | |
9355 | +CONFIG_OCOTEA=y | |
9356 | +CONFIG_440GX=y | |
9357 | +CONFIG_440A=y | |
9358 | +CONFIG_PIN_TLB=y | |
9359 | +CONFIG_BOOKE=y | |
9360 | +CONFIG_IBM_OCP=y | |
9361 | +CONFIG_IBM_EMAC4=y | |
9362 | +# CONFIG_PM is not set | |
9363 | +CONFIG_NOT_COHERENT_CACHE=y | |
9364 | +# CONFIG_SMP is not set | |
9365 | +# CONFIG_PREEMPT is not set | |
9366 | +# CONFIG_MATH_EMULATION is not set | |
9367 | +# CONFIG_CPU_FREQ is not set | |
9368 | + | |
9369 | +# | |
9370 | +# General setup | |
9371 | +# | |
9372 | +# CONFIG_HIGHMEM is not set | |
9373 | +CONFIG_PCI=y | |
9374 | +CONFIG_PCI_DOMAINS=y | |
9375 | +# CONFIG_PC_KEYBOARD is not set | |
9376 | +CONFIG_KERNEL_ELF=y | |
9377 | +CONFIG_BINFMT_ELF=y | |
9378 | +# CONFIG_BINFMT_MISC is not set | |
9379 | +# CONFIG_PCI_LEGACY_PROC is not set | |
9380 | +# CONFIG_PCI_NAMES is not set | |
9381 | +# CONFIG_HOTPLUG is not set | |
9382 | + | |
9383 | +# | |
9384 | +# Parallel port support | |
9385 | +# | |
9386 | +# CONFIG_PARPORT is not set | |
9387 | +CONFIG_CMDLINE_BOOL=y | |
9388 | +CONFIG_CMDLINE="ip=on console=ttyS0,115200" | |
9389 | + | |
9390 | +# | |
9391 | +# Advanced setup | |
9392 | +# | |
9393 | +# CONFIG_ADVANCED_OPTIONS is not set | |
9394 | + | |
9395 | +# | |
9396 | +# Default settings for advanced configuration options are used | |
9397 | +# | |
9398 | +CONFIG_HIGHMEM_START=0xfe000000 | |
9399 | +CONFIG_LOWMEM_SIZE=0x30000000 | |
9400 | +CONFIG_KERNEL_START=0xc0000000 | |
9401 | +CONFIG_TASK_SIZE=0x80000000 | |
9402 | +CONFIG_BOOT_LOAD=0x01000000 | |
9403 | + | |
9404 | +# | |
9405 | +# Generic Driver Options | |
9406 | +# | |
9407 | + | |
9408 | +# | |
9409 | +# Memory Technology Devices (MTD) | |
9410 | +# | |
9411 | +# CONFIG_MTD is not set | |
9412 | + | |
9413 | +# | |
9414 | +# Plug and Play support | |
9415 | +# | |
9416 | +# CONFIG_PNP is not set | |
9417 | + | |
9418 | +# | |
9419 | +# Block devices | |
9420 | +# | |
9421 | +# CONFIG_BLK_DEV_FD is not set | |
9422 | +# CONFIG_BLK_CPQ_DA is not set | |
9423 | +# CONFIG_BLK_CPQ_CISS_DA is not set | |
9424 | +# CONFIG_BLK_DEV_DAC960 is not set | |
9425 | +# CONFIG_BLK_DEV_UMEM is not set | |
9426 | +# CONFIG_BLK_DEV_LOOP is not set | |
9427 | +# CONFIG_BLK_DEV_NBD is not set | |
9428 | +# CONFIG_BLK_DEV_RAM is not set | |
9429 | +# CONFIG_BLK_DEV_INITRD is not set | |
9430 | +# CONFIG_LBD is not set | |
9431 | + | |
9432 | +# | |
9433 | +# Multi-device support (RAID and LVM) | |
9434 | +# | |
9435 | +# CONFIG_MD is not set | |
9436 | + | |
9437 | +# | |
9438 | +# ATA/ATAPI/MFM/RLL support | |
9439 | +# | |
9440 | +# CONFIG_IDE is not set | |
9441 | + | |
9442 | +# | |
9443 | +# SCSI device support | |
9444 | +# | |
9445 | +# CONFIG_SCSI is not set | |
9446 | + | |
9447 | +# | |
9448 | +# Fusion MPT device support | |
9449 | +# | |
9450 | + | |
9451 | +# | |
9452 | +# IEEE 1394 (FireWire) support (EXPERIMENTAL) | |
9453 | +# | |
9454 | +# CONFIG_IEEE1394 is not set | |
9455 | + | |
9456 | +# | |
9457 | +# I2O device support | |
9458 | +# | |
9459 | +# CONFIG_I2O is not set | |
9460 | + | |
9461 | +# | |
9462 | +# Networking support | |
9463 | +# | |
9464 | +CONFIG_NET=y | |
9465 | + | |
9466 | +# | |
9467 | +# Networking options | |
9468 | +# | |
9469 | +CONFIG_PACKET=y | |
9470 | +# CONFIG_PACKET_MMAP is not set | |
9471 | +# CONFIG_NETLINK_DEV is not set | |
9472 | +CONFIG_UNIX=y | |
9473 | +# CONFIG_NET_KEY is not set | |
9474 | +CONFIG_INET=y | |
9475 | +# CONFIG_IP_MULTICAST is not set | |
9476 | +# CONFIG_IP_ADVANCED_ROUTER is not set | |
9477 | +CONFIG_IP_PNP=y | |
9478 | +# CONFIG_IP_PNP_DHCP is not set | |
9479 | +CONFIG_IP_PNP_BOOTP=y | |
9480 | +# CONFIG_IP_PNP_RARP is not set | |
9481 | +# CONFIG_NET_IPIP is not set | |
9482 | +# CONFIG_NET_IPGRE is not set | |
9483 | +# CONFIG_ARPD is not set | |
9484 | +# CONFIG_INET_ECN is not set | |
9485 | +# CONFIG_SYN_COOKIES is not set | |
9486 | +# CONFIG_INET_AH is not set | |
9487 | +# CONFIG_INET_ESP is not set | |
9488 | +# CONFIG_INET_IPCOMP is not set | |
9489 | + | |
9490 | +# | |
9491 | +# IP: Virtual Server Configuration | |
9492 | +# | |
9493 | +# CONFIG_IP_VS is not set | |
9494 | +# CONFIG_IPV6 is not set | |
9495 | +# CONFIG_DECNET is not set | |
9496 | +# CONFIG_BRIDGE is not set | |
9497 | +CONFIG_NETFILTER=y | |
9498 | +# CONFIG_NETFILTER_DEBUG is not set | |
9499 | + | |
9500 | +# | |
9501 | +# IP: Netfilter Configuration | |
9502 | +# | |
9503 | +# CONFIG_IP_NF_CONNTRACK is not set | |
9504 | +# CONFIG_IP_NF_QUEUE is not set | |
9505 | +# CONFIG_IP_NF_IPTABLES is not set | |
9506 | +# CONFIG_IP_NF_ARPTABLES is not set | |
9507 | +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set | |
9508 | +# CONFIG_IP_NF_COMPAT_IPFWADM is not set | |
9509 | + | |
9510 | +# | |
9511 | +# SCTP Configuration (EXPERIMENTAL) | |
9512 | +# | |
9513 | +CONFIG_IPV6_SCTP__=y | |
9514 | +# CONFIG_IP_SCTP is not set | |
9515 | +# CONFIG_ATM is not set | |
9516 | +# CONFIG_VLAN_8021Q is not set | |
9517 | +# CONFIG_LLC is not set | |
9518 | +# CONFIG_X25 is not set | |
9519 | +# CONFIG_LAPB is not set | |
9520 | +# CONFIG_NET_DIVERT is not set | |
9521 | +# CONFIG_ECONET is not set | |
9522 | +# CONFIG_WAN_ROUTER is not set | |
9523 | +# CONFIG_NET_FASTROUTE is not set | |
9524 | +# CONFIG_NET_HW_FLOWCONTROL is not set | |
9525 | + | |
9526 | +# | |
9527 | +# QoS and/or fair queueing | |
9528 | +# | |
9529 | +# CONFIG_NET_SCHED is not set | |
9530 | + | |
9531 | +# | |
9532 | +# Network testing | |
9533 | +# | |
9534 | +# CONFIG_NET_PKTGEN is not set | |
9535 | +CONFIG_NETDEVICES=y | |
9536 | + | |
9537 | +# | |
9538 | +# ARCnet devices | |
9539 | +# | |
9540 | +# CONFIG_ARCNET is not set | |
9541 | +# CONFIG_DUMMY is not set | |
9542 | +# CONFIG_BONDING is not set | |
9543 | +# CONFIG_EQUALIZER is not set | |
9544 | +# CONFIG_TUN is not set | |
9545 | + | |
9546 | +# | |
9547 | +# Ethernet (10 or 100Mbit) | |
9548 | +# | |
9549 | +CONFIG_NET_ETHERNET=y | |
9550 | +# CONFIG_MII is not set | |
9551 | +# CONFIG_OAKNET is not set | |
9552 | +# CONFIG_HAPPYMEAL is not set | |
9553 | +# CONFIG_SUNGEM is not set | |
9554 | +# CONFIG_NET_VENDOR_3COM is not set | |
9555 | + | |
9556 | +# | |
9557 | +# Tulip family network device support | |
9558 | +# | |
9559 | +# CONFIG_NET_TULIP is not set | |
9560 | +# CONFIG_HP100 is not set | |
9561 | +# CONFIG_NET_PCI is not set | |
9562 | + | |
9563 | +# | |
9564 | +# Ethernet (1000 Mbit) | |
9565 | +# | |
9566 | +# CONFIG_ACENIC is not set | |
9567 | +# CONFIG_DL2K is not set | |
9568 | +# CONFIG_E1000 is not set | |
9569 | +# CONFIG_NS83820 is not set | |
9570 | +# CONFIG_HAMACHI is not set | |
9571 | +# CONFIG_YELLOWFIN is not set | |
9572 | +# CONFIG_R8169 is not set | |
9573 | +# CONFIG_SIS190 is not set | |
9574 | +# CONFIG_SK98LIN is not set | |
9575 | +# CONFIG_TIGON3 is not set | |
9576 | + | |
9577 | +# | |
9578 | +# Ethernet (10000 Mbit) | |
9579 | +# | |
9580 | +# CONFIG_IXGB is not set | |
9581 | +# CONFIG_FDDI is not set | |
9582 | +# CONFIG_HIPPI is not set | |
9583 | +# CONFIG_PPP is not set | |
9584 | +# CONFIG_SLIP is not set | |
9585 | + | |
9586 | +# | |
9587 | +# Wireless LAN (non-hamradio) | |
9588 | +# | |
9589 | +# CONFIG_NET_RADIO is not set | |
9590 | + | |
9591 | +# | |
9592 | +# Token Ring devices (depends on LLC=y) | |
9593 | +# | |
9594 | +# CONFIG_RCPCI is not set | |
9595 | +# CONFIG_SHAPER is not set | |
9596 | + | |
9597 | +# | |
9598 | +# Wan interfaces | |
9599 | +# | |
9600 | +# CONFIG_WAN is not set | |
9601 | + | |
9602 | +# | |
9603 | +# Amateur Radio support | |
9604 | +# | |
9605 | +# CONFIG_HAMRADIO is not set | |
9606 | + | |
9607 | +# | |
9608 | +# IrDA (infrared) support | |
9609 | +# | |
9610 | +# CONFIG_IRDA is not set | |
9611 | + | |
9612 | +# | |
9613 | +# ISDN subsystem | |
9614 | +# | |
9615 | +# CONFIG_ISDN_BOOL is not set | |
9616 | + | |
9617 | +# | |
9618 | +# Graphics support | |
9619 | +# | |
9620 | +# CONFIG_FB is not set | |
9621 | + | |
9622 | +# | |
9623 | +# Console display driver support | |
9624 | +# | |
9625 | +CONFIG_VGA_CONSOLE=y | |
9626 | +# CONFIG_MDA_CONSOLE is not set | |
9627 | +CONFIG_DUMMY_CONSOLE=y | |
9628 | + | |
9629 | +# | |
9630 | +# Input device support | |
9631 | +# | |
9632 | +CONFIG_INPUT=y | |
9633 | + | |
9634 | +# | |
9635 | +# Userland interfaces | |
9636 | +# | |
9637 | +CONFIG_INPUT_MOUSEDEV=y | |
9638 | +CONFIG_INPUT_MOUSEDEV_PSAUX=y | |
9639 | +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | |
9640 | +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | |
9641 | +# CONFIG_INPUT_JOYDEV is not set | |
9642 | +# CONFIG_INPUT_TSDEV is not set | |
9643 | +# CONFIG_INPUT_EVDEV is not set | |
9644 | +# CONFIG_INPUT_EVBUG is not set | |
9645 | + | |
9646 | +# | |
9647 | +# Input I/O drivers | |
9648 | +# | |
9649 | +# CONFIG_GAMEPORT is not set | |
9650 | +CONFIG_SOUND_GAMEPORT=y | |
9651 | +# CONFIG_SERIO is not set | |
9652 | + | |
9653 | +# | |
9654 | +# Input Device Drivers | |
9655 | +# | |
9656 | +# CONFIG_INPUT_KEYBOARD is not set | |
9657 | +# CONFIG_INPUT_MOUSE is not set | |
9658 | +# CONFIG_INPUT_JOYSTICK is not set | |
9659 | +# CONFIG_INPUT_TOUCHSCREEN is not set | |
9660 | +# CONFIG_INPUT_MISC is not set | |
9661 | + | |
9662 | +# | |
9663 | +# Macintosh device drivers | |
9664 | +# | |
9665 | + | |
9666 | +# | |
9667 | +# Character devices | |
9668 | +# | |
9669 | +CONFIG_VT=y | |
9670 | +CONFIG_VT_CONSOLE=y | |
9671 | +CONFIG_HW_CONSOLE=y | |
9672 | +# CONFIG_SERIAL_NONSTANDARD is not set | |
9673 | + | |
9674 | +# | |
9675 | +# Serial drivers | |
9676 | +# | |
9677 | +CONFIG_SERIAL_8250=y | |
9678 | +CONFIG_SERIAL_8250_CONSOLE=y | |
9679 | +CONFIG_SERIAL_8250_EXTENDED=y | |
9680 | +CONFIG_SERIAL_8250_MANY_PORTS=y | |
9681 | +CONFIG_SERIAL_8250_SHARE_IRQ=y | |
9682 | +# CONFIG_SERIAL_8250_DETECT_IRQ is not set | |
9683 | +# CONFIG_SERIAL_8250_MULTIPORT is not set | |
9684 | +# CONFIG_SERIAL_8250_RSA is not set | |
9685 | + | |
9686 | +# | |
9687 | +# Non-8250 serial port support | |
9688 | +# | |
9689 | +CONFIG_SERIAL_CORE=y | |
9690 | +CONFIG_SERIAL_CORE_CONSOLE=y | |
9691 | +CONFIG_UNIX98_PTYS=y | |
9692 | +CONFIG_UNIX98_PTY_COUNT=256 | |
9693 | + | |
9694 | +# | |
9695 | +# I2C support | |
9696 | +# | |
9697 | +# CONFIG_I2C is not set | |
9698 | + | |
9699 | +# | |
9700 | +# I2C Hardware Sensors Mainboard support | |
9701 | +# | |
9702 | + | |
9703 | +# | |
9704 | +# I2C Hardware Sensors Chip support | |
9705 | +# | |
9706 | +# CONFIG_I2C_SENSOR is not set | |
9707 | + | |
9708 | +# | |
9709 | +# Mice | |
9710 | +# | |
9711 | +# CONFIG_BUSMOUSE is not set | |
9712 | +# CONFIG_QIC02_TAPE is not set | |
9713 | + | |
9714 | +# | |
9715 | +# IPMI | |
9716 | +# | |
9717 | +# CONFIG_IPMI_HANDLER is not set | |
9718 | + | |
9719 | +# | |
9720 | +# Watchdog Cards | |
9721 | +# | |
9722 | +# CONFIG_WATCHDOG is not set | |
9723 | +# CONFIG_NVRAM is not set | |
9724 | +# CONFIG_GEN_RTC is not set | |
9725 | +# CONFIG_DTLK is not set | |
9726 | +# CONFIG_R3964 is not set | |
9727 | +# CONFIG_APPLICOM is not set | |
9728 | + | |
9729 | +# | |
9730 | +# Ftape, the floppy tape device driver | |
9731 | +# | |
9732 | +# CONFIG_FTAPE is not set | |
9733 | +# CONFIG_AGP is not set | |
9734 | +# CONFIG_DRM is not set | |
9735 | +# CONFIG_RAW_DRIVER is not set | |
9736 | +# CONFIG_HANGCHECK_TIMER is not set | |
9737 | + | |
9738 | +# | |
9739 | +# Multimedia devices | |
9740 | +# | |
9741 | +# CONFIG_VIDEO_DEV is not set | |
9742 | + | |
9743 | +# | |
9744 | +# Digital Video Broadcasting Devices | |
9745 | +# | |
9746 | +# CONFIG_DVB is not set | |
9747 | + | |
9748 | +# | |
9749 | +# File systems | |
9750 | +# | |
9751 | +# CONFIG_EXT2_FS is not set | |
9752 | +# CONFIG_EXT3_FS is not set | |
9753 | +# CONFIG_JBD is not set | |
9754 | +# CONFIG_REISERFS_FS is not set | |
9755 | +# CONFIG_JFS_FS is not set | |
9756 | +# CONFIG_XFS_FS is not set | |
9757 | +# CONFIG_MINIX_FS is not set | |
9758 | +# CONFIG_ROMFS_FS is not set | |
9759 | +# CONFIG_QUOTA is not set | |
9760 | +# CONFIG_AUTOFS_FS is not set | |
9761 | +# CONFIG_AUTOFS4_FS is not set | |
9762 | + | |
9763 | +# | |
9764 | +# CD-ROM/DVD Filesystems | |
9765 | +# | |
9766 | +# CONFIG_ISO9660_FS is not set | |
9767 | +# CONFIG_UDF_FS is not set | |
9768 | + | |
9769 | +# | |
9770 | +# DOS/FAT/NT Filesystems | |
9771 | +# | |
9772 | +# CONFIG_FAT_FS is not set | |
9773 | +# CONFIG_NTFS_FS is not set | |
9774 | + | |
9775 | +# | |
9776 | +# Pseudo filesystems | |
9777 | +# | |
9778 | +CONFIG_PROC_FS=y | |
9779 | +# CONFIG_DEVFS_FS is not set | |
9780 | +CONFIG_DEVPTS_FS=y | |
9781 | +# CONFIG_DEVPTS_FS_XATTR is not set | |
9782 | +# CONFIG_TMPFS is not set | |
9783 | +CONFIG_RAMFS=y | |
9784 | + | |
9785 | +# | |
9786 | +# Miscellaneous filesystems | |
9787 | +# | |
9788 | +# CONFIG_ADFS_FS is not set | |
9789 | +# CONFIG_AFFS_FS is not set | |
9790 | +# CONFIG_HFS_FS is not set | |
9791 | +# CONFIG_BEFS_FS is not set | |
9792 | +# CONFIG_BFS_FS is not set | |
9793 | +# CONFIG_EFS_FS is not set | |
9794 | +# CONFIG_CRAMFS is not set | |
9795 | +# CONFIG_VXFS_FS is not set | |
9796 | +# CONFIG_HPFS_FS is not set | |
9797 | +# CONFIG_QNX4FS_FS is not set | |
9798 | +# CONFIG_SYSV_FS is not set | |
9799 | +# CONFIG_UFS_FS is not set | |
9800 | + | |
9801 | +# | |
9802 | +# Network File Systems | |
9803 | +# | |
9804 | +CONFIG_NFS_FS=y | |
9805 | +# CONFIG_NFS_V3 is not set | |
9806 | +# CONFIG_NFS_V4 is not set | |
9807 | +# CONFIG_NFSD is not set | |
9808 | +CONFIG_ROOT_NFS=y | |
9809 | +CONFIG_LOCKD=y | |
9810 | +# CONFIG_EXPORTFS is not set | |
9811 | +CONFIG_SUNRPC=y | |
9812 | +# CONFIG_SUNRPC_GSS is not set | |
9813 | +# CONFIG_SMB_FS is not set | |
9814 | +# CONFIG_CIFS is not set | |
9815 | +# CONFIG_NCP_FS is not set | |
9816 | +# CONFIG_CODA_FS is not set | |
9817 | +# CONFIG_INTERMEZZO_FS is not set | |
9818 | +# CONFIG_AFS_FS is not set | |
9819 | + | |
9820 | +# | |
9821 | +# Partition Types | |
9822 | +# | |
9823 | +# CONFIG_PARTITION_ADVANCED is not set | |
9824 | +CONFIG_MSDOS_PARTITION=y | |
9825 | + | |
9826 | +# | |
9827 | +# Sound | |
9828 | +# | |
9829 | +# CONFIG_SOUND is not set | |
9830 | + | |
9831 | +# | |
9832 | +# USB support | |
9833 | +# | |
9834 | +# CONFIG_USB is not set | |
9835 | +# CONFIG_USB_GADGET is not set | |
9836 | + | |
9837 | +# | |
9838 | +# Bluetooth support | |
9839 | +# | |
9840 | +# CONFIG_BT is not set | |
9841 | + | |
9842 | +# | |
9843 | +# Library routines | |
9844 | +# | |
9845 | +CONFIG_CRC32=y | |
9846 | + | |
9847 | +# | |
9848 | +# Kernel hacking | |
9849 | +# | |
9850 | +CONFIG_DEBUG_KERNEL=y | |
9851 | +# CONFIG_DEBUG_SLAB is not set | |
9852 | +# CONFIG_MAGIC_SYSRQ is not set | |
9853 | +# CONFIG_DEBUG_SPINLOCK is not set | |
9854 | +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set | |
9855 | +# CONFIG_KGDB is not set | |
9856 | +# CONFIG_XMON is not set | |
9857 | +CONFIG_BDI_SWITCH=y | |
9858 | +CONFIG_DEBUG_INFO=y | |
9859 | +# CONFIG_SERIAL_TEXT_DEBUG is not set | |
9860 | +CONFIG_OCP=y | |
9861 | + | |
9862 | +# | |
9863 | +# Security options | |
9864 | +# | |
9865 | +# CONFIG_SECURITY is not set | |
9866 | + | |
9867 | +# | |
9868 | +# Cryptographic options | |
9869 | +# | |
9870 | +# CONFIG_CRYPTO is not set | |
9871 | diff -Nru a/arch/ppc/configs/pmac_defconfig b/arch/ppc/configs/pmac_defconfig | |
9872 | --- a/arch/ppc/configs/pmac_defconfig Sat Aug 2 13:06:57 2003 | |
9873 | +++ b/arch/ppc/configs/pmac_defconfig Sat Aug 23 02:33:38 2003 | |
9874 | @@ -9,6 +9,7 @@ | |
9875 | # Code maturity level options | |
9876 | # | |
9877 | CONFIG_EXPERIMENTAL=y | |
9878 | +# CONFIG_BROKEN is not set | |
9879 | ||
9880 | # | |
9881 | # General setup | |
9882 | @@ -18,9 +19,15 @@ | |
9883 | # CONFIG_BSD_PROCESS_ACCT is not set | |
9884 | CONFIG_SYSCTL=y | |
9885 | CONFIG_LOG_BUF_SHIFT=14 | |
9886 | +CONFIG_IKCONFIG=y | |
9887 | +CONFIG_IKCONFIG_PROC=y | |
9888 | # CONFIG_EMBEDDED is not set | |
9889 | +CONFIG_KALLSYMS=y | |
9890 | CONFIG_FUTEX=y | |
9891 | CONFIG_EPOLL=y | |
9892 | +CONFIG_IOSCHED_NOOP=y | |
9893 | +CONFIG_IOSCHED_AS=y | |
9894 | +CONFIG_IOSCHED_DEADLINE=y | |
9895 | ||
9896 | # | |
9897 | # Loadable module support | |
9898 | @@ -79,6 +86,7 @@ | |
9899 | # CONFIG_TAU_INT is not set | |
9900 | # CONFIG_TAU_AVERAGE is not set | |
9901 | CONFIG_CPU_FREQ=y | |
9902 | +CONFIG_CPU_FREQ_TABLE=y | |
9903 | CONFIG_CPU_FREQ_PROC_INTF=y | |
9904 | CONFIG_CPU_FREQ_24_API=y | |
9905 | CONFIG_CPU_FREQ_PMAC=y | |
9906 | @@ -90,8 +98,8 @@ | |
9907 | CONFIG_PCI=y | |
9908 | CONFIG_PCI_DOMAINS=y | |
9909 | CONFIG_KCORE_ELF=y | |
9910 | -CONFIG_BINFMT_ELF=y | |
9911 | CONFIG_KERNEL_ELF=y | |
9912 | +CONFIG_BINFMT_ELF=y | |
9913 | CONFIG_BINFMT_MISC=m | |
9914 | CONFIG_PCI_LEGACY_PROC=y | |
9915 | CONFIG_PCI_NAMES=y | |
9916 | @@ -101,9 +109,9 @@ | |
9917 | # PCMCIA/CardBus support | |
9918 | # | |
9919 | CONFIG_PCMCIA=m | |
9920 | +CONFIG_YENTA=m | |
9921 | CONFIG_CARDBUS=y | |
9922 | CONFIG_I82092=m | |
9923 | -CONFIG_I82365=m | |
9924 | CONFIG_TCIC=m | |
9925 | ||
9926 | # | |
9927 | @@ -131,6 +139,11 @@ | |
9928 | CONFIG_BOOT_LOAD=0x00800000 | |
9929 | ||
9930 | # | |
9931 | +# Generic Driver Options | |
9932 | +# | |
9933 | +# CONFIG_FW_LOADER is not set | |
9934 | + | |
9935 | +# | |
9936 | # Memory Technology Devices (MTD) | |
9937 | # | |
9938 | # CONFIG_MTD is not set | |
9939 | @@ -149,10 +162,12 @@ | |
9940 | # CONFIG_BLK_DEV_DAC960 is not set | |
9941 | # CONFIG_BLK_DEV_UMEM is not set | |
9942 | CONFIG_BLK_DEV_LOOP=y | |
9943 | +# CONFIG_BLK_DEV_CRYPTOLOOP is not set | |
9944 | # CONFIG_BLK_DEV_NBD is not set | |
9945 | CONFIG_BLK_DEV_RAM=y | |
9946 | CONFIG_BLK_DEV_RAM_SIZE=4096 | |
9947 | CONFIG_BLK_DEV_INITRD=y | |
9948 | +CONFIG_LBD=y | |
9949 | ||
9950 | # | |
9951 | # Multi-device support (RAID and LVM) | |
9952 | @@ -160,41 +175,39 @@ | |
9953 | # CONFIG_MD is not set | |
9954 | ||
9955 | # | |
9956 | -# ATA/IDE/MFM/RLL support | |
9957 | +# ATA/ATAPI/MFM/RLL support | |
9958 | # | |
9959 | CONFIG_IDE=y | |
9960 | - | |
9961 | -# | |
9962 | -# IDE, ATA and ATAPI Block devices | |
9963 | -# | |
9964 | CONFIG_BLK_DEV_IDE=y | |
9965 | ||
9966 | # | |
9967 | # Please see Documentation/ide.txt for help/info on IDE drives | |
9968 | # | |
9969 | -# CONFIG_BLK_DEV_HD is not set | |
9970 | CONFIG_BLK_DEV_IDEDISK=y | |
9971 | # CONFIG_IDEDISK_MULTI_MODE is not set | |
9972 | # CONFIG_IDEDISK_STROKE is not set | |
9973 | CONFIG_BLK_DEV_IDECS=m | |
9974 | CONFIG_BLK_DEV_IDECD=y | |
9975 | +# CONFIG_BLK_DEV_IDETAPE is not set | |
9976 | CONFIG_BLK_DEV_IDEFLOPPY=y | |
9977 | CONFIG_BLK_DEV_IDESCSI=y | |
9978 | # CONFIG_IDE_TASK_IOCTL is not set | |
9979 | +# CONFIG_IDE_TASKFILE_IO is not set | |
9980 | ||
9981 | # | |
9982 | # IDE chipset support/bugfixes | |
9983 | # | |
9984 | CONFIG_BLK_DEV_IDEPCI=y | |
9985 | -CONFIG_BLK_DEV_GENERIC=y | |
9986 | CONFIG_IDEPCI_SHARE_IRQ=y | |
9987 | +# CONFIG_BLK_DEV_OFFBOARD is not set | |
9988 | +CONFIG_BLK_DEV_GENERIC=y | |
9989 | +# CONFIG_BLK_DEV_OPTI621 is not set | |
9990 | +CONFIG_BLK_DEV_SL82C105=y | |
9991 | CONFIG_BLK_DEV_IDEDMA_PCI=y | |
9992 | # CONFIG_BLK_DEV_IDE_TCQ is not set | |
9993 | -# CONFIG_BLK_DEV_OFFBOARD is not set | |
9994 | # CONFIG_BLK_DEV_IDEDMA_FORCED is not set | |
9995 | CONFIG_IDEDMA_PCI_AUTO=y | |
9996 | # CONFIG_IDEDMA_ONLYDISK is not set | |
9997 | -CONFIG_BLK_DEV_IDEDMA=y | |
9998 | # CONFIG_IDEDMA_PCI_WIP is not set | |
9999 | CONFIG_BLK_DEV_ADMA=y | |
10000 | # CONFIG_BLK_DEV_AEC62XX is not set | |
10001 | @@ -204,12 +217,12 @@ | |
10002 | # CONFIG_BLK_DEV_TRIFLEX is not set | |
10003 | # CONFIG_BLK_DEV_CY82C693 is not set | |
10004 | # CONFIG_BLK_DEV_CS5520 is not set | |
10005 | +# CONFIG_BLK_DEV_CS5530 is not set | |
10006 | # CONFIG_BLK_DEV_HPT34X is not set | |
10007 | # CONFIG_BLK_DEV_HPT366 is not set | |
10008 | # CONFIG_BLK_DEV_SC1200 is not set | |
10009 | # CONFIG_BLK_DEV_PIIX is not set | |
10010 | # CONFIG_BLK_DEV_NS87415 is not set | |
10011 | -# CONFIG_BLK_DEV_OPTI621 is not set | |
10012 | # CONFIG_BLK_DEV_PDC202XX_OLD is not set | |
10013 | CONFIG_BLK_DEV_PDC202XX_NEW=y | |
10014 | # CONFIG_PDC202XX_FORCE is not set | |
10015 | @@ -218,15 +231,17 @@ | |
10016 | # CONFIG_BLK_DEV_SLC90E66 is not set | |
10017 | # CONFIG_BLK_DEV_TRM290 is not set | |
10018 | # CONFIG_BLK_DEV_VIA82CXXX is not set | |
10019 | -CONFIG_BLK_DEV_SL82C105=y | |
10020 | CONFIG_BLK_DEV_IDE_PMAC=y | |
10021 | CONFIG_BLK_DEV_IDEDMA_PMAC=y | |
10022 | CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO=y | |
10023 | -CONFIG_IDEDMA_AUTO=y | |
10024 | +CONFIG_BLK_DEV_IDEDMA=y | |
10025 | # CONFIG_IDEDMA_IVB is not set | |
10026 | +CONFIG_IDEDMA_AUTO=y | |
10027 | +# CONFIG_DMA_NONPCI is not set | |
10028 | +# CONFIG_BLK_DEV_HD is not set | |
10029 | ||
10030 | # | |
10031 | -# SCSI support | |
10032 | +# SCSI device support | |
10033 | # | |
10034 | CONFIG_SCSI=y | |
10035 | ||
10036 | @@ -266,8 +281,6 @@ | |
10037 | # CONFIG_SCSI_AIC79XX is not set | |
10038 | # CONFIG_SCSI_DPT_I2O is not set | |
10039 | CONFIG_SCSI_ADVANSYS=m | |
10040 | -# CONFIG_SCSI_IN2000 is not set | |
10041 | -# CONFIG_SCSI_AM53C974 is not set | |
10042 | # CONFIG_SCSI_MEGARAID is not set | |
10043 | # CONFIG_SCSI_BUSLOGIC is not set | |
10044 | # CONFIG_SCSI_CPQFCTS is not set | |
10045 | @@ -276,11 +289,8 @@ | |
10046 | # CONFIG_SCSI_EATA_PIO is not set | |
10047 | # CONFIG_SCSI_FUTURE_DOMAIN is not set | |
10048 | # CONFIG_SCSI_GDTH is not set | |
10049 | -# CONFIG_SCSI_GENERIC_NCR5380 is not set | |
10050 | -# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set | |
10051 | # CONFIG_SCSI_INITIO is not set | |
10052 | # CONFIG_SCSI_INIA100 is not set | |
10053 | -# CONFIG_SCSI_NCR53C7xx is not set | |
10054 | CONFIG_SCSI_SYM53C8XX_2=y | |
10055 | CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 | |
10056 | CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 | |
10057 | @@ -293,7 +303,6 @@ | |
10058 | # CONFIG_SCSI_QLOGIC_1280 is not set | |
10059 | # CONFIG_SCSI_DC395x is not set | |
10060 | # CONFIG_SCSI_DC390T is not set | |
10061 | -# CONFIG_SCSI_U14_34F is not set | |
10062 | # CONFIG_SCSI_NSP32 is not set | |
10063 | # CONFIG_SCSI_DEBUG is not set | |
10064 | CONFIG_SCSI_MESH=y | |
10065 | @@ -361,8 +370,6 @@ | |
10066 | CONFIG_PACKET=y | |
10067 | # CONFIG_PACKET_MMAP is not set | |
10068 | # CONFIG_NETLINK_DEV is not set | |
10069 | -CONFIG_NETFILTER=y | |
10070 | -# CONFIG_NETFILTER_DEBUG is not set | |
10071 | CONFIG_UNIX=y | |
10072 | # CONFIG_NET_KEY is not set | |
10073 | CONFIG_INET=y | |
10074 | @@ -380,6 +387,16 @@ | |
10075 | # CONFIG_INET_IPCOMP is not set | |
10076 | ||
10077 | # | |
10078 | +# IP: Virtual Server Configuration | |
10079 | +# | |
10080 | +# CONFIG_IP_VS is not set | |
10081 | +# CONFIG_IPV6 is not set | |
10082 | +# CONFIG_DECNET is not set | |
10083 | +# CONFIG_BRIDGE is not set | |
10084 | +CONFIG_NETFILTER=y | |
10085 | +# CONFIG_NETFILTER_DEBUG is not set | |
10086 | + | |
10087 | +# | |
10088 | # IP: Netfilter Configuration | |
10089 | # | |
10090 | CONFIG_IP_NF_CONNTRACK=m | |
10091 | @@ -395,6 +412,7 @@ | |
10092 | CONFIG_IP_NF_MATCH_MARK=m | |
10093 | CONFIG_IP_NF_MATCH_MULTIPORT=m | |
10094 | CONFIG_IP_NF_MATCH_TOS=m | |
10095 | +CONFIG_IP_NF_MATCH_RECENT=m | |
10096 | CONFIG_IP_NF_MATCH_ECN=m | |
10097 | CONFIG_IP_NF_MATCH_DSCP=m | |
10098 | CONFIG_IP_NF_MATCH_AH_ESP=m | |
10099 | @@ -425,10 +443,9 @@ | |
10100 | CONFIG_IP_NF_TARGET_TCPMSS=m | |
10101 | CONFIG_IP_NF_ARPTABLES=m | |
10102 | CONFIG_IP_NF_ARPFILTER=m | |
10103 | +CONFIG_IP_NF_ARP_MANGLE=m | |
10104 | CONFIG_IP_NF_COMPAT_IPCHAINS=m | |
10105 | # CONFIG_IP_NF_COMPAT_IPFWADM is not set | |
10106 | -# CONFIG_IPV6 is not set | |
10107 | -# CONFIG_XFRM_USER is not set | |
10108 | ||
10109 | # | |
10110 | # SCTP Configuration (EXPERIMENTAL) | |
10111 | @@ -438,8 +455,6 @@ | |
10112 | # CONFIG_ATM is not set | |
10113 | # CONFIG_VLAN_8021Q is not set | |
10114 | # CONFIG_LLC is not set | |
10115 | -# CONFIG_DECNET is not set | |
10116 | -# CONFIG_BRIDGE is not set | |
10117 | # CONFIG_X25 is not set | |
10118 | # CONFIG_LAPB is not set | |
10119 | # CONFIG_NET_DIVERT is not set | |
10120 | @@ -516,6 +531,7 @@ | |
10121 | # CONFIG_HAMACHI is not set | |
10122 | # CONFIG_YELLOWFIN is not set | |
10123 | # CONFIG_R8169 is not set | |
10124 | +# CONFIG_SIS190 is not set | |
10125 | # CONFIG_SK98LIN is not set | |
10126 | # CONFIG_TIGON3 is not set | |
10127 | ||
10128 | @@ -568,6 +584,7 @@ | |
10129 | CONFIG_PCMCIA_HERMES=m | |
10130 | # CONFIG_AIRO_CS is not set | |
10131 | # CONFIG_PCMCIA_ATMEL is not set | |
10132 | +# CONFIG_PCMCIA_WL3501 is not set | |
10133 | CONFIG_NET_WIRELESS=y | |
10134 | ||
10135 | # | |
10136 | @@ -637,25 +654,18 @@ | |
10137 | # | |
10138 | # Old SIR device drivers | |
10139 | # | |
10140 | -# CONFIG_IRTTY_OLD is not set | |
10141 | # CONFIG_IRPORT_SIR is not set | |
10142 | ||
10143 | # | |
10144 | # Old Serial dongle support | |
10145 | # | |
10146 | -# CONFIG_DONGLE_OLD is not set | |
10147 | ||
10148 | # | |
10149 | # FIR device drivers | |
10150 | # | |
10151 | # CONFIG_USB_IRDA is not set | |
10152 | -# CONFIG_NSC_FIR is not set | |
10153 | -# CONFIG_WINBOND_FIR is not set | |
10154 | # CONFIG_TOSHIBA_OLD is not set | |
10155 | # CONFIG_TOSHIBA_FIR is not set | |
10156 | -# CONFIG_SMC_IRCC_OLD is not set | |
10157 | -# CONFIG_SMC_IRCC_FIR is not set | |
10158 | -# CONFIG_ALI_FIR is not set | |
10159 | # CONFIG_VLSI_FIR is not set | |
10160 | ||
10161 | # | |
10162 | @@ -721,11 +731,6 @@ | |
10163 | CONFIG_LOGO_LINUX_CLUT224=y | |
10164 | ||
10165 | # | |
10166 | -# Old CD-ROM drivers (not SCSI, not IDE) | |
10167 | -# | |
10168 | -# CONFIG_CD_NO_IDESCSI is not set | |
10169 | - | |
10170 | -# | |
10171 | # Input device support | |
10172 | # | |
10173 | CONFIG_INPUT=y | |
10174 | @@ -766,7 +771,7 @@ | |
10175 | CONFIG_PMAC_PBOOK=y | |
10176 | CONFIG_PMAC_APM_EMU=y | |
10177 | CONFIG_PMAC_BACKLIGHT=y | |
10178 | -CONFIG_MAC_FLOPPY=y | |
10179 | +# CONFIG_MAC_FLOPPY is not set | |
10180 | CONFIG_MAC_SERIAL=y | |
10181 | CONFIG_ADB=y | |
10182 | CONFIG_ADB_MACIO=y | |
10183 | @@ -808,10 +813,12 @@ | |
10184 | # | |
10185 | # I2C Hardware Sensors Mainboard support | |
10186 | # | |
10187 | +# CONFIG_I2C_ALI1535 is not set | |
10188 | # CONFIG_I2C_ALI15X3 is not set | |
10189 | # CONFIG_I2C_AMD756 is not set | |
10190 | # CONFIG_I2C_AMD8111 is not set | |
10191 | # CONFIG_I2C_I801 is not set | |
10192 | +# CONFIG_I2C_NFORCE2 is not set | |
10193 | # CONFIG_I2C_PIIX4 is not set | |
10194 | # CONFIG_I2C_SIS96X is not set | |
10195 | # CONFIG_I2C_VIAPRO is not set | |
10196 | @@ -823,6 +830,7 @@ | |
10197 | # CONFIG_SENSORS_IT87 is not set | |
10198 | # CONFIG_SENSORS_LM75 is not set | |
10199 | # CONFIG_SENSORS_LM85 is not set | |
10200 | +# CONFIG_SENSORS_LM78 is not set | |
10201 | # CONFIG_SENSORS_VIA686A is not set | |
10202 | # CONFIG_SENSORS_W83781D is not set | |
10203 | # CONFIG_I2C_SENSOR is not set | |
10204 | @@ -1028,8 +1036,7 @@ | |
10205 | # Sound | |
10206 | # | |
10207 | CONFIG_SOUND=m | |
10208 | -CONFIG_DMASOUND_AWACS=m | |
10209 | -CONFIG_DMASOUND=m | |
10210 | +# CONFIG_DMASOUND_AWACS is not set | |
10211 | ||
10212 | # | |
10213 | # Advanced Linux Sound Architecture | |
10214 | @@ -1168,6 +1175,7 @@ | |
10215 | # | |
10216 | # USB Network adaptors | |
10217 | # | |
10218 | +# CONFIG_USB_AX8817X is not set | |
10219 | # CONFIG_USB_CATC is not set | |
10220 | # CONFIG_USB_KAWETH is not set | |
10221 | # CONFIG_USB_PEGASUS is not set | |
10222 | @@ -1231,7 +1239,6 @@ | |
10223 | # Kernel hacking | |
10224 | # | |
10225 | # CONFIG_DEBUG_KERNEL is not set | |
10226 | -CONFIG_KALLSYMS=y | |
10227 | CONFIG_BOOTX_TEXT=y | |
10228 | ||
10229 | # | |
10230 | diff -Nru a/arch/ppc/configs/power3_defconfig b/arch/ppc/configs/power3_defconfig | |
10231 | --- a/arch/ppc/configs/power3_defconfig Tue Jul 1 17:01:18 2003 | |
10232 | +++ b/arch/ppc/configs/power3_defconfig Sat Aug 23 02:33:38 2003 | |
10233 | @@ -9,6 +9,7 @@ | |
10234 | # Code maturity level options | |
10235 | # | |
10236 | CONFIG_EXPERIMENTAL=y | |
10237 | +# CONFIG_BROKEN is not set | |
10238 | ||
10239 | # | |
10240 | # General setup | |
10241 | @@ -18,9 +19,15 @@ | |
10242 | # CONFIG_BSD_PROCESS_ACCT is not set | |
10243 | CONFIG_SYSCTL=y | |
10244 | CONFIG_LOG_BUF_SHIFT=15 | |
10245 | +CONFIG_IKCONFIG=y | |
10246 | +CONFIG_IKCONFIG_PROC=y | |
10247 | # CONFIG_EMBEDDED is not set | |
10248 | +CONFIG_KALLSYMS=y | |
10249 | CONFIG_FUTEX=y | |
10250 | CONFIG_EPOLL=y | |
10251 | +CONFIG_IOSCHED_NOOP=y | |
10252 | +CONFIG_IOSCHED_AS=y | |
10253 | +CONFIG_IOSCHED_DEADLINE=y | |
10254 | ||
10255 | # | |
10256 | # Loadable module support | |
10257 | @@ -82,8 +89,8 @@ | |
10258 | CONFIG_PCI=y | |
10259 | CONFIG_PCI_DOMAINS=y | |
10260 | CONFIG_KCORE_ELF=y | |
10261 | -CONFIG_BINFMT_ELF=y | |
10262 | CONFIG_KERNEL_ELF=y | |
10263 | +CONFIG_BINFMT_ELF=y | |
10264 | CONFIG_BINFMT_MISC=y | |
10265 | CONFIG_PCI_LEGACY_PROC=y | |
10266 | CONFIG_PCI_NAMES=y | |
10267 | @@ -121,6 +128,10 @@ | |
10268 | CONFIG_BOOT_LOAD=0x00800000 | |
10269 | ||
10270 | # | |
10271 | +# Generic Driver Options | |
10272 | +# | |
10273 | + | |
10274 | +# | |
10275 | # Memory Technology Devices (MTD) | |
10276 | # | |
10277 | # CONFIG_MTD is not set | |
10278 | @@ -140,10 +151,12 @@ | |
10279 | # CONFIG_BLK_DEV_DAC960 is not set | |
10280 | # CONFIG_BLK_DEV_UMEM is not set | |
10281 | CONFIG_BLK_DEV_LOOP=y | |
10282 | +# CONFIG_BLK_DEV_CRYPTOLOOP is not set | |
10283 | # CONFIG_BLK_DEV_NBD is not set | |
10284 | CONFIG_BLK_DEV_RAM=y | |
10285 | CONFIG_BLK_DEV_RAM_SIZE=4096 | |
10286 | CONFIG_BLK_DEV_INITRD=y | |
10287 | +CONFIG_LBD=y | |
10288 | ||
10289 | # | |
10290 | # Multi-device support (RAID and LVM) | |
10291 | @@ -156,14 +169,15 @@ | |
10292 | CONFIG_MD_RAID5=y | |
10293 | # CONFIG_MD_MULTIPATH is not set | |
10294 | CONFIG_BLK_DEV_DM=y | |
10295 | +CONFIG_DM_IOCTL_V4=y | |
10296 | ||
10297 | # | |
10298 | -# ATA/IDE/MFM/RLL support | |
10299 | +# ATA/ATAPI/MFM/RLL support | |
10300 | # | |
10301 | # CONFIG_IDE is not set | |
10302 | ||
10303 | # | |
10304 | -# SCSI support | |
10305 | +# SCSI device support | |
10306 | # | |
10307 | CONFIG_SCSI=y | |
10308 | ||
10309 | @@ -196,8 +210,6 @@ | |
10310 | # CONFIG_SCSI_AIC79XX is not set | |
10311 | # CONFIG_SCSI_DPT_I2O is not set | |
10312 | # CONFIG_SCSI_ADVANSYS is not set | |
10313 | -# CONFIG_SCSI_IN2000 is not set | |
10314 | -# CONFIG_SCSI_AM53C974 is not set | |
10315 | # CONFIG_SCSI_MEGARAID is not set | |
10316 | # CONFIG_SCSI_BUSLOGIC is not set | |
10317 | # CONFIG_SCSI_CPQFCTS is not set | |
10318 | @@ -206,13 +218,10 @@ | |
10319 | # CONFIG_SCSI_EATA_PIO is not set | |
10320 | # CONFIG_SCSI_FUTURE_DOMAIN is not set | |
10321 | # CONFIG_SCSI_GDTH is not set | |
10322 | -# CONFIG_SCSI_GENERIC_NCR5380 is not set | |
10323 | -# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set | |
10324 | # CONFIG_SCSI_INITIO is not set | |
10325 | # CONFIG_SCSI_INIA100 is not set | |
10326 | # CONFIG_SCSI_PPA is not set | |
10327 | # CONFIG_SCSI_IMM is not set | |
10328 | -# CONFIG_SCSI_NCR53C7xx is not set | |
10329 | CONFIG_SCSI_SYM53C8XX_2=y | |
10330 | CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 | |
10331 | CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 | |
10332 | @@ -225,7 +234,6 @@ | |
10333 | # CONFIG_SCSI_QLOGIC_1280 is not set | |
10334 | # CONFIG_SCSI_DC395x is not set | |
10335 | # CONFIG_SCSI_DC390T is not set | |
10336 | -# CONFIG_SCSI_U14_34F is not set | |
10337 | # CONFIG_SCSI_NSP32 is not set | |
10338 | # CONFIG_SCSI_DEBUG is not set | |
10339 | # CONFIG_SCSI_MESH is not set | |
10340 | @@ -257,7 +265,6 @@ | |
10341 | CONFIG_PACKET=y | |
10342 | # CONFIG_PACKET_MMAP is not set | |
10343 | # CONFIG_NETLINK_DEV is not set | |
10344 | -# CONFIG_NETFILTER is not set | |
10345 | CONFIG_UNIX=y | |
10346 | # CONFIG_NET_KEY is not set | |
10347 | CONFIG_INET=y | |
10348 | @@ -274,7 +281,9 @@ | |
10349 | # CONFIG_INET_ESP is not set | |
10350 | # CONFIG_INET_IPCOMP is not set | |
10351 | # CONFIG_IPV6 is not set | |
10352 | -# CONFIG_XFRM_USER is not set | |
10353 | +# CONFIG_DECNET is not set | |
10354 | +# CONFIG_BRIDGE is not set | |
10355 | +# CONFIG_NETFILTER is not set | |
10356 | ||
10357 | # | |
10358 | # SCTP Configuration (EXPERIMENTAL) | |
10359 | @@ -284,8 +293,6 @@ | |
10360 | # CONFIG_ATM is not set | |
10361 | # CONFIG_VLAN_8021Q is not set | |
10362 | # CONFIG_LLC is not set | |
10363 | -# CONFIG_DECNET is not set | |
10364 | -# CONFIG_BRIDGE is not set | |
10365 | # CONFIG_X25 is not set | |
10366 | # CONFIG_LAPB is not set | |
10367 | # CONFIG_NET_DIVERT is not set | |
10368 | @@ -362,6 +369,7 @@ | |
10369 | # CONFIG_HAMACHI is not set | |
10370 | # CONFIG_YELLOWFIN is not set | |
10371 | # CONFIG_R8169 is not set | |
10372 | +# CONFIG_SIS190 is not set | |
10373 | # CONFIG_SK98LIN is not set | |
10374 | # CONFIG_TIGON3 is not set | |
10375 | ||
10376 | @@ -464,11 +472,6 @@ | |
10377 | CONFIG_LOGO_LINUX_CLUT224=y | |
10378 | ||
10379 | # | |
10380 | -# Old CD-ROM drivers (not SCSI, not IDE) | |
10381 | -# | |
10382 | -# CONFIG_CD_NO_IDESCSI is not set | |
10383 | - | |
10384 | -# | |
10385 | # Input device support | |
10386 | # | |
10387 | CONFIG_INPUT=y | |
10388 | @@ -495,6 +498,7 @@ | |
10389 | CONFIG_SERIO_SERPORT=y | |
10390 | # CONFIG_SERIO_CT82C710 is not set | |
10391 | # CONFIG_SERIO_PARKBD is not set | |
10392 | +# CONFIG_SERIO_PCIPS2 is not set | |
10393 | ||
10394 | # | |
10395 | # Input Device Drivers | |
10396 | @@ -554,9 +558,8 @@ | |
10397 | # | |
10398 | CONFIG_I2C=y | |
10399 | CONFIG_I2C_ALGOBIT=y | |
10400 | +# CONFIG_I2C_PROSAVAGE is not set | |
10401 | # CONFIG_I2C_PHILIPSPAR is not set | |
10402 | -# CONFIG_I2C_ELV is not set | |
10403 | -# CONFIG_I2C_VELLEMAN is not set | |
10404 | # CONFIG_SCx200_ACB is not set | |
10405 | CONFIG_I2C_ALGOPCF=y | |
10406 | # CONFIG_I2C_ELEKTOR is not set | |
10407 | @@ -566,10 +569,12 @@ | |
10408 | # | |
10409 | # I2C Hardware Sensors Mainboard support | |
10410 | # | |
10411 | +# CONFIG_I2C_ALI1535 is not set | |
10412 | # CONFIG_I2C_ALI15X3 is not set | |
10413 | # CONFIG_I2C_AMD756 is not set | |
10414 | # CONFIG_I2C_AMD8111 is not set | |
10415 | # CONFIG_I2C_I801 is not set | |
10416 | +# CONFIG_I2C_NFORCE2 is not set | |
10417 | # CONFIG_I2C_PIIX4 is not set | |
10418 | # CONFIG_I2C_SIS96X is not set | |
10419 | # CONFIG_I2C_VIAPRO is not set | |
10420 | @@ -581,6 +586,7 @@ | |
10421 | # CONFIG_SENSORS_IT87 is not set | |
10422 | # CONFIG_SENSORS_LM75 is not set | |
10423 | # CONFIG_SENSORS_LM85 is not set | |
10424 | +# CONFIG_SENSORS_LM78 is not set | |
10425 | # CONFIG_SENSORS_VIA686A is not set | |
10426 | # CONFIG_SENSORS_W83781D is not set | |
10427 | # CONFIG_I2C_SENSOR is not set | |
10428 | @@ -843,7 +849,6 @@ | |
10429 | # Kernel hacking | |
10430 | # | |
10431 | # CONFIG_DEBUG_KERNEL is not set | |
10432 | -CONFIG_KALLSYMS=y | |
10433 | CONFIG_BOOTX_TEXT=y | |
10434 | ||
10435 | # | |
10436 | diff -Nru a/arch/ppc/defconfig b/arch/ppc/defconfig | |
10437 | --- a/arch/ppc/defconfig Sat Aug 2 12:59:32 2003 | |
10438 | +++ b/arch/ppc/defconfig Sat Aug 23 02:33:38 2003 | |
10439 | @@ -9,6 +9,7 @@ | |
10440 | # Code maturity level options | |
10441 | # | |
10442 | CONFIG_EXPERIMENTAL=y | |
10443 | +# CONFIG_BROKEN is not set | |
10444 | ||
10445 | # | |
10446 | # General setup | |
10447 | @@ -18,9 +19,15 @@ | |
10448 | # CONFIG_BSD_PROCESS_ACCT is not set | |
10449 | CONFIG_SYSCTL=y | |
10450 | CONFIG_LOG_BUF_SHIFT=14 | |
10451 | +CONFIG_IKCONFIG=y | |
10452 | +CONFIG_IKCONFIG_PROC=y | |
10453 | # CONFIG_EMBEDDED is not set | |
10454 | +CONFIG_KALLSYMS=y | |
10455 | CONFIG_FUTEX=y | |
10456 | CONFIG_EPOLL=y | |
10457 | +CONFIG_IOSCHED_NOOP=y | |
10458 | +CONFIG_IOSCHED_AS=y | |
10459 | +CONFIG_IOSCHED_DEADLINE=y | |
10460 | ||
10461 | # | |
10462 | # Loadable module support | |
10463 | @@ -78,6 +85,7 @@ | |
10464 | # CONFIG_TAU_INT is not set | |
10465 | # CONFIG_TAU_AVERAGE is not set | |
10466 | CONFIG_CPU_FREQ=y | |
10467 | +CONFIG_CPU_FREQ_TABLE=y | |
10468 | CONFIG_CPU_FREQ_PROC_INTF=y | |
10469 | CONFIG_CPU_FREQ_24_API=y | |
10470 | CONFIG_CPU_FREQ_PMAC=y | |
10471 | @@ -89,8 +97,8 @@ | |
10472 | CONFIG_PCI=y | |
10473 | CONFIG_PCI_DOMAINS=y | |
10474 | CONFIG_KCORE_ELF=y | |
10475 | -CONFIG_BINFMT_ELF=y | |
10476 | CONFIG_KERNEL_ELF=y | |
10477 | +CONFIG_BINFMT_ELF=y | |
10478 | CONFIG_BINFMT_MISC=m | |
10479 | CONFIG_PCI_LEGACY_PROC=y | |
10480 | CONFIG_PCI_NAMES=y | |
10481 | @@ -128,6 +136,11 @@ | |
10482 | CONFIG_BOOT_LOAD=0x00800000 | |
10483 | ||
10484 | # | |
10485 | +# Generic Driver Options | |
10486 | +# | |
10487 | +# CONFIG_FW_LOADER is not set | |
10488 | + | |
10489 | +# | |
10490 | # Memory Technology Devices (MTD) | |
10491 | # | |
10492 | # CONFIG_MTD is not set | |
10493 | @@ -146,10 +159,12 @@ | |
10494 | # CONFIG_BLK_DEV_DAC960 is not set | |
10495 | # CONFIG_BLK_DEV_UMEM is not set | |
10496 | CONFIG_BLK_DEV_LOOP=y | |
10497 | +# CONFIG_BLK_DEV_CRYPTOLOOP is not set | |
10498 | # CONFIG_BLK_DEV_NBD is not set | |
10499 | CONFIG_BLK_DEV_RAM=y | |
10500 | CONFIG_BLK_DEV_RAM_SIZE=4096 | |
10501 | CONFIG_BLK_DEV_INITRD=y | |
10502 | +CONFIG_LBD=y | |
10503 | ||
10504 | # | |
10505 | # Multi-device support (RAID and LVM) | |
10506 | @@ -157,40 +172,38 @@ | |
10507 | # CONFIG_MD is not set | |
10508 | ||
10509 | # | |
10510 | -# ATA/IDE/MFM/RLL support | |
10511 | +# ATA/ATAPI/MFM/RLL support | |
10512 | # | |
10513 | CONFIG_IDE=y | |
10514 | - | |
10515 | -# | |
10516 | -# IDE, ATA and ATAPI Block devices | |
10517 | -# | |
10518 | CONFIG_BLK_DEV_IDE=y | |
10519 | ||
10520 | # | |
10521 | # Please see Documentation/ide.txt for help/info on IDE drives | |
10522 | # | |
10523 | -# CONFIG_BLK_DEV_HD is not set | |
10524 | CONFIG_BLK_DEV_IDEDISK=y | |
10525 | # CONFIG_IDEDISK_MULTI_MODE is not set | |
10526 | # CONFIG_IDEDISK_STROKE is not set | |
10527 | CONFIG_BLK_DEV_IDECD=y | |
10528 | +# CONFIG_BLK_DEV_IDETAPE is not set | |
10529 | CONFIG_BLK_DEV_IDEFLOPPY=y | |
10530 | CONFIG_BLK_DEV_IDESCSI=y | |
10531 | # CONFIG_IDE_TASK_IOCTL is not set | |
10532 | +# CONFIG_IDE_TASKFILE_IO is not set | |
10533 | ||
10534 | # | |
10535 | # IDE chipset support/bugfixes | |
10536 | # | |
10537 | CONFIG_BLK_DEV_IDEPCI=y | |
10538 | -CONFIG_BLK_DEV_GENERIC=y | |
10539 | CONFIG_IDEPCI_SHARE_IRQ=y | |
10540 | +# CONFIG_BLK_DEV_OFFBOARD is not set | |
10541 | +CONFIG_BLK_DEV_GENERIC=y | |
10542 | +# CONFIG_BLK_DEV_OPTI621 is not set | |
10543 | +CONFIG_BLK_DEV_SL82C105=y | |
10544 | CONFIG_BLK_DEV_IDEDMA_PCI=y | |
10545 | # CONFIG_BLK_DEV_IDE_TCQ is not set | |
10546 | -# CONFIG_BLK_DEV_OFFBOARD is not set | |
10547 | # CONFIG_BLK_DEV_IDEDMA_FORCED is not set | |
10548 | CONFIG_IDEDMA_PCI_AUTO=y | |
10549 | # CONFIG_IDEDMA_ONLYDISK is not set | |
10550 | -CONFIG_BLK_DEV_IDEDMA=y | |
10551 | # CONFIG_IDEDMA_PCI_WIP is not set | |
10552 | CONFIG_BLK_DEV_ADMA=y | |
10553 | # CONFIG_BLK_DEV_AEC62XX is not set | |
10554 | @@ -200,12 +213,12 @@ | |
10555 | # CONFIG_BLK_DEV_TRIFLEX is not set | |
10556 | # CONFIG_BLK_DEV_CY82C693 is not set | |
10557 | # CONFIG_BLK_DEV_CS5520 is not set | |
10558 | +# CONFIG_BLK_DEV_CS5530 is not set | |
10559 | # CONFIG_BLK_DEV_HPT34X is not set | |
10560 | # CONFIG_BLK_DEV_HPT366 is not set | |
10561 | # CONFIG_BLK_DEV_SC1200 is not set | |
10562 | # CONFIG_BLK_DEV_PIIX is not set | |
10563 | # CONFIG_BLK_DEV_NS87415 is not set | |
10564 | -# CONFIG_BLK_DEV_OPTI621 is not set | |
10565 | # CONFIG_BLK_DEV_PDC202XX_OLD is not set | |
10566 | # CONFIG_BLK_DEV_PDC202XX_NEW is not set | |
10567 | # CONFIG_BLK_DEV_SVWKS is not set | |
10568 | @@ -213,15 +226,17 @@ | |
10569 | # CONFIG_BLK_DEV_SLC90E66 is not set | |
10570 | # CONFIG_BLK_DEV_TRM290 is not set | |
10571 | # CONFIG_BLK_DEV_VIA82CXXX is not set | |
10572 | -CONFIG_BLK_DEV_SL82C105=y | |
10573 | CONFIG_BLK_DEV_IDE_PMAC=y | |
10574 | CONFIG_BLK_DEV_IDEDMA_PMAC=y | |
10575 | CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO=y | |
10576 | -CONFIG_IDEDMA_AUTO=y | |
10577 | +CONFIG_BLK_DEV_IDEDMA=y | |
10578 | # CONFIG_IDEDMA_IVB is not set | |
10579 | +CONFIG_IDEDMA_AUTO=y | |
10580 | +# CONFIG_DMA_NONPCI is not set | |
10581 | +# CONFIG_BLK_DEV_HD is not set | |
10582 | ||
10583 | # | |
10584 | -# SCSI support | |
10585 | +# SCSI device support | |
10586 | # | |
10587 | CONFIG_SCSI=y | |
10588 | ||
10589 | @@ -261,8 +276,6 @@ | |
10590 | # CONFIG_SCSI_AIC79XX is not set | |
10591 | # CONFIG_SCSI_DPT_I2O is not set | |
10592 | CONFIG_SCSI_ADVANSYS=m | |
10593 | -# CONFIG_SCSI_IN2000 is not set | |
10594 | -# CONFIG_SCSI_AM53C974 is not set | |
10595 | # CONFIG_SCSI_MEGARAID is not set | |
10596 | # CONFIG_SCSI_BUSLOGIC is not set | |
10597 | # CONFIG_SCSI_CPQFCTS is not set | |
10598 | @@ -271,11 +284,8 @@ | |
10599 | # CONFIG_SCSI_EATA_PIO is not set | |
10600 | # CONFIG_SCSI_FUTURE_DOMAIN is not set | |
10601 | # CONFIG_SCSI_GDTH is not set | |
10602 | -# CONFIG_SCSI_GENERIC_NCR5380 is not set | |
10603 | -# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set | |
10604 | # CONFIG_SCSI_INITIO is not set | |
10605 | # CONFIG_SCSI_INIA100 is not set | |
10606 | -# CONFIG_SCSI_NCR53C7xx is not set | |
10607 | CONFIG_SCSI_SYM53C8XX_2=y | |
10608 | CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 | |
10609 | CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 | |
10610 | @@ -288,7 +298,6 @@ | |
10611 | # CONFIG_SCSI_QLOGIC_1280 is not set | |
10612 | # CONFIG_SCSI_DC395x is not set | |
10613 | # CONFIG_SCSI_DC390T is not set | |
10614 | -# CONFIG_SCSI_U14_34F is not set | |
10615 | # CONFIG_SCSI_NSP32 is not set | |
10616 | # CONFIG_SCSI_DEBUG is not set | |
10617 | CONFIG_SCSI_MESH=y | |
10618 | @@ -322,8 +331,6 @@ | |
10619 | CONFIG_PACKET=y | |
10620 | # CONFIG_PACKET_MMAP is not set | |
10621 | # CONFIG_NETLINK_DEV is not set | |
10622 | -CONFIG_NETFILTER=y | |
10623 | -# CONFIG_NETFILTER_DEBUG is not set | |
10624 | CONFIG_UNIX=y | |
10625 | # CONFIG_NET_KEY is not set | |
10626 | CONFIG_INET=y | |
10627 | @@ -341,6 +348,16 @@ | |
10628 | # CONFIG_INET_IPCOMP is not set | |
10629 | ||
10630 | # | |
10631 | +# IP: Virtual Server Configuration | |
10632 | +# | |
10633 | +# CONFIG_IP_VS is not set | |
10634 | +# CONFIG_IPV6 is not set | |
10635 | +# CONFIG_DECNET is not set | |
10636 | +# CONFIG_BRIDGE is not set | |
10637 | +CONFIG_NETFILTER=y | |
10638 | +# CONFIG_NETFILTER_DEBUG is not set | |
10639 | + | |
10640 | +# | |
10641 | # IP: Netfilter Configuration | |
10642 | # | |
10643 | CONFIG_IP_NF_CONNTRACK=m | |
10644 | @@ -356,6 +373,7 @@ | |
10645 | CONFIG_IP_NF_MATCH_MARK=m | |
10646 | CONFIG_IP_NF_MATCH_MULTIPORT=m | |
10647 | CONFIG_IP_NF_MATCH_TOS=m | |
10648 | +CONFIG_IP_NF_MATCH_RECENT=m | |
10649 | CONFIG_IP_NF_MATCH_ECN=m | |
10650 | CONFIG_IP_NF_MATCH_DSCP=m | |
10651 | CONFIG_IP_NF_MATCH_AH_ESP=m | |
10652 | @@ -386,10 +404,9 @@ | |
10653 | CONFIG_IP_NF_TARGET_TCPMSS=m | |
10654 | CONFIG_IP_NF_ARPTABLES=m | |
10655 | CONFIG_IP_NF_ARPFILTER=m | |
10656 | +CONFIG_IP_NF_ARP_MANGLE=m | |
10657 | CONFIG_IP_NF_COMPAT_IPCHAINS=m | |
10658 | # CONFIG_IP_NF_COMPAT_IPFWADM is not set | |
10659 | -# CONFIG_IPV6 is not set | |
10660 | -# CONFIG_XFRM_USER is not set | |
10661 | ||
10662 | # | |
10663 | # SCTP Configuration (EXPERIMENTAL) | |
10664 | @@ -399,8 +416,6 @@ | |
10665 | # CONFIG_ATM is not set | |
10666 | # CONFIG_VLAN_8021Q is not set | |
10667 | # CONFIG_LLC is not set | |
10668 | -# CONFIG_DECNET is not set | |
10669 | -# CONFIG_BRIDGE is not set | |
10670 | # CONFIG_X25 is not set | |
10671 | # CONFIG_LAPB is not set | |
10672 | # CONFIG_NET_DIVERT is not set | |
10673 | @@ -477,6 +492,7 @@ | |
10674 | # CONFIG_HAMACHI is not set | |
10675 | # CONFIG_YELLOWFIN is not set | |
10676 | # CONFIG_R8169 is not set | |
10677 | +# CONFIG_SIS190 is not set | |
10678 | # CONFIG_SK98LIN is not set | |
10679 | # CONFIG_TIGON3 is not set | |
10680 | ||
10681 | @@ -548,7 +564,7 @@ | |
10682 | # Graphics support | |
10683 | # | |
10684 | CONFIG_FB=y | |
10685 | -CONFIG_FB_CIRRUS=y | |
10686 | +# CONFIG_FB_CIRRUS is not set | |
10687 | # CONFIG_FB_PM2 is not set | |
10688 | # CONFIG_FB_CYBER2000 is not set | |
10689 | CONFIG_FB_OF=y | |
10690 | @@ -602,11 +618,6 @@ | |
10691 | CONFIG_LOGO_LINUX_CLUT224=y | |
10692 | ||
10693 | # | |
10694 | -# Old CD-ROM drivers (not SCSI, not IDE) | |
10695 | -# | |
10696 | -# CONFIG_CD_NO_IDESCSI is not set | |
10697 | - | |
10698 | -# | |
10699 | # Input device support | |
10700 | # | |
10701 | CONFIG_INPUT=y | |
10702 | @@ -632,6 +643,7 @@ | |
10703 | CONFIG_SERIO_I8042=y | |
10704 | CONFIG_SERIO_SERPORT=y | |
10705 | # CONFIG_SERIO_CT82C710 is not set | |
10706 | +# CONFIG_SERIO_PCIPS2 is not set | |
10707 | ||
10708 | # | |
10709 | # Input Device Drivers | |
10710 | @@ -698,10 +710,12 @@ | |
10711 | # | |
10712 | # I2C Hardware Sensors Mainboard support | |
10713 | # | |
10714 | +# CONFIG_I2C_ALI1535 is not set | |
10715 | # CONFIG_I2C_ALI15X3 is not set | |
10716 | # CONFIG_I2C_AMD756 is not set | |
10717 | # CONFIG_I2C_AMD8111 is not set | |
10718 | # CONFIG_I2C_I801 is not set | |
10719 | +# CONFIG_I2C_NFORCE2 is not set | |
10720 | # CONFIG_I2C_PIIX4 is not set | |
10721 | # CONFIG_I2C_SIS96X is not set | |
10722 | # CONFIG_I2C_VIAPRO is not set | |
10723 | @@ -713,6 +727,7 @@ | |
10724 | # CONFIG_SENSORS_IT87 is not set | |
10725 | # CONFIG_SENSORS_LM75 is not set | |
10726 | # CONFIG_SENSORS_LM85 is not set | |
10727 | +# CONFIG_SENSORS_LM78 is not set | |
10728 | # CONFIG_SENSORS_VIA686A is not set | |
10729 | # CONFIG_SENSORS_W83781D is not set | |
10730 | # CONFIG_I2C_SENSOR is not set | |
10731 | @@ -1047,6 +1062,7 @@ | |
10732 | # | |
10733 | # USB Network adaptors | |
10734 | # | |
10735 | +# CONFIG_USB_AX8817X is not set | |
10736 | # CONFIG_USB_CATC is not set | |
10737 | # CONFIG_USB_KAWETH is not set | |
10738 | # CONFIG_USB_PEGASUS is not set | |
10739 | @@ -1123,7 +1139,6 @@ | |
10740 | # Kernel hacking | |
10741 | # | |
10742 | # CONFIG_DEBUG_KERNEL is not set | |
10743 | -CONFIG_KALLSYMS=y | |
10744 | CONFIG_BOOTX_TEXT=y | |
10745 | ||
10746 | # | |
10747 | diff -Nru a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile | |
10748 | --- a/arch/ppc/kernel/Makefile Mon Aug 4 20:55:20 2003 | |
10749 | +++ b/arch/ppc/kernel/Makefile Wed Sep 3 05:16:34 2003 | |
10750 | @@ -12,6 +12,7 @@ | |
10751 | # Start off with 'head.o', change as needed. | |
10752 | extra-y := head.o | |
10753 | extra-$(CONFIG_40x) := head_4xx.o | |
10754 | +extra-$(CONFIG_44x) := head_44x.o | |
10755 | extra-$(CONFIG_8xx) := head_8xx.o | |
10756 | extra-$(CONFIG_6xx) += idle_6xx.o | |
10757 | extra-y += vmlinux.lds.s | |
10758 | diff -Nru a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c | |
10759 | --- a/arch/ppc/kernel/cputable.c Sun Apr 27 05:41:48 2003 | |
10760 | +++ b/arch/ppc/kernel/cputable.c Wed Sep 3 05:16:34 2003 | |
10761 | @@ -154,6 +154,15 @@ | |
10762 | 32, 32, | |
10763 | __setup_cpu_750cx | |
10764 | }, | |
10765 | + { /* 750FX rev 1.x */ | |
10766 | + 0xffffff00, 0x70000100, "750FX", | |
10767 | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | | |
10768 | + CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP | | |
10769 | + CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM, | |
10770 | + COMMON_PPC, | |
10771 | + 32, 32, | |
10772 | + __setup_cpu_750 | |
10773 | + }, | |
10774 | { /* 750FX rev 2.0 must disable HID0[DPM] */ | |
10775 | 0xffffffff, 0x70000200, "750FX", | |
10776 | CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | | |
10777 | @@ -424,7 +433,7 @@ | |
10778 | }, | |
10779 | ||
10780 | #endif /* CONFIG_40x */ | |
10781 | -#ifdef CONFIG_440 | |
10782 | +#ifdef CONFIG_44x | |
10783 | { /* 440GP Rev. B */ | |
10784 | 0xf0000fff, 0x40000440, "440GP Rev. B", | |
10785 | CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, | |
10786 | @@ -439,7 +448,14 @@ | |
10787 | 32, 32, | |
10788 | 0, /*__setup_cpu_440 */ | |
10789 | }, | |
10790 | -#endif /* CONFIG_440 */ | |
10791 | + { /* 440GX Rev. A */ | |
10792 | + 0xf0000fff, 0x50000850, "440GX Rev. A", | |
10793 | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, | |
10794 | + PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, | |
10795 | + 32, 32, | |
10796 | + 0, /*__setup_cpu_440 */ | |
10797 | + }, | |
10798 | +#endif /* CONFIG_44x */ | |
10799 | #if !CLASSIC_PPC | |
10800 | { /* default match */ | |
10801 | 0x00000000, 0x00000000, "(generic PPC)", | |
10802 | diff -Nru a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S | |
10803 | --- a/arch/ppc/kernel/head.S Wed Jun 4 20:07:15 2003 | |
10804 | +++ b/arch/ppc/kernel/head.S Tue Aug 26 06:38:51 2003 | |
10805 | @@ -355,11 +355,6 @@ | |
10806 | * -- paulus. | |
10807 | */ | |
10808 | . = 0x200 | |
10809 | -MachineCheck: | |
10810 | -BEGIN_FTR_SECTION | |
10811 | - dssall | |
10812 | - sync | |
10813 | -END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) | |
10814 | mtspr SPRG0,r10 | |
10815 | mtspr SPRG1,r11 | |
10816 | mfcr r10 | |
10817 | diff -Nru a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S | |
10818 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
10819 | +++ b/arch/ppc/kernel/head_44x.S Wed Sep 3 02:08:48 2003 | |
10820 | @@ -0,0 +1,1056 @@ | |
10821 | +/* | |
10822 | + * arch/ppc/kernel/head_44x.S | |
10823 | + * | |
10824 | + * Kernel execution entry point code. | |
10825 | + * | |
10826 | + * Matt Porter <mporter@mvista.com> | |
10827 | + * | |
10828 | + * Copyright 2002-2003 MontaVista Software, Inc. | |
10829 | + * | |
10830 | + * This program is free software; you can redistribute it and/or modify it | |
10831 | + * under the terms of the GNU General Public License as published by the | |
10832 | + * Free Software Foundation; either version 2 of the License, or (at your | |
10833 | + * option) any later version. | |
10834 | + */ | |
10835 | + | |
10836 | +#include <linux/config.h> | |
10837 | +#include <asm/processor.h> | |
10838 | +#include <asm/page.h> | |
10839 | +#include <asm/mmu.h> | |
10840 | +#include <asm/pgtable.h> | |
10841 | +#include <asm/ibm4xx.h> | |
10842 | +#include <asm/ibm44x.h> | |
10843 | +#include <asm/cputable.h> | |
10844 | +#include <asm/thread_info.h> | |
10845 | +#include <asm/ppc_asm.h> | |
10846 | +#include <asm/offsets.h> | |
10847 | + | |
10848 | +/* | |
10849 | + * Macros | |
10850 | + */ | |
10851 | + | |
10852 | +#define SET_IVOR(vector_number, vector_label) \ | |
10853 | + li r26,vector_label@l; \ | |
10854 | + mtspr SPRN_IVOR##vector_number,r26; \ | |
10855 | + sync | |
10856 | + | |
10857 | +/* As with the other PowerPC ports, it is expected that when code | |
10858 | + * execution begins here, the following registers contain valid, yet | |
10859 | + * optional, information: | |
10860 | + * | |
10861 | + * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.) | |
10862 | + * r4 - Starting address of the init RAM disk | |
10863 | + * r5 - Ending address of the init RAM disk | |
10864 | + * r6 - Start of kernel command line string (e.g. "mem=128") | |
10865 | + * r7 - End of kernel command line string | |
10866 | + * | |
10867 | + */ | |
10868 | + .text | |
10869 | +_GLOBAL(_stext) | |
10870 | +_GLOBAL(_start) | |
10871 | + /* | |
10872 | + * Reserve a word at a fixed location to store the address | |
10873 | + * of abatron_pteptrs | |
10874 | + */ | |
10875 | + nop | |
10876 | +/* | |
10877 | + * Save parameters we are passed | |
10878 | + */ | |
10879 | + mr r31,r3 | |
10880 | + mr r30,r4 | |
10881 | + mr r29,r5 | |
10882 | + mr r28,r6 | |
10883 | + mr r27,r7 | |
10884 | + li r24,0 /* CPU number */ | |
10885 | + | |
10886 | +/* | |
10887 | + * Set up the initial MMU state | |
10888 | + * | |
10889 | + * We are still executing code at the virtual address | |
10890 | + * mappings set by the firmware for the base of RAM. | |
10891 | + * | |
10892 | + * We first invalidate all TLB entries but the one | |
10893 | + * we are running from. We then load the KERNELBASE | |
10894 | + * mappings so we can begin to use kernel addresses | |
10895 | + * natively and so the interrupt vector locations are | |
10896 | + * permanently pinned (necessary since Book E | |
10897 | + * implementations always have translation enabled). | |
10898 | + * | |
10899 | + * TODO: Use the known TLB entry we are running from to | |
10900 | + * determine which physical region we are located | |
10901 | + * in. This can be used to determine where in RAM | |
10902 | + * (on a shared CPU system) or PCI memory space | |
10903 | + * (on a DRAMless system) we are located. | |
10904 | + * For now, we assume a perfect world which means | |
10905 | + * we are located at the base of DRAM (physical 0). | |
10906 | + */ | |
10907 | + | |
10908 | +/* | |
10909 | + * Search TLB for entry that we are currently using. | |
10910 | + * Invalidate all entries but the one we are using. | |
10911 | + */ | |
10912 | + /* Load our current PID->MMUCR TID and MSR IS->MMUCR STS */ | |
10913 | + mfspr r3,SPRN_MMUCR /* Get MMUCR */ | |
10914 | + lis r4,PPC44x_MMUCR_STS@h | |
10915 | + ori r4,r4,PPC44x_MMUCR_TID@l /* Create mask */ | |
10916 | + andc r3,r3,r4 /* Clear out TID/STS bits */ | |
10917 | + mfspr r4,SPRN_PID /* Get PID */ | |
10918 | + or r3,r3,r4 /* Set TID bits */ | |
10919 | + mfmsr r5 /* Get MSR */ | |
10920 | + andi. r5,r5,MSR_IS@l /* TS=1? */ | |
10921 | + beq wmmucr /* If not, leave STS=0 */ | |
10922 | + oris r3,r3,PPC44x_MMUCR_STS@h /* Set STS=1 */ | |
10923 | +wmmucr: mtspr SPRN_MMUCR,r3 /* Put MMUCR */ | |
10924 | + sync | |
10925 | + | |
10926 | + bl invstr /* Find our address */ | |
10927 | +invstr: mflr r5 /* Make it accessible */ | |
10928 | + tlbsx r23,0,r5 /* Find entry we are in */ | |
10929 | + li r4,0 /* Start at TLB entry 0 */ | |
10930 | + li r3,0 /* Set PAGEID inval value */ | |
10931 | +1: cmpw r23,r4 /* Is this our entry? */ | |
10932 | + beq skpinv /* If so, skip the inval */ | |
10933 | + tlbwe r3,r4,PPC44x_TLB_PAGEID /* If not, inval the entry */ | |
10934 | +skpinv: addi r4,r4,1 /* Increment */ | |
10935 | + cmpwi r4,64 /* Are we done? */ | |
10936 | + bne 1b /* If not, repeat */ | |
10937 | + isync /* If so, context change */ | |
10938 | + | |
10939 | +/* | |
10940 | + * Configure and load pinned entries into TLB slots 62 and 63. | |
10941 | + */ | |
10942 | + | |
10943 | + lis r3,KERNELBASE@h /* Load the kernel virtual address */ | |
10944 | + ori r3,r3,KERNELBASE@l | |
10945 | + | |
10946 | + /* Kernel is at the base of RAM */ | |
10947 | + li r4, 0 /* Load the kernel physical address */ | |
10948 | + | |
10949 | + /* Load the kernel PID = 0 */ | |
10950 | + li r0,0 | |
10951 | + mtspr SPRN_PID,r0 | |
10952 | + sync | |
10953 | + | |
10954 | + /* Load the kernel TID = 0 */ | |
10955 | + mfspr r5,SPRN_MMUCR | |
10956 | + lis r6, PPC44x_MMUCR_TID@h | |
10957 | + ori r6,r6,PPC44x_MMUCR_TID@l | |
10958 | + andc r5,r5,r6 | |
10959 | + mtspr SPRN_MMUCR,r5 | |
10960 | + sync | |
10961 | + | |
10962 | + /* pageid fields */ | |
10963 | + clrrwi r3,r3,10 /* Mask off the effective page number */ | |
10964 | + ori r3,r3,(PPC44x_TLB_VALID | PPC44x_TLB_PAGESZ(PPC44x_PAGESZ_256M)) | |
10965 | + | |
10966 | + /* xlat fields */ | |
10967 | + clrrwi r4,r4,10 /* Mask off the real page number */ | |
10968 | + /* ERPN is 0 for first 4GB page */ | |
10969 | + | |
10970 | + /* attrib fields */ | |
10971 | + /* Added guarded bit to protect against speculative loads/stores */ | |
10972 | + li r5,0 | |
10973 | + ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G) | |
10974 | + | |
10975 | + li r0,62 /* TLB slot 62 */ | |
10976 | + | |
10977 | + tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */ | |
10978 | + tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */ | |
10979 | + tlbwe r5,r0,PPC44x_TLB_ATTRIB /* Load the attrib/access fields */ | |
10980 | + | |
10981 | + /* Force context change */ | |
10982 | + mfmsr r0 | |
10983 | + mtspr SRR1, r0 | |
10984 | + lis r0,3f@h | |
10985 | + ori r0,r0,3f@l | |
10986 | + mtspr SRR0,r0 | |
10987 | + sync | |
10988 | + rfi | |
10989 | + | |
10990 | + /* If necessary, invalidate original entry we used */ | |
10991 | +3: cmpwi r23,62 | |
10992 | + beq 4f | |
10993 | + li r6,0 | |
10994 | + tlbwe r6,r23,PPC44x_TLB_PAGEID | |
10995 | + sync | |
10996 | + | |
10997 | +4: ori r3,r3,PPC44x_TLB_TS /* TS = 1 */ | |
10998 | + | |
10999 | + li r0,63 /* TLB slot 63 */ | |
11000 | + | |
11001 | + tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */ | |
11002 | + tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */ | |
11003 | + tlbwe r5,r0,PPC44x_TLB_ATTRIB /* Load the attrib/access fields */ | |
11004 | + | |
11005 | +#ifdef CONFIG_SERIAL_TEXT_DEBUG | |
11006 | + /* | |
11007 | + * Add temporary UART mapping for early debug. This | |
11008 | + * mapping must be identical to that used by the early | |
11009 | + * bootloader code since the same asm/serial.h parameters | |
11010 | + * are used for polled operation. | |
11011 | + */ | |
11012 | + /* pageid fields */ | |
11013 | + lis r3,0xe000 | |
11014 | + ori r3,r3,(PPC44x_TLB_VALID | PPC44x_TLB_PAGESZ(PPC44x_PAGESZ_256M)) | |
11015 | + | |
11016 | + /* xlat fields */ | |
11017 | + lis r4,0x4000 /* RPN is 0x40000000 */ | |
11018 | + ori r4,r4,0x0001 /* ERPN is 1 for second 4GB page */ | |
11019 | + | |
11020 | + /* attrib fields */ | |
11021 | + li r5,0 | |
11022 | + ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G) | |
11023 | + | |
11024 | + li r0,60 /* TLB slot 60 */ | |
11025 | + | |
11026 | + tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */ | |
11027 | + tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */ | |
11028 | + tlbwe r5,r0,PPC44x_TLB_ATTRIB /* Load the attrib/access fields */ | |
11029 | + | |
11030 | + ori r3,r3,PPC44x_TLB_TS /* Translation state 1 */ | |
11031 | + | |
11032 | + li r0,61 /* TLB slot 61 */ | |
11033 | + | |
11034 | + tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */ | |
11035 | + tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */ | |
11036 | + tlbwe r5,r0,PPC44x_TLB_ATTRIB /* Load the attrib/access fields */ | |
11037 | +#endif /* CONFIG_SERIAL_TEXT_DEBUG */ | |
11038 | + | |
11039 | + /* Force context change */ | |
11040 | + isync | |
11041 | + | |
11042 | + /* Establish the interrupt vector offsets */ | |
11043 | + SET_IVOR(0, CriticalInput); | |
11044 | + SET_IVOR(1, MachineCheck); | |
11045 | + SET_IVOR(2, DataStorage); | |
11046 | + SET_IVOR(3, InstructionStorage); | |
11047 | + SET_IVOR(4, ExternalInput); | |
11048 | + SET_IVOR(5, Alignment); | |
11049 | + SET_IVOR(6, Program); | |
11050 | + SET_IVOR(7, FloatingPointUnavailable); | |
11051 | + SET_IVOR(8, SystemCall); | |
11052 | + SET_IVOR(9, AuxillaryProcessorUnavailable); | |
11053 | + SET_IVOR(10, Decrementer); | |
11054 | + SET_IVOR(11, FixedIntervalTimer); | |
11055 | + SET_IVOR(12, WatchdogTimer); | |
11056 | + SET_IVOR(13, DataTLBError); | |
11057 | + SET_IVOR(14, InstructionTLBError); | |
11058 | + SET_IVOR(15, Debug); | |
11059 | + | |
11060 | + /* Establish the interrupt vector base */ | |
11061 | + lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ | |
11062 | + mtspr SPRN_IVPR,r4 | |
11063 | + | |
11064 | + /* | |
11065 | + * This is where the main kernel code starts. | |
11066 | + */ | |
11067 | + | |
11068 | + /* ptr to current */ | |
11069 | + lis r2,init_task@h | |
11070 | + ori r2,r2,init_task@l | |
11071 | + | |
11072 | + /* ptr to current thread */ | |
11073 | + addi r4,r2,THREAD /* init task's THREAD */ | |
11074 | + mtspr SPRG3,r4 | |
11075 | + | |
11076 | + /* stack */ | |
11077 | + lis r1,init_thread_union@h | |
11078 | + ori r1,r1,init_thread_union@l | |
11079 | + li r0,0 | |
11080 | + stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1) | |
11081 | + | |
11082 | + bl early_init | |
11083 | + | |
11084 | +/* | |
11085 | + * Decide what sort of machine this is and initialize the MMU. | |
11086 | + */ | |
11087 | + mr r3,r31 | |
11088 | + mr r4,r30 | |
11089 | + mr r5,r29 | |
11090 | + mr r6,r28 | |
11091 | + mr r7,r27 | |
11092 | + bl machine_init | |
11093 | + bl MMU_init | |
11094 | + | |
11095 | + /* Setup PTE pointers for the Abatron bdiGDB */ | |
11096 | + lis r6, swapper_pg_dir@h | |
11097 | + ori r6, r6, swapper_pg_dir@l | |
11098 | + lis r5, abatron_pteptrs@h | |
11099 | + ori r5, r5, abatron_pteptrs@l | |
11100 | + lis r4, KERNELBASE@h | |
11101 | + ori r4, r4, KERNELBASE@l | |
11102 | + stw r5, 0(r4) /* Save abatron_pteptrs at a fixed location */ | |
11103 | + stw r6, 0(r5) | |
11104 | + | |
11105 | + /* Let's move on */ | |
11106 | + lis r4,start_kernel@h | |
11107 | + ori r4,r4,start_kernel@l | |
11108 | + lis r3,MSR_KERNEL@h | |
11109 | + ori r3,r3,MSR_KERNEL@l | |
11110 | + mtspr SRR0,r4 | |
11111 | + mtspr SRR1,r3 | |
11112 | + rfi /* change context and jump to start_kernel */ | |
11113 | + | |
11114 | +/* | |
11115 | + * Interrupt vector entry code | |
11116 | + * | |
11117 | + * The Book E MMUs are always on so we don't need to handle | |
11118 | + * interrupts in real mode as with previous PPC processors. In | |
11119 | + * this case we handle interrupts in the kernel virtual address | |
11120 | + * space. | |
11121 | + * | |
11122 | + * Interrupt vectors are dynamically placed relative to the | |
11123 | + * interrupt prefix as determined by the address of interrupt_base. | |
11124 | + * The interrupt vectors offsets are programmed using the labels | |
11125 | + * for each interrupt vector entry. | |
11126 | + * | |
11127 | + * Interrupt vectors must be aligned on a 16 byte boundary. | |
11128 | + * We align on a 32 byte cache line boundary for good measure. | |
11129 | + */ | |
11130 | + | |
11131 | +#define NORMAL_EXCEPTION_PROLOG \ | |
11132 | + mtspr SPRN_SPRG0,r10; /* save two registers to work with */\ | |
11133 | + mtspr SPRN_SPRG1,r11; \ | |
11134 | + mtspr SPRN_SPRG2,r1; \ | |
11135 | + mfcr r10; /* save CR in r10 for now */\ | |
11136 | + mfspr r11,SPRN_SRR1; /* check whether user or kernel */\ | |
11137 | + andi. r11,r11,MSR_PR; \ | |
11138 | + beq 1f; \ | |
11139 | + mfspr r1,SPRG3; /* if from user, start at top of */\ | |
11140 | + lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\ | |
11141 | + addi r1,r1,THREAD_SIZE; \ | |
11142 | +1: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\ | |
11143 | + tophys(r11,r1); \ | |
11144 | + stw r10,_CCR(r11); /* save various registers */\ | |
11145 | + stw r12,GPR12(r11); \ | |
11146 | + stw r9,GPR9(r11); \ | |
11147 | + mfspr r10,SPRG0; \ | |
11148 | + stw r10,GPR10(r11); \ | |
11149 | + mfspr r12,SPRG1; \ | |
11150 | + stw r12,GPR11(r11); \ | |
11151 | + mflr r10; \ | |
11152 | + stw r10,_LINK(r11); \ | |
11153 | + mfspr r10,SPRG2; \ | |
11154 | + mfspr r12,SRR0; \ | |
11155 | + stw r10,GPR1(r11); \ | |
11156 | + mfspr r9,SRR1; \ | |
11157 | + stw r10,0(r11); \ | |
11158 | + rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\ | |
11159 | + stw r0,GPR0(r11); \ | |
11160 | + SAVE_4GPRS(3, r11); \ | |
11161 | + SAVE_2GPRS(7, r11) | |
11162 | + | |
11163 | +/* | |
11164 | + * Exception prolog for critical exceptions. This is a little different | |
11165 | + * from the normal exception prolog above since a critical exception | |
11166 | + * can potentially occur at any point during normal exception processing. | |
11167 | + * Thus we cannot use the same SPRG registers as the normal prolog above. | |
11168 | + * Instead we use a couple of words of memory at low physical addresses. | |
11169 | + * This is OK since we don't support SMP on these processors. | |
11170 | + */ | |
11171 | +/* XXX but we don't have RAM mapped at 0 in space 0 -- paulus. */ | |
11172 | +#define CRITICAL_EXCEPTION_PROLOG \ | |
11173 | + stw r10,crit_r10@l(0); /* save two registers to work with */\ | |
11174 | + stw r11,crit_r11@l(0); \ | |
11175 | + mfspr r10,SPRG0; \ | |
11176 | + stw r10,crit_sprg0@l(0); \ | |
11177 | + mfspr r10,SPRG1; \ | |
11178 | + stw r10,crit_sprg1@l(0); \ | |
11179 | + mfspr r10,SPRG4R; \ | |
11180 | + stw r10,crit_sprg4@l(0); \ | |
11181 | + mfspr r10,SPRG5R; \ | |
11182 | + stw r10,crit_sprg5@l(0); \ | |
11183 | + mfspr r10,SPRG6R; \ | |
11184 | + stw r10,crit_sprg6@l(0); \ | |
11185 | + mfspr r10,SPRG7R; \ | |
11186 | + stw r10,crit_sprg7@l(0); \ | |
11187 | + mfspr r10,SPRN_PID; \ | |
11188 | + stw r10,crit_pid@l(0); \ | |
11189 | + mfspr r10,SRR0; \ | |
11190 | + stw r10,crit_srr0@l(0); \ | |
11191 | + mfspr r10,SRR1; \ | |
11192 | + stw r10,crit_srr1@l(0); \ | |
11193 | + mfcr r10; /* save CR in r10 for now */\ | |
11194 | + mfspr r11,SPRN_CSRR1; /* check whether user or kernel */\ | |
11195 | + andi. r11,r11,MSR_PR; \ | |
11196 | + lis r11,critical_stack_top@h; \ | |
11197 | + ori r11,r11,critical_stack_top@l; \ | |
11198 | + beq 1f; \ | |
11199 | + /* COMING FROM USER MODE */ \ | |
11200 | + mfspr r11,SPRG3; /* if from user, start at top of */\ | |
11201 | + lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\ | |
11202 | + addi r11,r11,THREAD_SIZE; \ | |
11203 | +1: subi r11,r11,INT_FRAME_SIZE; /* Allocate an exception frame */\ | |
11204 | + tophys(r11,r11); \ | |
11205 | + stw r10,_CCR(r11); /* save various registers */\ | |
11206 | + stw r12,GPR12(r11); \ | |
11207 | + stw r9,GPR9(r11); \ | |
11208 | + mflr r10; \ | |
11209 | + stw r10,_LINK(r11); \ | |
11210 | + mfspr r12,SPRN_DEAR; /* save DEAR and ESR in the frame */\ | |
11211 | + stw r12,_DEAR(r11); /* since they may have had stuff */\ | |
11212 | + mfspr r9,SPRN_ESR; /* in them at the point where the */\ | |
11213 | + stw r9,_ESR(r11); /* exception was taken */\ | |
11214 | + mfspr r12,CSRR0; \ | |
11215 | + stw r1,GPR1(r11); \ | |
11216 | + mfspr r9,CSRR1; \ | |
11217 | + stw r1,0(r11); \ | |
11218 | + tovirt(r1,r11); \ | |
11219 | + rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\ | |
11220 | + stw r0,GPR0(r11); \ | |
11221 | + SAVE_4GPRS(3, r11); \ | |
11222 | + SAVE_2GPRS(7, r11) | |
11223 | + | |
11224 | +/* | |
11225 | + * Exception vectors. | |
11226 | + */ | |
11227 | +#define START_EXCEPTION(label) \ | |
11228 | + .align 5; \ | |
11229 | +label: | |
11230 | + | |
11231 | +#define FINISH_EXCEPTION(func) \ | |
11232 | + bl transfer_to_handler_full; \ | |
11233 | + .long func; \ | |
11234 | + .long ret_from_except_full | |
11235 | + | |
11236 | +#define EXCEPTION(n, label, hdlr, xfer) \ | |
11237 | + START_EXCEPTION(label); \ | |
11238 | + NORMAL_EXCEPTION_PROLOG; \ | |
11239 | + addi r3,r1,STACK_FRAME_OVERHEAD; \ | |
11240 | + xfer(n, hdlr) | |
11241 | + | |
11242 | +#define CRITICAL_EXCEPTION(n, label, hdlr) \ | |
11243 | + START_EXCEPTION(label); \ | |
11244 | + CRITICAL_EXCEPTION_PROLOG; \ | |
11245 | + addi r3,r1,STACK_FRAME_OVERHEAD; \ | |
11246 | + EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ | |
11247 | + NOCOPY, transfer_to_handler_full, \ | |
11248 | + ret_from_except_full) | |
11249 | + | |
11250 | +#define EXC_XFER_TEMPLATE(hdlr, trap, msr, copyee, tfer, ret) \ | |
11251 | + li r10,trap; \ | |
11252 | + stw r10,TRAP(r11); \ | |
11253 | + lis r10,msr@h; \ | |
11254 | + ori r10,r10,msr@l; \ | |
11255 | + copyee(r10, r9); \ | |
11256 | + bl tfer; \ | |
11257 | + .long hdlr; \ | |
11258 | + .long ret | |
11259 | + | |
11260 | +#define COPY_EE(d, s) rlwimi d,s,0,16,16 | |
11261 | +#define NOCOPY(d, s) | |
11262 | + | |
11263 | +#define EXC_XFER_STD(n, hdlr) \ | |
11264 | + EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, NOCOPY, transfer_to_handler_full, \ | |
11265 | + ret_from_except_full) | |
11266 | + | |
11267 | +#define EXC_XFER_LITE(n, hdlr) \ | |
11268 | + EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \ | |
11269 | + ret_from_except) | |
11270 | + | |
11271 | +#define EXC_XFER_EE(n, hdlr) \ | |
11272 | + EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, COPY_EE, transfer_to_handler_full, \ | |
11273 | + ret_from_except_full) | |
11274 | + | |
11275 | +#define EXC_XFER_EE_LITE(n, hdlr) \ | |
11276 | + EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, COPY_EE, transfer_to_handler, \ | |
11277 | + ret_from_except) | |
11278 | + | |
11279 | +interrupt_base: | |
11280 | + /* Critical Input Interrupt */ | |
11281 | + CRITICAL_EXCEPTION(0x0100, CriticalInput, UnknownException) | |
11282 | + | |
11283 | + /* Machine Check Interrupt */ | |
11284 | + CRITICAL_EXCEPTION(0x0200, MachineCheck, MachineCheckException) | |
11285 | + | |
11286 | + /* Data Storage Interrupt */ | |
11287 | + START_EXCEPTION(DataStorage) | |
11288 | + mtspr SPRG0, r10 /* Save some working registers */ | |
11289 | + mtspr SPRG1, r11 | |
11290 | + mtspr SPRG4W, r12 | |
11291 | + mtspr SPRG5W, r13 | |
11292 | + mtspr SPRG6W, r14 | |
11293 | + mfcr r11 | |
11294 | + mtspr SPRG7W, r11 | |
11295 | + | |
11296 | + /* | |
11297 | + * Check if it was a store fault, if not then bail | |
11298 | + * because a user tried to access a kernel or | |
11299 | + * read-protected page. Otherwise, get the | |
11300 | + * offending address and handle it. | |
11301 | + */ | |
11302 | + mfspr r10, SPRN_ESR | |
11303 | + andis. r10, r10, ESR_ST@h | |
11304 | + beq 2f | |
11305 | + | |
11306 | + mfspr r10, SPRN_DEAR /* Get faulting address */ | |
11307 | + | |
11308 | + /* If we are faulting a kernel address, we have to use the | |
11309 | + * kernel page tables. | |
11310 | + */ | |
11311 | + andis. r11, r10, 0x8000 | |
11312 | + beq 3f | |
11313 | + lis r11, swapper_pg_dir@h | |
11314 | + ori r11, r11, swapper_pg_dir@l | |
11315 | + | |
11316 | + mfspr r12,SPRN_MMUCR /* Set TID to 0 */ | |
11317 | + li r13,PPC44x_MMUCR_TID@l | |
11318 | + andc r12,r12,r13 | |
11319 | + mtspr SPRN_MMUCR,r12 | |
11320 | + | |
11321 | + b 4f | |
11322 | + | |
11323 | + /* Get the PGD for the current thread */ | |
11324 | +3: | |
11325 | + mfspr r11,SPRG3 | |
11326 | + lwz r11,PGDIR(r11) | |
11327 | + | |
11328 | + /* Load MMUCR with our PID and STS=<current TS> */ | |
11329 | + mfspr r12,SPRN_MMUCR /* Get MMUCR */ | |
11330 | + lis r13,PPC44x_MMUCR_STS@h | |
11331 | + ori r13,r13,PPC44x_MMUCR_TID@l /* Create mask */ | |
11332 | + andc r12,r12,r13 /* Clear out TID/STS bits */ | |
11333 | + mfspr r13,SPRN_PID /* Get PID */ | |
11334 | + or r12,r12,r13 /* Set TID bits */ | |
11335 | + mfspr r14,SPRN_SRR1 /* Get SRR1 */ | |
11336 | + andi. r14,r14,MSR_IS@l /* TS=1? */ | |
11337 | + beq 4f /* If not, leave STS=0 */ | |
11338 | + oris r12,r12,PPC44x_MMUCR_STS@h /* Set STS=1 */ | |
11339 | + mtspr SPRN_MMUCR,r12 | |
11340 | +4: | |
11341 | + rlwinm r12, r10, 13, 19, 29 /* Compute pgdir/pmd offset */ | |
11342 | + lwzx r11, r12, r11 /* Get pgd/pmd entry */ | |
11343 | + rlwinm. r12, r11, 0, 0, 20 /* Extract pt base address */ | |
11344 | + beq 2f /* Bail if no table */ | |
11345 | + | |
11346 | + rlwimi r12, r10, 23, 20, 28 /* Compute pte address */ | |
11347 | + lwz r11, 4(r12) /* Get pte entry */ | |
11348 | + | |
11349 | + andi. r13, r11, _PAGE_RW /* Is it writeable? */ | |
11350 | + beq 2f /* Bail if not */ | |
11351 | + | |
11352 | + /* Update 'changed'. | |
11353 | + */ | |
11354 | + ori r11, r11, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE | |
11355 | + stw r11, 4(r12) /* Update Linux page table */ | |
11356 | + | |
11357 | + /* FIXME: Staticly setting some permissions */ | |
11358 | + li r13, 0x003f /* Set UX,UW,UR,SX,SW,SR */ | |
11359 | + andi. r11,r11,0xffff /* Clear MS 16 bits */ | |
11360 | + /* FIXME: Force attributes */ | |
11361 | + ori r11,r11, 0x0100 /* Set G */ | |
11362 | + /* FIXME: Already set in PTE */ | |
11363 | + rlwimi r11,r13,0,26,31 /* Insert static perms */ | |
11364 | + | |
11365 | + lis r13,0xffff | |
11366 | + ori r13,r13,0x0fff /* Set U0-U3 mask */ | |
11367 | + and r11,r11,r13 /* Clear U0-U3 */ | |
11368 | + | |
11369 | + /* find the TLB index that caused the fault. It has to be here. */ | |
11370 | + tlbsx r14, 0, r10 | |
11371 | + | |
11372 | + tlbwe r11, r14, PPC44x_TLB_ATTRIB /* Write ATTRIB */ | |
11373 | + | |
11374 | + /* Done...restore registers and get out of here. | |
11375 | + */ | |
11376 | + mfspr r11, SPRG7R | |
11377 | + mtcr r11 | |
11378 | + mfspr r14, SPRG6R | |
11379 | + mfspr r13, SPRG5R | |
11380 | + mfspr r12, SPRG4R | |
11381 | + | |
11382 | + mfspr r11, SPRG1 | |
11383 | + mfspr r10, SPRG0 | |
11384 | + rfi /* Force context change */ | |
11385 | + | |
11386 | +2: | |
11387 | + /* | |
11388 | + * The bailout. Restore registers to pre-exception conditions | |
11389 | + * and call the heavyweights to help us out. | |
11390 | + */ | |
11391 | + mfspr r11, SPRG7R | |
11392 | + mtcr r11 | |
11393 | + mfspr r14, SPRG6R | |
11394 | + mfspr r13, SPRG5R | |
11395 | + mfspr r12, SPRG4R | |
11396 | + | |
11397 | + mfspr r11, SPRG1 | |
11398 | + mfspr r10, SPRG0 | |
11399 | + b data_access | |
11400 | + | |
11401 | + /* Instruction Storage Interrupt */ | |
11402 | + START_EXCEPTION(InstructionStorage) | |
11403 | + NORMAL_EXCEPTION_PROLOG | |
11404 | + mr r4,r12 /* Pass SRR0 as arg2 */ | |
11405 | + li r5,0 /* Pass zero as arg3 */ | |
11406 | + addi r3,r1,STACK_FRAME_OVERHEAD | |
11407 | + EXC_XFER_EE_LITE(0x0400, do_page_fault) | |
11408 | + | |
11409 | + /* External Input Interrupt */ | |
11410 | + EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE) | |
11411 | + | |
11412 | + /* Alignment Interrupt */ | |
11413 | + START_EXCEPTION(Alignment) | |
11414 | + NORMAL_EXCEPTION_PROLOG | |
11415 | + mfspr r4,SPRN_DEAR /* Grab the DEAR and save it */ | |
11416 | + stw r4,_DEAR(r11) | |
11417 | + addi r3,r1,STACK_FRAME_OVERHEAD | |
11418 | + EXC_XFER_EE(0x0600, AlignmentException) | |
11419 | + | |
11420 | + /* Program Interrupt */ | |
11421 | + START_EXCEPTION(Program) | |
11422 | + NORMAL_EXCEPTION_PROLOG | |
11423 | + mfspr r4,SPRN_ESR /* Grab the ESR and save it */ | |
11424 | + stw r4,_ESR(r11) | |
11425 | + addi r3,r1,STACK_FRAME_OVERHEAD | |
11426 | + EXC_XFER_EE(0x700, ProgramCheckException) | |
11427 | + | |
11428 | + /* Floating Point Unavailable Interrupt */ | |
11429 | + EXCEPTION(0x2010, FloatingPointUnavailable, UnknownException, EXC_XFER_EE) | |
11430 | + | |
11431 | + /* System Call Interrupt */ | |
11432 | + START_EXCEPTION(SystemCall) | |
11433 | + NORMAL_EXCEPTION_PROLOG | |
11434 | + EXC_XFER_EE_LITE(0x0c00, DoSyscall) | |
11435 | + | |
11436 | + /* Auxillary Processor Unavailable Interrupt */ | |
11437 | + EXCEPTION(0x2020, AuxillaryProcessorUnavailable, UnknownException, EXC_XFER_EE) | |
11438 | + | |
11439 | + /* Decrementer Interrupt */ | |
11440 | + START_EXCEPTION(Decrementer) | |
11441 | + NORMAL_EXCEPTION_PROLOG | |
11442 | + lis r0,TSR_DIS@h /* Setup the DEC interrupt mask */ | |
11443 | + mtspr SPRN_TSR,r0 /* Clear the DEC interrupt */ | |
11444 | + addi r3,r1,STACK_FRAME_OVERHEAD | |
11445 | + EXC_XFER_LITE(0x1000, timer_interrupt) | |
11446 | + | |
11447 | + /* Fixed Internal Timer Interrupt */ | |
11448 | + /* TODO: Add FIT support */ | |
11449 | + EXCEPTION(0x1010, FixedIntervalTimer, UnknownException, EXC_XFER_EE) | |
11450 | + | |
11451 | + /* Watchdog Timer Interrupt */ | |
11452 | + /* TODO: Add watchdog support */ | |
11453 | + CRITICAL_EXCEPTION(0x1020, WatchdogTimer, UnknownException) | |
11454 | + | |
11455 | + /* Data TLB Error Interrupt */ | |
11456 | + START_EXCEPTION(DataTLBError) | |
11457 | + mtspr SPRG0, r10 /* Save some working registers */ | |
11458 | + mtspr SPRG1, r11 | |
11459 | + mtspr SPRG4W, r12 | |
11460 | + mtspr SPRG5W, r13 | |
11461 | + mtspr SPRG6W, r14 | |
11462 | + mfcr r11 | |
11463 | + mtspr SPRG7W, r11 | |
11464 | + mfspr r10, SPRN_DEAR /* Get faulting address */ | |
11465 | + | |
11466 | + /* If we are faulting a kernel address, we have to use the | |
11467 | + * kernel page tables. | |
11468 | + */ | |
11469 | + andis. r11, r10, 0x8000 | |
11470 | + beq 3f | |
11471 | + lis r11, swapper_pg_dir@h | |
11472 | + ori r11, r11, swapper_pg_dir@l | |
11473 | + | |
11474 | + mfspr r12,SPRN_MMUCR /* Set TID to 0 */ | |
11475 | + li r13,PPC44x_MMUCR_TID@l | |
11476 | + andc r12,r12,r13 | |
11477 | + mtspr SPRN_MMUCR,r12 | |
11478 | + | |
11479 | + b 4f | |
11480 | + | |
11481 | + /* Get the PGD for the current thread */ | |
11482 | +3: | |
11483 | + mfspr r11,SPRG3 | |
11484 | + lwz r11,PGDIR(r11) | |
11485 | + | |
11486 | + /* Load PID into MMUCR TID */ | |
11487 | + li r13,PPC44x_MMUCR_TID@l /* Create mask */ | |
11488 | + andc r12,r12,r13 /* Clear out TID/STS bits */ | |
11489 | + mfspr r13,SPRN_PID /* Get PID */ | |
11490 | + or r12,r12,r13 | |
11491 | + mtspr SPRN_MMUCR,r12 | |
11492 | +4: | |
11493 | + rlwinm r12, r10, 13, 19, 29 /* Compute pgdir/pmd offset */ | |
11494 | + lwzx r11, r12, r11 /* Get pgd/pmd entry */ | |
11495 | + rlwinm. r12, r11, 0, 0, 20 /* Extract pt base address */ | |
11496 | + beq 2f /* Bail if no table */ | |
11497 | + | |
11498 | + rlwimi r12, r10, 23, 20, 28 /* Compute pte address */ | |
11499 | + lwz r11, 4(r12) /* Get pte entry */ | |
11500 | + andi. r13, r11, _PAGE_PRESENT /* Is the page present? */ | |
11501 | + beq 2f /* Bail if not present */ | |
11502 | + | |
11503 | + ori r11, r11, _PAGE_ACCESSED | |
11504 | + stw r11, 4(r12) | |
11505 | + | |
11506 | + /* Jump to common tlb load */ | |
11507 | + b finish_tlb_load | |
11508 | + | |
11509 | +2: | |
11510 | + /* The bailout. Restore registers to pre-exception conditions | |
11511 | + * and call the heavyweights to help us out. | |
11512 | + */ | |
11513 | + mfspr r11, SPRG7R | |
11514 | + mtcr r11 | |
11515 | + mfspr r14, SPRG6R | |
11516 | + mfspr r13, SPRG5R | |
11517 | + mfspr r12, SPRG4R | |
11518 | + mfspr r11, SPRG1 | |
11519 | + mfspr r10, SPRG0 | |
11520 | + b data_access | |
11521 | + | |
11522 | + /* Instruction TLB Error Interrupt */ | |
11523 | + /* | |
11524 | + * Nearly the same as above, except we get our | |
11525 | + * information from different registers and bailout | |
11526 | + * to a different point. | |
11527 | + */ | |
11528 | + START_EXCEPTION(InstructionTLBError) | |
11529 | + mtspr SPRG0, r10 /* Save some working registers */ | |
11530 | + mtspr SPRG1, r11 | |
11531 | + mtspr SPRG4W, r12 | |
11532 | + mtspr SPRG5W, r13 | |
11533 | + mtspr SPRG6W, r14 | |
11534 | + mfcr r11 | |
11535 | + mtspr SPRG7W, r11 | |
11536 | + mfspr r10, SRR0 /* Get faulting address */ | |
11537 | + | |
11538 | + /* If we are faulting a kernel address, we have to use the | |
11539 | + * kernel page tables. | |
11540 | + */ | |
11541 | + andis. r11, r10, 0x8000 | |
11542 | + beq 3f | |
11543 | + lis r11, swapper_pg_dir@h | |
11544 | + ori r11, r11, swapper_pg_dir@l | |
11545 | + | |
11546 | + mfspr r12,SPRN_MMUCR /* Set TID to 0 */ | |
11547 | + li r13,PPC44x_MMUCR_TID@l | |
11548 | + andc r12,r12,r13 | |
11549 | + mtspr SPRN_MMUCR,r12 | |
11550 | + | |
11551 | + b 4f | |
11552 | + | |
11553 | + /* Get the PGD for the current thread */ | |
11554 | +3: | |
11555 | + mfspr r11,SPRG3 | |
11556 | + lwz r11,PGDIR(r11) | |
11557 | + | |
11558 | + /* Load PID into MMUCR TID */ | |
11559 | + li r13,PPC44x_MMUCR_TID@l /* Create mask */ | |
11560 | + andc r12,r13,r13 /* Clear out TID/STS bits */ | |
11561 | + mfspr r13,SPRN_PID /* Get PID */ | |
11562 | + or r12,r12,r13 | |
11563 | + mtspr SPRN_MMUCR,r12 | |
11564 | + | |
11565 | +4: | |
11566 | + rlwinm r12, r10, 13, 19, 29 /* Compute pgdir/pmd offset */ | |
11567 | + lwzx r11, r12, r11 /* Get pgd/pmd entry */ | |
11568 | + rlwinm. r12, r11, 0, 0, 20 /* Extract pt base address */ | |
11569 | + beq 2f /* Bail if no table */ | |
11570 | + | |
11571 | + rlwimi r12, r10, 23, 20, 28 /* Compute pte address */ | |
11572 | + lwz r11, 4(r12) /* Get pte entry */ | |
11573 | + andi. r13, r11, _PAGE_PRESENT /* Is the page present? */ | |
11574 | + beq 2f /* Bail if not present */ | |
11575 | + | |
11576 | + ori r11, r11, _PAGE_ACCESSED | |
11577 | + stw r11, 4(r12) | |
11578 | + | |
11579 | + /* Jump to common TLB load point */ | |
11580 | + b finish_tlb_load | |
11581 | + | |
11582 | +2: | |
11583 | + /* The bailout. Restore registers to pre-exception conditions | |
11584 | + * and call the heavyweights to help us out. | |
11585 | + */ | |
11586 | + mfspr r11, SPRG7R | |
11587 | + mtcr r11 | |
11588 | + mfspr r14, SPRG6R | |
11589 | + mfspr r13, SPRG5R | |
11590 | + mfspr r12, SPRG4R | |
11591 | + mfspr r11, SPRG1 | |
11592 | + mfspr r10, SPRG0 | |
11593 | + b InstructionStorage | |
11594 | + | |
11595 | +/* Check for a single step debug exception while in an exception | |
11596 | + * handler before state has been saved. This is to catch the case | |
11597 | + * where an instruction that we are trying to single step causes | |
11598 | + * an exception (eg ITLB/DTLB miss) and thus the first instruction of | |
11599 | + * the exception handler generates a single step debug exception. | |
11600 | + * | |
11601 | + * If we get a debug trap on the first instruction of an exception handler, | |
11602 | + * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is | |
11603 | + * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR). | |
11604 | + * The exception handler was handling a non-critical interrupt, so it will | |
11605 | + * save (and later restore) the MSR via SPRN_SRR1, which will still have | |
11606 | + * the MSR_DE bit set. | |
11607 | + */ | |
11608 | + /* Debug Interrupt */ | |
11609 | + CRITICAL_EXCEPTION(0x2000, Debug, DebugException) | |
11610 | +#if 0 | |
11611 | + START_EXCEPTION(Debug) | |
11612 | + /* This first instruction was already executed by the exception | |
11613 | + * handler and must be the first instruction of every exception | |
11614 | + * handler. | |
11615 | + */ | |
11616 | + mtspr SPRN_SPRG0,r10 /* Save some working registers... */ | |
11617 | + mtspr SPRN_SPRG1,r11 | |
11618 | + mtspr SPRN_SPRG4W,r12 | |
11619 | + mfcr r10 /* ..and the cr because we change it */ | |
11620 | + | |
11621 | + mfspr r11,SPRN_CSRR1 /* MSR at the time of fault */ | |
11622 | + andi. r11,r11,MSR_PR | |
11623 | + bne+ 2f /* trapped from problem state */ | |
11624 | + | |
11625 | + mfspr r11,SPRN_CSRR0 /* Faulting instruction address */ | |
11626 | + lis r12, KERNELBASE@h | |
11627 | + ori r12, r12, KERNELBASE@l | |
11628 | + cmplw r11,r12 | |
11629 | + blt+ 2f /* addr below exception vectors */ | |
11630 | + | |
11631 | + lis r12, Debug@h | |
11632 | + ori r12, r12, Debug@l | |
11633 | + cmplw r11,r12 | |
11634 | + bgt+ 2f /* addr above TLB exception vectors */ | |
11635 | + | |
11636 | + lis r11,DBSR_IC@h /* Remove the trap status */ | |
11637 | + mtspr SPRN_DBSR,r11 | |
11638 | + | |
11639 | + mfspr r11,SPRN_CSRR1 | |
11640 | + rlwinm r11,r11,0,23,21 /* clear MSR_DE */ | |
11641 | + mtspr SPRN_CSRR1, r11 /* restore MSR at rcfi without DE */ | |
11642 | + | |
11643 | + mtcrf 0xff,r10 /* restore registers */ | |
11644 | + mfspr r12,SPRN_SPRG4R | |
11645 | + mfspr r11,SPRN_SPRG1 | |
11646 | + mfspr r10,SPRN_SPRG0 | |
11647 | + | |
11648 | + sync | |
11649 | + rfci /* return to the exception handler */ | |
11650 | + b . /* prevent prefetch past rfci */ | |
11651 | + | |
11652 | +2: | |
11653 | + mtcrf 0xff,r10 /* restore registers */ | |
11654 | + mfspr r12,SPRN_SPRG4R | |
11655 | + mfspr r11,SPRN_SPRG1 | |
11656 | + mfspr r10,SPRN_SPRG0 | |
11657 | + | |
11658 | + CRIT_EXCEPTION_PROLOG | |
11659 | + addi r3,r1,STACK_FRAME_OVERHEAD | |
11660 | + li r7,CRIT_EXC; | |
11661 | + li r9,MSR_KERNEL | |
11662 | + FINISH_EXCEPTION(DebugException) | |
11663 | +#endif | |
11664 | + | |
11665 | +/* | |
11666 | + * Local functions | |
11667 | + */ | |
11668 | + /* | |
11669 | + * Data TLB exceptions will bail out to this point | |
11670 | + * if they can't resolve the lightweight TLB fault. | |
11671 | + */ | |
11672 | +data_access: | |
11673 | + NORMAL_EXCEPTION_PROLOG | |
11674 | + mfspr r5,SPRN_ESR /* Grab the ESR, save it, pass arg3 */ | |
11675 | + stw r5,_ESR(r11) | |
11676 | + mfspr r4,SPRN_DEAR /* Grab the DEAR, save it, pass arg2 */ | |
11677 | + stw r4,_DEAR(r11) | |
11678 | + addi r3,r1,STACK_FRAME_OVERHEAD | |
11679 | + EXC_XFER_EE_LITE(0x0300, do_page_fault) | |
11680 | + | |
11681 | +/* | |
11682 | + | |
11683 | + * Both the instruction and data TLB miss get to this | |
11684 | + * point to load the TLB. | |
11685 | + * r10 - EA of fault | |
11686 | + * r11 - available to use | |
11687 | + * r12 - Pointer to the 64-bit PTE | |
11688 | + * r13 - available to use | |
11689 | + * r14 - available to use | |
11690 | + * MMUCR - loaded with proper value when we get here | |
11691 | + * Upon exit, we reload everything and RFI. | |
11692 | + */ | |
11693 | +finish_tlb_load: | |
11694 | + /* | |
11695 | + * We set execute, because we don't have the granularity to | |
11696 | + * properly set this at the page level (Linux problem). | |
11697 | + * If shared is set, we cause a zero PID->TID load. | |
11698 | + * Many of these bits are software only. Bits we don't set | |
11699 | + * here we (properly should) assume have the appropriate value. | |
11700 | + */ | |
11701 | + | |
11702 | + /* Load the next available TLB index */ | |
11703 | + lis r13, tlb_44x_index@h | |
11704 | + ori r13, r13, tlb_44x_index@l | |
11705 | + lwz r14, 0(r13) | |
11706 | + /* Load the TLB high watermark */ | |
11707 | + lis r13, tlb_44x_hwater@h | |
11708 | + ori r13, r13, tlb_44x_hwater@l | |
11709 | + lwz r11, 0(r13) | |
11710 | + | |
11711 | + | |
11712 | + /* Increment, rollover, and store TLB index */ | |
11713 | + addi r14, r14, 1 | |
11714 | + cmpw 0, r14, r11 /* reserve entries 62-63 for kernel */ | |
11715 | + ble 7f | |
11716 | + li r14, 0 | |
11717 | +7: | |
11718 | + /* Load the next available TLB index */ | |
11719 | + lis r13, tlb_44x_index@h | |
11720 | + ori r13, r13, tlb_44x_index@l | |
11721 | + stw r14, 0(r13) | |
11722 | + | |
11723 | +6: | |
11724 | + lwz r13, 0(r12) /* Get MS word of PTE */ | |
11725 | + lwz r11, 4(r12) /* Get LS word of PTE */ | |
11726 | + rlwimi r13, r11, 0, 0 , 19 /* Insert RPN */ | |
11727 | + tlbwe r13, r14, PPC44x_TLB_XLAT /* Write XLAT */ | |
11728 | + | |
11729 | + /* | |
11730 | + * Create PAGEID. This is the faulting address plus | |
11731 | + * a set of static bits. The static bits are page | |
11732 | + * size and valid. Bits 20 and 21 should be zero | |
11733 | + * for a page size of 4KB. | |
11734 | + */ | |
11735 | + li r12, 0x0210 /* Set size and valid */ | |
11736 | + mfspr r13, SPRN_SRR1 /* Get SRR1 */ | |
11737 | + andi. r13, r13, MSR_IS@l | |
11738 | + beq 7f | |
11739 | + ori r12, r12, PPC44x_TLB_TS@l /* Set TS=1 */ | |
11740 | +7: rlwimi r10, r12, 0, 20, 31 /* Insert statics */ | |
11741 | + tlbwe r10, r14, PPC44x_TLB_PAGEID /* Write PAGEID */ | |
11742 | + | |
11743 | + /* FIXME: Staticly setting some permissions */ | |
11744 | + li r13, 0x002d /* Set UX,UR,SX,SR */ | |
11745 | + andi. r11, r11, 0xffff /* Clear MS 16 bits */ | |
11746 | + andi. r12, r11, 0x0002 /* _PAGE_HWWRITE? */ | |
11747 | + beq 8f | |
11748 | + ori r13, r13, 0x0002 /* Set SW */ | |
11749 | + /* FIXME: Force attributes */ | |
11750 | +8: ori r11, r11, 0x0100 /* Set G */ | |
11751 | + /* FIXME: Already set in PTE */ | |
11752 | + rlwimi r11, r13, 0, 26, 31 /* Insert static perms */ | |
11753 | + | |
11754 | + lis r13,0xffff | |
11755 | + ori r13,r13,0x0fff /* Set U0-U3 mask */ | |
11756 | + and r11,r11,r13 /* Clear U0-U3 */ | |
11757 | + tlbwe r11, r14, PPC44x_TLB_ATTRIB /* Write ATTRIB */ | |
11758 | + | |
11759 | + /* Done...restore registers and get out of here. | |
11760 | + */ | |
11761 | + mfspr r11, SPRG7R | |
11762 | + mtcr r11 | |
11763 | + mfspr r14, SPRG6R | |
11764 | + mfspr r13, SPRG5R | |
11765 | + mfspr r12, SPRG4R | |
11766 | + mfspr r11, SPRG1 | |
11767 | + mfspr r10, SPRG0 | |
11768 | + rfi /* Force context change */ | |
11769 | + | |
11770 | +/* | |
11771 | + * Global functions | |
11772 | + */ | |
11773 | + | |
11774 | +/* | |
11775 | + * extern void giveup_altivec(struct task_struct *prev) | |
11776 | + * | |
11777 | + * The 44x core does not have an AltiVec unit. | |
11778 | + */ | |
11779 | +_GLOBAL(giveup_altivec) | |
11780 | + blr | |
11781 | + | |
11782 | +/* | |
11783 | + * extern void giveup_fpu(struct task_struct *prev) | |
11784 | + * | |
11785 | + * The 44x core does not have an FPU. | |
11786 | + */ | |
11787 | +_GLOBAL(giveup_fpu) | |
11788 | + blr | |
11789 | + | |
11790 | +/* | |
11791 | + * extern void abort(void) | |
11792 | + * | |
11793 | + * At present, this routine just applies a system reset. | |
11794 | + */ | |
11795 | +_GLOBAL(abort) | |
11796 | + mfspr r13,SPRN_DBCR0 | |
11797 | + oris r13,r13,DBCR_RST(DBCR_RST_SYSTEM)@h | |
11798 | + mtspr SPRN_DBCR0,r13 | |
11799 | + | |
11800 | +_GLOBAL(set_context) | |
11801 | + | |
11802 | +#ifdef CONFIG_BDI_SWITCH | |
11803 | + /* Context switch the PTE pointer for the Abatron BDI2000. | |
11804 | + * The PGDIR is the second parameter. | |
11805 | + */ | |
11806 | + lis r5, abatron_pteptrs@h | |
11807 | + ori r5, r5, abatron_pteptrs@l | |
11808 | + stw r4, 0x4(r5) | |
11809 | +#endif | |
11810 | + mtspr SPRN_PID,r3 | |
11811 | + isync /* Force context change */ | |
11812 | + blr | |
11813 | + | |
11814 | +/* | |
11815 | + * We put a few things here that have to be page-aligned. This stuff | |
11816 | + * goes at the beginning of the data segment, which is page-aligned. | |
11817 | + */ | |
11818 | + .data | |
11819 | +_GLOBAL(sdata) | |
11820 | +_GLOBAL(empty_zero_page) | |
11821 | + .space 4096 | |
11822 | + | |
11823 | +/* | |
11824 | + * To support >32-bit physical addresses, we use an 8KB pgdir. | |
11825 | + */ | |
11826 | +_GLOBAL(swapper_pg_dir) | |
11827 | + .space 8192 | |
11828 | + | |
11829 | +/* Stack for handling critical exceptions from kernel mode */ | |
11830 | + .section .bss | |
11831 | +critical_stack_bottom: | |
11832 | + .space 4096 | |
11833 | +critical_stack_top: | |
11834 | + .previous | |
11835 | + | |
11836 | +/* | |
11837 | + * This space gets a copy of optional info passed to us by the bootstrap | |
11838 | + * which is used to pass parameters into the kernel like root=/dev/sda1, etc. | |
11839 | + */ | |
11840 | +_GLOBAL(cmd_line) | |
11841 | + .space 512 | |
11842 | + | |
11843 | +/* | |
11844 | + * Room for two PTE pointers, usually the kernel and current user pointers | |
11845 | + * to their respective root page table. | |
11846 | + */ | |
11847 | +abatron_pteptrs: | |
11848 | + .space 8 | |
11849 | + | |
11850 | +/* | |
11851 | + * This area is used for temporarily saving registers during the | |
11852 | + * critical exception prolog. | |
11853 | + */ | |
11854 | +crit_save: | |
11855 | +_GLOBAL(crit_r10) | |
11856 | + .space 4 | |
11857 | +_GLOBAL(crit_r11) | |
11858 | + .space 4 | |
11859 | +_GLOBAL(crit_sprg0) | |
11860 | + .space 4 | |
11861 | +_GLOBAL(crit_sprg1) | |
11862 | + .space 4 | |
11863 | +_GLOBAL(crit_sprg4) | |
11864 | + .space 4 | |
11865 | +_GLOBAL(crit_sprg5) | |
11866 | + .space 4 | |
11867 | +_GLOBAL(crit_sprg6) | |
11868 | + .space 4 | |
11869 | +_GLOBAL(crit_sprg7) | |
11870 | + .space 4 | |
11871 | +_GLOBAL(crit_pid) | |
11872 | + .space 4 | |
11873 | +_GLOBAL(crit_srr0) | |
11874 | + .space 4 | |
11875 | +_GLOBAL(crit_srr1) | |
11876 | + .space 4 | |
11877 | diff -Nru a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S | |
11878 | --- a/arch/ppc/kernel/misc.S Tue Jul 15 04:47:19 2003 | |
11879 | +++ b/arch/ppc/kernel/misc.S Wed Sep 3 05:16:34 2003 | |
11880 | @@ -405,16 +405,20 @@ | |
11881 | sync /* Flush to memory before changing mapping */ | |
11882 | tlbia | |
11883 | isync /* Flush shadow TLB */ | |
11884 | -#elif defined(CONFIG_440) | |
11885 | +#elif defined(CONFIG_44x) | |
11886 | lis r3,0 | |
11887 | sync | |
11888 | 1: | |
11889 | - tlbwe r3,r3,PPC440_TLB_PAGEID | |
11890 | + tlbwe r3,r3,PPC44x_TLB_PAGEID | |
11891 | addi r3,r3,1 | |
11892 | - cmpwi 0,r3,61 | |
11893 | + /* Load high watermark */ | |
11894 | + lis r4,tlb_44x_hwater@h | |
11895 | + ori r4,r4,tlb_44x_hwater@l | |
11896 | + lwz r5,0(r4) | |
11897 | + cmpw 0,r3,r5 | |
11898 | ble 1b | |
11899 | isync | |
11900 | -#else /* !(CONFIG_40x || CONFIG_440) */ | |
11901 | +#else /* !(CONFIG_40x || CONFIG_44x) */ | |
11902 | #if defined(CONFIG_SMP) | |
11903 | rlwinm r8,r1,0,0,18 | |
11904 | lwz r8,TI_CPU(r8) | |
11905 | @@ -465,17 +469,17 @@ | |
11906 | tlbwe r3, r3, TLB_TAG | |
11907 | isync | |
11908 | 10: | |
11909 | -#elif defined(CONFIG_440) | |
11910 | +#elif defined(CONFIG_44x) | |
11911 | mfspr r4,SPRN_MMUCR /* Get MMUCR */ | |
11912 | - lis r5,PPC440_MMUCR_STS@h | |
11913 | - ori r5,r5,PPC440_MMUCR_TID@l /* Create mask */ | |
11914 | + lis r5,PPC44x_MMUCR_STS@h | |
11915 | + ori r5,r5,PPC44x_MMUCR_TID@l /* Create mask */ | |
11916 | andc r4,r4,r5 /* Clear out TID/STS bits */ | |
11917 | mfspr r5,SPRN_PID /* Get PID */ | |
11918 | or r4,r4,r5 /* Set TID bits */ | |
11919 | mfmsr r6 /* Get MSR */ | |
11920 | andi. r6,r6,MSR_IS@l /* TS=1? */ | |
11921 | beq 11f /* If not, leave STS=0 */ | |
11922 | - oris r4,r4,PPC440_MMUCR_STS@h /* Set STS=1 */ | |
11923 | + oris r4,r4,PPC44x_MMUCR_STS@h /* Set STS=1 */ | |
11924 | 11: mtspr SPRN_MMUCR, r4 /* Put MMUCR */ | |
11925 | ||
11926 | tlbsx. r3, 0, r3 | |
11927 | @@ -486,10 +490,10 @@ | |
11928 | * the V bit in the TLB_PAGEID, loading this | |
11929 | * value will invalidate the TLB entry. | |
11930 | */ | |
11931 | - tlbwe r3, r3, PPC440_TLB_PAGEID | |
11932 | + tlbwe r3, r3, PPC44x_TLB_PAGEID | |
11933 | isync | |
11934 | 10: | |
11935 | -#else /* !(CONFIG_40x || CONFIG_440) */ | |
11936 | +#else /* !(CONFIG_40x || CONFIG_44x) */ | |
11937 | #if defined(CONFIG_SMP) | |
11938 | rlwinm r8,r1,0,0,18 | |
11939 | lwz r8,TI_CPU(r8) | |
11940 | @@ -658,9 +662,9 @@ | |
11941 | #ifdef CONFIG_NOT_COHERENT_CACHE | |
11942 | /* | |
11943 | * 40x cores have 8K or 16K dcache and 32 byte line size. | |
11944 | - * 440 has a 32K dcache and 32 byte line size. | |
11945 | + * 44x has a 32K dcache and 32 byte line size. | |
11946 | * 8xx has 1, 2, 4, 8K variants. | |
11947 | - * For now, cover the worst case of the 440. | |
11948 | + * For now, cover the worst case of the 44x. | |
11949 | * Must be called with external interrupts disabled. | |
11950 | */ | |
11951 | #define CACHE_NWAYS 64 | |
11952 | @@ -1380,3 +1384,4 @@ | |
11953 | .long sys_utimes | |
11954 | .long sys_statfs64 | |
11955 | .long sys_fstatfs64 | |
11956 | + .long ppc_fadvise64_64 | |
11957 | diff -Nru a/arch/ppc/kernel/ppc-stub.c b/arch/ppc/kernel/ppc-stub.c | |
11958 | --- a/arch/ppc/kernel/ppc-stub.c Mon Jun 30 10:10:33 2003 | |
11959 | +++ b/arch/ppc/kernel/ppc-stub.c Mon Aug 25 11:39:55 2003 | |
11960 | @@ -106,6 +106,7 @@ | |
11961 | #include <linux/smp.h> | |
11962 | #include <linux/smp_lock.h> | |
11963 | ||
11964 | +#include <asm/cacheflush.h> | |
11965 | #include <asm/system.h> | |
11966 | #include <asm/signal.h> | |
11967 | #include <asm/kgdb.h> | |
11968 | @@ -136,7 +137,7 @@ | |
11969 | /* typedef void (*trapfunc_t)(void); */ | |
11970 | ||
11971 | static void kgdb_fault_handler(struct pt_regs *regs); | |
11972 | -static void handle_exception (struct pt_regs *regs); | |
11973 | +static int handle_exception (struct pt_regs *regs); | |
11974 | ||
11975 | #if 0 | |
11976 | /* Install an exception handler for kgdb */ | |
11977 | @@ -186,7 +187,7 @@ | |
11978 | * return 0. | |
11979 | */ | |
11980 | static unsigned char * | |
11981 | -mem2hex(char *mem, char *buf, int count) | |
11982 | +mem2hex(const char *mem, char *buf, int count) | |
11983 | { | |
11984 | unsigned char ch; | |
11985 | unsigned short tmp_s; | |
11986 | @@ -460,14 +461,12 @@ | |
11987 | ||
11988 | int kgdb_bpt(struct pt_regs *regs) | |
11989 | { | |
11990 | - handle_exception(regs); | |
11991 | - return 1; | |
11992 | + return handle_exception(regs); | |
11993 | } | |
11994 | ||
11995 | int kgdb_sstep(struct pt_regs *regs) | |
11996 | { | |
11997 | - handle_exception(regs); | |
11998 | - return 1; | |
11999 | + return handle_exception(regs); | |
12000 | } | |
12001 | ||
12002 | void kgdb(struct pt_regs *regs) | |
12003 | @@ -477,16 +476,14 @@ | |
12004 | ||
12005 | int kgdb_iabr_match(struct pt_regs *regs) | |
12006 | { | |
12007 | - printk("kgdb doesn't support iabr, what?!?\n"); | |
12008 | - handle_exception(regs); | |
12009 | - return 1; | |
12010 | + printk(KERN_ERR "kgdb doesn't support iabr, what?!?\n"); | |
12011 | + return handle_exception(regs); | |
12012 | } | |
12013 | ||
12014 | int kgdb_dabr_match(struct pt_regs *regs) | |
12015 | { | |
12016 | - printk("kgdb doesn't support dabr, what?!?\n"); | |
12017 | - handle_exception(regs); | |
12018 | - return 1; | |
12019 | + printk(KERN_ERR "kgdb doesn't support dabr, what?!?\n"); | |
12020 | + return handle_exception(regs); | |
12021 | } | |
12022 | ||
12023 | /* Convert the hardware trap type code to a unix signal number. */ | |
12024 | @@ -559,7 +556,7 @@ | |
12025 | /* | |
12026 | * This function does all command processing for interfacing to gdb. | |
12027 | */ | |
12028 | -static void | |
12029 | +static int | |
12030 | handle_exception (struct pt_regs *regs) | |
12031 | { | |
12032 | int sigval; | |
12033 | @@ -568,14 +565,19 @@ | |
12034 | char *ptr; | |
12035 | unsigned int msr; | |
12036 | ||
12037 | + /* We don't handle user-mode breakpoints. */ | |
12038 | + if (user_mode(regs)) | |
12039 | + return 0; | |
12040 | + | |
12041 | if (debugger_fault_handler) { | |
12042 | debugger_fault_handler(regs); | |
12043 | panic("kgdb longjump failed!\n"); | |
12044 | } | |
12045 | if (kgdb_active) { | |
12046 | - printk("interrupt while in kgdb, returning\n"); | |
12047 | - return; | |
12048 | + printk(KERN_ERR "interrupt while in kgdb, returning\n"); | |
12049 | + return 0; | |
12050 | } | |
12051 | + | |
12052 | kgdb_active = 1; | |
12053 | kgdb_started = 1; | |
12054 | ||
12055 | @@ -783,7 +785,7 @@ | |
12056 | printk("remcomInBuffer: %s\n", remcomInBuffer); | |
12057 | printk("remcomOutBuffer: %s\n", remcomOutBuffer); | |
12058 | } | |
12059 | - return; | |
12060 | + return 1; | |
12061 | ||
12062 | case 's': | |
12063 | kgdb_flush_cache_all(); | |
12064 | @@ -800,7 +802,7 @@ | |
12065 | printk("remcomInBuffer: %s\n", remcomInBuffer); | |
12066 | printk("remcomOutBuffer: %s\n", remcomOutBuffer); | |
12067 | } | |
12068 | - return; | |
12069 | + return 1; | |
12070 | ||
12071 | case 'r': /* Reset (if user process..exit ???)*/ | |
12072 | panic("kgdb reset."); | |
12073 | @@ -828,11 +830,11 @@ | |
12074 | return; | |
12075 | } | |
12076 | ||
12077 | - asm(" .globl breakinst | |
12078 | - breakinst: .long 0x7d821008 | |
12079 | - "); | |
12080 | + asm(" .globl breakinst \n\ | |
12081 | + breakinst: .long 0x7d821008"); | |
12082 | } | |
12083 | ||
12084 | +#ifdef CONFIG_KGDB_CONSOLE | |
12085 | /* Output string in GDB O-packet format if GDB has connected. If nothing | |
12086 | output, returns 0 (caller must then handle output). */ | |
12087 | int | |
12088 | @@ -852,3 +854,4 @@ | |
12089 | ||
12090 | return 1; | |
12091 | } | |
12092 | +#endif | |
12093 | diff -Nru a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c | |
12094 | --- a/arch/ppc/kernel/ppc_ksyms.c Tue Jul 1 10:57:22 2003 | |
12095 | +++ b/arch/ppc/kernel/ppc_ksyms.c Wed Sep 3 05:16:34 2003 | |
12096 | @@ -155,6 +155,9 @@ | |
12097 | EXPORT_SYMBOL(iopa); | |
12098 | EXPORT_SYMBOL(mm_ptov); | |
12099 | EXPORT_SYMBOL(ioremap); | |
12100 | +#ifdef CONFIG_44x | |
12101 | +EXPORT_SYMBOL(ioremap64); | |
12102 | +#endif | |
12103 | EXPORT_SYMBOL(__ioremap); | |
12104 | EXPORT_SYMBOL(iounmap); | |
12105 | EXPORT_SYMBOL(ioremap_bot); /* aka VMALLOC_END */ | |
12106 | @@ -200,6 +203,7 @@ | |
12107 | EXPORT_SYMBOL(flush_icache_user_range); | |
12108 | EXPORT_SYMBOL(flush_dcache_page); | |
12109 | EXPORT_SYMBOL(flush_tlb_kernel_range); | |
12110 | +EXPORT_SYMBOL(flush_tlb_page); | |
12111 | #ifdef CONFIG_ALTIVEC | |
12112 | EXPORT_SYMBOL(last_task_used_altivec); | |
12113 | EXPORT_SYMBOL(giveup_altivec); | |
12114 | @@ -259,6 +263,15 @@ | |
12115 | EXPORT_SYMBOL(pci_busdev_to_OF_node); | |
12116 | EXPORT_SYMBOL(pci_device_to_OF_node); | |
12117 | EXPORT_SYMBOL(pci_device_from_OF_node); | |
12118 | +EXPORT_SYMBOL(of_find_node_by_name); | |
12119 | +EXPORT_SYMBOL(of_find_node_by_type); | |
12120 | +EXPORT_SYMBOL(of_find_compatible_node); | |
12121 | +EXPORT_SYMBOL(of_find_node_by_path); | |
12122 | +EXPORT_SYMBOL(of_find_all_nodes); | |
12123 | +EXPORT_SYMBOL(of_get_parent); | |
12124 | +EXPORT_SYMBOL(of_get_next_child); | |
12125 | +EXPORT_SYMBOL(of_node_get); | |
12126 | +EXPORT_SYMBOL(of_node_put); | |
12127 | #endif /* CONFIG_PPC_OF */ | |
12128 | #if defined(CONFIG_BOOTX_TEXT) | |
12129 | EXPORT_SYMBOL(btext_update_display); | |
12130 | @@ -343,7 +356,7 @@ | |
12131 | EXPORT_SYMBOL(cpm_install_handler); | |
12132 | EXPORT_SYMBOL(cpm_free_handler); | |
12133 | #endif /* CONFIG_8xx */ | |
12134 | -#if defined(CONFIG_8xx) || defined(CONFIG_40x) | |
12135 | +#if defined(CONFIG_8xx) || defined(CONFIG_4xx) | |
12136 | EXPORT_SYMBOL(__res); | |
12137 | #endif | |
12138 | #if defined(CONFIG_8xx) | |
12139 | diff -Nru a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c | |
12140 | --- a/arch/ppc/kernel/setup.c Mon Aug 18 19:46:23 2003 | |
12141 | +++ b/arch/ppc/kernel/setup.c Mon Aug 25 11:11:43 2003 | |
12142 | @@ -624,12 +624,10 @@ | |
12143 | #if defined(CONFIG_KGDB) | |
12144 | kgdb_map_scc(); | |
12145 | set_debug_traps(); | |
12146 | - if (strstr(cmd_line, "nokgdb")) | |
12147 | - printk("kgdb default breakpoint deactivated on command line\n"); | |
12148 | - else { | |
12149 | + if (strstr(cmd_line, "gdb")) { | |
12150 | if (ppc_md.progress) | |
12151 | ppc_md.progress("setup_arch: kgdb breakpoint", 0x4000); | |
12152 | - printk("kgdb default breakpoint activated\n"); | |
12153 | + printk("kgdb breakpoint activated\n"); | |
12154 | breakpoint(); | |
12155 | } | |
12156 | #endif | |
12157 | diff -Nru a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c | |
12158 | --- a/arch/ppc/kernel/smp.c Mon Aug 18 19:46:23 2003 | |
12159 | +++ b/arch/ppc/kernel/smp.c Fri Aug 22 19:58:08 2003 | |
12160 | @@ -47,8 +47,8 @@ | |
12161 | DEFINE_PER_CPU(unsigned int, prof_multiplier); | |
12162 | DEFINE_PER_CPU(unsigned int, prof_counter); | |
12163 | unsigned long cache_decay_ticks = HZ/100; | |
12164 | -unsigned long cpu_online_map = cpumask_of_cpu(0); | |
12165 | -unsigned long cpu_possible_map = 1UL; | |
12166 | +cpumask_t cpu_online_map; | |
12167 | +cpumask_t cpu_possible_map; | |
12168 | int smp_hw_index[NR_CPUS]; | |
12169 | struct thread_info *secondary_ti; | |
12170 | ||
12171 | @@ -336,7 +336,7 @@ | |
12172 | ||
12173 | void __init smp_prepare_cpus(unsigned int max_cpus) | |
12174 | { | |
12175 | - int num_cpus; | |
12176 | + int num_cpus, i; | |
12177 | ||
12178 | /* Fixup boot cpu */ | |
12179 | smp_store_cpu_info(smp_processor_id()); | |
12180 | @@ -350,7 +350,8 @@ | |
12181 | ||
12182 | /* Probe platform for CPUs: always linear. */ | |
12183 | num_cpus = smp_ops->probe(); | |
12184 | - cpu_possible_map = (1 << num_cpus)-1; | |
12185 | + for (i = 0; i < num_cpus; ++i) | |
12186 | + cpu_set(i, cpu_possible_map); | |
12187 | ||
12188 | /* Backup CPU 0 state */ | |
12189 | __save_cpu_setup(); | |
12190 | diff -Nru a/arch/ppc/kernel/syscalls.c b/arch/ppc/kernel/syscalls.c | |
12191 | --- a/arch/ppc/kernel/syscalls.c Tue Jul 15 04:49:49 2003 | |
12192 | +++ b/arch/ppc/kernel/syscalls.c Fri Aug 22 19:15:18 2003 | |
12193 | @@ -262,4 +262,14 @@ | |
12194 | return error; | |
12195 | } | |
12196 | ||
12197 | +/* | |
12198 | + * We put the arguments in a different order so we only use 6 | |
12199 | + * registers for arguments, rather than 7 as sys_fadvise64_64 needs | |
12200 | + * (because `offset' goes in r5/r6). | |
12201 | + */ | |
12202 | +long ppc_fadvise64_64(int fd, int advice, loff_t offset, loff_t len) | |
12203 | +{ | |
12204 | + return sys_fadvise64_64(fd, offset, len, advice); | |
12205 | +} | |
12206 | + | |
12207 | cond_syscall(sys_pciconfig_iobase); | |
12208 | diff -Nru a/arch/ppc/mm/44x_mmu.c b/arch/ppc/mm/44x_mmu.c | |
12209 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
12210 | +++ b/arch/ppc/mm/44x_mmu.c Wed Sep 3 02:10:22 2003 | |
12211 | @@ -0,0 +1,162 @@ | |
12212 | +/* | |
12213 | + * Modifications by Matt Porter (mporter@mvista.com) to support | |
12214 | + * PPC44x Book E processors. | |
12215 | + * | |
12216 | + * This file contains the routines for initializing the MMU | |
12217 | + * on the 4xx series of chips. | |
12218 | + * -- paulus | |
12219 | + * | |
12220 | + * Derived from arch/ppc/mm/init.c: | |
12221 | + * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) | |
12222 | + * | |
12223 | + * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au) | |
12224 | + * and Cort Dougan (PReP) (cort@cs.nmt.edu) | |
12225 | + * Copyright (C) 1996 Paul Mackerras | |
12226 | + * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk). | |
12227 | + * | |
12228 | + * Derived from "arch/i386/mm/init.c" | |
12229 | + * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds | |
12230 | + * | |
12231 | + * This program is free software; you can redistribute it and/or | |
12232 | + * modify it under the terms of the GNU General Public License | |
12233 | + * as published by the Free Software Foundation; either version | |
12234 | + * 2 of the License, or (at your option) any later version. | |
12235 | + * | |
12236 | + */ | |
12237 | + | |
12238 | +#include <linux/config.h> | |
12239 | +#include <linux/signal.h> | |
12240 | +#include <linux/sched.h> | |
12241 | +#include <linux/kernel.h> | |
12242 | +#include <linux/errno.h> | |
12243 | +#include <linux/string.h> | |
12244 | +#include <linux/types.h> | |
12245 | +#include <linux/ptrace.h> | |
12246 | +#include <linux/mman.h> | |
12247 | +#include <linux/mm.h> | |
12248 | +#include <linux/swap.h> | |
12249 | +#include <linux/stddef.h> | |
12250 | +#include <linux/vmalloc.h> | |
12251 | +#include <linux/init.h> | |
12252 | +#include <linux/delay.h> | |
12253 | +#include <linux/bootmem.h> | |
12254 | +#include <linux/highmem.h> | |
12255 | + | |
12256 | +#include <asm/pgalloc.h> | |
12257 | +#include <asm/prom.h> | |
12258 | +#include <asm/io.h> | |
12259 | +#include <asm/mmu_context.h> | |
12260 | +#include <asm/pgtable.h> | |
12261 | +#include <asm/mmu.h> | |
12262 | +#include <asm/uaccess.h> | |
12263 | +#include <asm/smp.h> | |
12264 | +#include <asm/bootx.h> | |
12265 | +#include <asm/machdep.h> | |
12266 | +#include <asm/setup.h> | |
12267 | + | |
12268 | +#include "mmu_decl.h" | |
12269 | +#include "mem_pieces.h" | |
12270 | + | |
12271 | +extern char etext[], _stext[]; | |
12272 | +extern struct mem_pieces phys_avail; | |
12273 | + | |
12274 | +/* Used by the 44x TLB replacement exception handler. | |
12275 | + * Just needed it declared someplace. | |
12276 | + */ | |
12277 | +unsigned int tlb_44x_index = 0; | |
12278 | +unsigned int tlb_44x_hwater = 61; | |
12279 | + | |
12280 | +/* | |
12281 | + * "Pins" a 256MB TLB entry in AS0 for kernel lowmem | |
12282 | + */ | |
12283 | +static void __init | |
12284 | +ppc44x_pin_tlb(int slot, unsigned int virt, unsigned int phys) | |
12285 | +{ | |
12286 | + unsigned long attrib; | |
12287 | + | |
12288 | + __asm__ __volatile__("\ | |
12289 | + clrrwi %2,%2,10\n\ | |
12290 | + ori %2,%2,%4\n\ | |
12291 | + clrrwi %1,%1,10\n\ | |
12292 | + li %0,0\n\ | |
12293 | + ori %0,%0,%5\n\ | |
12294 | + tlbwe %2,%3,%6\n\ | |
12295 | + tlbwe %1,%3,%7\n\ | |
12296 | + tlbwe %0,%3,%8" | |
12297 | + : | |
12298 | + : "r" (attrib), "r" (phys), "r" (virt), "r" (slot), | |
12299 | + "i" (PPC44x_TLB_VALID | PPC44x_TLB_PAGESZ(PPC44x_PAGESZ_256M)), | |
12300 | + "i" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G), | |
12301 | + "i" (PPC44x_TLB_PAGEID), | |
12302 | + "i" (PPC44x_TLB_XLAT), | |
12303 | + "i" (PPC44x_TLB_ATTRIB)); | |
12304 | +} | |
12305 | + | |
12306 | +/* | |
12307 | + * Configure PPC44x TLB for AS0 exception processing. | |
12308 | + */ | |
12309 | +static void __init | |
12310 | +ppc44x_tlb_config(void) | |
12311 | +{ | |
12312 | + unsigned int pinned_tlbs = 1; | |
12313 | + int i; | |
12314 | + | |
12315 | + /* | |
12316 | + * If lowmem is not on a pin tlb entry size boundary, | |
12317 | + * then reserve the last page of system memory. This | |
12318 | + * eliminates the possibility of a speculative dcache | |
12319 | + * fetch past the end of system memory that would | |
12320 | + * result in a machine check exception. | |
12321 | + */ | |
12322 | + if (total_lowmem | (PPC44x_PIN_SIZE - 1)) | |
12323 | + mem_pieces_remove(&phys_avail, total_lowmem - PAGE_SIZE, PAGE_SIZE, 1); | |
12324 | + | |
12325 | + /* Determine number of entries necessary to cover lowmem */ | |
12326 | + pinned_tlbs = (unsigned int) | |
12327 | + (_ALIGN(total_lowmem, PPC44x_PIN_SIZE) >> PPC44x_PIN_SHIFT); | |
12328 | + | |
12329 | + /* Write upper watermark to save location */ | |
12330 | + tlb_44x_hwater = PPC44x_LOW_SLOT - pinned_tlbs; | |
12331 | + | |
12332 | + /* If necessary, set additional pinned TLBs */ | |
12333 | + if (pinned_tlbs > 1) | |
12334 | + for (i = (PPC44x_LOW_SLOT-(pinned_tlbs-1)); i < PPC44x_LOW_SLOT; i++) { | |
12335 | + unsigned int phys_addr = (PPC44x_LOW_SLOT-i) * PPC44x_PIN_SIZE; | |
12336 | + ppc44x_pin_tlb(i, phys_addr+PAGE_OFFSET, phys_addr); | |
12337 | + } | |
12338 | +} | |
12339 | + | |
12340 | +/* | |
12341 | + * MMU_init_hw does the chip-specific initialization of the MMU hardware. | |
12342 | + */ | |
12343 | +void __init MMU_init_hw(void) | |
12344 | +{ | |
12345 | + flush_instruction_cache(); | |
12346 | + | |
12347 | + ppc44x_tlb_config(); | |
12348 | +} | |
12349 | + | |
12350 | +/* TODO: Add large page lowmem mapping support */ | |
12351 | +unsigned long __init mmu_mapin_ram(void) | |
12352 | +{ | |
12353 | + unsigned long v, s, f = _PAGE_GUARDED; | |
12354 | + phys_addr_t p; | |
12355 | + | |
12356 | + v = KERNELBASE; | |
12357 | + p = PPC_MEMSTART; | |
12358 | + | |
12359 | + for (s = 0; s < total_lowmem; s += PAGE_SIZE) { | |
12360 | + if ((char *) v >= _stext && (char *) v < etext) | |
12361 | + f |= _PAGE_RAM_TEXT; | |
12362 | + else | |
12363 | + f |= _PAGE_RAM; | |
12364 | + map_page(v, p, f); | |
12365 | + v += PAGE_SIZE; | |
12366 | + p += PAGE_SIZE; | |
12367 | + } | |
12368 | + | |
12369 | + if (ppc_md.progress) | |
12370 | + ppc_md.progress("MMU:mmu_mapin_ram done", 0x401); | |
12371 | + | |
12372 | + return s; | |
12373 | +} | |
12374 | diff -Nru a/arch/ppc/mm/Makefile b/arch/ppc/mm/Makefile | |
12375 | --- a/arch/ppc/mm/Makefile Sat Jan 4 00:44:11 2003 | |
12376 | +++ b/arch/ppc/mm/Makefile Wed Sep 3 05:16:34 2003 | |
12377 | @@ -11,4 +11,5 @@ | |
12378 | ||
12379 | obj-$(CONFIG_PPC_STD_MMU) += hashtable.o ppc_mmu.o tlb.o | |
12380 | obj-$(CONFIG_40x) += 4xx_mmu.o | |
12381 | +obj-$(CONFIG_44x) += 44x_mmu.o | |
12382 | obj-$(CONFIG_NOT_COHERENT_CACHE) += cachemap.o | |
12383 | diff -Nru a/arch/ppc/mm/cachemap.c b/arch/ppc/mm/cachemap.c | |
12384 | --- a/arch/ppc/mm/cachemap.c Tue May 20 22:22:44 2003 | |
12385 | +++ b/arch/ppc/mm/cachemap.c Wed Sep 3 05:16:34 2003 | |
12386 | @@ -48,7 +48,7 @@ | |
12387 | #include <asm/smp.h> | |
12388 | #include <asm/machdep.h> | |
12389 | ||
12390 | -int map_page(unsigned long va, unsigned long pa, int flags); | |
12391 | +int map_page(unsigned long va, phys_addr_t pa, int flags); | |
12392 | ||
12393 | /* This function will allocate the requested contiguous pages and | |
12394 | * map them into the kernel's vmalloc() space. This is done so we | |
12395 | @@ -61,7 +61,8 @@ | |
12396 | { | |
12397 | int order, err; | |
12398 | struct page *page, *free, *end; | |
12399 | - unsigned long pa, flags, offset; | |
12400 | + phys_addr_t pa; | |
12401 | + unsigned long flags, offset; | |
12402 | struct vm_struct *area = NULL; | |
12403 | unsigned long va = 0; | |
12404 | ||
12405 | diff -Nru a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c | |
12406 | --- a/arch/ppc/mm/init.c Wed Jun 4 20:48:59 2003 | |
12407 | +++ b/arch/ppc/mm/init.c Wed Sep 3 05:16:34 2003 | |
12408 | @@ -6,6 +6,7 @@ | |
12409 | * and Cort Dougan (PReP) (cort@cs.nmt.edu) | |
12410 | * Copyright (C) 1996 Paul Mackerras | |
12411 | * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk). | |
12412 | + * PPC44x/36-bit changes by Matt Porter (mporter@mvista.com) | |
12413 | * | |
12414 | * Derived from "arch/i386/mm/init.c" | |
12415 | * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds | |
12416 | diff -Nru a/arch/ppc/mm/mmu_decl.h b/arch/ppc/mm/mmu_decl.h | |
12417 | --- a/arch/ppc/mm/mmu_decl.h Sat Jan 4 03:05:41 2003 | |
12418 | +++ b/arch/ppc/mm/mmu_decl.h Wed Sep 3 05:16:34 2003 | |
12419 | @@ -20,9 +20,10 @@ | |
12420 | * | |
12421 | */ | |
12422 | #include <asm/tlbflush.h> | |
12423 | +#include <asm/mmu.h> | |
12424 | ||
12425 | extern void mapin_ram(void); | |
12426 | -extern int map_page(unsigned long va, unsigned long pa, int flags); | |
12427 | +extern int map_page(unsigned long va, phys_addr_t pa, int flags); | |
12428 | extern void setbat(int index, unsigned long virt, unsigned long phys, | |
12429 | unsigned int size, int flags); | |
12430 | extern void reserve_phys_mem(unsigned long start, unsigned long size); | |
12431 | diff -Nru a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c | |
12432 | --- a/arch/ppc/mm/pgtable.c Thu Jun 5 18:11:52 2003 | |
12433 | +++ b/arch/ppc/mm/pgtable.c Wed Sep 3 05:16:34 2003 | |
12434 | @@ -55,11 +55,18 @@ | |
12435 | #define p_mapped_by_bats(x) (0UL) | |
12436 | #endif /* HAVE_BATS */ | |
12437 | ||
12438 | +#ifdef CONFIG_44x | |
12439 | +/* 44x uses an 8kB pgdir because it has 8-byte Linux PTEs. */ | |
12440 | +#define PGDIR_ORDER 1 | |
12441 | +#else | |
12442 | +#define PGDIR_ORDER 0 | |
12443 | +#endif | |
12444 | + | |
12445 | pgd_t *pgd_alloc(struct mm_struct *mm) | |
12446 | { | |
12447 | pgd_t *ret; | |
12448 | ||
12449 | - if ((ret = (pgd_t *)__get_free_page(GFP_KERNEL)) != NULL) | |
12450 | + if ((ret = (pgd_t *)__get_free_pages(GFP_KERNEL, PGDIR_ORDER)) != NULL) | |
12451 | clear_page(ret); | |
12452 | return ret; | |
12453 | } | |
12454 | @@ -110,16 +117,33 @@ | |
12455 | __free_page(pte); | |
12456 | } | |
12457 | ||
12458 | +#ifndef CONFIG_44x | |
12459 | +void * | |
12460 | +ioremap(phys_addr_t addr, unsigned long size) | |
12461 | +{ | |
12462 | + return __ioremap(addr, size, _PAGE_NO_CACHE); | |
12463 | +} | |
12464 | +#else /* CONFIG_44x */ | |
12465 | void * | |
12466 | -ioremap(unsigned long addr, unsigned long size) | |
12467 | +ioremap64(unsigned long long addr, unsigned long size) | |
12468 | { | |
12469 | return __ioremap(addr, size, _PAGE_NO_CACHE); | |
12470 | } | |
12471 | ||
12472 | void * | |
12473 | -__ioremap(unsigned long addr, unsigned long size, unsigned long flags) | |
12474 | +ioremap(phys_addr_t addr, unsigned long size) | |
12475 | +{ | |
12476 | + phys_addr_t addr64 = fixup_bigphys_addr(addr, size);; | |
12477 | + | |
12478 | + return ioremap64(addr64, size); | |
12479 | +} | |
12480 | +#endif /* CONFIG_44x */ | |
12481 | + | |
12482 | +void * | |
12483 | +__ioremap(phys_addr_t addr, unsigned long size, unsigned long flags) | |
12484 | { | |
12485 | - unsigned long p, v, i; | |
12486 | + unsigned long v, i; | |
12487 | + phys_addr_t p; | |
12488 | int err; | |
12489 | ||
12490 | /* | |
12491 | @@ -144,7 +168,7 @@ | |
12492 | */ | |
12493 | if ( mem_init_done && (p < virt_to_phys(high_memory)) ) | |
12494 | { | |
12495 | - printk("__ioremap(): phys addr %0lx is RAM lr %p\n", p, | |
12496 | + printk("__ioremap(): phys addr "PTE_FMT" is RAM lr %p\n", p, | |
12497 | __builtin_return_address(0)); | |
12498 | return NULL; | |
12499 | } | |
12500 | @@ -195,7 +219,7 @@ | |
12501 | } | |
12502 | ||
12503 | out: | |
12504 | - return (void *) (v + (addr & ~PAGE_MASK)); | |
12505 | + return (void *) (v + ((unsigned long)addr & ~PAGE_MASK)); | |
12506 | } | |
12507 | ||
12508 | void iounmap(void *addr) | |
12509 | @@ -211,7 +235,7 @@ | |
12510 | } | |
12511 | ||
12512 | int | |
12513 | -map_page(unsigned long va, unsigned long pa, int flags) | |
12514 | +map_page(unsigned long va, phys_addr_t pa, int flags) | |
12515 | { | |
12516 | pmd_t *pd; | |
12517 | pte_t *pg; | |
12518 | @@ -261,7 +285,7 @@ | |
12519 | * virt, phys, size must all be page-aligned. | |
12520 | * This should only be called before ioremap is called. | |
12521 | */ | |
12522 | -void __init io_block_mapping(unsigned long virt, unsigned long phys, | |
12523 | +void __init io_block_mapping(unsigned long virt, phys_addr_t phys, | |
12524 | unsigned int size, int flags) | |
12525 | { | |
12526 | int i; | |
12527 | diff -Nru a/arch/ppc/ocp/ocp-probe.c b/arch/ppc/ocp/ocp-probe.c | |
12528 | --- a/arch/ppc/ocp/ocp-probe.c Wed Jan 15 19:45:18 2003 | |
12529 | +++ b/arch/ppc/ocp/ocp-probe.c Wed Sep 3 05:40:20 2003 | |
12530 | @@ -62,7 +62,6 @@ | |
12531 | (unsigned long) dev->paddr, dev->irq, dev->pm); | |
12532 | ||
12533 | /* now put in global tree */ | |
12534 | - strcpy(dev->dev.name, dev->name); | |
12535 | sprintf(dev->dev.bus_id, "%d", index); | |
12536 | dev->dev.parent = ocp_bus; | |
12537 | dev->dev.bus = &ocp_bus_type; | |
12538 | @@ -80,7 +79,7 @@ | |
12539 | return NULL; | |
12540 | memset(b, 0, sizeof(struct device)); | |
12541 | strcpy(b->bus_id, "ocp"); | |
12542 | - strcpy(b->name, "Host/OCP Bridge"); | |
12543 | + | |
12544 | device_register(b); | |
12545 | ||
12546 | return b; | |
12547 | diff -Nru a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig | |
12548 | --- a/arch/ppc/platforms/4xx/Kconfig Tue Aug 12 14:57:51 2003 | |
12549 | +++ b/arch/ppc/platforms/4xx/Kconfig Wed Sep 3 05:16:34 2003 | |
12550 | @@ -1,6 +1,6 @@ | |
12551 | config 4xx | |
12552 | bool | |
12553 | - depends on 40x | |
12554 | + depends on 40x || 44x | |
12555 | default y | |
12556 | ||
12557 | menu "IBM 4xx options" | |
12558 | @@ -57,6 +57,23 @@ | |
12559 | ||
12560 | endchoice | |
12561 | ||
12562 | +choice | |
12563 | + prompt "Machine Type" | |
12564 | + depends on 44x | |
12565 | + default EBONY | |
12566 | + | |
12567 | +config EBONY | |
12568 | + bool "Ebony" | |
12569 | + help | |
12570 | + This option enables support for the IBM PPC440GP evaluation board. | |
12571 | + | |
12572 | +config OCOTEA | |
12573 | + bool "Ocotea" | |
12574 | + help | |
12575 | + This option enables support for the IBM PPC440GX evaluation board. | |
12576 | + | |
12577 | +endchoice | |
12578 | + | |
12579 | config EP405PC | |
12580 | bool "EP405PC Support" | |
12581 | depends on EP405 | |
12582 | @@ -70,6 +87,26 @@ | |
12583 | depends on ASH | |
12584 | default y | |
12585 | ||
12586 | +config 440GP | |
12587 | + bool | |
12588 | + depends on EBONY | |
12589 | + default y | |
12590 | + | |
12591 | +config 440GX | |
12592 | + bool | |
12593 | + depends on OCOTEA | |
12594 | + default y | |
12595 | + | |
12596 | +config 440 | |
12597 | + bool | |
12598 | + depends on 440GP | |
12599 | + default y | |
12600 | + | |
12601 | +config 440A | |
12602 | + bool | |
12603 | + depends on 440GX | |
12604 | + default y | |
12605 | + | |
12606 | # All 405-based cores up until the 405GPR and 405EP have this errata. | |
12607 | config IBM405_ERR77 | |
12608 | bool | |
12609 | @@ -82,9 +119,25 @@ | |
12610 | depends on 40x && !405GPR | |
12611 | default y | |
12612 | ||
12613 | + | |
12614 | +config PIN_TLB | |
12615 | + bool | |
12616 | + depends on 44x | |
12617 | + default y | |
12618 | + | |
12619 | +config BOOKE | |
12620 | + bool | |
12621 | + depends on 44x | |
12622 | + default y | |
12623 | + | |
12624 | config IBM_OCP | |
12625 | bool | |
12626 | - depends on ASH || BEECH || CEDAR || CPCI405 || EP405 || REDWOOD_4 || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT | |
12627 | + depends on ASH || BEECH || CEDAR || CPCI405 || EBONY || EP405 || OCOTEA || REDWOOD_4 || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT | |
12628 | + default y | |
12629 | + | |
12630 | +config IBM_EMAC4 | |
12631 | + bool | |
12632 | + depends on 440GX | |
12633 | default y | |
12634 | ||
12635 | config NP405L | |
12636 | diff -Nru a/arch/ppc/platforms/4xx/Makefile b/arch/ppc/platforms/4xx/Makefile | |
12637 | --- a/arch/ppc/platforms/4xx/Makefile Mon Feb 3 14:19:36 2003 | |
12638 | +++ b/arch/ppc/platforms/4xx/Makefile Wed Sep 3 05:16:34 2003 | |
12639 | @@ -5,8 +5,10 @@ | |
12640 | obj-$(CONFIG_BEECH) += beech.o | |
12641 | obj-$(CONFIG_CEDAR) += cedar.o | |
12642 | obj-$(CONFIG_CPCI405) += cpci405.o | |
12643 | +obj-$(CONFIG_EBONY) += ebony.o | |
12644 | obj-$(CONFIG_EP405) += ep405.o | |
12645 | obj-$(CONFIG_OAK) += oak.o | |
12646 | +obj-$(CONFIG_OCOTEA) += ocotea.o | |
12647 | obj-$(CONFIG_REDWOOD_4) += redwood.o | |
12648 | obj-$(CONFIG_REDWOOD_5) += redwood5.o | |
12649 | obj-$(CONFIG_REDWOOD_6) += redwood6.o | |
12650 | @@ -21,4 +23,6 @@ | |
12651 | obj-$(CONFIG_REDWOOD_6) += ibmstbx25.o | |
12652 | obj-$(CONFIG_NP4GS3) += ibmnp4gs.o | |
12653 | obj-$(CONFIG_405LP) += ibm405lp.o | |
12654 | +obj-$(CONFIG_EBONY) += ibm440gp.o | |
12655 | +obj-$(CONFIG_OCOTEA) += ibm440gx.o | |
12656 | obj-$(CONFIG_405GPR) += ibm405gpr.o | |
12657 | diff -Nru a/arch/ppc/platforms/4xx/ebony.c b/arch/ppc/platforms/4xx/ebony.c | |
12658 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
12659 | +++ b/arch/ppc/platforms/4xx/ebony.c Wed Sep 3 02:14:10 2003 | |
12660 | @@ -0,0 +1,536 @@ | |
12661 | +/* | |
12662 | + * arch/ppc/platforms/ebony.c | |
12663 | + * | |
12664 | + * Ebony board specific routines | |
12665 | + * | |
12666 | + * Matt Porter <mporter@mvista.com> | |
12667 | + * | |
12668 | + * Copyright 2002 MontaVista Software Inc. | |
12669 | + * | |
12670 | + * This program is free software; you can redistribute it and/or modify it | |
12671 | + * under the terms of the GNU General Public License as published by the | |
12672 | + * Free Software Foundation; either version 2 of the License, or (at your | |
12673 | + * option) any later version. | |
12674 | + */ | |
12675 | + | |
12676 | +#include <linux/config.h> | |
12677 | +#include <linux/stddef.h> | |
12678 | +#include <linux/kernel.h> | |
12679 | +#include <linux/init.h> | |
12680 | +#include <linux/errno.h> | |
12681 | +#include <linux/reboot.h> | |
12682 | +#include <linux/pci.h> | |
12683 | +#include <linux/kdev_t.h> | |
12684 | +#include <linux/types.h> | |
12685 | +#include <linux/major.h> | |
12686 | +#include <linux/blkdev.h> | |
12687 | +#include <linux/console.h> | |
12688 | +#include <linux/delay.h> | |
12689 | +#include <linux/ide.h> | |
12690 | +#include <linux/initrd.h> | |
12691 | +#include <linux/irq.h> | |
12692 | +#include <linux/seq_file.h> | |
12693 | +#include <linux/root_dev.h> | |
12694 | +#include <linux/tty.h> | |
12695 | +#include <linux/serial.h> | |
12696 | +#include <linux/serial_core.h> | |
12697 | + | |
12698 | +#include <asm/system.h> | |
12699 | +#include <asm/pgtable.h> | |
12700 | +#include <asm/page.h> | |
12701 | +#include <asm/dma.h> | |
12702 | +#include <asm/io.h> | |
12703 | +#include <asm/machdep.h> | |
12704 | +#include <asm/pci-bridge.h> | |
12705 | +#include <asm/time.h> | |
12706 | +#include <asm/todc.h> | |
12707 | +#include <asm/bootinfo.h> | |
12708 | +#include <asm/ppc4xx_pic.h> | |
12709 | + | |
12710 | +/* | |
12711 | + * Ebony IRQ triggering/polarity settings | |
12712 | + */ | |
12713 | +static u_char ebony_IRQ_initsenses[] __initdata = { | |
12714 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 0: UART 0 */ | |
12715 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 1: UART 1 */ | |
12716 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 2: IIC 0 */ | |
12717 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 3: IIC 1 */ | |
12718 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 4: PCI Inb Mess */ | |
12719 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 5: PCI Cmd Wrt */ | |
12720 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 6: PCI PM */ | |
12721 | + (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 7: PCI MSI 0 */ | |
12722 | + (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 8: PCI MSI 1 */ | |
12723 | + (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 9: PCI MSI 2 */ | |
12724 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 10: MAL TX EOB */ | |
12725 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 11: MAL RX EOB */ | |
12726 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 12: DMA Chan 0 */ | |
12727 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 13: DMA Chan 1 */ | |
12728 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 14: DMA Chan 2 */ | |
12729 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 15: DMA Chan 3 */ | |
12730 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 16: Reserved */ | |
12731 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 17: Reserved */ | |
12732 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 18: GPT Timer 0 */ | |
12733 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 19: GPT Timer 1 */ | |
12734 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 20: GPT Timer 2 */ | |
12735 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 21: GPT Timer 3 */ | |
12736 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 22: GPT Timer 4 */ | |
12737 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 23: Ext Int 0 */ | |
12738 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 24: Ext Int 1 */ | |
12739 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 25: Ext Int 2 */ | |
12740 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 26: Ext Int 3 */ | |
12741 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 27: Ext Int 4 */ | |
12742 | + (IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE), /* 28: Ext Int 5 */ | |
12743 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 29: Ext Int 6 */ | |
12744 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 30: UIC1 NC Int */ | |
12745 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 31: UIC1 Crit Int */ | |
12746 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 32: MAL SERR */ | |
12747 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 33: MAL TXDE */ | |
12748 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 34: MAL RXDE */ | |
12749 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 35: ECC Unc Err */ | |
12750 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 36: ECC Corr Err */ | |
12751 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 37: Ext Bus Ctrl */ | |
12752 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 38: Ext Bus Mstr */ | |
12753 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 39: OPB->PLB */ | |
12754 | + (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 40: PCI MSI 3 */ | |
12755 | + (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 41: PCI MSI 4 */ | |
12756 | + (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 42: PCI MSI 5 */ | |
12757 | + (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 43: PCI MSI 6 */ | |
12758 | + (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 44: PCI MSI 7 */ | |
12759 | + (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 45: PCI MSI 8 */ | |
12760 | + (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 46: PCI MSI 9 */ | |
12761 | + (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 47: PCI MSI 10 */ | |
12762 | + (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE), /* 48: PCI MSI 11 */ | |
12763 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 49: PLB Perf Mon */ | |
12764 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 50: Ext Int 7 */ | |
12765 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 51: Ext Int 8 */ | |
12766 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 52: Ext Int 9 */ | |
12767 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 53: Ext Int 10 */ | |
12768 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 54: Ext Int 11 */ | |
12769 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 55: Ext Int 12 */ | |
12770 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 56: Ser ROM Err */ | |
12771 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 57: Reserved */ | |
12772 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 58: Reserved */ | |
12773 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 59: PCI Async Err */ | |
12774 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 60: EMAC 0 */ | |
12775 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 61: EMAC 0 WOL */ | |
12776 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 62: EMAC 1 */ | |
12777 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 63: EMAC 1 WOL */ | |
12778 | +}; | |
12779 | + | |
12780 | +extern void abort(void); | |
12781 | + | |
12782 | +/* Global Variables */ | |
12783 | +bd_t __res; | |
12784 | + | |
12785 | +static void __init | |
12786 | +ebony_calibrate_decr(void) | |
12787 | +{ | |
12788 | + unsigned int freq; | |
12789 | + | |
12790 | + /* | |
12791 | + * Determine system clock speed | |
12792 | + * | |
12793 | + * If we are on Rev. B silicon, then use | |
12794 | + * default external system clock. If we are | |
12795 | + * on Rev. C silicon then errata forces us to | |
12796 | + * use the internal clock. | |
12797 | + */ | |
12798 | + switch (PVR_REV(mfspr(PVR))) { | |
12799 | + case PVR_REV(PVR_440GP_RB): | |
12800 | + freq = EBONY_440GP_RB_SYSCLK; | |
12801 | + break; | |
12802 | + case PVR_REV(PVR_440GP_RC1): | |
12803 | + default: | |
12804 | + freq = EBONY_440GP_RC_SYSCLK; | |
12805 | + break; | |
12806 | + } | |
12807 | + | |
12808 | + tb_ticks_per_jiffy = freq / HZ; | |
12809 | + tb_to_us = mulhwu_scale_factor(freq, 1000000); | |
12810 | + | |
12811 | + /* Set the time base to zero */ | |
12812 | + mtspr(SPRN_TBWL, 0); | |
12813 | + mtspr(SPRN_TBWU, 0); | |
12814 | + | |
12815 | + /* Clear any pending timer interrupts */ | |
12816 | + mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS); | |
12817 | + | |
12818 | + /* Enable decrementer interrupt */ | |
12819 | + mtspr(SPRN_TCR, TCR_DIE); | |
12820 | +} | |
12821 | + | |
12822 | +static int | |
12823 | +ebony_show_cpuinfo(struct seq_file *m) | |
12824 | +{ | |
12825 | + seq_printf(m, "vendor\t\t: IBM\n"); | |
12826 | + seq_printf(m, "machine\t\t: Ebony\n"); | |
12827 | + | |
12828 | + return 0; | |
12829 | +} | |
12830 | + | |
12831 | +static inline int | |
12832 | +ebony_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) | |
12833 | +{ | |
12834 | + static char pci_irq_table[][4] = | |
12835 | + /* | |
12836 | + * PCI IDSEL/INTPIN->INTLINE | |
12837 | + * A B C D | |
12838 | + */ | |
12839 | + { | |
12840 | + { 23, 23, 23, 23 }, /* IDSEL 1 - PCI Slot 0 */ | |
12841 | + { 24, 24, 24, 24 }, /* IDSEL 2 - PCI Slot 1 */ | |
12842 | + { 25, 25, 25, 25 }, /* IDSEL 3 - PCI Slot 2 */ | |
12843 | + { 26, 26, 26, 26 }, /* IDSEL 4 - PCI Slot 3 */ | |
12844 | + }; | |
12845 | + | |
12846 | + const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4; | |
12847 | + return PCI_IRQ_TABLE_LOOKUP; | |
12848 | +} | |
12849 | + | |
12850 | +#define PCIX_WRITEL(value, offset) \ | |
12851 | + (writel(value, (u32)pcix_reg_base+offset)) | |
12852 | + | |
12853 | +/* | |
12854 | + * FIXME: This is only here to "make it work". This will move | |
12855 | + * to a ibm_pcix.c which will contain a generic IBM PCIX bridge | |
12856 | + * configuration library. -Matt | |
12857 | + */ | |
12858 | +static void __init | |
12859 | +ebony_setup_pcix(void) | |
12860 | +{ | |
12861 | + void *pcix_reg_base; | |
12862 | + | |
12863 | + pcix_reg_base = ioremap64(PCIX0_REG_BASE, PCIX0_REG_SIZE); | |
12864 | + | |
12865 | + /* Disable all windows */ | |
12866 | + PCIX_WRITEL(0, PCIX0_POM0SA); | |
12867 | + PCIX_WRITEL(0, PCIX0_POM1SA); | |
12868 | + PCIX_WRITEL(0, PCIX0_POM2SA); | |
12869 | + PCIX_WRITEL(0, PCIX0_PIM0SA); | |
12870 | + PCIX_WRITEL(0, PCIX0_PIM1SA); | |
12871 | + PCIX_WRITEL(0, PCIX0_PIM2SA); | |
12872 | + | |
12873 | + /* Setup 2GB PLB->PCI outbound mem window (3_8000_0000->0_8000_0000) */ | |
12874 | + PCIX_WRITEL(0x00000003, PCIX0_POM0LAH); | |
12875 | + PCIX_WRITEL(0x80000000, PCIX0_POM0LAL); | |
12876 | + PCIX_WRITEL(0x00000000, PCIX0_POM0PCIAH); | |
12877 | + PCIX_WRITEL(0x80000000, PCIX0_POM0PCIAL); | |
12878 | + PCIX_WRITEL(0x80000001, PCIX0_POM0SA); | |
12879 | + | |
12880 | + /* Setup 2GB PCI->PLB inbound memory window at 0, enable MSIs */ | |
12881 | + PCIX_WRITEL(0x00000000, PCIX0_PIM0LAH); | |
12882 | + PCIX_WRITEL(0x00000000, PCIX0_PIM0LAL); | |
12883 | + PCIX_WRITEL(0x80000007, PCIX0_PIM0SA); | |
12884 | + | |
12885 | + eieio(); | |
12886 | +} | |
12887 | + | |
12888 | +static void __init | |
12889 | +ebony_setup_hose(void) | |
12890 | +{ | |
12891 | + struct pci_controller *hose; | |
12892 | + | |
12893 | + /* Configure windows on the PCI-X host bridge */ | |
12894 | + ebony_setup_pcix(); | |
12895 | + | |
12896 | + hose = pcibios_alloc_controller(); | |
12897 | + | |
12898 | + if (!hose) | |
12899 | + return; | |
12900 | + | |
12901 | + hose->first_busno = 0; | |
12902 | + hose->last_busno = 0xff; | |
12903 | + | |
12904 | + hose->pci_mem_offset = EBONY_PCI_MEM_OFFSET; | |
12905 | + | |
12906 | + pci_init_resource(&hose->io_resource, | |
12907 | + EBONY_PCI_LOWER_IO, | |
12908 | + EBONY_PCI_UPPER_IO, | |
12909 | + IORESOURCE_IO, | |
12910 | + "PCI host bridge"); | |
12911 | + | |
12912 | + pci_init_resource(&hose->mem_resources[0], | |
12913 | + EBONY_PCI_LOWER_MEM, | |
12914 | + EBONY_PCI_UPPER_MEM, | |
12915 | + IORESOURCE_MEM, | |
12916 | + "PCI host bridge"); | |
12917 | + | |
12918 | + hose->io_space.start = EBONY_PCI_LOWER_IO; | |
12919 | + hose->io_space.end = EBONY_PCI_UPPER_IO; | |
12920 | + hose->mem_space.start = EBONY_PCI_LOWER_MEM; | |
12921 | + hose->mem_space.end = EBONY_PCI_UPPER_MEM; | |
12922 | + isa_io_base = | |
12923 | + (unsigned long)ioremap64(EBONY_PCI_IO_BASE, EBONY_PCI_IO_SIZE); | |
12924 | + hose->io_base_virt = (void *)isa_io_base; | |
12925 | + | |
12926 | + setup_indirect_pci(hose, | |
12927 | + EBONY_PCI_CFGA_PLB32, | |
12928 | + EBONY_PCI_CFGD_PLB32); | |
12929 | + hose->set_cfg_type = 1; | |
12930 | + | |
12931 | + hose->last_busno = pciauto_bus_scan(hose, hose->first_busno); | |
12932 | + | |
12933 | + ppc_md.pci_swizzle = common_swizzle; | |
12934 | + ppc_md.pci_map_irq = ebony_map_irq; | |
12935 | +} | |
12936 | + | |
12937 | +TODC_ALLOC(); | |
12938 | + | |
12939 | +static void __init | |
12940 | +ebony_early_serial_map(void) | |
12941 | +{ | |
12942 | + struct uart_port port; | |
12943 | + | |
12944 | + /* Setup ioremapped serial port access */ | |
12945 | + memset(&port, 0, sizeof(port)); | |
12946 | + port.membase = ioremap64(PPC440GP_UART0_ADDR, 8); | |
12947 | + port.irq = 0; | |
12948 | + port.uartclk = BASE_BAUD * 16; | |
12949 | + port.regshift = 0; | |
12950 | + port.iotype = SERIAL_IO_MEM; | |
12951 | + port.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST; | |
12952 | + port.line = 0; | |
12953 | + | |
12954 | + if (early_serial_setup(&port) != 0) { | |
12955 | + printk("Early serial init of port 0 failed\n"); | |
12956 | + } | |
12957 | + | |
12958 | + port.membase = ioremap64(PPC440GP_UART1_ADDR, 8); | |
12959 | + port.irq = 1; | |
12960 | + port.line = 1; | |
12961 | + | |
12962 | + if (early_serial_setup(&port) != 0) { | |
12963 | + printk("Early serial init of port 1 failed\n"); | |
12964 | + } | |
12965 | +} | |
12966 | + | |
12967 | +static void __init | |
12968 | +ebony_setup_arch(void) | |
12969 | +{ | |
12970 | + unsigned char * vpd_base; | |
12971 | + struct ibm440gp_clocks clocks; | |
12972 | + | |
12973 | +#if !defined(CONFIG_BDI_SWITCH) | |
12974 | + /* | |
12975 | + * The Abatron BDI JTAG debugger does not tolerate others | |
12976 | + * mucking with the debug registers. | |
12977 | + */ | |
12978 | + mtspr(SPRN_DBCR0, (DBCR0_TDE | DBCR0_IDM)); | |
12979 | +#endif | |
12980 | + | |
12981 | + /* Retrieve MAC addresses */ | |
12982 | + vpd_base = ioremap64(EBONY_VPD_BASE, EBONY_VPD_SIZE); | |
12983 | + memcpy(__res.bi_enetaddr[0],EBONY_NA0_ADDR(vpd_base),6); | |
12984 | + memcpy(__res.bi_enetaddr[1],EBONY_NA1_ADDR(vpd_base),6); | |
12985 | + | |
12986 | + /* | |
12987 | + * Determine various clocks. | |
12988 | + * To be completely correct we should get SysClk | |
12989 | + * from FPGA, because it can be changed by on-board switches | |
12990 | + * --ebs | |
12991 | + */ | |
12992 | + ibm440gp_get_clocks(&clocks, 33333333, 6 * 1843200); | |
12993 | + __res.bi_opb_busfreq = clocks.opb; | |
12994 | + | |
12995 | + /* Use IIC in standard (100 kHz) mode */ | |
12996 | + __res.bi_iic_fast[0] = __res.bi_iic_fast[1] = 0; | |
12997 | + | |
12998 | + /* Setup TODC access */ | |
12999 | + TODC_INIT(TODC_TYPE_DS1743, | |
13000 | + 0, | |
13001 | + 0, | |
13002 | + ioremap64(EBONY_RTC_ADDR, EBONY_RTC_SIZE), | |
13003 | + 8); | |
13004 | + | |
13005 | + /* init to some ~sane value until calibrate_delay() runs */ | |
13006 | + loops_per_jiffy = 50000000/HZ; | |
13007 | + | |
13008 | + /* Setup PCI host bridge */ | |
13009 | + ebony_setup_hose(); | |
13010 | + | |
13011 | +#ifdef CONFIG_BLK_DEV_INITRD | |
13012 | + if (initrd_start) | |
13013 | + ROOT_DEV = Root_RAM0; | |
13014 | + else | |
13015 | +#endif | |
13016 | +#ifdef CONFIG_ROOT_NFS | |
13017 | + ROOT_DEV = Root_NFS; | |
13018 | +#else | |
13019 | + ROOT_DEV = Root_HDA1; | |
13020 | +#endif | |
13021 | + | |
13022 | +#ifdef CONFIG_VT | |
13023 | + conswitchp = &dummy_con; | |
13024 | +#endif | |
13025 | + | |
13026 | + ebony_early_serial_map(); | |
13027 | + | |
13028 | + ibm4xxPIC_InitSenses = ebony_IRQ_initsenses; | |
13029 | + ibm4xxPIC_NumInitSenses = sizeof(ebony_IRQ_initsenses); | |
13030 | + | |
13031 | + /* Identify the system */ | |
13032 | + printk("IBM Ebony port (MontaVista Software, Inc. (source@mvista.com))\n"); | |
13033 | +} | |
13034 | + | |
13035 | +static void | |
13036 | +ebony_restart(char *cmd) | |
13037 | +{ | |
13038 | + local_irq_disable(); | |
13039 | + abort(); | |
13040 | +} | |
13041 | + | |
13042 | +static void | |
13043 | +ebony_power_off(void) | |
13044 | +{ | |
13045 | + local_irq_disable(); | |
13046 | + for(;;); | |
13047 | +} | |
13048 | + | |
13049 | +static void | |
13050 | +ebony_halt(void) | |
13051 | +{ | |
13052 | + local_irq_disable(); | |
13053 | + for(;;); | |
13054 | +} | |
13055 | + | |
13056 | +/* | |
13057 | + * Read the 440GP memory controller to get size of system memory. | |
13058 | + */ | |
13059 | +static unsigned long __init | |
13060 | +ebony_find_end_of_memory(void) | |
13061 | +{ | |
13062 | + u32 i, bank_config; | |
13063 | + u32 mem_size = 0; | |
13064 | + | |
13065 | + for (i=0; i<4; i++) | |
13066 | + { | |
13067 | + switch (i) | |
13068 | + { | |
13069 | + case 0: | |
13070 | + mtdcr(DCRN_SDRAM0_CFGADDR, SDRAM0_B0CR); | |
13071 | + break; | |
13072 | + case 1: | |
13073 | + mtdcr(DCRN_SDRAM0_CFGADDR, SDRAM0_B1CR); | |
13074 | + break; | |
13075 | + case 2: | |
13076 | + mtdcr(DCRN_SDRAM0_CFGADDR, SDRAM0_B2CR); | |
13077 | + break; | |
13078 | + case 3: | |
13079 | + mtdcr(DCRN_SDRAM0_CFGADDR, SDRAM0_B3CR); | |
13080 | + break; | |
13081 | + } | |
13082 | + | |
13083 | + bank_config = mfdcr(DCRN_SDRAM0_CFGDATA); | |
13084 | + | |
13085 | + if (!(bank_config & SDRAM_CONFIG_BANK_ENABLE)) | |
13086 | + continue; | |
13087 | + switch (SDRAM_CONFIG_BANK_SIZE(bank_config)) | |
13088 | + { | |
13089 | + case SDRAM_CONFIG_SIZE_8M: | |
13090 | + mem_size += PPC44x_MEM_SIZE_8M; | |
13091 | + break; | |
13092 | + case SDRAM_CONFIG_SIZE_16M: | |
13093 | + mem_size += PPC44x_MEM_SIZE_16M; | |
13094 | + break; | |
13095 | + case SDRAM_CONFIG_SIZE_32M: | |
13096 | + mem_size += PPC44x_MEM_SIZE_32M; | |
13097 | + break; | |
13098 | + case SDRAM_CONFIG_SIZE_64M: | |
13099 | + mem_size += PPC44x_MEM_SIZE_64M; | |
13100 | + break; | |
13101 | + case SDRAM_CONFIG_SIZE_128M: | |
13102 | + mem_size += PPC44x_MEM_SIZE_128M; | |
13103 | + break; | |
13104 | + case SDRAM_CONFIG_SIZE_256M: | |
13105 | + mem_size += PPC44x_MEM_SIZE_256M; | |
13106 | + break; | |
13107 | + case SDRAM_CONFIG_SIZE_512M: | |
13108 | + mem_size += PPC44x_MEM_SIZE_512M; | |
13109 | + break; | |
13110 | + } | |
13111 | + } | |
13112 | + return mem_size; | |
13113 | +} | |
13114 | + | |
13115 | +static void __init | |
13116 | +ebony_init_irq(void) | |
13117 | +{ | |
13118 | + int i; | |
13119 | + | |
13120 | + ppc4xx_pic_init(); | |
13121 | + | |
13122 | + for (i = 0; i < NR_IRQS; i++) | |
13123 | + irq_desc[i].handler = ppc4xx_pic; | |
13124 | +} | |
13125 | + | |
13126 | +#ifdef CONFIG_SERIAL_TEXT_DEBUG | |
13127 | +#include <linux/serialP.h> | |
13128 | +#include <linux/serial_reg.h> | |
13129 | +#include <asm/serial.h> | |
13130 | + | |
13131 | +static struct serial_state rs_table[RS_TABLE_SIZE] = { | |
13132 | + SERIAL_PORT_DFNS /* Defined in <asm/serial.h> */ | |
13133 | +}; | |
13134 | + | |
13135 | +static void | |
13136 | +ebony_progress(char *s, unsigned short hex) | |
13137 | +{ | |
13138 | + volatile char c; | |
13139 | + volatile unsigned long com_port; | |
13140 | + u16 shift; | |
13141 | + | |
13142 | + com_port = (unsigned long)rs_table[0].iomem_base; | |
13143 | + shift = rs_table[0].iomem_reg_shift; | |
13144 | + | |
13145 | + while ((c = *s++) != 0) { | |
13146 | + while ((*((volatile unsigned char *)com_port + | |
13147 | + (UART_LSR << shift)) & UART_LSR_THRE) == 0) | |
13148 | + ; | |
13149 | + *(volatile unsigned char *)com_port = c; | |
13150 | + | |
13151 | + } | |
13152 | + | |
13153 | + /* Send LF/CR to pretty up output */ | |
13154 | + while ((*((volatile unsigned char *)com_port + | |
13155 | + (UART_LSR << shift)) & UART_LSR_THRE) == 0) | |
13156 | + ; | |
13157 | + *(volatile unsigned char *)com_port = '\r'; | |
13158 | + while ((*((volatile unsigned char *)com_port + | |
13159 | + (UART_LSR << shift)) & UART_LSR_THRE) == 0) | |
13160 | + ; | |
13161 | + *(volatile unsigned char *)com_port = '\n'; | |
13162 | +} | |
13163 | +#endif /* CONFIG_SERIAL_TEXT_DEBUG */ | |
13164 | + | |
13165 | +void __init platform_init(unsigned long r3, unsigned long r4, | |
13166 | + unsigned long r5, unsigned long r6, unsigned long r7) | |
13167 | +{ | |
13168 | + parse_bootinfo((struct bi_record *) (r3 + KERNELBASE)); | |
13169 | + | |
13170 | + ppc_md.setup_arch = ebony_setup_arch; | |
13171 | + ppc_md.show_cpuinfo = ebony_show_cpuinfo; | |
13172 | + ppc_md.init_IRQ = ebony_init_irq; | |
13173 | + ppc_md.get_irq = NULL; /* Set in ppc4xx_pic_init() */ | |
13174 | + | |
13175 | + ppc_md.find_end_of_memory = ebony_find_end_of_memory; | |
13176 | + | |
13177 | + ppc_md.restart = ebony_restart; | |
13178 | + ppc_md.power_off = ebony_power_off; | |
13179 | + ppc_md.halt = ebony_halt; | |
13180 | + | |
13181 | + ppc_md.calibrate_decr = ebony_calibrate_decr; | |
13182 | + ppc_md.time_init = todc_time_init; | |
13183 | + ppc_md.set_rtc_time = todc_set_rtc_time; | |
13184 | + ppc_md.get_rtc_time = todc_get_rtc_time; | |
13185 | + | |
13186 | + ppc_md.nvram_read_val = todc_direct_read_val; | |
13187 | + ppc_md.nvram_write_val = todc_direct_write_val; | |
13188 | + | |
13189 | +#ifdef CONFIG_SERIAL_TEXT_DEBUG | |
13190 | + ppc_md.progress = ebony_progress; | |
13191 | +#endif /* CONFIG_SERIAL_TEXT_DEBUG */ | |
13192 | +#ifdef CONFIG_KGDB | |
13193 | + ppc_md.early_serial_map = ebony_early_serial_map; | |
13194 | +#endif | |
13195 | +} | |
13196 | + | |
13197 | diff -Nru a/arch/ppc/platforms/4xx/ebony.h b/arch/ppc/platforms/4xx/ebony.h | |
13198 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
13199 | +++ b/arch/ppc/platforms/4xx/ebony.h Wed Sep 3 02:14:11 2003 | |
13200 | @@ -0,0 +1,96 @@ | |
13201 | +/* | |
13202 | + * arch/ppc/platforms/ebony.h | |
13203 | + * | |
13204 | + * Ebony board definitions | |
13205 | + * | |
13206 | + * Matt Porter <mporter@mvista.com> | |
13207 | + * | |
13208 | + * Copyright 2002 MontaVista Software Inc. | |
13209 | + * | |
13210 | + * This program is free software; you can redistribute it and/or modify it | |
13211 | + * under the terms of the GNU General Public License as published by the | |
13212 | + * Free Software Foundation; either version 2 of the License, or (at your | |
13213 | + * option) any later version. | |
13214 | + */ | |
13215 | + | |
13216 | +#ifdef __KERNEL__ | |
13217 | +#ifndef __ASM_EBONY_H__ | |
13218 | +#define __ASM_EBONY_H__ | |
13219 | + | |
13220 | +#include <linux/config.h> | |
13221 | +#include <platforms/4xx/ibm440gp.h> | |
13222 | + | |
13223 | +/* F/W TLB mapping used in bootloader glue to reset EMAC */ | |
13224 | +#define PPC44x_EMAC0_MR0 0xE0000800 | |
13225 | + | |
13226 | +/* Macros to get at Ebony VPD info */ | |
13227 | +#define EBONY_VPD_BASE 0x00000001fffffe00ULL | |
13228 | +#define EBONY_VPD_SIZE 0x24 | |
13229 | +#define EBONY_NA0_OFFSET 0x0c | |
13230 | +#define EBONY_NA1_OFFSET 0x18 | |
13231 | +#define EBONY_NA0_ADDR(base) (base + EBONY_NA0_OFFSET) | |
13232 | +#define EBONY_NA1_ADDR(base) (base + EBONY_NA1_OFFSET) | |
13233 | + | |
13234 | +/* Default clock rates for Rev. B and Rev. C silicon */ | |
13235 | +#define EBONY_440GP_RB_SYSCLK 33000000 | |
13236 | +#define EBONY_440GP_RC_SYSCLK 400000000 | |
13237 | + | |
13238 | +/* RTC/NVRAM location */ | |
13239 | +#define EBONY_RTC_ADDR 0x0000000148000000ULL | |
13240 | +#define EBONY_RTC_SIZE 0x2000 | |
13241 | + | |
13242 | +/* Flash */ | |
13243 | +#define EBONY_FPGA_ADDR 0x0000000148300000 | |
13244 | +#define EBONY_BOOT_SMALL_FLASH(x) (x & 0x20) | |
13245 | +#define EBONY_ONBRD_FLASH_EN(x) (x & 0x02) | |
13246 | +#define EBONY_FLASH_SEL(x) (x & 0x01) | |
13247 | +#define EBONY_SMALL_FLASH_LOW1 0x00000001ff800000 | |
13248 | +#define EBONY_SMALL_FLASH_LOW2 0x00000001ff880000 | |
13249 | +#define EBONY_SMALL_FLASH_HIGH1 0x00000001fff00000 | |
13250 | +#define EBONY_SMALL_FLASH_HIGH2 0x00000001fff80000 | |
13251 | +#define EBONY_SMALL_FLASH_SIZE 0x80000 | |
13252 | +#define EBONY_LARGE_FLASH_LOW 0x00000001ff800000 | |
13253 | +#define EBONY_LARGE_FLASH_HIGH 0x00000001ffc00000 | |
13254 | +#define EBONY_LARGE_FLASH_SIZE 0x400000 | |
13255 | + | |
13256 | +#define EBONY_SMALL_FLASH_BASE 0x00000001fff80000 | |
13257 | +#define EBONY_LARGE_FLASH_BASE 0x00000001ff800000 | |
13258 | + | |
13259 | +/* | |
13260 | + * Serial port defines | |
13261 | + */ | |
13262 | + | |
13263 | +/* OpenBIOS defined UART mappings, used before early_serial_setup */ | |
13264 | +#define UART0_IO_BASE (u8 *) 0xE0000200 | |
13265 | +#define UART1_IO_BASE (u8 *) 0xE0000300 | |
13266 | + | |
13267 | +#define BASE_BAUD 33000000/3/16 | |
13268 | +#define UART0_INT 0 | |
13269 | +#define UART1_INT 1 | |
13270 | + | |
13271 | +#define STD_UART_OP(num) \ | |
13272 | + { 0, BASE_BAUD, 0, UART##num##_INT, \ | |
13273 | + (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ | |
13274 | + iomem_base: UART##num##_IO_BASE, \ | |
13275 | + io_type: SERIAL_IO_MEM}, | |
13276 | + | |
13277 | +#define SERIAL_PORT_DFNS \ | |
13278 | + STD_UART_OP(0) \ | |
13279 | + STD_UART_OP(1) | |
13280 | + | |
13281 | +/* PCI support */ | |
13282 | +#define EBONY_PCI_LOWER_IO 0x00000000 | |
13283 | +#define EBONY_PCI_UPPER_IO 0x0000ffff | |
13284 | +#define EBONY_PCI_LOWER_MEM 0x80002000 | |
13285 | +#define EBONY_PCI_UPPER_MEM 0xffffefff | |
13286 | + | |
13287 | +#define EBONY_PCI_CFGREGS_BASE 0x000000020ec00000 | |
13288 | +#define EBONY_PCI_CFGA_PLB32 0x0ec00000 | |
13289 | +#define EBONY_PCI_CFGD_PLB32 0x0ec00004 | |
13290 | + | |
13291 | +#define EBONY_PCI_IO_BASE 0x0000000208000000ULL | |
13292 | +#define EBONY_PCI_IO_SIZE 0x00010000 | |
13293 | +#define EBONY_PCI_MEM_OFFSET 0x00000000 | |
13294 | + | |
13295 | +#endif /* __ASM_EBONY_H__ */ | |
13296 | +#endif /* __KERNEL__ */ | |
13297 | diff -Nru a/arch/ppc/platforms/4xx/ibm440gp.c b/arch/ppc/platforms/4xx/ibm440gp.c | |
13298 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
13299 | +++ b/arch/ppc/platforms/4xx/ibm440gp.c Wed Sep 3 02:14:28 2003 | |
13300 | @@ -0,0 +1,31 @@ | |
13301 | +/* | |
13302 | + * arch/ppc/platforms/4xx/ibm440gp.c | |
13303 | + * | |
13304 | + * PPC440GP I/O descriptions | |
13305 | + * | |
13306 | + * Matt Porter <mporter@mvista.com> | |
13307 | + * | |
13308 | + * Copyright 2002 MontaVista Software Inc. | |
13309 | + * | |
13310 | + * This program is free software; you can redistribute it and/or modify it | |
13311 | + * under the terms of the GNU General Public License as published by the | |
13312 | + * Free Software Foundation; either version 2 of the License, or (at your | |
13313 | + * option) any later version. | |
13314 | + * | |
13315 | + */ | |
13316 | +#include <platforms/4xx/ibm440gp.h> | |
13317 | +#include <asm/ocp.h> | |
13318 | +#include <linux/init.h> | |
13319 | + | |
13320 | +struct ocp_def core_ocp[] __initdata = { | |
13321 | + {OCP_VENDOR_IBM, OCP_FUNC_OPB, PPC440GP_OPB_BASE_START, OCP_IRQ_NA, OCP_CPM_NA}, | |
13322 | + {OCP_VENDOR_IBM, OCP_FUNC_16550, PPC440GP_UART0_ADDR, UART0_INT, IBM_CPM_UART0}, | |
13323 | + {OCP_VENDOR_IBM, OCP_FUNC_16550, PPC440GP_UART1_ADDR, UART1_INT, IBM_CPM_UART1}, | |
13324 | + {OCP_VENDOR_IBM, OCP_FUNC_IIC, PPC440GP_IIC0_ADDR, IIC0_IRQ, IBM_CPM_IIC0}, | |
13325 | + {OCP_VENDOR_IBM, OCP_FUNC_IIC, PPC440GP_IIC1_ADDR, IIC1_IRQ, IBM_CPM_IIC1}, | |
13326 | + {OCP_VENDOR_IBM, OCP_FUNC_GPIO, PPC440GP_GPIO0_ADDR, OCP_IRQ_NA, IBM_CPM_GPIO0}, | |
13327 | + {OCP_VENDOR_IBM, OCP_FUNC_EMAC, PPC440GP_EMAC0_ADDR, BL_MAC_ETH0, OCP_CPM_NA}, | |
13328 | + {OCP_VENDOR_IBM, OCP_FUNC_EMAC, PPC440GP_EMAC1_ADDR, BL_MAC_ETH1, OCP_CPM_NA}, | |
13329 | + {OCP_VENDOR_IBM, OCP_FUNC_ZMII, PPC440GP_ZMII_ADDR, OCP_IRQ_NA, OCP_CPM_NA}, | |
13330 | + {OCP_VENDOR_INVALID, OCP_FUNC_INVALID, 0x0, OCP_IRQ_NA, OCP_CPM_NA}, | |
13331 | +}; | |
13332 | diff -Nru a/arch/ppc/platforms/4xx/ibm440gp.h b/arch/ppc/platforms/4xx/ibm440gp.h | |
13333 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
13334 | +++ b/arch/ppc/platforms/4xx/ibm440gp.h Wed Sep 3 02:14:29 2003 | |
13335 | @@ -0,0 +1,102 @@ | |
13336 | +/* | |
13337 | + * arch/ppc/platforms/4xx/ibm440gp.h | |
13338 | + * | |
13339 | + * PPC440GP definitions | |
13340 | + * | |
13341 | + * Roland Dreier <roland@digitalvampire.org> | |
13342 | + * | |
13343 | + * Copyright 2002 Roland Dreier | |
13344 | + * | |
13345 | + * This program is free software; you can redistribute it and/or modify it | |
13346 | + * under the terms of the GNU General Public License as published by the | |
13347 | + * Free Software Foundation; either version 2 of the License, or (at your | |
13348 | + * option) any later version. | |
13349 | + * | |
13350 | + * This file contains code that was originally in the files ibm44x.h | |
13351 | + * and ebony.h, which were written by Matt Porter of MontaVista Software Inc. | |
13352 | + */ | |
13353 | + | |
13354 | +#ifdef __KERNEL__ | |
13355 | +#ifndef __PPC_PLATFORMS_IBM440GP_H | |
13356 | +#define __PPC_PLATFORMS_IBM440GP_H | |
13357 | + | |
13358 | +#include <linux/config.h> | |
13359 | + | |
13360 | +#define EMAC_NUMS 2 | |
13361 | +#define UART_NUMS 2 | |
13362 | +#define ZMII_NUMS 1 | |
13363 | +#define IIC_NUMS 2 | |
13364 | +#define IIC0_IRQ 2 | |
13365 | +#define IIC1_IRQ 3 | |
13366 | +#define GPIO_NUMS 1 | |
13367 | + | |
13368 | +/* UART location */ | |
13369 | +#define PPC440GP_UART0_ADDR 0x0000000140000200ULL | |
13370 | +#define PPC440GP_UART1_ADDR 0x0000000140000300ULL | |
13371 | + | |
13372 | +/* EMAC location */ | |
13373 | +#define PPC440GP_EMAC0_ADDR 0x0000000140000800ULL | |
13374 | +#define PPC440GP_EMAC1_ADDR 0x0000000140000900ULL | |
13375 | +#define PPC440GP_EMAC_SIZE 0x70 | |
13376 | + | |
13377 | +/* EMAC IRQ's */ | |
13378 | +#define BL_MAC_WOL 61 /* WOL */ | |
13379 | +#define BL_MAC_WOL1 63 /* WOL */ | |
13380 | +#define BL_MAL_SERR 32 /* MAL SERR */ | |
13381 | +#define BL_MAL_TXDE 33 /* MAL TXDE */ | |
13382 | +#define BL_MAL_RXDE 34 /* MAL RXDE */ | |
13383 | +#define BL_MAL_TXEOB 10 /* MAL TX EOB */ | |
13384 | +#define BL_MAL_RXEOB 11 /* MAL RX EOB */ | |
13385 | +#define BL_MAC_ETH0 60 /* MAC */ | |
13386 | +#define BL_MAC_ETH1 62 /* MAC */ | |
13387 | + | |
13388 | +/* ZMII location */ | |
13389 | +#define PPC440GP_ZMII_ADDR 0x0000000140000780ULL | |
13390 | +#define PPC440GP_ZMII_SIZE 0x0c | |
13391 | + | |
13392 | +/* I2C location */ | |
13393 | +#define PPC440GP_IIC0_ADDR 0x40000400 | |
13394 | +#define PPC440GP_IIC1_ADDR 0x40000500 | |
13395 | + | |
13396 | +/* GPIO location */ | |
13397 | +#define PPC440GP_GPIO0_ADDR 0x0000000140000700ULL | |
13398 | + | |
13399 | +/* Clock and Power Management */ | |
13400 | +#define IBM_CPM_IIC0 0x80000000 /* IIC interface */ | |
13401 | +#define IBM_CPM_IIC1 0x40000000 /* IIC interface */ | |
13402 | +#define IBM_CPM_PCI 0x20000000 /* PCI bridge */ | |
13403 | +#define IBM_CPM_CPU 0x02000000 /* processor core */ | |
13404 | +#define IBM_CPM_DMA 0x01000000 /* DMA controller */ | |
13405 | +#define IBM_CPM_BGO 0x00800000 /* PLB to OPB bus arbiter */ | |
13406 | +#define IBM_CPM_BGI 0x00400000 /* OPB to PLB bridge */ | |
13407 | +#define IBM_CPM_EBC 0x00200000 /* External Bux Controller */ | |
13408 | +#define IBM_CPM_EBM 0x00100000 /* Ext Bus Master Interface */ | |
13409 | +#define IBM_CPM_DMC 0x00080000 /* SDRAM peripheral controller */ | |
13410 | +#define IBM_CPM_PLB 0x00040000 /* PLB bus arbiter */ | |
13411 | +#define IBM_CPM_SRAM 0x00020000 /* SRAM memory controller */ | |
13412 | +#define IBM_CPM_PPM 0x00002000 /* PLB Performance Monitor */ | |
13413 | +#define IBM_CPM_UIC1 0x00001000 /* Universal Interrupt Controller */ | |
13414 | +#define IBM_CPM_GPIO0 0x00000800 /* General Purpose IO (??) */ | |
13415 | +#define IBM_CPM_GPT 0x00000400 /* General Purpose Timers */ | |
13416 | +#define IBM_CPM_UART0 0x00000200 /* serial port 0 */ | |
13417 | +#define IBM_CPM_UART1 0x00000100 /* serial port 1 */ | |
13418 | +#define IBM_CPM_UIC0 0x00000080 /* Universal Interrupt Controller */ | |
13419 | +#define IBM_CPM_TMRCLK 0x00000040 /* CPU timers */ | |
13420 | + | |
13421 | +#define DFLT_IBM4xx_PM ~(IBM_CPM_UIC | IBM_CPM_UIC1 | IBM_CPM_CPU \ | |
13422 | + | IBM_CPM_EBC | IBM_CPM_SRAM | IBM_CPM_BGO \ | |
13423 | + | IBM_CPM_EBM | IBM_CPM_PLB | IBM_CPM_OPB \ | |
13424 | + | IBM_CPM_TMRCLK | IBM_CPM_DMA | IBM_CPM_PCI) | |
13425 | + | |
13426 | +#define PPC440GP_OPB_BASE_START 0x0000000140000000ULL | |
13427 | + | |
13428 | +/* | |
13429 | + * Serial port defines | |
13430 | + */ | |
13431 | +#define RS_TABLE_SIZE 2 | |
13432 | + | |
13433 | +#include <asm/ibm44x.h> | |
13434 | +#include <syslib/ibm440gp_common.h> | |
13435 | + | |
13436 | +#endif /* __PPC_PLATFORMS_IBM440GP_H */ | |
13437 | +#endif /* __KERNEL__ */ | |
13438 | diff -Nru a/arch/ppc/platforms/4xx/ibm440gx.c b/arch/ppc/platforms/4xx/ibm440gx.c | |
13439 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
13440 | +++ b/arch/ppc/platforms/4xx/ibm440gx.c Wed Sep 3 02:14:29 2003 | |
13441 | @@ -0,0 +1,37 @@ | |
13442 | +/* | |
13443 | + * arch/ppc/platforms/ibm440gx.c | |
13444 | + * | |
13445 | + * PPC440GX I/O descriptions | |
13446 | + * | |
13447 | + * Matt Porter <mporter@mvista.com> | |
13448 | + * | |
13449 | + * Copyright 2002-2003 MontaVista Software Inc. | |
13450 | + * | |
13451 | + * This program is free software; you can redistribute it and/or modify it | |
13452 | + * under the terms of the GNU General Public License as published by the | |
13453 | + * Free Software Foundation; either version 2 of the License, or (at your | |
13454 | + * option) any later version. | |
13455 | + * | |
13456 | + */ | |
13457 | + | |
13458 | +#include <linux/config.h> | |
13459 | +#include <linux/init.h> | |
13460 | +#include <linux/smp.h> | |
13461 | +#include <linux/threads.h> | |
13462 | +#include <linux/param.h> | |
13463 | +#include <linux/string.h> | |
13464 | +#include <asm/ocp.h> | |
13465 | +#include <platforms/4xx/ibm440gx.h> | |
13466 | + | |
13467 | +struct ocp_def core_ocp[] __initdata = { | |
13468 | + {OCP_VENDOR_IBM, OCP_FUNC_OPB, PPC440GX_OPB_BASE_START, OCP_IRQ_NA, OCP_CPM_NA}, | |
13469 | + {OCP_VENDOR_IBM, OCP_FUNC_16550, PPC440GX_UART0_ADDR, UART0_IRQ, IBM_CPM_UART0}, | |
13470 | + {OCP_VENDOR_IBM, OCP_FUNC_16550, PPC440GX_UART1_ADDR, UART1_IRQ, IBM_CPM_UART1}, | |
13471 | + {OCP_VENDOR_IBM, OCP_FUNC_IIC, PPC440GX_IIC0_ADDR, IIC0_IRQ, IBM_CPM_IIC0}, | |
13472 | + {OCP_VENDOR_IBM, OCP_FUNC_IIC, PPC440GX_IIC1_ADDR, IIC1_IRQ, IBM_CPM_IIC1}, | |
13473 | + {OCP_VENDOR_IBM, OCP_FUNC_GPIO, PPC440GX_GPIO0_ADDR, OCP_IRQ_NA, IBM_CPM_GPIO0}, | |
13474 | + {OCP_VENDOR_IBM, OCP_FUNC_EMAC, PPC440GX_EMAC0_ADDR, BL_MAC_ETH0, OCP_CPM_NA}, | |
13475 | + {OCP_VENDOR_IBM, OCP_FUNC_EMAC, PPC440GX_EMAC1_ADDR, BL_MAC_ETH1, OCP_CPM_NA}, | |
13476 | + {OCP_VENDOR_IBM, OCP_FUNC_ZMII, PPC440GX_ZMII_ADDR, OCP_IRQ_NA, OCP_CPM_NA}, | |
13477 | + {OCP_VENDOR_INVALID, OCP_FUNC_INVALID, 0x0, OCP_IRQ_NA, OCP_CPM_NA}, | |
13478 | +}; | |
13479 | diff -Nru a/arch/ppc/platforms/4xx/ibm440gx.h b/arch/ppc/platforms/4xx/ibm440gx.h | |
13480 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
13481 | +++ b/arch/ppc/platforms/4xx/ibm440gx.h Wed Sep 3 05:16:34 2003 | |
13482 | @@ -0,0 +1,123 @@ | |
13483 | +/* | |
13484 | + * arch/ppc/platforms/ibm440gx.h | |
13485 | + * | |
13486 | + * PPC440GX definitions | |
13487 | + * | |
13488 | + * Matt Porter <mporter@mvista.com> | |
13489 | + * | |
13490 | + * Copyright 2002 Roland Dreier | |
13491 | + * Copyright 2003 MontaVista Software, Inc. | |
13492 | + * | |
13493 | + * This program is free software; you can redistribute it and/or modify it | |
13494 | + * under the terms of the GNU General Public License as published by the | |
13495 | + * Free Software Foundation; either version 2 of the License, or (at your | |
13496 | + * option) any later version. | |
13497 | + * | |
13498 | + */ | |
13499 | + | |
13500 | +#ifdef __KERNEL__ | |
13501 | +#ifndef __PPC_PLATFORMS_IBM440GX_H | |
13502 | +#define __PPC_PLATFORMS_IBM440GX_H | |
13503 | + | |
13504 | +#include <linux/config.h> | |
13505 | + | |
13506 | +#include <asm/ibm44x.h> | |
13507 | + | |
13508 | +/* UART */ | |
13509 | +#define PPC440GX_UART0_ADDR 0x0000000140000200ULL | |
13510 | +#define PPC440GX_UART1_ADDR 0x0000000140000300ULL | |
13511 | +#define UART0_IRQ 0 | |
13512 | +#define UART1_IRQ 1 | |
13513 | + | |
13514 | +/* EMAC */ | |
13515 | +#define PPC440GX_EMAC0_ADDR 0x0000000140000800ULL | |
13516 | +#define PPC440GX_EMAC1_ADDR 0x0000000140000900ULL | |
13517 | +#define PPC440GX_EMAC2_ADDR 0x0000000140000C00ULL | |
13518 | +#define PPC440GX_EMAC3_ADDR 0x0000000140000E00ULL | |
13519 | +#define PPC440GX_EMAC_SIZE 0xFC | |
13520 | +#define EMAC_NUMS 2 | |
13521 | +#define BL_MAC_WOL 61 /* WOL */ | |
13522 | +#define BL_MAC_WOL1 63 /* WOL */ | |
13523 | +#define BL_MAC_WOL2 65 /* WOL */ | |
13524 | +#define BL_MAC_WOL3 67 /* WOL */ | |
13525 | +#define BL_MAL_SERR 32 /* MAL SERR */ | |
13526 | +#define BL_MAL_TXDE 33 /* MAL TXDE */ | |
13527 | +#define BL_MAL_RXDE 34 /* MAL RXDE */ | |
13528 | +#define BL_MAL_TXEOB 10 /* MAL TX EOB */ | |
13529 | +#define BL_MAL_RXEOB 11 /* MAL RX EOB */ | |
13530 | +#define BL_MAC_ETH0 60 /* MAC */ | |
13531 | +#define BL_MAC_ETH1 62 /* MAC */ | |
13532 | +#define BL_MAC_ETH2 64 /* MAC */ | |
13533 | +#define BL_MAC_ETH3 66 /* MAC */ | |
13534 | +#define BL_TAH0 68 /* TAH 0 */ | |
13535 | +#define BL_TAH1 69 /* TAH 1 */ | |
13536 | + | |
13537 | +/* TAH */ | |
13538 | +#define PPC440GX_TAH0_ADDR 0x0000000140000B00ULL | |
13539 | +#define PPC440GX_TAH1_ADDR 0x0000000140000D00ULL | |
13540 | +#define PPC440GX_TAH_SIZE 0xFC | |
13541 | + | |
13542 | +/* ZMII */ | |
13543 | +#define PPC440GX_ZMII_ADDR 0x0000000140000780ULL | |
13544 | +#define PPC440GX_ZMII_SIZE 0x0c | |
13545 | + | |
13546 | +/* RGMII */ | |
13547 | +#define PPC440GX_RGMII_ADDR 0x0000000140000790ULL | |
13548 | +#define PPC440GX_RGMII_SIZE 0x0c | |
13549 | + | |
13550 | +/* IIC */ | |
13551 | +#define PPC440GX_IIC0_ADDR 0x40000400 | |
13552 | +#define PPC440GX_IIC1_ADDR 0x40000500 | |
13553 | +#define IIC0_IRQ 2 | |
13554 | +#define IIC1_IRQ 3 | |
13555 | + | |
13556 | +/* GPIO */ | |
13557 | +#define PPC440GX_GPIO0_ADDR 0x0000000140000700ULL | |
13558 | + | |
13559 | +/* Clock and Power Management */ | |
13560 | +#define IBM_CPM_IIC0 0x80000000 /* IIC interface */ | |
13561 | +#define IBM_CPM_IIC1 0x40000000 /* IIC interface */ | |
13562 | +#define IBM_CPM_PCI 0x20000000 /* PCI bridge */ | |
13563 | +#define IBM_CPM_RGMII 0x10000000 /* RGMII */ | |
13564 | +#define IBM_CPM_TAHOE0 0x08000000 /* TAHOE 0 */ | |
13565 | +#define IBM_CPM_TAHOE1 0x04000000 /* TAHOE 1 */ | |
13566 | +#define IBM_CPM_CPU 0x02000000 /* processor core */ | |
13567 | +#define IBM_CPM_DMA 0x01000000 /* DMA controller */ | |
13568 | +#define IBM_CPM_BGO 0x00800000 /* PLB to OPB bus arbiter */ | |
13569 | +#define IBM_CPM_BGI 0x00400000 /* OPB to PLB bridge */ | |
13570 | +#define IBM_CPM_EBC 0x00200000 /* External Bux Controller */ | |
13571 | +#define IBM_CPM_EBM 0x00100000 /* Ext Bus Master Interface */ | |
13572 | +#define IBM_CPM_DMC 0x00080000 /* SDRAM peripheral controller */ | |
13573 | +#define IBM_CPM_PLB 0x00040000 /* PLB bus arbiter */ | |
13574 | +#define IBM_CPM_SRAM 0x00020000 /* SRAM memory controller */ | |
13575 | +#define IBM_CPM_PPM 0x00002000 /* PLB Performance Monitor */ | |
13576 | +#define IBM_CPM_UIC1 0x00001000 /* Universal Interrupt Controller */ | |
13577 | +#define IBM_CPM_GPIO0 0x00000800 /* General Purpose IO (??) */ | |
13578 | +#define IBM_CPM_GPT 0x00000400 /* General Purpose Timers */ | |
13579 | +#define IBM_CPM_UART0 0x00000200 /* serial port 0 */ | |
13580 | +#define IBM_CPM_UART1 0x00000100 /* serial port 1 */ | |
13581 | +#define IBM_CPM_UIC0 0x00000080 /* Universal Interrupt Controller */ | |
13582 | +#define IBM_CPM_TMRCLK 0x00000040 /* CPU timers */ | |
13583 | +#define IBM_CPM_EMAC0 0x00000020 /* EMAC 0 */ | |
13584 | +#define IBM_CPM_EMAC1 0x00000010 /* EMAC 1 */ | |
13585 | +#define IBM_CPM_EMAC2 0x00000008 /* EMAC 2 */ | |
13586 | +#define IBM_CPM_EMAC3 0x00000004 /* EMAC 3 */ | |
13587 | + | |
13588 | +#define DFLT_IBM4xx_PM ~(IBM_CPM_UIC | IBM_CPM_UIC1 | IBM_CPM_CPU \ | |
13589 | + | IBM_CPM_EBC | IBM_CPM_SRAM | IBM_CPM_BGO \ | |
13590 | + | IBM_CPM_EBM | IBM_CPM_PLB | IBM_CPM_OPB \ | |
13591 | + | IBM_CPM_TMRCLK | IBM_CPM_DMA | IBM_CPM_PCI \ | |
13592 | + | IBM_CPM_TAHOE0 | IBM_CPM_TAHOE1 \ | |
13593 | + | IBM_CPM_EMAC0 | IBM_CPM_EMAC1 \ | |
13594 | + | IBM_CPM_EMAC2 | IBM_CPM_EMAC3 ) | |
13595 | + | |
13596 | +/* OPB */ | |
13597 | +#define PPC440GX_OPB_BASE_START 0x0000000140000000ULL | |
13598 | + | |
13599 | +/* | |
13600 | + * Serial port defines | |
13601 | + */ | |
13602 | +#define RS_TABLE_SIZE 2 | |
13603 | + | |
13604 | +#endif /* __PPC_PLATFORMS_IBM440GX_H */ | |
13605 | +#endif /* __KERNEL__ */ | |
13606 | diff -Nru a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c | |
13607 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
13608 | +++ b/arch/ppc/platforms/4xx/ocotea.c Wed Sep 3 02:14:47 2003 | |
13609 | @@ -0,0 +1,459 @@ | |
13610 | +/* | |
13611 | + * arch/ppc/platforms/ocotea.c | |
13612 | + * | |
13613 | + * Ocotea board specific routines | |
13614 | + * | |
13615 | + * Matt Porter <mporter@mvista.com> | |
13616 | + * | |
13617 | + * Copyright 2003 MontaVista Software Inc. | |
13618 | + * | |
13619 | + * This program is free software; you can redistribute it and/or modify it | |
13620 | + * under the terms of the GNU General Public License as published by the | |
13621 | + * Free Software Foundation; either version 2 of the License, or (at your | |
13622 | + * option) any later version. | |
13623 | + */ | |
13624 | + | |
13625 | +#include <linux/config.h> | |
13626 | +#include <linux/stddef.h> | |
13627 | +#include <linux/kernel.h> | |
13628 | +#include <linux/init.h> | |
13629 | +#include <linux/errno.h> | |
13630 | +#include <linux/reboot.h> | |
13631 | +#include <linux/pci.h> | |
13632 | +#include <linux/kdev_t.h> | |
13633 | +#include <linux/types.h> | |
13634 | +#include <linux/major.h> | |
13635 | +#include <linux/blkdev.h> | |
13636 | +#include <linux/console.h> | |
13637 | +#include <linux/delay.h> | |
13638 | +#include <linux/ide.h> | |
13639 | +#include <linux/initrd.h> | |
13640 | +#include <linux/irq.h> | |
13641 | +#include <linux/seq_file.h> | |
13642 | +#include <linux/root_dev.h> | |
13643 | +#include <linux/tty.h> | |
13644 | +#include <linux/serial.h> | |
13645 | +#include <linux/serial_core.h> | |
13646 | + | |
13647 | +#include <asm/system.h> | |
13648 | +#include <asm/pgtable.h> | |
13649 | +#include <asm/page.h> | |
13650 | +#include <asm/dma.h> | |
13651 | +#include <asm/io.h> | |
13652 | +#include <asm/machdep.h> | |
13653 | +#include <asm/pci-bridge.h> | |
13654 | +#include <asm/time.h> | |
13655 | +#include <asm/todc.h> | |
13656 | +#include <asm/bootinfo.h> | |
13657 | +#include <asm/ppc4xx_pic.h> | |
13658 | + | |
13659 | +extern void abort(void); | |
13660 | + | |
13661 | +/* Global Variables */ | |
13662 | +bd_t __res; | |
13663 | + | |
13664 | +static void __init | |
13665 | +ocotea_calibrate_decr(void) | |
13666 | +{ | |
13667 | + unsigned int freq; | |
13668 | + | |
13669 | + freq = OCOTEA_SYSCLK; | |
13670 | + | |
13671 | + tb_ticks_per_jiffy = freq / HZ; | |
13672 | + tb_to_us = mulhwu_scale_factor(freq, 1000000); | |
13673 | + | |
13674 | + /* Set the time base to zero */ | |
13675 | + mtspr(SPRN_TBWL, 0); | |
13676 | + mtspr(SPRN_TBWU, 0); | |
13677 | + | |
13678 | + /* Clear any pending timer interrupts */ | |
13679 | + mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS); | |
13680 | + | |
13681 | + /* Enable decrementer interrupt */ | |
13682 | + mtspr(SPRN_TCR, TCR_DIE); | |
13683 | +} | |
13684 | + | |
13685 | +static int | |
13686 | +ocotea_show_cpuinfo(struct seq_file *m) | |
13687 | +{ | |
13688 | + seq_printf(m, "vendor\t\t: IBM\n"); | |
13689 | + seq_printf(m, "machine\t\t: PPC440GX EVB (Ocotea)\n"); | |
13690 | + | |
13691 | + return 0; | |
13692 | +} | |
13693 | +static inline int | |
13694 | +ocotea_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) | |
13695 | +{ | |
13696 | + static char pci_irq_table[][4] = | |
13697 | + /* | |
13698 | + * PCI IDSEL/INTPIN->INTLINE | |
13699 | + * A B C D | |
13700 | + */ | |
13701 | + { | |
13702 | + { 23, 23, 23, 23 }, /* IDSEL 1 - PCI Slot 0 */ | |
13703 | + { 24, 24, 24, 24 }, /* IDSEL 2 - PCI Slot 1 */ | |
13704 | + { 25, 25, 25, 25 }, /* IDSEL 3 - PCI Slot 2 */ | |
13705 | + { 26, 26, 26, 26 }, /* IDSEL 4 - PCI Slot 3 */ | |
13706 | + }; | |
13707 | + | |
13708 | + const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4; | |
13709 | + return PCI_IRQ_TABLE_LOOKUP; | |
13710 | +} | |
13711 | + | |
13712 | +#define PCIX_READW(offset) \ | |
13713 | + (readw((u32)pcix_reg_base+offset)) | |
13714 | + | |
13715 | +#define PCIX_WRITEW(value, offset) \ | |
13716 | + (writew(value, (u32)pcix_reg_base+offset)) | |
13717 | + | |
13718 | +#define PCIX_WRITEL(value, offset) \ | |
13719 | + (writel(value, (u32)pcix_reg_base+offset)) | |
13720 | + | |
13721 | +/* | |
13722 | + * FIXME: This is only here to "make it work". This will move | |
13723 | + * to a ibm_pcix.c which will contain a generic IBM PCIX bridge | |
13724 | + * configuration library. -Matt | |
13725 | + */ | |
13726 | +static void __init | |
13727 | +ocotea_setup_pcix(void) | |
13728 | +{ | |
13729 | + void *pcix_reg_base; | |
13730 | + | |
13731 | + pcix_reg_base = ioremap64(PCIX0_REG_BASE, PCIX0_REG_SIZE); | |
13732 | + | |
13733 | + /* Enable PCIX0 I/O, Mem, and Busmaster cycles */ | |
13734 | + PCIX_WRITEW(PCIX_READW(PCIX0_COMMAND) | PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER, PCIX0_COMMAND); | |
13735 | + | |
13736 | + /* Disable all windows */ | |
13737 | + PCIX_WRITEL(0, PCIX0_POM0SA); | |
13738 | + PCIX_WRITEL(0, PCIX0_POM1SA); | |
13739 | + PCIX_WRITEL(0, PCIX0_POM2SA); | |
13740 | + PCIX_WRITEL(0, PCIX0_PIM0SA); | |
13741 | + PCIX_WRITEL(0, PCIX0_PIM0SAH); | |
13742 | + PCIX_WRITEL(0, PCIX0_PIM1SA); | |
13743 | + PCIX_WRITEL(0, PCIX0_PIM2SA); | |
13744 | + PCIX_WRITEL(0, PCIX0_PIM2SAH); | |
13745 | + | |
13746 | + /* Setup 2GB PLB->PCI outbound mem window (3_8000_0000->0_8000_0000) */ | |
13747 | + PCIX_WRITEL(0x00000003, PCIX0_POM0LAH); | |
13748 | + PCIX_WRITEL(0x80000000, PCIX0_POM0LAL); | |
13749 | + PCIX_WRITEL(0x00000000, PCIX0_POM0PCIAH); | |
13750 | + PCIX_WRITEL(0x80000000, PCIX0_POM0PCIAL); | |
13751 | + PCIX_WRITEL(0x80000001, PCIX0_POM0SA); | |
13752 | + | |
13753 | + /* Setup 2GB PCI->PLB inbound memory window at 0, enable MSIs */ | |
13754 | + PCIX_WRITEL(0x00000000, PCIX0_PIM0LAH); | |
13755 | + PCIX_WRITEL(0x00000000, PCIX0_PIM0LAL); | |
13756 | + PCIX_WRITEL(0xe0000007, PCIX0_PIM0SA); | |
13757 | + | |
13758 | + eieio(); | |
13759 | +} | |
13760 | + | |
13761 | +static void __init | |
13762 | +ocotea_setup_hose(void) | |
13763 | +{ | |
13764 | + struct pci_controller *hose; | |
13765 | + | |
13766 | + /* Configure windows on the PCI-X host bridge */ | |
13767 | + ocotea_setup_pcix(); | |
13768 | + | |
13769 | + hose = pcibios_alloc_controller(); | |
13770 | + | |
13771 | + if (!hose) | |
13772 | + return; | |
13773 | + | |
13774 | + hose->first_busno = 0; | |
13775 | + hose->last_busno = 0xff; | |
13776 | + | |
13777 | + hose->pci_mem_offset = OCOTEA_PCI_MEM_OFFSET; | |
13778 | + | |
13779 | + pci_init_resource(&hose->io_resource, | |
13780 | + OCOTEA_PCI_LOWER_IO, | |
13781 | + OCOTEA_PCI_UPPER_IO, | |
13782 | + IORESOURCE_IO, | |
13783 | + "PCI host bridge"); | |
13784 | + | |
13785 | + pci_init_resource(&hose->mem_resources[0], | |
13786 | + OCOTEA_PCI_LOWER_MEM, | |
13787 | + OCOTEA_PCI_UPPER_MEM, | |
13788 | + IORESOURCE_MEM, | |
13789 | + "PCI host bridge"); | |
13790 | + | |
13791 | + hose->io_space.start = OCOTEA_PCI_LOWER_IO; | |
13792 | + hose->io_space.end = OCOTEA_PCI_UPPER_IO; | |
13793 | + hose->mem_space.start = OCOTEA_PCI_LOWER_MEM; | |
13794 | + hose->mem_space.end = OCOTEA_PCI_UPPER_MEM; | |
13795 | + isa_io_base = | |
13796 | + (unsigned long)ioremap64(OCOTEA_PCI_IO_BASE, OCOTEA_PCI_IO_SIZE); | |
13797 | + hose->io_base_virt = (void *)isa_io_base; | |
13798 | + | |
13799 | + setup_indirect_pci(hose, | |
13800 | + OCOTEA_PCI_CFGA_PLB32, | |
13801 | + OCOTEA_PCI_CFGD_PLB32); | |
13802 | + hose->set_cfg_type = 1; | |
13803 | + | |
13804 | + hose->last_busno = pciauto_bus_scan(hose, hose->first_busno); | |
13805 | + | |
13806 | + ppc_md.pci_swizzle = common_swizzle; | |
13807 | + ppc_md.pci_map_irq = ocotea_map_irq; | |
13808 | +} | |
13809 | + | |
13810 | + | |
13811 | +TODC_ALLOC(); | |
13812 | + | |
13813 | +static void __init | |
13814 | +ocotea_early_serial_map(void) | |
13815 | +{ | |
13816 | + struct uart_port port; | |
13817 | + | |
13818 | + /* Setup ioremapped serial port access */ | |
13819 | + memset(&port, 0, sizeof(port)); | |
13820 | + port.membase = ioremap64(PPC440GX_UART0_ADDR, 8); | |
13821 | + port.irq = 0; | |
13822 | + port.uartclk = BASE_BAUD * 16; | |
13823 | + port.regshift = 0; | |
13824 | + port.iotype = SERIAL_IO_MEM; | |
13825 | + port.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST; | |
13826 | + port.line = 0; | |
13827 | + | |
13828 | + if (early_serial_setup(&port) != 0) { | |
13829 | + printk("Early serial init of port 0 failed\n"); | |
13830 | + } | |
13831 | + | |
13832 | + port.membase = ioremap64(PPC440GX_UART1_ADDR, 8); | |
13833 | + port.irq = 1; | |
13834 | + port.line = 1; | |
13835 | + | |
13836 | + if (early_serial_setup(&port) != 0) { | |
13837 | + printk("Early serial init of port 1 failed\n"); | |
13838 | + } | |
13839 | +} | |
13840 | + | |
13841 | +static void __init | |
13842 | +ocotea_setup_arch(void) | |
13843 | +{ | |
13844 | + unsigned char *addr; | |
13845 | + unsigned long long mac64; | |
13846 | + | |
13847 | + /* Retrieve MAC addresses from flash */ | |
13848 | + addr = ioremap64(OCOTEA_MAC_BASE, OCOTEA_MAC_SIZE); | |
13849 | + mac64 = simple_strtoull(addr, 0, 16); | |
13850 | + memcpy(__res.bi_enetaddr[0], (char *)&mac64+2, 6); | |
13851 | + mac64 = simple_strtoull(addr+OCOTEA_MAC1_OFFSET, 0, 16); | |
13852 | + memcpy(__res.bi_enetaddr[1], (char *)&mac64+2, 6); | |
13853 | + iounmap(addr); | |
13854 | + | |
13855 | +#if !defined(CONFIG_BDI_SWITCH) | |
13856 | + /* | |
13857 | + * The Abatron BDI JTAG debugger does not tolerate others | |
13858 | + * mucking with the debug registers. | |
13859 | + */ | |
13860 | + mtspr(SPRN_DBCR0, (DBCR0_TDE | DBCR0_IDM)); | |
13861 | +#endif | |
13862 | + | |
13863 | + /* Setup TODC access */ | |
13864 | + TODC_INIT(TODC_TYPE_DS1743, | |
13865 | + 0, | |
13866 | + 0, | |
13867 | + ioremap64(OCOTEA_RTC_ADDR, OCOTEA_RTC_SIZE), | |
13868 | + 8); | |
13869 | + | |
13870 | + /* init to some ~sane value until calibrate_delay() runs */ | |
13871 | + loops_per_jiffy = 50000000/HZ; | |
13872 | + | |
13873 | + /* Setup PCI host bridge */ | |
13874 | + ocotea_setup_hose(); | |
13875 | + | |
13876 | +#ifdef CONFIG_BLK_DEV_INITRD | |
13877 | + if (initrd_start) | |
13878 | + ROOT_DEV = Root_RAM0; | |
13879 | + else | |
13880 | +#endif | |
13881 | +#ifdef CONFIG_ROOT_NFS | |
13882 | + ROOT_DEV = Root_NFS; | |
13883 | +#else | |
13884 | + ROOT_DEV = Root_HDA1; | |
13885 | +#endif | |
13886 | + | |
13887 | +#ifdef CONFIG_DUMMY_CONSOLE | |
13888 | + conswitchp = &dummy_con; | |
13889 | +#endif | |
13890 | + | |
13891 | + ocotea_early_serial_map(); | |
13892 | + | |
13893 | + /* Identify the system */ | |
13894 | + printk("IBM Ocotea port (MontaVista Software, Inc. <source@mvista.com>)\n"); | |
13895 | +} | |
13896 | + | |
13897 | +static void | |
13898 | +ocotea_restart(char *cmd) | |
13899 | +{ | |
13900 | + local_irq_disable(); | |
13901 | + abort(); | |
13902 | +} | |
13903 | + | |
13904 | +static void | |
13905 | +ocotea_power_off(void) | |
13906 | +{ | |
13907 | + local_irq_disable(); | |
13908 | + for(;;); | |
13909 | +} | |
13910 | + | |
13911 | +static void | |
13912 | +ocotea_halt(void) | |
13913 | +{ | |
13914 | + local_irq_disable(); | |
13915 | + for(;;); | |
13916 | +} | |
13917 | + | |
13918 | +/* | |
13919 | + * Read the 440GX memory controller to get size of system memory. | |
13920 | + */ | |
13921 | +static unsigned long __init | |
13922 | +ocotea_find_end_of_memory(void) | |
13923 | +{ | |
13924 | + u32 i, bank_config; | |
13925 | + u32 mem_size = 0; | |
13926 | + | |
13927 | + for (i=0; i<4; i++) | |
13928 | + { | |
13929 | + switch (i) | |
13930 | + { | |
13931 | + case 0: | |
13932 | + mtdcr(DCRN_SDRAM0_CFGADDR, SDRAM0_B0CR); | |
13933 | + break; | |
13934 | + case 1: | |
13935 | + mtdcr(DCRN_SDRAM0_CFGADDR, SDRAM0_B1CR); | |
13936 | + break; | |
13937 | + case 2: | |
13938 | + mtdcr(DCRN_SDRAM0_CFGADDR, SDRAM0_B2CR); | |
13939 | + break; | |
13940 | + case 3: | |
13941 | + mtdcr(DCRN_SDRAM0_CFGADDR, SDRAM0_B3CR); | |
13942 | + break; | |
13943 | + } | |
13944 | + | |
13945 | + bank_config = mfdcr(DCRN_SDRAM0_CFGDATA); | |
13946 | + | |
13947 | + if (!(bank_config & SDRAM_CONFIG_BANK_ENABLE)) | |
13948 | + continue; | |
13949 | + switch (SDRAM_CONFIG_BANK_SIZE(bank_config)) | |
13950 | + { | |
13951 | + case SDRAM_CONFIG_SIZE_8M: | |
13952 | + mem_size += PPC44x_MEM_SIZE_8M; | |
13953 | + break; | |
13954 | + case SDRAM_CONFIG_SIZE_16M: | |
13955 | + mem_size += PPC44x_MEM_SIZE_16M; | |
13956 | + break; | |
13957 | + case SDRAM_CONFIG_SIZE_32M: | |
13958 | + mem_size += PPC44x_MEM_SIZE_32M; | |
13959 | + break; | |
13960 | + case SDRAM_CONFIG_SIZE_64M: | |
13961 | + mem_size += PPC44x_MEM_SIZE_64M; | |
13962 | + break; | |
13963 | + case SDRAM_CONFIG_SIZE_128M: | |
13964 | + mem_size += PPC44x_MEM_SIZE_128M; | |
13965 | + break; | |
13966 | + case SDRAM_CONFIG_SIZE_256M: | |
13967 | + mem_size += PPC44x_MEM_SIZE_256M; | |
13968 | + break; | |
13969 | + case SDRAM_CONFIG_SIZE_512M: | |
13970 | + mem_size += PPC44x_MEM_SIZE_512M; | |
13971 | + break; | |
13972 | + } | |
13973 | + } | |
13974 | + return mem_size; | |
13975 | +} | |
13976 | + | |
13977 | +static void __init | |
13978 | +ocotea_init_irq(void) | |
13979 | +{ | |
13980 | + int i; | |
13981 | + | |
13982 | + /* Enable PPC440GP interrupt compatibility mode */ | |
13983 | + SDR_WRITE(DCRN_SDR_MFR,SDR_READ(DCRN_SDR_MFR) | DCRN_SDR_MFR_PCM); | |
13984 | + | |
13985 | + ppc4xx_pic_init(); | |
13986 | + | |
13987 | + for (i = 0; i < NR_IRQS; i++) | |
13988 | + irq_desc[i].handler = ppc4xx_pic; | |
13989 | +} | |
13990 | + | |
13991 | +#ifdef CONFIG_SERIAL_TEXT_DEBUG | |
13992 | +#include <linux/serialP.h> | |
13993 | +#include <linux/serial_reg.h> | |
13994 | +#include <asm/serial.h> | |
13995 | +struct serial_state rs_table[RS_TABLE_SIZE] = { | |
13996 | + SERIAL_PORT_DFNS /* Defined in <asm/serial.h> */ | |
13997 | +}; | |
13998 | + | |
13999 | +static void | |
14000 | +ocotea_progress(char *s, unsigned short hex) | |
14001 | +{ | |
14002 | + volatile char c; | |
14003 | + volatile unsigned long com_port; | |
14004 | + u16 shift; | |
14005 | + | |
14006 | + com_port = (unsigned long)rs_table[0].iomem_base; | |
14007 | + shift = rs_table[0].iomem_reg_shift; | |
14008 | + | |
14009 | + while ((c = *s++) != 0) { | |
14010 | + while ((*((volatile unsigned char *)com_port + | |
14011 | + (UART_LSR << shift)) & UART_LSR_THRE) == 0) | |
14012 | + ; | |
14013 | + *(volatile unsigned char *)com_port = c; | |
14014 | + | |
14015 | + } | |
14016 | + | |
14017 | + /* Send LF/CR to pretty up output */ | |
14018 | + while ((*((volatile unsigned char *)com_port + | |
14019 | + (UART_LSR << shift)) & UART_LSR_THRE) == 0) | |
14020 | + ; | |
14021 | + *(volatile unsigned char *)com_port = '\r'; | |
14022 | + while ((*((volatile unsigned char *)com_port + | |
14023 | + (UART_LSR << shift)) & UART_LSR_THRE) == 0) | |
14024 | + ; | |
14025 | + *(volatile unsigned char *)com_port = '\n'; | |
14026 | +} | |
14027 | +#endif /* CONFIG_SERIAL_TEXT_DEBUG */ | |
14028 | + | |
14029 | +#if 0 | |
14030 | +static void __init | |
14031 | +ocotea_map_io(void) | |
14032 | +{ | |
14033 | + io_block_mapping(0xe0000000, 0x0000000140000000, | |
14034 | + 0x00001000, _PAGE_IO); | |
14035 | +} | |
14036 | +#endif | |
14037 | + | |
14038 | +void __init platform_init(unsigned long r3, unsigned long r4, | |
14039 | + unsigned long r5, unsigned long r6, unsigned long r7) | |
14040 | +{ | |
14041 | + parse_bootinfo((struct bi_record *) (r3 + KERNELBASE)); | |
14042 | + | |
14043 | + ppc_md.setup_arch = ocotea_setup_arch; | |
14044 | + ppc_md.show_cpuinfo = ocotea_show_cpuinfo; | |
14045 | + ppc_md.init_IRQ = ocotea_init_irq; | |
14046 | + ppc_md.get_irq = NULL; /* Set in ppc4xx_pic_init() */ | |
14047 | + | |
14048 | + ppc_md.find_end_of_memory = ocotea_find_end_of_memory; | |
14049 | + | |
14050 | + ppc_md.restart = ocotea_restart; | |
14051 | + ppc_md.power_off = ocotea_power_off; | |
14052 | + ppc_md.halt = ocotea_halt; | |
14053 | + | |
14054 | + ppc_md.calibrate_decr = ocotea_calibrate_decr; | |
14055 | + ppc_md.time_init = todc_time_init; | |
14056 | + ppc_md.set_rtc_time = todc_set_rtc_time; | |
14057 | + ppc_md.get_rtc_time = todc_get_rtc_time; | |
14058 | + | |
14059 | + ppc_md.nvram_read_val = todc_direct_read_val; | |
14060 | + ppc_md.nvram_write_val = todc_direct_write_val; | |
14061 | + | |
14062 | +#ifdef CONFIG_SERIAL_TEXT_DEBUG | |
14063 | + ppc_md.progress = ocotea_progress; | |
14064 | +#endif /* CONFIG_SERIAL_TEXT_DEBUG */ | |
14065 | +#ifdef CONFIG_KGDB | |
14066 | + ppc_md.early_serial_map = ocotea_early_serial_map; | |
14067 | +#endif | |
14068 | +} | |
14069 | diff -Nru a/arch/ppc/platforms/4xx/ocotea.h b/arch/ppc/platforms/4xx/ocotea.h | |
14070 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
14071 | +++ b/arch/ppc/platforms/4xx/ocotea.h Wed Sep 3 05:16:34 2003 | |
14072 | @@ -0,0 +1,84 @@ | |
14073 | +/* | |
14074 | + * arch/ppc/platforms/ocotea.h | |
14075 | + * | |
14076 | + * Ocotea board definitions | |
14077 | + * | |
14078 | + * Matt Porter <mporter@mvista.com> | |
14079 | + * | |
14080 | + * Copyright 2003 MontaVista Software Inc. | |
14081 | + * | |
14082 | + * This program is free software; you can redistribute it and/or modify it | |
14083 | + * under the terms of the GNU General Public License as published by the | |
14084 | + * Free Software Foundation; either version 2 of the License, or (at your | |
14085 | + * option) any later version. | |
14086 | + * | |
14087 | + */ | |
14088 | + | |
14089 | +#ifdef __KERNEL__ | |
14090 | +#ifndef __ASM_OCOTEA_H__ | |
14091 | +#define __ASM_OCOTEA_H__ | |
14092 | + | |
14093 | +#include <linux/config.h> | |
14094 | +#include <platforms/4xx/ibm440gx.h> | |
14095 | + | |
14096 | +/* F/W TLB mapping used in bootloader glue to reset EMAC */ | |
14097 | +#define PPC44x_EMAC0_MR0 0xE0000800 | |
14098 | + | |
14099 | +/* Location of MAC addresses in firmware */ | |
14100 | +#define OCOTEA_MAC_BASE (OCOTEA_SMALL_FLASH_HIGH+0xc0500) | |
14101 | +#define OCOTEA_MAC_SIZE 0x200 | |
14102 | +#define OCOTEA_MAC1_OFFSET 0x100 | |
14103 | + | |
14104 | +/* Default clock rate */ | |
14105 | +#define OCOTEA_SYSCLK 25000000 | |
14106 | + | |
14107 | +/* RTC/NVRAM location */ | |
14108 | +#define OCOTEA_RTC_ADDR 0x0000000148000000ULL | |
14109 | +#define OCOTEA_RTC_SIZE 0x2000 | |
14110 | + | |
14111 | +/* Flash */ | |
14112 | +#define OCOTEA_FPGA_ADDR 0x0000000148300000ULL | |
14113 | +#define OCOTEA_BOOT_LARGE_FLASH(x) (x & 0x40) | |
14114 | +#define OCOTEA_SMALL_FLASH_LOW 0x00000001ff900000ULL | |
14115 | +#define OCOTEA_SMALL_FLASH_HIGH 0x00000001fff00000ULL | |
14116 | +#define OCOTEA_SMALL_FLASH_SIZE 0x100000 | |
14117 | +#define OCOTEA_LARGE_FLASH_LOW 0x00000001ff800000ULL | |
14118 | +#define OCOTEA_LARGE_FLASH_HIGH 0x00000001ffc00000ULL | |
14119 | +#define OCOTEA_LARGE_FLASH_SIZE 0x400000 | |
14120 | + | |
14121 | +/* | |
14122 | + * Serial port defines | |
14123 | + */ | |
14124 | +#define RS_TABLE_SIZE 2 | |
14125 | + | |
14126 | +/* OpenBIOS defined UART mappings, used before early_serial_setup */ | |
14127 | +#define UART0_IO_BASE (u8 *) 0xE0000200 | |
14128 | +#define UART1_IO_BASE (u8 *) 0xE0000300 | |
14129 | + | |
14130 | +#define BASE_BAUD 11059200/16 | |
14131 | +#define STD_UART_OP(num) \ | |
14132 | + { 0, BASE_BAUD, 0, UART##num##_IRQ, \ | |
14133 | + (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ | |
14134 | + iomem_base: UART##num##_IO_BASE, \ | |
14135 | + io_type: SERIAL_IO_MEM}, | |
14136 | + | |
14137 | +#define SERIAL_PORT_DFNS \ | |
14138 | + STD_UART_OP(0) \ | |
14139 | + STD_UART_OP(1) | |
14140 | + | |
14141 | +/* PCI support */ | |
14142 | +#define OCOTEA_PCI_LOWER_IO 0x00000000 | |
14143 | +#define OCOTEA_PCI_UPPER_IO 0x0000ffff | |
14144 | +#define OCOTEA_PCI_LOWER_MEM 0x80000000 | |
14145 | +#define OCOTEA_PCI_UPPER_MEM 0xffffefff | |
14146 | + | |
14147 | +#define OCOTEA_PCI_CFGREGS_BASE 0x000000020ec00000ULL | |
14148 | +#define OCOTEA_PCI_CFGA_PLB32 0x0ec00000 | |
14149 | +#define OCOTEA_PCI_CFGD_PLB32 0x0ec00004 | |
14150 | + | |
14151 | +#define OCOTEA_PCI_IO_BASE 0x0000000208000000ULL | |
14152 | +#define OCOTEA_PCI_IO_SIZE 0x00010000 | |
14153 | +#define OCOTEA_PCI_MEM_OFFSET 0x00000000 | |
14154 | + | |
14155 | +#endif /* __ASM_OCOTEA_H__ */ | |
14156 | +#endif /* __KERNEL__ */ | |
14157 | diff -Nru a/arch/ppc/platforms/mcpn765_serial.h b/arch/ppc/platforms/mcpn765_serial.h | |
14158 | --- a/arch/ppc/platforms/mcpn765_serial.h Tue Feb 11 15:48:53 2003 | |
14159 | +++ b/arch/ppc/platforms/mcpn765_serial.h Mon Jul 21 09:05:22 2003 | |
14160 | @@ -30,7 +30,8 @@ | |
14161 | #endif | |
14162 | ||
14163 | /* Rate for the 1.8432 Mhz clock for the onboard serial chip */ | |
14164 | -#define BASE_BAUD ( 1843200 / 16 ) | |
14165 | +#define BASE_BAUD ( 1843200 / 16 ) | |
14166 | +#define UART_CLK 1843200 | |
14167 | ||
14168 | #ifdef CONFIG_SERIAL_DETECT_IRQ | |
14169 | #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ) | |
14170 | diff -Nru a/arch/ppc/platforms/mcpn765_setup.c b/arch/ppc/platforms/mcpn765_setup.c | |
14171 | --- a/arch/ppc/platforms/mcpn765_setup.c Wed Apr 23 00:49:34 2003 | |
14172 | +++ b/arch/ppc/platforms/mcpn765_setup.c Mon Jul 21 09:05:22 2003 | |
14173 | @@ -31,6 +31,9 @@ | |
14174 | #include <linux/ide.h> | |
14175 | #include <linux/seq_file.h> | |
14176 | #include <linux/root_dev.h> | |
14177 | +#include <linux/serial.h> | |
14178 | +#include <linux/tty.h> /* for linux/serial_core.h */ | |
14179 | +#include <linux/serial_core.h> | |
14180 | ||
14181 | #include <asm/system.h> | |
14182 | #include <asm/pgtable.h> | |
14183 | @@ -49,36 +52,94 @@ | |
14184 | #include <asm/pplus.h> | |
14185 | ||
14186 | #include "mcpn765.h" | |
14187 | +#include "mcpn765_serial.h" | |
14188 | + | |
14189 | ||
14190 | static u_char mcpn765_openpic_initsenses[] __initdata = { | |
14191 | - 0, /* 16: i8259 cascade (active high) */ | |
14192 | - 1, /* 17: COM1,2,3,4 */ | |
14193 | - 1, /* 18: Enet 1 (front panel) */ | |
14194 | - 1, /* 19: HAWK WDT XXXX */ | |
14195 | - 1, /* 20: 21554 PCI-PCI bridge */ | |
14196 | - 1, /* 21: cPCI INTA# */ | |
14197 | - 1, /* 22: cPCI INTB# */ | |
14198 | - 1, /* 23: cPCI INTC# */ | |
14199 | - 1, /* 24: cPCI INTD# */ | |
14200 | - 1, /* 25: PMC1 INTA#, PMC2 INTB# */ | |
14201 | - 1, /* 26: PMC1 INTB#, PMC2 INTC# */ | |
14202 | - 1, /* 27: PMC1 INTC#, PMC2 INTD# */ | |
14203 | - 1, /* 28: PMC1 INTD#, PMC2 INTA# */ | |
14204 | - 1, /* 29: Enet 2 (connected to J3) */ | |
14205 | - 1, /* 30: Abort Switch */ | |
14206 | - 1, /* 31: RTC Alarm */ | |
14207 | + (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE),/* 16: i8259 cascade */ | |
14208 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 17: COM1,2,3,4 */ | |
14209 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 18: Enet 1 (front) */ | |
14210 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 19: HAWK WDT XXXX */ | |
14211 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 20: 21554 bridge */ | |
14212 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 21: cPCI INTA# */ | |
14213 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 22: cPCI INTB# */ | |
14214 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 23: cPCI INTC# */ | |
14215 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 24: cPCI INTD# */ | |
14216 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 25: PMC1 INTA#,PMC2 INTB#*/ | |
14217 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 26: PMC1 INTB#,PMC2 INTC#*/ | |
14218 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 27: PMC1 INTC#,PMC2 INTD#*/ | |
14219 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 28: PMC1 INTD#,PMC2 INTA#*/ | |
14220 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 29: Enet 2 (J3) */ | |
14221 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 30: Abort Switch */ | |
14222 | + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 31: RTC Alarm */ | |
14223 | }; | |
14224 | ||
14225 | ||
14226 | extern u_int openpic_irq(void); | |
14227 | extern char cmd_line[]; | |
14228 | ||
14229 | +extern void gen550_progress(char *, unsigned short); | |
14230 | +extern void gen550_init(int, struct uart_port *); | |
14231 | + | |
14232 | int use_of_interrupt_tree = 0; | |
14233 | ||
14234 | static void mcpn765_halt(void); | |
14235 | ||
14236 | TODC_ALLOC(); | |
14237 | ||
14238 | +#if defined(CONFIG_SERIAL_8250) && \ | |
14239 | + (defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG)) | |
14240 | +static void __init | |
14241 | +mcpn765_early_serial_map(void) | |
14242 | +{ | |
14243 | + struct uart_port serial_req; | |
14244 | + | |
14245 | + /* Setup serial port access */ | |
14246 | + memset(&serial_req, 0, sizeof(serial_req)); | |
14247 | + serial_req.uartclk = UART_CLK; | |
14248 | + serial_req.irq = 17; | |
14249 | + serial_req.flags = STD_COM_FLAGS; | |
14250 | + serial_req.iotype = SERIAL_IO_MEM; | |
14251 | + serial_req.membase = (u_char *)MCPN765_SERIAL_1; | |
14252 | + serial_req.regshift = 4; | |
14253 | + | |
14254 | + gen550_init(0, &serial_req); | |
14255 | + | |
14256 | + if (early_serial_setup(&serial_req) != 0) | |
14257 | + printk(KERN_ERR "Early serial init of port 0 failed\n"); | |
14258 | + | |
14259 | + /* Assume early_serial_setup() doesn't modify serial_req */ | |
14260 | + serial_req.line = 1; | |
14261 | + serial_req.irq = 17; | |
14262 | + serial_req.membase = (u_char *)MCPN765_SERIAL_2; | |
14263 | + | |
14264 | + gen550_init(1, &serial_req); | |
14265 | + | |
14266 | + if (early_serial_setup(&serial_req) != 0) | |
14267 | + printk(KERN_ERR "Early serial init of port 1 failed\n"); | |
14268 | + | |
14269 | + /* Assume early_serial_setup() doesn't modify serial_req */ | |
14270 | + serial_req.line = 2; | |
14271 | + serial_req.irq = 17; | |
14272 | + serial_req.membase = (u_char *)MCPN765_SERIAL_3; | |
14273 | + | |
14274 | + gen550_init(2, &serial_req); | |
14275 | + | |
14276 | + if (early_serial_setup(&serial_req) != 0) | |
14277 | + printk(KERN_ERR "Early serial init of port 2 failed\n"); | |
14278 | + | |
14279 | + /* Assume early_serial_setup() doesn't modify serial_req */ | |
14280 | + serial_req.line = 3; | |
14281 | + serial_req.irq = 17; | |
14282 | + serial_req.membase = (u_char *)MCPN765_SERIAL_4; | |
14283 | + | |
14284 | + gen550_init(3, &serial_req); | |
14285 | + | |
14286 | + if (early_serial_setup(&serial_req) != 0) | |
14287 | + printk(KERN_ERR "Early serial init of port 3 failed\n"); | |
14288 | +} | |
14289 | +#endif | |
14290 | + | |
14291 | static void __init | |
14292 | mcpn765_setup_arch(void) | |
14293 | { | |
14294 | @@ -187,12 +248,12 @@ | |
14295 | if ( ppc_md.progress ) | |
14296 | ppc_md.progress("init_irq: enter", 0); | |
14297 | ||
14298 | - openpic_init(1, NUM_8259_INTERRUPTS, NULL, -1); | |
14299 | + openpic_init(NUM_8259_INTERRUPTS); | |
14300 | ||
14301 | for(i=0; i < NUM_8259_INTERRUPTS; i++) | |
14302 | irq_desc[i].handler = &i8259_pic; | |
14303 | ||
14304 | - i8259_init(NULL); | |
14305 | + i8259_init(0); | |
14306 | ||
14307 | if ( ppc_md.progress ) | |
14308 | ppc_md.progress("init_irq: exit", 0); | |
14309 | @@ -361,65 +422,15 @@ | |
14310 | static __inline__ void | |
14311 | mcpn765_set_bat(void) | |
14312 | { | |
14313 | - unsigned long bat3u, bat3l; | |
14314 | - static int mapping_set = 0; | |
14315 | - | |
14316 | - if (!mapping_set) { | |
14317 | - | |
14318 | - __asm__ __volatile__( | |
14319 | - " lis %0,0xf000\n \ | |
14320 | - ori %1,%0,0x002a\n \ | |
14321 | - ori %0,%0,0x1ffe\n \ | |
14322 | - mtspr 0x21e,%0\n \ | |
14323 | - mtspr 0x21f,%1\n \ | |
14324 | - isync\n \ | |
14325 | - sync " | |
14326 | - : "=r" (bat3u), "=r" (bat3l)); | |
14327 | - | |
14328 | - mapping_set = 1; | |
14329 | - } | |
14330 | - | |
14331 | - return; | |
14332 | -} | |
14333 | - | |
14334 | -#ifdef CONFIG_SERIAL_TEXT_DEBUG | |
14335 | -#include <linux/serialP.h> | |
14336 | -#include <linux/serial_reg.h> | |
14337 | -#include <asm/serial.h> | |
14338 | - | |
14339 | -static struct serial_state rs_table[RS_TABLE_SIZE] = { | |
14340 | - SERIAL_PORT_DFNS /* Defined in <asm/serial.h> */ | |
14341 | -}; | |
14342 | - | |
14343 | -static void | |
14344 | -mcpn765_progress(char *s, unsigned short hex) | |
14345 | -{ | |
14346 | - volatile char c; | |
14347 | - volatile unsigned long com_port; | |
14348 | - u16 shift; | |
14349 | - | |
14350 | - com_port = rs_table[0].port; | |
14351 | - shift = rs_table[0].iomem_reg_shift; | |
14352 | - | |
14353 | - while ((c = *s++) != 0) { | |
14354 | - while ((*((volatile unsigned char *)com_port + | |
14355 | - (UART_LSR << shift)) & UART_LSR_THRE) == 0) | |
14356 | - ; | |
14357 | - *(volatile unsigned char *)com_port = c; | |
14358 | - | |
14359 | - if (c == '\n') { | |
14360 | - while ((*((volatile unsigned char *)com_port + | |
14361 | - (UART_LSR << shift)) & UART_LSR_THRE) == 0) | |
14362 | - ; | |
14363 | - *(volatile unsigned char *)com_port = '\r'; | |
14364 | - } | |
14365 | - } | |
14366 | + mb(); | |
14367 | + mtspr(DBAT1U, 0xfe8000fe); | |
14368 | + mtspr(DBAT1L, 0xfe80002a); | |
14369 | + mb(); | |
14370 | } | |
14371 | -#endif /* CONFIG_SERIAL_TEXT_DEBUG */ | |
14372 | ||
14373 | void __init | |
14374 | platform_init(unsigned long r3, unsigned long r4, unsigned long r5, | |
14375 | - unsigned long r6, unsigned long r7) | |
14376 | + unsigned long r6, unsigned long r7) | |
14377 | { | |
14378 | parse_bootinfo(find_bootinfo()); | |
14379 | ||
14380 | @@ -458,11 +469,13 @@ | |
14381 | ppc_md.heartbeat_reset = 0; | |
14382 | ppc_md.heartbeat_count = 0; | |
14383 | ||
14384 | -#ifdef CONFIG_SERIAL_TEXT_DEBUG | |
14385 | - ppc_md.progress = mcpn765_progress; | |
14386 | -#else /* !CONFIG_SERIAL_TEXT_DEBUG */ | |
14387 | - ppc_md.progress = NULL; | |
14388 | -#endif /* CONFIG_SERIAL_TEXT_DEBUG */ | |
14389 | +#if defined(CONFIG_SERIAL_8250) && \ | |
14390 | + (defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG)) | |
14391 | + mcpn765_early_serial_map(); | |
14392 | +#ifdef CONFIG_SERIAL_TEXT_DEBUG | |
14393 | + ppc_md.progress = gen550_progress; | |
14394 | +#endif | |
14395 | +#endif | |
14396 | ||
14397 | #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) | |
14398 | ppc_ide_md.default_irq = mcpn765_ide_default_irq; | |
14399 | diff -Nru a/arch/ppc/platforms/pmac_cpufreq.c b/arch/ppc/platforms/pmac_cpufreq.c | |
14400 | --- a/arch/ppc/platforms/pmac_cpufreq.c Wed Jul 23 17:04:23 2003 | |
14401 | +++ b/arch/ppc/platforms/pmac_cpufreq.c Mon Aug 25 09:51:43 2003 | |
14402 | @@ -21,6 +21,7 @@ | |
14403 | #include <linux/slab.h> | |
14404 | #include <linux/cpufreq.h> | |
14405 | #include <linux/init.h> | |
14406 | +#include <linux/sysdev.h> | |
14407 | #include <asm/prom.h> | |
14408 | #include <asm/machdep.h> | |
14409 | #include <asm/irq.h> | |
14410 | @@ -31,12 +32,16 @@ | |
14411 | #include <asm/cputable.h> | |
14412 | #include <asm/time.h> | |
14413 | ||
14414 | +/* WARNING !!! This will cause calibrate_delay() to be called, | |
14415 | + * but this is an __init function ! So you MUST go edit | |
14416 | + * init/main.c to make it non-init before enabling DEBUG_FREQ | |
14417 | + */ | |
14418 | #undef DEBUG_FREQ | |
14419 | ||
14420 | extern void low_choose_750fx_pll(int pll); | |
14421 | extern void low_sleep_handler(void); | |
14422 | -extern void openpic_sleep_save_intrs(void); | |
14423 | -extern void openpic_sleep_restore_intrs(void); | |
14424 | +extern void openpic_suspend(struct sys_device *sysdev, u32 state); | |
14425 | +extern void openpic_resume(struct sys_device *sysdev); | |
14426 | extern void enable_kernel_altivec(void); | |
14427 | extern void enable_kernel_fp(void); | |
14428 | ||
14429 | @@ -116,10 +121,7 @@ | |
14430 | printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1)); | |
14431 | #endif | |
14432 | /* Disable all interrupt sources on openpic */ | |
14433 | - openpic_sleep_save_intrs(); | |
14434 | - | |
14435 | - /* Make sure the PMU is idle */ | |
14436 | - pmu_suspend(); | |
14437 | + openpic_suspend(NULL, 1); | |
14438 | ||
14439 | /* Make sure the decrementer won't interrupt us */ | |
14440 | asm volatile("mtdec %0" : : "r" (0x7fffffff)); | |
14441 | @@ -153,11 +155,16 @@ | |
14442 | pmu_request(&req, NULL, 6, PMU_CPU_SPEED, 'W', 'O', 'O', 'F', low_speed); | |
14443 | while (!req.complete) | |
14444 | pmu_poll(); | |
14445 | - | |
14446 | - pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,1,1); | |
14447 | ||
14448 | + /* Prepare the northbridge for the speed transition */ | |
14449 | + pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,1,1); | |
14450 | + | |
14451 | + /* Call low level code to backup CPU state and recover from | |
14452 | + * hardware reset | |
14453 | + */ | |
14454 | low_sleep_handler(); | |
14455 | ||
14456 | + /* Restore the northbridge */ | |
14457 | pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,1,0); | |
14458 | ||
14459 | /* Restore L2 cache */ | |
14460 | @@ -174,13 +181,14 @@ | |
14461 | printk(KERN_DEBUG "HID1, after: %x\n", mfspr(SPRN_HID1)); | |
14462 | #endif | |
14463 | ||
14464 | + /* Restore low level PMU operations */ | |
14465 | + pmu_unlock(); | |
14466 | + | |
14467 | /* Restore decrementer */ | |
14468 | wakeup_decrementer(); | |
14469 | ||
14470 | /* Restore interrupts */ | |
14471 | - openpic_sleep_restore_intrs(); | |
14472 | - | |
14473 | - pmu_resume(); | |
14474 | + openpic_resume(NULL); | |
14475 | ||
14476 | /* Let interrupts flow again ... */ | |
14477 | local_irq_enable(); | |
14478 | @@ -195,13 +203,16 @@ | |
14479 | static int __pmac | |
14480 | do_set_cpu_speed(int speed_mode) | |
14481 | { | |
14482 | - struct cpufreq_freqs freqs; | |
14483 | + struct cpufreq_freqs freqs; | |
14484 | int rc; | |
14485 | ||
14486 | freqs.old = cur_freq; | |
14487 | freqs.new = (speed_mode == PMAC_CPU_HIGH_SPEED) ? hi_freq : low_freq; | |
14488 | freqs.cpu = smp_processor_id(); | |
14489 | ||
14490 | + if (freqs.old == freqs.new) | |
14491 | + return 0; | |
14492 | + | |
14493 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); | |
14494 | if (cpufreq_uses_pmu) | |
14495 | rc = pmu_set_cpu_speed(speed_mode); | |
14496 | @@ -275,7 +286,10 @@ | |
14497 | struct device_node *cpunode; | |
14498 | u32 *value; | |
14499 | int has_freq_ctl = 0; | |
14500 | - | |
14501 | + | |
14502 | + if (strstr(cmd_line, "nocpufreq")) | |
14503 | + return 0; | |
14504 | + | |
14505 | /* Assume only one CPU */ | |
14506 | cpunode = find_type_devices("cpu"); | |
14507 | if (!cpunode) | |
14508 | diff -Nru a/arch/ppc/platforms/pmac_pic.c b/arch/ppc/platforms/pmac_pic.c | |
14509 | --- a/arch/ppc/platforms/pmac_pic.c Wed Apr 30 05:41:43 2003 | |
14510 | +++ b/arch/ppc/platforms/pmac_pic.c Sun Aug 24 04:12:57 2003 | |
14511 | @@ -22,6 +22,9 @@ | |
14512 | #include <linux/signal.h> | |
14513 | #include <linux/pci.h> | |
14514 | #include <linux/interrupt.h> | |
14515 | +#include <linux/sysdev.h> | |
14516 | +#include <linux/adb.h> | |
14517 | +#include <linux/pmu.h> | |
14518 | ||
14519 | #include <asm/sections.h> | |
14520 | #include <asm/io.h> | |
14521 | @@ -506,7 +509,7 @@ | |
14522 | #endif /* CONFIG_XMON */ | |
14523 | } | |
14524 | ||
14525 | -#ifdef CONFIG_PMAC_PBOOK | |
14526 | +#ifdef CONFIG_PM | |
14527 | /* | |
14528 | * These procedures are used in implementing sleep on the powerbooks. | |
14529 | * sleep_save_intrs() saves the states of all interrupt enables | |
14530 | @@ -515,9 +518,32 @@ | |
14531 | */ | |
14532 | unsigned long sleep_save_mask[2]; | |
14533 | ||
14534 | -void __pmac | |
14535 | -pmac_sleep_save_intrs(int viaint) | |
14536 | +/* This used to be passed by the PMU driver but that link got | |
14537 | + * broken with the new driver model. We use this tweak for now... | |
14538 | + */ | |
14539 | +static int pmacpic_find_viaint(void) | |
14540 | { | |
14541 | + int viaint = -1; | |
14542 | + | |
14543 | +#ifdef CONFIG_ADB_PMU | |
14544 | + struct device_node *np; | |
14545 | + | |
14546 | + if (pmu_get_model() != PMU_OHARE_BASED) | |
14547 | + goto not_found; | |
14548 | + np = of_find_node_by_name(NULL, "via-pmu"); | |
14549 | + if (np == NULL) | |
14550 | + goto not_found; | |
14551 | + viaint = np->intrs[0].line; | |
14552 | +#endif /* CONFIG_ADB_PMU */ | |
14553 | + | |
14554 | +not_found: | |
14555 | + return viaint; | |
14556 | +} | |
14557 | + | |
14558 | +static int pmacpic_suspend(struct sys_device *sysdev, u32 state) | |
14559 | +{ | |
14560 | + int viaint = pmacpic_find_viaint(); | |
14561 | + | |
14562 | sleep_save_mask[0] = ppc_cached_irq_mask[0]; | |
14563 | sleep_save_mask[1] = ppc_cached_irq_mask[1]; | |
14564 | ppc_cached_irq_mask[0] = 0; | |
14565 | @@ -531,10 +557,11 @@ | |
14566 | /* make sure mask gets to controller before we return to caller */ | |
14567 | mb(); | |
14568 | (void)in_le32(&pmac_irq_hw[0]->enable); | |
14569 | + | |
14570 | + return 0; | |
14571 | } | |
14572 | ||
14573 | -void __pmac | |
14574 | -pmac_sleep_restore_intrs(void) | |
14575 | +static int pmacpic_resume(struct sys_device *sysdev) | |
14576 | { | |
14577 | int i; | |
14578 | ||
14579 | @@ -545,5 +572,39 @@ | |
14580 | for (i = 0; i < max_real_irqs; ++i) | |
14581 | if (test_bit(i, sleep_save_mask)) | |
14582 | pmac_unmask_irq(i); | |
14583 | + | |
14584 | + return 0; | |
14585 | } | |
14586 | -#endif /* CONFIG_PMAC_PBOOK */ | |
14587 | + | |
14588 | +#endif /* CONFIG_PM */ | |
14589 | + | |
14590 | +static struct sysdev_class pmacpic_sysclass = { | |
14591 | + set_kset_name("pmac_pic"), | |
14592 | +}; | |
14593 | + | |
14594 | +static struct sys_device device_pmacpic = { | |
14595 | + .id = 0, | |
14596 | + .cls = &pmacpic_sysclass, | |
14597 | +}; | |
14598 | + | |
14599 | +static struct sysdev_driver driver_pmacpic = { | |
14600 | +#ifdef CONFIG_PM | |
14601 | + .suspend = &pmacpic_suspend, | |
14602 | + .resume = &pmacpic_resume, | |
14603 | +#endif /* CONFIG_PM */ | |
14604 | +}; | |
14605 | + | |
14606 | +static int __init init_pmacpic_sysfs(void) | |
14607 | +{ | |
14608 | + if (max_irqs == 0) | |
14609 | + return -ENODEV; | |
14610 | + | |
14611 | + printk(KERN_DEBUG "Registering pmac pic with sysfs...\n"); | |
14612 | + sysdev_class_register(&pmacpic_sysclass); | |
14613 | + sys_device_register(&device_pmacpic); | |
14614 | + sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic); | |
14615 | + return 0; | |
14616 | +} | |
14617 | + | |
14618 | +subsys_initcall(init_pmacpic_sysfs); | |
14619 | + | |
14620 | diff -Nru a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c | |
14621 | --- a/arch/ppc/platforms/sandpoint.c Tue Jul 1 10:56:46 2003 | |
14622 | +++ b/arch/ppc/platforms/sandpoint.c Thu Aug 21 10:19:10 2003 | |
14623 | @@ -357,6 +357,21 @@ | |
14624 | } | |
14625 | ||
14626 | /* | |
14627 | + * Fix IDE interrupts. | |
14628 | + */ | |
14629 | +static int __init | |
14630 | +sandpoint_fix_winbond_83553(void) | |
14631 | +{ | |
14632 | + /* Make all 8259 interrupt level sensitive */ | |
14633 | + outb(0xf8, 0x4d0); | |
14634 | + outb(0xde, 0x4d1); | |
14635 | + | |
14636 | + return 0; | |
14637 | +} | |
14638 | + | |
14639 | +arch_initcall(sandpoint_fix_winbond_83553); | |
14640 | + | |
14641 | +/* | |
14642 | * Initialize the ISA devices on the Nat'l PC87308VUL SuperIO chip. | |
14643 | */ | |
14644 | static int __init | |
14645 | @@ -390,21 +405,6 @@ | |
14646 | } | |
14647 | ||
14648 | arch_initcall(sandpoint_setup_natl_87308); | |
14649 | - | |
14650 | -/* | |
14651 | - * Fix IDE interrupts. | |
14652 | - */ | |
14653 | -static int __init | |
14654 | -sandpoint_fix_winbond_83553(void) | |
14655 | -{ | |
14656 | - /* Make all 8259 interrupt level sensitive */ | |
14657 | - outb(0xf8, 0x4d0); | |
14658 | - outb(0xde, 0x4d1); | |
14659 | - | |
14660 | - return 0; | |
14661 | -} | |
14662 | - | |
14663 | -arch_initcall(sandpoint_fix_winbond_83553); | |
14664 | ||
14665 | static int __init | |
14666 | sandpoint_request_io(void) | |
14667 | diff -Nru a/arch/ppc/platforms/sandpoint.h b/arch/ppc/platforms/sandpoint.h | |
14668 | --- a/arch/ppc/platforms/sandpoint.h Tue Jul 1 10:56:46 2003 | |
14669 | +++ b/arch/ppc/platforms/sandpoint.h Thu Aug 21 10:19:10 2003 | |
14670 | @@ -61,9 +61,9 @@ | |
14671 | #define UART_CLK 1843200 | |
14672 | ||
14673 | #ifdef CONFIG_SERIAL_DETECT_IRQ | |
14674 | -#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ) | |
14675 | +#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_AUTO_IRQ) | |
14676 | #else | |
14677 | -#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST) | |
14678 | +#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF) | |
14679 | #endif | |
14680 | ||
14681 | #define STD_SERIAL_PORT_DFNS \ | |
14682 | diff -Nru a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile | |
14683 | --- a/arch/ppc/syslib/Makefile Sat Aug 9 09:39:19 2003 | |
14684 | +++ b/arch/ppc/syslib/Makefile Wed Sep 3 05:16:34 2003 | |
14685 | @@ -13,6 +13,8 @@ | |
14686 | CFLAGS_btext.o += -mrelocatable-lib | |
14687 | ||
14688 | obj-$(CONFIG_PPCBUG_NVRAM) += prep_nvram.o | |
14689 | +obj-$(CONFIG_44x) += ibm44x_common.o | |
14690 | +obj-$(CONFIG_440GP) += ibm440gp_common.o | |
14691 | ifeq ($(CONFIG_4xx),y) | |
14692 | obj-$(CONFIG_4xx) += ppc4xx_pic.o | |
14693 | obj-$(CONFIG_40x) += ppc4xx_setup.o | |
14694 | @@ -33,6 +35,7 @@ | |
14695 | obj-$(CONFIG_PPC_PREP) += open_pic.o indirect_pci.o i8259.o | |
14696 | obj-$(CONFIG_ADIR) += i8259.o indirect_pci.o pci_auto.o \ | |
14697 | todc_time.o | |
14698 | +obj-$(CONFIG_EBONY) += indirect_pci.o pci_auto.o todc_time.o | |
14699 | obj-$(CONFIG_EV64260) += gt64260_common.o gt64260_pic.o \ | |
14700 | indirect_pci.o todc_time.o pci_auto.o | |
14701 | obj-$(CONFIG_GEMINI) += open_pic.o i8259.o indirect_pci.o | |
14702 | @@ -46,6 +49,7 @@ | |
14703 | pci_auto.o indirect_pci.o | |
14704 | obj-$(CONFIG_MVME5100) += open_pic.o todc_time.o indirect_pci.o \ | |
14705 | i8259.o pci_auto.o pplus_common.o | |
14706 | +obj-$(CONFIG_OCOTEA) += indirect_pci.o pci_auto.o todc_time.o | |
14707 | obj-$(CONFIG_PAL4) += cpc700_pic.o | |
14708 | obj-$(CONFIG_PCORE) += mpc10x_common.o todc_time.o i8259.o \ | |
14709 | indirect_pci.o pci_auto.o | |
14710 | diff -Nru a/arch/ppc/syslib/ibm440gp_common.c b/arch/ppc/syslib/ibm440gp_common.c | |
14711 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
14712 | +++ b/arch/ppc/syslib/ibm440gp_common.c Wed Sep 3 02:15:08 2003 | |
14713 | @@ -0,0 +1,77 @@ | |
14714 | +/* | |
14715 | + * arch/ppc/syslib/ibm440gp_common.c | |
14716 | + * | |
14717 | + * PPC440GP system library | |
14718 | + * | |
14719 | + * Matt Porter <mporter@mvista.com> | |
14720 | + * Copyright 2002-2003 MontaVista Software Inc. | |
14721 | + * | |
14722 | + * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> | |
14723 | + * Copyright (c) 2003 Zultys Technologies | |
14724 | + * | |
14725 | + * This program is free software; you can redistribute it and/or modify it | |
14726 | + * under the terms of the GNU General Public License as published by the | |
14727 | + * Free Software Foundation; either version 2 of the License, or (at your | |
14728 | + * option) any later version. | |
14729 | + * | |
14730 | + */ | |
14731 | +#include <linux/config.h> | |
14732 | +#include <linux/types.h> | |
14733 | +#include <asm/ibm44x.h> | |
14734 | +#include <asm/mmu.h> | |
14735 | + | |
14736 | +/* | |
14737 | + * Calculate 440GP clocks | |
14738 | + */ | |
14739 | +void __init ibm440gp_get_clocks(struct ibm440gp_clocks* p, | |
14740 | + unsigned int sys_clk, | |
14741 | + unsigned int ser_clk) | |
14742 | +{ | |
14743 | + u32 cpc0_sys0 = mfdcr(DCRN_CPC0_SYS0); | |
14744 | + u32 cpc0_cr0 = mfdcr(DCRN_CPC0_CR0); | |
14745 | + u32 opdv, epdv; | |
14746 | + | |
14747 | + if (cpc0_sys0 & 0x2){ | |
14748 | + /* Bypass system PLL */ | |
14749 | + p->cpu = p->plb = sys_clk; | |
14750 | + } | |
14751 | + else { | |
14752 | + u32 fbdv, fwdva, fwdvb, m, vco; | |
14753 | + | |
14754 | + fbdv = (cpc0_sys0 >> 18) & 0x0f; | |
14755 | + if (!fbdv) | |
14756 | + fbdv = 16; | |
14757 | + | |
14758 | + fwdva = 8 - ((cpc0_sys0 >> 15) & 0x7); | |
14759 | + fwdvb = 8 - ((cpc0_sys0 >> 12) & 0x7); | |
14760 | + | |
14761 | + /* Feedback path */ | |
14762 | + if (cpc0_sys0 & 0x00000080){ | |
14763 | + /* PerClk */ | |
14764 | + m = fwdvb * opdv * epdv; | |
14765 | + } | |
14766 | + else { | |
14767 | + /* CPU clock */ | |
14768 | + m = fbdv * fwdva; | |
14769 | + } | |
14770 | + vco = sys_clk * m; | |
14771 | + p->cpu = vco / fwdva; | |
14772 | + p->plb = vco / fwdvb; | |
14773 | + } | |
14774 | + | |
14775 | + opdv = ((cpc0_sys0 >> 10) & 0x3) + 1; | |
14776 | + epdv = ((cpc0_sys0 >> 8) & 0x3) + 1; | |
14777 | + | |
14778 | + p->opb = p->plb / opdv; | |
14779 | + p->ebc = p->opb / epdv; | |
14780 | + | |
14781 | + if (cpc0_cr0 & 0x00400000){ | |
14782 | + /* External UART clock */ | |
14783 | + p->uart = ser_clk; | |
14784 | + } | |
14785 | + else { | |
14786 | + /* Internal UART clock */ | |
14787 | + u32 uart_div = ((cpc0_cr0 >> 16) & 0x1f) + 1; | |
14788 | + p->uart = p->plb / uart_div; | |
14789 | + } | |
14790 | +} | |
14791 | diff -Nru a/arch/ppc/syslib/ibm440gp_common.h b/arch/ppc/syslib/ibm440gp_common.h | |
14792 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
14793 | +++ b/arch/ppc/syslib/ibm440gp_common.h Wed Sep 3 02:15:09 2003 | |
14794 | @@ -0,0 +1,45 @@ | |
14795 | +/* | |
14796 | + * arch/ppc/syslib/ibm440gp_common.h | |
14797 | + * | |
14798 | + * PPC440GP system library | |
14799 | + * | |
14800 | + * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> | |
14801 | + * Copyright (c) 2003 Zultys Technologies | |
14802 | + * | |
14803 | + * This program is free software; you can redistribute it and/or modify it | |
14804 | + * under the terms of the GNU General Public License as published by the | |
14805 | + * Free Software Foundation; either version 2 of the License, or (at your | |
14806 | + * option) any later version. | |
14807 | + * | |
14808 | + */ | |
14809 | +#ifdef __KERNEL__ | |
14810 | +#ifndef __PPC_SYSLIB_IBM440GP_COMMON_H | |
14811 | +#define __PPC_SYSLIB_IBM440GP_COMMON_H | |
14812 | + | |
14813 | +#ifndef __ASSEMBLY__ | |
14814 | + | |
14815 | +#include <linux/config.h> | |
14816 | +#include <linux/init.h> | |
14817 | + | |
14818 | +/* | |
14819 | + * All clocks are in Hz | |
14820 | + */ | |
14821 | +struct ibm440gp_clocks { | |
14822 | + unsigned int cpu; /* CPUCoreClk */ | |
14823 | + unsigned int plb; /* PLBClk */ | |
14824 | + unsigned int opb; /* OPBClk */ | |
14825 | + unsigned int ebc; /* PerClk */ | |
14826 | + unsigned int uart; | |
14827 | +}; | |
14828 | + | |
14829 | +/* | |
14830 | + * Please, refer to the Figure 13.1 in 440GP user manual | |
14831 | + * | |
14832 | + * if internal UART clock is used, ser_clk is ignored | |
14833 | + */ | |
14834 | +void ibm440gp_get_clocks(struct ibm440gp_clocks*, unsigned int sys_clk, | |
14835 | + unsigned int ser_clk) __init; | |
14836 | + | |
14837 | +#endif /* __ASSEMBLY__ */ | |
14838 | +#endif /* __PPC_SYSLIB_IBM440GP_COMMON_H */ | |
14839 | +#endif /* __KERNEL__ */ | |
14840 | diff -Nru a/arch/ppc/syslib/ibm44x_common.c b/arch/ppc/syslib/ibm44x_common.c | |
14841 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
14842 | +++ b/arch/ppc/syslib/ibm44x_common.c Wed Sep 3 02:15:10 2003 | |
14843 | @@ -0,0 +1,37 @@ | |
14844 | +/* | |
14845 | + * arch/ppc/syslib/ibm44x_common.c | |
14846 | + * | |
14847 | + * PPC44x system library | |
14848 | + * | |
14849 | + * Matt Porter <mporter@mvista.com> | |
14850 | + * Copyright 2002-2003 MontaVista Software Inc. | |
14851 | + * | |
14852 | + * This program is free software; you can redistribute it and/or modify it | |
14853 | + * under the terms of the GNU General Public License as published by the | |
14854 | + * Free Software Foundation; either version 2 of the License, or (at your | |
14855 | + * option) any later version. | |
14856 | + * | |
14857 | + */ | |
14858 | +#include <linux/config.h> | |
14859 | +#include <linux/types.h> | |
14860 | +#include <asm/ibm44x.h> | |
14861 | +#include <asm/mmu.h> | |
14862 | + | |
14863 | +phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size) | |
14864 | +{ | |
14865 | + phys_addr_t page_4gb = 0; | |
14866 | + | |
14867 | + /* | |
14868 | + * Trap the least significant 32-bit portions of an | |
14869 | + * address in the 440's 36-bit address space. Fix | |
14870 | + * them up with the appropriate ERPN | |
14871 | + */ | |
14872 | + if ((addr >= PPC44x_IO_LO) && (addr < PPC44x_IO_HI)) | |
14873 | + page_4gb = PPC44x_IO_PAGE; | |
14874 | + else if ((addr >= PPC44x_PCICFG_LO) && (addr < PPC44x_PCICFG_HI)) | |
14875 | + page_4gb = PPC44x_PCICFG_PAGE; | |
14876 | + else if ((addr >= PPC44x_PCIMEM_LO) && (addr < PPC44x_PCIMEM_HI)) | |
14877 | + page_4gb = PPC44x_PCIMEM_PAGE; | |
14878 | + | |
14879 | + return (page_4gb | addr); | |
14880 | +}; | |
14881 | diff -Nru a/arch/ppc/syslib/of_device.c b/arch/ppc/syslib/of_device.c | |
14882 | --- a/arch/ppc/syslib/of_device.c Sat Aug 16 11:48:20 2003 | |
14883 | +++ b/arch/ppc/syslib/of_device.c Tue Aug 26 06:35:38 2003 | |
14884 | @@ -15,8 +15,8 @@ | |
14885 | * Used by a driver to check whether an of_device present in the | |
14886 | * system is in its list of supported devices. | |
14887 | */ | |
14888 | -const struct of_match * | |
14889 | -of_match_device(const struct of_match *matches, const struct of_device *dev) | |
14890 | +const struct of_match * of_match_device(const struct of_match *matches, | |
14891 | + const struct of_device *dev) | |
14892 | { | |
14893 | if (!dev->node) | |
14894 | return NULL; | |
14895 | @@ -38,8 +38,7 @@ | |
14896 | return NULL; | |
14897 | } | |
14898 | ||
14899 | -static int | |
14900 | -of_platform_bus_match(struct device *dev, struct device_driver *drv) | |
14901 | +static int of_platform_bus_match(struct device *dev, struct device_driver *drv) | |
14902 | { | |
14903 | struct of_device * of_dev = to_of_device(dev); | |
14904 | struct of_platform_driver * of_drv = to_of_platform_driver(drv); | |
14905 | @@ -51,21 +50,27 @@ | |
14906 | return of_match_device(matches, of_dev) != NULL; | |
14907 | } | |
14908 | ||
14909 | -struct bus_type of_platform_bus_type = { | |
14910 | - name: "of_platform", | |
14911 | - match: of_platform_bus_match, | |
14912 | -}; | |
14913 | +struct of_device *of_dev_get(struct of_device *dev) | |
14914 | +{ | |
14915 | + struct device *tmp; | |
14916 | + | |
14917 | + if (!dev) | |
14918 | + return NULL; | |
14919 | + tmp = get_device(&dev->dev); | |
14920 | + if (tmp) | |
14921 | + return to_of_device(tmp); | |
14922 | + else | |
14923 | + return NULL; | |
14924 | +} | |
14925 | ||
14926 | -static int __init | |
14927 | -of_bus_driver_init(void) | |
14928 | +void of_dev_put(struct of_device *dev) | |
14929 | { | |
14930 | - return bus_register(&of_platform_bus_type); | |
14931 | + if (dev) | |
14932 | + put_device(&dev->dev); | |
14933 | } | |
14934 | ||
14935 | -postcore_initcall(of_bus_driver_init); | |
14936 | ||
14937 | -static int | |
14938 | -of_device_probe(struct device *dev) | |
14939 | +static int of_device_probe(struct device *dev) | |
14940 | { | |
14941 | int error = -ENODEV; | |
14942 | struct of_platform_driver *drv; | |
14943 | @@ -78,22 +83,18 @@ | |
14944 | if (!drv->probe) | |
14945 | return error; | |
14946 | ||
14947 | -/* if (!try_module_get(driver->owner)) { | |
14948 | - printk(KERN_ERR "Can't get a module reference for %s\n", driver->name); | |
14949 | - return error; | |
14950 | - } | |
14951 | -*/ | |
14952 | + of_dev_get(of_dev); | |
14953 | + | |
14954 | match = of_match_device(drv->match_table, of_dev); | |
14955 | if (match) | |
14956 | error = drv->probe(of_dev, match); | |
14957 | -/* | |
14958 | - module_put(driver->owner); | |
14959 | -*/ | |
14960 | + if (error) | |
14961 | + of_dev_put(of_dev); | |
14962 | + | |
14963 | return error; | |
14964 | } | |
14965 | ||
14966 | -static int | |
14967 | -of_device_remove(struct device *dev) | |
14968 | +static int of_device_remove(struct device *dev) | |
14969 | { | |
14970 | struct of_device * of_dev = to_of_device(dev); | |
14971 | struct of_platform_driver * drv = to_of_platform_driver(of_dev->dev.driver); | |
14972 | @@ -103,32 +104,43 @@ | |
14973 | return 0; | |
14974 | } | |
14975 | ||
14976 | -static int | |
14977 | -of_device_suspend(struct device *dev, u32 state, u32 level) | |
14978 | +static int of_device_suspend(struct device *dev, u32 state) | |
14979 | { | |
14980 | struct of_device * of_dev = to_of_device(dev); | |
14981 | struct of_platform_driver * drv = to_of_platform_driver(of_dev->dev.driver); | |
14982 | int error = 0; | |
14983 | ||
14984 | if (drv && drv->suspend) | |
14985 | - error = drv->suspend(of_dev, state, level); | |
14986 | + error = drv->suspend(of_dev, state); | |
14987 | return error; | |
14988 | } | |
14989 | ||
14990 | -static int | |
14991 | -of_device_resume(struct device * dev, u32 level) | |
14992 | +static int of_device_resume(struct device * dev) | |
14993 | { | |
14994 | struct of_device * of_dev = to_of_device(dev); | |
14995 | struct of_platform_driver * drv = to_of_platform_driver(of_dev->dev.driver); | |
14996 | int error = 0; | |
14997 | ||
14998 | if (drv && drv->resume) | |
14999 | - error = drv->resume(of_dev, level); | |
15000 | + error = drv->resume(of_dev); | |
15001 | return error; | |
15002 | } | |
15003 | ||
15004 | -int | |
15005 | -of_register_driver(struct of_platform_driver *drv) | |
15006 | +struct bus_type of_platform_bus_type = { | |
15007 | + .name = "of_platform", | |
15008 | + .match = of_platform_bus_match, | |
15009 | + .suspend = of_device_suspend, | |
15010 | + .resume = of_device_resume, | |
15011 | +}; | |
15012 | + | |
15013 | +static int __init of_bus_driver_init(void) | |
15014 | +{ | |
15015 | + return bus_register(&of_platform_bus_type); | |
15016 | +} | |
15017 | + | |
15018 | +postcore_initcall(of_bus_driver_init); | |
15019 | + | |
15020 | +int of_register_driver(struct of_platform_driver *drv) | |
15021 | { | |
15022 | int count = 0; | |
15023 | ||
15024 | @@ -136,8 +148,6 @@ | |
15025 | drv->driver.name = drv->name; | |
15026 | drv->driver.bus = &of_platform_bus_type; | |
15027 | drv->driver.probe = of_device_probe; | |
15028 | - drv->driver.resume = of_device_resume; | |
15029 | - drv->driver.suspend = of_device_suspend; | |
15030 | drv->driver.remove = of_device_remove; | |
15031 | ||
15032 | /* register with core */ | |
15033 | @@ -145,15 +155,13 @@ | |
15034 | return count ? count : 1; | |
15035 | } | |
15036 | ||
15037 | -void | |
15038 | -of_unregister_driver(struct of_platform_driver *drv) | |
15039 | +void of_unregister_driver(struct of_platform_driver *drv) | |
15040 | { | |
15041 | driver_unregister(&drv->driver); | |
15042 | } | |
15043 | ||
15044 | ||
15045 | -static ssize_t | |
15046 | -dev_show_devspec(struct device *dev, char *buf) | |
15047 | +static ssize_t dev_show_devspec(struct device *dev, char *buf) | |
15048 | { | |
15049 | struct of_device *ofdev; | |
15050 | ||
15051 | @@ -163,8 +171,22 @@ | |
15052 | ||
15053 | static DEVICE_ATTR(devspec, S_IRUGO, dev_show_devspec, NULL); | |
15054 | ||
15055 | -int | |
15056 | -of_device_register(struct of_device *ofdev) | |
15057 | +/** | |
15058 | + * of_release_dev - free an of device structure when all users of it are finished. | |
15059 | + * @dev: device that's been disconnected | |
15060 | + * | |
15061 | + * Will be called only by the device core when all users of this of device are | |
15062 | + * done. | |
15063 | + */ | |
15064 | +void of_release_dev(struct device *dev) | |
15065 | +{ | |
15066 | + struct of_device *ofdev; | |
15067 | + | |
15068 | + ofdev = to_of_device(dev); | |
15069 | + kfree(ofdev); | |
15070 | +} | |
15071 | + | |
15072 | +int of_device_register(struct of_device *ofdev) | |
15073 | { | |
15074 | int rc; | |
15075 | struct of_device **odprop; | |
15076 | @@ -197,21 +219,20 @@ | |
15077 | return 0; | |
15078 | } | |
15079 | ||
15080 | -void | |
15081 | -of_device_unregister(struct of_device *ofdev) | |
15082 | +void of_device_unregister(struct of_device *ofdev) | |
15083 | { | |
15084 | struct of_device **odprop; | |
15085 | ||
15086 | device_remove_file(&ofdev->dev, &dev_attr_devspec); | |
15087 | - device_unregister(&ofdev->dev); | |
15088 | ||
15089 | odprop = (struct of_device **)get_property(ofdev->node, "linux,device", NULL); | |
15090 | if (odprop) | |
15091 | *odprop = NULL; | |
15092 | + | |
15093 | + device_unregister(&ofdev->dev); | |
15094 | } | |
15095 | ||
15096 | -struct of_device* | |
15097 | -of_platform_device_create(struct device_node *np, const char *bus_id) | |
15098 | +struct of_device* of_platform_device_create(struct device_node *np, const char *bus_id) | |
15099 | { | |
15100 | struct of_device *dev; | |
15101 | u32 *reg; | |
15102 | @@ -226,6 +247,7 @@ | |
15103 | dev->dev.dma_mask = &dev->dma_mask; | |
15104 | dev->dev.parent = NULL; | |
15105 | dev->dev.bus = &of_platform_bus_type; | |
15106 | + dev->dev.release = of_release_dev; | |
15107 | ||
15108 | reg = (u32 *)get_property(np, "reg", NULL); | |
15109 | strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE); | |
15110 | @@ -244,4 +266,7 @@ | |
15111 | EXPORT_SYMBOL(of_unregister_driver); | |
15112 | EXPORT_SYMBOL(of_device_register); | |
15113 | EXPORT_SYMBOL(of_device_unregister); | |
15114 | +EXPORT_SYMBOL(of_dev_get); | |
15115 | +EXPORT_SYMBOL(of_dev_put); | |
15116 | EXPORT_SYMBOL(of_platform_device_create); | |
15117 | +EXPORT_SYMBOL(of_release_dev); | |
15118 | diff -Nru a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c | |
15119 | --- a/arch/ppc/syslib/open_pic.c Tue Jul 15 10:01:29 2003 | |
15120 | +++ b/arch/ppc/syslib/open_pic.c Sun Aug 24 04:11:21 2003 | |
15121 | @@ -15,6 +15,7 @@ | |
15122 | #include <linux/init.h> | |
15123 | #include <linux/irq.h> | |
15124 | #include <linux/interrupt.h> | |
15125 | +#include <linux/sysdev.h> | |
15126 | #include <asm/ptrace.h> | |
15127 | #include <asm/signal.h> | |
15128 | #include <asm/io.h> | |
15129 | @@ -276,7 +277,7 @@ | |
15130 | } | |
15131 | #endif | |
15132 | ||
15133 | -#if defined(CONFIG_EPIC_SERIAL_MODE) || defined(CONFIG_PMAC_PBOOK) | |
15134 | +#if defined(CONFIG_EPIC_SERIAL_MODE) || defined(CONFIG_PM) | |
15135 | static void openpic_reset(void) | |
15136 | { | |
15137 | openpic_setfield(&OpenPIC->Global.Global_Configuration0, | |
15138 | @@ -532,7 +533,7 @@ | |
15139 | openpic_write(&OpenPIC->Global.Processor_Initialization, mask); | |
15140 | } | |
15141 | ||
15142 | -#if defined(CONFIG_SMP) || defined(CONFIG_PMAC_PBOOK) | |
15143 | +#if defined(CONFIG_SMP) || defined(CONFIG_PM) | |
15144 | static spinlock_t openpic_setup_lock = SPIN_LOCK_UNLOCKED; | |
15145 | #endif | |
15146 | ||
15147 | @@ -864,20 +865,55 @@ | |
15148 | } | |
15149 | #endif /* CONFIG_SMP */ | |
15150 | ||
15151 | -#ifdef CONFIG_PMAC_PBOOK | |
15152 | +#ifdef CONFIG_PM | |
15153 | + | |
15154 | +/* | |
15155 | + * We implement the IRQ controller as a sysdev and put it | |
15156 | + * to sleep at powerdown stage (the callback is named suspend, | |
15157 | + * but it's old semantics, for the Device Model, it's really | |
15158 | + * powerdown). The possible problem is that another sysdev that | |
15159 | + * happens to be suspend after this one will have interrupts off, | |
15160 | + * that may be an issue... For now, this isn't an issue on pmac | |
15161 | + * though... | |
15162 | + */ | |
15163 | + | |
15164 | static u32 save_ipi_vp[OPENPIC_NUM_IPI]; | |
15165 | static u32 save_irq_src_vp[OPENPIC_MAX_SOURCES]; | |
15166 | static u32 save_irq_src_dest[OPENPIC_MAX_SOURCES]; | |
15167 | static u32 save_cpu_task_pri[OPENPIC_MAX_PROCESSORS]; | |
15168 | +static int openpic_suspend_count; | |
15169 | + | |
15170 | +static void openpic_cached_enable_irq(u_int irq) | |
15171 | +{ | |
15172 | + check_arg_irq(irq); | |
15173 | + save_irq_src_vp[irq - open_pic_irq_offset] &= ~OPENPIC_MASK; | |
15174 | +} | |
15175 | ||
15176 | -void __pmac | |
15177 | -openpic_sleep_save_intrs(void) | |
15178 | +static void openpic_cached_disable_irq(u_int irq) | |
15179 | +{ | |
15180 | + check_arg_irq(irq); | |
15181 | + save_irq_src_vp[irq - open_pic_irq_offset] |= OPENPIC_MASK; | |
15182 | +} | |
15183 | + | |
15184 | +/* WARNING: Can be called directly by the cpufreq code with NULL parameter, | |
15185 | + * we need something better to deal with that... Maybe switch to S1 for | |
15186 | + * cpufreq changes | |
15187 | + */ | |
15188 | +int openpic_suspend(struct sys_device *sysdev, u32 state) | |
15189 | { | |
15190 | int i; | |
15191 | unsigned long flags; | |
15192 | ||
15193 | spin_lock_irqsave(&openpic_setup_lock, flags); | |
15194 | ||
15195 | + if (openpic_suspend_count++ > 0) { | |
15196 | + spin_unlock_irqrestore(&openpic_setup_lock, flags); | |
15197 | + return 0; | |
15198 | + } | |
15199 | + | |
15200 | + open_pic.enable = openpic_cached_enable_irq; | |
15201 | + open_pic.disable = openpic_cached_disable_irq; | |
15202 | + | |
15203 | for (i=0; i<NumProcessors; i++) { | |
15204 | save_cpu_task_pri[i] = openpic_read(&OpenPIC->Processor[i].Current_Task_Priority); | |
15205 | openpic_writefield(&OpenPIC->Processor[i].Current_Task_Priority, | |
15206 | @@ -889,38 +925,112 @@ | |
15207 | for (i=0; i<NumSources; i++) { | |
15208 | if (ISR[i] == 0) | |
15209 | continue; | |
15210 | - save_irq_src_vp[i] = openpic_read(&ISR[i]->Vector_Priority) | |
15211 | - & ~OPENPIC_ACTIVITY; | |
15212 | + save_irq_src_vp[i] = openpic_read(&ISR[i]->Vector_Priority) & ~OPENPIC_ACTIVITY; | |
15213 | save_irq_src_dest[i] = openpic_read(&ISR[i]->Destination); | |
15214 | } | |
15215 | + | |
15216 | spin_unlock_irqrestore(&openpic_setup_lock, flags); | |
15217 | + | |
15218 | + return 0; | |
15219 | } | |
15220 | ||
15221 | -void __pmac | |
15222 | -openpic_sleep_restore_intrs(void) | |
15223 | +/* WARNING: Can be called directly by the cpufreq code with NULL parameter, | |
15224 | + * we need something better to deal with that... Maybe switch to S1 for | |
15225 | + * cpufreq changes | |
15226 | + */ | |
15227 | +int openpic_resume(struct sys_device *sysdev) | |
15228 | { | |
15229 | int i; | |
15230 | unsigned long flags; | |
15231 | + u32 vppmask = OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK | | |
15232 | + OPENPIC_SENSE_MASK | OPENPIC_POLARITY_MASK | | |
15233 | + OPENPIC_MASK; | |
15234 | ||
15235 | spin_lock_irqsave(&openpic_setup_lock, flags); | |
15236 | ||
15237 | + if ((--openpic_suspend_count) > 0) { | |
15238 | + spin_unlock_irqrestore(&openpic_setup_lock, flags); | |
15239 | + return 0; | |
15240 | + } | |
15241 | + | |
15242 | openpic_reset(); | |
15243 | ||
15244 | + /* OpenPIC sometimes seem to need some time to be fully back up... */ | |
15245 | + do { | |
15246 | + openpic_set_spurious(OPENPIC_VEC_SPURIOUS+open_pic_irq_offset); | |
15247 | + } while(openpic_readfield(&OpenPIC->Global.Spurious_Vector, OPENPIC_VECTOR_MASK) | |
15248 | + != (OPENPIC_VEC_SPURIOUS + open_pic_irq_offset)); | |
15249 | + | |
15250 | + openpic_disable_8259_pass_through(); | |
15251 | + | |
15252 | for (i=0; i<OPENPIC_NUM_IPI; i++) | |
15253 | openpic_write(&OpenPIC->Global.IPI_Vector_Priority(i), | |
15254 | save_ipi_vp[i]); | |
15255 | for (i=0; i<NumSources; i++) { | |
15256 | if (ISR[i] == 0) | |
15257 | continue; | |
15258 | - openpic_write(&ISR[i]->Vector_Priority, save_irq_src_vp[i]); | |
15259 | openpic_write(&ISR[i]->Destination, save_irq_src_dest[i]); | |
15260 | + openpic_write(&ISR[i]->Vector_Priority, save_irq_src_vp[i]); | |
15261 | + /* make sure mask gets to controller before we return to user */ | |
15262 | + do { | |
15263 | + openpic_write(&ISR[i]->Vector_Priority, save_irq_src_vp[i]); | |
15264 | + } while (openpic_readfield(&ISR[i]->Vector_Priority, vppmask) | |
15265 | + != (save_irq_src_vp[i] & vppmask)); | |
15266 | } | |
15267 | - openpic_set_spurious(OPENPIC_VEC_SPURIOUS+open_pic_irq_offset); | |
15268 | - openpic_disable_8259_pass_through(); | |
15269 | for (i=0; i<NumProcessors; i++) | |
15270 | openpic_write(&OpenPIC->Processor[i].Current_Task_Priority, | |
15271 | save_cpu_task_pri[i]); | |
15272 | ||
15273 | + open_pic.enable = openpic_enable_irq; | |
15274 | + open_pic.disable = openpic_disable_irq; | |
15275 | + | |
15276 | spin_unlock_irqrestore(&openpic_setup_lock, flags); | |
15277 | + | |
15278 | + return 0; | |
15279 | +} | |
15280 | + | |
15281 | +#endif /* CONFIG_PM */ | |
15282 | + | |
15283 | +static struct sysdev_class openpic_sysclass = { | |
15284 | + set_kset_name("openpic"), | |
15285 | +}; | |
15286 | + | |
15287 | +static struct sys_device device_openpic = { | |
15288 | + .id = 0, | |
15289 | + .cls = &openpic_sysclass, | |
15290 | +}; | |
15291 | + | |
15292 | +static struct sysdev_driver driver_openpic = { | |
15293 | +#ifdef CONFIG_PM | |
15294 | + .suspend = &openpic_suspend, | |
15295 | + .resume = &openpic_resume, | |
15296 | +#endif /* CONFIG_PM */ | |
15297 | +}; | |
15298 | + | |
15299 | +static int __init init_openpic_sysfs(void) | |
15300 | +{ | |
15301 | + int rc; | |
15302 | + | |
15303 | + if (!OpenPIC_Addr) | |
15304 | + return -ENODEV; | |
15305 | + printk(KERN_DEBUG "Registering openpic with sysfs...\n"); | |
15306 | + rc = sysdev_class_register(&openpic_sysclass); | |
15307 | + if (rc) { | |
15308 | + printk(KERN_ERR "Failed registering openpic sys class\n"); | |
15309 | + return -ENODEV; | |
15310 | + } | |
15311 | + rc = sys_device_register(&device_openpic); | |
15312 | + if (rc) { | |
15313 | + printk(KERN_ERR "Failed registering openpic sys device\n"); | |
15314 | + return -ENODEV; | |
15315 | + } | |
15316 | + rc = sysdev_driver_register(&openpic_sysclass, &driver_openpic); | |
15317 | + if (rc) { | |
15318 | + printk(KERN_ERR "Failed registering openpic sys driver\n"); | |
15319 | + return -ENODEV; | |
15320 | + } | |
15321 | + return 0; | |
15322 | } | |
15323 | -#endif /* CONFIG_PMAC_PBOOK */ | |
15324 | + | |
15325 | +subsys_initcall(init_openpic_sysfs); | |
15326 | + | |
15327 | diff -Nru a/arch/ppc/syslib/prom.c b/arch/ppc/syslib/prom.c | |
15328 | --- a/arch/ppc/syslib/prom.c Sat Jun 7 02:18:01 2003 | |
15329 | +++ b/arch/ppc/syslib/prom.c Sun Aug 24 03:57:52 2003 | |
15330 | @@ -941,6 +941,184 @@ | |
15331 | return NULL; | |
15332 | } | |
15333 | ||
15334 | +/******* | |
15335 | + * | |
15336 | + * New implementation of the OF "find" APIs, return a refcounted | |
15337 | + * object, call of_node_put() when done. Currently, still lacks | |
15338 | + * locking as old implementation, this is beeing done for ppc64. | |
15339 | + * | |
15340 | + * Note that property management will need some locking as well, | |
15341 | + * this isn't dealt with yet | |
15342 | + * | |
15343 | + *******/ | |
15344 | + | |
15345 | +/** | |
15346 | + * of_find_node_by_name - Find a node by it's "name" property | |
15347 | + * @from: The node to start searching from or NULL, the node | |
15348 | + * you pass will not be searched, only the next one | |
15349 | + * will; typically, you pass what the previous call | |
15350 | + * returned. of_node_put() will be called on it | |
15351 | + * @name: The name string to match against | |
15352 | + * | |
15353 | + * Returns a node pointer with refcount incremented, use | |
15354 | + * of_node_put() on it when done. | |
15355 | + */ | |
15356 | +struct device_node *of_find_node_by_name(struct device_node *from, | |
15357 | + const char *name) | |
15358 | +{ | |
15359 | + struct device_node *np = from ? from->allnext : allnodes; | |
15360 | + | |
15361 | + for (; np != 0; np = np->allnext) | |
15362 | + if (np->name != 0 && strcasecmp(np->name, name) == 0) | |
15363 | + break; | |
15364 | + if (from) | |
15365 | + of_node_put(from); | |
15366 | + return of_node_get(np); | |
15367 | +} | |
15368 | + | |
15369 | +/** | |
15370 | + * of_find_node_by_type - Find a node by it's "device_type" property | |
15371 | + * @from: The node to start searching from or NULL, the node | |
15372 | + * you pass will not be searched, only the next one | |
15373 | + * will; typically, you pass what the previous call | |
15374 | + * returned. of_node_put() will be called on it | |
15375 | + * @name: The type string to match against | |
15376 | + * | |
15377 | + * Returns a node pointer with refcount incremented, use | |
15378 | + * of_node_put() on it when done. | |
15379 | + */ | |
15380 | +struct device_node *of_find_node_by_type(struct device_node *from, | |
15381 | + const char *type) | |
15382 | +{ | |
15383 | + struct device_node *np = from ? from->allnext : allnodes; | |
15384 | + | |
15385 | + for (; np != 0; np = np->allnext) | |
15386 | + if (np->type != 0 && strcasecmp(np->type, type) == 0) | |
15387 | + break; | |
15388 | + if (from) | |
15389 | + of_node_put(from); | |
15390 | + return of_node_get(np); | |
15391 | +} | |
15392 | + | |
15393 | +/** | |
15394 | + * of_find_compatible_node - Find a node based on type and one of the | |
15395 | + * tokens in it's "compatible" property | |
15396 | + * @from: The node to start searching from or NULL, the node | |
15397 | + * you pass will not be searched, only the next one | |
15398 | + * will; typically, you pass what the previous call | |
15399 | + * returned. of_node_put() will be called on it | |
15400 | + * @type: The type string to match "device_type" or NULL to ignore | |
15401 | + * @compatible: The string to match to one of the tokens in the device | |
15402 | + * "compatible" list. | |
15403 | + * | |
15404 | + * Returns a node pointer with refcount incremented, use | |
15405 | + * of_node_put() on it when done. | |
15406 | + */ | |
15407 | +struct device_node *of_find_compatible_node(struct device_node *from, | |
15408 | + const char *type, const char *compatible) | |
15409 | +{ | |
15410 | + struct device_node *np = from ? from->allnext : allnodes; | |
15411 | + | |
15412 | + for (; np != 0; np = np->allnext) { | |
15413 | + if (type != NULL | |
15414 | + && !(np->type != 0 && strcasecmp(np->type, type) == 0)) | |
15415 | + continue; | |
15416 | + if (device_is_compatible(np, compatible)) | |
15417 | + break; | |
15418 | + } | |
15419 | + if (from) | |
15420 | + of_node_put(from); | |
15421 | + return of_node_get(np); | |
15422 | +} | |
15423 | + | |
15424 | +/** | |
15425 | + * of_find_node_by_path - Find a node matching a full OF path | |
15426 | + * @path: The full path to match | |
15427 | + * | |
15428 | + * Returns a node pointer with refcount incremented, use | |
15429 | + * of_node_put() on it when done. | |
15430 | + */ | |
15431 | +struct device_node *of_find_node_by_path(const char *path) | |
15432 | +{ | |
15433 | + struct device_node *np = allnodes; | |
15434 | + | |
15435 | + for (; np != 0; np = np->allnext) | |
15436 | + if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0) | |
15437 | + break; | |
15438 | + return of_node_get(np); | |
15439 | +} | |
15440 | + | |
15441 | +/** | |
15442 | + * of_find_all_nodes - Get next node in global list | |
15443 | + * @prev: Previous node or NULL to start iteration | |
15444 | + * of_node_put() will be called on it | |
15445 | + * | |
15446 | + * Returns a node pointer with refcount incremented, use | |
15447 | + * of_node_put() on it when done. | |
15448 | + */ | |
15449 | +struct device_node *of_find_all_nodes(struct device_node *prev) | |
15450 | +{ | |
15451 | + return of_node_get(prev ? prev->allnext : allnodes); | |
15452 | +} | |
15453 | + | |
15454 | +/** | |
15455 | + * of_get_parent - Get a node's parent if any | |
15456 | + * @node: Node to get parent | |
15457 | + * | |
15458 | + * Returns a node pointer with refcount incremented, use | |
15459 | + * of_node_put() on it when done. | |
15460 | + */ | |
15461 | +struct device_node *of_get_parent(const struct device_node *node) | |
15462 | +{ | |
15463 | + return node ? of_node_get(node->parent) : NULL; | |
15464 | +} | |
15465 | + | |
15466 | +/** | |
15467 | + * of_get_next_child - Iterate a node childs | |
15468 | + * @node: parent node | |
15469 | + * @prev: previous child of the parent node, or NULL to get first | |
15470 | + * | |
15471 | + * Returns a node pointer with refcount incremented, use | |
15472 | + * of_node_put() on it when done. | |
15473 | + */ | |
15474 | +struct device_node *of_get_next_child(const struct device_node *node, | |
15475 | + struct device_node *prev) | |
15476 | +{ | |
15477 | + struct device_node *next = prev ? prev->sibling : node->child; | |
15478 | + | |
15479 | + for (; next != 0; next = next->sibling) | |
15480 | + if (of_node_get(next)) | |
15481 | + break; | |
15482 | + if (prev) | |
15483 | + of_node_put(prev); | |
15484 | + return next; | |
15485 | +} | |
15486 | + | |
15487 | +/** | |
15488 | + * of_node_get - Increment refcount of a node | |
15489 | + * @node: Node to inc refcount, NULL is supported to | |
15490 | + * simplify writing of callers | |
15491 | + * | |
15492 | + * Returns the node itself or NULL if gone. Current implementation | |
15493 | + * does nothing as we don't yet do dynamic node allocation on ppc32 | |
15494 | + */ | |
15495 | +struct device_node *of_node_get(struct device_node *node) | |
15496 | +{ | |
15497 | + return node; | |
15498 | +} | |
15499 | + | |
15500 | +/** | |
15501 | + * of_node_put - Decrement refcount of a node | |
15502 | + * @node: Node to dec refcount, NULL is supported to | |
15503 | + * simplify writing of callers | |
15504 | + * | |
15505 | + * Current implementation does nothing as we don't yet do dynamic node | |
15506 | + * allocation on ppc32 | |
15507 | + */ | |
15508 | +void of_node_put(struct device_node *node) | |
15509 | +{ | |
15510 | +} | |
15511 | + | |
15512 | /* | |
15513 | * Find the device_node with a given phandle. | |
15514 | */ | |
15515 | diff -Nru a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c | |
15516 | --- a/arch/ppc/xmon/start.c Sat Jun 7 02:18:02 2003 | |
15517 | +++ b/arch/ppc/xmon/start.c Sun Aug 24 07:39:33 2003 | |
15518 | @@ -225,14 +225,13 @@ | |
15519 | static int scc_initialized = 0; | |
15520 | ||
15521 | void xmon_init_scc(void); | |
15522 | -extern void pmu_poll(void); | |
15523 | extern void cuda_poll(void); | |
15524 | ||
15525 | static inline void do_poll_adb(void) | |
15526 | { | |
15527 | #ifdef CONFIG_ADB_PMU | |
15528 | if (sys_ctrler == SYS_CTRLER_PMU) | |
15529 | - pmu_poll(); | |
15530 | + pmu_poll_adb(); | |
15531 | #endif /* CONFIG_ADB_PMU */ | |
15532 | #ifdef CONFIG_ADB_CUDA | |
15533 | if (sys_ctrler == SYS_CTRLER_CUDA) | |
15534 | diff -Nru a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig | |
15535 | --- a/arch/ppc64/Kconfig Mon Aug 18 19:46:23 2003 | |
15536 | +++ b/arch/ppc64/Kconfig Sun Aug 31 16:14:22 2003 | |
15537 | @@ -175,22 +175,6 @@ | |
15538 | bool | |
15539 | default PCI | |
15540 | ||
15541 | -# only elf supported, a.out is not -- Cort | |
15542 | -config KCORE_ELF | |
15543 | - bool | |
15544 | - depends on PROC_FS | |
15545 | - default y | |
15546 | - help | |
15547 | - If you enabled support for /proc file system then the file | |
15548 | - /proc/kcore will contain the kernel core image in ELF format. This | |
15549 | - can be used in gdb: | |
15550 | - | |
15551 | - $ cd /usr/src/linux ; gdb vmlinux /proc/kcore | |
15552 | - | |
15553 | - This is especially useful if you have compiled the kernel with the | |
15554 | - "-g" option to preserve debugging information. It is mainly used | |
15555 | - for examining kernel data structures on the live kernel. | |
15556 | - | |
15557 | source "fs/Kconfig.binfmt" | |
15558 | ||
15559 | source "drivers/pci/Kconfig" | |
15560 | diff -Nru a/arch/ppc64/kernel/ioctl32.c b/arch/ppc64/kernel/ioctl32.c | |
15561 | --- a/arch/ppc64/kernel/ioctl32.c Fri Aug 8 14:53:47 2003 | |
15562 | +++ b/arch/ppc64/kernel/ioctl32.c Sun Aug 31 16:14:44 2003 | |
15563 | @@ -725,7 +725,7 @@ | |
15564 | #define IOCTL_TABLE_START \ | |
15565 | struct ioctl_trans ioctl_start[] = { | |
15566 | #define IOCTL_TABLE_END \ | |
15567 | - }; struct ioctl_trans ioctl_end[0]; | |
15568 | + }; | |
15569 | ||
15570 | IOCTL_TABLE_START | |
15571 | #include <linux/compat_ioctl.h> | |
15572 | @@ -763,3 +763,5 @@ | |
15573 | HANDLE_IOCTL(USBDEVFS_REAPURBNDELAY32, do_usbdevfs_reapurb) | |
15574 | HANDLE_IOCTL(USBDEVFS_DISCSIGNAL32, do_usbdevfs_discsignal) | |
15575 | IOCTL_TABLE_END | |
15576 | + | |
15577 | +int ioctl_table_size = ARRAY_SIZE(ioctl_start); | |
15578 | diff -Nru a/arch/ppc64/kernel/proc_ppc64.c b/arch/ppc64/kernel/proc_ppc64.c | |
15579 | --- a/arch/ppc64/kernel/proc_ppc64.c Tue Mar 25 20:30:59 2003 | |
15580 | +++ b/arch/ppc64/kernel/proc_ppc64.c Sun Aug 31 16:14:08 2003 | |
15581 | @@ -47,9 +47,9 @@ | |
15582 | static int page_map_mmap( struct file *file, struct vm_area_struct *vma ); | |
15583 | ||
15584 | static struct file_operations page_map_fops = { | |
15585 | - llseek: page_map_seek, | |
15586 | - read: page_map_read, | |
15587 | - mmap: page_map_mmap | |
15588 | + .llseek = page_map_seek, | |
15589 | + .read = page_map_read, | |
15590 | + .mmap = page_map_mmap | |
15591 | }; | |
15592 | ||
15593 | ||
15594 | diff -Nru a/arch/ppc64/kernel/scanlog.c b/arch/ppc64/kernel/scanlog.c | |
15595 | --- a/arch/ppc64/kernel/scanlog.c Thu Feb 13 00:47:26 2003 | |
15596 | +++ b/arch/ppc64/kernel/scanlog.c Sun Aug 31 16:14:08 2003 | |
15597 | @@ -190,11 +190,11 @@ | |
15598 | } | |
15599 | ||
15600 | struct file_operations scanlog_fops = { | |
15601 | - owner: THIS_MODULE, | |
15602 | - read: scanlog_read, | |
15603 | - write: scanlog_write, | |
15604 | - open: scanlog_open, | |
15605 | - release: scanlog_release, | |
15606 | + .owner = THIS_MODULE, | |
15607 | + .read = scanlog_read, | |
15608 | + .write = scanlog_write, | |
15609 | + .open = scanlog_open, | |
15610 | + .release = scanlog_release, | |
15611 | }; | |
15612 | ||
15613 | int __init scanlog_init(void) | |
15614 | diff -Nru a/arch/s390/Kconfig b/arch/s390/Kconfig | |
15615 | --- a/arch/s390/Kconfig Mon Jul 21 13:25:16 2003 | |
15616 | +++ b/arch/s390/Kconfig Sun Aug 31 16:14:22 2003 | |
15617 | @@ -217,10 +217,6 @@ | |
15618 | ||
15619 | endchoice | |
15620 | ||
15621 | -config KCORE_ELF | |
15622 | - bool | |
15623 | - default y | |
15624 | - | |
15625 | source "fs/Kconfig.binfmt" | |
15626 | ||
15627 | config PROCESS_DEBUG | |
15628 | diff -Nru a/arch/s390/kernel/compat_ioctl.c b/arch/s390/kernel/compat_ioctl.c | |
15629 | --- a/arch/s390/kernel/compat_ioctl.c Tue May 27 12:34:41 2003 | |
15630 | +++ b/arch/s390/kernel/compat_ioctl.c Sun Aug 31 16:14:44 2003 | |
15631 | @@ -808,7 +808,7 @@ | |
15632 | #define IOCTL_TABLE_START \ | |
15633 | struct ioctl_trans ioctl_start[] = { | |
15634 | #define IOCTL_TABLE_END \ | |
15635 | - }; struct ioctl_trans ioctl_end[0]; | |
15636 | + }; | |
15637 | ||
15638 | IOCTL_TABLE_START | |
15639 | #include <linux/compat_ioctl.h> | |
15640 | @@ -899,3 +899,5 @@ | |
15641 | HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans) | |
15642 | ||
15643 | IOCTL_TABLE_END | |
15644 | + | |
15645 | +int ioctl_table_size = ARRAY_SIZE(ioctl_start); | |
15646 | diff -Nru a/arch/sh/Kconfig b/arch/sh/Kconfig | |
15647 | --- a/arch/sh/Kconfig Sat Aug 2 14:26:16 2003 | |
15648 | +++ b/arch/sh/Kconfig Sun Aug 31 16:14:22 2003 | |
15649 | @@ -729,40 +729,6 @@ | |
15650 | ||
15651 | menu "Executable file formats" | |
15652 | ||
15653 | -choice | |
15654 | - prompt "Kernel core (/proc/kcore) format" | |
15655 | - depends on PROC_FS | |
15656 | - default KCORE_ELF | |
15657 | - | |
15658 | -config KCORE_ELF | |
15659 | - bool "ELF" | |
15660 | - ---help--- | |
15661 | - If you enabled support for /proc file system then the file | |
15662 | - /proc/kcore will contain the kernel core image. This can be used | |
15663 | - in gdb: | |
15664 | - | |
15665 | - $ cd /usr/src/linux ; gdb vmlinux /proc/kcore | |
15666 | - | |
15667 | - You have two choices here: ELF and A.OUT. Selecting ELF will make | |
15668 | - /proc/kcore appear in ELF core format as defined by the Executable | |
15669 | - and Linking Format specification. Selecting A.OUT will choose the | |
15670 | - old "a.out" format which may be necessary for some old versions | |
15671 | - of binutils or on some architectures. | |
15672 | - | |
15673 | - This is especially useful if you have compiled the kernel with the | |
15674 | - "-g" option to preserve debugging information. It is mainly used | |
15675 | - for examining kernel data structures on the live kernel so if you | |
15676 | - don't understand what this means or are not a kernel hacker, just | |
15677 | - leave it at its default value ELF. | |
15678 | - | |
15679 | -config KCORE_AOUT | |
15680 | - bool "A.OUT" | |
15681 | - help | |
15682 | - Not necessary unless you're using a very out-of-date binutils | |
15683 | - version. You probably want KCORE_ELF. | |
15684 | - | |
15685 | -endchoice | |
15686 | - | |
15687 | source "fs/Kconfig.binfmt" | |
15688 | ||
15689 | endmenu | |
15690 | diff -Nru a/arch/sh/boards/adx/mach.c b/arch/sh/boards/adx/mach.c | |
15691 | --- a/arch/sh/boards/adx/mach.c Mon May 19 16:04:36 2003 | |
15692 | +++ b/arch/sh/boards/adx/mach.c Sun Aug 31 16:14:08 2003 | |
15693 | @@ -24,41 +24,41 @@ | |
15694 | */ | |
15695 | ||
15696 | struct sh_machine_vector mv_adx __initmv = { | |
15697 | - mv_nr_irqs: 48, | |
15698 | + .mv_nr_irqs = 48, | |
15699 | ||
15700 | - mv_inb: adx_inb, | |
15701 | - mv_inw: adx_inw, | |
15702 | - mv_inl: adx_inl, | |
15703 | - mv_outb: adx_outb, | |
15704 | - mv_outw: adx_outw, | |
15705 | - mv_outl: adx_outl, | |
15706 | - | |
15707 | - mv_inb_p: adx_inb_p, | |
15708 | - mv_inw_p: adx_inw, | |
15709 | - mv_inl_p: adx_inl, | |
15710 | - mv_outb_p: adx_outb_p, | |
15711 | - mv_outw_p: adx_outw, | |
15712 | - mv_outl_p: adx_outl, | |
15713 | - | |
15714 | - mv_insb: adx_insb, | |
15715 | - mv_insw: adx_insw, | |
15716 | - mv_insl: adx_insl, | |
15717 | - mv_outsb: adx_outsb, | |
15718 | - mv_outsw: adx_outsw, | |
15719 | - mv_outsl: adx_outsl, | |
15720 | - | |
15721 | - mv_readb: adx_readb, | |
15722 | - mv_readw: adx_readw, | |
15723 | - mv_readl: adx_readl, | |
15724 | - mv_writeb: adx_writeb, | |
15725 | - mv_writew: adx_writew, | |
15726 | - mv_writel: adx_writel, | |
15727 | + .mv_inb = adx_inb, | |
15728 | + .mv_inw = adx_inw, | |
15729 | + .mv_inl = adx_inl, | |
15730 | + .mv_outb = adx_outb, | |
15731 | + .mv_outw = adx_outw, | |
15732 | + .mv_outl = adx_outl, | |
15733 | + | |
15734 | + .mv_inb_p = adx_inb_p, | |
15735 | + .mv_inw_p = adx_inw, | |
15736 | + .mv_inl_p = adx_inl, | |
15737 | + .mv_outb_p = adx_outb_p, | |
15738 | + .mv_outw_p = adx_outw, | |
15739 | + .mv_outl_p = adx_outl, | |
15740 | + | |
15741 | + .mv_insb = adx_insb, | |
15742 | + .mv_insw = adx_insw, | |
15743 | + .mv_insl = adx_insl, | |
15744 | + .mv_outsb = adx_outsb, | |
15745 | + .mv_outsw = adx_outsw, | |
15746 | + .mv_outsl = adx_outsl, | |
15747 | + | |
15748 | + .mv_readb = adx_readb, | |
15749 | + .mv_readw = adx_readw, | |
15750 | + .mv_readl = adx_readl, | |
15751 | + .mv_writeb = adx_writeb, | |
15752 | + .mv_writew = adx_writew, | |
15753 | + .mv_writel = adx_writel, | |
15754 | ||
15755 | - mv_ioremap: adx_ioremap, | |
15756 | - mv_iounmap: adx_iounmap, | |
15757 | + .mv_ioremap = adx_ioremap, | |
15758 | + .mv_iounmap = adx_iounmap, | |
15759 | ||
15760 | - mv_isa_port2addr: adx_isa_port2addr, | |
15761 | + .mv_isa_port2addr = adx_isa_port2addr, | |
15762 | ||
15763 | - mv_init_irq: init_adx_IRQ, | |
15764 | + .mv_init_irq = init_adx_IRQ, | |
15765 | }; | |
15766 | ALIAS_MV(adx) | |
15767 | diff -Nru a/arch/sh/boards/bigsur/mach.c b/arch/sh/boards/bigsur/mach.c | |
15768 | --- a/arch/sh/boards/bigsur/mach.c Sat Mar 2 08:57:07 2002 | |
15769 | +++ b/arch/sh/boards/bigsur/mach.c Sun Aug 31 16:14:08 2003 | |
15770 | @@ -28,44 +28,44 @@ | |
15771 | extern void init_bigsur_IRQ(void); | |
15772 | ||
15773 | struct sh_machine_vector mv_bigsur __initmv = { | |
15774 | - mv_nr_irqs: NR_IRQS, // Defined in <asm/irq.h> | |
15775 | - mv_inb: bigsur_inb, | |
15776 | - mv_inw: bigsur_inw, | |
15777 | - mv_inl: bigsur_inl, | |
15778 | - mv_outb: bigsur_outb, | |
15779 | - mv_outw: bigsur_outw, | |
15780 | - mv_outl: bigsur_outl, | |
15781 | - | |
15782 | - mv_inb_p: bigsur_inb_p, | |
15783 | - mv_inw_p: bigsur_inw, | |
15784 | - mv_inl_p: bigsur_inl, | |
15785 | - mv_outb_p: bigsur_outb_p, | |
15786 | - mv_outw_p: bigsur_outw, | |
15787 | - mv_outl_p: bigsur_outl, | |
15788 | - | |
15789 | - mv_insb: bigsur_insb, | |
15790 | - mv_insw: bigsur_insw, | |
15791 | - mv_insl: bigsur_insl, | |
15792 | - mv_outsb: bigsur_outsb, | |
15793 | - mv_outsw: bigsur_outsw, | |
15794 | - mv_outsl: bigsur_outsl, | |
15795 | - | |
15796 | - mv_readb: generic_readb, | |
15797 | - mv_readw: generic_readw, | |
15798 | - mv_readl: generic_readl, | |
15799 | - mv_writeb: generic_writeb, | |
15800 | - mv_writew: generic_writew, | |
15801 | - mv_writel: generic_writel, | |
15802 | + .mv_nr_irqs = NR_IRQS, // Defined in <asm/irq.h> | |
15803 | + .mv_inb = bigsur_inb, | |
15804 | + .mv_inw = bigsur_inw, | |
15805 | + .mv_inl = bigsur_inl, | |
15806 | + .mv_outb = bigsur_outb, | |
15807 | + .mv_outw = bigsur_outw, | |
15808 | + .mv_outl = bigsur_outl, | |
15809 | + | |
15810 | + .mv_inb_p = bigsur_inb_p, | |
15811 | + .mv_inw_p = bigsur_inw, | |
15812 | + .mv_inl_p = bigsur_inl, | |
15813 | + .mv_outb_p = bigsur_outb_p, | |
15814 | + .mv_outw_p = bigsur_outw, | |
15815 | + .mv_outl_p = bigsur_outl, | |
15816 | + | |
15817 | + .mv_insb = bigsur_insb, | |
15818 | + .mv_insw = bigsur_insw, | |
15819 | + .mv_insl = bigsur_insl, | |
15820 | + .mv_outsb = bigsur_outsb, | |
15821 | + .mv_outsw = bigsur_outsw, | |
15822 | + .mv_outsl = bigsur_outsl, | |
15823 | + | |
15824 | + .mv_readb = generic_readb, | |
15825 | + .mv_readw = generic_readw, | |
15826 | + .mv_readl = generic_readl, | |
15827 | + .mv_writeb = generic_writeb, | |
15828 | + .mv_writew = generic_writew, | |
15829 | + .mv_writel = generic_writel, | |
15830 | ||
15831 | - mv_ioremap: generic_ioremap, | |
15832 | - mv_iounmap: generic_iounmap, | |
15833 | + .mv_ioremap = generic_ioremap, | |
15834 | + .mv_iounmap = generic_iounmap, | |
15835 | ||
15836 | - mv_isa_port2addr: bigsur_isa_port2addr, | |
15837 | - mv_irq_demux: bigsur_irq_demux, | |
15838 | + .mv_isa_port2addr = bigsur_isa_port2addr, | |
15839 | + .mv_irq_demux = bigsur_irq_demux, | |
15840 | ||
15841 | - mv_init_irq: init_bigsur_IRQ, | |
15842 | + .mv_init_irq = init_bigsur_IRQ, | |
15843 | #ifdef CONFIG_HEARTBEAT | |
15844 | - mv_heartbeat: heartbeat_bigsur, | |
15845 | + .mv_heartbeat = heartbeat_bigsur, | |
15846 | #endif | |
15847 | ||
15848 | }; | |
15849 | diff -Nru a/arch/sh/boards/cat68701/mach.c b/arch/sh/boards/cat68701/mach.c | |
15850 | --- a/arch/sh/boards/cat68701/mach.c Sat Mar 2 08:57:07 2002 | |
15851 | +++ b/arch/sh/boards/cat68701/mach.c Sun Aug 31 16:14:08 2003 | |
15852 | @@ -23,44 +23,44 @@ | |
15853 | */ | |
15854 | ||
15855 | struct sh_machine_vector mv_cat68701 __initmv = { | |
15856 | - mv_nr_irqs: 32, | |
15857 | - mv_inb: cat68701_inb, | |
15858 | - mv_inw: cat68701_inw, | |
15859 | - mv_inl: cat68701_inl, | |
15860 | - mv_outb: cat68701_outb, | |
15861 | - mv_outw: cat68701_outw, | |
15862 | - mv_outl: cat68701_outl, | |
15863 | - | |
15864 | - mv_inb_p: cat68701_inb_p, | |
15865 | - mv_inw_p: cat68701_inw, | |
15866 | - mv_inl_p: cat68701_inl, | |
15867 | - mv_outb_p: cat68701_outb_p, | |
15868 | - mv_outw_p: cat68701_outw, | |
15869 | - mv_outl_p: cat68701_outl, | |
15870 | - | |
15871 | - mv_insb: cat68701_insb, | |
15872 | - mv_insw: cat68701_insw, | |
15873 | - mv_insl: cat68701_insl, | |
15874 | - mv_outsb: cat68701_outsb, | |
15875 | - mv_outsw: cat68701_outsw, | |
15876 | - mv_outsl: cat68701_outsl, | |
15877 | - | |
15878 | - mv_readb: cat68701_readb, | |
15879 | - mv_readw: cat68701_readw, | |
15880 | - mv_readl: cat68701_readl, | |
15881 | - mv_writeb: cat68701_writeb, | |
15882 | - mv_writew: cat68701_writew, | |
15883 | - mv_writel: cat68701_writel, | |
15884 | + .mv_nr_irqs = 32, | |
15885 | + .mv_inb = cat68701_inb, | |
15886 | + .mv_inw = cat68701_inw, | |
15887 | + .mv_inl = cat68701_inl, | |
15888 | + .mv_outb = cat68701_outb, | |
15889 | + .mv_outw = cat68701_outw, | |
15890 | + .mv_outl = cat68701_outl, | |
15891 | + | |
15892 | + .mv_inb_p = cat68701_inb_p, | |
15893 | + .mv_inw_p = cat68701_inw, | |
15894 | + .mv_inl_p = cat68701_inl, | |
15895 | + .mv_outb_p = cat68701_outb_p, | |
15896 | + .mv_outw_p = cat68701_outw, | |
15897 | + .mv_outl_p = cat68701_outl, | |
15898 | + | |
15899 | + .mv_insb = cat68701_insb, | |
15900 | + .mv_insw = cat68701_insw, | |
15901 | + .mv_insl = cat68701_insl, | |
15902 | + .mv_outsb = cat68701_outsb, | |
15903 | + .mv_outsw = cat68701_outsw, | |
15904 | + .mv_outsl = cat68701_outsl, | |
15905 | + | |
15906 | + .mv_readb = cat68701_readb, | |
15907 | + .mv_readw = cat68701_readw, | |
15908 | + .mv_readl = cat68701_readl, | |
15909 | + .mv_writeb = cat68701_writeb, | |
15910 | + .mv_writew = cat68701_writew, | |
15911 | + .mv_writel = cat68701_writel, | |
15912 | ||
15913 | - mv_ioremap: cat68701_ioremap, | |
15914 | - mv_iounmap: cat68701_iounmap, | |
15915 | + .mv_ioremap = cat68701_ioremap, | |
15916 | + .mv_iounmap = cat68701_iounmap, | |
15917 | ||
15918 | - mv_isa_port2addr: cat68701_isa_port2addr, | |
15919 | - mv_irq_demux: cat68701_irq_demux, | |
15920 | + .mv_isa_port2addr = cat68701_isa_port2addr, | |
15921 | + .mv_irq_demux = cat68701_irq_demux, | |
15922 | ||
15923 | - mv_init_irq: init_cat68701_IRQ, | |
15924 | + .mv_init_irq = init_cat68701_IRQ, | |
15925 | #ifdef CONFIG_HEARTBEAT | |
15926 | - mv_heartbeat: heartbeat_cat68701, | |
15927 | + .mv_heartbeat = heartbeat_cat68701, | |
15928 | #endif | |
15929 | }; | |
15930 | ALIAS_MV(cat68701) | |
15931 | diff -Nru a/arch/sh/boards/cqreek/mach.c b/arch/sh/boards/cqreek/mach.c | |
15932 | --- a/arch/sh/boards/cqreek/mach.c Sat Jun 14 11:02:09 2003 | |
15933 | +++ b/arch/sh/boards/cqreek/mach.c Sun Aug 31 16:14:08 2003 | |
15934 | @@ -21,46 +21,46 @@ | |
15935 | ||
15936 | struct sh_machine_vector mv_cqreek __initmv = { | |
15937 | #if defined(CONFIG_CPU_SH4) | |
15938 | - mv_nr_irqs: 48, | |
15939 | + .mv_nr_irqs = 48, | |
15940 | #elif defined(CONFIG_CPU_SUBTYPE_SH7708) | |
15941 | - mv_nr_irqs: 32, | |
15942 | + .mv_nr_irqs = 32, | |
15943 | #elif defined(CONFIG_CPU_SUBTYPE_SH7709) | |
15944 | - mv_nr_irqs: 61, | |
15945 | + .mv_nr_irqs = 61, | |
15946 | #endif | |
15947 | ||
15948 | - mv_inb: generic_inb, | |
15949 | - mv_inw: generic_inw, | |
15950 | - mv_inl: generic_inl, | |
15951 | - mv_outb: generic_outb, | |
15952 | - mv_outw: generic_outw, | |
15953 | - mv_outl: generic_outl, | |
15954 | - | |
15955 | - mv_inb_p: generic_inb_p, | |
15956 | - mv_inw_p: generic_inw_p, | |
15957 | - mv_inl_p: generic_inl_p, | |
15958 | - mv_outb_p: generic_outb_p, | |
15959 | - mv_outw_p: generic_outw_p, | |
15960 | - mv_outl_p: generic_outl_p, | |
15961 | - | |
15962 | - mv_insb: generic_insb, | |
15963 | - mv_insw: generic_insw, | |
15964 | - mv_insl: generic_insl, | |
15965 | - mv_outsb: generic_outsb, | |
15966 | - mv_outsw: generic_outsw, | |
15967 | - mv_outsl: generic_outsl, | |
15968 | - | |
15969 | - mv_readb: generic_readb, | |
15970 | - mv_readw: generic_readw, | |
15971 | - mv_readl: generic_readl, | |
15972 | - mv_writeb: generic_writeb, | |
15973 | - mv_writew: generic_writew, | |
15974 | - mv_writel: generic_writel, | |
15975 | + .mv_inb = generic_inb, | |
15976 | + .mv_inw = generic_inw, | |
15977 | + .mv_inl = generic_inl, | |
15978 | + .mv_outb = generic_outb, | |
15979 | + .mv_outw = generic_outw, | |
15980 | + .mv_outl = generic_outl, | |
15981 | + | |
15982 | + .mv_inb_p = generic_inb_p, | |
15983 | + .mv_inw_p = generic_inw_p, | |
15984 | + .mv_inl_p = generic_inl_p, | |
15985 | + .mv_outb_p = generic_outb_p, | |
15986 | + .mv_outw_p = generic_outw_p, | |
15987 | + .mv_outl_p = generic_outl_p, | |
15988 | + | |
15989 | + .mv_insb = generic_insb, | |
15990 | + .mv_insw = generic_insw, | |
15991 | + .mv_insl = generic_insl, | |
15992 | + .mv_outsb = generic_outsb, | |
15993 | + .mv_outsw = generic_outsw, | |
15994 | + .mv_outsl = generic_outsl, | |
15995 | + | |
15996 | + .mv_readb = generic_readb, | |
15997 | + .mv_readw = generic_readw, | |
15998 | + .mv_readl = generic_readl, | |
15999 | + .mv_writeb = generic_writeb, | |
16000 | + .mv_writew = generic_writew, | |
16001 | + .mv_writel = generic_writel, | |
16002 | ||
16003 | - mv_init_irq: init_cqreek_IRQ, | |
16004 | + .mv_init_irq = init_cqreek_IRQ, | |
16005 | ||
16006 | - mv_isa_port2addr: cqreek_port2addr, | |
16007 | + .mv_isa_port2addr = cqreek_port2addr, | |
16008 | ||
16009 | - mv_ioremap: generic_ioremap, | |
16010 | - mv_iounmap: generic_iounmap, | |
16011 | + .mv_ioremap = generic_ioremap, | |
16012 | + .mv_iounmap = generic_iounmap, | |
16013 | }; | |
16014 | ALIAS_MV(cqreek) | |
16015 | diff -Nru a/arch/sh/boards/dmida/mach.c b/arch/sh/boards/dmida/mach.c | |
16016 | --- a/arch/sh/boards/dmida/mach.c Mon May 19 16:04:36 2003 | |
16017 | +++ b/arch/sh/boards/dmida/mach.c Sun Aug 31 16:14:08 2003 | |
16018 | @@ -30,42 +30,42 @@ | |
16019 | */ | |
16020 | ||
16021 | struct sh_machine_vector mv_dmida __initmv = { | |
16022 | - mv_name: "DMIDA", | |
16023 | + .mv_name = "DMIDA", | |
16024 | ||
16025 | - mv_nr_irqs: HD64465_IRQ_BASE+HD64465_IRQ_NUM, | |
16026 | + .mv_nr_irqs = HD64465_IRQ_BASE+HD64465_IRQ_NUM, | |
16027 | ||
16028 | - mv_inb: hd64465_inb, | |
16029 | - mv_inw: hd64465_inw, | |
16030 | - mv_inl: hd64465_inl, | |
16031 | - mv_outb: hd64465_outb, | |
16032 | - mv_outw: hd64465_outw, | |
16033 | - mv_outl: hd64465_outl, | |
16034 | - | |
16035 | - mv_inb_p: hd64465_inb_p, | |
16036 | - mv_inw_p: hd64465_inw, | |
16037 | - mv_inl_p: hd64465_inl, | |
16038 | - mv_outb_p: hd64465_outb_p, | |
16039 | - mv_outw_p: hd64465_outw, | |
16040 | - mv_outl_p: hd64465_outl, | |
16041 | - | |
16042 | - mv_insb: hd64465_insb, | |
16043 | - mv_insw: hd64465_insw, | |
16044 | - mv_insl: hd64465_insl, | |
16045 | - mv_outsb: hd64465_outsb, | |
16046 | - mv_outsw: hd64465_outsw, | |
16047 | - mv_outsl: hd64465_outsl, | |
16048 | - | |
16049 | - mv_readb: generic_readb, | |
16050 | - mv_readw: generic_readw, | |
16051 | - mv_readl: generic_readl, | |
16052 | - mv_writeb: generic_writeb, | |
16053 | - mv_writew: generic_writew, | |
16054 | - mv_writel: generic_writel, | |
16055 | + .mv_inb = hd64465_inb, | |
16056 | + .mv_inw = hd64465_inw, | |
16057 | + .mv_inl = hd64465_inl, | |
16058 | + .mv_outb = hd64465_outb, | |
16059 | + .mv_outw = hd64465_outw, | |
16060 | + .mv_outl = hd64465_outl, | |
16061 | + | |
16062 | + .mv_inb_p = hd64465_inb_p, | |
16063 | + .mv_inw_p = hd64465_inw, | |
16064 | + .mv_inl_p = hd64465_inl, | |
16065 | + .mv_outb_p = hd64465_outb_p, | |
16066 | + .mv_outw_p = hd64465_outw, | |
16067 | + .mv_outl_p = hd64465_outl, | |
16068 | + | |
16069 | + .mv_insb = hd64465_insb, | |
16070 | + .mv_insw = hd64465_insw, | |
16071 | + .mv_insl = hd64465_insl, | |
16072 | + .mv_outsb = hd64465_outsb, | |
16073 | + .mv_outsw = hd64465_outsw, | |
16074 | + .mv_outsl = hd64465_outsl, | |
16075 | + | |
16076 | + .mv_readb = generic_readb, | |
16077 | + .mv_readw = generic_readw, | |
16078 | + .mv_readl = generic_readl, | |
16079 | + .mv_writeb = generic_writeb, | |
16080 | + .mv_writew = generic_writew, | |
16081 | + .mv_writel = generic_writel, | |
16082 | ||
16083 | - mv_irq_demux: hd64465_irq_demux, | |
16084 | + .mv_irq_demux = hd64465_irq_demux, | |
16085 | ||
16086 | - mv_rtc_gettimeofday: sh_rtc_gettimeofday, | |
16087 | - mv_rtc_settimeofday: sh_rtc_settimeofday, | |
16088 | + .mv_rtc_gettimeofday = sh_rtc_gettimeofday, | |
16089 | + .mv_rtc_settimeofday = sh_rtc_settimeofday, | |
16090 | }; | |
16091 | ALIAS_MV(dmida) | |
16092 | ||
16093 | diff -Nru a/arch/sh/boards/dreamcast/irq.c b/arch/sh/boards/dreamcast/irq.c | |
16094 | --- a/arch/sh/boards/dreamcast/irq.c Sat Jun 14 11:02:09 2003 | |
16095 | +++ b/arch/sh/boards/dreamcast/irq.c Sun Aug 31 16:14:08 2003 | |
16096 | @@ -110,13 +110,13 @@ | |
16097 | } | |
16098 | ||
16099 | struct hw_interrupt_type systemasic_int = { | |
16100 | - typename: "System ASIC", | |
16101 | - startup: startup_systemasic_irq, | |
16102 | - shutdown: shutdown_systemasic_irq, | |
16103 | - enable: enable_systemasic_irq, | |
16104 | - disable: disable_systemasic_irq, | |
16105 | - ack: ack_systemasic_irq, | |
16106 | - end: end_systemasic_irq, | |
16107 | + .typename = "System ASIC", | |
16108 | + .startup = startup_systemasic_irq, | |
16109 | + .shutdown = shutdown_systemasic_irq, | |
16110 | + .enable = enable_systemasic_irq, | |
16111 | + .disable = disable_systemasic_irq, | |
16112 | + .ack = ack_systemasic_irq, | |
16113 | + .end = end_systemasic_irq, | |
16114 | }; | |
16115 | ||
16116 | /* | |
16117 | diff -Nru a/arch/sh/boards/dreamcast/mach.c b/arch/sh/boards/dreamcast/mach.c | |
16118 | --- a/arch/sh/boards/dreamcast/mach.c Mon May 19 16:04:36 2003 | |
16119 | +++ b/arch/sh/boards/dreamcast/mach.c Sun Aug 31 16:14:08 2003 | |
16120 | @@ -21,40 +21,40 @@ | |
16121 | */ | |
16122 | ||
16123 | struct sh_machine_vector mv_dreamcast __initmv = { | |
16124 | - mv_nr_irqs: NR_IRQS, | |
16125 | + .mv_nr_irqs = NR_IRQS, | |
16126 | ||
16127 | - mv_inb: generic_inb, | |
16128 | - mv_inw: generic_inw, | |
16129 | - mv_inl: generic_inl, | |
16130 | - mv_outb: generic_outb, | |
16131 | - mv_outw: generic_outw, | |
16132 | - mv_outl: generic_outl, | |
16133 | - | |
16134 | - mv_inb_p: generic_inb_p, | |
16135 | - mv_inw_p: generic_inw, | |
16136 | - mv_inl_p: generic_inl, | |
16137 | - mv_outb_p: generic_outb_p, | |
16138 | - mv_outw_p: generic_outw, | |
16139 | - mv_outl_p: generic_outl, | |
16140 | - | |
16141 | - mv_insb: generic_insb, | |
16142 | - mv_insw: generic_insw, | |
16143 | - mv_insl: generic_insl, | |
16144 | - mv_outsb: generic_outsb, | |
16145 | - mv_outsw: generic_outsw, | |
16146 | - mv_outsl: generic_outsl, | |
16147 | - | |
16148 | - mv_readb: generic_readb, | |
16149 | - mv_readw: generic_readw, | |
16150 | - mv_readl: generic_readl, | |
16151 | - mv_writeb: generic_writeb, | |
16152 | - mv_writew: generic_writew, | |
16153 | - mv_writel: generic_writel, | |
16154 | + .mv_inb = generic_inb, | |
16155 | + .mv_inw = generic_inw, | |
16156 | + .mv_inl = generic_inl, | |
16157 | + .mv_outb = generic_outb, | |
16158 | + .mv_outw = generic_outw, | |
16159 | + .mv_outl = generic_outl, | |
16160 | + | |
16161 | + .mv_inb_p = generic_inb_p, | |
16162 | + .mv_inw_p = generic_inw, | |
16163 | + .mv_inl_p = generic_inl, | |
16164 | + .mv_outb_p = generic_outb_p, | |
16165 | + .mv_outw_p = generic_outw, | |
16166 | + .mv_outl_p = generic_outl, | |
16167 | + | |
16168 | + .mv_insb = generic_insb, | |
16169 | + .mv_insw = generic_insw, | |
16170 | + .mv_insl = generic_insl, | |
16171 | + .mv_outsb = generic_outsb, | |
16172 | + .mv_outsw = generic_outsw, | |
16173 | + .mv_outsl = generic_outsl, | |
16174 | + | |
16175 | + .mv_readb = generic_readb, | |
16176 | + .mv_readw = generic_readw, | |
16177 | + .mv_readl = generic_readl, | |
16178 | + .mv_writeb = generic_writeb, | |
16179 | + .mv_writew = generic_writew, | |
16180 | + .mv_writel = generic_writel, | |
16181 | ||
16182 | - mv_ioremap: generic_ioremap, | |
16183 | - mv_iounmap: generic_iounmap, | |
16184 | + .mv_ioremap = generic_ioremap, | |
16185 | + .mv_iounmap = generic_iounmap, | |
16186 | ||
16187 | - mv_isa_port2addr: dreamcast_isa_port2addr, | |
16188 | - mv_irq_demux: systemasic_irq_demux, | |
16189 | + .mv_isa_port2addr = dreamcast_isa_port2addr, | |
16190 | + .mv_irq_demux = systemasic_irq_demux, | |
16191 | }; | |
16192 | ALIAS_MV(dreamcast) | |
16193 | diff -Nru a/arch/sh/boards/ec3104/irq.c b/arch/sh/boards/ec3104/irq.c | |
16194 | --- a/arch/sh/boards/ec3104/irq.c Sat Jun 14 11:02:09 2003 | |
16195 | +++ b/arch/sh/boards/ec3104/irq.c Sun Aug 31 16:14:08 2003 | |
16196 | @@ -169,13 +169,13 @@ | |
16197 | } | |
16198 | ||
16199 | static struct hw_interrupt_type ec3104_int = { | |
16200 | - typename: "EC3104", | |
16201 | - enable: enable_ec3104_irq, | |
16202 | - disable: disable_ec3104_irq, | |
16203 | - ack: mask_and_ack_ec3104_irq, | |
16204 | - end: end_ec3104_irq, | |
16205 | - startup: startup_ec3104_irq, | |
16206 | - shutdown: shutdown_ec3104_irq, | |
16207 | + .typename = "EC3104", | |
16208 | + .enable = enable_ec3104_irq, | |
16209 | + .disable = disable_ec3104_irq, | |
16210 | + .ack = mask_and_ack_ec3104_irq, | |
16211 | + .end = end_ec3104_irq, | |
16212 | + .startup = startup_ec3104_irq, | |
16213 | + .shutdown = shutdown_ec3104_irq, | |
16214 | }; | |
16215 | ||
16216 | /* Yuck. the _demux API is ugly */ | |
16217 | diff -Nru a/arch/sh/boards/ec3104/mach.c b/arch/sh/boards/ec3104/mach.c | |
16218 | --- a/arch/sh/boards/ec3104/mach.c Sat Jan 19 10:54:19 2002 | |
16219 | +++ b/arch/sh/boards/ec3104/mach.c Sun Aug 31 16:14:08 2003 | |
16220 | @@ -28,42 +28,42 @@ | |
16221 | */ | |
16222 | ||
16223 | struct sh_machine_vector mv_ec3104 __initmv = { | |
16224 | - mv_name: "EC3104", | |
16225 | + .mv_name = "EC3104", | |
16226 | ||
16227 | - mv_nr_irqs: 96, | |
16228 | + .mv_nr_irqs = 96, | |
16229 | ||
16230 | - mv_inb: ec3104_inb, | |
16231 | - mv_inw: ec3104_inw, | |
16232 | - mv_inl: ec3104_inl, | |
16233 | - mv_outb: ec3104_outb, | |
16234 | - mv_outw: ec3104_outw, | |
16235 | - mv_outl: ec3104_outl, | |
16236 | - | |
16237 | - mv_inb_p: generic_inb_p, | |
16238 | - mv_inw_p: generic_inw, | |
16239 | - mv_inl_p: generic_inl, | |
16240 | - mv_outb_p: generic_outb_p, | |
16241 | - mv_outw_p: generic_outw, | |
16242 | - mv_outl_p: generic_outl, | |
16243 | - | |
16244 | - mv_insb: generic_insb, | |
16245 | - mv_insw: generic_insw, | |
16246 | - mv_insl: generic_insl, | |
16247 | - mv_outsb: generic_outsb, | |
16248 | - mv_outsw: generic_outsw, | |
16249 | - mv_outsl: generic_outsl, | |
16250 | - | |
16251 | - mv_readb: generic_readb, | |
16252 | - mv_readw: generic_readw, | |
16253 | - mv_readl: generic_readl, | |
16254 | - mv_writeb: generic_writeb, | |
16255 | - mv_writew: generic_writew, | |
16256 | - mv_writel: generic_writel, | |
16257 | + .mv_inb = ec3104_inb, | |
16258 | + .mv_inw = ec3104_inw, | |
16259 | + .mv_inl = ec3104_inl, | |
16260 | + .mv_outb = ec3104_outb, | |
16261 | + .mv_outw = ec3104_outw, | |
16262 | + .mv_outl = ec3104_outl, | |
16263 | + | |
16264 | + .mv_inb_p = generic_inb_p, | |
16265 | + .mv_inw_p = generic_inw, | |
16266 | + .mv_inl_p = generic_inl, | |
16267 | + .mv_outb_p = generic_outb_p, | |
16268 | + .mv_outw_p = generic_outw, | |
16269 | + .mv_outl_p = generic_outl, | |
16270 | + | |
16271 | + .mv_insb = generic_insb, | |
16272 | + .mv_insw = generic_insw, | |
16273 | + .mv_insl = generic_insl, | |
16274 | + .mv_outsb = generic_outsb, | |
16275 | + .mv_outsw = generic_outsw, | |
16276 | + .mv_outsl = generic_outsl, | |
16277 | + | |
16278 | + .mv_readb = generic_readb, | |
16279 | + .mv_readw = generic_readw, | |
16280 | + .mv_readl = generic_readl, | |
16281 | + .mv_writeb = generic_writeb, | |
16282 | + .mv_writew = generic_writew, | |
16283 | + .mv_writel = generic_writel, | |
16284 | ||
16285 | - mv_irq_demux: ec3104_irq_demux, | |
16286 | + .mv_irq_demux = ec3104_irq_demux, | |
16287 | ||
16288 | - mv_rtc_gettimeofday: sh_rtc_gettimeofday, | |
16289 | - mv_rtc_settimeofday: sh_rtc_settimeofday, | |
16290 | + .mv_rtc_gettimeofday = sh_rtc_gettimeofday, | |
16291 | + .mv_rtc_settimeofday = sh_rtc_settimeofday, | |
16292 | }; | |
16293 | ||
16294 | ALIAS_MV(ec3104) | |
16295 | diff -Nru a/arch/sh/boards/harp/mach.c b/arch/sh/boards/harp/mach.c | |
16296 | --- a/arch/sh/boards/harp/mach.c Sat Mar 2 08:57:07 2002 | |
16297 | +++ b/arch/sh/boards/harp/mach.c Sun Aug 31 16:14:08 2003 | |
16298 | @@ -26,46 +26,46 @@ | |
16299 | */ | |
16300 | ||
16301 | struct sh_machine_vector mv_harp __initmv = { | |
16302 | - mv_nr_irqs: 89 + HD64465_IRQ_NUM, | |
16303 | + .mv_nr_irqs = 89 + HD64465_IRQ_NUM, | |
16304 | ||
16305 | - mv_inb: hd64465_inb, | |
16306 | - mv_inw: hd64465_inw, | |
16307 | - mv_inl: hd64465_inl, | |
16308 | - mv_outb: hd64465_outb, | |
16309 | - mv_outw: hd64465_outw, | |
16310 | - mv_outl: hd64465_outl, | |
16311 | - | |
16312 | - mv_inb_p: hd64465_inb_p, | |
16313 | - mv_inw_p: hd64465_inw, | |
16314 | - mv_inl_p: hd64465_inl, | |
16315 | - mv_outb_p: hd64465_outb_p, | |
16316 | - mv_outw_p: hd64465_outw, | |
16317 | - mv_outl_p: hd64465_outl, | |
16318 | - | |
16319 | - mv_insb: hd64465_insb, | |
16320 | - mv_insw: hd64465_insw, | |
16321 | - mv_insl: hd64465_insl, | |
16322 | - mv_outsb: hd64465_outsb, | |
16323 | - mv_outsw: hd64465_outsw, | |
16324 | - mv_outsl: hd64465_outsl, | |
16325 | - | |
16326 | - mv_readb: generic_readb, | |
16327 | - mv_readw: generic_readw, | |
16328 | - mv_readl: generic_readl, | |
16329 | - mv_writeb: generic_writeb, | |
16330 | - mv_writew: generic_writew, | |
16331 | - mv_writel: generic_writel, | |
16332 | + .mv_inb = hd64465_inb, | |
16333 | + .mv_inw = hd64465_inw, | |
16334 | + .mv_inl = hd64465_inl, | |
16335 | + .mv_outb = hd64465_outb, | |
16336 | + .mv_outw = hd64465_outw, | |
16337 | + .mv_outl = hd64465_outl, | |
16338 | + | |
16339 | + .mv_inb_p = hd64465_inb_p, | |
16340 | + .mv_inw_p = hd64465_inw, | |
16341 | + .mv_inl_p = hd64465_inl, | |
16342 | + .mv_outb_p = hd64465_outb_p, | |
16343 | + .mv_outw_p = hd64465_outw, | |
16344 | + .mv_outl_p = hd64465_outl, | |
16345 | + | |
16346 | + .mv_insb = hd64465_insb, | |
16347 | + .mv_insw = hd64465_insw, | |
16348 | + .mv_insl = hd64465_insl, | |
16349 | + .mv_outsb = hd64465_outsb, | |
16350 | + .mv_outsw = hd64465_outsw, | |
16351 | + .mv_outsl = hd64465_outsl, | |
16352 | + | |
16353 | + .mv_readb = generic_readb, | |
16354 | + .mv_readw = generic_readw, | |
16355 | + .mv_readl = generic_readl, | |
16356 | + .mv_writeb = generic_writeb, | |
16357 | + .mv_writew = generic_writew, | |
16358 | + .mv_writel = generic_writel, | |
16359 | ||
16360 | - mv_ioremap: generic_ioremap, | |
16361 | - mv_iounmap: generic_iounmap, | |
16362 | + .mv_ioremap = generic_ioremap, | |
16363 | + .mv_iounmap = generic_iounmap, | |
16364 | ||
16365 | - mv_isa_port2addr: hd64465_isa_port2addr, | |
16366 | + .mv_isa_port2addr = hd64465_isa_port2addr, | |
16367 | ||
16368 | #ifdef CONFIG_PCI | |
16369 | - mv_init_irq: init_harp_irq, | |
16370 | + .mv_init_irq = init_harp_irq, | |
16371 | #endif | |
16372 | #ifdef CONFIG_HEARTBEAT | |
16373 | - mv_heartbeat: heartbeat_harp, | |
16374 | + .mv_heartbeat = heartbeat_harp, | |
16375 | #endif | |
16376 | }; | |
16377 | ||
16378 | diff -Nru a/arch/sh/boards/hp6xx/hp620/mach.c b/arch/sh/boards/hp6xx/hp620/mach.c | |
16379 | --- a/arch/sh/boards/hp6xx/hp620/mach.c Mon May 19 16:04:36 2003 | |
16380 | +++ b/arch/sh/boards/hp6xx/hp620/mach.c Sun Aug 31 16:14:08 2003 | |
16381 | @@ -24,41 +24,41 @@ | |
16382 | */ | |
16383 | ||
16384 | struct sh_machine_vector mv_hp620 __initmv = { | |
16385 | - mv_name: "hp620", | |
16386 | + .mv_name = "hp620", | |
16387 | ||
16388 | - mv_nr_irqs: HD64461_IRQBASE+HD64461_IRQ_NUM, | |
16389 | + .mv_nr_irqs = HD64461_IRQBASE+HD64461_IRQ_NUM, | |
16390 | ||
16391 | - mv_inb: hd64461_inb, | |
16392 | - mv_inw: hd64461_inw, | |
16393 | - mv_inl: hd64461_inl, | |
16394 | - mv_outb: hd64461_outb, | |
16395 | - mv_outw: hd64461_outw, | |
16396 | - mv_outl: hd64461_outl, | |
16397 | - | |
16398 | - mv_inb_p: hd64461_inb_p, | |
16399 | - mv_inw_p: hd64461_inw, | |
16400 | - mv_inl_p: hd64461_inl, | |
16401 | - mv_outb_p: hd64461_outb_p, | |
16402 | - mv_outw_p: hd64461_outw, | |
16403 | - mv_outl_p: hd64461_outl, | |
16404 | - | |
16405 | - mv_insb: hd64461_insb, | |
16406 | - mv_insw: hd64461_insw, | |
16407 | - mv_insl: hd64461_insl, | |
16408 | - mv_outsb: hd64461_outsb, | |
16409 | - mv_outsw: hd64461_outsw, | |
16410 | - mv_outsl: hd64461_outsl, | |
16411 | - | |
16412 | - mv_readb: generic_readb, | |
16413 | - mv_readw: generic_readw, | |
16414 | - mv_readl: generic_readl, | |
16415 | - mv_writeb: generic_writeb, | |
16416 | - mv_writew: generic_writew, | |
16417 | - mv_writel: generic_writel, | |
16418 | + .mv_inb = hd64461_inb, | |
16419 | + .mv_inw = hd64461_inw, | |
16420 | + .mv_inl = hd64461_inl, | |
16421 | + .mv_outb = hd64461_outb, | |
16422 | + .mv_outw = hd64461_outw, | |
16423 | + .mv_outl = hd64461_outl, | |
16424 | + | |
16425 | + .mv_inb_p = hd64461_inb_p, | |
16426 | + .mv_inw_p = hd64461_inw, | |
16427 | + .mv_inl_p = hd64461_inl, | |
16428 | + .mv_outb_p = hd64461_outb_p, | |
16429 | + .mv_outw_p = hd64461_outw, | |
16430 | + .mv_outl_p = hd64461_outl, | |
16431 | + | |
16432 | + .mv_insb = hd64461_insb, | |
16433 | + .mv_insw = hd64461_insw, | |
16434 | + .mv_insl = hd64461_insl, | |
16435 | + .mv_outsb = hd64461_outsb, | |
16436 | + .mv_outsw = hd64461_outsw, | |
16437 | + .mv_outsl = hd64461_outsl, | |
16438 | + | |
16439 | + .mv_readb = generic_readb, | |
16440 | + .mv_readw = generic_readw, | |
16441 | + .mv_readl = generic_readl, | |
16442 | + .mv_writeb = generic_writeb, | |
16443 | + .mv_writew = generic_writew, | |
16444 | + .mv_writel = generic_writel, | |
16445 | ||
16446 | - mv_irq_demux: hd64461_irq_demux, | |
16447 | + .mv_irq_demux = hd64461_irq_demux, | |
16448 | ||
16449 | - mv_rtc_gettimeofday: sh_rtc_gettimeofday, | |
16450 | - mv_rtc_settimeofday: sh_rtc_settimeofday, | |
16451 | + .mv_rtc_gettimeofday = sh_rtc_gettimeofday, | |
16452 | + .mv_rtc_settimeofday = sh_rtc_settimeofday, | |
16453 | }; | |
16454 | ALIAS_MV(hp620) | |
16455 | diff -Nru a/arch/sh/boards/hp6xx/hp680/mach.c b/arch/sh/boards/hp6xx/hp680/mach.c | |
16456 | --- a/arch/sh/boards/hp6xx/hp680/mach.c Mon May 19 16:04:37 2003 | |
16457 | +++ b/arch/sh/boards/hp6xx/hp680/mach.c Sun Aug 31 16:14:08 2003 | |
16458 | @@ -20,41 +20,41 @@ | |
16459 | #include <asm/irq.h> | |
16460 | ||
16461 | struct sh_machine_vector mv_hp680 __initmv = { | |
16462 | - mv_name: "hp680", | |
16463 | + .mv_name = "hp680", | |
16464 | ||
16465 | - mv_nr_irqs: HD64461_IRQBASE+HD64461_IRQ_NUM, | |
16466 | + .mv_nr_irqs = HD64461_IRQBASE+HD64461_IRQ_NUM, | |
16467 | ||
16468 | - mv_inb: hd64461_inb, | |
16469 | - mv_inw: hd64461_inw, | |
16470 | - mv_inl: hd64461_inl, | |
16471 | - mv_outb: hd64461_outb, | |
16472 | - mv_outw: hd64461_outw, | |
16473 | - mv_outl: hd64461_outl, | |
16474 | - | |
16475 | - mv_inb_p: hd64461_inb_p, | |
16476 | - mv_inw_p: hd64461_inw, | |
16477 | - mv_inl_p: hd64461_inl, | |
16478 | - mv_outb_p: hd64461_outb_p, | |
16479 | - mv_outw_p: hd64461_outw, | |
16480 | - mv_outl_p: hd64461_outl, | |
16481 | - | |
16482 | - mv_insb: hd64461_insb, | |
16483 | - mv_insw: hd64461_insw, | |
16484 | - mv_insl: hd64461_insl, | |
16485 | - mv_outsb: hd64461_outsb, | |
16486 | - mv_outsw: hd64461_outsw, | |
16487 | - mv_outsl: hd64461_outsl, | |
16488 | - | |
16489 | - mv_readb: generic_readb, | |
16490 | - mv_readw: generic_readw, | |
16491 | - mv_readl: generic_readl, | |
16492 | - mv_writeb: generic_writeb, | |
16493 | - mv_writew: generic_writew, | |
16494 | - mv_writel: generic_writel, | |
16495 | + .mv_inb = hd64461_inb, | |
16496 | + .mv_inw = hd64461_inw, | |
16497 | + .mv_inl = hd64461_inl, | |
16498 | + .mv_outb = hd64461_outb, | |
16499 | + .mv_outw = hd64461_outw, | |
16500 | + .mv_outl = hd64461_outl, | |
16501 | + | |
16502 | + .mv_inb_p = hd64461_inb_p, | |
16503 | + .mv_inw_p = hd64461_inw, | |
16504 | + .mv_inl_p = hd64461_inl, | |
16505 | + .mv_outb_p = hd64461_outb_p, | |
16506 | + .mv_outw_p = hd64461_outw, | |
16507 | + .mv_outl_p = hd64461_outl, | |
16508 | + | |
16509 | + .mv_insb = hd64461_insb, | |
16510 | + .mv_insw = hd64461_insw, | |
16511 | + .mv_insl = hd64461_insl, | |
16512 | + .mv_outsb = hd64461_outsb, | |
16513 | + .mv_outsw = hd64461_outsw, | |
16514 | + .mv_outsl = hd64461_outsl, | |
16515 | + | |
16516 | + .mv_readb = generic_readb, | |
16517 | + .mv_readw = generic_readw, | |
16518 | + .mv_readl = generic_readl, | |
16519 | + .mv_writeb = generic_writeb, | |
16520 | + .mv_writew = generic_writew, | |
16521 | + .mv_writel = generic_writel, | |
16522 | ||
16523 | - mv_irq_demux: hd64461_irq_demux, | |
16524 | + .mv_irq_demux = hd64461_irq_demux, | |
16525 | ||
16526 | - mv_rtc_gettimeofday: sh_rtc_gettimeofday, | |
16527 | - mv_rtc_settimeofday: sh_rtc_settimeofday, | |
16528 | + .mv_rtc_gettimeofday = sh_rtc_gettimeofday, | |
16529 | + .mv_rtc_settimeofday = sh_rtc_settimeofday, | |
16530 | }; | |
16531 | ALIAS_MV(hp680) | |
16532 | diff -Nru a/arch/sh/boards/hp6xx/hp690/mach.c b/arch/sh/boards/hp6xx/hp690/mach.c | |
16533 | --- a/arch/sh/boards/hp6xx/hp690/mach.c Mon May 19 16:04:37 2003 | |
16534 | +++ b/arch/sh/boards/hp6xx/hp690/mach.c Sun Aug 31 16:14:08 2003 | |
16535 | @@ -20,41 +20,41 @@ | |
16536 | #include <asm/irq.h> | |
16537 | ||
16538 | struct sh_machine_vector mv_hp690 __initmv = { | |
16539 | - mv_name: "hp690", | |
16540 | + .mv_name = "hp690", | |
16541 | ||
16542 | - mv_nr_irqs: HD64461_IRQBASE+HD64461_IRQ_NUM, | |
16543 | + .mv_nr_irqs = HD64461_IRQBASE+HD64461_IRQ_NUM, | |
16544 | ||
16545 | - mv_inb: hd64461_inb, | |
16546 | - mv_inw: hd64461_inw, | |
16547 | - mv_inl: hd64461_inl, | |
16548 | - mv_outb: hd64461_outb, | |
16549 | - mv_outw: hd64461_outw, | |
16550 | - mv_outl: hd64461_outl, | |
16551 | - | |
16552 | - mv_inb_p: hd64461_inb_p, | |
16553 | - mv_inw_p: hd64461_inw, | |
16554 | - mv_inl_p: hd64461_inl, | |
16555 | - mv_outb_p: hd64461_outb_p, | |
16556 | - mv_outw_p: hd64461_outw, | |
16557 | - mv_outl_p: hd64461_outl, | |
16558 | - | |
16559 | - mv_insb: hd64461_insb, | |
16560 | - mv_insw: hd64461_insw, | |
16561 | - mv_insl: hd64461_insl, | |
16562 | - mv_outsb: hd64461_outsb, | |
16563 | - mv_outsw: hd64461_outsw, | |
16564 | - mv_outsl: hd64461_outsl, | |
16565 | - | |
16566 | - mv_readb: generic_readb, | |
16567 | - mv_readw: generic_readw, | |
16568 | - mv_readl: generic_readl, | |
16569 | - mv_writeb: generic_writeb, | |
16570 | - mv_writew: generic_writew, | |
16571 | - mv_writel: generic_writel, | |
16572 | + .mv_inb = hd64461_inb, | |
16573 | + .mv_inw = hd64461_inw, | |
16574 | + .mv_inl = hd64461_inl, | |
16575 | + .mv_outb = hd64461_outb, | |
16576 | + .mv_outw = hd64461_outw, | |
16577 | + .mv_outl = hd64461_outl, | |
16578 | + | |
16579 | + .mv_inb_p = hd64461_inb_p, | |
16580 | + .mv_inw_p = hd64461_inw, | |
16581 | + .mv_inl_p = hd64461_inl, | |
16582 | + .mv_outb_p = hd64461_outb_p, | |
16583 | + .mv_outw_p = hd64461_outw, | |
16584 | + .mv_outl_p = hd64461_outl, | |
16585 | + | |
16586 | + .mv_insb = hd64461_insb, | |
16587 | + .mv_insw = hd64461_insw, | |
16588 | + .mv_insl = hd64461_insl, | |
16589 | + .mv_outsb = hd64461_outsb, | |
16590 | + .mv_outsw = hd64461_outsw, | |
16591 | + .mv_outsl = hd64461_outsl, | |
16592 | + | |
16593 | + .mv_readb = generic_readb, | |
16594 | + .mv_readw = generic_readw, | |
16595 | + .mv_readl = generic_readl, | |
16596 | + .mv_writeb = generic_writeb, | |
16597 | + .mv_writew = generic_writew, | |
16598 | + .mv_writel = generic_writel, | |
16599 | ||
16600 | - mv_irq_demux: hd64461_irq_demux, | |
16601 | + .mv_irq_demux = hd64461_irq_demux, | |
16602 | ||
16603 | - mv_rtc_gettimeofday: sh_rtc_gettimeofday, | |
16604 | - mv_rtc_settimeofday: sh_rtc_settimeofday, | |
16605 | + .mv_rtc_gettimeofday = sh_rtc_gettimeofday, | |
16606 | + .mv_rtc_settimeofday = sh_rtc_settimeofday, | |
16607 | }; | |
16608 | ALIAS_MV(hp690) | |
16609 | diff -Nru a/arch/sh/boards/overdrive/mach.c b/arch/sh/boards/overdrive/mach.c | |
16610 | --- a/arch/sh/boards/overdrive/mach.c Sat Jun 14 11:02:09 2003 | |
16611 | +++ b/arch/sh/boards/overdrive/mach.c Sun Aug 31 16:14:08 2003 | |
16612 | @@ -28,46 +28,46 @@ | |
16613 | */ | |
16614 | ||
16615 | struct sh_machine_vector mv_od __initmv = { | |
16616 | - mv_nr_irqs: 48, | |
16617 | + .mv_nr_irqs = 48, | |
16618 | ||
16619 | - mv_inb: od_inb, | |
16620 | - mv_inw: od_inw, | |
16621 | - mv_inl: od_inl, | |
16622 | - mv_outb: od_outb, | |
16623 | - mv_outw: od_outw, | |
16624 | - mv_outl: od_outl, | |
16625 | - | |
16626 | - mv_inb_p: od_inb_p, | |
16627 | - mv_inw_p: od_inw_p, | |
16628 | - mv_inl_p: od_inl_p, | |
16629 | - mv_outb_p: od_outb_p, | |
16630 | - mv_outw_p: od_outw_p, | |
16631 | - mv_outl_p: od_outl_p, | |
16632 | - | |
16633 | - mv_insb: od_insb, | |
16634 | - mv_insw: od_insw, | |
16635 | - mv_insl: od_insl, | |
16636 | - mv_outsb: od_outsb, | |
16637 | - mv_outsw: od_outsw, | |
16638 | - mv_outsl: od_outsl, | |
16639 | - | |
16640 | - mv_readb: generic_readb, | |
16641 | - mv_readw: generic_readw, | |
16642 | - mv_readl: generic_readl, | |
16643 | - mv_writeb: generic_writeb, | |
16644 | - mv_writew: generic_writew, | |
16645 | - mv_writel: generic_writel, | |
16646 | + .mv_inb = od_inb, | |
16647 | + .mv_inw = od_inw, | |
16648 | + .mv_inl = od_inl, | |
16649 | + .mv_outb = od_outb, | |
16650 | + .mv_outw = od_outw, | |
16651 | + .mv_outl = od_outl, | |
16652 | + | |
16653 | + .mv_inb_p = od_inb_p, | |
16654 | + .mv_inw_p = od_inw_p, | |
16655 | + .mv_inl_p = od_inl_p, | |
16656 | + .mv_outb_p = od_outb_p, | |
16657 | + .mv_outw_p = od_outw_p, | |
16658 | + .mv_outl_p = od_outl_p, | |
16659 | + | |
16660 | + .mv_insb = od_insb, | |
16661 | + .mv_insw = od_insw, | |
16662 | + .mv_insl = od_insl, | |
16663 | + .mv_outsb = od_outsb, | |
16664 | + .mv_outsw = od_outsw, | |
16665 | + .mv_outsl = od_outsl, | |
16666 | + | |
16667 | + .mv_readb = generic_readb, | |
16668 | + .mv_readw = generic_readw, | |
16669 | + .mv_readl = generic_readl, | |
16670 | + .mv_writeb = generic_writeb, | |
16671 | + .mv_writew = generic_writew, | |
16672 | + .mv_writel = generic_writel, | |
16673 | ||
16674 | - mv_ioremap: generic_ioremap, | |
16675 | - mv_iounmap: generic_iounmap, | |
16676 | + .mv_ioremap = generic_ioremap, | |
16677 | + .mv_iounmap = generic_iounmap, | |
16678 | ||
16679 | - mv_isa_port2addr: generic_isa_port2addr, | |
16680 | + .mv_isa_port2addr = generic_isa_port2addr, | |
16681 | ||
16682 | #ifdef CONFIG_PCI | |
16683 | - mv_init_irq: init_overdrive_irq, | |
16684 | + .mv_init_irq = init_overdrive_irq, | |
16685 | #endif | |
16686 | #ifdef CONFIG_HEARTBEAT | |
16687 | - mv_heartbeat: heartbeat_od, | |
16688 | + .mv_heartbeat = heartbeat_od, | |
16689 | #endif | |
16690 | }; | |
16691 | ||
16692 | diff -Nru a/arch/sh/boards/saturn/irq.c b/arch/sh/boards/saturn/irq.c | |
16693 | --- a/arch/sh/boards/saturn/irq.c Sat Jun 14 11:02:09 2003 | |
16694 | +++ b/arch/sh/boards/saturn/irq.c Sun Aug 31 16:14:08 2003 | |
16695 | @@ -102,13 +102,13 @@ | |
16696 | } | |
16697 | ||
16698 | static struct hw_interrupt_type saturn_int = { | |
16699 | - typename: "Saturn", | |
16700 | - enable: enable_saturn_irq, | |
16701 | - disable: disable_saturn_irq, | |
16702 | - ack: mask_and_ack_saturn_irq, | |
16703 | - end: end_saturn_irq, | |
16704 | - startup: startup_saturn_irq, | |
16705 | - shutdown: shutdown_saturn_irq, | |
16706 | + .typename = "Saturn", | |
16707 | + .enable = enable_saturn_irq, | |
16708 | + .disable = disable_saturn_irq, | |
16709 | + .ack = mask_and_ack_saturn_irq, | |
16710 | + .end = end_saturn_irq, | |
16711 | + .startup = startup_saturn_irq, | |
16712 | + .shutdown = shutdown_saturn_irq, | |
16713 | }; | |
16714 | ||
16715 | int saturn_irq_demux(int irq_nr) | |
16716 | diff -Nru a/arch/sh/boards/saturn/mach.c b/arch/sh/boards/saturn/mach.c | |
16717 | --- a/arch/sh/boards/saturn/mach.c Mon May 19 16:04:39 2003 | |
16718 | +++ b/arch/sh/boards/saturn/mach.c Sun Aug 31 16:14:08 2003 | |
16719 | @@ -18,41 +18,41 @@ | |
16720 | * The Machine Vector | |
16721 | */ | |
16722 | struct sh_machine_vector mv_saturn __initmv = { | |
16723 | - mv_nr_irqs: 80, /* Fix this later */ | |
16724 | + .mv_nr_irqs = 80, /* Fix this later */ | |
16725 | ||
16726 | - mv_inb: generic_inb, | |
16727 | - mv_inw: generic_inw, | |
16728 | - mv_inl: generic_inl, | |
16729 | - mv_outb: generic_outb, | |
16730 | - mv_outw: generic_outw, | |
16731 | - mv_outl: generic_outl, | |
16732 | - | |
16733 | - mv_inb_p: generic_inb_p, | |
16734 | - mv_inw_p: generic_inw_p, | |
16735 | - mv_inl_p: generic_inl_p, | |
16736 | - mv_outb_p: generic_outb_p, | |
16737 | - mv_outw_p: generic_outw_p, | |
16738 | - mv_outl_p: generic_outl_p, | |
16739 | - | |
16740 | - mv_insb: generic_insb, | |
16741 | - mv_insw: generic_insw, | |
16742 | - mv_insl: generic_insl, | |
16743 | - mv_outsb: generic_outsb, | |
16744 | - mv_outsw: generic_outsw, | |
16745 | - mv_outsl: generic_outsl, | |
16746 | - | |
16747 | - mv_readb: generic_readb, | |
16748 | - mv_readw: generic_readw, | |
16749 | - mv_readl: generic_readl, | |
16750 | - mv_writeb: generic_writeb, | |
16751 | - mv_writew: generic_writew, | |
16752 | - mv_writel: generic_writel, | |
16753 | + .mv_inb = generic_inb, | |
16754 | + .mv_inw = generic_inw, | |
16755 | + .mv_inl = generic_inl, | |
16756 | + .mv_outb = generic_outb, | |
16757 | + .mv_outw = generic_outw, | |
16758 | + .mv_outl = generic_outl, | |
16759 | + | |
16760 | + .mv_inb_p = generic_inb_p, | |
16761 | + .mv_inw_p = generic_inw_p, | |
16762 | + .mv_inl_p = generic_inl_p, | |
16763 | + .mv_outb_p = generic_outb_p, | |
16764 | + .mv_outw_p = generic_outw_p, | |
16765 | + .mv_outl_p = generic_outl_p, | |
16766 | + | |
16767 | + .mv_insb = generic_insb, | |
16768 | + .mv_insw = generic_insw, | |
16769 | + .mv_insl = generic_insl, | |
16770 | + .mv_outsb = generic_outsb, | |
16771 | + .mv_outsw = generic_outsw, | |
16772 | + .mv_outsl = generic_outsl, | |
16773 | + | |
16774 | + .mv_readb = generic_readb, | |
16775 | + .mv_readw = generic_readw, | |
16776 | + .mv_readl = generic_readl, | |
16777 | + .mv_writeb = generic_writeb, | |
16778 | + .mv_writew = generic_writew, | |
16779 | + .mv_writel = generic_writel, | |
16780 | ||
16781 | - mv_isa_port2addr: saturn_isa_port2addr, | |
16782 | - mv_irq_demux: saturn_irq_demux, | |
16783 | + .mv_isa_port2addr = saturn_isa_port2addr, | |
16784 | + .mv_irq_demux = saturn_irq_demux, | |
16785 | ||
16786 | - mv_ioremap: saturn_ioremap, | |
16787 | - mv_iounmap: saturn_iounmap, | |
16788 | + .mv_ioremap = saturn_ioremap, | |
16789 | + .mv_iounmap = saturn_iounmap, | |
16790 | }; | |
16791 | ||
16792 | ALIAS_MV(saturn) | |
16793 | diff -Nru a/arch/sh/boards/se/770x/mach.c b/arch/sh/boards/se/770x/mach.c | |
16794 | --- a/arch/sh/boards/se/770x/mach.c Mon May 19 16:04:39 2003 | |
16795 | +++ b/arch/sh/boards/se/770x/mach.c Sun Aug 31 16:14:08 2003 | |
16796 | @@ -28,49 +28,49 @@ | |
16797 | ||
16798 | struct sh_machine_vector mv_se __initmv = { | |
16799 | #if defined(CONFIG_CPU_SH4) | |
16800 | - mv_nr_irqs: 48, | |
16801 | + .mv_nr_irqs = 48, | |
16802 | #elif defined(CONFIG_CPU_SUBTYPE_SH7708) | |
16803 | - mv_nr_irqs: 32, | |
16804 | + .mv_nr_irqs = 32, | |
16805 | #elif defined(CONFIG_CPU_SUBTYPE_SH7709) | |
16806 | - mv_nr_irqs: 61, | |
16807 | + .mv_nr_irqs = 61, | |
16808 | #endif | |
16809 | ||
16810 | - mv_inb: se_inb, | |
16811 | - mv_inw: se_inw, | |
16812 | - mv_inl: se_inl, | |
16813 | - mv_outb: se_outb, | |
16814 | - mv_outw: se_outw, | |
16815 | - mv_outl: se_outl, | |
16816 | - | |
16817 | - mv_inb_p: se_inb_p, | |
16818 | - mv_inw_p: se_inw, | |
16819 | - mv_inl_p: se_inl, | |
16820 | - mv_outb_p: se_outb_p, | |
16821 | - mv_outw_p: se_outw, | |
16822 | - mv_outl_p: se_outl, | |
16823 | - | |
16824 | - mv_insb: se_insb, | |
16825 | - mv_insw: se_insw, | |
16826 | - mv_insl: se_insl, | |
16827 | - mv_outsb: se_outsb, | |
16828 | - mv_outsw: se_outsw, | |
16829 | - mv_outsl: se_outsl, | |
16830 | - | |
16831 | - mv_readb: se_readb, | |
16832 | - mv_readw: se_readw, | |
16833 | - mv_readl: se_readl, | |
16834 | - mv_writeb: se_writeb, | |
16835 | - mv_writew: se_writew, | |
16836 | - mv_writel: se_writel, | |
16837 | + .mv_inb = se_inb, | |
16838 | + .mv_inw = se_inw, | |
16839 | + .mv_inl = se_inl, | |
16840 | + .mv_outb = se_outb, | |
16841 | + .mv_outw = se_outw, | |
16842 | + .mv_outl = se_outl, | |
16843 | + | |
16844 | + .mv_inb_p = se_inb_p, | |
16845 | + .mv_inw_p = se_inw, | |
16846 | + .mv_inl_p = se_inl, | |
16847 | + .mv_outb_p = se_outb_p, | |
16848 | + .mv_outw_p = se_outw, | |
16849 | + .mv_outl_p = se_outl, | |
16850 | + | |
16851 | + .mv_insb = se_insb, | |
16852 | + .mv_insw = se_insw, | |
16853 | + .mv_insl = se_insl, | |
16854 | + .mv_outsb = se_outsb, | |
16855 | + .mv_outsw = se_outsw, | |
16856 | + .mv_outsl = se_outsl, | |
16857 | + | |
16858 | + .mv_readb = se_readb, | |
16859 | + .mv_readw = se_readw, | |
16860 | + .mv_readl = se_readl, | |
16861 | + .mv_writeb = se_writeb, | |
16862 | + .mv_writew = se_writew, | |
16863 | + .mv_writel = se_writel, | |
16864 | ||
16865 | - mv_ioremap: generic_ioremap, | |
16866 | - mv_iounmap: generic_iounmap, | |
16867 | + .mv_ioremap = generic_ioremap, | |
16868 | + .mv_iounmap = generic_iounmap, | |
16869 | ||
16870 | - mv_isa_port2addr: se_isa_port2addr, | |
16871 | + .mv_isa_port2addr = se_isa_port2addr, | |
16872 | ||
16873 | - mv_init_irq: init_se_IRQ, | |
16874 | + .mv_init_irq = init_se_IRQ, | |
16875 | #ifdef CONFIG_HEARTBEAT | |
16876 | - mv_heartbeat: heartbeat_se, | |
16877 | + .mv_heartbeat = heartbeat_se, | |
16878 | #endif | |
16879 | }; | |
16880 | ALIAS_MV(se) | |
16881 | diff -Nru a/arch/sh/boards/se/7751/mach.c b/arch/sh/boards/se/7751/mach.c | |
16882 | --- a/arch/sh/boards/se/7751/mach.c Mon May 19 16:04:39 2003 | |
16883 | +++ b/arch/sh/boards/se/7751/mach.c Sun Aug 31 16:14:08 2003 | |
16884 | @@ -26,44 +26,44 @@ | |
16885 | */ | |
16886 | ||
16887 | struct sh_machine_vector mv_7751se __initmv = { | |
16888 | - mv_nr_irqs: 72, | |
16889 | + .mv_nr_irqs = 72, | |
16890 | ||
16891 | - mv_inb: sh7751se_inb, | |
16892 | - mv_inw: sh7751se_inw, | |
16893 | - mv_inl: sh7751se_inl, | |
16894 | - mv_outb: sh7751se_outb, | |
16895 | - mv_outw: sh7751se_outw, | |
16896 | - mv_outl: sh7751se_outl, | |
16897 | - | |
16898 | - mv_inb_p: sh7751se_inb_p, | |
16899 | - mv_inw_p: sh7751se_inw, | |
16900 | - mv_inl_p: sh7751se_inl, | |
16901 | - mv_outb_p: sh7751se_outb_p, | |
16902 | - mv_outw_p: sh7751se_outw, | |
16903 | - mv_outl_p: sh7751se_outl, | |
16904 | - | |
16905 | - mv_insb: sh7751se_insb, | |
16906 | - mv_insw: sh7751se_insw, | |
16907 | - mv_insl: sh7751se_insl, | |
16908 | - mv_outsb: sh7751se_outsb, | |
16909 | - mv_outsw: sh7751se_outsw, | |
16910 | - mv_outsl: sh7751se_outsl, | |
16911 | - | |
16912 | - mv_readb: sh7751se_readb, | |
16913 | - mv_readw: sh7751se_readw, | |
16914 | - mv_readl: sh7751se_readl, | |
16915 | - mv_writeb: sh7751se_writeb, | |
16916 | - mv_writew: sh7751se_writew, | |
16917 | - mv_writel: sh7751se_writel, | |
16918 | + .mv_inb = sh7751se_inb, | |
16919 | + .mv_inw = sh7751se_inw, | |
16920 | + .mv_inl = sh7751se_inl, | |
16921 | + .mv_outb = sh7751se_outb, | |
16922 | + .mv_outw = sh7751se_outw, | |
16923 | + .mv_outl = sh7751se_outl, | |
16924 | + | |
16925 | + .mv_inb_p = sh7751se_inb_p, | |
16926 | + .mv_inw_p = sh7751se_inw, | |
16927 | + .mv_inl_p = sh7751se_inl, | |
16928 | + .mv_outb_p = sh7751se_outb_p, | |
16929 | + .mv_outw_p = sh7751se_outw, | |
16930 | + .mv_outl_p = sh7751se_outl, | |
16931 | + | |
16932 | + .mv_insb = sh7751se_insb, | |
16933 | + .mv_insw = sh7751se_insw, | |
16934 | + .mv_insl = sh7751se_insl, | |
16935 | + .mv_outsb = sh7751se_outsb, | |
16936 | + .mv_outsw = sh7751se_outsw, | |
16937 | + .mv_outsl = sh7751se_outsl, | |
16938 | + | |
16939 | + .mv_readb = sh7751se_readb, | |
16940 | + .mv_readw = sh7751se_readw, | |
16941 | + .mv_readl = sh7751se_readl, | |
16942 | + .mv_writeb = sh7751se_writeb, | |
16943 | + .mv_writew = sh7751se_writew, | |
16944 | + .mv_writel = sh7751se_writel, | |
16945 | ||
16946 | - mv_ioremap: generic_ioremap, | |
16947 | - mv_iounmap: generic_iounmap, | |
16948 | + .mv_ioremap = generic_ioremap, | |
16949 | + .mv_iounmap = generic_iounmap, | |
16950 | ||
16951 | - mv_isa_port2addr: sh7751se_isa_port2addr, | |
16952 | + .mv_isa_port2addr = sh7751se_isa_port2addr, | |
16953 | ||
16954 | - mv_init_irq: init_7751se_IRQ, | |
16955 | + .mv_init_irq = init_7751se_IRQ, | |
16956 | #ifdef CONFIG_HEARTBEAT | |
16957 | - mv_heartbeat: heartbeat_7751se, | |
16958 | + .mv_heartbeat = heartbeat_7751se, | |
16959 | #endif | |
16960 | }; | |
16961 | ALIAS_MV(7751se) | |
16962 | diff -Nru a/arch/sh/boards/sh2000/mach.c b/arch/sh/boards/sh2000/mach.c | |
16963 | --- a/arch/sh/boards/sh2000/mach.c Mon May 19 16:04:40 2003 | |
16964 | +++ b/arch/sh/boards/sh2000/mach.c Sun Aug 31 16:14:08 2003 | |
16965 | @@ -19,39 +19,39 @@ | |
16966 | */ | |
16967 | ||
16968 | struct sh_machine_vector mv_sh2000 __initmv = { | |
16969 | - mv_nr_irqs: 80, | |
16970 | + .mv_nr_irqs = 80, | |
16971 | ||
16972 | - mv_inb: generic_inb, | |
16973 | - mv_inw: generic_inw, | |
16974 | - mv_inl: generic_inl, | |
16975 | - mv_outb: generic_outb, | |
16976 | - mv_outw: generic_outw, | |
16977 | - mv_outl: generic_outl, | |
16978 | - | |
16979 | - mv_inb_p: generic_inb_p, | |
16980 | - mv_inw_p: generic_inw_p, | |
16981 | - mv_inl_p: generic_inl_p, | |
16982 | - mv_outb_p: generic_outb_p, | |
16983 | - mv_outw_p: generic_outw_p, | |
16984 | - mv_outl_p: generic_outl_p, | |
16985 | - | |
16986 | - mv_insb: generic_insb, | |
16987 | - mv_insw: generic_insw, | |
16988 | - mv_insl: generic_insl, | |
16989 | - mv_outsb: generic_outsb, | |
16990 | - mv_outsw: generic_outsw, | |
16991 | - mv_outsl: generic_outsl, | |
16992 | - | |
16993 | - mv_readb: generic_readb, | |
16994 | - mv_readw: generic_readw, | |
16995 | - mv_readl: generic_readl, | |
16996 | - mv_writeb: generic_writeb, | |
16997 | - mv_writew: generic_writew, | |
16998 | - mv_writel: generic_writel, | |
16999 | + .mv_inb = generic_inb, | |
17000 | + .mv_inw = generic_inw, | |
17001 | + .mv_inl = generic_inl, | |
17002 | + .mv_outb = generic_outb, | |
17003 | + .mv_outw = generic_outw, | |
17004 | + .mv_outl = generic_outl, | |
17005 | + | |
17006 | + .mv_inb_p = generic_inb_p, | |
17007 | + .mv_inw_p = generic_inw_p, | |
17008 | + .mv_inl_p = generic_inl_p, | |
17009 | + .mv_outb_p = generic_outb_p, | |
17010 | + .mv_outw_p = generic_outw_p, | |
17011 | + .mv_outl_p = generic_outl_p, | |
17012 | + | |
17013 | + .mv_insb = generic_insb, | |
17014 | + .mv_insw = generic_insw, | |
17015 | + .mv_insl = generic_insl, | |
17016 | + .mv_outsb = generic_outsb, | |
17017 | + .mv_outsw = generic_outsw, | |
17018 | + .mv_outsl = generic_outsl, | |
17019 | + | |
17020 | + .mv_readb = generic_readb, | |
17021 | + .mv_readw = generic_readw, | |
17022 | + .mv_readl = generic_readl, | |
17023 | + .mv_writeb = generic_writeb, | |
17024 | + .mv_writew = generic_writew, | |
17025 | + .mv_writel = generic_writel, | |
17026 | ||
17027 | - mv_isa_port2addr: sh2000_isa_port2addr, | |
17028 | + .mv_isa_port2addr = sh2000_isa_port2addr, | |
17029 | ||
17030 | - mv_ioremap: generic_ioremap, | |
17031 | - mv_iounmap: generic_iounmap, | |
17032 | + .mv_ioremap = generic_ioremap, | |
17033 | + .mv_iounmap = generic_iounmap, | |
17034 | }; | |
17035 | ALIAS_MV(sh2000) | |
17036 | diff -Nru a/arch/sh/boards/unknown/mach.c b/arch/sh/boards/unknown/mach.c | |
17037 | --- a/arch/sh/boards/unknown/mach.c Fri Jan 10 04:26:40 2003 | |
17038 | +++ b/arch/sh/boards/unknown/mach.c Sun Aug 31 16:14:08 2003 | |
17039 | @@ -24,44 +24,44 @@ | |
17040 | ||
17041 | struct sh_machine_vector mv_unknown __initmv = { | |
17042 | #if defined(CONFIG_CPU_SH4) | |
17043 | - mv_nr_irqs: 48, | |
17044 | + .mv_nr_irqs = 48, | |
17045 | #elif defined(CONFIG_CPU_SUBTYPE_SH7708) | |
17046 | - mv_nr_irqs: 32, | |
17047 | + .mv_nr_irqs = 32, | |
17048 | #elif defined(CONFIG_CPU_SUBTYPE_SH7709) | |
17049 | - mv_nr_irqs: 61, | |
17050 | + .mv_nr_irqs = 61, | |
17051 | #endif | |
17052 | ||
17053 | - mv_inb: unknown_inb, | |
17054 | - mv_inw: unknown_inw, | |
17055 | - mv_inl: unknown_inl, | |
17056 | - mv_outb: unknown_outb, | |
17057 | - mv_outw: unknown_outw, | |
17058 | - mv_outl: unknown_outl, | |
17059 | - | |
17060 | - mv_inb_p: unknown_inb_p, | |
17061 | - mv_inw_p: unknown_inw_p, | |
17062 | - mv_inl_p: unknown_inl_p, | |
17063 | - mv_outb_p: unknown_outb_p, | |
17064 | - mv_outw_p: unknown_outw_p, | |
17065 | - mv_outl_p: unknown_outl_p, | |
17066 | - | |
17067 | - mv_insb: unknown_insb, | |
17068 | - mv_insw: unknown_insw, | |
17069 | - mv_insl: unknown_insl, | |
17070 | - mv_outsb: unknown_outsb, | |
17071 | - mv_outsw: unknown_outsw, | |
17072 | - mv_outsl: unknown_outsl, | |
17073 | - | |
17074 | - mv_readb: unknown_readb, | |
17075 | - mv_readw: unknown_readw, | |
17076 | - mv_readl: unknown_readl, | |
17077 | - mv_writeb: unknown_writeb, | |
17078 | - mv_writew: unknown_writew, | |
17079 | - mv_writel: unknown_writel, | |
17080 | + .mv_inb = unknown_inb, | |
17081 | + .mv_inw = unknown_inw, | |
17082 | + .mv_inl = unknown_inl, | |
17083 | + .mv_outb = unknown_outb, | |
17084 | + .mv_outw = unknown_outw, | |
17085 | + .mv_outl = unknown_outl, | |
17086 | + | |
17087 | + .mv_inb_p = unknown_inb_p, | |
17088 | + .mv_inw_p = unknown_inw_p, | |
17089 | + .mv_inl_p = unknown_inl_p, | |
17090 | + .mv_outb_p = unknown_outb_p, | |
17091 | + .mv_outw_p = unknown_outw_p, | |
17092 | + .mv_outl_p = unknown_outl_p, | |
17093 | + | |
17094 | + .mv_insb = unknown_insb, | |
17095 | + .mv_insw = unknown_insw, | |
17096 | + .mv_insl = unknown_insl, | |
17097 | + .mv_outsb = unknown_outsb, | |
17098 | + .mv_outsw = unknown_outsw, | |
17099 | + .mv_outsl = unknown_outsl, | |
17100 | + | |
17101 | + .mv_readb = unknown_readb, | |
17102 | + .mv_readw = unknown_readw, | |
17103 | + .mv_readl = unknown_readl, | |
17104 | + .mv_writeb = unknown_writeb, | |
17105 | + .mv_writew = unknown_writew, | |
17106 | + .mv_writel = unknown_writel, | |
17107 | ||
17108 | - mv_ioremap: unknown_ioremap, | |
17109 | - mv_iounmap: unknown_iounmap, | |
17110 | + .mv_ioremap = unknown_ioremap, | |
17111 | + .mv_iounmap = unknown_iounmap, | |
17112 | ||
17113 | - mv_isa_port2addr: unknown_isa_port2addr, | |
17114 | + .mv_isa_port2addr = unknown_isa_port2addr, | |
17115 | }; | |
17116 | ALIAS_MV(unknown) | |
17117 | diff -Nru a/arch/sh/cchips/hd6446x/hd64465/setup.c b/arch/sh/cchips/hd6446x/hd64465/setup.c | |
17118 | --- a/arch/sh/cchips/hd6446x/hd64465/setup.c Mon Nov 4 07:33:57 2002 | |
17119 | +++ b/arch/sh/cchips/hd6446x/hd64465/setup.c Sun Aug 31 16:14:08 2003 | |
17120 | @@ -89,13 +89,13 @@ | |
17121 | ||
17122 | ||
17123 | static struct hw_interrupt_type hd64465_irq_type = { | |
17124 | - typename: "HD64465-IRQ", | |
17125 | - startup: startup_hd64465_irq, | |
17126 | - shutdown: shutdown_hd64465_irq, | |
17127 | - enable: enable_hd64465_irq, | |
17128 | - disable: disable_hd64465_irq, | |
17129 | - ack: mask_and_ack_hd64465, | |
17130 | - end: end_hd64465_irq | |
17131 | + .typename = "HD64465-IRQ", | |
17132 | + .startup = startup_hd64465_irq, | |
17133 | + .shutdown = shutdown_hd64465_irq, | |
17134 | + .enable = enable_hd64465_irq, | |
17135 | + .disable = disable_hd64465_irq, | |
17136 | + .ack = mask_and_ack_hd64465, | |
17137 | + .end = end_hd64465_irq | |
17138 | }; | |
17139 | ||
17140 | ||
17141 | diff -Nru a/arch/sparc/Kconfig b/arch/sparc/Kconfig | |
17142 | --- a/arch/sparc/Kconfig Sat Aug 2 14:26:16 2003 | |
17143 | +++ b/arch/sparc/Kconfig Sun Aug 31 16:14:22 2003 | |
17144 | @@ -254,29 +254,6 @@ | |
17145 | <file:Documentation/modules.txt>. | |
17146 | The module will be called openpromfs. If unsure, say M. | |
17147 | ||
17148 | -config KCORE_ELF | |
17149 | - bool | |
17150 | - depends on PROC_FS | |
17151 | - default y | |
17152 | - ---help--- | |
17153 | - If you enabled support for /proc file system then the file | |
17154 | - /proc/kcore will contain the kernel core image. This can be used | |
17155 | - in gdb: | |
17156 | - | |
17157 | - $ cd /usr/src/linux ; gdb vmlinux /proc/kcore | |
17158 | - | |
17159 | - You have two choices here: ELF and A.OUT. Selecting ELF will make | |
17160 | - /proc/kcore appear in ELF core format as defined by the Executable | |
17161 | - and Linking Format specification. Selecting A.OUT will choose the | |
17162 | - old "a.out" format which may be necessary for some old versions | |
17163 | - of binutils or on some architectures. | |
17164 | - | |
17165 | - This is especially useful if you have compiled the kernel with the | |
17166 | - "-g" option to preserve debugging information. It is mainly used | |
17167 | - for examining kernel data structures on the live kernel so if you | |
17168 | - don't understand what this means or are not a kernel hacker, just | |
17169 | - leave it at its default value ELF. | |
17170 | - | |
17171 | source "fs/Kconfig.binfmt" | |
17172 | ||
17173 | config SUNOS_EMUL | |
17174 | diff -Nru a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile | |
17175 | --- a/arch/sparc/boot/Makefile Sat Jul 12 22:05:29 2003 | |
17176 | +++ b/arch/sparc/boot/Makefile Thu Aug 28 00:18:36 2003 | |
17177 | @@ -19,7 +19,7 @@ | |
17178 | ||
17179 | BTOBJS := $(HEAD_Y) $(INIT_Y) | |
17180 | BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y) | |
17181 | -LDFLAGS_image := -T arch/sparc/vmlinux.lds.s $(BTOBJS) --start-group $(BTLIBS) --end-group | |
17182 | +LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds.s $(BTOBJS) --start-group $(BTLIBS) --end-group | |
17183 | ||
17184 | # Actual linking | |
17185 | $(obj)/image: $(obj)/btfix.o FORCE | |
17186 | diff -Nru a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S | |
17187 | --- a/arch/sparc/kernel/entry.S Sat Aug 16 14:13:18 2003 | |
17188 | +++ b/arch/sparc/kernel/entry.S Wed Aug 27 23:52:25 2003 | |
17189 | @@ -38,7 +38,7 @@ | |
17190 | ||
17191 | #define curptr g6 | |
17192 | ||
17193 | -#define NR_SYSCALLS 266 /* Each OS is different... */ | |
17194 | +#define NR_SYSCALLS 267 /* Each OS is different... */ | |
17195 | ||
17196 | /* These are just handy. */ | |
17197 | #define _SV save %sp, -STACKFRAME_SZ, %sp | |
17198 | diff -Nru a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c | |
17199 | --- a/arch/sparc/kernel/ioport.c Sun May 25 17:00:00 2003 | |
17200 | +++ b/arch/sparc/kernel/ioport.c Thu Aug 28 01:15:54 2003 | |
17201 | @@ -511,6 +511,26 @@ | |
17202 | } | |
17203 | } | |
17204 | ||
17205 | +/* | |
17206 | + * Same as pci_map_single, but with pages. | |
17207 | + */ | |
17208 | +dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page, | |
17209 | + unsigned long offset, size_t size, int direction) | |
17210 | +{ | |
17211 | + if (direction == PCI_DMA_NONE) | |
17212 | + BUG(); | |
17213 | + /* IIep is write-through, not flushing. */ | |
17214 | + return page_to_phys(page) + offset; | |
17215 | +} | |
17216 | + | |
17217 | +void pci_unmap_page(struct pci_dev *hwdev, | |
17218 | + dma_addr_t dma_address, size_t size, int direction) | |
17219 | +{ | |
17220 | + if (direction == PCI_DMA_NONE) | |
17221 | + BUG(); | |
17222 | + /* mmu_inval_dma_area XXX */ | |
17223 | +} | |
17224 | + | |
17225 | /* Map a set of buffers described by scatterlist in streaming | |
17226 | * mode for DMA. This is the scather-gather version of the | |
17227 | * above pci_map_single interface. Here the scatter gather list | |
17228 | diff -Nru a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c | |
17229 | --- a/arch/sparc/kernel/sys_sunos.c Sun May 25 17:00:00 2003 | |
17230 | +++ b/arch/sparc/kernel/sys_sunos.c Tue Aug 26 09:25:41 2003 | |
17231 | @@ -92,8 +92,8 @@ | |
17232 | * SunOS is so stupid some times... hmph! | |
17233 | */ | |
17234 | if (file) { | |
17235 | - if(major(file->f_dentry->d_inode->i_rdev) == MEM_MAJOR && | |
17236 | - minor(file->f_dentry->d_inode->i_rdev) == 5) { | |
17237 | + if(imajor(file->f_dentry->d_inode) == MEM_MAJOR && | |
17238 | + iminor(file->f_dentry->d_inode) == 5) { | |
17239 | flags |= MAP_ANONYMOUS; | |
17240 | fput(file); | |
17241 | file = 0; | |
17242 | diff -Nru a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S | |
17243 | --- a/arch/sparc/kernel/systbls.S Sat Aug 16 14:13:18 2003 | |
17244 | +++ b/arch/sparc/kernel/systbls.S Thu Aug 28 01:35:18 2003 | |
17245 | @@ -72,7 +72,7 @@ | |
17246 | /*250*/ .long sparc_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl | |
17247 | /*255*/ .long sys_nis_syscall, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep | |
17248 | /*260*/ .long sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun | |
17249 | -/*261*/ .long sys_timer_delete, sys_nis_syscall | |
17250 | +/*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall | |
17251 | ||
17252 | #ifdef CONFIG_SUNOS_EMUL | |
17253 | /* Now the SunOS syscall table. */ | |
17254 | @@ -171,6 +171,6 @@ | |
17255 | .long sunos_nosys | |
17256 | /*260*/ .long sunos_nosys, sunos_nosys, sunos_nosys | |
17257 | .long sunos_nosys, sunos_nosys, sunos_nosys | |
17258 | - .long sunos_nosys | |
17259 | + .long sunos_nosys, sunos_nosys | |
17260 | ||
17261 | #endif | |
17262 | diff -Nru a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig | |
17263 | --- a/arch/sparc64/Kconfig Sat Aug 2 14:26:53 2003 | |
17264 | +++ b/arch/sparc64/Kconfig Sun Aug 31 16:14:22 2003 | |
17265 | @@ -363,29 +363,6 @@ | |
17266 | <file:Documentation/modules.txt>. | |
17267 | The module will be called openpromfs. If unsure, say M. | |
17268 | ||
17269 | -config KCORE_ELF | |
17270 | - bool | |
17271 | - depends on PROC_FS | |
17272 | - default y | |
17273 | - ---help--- | |
17274 | - If you enabled support for /proc file system then the file | |
17275 | - /proc/kcore will contain the kernel core image. This can be used | |
17276 | - in gdb: | |
17277 | - | |
17278 | - $ cd /usr/src/linux ; gdb vmlinux /proc/kcore | |
17279 | - | |
17280 | - You have two choices here: ELF and A.OUT. Selecting ELF will make | |
17281 | - /proc/kcore appear in ELF core format as defined by the Executable | |
17282 | - and Linking Format specification. Selecting A.OUT will choose the | |
17283 | - old "a.out" format which may be necessary for some old versions | |
17284 | - of binutils or on some architectures. | |
17285 | - | |
17286 | - This is especially useful if you have compiled the kernel with the | |
17287 | - "-g" option to preserve debugging information. It is mainly used | |
17288 | - for examining kernel data structures on the live kernel so if you | |
17289 | - don't understand what this means or are not a kernel hacker, just | |
17290 | - leave it at its default value ELF. | |
17291 | - | |
17292 | config SPARC32_COMPAT | |
17293 | bool "Kernel support for Linux/Sparc 32bit binary compatibility" | |
17294 | help | |
17295 | diff -Nru a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S | |
17296 | --- a/arch/sparc64/kernel/entry.S Sat Aug 16 14:13:18 2003 | |
17297 | +++ b/arch/sparc64/kernel/entry.S Wed Aug 27 23:52:25 2003 | |
17298 | @@ -26,7 +26,7 @@ | |
17299 | ||
17300 | #define curptr g6 | |
17301 | ||
17302 | -#define NR_SYSCALLS 266 /* Each OS is different... */ | |
17303 | +#define NR_SYSCALLS 267 /* Each OS is different... */ | |
17304 | ||
17305 | .text | |
17306 | .align 32 | |
17307 | diff -Nru a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c | |
17308 | --- a/arch/sparc64/kernel/ioctl32.c Fri Aug 8 14:53:47 2003 | |
17309 | +++ b/arch/sparc64/kernel/ioctl32.c Sun Aug 31 16:14:44 2003 | |
17310 | @@ -1388,7 +1388,7 @@ | |
17311 | #define IOCTL_TABLE_START \ | |
17312 | struct ioctl_trans ioctl_start[] = { | |
17313 | #define IOCTL_TABLE_END \ | |
17314 | - }; struct ioctl_trans ioctl_end[0]; | |
17315 | + }; | |
17316 | ||
17317 | IOCTL_TABLE_START | |
17318 | #include <linux/compat_ioctl.h> | |
17319 | @@ -1583,3 +1583,5 @@ | |
17320 | HANDLE_IOCTL(USBDEVFS_DISCSIGNAL32, do_usbdevfs_discsignal) | |
17321 | /* take care of sizeof(sizeof()) breakage */ | |
17322 | IOCTL_TABLE_END | |
17323 | + | |
17324 | +int ioctl_table_size = ARRAY_SIZE(ioctl_start); | |
17325 | diff -Nru a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c | |
17326 | --- a/arch/sparc64/kernel/irq.c Tue Aug 19 19:00:31 2003 | |
17327 | +++ b/arch/sparc64/kernel/irq.c Thu Aug 28 17:10:27 2003 | |
17328 | @@ -1097,6 +1097,18 @@ | |
17329 | ||
17330 | memset(__irq_work + smp_processor_id(), 0, sizeof(*workp)); | |
17331 | ||
17332 | + /* Make sure we are called with PSTATE_IE disabled. */ | |
17333 | + __asm__ __volatile__("rdpr %%pstate, %0\n\t" | |
17334 | + : "=r" (tmp)); | |
17335 | + if (tmp & PSTATE_IE) { | |
17336 | + prom_printf("BUG: init_irqwork_curcpu() called with " | |
17337 | + "PSTATE_IE enabled, bailing.\n"); | |
17338 | + __asm__ __volatile__("mov %%i7, %0\n\t" | |
17339 | + : "=r" (tmp)); | |
17340 | + prom_printf("BUG: Called from %lx\n", tmp); | |
17341 | + prom_halt(); | |
17342 | + } | |
17343 | + | |
17344 | /* Set interrupt globals. */ | |
17345 | workp = &__irq_work[smp_processor_id()]; | |
17346 | __asm__ __volatile__( | |
17347 | @@ -1105,7 +1117,7 @@ | |
17348 | "mov %2, %%g6\n\t" | |
17349 | "wrpr %0, 0x0, %%pstate\n\t" | |
17350 | : "=&r" (tmp) | |
17351 | - : "i" (PSTATE_IG | PSTATE_IE), "r" (workp)); | |
17352 | + : "i" (PSTATE_IG), "r" (workp)); | |
17353 | } | |
17354 | ||
17355 | /* Only invoked on boot processor. */ | |
17356 | diff -Nru a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c | |
17357 | --- a/arch/sparc64/kernel/pci_psycho.c Fri Jul 25 08:40:56 2003 | |
17358 | +++ b/arch/sparc64/kernel/pci_psycho.c Sun Aug 24 03:18:58 2003 | |
17359 | @@ -874,6 +874,46 @@ | |
17360 | #define PSYCHO_PCI_AFAR_A 0x2018UL | |
17361 | #define PSYCHO_PCI_AFAR_B 0x4018UL | |
17362 | ||
17363 | +static irqreturn_t psycho_pcierr_intr_other(struct pci_pbm_info *pbm, int is_pbm_a) | |
17364 | +{ | |
17365 | + unsigned long csr_reg, csr, csr_error_bits; | |
17366 | + irqreturn_t ret = IRQ_NONE; | |
17367 | + u16 stat; | |
17368 | + | |
17369 | + if (is_pbm_a) { | |
17370 | + csr_reg = pbm->controller_regs + PSYCHO_PCIA_CTRL; | |
17371 | + } else { | |
17372 | + csr_reg = pbm->controller_regs + PSYCHO_PCIB_CTRL; | |
17373 | + } | |
17374 | + csr = psycho_read(csr_reg); | |
17375 | + csr_error_bits = | |
17376 | + csr & (PSYCHO_PCICTRL_SBH_ERR | PSYCHO_PCICTRL_SERR); | |
17377 | + if (csr_error_bits) { | |
17378 | + /* Clear the errors. */ | |
17379 | + psycho_write(csr_reg, csr); | |
17380 | + | |
17381 | + /* Log 'em. */ | |
17382 | + if (csr_error_bits & PSYCHO_PCICTRL_SBH_ERR) | |
17383 | + printk("%s: PCI streaming byte hole error asserted.\n", | |
17384 | + pbm->name); | |
17385 | + if (csr_error_bits & PSYCHO_PCICTRL_SERR) | |
17386 | + printk("%s: PCI SERR signal asserted.\n", pbm->name); | |
17387 | + ret = IRQ_HANDLED; | |
17388 | + } | |
17389 | + pci_read_config_word(pbm->pci_bus->self, PCI_STATUS, &stat); | |
17390 | + if (stat & (PCI_STATUS_PARITY | | |
17391 | + PCI_STATUS_SIG_TARGET_ABORT | | |
17392 | + PCI_STATUS_REC_TARGET_ABORT | | |
17393 | + PCI_STATUS_REC_MASTER_ABORT | | |
17394 | + PCI_STATUS_SIG_SYSTEM_ERROR)) { | |
17395 | + printk("%s: PCI bus error, PCI_STATUS[%04x]\n", | |
17396 | + pbm->name, stat); | |
17397 | + pci_write_config_word(pbm->pci_bus->self, PCI_STATUS, 0xffff); | |
17398 | + ret = IRQ_HANDLED; | |
17399 | + } | |
17400 | + return ret; | |
17401 | +} | |
17402 | + | |
17403 | static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs) | |
17404 | { | |
17405 | struct pci_pbm_info *pbm = dev_id; | |
17406 | @@ -902,7 +942,7 @@ | |
17407 | PSYCHO_PCIAFSR_SMA | PSYCHO_PCIAFSR_STA | | |
17408 | PSYCHO_PCIAFSR_SRTRY | PSYCHO_PCIAFSR_SPERR); | |
17409 | if (!error_bits) | |
17410 | - return IRQ_NONE; | |
17411 | + return psycho_pcierr_intr_other(pbm, is_pbm_a); | |
17412 | psycho_write(afsr_reg, error_bits); | |
17413 | ||
17414 | /* Log the error. */ | |
17415 | @@ -1008,6 +1048,7 @@ | |
17416 | prom_halt(); | |
17417 | } | |
17418 | ||
17419 | + pbm = &p->pbm_A; | |
17420 | irq = psycho_irq_build(pbm, NULL, (portid << 6) | PSYCHO_PCIERR_A_INO); | |
17421 | if (request_irq(irq, psycho_pcierr_intr, | |
17422 | SA_SHIRQ, "PSYCHO PCIERR", &p->pbm_A) < 0) { | |
17423 | @@ -1016,6 +1057,7 @@ | |
17424 | prom_halt(); | |
17425 | } | |
17426 | ||
17427 | + pbm = &p->pbm_B; | |
17428 | irq = psycho_irq_build(pbm, NULL, (portid << 6) | PSYCHO_PCIERR_B_INO); | |
17429 | if (request_irq(irq, psycho_pcierr_intr, | |
17430 | SA_SHIRQ, "PSYCHO PCIERR", &p->pbm_B) < 0) { | |
17431 | diff -Nru a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c | |
17432 | --- a/arch/sparc64/kernel/pci_sabre.c Tue Aug 19 16:00:48 2003 | |
17433 | +++ b/arch/sparc64/kernel/pci_sabre.c Sun Aug 24 03:18:58 2003 | |
17434 | @@ -221,6 +221,7 @@ | |
17435 | ((unsigned long)(REG))) | |
17436 | ||
17437 | static int hummingbird_p; | |
17438 | +static struct pci_bus *sabre_root_bus; | |
17439 | ||
17440 | static void *sabre_pci_config_mkaddr(struct pci_pbm_info *pbm, | |
17441 | unsigned char bus, | |
17442 | @@ -860,6 +861,42 @@ | |
17443 | return IRQ_HANDLED; | |
17444 | } | |
17445 | ||
17446 | +static irqreturn_t sabre_pcierr_intr_other(struct pci_controller_info *p) | |
17447 | +{ | |
17448 | + unsigned long csr_reg, csr, csr_error_bits; | |
17449 | + irqreturn_t ret = IRQ_NONE; | |
17450 | + u16 stat; | |
17451 | + | |
17452 | + csr_reg = p->pbm_A.controller_regs + SABRE_PCICTRL; | |
17453 | + csr = sabre_read(csr_reg); | |
17454 | + csr_error_bits = | |
17455 | + csr & SABRE_PCICTRL_SERR; | |
17456 | + if (csr_error_bits) { | |
17457 | + /* Clear the errors. */ | |
17458 | + sabre_write(csr_reg, csr); | |
17459 | + | |
17460 | + /* Log 'em. */ | |
17461 | + if (csr_error_bits & SABRE_PCICTRL_SERR) | |
17462 | + printk("SABRE%d: PCI SERR signal asserted.\n", | |
17463 | + p->index); | |
17464 | + ret = IRQ_HANDLED; | |
17465 | + } | |
17466 | + pci_read_config_word(sabre_root_bus->self, | |
17467 | + PCI_STATUS, &stat); | |
17468 | + if (stat & (PCI_STATUS_PARITY | | |
17469 | + PCI_STATUS_SIG_TARGET_ABORT | | |
17470 | + PCI_STATUS_REC_TARGET_ABORT | | |
17471 | + PCI_STATUS_REC_MASTER_ABORT | | |
17472 | + PCI_STATUS_SIG_SYSTEM_ERROR)) { | |
17473 | + printk("SABRE%d: PCI bus error, PCI_STATUS[%04x]\n", | |
17474 | + p->index, stat); | |
17475 | + pci_write_config_word(sabre_root_bus->self, | |
17476 | + PCI_STATUS, 0xffff); | |
17477 | + ret = IRQ_HANDLED; | |
17478 | + } | |
17479 | + return ret; | |
17480 | +} | |
17481 | + | |
17482 | static irqreturn_t sabre_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs) | |
17483 | { | |
17484 | struct pci_controller_info *p = dev_id; | |
17485 | @@ -881,7 +918,7 @@ | |
17486 | SABRE_PIOAFSR_SMA | SABRE_PIOAFSR_STA | | |
17487 | SABRE_PIOAFSR_SRTRY | SABRE_PIOAFSR_SPERR); | |
17488 | if (!error_bits) | |
17489 | - return IRQ_NONE; | |
17490 | + return sabre_pcierr_intr_other(p); | |
17491 | sabre_write(afsr_reg, error_bits); | |
17492 | ||
17493 | /* Log the error. */ | |
17494 | @@ -1167,6 +1204,8 @@ | |
17495 | &p->pbm_A); | |
17496 | pci_fixup_host_bridge_self(sabre_bus); | |
17497 | sabre_bus->self->sysdata = cookie; | |
17498 | + | |
17499 | + sabre_root_bus = sabre_bus; | |
17500 | ||
17501 | apb_init(p, sabre_bus); | |
17502 | ||
17503 | diff -Nru a/arch/sparc64/kernel/pci_schizo.c b/arch/sparc64/kernel/pci_schizo.c | |
17504 | --- a/arch/sparc64/kernel/pci_schizo.c Sat Aug 2 18:21:52 2003 | |
17505 | +++ b/arch/sparc64/kernel/pci_schizo.c Sun Aug 24 03:18:58 2003 | |
17506 | @@ -845,6 +845,88 @@ | |
17507 | #define SCHIZO_PCIAFSR_MEM 0x0000000020000000UL /* Schizo/Tomatillo */ | |
17508 | #define SCHIZO_PCIAFSR_IO 0x0000000010000000UL /* Schizo/Tomatillo */ | |
17509 | ||
17510 | +#define SCHIZO_PCI_CTRL (0x2000UL) | |
17511 | +#define SCHIZO_PCICTRL_BUS_UNUS (1UL << 63UL) /* Safari */ | |
17512 | +#define SCHIZO_PCICTRL_ARB_PRIO (0x1ff << 52UL) /* Tomatillo */ | |
17513 | +#define SCHIZO_PCICTRL_ESLCK (1UL << 51UL) /* Safari */ | |
17514 | +#define SCHIZO_PCICTRL_ERRSLOT (7UL << 48UL) /* Safari */ | |
17515 | +#define SCHIZO_PCICTRL_TTO_ERR (1UL << 38UL) /* Safari/Tomatillo */ | |
17516 | +#define SCHIZO_PCICTRL_RTRY_ERR (1UL << 37UL) /* Safari/Tomatillo */ | |
17517 | +#define SCHIZO_PCICTRL_DTO_ERR (1UL << 36UL) /* Safari/Tomatillo */ | |
17518 | +#define SCHIZO_PCICTRL_SBH_ERR (1UL << 35UL) /* Safari */ | |
17519 | +#define SCHIZO_PCICTRL_SERR (1UL << 34UL) /* Safari/Tomatillo */ | |
17520 | +#define SCHIZO_PCICTRL_PCISPD (1UL << 33UL) /* Safari */ | |
17521 | +#define SCHIZO_PCICTRL_MRM_PREF (1UL << 28UL) /* Tomatillo */ | |
17522 | +#define SCHIZO_PCICTRL_RDO_PREF (1UL << 27UL) /* Tomatillo */ | |
17523 | +#define SCHIZO_PCICTRL_RDL_PREF (1UL << 26UL) /* Tomatillo */ | |
17524 | +#define SCHIZO_PCICTRL_PTO (3UL << 24UL) /* Safari/Tomatillo */ | |
17525 | +#define SCHIZO_PCICTRL_PTO_SHIFT 24UL | |
17526 | +#define SCHIZO_PCICTRL_TRWSW (7UL << 21UL) /* Tomatillo */ | |
17527 | +#define SCHIZO_PCICTRL_F_TGT_A (1UL << 20UL) /* Tomatillo */ | |
17528 | +#define SCHIZO_PCICTRL_S_DTO_INT (1UL << 19UL) /* Safari */ | |
17529 | +#define SCHIZO_PCICTRL_F_TGT_RT (1UL << 19UL) /* Tomatillo */ | |
17530 | +#define SCHIZO_PCICTRL_SBH_INT (1UL << 18UL) /* Safari */ | |
17531 | +#define SCHIZO_PCICTRL_T_DTO_INT (1UL << 18UL) /* Tomatillo */ | |
17532 | +#define SCHIZO_PCICTRL_EEN (1UL << 17UL) /* Safari/Tomatillo */ | |
17533 | +#define SCHIZO_PCICTRL_PARK (1UL << 16UL) /* Safari/Tomatillo */ | |
17534 | +#define SCHIZO_PCICTRL_PCIRST (1UL << 8UL) /* Safari */ | |
17535 | +#define SCHIZO_PCICTRL_ARB_S (0x3fUL << 0UL) /* Safari */ | |
17536 | +#define SCHIZO_PCICTRL_ARB_T (0xffUL << 0UL) /* Tomatillo */ | |
17537 | + | |
17538 | +static irqreturn_t schizo_pcierr_intr_other(struct pci_pbm_info *pbm) | |
17539 | +{ | |
17540 | + unsigned long csr_reg, csr, csr_error_bits; | |
17541 | + irqreturn_t ret = IRQ_NONE; | |
17542 | + u16 stat; | |
17543 | + | |
17544 | + csr_reg = pbm->pbm_regs + SCHIZO_PCI_CTRL; | |
17545 | + csr = schizo_read(csr_reg); | |
17546 | + csr_error_bits = | |
17547 | + csr & (SCHIZO_PCICTRL_BUS_UNUS | | |
17548 | + SCHIZO_PCICTRL_TTO_ERR | | |
17549 | + SCHIZO_PCICTRL_RTRY_ERR | | |
17550 | + SCHIZO_PCICTRL_DTO_ERR | | |
17551 | + SCHIZO_PCICTRL_SBH_ERR | | |
17552 | + SCHIZO_PCICTRL_SERR); | |
17553 | + if (csr_error_bits) { | |
17554 | + /* Clear the errors. */ | |
17555 | + schizo_write(csr_reg, csr); | |
17556 | + | |
17557 | + /* Log 'em. */ | |
17558 | + if (csr_error_bits & SCHIZO_PCICTRL_BUS_UNUS) | |
17559 | + printk("%s: Bus unusable error asserted.\n", | |
17560 | + pbm->name); | |
17561 | + if (csr_error_bits & SCHIZO_PCICTRL_TTO_ERR) | |
17562 | + printk("%s: PCI TRDY# timeout error asserted.\n", | |
17563 | + pbm->name); | |
17564 | + if (csr_error_bits & SCHIZO_PCICTRL_RTRY_ERR) | |
17565 | + printk("%s: PCI excessive retry error asserted.\n", | |
17566 | + pbm->name); | |
17567 | + if (csr_error_bits & SCHIZO_PCICTRL_DTO_ERR) | |
17568 | + printk("%s: PCI discard timeout error asserted.\n", | |
17569 | + pbm->name); | |
17570 | + if (csr_error_bits & SCHIZO_PCICTRL_SBH_ERR) | |
17571 | + printk("%s: PCI streaming byte hole error asserted.\n", | |
17572 | + pbm->name); | |
17573 | + if (csr_error_bits & SCHIZO_PCICTRL_SERR) | |
17574 | + printk("%s: PCI SERR signal asserted.\n", | |
17575 | + pbm->name); | |
17576 | + ret = IRQ_HANDLED; | |
17577 | + } | |
17578 | + pci_read_config_word(pbm->pci_bus->self, PCI_STATUS, &stat); | |
17579 | + if (stat & (PCI_STATUS_PARITY | | |
17580 | + PCI_STATUS_SIG_TARGET_ABORT | | |
17581 | + PCI_STATUS_REC_TARGET_ABORT | | |
17582 | + PCI_STATUS_REC_MASTER_ABORT | | |
17583 | + PCI_STATUS_SIG_SYSTEM_ERROR)) { | |
17584 | + printk("%s: PCI bus error, PCI_STATUS[%04x]\n", | |
17585 | + pbm->name, stat); | |
17586 | + pci_write_config_word(pbm->pci_bus->self, PCI_STATUS, 0xffff); | |
17587 | + ret = IRQ_HANDLED; | |
17588 | + } | |
17589 | + return ret; | |
17590 | +} | |
17591 | + | |
17592 | static irqreturn_t schizo_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs) | |
17593 | { | |
17594 | struct pci_pbm_info *pbm = dev_id; | |
17595 | @@ -871,7 +953,7 @@ | |
17596 | SCHIZO_PCIAFSR_SRTRY | SCHIZO_PCIAFSR_SPERR | | |
17597 | SCHIZO_PCIAFSR_STTO | SCHIZO_PCIAFSR_SUNUS); | |
17598 | if (!error_bits) | |
17599 | - return IRQ_NONE; | |
17600 | + return schizo_pcierr_intr_other(pbm); | |
17601 | schizo_write(afsr_reg, error_bits); | |
17602 | ||
17603 | /* Log the error. */ | |
17604 | @@ -1043,34 +1125,6 @@ | |
17605 | #define SCHIZO_PCIERR_A_INO 0x32 /* PBM A PCI bus error */ | |
17606 | #define SCHIZO_PCIERR_B_INO 0x33 /* PBM B PCI bus error */ | |
17607 | #define SCHIZO_SERR_INO 0x34 /* Safari interface error */ | |
17608 | - | |
17609 | -#define SCHIZO_PCI_CTRL (0x2000UL) | |
17610 | -#define SCHIZO_PCICTRL_BUS_UNUS (1UL << 63UL) /* Safari */ | |
17611 | -#define SCHIZO_PCICTRL_ARB_PRIO (0x1ff << 52UL) /* Tomatillo */ | |
17612 | -#define SCHIZO_PCICTRL_ESLCK (1UL << 51UL) /* Safari */ | |
17613 | -#define SCHIZO_PCICTRL_ERRSLOT (7UL << 48UL) /* Safari */ | |
17614 | -#define SCHIZO_PCICTRL_TTO_ERR (1UL << 38UL) /* Safari/Tomatillo */ | |
17615 | -#define SCHIZO_PCICTRL_RTRY_ERR (1UL << 37UL) /* Safari/Tomatillo */ | |
17616 | -#define SCHIZO_PCICTRL_DTO_ERR (1UL << 36UL) /* Safari/Tomatillo */ | |
17617 | -#define SCHIZO_PCICTRL_SBH_ERR (1UL << 35UL) /* Safari */ | |
17618 | -#define SCHIZO_PCICTRL_SERR (1UL << 34UL) /* Safari/Tomatillo */ | |
17619 | -#define SCHIZO_PCICTRL_PCISPD (1UL << 33UL) /* Safari */ | |
17620 | -#define SCHIZO_PCICTRL_MRM_PREF (1UL << 28UL) /* Tomatillo */ | |
17621 | -#define SCHIZO_PCICTRL_RDO_PREF (1UL << 27UL) /* Tomatillo */ | |
17622 | -#define SCHIZO_PCICTRL_RDL_PREF (1UL << 26UL) /* Tomatillo */ | |
17623 | -#define SCHIZO_PCICTRL_PTO (3UL << 24UL) /* Safari/Tomatillo */ | |
17624 | -#define SCHIZO_PCICTRL_PTO_SHIFT 24UL | |
17625 | -#define SCHIZO_PCICTRL_TRWSW (7UL << 21UL) /* Tomatillo */ | |
17626 | -#define SCHIZO_PCICTRL_F_TGT_A (1UL << 20UL) /* Tomatillo */ | |
17627 | -#define SCHIZO_PCICTRL_S_DTO_INT (1UL << 19UL) /* Safari */ | |
17628 | -#define SCHIZO_PCICTRL_F_TGT_RT (1UL << 19UL) /* Tomatillo */ | |
17629 | -#define SCHIZO_PCICTRL_SBH_INT (1UL << 18UL) /* Safari */ | |
17630 | -#define SCHIZO_PCICTRL_T_DTO_INT (1UL << 18UL) /* Tomatillo */ | |
17631 | -#define SCHIZO_PCICTRL_EEN (1UL << 17UL) /* Safari/Tomatillo */ | |
17632 | -#define SCHIZO_PCICTRL_PARK (1UL << 16UL) /* Safari/Tomatillo */ | |
17633 | -#define SCHIZO_PCICTRL_PCIRST (1UL << 8UL) /* Safari */ | |
17634 | -#define SCHIZO_PCICTRL_ARB_S (0x3fUL << 0UL) /* Safari */ | |
17635 | -#define SCHIZO_PCICTRL_ARB_T (0xffUL << 0UL) /* Tomatillo */ | |
17636 | ||
17637 | struct pci_pbm_info *pbm_for_ino(struct pci_controller_info *p, u32 ino) | |
17638 | { | |
17639 | diff -Nru a/arch/sparc64/kernel/semaphore.c b/arch/sparc64/kernel/semaphore.c | |
17640 | --- a/arch/sparc64/kernel/semaphore.c Mon Oct 14 05:17:46 2002 | |
17641 | +++ b/arch/sparc64/kernel/semaphore.c Wed Sep 3 23:40:12 2003 | |
17642 | @@ -110,6 +110,7 @@ | |
17643 | ||
17644 | void down(struct semaphore *sem) | |
17645 | { | |
17646 | + might_sleep(); | |
17647 | /* This atomically does: | |
17648 | * old_val = sem->count; | |
17649 | * new_val = sem->count - 1; | |
17650 | @@ -219,6 +220,7 @@ | |
17651 | { | |
17652 | int ret = 0; | |
17653 | ||
17654 | + might_sleep(); | |
17655 | /* This atomically does: | |
17656 | * old_val = sem->count; | |
17657 | * new_val = sem->count - 1; | |
17658 | diff -Nru a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c | |
17659 | --- a/arch/sparc64/kernel/sys_sparc32.c Sat Aug 16 07:09:56 2003 | |
17660 | +++ b/arch/sparc64/kernel/sys_sparc32.c Sat Aug 30 22:29:28 2003 | |
17661 | @@ -388,7 +388,7 @@ | |
17662 | * | |
17663 | * This is really horribly ugly. | |
17664 | */ | |
17665 | -#define IPCOP_MASK(__x) (1UL << (__x)) | |
17666 | +#define IPCOP_MASK(__x) (1UL << ((__x)&~IPC_64)) | |
17667 | static int do_sys32_semctl(int first, int second, int third, void *uptr) | |
17668 | { | |
17669 | union semun fourth; | |
17670 | @@ -400,7 +400,7 @@ | |
17671 | err = -EFAULT; | |
17672 | if (get_user (pad, (u32 *)uptr)) | |
17673 | goto out; | |
17674 | - if(third == SETVAL) | |
17675 | + if ((third & ~IPC_64) == SETVAL) | |
17676 | fourth.val = (int)pad; | |
17677 | else | |
17678 | fourth.__pad = (void *)A(pad); | |
17679 | @@ -2779,3 +2779,41 @@ | |
17680 | return sys_lookup_dcookie((u64)cookie_high << 32 | cookie_low, | |
17681 | buf, len); | |
17682 | } | |
17683 | + | |
17684 | +extern asmlinkage long | |
17685 | +sys_timer_create(clockid_t which_clock, struct sigevent *timer_event_spec, | |
17686 | + timer_t * created_timer_id); | |
17687 | + | |
17688 | +long | |
17689 | +sys32_timer_create(u32 clock, struct sigevent32 *se32, timer_t *timer_id) | |
17690 | +{ | |
17691 | + struct sigevent se; | |
17692 | + mm_segment_t oldfs; | |
17693 | + timer_t t; | |
17694 | + long err; | |
17695 | + | |
17696 | + if (se32 == NULL) | |
17697 | + return sys_timer_create(clock, NULL, timer_id); | |
17698 | + | |
17699 | + memset(&se, 0, sizeof(struct sigevent)); | |
17700 | + if (get_user(se.sigev_value.sival_int, &se32->sigev_value.sival_int) || | |
17701 | + __get_user(se.sigev_signo, &se32->sigev_signo) || | |
17702 | + __get_user(se.sigev_notify, &se32->sigev_notify) || | |
17703 | + __copy_from_user(&se._sigev_un._pad, &se32->_sigev_un._pad, | |
17704 | + sizeof(se._sigev_un._pad))) | |
17705 | + return -EFAULT; | |
17706 | + | |
17707 | + if (!access_ok(VERIFY_WRITE,timer_id,sizeof(timer_t))) | |
17708 | + return -EFAULT; | |
17709 | + | |
17710 | + oldfs = get_fs(); | |
17711 | + set_fs(KERNEL_DS); | |
17712 | + err = sys_timer_create(clock, &se, &t); | |
17713 | + set_fs(oldfs); | |
17714 | + | |
17715 | + if (!err) | |
17716 | + err = __put_user (t, timer_id); | |
17717 | + | |
17718 | + return err; | |
17719 | +} | |
17720 | + | |
17721 | diff -Nru a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c | |
17722 | --- a/arch/sparc64/kernel/sys_sunos32.c Sun May 25 17:00:00 2003 | |
17723 | +++ b/arch/sparc64/kernel/sys_sunos32.c Tue Aug 26 09:25:41 2003 | |
17724 | @@ -90,7 +90,7 @@ | |
17725 | if (!file) | |
17726 | goto out; | |
17727 | inode = file->f_dentry->d_inode; | |
17728 | - if (minor(inode->i_rdev) == MEM_MAJOR && minor(inode->i_rdev) == 5) { | |
17729 | + if (imajor(inode) == MEM_MAJOR && iminor(inode) == 5) { | |
17730 | flags |= MAP_ANONYMOUS; | |
17731 | fput(file); | |
17732 | file = NULL; | |
17733 | diff -Nru a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S | |
17734 | --- a/arch/sparc64/kernel/systbls.S Sat Aug 16 14:55:44 2003 | |
17735 | +++ b/arch/sparc64/kernel/systbls.S Thu Aug 28 01:35:18 2003 | |
17736 | @@ -72,7 +72,7 @@ | |
17737 | /*250*/ .word sys32_mremap, sys32_sysctl, sys_getsid, sys_fdatasync, sys32_nfsservctl | |
17738 | .word sys_ni_syscall, compat_clock_settime, compat_clock_gettime, compat_clock_getres, compat_clock_nanosleep | |
17739 | /*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, compat_timer_settime, compat_timer_gettime, sys_timer_getoverrun | |
17740 | - .word sys_timer_delete, sys_ni_syscall | |
17741 | + .word sys_timer_delete, sys32_timer_create, sys_ni_syscall | |
17742 | ||
17743 | /* Now the 64-bit native Linux syscall table. */ | |
17744 | ||
17745 | @@ -133,7 +133,7 @@ | |
17746 | /*250*/ .word sys64_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl | |
17747 | .word sys_ni_syscall, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep | |
17748 | /*260*/ .word sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun | |
17749 | - .word sys_timer_delete, sys_ni_syscall | |
17750 | + .word sys_timer_delete, sys_timer_create, sys_ni_syscall | |
17751 | ||
17752 | #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ | |
17753 | defined(CONFIG_SOLARIS_EMUL_MODULE) | |
17754 | @@ -228,10 +228,10 @@ | |
17755 | .word sunos_nosys, sunos_nosys, sunos_nosys | |
17756 | .word sunos_nosys, sunos_nosys | |
17757 | /*250*/ .word sunos_nosys, sunos_nosys, sunos_nosys | |
17758 | - .word sunos_nosys, sunos_nosys, sys_ni_syscall | |
17759 | - .word sys_ni_syscall, sys_ni_syscall, sys_ni_syscall | |
17760 | - .word sys_ni_syscall, sys_ni_syscall, sys_ni_syscall | |
17761 | - .word sys_ni_syscall, sys_ni_syscall, sys_ni_syscall | |
17762 | - .word sys_ni_syscall, sys_ni_syscall | |
17763 | + .word sunos_nosys, sunos_nosys, sunos_nosys | |
17764 | + .word sunos_nosys, sunos_nosys, sunos_nosys | |
17765 | + .word sunos_nosys, sunos_nosys, sunos_nosys | |
17766 | + .word sunos_nosys, sunos_nosys, sunos_nosys | |
17767 | + .word sunos_nosys, sunos_nosys, sunos_nosys | |
17768 | ||
17769 | #endif | |
17770 | diff -Nru a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c | |
17771 | --- a/arch/sparc64/mm/hugetlbpage.c Mon Feb 24 23:13:11 2003 | |
17772 | +++ b/arch/sparc64/mm/hugetlbpage.c Tue Aug 26 09:41:27 2003 | |
17773 | @@ -380,207 +380,6 @@ | |
17774 | return 1; | |
17775 | } | |
17776 | ||
17777 | -static struct inode *set_new_inode(unsigned long len, int prot, int flag, int key) | |
17778 | -{ | |
17779 | - struct inode *inode; | |
17780 | - int i; | |
17781 | - | |
17782 | - for (i = 0; i < MAX_ID; i++) { | |
17783 | - if (htlbpagek[i].key == 0) | |
17784 | - break; | |
17785 | - } | |
17786 | - if (i == MAX_ID) | |
17787 | - return NULL; | |
17788 | - inode = kmalloc(sizeof (struct inode), GFP_KERNEL); | |
17789 | - if (inode == NULL) | |
17790 | - return NULL; | |
17791 | - | |
17792 | - inode_init_once(inode); | |
17793 | - atomic_inc(&inode->i_writecount); | |
17794 | - inode->i_mapping = &inode->i_data; | |
17795 | - inode->i_mapping->host = inode; | |
17796 | - inode->i_ino = (unsigned long)key; | |
17797 | - | |
17798 | - htlbpagek[i].key = key; | |
17799 | - htlbpagek[i].in = inode; | |
17800 | - inode->i_uid = current->fsuid; | |
17801 | - inode->i_gid = current->fsgid; | |
17802 | - inode->i_mode = prot; | |
17803 | - inode->i_size = len; | |
17804 | - return inode; | |
17805 | -} | |
17806 | - | |
17807 | -static int check_size_prot(struct inode *inode, unsigned long len, int prot, int flag) | |
17808 | -{ | |
17809 | - if (inode->i_uid != current->fsuid) | |
17810 | - return -1; | |
17811 | - if (inode->i_gid != current->fsgid) | |
17812 | - return -1; | |
17813 | - if (inode->i_size != len) | |
17814 | - return -1; | |
17815 | - return 0; | |
17816 | -} | |
17817 | - | |
17818 | -static int alloc_shared_hugetlb_pages(int key, unsigned long addr, unsigned long len, | |
17819 | - int prot, int flag) | |
17820 | -{ | |
17821 | - struct mm_struct *mm = current->mm; | |
17822 | - struct vm_area_struct *vma; | |
17823 | - struct inode *inode; | |
17824 | - struct address_space *mapping; | |
17825 | - struct page *page; | |
17826 | - int idx; | |
17827 | - int retval = -ENOMEM; | |
17828 | - int newalloc = 0; | |
17829 | - | |
17830 | -try_again: | |
17831 | - spin_lock(&htlbpage_lock); | |
17832 | - | |
17833 | - inode = find_key_inode(key); | |
17834 | - if (inode == NULL) { | |
17835 | - if (!capable(CAP_SYS_ADMIN)) { | |
17836 | - if (!in_group_p(0)) { | |
17837 | - retval = -EPERM; | |
17838 | - goto out_err; | |
17839 | - } | |
17840 | - } | |
17841 | - if (!(flag & IPC_CREAT)) { | |
17842 | - retval = -ENOENT; | |
17843 | - goto out_err; | |
17844 | - } | |
17845 | - inode = set_new_inode(len, prot, flag, key); | |
17846 | - if (inode == NULL) | |
17847 | - goto out_err; | |
17848 | - newalloc = 1; | |
17849 | - } else { | |
17850 | - if (check_size_prot(inode, len, prot, flag) < 0) { | |
17851 | - retval = -EINVAL; | |
17852 | - goto out_err; | |
17853 | - } else if (atomic_read(&inode->i_writecount)) { | |
17854 | - spin_unlock(&htlbpage_lock); | |
17855 | - goto try_again; | |
17856 | - } | |
17857 | - } | |
17858 | - spin_unlock(&htlbpage_lock); | |
17859 | - mapping = inode->i_mapping; | |
17860 | - | |
17861 | - addr = do_mmap_pgoff(NULL, addr, len, (unsigned long) prot, | |
17862 | - MAP_NORESERVE|MAP_FIXED|MAP_PRIVATE|MAP_ANONYMOUS, 0); | |
17863 | - if (IS_ERR((void *) addr)) | |
17864 | - goto freeinode; | |
17865 | - | |
17866 | - vma = find_vma(mm, addr); | |
17867 | - if (!vma) { | |
17868 | - retval = -EINVAL; | |
17869 | - goto freeinode; | |
17870 | - } | |
17871 | - | |
17872 | - spin_lock(&mm->page_table_lock); | |
17873 | - do { | |
17874 | - pte_t *pte = huge_pte_alloc_map(mm, addr); | |
17875 | - | |
17876 | - if (!pte || !pte_none(pte)) { | |
17877 | - if (pte) | |
17878 | - pte_unmap(pte); | |
17879 | - goto out; | |
17880 | - } | |
17881 | - | |
17882 | - idx = (addr - vma->vm_start) >> HPAGE_SHIFT; | |
17883 | - page = find_get_page(mapping, idx); | |
17884 | - if (page == NULL) { | |
17885 | - page = alloc_hugetlb_page(); | |
17886 | - if (page == NULL) { | |
17887 | - pte_unmap(pte); | |
17888 | - retval = -ENOMEM; | |
17889 | - goto out; | |
17890 | - } | |
17891 | - retval = add_to_page_cache(page, mapping, | |
17892 | - idx, GFP_ATOMIC); | |
17893 | - if (retval) { | |
17894 | - pte_unmap(pte); | |
17895 | - free_hugetlb_page(page); | |
17896 | - goto out; | |
17897 | - } | |
17898 | - } | |
17899 | - set_huge_pte(mm, vma, page, pte, | |
17900 | - (vma->vm_flags & VM_WRITE)); | |
17901 | - pte_unmap(pte); | |
17902 | - | |
17903 | - addr += HPAGE_SIZE; | |
17904 | - } while (addr < vma->vm_end); | |
17905 | - | |
17906 | - retval = 0; | |
17907 | - vma->vm_flags |= (VM_HUGETLB | VM_RESERVED); | |
17908 | - vma->vm_ops = &hugetlb_vm_ops; | |
17909 | - spin_unlock(&mm->page_table_lock); | |
17910 | - spin_lock(&htlbpage_lock); | |
17911 | - atomic_set(&inode->i_writecount, 0); | |
17912 | - spin_unlock(&htlbpage_lock); | |
17913 | - | |
17914 | - return retval; | |
17915 | - | |
17916 | -out: | |
17917 | - if (addr > vma->vm_start) { | |
17918 | - unsigned long raddr; | |
17919 | - raddr = vma->vm_end; | |
17920 | - vma->vm_end = addr; | |
17921 | - | |
17922 | - flush_cache_range(vma, vma->vm_start, vma->vm_end); | |
17923 | - zap_hugetlb_resources(vma); | |
17924 | - flush_tlb_range(vma, vma->vm_start, vma->vm_end); | |
17925 | - | |
17926 | - vma->vm_end = raddr; | |
17927 | - } | |
17928 | - spin_unlock(&mm->page_table_lock); | |
17929 | - do_munmap(mm, vma->vm_start, len); | |
17930 | - if (newalloc) | |
17931 | - goto freeinode; | |
17932 | - | |
17933 | - return retval; | |
17934 | - | |
17935 | -out_err: | |
17936 | - spin_unlock(&htlbpage_lock); | |
17937 | - | |
17938 | -freeinode: | |
17939 | - if (newalloc) { | |
17940 | - for (idx = 0; idx < MAX_ID; idx++) { | |
17941 | - if (htlbpagek[idx].key == inode->i_ino) { | |
17942 | - htlbpagek[idx].key = 0; | |
17943 | - htlbpagek[idx].in = NULL; | |
17944 | - break; | |
17945 | - } | |
17946 | - } | |
17947 | - kfree(inode); | |
17948 | - } | |
17949 | - return retval; | |
17950 | -} | |
17951 | - | |
17952 | -static int alloc_private_hugetlb_pages(int key, unsigned long addr, unsigned long len, | |
17953 | - int prot, int flag) | |
17954 | -{ | |
17955 | - if (!capable(CAP_SYS_ADMIN)) { | |
17956 | - if (!in_group_p(0)) | |
17957 | - return -EPERM; | |
17958 | - } | |
17959 | - addr = do_mmap_pgoff(NULL, addr, len, prot, | |
17960 | - MAP_NORESERVE|MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0); | |
17961 | - if (IS_ERR((void *) addr)) | |
17962 | - return -ENOMEM; | |
17963 | - if (make_hugetlb_pages_present(addr, (addr + len), flag) < 0) { | |
17964 | - do_munmap(current->mm, addr, len); | |
17965 | - return -ENOMEM; | |
17966 | - } | |
17967 | - return 0; | |
17968 | -} | |
17969 | - | |
17970 | -int alloc_hugetlb_pages(int key, unsigned long addr, unsigned long len, int prot, | |
17971 | - int flag) | |
17972 | -{ | |
17973 | - if (key > 0) | |
17974 | - return alloc_shared_hugetlb_pages(key, addr, len, prot, flag); | |
17975 | - return alloc_private_hugetlb_pages(key, addr, len, prot, flag); | |
17976 | -} | |
17977 | - | |
17978 | extern long htlbzone_pages; | |
17979 | extern struct list_head htlbpage_freelist; | |
17980 | ||
17981 | diff -Nru a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c | |
17982 | --- a/arch/sparc64/solaris/misc.c Tue Aug 19 12:12:41 2003 | |
17983 | +++ b/arch/sparc64/solaris/misc.c Tue Aug 26 09:25:41 2003 | |
17984 | @@ -77,8 +77,8 @@ | |
17985 | goto out; | |
17986 | else { | |
17987 | struct inode * inode = file->f_dentry->d_inode; | |
17988 | - if(major(inode->i_rdev) == MEM_MAJOR && | |
17989 | - minor(inode->i_rdev) == 5) { | |
17990 | + if(imajor(inode) == MEM_MAJOR && | |
17991 | + iminor(inode) == 5) { | |
17992 | flags |= MAP_ANONYMOUS; | |
17993 | fput(file); | |
17994 | file = NULL; | |
17995 | diff -Nru a/arch/sparc64/solaris/socksys.c b/arch/sparc64/solaris/socksys.c | |
17996 | --- a/arch/sparc64/solaris/socksys.c Wed May 7 08:47:29 2003 | |
17997 | +++ b/arch/sparc64/solaris/socksys.c Tue Aug 26 09:25:40 2003 | |
17998 | @@ -70,14 +70,14 @@ | |
17999 | (int (*)(int,int,int))SUNOS(97); | |
18000 | struct sol_socket_struct * sock; | |
18001 | ||
18002 | - family = ((minor(inode->i_rdev) >> 4) & 0xf); | |
18003 | + family = ((iminor(inode) >> 4) & 0xf); | |
18004 | switch (family) { | |
18005 | case AF_UNIX: | |
18006 | type = SOCK_STREAM; | |
18007 | protocol = 0; | |
18008 | break; | |
18009 | case AF_INET: | |
18010 | - protocol = af_inet_protocols[minor(inode->i_rdev) & 0xf]; | |
18011 | + protocol = af_inet_protocols[iminor(inode) & 0xf]; | |
18012 | switch (protocol) { | |
18013 | case IPPROTO_TCP: type = SOCK_STREAM; break; | |
18014 | case IPPROTO_UDP: type = SOCK_DGRAM; break; | |
18015 | diff -Nru a/arch/sparc64/solaris/systbl.S b/arch/sparc64/solaris/systbl.S | |
18016 | --- a/arch/sparc64/solaris/systbl.S Mon Aug 18 01:08:52 2003 | |
18017 | +++ b/arch/sparc64/solaris/systbl.S Wed Aug 27 23:52:25 2003 | |
18018 | @@ -294,4 +294,5 @@ | |
18019 | .word solaris_unimplemented /* 264 */ | |
18020 | .word solaris_unimplemented /* 265 */ | |
18021 | .word solaris_unimplemented /* 266 */ | |
18022 | + .word solaris_unimplemented /* 267 */ | |
18023 | ||
18024 | diff -Nru a/arch/sparc64/solaris/timod.c b/arch/sparc64/solaris/timod.c | |
18025 | --- a/arch/sparc64/solaris/timod.c Fri Jun 6 04:40:53 2003 | |
18026 | +++ b/arch/sparc64/solaris/timod.c Tue Aug 26 09:25:41 2003 | |
18027 | @@ -924,7 +924,7 @@ | |
18028 | if (!ino) goto out; | |
18029 | ||
18030 | if (!ino->i_sock && | |
18031 | - (major(ino->i_rdev) != 30 || minor(ino->i_rdev) != 1)) | |
18032 | + (imajor(ino) != 30 || iminor(ino) != 1)) | |
18033 | goto out; | |
18034 | ||
18035 | ctlptr = (struct strbuf *)A(arg1); | |
18036 | diff -Nru a/arch/v850/Kconfig b/arch/v850/Kconfig | |
18037 | --- a/arch/v850/Kconfig Sat Aug 2 14:26:16 2003 | |
18038 | +++ b/arch/v850/Kconfig Sun Aug 31 16:14:22 2003 | |
18039 | @@ -262,14 +262,6 @@ | |
18040 | ||
18041 | menu "Executable file formats" | |
18042 | ||
18043 | -config KCORE_AOUT | |
18044 | - bool | |
18045 | - default y | |
18046 | - | |
18047 | -config KCORE_ELF | |
18048 | - bool | |
18049 | - default y | |
18050 | - | |
18051 | source "fs/Kconfig.binfmt" | |
18052 | ||
18053 | endmenu | |
18054 | diff -Nru a/arch/v850/kernel/vmlinux.lds.S b/arch/v850/kernel/vmlinux.lds.S | |
18055 | --- a/arch/v850/kernel/vmlinux.lds.S Mon Aug 4 20:42:12 2003 | |
18056 | +++ b/arch/v850/kernel/vmlinux.lds.S Tue Aug 26 00:21:26 2003 | |
18057 | @@ -33,6 +33,30 @@ | |
18058 | *(.intv.mach) /* Machine-specific int. vectors. */ \ | |
18059 | __intv_end = . ; | |
18060 | ||
18061 | +#define RODATA_CONTENTS \ | |
18062 | + . = ALIGN (16) ; \ | |
18063 | + *(.rodata) *(.rodata.*) \ | |
18064 | + *(__vermagic) /* Kernel version magic */ \ | |
18065 | + *(.rodata1) \ | |
18066 | + /* Kernel symbol table: Normal symbols */ \ | |
18067 | + ___start___ksymtab = .; \ | |
18068 | + *(__ksymtab) \ | |
18069 | + ___stop___ksymtab = .; \ | |
18070 | + /* Kernel symbol table: GPL-only symbols */ \ | |
18071 | + ___start___ksymtab_gpl = .; \ | |
18072 | + *(__ksymtab_gpl) \ | |
18073 | + ___stop___ksymtab_gpl = .; \ | |
18074 | + /* Kernel symbol table: strings */ \ | |
18075 | + *(__ksymtab_strings) \ | |
18076 | + /* Kernel symbol table: Normal symbols */ \ | |
18077 | + ___start___kcrctab = .; \ | |
18078 | + *(__kcrctab) \ | |
18079 | + ___stop___kcrctab = .; \ | |
18080 | + /* Kernel symbol table: GPL-only symbols */ \ | |
18081 | + ___start___kcrctab_gpl = .; \ | |
18082 | + *(__kcrctab_gpl) \ | |
18083 | + ___stop___kcrctab_gpl = .; \ | |
18084 | + | |
18085 | /* Kernel text segment, and some constant data areas. */ | |
18086 | #define TEXT_CONTENTS \ | |
18087 | __stext = . ; \ | |
18088 | @@ -42,7 +66,7 @@ | |
18089 | *(.text.lock) \ | |
18090 | *(.exitcall.exit) \ | |
18091 | __real_etext = . ; /* There may be data after here. */ \ | |
18092 | - RODATA \ | |
18093 | + RODATA_CONTENTS \ | |
18094 | . = ALIGN (4) ; \ | |
18095 | *(.call_table_data) \ | |
18096 | *(.call_table_text) \ | |
18097 | diff -Nru a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig | |
18098 | --- a/arch/x86_64/Kconfig Sat Aug 2 14:26:16 2003 | |
18099 | +++ b/arch/x86_64/Kconfig Sun Aug 31 16:14:22 2003 | |
18100 | @@ -370,11 +370,6 @@ | |
18101 | ||
18102 | menu "Executable file formats / Emulations" | |
18103 | ||
18104 | -config KCORE_ELF | |
18105 | - bool | |
18106 | - depends on PROC_FS | |
18107 | - default y | |
18108 | - | |
18109 | source "fs/Kconfig.binfmt" | |
18110 | ||
18111 | config IA32_EMULATION | |
18112 | diff -Nru a/arch/x86_64/defconfig b/arch/x86_64/defconfig | |
18113 | --- a/arch/x86_64/defconfig Sat Aug 9 07:53:46 2003 | |
18114 | +++ b/arch/x86_64/defconfig Sat Aug 23 04:57:05 2003 | |
18115 | @@ -14,6 +14,7 @@ | |
18116 | # Code maturity level options | |
18117 | # | |
18118 | CONFIG_EXPERIMENTAL=y | |
18119 | +# CONFIG_BROKEN is not set | |
18120 | ||
18121 | # | |
18122 | # General setup | |
18123 | @@ -23,10 +24,12 @@ | |
18124 | # CONFIG_BSD_PROCESS_ACCT is not set | |
18125 | CONFIG_SYSCTL=y | |
18126 | CONFIG_LOG_BUF_SHIFT=18 | |
18127 | +# CONFIG_IKCONFIG is not set | |
18128 | # CONFIG_EMBEDDED is not set | |
18129 | CONFIG_KALLSYMS=y | |
18130 | CONFIG_FUTEX=y | |
18131 | CONFIG_EPOLL=y | |
18132 | +CONFIG_IOSCHED_NOOP=y | |
18133 | CONFIG_IOSCHED_AS=y | |
18134 | CONFIG_IOSCHED_DEADLINE=y | |
18135 | ||
18136 | @@ -72,10 +75,10 @@ | |
18137 | CONFIG_SOFTWARE_SUSPEND=y | |
18138 | ||
18139 | # | |
18140 | -# ACPI Support | |
18141 | +# ACPI (Advanced Configuration and Power Interface) Support | |
18142 | # | |
18143 | +# CONFIG_ACPI_HT is not set | |
18144 | CONFIG_ACPI=y | |
18145 | -# CONFIG_ACPI_HT_ONLY is not set | |
18146 | CONFIG_ACPI_BOOT=y | |
18147 | CONFIG_ACPI_SLEEP=y | |
18148 | CONFIG_ACPI_SLEEP_PROC_FS=y | |
18149 | @@ -117,7 +120,6 @@ | |
18150 | # | |
18151 | # Generic Driver Options | |
18152 | # | |
18153 | -# CONFIG_FW_LOADER is not set | |
18154 | ||
18155 | # | |
18156 | # Memory Technology Devices (MTD) | |
18157 | @@ -159,6 +161,7 @@ | |
18158 | CONFIG_IDEDISK_MULTI_MODE=y | |
18159 | # CONFIG_IDEDISK_STROKE is not set | |
18160 | CONFIG_BLK_DEV_IDECD=y | |
18161 | +# CONFIG_BLK_DEV_IDETAPE is not set | |
18162 | # CONFIG_BLK_DEV_IDEFLOPPY is not set | |
18163 | # CONFIG_BLK_DEV_IDESCSI is not set | |
18164 | # CONFIG_IDE_TASK_IOCTL is not set | |
18165 | @@ -318,7 +321,6 @@ | |
18166 | # CONFIG_DECNET is not set | |
18167 | # CONFIG_BRIDGE is not set | |
18168 | # CONFIG_NETFILTER is not set | |
18169 | -# CONFIG_XFRM_USER is not set | |
18170 | ||
18171 | # | |
18172 | # SCTP Configuration (EXPERIMENTAL) | |
18173 | @@ -405,6 +407,7 @@ | |
18174 | # CONFIG_HAMACHI is not set | |
18175 | # CONFIG_YELLOWFIN is not set | |
18176 | # CONFIG_R8169 is not set | |
18177 | +# CONFIG_SIS190 is not set | |
18178 | # CONFIG_SK98LIN is not set | |
18179 | CONFIG_TIGON3=y | |
18180 | ||
18181 | @@ -595,10 +598,7 @@ | |
18182 | CONFIG_REISERFS_FS=y | |
18183 | # CONFIG_REISERFS_CHECK is not set | |
18184 | # CONFIG_REISERFS_PROC_INFO is not set | |
18185 | -CONFIG_JFS_FS=y | |
18186 | -CONFIG_JFS_POSIX_ACL=y | |
18187 | -# CONFIG_JFS_DEBUG is not set | |
18188 | -# CONFIG_JFS_STATISTICS is not set | |
18189 | +# CONFIG_JFS_FS is not set | |
18190 | CONFIG_FS_POSIX_ACL=y | |
18191 | # CONFIG_XFS_FS is not set | |
18192 | # CONFIG_MINIX_FS is not set | |
18193 | @@ -674,49 +674,6 @@ | |
18194 | # | |
18195 | # CONFIG_PARTITION_ADVANCED is not set | |
18196 | CONFIG_MSDOS_PARTITION=y | |
18197 | -CONFIG_NLS=y | |
18198 | - | |
18199 | -# | |
18200 | -# Native Language Support | |
18201 | -# | |
18202 | -CONFIG_NLS_DEFAULT="iso8859-1" | |
18203 | -# CONFIG_NLS_CODEPAGE_437 is not set | |
18204 | -# CONFIG_NLS_CODEPAGE_737 is not set | |
18205 | -# CONFIG_NLS_CODEPAGE_775 is not set | |
18206 | -# CONFIG_NLS_CODEPAGE_850 is not set | |
18207 | -# CONFIG_NLS_CODEPAGE_852 is not set | |
18208 | -# CONFIG_NLS_CODEPAGE_855 is not set | |
18209 | -# CONFIG_NLS_CODEPAGE_857 is not set | |
18210 | -# CONFIG_NLS_CODEPAGE_860 is not set | |
18211 | -# CONFIG_NLS_CODEPAGE_861 is not set | |
18212 | -# CONFIG_NLS_CODEPAGE_862 is not set | |
18213 | -# CONFIG_NLS_CODEPAGE_863 is not set | |
18214 | -# CONFIG_NLS_CODEPAGE_864 is not set | |
18215 | -# CONFIG_NLS_CODEPAGE_865 is not set | |
18216 | -# CONFIG_NLS_CODEPAGE_866 is not set | |
18217 | -# CONFIG_NLS_CODEPAGE_869 is not set | |
18218 | -# CONFIG_NLS_CODEPAGE_936 is not set | |
18219 | -# CONFIG_NLS_CODEPAGE_950 is not set | |
18220 | -# CONFIG_NLS_CODEPAGE_932 is not set | |
18221 | -# CONFIG_NLS_CODEPAGE_949 is not set | |
18222 | -# CONFIG_NLS_CODEPAGE_874 is not set | |
18223 | -# CONFIG_NLS_ISO8859_8 is not set | |
18224 | -# CONFIG_NLS_CODEPAGE_1250 is not set | |
18225 | -# CONFIG_NLS_CODEPAGE_1251 is not set | |
18226 | -# CONFIG_NLS_ISO8859_1 is not set | |
18227 | -# CONFIG_NLS_ISO8859_2 is not set | |
18228 | -# CONFIG_NLS_ISO8859_3 is not set | |
18229 | -# CONFIG_NLS_ISO8859_4 is not set | |
18230 | -# CONFIG_NLS_ISO8859_5 is not set | |
18231 | -# CONFIG_NLS_ISO8859_6 is not set | |
18232 | -# CONFIG_NLS_ISO8859_7 is not set | |
18233 | -# CONFIG_NLS_ISO8859_9 is not set | |
18234 | -# CONFIG_NLS_ISO8859_13 is not set | |
18235 | -# CONFIG_NLS_ISO8859_14 is not set | |
18236 | -# CONFIG_NLS_ISO8859_15 is not set | |
18237 | -# CONFIG_NLS_KOI8_R is not set | |
18238 | -# CONFIG_NLS_KOI8_U is not set | |
18239 | -# CONFIG_NLS_UTF8 is not set | |
18240 | ||
18241 | # | |
18242 | # Graphics support | |
18243 | diff -Nru a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c | |
18244 | --- a/arch/x86_64/ia32/ia32_ioctl.c Fri Jul 11 05:14:13 2003 | |
18245 | +++ b/arch/x86_64/ia32/ia32_ioctl.c Sun Aug 31 16:14:44 2003 | |
18246 | @@ -673,12 +673,10 @@ | |
18247 | return err; | |
18248 | } | |
18249 | ||
18250 | -#define REF_SYMBOL(handler) if (0) (void)handler; | |
18251 | -#define HANDLE_IOCTL2(cmd,handler) REF_SYMBOL(handler); asm volatile(".quad %P0, " #handler ",0"::"i" (cmd)); | |
18252 | -#define HANDLE_IOCTL(cmd,handler) HANDLE_IOCTL2(cmd,handler) | |
18253 | +#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL }, | |
18254 | #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd,sys_ioctl) | |
18255 | -#define IOCTL_TABLE_START void ioctl_dummy(void) { asm volatile("\n.global ioctl_start\nioctl_start:\n\t" ); | |
18256 | -#define IOCTL_TABLE_END asm volatile("\n.global ioctl_end;\nioctl_end:\n"); } | |
18257 | +#define IOCTL_TABLE_START struct ioctl_trans ioctl_start[] = { | |
18258 | +#define IOCTL_TABLE_END }; | |
18259 | ||
18260 | IOCTL_TABLE_START | |
18261 | #include <linux/compat_ioctl.h> | |
18262 | @@ -765,3 +763,4 @@ | |
18263 | HANDLE_IOCTL(MTRRIOC32_KILL_PAGE_ENTRY, mtrr_ioctl32) | |
18264 | IOCTL_TABLE_END | |
18265 | ||
18266 | +int ioctl_table_size = ARRAY_SIZE(ioctl_start); | |
18267 | diff -Nru a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c | |
18268 | --- a/arch/x86_64/ia32/sys_ia32.c Mon Jul 14 04:19:39 2003 | |
18269 | +++ b/arch/x86_64/ia32/sys_ia32.c Sun Aug 31 05:33:07 2003 | |
18270 | @@ -1170,8 +1170,6 @@ | |
18271 | return ret; | |
18272 | } | |
18273 | ||
18274 | -extern void check_pending(int signum); | |
18275 | - | |
18276 | asmlinkage long sys_utimes(char *, struct timeval *); | |
18277 | ||
18278 | asmlinkage long | |
18279 | diff -Nru a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c | |
18280 | --- a/arch/x86_64/kernel/apic.c Mon Aug 18 19:46:23 2003 | |
18281 | +++ b/arch/x86_64/kernel/apic.c Sat Aug 23 05:13:33 2003 | |
18282 | @@ -299,7 +299,7 @@ | |
18283 | * This is meaningless in clustered apic mode, so we skip it. | |
18284 | */ | |
18285 | if (!clustered_apic_mode && | |
18286 | - !cpu_isset(GET_APIC_ID(apic_read(APIC_ID)), phys_cpu_present_map)) | |
18287 | + !physid_isset(GET_APIC_ID(apic_read(APIC_ID)), phys_cpu_present_map)) | |
18288 | BUG(); | |
18289 | ||
18290 | /* | |
18291 | @@ -993,7 +993,7 @@ | |
18292 | ||
18293 | connect_bsp_APIC(); | |
18294 | ||
18295 | - phys_cpu_present_map = cpumask_of_cpu(0); | |
18296 | + phys_cpu_present_map = physid_mask_of_physid(0); | |
18297 | apic_write_around(APIC_ID, boot_cpu_id); | |
18298 | ||
18299 | setup_local_APIC(); | |
18300 | diff -Nru a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c | |
18301 | --- a/arch/x86_64/kernel/io_apic.c Tue Aug 19 07:45:10 2003 | |
18302 | +++ b/arch/x86_64/kernel/io_apic.c Sat Aug 23 05:13:33 2003 | |
18303 | @@ -1014,7 +1014,7 @@ | |
18304 | static void __init setup_ioapic_ids_from_mpc (void) | |
18305 | { | |
18306 | union IO_APIC_reg_00 reg_00; | |
18307 | - cpumask_t phys_id_present_map = phys_cpu_present_map; | |
18308 | + physid_mask_t phys_id_present_map = phys_cpu_present_map; | |
18309 | int apic; | |
18310 | int i; | |
18311 | unsigned char old_id; | |
18312 | @@ -1047,22 +1047,22 @@ | |
18313 | * system must have a unique ID or we get lots of nice | |
18314 | * 'stuck on smp_invalidate_needed IPI wait' messages. | |
18315 | */ | |
18316 | - if (cpu_isset(mp_ioapics[apic].mpc_apicid, phys_id_present_map)) { | |
18317 | + if (physid_isset(mp_ioapics[apic].mpc_apicid, phys_id_present_map)) { | |
18318 | printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n", | |
18319 | apic, mp_ioapics[apic].mpc_apicid); | |
18320 | for (i = 0; i < 0xf; i++) | |
18321 | - if (!cpu_isset(i, phys_id_present_map)) | |
18322 | + if (!physid_isset(i, phys_id_present_map)) | |
18323 | break; | |
18324 | if (i >= 0xf) | |
18325 | panic("Max APIC ID exceeded!\n"); | |
18326 | printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", | |
18327 | i); | |
18328 | - cpu_set(i, phys_id_present_map); | |
18329 | + physid_set(i, phys_id_present_map); | |
18330 | mp_ioapics[apic].mpc_apicid = i; | |
18331 | } else { | |
18332 | printk(KERN_INFO | |
18333 | "Using IO-APIC %d\n", mp_ioapics[apic].mpc_apicid); | |
18334 | - cpu_set(mp_ioapics[apic].mpc_apicid, phys_id_present_map); | |
18335 | + physid_set(mp_ioapics[apic].mpc_apicid, phys_id_present_map); | |
18336 | } | |
18337 | ||
18338 | ||
18339 | @@ -1642,7 +1642,7 @@ | |
18340 | int __init io_apic_get_unique_id (int ioapic, int apic_id) | |
18341 | { | |
18342 | union IO_APIC_reg_00 reg_00; | |
18343 | - static cpumask_t apic_id_map; | |
18344 | + static physid_mask_t apic_id_map; | |
18345 | unsigned long flags; | |
18346 | int i = 0; | |
18347 | ||
18348 | @@ -1655,7 +1655,7 @@ | |
18349 | * advantage of new APIC bus architecture. | |
18350 | */ | |
18351 | ||
18352 | - if (!cpus_empty(apic_id_map)) | |
18353 | + if (!physids_empty(apic_id_map)) | |
18354 | apic_id_map = phys_cpu_present_map; | |
18355 | ||
18356 | spin_lock_irqsave(&ioapic_lock, flags); | |
18357 | @@ -1672,10 +1672,10 @@ | |
18358 | * Every APIC in a system must have a unique ID or we get lots of nice | |
18359 | * 'stuck on smp_invalidate_needed IPI wait' messages. | |
18360 | */ | |
18361 | - if (cpu_isset(apic_id, apic_id_map)) { | |
18362 | + if (physid_isset(apic_id, apic_id_map)) { | |
18363 | ||
18364 | for (i = 0; i < IO_APIC_MAX_ID; i++) { | |
18365 | - if (!cpu_isset(i, apic_id_map)) | |
18366 | + if (!physid_isset(i, apic_id_map)) | |
18367 | break; | |
18368 | } | |
18369 | ||
18370 | @@ -1688,7 +1688,7 @@ | |
18371 | apic_id = i; | |
18372 | } | |
18373 | ||
18374 | - cpu_set(apic_id, apic_id_map); | |
18375 | + physid_set(apic_id, apic_id_map); | |
18376 | ||
18377 | if (reg_00.bits.ID != apic_id) { | |
18378 | reg_00.bits.ID = apic_id; | |
18379 | diff -Nru a/arch/x86_64/kernel/ioport.c b/arch/x86_64/kernel/ioport.c | |
18380 | --- a/arch/x86_64/kernel/ioport.c Wed Aug 20 10:43:52 2003 | |
18381 | +++ b/arch/x86_64/kernel/ioport.c Sat Aug 23 05:03:34 2003 | |
18382 | @@ -10,12 +10,11 @@ | |
18383 | #include <linux/errno.h> | |
18384 | #include <linux/types.h> | |
18385 | #include <linux/ioport.h> | |
18386 | -#include <linux/mm.h> | |
18387 | #include <linux/smp.h> | |
18388 | #include <linux/smp_lock.h> | |
18389 | #include <linux/stddef.h> | |
18390 | #include <linux/slab.h> | |
18391 | -#include <asm/io.h> | |
18392 | +#include <linux/thread_info.h> | |
18393 | ||
18394 | /* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */ | |
18395 | static void set_bitmap(unsigned long *bitmap, unsigned int base, unsigned int extent, int new_value) | |
18396 | @@ -118,12 +117,7 @@ | |
18397 | return -EPERM; | |
18398 | } | |
18399 | regs.eflags = (regs.eflags &~ 0x3000UL) | (level << 12); | |
18400 | + /* Make sure we return the long way (not sysenter) */ | |
18401 | + set_thread_flag(TIF_IRET); | |
18402 | return 0; | |
18403 | } | |
18404 | - | |
18405 | -void eat_key(void) | |
18406 | -{ | |
18407 | - if (inb(0x60) & 1) | |
18408 | - inb(0x64); | |
18409 | -} | |
18410 | - | |
18411 | diff -Nru a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c | |
18412 | --- a/arch/x86_64/kernel/mpparse.c Tue Aug 19 07:45:28 2003 | |
18413 | +++ b/arch/x86_64/kernel/mpparse.c Sat Aug 23 05:13:33 2003 | |
18414 | @@ -67,7 +67,7 @@ | |
18415 | static unsigned int num_processors = 0; | |
18416 | ||
18417 | /* Bitmask of physically existing CPUs */ | |
18418 | -cpumask_t phys_cpu_present_map = CPU_MASK_NONE; | |
18419 | +physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE; | |
18420 | ||
18421 | /* ACPI MADT entry parsing functions */ | |
18422 | #ifdef CONFIG_ACPI_BOOT | |
18423 | @@ -126,7 +126,7 @@ | |
18424 | } | |
18425 | ver = m->mpc_apicver; | |
18426 | ||
18427 | - cpu_set(m->mpc_apicid, phys_cpu_present_map); | |
18428 | + physid_set(m->mpc_apicid, phys_cpu_present_map); | |
18429 | /* | |
18430 | * Validate version | |
18431 | */ | |
18432 | diff -Nru a/arch/x86_64/kernel/msr.c b/arch/x86_64/kernel/msr.c | |
18433 | --- a/arch/x86_64/kernel/msr.c Mon Aug 18 19:46:23 2003 | |
18434 | +++ b/arch/x86_64/kernel/msr.c Tue Aug 26 09:25:40 2003 | |
18435 | @@ -194,7 +194,7 @@ | |
18436 | u32 data[2]; | |
18437 | size_t rv; | |
18438 | u32 reg = *ppos; | |
18439 | - int cpu = minor(file->f_dentry->d_inode->i_rdev); | |
18440 | + int cpu = iminor(file->f_dentry->d_inode); | |
18441 | int err; | |
18442 | ||
18443 | if ( count % 8 ) | |
18444 | @@ -219,7 +219,7 @@ | |
18445 | u32 data[2]; | |
18446 | size_t rv; | |
18447 | u32 reg = *ppos; | |
18448 | - int cpu = minor(file->f_dentry->d_inode->i_rdev); | |
18449 | + int cpu = iminor(file->f_dentry->d_inode); | |
18450 | int err; | |
18451 | ||
18452 | if ( count % 8 ) | |
18453 | @@ -239,7 +239,7 @@ | |
18454 | ||
18455 | static int msr_open(struct inode *inode, struct file *file) | |
18456 | { | |
18457 | - int cpu = minor(file->f_dentry->d_inode->i_rdev); | |
18458 | + int cpu = iminor(file->f_dentry->d_inode); | |
18459 | struct cpuinfo_x86 *c = &(cpu_data)[cpu]; | |
18460 | ||
18461 | if (!cpu_online(cpu)) | |
18462 | diff -Nru a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c | |
18463 | --- a/arch/x86_64/kernel/setup.c Mon Aug 18 19:46:23 2003 | |
18464 | +++ b/arch/x86_64/kernel/setup.c Sat Aug 23 04:55:48 2003 | |
18465 | @@ -243,6 +243,8 @@ | |
18466 | ||
18467 | void __init setup_arch(char **cmdline_p) | |
18468 | { | |
18469 | + unsigned long low_mem_size; | |
18470 | + | |
18471 | ROOT_DEV = ORIG_ROOT_DEV; | |
18472 | drive_info = DRIVE_INFO; | |
18473 | screen_info = SCREEN_INFO; | |
18474 | @@ -378,7 +380,13 @@ | |
18475 | request_resource(&ioport_resource, standard_io_resources+i); | |
18476 | } | |
18477 | ||
18478 | - pci_mem_start = IOMAP_START; | |
18479 | + /* Will likely break when you have unassigned resources with more | |
18480 | + than 4GB memory and bridges that don't support more than 4GB. | |
18481 | + Doing it properly would require to allocate GFP_DMA memory | |
18482 | + in this case. */ | |
18483 | + low_mem_size = ((end_pfn << PAGE_SHIFT) + 0xfffff) & ~0xfffff; | |
18484 | + if (low_mem_size > pci_mem_start) | |
18485 | + pci_mem_start = low_mem_size; | |
18486 | ||
18487 | #ifdef CONFIG_GART_IOMMU | |
18488 | iommu_hole_init(); | |
18489 | diff -Nru a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c | |
18490 | --- a/arch/x86_64/kernel/smpboot.c Mon Aug 18 19:46:23 2003 | |
18491 | +++ b/arch/x86_64/kernel/smpboot.c Sat Aug 23 05:13:33 2003 | |
18492 | @@ -734,10 +734,10 @@ | |
18493 | current_thread_info()->cpu = 0; | |
18494 | smp_tune_scheduling(); | |
18495 | ||
18496 | - if (!cpu_isset(hard_smp_processor_id(), phys_cpu_present_map)) { | |
18497 | + if (!physid_isset(hard_smp_processor_id(), phys_cpu_present_map)) { | |
18498 | printk("weird, boot CPU (#%d) not listed by the BIOS.\n", | |
18499 | hard_smp_processor_id()); | |
18500 | - cpu_set(hard_smp_processor_id(), phys_cpu_present_map); | |
18501 | + physid_set(hard_smp_processor_id(), phys_cpu_present_map); | |
18502 | } | |
18503 | ||
18504 | /* | |
18505 | @@ -748,7 +748,7 @@ | |
18506 | printk(KERN_NOTICE "SMP motherboard not detected.\n"); | |
18507 | io_apic_irqs = 0; | |
18508 | cpu_online_map = cpumask_of_cpu(0); | |
18509 | - phys_cpu_present_map = cpumask_of_cpu(0); | |
18510 | + phys_cpu_present_map = physid_mask_of_physid(0); | |
18511 | if (APIC_init_uniprocessor()) | |
18512 | printk(KERN_NOTICE "Local APIC not detected." | |
18513 | " Using dummy APIC emulation.\n"); | |
18514 | @@ -759,10 +759,10 @@ | |
18515 | * Should not be necessary because the MP table should list the boot | |
18516 | * CPU too, but we do it for the sake of robustness anyway. | |
18517 | */ | |
18518 | - if (!cpu_isset(boot_cpu_id, phys_cpu_present_map)) { | |
18519 | + if (!physid_isset(boot_cpu_id, phys_cpu_present_map)) { | |
18520 | printk(KERN_NOTICE "weird, boot CPU (#%d) not listed by the BIOS.\n", | |
18521 | boot_cpu_id); | |
18522 | - cpu_set(hard_smp_processor_id(), phys_cpu_present_map); | |
18523 | + physid_set(hard_smp_processor_id(), phys_cpu_present_map); | |
18524 | } | |
18525 | ||
18526 | /* | |
18527 | @@ -774,7 +774,7 @@ | |
18528 | printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n"); | |
18529 | io_apic_irqs = 0; | |
18530 | cpu_online_map = cpumask_of_cpu(0); | |
18531 | - phys_cpu_present_map = cpumask_of_cpu(0); | |
18532 | + phys_cpu_present_map = physid_mask_of_physid(0); | |
18533 | disable_apic = 1; | |
18534 | goto smp_done; | |
18535 | } | |
18536 | @@ -789,7 +789,7 @@ | |
18537 | printk(KERN_INFO "SMP mode deactivated, forcing use of dummy APIC emulation.\n"); | |
18538 | io_apic_irqs = 0; | |
18539 | cpu_online_map = cpumask_of_cpu(0); | |
18540 | - phys_cpu_present_map = cpumask_of_cpu(0); | |
18541 | + phys_cpu_present_map = physid_mask_of_physid(0); | |
18542 | disable_apic = 1; | |
18543 | goto smp_done; | |
18544 | } | |
18545 | @@ -803,7 +803,7 @@ | |
18546 | /* | |
18547 | * Now scan the CPU present map and fire up the other CPUs. | |
18548 | */ | |
18549 | - Dprintk("CPU present map: %lx\n", phys_cpu_present_map); | |
18550 | + Dprintk("CPU present map: %lx\n", physids_coerce(phys_cpu_present_map)); | |
18551 | ||
18552 | for (apicid = 0; apicid < NR_CPUS; apicid++) { | |
18553 | /* | |
18554 | diff -Nru a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c | |
18555 | --- a/arch/x86_64/kernel/time.c Thu Jul 10 22:22:57 2003 | |
18556 | +++ b/arch/x86_64/kernel/time.c Sat Aug 23 04:31:18 2003 | |
18557 | @@ -79,6 +79,7 @@ | |
18558 | unsigned long t; | |
18559 | unsigned long x; | |
18560 | rdtscll_sync(&t); | |
18561 | + if (t < vxtime.last_tsc) t = vxtime.last_tsc; /* hack */ | |
18562 | x = ((t - vxtime.last_tsc) * vxtime.tsc_quot) >> 32; | |
18563 | return x; | |
18564 | } | |
18565 | diff -Nru a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c | |
18566 | --- a/arch/x86_64/kernel/vsyscall.c Fri Jun 13 01:16:29 2003 | |
18567 | +++ b/arch/x86_64/kernel/vsyscall.c Sat Aug 23 04:31:40 2003 | |
18568 | @@ -85,6 +85,7 @@ | |
18569 | if (__vxtime.mode == VXTIME_TSC) { | |
18570 | sync_core(); | |
18571 | rdtscll(t); | |
18572 | + if (t < __vxtime.last_tsc) t = __vxtime.last_tsc; | |
18573 | usec += ((t - __vxtime.last_tsc) * | |
18574 | __vxtime.tsc_quot) >> 32; | |
18575 | } else { | |
18576 | diff -Nru a/drivers/Makefile b/drivers/Makefile | |
18577 | --- a/drivers/Makefile Tue Aug 12 08:42:21 2003 | |
18578 | +++ b/drivers/Makefile Sun Aug 24 07:59:26 2003 | |
18579 | @@ -20,6 +20,7 @@ | |
18580 | obj-y += base/ block/ misc/ net/ media/ | |
18581 | obj-$(CONFIG_NUBUS) += nubus/ | |
18582 | obj-$(CONFIG_ATM) += atm/ | |
18583 | +obj-$(CONFIG_PPC_PMAC) += macintosh/ | |
18584 | obj-$(CONFIG_IDE) += ide/ | |
18585 | obj-$(CONFIG_FC4) += fc4/ | |
18586 | obj-$(CONFIG_SCSI) += scsi/ | |
18587 | @@ -31,7 +32,6 @@ | |
18588 | obj-$(CONFIG_DIO) += dio/ | |
18589 | obj-$(CONFIG_SBUS) += sbus/ | |
18590 | obj-$(CONFIG_ZORRO) += zorro/ | |
18591 | -obj-$(CONFIG_PPC_PMAC) += macintosh/ | |
18592 | obj-$(CONFIG_MAC) += macintosh/ | |
18593 | obj-$(CONFIG_PARIDE) += block/paride/ | |
18594 | obj-$(CONFIG_TC) += tc/ | |
18595 | diff -Nru a/drivers/acorn/block/fd1772.c b/drivers/acorn/block/fd1772.c | |
18596 | --- a/drivers/acorn/block/fd1772.c Thu Aug 7 02:25:23 2003 | |
18597 | +++ b/drivers/acorn/block/fd1772.c Tue Aug 26 09:25:40 2003 | |
18598 | @@ -1455,8 +1455,8 @@ | |
18599 | ||
18600 | static int floppy_open(struct inode *inode, struct file *filp) | |
18601 | { | |
18602 | - int drive = minor(inode->i_rdev) & 3; | |
18603 | - int type = minor(inode->i_rdev) >> 2; | |
18604 | + int drive = iminor(inode) & 3; | |
18605 | + int type = iminor(inode) >> 2; | |
18606 | int old_dev = fd_device[drive]; | |
18607 | ||
18608 | if (fd_ref[drive] && old_dev != type) | |
18609 | @@ -1490,7 +1490,7 @@ | |
18610 | ||
18611 | static int floppy_release(struct inode *inode, struct file *filp) | |
18612 | { | |
18613 | - int drive = minor(inode->i_rdev) & 3; | |
18614 | + int drive = iminor(inode) & 3; | |
18615 | ||
18616 | if (fd_ref[drive] < 0) | |
18617 | fd_ref[drive] = 0; | |
18618 | diff -Nru a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig | |
18619 | --- a/drivers/acpi/Kconfig Wed Aug 20 09:06:49 2003 | |
18620 | +++ b/drivers/acpi/Kconfig Sat Aug 23 04:07:34 2003 | |
18621 | @@ -69,6 +69,7 @@ | |
18622 | bool "Sleep States (EXPERIMENTAL)" | |
18623 | depends on X86 && ACPI | |
18624 | depends on EXPERIMENTAL && PM | |
18625 | + select SOFTWARE_SUSPEND | |
18626 | default y | |
18627 | ---help--- | |
18628 | This option adds support for ACPI suspend states. | |
18629 | diff -Nru a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c | |
18630 | --- a/drivers/acpi/pci_link.c Tue Jul 29 13:28:29 2003 | |
18631 | +++ b/drivers/acpi/pci_link.c Sun Aug 31 16:14:25 2003 | |
18632 | @@ -516,9 +516,8 @@ | |
18633 | return_VALUE(0); | |
18634 | } | |
18635 | ||
18636 | - if (acpi_pci_link_allocate(link)) { | |
18637 | - return -ENODEV; | |
18638 | - } | |
18639 | + if (acpi_pci_link_allocate(link)) | |
18640 | + return_VALUE(0); | |
18641 | ||
18642 | if (!link->irq.active) { | |
18643 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link disabled\n")); | |
18644 | diff -Nru a/drivers/atm/Kconfig b/drivers/atm/Kconfig | |
18645 | --- a/drivers/atm/Kconfig Tue Jul 29 22:31:46 2003 | |
18646 | +++ b/drivers/atm/Kconfig Mon Aug 25 06:04:02 2003 | |
18647 | @@ -241,7 +241,7 @@ | |
18648 | ||
18649 | config ATM_AMBASSADOR | |
18650 | tristate "Madge Ambassador (Collage PCI 155 Server)" | |
18651 | - depends on PCI && ATM | |
18652 | + depends on PCI && ATM && BROKEN_ON_SMP | |
18653 | help | |
18654 | This is a driver for ATMizer based ATM card produced by Madge | |
18655 | Networks Ltd. Say Y (or M to compile as a module named ambassador) | |
18656 | diff -Nru a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c | |
18657 | --- a/drivers/atm/ambassador.c Tue Aug 19 21:10:45 2003 | |
18658 | +++ b/drivers/atm/ambassador.c Wed Aug 27 23:17:10 2003 | |
18659 | @@ -310,10 +310,11 @@ | |
18660 | 0xdeadbeef | |
18661 | }; | |
18662 | ||
18663 | +static void do_housekeeping (unsigned long arg); | |
18664 | /********** globals **********/ | |
18665 | ||
18666 | static amb_dev * amb_devs = NULL; | |
18667 | -static struct timer_list housekeeping; | |
18668 | +static struct timer_list housekeeping = TIMER_INITIALIZER(do_housekeeping, 0, 1); | |
18669 | ||
18670 | static unsigned short debug = 0; | |
18671 | static unsigned int cmds = 8; | |
18672 | @@ -937,63 +938,6 @@ | |
18673 | return IRQ_HANDLED; | |
18674 | } | |
18675 | ||
18676 | -/********** don't panic... yeah, right **********/ | |
18677 | - | |
18678 | -#ifdef DEBUG_AMBASSADOR | |
18679 | -static void dont_panic (amb_dev * dev) { | |
18680 | - amb_cq * cq = &dev->cq; | |
18681 | - volatile amb_cq_ptrs * ptrs = &cq->ptrs; | |
18682 | - amb_txq * txq; | |
18683 | - amb_rxq * rxq; | |
18684 | - command * cmd; | |
18685 | - tx_in * tx; | |
18686 | - tx_simple * tx_descr; | |
18687 | - unsigned char pool; | |
18688 | - rx_in * rx; | |
18689 | - | |
18690 | - unsigned long flags; | |
18691 | - save_flags (flags); | |
18692 | - cli(); | |
18693 | - | |
18694 | - PRINTK (KERN_INFO, "don't panic - putting adapter into reset"); | |
18695 | - wr_plain (dev, offsetof(amb_mem, reset_control), | |
18696 | - rd_plain (dev, offsetof(amb_mem, reset_control)) | AMB_RESET_BITS); | |
18697 | - | |
18698 | - PRINTK (KERN_INFO, "marking all commands complete"); | |
18699 | - for (cmd = ptrs->start; cmd < ptrs->limit; ++cmd) | |
18700 | - cmd->request = cpu_to_be32 (SRB_COMPLETE); | |
18701 | - | |
18702 | - PRINTK (KERN_INFO, "completing all TXs"); | |
18703 | - txq = &dev->txq; | |
18704 | - tx = txq->in.ptr; | |
18705 | - while (txq->pending--) { | |
18706 | - if (tx == txq->in.start) | |
18707 | - tx = txq->in.limit; | |
18708 | - --tx; | |
18709 | - tx_descr = bus_to_virt (be32_to_cpu (tx->tx_descr_addr)); | |
18710 | - amb_kfree_skb (tx_descr->skb); | |
18711 | - kfree (tx_descr); | |
18712 | - } | |
18713 | - | |
18714 | - PRINTK (KERN_INFO, "freeing all RX buffers"); | |
18715 | - for (pool = 0; pool < NUM_RX_POOLS; ++pool) { | |
18716 | - rxq = &dev->rxq[pool]; | |
18717 | - rx = rxq->in.ptr; | |
18718 | - while (rxq->pending--) { | |
18719 | - if (rx == rxq->in.start) | |
18720 | - rx = rxq->in.limit; | |
18721 | - --rx; | |
18722 | - dev_kfree_skb_any (bus_to_virt (rx->handle)); | |
18723 | - } | |
18724 | - } | |
18725 | - | |
18726 | - PRINTK (KERN_INFO, "don't panic over - close all VCs and rmmod"); | |
18727 | - set_bit (dead, &dev->flags); | |
18728 | - restore_flags (flags); | |
18729 | - return; | |
18730 | -} | |
18731 | -#endif | |
18732 | - | |
18733 | /********** make rate (not quite as much fun as Horizon) **********/ | |
18734 | ||
18735 | static unsigned int make_rate (unsigned int rate, rounding r, | |
18736 | @@ -1420,32 +1364,6 @@ | |
18737 | return; | |
18738 | } | |
18739 | ||
18740 | -/********** Debug\17Ioctl **********/ | |
18741 | - | |
18742 | -#if 0 | |
18743 | -static int amb_ioctl (struct atm_dev * dev, unsigned int cmd, void * arg) { | |
18744 | - unsigned short newdebug; | |
18745 | - if (cmd == AMB_SETDEBUG) { | |
18746 | - if (!capable(CAP_NET_ADMIN)) | |
18747 | - return -EPERM; | |
18748 | - if (copy_from_user (&newdebug, arg, sizeof(newdebug))) { | |
18749 | - // moan | |
18750 | - return -EFAULT; | |
18751 | - } else { | |
18752 | - debug = newdebug; | |
18753 | - return 0; | |
18754 | - } | |
18755 | - } else if (cmd == AMB_DONTPANIC) { | |
18756 | - if (!capable(CAP_NET_ADMIN)) | |
18757 | - return -EPERM; | |
18758 | - dont_panic (dev); | |
18759 | - } else { | |
18760 | - // moan | |
18761 | - return -ENOIOCTLCMD; | |
18762 | - } | |
18763 | -} | |
18764 | -#endif | |
18765 | - | |
18766 | /********** Set socket options for a VC **********/ | |
18767 | ||
18768 | // int amb_getsockopt (struct atm_vcc * atm_vcc, int level, int optname, void * optval, int optlen); | |
18769 | @@ -1524,33 +1442,6 @@ | |
18770 | tx.tx_descr_length = cpu_to_be16 (sizeof(tx_frag)+sizeof(tx_frag_end)); | |
18771 | tx.tx_descr_addr = cpu_to_be32 (virt_to_bus (&tx_descr->tx_frag)); | |
18772 | ||
18773 | -#ifdef DEBUG_AMBASSADOR | |
18774 | - /* wey-hey! */ | |
18775 | - if (vc == 1023) { | |
18776 | - unsigned int i; | |
18777 | - unsigned short d = 0; | |
18778 | - char * s = skb->data; | |
18779 | - switch (*s++) { | |
18780 | - case 'D': { | |
18781 | - for (i = 0; i < 4; ++i) { | |
18782 | - d = (d<<4) | ((*s <= '9') ? (*s - '0') : (*s - 'a' + 10)); | |
18783 | - ++s; | |
18784 | - } | |
18785 | - PRINTK (KERN_INFO, "debug bitmap is now %hx", debug = d); | |
18786 | - break; | |
18787 | - } | |
18788 | - case 'R': { | |
18789 | - if (*s++ == 'e' && *s++ == 's' && *s++ == 'e' && *s++ == 't') | |
18790 | - dont_panic (dev); | |
18791 | - break; | |
18792 | - } | |
18793 | - default: { | |
18794 | - break; | |
18795 | - } | |
18796 | - } | |
18797 | - } | |
18798 | -#endif | |
18799 | - | |
18800 | while (tx_give (dev, &tx)) | |
18801 | schedule(); | |
18802 | return 0; | |
18803 | @@ -1663,21 +1554,14 @@ | |
18804 | /********** Operation Structure **********/ | |
18805 | ||
18806 | static const struct atmdev_ops amb_ops = { | |
18807 | - .open = amb_open, | |
18808 | + .open = amb_open, | |
18809 | .close = amb_close, | |
18810 | - .send = amb_send, | |
18811 | + .send = amb_send, | |
18812 | .proc_read = amb_proc_read, | |
18813 | .owner = THIS_MODULE, | |
18814 | }; | |
18815 | ||
18816 | /********** housekeeping **********/ | |
18817 | - | |
18818 | -static inline void set_timer (struct timer_list * timer, unsigned long delay) { | |
18819 | - timer->expires = jiffies + delay; | |
18820 | - add_timer (timer); | |
18821 | - return; | |
18822 | -} | |
18823 | - | |
18824 | static void do_housekeeping (unsigned long arg) { | |
18825 | amb_dev * dev = amb_devs; | |
18826 | // data is set to zero at module unload | |
18827 | @@ -1693,7 +1577,7 @@ | |
18828 | ||
18829 | dev = dev->prev; | |
18830 | } | |
18831 | - set_timer (&housekeeping, 10*HZ); | |
18832 | + mod_timer(&housekeeping, jiffies + 10*HZ); | |
18833 | } | |
18834 | ||
18835 | return; | |
18836 | @@ -2579,11 +2463,7 @@ | |
18837 | devs = amb_probe(); | |
18838 | ||
18839 | if (devs) { | |
18840 | - init_timer (&housekeeping); | |
18841 | - housekeeping.function = do_housekeeping; | |
18842 | - // paranoia | |
18843 | - housekeeping.data = 1; | |
18844 | - set_timer (&housekeeping, 0); | |
18845 | + mod_timer (&housekeeping, jiffies); | |
18846 | } else { | |
18847 | PRINTK (KERN_INFO, "no (usable) adapters found"); | |
18848 | } | |
18849 | @@ -2600,7 +2480,7 @@ | |
18850 | ||
18851 | // paranoia | |
18852 | housekeeping.data = 0; | |
18853 | - del_timer (&housekeeping); | |
18854 | + del_timer_sync(&housekeeping); | |
18855 | ||
18856 | while (amb_devs) { | |
18857 | dev = amb_devs; | |
18858 | diff -Nru a/drivers/atm/eni.c b/drivers/atm/eni.c | |
18859 | --- a/drivers/atm/eni.c Tue Aug 19 21:10:45 2003 | |
18860 | +++ b/drivers/atm/eni.c Mon Sep 1 08:23:55 2003 | |
18861 | @@ -1809,10 +1809,6 @@ | |
18862 | "master (0x%02x)\n",dev->number,error); | |
18863 | return error; | |
18864 | } | |
18865 | -#ifdef __sparc_v9__ /* copied from drivers/net/sunhme.c */ | |
18866 | - /* NOTE: Cache line size is in 32-bit word units. */ | |
18867 | - pci_write_config_byte(eni_dev->pci_dev, PCI_CACHE_LINE_SIZE, 0x10); | |
18868 | -#endif | |
18869 | if ((error = pci_write_config_byte(eni_dev->pci_dev,PCI_TONGA_CTRL, | |
18870 | END_SWAP_DMA))) { | |
18871 | printk(KERN_ERR DEV_LABEL "(itf %d): can't set endian swap " | |
18872 | @@ -2345,7 +2341,7 @@ | |
18873 | struct sk_buff *skb; /* dummy for sizeof */ | |
18874 | ||
18875 | if (sizeof(skb->cb) < sizeof(struct eni_skb_prv)) { | |
18876 | - printk(KERN_ERR "eni_detect: skb->cb is too small (%d < %d)\n", | |
18877 | + printk(KERN_ERR "eni_detect: skb->cb is too small (%Zd < %Zd)\n", | |
18878 | sizeof(skb->cb),sizeof(struct eni_skb_prv)); | |
18879 | return -EIO; | |
18880 | } | |
18881 | diff -Nru a/drivers/atm/firestream.c b/drivers/atm/firestream.c | |
18882 | --- a/drivers/atm/firestream.c Tue Aug 19 21:10:45 2003 | |
18883 | +++ b/drivers/atm/firestream.c Sun Aug 31 16:14:27 2003 | |
18884 | @@ -895,7 +895,7 @@ | |
18885 | /* XXX handle qos parameters (rate limiting) ? */ | |
18886 | ||
18887 | vcc = kmalloc(sizeof(struct fs_vcc), GFP_KERNEL); | |
18888 | - fs_dprintk (FS_DEBUG_ALLOC, "Alloc VCC: %p(%d)\n", vcc, sizeof(struct fs_vcc)); | |
18889 | + fs_dprintk (FS_DEBUG_ALLOC, "Alloc VCC: %p(%Zd)\n", vcc, sizeof(struct fs_vcc)); | |
18890 | if (!vcc) { | |
18891 | clear_bit(ATM_VF_ADDR, &atm_vcc->flags); | |
18892 | return -ENOMEM; | |
18893 | @@ -946,7 +946,7 @@ | |
18894 | ||
18895 | if (DO_DIRECTION (txtp)) { | |
18896 | tc = kmalloc (sizeof (struct fs_transmit_config), GFP_KERNEL); | |
18897 | - fs_dprintk (FS_DEBUG_ALLOC, "Alloc tc: %p(%d)\n", | |
18898 | + fs_dprintk (FS_DEBUG_ALLOC, "Alloc tc: %p(%Zd)\n", | |
18899 | tc, sizeof (struct fs_transmit_config)); | |
18900 | if (!tc) { | |
18901 | fs_dprintk (FS_DEBUG_OPEN, "fs: can't alloc transmit_config.\n"); | |
18902 | @@ -1180,7 +1180,7 @@ | |
18903 | vcc->last_skb = skb; | |
18904 | ||
18905 | td = kmalloc (sizeof (struct FS_BPENTRY), GFP_ATOMIC); | |
18906 | - fs_dprintk (FS_DEBUG_ALLOC, "Alloc transd: %p(%d)\n", td, sizeof (struct FS_BPENTRY)); | |
18907 | + fs_dprintk (FS_DEBUG_ALLOC, "Alloc transd: %p(%Zd)\n", td, sizeof (struct FS_BPENTRY)); | |
18908 | if (!td) { | |
18909 | /* Oops out of mem */ | |
18910 | return -ENOMEM; | |
18911 | @@ -1487,7 +1487,7 @@ | |
18912 | fs_dprintk (FS_DEBUG_ALLOC, "Alloc rec-skb: %p(%d)\n", skb, fp->bufsize); | |
18913 | if (!skb) break; | |
18914 | ne = kmalloc (sizeof (struct FS_BPENTRY), gfp_flags); | |
18915 | - fs_dprintk (FS_DEBUG_ALLOC, "Alloc rec-d: %p(%d)\n", ne, sizeof (struct FS_BPENTRY)); | |
18916 | + fs_dprintk (FS_DEBUG_ALLOC, "Alloc rec-d: %p(%Zd)\n", ne, sizeof (struct FS_BPENTRY)); | |
18917 | if (!ne) { | |
18918 | fs_dprintk (FS_DEBUG_ALLOC, "Free rec-skb: %p\n", skb); | |
18919 | dev_kfree_skb_any (skb); | |
18920 | @@ -1792,7 +1792,7 @@ | |
18921 | } | |
18922 | dev->atm_vccs = kmalloc (dev->nchannels * sizeof (struct atm_vcc *), | |
18923 | GFP_KERNEL); | |
18924 | - fs_dprintk (FS_DEBUG_ALLOC, "Alloc atmvccs: %p(%d)\n", | |
18925 | + fs_dprintk (FS_DEBUG_ALLOC, "Alloc atmvccs: %p(%Zd)\n", | |
18926 | dev->atm_vccs, dev->nchannels * sizeof (struct atm_vcc *)); | |
18927 | ||
18928 | if (!dev->atm_vccs) { | |
18929 | @@ -1900,7 +1900,7 @@ | |
18930 | goto err_out; | |
18931 | ||
18932 | fs_dev = kmalloc (sizeof (struct fs_dev), GFP_KERNEL); | |
18933 | - fs_dprintk (FS_DEBUG_ALLOC, "Alloc fs-dev: %p(%d)\n", | |
18934 | + fs_dprintk (FS_DEBUG_ALLOC, "Alloc fs-dev: %p(%Zd)\n", | |
18935 | fs_dev, sizeof (struct fs_dev)); | |
18936 | if (!fs_dev) | |
18937 | goto err_out; | |
18938 | diff -Nru a/drivers/block/DAC960.c b/drivers/block/DAC960.c | |
18939 | --- a/drivers/block/DAC960.c Fri Aug 15 09:39:48 2003 | |
18940 | +++ b/drivers/block/DAC960.c Sun Aug 31 16:13:56 2003 | |
18941 | @@ -23,6 +23,7 @@ | |
18942 | #include <linux/version.h> | |
18943 | #include <linux/module.h> | |
18944 | #include <linux/types.h> | |
18945 | +#include <linux/miscdevice.h> | |
18946 | #include <linux/blkdev.h> | |
18947 | #include <linux/bio.h> | |
18948 | #include <linux/completion.h> | |
18949 | @@ -44,6 +45,8 @@ | |
18950 | #include <asm/uaccess.h> | |
18951 | #include "DAC960.h" | |
18952 | ||
18953 | +#define DAC960_GAM_MINOR 252 | |
18954 | + | |
18955 | ||
18956 | static DAC960_Controller_T *DAC960_Controllers[DAC960_MaxControllers]; | |
18957 | static int DAC960_ControllerCount; | |
18958 | @@ -71,10 +74,6 @@ | |
18959 | DAC960_Controller_T *p = disk->queue->queuedata; | |
18960 | int drive_nr = (int)disk->private_data; | |
18961 | ||
18962 | - /* bad hack for the "user" ioctls */ | |
18963 | - if (!p->ControllerNumber && !drive_nr && (file->f_flags & O_NONBLOCK)) | |
18964 | - return 0; | |
18965 | - | |
18966 | if (p->FirmwareType == DAC960_V1_Controller) { | |
18967 | if (p->V1.LogicalDriveInformation[drive_nr]. | |
18968 | LogicalDriveState == DAC960_V1_LogicalDrive_Offline) | |
18969 | @@ -101,9 +100,6 @@ | |
18970 | int drive_nr = (int)disk->private_data; | |
18971 | struct hd_geometry g, *loc = (struct hd_geometry *)arg; | |
18972 | ||
18973 | - if (file && (file->f_flags & O_NONBLOCK)) | |
18974 | - return DAC960_UserIOCTL(inode, file, cmd, arg); | |
18975 | - | |
18976 | if (cmd != HDIO_GETGEO || !loc) | |
18977 | return -EINVAL; | |
18978 | ||
18979 | @@ -5569,407 +5565,6 @@ | |
18980 | } | |
18981 | ||
18982 | /* | |
18983 | - DAC960_UserIOCTL is the User IOCTL Function for the DAC960 Driver. | |
18984 | -*/ | |
18985 | - | |
18986 | -static int DAC960_UserIOCTL(struct inode *inode, struct file *file, | |
18987 | - unsigned int Request, unsigned long Argument) | |
18988 | -{ | |
18989 | - int ErrorCode = 0; | |
18990 | - if (!capable(CAP_SYS_ADMIN)) return -EACCES; | |
18991 | - switch (Request) | |
18992 | - { | |
18993 | - case DAC960_IOCTL_GET_CONTROLLER_COUNT: | |
18994 | - return DAC960_ControllerCount; | |
18995 | - case DAC960_IOCTL_GET_CONTROLLER_INFO: | |
18996 | - { | |
18997 | - DAC960_ControllerInfo_T *UserSpaceControllerInfo = | |
18998 | - (DAC960_ControllerInfo_T *) Argument; | |
18999 | - DAC960_ControllerInfo_T ControllerInfo; | |
19000 | - DAC960_Controller_T *Controller; | |
19001 | - int ControllerNumber; | |
19002 | - if (UserSpaceControllerInfo == NULL) return -EINVAL; | |
19003 | - ErrorCode = get_user(ControllerNumber, | |
19004 | - &UserSpaceControllerInfo->ControllerNumber); | |
19005 | - if (ErrorCode != 0) return ErrorCode; | |
19006 | - if (ControllerNumber < 0 || | |
19007 | - ControllerNumber > DAC960_ControllerCount - 1) | |
19008 | - return -ENXIO; | |
19009 | - Controller = DAC960_Controllers[ControllerNumber]; | |
19010 | - if (Controller == NULL) return -ENXIO; | |
19011 | - memset(&ControllerInfo, 0, sizeof(DAC960_ControllerInfo_T)); | |
19012 | - ControllerInfo.ControllerNumber = ControllerNumber; | |
19013 | - ControllerInfo.FirmwareType = Controller->FirmwareType; | |
19014 | - ControllerInfo.Channels = Controller->Channels; | |
19015 | - ControllerInfo.Targets = Controller->Targets; | |
19016 | - ControllerInfo.PCI_Bus = Controller->Bus; | |
19017 | - ControllerInfo.PCI_Device = Controller->Device; | |
19018 | - ControllerInfo.PCI_Function = Controller->Function; | |
19019 | - ControllerInfo.IRQ_Channel = Controller->IRQ_Channel; | |
19020 | - ControllerInfo.PCI_Address = Controller->PCI_Address; | |
19021 | - strcpy(ControllerInfo.ModelName, Controller->ModelName); | |
19022 | - strcpy(ControllerInfo.FirmwareVersion, Controller->FirmwareVersion); | |
19023 | - return (copy_to_user(UserSpaceControllerInfo, &ControllerInfo, | |
19024 | - sizeof(DAC960_ControllerInfo_T)) ? -EFAULT : 0); | |
19025 | - } | |
19026 | - case DAC960_IOCTL_V1_EXECUTE_COMMAND: | |
19027 | - { | |
19028 | - DAC960_V1_UserCommand_T *UserSpaceUserCommand = | |
19029 | - (DAC960_V1_UserCommand_T *) Argument; | |
19030 | - DAC960_V1_UserCommand_T UserCommand; | |
19031 | - DAC960_Controller_T *Controller; | |
19032 | - DAC960_Command_T *Command = NULL; | |
19033 | - DAC960_V1_CommandOpcode_T CommandOpcode; | |
19034 | - DAC960_V1_CommandStatus_T CommandStatus; | |
19035 | - DAC960_V1_DCDB_T DCDB; | |
19036 | - DAC960_V1_DCDB_T *DCDB_IOBUF = NULL; | |
19037 | - dma_addr_t DCDB_IOBUFDMA; | |
19038 | - unsigned long flags; | |
19039 | - int ControllerNumber, DataTransferLength; | |
19040 | - unsigned char *DataTransferBuffer = NULL; | |
19041 | - dma_addr_t DataTransferBufferDMA; | |
19042 | - if (UserSpaceUserCommand == NULL) return -EINVAL; | |
19043 | - if (copy_from_user(&UserCommand, UserSpaceUserCommand, | |
19044 | - sizeof(DAC960_V1_UserCommand_T))) { | |
19045 | - ErrorCode = -EFAULT; | |
19046 | - goto Failure1a; | |
19047 | - } | |
19048 | - ControllerNumber = UserCommand.ControllerNumber; | |
19049 | - if (ControllerNumber < 0 || | |
19050 | - ControllerNumber > DAC960_ControllerCount - 1) | |
19051 | - return -ENXIO; | |
19052 | - Controller = DAC960_Controllers[ControllerNumber]; | |
19053 | - if (Controller == NULL) return -ENXIO; | |
19054 | - if (Controller->FirmwareType != DAC960_V1_Controller) return -EINVAL; | |
19055 | - CommandOpcode = UserCommand.CommandMailbox.Common.CommandOpcode; | |
19056 | - DataTransferLength = UserCommand.DataTransferLength; | |
19057 | - if (CommandOpcode & 0x80) return -EINVAL; | |
19058 | - if (CommandOpcode == DAC960_V1_DCDB) | |
19059 | - { | |
19060 | - if (copy_from_user(&DCDB, UserCommand.DCDB, | |
19061 | - sizeof(DAC960_V1_DCDB_T))) { | |
19062 | - ErrorCode = -EFAULT; | |
19063 | - goto Failure1a; | |
19064 | - } | |
19065 | - if (DCDB.Channel >= DAC960_V1_MaxChannels) return -EINVAL; | |
19066 | - if (!((DataTransferLength == 0 && | |
19067 | - DCDB.Direction | |
19068 | - == DAC960_V1_DCDB_NoDataTransfer) || | |
19069 | - (DataTransferLength > 0 && | |
19070 | - DCDB.Direction | |
19071 | - == DAC960_V1_DCDB_DataTransferDeviceToSystem) || | |
19072 | - (DataTransferLength < 0 && | |
19073 | - DCDB.Direction | |
19074 | - == DAC960_V1_DCDB_DataTransferSystemToDevice))) | |
19075 | - return -EINVAL; | |
19076 | - if (((DCDB.TransferLengthHigh4 << 16) | DCDB.TransferLength) | |
19077 | - != abs(DataTransferLength)) | |
19078 | - return -EINVAL; | |
19079 | - DCDB_IOBUF = pci_alloc_consistent(Controller->PCIDevice, | |
19080 | - sizeof(DAC960_V1_DCDB_T), &DCDB_IOBUFDMA); | |
19081 | - if (DCDB_IOBUF == NULL) | |
19082 | - return -ENOMEM; | |
19083 | - } | |
19084 | - if (DataTransferLength > 0) | |
19085 | - { | |
19086 | - DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice, | |
19087 | - DataTransferLength, &DataTransferBufferDMA); | |
19088 | - if (DataTransferBuffer == NULL) { | |
19089 | - ErrorCode = -ENOMEM; | |
19090 | - goto Failure1; | |
19091 | - } | |
19092 | - memset(DataTransferBuffer, 0, DataTransferLength); | |
19093 | - } | |
19094 | - else if (DataTransferLength < 0) | |
19095 | - { | |
19096 | - DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice, | |
19097 | - -DataTransferLength, &DataTransferBufferDMA); | |
19098 | - if (DataTransferBuffer == NULL) { | |
19099 | - ErrorCode = -ENOMEM; | |
19100 | - goto Failure1; | |
19101 | - } | |
19102 | - if (copy_from_user(DataTransferBuffer, | |
19103 | - UserCommand.DataTransferBuffer, | |
19104 | - -DataTransferLength)) { | |
19105 | - ErrorCode = -EFAULT; | |
19106 | - goto Failure1; | |
19107 | - } | |
19108 | - } | |
19109 | - if (CommandOpcode == DAC960_V1_DCDB) | |
19110 | - { | |
19111 | - spin_lock_irqsave(&Controller->queue_lock, flags); | |
19112 | - while ((Command = DAC960_AllocateCommand(Controller)) == NULL) | |
19113 | - DAC960_WaitForCommand(Controller); | |
19114 | - while (Controller->V1.DirectCommandActive[DCDB.Channel] | |
19115 | - [DCDB.TargetID]) | |
19116 | - { | |
19117 | - spin_unlock_irq(&Controller->queue_lock); | |
19118 | - __wait_event(Controller->CommandWaitQueue, | |
19119 | - !Controller->V1.DirectCommandActive | |
19120 | - [DCDB.Channel][DCDB.TargetID]); | |
19121 | - spin_lock_irq(&Controller->queue_lock); | |
19122 | - } | |
19123 | - Controller->V1.DirectCommandActive[DCDB.Channel] | |
19124 | - [DCDB.TargetID] = true; | |
19125 | - spin_unlock_irqrestore(&Controller->queue_lock, flags); | |
19126 | - DAC960_V1_ClearCommand(Command); | |
19127 | - Command->CommandType = DAC960_ImmediateCommand; | |
19128 | - memcpy(&Command->V1.CommandMailbox, &UserCommand.CommandMailbox, | |
19129 | - sizeof(DAC960_V1_CommandMailbox_T)); | |
19130 | - Command->V1.CommandMailbox.Type3.BusAddress = DCDB_IOBUFDMA; | |
19131 | - DCDB.BusAddress = DataTransferBufferDMA; | |
19132 | - memcpy(DCDB_IOBUF, &DCDB, sizeof(DAC960_V1_DCDB_T)); | |
19133 | - } | |
19134 | - else | |
19135 | - { | |
19136 | - spin_lock_irqsave(&Controller->queue_lock, flags); | |
19137 | - while ((Command = DAC960_AllocateCommand(Controller)) == NULL) | |
19138 | - DAC960_WaitForCommand(Controller); | |
19139 | - spin_unlock_irqrestore(&Controller->queue_lock, flags); | |
19140 | - DAC960_V1_ClearCommand(Command); | |
19141 | - Command->CommandType = DAC960_ImmediateCommand; | |
19142 | - memcpy(&Command->V1.CommandMailbox, &UserCommand.CommandMailbox, | |
19143 | - sizeof(DAC960_V1_CommandMailbox_T)); | |
19144 | - if (DataTransferBuffer != NULL) | |
19145 | - Command->V1.CommandMailbox.Type3.BusAddress = | |
19146 | - DataTransferBufferDMA; | |
19147 | - } | |
19148 | - DAC960_ExecuteCommand(Command); | |
19149 | - CommandStatus = Command->V1.CommandStatus; | |
19150 | - spin_lock_irqsave(&Controller->queue_lock, flags); | |
19151 | - DAC960_DeallocateCommand(Command); | |
19152 | - spin_unlock_irqrestore(&Controller->queue_lock, flags); | |
19153 | - if (DataTransferLength > 0) | |
19154 | - { | |
19155 | - if (copy_to_user(UserCommand.DataTransferBuffer, | |
19156 | - DataTransferBuffer, DataTransferLength)) { | |
19157 | - ErrorCode = -EFAULT; | |
19158 | - goto Failure1; | |
19159 | - } | |
19160 | - } | |
19161 | - if (CommandOpcode == DAC960_V1_DCDB) | |
19162 | - { | |
19163 | - /* | |
19164 | - I don't believe Target or Channel in the DCDB_IOBUF | |
19165 | - should be any different from the contents of DCDB. | |
19166 | - */ | |
19167 | - Controller->V1.DirectCommandActive[DCDB.Channel] | |
19168 | - [DCDB.TargetID] = false; | |
19169 | - if (copy_to_user(UserCommand.DCDB, DCDB_IOBUF, | |
19170 | - sizeof(DAC960_V1_DCDB_T))) { | |
19171 | - ErrorCode = -EFAULT; | |
19172 | - goto Failure1; | |
19173 | - } | |
19174 | - } | |
19175 | - ErrorCode = CommandStatus; | |
19176 | - Failure1: | |
19177 | - if (DataTransferBuffer != NULL) | |
19178 | - pci_free_consistent(Controller->PCIDevice, abs(DataTransferLength), | |
19179 | - DataTransferBuffer, DataTransferBufferDMA); | |
19180 | - if (DCDB_IOBUF != NULL) | |
19181 | - pci_free_consistent(Controller->PCIDevice, sizeof(DAC960_V1_DCDB_T), | |
19182 | - DCDB_IOBUF, DCDB_IOBUFDMA); | |
19183 | - Failure1a: | |
19184 | - return ErrorCode; | |
19185 | - } | |
19186 | - case DAC960_IOCTL_V2_EXECUTE_COMMAND: | |
19187 | - { | |
19188 | - DAC960_V2_UserCommand_T *UserSpaceUserCommand = | |
19189 | - (DAC960_V2_UserCommand_T *) Argument; | |
19190 | - DAC960_V2_UserCommand_T UserCommand; | |
19191 | - DAC960_Controller_T *Controller; | |
19192 | - DAC960_Command_T *Command = NULL; | |
19193 | - DAC960_V2_CommandMailbox_T *CommandMailbox; | |
19194 | - DAC960_V2_CommandStatus_T CommandStatus; | |
19195 | - unsigned long flags; | |
19196 | - int ControllerNumber, DataTransferLength; | |
19197 | - int DataTransferResidue, RequestSenseLength; | |
19198 | - unsigned char *DataTransferBuffer = NULL; | |
19199 | - dma_addr_t DataTransferBufferDMA; | |
19200 | - unsigned char *RequestSenseBuffer = NULL; | |
19201 | - dma_addr_t RequestSenseBufferDMA; | |
19202 | - if (UserSpaceUserCommand == NULL) return -EINVAL; | |
19203 | - if (copy_from_user(&UserCommand, UserSpaceUserCommand, | |
19204 | - sizeof(DAC960_V2_UserCommand_T))) { | |
19205 | - ErrorCode = -EFAULT; | |
19206 | - goto Failure2a; | |
19207 | - } | |
19208 | - ControllerNumber = UserCommand.ControllerNumber; | |
19209 | - if (ControllerNumber < 0 || | |
19210 | - ControllerNumber > DAC960_ControllerCount - 1) | |
19211 | - return -ENXIO; | |
19212 | - Controller = DAC960_Controllers[ControllerNumber]; | |
19213 | - if (Controller == NULL) return -ENXIO; | |
19214 | - if (Controller->FirmwareType != DAC960_V2_Controller) return -EINVAL; | |
19215 | - DataTransferLength = UserCommand.DataTransferLength; | |
19216 | - if (DataTransferLength > 0) | |
19217 | - { | |
19218 | - DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice, | |
19219 | - DataTransferLength, &DataTransferBufferDMA); | |
19220 | - if (DataTransferBuffer == NULL) return -ENOMEM; | |
19221 | - memset(DataTransferBuffer, 0, DataTransferLength); | |
19222 | - } | |
19223 | - else if (DataTransferLength < 0) | |
19224 | - { | |
19225 | - DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice, | |
19226 | - -DataTransferLength, &DataTransferBufferDMA); | |
19227 | - if (DataTransferBuffer == NULL) return -ENOMEM; | |
19228 | - if (copy_from_user(DataTransferBuffer, | |
19229 | - UserCommand.DataTransferBuffer, | |
19230 | - -DataTransferLength)) { | |
19231 | - ErrorCode = -EFAULT; | |
19232 | - goto Failure2; | |
19233 | - } | |
19234 | - } | |
19235 | - RequestSenseLength = UserCommand.RequestSenseLength; | |
19236 | - if (RequestSenseLength > 0) | |
19237 | - { | |
19238 | - RequestSenseBuffer = pci_alloc_consistent(Controller->PCIDevice, | |
19239 | - RequestSenseLength, &RequestSenseBufferDMA); | |
19240 | - if (RequestSenseBuffer == NULL) | |
19241 | - { | |
19242 | - ErrorCode = -ENOMEM; | |
19243 | - goto Failure2; | |
19244 | - } | |
19245 | - memset(RequestSenseBuffer, 0, RequestSenseLength); | |
19246 | - } | |
19247 | - spin_lock_irqsave(&Controller->queue_lock, flags); | |
19248 | - while ((Command = DAC960_AllocateCommand(Controller)) == NULL) | |
19249 | - DAC960_WaitForCommand(Controller); | |
19250 | - spin_unlock_irqrestore(&Controller->queue_lock, flags); | |
19251 | - DAC960_V2_ClearCommand(Command); | |
19252 | - Command->CommandType = DAC960_ImmediateCommand; | |
19253 | - CommandMailbox = &Command->V2.CommandMailbox; | |
19254 | - memcpy(CommandMailbox, &UserCommand.CommandMailbox, | |
19255 | - sizeof(DAC960_V2_CommandMailbox_T)); | |
19256 | - CommandMailbox->Common.CommandControlBits | |
19257 | - .AdditionalScatterGatherListMemory = false; | |
19258 | - CommandMailbox->Common.CommandControlBits | |
19259 | - .NoAutoRequestSense = true; | |
19260 | - CommandMailbox->Common.DataTransferSize = 0; | |
19261 | - CommandMailbox->Common.DataTransferPageNumber = 0; | |
19262 | - memset(&CommandMailbox->Common.DataTransferMemoryAddress, 0, | |
19263 | - sizeof(DAC960_V2_DataTransferMemoryAddress_T)); | |
19264 | - if (DataTransferLength != 0) | |
19265 | - { | |
19266 | - if (DataTransferLength > 0) | |
19267 | - { | |
19268 | - CommandMailbox->Common.CommandControlBits | |
19269 | - .DataTransferControllerToHost = true; | |
19270 | - CommandMailbox->Common.DataTransferSize = DataTransferLength; | |
19271 | - } | |
19272 | - else | |
19273 | - { | |
19274 | - CommandMailbox->Common.CommandControlBits | |
19275 | - .DataTransferControllerToHost = false; | |
19276 | - CommandMailbox->Common.DataTransferSize = -DataTransferLength; | |
19277 | - } | |
19278 | - CommandMailbox->Common.DataTransferMemoryAddress | |
19279 | - .ScatterGatherSegments[0] | |
19280 | - .SegmentDataPointer = DataTransferBufferDMA; | |
19281 | - CommandMailbox->Common.DataTransferMemoryAddress | |
19282 | - .ScatterGatherSegments[0] | |
19283 | - .SegmentByteCount = | |
19284 | - CommandMailbox->Common.DataTransferSize; | |
19285 | - } | |
19286 | - if (RequestSenseLength > 0) | |
19287 | - { | |
19288 | - CommandMailbox->Common.CommandControlBits | |
19289 | - .NoAutoRequestSense = false; | |
19290 | - CommandMailbox->Common.RequestSenseSize = RequestSenseLength; | |
19291 | - CommandMailbox->Common.RequestSenseBusAddress = | |
19292 | - RequestSenseBufferDMA; | |
19293 | - } | |
19294 | - DAC960_ExecuteCommand(Command); | |
19295 | - CommandStatus = Command->V2.CommandStatus; | |
19296 | - RequestSenseLength = Command->V2.RequestSenseLength; | |
19297 | - DataTransferResidue = Command->V2.DataTransferResidue; | |
19298 | - spin_lock_irqsave(&Controller->queue_lock, flags); | |
19299 | - DAC960_DeallocateCommand(Command); | |
19300 | - spin_unlock_irqrestore(&Controller->queue_lock, flags); | |
19301 | - if (RequestSenseLength > UserCommand.RequestSenseLength) | |
19302 | - RequestSenseLength = UserCommand.RequestSenseLength; | |
19303 | - if (copy_to_user(&UserSpaceUserCommand->DataTransferLength, | |
19304 | - &DataTransferResidue, | |
19305 | - sizeof(DataTransferResidue))) { | |
19306 | - ErrorCode = -EFAULT; | |
19307 | - goto Failure2; | |
19308 | - } | |
19309 | - if (copy_to_user(&UserSpaceUserCommand->RequestSenseLength, | |
19310 | - &RequestSenseLength, sizeof(RequestSenseLength))) { | |
19311 | - ErrorCode = -EFAULT; | |
19312 | - goto Failure2; | |
19313 | - } | |
19314 | - if (DataTransferLength > 0) | |
19315 | - { | |
19316 | - if (copy_to_user(UserCommand.DataTransferBuffer, | |
19317 | - DataTransferBuffer, DataTransferLength)) { | |
19318 | - ErrorCode = -EFAULT; | |
19319 | - goto Failure2; | |
19320 | - } | |
19321 | - } | |
19322 | - if (RequestSenseLength > 0) | |
19323 | - { | |
19324 | - if (copy_to_user(UserCommand.RequestSenseBuffer, | |
19325 | - RequestSenseBuffer, RequestSenseLength)) { | |
19326 | - ErrorCode = -EFAULT; | |
19327 | - goto Failure2; | |
19328 | - } | |
19329 | - } | |
19330 | - ErrorCode = CommandStatus; | |
19331 | - Failure2: | |
19332 | - pci_free_consistent(Controller->PCIDevice, abs(DataTransferLength), | |
19333 | - DataTransferBuffer, DataTransferBufferDMA); | |
19334 | - if (RequestSenseBuffer != NULL) | |
19335 | - pci_free_consistent(Controller->PCIDevice, RequestSenseLength, | |
19336 | - RequestSenseBuffer, RequestSenseBufferDMA); | |
19337 | - Failure2a: | |
19338 | - return ErrorCode; | |
19339 | - } | |
19340 | - case DAC960_IOCTL_V2_GET_HEALTH_STATUS: | |
19341 | - { | |
19342 | - DAC960_V2_GetHealthStatus_T *UserSpaceGetHealthStatus = | |
19343 | - (DAC960_V2_GetHealthStatus_T *) Argument; | |
19344 | - DAC960_V2_GetHealthStatus_T GetHealthStatus; | |
19345 | - DAC960_V2_HealthStatusBuffer_T HealthStatusBuffer; | |
19346 | - DAC960_Controller_T *Controller; | |
19347 | - int ControllerNumber; | |
19348 | - if (UserSpaceGetHealthStatus == NULL) return -EINVAL; | |
19349 | - if (copy_from_user(&GetHealthStatus, UserSpaceGetHealthStatus, | |
19350 | - sizeof(DAC960_V2_GetHealthStatus_T))) | |
19351 | - return -EFAULT; | |
19352 | - ControllerNumber = GetHealthStatus.ControllerNumber; | |
19353 | - if (ControllerNumber < 0 || | |
19354 | - ControllerNumber > DAC960_ControllerCount - 1) | |
19355 | - return -ENXIO; | |
19356 | - Controller = DAC960_Controllers[ControllerNumber]; | |
19357 | - if (Controller == NULL) return -ENXIO; | |
19358 | - if (Controller->FirmwareType != DAC960_V2_Controller) return -EINVAL; | |
19359 | - if (copy_from_user(&HealthStatusBuffer, | |
19360 | - GetHealthStatus.HealthStatusBuffer, | |
19361 | - sizeof(DAC960_V2_HealthStatusBuffer_T))) | |
19362 | - return -EFAULT; | |
19363 | - while (Controller->V2.HealthStatusBuffer->StatusChangeCounter | |
19364 | - == HealthStatusBuffer.StatusChangeCounter && | |
19365 | - Controller->V2.HealthStatusBuffer->NextEventSequenceNumber | |
19366 | - == HealthStatusBuffer.NextEventSequenceNumber) | |
19367 | - { | |
19368 | - interruptible_sleep_on_timeout(&Controller->HealthStatusWaitQueue, | |
19369 | - DAC960_MonitoringTimerInterval); | |
19370 | - if (signal_pending(current)) return -EINTR; | |
19371 | - } | |
19372 | - if (copy_to_user(GetHealthStatus.HealthStatusBuffer, | |
19373 | - Controller->V2.HealthStatusBuffer, | |
19374 | - sizeof(DAC960_V2_HealthStatusBuffer_T))) | |
19375 | - return -EFAULT; | |
19376 | - return 0; | |
19377 | - } | |
19378 | - } | |
19379 | - return -EINVAL; | |
19380 | -} | |
19381 | - | |
19382 | - | |
19383 | -/* | |
19384 | DAC960_CheckStatusBuffer verifies that there is room to hold ByteCount | |
19385 | additional bytes in the Combined Status Buffer and grows the buffer if | |
19386 | necessary. It returns true if there is enough room and false otherwise. | |
19387 | @@ -6901,6 +6496,436 @@ | |
19388 | Controller->ControllerProcEntry = NULL; | |
19389 | } | |
19390 | ||
19391 | +#ifdef DAC960_GAM_MINOR | |
19392 | + | |
19393 | +/* | |
19394 | + * DAC960_gam_ioctl is the ioctl function for performing RAID operations. | |
19395 | +*/ | |
19396 | + | |
19397 | +static int DAC960_gam_ioctl(struct inode *inode, struct file *file, | |
19398 | + unsigned int Request, unsigned long Argument) | |
19399 | +{ | |
19400 | + int ErrorCode = 0; | |
19401 | + if (!capable(CAP_SYS_ADMIN)) return -EACCES; | |
19402 | + switch (Request) | |
19403 | + { | |
19404 | + case DAC960_IOCTL_GET_CONTROLLER_COUNT: | |
19405 | + return DAC960_ControllerCount; | |
19406 | + case DAC960_IOCTL_GET_CONTROLLER_INFO: | |
19407 | + { | |
19408 | + DAC960_ControllerInfo_T *UserSpaceControllerInfo = | |
19409 | + (DAC960_ControllerInfo_T *) Argument; | |
19410 | + DAC960_ControllerInfo_T ControllerInfo; | |
19411 | + DAC960_Controller_T *Controller; | |
19412 | + int ControllerNumber; | |
19413 | + if (UserSpaceControllerInfo == NULL) return -EINVAL; | |
19414 | + ErrorCode = get_user(ControllerNumber, | |
19415 | + &UserSpaceControllerInfo->ControllerNumber); | |
19416 | + if (ErrorCode != 0) return ErrorCode; | |
19417 | + if (ControllerNumber < 0 || | |
19418 | + ControllerNumber > DAC960_ControllerCount - 1) | |
19419 | + return -ENXIO; | |
19420 | + Controller = DAC960_Controllers[ControllerNumber]; | |
19421 | + if (Controller == NULL) return -ENXIO; | |
19422 | + memset(&ControllerInfo, 0, sizeof(DAC960_ControllerInfo_T)); | |
19423 | + ControllerInfo.ControllerNumber = ControllerNumber; | |
19424 | + ControllerInfo.FirmwareType = Controller->FirmwareType; | |
19425 | + ControllerInfo.Channels = Controller->Channels; | |
19426 | + ControllerInfo.Targets = Controller->Targets; | |
19427 | + ControllerInfo.PCI_Bus = Controller->Bus; | |
19428 | + ControllerInfo.PCI_Device = Controller->Device; | |
19429 | + ControllerInfo.PCI_Function = Controller->Function; | |
19430 | + ControllerInfo.IRQ_Channel = Controller->IRQ_Channel; | |
19431 | + ControllerInfo.PCI_Address = Controller->PCI_Address; | |
19432 | + strcpy(ControllerInfo.ModelName, Controller->ModelName); | |
19433 | + strcpy(ControllerInfo.FirmwareVersion, Controller->FirmwareVersion); | |
19434 | + return (copy_to_user(UserSpaceControllerInfo, &ControllerInfo, | |
19435 | + sizeof(DAC960_ControllerInfo_T)) ? -EFAULT : 0); | |
19436 | + } | |
19437 | + case DAC960_IOCTL_V1_EXECUTE_COMMAND: | |
19438 | + { | |
19439 | + DAC960_V1_UserCommand_T *UserSpaceUserCommand = | |
19440 | + (DAC960_V1_UserCommand_T *) Argument; | |
19441 | + DAC960_V1_UserCommand_T UserCommand; | |
19442 | + DAC960_Controller_T *Controller; | |
19443 | + DAC960_Command_T *Command = NULL; | |
19444 | + DAC960_V1_CommandOpcode_T CommandOpcode; | |
19445 | + DAC960_V1_CommandStatus_T CommandStatus; | |
19446 | + DAC960_V1_DCDB_T DCDB; | |
19447 | + DAC960_V1_DCDB_T *DCDB_IOBUF = NULL; | |
19448 | + dma_addr_t DCDB_IOBUFDMA; | |
19449 | + unsigned long flags; | |
19450 | + int ControllerNumber, DataTransferLength; | |
19451 | + unsigned char *DataTransferBuffer = NULL; | |
19452 | + dma_addr_t DataTransferBufferDMA; | |
19453 | + if (UserSpaceUserCommand == NULL) return -EINVAL; | |
19454 | + if (copy_from_user(&UserCommand, UserSpaceUserCommand, | |
19455 | + sizeof(DAC960_V1_UserCommand_T))) { | |
19456 | + ErrorCode = -EFAULT; | |
19457 | + goto Failure1a; | |
19458 | + } | |
19459 | + ControllerNumber = UserCommand.ControllerNumber; | |
19460 | + if (ControllerNumber < 0 || | |
19461 | + ControllerNumber > DAC960_ControllerCount - 1) | |
19462 | + return -ENXIO; | |
19463 | + Controller = DAC960_Controllers[ControllerNumber]; | |
19464 | + if (Controller == NULL) return -ENXIO; | |
19465 | + if (Controller->FirmwareType != DAC960_V1_Controller) return -EINVAL; | |
19466 | + CommandOpcode = UserCommand.CommandMailbox.Common.CommandOpcode; | |
19467 | + DataTransferLength = UserCommand.DataTransferLength; | |
19468 | + if (CommandOpcode & 0x80) return -EINVAL; | |
19469 | + if (CommandOpcode == DAC960_V1_DCDB) | |
19470 | + { | |
19471 | + if (copy_from_user(&DCDB, UserCommand.DCDB, | |
19472 | + sizeof(DAC960_V1_DCDB_T))) { | |
19473 | + ErrorCode = -EFAULT; | |
19474 | + goto Failure1a; | |
19475 | + } | |
19476 | + if (DCDB.Channel >= DAC960_V1_MaxChannels) return -EINVAL; | |
19477 | + if (!((DataTransferLength == 0 && | |
19478 | + DCDB.Direction | |
19479 | + == DAC960_V1_DCDB_NoDataTransfer) || | |
19480 | + (DataTransferLength > 0 && | |
19481 | + DCDB.Direction | |
19482 | + == DAC960_V1_DCDB_DataTransferDeviceToSystem) || | |
19483 | + (DataTransferLength < 0 && | |
19484 | + DCDB.Direction | |
19485 | + == DAC960_V1_DCDB_DataTransferSystemToDevice))) | |
19486 | + return -EINVAL; | |
19487 | + if (((DCDB.TransferLengthHigh4 << 16) | DCDB.TransferLength) | |
19488 | + != abs(DataTransferLength)) | |
19489 | + return -EINVAL; | |
19490 | + DCDB_IOBUF = pci_alloc_consistent(Controller->PCIDevice, | |
19491 | + sizeof(DAC960_V1_DCDB_T), &DCDB_IOBUFDMA); | |
19492 | + if (DCDB_IOBUF == NULL) | |
19493 | + return -ENOMEM; | |
19494 | + } | |
19495 | + if (DataTransferLength > 0) | |
19496 | + { | |
19497 | + DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice, | |
19498 | + DataTransferLength, &DataTransferBufferDMA); | |
19499 | + if (DataTransferBuffer == NULL) { | |
19500 | + ErrorCode = -ENOMEM; | |
19501 | + goto Failure1; | |
19502 | + } | |
19503 | + memset(DataTransferBuffer, 0, DataTransferLength); | |
19504 | + } | |
19505 | + else if (DataTransferLength < 0) | |
19506 | + { | |
19507 | + DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice, | |
19508 | + -DataTransferLength, &DataTransferBufferDMA); | |
19509 | + if (DataTransferBuffer == NULL) { | |
19510 | + ErrorCode = -ENOMEM; | |
19511 | + goto Failure1; | |
19512 | + } | |
19513 | + if (copy_from_user(DataTransferBuffer, | |
19514 | + UserCommand.DataTransferBuffer, | |
19515 | + -DataTransferLength)) { | |
19516 | + ErrorCode = -EFAULT; | |
19517 | + goto Failure1; | |
19518 | + } | |
19519 | + } | |
19520 | + if (CommandOpcode == DAC960_V1_DCDB) | |
19521 | + { | |
19522 | + spin_lock_irqsave(&Controller->queue_lock, flags); | |
19523 | + while ((Command = DAC960_AllocateCommand(Controller)) == NULL) | |
19524 | + DAC960_WaitForCommand(Controller); | |
19525 | + while (Controller->V1.DirectCommandActive[DCDB.Channel] | |
19526 | + [DCDB.TargetID]) | |
19527 | + { | |
19528 | + spin_unlock_irq(&Controller->queue_lock); | |
19529 | + __wait_event(Controller->CommandWaitQueue, | |
19530 | + !Controller->V1.DirectCommandActive | |
19531 | + [DCDB.Channel][DCDB.TargetID]); | |
19532 | + spin_lock_irq(&Controller->queue_lock); | |
19533 | + } | |
19534 | + Controller->V1.DirectCommandActive[DCDB.Channel] | |
19535 | + [DCDB.TargetID] = true; | |
19536 | + spin_unlock_irqrestore(&Controller->queue_lock, flags); | |
19537 | + DAC960_V1_ClearCommand(Command); | |
19538 | + Command->CommandType = DAC960_ImmediateCommand; | |
19539 | + memcpy(&Command->V1.CommandMailbox, &UserCommand.CommandMailbox, | |
19540 | + sizeof(DAC960_V1_CommandMailbox_T)); | |
19541 | + Command->V1.CommandMailbox.Type3.BusAddress = DCDB_IOBUFDMA; | |
19542 | + DCDB.BusAddress = DataTransferBufferDMA; | |
19543 | + memcpy(DCDB_IOBUF, &DCDB, sizeof(DAC960_V1_DCDB_T)); | |
19544 | + } | |
19545 | + else | |
19546 | + { | |
19547 | + spin_lock_irqsave(&Controller->queue_lock, flags); | |
19548 | + while ((Command = DAC960_AllocateCommand(Controller)) == NULL) | |
19549 | + DAC960_WaitForCommand(Controller); | |
19550 | + spin_unlock_irqrestore(&Controller->queue_lock, flags); | |
19551 | + DAC960_V1_ClearCommand(Command); | |
19552 | + Command->CommandType = DAC960_ImmediateCommand; | |
19553 | + memcpy(&Command->V1.CommandMailbox, &UserCommand.CommandMailbox, | |
19554 | + sizeof(DAC960_V1_CommandMailbox_T)); | |
19555 | + if (DataTransferBuffer != NULL) | |
19556 | + Command->V1.CommandMailbox.Type3.BusAddress = | |
19557 | + DataTransferBufferDMA; | |
19558 | + } | |
19559 | + DAC960_ExecuteCommand(Command); | |
19560 | + CommandStatus = Command->V1.CommandStatus; | |
19561 | + spin_lock_irqsave(&Controller->queue_lock, flags); | |
19562 | + DAC960_DeallocateCommand(Command); | |
19563 | + spin_unlock_irqrestore(&Controller->queue_lock, flags); | |
19564 | + if (DataTransferLength > 0) | |
19565 | + { | |
19566 | + if (copy_to_user(UserCommand.DataTransferBuffer, | |
19567 | + DataTransferBuffer, DataTransferLength)) { | |
19568 | + ErrorCode = -EFAULT; | |
19569 | + goto Failure1; | |
19570 | + } | |
19571 | + } | |
19572 | + if (CommandOpcode == DAC960_V1_DCDB) | |
19573 | + { | |
19574 | + /* | |
19575 | + I don't believe Target or Channel in the DCDB_IOBUF | |
19576 | + should be any different from the contents of DCDB. | |
19577 | + */ | |
19578 | + Controller->V1.DirectCommandActive[DCDB.Channel] | |
19579 | + [DCDB.TargetID] = false; | |
19580 | + if (copy_to_user(UserCommand.DCDB, DCDB_IOBUF, | |
19581 | + sizeof(DAC960_V1_DCDB_T))) { | |
19582 | + ErrorCode = -EFAULT; | |
19583 | + goto Failure1; | |
19584 | + } | |
19585 | + } | |
19586 | + ErrorCode = CommandStatus; | |
19587 | + Failure1: | |
19588 | + if (DataTransferBuffer != NULL) | |
19589 | + pci_free_consistent(Controller->PCIDevice, abs(DataTransferLength), | |
19590 | + DataTransferBuffer, DataTransferBufferDMA); | |
19591 | + if (DCDB_IOBUF != NULL) | |
19592 | + pci_free_consistent(Controller->PCIDevice, sizeof(DAC960_V1_DCDB_T), | |
19593 | + DCDB_IOBUF, DCDB_IOBUFDMA); | |
19594 | + Failure1a: | |
19595 | + return ErrorCode; | |
19596 | + } | |
19597 | + case DAC960_IOCTL_V2_EXECUTE_COMMAND: | |
19598 | + { | |
19599 | + DAC960_V2_UserCommand_T *UserSpaceUserCommand = | |
19600 | + (DAC960_V2_UserCommand_T *) Argument; | |
19601 | + DAC960_V2_UserCommand_T UserCommand; | |
19602 | + DAC960_Controller_T *Controller; | |
19603 | + DAC960_Command_T *Command = NULL; | |
19604 | + DAC960_V2_CommandMailbox_T *CommandMailbox; | |
19605 | + DAC960_V2_CommandStatus_T CommandStatus; | |
19606 | + unsigned long flags; | |
19607 | + int ControllerNumber, DataTransferLength; | |
19608 | + int DataTransferResidue, RequestSenseLength; | |
19609 | + unsigned char *DataTransferBuffer = NULL; | |
19610 | + dma_addr_t DataTransferBufferDMA; | |
19611 | + unsigned char *RequestSenseBuffer = NULL; | |
19612 | + dma_addr_t RequestSenseBufferDMA; | |
19613 | + if (UserSpaceUserCommand == NULL) return -EINVAL; | |
19614 | + if (copy_from_user(&UserCommand, UserSpaceUserCommand, | |
19615 | + sizeof(DAC960_V2_UserCommand_T))) { | |
19616 | + ErrorCode = -EFAULT; | |
19617 | + goto Failure2a; | |
19618 | + } | |
19619 | + ControllerNumber = UserCommand.ControllerNumber; | |
19620 | + if (ControllerNumber < 0 || | |
19621 | + ControllerNumber > DAC960_ControllerCount - 1) | |
19622 | + return -ENXIO; | |
19623 | + Controller = DAC960_Controllers[ControllerNumber]; | |
19624 | + if (Controller == NULL) return -ENXIO; | |
19625 | + if (Controller->FirmwareType != DAC960_V2_Controller) return -EINVAL; | |
19626 | + DataTransferLength = UserCommand.DataTransferLength; | |
19627 | + if (DataTransferLength > 0) | |
19628 | + { | |
19629 | + DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice, | |
19630 | + DataTransferLength, &DataTransferBufferDMA); | |
19631 | + if (DataTransferBuffer == NULL) return -ENOMEM; | |
19632 | + memset(DataTransferBuffer, 0, DataTransferLength); | |
19633 | + } | |
19634 | + else if (DataTransferLength < 0) | |
19635 | + { | |
19636 | + DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice, | |
19637 | + -DataTransferLength, &DataTransferBufferDMA); | |
19638 | + if (DataTransferBuffer == NULL) return -ENOMEM; | |
19639 | + if (copy_from_user(DataTransferBuffer, | |
19640 | + UserCommand.DataTransferBuffer, | |
19641 | + -DataTransferLength)) { | |
19642 | + ErrorCode = -EFAULT; | |
19643 | + goto Failure2; | |
19644 | + } | |
19645 | + } | |
19646 | + RequestSenseLength = UserCommand.RequestSenseLength; | |
19647 | + if (RequestSenseLength > 0) | |
19648 | + { | |
19649 | + RequestSenseBuffer = pci_alloc_consistent(Controller->PCIDevice, | |
19650 | + RequestSenseLength, &RequestSenseBufferDMA); | |
19651 | + if (RequestSenseBuffer == NULL) | |
19652 | + { | |
19653 | + ErrorCode = -ENOMEM; | |
19654 | + goto Failure2; | |
19655 | + } | |
19656 | + memset(RequestSenseBuffer, 0, RequestSenseLength); | |
19657 | + } | |
19658 | + spin_lock_irqsave(&Controller->queue_lock, flags); | |
19659 | + while ((Command = DAC960_AllocateCommand(Controller)) == NULL) | |
19660 | + DAC960_WaitForCommand(Controller); | |
19661 | + spin_unlock_irqrestore(&Controller->queue_lock, flags); | |
19662 | + DAC960_V2_ClearCommand(Command); | |
19663 | + Command->CommandType = DAC960_ImmediateCommand; | |
19664 | + CommandMailbox = &Command->V2.CommandMailbox; | |
19665 | + memcpy(CommandMailbox, &UserCommand.CommandMailbox, | |
19666 | + sizeof(DAC960_V2_CommandMailbox_T)); | |
19667 | + CommandMailbox->Common.CommandControlBits | |
19668 | + .AdditionalScatterGatherListMemory = false; | |
19669 | + CommandMailbox->Common.CommandControlBits | |
19670 | + .NoAutoRequestSense = true; | |
19671 | + CommandMailbox->Common.DataTransferSize = 0; | |
19672 | + CommandMailbox->Common.DataTransferPageNumber = 0; | |
19673 | + memset(&CommandMailbox->Common.DataTransferMemoryAddress, 0, | |
19674 | + sizeof(DAC960_V2_DataTransferMemoryAddress_T)); | |
19675 | + if (DataTransferLength != 0) | |
19676 | + { | |
19677 | + if (DataTransferLength > 0) | |
19678 | + { | |
19679 | + CommandMailbox->Common.CommandControlBits | |
19680 | + .DataTransferControllerToHost = true; | |
19681 | + CommandMailbox->Common.DataTransferSize = DataTransferLength; | |
19682 | + } | |
19683 | + else | |
19684 | + { | |
19685 | + CommandMailbox->Common.CommandControlBits | |
19686 | + .DataTransferControllerToHost = false; | |
19687 | + CommandMailbox->Common.DataTransferSize = -DataTransferLength; | |
19688 | + } | |
19689 | + CommandMailbox->Common.DataTransferMemoryAddress | |
19690 | + .ScatterGatherSegments[0] | |
19691 | + .SegmentDataPointer = DataTransferBufferDMA; | |
19692 | + CommandMailbox->Common.DataTransferMemoryAddress | |
19693 | + .ScatterGatherSegments[0] | |
19694 | + .SegmentByteCount = | |
19695 | + CommandMailbox->Common.DataTransferSize; | |
19696 | + } | |
19697 | + if (RequestSenseLength > 0) | |
19698 | + { | |
19699 | + CommandMailbox->Common.CommandControlBits | |
19700 | + .NoAutoRequestSense = false; | |
19701 | + CommandMailbox->Common.RequestSenseSize = RequestSenseLength; | |
19702 | + CommandMailbox->Common.RequestSenseBusAddress = | |
19703 | + RequestSenseBufferDMA; | |
19704 | + } | |
19705 | + DAC960_ExecuteCommand(Command); | |
19706 | + CommandStatus = Command->V2.CommandStatus; | |
19707 | + RequestSenseLength = Command->V2.RequestSenseLength; | |
19708 | + DataTransferResidue = Command->V2.DataTransferResidue; | |
19709 | + spin_lock_irqsave(&Controller->queue_lock, flags); | |
19710 | + DAC960_DeallocateCommand(Command); | |
19711 | + spin_unlock_irqrestore(&Controller->queue_lock, flags); | |
19712 | + if (RequestSenseLength > UserCommand.RequestSenseLength) | |
19713 | + RequestSenseLength = UserCommand.RequestSenseLength; | |
19714 | + if (copy_to_user(&UserSpaceUserCommand->DataTransferLength, | |
19715 | + &DataTransferResidue, | |
19716 | + sizeof(DataTransferResidue))) { | |
19717 | + ErrorCode = -EFAULT; | |
19718 | + goto Failure2; | |
19719 | + } | |
19720 | + if (copy_to_user(&UserSpaceUserCommand->RequestSenseLength, | |
19721 | + &RequestSenseLength, sizeof(RequestSenseLength))) { | |
19722 | + ErrorCode = -EFAULT; | |
19723 | + goto Failure2; | |
19724 | + } | |
19725 | + if (DataTransferLength > 0) | |
19726 | + { | |
19727 | + if (copy_to_user(UserCommand.DataTransferBuffer, | |
19728 | + DataTransferBuffer, DataTransferLength)) { | |
19729 | + ErrorCode = -EFAULT; | |
19730 | + goto Failure2; | |
19731 | + } | |
19732 | + } | |
19733 | + if (RequestSenseLength > 0) | |
19734 | + { | |
19735 | + if (copy_to_user(UserCommand.RequestSenseBuffer, | |
19736 | + RequestSenseBuffer, RequestSenseLength)) { | |
19737 | + ErrorCode = -EFAULT; | |
19738 | + goto Failure2; | |
19739 | + } | |
19740 | + } | |
19741 | + ErrorCode = CommandStatus; | |
19742 | + Failure2: | |
19743 | + pci_free_consistent(Controller->PCIDevice, abs(DataTransferLength), | |
19744 | + DataTransferBuffer, DataTransferBufferDMA); | |
19745 | + if (RequestSenseBuffer != NULL) | |
19746 | + pci_free_consistent(Controller->PCIDevice, RequestSenseLength, | |
19747 | + RequestSenseBuffer, RequestSenseBufferDMA); | |
19748 | + Failure2a: | |
19749 | + return ErrorCode; | |
19750 | + } | |
19751 | + case DAC960_IOCTL_V2_GET_HEALTH_STATUS: | |
19752 | + { | |
19753 | + DAC960_V2_GetHealthStatus_T *UserSpaceGetHealthStatus = | |
19754 | + (DAC960_V2_GetHealthStatus_T *) Argument; | |
19755 | + DAC960_V2_GetHealthStatus_T GetHealthStatus; | |
19756 | + DAC960_V2_HealthStatusBuffer_T HealthStatusBuffer; | |
19757 | + DAC960_Controller_T *Controller; | |
19758 | + int ControllerNumber; | |
19759 | + if (UserSpaceGetHealthStatus == NULL) return -EINVAL; | |
19760 | + if (copy_from_user(&GetHealthStatus, UserSpaceGetHealthStatus, | |
19761 | + sizeof(DAC960_V2_GetHealthStatus_T))) | |
19762 | + return -EFAULT; | |
19763 | + ControllerNumber = GetHealthStatus.ControllerNumber; | |
19764 | + if (ControllerNumber < 0 || | |
19765 | + ControllerNumber > DAC960_ControllerCount - 1) | |
19766 | + return -ENXIO; | |
19767 | + Controller = DAC960_Controllers[ControllerNumber]; | |
19768 | + if (Controller == NULL) return -ENXIO; | |
19769 | + if (Controller->FirmwareType != DAC960_V2_Controller) return -EINVAL; | |
19770 | + if (copy_from_user(&HealthStatusBuffer, | |
19771 | + GetHealthStatus.HealthStatusBuffer, | |
19772 | + sizeof(DAC960_V2_HealthStatusBuffer_T))) | |
19773 | + return -EFAULT; | |
19774 | + while (Controller->V2.HealthStatusBuffer->StatusChangeCounter | |
19775 | + == HealthStatusBuffer.StatusChangeCounter && | |
19776 | + Controller->V2.HealthStatusBuffer->NextEventSequenceNumber | |
19777 | + == HealthStatusBuffer.NextEventSequenceNumber) | |
19778 | + { | |
19779 | + interruptible_sleep_on_timeout(&Controller->HealthStatusWaitQueue, | |
19780 | + DAC960_MonitoringTimerInterval); | |
19781 | + if (signal_pending(current)) return -EINTR; | |
19782 | + } | |
19783 | + if (copy_to_user(GetHealthStatus.HealthStatusBuffer, | |
19784 | + Controller->V2.HealthStatusBuffer, | |
19785 | + sizeof(DAC960_V2_HealthStatusBuffer_T))) | |
19786 | + return -EFAULT; | |
19787 | + return 0; | |
19788 | + } | |
19789 | + } | |
19790 | + return -EINVAL; | |
19791 | +} | |
19792 | + | |
19793 | +static struct file_operations DAC960_gam_fops = { | |
19794 | + .owner = THIS_MODULE, | |
19795 | + .ioctl = DAC960_gam_ioctl | |
19796 | +}; | |
19797 | + | |
19798 | +static struct miscdevice DAC960_gam_dev = { | |
19799 | + DAC960_GAM_MINOR, | |
19800 | + "dac960_gam", | |
19801 | + &DAC960_gam_fops | |
19802 | +}; | |
19803 | + | |
19804 | +static int DAC960_gam_init(void) | |
19805 | +{ | |
19806 | + int ret; | |
19807 | + | |
19808 | + ret = misc_register(&DAC960_gam_dev); | |
19809 | + if (ret) | |
19810 | + printk(KERN_ERR "DAC960_gam: can't misc_register on minor %d\n", DAC960_GAM_MINOR); | |
19811 | + return ret; | |
19812 | +} | |
19813 | + | |
19814 | +static void DAC960_gam_cleanup(void) | |
19815 | +{ | |
19816 | + misc_deregister(&DAC960_gam_dev); | |
19817 | +} | |
19818 | + | |
19819 | +#endif /* DAC960_GAM_MINOR */ | |
19820 | + | |
19821 | static struct DAC960_privdata DAC960_BA_privdata = { | |
19822 | .HardwareType = DAC960_BA_Controller, | |
19823 | .FirmwareType = DAC960_V2_Controller, | |
19824 | @@ -7000,12 +7025,23 @@ | |
19825 | ||
19826 | static int DAC960_init_module(void) | |
19827 | { | |
19828 | - return pci_module_init(&DAC960_pci_driver); | |
19829 | + int ret; | |
19830 | + | |
19831 | + ret = pci_module_init(&DAC960_pci_driver); | |
19832 | +#ifdef DAC960_GAM_MINOR | |
19833 | + if (!ret) | |
19834 | + DAC960_gam_init(); | |
19835 | +#endif | |
19836 | + return ret; | |
19837 | } | |
19838 | ||
19839 | static void DAC960_cleanup_module(void) | |
19840 | { | |
19841 | int i; | |
19842 | + | |
19843 | +#ifdef DAC960_GAM_MINOR | |
19844 | + DAC960_gam_cleanup(); | |
19845 | +#endif | |
19846 | ||
19847 | for (i = 0; i < DAC960_ControllerCount; i++) { | |
19848 | DAC960_Controller_T *Controller = DAC960_Controllers[i]; | |
19849 | diff -Nru a/drivers/block/DAC960.h b/drivers/block/DAC960.h | |
19850 | --- a/drivers/block/DAC960.h Thu Aug 7 06:13:28 2003 | |
19851 | +++ b/drivers/block/DAC960.h Sun Aug 31 16:13:56 2003 | |
19852 | @@ -4138,8 +4138,6 @@ | |
19853 | static void DAC960_V1_QueueMonitoringCommand(DAC960_Command_T *); | |
19854 | static void DAC960_V2_QueueMonitoringCommand(DAC960_Command_T *); | |
19855 | static void DAC960_MonitoringTimerFunction(unsigned long); | |
19856 | -static int DAC960_UserIOCTL(struct inode *, struct file *, | |
19857 | - unsigned int, unsigned long); | |
19858 | static void DAC960_Message(DAC960_MessageLevel_T, unsigned char *, | |
19859 | DAC960_Controller_T *, ...); | |
19860 | static void DAC960_CreateProcEntries(DAC960_Controller_T *); | |
19861 | diff -Nru a/drivers/block/acsi_slm.c b/drivers/block/acsi_slm.c | |
19862 | --- a/drivers/block/acsi_slm.c Sun Jun 8 04:05:16 2003 | |
19863 | +++ b/drivers/block/acsi_slm.c Tue Aug 26 09:25:40 2003 | |
19864 | @@ -374,7 +374,7 @@ | |
19865 | if (!(page = __get_free_page( GFP_KERNEL ))) | |
19866 | return( -ENOMEM ); | |
19867 | ||
19868 | - length = slm_getstats( (char *)page, MINOR(node->i_rdev) ); | |
19869 | + length = slm_getstats( (char *)page, iminor(node) ); | |
19870 | if (length < 0) { | |
19871 | count = length; | |
19872 | goto out; | |
19873 | @@ -622,7 +622,7 @@ | |
19874 | ||
19875 | { | |
19876 | struct inode *node = file->f_dentry->d_inode; | |
19877 | - int device = MINOR( node->i_rdev ); | |
19878 | + int device = iminor(node); | |
19879 | int n, filled, w, h; | |
19880 | ||
19881 | while( SLMState == PRINTING || | |
19882 | @@ -694,7 +694,7 @@ | |
19883 | static int slm_ioctl( struct inode *inode, struct file *file, | |
19884 | unsigned int cmd, unsigned long arg ) | |
19885 | ||
19886 | -{ int device = MINOR( inode->i_rdev ), err; | |
19887 | +{ int device = iminor(inode), err; | |
19888 | ||
19889 | /* I can think of setting: | |
19890 | * - manual feed | |
19891 | @@ -768,7 +768,7 @@ | |
19892 | { int device; | |
19893 | struct slm *sip; | |
19894 | ||
19895 | - device = MINOR(inode->i_rdev); | |
19896 | + device = iminor(inode); | |
19897 | if (device >= N_SLM_Printers) | |
19898 | return( -ENXIO ); | |
19899 | sip = &slm_info[device]; | |
19900 | @@ -797,7 +797,7 @@ | |
19901 | { int device; | |
19902 | struct slm *sip; | |
19903 | ||
19904 | - device = MINOR(inode->i_rdev); | |
19905 | + device = iminor(inode); | |
19906 | sip = &slm_info[device]; | |
19907 | ||
19908 | if (file->f_mode & 2) | |
19909 | diff -Nru a/drivers/block/amiflop.c b/drivers/block/amiflop.c | |
19910 | --- a/drivers/block/amiflop.c Thu Aug 7 02:25:23 2003 | |
19911 | +++ b/drivers/block/amiflop.c Wed Sep 3 03:32:10 2003 | |
19912 | @@ -55,24 +55,15 @@ | |
19913 | ||
19914 | #include <linux/module.h> | |
19915 | ||
19916 | -#include <linux/sched.h> | |
19917 | -#include <linux/fs.h> | |
19918 | -#include <linux/fcntl.h> | |
19919 | -#include <linux/kernel.h> | |
19920 | -#include <linux/timer.h> | |
19921 | #include <linux/fd.h> | |
19922 | #include <linux/hdreg.h> | |
19923 | -#include <linux/errno.h> | |
19924 | -#include <linux/types.h> | |
19925 | #include <linux/delay.h> | |
19926 | -#include <linux/string.h> | |
19927 | -#include <linux/slab.h> | |
19928 | #include <linux/init.h> | |
19929 | #include <linux/amifdreg.h> | |
19930 | #include <linux/amifd.h> | |
19931 | -#include <linux/ioport.h> | |
19932 | #include <linux/buffer_head.h> | |
19933 | -#include <linux/interrupt.h> | |
19934 | +#include <linux/blkdev.h> | |
19935 | +#include <linux/elevator.h> | |
19936 | ||
19937 | #include <asm/setup.h> | |
19938 | #include <asm/uaccess.h> | |
19939 | @@ -1446,7 +1437,7 @@ | |
19940 | static int fd_ioctl(struct inode *inode, struct file *filp, | |
19941 | unsigned int cmd, unsigned long param) | |
19942 | { | |
19943 | - int drive = minor(inode->i_rdev) & 3; | |
19944 | + int drive = iminor(inode) & 3; | |
19945 | static struct floppy_struct getprm; | |
19946 | ||
19947 | switch(cmd){ | |
19948 | @@ -1570,8 +1561,8 @@ | |
19949 | */ | |
19950 | static int floppy_open(struct inode *inode, struct file *filp) | |
19951 | { | |
19952 | - int drive = minor(inode->i_rdev) & 3; | |
19953 | - int system = (minor(inode->i_rdev) & 4) >> 2; | |
19954 | + int drive = iminor(inode) & 3; | |
19955 | + int system = (iminor(inode) & 4) >> 2; | |
19956 | int old_dev; | |
19957 | unsigned long flags; | |
19958 | ||
19959 | @@ -1618,7 +1609,7 @@ | |
19960 | ||
19961 | static int floppy_release(struct inode * inode, struct file * filp) | |
19962 | { | |
19963 | - int drive = minor(inode->i_rdev) & 3; | |
19964 | + int drive = iminor(inode) & 3; | |
19965 | ||
19966 | if (unit[drive].dirty == 1) { | |
19967 | del_timer (flush_track_timer + drive); | |
19968 | @@ -1740,7 +1731,7 @@ | |
19969 | ||
19970 | int __init amiga_floppy_init(void) | |
19971 | { | |
19972 | - int i; | |
19973 | + int i, ret; | |
19974 | ||
19975 | if (!AMIGAHW_PRESENT(AMI_FLOPPY)) | |
19976 | return -ENXIO; | |
19977 | @@ -1752,41 +1743,39 @@ | |
19978 | * We request DSKPTR, DSKLEN and DSKDATA only, because the other | |
19979 | * floppy registers are too spreaded over the custom register space | |
19980 | */ | |
19981 | + ret = -EBUSY; | |
19982 | if (!request_mem_region(CUSTOM_PHYSADDR+0x20, 8, "amiflop [Paula]")) { | |
19983 | printk("fd: cannot get floppy registers\n"); | |
19984 | - unregister_blkdev(FLOPPY_MAJOR,"fd"); | |
19985 | - return -EBUSY; | |
19986 | + goto out_blkdev; | |
19987 | } | |
19988 | + | |
19989 | + ret = -ENOMEM; | |
19990 | if ((raw_buf = (char *)amiga_chip_alloc (RAW_BUF_SIZE, "Floppy")) == | |
19991 | NULL) { | |
19992 | printk("fd: cannot get chip mem buffer\n"); | |
19993 | - release_mem_region(CUSTOM_PHYSADDR+0x20, 8); | |
19994 | - unregister_blkdev(FLOPPY_MAJOR,"fd"); | |
19995 | - return -ENOMEM; | |
19996 | + goto out_memregion; | |
19997 | } | |
19998 | + | |
19999 | + ret = -EBUSY; | |
20000 | if (request_irq(IRQ_AMIGA_DSKBLK, fd_block_done, 0, "floppy_dma", NULL)) { | |
20001 | printk("fd: cannot get irq for dma\n"); | |
20002 | - amiga_chip_free(raw_buf); | |
20003 | - release_mem_region(CUSTOM_PHYSADDR+0x20, 8); | |
20004 | - unregister_blkdev(FLOPPY_MAJOR,"fd"); | |
20005 | - return -EBUSY; | |
20006 | + goto out_irq; | |
20007 | } | |
20008 | + | |
20009 | if (request_irq(IRQ_AMIGA_CIAA_TB, ms_isr, 0, "floppy_timer", NULL)) { | |
20010 | printk("fd: cannot get irq for timer\n"); | |
20011 | - free_irq(IRQ_AMIGA_DSKBLK, NULL); | |
20012 | - amiga_chip_free(raw_buf); | |
20013 | - release_mem_region(CUSTOM_PHYSADDR+0x20, 8); | |
20014 | - unregister_blkdev(FLOPPY_MAJOR,"fd"); | |
20015 | - return -EBUSY; | |
20016 | - } | |
20017 | - if (fd_probe_drives() < 1) { /* No usable drives */ | |
20018 | - free_irq(IRQ_AMIGA_CIAA_TB, NULL); | |
20019 | - free_irq(IRQ_AMIGA_DSKBLK, NULL); | |
20020 | - amiga_chip_free(raw_buf); | |
20021 | - release_mem_region(CUSTOM_PHYSADDR+0x20, 8); | |
20022 | - unregister_blkdev(FLOPPY_MAJOR,"fd"); | |
20023 | - return -ENXIO; | |
20024 | + goto out_irq2; | |
20025 | } | |
20026 | + | |
20027 | + ret = -ENOMEM; | |
20028 | + floppy_queue = blk_init_queue(do_fd_request, &amiflop_lock); | |
20029 | + if (!floppy_queue) | |
20030 | + goto out_queue; | |
20031 | + | |
20032 | + ret = -ENXIO; | |
20033 | + if (fd_probe_drives() < 1) /* No usable drives */ | |
20034 | + goto out_probe; | |
20035 | + | |
20036 | blk_register_region(MKDEV(FLOPPY_MAJOR, 0), 256, THIS_MODULE, | |
20037 | floppy_find, NULL, NULL); | |
20038 | ||
20039 | @@ -1813,17 +1802,6 @@ | |
20040 | post_write_timer.data = 0; | |
20041 | post_write_timer.function = post_write; | |
20042 | ||
20043 | - floppy_queue = blk_init_queue(do_fd_request, &amiflop_lock); | |
20044 | - if (!floppy_queue) { | |
20045 | - free_irq(IRQ_AMIGA_CIAA_TB, NULL); | |
20046 | - free_irq(IRQ_AMIGA_DSKBLK, NULL); | |
20047 | - amiga_chip_free(raw_buf); | |
20048 | - release_mem_region(CUSTOM_PHYSADDR+0x20, 8); | |
20049 | - unregister_blkdev(FLOPPY_MAJOR,"fd"); | |
20050 | - blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256); | |
20051 | - return -ENOMEM; | |
20052 | - } | |
20053 | - | |
20054 | for (i = 0; i < 128; i++) | |
20055 | mfmdecode[i]=255; | |
20056 | for (i = 0; i < 16; i++) | |
20057 | @@ -1835,6 +1813,20 @@ | |
20058 | /* init ms timer */ | |
20059 | ciaa.crb = 8; /* one-shot, stop */ | |
20060 | return 0; | |
20061 | + | |
20062 | +out_probe: | |
20063 | + blk_cleanup_queue(floppy_queue); | |
20064 | +out_queue: | |
20065 | + free_irq(IRQ_AMIGA_CIAA_TB, NULL); | |
20066 | +out_irq2: | |
20067 | + free_irq(IRQ_AMIGA_DSKBLK, NULL); | |
20068 | +out_irq: | |
20069 | + amiga_chip_free(raw_buf); | |
20070 | +out_memregion: | |
20071 | + release_mem_region(CUSTOM_PHYSADDR+0x20, 8); | |
20072 | +out_blkdev: | |
20073 | + unregister_blkdev(FLOPPY_MAJOR,"fd"); | |
20074 | + return ret; | |
20075 | } | |
20076 | ||
20077 | #ifdef MODULE | |
20078 | diff -Nru a/drivers/block/as-iosched.c b/drivers/block/as-iosched.c | |
20079 | --- a/drivers/block/as-iosched.c Fri Aug 15 00:57:28 2003 | |
20080 | +++ b/drivers/block/as-iosched.c Wed Sep 3 23:40:09 2003 | |
20081 | @@ -709,6 +709,14 @@ | |
20082 | return 1; | |
20083 | } | |
20084 | ||
20085 | + if (aic->seek_samples == 0 || aic->ttime_samples == 0) { | |
20086 | + /* | |
20087 | + * Process has just started IO so default to not anticipate. | |
20088 | + * Maybe should be smarter. | |
20089 | + */ | |
20090 | + return 1; | |
20091 | + } | |
20092 | + | |
20093 | if (aic->ttime_mean > ad->antic_expire) { | |
20094 | /* the process thinks too much between requests */ | |
20095 | return 1; | |
20096 | @@ -902,12 +910,7 @@ | |
20097 | struct as_rq *arq = RQ_DATA(rq); | |
20098 | struct as_io_context *aic; | |
20099 | ||
20100 | - if (unlikely(!blk_fs_request(rq))) | |
20101 | - return; | |
20102 | - | |
20103 | - WARN_ON(blk_fs_request(rq) && arq->state == AS_RQ_NEW); | |
20104 | - | |
20105 | - if (arq->state != AS_RQ_DISPATCHED) | |
20106 | + if (unlikely(arq->state != AS_RQ_DISPATCHED)) | |
20107 | return; | |
20108 | ||
20109 | if (ad->changed_batch && ad->nr_dispatched == 1) { | |
20110 | @@ -1027,7 +1030,7 @@ | |
20111 | { | |
20112 | struct as_rq *arq = RQ_DATA(rq); | |
20113 | ||
20114 | - if (unlikely(!blk_fs_request(rq))) | |
20115 | + if (unlikely(arq->state == AS_RQ_NEW)) | |
20116 | return; | |
20117 | ||
20118 | if (!arq) { | |
20119 | @@ -1333,9 +1336,9 @@ | |
20120 | atomic_inc(&arq->io_context->aic->nr_dispatched); | |
20121 | } else | |
20122 | WARN_ON(blk_fs_request(rq) | |
20123 | - && (!(rq->flags & REQ_HARDBARRIER)) ); | |
20124 | + && (!(rq->flags & (REQ_HARDBARRIER|REQ_SOFTBARRIER))) ); | |
20125 | ||
20126 | - list_add_tail(&rq->queuelist, ad->dispatch); | |
20127 | + list_add(&rq->queuelist, ad->dispatch); | |
20128 | ||
20129 | /* Stop anticipating - let this request get through */ | |
20130 | as_antic_stop(ad); | |
20131 | @@ -1350,26 +1353,31 @@ | |
20132 | struct as_data *ad = q->elevator.elevator_data; | |
20133 | struct as_rq *arq = RQ_DATA(rq); | |
20134 | ||
20135 | - if (unlikely(rq->flags & REQ_HARDBARRIER)) { | |
20136 | + if (unlikely(rq->flags & (REQ_HARDBARRIER|REQ_SOFTBARRIER))) { | |
20137 | q->last_merge = NULL; | |
20138 | ||
20139 | - while (ad->next_arq[REQ_SYNC]) | |
20140 | - as_move_to_dispatch(ad, ad->next_arq[REQ_SYNC]); | |
20141 | + if (insert_here != ad->dispatch) { | |
20142 | + while (ad->next_arq[REQ_SYNC]) | |
20143 | + as_move_to_dispatch(ad, ad->next_arq[REQ_SYNC]); | |
20144 | + | |
20145 | + while (ad->next_arq[REQ_ASYNC]) | |
20146 | + as_move_to_dispatch(ad, ad->next_arq[REQ_ASYNC]); | |
20147 | + } | |
20148 | ||
20149 | - while (ad->next_arq[REQ_ASYNC]) | |
20150 | - as_move_to_dispatch(ad, ad->next_arq[REQ_ASYNC]); | |
20151 | + if (!insert_here) | |
20152 | + insert_here = ad->dispatch->prev; | |
20153 | } | |
20154 | ||
20155 | if (unlikely(!blk_fs_request(rq))) { | |
20156 | if (!insert_here) | |
20157 | - insert_here = ad->dispatch->prev; | |
20158 | + insert_here = ad->dispatch; | |
20159 | + } | |
20160 | ||
20161 | + if (insert_here) { | |
20162 | list_add(&rq->queuelist, insert_here); | |
20163 | ||
20164 | /* Stop anticipating - let this request get through */ | |
20165 | - if (!list_empty(ad->dispatch) | |
20166 | - && (ad->antic_status == ANTIC_WAIT_REQ | |
20167 | - || ad->antic_status == ANTIC_WAIT_NEXT)) | |
20168 | + if (list_empty(ad->dispatch)) | |
20169 | as_antic_stop(ad); | |
20170 | ||
20171 | return; | |
20172 | diff -Nru a/drivers/block/ataflop.c b/drivers/block/ataflop.c | |
20173 | --- a/drivers/block/ataflop.c Thu Aug 7 02:25:23 2003 | |
20174 | +++ b/drivers/block/ataflop.c Wed Jul 30 15:49:57 2003 | |
20175 | @@ -63,35 +63,16 @@ | |
20176 | ||
20177 | #include <linux/module.h> | |
20178 | ||
20179 | -#include <linux/sched.h> | |
20180 | -#include <linux/string.h> | |
20181 | -#include <linux/fs.h> | |
20182 | -#include <linux/fcntl.h> | |
20183 | -#include <linux/kernel.h> | |
20184 | -#include <linux/timer.h> | |
20185 | #include <linux/fd.h> | |
20186 | -#include <linux/errno.h> | |
20187 | -#include <linux/types.h> | |
20188 | #include <linux/delay.h> | |
20189 | -#include <linux/mm.h> | |
20190 | -#include <linux/slab.h> | |
20191 | #include <linux/init.h> | |
20192 | -#include <linux/buffer_head.h> /* for invalidate_buffers() */ | |
20193 | - | |
20194 | -#include <asm/setup.h> | |
20195 | -#include <asm/system.h> | |
20196 | -#include <asm/bitops.h> | |
20197 | -#include <asm/irq.h> | |
20198 | -#include <asm/pgtable.h> | |
20199 | -#include <asm/uaccess.h> | |
20200 | +#include <linux/blkdev.h> | |
20201 | ||
20202 | #include <asm/atafd.h> | |
20203 | #include <asm/atafdreg.h> | |
20204 | -#include <asm/atarihw.h> | |
20205 | #include <asm/atariints.h> | |
20206 | #include <asm/atari_stdma.h> | |
20207 | #include <asm/atari_stram.h> | |
20208 | -#include <linux/blkpg.h> | |
20209 | ||
20210 | #define FD_MAX_UNITS 2 | |
20211 | ||
20212 | @@ -1838,7 +1819,7 @@ | |
20213 | static int floppy_open( struct inode *inode, struct file *filp ) | |
20214 | { | |
20215 | struct atari_floppy_struct *p = inode->i_bdev->bd_disk->private_data; | |
20216 | - int type = minor(inode->i_rdev) >> 2; | |
20217 | + int type = iminor(inode) >> 2; | |
20218 | ||
20219 | DPRINT(("fd_open: type=%d\n",type)); | |
20220 | if (p->ref && p->type != type) | |
20221 | diff -Nru a/drivers/block/cciss.c b/drivers/block/cciss.c | |
20222 | --- a/drivers/block/cciss.c Thu Aug 7 06:13:28 2003 | |
20223 | +++ b/drivers/block/cciss.c Wed Sep 3 23:45:21 2003 | |
20224 | @@ -356,11 +356,11 @@ | |
20225 | */ | |
20226 | static int cciss_open(struct inode *inode, struct file *filep) | |
20227 | { | |
20228 | - int ctlr = major(inode->i_rdev) - COMPAQ_CISS_MAJOR; | |
20229 | - int dsk = minor(inode->i_rdev) >> NWD_SHIFT; | |
20230 | + int ctlr = imajor(inode) - COMPAQ_CISS_MAJOR; | |
20231 | + int dsk = iminor(inode) >> NWD_SHIFT; | |
20232 | ||
20233 | #ifdef CCISS_DEBUG | |
20234 | - printk(KERN_DEBUG "cciss_open %x (%x:%x)\n", inode->i_rdev, ctlr, dsk); | |
20235 | + printk(KERN_DEBUG "cciss_open %s (%x:%x)\n", inode->i_bdev->bd_disk->disk_name, ctlr, dsk); | |
20236 | #endif /* CCISS_DEBUG */ | |
20237 | ||
20238 | if (ctlr >= MAX_CTLR || hba[ctlr] == NULL) | |
20239 | @@ -372,7 +372,7 @@ | |
20240 | * for "raw controller". | |
20241 | */ | |
20242 | if (hba[ctlr]->drv[dsk].nr_blocks == 0) { | |
20243 | - if (minor(inode->i_rdev) != 0) | |
20244 | + if (iminor(inode) != 0) | |
20245 | return -ENXIO; | |
20246 | if (!capable(CAP_SYS_ADMIN)) | |
20247 | return -EPERM; | |
20248 | @@ -386,11 +386,11 @@ | |
20249 | */ | |
20250 | static int cciss_release(struct inode *inode, struct file *filep) | |
20251 | { | |
20252 | - int ctlr = major(inode->i_rdev) - COMPAQ_CISS_MAJOR; | |
20253 | - int dsk = minor(inode->i_rdev) >> NWD_SHIFT; | |
20254 | + int ctlr = imajor(inode) - COMPAQ_CISS_MAJOR; | |
20255 | + int dsk = iminor(inode) >> NWD_SHIFT; | |
20256 | ||
20257 | #ifdef CCISS_DEBUG | |
20258 | - printk(KERN_DEBUG "cciss_release %x (%x:%x)\n", inode->i_rdev, ctlr, dsk); | |
20259 | + printk(KERN_DEBUG "cciss_release %s (%x:%x)\n", inode->i_bdev->bd_disk->disk_name, ctlr, dsk); | |
20260 | #endif /* CCISS_DEBUG */ | |
20261 | ||
20262 | /* fsync_dev(inode->i_rdev); */ | |
20263 | @@ -406,8 +406,8 @@ | |
20264 | static int cciss_ioctl(struct inode *inode, struct file *filep, | |
20265 | unsigned int cmd, unsigned long arg) | |
20266 | { | |
20267 | - int ctlr = major(inode->i_rdev) - COMPAQ_CISS_MAJOR; | |
20268 | - int dsk = minor(inode->i_rdev) >> NWD_SHIFT; | |
20269 | + int ctlr = imajor(inode) - COMPAQ_CISS_MAJOR; | |
20270 | + int dsk = iminor(inode) >> NWD_SHIFT; | |
20271 | ||
20272 | #ifdef CCISS_DEBUG | |
20273 | printk(KERN_DEBUG "cciss_ioctl: Called with cmd=%x %lx\n", cmd, arg); | |
20274 | @@ -2447,11 +2447,8 @@ | |
20275 | if( i < 0 ) | |
20276 | return (-1); | |
20277 | if (cciss_pci_init(hba[i], pdev) != 0) | |
20278 | - { | |
20279 | - release_io_mem(hba[i]); | |
20280 | - free_hba(i); | |
20281 | - return (-1); | |
20282 | - } | |
20283 | + goto clean1; | |
20284 | + | |
20285 | sprintf(hba[i]->devname, "cciss%d", i); | |
20286 | hba[i]->ctlr = i; | |
20287 | hba[i]->pdev = pdev; | |
20288 | @@ -2463,28 +2460,23 @@ | |
20289 | printk("cciss: not using DAC cycles\n"); | |
20290 | else { | |
20291 | printk("cciss: no suitable DMA available\n"); | |
20292 | - free_hba(i); | |
20293 | - return -ENODEV; | |
20294 | + goto clean1; | |
20295 | } | |
20296 | ||
20297 | if (register_blkdev(COMPAQ_CISS_MAJOR+i, hba[i]->devname)) { | |
20298 | - release_io_mem(hba[i]); | |
20299 | - free_hba(i); | |
20300 | - return -1; | |
20301 | + printk(KERN_ERR "cciss: Unable to register device %s\n", | |
20302 | + hba[i]->devname); | |
20303 | + goto clean1; | |
20304 | } | |
20305 | ||
20306 | /* make sure the board interrupts are off */ | |
20307 | hba[i]->access.set_intr_mask(hba[i], CCISS_INTR_OFF); | |
20308 | if( request_irq(hba[i]->intr, do_cciss_intr, | |
20309 | SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, | |
20310 | - hba[i]->devname, hba[i])) | |
20311 | - { | |
20312 | - printk(KERN_ERR "ciss: Unable to get irq %d for %s\n", | |
20313 | + hba[i]->devname, hba[i])) { | |
20314 | + printk(KERN_ERR "cciss: Unable to get irq %d for %s\n", | |
20315 | hba[i]->intr, hba[i]->devname); | |
20316 | - unregister_blkdev( COMPAQ_CISS_MAJOR+i, hba[i]->devname); | |
20317 | - release_io_mem(hba[i]); | |
20318 | - free_hba(i); | |
20319 | - return(-1); | |
20320 | + goto clean2; | |
20321 | } | |
20322 | hba[i]->cmd_pool_bits = kmalloc(((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long), GFP_KERNEL); | |
20323 | hba[i]->cmd_pool = (CommandList_struct *)pci_alloc_consistent( | |
20324 | @@ -2495,35 +2487,18 @@ | |
20325 | &(hba[i]->errinfo_pool_dhandle)); | |
20326 | if((hba[i]->cmd_pool_bits == NULL) | |
20327 | || (hba[i]->cmd_pool == NULL) | |
20328 | - || (hba[i]->errinfo_pool == NULL)) | |
20329 | - { | |
20330 | -err_all: | |
20331 | - if(hba[i]->cmd_pool_bits) | |
20332 | - kfree(hba[i]->cmd_pool_bits); | |
20333 | - if(hba[i]->cmd_pool) | |
20334 | - pci_free_consistent(hba[i]->pdev, | |
20335 | - NR_CMDS * sizeof(CommandList_struct), | |
20336 | - hba[i]->cmd_pool, hba[i]->cmd_pool_dhandle); | |
20337 | - if(hba[i]->errinfo_pool) | |
20338 | - pci_free_consistent(hba[i]->pdev, | |
20339 | - NR_CMDS * sizeof( ErrorInfo_struct), | |
20340 | - hba[i]->errinfo_pool, | |
20341 | - hba[i]->errinfo_pool_dhandle); | |
20342 | - free_irq(hba[i]->intr, hba[i]); | |
20343 | - unregister_blkdev(COMPAQ_CISS_MAJOR+i, hba[i]->devname); | |
20344 | - release_io_mem(hba[i]); | |
20345 | - free_hba(i); | |
20346 | + || (hba[i]->errinfo_pool == NULL)) { | |
20347 | printk( KERN_ERR "cciss: out of memory"); | |
20348 | - return(-1); | |
20349 | + goto clean4; | |
20350 | } | |
20351 | ||
20352 | - /* | |
20353 | - * someone needs to clean up this failure handling mess | |
20354 | - */ | |
20355 | spin_lock_init(&hba[i]->lock); | |
20356 | q = blk_init_queue(do_cciss_request, &hba[i]->lock); | |
20357 | if (!q) | |
20358 | - goto err_all; | |
20359 | + goto clean4; | |
20360 | + | |
20361 | + hba[i]->queue = q; | |
20362 | + q->queuedata = hba[i]; | |
20363 | ||
20364 | /* Initialize the pdev driver private data. | |
20365 | have it point to hba[i]. */ | |
20366 | @@ -2545,7 +2520,6 @@ | |
20367 | ||
20368 | cciss_procinit(i); | |
20369 | ||
20370 | - q->queuedata = hba[i]; | |
20371 | blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask); | |
20372 | ||
20373 | /* This is a hardware imposed limit. */ | |
20374 | @@ -2574,6 +2548,26 @@ | |
20375 | add_disk(disk); | |
20376 | } | |
20377 | return(1); | |
20378 | + | |
20379 | +clean4: | |
20380 | + if(hba[i]->cmd_pool_bits) | |
20381 | + kfree(hba[i]->cmd_pool_bits); | |
20382 | + if(hba[i]->cmd_pool) | |
20383 | + pci_free_consistent(hba[i]->pdev, | |
20384 | + NR_CMDS * sizeof(CommandList_struct), | |
20385 | + hba[i]->cmd_pool, hba[i]->cmd_pool_dhandle); | |
20386 | + if(hba[i]->errinfo_pool) | |
20387 | + pci_free_consistent(hba[i]->pdev, | |
20388 | + NR_CMDS * sizeof( ErrorInfo_struct), | |
20389 | + hba[i]->errinfo_pool, | |
20390 | + hba[i]->errinfo_pool_dhandle); | |
20391 | + free_irq(hba[i]->intr, hba[i]); | |
20392 | +clean2: | |
20393 | + unregister_blkdev(COMPAQ_CISS_MAJOR+i, hba[i]->devname); | |
20394 | +clean1: | |
20395 | + release_io_mem(hba[i]); | |
20396 | + free_hba(i); | |
20397 | + return(-1); | |
20398 | } | |
20399 | ||
20400 | static void __devexit cciss_remove_one (struct pci_dev *pdev) | |
20401 | diff -Nru a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c | |
20402 | --- a/drivers/block/cpqarray.c Thu Aug 7 02:25:24 2003 | |
20403 | +++ b/drivers/block/cpqarray.c Tue Aug 26 09:25:41 2003 | |
20404 | @@ -1078,7 +1078,7 @@ | |
20405 | put_user(host->ctlr_sig, (int*)arg); | |
20406 | return 0; | |
20407 | case IDAREVALIDATEVOLS: | |
20408 | - if (minor(inode->i_rdev) != 0) | |
20409 | + if (iminor(inode) != 0) | |
20410 | return -ENXIO; | |
20411 | return revalidate_allvol(host); | |
20412 | case IDADRIVERVERSION: | |
20413 | diff -Nru a/drivers/block/deadline-iosched.c b/drivers/block/deadline-iosched.c | |
20414 | --- a/drivers/block/deadline-iosched.c Fri Jul 25 11:20:53 2003 | |
20415 | +++ b/drivers/block/deadline-iosched.c Wed Sep 3 23:40:09 2003 | |
20416 | @@ -627,21 +627,25 @@ | |
20417 | struct deadline_data *dd = q->elevator.elevator_data; | |
20418 | struct deadline_rq *drq = RQ_DATA(rq); | |
20419 | ||
20420 | - if (unlikely(rq->flags & REQ_HARDBARRIER)) { | |
20421 | + if (unlikely(rq->flags & (REQ_HARDBARRIER|REQ_SOFTBARRIER))) { | |
20422 | DL_INVALIDATE_HASH(dd); | |
20423 | q->last_merge = NULL; | |
20424 | ||
20425 | - while (deadline_dispatch_requests(dd)) | |
20426 | - ; | |
20427 | + if (insert_here != dd->dispatch) { | |
20428 | + while (deadline_dispatch_requests(dd)) | |
20429 | + ; | |
20430 | + } | |
20431 | ||
20432 | - list_add_tail(&rq->queuelist, dd->dispatch); | |
20433 | - return; | |
20434 | + if (!insert_here) | |
20435 | + insert_here = dd->dispatch->prev; | |
20436 | } | |
20437 | ||
20438 | if (unlikely(!blk_fs_request(rq))) { | |
20439 | if (!insert_here) | |
20440 | - insert_here = dd->dispatch->prev; | |
20441 | + insert_here = dd->dispatch; | |
20442 | + } | |
20443 | ||
20444 | + if (insert_here) { | |
20445 | list_add(&rq->queuelist, insert_here); | |
20446 | return; | |
20447 | } | |
20448 | diff -Nru a/drivers/block/elevator.c b/drivers/block/elevator.c | |
20449 | --- a/drivers/block/elevator.c Thu Aug 14 18:16:57 2003 | |
20450 | +++ b/drivers/block/elevator.c Wed Sep 3 23:40:09 2003 | |
20451 | @@ -162,10 +162,10 @@ | |
20452 | void __elv_add_request(request_queue_t *q, struct request *rq, int at_end, | |
20453 | int plug) | |
20454 | { | |
20455 | - struct list_head *insert = &q->queue_head; | |
20456 | + struct list_head *insert = NULL; | |
20457 | ||
20458 | - if (at_end) | |
20459 | - insert = insert->prev; | |
20460 | + if (!at_end) | |
20461 | + insert = &q->queue_head; | |
20462 | if (plug) | |
20463 | blk_plug_device(q); | |
20464 | ||
20465 | diff -Nru a/drivers/block/floppy.c b/drivers/block/floppy.c | |
20466 | --- a/drivers/block/floppy.c Fri Aug 15 10:27:03 2003 | |
20467 | +++ b/drivers/block/floppy.c Wed Sep 3 23:40:13 2003 | |
20468 | @@ -695,23 +695,9 @@ | |
20469 | spin_unlock_irqrestore(&floppy_lock, flags); | |
20470 | } | |
20471 | ||
20472 | -static int maximum(int a, int b) | |
20473 | -{ | |
20474 | - if (a > b) | |
20475 | - return a; | |
20476 | - else | |
20477 | - return b; | |
20478 | -} | |
20479 | -#define INFBOUND(a,b) (a)=maximum((a),(b)); | |
20480 | +#define INFBOUND(a,b) (a)=max_t(int, a, b) | |
20481 | ||
20482 | -static int minimum(int a, int b) | |
20483 | -{ | |
20484 | - if (a < b) | |
20485 | - return a; | |
20486 | - else | |
20487 | - return b; | |
20488 | -} | |
20489 | -#define SUPBOUND(a,b) (a)=minimum((a),(b)); | |
20490 | +#define SUPBOUND(a,b) (a)=min_t(int, a, b) | |
20491 | ||
20492 | ||
20493 | /* | |
20494 | @@ -1021,9 +1007,9 @@ | |
20495 | ||
20496 | static DECLARE_WORK(floppy_work, NULL, NULL); | |
20497 | ||
20498 | -static void schedule_bh( void (*handler)(void*) ) | |
20499 | +static void schedule_bh(void (*handler) (void)) | |
20500 | { | |
20501 | - PREPARE_WORK(&floppy_work, handler, NULL); | |
20502 | + PREPARE_WORK(&floppy_work, (void (*)(void *))handler, NULL); | |
20503 | schedule_work(&floppy_work); | |
20504 | } | |
20505 | ||
20506 | @@ -1035,7 +1021,7 @@ | |
20507 | ||
20508 | spin_lock_irqsave(&floppy_lock, flags); | |
20509 | do_floppy = NULL; | |
20510 | - PREPARE_WORK(&floppy_work, (void*)(void*)empty, NULL); | |
20511 | + PREPARE_WORK(&floppy_work, (void*)empty, NULL); | |
20512 | del_timer(&fd_timer); | |
20513 | spin_unlock_irqrestore(&floppy_lock, flags); | |
20514 | } | |
20515 | @@ -1813,9 +1799,9 @@ | |
20516 | max_sensei--; | |
20517 | } while ((ST0 & 0x83) != UNIT(current_drive) && inr == 2 && max_sensei); | |
20518 | } | |
20519 | - if (handler) { | |
20520 | - schedule_bh( (void *)(void *) handler); | |
20521 | - } else | |
20522 | + if (handler) | |
20523 | + schedule_bh(handler); | |
20524 | + else | |
20525 | FDCS->reset = 1; | |
20526 | is_alive("normal interrupt end"); | |
20527 | ||
20528 | @@ -2058,26 +2044,26 @@ | |
20529 | wake_up(&command_done); | |
20530 | } | |
20531 | ||
20532 | -static struct cont_t wakeup_cont={ | |
20533 | - empty, | |
20534 | - do_wakeup, | |
20535 | - empty, | |
20536 | - (done_f)empty | |
20537 | +static struct cont_t wakeup_cont = { | |
20538 | + .interrupt = empty, | |
20539 | + .redo = do_wakeup, | |
20540 | + .error = empty, | |
20541 | + .done = (done_f) empty | |
20542 | }; | |
20543 | ||
20544 | ||
20545 | -static struct cont_t intr_cont={ | |
20546 | - empty, | |
20547 | - process_fd_request, | |
20548 | - empty, | |
20549 | - (done_f) empty | |
20550 | +static struct cont_t intr_cont = { | |
20551 | + .interrupt = empty, | |
20552 | + .redo = process_fd_request, | |
20553 | + .error = empty, | |
20554 | + .done = (done_f) empty | |
20555 | }; | |
20556 | ||
20557 | static int wait_til_done(void (*handler)(void), int interruptible) | |
20558 | { | |
20559 | int ret; | |
20560 | ||
20561 | - schedule_bh((void *)(void *)handler); | |
20562 | + schedule_bh(handler); | |
20563 | ||
20564 | if (command_status < 2 && NO_SIGNAL) { | |
20565 | DECLARE_WAITQUEUE(wait, current); | |
20566 | @@ -2281,11 +2267,12 @@ | |
20567 | #endif | |
20568 | } | |
20569 | ||
20570 | -static struct cont_t format_cont={ | |
20571 | - format_interrupt, | |
20572 | - redo_format, | |
20573 | - bad_flp_intr, | |
20574 | - generic_done }; | |
20575 | +static struct cont_t format_cont = { | |
20576 | + .interrupt = format_interrupt, | |
20577 | + .redo = redo_format, | |
20578 | + .error = bad_flp_intr, | |
20579 | + .done = generic_done | |
20580 | +}; | |
20581 | ||
20582 | static int do_format(int drive, struct format_descr *tmp_format_req) | |
20583 | { | |
20584 | @@ -2523,12 +2510,12 @@ | |
20585 | int size, i; | |
20586 | ||
20587 | max_sector = transfer_size(ssize, | |
20588 | - minimum(max_sector, max_sector_2), | |
20589 | + min(max_sector, max_sector_2), | |
20590 | current_req->nr_sectors); | |
20591 | ||
20592 | if (current_count_sectors <= 0 && CT(COMMAND) == FD_WRITE && | |
20593 | buffer_max > fsector_t + current_req->nr_sectors) | |
20594 | - current_count_sectors = minimum(buffer_max - fsector_t, | |
20595 | + current_count_sectors = min_t(int, buffer_max - fsector_t, | |
20596 | current_req->nr_sectors); | |
20597 | ||
20598 | remaining = current_count_sectors << 9; | |
20599 | @@ -2546,7 +2533,7 @@ | |
20600 | } | |
20601 | #endif | |
20602 | ||
20603 | - buffer_max = maximum(max_sector, buffer_max); | |
20604 | + buffer_max = max(max_sector, buffer_max); | |
20605 | ||
20606 | dma_buffer = floppy_track_buffer + ((fsector_t - buffer_min) << 9); | |
20607 | ||
20608 | @@ -2697,7 +2684,7 @@ | |
20609 | if ((_floppy->rate & FD_2M) && (!TRACK) && (!HEAD)){ | |
20610 | max_sector = 2 * _floppy->sect / 3; | |
20611 | if (fsector_t >= max_sector){ | |
20612 | - current_count_sectors = minimum(_floppy->sect - fsector_t, | |
20613 | + current_count_sectors = min_t(int, _floppy->sect - fsector_t, | |
20614 | current_req->nr_sectors); | |
20615 | return 1; | |
20616 | } | |
20617 | @@ -2987,7 +2974,7 @@ | |
20618 | ||
20619 | if (TESTF(FD_NEED_TWADDLE)) | |
20620 | twaddle(); | |
20621 | - schedule_bh( (void *)(void *) floppy_start); | |
20622 | + schedule_bh(floppy_start); | |
20623 | #ifdef DEBUGT | |
20624 | debugt("queue fd request"); | |
20625 | #endif | |
20626 | @@ -2996,16 +2983,17 @@ | |
20627 | #undef REPEAT | |
20628 | } | |
20629 | ||
20630 | -static struct cont_t rw_cont={ | |
20631 | - rw_interrupt, | |
20632 | - redo_fd_request, | |
20633 | - bad_flp_intr, | |
20634 | - request_done }; | |
20635 | +static struct cont_t rw_cont = { | |
20636 | + .interrupt = rw_interrupt, | |
20637 | + .redo = redo_fd_request, | |
20638 | + .error = bad_flp_intr, | |
20639 | + .done = request_done | |
20640 | +}; | |
20641 | ||
20642 | static void process_fd_request(void) | |
20643 | { | |
20644 | cont = &rw_cont; | |
20645 | - schedule_bh( (void *)(void *) redo_fd_request); | |
20646 | + schedule_bh(redo_fd_request); | |
20647 | } | |
20648 | ||
20649 | static void do_fd_request(request_queue_t * q) | |
20650 | @@ -3031,11 +3019,12 @@ | |
20651 | is_alive("do fd request"); | |
20652 | } | |
20653 | ||
20654 | -static struct cont_t poll_cont={ | |
20655 | - success_and_wakeup, | |
20656 | - floppy_ready, | |
20657 | - generic_failure, | |
20658 | - generic_done }; | |
20659 | +static struct cont_t poll_cont = { | |
20660 | + .interrupt = success_and_wakeup, | |
20661 | + .redo = floppy_ready, | |
20662 | + .error = generic_failure, | |
20663 | + .done = generic_done | |
20664 | +}; | |
20665 | ||
20666 | static int poll_drive(int interruptible, int flag) | |
20667 | { | |
20668 | @@ -3066,11 +3055,12 @@ | |
20669 | printk("weird, reset interrupt called\n"); | |
20670 | } | |
20671 | ||
20672 | -static struct cont_t reset_cont={ | |
20673 | - reset_intr, | |
20674 | - success_and_wakeup, | |
20675 | - generic_failure, | |
20676 | - generic_done }; | |
20677 | +static struct cont_t reset_cont = { | |
20678 | + .interrupt = reset_intr, | |
20679 | + .redo = success_and_wakeup, | |
20680 | + .error = generic_failure, | |
20681 | + .done = generic_done | |
20682 | +}; | |
20683 | ||
20684 | static int user_reset_fdc(int drive, int arg, int interruptible) | |
20685 | { | |
20686 | @@ -3174,11 +3164,11 @@ | |
20687 | } | |
20688 | ||
20689 | ||
20690 | -static struct cont_t raw_cmd_cont={ | |
20691 | - success_and_wakeup, | |
20692 | - floppy_start, | |
20693 | - generic_failure, | |
20694 | - raw_cmd_done | |
20695 | +static struct cont_t raw_cmd_cont = { | |
20696 | + .interrupt = success_and_wakeup, | |
20697 | + .redo = floppy_start, | |
20698 | + .error = generic_failure, | |
20699 | + .done = raw_cmd_done | |
20700 | }; | |
20701 | ||
20702 | static inline int raw_cmd_copyout(int cmd, char *param, | |
20703 | @@ -3781,9 +3771,9 @@ | |
20704 | } | |
20705 | } | |
20706 | ||
20707 | - UDRS->fd_device = minor(inode->i_rdev); | |
20708 | - set_capacity(disks[drive], floppy_sizes[minor(inode->i_rdev)]); | |
20709 | - if (old_dev != -1 && old_dev != minor(inode->i_rdev)) { | |
20710 | + UDRS->fd_device = iminor(inode); | |
20711 | + set_capacity(disks[drive], floppy_sizes[iminor(inode)]); | |
20712 | + if (old_dev != -1 && old_dev != iminor(inode)) { | |
20713 | if (buffer_drive == drive) | |
20714 | buffer_track = -1; | |
20715 | } | |
20716 | @@ -3910,22 +3900,6 @@ | |
20717 | return 0; | |
20718 | } | |
20719 | ||
20720 | -static int floppy_read_block_0(struct gendisk *disk) | |
20721 | -{ | |
20722 | - struct block_device *bdev; | |
20723 | - int ret; | |
20724 | - | |
20725 | - bdev = bdget_disk(disk, 0); | |
20726 | - if (!bdev) { | |
20727 | - printk("No block device for %s\n", disk->disk_name); | |
20728 | - BUG(); | |
20729 | - } | |
20730 | - bdev->bd_disk = disk; /* ewww */ | |
20731 | - ret = __floppy_read_block_0(bdev); | |
20732 | - atomic_dec(&bdev->bd_count); | |
20733 | - return ret; | |
20734 | -} | |
20735 | - | |
20736 | /* revalidate the floppy disk, i.e. trigger format autodetection by reading | |
20737 | * the bootblock (block 0). "Autodetection" is also needed to check whether | |
20738 | * there is a disk in the drive at all... Thus we also do it for fixed | |
20739 | @@ -3961,7 +3935,7 @@ | |
20740 | UDRS->generation++; | |
20741 | if (NO_GEOM){ | |
20742 | /* auto-sensing */ | |
20743 | - res = floppy_read_block_0(disk); | |
20744 | + res = __floppy_read_block_0(opened_bdev[drive]); | |
20745 | } else { | |
20746 | if (cf) | |
20747 | poll_drive(0, FD_RAW_NEED_DISK); | |
20748 | @@ -4633,3 +4607,5 @@ | |
20749 | __setup ("floppy=", floppy_setup); | |
20750 | module_init(floppy_init) | |
20751 | #endif | |
20752 | + | |
20753 | +MODULE_ALIAS_BLOCKDEV_MAJOR(FLOPPY_MAJOR); | |
20754 | diff -Nru a/drivers/block/floppy98.c b/drivers/block/floppy98.c | |
20755 | --- a/drivers/block/floppy98.c Thu Aug 7 02:25:24 2003 | |
20756 | +++ b/drivers/block/floppy98.c Tue Aug 26 09:44:42 2003 | |
20757 | @@ -3844,9 +3844,9 @@ | |
20758 | } | |
20759 | } | |
20760 | ||
20761 | - UDRS->fd_device = minor(inode->i_rdev); | |
20762 | - set_capacity(disks[drive], floppy_sizes[minor(inode->i_rdev)]); | |
20763 | - if (old_dev != -1 && old_dev != minor(inode->i_rdev)) { | |
20764 | + UDRS->fd_device = iminor(inode); | |
20765 | + set_capacity(disks[drive], floppy_sizes[iminor(inode)]); | |
20766 | + if (old_dev != -1 && old_dev != iminor(inode)) { | |
20767 | if (buffer_drive == drive) | |
20768 | buffer_track = -1; | |
20769 | } | |
20770 | @@ -3989,22 +3989,6 @@ | |
20771 | return 0; | |
20772 | } | |
20773 | ||
20774 | -static int floppy_read_block_0(struct gendisk *disk) | |
20775 | -{ | |
20776 | - struct block_device *bdev; | |
20777 | - int ret; | |
20778 | - | |
20779 | - bdev = bdget_disk(disk, 0); | |
20780 | - if (!bdev) { | |
20781 | - printk("No block device for %s\n", disk->disk_name); | |
20782 | - BUG(); | |
20783 | - } | |
20784 | - bdev->bd_disk = disk; /* ewww */ | |
20785 | - ret = __floppy_read_block_0(bdev); | |
20786 | - atomic_dec(&bdev->bd_count); | |
20787 | - return ret; | |
20788 | -} | |
20789 | - | |
20790 | /* revalidate the floppy disk, i.e. trigger format autodetection by reading | |
20791 | * the bootblock (block 0). "Autodetection" is also needed to check whether | |
20792 | * there is a disk in the drive at all... Thus we also do it for fixed | |
20793 | @@ -4040,7 +4024,7 @@ | |
20794 | UDRS->generation++; | |
20795 | if (NO_GEOM){ | |
20796 | /* auto-sensing */ | |
20797 | - res = floppy_read_block_0(disk); | |
20798 | + res = __floppy_read_block_0(opened_bdev[drive]); | |
20799 | } else { | |
20800 | if (cf) | |
20801 | poll_drive(0, FD_RAW_NEED_DISK); | |
20802 | diff -Nru a/drivers/block/genhd.c b/drivers/block/genhd.c | |
20803 | --- a/drivers/block/genhd.c Fri Aug 1 02:22:20 2003 | |
20804 | +++ b/drivers/block/genhd.c Wed Sep 3 23:40:17 2003 | |
20805 | @@ -372,7 +372,7 @@ | |
20806 | disk_stat_read(disk, write_merges), | |
20807 | (unsigned long long)disk_stat_read(disk, write_sectors), | |
20808 | jiffies_to_msec(disk_stat_read(disk, write_ticks)), | |
20809 | - disk_stat_read(disk, in_flight), | |
20810 | + disk->in_flight, | |
20811 | jiffies_to_msec(disk_stat_read(disk, io_ticks)), | |
20812 | jiffies_to_msec(disk_stat_read(disk, time_in_queue))); | |
20813 | } | |
20814 | @@ -492,7 +492,7 @@ | |
20815 | disk_stat_read(gp, writes), disk_stat_read(gp, write_merges), | |
20816 | (unsigned long long)disk_stat_read(gp, write_sectors), | |
20817 | jiffies_to_msec(disk_stat_read(gp, write_ticks)), | |
20818 | - disk_stat_read(gp, in_flight), | |
20819 | + gp->in_flight, | |
20820 | jiffies_to_msec(disk_stat_read(gp, io_ticks)), | |
20821 | jiffies_to_msec(disk_stat_read(gp, time_in_queue))); | |
20822 | ||
20823 | @@ -576,13 +576,10 @@ | |
20824 | ||
20825 | void set_device_ro(struct block_device *bdev, int flag) | |
20826 | { | |
20827 | - struct gendisk *disk = bdev->bd_disk; | |
20828 | - if (bdev->bd_contains != bdev) { | |
20829 | - int part = bdev->bd_dev - MKDEV(disk->major, disk->first_minor); | |
20830 | - struct hd_struct *p = disk->part[part-1]; | |
20831 | - if (p) p->policy = flag; | |
20832 | - } else | |
20833 | - disk->policy = flag; | |
20834 | + if (bdev->bd_contains != bdev) | |
20835 | + bdev->bd_part->policy = flag; | |
20836 | + else | |
20837 | + bdev->bd_disk->policy = flag; | |
20838 | } | |
20839 | ||
20840 | void set_disk_ro(struct gendisk *disk, int flag) | |
20841 | @@ -595,17 +592,12 @@ | |
20842 | ||
20843 | int bdev_read_only(struct block_device *bdev) | |
20844 | { | |
20845 | - struct gendisk *disk; | |
20846 | if (!bdev) | |
20847 | return 0; | |
20848 | - disk = bdev->bd_disk; | |
20849 | - if (bdev->bd_contains != bdev) { | |
20850 | - int part = bdev->bd_dev - MKDEV(disk->major, disk->first_minor); | |
20851 | - struct hd_struct *p = disk->part[part-1]; | |
20852 | - if (p) return p->policy; | |
20853 | - return 0; | |
20854 | - } else | |
20855 | - return disk->policy; | |
20856 | + else if (bdev->bd_contains != bdev) | |
20857 | + return bdev->bd_part->policy; | |
20858 | + else | |
20859 | + return bdev->bd_disk->policy; | |
20860 | } | |
20861 | ||
20862 | int invalidate_partition(struct gendisk *disk, int index) | |
20863 | diff -Nru a/drivers/block/ioctl.c b/drivers/block/ioctl.c | |
20864 | --- a/drivers/block/ioctl.c Thu Jul 17 22:30:42 2003 | |
20865 | +++ b/drivers/block/ioctl.c Tue Aug 26 12:06:15 2003 | |
20866 | @@ -8,7 +8,6 @@ | |
20867 | static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg *arg) | |
20868 | { | |
20869 | struct block_device *bdevp; | |
20870 | - int holder; | |
20871 | struct gendisk *disk; | |
20872 | struct blkpg_ioctl_arg a; | |
20873 | struct blkpg_partition p; | |
20874 | @@ -41,8 +40,11 @@ | |
20875 | return -EINVAL; | |
20876 | } | |
20877 | /* partition number in use? */ | |
20878 | - if (disk->part[part - 1]) | |
20879 | + down(&bdev->bd_sem); | |
20880 | + if (disk->part[part - 1]) { | |
20881 | + up(&bdev->bd_sem); | |
20882 | return -EBUSY; | |
20883 | + } | |
20884 | /* overlap? */ | |
20885 | for (i = 0; i < disk->minors - 1; i++) { | |
20886 | struct hd_struct *s = disk->part[i]; | |
20887 | @@ -50,22 +52,26 @@ | |
20888 | if (!s) | |
20889 | continue; | |
20890 | if (!(start+length <= s->start_sect || | |
20891 | - start >= s->start_sect + s->nr_sects)) | |
20892 | + start >= s->start_sect + s->nr_sects)) { | |
20893 | + up(&bdev->bd_sem); | |
20894 | return -EBUSY; | |
20895 | + } | |
20896 | } | |
20897 | /* all seems OK */ | |
20898 | add_partition(disk, part, start, length); | |
20899 | + up(&bdev->bd_sem); | |
20900 | return 0; | |
20901 | case BLKPG_DEL_PARTITION: | |
20902 | if (!disk->part[part-1]) | |
20903 | return -ENXIO; | |
20904 | if (disk->part[part - 1]->nr_sects == 0) | |
20905 | return -ENXIO; | |
20906 | - /* partition in use? Incomplete check for now. */ | |
20907 | bdevp = bdget_disk(disk, part); | |
20908 | if (!bdevp) | |
20909 | return -ENOMEM; | |
20910 | - if (bd_claim(bdevp, &holder) < 0) { | |
20911 | + down(&bdevp->bd_sem); | |
20912 | + if (bdevp->bd_openers) { | |
20913 | + up(&bdevp->bd_sem); | |
20914 | bdput(bdevp); | |
20915 | return -EBUSY; | |
20916 | } | |
20917 | @@ -73,9 +79,12 @@ | |
20918 | fsync_bdev(bdevp); | |
20919 | invalidate_bdev(bdevp, 0); | |
20920 | ||
20921 | + down(&bdev->bd_sem); | |
20922 | delete_partition(disk, part); | |
20923 | - bd_release(bdevp); | |
20924 | + up(&bdev->bd_sem); | |
20925 | + up(&bdevp->bd_sem); | |
20926 | bdput(bdevp); | |
20927 | + | |
20928 | return 0; | |
20929 | default: | |
20930 | return -EINVAL; | |
20931 | diff -Nru a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c | |
20932 | --- a/drivers/block/ll_rw_blk.c Mon Aug 18 22:28:54 2003 | |
20933 | +++ b/drivers/block/ll_rw_blk.c Wed Sep 3 23:40:17 2003 | |
20934 | @@ -136,6 +136,12 @@ | |
20935 | return ret; | |
20936 | } | |
20937 | ||
20938 | +void blk_queue_activity_fn(request_queue_t *q, activity_fn *fn, void *data) | |
20939 | +{ | |
20940 | + q->activity_fn = fn; | |
20941 | + q->activity_data = data; | |
20942 | +} | |
20943 | + | |
20944 | /** | |
20945 | * blk_queue_prep_rq - set a prepare_request function for queue | |
20946 | * @q: queue | |
20947 | @@ -225,6 +231,8 @@ | |
20948 | blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH); | |
20949 | ||
20950 | INIT_LIST_HEAD(&q->plug_list); | |
20951 | + | |
20952 | + blk_queue_activity_fn(q, NULL, NULL); | |
20953 | } | |
20954 | ||
20955 | /** | |
20956 | @@ -1314,7 +1322,7 @@ | |
20957 | ||
20958 | if (!printed) { | |
20959 | printed = 1; | |
20960 | - printk("Using %s elevator\n", chosen_elevator->elevator_name); | |
20961 | + printk("Using %s io scheduler\n", chosen_elevator->elevator_name); | |
20962 | } | |
20963 | ||
20964 | if (elevator_init(q, chosen_elevator)) | |
20965 | @@ -1652,7 +1660,7 @@ | |
20966 | } | |
20967 | if (new_io) { | |
20968 | disk_round_stats(rq->rq_disk); | |
20969 | - disk_stat_inc(rq->rq_disk, in_flight); | |
20970 | + rq->rq_disk->in_flight++; | |
20971 | } | |
20972 | } | |
20973 | ||
20974 | @@ -1666,6 +1674,9 @@ | |
20975 | { | |
20976 | drive_stat_acct(req, req->nr_sectors, 1); | |
20977 | ||
20978 | + if (q->activity_fn) | |
20979 | + q->activity_fn(q->activity_data, rq_data_dir(req)); | |
20980 | + | |
20981 | /* | |
20982 | * elevator indicated where it wants this request to be | |
20983 | * inserted at elevator_merge time | |
20984 | @@ -1693,10 +1704,10 @@ | |
20985 | unsigned long now = jiffies; | |
20986 | ||
20987 | disk_stat_add(disk, time_in_queue, | |
20988 | - disk_stat_read(disk, in_flight) * (now - disk->stamp)); | |
20989 | + disk->in_flight * (now - disk->stamp)); | |
20990 | disk->stamp = now; | |
20991 | ||
20992 | - if (disk_stat_read(disk, in_flight)) | |
20993 | + if (disk->in_flight) | |
20994 | disk_stat_add(disk, io_ticks, (now - disk->stamp_idle)); | |
20995 | disk->stamp_idle = now; | |
20996 | } | |
20997 | @@ -1808,7 +1819,7 @@ | |
20998 | ||
20999 | if (req->rq_disk) { | |
21000 | disk_round_stats(req->rq_disk); | |
21001 | - disk_stat_dec(req->rq_disk, in_flight); | |
21002 | + req->rq_disk->in_flight--; | |
21003 | } | |
21004 | ||
21005 | __blk_put_request(q, next); | |
21006 | @@ -2043,24 +2054,23 @@ | |
21007 | static inline void blk_partition_remap(struct bio *bio) | |
21008 | { | |
21009 | struct block_device *bdev = bio->bi_bdev; | |
21010 | - struct gendisk *disk = bdev->bd_disk; | |
21011 | - struct hd_struct *p; | |
21012 | - if (bdev == bdev->bd_contains) | |
21013 | - return; | |
21014 | ||
21015 | - p = disk->part[bdev->bd_dev-MKDEV(disk->major,disk->first_minor)-1]; | |
21016 | - switch (bio->bi_rw) { | |
21017 | - case READ: | |
21018 | - p->read_sectors += bio_sectors(bio); | |
21019 | - p->reads++; | |
21020 | - break; | |
21021 | - case WRITE: | |
21022 | - p->write_sectors += bio_sectors(bio); | |
21023 | - p->writes++; | |
21024 | - break; | |
21025 | + if (bdev != bdev->bd_contains) { | |
21026 | + struct hd_struct *p = bdev->bd_part; | |
21027 | + | |
21028 | + switch (bio->bi_rw) { | |
21029 | + case READ: | |
21030 | + p->read_sectors += bio_sectors(bio); | |
21031 | + p->reads++; | |
21032 | + break; | |
21033 | + case WRITE: | |
21034 | + p->write_sectors += bio_sectors(bio); | |
21035 | + p->writes++; | |
21036 | + break; | |
21037 | + } | |
21038 | + bio->bi_sector += p->start_sect; | |
21039 | + bio->bi_bdev = bdev->bd_contains; | |
21040 | } | |
21041 | - bio->bi_sector += bdev->bd_offset; | |
21042 | - bio->bi_bdev = bdev->bd_contains; | |
21043 | } | |
21044 | ||
21045 | /** | |
21046 | @@ -2470,7 +2480,7 @@ | |
21047 | break; | |
21048 | } | |
21049 | disk_round_stats(disk); | |
21050 | - disk_stat_dec(disk, in_flight); | |
21051 | + disk->in_flight--; | |
21052 | } | |
21053 | __blk_put_request(req->q, req); | |
21054 | /* Do this LAST! The structure may be freed immediately afterwards */ | |
21055 | diff -Nru a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c | |
21056 | --- a/drivers/block/paride/pg.c Sun May 25 02:45:05 2003 | |
21057 | +++ b/drivers/block/paride/pg.c Tue Aug 26 09:25:41 2003 | |
21058 | @@ -527,11 +527,9 @@ | |
21059 | return -1; | |
21060 | } | |
21061 | ||
21062 | -#define DEVICE_NR(dev) (minor(dev) & 0x7F) | |
21063 | - | |
21064 | static int pg_open(struct inode *inode, struct file *file) | |
21065 | { | |
21066 | - int unit = DEVICE_NR(inode->i_rdev); | |
21067 | + int unit = iminor(inode) & 0x7f; | |
21068 | struct pg *dev = &devices[unit]; | |
21069 | ||
21070 | if ((unit >= PG_UNITS) || (!dev->present)) | |
21071 | diff -Nru a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c | |
21072 | --- a/drivers/block/paride/pt.c Sun May 25 02:45:06 2003 | |
21073 | +++ b/drivers/block/paride/pt.c Tue Aug 26 09:25:41 2003 | |
21074 | @@ -670,11 +670,11 @@ | |
21075 | return -1; | |
21076 | } | |
21077 | ||
21078 | -#define DEVICE_NR(dev) (minor(dev) & 0x7F) | |
21079 | +#define DEVICE_NR(inode) (iminor(inode) & 0x7F) | |
21080 | ||
21081 | static int pt_open(struct inode *inode, struct file *file) | |
21082 | { | |
21083 | - int unit = DEVICE_NR(inode->i_rdev); | |
21084 | + int unit = DEVICE_NR(inode); | |
21085 | ||
21086 | if ((unit >= PT_UNITS) || (!PT.present)) | |
21087 | return -ENODEV; | |
21088 | @@ -696,7 +696,7 @@ | |
21089 | return -EROFS; | |
21090 | } | |
21091 | ||
21092 | - if (!(minor(inode->i_rdev) & 128)) | |
21093 | + if (!(iminor(inode) & 128)) | |
21094 | PT.flags |= PT_REWIND; | |
21095 | ||
21096 | PT.bufptr = kmalloc(PT_BUFSIZE, GFP_KERNEL); | |
21097 | @@ -715,7 +715,7 @@ | |
21098 | int unit; | |
21099 | struct mtop mtop; | |
21100 | ||
21101 | - unit = DEVICE_NR(inode->i_rdev); | |
21102 | + unit = DEVICE_NR(inode); | |
21103 | if (unit >= PT_UNITS) | |
21104 | return -EINVAL; | |
21105 | if (!PT.present) | |
21106 | @@ -753,7 +753,7 @@ | |
21107 | static int | |
21108 | pt_release(struct inode *inode, struct file *file) | |
21109 | { | |
21110 | - int unit = DEVICE_NR(inode->i_rdev); | |
21111 | + int unit = DEVICE_NR(inode); | |
21112 | ||
21113 | if ((unit >= PT_UNITS) || (atomic_read(&PT.available) > 1)) | |
21114 | return -EINVAL; | |
21115 | @@ -776,7 +776,7 @@ | |
21116 | static ssize_t pt_read(struct file *filp, char *buf, size_t count, loff_t * ppos) | |
21117 | { | |
21118 | struct inode *ino = filp->f_dentry->d_inode; | |
21119 | - int unit = DEVICE_NR(ino->i_rdev); | |
21120 | + int unit = DEVICE_NR(ino); | |
21121 | char rd_cmd[12] = { ATAPI_READ_6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; | |
21122 | int k, n, r, p, s, t, b; | |
21123 | ||
21124 | @@ -873,7 +873,7 @@ | |
21125 | static ssize_t pt_write(struct file *filp, const char *buf, size_t count, loff_t * ppos) | |
21126 | { | |
21127 | struct inode *ino = filp->f_dentry->d_inode; | |
21128 | - int unit = DEVICE_NR(ino->i_rdev); | |
21129 | + int unit = DEVICE_NR(ino); | |
21130 | char wr_cmd[12] = { ATAPI_WRITE_6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; | |
21131 | int k, n, r, p, s, t, b; | |
21132 | ||
21133 | diff -Nru a/drivers/block/rd.c b/drivers/block/rd.c | |
21134 | --- a/drivers/block/rd.c Thu Aug 7 02:25:24 2003 | |
21135 | +++ b/drivers/block/rd.c Tue Aug 26 10:05:56 2003 | |
21136 | @@ -245,6 +245,7 @@ | |
21137 | static int rd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | |
21138 | { | |
21139 | int error; | |
21140 | + struct block_device *bdev = inode->i_bdev; | |
21141 | ||
21142 | if (cmd != BLKFLSBUF) | |
21143 | return -EINVAL; | |
21144 | @@ -253,12 +254,12 @@ | |
21145 | it's not like with the other blockdevices where | |
21146 | this ioctl only flushes away the buffer cache. */ | |
21147 | error = -EBUSY; | |
21148 | - down(&inode->i_bdev->bd_sem); | |
21149 | - if (inode->i_bdev->bd_openers <= 2) { | |
21150 | - truncate_inode_pages(inode->i_mapping, 0); | |
21151 | + down(&bdev->bd_sem); | |
21152 | + if (bdev->bd_openers <= 2) { | |
21153 | + truncate_inode_pages(bdev->bd_inode->i_mapping, 0); | |
21154 | error = 0; | |
21155 | } | |
21156 | - up(&inode->i_bdev->bd_sem); | |
21157 | + up(&bdev->bd_sem); | |
21158 | return error; | |
21159 | } | |
21160 | ||
21161 | @@ -269,18 +270,18 @@ | |
21162 | ||
21163 | static int rd_open(struct inode * inode, struct file * filp) | |
21164 | { | |
21165 | - unsigned unit = minor(inode->i_rdev); | |
21166 | + unsigned unit = iminor(inode); | |
21167 | ||
21168 | /* | |
21169 | * Immunize device against invalidate_buffers() and prune_icache(). | |
21170 | */ | |
21171 | if (rd_bdev[unit] == NULL) { | |
21172 | struct block_device *bdev = inode->i_bdev; | |
21173 | - atomic_inc(&bdev->bd_count); | |
21174 | + inode = igrab(bdev->bd_inode); | |
21175 | rd_bdev[unit] = bdev; | |
21176 | bdev->bd_openers++; | |
21177 | bdev->bd_block_size = rd_blocksize; | |
21178 | - bdev->bd_inode->i_size = get_capacity(rd_disks[unit])<<9; | |
21179 | + inode->i_size = get_capacity(rd_disks[unit])<<9; | |
21180 | inode->i_mapping->a_ops = &ramdisk_aops; | |
21181 | inode->i_mapping->backing_dev_info = &rd_backing_dev_info; | |
21182 | } | |
21183 | diff -Nru a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c | |
21184 | --- a/drivers/block/scsi_ioctl.c Thu Aug 7 11:22:15 2003 | |
21185 | +++ b/drivers/block/scsi_ioctl.c Mon Sep 1 12:24:06 2003 | |
21186 | @@ -438,11 +438,7 @@ | |
21187 | err = sg_emulated_host(q, (int *) arg); | |
21188 | break; | |
21189 | case SG_IO: | |
21190 | - err = bd_claim(bdev, current); | |
21191 | - if (err) | |
21192 | - break; | |
21193 | err = sg_io(q, bdev, (struct sg_io_hdr *) arg); | |
21194 | - bd_release(bdev); | |
21195 | break; | |
21196 | /* | |
21197 | * old junk scsi send command ioctl | |
21198 | @@ -452,11 +448,7 @@ | |
21199 | if (!arg) | |
21200 | break; | |
21201 | ||
21202 | - err = bd_claim(bdev, current); | |
21203 | - if (err) | |
21204 | - break; | |
21205 | err = sg_scsi_ioctl(q, bdev, (Scsi_Ioctl_Command *)arg); | |
21206 | - bd_release(bdev); | |
21207 | break; | |
21208 | case CDROMCLOSETRAY: | |
21209 | close = 1; | |
21210 | diff -Nru a/drivers/block/xd.c b/drivers/block/xd.c | |
21211 | --- a/drivers/block/xd.c Thu Aug 7 02:25:24 2003 | |
21212 | +++ b/drivers/block/xd.c Wed Sep 3 23:40:13 2003 | |
21213 | @@ -1103,5 +1103,5 @@ | |
21214 | ||
21215 | #endif /* MODULE */ | |
21216 | ||
21217 | -module_init(xd_init) | |
21218 | - | |
21219 | +module_init(xd_init); | |
21220 | +MODULE_ALIAS_BLOCKDEV_MAJOR(XT_DISK_MAJOR); | |
21221 | diff -Nru a/drivers/block/z2ram.c b/drivers/block/z2ram.c | |
21222 | --- a/drivers/block/z2ram.c Thu Aug 7 02:25:24 2003 | |
21223 | +++ b/drivers/block/z2ram.c Wed Jul 30 15:20:18 2003 | |
21224 | @@ -28,10 +28,10 @@ | |
21225 | #define DEVICE_NAME "Z2RAM" | |
21226 | ||
21227 | #include <linux/major.h> | |
21228 | -#include <linux/slab.h> | |
21229 | #include <linux/vmalloc.h> | |
21230 | #include <linux/init.h> | |
21231 | #include <linux/module.h> | |
21232 | +#include <linux/blkdev.h> | |
21233 | ||
21234 | #include <asm/setup.h> | |
21235 | #include <asm/bitops.h> | |
21236 | @@ -150,7 +150,7 @@ | |
21237 | sizeof( z2ram_map[0] ); | |
21238 | int rc = -ENOMEM; | |
21239 | ||
21240 | - device = minor( inode->i_rdev ); | |
21241 | + device = iminor(inode); | |
21242 | ||
21243 | if ( current_device != -1 && current_device != device ) | |
21244 | { | |
21245 | diff -Nru a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c | |
21246 | --- a/drivers/bluetooth/hci_ldisc.c Thu May 8 16:38:32 2003 | |
21247 | +++ b/drivers/bluetooth/hci_ldisc.c Wed Sep 3 23:40:16 2003 | |
21248 | @@ -574,3 +574,4 @@ | |
21249 | MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>"); | |
21250 | MODULE_DESCRIPTION("Bluetooth HCI UART driver ver " VERSION); | |
21251 | MODULE_LICENSE("GPL"); | |
21252 | +MODULE_ALIAS_LDISC(N_HCI); | |
21253 | diff -Nru a/drivers/cdrom/Kconfig b/drivers/cdrom/Kconfig | |
21254 | --- a/drivers/cdrom/Kconfig Thu Jun 26 23:05:31 2003 | |
21255 | +++ b/drivers/cdrom/Kconfig Mon Aug 25 06:13:29 2003 | |
21256 | @@ -74,7 +74,7 @@ | |
21257 | ||
21258 | config SBPCD | |
21259 | tristate "Matsushita/Panasonic/Creative, Longshine, TEAC CDROM support" | |
21260 | - depends on CD_NO_IDESCSI | |
21261 | + depends on CD_NO_IDESCSI && BROKEN_ON_SMP | |
21262 | ---help--- | |
21263 | This driver supports most of the drives which use the Panasonic or | |
21264 | Sound Blaster interface. Please read the file | |
21265 | @@ -199,7 +199,7 @@ | |
21266 | ||
21267 | config CM206 | |
21268 | tristate "Philips/LMS CM206 CDROM support" | |
21269 | - depends on CD_NO_IDESCSI | |
21270 | + depends on CD_NO_IDESCSI && BROKEN_ON_SMP | |
21271 | ---help--- | |
21272 | If you have a Philips/LMS CD-ROM drive cm206 in combination with a | |
21273 | cm260 host adapter card, say Y here. Please also read the file | |
21274 | @@ -245,7 +245,7 @@ | |
21275 | ||
21276 | config CDU31A | |
21277 | tristate "Sony CDU31A/CDU33A CDROM support" | |
21278 | - depends on CD_NO_IDESCSI | |
21279 | + depends on CD_NO_IDESCSI && BROKEN_ON_SMP | |
21280 | ---help--- | |
21281 | These CD-ROM drives have a spring-pop-out caddyless drawer, and a | |
21282 | rectangular green LED centered beneath it. NOTE: these CD-ROM | |
21283 | @@ -267,7 +267,7 @@ | |
21284 | ||
21285 | config CDU535 | |
21286 | tristate "Sony CDU535 CDROM support" | |
21287 | - depends on CD_NO_IDESCSI | |
21288 | + depends on CD_NO_IDESCSI && BROKEN_ON_SMP | |
21289 | ---help--- | |
21290 | This is the driver for the older Sony CDU-535 and CDU-531 CD-ROM | |
21291 | drives. Please read the file <file:Documentation/cdrom/sonycd535>. | |
21292 | diff -Nru a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c | |
21293 | --- a/drivers/cdrom/aztcd.c Thu Aug 7 02:25:24 2003 | |
21294 | +++ b/drivers/cdrom/aztcd.c Wed Sep 3 23:40:13 2003 | |
21295 | @@ -2499,3 +2499,4 @@ | |
21296 | } | |
21297 | ||
21298 | MODULE_LICENSE("GPL"); | |
21299 | +MODULE_ALIAS_BLOCKDEV_MAJOR(AZTECH_CDROM_MAJOR); | |
21300 | diff -Nru a/drivers/cdrom/cdu31a.c b/drivers/cdrom/cdu31a.c | |
21301 | --- a/drivers/cdrom/cdu31a.c Thu Aug 7 02:25:24 2003 | |
21302 | +++ b/drivers/cdrom/cdu31a.c Wed Sep 3 23:40:13 2003 | |
21303 | @@ -3500,3 +3500,4 @@ | |
21304 | module_exit(cdu31a_exit); | |
21305 | ||
21306 | MODULE_LICENSE("GPL"); | |
21307 | +MODULE_ALIAS_BLOCKDEV_MAJOR(CDU31A_CDROM_MAJOR); | |
21308 | diff -Nru a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c | |
21309 | --- a/drivers/cdrom/cm206.c Thu Aug 7 02:25:24 2003 | |
21310 | +++ b/drivers/cdrom/cm206.c Wed Sep 3 23:40:13 2003 | |
21311 | @@ -1616,7 +1616,7 @@ | |
21312 | __setup("cm206=", cm206_setup); | |
21313 | ||
21314 | #endif /* !MODULE */ | |
21315 | - | |
21316 | +MODULE_ALIAS_BLOCKDEV_MAJOR(CM206_CDROM_MAJOR); | |
21317 | ||
21318 | /* | |
21319 | * Local variables: | |
21320 | diff -Nru a/drivers/cdrom/gscd.c b/drivers/cdrom/gscd.c | |
21321 | --- a/drivers/cdrom/gscd.c Thu Aug 7 02:25:24 2003 | |
21322 | +++ b/drivers/cdrom/gscd.c Wed Sep 3 23:40:13 2003 | |
21323 | @@ -1029,3 +1029,4 @@ | |
21324 | MODULE_LICENSE("GPL"); | |
21325 | module_init(gscd_init); | |
21326 | module_exit(gscd_exit); | |
21327 | +MODULE_ALIAS_BLOCKDEV_MAJOR(GOLDSTAR_CDROM_MAJOR); | |
21328 | diff -Nru a/drivers/cdrom/mcd.c b/drivers/cdrom/mcd.c | |
21329 | --- a/drivers/cdrom/mcd.c Thu Aug 7 02:25:24 2003 | |
21330 | +++ b/drivers/cdrom/mcd.c Wed Sep 3 23:40:13 2003 | |
21331 | @@ -1559,3 +1559,4 @@ | |
21332 | ||
21333 | MODULE_AUTHOR("Martin Harriss"); | |
21334 | MODULE_LICENSE("GPL"); | |
21335 | +MODULE_ALIAS_BLOCKDEV_MAJOR(MITSUMI_CDROM_MAJOR); | |
21336 | diff -Nru a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c | |
21337 | --- a/drivers/cdrom/mcdx.c Thu Aug 7 02:25:24 2003 | |
21338 | +++ b/drivers/cdrom/mcdx.c Wed Sep 3 23:40:13 2003 | |
21339 | @@ -1970,3 +1970,4 @@ | |
21340 | } | |
21341 | ||
21342 | MODULE_LICENSE("GPL"); | |
21343 | +MODULE_ALIAS_BLOCKDEV_MAJOR(MITSUMI_X_CDROM_MAJOR); | |
21344 | diff -Nru a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c | |
21345 | --- a/drivers/cdrom/optcd.c Thu Aug 7 02:25:24 2003 | |
21346 | +++ b/drivers/cdrom/optcd.c Wed Sep 3 23:40:13 2003 | |
21347 | @@ -2102,3 +2102,4 @@ | |
21348 | module_exit(optcd_exit); | |
21349 | ||
21350 | MODULE_LICENSE("GPL"); | |
21351 | +MODULE_ALIAS_BLOCKDEV_MAJOR(OPTICS_CDROM_MAJOR); | |
21352 | diff -Nru a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c | |
21353 | --- a/drivers/cdrom/sbpcd.c Thu Aug 7 02:25:24 2003 | |
21354 | +++ b/drivers/cdrom/sbpcd.c Wed Sep 3 23:40:13 2003 | |
21355 | @@ -5954,6 +5954,9 @@ | |
21356 | } | |
21357 | ||
21358 | MODULE_LICENSE("GPL"); | |
21359 | +/* FIXME: Old modules.conf claims MATSUSHITA_CDROM2_MAJOR and CDROM3, but | |
21360 | + AFAICT this doesn't support those majors, so why? --RR 30 Jul 2003 */ | |
21361 | +MODULE_ALIAS_BLOCKDEV_MAJOR(MATSUSHITA_CDROM_MAJOR); | |
21362 | ||
21363 | /*==========================================================================*/ | |
21364 | /* | |
21365 | diff -Nru a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c | |
21366 | --- a/drivers/cdrom/sjcd.c Thu Aug 7 02:25:24 2003 | |
21367 | +++ b/drivers/cdrom/sjcd.c Wed Sep 3 23:40:13 2003 | |
21368 | @@ -1813,3 +1813,4 @@ | |
21369 | module_exit(sjcd_exit); | |
21370 | ||
21371 | MODULE_LICENSE("GPL"); | |
21372 | +MODULE_ALIAS_BLOCKDEV_MAJOR(SANYO_CDROM_MAJOR); | |
21373 | diff -Nru a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c | |
21374 | --- a/drivers/cdrom/sonycd535.c Thu Aug 7 02:25:24 2003 | |
21375 | +++ b/drivers/cdrom/sonycd535.c Wed Sep 3 23:40:13 2003 | |
21376 | @@ -1684,3 +1684,4 @@ | |
21377 | ||
21378 | ||
21379 | MODULE_LICENSE("GPL"); | |
21380 | +MODULE_ALIAS_BLOCKDEV_MAJOR(CDU535_CDROM_MAJOR); | |
21381 | diff -Nru a/drivers/char/Kconfig b/drivers/char/Kconfig | |
21382 | --- a/drivers/char/Kconfig Fri Aug 22 09:52:20 2003 | |
21383 | +++ b/drivers/char/Kconfig Tue Sep 2 11:28:13 2003 | |
21384 | @@ -80,7 +80,7 @@ | |
21385 | ||
21386 | config COMPUTONE | |
21387 | tristate "Computone IntelliPort Plus serial support" | |
21388 | - depends on SERIAL_NONSTANDARD | |
21389 | + depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP | |
21390 | ---help--- | |
21391 | This driver supports the entire family of Intelliport II/Plus | |
21392 | controllers with the exception of the MicroChannel controllers and | |
21393 | @@ -113,7 +113,7 @@ | |
21394 | ||
21395 | config CYCLADES | |
21396 | tristate "Cyclades async mux support" | |
21397 | - depends on SERIAL_NONSTANDARD | |
21398 | + depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP | |
21399 | ---help--- | |
21400 | This is a driver for a card that gives you many serial ports. You | |
21401 | would need something like this to connect more than two modems to | |
21402 | @@ -145,7 +145,7 @@ | |
21403 | ||
21404 | config DIGIEPCA | |
21405 | tristate "Digiboard Intelligent Async Support" | |
21406 | - depends on SERIAL_NONSTANDARD | |
21407 | + depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP | |
21408 | ---help--- | |
21409 | This is a driver for Digi International's Xx, Xeve, and Xem series | |
21410 | of cards which provide multiple serial ports. You would need | |
21411 | @@ -164,7 +164,7 @@ | |
21412 | ||
21413 | config DIGI | |
21414 | tristate "Digiboard PC/Xx Support" | |
21415 | - depends on SERIAL_NONSTANDARD && DIGIEPCA=n | |
21416 | + depends on SERIAL_NONSTANDARD && DIGIEPCA=n && BROKEN_ON_SMP | |
21417 | help | |
21418 | This is a driver for the Digiboard PC/Xe, PC/Xi, and PC/Xeve cards | |
21419 | that give you many serial ports. You would need something like this | |
21420 | @@ -177,7 +177,7 @@ | |
21421 | ||
21422 | config ESPSERIAL | |
21423 | tristate "Hayes ESP serial port support" | |
21424 | - depends on SERIAL_NONSTANDARD && ISA | |
21425 | + depends on SERIAL_NONSTANDARD && ISA && BROKEN_ON_SMP | |
21426 | help | |
21427 | This is a driver which supports Hayes ESP serial ports. Both single | |
21428 | port cards and multiport cards are supported. Make sure to read | |
21429 | @@ -190,7 +190,7 @@ | |
21430 | ||
21431 | config MOXA_INTELLIO | |
21432 | tristate "Moxa Intellio support" | |
21433 | - depends on SERIAL_NONSTANDARD | |
21434 | + depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP | |
21435 | help | |
21436 | Say Y here if you have a Moxa Intellio multiport serial card. | |
21437 | ||
21438 | @@ -201,7 +201,7 @@ | |
21439 | ||
21440 | config MOXA_SMARTIO | |
21441 | tristate "Moxa SmartIO support" | |
21442 | - depends on SERIAL_NONSTANDARD | |
21443 | + depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP | |
21444 | help | |
21445 | Say Y here if you have a Moxa SmartIO multiport serial card. | |
21446 | ||
21447 | @@ -212,7 +212,7 @@ | |
21448 | ||
21449 | config ISI | |
21450 | tristate "Multi-Tech multiport card support (EXPERIMENTAL)" | |
21451 | - depends on SERIAL_NONSTANDARD && EXPERIMENTAL && m | |
21452 | + depends on SERIAL_NONSTANDARD && EXPERIMENTAL && BROKEN_ON_SMP && m | |
21453 | help | |
21454 | This is a driver for the Multi-Tech cards which provide several | |
21455 | serial ports. The driver is experimental and can currently only be | |
21456 | @@ -262,7 +262,7 @@ | |
21457 | ||
21458 | config RISCOM8 | |
21459 | tristate "SDL RISCom/8 card support" | |
21460 | - depends on SERIAL_NONSTANDARD | |
21461 | + depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP | |
21462 | help | |
21463 | This is a driver for the SDL Communications RISCom/8 multiport card, | |
21464 | which gives you many serial ports. You would need something like | |
21465 | @@ -275,7 +275,7 @@ | |
21466 | ||
21467 | config SPECIALIX | |
21468 | tristate "Specialix IO8+ card support" | |
21469 | - depends on SERIAL_NONSTANDARD | |
21470 | + depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP | |
21471 | help | |
21472 | This is a driver for the Specialix IO8+ multiport card (both the | |
21473 | ISA and the PCI version) which gives you many serial ports. You | |
21474 | @@ -299,7 +299,7 @@ | |
21475 | ||
21476 | config SX | |
21477 | tristate "Specialix SX (and SI) card support" | |
21478 | - depends on SERIAL_NONSTANDARD | |
21479 | + depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP | |
21480 | help | |
21481 | This is a driver for the SX and SI multiport serial cards. | |
21482 | Please read the file <file:Documentation/sx.txt> for details. | |
21483 | @@ -310,7 +310,7 @@ | |
21484 | ||
21485 | config RIO | |
21486 | tristate "Specialix RIO system support" | |
21487 | - depends on SERIAL_NONSTANDARD | |
21488 | + depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP | |
21489 | help | |
21490 | This is a driver for the Specialix RIO, a smart serial card which | |
21491 | drives an outboard box that can support up to 128 ports. Product | |
21492 | @@ -339,7 +339,7 @@ | |
21493 | ||
21494 | config STALLION | |
21495 | tristate "Stallion EasyIO or EC8/32 support" | |
21496 | - depends on STALDRV | |
21497 | + depends on STALDRV && BROKEN_ON_SMP | |
21498 | help | |
21499 | If you have an EasyIO or EasyConnection 8/32 multiport Stallion | |
21500 | card, then this is for you; say Y. Make sure to read | |
21501 | @@ -352,7 +352,7 @@ | |
21502 | ||
21503 | config ISTALLION | |
21504 | tristate "Stallion EC8/64, ONboard, Brumby support" | |
21505 | - depends on STALDRV | |
21506 | + depends on STALDRV && BROKEN | |
21507 | help | |
21508 | If you have an EasyConnection 8/64, ONboard, Brumby or Stallion | |
21509 | serial multiport card, say Y here. Make sure to read | |
21510 | @@ -365,7 +365,7 @@ | |
21511 | ||
21512 | config SERIAL_TX3912 | |
21513 | bool "TMPTX3912/PR31700 serial port support" | |
21514 | - depends on SERIAL_NONSTANDARD && MIPS | |
21515 | + depends on SERIAL_NONSTANDARD && MIPS && BROKEN_ON_SMP | |
21516 | help | |
21517 | The TX3912 is a Toshiba RISC processor based o the MIPS 3900 core; | |
21518 | see <http://www.toshiba.com/taec/components/Generic/risc/tx3912.htm>. | |
21519 | @@ -425,7 +425,7 @@ | |
21520 | ||
21521 | config A2232 | |
21522 | tristate "Commodore A2232 serial support (EXPERIMENTAL)" | |
21523 | - depends on EXPERIMENTAL && ZORRO | |
21524 | + depends on EXPERIMENTAL && ZORRO && BROKEN_ON_SMP | |
21525 | ---help--- | |
21526 | This option supports the 2232 7-port serial card shipped with the | |
21527 | Amiga 2000 and other Zorro-bus machines, dating from 1989. At | |
21528 | @@ -909,6 +909,7 @@ | |
21529 | ||
21530 | config FTAPE | |
21531 | tristate "Ftape (QIC-80/Travan) support" | |
21532 | + depends on BROKEN_ON_SMP | |
21533 | ---help--- | |
21534 | If you have a tape drive that is connected to your floppy | |
21535 | controller, say Y here. | |
21536 | diff -Nru a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig | |
21537 | --- a/drivers/char/agp/Kconfig Fri Aug 15 07:33:19 2003 | |
21538 | +++ b/drivers/char/agp/Kconfig Thu Aug 28 16:22:00 2003 | |
21539 | @@ -63,15 +63,19 @@ | |
21540 | You should say Y here if you use XFree86 3.3.6 or 4.x and want to | |
21541 | use GLX or DRI. If unsure, say N. | |
21542 | ||
21543 | +# RED-PEN this option is misnamed, it's not 8151 specific | |
21544 | config AGP_AMD_8151 | |
21545 | - tristate "AMD Opteron/Athlon64 on-CPU GART support" | |
21546 | + tristate "AMD Opteron/Athlon64 on-CPU GART support" if !GART_IOMMU | |
21547 | depends on AGP && X86 | |
21548 | - default GART_IOMMU | |
21549 | + default y if GART_IOMMU | |
21550 | help | |
21551 | This option gives you AGP support for the GLX component of | |
21552 | - XFree86 4.x using the on-CPU AGP bridge of the AMD Athlon64/Opteron CPUs. | |
21553 | + XFree86 4.x using the on-CPU northbridge of the AMD Athlon64/Opteron CPUs. | |
21554 | + You still need an external AGP bridge like the AMD 8151, VIA | |
21555 | + K8T400M, SiS755. It may also support other AGP bridges when loaded | |
21556 | + with agp_try_unsupported=1. | |
21557 | You should say Y here if you use XFree86 3.3.6 or 4.x and want to | |
21558 | - use GLX or DRI. If unsure, say N | |
21559 | + use GLX or DRI. If unsure, say Y | |
21560 | ||
21561 | config AGP_INTEL | |
21562 | tristate "Intel 440LX/BX/GX, I8xx and E7x05 chipset support" | |
21563 | diff -Nru a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h | |
21564 | --- a/drivers/char/agp/agp.h Fri Aug 15 06:28:58 2003 | |
21565 | +++ b/drivers/char/agp/agp.h Thu Aug 28 18:04:31 2003 | |
21566 | @@ -167,8 +167,10 @@ | |
21567 | ||
21568 | #define PGE_EMPTY(b, p) (!(p) || (p) == (unsigned long) (b)->scratch_page) | |
21569 | ||
21570 | -/* intel register */ | |
21571 | -#define INTEL_APBASE 0x10 | |
21572 | +/* Chipset independant registers (from AGP Spec) */ | |
21573 | +#define AGP_APBASE 0x10 | |
21574 | + | |
21575 | +/* Intel registers */ | |
21576 | #define INTEL_APSIZE 0xb4 | |
21577 | #define INTEL_ATTBASE 0xb8 | |
21578 | #define INTEL_AGPCTRL 0xb0 | |
21579 | @@ -176,7 +178,6 @@ | |
21580 | #define INTEL_ERRSTS 0x91 | |
21581 | ||
21582 | /* Intel 460GX Registers */ | |
21583 | -#define INTEL_I460_APBASE 0x10 | |
21584 | #define INTEL_I460_BAPBASE 0x98 | |
21585 | #define INTEL_I460_GXBCTL 0xa0 | |
21586 | #define INTEL_I460_AGPSIZ 0xa2 | |
21587 | @@ -184,7 +185,7 @@ | |
21588 | #define INTEL_I460_GATT_VALID (1UL << 24) | |
21589 | #define INTEL_I460_GATT_COHERENT (1UL << 25) | |
21590 | ||
21591 | -/* intel i830 registers */ | |
21592 | +/* Intel i830 registers */ | |
21593 | #define I830_GMCH_CTRL 0x52 | |
21594 | #define I830_GMCH_ENABLED 0x4 | |
21595 | #define I830_GMCH_MEM_MASK 0x1 | |
21596 | @@ -218,31 +219,31 @@ | |
21597 | #define I852_GME 0x2 | |
21598 | #define I852_GM 0x5 | |
21599 | ||
21600 | -/* intel 815 register */ | |
21601 | +/* Intel 815 register */ | |
21602 | #define INTEL_815_APCONT 0x51 | |
21603 | #define INTEL_815_ATTBASE_MASK ~0x1FFFFFFF | |
21604 | ||
21605 | -/* intel i820 registers */ | |
21606 | +/* Intel i820 registers */ | |
21607 | #define INTEL_I820_RDCR 0x51 | |
21608 | #define INTEL_I820_ERRSTS 0xc8 | |
21609 | ||
21610 | -/* intel i840 registers */ | |
21611 | +/* Intel i840 registers */ | |
21612 | #define INTEL_I840_MCHCFG 0x50 | |
21613 | #define INTEL_I840_ERRSTS 0xc8 | |
21614 | ||
21615 | -/* intel i845 registers */ | |
21616 | +/* Intel i845 registers */ | |
21617 | #define INTEL_I845_AGPM 0x51 | |
21618 | #define INTEL_I845_ERRSTS 0xc8 | |
21619 | ||
21620 | -/* intel i850 registers */ | |
21621 | +/* Intel i850 registers */ | |
21622 | #define INTEL_I850_MCHCFG 0x50 | |
21623 | #define INTEL_I850_ERRSTS 0xc8 | |
21624 | ||
21625 | -/* intel i860 registers */ | |
21626 | +/* Intel i860 registers */ | |
21627 | #define INTEL_I860_MCHCFG 0x50 | |
21628 | #define INTEL_I860_ERRSTS 0xc8 | |
21629 | ||
21630 | -/* intel i810 registers */ | |
21631 | +/* Intel i810 registers */ | |
21632 | #define I810_GMADDR 0x10 | |
21633 | #define I810_MMADDR 0x14 | |
21634 | #define I810_PTE_BASE 0x10000 | |
21635 | @@ -261,7 +262,6 @@ | |
21636 | #define I810_DRAM_ROW_0_SDRAM 0x00000001 | |
21637 | ||
21638 | /* Intel 7505 registers */ | |
21639 | -#define INTEL_I7505_NAPBASELO 0x10 | |
21640 | #define INTEL_I7505_APSIZE 0x74 | |
21641 | #define INTEL_I7505_NCAPID 0x60 | |
21642 | #define INTEL_I7505_NISTAT 0x6c | |
21643 | @@ -271,26 +271,23 @@ | |
21644 | #define INTEL_I7505_MCHCFG 0x50 | |
21645 | ||
21646 | /* VIA register */ | |
21647 | -#define VIA_APBASE 0x10 | |
21648 | #define VIA_GARTCTRL 0x80 | |
21649 | #define VIA_APSIZE 0x84 | |
21650 | #define VIA_ATTBASE 0x88 | |
21651 | ||
21652 | /* VIA KT400 */ | |
21653 | #define VIA_AGP3_GARTCTRL 0x90 | |
21654 | -#define VIA_AGP3_APSIZE 0x94 | |
21655 | +#define VIA_AGP3_APSIZE 0x94 | |
21656 | #define VIA_AGP3_ATTBASE 0x98 | |
21657 | -#define VIA_AGPSEL 0xfd | |
21658 | +#define VIA_AGPSEL 0xfd | |
21659 | ||
21660 | /* SiS registers */ | |
21661 | -#define SIS_APBASE 0x10 | |
21662 | #define SIS_ATTBASE 0x90 | |
21663 | #define SIS_APSIZE 0x94 | |
21664 | #define SIS_TLBCNTRL 0x97 | |
21665 | #define SIS_TLBFLUSH 0x98 | |
21666 | ||
21667 | /* AMD registers */ | |
21668 | -#define AMD_APBASE 0x10 | |
21669 | #define AMD_MMBASE 0x14 | |
21670 | #define AMD_APSIZE 0xac | |
21671 | #define AMD_MODECNTL 0xb0 | |
21672 | @@ -300,24 +297,14 @@ | |
21673 | #define AMD_TLBFLUSH 0x0c /* In mmio region (32-bit register) */ | |
21674 | #define AMD_CACHEENTRY 0x10 /* In mmio region (32-bit register) */ | |
21675 | ||
21676 | -#define AMD_8151_APSIZE 0xb4 | |
21677 | -#define AMD_8151_GARTBLOCK 0xb8 | |
21678 | - | |
21679 | -#define AMD_X86_64_GARTAPERTURECTL 0x90 | |
21680 | -#define AMD_X86_64_GARTAPERTUREBASE 0x94 | |
21681 | -#define AMD_X86_64_GARTTABLEBASE 0x98 | |
21682 | -#define AMD_X86_64_GARTCACHECTL 0x9c | |
21683 | -#define AMD_X86_64_GARTEN 1<<0 | |
21684 | - | |
21685 | -#define AMD_8151_VMAPERTURE 0x10 | |
21686 | -#define AMD_8151_AGP_CTL 0xb0 | |
21687 | -#define AMD_8151_APERTURESIZE 0xb4 | |
21688 | -#define AMD_8151_GARTPTR 0xb8 | |
21689 | -#define AMD_8151_GTLBEN 1<<7 | |
21690 | -#define AMD_8151_APEREN 1<<8 | |
21691 | +/* AMD64 registers */ | |
21692 | +#define AMD64_GARTAPERTURECTL 0x90 | |
21693 | +#define AMD64_GARTAPERTUREBASE 0x94 | |
21694 | +#define AMD64_GARTTABLEBASE 0x98 | |
21695 | +#define AMD64_GARTCACHECTL 0x9c | |
21696 | +#define AMD64_GARTEN 1<<0 | |
21697 | ||
21698 | /* ALi registers */ | |
21699 | -#define ALI_APBASE 0x10 | |
21700 | #define ALI_AGPCTRL 0xb8 | |
21701 | #define ALI_ATTBASE 0xbc | |
21702 | #define ALI_TLBCTRL 0xc0 | |
21703 | @@ -327,19 +314,17 @@ | |
21704 | #define ALI_CACHE_FLUSH_EN 0x100 | |
21705 | ||
21706 | /* ATI register */ | |
21707 | -#define ATI_APBASE 0x10 | |
21708 | -#define ATI_GART_MMBASE_ADDR 0x14 | |
21709 | -#define ATI_RS100_APSIZE 0xac | |
21710 | -#define ATI_RS300_APSIZE 0xf8 | |
21711 | -#define ATI_RS100_IG_AGPMODE 0xb0 | |
21712 | -#define ATI_RS300_IG_AGPMODE 0xfc | |
21713 | - | |
21714 | -#define ATI_GART_FEATURE_ID 0x00 | |
21715 | -#define ATI_GART_BASE 0x04 | |
21716 | -#define ATI_GART_CACHE_SZBASE 0x08 | |
21717 | -#define ATI_GART_CACHE_CNTRL 0x0c | |
21718 | -#define ATI_GART_CACHE_ENTRY_CNTRL 0x10 | |
21719 | - | |
21720 | +#define ATI_GART_MMBASE_ADDR 0x14 | |
21721 | +#define ATI_RS100_APSIZE 0xac | |
21722 | +#define ATI_RS300_APSIZE 0xf8 | |
21723 | +#define ATI_RS100_IG_AGPMODE 0xb0 | |
21724 | +#define ATI_RS300_IG_AGPMODE 0xfc | |
21725 | + | |
21726 | +#define ATI_GART_FEATURE_ID 0x00 | |
21727 | +#define ATI_GART_BASE 0x04 | |
21728 | +#define ATI_GART_CACHE_SZBASE 0x08 | |
21729 | +#define ATI_GART_CACHE_CNTRL 0x0c | |
21730 | +#define ATI_GART_CACHE_ENTRY_CNTRL 0x10 | |
21731 | ||
21732 | /* Serverworks Registers */ | |
21733 | #define SVWRKS_APSIZE 0x10 | |
21734 | @@ -369,6 +354,17 @@ | |
21735 | #define HP_ZX1_PDIR_BASE 0x320 | |
21736 | #define HP_ZX1_CACHE_FLUSH 0x428 | |
21737 | ||
21738 | +/* NVIDIA registers */ | |
21739 | +#define NVIDIA_0_APSIZE 0x80 | |
21740 | +#define NVIDIA_1_WBC 0xf0 | |
21741 | +#define NVIDIA_2_GARTCTRL 0xd0 | |
21742 | +#define NVIDIA_2_APBASE 0xd8 | |
21743 | +#define NVIDIA_2_APLIMIT 0xdc | |
21744 | +#define NVIDIA_2_ATTBASE(i) (0xe0 + (i) * 4) | |
21745 | +#define NVIDIA_3_APBASE 0x50 | |
21746 | +#define NVIDIA_3_APLIMIT 0x54 | |
21747 | + | |
21748 | + | |
21749 | struct agp_device_ids { | |
21750 | unsigned short device_id; /* first, to make table easier to read */ | |
21751 | enum chipset_type chipset; | |
21752 | @@ -405,6 +401,9 @@ | |
21753 | void global_cache_flush(void); | |
21754 | void get_agp_version(struct agp_bridge_data *bridge); | |
21755 | unsigned long agp_generic_mask_memory(unsigned long addr, int type); | |
21756 | + | |
21757 | +extern int agp_off; | |
21758 | +extern int agp_try_unsupported_boot; | |
21759 | ||
21760 | /* Standard agp registers */ | |
21761 | #define AGPSTAT 0x4 | |
21762 | diff -Nru a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c | |
21763 | --- a/drivers/char/agp/ali-agp.c Mon Aug 18 10:39:21 2003 | |
21764 | +++ b/drivers/char/agp/ali-agp.c Thu Aug 28 16:44:18 2003 | |
21765 | @@ -76,7 +76,7 @@ | |
21766 | pci_write_config_dword(agp_bridge->dev, ALI_TLBCTRL, ((temp & 0xffffff00) | 0x00000010)); | |
21767 | ||
21768 | /* address to map to */ | |
21769 | - pci_read_config_dword(agp_bridge->dev, ALI_APBASE, &temp); | |
21770 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
21771 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
21772 | ||
21773 | #if 0 | |
21774 | diff -Nru a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c | |
21775 | --- a/drivers/char/agp/amd-k7-agp.c Mon Aug 18 10:39:21 2003 | |
21776 | +++ b/drivers/char/agp/amd-k7-agp.c Thu Aug 28 16:44:18 2003 | |
21777 | @@ -148,7 +148,7 @@ | |
21778 | * used to program the agp master not the cpu | |
21779 | */ | |
21780 | ||
21781 | - pci_read_config_dword(agp_bridge->dev, AMD_APBASE, &temp); | |
21782 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
21783 | addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
21784 | agp_bridge->gart_bus_addr = addr; | |
21785 | ||
21786 | diff -Nru a/drivers/char/agp/amd-k8-agp.c b/drivers/char/agp/amd-k8-agp.c | |
21787 | --- a/drivers/char/agp/amd-k8-agp.c Thu Jul 31 08:58:45 2003 | |
21788 | +++ b/drivers/char/agp/amd-k8-agp.c Thu Aug 28 18:04:31 2003 | |
21789 | @@ -8,12 +8,6 @@ | |
21790 | * work is done in the northbridge(s). | |
21791 | */ | |
21792 | ||
21793 | -/* | |
21794 | - * On x86-64 the AGP driver needs to be initialized early by the IOMMU | |
21795 | - * code. When you use this driver as a template for a new K8 AGP bridge | |
21796 | - * driver don't forget to change arch/x86_64/kernel/pci-gart.c too -AK. | |
21797 | - */ | |
21798 | - | |
21799 | #include <linux/module.h> | |
21800 | #include <linux/pci.h> | |
21801 | #include <linux/init.h> | |
21802 | @@ -21,7 +15,11 @@ | |
21803 | #include "agp.h" | |
21804 | ||
21805 | /* Will need to be increased if hammer ever goes >8-way. */ | |
21806 | +#ifdef CONFIG_SMP | |
21807 | #define MAX_HAMMER_GARTS 8 | |
21808 | +#else | |
21809 | +#define MAX_HAMMER_GARTS 1 | |
21810 | +#endif | |
21811 | ||
21812 | /* PTE bits. */ | |
21813 | #define GPTE_VALID 1 | |
21814 | @@ -39,6 +37,8 @@ | |
21815 | static int nr_garts; | |
21816 | static struct pci_dev * hammers[MAX_HAMMER_GARTS]; | |
21817 | ||
21818 | +static int __initdata agp_try_unsupported; | |
21819 | + | |
21820 | static int gart_iterator; | |
21821 | #define for_each_nb() for(gart_iterator=0;gart_iterator<nr_garts;gart_iterator++) | |
21822 | ||
21823 | @@ -46,9 +46,9 @@ | |
21824 | { | |
21825 | u32 tmp; | |
21826 | ||
21827 | - pci_read_config_dword (dev, AMD_X86_64_GARTCACHECTL, &tmp); | |
21828 | + pci_read_config_dword (dev, AMD64_GARTCACHECTL, &tmp); | |
21829 | tmp |= INVGART; | |
21830 | - pci_write_config_dword (dev, AMD_X86_64_GARTCACHECTL, tmp); | |
21831 | + pci_write_config_dword (dev, AMD64_GARTCACHECTL, tmp); | |
21832 | } | |
21833 | ||
21834 | static void amd_x86_64_tlbflush(struct agp_memory *temp) | |
21835 | @@ -135,7 +135,7 @@ | |
21836 | if (dev==NULL) | |
21837 | return 0; | |
21838 | ||
21839 | - pci_read_config_dword(dev, AMD_X86_64_GARTAPERTURECTL, &temp); | |
21840 | + pci_read_config_dword(dev, AMD64_GARTAPERTURECTL, &temp); | |
21841 | temp = (temp & 0xe); | |
21842 | values = A_SIZE_32(x86_64_aperture_sizes); | |
21843 | ||
21844 | @@ -162,7 +162,7 @@ | |
21845 | u64 addr, aper_base; | |
21846 | ||
21847 | /* Address to map to */ | |
21848 | - pci_read_config_dword (hammer, AMD_X86_64_GARTAPERTUREBASE, &tmp); | |
21849 | + pci_read_config_dword (hammer, AMD64_GARTAPERTUREBASE, &tmp); | |
21850 | aperturebase = tmp << 25; | |
21851 | aper_base = (aperturebase & PCI_BASE_ADDRESS_MEM_MASK); | |
21852 | ||
21853 | @@ -171,13 +171,13 @@ | |
21854 | addr >>= 12; | |
21855 | tmp = (u32) addr<<4; | |
21856 | tmp &= ~0xf; | |
21857 | - pci_write_config_dword (hammer, AMD_X86_64_GARTTABLEBASE, tmp); | |
21858 | + pci_write_config_dword (hammer, AMD64_GARTTABLEBASE, tmp); | |
21859 | ||
21860 | /* Enable GART translation for this hammer. */ | |
21861 | - pci_read_config_dword(hammer, AMD_X86_64_GARTAPERTURECTL, &tmp); | |
21862 | + pci_read_config_dword(hammer, AMD64_GARTAPERTURECTL, &tmp); | |
21863 | tmp |= GARTEN; | |
21864 | tmp &= ~(DISGARTCPU | DISGARTIO); | |
21865 | - pci_write_config_dword(hammer, AMD_X86_64_GARTAPERTURECTL, tmp); | |
21866 | + pci_write_config_dword(hammer, AMD64_GARTAPERTURECTL, tmp); | |
21867 | ||
21868 | /* keep CPU's coherent. */ | |
21869 | flush_x86_64_tlb (hammer); | |
21870 | @@ -216,9 +216,9 @@ | |
21871 | ||
21872 | for_each_nb() { | |
21873 | /* disable gart translation */ | |
21874 | - pci_read_config_dword (hammers[gart_iterator], AMD_X86_64_GARTAPERTURECTL, &tmp); | |
21875 | - tmp &= ~(AMD_X86_64_GARTEN); | |
21876 | - pci_write_config_dword (hammers[gart_iterator], AMD_X86_64_GARTAPERTURECTL, tmp); | |
21877 | + pci_read_config_dword (hammers[gart_iterator], AMD64_GARTAPERTURECTL, &tmp); | |
21878 | + tmp &= ~AMD64_GARTEN; | |
21879 | + pci_write_config_dword (hammers[gart_iterator], AMD64_GARTAPERTURECTL, tmp); | |
21880 | } | |
21881 | } | |
21882 | ||
21883 | @@ -246,24 +246,123 @@ | |
21884 | .agp_destroy_page = agp_generic_destroy_page, | |
21885 | }; | |
21886 | ||
21887 | +/* Some basic sanity checks for the aperture. */ | |
21888 | +static int __init aperture_valid(u64 aper, u32 size) | |
21889 | +{ | |
21890 | + static int not_first_call; | |
21891 | + u32 pfn, c; | |
21892 | + if (aper == 0) { | |
21893 | + printk(KERN_ERR "No aperture\n"); | |
21894 | + return 0; | |
21895 | + } | |
21896 | + if (size < 32*1024*1024) { | |
21897 | + printk(KERN_ERR "Aperture too small (%d MB)\n", size>>20); | |
21898 | + return 0; | |
21899 | + } | |
21900 | + if (aper + size > 0xffffffff) { | |
21901 | + printk(KERN_ERR "Aperture out of bounds\n"); | |
21902 | + return 0; | |
21903 | + } | |
21904 | + pfn = aper >> PAGE_SHIFT; | |
21905 | + for (c = 0; c < size/PAGE_SIZE; c++) { | |
21906 | + if (!pfn_valid(pfn + c)) | |
21907 | + break; | |
21908 | + if (!PageReserved(pfn_to_page(pfn + c))) { | |
21909 | + printk(KERN_ERR "Aperture pointing to RAM\n"); | |
21910 | + return 0; | |
21911 | + } | |
21912 | + } | |
21913 | ||
21914 | -#ifdef CONFIG_SMP | |
21915 | -static int cache_nbs (void) | |
21916 | + /* Request the Aperture. This catches cases when someone else | |
21917 | + already put a mapping in there - happens with some very broken BIOS | |
21918 | + | |
21919 | + Maybe better to use pci_assign_resource/pci_enable_device instead trusting | |
21920 | + the bridges? */ | |
21921 | + if (!not_first_call && request_mem_region(aper, size, "aperture") < 0) { | |
21922 | + printk(KERN_ERR "Aperture conflicts with PCI mapping.\n"); | |
21923 | + return 0; | |
21924 | + } | |
21925 | + | |
21926 | + not_first_call = 1; | |
21927 | + return 1; | |
21928 | +} | |
21929 | + | |
21930 | +/* | |
21931 | + * W*s centric BIOS sometimes only set up the aperture in the AGP | |
21932 | + * bridge, not the northbridge. On AMD64 this is handled early | |
21933 | + * in aperture.c, but when GART_IOMMU is not enabled or we run | |
21934 | + * on a 32bit kernel this needs to be redone. | |
21935 | + * Unfortunately it is impossible to fix the aperture here because it's too late | |
21936 | + * to allocate that much memory. But at least error out cleanly instead of | |
21937 | + * crashing. | |
21938 | + */ | |
21939 | +static __init int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp, | |
21940 | + u16 cap) | |
21941 | +{ | |
21942 | + u32 aper_low, aper_hi; | |
21943 | + u64 aper, nb_aper; | |
21944 | + int order = 0; | |
21945 | + u32 nb_order, nb_base; | |
21946 | + u16 apsize; | |
21947 | + | |
21948 | + pci_read_config_dword(nb, 0x90, &nb_order); | |
21949 | + nb_order = (nb_order >> 1) & 7; | |
21950 | + pci_read_config_dword(nb, 0x94, &nb_base); | |
21951 | + nb_aper = nb_base << 25; | |
21952 | + if (aperture_valid(nb_aper, (32*1024*1024)<<nb_order)) { | |
21953 | + return 0; | |
21954 | + } | |
21955 | + | |
21956 | + /* Northbridge seems to contain crap. Try the AGP bridge. */ | |
21957 | + | |
21958 | + pci_read_config_word(agp, cap+0x14, &apsize); | |
21959 | + if (apsize == 0xffff) | |
21960 | + return -1; | |
21961 | + | |
21962 | + apsize &= 0xfff; | |
21963 | + /* Some BIOS use weird encodings not in the AGPv3 table. */ | |
21964 | + if (apsize & 0xff) | |
21965 | + apsize |= 0xf00; | |
21966 | + order = 7 - hweight16(apsize); | |
21967 | + | |
21968 | + pci_read_config_dword(agp, 0x10, &aper_low); | |
21969 | + pci_read_config_dword(agp, 0x14, &aper_hi); | |
21970 | + aper = (aper_low & ~((1<<22)-1)) | ((u64)aper_hi << 32); | |
21971 | + printk(KERN_INFO "Aperture from AGP @ %Lx size %u MB\n", aper, 32 << order); | |
21972 | + if (order < 0 || !aperture_valid(aper, (32*1024*1024)<<order)) | |
21973 | + return -1; | |
21974 | + | |
21975 | + pci_write_config_dword(nb, 0x90, order << 1); | |
21976 | + pci_write_config_dword(nb, 0x94, aper >> 25); | |
21977 | + | |
21978 | + return 0; | |
21979 | +} | |
21980 | + | |
21981 | +static __init int cache_nbs (struct pci_dev *pdev, u32 cap_ptr) | |
21982 | { | |
21983 | struct pci_dev *loop_dev = NULL; | |
21984 | int i = 0; | |
21985 | ||
21986 | /* cache pci_devs of northbridges. */ | |
21987 | - while ((loop_dev = pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, loop_dev)) != NULL) { | |
21988 | + while ((loop_dev = pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, loop_dev)) | |
21989 | + != NULL) { | |
21990 | + if (fix_northbridge(loop_dev, pdev, cap_ptr) < 0) { | |
21991 | + printk("No usable aperture found.\n"); | |
21992 | +#ifdef __x86_64__ | |
21993 | + /* should port this to i386 */ | |
21994 | + printk("Consider rebooting with iommu=memaper=2 to get a good aperture.\n"); | |
21995 | +#endif | |
21996 | + return -1; | |
21997 | + } | |
21998 | hammers[i++] = loop_dev; | |
21999 | nr_garts = i; | |
22000 | - if (i == MAX_HAMMER_GARTS) | |
22001 | + if (i == MAX_HAMMER_GARTS) { | |
22002 | + printk(KERN_INFO "Too many northbridges for AGP\n"); | |
22003 | return -1; | |
22004 | + } | |
22005 | } | |
22006 | - return 0; | |
22007 | + return i == 0 ? -1 : 0; | |
22008 | } | |
22009 | -#endif | |
22010 | - | |
22011 | ||
22012 | static int __init agp_amdk8_probe(struct pci_dev *pdev, | |
22013 | const struct pci_device_id *ent) | |
22014 | @@ -277,7 +376,7 @@ | |
22015 | if (!cap_ptr) | |
22016 | return -ENODEV; | |
22017 | ||
22018 | - printk(KERN_INFO PFX "Detected Opteron/Athlon64 on-CPU GART\n"); | |
22019 | + /* Could check for AGPv3 here */ | |
22020 | ||
22021 | bridge = agp_alloc_bridge(); | |
22022 | if (!bridge) | |
22023 | @@ -311,6 +410,9 @@ | |
22024 | bridge->major_version = 3; | |
22025 | bridge->minor_version = 0; | |
22026 | } | |
22027 | + } else { | |
22028 | + printk(KERN_INFO PFX "Detected AGP bridge %x\n", | |
22029 | + pdev->devfn); | |
22030 | } | |
22031 | ||
22032 | bridge->driver = &amd_8151_driver; | |
22033 | @@ -320,22 +422,10 @@ | |
22034 | /* Fill in the mode register */ | |
22035 | pci_read_config_dword(pdev, bridge->capndx+PCI_AGP_STATUS, &bridge->mode); | |
22036 | ||
22037 | -#ifdef CONFIG_SMP | |
22038 | - if (cache_nbs() == -1) { | |
22039 | + if (cache_nbs(pdev, cap_ptr) == -1) { | |
22040 | agp_put_bridge(bridge); | |
22041 | - return -ENOMEM; | |
22042 | - } | |
22043 | -#else | |
22044 | - { | |
22045 | - struct pci_dev *loop_dev = NULL; | |
22046 | - while ((loop_dev = pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, loop_dev)) != NULL) { | |
22047 | - /* For UP, we only care about the first GART. */ | |
22048 | - hammers[0] = loop_dev; | |
22049 | - nr_garts = 1; | |
22050 | - break; | |
22051 | - } | |
22052 | + return -ENODEV; | |
22053 | } | |
22054 | -#endif | |
22055 | ||
22056 | pci_set_drvdata(pdev, bridge); | |
22057 | return agp_add_bridge(bridge); | |
22058 | @@ -345,6 +435,8 @@ | |
22059 | { | |
22060 | struct agp_bridge_data *bridge = pci_get_drvdata(pdev); | |
22061 | ||
22062 | + release_mem_region(virt_to_phys(bridge->gatt_table_real), | |
22063 | + x86_64_aperture_sizes[bridge->aperture_size_idx].size); | |
22064 | agp_remove_bridge(bridge); | |
22065 | agp_put_bridge(bridge); | |
22066 | } | |
22067 | @@ -358,11 +450,21 @@ | |
22068 | .subvendor = PCI_ANY_ID, | |
22069 | .subdevice = PCI_ANY_ID, | |
22070 | }, | |
22071 | + /* VIA K8T800 */ | |
22072 | { | |
22073 | .class = (PCI_CLASS_BRIDGE_HOST << 8), | |
22074 | .class_mask = ~0, | |
22075 | .vendor = PCI_VENDOR_ID_VIA, | |
22076 | - .device = PCI_DEVICE_ID_VIA_K8T400M_0, | |
22077 | + .device = PCI_DEVICE_ID_VIA_8385_0, | |
22078 | + .subvendor = PCI_ANY_ID, | |
22079 | + .subdevice = PCI_ANY_ID, | |
22080 | + }, | |
22081 | + /* VIA K8M800 / K8N800 */ | |
22082 | + { | |
22083 | + .class = (PCI_CLASS_BRIDGE_HOST << 8), | |
22084 | + .class_mask = ~0, | |
22085 | + .vendor = PCI_VENDOR_ID_VIA, | |
22086 | + .device = PCI_DEVICE_ID_VIA_8380_0, | |
22087 | .subvendor = PCI_ANY_ID, | |
22088 | .subdevice = PCI_ANY_ID, | |
22089 | }, | |
22090 | @@ -386,10 +488,43 @@ | |
22091 | .remove = agp_amdk8_remove, | |
22092 | }; | |
22093 | ||
22094 | + | |
22095 | /* Not static due to IOMMU code calling it early. */ | |
22096 | int __init agp_amdk8_init(void) | |
22097 | { | |
22098 | - return pci_module_init(&agp_amdk8_pci_driver); | |
22099 | + int err = 0; | |
22100 | + if (agp_off) | |
22101 | + return -EINVAL; | |
22102 | + if (pci_module_init(&agp_amdk8_pci_driver) == 0) { | |
22103 | + struct pci_dev *dev; | |
22104 | + if (!agp_try_unsupported && !agp_try_unsupported_boot) { | |
22105 | + printk(KERN_INFO "No supported AGP bridge found.\n"); | |
22106 | +#ifdef MODULE | |
22107 | + printk(KERN_INFO "You can try agp_try_unsupported=1\n"); | |
22108 | +#else | |
22109 | + printk(KERN_INFO "You can boot with agp=try_unsupported\n"); | |
22110 | +#endif | |
22111 | + return -ENODEV; | |
22112 | + } | |
22113 | + | |
22114 | + /* First check that we have at least one K8 NB */ | |
22115 | + if (!pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, NULL)) | |
22116 | + return -ENODEV; | |
22117 | + | |
22118 | + /* Look for any AGP bridge */ | |
22119 | + dev = NULL; | |
22120 | + err = -ENODEV; | |
22121 | + while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev))) { | |
22122 | + if (!pci_find_capability(dev, PCI_CAP_ID_AGP)) | |
22123 | + continue; | |
22124 | + /* Only one bridge supported right now */ | |
22125 | + if (agp_amdk8_probe(dev, NULL) == 0) { | |
22126 | + err = 0; | |
22127 | + break; | |
22128 | + } | |
22129 | + } | |
22130 | + } | |
22131 | + return err; | |
22132 | } | |
22133 | ||
22134 | static void __exit agp_amdk8_cleanup(void) | |
22135 | @@ -404,6 +539,6 @@ | |
22136 | module_exit(agp_amdk8_cleanup); | |
22137 | #endif | |
22138 | ||
22139 | -MODULE_AUTHOR("Dave Jones <davej@codemonkey.org.uk>"); | |
22140 | +MODULE_AUTHOR("Dave Jones <davej@codemonkey.org.uk>, Andi Kleen"); | |
22141 | +MODULE_PARM(agp_try_unsupported, "1i"); | |
22142 | MODULE_LICENSE("GPL and additional rights"); | |
22143 | - | |
22144 | diff -Nru a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c | |
22145 | --- a/drivers/char/agp/ati-agp.c Mon Aug 18 10:39:21 2003 | |
22146 | +++ b/drivers/char/agp/ati-agp.c Thu Aug 28 16:44:18 2003 | |
22147 | @@ -1,5 +1,5 @@ | |
22148 | /* | |
22149 | - * ALi AGPGART routines. | |
22150 | + * ATi AGPGART routines. | |
22151 | */ | |
22152 | ||
22153 | #include <linux/types.h> | |
22154 | @@ -212,7 +212,7 @@ | |
22155 | ||
22156 | /* address to map too */ | |
22157 | /* | |
22158 | - pci_read_config_dword(agp_bridge.dev, ATI_APBASE, &temp); | |
22159 | + pci_read_config_dword(agp_bridge.dev, AGP_APBASE, &temp); | |
22160 | agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
22161 | printk(KERN_INFO "IGP320 gart_bus_addr: %x\n", agp_bridge.gart_bus_addr); | |
22162 | */ | |
22163 | @@ -355,7 +355,7 @@ | |
22164 | * This is a bus address even on the alpha, b/c its | |
22165 | * used to program the agp master not the cpu | |
22166 | */ | |
22167 | - pci_read_config_dword(agp_bridge->dev, ATI_APBASE, &temp); | |
22168 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
22169 | addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
22170 | agp_bridge->gart_bus_addr = addr; | |
22171 | ||
22172 | diff -Nru a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c | |
22173 | --- a/drivers/char/agp/backend.c Wed Aug 13 10:20:16 2003 | |
22174 | +++ b/drivers/char/agp/backend.c Wed Sep 3 23:40:14 2003 | |
22175 | @@ -301,9 +301,14 @@ | |
22176 | } | |
22177 | EXPORT_SYMBOL_GPL(agp_remove_bridge); | |
22178 | ||
22179 | +int agp_off; | |
22180 | +int agp_try_unsupported_boot; | |
22181 | +EXPORT_SYMBOL(agp_off); | |
22182 | +EXPORT_SYMBOL(agp_try_unsupported_boot); | |
22183 | ||
22184 | static int __init agp_init(void) | |
22185 | { | |
22186 | + if (!agp_off) | |
22187 | printk(KERN_INFO "Linux agpgart interface v%d.%d (c) Dave Jones\n", | |
22188 | AGPGART_VERSION_MAJOR, AGPGART_VERSION_MINOR); | |
22189 | return 0; | |
22190 | @@ -313,10 +318,20 @@ | |
22191 | { | |
22192 | } | |
22193 | ||
22194 | +static __init int agp_setup(char *s) | |
22195 | +{ | |
22196 | + if (!strcmp(s,"off")) | |
22197 | + agp_off = 1; | |
22198 | + if (!strcmp(s,"try_unsupported")) | |
22199 | + agp_try_unsupported_boot = 1; | |
22200 | + return 1; | |
22201 | +} | |
22202 | +__setup("agp=", agp_setup); | |
22203 | ||
22204 | MODULE_AUTHOR("Dave Jones <davej@codemonkey.org.uk>"); | |
22205 | MODULE_DESCRIPTION("AGP GART driver"); | |
22206 | MODULE_LICENSE("GPL and additional rights"); | |
22207 | +MODULE_ALIAS_MISCDEV(AGPGART_MINOR); | |
22208 | ||
22209 | module_init(agp_init); | |
22210 | module_exit(agp_exit); | |
22211 | diff -Nru a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c | |
22212 | --- a/drivers/char/agp/frontend.c Sun Jul 13 05:36:05 2003 | |
22213 | +++ b/drivers/char/agp/frontend.c Wed Sep 3 23:40:14 2003 | |
22214 | @@ -698,7 +698,7 @@ | |
22215 | ||
22216 | static int agp_open(struct inode *inode, struct file *file) | |
22217 | { | |
22218 | - int minor = minor(inode->i_rdev); | |
22219 | + int minor = iminor(inode); | |
22220 | struct agp_file_private *priv; | |
22221 | struct agp_client *client; | |
22222 | int rc = -ENXIO; | |
22223 | @@ -1097,4 +1097,3 @@ | |
22224 | { | |
22225 | misc_deregister(&agp_miscdev); | |
22226 | } | |
22227 | - | |
22228 | diff -Nru a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c | |
22229 | --- a/drivers/char/agp/generic.c Wed Aug 13 01:35:50 2003 | |
22230 | +++ b/drivers/char/agp/generic.c Wed Aug 27 11:06:10 2003 | |
22231 | @@ -577,12 +577,12 @@ | |
22232 | agp_device_command(command, TRUE); | |
22233 | return; | |
22234 | } else { | |
22235 | - /* Disable calibration cycle in RX91<1> when not in AGP3.0 mode of operation.*/ | |
22236 | + /* Disable calibration cycle in RX91<1> when not in AGP3.0 mode of operation.*/ | |
22237 | command &= ~(7<<10) ; | |
22238 | pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx+AGPCTRL, &temp); | |
22239 | temp |= (1<<9); | |
22240 | pci_write_config_dword(agp_bridge->dev, agp_bridge->capndx+AGPCTRL, temp); | |
22241 | - | |
22242 | + | |
22243 | printk (KERN_INFO PFX "Device is in legacy mode," | |
22244 | " falling back to 2.x\n"); | |
22245 | } | |
22246 | diff -Nru a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c | |
22247 | --- a/drivers/char/agp/intel-agp.c Fri Aug 15 07:25:05 2003 | |
22248 | +++ b/drivers/char/agp/intel-agp.c Thu Aug 28 16:44:18 2003 | |
22249 | @@ -618,7 +618,7 @@ | |
22250 | pci_write_config_word(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | |
22251 | ||
22252 | /* address to map to */ | |
22253 | - pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp); | |
22254 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
22255 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
22256 | ||
22257 | /* attbase - aperture base */ | |
22258 | @@ -657,7 +657,7 @@ | |
22259 | current_size->size_value); | |
22260 | ||
22261 | /* address to map to */ | |
22262 | - pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp); | |
22263 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
22264 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
22265 | ||
22266 | pci_read_config_dword(agp_bridge->dev, INTEL_ATTBASE, &addr); | |
22267 | @@ -708,7 +708,7 @@ | |
22268 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | |
22269 | ||
22270 | /* address to map to */ | |
22271 | - pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp); | |
22272 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
22273 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
22274 | ||
22275 | /* attbase - aperture base */ | |
22276 | @@ -739,7 +739,7 @@ | |
22277 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | |
22278 | ||
22279 | /* address to map to */ | |
22280 | - pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp); | |
22281 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
22282 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
22283 | ||
22284 | /* attbase - aperture base */ | |
22285 | @@ -768,7 +768,7 @@ | |
22286 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | |
22287 | ||
22288 | /* address to map to */ | |
22289 | - pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp); | |
22290 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
22291 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
22292 | ||
22293 | /* attbase - aperture base */ | |
22294 | @@ -797,7 +797,7 @@ | |
22295 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | |
22296 | ||
22297 | /* address to map to */ | |
22298 | - pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp); | |
22299 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
22300 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
22301 | ||
22302 | /* attbase - aperture base */ | |
22303 | @@ -826,7 +826,7 @@ | |
22304 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | |
22305 | ||
22306 | /* address to map to */ | |
22307 | - pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp); | |
22308 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
22309 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
22310 | ||
22311 | /* attbase - aperture base */ | |
22312 | @@ -855,7 +855,7 @@ | |
22313 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | |
22314 | ||
22315 | /* address to map to */ | |
22316 | - pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp); | |
22317 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
22318 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
22319 | ||
22320 | /* attbase - aperture base */ | |
22321 | @@ -884,7 +884,7 @@ | |
22322 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | |
22323 | ||
22324 | /* address to map to */ | |
22325 | - pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp); | |
22326 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
22327 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
22328 | ||
22329 | /* attbase - aperture base */ | |
22330 | diff -Nru a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c | |
22331 | --- a/drivers/char/agp/nvidia-agp.c Fri Aug 15 07:22:22 2003 | |
22332 | +++ b/drivers/char/agp/nvidia-agp.c Thu Aug 28 16:56:50 2003 | |
22333 | @@ -13,18 +13,6 @@ | |
22334 | #include <linux/mm.h> | |
22335 | #include "agp.h" | |
22336 | ||
22337 | - | |
22338 | -/* registers */ | |
22339 | -#define NVIDIA_0_APBASE 0x10 | |
22340 | -#define NVIDIA_0_APSIZE 0x80 | |
22341 | -#define NVIDIA_1_WBC 0xf0 | |
22342 | -#define NVIDIA_2_GARTCTRL 0xd0 | |
22343 | -#define NVIDIA_2_APBASE 0xd8 | |
22344 | -#define NVIDIA_2_APLIMIT 0xdc | |
22345 | -#define NVIDIA_2_ATTBASE(i) (0xe0 + (i) * 4) | |
22346 | -#define NVIDIA_3_APBASE 0x50 | |
22347 | -#define NVIDIA_3_APLIMIT 0x54 | |
22348 | - | |
22349 | static struct _nvidia_private { | |
22350 | struct pci_dev *dev_1; | |
22351 | struct pci_dev *dev_2; | |
22352 | @@ -73,7 +61,7 @@ | |
22353 | current_size->size_value); | |
22354 | ||
22355 | /* address to map to */ | |
22356 | - pci_read_config_dword(agp_bridge->dev, NVIDIA_0_APBASE, &apbase); | |
22357 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &apbase); | |
22358 | apbase &= PCI_BASE_ADDRESS_MEM_MASK; | |
22359 | agp_bridge->gart_bus_addr = apbase; | |
22360 | aplimit = apbase + (current_size->size * 1024 * 1024) - 1; | |
22361 | diff -Nru a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c | |
22362 | --- a/drivers/char/agp/sis-agp.c Mon Aug 18 10:39:21 2003 | |
22363 | +++ b/drivers/char/agp/sis-agp.c Thu Aug 28 16:44:18 2003 | |
22364 | @@ -43,7 +43,7 @@ | |
22365 | ||
22366 | current_size = A_SIZE_8(agp_bridge->current_size); | |
22367 | pci_write_config_byte(agp_bridge->dev, SIS_TLBCNTRL, 0x05); | |
22368 | - pci_read_config_dword(agp_bridge->dev, SIS_APBASE, &temp); | |
22369 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
22370 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
22371 | pci_write_config_dword(agp_bridge->dev, SIS_ATTBASE, | |
22372 | agp_bridge->gatt_bus_addr); | |
22373 | diff -Nru a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c | |
22374 | --- a/drivers/char/agp/via-agp.c Wed Aug 13 01:41:04 2003 | |
22375 | +++ b/drivers/char/agp/via-agp.c Thu Aug 28 17:14:45 2003 | |
22376 | @@ -39,7 +39,7 @@ | |
22377 | pci_write_config_byte(agp_bridge->dev, VIA_APSIZE, | |
22378 | current_size->size_value); | |
22379 | /* address to map too */ | |
22380 | - pci_read_config_dword(agp_bridge->dev, VIA_APBASE, &temp); | |
22381 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
22382 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
22383 | ||
22384 | /* GART control register */ | |
22385 | @@ -114,7 +114,7 @@ | |
22386 | current_size = A_SIZE_16(agp_bridge->current_size); | |
22387 | ||
22388 | /* address to map too */ | |
22389 | - pci_read_config_dword(agp_bridge->dev, VIA_APBASE, &temp); | |
22390 | + pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | |
22391 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | |
22392 | ||
22393 | /* attbase - aperture GATT base */ | |
22394 | @@ -215,52 +215,52 @@ | |
22395 | { | |
22396 | { | |
22397 | .device_id = PCI_DEVICE_ID_VIA_82C597_0, | |
22398 | - .chipset_name = "VP3", | |
22399 | + .chipset_name = "Apollo VP3", | |
22400 | }, | |
22401 | ||
22402 | { | |
22403 | .device_id = PCI_DEVICE_ID_VIA_82C598_0, | |
22404 | - .chipset_name = "MVP3", | |
22405 | + .chipset_name = "Apollo MVP3", | |
22406 | }, | |
22407 | ||
22408 | { | |
22409 | .device_id = PCI_DEVICE_ID_VIA_8501_0, | |
22410 | - .chipset_name = "MVP4", | |
22411 | + .chipset_name = "Apollo MVP4", | |
22412 | }, | |
22413 | ||
22414 | /* VT8601 */ | |
22415 | { | |
22416 | .device_id = PCI_DEVICE_ID_VIA_8601_0, | |
22417 | - .chipset_name = "PLE133 ProMedia", | |
22418 | + .chipset_name = "Apollo ProMedia/PLE133Ta", | |
22419 | }, | |
22420 | ||
22421 | /* VT82C693A / VT28C694T */ | |
22422 | { | |
22423 | - .device_id = PCI_DEVICE_ID_VIA_82C691, | |
22424 | + .device_id = PCI_DEVICE_ID_VIA_82C691_0, | |
22425 | .chipset_name = "Apollo Pro 133", | |
22426 | }, | |
22427 | ||
22428 | { | |
22429 | .device_id = PCI_DEVICE_ID_VIA_8371_0, | |
22430 | - .chipset_name = "Apollo Pro KX133", | |
22431 | + .chipset_name = "KX133", | |
22432 | }, | |
22433 | ||
22434 | /* VT8633 */ | |
22435 | { | |
22436 | .device_id = PCI_DEVICE_ID_VIA_8633_0, | |
22437 | - .chipset_name = "Apollo Pro 266", | |
22438 | + .chipset_name = "Pro 266", | |
22439 | }, | |
22440 | ||
22441 | /* VT8361 */ | |
22442 | { | |
22443 | .device_id = PCI_DEVICE_ID_VIA_8361, | |
22444 | - .chipset_name = "Apollo KLE133", | |
22445 | + .chipset_name = "KLE133", | |
22446 | }, | |
22447 | ||
22448 | /* VT8365 / VT8362 */ | |
22449 | { | |
22450 | .device_id = PCI_DEVICE_ID_VIA_8363_0, | |
22451 | - .chipset_name = "Apollo Pro KT133/KM133/TwisterK", | |
22452 | + .chipset_name = "Twister-K/KT133x/KM133", | |
22453 | }, | |
22454 | ||
22455 | /* VT8753A */ | |
22456 | @@ -272,79 +272,79 @@ | |
22457 | /* VT8366 */ | |
22458 | { | |
22459 | .device_id = PCI_DEVICE_ID_VIA_8367_0, | |
22460 | - .chipset_name = "Apollo Pro KT266/KT333", | |
22461 | + .chipset_name = "KT266/KY266x/KT333", | |
22462 | }, | |
22463 | ||
22464 | /* VT8633 (for CuMine/ Celeron) */ | |
22465 | { | |
22466 | .device_id = PCI_DEVICE_ID_VIA_8653_0, | |
22467 | - .chipset_name = "Apollo Pro 266T", | |
22468 | + .chipset_name = "Pro266T", | |
22469 | }, | |
22470 | ||
22471 | /* KM266 / PM266 */ | |
22472 | { | |
22473 | - .device_id = PCI_DEVICE_ID_VIA_KM266, | |
22474 | - .chipset_name = "KM266/PM266", | |
22475 | + .device_id = PCI_DEVICE_ID_VIA_XM266, | |
22476 | + .chipset_name = "PM266/KM266", | |
22477 | }, | |
22478 | ||
22479 | /* CLE266 */ | |
22480 | { | |
22481 | - .device_id = PCI_DEVICE_ID_VIA_CLE266, | |
22482 | + .device_id = PCI_DEVICE_ID_VIA_862X_0, | |
22483 | .chipset_name = "CLE266", | |
22484 | }, | |
22485 | ||
22486 | { | |
22487 | .device_id = PCI_DEVICE_ID_VIA_8377_0, | |
22488 | - .chipset_name = "Apollo Pro KT400", | |
22489 | + .chipset_name = "KT400/KT400A/KT600", | |
22490 | }, | |
22491 | ||
22492 | - /* VT8604 / VT8605 / VT8603 / TwisterT | |
22493 | + /* VT8604 / VT8605 / VT8603 | |
22494 | * (Apollo Pro133A chipset with S3 Savage4) */ | |
22495 | { | |
22496 | - .device_id = PCI_DEVICE_ID_VIA_82C694X_0, | |
22497 | - .chipset_name = "Apollo ProSavage PM133/PL133/PN133/Twister" | |
22498 | + .device_id = PCI_DEVICE_ID_VIA_8605_0, | |
22499 | + .chipset_name = "ProSavage PM133/PL133/PN133" | |
22500 | }, | |
22501 | ||
22502 | - /* VT8752*/ | |
22503 | + /* P4M266x/P4N266 */ | |
22504 | { | |
22505 | - .device_id = PCI_DEVICE_ID_VIA_8752, | |
22506 | - .chipset_name = "ProSavage DDR P4M266", | |
22507 | + .device_id = PCI_DEVICE_ID_VIA_8703_51_0, | |
22508 | + .chipset_name = "P4M266x/P4N266", | |
22509 | }, | |
22510 | ||
22511 | - /* KN266/PN266 */ | |
22512 | + /* VT8754 */ | |
22513 | { | |
22514 | - .device_id = PCI_DEVICE_ID_VIA_KN266, | |
22515 | - .chipset_name = "KN266/PN266", | |
22516 | + .device_id = PCI_DEVICE_ID_VIA_8754C_0, | |
22517 | + .chipset_name = "PT800", | |
22518 | }, | |
22519 | ||
22520 | - /* VT8754 */ | |
22521 | + /* P4X600 */ | |
22522 | { | |
22523 | - .device_id = PCI_DEVICE_ID_VIA_8754, | |
22524 | - .chipset_name = "Apollo P4X333/P4X400" | |
22525 | + .device_id = PCI_DEVICE_ID_VIA_8763_0, | |
22526 | + .chipset_name = "P4X600" | |
22527 | }, | |
22528 | ||
22529 | - /* P4N333 */ | |
22530 | + /* KM400 */ | |
22531 | { | |
22532 | - .device_id = PCI_DEVICE_ID_VIA_P4N333, | |
22533 | - .chipset_name = "P4N333", | |
22534 | + .device_id = PCI_DEVICE_ID_VIA_8378_0, | |
22535 | + .chipset_name = "KM400/KM400A", | |
22536 | }, | |
22537 | ||
22538 | - /* P4X600 */ | |
22539 | + /* PT880 */ | |
22540 | { | |
22541 | - .device_id = PCI_DEVICE_ID_VIA_P4X600, | |
22542 | - .chipset_name = "P4X600", | |
22543 | + .device_id = PCI_DEVICE_ID_VIA_PT880, | |
22544 | + .chipset_name = "PT880", | |
22545 | }, | |
22546 | ||
22547 | - /* KM400 */ | |
22548 | + /* PT890 */ | |
22549 | { | |
22550 | - .device_id = PCI_DEVICE_ID_VIA_KM400, | |
22551 | - .chipset_name = "KM400", | |
22552 | + .device_id = PCI_DEVICE_ID_VIA_8783_0, | |
22553 | + .chipset_name = "PT890", | |
22554 | }, | |
22555 | ||
22556 | - /* P4M400 */ | |
22557 | + /* PM800/PN800/PM880/PN880 */ | |
22558 | { | |
22559 | - .device_id = PCI_DEVICE_ID_VIA_P4M400, | |
22560 | - .chipset_name = "P4M400", | |
22561 | + .device_id = PCI_DEVICE_ID_VIA_PX8X0_0, | |
22562 | + .chipset_name = "PM800/PN800/PM880/PN880", | |
22563 | }, | |
22564 | ||
22565 | { }, /* dummy final entry, always present */ | |
22566 | diff -Nru a/drivers/char/busmouse.c b/drivers/char/busmouse.c | |
22567 | --- a/drivers/char/busmouse.c Fri Jul 11 23:17:17 2003 | |
22568 | +++ b/drivers/char/busmouse.c Wed Sep 3 23:40:14 2003 | |
22569 | @@ -51,7 +51,7 @@ | |
22570 | ||
22571 | #define NR_MICE 15 | |
22572 | #define FIRST_MOUSE 0 | |
22573 | -#define DEV_TO_MOUSE(dev) MINOR_TO_MOUSE(minor(dev)) | |
22574 | +#define DEV_TO_MOUSE(inode) MINOR_TO_MOUSE(iminor(inode)) | |
22575 | #define MINOR_TO_MOUSE(minor) ((minor) - FIRST_MOUSE) | |
22576 | ||
22577 | /* | |
22578 | @@ -190,7 +190,7 @@ | |
22579 | unsigned int mousedev; | |
22580 | int ret; | |
22581 | ||
22582 | - mousedev = DEV_TO_MOUSE(inode->i_rdev); | |
22583 | + mousedev = DEV_TO_MOUSE(inode); | |
22584 | if (mousedev >= NR_MICE) | |
22585 | return -EINVAL; | |
22586 | ||
22587 | @@ -452,4 +452,5 @@ | |
22588 | EXPORT_SYMBOL(register_busmouse); | |
22589 | EXPORT_SYMBOL(unregister_busmouse); | |
22590 | ||
22591 | +MODULE_ALIAS_MISCDEV(BUSMOUSE_MINOR); | |
22592 | MODULE_LICENSE("GPL"); | |
22593 | diff -Nru a/drivers/char/cyclades.c b/drivers/char/cyclades.c | |
22594 | --- a/drivers/char/cyclades.c Fri Aug 1 02:20:44 2003 | |
22595 | +++ b/drivers/char/cyclades.c Sun Aug 31 16:14:39 2003 | |
22596 | @@ -1050,14 +1050,14 @@ | |
22597 | udelay(5000L); | |
22598 | ||
22599 | /* Enable the Tx interrupts on the CD1400 */ | |
22600 | - save_flags(flags); cli(); | |
22601 | + local_irq_save(flags); | |
22602 | cy_writeb((u_long)address + (CyCAR<<index), 0); | |
22603 | cyy_issue_cmd(address, CyCHAN_CTL|CyENB_XMTR, index); | |
22604 | ||
22605 | cy_writeb((u_long)address + (CyCAR<<index), 0); | |
22606 | cy_writeb((u_long)address + (CySRER<<index), | |
22607 | cy_readb(address + (CySRER<<index)) | CyTxRdy); | |
22608 | - restore_flags(flags); | |
22609 | + local_irq_restore(flags); | |
22610 | ||
22611 | /* Wait ... */ | |
22612 | udelay(5000L); | |
22613 | @@ -5665,7 +5665,7 @@ | |
22614 | cy_cleanup_module(void) | |
22615 | { | |
22616 | int i; | |
22617 | - int e1; | |
22618 | + int e1, e2; | |
22619 | unsigned long flags; | |
22620 | ||
22621 | #ifndef CONFIG_CYZ_INTR | |
22622 | @@ -5675,13 +5675,10 @@ | |
22623 | } | |
22624 | #endif /* CONFIG_CYZ_INTR */ | |
22625 | ||
22626 | - save_flags(flags); cli(); | |
22627 | - | |
22628 | if ((e1 = tty_unregister_driver(cy_serial_driver))) | |
22629 | printk("cyc: failed to unregister Cyclades serial driver(%d)\n", | |
22630 | e1); | |
22631 | ||
22632 | - restore_flags(flags); | |
22633 | put_tty_driver(cy_serial_driver); | |
22634 | ||
22635 | for (i = 0; i < NR_CARDS; i++) { | |
22636 | diff -Nru a/drivers/char/drm/drm_drv.h b/drivers/char/drm/drm_drv.h | |
22637 | --- a/drivers/char/drm/drm_drv.h Thu Aug 7 15:37:26 2003 | |
22638 | +++ b/drivers/char/drm/drm_drv.h Tue Aug 26 09:25:41 2003 | |
22639 | @@ -795,7 +795,7 @@ | |
22640 | int i; | |
22641 | ||
22642 | for (i = 0; i < DRM(numdevs); i++) { | |
22643 | - if (minor(inode->i_rdev) == DRM(minor)[i]) { | |
22644 | + if (iminor(inode) == DRM(minor)[i]) { | |
22645 | dev = &(DRM(device)[i]); | |
22646 | break; | |
22647 | } | |
22648 | diff -Nru a/drivers/char/drm/drm_fops.h b/drivers/char/drm/drm_fops.h | |
22649 | --- a/drivers/char/drm/drm_fops.h Thu Jul 10 23:18:01 2003 | |
22650 | +++ b/drivers/char/drm/drm_fops.h Tue Aug 26 09:25:41 2003 | |
22651 | @@ -51,7 +51,7 @@ | |
22652 | */ | |
22653 | int DRM(open_helper)(struct inode *inode, struct file *filp, drm_device_t *dev) | |
22654 | { | |
22655 | - int minor = minor(inode->i_rdev); | |
22656 | + int minor = iminor(inode); | |
22657 | drm_file_t *priv; | |
22658 | ||
22659 | if (filp->f_flags & O_EXCL) return -EBUSY; /* No exclusive opens */ | |
22660 | diff -Nru a/drivers/char/drm/drm_stub.h b/drivers/char/drm/drm_stub.h | |
22661 | --- a/drivers/char/drm/drm_stub.h Thu Jul 10 23:18:01 2003 | |
22662 | +++ b/drivers/char/drm/drm_stub.h Tue Aug 26 09:25:41 2003 | |
22663 | @@ -62,7 +62,7 @@ | |
22664 | */ | |
22665 | static int DRM(stub_open)(struct inode *inode, struct file *filp) | |
22666 | { | |
22667 | - int minor = minor(inode->i_rdev); | |
22668 | + int minor = iminor(inode); | |
22669 | int err = -ENODEV; | |
22670 | struct file_operations *old_fops; | |
22671 | ||
22672 | diff -Nru a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c | |
22673 | --- a/drivers/char/dsp56k.c Wed May 7 08:47:29 2003 | |
22674 | +++ b/drivers/char/dsp56k.c Tue Aug 26 09:25:41 2003 | |
22675 | @@ -207,7 +207,7 @@ | |
22676 | loff_t *ppos) | |
22677 | { | |
22678 | struct inode *inode = file->f_dentry->d_inode; | |
22679 | - int dev = minor(inode->i_rdev) & 0x0f; | |
22680 | + int dev = iminor(inode) & 0x0f; | |
22681 | ||
22682 | switch(dev) | |
22683 | { | |
22684 | @@ -270,7 +270,7 @@ | |
22685 | loff_t *ppos) | |
22686 | { | |
22687 | struct inode *inode = file->f_dentry->d_inode; | |
22688 | - int dev = minor(inode->i_rdev) & 0x0f; | |
22689 | + int dev = iminor(inode) & 0x0f; | |
22690 | ||
22691 | switch(dev) | |
22692 | { | |
22693 | @@ -331,7 +331,7 @@ | |
22694 | static int dsp56k_ioctl(struct inode *inode, struct file *file, | |
22695 | unsigned int cmd, unsigned long arg) | |
22696 | { | |
22697 | - int dev = minor(inode->i_rdev) & 0x0f; | |
22698 | + int dev = iminor(inode) & 0x0f; | |
22699 | ||
22700 | switch(dev) | |
22701 | { | |
22702 | @@ -424,7 +424,7 @@ | |
22703 | #if 0 | |
22704 | static unsigned int dsp56k_poll(struct file *file, poll_table *wait) | |
22705 | { | |
22706 | - int dev = minor(file->f_dentry->d_inode->i_rdev) & 0x0f; | |
22707 | + int dev = iminor(file->f_dentry->d_inode) & 0x0f; | |
22708 | ||
22709 | switch(dev) | |
22710 | { | |
22711 | @@ -441,7 +441,7 @@ | |
22712 | ||
22713 | static int dsp56k_open(struct inode *inode, struct file *file) | |
22714 | { | |
22715 | - int dev = minor(inode->i_rdev) & 0x0f; | |
22716 | + int dev = iminor(inode) & 0x0f; | |
22717 | ||
22718 | switch(dev) | |
22719 | { | |
22720 | @@ -472,7 +472,7 @@ | |
22721 | ||
22722 | static int dsp56k_release(struct inode *inode, struct file *file) | |
22723 | { | |
22724 | - int dev = minor(inode->i_rdev) & 0x0f; | |
22725 | + int dev = iminor(inode) & 0x0f; | |
22726 | ||
22727 | switch(dev) | |
22728 | { | |
22729 | diff -Nru a/drivers/char/dtlk.c b/drivers/char/dtlk.c | |
22730 | --- a/drivers/char/dtlk.c Fri Jul 11 06:34:28 2003 | |
22731 | +++ b/drivers/char/dtlk.c Tue Aug 26 09:25:41 2003 | |
22732 | @@ -125,7 +125,7 @@ | |
22733 | static ssize_t dtlk_read(struct file *file, char *buf, | |
22734 | size_t count, loff_t * ppos) | |
22735 | { | |
22736 | - unsigned int minor = minor(file->f_dentry->d_inode->i_rdev); | |
22737 | + unsigned int minor = iminor(file->f_dentry->d_inode); | |
22738 | char ch; | |
22739 | int i = 0, retries; | |
22740 | ||
22741 | @@ -185,7 +185,7 @@ | |
22742 | if (ppos != &file->f_pos) | |
22743 | return -ESPIPE; | |
22744 | ||
22745 | - if (minor(file->f_dentry->d_inode->i_rdev) != DTLK_MINOR) | |
22746 | + if (iminor(file->f_dentry->d_inode) != DTLK_MINOR) | |
22747 | return -EINVAL; | |
22748 | ||
22749 | while (1) { | |
22750 | @@ -304,7 +304,7 @@ | |
22751 | { | |
22752 | TRACE_TEXT("(dtlk_open"); | |
22753 | ||
22754 | - switch (minor(inode->i_rdev)) { | |
22755 | + switch (iminor(inode)) { | |
22756 | case DTLK_MINOR: | |
22757 | if (dtlk_busy) | |
22758 | return -EBUSY; | |
22759 | @@ -319,7 +319,7 @@ | |
22760 | { | |
22761 | TRACE_TEXT("(dtlk_release"); | |
22762 | ||
22763 | - switch (minor(inode->i_rdev)) { | |
22764 | + switch (iminor(inode)) { | |
22765 | case DTLK_MINOR: | |
22766 | break; | |
22767 | ||
22768 | diff -Nru a/drivers/char/epca.c b/drivers/char/epca.c | |
22769 | --- a/drivers/char/epca.c Thu Jul 31 08:58:45 2003 | |
22770 | +++ b/drivers/char/epca.c Sun Aug 31 16:01:49 2003 | |
22771 | @@ -40,6 +40,7 @@ | |
22772 | #include <linux/tty_flip.h> | |
22773 | #include <linux/slab.h> | |
22774 | #include <linux/ioport.h> | |
22775 | +#include <linux/interrupt.h> | |
22776 | #include <asm/uaccess.h> | |
22777 | #include <asm/io.h> | |
22778 | ||
22779 | diff -Nru a/drivers/char/ftape/lowlevel/fdc-io.c b/drivers/char/ftape/lowlevel/fdc-io.c | |
22780 | --- a/drivers/char/ftape/lowlevel/fdc-io.c Tue Jul 15 10:01:29 2003 | |
22781 | +++ b/drivers/char/ftape/lowlevel/fdc-io.c Sun Aug 31 16:13:58 2003 | |
22782 | @@ -1305,7 +1305,7 @@ | |
22783 | } else { | |
22784 | TRACE(ft_t_bug, "Unexpected ftape interrupt"); | |
22785 | } | |
22786 | - return IRQ_RETVAL(handled); | |
22787 | + TRACE_EXIT IRQ_RETVAL(handled); | |
22788 | } | |
22789 | ||
22790 | int fdc_grab_irq_and_dma(void) | |
22791 | diff -Nru a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c | |
22792 | --- a/drivers/char/ftape/zftape/zftape-init.c Tue Jul 15 10:01:29 2003 | |
22793 | +++ b/drivers/char/ftape/zftape/zftape-init.c Tue Aug 26 09:25:41 2003 | |
22794 | @@ -110,11 +110,11 @@ | |
22795 | int result; | |
22796 | TRACE_FUN(ft_t_flow); | |
22797 | ||
22798 | - TRACE(ft_t_flow, "called for minor %d", minor(ino->i_rdev)); | |
22799 | + TRACE(ft_t_flow, "called for minor %d", iminor(ino)); | |
22800 | if ( test_and_set_bit(0,&busy_flag) ) { | |
22801 | TRACE_ABORT(-EBUSY, ft_t_warn, "failed: already busy"); | |
22802 | } | |
22803 | - if ((minor(ino->i_rdev) & ~(ZFT_MINOR_OP_MASK | FTAPE_NO_REWIND)) | |
22804 | + if ((iminor(ino) & ~(ZFT_MINOR_OP_MASK | FTAPE_NO_REWIND)) | |
22805 | > | |
22806 | FTAPE_SEL_D) { | |
22807 | clear_bit(0,&busy_flag); | |
22808 | @@ -122,7 +122,7 @@ | |
22809 | } | |
22810 | orig_sigmask = current->blocked; | |
22811 | sigfillset(¤t->blocked); | |
22812 | - result = _zft_open(minor(ino->i_rdev), filep->f_flags & O_ACCMODE); | |
22813 | + result = _zft_open(iminor(ino), filep->f_flags & O_ACCMODE); | |
22814 | if (result < 0) { | |
22815 | current->blocked = orig_sigmask; /* restore mask */ | |
22816 | clear_bit(0,&busy_flag); | |
22817 | @@ -144,7 +144,7 @@ | |
22818 | int result; | |
22819 | TRACE_FUN(ft_t_flow); | |
22820 | ||
22821 | - if ( !test_bit(0,&busy_flag) || minor(ino->i_rdev) != zft_unit) { | |
22822 | + if ( !test_bit(0,&busy_flag) || iminor(ino) != zft_unit) { | |
22823 | TRACE(ft_t_err, "failed: not busy or wrong unit"); | |
22824 | TRACE_EXIT 0; | |
22825 | } | |
22826 | @@ -167,7 +167,7 @@ | |
22827 | sigset_t old_sigmask; | |
22828 | TRACE_FUN(ft_t_flow); | |
22829 | ||
22830 | - if ( !test_bit(0,&busy_flag) || minor(ino->i_rdev) != zft_unit || ft_failure) { | |
22831 | + if ( !test_bit(0,&busy_flag) || iminor(ino) != zft_unit || ft_failure) { | |
22832 | TRACE_ABORT(-EIO, ft_t_err, | |
22833 | "failed: not busy, failure or wrong unit"); | |
22834 | } | |
22835 | @@ -188,7 +188,7 @@ | |
22836 | TRACE_FUN(ft_t_flow); | |
22837 | ||
22838 | if ( !test_bit(0,&busy_flag) || | |
22839 | - minor(filep->f_dentry->d_inode->i_rdev) != zft_unit || | |
22840 | + iminor(filep->f_dentry->d_inode) != zft_unit || | |
22841 | ft_failure) | |
22842 | { | |
22843 | TRACE_ABORT(-EIO, ft_t_err, | |
22844 | @@ -217,7 +217,7 @@ | |
22845 | TRACE_FUN(ft_t_flow); | |
22846 | ||
22847 | TRACE(ft_t_data_flow, "called with count: %ld", (unsigned long)req_len); | |
22848 | - if (!test_bit(0,&busy_flag) || minor(ino->i_rdev) != zft_unit || ft_failure) { | |
22849 | + if (!test_bit(0,&busy_flag) || iminor(ino) != zft_unit || ft_failure) { | |
22850 | TRACE_ABORT(-EIO, ft_t_err, | |
22851 | "failed: not busy, failure or wrong unit"); | |
22852 | } | |
22853 | @@ -240,7 +240,7 @@ | |
22854 | TRACE_FUN(ft_t_flow); | |
22855 | ||
22856 | TRACE(ft_t_flow, "called with count: %ld", (unsigned long)req_len); | |
22857 | - if (!test_bit(0,&busy_flag) || minor(ino->i_rdev) != zft_unit || ft_failure) { | |
22858 | + if (!test_bit(0,&busy_flag) || iminor(ino) != zft_unit || ft_failure) { | |
22859 | TRACE_ABORT(-EIO, ft_t_err, | |
22860 | "failed: not busy, failure or wrong unit"); | |
22861 | } | |
22862 | diff -Nru a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c | |
22863 | --- a/drivers/char/generic_serial.c Wed Jun 11 12:32:33 2003 | |
22864 | +++ b/drivers/char/generic_serial.c Sun Aug 31 16:09:23 2003 | |
22865 | @@ -25,6 +25,7 @@ | |
22866 | #include <linux/serial.h> | |
22867 | #include <linux/mm.h> | |
22868 | #include <linux/generic_serial.h> | |
22869 | +#include <linux/interrupt.h> | |
22870 | #include <asm/semaphore.h> | |
22871 | #include <asm/uaccess.h> | |
22872 | ||
22873 | diff -Nru a/drivers/char/ip2main.c b/drivers/char/ip2main.c | |
22874 | --- a/drivers/char/ip2main.c Mon Jul 14 06:47:09 2003 | |
22875 | +++ b/drivers/char/ip2main.c Tue Aug 26 09:25:41 2003 | |
22876 | @@ -2733,7 +2733,7 @@ | |
22877 | ssize_t | |
22878 | ip2_ipl_read(struct file *pFile, char *pData, size_t count, loff_t *off ) | |
22879 | { | |
22880 | - unsigned int minor = minor( pFile->f_dentry->d_inode->i_rdev ); | |
22881 | + unsigned int minor = iminor(pFile->f_dentry->d_inode); | |
22882 | int rc = 0; | |
22883 | ||
22884 | #ifdef IP2DEBUG_IPL | |
22885 | @@ -2863,7 +2863,7 @@ | |
22886 | static int | |
22887 | ip2_ipl_ioctl ( struct inode *pInode, struct file *pFile, UINT cmd, ULONG arg ) | |
22888 | { | |
22889 | - unsigned int iplminor = minor(pInode->i_rdev); | |
22890 | + unsigned int iplminor = iminor(pInode); | |
22891 | int rc = 0; | |
22892 | ULONG *pIndex = (ULONG*)arg; | |
22893 | i2eBordStrPtr pB = i2BoardPtrTable[iplminor / 4]; | |
22894 | @@ -2998,7 +2998,7 @@ | |
22895 | static int | |
22896 | ip2_ipl_open( struct inode *pInode, struct file *pFile ) | |
22897 | { | |
22898 | - unsigned int iplminor = minor(pInode->i_rdev); | |
22899 | + unsigned int iplminor = iminor(pInode); | |
22900 | i2eBordStrPtr pB; | |
22901 | i2ChanStrPtr pCh; | |
22902 | ||
22903 | diff -Nru a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c | |
22904 | --- a/drivers/char/ipmi/ipmi_devintf.c Wed May 7 08:47:29 2003 | |
22905 | +++ b/drivers/char/ipmi/ipmi_devintf.c Tue Aug 26 09:25:41 2003 | |
22906 | @@ -110,7 +110,7 @@ | |
22907 | ||
22908 | static int ipmi_open(struct inode *inode, struct file *file) | |
22909 | { | |
22910 | - int if_num = minor(inode->i_rdev); | |
22911 | + int if_num = iminor(inode); | |
22912 | int rv; | |
22913 | struct ipmi_file_private *priv; | |
22914 | ||
22915 | diff -Nru a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c | |
22916 | --- a/drivers/char/ipmi/ipmi_watchdog.c Mon Aug 11 04:34:37 2003 | |
22917 | +++ b/drivers/char/ipmi/ipmi_watchdog.c Tue Aug 26 09:25:41 2003 | |
22918 | @@ -645,7 +645,7 @@ | |
22919 | ||
22920 | static int ipmi_open(struct inode *ino, struct file *filep) | |
22921 | { | |
22922 | - switch (minor(ino->i_rdev)) | |
22923 | + switch (iminor(ino)) | |
22924 | { | |
22925 | case WATCHDOG_MINOR: | |
22926 | if (ipmi_wdog_open) | |
22927 | @@ -688,7 +688,7 @@ | |
22928 | ||
22929 | static int ipmi_close(struct inode *ino, struct file *filep) | |
22930 | { | |
22931 | - if (minor(ino->i_rdev)==WATCHDOG_MINOR) | |
22932 | + if (iminor(ino)==WATCHDOG_MINOR) | |
22933 | { | |
22934 | #ifndef CONFIG_WATCHDOG_NOWAYOUT | |
22935 | ipmi_watchdog_state = WDOG_TIMEOUT_NONE; | |
22936 | diff -Nru a/drivers/char/istallion.c b/drivers/char/istallion.c | |
22937 | --- a/drivers/char/istallion.c Mon Jun 23 18:43:58 2003 | |
22938 | +++ b/drivers/char/istallion.c Tue Aug 26 09:25:41 2003 | |
22939 | @@ -4805,7 +4805,7 @@ | |
22940 | (int) fp, (int) buf, count, (int) offp); | |
22941 | #endif | |
22942 | ||
22943 | - brdnr = minor(fp->f_dentry->d_inode->i_rdev); | |
22944 | + brdnr = iminor(fp->f_dentry->d_inode); | |
22945 | if (brdnr >= stli_nrbrds) | |
22946 | return(-ENODEV); | |
22947 | brdp = stli_brds[brdnr]; | |
22948 | @@ -4860,7 +4860,7 @@ | |
22949 | (int) fp, (int) buf, count, (int) offp); | |
22950 | #endif | |
22951 | ||
22952 | - brdnr = minor(fp->f_dentry->d_inode->i_rdev); | |
22953 | + brdnr = iminor(fp->f_dentry->d_inode); | |
22954 | if (brdnr >= stli_nrbrds) | |
22955 | return(-ENODEV); | |
22956 | brdp = stli_brds[brdnr]; | |
22957 | @@ -5201,7 +5201,7 @@ | |
22958 | * Now handle the board specific ioctls. These all depend on the | |
22959 | * minor number of the device they were called from. | |
22960 | */ | |
22961 | - brdnr = minor(ip->i_rdev); | |
22962 | + brdnr = iminor(ip); | |
22963 | if (brdnr >= STL_MAXBRDS) | |
22964 | return(-ENODEV); | |
22965 | brdp = stli_brds[brdnr]; | |
22966 | diff -Nru a/drivers/char/ite_gpio.c b/drivers/char/ite_gpio.c | |
22967 | --- a/drivers/char/ite_gpio.c Thu Mar 6 14:03:51 2003 | |
22968 | +++ b/drivers/char/ite_gpio.c Tue Aug 26 09:25:41 2003 | |
22969 | @@ -238,7 +238,7 @@ | |
22970 | ||
22971 | static int ite_gpio_open(struct inode *inode, struct file *file) | |
22972 | { | |
22973 | - unsigned int minor = minor(inode->i_rdev); | |
22974 | + unsigned int minor = iminor(inode); | |
22975 | if (minor != GPIO_MINOR) | |
22976 | return -ENODEV; | |
22977 | ||
22978 | diff -Nru a/drivers/char/lcd.c b/drivers/char/lcd.c | |
22979 | --- a/drivers/char/lcd.c Wed May 29 12:05:13 2002 | |
22980 | +++ b/drivers/char/lcd.c Sun Aug 31 16:14:08 2003 | |
22981 | @@ -551,9 +551,9 @@ | |
22982 | */ | |
22983 | ||
22984 | static struct file_operations lcd_fops = { | |
22985 | - read: lcd_read, | |
22986 | - ioctl: lcd_ioctl, | |
22987 | - open: lcd_open, | |
22988 | + .read = lcd_read, | |
22989 | + .ioctl = lcd_ioctl, | |
22990 | + .open = lcd_open, | |
22991 | }; | |
22992 | ||
22993 | static struct miscdevice lcd_dev= | |
22994 | diff -Nru a/drivers/char/lp.c b/drivers/char/lp.c | |
22995 | --- a/drivers/char/lp.c Wed May 7 08:47:29 2003 | |
22996 | +++ b/drivers/char/lp.c Wed Sep 3 23:40:14 2003 | |
22997 | @@ -292,7 +292,7 @@ | |
22998 | static ssize_t lp_write(struct file * file, const char * buf, | |
22999 | size_t count, loff_t *ppos) | |
23000 | { | |
23001 | - unsigned int minor = minor(file->f_dentry->d_inode->i_rdev); | |
23002 | + unsigned int minor = iminor(file->f_dentry->d_inode); | |
23003 | struct parport *port = lp_table[minor].dev->port; | |
23004 | char *kbuf = lp_table[minor].lp_buffer; | |
23005 | ssize_t retv = 0; | |
23006 | @@ -408,7 +408,7 @@ | |
23007 | static ssize_t lp_read(struct file * file, char * buf, | |
23008 | size_t count, loff_t *ppos) | |
23009 | { | |
23010 | - unsigned int minor=minor(file->f_dentry->d_inode->i_rdev); | |
23011 | + unsigned int minor=iminor(file->f_dentry->d_inode); | |
23012 | struct parport *port = lp_table[minor].dev->port; | |
23013 | ssize_t retval = 0; | |
23014 | char *kbuf = lp_table[minor].lp_buffer; | |
23015 | @@ -483,7 +483,7 @@ | |
23016 | ||
23017 | static int lp_open(struct inode * inode, struct file * file) | |
23018 | { | |
23019 | - unsigned int minor = minor(inode->i_rdev); | |
23020 | + unsigned int minor = iminor(inode); | |
23021 | ||
23022 | if (minor >= LP_NO) | |
23023 | return -ENXIO; | |
23024 | @@ -540,7 +540,7 @@ | |
23025 | ||
23026 | static int lp_release(struct inode * inode, struct file * file) | |
23027 | { | |
23028 | - unsigned int minor = minor(inode->i_rdev); | |
23029 | + unsigned int minor = iminor(inode); | |
23030 | ||
23031 | lp_claim_parport_or_block (&lp_table[minor]); | |
23032 | parport_negotiate (lp_table[minor].dev->port, IEEE1284_MODE_COMPAT); | |
23033 | @@ -555,7 +555,7 @@ | |
23034 | static int lp_ioctl(struct inode *inode, struct file *file, | |
23035 | unsigned int cmd, unsigned long arg) | |
23036 | { | |
23037 | - unsigned int minor = minor(inode->i_rdev); | |
23038 | + unsigned int minor = iminor(inode); | |
23039 | int status; | |
23040 | int retval = 0; | |
23041 | ||
23042 | @@ -965,4 +965,5 @@ | |
23043 | module_init(lp_init_module); | |
23044 | module_exit(lp_cleanup_module); | |
23045 | ||
23046 | +MODULE_ALIAS("char-major-" __stringify(LP_MAJOR)); | |
23047 | MODULE_LICENSE("GPL"); | |
23048 | diff -Nru a/drivers/char/lp_old98.c b/drivers/char/lp_old98.c | |
23049 | --- a/drivers/char/lp_old98.c Thu Apr 24 03:30:40 2003 | |
23050 | +++ b/drivers/char/lp_old98.c Tue Aug 26 09:25:41 2003 | |
23051 | @@ -219,7 +219,7 @@ | |
23052 | ||
23053 | static int lp_old98_open(struct inode * inode, struct file * file) | |
23054 | { | |
23055 | - if (minor(inode->i_rdev) != 0) | |
23056 | + if (iminor(inode) != 0) | |
23057 | return -ENXIO; | |
23058 | ||
23059 | if (lp.flags & LP_BUSY) | |
23060 | diff -Nru a/drivers/char/mem.c b/drivers/char/mem.c | |
23061 | --- a/drivers/char/mem.c Tue Jun 10 23:33:17 2003 | |
23062 | +++ b/drivers/char/mem.c Tue Aug 26 09:25:41 2003 | |
23063 | @@ -607,7 +607,7 @@ | |
23064 | ||
23065 | static int memory_open(struct inode * inode, struct file * filp) | |
23066 | { | |
23067 | - switch (minor(inode->i_rdev)) { | |
23068 | + switch (iminor(inode)) { | |
23069 | case 1: | |
23070 | filp->f_op = &mem_fops; | |
23071 | break; | |
23072 | diff -Nru a/drivers/char/misc.c b/drivers/char/misc.c | |
23073 | --- a/drivers/char/misc.c Sat May 17 12:39:13 2003 | |
23074 | +++ b/drivers/char/misc.c Tue Aug 26 09:25:41 2003 | |
23075 | @@ -100,7 +100,7 @@ | |
23076 | ||
23077 | static int misc_open(struct inode * inode, struct file * file) | |
23078 | { | |
23079 | - int minor = minor(inode->i_rdev); | |
23080 | + int minor = iminor(inode); | |
23081 | struct miscdevice *c; | |
23082 | int err = -ENODEV; | |
23083 | struct file_operations *old_fops, *new_fops = NULL; | |
23084 | diff -Nru a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c | |
23085 | --- a/drivers/char/n_hdlc.c Fri May 30 19:53:01 2003 | |
23086 | +++ b/drivers/char/n_hdlc.c Wed Sep 3 23:40:16 2003 | |
23087 | @@ -182,9 +182,9 @@ | |
23088 | ||
23089 | /* TTY callbacks */ | |
23090 | ||
23091 | -static int n_hdlc_tty_read(struct tty_struct *tty, struct file *file, | |
23092 | +static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file, | |
23093 | __u8 *buf, size_t nr); | |
23094 | -static int n_hdlc_tty_write(struct tty_struct *tty, struct file *file, | |
23095 | +static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file, | |
23096 | const __u8 *buf, size_t nr); | |
23097 | static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file, | |
23098 | unsigned int cmd, unsigned long arg); | |
23099 | @@ -572,7 +572,7 @@ | |
23100 | * | |
23101 | * Returns the number of bytes returned or error code. | |
23102 | */ | |
23103 | -static int n_hdlc_tty_read(struct tty_struct *tty, struct file *file, | |
23104 | +static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file, | |
23105 | __u8 *buf, size_t nr) | |
23106 | { | |
23107 | struct n_hdlc *n_hdlc = tty2n_hdlc(tty); | |
23108 | @@ -649,7 +649,7 @@ | |
23109 | * | |
23110 | * Returns the number of bytes written (or error code). | |
23111 | */ | |
23112 | -static int n_hdlc_tty_write(struct tty_struct *tty, struct file *file, | |
23113 | +static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file, | |
23114 | const __u8 *data, size_t count) | |
23115 | { | |
23116 | struct n_hdlc *n_hdlc = tty2n_hdlc (tty); | |
23117 | @@ -658,7 +658,7 @@ | |
23118 | struct n_hdlc_buf *tbuf; | |
23119 | ||
23120 | if (debuglevel >= DEBUG_LEVEL_INFO) | |
23121 | - printk("%s(%d)n_hdlc_tty_write() called count=%d\n", | |
23122 | + printk("%s(%d)n_hdlc_tty_write() called count=%Zd\n", | |
23123 | __FILE__,__LINE__,count); | |
23124 | ||
23125 | /* Verify pointers */ | |
23126 | @@ -673,7 +673,7 @@ | |
23127 | if (debuglevel & DEBUG_LEVEL_INFO) | |
23128 | printk (KERN_WARNING | |
23129 | "n_hdlc_tty_write: truncating user packet " | |
23130 | - "from %lu to %d\n", (unsigned long) count, | |
23131 | + "from %lu to %Zd\n", (unsigned long) count, | |
23132 | maxframe ); | |
23133 | count = maxframe; | |
23134 | } | |
23135 | @@ -982,3 +982,4 @@ | |
23136 | MODULE_AUTHOR("Paul Fulghum paulkf@microgate.com"); | |
23137 | MODULE_PARM(debuglevel, "i"); | |
23138 | MODULE_PARM(maxframe, "i"); | |
23139 | +MODULE_ALIAS_LDISC(N_HDLC); | |
23140 | diff -Nru a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c | |
23141 | --- a/drivers/char/n_r3964.c Tue Jul 15 10:01:29 2003 | |
23142 | +++ b/drivers/char/n_r3964.c Wed Sep 3 23:40:16 2003 | |
23143 | @@ -1428,4 +1428,4 @@ | |
23144 | ||
23145 | ||
23146 | MODULE_LICENSE("GPL"); | |
23147 | - | |
23148 | +MODULE_ALIAS_LDISC(N_R3964); | |
23149 | diff -Nru a/drivers/char/nvram.c b/drivers/char/nvram.c | |
23150 | --- a/drivers/char/nvram.c Tue Feb 25 10:47:17 2003 | |
23151 | +++ b/drivers/char/nvram.c Wed Sep 3 23:40:14 2003 | |
23152 | @@ -923,3 +923,4 @@ | |
23153 | EXPORT_SYMBOL(nvram_check_checksum); | |
23154 | EXPORT_SYMBOL(__nvram_set_checksum); | |
23155 | EXPORT_SYMBOL(nvram_set_checksum); | |
23156 | +MODULE_ALIAS_MISCDEV(NVRAM_MINOR); | |
23157 | diff -Nru a/drivers/char/pcxx.c b/drivers/char/pcxx.c | |
23158 | --- a/drivers/char/pcxx.c Wed Aug 20 14:20:10 2003 | |
23159 | +++ b/drivers/char/pcxx.c Sun Aug 31 16:14:07 2003 | |
23160 | @@ -121,7 +121,7 @@ | |
23161 | MODULE_PARM(altpin, "1-4i"); | |
23162 | MODULE_PARM(numports, "1-4i"); | |
23163 | ||
23164 | -#endif MODULE | |
23165 | +#endif /* MODULE */ | |
23166 | ||
23167 | static int numcards = 1; | |
23168 | static int nbdevs = 0; | |
23169 | diff -Nru a/drivers/char/ppdev.c b/drivers/char/ppdev.c | |
23170 | --- a/drivers/char/ppdev.c Wed May 7 08:47:29 2003 | |
23171 | +++ b/drivers/char/ppdev.c Tue Aug 26 09:25:41 2003 | |
23172 | @@ -104,7 +104,7 @@ | |
23173 | static ssize_t pp_read (struct file * file, char * buf, size_t count, | |
23174 | loff_t * ppos) | |
23175 | { | |
23176 | - unsigned int minor = minor (file->f_dentry->d_inode->i_rdev); | |
23177 | + unsigned int minor = iminor(file->f_dentry->d_inode); | |
23178 | struct pp_struct *pp = file->private_data; | |
23179 | char * kbuffer; | |
23180 | ssize_t bytes_read = 0; | |
23181 | @@ -187,7 +187,7 @@ | |
23182 | static ssize_t pp_write (struct file * file, const char * buf, size_t count, | |
23183 | loff_t * ppos) | |
23184 | { | |
23185 | - unsigned int minor = minor (file->f_dentry->d_inode->i_rdev); | |
23186 | + unsigned int minor = iminor(file->f_dentry->d_inode); | |
23187 | struct pp_struct *pp = file->private_data; | |
23188 | char * kbuffer; | |
23189 | ssize_t bytes_written = 0; | |
23190 | @@ -330,7 +330,7 @@ | |
23191 | static int pp_ioctl(struct inode *inode, struct file *file, | |
23192 | unsigned int cmd, unsigned long arg) | |
23193 | { | |
23194 | - unsigned int minor = minor(inode->i_rdev); | |
23195 | + unsigned int minor = iminor(inode); | |
23196 | struct pp_struct *pp = file->private_data; | |
23197 | struct parport * port; | |
23198 | ||
23199 | @@ -638,7 +638,7 @@ | |
23200 | ||
23201 | static int pp_open (struct inode * inode, struct file * file) | |
23202 | { | |
23203 | - unsigned int minor = minor (inode->i_rdev); | |
23204 | + unsigned int minor = iminor(inode); | |
23205 | struct pp_struct *pp; | |
23206 | ||
23207 | if (minor >= PARPORT_MAX) | |
23208 | @@ -667,7 +667,7 @@ | |
23209 | ||
23210 | static int pp_release (struct inode * inode, struct file * file) | |
23211 | { | |
23212 | - unsigned int minor = minor (inode->i_rdev); | |
23213 | + unsigned int minor = iminor(inode); | |
23214 | struct pp_struct *pp = file->private_data; | |
23215 | int compat_negot; | |
23216 | ||
23217 | diff -Nru a/drivers/char/pty.c b/drivers/char/pty.c | |
23218 | --- a/drivers/char/pty.c Wed Jun 11 12:33:13 2003 | |
23219 | +++ b/drivers/char/pty.c Wed Sep 3 23:40:19 2003 | |
23220 | @@ -354,7 +354,7 @@ | |
23221 | pty_slave_driver->init_termios = tty_std_termios; | |
23222 | pty_slave_driver->init_termios.c_cflag = B38400 | CS8 | CREAD; | |
23223 | pty_slave_driver->flags = TTY_DRIVER_RESET_TERMIOS | | |
23224 | - TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS; | |
23225 | + TTY_DRIVER_REAL_RAW; | |
23226 | pty_slave_driver->other = pty_driver; | |
23227 | tty_set_operations(pty_slave_driver, &pty_ops); | |
23228 | ||
23229 | diff -Nru a/drivers/char/random.c b/drivers/char/random.c | |
23230 | --- a/drivers/char/random.c Wed Aug 6 10:59:31 2003 | |
23231 | +++ b/drivers/char/random.c Sun Aug 31 16:13:54 2003 | |
23232 | @@ -269,9 +269,9 @@ | |
23233 | ||
23234 | /* | |
23235 | * The minimum number of bits of entropy before we wake up a read on | |
23236 | - * /dev/random. Should always be at least 8, or at least 1 byte. | |
23237 | + * /dev/random. Should be enough to do a significant reseed. | |
23238 | */ | |
23239 | -static int random_read_wakeup_thresh = 8; | |
23240 | +static int random_read_wakeup_thresh = 64; | |
23241 | ||
23242 | /* | |
23243 | * If the entropy count falls under this number of bits, then we | |
23244 | @@ -483,9 +483,9 @@ | |
23245 | unsigned add_ptr; | |
23246 | int entropy_count; | |
23247 | int input_rotate; | |
23248 | - int extract_count; | |
23249 | struct poolinfo poolinfo; | |
23250 | __u32 *pool; | |
23251 | + spinlock_t lock; | |
23252 | }; | |
23253 | ||
23254 | /* | |
23255 | @@ -502,7 +502,7 @@ | |
23256 | ||
23257 | poolwords = (size + 3) / 4; /* Convert bytes->words */ | |
23258 | /* The pool size must be a multiple of 16 32-bit words */ | |
23259 | - poolwords = ((poolwords + 15) / 16) * 16; | |
23260 | + poolwords = ((poolwords + 15) / 16) * 16; | |
23261 | ||
23262 | for (p = poolinfo_table; p->poolwords; p++) { | |
23263 | if (poolwords == p->poolwords) | |
23264 | @@ -524,6 +524,7 @@ | |
23265 | return -ENOMEM; | |
23266 | } | |
23267 | memset(r->pool, 0, POOLBYTES); | |
23268 | + r->lock = SPIN_LOCK_UNLOCKED; | |
23269 | *ret_bucket = r; | |
23270 | return 0; | |
23271 | } | |
23272 | @@ -534,7 +535,6 @@ | |
23273 | r->add_ptr = 0; | |
23274 | r->entropy_count = 0; | |
23275 | r->input_rotate = 0; | |
23276 | - r->extract_count = 0; | |
23277 | memset(r->pool, 0, r->poolinfo.POOLBYTES); | |
23278 | } | |
23279 | #ifdef CONFIG_SYSCTL | |
23280 | @@ -565,6 +565,9 @@ | |
23281 | int new_rotate; | |
23282 | int wordmask = r->poolinfo.poolwords - 1; | |
23283 | __u32 w; | |
23284 | + unsigned long flags; | |
23285 | + | |
23286 | + spin_lock_irqsave(&r->lock, flags); | |
23287 | ||
23288 | while (nwords--) { | |
23289 | w = rotate_left(r->input_rotate, *in++); | |
23290 | @@ -589,6 +592,8 @@ | |
23291 | w ^= r->pool[i]; | |
23292 | r->pool[i] = (w >> 3) ^ twist_table[w & 7]; | |
23293 | } | |
23294 | + | |
23295 | + spin_unlock_irqrestore(&r->lock, flags); | |
23296 | } | |
23297 | ||
23298 | /* | |
23299 | @@ -596,6 +601,10 @@ | |
23300 | */ | |
23301 | static void credit_entropy_store(struct entropy_store *r, int nbits) | |
23302 | { | |
23303 | + unsigned long flags; | |
23304 | + | |
23305 | + spin_lock_irqsave(&r->lock, flags); | |
23306 | + | |
23307 | if (r->entropy_count + nbits < 0) { | |
23308 | DEBUG_ENT("negative entropy/overflow (%d+%d)\n", | |
23309 | r->entropy_count, nbits); | |
23310 | @@ -605,11 +614,15 @@ | |
23311 | } else { | |
23312 | r->entropy_count += nbits; | |
23313 | if (nbits) | |
23314 | - DEBUG_ENT("%s added %d bits, now %d\n", | |
23315 | + DEBUG_ENT("%04d %04d : added %d bits to %s\n", | |
23316 | + random_state->entropy_count, | |
23317 | + sec_random_state->entropy_count, | |
23318 | + nbits, | |
23319 | r == sec_random_state ? "secondary" : | |
23320 | - r == random_state ? "primary" : "unknown", | |
23321 | - nbits, r->entropy_count); | |
23322 | + r == random_state ? "primary" : "unknown"); | |
23323 | } | |
23324 | + | |
23325 | + spin_unlock_irqrestore(&r->lock, flags); | |
23326 | } | |
23327 | ||
23328 | /********************************************************************** | |
23329 | @@ -620,27 +633,33 @@ | |
23330 | * | |
23331 | **********************************************************************/ | |
23332 | ||
23333 | -static __u32 *batch_entropy_pool; | |
23334 | -static int *batch_entropy_credit; | |
23335 | -static int batch_max; | |
23336 | +struct sample { | |
23337 | + __u32 data[2]; | |
23338 | + int credit; | |
23339 | +}; | |
23340 | + | |
23341 | +static struct sample *batch_entropy_pool, *batch_entropy_copy; | |
23342 | static int batch_head, batch_tail; | |
23343 | +static spinlock_t batch_lock = SPIN_LOCK_UNLOCKED; | |
23344 | + | |
23345 | +static int batch_max; | |
23346 | static void batch_entropy_process(void *private_); | |
23347 | static DECLARE_WORK(batch_work, batch_entropy_process, NULL); | |
23348 | ||
23349 | /* note: the size must be a power of 2 */ | |
23350 | static int __init batch_entropy_init(int size, struct entropy_store *r) | |
23351 | { | |
23352 | - batch_entropy_pool = kmalloc(2*size*sizeof(__u32), GFP_KERNEL); | |
23353 | + batch_entropy_pool = kmalloc(size*sizeof(struct sample), GFP_KERNEL); | |
23354 | if (!batch_entropy_pool) | |
23355 | return -1; | |
23356 | - batch_entropy_credit =kmalloc(size*sizeof(int), GFP_KERNEL); | |
23357 | - if (!batch_entropy_credit) { | |
23358 | + batch_entropy_copy = kmalloc(size*sizeof(struct sample), GFP_KERNEL); | |
23359 | + if (!batch_entropy_copy) { | |
23360 | kfree(batch_entropy_pool); | |
23361 | return -1; | |
23362 | } | |
23363 | batch_head = batch_tail = 0; | |
23364 | - batch_max = size; | |
23365 | batch_work.data = r; | |
23366 | + batch_max = size; | |
23367 | return 0; | |
23368 | } | |
23369 | ||
23370 | @@ -652,27 +671,33 @@ | |
23371 | */ | |
23372 | void batch_entropy_store(u32 a, u32 b, int num) | |
23373 | { | |
23374 | - int new; | |
23375 | + int new; | |
23376 | + unsigned long flags; | |
23377 | ||
23378 | if (!batch_max) | |
23379 | return; | |
23380 | - | |
23381 | - batch_entropy_pool[2*batch_head] = a; | |
23382 | - batch_entropy_pool[(2*batch_head) + 1] = b; | |
23383 | - batch_entropy_credit[batch_head] = num; | |
23384 | ||
23385 | - new = (batch_head+1) & (batch_max-1); | |
23386 | - if ((unsigned)(new - batch_tail) >= (unsigned)(batch_max / 2)) { | |
23387 | + spin_lock_irqsave(&batch_lock, flags); | |
23388 | + | |
23389 | + batch_entropy_pool[batch_head].data[0] = a; | |
23390 | + batch_entropy_pool[batch_head].data[1] = b; | |
23391 | + batch_entropy_pool[batch_head].credit = num; | |
23392 | + | |
23393 | + if (((batch_head - batch_tail) & (batch_max-1)) >= (batch_max / 2)) { | |
23394 | /* | |
23395 | * Schedule it for the next timer tick: | |
23396 | */ | |
23397 | schedule_delayed_work(&batch_work, 1); | |
23398 | - batch_head = new; | |
23399 | - } else if (new == batch_tail) { | |
23400 | + } | |
23401 | + | |
23402 | + new = (batch_head+1) & (batch_max-1); | |
23403 | + if (new == batch_tail) { | |
23404 | DEBUG_ENT("batch entropy buffer full\n"); | |
23405 | } else { | |
23406 | batch_head = new; | |
23407 | } | |
23408 | + | |
23409 | + spin_unlock_irqrestore(&batch_lock, flags); | |
23410 | } | |
23411 | ||
23412 | /* | |
23413 | @@ -684,20 +709,34 @@ | |
23414 | { | |
23415 | struct entropy_store *r = (struct entropy_store *) private_, *p; | |
23416 | int max_entropy = r->poolinfo.POOLBITS; | |
23417 | + unsigned head, tail; | |
23418 | ||
23419 | - if (!batch_max) | |
23420 | - return; | |
23421 | + /* Mixing into the pool is expensive, so copy over the batch | |
23422 | + * data and release the batch lock. The pool is at least half | |
23423 | + * full, so don't worry too much about copying only the used | |
23424 | + * part. | |
23425 | + */ | |
23426 | + spin_lock_irq(&batch_lock); | |
23427 | + | |
23428 | + memcpy(batch_entropy_copy, batch_entropy_pool, | |
23429 | + batch_max*sizeof(struct sample)); | |
23430 | + | |
23431 | + head = batch_head; | |
23432 | + tail = batch_tail; | |
23433 | + batch_tail = batch_head; | |
23434 | + | |
23435 | + spin_unlock_irq(&batch_lock); | |
23436 | ||
23437 | p = r; | |
23438 | - while (batch_head != batch_tail) { | |
23439 | + while (head != tail) { | |
23440 | if (r->entropy_count >= max_entropy) { | |
23441 | r = (r == sec_random_state) ? random_state : | |
23442 | sec_random_state; | |
23443 | max_entropy = r->poolinfo.POOLBITS; | |
23444 | } | |
23445 | - add_entropy_words(r, batch_entropy_pool + 2*batch_tail, 2); | |
23446 | - credit_entropy_store(r, batch_entropy_credit[batch_tail]); | |
23447 | - batch_tail = (batch_tail+1) & (batch_max-1); | |
23448 | + add_entropy_words(r, batch_entropy_copy[tail].data, 2); | |
23449 | + credit_entropy_store(r, batch_entropy_copy[tail].credit); | |
23450 | + tail = (tail+1) & (batch_max-1); | |
23451 | } | |
23452 | if (p->entropy_count >= random_read_wakeup_thresh) | |
23453 | wake_up_interruptible(&random_read_wait); | |
23454 | @@ -1216,6 +1255,7 @@ | |
23455 | ||
23456 | #define EXTRACT_ENTROPY_USER 1 | |
23457 | #define EXTRACT_ENTROPY_SECONDARY 2 | |
23458 | +#define EXTRACT_ENTROPY_LIMIT 4 | |
23459 | #define TMP_BUF_SIZE (HASH_BUFFER_SIZE + HASH_EXTRA_SIZE) | |
23460 | #define SEC_XFER_SIZE (TMP_BUF_SIZE*4) | |
23461 | ||
23462 | @@ -1224,36 +1264,28 @@ | |
23463 | ||
23464 | /* | |
23465 | * This utility inline function is responsible for transfering entropy | |
23466 | - * from the primary pool to the secondary extraction pool. We pull | |
23467 | - * randomness under two conditions; one is if there isn't enough entropy | |
23468 | - * in the secondary pool. The other is after we have extracted 1024 bytes, | |
23469 | - * at which point we do a "catastrophic reseeding". | |
23470 | + * from the primary pool to the secondary extraction pool. We make | |
23471 | + * sure we pull enough for a 'catastrophic reseed'. | |
23472 | */ | |
23473 | static inline void xfer_secondary_pool(struct entropy_store *r, | |
23474 | size_t nbytes, __u32 *tmp) | |
23475 | { | |
23476 | if (r->entropy_count < nbytes * 8 && | |
23477 | r->entropy_count < r->poolinfo.POOLBITS) { | |
23478 | - int nwords = min_t(int, | |
23479 | - r->poolinfo.poolwords - r->entropy_count/32, | |
23480 | - sizeof(tmp) / 4); | |
23481 | + int bytes = max_t(int, random_read_wakeup_thresh / 8, | |
23482 | + min_t(int, nbytes, TMP_BUF_SIZE)); | |
23483 | ||
23484 | - DEBUG_ENT("xfer %d from primary to %s (have %d, need %d)\n", | |
23485 | - nwords * 32, | |
23486 | + DEBUG_ENT("%04d %04d : going to reseed %s with %d bits " | |
23487 | + "(%d of %d requested)\n", | |
23488 | + random_state->entropy_count, | |
23489 | + sec_random_state->entropy_count, | |
23490 | r == sec_random_state ? "secondary" : "unknown", | |
23491 | - r->entropy_count, nbytes * 8); | |
23492 | + bytes * 8, nbytes * 8, r->entropy_count); | |
23493 | ||
23494 | - extract_entropy(random_state, tmp, nwords * 4, 0); | |
23495 | - add_entropy_words(r, tmp, nwords); | |
23496 | - credit_entropy_store(r, nwords * 32); | |
23497 | - } | |
23498 | - if (r->extract_count > 1024) { | |
23499 | - DEBUG_ENT("reseeding %s with %d from primary\n", | |
23500 | - r == sec_random_state ? "secondary" : "unknown", | |
23501 | - sizeof(tmp) * 8); | |
23502 | - extract_entropy(random_state, tmp, sizeof(tmp), 0); | |
23503 | - add_entropy_words(r, tmp, sizeof(tmp) / 4); | |
23504 | - r->extract_count = 0; | |
23505 | + bytes=extract_entropy(random_state, tmp, bytes, | |
23506 | + EXTRACT_ENTROPY_LIMIT); | |
23507 | + add_entropy_words(r, tmp, bytes); | |
23508 | + credit_entropy_store(r, bytes*8); | |
23509 | } | |
23510 | } | |
23511 | ||
23512 | @@ -1276,8 +1308,8 @@ | |
23513 | ssize_t ret, i; | |
23514 | __u32 tmp[TMP_BUF_SIZE]; | |
23515 | __u32 x; | |
23516 | + unsigned long cpuflags; | |
23517 | ||
23518 | - add_timer_randomness(&extract_timer_state, nbytes); | |
23519 | ||
23520 | /* Redundant, but just in case... */ | |
23521 | if (r->entropy_count > r->poolinfo.POOLBITS) | |
23522 | @@ -1286,10 +1318,18 @@ | |
23523 | if (flags & EXTRACT_ENTROPY_SECONDARY) | |
23524 | xfer_secondary_pool(r, nbytes, tmp); | |
23525 | ||
23526 | - DEBUG_ENT("%s has %d bits, want %d bits\n", | |
23527 | + /* Hold lock while accounting */ | |
23528 | + spin_lock_irqsave(&r->lock, cpuflags); | |
23529 | + | |
23530 | + DEBUG_ENT("%04d %04d : trying to extract %d bits from %s\n", | |
23531 | + random_state->entropy_count, | |
23532 | + sec_random_state->entropy_count, | |
23533 | + nbytes * 8, | |
23534 | r == sec_random_state ? "secondary" : | |
23535 | - r == random_state ? "primary" : "unknown", | |
23536 | - r->entropy_count, nbytes * 8); | |
23537 | + r == random_state ? "primary" : "unknown"); | |
23538 | + | |
23539 | + if (flags & EXTRACT_ENTROPY_LIMIT && nbytes >= r->entropy_count / 8) | |
23540 | + nbytes = r->entropy_count / 8; | |
23541 | ||
23542 | if (r->entropy_count / 8 >= nbytes) | |
23543 | r->entropy_count -= nbytes*8; | |
23544 | @@ -1299,8 +1339,16 @@ | |
23545 | if (r->entropy_count < random_write_wakeup_thresh) | |
23546 | wake_up_interruptible(&random_write_wait); | |
23547 | ||
23548 | - r->extract_count += nbytes; | |
23549 | - | |
23550 | + DEBUG_ENT("%04d %04d : debiting %d bits from %s%s\n", | |
23551 | + random_state->entropy_count, | |
23552 | + sec_random_state->entropy_count, | |
23553 | + nbytes * 8, | |
23554 | + r == sec_random_state ? "secondary" : | |
23555 | + r == random_state ? "primary" : "unknown", | |
23556 | + flags & EXTRACT_ENTROPY_LIMIT ? "" : " (unlimited)"); | |
23557 | + | |
23558 | + spin_unlock_irqrestore(&r->lock, cpuflags); | |
23559 | + | |
23560 | ret = 0; | |
23561 | while (nbytes) { | |
23562 | /* | |
23563 | @@ -1312,7 +1360,16 @@ | |
23564 | ret = -ERESTARTSYS; | |
23565 | break; | |
23566 | } | |
23567 | + | |
23568 | + DEBUG_ENT("%04d %04d : extract feeling sleepy (%d bytes left)\n", | |
23569 | + random_state->entropy_count, | |
23570 | + sec_random_state->entropy_count, nbytes); | |
23571 | + | |
23572 | schedule(); | |
23573 | + | |
23574 | + DEBUG_ENT("%04d %04d : extract woke up\n", | |
23575 | + random_state->entropy_count, | |
23576 | + sec_random_state->entropy_count); | |
23577 | } | |
23578 | ||
23579 | /* Hash the pool to get the output */ | |
23580 | @@ -1361,7 +1418,6 @@ | |
23581 | nbytes -= i; | |
23582 | buf += i; | |
23583 | ret += i; | |
23584 | - add_timer_randomness(&extract_timer_state, nbytes); | |
23585 | } | |
23586 | ||
23587 | /* Wipe data just returned from memory */ | |
23588 | @@ -1488,15 +1544,27 @@ | |
23589 | if (nbytes == 0) | |
23590 | return 0; | |
23591 | ||
23592 | - add_wait_queue(&random_read_wait, &wait); | |
23593 | while (nbytes > 0) { | |
23594 | - set_current_state(TASK_INTERRUPTIBLE); | |
23595 | - | |
23596 | n = nbytes; | |
23597 | if (n > SEC_XFER_SIZE) | |
23598 | n = SEC_XFER_SIZE; | |
23599 | - if (n > random_state->entropy_count / 8) | |
23600 | - n = random_state->entropy_count / 8; | |
23601 | + | |
23602 | + DEBUG_ENT("%04d %04d : reading %d bits, p: %d s: %d\n", | |
23603 | + random_state->entropy_count, | |
23604 | + sec_random_state->entropy_count, | |
23605 | + n*8, random_state->entropy_count, | |
23606 | + sec_random_state->entropy_count); | |
23607 | + | |
23608 | + n = extract_entropy(sec_random_state, buf, n, | |
23609 | + EXTRACT_ENTROPY_USER | | |
23610 | + EXTRACT_ENTROPY_LIMIT | | |
23611 | + EXTRACT_ENTROPY_SECONDARY); | |
23612 | + | |
23613 | + DEBUG_ENT("%04d %04d : read got %d bits (%d still needed)\n", | |
23614 | + random_state->entropy_count, | |
23615 | + sec_random_state->entropy_count, | |
23616 | + n*8, (nbytes-n)*8); | |
23617 | + | |
23618 | if (n == 0) { | |
23619 | if (file->f_flags & O_NONBLOCK) { | |
23620 | retval = -EAGAIN; | |
23621 | @@ -1506,12 +1574,27 @@ | |
23622 | retval = -ERESTARTSYS; | |
23623 | break; | |
23624 | } | |
23625 | - schedule(); | |
23626 | + | |
23627 | + DEBUG_ENT("%04d %04d : sleeping?\n", | |
23628 | + random_state->entropy_count, | |
23629 | + sec_random_state->entropy_count); | |
23630 | + | |
23631 | + set_current_state(TASK_INTERRUPTIBLE); | |
23632 | + add_wait_queue(&random_read_wait, &wait); | |
23633 | + | |
23634 | + if (sec_random_state->entropy_count / 8 == 0) | |
23635 | + schedule(); | |
23636 | + | |
23637 | + set_current_state(TASK_RUNNING); | |
23638 | + remove_wait_queue(&random_read_wait, &wait); | |
23639 | + | |
23640 | + DEBUG_ENT("%04d %04d : waking up\n", | |
23641 | + random_state->entropy_count, | |
23642 | + sec_random_state->entropy_count); | |
23643 | + | |
23644 | continue; | |
23645 | } | |
23646 | - n = extract_entropy(sec_random_state, buf, n, | |
23647 | - EXTRACT_ENTROPY_USER | | |
23648 | - EXTRACT_ENTROPY_SECONDARY); | |
23649 | + | |
23650 | if (n < 0) { | |
23651 | retval = n; | |
23652 | break; | |
23653 | @@ -1522,8 +1605,6 @@ | |
23654 | break; /* This break makes the device work */ | |
23655 | /* like a named pipe */ | |
23656 | } | |
23657 | - current->state = TASK_RUNNING; | |
23658 | - remove_wait_queue(&random_read_wait, &wait); | |
23659 | ||
23660 | /* | |
23661 | * If we gave the user some bytes, update the access time. | |
23662 | @@ -1595,8 +1676,9 @@ | |
23663 | random_ioctl(struct inode * inode, struct file * file, | |
23664 | unsigned int cmd, unsigned long arg) | |
23665 | { | |
23666 | - int *p, size, ent_count; | |
23667 | + int *p, *tmp, size, ent_count; | |
23668 | int retval; | |
23669 | + unsigned long flags; | |
23670 | ||
23671 | switch (cmd) { | |
23672 | case RNDGETENTCNT: | |
23673 | @@ -1621,17 +1703,36 @@ | |
23674 | if (!capable(CAP_SYS_ADMIN)) | |
23675 | return -EPERM; | |
23676 | p = (int *) arg; | |
23677 | - ent_count = random_state->entropy_count; | |
23678 | - if (put_user(ent_count, p++) || | |
23679 | - get_user(size, p) || | |
23680 | + if (get_user(size, p) || | |
23681 | put_user(random_state->poolinfo.poolwords, p++)) | |
23682 | return -EFAULT; | |
23683 | if (size < 0) | |
23684 | - return -EINVAL; | |
23685 | + return -EFAULT; | |
23686 | if (size > random_state->poolinfo.poolwords) | |
23687 | size = random_state->poolinfo.poolwords; | |
23688 | - if (copy_to_user(p, random_state->pool, size * sizeof(__u32))) | |
23689 | + | |
23690 | + /* prepare to atomically snapshot pool */ | |
23691 | + | |
23692 | + tmp = kmalloc(size * sizeof(__u32), GFP_KERNEL); | |
23693 | + | |
23694 | + if (!tmp) | |
23695 | return -EFAULT; | |
23696 | + | |
23697 | + spin_lock_irqsave(&random_state->lock, flags); | |
23698 | + ent_count = random_state->entropy_count; | |
23699 | + memcpy(tmp, random_state->pool, size * sizeof(__u32)); | |
23700 | + spin_unlock_irqrestore(&random_state->lock, flags); | |
23701 | + | |
23702 | + if (!copy_to_user(p, tmp, size * sizeof(__u32))) { | |
23703 | + kfree(tmp); | |
23704 | + return -EFAULT; | |
23705 | + } | |
23706 | + | |
23707 | + kfree(tmp); | |
23708 | + | |
23709 | + if(put_user(ent_count, p++)) | |
23710 | + return -EFAULT; | |
23711 | + | |
23712 | return 0; | |
23713 | case RNDADDENTROPY: | |
23714 | if (!capable(CAP_SYS_ADMIN)) | |
23715 | diff -Nru a/drivers/char/raw.c b/drivers/char/raw.c | |
23716 | --- a/drivers/char/raw.c Fri Jun 20 13:16:17 2003 | |
23717 | +++ b/drivers/char/raw.c Sun Aug 31 16:14:45 2003 | |
23718 | @@ -43,7 +43,7 @@ | |
23719 | */ | |
23720 | static int raw_open(struct inode *inode, struct file *filp) | |
23721 | { | |
23722 | - const int minor = minor(inode->i_rdev); | |
23723 | + const int minor = iminor(inode); | |
23724 | struct block_device *bdev; | |
23725 | int err; | |
23726 | ||
23727 | @@ -60,23 +60,25 @@ | |
23728 | bdev = raw_devices[minor].binding; | |
23729 | err = -ENODEV; | |
23730 | if (bdev) { | |
23731 | - err = bd_claim(bdev, raw_open); | |
23732 | + err = blkdev_get(bdev, filp->f_mode, 0, BDEV_RAW); | |
23733 | if (err) | |
23734 | goto out; | |
23735 | - atomic_inc(&bdev->bd_count); | |
23736 | - err = blkdev_get(bdev, filp->f_mode, 0, BDEV_RAW); | |
23737 | + igrab(bdev->bd_inode); | |
23738 | + err = bd_claim(bdev, raw_open); | |
23739 | + if (err) { | |
23740 | + blkdev_put(bdev, BDEV_RAW); | |
23741 | + goto out; | |
23742 | + } | |
23743 | + err = set_blocksize(bdev, bdev_hardsect_size(bdev)); | |
23744 | if (err) { | |
23745 | bd_release(bdev); | |
23746 | + blkdev_put(bdev, BDEV_RAW); | |
23747 | goto out; | |
23748 | - } else { | |
23749 | - err = set_blocksize(bdev, bdev_hardsect_size(bdev)); | |
23750 | - if (err == 0) { | |
23751 | - filp->f_flags |= O_DIRECT; | |
23752 | - if (++raw_devices[minor].inuse == 1) | |
23753 | - filp->f_dentry->d_inode->i_mapping = | |
23754 | - bdev->bd_inode->i_mapping; | |
23755 | - } | |
23756 | } | |
23757 | + filp->f_flags |= O_DIRECT; | |
23758 | + if (++raw_devices[minor].inuse == 1) | |
23759 | + filp->f_dentry->d_inode->i_mapping = | |
23760 | + bdev->bd_inode->i_mapping; | |
23761 | } | |
23762 | filp->private_data = bdev; | |
23763 | out: | |
23764 | @@ -90,7 +92,7 @@ | |
23765 | */ | |
23766 | static int raw_release(struct inode *inode, struct file *filp) | |
23767 | { | |
23768 | - const int minor= minor(inode->i_rdev); | |
23769 | + const int minor= iminor(inode); | |
23770 | struct block_device *bdev; | |
23771 | ||
23772 | down(&raw_mutex); | |
23773 | diff -Nru a/drivers/char/riscom8.c b/drivers/char/riscom8.c | |
23774 | --- a/drivers/char/riscom8.c Mon Aug 18 09:59:49 2003 | |
23775 | +++ b/drivers/char/riscom8.c Wed Sep 3 23:39:56 2003 | |
23776 | @@ -1036,7 +1036,6 @@ | |
23777 | int error; | |
23778 | struct riscom_port * port; | |
23779 | struct riscom_board * bp; | |
23780 | - unsigned long flags; | |
23781 | ||
23782 | board = RC_BOARD(tty->index); | |
23783 | if (board >= RC_NBOARD || !(rc_board[board].flags & RC_BOARD_PRESENT)) | |
23784 | diff -Nru a/drivers/char/rtc.c b/drivers/char/rtc.c | |
23785 | --- a/drivers/char/rtc.c Tue Aug 12 13:25:18 2003 | |
23786 | +++ b/drivers/char/rtc.c Wed Sep 3 23:40:14 2003 | |
23787 | @@ -44,10 +44,12 @@ | |
23788 | * 1.11 Takashi Iwai: Kernel access functions | |
23789 | * rtc_register/rtc_unregister/rtc_control | |
23790 | * 1.11a Daniele Bellucci: Audit create_proc_read_entry in rtc_init | |
23791 | + * 1.12 Venkatesh Pallipadi: Hooks for emulating rtc on HPET base-timer | |
23792 | + * CONFIG_HPET_EMULATE_RTC | |
23793 | * | |
23794 | */ | |
23795 | ||
23796 | -#define RTC_VERSION "1.11a" | |
23797 | +#define RTC_VERSION "1.12" | |
23798 | ||
23799 | #define RTC_IO_EXTENT 0x8 | |
23800 | ||
23801 | @@ -80,6 +82,10 @@ | |
23802 | #include <asm/uaccess.h> | |
23803 | #include <asm/system.h> | |
23804 | ||
23805 | +#if defined(__i386__) | |
23806 | +#include <asm/hpet.h> | |
23807 | +#endif | |
23808 | + | |
23809 | #ifdef __sparc__ | |
23810 | #include <linux/pci.h> | |
23811 | #include <asm/ebus.h> | |
23812 | @@ -95,6 +101,17 @@ | |
23813 | static int rtc_has_irq = 1; | |
23814 | #endif | |
23815 | ||
23816 | +#ifndef CONFIG_HPET_EMULATE_RTC | |
23817 | +#define is_hpet_enabled() 0 | |
23818 | +#define hpet_set_alarm_time(hrs, min, sec) 0 | |
23819 | +#define hpet_set_periodic_freq(arg) 0 | |
23820 | +#define hpet_mask_rtc_irq_bit(arg) 0 | |
23821 | +#define hpet_set_rtc_irq_bit(arg) 0 | |
23822 | +#define hpet_rtc_timer_init() do { } while (0) | |
23823 | +#define hpet_rtc_dropped_irq() 0 | |
23824 | +static inline irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) {return 0;} | |
23825 | +#endif | |
23826 | + | |
23827 | /* | |
23828 | * We sponge a minor off of the misc major. No need slurping | |
23829 | * up another valuable major dev number for this. If you add | |
23830 | @@ -120,7 +137,6 @@ | |
23831 | static unsigned int rtc_poll(struct file *file, poll_table *wait); | |
23832 | #endif | |
23833 | ||
23834 | -static void get_rtc_time (struct rtc_time *rtc_tm); | |
23835 | static void get_rtc_alm_time (struct rtc_time *alm_tm); | |
23836 | #if RTC_IRQ | |
23837 | static void rtc_dropped_irq(unsigned long data); | |
23838 | @@ -182,7 +198,7 @@ | |
23839 | * (See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.) | |
23840 | */ | |
23841 | ||
23842 | -static irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |
23843 | +irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |
23844 | { | |
23845 | /* | |
23846 | * Can be an alarm interrupt, update complete interrupt, | |
23847 | @@ -194,7 +210,16 @@ | |
23848 | spin_lock (&rtc_lock); | |
23849 | rtc_irq_data += 0x100; | |
23850 | rtc_irq_data &= ~0xff; | |
23851 | - rtc_irq_data |= (CMOS_READ(RTC_INTR_FLAGS) & 0xF0); | |
23852 | + if (is_hpet_enabled()) { | |
23853 | + /* | |
23854 | + * In this case it is HPET RTC interrupt handler | |
23855 | + * calling us, with the interrupt information | |
23856 | + * passed as arg1, instead of irq. | |
23857 | + */ | |
23858 | + rtc_irq_data |= (unsigned long)irq & 0xF0; | |
23859 | + } else { | |
23860 | + rtc_irq_data |= (CMOS_READ(RTC_INTR_FLAGS) & 0xF0); | |
23861 | + } | |
23862 | ||
23863 | if (rtc_status & RTC_TIMER_ON) | |
23864 | mod_timer(&rtc_irq_timer, jiffies + HZ/rtc_freq + 2*HZ/100); | |
23865 | @@ -429,6 +454,12 @@ | |
23866 | sec = alm_tm.tm_sec; | |
23867 | ||
23868 | spin_lock_irq(&rtc_lock); | |
23869 | + if (hpet_set_alarm_time(hrs, min, sec)) { | |
23870 | + /* | |
23871 | + * Fallthru and set alarm time in CMOS too, | |
23872 | + * so that we will get proper value in RTC_ALM_READ | |
23873 | + */ | |
23874 | + } | |
23875 | if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || | |
23876 | RTC_ALWAYS_BCD) | |
23877 | { | |
23878 | @@ -450,7 +481,7 @@ | |
23879 | } | |
23880 | case RTC_RD_TIME: /* Read the time/date from RTC */ | |
23881 | { | |
23882 | - get_rtc_time(&wtime); | |
23883 | + rtc_get_rtc_time(&wtime); | |
23884 | break; | |
23885 | } | |
23886 | case RTC_SET_TIME: /* Set the RTC */ | |
23887 | @@ -582,6 +613,10 @@ | |
23888 | return -EINVAL; | |
23889 | ||
23890 | spin_lock_irq(&rtc_lock); | |
23891 | + if (hpet_set_periodic_freq(arg)) { | |
23892 | + spin_unlock_irq(&rtc_lock); | |
23893 | + return 0; | |
23894 | + } | |
23895 | rtc_freq = arg; | |
23896 | ||
23897 | val = CMOS_READ(RTC_FREQ_SELECT) & 0xf0; | |
23898 | @@ -667,13 +702,14 @@ | |
23899 | */ | |
23900 | ||
23901 | spin_lock_irq(&rtc_lock); | |
23902 | - tmp = CMOS_READ(RTC_CONTROL); | |
23903 | - tmp &= ~RTC_PIE; | |
23904 | - tmp &= ~RTC_AIE; | |
23905 | - tmp &= ~RTC_UIE; | |
23906 | - CMOS_WRITE(tmp, RTC_CONTROL); | |
23907 | - CMOS_READ(RTC_INTR_FLAGS); | |
23908 | - | |
23909 | + if (!hpet_mask_rtc_irq_bit(RTC_PIE | RTC_AIE | RTC_UIE)) { | |
23910 | + tmp = CMOS_READ(RTC_CONTROL); | |
23911 | + tmp &= ~RTC_PIE; | |
23912 | + tmp &= ~RTC_AIE; | |
23913 | + tmp &= ~RTC_UIE; | |
23914 | + CMOS_WRITE(tmp, RTC_CONTROL); | |
23915 | + CMOS_READ(RTC_INTR_FLAGS); | |
23916 | + } | |
23917 | if (rtc_status & RTC_TIMER_ON) { | |
23918 | rtc_status &= ~RTC_TIMER_ON; | |
23919 | del_timer(&rtc_irq_timer); | |
23920 | @@ -765,12 +801,14 @@ | |
23921 | rtc_callback = NULL; | |
23922 | ||
23923 | /* disable controls */ | |
23924 | - tmp = CMOS_READ(RTC_CONTROL); | |
23925 | - tmp &= ~RTC_PIE; | |
23926 | - tmp &= ~RTC_AIE; | |
23927 | - tmp &= ~RTC_UIE; | |
23928 | - CMOS_WRITE(tmp, RTC_CONTROL); | |
23929 | - CMOS_READ(RTC_INTR_FLAGS); | |
23930 | + if (!hpet_mask_rtc_irq_bit(RTC_PIE | RTC_AIE | RTC_UIE)) { | |
23931 | + tmp = CMOS_READ(RTC_CONTROL); | |
23932 | + tmp &= ~RTC_PIE; | |
23933 | + tmp &= ~RTC_AIE; | |
23934 | + tmp &= ~RTC_UIE; | |
23935 | + CMOS_WRITE(tmp, RTC_CONTROL); | |
23936 | + CMOS_READ(RTC_INTR_FLAGS); | |
23937 | + } | |
23938 | if (rtc_status & RTC_TIMER_ON) { | |
23939 | rtc_status &= ~RTC_TIMER_ON; | |
23940 | del_timer(&rtc_irq_timer); | |
23941 | @@ -822,6 +860,10 @@ | |
23942 | &rtc_fops | |
23943 | }; | |
23944 | ||
23945 | +#if RTC_IRQ | |
23946 | +static irqreturn_t (*rtc_int_handler_ptr)(int irq, void *dev_id, struct pt_regs *regs); | |
23947 | +#endif | |
23948 | + | |
23949 | static int __init rtc_init(void) | |
23950 | { | |
23951 | #if defined(__alpha__) || defined(__mips__) | |
23952 | @@ -889,12 +931,20 @@ | |
23953 | } | |
23954 | ||
23955 | #if RTC_IRQ | |
23956 | - if (request_irq(RTC_IRQ, rtc_interrupt, SA_INTERRUPT, "rtc", NULL)) { | |
23957 | + if (is_hpet_enabled()) { | |
23958 | + rtc_int_handler_ptr = hpet_rtc_interrupt; | |
23959 | + } else { | |
23960 | + rtc_int_handler_ptr = rtc_interrupt; | |
23961 | + } | |
23962 | + | |
23963 | + if(request_irq(RTC_IRQ, rtc_int_handler_ptr, SA_INTERRUPT, "rtc", NULL)) { | |
23964 | /* Yeah right, seeing as irq 8 doesn't even hit the bus. */ | |
23965 | printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ); | |
23966 | release_region(RTC_PORT(0), RTC_IO_EXTENT); | |
23967 | return -EIO; | |
23968 | } | |
23969 | + hpet_rtc_timer_init(); | |
23970 | + | |
23971 | #endif | |
23972 | ||
23973 | #endif /* __sparc__ vs. others */ | |
23974 | @@ -965,10 +1015,12 @@ | |
23975 | init_timer(&rtc_irq_timer); | |
23976 | rtc_irq_timer.function = rtc_dropped_irq; | |
23977 | spin_lock_irq(&rtc_lock); | |
23978 | - /* Initialize periodic freq. to CMOS reset default, which is 1024Hz */ | |
23979 | - CMOS_WRITE(((CMOS_READ(RTC_FREQ_SELECT) & 0xF0) | 0x06), RTC_FREQ_SELECT); | |
23980 | - spin_unlock_irq(&rtc_lock); | |
23981 | rtc_freq = 1024; | |
23982 | + if (!hpet_set_periodic_freq(rtc_freq)) { | |
23983 | + /* Initialize periodic freq. to CMOS reset default, which is 1024Hz */ | |
23984 | + CMOS_WRITE(((CMOS_READ(RTC_FREQ_SELECT) & 0xF0) | 0x06), RTC_FREQ_SELECT); | |
23985 | + } | |
23986 | + spin_unlock_irq(&rtc_lock); | |
23987 | no_irq2: | |
23988 | #endif | |
23989 | ||
23990 | @@ -1019,6 +1071,11 @@ | |
23991 | ||
23992 | spin_lock_irq (&rtc_lock); | |
23993 | ||
23994 | + if (hpet_rtc_dropped_irq()) { | |
23995 | + spin_unlock_irq(&rtc_lock); | |
23996 | + return; | |
23997 | + } | |
23998 | + | |
23999 | /* Just in case someone disabled the timer from behind our back... */ | |
24000 | if (rtc_status & RTC_TIMER_ON) | |
24001 | mod_timer(&rtc_irq_timer, jiffies + HZ/rtc_freq + 2*HZ/100); | |
24002 | @@ -1061,7 +1118,7 @@ | |
24003 | ||
24004 | p = buf; | |
24005 | ||
24006 | - get_rtc_time(&tm); | |
24007 | + rtc_get_rtc_time(&tm); | |
24008 | ||
24009 | /* | |
24010 | * There is no way to tell if the luser has the RTC set for local | |
24011 | @@ -1148,7 +1205,7 @@ | |
24012 | return uip; | |
24013 | } | |
24014 | ||
24015 | -static void get_rtc_time(struct rtc_time *rtc_tm) | |
24016 | +void rtc_get_rtc_time(struct rtc_time *rtc_tm) | |
24017 | { | |
24018 | unsigned long uip_watchdog = jiffies; | |
24019 | unsigned char ctrl; | |
24020 | @@ -1254,6 +1311,10 @@ | |
24021 | unsigned char val; | |
24022 | ||
24023 | spin_lock_irq(&rtc_lock); | |
24024 | + if (hpet_mask_rtc_irq_bit(bit)) { | |
24025 | + spin_unlock_irq(&rtc_lock); | |
24026 | + return; | |
24027 | + } | |
24028 | val = CMOS_READ(RTC_CONTROL); | |
24029 | val &= ~bit; | |
24030 | CMOS_WRITE(val, RTC_CONTROL); | |
24031 | @@ -1268,6 +1329,10 @@ | |
24032 | unsigned char val; | |
24033 | ||
24034 | spin_lock_irq(&rtc_lock); | |
24035 | + if (hpet_set_rtc_irq_bit(bit)) { | |
24036 | + spin_unlock_irq(&rtc_lock); | |
24037 | + return; | |
24038 | + } | |
24039 | val = CMOS_READ(RTC_CONTROL); | |
24040 | val |= bit; | |
24041 | CMOS_WRITE(val, RTC_CONTROL); | |
24042 | @@ -1280,3 +1345,4 @@ | |
24043 | ||
24044 | MODULE_AUTHOR("Paul Gortmaker"); | |
24045 | MODULE_LICENSE("GPL"); | |
24046 | +MODULE_ALIAS_MISCDEV(RTC_MINOR); | |
24047 | diff -Nru a/drivers/char/scx200_gpio.c b/drivers/char/scx200_gpio.c | |
24048 | --- a/drivers/char/scx200_gpio.c Sat Dec 7 08:54:07 2002 | |
24049 | +++ b/drivers/char/scx200_gpio.c Tue Aug 26 09:25:41 2003 | |
24050 | @@ -29,7 +29,7 @@ | |
24051 | static ssize_t scx200_gpio_write(struct file *file, const char *data, | |
24052 | size_t len, loff_t *ppos) | |
24053 | { | |
24054 | - unsigned m = minor(file->f_dentry->d_inode->i_rdev); | |
24055 | + unsigned m = iminor(file->f_dentry->d_inode); | |
24056 | size_t i; | |
24057 | ||
24058 | if (ppos != &file->f_pos) | |
24059 | @@ -80,7 +80,7 @@ | |
24060 | static ssize_t scx200_gpio_read(struct file *file, char *buf, | |
24061 | size_t len, loff_t *ppos) | |
24062 | { | |
24063 | - unsigned m = minor(file->f_dentry->d_inode->i_rdev); | |
24064 | + unsigned m = iminor(file->f_dentry->d_inode); | |
24065 | int value; | |
24066 | ||
24067 | if (ppos != &file->f_pos) | |
24068 | @@ -95,7 +95,7 @@ | |
24069 | ||
24070 | static int scx200_gpio_open(struct inode *inode, struct file *file) | |
24071 | { | |
24072 | - unsigned m = minor(inode->i_rdev); | |
24073 | + unsigned m = iminor(inode); | |
24074 | if (m > 63) | |
24075 | return -EINVAL; | |
24076 | return 0; | |
24077 | diff -Nru a/drivers/char/sonypi.c b/drivers/char/sonypi.c | |
24078 | --- a/drivers/char/sonypi.c Fri Jun 13 07:30:24 2003 | |
24079 | +++ b/drivers/char/sonypi.c Fri Aug 1 05:36:14 2003 | |
24080 | @@ -308,7 +308,7 @@ | |
24081 | int i, j; | |
24082 | ||
24083 | v1 = inb_p(sonypi_device.ioport1); | |
24084 | - v2 = inb_p(sonypi_device.ioport2); | |
24085 | + v2 = inb_p(sonypi_device.ioport1 + sonypi_device.evtype_offset); | |
24086 | ||
24087 | for (i = 0; sonypi_eventtypes[i].model; i++) { | |
24088 | if (sonypi_device.model != sonypi_eventtypes[i].model) | |
24089 | @@ -670,11 +670,13 @@ | |
24090 | if (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE2) { | |
24091 | ioport_list = sonypi_type2_ioport_list; | |
24092 | sonypi_device.region_size = SONYPI_TYPE2_REGION_SIZE; | |
24093 | + sonypi_device.evtype_offset = SONYPI_TYPE2_EVTYPE_OFFSET; | |
24094 | irq_list = sonypi_type2_irq_list; | |
24095 | } | |
24096 | else { | |
24097 | ioport_list = sonypi_type1_ioport_list; | |
24098 | sonypi_device.region_size = SONYPI_TYPE1_REGION_SIZE; | |
24099 | + sonypi_device.evtype_offset = SONYPI_TYPE1_EVTYPE_OFFSET; | |
24100 | irq_list = sonypi_type1_irq_list; | |
24101 | } | |
24102 | ||
24103 | diff -Nru a/drivers/char/sonypi.h b/drivers/char/sonypi.h | |
24104 | --- a/drivers/char/sonypi.h Tue Jun 10 03:03:28 2003 | |
24105 | +++ b/drivers/char/sonypi.h Mon Sep 1 03:37:24 2003 | |
24106 | @@ -56,12 +56,14 @@ | |
24107 | #define SONYPI_BASE 0x50 | |
24108 | #define SONYPI_G10A (SONYPI_BASE+0x14) | |
24109 | #define SONYPI_TYPE1_REGION_SIZE 0x08 | |
24110 | +#define SONYPI_TYPE1_EVTYPE_OFFSET 0x04 | |
24111 | ||
24112 | /* type2 series specifics */ | |
24113 | #define SONYPI_SIRQ 0x9b | |
24114 | #define SONYPI_SLOB 0x9c | |
24115 | #define SONYPI_SHIB 0x9d | |
24116 | #define SONYPI_TYPE2_REGION_SIZE 0x20 | |
24117 | +#define SONYPI_TYPE2_EVTYPE_OFFSET 0x12 | |
24118 | ||
24119 | /* battery / brightness addresses */ | |
24120 | #define SONYPI_BAT_FLAGS 0x81 | |
24121 | @@ -167,6 +169,7 @@ | |
24122 | #define SONYPI_THUMBPHRASE_MASK 0x00000200 | |
24123 | #define SONYPI_MEYE_MASK 0x00000400 | |
24124 | #define SONYPI_MEMORYSTICK_MASK 0x00000800 | |
24125 | +#define SONYPI_BATTERY_MASK 0x00001000 | |
24126 | ||
24127 | struct sonypi_event { | |
24128 | u8 data; | |
24129 | @@ -293,6 +296,13 @@ | |
24130 | { 0, 0 } | |
24131 | }; | |
24132 | ||
24133 | +/* The set of possible battery events */ | |
24134 | +static struct sonypi_event sonypi_batteryev[] = { | |
24135 | + { 0x20, SONYPI_EVENT_BATTERY_INSERT }, | |
24136 | + { 0x30, SONYPI_EVENT_BATTERY_REMOVE }, | |
24137 | + { 0, 0 } | |
24138 | +}; | |
24139 | + | |
24140 | struct sonypi_eventtypes { | |
24141 | int model; | |
24142 | u8 data; | |
24143 | @@ -307,19 +317,22 @@ | |
24144 | { SONYPI_DEVICE_MODEL_TYPE1, 0x20, SONYPI_FNKEY_MASK, sonypi_fnkeyev }, | |
24145 | { SONYPI_DEVICE_MODEL_TYPE1, 0x30, SONYPI_BLUETOOTH_MASK, sonypi_blueev }, | |
24146 | { SONYPI_DEVICE_MODEL_TYPE1, 0x40, SONYPI_PKEY_MASK, sonypi_pkeyev }, | |
24147 | + { SONYPI_DEVICE_MODEL_TYPE1, 0x30, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev }, | |
24148 | + { SONYPI_DEVICE_MODEL_TYPE1, 0x40, SONYPI_BATTERY_MASK, sonypi_batteryev }, | |
24149 | ||
24150 | { SONYPI_DEVICE_MODEL_TYPE2, 0, 0xffffffff, sonypi_releaseev }, | |
24151 | { SONYPI_DEVICE_MODEL_TYPE2, 0x38, SONYPI_LID_MASK, sonypi_lidev }, | |
24152 | - { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_JOGGER_MASK, sonypi_joggerev }, | |
24153 | - { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_CAPTURE_MASK, sonypi_captureev }, | |
24154 | - { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_FNKEY_MASK, sonypi_fnkeyev }, | |
24155 | - { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_BLUETOOTH_MASK, sonypi_blueev }, | |
24156 | + { SONYPI_DEVICE_MODEL_TYPE2, 0x11, SONYPI_JOGGER_MASK, sonypi_joggerev }, | |
24157 | + { SONYPI_DEVICE_MODEL_TYPE2, 0x61, SONYPI_CAPTURE_MASK, sonypi_captureev }, | |
24158 | + { SONYPI_DEVICE_MODEL_TYPE2, 0x21, SONYPI_FNKEY_MASK, sonypi_fnkeyev }, | |
24159 | + { SONYPI_DEVICE_MODEL_TYPE2, 0x31, SONYPI_BLUETOOTH_MASK, sonypi_blueev }, | |
24160 | { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_PKEY_MASK, sonypi_pkeyev }, | |
24161 | - { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_BACK_MASK, sonypi_backev }, | |
24162 | + { SONYPI_DEVICE_MODEL_TYPE2, 0x11, SONYPI_BACK_MASK, sonypi_backev }, | |
24163 | { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_HELP_MASK, sonypi_helpev }, | |
24164 | { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_ZOOM_MASK, sonypi_zoomev }, | |
24165 | { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_THUMBPHRASE_MASK, sonypi_thumbphraseev }, | |
24166 | - { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev }, | |
24167 | + { SONYPI_DEVICE_MODEL_TYPE2, 0x31, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev }, | |
24168 | + { SONYPI_DEVICE_MODEL_TYPE2, 0x41, SONYPI_BATTERY_MASK, sonypi_batteryev }, | |
24169 | ||
24170 | { 0, 0, 0, 0 } | |
24171 | }; | |
24172 | @@ -354,6 +367,7 @@ | |
24173 | u16 ioport1; | |
24174 | u16 ioport2; | |
24175 | u16 region_size; | |
24176 | + u16 evtype_offset; | |
24177 | int camera_power; | |
24178 | int bluetooth_power; | |
24179 | struct semaphore lock; | |
24180 | diff -Nru a/drivers/char/stallion.c b/drivers/char/stallion.c | |
24181 | --- a/drivers/char/stallion.c Wed Jul 30 04:37:51 2003 | |
24182 | +++ b/drivers/char/stallion.c Sun Aug 24 05:39:23 2003 | |
24183 | @@ -3078,7 +3078,7 @@ | |
24184 | (int) fp, cmd, (int) arg); | |
24185 | #endif | |
24186 | ||
24187 | - brdnr = minor(ip->i_rdev); | |
24188 | + brdnr = iminor(ip); | |
24189 | if (brdnr >= STL_MAXBRDS) | |
24190 | return(-ENODEV); | |
24191 | rc = 0; | |
24192 | @@ -4234,7 +4234,7 @@ | |
24193 | misr = inb(ioaddr + EREG_DATA); | |
24194 | if (misr & MISR_DCD) { | |
24195 | set_bit(ASYI_DCDCHANGE, &portp->istate); | |
24196 | - schedule_task(&portp->tqueue); | |
24197 | + schedule_work(&portp->tqueue); | |
24198 | portp->stats.modem++; | |
24199 | } | |
24200 | ||
24201 | @@ -5031,7 +5031,7 @@ | |
24202 | if ((len == 0) || ((len < STL_TXBUFLOW) && | |
24203 | (test_bit(ASYI_TXLOW, &portp->istate) == 0))) { | |
24204 | set_bit(ASYI_TXLOW, &portp->istate); | |
24205 | - schedule_task(&portp->tqueue); | |
24206 | + schedule_work(&portp->tqueue); | |
24207 | } | |
24208 | ||
24209 | if (len == 0) { | |
24210 | @@ -5248,7 +5248,7 @@ | |
24211 | ipr = stl_sc26198getreg(portp, IPR); | |
24212 | if (ipr & IPR_DCDCHANGE) { | |
24213 | set_bit(ASYI_DCDCHANGE, &portp->istate); | |
24214 | - schedule_task(&portp->tqueue); | |
24215 | + schedule_work(&portp->tqueue); | |
24216 | portp->stats.modem++; | |
24217 | } | |
24218 | break; | |
24219 | diff -Nru a/drivers/char/tipar.c b/drivers/char/tipar.c | |
24220 | --- a/drivers/char/tipar.c Wed May 7 08:47:30 2003 | |
24221 | +++ b/drivers/char/tipar.c Tue Aug 26 09:25:41 2003 | |
24222 | @@ -248,7 +248,7 @@ | |
24223 | static int | |
24224 | tipar_open(struct inode *inode, struct file *file) | |
24225 | { | |
24226 | - unsigned int minor = minor(inode->i_rdev) - TIPAR_MINOR; | |
24227 | + unsigned int minor = iminor(inode) - TIPAR_MINOR; | |
24228 | ||
24229 | if (minor > tp_count - 1) | |
24230 | return -ENXIO; | |
24231 | @@ -266,7 +266,7 @@ | |
24232 | static int | |
24233 | tipar_close(struct inode *inode, struct file *file) | |
24234 | { | |
24235 | - unsigned int minor = minor(inode->i_rdev) - TIPAR_MINOR; | |
24236 | + unsigned int minor = iminor(inode) - TIPAR_MINOR; | |
24237 | ||
24238 | if (minor > tp_count - 1) | |
24239 | return -ENXIO; | |
24240 | @@ -279,8 +279,7 @@ | |
24241 | static ssize_t | |
24242 | tipar_write(struct file *file, const char *buf, size_t count, loff_t * ppos) | |
24243 | { | |
24244 | - unsigned int minor = | |
24245 | - minor(file->f_dentry->d_inode->i_rdev) - TIPAR_MINOR; | |
24246 | + unsigned int minor = iminor(file->f_dentry->d_inode) - TIPAR_MINOR; | |
24247 | ssize_t n; | |
24248 | ||
24249 | parport_claim_or_block(table[minor].dev); | |
24250 | @@ -308,8 +307,7 @@ | |
24251 | tipar_read(struct file *file, char *buf, size_t count, loff_t * ppos) | |
24252 | { | |
24253 | int b = 0; | |
24254 | - unsigned int minor = | |
24255 | - minor(file->f_dentry->d_inode->i_rdev) - TIPAR_MINOR; | |
24256 | + unsigned int minor = iminor(file->f_dentry->d_inode) - TIPAR_MINOR; | |
24257 | ssize_t retval = 0; | |
24258 | ssize_t n = 0; | |
24259 | ||
24260 | diff -Nru a/drivers/char/tpqic02.c b/drivers/char/tpqic02.c | |
24261 | --- a/drivers/char/tpqic02.c Wed May 7 08:47:30 2003 | |
24262 | +++ b/drivers/char/tpqic02.c Tue Aug 26 09:25:41 2003 | |
24263 | @@ -169,7 +169,7 @@ | |
24264 | static volatile unsigned dma_mode; /* !=0 also means DMA in use */ | |
24265 | static flag need_rewind = YES; | |
24266 | ||
24267 | -static kdev_t current_tape_dev; | |
24268 | +static int current_type; | |
24269 | static int extra_blocks_left = BLOCKS_BEYOND_EW; | |
24270 | static struct timer_list tp_timer; | |
24271 | ||
24272 | @@ -677,7 +677,7 @@ | |
24273 | * exception flag from previous exception which we are trying to clear. | |
24274 | */ | |
24275 | ||
24276 | - if (TP_DIAGS(current_tape_dev)) | |
24277 | + if (TP_DIAGS(current_type)) | |
24278 | printk(TPQIC02_NAME ": reading status bytes: "); | |
24279 | ||
24280 | for (q = stp; q < stp + size; q++) { | |
24281 | @@ -693,7 +693,7 @@ | |
24282 | ||
24283 | *q = inb_p(QIC02_DATA_PORT); /* read status byte */ | |
24284 | ||
24285 | - if (TP_DIAGS(current_tape_dev)) | |
24286 | + if (TP_DIAGS(current_type)) | |
24287 | printk("[%1d]=0x%x ", q - stp, (unsigned) (*q) & 0xff); | |
24288 | ||
24289 | outb_p(ctlbits | QIC02_CTL_REQUEST, QIC02_CTL_PORT); /* set request */ | |
24290 | @@ -714,7 +714,7 @@ | |
24291 | cpu_relax(); | |
24292 | /* wait for ready */ | |
24293 | ||
24294 | - if (TP_DIAGS(current_tape_dev)) | |
24295 | + if (TP_DIAGS(current_type)) | |
24296 | printk("\n"); | |
24297 | ||
24298 | return TE_OK; | |
24299 | @@ -1614,7 +1614,7 @@ | |
24300 | ||
24301 | if (status_expect_int) { | |
24302 | #ifdef WANT_EXTRA_FULL_DEBUGGING | |
24303 | - if (TP_DIAGS(current_tape_dev)) | |
24304 | + if (TP_DIAGS(current_type)) | |
24305 | printk("@"); | |
24306 | #endif | |
24307 | stat = inb(QIC02_STAT_PORT); /* Knock, knock */ | |
24308 | @@ -1726,7 +1726,7 @@ | |
24309 | ||
24310 | static ssize_t qic02_tape_read(struct file *filp, char *buf, size_t count, loff_t * ppos) | |
24311 | { | |
24312 | - kdev_t dev = filp->f_dentry->d_inode->i_rdev; | |
24313 | + int type = iminor(filp->f_dentry->d_inode); | |
24314 | unsigned short flags = filp->f_flags; | |
24315 | unsigned long bytes_todo, bytes_done, total_bytes_done = 0; | |
24316 | int stat; | |
24317 | @@ -1736,8 +1736,8 @@ | |
24318 | return -ENXIO; | |
24319 | } | |
24320 | ||
24321 | - if (TP_DIAGS(current_tape_dev)) | |
24322 | - printk(TPQIC02_NAME ": request READ, minor=%x, buf=%p, count=%lx, pos=%Lx, flags=%x\n", minor(dev), buf, | |
24323 | + if (TP_DIAGS(current_type)) | |
24324 | + printk(TPQIC02_NAME ": request READ, minor=%x, buf=%p, count=%lx, pos=%Lx, flags=%x\n", type, buf, | |
24325 | (long) count, filp->f_pos, flags); | |
24326 | ||
24327 | if (count % TAPE_BLKSIZE) { /* Only allow mod 512 bytes at a time. */ | |
24328 | @@ -1904,7 +1904,7 @@ | |
24329 | */ | |
24330 | static ssize_t qic02_tape_write(struct file *filp, const char *buf, size_t count, loff_t * ppos) | |
24331 | { | |
24332 | - kdev_t dev = filp->f_dentry->d_inode->i_rdev; | |
24333 | + int type = iminor(filp->f_dentry->d_inode); | |
24334 | unsigned short flags = filp->f_flags; | |
24335 | unsigned long bytes_todo, bytes_done, total_bytes_done = 0; | |
24336 | ||
24337 | @@ -1913,9 +1913,9 @@ | |
24338 | return -ENXIO; | |
24339 | } | |
24340 | ||
24341 | - if (TP_DIAGS(current_tape_dev)) { | |
24342 | + if (TP_DIAGS(current_type)) { | |
24343 | printk(TPQIC02_NAME ": request WRITE, minor=%x, buf=%p, count=%lx, pos=%Lx, flags=%x\n", | |
24344 | - minor(dev), buf, (long) count, filp->f_pos, flags); | |
24345 | + type, buf, (long) count, filp->f_pos, flags); | |
24346 | } | |
24347 | ||
24348 | if (count % TAPE_BLKSIZE) { /* only allow mod 512 bytes at a time */ | |
24349 | @@ -2070,17 +2070,18 @@ | |
24350 | static int qic02_tape_open_no_use_count(struct inode *inode, | |
24351 | struct file *filp) | |
24352 | { | |
24353 | - kdev_t dev = inode->i_rdev; | |
24354 | + int type = iminor(inode); | |
24355 | unsigned short flags = filp->f_flags; | |
24356 | unsigned short dens = 0; | |
24357 | int s; | |
24358 | ||
24359 | ||
24360 | - if (TP_DIAGS(dev)) { | |
24361 | - printk("qic02_tape_open: dev=%s, flags=%x ", cdevname(dev), flags); | |
24362 | + if (TP_DIAGS(type)) { | |
24363 | + printk("qic02_tape_open: dev=tpqic2(%d), flags=%x ", | |
24364 | + type, flags); | |
24365 | } | |
24366 | ||
24367 | - if (minor(dev) == 255) { /* special case for resetting */ | |
24368 | + if (type == 255) { /* special case for resetting */ | |
24369 | if (capable(CAP_SYS_ADMIN)) { | |
24370 | return (tape_reset(1) == TE_OK) ? -EAGAIN : -ENXIO; | |
24371 | } else { | |
24372 | @@ -2162,7 +2163,7 @@ | |
24373 | */ | |
24374 | ||
24375 | /* not allowed to do QCMD_DENS_* unless tape is rewound */ | |
24376 | - if ((TP_DENS(dev) != 0) && (TP_DENS(current_tape_dev) != TP_DENS(dev))) { | |
24377 | + if ((TP_DENS(type) != 0) && (TP_DENS(current_type) != TP_DENS(type))) { | |
24378 | /* force rewind if minor bits have changed, | |
24379 | * i.e. user wants to use tape in different format. | |
24380 | * [assuming single drive operation] | |
24381 | @@ -2175,7 +2176,7 @@ | |
24382 | /* density bits still the same, but TP_DIAGS bit | |
24383 | * may have changed. | |
24384 | */ | |
24385 | - current_tape_dev = dev; | |
24386 | + current_type = type; | |
24387 | } | |
24388 | ||
24389 | if (need_rewind == YES) { | |
24390 | @@ -2212,14 +2213,14 @@ | |
24391 | * so we must have done a rewind by now. If not, just skip over. | |
24392 | * Only give set density command when minor bits have changed. | |
24393 | */ | |
24394 | - if (TP_DENS(current_tape_dev) == TP_DENS(dev)) { | |
24395 | + if (TP_DENS(current_type) == TP_DENS(type)) { | |
24396 | return 0; | |
24397 | } | |
24398 | ||
24399 | - current_tape_dev = dev; | |
24400 | + current_type = type; | |
24401 | need_rewind = NO; | |
24402 | if (TP_HAVE_DENS) { | |
24403 | - dens = TP_DENS(dev); | |
24404 | + dens = TP_DENS(type); | |
24405 | } | |
24406 | ||
24407 | if (dens < sizeof(format_names) / sizeof(char *)) | |
24408 | @@ -2227,7 +2228,7 @@ | |
24409 | else | |
24410 | tpqputs(TPQD_REWIND, "Wait for retensioning..."); | |
24411 | ||
24412 | - switch (TP_DENS(dev)) { | |
24413 | + switch (TP_DENS(type)) { | |
24414 | case 0: /* Minor 0 is for drives without set-density support */ | |
24415 | s = 0; | |
24416 | break; | |
24417 | @@ -2254,7 +2255,7 @@ | |
24418 | } | |
24419 | if (s != 0) { | |
24420 | status_dead = YES; /* force reset */ | |
24421 | - current_tape_dev = NODEV;/* earlier 0xff80 */ | |
24422 | + current_type = 0;/* earlier 0xff80 */ | |
24423 | return -EIO; | |
24424 | } | |
24425 | ||
24426 | @@ -2264,10 +2265,10 @@ | |
24427 | ||
24428 | static int qic02_tape_release(struct inode *inode, struct file *filp) | |
24429 | { | |
24430 | - kdev_t dev = inode->i_rdev; | |
24431 | + int type = iminor(inode); | |
24432 | ||
24433 | - if (TP_DIAGS(dev)) { | |
24434 | - printk("qic02_tape_release: dev=%s\n", cdevname(dev)); | |
24435 | + if (TP_DIAGS(type)) { | |
24436 | + printk("qic02_tape_release: dev=tpqic2(%d)\n", type); | |
24437 | } | |
24438 | ||
24439 | if (status_zombie == NO) { /* don't rewind in zombie mode */ | |
24440 | @@ -2283,7 +2284,7 @@ | |
24441 | /* Rewind only if minor number requires it AND | |
24442 | * read/writes have been done. ************* IS THIS CORRECT?????????? | |
24443 | */ | |
24444 | - if ((TP_REWCLOSE(dev)) && (status_bytes_rd | status_bytes_wr)) { | |
24445 | + if (TP_REWCLOSE(type) && (status_bytes_rd | status_bytes_wr)) { | |
24446 | tpqputs(TPQD_REWIND, "release: Doing rewind..."); | |
24447 | (void) do_qic_cmd(QCMD_REWIND, TIM_R); | |
24448 | } | |
24449 | @@ -2398,7 +2399,7 @@ | |
24450 | struct mtpos ioctl_tell; | |
24451 | ||
24452 | ||
24453 | - if (TP_DIAGS(current_tape_dev)) | |
24454 | + if (TP_DIAGS(current_type)) | |
24455 | printk(TPQIC02_NAME ": ioctl(%4x, %4lx)\n", iocmd, ioarg); | |
24456 | ||
24457 | if (!inode) | |
24458 | @@ -2459,7 +2460,7 @@ | |
24459 | * --- tape at the beginning of the current file. | |
24460 | */ | |
24461 | ||
24462 | - if (TP_DIAGS(current_tape_dev)) | |
24463 | + if (TP_DIAGS(current_type)) | |
24464 | printk("OP op=%4x, count=%4x\n", operation.mt_op, operation.mt_count); | |
24465 | ||
24466 | if (operation.mt_count < 0) | |
24467 | @@ -2492,7 +2493,7 @@ | |
24468 | return 0; | |
24469 | ||
24470 | } else if (c == _IOC_NR(MTIOCGET)) { | |
24471 | - if (TP_DIAGS(current_tape_dev)) | |
24472 | + if (TP_DIAGS(current_type)) | |
24473 | printk("GET "); | |
24474 | ||
24475 | CHECK_IOC_SIZE(mtget); | |
24476 | @@ -2507,7 +2508,7 @@ | |
24477 | return -EFAULT; | |
24478 | return 0; | |
24479 | } else if (TP_HAVE_TELL && (c == _IOC_NR(MTIOCPOS))) { | |
24480 | - if (TP_DIAGS(current_tape_dev)) | |
24481 | + if (TP_DIAGS(current_type)) | |
24482 | printk("POS "); | |
24483 | ||
24484 | CHECK_IOC_SIZE(mtpos); | |
24485 | @@ -2664,7 +2665,7 @@ | |
24486 | return -ENODEV; | |
24487 | } | |
24488 | ||
24489 | - current_tape_dev = mk_kdev(QIC02_TAPE_MAJOR, 0); | |
24490 | + current_type = 0; | |
24491 | ||
24492 | #ifndef CONFIG_QIC02_DYNCONF | |
24493 | printk(TPQIC02_NAME ": IRQ %d, DMA %d, IO 0x%x, IFC %s, %s, %s\n", | |
24494 | diff -Nru a/drivers/char/tty_io.c b/drivers/char/tty_io.c | |
24495 | --- a/drivers/char/tty_io.c Fri Aug 1 02:22:20 2003 | |
24496 | +++ b/drivers/char/tty_io.c Sun Aug 31 16:15:47 2003 | |
24497 | @@ -177,7 +177,7 @@ | |
24498 | ||
24499 | EXPORT_SYMBOL(tty_name); | |
24500 | ||
24501 | -inline int tty_paranoia_check(struct tty_struct *tty, kdev_t device, | |
24502 | +inline int tty_paranoia_check(struct tty_struct *tty, struct inode *inode, | |
24503 | const char *routine) | |
24504 | { | |
24505 | #ifdef TTY_PARANOIA_CHECK | |
24506 | @@ -187,11 +187,11 @@ | |
24507 | "Warning: null TTY for (%s) in %s\n"; | |
24508 | ||
24509 | if (!tty) { | |
24510 | - printk(badtty, cdevname(device), routine); | |
24511 | + printk(badtty, cdevname(inode->i_rdev), routine); | |
24512 | return 1; | |
24513 | } | |
24514 | if (tty->magic != TTY_MAGIC) { | |
24515 | - printk(badmagic, cdevname(device), routine); | |
24516 | + printk(badmagic, cdevname(inode->i_rdev), routine); | |
24517 | return 1; | |
24518 | } | |
24519 | #endif | |
24520 | @@ -646,7 +646,7 @@ | |
24521 | ||
24522 | tty = (struct tty_struct *)file->private_data; | |
24523 | inode = file->f_dentry->d_inode; | |
24524 | - if (tty_paranoia_check(tty, inode->i_rdev, "tty_read")) | |
24525 | + if (tty_paranoia_check(tty, inode, "tty_read")) | |
24526 | return -EIO; | |
24527 | if (!tty || (test_bit(TTY_IO_ERROR, &tty->flags))) | |
24528 | return -EIO; | |
24529 | @@ -763,7 +763,7 @@ | |
24530 | } | |
24531 | ||
24532 | tty = (struct tty_struct *)file->private_data; | |
24533 | - if (tty_paranoia_check(tty, inode->i_rdev, "tty_write")) | |
24534 | + if (tty_paranoia_check(tty, inode, "tty_write")) | |
24535 | return -EIO; | |
24536 | if (!tty || !tty->driver->write || (test_bit(TTY_IO_ERROR, &tty->flags))) | |
24537 | return -EIO; | |
24538 | @@ -1023,7 +1023,7 @@ | |
24539 | o_tty->magic = 0; | |
24540 | o_tty->driver->refcount--; | |
24541 | file_list_lock(); | |
24542 | - list_del(&o_tty->tty_files); | |
24543 | + list_del_init(&o_tty->tty_files); | |
24544 | file_list_unlock(); | |
24545 | free_tty_struct(o_tty); | |
24546 | } | |
24547 | @@ -1037,7 +1037,7 @@ | |
24548 | tty->magic = 0; | |
24549 | tty->driver->refcount--; | |
24550 | file_list_lock(); | |
24551 | - list_del(&tty->tty_files); | |
24552 | + list_del_init(&tty->tty_files); | |
24553 | file_list_unlock(); | |
24554 | module_put(tty->driver->owner); | |
24555 | free_tty_struct(tty); | |
24556 | @@ -1059,7 +1059,7 @@ | |
24557 | char buf[64]; | |
24558 | ||
24559 | tty = (struct tty_struct *)filp->private_data; | |
24560 | - if (tty_paranoia_check(tty, filp->f_dentry->d_inode->i_rdev, "release_dev")) | |
24561 | + if (tty_paranoia_check(tty, filp->f_dentry->d_inode, "release_dev")) | |
24562 | return; | |
24563 | ||
24564 | check_tty_count(tty, "release_dev"); | |
24565 | @@ -1439,7 +1439,7 @@ | |
24566 | struct tty_struct * tty; | |
24567 | ||
24568 | tty = (struct tty_struct *)filp->private_data; | |
24569 | - if (tty_paranoia_check(tty, filp->f_dentry->d_inode->i_rdev, "tty_poll")) | |
24570 | + if (tty_paranoia_check(tty, filp->f_dentry->d_inode, "tty_poll")) | |
24571 | return 0; | |
24572 | ||
24573 | if (tty->ldisc.poll) | |
24574 | @@ -1453,7 +1453,7 @@ | |
24575 | int retval; | |
24576 | ||
24577 | tty = (struct tty_struct *)filp->private_data; | |
24578 | - if (tty_paranoia_check(tty, filp->f_dentry->d_inode->i_rdev, "tty_fasync")) | |
24579 | + if (tty_paranoia_check(tty, filp->f_dentry->d_inode, "tty_fasync")) | |
24580 | return 0; | |
24581 | ||
24582 | retval = fasync_helper(fd, filp, on, &tty->fasync); | |
24583 | @@ -1727,7 +1727,7 @@ | |
24584 | int retval; | |
24585 | ||
24586 | tty = (struct tty_struct *)file->private_data; | |
24587 | - if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl")) | |
24588 | + if (tty_paranoia_check(tty, inode, "tty_ioctl")) | |
24589 | return -EINVAL; | |
24590 | ||
24591 | real_tty = tty; | |
24592 | diff -Nru a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c | |
24593 | --- a/drivers/char/vc_screen.c Wed May 7 08:47:30 2003 | |
24594 | +++ b/drivers/char/vc_screen.c Tue Aug 26 09:25:41 2003 | |
24595 | @@ -49,7 +49,7 @@ | |
24596 | vcs_size(struct inode *inode) | |
24597 | { | |
24598 | int size; | |
24599 | - int minor = minor(inode->i_rdev); | |
24600 | + int minor = iminor(inode); | |
24601 | int currcons = minor & 127; | |
24602 | if (currcons == 0) | |
24603 | currcons = fg_console; | |
24604 | @@ -104,7 +104,7 @@ | |
24605 | vcs_read(struct file *file, char *buf, size_t count, loff_t *ppos) | |
24606 | { | |
24607 | struct inode *inode = file->f_dentry->d_inode; | |
24608 | - unsigned int currcons = minor(inode->i_rdev); | |
24609 | + unsigned int currcons = iminor(inode); | |
24610 | long pos = *ppos; | |
24611 | long viewed, attr, read; | |
24612 | int col, maxcol; | |
24613 | @@ -273,7 +273,7 @@ | |
24614 | vcs_write(struct file *file, const char *buf, size_t count, loff_t *ppos) | |
24615 | { | |
24616 | struct inode *inode = file->f_dentry->d_inode; | |
24617 | - unsigned int currcons = minor(inode->i_rdev); | |
24618 | + unsigned int currcons = iminor(inode); | |
24619 | long pos = *ppos; | |
24620 | long viewed, attr, size, written; | |
24621 | char *con_buf0; | |
24622 | @@ -456,7 +456,7 @@ | |
24623 | static int | |
24624 | vcs_open(struct inode *inode, struct file *filp) | |
24625 | { | |
24626 | - unsigned int currcons = minor(inode->i_rdev) & 127; | |
24627 | + unsigned int currcons = iminor(inode) & 127; | |
24628 | if(currcons && !vc_cons_allocated(currcons-1)) | |
24629 | return -ENXIO; | |
24630 | return 0; | |
24631 | diff -Nru a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig | |
24632 | --- a/drivers/char/watchdog/Kconfig Mon Jul 28 13:28:55 2003 | |
24633 | +++ b/drivers/char/watchdog/Kconfig Sun Aug 31 11:39:56 2003 | |
24634 | @@ -346,6 +346,18 @@ | |
24635 | module, say M here and read <file:Documentation/modules.txt>. Most | |
24636 | people will say N. | |
24637 | ||
24638 | +config ALIM1535_WDT | |
24639 | + tristate "ALi M1535 PMU Watchdog Timer" | |
24640 | + depends on WATCHDOG | |
24641 | + ---help--- | |
24642 | + This is the driver for the hardware watchdog on the ALi M1535 PMU. | |
24643 | + | |
24644 | + This driver is also available as a module ( = code which can be | |
24645 | + inserted in and removed from the running kernel whenever you want). | |
24646 | + The module is called alim1535_wdt. If you want to compile it as a | |
24647 | + module, say M here and read <file:Documentation/modules.txt>. Most | |
24648 | + people will say N. | |
24649 | + | |
24650 | config SC1200_WDT | |
24651 | tristate "National Semiconductor PC87307/PC97307 (ala SC1200) Watchdog" | |
24652 | depends on WATCHDOG | |
24653 | diff -Nru a/drivers/char/watchdog/Makefile b/drivers/char/watchdog/Makefile | |
24654 | --- a/drivers/char/watchdog/Makefile Thu Feb 27 12:38:45 2003 | |
24655 | +++ b/drivers/char/watchdog/Makefile Sun Aug 31 11:39:56 2003 | |
24656 | @@ -27,6 +27,7 @@ | |
24657 | obj-$(CONFIG_W83877F_WDT) += w83877f_wdt.o | |
24658 | obj-$(CONFIG_SC520_WDT) += sc520_wdt.o | |
24659 | obj-$(CONFIG_ALIM7101_WDT) += alim7101_wdt.o | |
24660 | +obj-$(CONFIG_ALIM1535_WDT) += alim1535_wdt.o | |
24661 | obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o | |
24662 | obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o | |
24663 | obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o | |
24664 | diff -Nru a/drivers/char/watchdog/acquirewdt.c b/drivers/char/watchdog/acquirewdt.c | |
24665 | --- a/drivers/char/watchdog/acquirewdt.c Fri Aug 8 03:28:08 2003 | |
24666 | +++ b/drivers/char/watchdog/acquirewdt.c Sun Aug 31 14:15:12 2003 | |
24667 | @@ -1,5 +1,5 @@ | |
24668 | /* | |
24669 | - * Acquire Single Board Computer Watchdog Timer driver for Linux 2.1.x | |
24670 | + * Acquire Single Board Computer Watchdog Timer driver | |
24671 | * | |
24672 | * Based on wdt.c. Original copyright messages: | |
24673 | * | |
24674 | @@ -10,10 +10,10 @@ | |
24675 | * modify it under the terms of the GNU General Public License | |
24676 | * as published by the Free Software Foundation; either version | |
24677 | * 2 of the License, or (at your option) any later version. | |
24678 | - * | |
24679 | - * Neither Alan Cox nor CymruNet Ltd. admit liability nor provide | |
24680 | - * warranty for any of this software. This material is provided | |
24681 | - * "AS-IS" and at no charge. | |
24682 | + * | |
24683 | + * Neither Alan Cox nor CymruNet Ltd. admit liability nor provide | |
24684 | + * warranty for any of this software. This material is provided | |
24685 | + * "AS-IS" and at no charge. | |
24686 | * | |
24687 | * (c) Copyright 1995 Alan Cox <alan@redhat.com> | |
24688 | * | |
24689 | @@ -22,33 +22,39 @@ | |
24690 | * Can't add timeout - driver doesn't allow changing value | |
24691 | */ | |
24692 | ||
24693 | -#include <linux/config.h> | |
24694 | #include <linux/module.h> | |
24695 | #include <linux/moduleparam.h> | |
24696 | #include <linux/types.h> | |
24697 | #include <linux/miscdevice.h> | |
24698 | #include <linux/watchdog.h> | |
24699 | +#include <linux/fs.h> | |
24700 | #include <linux/ioport.h> | |
24701 | #include <linux/notifier.h> | |
24702 | -#include <linux/fs.h> | |
24703 | #include <linux/reboot.h> | |
24704 | #include <linux/init.h> | |
24705 | -#include <linux/spinlock.h> | |
24706 | ||
24707 | #include <asm/io.h> | |
24708 | #include <asm/uaccess.h> | |
24709 | #include <asm/system.h> | |
24710 | ||
24711 | -static int acq_is_open; | |
24712 | -static spinlock_t acq_lock; | |
24713 | -static int expect_close = 0; | |
24714 | +#define WATCHDOG_NAME "Acquire WDT" | |
24715 | +#define PFX WATCHDOG_NAME ": " | |
24716 | +#define WATCHDOG_TIMEOUT 0 /* ??? Is the timeout hardcoded to 1 minute ??? */ | |
24717 | + | |
24718 | +static unsigned long acq_is_open; | |
24719 | +static char expect_close; | |
24720 | ||
24721 | /* | |
24722 | * You must set these - there is no sane way to probe for this board. | |
24723 | */ | |
24724 | - | |
24725 | -#define WDT_STOP 0x43 | |
24726 | -#define WDT_START 0x443 | |
24727 | + | |
24728 | +static int wdt_stop = 0x43; | |
24729 | +module_param(wdt_stop, int, 0); | |
24730 | +MODULE_PARM_DESC(wdt_stop, "Acquire WDT 'stop' io port (default 0x43)"); | |
24731 | + | |
24732 | +static int wdt_start = 0x443; | |
24733 | +module_param(wdt_start, int, 0); | |
24734 | +MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)"); | |
24735 | ||
24736 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | |
24737 | static int nowayout = 1; | |
24738 | @@ -62,38 +68,52 @@ | |
24739 | /* | |
24740 | * Kernel methods. | |
24741 | */ | |
24742 | - | |
24743 | ||
24744 | static void acq_ping(void) | |
24745 | { | |
24746 | /* Write a watchdog value */ | |
24747 | - inb_p(WDT_START); | |
24748 | + inb_p(wdt_start); | |
24749 | } | |
24750 | ||
24751 | +static void acq_stop(void) | |
24752 | +{ | |
24753 | + /* Turn the card off */ | |
24754 | + inb_p(wdt_stop); | |
24755 | +} | |
24756 | + | |
24757 | +/* | |
24758 | + * /dev/watchdog handling. | |
24759 | + */ | |
24760 | + | |
24761 | static ssize_t acq_write(struct file *file, const char *buf, size_t count, loff_t *ppos) | |
24762 | { | |
24763 | /* Can't seek (pwrite) on this device */ | |
24764 | if (ppos != &file->f_pos) | |
24765 | return -ESPIPE; | |
24766 | ||
24767 | + /* See if we got the magic character 'V' and reload the timer */ | |
24768 | if(count) { | |
24769 | if (!nowayout) { | |
24770 | size_t i; | |
24771 | ||
24772 | + /* note: just in case someone wrote the magic character | |
24773 | + * five months ago... */ | |
24774 | expect_close = 0; | |
24775 | ||
24776 | + /* scan to see wether or not we got the magic character */ | |
24777 | for (i = 0; i != count; i++) { | |
24778 | char c; | |
24779 | if (get_user(c, buf + i)) | |
24780 | return -EFAULT; | |
24781 | if (c == 'V') | |
24782 | - expect_close = 1; | |
24783 | + expect_close = 42; | |
24784 | } | |
24785 | } | |
24786 | + | |
24787 | + /* Well, anyhow someone wrote to us, we should return that favour */ | |
24788 | acq_ping(); | |
24789 | - return 1; | |
24790 | } | |
24791 | - return 0; | |
24792 | + return count; | |
24793 | } | |
24794 | ||
24795 | static int acq_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |
24796 | @@ -103,65 +123,75 @@ | |
24797 | { | |
24798 | .options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, | |
24799 | .firmware_version = 1, | |
24800 | - .identity = "Acquire WDT" | |
24801 | + .identity = "Acquire WDT", | |
24802 | }; | |
24803 | - | |
24804 | + | |
24805 | switch(cmd) | |
24806 | { | |
24807 | case WDIOC_GETSUPPORT: | |
24808 | - if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))) | |
24809 | - return -EFAULT; | |
24810 | - break; | |
24811 | - | |
24812 | + return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)) ? -EFAULT : 0; | |
24813 | + | |
24814 | case WDIOC_GETSTATUS: | |
24815 | - if (copy_to_user((int *)arg, &acq_is_open, sizeof(int))) | |
24816 | - return -EFAULT; | |
24817 | - break; | |
24818 | + case WDIOC_GETBOOTSTATUS: | |
24819 | + return put_user(0, (int *)arg); | |
24820 | ||
24821 | case WDIOC_KEEPALIVE: | |
24822 | acq_ping(); | |
24823 | - break; | |
24824 | + return 0; | |
24825 | + | |
24826 | + case WDIOC_GETTIMEOUT: | |
24827 | + return put_user(WATCHDOG_TIMEOUT, (int *)arg); | |
24828 | + | |
24829 | + case WDIOC_SETOPTIONS: | |
24830 | + { | |
24831 | + int options, retval = -EINVAL; | |
24832 | + | |
24833 | + if (get_user(options, (int *)arg)) | |
24834 | + return -EFAULT; | |
24835 | + | |
24836 | + if (options & WDIOS_DISABLECARD) | |
24837 | + { | |
24838 | + acq_stop(); | |
24839 | + retval = 0; | |
24840 | + } | |
24841 | + | |
24842 | + if (options & WDIOS_ENABLECARD) | |
24843 | + { | |
24844 | + acq_ping(); | |
24845 | + retval = 0; | |
24846 | + } | |
24847 | + | |
24848 | + return retval; | |
24849 | + } | |
24850 | ||
24851 | default: | |
24852 | - return -ENOTTY; | |
24853 | + return -ENOIOCTLCMD; | |
24854 | } | |
24855 | - return 0; | |
24856 | } | |
24857 | ||
24858 | static int acq_open(struct inode *inode, struct file *file) | |
24859 | { | |
24860 | - if ((minor(inode->i_rdev) == WATCHDOG_MINOR)) { | |
24861 | - spin_lock(&acq_lock); | |
24862 | - if(acq_is_open) { | |
24863 | - spin_unlock(&acq_lock); | |
24864 | - return -EBUSY; | |
24865 | - } | |
24866 | - if (nowayout) | |
24867 | - __module_get(THIS_MODULE); | |
24868 | + if (test_and_set_bit(0, &acq_is_open)) | |
24869 | + return -EBUSY; | |
24870 | ||
24871 | - /* Activate */ | |
24872 | - acq_is_open=1; | |
24873 | - inb_p(WDT_START); | |
24874 | - spin_unlock(&acq_lock); | |
24875 | - return 0; | |
24876 | + if (nowayout) | |
24877 | + __module_get(THIS_MODULE); | |
24878 | ||
24879 | - } else { | |
24880 | - return -ENODEV; | |
24881 | - } | |
24882 | + /* Activate */ | |
24883 | + acq_ping(); | |
24884 | + return 0; | |
24885 | } | |
24886 | ||
24887 | static int acq_close(struct inode *inode, struct file *file) | |
24888 | { | |
24889 | - if(minor(inode->i_rdev)==WATCHDOG_MINOR) { | |
24890 | - spin_lock(&acq_lock); | |
24891 | - if (expect_close) | |
24892 | - inb_p(WDT_STOP); | |
24893 | - else | |
24894 | - printk(KERN_CRIT "WDT closed unexpectedly. WDT will not stop!\n"); | |
24895 | - | |
24896 | - acq_is_open=0; | |
24897 | - spin_unlock(&acq_lock); | |
24898 | + if (expect_close == 42) { | |
24899 | + acq_stop(); | |
24900 | + } else { | |
24901 | + printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); | |
24902 | + acq_ping(); | |
24903 | } | |
24904 | + clear_bit(0, &acq_is_open); | |
24905 | + expect_close = 0; | |
24906 | return 0; | |
24907 | } | |
24908 | ||
24909 | @@ -172,20 +202,20 @@ | |
24910 | static int acq_notify_sys(struct notifier_block *this, unsigned long code, | |
24911 | void *unused) | |
24912 | { | |
24913 | - if(code==SYS_DOWN || code==SYS_HALT) | |
24914 | - /* Turn the card off */ | |
24915 | - inb_p(WDT_STOP); | |
24916 | - | |
24917 | + if(code==SYS_DOWN || code==SYS_HALT) { | |
24918 | + /* Turn the WDT off */ | |
24919 | + acq_stop(); | |
24920 | + } | |
24921 | return NOTIFY_DONE; | |
24922 | } | |
24923 | - | |
24924 | + | |
24925 | /* | |
24926 | * Kernel Interfaces | |
24927 | */ | |
24928 | - | |
24929 | - | |
24930 | + | |
24931 | static struct file_operations acq_fops = { | |
24932 | .owner = THIS_MODULE, | |
24933 | + .llseek = no_llseek, | |
24934 | .write = acq_write, | |
24935 | .ioctl = acq_ioctl, | |
24936 | .open = acq_open, | |
24937 | @@ -196,52 +226,84 @@ | |
24938 | { | |
24939 | .minor = WATCHDOG_MINOR, | |
24940 | .name = "watchdog", | |
24941 | - .fops = &acq_fops | |
24942 | + .fops = &acq_fops, | |
24943 | }; | |
24944 | ||
24945 | - | |
24946 | /* | |
24947 | * The WDT card needs to learn about soft shutdowns in order to | |
24948 | - * turn the timebomb registers off. | |
24949 | + * turn the timebomb registers off. | |
24950 | */ | |
24951 | - | |
24952 | + | |
24953 | static struct notifier_block acq_notifier = | |
24954 | { | |
24955 | .notifier_call = acq_notify_sys, | |
24956 | .next = NULL, | |
24957 | - .priority = 0 | |
24958 | + .priority = 0, | |
24959 | }; | |
24960 | ||
24961 | static int __init acq_init(void) | |
24962 | { | |
24963 | + int ret; | |
24964 | + | |
24965 | printk(KERN_INFO "WDT driver for Acquire single board computer initialising.\n"); | |
24966 | ||
24967 | - spin_lock_init(&acq_lock); | |
24968 | - if (misc_register(&acq_miscdev)) | |
24969 | - return -ENODEV; | |
24970 | - if (!request_region(WDT_STOP, 1, "Acquire WDT")) { | |
24971 | - misc_deregister(&acq_miscdev); | |
24972 | - return -EIO; | |
24973 | - } | |
24974 | - if (!request_region(WDT_START, 1, "Acquire WDT")) { | |
24975 | - release_region(WDT_STOP, 1); | |
24976 | - misc_deregister(&acq_miscdev); | |
24977 | - return -EIO; | |
24978 | + if (wdt_stop != wdt_start) { | |
24979 | + if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { | |
24980 | + printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", | |
24981 | + wdt_stop); | |
24982 | + ret = -EIO; | |
24983 | + goto out; | |
24984 | + } | |
24985 | } | |
24986 | ||
24987 | - register_reboot_notifier(&acq_notifier); | |
24988 | - return 0; | |
24989 | + if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { | |
24990 | + printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", | |
24991 | + wdt_start); | |
24992 | + ret = -EIO; | |
24993 | + goto unreg_stop; | |
24994 | + } | |
24995 | + | |
24996 | + ret = register_reboot_notifier(&acq_notifier); | |
24997 | + if (ret != 0) { | |
24998 | + printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", | |
24999 | + ret); | |
25000 | + goto unreg_regions; | |
25001 | + } | |
25002 | + | |
25003 | + ret = misc_register(&acq_miscdev); | |
25004 | + if (ret != 0) { | |
25005 | + printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", | |
25006 | + WATCHDOG_MINOR, ret); | |
25007 | + goto unreg_reboot; | |
25008 | + } | |
25009 | + | |
25010 | + printk (KERN_INFO PFX "initialized. (nowayout=%d)\n", | |
25011 | + nowayout); | |
25012 | + | |
25013 | +out: | |
25014 | + return ret; | |
25015 | +unreg_reboot: | |
25016 | + unregister_reboot_notifier(&acq_notifier); | |
25017 | +unreg_regions: | |
25018 | + release_region(wdt_start, 1); | |
25019 | +unreg_stop: | |
25020 | + if (wdt_stop != wdt_start) | |
25021 | + release_region(wdt_stop, 1); | |
25022 | + goto out; | |
25023 | } | |
25024 | - | |
25025 | + | |
25026 | static void __exit acq_exit(void) | |
25027 | { | |
25028 | misc_deregister(&acq_miscdev); | |
25029 | unregister_reboot_notifier(&acq_notifier); | |
25030 | - release_region(WDT_STOP,1); | |
25031 | - release_region(WDT_START,1); | |
25032 | + if(wdt_stop != wdt_start) | |
25033 | + release_region(wdt_stop,1); | |
25034 | + release_region(wdt_start,1); | |
25035 | } | |
25036 | ||
25037 | module_init(acq_init); | |
25038 | module_exit(acq_exit); | |
25039 | ||
25040 | MODULE_LICENSE("GPL"); | |
25041 | +MODULE_AUTHOR("Unkown"); | |
25042 | +MODULE_DESCRIPTION("Acquire Single Board Computer Watchdog Timer driver"); | |
25043 | diff -Nru a/drivers/char/watchdog/advantechwdt.c b/drivers/char/watchdog/advantechwdt.c | |
25044 | --- a/drivers/char/watchdog/advantechwdt.c Sat Aug 9 07:00:04 2003 | |
25045 | +++ b/drivers/char/watchdog/advantechwdt.c Sat Aug 30 04:48:19 2003 | |
25046 | @@ -133,7 +133,7 @@ | |
25047 | static struct watchdog_info ident = { | |
25048 | .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, | |
25049 | .firmware_version = 1, | |
25050 | - .identity = "Advantech WDT" | |
25051 | + .identity = "Advantech WDT", | |
25052 | }; | |
25053 | ||
25054 | switch (cmd) { | |
25055 | diff -Nru a/drivers/char/watchdog/alim1535_wdt.c b/drivers/char/watchdog/alim1535_wdt.c | |
25056 | --- /dev/null Wed Dec 31 16:00:00 1969 | |
25057 | +++ b/drivers/char/watchdog/alim1535_wdt.c Sun Aug 31 11:38:01 2003 | |
25058 | @@ -0,0 +1,465 @@ | |
25059 | +/* | |
25060 | + * Watchdog for the 7101 PMU version found in the ALi M1535 chipsets | |
25061 | + * | |
25062 | + * This program is free software; you can redistribute it and/or | |
25063 | + * modify it under the terms of the GNU General Public License | |
25064 | + * as published by the Free Software Foundation; either version | |
25065 | + * 2 of the License, or (at your option) any later version. | |
25066 | + */ | |
25067 | + | |
25068 | +#include <linux/module.h> | |
25069 | +#include <linux/moduleparam.h> | |
25070 | +#include <linux/types.h> | |
25071 | +#include <linux/miscdevice.h> | |
25072 | +#include <linux/watchdog.h> | |
25073 | +#include <linux/ioport.h> | |
25074 | +#include <linux/notifier.h> | |
25075 | +#include <linux/reboot.h> | |
25076 | +#include <linux/init.h> | |
25077 | +#include <linux/pci.h> | |
25078 | + | |
25079 | +#include <asm/uaccess.h> | |
25080 | +#include <asm/io.h> | |
25081 | + | |
25082 | +#define WATCHDOG_NAME "ALi_M1535" | |
25083 | +#define PFX WATCHDOG_NAME ": " | |
25084 | +#define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ | |
25085 | + | |
25086 | +/* internal variables */ | |
25087 | +static unsigned long ali_is_open; | |
25088 | +static char ali_expect_release; | |
25089 | +static struct pci_dev *ali_pci; | |
25090 | +static u32 ali_timeout_bits; /* stores the computed timeout */ | |
25091 | +static spinlock_t ali_lock; /* Guards the hardware */ | |
25092 | + | |
25093 | +/* module parameters */ | |
25094 | +static int timeout = WATCHDOG_TIMEOUT; | |
25095 | +module_param(timeout, int, 0); | |
25096 | +MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (0<timeout<18000, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); | |
25097 | + | |
25098 | +#ifdef CONFIG_WATCHDOG_NOWAYOUT | |
25099 | +static int nowayout = 1; | |
25100 | +#else | |
25101 | +static int nowayout = 0; | |
25102 | +#endif | |
25103 | + | |
25104 | +module_param(nowayout, int, 0); | |
25105 | +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | |
25106 | + | |
25107 | +/* | |
25108 | + * ali_start - start watchdog countdown | |
25109 | + * | |
25110 | + * Starts the timer running providing the timer has a counter | |
25111 | + * configuration set. | |
25112 | + */ | |
25113 | + | |
25114 | +static void ali_start(void) | |
25115 | +{ | |
25116 | + u32 val; | |
25117 | + | |
25118 | + spin_lock(&ali_lock); | |
25119 | + | |
25120 | + pci_read_config_dword(ali_pci, 0xCC, &val); | |
25121 | + val &= ~0x3F; /* Mask count */ | |
25122 | + val |= (1<<25) | ali_timeout_bits; | |
25123 | + pci_write_config_dword(ali_pci, 0xCC, val); | |
25124 | + | |
25125 | + spin_unlock(&ali_lock); | |
25126 | +} | |
25127 | + | |
25128 | +/* | |
25129 | + * ali_stop - stop the timer countdown | |
25130 | + * | |
25131 | + * Stop the ALi watchdog countdown | |
25132 | + */ | |
25133 | + | |
25134 | +static void ali_stop(void) | |
25135 | +{ | |
25136 | + u32 val; | |
25137 | + | |
25138 | + spin_lock(&ali_lock); | |
25139 | + | |
25140 | + pci_read_config_dword(ali_pci, 0xCC, &val); | |
25141 | + val &= ~0x3F; /* Mask count to zero (disabled) */ | |
25142 | + val &= ~(1<<25);/* and for safety mask the reset enable */ | |
25143 | + pci_write_config_dword(ali_pci, 0xCC, val); | |
25144 | + | |
25145 | + spin_unlock(&ali_lock); | |
25146 | +} | |
25147 | + | |
25148 | +/* | |
25149 | + * ali_keepalive - send a keepalive to the watchdog | |
25150 | + * | |
25151 | + * Send a keepalive to the timer (actually we restart the timer). | |
25152 | + */ | |
25153 | + | |
25154 | +static void ali_keepalive(void) | |
25155 | +{ | |
25156 | + ali_start(); | |
25157 | +} | |
25158 | + | |
25159 | +/* | |
25160 | + * ali_settimer - compute the timer reload value | |
25161 | + * @t: time in seconds | |
25162 | + * | |
25163 | + * Computes the timeout values needed | |
25164 | + */ | |
25165 | + | |
25166 | +static int ali_settimer(int t) | |
25167 | +{ | |
25168 | + if(t < 0) | |
25169 | + return -EINVAL; | |
25170 | + else if(t < 60) | |
25171 | + ali_timeout_bits = t|(1<<6); | |
25172 | + else if(t < 3600) | |
25173 | + ali_timeout_bits = (t/60)|(1<<7); | |
25174 | + else if(t < 18000) | |
25175 | + ali_timeout_bits = (t/300)|(1<<6)|(1<<7); | |
25176 | + else return -EINVAL; | |
25177 | + | |
25178 | + timeout = t; | |
25179 | + return 0; | |
25180 | +} | |
25181 | + | |
25182 | +/* | |
25183 | + * /dev/watchdog handling | |
25184 | + */ | |
25185 | + | |
25186 | +/* | |
25187 | + * ali_write - writes to ALi watchdog | |
25188 | + * @file: file from VFS | |
25189 | + * @data: user address of data | |
25190 | + * @len: length of data | |
25191 | + * @ppos: pointer to the file offset | |
25192 | + * | |
25193 | + * Handle a write to the ALi watchdog. Writing to the file pings | |
25194 | + * the watchdog and resets it. Writing the magic 'V' sequence allows | |
25195 | + * the next close to turn off the watchdog. | |
25196 | + */ | |
25197 | + | |
25198 | +static ssize_t ali_write(struct file *file, const char *data, | |
25199 | + size_t len, loff_t * ppos) | |
25200 | +{ | |
25201 | + /* Can't seek (pwrite) on this device */ | |
25202 | + if (ppos != &file->f_pos) | |
25203 | + return -ESPIPE; | |
25204 | + | |
25205 | + /* See if we got the magic character 'V' and reload the timer */ | |
25206 | + if (len) { | |
25207 | + if (!nowayout) { | |
25208 | + size_t i; | |
25209 | + | |
25210 | + /* note: just in case someone wrote the magic character | |
25211 | + * five months ago... */ | |
25212 | + ali_expect_release = 0; | |
25213 | + | |
25214 | + /* scan to see wether or not we got the magic character */ | |
25215 | + for (i = 0; i != len; i++) { | |
25216 | + char c; | |
25217 | + if(get_user(c, data+i)) | |
25218 | + return -EFAULT; | |
25219 | + if (c == 'V') | |
25220 | + ali_expect_release = 42; | |
25221 | + } | |
25222 | + } | |
25223 | + | |
25224 | + /* someone wrote to us, we should reload the timer */ | |
25225 | + ali_start(); | |
25226 | + } | |
25227 | + return len; | |
25228 | +} | |
25229 | + | |
25230 | +/* | |
25231 | + * ali_ioctl - handle watchdog ioctls | |
25232 | + * @inode: VFS inode | |
25233 | + * @file: VFS file pointer | |
25234 | + * @cmd: ioctl number | |
25235 | + * @arg: arguments to the ioctl | |
25236 | + * | |
25237 | + * Handle the watchdog ioctls supported by the ALi driver. Really | |
25238 | + * we want an extension to enable irq ack monitoring and the like | |
25239 | + */ | |
25240 | + | |
25241 | +static int ali_ioctl(struct inode *inode, struct file *file, | |
25242 | + unsigned int cmd, unsigned long arg) | |
25243 | +{ | |
25244 | + static struct watchdog_info ident = { | |
25245 | + .options = WDIOF_KEEPALIVEPING | | |
25246 | + WDIOF_SETTIMEOUT | | |
25247 | + WDIOF_MAGICCLOSE, | |
25248 | + .firmware_version = 0, | |
25249 | + .identity = "ALi M1535 WatchDog Timer", | |
25250 | + }; | |
25251 | + | |
25252 | + switch (cmd) { | |
25253 | + case WDIOC_GETSUPPORT: | |
25254 | + return copy_to_user((struct watchdog_info *) arg, &ident, | |
25255 | + sizeof (ident)) ? -EFAULT : 0; | |
25256 | + | |
25257 | + case WDIOC_GETSTATUS: | |
25258 | + case WDIOC_GETBOOTSTATUS: | |
25259 | + return put_user(0, (int *) arg); | |
25260 | + | |
25261 | + case WDIOC_KEEPALIVE: | |
25262 | + ali_keepalive(); | |
25263 | + return 0; | |
25264 | + | |
25265 | + case WDIOC_SETOPTIONS: | |
25266 | + { | |
25267 | + int new_options, retval = -EINVAL; | |
25268 | + | |
25269 | + if (get_user (new_options, (int *) arg)) | |
25270 | + return -EFAULT; | |
25271 | + | |
25272 | + if (new_options & WDIOS_DISABLECARD) { | |
25273 | + ali_stop(); | |
25274 | + retval = 0; | |
25275 | + } | |
25276 | + | |
25277 | + if (new_options & WDIOS_ENABLECARD) { | |
25278 | + ali_start(); | |
25279 | + retval = 0; | |
25280 | + } | |
25281 | + | |
25282 | + return retval; | |
25283 | + } | |
25284 | + | |
25285 | + case WDIOC_SETTIMEOUT: | |
25286 | + { | |
25287 | + int new_timeout; | |
25288 | + | |
25289 | + if (get_user(new_timeout, (int *) arg)) | |
25290 | + return -EFAULT; | |
25291 | + | |
25292 | + if (ali_settimer(new_timeout)) | |
25293 | + return -EINVAL; | |
25294 | + | |
25295 | + ali_keepalive(); | |
25296 | + /* Fall */ | |
25297 | + } | |
25298 | + | |
25299 | + case WDIOC_GETTIMEOUT: | |
25300 | + return put_user(timeout, (int *)arg); | |
25301 | + | |
25302 | + default: | |
25303 | + return -ENOIOCTLCMD; | |
25304 | + } | |
25305 | +} | |
25306 | + | |
25307 | +/* | |
25308 | + * ali_open - handle open of ali watchdog | |
25309 | + * @inode: inode from VFS | |
25310 | + * @file: file from VFS | |
25311 | + * | |
25312 | + * Open the ALi watchdog device. Ensure only one person opens it | |
25313 | + * at a time. Also start the watchdog running. | |
25314 | + */ | |
25315 | + | |
25316 | +static int ali_open(struct inode *inode, struct file *file) | |
25317 | +{ | |
25318 | + /* /dev/watchdog can only be opened once */ | |
25319 | + if (test_and_set_bit(0, &ali_is_open)) | |
25320 | + return -EBUSY; | |
25321 | + | |
25322 | + /* Activate */ | |
25323 | + ali_start(); | |
25324 | + return 0; | |
25325 | +} | |
25326 | + | |
25327 | +/* | |
25328 | + * ali_release - close an ALi watchdog | |
25329 | + * @inode: inode from VFS | |
25330 | + * @file: file from VFS | |
25331 | + * | |
25332 | + * Close the ALi watchdog device. Actual shutdown of the timer | |
25333 | + * only occurs if the magic sequence has been set. | |
25334 | + */ | |
25335 | + | |
25336 | +static int ali_release(struct inode *inode, struct file *file) | |
25337 | +{ | |
25338 | + /* | |
25339 | + * Shut off the timer. | |
25340 | + */ | |
25341 | + if (ali_expect_release == 42) { | |
25342 | + ali_stop(); | |
25343 | + } else { | |
25344 | + printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); | |
25345 | + ali_keepalive(); | |
25346 | + } | |
25347 | + clear_bit(0, &ali_is_open); | |
25348 | + ali_expect_release = 0; | |
25349 | + return 0; | |
25350 | +} | |
25351 | + | |
25352 | +/* | |
25353 | + * ali_notify_sys - System down notifier | |
25354 | + * | |
25355 | + * Notifier for system down | |
25356 | + */ | |
25357 | + | |
25358 | + | |
25359 | +static int ali_notify_sys(struct notifier_block *this, unsigned long code, void *unused) | |
25360 | +{ | |
25361 | + if (code==SYS_DOWN || code==SYS_HALT) { | |
25362 | + /* Turn the WDT off */ | |
25363 | + ali_stop(); | |
25364 | + } | |
25365 | + | |
25366 | + return NOTIFY_DONE; | |
25367 | +} | |
25368 | + | |
25369 | +/* | |
25370 | + * Data for PCI driver interface | |
25371 | + * | |
25372 | + * This data only exists for exporting the supported | |
25373 | + * PCI ids via MODULE_DEVICE_TABLE. We do not actually | |
25374 | + * register a pci_driver, because someone else might one day | |
25375 | + * want to register another driver on the same PCI id. | |
25376 | + */ | |
25377 | + | |
25378 | +static struct pci_device_id ali_pci_tbl[] __initdata = { | |
25379 | + { PCI_VENDOR_ID_AL, 1535, PCI_ANY_ID, PCI_ANY_ID,}, | |
25380 | + { 0, }, | |
25381 | +}; | |
25382 | +MODULE_DEVICE_TABLE(pci, ali_pci_tbl); | |
25383 | + | |
25384 | +/* | |
25385 | + * ali_find_watchdog - find a 1535 and 7101 | |
25386 | + * | |
25387 | + * Scans the PCI hardware for a 1535 series bridge and matching 7101 | |
25388 | + * watchdog device. This may be overtight but it is better to be safe | |
25389 | + */ | |
25390 | + | |
25391 | +static int __init ali_find_watchdog(void) | |
25392 | +{ | |
25393 | + struct pci_dev *pdev; | |
25394 | + u32 wdog; | |
25395 | + | |
25396 | + /* Check for a 1535 series bridge */ | |
25397 | + pdev = pci_find_device(PCI_VENDOR_ID_AL, 0x1535, NULL); | |
25398 | + if(pdev == NULL) | |
25399 | + return -ENODEV; | |
25400 | + | |
25401 | + /* Check for the a 7101 PMU */ | |
25402 | + pdev = pci_find_device(PCI_VENDOR_ID_AL, 0x7101, NULL); | |
25403 | + if(pdev == NULL) | |
25404 | + return -ENODEV; | |
25405 | + | |
25406 | + if(pci_enable_device(pdev)) | |
25407 | + return -EIO; | |
25408 | + | |
25409 | + ali_pci = pdev; | |
25410 | + | |
25411 | + /* | |
25412 | + * Initialize the timer bits | |
25413 | + */ | |
25414 | + pci_read_config_dword(pdev, 0xCC, &wdog); | |
25415 | + | |
25416 | + wdog &= ~0x3F; /* Timer bits */ | |
25417 | + wdog &= ~((1<<27)|(1<<26)|(1<<25)|(1<<24)); /* Issued events */ | |
25418 | + wdog &= ~((1<<16)|(1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9)); /* No monitor bits */ | |
25419 | + | |
25420 | + pci_write_config_dword(pdev, 0xCC, wdog); | |
25421 | + | |
25422 | + return 0; | |
25423 | +} | |
25424 | + | |
25425 | +/* | |
25426 | + * Kernel Interfaces | |
25427 | + */ | |
25428 | + | |
25429 | +static struct file_operations ali_fops = { | |
25430 | + .owner = THIS_MODULE, | |
25431 | + .llseek = no_llseek, | |
25432 | + .write = ali_write, | |
25433 | + .ioctl = ali_ioctl, | |
25434 | + .open = ali_open, | |
25435 | + .release = ali_release, | |
25436 | +}; | |
25437 | + | |
25438 | +static struct miscdevice ali_miscdev = { | |
25439 | + .minor = WATCHDOG_MINOR, | |
25440 | + .name = "watchdog", | |
25441 | + .fops = &ali_fops, | |
25442 | +}; | |
25443 | + | |
25444 | +static struct notifier_block ali_notifier = { | |
25445 | + .notifier_call = ali_notify_sys, | |
25446 | + .next = NULL, | |
25447 | + .priority = 0, | |
25448 | +}; | |
25449 | + | |
25450 | +/* | |
25451 | + * watchdog_init - module initialiser | |
25452 | + * | |
25453 | + * Scan for a suitable watchdog and if so initialize it. Return an error | |
25454 | + * if we cannot, the error causes the module to unload | |
25455 | + */ | |
25456 | + | |
25457 | +static int __init watchdog_init(void) | |
25458 | +{ | |
25459 | + int ret; | |
25460 | + | |
25461 | + spin_lock_init(&ali_lock); | |
25462 | + | |
25463 | + /* Check wether or not the hardware watchdog is there */ | |
25464 | + if (ali_find_watchdog() != 0) { | |
25465 | + return -ENODEV; | |
25466 | + } | |
25467 | + | |
25468 | + /* Check that the timeout value is within it's range ; if not reset to the default */ | |
25469 | + if (timeout < 1 || timeout >= 18000) { | |
25470 | + timeout = WATCHDOG_TIMEOUT; | |
25471 | + printk(KERN_INFO PFX "timeout value must be 0<timeout<18000, using %d\n", | |
25472 | + timeout); | |
25473 | + } | |
25474 | + | |
25475 | + /* Calculate the watchdog's timeout */ | |
25476 | + ali_settimer(timeout); | |
25477 | + | |
25478 | + ret = misc_register(&ali_miscdev); | |
25479 | + if (ret != 0) { | |
25480 | + printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", | |
25481 | + WATCHDOG_MINOR, ret); | |
25482 | + goto out; | |
25483 | + } | |
25484 | + | |
25485 | + ret = register_reboot_notifier(&ali_notifier); | |
25486 | + if (ret != 0) { | |
25487 | + printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", | |
25488 | + ret); | |
25489 | + goto unreg_miscdev; | |
25490 | + } | |
25491 | + | |
25492 | + printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", | |
25493 | + timeout, nowayout); | |
25494 | + | |
25495 | +out: | |
25496 | + return ret; | |
25497 | +unreg_miscdev: | |
25498 | + misc_deregister(&ali_miscdev); | |
25499 | + goto out; | |
25500 | +} | |
25501 | + | |
25502 | +/* | |
25503 | + * watchdog_exit - module de-initialiser | |
25504 | + * | |
25505 | + * Called while unloading a successfully installed watchdog module. | |
25506 | + */ | |
25507 | + | |
25508 | +static void __exit watchdog_exit(void) | |
25509 | +{ | |
25510 | + /* Stop the timer before we leave */ | |
25511 | + ali_stop(); | |
25512 | + | |
25513 | + /* Deregister */ | |
25514 | + unregister_reboot_notifier(&ali_notifier); | |
25515 | + misc_deregister(&ali_miscdev); | |
25516 | +} | |
25517 | + | |
25518 | +module_init(watchdog_init); | |
25519 | +module_exit(watchdog_exit); | |
25520 | + | |
25521 | +MODULE_AUTHOR("Alan Cox"); | |
25522 | +MODULE_DESCRIPTION("ALi M1535 PMU Watchdog Timer driver"); | |
25523 | +MODULE_LICENSE("GPL"); | |
25524 | diff -Nru a/drivers/char/watchdog/cpu5wdt.c b/drivers/char/watchdog/cpu5wdt.c | |
25525 | --- a/drivers/char/watchdog/cpu5wdt.c Thu Feb 13 06:54:43 2003 | |
25526 | +++ b/drivers/char/watchdog/cpu5wdt.c Tue Aug 26 09:25:41 2003 | |
25527 | @@ -134,7 +134,7 @@ | |
25528 | ||
25529 | static int cpu5wdt_open(struct inode *inode, struct file *file) | |
25530 | { | |
25531 | - switch(minor(inode->i_rdev)) { | |
25532 | + switch(iminor(inode)) { | |
25533 | case WATCHDOG_MINOR: | |
25534 | if ( test_and_set_bit(0, &cpu5wdt_device.inuse) ) | |
25535 | return -EBUSY; | |
25536 | @@ -148,7 +148,7 @@ | |
25537 | ||
25538 | static int cpu5wdt_release(struct inode *inode, struct file *file) | |
25539 | { | |
25540 | - if(minor(inode->i_rdev)==WATCHDOG_MINOR) { | |
25541 | + if(iminor(inode)==WATCHDOG_MINOR) { | |
25542 | clear_bit(0, &cpu5wdt_device.inuse); | |
25543 | } | |
25544 | return 0; | |
25545 | diff -Nru a/drivers/char/watchdog/ib700wdt.c b/drivers/char/watchdog/ib700wdt.c | |
25546 | --- a/drivers/char/watchdog/ib700wdt.c Fri Aug 8 03:28:08 2003 | |
25547 | +++ b/drivers/char/watchdog/ib700wdt.c Tue Aug 26 09:25:41 2003 | |
25548 | @@ -218,7 +218,7 @@ | |
25549 | static int | |
25550 | ibwdt_open(struct inode *inode, struct file *file) | |
25551 | { | |
25552 | - if (minor(inode->i_rdev) == WATCHDOG_MINOR) { | |
25553 | + if (iminor(inode) == WATCHDOG_MINOR) { | |
25554 | spin_lock(&ibwdt_lock); | |
25555 | if (ibwdt_is_open) { | |
25556 | spin_unlock(&ibwdt_lock); | |
25557 | @@ -240,7 +240,7 @@ | |
25558 | static int | |
25559 | ibwdt_close(struct inode *inode, struct file *file) | |
25560 | { | |
25561 | - if (minor(inode->i_rdev) == WATCHDOG_MINOR) { | |
25562 | + if (iminor(inode) == WATCHDOG_MINOR) { | |
25563 | spin_lock(&ibwdt_lock); | |
25564 | if (expect_close) | |
25565 | outb_p(wd_times[wd_margin], WDT_STOP); | |
25566 | diff -Nru a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c | |
25567 | --- a/drivers/char/watchdog/machzwd.c Fri Aug 8 03:28:08 2003 | |
25568 | +++ b/drivers/char/watchdog/machzwd.c Tue Aug 26 09:25:41 2003 | |
25569 | @@ -377,7 +377,7 @@ | |
25570 | ||
25571 | static int zf_open(struct inode *inode, struct file *file) | |
25572 | { | |
25573 | - switch(minor(inode->i_rdev)){ | |
25574 | + switch(iminor(inode)){ | |
25575 | case WATCHDOG_MINOR: | |
25576 | spin_lock(&zf_lock); | |
25577 | if(zf_is_open){ | |
25578 | @@ -402,7 +402,7 @@ | |
25579 | ||
25580 | static int zf_close(struct inode *inode, struct file *file) | |
25581 | { | |
25582 | - if(minor(inode->i_rdev) == WATCHDOG_MINOR){ | |
25583 | + if(iminor(inode) == WATCHDOG_MINOR){ | |
25584 | ||
25585 | if(zf_expect_close){ | |
25586 | zf_timer_off(); | |
25587 | diff -Nru a/drivers/char/watchdog/pcwd.c b/drivers/char/watchdog/pcwd.c | |
25588 | --- a/drivers/char/watchdog/pcwd.c Fri Aug 1 03:02:31 2003 | |
25589 | +++ b/drivers/char/watchdog/pcwd.c Tue Aug 26 09:25:41 2003 | |
25590 | @@ -426,7 +426,7 @@ | |
25591 | ||
25592 | static int pcwd_open(struct inode *ino, struct file *filep) | |
25593 | { | |
25594 | - switch (minor(ino->i_rdev)) { | |
25595 | + switch (iminor(ino)) { | |
25596 | case WATCHDOG_MINOR: | |
25597 | if (!atomic_dec_and_test(&open_allowed) ) { | |
25598 | atomic_inc( &open_allowed ); | |
25599 | @@ -457,7 +457,7 @@ | |
25600 | /* Can't seek (pread) on this device */ | |
25601 | if (ppos != &file->f_pos) | |
25602 | return -ESPIPE; | |
25603 | - switch(minor(file->f_dentry->d_inode->i_rdev)) | |
25604 | + switch(iminor(file->f_dentry->d_inode)) | |
25605 | { | |
25606 | case TEMP_MINOR: | |
25607 | /* | |
25608 | @@ -477,7 +477,7 @@ | |
25609 | ||
25610 | static int pcwd_close(struct inode *ino, struct file *filep) | |
25611 | { | |
25612 | - if (minor(ino->i_rdev)==WATCHDOG_MINOR) { | |
25613 | + if (iminor(ino)==WATCHDOG_MINOR) { | |
25614 | if (expect_close) { | |
25615 | /* Disable the board */ | |
25616 | if (revision == PCWD_REVISION_C) { | |
25617 | diff -Nru a/drivers/char/watchdog/wafer5823wdt.c b/drivers/char/watchdog/wafer5823wdt.c | |
25618 | --- a/drivers/char/watchdog/wafer5823wdt.c Fri Aug 1 03:02:31 2003 | |
25619 | +++ b/drivers/char/watchdog/wafer5823wdt.c Wed Sep 3 12:58:44 2003 | |
25620 | @@ -1,5 +1,5 @@ | |
25621 | /* | |
25622 | - * ICP Wafer 5823 Single Board Computer WDT driver for Linux 2.4.x | |
25623 | + * ICP Wafer 5823 Single Board Computer WDT driver | |
25624 | * http://www.icpamerica.com/wafer_5823.php | |
25625 | * May also work on other similar models | |
25626 | * | |
25627 | @@ -17,10 +17,10 @@ | |
25628 | * modify it under the terms of the GNU General Public License | |
25629 | * as published by the Free Software Foundation; either version | |
25630 | * 2 of the License, or (at your option) any later version. | |
25631 | - * | |
25632 | - * Neither Alan Cox nor CymruNet Ltd. admit liability nor provide | |
25633 | - * warranty for any of this software. This material is provided | |
25634 | - * "AS-IS" and at no charge. | |
25635 | + * | |
25636 | + * Neither Alan Cox nor CymruNet Ltd. admit liability nor provide | |
25637 | + * warranty for any of this software. This material is provided | |
25638 | + * "AS-IS" and at no charge. | |
25639 | * | |
25640 | * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk> | |
25641 | * | |
25642 | @@ -39,9 +39,13 @@ | |
25643 | #include <asm/io.h> | |
25644 | #include <asm/uaccess.h> | |
25645 | ||
25646 | +#define WATCHDOG_NAME "Wafer 5823 WDT" | |
25647 | +#define PFX WATCHDOG_NAME ": " | |
25648 | +#define WD_TIMO 60 /* 60 sec default timeout */ | |
25649 | + | |
25650 | static unsigned long wafwdt_is_open; | |
25651 | +static char expect_close; | |
25652 | static spinlock_t wafwdt_lock; | |
25653 | -static int expect_close = 0; | |
25654 | ||
25655 | /* | |
25656 | * You must set these - there is no sane way to probe for this board. | |
25657 | @@ -52,11 +56,12 @@ | |
25658 | * to restart it again. | |
25659 | */ | |
25660 | ||
25661 | -#define WDT_START 0x443 | |
25662 | -#define WDT_STOP 0x843 | |
25663 | +static int wdt_stop = 0x843; | |
25664 | +static int wdt_start = 0x443; | |
25665 | ||
25666 | -#define WD_TIMO 60 /* 1 minute */ | |
25667 | -static int wd_margin = WD_TIMO; | |
25668 | +static int timeout = WD_TIMO; /* in seconds */ | |
25669 | +module_param(timeout, int, 0); | |
25670 | +MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WD_TIMO) "."); | |
25671 | ||
25672 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | |
25673 | static int nowayout = 1; | |
25674 | @@ -70,24 +75,24 @@ | |
25675 | static void wafwdt_ping(void) | |
25676 | { | |
25677 | /* pat watchdog */ | |
25678 | - spin_lock(&wafwdt_lock); | |
25679 | - inb_p(WDT_STOP); | |
25680 | - inb_p(WDT_START); | |
25681 | - spin_unlock(&wafwdt_lock); | |
25682 | + spin_lock(&wafwdt_lock); | |
25683 | + inb_p(wdt_stop); | |
25684 | + inb_p(wdt_start); | |
25685 | + spin_unlock(&wafwdt_lock); | |
25686 | } | |
25687 | ||
25688 | static void wafwdt_start(void) | |
25689 | { | |
25690 | /* start up watchdog */ | |
25691 | - outb_p(wd_margin, WDT_START); | |
25692 | - inb_p(WDT_START); | |
25693 | + outb_p(timeout, wdt_start); | |
25694 | + inb_p(wdt_start); | |
25695 | } | |
25696 | ||
25697 | static void | |
25698 | wafwdt_stop(void) | |
25699 | { | |
25700 | /* stop watchdog */ | |
25701 | - inb_p(WDT_STOP); | |
25702 | + inb_p(wdt_stop); | |
25703 | } | |
25704 | ||
25705 | static ssize_t wafwdt_write(struct file *file, const char *buf, size_t count, loff_t * ppos) | |
25706 | @@ -96,6 +101,7 @@ | |
25707 | if (ppos != &file->f_pos) | |
25708 | return -ESPIPE; | |
25709 | ||
25710 | + /* See if we got the magic character 'V' and reload the timer */ | |
25711 | if (count) { | |
25712 | if (!nowayout) { | |
25713 | size_t i; | |
25714 | @@ -103,30 +109,30 @@ | |
25715 | /* In case it was set long ago */ | |
25716 | expect_close = 0; | |
25717 | ||
25718 | + /* scan to see wether or not we got the magic character */ | |
25719 | for (i = 0; i != count; i++) { | |
25720 | char c; | |
25721 | if (get_user(c, buf + i)) | |
25722 | return -EFAULT; | |
25723 | if (c == 'V') | |
25724 | - expect_close = 1; | |
25725 | + expect_close = 42; | |
25726 | } | |
25727 | } | |
25728 | + /* Well, anyhow someone wrote to us, we should return that favour */ | |
25729 | wafwdt_ping(); | |
25730 | - return 1; | |
25731 | } | |
25732 | - return 0; | |
25733 | + return count; | |
25734 | } | |
25735 | ||
25736 | static int wafwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |
25737 | unsigned long arg) | |
25738 | { | |
25739 | - int new_margin; | |
25740 | + int new_timeout; | |
25741 | static struct watchdog_info ident = { | |
25742 | .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, | |
25743 | .firmware_version = 1, | |
25744 | - .identity = "Wafer 5823 WDT" | |
25745 | + .identity = "Wafer 5823 WDT", | |
25746 | }; | |
25747 | - int one=1; | |
25748 | ||
25749 | switch (cmd) { | |
25750 | case WDIOC_GETSUPPORT: | |
25751 | @@ -136,25 +142,44 @@ | |
25752 | break; | |
25753 | ||
25754 | case WDIOC_GETSTATUS: | |
25755 | - if (copy_to_user((int *) arg, &one, sizeof (int))) | |
25756 | - return -EFAULT; | |
25757 | - break; | |
25758 | + case WDIOC_GETBOOTSTATUS: | |
25759 | + return put_user(0, (int *)arg); | |
25760 | ||
25761 | case WDIOC_KEEPALIVE: | |
25762 | wafwdt_ping(); | |
25763 | break; | |
25764 | ||
25765 | case WDIOC_SETTIMEOUT: | |
25766 | - if (get_user(new_margin, (int *)arg)) | |
25767 | + if (get_user(new_timeout, (int *)arg)) | |
25768 | return -EFAULT; | |
25769 | - if ((new_margin < 1) || (new_margin > 255)) | |
25770 | + if ((new_timeout < 1) || (new_timeout > 255)) | |
25771 | return -EINVAL; | |
25772 | - wd_margin = new_margin; | |
25773 | + timeout = new_timeout; | |
25774 | wafwdt_stop(); | |
25775 | wafwdt_start(); | |
25776 | /* Fall */ | |
25777 | case WDIOC_GETTIMEOUT: | |
25778 | - return put_user(wd_margin, (int *)arg); | |
25779 | + return put_user(timeout, (int *)arg); | |
25780 | + | |
25781 | + case WDIOC_SETOPTIONS: | |
25782 | + { | |
25783 | + int options, retval = -EINVAL; | |
25784 | + | |
25785 | + if (get_user(options, (int *)arg)) | |
25786 | + return -EFAULT; | |
25787 | + | |
25788 | + if (options & WDIOS_DISABLECARD) { | |
25789 | + wafwdt_start(); | |
25790 | + retval = 0; | |
25791 | + } | |
25792 | + | |
25793 | + if (options & WDIOS_ENABLECARD) { | |
25794 | + wafwdt_stop(); | |
25795 | + retval = 0; | |
25796 | + } | |
25797 | + | |
25798 | + return retval; | |
25799 | + } | |
25800 | ||
25801 | default: | |
25802 | return -ENOTTY; | |
25803 | @@ -166,6 +191,10 @@ | |
25804 | { | |
25805 | if (test_and_set_bit(0, &wafwdt_is_open)) | |
25806 | return -EBUSY; | |
25807 | + | |
25808 | + /* | |
25809 | + * Activate | |
25810 | + */ | |
25811 | wafwdt_start(); | |
25812 | return 0; | |
25813 | } | |
25814 | @@ -173,12 +202,14 @@ | |
25815 | static int | |
25816 | wafwdt_close(struct inode *inode, struct file *file) | |
25817 | { | |
25818 | - clear_bit(0, &wafwdt_is_open); | |
25819 | - if (expect_close) { | |
25820 | + if (expect_close == 42) { | |
25821 | wafwdt_stop(); | |
25822 | } else { | |
25823 | - printk(KERN_CRIT "WDT device closed unexpectedly. WDT will not stop!\n"); | |
25824 | + printk(KERN_CRIT PFX "WDT device closed unexpectedly. WDT will not stop!\n"); | |
25825 | + wafwdt_ping(); | |
25826 | } | |
25827 | + clear_bit(0, &wafwdt_is_open); | |
25828 | + expect_close = 0; | |
25829 | return 0; | |
25830 | } | |
25831 | ||
25832 | @@ -201,6 +232,7 @@ | |
25833 | ||
25834 | static struct file_operations wafwdt_fops = { | |
25835 | .owner = THIS_MODULE, | |
25836 | + .llseek = no_llseek, | |
25837 | .write = wafwdt_write, | |
25838 | .ioctl = wafwdt_ioctl, | |
25839 | .open = wafwdt_open, | |
25840 | @@ -210,53 +242,93 @@ | |
25841 | static struct miscdevice wafwdt_miscdev = { | |
25842 | .minor = WATCHDOG_MINOR, | |
25843 | .name = "watchdog", | |
25844 | - .fops = &wafwdt_fops | |
25845 | + .fops = &wafwdt_fops, | |
25846 | }; | |
25847 | ||
25848 | /* | |
25849 | * The WDT needs to learn about soft shutdowns in order to | |
25850 | - * turn the timebomb registers off. | |
25851 | + * turn the timebomb registers off. | |
25852 | */ | |
25853 | ||
25854 | static struct notifier_block wafwdt_notifier = { | |
25855 | .notifier_call = wafwdt_notify_sys, | |
25856 | .next = NULL, | |
25857 | - .priority = 0 | |
25858 | + .priority = 0, | |
25859 | }; | |
25860 | ||
25861 | static int __init wafwdt_init(void) | |
25862 | { | |
25863 | + int ret; | |
25864 | + | |
25865 | printk(KERN_INFO "WDT driver for Wafer 5823 single board computer initialising.\n"); | |
25866 | ||
25867 | spin_lock_init(&wafwdt_lock); | |
25868 | - if(!request_region(WDT_STOP, 1, "Wafer 5823 WDT")) | |
25869 | - goto error; | |
25870 | - if(!request_region(WDT_START, 1, "Wafer 5823 WDT")) | |
25871 | + | |
25872 | + if (timeout < 1 || timeout > 255) { | |
25873 | + timeout = WD_TIMO; | |
25874 | + printk (KERN_INFO PFX "timeout value must be 1<=x<=255, using %d\n", | |
25875 | + timeout); | |
25876 | + } | |
25877 | + | |
25878 | + if (wdt_stop != wdt_start) { | |
25879 | + if(!request_region(wdt_stop, 1, "Wafer 5823 WDT")) { | |
25880 | + printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", | |
25881 | + wdt_stop); | |
25882 | + ret = -EIO; | |
25883 | + goto error; | |
25884 | + } | |
25885 | + } | |
25886 | + | |
25887 | + if(!request_region(wdt_start, 1, "Wafer 5823 WDT")) { | |
25888 | + printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", | |
25889 | + wdt_start); | |
25890 | + ret = -EIO; | |
25891 | goto error2; | |
25892 | - if(misc_register(&wafwdt_miscdev)<0) | |
25893 | + } | |
25894 | + | |
25895 | + ret = register_reboot_notifier(&wafwdt_notifier); | |
25896 | + if (ret != 0) { | |
25897 | + printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", | |
25898 | + ret); | |
25899 | goto error3; | |
25900 | - register_reboot_notifier(&wafwdt_notifier); | |
25901 | - return 0; | |
25902 | + } | |
25903 | + | |
25904 | + ret = misc_register(&wafwdt_miscdev); | |
25905 | + if (ret != 0) { | |
25906 | + printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", | |
25907 | + WATCHDOG_MINOR, ret); | |
25908 | + goto error4; | |
25909 | + } | |
25910 | + | |
25911 | + printk (KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", | |
25912 | + timeout, nowayout); | |
25913 | + | |
25914 | + return ret; | |
25915 | +error4: | |
25916 | + unregister_reboot_notifier(&wafwdt_notifier); | |
25917 | error3: | |
25918 | - release_region(WDT_START, 1); | |
25919 | + release_region(wdt_start, 1); | |
25920 | error2: | |
25921 | - release_region(WDT_STOP, 1); | |
25922 | + if (wdt_stop != wdt_start) | |
25923 | + release_region(wdt_stop, 1); | |
25924 | error: | |
25925 | - return -ENODEV; | |
25926 | + return ret; | |
25927 | } | |
25928 | ||
25929 | static void __exit wafwdt_exit(void) | |
25930 | { | |
25931 | misc_deregister(&wafwdt_miscdev); | |
25932 | unregister_reboot_notifier(&wafwdt_notifier); | |
25933 | - release_region(WDT_STOP, 1); | |
25934 | - release_region(WDT_START, 1); | |
25935 | + if(wdt_stop != wdt_start) | |
25936 | + release_region(wdt_stop, 1); | |
25937 | + release_region(wdt_start, 1); | |
25938 | } | |
25939 | ||
25940 | module_init(wafwdt_init); | |
25941 | module_exit(wafwdt_exit); | |
25942 | ||
25943 | MODULE_AUTHOR("Justin Cormack"); | |
25944 | +MODULE_DESCRIPTION("ICP Wafer 5823 Single Board Computer WDT driver"); | |
25945 | MODULE_LICENSE("GPL"); | |
25946 | ||
25947 | /* end of wafer5823wdt.c */ | |
25948 | diff -Nru a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c | |
25949 | --- a/drivers/char/watchdog/wdt.c Thu Apr 24 05:36:57 2003 | |
25950 | +++ b/drivers/char/watchdog/wdt.c Wed Sep 3 23:40:14 2003 | |
25951 | @@ -290,7 +290,7 @@ | |
25952 | if (ptr != &file->f_pos) | |
25953 | return -ESPIPE; | |
25954 | ||
25955 | - switch(minor(file->f_dentry->d_inode->i_rdev)) | |
25956 | + switch(iminor(file->f_dentry->d_inode)) | |
25957 | { | |
25958 | case TEMP_MINOR: | |
25959 | c*=11; | |
25960 | @@ -373,7 +373,7 @@ | |
25961 | ||
25962 | static int wdt_open(struct inode *inode, struct file *file) | |
25963 | { | |
25964 | - switch(minor(inode->i_rdev)) | |
25965 | + switch(iminor(inode)) | |
25966 | { | |
25967 | case WATCHDOG_MINOR: | |
25968 | if(test_and_set_bit(0, &wdt_is_open)) | |
25969 | @@ -413,7 +413,7 @@ | |
25970 | ||
25971 | static int wdt_release(struct inode *inode, struct file *file) | |
25972 | { | |
25973 | - if(minor(inode->i_rdev)==WATCHDOG_MINOR) | |
25974 | + if(iminor(inode)==WATCHDOG_MINOR) | |
25975 | { | |
25976 | if (expect_close) { | |
25977 | inb_p(WDT_DC); /* Disable counters */ | |
25978 | @@ -579,4 +579,6 @@ | |
25979 | ||
25980 | MODULE_AUTHOR("Alan Cox"); | |
25981 | MODULE_DESCRIPTION("Driver for ISA ICS watchdog cards (WDT500/501)"); | |
25982 | +MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | |
25983 | +MODULE_ALIAS_MISCDEV(TEMP_MINOR); | |
25984 | MODULE_LICENSE("GPL"); | |
25985 | diff -Nru a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c | |
25986 | --- a/drivers/char/watchdog/wdt_pci.c Fri Aug 1 11:59:44 2003 | |
25987 | +++ b/drivers/char/watchdog/wdt_pci.c Tue Aug 26 09:25:41 2003 | |
25988 | @@ -276,7 +276,7 @@ | |
25989 | if (ptr != &file->f_pos) | |
25990 | return -ESPIPE; | |
25991 | ||
25992 | - switch(minor(file->f_dentry->d_inode->i_rdev)) | |
25993 | + switch(iminor(file->f_dentry->d_inode)) | |
25994 | { | |
25995 | case TEMP_MINOR: | |
25996 | c*=11; | |
25997 | @@ -361,7 +361,7 @@ | |
25998 | { | |
25999 | unsigned long flags; | |
26000 | ||
26001 | - switch(minor(inode->i_rdev)) | |
26002 | + switch(iminor(inode)) | |
26003 | { | |
26004 | case WATCHDOG_MINOR: | |
26005 | if (down_trylock(&open_sem)) | |
26006 | @@ -423,7 +423,7 @@ | |
26007 | static int wdtpci_release(struct inode *inode, struct file *file) | |
26008 | { | |
26009 | ||
26010 | - if (minor(inode->i_rdev)==WATCHDOG_MINOR) { | |
26011 | + if (iminor(inode)==WATCHDOG_MINOR) { | |
26012 | unsigned long flags; | |
26013 | if (expect_close) { | |
26014 | spin_lock_irqsave(&wdtpci_lock, flags); | |
26015 | diff -Nru a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig | |
26016 | --- a/drivers/i2c/Kconfig Fri Aug 1 21:55:21 2003 | |
26017 | +++ b/drivers/i2c/Kconfig Tue Aug 26 11:58:28 2003 | |
26018 | @@ -150,7 +150,7 @@ | |
26019 | ||
26020 | config I2C_ELEKTOR | |
26021 | tristate "Elektor ISA card" | |
26022 | - depends on I2C_ALGOPCF | |
26023 | + depends on I2C_ALGOPCF && BROKEN_ON_SMP | |
26024 | help | |
26025 | This supports the PCF8584 ISA bus I2C adapter. Say Y if you own | |
26026 | such an adapter. | |
26027 | diff -Nru a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c | |
26028 | --- a/drivers/i2c/i2c-dev.c Wed Aug 6 02:26:55 2003 | |
26029 | +++ b/drivers/i2c/i2c-dev.c Tue Aug 26 09:25:41 2003 | |
26030 | @@ -138,7 +138,7 @@ | |
26031 | return -ENOMEM; | |
26032 | ||
26033 | pr_debug("i2c-dev.o: i2c-%d reading %d bytes.\n", | |
26034 | - minor(file->f_dentry->d_inode->i_rdev), count); | |
26035 | + iminor(file->f_dentry->d_inode), count); | |
26036 | ||
26037 | ret = i2c_master_recv(client,tmp,count); | |
26038 | if (ret >= 0) | |
26039 | @@ -166,7 +166,7 @@ | |
26040 | } | |
26041 | ||
26042 | pr_debug("i2c-dev.o: i2c-%d writing %d bytes.\n", | |
26043 | - minor(file->f_dentry->d_inode->i_rdev), count); | |
26044 | + iminor(file->f_dentry->d_inode), count); | |
26045 | ||
26046 | ret = i2c_master_send(client,tmp,count); | |
26047 | kfree(tmp); | |
26048 | @@ -186,7 +186,7 @@ | |
26049 | unsigned long funcs; | |
26050 | ||
26051 | dev_dbg(&client->dev, "i2c-%d ioctl, cmd: 0x%x, arg: %lx.\n", | |
26052 | - minor(inode->i_rdev),cmd, arg); | |
26053 | + iminor(inode),cmd, arg); | |
26054 | ||
26055 | switch ( cmd ) { | |
26056 | case I2C_SLAVE: | |
26057 | @@ -373,7 +373,7 @@ | |
26058 | ||
26059 | static int i2cdev_open(struct inode *inode, struct file *file) | |
26060 | { | |
26061 | - unsigned int minor = minor(inode->i_rdev); | |
26062 | + unsigned int minor = iminor(inode); | |
26063 | struct i2c_client *client; | |
26064 | struct i2c_adapter *adap; | |
26065 | struct i2c_dev *i2c_dev; | |
26066 | diff -Nru a/drivers/i2c/i2c-keywest.c b/drivers/i2c/i2c-keywest.c | |
26067 | --- a/drivers/i2c/i2c-keywest.c Wed Jul 9 04:45:34 2003 | |
26068 | +++ b/drivers/i2c/i2c-keywest.c Tue Aug 26 06:35:38 2003 | |
26069 | @@ -81,9 +81,6 @@ | |
26070 | int probe = 0; | |
26071 | int debug = 0; | |
26072 | ||
26073 | -static struct keywest_iface *ifaces = NULL; | |
26074 | - | |
26075 | - | |
26076 | static void | |
26077 | do_stop(struct keywest_iface* iface, int result) | |
26078 | { | |
26079 | @@ -306,6 +303,7 @@ | |
26080 | write_reg(reg_control, read_reg(reg_control) | KW_I2C_CTL_XADDR); | |
26081 | write_reg(reg_ier, KW_I2C_IRQ_MASK); | |
26082 | ||
26083 | + /* Wait interrupt operations completion */ | |
26084 | wait_for_completion(&iface->complete); | |
26085 | ||
26086 | rc = iface->result; | |
26087 | @@ -385,6 +383,7 @@ | |
26088 | write_reg(reg_control, read_reg(reg_control) | KW_I2C_CTL_XADDR); | |
26089 | write_reg(reg_ier, KW_I2C_IRQ_MASK); | |
26090 | ||
26091 | + /* Wait interrupt operations completion */ | |
26092 | wait_for_completion(&iface->complete); | |
26093 | ||
26094 | rc = iface->result; | |
26095 | @@ -409,16 +408,16 @@ | |
26096 | ||
26097 | /* For now, we only handle combined mode (smbus) */ | |
26098 | static struct i2c_algorithm keywest_algorithm = { | |
26099 | - name: "Keywest i2c", | |
26100 | - id: I2C_ALGO_SMBUS, | |
26101 | - smbus_xfer: keywest_smbus_xfer, | |
26102 | - master_xfer: keywest_xfer, | |
26103 | - functionality: keywest_func, | |
26104 | + .name = "Keywest i2c", | |
26105 | + .id = I2C_ALGO_SMBUS, | |
26106 | + .smbus_xfer = keywest_smbus_xfer, | |
26107 | + .master_xfer = keywest_xfer, | |
26108 | + .functionality = keywest_func, | |
26109 | }; | |
26110 | ||
26111 | ||
26112 | static int | |
26113 | -create_iface(struct device_node* np) | |
26114 | +create_iface(struct device_node *np, struct device *dev) | |
26115 | { | |
26116 | unsigned long steps, *psteps, *prate; | |
26117 | unsigned bsteps, tsize, i, nchan, addroffset; | |
26118 | @@ -487,8 +486,8 @@ | |
26119 | *prate); | |
26120 | } | |
26121 | ||
26122 | - /* Select standard mode by default */ | |
26123 | - iface->cur_mode |= KW_I2C_MODE_STANDARD; | |
26124 | + /* Select standard sub mode */ | |
26125 | + iface->cur_mode |= KW_I2C_MODE_STANDARDSUB; | |
26126 | ||
26127 | /* Write mode */ | |
26128 | write_reg(reg_mode, iface->cur_mode); | |
26129 | @@ -506,11 +505,13 @@ | |
26130 | return -ENODEV; | |
26131 | } | |
26132 | ||
26133 | + dev_set_drvdata(dev, iface); | |
26134 | + | |
26135 | for (i=0; i<nchan; i++) { | |
26136 | struct keywest_chan* chan = &iface->channels[i]; | |
26137 | u8 addr; | |
26138 | ||
26139 | - sprintf(chan->adapter.dev.name, "%s %d", np->parent->name, i); | |
26140 | + sprintf(chan->adapter.name, "%s %d", np->parent->name, i); | |
26141 | chan->iface = iface; | |
26142 | chan->chan_no = i; | |
26143 | chan->adapter.id = I2C_ALGO_SMBUS; | |
26144 | @@ -519,11 +520,12 @@ | |
26145 | chan->adapter.client_register = NULL; | |
26146 | chan->adapter.client_unregister = NULL; | |
26147 | i2c_set_adapdata(&chan->adapter, chan); | |
26148 | + chan->adapter.dev.parent = dev; | |
26149 | ||
26150 | rc = i2c_add_adapter(&chan->adapter); | |
26151 | if (rc) { | |
26152 | printk("i2c-keywest.c: Adapter %s registration failed\n", | |
26153 | - chan->adapter.dev.name); | |
26154 | + chan->adapter.name); | |
26155 | i2c_set_adapdata(&chan->adapter, NULL); | |
26156 | } | |
26157 | if (probe) { | |
26158 | @@ -540,20 +542,18 @@ | |
26159 | printk(KERN_INFO "Found KeyWest i2c on \"%s\", %d channel%s, stepping: %d bits\n", | |
26160 | np->parent->name, nchan, nchan > 1 ? "s" : "", bsteps); | |
26161 | ||
26162 | - iface->next = ifaces; | |
26163 | - ifaces = iface; | |
26164 | return 0; | |
26165 | } | |
26166 | ||
26167 | -static void | |
26168 | -dispose_iface(struct keywest_iface *iface) | |
26169 | +static int | |
26170 | +dispose_iface(struct device *dev) | |
26171 | { | |
26172 | + struct keywest_iface *iface = dev_get_drvdata(dev); | |
26173 | int i, rc; | |
26174 | ||
26175 | - ifaces = iface->next; | |
26176 | - | |
26177 | /* Make sure we stop all activity */ | |
26178 | down(&iface->sem); | |
26179 | + | |
26180 | spin_lock_irq(&iface->lock); | |
26181 | while (iface->state != state_idle) { | |
26182 | spin_unlock_irq(&iface->lock); | |
26183 | @@ -578,31 +578,76 @@ | |
26184 | printk("i2c-keywest.c: i2c_del_adapter failed, that's bad !\n"); | |
26185 | } | |
26186 | iounmap((void *)iface->base); | |
26187 | + dev_set_drvdata(dev, NULL); | |
26188 | kfree(iface); | |
26189 | + | |
26190 | + return 0; | |
26191 | +} | |
26192 | + | |
26193 | +static int | |
26194 | +create_iface_macio(struct macio_dev* dev, const struct of_match *match) | |
26195 | +{ | |
26196 | + return create_iface(dev->ofdev.node, &dev->ofdev.dev); | |
26197 | +} | |
26198 | + | |
26199 | +static int | |
26200 | +dispose_iface_macio(struct macio_dev* dev) | |
26201 | +{ | |
26202 | + return dispose_iface(&dev->ofdev.dev); | |
26203 | +} | |
26204 | + | |
26205 | +static int | |
26206 | +create_iface_of_platform(struct of_device* dev, const struct of_match *match) | |
26207 | +{ | |
26208 | + return create_iface(dev->node, &dev->dev); | |
26209 | +} | |
26210 | + | |
26211 | +static int | |
26212 | +dispose_iface_of_platform(struct of_device* dev) | |
26213 | +{ | |
26214 | + return dispose_iface(&dev->dev); | |
26215 | } | |
26216 | ||
26217 | +static struct of_match i2c_keywest_match[] = | |
26218 | +{ | |
26219 | + { | |
26220 | + .name = OF_ANY_MATCH, | |
26221 | + .type = "i2c", | |
26222 | + .compatible = "keywest" | |
26223 | + }, | |
26224 | + {}, | |
26225 | +}; | |
26226 | + | |
26227 | +static struct macio_driver i2c_keywest_macio_driver = | |
26228 | +{ | |
26229 | + .name = "i2c-keywest", | |
26230 | + .match_table = i2c_keywest_match, | |
26231 | + .probe = create_iface_macio, | |
26232 | + .remove = dispose_iface_macio | |
26233 | +}; | |
26234 | + | |
26235 | +static struct of_platform_driver i2c_keywest_of_platform_driver = | |
26236 | +{ | |
26237 | + .name = "i2c-keywest", | |
26238 | + .match_table = i2c_keywest_match, | |
26239 | + .probe = create_iface_of_platform, | |
26240 | + .remove = dispose_iface_of_platform | |
26241 | +}; | |
26242 | + | |
26243 | static int __init | |
26244 | i2c_keywest_init(void) | |
26245 | { | |
26246 | - struct device_node *np; | |
26247 | - int rc = -ENODEV; | |
26248 | - | |
26249 | - np = find_compatible_devices("i2c", "keywest"); | |
26250 | - while (np != 0) { | |
26251 | - if (np->n_addrs >= 1 && np->n_intrs >= 1) | |
26252 | - rc = create_iface(np); | |
26253 | - np = np->next; | |
26254 | - } | |
26255 | - if (ifaces) | |
26256 | - rc = 0; | |
26257 | - return rc; | |
26258 | + macio_register_driver(&i2c_keywest_macio_driver); | |
26259 | + of_register_driver(&i2c_keywest_of_platform_driver); | |
26260 | + | |
26261 | + return 0; | |
26262 | } | |
26263 | ||
26264 | static void __exit | |
26265 | i2c_keywest_cleanup(void) | |
26266 | { | |
26267 | - while(ifaces) | |
26268 | - dispose_iface(ifaces); | |
26269 | + macio_unregister_driver(&i2c_keywest_macio_driver); | |
26270 | + of_unregister_driver(&i2c_keywest_of_platform_driver); | |
26271 | } | |
26272 | ||
26273 | module_init(i2c_keywest_init); | |
26274 | diff -Nru a/drivers/i2c/i2c-keywest.h b/drivers/i2c/i2c-keywest.h | |
26275 | --- a/drivers/i2c/i2c-keywest.h Fri Feb 15 14:32:09 2002 | |
26276 | +++ b/drivers/i2c/i2c-keywest.h Sun Aug 24 06:10:14 2003 | |
26277 | @@ -67,7 +67,6 @@ | |
26278 | int stopretry; | |
26279 | struct timer_list timeout_timer; | |
26280 | struct completion complete; | |
26281 | - struct keywest_iface* next; | |
26282 | }; | |
26283 | ||
26284 | enum { | |
26285 | diff -Nru a/drivers/ide/Kconfig b/drivers/ide/Kconfig | |
26286 | --- a/drivers/ide/Kconfig Wed Aug 13 14:35:06 2003 | |
26287 | +++ b/drivers/ide/Kconfig Wed Sep 3 09:52:16 2003 | |
26288 | @@ -815,6 +815,17 @@ | |
26289 | most of the recent Apple Power Macintoshes and PowerBooks. | |
26290 | If unsure, say Y. | |
26291 | ||
26292 | +config BLK_DEV_IDE_PMAC_ATA100FIRST | |
26293 | + bool "Probe internal ATA/100 (Kauai) first" | |
26294 | + depends on BLK_DEV_IDE_PMAC | |
26295 | + help | |
26296 | + This option will cause the ATA/100 controller found in UniNorth2 | |
26297 | + based machines (Windtunnel PowerMac, Aluminium PowerBooks, ...) | |
26298 | + to be probed before the ATA/66 and ATA/33 controllers. Without | |
26299 | + these, those machine used to have the hard disk on hdc and the | |
26300 | + CD-ROM on hda. This option changes this to more natural hda for | |
26301 | + hard disk and hdc for CD-ROM. | |
26302 | + | |
26303 | config BLK_DEV_IDEDMA_PMAC | |
26304 | bool "PowerMac IDE DMA support" | |
26305 | depends on BLK_DEV_IDE_PMAC | |
26306 | @@ -823,6 +834,13 @@ | |
26307 | Power Macintoshes and PowerBooks to use DMA (direct memory access) | |
26308 | to transfer data to and from memory. Saying Y is safe and improves | |
26309 | performance. | |
26310 | + | |
26311 | +config BLK_DEV_IDE_PMAC_BLINK | |
26312 | + bool "Blink laptop LED on drive activity" | |
26313 | + depends on BLK_DEV_IDE_PMAC && ADB_PMU | |
26314 | + help | |
26315 | + This option enables the use of the sleep LED as a hard drive | |
26316 | + activity LED. | |
26317 | ||
26318 | config BLK_DEV_IDEDMA_PMAC_AUTO | |
26319 | bool "Use DMA by default" | |
26320 | diff -Nru a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c | |
26321 | --- a/drivers/ide/ide-cd.c Wed Aug 20 09:01:03 2003 | |
26322 | +++ b/drivers/ide/ide-cd.c Fri Aug 22 18:04:49 2003 | |
26323 | @@ -794,16 +794,16 @@ | |
26324 | request or data protect error.*/ | |
26325 | ide_dump_status (drive, "command error", stat); | |
26326 | do_end_request = 1; | |
26327 | - } else if ((err & ~ABRT_ERR) != 0) { | |
26328 | - /* Go to the default handler | |
26329 | - for other errors. */ | |
26330 | - DRIVER(drive)->error(drive, "cdrom_decode_status",stat); | |
26331 | - return 1; | |
26332 | } else if (sense_key == MEDIUM_ERROR) { | |
26333 | /* No point in re-trying a zillion times on a bad | |
26334 | * sector... If we got here the error is not correctable */ | |
26335 | ide_dump_status (drive, "media error (bad sector)", stat); | |
26336 | do_end_request = 1; | |
26337 | + } else if ((err & ~ABRT_ERR) != 0) { | |
26338 | + /* Go to the default handler | |
26339 | + for other errors. */ | |
26340 | + DRIVER(drive)->error(drive, "cdrom_decode_status",stat); | |
26341 | + return 1; | |
26342 | } else if ((++rq->errors > ERROR_MAX)) { | |
26343 | /* We've racked up too many retries. Abort. */ | |
26344 | do_end_request = 1; | |
26345 | diff -Nru a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c | |
26346 | --- a/drivers/ide/ide-io.c Thu Aug 7 02:25:24 2003 | |
26347 | +++ b/drivers/ide/ide-io.c Sun Aug 24 15:33:30 2003 | |
26348 | @@ -54,8 +54,6 @@ | |
26349 | #include <asm/io.h> | |
26350 | #include <asm/bitops.h> | |
26351 | ||
26352 | -#include "ide_modes.h" | |
26353 | - | |
26354 | #if (DISK_RECOVERY_TIME > 0) | |
26355 | ||
26356 | #error So the User Has To Fix the Compilation And Stop Hacking Port 0x43. Does anyone ever use this anyway ?? | |
26357 | diff -Nru a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c | |
26358 | --- a/drivers/ide/ide-lib.c Thu Aug 7 02:25:25 2003 | |
26359 | +++ b/drivers/ide/ide-lib.c Sun Aug 24 15:33:30 2003 | |
26360 | @@ -22,8 +22,6 @@ | |
26361 | #include <asm/io.h> | |
26362 | #include <asm/bitops.h> | |
26363 | ||
26364 | -#include "ide_modes.h" | |
26365 | - | |
26366 | /* | |
26367 | * IDE library routines. These are plug in code that most | |
26368 | * drivers can use but occasionally may be weird enough | |
26369 | @@ -170,7 +168,7 @@ | |
26370 | BUG(); | |
26371 | return min(speed, speed_max[mode]); | |
26372 | #else /* !CONFIG_BLK_DEV_IDEDMA */ | |
26373 | - return min(speed, XFER_PIO_4); | |
26374 | + return min(speed, (u8)XFER_PIO_4); | |
26375 | #endif /* CONFIG_BLK_DEV_IDEDMA */ | |
26376 | } | |
26377 | ||
26378 | @@ -188,6 +186,12 @@ | |
26379 | ||
26380 | EXPORT_SYMBOL(ide_dma_enable); | |
26381 | ||
26382 | +/* | |
26383 | + * Standard (generic) timings for PIO modes, from ATA2 specification. | |
26384 | + * These timings are for access to the IDE data port register *only*. | |
26385 | + * Some drives may specify a mode, while also specifying a different | |
26386 | + * value for cycle_time (from drive identification data). | |
26387 | + */ | |
26388 | const ide_pio_timings_t ide_pio_timings[6] = { | |
26389 | { 70, 165, 600 }, /* PIO Mode 0 */ | |
26390 | { 50, 125, 383 }, /* PIO Mode 1 */ | |
26391 | @@ -198,6 +202,13 @@ | |
26392 | }; | |
26393 | ||
26394 | EXPORT_SYMBOL_GPL(ide_pio_timings); | |
26395 | + | |
26396 | +/* | |
26397 | + * Shared data/functions for determining best PIO mode for an IDE drive. | |
26398 | + * Most of this stuff originally lived in cmd640.c, and changes to the | |
26399 | + * ide_pio_blacklist[] table should be made with EXTREME CAUTION to avoid | |
26400 | + * breaking the fragile cmd640.c support. | |
26401 | + */ | |
26402 | ||
26403 | /* | |
26404 | * Black list. Some drives incorrectly report their maximal PIO mode, | |
26405 | diff -Nru a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c | |
26406 | --- a/drivers/ide/ide-probe.c Thu Aug 14 16:52:06 2003 | |
26407 | +++ b/drivers/ide/ide-probe.c Wed Sep 3 09:52:16 2003 | |
26408 | @@ -644,15 +644,26 @@ | |
26409 | return drive->present; | |
26410 | } | |
26411 | ||
26412 | +static void hwif_release_dev (struct device *dev) | |
26413 | +{ | |
26414 | + ide_hwif_t *hwif = container_of(dev, ide_hwif_t, gendev); | |
26415 | + | |
26416 | + up(&hwif->gendev_rel_sem); | |
26417 | +} | |
26418 | + | |
26419 | static void hwif_register (ide_hwif_t *hwif) | |
26420 | { | |
26421 | /* register with global device tree */ | |
26422 | strlcpy(hwif->gendev.bus_id,hwif->name,BUS_ID_SIZE); | |
26423 | hwif->gendev.driver_data = hwif; | |
26424 | - if (hwif->pci_dev) | |
26425 | - hwif->gendev.parent = &hwif->pci_dev->dev; | |
26426 | - else | |
26427 | - hwif->gendev.parent = NULL; /* Would like to do = &device_legacy */ | |
26428 | + if (hwif->gendev.parent == NULL) { | |
26429 | + if (hwif->pci_dev) | |
26430 | + hwif->gendev.parent = &hwif->pci_dev->dev; | |
26431 | + else | |
26432 | + /* Would like to do = &device_legacy */ | |
26433 | + hwif->gendev.parent = NULL; | |
26434 | + } | |
26435 | + hwif->gendev.release = hwif_release_dev; | |
26436 | device_register(&hwif->gendev); | |
26437 | } | |
26438 | ||
26439 | @@ -770,8 +781,7 @@ | |
26440 | */ | |
26441 | for (unit = 0; unit < MAX_DRIVES; ++unit) { | |
26442 | ide_drive_t *drive = &hwif->drives[unit]; | |
26443 | - drive->dn = ((hwif->channel ? 2 : 0) + unit); | |
26444 | - hwif->drives[unit].dn = ((hwif->channel ? 2 : 0) + unit); | |
26445 | + drive->dn = (hwif->channel ? 2 : 0) + unit; | |
26446 | (void) probe_for_drive(drive); | |
26447 | if (drive->present && !hwif->present) { | |
26448 | hwif->present = 1; | |
26449 | @@ -945,15 +955,14 @@ | |
26450 | if (drive->disk) | |
26451 | drive->disk->queue = drive->queue; | |
26452 | ||
26453 | - return 0; | |
26454 | -} | |
26455 | - | |
26456 | -/* | |
26457 | - * Setup the drive for request handling. | |
26458 | - */ | |
26459 | -static void ide_init_drive(ide_drive_t *drive) | |
26460 | -{ | |
26461 | + /* needs drive->queue to be set */ | |
26462 | ide_toggle_bounce(drive, 1); | |
26463 | + | |
26464 | + /* enable led activity for disk drives only */ | |
26465 | + if (drive->media == ide_disk && hwif->led_act) | |
26466 | + blk_queue_activity_fn(q, hwif->led_act, drive); | |
26467 | + | |
26468 | + return 0; | |
26469 | } | |
26470 | ||
26471 | /* | |
26472 | @@ -1068,10 +1077,9 @@ | |
26473 | } | |
26474 | ||
26475 | /* | |
26476 | - * Link any new drives into the hwgroup, allocate | |
26477 | - * the block device queue and initialize the drive. | |
26478 | - * Note that ide_init_drive sends commands to the new | |
26479 | - * drive. | |
26480 | + * For any present drive: | |
26481 | + * - allocate the block device queue | |
26482 | + * - link drive into the hwgroup | |
26483 | */ | |
26484 | for (index = 0; index < MAX_DRIVES; ++index) { | |
26485 | ide_drive_t *drive = &hwif->drives[index]; | |
26486 | @@ -1092,7 +1100,6 @@ | |
26487 | hwgroup->drive->next = drive; | |
26488 | } | |
26489 | spin_unlock_irq(&ide_lock); | |
26490 | - ide_init_drive(drive); | |
26491 | } | |
26492 | ||
26493 | #if !defined(__mc68000__) && !defined(CONFIG_APUS) && !defined(__sparc__) | |
26494 | @@ -1201,6 +1208,13 @@ | |
26495 | return -ENOMEM; | |
26496 | } | |
26497 | ||
26498 | +static void drive_release_dev (struct device *dev) | |
26499 | +{ | |
26500 | + ide_drive_t *drive = container_of(dev, ide_drive_t, gendev); | |
26501 | + | |
26502 | + up(&drive->gendev_rel_sem); | |
26503 | +} | |
26504 | + | |
26505 | /* | |
26506 | * init_gendisk() (as opposed to ide_geninit) is called for each major device, | |
26507 | * after probing for drives, to allocate partition tables and other data | |
26508 | @@ -1219,6 +1233,7 @@ | |
26509 | drive->gendev.parent = &hwif->gendev; | |
26510 | drive->gendev.bus = &ide_bus_type; | |
26511 | drive->gendev.driver_data = drive; | |
26512 | + drive->gendev.release = drive_release_dev; | |
26513 | if (drive->present) { | |
26514 | device_register(&drive->gendev); | |
26515 | sprintf(drive->devfs_name, "ide/host%d/bus%d/target%d/lun%d", | |
26516 | @@ -1303,31 +1318,6 @@ | |
26517 | ||
26518 | EXPORT_SYMBOL(hwif_init); | |
26519 | ||
26520 | -int export_ide_init_queue (ide_drive_t *drive) | |
26521 | -{ | |
26522 | - if (ide_init_queue(drive)) | |
26523 | - return 1; | |
26524 | - | |
26525 | - ide_init_drive(drive); | |
26526 | - return 0; | |
26527 | -} | |
26528 | - | |
26529 | -EXPORT_SYMBOL(export_ide_init_queue); | |
26530 | - | |
26531 | -u8 export_probe_for_drive (ide_drive_t *drive) | |
26532 | -{ | |
26533 | - return probe_for_drive(drive); | |
26534 | -} | |
26535 | - | |
26536 | -EXPORT_SYMBOL(export_probe_for_drive); | |
26537 | - | |
26538 | -int ideprobe_init (void); | |
26539 | -static ide_module_t ideprobe_module = { | |
26540 | - IDE_PROBE_MODULE, | |
26541 | - ideprobe_init, | |
26542 | - NULL | |
26543 | -}; | |
26544 | - | |
26545 | int ideprobe_init (void) | |
26546 | { | |
26547 | unsigned int index; | |
26548 | @@ -1359,7 +1349,7 @@ | |
26549 | } | |
26550 | } | |
26551 | if (!ide_probe) | |
26552 | - ide_probe = &ideprobe_module; | |
26553 | + ide_probe = &ideprobe_init; | |
26554 | MOD_DEC_USE_COUNT; | |
26555 | return 0; | |
26556 | } | |
26557 | diff -Nru a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c | |
26558 | --- a/drivers/ide/ide-tape.c Wed Aug 20 14:21:56 2003 | |
26559 | +++ b/drivers/ide/ide-tape.c Tue Aug 26 09:25:41 2003 | |
26560 | @@ -4922,7 +4922,7 @@ | |
26561 | struct inode *inode = file->f_dentry->d_inode; | |
26562 | ide_drive_t *drive = file->private_data; | |
26563 | idetape_tape_t *tape = drive->driver_data; | |
26564 | - unsigned int minor = minor(inode->i_rdev); | |
26565 | + unsigned int minor = iminor(inode); | |
26566 | ssize_t retval, actually_written = 0; | |
26567 | int position; | |
26568 | ||
26569 | @@ -5568,7 +5568,7 @@ | |
26570 | */ | |
26571 | static int idetape_chrdev_open (struct inode *inode, struct file *filp) | |
26572 | { | |
26573 | - unsigned int minor = minor(inode->i_rdev), i = minor & ~0xc0; | |
26574 | + unsigned int minor = iminor(inode), i = minor & ~0xc0; | |
26575 | ide_drive_t *drive; | |
26576 | idetape_tape_t *tape; | |
26577 | idetape_pc_t pc; | |
26578 | @@ -5649,7 +5649,7 @@ | |
26579 | ide_drive_t *drive = filp->private_data; | |
26580 | idetape_tape_t *tape; | |
26581 | idetape_pc_t pc; | |
26582 | - unsigned int minor = minor(inode->i_rdev); | |
26583 | + unsigned int minor = iminor(inode); | |
26584 | ||
26585 | lock_kernel(); | |
26586 | tape = drive->driver_data; | |
26587 | diff -Nru a/drivers/ide/ide.c b/drivers/ide/ide.c | |
26588 | --- a/drivers/ide/ide.c Wed Aug 20 09:01:03 2003 | |
26589 | +++ b/drivers/ide/ide.c Tue Sep 2 07:18:29 2003 | |
26590 | @@ -161,8 +161,6 @@ | |
26591 | #include <asm/io.h> | |
26592 | #include <asm/bitops.h> | |
26593 | ||
26594 | -#include "ide_modes.h" | |
26595 | - | |
26596 | ||
26597 | /* default maximum number of failures */ | |
26598 | #define IDE_DEFAULT_MAX_FAILURES 1 | |
26599 | @@ -180,7 +178,9 @@ | |
26600 | DECLARE_MUTEX(ide_cfg_sem); | |
26601 | spinlock_t ide_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED; | |
26602 | ||
26603 | +#ifdef CONFIG_BLK_DEV_IDEPCI | |
26604 | static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */ | |
26605 | +#endif | |
26606 | ||
26607 | #ifdef CONFIG_IDEDMA_AUTO | |
26608 | int noautodma = 0; | |
26609 | @@ -190,11 +190,7 @@ | |
26610 | ||
26611 | EXPORT_SYMBOL(noautodma); | |
26612 | ||
26613 | -/* | |
26614 | - * ide_modules keeps track of the available IDE chipset/probe/driver modules. | |
26615 | - */ | |
26616 | -ide_module_t *ide_chipsets; | |
26617 | -ide_module_t *ide_probe; | |
26618 | +int (*ide_probe)(void); | |
26619 | ||
26620 | /* | |
26621 | * This is declared extern in ide.h, for access by other IDE modules: | |
26622 | @@ -255,6 +251,8 @@ | |
26623 | hwif->mwdma_mask = 0x80; /* disable all mwdma */ | |
26624 | hwif->swdma_mask = 0x80; /* disable all swdma */ | |
26625 | ||
26626 | + sema_init(&hwif->gendev_rel_sem, 0); | |
26627 | + | |
26628 | default_hwif_iops(hwif); | |
26629 | default_hwif_transport(hwif); | |
26630 | for (unit = 0; unit < MAX_DRIVES; ++unit) { | |
26631 | @@ -277,6 +275,7 @@ | |
26632 | drive->driver = &idedefault_driver; | |
26633 | drive->vdma = 0; | |
26634 | INIT_LIST_HEAD(&drive->list); | |
26635 | + sema_init(&drive->gendev_rel_sem, 0); | |
26636 | } | |
26637 | } | |
26638 | ||
26639 | @@ -452,7 +451,7 @@ | |
26640 | (void) request_module("ide-probe-mod"); | |
26641 | #endif /* (CONFIG_KMOD) && (CONFIG_BLK_DEV_IDE_MODULE) */ | |
26642 | } else { | |
26643 | - (void) ide_probe->init(); | |
26644 | + (void)ide_probe(); | |
26645 | } | |
26646 | } | |
26647 | ||
26648 | @@ -749,6 +748,7 @@ | |
26649 | spin_unlock_irq(&ide_lock); | |
26650 | blk_cleanup_queue(drive->queue); | |
26651 | device_unregister(&drive->gendev); | |
26652 | + down(&drive->gendev_rel_sem); | |
26653 | spin_lock_irq(&ide_lock); | |
26654 | drive->queue = NULL; | |
26655 | } | |
26656 | @@ -778,6 +778,7 @@ | |
26657 | /* More messed up locking ... */ | |
26658 | spin_unlock_irq(&ide_lock); | |
26659 | device_unregister(&hwif->gendev); | |
26660 | + down(&hwif->gendev_rel_sem); | |
26661 | ||
26662 | /* | |
26663 | * Remove us from the kernel's knowledge | |
26664 | @@ -1046,21 +1047,6 @@ | |
26665 | EXPORT_SYMBOL(ide_register_hw); | |
26666 | ||
26667 | /* | |
26668 | - * Compatibility function with existing drivers. If you want | |
26669 | - * something different, use the function above. | |
26670 | - */ | |
26671 | -int ide_register (int arg1, int arg2, int irq) | |
26672 | -{ | |
26673 | - hw_regs_t hw; | |
26674 | - ide_init_hwif_ports(&hw, (unsigned long) arg1, (unsigned long) arg2, NULL); | |
26675 | - hw.irq = irq; | |
26676 | - return ide_register_hw(&hw, NULL); | |
26677 | -} | |
26678 | - | |
26679 | -EXPORT_SYMBOL(ide_register); | |
26680 | - | |
26681 | - | |
26682 | -/* | |
26683 | * Locks for IDE setting functionality | |
26684 | */ | |
26685 | ||
26686 | @@ -1658,11 +1644,15 @@ | |
26687 | ||
26688 | case HDIO_SCAN_HWIF: | |
26689 | { | |
26690 | + hw_regs_t hw; | |
26691 | int args[3]; | |
26692 | if (!capable(CAP_SYS_RAWIO)) return -EACCES; | |
26693 | if (copy_from_user(args, (void *)arg, 3 * sizeof(int))) | |
26694 | return -EFAULT; | |
26695 | - if (ide_register(args[0], args[1], args[2]) == -1) | |
26696 | + ide_init_hwif_ports(&hw, (unsigned long) args[0], | |
26697 | + (unsigned long) args[1], NULL); | |
26698 | + hw.irq = args[2]; | |
26699 | + if (ide_register_hw(&hw, NULL) == -1) | |
26700 | return -EIO; | |
26701 | return 0; | |
26702 | } | |
26703 | @@ -1870,7 +1860,7 @@ | |
26704 | * registered. In most cases, only one device | |
26705 | * will be present. | |
26706 | * "hdx=scsi" : the return of the ide-scsi flag, this is useful for | |
26707 | - * allowwing ide-floppy, ide-tape, and ide-cdrom|writers | |
26708 | + * allowing ide-floppy, ide-tape, and ide-cdrom|writers | |
26709 | * to use ide-scsi emulation on a device specific option. | |
26710 | * "idebus=xx" : inform IDE driver of VESA/PCI bus speed in MHz, | |
26711 | * where "xx" is between 20 and 66 inclusive, | |
26712 | diff -Nru a/drivers/ide/ide_modes.h b/drivers/ide/ide_modes.h | |
26713 | --- a/drivers/ide/ide_modes.h Mon Sep 16 05:54:57 2002 | |
26714 | +++ /dev/null Wed Dec 31 16:00:00 1969 | |
26715 | @@ -1,41 +0,0 @@ | |
26716 | -/* | |
26717 | - * linux/drivers/ide/ide_modes.h | |
26718 | - * | |
26719 | - * Copyright (C) 1996 Linus Torvalds, Igor Abramov, and Mark Lord | |
26720 | - */ | |
26721 | - | |
26722 | -#ifndef _IDE_MODES_H | |
26723 | -#define _IDE_MODES_H | |
26724 | - | |
26725 | -#include <linux/config.h> | |
26726 | - | |
26727 | -/* | |
26728 | - * Shared data/functions for determining best PIO mode for an IDE drive. | |
26729 | - * Most of this stuff originally lived in cmd640.c, and changes to the | |
26730 | - * ide_pio_blacklist[] table should be made with EXTREME CAUTION to avoid | |
26731 | - * breaking the fragile cmd640.c support. | |
26732 | - */ | |
26733 | - | |
26734 | -/* | |
26735 | - * Standard (generic) timings for PIO modes, from ATA2 specification. | |
26736 | - * These timings are for access to the IDE data port register *only*. | |
26737 | - * Some drives may specify a mode, while also specifying a different | |
26738 | - * value for cycle_time (from drive identification data). | |
26739 | - */ | |
26740 | -typedef struct ide_pio_timings_s { | |
26741 | - int setup_time; /* Address setup (ns) minimum */ | |
26742 | - int active_time; /* Active pulse (ns) minimum */ | |
26743 | - int cycle_time; /* Cycle time (ns) minimum = (setup + active + recovery) */ | |
26744 | -} ide_pio_timings_t; | |
26745 | - | |
26746 | -typedef struct ide_pio_data_s { | |
26747 | - u8 pio_mode; | |
26748 | - u8 use_iordy; | |
26749 | - u8 overridden; | |
26750 | - u8 blacklisted; | |
26751 | - unsigned int cycle_time; | |
26752 | -} ide_pio_data_t; | |
26753 | - | |
26754 | -u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d); | |
26755 | -extern const ide_pio_timings_t ide_pio_timings[6]; | |
26756 | -#endif /* _IDE_MODES_H */ | |
26757 | diff -Nru a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c | |
26758 | --- a/drivers/ide/legacy/ali14xx.c Tue Aug 12 13:29:09 2003 | |
26759 | +++ b/drivers/ide/legacy/ali14xx.c Sun Aug 24 15:33:30 2003 | |
26760 | @@ -54,8 +54,6 @@ | |
26761 | ||
26762 | #include <asm/io.h> | |
26763 | ||
26764 | -#include "ide_modes.h" | |
26765 | - | |
26766 | /* port addresses for auto-detection */ | |
26767 | #define ALI_NUM_PORTS 4 | |
26768 | static int ports[ALI_NUM_PORTS] __initdata = {0x074, 0x0f4, 0x034, 0x0e4}; | |
26769 | diff -Nru a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c | |
26770 | --- a/drivers/ide/legacy/dtc2278.c Tue Aug 12 13:29:09 2003 | |
26771 | +++ b/drivers/ide/legacy/dtc2278.c Sun Aug 24 15:33:30 2003 | |
26772 | @@ -21,8 +21,6 @@ | |
26773 | ||
26774 | #include <asm/io.h> | |
26775 | ||
26776 | -#include "ide_modes.h" | |
26777 | - | |
26778 | /* | |
26779 | * Changing this #undef to #define may solve start up problems in some systems. | |
26780 | */ | |
26781 | diff -Nru a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c | |
26782 | --- a/drivers/ide/legacy/ht6560b.c Tue Aug 12 13:29:09 2003 | |
26783 | +++ b/drivers/ide/legacy/ht6560b.c Sun Aug 24 15:33:30 2003 | |
26784 | @@ -53,8 +53,6 @@ | |
26785 | ||
26786 | #include <asm/io.h> | |
26787 | ||
26788 | -#include "ide_modes.h" | |
26789 | - | |
26790 | /* #define DEBUG */ /* remove comments for DEBUG messages */ | |
26791 | ||
26792 | /* | |
26793 | diff -Nru a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c | |
26794 | --- a/drivers/ide/legacy/macide.c Tue Feb 18 10:06:19 2003 | |
26795 | +++ b/drivers/ide/legacy/macide.c Sun Aug 24 05:37:06 2003 | |
26796 | @@ -126,7 +126,7 @@ | |
26797 | /* probing the drive which freezes a 190. */ | |
26798 | ||
26799 | ide_drive_t *drive = &ide_hwifs[index].drives[0]; | |
26800 | - drive->capacity = drive->cyl*drive->head*drive->sect; | |
26801 | + drive->capacity64 = drive->cyl*drive->head*drive->sect; | |
26802 | ||
26803 | #ifdef CONFIG_BLK_DEV_MAC_MEDIABAY | |
26804 | request_irq(IRQ_BABOON_2, macide_mediabay_interrupt, | |
26805 | diff -Nru a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c | |
26806 | --- a/drivers/ide/legacy/qd65xx.c Tue Aug 12 13:29:09 2003 | |
26807 | +++ b/drivers/ide/legacy/qd65xx.c Sun Aug 24 15:33:30 2003 | |
26808 | @@ -42,7 +42,6 @@ | |
26809 | #include <asm/system.h> | |
26810 | #include <asm/io.h> | |
26811 | ||
26812 | -#include "ide_modes.h" | |
26813 | #include "qd65xx.h" | |
26814 | ||
26815 | /* | |
26816 | diff -Nru a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c | |
26817 | --- a/drivers/ide/legacy/umc8672.c Tue Aug 12 13:29:09 2003 | |
26818 | +++ b/drivers/ide/legacy/umc8672.c Sun Aug 24 15:33:30 2003 | |
26819 | @@ -54,8 +54,6 @@ | |
26820 | ||
26821 | #include <asm/io.h> | |
26822 | ||
26823 | -#include "ide_modes.h" | |
26824 | - | |
26825 | /* | |
26826 | * Default speeds. These can be changed with "auto-tune" and/or hdparm. | |
26827 | */ | |
26828 | diff -Nru a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c | |
26829 | --- a/drivers/ide/pci/aec62xx.c Thu Jul 31 08:58:49 2003 | |
26830 | +++ b/drivers/ide/pci/aec62xx.c Sun Aug 24 15:33:30 2003 | |
26831 | @@ -16,7 +16,6 @@ | |
26832 | ||
26833 | #include <asm/io.h> | |
26834 | ||
26835 | -#include "ide_modes.h" | |
26836 | #include "aec62xx.h" | |
26837 | ||
26838 | #if defined(DISPLAY_AEC62XX_TIMINGS) && defined(CONFIG_PROC_FS) | |
26839 | diff -Nru a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c | |
26840 | --- a/drivers/ide/pci/alim15x3.c Sat Aug 16 06:34:25 2003 | |
26841 | +++ b/drivers/ide/pci/alim15x3.c Sun Aug 24 15:33:30 2003 | |
26842 | @@ -37,7 +37,6 @@ | |
26843 | ||
26844 | #include <asm/io.h> | |
26845 | ||
26846 | -#include "ide_modes.h" | |
26847 | #include "alim15x3.h" | |
26848 | ||
26849 | /* | |
26850 | diff -Nru a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c | |
26851 | --- a/drivers/ide/pci/cmd640.c Thu Mar 13 16:49:44 2003 | |
26852 | +++ b/drivers/ide/pci/cmd640.c Sun Aug 24 15:33:30 2003 | |
26853 | @@ -115,8 +115,6 @@ | |
26854 | ||
26855 | #include <asm/io.h> | |
26856 | ||
26857 | -#include "ide_modes.h" | |
26858 | - | |
26859 | /* | |
26860 | * This flag is set in ide.c by the parameter: ide0=cmd640_vlb | |
26861 | */ | |
26862 | diff -Nru a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c | |
26863 | --- a/drivers/ide/pci/cmd64x.c Thu Jul 31 08:58:49 2003 | |
26864 | +++ b/drivers/ide/pci/cmd64x.c Mon Sep 1 08:23:55 2003 | |
26865 | @@ -25,7 +25,6 @@ | |
26866 | ||
26867 | #include <asm/io.h> | |
26868 | ||
26869 | -#include "ide_modes.h" | |
26870 | #include "cmd64x.h" | |
26871 | ||
26872 | #if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) | |
26873 | @@ -629,10 +628,7 @@ | |
26874 | ||
26875 | /* Set a good latency timer and cache line size value. */ | |
26876 | (void) pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64); | |
26877 | -#ifdef __sparc_v9__ | |
26878 | - (void) pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 0x10); | |
26879 | -#endif | |
26880 | - | |
26881 | + /* FIXME: pci_set_master() to ensure a good latency timer value */ | |
26882 | ||
26883 | /* Setup interrupts. */ | |
26884 | (void) pci_read_config_byte(dev, MRDMODE, &mrdmode); | |
26885 | diff -Nru a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c | |
26886 | --- a/drivers/ide/pci/cs5520.c Thu Jul 31 08:58:49 2003 | |
26887 | +++ b/drivers/ide/pci/cs5520.c Sun Aug 24 15:33:30 2003 | |
26888 | @@ -51,7 +51,6 @@ | |
26889 | #include <asm/io.h> | |
26890 | #include <asm/irq.h> | |
26891 | ||
26892 | -#include "ide_modes.h" | |
26893 | #include "cs5520.h" | |
26894 | ||
26895 | #if defined(DISPLAY_CS5520_TIMINGS) && defined(CONFIG_PROC_FS) | |
26896 | diff -Nru a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c | |
26897 | --- a/drivers/ide/pci/cs5530.c Thu Jul 31 08:58:49 2003 | |
26898 | +++ b/drivers/ide/pci/cs5530.c Sun Aug 24 15:33:30 2003 | |
26899 | @@ -31,7 +31,6 @@ | |
26900 | #include <asm/io.h> | |
26901 | #include <asm/irq.h> | |
26902 | ||
26903 | -#include "ide_modes.h" | |
26904 | #include "cs5530.h" | |
26905 | ||
26906 | #if defined(DISPLAY_CS5530_TIMINGS) && defined(CONFIG_PROC_FS) | |
26907 | diff -Nru a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c | |
26908 | --- a/drivers/ide/pci/cy82c693.c Thu Jul 31 08:58:49 2003 | |
26909 | +++ b/drivers/ide/pci/cy82c693.c Sun Aug 24 15:33:30 2003 | |
26910 | @@ -54,7 +54,6 @@ | |
26911 | ||
26912 | #include <asm/io.h> | |
26913 | ||
26914 | -#include "ide_modes.h" | |
26915 | #include "cy82c693.h" | |
26916 | ||
26917 | /* | |
26918 | @@ -113,7 +112,7 @@ | |
26919 | ||
26920 | /* note: we use the same values for 16bit IOR and IOW | |
26921 | * those are all the same, since I don't have other | |
26922 | - * timings than those from ide_modes.h | |
26923 | + * timings than those from ide-lib.c | |
26924 | */ | |
26925 | ||
26926 | p_pclk->time_16r = (u8)clk1; | |
26927 | diff -Nru a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c | |
26928 | --- a/drivers/ide/pci/generic.c Thu Jul 31 08:58:49 2003 | |
26929 | +++ b/drivers/ide/pci/generic.c Wed Sep 3 07:34:35 2003 | |
26930 | @@ -140,6 +140,7 @@ | |
26931 | { PCI_VENDOR_ID_HINT, PCI_DEVICE_ID_HINT_VXPROII_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6}, | |
26932 | { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C561, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7}, | |
26933 | { PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C558, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8}, | |
26934 | + { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237_SATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9}, | |
26935 | { 0, }, | |
26936 | }; | |
26937 | ||
26938 | diff -Nru a/drivers/ide/pci/generic.h b/drivers/ide/pci/generic.h | |
26939 | --- a/drivers/ide/pci/generic.h Mon Jan 13 17:12:03 2003 | |
26940 | +++ b/drivers/ide/pci/generic.h Wed Sep 3 07:37:12 2003 | |
26941 | @@ -127,6 +127,19 @@ | |
26942 | .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, | |
26943 | .bootable = ON_BOARD, | |
26944 | .extra = 0, | |
26945 | + },{ /* 9 */ | |
26946 | + .vendor = PCI_VENDOR_ID_VIA, | |
26947 | + .device = PCI_DEVICE_ID_VIA_8237_SATA, | |
26948 | + .name = "VIA8237SATA", | |
26949 | + .init_chipset = init_chipset_generic, | |
26950 | + .init_iops = NULL, | |
26951 | + .init_hwif = init_hwif_generic, | |
26952 | + .init_dma = init_dma_generic, | |
26953 | + .channels = 2, | |
26954 | + .autodma = AUTODMA, | |
26955 | + .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, | |
26956 | + .bootable = OFF_BOARD, | |
26957 | + .extra = 0, | |
26958 | },{ | |
26959 | .vendor = 0, | |
26960 | .device = 0, | |
26961 | diff -Nru a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c | |
26962 | --- a/drivers/ide/pci/hpt34x.c Thu Jul 31 08:58:49 2003 | |
26963 | +++ b/drivers/ide/pci/hpt34x.c Sun Aug 24 15:33:30 2003 | |
26964 | @@ -42,7 +42,6 @@ | |
26965 | #include <asm/io.h> | |
26966 | #include <asm/irq.h> | |
26967 | ||
26968 | -#include "ide_modes.h" | |
26969 | #include "hpt34x.h" | |
26970 | ||
26971 | #if defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS) | |
26972 | diff -Nru a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c | |
26973 | --- a/drivers/ide/pci/hpt366.c Mon Aug 11 09:04:06 2003 | |
26974 | +++ b/drivers/ide/pci/hpt366.c Sun Aug 24 15:33:30 2003 | |
26975 | @@ -62,7 +62,6 @@ | |
26976 | #include <asm/io.h> | |
26977 | #include <asm/irq.h> | |
26978 | ||
26979 | -#include "ide_modes.h" | |
26980 | #include "hpt366.h" | |
26981 | ||
26982 | #if defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) | |
26983 | @@ -989,7 +988,40 @@ | |
26984 | hwif->intrproc = &hpt3xx_intrproc; | |
26985 | hwif->maskproc = &hpt3xx_maskproc; | |
26986 | ||
26987 | - pci_read_config_byte(hwif->pci_dev, 0x5a, &ata66); | |
26988 | + /* | |
26989 | + * The HPT37x uses the CBLID pins as outputs for MA15/MA16 | |
26990 | + * address lines to access an external eeprom. To read valid | |
26991 | + * cable detect state the pins must be enabled as inputs. | |
26992 | + */ | |
26993 | + if (hpt_minimum_revision(dev, 8) && PCI_FUNC(dev->devfn) & 1) { | |
26994 | + /* | |
26995 | + * HPT374 PCI function 1 | |
26996 | + * - set bit 15 of reg 0x52 to enable TCBLID as input | |
26997 | + * - set bit 15 of reg 0x56 to enable FCBLID as input | |
26998 | + */ | |
26999 | + u16 mcr3, mcr6; | |
27000 | + pci_read_config_word(dev, 0x52, &mcr3); | |
27001 | + pci_read_config_word(dev, 0x56, &mcr6); | |
27002 | + pci_write_config_word(dev, 0x52, mcr3 | 0x8000); | |
27003 | + pci_write_config_word(dev, 0x56, mcr6 | 0x8000); | |
27004 | + /* now read cable id register */ | |
27005 | + pci_read_config_byte(dev, 0x5a, &ata66); | |
27006 | + pci_write_config_word(dev, 0x52, mcr3); | |
27007 | + pci_write_config_word(dev, 0x56, mcr6); | |
27008 | + } else if (hpt_minimum_revision(dev, 3)) { | |
27009 | + /* | |
27010 | + * HPT370/372 and 374 pcifn 0 | |
27011 | + * - clear bit 0 of 0x5b to enable P/SCBLID as inputs | |
27012 | + */ | |
27013 | + u8 scr2; | |
27014 | + pci_read_config_byte(dev, 0x5b, &scr2); | |
27015 | + pci_write_config_byte(dev, 0x5b, scr2 & ~1); | |
27016 | + /* now read cable id register */ | |
27017 | + pci_read_config_byte(dev, 0x5a, &ata66); | |
27018 | + pci_write_config_byte(dev, 0x5b, scr2); | |
27019 | + } else { | |
27020 | + pci_read_config_byte(dev, 0x5a, &ata66); | |
27021 | + } | |
27022 | ||
27023 | #ifdef DEBUG | |
27024 | printk("HPT366: reg5ah=0x%02x ATA-%s Cable Port%d\n", | |
27025 | diff -Nru a/drivers/ide/pci/it8172.c b/drivers/ide/pci/it8172.c | |
27026 | --- a/drivers/ide/pci/it8172.c Thu Jul 31 08:58:49 2003 | |
27027 | +++ b/drivers/ide/pci/it8172.c Sun Aug 24 15:33:30 2003 | |
27028 | @@ -42,7 +42,6 @@ | |
27029 | #include <asm/io.h> | |
27030 | #include <asm/it8172/it8172_int.h> | |
27031 | ||
27032 | -#include "ide_modes.h" | |
27033 | #include "it8172.h" | |
27034 | ||
27035 | /* | |
27036 | diff -Nru a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c | |
27037 | --- a/drivers/ide/pci/ns87415.c Thu Jul 31 08:58:49 2003 | |
27038 | +++ b/drivers/ide/pci/ns87415.c Mon Sep 1 08:23:55 2003 | |
27039 | @@ -147,9 +147,7 @@ | |
27040 | ||
27041 | /* Set a good latency timer and cache line size value. */ | |
27042 | (void) pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64); | |
27043 | -#ifdef __sparc_v9__ | |
27044 | - (void) pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 0x10); | |
27045 | -#endif | |
27046 | + /* FIXME: use pci_set_master() to ensure good latency timer value */ | |
27047 | ||
27048 | /* | |
27049 | * We cannot probe for IRQ: both ports share common IRQ on INTA. | |
27050 | diff -Nru a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c | |
27051 | --- a/drivers/ide/pci/opti621.c Thu Jul 31 08:58:49 2003 | |
27052 | +++ b/drivers/ide/pci/opti621.c Sun Aug 24 15:33:30 2003 | |
27053 | @@ -104,7 +104,6 @@ | |
27054 | ||
27055 | #include <asm/io.h> | |
27056 | ||
27057 | -#include "ide_modes.h" | |
27058 | #include "opti621.h" | |
27059 | ||
27060 | #define OPTI621_MAX_PIO 3 | |
27061 | diff -Nru a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c | |
27062 | --- a/drivers/ide/pci/pdc202xx_new.c Thu Jul 31 08:58:49 2003 | |
27063 | +++ b/drivers/ide/pci/pdc202xx_new.c Sun Aug 24 15:33:30 2003 | |
27064 | @@ -32,7 +32,6 @@ | |
27065 | #include <asm/io.h> | |
27066 | #include <asm/irq.h> | |
27067 | ||
27068 | -#include "ide_modes.h" | |
27069 | #include "pdc202xx_new.h" | |
27070 | ||
27071 | #define PDC202_DEBUG_CABLE 0 | |
27072 | diff -Nru a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c | |
27073 | --- a/drivers/ide/pci/pdc202xx_old.c Wed Aug 13 17:45:49 2003 | |
27074 | +++ b/drivers/ide/pci/pdc202xx_old.c Wed Sep 3 06:34:40 2003 | |
27075 | @@ -46,7 +46,6 @@ | |
27076 | #include <asm/io.h> | |
27077 | #include <asm/irq.h> | |
27078 | ||
27079 | -#include "ide_modes.h" | |
27080 | #include "pdc202xx_old.h" | |
27081 | ||
27082 | #define PDC202_DEBUG_CABLE 0 | |
27083 | @@ -748,9 +747,6 @@ | |
27084 | hwif->autodma = 0; | |
27085 | hwif->tuneproc = &config_chipset_for_pio; | |
27086 | hwif->quirkproc = &pdc202xx_quirkproc; | |
27087 | - | |
27088 | - if (hwif->pci_dev->device == PCI_DEVICE_ID_PROMISE_20265) | |
27089 | - hwif->no_lba48 = (hwif->channel) ? 0 : 1; | |
27090 | ||
27091 | if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) { | |
27092 | hwif->busproc = &pdc202xx_tristate; | |
27093 | diff -Nru a/drivers/ide/pci/pdcadma.c b/drivers/ide/pci/pdcadma.c | |
27094 | --- a/drivers/ide/pci/pdcadma.c Thu Jul 31 08:58:49 2003 | |
27095 | +++ b/drivers/ide/pci/pdcadma.c Sun Aug 24 15:33:30 2003 | |
27096 | @@ -24,7 +24,6 @@ | |
27097 | #include <asm/io.h> | |
27098 | #include <asm/irq.h> | |
27099 | ||
27100 | -#include "ide_modes.h" | |
27101 | #include "pdcadma.h" | |
27102 | ||
27103 | #if defined(DISPLAY_PDCADMA_TIMINGS) && defined(CONFIG_PROC_FS) | |
27104 | diff -Nru a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c | |
27105 | --- a/drivers/ide/pci/piix.c Thu Jul 31 08:58:49 2003 | |
27106 | +++ b/drivers/ide/pci/piix.c Sun Aug 24 15:33:30 2003 | |
27107 | @@ -103,7 +103,6 @@ | |
27108 | ||
27109 | #include <asm/io.h> | |
27110 | ||
27111 | -#include "ide_modes.h" | |
27112 | #include "piix.h" | |
27113 | ||
27114 | static int no_piix_dma; | |
27115 | diff -Nru a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c | |
27116 | --- a/drivers/ide/pci/sc1200.c Thu Jul 31 08:58:49 2003 | |
27117 | +++ b/drivers/ide/pci/sc1200.c Sun Aug 24 15:33:30 2003 | |
27118 | @@ -29,7 +29,6 @@ | |
27119 | #include <asm/io.h> | |
27120 | #include <asm/irq.h> | |
27121 | ||
27122 | -#include "ide_modes.h" | |
27123 | #include "sc1200.h" | |
27124 | ||
27125 | #define SC1200_REV_A 0x00 | |
27126 | diff -Nru a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c | |
27127 | --- a/drivers/ide/pci/serverworks.c Thu Jul 31 08:58:49 2003 | |
27128 | +++ b/drivers/ide/pci/serverworks.c Sun Aug 24 15:33:30 2003 | |
27129 | @@ -39,7 +39,6 @@ | |
27130 | ||
27131 | #include <asm/io.h> | |
27132 | ||
27133 | -#include "ide_modes.h" | |
27134 | #include "serverworks.h" | |
27135 | ||
27136 | static u8 svwks_revision = 0; | |
27137 | diff -Nru a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c | |
27138 | --- a/drivers/ide/pci/siimage.c Wed Aug 13 17:45:20 2003 | |
27139 | +++ b/drivers/ide/pci/siimage.c Mon Sep 1 15:53:57 2003 | |
27140 | @@ -1,7 +1,24 @@ | |
27141 | /* | |
27142 | - * linux/drivers/ide/pci/siimage.c Version 1.02 Jan 30, 2003 | |
27143 | + * linux/drivers/ide/pci/siimage.c Version 1.06 June 11, 2003 | |
27144 | * | |
27145 | * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org> | |
27146 | + * Copyright (C) 2003 Red Hat <alan@redhat.com> | |
27147 | + * | |
27148 | + * May be copied or modified under the terms of the GNU General Public License | |
27149 | + * | |
27150 | + * Documentation available under NDA only | |
27151 | + * | |
27152 | + * | |
27153 | + * FAQ Items: | |
27154 | + * If you are using Marvell SATA-IDE adapters with Maxtor drives | |
27155 | + * ensure the system is set up for ATA100/UDMA5 not UDMA6. | |
27156 | + * | |
27157 | + * If you are using WD drives with SATA bridges you must set the | |
27158 | + * drive to "Single". "Master" will hang | |
27159 | + * | |
27160 | + * If you have strange problems with nVidia chipset systems please | |
27161 | + * see the SI support documentation and update your system BIOS | |
27162 | + * if neccessary | |
27163 | */ | |
27164 | ||
27165 | #include <linux/config.h> | |
27166 | @@ -15,7 +32,6 @@ | |
27167 | ||
27168 | #include <asm/io.h> | |
27169 | ||
27170 | -#include "ide_modes.h" | |
27171 | #include "siimage.h" | |
27172 | ||
27173 | #if defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS) | |
27174 | @@ -23,16 +39,107 @@ | |
27175 | #include <linux/proc_fs.h> | |
27176 | ||
27177 | static u8 siimage_proc = 0; | |
27178 | -#define SIIMAGE_MAX_DEVS 5 | |
27179 | +#define SIIMAGE_MAX_DEVS 16 | |
27180 | static struct pci_dev *siimage_devs[SIIMAGE_MAX_DEVS]; | |
27181 | static int n_siimage_devs; | |
27182 | ||
27183 | -static char * print_siimage_get_info (char *buf, struct pci_dev *dev, int index) | |
27184 | +/** | |
27185 | + * pdev_is_sata - check if device is SATA | |
27186 | + * @pdev: PCI device to check | |
27187 | + * | |
27188 | + * Returns true if this is a SATA controller | |
27189 | + */ | |
27190 | + | |
27191 | +static int pdev_is_sata(struct pci_dev *pdev) | |
27192 | +{ | |
27193 | + switch(pdev->device) | |
27194 | + { | |
27195 | + case PCI_DEVICE_ID_SII_3112: | |
27196 | + case PCI_DEVICE_ID_SII_1210SA: | |
27197 | + return 1; | |
27198 | + case PCI_DEVICE_ID_SII_680: | |
27199 | + return 0; | |
27200 | + } | |
27201 | + BUG(); | |
27202 | + return 0; | |
27203 | +} | |
27204 | + | |
27205 | +/** | |
27206 | + * is_sata - check if hwif is SATA | |
27207 | + * @hwif: interface to check | |
27208 | + * | |
27209 | + * Returns true if this is a SATA controller | |
27210 | + */ | |
27211 | + | |
27212 | +static inline int is_sata(ide_hwif_t *hwif) | |
27213 | +{ | |
27214 | + return pdev_is_sata(hwif->pci_dev); | |
27215 | +} | |
27216 | + | |
27217 | +/** | |
27218 | + * siimage_selreg - return register base | |
27219 | + * @hwif: interface | |
27220 | + * @r: config offset | |
27221 | + * | |
27222 | + * Turn a config register offset into the right address in either | |
27223 | + * PCI space or MMIO space to access the control register in question | |
27224 | + * Thankfully this is a configuration operation so isnt performance | |
27225 | + * criticial. | |
27226 | + */ | |
27227 | + | |
27228 | +static unsigned long siimage_selreg(ide_hwif_t *hwif, int r) | |
27229 | +{ | |
27230 | + unsigned long base = (unsigned long)hwif->hwif_data; | |
27231 | + base += 0xA0 + r; | |
27232 | + if(hwif->mmio) | |
27233 | + base += (hwif->channel << 6); | |
27234 | + else | |
27235 | + base += (hwif->channel << 4); | |
27236 | + return base; | |
27237 | +} | |
27238 | + | |
27239 | +/** | |
27240 | + * siimage_seldev - return register base | |
27241 | + * @hwif: interface | |
27242 | + * @r: config offset | |
27243 | + * | |
27244 | + * Turn a config register offset into the right address in either | |
27245 | + * PCI space or MMIO space to access the control register in question | |
27246 | + * including accounting for the unit shift. | |
27247 | + */ | |
27248 | + | |
27249 | +static inline unsigned long siimage_seldev(ide_drive_t *drive, int r) | |
27250 | +{ | |
27251 | + ide_hwif_t *hwif = HWIF(drive); | |
27252 | + unsigned long base = (unsigned long)hwif->hwif_data; | |
27253 | + base += 0xA0 + r; | |
27254 | + if(hwif->mmio) | |
27255 | + base += (hwif->channel << 6); | |
27256 | + else | |
27257 | + base += (hwif->channel << 4); | |
27258 | + base |= drive->select.b.unit << drive->select.b.unit; | |
27259 | + return base; | |
27260 | +} | |
27261 | + | |
27262 | +/** | |
27263 | + * print_siimage_get_info - print minimal proc information | |
27264 | + * @buf: buffer to write into (kernel space) | |
27265 | + * @dev: PCI device we are describing | |
27266 | + * @index: Controller number | |
27267 | + * | |
27268 | + * Print the basic information for the state of the CMD680/SI3112 | |
27269 | + * channel. We don't actually dump a lot of information out for | |
27270 | + * this controller although we could expand it if we needed. | |
27271 | + */ | |
27272 | + | |
27273 | +static char *print_siimage_get_info (char *buf, struct pci_dev *dev, int index) | |
27274 | { | |
27275 | char *p = buf; | |
27276 | u8 mmio = (pci_get_drvdata(dev) != NULL) ? 1 : 0; | |
27277 | - unsigned long bmdma = (mmio) ? ((unsigned long) pci_get_drvdata(dev)) : | |
27278 | - (pci_resource_start(dev, 4)); | |
27279 | + unsigned long bmdma = pci_resource_start(dev, 4); | |
27280 | + | |
27281 | + if(mmio) | |
27282 | + bmdma = pci_resource_start(dev, 5); | |
27283 | ||
27284 | p += sprintf(p, "\nController: %d\n", index); | |
27285 | p += sprintf(p, "SiI%x Chipset.\n", dev->device); | |
27286 | @@ -40,18 +147,20 @@ | |
27287 | p += sprintf(p, "MMIO Base 0x%lx\n", bmdma); | |
27288 | p += sprintf(p, "%s-DMA Base 0x%lx\n", (mmio)?"MMIO":"BM", bmdma); | |
27289 | p += sprintf(p, "%s-DMA Base 0x%lx\n", (mmio)?"MMIO":"BM", bmdma+8); | |
27290 | - | |
27291 | - p += sprintf(p, "--------------- Primary Channel " | |
27292 | - "---------------- Secondary Channel " | |
27293 | - "-------------\n"); | |
27294 | - p += sprintf(p, "--------------- drive0 --------- drive1 " | |
27295 | - "-------- drive0 ---------- drive1 ------\n"); | |
27296 | - p += sprintf(p, "PIO Mode: %s %s" | |
27297 | - " %s %s\n", | |
27298 | - "?", "?", "?", "?"); | |
27299 | return (char *)p; | |
27300 | } | |
27301 | ||
27302 | +/** | |
27303 | + * siimage_get_info - proc callback | |
27304 | + * @buffer: kernel buffer to complete | |
27305 | + * @addr: written with base of data to return | |
27306 | + * offset: seek offset | |
27307 | + * count: bytes to fill in | |
27308 | + * | |
27309 | + * Called when the user reads data from the virtual file for this | |
27310 | + * controller from /proc | |
27311 | + */ | |
27312 | + | |
27313 | static int siimage_get_info (char *buffer, char **addr, off_t offset, int count) | |
27314 | { | |
27315 | char *p = buffer; | |
27316 | @@ -72,46 +181,70 @@ | |
27317 | ||
27318 | #endif /* defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS) */ | |
27319 | ||
27320 | +/** | |
27321 | + * siimage_ratemask - Compute available modes | |
27322 | + * @drive: IDE drive | |
27323 | + * | |
27324 | + * Compute the available speeds for the devices on the interface. | |
27325 | + * For the CMD680 this depends on the clocking mode (scsc), for the | |
27326 | + * SI3312 SATA controller life is a bit simpler. Enforce UDMA33 | |
27327 | + * as a limit if there is no 80pin cable present. | |
27328 | + */ | |
27329 | + | |
27330 | static byte siimage_ratemask (ide_drive_t *drive) | |
27331 | { | |
27332 | ide_hwif_t *hwif = HWIF(drive); | |
27333 | u8 mode = 0, scsc = 0; | |
27334 | + unsigned long base = (unsigned long) hwif->hwif_data; | |
27335 | ||
27336 | if (hwif->mmio) | |
27337 | - scsc = hwif->INB(HWIFADDR(0x4A)); | |
27338 | + scsc = hwif->INB(base + 0x4A); | |
27339 | else | |
27340 | pci_read_config_byte(hwif->pci_dev, 0x8A, &scsc); | |
27341 | ||
27342 | - switch(hwif->pci_dev->device) { | |
27343 | - case PCI_DEVICE_ID_SII_3112: | |
27344 | - return 4; | |
27345 | - case PCI_DEVICE_ID_SII_680: | |
27346 | - if ((scsc & 0x10) == 0x10) /* 133 */ | |
27347 | - mode = 4; | |
27348 | - else if ((scsc & 0x30) == 0x00) /* 100 */ | |
27349 | - mode = 3; | |
27350 | - else if ((scsc & 0x20) == 0x20) /* 66 eek */ | |
27351 | - BUG(); // mode = 2; | |
27352 | - break; | |
27353 | - default: return 0; | |
27354 | + if(is_sata(hwif)) | |
27355 | + { | |
27356 | + if(strstr(drive->id->model, "Maxtor")) | |
27357 | + return 3; | |
27358 | + return 4; | |
27359 | } | |
27360 | + | |
27361 | + if ((scsc & 0x30) == 0x10) /* 133 */ | |
27362 | + mode = 4; | |
27363 | + else if ((scsc & 0x30) == 0x20) /* 2xPCI */ | |
27364 | + mode = 4; | |
27365 | + else if ((scsc & 0x30) == 0x00) /* 100 */ | |
27366 | + mode = 3; | |
27367 | + else /* Disabled ? */ | |
27368 | + BUG(); | |
27369 | + | |
27370 | if (!eighty_ninty_three(drive)) | |
27371 | mode = min(mode, (u8)1); | |
27372 | return mode; | |
27373 | } | |
27374 | ||
27375 | +/** | |
27376 | + * siimage_taskfile_timing - turn timing data to a mode | |
27377 | + * @hwif: interface to query | |
27378 | + * | |
27379 | + * Read the timing data for the interface and return the | |
27380 | + * mode that is being used. | |
27381 | + */ | |
27382 | + | |
27383 | static byte siimage_taskfile_timing (ide_hwif_t *hwif) | |
27384 | { | |
27385 | u16 timing = 0x328a; | |
27386 | + unsigned long addr = siimage_selreg(hwif, 2); | |
27387 | ||
27388 | if (hwif->mmio) | |
27389 | - timing = hwif->INW(SELADDR(2)); | |
27390 | + timing = hwif->INW(addr); | |
27391 | else | |
27392 | - pci_read_config_word(hwif->pci_dev, SELREG(2), &timing); | |
27393 | + pci_read_config_word(hwif->pci_dev, addr, &timing); | |
27394 | ||
27395 | switch (timing) { | |
27396 | case 0x10c1: return 4; | |
27397 | case 0x10c3: return 3; | |
27398 | + case 0x1104: | |
27399 | case 0x1281: return 2; | |
27400 | case 0x2283: return 1; | |
27401 | case 0x328a: | |
27402 | @@ -119,34 +252,88 @@ | |
27403 | } | |
27404 | } | |
27405 | ||
27406 | +/** | |
27407 | + * simmage_tuneproc - tune a drive | |
27408 | + * @drive: drive to tune | |
27409 | + * @mode_wanted: the target operating mode | |
27410 | + * | |
27411 | + * Load the timing settings for this device mode into the | |
27412 | + * controller. If we are in PIO mode 3 or 4 turn on IORDY | |
27413 | + * monitoring (bit 9). The TF timing is bits 31:16 | |
27414 | + */ | |
27415 | + | |
27416 | static void siimage_tuneproc (ide_drive_t *drive, byte mode_wanted) | |
27417 | { | |
27418 | ide_hwif_t *hwif = HWIF(drive); | |
27419 | - struct pci_dev *dev = hwif->pci_dev; | |
27420 | - u16 speedt = 0; | |
27421 | - u8 unit = drive->select.b.unit; | |
27422 | - | |
27423 | - if (hwif->mmio) | |
27424 | - speedt = hwif->INW(SELADDR(0x04|(unit<<unit))); | |
27425 | - else | |
27426 | - pci_read_config_word(dev, SELADDR(0x04|(unit<<unit)), &speedt); | |
27427 | - | |
27428 | + u32 speedt = 0; | |
27429 | + u16 speedp = 0; | |
27430 | + unsigned long addr = siimage_seldev(drive, 0x04); | |
27431 | + unsigned long tfaddr = siimage_selreg(hwif, 0x02); | |
27432 | + | |
27433 | /* cheat for now and use the docs */ | |
27434 | -// switch(siimage_taskfile_timing(hwif)) { | |
27435 | switch(mode_wanted) { | |
27436 | - case 4: speedt = 0x10c1; break; | |
27437 | - case 3: speedt = 0x10C3; break; | |
27438 | - case 2: speedt = 0x1104; break; | |
27439 | - case 1: speedt = 0x2283; break; | |
27440 | + case 4: | |
27441 | + speedp = 0x10c1; | |
27442 | + speedt = 0x10c1; | |
27443 | + break; | |
27444 | + case 3: | |
27445 | + speedp = 0x10C3; | |
27446 | + speedt = 0x10C3; | |
27447 | + break; | |
27448 | + case 2: | |
27449 | + speedp = 0x1104; | |
27450 | + speedt = 0x1281; | |
27451 | + break; | |
27452 | + case 1: | |
27453 | + speedp = 0x2283; | |
27454 | + speedt = 0x1281; | |
27455 | + break; | |
27456 | case 0: | |
27457 | - default: speedt = 0x328A; break; | |
27458 | + default: | |
27459 | + speedp = 0x328A; | |
27460 | + speedt = 0x328A; | |
27461 | + break; | |
27462 | } | |
27463 | if (hwif->mmio) | |
27464 | - hwif->OUTW(speedt, SELADDR(0x04|(unit<<unit))); | |
27465 | + { | |
27466 | + hwif->OUTW(speedt, addr); | |
27467 | + hwif->OUTW(speedp, tfaddr); | |
27468 | + /* Now set up IORDY */ | |
27469 | + if(mode_wanted == 3 || mode_wanted == 4) | |
27470 | + hwif->OUTW(hwif->INW(tfaddr-2)|0x200, tfaddr-2); | |
27471 | + else | |
27472 | + hwif->OUTW(hwif->INW(tfaddr-2)&~0x200, tfaddr-2); | |
27473 | + } | |
27474 | else | |
27475 | - pci_write_config_word(dev, SELADDR(0x04|(unit<<unit)), speedt); | |
27476 | + { | |
27477 | + pci_write_config_word(hwif->pci_dev, addr, speedp); | |
27478 | + pci_write_config_word(hwif->pci_dev, tfaddr, speedt); | |
27479 | + pci_read_config_word(hwif->pci_dev, tfaddr-2, &speedp); | |
27480 | + speedp &= ~0x200; | |
27481 | + /* Set IORDY for mode 3 or 4 */ | |
27482 | + if(mode_wanted == 3 || mode_wanted == 4) | |
27483 | + speedp |= 0x200; | |
27484 | + pci_write_config_word(hwif->pci_dev, tfaddr-2, speedp); | |
27485 | + } | |
27486 | } | |
27487 | ||
27488 | +/** | |
27489 | + * config_siimage_chipset_for_pio - set drive timings | |
27490 | + * @drive: drive to tune | |
27491 | + * @speed we want | |
27492 | + * | |
27493 | + * Compute the best pio mode we can for a given device. Also honour | |
27494 | + * the timings for the driver when dealing with mixed devices. Some | |
27495 | + * of this is ugly but its all wrapped up here | |
27496 | + * | |
27497 | + * The SI680 can also do VDMA - we need to start using that | |
27498 | + * | |
27499 | + * FIXME: we use the BIOS channel timings to avoid driving the task | |
27500 | + * files too fast at the disk. We need to compute the master/slave | |
27501 | + * drive PIO mode properly so that we can up the speed on a hotplug | |
27502 | + * system. | |
27503 | + */ | |
27504 | + | |
27505 | static void config_siimage_chipset_for_pio (ide_drive_t *drive, byte set_speed) | |
27506 | { | |
27507 | u8 channel_timings = siimage_taskfile_timing(HWIF(drive)); | |
27508 | @@ -167,6 +354,16 @@ | |
27509 | config_siimage_chipset_for_pio(drive, set_speed); | |
27510 | } | |
27511 | ||
27512 | +/** | |
27513 | + * siimage_tune_chipset - set controller timings | |
27514 | + * @drive: Drive to set up | |
27515 | + * @xferspeed: speed we want to achieve | |
27516 | + * | |
27517 | + * Tune the SII chipset for the desired mode. If we can't achieve | |
27518 | + * the desired mode then tune for a lower one, but ultimately | |
27519 | + * make the thing work. | |
27520 | + */ | |
27521 | + | |
27522 | static int siimage_tune_chipset (ide_drive_t *drive, byte xferspeed) | |
27523 | { | |
27524 | u8 ultra6[] = { 0x0F, 0x0B, 0x07, 0x05, 0x03, 0x02, 0x01 }; | |
27525 | @@ -176,30 +373,32 @@ | |
27526 | ide_hwif_t *hwif = HWIF(drive); | |
27527 | u16 ultra = 0, multi = 0; | |
27528 | u8 mode = 0, unit = drive->select.b.unit; | |
27529 | - u8 speed = ide_rate_filter(siimage_ratemask(drive), xferspeed); | |
27530 | + u8 speed = ide_rate_filter(siimage_ratemask(drive), xferspeed); | |
27531 | + unsigned long base = (unsigned long)hwif->hwif_data; | |
27532 | u8 scsc = 0, addr_mask = ((hwif->channel) ? | |
27533 | ((hwif->mmio) ? 0xF4 : 0x84) : | |
27534 | ((hwif->mmio) ? 0xB4 : 0x80)); | |
27535 | + | |
27536 | + unsigned long ma = siimage_seldev(drive, 0x08); | |
27537 | + unsigned long ua = siimage_seldev(drive, 0x0C); | |
27538 | ||
27539 | if (hwif->mmio) { | |
27540 | - scsc = hwif->INB(HWIFADDR(0x4A)); | |
27541 | - mode = hwif->INB(HWIFADDR(addr_mask)); | |
27542 | - multi = hwif->INW(SELADDR(0x08|(unit<<unit))); | |
27543 | - ultra = hwif->INW(SELADDR(0x0C|(unit<<unit))); | |
27544 | + scsc = hwif->INB(base + 0x4A); | |
27545 | + mode = hwif->INB(base + addr_mask); | |
27546 | + multi = hwif->INW(ma); | |
27547 | + ultra = hwif->INW(ua); | |
27548 | } else { | |
27549 | - pci_read_config_byte(hwif->pci_dev, HWIFADDR(0x8A), &scsc); | |
27550 | + pci_read_config_byte(hwif->pci_dev, 0x8A, &scsc); | |
27551 | pci_read_config_byte(hwif->pci_dev, addr_mask, &mode); | |
27552 | - pci_read_config_word(hwif->pci_dev, | |
27553 | - SELREG(0x08|(unit<<unit)), &multi); | |
27554 | - pci_read_config_word(hwif->pci_dev, | |
27555 | - SELREG(0x0C|(unit<<unit)), &ultra); | |
27556 | + pci_read_config_word(hwif->pci_dev, ma, &multi); | |
27557 | + pci_read_config_word(hwif->pci_dev, ua, &ultra); | |
27558 | } | |
27559 | ||
27560 | mode &= ~((unit) ? 0x30 : 0x03); | |
27561 | ultra &= ~0x3F; | |
27562 | scsc = ((scsc & 0x30) == 0x00) ? 0 : 1; | |
27563 | ||
27564 | - scsc = (hwif->pci_dev->device == PCI_DEVICE_ID_SII_3112) ? 1 : scsc; | |
27565 | + scsc = is_sata(hwif) ? 1 : scsc; | |
27566 | ||
27567 | switch(speed) { | |
27568 | case XFER_PIO_4: | |
27569 | @@ -225,8 +424,8 @@ | |
27570 | case XFER_UDMA_1: | |
27571 | case XFER_UDMA_0: | |
27572 | multi = dma[2]; | |
27573 | - ultra |= ((scsc) ? (ultra5[speed - XFER_UDMA_0]) : | |
27574 | - (ultra6[speed - XFER_UDMA_0])); | |
27575 | + ultra |= ((scsc) ? (ultra6[speed - XFER_UDMA_0]) : | |
27576 | + (ultra5[speed - XFER_UDMA_0])); | |
27577 | mode |= ((unit) ? 0x30 : 0x03); | |
27578 | config_siimage_chipset_for_pio(drive, 0); | |
27579 | break; | |
27580 | @@ -235,20 +434,26 @@ | |
27581 | } | |
27582 | ||
27583 | if (hwif->mmio) { | |
27584 | - hwif->OUTB(mode, HWIFADDR(addr_mask)); | |
27585 | - hwif->OUTW(multi, SELADDR(0x08|(unit<<unit))); | |
27586 | - hwif->OUTW(ultra, SELADDR(0x0C|(unit<<unit))); | |
27587 | + hwif->OUTB(mode, base + addr_mask); | |
27588 | + hwif->OUTW(multi, ma); | |
27589 | + hwif->OUTW(ultra, ua); | |
27590 | } else { | |
27591 | pci_write_config_byte(hwif->pci_dev, addr_mask, mode); | |
27592 | - pci_write_config_word(hwif->pci_dev, | |
27593 | - SELREG(0x08|(unit<<unit)), multi); | |
27594 | - pci_write_config_word(hwif->pci_dev, | |
27595 | - SELREG(0x0C|(unit<<unit)), ultra); | |
27596 | + pci_write_config_word(hwif->pci_dev, ma, multi); | |
27597 | + pci_write_config_word(hwif->pci_dev, ua, ultra); | |
27598 | } | |
27599 | - | |
27600 | return (ide_config_drive_speed(drive, speed)); | |
27601 | } | |
27602 | ||
27603 | +/** | |
27604 | + * config_chipset_for_dma - configure for DMA | |
27605 | + * @drive: drive to configure | |
27606 | + * | |
27607 | + * Called by the IDE layer when it wants the timings set up. | |
27608 | + * For the CMD680 we also need to set up the PIO timings and | |
27609 | + * enable DMA. | |
27610 | + */ | |
27611 | + | |
27612 | static int config_chipset_for_dma (ide_drive_t *drive) | |
27613 | { | |
27614 | u8 speed = ide_dma_speed(drive, siimage_ratemask(drive)); | |
27615 | @@ -267,14 +472,22 @@ | |
27616 | return ide_dma_enable(drive); | |
27617 | } | |
27618 | ||
27619 | +/** | |
27620 | + * siimage_configure_drive_for_dma - set up for DMA transfers | |
27621 | + * @drive: drive we are going to set up | |
27622 | + * | |
27623 | + * Set up the drive for DMA, tune the controller and drive as | |
27624 | + * required. If the drive isn't suitable for DMA or we hit | |
27625 | + * other problems then we will drop down to PIO and set up | |
27626 | + * PIO appropriately | |
27627 | + */ | |
27628 | + | |
27629 | static int siimage_config_drive_for_dma (ide_drive_t *drive) | |
27630 | { | |
27631 | ide_hwif_t *hwif = HWIF(drive); | |
27632 | struct hd_driveid *id = drive->id; | |
27633 | ||
27634 | - if (id != NULL && (id->capability & 1) != 0 && drive->autodma) { | |
27635 | - if (!(hwif->atapi_dma)) | |
27636 | - goto fast_ata_pio; | |
27637 | + if ((id->capability & 1) != 0 && drive->autodma) { | |
27638 | /* Consult the list of known "bad" drives */ | |
27639 | if (hwif->ide_dma_bad_drive(drive)) | |
27640 | goto fast_ata_pio; | |
27641 | @@ -316,18 +529,28 @@ | |
27642 | { | |
27643 | ide_hwif_t *hwif = HWIF(drive); | |
27644 | u8 dma_altstat = 0; | |
27645 | + unsigned long addr = siimage_selreg(hwif, 1); | |
27646 | ||
27647 | /* return 1 if INTR asserted */ | |
27648 | if ((hwif->INB(hwif->dma_status) & 4) == 4) | |
27649 | return 1; | |
27650 | ||
27651 | /* return 1 if Device INTR asserted */ | |
27652 | - pci_read_config_byte(hwif->pci_dev, SELREG(1), &dma_altstat); | |
27653 | + pci_read_config_byte(hwif->pci_dev, addr, &dma_altstat); | |
27654 | if (dma_altstat & 8) | |
27655 | return 0; //return 1; | |
27656 | return 0; | |
27657 | } | |
27658 | ||
27659 | +/** | |
27660 | + * siimage_mmio_ide_dma_count - DMA bytes done | |
27661 | + * @drive | |
27662 | + * | |
27663 | + * If we are doing VDMA the CMD680 requires a little bit | |
27664 | + * of more careful handling and we have to read the counts | |
27665 | + * off ourselves. For non VDMA life is normal. | |
27666 | + */ | |
27667 | + | |
27668 | static int siimage_mmio_ide_dma_count (ide_drive_t *drive) | |
27669 | { | |
27670 | #ifdef SIIMAGE_VIRTUAL_DMAPIO | |
27671 | @@ -335,9 +558,10 @@ | |
27672 | ide_hwif_t *hwif = HWIF(drive); | |
27673 | u32 count = (rq->nr_sectors * SECTOR_SIZE); | |
27674 | u32 rcount = 0; | |
27675 | + unsigned long addr = siimage_selreg(hwif, 0x1C); | |
27676 | ||
27677 | - hwif->OUTL(count, SELADDR(0x1C)); | |
27678 | - rcount = hwif->INL(SELADDR(0x1C)); | |
27679 | + hwif->OUTL(count, addr); | |
27680 | + rcount = hwif->INL(addr); | |
27681 | ||
27682 | printk("\n%s: count = %d, rcount = %d, nr_sectors = %lu\n", | |
27683 | drive->name, count, rcount, rq->nr_sectors); | |
27684 | @@ -346,13 +570,22 @@ | |
27685 | return __ide_dma_count(drive); | |
27686 | } | |
27687 | ||
27688 | -/* returns 1 if dma irq issued, 0 otherwise */ | |
27689 | +/** | |
27690 | + * siimage_mmio_ide_dma_test_irq - check we caused an IRQ | |
27691 | + * @drive: drive we are testing | |
27692 | + * | |
27693 | + * Check if we caused an IDE DMA interrupt. We may also have caused | |
27694 | + * SATA status interrupts, if so we clean them up and continue. | |
27695 | + */ | |
27696 | + | |
27697 | static int siimage_mmio_ide_dma_test_irq (ide_drive_t *drive) | |
27698 | { | |
27699 | ide_hwif_t *hwif = HWIF(drive); | |
27700 | + unsigned long base = (unsigned long)hwif->hwif_data; | |
27701 | + unsigned long addr = siimage_selreg(hwif, 0x1); | |
27702 | ||
27703 | if (SATA_ERROR_REG) { | |
27704 | - u32 ext_stat = hwif->INL(HWIFADDR(0x10)); | |
27705 | + u32 ext_stat = hwif->INL(base + 0x10); | |
27706 | u8 watchdog = 0; | |
27707 | if (ext_stat & ((hwif->channel) ? 0x40 : 0x10)) { | |
27708 | u32 sata_error = hwif->INL(SATA_ERROR_REG); | |
27709 | @@ -379,7 +612,7 @@ | |
27710 | return 1; | |
27711 | ||
27712 | /* return 1 if Device INTR asserted */ | |
27713 | - if ((hwif->INB(SELADDR(1)) & 8) == 8) | |
27714 | + if ((hwif->INB(addr) & 8) == 8) | |
27715 | return 0; //return 1; | |
27716 | ||
27717 | return 0; | |
27718 | @@ -388,21 +621,29 @@ | |
27719 | static int siimage_mmio_ide_dma_verbose (ide_drive_t *drive) | |
27720 | { | |
27721 | int temp = __ide_dma_verbose(drive); | |
27722 | -#if 0 | |
27723 | - drive->using_dma = 0; | |
27724 | -#endif | |
27725 | return temp; | |
27726 | } | |
27727 | ||
27728 | +/** | |
27729 | + * siimage_busproc - bus isolation ioctl | |
27730 | + * @drive: drive to isolate/restore | |
27731 | + * @state: bus state to set | |
27732 | + * | |
27733 | + * Used by the SII3112 to handle bus isolation. As this is a | |
27734 | + * SATA controller the work required is quite limited, we | |
27735 | + * just have to clean up the statistics | |
27736 | + */ | |
27737 | + | |
27738 | static int siimage_busproc (ide_drive_t * drive, int state) | |
27739 | { | |
27740 | ide_hwif_t *hwif = HWIF(drive); | |
27741 | u32 stat_config = 0; | |
27742 | + unsigned long addr = siimage_selreg(hwif, 0); | |
27743 | ||
27744 | if (hwif->mmio) { | |
27745 | - stat_config = hwif->INL(SELADDR(0)); | |
27746 | + stat_config = hwif->INL(addr); | |
27747 | } else | |
27748 | - pci_read_config_dword(hwif->pci_dev, SELREG(0), &stat_config); | |
27749 | + pci_read_config_dword(hwif->pci_dev, addr, &stat_config); | |
27750 | ||
27751 | switch (state) { | |
27752 | case BUSSTATE_ON: | |
27753 | @@ -418,12 +659,20 @@ | |
27754 | hwif->drives[1].failures = hwif->drives[1].max_failures + 1; | |
27755 | break; | |
27756 | default: | |
27757 | - return 0; | |
27758 | + return -EINVAL; | |
27759 | } | |
27760 | hwif->bus_state = state; | |
27761 | return 0; | |
27762 | } | |
27763 | ||
27764 | +/** | |
27765 | + * siimage_reset_poll - wait for sata reset | |
27766 | + * @drive: drive we are resetting | |
27767 | + * | |
27768 | + * Poll the SATA phy and see whether it has come back from the dead | |
27769 | + * yet. | |
27770 | + */ | |
27771 | + | |
27772 | static int siimage_reset_poll (ide_drive_t *drive) | |
27773 | { | |
27774 | if (SATA_STATUS_REG) { | |
27775 | @@ -433,13 +682,7 @@ | |
27776 | printk(KERN_WARNING "%s: reset phy dead, status=0x%08x\n", | |
27777 | hwif->name, hwif->INL(SATA_STATUS_REG)); | |
27778 | HWGROUP(drive)->poll_timeout = 0; | |
27779 | -#if 0 | |
27780 | - drive->failures++; | |
27781 | - return ide_stopped; | |
27782 | -#else | |
27783 | return ide_started; | |
27784 | -#endif | |
27785 | - return 1; | |
27786 | } | |
27787 | return 0; | |
27788 | } else { | |
27789 | @@ -447,34 +690,53 @@ | |
27790 | } | |
27791 | } | |
27792 | ||
27793 | +/** | |
27794 | + * siimage_pre_reset - reset hook | |
27795 | + * @drive: IDE device being reset | |
27796 | + * | |
27797 | + * For the SATA devices we need to handle recalibration/geometry | |
27798 | + * differently | |
27799 | + */ | |
27800 | + | |
27801 | static void siimage_pre_reset (ide_drive_t *drive) | |
27802 | { | |
27803 | if (drive->media != ide_disk) | |
27804 | return; | |
27805 | ||
27806 | - if (HWIF(drive)->pci_dev->device == PCI_DEVICE_ID_SII_3112) { | |
27807 | + if (is_sata(HWIF(drive))) | |
27808 | + { | |
27809 | drive->special.b.set_geometry = 0; | |
27810 | drive->special.b.recalibrate = 0; | |
27811 | } | |
27812 | } | |
27813 | ||
27814 | +/** | |
27815 | + * siimage_reset - reset a device on an siimage controller | |
27816 | + * @drive: drive to reset | |
27817 | + * | |
27818 | + * Perform a controller level reset fo the device. For | |
27819 | + * SATA we must also check the PHY. | |
27820 | + */ | |
27821 | + | |
27822 | static void siimage_reset (ide_drive_t *drive) | |
27823 | { | |
27824 | ide_hwif_t *hwif = HWIF(drive); | |
27825 | u8 reset = 0; | |
27826 | + unsigned long addr = siimage_selreg(hwif, 0); | |
27827 | ||
27828 | if (hwif->mmio) { | |
27829 | - reset = hwif->INB(SELADDR(0)); | |
27830 | - hwif->OUTB((reset|0x03), SELADDR(0)); | |
27831 | + reset = hwif->INB(addr); | |
27832 | + hwif->OUTB((reset|0x03), addr); | |
27833 | + /* FIXME:posting */ | |
27834 | udelay(25); | |
27835 | - hwif->OUTB(reset, SELADDR(0)); | |
27836 | - (void) hwif->INB(SELADDR(0)); | |
27837 | + hwif->OUTB(reset, addr); | |
27838 | + (void) hwif->INB(addr); | |
27839 | } else { | |
27840 | - pci_read_config_byte(hwif->pci_dev, SELREG(0), &reset); | |
27841 | - pci_write_config_byte(hwif->pci_dev, SELREG(0), reset|0x03); | |
27842 | + pci_read_config_byte(hwif->pci_dev, addr, &reset); | |
27843 | + pci_write_config_byte(hwif->pci_dev, addr, reset|0x03); | |
27844 | udelay(25); | |
27845 | - pci_write_config_byte(hwif->pci_dev, SELREG(0), reset); | |
27846 | - pci_read_config_byte(hwif->pci_dev, SELREG(0), &reset); | |
27847 | + pci_write_config_byte(hwif->pci_dev, addr, reset); | |
27848 | + pci_read_config_byte(hwif->pci_dev, addr, &reset); | |
27849 | } | |
27850 | ||
27851 | if (SATA_STATUS_REG) { | |
27852 | @@ -490,20 +752,28 @@ | |
27853 | ||
27854 | } | |
27855 | ||
27856 | +/** | |
27857 | + * proc_reports_siimage - add siimage controller to proc | |
27858 | + * @dev: PCI device | |
27859 | + * @clocking: SCSC value | |
27860 | + * @name: controller name | |
27861 | + * | |
27862 | + * Report the clocking mode of the controller and add it to | |
27863 | + * the /proc interface layer | |
27864 | + */ | |
27865 | + | |
27866 | static void proc_reports_siimage (struct pci_dev *dev, u8 clocking, const char *name) | |
27867 | { | |
27868 | - if (dev->device == PCI_DEVICE_ID_SII_3112) | |
27869 | + if(pdev_is_sata(dev)) | |
27870 | goto sata_skip; | |
27871 | ||
27872 | printk(KERN_INFO "%s: BASE CLOCK ", name); | |
27873 | - clocking &= ~0x0C; | |
27874 | + clocking &= 0x03; | |
27875 | switch(clocking) { | |
27876 | case 0x03: printk("DISABLED !\n"); break; | |
27877 | case 0x02: printk("== 2X PCI \n"); break; | |
27878 | case 0x01: printk("== 133 \n"); break; | |
27879 | case 0x00: printk("== 100 \n"); break; | |
27880 | - default: | |
27881 | - BUG(); | |
27882 | } | |
27883 | ||
27884 | sata_skip: | |
27885 | @@ -518,75 +788,108 @@ | |
27886 | #endif /* DISPLAY_SIIMAGE_TIMINGS && CONFIG_PROC_FS */ | |
27887 | } | |
27888 | ||
27889 | +/** | |
27890 | + * setup_mmio_siimage - switch an SI controller into MMIO | |
27891 | + * @dev: PCI device we are configuring | |
27892 | + * @name: device name | |
27893 | + * | |
27894 | + * Attempt to put the device into mmio mode. There are some slight | |
27895 | + * complications here with certain systems where the mmio bar isnt | |
27896 | + * mapped so we have to be sure we can fall back to I/O. | |
27897 | + */ | |
27898 | + | |
27899 | static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name) | |
27900 | { | |
27901 | unsigned long bar5 = pci_resource_start(dev, 5); | |
27902 | - unsigned long end5 = pci_resource_end(dev, 5); | |
27903 | + unsigned long barsize = pci_resource_len(dev, 5); | |
27904 | u8 tmpbyte = 0; | |
27905 | unsigned long addr; | |
27906 | void *ioaddr; | |
27907 | ||
27908 | - ioaddr = ioremap_nocache(bar5, (end5 - bar5)); | |
27909 | + /* | |
27910 | + * Drop back to PIO if we can't map the mmio. Some | |
27911 | + * systems seem to get terminally confused in the PCI | |
27912 | + * spaces. | |
27913 | + */ | |
27914 | + | |
27915 | + if(!request_mem_region(bar5, barsize, name)) | |
27916 | + { | |
27917 | + printk(KERN_WARNING "siimage: IDE controller MMIO ports not available.\n"); | |
27918 | + return 0; | |
27919 | + } | |
27920 | + | |
27921 | + ioaddr = ioremap(bar5, barsize); | |
27922 | ||
27923 | if (ioaddr == NULL) | |
27924 | + { | |
27925 | + release_mem_region(bar5, barsize); | |
27926 | return 0; | |
27927 | + } | |
27928 | ||
27929 | pci_set_master(dev); | |
27930 | pci_set_drvdata(dev, ioaddr); | |
27931 | addr = (unsigned long) ioaddr; | |
27932 | ||
27933 | - if (dev->device == PCI_DEVICE_ID_SII_3112) { | |
27934 | - writel(0, DEVADDR(0x148)); | |
27935 | - writel(0, DEVADDR(0x1C8)); | |
27936 | + if (pdev_is_sata(dev)) { | |
27937 | + writel(0, addr + 0x148); | |
27938 | + writel(0, addr + 0x1C8); | |
27939 | } | |
27940 | ||
27941 | - writeb(0, DEVADDR(0xB4)); | |
27942 | - writeb(0, DEVADDR(0xF4)); | |
27943 | - tmpbyte = readb(DEVADDR(0x4A)); | |
27944 | - | |
27945 | - switch(tmpbyte) { | |
27946 | - case 0x01: | |
27947 | - writeb(tmpbyte|0x10, DEVADDR(0x4A)); | |
27948 | - tmpbyte = readb(DEVADDR(0x4A)); | |
27949 | - case 0x31: | |
27950 | - /* if clocking is disabled */ | |
27951 | - /* 133 clock attempt to force it on */ | |
27952 | - writeb(tmpbyte & ~0x20, DEVADDR(0x4A)); | |
27953 | - tmpbyte = readb(DEVADDR(0x4A)); | |
27954 | - case 0x11: | |
27955 | - case 0x21: | |
27956 | + writeb(0, addr + 0xB4); | |
27957 | + writeb(0, addr + 0xF4); | |
27958 | + tmpbyte = readb(addr + 0x4A); | |
27959 | + | |
27960 | + switch(tmpbyte & 0x30) { | |
27961 | + case 0x00: | |
27962 | + /* In 100 MHz clocking, try and switch to 133 */ | |
27963 | + writeb(tmpbyte|0x10, addr + 0x4A); | |
27964 | break; | |
27965 | - default: | |
27966 | - tmpbyte &= ~0x30; | |
27967 | - tmpbyte |= 0x20; | |
27968 | - writeb(tmpbyte, DEVADDR(0x4A)); | |
27969 | + case 0x10: | |
27970 | + /* On 133Mhz clocking */ | |
27971 | + break; | |
27972 | + case 0x20: | |
27973 | + /* On PCIx2 clocking */ | |
27974 | + break; | |
27975 | + case 0x30: | |
27976 | + /* Clocking is disabled */ | |
27977 | + /* 133 clock attempt to force it on */ | |
27978 | + writeb(tmpbyte & ~0x20, addr + 0x4A); | |
27979 | break; | |
27980 | } | |
27981 | ||
27982 | - writeb(0x72, DEVADDR(0xA1)); | |
27983 | - writew(0x328A, DEVADDR(0xA2)); | |
27984 | - writel(0x62DD62DD, DEVADDR(0xA4)); | |
27985 | - writel(0x43924392, DEVADDR(0xA8)); | |
27986 | - writel(0x40094009, DEVADDR(0xAC)); | |
27987 | - writeb(0x72, DEVADDR(0xE1)); | |
27988 | - writew(0x328A, DEVADDR(0xE2)); | |
27989 | - writel(0x62DD62DD, DEVADDR(0xE4)); | |
27990 | - writel(0x43924392, DEVADDR(0xE8)); | |
27991 | - writel(0x40094009, DEVADDR(0xEC)); | |
27992 | - | |
27993 | - if (dev->device == PCI_DEVICE_ID_SII_3112) { | |
27994 | - writel(0xFFFF0000, DEVADDR(0x108)); | |
27995 | - writel(0xFFFF0000, DEVADDR(0x188)); | |
27996 | - writel(0x00680000, DEVADDR(0x148)); | |
27997 | - writel(0x00680000, DEVADDR(0x1C8)); | |
27998 | + writeb( 0x72, addr + 0xA1); | |
27999 | + writew( 0x328A, addr + 0xA2); | |
28000 | + writel(0x62DD62DD, addr + 0xA4); | |
28001 | + writel(0x43924392, addr + 0xA8); | |
28002 | + writel(0x40094009, addr + 0xAC); | |
28003 | + writeb( 0x72, addr + 0xE1); | |
28004 | + writew( 0x328A, addr + 0xE2); | |
28005 | + writel(0x62DD62DD, addr + 0xE4); | |
28006 | + writel(0x43924392, addr + 0xE8); | |
28007 | + writel(0x40094009, addr + 0xEC); | |
28008 | + | |
28009 | + if (pdev_is_sata(dev)) { | |
28010 | + writel(0xFFFF0000, addr + 0x108); | |
28011 | + writel(0xFFFF0000, addr + 0x188); | |
28012 | + writel(0x00680000, addr + 0x148); | |
28013 | + writel(0x00680000, addr + 0x1C8); | |
28014 | } | |
28015 | ||
28016 | - tmpbyte = readb(DEVADDR(0x4A)); | |
28017 | + tmpbyte = readb(addr + 0x4A); | |
28018 | ||
28019 | - proc_reports_siimage(dev, (tmpbyte>>=4), name); | |
28020 | + proc_reports_siimage(dev, (tmpbyte>>4), name); | |
28021 | return 1; | |
28022 | } | |
28023 | ||
28024 | +/** | |
28025 | + * init_chipset_siimage - set up an SI device | |
28026 | + * @dev: PCI device | |
28027 | + * @name: device name | |
28028 | + * | |
28029 | + * Perform the initial PCI set up for this device. Attempt to switch | |
28030 | + * to 133MHz clocking if the system isn't already set up to do it. | |
28031 | + */ | |
28032 | + | |
28033 | static unsigned int __init init_chipset_siimage (struct pci_dev *dev, const char *name) | |
28034 | { | |
28035 | u32 class_rev = 0; | |
28036 | @@ -607,139 +910,150 @@ | |
28037 | pci_write_config_byte(dev, 0x80, 0x00); | |
28038 | pci_write_config_byte(dev, 0x84, 0x00); | |
28039 | pci_read_config_byte(dev, 0x8A, &tmpbyte); | |
28040 | - switch(tmpbyte) { | |
28041 | + switch(tmpbyte & 0x30) { | |
28042 | case 0x00: | |
28043 | - case 0x01: | |
28044 | /* 133 clock attempt to force it on */ | |
28045 | pci_write_config_byte(dev, 0x8A, tmpbyte|0x10); | |
28046 | - pci_read_config_byte(dev, 0x8A, &tmpbyte); | |
28047 | case 0x30: | |
28048 | - case 0x31: | |
28049 | /* if clocking is disabled */ | |
28050 | /* 133 clock attempt to force it on */ | |
28051 | pci_write_config_byte(dev, 0x8A, tmpbyte & ~0x20); | |
28052 | - pci_read_config_byte(dev, 0x8A, &tmpbyte); | |
28053 | case 0x10: | |
28054 | - case 0x11: | |
28055 | - case 0x20: | |
28056 | - case 0x21: | |
28057 | + /* 133 already */ | |
28058 | break; | |
28059 | - default: | |
28060 | - tmpbyte &= ~0x30; | |
28061 | - tmpbyte |= 0x20; | |
28062 | - pci_write_config_byte(dev, 0x8A, tmpbyte); | |
28063 | + case 0x20: | |
28064 | + /* BIOS set PCI x2 clocking */ | |
28065 | break; | |
28066 | } | |
28067 | ||
28068 | - pci_read_config_byte(dev, 0x8A, &tmpbyte); | |
28069 | - pci_write_config_byte(dev, 0xA1, 0x72); | |
28070 | - pci_write_config_word(dev, 0xA2, 0x328A); | |
28071 | + pci_read_config_byte(dev, 0x8A, &tmpbyte); | |
28072 | + | |
28073 | + pci_write_config_byte(dev, 0xA1, 0x72); | |
28074 | + pci_write_config_word(dev, 0xA2, 0x328A); | |
28075 | pci_write_config_dword(dev, 0xA4, 0x62DD62DD); | |
28076 | pci_write_config_dword(dev, 0xA8, 0x43924392); | |
28077 | pci_write_config_dword(dev, 0xAC, 0x40094009); | |
28078 | - pci_write_config_byte(dev, 0xB1, 0x72); | |
28079 | - pci_write_config_word(dev, 0xB2, 0x328A); | |
28080 | + pci_write_config_byte(dev, 0xB1, 0x72); | |
28081 | + pci_write_config_word(dev, 0xB2, 0x328A); | |
28082 | pci_write_config_dword(dev, 0xB4, 0x62DD62DD); | |
28083 | pci_write_config_dword(dev, 0xB8, 0x43924392); | |
28084 | pci_write_config_dword(dev, 0xBC, 0x40094009); | |
28085 | ||
28086 | - pci_read_config_byte(dev, 0x8A, &tmpbyte); | |
28087 | - proc_reports_siimage(dev, (tmpbyte>>=4), name); | |
28088 | + proc_reports_siimage(dev, (tmpbyte>>4), name); | |
28089 | return 0; | |
28090 | } | |
28091 | ||
28092 | +/** | |
28093 | + * init_mmio_iops_siimage - set up the iops for MMIO | |
28094 | + * @hwif: interface to set up | |
28095 | + * | |
28096 | + * The basic setup here is fairly simple, we can use standard MMIO | |
28097 | + * operations. However we do have to set the taskfile register offsets | |
28098 | + * by hand as there isnt a standard defined layout for them this | |
28099 | + * time. | |
28100 | + * | |
28101 | + * The hardware supports buffered taskfiles and also some rather nice | |
28102 | + * extended PRD tables. Unfortunately right now we don't. | |
28103 | + */ | |
28104 | + | |
28105 | static void __init init_mmio_iops_siimage (ide_hwif_t *hwif) | |
28106 | { | |
28107 | struct pci_dev *dev = hwif->pci_dev; | |
28108 | - unsigned long addr = (unsigned long) pci_get_drvdata(hwif->pci_dev); | |
28109 | + void *addr = pci_get_drvdata(dev); | |
28110 | u8 ch = hwif->channel; | |
28111 | -// u16 i = 0; | |
28112 | - hw_regs_t hw; | |
28113 | + hw_regs_t hw; | |
28114 | + unsigned long base; | |
28115 | + | |
28116 | + /* | |
28117 | + * Fill in the basic HWIF bits | |
28118 | + */ | |
28119 | ||
28120 | default_hwif_mmiops(hwif); | |
28121 | + hwif->hwif_data = addr; | |
28122 | + | |
28123 | + /* | |
28124 | + * Now set up the hw. We have to do this ourselves as | |
28125 | + * the MMIO layout isnt the same as the the standard port | |
28126 | + * based I/O | |
28127 | + */ | |
28128 | + | |
28129 | memset(&hw, 0, sizeof(hw_regs_t)); | |
28130 | + hw.priv = addr; | |
28131 | ||
28132 | -#if 1 | |
28133 | -#ifdef SIIMAGE_BUFFERED_TASKFILE | |
28134 | - hw.io_ports[IDE_DATA_OFFSET] = DEVADDR((ch) ? 0xD0 : 0x90); | |
28135 | - hw.io_ports[IDE_ERROR_OFFSET] = DEVADDR((ch) ? 0xD1 : 0x91); | |
28136 | - hw.io_ports[IDE_NSECTOR_OFFSET] = DEVADDR((ch) ? 0xD2 : 0x92); | |
28137 | - hw.io_ports[IDE_SECTOR_OFFSET] = DEVADDR((ch) ? 0xD3 : 0x93); | |
28138 | - hw.io_ports[IDE_LCYL_OFFSET] = DEVADDR((ch) ? 0xD4 : 0x94); | |
28139 | - hw.io_ports[IDE_HCYL_OFFSET] = DEVADDR((ch) ? 0xD5 : 0x95); | |
28140 | - hw.io_ports[IDE_SELECT_OFFSET] = DEVADDR((ch) ? 0xD6 : 0x96); | |
28141 | - hw.io_ports[IDE_STATUS_OFFSET] = DEVADDR((ch) ? 0xD7 : 0x97); | |
28142 | - hw.io_ports[IDE_CONTROL_OFFSET] = DEVADDR((ch) ? 0xDA : 0x9A); | |
28143 | -#else /* ! SIIMAGE_BUFFERED_TASKFILE */ | |
28144 | - hw.io_ports[IDE_DATA_OFFSET] = DEVADDR((ch) ? 0xC0 : 0x80); | |
28145 | - hw.io_ports[IDE_ERROR_OFFSET] = DEVADDR((ch) ? 0xC1 : 0x81); | |
28146 | - hw.io_ports[IDE_NSECTOR_OFFSET] = DEVADDR((ch) ? 0xC2 : 0x82); | |
28147 | - hw.io_ports[IDE_SECTOR_OFFSET] = DEVADDR((ch) ? 0xC3 : 0x83); | |
28148 | - hw.io_ports[IDE_LCYL_OFFSET] = DEVADDR((ch) ? 0xC4 : 0x84); | |
28149 | - hw.io_ports[IDE_HCYL_OFFSET] = DEVADDR((ch) ? 0xC5 : 0x85); | |
28150 | - hw.io_ports[IDE_SELECT_OFFSET] = DEVADDR((ch) ? 0xC6 : 0x86); | |
28151 | - hw.io_ports[IDE_STATUS_OFFSET] = DEVADDR((ch) ? 0xC7 : 0x87); | |
28152 | - hw.io_ports[IDE_CONTROL_OFFSET] = DEVADDR((ch) ? 0xCA : 0x8A); | |
28153 | -#endif /* SIIMAGE_BUFFERED_TASKFILE */ | |
28154 | -#else | |
28155 | -#ifdef SIIMAGE_BUFFERED_TASKFILE | |
28156 | - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) | |
28157 | - hw.io_ports[i] = DEVADDR((ch) ? 0xD0 : 0x90)|(i); | |
28158 | - hw.io_ports[IDE_CONTROL_OFFSET] = DEVADDR((ch) ? 0xDA : 0x9A); | |
28159 | -#else /* ! SIIMAGE_BUFFERED_TASKFILE */ | |
28160 | - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) | |
28161 | - hw.io_ports[i] = DEVADDR((ch) ? 0xC0 : 0x80)|(i); | |
28162 | - hw.io_ports[IDE_CONTROL_OFFSET] = DEVADDR((ch) ? 0xCA : 0x8A); | |
28163 | -#endif /* SIIMAGE_BUFFERED_TASKFILE */ | |
28164 | -#endif | |
28165 | + base = (unsigned long)addr; | |
28166 | + if(ch) | |
28167 | + base += 0xC0; | |
28168 | + else | |
28169 | + base += 0x80; | |
28170 | ||
28171 | -#if 0 | |
28172 | - printk(KERN_DEBUG "%s: ", hwif->name); | |
28173 | - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) | |
28174 | - printk("0x%08x ", DEVADDR((ch) ? 0xC0 : 0x80)|(i)); | |
28175 | - printk("0x%08x ", DEVADDR((ch) ? 0xCA : 0x8A)|(i)); | |
28176 | -#endif | |
28177 | + /* | |
28178 | + * The buffered task file doesn't have status/control | |
28179 | + * so we can't currently use it sanely since we want to | |
28180 | + * use LBA48 mode. | |
28181 | + */ | |
28182 | +// base += 0x10; | |
28183 | +// hwif->no_lba48 = 1; | |
28184 | + | |
28185 | + hw.io_ports[IDE_DATA_OFFSET] = base; | |
28186 | + hw.io_ports[IDE_ERROR_OFFSET] = base + 1; | |
28187 | + hw.io_ports[IDE_NSECTOR_OFFSET] = base + 2; | |
28188 | + hw.io_ports[IDE_SECTOR_OFFSET] = base + 3; | |
28189 | + hw.io_ports[IDE_LCYL_OFFSET] = base + 4; | |
28190 | + hw.io_ports[IDE_HCYL_OFFSET] = base + 5; | |
28191 | + hw.io_ports[IDE_SELECT_OFFSET] = base + 6; | |
28192 | + hw.io_ports[IDE_STATUS_OFFSET] = base + 7; | |
28193 | + hw.io_ports[IDE_CONTROL_OFFSET] = base + 10; | |
28194 | ||
28195 | hw.io_ports[IDE_IRQ_OFFSET] = 0; | |
28196 | ||
28197 | - if (dev->device == PCI_DEVICE_ID_SII_3112) { | |
28198 | - hw.sata_scr[SATA_STATUS_OFFSET] = DEVADDR((ch) ? 0x184 : 0x104); | |
28199 | - hw.sata_scr[SATA_ERROR_OFFSET] = DEVADDR((ch) ? 0x188 : 0x108); | |
28200 | - hw.sata_scr[SATA_CONTROL_OFFSET]= DEVADDR((ch) ? 0x180 : 0x100); | |
28201 | - hw.sata_misc[SATA_MISC_OFFSET] = DEVADDR((ch) ? 0x1C0 : 0x140); | |
28202 | - hw.sata_misc[SATA_PHY_OFFSET] = DEVADDR((ch) ? 0x1C4 : 0x144); | |
28203 | - hw.sata_misc[SATA_IEN_OFFSET] = DEVADDR((ch) ? 0x1C8 : 0x148); | |
28204 | + if (pdev_is_sata(dev)) { | |
28205 | + base = (unsigned long) addr; | |
28206 | + if(ch) | |
28207 | + base += 0x80; | |
28208 | + hw.sata_scr[SATA_STATUS_OFFSET] = base + 0x104; | |
28209 | + hw.sata_scr[SATA_ERROR_OFFSET] = base + 0x108; | |
28210 | + hw.sata_scr[SATA_CONTROL_OFFSET]= base + 0x100; | |
28211 | + hw.sata_misc[SATA_MISC_OFFSET] = base + 0x140; | |
28212 | + hw.sata_misc[SATA_PHY_OFFSET] = base + 0x144; | |
28213 | + hw.sata_misc[SATA_IEN_OFFSET] = base + 0x148; | |
28214 | } | |
28215 | ||
28216 | - hw.priv = (void *) addr; | |
28217 | -// hw.priv = pci_get_drvdata(hwif->pci_dev); | |
28218 | hw.irq = hwif->pci_dev->irq; | |
28219 | ||
28220 | memcpy(&hwif->hw, &hw, sizeof(hw)); | |
28221 | memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports)); | |
28222 | ||
28223 | - if (hwif->pci_dev->device == PCI_DEVICE_ID_SII_3112) { | |
28224 | + if (is_sata(hwif)) { | |
28225 | memcpy(hwif->sata_scr, hwif->hw.sata_scr, sizeof(hwif->hw.sata_scr)); | |
28226 | memcpy(hwif->sata_misc, hwif->hw.sata_misc, sizeof(hwif->hw.sata_misc)); | |
28227 | } | |
28228 | ||
28229 | -#ifdef SIIMAGE_BUFFERED_TASKFILE | |
28230 | - hwif->no_lba48 = 1; | |
28231 | -#endif /* SIIMAGE_BUFFERED_TASKFILE */ | |
28232 | hwif->irq = hw.irq; | |
28233 | - hwif->hwif_data = pci_get_drvdata(hwif->pci_dev); | |
28234 | + | |
28235 | + base = (unsigned long) addr; | |
28236 | ||
28237 | #ifdef SIIMAGE_LARGE_DMA | |
28238 | - hwif->dma_base = DEVADDR((ch) ? 0x18 : 0x10); | |
28239 | - hwif->dma_base2 = DEVADDR((ch) ? 0x08 : 0x00); | |
28240 | - hwif->dma_prdtable = (hwif->dma_base2 + 4); | |
28241 | +/* Watch the brackets - even Ken and Dennis get some language design wrong */ | |
28242 | + hwif->dma_base = base + (ch ? 0x18 : 0x10); | |
28243 | + hwif->dma_base2 = base + (ch ? 0x08 : 0x00); | |
28244 | + hwif->dma_prdtable = hwif->dma_base2 + 4; | |
28245 | #else /* ! SIIMAGE_LARGE_DMA */ | |
28246 | - hwif->dma_base = DEVADDR((ch) ? 0x08 : 0x00); | |
28247 | - hwif->dma_base2 = DEVADDR((ch) ? 0x18 : 0x10); | |
28248 | + hwif->dma_base = base + (ch ? 0x08 : 0x00); | |
28249 | + hwif->dma_base2 = base + (ch ? 0x18 : 0x10); | |
28250 | #endif /* SIIMAGE_LARGE_DMA */ | |
28251 | - hwif->mmio = 1; | |
28252 | + hwif->mmio = 2; | |
28253 | } | |
28254 | ||
28255 | +/** | |
28256 | + * init_iops_siimage - set up iops | |
28257 | + * @hwif: interface to set up | |
28258 | + * | |
28259 | + * Do the basic setup for the SIIMAGE hardware interface | |
28260 | + * and then do the MMIO setup if we can. This is the first | |
28261 | + * look in we get for setting up the hwif so that we | |
28262 | + * can get the iops right before using them. | |
28263 | + */ | |
28264 | + | |
28265 | static void __init init_iops_siimage (ide_hwif_t *hwif) | |
28266 | { | |
28267 | struct pci_dev *dev = hwif->pci_dev; | |
28268 | @@ -747,37 +1061,60 @@ | |
28269 | ||
28270 | pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); | |
28271 | class_rev &= 0xff; | |
28272 | + | |
28273 | + hwif->hwif_data = 0; | |
28274 | ||
28275 | hwif->rqsize = 128; | |
28276 | - if ((dev->device == PCI_DEVICE_ID_SII_3112) && (!(class_rev))) | |
28277 | - hwif->rqsize = 16; | |
28278 | + if (is_sata(hwif)) | |
28279 | + hwif->rqsize = 15; | |
28280 | ||
28281 | if (pci_get_drvdata(dev) == NULL) | |
28282 | return; | |
28283 | init_mmio_iops_siimage(hwif); | |
28284 | } | |
28285 | ||
28286 | +/** | |
28287 | + * ata66_siimage - check for 80 pin cable | |
28288 | + * @hwif: interface to check | |
28289 | + * | |
28290 | + * Check for the presence of an ATA66 capable cable on the | |
28291 | + * interface. | |
28292 | + */ | |
28293 | + | |
28294 | static unsigned int __init ata66_siimage (ide_hwif_t *hwif) | |
28295 | { | |
28296 | + unsigned long addr = siimage_selreg(hwif, 0); | |
28297 | if (pci_get_drvdata(hwif->pci_dev) == NULL) { | |
28298 | u8 ata66 = 0; | |
28299 | - pci_read_config_byte(hwif->pci_dev, SELREG(0), &ata66); | |
28300 | + pci_read_config_byte(hwif->pci_dev, addr, &ata66); | |
28301 | return (ata66 & 0x01) ? 1 : 0; | |
28302 | } | |
28303 | ||
28304 | - return (hwif->INB(SELADDR(0)) & 0x01) ? 1 : 0; | |
28305 | + return (hwif->INB(addr) & 0x01) ? 1 : 0; | |
28306 | } | |
28307 | ||
28308 | +/** | |
28309 | + * init_hwif_siimage - set up hwif structs | |
28310 | + * @hwif: interface to set up | |
28311 | + * | |
28312 | + * We do the basic set up of the interface structure. The SIIMAGE | |
28313 | + * requires several custom handlers so we override the default | |
28314 | + * ide DMA handlers appropriately | |
28315 | + */ | |
28316 | + | |
28317 | static void __init init_hwif_siimage (ide_hwif_t *hwif) | |
28318 | { | |
28319 | hwif->autodma = 0; | |
28320 | - hwif->busproc = &siimage_busproc; | |
28321 | + | |
28322 | hwif->resetproc = &siimage_reset; | |
28323 | hwif->speedproc = &siimage_tune_chipset; | |
28324 | hwif->tuneproc = &siimage_tuneproc; | |
28325 | hwif->reset_poll = &siimage_reset_poll; | |
28326 | hwif->pre_reset = &siimage_pre_reset; | |
28327 | ||
28328 | + if(is_sata(hwif)) | |
28329 | + hwif->busproc = &siimage_busproc; | |
28330 | + | |
28331 | if (!hwif->dma_base) { | |
28332 | hwif->drives[0].autotune = 1; | |
28333 | hwif->drives[1].autotune = 1; | |
28334 | @@ -788,7 +1125,7 @@ | |
28335 | hwif->mwdma_mask = 0x07; | |
28336 | hwif->swdma_mask = 0x07; | |
28337 | ||
28338 | - if (hwif->pci_dev->device != PCI_DEVICE_ID_SII_3112) | |
28339 | + if (!is_sata(hwif)) | |
28340 | hwif->atapi_dma = 1; | |
28341 | ||
28342 | hwif->ide_dma_check = &siimage_config_drive_for_dma; | |
28343 | @@ -802,12 +1139,26 @@ | |
28344 | } else { | |
28345 | hwif->ide_dma_test_irq = & siimage_io_ide_dma_test_irq; | |
28346 | } | |
28347 | - if (!noautodma) | |
28348 | - hwif->autodma = 1; | |
28349 | + | |
28350 | + /* | |
28351 | + * The BIOS often doesn't set up DMA on this controller | |
28352 | + * so we always do it. | |
28353 | + */ | |
28354 | + | |
28355 | + hwif->autodma = 1; | |
28356 | hwif->drives[0].autodma = hwif->autodma; | |
28357 | hwif->drives[1].autodma = hwif->autodma; | |
28358 | } | |
28359 | ||
28360 | +/** | |
28361 | + * init_dma_siimage - set up IDE DMA | |
28362 | + * @hwif: interface | |
28363 | + * @dmabase: DMA base address to use | |
28364 | + * | |
28365 | + * For the SI chips this requires no special set up so we can just | |
28366 | + * let the IDE DMA core do the usual work. | |
28367 | + */ | |
28368 | + | |
28369 | static void __init init_dma_siimage (ide_hwif_t *hwif, unsigned long dmabase) | |
28370 | { | |
28371 | ide_setup_dma(hwif, dmabase, 8); | |
28372 | @@ -816,6 +1167,15 @@ | |
28373 | extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); | |
28374 | ||
28375 | ||
28376 | +/** | |
28377 | + * siimage_init_one - pci layer discovery entry | |
28378 | + * @dev: PCI device | |
28379 | + * @id: ident table entry | |
28380 | + * | |
28381 | + * Called by the PCI code when it finds an SI680 or SI3112 controller. | |
28382 | + * We then use the IDE PCI generic helper to do most of the work. | |
28383 | + */ | |
28384 | + | |
28385 | static int __devinit siimage_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |
28386 | { | |
28387 | ide_pci_device_t *d = &siimage_chipsets[id->driver_data]; | |
28388 | @@ -829,6 +1189,7 @@ | |
28389 | static struct pci_device_id siimage_pci_tbl[] = { | |
28390 | { PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | |
28391 | { PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, | |
28392 | + { PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_1210SA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, | |
28393 | { 0, }, | |
28394 | }; | |
28395 | ||
28396 | @@ -851,6 +1212,6 @@ | |
28397 | module_init(siimage_ide_init); | |
28398 | module_exit(siimage_ide_exit); | |
28399 | ||
28400 | -MODULE_AUTHOR("Andre Hedrick"); | |
28401 | +MODULE_AUTHOR("Andre Hedrick, Alan Cox"); | |
28402 | MODULE_DESCRIPTION("PCI driver module for SiI IDE"); | |
28403 | MODULE_LICENSE("GPL"); | |
28404 | diff -Nru a/drivers/ide/pci/siimage.h b/drivers/ide/pci/siimage.h | |
28405 | --- a/drivers/ide/pci/siimage.h Mon Feb 17 11:01:34 2003 | |
28406 | +++ b/drivers/ide/pci/siimage.h Mon Sep 1 15:53:57 2003 | |
28407 | @@ -13,12 +13,6 @@ | |
28408 | #undef SIIMAGE_BUFFERED_TASKFILE | |
28409 | #undef SIIMAGE_LARGE_DMA | |
28410 | ||
28411 | -#if 0 | |
28412 | -typedef struct ide_io_ops_s siimage_iops { | |
28413 | - | |
28414 | -} | |
28415 | -#endif | |
28416 | - | |
28417 | #define SII_DEBUG 0 | |
28418 | ||
28419 | #if SII_DEBUG | |
28420 | @@ -27,12 +21,6 @@ | |
28421 | #define siiprintk(x...) | |
28422 | #endif | |
28423 | ||
28424 | -#define ADJREG(B,R) ((B)|(R)|((hwif->channel)<<(4+(2*(hwif->mmio))))) | |
28425 | -#define SELREG(R) ADJREG((0xA0),(R)) | |
28426 | -#define SELADDR(R) ((((unsigned long)hwif->hwif_data)*(hwif->mmio))|SELREG((R))) | |
28427 | -#define HWIFADDR(R) ((((unsigned long)hwif->hwif_data)*(hwif->mmio))|(R)) | |
28428 | -#define DEVADDR(R) (((unsigned long) pci_get_drvdata(dev))|(R)) | |
28429 | - | |
28430 | ||
28431 | #if defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS) | |
28432 | #include <linux/stat.h> | |
28433 | @@ -76,6 +64,19 @@ | |
28434 | .vendor = PCI_VENDOR_ID_CMD, | |
28435 | .device = PCI_DEVICE_ID_SII_3112, | |
28436 | .name = "SiI3112 Serial ATA", | |
28437 | + .init_chipset = init_chipset_siimage, | |
28438 | + .init_iops = init_iops_siimage, | |
28439 | + .init_hwif = init_hwif_siimage, | |
28440 | + .init_dma = init_dma_siimage, | |
28441 | + .channels = 2, | |
28442 | + .autodma = AUTODMA, | |
28443 | + .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, | |
28444 | + .bootable = ON_BOARD, | |
28445 | + .extra = 0, | |
28446 | + },{ /* 2 */ | |
28447 | + .vendor = PCI_VENDOR_ID_CMD, | |
28448 | + .device = PCI_DEVICE_ID_SII_1210SA, | |
28449 | + .name = "Adaptec AAR-1210SA", | |
28450 | .init_chipset = init_chipset_siimage, | |
28451 | .init_iops = init_iops_siimage, | |
28452 | .init_hwif = init_hwif_siimage, | |
28453 | diff -Nru a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c | |
28454 | --- a/drivers/ide/pci/sis5513.c Thu Jul 31 08:58:49 2003 | |
28455 | +++ b/drivers/ide/pci/sis5513.c Sun Aug 24 15:33:30 2003 | |
28456 | @@ -63,7 +63,6 @@ | |
28457 | #include <asm/irq.h> | |
28458 | ||
28459 | #include "ide-timing.h" | |
28460 | -#include "ide_modes.h" | |
28461 | #include "sis5513.h" | |
28462 | ||
28463 | /* registers layout and init values are chipset family dependant */ | |
28464 | diff -Nru a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c | |
28465 | --- a/drivers/ide/pci/sl82c105.c Thu Jul 31 08:58:49 2003 | |
28466 | +++ b/drivers/ide/pci/sl82c105.c Sun Aug 24 15:33:30 2003 | |
28467 | @@ -29,7 +29,6 @@ | |
28468 | #include <asm/io.h> | |
28469 | #include <asm/dma.h> | |
28470 | ||
28471 | -#include "ide_modes.h" | |
28472 | #include "sl82c105.h" | |
28473 | ||
28474 | #undef DEBUG | |
28475 | diff -Nru a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c | |
28476 | --- a/drivers/ide/pci/slc90e66.c Thu Jul 31 08:58:49 2003 | |
28477 | +++ b/drivers/ide/pci/slc90e66.c Sun Aug 24 15:33:30 2003 | |
28478 | @@ -21,7 +21,6 @@ | |
28479 | ||
28480 | #include <asm/io.h> | |
28481 | ||
28482 | -#include "ide_modes.h" | |
28483 | #include "slc90e66.h" | |
28484 | ||
28485 | #if defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) | |
28486 | diff -Nru a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c | |
28487 | --- a/drivers/ide/pci/triflex.c Sat Feb 22 15:52:14 2003 | |
28488 | +++ b/drivers/ide/pci/triflex.c Sun Aug 24 15:33:30 2003 | |
28489 | @@ -41,7 +41,6 @@ | |
28490 | #include <linux/ide.h> | |
28491 | #include <linux/init.h> | |
28492 | ||
28493 | -#include "ide_modes.h" | |
28494 | #include "triflex.h" | |
28495 | ||
28496 | static struct pci_dev *triflex_dev; | |
28497 | diff -Nru a/drivers/ide/ppc/mpc8xx.c b/drivers/ide/ppc/mpc8xx.c | |
28498 | --- a/drivers/ide/ppc/mpc8xx.c Fri May 2 10:53:08 2003 | |
28499 | +++ b/drivers/ide/ppc/mpc8xx.c Sun Aug 24 15:33:30 2003 | |
28500 | @@ -42,7 +42,6 @@ | |
28501 | #include <asm/machdep.h> | |
28502 | #include <asm/irq.h> | |
28503 | ||
28504 | -#include "ide_modes.h" | |
28505 | static int identify (volatile u8 *p); | |
28506 | static void print_fixed (volatile u8 *p); | |
28507 | static void print_funcid (int func); | |
28508 | diff -Nru a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c | |
28509 | --- a/drivers/ide/ppc/pmac.c Sat Aug 16 11:46:50 2003 | |
28510 | +++ b/drivers/ide/ppc/pmac.c Sun Aug 31 14:09:16 2003 | |
28511 | @@ -5,7 +5,7 @@ | |
28512 | * These IDE interfaces are memory-mapped and have a DBDMA channel | |
28513 | * for doing DMA. | |
28514 | * | |
28515 | - * Copyright (C) 1998-2001 Paul Mackerras & Ben. Herrenschmidt | |
28516 | + * Copyright (C) 1998-2003 Paul Mackerras & Ben. Herrenschmidt | |
28517 | * | |
28518 | * This program is free software; you can redistribute it and/or | |
28519 | * modify it under the terms of the GNU General Public License | |
28520 | @@ -16,6 +16,11 @@ | |
28521 | * | |
28522 | * Copyright (c) 1995-1998 Mark Lord | |
28523 | * | |
28524 | + * TODO: - Use pre-calculated (kauai) timing tables all the time and | |
28525 | + * get rid of the "rounded" tables used previously, so we have the | |
28526 | + * same table format for all controllers and can then just have one | |
28527 | + * big table | |
28528 | + * | |
28529 | */ | |
28530 | #include <linux/config.h> | |
28531 | #include <linux/types.h> | |
28532 | @@ -27,6 +32,8 @@ | |
28533 | #include <linux/notifier.h> | |
28534 | #include <linux/reboot.h> | |
28535 | #include <linux/pci.h> | |
28536 | +#include <linux/adb.h> | |
28537 | +#include <linux/pmu.h> | |
28538 | ||
28539 | #include <asm/prom.h> | |
28540 | #include <asm/io.h> | |
28541 | @@ -38,26 +45,27 @@ | |
28542 | #include <asm/pmac_feature.h> | |
28543 | #include <asm/sections.h> | |
28544 | #include <asm/irq.h> | |
28545 | -#ifdef CONFIG_PMAC_PBOOK | |
28546 | -#include <linux/adb.h> | |
28547 | -#include <linux/pmu.h> | |
28548 | -#endif | |
28549 | -#include "ide_modes.h" | |
28550 | + | |
28551 | +#include "ide-timing.h" | |
28552 | ||
28553 | extern void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq); | |
28554 | ||
28555 | #define IDE_PMAC_DEBUG | |
28556 | ||
28557 | -#define DMA_WAIT_TIMEOUT 500 | |
28558 | +#define DMA_WAIT_TIMEOUT 100 | |
28559 | ||
28560 | typedef struct pmac_ide_hwif { | |
28561 | unsigned long regbase; | |
28562 | int irq; | |
28563 | int kind; | |
28564 | int aapl_bus_id; | |
28565 | + int cable_80 : 1; | |
28566 | + int mediabay : 1; | |
28567 | + int broken_dma : 1; | |
28568 | + int broken_dma_warn : 1; | |
28569 | struct device_node* node; | |
28570 | - u32 timings[2]; | |
28571 | - int index; | |
28572 | + struct macio_dev *mdev; | |
28573 | + u32 timings[4]; | |
28574 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC | |
28575 | /* Those fields are duplicating what is in hwif. We currently | |
28576 | * can't use the hwif ones because of some assumptions that are | |
28577 | @@ -82,7 +90,15 @@ | |
28578 | controller_heathrow, /* Heathrow/Paddington */ | |
28579 | controller_kl_ata3, /* KeyLargo ATA-3 */ | |
28580 | controller_kl_ata4, /* KeyLargo ATA-4 */ | |
28581 | - controller_kl_ata4_80 /* KeyLargo ATA-4 with 80 conductor cable */ | |
28582 | + controller_un_ata6 /* UniNorth2 ATA-6 */ | |
28583 | +}; | |
28584 | + | |
28585 | +static const char* model_name[] = { | |
28586 | + "OHare ATA", /* OHare based */ | |
28587 | + "Heathrow ATA", /* Heathrow/Paddington */ | |
28588 | + "KeyLargo ATA-3", /* KeyLargo ATA-3 */ | |
28589 | + "KeyLargo ATA-4", /* KeyLargo ATA-4 */ | |
28590 | + "UniNorth ATA-6" /* UniNorth2 ATA-6 */ | |
28591 | }; | |
28592 | ||
28593 | /* | |
28594 | @@ -91,6 +107,11 @@ | |
28595 | #define IDE_TIMING_CONFIG 0x200 | |
28596 | #define IDE_INTERRUPT 0x300 | |
28597 | ||
28598 | +/* Kauai (U2) ATA has different register setup */ | |
28599 | +#define IDE_KAUAI_PIO_CONFIG 0x200 | |
28600 | +#define IDE_KAUAI_ULTRA_CONFIG 0x210 | |
28601 | +#define IDE_KAUAI_POLL_CONFIG 0x220 | |
28602 | + | |
28603 | /* | |
28604 | * Timing configuration register definitions | |
28605 | */ | |
28606 | @@ -101,6 +122,28 @@ | |
28607 | #define IDE_SYSCLK_NS 30 /* 33Mhz cell */ | |
28608 | #define IDE_SYSCLK_66_NS 15 /* 66Mhz cell */ | |
28609 | ||
28610 | +/* 100Mhz cell, found in Uninorth 2. I don't have much infos about | |
28611 | + * this one yet, it appears as a pci device (106b/0033) on uninorth | |
28612 | + * internal PCI bus and it's clock is controlled like gem or fw. It | |
28613 | + * appears to be an evolution of keylargo ATA4 with a timing register | |
28614 | + * extended to 2 32bits registers and a similar DBDMA channel. Other | |
28615 | + * registers seem to exist but I can't tell much about them. | |
28616 | + * | |
28617 | + * So far, I'm using pre-calculated tables for this extracted from | |
28618 | + * the values used by the MacOS X driver. | |
28619 | + * | |
28620 | + * The "PIO" register controls PIO and MDMA timings, the "ULTRA" | |
28621 | + * register controls the UDMA timings. At least, it seems bit 0 | |
28622 | + * of this one enables UDMA vs. MDMA, and bits 4..7 are the | |
28623 | + * cycle time in units of 10ns. Bits 8..15 are used by I don't | |
28624 | + * know their meaning yet | |
28625 | + */ | |
28626 | +#define TR_100_PIOREG_PIO_MASK 0xff000fff | |
28627 | +#define TR_100_PIOREG_MDMA_MASK 0x00fff000 | |
28628 | +#define TR_100_UDMAREG_UDMA_MASK 0x0000ffff | |
28629 | +#define TR_100_UDMAREG_UDMA_EN 0x00000001 | |
28630 | + | |
28631 | + | |
28632 | /* 66Mhz cell, found in KeyLargo. Can do ultra mode 0 to 2 on | |
28633 | * 40 connector cable and to 4 on 80 connector one. | |
28634 | * Clock unit is 15ns (66Mhz) | |
28635 | @@ -115,8 +158,7 @@ | |
28636 | * well, despite a comment that would lead to think it has a | |
28637 | * min value of 45ns. | |
28638 | * Apple also add 60ns to the write data setup (or cycle time ?) on | |
28639 | - * reads. I can't explain that, I tried it and it broke everything | |
28640 | - * here. | |
28641 | + * reads. | |
28642 | */ | |
28643 | #define TR_66_UDMA_MASK 0xfff00000 | |
28644 | #define TR_66_UDMA_EN 0x00100000 /* Enable Ultra mode for DMA */ | |
28645 | @@ -220,12 +262,12 @@ | |
28646 | { 0, 0, 0 } | |
28647 | }; | |
28648 | ||
28649 | -/* Ultra DMA timings (rounded) */ | |
28650 | +/* KeyLargo ATA-4 Ultra DMA timings (rounded) */ | |
28651 | struct { | |
28652 | int addrSetup; /* ??? */ | |
28653 | int rdy2pause; | |
28654 | int wrDataSetup; | |
28655 | -} udma_timings[] __pmacdata = | |
28656 | +} kl66_udma_timings[] __pmacdata = | |
28657 | { | |
28658 | { 0, 180, 120 }, /* Mode 0 */ | |
28659 | { 0, 150, 90 }, /* 1 */ | |
28660 | @@ -234,6 +276,63 @@ | |
28661 | { 0, 90, 30 } /* 4 */ | |
28662 | }; | |
28663 | ||
28664 | +/* UniNorth 2 ATA/100 timings */ | |
28665 | +struct kauai_timing { | |
28666 | + int cycle_time; | |
28667 | + u32 timing_reg; | |
28668 | +}; | |
28669 | + | |
28670 | +static struct kauai_timing kauai_pio_timings[] __pmacdata = | |
28671 | +{ | |
28672 | + { 930 , 0x08000fff }, | |
28673 | + { 600 , 0x08000a92 }, | |
28674 | + { 383 , 0x0800060f }, | |
28675 | + { 360 , 0x08000492 }, | |
28676 | + { 330 , 0x0800048f }, | |
28677 | + { 300 , 0x080003cf }, | |
28678 | + { 270 , 0x080003cc }, | |
28679 | + { 240 , 0x0800038b }, | |
28680 | + { 239 , 0x0800030c }, | |
28681 | + { 180 , 0x05000249 }, | |
28682 | + { 120 , 0x04000148 } | |
28683 | +}; | |
28684 | + | |
28685 | +static struct kauai_timing kauai_mdma_timings[] __pmacdata = | |
28686 | +{ | |
28687 | + { 1260 , 0x00fff000 }, | |
28688 | + { 480 , 0x00618000 }, | |
28689 | + { 360 , 0x00492000 }, | |
28690 | + { 270 , 0x0038e000 }, | |
28691 | + { 240 , 0x0030c000 }, | |
28692 | + { 210 , 0x002cb000 }, | |
28693 | + { 180 , 0x00249000 }, | |
28694 | + { 150 , 0x00209000 }, | |
28695 | + { 120 , 0x00148000 }, | |
28696 | + { 0 , 0 }, | |
28697 | +}; | |
28698 | + | |
28699 | +static struct kauai_timing kauai_udma_timings[] __pmacdata = | |
28700 | +{ | |
28701 | + { 120 , 0x000070c0 }, | |
28702 | + { 90 , 0x00005d80 }, | |
28703 | + { 60 , 0x00004a60 }, | |
28704 | + { 45 , 0x00003a50 }, | |
28705 | + { 30 , 0x00002a30 }, | |
28706 | + { 20 , 0x00002921 }, | |
28707 | + { 0 , 0 }, | |
28708 | +}; | |
28709 | + | |
28710 | +static inline u32 | |
28711 | +kauai_lookup_timing(struct kauai_timing* table, int cycle_time) | |
28712 | +{ | |
28713 | + int i; | |
28714 | + | |
28715 | + for (i=0; table[i].cycle_time; i++) | |
28716 | + if (cycle_time > table[i+1].cycle_time) | |
28717 | + return table[i].timing_reg; | |
28718 | + return 0; | |
28719 | +} | |
28720 | + | |
28721 | /* allow up to 256 DBDMA commands per xfer */ | |
28722 | #define MAX_DCMDS 256 | |
28723 | ||
28724 | @@ -242,24 +341,106 @@ | |
28725 | * NOTE: There is at least one case I know of a disk that needs about 10sec | |
28726 | * before anwering on the bus. I beleive we could add a kernel command | |
28727 | * line arg to override this delay for such cases. | |
28728 | + * | |
28729 | + * NOTE2: This has to be fixed with a BSY wait loop. I'm working on adding | |
28730 | + * that to the generic probe code. | |
28731 | */ | |
28732 | #define IDE_WAKEUP_DELAY_MS 2000 | |
28733 | ||
28734 | -static void pmac_ide_setup_dma(struct device_node *np, int ix); | |
28735 | -static int pmac_ide_build_dmatable(ide_drive_t *drive, int wr); | |
28736 | +static void pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif); | |
28737 | +static int pmac_ide_build_dmatable(ide_drive_t *drive, struct request *rq); | |
28738 | static int pmac_ide_tune_chipset(ide_drive_t *drive, u8 speed); | |
28739 | static void pmac_ide_tuneproc(ide_drive_t *drive, u8 pio); | |
28740 | static void pmac_ide_selectproc(ide_drive_t *drive); | |
28741 | +static void pmac_ide_kauai_selectproc(ide_drive_t *drive); | |
28742 | static int pmac_ide_dma_begin (ide_drive_t *drive); | |
28743 | ||
28744 | #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ | |
28745 | ||
28746 | -#ifdef CONFIG_PMAC_PBOOK | |
28747 | -static int idepmac_notify_sleep(struct pmu_sleep_notifier *self, int when); | |
28748 | -struct pmu_sleep_notifier idepmac_sleep_notifier = { | |
28749 | - idepmac_notify_sleep, SLEEP_LEVEL_BLOCK, | |
28750 | -}; | |
28751 | -#endif /* CONFIG_PMAC_PBOOK */ | |
28752 | +#ifdef CONFIG_BLK_DEV_IDE_PMAC_BLINK | |
28753 | + | |
28754 | +/* Set to 50ms */ | |
28755 | +#define PMU_HD_BLINK_TIME (HZ/50) | |
28756 | + | |
28757 | +static struct adb_request pmu_blink_on, pmu_blink_off; | |
28758 | +static spinlock_t pmu_blink_lock; | |
28759 | +static unsigned long pmu_blink_stoptime; | |
28760 | +static int pmu_blink_ledstate; | |
28761 | +static struct timer_list pmu_blink_timer; | |
28762 | +static int pmu_ide_blink_enabled; | |
28763 | + | |
28764 | + | |
28765 | +static void | |
28766 | +pmu_hd_blink_timeout(unsigned long data) | |
28767 | +{ | |
28768 | + unsigned long flags; | |
28769 | + | |
28770 | + spin_lock_irqsave(&pmu_blink_lock, flags); | |
28771 | + | |
28772 | + /* We may have been triggered again in a racy way, check | |
28773 | + * that we really want to switch it off | |
28774 | + */ | |
28775 | + if (time_after(pmu_blink_stoptime, jiffies)) | |
28776 | + goto done; | |
28777 | + | |
28778 | + /* Previous req. not complete, try 100ms more */ | |
28779 | + if (pmu_blink_off.complete == 0) | |
28780 | + mod_timer(&pmu_blink_timer, jiffies + PMU_HD_BLINK_TIME); | |
28781 | + else if (pmu_blink_ledstate) { | |
28782 | + pmu_request(&pmu_blink_off, NULL, 4, 0xee, 4, 0, 0); | |
28783 | + pmu_blink_ledstate = 0; | |
28784 | + } | |
28785 | +done: | |
28786 | + spin_unlock_irqrestore(&pmu_blink_lock, flags); | |
28787 | +} | |
28788 | + | |
28789 | +static void | |
28790 | +pmu_hd_kick_blink(void *data, int rw) | |
28791 | +{ | |
28792 | + unsigned long flags; | |
28793 | + | |
28794 | + pmu_blink_stoptime = jiffies + PMU_HD_BLINK_TIME; | |
28795 | + wmb(); | |
28796 | + mod_timer(&pmu_blink_timer, pmu_blink_stoptime); | |
28797 | + if (pmu_blink_ledstate == 1) | |
28798 | + return; | |
28799 | + spin_lock_irqsave(&pmu_blink_lock, flags); | |
28800 | + if (pmu_blink_on.complete && !pmu_blink_ledstate) { | |
28801 | + pmu_request(&pmu_blink_on, NULL, 4, 0xee, 4, 0, 1); | |
28802 | + pmu_blink_ledstate = 1; | |
28803 | + } | |
28804 | + spin_unlock_irqrestore(&pmu_blink_lock, flags); | |
28805 | +} | |
28806 | + | |
28807 | +static int | |
28808 | +pmu_hd_blink_init(void) | |
28809 | +{ | |
28810 | + struct device_node *dt; | |
28811 | + const char *model; | |
28812 | + | |
28813 | + if (pmu_get_model() != PMU_KEYLARGO_BASED) | |
28814 | + return 0; | |
28815 | + | |
28816 | + dt = find_devices("device-tree"); | |
28817 | + if (dt == NULL) | |
28818 | + return 0; | |
28819 | + model = (const char *)get_property(dt, "model", NULL); | |
28820 | + if (model == NULL) | |
28821 | + return 0; | |
28822 | + if (strncmp(model, "PowerBook", strlen("PowerBook")) != 0 && | |
28823 | + strncmp(model, "iBook", strlen("iBook")) != 0) | |
28824 | + return 0; | |
28825 | + | |
28826 | + pmu_blink_on.complete = 1; | |
28827 | + pmu_blink_off.complete = 1; | |
28828 | + spin_lock_init(&pmu_blink_lock); | |
28829 | + init_timer(&pmu_blink_timer); | |
28830 | + pmu_blink_timer.function = pmu_hd_blink_timeout; | |
28831 | + | |
28832 | + return 1; | |
28833 | +} | |
28834 | + | |
28835 | +#endif /* CONFIG_BLK_DEV_IDE_PMAC_BLINK */ | |
28836 | ||
28837 | /* | |
28838 | * N.B. this can't be an initfunc, because the media-bay task can | |
28839 | @@ -315,6 +496,41 @@ | |
28840 | (void)readl((unsigned *)(IDE_DATA_REG+IDE_TIMING_CONFIG)); | |
28841 | } | |
28842 | ||
28843 | +static void __pmac | |
28844 | +pmac_ide_kauai_selectproc(ide_drive_t *drive) | |
28845 | +{ | |
28846 | + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; | |
28847 | + | |
28848 | + if (pmif == NULL) | |
28849 | + return; | |
28850 | + | |
28851 | + if (drive->select.b.unit & 0x01) { | |
28852 | + writel(pmif->timings[1], | |
28853 | + (unsigned *)(IDE_DATA_REG + IDE_KAUAI_PIO_CONFIG)); | |
28854 | + writel(pmif->timings[3], | |
28855 | + (unsigned *)(IDE_DATA_REG + IDE_KAUAI_ULTRA_CONFIG)); | |
28856 | + } else { | |
28857 | + writel(pmif->timings[0], | |
28858 | + (unsigned *)(IDE_DATA_REG + IDE_KAUAI_PIO_CONFIG)); | |
28859 | + writel(pmif->timings[2], | |
28860 | + (unsigned *)(IDE_DATA_REG + IDE_KAUAI_ULTRA_CONFIG)); | |
28861 | + } | |
28862 | + (void)readl((unsigned *)(IDE_DATA_REG + IDE_KAUAI_PIO_CONFIG)); | |
28863 | +} | |
28864 | + | |
28865 | +static void __pmac | |
28866 | +pmac_ide_do_update_timings(ide_drive_t *drive) | |
28867 | +{ | |
28868 | + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; | |
28869 | + | |
28870 | + if (pmif == NULL) | |
28871 | + return; | |
28872 | + | |
28873 | + if (pmif->kind == controller_un_ata6) | |
28874 | + pmac_ide_kauai_selectproc(drive); | |
28875 | + else | |
28876 | + pmac_ide_selectproc(drive); | |
28877 | +} | |
28878 | ||
28879 | static int __pmac | |
28880 | pmac_ide_do_setfeature(ide_drive_t *drive, u8 command) | |
28881 | @@ -322,7 +538,7 @@ | |
28882 | ide_hwif_t *hwif = HWIF(drive); | |
28883 | int result = 1; | |
28884 | ||
28885 | - disable_irq(hwif->irq); /* disable_irq_nosync ?? */ | |
28886 | + disable_irq_nosync(hwif->irq); | |
28887 | udelay(1); | |
28888 | SELECT_DRIVE(drive); | |
28889 | SELECT_MASK(drive, 0); | |
28890 | @@ -332,22 +548,22 @@ | |
28891 | /* Timeout bumped for some powerbooks */ | |
28892 | if (wait_for_ready(drive, 2000)) { | |
28893 | /* Timeout bumped for some powerbooks */ | |
28894 | - printk(KERN_ERR "pmac_ide_do_setfeature disk not ready " | |
28895 | - "before SET_FEATURE!\n"); | |
28896 | + printk(KERN_ERR "%s: pmac_ide_do_setfeature disk not ready " | |
28897 | + "before SET_FEATURE!\n", drive->name); | |
28898 | goto out; | |
28899 | } | |
28900 | udelay(10); | |
28901 | hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG); | |
28902 | hwif->OUTB(command, IDE_NSECTOR_REG); | |
28903 | hwif->OUTB(SETFEATURES_XFER, IDE_FEATURE_REG); | |
28904 | - hwif->OUTB(WIN_SETFEATURES, IDE_COMMAND_REG); | |
28905 | + hwif->OUTBSYNC(drive, WIN_SETFEATURES, IDE_COMMAND_REG); | |
28906 | udelay(1); | |
28907 | /* Timeout bumped for some powerbooks */ | |
28908 | result = wait_for_ready(drive, 2000); | |
28909 | hwif->OUTB(drive->ctl, IDE_CONTROL_REG); | |
28910 | if (result) | |
28911 | - printk(KERN_ERR "pmac_ide_do_setfeature disk not ready " | |
28912 | - "after SET_FEATURE !\n"); | |
28913 | + printk(KERN_ERR "%s: pmac_ide_do_setfeature disk not ready " | |
28914 | + "after SET_FEATURE !\n", drive->name); | |
28915 | out: | |
28916 | SELECT_MASK(drive, 0); | |
28917 | if (result == 0) { | |
28918 | @@ -403,21 +619,27 @@ | |
28919 | if (pmif == NULL) | |
28920 | return; | |
28921 | ||
28922 | + /* which drive is it ? */ | |
28923 | + timings = &pmif->timings[drive->select.b.unit & 0x01]; | |
28924 | + | |
28925 | pio = ide_get_best_pio_mode(drive, pio, 4, &d); | |
28926 | - accessTicks = SYSCLK_TICKS(ide_pio_timings[pio].active_time); | |
28927 | - if (drive->select.b.unit & 0x01) | |
28928 | - timings = &pmif->timings[1]; | |
28929 | - else | |
28930 | - timings = &pmif->timings[0]; | |
28931 | ||
28932 | - recTime = d.cycle_time - ide_pio_timings[pio].active_time | |
28933 | - - ide_pio_timings[pio].setup_time; | |
28934 | - recTime = max(recTime, 150U); | |
28935 | - accessTime = ide_pio_timings[pio].active_time; | |
28936 | - accessTime = max(accessTime, 150U); | |
28937 | - if (pmif->kind == controller_kl_ata4 || | |
28938 | - pmif->kind == controller_kl_ata4_80) { | |
28939 | + switch (pmif->kind) { | |
28940 | + case controller_un_ata6: { | |
28941 | + /* 100Mhz cell */ | |
28942 | + u32 tr = kauai_lookup_timing(kauai_pio_timings, d.cycle_time); | |
28943 | + if (tr == 0) | |
28944 | + return; | |
28945 | + *timings = ((*timings) & ~TR_100_PIOREG_PIO_MASK) | tr; | |
28946 | + break; | |
28947 | + } | |
28948 | + case controller_kl_ata4: | |
28949 | /* 66Mhz cell */ | |
28950 | + recTime = d.cycle_time - ide_pio_timings[pio].active_time | |
28951 | + - ide_pio_timings[pio].setup_time; | |
28952 | + recTime = max(recTime, 150U); | |
28953 | + accessTime = ide_pio_timings[pio].active_time; | |
28954 | + accessTime = max(accessTime, 150U); | |
28955 | accessTicks = SYSCLK_TICKS_66(accessTime); | |
28956 | accessTicks = min(accessTicks, 0x1fU); | |
28957 | recTicks = SYSCLK_TICKS_66(recTime); | |
28958 | @@ -425,9 +647,15 @@ | |
28959 | *timings = ((*timings) & ~TR_66_PIO_MASK) | | |
28960 | (accessTicks << TR_66_PIO_ACCESS_SHIFT) | | |
28961 | (recTicks << TR_66_PIO_RECOVERY_SHIFT); | |
28962 | - } else { | |
28963 | + break; | |
28964 | + default: { | |
28965 | /* 33Mhz cell */ | |
28966 | int ebit = 0; | |
28967 | + recTime = d.cycle_time - ide_pio_timings[pio].active_time | |
28968 | + - ide_pio_timings[pio].setup_time; | |
28969 | + recTime = max(recTime, 150U); | |
28970 | + accessTime = ide_pio_timings[pio].active_time; | |
28971 | + accessTime = max(accessTime, 150U); | |
28972 | accessTicks = SYSCLK_TICKS(accessTime); | |
28973 | accessTicks = min(accessTicks, 0x1fU); | |
28974 | accessTicks = max(accessTicks, 4U); | |
28975 | @@ -443,26 +671,31 @@ | |
28976 | (recTicks << TR_33_PIO_RECOVERY_SHIFT); | |
28977 | if (ebit) | |
28978 | *timings |= TR_33_PIO_E; | |
28979 | + break; | |
28980 | + } | |
28981 | } | |
28982 | ||
28983 | #ifdef IDE_PMAC_DEBUG | |
28984 | - printk(KERN_ERR "ide_pmac: Set PIO timing for mode %d, reg: 0x%08x\n", | |
28985 | - pio, *timings); | |
28986 | + printk(KERN_ERR "%s: Set PIO timing for mode %d, reg: 0x%08x\n", | |
28987 | + drive->name, pio, *timings); | |
28988 | #endif | |
28989 | ||
28990 | if (drive->select.all == HWIF(drive)->INB(IDE_SELECT_REG)) | |
28991 | - pmac_ide_selectproc(drive); | |
28992 | + pmac_ide_do_update_timings(drive); | |
28993 | } | |
28994 | ||
28995 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC | |
28996 | static int __pmac | |
28997 | -set_timings_udma(u32 *timings, u8 speed) | |
28998 | +set_timings_udma_ata4(u32 *timings, u8 speed) | |
28999 | { | |
29000 | unsigned rdyToPauseTicks, wrDataSetupTicks, addrTicks; | |
29001 | ||
29002 | - rdyToPauseTicks = SYSCLK_TICKS_66(udma_timings[speed & 0xf].rdy2pause); | |
29003 | - wrDataSetupTicks = SYSCLK_TICKS_66(udma_timings[speed & 0xf].wrDataSetup); | |
29004 | - addrTicks = SYSCLK_TICKS_66(udma_timings[speed & 0xf].addrSetup); | |
29005 | + if (speed > XFER_UDMA_4) | |
29006 | + return 1; | |
29007 | + | |
29008 | + rdyToPauseTicks = SYSCLK_TICKS_66(kl66_udma_timings[speed & 0xf].rdy2pause); | |
29009 | + wrDataSetupTicks = SYSCLK_TICKS_66(kl66_udma_timings[speed & 0xf].wrDataSetup); | |
29010 | + addrTicks = SYSCLK_TICKS_66(kl66_udma_timings[speed & 0xf].addrSetup); | |
29011 | ||
29012 | *timings = ((*timings) & ~(TR_66_UDMA_MASK | TR_66_MDMA_MASK)) | | |
29013 | (wrDataSetupTicks << TR_66_UDMA_WRDATASETUP_SHIFT) | | |
29014 | @@ -478,11 +711,29 @@ | |
29015 | } | |
29016 | ||
29017 | static int __pmac | |
29018 | -set_timings_mdma(int intf_type, u32 *timings, u8 speed, int drive_cycle_time) | |
29019 | +set_timings_udma_ata6(u32 *pio_timings, u32 *ultra_timings, u8 speed) | |
29020 | +{ | |
29021 | + struct ide_timing *t = ide_timing_find_mode(speed); | |
29022 | + u32 tr; | |
29023 | + | |
29024 | + if (speed > XFER_UDMA_5 || t == NULL) | |
29025 | + return 1; | |
29026 | + tr = kauai_lookup_timing(kauai_udma_timings, (int)t->udma); | |
29027 | + if (tr == 0) | |
29028 | + return 1; | |
29029 | + *ultra_timings = ((*ultra_timings) & ~TR_100_UDMAREG_UDMA_MASK) | tr; | |
29030 | + *ultra_timings = (*ultra_timings) | TR_100_UDMAREG_UDMA_EN; | |
29031 | + | |
29032 | + return 0; | |
29033 | +} | |
29034 | + | |
29035 | +static int __pmac | |
29036 | +set_timings_mdma(ide_drive_t *drive, int intf_type, u32 *timings, u32 *timings2, | |
29037 | + u8 speed, int drive_cycle_time) | |
29038 | { | |
29039 | int cycleTime, accessTime, recTime; | |
29040 | unsigned accessTicks, recTicks; | |
29041 | - struct mdma_timings_t* tm; | |
29042 | + struct mdma_timings_t* tm = NULL; | |
29043 | int i; | |
29044 | ||
29045 | /* Get default cycle time for mode */ | |
29046 | @@ -491,7 +742,7 @@ | |
29047 | case 1: cycleTime = 150; break; | |
29048 | case 2: cycleTime = 120; break; | |
29049 | default: | |
29050 | - return -1; | |
29051 | + return 1; | |
29052 | } | |
29053 | /* Adjust for drive */ | |
29054 | if (drive_cycle_time && drive_cycle_time > cycleTime) | |
29055 | @@ -501,8 +752,9 @@ | |
29056 | cycleTime = 150; | |
29057 | /* Get the proper timing array for this controller */ | |
29058 | switch(intf_type) { | |
29059 | + case controller_un_ata6: | |
29060 | + break; | |
29061 | case controller_kl_ata4: | |
29062 | - case controller_kl_ata4_80: | |
29063 | tm = mdma_timings_66; | |
29064 | break; | |
29065 | case controller_kl_ata3: | |
29066 | @@ -512,24 +764,36 @@ | |
29067 | tm = mdma_timings_33; | |
29068 | break; | |
29069 | } | |
29070 | - /* Lookup matching access & recovery times */ | |
29071 | - i = -1; | |
29072 | - for (;;) { | |
29073 | - if (tm[i+1].cycleTime < cycleTime) | |
29074 | - break; | |
29075 | - i++; | |
29076 | - } | |
29077 | - if (i < 0) | |
29078 | - return -1; | |
29079 | - cycleTime = tm[i].cycleTime; | |
29080 | - accessTime = tm[i].accessTime; | |
29081 | - recTime = tm[i].recoveryTime; | |
29082 | + if (tm != NULL) { | |
29083 | + /* Lookup matching access & recovery times */ | |
29084 | + i = -1; | |
29085 | + for (;;) { | |
29086 | + if (tm[i+1].cycleTime < cycleTime) | |
29087 | + break; | |
29088 | + i++; | |
29089 | + } | |
29090 | + if (i < 0) | |
29091 | + return 1; | |
29092 | + cycleTime = tm[i].cycleTime; | |
29093 | + accessTime = tm[i].accessTime; | |
29094 | + recTime = tm[i].recoveryTime; | |
29095 | ||
29096 | #ifdef IDE_PMAC_DEBUG | |
29097 | - printk(KERN_ERR "ide_pmac: MDMA, cycleTime: %d, accessTime: %d, recTime: %d\n", | |
29098 | - cycleTime, accessTime, recTime); | |
29099 | -#endif | |
29100 | - if (intf_type == controller_kl_ata4 || intf_type == controller_kl_ata4_80) { | |
29101 | + printk(KERN_ERR "%s: MDMA, cycleTime: %d, accessTime: %d, recTime: %d\n", | |
29102 | + drive->name, cycleTime, accessTime, recTime); | |
29103 | +#endif | |
29104 | + } | |
29105 | + switch(intf_type) { | |
29106 | + case controller_un_ata6: { | |
29107 | + /* 100Mhz cell */ | |
29108 | + u32 tr = kauai_lookup_timing(kauai_mdma_timings, cycleTime); | |
29109 | + if (tr == 0) | |
29110 | + return 1; | |
29111 | + *timings = ((*timings) & ~TR_100_PIOREG_MDMA_MASK) | tr; | |
29112 | + *timings2 = (*timings2) & ~TR_100_UDMAREG_UDMA_EN; | |
29113 | + } | |
29114 | + break; | |
29115 | + case controller_kl_ata4: | |
29116 | /* 66Mhz cell */ | |
29117 | accessTicks = SYSCLK_TICKS_66(accessTime); | |
29118 | accessTicks = min(accessTicks, 0x1fU); | |
29119 | @@ -541,7 +805,8 @@ | |
29120 | *timings = ((*timings) & ~(TR_66_MDMA_MASK | TR_66_UDMA_MASK)) | | |
29121 | (accessTicks << TR_66_MDMA_ACCESS_SHIFT) | | |
29122 | (recTicks << TR_66_MDMA_RECOVERY_SHIFT); | |
29123 | - } else if (intf_type == controller_kl_ata3) { | |
29124 | + break; | |
29125 | + case controller_kl_ata3: | |
29126 | /* 33Mhz cell on KeyLargo */ | |
29127 | accessTicks = SYSCLK_TICKS(accessTime); | |
29128 | accessTicks = max(accessTicks, 1U); | |
29129 | @@ -553,7 +818,8 @@ | |
29130 | *timings = ((*timings) & ~TR_33_MDMA_MASK) | | |
29131 | (accessTicks << TR_33_MDMA_ACCESS_SHIFT) | | |
29132 | (recTicks << TR_33_MDMA_RECOVERY_SHIFT); | |
29133 | - } else { | |
29134 | + break; | |
29135 | + default: { | |
29136 | /* 33Mhz cell on others */ | |
29137 | int halfTick = 0; | |
29138 | int origAccessTime = accessTime; | |
29139 | @@ -578,10 +844,11 @@ | |
29140 | (recTicks << TR_33_MDMA_RECOVERY_SHIFT); | |
29141 | if (halfTick) | |
29142 | *timings |= TR_33_MDMA_HALFTICK; | |
29143 | + } | |
29144 | } | |
29145 | #ifdef IDE_PMAC_DEBUG | |
29146 | - printk(KERN_ERR "ide_pmac: Set MDMA timing for mode %d, reg: 0x%08x\n", | |
29147 | - speed & 0xf, *timings); | |
29148 | + printk(KERN_ERR "%s: Set MDMA timing for mode %d, reg: 0x%08x\n", | |
29149 | + drive->name, speed & 0xf, *timings); | |
29150 | #endif | |
29151 | return 0; | |
29152 | } | |
29153 | @@ -591,36 +858,42 @@ | |
29154 | * our, normal mdma function is supposed to be more precise | |
29155 | */ | |
29156 | static int __pmac | |
29157 | -pmac_ide_tune_chipset (ide_drive_t *drive, u8 speed) | |
29158 | +pmac_ide_tune_chipset (ide_drive_t *drive, byte speed) | |
29159 | { | |
29160 | int unit = (drive->select.b.unit & 0x01); | |
29161 | int ret = 0; | |
29162 | pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; | |
29163 | - u32 *timings; | |
29164 | - | |
29165 | + u32 *timings, *timings2; | |
29166 | + | |
29167 | if (pmif == NULL) | |
29168 | return 1; | |
29169 | - | |
29170 | + | |
29171 | timings = &pmif->timings[unit]; | |
29172 | + timings2 = &pmif->timings[unit+2]; | |
29173 | ||
29174 | switch(speed) { | |
29175 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC | |
29176 | + case XFER_UDMA_5: | |
29177 | + if (pmif->kind != controller_un_ata6) | |
29178 | + return 1; | |
29179 | case XFER_UDMA_4: | |
29180 | case XFER_UDMA_3: | |
29181 | - if (pmif->kind != controller_kl_ata4_80) | |
29182 | + if (HWIF(drive)->udma_four == 0) | |
29183 | return 1; | |
29184 | case XFER_UDMA_2: | |
29185 | case XFER_UDMA_1: | |
29186 | case XFER_UDMA_0: | |
29187 | - if (pmif->kind != controller_kl_ata4 && | |
29188 | - pmif->kind != controller_kl_ata4_80) | |
29189 | - return 1; | |
29190 | - ret = set_timings_udma(timings, speed); | |
29191 | + if (pmif->kind == controller_kl_ata4) | |
29192 | + ret = set_timings_udma_ata4(timings, speed); | |
29193 | + else if (pmif->kind == controller_un_ata6) | |
29194 | + ret = set_timings_udma_ata6(timings, timings2, speed); | |
29195 | + else | |
29196 | + ret = 1; | |
29197 | break; | |
29198 | case XFER_MW_DMA_2: | |
29199 | case XFER_MW_DMA_1: | |
29200 | case XFER_MW_DMA_0: | |
29201 | - ret = set_timings_mdma(pmif->kind, timings, speed, 0); | |
29202 | + ret = set_timings_mdma(drive, pmif->kind, timings, timings2, speed, 0); | |
29203 | break; | |
29204 | case XFER_SW_DMA_2: | |
29205 | case XFER_SW_DMA_1: | |
29206 | @@ -644,7 +917,7 @@ | |
29207 | if (ret) | |
29208 | return ret; | |
29209 | ||
29210 | - pmac_ide_selectproc(drive); | |
29211 | + pmac_ide_do_update_timings(drive); | |
29212 | drive->current_speed = speed; | |
29213 | ||
29214 | return 0; | |
29215 | @@ -653,11 +926,14 @@ | |
29216 | static void __pmac | |
29217 | sanitize_timings(pmac_ide_hwif_t *pmif) | |
29218 | { | |
29219 | - unsigned value; | |
29220 | + unsigned int value, value2 = 0; | |
29221 | ||
29222 | switch(pmif->kind) { | |
29223 | + case controller_un_ata6: | |
29224 | + value = 0x08618a92; | |
29225 | + value2 = 0x00002921; | |
29226 | + break; | |
29227 | case controller_kl_ata4: | |
29228 | - case controller_kl_ata4_80: | |
29229 | value = 0x0008438c; | |
29230 | break; | |
29231 | case controller_kl_ata3: | |
29232 | @@ -670,6 +946,7 @@ | |
29233 | break; | |
29234 | } | |
29235 | pmif->timings[0] = pmif->timings[1] = value; | |
29236 | + pmif->timings[2] = pmif->timings[3] = value2; | |
29237 | } | |
29238 | ||
29239 | unsigned long __pmac | |
29240 | @@ -724,214 +1001,474 @@ | |
29241 | return 0; | |
29242 | } | |
29243 | ||
29244 | -void __init | |
29245 | -pmac_ide_probe(void) | |
29246 | +/* Suspend call back, should be called after the child devices | |
29247 | + * have actually been suspended | |
29248 | + */ | |
29249 | +static int | |
29250 | +pmac_ide_do_suspend(ide_hwif_t *hwif) | |
29251 | { | |
29252 | - struct device_node *np; | |
29253 | - int i; | |
29254 | - struct device_node *atas; | |
29255 | - struct device_node *p, **pp, *removables, **rp; | |
29256 | - unsigned long base; | |
29257 | - int irq, big_delay; | |
29258 | - ide_hwif_t *hwif; | |
29259 | + pmac_ide_hwif_t *pmif = (pmac_ide_hwif_t *)hwif->hwif_data; | |
29260 | + | |
29261 | + /* We clear the timings */ | |
29262 | + pmif->timings[0] = 0; | |
29263 | + pmif->timings[1] = 0; | |
29264 | + | |
29265 | +#ifdef CONFIG_BLK_DEV_IDE_PMAC_BLINK | |
29266 | + /* Note: This code will be called for every hwif, thus we'll | |
29267 | + * try several time to stop the LED blinker timer, but that | |
29268 | + * should be harmless | |
29269 | + */ | |
29270 | + if (pmu_ide_blink_enabled) { | |
29271 | + unsigned long flags; | |
29272 | ||
29273 | - if (_machine != _MACH_Pmac) | |
29274 | - return; | |
29275 | - pp = &atas; | |
29276 | - rp = &removables; | |
29277 | - p = find_devices("ATA"); | |
29278 | - if (p == NULL) | |
29279 | - p = find_devices("IDE"); | |
29280 | - if (p == NULL) | |
29281 | - p = find_type_devices("ide"); | |
29282 | - if (p == NULL) | |
29283 | - p = find_type_devices("ata"); | |
29284 | - /* Move removable devices such as the media-bay CDROM | |
29285 | - on the PB3400 to the end of the list. */ | |
29286 | - for (; p != NULL; p = p->next) { | |
29287 | - if (p->parent && p->parent->type | |
29288 | - && strcasecmp(p->parent->type, "media-bay") == 0) { | |
29289 | - *rp = p; | |
29290 | - rp = &p->next; | |
29291 | - } else { | |
29292 | - *pp = p; | |
29293 | - pp = &p->next; | |
29294 | - } | |
29295 | + /* Make sure we don't hit the PMU blink */ | |
29296 | + spin_lock_irqsave(&pmu_blink_lock, flags); | |
29297 | + if (pmu_blink_ledstate) | |
29298 | + del_timer(&pmu_blink_timer); | |
29299 | + pmu_blink_ledstate = 0; | |
29300 | + spin_unlock_irqrestore(&pmu_blink_lock, flags); | |
29301 | } | |
29302 | - *rp = NULL; | |
29303 | - *pp = removables; | |
29304 | - big_delay = 0; | |
29305 | - | |
29306 | - for (i = 0, np = atas; i < MAX_HWIFS && np != NULL; np = np->next) { | |
29307 | - struct device_node *tp; | |
29308 | - struct pmac_ide_hwif* pmif; | |
29309 | - int *bidp; | |
29310 | - int in_bay = 0; | |
29311 | - u8 pbus, pid; | |
29312 | - struct pci_dev *pdev = NULL; | |
29313 | - | |
29314 | - /* | |
29315 | - * If this node is not under a mac-io or dbdma node, | |
29316 | - * leave it to the generic PCI driver. | |
29317 | - */ | |
29318 | - for (tp = np->parent; tp != 0; tp = tp->parent) | |
29319 | - if (tp->type && (strcmp(tp->type, "mac-io") == 0 | |
29320 | - || strcmp(tp->type, "dbdma") == 0)) | |
29321 | - break; | |
29322 | - if (tp == 0) | |
29323 | - continue; | |
29324 | +#endif /* CONFIG_BLK_DEV_IDE_PMAC_BLINK */ | |
29325 | ||
29326 | - if (np->n_addrs == 0) { | |
29327 | - printk(KERN_WARNING "ide: no address for device %s\n", | |
29328 | - np->full_name); | |
29329 | - continue; | |
29330 | - } | |
29331 | + /* The media bay will handle itself just fine */ | |
29332 | + if (pmif->mediabay) | |
29333 | + return 0; | |
29334 | + | |
29335 | + /* Disable the bus */ | |
29336 | + ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, pmif->node, pmif->aapl_bus_id, 0); | |
29337 | ||
29338 | - /* We need to find the pci_dev of the mac-io holding the | |
29339 | - * IDE interface | |
29340 | - */ | |
29341 | - if (pci_device_from_OF_node(tp, &pbus, &pid) == 0) | |
29342 | - pdev = pci_find_slot(pbus, pid); | |
29343 | - if (pdev == NULL) | |
29344 | - printk(KERN_WARNING "ide: no PCI host for device %s, DMA disabled\n", | |
29345 | - np->full_name); | |
29346 | + return 0; | |
29347 | +} | |
29348 | ||
29349 | - /* | |
29350 | - * If this slot is taken (e.g. by ide-pci.c) try the next one. | |
29351 | - */ | |
29352 | - while (i < MAX_HWIFS | |
29353 | - && ide_hwifs[i].io_ports[IDE_DATA_OFFSET] != 0) | |
29354 | - ++i; | |
29355 | - if (i >= MAX_HWIFS) | |
29356 | - break; | |
29357 | - pmif = &pmac_ide[i]; | |
29358 | +/* Resume call back, should be called before the child devices | |
29359 | + * are resumed | |
29360 | + */ | |
29361 | +static int | |
29362 | +pmac_ide_do_resume(ide_hwif_t *hwif) | |
29363 | +{ | |
29364 | + pmac_ide_hwif_t *pmif = (pmac_ide_hwif_t *)hwif->hwif_data; | |
29365 | + | |
29366 | + /* Hard reset & re-enable controller (do we really need to reset ? -BenH) */ | |
29367 | + if (!pmif->mediabay) { | |
29368 | + ppc_md.feature_call(PMAC_FTR_IDE_RESET, pmif->node, pmif->aapl_bus_id, 1); | |
29369 | + ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, pmif->node, pmif->aapl_bus_id, 1); | |
29370 | + mdelay(10); | |
29371 | + ppc_md.feature_call(PMAC_FTR_IDE_RESET, pmif->node, pmif->aapl_bus_id, 0); | |
29372 | + mdelay(100); | |
29373 | + } | |
29374 | ||
29375 | - /* | |
29376 | - * Some older OFs have bogus sizes, causing request_OF_resource | |
29377 | - * to fail. We fix them up here | |
29378 | - */ | |
29379 | - if (np->addrs[0].size > 0x1000) | |
29380 | - np->addrs[0].size = 0x1000; | |
29381 | - if (np->n_addrs > 1 && np->addrs[1].size > 0x100) | |
29382 | - np->addrs[1].size = 0x100; | |
29383 | + /* Sanitize drive timings */ | |
29384 | + sanitize_timings(pmif); | |
29385 | ||
29386 | - if (request_OF_resource(np, 0, " (mac-io IDE IO)") == NULL) { | |
29387 | - printk(KERN_ERR "ide-pmac(%s): can't request IO resource !\n", np->name); | |
29388 | - continue; | |
29389 | - } | |
29390 | + return 0; | |
29391 | +} | |
29392 | ||
29393 | - base = (unsigned long) ioremap(np->addrs[0].address, 0x400); | |
29394 | +static int | |
29395 | +pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif) | |
29396 | +{ | |
29397 | + struct device_node *np = pmif->node; | |
29398 | + int *bidp, i; | |
29399 | ||
29400 | - /* XXX This is bogus. Should be fixed in the registry by checking | |
29401 | - the kind of host interrupt controller, a bit like gatwick | |
29402 | - fixes in irq.c | |
29403 | - */ | |
29404 | - if (np->n_intrs == 0) { | |
29405 | - printk(KERN_WARNING "ide: no intrs for device %s, using 13\n", | |
29406 | - np->full_name); | |
29407 | - irq = 13; | |
29408 | - } else { | |
29409 | - irq = np->intrs[0].line; | |
29410 | - } | |
29411 | - pmif->regbase = base; | |
29412 | - pmif->irq = irq; | |
29413 | - pmif->node = np; | |
29414 | - pmif->index = i; | |
29415 | - if (device_is_compatible(np, "keylargo-ata")) { | |
29416 | - if (strcmp(np->name, "ata-4") == 0) | |
29417 | - pmif->kind = controller_kl_ata4; | |
29418 | - else | |
29419 | - pmif->kind = controller_kl_ata3; | |
29420 | - } else if (device_is_compatible(np, "heathrow-ata")) | |
29421 | - pmif->kind = controller_heathrow; | |
29422 | + pmif->cable_80 = 0; | |
29423 | + pmif->broken_dma = pmif->broken_dma_warn = 0; | |
29424 | + if (device_is_compatible(np, "kauai-ata")) | |
29425 | + pmif->kind = controller_un_ata6; | |
29426 | + else if (device_is_compatible(np, "keylargo-ata")) { | |
29427 | + if (strcmp(np->name, "ata-4") == 0) | |
29428 | + pmif->kind = controller_kl_ata4; | |
29429 | else | |
29430 | - pmif->kind = controller_ohare; | |
29431 | + pmif->kind = controller_kl_ata3; | |
29432 | + } else if (device_is_compatible(np, "heathrow-ata")) | |
29433 | + pmif->kind = controller_heathrow; | |
29434 | + else { | |
29435 | + pmif->kind = controller_ohare; | |
29436 | + pmif->broken_dma = 1; | |
29437 | + } | |
29438 | ||
29439 | - bidp = (int *)get_property(np, "AAPL,bus-id", NULL); | |
29440 | - pmif->aapl_bus_id = bidp ? *bidp : 0; | |
29441 | + bidp = (int *)get_property(np, "AAPL,bus-id", NULL); | |
29442 | + pmif->aapl_bus_id = bidp ? *bidp : 0; | |
29443 | ||
29444 | - if (pmif->kind == controller_kl_ata4) { | |
29445 | - char* cable = get_property(np, "cable-type", NULL); | |
29446 | - if (cable && !strncmp(cable, "80-", 3)) | |
29447 | - pmif->kind = controller_kl_ata4_80; | |
29448 | - } | |
29449 | + /* Get cable type from device-tree */ | |
29450 | + if (pmif->kind == controller_kl_ata4 || pmif->kind == controller_un_ata6) { | |
29451 | + char* cable = get_property(np, "cable-type", NULL); | |
29452 | + if (cable && !strncmp(cable, "80-", 3)) | |
29453 | + pmif->cable_80 = 1; | |
29454 | + } | |
29455 | ||
29456 | - /* Make sure we have sane timings */ | |
29457 | - sanitize_timings(pmif); | |
29458 | + pmif->mediabay = 0; | |
29459 | + | |
29460 | + /* Make sure we have sane timings */ | |
29461 | + sanitize_timings(pmif); | |
29462 | ||
29463 | - if (np->parent && np->parent->name | |
29464 | - && strcasecmp(np->parent->name, "media-bay") == 0) { | |
29465 | + /* XXX FIXME: Media bay stuff need re-organizing */ | |
29466 | + if (np->parent && np->parent->name | |
29467 | + && strcasecmp(np->parent->name, "media-bay") == 0) { | |
29468 | #ifdef CONFIG_PMAC_PBOOK | |
29469 | - media_bay_set_ide_infos(np->parent,base,irq,i); | |
29470 | + media_bay_set_ide_infos(np->parent, pmif->regbase, pmif->irq, hwif->index); | |
29471 | #endif /* CONFIG_PMAC_PBOOK */ | |
29472 | - in_bay = 1; | |
29473 | - if (!bidp) | |
29474 | - pmif->aapl_bus_id = 1; | |
29475 | - } else if (pmif->kind == controller_ohare) { | |
29476 | - /* The code below is having trouble on some ohare machines | |
29477 | - * (timing related ?). Until I can put my hand on one of these | |
29478 | - * units, I keep the old way | |
29479 | - */ | |
29480 | - ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, 0, 1); | |
29481 | - } else { | |
29482 | - /* This is necessary to enable IDE when net-booting */ | |
29483 | - printk(KERN_INFO "pmac_ide: enabling IDE bus ID %d\n", | |
29484 | - pmif->aapl_bus_id); | |
29485 | - ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 1); | |
29486 | - ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmif->aapl_bus_id, 1); | |
29487 | - mdelay(10); | |
29488 | - ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 0); | |
29489 | - big_delay = 1; | |
29490 | - } | |
29491 | + pmif->mediabay = 1; | |
29492 | + if (!bidp) | |
29493 | + pmif->aapl_bus_id = 1; | |
29494 | + } else if (pmif->kind == controller_ohare) { | |
29495 | + /* The code below is having trouble on some ohare machines | |
29496 | + * (timing related ?). Until I can put my hand on one of these | |
29497 | + * units, I keep the old way | |
29498 | + */ | |
29499 | + ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, 0, 1); | |
29500 | + } else { | |
29501 | + /* This is necessary to enable IDE when net-booting */ | |
29502 | + ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 1); | |
29503 | + ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmif->aapl_bus_id, 1); | |
29504 | + mdelay(10); | |
29505 | + ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 0); | |
29506 | + mdelay(100); | |
29507 | + } | |
29508 | ||
29509 | - hwif = &ide_hwifs[i]; | |
29510 | - /* Setup MMIO ops */ | |
29511 | - default_hwif_mmiops(hwif); | |
29512 | - /* Tell common code _not_ to mess with resources */ | |
29513 | - hwif->mmio = 2; | |
29514 | - hwif->hwif_data = pmif; | |
29515 | - pmac_ide_init_hwif_ports(&hwif->hw, base, 0, &hwif->irq); | |
29516 | - memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); | |
29517 | - hwif->chipset = ide_pmac; | |
29518 | - hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET] || in_bay; | |
29519 | - hwif->udma_four = (pmif->kind == controller_kl_ata4_80); | |
29520 | - hwif->pci_dev = pdev; | |
29521 | - hwif->drives[0].unmask = 1; | |
29522 | - hwif->drives[1].unmask = 1; | |
29523 | - hwif->tuneproc = pmac_ide_tuneproc; | |
29524 | + /* Setup MMIO ops */ | |
29525 | + default_hwif_mmiops(hwif); | |
29526 | + | |
29527 | + /* Tell common code _not_ to mess with resources */ | |
29528 | + hwif->mmio = 2; | |
29529 | + hwif->hwif_data = pmif; | |
29530 | + pmac_ide_init_hwif_ports(&hwif->hw, pmif->regbase, 0, &hwif->irq); | |
29531 | + memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); | |
29532 | + hwif->chipset = ide_pmac; | |
29533 | + hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET] || pmif->mediabay; | |
29534 | + hwif->hold = pmif->mediabay; | |
29535 | + hwif->udma_four = pmif->cable_80; | |
29536 | + hwif->drives[0].unmask = 1; | |
29537 | + hwif->drives[1].unmask = 1; | |
29538 | + hwif->tuneproc = pmac_ide_tuneproc; | |
29539 | + if (pmif->kind == controller_un_ata6) | |
29540 | + hwif->selectproc = pmac_ide_kauai_selectproc; | |
29541 | + else | |
29542 | hwif->selectproc = pmac_ide_selectproc; | |
29543 | - hwif->speedproc = pmac_ide_tune_chipset; | |
29544 | + hwif->speedproc = pmac_ide_tune_chipset; | |
29545 | + | |
29546 | +#ifdef CONFIG_BLK_DEV_IDE_PMAC_BLINK | |
29547 | + pmu_ide_blink_enabled = pmu_hd_blink_init(); | |
29548 | + | |
29549 | + if (pmu_ide_blink_enabled) | |
29550 | + hwif->led_act = pmu_hd_kick_blink; | |
29551 | +#endif | |
29552 | + | |
29553 | + printk(KERN_INFO "ide%d: Found Apple %s controller, bus ID %d%s\n", | |
29554 | + hwif->index, model_name[pmif->kind], pmif->aapl_bus_id, | |
29555 | + pmif->mediabay ? " (mediabay)" : ""); | |
29556 | + | |
29557 | #ifdef CONFIG_PMAC_PBOOK | |
29558 | - if (in_bay && check_media_bay_by_base(base, MB_CD) == 0) | |
29559 | - hwif->noprobe = 0; | |
29560 | + if (pmif->mediabay && check_media_bay_by_base(pmif->regbase, MB_CD) == 0) | |
29561 | + hwif->noprobe = 0; | |
29562 | #endif /* CONFIG_PMAC_PBOOK */ | |
29563 | ||
29564 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC | |
29565 | - if (np->n_addrs >= 2) { | |
29566 | - /* has a DBDMA controller channel */ | |
29567 | - pmac_ide_setup_dma(np, i); | |
29568 | - } | |
29569 | - hwif->atapi_dma = 1; | |
29570 | - hwif->ultra_mask = 0x1f; | |
29571 | - hwif->mwdma_mask = 0x07; | |
29572 | - hwif->swdma_mask = 0x07; | |
29573 | - | |
29574 | + /* has a DBDMA controller channel */ | |
29575 | + if (pmif->dma_regs) | |
29576 | + pmac_ide_setup_dma(pmif, hwif); | |
29577 | #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ | |
29578 | ||
29579 | + /* We probe the hwif now */ | |
29580 | + probe_hwif_init(hwif); | |
29581 | + | |
29582 | + /* The code IDE code will have set hwif->present if we have devices attached, | |
29583 | + * if we don't, the discard the interface except if we are on a media bay slot | |
29584 | + */ | |
29585 | + if (!hwif->present && !pmif->mediabay) { | |
29586 | + printk(KERN_INFO "ide%d: Bus empty, interface released.\n", | |
29587 | + hwif->index); | |
29588 | + default_hwif_iops(hwif); | |
29589 | + for (i = IDE_DATA_OFFSET; i <= IDE_CONTROL_OFFSET; ++i) | |
29590 | + hwif->io_ports[i] = 0; | |
29591 | + hwif->chipset = ide_unknown; | |
29592 | + hwif->noprobe = 1; | |
29593 | + return -ENODEV; | |
29594 | + } | |
29595 | + | |
29596 | + return 0; | |
29597 | +} | |
29598 | + | |
29599 | +static int __devinit | |
29600 | +pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_match *match) | |
29601 | +{ | |
29602 | + unsigned long base, regbase; | |
29603 | + int irq; | |
29604 | + ide_hwif_t *hwif; | |
29605 | + pmac_ide_hwif_t *pmif; | |
29606 | + int i, rc; | |
29607 | + | |
29608 | + i = 0; | |
29609 | + while (i < MAX_HWIFS && (ide_hwifs[i].io_ports[IDE_DATA_OFFSET] != 0 | |
29610 | + || pmac_ide[i].node != NULL)) | |
29611 | ++i; | |
29612 | + if (i >= MAX_HWIFS) { | |
29613 | + printk(KERN_ERR "ide-pmac: MacIO interface attach with no slot\n"); | |
29614 | + printk(KERN_ERR " %s\n", mdev->ofdev.node->full_name); | |
29615 | + return -ENODEV; | |
29616 | } | |
29617 | - pmac_ide_count = i; | |
29618 | - if (big_delay) | |
29619 | - mdelay(IDE_WAKEUP_DELAY_MS); | |
29620 | ||
29621 | -#ifdef CONFIG_PMAC_PBOOK | |
29622 | - pmu_register_sleep_notifier(&idepmac_sleep_notifier); | |
29623 | -#endif /* CONFIG_PMAC_PBOOK */ | |
29624 | + pmif = &pmac_ide[i]; | |
29625 | + hwif = &ide_hwifs[i]; | |
29626 | + | |
29627 | + if (mdev->ofdev.node->n_addrs == 0) { | |
29628 | + printk(KERN_WARNING "ide%d: no address for %s\n", | |
29629 | + i, mdev->ofdev.node->full_name); | |
29630 | + return -ENXIO; | |
29631 | + } | |
29632 | + | |
29633 | + /* | |
29634 | + * Some older OFs have bogus sizes, causing request_OF_resource | |
29635 | + * to fail. We fix them up here | |
29636 | + */ | |
29637 | + if (mdev->ofdev.node->addrs[0].size > 0x1000) | |
29638 | + mdev->ofdev.node->addrs[0].size = 0x1000; | |
29639 | + if (mdev->ofdev.node->n_addrs > 1 && mdev->ofdev.node->addrs[1].size > 0x100) | |
29640 | + mdev->ofdev.node->addrs[1].size = 0x100; | |
29641 | + | |
29642 | + /* Request memory resource for IO ports */ | |
29643 | + if (request_OF_resource(mdev->ofdev.node, 0, " (mac-io ata ports)") == NULL) { | |
29644 | + printk(KERN_ERR "ide%d: can't request mmio resource !\n", i); | |
29645 | + return -EBUSY; | |
29646 | + } | |
29647 | + | |
29648 | + /* XXX This is bogus. Should be fixed in the registry by checking | |
29649 | + * the kind of host interrupt controller, a bit like gatwick | |
29650 | + * fixes in irq.c. That works well enough for the single case | |
29651 | + * where that happens though... | |
29652 | + */ | |
29653 | + if (mdev->ofdev.node->n_intrs == 0) { | |
29654 | + printk(KERN_WARNING "ide%d: no intrs for device %s, using 13\n", | |
29655 | + i, mdev->ofdev.node->full_name); | |
29656 | + irq = 13; | |
29657 | + } else | |
29658 | + irq = mdev->ofdev.node->intrs[0].line; | |
29659 | + | |
29660 | + base = (unsigned long) ioremap(mdev->ofdev.node->addrs[0].address, 0x400); | |
29661 | + regbase = base; | |
29662 | + | |
29663 | + hwif->pci_dev = mdev->bus->pdev; | |
29664 | + hwif->gendev.parent = &mdev->ofdev.dev; | |
29665 | + | |
29666 | + pmif->mdev = mdev; | |
29667 | + pmif->node = mdev->ofdev.node; | |
29668 | + pmif->regbase = regbase; | |
29669 | + pmif->irq = irq; | |
29670 | +#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC | |
29671 | + if (mdev->ofdev.node->n_addrs >= 2) | |
29672 | + pmif->dma_regs = (volatile struct dbdma_regs*) | |
29673 | + ioremap(mdev->ofdev.node->addrs[1].address, 0x1000); | |
29674 | + else | |
29675 | + pmif->dma_regs = NULL; | |
29676 | +#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ | |
29677 | + dev_set_drvdata(&mdev->ofdev.dev, hwif); | |
29678 | + | |
29679 | + rc = pmac_ide_setup_device(pmif, hwif); | |
29680 | + if (rc != 0) { | |
29681 | + /* The inteface is released to the common IDE layer */ | |
29682 | + dev_set_drvdata(&mdev->ofdev.dev, NULL); | |
29683 | + iounmap((void *)base); | |
29684 | + if (pmif->dma_regs) | |
29685 | + iounmap((void *)pmif->dma_regs); | |
29686 | + memset(pmif, 0, sizeof(*pmif)); | |
29687 | + release_OF_resource(mdev->ofdev.node, 0); | |
29688 | + } | |
29689 | + | |
29690 | + return rc; | |
29691 | } | |
29692 | ||
29693 | +static int | |
29694 | +pmac_ide_macio_suspend(struct macio_dev *mdev, u32 state) | |
29695 | +{ | |
29696 | + ide_hwif_t *hwif = (ide_hwif_t *)dev_get_drvdata(&mdev->ofdev.dev); | |
29697 | + int rc = 0; | |
29698 | + | |
29699 | + if (state != mdev->ofdev.dev.power_state && state >= 2) { | |
29700 | + rc = pmac_ide_do_suspend(hwif); | |
29701 | + if (rc == 0) | |
29702 | + mdev->ofdev.dev.power_state = state; | |
29703 | + } | |
29704 | + | |
29705 | + return rc; | |
29706 | +} | |
29707 | + | |
29708 | +static int | |
29709 | +pmac_ide_macio_resume(struct macio_dev *mdev) | |
29710 | +{ | |
29711 | + ide_hwif_t *hwif = (ide_hwif_t *)dev_get_drvdata(&mdev->ofdev.dev); | |
29712 | + int rc = 0; | |
29713 | + | |
29714 | + if (mdev->ofdev.dev.power_state != 0) { | |
29715 | + rc = pmac_ide_do_resume(hwif); | |
29716 | + if (rc == 0) | |
29717 | + mdev->ofdev.dev.power_state = 0; | |
29718 | + } | |
29719 | + | |
29720 | + return rc; | |
29721 | +} | |
29722 | + | |
29723 | +static int __devinit | |
29724 | +pmac_ide_pci_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |
29725 | +{ | |
29726 | + ide_hwif_t *hwif; | |
29727 | + struct device_node *np; | |
29728 | + pmac_ide_hwif_t *pmif; | |
29729 | + unsigned long base; | |
29730 | + unsigned long rbase, rlen; | |
29731 | + int i, rc; | |
29732 | + | |
29733 | + np = pci_device_to_OF_node(pdev); | |
29734 | + if (np == NULL) { | |
29735 | + printk(KERN_ERR "ide-pmac: cannot find MacIO node for Kauai ATA interface\n"); | |
29736 | + return -ENODEV; | |
29737 | + } | |
29738 | + i = 0; | |
29739 | + while (i < MAX_HWIFS && (ide_hwifs[i].io_ports[IDE_DATA_OFFSET] != 0 | |
29740 | + || pmac_ide[i].node != NULL)) | |
29741 | + ++i; | |
29742 | + if (i >= MAX_HWIFS) { | |
29743 | + printk(KERN_ERR "ide-pmac: PCI interface attach with no slot\n"); | |
29744 | + printk(KERN_ERR " %s\n", np->full_name); | |
29745 | + return -ENODEV; | |
29746 | + } | |
29747 | + | |
29748 | + pmif = &pmac_ide[i]; | |
29749 | + hwif = &ide_hwifs[i]; | |
29750 | + | |
29751 | + if (pci_enable_device(pdev)) { | |
29752 | + printk(KERN_WARNING "ide%i: Can't enable PCI device for %s\n", | |
29753 | + i, np->full_name); | |
29754 | + return -ENXIO; | |
29755 | + } | |
29756 | + pci_set_master(pdev); | |
29757 | + | |
29758 | + if (pci_request_regions(pdev, "Kauai ATA")) { | |
29759 | + printk(KERN_ERR "ide%d: Cannot obtain PCI resources for %s\n", | |
29760 | + i, np->full_name); | |
29761 | + return -ENXIO; | |
29762 | + } | |
29763 | + | |
29764 | + hwif->pci_dev = pdev; | |
29765 | + hwif->gendev.parent = &pdev->dev; | |
29766 | + pmif->mdev = NULL; | |
29767 | + pmif->node = np; | |
29768 | + | |
29769 | + rbase = pci_resource_start(pdev, 0); | |
29770 | + rlen = pci_resource_len(pdev, 0); | |
29771 | + | |
29772 | + base = (unsigned long) ioremap(rbase, rlen); | |
29773 | + pmif->regbase = base + 0x2000; | |
29774 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC | |
29775 | + pmif->dma_regs = (volatile struct dbdma_regs*)(base + 0x1000); | |
29776 | +#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ | |
29777 | + pmif->irq = pdev->irq; | |
29778 | + | |
29779 | + pci_set_drvdata(pdev, hwif); | |
29780 | + | |
29781 | + rc = pmac_ide_setup_device(pmif, hwif); | |
29782 | + if (rc != 0) { | |
29783 | + /* The inteface is released to the common IDE layer */ | |
29784 | + pci_set_drvdata(pdev, NULL); | |
29785 | + iounmap((void *)base); | |
29786 | + memset(pmif, 0, sizeof(*pmif)); | |
29787 | + pci_release_regions(pdev); | |
29788 | + } | |
29789 | + | |
29790 | + return rc; | |
29791 | +} | |
29792 | + | |
29793 | +static int | |
29794 | +pmac_ide_pci_suspend(struct pci_dev *pdev, u32 state) | |
29795 | +{ | |
29796 | + ide_hwif_t *hwif = (ide_hwif_t *)pci_get_drvdata(pdev); | |
29797 | + int rc = 0; | |
29798 | + | |
29799 | + if (state != pdev->dev.power_state && state >= 2) { | |
29800 | + rc = pmac_ide_do_suspend(hwif); | |
29801 | + if (rc == 0) | |
29802 | + pdev->dev.power_state = state; | |
29803 | + } | |
29804 | + | |
29805 | + return rc; | |
29806 | +} | |
29807 | ||
29808 | static int | |
29809 | +pmac_ide_pci_resume(struct pci_dev *pdev) | |
29810 | +{ | |
29811 | + ide_hwif_t *hwif = (ide_hwif_t *)pci_get_drvdata(pdev); | |
29812 | + int rc = 0; | |
29813 | + | |
29814 | + if (pdev->dev.power_state != 0) { | |
29815 | + rc = pmac_ide_do_resume(hwif); | |
29816 | + if (rc == 0) | |
29817 | + pdev->dev.power_state = 0; | |
29818 | + } | |
29819 | + | |
29820 | + return rc; | |
29821 | +} | |
29822 | + | |
29823 | +static struct of_match pmac_ide_macio_match[] = | |
29824 | +{ | |
29825 | + { | |
29826 | + .name = "IDE", | |
29827 | + .type = OF_ANY_MATCH, | |
29828 | + .compatible = OF_ANY_MATCH | |
29829 | + }, | |
29830 | + { | |
29831 | + .name = "ATA", | |
29832 | + .type = OF_ANY_MATCH, | |
29833 | + .compatible = OF_ANY_MATCH | |
29834 | + }, | |
29835 | + { | |
29836 | + .name = OF_ANY_MATCH, | |
29837 | + .type = "ide", | |
29838 | + .compatible = OF_ANY_MATCH | |
29839 | + }, | |
29840 | + { | |
29841 | + .name = OF_ANY_MATCH, | |
29842 | + .type = "ata", | |
29843 | + .compatible = OF_ANY_MATCH | |
29844 | + }, | |
29845 | + {}, | |
29846 | +}; | |
29847 | + | |
29848 | +static struct macio_driver pmac_ide_macio_driver = | |
29849 | +{ | |
29850 | + .name = "ide-pmac", | |
29851 | + .match_table = pmac_ide_macio_match, | |
29852 | + .probe = pmac_ide_macio_attach, | |
29853 | + .suspend = pmac_ide_macio_suspend, | |
29854 | + .resume = pmac_ide_macio_resume, | |
29855 | +}; | |
29856 | + | |
29857 | +static struct pci_device_id pmac_ide_pci_match[] __devinitdata = { | |
29858 | + { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_KAUAI_ATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | |
29859 | +}; | |
29860 | + | |
29861 | +static struct pci_driver pmac_ide_pci_driver = { | |
29862 | + .name = "ide-pmac", | |
29863 | + .id_table = pmac_ide_pci_match, | |
29864 | + .probe = pmac_ide_pci_attach, | |
29865 | + .suspend = pmac_ide_pci_suspend, | |
29866 | + .resume = pmac_ide_pci_resume, | |
29867 | +}; | |
29868 | + | |
29869 | +void __init | |
29870 | +pmac_ide_probe(void) | |
29871 | +{ | |
29872 | + if (_machine != _MACH_Pmac) | |
29873 | + return; | |
29874 | + | |
29875 | +#ifdef CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST | |
29876 | + pci_register_driver(&pmac_ide_pci_driver); | |
29877 | + macio_register_driver(&pmac_ide_macio_driver); | |
29878 | +#else | |
29879 | + macio_register_driver(&pmac_ide_macio_driver); | |
29880 | + pci_register_driver(&pmac_ide_pci_driver); | |
29881 | +#endif | |
29882 | +} | |
29883 | + | |
29884 | +#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC | |
29885 | + | |
29886 | +static int __pmac | |
29887 | pmac_ide_build_sglist(ide_drive_t *drive, struct request *rq) | |
29888 | { | |
29889 | ide_hwif_t *hwif = HWIF(drive); | |
29890 | @@ -942,7 +1479,7 @@ | |
29891 | if (hwif->sg_dma_active) | |
29892 | BUG(); | |
29893 | ||
29894 | - nents = blk_rq_map_sg(&drive->queue, rq, sg); | |
29895 | + nents = blk_rq_map_sg(drive->queue, rq, sg); | |
29896 | ||
29897 | if (rq_data_dir(rq) == READ) | |
29898 | pmif->sg_dma_direction = PCI_DMA_FROMDEVICE; | |
29899 | @@ -952,7 +1489,7 @@ | |
29900 | return pci_map_sg(hwif->pci_dev, sg, nents, pmif->sg_dma_direction); | |
29901 | } | |
29902 | ||
29903 | -static int | |
29904 | +static int __pmac | |
29905 | pmac_ide_raw_build_sglist(ide_drive_t *drive, struct request *rq) | |
29906 | { | |
29907 | ide_hwif_t *hwif = HWIF(drive); | |
29908 | @@ -968,14 +1505,14 @@ | |
29909 | else | |
29910 | pmif->sg_dma_direction = PCI_DMA_FROMDEVICE; | |
29911 | ||
29912 | - if (sector_count > 127) { | |
29913 | + if (sector_count > 128) { | |
29914 | memset(&sg[nents], 0, sizeof(*sg)); | |
29915 | sg[nents].page = virt_to_page(virt_addr); | |
29916 | sg[nents].offset = offset_in_page(virt_addr); | |
29917 | - sg[nents].length = 127 * SECTOR_SIZE; | |
29918 | + sg[nents].length = 128 * SECTOR_SIZE; | |
29919 | nents++; | |
29920 | - virt_addr = virt_addr + (127 * SECTOR_SIZE); | |
29921 | - sector_count -= 127; | |
29922 | + virt_addr = virt_addr + (128 * SECTOR_SIZE); | |
29923 | + sector_count -= 128; | |
29924 | } | |
29925 | memset(&sg[nents], 0, sizeof(*sg)); | |
29926 | sg[nents].page = virt_to_page(virt_addr); | |
29927 | @@ -990,16 +1527,16 @@ | |
29928 | * pmac_ide_build_dmatable builds the DBDMA command list | |
29929 | * for a transfer and sets the DBDMA channel to point to it. | |
29930 | */ | |
29931 | -static int | |
29932 | -pmac_ide_build_dmatable(ide_drive_t *drive, int wr) | |
29933 | +static int __pmac | |
29934 | +pmac_ide_build_dmatable(ide_drive_t *drive, struct request *rq) | |
29935 | { | |
29936 | struct dbdma_cmd *table; | |
29937 | int i, count = 0; | |
29938 | - struct request *rq = HWGROUP(drive)->rq; | |
29939 | ide_hwif_t *hwif = HWIF(drive); | |
29940 | pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; | |
29941 | volatile struct dbdma_regs *dma = pmif->dma_regs; | |
29942 | struct scatterlist *sg; | |
29943 | + int wr = (rq_data_dir(rq) == WRITE); | |
29944 | ||
29945 | /* DMA table is already aligned */ | |
29946 | table = (struct dbdma_cmd *) pmif->dma_table_cpu; | |
29947 | @@ -1026,10 +1563,18 @@ | |
29948 | cur_addr = sg_dma_address(sg); | |
29949 | cur_len = sg_dma_len(sg); | |
29950 | ||
29951 | + if (pmif->broken_dma && cur_addr & (L1_CACHE_BYTES - 1)) { | |
29952 | + if (pmif->broken_dma_warn == 0) { | |
29953 | + printk(KERN_WARNING "%s: DMA on non aligned address," | |
29954 | + "switching to PIO on Ohare chipset\n", drive->name); | |
29955 | + pmif->broken_dma_warn = 1; | |
29956 | + } | |
29957 | + goto use_pio_instead; | |
29958 | + } | |
29959 | while (cur_len) { | |
29960 | unsigned int tc = (cur_len < 0xfe00)? cur_len: 0xfe00; | |
29961 | ||
29962 | - if (++count >= MAX_DCMDS) { | |
29963 | + if (count++ >= MAX_DCMDS) { | |
29964 | printk(KERN_WARNING "%s: DMA table too small\n", | |
29965 | drive->name); | |
29966 | goto use_pio_instead; | |
29967 | @@ -1070,7 +1615,7 @@ | |
29968 | } | |
29969 | ||
29970 | /* Teardown mappings after DMA has completed. */ | |
29971 | -static void | |
29972 | +static void __pmac | |
29973 | pmac_ide_destroy_dmatable (ide_drive_t *drive) | |
29974 | { | |
29975 | struct pci_dev *dev = HWIF(drive)->pci_dev; | |
29976 | @@ -1081,67 +1626,25 @@ | |
29977 | if (nents) { | |
29978 | pci_unmap_sg(dev, sg, nents, pmif->sg_dma_direction); | |
29979 | pmif->sg_nents = 0; | |
29980 | + HWIF(drive)->sg_dma_active = 0; | |
29981 | } | |
29982 | } | |
29983 | ||
29984 | -static __inline__ unsigned char | |
29985 | -dma_bits_to_command(unsigned char bits) | |
29986 | -{ | |
29987 | - if(bits & 0x04) | |
29988 | - return XFER_MW_DMA_2; | |
29989 | - if(bits & 0x02) | |
29990 | - return XFER_MW_DMA_1; | |
29991 | - if(bits & 0x01) | |
29992 | - return XFER_MW_DMA_0; | |
29993 | - return 0; | |
29994 | -} | |
29995 | - | |
29996 | -static __inline__ unsigned char | |
29997 | -udma_bits_to_command(unsigned char bits, int high_speed) | |
29998 | -{ | |
29999 | - if (high_speed) { | |
30000 | - if(bits & 0x10) | |
30001 | - return XFER_UDMA_4; | |
30002 | - if(bits & 0x08) | |
30003 | - return XFER_UDMA_3; | |
30004 | - } | |
30005 | - if(bits & 0x04) | |
30006 | - return XFER_UDMA_2; | |
30007 | - if(bits & 0x02) | |
30008 | - return XFER_UDMA_1; | |
30009 | - if(bits & 0x01) | |
30010 | - return XFER_UDMA_0; | |
30011 | - return 0; | |
30012 | -} | |
30013 | - | |
30014 | /* Calculate MultiWord DMA timings */ | |
30015 | static int __pmac | |
30016 | -pmac_ide_mdma_enable(ide_drive_t *drive) | |
30017 | +pmac_ide_mdma_enable(ide_drive_t *drive, u16 mode) | |
30018 | { | |
30019 | - u8 bits = drive->id->dma_mword & 0x07; | |
30020 | - u8 feature = dma_bits_to_command(bits); | |
30021 | - u32 *timings; | |
30022 | + ide_hwif_t *hwif = HWIF(drive); | |
30023 | + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; | |
30024 | int drive_cycle_time; | |
30025 | struct hd_driveid *id = drive->id; | |
30026 | - pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; | |
30027 | + u32 *timings, *timings2; | |
30028 | + u32 timing_local[2]; | |
30029 | int ret; | |
30030 | ||
30031 | - /* Set feature on drive */ | |
30032 | - printk(KERN_INFO "%s: Enabling MultiWord DMA %d\n", drive->name, feature & 0xf); | |
30033 | - ret = pmac_ide_do_setfeature(drive, feature); | |
30034 | - if (ret) { | |
30035 | - printk(KERN_WARNING "%s: Failed !\n", drive->name); | |
30036 | - return 0; | |
30037 | - } | |
30038 | - | |
30039 | - if (!drive->init_speed) | |
30040 | - drive->init_speed = feature; | |
30041 | - | |
30042 | /* which drive is it ? */ | |
30043 | - if (drive->select.b.unit & 0x01) | |
30044 | - timings = &pmif->timings[1]; | |
30045 | - else | |
30046 | - timings = &pmif->timings[0]; | |
30047 | + timings = &pmif->timings[drive->select.b.unit & 0x01]; | |
30048 | + timings2 = &pmif->timings[(drive->select.b.unit & 0x01) + 2]; | |
30049 | ||
30050 | /* Check if drive provide explicit cycle time */ | |
30051 | if ((id->field_valid & 2) && (id->eide_dma_time)) | |
30052 | @@ -1149,201 +1652,220 @@ | |
30053 | else | |
30054 | drive_cycle_time = 0; | |
30055 | ||
30056 | + /* Copy timings to local image */ | |
30057 | + timing_local[0] = *timings; | |
30058 | + timing_local[1] = *timings2; | |
30059 | + | |
30060 | /* Calculate controller timings */ | |
30061 | - set_timings_mdma(pmif->kind, timings, feature, drive_cycle_time); | |
30062 | + ret = set_timings_mdma( drive, pmif->kind, | |
30063 | + &timing_local[0], | |
30064 | + &timing_local[1], | |
30065 | + mode, | |
30066 | + drive_cycle_time); | |
30067 | + if (ret) | |
30068 | + return 0; | |
30069 | + | |
30070 | + /* Set feature on drive */ | |
30071 | + printk(KERN_INFO "%s: Enabling MultiWord DMA %d\n", drive->name, mode & 0xf); | |
30072 | + ret = pmac_ide_do_setfeature(drive, mode); | |
30073 | + if (ret) { | |
30074 | + printk(KERN_WARNING "%s: Failed !\n", drive->name); | |
30075 | + return 0; | |
30076 | + } | |
30077 | + | |
30078 | + /* Apply timings to controller */ | |
30079 | + *timings = timing_local[0]; | |
30080 | + *timings2 = timing_local[1]; | |
30081 | + | |
30082 | + /* Set speed info in drive */ | |
30083 | + drive->current_speed = mode; | |
30084 | + if (!drive->init_speed) | |
30085 | + drive->init_speed = mode; | |
30086 | ||
30087 | - drive->current_speed = feature; | |
30088 | return 1; | |
30089 | } | |
30090 | ||
30091 | /* Calculate Ultra DMA timings */ | |
30092 | static int __pmac | |
30093 | -pmac_ide_udma_enable(ide_drive_t *drive, int high_speed) | |
30094 | +pmac_ide_udma_enable(ide_drive_t *drive, u16 mode) | |
30095 | { | |
30096 | - u8 bits = drive->id->dma_ultra & 0x1f; | |
30097 | - u8 feature = udma_bits_to_command(bits, high_speed); | |
30098 | - pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; | |
30099 | - u32 *timings; | |
30100 | + ide_hwif_t *hwif = HWIF(drive); | |
30101 | + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; | |
30102 | + u32 *timings, *timings2; | |
30103 | + u32 timing_local[2]; | |
30104 | int ret; | |
30105 | + | |
30106 | + /* which drive is it ? */ | |
30107 | + timings = &pmif->timings[drive->select.b.unit & 0x01]; | |
30108 | + timings2 = &pmif->timings[(drive->select.b.unit & 0x01) + 2]; | |
30109 | ||
30110 | + /* Copy timings to local image */ | |
30111 | + timing_local[0] = *timings; | |
30112 | + timing_local[1] = *timings2; | |
30113 | + | |
30114 | + /* Calculate timings for interface */ | |
30115 | + if (pmif->kind == controller_un_ata6) | |
30116 | + ret = set_timings_udma_ata6( &timing_local[0], | |
30117 | + &timing_local[1], | |
30118 | + mode); | |
30119 | + else | |
30120 | + ret = set_timings_udma_ata4(&timing_local[0], mode); | |
30121 | + if (ret) | |
30122 | + return 0; | |
30123 | + | |
30124 | /* Set feature on drive */ | |
30125 | - printk(KERN_INFO "%s: Enabling Ultra DMA %d\n", drive->name, feature & 0xf); | |
30126 | - ret = pmac_ide_do_setfeature(drive, feature); | |
30127 | + printk(KERN_INFO "%s: Enabling Ultra DMA %d\n", drive->name, mode & 0x0f); | |
30128 | + ret = pmac_ide_do_setfeature(drive, mode); | |
30129 | if (ret) { | |
30130 | printk(KERN_WARNING "%s: Failed !\n", drive->name); | |
30131 | return 0; | |
30132 | } | |
30133 | ||
30134 | - if (!drive->init_speed) | |
30135 | - drive->init_speed = feature; | |
30136 | + /* Apply timings to controller */ | |
30137 | + *timings = timing_local[0]; | |
30138 | + *timings2 = timing_local[1]; | |
30139 | ||
30140 | - /* which drive is it ? */ | |
30141 | - if (drive->select.b.unit & 0x01) | |
30142 | - timings = &pmif->timings[1]; | |
30143 | - else | |
30144 | - timings = &pmif->timings[0]; | |
30145 | - | |
30146 | - set_timings_udma(timings, feature); | |
30147 | + /* Set speed info in drive */ | |
30148 | + drive->current_speed = mode; | |
30149 | + if (!drive->init_speed) | |
30150 | + drive->init_speed = mode; | |
30151 | ||
30152 | - drive->current_speed = feature; | |
30153 | return 1; | |
30154 | } | |
30155 | ||
30156 | -int pmac_ide_dma_check(ide_drive_t *drive) | |
30157 | +static int __pmac | |
30158 | +pmac_ide_dma_check(ide_drive_t *drive) | |
30159 | { | |
30160 | - int ata4, udma; | |
30161 | struct hd_driveid *id = drive->id; | |
30162 | ide_hwif_t *hwif = HWIF(drive); | |
30163 | pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; | |
30164 | int enable = 1; | |
30165 | - | |
30166 | + int map; | |
30167 | drive->using_dma = 0; | |
30168 | ||
30169 | - if (pmif == NULL) | |
30170 | - return 0; | |
30171 | - | |
30172 | if (drive->media == ide_floppy) | |
30173 | enable = 0; | |
30174 | - if (((id->capability & 1) == 0) && | |
30175 | - !HWIF(drive)->ide_dma_good_drive(drive)) | |
30176 | + if (((id->capability & 1) == 0) && !__ide_dma_good_drive(drive)) | |
30177 | enable = 0; | |
30178 | - if (HWIF(drive)->ide_dma_bad_drive(drive)) | |
30179 | + if (__ide_dma_bad_drive(drive)) | |
30180 | enable = 0; | |
30181 | - udma = 0; | |
30182 | - ata4 = (pmif->kind == controller_kl_ata4 || | |
30183 | - pmif->kind == controller_kl_ata4_80); | |
30184 | - | |
30185 | - if(enable) { | |
30186 | - if (ata4 && (drive->media == ide_disk) && | |
30187 | - (id->field_valid & 0x0004) && (id->dma_ultra & 0x1f)) { | |
30188 | - /* UltraDMA modes. */ | |
30189 | - drive->using_dma = pmac_ide_udma_enable(drive, | |
30190 | - pmif->kind == controller_kl_ata4_80); | |
30191 | - } | |
30192 | - if (!drive->using_dma && (id->dma_mword & 0x0007)) { | |
30193 | - /* Normal MultiWord DMA modes. */ | |
30194 | - drive->using_dma = pmac_ide_mdma_enable(drive); | |
30195 | + | |
30196 | + if (enable) { | |
30197 | + short mode; | |
30198 | + | |
30199 | + map = XFER_MWDMA; | |
30200 | + if (pmif->kind == controller_kl_ata4 || pmif->kind == controller_un_ata6) { | |
30201 | + map |= XFER_UDMA; | |
30202 | + if (pmif->cable_80) { | |
30203 | + map |= XFER_UDMA_66; | |
30204 | + if (pmif->kind == controller_un_ata6) | |
30205 | + map |= XFER_UDMA_100; | |
30206 | + } | |
30207 | } | |
30208 | + mode = ide_find_best_mode(drive, map); | |
30209 | + if (mode & XFER_UDMA) | |
30210 | + drive->using_dma = pmac_ide_udma_enable(drive, mode); | |
30211 | + else if (mode & XFER_MWDMA) | |
30212 | + drive->using_dma = pmac_ide_mdma_enable(drive, mode); | |
30213 | hwif->OUTB(0, IDE_CONTROL_REG); | |
30214 | /* Apply settings to controller */ | |
30215 | - pmac_ide_selectproc(drive); | |
30216 | + pmac_ide_do_update_timings(drive); | |
30217 | } | |
30218 | return 0; | |
30219 | } | |
30220 | ||
30221 | -static int | |
30222 | -pmac_ide_dma_read (ide_drive_t *drive) | |
30223 | +static int __pmac | |
30224 | +pmac_ide_dma_start(ide_drive_t *drive, int reading) | |
30225 | { | |
30226 | ide_hwif_t *hwif = HWIF(drive); | |
30227 | pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; | |
30228 | struct request *rq = HWGROUP(drive)->rq; | |
30229 | -// ide_task_t *args = rq->special; | |
30230 | u8 unit = (drive->select.b.unit & 0x01); | |
30231 | u8 ata4; | |
30232 | - u8 lba48 = (drive->addressing == 1) ? 1 : 0; | |
30233 | - task_ioreg_t command = WIN_NOP; | |
30234 | ||
30235 | if (pmif == NULL) | |
30236 | return 1; | |
30237 | + ata4 = (pmif->kind == controller_kl_ata4); | |
30238 | ||
30239 | - ata4 = (pmif->kind == controller_kl_ata4 || | |
30240 | - pmif->kind == controller_kl_ata4_80); | |
30241 | - | |
30242 | - if (!pmac_ide_build_dmatable(drive, 0)) | |
30243 | + if (!pmac_ide_build_dmatable(drive, rq)) | |
30244 | return 1; | |
30245 | + | |
30246 | /* Apple adds 60ns to wrDataSetup on reads */ | |
30247 | if (ata4 && (pmif->timings[unit] & TR_66_UDMA_EN)) { | |
30248 | - writel(pmif->timings[unit]+0x00800000UL, | |
30249 | + writel(pmif->timings[unit] + (reading ? 0x00800000UL : 0), | |
30250 | (unsigned *)(IDE_DATA_REG+IDE_TIMING_CONFIG)); | |
30251 | (void)readl((unsigned *)(IDE_DATA_REG + IDE_TIMING_CONFIG)); | |
30252 | } | |
30253 | + | |
30254 | drive->waiting_for_dma = 1; | |
30255 | + | |
30256 | + return 0; | |
30257 | +} | |
30258 | + | |
30259 | +static int __pmac | |
30260 | +pmac_ide_dma_read(ide_drive_t *drive) | |
30261 | +{ | |
30262 | + struct request *rq = HWGROUP(drive)->rq; | |
30263 | + u8 lba48 = (drive->addressing == 1) ? 1 : 0; | |
30264 | + task_ioreg_t command = WIN_NOP; | |
30265 | + | |
30266 | + if (pmac_ide_dma_start(drive, 1)) | |
30267 | + return 1; | |
30268 | + | |
30269 | if (drive->media != ide_disk) | |
30270 | return 0; | |
30271 | - if (HWGROUP(drive)->handler != NULL) /* paranoia check */ | |
30272 | - BUG(); | |
30273 | - ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); | |
30274 | - /* | |
30275 | - * FIX ME to use only ACB ide_task_t args Struct | |
30276 | - */ | |
30277 | -#if 0 | |
30278 | - { | |
30279 | - ide_task_t *args = rq->special; | |
30280 | - command = args->tfRegister[IDE_COMMAND_OFFSET]; | |
30281 | - } | |
30282 | -#else | |
30283 | + | |
30284 | command = (lba48) ? WIN_READDMA_EXT : WIN_READDMA; | |
30285 | + | |
30286 | + if (drive->vdma) | |
30287 | + command = (lba48) ? WIN_READ_EXT: WIN_READ; | |
30288 | + | |
30289 | if (rq->flags & REQ_DRIVE_TASKFILE) { | |
30290 | ide_task_t *args = rq->special; | |
30291 | command = args->tfRegister[IDE_COMMAND_OFFSET]; | |
30292 | } | |
30293 | -#endif | |
30294 | + | |
30295 | /* issue cmd to drive */ | |
30296 | - hwif->OUTB(command, IDE_COMMAND_REG); | |
30297 | + ide_execute_command(drive, command, &ide_dma_intr, 2*WAIT_CMD, NULL); | |
30298 | ||
30299 | return pmac_ide_dma_begin(drive); | |
30300 | } | |
30301 | ||
30302 | -static int | |
30303 | +static int __pmac | |
30304 | pmac_ide_dma_write (ide_drive_t *drive) | |
30305 | { | |
30306 | - ide_hwif_t *hwif = HWIF(drive); | |
30307 | - pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; | |
30308 | struct request *rq = HWGROUP(drive)->rq; | |
30309 | -// ide_task_t *args = rq->special; | |
30310 | - u8 unit = (drive->select.b.unit & 0x01); | |
30311 | - u8 ata4; | |
30312 | u8 lba48 = (drive->addressing == 1) ? 1 : 0; | |
30313 | task_ioreg_t command = WIN_NOP; | |
30314 | ||
30315 | - if (pmif == NULL) | |
30316 | + if (pmac_ide_dma_start(drive, 0)) | |
30317 | return 1; | |
30318 | ||
30319 | - ata4 = (pmif->kind == controller_kl_ata4 || | |
30320 | - pmif->kind == controller_kl_ata4_80); | |
30321 | - | |
30322 | - if (!pmac_ide_build_dmatable(drive, 1)) | |
30323 | - return 1; | |
30324 | - /* Apple adds 60ns to wrDataSetup on reads */ | |
30325 | - if (ata4 && (pmif->timings[unit] & TR_66_UDMA_EN)) { | |
30326 | - writel(pmif->timings[unit], | |
30327 | - (unsigned *)(IDE_DATA_REG+IDE_TIMING_CONFIG)); | |
30328 | - (void)readl((unsigned *)(IDE_DATA_REG + IDE_TIMING_CONFIG)); | |
30329 | - } | |
30330 | - drive->waiting_for_dma = 1; | |
30331 | if (drive->media != ide_disk) | |
30332 | return 0; | |
30333 | - if (HWGROUP(drive)->handler != NULL) /* paranoia check */ | |
30334 | - BUG(); | |
30335 | - ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); | |
30336 | - /* | |
30337 | - * FIX ME to use only ACB ide_task_t args Struct | |
30338 | - */ | |
30339 | -#if 0 | |
30340 | - { | |
30341 | - ide_task_t *args = rq->special; | |
30342 | - command = args->tfRegister[IDE_COMMAND_OFFSET]; | |
30343 | - } | |
30344 | -#else | |
30345 | + | |
30346 | command = (lba48) ? WIN_WRITEDMA_EXT : WIN_WRITEDMA; | |
30347 | + if (drive->vdma) | |
30348 | + command = (lba48) ? WIN_WRITE_EXT: WIN_WRITE; | |
30349 | + | |
30350 | if (rq->flags & REQ_DRIVE_TASKFILE) { | |
30351 | ide_task_t *args = rq->special; | |
30352 | command = args->tfRegister[IDE_COMMAND_OFFSET]; | |
30353 | } | |
30354 | -#endif | |
30355 | + | |
30356 | /* issue cmd to drive */ | |
30357 | - hwif->OUTB(command, IDE_COMMAND_REG); | |
30358 | + ide_execute_command(drive, command, &ide_dma_intr, 2*WAIT_CMD, NULL); | |
30359 | ||
30360 | return pmac_ide_dma_begin(drive); | |
30361 | } | |
30362 | ||
30363 | -static int | |
30364 | +static int __pmac | |
30365 | pmac_ide_dma_count (ide_drive_t *drive) | |
30366 | { | |
30367 | return HWIF(drive)->ide_dma_begin(drive); | |
30368 | } | |
30369 | ||
30370 | -static int | |
30371 | +static int __pmac | |
30372 | pmac_ide_dma_begin (ide_drive_t *drive) | |
30373 | { | |
30374 | pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; | |
30375 | @@ -1359,7 +1881,7 @@ | |
30376 | return 0; | |
30377 | } | |
30378 | ||
30379 | -static int | |
30380 | +static int __pmac | |
30381 | pmac_ide_dma_end (ide_drive_t *drive) | |
30382 | { | |
30383 | pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; | |
30384 | @@ -1378,7 +1900,7 @@ | |
30385 | return (dstat & (RUN|DEAD|ACTIVE)) != RUN; | |
30386 | } | |
30387 | ||
30388 | -static int | |
30389 | +static int __pmac | |
30390 | pmac_ide_dma_test_irq (ide_drive_t *drive) | |
30391 | { | |
30392 | pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; | |
30393 | @@ -1418,33 +1940,33 @@ | |
30394 | return 1; | |
30395 | if (!drive->waiting_for_dma) | |
30396 | printk(KERN_WARNING "ide%d, ide_dma_test_irq \ | |
30397 | - called while not waiting\n", pmif->index); | |
30398 | + called while not waiting\n", HWIF(drive)->index); | |
30399 | ||
30400 | /* If dbdma didn't execute the STOP command yet, the | |
30401 | * active bit is still set */ | |
30402 | drive->waiting_for_dma++; | |
30403 | if (drive->waiting_for_dma >= DMA_WAIT_TIMEOUT) { | |
30404 | printk(KERN_WARNING "ide%d, timeout waiting \ | |
30405 | - for dbdma command stop\n", pmif->index); | |
30406 | + for dbdma command stop\n", HWIF(drive)->index); | |
30407 | return 1; | |
30408 | } | |
30409 | - udelay(1); | |
30410 | + udelay(5); | |
30411 | return 0; | |
30412 | } | |
30413 | ||
30414 | -static int | |
30415 | +static int __pmac | |
30416 | pmac_ide_dma_host_off (ide_drive_t *drive) | |
30417 | { | |
30418 | return 0; | |
30419 | } | |
30420 | ||
30421 | -static int | |
30422 | +static int __pmac | |
30423 | pmac_ide_dma_host_on (ide_drive_t *drive) | |
30424 | { | |
30425 | return 0; | |
30426 | } | |
30427 | ||
30428 | -static int | |
30429 | +static int __pmac | |
30430 | pmac_ide_dma_lostirq (ide_drive_t *drive) | |
30431 | { | |
30432 | pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; | |
30433 | @@ -1461,316 +1983,87 @@ | |
30434 | } | |
30435 | ||
30436 | static void __init | |
30437 | -pmac_ide_setup_dma(struct device_node *np, int ix) | |
30438 | +pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif) | |
30439 | { | |
30440 | - struct pmac_ide_hwif *pmif = &pmac_ide[ix]; | |
30441 | - | |
30442 | - if (request_OF_resource(np, 1, " (mac-io IDE DMA)") == NULL) { | |
30443 | - printk(KERN_ERR "ide-pmac(%s): can't request DMA resource !\n", np->name); | |
30444 | + /* We won't need pci_dev if we switch to generic consistent | |
30445 | + * DMA routines ... | |
30446 | + */ | |
30447 | + if (hwif->pci_dev == NULL) | |
30448 | return; | |
30449 | - } | |
30450 | - | |
30451 | - pmif->dma_regs = | |
30452 | - (volatile struct dbdma_regs*)ioremap(np->addrs[1].address, 0x200); | |
30453 | - | |
30454 | /* | |
30455 | * Allocate space for the DBDMA commands. | |
30456 | * The +2 is +1 for the stop command and +1 to allow for | |
30457 | * aligning the start address to a multiple of 16 bytes. | |
30458 | */ | |
30459 | pmif->dma_table_cpu = (struct dbdma_cmd*)pci_alloc_consistent( | |
30460 | - ide_hwifs[ix].pci_dev, | |
30461 | + hwif->pci_dev, | |
30462 | (MAX_DCMDS + 2) * sizeof(struct dbdma_cmd), | |
30463 | &pmif->dma_table_dma); | |
30464 | if (pmif->dma_table_cpu == NULL) { | |
30465 | printk(KERN_ERR "%s: unable to allocate DMA command list\n", | |
30466 | - ide_hwifs[ix].name); | |
30467 | + hwif->name); | |
30468 | return; | |
30469 | } | |
30470 | ||
30471 | pmif->sg_table = kmalloc(sizeof(struct scatterlist) * MAX_DCMDS, | |
30472 | GFP_KERNEL); | |
30473 | if (pmif->sg_table == NULL) { | |
30474 | - pci_free_consistent( ide_hwifs[ix].pci_dev, | |
30475 | + pci_free_consistent( hwif->pci_dev, | |
30476 | (MAX_DCMDS + 2) * sizeof(struct dbdma_cmd), | |
30477 | pmif->dma_table_cpu, pmif->dma_table_dma); | |
30478 | return; | |
30479 | } | |
30480 | - ide_hwifs[ix].ide_dma_off = &__ide_dma_off; | |
30481 | - ide_hwifs[ix].ide_dma_off_quietly = &__ide_dma_off_quietly; | |
30482 | - ide_hwifs[ix].ide_dma_on = &__ide_dma_on; | |
30483 | - ide_hwifs[ix].ide_dma_check = &pmac_ide_dma_check; | |
30484 | - ide_hwifs[ix].ide_dma_read = &pmac_ide_dma_read; | |
30485 | - ide_hwifs[ix].ide_dma_write = &pmac_ide_dma_write; | |
30486 | - ide_hwifs[ix].ide_dma_count = &pmac_ide_dma_count; | |
30487 | - ide_hwifs[ix].ide_dma_begin = &pmac_ide_dma_begin; | |
30488 | - ide_hwifs[ix].ide_dma_end = &pmac_ide_dma_end; | |
30489 | - ide_hwifs[ix].ide_dma_test_irq = &pmac_ide_dma_test_irq; | |
30490 | - ide_hwifs[ix].ide_dma_host_off = &pmac_ide_dma_host_off; | |
30491 | - ide_hwifs[ix].ide_dma_host_on = &pmac_ide_dma_host_on; | |
30492 | - ide_hwifs[ix].ide_dma_good_drive = &__ide_dma_good_drive; | |
30493 | - ide_hwifs[ix].ide_dma_bad_drive = &__ide_dma_bad_drive; | |
30494 | - ide_hwifs[ix].ide_dma_verbose = &__ide_dma_verbose; | |
30495 | - ide_hwifs[ix].ide_dma_timeout = &__ide_dma_timeout; | |
30496 | - ide_hwifs[ix].ide_dma_retune = &__ide_dma_retune; | |
30497 | - ide_hwifs[ix].ide_dma_lostirq = &pmac_ide_dma_lostirq; | |
30498 | - ide_hwifs[ix].ide_dma_queued_on = &__ide_dma_queued_on; | |
30499 | - ide_hwifs[ix].ide_dma_queued_off = &__ide_dma_queued_off; | |
30500 | + hwif->ide_dma_off = &__ide_dma_off; | |
30501 | + hwif->ide_dma_off_quietly = &__ide_dma_off_quietly; | |
30502 | + hwif->ide_dma_on = &__ide_dma_on; | |
30503 | + hwif->ide_dma_check = &pmac_ide_dma_check; | |
30504 | + hwif->ide_dma_read = &pmac_ide_dma_read; | |
30505 | + hwif->ide_dma_write = &pmac_ide_dma_write; | |
30506 | + hwif->ide_dma_count = &pmac_ide_dma_count; | |
30507 | + hwif->ide_dma_begin = &pmac_ide_dma_begin; | |
30508 | + hwif->ide_dma_end = &pmac_ide_dma_end; | |
30509 | + hwif->ide_dma_test_irq = &pmac_ide_dma_test_irq; | |
30510 | + hwif->ide_dma_host_off = &pmac_ide_dma_host_off; | |
30511 | + hwif->ide_dma_host_on = &pmac_ide_dma_host_on; | |
30512 | + hwif->ide_dma_good_drive = &__ide_dma_good_drive; | |
30513 | + hwif->ide_dma_bad_drive = &__ide_dma_bad_drive; | |
30514 | + hwif->ide_dma_verbose = &__ide_dma_verbose; | |
30515 | + hwif->ide_dma_timeout = &__ide_dma_timeout; | |
30516 | + hwif->ide_dma_retune = &__ide_dma_retune; | |
30517 | + hwif->ide_dma_lostirq = &pmac_ide_dma_lostirq; | |
30518 | + hwif->ide_dma_queued_on = &__ide_dma_queued_on; | |
30519 | + hwif->ide_dma_queued_off = &__ide_dma_queued_off; | |
30520 | +#ifdef CONFIG_BLK_DEV_IDE_TCQ | |
30521 | + hwif->ide_dma_queued_read = __ide_dma_queued_read; | |
30522 | + hwif->ide_dma_queued_write = __ide_dma_queued_write; | |
30523 | + hwif->ide_dma_queued_start = __ide_dma_queued_start; | |
30524 | +#endif | |
30525 | ||
30526 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO | |
30527 | if (!noautodma) | |
30528 | - ide_hwifs[ix].autodma = 1; | |
30529 | + hwif->autodma = 1; | |
30530 | #endif | |
30531 | - ide_hwifs[ix].drives[0].autodma = ide_hwifs[ix].autodma; | |
30532 | - ide_hwifs[ix].drives[1].autodma = ide_hwifs[ix].autodma; | |
30533 | -} | |
30534 | - | |
30535 | -#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ | |
30536 | - | |
30537 | -static void __pmac | |
30538 | -idepmac_sleep_device(ide_drive_t *drive, unsigned base) | |
30539 | -{ | |
30540 | - ide_hwif_t *hwif = HWIF(drive); | |
30541 | - int j; | |
30542 | - | |
30543 | - /* FIXME: We only handle the master IDE disk, we shoud | |
30544 | - * try to fix CD-ROMs here | |
30545 | - */ | |
30546 | - switch (drive->media) { | |
30547 | - case ide_disk: | |
30548 | - /* Spin down the drive */ | |
30549 | - hwif->OUTB(drive->select.all, base+0x60); | |
30550 | - (void) hwif->INB(base+0x60); | |
30551 | - udelay(100); | |
30552 | - hwif->OUTB(0x0, base+0x30); | |
30553 | - hwif->OUTB(0x0, base+0x20); | |
30554 | - hwif->OUTB(0x0, base+0x40); | |
30555 | - hwif->OUTB(0x0, base+0x50); | |
30556 | - hwif->OUTB(0xe0, base+0x70); | |
30557 | - hwif->OUTB(0x2, base+0x160); | |
30558 | - for (j = 0; j < 10; j++) { | |
30559 | - u8 status; | |
30560 | - mdelay(100); | |
30561 | - status = hwif->INB(base+0x70); | |
30562 | - if (!(status & BUSY_STAT) && (status & DRQ_STAT)) | |
30563 | - break; | |
30564 | - } | |
30565 | - break; | |
30566 | - case ide_cdrom: | |
30567 | - // todo | |
30568 | - break; | |
30569 | - case ide_floppy: | |
30570 | - // todo | |
30571 | - break; | |
30572 | - } | |
30573 | -} | |
30574 | - | |
30575 | -#ifdef CONFIG_PMAC_PBOOK | |
30576 | -static void __pmac | |
30577 | -idepmac_wake_device(ide_drive_t *drive, int used_dma) | |
30578 | -{ | |
30579 | - /* We force the IDE subdriver to check for a media change | |
30580 | - * This must be done first or we may lost the condition | |
30581 | - * | |
30582 | - * Problem: This can schedule. I moved the block device | |
30583 | - * wakeup almost late by priority because of that. | |
30584 | - */ | |
30585 | - //if (DRIVER(drive)) | |
30586 | - // check_disk_change(MKDEV(drive->disk->major, drive->disk->first_minor)); | |
30587 | - | |
30588 | -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC | |
30589 | - /* We re-enable DMA on the drive if it was active. */ | |
30590 | - /* This doesn't work with the CD-ROM in the media-bay, probably | |
30591 | - * because of a pending unit attention. The problem if that if I | |
30592 | - * clear the error, the filesystem dies. | |
30593 | - */ | |
30594 | - if (used_dma && !ide_spin_wait_hwgroup(drive)) { | |
30595 | - /* Lock HW group */ | |
30596 | - HWGROUP(drive)->busy = 1; | |
30597 | - pmac_ide_dma_check(drive); | |
30598 | - HWGROUP(drive)->busy = 0; | |
30599 | - if (!list_empty(&drive->queue.queue_head)) | |
30600 | - ide_do_request(HWGROUP(drive), 0); | |
30601 | - spin_unlock_irq(&ide_lock); | |
30602 | - } | |
30603 | -#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ | |
30604 | -} | |
30605 | - | |
30606 | -static void __pmac | |
30607 | -idepmac_sleep_interface(pmac_ide_hwif_t *pmif, unsigned base, int mediabay) | |
30608 | -{ | |
30609 | - struct device_node* np = pmif->node; | |
30610 | - | |
30611 | - /* We clear the timings */ | |
30612 | - pmif->timings[0] = 0; | |
30613 | - pmif->timings[1] = 0; | |
30614 | - | |
30615 | - /* The media bay will handle itself just fine */ | |
30616 | - if (mediabay) | |
30617 | - return; | |
30618 | - | |
30619 | - /* Disable the bus */ | |
30620 | - ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmif->aapl_bus_id, 0); | |
30621 | -} | |
30622 | + hwif->drives[0].autodma = hwif->autodma; | |
30623 | + hwif->drives[1].autodma = hwif->autodma; | |
30624 | ||
30625 | -static void __pmac | |
30626 | -idepmac_wake_interface(pmac_ide_hwif_t *pmif, unsigned long base, int mediabay) | |
30627 | -{ | |
30628 | - struct device_node* np = pmif->node; | |
30629 | - | |
30630 | - if (!mediabay) { | |
30631 | - /* Revive IDE disk and controller */ | |
30632 | - ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 1); | |
30633 | - ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmif->aapl_bus_id, 1); | |
30634 | - mdelay(10); | |
30635 | - ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 0); | |
30636 | - } | |
30637 | -} | |
30638 | - | |
30639 | -static void | |
30640 | -idepmac_sleep_drive(ide_drive_t *drive, unsigned long base) | |
30641 | -{ | |
30642 | - int unlock = 0; | |
30643 | - | |
30644 | - /* Wait for HW group to complete operations */ | |
30645 | - if (ide_spin_wait_hwgroup(drive)) { | |
30646 | - // What can we do here ? Wake drive we had already | |
30647 | - // put to sleep and return an error ? | |
30648 | - } else { | |
30649 | - unlock = 1; | |
30650 | - /* Lock HW group */ | |
30651 | - HWGROUP(drive)->busy = 1; | |
30652 | - /* Stop the device */ | |
30653 | - idepmac_sleep_device(drive, base); | |
30654 | - } | |
30655 | - if (unlock) | |
30656 | - spin_unlock_irq(&ide_lock); | |
30657 | -} | |
30658 | - | |
30659 | -static void | |
30660 | -idepmac_wake_drive(ide_drive_t *drive, unsigned long base) | |
30661 | -{ | |
30662 | - ide_hwif_t *hwif = HWIF(drive); | |
30663 | - unsigned long flags; | |
30664 | - int j; | |
30665 | - | |
30666 | - /* Reset timings */ | |
30667 | - pmac_ide_selectproc(drive); | |
30668 | - mdelay(10); | |
30669 | - | |
30670 | - /* Wait up to 20 seconds for the drive to be ready */ | |
30671 | - for (j = 0; j < 200; j++) { | |
30672 | - u8 status = 0; | |
30673 | - mdelay(100); | |
30674 | - hwif->OUTB(drive->select.all, base + 0x60); | |
30675 | - if ((hwif->INB(base + 0x60)) != drive->select.all) | |
30676 | - continue; | |
30677 | - status = hwif->INB(base + 0x70); | |
30678 | - if (!(status & BUSY_STAT)) | |
30679 | + hwif->atapi_dma = 1; | |
30680 | + switch(pmif->kind) { | |
30681 | + case controller_un_ata6: | |
30682 | + hwif->ultra_mask = pmif->cable_80 ? 0x3f : 0x07; | |
30683 | + hwif->mwdma_mask = 0x07; | |
30684 | + hwif->swdma_mask = 0x00; | |
30685 | break; | |
30686 | - } | |
30687 | - | |
30688 | - /* We resume processing on the HW group */ | |
30689 | - spin_lock_irqsave(&ide_lock, flags); | |
30690 | - HWGROUP(drive)->busy = 0; | |
30691 | - if (!list_empty(&drive->queue.queue_head)) | |
30692 | - ide_do_request(HWGROUP(drive), 0); | |
30693 | - spin_unlock_irqrestore(&ide_lock, flags); | |
30694 | + case controller_kl_ata4: | |
30695 | + hwif->ultra_mask = pmif->cable_80 ? 0x1f : 0x07; | |
30696 | + hwif->mwdma_mask = 0x07; | |
30697 | + hwif->swdma_mask = 0x00; | |
30698 | + break; | |
30699 | + default: | |
30700 | + hwif->ultra_mask = 0x00; | |
30701 | + hwif->mwdma_mask = 0x07; | |
30702 | + hwif->swdma_mask = 0x00; | |
30703 | + break; | |
30704 | + } | |
30705 | } | |
30706 | ||
30707 | -/* Note: We support only master drives for now. This will have to be | |
30708 | - * improved if we want to handle sleep on the iMacDV where the CD-ROM | |
30709 | - * is a slave | |
30710 | - */ | |
30711 | -static int __pmac | |
30712 | -idepmac_notify_sleep(struct pmu_sleep_notifier *self, int when) | |
30713 | -{ | |
30714 | - int i, ret; | |
30715 | - unsigned long base; | |
30716 | - int big_delay; | |
30717 | - | |
30718 | - switch (when) { | |
30719 | - case PBOOK_SLEEP_REQUEST: | |
30720 | - break; | |
30721 | - case PBOOK_SLEEP_REJECT: | |
30722 | - break; | |
30723 | - case PBOOK_SLEEP_NOW: | |
30724 | - for (i = 0; i < pmac_ide_count; ++i) { | |
30725 | - ide_hwif_t *hwif; | |
30726 | - int dn; | |
30727 | - | |
30728 | - if ((base = pmac_ide[i].regbase) == 0) | |
30729 | - continue; | |
30730 | - | |
30731 | - hwif = &ide_hwifs[i]; | |
30732 | - for (dn=0; dn<MAX_DRIVES; dn++) { | |
30733 | - if (!hwif->drives[dn].present) | |
30734 | - continue; | |
30735 | - idepmac_sleep_drive(&hwif->drives[dn], base); | |
30736 | - } | |
30737 | - /* Disable irq during sleep */ | |
30738 | - disable_irq(pmac_ide[i].irq); | |
30739 | - | |
30740 | - /* Check if this is a media bay with an IDE device or not | |
30741 | - * a media bay. | |
30742 | - */ | |
30743 | - ret = check_media_bay_by_base(base, MB_CD); | |
30744 | - if ((ret == 0) || (ret == -ENODEV)) | |
30745 | - idepmac_sleep_interface(&pmac_ide[i], base, (ret == 0)); | |
30746 | - } | |
30747 | - break; | |
30748 | - case PBOOK_WAKE: | |
30749 | - big_delay = 0; | |
30750 | - for (i = 0; i < pmac_ide_count; ++i) { | |
30751 | - | |
30752 | - if ((base = pmac_ide[i].regbase) == 0) | |
30753 | - continue; | |
30754 | - | |
30755 | - /* Make sure we have sane timings */ | |
30756 | - sanitize_timings(&pmac_ide[i]); | |
30757 | - | |
30758 | - /* Check if this is a media bay with an IDE device or not | |
30759 | - * a media bay | |
30760 | - */ | |
30761 | - ret = check_media_bay_by_base(base, MB_CD); | |
30762 | - if ((ret == 0) || (ret == -ENODEV)) { | |
30763 | - idepmac_wake_interface(&pmac_ide[i], base, (ret == 0)); | |
30764 | - big_delay = 1; | |
30765 | - } | |
30766 | - | |
30767 | - } | |
30768 | - /* Let hardware get up to speed */ | |
30769 | - if (big_delay) | |
30770 | - mdelay(IDE_WAKEUP_DELAY_MS); | |
30771 | - | |
30772 | - for (i = 0; i < pmac_ide_count; ++i) { | |
30773 | - ide_hwif_t *hwif; | |
30774 | - int used_dma, dn; | |
30775 | - int irq_on = 0; | |
30776 | - | |
30777 | - if ((base = pmac_ide[i].regbase) == 0) | |
30778 | - continue; | |
30779 | - | |
30780 | - hwif = &ide_hwifs[i]; | |
30781 | - for (dn=0; dn<MAX_DRIVES; dn++) { | |
30782 | - ide_drive_t *drive = &hwif->drives[dn]; | |
30783 | - if (!drive->present) | |
30784 | - continue; | |
30785 | - /* We don't have re-configured DMA yet */ | |
30786 | - used_dma = drive->using_dma; | |
30787 | - drive->using_dma = 0; | |
30788 | - idepmac_wake_drive(drive, base); | |
30789 | - if (!irq_on) { | |
30790 | - enable_irq(pmac_ide[i].irq); | |
30791 | - irq_on = 1; | |
30792 | - } | |
30793 | - idepmac_wake_device(drive, used_dma); | |
30794 | - } | |
30795 | - if (!irq_on) | |
30796 | - enable_irq(pmac_ide[i].irq); | |
30797 | - } | |
30798 | - break; | |
30799 | - } | |
30800 | - return PBOOK_SLEEP_OK; | |
30801 | -} | |
30802 | -#endif /* CONFIG_PMAC_PBOOK */ | |
30803 | +#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ | |
30804 | diff -Nru a/drivers/ieee1394/csr.c b/drivers/ieee1394/csr.c | |
30805 | --- a/drivers/ieee1394/csr.c Wed Aug 20 14:21:56 2003 | |
30806 | +++ b/drivers/ieee1394/csr.c Mon Sep 1 17:00:00 2003 | |
30807 | @@ -21,6 +21,7 @@ | |
30808 | #include <linux/module.h> | |
30809 | #include <linux/moduleparam.h> | |
30810 | #include <linux/param.h> | |
30811 | +#include <linux/spinlock.h> | |
30812 | ||
30813 | #include "ieee1394_types.h" | |
30814 | #include "hosts.h" | |
30815 | diff -Nru a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c | |
30816 | --- a/drivers/ieee1394/eth1394.c Tue Aug 19 20:56:01 2003 | |
30817 | +++ b/drivers/ieee1394/eth1394.c Mon Sep 1 17:00:00 2003 | |
30818 | @@ -89,7 +89,7 @@ | |
30819 | #define TRACE() printk(KERN_ERR "%s:%s[%d] ---- TRACE\n", driver_name, __FUNCTION__, __LINE__) | |
30820 | ||
30821 | static char version[] __devinitdata = | |
30822 | - "$Rev: 1020 $ Ben Collins <bcollins@debian.org>"; | |
30823 | + "$Rev: 1043 $ Ben Collins <bcollins@debian.org>"; | |
30824 | ||
30825 | struct fragment_info { | |
30826 | struct list_head list; | |
30827 | @@ -1349,21 +1349,20 @@ | |
30828 | ptask->dest_node, | |
30829 | ptask->addr, ptask->skb->data, | |
30830 | tx_len)) { | |
30831 | - goto fail; | |
30832 | + free_hpsb_packet(packet); | |
30833 | + return -1; | |
30834 | } | |
30835 | ||
30836 | ptask->packet = packet; | |
30837 | hpsb_set_packet_complete_task(ptask->packet, ether1394_complete_cb, | |
30838 | ptask); | |
30839 | ||
30840 | - if (hpsb_send_packet(packet)) | |
30841 | - return 0; | |
30842 | - | |
30843 | -fail: | |
30844 | - if (packet) | |
30845 | + if (!hpsb_send_packet(packet)) { | |
30846 | ether1394_free_packet(packet); | |
30847 | + return -1; | |
30848 | + } | |
30849 | ||
30850 | - return -1; | |
30851 | + return 0; | |
30852 | } | |
30853 | ||
30854 | ||
30855 | @@ -1600,7 +1599,7 @@ | |
30856 | case ETHTOOL_GDRVINFO: { | |
30857 | struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; | |
30858 | strcpy (info.driver, driver_name); | |
30859 | - strcpy (info.version, "$Rev: 1020 $"); | |
30860 | + strcpy (info.version, "$Rev: 1043 $"); | |
30861 | /* FIXME XXX provide sane businfo */ | |
30862 | strcpy (info.bus_info, "ieee1394"); | |
30863 | if (copy_to_user (useraddr, &info, sizeof (info))) | |
30864 | diff -Nru a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c | |
30865 | --- a/drivers/ieee1394/ieee1394_core.c Sun Aug 3 17:00:00 2003 | |
30866 | +++ b/drivers/ieee1394/ieee1394_core.c Mon Sep 1 17:00:00 2003 | |
30867 | @@ -1124,7 +1124,7 @@ | |
30868 | to get the index of the ieee1394_driver | |
30869 | we want */ | |
30870 | ||
30871 | - blocknum = (minor(inode->i_rdev) >> 4) & 0xF; | |
30872 | + blocknum = (iminor(inode) >> 4) & 0xF; | |
30873 | ||
30874 | /* look up the driver */ | |
30875 | ||
30876 | @@ -1237,6 +1237,7 @@ | |
30877 | EXPORT_SYMBOL(hpsb_free_tlabel); | |
30878 | EXPORT_SYMBOL(hpsb_make_readpacket); | |
30879 | EXPORT_SYMBOL(hpsb_make_writepacket); | |
30880 | +EXPORT_SYMBOL(hpsb_make_streampacket); | |
30881 | EXPORT_SYMBOL(hpsb_make_lockpacket); | |
30882 | EXPORT_SYMBOL(hpsb_make_lock64packet); | |
30883 | EXPORT_SYMBOL(hpsb_make_phypacket); | |
30884 | diff -Nru a/drivers/ieee1394/ieee1394_core.h b/drivers/ieee1394/ieee1394_core.h | |
30885 | --- a/drivers/ieee1394/ieee1394_core.h Thu Jul 24 17:00:00 2003 | |
30886 | +++ b/drivers/ieee1394/ieee1394_core.h Tue Aug 26 09:25:41 2003 | |
30887 | @@ -202,7 +202,7 @@ | |
30888 | /* return the index (within a minor number block) of a file */ | |
30889 | static inline unsigned char ieee1394_file_to_instance(struct file *file) | |
30890 | { | |
30891 | - unsigned char minor = minor(file->f_dentry->d_inode->i_rdev); | |
30892 | + unsigned char minor = iminor(file->f_dentry->d_inode); | |
30893 | ||
30894 | /* return lower 4 bits */ | |
30895 | return minor & 0xF; | |
30896 | diff -Nru a/drivers/ieee1394/ieee1394_transactions.c b/drivers/ieee1394/ieee1394_transactions.c | |
30897 | --- a/drivers/ieee1394/ieee1394_transactions.c Tue Aug 5 10:11:00 2003 | |
30898 | +++ b/drivers/ieee1394/ieee1394_transactions.c Mon Sep 1 17:00:00 2003 | |
30899 | @@ -104,7 +104,7 @@ | |
30900 | int channel, int tag, int sync) | |
30901 | { | |
30902 | packet->header[0] = (length << 16) | (tag << 14) | (channel << 8) | |
30903 | - | (TCODE_STREAM_DATA << 4) | sync; | |
30904 | + | (TCODE_STREAM_DATA << 4) | sync; | |
30905 | ||
30906 | packet->header_size = 4; | |
30907 | packet->data_size = length; | |
30908 | @@ -317,6 +317,35 @@ | |
30909 | return packet; | |
30910 | } | |
30911 | ||
30912 | +struct hpsb_packet *hpsb_make_streampacket(struct hpsb_host *host, u8 *buffer, int length, | |
30913 | + int channel, int tag, int sync) | |
30914 | +{ | |
30915 | + struct hpsb_packet *packet; | |
30916 | + | |
30917 | + if (length == 0) | |
30918 | + return NULL; | |
30919 | + | |
30920 | + packet = alloc_hpsb_packet(length + (length % 4 ? 4 - (length % 4) : 0)); | |
30921 | + if (!packet) | |
30922 | + return NULL; | |
30923 | + | |
30924 | + if (length % 4) { /* zero padding bytes */ | |
30925 | + packet->data[length >> 2] = 0; | |
30926 | + } | |
30927 | + packet->host = host; | |
30928 | + | |
30929 | + if (hpsb_get_tlabel(packet)) { | |
30930 | + free_hpsb_packet(packet); | |
30931 | + return NULL; | |
30932 | + } | |
30933 | + | |
30934 | + fill_async_stream_packet(packet, length, channel, tag, sync); | |
30935 | + if (buffer) | |
30936 | + memcpy(packet->data, buffer, length); | |
30937 | + | |
30938 | + return packet; | |
30939 | +} | |
30940 | + | |
30941 | struct hpsb_packet *hpsb_make_lockpacket(struct hpsb_host *host, nodeid_t node, | |
30942 | u64 addr, int extcode, quadlet_t *data, | |
30943 | quadlet_t arg) | |
30944 | @@ -580,25 +609,18 @@ | |
30945 | u16 specifier_id_hi = (specifier_id & 0x00ffff00) >> 8; | |
30946 | u8 specifier_id_lo = specifier_id & 0xff; | |
30947 | ||
30948 | - HPSB_VERBOSE("Send GASP: channel = %d, length = %d", channel, length); | |
30949 | + HPSB_VERBOSE("Send GASP: channel = %d, length = %Zd", channel, length); | |
30950 | ||
30951 | length += 8; | |
30952 | - | |
30953 | - packet = alloc_hpsb_packet(length + (length % 4 ? 4 - (length % 4) : 0)); | |
30954 | + | |
30955 | + packet = hpsb_make_streampacket(host, NULL, length, channel, 3, 0); | |
30956 | if (!packet) | |
30957 | return -ENOMEM; | |
30958 | ||
30959 | - if (length % 4) { | |
30960 | - packet->data[length / 4] = 0; | |
30961 | - } | |
30962 | - | |
30963 | - packet->host = host; | |
30964 | - fill_async_stream_packet(packet, length, channel, 3, 0); | |
30965 | - | |
30966 | packet->data[0] = cpu_to_be32((host->node_id << 16) | specifier_id_hi); | |
30967 | packet->data[1] = cpu_to_be32((specifier_id_lo << 24) | (version & 0x00ffffff)); | |
30968 | ||
30969 | - memcpy(&(packet->data[2]), buffer, length - 4); | |
30970 | + memcpy(&(packet->data[2]), buffer, length - 8); | |
30971 | ||
30972 | packet->generation = generation; | |
30973 | ||
30974 | diff -Nru a/drivers/ieee1394/ieee1394_transactions.h b/drivers/ieee1394/ieee1394_transactions.h | |
30975 | --- a/drivers/ieee1394/ieee1394_transactions.h Sun Aug 3 17:00:00 2003 | |
30976 | +++ b/drivers/ieee1394/ieee1394_transactions.h Mon Sep 1 17:00:00 2003 | |
30977 | @@ -25,6 +25,8 @@ | |
30978 | int tag, int sync); | |
30979 | struct hpsb_packet *hpsb_make_writepacket (struct hpsb_host *host, nodeid_t node, | |
30980 | u64 addr, quadlet_t *buffer, size_t length); | |
30981 | +struct hpsb_packet *hpsb_make_streampacket(struct hpsb_host *host, u8 *buffer, | |
30982 | + int length, int channel, int tag, int sync); | |
30983 | ||
30984 | /* | |
30985 | * hpsb_packet_success - Make sense of the ack and reply codes and | |
30986 | diff -Nru a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c | |
30987 | --- a/drivers/ieee1394/nodemgr.c Sat Aug 16 05:08:09 2003 | |
30988 | +++ b/drivers/ieee1394/nodemgr.c Mon Sep 1 17:00:00 2003 | |
30989 | @@ -1304,12 +1304,14 @@ | |
30990 | * unregister all the unit directories. */ | |
30991 | nodemgr_remove_node_uds(ne); | |
30992 | ||
30993 | + /* With all the ud's gone, mark the generation current, | |
30994 | + * this way the probe will succeed. */ | |
30995 | + ne->generation = generation; | |
30996 | + | |
30997 | /* This will re-register our unitdir's */ | |
30998 | nodemgr_process_config_rom (hi, ne, busoptions); | |
30999 | - } | |
31000 | - | |
31001 | - /* Since that's done, we can declare this record current */ | |
31002 | - ne->generation = generation; | |
31003 | + } else | |
31004 | + ne->generation = generation; | |
31005 | ||
31006 | /* Update unit_dirs with attached drivers */ | |
31007 | bus_for_each_dev(&ieee1394_bus_type, NULL, ne, | |
31008 | diff -Nru a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c | |
31009 | --- a/drivers/ieee1394/ohci1394.c Sun Aug 3 17:00:00 2003 | |
31010 | +++ b/drivers/ieee1394/ohci1394.c Mon Sep 1 17:00:00 2003 | |
31011 | @@ -161,7 +161,7 @@ | |
31012 | printk(level "%s_%d: " fmt "\n" , OHCI1394_DRIVER_NAME, card , ## args) | |
31013 | ||
31014 | static char version[] __devinitdata = | |
31015 | - "$Rev: 1023 $ Ben Collins <bcollins@debian.org>"; | |
31016 | + "$Rev: 1045 $ Ben Collins <bcollins@debian.org>"; | |
31017 | ||
31018 | /* Module Parameters */ | |
31019 | static int phys_dma = 1; | |
31020 | @@ -1451,7 +1451,7 @@ | |
31021 | if (sync != -1) { | |
31022 | /* set sync flag on first DMA descriptor */ | |
31023 | struct dma_cmd *cmd = &recv->block[recv->block_dma]; | |
31024 | - cmd->control |= DMA_CTL_WAIT; | |
31025 | + cmd->control |= cpu_to_le32(DMA_CTL_WAIT); | |
31026 | ||
31027 | /* match sync field */ | |
31028 | contextMatch |= (sync&0xf)<<8; | |
31029 | @@ -1675,10 +1675,10 @@ | |
31030 | struct dma_cmd *im = &recv->block[recv->block_dma]; | |
31031 | ||
31032 | /* check the DMA descriptor for new writes to xferStatus */ | |
31033 | - u16 xferstatus = im->status >> 16; | |
31034 | + u16 xferstatus = le32_to_cpu(im->status) >> 16; | |
31035 | ||
31036 | /* rescount is the number of bytes *remaining to be written* in the block */ | |
31037 | - u16 rescount = im->status & 0xFFFF; | |
31038 | + u16 rescount = le32_to_cpu(im->status) & 0xFFFF; | |
31039 | ||
31040 | unsigned char event = xferstatus & 0x1F; | |
31041 | ||
31042 | diff -Nru a/drivers/ieee1394/pcilynx.c b/drivers/ieee1394/pcilynx.c | |
31043 | --- a/drivers/ieee1394/pcilynx.c Sat Aug 16 05:08:53 2003 | |
31044 | +++ b/drivers/ieee1394/pcilynx.c Tue Aug 26 09:25:41 2003 | |
31045 | @@ -875,7 +875,7 @@ | |
31046 | ||
31047 | static int mem_open(struct inode *inode, struct file *file) | |
31048 | { | |
31049 | - int cid = minor(inode->i_rdev); | |
31050 | + int cid = iminor(inode); | |
31051 | enum { t_rom, t_aux, t_ram } type; | |
31052 | struct memdata *md; | |
31053 | ||
31054 | diff -Nru a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c | |
31055 | --- a/drivers/ieee1394/raw1394.c Sun Aug 3 17:00:00 2003 | |
31056 | +++ b/drivers/ieee1394/raw1394.c Tue Sep 2 06:26:59 2003 | |
31057 | @@ -38,6 +38,7 @@ | |
31058 | #include <linux/version.h> | |
31059 | #include <linux/smp_lock.h> | |
31060 | #include <linux/interrupt.h> | |
31061 | +#include <linux/vmalloc.h> | |
31062 | #include <asm/uaccess.h> | |
31063 | #include <asm/atomic.h> | |
31064 | #include <linux/devfs_fs_kernel.h> | |
31065 | @@ -180,6 +181,7 @@ | |
31066 | ||
31067 | if ((req->req.type == RAW1394_REQ_ASYNC_READ) || | |
31068 | (req->req.type == RAW1394_REQ_ASYNC_WRITE) || | |
31069 | + (req->req.type == RAW1394_REQ_ASYNC_STREAM) || | |
31070 | (req->req.type == RAW1394_REQ_LOCK) || | |
31071 | (req->req.type == RAW1394_REQ_LOCK64)) | |
31072 | hpsb_free_tlabel(packet); | |
31073 | @@ -689,6 +691,21 @@ | |
31074 | req->req.length = 0; | |
31075 | break; | |
31076 | ||
31077 | + case RAW1394_REQ_ASYNC_STREAM: | |
31078 | + DBGMSG("stream_request called"); | |
31079 | + | |
31080 | + packet = hpsb_make_streampacket(fi->host, NULL, req->req.length, node & 0x3f/*channel*/, | |
31081 | + (req->req.misc >> 16) & 0x3, req->req.misc & 0xf); | |
31082 | + if (!packet) | |
31083 | + return -ENOMEM; | |
31084 | + | |
31085 | + if (copy_from_user(packet->data, int2ptr(req->req.sendb), | |
31086 | + req->req.length)) | |
31087 | + req->req.error = RAW1394_ERROR_MEMFAULT; | |
31088 | + | |
31089 | + req->req.length = 0; | |
31090 | + break; | |
31091 | + | |
31092 | case RAW1394_REQ_LOCK: | |
31093 | DBGMSG("lock_request called"); | |
31094 | if ((req->req.misc == EXTCODE_FETCH_ADD) | |
31095 | @@ -892,7 +909,7 @@ | |
31096 | struct arm_request_response *arm_req_resp = NULL; | |
31097 | ||
31098 | DBGMSG("arm_read called by node: %X" | |
31099 | - "addr: %4.4x %8.8x length: %u", nodeid, | |
31100 | + "addr: %4.4x %8.8x length: %Zu", nodeid, | |
31101 | (u16) ((addr >>32) & 0xFFFF), (u32) (addr & 0xFFFFFFFF), | |
31102 | length); | |
31103 | spin_lock(&host_info_lock); | |
31104 | @@ -1028,7 +1045,7 @@ | |
31105 | struct arm_request_response *arm_req_resp = NULL; | |
31106 | ||
31107 | DBGMSG("arm_write called by node: %X" | |
31108 | - "addr: %4.4x %8.8x length: %u", nodeid, | |
31109 | + "addr: %4.4x %8.8x length: %Zu", nodeid, | |
31110 | (u16) ((addr >>32) & 0xFFFF), (u32) (addr & 0xFFFFFFFF), | |
31111 | length); | |
31112 | spin_lock(&host_info_lock); | |
31113 | @@ -1566,8 +1583,8 @@ | |
31114 | req->req.length, ((req->req.misc >> 8) & 0xFF), | |
31115 | (req->req.misc & 0xFF),((req->req.misc >> 16) & 0xFFFF)); | |
31116 | /* check addressrange */ | |
31117 | - if ((((req->req.address) & ~((u64)0xFFFFFFFFFFFFLL)) != 0) || | |
31118 | - (((req->req.address + req->req.length) & ~((u64)0xFFFFFFFFFFFFLL)) != 0)) { | |
31119 | + if ((((req->req.address) & ~(0xFFFFFFFFFFFFULL)) != 0) || | |
31120 | + (((req->req.address + req->req.length) & ~(0xFFFFFFFFFFFFULL)) != 0)) { | |
31121 | req->req.length = 0; | |
31122 | return (-EINVAL); | |
31123 | } | |
31124 | @@ -1578,7 +1595,7 @@ | |
31125 | return (-ENOMEM); | |
31126 | } | |
31127 | /* allocation of addr_space_buffer */ | |
31128 | - addr->addr_space_buffer = (u8 *)kmalloc(req->req.length,SLAB_KERNEL); | |
31129 | + addr->addr_space_buffer = (u8 *)vmalloc(req->req.length); | |
31130 | if (!(addr->addr_space_buffer)) { | |
31131 | kfree(addr); | |
31132 | req->req.length = 0; | |
31133 | @@ -1592,7 +1609,7 @@ | |
31134 | /* init: user -> kernel */ | |
31135 | if (copy_from_user(addr->addr_space_buffer,int2ptr(req->req.sendb), | |
31136 | req->req.length)) { | |
31137 | - kfree(addr->addr_space_buffer); | |
31138 | + vfree(addr->addr_space_buffer); | |
31139 | kfree(addr); | |
31140 | return (-EFAULT); | |
31141 | } | |
31142 | @@ -1633,7 +1650,7 @@ | |
31143 | } | |
31144 | if (same_host) { | |
31145 | /* addressrange occupied by same host */ | |
31146 | - kfree(addr->addr_space_buffer); | |
31147 | + vfree(addr->addr_space_buffer); | |
31148 | kfree(addr); | |
31149 | spin_unlock_irqrestore(&host_info_lock, flags); | |
31150 | return (-EALREADY); | |
31151 | @@ -1668,7 +1685,7 @@ | |
31152 | int2ptr(&addr->start),sizeof(u64))) { | |
31153 | printk(KERN_ERR "raw1394: arm_register failed " | |
31154 | " address-range-entry is invalid -> EFAULT !!!\n"); | |
31155 | - kfree(addr->addr_space_buffer); | |
31156 | + vfree(addr->addr_space_buffer); | |
31157 | kfree(addr); | |
31158 | spin_unlock_irqrestore(&host_info_lock, flags); | |
31159 | return (-EFAULT); | |
31160 | @@ -1686,7 +1703,7 @@ | |
31161 | list_add_tail(&addr->addr_list, &fi->addr_list); | |
31162 | } else { | |
31163 | DBGMSG("arm_register failed errno: %d \n",retval); | |
31164 | - kfree(addr->addr_space_buffer); | |
31165 | + vfree(addr->addr_space_buffer); | |
31166 | kfree(addr); | |
31167 | spin_unlock_irqrestore(&host_info_lock, flags); | |
31168 | return (-EALREADY); | |
31169 | @@ -1760,7 +1777,7 @@ | |
31170 | if (another_host) { | |
31171 | DBGMSG("delete entry from list -> success"); | |
31172 | list_del(&addr->addr_list); | |
31173 | - kfree(addr->addr_space_buffer); | |
31174 | + vfree(addr->addr_space_buffer); | |
31175 | kfree(addr); | |
31176 | free_pending_request(req); /* immediate success or fail */ | |
31177 | spin_unlock_irqrestore(&host_info_lock, flags); | |
31178 | @@ -1775,7 +1792,7 @@ | |
31179 | DBGMSG("delete entry from list -> success"); | |
31180 | list_del(&addr->addr_list); | |
31181 | spin_unlock_irqrestore(&host_info_lock, flags); | |
31182 | - kfree(addr->addr_space_buffer); | |
31183 | + vfree(addr->addr_space_buffer); | |
31184 | kfree(addr); | |
31185 | free_pending_request(req); /* immediate success or fail */ | |
31186 | return sizeof(struct raw1394_request); | |
31187 | @@ -2440,7 +2457,7 @@ | |
31188 | } | |
31189 | DBGMSG("raw1394_release: delete addr_entry from list"); | |
31190 | list_del(&addr->addr_list); | |
31191 | - kfree(addr->addr_space_buffer); | |
31192 | + vfree(addr->addr_space_buffer); | |
31193 | kfree(addr); | |
31194 | } /* while */ | |
31195 | spin_unlock_irq(&host_info_lock); | |
31196 | diff -Nru a/drivers/ieee1394/raw1394.h b/drivers/ieee1394/raw1394.h | |
31197 | --- a/drivers/ieee1394/raw1394.h Wed Feb 12 20:57:18 2003 | |
31198 | +++ b/drivers/ieee1394/raw1394.h Mon Sep 1 17:00:00 2003 | |
31199 | @@ -19,6 +19,7 @@ | |
31200 | #define RAW1394_REQ_LOCK64 103 | |
31201 | #define RAW1394_REQ_ISO_SEND 104 | |
31202 | #define RAW1394_REQ_ASYNC_SEND 105 | |
31203 | +#define RAW1394_REQ_ASYNC_STREAM 106 | |
31204 | ||
31205 | #define RAW1394_REQ_ISO_LISTEN 200 | |
31206 | #define RAW1394_REQ_FCP_LISTEN 201 | |
31207 | diff -Nru a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c | |
31208 | --- a/drivers/ieee1394/sbp2.c Sun Aug 10 22:11:01 2003 | |
31209 | +++ b/drivers/ieee1394/sbp2.c Mon Sep 1 17:00:00 2003 | |
31210 | @@ -80,7 +80,7 @@ | |
31211 | #include "sbp2.h" | |
31212 | ||
31213 | static char version[] __devinitdata = | |
31214 | - "$Rev: 1018 $ Ben Collins <bcollins@debian.org>"; | |
31215 | + "$Rev: 1034 $ Ben Collins <bcollins@debian.org>"; | |
31216 | ||
31217 | /* | |
31218 | * Module load parameter definitions | |
31219 | @@ -1002,9 +1002,8 @@ | |
31220 | sbp2scsi_complete_all_commands(scsi_id, DID_NO_CONNECT); | |
31221 | ||
31222 | /* Remove it from the scsi layer now */ | |
31223 | - if (sdev) { | |
31224 | + if (sdev) | |
31225 | scsi_remove_device(sdev); | |
31226 | - } | |
31227 | ||
31228 | sbp2util_remove_command_orb_pool(scsi_id); | |
31229 | ||
31230 | diff -Nru a/drivers/input/evdev.c b/drivers/input/evdev.c | |
31231 | --- a/drivers/input/evdev.c Tue Aug 12 16:21:11 2003 | |
31232 | +++ b/drivers/input/evdev.c Sun Aug 31 16:14:28 2003 | |
31233 | @@ -122,7 +122,7 @@ | |
31234 | static int evdev_open(struct inode * inode, struct file * file) | |
31235 | { | |
31236 | struct evdev_list *list; | |
31237 | - int i = minor(inode->i_rdev) - EVDEV_MINOR_BASE; | |
31238 | + int i = iminor(inode) - EVDEV_MINOR_BASE; | |
31239 | int accept_err; | |
31240 | ||
31241 | if (i >= EVDEV_MINORS || !evdev_table[i]) | |
31242 | @@ -305,6 +305,7 @@ | |
31243 | case EV_KEY: bits = dev->keybit; len = KEY_MAX; break; | |
31244 | case EV_REL: bits = dev->relbit; len = REL_MAX; break; | |
31245 | case EV_ABS: bits = dev->absbit; len = ABS_MAX; break; | |
31246 | + case EV_MSC: bits = dev->mscbit; len = MSC_MAX; break; | |
31247 | case EV_LED: bits = dev->ledbit; len = LED_MAX; break; | |
31248 | case EV_SND: bits = dev->sndbit; len = SND_MAX; break; | |
31249 | case EV_FF: bits = dev->ffbit; len = FF_MAX; break; | |
31250 | diff -Nru a/drivers/input/input.c b/drivers/input/input.c | |
31251 | --- a/drivers/input/input.c Tue Aug 12 13:29:25 2003 | |
31252 | +++ b/drivers/input/input.c Tue Aug 26 09:25:41 2003 | |
31253 | @@ -280,7 +280,7 @@ | |
31254 | if (id->id.product != dev->id.product) | |
31255 | continue; | |
31256 | ||
31257 | - if (id->flags & INPUT_DEVICE_ID_MATCH_BUS) | |
31258 | + if (id->flags & INPUT_DEVICE_ID_MATCH_VERSION) | |
31259 | if (id->id.version != dev->id.version) | |
31260 | continue; | |
31261 | ||
31262 | @@ -527,7 +527,7 @@ | |
31263 | ||
31264 | static int input_open_file(struct inode *inode, struct file *file) | |
31265 | { | |
31266 | - struct input_handler *handler = input_table[minor(inode->i_rdev) >> 5]; | |
31267 | + struct input_handler *handler = input_table[iminor(inode) >> 5]; | |
31268 | struct file_operations *old_fops, *new_fops = NULL; | |
31269 | int err; | |
31270 | ||
31271 | diff -Nru a/drivers/input/joydev.c b/drivers/input/joydev.c | |
31272 | --- a/drivers/input/joydev.c Fri May 2 06:55:04 2003 | |
31273 | +++ b/drivers/input/joydev.c Tue Aug 26 09:25:41 2003 | |
31274 | @@ -170,7 +170,7 @@ | |
31275 | static int joydev_open(struct inode *inode, struct file *file) | |
31276 | { | |
31277 | struct joydev_list *list; | |
31278 | - int i = minor(inode->i_rdev) - JOYDEV_MINOR_BASE; | |
31279 | + int i = iminor(inode) - JOYDEV_MINOR_BASE; | |
31280 | ||
31281 | if (i >= JOYDEV_MINORS || !joydev_table[i]) | |
31282 | return -ENODEV; | |
31283 | diff -Nru a/drivers/input/mousedev.c b/drivers/input/mousedev.c | |
31284 | --- a/drivers/input/mousedev.c Fri May 2 06:55:04 2003 | |
31285 | +++ b/drivers/input/mousedev.c Tue Aug 26 09:25:41 2003 | |
31286 | @@ -228,11 +228,11 @@ | |
31287 | int i; | |
31288 | ||
31289 | #ifdef CONFIG_INPUT_MOUSEDEV_PSAUX | |
31290 | - if (major(inode->i_rdev) == MISC_MAJOR) | |
31291 | + if (imajor(inode) == MISC_MAJOR) | |
31292 | i = MOUSEDEV_MIX; | |
31293 | else | |
31294 | #endif | |
31295 | - i = minor(inode->i_rdev) - MOUSEDEV_MINOR_BASE; | |
31296 | + i = iminor(inode) - MOUSEDEV_MINOR_BASE; | |
31297 | ||
31298 | if (i >= MOUSEDEV_MINORS || !mousedev_table[i]) | |
31299 | return -ENODEV; | |
31300 | diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c | |
31301 | --- a/drivers/input/serio/i8042.c Wed Jul 23 07:37:45 2003 | |
31302 | +++ b/drivers/input/serio/i8042.c Wed Sep 3 23:40:20 2003 | |
31303 | @@ -410,6 +410,7 @@ | |
31304 | /* work around hardware that doubles key releases */ | |
31305 | if (index == i8042_last_release) { | |
31306 | dbg("i8042 skipped double release (%d)\n", index); | |
31307 | + i8042_last_e0 = 0; | |
31308 | continue; | |
31309 | } | |
31310 | if (index == 0xaa || index == 0xb6) | |
31311 | @@ -581,6 +582,7 @@ | |
31312 | static int __init i8042_check_mux(struct i8042_values *values) | |
31313 | { | |
31314 | unsigned char param; | |
31315 | + static int i8042_check_mux_cookie; | |
31316 | int i; | |
31317 | ||
31318 | /* | |
31319 | @@ -588,9 +590,9 @@ | |
31320 | */ | |
31321 | ||
31322 | if (request_irq(values->irq, i8042_interrupt, SA_SHIRQ, | |
31323 | - "i8042", i8042_request_irq_cookie)) | |
31324 | + "i8042", &i8042_check_mux_cookie)) | |
31325 | return -1; | |
31326 | - free_irq(values->irq, i8042_request_irq_cookie); | |
31327 | + free_irq(values->irq, &i8042_check_mux_cookie); | |
31328 | ||
31329 | /* | |
31330 | * Get rid of bytes in the queue. | |
31331 | @@ -653,6 +655,7 @@ | |
31332 | static int __init i8042_check_aux(struct i8042_values *values) | |
31333 | { | |
31334 | unsigned char param; | |
31335 | + static int i8042_check_aux_cookie; | |
31336 | ||
31337 | /* | |
31338 | * Check if AUX irq is available. If it isn't, then there is no point | |
31339 | @@ -660,9 +663,9 @@ | |
31340 | */ | |
31341 | ||
31342 | if (request_irq(values->irq, i8042_interrupt, SA_SHIRQ, | |
31343 | - "i8042", i8042_request_irq_cookie)) | |
31344 | + "i8042", &i8042_check_aux_cookie)) | |
31345 | return -1; | |
31346 | - free_irq(values->irq, i8042_request_irq_cookie); | |
31347 | + free_irq(values->irq, &i8042_check_aux_cookie); | |
31348 | ||
31349 | /* | |
31350 | * Get rid of bytes in the queue. | |
31351 | diff -Nru a/drivers/input/serio/sa1111ps2.c b/drivers/input/serio/sa1111ps2.c | |
31352 | --- a/drivers/input/serio/sa1111ps2.c Sat May 17 07:47:27 2003 | |
31353 | +++ b/drivers/input/serio/sa1111ps2.c Sun Aug 24 07:45:05 2003 | |
31354 | @@ -62,9 +62,9 @@ | |
31355 | ||
31356 | serio_interrupt(&ps2if->io, scancode, flag, regs); | |
31357 | ||
31358 | - status = sa1111_readl(ps2if->base + SA1111_PS2STAT); | |
31359 | + status = sa1111_readl(ps2if->base + SA1111_PS2STAT); | |
31360 | ||
31361 | - handled = IRQ_HANDLED; | |
31362 | + handled = IRQ_HANDLED; | |
31363 | } | |
31364 | ||
31365 | return handled; | |
31366 | @@ -232,9 +232,8 @@ | |
31367 | /* | |
31368 | * Add one device to this driver. | |
31369 | */ | |
31370 | -static int ps2_probe(struct device *dev) | |
31371 | +static int ps2_probe(struct sa1111_dev *dev) | |
31372 | { | |
31373 | - struct sa1111_dev *sadev = SA1111_DEV(dev); | |
31374 | struct ps2if *ps2if; | |
31375 | int ret; | |
31376 | ||
31377 | @@ -249,20 +248,20 @@ | |
31378 | ps2if->io.write = ps2_write; | |
31379 | ps2if->io.open = ps2_open; | |
31380 | ps2if->io.close = ps2_close; | |
31381 | - ps2if->io.name = dev->name; | |
31382 | - ps2if->io.phys = dev->bus_id; | |
31383 | + ps2if->io.name = dev->dev.bus_id; | |
31384 | + ps2if->io.phys = dev->dev.bus_id; | |
31385 | ps2if->io.driver = ps2if; | |
31386 | - ps2if->dev = sadev; | |
31387 | - dev->driver_data = ps2if; | |
31388 | + ps2if->dev = dev; | |
31389 | + sa1111_set_drvdata(dev, ps2if); | |
31390 | ||
31391 | spin_lock_init(&ps2if->lock); | |
31392 | ||
31393 | /* | |
31394 | * Request the physical region for this PS2 port. | |
31395 | */ | |
31396 | - if (!request_mem_region(sadev->res.start, | |
31397 | - sadev->res.end - sadev->res.start + 1, | |
31398 | - SA1111_DRIVER_NAME(sadev))) { | |
31399 | + if (!request_mem_region(dev->res.start, | |
31400 | + dev->res.end - dev->res.start + 1, | |
31401 | + SA1111_DRIVER_NAME(dev))) { | |
31402 | ret = -EBUSY; | |
31403 | goto free; | |
31404 | } | |
31405 | @@ -270,7 +269,7 @@ | |
31406 | /* | |
31407 | * Our parent device has already mapped the region. | |
31408 | */ | |
31409 | - ps2if->base = (unsigned long)sadev->mapbase; | |
31410 | + ps2if->base = (unsigned long)dev->mapbase; | |
31411 | ||
31412 | sa1111_enable_device(ps2if->dev); | |
31413 | ||
31414 | @@ -301,10 +300,10 @@ | |
31415 | ||
31416 | out: | |
31417 | sa1111_disable_device(ps2if->dev); | |
31418 | - release_mem_region(sadev->res.start, | |
31419 | - sadev->res.end - sadev->res.start + 1); | |
31420 | + release_mem_region(dev->res.start, | |
31421 | + dev->res.end - dev->res.start + 1); | |
31422 | free: | |
31423 | - dev->driver_data = NULL; | |
31424 | + sa1111_set_drvdata(dev, NULL); | |
31425 | kfree(ps2if); | |
31426 | return ret; | |
31427 | } | |
31428 | @@ -312,31 +311,17 @@ | |
31429 | /* | |
31430 | * Remove one device from this driver. | |
31431 | */ | |
31432 | -static int ps2_remove(struct device *dev) | |
31433 | +static int ps2_remove(struct sa1111_dev *dev) | |
31434 | { | |
31435 | - struct ps2if *ps2if = dev->driver_data; | |
31436 | - struct sa1111_dev *sadev = SA1111_DEV(dev); | |
31437 | + struct ps2if *ps2if = sa1111_get_drvdata(dev); | |
31438 | ||
31439 | serio_unregister_port(&ps2if->io); | |
31440 | - release_mem_region(sadev->res.start, | |
31441 | - sadev->res.end - sadev->res.start + 1); | |
31442 | - kfree(ps2if); | |
31443 | - | |
31444 | - dev->driver_data = NULL; | |
31445 | - | |
31446 | - return 0; | |
31447 | -} | |
31448 | + release_mem_region(dev->res.start, | |
31449 | + dev->res.end - dev->res.start + 1); | |
31450 | + sa1111_set_drvdata(dev, NULL); | |
31451 | ||
31452 | -/* | |
31453 | - * We should probably do something here, but what? | |
31454 | - */ | |
31455 | -static int ps2_suspend(struct device *dev, u32 state, u32 level) | |
31456 | -{ | |
31457 | - return 0; | |
31458 | -} | |
31459 | + kfree(ps2if); | |
31460 | ||
31461 | -static int ps2_resume(struct device *dev, u32 level) | |
31462 | -{ | |
31463 | return 0; | |
31464 | } | |
31465 | ||
31466 | @@ -345,24 +330,21 @@ | |
31467 | */ | |
31468 | static struct sa1111_driver ps2_driver = { | |
31469 | .drv = { | |
31470 | - .name = "sa1111-ps2", | |
31471 | - .bus = &sa1111_bus_type, | |
31472 | - .probe = ps2_probe, | |
31473 | - .remove = ps2_remove, | |
31474 | - .suspend = ps2_suspend, | |
31475 | - .resume = ps2_resume, | |
31476 | + .name = "sa1111-ps2", | |
31477 | }, | |
31478 | - .devid = SA1111_DEVID_PS2, | |
31479 | + .devid = SA1111_DEVID_PS2, | |
31480 | + .probe = ps2_probe, | |
31481 | + .remove = ps2_remove, | |
31482 | }; | |
31483 | ||
31484 | static int __init ps2_init(void) | |
31485 | { | |
31486 | - return driver_register(&ps2_driver.drv); | |
31487 | + return sa1111_driver_register(&ps2_driver); | |
31488 | } | |
31489 | ||
31490 | static void __exit ps2_exit(void) | |
31491 | { | |
31492 | - driver_unregister(&ps2_driver.drv); | |
31493 | + sa1111_driver_unregister(&ps2_driver); | |
31494 | } | |
31495 | ||
31496 | module_init(ps2_init); | |
31497 | diff -Nru a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c | |
31498 | --- a/drivers/input/serio/serport.c Sun May 4 09:36:03 2003 | |
31499 | +++ b/drivers/input/serio/serport.c Wed Sep 3 23:40:16 2003 | |
31500 | @@ -24,6 +24,7 @@ | |
31501 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); | |
31502 | MODULE_DESCRIPTION("Input device TTY line discipline"); | |
31503 | MODULE_LICENSE("GPL"); | |
31504 | +MODULE_ALIAS_LDISC(N_MOUSE); | |
31505 | ||
31506 | #define SERPORT_BUSY 1 | |
31507 | ||
31508 | diff -Nru a/drivers/input/tsdev.c b/drivers/input/tsdev.c | |
31509 | --- a/drivers/input/tsdev.c Fri May 2 06:55:04 2003 | |
31510 | +++ b/drivers/input/tsdev.c Tue Aug 26 09:25:41 2003 | |
31511 | @@ -96,7 +96,7 @@ | |
31512 | ||
31513 | static int tsdev_open(struct inode *inode, struct file *file) | |
31514 | { | |
31515 | - int i = minor(inode->i_rdev) - TSDEV_MINOR_BASE; | |
31516 | + int i = iminor(inode) - TSDEV_MINOR_BASE; | |
31517 | struct tsdev_list *list; | |
31518 | ||
31519 | if (i >= TSDEV_MINORS || !tsdev_table[i]) | |
31520 | diff -Nru a/drivers/isdn/Kconfig b/drivers/isdn/Kconfig | |
31521 | --- a/drivers/isdn/Kconfig Tue Nov 12 12:48:13 2002 | |
31522 | +++ b/drivers/isdn/Kconfig Mon Aug 25 05:49:31 2003 | |
31523 | @@ -22,7 +22,7 @@ | |
31524 | ||
31525 | ||
31526 | menu "Old ISDN4Linux" | |
31527 | - depends on NET && ISDN_BOOL | |
31528 | + depends on NET && ISDN_BOOL && BROKEN_ON_SMP | |
31529 | ||
31530 | config ISDN | |
31531 | tristate "Old ISDN4Linux (obsolete)" | |
31532 | diff -Nru a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c | |
31533 | --- a/drivers/isdn/capi/capi.c Wed Jun 11 12:32:56 2003 | |
31534 | +++ b/drivers/isdn/capi/capi.c Wed Sep 3 03:09:05 2003 | |
31535 | @@ -412,7 +412,7 @@ | |
31536 | static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb) | |
31537 | { | |
31538 | struct sk_buff *nskb; | |
31539 | - unsigned int datalen; | |
31540 | + int datalen; | |
31541 | u16 errcode, datahandle; | |
31542 | ||
31543 | datalen = skb->len - CAPIMSG_LEN(skb->data); | |
31544 | @@ -552,12 +552,12 @@ | |
31545 | struct capincci *np; | |
31546 | u32 ncci; | |
31547 | ||
31548 | - if (CAPIMSG_COMMAND(skb->data) == CAPI_CONNECT_B3_CONF) { | |
31549 | + if (CAPIMSG_CMD(skb->data) == CAPI_CONNECT_B3_CONF) { | |
31550 | u16 info = CAPIMSG_U16(skb->data, 12); // Info field | |
31551 | if (info == 0) | |
31552 | capincci_alloc(cdev, CAPIMSG_NCCI(skb->data)); | |
31553 | } | |
31554 | - if (CAPIMSG_COMMAND(skb->data) == CAPI_CONNECT_B3_IND) { | |
31555 | + if (CAPIMSG_CMD(skb->data) == CAPI_CONNECT_B3_IND) { | |
31556 | capincci_alloc(cdev, CAPIMSG_NCCI(skb->data)); | |
31557 | } | |
31558 | if (CAPIMSG_COMMAND(skb->data) != CAPI_DATA_B3) { | |
31559 | @@ -688,7 +688,7 @@ | |
31560 | } | |
31561 | mlen = CAPIMSG_LEN(skb->data); | |
31562 | if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) { | |
31563 | - if (mlen + CAPIMSG_DATALEN(skb->data) != count) { | |
31564 | + if ((size_t)(mlen + CAPIMSG_DATALEN(skb->data)) != count) { | |
31565 | kfree_skb(skb); | |
31566 | return -EINVAL; | |
31567 | } | |
31568 | @@ -700,7 +700,7 @@ | |
31569 | } | |
31570 | CAPIMSG_SETAPPID(skb->data, cdev->ap.applid); | |
31571 | ||
31572 | - if (CAPIMSG_COMMAND(skb->data) == CAPI_DISCONNECT_B3_RESP) { | |
31573 | + if (CAPIMSG_CMD(skb->data) == CAPI_DISCONNECT_B3_RESP) { | |
31574 | capincci_free(cdev, CAPIMSG_NCCI(skb->data)); | |
31575 | ||
31576 | } | |
31577 | @@ -964,7 +964,7 @@ | |
31578 | { | |
31579 | struct capiminor *mp; | |
31580 | ||
31581 | - if ((mp = capiminor_find(minor(file->f_dentry->d_inode->i_rdev))) == 0) | |
31582 | + if ((mp = capiminor_find(iminor(file->f_dentry->d_inode))) == 0) | |
31583 | return -ENXIO; | |
31584 | if (mp->nccip == 0) | |
31585 | return -ENXIO; | |
31586 | diff -Nru a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c | |
31587 | --- a/drivers/isdn/capi/capidrv.c Tue Jul 15 10:01:29 2003 | |
31588 | +++ b/drivers/isdn/capi/capidrv.c Wed Sep 3 03:09:05 2003 | |
31589 | @@ -48,7 +48,7 @@ | |
31590 | struct capidrv_contr { | |
31591 | ||
31592 | struct capidrv_contr *next; | |
31593 | - | |
31594 | + struct module *owner; | |
31595 | u32 contrnr; | |
31596 | char name[20]; | |
31597 | ||
31598 | @@ -1816,7 +1816,7 @@ | |
31599 | capidrv_bchan *bchan; | |
31600 | capidrv_ncci *nccip; | |
31601 | int len = skb->len; | |
31602 | - size_t msglen; | |
31603 | + int msglen; | |
31604 | u16 errcode; | |
31605 | u16 datahandle; | |
31606 | ||
31607 | @@ -1844,7 +1844,7 @@ | |
31608 | 0 /* Flags */ | |
31609 | ); | |
31610 | ||
31611 | - if (capidrv_add_ack(nccip, datahandle, doack ? skb->len : -1) < 0) | |
31612 | + if (capidrv_add_ack(nccip, datahandle, doack ? (int)skb->len : -1) < 0) | |
31613 | return 0; | |
31614 | ||
31615 | capi_cmsg2message(&sendcmsg, sendcmsg.buf); | |
31616 | @@ -1990,16 +1990,19 @@ | |
31617 | char id[20]; | |
31618 | int i; | |
31619 | ||
31620 | - MOD_INC_USE_COUNT; | |
31621 | - | |
31622 | sprintf(id, "capidrv-%d", contr); | |
31623 | if (!(card = (capidrv_contr *) kmalloc(sizeof(capidrv_contr), GFP_ATOMIC))) { | |
31624 | printk(KERN_WARNING | |
31625 | "capidrv: (%s) Could not allocate contr-struct.\n", id); | |
31626 | - MOD_DEC_USE_COUNT; | |
31627 | return -1; | |
31628 | } | |
31629 | memset(card, 0, sizeof(capidrv_contr)); | |
31630 | + card->owner = THIS_MODULE; | |
31631 | + if (!try_module_get(card->owner)) { | |
31632 | + printk(KERN_WARNING "capidrv: (%s) Could not reserve module\n", id); | |
31633 | + kfree(card); | |
31634 | + return -1; | |
31635 | + } | |
31636 | init_timer(&card->listentimer); | |
31637 | strcpy(card->name, id); | |
31638 | card->contrnr = contr; | |
31639 | @@ -2008,8 +2011,8 @@ | |
31640 | if (!card->bchans) { | |
31641 | printk(KERN_WARNING | |
31642 | "capidrv: (%s) Could not allocate bchan-structs.\n", id); | |
31643 | + module_put(card->owner); | |
31644 | kfree(card); | |
31645 | - MOD_DEC_USE_COUNT; | |
31646 | return -1; | |
31647 | } | |
31648 | card->interface.channels = profp->nbchannel; | |
31649 | @@ -2042,8 +2045,8 @@ | |
31650 | if (!register_isdn(&card->interface)) { | |
31651 | printk(KERN_ERR "capidrv: Unable to register contr %s\n", id); | |
31652 | kfree(card->bchans); | |
31653 | + module_put(card->owner); | |
31654 | kfree(card); | |
31655 | - MOD_DEC_USE_COUNT; | |
31656 | return -1; | |
31657 | } | |
31658 | card->myid = card->interface.channels; | |
31659 | @@ -2153,12 +2156,9 @@ | |
31660 | } | |
31661 | spin_unlock_irqrestore(&global_lock, flags); | |
31662 | ||
31663 | + module_put(card->owner); | |
31664 | printk(KERN_INFO "%s: now down.\n", card->name); | |
31665 | - | |
31666 | kfree(card); | |
31667 | - | |
31668 | - MOD_DEC_USE_COUNT; | |
31669 | - | |
31670 | return 0; | |
31671 | } | |
31672 | ||
31673 | @@ -2245,8 +2245,6 @@ | |
31674 | u32 ncontr, contr; | |
31675 | u16 errcode; | |
31676 | ||
31677 | - MOD_INC_USE_COUNT; | |
31678 | - | |
31679 | if ((p = strchr(revision, ':')) != 0 && p[1]) { | |
31680 | strncpy(rev, p + 2, sizeof(rev)); | |
31681 | rev[sizeof(rev)-1] = 0; | |
31682 | @@ -2262,7 +2260,6 @@ | |
31683 | global.ap.recv_message = capidrv_recv_message; | |
31684 | errcode = capi20_register(&global.ap); | |
31685 | if (errcode) { | |
31686 | - MOD_DEC_USE_COUNT; | |
31687 | return -EIO; | |
31688 | } | |
31689 | ||
31690 | @@ -2271,7 +2268,6 @@ | |
31691 | errcode = capi20_get_profile(0, &profile); | |
31692 | if (errcode != CAPI_NOERROR) { | |
31693 | capi20_release(&global.ap); | |
31694 | - MOD_DEC_USE_COUNT; | |
31695 | return -EIO; | |
31696 | } | |
31697 | ||
31698 | @@ -2285,8 +2281,6 @@ | |
31699 | proc_init(); | |
31700 | ||
31701 | printk(KERN_NOTICE "capidrv: Rev %s: loaded\n", rev); | |
31702 | - MOD_DEC_USE_COUNT; | |
31703 | - | |
31704 | return 0; | |
31705 | } | |
31706 | ||
31707 | diff -Nru a/drivers/isdn/capi/capilib.c b/drivers/isdn/capi/capilib.c | |
31708 | --- a/drivers/isdn/capi/capilib.c Thu Aug 15 15:06:55 2002 | |
31709 | +++ b/drivers/isdn/capi/capilib.c Wed Sep 3 03:09:05 2003 | |
31710 | @@ -29,7 +29,7 @@ | |
31711 | ||
31712 | static inline void mq_init(struct capilib_ncci * np) | |
31713 | { | |
31714 | - int i; | |
31715 | + u_int i; | |
31716 | np->msgidqueue = 0; | |
31717 | np->msgidlast = 0; | |
31718 | np->nmsg = 0; | |
31719 | diff -Nru a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c | |
31720 | --- a/drivers/isdn/capi/kcapi.c Sun May 25 17:00:00 2003 | |
31721 | +++ b/drivers/isdn/capi/kcapi.c Wed Sep 3 03:09:05 2003 | |
31722 | @@ -72,7 +72,7 @@ | |
31723 | static struct work_struct tq_state_notify; | |
31724 | static struct work_struct tq_recv_notify; | |
31725 | ||
31726 | -/* -------- ref counting -------------------------------------- */ | |
31727 | +/* -------- controller ref counting -------------------------------------- */ | |
31728 | ||
31729 | static inline struct capi_ctr * | |
31730 | capi_ctr_get(struct capi_ctr *card) | |
31731 | @@ -89,6 +89,21 @@ | |
31732 | DBG("MOD_COUNT DEC"); | |
31733 | } | |
31734 | ||
31735 | +/* -------- own ref counting -------------------------------------- */ | |
31736 | + | |
31737 | +static inline void | |
31738 | +kcapi_get_ref(void) | |
31739 | +{ | |
31740 | + if (!try_module_get(THIS_MODULE)) | |
31741 | + printk(KERN_WARNING "%s: cannot reserve module\n", __FUNCTION__); | |
31742 | +} | |
31743 | + | |
31744 | +static inline void | |
31745 | +kcapi_put_ref(void) | |
31746 | +{ | |
31747 | + module_put(THIS_MODULE); | |
31748 | +} | |
31749 | + | |
31750 | /* ------------------------------------------------------------- */ | |
31751 | ||
31752 | static inline struct capi_ctr *get_capi_ctr_by_nr(u16 contr) | |
31753 | @@ -209,10 +224,10 @@ | |
31754 | { | |
31755 | struct capi_notifier *np; | |
31756 | ||
31757 | - MOD_INC_USE_COUNT; | |
31758 | + kcapi_get_ref(); | |
31759 | np = (struct capi_notifier *)kmalloc(sizeof(struct capi_notifier), GFP_ATOMIC); | |
31760 | if (!np) { | |
31761 | - MOD_DEC_USE_COUNT; | |
31762 | + kcapi_put_ref(); | |
31763 | return -1; | |
31764 | } | |
31765 | memset(np, 0, sizeof(struct capi_notifier)); | |
31766 | @@ -226,9 +241,9 @@ | |
31767 | * of devices. Devices can only removed in | |
31768 | * user process, not in bh. | |
31769 | */ | |
31770 | - MOD_INC_USE_COUNT; | |
31771 | + kcapi_get_ref(); | |
31772 | if (schedule_work(&tq_state_notify) == 0) | |
31773 | - MOD_DEC_USE_COUNT; | |
31774 | + kcapi_put_ref(); | |
31775 | return 0; | |
31776 | } | |
31777 | ||
31778 | @@ -286,9 +301,9 @@ | |
31779 | while ((np = notify_dequeue()) != 0) { | |
31780 | notify_doit(np); | |
31781 | kfree(np); | |
31782 | - MOD_DEC_USE_COUNT; | |
31783 | + kcapi_put_ref(); | |
31784 | } | |
31785 | - MOD_DEC_USE_COUNT; | |
31786 | + kcapi_put_ref(); | |
31787 | } | |
31788 | ||
31789 | /* -------- Receiver ------------------------------------------ */ | |
31790 | @@ -626,19 +641,18 @@ | |
31791 | ||
31792 | EXPORT_SYMBOL(capi20_put_message); | |
31793 | ||
31794 | -u16 capi20_get_manufacturer(u32 contr, u8 buf[CAPI_MANUFACTURER_LEN]) | |
31795 | +u16 capi20_get_manufacturer(u32 contr, u8 *buf) | |
31796 | { | |
31797 | struct capi_ctr *card; | |
31798 | ||
31799 | if (contr == 0) { | |
31800 | - strlcpy(buf, capi_manufakturer, sizeof(buf)); | |
31801 | + strlcpy(buf, capi_manufakturer, CAPI_MANUFACTURER_LEN); | |
31802 | return CAPI_NOERROR; | |
31803 | } | |
31804 | card = get_capi_ctr_by_nr(contr); | |
31805 | if (!card || card->cardstate != CARD_RUNNING) | |
31806 | return CAPI_REGNOTINSTALLED; | |
31807 | - | |
31808 | - strlcpy(buf, card->manu, sizeof(buf)); | |
31809 | + strlcpy(buf, card->manu, CAPI_MANUFACTURER_LEN); | |
31810 | return CAPI_NOERROR; | |
31811 | } | |
31812 | ||
31813 | @@ -662,19 +676,19 @@ | |
31814 | ||
31815 | EXPORT_SYMBOL(capi20_get_version); | |
31816 | ||
31817 | -u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]) | |
31818 | +u16 capi20_get_serial(u32 contr, u8 *serial) | |
31819 | { | |
31820 | struct capi_ctr *card; | |
31821 | ||
31822 | if (contr == 0) { | |
31823 | - strlcpy(serial, driver_serial, sizeof(serial)); | |
31824 | + strlcpy(serial, driver_serial, CAPI_SERIAL_LEN); | |
31825 | return CAPI_NOERROR; | |
31826 | } | |
31827 | card = get_capi_ctr_by_nr(contr); | |
31828 | if (!card || card->cardstate != CARD_RUNNING) | |
31829 | return CAPI_REGNOTINSTALLED; | |
31830 | ||
31831 | - strlcpy((void *) serial, card->serial, sizeof(serial)); | |
31832 | + strlcpy((void *) serial, card->serial, CAPI_SERIAL_LEN); | |
31833 | return CAPI_NOERROR; | |
31834 | } | |
31835 | ||
31836 | diff -Nru a/drivers/isdn/hardware/avm/Kconfig b/drivers/isdn/hardware/avm/Kconfig | |
31837 | --- a/drivers/isdn/hardware/avm/Kconfig Thu Nov 14 08:10:48 2002 | |
31838 | +++ b/drivers/isdn/hardware/avm/Kconfig Mon Aug 25 07:15:22 2003 | |
31839 | @@ -12,13 +12,13 @@ | |
31840 | ||
31841 | config ISDN_DRV_AVMB1_B1ISA | |
31842 | tristate "AVM B1 ISA support" | |
31843 | - depends on CAPI_AVM && ISDN_CAPI && ISA | |
31844 | + depends on CAPI_AVM && ISDN_CAPI && ISA && BROKEN_ON_SMP | |
31845 | help | |
31846 | Enable support for the ISA version of the AVM B1 card. | |
31847 | ||
31848 | config ISDN_DRV_AVMB1_B1PCI | |
31849 | tristate "AVM B1 PCI support" | |
31850 | - depends on CAPI_AVM && ISDN_CAPI && PCI | |
31851 | + depends on CAPI_AVM && ISDN_CAPI && PCI && BROKEN_ON_SMP | |
31852 | help | |
31853 | Enable support for the PCI version of the AVM B1 card. | |
31854 | ||
31855 | @@ -30,14 +30,14 @@ | |
31856 | ||
31857 | config ISDN_DRV_AVMB1_T1ISA | |
31858 | tristate "AVM T1/T1-B ISA support" | |
31859 | - depends on CAPI_AVM && ISDN_CAPI && ISA | |
31860 | + depends on CAPI_AVM && ISDN_CAPI && ISA && BROKEN_ON_SMP | |
31861 | help | |
31862 | Enable support for the AVM T1 T1B card. | |
31863 | Note: This is a PRI card and handle 30 B-channels. | |
31864 | ||
31865 | config ISDN_DRV_AVMB1_B1PCMCIA | |
31866 | tristate "AVM B1/M1/M2 PCMCIA support" | |
31867 | - depends on CAPI_AVM && ISDN_CAPI | |
31868 | + depends on CAPI_AVM && ISDN_CAPI && BROKEN_ON_SMP | |
31869 | help | |
31870 | Enable support for the PCMCIA version of the AVM B1 card. | |
31871 | ||
31872 | @@ -50,14 +50,14 @@ | |
31873 | ||
31874 | config ISDN_DRV_AVMB1_T1PCI | |
31875 | tristate "AVM T1/T1-B PCI support" | |
31876 | - depends on CAPI_AVM && ISDN_CAPI && PCI | |
31877 | + depends on CAPI_AVM && ISDN_CAPI && PCI && BROKEN_ON_SMP | |
31878 | help | |
31879 | Enable support for the AVM T1 T1B card. | |
31880 | Note: This is a PRI card and handle 30 B-channels. | |
31881 | ||
31882 | config ISDN_DRV_AVMB1_C4 | |
31883 | tristate "AVM C4/C2 support" | |
31884 | - depends on CAPI_AVM && ISDN_CAPI && PCI | |
31885 | + depends on CAPI_AVM && ISDN_CAPI && PCI && BROKEN_ON_SMP | |
31886 | help | |
31887 | Enable support for the AVM C4/C2 PCI cards. | |
31888 | These cards handle 4/2 BRI ISDN lines (8/4 channels). | |
31889 | diff -Nru a/drivers/isdn/hardware/avm/avmcard.h b/drivers/isdn/hardware/avm/avmcard.h | |
31890 | --- a/drivers/isdn/hardware/avm/avmcard.h Mon Apr 21 03:58:37 2003 | |
31891 | +++ b/drivers/isdn/hardware/avm/avmcard.h Wed Sep 3 03:09:05 2003 | |
31892 | @@ -95,8 +95,8 @@ | |
31893 | ||
31894 | struct avmctrl_info *ctrlinfo; | |
31895 | ||
31896 | - int nr_controllers; | |
31897 | - int nlogcontr; | |
31898 | + u_int nr_controllers; | |
31899 | + u_int nlogcontr; | |
31900 | struct list_head list; | |
31901 | } avmcard; | |
31902 | ||
31903 | diff -Nru a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c | |
31904 | --- a/drivers/isdn/hardware/avm/b1.c Sun May 25 17:00:00 2003 | |
31905 | +++ b/drivers/isdn/hardware/avm/b1.c Wed Sep 3 03:09:05 2003 | |
31906 | @@ -148,30 +148,31 @@ | |
31907 | card->revision = inb(card->port + B1_REVISION); | |
31908 | } | |
31909 | ||
31910 | +#define FWBUF_SIZE 256 | |
31911 | int b1_load_t4file(avmcard *card, capiloaddatapart * t4file) | |
31912 | { | |
31913 | - unsigned char buf[256]; | |
31914 | + unsigned char buf[FWBUF_SIZE]; | |
31915 | unsigned char *dp; | |
31916 | int i, left; | |
31917 | unsigned int base = card->port; | |
31918 | ||
31919 | dp = t4file->data; | |
31920 | left = t4file->len; | |
31921 | - while (left > sizeof(buf)) { | |
31922 | + while (left > FWBUF_SIZE) { | |
31923 | if (t4file->user) { | |
31924 | - if (copy_from_user(buf, dp, sizeof(buf))) | |
31925 | + if (copy_from_user(buf, dp, FWBUF_SIZE)) | |
31926 | return -EFAULT; | |
31927 | } else { | |
31928 | - memcpy(buf, dp, sizeof(buf)); | |
31929 | + memcpy(buf, dp, FWBUF_SIZE); | |
31930 | } | |
31931 | - for (i = 0; i < sizeof(buf); i++) | |
31932 | + for (i = 0; i < FWBUF_SIZE; i++) | |
31933 | if (b1_save_put_byte(base, buf[i]) < 0) { | |
31934 | printk(KERN_ERR "%s: corrupted firmware file ?\n", | |
31935 | card->name); | |
31936 | return -EIO; | |
31937 | } | |
31938 | - left -= sizeof(buf); | |
31939 | - dp += sizeof(buf); | |
31940 | + left -= FWBUF_SIZE; | |
31941 | + dp += FWBUF_SIZE; | |
31942 | } | |
31943 | if (left) { | |
31944 | if (t4file->user) { | |
31945 | @@ -192,7 +193,7 @@ | |
31946 | ||
31947 | int b1_load_config(avmcard *card, capiloaddatapart * config) | |
31948 | { | |
31949 | - unsigned char buf[256]; | |
31950 | + unsigned char buf[FWBUF_SIZE]; | |
31951 | unsigned char *dp; | |
31952 | unsigned int base = card->port; | |
31953 | int i, j, left; | |
31954 | @@ -205,21 +206,21 @@ | |
31955 | b1_put_byte(base, SEND_CONFIG); | |
31956 | b1_put_word(base, left); | |
31957 | } | |
31958 | - while (left > sizeof(buf)) { | |
31959 | + while (left > FWBUF_SIZE) { | |
31960 | if (config->user) { | |
31961 | - if (copy_from_user(buf, dp, sizeof(buf))) | |
31962 | + if (copy_from_user(buf, dp, FWBUF_SIZE)) | |
31963 | return -EFAULT; | |
31964 | } else { | |
31965 | - memcpy(buf, dp, sizeof(buf)); | |
31966 | + memcpy(buf, dp, FWBUF_SIZE); | |
31967 | } | |
31968 | - for (i = 0; i < sizeof(buf); ) { | |
31969 | + for (i = 0; i < FWBUF_SIZE; ) { | |
31970 | b1_put_byte(base, SEND_CONFIG); | |
31971 | for (j=0; j < 4; j++) { | |
31972 | b1_put_byte(base, buf[i++]); | |
31973 | } | |
31974 | } | |
31975 | - left -= sizeof(buf); | |
31976 | - dp += sizeof(buf); | |
31977 | + left -= FWBUF_SIZE; | |
31978 | + dp += FWBUF_SIZE; | |
31979 | } | |
31980 | if (left) { | |
31981 | if (config->user) { | |
31982 | @@ -785,7 +786,7 @@ | |
31983 | char rev[32]; | |
31984 | ||
31985 | if ((p = strchr(revision, ':')) != 0 && p[1]) { | |
31986 | - strlcpy(rev, p + 2, sizeof(rev)); | |
31987 | + strlcpy(rev, p + 2, 32); | |
31988 | if ((p = strchr(rev, '$')) != 0 && p > rev) | |
31989 | *(p-1) = 0; | |
31990 | } else | |
31991 | diff -Nru a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c | |
31992 | --- a/drivers/isdn/hardware/avm/c4.c Thu Jul 31 08:59:04 2003 | |
31993 | +++ b/drivers/isdn/hardware/avm/c4.c Wed Sep 3 03:09:05 2003 | |
31994 | @@ -189,7 +189,7 @@ | |
31995 | { | |
31996 | u32 val; | |
31997 | unsigned char *dp; | |
31998 | - int left; | |
31999 | + u_int left; | |
32000 | u32 loadoff = 0; | |
32001 | ||
32002 | dp = t4file->data; | |
32003 | @@ -664,7 +664,7 @@ | |
32004 | u32 status = c4inmeml(card->mbase+DOORBELL); | |
32005 | ||
32006 | if (status & DBELL_RESET_HOST) { | |
32007 | - int i; | |
32008 | + u_int i; | |
32009 | c4outmeml(card->mbase+PCI_OUT_INT_MASK, 0x0c); | |
32010 | if (card->nlogcontr == 0) | |
32011 | return IRQ_HANDLED; | |
32012 | @@ -791,7 +791,8 @@ | |
32013 | { | |
32014 | u8 val[4]; | |
32015 | unsigned char *dp; | |
32016 | - int left, retval; | |
32017 | + u_int left; | |
32018 | + int retval; | |
32019 | ||
32020 | if ((retval = queue_sendconfigword(card, 1)) != 0) | |
32021 | return retval; | |
32022 | @@ -880,7 +881,7 @@ | |
32023 | { | |
32024 | avmcard *card = ((avmctrl_info *)(ctrl->driverdata))->card; | |
32025 | avmctrl_info *cinfo; | |
32026 | - int i; | |
32027 | + u_int i; | |
32028 | ||
32029 | c4_reset(card); | |
32030 | ||
32031 | @@ -896,7 +897,7 @@ | |
32032 | { | |
32033 | avmcard *card = pci_get_drvdata(pdev); | |
32034 | avmctrl_info *cinfo; | |
32035 | - int i; | |
32036 | + u_int i; | |
32037 | ||
32038 | c4_reset(card); | |
32039 | ||
32040 | diff -Nru a/drivers/isdn/hardware/eicon/capifunc.c b/drivers/isdn/hardware/eicon/capifunc.c | |
32041 | --- a/drivers/isdn/hardware/eicon/capifunc.c Sun May 25 17:00:00 2003 | |
32042 | +++ b/drivers/isdn/hardware/eicon/capifunc.c Wed Sep 3 15:27:36 2003 | |
32043 | @@ -22,8 +22,8 @@ | |
32044 | #define DBG_MINIMUM (DL_LOG + DL_FTL + DL_ERR) | |
32045 | #define DBG_DEFAULT (DBG_MINIMUM + DL_XLOG + DL_REG) | |
32046 | ||
32047 | -static DIVA_CAPI_ADAPTER *adapter = (DIVA_CAPI_ADAPTER *) NULL; | |
32048 | -static APPL *application = (APPL *) NULL; | |
32049 | +DIVA_CAPI_ADAPTER *adapter = (DIVA_CAPI_ADAPTER *) NULL; | |
32050 | +APPL *application = (APPL *) NULL; | |
32051 | byte max_appl = MAX_APPL; | |
32052 | static CAPI_MSG *mapped_msg = (CAPI_MSG *) NULL; | |
32053 | ||
32054 | @@ -45,7 +45,7 @@ | |
32055 | static void DIRequest(ENTITY * e); | |
32056 | static DESCRIPTOR MAdapter; | |
32057 | static DESCRIPTOR DAdapter; | |
32058 | -static byte max_adapter = 0; | |
32059 | +byte max_adapter = 0; | |
32060 | static byte ControllerMap[MAX_DESCRIPTORS + 1]; | |
32061 | ||
32062 | ||
32063 | @@ -111,7 +111,7 @@ | |
32064 | /* | |
32065 | * Controller mapping | |
32066 | */ | |
32067 | -static byte MapController(byte Controller) | |
32068 | +byte MapController(byte Controller) | |
32069 | { | |
32070 | byte i; | |
32071 | byte MappedController = 0; | |
32072 | @@ -750,8 +750,6 @@ | |
32073 | void **xbuffer_ptr, **xbuffer_internal; | |
32074 | diva_os_spin_lock_magic_t old_irql; | |
32075 | ||
32076 | - DIVA_LOCK_MODULE; | |
32077 | - | |
32078 | if (diva_os_in_irq()) { | |
32079 | DBG_ERR(("CAPI_REGISTER - in irq context !")) | |
32080 | return; | |
32081 | @@ -777,6 +775,11 @@ | |
32082 | return; /* appl already registered */ | |
32083 | } | |
32084 | ||
32085 | + if (!try_module_get(ctrl->owner)) { | |
32086 | + printk(KERN_WARNING "%s: cannot reserve module\n", __FUNCTION__); | |
32087 | + return; | |
32088 | + } | |
32089 | + | |
32090 | /* alloc memory */ | |
32091 | ||
32092 | bnum = rp->level3cnt * rp->datablkcnt; | |
32093 | @@ -784,6 +787,7 @@ | |
32094 | ||
32095 | if (!(DataNCCI = diva_os_malloc(0, bnum * sizeof(word)))) { | |
32096 | DBG_ERR(("CAPI_REGISTER - memory allocation failed")) | |
32097 | + module_put(ctrl->owner); | |
32098 | return; | |
32099 | } | |
32100 | memset(DataNCCI, 0, bnum * sizeof(word)); | |
32101 | @@ -791,6 +795,7 @@ | |
32102 | if (!(DataFlags = diva_os_malloc(0, bnum * sizeof(word)))) { | |
32103 | DBG_ERR(("CAPI_REGISTER - memory allocation failed")) | |
32104 | diva_os_free(0, DataNCCI); | |
32105 | + module_put(ctrl->owner); | |
32106 | return; | |
32107 | } | |
32108 | memset(DataFlags, 0, bnum * sizeof(word)); | |
32109 | @@ -799,6 +804,7 @@ | |
32110 | DBG_ERR(("CAPI_REGISTER - memory allocation failed")) | |
32111 | diva_os_free(0, DataNCCI); | |
32112 | diva_os_free(0, DataFlags); | |
32113 | + module_put(ctrl->owner); | |
32114 | return; | |
32115 | } | |
32116 | memset(ReceiveBuffer, 0, bnum * rp->datablklen); | |
32117 | @@ -808,6 +814,7 @@ | |
32118 | diva_os_free(0, DataNCCI); | |
32119 | diva_os_free(0, DataFlags); | |
32120 | diva_os_free(0, ReceiveBuffer); | |
32121 | + module_put(ctrl->owner); | |
32122 | return; | |
32123 | } | |
32124 | memset(xbuffer_used, 0, xnum); | |
32125 | @@ -818,6 +825,7 @@ | |
32126 | diva_os_free(0, DataFlags); | |
32127 | diva_os_free(0, ReceiveBuffer); | |
32128 | diva_os_free(0, xbuffer_used); | |
32129 | + module_put(ctrl->owner); | |
32130 | return; | |
32131 | } | |
32132 | memset(xbuffer_ptr, 0, xnum * sizeof(void *)); | |
32133 | @@ -829,6 +837,7 @@ | |
32134 | diva_os_free(0, ReceiveBuffer); | |
32135 | diva_os_free(0, xbuffer_used); | |
32136 | diva_os_free(0, xbuffer_ptr); | |
32137 | + module_put(ctrl->owner); | |
32138 | return; | |
32139 | } | |
32140 | memset(xbuffer_internal, 0, xnum * sizeof(void *)); | |
32141 | @@ -848,6 +857,7 @@ | |
32142 | diva_os_free(0, xbuffer_used); | |
32143 | diva_os_free(0, xbuffer_ptr); | |
32144 | diva_os_free(0, xbuffer_internal); | |
32145 | + module_put(ctrl->owner); | |
32146 | return; | |
32147 | } | |
32148 | } | |
32149 | @@ -935,7 +945,7 @@ | |
32150 | } | |
32151 | diva_os_leave_spin_lock(&api_lock, &old_irql, "release_appl"); | |
32152 | ||
32153 | - DIVA_UNLOCK_MODULE; | |
32154 | + module_put(ctrl->owner); | |
32155 | } | |
32156 | ||
32157 | /* | |
32158 | diff -Nru a/drivers/isdn/hardware/eicon/divasi.c b/drivers/isdn/hardware/eicon/divasi.c | |
32159 | --- a/drivers/isdn/hardware/eicon/divasi.c Mon Jul 21 12:08:32 2003 | |
32160 | +++ b/drivers/isdn/hardware/eicon/divasi.c Tue Aug 26 09:25:41 2003 | |
32161 | @@ -432,7 +432,7 @@ | |
32162 | ||
32163 | static int um_idi_release(struct inode *inode, struct file *file) | |
32164 | { | |
32165 | - unsigned int adapter_nr = minor(inode->i_rdev); | |
32166 | + unsigned int adapter_nr = iminor(inode); | |
32167 | int ret = 0; | |
32168 | ||
32169 | if (!(file->private_data)) { | |
32170 | diff -Nru a/drivers/isdn/hardware/eicon/platform.h b/drivers/isdn/hardware/eicon/platform.h | |
32171 | --- a/drivers/isdn/hardware/eicon/platform.h Wed Nov 13 12:59:12 2002 | |
32172 | +++ b/drivers/isdn/hardware/eicon/platform.h Wed Sep 3 15:24:15 2003 | |
32173 | @@ -201,8 +201,10 @@ | |
32174 | /* | |
32175 | ** module locking | |
32176 | */ | |
32177 | +/* | |
32178 | #define DIVA_LOCK_MODULE MOD_INC_USE_COUNT | |
32179 | #define DIVA_UNLOCK_MODULE MOD_DEC_USE_COUNT | |
32180 | +*/ | |
32181 | ||
32182 | /* | |
32183 | ** Spin Lock framework | |
32184 | diff -Nru a/drivers/isdn/hisax/amd7930_fn.c b/drivers/isdn/hisax/amd7930_fn.c | |
32185 | --- a/drivers/isdn/hisax/amd7930_fn.c Sat Apr 19 13:06:05 2003 | |
32186 | +++ b/drivers/isdn/hisax/amd7930_fn.c Wed Sep 3 03:09:05 2003 | |
32187 | @@ -692,7 +692,7 @@ | |
32188 | if (cs->debug & L1_DEB_ISAC) | |
32189 | debugl1(cs, "Amd7930: dbusy_timer_handler: DSR1=0x%02X, DSR2=0x%02X, DER=0x%04X, cs->tx_skb->len=%u, tx_stat=%u, dtcr=%u, cs->tx_cnt=%u", dsr1, dsr2, der, cs->tx_skb->len, cs->dc.amd7930.tx_xmtlen, dtcr, cs->tx_cnt); | |
32190 | ||
32191 | - if ((cs->dc.amd7930.tx_xmtlen - dtcr) < cs->tx_cnt) { /* D-Channel Busy */ | |
32192 | + if ((int)(cs->dc.amd7930.tx_xmtlen - dtcr) < cs->tx_cnt) { /* D-Channel Busy */ | |
32193 | test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags); | |
32194 | stptr = cs->stlist; | |
32195 | while (stptr != NULL) { | |
32196 | diff -Nru a/drivers/isdn/hisax/callc.c b/drivers/isdn/hisax/callc.c | |
32197 | --- a/drivers/isdn/hisax/callc.c Mon May 26 17:51:43 2003 | |
32198 | +++ b/drivers/isdn/hisax/callc.c Wed Sep 3 03:09:40 2003 | |
32199 | @@ -1758,7 +1758,7 @@ | |
32200 | /* protocol specific io commands */ | |
32201 | case (ISDN_CMD_PROT_IO): | |
32202 | for (st = csta->stlist; st; st = st->next) | |
32203 | - if (st->protocol == (ic->arg & 0xFF)) | |
32204 | + if ((u_int)st->protocol == (ic->arg & 0xFF)) | |
32205 | return(st->l3.l4l3_proto(st, ic)); | |
32206 | return(-EINVAL); | |
32207 | break; | |
32208 | diff -Nru a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c | |
32209 | --- a/drivers/isdn/hisax/diva.c Mon May 12 18:59:22 2003 | |
32210 | +++ b/drivers/isdn/hisax/diva.c Wed Sep 3 02:15:47 2003 | |
32211 | @@ -751,17 +751,17 @@ | |
32212 | card->para[1] = pnp_port_start(pd, 0); | |
32213 | card->para[0] = pnp_irq(pd, 0); | |
32214 | if (pdev->function == ISAPNP_FUNCTION(0xA1)) { | |
32215 | - if (diva_ipac_isa_probe(cs->card, cs)) | |
32216 | + if (diva_ipac_isa_probe(card->cs, card)) | |
32217 | return 0; | |
32218 | return 1; | |
32219 | } else { | |
32220 | - if (diva_isac_isa_probe(cs->card, cs)) | |
32221 | + if (diva_isac_isa_probe(card->cs, card)) | |
32222 | return 0; | |
32223 | return 1; | |
32224 | - } else { | |
32225 | - printk(KERN_ERR "Diva PnP: PnP error card found, no device\n"); | |
32226 | - return(0); | |
32227 | } | |
32228 | + } else { | |
32229 | + printk(KERN_ERR "Diva PnP: PnP error card found, no device\n"); | |
32230 | + return(0); | |
32231 | } | |
32232 | pdev++; | |
32233 | pnp_c=NULL; | |
32234 | diff -Nru a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c | |
32235 | --- a/drivers/isdn/hisax/elsa.c Mon May 12 18:59:22 2003 | |
32236 | +++ b/drivers/isdn/hisax/elsa.c Wed Sep 3 04:35:55 2003 | |
32237 | @@ -838,7 +838,7 @@ | |
32238 | cs->hw.elsa.status |= ELSA_BAD_PWR; | |
32239 | } | |
32240 | switch (cs->subtyp) { | |
32241 | - case ELSA_PCFPRO: bytecnt = 16; break; | |
32242 | + case ELSA_PCFPRO: bytecnt = 16; break; | |
32243 | } | |
32244 | if (!request_io(&cs->rs, cs->hw.elsa.base, bytecnt, "elsa isdn")) | |
32245 | goto err; | |
32246 | diff -Nru a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c | |
32247 | --- a/drivers/isdn/hisax/elsa_ser.c Sat Jan 4 14:10:11 2003 | |
32248 | +++ b/drivers/isdn/hisax/elsa_ser.c Wed Sep 3 03:09:40 2003 | |
32249 | @@ -255,7 +255,7 @@ | |
32250 | write_modem(struct BCState *bcs) { | |
32251 | int ret=0; | |
32252 | struct IsdnCardState *cs = bcs->cs; | |
32253 | - int count, len, fp; | |
32254 | + u_int count, len, fp; | |
32255 | unsigned long flags; | |
32256 | ||
32257 | if (!bcs->tx_skb) | |
32258 | @@ -435,8 +435,8 @@ | |
32259 | } | |
32260 | ||
32261 | void | |
32262 | -modem_write_cmd(struct IsdnCardState *cs, u8 *buf, int len) { | |
32263 | - int count, fp; | |
32264 | +modem_write_cmd(struct IsdnCardState *cs, u8 *buf, u_int len) { | |
32265 | + u_int count, fp; | |
32266 | u8 *msg = buf; | |
32267 | unsigned long flags; | |
32268 | ||
32269 | diff -Nru a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c | |
32270 | --- a/drivers/isdn/hisax/hfc_2bds0.c Sat Jan 11 11:24:09 2003 | |
32271 | +++ b/drivers/isdn/hisax/hfc_2bds0.c Wed Sep 3 03:09:40 2003 | |
32272 | @@ -264,8 +264,9 @@ | |
32273 | hfc_fill_fifo(struct BCState *bcs) | |
32274 | { | |
32275 | struct IsdnCardState *cs = bcs->cs; | |
32276 | - int idx, fcnt; | |
32277 | - int count; | |
32278 | + u_int idx; | |
32279 | + int fcnt; | |
32280 | + u_int count; | |
32281 | u8 cip; | |
32282 | ||
32283 | if (!bcs->tx_skb) | |
32284 | @@ -636,8 +637,8 @@ | |
32285 | static void | |
32286 | hfc_fill_dfifo(struct IsdnCardState *cs) | |
32287 | { | |
32288 | - int idx, fcnt; | |
32289 | - int count; | |
32290 | + int fcnt; | |
32291 | + u_int idx, count; | |
32292 | u8 cip; | |
32293 | ||
32294 | if (!cs->tx_skb) | |
32295 | diff -Nru a/drivers/isdn/hisax/hfc_2bs0.c b/drivers/isdn/hisax/hfc_2bs0.c | |
32296 | --- a/drivers/isdn/hisax/hfc_2bs0.c Sun Jan 12 16:12:37 2003 | |
32297 | +++ b/drivers/isdn/hisax/hfc_2bs0.c Wed Sep 3 03:09:40 2003 | |
32298 | @@ -249,8 +249,8 @@ | |
32299 | hfc_fill_fifo(struct BCState *bcs) | |
32300 | { | |
32301 | struct IsdnCardState *cs = bcs->cs; | |
32302 | - int idx, fcnt; | |
32303 | - int count; | |
32304 | + int fcnt; | |
32305 | + u_int idx, count; | |
32306 | int z1, z2; | |
32307 | u8 cip; | |
32308 | ||
32309 | diff -Nru a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c | |
32310 | --- a/drivers/isdn/hisax/hfc_pci.c Mon Apr 21 03:58:37 2003 | |
32311 | +++ b/drivers/isdn/hisax/hfc_pci.c Wed Sep 3 03:09:40 2003 | |
32312 | @@ -487,8 +487,8 @@ | |
32313 | static void | |
32314 | hfcpci_fill_dfifo(struct IsdnCardState *cs) | |
32315 | { | |
32316 | - int fcnt; | |
32317 | - int count, new_z1, maxlen; | |
32318 | + int fcnt, new_z1, maxlen; | |
32319 | + u_int count; | |
32320 | dfifo_type *df; | |
32321 | u8 *src, *dst, new_f1; | |
32322 | ||
32323 | @@ -533,7 +533,7 @@ | |
32324 | src = cs->tx_skb->data; /* source pointer */ | |
32325 | dst = df->data + le16_to_cpu(df->za[df->f1 & D_FREG_MASK].z1); | |
32326 | maxlen = D_FIFO_SIZE - le16_to_cpu(df->za[df->f1 & D_FREG_MASK].z1); /* end fifo */ | |
32327 | - if (maxlen > count) | |
32328 | + if (maxlen > (int)count) | |
32329 | maxlen = count; /* limit size */ | |
32330 | memcpy(dst, src, maxlen); /* first copy */ | |
32331 | ||
32332 | @@ -559,8 +559,8 @@ | |
32333 | hfcpci_fill_fifo(struct BCState *bcs) | |
32334 | { | |
32335 | struct IsdnCardState *cs = bcs->cs; | |
32336 | - int maxlen, fcnt; | |
32337 | - int count, new_z1; | |
32338 | + int maxlen, fcnt, new_z1; | |
32339 | + u_int count; | |
32340 | bzfifo_type *bz; | |
32341 | u8 *bdata; | |
32342 | u8 new_f1, *src, *dst; | |
32343 | @@ -591,7 +591,7 @@ | |
32344 | fcnt = B_FIFO_SIZE - fcnt; /* remaining bytes to send */ | |
32345 | ||
32346 | while ((fcnt < 2 * HFCPCI_BTRANS_THRESHOLD) && (bcs->tx_skb)) { | |
32347 | - if (bcs->tx_skb->len < B_FIFO_SIZE - fcnt) { | |
32348 | + if ((int)bcs->tx_skb->len < (B_FIFO_SIZE - fcnt)) { | |
32349 | /* data is suitable for fifo */ | |
32350 | count = bcs->tx_skb->len; | |
32351 | ||
32352 | @@ -601,7 +601,7 @@ | |
32353 | src = bcs->tx_skb->data; /* source pointer */ | |
32354 | dst = bdata + (le16_to_cpu(*z1t) - B_SUB_VAL); | |
32355 | maxlen = (B_FIFO_SIZE + B_SUB_VAL) - le16_to_cpu(*z1t); /* end of fifo */ | |
32356 | - if (maxlen > count) | |
32357 | + if (maxlen > (int)count) | |
32358 | maxlen = count; /* limit size */ | |
32359 | memcpy(dst, src, maxlen); /* first copy */ | |
32360 | ||
32361 | @@ -661,7 +661,7 @@ | |
32362 | src = bcs->tx_skb->data; /* source pointer */ | |
32363 | dst = bdata + (le16_to_cpu(bz->za[bz->f1].z1) - B_SUB_VAL); | |
32364 | maxlen = (B_FIFO_SIZE + B_SUB_VAL) - le16_to_cpu(bz->za[bz->f1].z1); /* end fifo */ | |
32365 | - if (maxlen > count) | |
32366 | + if (maxlen > (int)count) | |
32367 | maxlen = count; /* limit size */ | |
32368 | memcpy(dst, src, maxlen); /* first copy */ | |
32369 | ||
32370 | diff -Nru a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c | |
32371 | --- a/drivers/isdn/hisax/hfc_sx.c Mon Apr 21 03:58:37 2003 | |
32372 | +++ b/drivers/isdn/hisax/hfc_sx.c Wed Sep 3 03:09:40 2003 | |
32373 | @@ -145,7 +145,7 @@ | |
32374 | count = z2 - z1; | |
32375 | if (count <= 0) | |
32376 | count += fifo_size; /* free bytes */ | |
32377 | - if (count < skb->len+1) return(0); /* no room */ | |
32378 | + if (count < (int)(skb->len+1)) return(0); /* no room */ | |
32379 | count = fifo_size - count; /* bytes still not send */ | |
32380 | if (count > 2 * trans_max) return(0); /* delay too long */ | |
32381 | count = skb->len; | |
32382 | @@ -182,7 +182,7 @@ | |
32383 | if (cs->debug & L1_DEB_ISAC_FIFO) | |
32384 | debugl1(cs, "hfcsx_write_fifo %d count(%ld/%d)", | |
32385 | fifo, skb->len, count); | |
32386 | - if (count < skb->len) { | |
32387 | + if (count < (int)skb->len) { | |
32388 | if (cs->debug & L1_DEB_ISAC_FIFO) | |
32389 | debugl1(cs, "hfcsx_write_fifo %d no fifo mem", fifo); | |
32390 | return(0); | |
32391 | diff -Nru a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h | |
32392 | --- a/drivers/isdn/hisax/hisax.h Mon Apr 21 03:58:37 2003 | |
32393 | +++ b/drivers/isdn/hisax/hisax.h Wed Sep 3 03:09:40 2003 | |
32394 | @@ -265,7 +265,7 @@ | |
32395 | struct Layer2 { | |
32396 | int tei; | |
32397 | int sap; | |
32398 | - int maxlen; | |
32399 | + u_int maxlen; | |
32400 | unsigned long flag; | |
32401 | unsigned int vs, va, vr; | |
32402 | int rc; | |
32403 | diff -Nru a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c | |
32404 | --- a/drivers/isdn/hisax/hisax_fcpcipnp.c Thu Jul 31 16:47:19 2003 | |
32405 | +++ b/drivers/isdn/hisax/hisax_fcpcipnp.c Wed Sep 3 03:15:17 2003 | |
32406 | @@ -38,6 +38,8 @@ | |
32407 | #define __debug_variable debug | |
32408 | #include "hisax_debug.h" | |
32409 | ||
32410 | +// #define CONFIG_PNP_CARD 1 | |
32411 | + | |
32412 | #ifdef CONFIG_HISAX_DEBUG | |
32413 | static int debug = 0; | |
32414 | MODULE_PARM(debug, "i"); | |
32415 | @@ -365,8 +367,8 @@ | |
32416 | { | |
32417 | struct fritz_adapter *adapter = bcs->adapter; | |
32418 | struct sk_buff *skb = bcs->tx_skb; | |
32419 | - int count; | |
32420 | - int fifo_size = 32; | |
32421 | + u_int count; | |
32422 | + u_int fifo_size = 32; | |
32423 | unsigned long flags; | |
32424 | unsigned char *p; | |
32425 | ||
32426 | diff -Nru a/drivers/isdn/hisax/ipacx.c b/drivers/isdn/hisax/ipacx.c | |
32427 | --- a/drivers/isdn/hisax/ipacx.c Sun Jan 12 16:12:37 2003 | |
32428 | +++ b/drivers/isdn/hisax/ipacx.c Wed Sep 3 06:24:04 2003 | |
32429 | @@ -736,5 +736,6 @@ | |
32430 | cs->bc_hw_ops = ipacx_bc_ops; | |
32431 | val = ipacx_read_reg(cs, IPACX_ID) & 0x3f; | |
32432 | printk(KERN_INFO "HiSax: IPACX Design Id: %#x\n", val); | |
32433 | + return 0; | |
32434 | } | |
32435 | ||
32436 | diff -Nru a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c | |
32437 | --- a/drivers/isdn/hisax/isar.c Sun Jan 12 16:12:37 2003 | |
32438 | +++ b/drivers/isdn/hisax/isar.c Wed Sep 3 03:09:40 2003 | |
32439 | @@ -677,7 +677,7 @@ | |
32440 | if (!(bcs->hw.isar.reg->bstat & | |
32441 | (bcs->hw.isar.dpath == 1 ? BSTAT_RDM1 : BSTAT_RDM2))) | |
32442 | return; | |
32443 | - if (bcs->tx_skb->len > bcs->hw.isar.mml) { | |
32444 | + if (bcs->tx_skb->len > (u_int)bcs->hw.isar.mml) { | |
32445 | msb = 0; | |
32446 | count = bcs->hw.isar.mml; | |
32447 | } else { | |
32448 | diff -Nru a/drivers/isdn/hisax/isdnl1.h b/drivers/isdn/hisax/isdnl1.h | |
32449 | --- a/drivers/isdn/hisax/isdnl1.h Sat Feb 22 09:10:42 2003 | |
32450 | +++ b/drivers/isdn/hisax/isdnl1.h Wed Sep 3 03:09:40 2003 | |
32451 | @@ -354,7 +354,7 @@ | |
32452 | } | |
32453 | ||
32454 | static inline unsigned char * | |
32455 | -xmit_fill_fifo_b(struct BCState *bcs, int fifo_size, int *count, int *more) | |
32456 | +xmit_fill_fifo_b(struct BCState *bcs, u_int fifo_size, int *count, int *more) | |
32457 | { | |
32458 | struct IsdnCardState *cs = bcs->cs; | |
32459 | unsigned char *p; | |
32460 | @@ -391,7 +391,7 @@ | |
32461 | } | |
32462 | ||
32463 | static inline unsigned char * | |
32464 | -xmit_fill_fifo_d(struct IsdnCardState *cs, int fifo_size, int *count, int *more) | |
32465 | +xmit_fill_fifo_d(struct IsdnCardState *cs, u_int fifo_size, int *count, int *more) | |
32466 | { | |
32467 | unsigned char *p; | |
32468 | ||
32469 | diff -Nru a/drivers/isdn/hisax/isdnl2.c b/drivers/isdn/hisax/isdnl2.c | |
32470 | --- a/drivers/isdn/hisax/isdnl2.c Fri Feb 7 00:20:36 2003 | |
32471 | +++ b/drivers/isdn/hisax/isdnl2.c Wed Sep 3 03:09:40 2003 | |
32472 | @@ -103,7 +103,7 @@ | |
32473 | "EV_L2_FRAME_ERROR", | |
32474 | }; | |
32475 | ||
32476 | -static int l2addrsize(struct Layer2 *l2); | |
32477 | +static u_int l2addrsize(struct Layer2 *l2); | |
32478 | ||
32479 | static void | |
32480 | set_peer_busy(struct Layer2 *l2) { | |
32481 | @@ -178,14 +178,14 @@ | |
32482 | clear_peer_busy(l2); | |
32483 | } | |
32484 | ||
32485 | -inline int | |
32486 | +inline u_int | |
32487 | l2headersize(struct Layer2 *l2, int ui) | |
32488 | { | |
32489 | return (((test_bit(FLG_MOD128, &l2->flag) && (!ui)) ? 2 : 1) + | |
32490 | (test_bit(FLG_LAPD, &l2->flag) ? 2 : 1)); | |
32491 | } | |
32492 | ||
32493 | -inline int | |
32494 | +inline u_int | |
32495 | l2addrsize(struct Layer2 *l2) | |
32496 | { | |
32497 | return (test_bit(FLG_LAPD, &l2->flag) ? 2 : 1); | |
32498 | @@ -295,7 +295,7 @@ | |
32499 | int | |
32500 | iframe_error(struct PStack *st, struct sk_buff *skb) | |
32501 | { | |
32502 | - int i = l2addrsize(&st->l2) + (test_bit(FLG_MOD128, &st->l2.flag) ? 2 : 1); | |
32503 | + u_int i = l2addrsize(&st->l2) + (test_bit(FLG_MOD128, &st->l2.flag) ? 2 : 1); | |
32504 | int rsp = *skb->data & 0x2; | |
32505 | ||
32506 | if (test_bit(FLG_ORIG, &st->l2.flag)) | |
32507 | @@ -360,7 +360,7 @@ | |
32508 | int | |
32509 | FRMR_error(struct PStack *st, struct sk_buff *skb) | |
32510 | { | |
32511 | - int headers = l2addrsize(&st->l2) + 1; | |
32512 | + u_int headers = l2addrsize(&st->l2) + 1; | |
32513 | u8 *datap = skb->data + headers; | |
32514 | int rsp = *skb->data & 0x2; | |
32515 | ||
32516 | @@ -1066,8 +1066,8 @@ | |
32517 | struct PStack *st = fi->userdata; | |
32518 | struct sk_buff *skb = arg; | |
32519 | struct Layer2 *l2 = &(st->l2); | |
32520 | - int PollFlag, ns, i; | |
32521 | - unsigned int nr; | |
32522 | + int PollFlag, i; | |
32523 | + unsigned int nr, ns; | |
32524 | ||
32525 | i = l2addrsize(l2); | |
32526 | if (test_bit(FLG_MOD128, &l2->flag)) { | |
32527 | @@ -1251,8 +1251,7 @@ | |
32528 | struct sk_buff *skb, *oskb; | |
32529 | struct Layer2 *l2 = &st->l2; | |
32530 | u8 header[MAX_HEADER_LEN]; | |
32531 | - int i; | |
32532 | - int unsigned p1; | |
32533 | + int unsigned p1, i; | |
32534 | unsigned long flags; | |
32535 | ||
32536 | if (!cansend(st)) | |
32537 | @@ -1632,7 +1631,7 @@ | |
32538 | { | |
32539 | struct sk_buff *skb = arg; | |
32540 | u8 *datap; | |
32541 | - int ret = 1, len; | |
32542 | + u_int ret = 1, len; | |
32543 | int c = 0; | |
32544 | ||
32545 | switch (pr) { | |
32546 | diff -Nru a/drivers/isdn/hisax/l3_1tr6.c b/drivers/isdn/hisax/l3_1tr6.c | |
32547 | --- a/drivers/isdn/hisax/l3_1tr6.c Sat Jan 4 07:35:39 2003 | |
32548 | +++ b/drivers/isdn/hisax/l3_1tr6.c Wed Sep 3 03:09:40 2003 | |
32549 | @@ -302,7 +302,8 @@ | |
32550 | l3_1tr6_info(struct l3_process *pc, u8 pr, void *arg) | |
32551 | { | |
32552 | u8 *p; | |
32553 | - int i, tmpcharge = 0; | |
32554 | + u_int i; | |
32555 | + int tmpcharge = 0; | |
32556 | char a_charge[8], tmp[32]; | |
32557 | struct sk_buff *skb = arg; | |
32558 | ||
32559 | @@ -400,7 +401,8 @@ | |
32560 | { | |
32561 | struct sk_buff *skb = arg; | |
32562 | u8 *p; | |
32563 | - int i, tmpcharge = 0; | |
32564 | + u_int i; | |
32565 | + int tmpcharge = 0; | |
32566 | char a_charge[8], tmp[32]; | |
32567 | ||
32568 | StopAllL3Timer(pc); | |
32569 | @@ -753,7 +755,8 @@ | |
32570 | static void | |
32571 | up1tr6(struct PStack *st, int pr, void *arg) | |
32572 | { | |
32573 | - int i, mt, cr; | |
32574 | + u_int i; | |
32575 | + int mt, cr; | |
32576 | struct l3_process *proc; | |
32577 | struct sk_buff *skb = arg; | |
32578 | char tmp[80]; | |
32579 | @@ -868,7 +871,8 @@ | |
32580 | static void | |
32581 | down1tr6(struct PStack *st, int pr, void *arg) | |
32582 | { | |
32583 | - int i, cr; | |
32584 | + u_int i; | |
32585 | + int cr; | |
32586 | struct l3_process *proc; | |
32587 | struct Channel *chan; | |
32588 | char tmp[80]; | |
32589 | @@ -915,7 +919,7 @@ | |
32590 | static void | |
32591 | man1tr6(struct PStack *st, int pr, void *arg) | |
32592 | { | |
32593 | - int i; | |
32594 | + u_int i; | |
32595 | struct l3_process *proc = arg; | |
32596 | ||
32597 | if (!proc) { | |
32598 | diff -Nru a/drivers/isdn/hisax/l3dss1.c b/drivers/isdn/hisax/l3dss1.c | |
32599 | --- a/drivers/isdn/hisax/l3dss1.c Mon Feb 24 10:22:41 2003 | |
32600 | +++ b/drivers/isdn/hisax/l3dss1.c Wed Sep 3 03:09:40 2003 | |
32601 | @@ -736,7 +736,7 @@ | |
32602 | p += l; | |
32603 | mt = *p++; | |
32604 | oldpos = 0; | |
32605 | - while ((p - skb->data) < skb->len) { | |
32606 | + while ((p - skb->data) < (int)skb->len) { | |
32607 | if ((*p & 0xf0) == 0x90) { /* shift codeset */ | |
32608 | old_codeset = codeset; | |
32609 | codeset = *p & 7; | |
32610 | @@ -2923,7 +2923,7 @@ | |
32611 | u8 tmp[16]; | |
32612 | u8 *p = tmp; | |
32613 | int l; | |
32614 | - int i; | |
32615 | + u_int i; | |
32616 | struct l3_process *proc = st->l3.global; | |
32617 | ||
32618 | proc->callref = skb->data[2]; /* cr flag */ | |
32619 | @@ -2961,7 +2961,8 @@ | |
32620 | static void | |
32621 | dss1up(struct PStack *st, int pr, void *arg) | |
32622 | { | |
32623 | - int i, mt, cr, cause, callState; | |
32624 | + u_int i; | |
32625 | + int mt, cr, cause, callState; | |
32626 | char *ptr; | |
32627 | u8 *p; | |
32628 | struct sk_buff *skb = arg; | |
32629 | @@ -2998,7 +2999,7 @@ | |
32630 | return; | |
32631 | } | |
32632 | cr = getcallref(skb->data); | |
32633 | - if (skb->len < ((skb->data[1] & 0x0f) + 3)) { | |
32634 | + if (skb->len < (u_int)((skb->data[1] & 0x0f) + 3)) { | |
32635 | l3_debug(st, "dss1up frame too short(%d)", skb->len); | |
32636 | dev_kfree_skb(skb); | |
32637 | return; | |
32638 | @@ -3135,7 +3136,8 @@ | |
32639 | static void | |
32640 | dss1down(struct PStack *st, int pr, void *arg) | |
32641 | { | |
32642 | - int i, cr; | |
32643 | + u_int i; | |
32644 | + int cr; | |
32645 | struct l3_process *proc; | |
32646 | struct Channel *chan; | |
32647 | ||
32648 | @@ -3186,29 +3188,29 @@ | |
32649 | static void | |
32650 | dss1man(struct PStack *st, int pr, void *arg) | |
32651 | { | |
32652 | - int i; | |
32653 | - struct l3_process *proc = arg; | |
32654 | - | |
32655 | - if (!proc) { | |
32656 | - printk(KERN_ERR "HiSax dss1man without proc pr=%04x\n", pr); | |
32657 | - return; | |
32658 | - } | |
32659 | - for (i = 0; i < MANSLLEN; i++) | |
32660 | + u_int i; | |
32661 | + struct l3_process *proc = arg; | |
32662 | + | |
32663 | + if (!proc) { | |
32664 | + printk(KERN_ERR "HiSax dss1man without proc pr=%04x\n", pr); | |
32665 | + return; | |
32666 | + } | |
32667 | + for (i = 0; i < MANSLLEN; i++) | |
32668 | if ((pr == manstatelist[i].primitive) && | |
32669 | - ((1 << proc->state) & manstatelist[i].state)) | |
32670 | - break; | |
32671 | - if (i == MANSLLEN) { | |
32672 | - if (st->l3.debug & L3_DEB_STATE) { | |
32673 | - l3_debug(st, "cr %d dss1man state %d prim %#x unhandled", | |
32674 | - proc->callref & 0x7f, proc->state, pr); | |
32675 | - } | |
32676 | - } else { | |
32677 | - if (st->l3.debug & L3_DEB_STATE) { | |
32678 | - l3_debug(st, "cr %d dss1man state %d prim %#x", | |
32679 | - proc->callref & 0x7f, proc->state, pr); | |
32680 | - } | |
32681 | - manstatelist[i].rout(proc, pr, arg); | |
32682 | - } | |
32683 | + ((1 << proc->state) & manstatelist[i].state)) | |
32684 | + break; | |
32685 | + if (i == MANSLLEN) { | |
32686 | + if (st->l3.debug & L3_DEB_STATE) { | |
32687 | + l3_debug(st, "cr %d dss1man state %d prim %#x unhandled", | |
32688 | + proc->callref & 0x7f, proc->state, pr); | |
32689 | + } | |
32690 | + } else { | |
32691 | + if (st->l3.debug & L3_DEB_STATE) { | |
32692 | + l3_debug(st, "cr %d dss1man state %d prim %#x", | |
32693 | + proc->callref & 0x7f, proc->state, pr); | |
32694 | + } | |
32695 | + manstatelist[i].rout(proc, pr, arg); | |
32696 | + } | |
32697 | } | |
32698 | ||
32699 | void | |
32700 | diff -Nru a/drivers/isdn/hisax/l3ni1.c b/drivers/isdn/hisax/l3ni1.c | |
32701 | --- a/drivers/isdn/hisax/l3ni1.c Mon Feb 24 10:22:43 2003 | |
32702 | +++ b/drivers/isdn/hisax/l3ni1.c Wed Sep 3 03:09:40 2003 | |
32703 | @@ -685,7 +685,7 @@ | |
32704 | p += l; | |
32705 | mt = *p++; | |
32706 | oldpos = 0; | |
32707 | - while ((p - skb->data) < skb->len) { | |
32708 | + while ((u_int)(p - skb->data) < skb->len) { | |
32709 | if ((*p & 0xf0) == 0x90) { /* shift codeset */ | |
32710 | old_codeset = codeset; | |
32711 | codeset = *p & 7; | |
32712 | @@ -2859,7 +2859,7 @@ | |
32713 | u8 tmp[16]; | |
32714 | u8 *p = tmp; | |
32715 | int l; | |
32716 | - int i; | |
32717 | + u_int i; | |
32718 | struct l3_process *proc = st->l3.global; | |
32719 | ||
32720 | if ( skb ) | |
32721 | @@ -2900,7 +2900,8 @@ | |
32722 | static void | |
32723 | ni1up(struct PStack *st, int pr, void *arg) | |
32724 | { | |
32725 | - int i, mt, cr, cause, callState; | |
32726 | + u_int i; | |
32727 | + int mt, cr, cause, callState; | |
32728 | char *ptr; | |
32729 | u8 *p; | |
32730 | struct sk_buff *skb = arg; | |
32731 | @@ -2941,7 +2942,7 @@ | |
32732 | return; | |
32733 | } | |
32734 | cr = getcallref(skb->data); | |
32735 | - if (skb->len < ((skb->data[1] & 0x0f) + 3)) { | |
32736 | + if (skb->len < (u_int)((skb->data[1] & 0x0f) + 3)) { | |
32737 | l3_debug(st, "ni1up frame too short(%d)", skb->len); | |
32738 | dev_kfree_skb(skb); | |
32739 | return; | |
32740 | @@ -3086,7 +3087,8 @@ | |
32741 | static void | |
32742 | ni1down(struct PStack *st, int pr, void *arg) | |
32743 | { | |
32744 | - int i, cr; | |
32745 | + u_int i; | |
32746 | + int cr; | |
32747 | struct l3_process *proc; | |
32748 | struct Channel *chan; | |
32749 | ||
32750 | @@ -3137,7 +3139,7 @@ | |
32751 | static void | |
32752 | ni1man(struct PStack *st, int pr, void *arg) | |
32753 | { | |
32754 | - int i; | |
32755 | + u_int i; | |
32756 | struct l3_process *proc = arg; | |
32757 | ||
32758 | if (!proc) { | |
32759 | diff -Nru a/drivers/isdn/hisax/netjet.c b/drivers/isdn/hisax/netjet.c | |
32760 | --- a/drivers/isdn/hisax/netjet.c Sun Jan 12 16:01:56 2003 | |
32761 | +++ b/drivers/isdn/hisax/netjet.c Wed Sep 3 03:09:40 2003 | |
32762 | @@ -729,7 +729,7 @@ | |
32763 | ||
32764 | static void write_raw(struct BCState *bcs, u_int *buf, int cnt) { | |
32765 | u_int mask, val, *p=buf; | |
32766 | - u_int i, s_cnt; | |
32767 | + int i, s_cnt; | |
32768 | ||
32769 | if (cnt <= 0) | |
32770 | return; | |
32771 | diff -Nru a/drivers/isdn/hisax/q931.c b/drivers/isdn/hisax/q931.c | |
32772 | --- a/drivers/isdn/hisax/q931.c Sat Jan 4 07:35:39 2003 | |
32773 | +++ b/drivers/isdn/hisax/q931.c Wed Sep 3 03:09:40 2003 | |
32774 | @@ -446,7 +446,7 @@ | |
32775 | { | |
32776 | u8 *end; | |
32777 | char *dp = dest; | |
32778 | - int i, cause; | |
32779 | + u_int i, cause; | |
32780 | ||
32781 | end = p + p[1] + 1; | |
32782 | p += 2; | |
32783 | @@ -871,7 +871,8 @@ | |
32784 | disptext_ni1(char *dest, u8 * p) | |
32785 | { | |
32786 | char *dp = dest; | |
32787 | - int l, tag, len, i; | |
32788 | + int l, tag, len; | |
32789 | + u_int i; | |
32790 | ||
32791 | p++; | |
32792 | l = *p++ - 1; | |
32793 | @@ -1200,7 +1201,7 @@ | |
32794 | char *dp; | |
32795 | unsigned char pd, cr_l, cr, mt; | |
32796 | unsigned char sapi, tei, ftyp; | |
32797 | - int i, cset = 0, cs_old = 0, cs_fest = 0; | |
32798 | + u_int i, cset = 0, cs_old = 0, cs_fest = 0; | |
32799 | int size, finish = 0; | |
32800 | ||
32801 | if (skb->len < 3) | |
32802 | diff -Nru a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c | |
32803 | --- a/drivers/isdn/hisax/sedlbauer.c Mon May 12 18:59:22 2003 | |
32804 | +++ b/drivers/isdn/hisax/sedlbauer.c Wed Sep 3 02:17:10 2003 | |
32805 | @@ -760,7 +760,7 @@ | |
32806 | printk(KERN_ERR "Sedlbauer PnP:some resources are missing %ld/%lx\n", | |
32807 | pnp_irq(pd, 0), pnp_port_start(pd, 0)); | |
32808 | pnp_device_detach(pd); | |
32809 | - goto err; | |
32810 | + return 0; | |
32811 | } | |
32812 | card->para[1] = pnp_port_start(pd, 0); | |
32813 | card->para[0] = pnp_irq(pd, 0); | |
32814 | @@ -777,7 +777,7 @@ | |
32815 | } | |
32816 | } else { | |
32817 | printk(KERN_ERR "Sedlbauer PnP: PnP error card found, no device\n"); | |
32818 | - goto err; | |
32819 | + return 0; | |
32820 | } | |
32821 | } | |
32822 | pdev++; | |
32823 | diff -Nru a/drivers/isdn/hisax/st5481_b.c b/drivers/isdn/hisax/st5481_b.c | |
32824 | --- a/drivers/isdn/hisax/st5481_b.c Sat Aug 9 05:20:58 2003 | |
32825 | +++ b/drivers/isdn/hisax/st5481_b.c Wed Sep 3 03:09:40 2003 | |
32826 | @@ -31,9 +31,9 @@ | |
32827 | struct st5481_b_out *b_out = &bcs->b_out; | |
32828 | struct st5481_adapter *adapter = bcs->adapter; | |
32829 | struct urb *urb; | |
32830 | - unsigned int packet_size,offset; | |
32831 | - int len,buf_size,bytes_sent; | |
32832 | - int i; | |
32833 | + u_int packet_size, bytes_sent; | |
32834 | + int len, offset, buf_size; | |
32835 | + u_int i; | |
32836 | struct sk_buff *skb; | |
32837 | ||
32838 | if (test_and_set_bit(buf_nr, &b_out->busy)) { | |
32839 | diff -Nru a/drivers/isdn/hisax/st5481_d.c b/drivers/isdn/hisax/st5481_d.c | |
32840 | --- a/drivers/isdn/hisax/st5481_d.c Sat Aug 9 05:20:13 2003 | |
32841 | +++ b/drivers/isdn/hisax/st5481_d.c Wed Sep 3 03:09:40 2003 | |
32842 | @@ -294,8 +294,8 @@ | |
32843 | { | |
32844 | struct st5481_d_out *d_out = &adapter->d_out; | |
32845 | struct urb *urb; | |
32846 | - unsigned int num_packets, packet_offset; | |
32847 | - int len, buf_size, bytes_sent; | |
32848 | + unsigned int num_packets; | |
32849 | + int len, buf_size, bytes_sent, packet_offset; | |
32850 | struct sk_buff *skb; | |
32851 | struct usb_iso_packet_descriptor *desc; | |
32852 | ||
32853 | @@ -341,7 +341,7 @@ | |
32854 | desc = &urb->iso_frame_desc[num_packets]; | |
32855 | desc->offset = packet_offset; | |
32856 | desc->length = SIZE_ISO_PACKETS_D_OUT; | |
32857 | - if (len - packet_offset < desc->length) | |
32858 | + if (len - packet_offset < (int)desc->length) | |
32859 | desc->length = len - packet_offset; | |
32860 | num_packets++; | |
32861 | packet_offset += desc->length; | |
32862 | diff -Nru a/drivers/isdn/i4l/Kconfig b/drivers/isdn/i4l/Kconfig | |
32863 | --- a/drivers/isdn/i4l/Kconfig Sat Feb 22 09:17:33 2003 | |
32864 | +++ b/drivers/isdn/i4l/Kconfig Sun Aug 24 00:59:46 2003 | |
32865 | @@ -106,6 +106,7 @@ | |
32866 | ||
32867 | config ISDN_DIVERSION | |
32868 | tristate "Support isdn diversion services" | |
32869 | + depends on BROKEN | |
32870 | help | |
32871 | This option allows you to use some supplementary diversion | |
32872 | services in conjunction with the HiSax driver on an EURO/DSS1 | |
32873 | diff -Nru a/drivers/isdn/i4l/isdn_audio.c b/drivers/isdn/i4l/isdn_audio.c | |
32874 | --- a/drivers/isdn/i4l/isdn_audio.c Tue Oct 29 19:01:05 2002 | |
32875 | +++ b/drivers/isdn/i4l/isdn_audio.c Wed Sep 3 03:09:40 2003 | |
32876 | @@ -517,7 +517,6 @@ | |
32877 | dtmf_state *s; | |
32878 | int silence; | |
32879 | int i; | |
32880 | - unsigned long flags; | |
32881 | int grp[2]; | |
32882 | char what; | |
32883 | char *p; | |
32884 | @@ -551,7 +550,7 @@ | |
32885 | *p++ = 0x10; | |
32886 | *p = what; | |
32887 | skb_trim(skb, 2); | |
32888 | - if (skb_headroom(skb) < sizeof(isdn_audio_skb)) { | |
32889 | + if ((size_t)skb_headroom(skb) < sizeof(isdnaudio_header)) { | |
32890 | printk(KERN_WARNING | |
32891 | "isdn_audio: insufficient skb_headroom, dropping\n"); | |
32892 | kfree_skb(skb); | |
32893 | @@ -559,11 +558,7 @@ | |
32894 | } | |
32895 | ISDN_AUDIO_SKB_DLECOUNT(skb) = 0; | |
32896 | ISDN_AUDIO_SKB_LOCK(skb) = 0; | |
32897 | - save_flags(flags); | |
32898 | - cli(); | |
32899 | isdn_tty_queue_tail(info, skb, 2); | |
32900 | - restore_flags(flags); | |
32901 | - /* Schedule dequeuing */ | |
32902 | if ((dev->modempoll) && (info->rcvsched)) | |
32903 | mod_timer(&info->read_timer, jiffies + 4); | |
32904 | } else | |
32905 | @@ -653,7 +648,6 @@ | |
32906 | isdn_audio_put_dle_code(modem_info * info, u_char code) | |
32907 | { | |
32908 | struct sk_buff *skb; | |
32909 | - unsigned long flags; | |
32910 | char *p; | |
32911 | ||
32912 | skb = dev_alloc_skb(2); | |
32913 | @@ -666,7 +660,7 @@ | |
32914 | p = (char *) skb_put(skb, 2); | |
32915 | p[0] = 0x10; | |
32916 | p[1] = code; | |
32917 | - if (skb_headroom(skb) < sizeof(isdn_audio_skb)) { | |
32918 | + if ((size_t)skb_headroom(skb) < sizeof(isdnaudio_header)) { | |
32919 | printk(KERN_WARNING | |
32920 | "isdn_audio: insufficient skb_headroom, dropping\n"); | |
32921 | kfree_skb(skb); | |
32922 | @@ -674,10 +668,7 @@ | |
32923 | } | |
32924 | ISDN_AUDIO_SKB_DLECOUNT(skb) = 0; | |
32925 | ISDN_AUDIO_SKB_LOCK(skb) = 0; | |
32926 | - save_flags(flags); | |
32927 | - cli(); | |
32928 | isdn_tty_queue_tail(info, skb, 2); | |
32929 | - restore_flags(flags); | |
32930 | /* Schedule dequeuing */ | |
32931 | if ((dev->modempoll) && (info->rcvsched)) | |
32932 | mod_timer(&info->read_timer, jiffies + 4); | |
32933 | @@ -691,7 +682,7 @@ | |
32934 | ||
32935 | what = ' '; | |
32936 | ||
32937 | - if (s->idx > (info->emu.vpar[2] * 800)) { | |
32938 | + if (s->idx > (u_int)(info->emu.vpar[2] * 800)) { | |
32939 | s->idx = 0; | |
32940 | if (!s->state) { /* silence from beginning of rec */ | |
32941 | what = 's'; | |
32942 | @@ -699,9 +690,9 @@ | |
32943 | what = 'q'; | |
32944 | } | |
32945 | } | |
32946 | - if ((what == 's') || (what == 'q')) { | |
32947 | - printk(KERN_DEBUG "ttyI%d: %s\n", info->line, | |
32948 | - (what=='s') ? "silence":"quiet"); | |
32949 | - isdn_audio_put_dle_code(info, what); | |
32950 | - } | |
32951 | + if ((what == 's') || (what == 'q')) { | |
32952 | + printk(KERN_DEBUG "ttyI%d: %s\n", info->line, | |
32953 | + (what=='s') ? "silence":"quiet"); | |
32954 | + isdn_audio_put_dle_code(info, what); | |
32955 | + } | |
32956 | } | |
32957 | diff -Nru a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c | |
32958 | --- a/drivers/isdn/i4l/isdn_common.c Mon Jul 21 11:39:14 2003 | |
32959 | +++ b/drivers/isdn/i4l/isdn_common.c Wed Sep 3 06:27:32 2003 | |
32960 | @@ -598,6 +598,7 @@ | |
32961 | iif->statcallb = isdn_status_callback; | |
32962 | ||
32963 | isdn_info_update(); | |
32964 | + return(0); | |
32965 | } | |
32966 | ||
32967 | static int | |
32968 | @@ -609,6 +610,7 @@ | |
32969 | drv->features = drv->interface->features; | |
32970 | isdn_v110_add_features(drv); | |
32971 | set_global_features(); | |
32972 | + return(0); | |
32973 | } | |
32974 | ||
32975 | static int | |
32976 | @@ -616,6 +618,7 @@ | |
32977 | { | |
32978 | fsm_change_state(fi, ST_DRV_LOADED); | |
32979 | set_global_features(); | |
32980 | + return(0); | |
32981 | } | |
32982 | ||
32983 | static int | |
32984 | @@ -646,6 +649,7 @@ | |
32985 | drv->stavail += c->arg; | |
32986 | spin_unlock_irqrestore(&stat_lock, flags); | |
32987 | wake_up_interruptible(&drv->st_waitq); | |
32988 | + return 0; | |
32989 | } | |
32990 | ||
32991 | static int | |
32992 | @@ -1318,20 +1322,18 @@ | |
32993 | isdn_status_read(struct file *file, char *buf, size_t count, loff_t * off) | |
32994 | { | |
32995 | int retval; | |
32996 | - int len = 0; | |
32997 | + size_t len = 0; | |
32998 | char *p; | |
32999 | ||
33000 | if (off != &file->f_pos) | |
33001 | return -ESPIPE; | |
33002 | ||
33003 | - lock_kernel(); | |
33004 | if (!file->private_data) { | |
33005 | - if (file->f_flags & O_NONBLOCK) { | |
33006 | - retval = -EAGAIN; | |
33007 | - goto out; | |
33008 | - } | |
33009 | + if (file->f_flags & O_NONBLOCK) | |
33010 | + return -EAGAIN; | |
33011 | interruptible_sleep_on(&(dev->info_waitq)); | |
33012 | } | |
33013 | + lock_kernel(); | |
33014 | p = isdn_statstr(); | |
33015 | file->private_data = 0; | |
33016 | if ((len = strlen(p)) <= count) { | |
33017 | @@ -1362,12 +1364,10 @@ | |
33018 | { | |
33019 | unsigned int mask = 0; | |
33020 | ||
33021 | - lock_kernel(); | |
33022 | - | |
33023 | poll_wait(file, &(dev->info_waitq), wait); | |
33024 | + lock_kernel(); | |
33025 | if (file->private_data) | |
33026 | mask |= POLLIN | POLLRDNORM; | |
33027 | - | |
33028 | unlock_kernel(); | |
33029 | return mask; | |
33030 | } | |
33031 | @@ -1432,7 +1432,7 @@ | |
33032 | static int | |
33033 | isdn_ctrl_open(struct inode *ino, struct file *file) | |
33034 | { | |
33035 | - unsigned int minor = minor(ino->i_rdev); | |
33036 | + unsigned int minor = iminor(ino); | |
33037 | struct isdn_slot *slot = get_slot_by_minor(minor - ISDN_MINOR_CTRL); | |
33038 | ||
33039 | if (!slot) | |
33040 | @@ -1464,7 +1464,7 @@ | |
33041 | struct isdn_slot *slot = file->private_data; | |
33042 | DECLARE_WAITQUEUE(wait, current); | |
33043 | unsigned long flags; | |
33044 | - int len = 0; | |
33045 | + size_t len = 0; | |
33046 | ||
33047 | if (off != &file->f_pos) | |
33048 | return -ESPIPE; | |
33049 | @@ -1795,7 +1795,7 @@ | |
33050 | static int | |
33051 | isdn_open(struct inode * inode, struct file * file) | |
33052 | { | |
33053 | - int minor = minor(inode->i_rdev); | |
33054 | + int minor = iminor(inode); | |
33055 | int err = -ENODEV; | |
33056 | struct file_operations *old_fops, *new_fops = NULL; | |
33057 | ||
33058 | diff -Nru a/drivers/isdn/i4l/isdn_net_lib.c b/drivers/isdn/i4l/isdn_net_lib.c | |
33059 | --- a/drivers/isdn/i4l/isdn_net_lib.c Sun May 25 17:00:00 2003 | |
33060 | +++ b/drivers/isdn/i4l/isdn_net_lib.c Wed Sep 3 03:09:40 2003 | |
33061 | @@ -758,7 +758,7 @@ | |
33062 | isdn_net_getphone(isdn_net_ioctl_phone * phone, char *phones) | |
33063 | { | |
33064 | isdn_net_dev *idev = isdn_net_findif(phone->name); | |
33065 | - int count = 0; | |
33066 | + u_int count = 0; | |
33067 | char *buf = (char *)__get_free_page(GFP_KERNEL); | |
33068 | struct isdn_net_phone *n; | |
33069 | ||
33070 | diff -Nru a/drivers/isdn/i4l/isdn_net_lib.h b/drivers/isdn/i4l/isdn_net_lib.h | |
33071 | --- a/drivers/isdn/i4l/isdn_net_lib.h Tue Oct 29 18:55:59 2002 | |
33072 | +++ b/drivers/isdn/i4l/isdn_net_lib.h Wed Sep 3 03:09:40 2003 | |
33073 | @@ -133,47 +133,47 @@ | |
33074 | /* per ISDN channel (ISDN interface) data */ | |
33075 | ||
33076 | struct isdn_net_dev_s { | |
33077 | - struct isdn_slot *isdn_slot; /* Index to isdn device/channel */ | |
33078 | - struct isdn_slot *exclusive; /* NULL if non excl */ | |
33079 | - int pre_device; /* Preselected isdn-device */ | |
33080 | - int pre_channel; /* Preselected isdn-channel */ | |
33081 | - | |
33082 | - struct timer_list dial_timer; /* dial events timer */ | |
33083 | - struct fsm_inst fi; /* call control state machine */ | |
33084 | - int dial_event; /* event in case of timer expiry */ | |
33085 | - int dial; /* # of phone number just dialed */ | |
33086 | - int outgoing; /* Flag: outgoing call */ | |
33087 | - int dialretry; /* Counter for Dialout-retries */ | |
33088 | - | |
33089 | - int cps; /* current speed of this interface */ | |
33090 | - int transcount; /* byte-counter for cps-calculation */ | |
33091 | - int last_jiffies; /* when transcount was reset */ | |
33092 | - int sqfull; /* Flag: netdev-queue overloaded */ | |
33093 | - ulong sqfull_stamp; /* Start-Time of overload */ | |
33094 | - | |
33095 | - int huptimer; /* Timeout-counter for auto-hangup */ | |
33096 | - int charge; /* Counter for charging units */ | |
33097 | - int charge_state; /* ChargeInfo state machine */ | |
33098 | - unsigned long chargetime; /* Timer for Charging info */ | |
33099 | - int chargeint; /* Interval between charge-infos */ | |
33100 | - | |
33101 | - int pppbind; /* ippp device for bindings */ | |
33102 | - | |
33103 | - struct sk_buff_head super_tx_queue; /* List of supervisory frames to */ | |
33104 | - /* be transmitted asap */ | |
33105 | - int frame_cnt; /* number of frames currently */ | |
33106 | - /* queued in HL driver */ | |
33107 | - struct tasklet_struct tlet; | |
33108 | - | |
33109 | - isdn_net_local *mlp; /* Ptr to master device for all devs*/ | |
33110 | - | |
33111 | - struct list_head slaves; /* member of local->slaves */ | |
33112 | - struct list_head online; /* member of local->online */ | |
33113 | - | |
33114 | - char name[10]; /* Name of device */ | |
33115 | - struct list_head global_list; /* global list of all isdn_net_devs */ | |
33116 | - void *ind_priv; /* interface types can put their | |
33117 | - private data here */ | |
33118 | + struct isdn_slot *isdn_slot; /* Index to isdn device/channel */ | |
33119 | + struct isdn_slot *exclusive; /* NULL if non excl */ | |
33120 | + int pre_device; /* Preselected isdn-device */ | |
33121 | + int pre_channel; /* Preselected isdn-channel */ | |
33122 | + | |
33123 | + struct timer_list dial_timer; /* dial events timer */ | |
33124 | + struct fsm_inst fi; /* call control state machine */ | |
33125 | + int dial_event; /* event in case of timer expiry */ | |
33126 | + int dial; /* # of phone number just dialed */ | |
33127 | + int outgoing; /* Flag: outgoing call */ | |
33128 | + int dialretry; /* Counter for Dialout-retries */ | |
33129 | + | |
33130 | + int cps; /* current speed of this interface */ | |
33131 | + int transcount; /* byte-counter for cps-calculation */ | |
33132 | + u_long last_jiffies; /* when transcount was reset */ | |
33133 | + int sqfull; /* Flag: netdev-queue overloaded */ | |
33134 | + u_long sqfull_stamp; /* Start-Time of overload */ | |
33135 | + | |
33136 | + int huptimer; /* Timeout-counter for auto-hangup */ | |
33137 | + int charge; /* Counter for charging units */ | |
33138 | + int charge_state; /* ChargeInfo state machine */ | |
33139 | + u_long chargetime; /* Timer for Charging info */ | |
33140 | + int chargeint; /* Interval between charge-infos */ | |
33141 | + | |
33142 | + int pppbind; /* ippp device for bindings */ | |
33143 | + | |
33144 | + struct sk_buff_head super_tx_queue; /* List of supervisory frames to */ | |
33145 | + /* be transmitted asap */ | |
33146 | + int frame_cnt; /* number of frames currently */ | |
33147 | + /* queued in HL driver */ | |
33148 | + struct tasklet_struct tlet; | |
33149 | + | |
33150 | + isdn_net_local *mlp; /* Ptr to master device for all devs*/ | |
33151 | + | |
33152 | + struct list_head slaves; /* member of local->slaves */ | |
33153 | + struct list_head online; /* member of local->online */ | |
33154 | + | |
33155 | + char name[10]; /* Name of device */ | |
33156 | + struct list_head global_list; /* global list of all isdn_net_devs */ | |
33157 | + void *ind_priv; /* interface types can put their | |
33158 | + private data here */ | |
33159 | }; | |
33160 | ||
33161 | /* ====================================================================== */ | |
33162 | diff -Nru a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c | |
33163 | --- a/drivers/isdn/i4l/isdn_ppp.c Tue Jul 15 10:01:29 2003 | |
33164 | +++ b/drivers/isdn/i4l/isdn_ppp.c Tue Aug 26 09:25:41 2003 | |
33165 | @@ -119,7 +119,7 @@ | |
33166 | ipppd_open(struct inode *ino, struct file *file) | |
33167 | { | |
33168 | unsigned long flags; | |
33169 | - unsigned int minor = minor(ino->i_rdev) - ISDN_MINOR_PPP; | |
33170 | + unsigned int minor = iminor(ino) - ISDN_MINOR_PPP; | |
33171 | struct ipppd *ipppd; | |
33172 | ||
33173 | ipppd = kmalloc(sizeof(*ipppd), GFP_KERNEL); | |
33174 | diff -Nru a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c | |
33175 | --- a/drivers/isdn/i4l/isdn_tty.c Wed Jun 18 21:25:09 2003 | |
33176 | +++ b/drivers/isdn/i4l/isdn_tty.c Wed Sep 3 03:09:40 2003 | |
33177 | @@ -132,7 +132,7 @@ | |
33178 | isdn_tty_readbchan(struct modem_info *info, u_char * buf, u_char * fp, int len) | |
33179 | { | |
33180 | int count; | |
33181 | - int count_pull; | |
33182 | + u_int count_pull; | |
33183 | int count_put; | |
33184 | int dflag; | |
33185 | struct sk_buff *skb; | |
33186 | @@ -179,7 +179,7 @@ | |
33187 | #endif | |
33188 | /* No DLE's in buff, so simply copy it */ | |
33189 | dflag = 1; | |
33190 | - if ((count_pull = skb->len) > len) { | |
33191 | + if ((int)(count_pull = skb->len) > len) { | |
33192 | count_pull = len; | |
33193 | dflag = 0; | |
33194 | } | |
33195 | @@ -315,7 +315,7 @@ | |
33196 | skb_pull(skb, 4); | |
33197 | } | |
33198 | #ifdef CONFIG_ISDN_AUDIO | |
33199 | - if (skb_headroom(skb) < sizeof(isdn_audio_skb)) { | |
33200 | + if ((size_t)skb_headroom(skb) < sizeof(isdnaudio_header)) { | |
33201 | printk(KERN_WARNING | |
33202 | "isdn_audio: insufficient skb_headroom, dropping\n"); | |
33203 | kfree_skb(skb); | |
33204 | @@ -1728,9 +1728,6 @@ | |
33205 | modem_info *info; | |
33206 | int retval, line; | |
33207 | ||
33208 | - /* FIXME. This is not unload-race free AFAICS */ | |
33209 | - | |
33210 | - MOD_INC_USE_COUNT; | |
33211 | ||
33212 | line = tty->index; | |
33213 | if (line < 0 || line > ISDN_MAX_CHANNELS) | |
33214 | @@ -1738,6 +1735,8 @@ | |
33215 | info = &isdn_mdm.info[line]; | |
33216 | if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_open")) | |
33217 | return -ENODEV; | |
33218 | + if (!try_module_get(info->owner)) | |
33219 | + printk(KERN_WARNING "%s: cannot reserve module\n", __FUNCTION__); | |
33220 | #ifdef ISDN_DEBUG_MODEM_OPEN | |
33221 | printk(KERN_DEBUG "isdn_tty_open %s, count = %d\n", tty->name, | |
33222 | info->count); | |
33223 | @@ -1753,6 +1752,7 @@ | |
33224 | #ifdef ISDN_DEBUG_MODEM_OPEN | |
33225 | printk(KERN_DEBUG "isdn_tty_open return after startup\n"); | |
33226 | #endif | |
33227 | + module_put(info->owner); | |
33228 | return retval; | |
33229 | } | |
33230 | retval = isdn_tty_block_til_ready(tty, filp, info); | |
33231 | @@ -1760,6 +1760,7 @@ | |
33232 | #ifdef ISDN_DEBUG_MODEM_OPEN | |
33233 | printk(KERN_DEBUG "isdn_tty_open return after isdn_tty_block_til_ready \n"); | |
33234 | #endif | |
33235 | + module_put(info->owner); | |
33236 | return retval; | |
33237 | } | |
33238 | #ifdef ISDN_DEBUG_MODEM_OPEN | |
33239 | @@ -1779,7 +1780,9 @@ | |
33240 | ulong flags; | |
33241 | ulong timeout; | |
33242 | ||
33243 | - if (!info || isdn_tty_paranoia_check(info, tty->name, "isdn_tty_close")) | |
33244 | + if (!info) | |
33245 | + return; | |
33246 | + if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_close")) | |
33247 | goto out; | |
33248 | ||
33249 | save_flags(flags); | |
33250 | @@ -1859,7 +1862,7 @@ | |
33251 | printk(KERN_DEBUG "isdn_tty_close normal exit\n"); | |
33252 | #endif | |
33253 | out: | |
33254 | - MOD_DEC_USE_COUNT; | |
33255 | + module_put(info->owner); | |
33256 | } | |
33257 | ||
33258 | /* | |
33259 | @@ -2036,6 +2039,7 @@ | |
33260 | return -3; | |
33261 | } | |
33262 | #endif | |
33263 | + info->owner = THIS_MODULE; | |
33264 | init_MUTEX(&info->write_sem); | |
33265 | sprintf(info->last_cause, "0000"); | |
33266 | sprintf(info->last_num, "none"); | |
33267 | @@ -2457,7 +2461,7 @@ | |
33268 | (!skb_queue_empty(&info->rpqueue)))) { | |
33269 | skb = alloc_skb(strlen(msg) | |
33270 | #ifdef CONFIG_ISDN_AUDIO | |
33271 | - + sizeof(isdn_audio_skb) | |
33272 | + + sizeof(isdnaudio_header) | |
33273 | #endif | |
33274 | , GFP_ATOMIC); | |
33275 | if (!skb) { | |
33276 | @@ -2465,7 +2469,7 @@ | |
33277 | return; | |
33278 | } | |
33279 | #ifdef CONFIG_ISDN_AUDIO | |
33280 | - skb_reserve(skb, sizeof(isdn_audio_skb)); | |
33281 | + skb_reserve(skb, sizeof(isdnaudio_header)); | |
33282 | #endif | |
33283 | sp = skb_put(skb, strlen(msg)); | |
33284 | #ifdef CONFIG_ISDN_AUDIO | |
33285 | diff -Nru a/drivers/isdn/i4l/isdn_ttyfax.c b/drivers/isdn/i4l/isdn_ttyfax.c | |
33286 | --- a/drivers/isdn/i4l/isdn_ttyfax.c Fri May 23 11:33:46 2003 | |
33287 | +++ b/drivers/isdn/i4l/isdn_ttyfax.c Wed Sep 3 03:09:40 2003 | |
33288 | @@ -265,7 +265,7 @@ | |
33289 | __u8 RightMask; | |
33290 | __u8 fBit; | |
33291 | __u8 Data; | |
33292 | - int i; | |
33293 | + u_int i; | |
33294 | ||
33295 | if (!info->fax->bor) { | |
33296 | for (i = 0; i < skb->len; i++) { | |
33297 | diff -Nru a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c | |
33298 | --- a/drivers/isdn/icn/icn.c Sun May 25 17:00:00 2003 | |
33299 | +++ b/drivers/isdn/icn/icn.c Wed Sep 3 04:41:06 2003 | |
33300 | @@ -43,6 +43,8 @@ | |
33301 | static char | |
33302 | *revision = "$Revision$"; | |
33303 | ||
33304 | +static spinlock_t icn_lock = SPIN_LOCK_UNLOCKED; | |
33305 | + | |
33306 | static int icn_addcard(int, char *, char *); | |
33307 | ||
33308 | /* | |
33309 | @@ -59,16 +61,15 @@ | |
33310 | unsigned long flags; | |
33311 | ||
33312 | skb_queue_purge(queue); | |
33313 | - save_flags(flags); | |
33314 | - cli(); | |
33315 | + spin_lock_irqsave(&icn_lock, flags); | |
33316 | card->xlen[channel] = 0; | |
33317 | card->sndcount[channel] = 0; | |
33318 | if ((skb = card->xskb[channel])) { | |
33319 | card->xskb[channel] = NULL; | |
33320 | - restore_flags(flags); | |
33321 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33322 | dev_kfree_skb(skb); | |
33323 | } else | |
33324 | - restore_flags(flags); | |
33325 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33326 | } | |
33327 | ||
33328 | /* Put a value into a shift-register, highest bit first. | |
33329 | @@ -146,8 +147,7 @@ | |
33330 | #ifdef MAP_DEBUG | |
33331 | printk(KERN_DEBUG "icn_lock_channel %d\n", channel); | |
33332 | #endif | |
33333 | - save_flags(flags); | |
33334 | - cli(); | |
33335 | + spin_lock_irqsave(&icn_lock, flags); | |
33336 | if ((dev.channel == channel) && (card == dev.mcard)) { | |
33337 | dev.chanlock++; | |
33338 | retval = 1; | |
33339 | @@ -160,7 +160,7 @@ | |
33340 | printk(KERN_DEBUG "icn_lock_channel %d FAILED, dc=%d\n", channel, dev.channel); | |
33341 | #endif | |
33342 | } | |
33343 | - restore_flags(flags); | |
33344 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33345 | return retval; | |
33346 | } | |
33347 | ||
33348 | @@ -175,11 +175,10 @@ | |
33349 | #ifdef MAP_DEBUG | |
33350 | printk(KERN_DEBUG "icn_release_channel l=%d\n", dev.chanlock); | |
33351 | #endif | |
33352 | - save_flags(flags); | |
33353 | - cli(); | |
33354 | + spin_lock_irqsave(&icn_lock, flags); | |
33355 | if (dev.chanlock > 0) | |
33356 | dev.chanlock--; | |
33357 | - restore_flags(flags); | |
33358 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33359 | } | |
33360 | ||
33361 | /* | |
33362 | @@ -195,19 +194,18 @@ | |
33363 | printk(KERN_DEBUG "trymaplock c=%d dc=%d l=%d\n", channel, dev.channel, | |
33364 | dev.chanlock); | |
33365 | #endif | |
33366 | - save_flags(flags); | |
33367 | - cli(); | |
33368 | + spin_lock_irqsave(&icn_lock, flags); | |
33369 | if ((!dev.chanlock) || | |
33370 | ((dev.channel == channel) && (dev.mcard == card))) { | |
33371 | dev.chanlock++; | |
33372 | icn_map_channel(card, channel); | |
33373 | - restore_flags(flags); | |
33374 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33375 | #ifdef MAP_DEBUG | |
33376 | printk(KERN_DEBUG "trymaplock %d OK\n", channel); | |
33377 | #endif | |
33378 | return 1; | |
33379 | } | |
33380 | - restore_flags(flags); | |
33381 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33382 | #ifdef MAP_DEBUG | |
33383 | printk(KERN_DEBUG "trymaplock %d FAILED\n", channel); | |
33384 | #endif | |
33385 | @@ -226,13 +224,12 @@ | |
33386 | #ifdef MAP_DEBUG | |
33387 | printk(KERN_DEBUG "map_release c=%d l=%d\n", channel, dev.chanlock); | |
33388 | #endif | |
33389 | - save_flags(flags); | |
33390 | - cli(); | |
33391 | + spin_lock_irqsave(&icn_lock, flags); | |
33392 | if (dev.chanlock > 0) | |
33393 | dev.chanlock--; | |
33394 | if (!dev.chanlock) | |
33395 | icn_map_channel(card, channel); | |
33396 | - restore_flags(flags); | |
33397 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33398 | } | |
33399 | ||
33400 | /* Get Data from the B-Channel, assemble fragmented packets and put them | |
33401 | @@ -308,14 +305,13 @@ | |
33402 | (card->sndcount[channel] || | |
33403 | skb_queue_len(&card->spqueue[channel]) || | |
33404 | card->xskb[channel])) { | |
33405 | - save_flags(flags); | |
33406 | - cli(); | |
33407 | + spin_lock_irqsave(&icn_lock, flags); | |
33408 | if (card->xmit_lock[channel]) { | |
33409 | - restore_flags(flags); | |
33410 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33411 | break; | |
33412 | } | |
33413 | card->xmit_lock[channel]++; | |
33414 | - restore_flags(flags); | |
33415 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33416 | skb = card->xskb[channel]; | |
33417 | if (!skb) { | |
33418 | skb = skb_dequeue(&card->spqueue[channel]); | |
33419 | @@ -345,11 +341,10 @@ | |
33420 | sbnext; /* switch to next buffer */ | |
33421 | icn_maprelease_channel(card, mch & 2); | |
33422 | if (!skb->len) { | |
33423 | - save_flags(flags); | |
33424 | - cli(); | |
33425 | + spin_lock_irqsave(&icn_lock, flags); | |
33426 | if (card->xskb[channel]) | |
33427 | card->xskb[channel] = NULL; | |
33428 | - restore_flags(flags); | |
33429 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33430 | dev_kfree_skb(skb); | |
33431 | if (card->xlen[channel]) { | |
33432 | cmd.command = ISDN_STAT_BSENT; | |
33433 | @@ -359,10 +354,9 @@ | |
33434 | card->interface.statcallb(&cmd); | |
33435 | } | |
33436 | } else { | |
33437 | - save_flags(flags); | |
33438 | - cli(); | |
33439 | + spin_lock_irqsave(&icn_lock, flags); | |
33440 | card->xskb[channel] = skb; | |
33441 | - restore_flags(flags); | |
33442 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33443 | } | |
33444 | card->xmit_lock[channel] = 0; | |
33445 | if (!icn_trymaplock_channel(card, mch)) | |
33446 | @@ -393,11 +387,10 @@ | |
33447 | } | |
33448 | if (card->flags & (ICN_FLAGS_B1ACTIVE | ICN_FLAGS_B2ACTIVE)) { | |
33449 | /* schedule b-channel polling again */ | |
33450 | - save_flags(flags); | |
33451 | - cli(); | |
33452 | + spin_lock_irqsave(&icn_lock, flags); | |
33453 | mod_timer(&card->rb_timer, jiffies+ICN_TIMER_BCREAD); | |
33454 | card->flags |= ICN_FLAGS_RBTIMER; | |
33455 | - restore_flags(flags); | |
33456 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33457 | } else | |
33458 | card->flags &= ~ICN_FLAGS_RBTIMER; | |
33459 | } | |
33460 | @@ -464,9 +457,8 @@ | |
33461 | cmd.driver = card->myid; | |
33462 | cmd.arg = channel; | |
33463 | switch (action) { | |
33464 | - case 11: | |
33465 | - save_flags(flags); | |
33466 | - cli(); | |
33467 | + case 11: | |
33468 | + spin_lock_irqsave(&icn_lock, flags); | |
33469 | icn_free_queue(card,channel); | |
33470 | card->rcvidx[channel] = 0; | |
33471 | ||
33472 | @@ -483,11 +475,10 @@ | |
33473 | ncmd.driver = card->myid; | |
33474 | ncmd.arg = channel; | |
33475 | ncmd.command = ISDN_STAT_BHUP; | |
33476 | - restore_flags(flags); | |
33477 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33478 | card->interface.statcallb(&cmd); | |
33479 | } else | |
33480 | - restore_flags(flags); | |
33481 | - | |
33482 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33483 | break; | |
33484 | case 1: | |
33485 | icn_free_queue(card,channel); | |
33486 | @@ -498,10 +489,9 @@ | |
33487 | card->flags &= ~((channel) ? | |
33488 | ICN_FLAGS_B2ACTIVE : ICN_FLAGS_B1ACTIVE); | |
33489 | icn_free_queue(card, channel); | |
33490 | - save_flags(flags); | |
33491 | - cli(); | |
33492 | + spin_lock_irqsave(&icn_lock, flags); | |
33493 | card->rcvidx[channel] = 0; | |
33494 | - restore_flags(flags); | |
33495 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33496 | break; | |
33497 | case 3: | |
33498 | { | |
33499 | @@ -557,10 +547,9 @@ | |
33500 | case 8: | |
33501 | card->flags &= ~ICN_FLAGS_B1ACTIVE; | |
33502 | icn_free_queue(card, 0); | |
33503 | - save_flags(flags); | |
33504 | - cli(); | |
33505 | + spin_lock_irqsave(&icn_lock, flags); | |
33506 | card->rcvidx[0] = 0; | |
33507 | - restore_flags(flags); | |
33508 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33509 | cmd.arg = 0; | |
33510 | cmd.driver = card->myid; | |
33511 | card->interface.statcallb(&cmd); | |
33512 | @@ -571,10 +560,9 @@ | |
33513 | cmd.command = ISDN_STAT_BHUP; | |
33514 | card->flags &= ~ICN_FLAGS_B2ACTIVE; | |
33515 | icn_free_queue(card, 1); | |
33516 | - save_flags(flags); | |
33517 | - cli(); | |
33518 | + spin_lock_irqsave(&icn_lock, flags); | |
33519 | card->rcvidx[1] = 0; | |
33520 | - restore_flags(flags); | |
33521 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33522 | cmd.arg = 1; | |
33523 | cmd.driver = card->myid; | |
33524 | card->interface.statcallb(&cmd); | |
33525 | @@ -592,8 +580,7 @@ | |
33526 | { | |
33527 | ulong flags; | |
33528 | ||
33529 | - save_flags(flags); | |
33530 | - cli(); | |
33531 | + spin_lock_irqsave(&icn_lock, flags); | |
33532 | *card->msg_buf_write++ = (c == 0xff) ? '\n' : c; | |
33533 | if (card->msg_buf_write == card->msg_buf_read) { | |
33534 | if (++card->msg_buf_read > card->msg_buf_end) | |
33535 | @@ -601,7 +588,7 @@ | |
33536 | } | |
33537 | if (card->msg_buf_write > card->msg_buf_end) | |
33538 | card->msg_buf_write = card->msg_buf; | |
33539 | - restore_flags(flags); | |
33540 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33541 | } | |
33542 | ||
33543 | static void | |
33544 | @@ -683,20 +670,18 @@ | |
33545 | if (!(card->flags & ICN_FLAGS_RBTIMER)) { | |
33546 | /* schedule b-channel polling */ | |
33547 | card->flags |= ICN_FLAGS_RBTIMER; | |
33548 | - save_flags(flags); | |
33549 | - cli(); | |
33550 | + spin_lock_irqsave(&icn_lock, flags); | |
33551 | del_timer(&card->rb_timer); | |
33552 | card->rb_timer.function = icn_pollbchan; | |
33553 | card->rb_timer.data = (unsigned long) card; | |
33554 | card->rb_timer.expires = jiffies + ICN_TIMER_BCREAD; | |
33555 | add_timer(&card->rb_timer); | |
33556 | - restore_flags(flags); | |
33557 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33558 | } | |
33559 | /* schedule again */ | |
33560 | - save_flags(flags); | |
33561 | - cli(); | |
33562 | + spin_lock_irqsave(&icn_lock, flags); | |
33563 | mod_timer(&card->st_timer, jiffies+ICN_TIMER_DCREAD); | |
33564 | - restore_flags(flags); | |
33565 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33566 | } | |
33567 | ||
33568 | /* Append a packet to the transmit buffer-queue. | |
33569 | @@ -725,8 +710,7 @@ | |
33570 | return 0; | |
33571 | if (card->sndcount[channel] > ICN_MAX_SQUEUE) | |
33572 | return 0; | |
33573 | - save_flags(flags); | |
33574 | - cli(); | |
33575 | + spin_lock_irqsave(&icn_lock, flags); | |
33576 | nskb = skb_clone(skb, GFP_ATOMIC); | |
33577 | if (nskb) { | |
33578 | /* Push ACK flag as one | |
33579 | @@ -738,7 +722,7 @@ | |
33580 | } else | |
33581 | len = 0; | |
33582 | card->sndcount[channel] += len; | |
33583 | - restore_flags(flags); | |
33584 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33585 | } | |
33586 | return len; | |
33587 | } | |
33588 | @@ -860,11 +844,10 @@ | |
33589 | #ifdef BOOT_DEBUG | |
33590 | printk(KERN_DEBUG "Map Bank 0\n"); | |
33591 | #endif | |
33592 | - save_flags(flags); | |
33593 | - cli(); | |
33594 | + spin_lock_irqsave(&icn_lock, flags); | |
33595 | icn_map_channel(card, 0); /* Select Bank 0 */ | |
33596 | icn_lock_channel(card, 0); /* Lock Bank 0 */ | |
33597 | - restore_flags(flags); | |
33598 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33599 | SLEEP(1); | |
33600 | memcpy_toio(dev.shmem, codebuf, ICN_CODE_STAGE1); /* Copy code */ | |
33601 | #ifdef BOOT_DEBUG | |
33602 | @@ -875,12 +858,11 @@ | |
33603 | #ifdef BOOT_DEBUG | |
33604 | printk(KERN_DEBUG "Map Bank 8\n"); | |
33605 | #endif | |
33606 | - save_flags(flags); | |
33607 | - cli(); | |
33608 | + spin_lock_irqsave(&icn_lock, flags); | |
33609 | icn_release_channel(); | |
33610 | icn_map_channel(card, 2); /* Select Bank 8 */ | |
33611 | icn_lock_channel(card, 2); /* Lock Bank 8 */ | |
33612 | - restore_flags(flags); | |
33613 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33614 | SLEEP(1); | |
33615 | memcpy_toio(dev.shmem, codebuf, ICN_CODE_STAGE1); /* Copy code */ | |
33616 | #ifdef BOOT_DEBUG | |
33617 | @@ -900,11 +882,10 @@ | |
33618 | #ifdef BOOT_DEBUG | |
33619 | printk(KERN_DEBUG "Map Bank 0\n"); | |
33620 | #endif | |
33621 | - save_flags(flags); | |
33622 | - cli(); | |
33623 | + spin_lock_irqsave(&icn_lock, flags); | |
33624 | icn_map_channel(card, 0); /* Select Bank 0 */ | |
33625 | icn_lock_channel(card, 0); /* Lock Bank 0 */ | |
33626 | - restore_flags(flags); | |
33627 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33628 | SLEEP(1); | |
33629 | ret = (icn_check_loader(1)); | |
33630 | ||
33631 | @@ -931,8 +912,7 @@ | |
33632 | if ((ret = verify_area(VERIFY_READ, (void *) buffer, ICN_CODE_STAGE2))) | |
33633 | return ret; | |
33634 | timer = 0; | |
33635 | - save_flags(flags); | |
33636 | - cli(); | |
33637 | + spin_lock_irqsave(&icn_lock, flags); | |
33638 | if (card->secondhalf) { | |
33639 | icn_map_channel(card, 2); | |
33640 | icn_lock_channel(card, 2); | |
33641 | @@ -940,7 +920,7 @@ | |
33642 | icn_map_channel(card, 0); | |
33643 | icn_lock_channel(card, 0); | |
33644 | } | |
33645 | - restore_flags(flags); | |
33646 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33647 | while (left) { | |
33648 | if (sbfree) { /* If there is a free buffer... */ | |
33649 | cnt = left; | |
33650 | @@ -995,8 +975,7 @@ | |
33651 | printk(KERN_DEBUG "Proto loaded, install poll-timer %d\n", | |
33652 | card->secondhalf); | |
33653 | #endif | |
33654 | - save_flags(flags); | |
33655 | - cli(); | |
33656 | + spin_lock_irqsave(&icn_lock, flags); | |
33657 | init_timer(&card->st_timer); | |
33658 | card->st_timer.expires = jiffies + ICN_TIMER_DCREAD; | |
33659 | card->st_timer.function = icn_polldchan; | |
33660 | @@ -1011,7 +990,7 @@ | |
33661 | add_timer(&card->other->st_timer); | |
33662 | card->other->flags |= ICN_FLAGS_RUNNING; | |
33663 | } | |
33664 | - restore_flags(flags); | |
33665 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33666 | } | |
33667 | icn_maprelease_channel(card, 0); | |
33668 | return 0; | |
33669 | @@ -1069,8 +1048,7 @@ | |
33670 | } else | |
33671 | memcpy(msg, buf, count); | |
33672 | ||
33673 | - save_flags(flags); | |
33674 | - cli(); | |
33675 | + spin_lock_irqsave(&icn_lock, flags); | |
33676 | lastmap_card = dev.mcard; | |
33677 | lastmap_channel = dev.channel; | |
33678 | icn_map_channel(card, mch); | |
33679 | @@ -1092,7 +1070,7 @@ | |
33680 | writeb((readb(&cmd_i) + count) & 0xff, &cmd_i); | |
33681 | if (lastmap_card) | |
33682 | icn_map_channel(lastmap_card, lastmap_channel); | |
33683 | - restore_flags(flags); | |
33684 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33685 | if (len) { | |
33686 | mdelay(1); | |
33687 | if (loop++ > 20) | |
33688 | @@ -1118,8 +1096,7 @@ | |
33689 | unsigned long flags; | |
33690 | isdn_ctrl cmd; | |
33691 | ||
33692 | - save_flags(flags); | |
33693 | - cli(); | |
33694 | + spin_lock_irqsave(&icn_lock, flags); | |
33695 | if (card->flags & ICN_FLAGS_RUNNING) { | |
33696 | card->flags &= ~ICN_FLAGS_RUNNING; | |
33697 | del_timer(&card->st_timer); | |
33698 | @@ -1130,7 +1107,7 @@ | |
33699 | if (card->doubleS0) | |
33700 | icn_stopcard(card->other); | |
33701 | } | |
33702 | - restore_flags(flags); | |
33703 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33704 | } | |
33705 | ||
33706 | static void | |
33707 | @@ -1154,7 +1131,7 @@ | |
33708 | icn_card *card = cards; | |
33709 | ||
33710 | while (card) { | |
33711 | - if (check_region(card->port, ICN_PORTLEN)) { | |
33712 | + if (!request_region(card->port, ICN_PORTLEN, "icn-isdn")) { | |
33713 | printk(KERN_WARNING | |
33714 | "icn: (%s) ports 0x%03x-0x%03x in use.\n", | |
33715 | CID, | |
33716 | @@ -1163,6 +1140,7 @@ | |
33717 | } else { | |
33718 | OUTB_P(0, ICN_RUN); /* Reset Controller */ | |
33719 | OUTB_P(0, ICN_MAPRAM); /* Disable RAM */ | |
33720 | + release_region(card->port, ICN_PORTLEN); | |
33721 | } | |
33722 | card = card->next; | |
33723 | } | |
33724 | @@ -1184,22 +1162,22 @@ | |
33725 | switch (c->arg) { | |
33726 | case ICN_IOCTL_SETMMIO: | |
33727 | if (dev.memaddr != (a & 0x0ffc000)) { | |
33728 | - if (check_mem_region(a & 0x0ffc000, 0x4000)) { | |
33729 | + if (!request_mem_region(a & 0x0ffc000, 0x4000, "icn-isdn (all cards)")) { | |
33730 | printk(KERN_WARNING | |
33731 | "icn: memory at 0x%08lx in use.\n", | |
33732 | a & 0x0ffc000); | |
33733 | return -EINVAL; | |
33734 | } | |
33735 | + release_mem_region(a & 0x0ffc000, 0x4000); | |
33736 | icn_stopallcards(); | |
33737 | - save_flags(flags); | |
33738 | - cli(); | |
33739 | + spin_lock_irqsave(&icn_lock, flags); | |
33740 | if (dev.mvalid) { | |
33741 | iounmap(dev.shmem); | |
33742 | release_mem_region(dev.memaddr, 0x4000); | |
33743 | } | |
33744 | dev.mvalid = 0; | |
33745 | dev.memaddr = a & 0x0ffc000; | |
33746 | - restore_flags(flags); | |
33747 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33748 | printk(KERN_INFO | |
33749 | "icn: (%s) mmio set to 0x%08lx\n", | |
33750 | CID, | |
33751 | @@ -1214,15 +1192,15 @@ | |
33752 | a == 0x308 || a == 0x318 || a == 0x328 || a == 0x338 | |
33753 | || a == 0x348 || a == 0x358 || a == 0x368) { | |
33754 | if (card->port != (unsigned short) a) { | |
33755 | - if (check_region((unsigned short) a, ICN_PORTLEN)) { | |
33756 | + if (!request_region((unsigned short) a, ICN_PORTLEN, "icn-isdn")) { | |
33757 | printk(KERN_WARNING | |
33758 | "icn: (%s) ports 0x%03x-0x%03x in use.\n", | |
33759 | CID, (int) a, (int) a + ICN_PORTLEN); | |
33760 | return -EINVAL; | |
33761 | } | |
33762 | + release_region((unsigned short) a, ICN_PORTLEN); | |
33763 | icn_stopcard(card); | |
33764 | - save_flags(flags); | |
33765 | - cli(); | |
33766 | + spin_lock_irqsave(&icn_lock, flags); | |
33767 | if (card->rvalid) | |
33768 | release_region(card->port, ICN_PORTLEN); | |
33769 | card->port = (unsigned short) a; | |
33770 | @@ -1231,7 +1209,7 @@ | |
33771 | card->other->port = (unsigned short) a; | |
33772 | card->other->rvalid = 0; | |
33773 | } | |
33774 | - restore_flags(flags); | |
33775 | + spin_unlock_irqrestore(&icn_lock, flags); | |
33776 | printk(KERN_INFO | |
33777 | "icn: (%s) port set to 0x%03x\n", | |
33778 | CID, card->port); | |
33779 | diff -Nru a/drivers/isdn/sc/card.h b/drivers/isdn/sc/card.h | |
33780 | --- a/drivers/isdn/sc/card.h Mon Feb 4 23:49:25 2002 | |
33781 | +++ b/drivers/isdn/sc/card.h Wed Sep 3 05:23:34 2003 | |
33782 | @@ -94,6 +94,7 @@ | |
33783 | int StartOnReset; /* Indicates startproc after reset */ | |
33784 | int EngineUp; /* Indicates CommEngine Up */ | |
33785 | int trace_mode; /* Indicate if tracing is on */ | |
33786 | + spinlock_t lock; /* local lock */ | |
33787 | } board; | |
33788 | ||
33789 | #endif /* CARD_H */ | |
33790 | diff -Nru a/drivers/isdn/sc/command.c b/drivers/isdn/sc/command.c | |
33791 | --- a/drivers/isdn/sc/command.c Sun Nov 17 15:08:01 2002 | |
33792 | +++ b/drivers/isdn/sc/command.c Wed Sep 3 05:43:20 2003 | |
33793 | @@ -419,14 +419,13 @@ | |
33794 | ||
33795 | adapter[card]->EngineUp = 0; | |
33796 | ||
33797 | - save_flags(flags); | |
33798 | - cli(); | |
33799 | + spin_lock_irqsave(&adapter[card]->lock, flags); | |
33800 | init_timer(&adapter[card]->reset_timer); | |
33801 | adapter[card]->reset_timer.function = check_reset; | |
33802 | adapter[card]->reset_timer.data = card; | |
33803 | adapter[card]->reset_timer.expires = jiffies + CHECKRESET_TIME; | |
33804 | add_timer(&adapter[card]->reset_timer); | |
33805 | - restore_flags(flags); | |
33806 | + spin_unlock_irqrestore(&adapter[card]->lock, flags); | |
33807 | ||
33808 | outb(0x1,adapter[card]->ioport[SFT_RESET]); | |
33809 | ||
33810 | diff -Nru a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c | |
33811 | --- a/drivers/isdn/sc/init.c Thu May 22 19:22:14 2003 | |
33812 | +++ b/drivers/isdn/sc/init.c Wed Sep 3 05:33:51 2003 | |
33813 | @@ -97,11 +97,12 @@ | |
33814 | * No, I/O Base has been provided | |
33815 | */ | |
33816 | for (i = 0 ; i < MAX_IO_REGS - 1 ; i++) { | |
33817 | - if(check_region(io[b] + i * 0x400, 1)) { | |
33818 | + if(!request_region(io[b] + i * 0x400, 1, "sc test")) { | |
33819 | pr_debug("check_region for 0x%x failed\n", io[b] + i * 0x400); | |
33820 | io[b] = 0; | |
33821 | break; | |
33822 | - } | |
33823 | + } else | |
33824 | + release_region(io[b] + i * 0x400, 1); | |
33825 | } | |
33826 | ||
33827 | /* | |
33828 | @@ -136,11 +137,12 @@ | |
33829 | last_base = i + IOBASE_OFFSET; | |
33830 | pr_debug(" checking 0x%x...", i); | |
33831 | for ( j = 0 ; j < MAX_IO_REGS - 1 ; j++) { | |
33832 | - if(check_region(i + j * 0x400, 1)) { | |
33833 | + if(!request_region(i + j * 0x400, 1, "sc test")) { | |
33834 | pr_debug("Failed\n"); | |
33835 | found_io = 0; | |
33836 | break; | |
33837 | - } | |
33838 | + } else | |
33839 | + release_region(i + j * 0x400, 1); | |
33840 | } | |
33841 | ||
33842 | if(found_io) { | |
33843 | @@ -177,9 +179,10 @@ | |
33844 | * Just look for a signature and ID the | |
33845 | * board model | |
33846 | */ | |
33847 | - if(!check_region(ram[b], SRAM_PAGESIZE)) { | |
33848 | - pr_debug("check_region for RAM base 0x%x succeeded\n", ram[b]); | |
33849 | + if(request_region(ram[b], SRAM_PAGESIZE, "sc test")) { | |
33850 | + pr_debug("request_region for RAM base 0x%x succeeded\n", ram[b]); | |
33851 | model = identify_board(ram[b], io[b]); | |
33852 | + release_region(ram[b], SRAM_PAGESIZE); | |
33853 | } | |
33854 | } | |
33855 | else { | |
33856 | @@ -189,9 +192,10 @@ | |
33857 | */ | |
33858 | for (i = SRAM_MIN ; i < SRAM_MAX ; i += SRAM_PAGESIZE) { | |
33859 | pr_debug("Checking RAM address 0x%x...\n", i); | |
33860 | - if(!check_region(i, SRAM_PAGESIZE)) { | |
33861 | + if(request_region(i, SRAM_PAGESIZE, "sc test")) { | |
33862 | pr_debug(" check_region succeeded\n"); | |
33863 | model = identify_board(i, io[b]); | |
33864 | + release_region(i, SRAM_PAGESIZE); | |
33865 | if (model >= 0) { | |
33866 | pr_debug(" Identified a %s\n", | |
33867 | boardname[model]); | |
33868 | @@ -201,7 +205,7 @@ | |
33869 | pr_debug(" Unidentifed or inaccessible\n"); | |
33870 | continue; | |
33871 | } | |
33872 | - pr_debug(" check_region failed\n"); | |
33873 | + pr_debug(" request failed\n"); | |
33874 | } | |
33875 | } | |
33876 | /* | |
33877 | @@ -310,6 +314,7 @@ | |
33878 | continue; | |
33879 | } | |
33880 | memset(adapter[cinst], 0, sizeof(board)); | |
33881 | + spin_lock_init(&adapter[cinst]->lock); | |
33882 | ||
33883 | if(!register_isdn(interface)) { | |
33884 | /* | |
33885 | diff -Nru a/drivers/isdn/sc/message.c b/drivers/isdn/sc/message.c | |
33886 | --- a/drivers/isdn/sc/message.c Mon Sep 2 12:15:37 2002 | |
33887 | +++ b/drivers/isdn/sc/message.c Wed Sep 3 05:43:22 2003 | |
33888 | @@ -55,8 +55,7 @@ | |
33889 | /* | |
33890 | * Map in the DPM to the base page and copy the message | |
33891 | */ | |
33892 | - save_flags(flags); | |
33893 | - cli(); | |
33894 | + spin_lock_irqsave(&adapter[card]->lock, flags); | |
33895 | outb((adapter[card]->shmem_magic >> 14) | 0x80, | |
33896 | adapter[card]->ioport[adapter[card]->shmem_pgport]); | |
33897 | dpm = (DualPortMemory *) adapter[card]->rambase; | |
33898 | @@ -64,8 +63,7 @@ | |
33899 | MSG_LEN); | |
33900 | dpm->rsp_tail = (dpm->rsp_tail+1) % MAX_MESSAGES; | |
33901 | inb(adapter[card]->ioport[FIFO_READ]); | |
33902 | - restore_flags(flags); | |
33903 | - | |
33904 | + spin_unlock_irqrestore(&adapter[card]->lock, flags); | |
33905 | /* | |
33906 | * Tell the board that the message is received | |
33907 | */ | |
33908 | @@ -152,15 +150,14 @@ | |
33909 | /* | |
33910 | * Disable interrupts and map in shared memory | |
33911 | */ | |
33912 | - save_flags(flags); | |
33913 | - cli(); | |
33914 | + spin_lock_irqsave(&adapter[card]->lock, flags); | |
33915 | outb((adapter[card]->shmem_magic >> 14) | 0x80, | |
33916 | adapter[card]->ioport[adapter[card]->shmem_pgport]); | |
33917 | dpm = (DualPortMemory *) adapter[card]->rambase; /* Fix me */ | |
33918 | memcpy_toio(&(dpm->req_queue[dpm->req_head]),&sndmsg,MSG_LEN); | |
33919 | dpm->req_head = (dpm->req_head+1) % MAX_MESSAGES; | |
33920 | outb(sndmsg.sequence_no, adapter[card]->ioport[FIFO_WRITE]); | |
33921 | - restore_flags(flags); | |
33922 | + spin_unlock_irqrestore(&adapter[card]->lock, flags); | |
33923 | ||
33924 | pr_debug("%s: Sent Message seq:%d pid:%d time:%d " | |
33925 | "cnt:%d (type,class,code):(%d,%d,%d) " | |
33926 | diff -Nru a/drivers/isdn/sc/shmem.c b/drivers/isdn/sc/shmem.c | |
33927 | --- a/drivers/isdn/sc/shmem.c Mon Sep 2 12:15:37 2002 | |
33928 | +++ b/drivers/isdn/sc/shmem.c Wed Sep 3 05:42:20 2003 | |
33929 | @@ -53,18 +53,17 @@ | |
33930 | /* | |
33931 | * Block interrupts and load the page | |
33932 | */ | |
33933 | - save_flags(flags); | |
33934 | - cli(); | |
33935 | + spin_lock_irqsave(&adapter[card]->lock, flags); | |
33936 | ||
33937 | outb(((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80, | |
33938 | adapter[card]->ioport[adapter[card]->shmem_pgport]); | |
33939 | - pr_debug("%s: set page to %#x\n",adapter[card]->devicename, | |
33940 | - ((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80); | |
33941 | ret = memcpy_toio(adapter[card]->rambase + | |
33942 | ((unsigned long) dest % 0x4000), src, n); | |
33943 | + spin_unlock_irqrestore(&adapter[card]->lock, flags); | |
33944 | + pr_debug("%s: set page to %#x\n",adapter[card]->devicename, | |
33945 | + ((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80); | |
33946 | pr_debug("%s: copying %d bytes from %#x to %#x\n",adapter[card]->devicename, n, | |
33947 | (unsigned long) src, adapter[card]->rambase + ((unsigned long) dest %0x4000)); | |
33948 | - restore_flags(flags); | |
33949 | ||
33950 | return ret; | |
33951 | } | |
33952 | @@ -97,19 +96,18 @@ | |
33953 | /* | |
33954 | * Block interrupts and load the page | |
33955 | */ | |
33956 | - save_flags(flags); | |
33957 | - cli(); | |
33958 | + spin_lock_irqsave(&adapter[card]->lock, flags); | |
33959 | ||
33960 | outb(((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80, | |
33961 | adapter[card]->ioport[adapter[card]->shmem_pgport]); | |
33962 | - pr_debug("%s: set page to %#x\n",adapter[card]->devicename, | |
33963 | - ((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80); | |
33964 | ret = memcpy_fromio(dest,(void *)(adapter[card]->rambase + | |
33965 | ((unsigned long) src % 0x4000)), n); | |
33966 | + spin_unlock_irqrestore(&adapter[card]->lock, flags); | |
33967 | + pr_debug("%s: set page to %#x\n",adapter[card]->devicename, | |
33968 | + ((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80); | |
33969 | /* pr_debug("%s: copying %d bytes from %#x to %#x\n", | |
33970 | adapter[card]->devicename, n, | |
33971 | adapter[card]->rambase + ((unsigned long) src %0x4000), (unsigned long) dest); */ | |
33972 | - restore_flags(flags); | |
33973 | ||
33974 | return ret; | |
33975 | } | |
33976 | @@ -138,16 +136,15 @@ | |
33977 | /* | |
33978 | * Block interrupts and load the page | |
33979 | */ | |
33980 | - save_flags(flags); | |
33981 | - cli(); | |
33982 | + spin_lock_irqsave(&adapter[card]->lock, flags); | |
33983 | ||
33984 | outb(((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80, | |
33985 | adapter[card]->ioport[adapter[card]->shmem_pgport]); | |
33986 | - pr_debug("%s: set page to %#x\n",adapter[card]->devicename, | |
33987 | - ((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80); | |
33988 | ret = memset_io(adapter[card]->rambase + | |
33989 | ((unsigned long) dest % 0x4000), c, n); | |
33990 | - restore_flags(flags); | |
33991 | + pr_debug("%s: set page to %#x\n",adapter[card]->devicename, | |
33992 | + ((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80); | |
33993 | + spin_unlock_irqrestore(&adapter[card]->lock, flags); | |
33994 | ||
33995 | return ret; | |
33996 | } | |
33997 | diff -Nru a/drivers/isdn/sc/timer.c b/drivers/isdn/sc/timer.c | |
33998 | --- a/drivers/isdn/sc/timer.c Mon Sep 2 12:15:37 2002 | |
33999 | +++ b/drivers/isdn/sc/timer.c Wed Sep 3 05:49:32 2003 | |
34000 | @@ -62,8 +62,7 @@ | |
34001 | /* Setup the io ports */ | |
34002 | setup_ports(card); | |
34003 | ||
34004 | - save_flags(flags); | |
34005 | - cli(); | |
34006 | + spin_lock_irqsave(&adapter[card]->lock, flags); | |
34007 | outb(adapter[card]->ioport[adapter[card]->shmem_pgport], | |
34008 | (adapter[card]->shmem_magic>>14) | 0x80); | |
34009 | sig = (unsigned long) *((unsigned long *)(adapter[card]->rambase + SIG_OFFSET)); | |
34010 | @@ -71,18 +70,16 @@ | |
34011 | /* check the signature */ | |
34012 | if(sig == SIGNATURE) { | |
34013 | flushreadfifo(card); | |
34014 | - restore_flags(flags); | |
34015 | + spin_unlock_irqrestore(&adapter[card]->lock, flags); | |
34016 | /* See if we need to do a startproc */ | |
34017 | if (adapter[card]->StartOnReset) | |
34018 | startproc(card); | |
34019 | - } | |
34020 | - else { | |
34021 | + } else { | |
34022 | pr_debug("%s: No signature yet, waiting another %d jiffies.\n", | |
34023 | adapter[card]->devicename, CHECKRESET_TIME); | |
34024 | mod_timer(&adapter[card]->reset_timer, jiffies+CHECKRESET_TIME); | |
34025 | + spin_unlock_irqrestore(&adapter[card]->lock, flags); | |
34026 | } | |
34027 | - restore_flags(flags); | |
34028 | - | |
34029 | } | |
34030 | ||
34031 | /* | |
34032 | @@ -122,10 +119,9 @@ | |
34033 | adapter[card]->phystat = adapter[card]->nphystat; | |
34034 | ||
34035 | /* Reinitialize the timer */ | |
34036 | - save_flags(flags); | |
34037 | - cli(); | |
34038 | + spin_lock_irqsave(&adapter[card]->lock, flags); | |
34039 | mod_timer(&adapter[card]->stat_timer, jiffies+CHECKSTAT_TIME); | |
34040 | - restore_flags(flags); | |
34041 | + spin_unlock_irqrestore(&adapter[card]->lock, flags); | |
34042 | ||
34043 | /* Send a new cePhyStatus message */ | |
34044 | sendmessage(card, CEPID,ceReqTypePhy,ceReqClass2, | |
34045 | @@ -146,11 +142,5 @@ | |
34046 | */ | |
34047 | void trace_timer(unsigned long data) | |
34048 | { | |
34049 | - unsigned long flags; | |
34050 | - | |
34051 | - /* | |
34052 | - * Disable interrupts and swap the first page | |
34053 | - */ | |
34054 | - save_flags(flags); | |
34055 | - cli(); | |
34056 | + /* not implemented */ | |
34057 | } | |
34058 | diff -Nru a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c | |
34059 | --- a/drivers/macintosh/adb.c Sat Jun 7 00:45:03 2003 | |
34060 | +++ b/drivers/macintosh/adb.c Tue Aug 26 09:25:41 2003 | |
34061 | @@ -712,7 +712,7 @@ | |
34062 | { | |
34063 | struct adbdev_state *state; | |
34064 | ||
34065 | - if (minor(inode->i_rdev) > 0 || adb_controller == NULL) | |
34066 | + if (iminor(inode) > 0 || adb_controller == NULL) | |
34067 | return -ENXIO; | |
34068 | state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL); | |
34069 | if (state == 0) | |
34070 | diff -Nru a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c | |
34071 | --- a/drivers/macintosh/macio_asic.c Sat Aug 16 11:47:51 2003 | |
34072 | +++ b/drivers/macintosh/macio_asic.c Tue Aug 26 06:35:38 2003 | |
34073 | @@ -23,6 +23,8 @@ | |
34074 | #include <asm/prom.h> | |
34075 | #include <asm/pci-bridge.h> | |
34076 | ||
34077 | +static struct macio_chip *macio_on_hold; | |
34078 | + | |
34079 | static int | |
34080 | macio_bus_match(struct device *dev, struct device_driver *drv) | |
34081 | { | |
34082 | @@ -36,21 +38,27 @@ | |
34083 | return of_match_device(matches, &macio_dev->ofdev) != NULL; | |
34084 | } | |
34085 | ||
34086 | -struct bus_type macio_bus_type = { | |
34087 | - name: "macio", | |
34088 | - match: macio_bus_match, | |
34089 | -}; | |
34090 | +struct macio_dev *macio_dev_get(struct macio_dev *dev) | |
34091 | +{ | |
34092 | + struct device *tmp; | |
34093 | ||
34094 | -static int __init | |
34095 | -macio_bus_driver_init(void) | |
34096 | + if (!dev) | |
34097 | + return NULL; | |
34098 | + tmp = get_device(&dev->ofdev.dev); | |
34099 | + if (tmp) | |
34100 | + return to_macio_device(tmp); | |
34101 | + else | |
34102 | + return NULL; | |
34103 | +} | |
34104 | + | |
34105 | +void macio_dev_put(struct macio_dev *dev) | |
34106 | { | |
34107 | - return bus_register(&macio_bus_type); | |
34108 | + if (dev) | |
34109 | + put_device(&dev->ofdev.dev); | |
34110 | } | |
34111 | ||
34112 | -postcore_initcall(macio_bus_driver_init); | |
34113 | ||
34114 | -static int | |
34115 | -macio_device_probe(struct device *dev) | |
34116 | +static int macio_device_probe(struct device *dev) | |
34117 | { | |
34118 | int error = -ENODEV; | |
34119 | struct macio_driver *drv; | |
34120 | @@ -63,55 +71,89 @@ | |
34121 | if (!drv->probe) | |
34122 | return error; | |
34123 | ||
34124 | -/* if (!try_module_get(driver->owner)) { | |
34125 | - printk(KERN_ERR "Can't get a module reference for %s\n", driver->name); | |
34126 | - return error; | |
34127 | - } | |
34128 | -*/ | |
34129 | + macio_dev_get(macio_dev); | |
34130 | + | |
34131 | match = of_match_device(drv->match_table, &macio_dev->ofdev); | |
34132 | if (match) | |
34133 | error = drv->probe(macio_dev, match); | |
34134 | -/* | |
34135 | - module_put(driver->owner); | |
34136 | -*/ | |
34137 | + if (error) | |
34138 | + macio_dev_put(macio_dev); | |
34139 | + | |
34140 | return error; | |
34141 | } | |
34142 | ||
34143 | -static int | |
34144 | -macio_device_remove(struct device *dev) | |
34145 | +static int macio_device_remove(struct device *dev) | |
34146 | { | |
34147 | struct macio_dev * macio_dev = to_macio_device(dev); | |
34148 | struct macio_driver * drv = to_macio_driver(macio_dev->ofdev.dev.driver); | |
34149 | ||
34150 | if (drv && drv->remove) | |
34151 | drv->remove(macio_dev); | |
34152 | + macio_dev_put(macio_dev); | |
34153 | + | |
34154 | return 0; | |
34155 | } | |
34156 | ||
34157 | -static int | |
34158 | -macio_device_suspend(struct device *dev, u32 state, u32 level) | |
34159 | +static int macio_device_suspend(struct device *dev, u32 state) | |
34160 | { | |
34161 | struct macio_dev * macio_dev = to_macio_device(dev); | |
34162 | - struct macio_driver * drv = to_macio_driver(macio_dev->ofdev.dev.driver); | |
34163 | + struct macio_driver * drv; | |
34164 | int error = 0; | |
34165 | ||
34166 | - if (drv && drv->suspend) | |
34167 | - error = drv->suspend(macio_dev, state, level); | |
34168 | + if (macio_dev->ofdev.dev.driver == NULL) | |
34169 | + return 0; | |
34170 | + drv = to_macio_driver(macio_dev->ofdev.dev.driver); | |
34171 | + if (drv->suspend) | |
34172 | + error = drv->suspend(macio_dev, state); | |
34173 | return error; | |
34174 | } | |
34175 | ||
34176 | -static int | |
34177 | -macio_device_resume(struct device * dev, u32 level) | |
34178 | +static int macio_device_resume(struct device * dev) | |
34179 | { | |
34180 | struct macio_dev * macio_dev = to_macio_device(dev); | |
34181 | - struct macio_driver * drv = to_macio_driver(macio_dev->ofdev.dev.driver); | |
34182 | + struct macio_driver * drv; | |
34183 | int error = 0; | |
34184 | ||
34185 | - if (drv && drv->resume) | |
34186 | - error = drv->resume(macio_dev, level); | |
34187 | + if (macio_dev->ofdev.dev.driver == NULL) | |
34188 | + return 0; | |
34189 | + drv = to_macio_driver(macio_dev->ofdev.dev.driver); | |
34190 | + if (drv->resume) | |
34191 | + error = drv->resume(macio_dev); | |
34192 | return error; | |
34193 | } | |
34194 | ||
34195 | +struct bus_type macio_bus_type = { | |
34196 | + .name = "macio", | |
34197 | + .match = macio_bus_match, | |
34198 | + .suspend = macio_device_suspend, | |
34199 | + .resume = macio_device_resume, | |
34200 | +}; | |
34201 | + | |
34202 | +static int __init | |
34203 | +macio_bus_driver_init(void) | |
34204 | +{ | |
34205 | + return bus_register(&macio_bus_type); | |
34206 | +} | |
34207 | + | |
34208 | +postcore_initcall(macio_bus_driver_init); | |
34209 | + | |
34210 | + | |
34211 | +/** | |
34212 | + * macio_release_dev - free a macio device structure when all users of it are finished. | |
34213 | + * @dev: device that's been disconnected | |
34214 | + * | |
34215 | + * Will be called only by the device core when all users of this macio device are | |
34216 | + * done. This currently means never as we don't hot remove any macio device yet, | |
34217 | + * though that will happen with mediabay based devices in a later implementation. | |
34218 | + */ | |
34219 | +static void macio_release_dev(struct device *dev) | |
34220 | +{ | |
34221 | + struct macio_dev *mdev; | |
34222 | + | |
34223 | + mdev = to_macio_device(dev); | |
34224 | + kfree(mdev); | |
34225 | +} | |
34226 | + | |
34227 | /** | |
34228 | * macio_add_one_device - Add one device from OF node to the device tree | |
34229 | * @chip: pointer to the macio_chip holding the device | |
34230 | @@ -121,13 +163,15 @@ | |
34231 | * When media-bay is changed to hotswap drivers, this function will | |
34232 | * be exposed to the bay driver some way... | |
34233 | */ | |
34234 | -static struct macio_dev * | |
34235 | -macio_add_one_device(struct macio_chip *chip, struct device *parent, | |
34236 | +static struct macio_dev * macio_add_one_device(struct macio_chip *chip, struct device *parent, | |
34237 | struct device_node *np, struct macio_dev *in_bay) | |
34238 | { | |
34239 | struct macio_dev *dev; | |
34240 | u32 *reg; | |
34241 | ||
34242 | + if (np == NULL) | |
34243 | + return NULL; | |
34244 | + | |
34245 | dev = kmalloc(sizeof(*dev), GFP_KERNEL); | |
34246 | if (!dev) | |
34247 | return NULL; | |
34248 | @@ -140,6 +184,7 @@ | |
34249 | dev->ofdev.dev.dma_mask = &dev->ofdev.dma_mask; | |
34250 | dev->ofdev.dev.parent = parent; | |
34251 | dev->ofdev.dev.bus = &macio_bus_type; | |
34252 | + dev->ofdev.dev.release = macio_release_dev; | |
34253 | ||
34254 | /* MacIO itself has a different reg, we use it's PCI base */ | |
34255 | if (np == chip->of_node) { | |
34256 | @@ -164,8 +209,7 @@ | |
34257 | return dev; | |
34258 | } | |
34259 | ||
34260 | -static int | |
34261 | -macio_skip_device(struct device_node *np) | |
34262 | +static int macio_skip_device(struct device_node *np) | |
34263 | { | |
34264 | if (strncmp(np->name, "battery", 7) == 0) | |
34265 | return 1; | |
34266 | @@ -185,10 +229,9 @@ | |
34267 | * For now, childs of media-bay are added now as well. This will | |
34268 | * change rsn though. | |
34269 | */ | |
34270 | -static void | |
34271 | -macio_pci_add_devices(struct macio_chip *chip) | |
34272 | +static void macio_pci_add_devices(struct macio_chip *chip) | |
34273 | { | |
34274 | - struct device_node *np; | |
34275 | + struct device_node *np, *pnode; | |
34276 | struct macio_dev *rdev, *mdev, *mbdev = NULL, *sdev = NULL; | |
34277 | struct device *parent = NULL; | |
34278 | ||
34279 | @@ -196,16 +239,23 @@ | |
34280 | #ifdef CONFIG_PCI | |
34281 | if (chip->lbus.pdev) | |
34282 | parent = &chip->lbus.pdev->dev; | |
34283 | -#endif | |
34284 | - rdev = macio_add_one_device(chip, parent, chip->of_node, NULL); | |
34285 | +#endif | |
34286 | + pnode = of_node_get(chip->of_node); | |
34287 | + if (pnode == NULL) | |
34288 | + return; | |
34289 | + | |
34290 | + rdev = macio_add_one_device(chip, parent, pnode, NULL); | |
34291 | if (rdev == NULL) | |
34292 | return; | |
34293 | ||
34294 | /* First scan 1st level */ | |
34295 | - for (np = chip->of_node->child; np != NULL; np = np->sibling) { | |
34296 | + for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) { | |
34297 | if (!macio_skip_device(np)) { | |
34298 | + of_node_get(np); | |
34299 | mdev = macio_add_one_device(chip, &rdev->ofdev.dev, np, NULL); | |
34300 | - if (strncmp(np->name, "media-bay", 9) == 0) | |
34301 | + if (mdev == NULL) | |
34302 | + of_node_put(np); | |
34303 | + else if (strncmp(np->name, "media-bay", 9) == 0) | |
34304 | mbdev = mdev; | |
34305 | else if (strncmp(np->name, "escc", 4) == 0) | |
34306 | sdev = mdev; | |
34307 | @@ -213,17 +263,21 @@ | |
34308 | } | |
34309 | ||
34310 | /* Add media bay devices if any */ | |
34311 | - if (mbdev) { | |
34312 | - for (np = mbdev->ofdev.node->child; np != NULL; np = np->sibling) | |
34313 | - if (!macio_skip_device(np)) | |
34314 | - macio_add_one_device(chip, &mbdev->ofdev.dev, np, mbdev); | |
34315 | - } | |
34316 | + if (mbdev) | |
34317 | + for (np = NULL; (np = of_get_next_child(mbdev->ofdev.node, np)) != NULL;) | |
34318 | + if (!macio_skip_device(np)) { | |
34319 | + of_node_get(np); | |
34320 | + if (macio_add_one_device(chip, &mbdev->ofdev.dev, np, mbdev) == NULL) | |
34321 | + of_node_put(np); | |
34322 | + } | |
34323 | /* Add serial ports if any */ | |
34324 | - if (sdev) { | |
34325 | - for (np = sdev->ofdev.node->child; np != NULL; np = np->sibling) | |
34326 | - if (!macio_skip_device(np)) | |
34327 | - macio_add_one_device(chip, &sdev->ofdev.dev, np, NULL); | |
34328 | - } | |
34329 | + if (sdev) | |
34330 | + for (np = NULL; (np = of_get_next_child(sdev->ofdev.node, np)) != NULL;) | |
34331 | + if (!macio_skip_device(np)) { | |
34332 | + of_node_get(np); | |
34333 | + if (macio_add_one_device(chip, &sdev->ofdev.dev, np, NULL) == NULL) | |
34334 | + of_node_put(np); | |
34335 | + } | |
34336 | } | |
34337 | ||
34338 | ||
34339 | @@ -231,8 +285,7 @@ | |
34340 | * macio_register_driver - Registers a new MacIO device driver | |
34341 | * @drv: pointer to the driver definition structure | |
34342 | */ | |
34343 | -int | |
34344 | -macio_register_driver(struct macio_driver *drv) | |
34345 | +int macio_register_driver(struct macio_driver *drv) | |
34346 | { | |
34347 | int count = 0; | |
34348 | ||
34349 | @@ -240,8 +293,6 @@ | |
34350 | drv->driver.name = drv->name; | |
34351 | drv->driver.bus = &macio_bus_type; | |
34352 | drv->driver.probe = macio_device_probe; | |
34353 | - drv->driver.resume = macio_device_resume; | |
34354 | - drv->driver.suspend = macio_device_suspend; | |
34355 | drv->driver.remove = macio_device_remove; | |
34356 | ||
34357 | /* register with core */ | |
34358 | @@ -253,16 +304,14 @@ | |
34359 | * macio_unregister_driver - Unregisters a new MacIO device driver | |
34360 | * @drv: pointer to the driver definition structure | |
34361 | */ | |
34362 | -void | |
34363 | -macio_unregister_driver(struct macio_driver *drv) | |
34364 | +void macio_unregister_driver(struct macio_driver *drv) | |
34365 | { | |
34366 | driver_unregister(&drv->driver); | |
34367 | } | |
34368 | ||
34369 | #ifdef CONFIG_PCI | |
34370 | ||
34371 | -static int __devinit | |
34372 | -macio_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |
34373 | +static int __devinit macio_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |
34374 | { | |
34375 | struct device_node* np; | |
34376 | struct macio_chip* chip; | |
34377 | @@ -270,19 +319,27 @@ | |
34378 | if (ent->vendor != PCI_VENDOR_ID_APPLE) | |
34379 | return -ENODEV; | |
34380 | ||
34381 | + /* Note regarding refcounting: We assume pci_device_to_OF_node() is ported | |
34382 | + * to new OF APIs and returns a node with refcount incremented. This isn't | |
34383 | + * the case today, but on the other hand ppc32 doesn't do refcounting. This | |
34384 | + * will have to be fixed when going to ppc64. --BenH. | |
34385 | + */ | |
34386 | np = pci_device_to_OF_node(pdev); | |
34387 | if (np == NULL) | |
34388 | return -ENODEV; | |
34389 | ||
34390 | + /* We also assume that pmac_feature will have done a get() on nodes stored | |
34391 | + * in the macio chips array | |
34392 | + */ | |
34393 | chip = macio_find(np, macio_unknown); | |
34394 | + of_node_put(np); | |
34395 | if (chip == NULL) | |
34396 | return -ENODEV; | |
34397 | ||
34398 | - /* XXX Need locking */ | |
34399 | + /* XXX Need locking ??? */ | |
34400 | if (chip->lbus.pdev == NULL) { | |
34401 | chip->lbus.pdev = pdev; | |
34402 | chip->lbus.chip = chip; | |
34403 | -// INIT_LIST_HEAD(&chip->lbus.devices); | |
34404 | pci_set_drvdata(pdev, &chip->lbus); | |
34405 | pci_set_master(pdev); | |
34406 | } | |
34407 | @@ -290,13 +347,28 @@ | |
34408 | printk(KERN_INFO "MacIO PCI driver attached to %s chipset\n", | |
34409 | chip->name); | |
34410 | ||
34411 | + /* | |
34412 | + * HACK ALERT: The WallStreet PowerBook and some OHare based machines | |
34413 | + * have 2 macio ASICs. I must probe the "main" one first or IDE ordering | |
34414 | + * will be incorrect. So I put on "hold" the second one since it seem to | |
34415 | + * appear first on PCI | |
34416 | + */ | |
34417 | + if (chip->type == macio_gatwick || chip->type == macio_ohareII) | |
34418 | + if (macio_chips[0].lbus.pdev == NULL) { | |
34419 | + macio_on_hold = chip; | |
34420 | + return 0; | |
34421 | + } | |
34422 | + | |
34423 | macio_pci_add_devices(chip); | |
34424 | + if (macio_on_hold && macio_chips[0].lbus.pdev != NULL) { | |
34425 | + macio_pci_add_devices(macio_on_hold); | |
34426 | + macio_on_hold = NULL; | |
34427 | + } | |
34428 | ||
34429 | return 0; | |
34430 | } | |
34431 | ||
34432 | -static void __devexit | |
34433 | -macio_pci_remove(struct pci_dev* pdev) | |
34434 | +static void __devexit macio_pci_remove(struct pci_dev* pdev) | |
34435 | { | |
34436 | panic("removing of macio-asic not supported !\n"); | |
34437 | } | |
34438 | @@ -306,10 +378,10 @@ | |
34439 | * will then decide wether it applies or not | |
34440 | */ | |
34441 | static const struct pci_device_id __devinitdata pci_ids [] = { { | |
34442 | - .vendor = PCI_VENDOR_ID_APPLE, | |
34443 | - .device = PCI_ANY_ID, | |
34444 | - .subvendor = PCI_ANY_ID, | |
34445 | - .subdevice = PCI_ANY_ID, | |
34446 | + .vendor = PCI_VENDOR_ID_APPLE, | |
34447 | + .device = PCI_ANY_ID, | |
34448 | + .subvendor = PCI_ANY_ID, | |
34449 | + .subdevice = PCI_ANY_ID, | |
34450 | ||
34451 | }, { /* end: all zeroes */ } | |
34452 | }; | |
34453 | @@ -317,17 +389,16 @@ | |
34454 | ||
34455 | /* pci driver glue; this is a "new style" PCI driver module */ | |
34456 | static struct pci_driver macio_pci_driver = { | |
34457 | - .name = (char *) "macio", | |
34458 | - .id_table = pci_ids, | |
34459 | + .name = (char *) "macio", | |
34460 | + .id_table = pci_ids, | |
34461 | ||
34462 | - .probe = macio_pci_probe, | |
34463 | - .remove = macio_pci_remove, | |
34464 | + .probe = macio_pci_probe, | |
34465 | + .remove = macio_pci_remove, | |
34466 | }; | |
34467 | ||
34468 | #endif /* CONFIG_PCI */ | |
34469 | ||
34470 | -static int __init | |
34471 | -macio_module_init (void) | |
34472 | +static int __init macio_module_init (void) | |
34473 | { | |
34474 | #ifdef CONFIG_PCI | |
34475 | int rc; | |
34476 | @@ -339,17 +410,9 @@ | |
34477 | return 0; | |
34478 | } | |
34479 | ||
34480 | -/* | |
34481 | -static void __exit | |
34482 | -macio_module_cleanup (void) | |
34483 | -{ | |
34484 | -#ifdef CONFIG_PCI | |
34485 | - pci_unregister_driver(&macio_pci_driver); | |
34486 | -#endif | |
34487 | -} | |
34488 | -module_exit(macio_module_cleanup); | |
34489 | -*/ | |
34490 | module_init(macio_module_init); | |
34491 | ||
34492 | EXPORT_SYMBOL(macio_register_driver); | |
34493 | EXPORT_SYMBOL(macio_unregister_driver); | |
34494 | +EXPORT_SYMBOL(macio_dev_get); | |
34495 | +EXPORT_SYMBOL(macio_dev_put); | |
34496 | diff -Nru a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c | |
34497 | --- a/drivers/macintosh/mediabay.c Sat Mar 22 01:11:14 2003 | |
34498 | +++ b/drivers/macintosh/mediabay.c Mon Aug 25 09:51:43 2003 | |
34499 | @@ -37,15 +37,7 @@ | |
34500 | #include <linux/adb.h> | |
34501 | #include <linux/pmu.h> | |
34502 | ||
34503 | -#ifdef CONFIG_PMAC_PBOOK | |
34504 | -static int mb_notify_sleep(struct pmu_sleep_notifier *self, int when); | |
34505 | -static struct pmu_sleep_notifier mb_sleep_notifier = { | |
34506 | - mb_notify_sleep, | |
34507 | - SLEEP_LEVEL_MEDIABAY, | |
34508 | -}; | |
34509 | -#endif | |
34510 | ||
34511 | -#undef MB_USE_INTERRUPTS | |
34512 | #define MB_DEBUG | |
34513 | #define MB_IGNORE_SIGNALS | |
34514 | ||
34515 | @@ -55,13 +47,6 @@ | |
34516 | #define MBDBG(fmt, arg...) do { } while (0) | |
34517 | #endif | |
34518 | ||
34519 | -/* Type of media bay */ | |
34520 | -enum { | |
34521 | - mb_ohare, | |
34522 | - mb_heathrow, | |
34523 | - mb_keylargo | |
34524 | -}; | |
34525 | - | |
34526 | #define MB_FCR32(bay, r) ((bay)->base + ((r) >> 2)) | |
34527 | #define MB_FCR8(bay, r) (((volatile u8*)((bay)->base)) + (r)) | |
34528 | ||
34529 | @@ -76,11 +61,12 @@ | |
34530 | ||
34531 | struct mb_ops { | |
34532 | char* name; | |
34533 | - u8 (*content)(struct media_bay_info* bay); | |
34534 | - void (*power)(struct media_bay_info* bay, int on_off); | |
34535 | - int (*setup_bus)(struct media_bay_info* bay, u8 device_id); | |
34536 | - void (*un_reset)(struct media_bay_info* bay); | |
34537 | - void (*un_reset_ide)(struct media_bay_info* bay); | |
34538 | + void (*init)(struct media_bay_info *bay); | |
34539 | + u8 (*content)(struct media_bay_info *bay); | |
34540 | + void (*power)(struct media_bay_info *bay, int on_off); | |
34541 | + int (*setup_bus)(struct media_bay_info *bay, u8 device_id); | |
34542 | + void (*un_reset)(struct media_bay_info *bay); | |
34543 | + void (*un_reset_ide)(struct media_bay_info *bay); | |
34544 | }; | |
34545 | ||
34546 | struct media_bay_info { | |
34547 | @@ -90,11 +76,12 @@ | |
34548 | int last_value; | |
34549 | int value_count; | |
34550 | int timer; | |
34551 | - struct device_node* dev_node; | |
34552 | - int mb_type; | |
34553 | + struct macio_dev *mdev; | |
34554 | struct mb_ops* ops; | |
34555 | int index; | |
34556 | int cached_gpio; | |
34557 | + int sleeping; | |
34558 | + struct semaphore lock; | |
34559 | #ifdef CONFIG_BLK_DEV_IDE | |
34560 | unsigned long cd_base; | |
34561 | int cd_index; | |
34562 | @@ -111,13 +98,13 @@ | |
34563 | #ifdef CONFIG_BLK_DEV_IDE | |
34564 | /* check the busy bit in the media-bay ide interface | |
34565 | (assumes the media-bay contains an ide device) */ | |
34566 | -#define MB_IDE_READY(i) ((inb(media_bays[i].cd_base + 0x70) & 0x80) == 0) | |
34567 | +#define MB_IDE_READY(i) ((readb(media_bays[i].cd_base + 0x70) & 0x80) == 0) | |
34568 | #endif | |
34569 | ||
34570 | /* Note: All delays are not in milliseconds and converted to HZ relative | |
34571 | * values by the macro below | |
34572 | */ | |
34573 | -#define MS_TO_HZ(ms) ((ms * HZ) / 1000) | |
34574 | +#define MS_TO_HZ(ms) ((ms * HZ + 999) / 1000) | |
34575 | ||
34576 | /* | |
34577 | * Consider the media-bay ID value stable if it is the same for | |
34578 | @@ -352,38 +339,37 @@ | |
34579 | MB_BIS(bay, OHARE_FCR, OH_BAY_RESET_N); | |
34580 | } | |
34581 | ||
34582 | -static void __pmac | |
34583 | -heathrow_mb_un_reset(struct media_bay_info* bay) | |
34584 | +static void __pmac keylargo_mb_init(struct media_bay_info *bay) | |
34585 | +{ | |
34586 | + MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_ENABLE); | |
34587 | +} | |
34588 | + | |
34589 | +static void __pmac heathrow_mb_un_reset(struct media_bay_info* bay) | |
34590 | { | |
34591 | MB_BIS(bay, HEATHROW_FCR, HRW_BAY_RESET_N); | |
34592 | } | |
34593 | ||
34594 | -static void __pmac | |
34595 | -keylargo_mb_un_reset(struct media_bay_info* bay) | |
34596 | +static void __pmac keylargo_mb_un_reset(struct media_bay_info* bay) | |
34597 | { | |
34598 | MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_DEV_RESET); | |
34599 | } | |
34600 | ||
34601 | -static void __pmac | |
34602 | -ohare_mb_un_reset_ide(struct media_bay_info* bay) | |
34603 | +static void __pmac ohare_mb_un_reset_ide(struct media_bay_info* bay) | |
34604 | { | |
34605 | MB_BIS(bay, OHARE_FCR, OH_IDE1_RESET_N); | |
34606 | } | |
34607 | ||
34608 | -static void __pmac | |
34609 | -heathrow_mb_un_reset_ide(struct media_bay_info* bay) | |
34610 | +static void __pmac heathrow_mb_un_reset_ide(struct media_bay_info* bay) | |
34611 | { | |
34612 | MB_BIS(bay, HEATHROW_FCR, HRW_IDE1_RESET_N); | |
34613 | } | |
34614 | ||
34615 | -static void __pmac | |
34616 | -keylargo_mb_un_reset_ide(struct media_bay_info* bay) | |
34617 | +static void __pmac keylargo_mb_un_reset_ide(struct media_bay_info* bay) | |
34618 | { | |
34619 | MB_BIS(bay, KEYLARGO_FCR1, KL1_EIDE0_RESET_N); | |
34620 | } | |
34621 | ||
34622 | -static inline void __pmac | |
34623 | -set_mb_power(struct media_bay_info* bay, int onoff) | |
34624 | +static inline void __pmac set_mb_power(struct media_bay_info* bay, int onoff) | |
34625 | { | |
34626 | /* Power up up and assert the bay reset line */ | |
34627 | if (onoff) { | |
34628 | @@ -399,8 +385,7 @@ | |
34629 | bay->timer = MS_TO_HZ(MB_POWER_DELAY); | |
34630 | } | |
34631 | ||
34632 | -static void __pmac | |
34633 | -poll_media_bay(struct media_bay_info* bay) | |
34634 | +static void __pmac poll_media_bay(struct media_bay_info* bay) | |
34635 | { | |
34636 | int id = bay->ops->content(bay); | |
34637 | ||
34638 | @@ -429,15 +414,13 @@ | |
34639 | } | |
34640 | } | |
34641 | ||
34642 | -int __pmac | |
34643 | -check_media_bay(struct device_node *which_bay, int what) | |
34644 | +int __pmac check_media_bay(struct device_node *which_bay, int what) | |
34645 | { | |
34646 | #ifdef CONFIG_BLK_DEV_IDE | |
34647 | int i; | |
34648 | ||
34649 | for (i=0; i<media_bay_count; i++) | |
34650 | - if (which_bay == media_bays[i].dev_node) | |
34651 | - { | |
34652 | + if (media_bays[i].mdev && which_bay == media_bays[i].mdev->ofdev.node) { | |
34653 | if ((what == media_bays[i].content_id) && media_bays[i].state == mb_up) | |
34654 | return 0; | |
34655 | media_bays[i].cd_index = -1; | |
34656 | @@ -447,15 +430,13 @@ | |
34657 | return -ENODEV; | |
34658 | } | |
34659 | ||
34660 | -int __pmac | |
34661 | -check_media_bay_by_base(unsigned long base, int what) | |
34662 | +int __pmac check_media_bay_by_base(unsigned long base, int what) | |
34663 | { | |
34664 | #ifdef CONFIG_BLK_DEV_IDE | |
34665 | int i; | |
34666 | ||
34667 | for (i=0; i<media_bay_count; i++) | |
34668 | - if (base == media_bays[i].cd_base) | |
34669 | - { | |
34670 | + if (media_bays[i].mdev && base == media_bays[i].cd_base) { | |
34671 | if ((what == media_bays[i].content_id) && media_bays[i].state == mb_up) | |
34672 | return 0; | |
34673 | media_bays[i].cd_index = -1; | |
34674 | @@ -466,42 +447,47 @@ | |
34675 | return -ENODEV; | |
34676 | } | |
34677 | ||
34678 | -int __pmac | |
34679 | -media_bay_set_ide_infos(struct device_node* which_bay, unsigned long base, | |
34680 | +int __pmac media_bay_set_ide_infos(struct device_node* which_bay, unsigned long base, | |
34681 | int irq, int index) | |
34682 | { | |
34683 | #ifdef CONFIG_BLK_DEV_IDE | |
34684 | int i; | |
34685 | ||
34686 | - for (i=0; i<media_bay_count; i++) | |
34687 | - if (which_bay == media_bays[i].dev_node) | |
34688 | - { | |
34689 | + for (i=0; i<media_bay_count; i++) { | |
34690 | + struct media_bay_info* bay = &media_bays[i]; | |
34691 | + | |
34692 | + if (bay->mdev && which_bay == bay->mdev->ofdev.node) { | |
34693 | int timeout = 5000; | |
34694 | ||
34695 | - media_bays[i].cd_base = base; | |
34696 | - media_bays[i].cd_irq = irq; | |
34697 | + down(&bay->lock); | |
34698 | ||
34699 | - if ((MB_CD != media_bays[i].content_id) || media_bays[i].state != mb_up) | |
34700 | - return 0; | |
34701 | + bay->cd_base = base; | |
34702 | + bay->cd_irq = irq; | |
34703 | ||
34704 | - printk(KERN_DEBUG "Registered ide %d for media bay %d\n", index, i); | |
34705 | + if ((MB_CD != bay->content_id) || bay->state != mb_up) { | |
34706 | + up(&bay->lock); | |
34707 | + return 0; | |
34708 | + } | |
34709 | + printk(KERN_DEBUG "Registered ide%d for media bay %d\n", index, i); | |
34710 | do { | |
34711 | if (MB_IDE_READY(i)) { | |
34712 | - media_bays[i].cd_index = index; | |
34713 | + bay->cd_index = index; | |
34714 | + up(&bay->lock); | |
34715 | return 0; | |
34716 | } | |
34717 | mdelay(1); | |
34718 | } while(--timeout); | |
34719 | printk(KERN_DEBUG "Timeount waiting IDE in bay %d\n", i); | |
34720 | + up(&bay->lock); | |
34721 | return -ENODEV; | |
34722 | } | |
34723 | -#endif | |
34724 | + } | |
34725 | +#endif /* CONFIG_BLK_DEV_IDE */ | |
34726 | ||
34727 | return -ENODEV; | |
34728 | } | |
34729 | ||
34730 | -static void __pmac | |
34731 | -media_bay_step(int i) | |
34732 | +static void __pmac media_bay_step(int i) | |
34733 | { | |
34734 | struct media_bay_info* bay = &media_bays[i]; | |
34735 | ||
34736 | @@ -567,6 +553,7 @@ | |
34737 | if (bay->cd_index < 0) { | |
34738 | hw_regs_t hw; | |
34739 | ||
34740 | + printk("mediabay %d, registering IDE...\n", i); | |
34741 | pmu_suspend(); | |
34742 | ide_init_hwif_ports(&hw, (unsigned long) bay->cd_base, (unsigned long) 0, NULL); | |
34743 | hw.irq = bay->cd_irq; | |
34744 | @@ -580,13 +567,15 @@ | |
34745 | printk("IDE register error\n"); | |
34746 | set_mb_power(bay, 0); | |
34747 | } else { | |
34748 | - printk(KERN_DEBUG "media-bay %d is ide %d\n", i, bay->cd_index); | |
34749 | + printk(KERN_DEBUG "media-bay %d is ide%d\n", i, bay->cd_index); | |
34750 | MBDBG("mediabay %d IDE ready\n", i); | |
34751 | } | |
34752 | break; | |
34753 | - } | |
34754 | + } else if (bay->timer > 0) | |
34755 | + bay->timer--; | |
34756 | if (bay->timer == 0) { | |
34757 | - printk("\nIDE Timeout in bay %d !\n", i); | |
34758 | + printk("\nIDE Timeout in bay %d !, IDE state is: 0x%02x\n", | |
34759 | + i, readb(bay->cd_base + 0x70)); | |
34760 | MBDBG("mediabay%d: nIDE Timeout !\n", i); | |
34761 | set_mb_power(bay, 0); | |
34762 | } | |
34763 | @@ -623,8 +612,7 @@ | |
34764 | * with the IDE driver. It needs to be a thread because | |
34765 | * ide_register can't be called from interrupt context. | |
34766 | */ | |
34767 | -static int __pmac | |
34768 | -media_bay_task(void *x) | |
34769 | +static int __pmac media_bay_task(void *x) | |
34770 | { | |
34771 | int i; | |
34772 | ||
34773 | @@ -634,75 +622,140 @@ | |
34774 | #endif | |
34775 | ||
34776 | for (;;) { | |
34777 | - for (i = 0; i < media_bay_count; ++i) | |
34778 | - media_bay_step(i); | |
34779 | + for (i = 0; i < media_bay_count; ++i) { | |
34780 | + down(&media_bays[i].lock); | |
34781 | + if (!media_bays[i].sleeping) | |
34782 | + media_bay_step(i); | |
34783 | + up(&media_bays[i].lock); | |
34784 | + } | |
34785 | ||
34786 | current->state = TASK_INTERRUPTIBLE; | |
34787 | - schedule_timeout(1); | |
34788 | + schedule_timeout(MS_TO_HZ(10)); | |
34789 | if (signal_pending(current)) | |
34790 | return 0; | |
34791 | } | |
34792 | } | |
34793 | ||
34794 | -#ifdef MB_USE_INTERRUPTS | |
34795 | -static void __pmac | |
34796 | -media_bay_intr(int irq, void *devid, struct pt_regs *regs) | |
34797 | -{ | |
34798 | -} | |
34799 | -#endif | |
34800 | - | |
34801 | -#ifdef CONFIG_PMAC_PBOOK | |
34802 | -/* | |
34803 | - * notify clients before sleep and reset bus afterwards | |
34804 | - */ | |
34805 | -int __pmac | |
34806 | -mb_notify_sleep(struct pmu_sleep_notifier *self, int when) | |
34807 | +static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_match *match) | |
34808 | { | |
34809 | struct media_bay_info* bay; | |
34810 | + volatile u32 *regbase; | |
34811 | + struct device_node *ofnode; | |
34812 | int i; | |
34813 | + | |
34814 | + ofnode = mdev->ofdev.node; | |
34815 | + | |
34816 | + if (!request_OF_resource(ofnode, 0, NULL)) | |
34817 | + return -ENXIO; | |
34818 | + | |
34819 | + /* Media bay registers are located at the beginning of the | |
34820 | + * mac-io chip, we get the parent address for now (hrm...) | |
34821 | + */ | |
34822 | + if (ofnode->parent->n_addrs == 0) | |
34823 | + return -ENODEV; | |
34824 | + regbase = (volatile u32 *)ioremap(ofnode->parent->addrs[0].address, 0x100); | |
34825 | + if (regbase == NULL) { | |
34826 | + release_OF_resource(ofnode, 0); | |
34827 | + return -ENOMEM; | |
34828 | + } | |
34829 | ||
34830 | - switch (when) { | |
34831 | - case PBOOK_SLEEP_REQUEST: | |
34832 | - case PBOOK_SLEEP_REJECT: | |
34833 | - break; | |
34834 | - | |
34835 | - case PBOOK_SLEEP_NOW: | |
34836 | - for (i=0; i<media_bay_count; i++) { | |
34837 | - bay = &media_bays[i]; | |
34838 | - set_mb_power(bay, 0); | |
34839 | - mdelay(10); | |
34840 | - } | |
34841 | - break; | |
34842 | - case PBOOK_WAKE: | |
34843 | - for (i=0; i<media_bay_count; i++) { | |
34844 | - bay = &media_bays[i]; | |
34845 | - /* We re-enable the bay using it's previous content | |
34846 | - only if it did not change. Note those bozo timings, | |
34847 | - they seem to help the 3400 get it right. | |
34848 | - */ | |
34849 | - /* Force MB power to 0 */ | |
34850 | - set_mb_power(bay, 0); | |
34851 | - mdelay(MB_POWER_DELAY); | |
34852 | - if (bay->ops->content(bay) != bay->content_id) | |
34853 | - continue; | |
34854 | - set_mb_power(bay, 1); | |
34855 | - bay->last_value = bay->content_id; | |
34856 | - bay->value_count = MS_TO_HZ(MB_STABLE_DELAY); | |
34857 | - bay->timer = MS_TO_HZ(MB_POWER_DELAY); | |
34858 | -#ifdef CONFIG_BLK_DEV_IDE | |
34859 | - bay->cd_retry = 0; | |
34860 | -#endif | |
34861 | - do { | |
34862 | - mdelay(1000/HZ); | |
34863 | - media_bay_step(i); | |
34864 | - } while((media_bays[i].state != mb_empty) && | |
34865 | - (media_bays[i].state != mb_up)); | |
34866 | - } | |
34867 | - break; | |
34868 | + i = media_bay_count++; | |
34869 | + bay = &media_bays[i]; | |
34870 | + bay->mdev = mdev; | |
34871 | + bay->base = regbase; | |
34872 | + bay->index = i; | |
34873 | + bay->ops = match->data; | |
34874 | + bay->sleeping = 0; | |
34875 | + init_MUTEX(&bay->lock); | |
34876 | + | |
34877 | + /* Init HW probing */ | |
34878 | + if (bay->ops->init) | |
34879 | + bay->ops->init(bay); | |
34880 | + | |
34881 | + printk(KERN_INFO "mediabay%d: Registered %s media-bay\n", i, bay->ops->name); | |
34882 | + | |
34883 | + /* Force an immediate detect */ | |
34884 | + set_mb_power(bay, 0); | |
34885 | + set_current_state(TASK_UNINTERRUPTIBLE); | |
34886 | + schedule_timeout(MS_TO_HZ(MB_POWER_DELAY)); | |
34887 | + bay->content_id = MB_NO; | |
34888 | + bay->last_value = bay->ops->content(bay); | |
34889 | + bay->value_count = MS_TO_HZ(MB_STABLE_DELAY); | |
34890 | + bay->state = mb_empty; | |
34891 | + do { | |
34892 | + set_current_state(TASK_UNINTERRUPTIBLE); | |
34893 | + schedule_timeout(MS_TO_HZ(10)); | |
34894 | + media_bay_step(i); | |
34895 | + } while((bay->state != mb_empty) && | |
34896 | + (bay->state != mb_up)); | |
34897 | + | |
34898 | + /* Mark us ready by filling our mdev data */ | |
34899 | + dev_set_drvdata(&mdev->ofdev.dev, bay); | |
34900 | + | |
34901 | + /* Startup kernel thread */ | |
34902 | + if (i == 0) | |
34903 | + kernel_thread(media_bay_task, NULL, | |
34904 | + CLONE_FS | CLONE_FILES | CLONE_SIGHAND); | |
34905 | + | |
34906 | + return 0; | |
34907 | + | |
34908 | +} | |
34909 | + | |
34910 | +static int __pmac media_bay_suspend(struct macio_dev *mdev, u32 state) | |
34911 | +{ | |
34912 | + struct media_bay_info *bay = dev_get_drvdata(&mdev->ofdev.dev); | |
34913 | + | |
34914 | + if (state != mdev->ofdev.dev.power_state && state >= 2) { | |
34915 | + down(&bay->lock); | |
34916 | + bay->sleeping = 1; | |
34917 | + set_mb_power(bay, 0); | |
34918 | + up(&bay->lock); | |
34919 | + set_current_state(TASK_UNINTERRUPTIBLE); | |
34920 | + schedule_timeout(MS_TO_HZ(10)); | |
34921 | + mdev->ofdev.dev.power_state = state; | |
34922 | } | |
34923 | - return PBOOK_SLEEP_OK; | |
34924 | + return 0; | |
34925 | +} | |
34926 | + | |
34927 | +static int __pmac media_bay_resume(struct macio_dev *mdev) | |
34928 | +{ | |
34929 | + struct media_bay_info *bay = dev_get_drvdata(&mdev->ofdev.dev); | |
34930 | + | |
34931 | + if (mdev->ofdev.dev.power_state != 0) { | |
34932 | + mdev->ofdev.dev.power_state = 0; | |
34933 | + | |
34934 | + /* We re-enable the bay using it's previous content | |
34935 | + only if it did not change. Note those bozo timings, | |
34936 | + they seem to help the 3400 get it right. | |
34937 | + */ | |
34938 | + /* Force MB power to 0 */ | |
34939 | + down(&bay->lock); | |
34940 | + set_mb_power(bay, 0); | |
34941 | + set_current_state(TASK_UNINTERRUPTIBLE); | |
34942 | + schedule_timeout(MS_TO_HZ(MB_POWER_DELAY)); | |
34943 | + if (bay->ops->content(bay) != bay->content_id) { | |
34944 | + printk("mediabay%d: content changed during sleep...\n", bay->index); | |
34945 | + up(&bay->lock); | |
34946 | + return 0; | |
34947 | + } | |
34948 | + set_mb_power(bay, 1); | |
34949 | + bay->last_value = bay->content_id; | |
34950 | + bay->value_count = MS_TO_HZ(MB_STABLE_DELAY); | |
34951 | + bay->timer = MS_TO_HZ(MB_POWER_DELAY); | |
34952 | +#ifdef CONFIG_BLK_DEV_IDE | |
34953 | + bay->cd_retry = 0; | |
34954 | +#endif | |
34955 | + do { | |
34956 | + set_current_state(TASK_UNINTERRUPTIBLE); | |
34957 | + schedule_timeout(MS_TO_HZ(10)); | |
34958 | + media_bay_step(bay->index); | |
34959 | + } while((bay->state != mb_empty) && | |
34960 | + (bay->state != mb_up)); | |
34961 | + bay->sleeping = 0; | |
34962 | + up(&bay->lock); | |
34963 | + } | |
34964 | + return 0; | |
34965 | } | |
34966 | -#endif /* CONFIG_PMAC_PBOOK */ | |
34967 | ||
34968 | ||
34969 | /* Definitions of "ops" structures. | |
34970 | @@ -727,6 +780,7 @@ | |
34971 | ||
34972 | static struct mb_ops keylargo_mb_ops __pmacdata = { | |
34973 | .name = "KeyLargo", | |
34974 | + .init = keylargo_mb_init, | |
34975 | .content = keylargo_mb_content, | |
34976 | .power = keylargo_mb_power, | |
34977 | .setup_bus = keylargo_mb_setup_bus, | |
34978 | @@ -743,12 +797,42 @@ | |
34979 | * Therefore we do it all by polling the media bay once each tick. | |
34980 | */ | |
34981 | ||
34982 | -static int __init | |
34983 | -media_bay_init(void) | |
34984 | +static struct of_match media_bay_match[] = | |
34985 | { | |
34986 | - struct device_node *np; | |
34987 | - int n,i; | |
34988 | - | |
34989 | + { | |
34990 | + .name = "media-bay", | |
34991 | + .type = OF_ANY_MATCH, | |
34992 | + .compatible = "keylargo-media-bay", | |
34993 | + .data = &keylargo_mb_ops, | |
34994 | + }, | |
34995 | + { | |
34996 | + .name = "media-bay", | |
34997 | + .type = OF_ANY_MATCH, | |
34998 | + .compatible = "heathrow-media-bay", | |
34999 | + .data = &heathrow_mb_ops, | |
35000 | + }, | |
35001 | + { | |
35002 | + .name = "media-bay", | |
35003 | + .type = OF_ANY_MATCH, | |
35004 | + .compatible = "ohare-media-bay", | |
35005 | + .data = &ohare_mb_ops, | |
35006 | + }, | |
35007 | + {}, | |
35008 | +}; | |
35009 | + | |
35010 | +static struct macio_driver media_bay_driver = | |
35011 | +{ | |
35012 | + .name = "media-bay", | |
35013 | + .match_table = media_bay_match, | |
35014 | + .probe = media_bay_attach, | |
35015 | + .suspend = media_bay_suspend, | |
35016 | + .resume = media_bay_resume | |
35017 | +}; | |
35018 | + | |
35019 | +static int __init media_bay_init(void) | |
35020 | +{ | |
35021 | + int i; | |
35022 | + | |
35023 | for (i=0; i<MAX_BAYS; i++) { | |
35024 | memset((char *)&media_bays[i], 0, sizeof(struct media_bay_info)); | |
35025 | media_bays[i].content_id = -1; | |
35026 | @@ -756,84 +840,12 @@ | |
35027 | media_bays[i].cd_index = -1; | |
35028 | #endif | |
35029 | } | |
35030 | - | |
35031 | - np = find_devices("media-bay"); | |
35032 | - n = 0; | |
35033 | - while(np && (n<MAX_BAYS)) { | |
35034 | - struct media_bay_info* bay = &media_bays[n]; | |
35035 | - if (!np->parent || np->n_addrs == 0 || !request_OF_resource(np, 0, NULL)) { | |
35036 | - np = np->next; | |
35037 | - printk(KERN_ERR "media-bay: Can't request IO resource !\n"); | |
35038 | - continue; | |
35039 | - } | |
35040 | - bay->mb_type = mb_ohare; | |
35041 | - | |
35042 | - if (device_is_compatible(np, "keylargo-media-bay")) { | |
35043 | - bay->mb_type = mb_keylargo; | |
35044 | - bay->ops = &keylargo_mb_ops; | |
35045 | - } else if (device_is_compatible(np, "heathrow-media-bay")) { | |
35046 | - bay->mb_type = mb_heathrow; | |
35047 | - bay->ops = &heathrow_mb_ops; | |
35048 | - } else if (device_is_compatible(np, "ohare-media-bay")) { | |
35049 | - bay->mb_type = mb_ohare; | |
35050 | - bay->ops = &ohare_mb_ops; | |
35051 | - } else { | |
35052 | - printk(KERN_ERR "mediabay: Unknown bay type !\n"); | |
35053 | - np = np->next; | |
35054 | - continue; | |
35055 | - } | |
35056 | - bay->base = (volatile u32*)ioremap(np->parent->addrs[0].address, 0x1000); | |
35057 | - | |
35058 | - /* Enable probe logic on keylargo */ | |
35059 | - if (bay->mb_type == mb_keylargo) | |
35060 | - MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_ENABLE); | |
35061 | -#ifdef MB_USE_INTERRUPTS | |
35062 | - if (np->n_intrs == 0) { | |
35063 | - printk(KERN_ERR "media bay %d has no irq\n",n); | |
35064 | - np = np->next; | |
35065 | - continue; | |
35066 | - } | |
35067 | - | |
35068 | - if (request_irq(np->intrs[0].line, media_bay_intr, 0, "Media bay", (void *)n)) { | |
35069 | - printk(KERN_ERR "Couldn't get IRQ %d for media bay %d\n", | |
35070 | - np->intrs[0].line, n); | |
35071 | - np = np->next; | |
35072 | - continue; | |
35073 | - } | |
35074 | -#endif | |
35075 | - media_bay_count++; | |
35076 | - | |
35077 | - printk(KERN_INFO "mediabay%d: Registered %s media-bay\n", n, bay->ops->name); | |
35078 | - bay->dev_node = np; | |
35079 | - bay->index = n; | |
35080 | - | |
35081 | - /* Force an immediate detect */ | |
35082 | - set_mb_power(bay, 0); | |
35083 | - mdelay(MB_POWER_DELAY); | |
35084 | - bay->content_id = MB_NO; | |
35085 | - bay->last_value = bay->ops->content(bay); | |
35086 | - bay->value_count = MS_TO_HZ(MB_STABLE_DELAY); | |
35087 | - bay->state = mb_empty; | |
35088 | - do { | |
35089 | - mdelay(1000/HZ); | |
35090 | - media_bay_step(n); | |
35091 | - } while((bay->state != mb_empty) && | |
35092 | - (bay->state != mb_up)); | |
35093 | - | |
35094 | - n++; | |
35095 | - np=np->next; | |
35096 | - } | |
35097 | + if (_machine != _MACH_Pmac) | |
35098 | + return -ENODEV; | |
35099 | ||
35100 | - if (media_bay_count) | |
35101 | - { | |
35102 | -#ifdef CONFIG_PMAC_PBOOK | |
35103 | - pmu_register_sleep_notifier(&mb_sleep_notifier); | |
35104 | -#endif /* CONFIG_PMAC_PBOOK */ | |
35105 | + macio_register_driver(&media_bay_driver); | |
35106 | ||
35107 | - kernel_thread(media_bay_task, NULL, | |
35108 | - CLONE_FS | CLONE_FILES | CLONE_SIGHAND); | |
35109 | - } | |
35110 | return 0; | |
35111 | } | |
35112 | ||
35113 | -subsys_initcall(media_bay_init); | |
35114 | +device_initcall(media_bay_init); | |
35115 | diff -Nru a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c | |
35116 | --- a/drivers/macintosh/via-pmu.c Sat Jun 7 00:46:48 2003 | |
35117 | +++ b/drivers/macintosh/via-pmu.c Wed Sep 3 09:25:59 2003 | |
35118 | @@ -11,6 +11,14 @@ | |
35119 | * Copyright (C) 1998 Paul Mackerras and Fabio Riccardi. | |
35120 | * Copyright (C) 2001-2002 Benjamin Herrenschmidt | |
35121 | * | |
35122 | + * THIS DRIVER IS BECOMING A TOTAL MESS ! | |
35123 | + * - Cleanup atomically disabling reply to PMU events after | |
35124 | + * a sleep or a freq. switch | |
35125 | + * - Move sleep code out of here to pmac_pm, merge into new | |
35126 | + * common PM infrastructure | |
35127 | + * - Move backlight code out as well | |
35128 | + * - Save/Restore PCI space properly | |
35129 | + * | |
35130 | */ | |
35131 | #include <stdarg.h> | |
35132 | #include <linux/config.h> | |
35133 | @@ -34,6 +42,8 @@ | |
35134 | #include <linux/proc_fs.h> | |
35135 | #include <linux/init.h> | |
35136 | #include <linux/interrupt.h> | |
35137 | +#include <linux/device.h> | |
35138 | +#include <linux/suspend.h> | |
35139 | #include <asm/prom.h> | |
35140 | #include <asm/machdep.h> | |
35141 | #include <asm/io.h> | |
35142 | @@ -47,6 +57,7 @@ | |
35143 | #include <asm/mmu_context.h> | |
35144 | #include <asm/cputable.h> | |
35145 | #include <asm/time.h> | |
35146 | +#include <asm/xmon.h> | |
35147 | #ifdef CONFIG_PMAC_BACKLIGHT | |
35148 | #include <asm/backlight.h> | |
35149 | #endif | |
35150 | @@ -55,7 +66,6 @@ | |
35151 | #undef SUSPEND_USES_PMU | |
35152 | #define DEBUG_SLEEP | |
35153 | #undef HACKED_PCI_SAVE | |
35154 | -#define NEW_OHARE_CODE | |
35155 | ||
35156 | /* Misc minor number allocated for /dev/pmu */ | |
35157 | #define PMU_MINOR 154 | |
35158 | @@ -63,6 +73,13 @@ | |
35159 | /* How many iterations between battery polls */ | |
35160 | #define BATTERY_POLLING_COUNT 2 | |
35161 | ||
35162 | +/* Some debugging tools */ | |
35163 | +#ifdef CONFIG_XMON | |
35164 | +//#define LIVE_DEBUG(req) ((req) && (req)->data[0] == 0x7d) | |
35165 | +#define LIVE_DEBUG(req) (0) | |
35166 | +static int whacky_debug; | |
35167 | +#endif /* CONFIG_XMON */ | |
35168 | + | |
35169 | static volatile unsigned char *via; | |
35170 | ||
35171 | /* VIA registers - spaced 0x200 bytes apart */ | |
35172 | @@ -106,6 +123,7 @@ | |
35173 | intack, | |
35174 | reading, | |
35175 | reading_intr, | |
35176 | + locked, | |
35177 | } pmu_state; | |
35178 | ||
35179 | static volatile enum int_data_state { | |
35180 | @@ -133,6 +151,7 @@ | |
35181 | static int pmu_has_adb; | |
35182 | static unsigned char *gpio_reg = NULL; | |
35183 | static int gpio_irq = -1; | |
35184 | +static int gpio_irq_enabled = -1; | |
35185 | static volatile int pmu_suspended = 0; | |
35186 | static spinlock_t pmu_lock; | |
35187 | static u8 pmu_intr_mask; | |
35188 | @@ -143,9 +162,11 @@ | |
35189 | static int sleep_in_progress; | |
35190 | static int can_sleep; | |
35191 | #endif /* CONFIG_PMAC_PBOOK */ | |
35192 | +static unsigned int pmu_irq_stats[11]; | |
35193 | ||
35194 | static struct proc_dir_entry *proc_pmu_root; | |
35195 | static struct proc_dir_entry *proc_pmu_info; | |
35196 | +static struct proc_dir_entry *proc_pmu_irqstats; | |
35197 | static struct proc_dir_entry *proc_pmu_options; | |
35198 | ||
35199 | #ifdef CONFIG_PMAC_PBOOK | |
35200 | @@ -184,6 +205,8 @@ | |
35201 | static irqreturn_t gpio1_interrupt(int irq, void *arg, struct pt_regs *regs); | |
35202 | static int proc_get_info(char *page, char **start, off_t off, | |
35203 | int count, int *eof, void *data); | |
35204 | +static int proc_get_irqstats(char *page, char **start, off_t off, | |
35205 | + int count, int *eof, void *data); | |
35206 | #ifdef CONFIG_PMAC_BACKLIGHT | |
35207 | static int pmu_set_backlight_level(int level, void* data); | |
35208 | static int pmu_set_backlight_enable(int on, int level, void* data); | |
35209 | @@ -205,16 +228,12 @@ | |
35210 | pmu_init, | |
35211 | pmu_send_request, | |
35212 | pmu_adb_autopoll, | |
35213 | - pmu_poll, | |
35214 | + pmu_poll_adb, | |
35215 | pmu_adb_reset_bus | |
35216 | }; | |
35217 | #endif /* CONFIG_ADB */ | |
35218 | ||
35219 | extern void low_sleep_handler(void); | |
35220 | -extern void pmac_sleep_save_intrs(int); | |
35221 | -extern void pmac_sleep_restore_intrs(void); | |
35222 | -extern void openpic_sleep_save_intrs(void); | |
35223 | -extern void openpic_sleep_restore_intrs(void); | |
35224 | extern void enable_kernel_altivec(void); | |
35225 | extern void enable_kernel_fp(void); | |
35226 | ||
35227 | @@ -223,14 +242,6 @@ | |
35228 | int pmu_wink(struct adb_request *req); | |
35229 | #endif | |
35230 | ||
35231 | -#if defined(CONFIG_PMAC_PBOOK) && defined(CONFIG_PM) | |
35232 | -static int generic_notify_sleep(struct pmu_sleep_notifier *self, int when); | |
35233 | -static struct pmu_sleep_notifier generic_sleep_notifier = { | |
35234 | - generic_notify_sleep, | |
35235 | - SLEEP_LEVEL_MISC, | |
35236 | -}; | |
35237 | -#endif /* defined(CONFIG_PMAC_PBOOK) && defined(CONFIG_PM) */ | |
35238 | - | |
35239 | /* | |
35240 | * This table indicates for each PMU opcode: | |
35241 | * - the number of data bytes to be sent with the command, or -1 | |
35242 | @@ -361,11 +372,6 @@ | |
35243 | ||
35244 | sys_ctrler = SYS_CTRLER_PMU; | |
35245 | ||
35246 | -#if defined(CONFIG_PMAC_PBOOK) && defined(CONFIG_PM) | |
35247 | - pmu_register_sleep_notifier(&generic_sleep_notifier); | |
35248 | - pm_active = 1; | |
35249 | -#endif | |
35250 | - | |
35251 | return 1; | |
35252 | } | |
35253 | ||
35254 | @@ -416,6 +422,7 @@ | |
35255 | if (pmu_kind == PMU_KEYLARGO_BASED && gpio_irq != -1) { | |
35256 | if (request_irq(gpio_irq, gpio1_interrupt, 0, "GPIO1/ADB", (void *)0)) | |
35257 | printk(KERN_ERR "pmu: can't get irq %d (GPIO1)\n", gpio_irq); | |
35258 | + gpio_irq_enabled = 1; | |
35259 | } | |
35260 | ||
35261 | /* Enable interrupts */ | |
35262 | @@ -489,6 +496,8 @@ | |
35263 | int i; | |
35264 | proc_pmu_info = create_proc_read_entry("info", 0, proc_pmu_root, | |
35265 | proc_get_info, NULL); | |
35266 | + proc_pmu_irqstats = create_proc_read_entry("interrupts", 0, proc_pmu_root, | |
35267 | + proc_get_irqstats, NULL); | |
35268 | #ifdef CONFIG_PMAC_PBOOK | |
35269 | for (i=0; i<pmu_battery_count; i++) { | |
35270 | char title[16]; | |
35271 | @@ -552,15 +561,14 @@ | |
35272 | ||
35273 | /* Read PMU version */ | |
35274 | pmu_request(&req, NULL, 1, PMU_GET_VERSION); | |
35275 | - while (!req.complete) | |
35276 | - pmu_poll(); | |
35277 | + pmu_wait_complete(&req); | |
35278 | if (req.reply_len > 0) | |
35279 | pmu_version = req.reply[0]; | |
35280 | ||
35281 | return 1; | |
35282 | } | |
35283 | ||
35284 | -int __pmac | |
35285 | +int | |
35286 | pmu_get_model(void) | |
35287 | { | |
35288 | return pmu_kind; | |
35289 | @@ -774,6 +782,33 @@ | |
35290 | return p - page; | |
35291 | } | |
35292 | ||
35293 | +static int __pmac | |
35294 | +proc_get_irqstats(char *page, char **start, off_t off, | |
35295 | + int count, int *eof, void *data) | |
35296 | +{ | |
35297 | + int i; | |
35298 | + char* p = page; | |
35299 | + static const char *irq_names[] = { | |
35300 | + "Total CB1 triggered events", | |
35301 | + "Total GPIO1 triggered events", | |
35302 | + "PC-Card eject button", | |
35303 | + "Sound/Brightness button", | |
35304 | + "ADB message", | |
35305 | + "Battery state change", | |
35306 | + "Environment interrupt", | |
35307 | + "Tick timer", | |
35308 | + "Ghost interrupt (zero len)", | |
35309 | + "Empty interrupt (empty mask)", | |
35310 | + "Max irqs in a row" | |
35311 | + }; | |
35312 | + | |
35313 | + for (i=0; i<11; i++) { | |
35314 | + p += sprintf(p, " %2u: %10u (%s)\n", | |
35315 | + i, pmu_irq_stats[i], irq_names[i]); | |
35316 | + } | |
35317 | + return p - page; | |
35318 | +} | |
35319 | + | |
35320 | #ifdef CONFIG_PMAC_PBOOK | |
35321 | static int __pmac | |
35322 | proc_get_batt(char *page, char **start, off_t off, | |
35323 | @@ -982,8 +1017,7 @@ | |
35324 | printk(KERN_ERR "pmu_adb_reset_bus: pmu_queue_request failed\n"); | |
35325 | return -EIO; | |
35326 | } | |
35327 | - while (!req.complete) | |
35328 | - pmu_poll(); | |
35329 | + pmu_wait_complete(&req); | |
35330 | ||
35331 | if (save_autopoll != 0) | |
35332 | pmu_adb_autopoll(save_autopoll); | |
35333 | @@ -1133,6 +1167,12 @@ | |
35334 | wait_for_ack(); | |
35335 | /* set the shift register to shift out and send a byte */ | |
35336 | send_byte(req->data[0]); | |
35337 | +#ifdef CONFIG_XMON | |
35338 | + if (LIVE_DEBUG(req)) | |
35339 | + xmon_printf("R"); | |
35340 | + else | |
35341 | + whacky_debug = 0; | |
35342 | +#endif /* CONFIG_XMON */ | |
35343 | } | |
35344 | ||
35345 | void __openfirmware | |
35346 | @@ -1142,15 +1182,33 @@ | |
35347 | return; | |
35348 | if (disable_poll) | |
35349 | return; | |
35350 | + via_pmu_interrupt(0, 0, 0); | |
35351 | +} | |
35352 | + | |
35353 | +void __openfirmware | |
35354 | +pmu_poll_adb(void) | |
35355 | +{ | |
35356 | + if (!via) | |
35357 | + return; | |
35358 | + if (disable_poll) | |
35359 | + return; | |
35360 | /* Kicks ADB read when PMU is suspended */ | |
35361 | - if (pmu_suspended) | |
35362 | - adb_int_pending = 1; | |
35363 | + adb_int_pending = 1; | |
35364 | do { | |
35365 | via_pmu_interrupt(0, 0, 0); | |
35366 | } while (pmu_suspended && (adb_int_pending || pmu_state != idle | |
35367 | || req_awaiting_reply)); | |
35368 | } | |
35369 | ||
35370 | +void __openfirmware | |
35371 | +pmu_wait_complete(struct adb_request *req) | |
35372 | +{ | |
35373 | + if (!via) | |
35374 | + return; | |
35375 | + while((pmu_state != idle && pmu_state != locked) || !req->complete) | |
35376 | + via_pmu_interrupt(0, 0, 0); | |
35377 | +} | |
35378 | + | |
35379 | /* This function loops until the PMU is idle and prevents it from | |
35380 | * anwsering to ADB interrupts. pmu_request can still be called. | |
35381 | * This is done to avoid spurrious shutdowns when we know we'll have | |
35382 | @@ -1175,6 +1233,8 @@ | |
35383 | ||
35384 | do { | |
35385 | spin_unlock_irqrestore(&pmu_lock, flags); | |
35386 | + if (req_awaiting_reply) | |
35387 | + adb_int_pending = 1; | |
35388 | via_pmu_interrupt(0, 0, 0); | |
35389 | spin_lock_irqsave(&pmu_lock, flags); | |
35390 | if (!adb_int_pending && pmu_state == idle && !req_awaiting_reply) { | |
35391 | @@ -1185,7 +1245,7 @@ | |
35392 | pmu_poll(); | |
35393 | #else /* SUSPEND_USES_PMU */ | |
35394 | if (gpio_irq >= 0) | |
35395 | - disable_irq(gpio_irq); | |
35396 | + disable_irq_nosync(gpio_irq); | |
35397 | out_8(&via[IER], CB1_INT | IER_CLR); | |
35398 | spin_unlock_irqrestore(&pmu_lock, flags); | |
35399 | #endif /* SUSPEND_USES_PMU */ | |
35400 | @@ -1227,16 +1287,47 @@ | |
35401 | static void __pmac | |
35402 | pmu_handle_data(unsigned char *data, int len, struct pt_regs *regs) | |
35403 | { | |
35404 | + unsigned char ints, pirq; | |
35405 | + int i = 0; | |
35406 | + | |
35407 | asleep = 0; | |
35408 | if (drop_interrupts || len < 1) { | |
35409 | adb_int_pending = 0; | |
35410 | + pmu_irq_stats[8]++; | |
35411 | + return; | |
35412 | + } | |
35413 | + | |
35414 | + /* Get PMU interrupt mask */ | |
35415 | + ints = data[0]; | |
35416 | + | |
35417 | + /* Record zero interrupts for stats */ | |
35418 | + if (ints == 0) | |
35419 | + pmu_irq_stats[9]++; | |
35420 | + | |
35421 | + /* Hack to deal with ADB autopoll flag */ | |
35422 | + if (ints & PMU_INT_ADB) | |
35423 | + ints &= ~(PMU_INT_ADB_AUTO | PMU_INT_AUTO_SRQ_POLL); | |
35424 | + | |
35425 | +next: | |
35426 | + | |
35427 | + if (ints == 0) { | |
35428 | + if (i > pmu_irq_stats[10]) | |
35429 | + pmu_irq_stats[10] = i; | |
35430 | return; | |
35431 | } | |
35432 | + | |
35433 | + for (pirq = 0; pirq < 8; pirq++) | |
35434 | + if (ints & (1 << pirq)) | |
35435 | + break; | |
35436 | + pmu_irq_stats[pirq]++; | |
35437 | + i++; | |
35438 | + ints &= ~(1 << pirq); | |
35439 | + | |
35440 | /* Note: for some reason, we get an interrupt with len=1, | |
35441 | * data[0]==0 after each normal ADB interrupt, at least | |
35442 | * on the Pismo. Still investigating... --BenH | |
35443 | */ | |
35444 | - if (data[0] & PMU_INT_ADB) { | |
35445 | + if ((1 << pirq) & PMU_INT_ADB) { | |
35446 | if ((data[0] & PMU_INT_ADB_AUTO) == 0) { | |
35447 | struct adb_request *req = req_awaiting_reply; | |
35448 | if (req == 0) { | |
35449 | @@ -1274,29 +1365,37 @@ | |
35450 | adb_input(data+1, len-1, regs, 1); | |
35451 | #endif /* CONFIG_ADB */ | |
35452 | } | |
35453 | - } else { | |
35454 | - /* Sound/brightness button pressed */ | |
35455 | - if ((data[0] & PMU_INT_SNDBRT) && len == 3) { | |
35456 | + } | |
35457 | + /* Sound/brightness button pressed */ | |
35458 | + else if ((1 << pirq) & PMU_INT_SNDBRT) { | |
35459 | #ifdef CONFIG_PMAC_BACKLIGHT | |
35460 | + if (len == 3) | |
35461 | #ifdef CONFIG_INPUT_ADBHID | |
35462 | if (!disable_kernel_backlight) | |
35463 | #endif /* CONFIG_INPUT_ADBHID */ | |
35464 | set_backlight_level(data[1] >> 4); | |
35465 | #endif /* CONFIG_PMAC_BACKLIGHT */ | |
35466 | - } | |
35467 | + } | |
35468 | + /* Tick interrupt */ | |
35469 | + else if ((1 << pirq) & PMU_INT_TICK) { | |
35470 | #ifdef CONFIG_PMAC_PBOOK | |
35471 | /* Environement or tick interrupt, query batteries */ | |
35472 | - if (pmu_battery_count && (data[0] & PMU_INT_TICK)) { | |
35473 | + if (pmu_battery_count) { | |
35474 | if ((--query_batt_timer) == 0) { | |
35475 | query_battery_state(); | |
35476 | query_batt_timer = BATTERY_POLLING_COUNT; | |
35477 | } | |
35478 | - } else if (pmu_battery_count && (data[0] & PMU_INT_ENVIRONMENT)) | |
35479 | + } | |
35480 | + } | |
35481 | + else if ((1 << pirq) & PMU_INT_ENVIRONMENT) { | |
35482 | + if (pmu_battery_count) | |
35483 | query_battery_state(); | |
35484 | - if (data[0]) | |
35485 | - pmu_pass_intr(data, len); | |
35486 | + pmu_pass_intr(data, len); | |
35487 | + } else { | |
35488 | + pmu_pass_intr(data, len); | |
35489 | #endif /* CONFIG_PMAC_PBOOK */ | |
35490 | } | |
35491 | + goto next; | |
35492 | } | |
35493 | ||
35494 | static struct adb_request* __pmac | |
35495 | @@ -1326,17 +1425,29 @@ | |
35496 | case sending: | |
35497 | req = current_req; | |
35498 | if (data_len < 0) { | |
35499 | +#ifdef CONFIG_XMON | |
35500 | + if (LIVE_DEBUG(req)) | |
35501 | + xmon_printf("s"); | |
35502 | +#endif /* CONFIG_XMON */ | |
35503 | data_len = req->nbytes - 1; | |
35504 | send_byte(data_len); | |
35505 | break; | |
35506 | } | |
35507 | if (data_index <= data_len) { | |
35508 | +#ifdef CONFIG_XMON | |
35509 | + if (LIVE_DEBUG(req)) | |
35510 | + xmon_printf("S"); | |
35511 | +#endif /* CONFIG_XMON */ | |
35512 | send_byte(req->data[data_index++]); | |
35513 | break; | |
35514 | } | |
35515 | req->sent = 1; | |
35516 | data_len = pmu_data_len[req->data[0]][1]; | |
35517 | if (data_len == 0) { | |
35518 | +#ifdef CONFIG_XMON | |
35519 | + if (LIVE_DEBUG(req)) | |
35520 | + xmon_printf("D"); | |
35521 | +#endif /* CONFIG_XMON */ | |
35522 | pmu_state = idle; | |
35523 | current_req = req->next; | |
35524 | if (req->reply_expected) | |
35525 | @@ -1344,6 +1455,10 @@ | |
35526 | else | |
35527 | return req; | |
35528 | } else { | |
35529 | +#ifdef CONFIG_XMON | |
35530 | + if (LIVE_DEBUG(req)) | |
35531 | + xmon_printf("-"); | |
35532 | +#endif /* CONFIG_XMON */ | |
35533 | pmu_state = reading; | |
35534 | data_index = 0; | |
35535 | reply_ptr = req->reply + req->reply_len; | |
35536 | @@ -1357,15 +1472,27 @@ | |
35537 | pmu_state = reading_intr; | |
35538 | reply_ptr = interrupt_data[int_data_last]; | |
35539 | recv_byte(); | |
35540 | + if (gpio_irq >= 0 && !gpio_irq_enabled) { | |
35541 | + enable_irq(gpio_irq); | |
35542 | + gpio_irq_enabled = 1; | |
35543 | + } | |
35544 | break; | |
35545 | ||
35546 | case reading: | |
35547 | case reading_intr: | |
35548 | if (data_len == -1) { | |
35549 | +#ifdef CONFIG_XMON | |
35550 | + if (LIVE_DEBUG(current_req)) | |
35551 | + xmon_printf("r"); | |
35552 | +#endif /* CONFIG_XMON */ | |
35553 | data_len = bite; | |
35554 | if (bite > 32) | |
35555 | printk(KERN_ERR "PMU: bad reply len %d\n", bite); | |
35556 | } else if (data_index < 32) { | |
35557 | +#ifdef CONFIG_XMON | |
35558 | + if (LIVE_DEBUG(current_req)) | |
35559 | + xmon_printf("R"); | |
35560 | +#endif /* CONFIG_XMON */ | |
35561 | reply_ptr[data_index++] = bite; | |
35562 | } | |
35563 | if (data_index < data_len) { | |
35564 | @@ -1373,15 +1500,29 @@ | |
35565 | break; | |
35566 | } | |
35567 | ||
35568 | +#ifdef CONFIG_XMON | |
35569 | + if (LIVE_DEBUG(current_req)) { | |
35570 | + whacky_debug = 1; | |
35571 | + xmon_printf("D"); | |
35572 | + } | |
35573 | +#endif /* CONFIG_XMON */ | |
35574 | if (pmu_state == reading_intr) { | |
35575 | pmu_state = idle; | |
35576 | int_data_state[int_data_last] = int_data_ready; | |
35577 | interrupt_data_len[int_data_last] = data_len; | |
35578 | } else { | |
35579 | req = current_req; | |
35580 | + /* | |
35581 | + * For PMU sleep and freq change requests, we lock the | |
35582 | + * PMU until it's explicitely unlocked. This avoids any | |
35583 | + * spurrious event polling getting in | |
35584 | + */ | |
35585 | current_req = req->next; | |
35586 | req->reply_len += data_index; | |
35587 | - pmu_state = idle; | |
35588 | + if (req->data[0] == PMU_SLEEP || req->data[0] == PMU_CPU_SPEED) | |
35589 | + pmu_state = locked; | |
35590 | + else | |
35591 | + pmu_state = idle; | |
35592 | return req; | |
35593 | } | |
35594 | break; | |
35595 | @@ -1411,6 +1552,10 @@ | |
35596 | intr = in_8(&via[IFR]) & (SR_INT | CB1_INT); | |
35597 | if (intr == 0) | |
35598 | break; | |
35599 | +#ifdef CONFIG_XMON | |
35600 | + if (whacky_debug) | |
35601 | + xmon_printf("|%02x|", intr); | |
35602 | +#endif /* CONFIG_XMON */ | |
35603 | handled = 1; | |
35604 | if (++nloop > 1000) { | |
35605 | printk(KERN_DEBUG "PMU: stuck in intr loop, " | |
35606 | @@ -1419,8 +1564,10 @@ | |
35607 | break; | |
35608 | } | |
35609 | out_8(&via[IFR], intr); | |
35610 | - if (intr & CB1_INT) | |
35611 | + if (intr & CB1_INT) { | |
35612 | adb_int_pending = 1; | |
35613 | + pmu_irq_stats[0]++; | |
35614 | + } | |
35615 | if (intr & SR_INT) { | |
35616 | req = pmu_sr_intr(regs); | |
35617 | if (req) | |
35618 | @@ -1431,6 +1578,10 @@ | |
35619 | recheck: | |
35620 | if (pmu_state == idle) { | |
35621 | if (adb_int_pending) { | |
35622 | +#ifdef CONFIG_XMON | |
35623 | + if (whacky_debug) | |
35624 | + xmon_printf("!A!"); | |
35625 | +#endif /* CONFIG_XMON */ | |
35626 | if (int_data_state[0] == int_data_empty) | |
35627 | int_data_last = 0; | |
35628 | else if (int_data_state[1] == int_data_empty) | |
35629 | @@ -1479,11 +1630,33 @@ | |
35630 | return IRQ_RETVAL(handled); | |
35631 | } | |
35632 | ||
35633 | +void __pmac | |
35634 | +pmu_unlock(void) | |
35635 | +{ | |
35636 | + unsigned long flags; | |
35637 | + | |
35638 | + spin_lock_irqsave(&pmu_lock, flags); | |
35639 | + if (pmu_state == locked) | |
35640 | + pmu_state = idle; | |
35641 | + adb_int_pending = 1; | |
35642 | + spin_unlock_irqrestore(&pmu_lock, flags); | |
35643 | +} | |
35644 | + | |
35645 | + | |
35646 | static irqreturn_t __pmac | |
35647 | gpio1_interrupt(int irq, void *arg, struct pt_regs *regs) | |
35648 | { | |
35649 | + unsigned long flags; | |
35650 | + | |
35651 | if ((in_8(gpio_reg + 0x9) & 0x02) == 0) { | |
35652 | + spin_lock_irqsave(&pmu_lock, flags); | |
35653 | + if (gpio_irq_enabled > 0) { | |
35654 | + disable_irq_nosync(gpio_irq); | |
35655 | + gpio_irq_enabled = 0; | |
35656 | + } | |
35657 | + pmu_irq_stats[1]++; | |
35658 | adb_int_pending = 1; | |
35659 | + spin_unlock_irqrestore(&pmu_lock, flags); | |
35660 | via_pmu_interrupt(0, 0, 0); | |
35661 | return IRQ_HANDLED; | |
35662 | } | |
35663 | @@ -1507,13 +1680,11 @@ | |
35664 | if (on) { | |
35665 | pmu_request(&req, NULL, 2, PMU_BACKLIGHT_BRIGHT, | |
35666 | backlight_to_bright[level]); | |
35667 | - while (!req.complete) | |
35668 | - pmu_poll(); | |
35669 | + pmu_wait_complete(&req); | |
35670 | } | |
35671 | pmu_request(&req, NULL, 2, PMU_POWER_CTRL, | |
35672 | PMU_POW_BACKLIGHT | (on ? PMU_POW_ON : PMU_POW_OFF)); | |
35673 | - while (!req.complete) | |
35674 | - pmu_poll(); | |
35675 | + pmu_wait_complete(&req); | |
35676 | ||
35677 | return 0; | |
35678 | } | |
35679 | @@ -1549,8 +1720,7 @@ | |
35680 | ||
35681 | pmu_request(&req, NULL, 2, PMU_POWER_CTRL, PMU_POW_IRLED | | |
35682 | (on ? PMU_POW_ON : PMU_POW_OFF)); | |
35683 | - while (!req.complete) | |
35684 | - pmu_poll(); | |
35685 | + pmu_wait_complete(&req); | |
35686 | } | |
35687 | ||
35688 | void __pmac | |
35689 | @@ -1570,8 +1740,7 @@ | |
35690 | } | |
35691 | ||
35692 | pmu_request(&req, NULL, 1, PMU_RESET); | |
35693 | - while(!req.complete || (pmu_state != idle)) | |
35694 | - pmu_poll(); | |
35695 | + pmu_wait_complete(&req); | |
35696 | for (;;) | |
35697 | ; | |
35698 | } | |
35699 | @@ -1588,14 +1757,12 @@ | |
35700 | if (pmu_kind != PMU_KEYLARGO_BASED) { | |
35701 | pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, PMU_INT_ADB | | |
35702 | PMU_INT_TICK ); | |
35703 | - while(!req.complete) | |
35704 | - pmu_poll(); | |
35705 | + pmu_wait_complete(&req); | |
35706 | } | |
35707 | ||
35708 | pmu_request(&req, NULL, 5, PMU_SHUTDOWN, | |
35709 | 'M', 'A', 'T', 'T'); | |
35710 | - while(!req.complete || (pmu_state != idle)) | |
35711 | - pmu_poll(); | |
35712 | + pmu_wait_complete(&req); | |
35713 | for (;;) | |
35714 | ; | |
35715 | } | |
35716 | @@ -1606,25 +1773,261 @@ | |
35717 | return via != 0; | |
35718 | } | |
35719 | ||
35720 | -#ifdef CONFIG_PMAC_PBOOK | |
35721 | +struct pmu_i2c_hdr { | |
35722 | + u8 bus; | |
35723 | + u8 mode; | |
35724 | + u8 bus2; | |
35725 | + u8 address; | |
35726 | + u8 sub_addr; | |
35727 | + u8 comb_addr; | |
35728 | + u8 count; | |
35729 | +}; | |
35730 | ||
35731 | -static LIST_HEAD(sleep_notifiers); | |
35732 | +int | |
35733 | +pmu_i2c_combined_read(int bus, int addr, int subaddr, u8* data, int len) | |
35734 | +{ | |
35735 | + struct adb_request req; | |
35736 | + struct pmu_i2c_hdr *hdr = (struct pmu_i2c_hdr *)&req.data[1]; | |
35737 | + int retry; | |
35738 | + int rc; | |
35739 | + | |
35740 | + for (retry=0; retry<16; retry++) { | |
35741 | + memset(&req, 0, sizeof(req)); | |
35742 | + | |
35743 | + hdr->bus = bus; | |
35744 | + hdr->address = addr & 0xfe; | |
35745 | + hdr->mode = PMU_I2C_MODE_COMBINED; | |
35746 | + hdr->bus2 = 0; | |
35747 | + hdr->sub_addr = subaddr; | |
35748 | + hdr->comb_addr = addr | 1; | |
35749 | + hdr->count = len; | |
35750 | + | |
35751 | + req.nbytes = sizeof(struct pmu_i2c_hdr) + 1; | |
35752 | + req.reply_expected = 0; | |
35753 | + req.reply_len = 0; | |
35754 | + req.data[0] = PMU_I2C_CMD; | |
35755 | + req.reply[0] = 0xff; | |
35756 | + rc = pmu_queue_request(&req); | |
35757 | + if (rc) | |
35758 | + return rc; | |
35759 | + while(!req.complete) | |
35760 | + pmu_poll(); | |
35761 | + if (req.reply[0] == PMU_I2C_STATUS_OK) | |
35762 | + break; | |
35763 | + mdelay(15); | |
35764 | + } | |
35765 | + if (req.reply[0] != PMU_I2C_STATUS_OK) | |
35766 | + return -1; | |
35767 | ||
35768 | -#ifdef CONFIG_PM | |
35769 | -static int __pmac | |
35770 | -generic_notify_sleep(struct pmu_sleep_notifier *self, int when) | |
35771 | + for (retry=0; retry<16; retry++) { | |
35772 | + memset(&req, 0, sizeof(req)); | |
35773 | + | |
35774 | + mdelay(15); | |
35775 | + | |
35776 | + hdr->bus = PMU_I2C_BUS_STATUS; | |
35777 | + req.reply[0] = 0xff; | |
35778 | + | |
35779 | + req.nbytes = 2; | |
35780 | + req.reply_expected = 0; | |
35781 | + req.reply_len = 0; | |
35782 | + req.data[0] = PMU_I2C_CMD; | |
35783 | + rc = pmu_queue_request(&req); | |
35784 | + if (rc) | |
35785 | + return rc; | |
35786 | + while(!req.complete) | |
35787 | + pmu_poll(); | |
35788 | + if (req.reply[0] == PMU_I2C_STATUS_DATAREAD) { | |
35789 | + memcpy(data, &req.reply[1], req.reply_len - 1); | |
35790 | + return req.reply_len - 1; | |
35791 | + } | |
35792 | + } | |
35793 | + return -1; | |
35794 | +} | |
35795 | + | |
35796 | +int | |
35797 | +pmu_i2c_stdsub_write(int bus, int addr, int subaddr, u8* data, int len) | |
35798 | +{ | |
35799 | + struct adb_request req; | |
35800 | + struct pmu_i2c_hdr *hdr = (struct pmu_i2c_hdr *)&req.data[1]; | |
35801 | + int retry; | |
35802 | + int rc; | |
35803 | + | |
35804 | + for (retry=0; retry<16; retry++) { | |
35805 | + memset(&req, 0, sizeof(req)); | |
35806 | + | |
35807 | + hdr->bus = bus; | |
35808 | + hdr->address = addr & 0xfe; | |
35809 | + hdr->mode = PMU_I2C_MODE_STDSUB; | |
35810 | + hdr->bus2 = 0; | |
35811 | + hdr->sub_addr = subaddr; | |
35812 | + hdr->comb_addr = addr & 0xfe; | |
35813 | + hdr->count = len; | |
35814 | + | |
35815 | + req.data[0] = PMU_I2C_CMD; | |
35816 | + memcpy(&req.data[sizeof(struct pmu_i2c_hdr) + 1], data, len); | |
35817 | + req.nbytes = sizeof(struct pmu_i2c_hdr) + len + 1; | |
35818 | + req.reply_expected = 0; | |
35819 | + req.reply_len = 0; | |
35820 | + req.reply[0] = 0xff; | |
35821 | + rc = pmu_queue_request(&req); | |
35822 | + if (rc) | |
35823 | + return rc; | |
35824 | + while(!req.complete) | |
35825 | + pmu_poll(); | |
35826 | + if (req.reply[0] == PMU_I2C_STATUS_OK) | |
35827 | + break; | |
35828 | + mdelay(15); | |
35829 | + } | |
35830 | + if (req.reply[0] != PMU_I2C_STATUS_OK) | |
35831 | + return -1; | |
35832 | + | |
35833 | + for (retry=0; retry<16; retry++) { | |
35834 | + memset(&req, 0, sizeof(req)); | |
35835 | + | |
35836 | + mdelay(15); | |
35837 | + | |
35838 | + hdr->bus = PMU_I2C_BUS_STATUS; | |
35839 | + req.reply[0] = 0xff; | |
35840 | + | |
35841 | + req.nbytes = 2; | |
35842 | + req.reply_expected = 0; | |
35843 | + req.reply_len = 0; | |
35844 | + req.data[0] = PMU_I2C_CMD; | |
35845 | + rc = pmu_queue_request(&req); | |
35846 | + if (rc) | |
35847 | + return rc; | |
35848 | + while(!req.complete) | |
35849 | + pmu_poll(); | |
35850 | + if (req.reply[0] == PMU_I2C_STATUS_OK) | |
35851 | + return len; | |
35852 | + } | |
35853 | + return -1; | |
35854 | +} | |
35855 | + | |
35856 | +int | |
35857 | +pmu_i2c_simple_read(int bus, int addr, u8* data, int len) | |
35858 | +{ | |
35859 | + struct adb_request req; | |
35860 | + struct pmu_i2c_hdr *hdr = (struct pmu_i2c_hdr *)&req.data[1]; | |
35861 | + int retry; | |
35862 | + int rc; | |
35863 | + | |
35864 | + for (retry=0; retry<16; retry++) { | |
35865 | + memset(&req, 0, sizeof(req)); | |
35866 | + | |
35867 | + hdr->bus = bus; | |
35868 | + hdr->address = addr | 1; | |
35869 | + hdr->mode = PMU_I2C_MODE_SIMPLE; | |
35870 | + hdr->bus2 = 0; | |
35871 | + hdr->sub_addr = 0; | |
35872 | + hdr->comb_addr = 0; | |
35873 | + hdr->count = len; | |
35874 | + | |
35875 | + req.data[0] = PMU_I2C_CMD; | |
35876 | + req.nbytes = sizeof(struct pmu_i2c_hdr) + 1; | |
35877 | + req.reply_expected = 0; | |
35878 | + req.reply_len = 0; | |
35879 | + req.reply[0] = 0xff; | |
35880 | + rc = pmu_queue_request(&req); | |
35881 | + if (rc) | |
35882 | + return rc; | |
35883 | + while(!req.complete) | |
35884 | + pmu_poll(); | |
35885 | + if (req.reply[0] == PMU_I2C_STATUS_OK) | |
35886 | + break; | |
35887 | + mdelay(15); | |
35888 | + } | |
35889 | + if (req.reply[0] != PMU_I2C_STATUS_OK) | |
35890 | + return -1; | |
35891 | + | |
35892 | + for (retry=0; retry<16; retry++) { | |
35893 | + memset(&req, 0, sizeof(req)); | |
35894 | + | |
35895 | + mdelay(15); | |
35896 | + | |
35897 | + hdr->bus = PMU_I2C_BUS_STATUS; | |
35898 | + req.reply[0] = 0xff; | |
35899 | + | |
35900 | + req.nbytes = 2; | |
35901 | + req.reply_expected = 0; | |
35902 | + req.reply_len = 0; | |
35903 | + req.data[0] = PMU_I2C_CMD; | |
35904 | + rc = pmu_queue_request(&req); | |
35905 | + if (rc) | |
35906 | + return rc; | |
35907 | + while(!req.complete) | |
35908 | + pmu_poll(); | |
35909 | + if (req.reply[0] == PMU_I2C_STATUS_DATAREAD) { | |
35910 | + memcpy(data, &req.reply[1], req.reply_len - 1); | |
35911 | + return req.reply_len - 1; | |
35912 | + } | |
35913 | + } | |
35914 | + return -1; | |
35915 | +} | |
35916 | + | |
35917 | +int | |
35918 | +pmu_i2c_simple_write(int bus, int addr, u8* data, int len) | |
35919 | { | |
35920 | - switch (when) { | |
35921 | - case PBOOK_SLEEP_NOW: | |
35922 | - if (pm_send_all(PM_SUSPEND, (void *)3)) | |
35923 | - return PBOOK_SLEEP_REJECT; | |
35924 | + struct adb_request req; | |
35925 | + struct pmu_i2c_hdr *hdr = (struct pmu_i2c_hdr *)&req.data[1]; | |
35926 | + int retry; | |
35927 | + int rc; | |
35928 | + | |
35929 | + for (retry=0; retry<16; retry++) { | |
35930 | + memset(&req, 0, sizeof(req)); | |
35931 | + | |
35932 | + hdr->bus = bus; | |
35933 | + hdr->address = addr & 0xfe; | |
35934 | + hdr->mode = PMU_I2C_MODE_SIMPLE; | |
35935 | + hdr->bus2 = 0; | |
35936 | + hdr->sub_addr = 0; | |
35937 | + hdr->comb_addr = 0; | |
35938 | + hdr->count = len; | |
35939 | + | |
35940 | + req.data[0] = PMU_I2C_CMD; | |
35941 | + memcpy(&req.data[sizeof(struct pmu_i2c_hdr) + 1], data, len); | |
35942 | + req.nbytes = sizeof(struct pmu_i2c_hdr) + len + 1; | |
35943 | + req.reply_expected = 0; | |
35944 | + req.reply_len = 0; | |
35945 | + req.reply[0] = 0xff; | |
35946 | + rc = pmu_queue_request(&req); | |
35947 | + if (rc) | |
35948 | + return rc; | |
35949 | + while(!req.complete) | |
35950 | + pmu_poll(); | |
35951 | + if (req.reply[0] == PMU_I2C_STATUS_OK) | |
35952 | break; | |
35953 | - case PBOOK_WAKE: | |
35954 | - (void) pm_send_all(PM_RESUME, (void *)0); | |
35955 | + mdelay(15); | |
35956 | + } | |
35957 | + if (req.reply[0] != PMU_I2C_STATUS_OK) | |
35958 | + return -1; | |
35959 | + | |
35960 | + for (retry=0; retry<16; retry++) { | |
35961 | + memset(&req, 0, sizeof(req)); | |
35962 | + | |
35963 | + mdelay(15); | |
35964 | + | |
35965 | + hdr->bus = PMU_I2C_BUS_STATUS; | |
35966 | + req.reply[0] = 0xff; | |
35967 | + | |
35968 | + req.nbytes = 2; | |
35969 | + req.reply_expected = 0; | |
35970 | + req.reply_len = 0; | |
35971 | + req.data[0] = PMU_I2C_CMD; | |
35972 | + rc = pmu_queue_request(&req); | |
35973 | + if (rc) | |
35974 | + return rc; | |
35975 | + while(!req.complete) | |
35976 | + pmu_poll(); | |
35977 | + if (req.reply[0] == PMU_I2C_STATUS_OK) | |
35978 | + return len; | |
35979 | } | |
35980 | - return PBOOK_SLEEP_OK; | |
35981 | + return -1; | |
35982 | } | |
35983 | -#endif /* CONFIG_PM */ | |
35984 | + | |
35985 | +#ifdef CONFIG_PMAC_PBOOK | |
35986 | + | |
35987 | +static LIST_HEAD(sleep_notifiers); | |
35988 | ||
35989 | int | |
35990 | pmu_register_sleep_notifier(struct pmu_sleep_notifier *n) | |
35991 | @@ -1885,90 +2288,166 @@ | |
35992 | } | |
35993 | ||
35994 | extern long sys_sync(void); | |
35995 | +extern void pm_prepare_console(void); | |
35996 | +extern void pm_restore_console(void); | |
35997 | ||
35998 | -#define GRACKLE_PM (1<<7) | |
35999 | -#define GRACKLE_DOZE (1<<5) | |
36000 | -#define GRACKLE_NAP (1<<4) | |
36001 | -#define GRACKLE_SLEEP (1<<3) | |
36002 | - | |
36003 | -int __pmac | |
36004 | -powerbook_sleep_G3(void) | |
36005 | +static int __pmac | |
36006 | +pmac_suspend_devices(void) | |
36007 | { | |
36008 | - unsigned long save_l2cr; | |
36009 | - unsigned short pmcr1; | |
36010 | - struct adb_request req; | |
36011 | int ret; | |
36012 | - struct pci_dev *grackle; | |
36013 | - | |
36014 | - grackle = pci_find_slot(0, 0); | |
36015 | - if (!grackle) | |
36016 | - return -ENODEV; | |
36017 | - | |
36018 | - /* Notify device drivers */ | |
36019 | + | |
36020 | + pm_prepare_console(); | |
36021 | + | |
36022 | + /* Notify old-style device drivers & userland */ | |
36023 | ret = broadcast_sleep(PBOOK_SLEEP_REQUEST, PBOOK_SLEEP_REJECT); | |
36024 | if (ret != PBOOK_SLEEP_OK) { | |
36025 | - printk("pmu: sleep rejected\n"); | |
36026 | + printk(KERN_ERR "Sleep rejected by drivers\n"); | |
36027 | return -EBUSY; | |
36028 | } | |
36029 | ||
36030 | /* Sync the disks. */ | |
36031 | /* XXX It would be nice to have some way to ensure that | |
36032 | - * nobody is dirtying any new buffers while we wait. | |
36033 | - * BenH: Moved to _after_ sleep request and changed video | |
36034 | - * drivers to vmalloc() during sleep request. This way, all | |
36035 | - * vmalloc's are done before actual sleep of block drivers */ | |
36036 | + * nobody is dirtying any new buffers while we wait. That | |
36037 | + * could be acheived using the refrigerator for processes | |
36038 | + * that swsusp uses | |
36039 | + */ | |
36040 | sys_sync(); | |
36041 | ||
36042 | /* Sleep can fail now. May not be very robust but useful for debugging */ | |
36043 | ret = broadcast_sleep(PBOOK_SLEEP_NOW, PBOOK_WAKE); | |
36044 | if (ret != PBOOK_SLEEP_OK) { | |
36045 | - printk("pmu: sleep failed\n"); | |
36046 | + printk(KERN_ERR "Driver sleep failed\n"); | |
36047 | return -EBUSY; | |
36048 | } | |
36049 | ||
36050 | - /* Wait for completion of async backlight requests */ | |
36051 | - while (!bright_req_1.complete || !bright_req_2.complete || | |
36052 | - !bright_req_3.complete || !batt_req.complete) | |
36053 | - pmu_poll(); | |
36054 | + /* Send suspend call to devices, hold the device core's dpm_sem */ | |
36055 | + ret = device_suspend(PM_SUSPEND_MEM); | |
36056 | + if (ret) { | |
36057 | + printk(KERN_ERR "Driver sleep failed\n"); | |
36058 | + broadcast_wake(); | |
36059 | + return -EBUSY; | |
36060 | + } | |
36061 | ||
36062 | - /* Turn off various things. Darwin does some retry tests here... */ | |
36063 | - pmu_request(&req, NULL, 2, PMU_POWER_CTRL0, PMU_POW0_OFF|PMU_POW0_HARD_DRIVE); | |
36064 | - while (!req.complete) | |
36065 | - pmu_poll(); | |
36066 | - pmu_request(&req, NULL, 2, PMU_POWER_CTRL, | |
36067 | - PMU_POW_OFF|PMU_POW_BACKLIGHT|PMU_POW_IRLED|PMU_POW_MEDIABAY); | |
36068 | - while (!req.complete) | |
36069 | - pmu_poll(); | |
36070 | - | |
36071 | - /* Disable all interrupts */ | |
36072 | - pmac_sleep_save_intrs(-1); | |
36073 | - | |
36074 | - /* Make sure the PMU is idle */ | |
36075 | - while (pmu_state != idle) | |
36076 | - pmu_poll(); | |
36077 | - | |
36078 | /* Make sure the decrementer won't interrupt us */ | |
36079 | asm volatile("mtdec %0" : : "r" (0x7fffffff)); | |
36080 | /* Make sure any pending DEC interrupt occurring while we did | |
36081 | * the above didn't re-enable the DEC */ | |
36082 | mb(); | |
36083 | asm volatile("mtdec %0" : : "r" (0x7fffffff)); | |
36084 | - | |
36085 | - /* We can now disable MSR_EE */ | |
36086 | + | |
36087 | + /* We can now disable MSR_EE. This code of course works properly only | |
36088 | + * on UP machines... For SMP, if we ever implement sleep, we'll have to | |
36089 | + * stop the "other" CPUs way before we do all that stuff. | |
36090 | + */ | |
36091 | local_irq_disable(); | |
36092 | ||
36093 | - /* Giveup the FPU */ | |
36094 | + /* Broadcast power down irq | |
36095 | + * This isn't that useful in most cases (only directly wired devices can | |
36096 | + * use this but still... This will take care of sysdev's as well, so | |
36097 | + * we exit from here with local irqs disabled and PIC off. | |
36098 | + */ | |
36099 | + ret = device_power_down(PM_SUSPEND_MEM); | |
36100 | + if (ret) { | |
36101 | + wakeup_decrementer(); | |
36102 | + local_irq_enable(); | |
36103 | + device_resume(); | |
36104 | + broadcast_wake(); | |
36105 | + printk(KERN_ERR "Driver powerdown failed\n"); | |
36106 | + return -EBUSY; | |
36107 | + } | |
36108 | + | |
36109 | + /* Wait for completion of async backlight requests */ | |
36110 | + while (!bright_req_1.complete || !bright_req_2.complete || | |
36111 | + !bright_req_3.complete || !batt_req.complete) | |
36112 | + pmu_poll(); | |
36113 | + | |
36114 | + /* Giveup the lazy FPU & vec so we don't have to back them | |
36115 | + * up from the low level code | |
36116 | + */ | |
36117 | enable_kernel_fp(); | |
36118 | ||
36119 | +#ifdef CONFIG_ALTIVEC | |
36120 | + if (cur_cpu_spec[0]->cpu_features & CPU_FTR_ALTIVEC) | |
36121 | + enable_kernel_altivec(); | |
36122 | +#endif /* CONFIG_ALTIVEC */ | |
36123 | + | |
36124 | + return 0; | |
36125 | +} | |
36126 | + | |
36127 | +static int __pmac | |
36128 | +pmac_wakeup_devices(void) | |
36129 | +{ | |
36130 | + mdelay(100); | |
36131 | + | |
36132 | + /* Power back up system devices (including the PIC) */ | |
36133 | + device_power_up(); | |
36134 | + | |
36135 | + pmu_blink(1); | |
36136 | + | |
36137 | + /* Force a poll of ADB interrupts */ | |
36138 | + adb_int_pending = 1; | |
36139 | + via_pmu_interrupt(0, 0, 0); | |
36140 | + | |
36141 | + /* Restart jiffies & scheduling */ | |
36142 | + wakeup_decrementer(); | |
36143 | + | |
36144 | + /* Re-enable local CPU interrupts */ | |
36145 | + local_irq_enable(); | |
36146 | + | |
36147 | + pmu_blink(1); | |
36148 | + | |
36149 | + /* Resume devices */ | |
36150 | + device_resume(); | |
36151 | + | |
36152 | + /* Notify old style drivers */ | |
36153 | + broadcast_wake(); | |
36154 | + | |
36155 | + pm_restore_console(); | |
36156 | + | |
36157 | + return 0; | |
36158 | +} | |
36159 | + | |
36160 | +#define GRACKLE_PM (1<<7) | |
36161 | +#define GRACKLE_DOZE (1<<5) | |
36162 | +#define GRACKLE_NAP (1<<4) | |
36163 | +#define GRACKLE_SLEEP (1<<3) | |
36164 | + | |
36165 | +int __pmac | |
36166 | +powerbook_sleep_grackle(void) | |
36167 | +{ | |
36168 | + unsigned long save_l2cr; | |
36169 | + unsigned short pmcr1; | |
36170 | + struct adb_request req; | |
36171 | + int ret; | |
36172 | + struct pci_dev *grackle; | |
36173 | + | |
36174 | + grackle = pci_find_slot(0, 0); | |
36175 | + if (!grackle) | |
36176 | + return -ENODEV; | |
36177 | + | |
36178 | + ret = pmac_suspend_devices(); | |
36179 | + if (ret) { | |
36180 | + printk(KERN_ERR "Sleep rejected by devices\n"); | |
36181 | + return ret; | |
36182 | + } | |
36183 | + | |
36184 | + /* Turn off various things. Darwin does some retry tests here... */ | |
36185 | + pmu_request(&req, NULL, 2, PMU_POWER_CTRL0, PMU_POW0_OFF|PMU_POW0_HARD_DRIVE); | |
36186 | + pmu_wait_complete(&req); | |
36187 | + pmu_request(&req, NULL, 2, PMU_POWER_CTRL, | |
36188 | + PMU_POW_OFF|PMU_POW_BACKLIGHT|PMU_POW_IRLED|PMU_POW_MEDIABAY); | |
36189 | + pmu_wait_complete(&req); | |
36190 | + | |
36191 | /* For 750, save backside cache setting and disable it */ | |
36192 | save_l2cr = _get_L2CR(); /* (returns -1 if not available) */ | |
36193 | if (save_l2cr != 0xffffffff && (save_l2cr & L2CR_L2E) != 0) | |
36194 | _set_L2CR(save_l2cr & 0x7fffffff); | |
36195 | ||
36196 | - /* Ask the PMU to put us to sleep */ | |
36197 | - pmu_request(&req, NULL, 5, PMU_SLEEP, 'M', 'A', 'T', 'T'); | |
36198 | - while (!req.complete) | |
36199 | - pmu_poll(); | |
36200 | + if (!__fake_sleep) { | |
36201 | + /* Ask the PMU to put us to sleep */ | |
36202 | + pmu_request(&req, NULL, 5, PMU_SLEEP, 'M', 'A', 'T', 'T'); | |
36203 | + pmu_wait_complete(&req); | |
36204 | + } | |
36205 | ||
36206 | /* The VIA is supposed not to be restored correctly*/ | |
36207 | save_via_state(); | |
36208 | @@ -1982,7 +2461,10 @@ | |
36209 | pci_write_config_word(grackle, 0x70, pmcr1); | |
36210 | ||
36211 | /* Call low-level ASM sleep handler */ | |
36212 | - low_sleep_handler(); | |
36213 | + if (__fake_sleep) | |
36214 | + mdelay(5000); | |
36215 | + else | |
36216 | + low_sleep_handler(); | |
36217 | ||
36218 | /* We're awake again, stop grackle PM */ | |
36219 | pci_read_config_word(grackle, 0x70, &pmcr1); | |
36220 | @@ -2001,36 +2483,17 @@ | |
36221 | set_context(current->active_mm->context, current->active_mm->pgd); | |
36222 | ||
36223 | /* Power things up */ | |
36224 | - pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0xfc); | |
36225 | - while (!req.complete) | |
36226 | - pmu_poll(); | |
36227 | + pmu_unlock(); | |
36228 | + pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask); | |
36229 | + pmu_wait_complete(&req); | |
36230 | pmu_request(&req, NULL, 2, PMU_POWER_CTRL0, | |
36231 | PMU_POW0_ON|PMU_POW0_HARD_DRIVE); | |
36232 | - while (!req.complete) | |
36233 | - pmu_poll(); | |
36234 | + pmu_wait_complete(&req); | |
36235 | pmu_request(&req, NULL, 2, PMU_POWER_CTRL, | |
36236 | PMU_POW_ON|PMU_POW_BACKLIGHT|PMU_POW_CHARGER|PMU_POW_IRLED|PMU_POW_MEDIABAY); | |
36237 | - while (!req.complete) | |
36238 | - pmu_poll(); | |
36239 | - | |
36240 | - /* reenable interrupt controller */ | |
36241 | - pmac_sleep_restore_intrs(); | |
36242 | + pmu_wait_complete(&req); | |
36243 | ||
36244 | - /* Leave some time for HW to settle down */ | |
36245 | - mdelay(100); | |
36246 | - | |
36247 | - /* Restart jiffies & scheduling */ | |
36248 | - wakeup_decrementer(); | |
36249 | - | |
36250 | - /* Force a poll of ADB interrupts */ | |
36251 | - adb_int_pending = 1; | |
36252 | - via_pmu_interrupt(0, 0, 0); | |
36253 | - | |
36254 | - /* Re-enable local CPU interrupts */ | |
36255 | - local_irq_enable(); | |
36256 | - | |
36257 | - /* Notify drivers */ | |
36258 | - broadcast_wake(); | |
36259 | + pmac_wakeup_devices(); | |
36260 | ||
36261 | return 0; | |
36262 | } | |
36263 | @@ -2048,68 +2511,20 @@ | |
36264 | return -ENOSYS; | |
36265 | } | |
36266 | ||
36267 | - /* Notify device drivers */ | |
36268 | - ret = broadcast_sleep(PBOOK_SLEEP_REQUEST, PBOOK_SLEEP_REJECT); | |
36269 | - if (ret != PBOOK_SLEEP_OK) { | |
36270 | - printk("pmu: sleep rejected\n"); | |
36271 | - return -EBUSY; | |
36272 | - } | |
36273 | - | |
36274 | - /* Sync the disks. */ | |
36275 | - /* XXX It would be nice to have some way to ensure that | |
36276 | - * nobody is dirtying any new buffers while we wait. | |
36277 | - * BenH: Moved to _after_ sleep request and changed video | |
36278 | - * drivers to vmalloc() during sleep request. This way, all | |
36279 | - * vmalloc's are done before actual sleep of block drivers */ | |
36280 | - sys_sync(); | |
36281 | - | |
36282 | - /* Sleep can fail now. May not be very robust but useful for debugging */ | |
36283 | - ret = broadcast_sleep(PBOOK_SLEEP_NOW, PBOOK_WAKE); | |
36284 | - if (ret != PBOOK_SLEEP_OK) { | |
36285 | - printk("pmu: sleep failed\n"); | |
36286 | - return -EBUSY; | |
36287 | + ret = pmac_suspend_devices(); | |
36288 | + if (ret) { | |
36289 | + printk(KERN_ERR "Sleep rejected by devices\n"); | |
36290 | + return ret; | |
36291 | } | |
36292 | - /* Wait for completion of async backlight requests */ | |
36293 | - while (!bright_req_1.complete || !bright_req_2.complete || | |
36294 | - !bright_req_3.complete || !batt_req.complete) | |
36295 | - pmu_poll(); | |
36296 | - | |
36297 | + | |
36298 | /* Tell PMU what events will wake us up */ | |
36299 | pmu_request(&req, NULL, 4, PMU_POWER_EVENTS, PMU_PWR_CLR_WAKEUP_EVENTS, | |
36300 | 0xff, 0xff); | |
36301 | - while (!req.complete) | |
36302 | - pmu_poll(); | |
36303 | - | |
36304 | + pmu_wait_complete(&req); | |
36305 | pmu_request(&req, NULL, 4, PMU_POWER_EVENTS, PMU_PWR_SET_WAKEUP_EVENTS, | |
36306 | 0, PMU_PWR_WAKEUP_KEY | | |
36307 | (option_lid_wakeup ? PMU_PWR_WAKEUP_LID_OPEN : 0)); | |
36308 | - while (!req.complete) | |
36309 | - pmu_poll(); | |
36310 | - | |
36311 | - /* Save & disable all interrupts */ | |
36312 | - openpic_sleep_save_intrs(); | |
36313 | - | |
36314 | - /* Make sure the PMU is idle */ | |
36315 | - while (pmu_state != idle) | |
36316 | - pmu_poll(); | |
36317 | - | |
36318 | - /* Make sure the decrementer won't interrupt us */ | |
36319 | - asm volatile("mtdec %0" : : "r" (0x7fffffff)); | |
36320 | - /* Make sure any pending DEC interrupt occurring while we did | |
36321 | - * the above didn't re-enable the DEC */ | |
36322 | - mb(); | |
36323 | - asm volatile("mtdec %0" : : "r" (0x7fffffff)); | |
36324 | - | |
36325 | - /* We can now disable MSR_EE */ | |
36326 | - local_irq_disable(); | |
36327 | - | |
36328 | - /* Giveup the FPU & vec */ | |
36329 | - enable_kernel_fp(); | |
36330 | - | |
36331 | -#ifdef CONFIG_ALTIVEC | |
36332 | - if (cur_cpu_spec[0]->cpu_features & CPU_FTR_ALTIVEC) | |
36333 | - enable_kernel_altivec(); | |
36334 | -#endif /* CONFIG_ALTIVEC */ | |
36335 | + pmu_wait_complete(&req); | |
36336 | ||
36337 | /* Save & disable L2 and L3 caches*/ | |
36338 | save_l3cr = _get_L3CR(); /* (returns -1 if not available) */ | |
36339 | @@ -2125,13 +2540,9 @@ | |
36340 | if (!__fake_sleep) { | |
36341 | /* Ask the PMU to put us to sleep */ | |
36342 | pmu_request(&req, NULL, 5, PMU_SLEEP, 'M', 'A', 'T', 'T'); | |
36343 | - while (!req.complete && pmu_state != idle) | |
36344 | - pmu_poll(); | |
36345 | + pmu_wait_complete(&req); | |
36346 | } | |
36347 | ||
36348 | - out_8(&via[B], in_8(&via[B]) | TREQ); | |
36349 | - wait_for_ack(); | |
36350 | - | |
36351 | /* The VIA is supposed not to be restored correctly*/ | |
36352 | save_via_state(); | |
36353 | ||
36354 | @@ -2161,8 +2572,6 @@ | |
36355 | /* Don't restore PCI for now, it crashes. Maybe unnecessary on pbook */ | |
36356 | //pbook_pci_restore(); | |
36357 | ||
36358 | - pmu_blink(2); | |
36359 | - | |
36360 | /* Restore L2 cache */ | |
36361 | if (save_l2cr != 0xffffffff && (save_l2cr & L2CR_L2E) != 0) | |
36362 | _set_L2CR(save_l2cr); | |
36363 | @@ -2174,31 +2583,15 @@ | |
36364 | set_context(current->active_mm->context, current->active_mm->pgd); | |
36365 | ||
36366 | /* Tell PMU we are ready */ | |
36367 | + pmu_unlock(); | |
36368 | pmu_request(&req, NULL, 2, PMU_SYSTEM_READY, 2); | |
36369 | - while (!req.complete) | |
36370 | - pmu_poll(); | |
36371 | - pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0xfc); | |
36372 | - while (!req.complete) | |
36373 | - pmu_poll(); | |
36374 | - | |
36375 | - /* reenable interrupt controller */ | |
36376 | - openpic_sleep_restore_intrs(); | |
36377 | - | |
36378 | - /* Leave some time for HW to settle down */ | |
36379 | - mdelay(100); | |
36380 | - | |
36381 | - /* Restart jiffies & scheduling */ | |
36382 | - wakeup_decrementer(); | |
36383 | + pmu_wait_complete(&req); | |
36384 | + pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask); | |
36385 | + pmu_wait_complete(&req); | |
36386 | ||
36387 | - /* Force a poll of ADB interrupts */ | |
36388 | - adb_int_pending = 1; | |
36389 | - via_pmu_interrupt(0, 0, 0); | |
36390 | + pmu_blink(1); | |
36391 | ||
36392 | - /* Re-enable local CPU interrupts */ | |
36393 | - local_irq_enable(); | |
36394 | - | |
36395 | - /* Notify drivers */ | |
36396 | - broadcast_wake(); | |
36397 | + pmac_wakeup_devices(); | |
36398 | ||
36399 | return 0; | |
36400 | } | |
36401 | @@ -2227,45 +2620,13 @@ | |
36402 | /* Allocate room for PCI save */ | |
36403 | pbook_alloc_pci_save(); | |
36404 | ||
36405 | - /* Notify device drivers */ | |
36406 | - ret = broadcast_sleep(PBOOK_SLEEP_REQUEST, PBOOK_SLEEP_REJECT); | |
36407 | - if (ret != PBOOK_SLEEP_OK) { | |
36408 | - pbook_free_pci_save(); | |
36409 | - printk("pmu: sleep rejected\n"); | |
36410 | - return -EBUSY; | |
36411 | - } | |
36412 | - | |
36413 | - /* Sync the disks. */ | |
36414 | - /* XXX It would be nice to have some way to ensure that | |
36415 | - * nobody is dirtying any new buffers while we wait. | |
36416 | - * BenH: Moved to _after_ sleep request and changed video | |
36417 | - * drivers to vmalloc() during sleep request. This way, all | |
36418 | - * vmalloc's are done before actual sleep of block drivers */ | |
36419 | - sys_sync(); | |
36420 | - | |
36421 | - /* Sleep can fail now. May not be very robust but useful for debugging */ | |
36422 | - ret = broadcast_sleep(PBOOK_SLEEP_NOW, PBOOK_WAKE); | |
36423 | - if (ret != PBOOK_SLEEP_OK) { | |
36424 | - printk("pmu: sleep failed\n"); | |
36425 | + ret = pmac_suspend_devices(); | |
36426 | + if (ret) { | |
36427 | pbook_free_pci_save(); | |
36428 | - return -EBUSY; | |
36429 | + printk(KERN_ERR "Sleep rejected by devices\n"); | |
36430 | + return ret; | |
36431 | } | |
36432 | ||
36433 | - /* Wait for completion of async backlight requests */ | |
36434 | - while (!bright_req_1.complete || !bright_req_2.complete || | |
36435 | - !bright_req_3.complete || !batt_req.complete) | |
36436 | - pmu_poll(); | |
36437 | - | |
36438 | - /* Disable all interrupts except pmu */ | |
36439 | - pmac_sleep_save_intrs(vias->intrs[0].line); | |
36440 | - | |
36441 | - /* Make sure the decrementer won't interrupt us */ | |
36442 | - asm volatile("mtdec %0" : : "r" (0x7fffffff)); | |
36443 | - /* Make sure any pending DEC interrupt occurring while we did | |
36444 | - * the above didn't re-enable the DEC */ | |
36445 | - mb(); | |
36446 | - asm volatile("mtdec %0" : : "r" (0x7fffffff)); | |
36447 | - | |
36448 | /* Save the state of PCI config space for some slots */ | |
36449 | pbook_pci_save(); | |
36450 | ||
36451 | @@ -2303,25 +2664,13 @@ | |
36452 | out_be32(mem_ctrl_sleep, 0x3f); | |
36453 | pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,0); | |
36454 | pbook_pci_restore(); | |
36455 | + pmu_unlock(); | |
36456 | ||
36457 | /* wait for the PMU interrupt sequence to complete */ | |
36458 | while (asleep) | |
36459 | mb(); | |
36460 | ||
36461 | - /* reenable interrupts */ | |
36462 | - pmac_sleep_restore_intrs(); | |
36463 | - | |
36464 | - /* Leave some time for HW to settle down */ | |
36465 | - mdelay(100); | |
36466 | - | |
36467 | - /* Restart jiffies & scheduling */ | |
36468 | - wakeup_decrementer(); | |
36469 | - | |
36470 | - /* Re-enable local CPU interrupts */ | |
36471 | - local_irq_enable(); | |
36472 | - | |
36473 | - /* Notify drivers */ | |
36474 | - broadcast_wake(); | |
36475 | + pmac_wakeup_devices(); | |
36476 | ||
36477 | pbook_free_pci_save(); | |
36478 | iounmap(mem_ctrl); | |
36479 | @@ -2524,7 +2873,7 @@ | |
36480 | break; | |
36481 | case PMU_HEATHROW_BASED: | |
36482 | case PMU_PADDINGTON_BASED: | |
36483 | - error = powerbook_sleep_G3(); | |
36484 | + error = powerbook_sleep_grackle(); | |
36485 | break; | |
36486 | case PMU_KEYLARGO_BASED: | |
36487 | error = powerbook_sleep_Core99(); | |
36488 | @@ -2676,8 +3025,15 @@ | |
36489 | ||
36490 | EXPORT_SYMBOL(pmu_request); | |
36491 | EXPORT_SYMBOL(pmu_poll); | |
36492 | +EXPORT_SYMBOL(pmu_poll_adb); | |
36493 | +EXPORT_SYMBOL(pmu_wait_complete); | |
36494 | EXPORT_SYMBOL(pmu_suspend); | |
36495 | EXPORT_SYMBOL(pmu_resume); | |
36496 | +EXPORT_SYMBOL(pmu_unlock); | |
36497 | +EXPORT_SYMBOL(pmu_i2c_combined_read); | |
36498 | +EXPORT_SYMBOL(pmu_i2c_stdsub_write); | |
36499 | +EXPORT_SYMBOL(pmu_i2c_simple_read); | |
36500 | +EXPORT_SYMBOL(pmu_i2c_simple_write); | |
36501 | #ifdef CONFIG_PMAC_PBOOK | |
36502 | EXPORT_SYMBOL(pmu_register_sleep_notifier); | |
36503 | EXPORT_SYMBOL(pmu_unregister_sleep_notifier); | |
36504 | diff -Nru a/drivers/md/md.c b/drivers/md/md.c | |
36505 | --- a/drivers/md/md.c Thu Aug 7 02:25:25 2003 | |
36506 | +++ b/drivers/md/md.c Tue Aug 26 09:25:41 2003 | |
36507 | @@ -179,7 +179,6 @@ | |
36508 | mddev_map[mdidx(mddev)] = NULL; | |
36509 | blk_put_queue(mddev->queue); | |
36510 | kfree(mddev); | |
36511 | - MOD_DEC_USE_COUNT; | |
36512 | } | |
36513 | spin_unlock(&all_mddevs_lock); | |
36514 | } | |
36515 | @@ -201,7 +200,6 @@ | |
36516 | mddev_map[unit] = new; | |
36517 | list_add(&new->all_mddevs, &all_mddevs); | |
36518 | spin_unlock(&all_mddevs_lock); | |
36519 | - MOD_INC_USE_COUNT; | |
36520 | return new; | |
36521 | } | |
36522 | spin_unlock(&all_mddevs_lock); | |
36523 | @@ -640,14 +638,13 @@ | |
36524 | /* make rdev->sb match mddev data.. | |
36525 | * | |
36526 | * 1/ zero out disks | |
36527 | - * 2/ Add info for each disk, keeping track of highest desc_nr | |
36528 | - * 3/ any empty disks < highest become removed | |
36529 | + * 2/ Add info for each disk, keeping track of highest desc_nr (next_spare); | |
36530 | + * 3/ any empty disks < next_spare become removed | |
36531 | * | |
36532 | * disks[0] gets initialised to REMOVED because | |
36533 | * we cannot be sure from other fields if it has | |
36534 | * been initialised or not. | |
36535 | */ | |
36536 | - int highest = 0; | |
36537 | int i; | |
36538 | int active=0, working=0,failed=0,spare=0,nr_disks=0; | |
36539 | ||
36540 | @@ -718,17 +715,17 @@ | |
36541 | spare++; | |
36542 | working++; | |
36543 | } | |
36544 | - if (rdev2->desc_nr > highest) | |
36545 | - highest = rdev2->desc_nr; | |
36546 | } | |
36547 | ||
36548 | - /* now set the "removed" bit on any non-trailing holes */ | |
36549 | - for (i=0; i<highest; i++) { | |
36550 | + /* now set the "removed" and "faulty" bits on any missing devices */ | |
36551 | + for (i=0 ; i < mddev->raid_disks ; i++) { | |
36552 | mdp_disk_t *d = &sb->disks[i]; | |
36553 | if (d->state == 0 && d->number == 0) { | |
36554 | d->number = i; | |
36555 | d->raid_disk = i; | |
36556 | d->state = (1<<MD_DISK_REMOVED); | |
36557 | + d->state |= (1<<MD_DISK_FAULTY); | |
36558 | + failed++; | |
36559 | } | |
36560 | } | |
36561 | sb->nr_disks = nr_disks; | |
36562 | @@ -1612,12 +1609,6 @@ | |
36563 | spin_unlock(&pers_lock); | |
36564 | ||
36565 | blk_queue_make_request(mddev->queue, mddev->pers->make_request); | |
36566 | - printk("%s: setting max_sectors to %d, segment boundary to %d\n", | |
36567 | - disk->disk_name, | |
36568 | - chunk_size >> 9, | |
36569 | - (chunk_size>>1)-1); | |
36570 | - blk_queue_max_sectors(mddev->queue, chunk_size >> 9); | |
36571 | - blk_queue_segment_boundary(mddev->queue, (chunk_size>>1) - 1); | |
36572 | mddev->queue->queuedata = mddev; | |
36573 | ||
36574 | err = mddev->pers->run(mddev); | |
36575 | @@ -2366,17 +2357,14 @@ | |
36576 | unsigned int cmd, unsigned long arg) | |
36577 | { | |
36578 | char b[BDEVNAME_SIZE]; | |
36579 | - unsigned int minor; | |
36580 | + unsigned int minor = iminor(inode); | |
36581 | int err = 0; | |
36582 | struct hd_geometry *loc = (struct hd_geometry *) arg; | |
36583 | mddev_t *mddev = NULL; | |
36584 | - kdev_t dev; | |
36585 | ||
36586 | if (!capable(CAP_SYS_ADMIN)) | |
36587 | return -EACCES; | |
36588 | ||
36589 | - dev = inode->i_rdev; | |
36590 | - minor = minor(dev); | |
36591 | if (minor >= MAX_MD_DEVS) { | |
36592 | MD_BUG(); | |
36593 | return -EINVAL; | |
36594 | @@ -2615,7 +2603,7 @@ | |
36595 | /* | |
36596 | * Succeed if we can find or allocate a mddev structure. | |
36597 | */ | |
36598 | - mddev_t *mddev = mddev_find(minor(inode->i_rdev)); | |
36599 | + mddev_t *mddev = mddev_find(iminor(inode)); | |
36600 | int err = -ENOMEM; | |
36601 | ||
36602 | if (!mddev) | |
36603 | @@ -3590,6 +3578,7 @@ | |
36604 | if (!disks[i]) | |
36605 | continue; | |
36606 | mddev = disk->private_data; | |
36607 | + export_array(mddev); | |
36608 | del_gendisk(disk); | |
36609 | put_disk(disk); | |
36610 | mddev_put(mddev); | |
36611 | diff -Nru a/drivers/md/raid0.c b/drivers/md/raid0.c | |
36612 | --- a/drivers/md/raid0.c Thu Aug 14 18:16:17 2003 | |
36613 | +++ b/drivers/md/raid0.c Sat Aug 23 15:07:18 2003 | |
36614 | @@ -231,6 +231,13 @@ | |
36615 | mdk_rdev_t *rdev; | |
36616 | struct list_head *tmp; | |
36617 | ||
36618 | + printk("md%d: setting max_sectors to %d, segment boundary to %d\n", | |
36619 | + mdidx(mddev), | |
36620 | + mddev->chunk_size >> 9, | |
36621 | + (mddev->chunk_size>>1)-1); | |
36622 | + blk_queue_max_sectors(mddev->queue, mddev->chunk_size >> 9); | |
36623 | + blk_queue_segment_boundary(mddev->queue, (mddev->chunk_size>>1) - 1); | |
36624 | + | |
36625 | conf = kmalloc(sizeof (raid0_conf_t), GFP_KERNEL); | |
36626 | if (!conf) | |
36627 | goto out; | |
36628 | diff -Nru a/drivers/md/raid5.c b/drivers/md/raid5.c | |
36629 | --- a/drivers/md/raid5.c Sun Aug 10 16:01:44 2003 | |
36630 | +++ b/drivers/md/raid5.c Sat Aug 23 15:07:16 2003 | |
36631 | @@ -1326,7 +1326,7 @@ | |
36632 | (unsigned long long)new_sector, | |
36633 | (unsigned long long)logical_sector); | |
36634 | ||
36635 | - sh = get_active_stripe(conf, new_sector, pd_idx, 0/*(bi->bi_rw&RWA_MASK)*/); | |
36636 | + sh = get_active_stripe(conf, new_sector, pd_idx, (bi->bi_rw&RWA_MASK)); | |
36637 | if (sh) { | |
36638 | ||
36639 | add_stripe_bio(sh, bi, dd_idx, (bi->bi_rw&RW_MASK)); | |
36640 | @@ -1334,7 +1334,12 @@ | |
36641 | raid5_plug_device(conf); | |
36642 | handle_stripe(sh); | |
36643 | release_stripe(sh); | |
36644 | + } else { | |
36645 | + /* cannot get stripe for read-ahead, just give-up */ | |
36646 | + clear_bit(BIO_UPTODATE, &bi->bi_flags); | |
36647 | + break; | |
36648 | } | |
36649 | + | |
36650 | } | |
36651 | spin_lock_irq(&conf->device_lock); | |
36652 | if (--bi->bi_phys_segments == 0) { | |
36653 | diff -Nru a/drivers/md/xor.c b/drivers/md/xor.c | |
36654 | --- a/drivers/md/xor.c Wed Jul 24 08:36:02 2002 | |
36655 | +++ b/drivers/md/xor.c Sat Aug 23 15:07:12 2003 | |
36656 | @@ -134,7 +134,10 @@ | |
36657 | return 0; | |
36658 | } | |
36659 | ||
36660 | +static __exit void xor_exit(void) { } | |
36661 | + | |
36662 | EXPORT_SYMBOL(xor_block); | |
36663 | MODULE_LICENSE("GPL"); | |
36664 | ||
36665 | module_init(calibrate_xor_block); | |
36666 | +module_exit(xor_exit); | |
36667 | diff -Nru a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c | |
36668 | --- a/drivers/media/common/saa7146_fops.c Mon Jul 7 04:28:54 2003 | |
36669 | +++ b/drivers/media/common/saa7146_fops.c Tue Aug 26 09:25:41 2003 | |
36670 | @@ -157,7 +157,7 @@ | |
36671 | ||
36672 | static int fops_open(struct inode *inode, struct file *file) | |
36673 | { | |
36674 | - unsigned int minor = minor(inode->i_rdev); | |
36675 | + unsigned int minor = iminor(inode); | |
36676 | struct saa7146_dev *h = NULL, *dev = NULL; | |
36677 | struct list_head *list; | |
36678 | struct saa7146_fh *fh = NULL; | |
36679 | diff -Nru a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c | |
36680 | --- a/drivers/media/common/saa7146_video.c Thu Jul 31 16:47:19 2003 | |
36681 | +++ b/drivers/media/common/saa7146_video.c Sun Aug 31 16:14:08 2003 | |
36682 | @@ -359,41 +359,41 @@ | |
36683 | ||
36684 | static struct v4l2_queryctrl controls[] = { | |
36685 | { | |
36686 | - id: V4L2_CID_BRIGHTNESS, | |
36687 | - name: "Brightness", | |
36688 | - minimum: 0, | |
36689 | - maximum: 255, | |
36690 | - step: 1, | |
36691 | - default_value: 128, | |
36692 | - type: V4L2_CTRL_TYPE_INTEGER, | |
36693 | + .id = V4L2_CID_BRIGHTNESS, | |
36694 | + .name = "Brightness", | |
36695 | + .minimum = 0, | |
36696 | + .maximum = 255, | |
36697 | + .step = 1, | |
36698 | + .default_value = 128, | |
36699 | + .type = V4L2_CTRL_TYPE_INTEGER, | |
36700 | },{ | |
36701 | - id: V4L2_CID_CONTRAST, | |
36702 | - name: "Contrast", | |
36703 | - minimum: 0, | |
36704 | - maximum: 127, | |
36705 | - step: 1, | |
36706 | - default_value: 64, | |
36707 | - type: V4L2_CTRL_TYPE_INTEGER, | |
36708 | + .id = V4L2_CID_CONTRAST, | |
36709 | + .name = "Contrast", | |
36710 | + .minimum = 0, | |
36711 | + .maximum = 127, | |
36712 | + .step = 1, | |
36713 | + .default_value = 64, | |
36714 | + .type = V4L2_CTRL_TYPE_INTEGER, | |
36715 | },{ | |
36716 | - id: V4L2_CID_SATURATION, | |
36717 | - name: "Saturation", | |
36718 | - minimum: 0, | |
36719 | - maximum: 127, | |
36720 | - step: 1, | |
36721 | - default_value: 64, | |
36722 | - type: V4L2_CTRL_TYPE_INTEGER, | |
36723 | + .id = V4L2_CID_SATURATION, | |
36724 | + .name = "Saturation", | |
36725 | + .minimum = 0, | |
36726 | + .maximum = 127, | |
36727 | + .step = 1, | |
36728 | + .default_value = 64, | |
36729 | + .type = V4L2_CTRL_TYPE_INTEGER, | |
36730 | },{ | |
36731 | - id: V4L2_CID_VFLIP, | |
36732 | - name: "Vertical flip", | |
36733 | - minimum: 0, | |
36734 | - maximum: 1, | |
36735 | - type: V4L2_CTRL_TYPE_BOOLEAN, | |
36736 | + .id = V4L2_CID_VFLIP, | |
36737 | + .name = "Vertical flip", | |
36738 | + .minimum = 0, | |
36739 | + .maximum = 1, | |
36740 | + .type = V4L2_CTRL_TYPE_BOOLEAN, | |
36741 | },{ | |
36742 | - id: V4L2_CID_HFLIP, | |
36743 | - name: "Horizontal flip", | |
36744 | - minimum: 0, | |
36745 | - maximum: 1, | |
36746 | - type: V4L2_CTRL_TYPE_BOOLEAN, | |
36747 | + .id = V4L2_CID_HFLIP, | |
36748 | + .name = "Horizontal flip", | |
36749 | + .minimum = 0, | |
36750 | + .maximum = 1, | |
36751 | + .type = V4L2_CTRL_TYPE_BOOLEAN, | |
36752 | }, | |
36753 | }; | |
36754 | static int NUM_CONTROLS = sizeof(controls)/sizeof(struct v4l2_queryctrl); | |
36755 | diff -Nru a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c | |
36756 | --- a/drivers/media/dvb/dvb-core/dvbdev.c Tue Aug 12 13:25:49 2003 | |
36757 | +++ b/drivers/media/dvb/dvb-core/dvbdev.c Tue Aug 26 09:25:41 2003 | |
36758 | @@ -73,7 +73,7 @@ | |
36759 | { | |
36760 | struct dvb_device *dvbdev; | |
36761 | ||
36762 | - dvbdev = dvbdev_find_device (minor(inode->i_rdev)); | |
36763 | + dvbdev = dvbdev_find_device (iminor(inode)); | |
36764 | ||
36765 | if (dvbdev && dvbdev->fops) { | |
36766 | int err = 0; | |
36767 | diff -Nru a/drivers/media/dvb/frontends/grundig_29504-401.c b/drivers/media/dvb/frontends/grundig_29504-401.c | |
36768 | --- a/drivers/media/dvb/frontends/grundig_29504-401.c Wed Jun 18 05:03:14 2003 | |
36769 | +++ b/drivers/media/dvb/frontends/grundig_29504-401.c Sun Aug 31 16:14:08 2003 | |
36770 | @@ -37,15 +37,15 @@ | |
36771 | ||
36772 | ||
36773 | struct dvb_frontend_info grundig_29504_401_info = { | |
36774 | - name: "Grundig 29504-401", | |
36775 | - type: FE_OFDM, | |
36776 | -/* frequency_min: ???,*/ | |
36777 | -/* frequency_max: ???,*/ | |
36778 | - frequency_stepsize: 166666, | |
36779 | -/* frequency_tolerance: ???,*/ | |
36780 | -/* symbol_rate_tolerance: ???,*/ | |
36781 | - notifier_delay: 0, | |
36782 | - caps: FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | | |
36783 | + .name = "Grundig 29504-401", | |
36784 | + .type = FE_OFDM, | |
36785 | +/* .frequency_min = ???,*/ | |
36786 | +/* .frequency_max = ???,*/ | |
36787 | + .frequency_stepsize = 166666, | |
36788 | +/* .frequency_tolerance = ???,*/ | |
36789 | +/* .symbol_rate_tolerance = ???,*/ | |
36790 | + .notifier_delay = 0, | |
36791 | + .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | | |
36792 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | | |
36793 | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | | |
36794 | FE_CAN_MUTE_TS /*| FE_CAN_CLEAN_SETUP*/ | |
36795 | diff -Nru a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c | |
36796 | --- a/drivers/media/dvb/frontends/ves1820.c Thu Jun 19 23:48:36 2003 | |
36797 | +++ b/drivers/media/dvb/frontends/ves1820.c Sun Aug 31 16:14:08 2003 | |
36798 | @@ -81,9 +81,9 @@ | |
36799 | .symbol_rate_min = (XIN/2)/64, /* SACLK/64 == (XIN/2)/64 */ | |
36800 | .symbol_rate_max = (XIN/2)/4, /* SACLK/4 */ | |
36801 | #if 0 | |
36802 | - frequency_tolerance: ???, | |
36803 | - symbol_rate_tolerance: ???, /* ppm */ /* == 8% (spec p. 5) */ | |
36804 | - notifier_delay: ?, | |
36805 | + .frequency_tolerance = ???, | |
36806 | + .symbol_rate_tolerance = ???, /* ppm */ /* == 8% (spec p. 5) */ | |
36807 | + .notifier_delay = ?, | |
36808 | #endif | |
36809 | .caps = FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 | | |
36810 | FE_CAN_QAM_128 | FE_CAN_QAM_256 | | |
36811 | diff -Nru a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | |
36812 | --- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c Mon Aug 11 07:56:25 2003 | |
36813 | +++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c Sat Aug 23 12:49:46 2003 | |
36814 | @@ -1249,7 +1249,7 @@ | |
36815 | if ((err = usb_register(&ttusb_driver)) < 0) { | |
36816 | printk("%s: usb_register failed! Error number %d", | |
36817 | __FILE__, err); | |
36818 | - return -1; | |
36819 | + return err; | |
36820 | } | |
36821 | ||
36822 | return 0; | |
36823 | diff -Nru a/drivers/media/dvb/ttusb-dec/dec2000_frontend.c b/drivers/media/dvb/ttusb-dec/dec2000_frontend.c | |
36824 | --- a/drivers/media/dvb/ttusb-dec/dec2000_frontend.c Mon Jul 14 02:56:39 2003 | |
36825 | +++ b/drivers/media/dvb/ttusb-dec/dec2000_frontend.c Sun Aug 31 16:14:08 2003 | |
36826 | @@ -30,12 +30,12 @@ | |
36827 | #define dprintk if (debug) printk | |
36828 | ||
36829 | static struct dvb_frontend_info dec2000_frontend_info = { | |
36830 | - name: "TechnoTrend/Hauppauge DEC-2000-t Frontend", | |
36831 | - type: FE_OFDM, | |
36832 | - frequency_min: 51000000, | |
36833 | - frequency_max: 858000000, | |
36834 | - frequency_stepsize: 62500, | |
36835 | - caps: FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | | |
36836 | + .name = "TechnoTrend/Hauppauge DEC-2000-t Frontend", | |
36837 | + .type = FE_OFDM, | |
36838 | + .frequency_min = 51000000, | |
36839 | + .frequency_max = 858000000, | |
36840 | + .frequency_stepsize = 62500, | |
36841 | + .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | | |
36842 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | | |
36843 | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | | |
36844 | FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO | | |
36845 | diff -Nru a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c | |
36846 | --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c Sat Aug 9 06:43:04 2003 | |
36847 | +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c Sun Aug 31 16:14:08 2003 | |
36848 | @@ -1003,10 +1003,10 @@ | |
36849 | }; | |
36850 | ||
36851 | static struct usb_driver ttusb_dec_driver = { | |
36852 | - name: DRIVER_NAME, | |
36853 | - probe: ttusb_dec_probe, | |
36854 | - disconnect: ttusb_dec_disconnect, | |
36855 | - id_table: ttusb_dec_table, | |
36856 | + .name = DRIVER_NAME, | |
36857 | + .probe = ttusb_dec_probe, | |
36858 | + .disconnect = ttusb_dec_disconnect, | |
36859 | + .id_table = ttusb_dec_table, | |
36860 | }; | |
36861 | ||
36862 | static int __init ttusb_dec_init(void) | |
36863 | diff -Nru a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig | |
36864 | --- a/drivers/media/video/Kconfig Thu Aug 21 09:02:59 2003 | |
36865 | +++ b/drivers/media/video/Kconfig Sun Aug 24 01:26:51 2003 | |
36866 | @@ -201,7 +201,7 @@ | |
36867 | ||
36868 | config VIDEO_ZR36120 | |
36869 | tristate "Zoran ZR36120/36125 Video For Linux" | |
36870 | - depends on VIDEO_DEV && PCI && I2C | |
36871 | + depends on VIDEO_DEV && PCI && I2C && BROKEN | |
36872 | help | |
36873 | Support for ZR36120/ZR36125 based frame grabber/overlay boards. | |
36874 | This includes the Victor II, WaveWatcher, Video Wonder, Maxi-TV, | |
36875 | diff -Nru a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c | |
36876 | --- a/drivers/media/video/adv7170.c Wed Aug 20 15:29:21 2003 | |
36877 | +++ b/drivers/media/video/adv7170.c Sun Aug 31 16:14:05 2003 | |
36878 | @@ -104,6 +104,7 @@ | |
36879 | u8 value) | |
36880 | { | |
36881 | struct adv7170 *encoder = i2c_get_clientdata(client); | |
36882 | + | |
36883 | encoder->reg[reg] = value; | |
36884 | return i2c_smbus_write_byte_data(client, reg, value); | |
36885 | } | |
36886 | @@ -130,6 +131,7 @@ | |
36887 | struct adv7170 *encoder = i2c_get_clientdata(client); | |
36888 | struct i2c_msg msg; | |
36889 | u8 block_data[32]; | |
36890 | + | |
36891 | msg.addr = client->addr; | |
36892 | msg.flags = client->flags; | |
36893 | while (len >= 2) { | |
36894 | @@ -143,16 +145,16 @@ | |
36895 | data += 2; | |
36896 | } while (len >= 2 && data[0] == reg && | |
36897 | msg.len < 32); | |
36898 | - if ((ret = | |
36899 | - i2c_transfer(client->adapter, &msg, 1)) < 0) | |
36900 | + if ((ret = i2c_transfer(client->adapter, | |
36901 | + &msg, 1)) < 0) | |
36902 | break; | |
36903 | } | |
36904 | } else { | |
36905 | /* do some slow I2C emulation kind of thing */ | |
36906 | while (len >= 2) { | |
36907 | reg = *data++; | |
36908 | - if ((ret = | |
36909 | - adv7170_write(client, reg, *data++)) < 0) | |
36910 | + if ((ret = adv7170_write(client, reg, | |
36911 | + *data++)) < 0) | |
36912 | break; | |
36913 | len -= 2; | |
36914 | } | |
36915 | @@ -442,6 +444,7 @@ | |
36916 | dname = adv7171_name; | |
36917 | } else { | |
36918 | /* We should never get here!!! */ | |
36919 | + kfree(client); | |
36920 | return 0; | |
36921 | } | |
36922 | snprintf(I2C_NAME(client), sizeof(I2C_NAME(client)) - 1, | |
36923 | @@ -449,6 +452,7 @@ | |
36924 | ||
36925 | encoder = kmalloc(sizeof(struct adv7170), GFP_KERNEL); | |
36926 | if (encoder == NULL) { | |
36927 | + kfree(client); | |
36928 | return -ENOMEM; | |
36929 | } | |
36930 | memset(encoder, 0, sizeof(struct adv7170)); | |
36931 | diff -Nru a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c | |
36932 | --- a/drivers/media/video/adv7175.c Wed Aug 20 15:29:21 2003 | |
36933 | +++ b/drivers/media/video/adv7175.c Sun Aug 31 16:14:05 2003 | |
36934 | @@ -100,6 +100,7 @@ | |
36935 | u8 value) | |
36936 | { | |
36937 | struct adv7175 *encoder = i2c_get_clientdata(client); | |
36938 | + | |
36939 | encoder->reg[reg] = value; | |
36940 | return i2c_smbus_write_byte_data(client, reg, value); | |
36941 | } | |
36942 | @@ -126,6 +127,7 @@ | |
36943 | struct adv7175 *encoder = i2c_get_clientdata(client); | |
36944 | struct i2c_msg msg; | |
36945 | u8 block_data[32]; | |
36946 | + | |
36947 | msg.addr = client->addr; | |
36948 | msg.flags = client->flags; | |
36949 | while (len >= 2) { | |
36950 | @@ -139,16 +141,16 @@ | |
36951 | data += 2; | |
36952 | } while (len >= 2 && data[0] == reg && | |
36953 | msg.len < 32); | |
36954 | - if ((ret = | |
36955 | - i2c_transfer(client->adapter, &msg, 1)) < 0) | |
36956 | + if ((ret = i2c_transfer(client->adapter, | |
36957 | + &msg, 1)) < 0) | |
36958 | break; | |
36959 | } | |
36960 | } else { | |
36961 | /* do some slow I2C emulation kind of thing */ | |
36962 | while (len >= 2) { | |
36963 | reg = *data++; | |
36964 | - if ((ret = | |
36965 | - adv7175_write(client, reg, *data++)) < 0) | |
36966 | + if ((ret = adv7175_write(client, reg, | |
36967 | + *data++)) < 0) | |
36968 | break; | |
36969 | len -= 2; | |
36970 | } | |
36971 | @@ -163,6 +165,7 @@ | |
36972 | { | |
36973 | struct adv7175 *encoder = i2c_get_clientdata(client); | |
36974 | int i, j; | |
36975 | + | |
36976 | printk(KERN_INFO "%s: registry dump\n", I2C_NAME(client)); | |
36977 | for (i = 0; i < 182 / 8; i++) { | |
36978 | printk("%s: 0x%02x -", I2C_NAME(client), i * 8); | |
36979 | @@ -463,6 +466,7 @@ | |
36980 | dname = adv7176_name; | |
36981 | } else { | |
36982 | /* We should never get here!!! */ | |
36983 | + kfree(client); | |
36984 | return 0; | |
36985 | } | |
36986 | snprintf(I2C_NAME(client), sizeof(I2C_NAME(client)) - 1, | |
36987 | @@ -470,6 +474,7 @@ | |
36988 | ||
36989 | encoder = kmalloc(sizeof(struct adv7175), GFP_KERNEL); | |
36990 | if (encoder == NULL) { | |
36991 | + kfree(client); | |
36992 | return -ENOMEM; | |
36993 | } | |
36994 | memset(encoder, 0, sizeof(struct adv7175)); | |
36995 | diff -Nru a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c | |
36996 | --- a/drivers/media/video/bt819.c Wed Aug 20 15:29:21 2003 | |
36997 | +++ b/drivers/media/video/bt819.c Sun Aug 31 16:14:05 2003 | |
36998 | @@ -113,6 +113,7 @@ | |
36999 | u8 value) | |
37000 | { | |
37001 | struct bt819 *decoder = i2c_get_clientdata(client); | |
37002 | + | |
37003 | decoder->reg[reg] = value; | |
37004 | return i2c_smbus_write_byte_data(client, reg, value); | |
37005 | } | |
37006 | @@ -124,6 +125,7 @@ | |
37007 | u8 value) | |
37008 | { | |
37009 | struct bt819 *decoder = i2c_get_clientdata(client); | |
37010 | + | |
37011 | return bt819_write(client, reg, | |
37012 | (decoder-> | |
37013 | reg[reg] & ~(1 << bit)) | | |
37014 | @@ -145,6 +147,7 @@ | |
37015 | struct bt819 *decoder = i2c_get_clientdata(client); | |
37016 | struct i2c_msg msg; | |
37017 | u8 block_data[32]; | |
37018 | + | |
37019 | msg.addr = client->addr; | |
37020 | msg.flags = client->flags; | |
37021 | while (len >= 2) { | |
37022 | @@ -158,8 +161,8 @@ | |
37023 | data += 2; | |
37024 | } while (len >= 2 && data[0] == reg && | |
37025 | msg.len < 32); | |
37026 | - if ((ret = | |
37027 | - i2c_transfer(client->adapter, &msg, 1)) < 0) | |
37028 | + if ((ret = i2c_transfer(client->adapter, | |
37029 | + &msg, 1)) < 0) | |
37030 | break; | |
37031 | } | |
37032 | } else { | |
37033 | diff -Nru a/drivers/media/video/bt856.c b/drivers/media/video/bt856.c | |
37034 | --- a/drivers/media/video/bt856.c Wed Aug 20 15:29:21 2003 | |
37035 | +++ b/drivers/media/video/bt856.c Sun Aug 31 16:14:05 2003 | |
37036 | @@ -98,6 +98,7 @@ | |
37037 | u8 value) | |
37038 | { | |
37039 | struct bt856 *encoder = i2c_get_clientdata(client); | |
37040 | + | |
37041 | encoder->reg[reg - REG_OFFSET] = value; | |
37042 | return i2c_smbus_write_byte_data(client, reg, value); | |
37043 | } | |
37044 | @@ -109,6 +110,7 @@ | |
37045 | u8 value) | |
37046 | { | |
37047 | struct bt856 *encoder = i2c_get_clientdata(client); | |
37048 | + | |
37049 | return bt856_write(client, reg, | |
37050 | (encoder-> | |
37051 | reg[reg - REG_OFFSET] & ~(1 << bit)) | | |
37052 | @@ -120,6 +122,7 @@ | |
37053 | { | |
37054 | int i; | |
37055 | struct bt856 *encoder = i2c_get_clientdata(client); | |
37056 | + | |
37057 | printk(KERN_INFO "%s: register dump:", I2C_NAME(client)); | |
37058 | for (i = 0xd6; i <= 0xde; i += 2) | |
37059 | printk(" %02x", encoder->reg[i - REG_OFFSET]); | |
37060 | @@ -341,6 +344,7 @@ | |
37061 | ||
37062 | encoder = kmalloc(sizeof(struct bt856), GFP_KERNEL); | |
37063 | if (encoder == NULL) { | |
37064 | + kfree(client); | |
37065 | return -ENOMEM; | |
37066 | } | |
37067 | memset(encoder, 0, sizeof(struct bt856)); | |
37068 | diff -Nru a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c | |
37069 | --- a/drivers/media/video/bttv-driver.c Thu Aug 7 14:20:17 2003 | |
37070 | +++ b/drivers/media/video/bttv-driver.c Wed Sep 3 23:40:14 2003 | |
37071 | @@ -115,6 +115,7 @@ | |
37072 | MODULE_DESCRIPTION("bttv - v4l/v4l2 driver module for bt848/878 based cards"); | |
37073 | MODULE_AUTHOR("Ralph Metzler & Marcus Metzler & Gerd Knorr"); | |
37074 | MODULE_LICENSE("GPL"); | |
37075 | +MODULE_ALIAS_CHARDEV_MAJOR(VIDEO_MAJOR); | |
37076 | ||
37077 | /* kernel args */ | |
37078 | #ifndef MODULE | |
37079 | @@ -2758,7 +2759,7 @@ | |
37080 | ||
37081 | static int bttv_open(struct inode *inode, struct file *file) | |
37082 | { | |
37083 | - int minor = minor(inode->i_rdev); | |
37084 | + int minor = iminor(inode); | |
37085 | struct bttv *btv = NULL; | |
37086 | struct bttv_fh *fh; | |
37087 | enum v4l2_buf_type type = 0; | |
37088 | @@ -2894,7 +2895,7 @@ | |
37089 | ||
37090 | static int radio_open(struct inode *inode, struct file *file) | |
37091 | { | |
37092 | - int minor = minor(inode->i_rdev); | |
37093 | + int minor = iminor(inode); | |
37094 | struct bttv *btv = NULL; | |
37095 | u32 v = 400*16; | |
37096 | unsigned int i; | |
37097 | diff -Nru a/drivers/media/video/meye.c b/drivers/media/video/meye.c | |
37098 | --- a/drivers/media/video/meye.c Thu Jul 31 08:59:04 2003 | |
37099 | +++ b/drivers/media/video/meye.c Wed Aug 27 04:24:51 2003 | |
37100 | @@ -920,7 +920,7 @@ | |
37101 | ||
37102 | case VIDIOCGCAP: { | |
37103 | struct video_capability *b = arg; | |
37104 | - strcpy(b->name,meye.video_dev.name); | |
37105 | + strcpy(b->name,meye.video_dev->name); | |
37106 | b->type = VID_TYPE_CAPTURE; | |
37107 | b->channels = 1; | |
37108 | b->audios = 0; | |
37109 | @@ -1225,6 +1225,8 @@ | |
37110 | .type = VID_TYPE_CAPTURE, | |
37111 | .hardware = VID_HARDWARE_MEYE, | |
37112 | .fops = &meye_fops, | |
37113 | + .release = video_device_release, | |
37114 | + .minor = -1, | |
37115 | }; | |
37116 | ||
37117 | #ifdef CONFIG_PM | |
37118 | @@ -1275,10 +1277,17 @@ | |
37119 | goto out1; | |
37120 | } | |
37121 | ||
37122 | - sonypi_camera_command(SONYPI_COMMAND_SETCAMERA, 1); | |
37123 | - | |
37124 | meye.mchip_dev = pcidev; | |
37125 | - memcpy(&meye.video_dev, &meye_template, sizeof(meye_template)); | |
37126 | + meye.video_dev = video_device_alloc(); | |
37127 | + if (!meye.video_dev) { | |
37128 | + printk(KERN_ERR "meye: video_device_alloc() failed!\n"); | |
37129 | + ret = -EBUSY; | |
37130 | + goto out1; | |
37131 | + } | |
37132 | + memcpy(meye.video_dev, &meye_template, sizeof(meye_template)); | |
37133 | + meye.video_dev->dev = &meye.mchip_dev->dev; | |
37134 | + | |
37135 | + sonypi_camera_command(SONYPI_COMMAND_SETCAMERA, 1); | |
37136 | ||
37137 | if ((ret = pci_enable_device(meye.mchip_dev))) { | |
37138 | printk(KERN_ERR "meye: pci_enable_device failed\n"); | |
37139 | @@ -1335,7 +1344,7 @@ | |
37140 | wait_ms(1); | |
37141 | mchip_set(MCHIP_MM_INTA, MCHIP_MM_INTA_HIC_1_MASK); | |
37142 | ||
37143 | - if (video_register_device(&meye.video_dev, VFL_TYPE_GRABBER, video_nr) < 0) { | |
37144 | + if (video_register_device(meye.video_dev, VFL_TYPE_GRABBER, video_nr) < 0) { | |
37145 | ||
37146 | printk(KERN_ERR "meye: video_register_device failed\n"); | |
37147 | ret = -EIO; | |
37148 | @@ -1383,6 +1392,9 @@ | |
37149 | out3: | |
37150 | pci_disable_device(meye.mchip_dev); | |
37151 | out2: | |
37152 | + video_device_release(meye.video_dev); | |
37153 | + meye.video_dev = NULL; | |
37154 | + | |
37155 | sonypi_camera_command(SONYPI_COMMAND_SETCAMERA, 0); | |
37156 | out1: | |
37157 | return ret; | |
37158 | @@ -1390,7 +1402,7 @@ | |
37159 | ||
37160 | static void __devexit meye_remove(struct pci_dev *pcidev) { | |
37161 | ||
37162 | - video_unregister_device(&meye.video_dev); | |
37163 | + video_unregister_device(meye.video_dev); | |
37164 | ||
37165 | mchip_hic_stop(); | |
37166 | ||
37167 | diff -Nru a/drivers/media/video/meye.h b/drivers/media/video/meye.h | |
37168 | --- a/drivers/media/video/meye.h Wed Apr 16 03:01:38 2003 | |
37169 | +++ b/drivers/media/video/meye.h Tue Aug 26 09:48:06 2003 | |
37170 | @@ -312,7 +312,7 @@ | |
37171 | ||
37172 | struct meye_queue grabq; /* queue for buffers to be grabbed */ | |
37173 | ||
37174 | - struct video_device video_dev; /* video device parameters */ | |
37175 | + struct video_device *video_dev; /* video device parameters */ | |
37176 | struct video_picture picture; /* video picture parameters */ | |
37177 | struct meye_params params; /* additional parameters */ | |
37178 | #ifdef CONFIG_PM | |
37179 | diff -Nru a/drivers/media/video/planb.c b/drivers/media/video/planb.c | |
37180 | --- a/drivers/media/video/planb.c Tue Aug 12 13:24:31 2003 | |
37181 | +++ b/drivers/media/video/planb.c Mon Sep 1 08:41:30 2003 | |
37182 | @@ -2158,6 +2158,7 @@ | |
37183 | unsigned int old_base, new_base; | |
37184 | unsigned int irq; | |
37185 | struct pci_dev *pdev; | |
37186 | + int rc; | |
37187 | ||
37188 | if (_machine != _MACH_Pmac) | |
37189 | return 0; | |
37190 | @@ -2211,18 +2212,25 @@ | |
37191 | ||
37192 | pdev = pci_find_slot (bus, dev_fn); | |
37193 | if (!pdev) { | |
37194 | - printk(KERN_ERR "cannot find slot\n"); | |
37195 | - /* XXX handle error */ | |
37196 | + printk(KERN_ERR "planb: cannot find slot\n"); | |
37197 | + goto err_out; | |
37198 | } | |
37199 | ||
37200 | /* Enable response in memory space, bus mastering, | |
37201 | use memory write and invalidate */ | |
37202 | - pci_write_config_word (pdev, PCI_COMMAND, | |
37203 | - PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | | |
37204 | - PCI_COMMAND_INVALIDATE); | |
37205 | - /* Set PCI Cache line size & latency timer */ | |
37206 | - pci_write_config_byte (pdev, PCI_CACHE_LINE_SIZE, 0x8); | |
37207 | - pci_write_config_byte (pdev, PCI_LATENCY_TIMER, 0x40); | |
37208 | + rc = pci_enable_device(pdev); | |
37209 | + if (rc) { | |
37210 | + printk(KERN_ERR "planb: cannot enable PCI device %s\n", | |
37211 | + pci_name(pdev)); | |
37212 | + goto err_out; | |
37213 | + } | |
37214 | + rc = pci_set_mwi(pdev); | |
37215 | + if (rc) { | |
37216 | + printk(KERN_ERR "planb: cannot enable MWI on PCI device %s\n", | |
37217 | + pci_name(pdev)); | |
37218 | + goto err_out_disable; | |
37219 | + } | |
37220 | + pci_set_master(pdev); | |
37221 | ||
37222 | /* Set the new base address */ | |
37223 | pci_write_config_dword (pdev, confreg, new_base); | |
37224 | @@ -2234,6 +2242,12 @@ | |
37225 | pb->irq = irq; | |
37226 | ||
37227 | return planb_num; | |
37228 | + | |
37229 | +err_out_disable: | |
37230 | + pci_disable_device(pdev); | |
37231 | +err_out: | |
37232 | + /* FIXME handle error */ /* comment moved from pci_find_slot, above */ | |
37233 | + return 0; | |
37234 | } | |
37235 | ||
37236 | static void release_planb(void) | |
37237 | diff -Nru a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c | |
37238 | --- a/drivers/media/video/saa7110.c Wed Aug 20 15:29:21 2003 | |
37239 | +++ b/drivers/media/video/saa7110.c Sun Aug 31 16:14:05 2003 | |
37240 | @@ -86,6 +86,7 @@ | |
37241 | u8 value) | |
37242 | { | |
37243 | struct saa7110 *decoder = i2c_get_clientdata(client); | |
37244 | + | |
37245 | decoder->reg[reg] = value; | |
37246 | return i2c_smbus_write_byte_data(client, reg, value); | |
37247 | } | |
37248 | @@ -97,6 +98,7 @@ | |
37249 | { | |
37250 | int ret = -1; | |
37251 | u8 reg = *data++; | |
37252 | + | |
37253 | len--; | |
37254 | ||
37255 | /* the saa7110 has an autoincrement function, use it if | |
37256 | @@ -105,6 +107,7 @@ | |
37257 | struct saa7110 *decoder = i2c_get_clientdata(client); | |
37258 | struct i2c_msg msg; | |
37259 | u8 block_data[54]; | |
37260 | + | |
37261 | msg.len = 0; | |
37262 | msg.buf = (char *) block_data; | |
37263 | msg.addr = client->addr; | |
37264 | @@ -119,8 +122,8 @@ | |
37265 | } | |
37266 | } else { | |
37267 | while (len-- >= 1) { | |
37268 | - if ((ret = | |
37269 | - saa7110_write(client, reg++, *data++)) < 0) | |
37270 | + if ((ret = saa7110_write(client, reg++, | |
37271 | + *data++)) < 0) | |
37272 | break; | |
37273 | } | |
37274 | } | |
37275 | @@ -279,6 +282,7 @@ | |
37276 | case DECODER_GET_CAPABILITIES: | |
37277 | { | |
37278 | struct video_decoder_capability *dc = arg; | |
37279 | + | |
37280 | dc->flags = | |
37281 | VIDEO_DECODER_PAL | VIDEO_DECODER_NTSC | | |
37282 | VIDEO_DECODER_SECAM | VIDEO_DECODER_AUTO; | |
37283 | diff -Nru a/drivers/media/video/saa7111.c b/drivers/media/video/saa7111.c | |
37284 | --- a/drivers/media/video/saa7111.c Thu Aug 21 10:13:46 2003 | |
37285 | +++ b/drivers/media/video/saa7111.c Sun Aug 31 16:14:05 2003 | |
37286 | @@ -93,6 +93,7 @@ | |
37287 | u8 value) | |
37288 | { | |
37289 | struct saa7111 *decoder = i2c_get_clientdata(client); | |
37290 | + | |
37291 | decoder->reg[reg] = value; | |
37292 | return i2c_smbus_write_byte_data(client, reg, value); | |
37293 | } | |
37294 | @@ -112,6 +113,7 @@ | |
37295 | struct saa7111 *decoder = i2c_get_clientdata(client); | |
37296 | struct i2c_msg msg; | |
37297 | u8 block_data[32]; | |
37298 | + | |
37299 | msg.addr = client->addr; | |
37300 | msg.flags = client->flags; | |
37301 | while (len >= 2) { | |
37302 | @@ -125,16 +127,16 @@ | |
37303 | data += 2; | |
37304 | } while (len >= 2 && data[0] == reg && | |
37305 | msg.len < 32); | |
37306 | - if ((ret = | |
37307 | - i2c_transfer(client->adapter, &msg, 1)) < 0) | |
37308 | + if ((ret = i2c_transfer(client->adapter, | |
37309 | + &msg, 1)) < 0) | |
37310 | break; | |
37311 | } | |
37312 | } else { | |
37313 | /* do some slow I2C emulation kind of thing */ | |
37314 | while (len >= 2) { | |
37315 | reg = *data++; | |
37316 | - if ((ret = | |
37317 | - saa7111_write(client, reg, *data++)) < 0) | |
37318 | + if ((ret = saa7111_write(client, reg, | |
37319 | + *data++)) < 0) | |
37320 | break; | |
37321 | len -= 2; | |
37322 | } | |
37323 | diff -Nru a/drivers/media/video/saa7114.c b/drivers/media/video/saa7114.c | |
37324 | --- a/drivers/media/video/saa7114.c Wed Aug 20 15:29:21 2003 | |
37325 | +++ b/drivers/media/video/saa7114.c Sun Aug 31 16:14:05 2003 | |
37326 | @@ -144,6 +144,7 @@ | |
37327 | u8 value) | |
37328 | { | |
37329 | /*struct saa7114 *decoder = i2c_get_clientdata(client);*/ | |
37330 | + | |
37331 | /*decoder->reg[reg] = value;*/ | |
37332 | return i2c_smbus_write_byte_data(client, reg, value); | |
37333 | } | |
37334 | @@ -163,6 +164,7 @@ | |
37335 | /*struct saa7114 *decoder = i2c_get_clientdata(client);*/ | |
37336 | struct i2c_msg msg; | |
37337 | u8 block_data[32]; | |
37338 | + | |
37339 | msg.addr = client->addr; | |
37340 | msg.flags = client->flags; | |
37341 | while (len >= 2) { | |
37342 | @@ -176,16 +178,16 @@ | |
37343 | data += 2; | |
37344 | } while (len >= 2 && data[0] == reg && | |
37345 | msg.len < 32); | |
37346 | - if ((ret = | |
37347 | - i2c_transfer(client->adapter, &msg, 1)) < 0) | |
37348 | + if ((ret = i2c_transfer(client->adapter, | |
37349 | + &msg, 1)) < 0) | |
37350 | break; | |
37351 | } | |
37352 | } else { | |
37353 | /* do some slow I2C emulation kind of thing */ | |
37354 | while (len >= 2) { | |
37355 | reg = *data++; | |
37356 | - if ((ret = | |
37357 | - saa7114_write(client, reg, *data++)) < 0) | |
37358 | + if ((ret = saa7114_write(client, reg, | |
37359 | + *data++)) < 0) | |
37360 | break; | |
37361 | len -= 2; | |
37362 | } | |
37363 | @@ -995,6 +997,8 @@ | |
37364 | KERN_ERR | |
37365 | "%s_attach: init error %d at stage %d, leaving attach.\n", | |
37366 | I2C_NAME(client), i, err[i]); | |
37367 | + kfree(decoder); | |
37368 | + kfree(client); | |
37369 | return 0; | |
37370 | } | |
37371 | } | |
37372 | @@ -1022,6 +1026,8 @@ | |
37373 | KERN_ERR | |
37374 | "%s_attach: init error %d at stage %d, leaving attach.\n", | |
37375 | I2C_NAME(client), i, err[i]); | |
37376 | + kfree(decoder); | |
37377 | + kfree(client); | |
37378 | return 0; | |
37379 | } | |
37380 | } | |
37381 | @@ -1068,6 +1074,8 @@ | |
37382 | KERN_ERR | |
37383 | "%s_attach: init error %d at stage %d, leaving attach.\n", | |
37384 | I2C_NAME(client), i, err[i]); | |
37385 | + kfree(decoder); | |
37386 | + kfree(client); | |
37387 | return 0; | |
37388 | } | |
37389 | } | |
37390 | @@ -1107,6 +1115,8 @@ | |
37391 | KERN_ERR | |
37392 | "%s_attach: init error %d at stage %d, leaving attach.\n", | |
37393 | I2C_NAME(client), i, err[i]); | |
37394 | + kfree(decoder); | |
37395 | + kfree(client); | |
37396 | return 0; | |
37397 | } | |
37398 | } | |
37399 | @@ -1127,6 +1137,8 @@ | |
37400 | KERN_ERR | |
37401 | "%s_attach: init error %d at stage %d, leaving attach.\n", | |
37402 | I2C_NAME(client), i, err[i]); | |
37403 | + kfree(decoder); | |
37404 | + kfree(client); | |
37405 | return 0; | |
37406 | } | |
37407 | } | |
37408 | diff -Nru a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c | |
37409 | --- a/drivers/media/video/saa7134/saa7134-oss.c Sun May 25 17:00:00 2003 | |
37410 | +++ b/drivers/media/video/saa7134/saa7134-oss.c Tue Aug 26 09:25:41 2003 | |
37411 | @@ -215,7 +215,7 @@ | |
37412 | ||
37413 | static int dsp_open(struct inode *inode, struct file *file) | |
37414 | { | |
37415 | - int minor = minor(inode->i_rdev); | |
37416 | + int minor = iminor(inode); | |
37417 | struct saa7134_dev *h,*dev = NULL; | |
37418 | struct list_head *list; | |
37419 | int err; | |
37420 | @@ -598,7 +598,7 @@ | |
37421 | ||
37422 | static int mixer_open(struct inode *inode, struct file *file) | |
37423 | { | |
37424 | - int minor = minor(inode->i_rdev); | |
37425 | + int minor = iminor(inode); | |
37426 | struct saa7134_dev *h,*dev = NULL; | |
37427 | struct list_head *list; | |
37428 | ||
37429 | diff -Nru a/drivers/media/video/saa7134/saa7134-ts.c b/drivers/media/video/saa7134/saa7134-ts.c | |
37430 | --- a/drivers/media/video/saa7134/saa7134-ts.c Thu Jul 31 16:47:19 2003 | |
37431 | +++ b/drivers/media/video/saa7134/saa7134-ts.c Tue Aug 26 09:25:41 2003 | |
37432 | @@ -166,7 +166,7 @@ | |
37433 | ||
37434 | static int ts_open(struct inode *inode, struct file *file) | |
37435 | { | |
37436 | - int minor = minor(inode->i_rdev); | |
37437 | + int minor = iminor(inode); | |
37438 | struct saa7134_dev *h,*dev = NULL; | |
37439 | struct list_head *list; | |
37440 | int err; | |
37441 | diff -Nru a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c | |
37442 | --- a/drivers/media/video/saa7134/saa7134-video.c Thu Jul 31 16:47:19 2003 | |
37443 | +++ b/drivers/media/video/saa7134/saa7134-video.c Tue Aug 26 09:25:41 2003 | |
37444 | @@ -1131,7 +1131,7 @@ | |
37445 | ||
37446 | static int video_open(struct inode *inode, struct file *file) | |
37447 | { | |
37448 | - int minor = minor(inode->i_rdev); | |
37449 | + int minor = iminor(inode); | |
37450 | struct saa7134_dev *h,*dev = NULL; | |
37451 | struct saa7134_fh *fh; | |
37452 | struct list_head *list; | |
37453 | diff -Nru a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c | |
37454 | --- a/drivers/media/video/saa7185.c Wed Aug 20 15:29:21 2003 | |
37455 | +++ b/drivers/media/video/saa7185.c Sun Aug 31 16:14:05 2003 | |
37456 | @@ -98,6 +98,7 @@ | |
37457 | u8 value) | |
37458 | { | |
37459 | struct saa7185 *encoder = i2c_get_clientdata(client); | |
37460 | + | |
37461 | dprintk(1, KERN_DEBUG "SAA7185: %02x set to %02x\n", reg, value); | |
37462 | encoder->reg[reg] = value; | |
37463 | return i2c_smbus_write_byte_data(client, reg, value); | |
37464 | @@ -118,6 +119,7 @@ | |
37465 | struct saa7185 *encoder = i2c_get_clientdata(client); | |
37466 | struct i2c_msg msg; | |
37467 | u8 block_data[32]; | |
37468 | + | |
37469 | msg.addr = client->addr; | |
37470 | msg.flags = client->flags; | |
37471 | while (len >= 2) { | |
37472 | @@ -131,16 +133,16 @@ | |
37473 | data += 2; | |
37474 | } while (len >= 2 && data[0] == reg && | |
37475 | msg.len < 32); | |
37476 | - if ((ret = | |
37477 | - i2c_transfer(client->adapter, &msg, 1)) < 0) | |
37478 | + if ((ret = i2c_transfer(client->adapter, | |
37479 | + &msg, 1)) < 0) | |
37480 | break; | |
37481 | } | |
37482 | } else { | |
37483 | /* do some slow I2C emulation kind of thing */ | |
37484 | while (len >= 2) { | |
37485 | reg = *data++; | |
37486 | - if ((ret = | |
37487 | - saa7185_write(client, reg, *data++)) < 0) | |
37488 | + if ((ret = saa7185_write(client, reg, | |
37489 | + *data++)) < 0) | |
37490 | break; | |
37491 | len -= 2; | |
37492 | } | |
37493 | @@ -434,6 +436,7 @@ | |
37494 | ||
37495 | encoder = kmalloc(sizeof(struct saa7185), GFP_KERNEL); | |
37496 | if (encoder == NULL) { | |
37497 | + kfree(client); | |
37498 | return -ENOMEM; | |
37499 | } | |
37500 | memset(encoder, 0, sizeof(struct saa7185)); | |
37501 | diff -Nru a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c | |
37502 | --- a/drivers/media/video/stradis.c Thu Apr 24 03:35:23 2003 | |
37503 | +++ b/drivers/media/video/stradis.c Tue Aug 26 09:25:41 2003 | |
37504 | @@ -1946,7 +1946,7 @@ | |
37505 | static int saa_open(struct inode *inode, struct file *file) | |
37506 | { | |
37507 | struct saa7146 *saa = NULL; | |
37508 | - unsigned int minor = minor(inode->i_rdev); | |
37509 | + unsigned int minor = iminor(inode); | |
37510 | int i; | |
37511 | ||
37512 | for (i = 0; i < SAA7146_MAX; i++) { | |
37513 | diff -Nru a/drivers/media/video/tvmixer.c b/drivers/media/video/tvmixer.c | |
37514 | --- a/drivers/media/video/tvmixer.c Wed Aug 20 15:29:21 2003 | |
37515 | +++ b/drivers/media/video/tvmixer.c Tue Aug 26 09:25:41 2003 | |
37516 | @@ -173,7 +173,7 @@ | |
37517 | ||
37518 | static int tvmixer_open(struct inode *inode, struct file *file) | |
37519 | { | |
37520 | - int i, minor = minor(inode->i_rdev); | |
37521 | + int i, minor = iminor(inode); | |
37522 | struct TVMIXER *mix = NULL; | |
37523 | struct i2c_client *client = NULL; | |
37524 | ||
37525 | diff -Nru a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c | |
37526 | --- a/drivers/media/video/videodev.c Wed Aug 6 02:51:26 2003 | |
37527 | +++ b/drivers/media/video/videodev.c Tue Sep 2 11:40:27 2003 | |
37528 | @@ -99,7 +99,7 @@ | |
37529 | ||
37530 | struct video_device* video_devdata(struct file *file) | |
37531 | { | |
37532 | - return video_device[minor(file->f_dentry->d_inode->i_rdev)]; | |
37533 | + return video_device[iminor(file->f_dentry->d_inode)]; | |
37534 | } | |
37535 | ||
37536 | /* | |
37537 | @@ -107,7 +107,7 @@ | |
37538 | */ | |
37539 | static int video_open(struct inode *inode, struct file *file) | |
37540 | { | |
37541 | - unsigned int minor = minor(inode->i_rdev); | |
37542 | + unsigned int minor = iminor(inode); | |
37543 | int err = 0; | |
37544 | struct video_device *vfl; | |
37545 | struct file_operations *old_fops; | |
37546 | @@ -349,9 +349,9 @@ | |
37547 | if(video_device[vfd->minor]!=vfd) | |
37548 | panic("videodev: bad unregister"); | |
37549 | ||
37550 | - class_device_unregister(&vfd->class_dev); | |
37551 | devfs_remove(vfd->devfs_name); | |
37552 | video_device[vfd->minor]=NULL; | |
37553 | + class_device_unregister(&vfd->class_dev); | |
37554 | up(&videodev_lock); | |
37555 | } | |
37556 | ||
37557 | diff -Nru a/drivers/media/video/vpx3220.c b/drivers/media/video/vpx3220.c | |
37558 | --- a/drivers/media/video/vpx3220.c Wed Aug 20 15:29:21 2003 | |
37559 | +++ b/drivers/media/video/vpx3220.c Sun Aug 31 16:14:05 2003 | |
37560 | @@ -76,6 +76,7 @@ | |
37561 | u8 value) | |
37562 | { | |
37563 | struct vpx3220 *decoder = i2c_get_clientdata(client); | |
37564 | + | |
37565 | decoder->reg[reg] = value; | |
37566 | return i2c_smbus_write_byte_data(client, reg, value); | |
37567 | } | |
37568 | @@ -294,6 +295,7 @@ | |
37569 | { | |
37570 | int len = sizeof(init_common); | |
37571 | const unsigned char *data = init_common; | |
37572 | + | |
37573 | while (len > 1) { | |
37574 | dprintk(1, | |
37575 | KERN_DEBUG "vpx3216b i2c reg 0x%02x data 0x%02x\n", | |
37576 | diff -Nru a/drivers/media/video/zoran.h b/drivers/media/video/zoran.h | |
37577 | --- a/drivers/media/video/zoran.h Wed Aug 20 15:29:21 2003 | |
37578 | +++ b/drivers/media/video/zoran.h Sun Aug 31 16:14:06 2003 | |
37579 | @@ -146,7 +146,7 @@ | |
37580 | ||
37581 | #define ZORAN_NAME "ZORAN" /* name of the device */ | |
37582 | ||
37583 | -#define ZR_DEVNAME(zr) pci_name((zr)->pci_dev) | |
37584 | +#define ZR_DEVNAME(zr) ((zr)->name) | |
37585 | ||
37586 | #define BUZ_MAX_WIDTH (zr->timing->Wa) | |
37587 | #define BUZ_MAX_HEIGHT (zr->timing->Ha) | |
37588 | @@ -383,7 +383,7 @@ | |
37589 | }; | |
37590 | ||
37591 | struct zoran { | |
37592 | - struct video_device video_dev; | |
37593 | + struct video_device *video_dev; | |
37594 | ||
37595 | struct i2c_adapter i2c_adapter; /* */ | |
37596 | struct i2c_algo_bit_data i2c_algo; /* */ | |
37597 | @@ -403,9 +403,7 @@ | |
37598 | struct tvnorm *timing; | |
37599 | ||
37600 | unsigned short id; /* number of this device */ | |
37601 | -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) | |
37602 | char name[32]; /* name of this device */ | |
37603 | -#endif | |
37604 | struct pci_dev *pci_dev; /* PCI device */ | |
37605 | unsigned char revision; /* revision of zr36057 */ | |
37606 | unsigned int zr36057_adr; /* bus address of IO mem returned by PCI BIOS */ | |
37607 | diff -Nru a/drivers/media/video/zoran_card.c b/drivers/media/video/zoran_card.c | |
37608 | --- a/drivers/media/video/zoran_card.c Wed Aug 20 15:29:21 2003 | |
37609 | +++ b/drivers/media/video/zoran_card.c Sun Aug 31 16:14:05 2003 | |
37610 | @@ -136,7 +136,8 @@ | |
37611 | MODULE_PARM_DESC(pass_through, | |
37612 | "Pass TV signal through to TV-out when idling"); | |
37613 | ||
37614 | -int debug = 1; | |
37615 | +static int debug = 1; | |
37616 | +int *zr_debug = &debug; | |
37617 | MODULE_PARM(debug, "i"); | |
37618 | MODULE_PARM_DESC(debug, "Debug level (0-4)"); | |
37619 | ||
37620 | @@ -153,7 +154,7 @@ | |
37621 | ||
37622 | #define dprintk(num, format, args...) \ | |
37623 | do { \ | |
37624 | - if (debug >= num) \ | |
37625 | + if (*zr_debug >= num) \ | |
37626 | printk(format, ##args); \ | |
37627 | } while (0) | |
37628 | ||
37629 | @@ -623,6 +624,7 @@ | |
37630 | zoran_i2c_getsda (void *data) | |
37631 | { | |
37632 | struct zoran *zr = (struct zoran *) data; | |
37633 | + | |
37634 | return (btread(ZR36057_I2CBR) >> 1) & 1; | |
37635 | } | |
37636 | ||
37637 | @@ -630,6 +632,7 @@ | |
37638 | zoran_i2c_getscl (void *data) | |
37639 | { | |
37640 | struct zoran *zr = (struct zoran *) data; | |
37641 | + | |
37642 | return btread(ZR36057_I2CBR) & 1; | |
37643 | } | |
37644 | ||
37645 | @@ -638,6 +641,7 @@ | |
37646 | int state) | |
37647 | { | |
37648 | struct zoran *zr = (struct zoran *) data; | |
37649 | + | |
37650 | if (state) | |
37651 | zr->i2cbr |= 2; | |
37652 | else | |
37653 | @@ -650,6 +654,7 @@ | |
37654 | int state) | |
37655 | { | |
37656 | struct zoran *zr = (struct zoran *) data; | |
37657 | + | |
37658 | if (state) | |
37659 | zr->i2cbr |= 1; | |
37660 | else | |
37661 | @@ -766,6 +771,7 @@ | |
37662 | struct zoran_jpg_settings *settings) | |
37663 | { | |
37664 | int err = 0, err0 = 0; | |
37665 | + | |
37666 | dprintk(4, | |
37667 | KERN_DEBUG | |
37668 | "%s: check_jpg_settings() - dec: %d, Hdcm: %d, Vdcm: %d, Tdcm: %d\n", | |
37669 | @@ -977,7 +983,7 @@ | |
37670 | if (timeout) { | |
37671 | dprintk(1, ": time spent: %d\n", 1 * HZ - timeout); | |
37672 | } | |
37673 | - if (debug > 1) | |
37674 | + if (*zr_debug > 1) | |
37675 | print_interrupts(zr); | |
37676 | btwrite(icr, ZR36057_ICR); | |
37677 | } | |
37678 | @@ -986,6 +992,7 @@ | |
37679 | zr36057_init (struct zoran *zr) | |
37680 | { | |
37681 | unsigned long mem; | |
37682 | + void *vdev; | |
37683 | unsigned mem_needed; | |
37684 | int j; | |
37685 | int two = 2; | |
37686 | @@ -1040,11 +1047,16 @@ | |
37687 | * in case allocation fails */ | |
37688 | mem_needed = BUZ_NUM_STAT_COM * 4; | |
37689 | mem = (unsigned long) kmalloc(mem_needed, GFP_KERNEL); | |
37690 | - if (!mem) { | |
37691 | + vdev = (void *) kmalloc(sizeof(struct video_device), GFP_KERNEL); | |
37692 | + if (!mem || !vdev) { | |
37693 | dprintk(1, | |
37694 | KERN_ERR | |
37695 | "%s: zr36057_init() - kmalloc (STAT_COM) failed\n", | |
37696 | ZR_DEVNAME(zr)); | |
37697 | + if (vdev) | |
37698 | + kfree(vdev); | |
37699 | + if (mem) | |
37700 | + kfree((void *)mem); | |
37701 | return -ENOMEM; | |
37702 | } | |
37703 | memset((void *) mem, 0, mem_needed); | |
37704 | @@ -1056,17 +1068,19 @@ | |
37705 | /* | |
37706 | * Now add the template and register the device unit. | |
37707 | */ | |
37708 | - memcpy(&zr->video_dev, &zoran_template, sizeof(zoran_template)); | |
37709 | - strcpy(zr->video_dev.name, ZR_DEVNAME(zr)); | |
37710 | - if (video_register_device | |
37711 | - (&zr->video_dev, VFL_TYPE_GRABBER, video_nr) < 0) { | |
37712 | + zr->video_dev = vdev; | |
37713 | + memcpy(zr->video_dev, &zoran_template, sizeof(zoran_template)); | |
37714 | + strcpy(zr->video_dev->name, ZR_DEVNAME(zr)); | |
37715 | + if (video_register_device(zr->video_dev, VFL_TYPE_GRABBER, | |
37716 | + video_nr) < 0) { | |
37717 | zoran_unregister_i2c(zr); | |
37718 | kfree((void *) zr->stat_com); | |
37719 | + kfree(vdev); | |
37720 | return -1; | |
37721 | } | |
37722 | ||
37723 | zoran_init_hardware(zr); | |
37724 | - if (debug > 2) | |
37725 | + if (*zr_debug > 2) | |
37726 | detect_guest_activity(zr); | |
37727 | test_interrupts(zr); | |
37728 | if (!pass_through) { | |
37729 | @@ -1109,7 +1123,14 @@ | |
37730 | kfree((void *) zr->stat_com); | |
37731 | zoran_proc_cleanup(zr); | |
37732 | iounmap(zr->zr36057_mem); | |
37733 | - video_unregister_device(&zr->video_dev); | |
37734 | + pci_disable_device(zr->pci_dev); | |
37735 | + video_unregister_device(zr->video_dev); | |
37736 | +} | |
37737 | + | |
37738 | +void | |
37739 | +zoran_vdev_release (struct video_device *vdev) | |
37740 | +{ | |
37741 | + kfree(vdev); | |
37742 | } | |
37743 | ||
37744 | static struct videocodec_master * __devinit | |
37745 | @@ -1207,6 +1228,7 @@ | |
37746 | } else { | |
37747 | int i; | |
37748 | unsigned short ss_vendor, ss_device; | |
37749 | + | |
37750 | ss_vendor = zr->pci_dev->subsystem_vendor; | |
37751 | ss_device = zr->pci_dev->subsystem_device; | |
37752 | dprintk(1, | |
37753 | @@ -1467,6 +1489,7 @@ | |
37754 | init_dc10_cards (void) | |
37755 | { | |
37756 | int i; | |
37757 | + | |
37758 | memset(zoran, 0, sizeof(zoran)); | |
37759 | printk(KERN_INFO "Zoran MJPEG board driver version %d.%d.%d\n", | |
37760 | MAJOR_VERSION, MINOR_VERSION, RELEASE_VERSION); | |
37761 | @@ -1523,6 +1546,7 @@ | |
37762 | /* take care of Natoma chipset and a revision 1 zr36057 */ | |
37763 | for (i = 0; i < zoran_num; i++) { | |
37764 | struct zoran *zr = &zoran[i]; | |
37765 | + | |
37766 | if (pci_pci_problems & PCIPCI_NATOMA && zr->revision <= 1) { | |
37767 | zr->jpg_buffers.need_contiguous = 1; | |
37768 | dprintk(1, | |
37769 | @@ -1546,6 +1570,7 @@ | |
37770 | unload_dc10_cards (void) | |
37771 | { | |
37772 | int i; | |
37773 | + | |
37774 | for (i = 0; i < zoran_num; i++) | |
37775 | zoran_release(&zoran[i]); | |
37776 | } | |
37777 | diff -Nru a/drivers/media/video/zoran_card.h b/drivers/media/video/zoran_card.h | |
37778 | --- a/drivers/media/video/zoran_card.h Wed Aug 20 14:29:31 2003 | |
37779 | +++ b/drivers/media/video/zoran_card.h Sun Aug 31 16:14:03 2003 | |
37780 | @@ -40,5 +40,6 @@ | |
37781 | extern int zoran_check_jpg_settings(struct zoran *zr, | |
37782 | struct zoran_jpg_settings *settings); | |
37783 | extern void zoran_open_init_params(struct zoran *zr); | |
37784 | +extern void zoran_vdev_release(struct video_device *vdev); | |
37785 | ||
37786 | #endif /* __ZORAN_CARD_H__ */ | |
37787 | diff -Nru a/drivers/media/video/zoran_device.c b/drivers/media/video/zoran_device.c | |
37788 | --- a/drivers/media/video/zoran_device.c Wed Aug 20 14:29:31 2003 | |
37789 | +++ b/drivers/media/video/zoran_device.c Sun Aug 31 16:14:05 2003 | |
37790 | @@ -58,11 +58,11 @@ | |
37791 | extern const struct zoran_format zoran_formats[]; | |
37792 | extern const int zoran_num_formats; | |
37793 | ||
37794 | -extern int debug; | |
37795 | +extern int *zr_debug; | |
37796 | ||
37797 | #define dprintk(num, format, args...) \ | |
37798 | do { \ | |
37799 | - if (debug >= num) \ | |
37800 | + if (*zr_debug >= num) \ | |
37801 | printk(format, ##args); \ | |
37802 | } while (0) | |
37803 | ||
37804 | @@ -170,7 +170,7 @@ | |
37805 | static void | |
37806 | dump_guests (struct zoran *zr) | |
37807 | { | |
37808 | - if (debug > 2) { | |
37809 | + if (*zr_debug > 2) { | |
37810 | int i, guest[8]; | |
37811 | ||
37812 | for (i = 1; i < 8; i++) { // Don't read jpeg codec here | |
37813 | @@ -190,6 +190,7 @@ | |
37814 | get_time (void) | |
37815 | { | |
37816 | struct timeval tv; | |
37817 | + | |
37818 | do_gettimeofday(&tv); | |
37819 | return (1000000 * tv.tv_sec + tv.tv_usec); | |
37820 | } | |
37821 | @@ -868,8 +869,8 @@ | |
37822 | void | |
37823 | print_interrupts (struct zoran *zr) | |
37824 | { | |
37825 | - int res, noerr; | |
37826 | - noerr = 0; | |
37827 | + int res, noerr = 0; | |
37828 | + | |
37829 | printk(KERN_INFO "%s: interrupts received:", ZR_DEVNAME(zr)); | |
37830 | if ((res = zr->field_counter) < -1 || res > 1) { | |
37831 | printk(" FD:%d", res); | |
37832 | @@ -931,6 +932,7 @@ | |
37833 | count_reset_interrupt (struct zoran *zr) | |
37834 | { | |
37835 | u32 isr; | |
37836 | + | |
37837 | if ((isr = btread(ZR36057_ISR) & 0x78000000)) { | |
37838 | if (isr & ZR36057_ISR_GIRQ1) { | |
37839 | btwrite(ZR36057_ISR_GIRQ1, ZR36057_ISR); | |
37840 | @@ -961,6 +963,7 @@ | |
37841 | jpeg_start (struct zoran *zr) | |
37842 | { | |
37843 | int reg; | |
37844 | + | |
37845 | zr->frame_num = 0; | |
37846 | ||
37847 | /* deassert P_reset, disable code transfer, deassert Active */ | |
37848 | @@ -1272,7 +1275,7 @@ | |
37849 | zr->num_errors++; | |
37850 | ||
37851 | /* Report error */ | |
37852 | - if (debug > 1 && zr->num_errors <= 8) { | |
37853 | + if (*zr_debug > 1 && zr->num_errors <= 8) { | |
37854 | long frame; | |
37855 | frame = | |
37856 | zr->jpg_pend[zr->jpg_dma_tail & BUZ_MASK_FRAME]; | |
37857 | @@ -1453,38 +1456,23 @@ | |
37858 | 0) { | |
37859 | /* it is finished, notify the user */ | |
37860 | ||
37861 | - zr->v4l_buffers.buffer[zr-> | |
37862 | - v4l_grab_frame]. | |
37863 | - state = BUZ_STATE_DONE; | |
37864 | - zr->v4l_buffers.buffer[zr-> | |
37865 | - v4l_grab_frame]. | |
37866 | - bs.seq = | |
37867 | - zr->v4l_grab_seq; | |
37868 | - do_gettimeofday(&zr-> | |
37869 | - v4l_buffers. | |
37870 | - buffer[zr-> | |
37871 | - v4l_grab_frame]. | |
37872 | - bs. | |
37873 | - timestamp); | |
37874 | - zr->v4l_grab_frame = | |
37875 | - NO_GRAB_ACTIVE; | |
37876 | + zr->v4l_buffers.buffer[zr->v4l_grab_frame].state = BUZ_STATE_DONE; | |
37877 | + zr->v4l_buffers.buffer[zr->v4l_grab_frame].bs.seq = zr->v4l_grab_seq; | |
37878 | + do_gettimeofday(&zr->v4l_buffers.buffer[zr->v4l_grab_frame].bs.timestamp); | |
37879 | + zr->v4l_grab_frame = NO_GRAB_ACTIVE; | |
37880 | zr->v4l_pend_tail++; | |
37881 | } | |
37882 | } | |
37883 | ||
37884 | if (zr->v4l_grab_frame == NO_GRAB_ACTIVE) | |
37885 | - wake_up_interruptible(&zr-> | |
37886 | - v4l_capq); | |
37887 | + wake_up_interruptible(&zr->v4l_capq); | |
37888 | ||
37889 | /* Check if there is another grab queued */ | |
37890 | ||
37891 | if (zr->v4l_grab_frame == NO_GRAB_ACTIVE && | |
37892 | - zr->v4l_pend_tail != | |
37893 | - zr->v4l_pend_head) { | |
37894 | + zr->v4l_pend_tail != zr->v4l_pend_head) { | |
37895 | ||
37896 | - int frame = | |
37897 | - zr->v4l_pend[zr-> | |
37898 | - v4l_pend_tail & | |
37899 | + int frame = zr->v4l_pend[zr->v4l_pend_tail & | |
37900 | V4L_MASK_FRAME]; | |
37901 | u32 reg; | |
37902 | ||
37903 | @@ -1544,7 +1532,7 @@ | |
37904 | ||
37905 | if (zr->codec_mode == BUZ_MODE_MOTION_DECOMPRESS || | |
37906 | zr->codec_mode == BUZ_MODE_MOTION_COMPRESS) { | |
37907 | - if (debug > 1 && | |
37908 | + if (*zr_debug > 1 && | |
37909 | (!zr->frame_num || zr->JPEG_error)) { | |
37910 | printk(KERN_INFO | |
37911 | "%s: first frame ready: state=0x%08x odd_even=%d field_per_buff=%d delay=%d\n", | |
37912 | @@ -1559,11 +1547,8 @@ | |
37913 | int i; | |
37914 | strcpy(sv, sc); | |
37915 | for (i = 0; i < 4; i++) { | |
37916 | - if (zr-> | |
37917 | - stat_com[i] & | |
37918 | - 1) | |
37919 | - sv[i] = | |
37920 | - '1'; | |
37921 | + if (zr->stat_com[i] & 1) | |
37922 | + sv[i] = '1'; | |
37923 | } | |
37924 | sv[4] = 0; | |
37925 | printk(KERN_INFO | |
37926 | @@ -1584,7 +1569,7 @@ | |
37927 | zr->JPEG_missed; | |
37928 | } | |
37929 | ||
37930 | - if (debug > 2 && zr->frame_num < 6) { | |
37931 | + if (*zr_debug > 2 && zr->frame_num < 6) { | |
37932 | int i; | |
37933 | printk("%s: seq=%ld stat_com:", | |
37934 | ZR_DEVNAME(zr), zr->jpg_seq_num); | |
37935 | @@ -1643,10 +1628,11 @@ | |
37936 | zoran_set_pci_master (struct zoran *zr, | |
37937 | int set_master) | |
37938 | { | |
37939 | - u16 command; | |
37940 | if (set_master) { | |
37941 | pci_set_master(zr->pci_dev); | |
37942 | } else { | |
37943 | + u16 command; | |
37944 | + | |
37945 | pci_read_config_word(zr->pci_dev, PCI_COMMAND, &command); | |
37946 | command &= ~PCI_COMMAND_MASTER; | |
37947 | pci_write_config_word(zr->pci_dev, PCI_COMMAND, command); | |
37948 | @@ -1657,6 +1643,7 @@ | |
37949 | zoran_init_hardware (struct zoran *zr) | |
37950 | { | |
37951 | int j, zero = 0; | |
37952 | + | |
37953 | /* Enable bus-mastering */ | |
37954 | zoran_set_pci_master(zr, 1); | |
37955 | ||
37956 | @@ -1718,6 +1705,7 @@ | |
37957 | zr36057_init_vfe (struct zoran *zr) | |
37958 | { | |
37959 | u32 reg; | |
37960 | + | |
37961 | reg = btread(ZR36057_VFESPFR); | |
37962 | reg |= ZR36057_VFESPFR_LittleEndian; | |
37963 | reg &= ~ZR36057_VFESPFR_VCLKPol; | |
37964 | @@ -1748,6 +1736,7 @@ | |
37965 | if (zr->card.type == LML33 && | |
37966 | (cmd == DECODER_SET_NORM || DECODER_SET_INPUT)) { | |
37967 | int res; | |
37968 | + | |
37969 | // Bt819 needs to reset its FIFO buffer using #FRST pin and | |
37970 | // LML33 card uses GPIO(7) for that. | |
37971 | GPIO(zr, 7, 0); | |
37972 | diff -Nru a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c | |
37973 | --- a/drivers/media/video/zoran_driver.c Wed Aug 20 14:29:31 2003 | |
37974 | +++ b/drivers/media/video/zoran_driver.c Sun Aug 31 16:14:05 2003 | |
37975 | @@ -51,6 +51,7 @@ | |
37976 | #include <linux/delay.h> | |
37977 | #include <linux/slab.h> | |
37978 | #include <linux/pci.h> | |
37979 | +#include <linux/vmalloc.h> | |
37980 | ||
37981 | #include <linux/interrupt.h> | |
37982 | #include <linux/i2c.h> | |
37983 | @@ -187,11 +188,11 @@ | |
37984 | # include <linux/bigphysarea.h> | |
37985 | #endif | |
37986 | ||
37987 | -extern int debug; | |
37988 | +extern int *zr_debug; | |
37989 | ||
37990 | #define dprintk(num, format, args...) \ | |
37991 | do { \ | |
37992 | - if (debug >= num) \ | |
37993 | + if (*zr_debug >= num) \ | |
37994 | printk(format, ##args); \ | |
37995 | } while (0) | |
37996 | ||
37997 | @@ -370,6 +371,7 @@ | |
37998 | int n = | |
37999 | (fh->v4l_buffers.buffer_size + PAGE_SIZE - | |
38000 | 1) / PAGE_SIZE; | |
38001 | + | |
38002 | mem = | |
38003 | (unsigned char *) bigphysarea_alloc_pages(n, 0, | |
38004 | GFP_KERNEL); | |
38005 | @@ -412,6 +414,7 @@ | |
38006 | int size = | |
38007 | fh->v4l_buffers.num_buffers * | |
38008 | fh->v4l_buffers.buffer_size; | |
38009 | + | |
38010 | pmem = get_high_mem(size); | |
38011 | if (pmem == 0) { | |
38012 | dprintk(1, | |
38013 | @@ -847,9 +850,10 @@ | |
38014 | if (res) | |
38015 | return res; | |
38016 | } | |
38017 | - if ((res = | |
38018 | - zoran_v4l_set_format(file, mp->width, mp->height, | |
38019 | - &zoran_formats[i]))) | |
38020 | + if ((res = zoran_v4l_set_format(file, | |
38021 | + mp->width, | |
38022 | + mp->height, | |
38023 | + &zoran_formats[i]))) | |
38024 | return res; | |
38025 | zr->v4l_settings = fh->v4l_settings; | |
38026 | ||
38027 | @@ -1144,7 +1148,7 @@ | |
38028 | frame = zr->jpg_pend[zr->jpg_que_tail & BUZ_MASK_FRAME]; | |
38029 | ||
38030 | /* buffer should now be in BUZ_STATE_DONE */ | |
38031 | - if (debug > 0) | |
38032 | + if (*zr_debug > 0) | |
38033 | if (zr->jpg_buffers.buffer[frame].state != BUZ_STATE_DONE) | |
38034 | dprintk(2, | |
38035 | KERN_ERR | |
38036 | @@ -1268,7 +1272,7 @@ | |
38037 | ||
38038 | /* find the device */ | |
38039 | for (i = 0; i < zoran_num; i++) { | |
38040 | - if (zoran[i].video_dev.minor == minor) { | |
38041 | + if (zoran[i].video_dev->minor == minor) { | |
38042 | zr = &zoran[i]; | |
38043 | break; | |
38044 | } | |
38045 | @@ -1424,7 +1428,7 @@ | |
38046 | /* disable interrupts */ | |
38047 | btand(~ZR36057_ICR_IntPinEn, ZR36057_ICR); | |
38048 | ||
38049 | - if (debug > 1) | |
38050 | + if (*zr_debug > 1) | |
38051 | print_interrupts(zr); | |
38052 | ||
38053 | /* Overlay off */ | |
38054 | @@ -2032,6 +2036,7 @@ | |
38055 | case VIDIOCGCAP: | |
38056 | { | |
38057 | struct video_capability *vcap = arg; | |
38058 | + | |
38059 | dprintk(3, KERN_DEBUG "%s: VIDIOCGCAP\n", ZR_DEVNAME(zr)); | |
38060 | ||
38061 | memset(vcap, 0, sizeof(struct video_capability)); | |
38062 | @@ -2154,6 +2159,7 @@ | |
38063 | ||
38064 | for (i = 0; i < zoran_num_formats; i++) { | |
38065 | const struct zoran_format *fmt = &zoran_formats[i]; | |
38066 | + | |
38067 | if (fmt->palette != -1 && | |
38068 | fmt->flags & ZORAN_FORMAT_OVERLAY && | |
38069 | fmt->palette == vpict->palette && | |
38070 | @@ -2203,7 +2209,9 @@ | |
38071 | case VIDIOCGWIN: | |
38072 | { | |
38073 | struct video_window *vwin = arg; | |
38074 | + | |
38075 | dprintk(3, KERN_DEBUG "%s: VIDIOCGWIN\n", ZR_DEVNAME(zr)); | |
38076 | + | |
38077 | memset(vwin, 0, sizeof(struct video_window)); | |
38078 | down(&zr->resource_lock); | |
38079 | vwin->x = fh->overlay_settings.x; | |
38080 | @@ -2241,7 +2249,9 @@ | |
38081 | case VIDIOCGFBUF: | |
38082 | { | |
38083 | struct video_buffer *vbuf = arg; | |
38084 | + | |
38085 | dprintk(3, KERN_DEBUG "%s: VIDIOCGFBUF\n", ZR_DEVNAME(zr)); | |
38086 | + | |
38087 | down(&zr->resource_lock); | |
38088 | *vbuf = zr->buffer; | |
38089 | up(&zr->resource_lock); | |
38090 | @@ -2285,8 +2295,10 @@ | |
38091 | case VIDIOCSYNC: | |
38092 | { | |
38093 | int *frame = arg, res; | |
38094 | + | |
38095 | dprintk(3, KERN_DEBUG "%s: VIDIOCSYNC - frame=%d\n", | |
38096 | ZR_DEVNAME(zr), *frame); | |
38097 | + | |
38098 | down(&zr->resource_lock); | |
38099 | res = v4l_sync(file, *frame); | |
38100 | up(&zr->resource_lock); | |
38101 | @@ -2300,11 +2312,13 @@ | |
38102 | { | |
38103 | struct video_mmap *vmap = arg; | |
38104 | int res; | |
38105 | + | |
38106 | dprintk(3, | |
38107 | KERN_DEBUG | |
38108 | "%s: VIDIOCMCAPTURE - frame=%d, geom=%dx%d, fmt=%d\n", | |
38109 | ZR_DEVNAME(zr), vmap->frame, vmap->width, vmap->height, | |
38110 | vmap->format); | |
38111 | + | |
38112 | down(&zr->resource_lock); | |
38113 | res = v4l_grab(file, vmap); | |
38114 | up(&zr->resource_lock); | |
38115 | @@ -2358,7 +2372,8 @@ | |
38116 | struct video_unit *vunit = arg; | |
38117 | ||
38118 | dprintk(3, KERN_DEBUG "%s: VIDIOCGUNIT\n", ZR_DEVNAME(zr)); | |
38119 | - vunit->video = zr->video_dev.minor; | |
38120 | + | |
38121 | + vunit->video = zr->video_dev->minor; | |
38122 | vunit->vbi = VIDEO_NO_UNIT; | |
38123 | vunit->radio = VIDEO_NO_UNIT; | |
38124 | vunit->audio = VIDEO_NO_UNIT; | |
38125 | @@ -2393,6 +2408,7 @@ | |
38126 | case BUZIOC_G_PARAMS: | |
38127 | { | |
38128 | struct zoran_params *bparams = arg; | |
38129 | + | |
38130 | dprintk(3, KERN_DEBUG "%s: BUZIOC_G_PARAMS\n", ZR_DEVNAME(zr)); | |
38131 | ||
38132 | memset(bparams, 0, sizeof(struct zoran_params)); | |
38133 | @@ -2686,6 +2702,7 @@ | |
38134 | struct v4l2_fmtdesc *fmt = arg; | |
38135 | int index = fmt->index, num = -1, i, flag = 0, type = | |
38136 | fmt->type; | |
38137 | + | |
38138 | dprintk(3, KERN_DEBUG "%s: VIDIOC_ENUM_FMT - index=%d\n", | |
38139 | ZR_DEVNAME(zr), fmt->index); | |
38140 | ||
38141 | @@ -3530,6 +3547,7 @@ | |
38142 | case VIDIOC_QUERYCTRL: | |
38143 | { | |
38144 | struct v4l2_queryctrl *ctrl = arg; | |
38145 | + | |
38146 | dprintk(3, KERN_DEBUG "%s: VIDIOC_QUERYCTRL - id=%d\n", | |
38147 | ZR_DEVNAME(zr), ctrl->id); | |
38148 | ||
38149 | @@ -3571,6 +3589,7 @@ | |
38150 | case VIDIOC_G_CTRL: | |
38151 | { | |
38152 | struct v4l2_control *ctrl = arg; | |
38153 | + | |
38154 | dprintk(3, KERN_DEBUG "%s: VIDIOC_G_CTRL - id=%d\n", | |
38155 | ZR_DEVNAME(zr), ctrl->id); | |
38156 | ||
38157 | @@ -3652,6 +3671,7 @@ | |
38158 | case VIDIOC_ENUMSTD: | |
38159 | { | |
38160 | struct v4l2_standard *std = arg; | |
38161 | + | |
38162 | dprintk(3, KERN_DEBUG "%s: VIDIOC_ENUMSTD - index=%d\n", | |
38163 | ZR_DEVNAME(zr), std->index); | |
38164 | ||
38165 | @@ -3707,6 +3727,7 @@ | |
38166 | { | |
38167 | v4l2_std_id *std = arg; | |
38168 | int norm; | |
38169 | + | |
38170 | dprintk(3, KERN_DEBUG "%s: VIDIOC_G_STD\n", ZR_DEVNAME(zr)); | |
38171 | ||
38172 | down(&zr->resource_lock); | |
38173 | @@ -3804,6 +3825,7 @@ | |
38174 | case VIDIOC_G_INPUT: | |
38175 | { | |
38176 | int *input = arg; | |
38177 | + | |
38178 | dprintk(3, KERN_DEBUG "%s: VIDIOC_G_INPUT\n", ZR_DEVNAME(zr)); | |
38179 | ||
38180 | down(&zr->resource_lock); | |
38181 | @@ -3817,6 +3839,7 @@ | |
38182 | case VIDIOC_S_INPUT: | |
38183 | { | |
38184 | int *input = arg, res = 0; | |
38185 | + | |
38186 | dprintk(3, KERN_DEBUG "%s: VIDIOC_S_INPUT - input=%d\n", | |
38187 | ZR_DEVNAME(zr), *input); | |
38188 | ||
38189 | @@ -3835,6 +3858,7 @@ | |
38190 | case VIDIOC_ENUMOUTPUT: | |
38191 | { | |
38192 | struct v4l2_output *outp = arg; | |
38193 | + | |
38194 | dprintk(3, KERN_DEBUG "%s: VIDIOC_ENUMOUTPUT - index=%d\n", | |
38195 | ZR_DEVNAME(zr), outp->index); | |
38196 | ||
38197 | @@ -4005,7 +4029,9 @@ | |
38198 | case VIDIOC_G_JPEGCOMP: | |
38199 | { | |
38200 | struct v4l2_jpegcompression *params = arg; | |
38201 | - dprintk(3, KERN_DEBUG "%s: VIDIOC_G_JPEGCOMP\n", ZR_DEVNAME(zr)); | |
38202 | + | |
38203 | + dprintk(3, KERN_DEBUG "%s: VIDIOC_G_JPEGCOMP\n", | |
38204 | + ZR_DEVNAME(zr)); | |
38205 | ||
38206 | memset(params, 0, sizeof(*params)); | |
38207 | ||
38208 | @@ -4175,6 +4201,7 @@ | |
38209 | } else if (fmt->type == | |
38210 | V4L2_BUF_TYPE_VIDEO_CAPTURE) { | |
38211 | int i; | |
38212 | + | |
38213 | for (i = 0; i < zoran_num_formats; i++) | |
38214 | if (zoran_formats[i].fourcc == | |
38215 | fmt->fmt.pix.pixelformat) | |
38216 | @@ -4321,6 +4348,7 @@ | |
38217 | zoran_vm_open (struct vm_area_struct *vma) | |
38218 | { | |
38219 | struct zoran_mapping *map = vma->vm_private_data; | |
38220 | + | |
38221 | map->count++; | |
38222 | } | |
38223 | ||
38224 | @@ -4665,5 +4693,6 @@ | |
38225 | #endif | |
38226 | .hardware = ZORAN_HARDWARE, | |
38227 | .fops = &zoran_fops, | |
38228 | + .release = &zoran_vdev_release, | |
38229 | .minor = -1 | |
38230 | }; | |
38231 | diff -Nru a/drivers/media/video/zoran_procfs.c b/drivers/media/video/zoran_procfs.c | |
38232 | --- a/drivers/media/video/zoran_procfs.c Wed Aug 20 15:38:07 2003 | |
38233 | +++ b/drivers/media/video/zoran_procfs.c Sun Aug 31 16:14:05 2003 | |
38234 | @@ -49,11 +49,11 @@ | |
38235 | #include "zoran.h" | |
38236 | #include "zoran_procfs.h" | |
38237 | ||
38238 | -extern int debug; | |
38239 | +extern int *zr_debug; | |
38240 | ||
38241 | #define dprintk(num, format, args...) \ | |
38242 | do { \ | |
38243 | - if (debug >= num) \ | |
38244 | + if (*zr_debug >= num) \ | |
38245 | printk(format, ##args); \ | |
38246 | } while (0) | |
38247 | ||
38248 | @@ -248,6 +248,7 @@ | |
38249 | { | |
38250 | #ifdef CONFIG_PROC_FS | |
38251 | char name[8]; | |
38252 | + | |
38253 | snprintf(name, 7, "zoran%d", zr->id); | |
38254 | if ((zr->zoran_proc = create_proc_entry(name, 0, 0))) { | |
38255 | zr->zoran_proc->read_proc = zoran_read_proc; | |
38256 | @@ -272,6 +273,7 @@ | |
38257 | { | |
38258 | #ifdef CONFIG_PROC_FS | |
38259 | char name[8]; | |
38260 | + | |
38261 | snprintf(name, 7, "zoran%d", zr->id); | |
38262 | if (zr->zoran_proc) { | |
38263 | remove_proc_entry(name, 0); | |
38264 | diff -Nru a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig | |
38265 | --- a/drivers/mtd/devices/Kconfig Mon Aug 18 11:25:06 2003 | |
38266 | +++ b/drivers/mtd/devices/Kconfig Sun Aug 24 03:43:25 2003 | |
38267 | @@ -102,7 +102,7 @@ | |
38268 | ||
38269 | config MTD_BLKMTD | |
38270 | tristate "MTD emulation using block device" | |
38271 | - depends on MTD && BROKEN | |
38272 | + depends on MTD | |
38273 | help | |
38274 | This driver allows a block device to appear as an MTD. It would | |
38275 | generally be used in the following cases: | |
38276 | diff -Nru a/drivers/mtd/maps/ceiva.c b/drivers/mtd/maps/ceiva.c | |
38277 | --- a/drivers/mtd/maps/ceiva.c Wed May 28 08:01:03 2003 | |
38278 | +++ b/drivers/mtd/maps/ceiva.c Sun Aug 31 16:14:08 2003 | |
38279 | @@ -64,23 +64,23 @@ | |
38280 | ||
38281 | static struct mtd_partition ceiva_partitions[] = { | |
38282 | { | |
38283 | - name: "Ceiva BOOT partition", | |
38284 | - size: BOOT_PARTITION_SIZE_KiB*1024, | |
38285 | - offset: 0, | |
38286 | + .name = "Ceiva BOOT partition", | |
38287 | + .size = BOOT_PARTITION_SIZE_KiB*1024, | |
38288 | + .offset = 0, | |
38289 | ||
38290 | },{ | |
38291 | - name: "Ceiva parameters partition", | |
38292 | - size: PARAMS_PARTITION_SIZE_KiB*1024, | |
38293 | - offset: (16 + 8) * 1024, | |
38294 | + .name = "Ceiva parameters partition", | |
38295 | + .size = PARAMS_PARTITION_SIZE_KiB*1024, | |
38296 | + .offset = (16 + 8) * 1024, | |
38297 | },{ | |
38298 | - name: "Ceiva kernel partition", | |
38299 | - size: (KERNEL_PARTITION_SIZE_KiB)*1024, | |
38300 | - offset: 0x20000, | |
38301 | + .name = "Ceiva kernel partition", | |
38302 | + .size = (KERNEL_PARTITION_SIZE_KiB)*1024, | |
38303 | + .offset = 0x20000, | |
38304 | ||
38305 | },{ | |
38306 | - name: "Ceiva root filesystem partition", | |
38307 | - offset: MTDPART_OFS_APPEND, | |
38308 | - size: (ROOT_PARTITION_SIZE_KiB)*1024, | |
38309 | + .name = "Ceiva root filesystem partition", | |
38310 | + .offset = MTDPART_OFS_APPEND, | |
38311 | + .size = (ROOT_PARTITION_SIZE_KiB)*1024, | |
38312 | } | |
38313 | }; | |
38314 | #endif | |
38315 | diff -Nru a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c | |
38316 | --- a/drivers/mtd/maps/pcmciamtd.c Wed Jun 25 03:30:03 2003 | |
38317 | +++ b/drivers/mtd/maps/pcmciamtd.c Sat Aug 23 08:27:27 2003 | |
38318 | @@ -344,9 +344,8 @@ | |
38319 | * still open, this will be postponed until it is closed. | |
38320 | */ | |
38321 | ||
38322 | -static void pcmciamtd_release(u_long arg) | |
38323 | +static void pcmciamtd_release(dev_link_t *link) | |
38324 | { | |
38325 | - dev_link_t *link = (dev_link_t *)arg; | |
38326 | struct pcmciamtd_dev *dev = link->priv; | |
38327 | ||
38328 | DEBUG(3, "link = 0x%p", link); | |
38329 | @@ -564,7 +563,7 @@ | |
38330 | ||
38331 | if(!dev->win_size) { | |
38332 | err("Cant allocate memory window"); | |
38333 | - pcmciamtd_release((u_long)link); | |
38334 | + pcmciamtd_release(link); | |
38335 | return; | |
38336 | } | |
38337 | DEBUG(1, "Allocated a window of %dKiB", dev->win_size >> 10); | |
38338 | @@ -576,7 +575,7 @@ | |
38339 | dev->win_base = ioremap(req.Base, req.Size); | |
38340 | if(!dev->win_base) { | |
38341 | err("ioremap(%lu, %u) failed", req.Base, req.Size); | |
38342 | - pcmciamtd_release((u_long)link); | |
38343 | + pcmciamtd_release(link); | |
38344 | return; | |
38345 | } | |
38346 | DEBUG(1, "mapped window dev = %p req.base = 0x%lx base = %p size = 0x%x", | |
38347 | @@ -631,7 +630,7 @@ | |
38348 | ||
38349 | if(!mtd) { | |
38350 | DEBUG(1, "Cant find an MTD"); | |
38351 | - pcmciamtd_release((u_long)link); | |
38352 | + pcmciamtd_release(link); | |
38353 | return; | |
38354 | } | |
38355 | ||
38356 | @@ -671,7 +670,7 @@ | |
38357 | map_destroy(mtd); | |
38358 | dev->mtd_info = NULL; | |
38359 | err("Couldnt register MTD device"); | |
38360 | - pcmciamtd_release((u_long)link); | |
38361 | + pcmciamtd_release(link); | |
38362 | return; | |
38363 | } | |
38364 | snprintf(dev->node.dev_name, sizeof(dev->node.dev_name), "mtd%d", mtd->index); | |
38365 | @@ -683,7 +682,7 @@ | |
38366 | cs_failed: | |
38367 | cs_error(link->handle, last_fn, last_ret); | |
38368 | err("CS Error, exiting"); | |
38369 | - pcmciamtd_release((u_long)link); | |
38370 | + pcmciamtd_release(link); | |
38371 | return; | |
38372 | } | |
38373 | ||
38374 | @@ -710,7 +709,7 @@ | |
38375 | del_mtd_device(dev->mtd_info); | |
38376 | info("mtd%d: Removed", dev->mtd_info->index); | |
38377 | } | |
38378 | - mod_timer(&link->release, jiffies + HZ/20); | |
38379 | + pcmciamtd_release(link); | |
38380 | } | |
38381 | break; | |
38382 | case CS_EVENT_CARD_INSERTION: | |
38383 | @@ -751,10 +750,8 @@ | |
38384 | { | |
38385 | DEBUG(3, "link=0x%p", link); | |
38386 | ||
38387 | - del_timer(&link->release); | |
38388 | - | |
38389 | if(link->state & DEV_CONFIG) { | |
38390 | - pcmciamtd_release((u_long)link); | |
38391 | + pcmciamtd_release(link); | |
38392 | } | |
38393 | ||
38394 | if (link->handle) { | |
38395 | @@ -789,10 +786,6 @@ | |
38396 | memset(dev, 0, sizeof(*dev)); | |
38397 | link = &dev->link; | |
38398 | link->priv = dev; | |
38399 | - | |
38400 | - init_timer(&link->release); | |
38401 | - link->release.function = &pcmciamtd_release; | |
38402 | - link->release.data = (u_long)link; | |
38403 | ||
38404 | link->conf.Attributes = 0; | |
38405 | link->conf.IntType = INT_MEMORY; | |
38406 | diff -Nru a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c | |
38407 | --- a/drivers/mtd/mtdchar.c Wed May 28 08:01:05 2003 | |
38408 | +++ b/drivers/mtd/mtdchar.c Tue Aug 26 09:25:41 2003 | |
38409 | @@ -59,7 +59,7 @@ | |
38410 | ||
38411 | static int mtd_open(struct inode *inode, struct file *file) | |
38412 | { | |
38413 | - int minor = minor(inode->i_rdev); | |
38414 | + int minor = iminor(inode); | |
38415 | int devnum = minor >> 1; | |
38416 | struct mtd_info *mtd; | |
38417 | ||
38418 | diff -Nru a/drivers/mtd/nand/autcpu12.c b/drivers/mtd/nand/autcpu12.c | |
38419 | --- a/drivers/mtd/nand/autcpu12.c Mon Jun 23 05:34:08 2003 | |
38420 | +++ b/drivers/mtd/nand/autcpu12.c Sun Aug 31 16:14:08 2003 | |
38421 | @@ -73,39 +73,39 @@ | |
38422 | extern struct nand_oobinfo jffs2_oobinfo; | |
38423 | ||
38424 | static struct mtd_partition partition_info16k[] = { | |
38425 | - { name: "AUTCPU12 flash partition 1", | |
38426 | - offset: 0, | |
38427 | - size: 8 * SZ_1M }, | |
38428 | - { name: "AUTCPU12 flash partition 2", | |
38429 | - offset: 8 * SZ_1M, | |
38430 | - size: 8 * SZ_1M }, | |
38431 | + { .name = "AUTCPU12 flash partition 1", | |
38432 | + .offset = 0, | |
38433 | + .size = 8 * SZ_1M }, | |
38434 | + { .name = "AUTCPU12 flash partition 2", | |
38435 | + .offset = 8 * SZ_1M, | |
38436 | + .size = 8 * SZ_1M }, | |
38437 | }; | |
38438 | ||
38439 | static struct mtd_partition partition_info32k[] = { | |
38440 | - { name: "AUTCPU12 flash partition 1", | |
38441 | - offset: 0, | |
38442 | - size: 8 * SZ_1M }, | |
38443 | - { name: "AUTCPU12 flash partition 2", | |
38444 | - offset: 8 * SZ_1M, | |
38445 | - size: 24 * SZ_1M }, | |
38446 | + { .name = "AUTCPU12 flash partition 1", | |
38447 | + .offset = 0, | |
38448 | + .size = 8 * SZ_1M }, | |
38449 | + { .name = "AUTCPU12 flash partition 2", | |
38450 | + .offset = 8 * SZ_1M, | |
38451 | + .size = 24 * SZ_1M }, | |
38452 | }; | |
38453 | ||
38454 | static struct mtd_partition partition_info64k[] = { | |
38455 | - { name: "AUTCPU12 flash partition 1", | |
38456 | - offset: 0, | |
38457 | - size: 16 * SZ_1M }, | |
38458 | - { name: "AUTCPU12 flash partition 2", | |
38459 | - offset: 16 * SZ_1M, | |
38460 | - size: 48 * SZ_1M }, | |
38461 | + { .name = "AUTCPU12 flash partition 1", | |
38462 | + .offset = 0, | |
38463 | + .size = 16 * SZ_1M }, | |
38464 | + { .name = "AUTCPU12 flash partition 2", | |
38465 | + .offset = 16 * SZ_1M, | |
38466 | + .size = 48 * SZ_1M }, | |
38467 | }; | |
38468 | ||
38469 | static struct mtd_partition partition_info128k[] = { | |
38470 | - { name: "AUTCPU12 flash partition 1", | |
38471 | - offset: 0, | |
38472 | - size: 16 * SZ_1M }, | |
38473 | - { name: "AUTCPU12 flash partition 2", | |
38474 | - offset: 16 * SZ_1M, | |
38475 | - size: 112 * SZ_1M }, | |
38476 | + { .name = "AUTCPU12 flash partition 1", | |
38477 | + .offset = 0, | |
38478 | + .size = 16 * SZ_1M }, | |
38479 | + { .name = "AUTCPU12 flash partition 2", | |
38480 | + .offset = 16 * SZ_1M, | |
38481 | + .size = 112 * SZ_1M }, | |
38482 | }; | |
38483 | ||
38484 | #define NUM_PARTITIONS16K 2 | |
38485 | diff -Nru a/drivers/mtd/nand/edb7312.c b/drivers/mtd/nand/edb7312.c | |
38486 | --- a/drivers/mtd/nand/edb7312.c Wed May 28 08:01:25 2003 | |
38487 | +++ b/drivers/mtd/nand/edb7312.c Sun Aug 31 16:14:08 2003 | |
38488 | @@ -71,9 +71,9 @@ | |
38489 | * Define static partitions for flash device | |
38490 | */ | |
38491 | static struct mtd_partition partition_info[] = { | |
38492 | - { name: "EP7312 Nand Flash", | |
38493 | - offset: 0, | |
38494 | - size: 8*1024*1024 } | |
38495 | + { .name = "EP7312 Nand Flash", | |
38496 | + .offset = 0, | |
38497 | + .size = 8*1024*1024 } | |
38498 | }; | |
38499 | #define NUM_PARTITIONS 1 | |
38500 | ||
38501 | diff -Nru a/drivers/net/3c501.c b/drivers/net/3c501.c | |
38502 | --- a/drivers/net/3c501.c Sun Apr 20 22:41:08 2003 | |
38503 | +++ b/drivers/net/3c501.c Tue Aug 26 13:21:28 2003 | |
38504 | @@ -307,7 +307,7 @@ | |
38505 | dev->stop = &el1_close; | |
38506 | dev->get_stats = &el1_get_stats; | |
38507 | dev->set_multicast_list = &set_multicast_list; | |
38508 | - dev->do_ioctl = netdev_ioctl; | |
38509 | + dev->ethtool_ops = &netdev_ethtool_ops; | |
38510 | ||
38511 | /* | |
38512 | * Setup the generic properties | |
38513 | @@ -857,86 +857,31 @@ | |
38514 | } | |
38515 | } | |
38516 | ||
38517 | -/** | |
38518 | - * netdev_ethtool_ioctl: Handle network interface SIOCETHTOOL ioctls | |
38519 | - * @dev: network interface on which out-of-band action is to be performed | |
38520 | - * @useraddr: userspace address to which data is to be read and returned | |
38521 | - * | |
38522 | - * Process the various commands of the SIOCETHTOOL interface. | |
38523 | - */ | |
38524 | ||
38525 | -static int netdev_ethtool_ioctl (struct net_device *dev, void *useraddr) | |
38526 | +static void netdev_get_drvinfo(struct net_device *dev, | |
38527 | + struct ethtool_drvinfo *info) | |
38528 | { | |
38529 | - u32 ethcmd; | |
38530 | - | |
38531 | - /* dev_ioctl() in ../../net/core/dev.c has already checked | |
38532 | - capable(CAP_NET_ADMIN), so don't bother with that here. */ | |
38533 | - | |
38534 | - if (get_user(ethcmd, (u32 *)useraddr)) | |
38535 | - return -EFAULT; | |
38536 | - | |
38537 | - switch (ethcmd) { | |
38538 | - | |
38539 | - case ETHTOOL_GDRVINFO: { | |
38540 | - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; | |
38541 | - strcpy (info.driver, DRV_NAME); | |
38542 | - strcpy (info.version, DRV_VERSION); | |
38543 | - sprintf(info.bus_info, "ISA 0x%lx", dev->base_addr); | |
38544 | - if (copy_to_user (useraddr, &info, sizeof (info))) | |
38545 | - return -EFAULT; | |
38546 | - return 0; | |
38547 | - } | |
38548 | - | |
38549 | - /* get message-level */ | |
38550 | - case ETHTOOL_GMSGLVL: { | |
38551 | - struct ethtool_value edata = {ETHTOOL_GMSGLVL}; | |
38552 | - edata.data = debug; | |
38553 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
38554 | - return -EFAULT; | |
38555 | - return 0; | |
38556 | - } | |
38557 | - /* set message-level */ | |
38558 | - case ETHTOOL_SMSGLVL: { | |
38559 | - struct ethtool_value edata; | |
38560 | - if (copy_from_user(&edata, useraddr, sizeof(edata))) | |
38561 | - return -EFAULT; | |
38562 | - debug = edata.data; | |
38563 | - return 0; | |
38564 | - } | |
38565 | - | |
38566 | - default: | |
38567 | - break; | |
38568 | - } | |
38569 | - | |
38570 | - return -EOPNOTSUPP; | |
38571 | + strcpy(info->driver, DRV_NAME); | |
38572 | + strcpy(info->version, DRV_VERSION); | |
38573 | + sprintf(info->bus_info, "ISA 0x%lx", dev->base_addr); | |
38574 | } | |
38575 | ||
38576 | -/** | |
38577 | - * netdev_ioctl: Handle network interface ioctls | |
38578 | - * @dev: network interface on which out-of-band action is to be performed | |
38579 | - * @rq: user request data | |
38580 | - * @cmd: command issued by user | |
38581 | - * | |
38582 | - * Process the various out-of-band ioctls passed to this driver. | |
38583 | - */ | |
38584 | +static u32 netdev_get_msglevel(struct net_device *dev) | |
38585 | +{ | |
38586 | + return debug; | |
38587 | +} | |
38588 | ||
38589 | -static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |
38590 | +static void netdev_set_msglevel(struct net_device *dev, u32 level) | |
38591 | { | |
38592 | - int rc = 0; | |
38593 | + debug = level; | |
38594 | +} | |
38595 | ||
38596 | - switch (cmd) { | |
38597 | - case SIOCETHTOOL: | |
38598 | - rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); | |
38599 | - break; | |
38600 | - | |
38601 | - default: | |
38602 | - rc = -EOPNOTSUPP; | |
38603 | - break; | |
38604 | - } | |
38605 | +static struct ethtool_ops netdev_ethtool_ops = { | |
38606 | + .get_drvinfo = netdev_get_drvinfo, | |
38607 | + .get_msglevel = netdev_get_msglevel, | |
38608 | + .set_msglevel = netdev_set_msglevel, | |
38609 | +}; | |
38610 | ||
38611 | - return rc; | |
38612 | -} | |
38613 | - | |
38614 | #ifdef MODULE | |
38615 | ||
38616 | static struct net_device dev_3c501 = { | |
38617 | diff -Nru a/drivers/net/3c501.h b/drivers/net/3c501.h | |
38618 | --- a/drivers/net/3c501.h Sun Apr 20 22:41:08 2003 | |
38619 | +++ b/drivers/net/3c501.h Tue Aug 26 13:21:28 2003 | |
38620 | @@ -14,7 +14,7 @@ | |
38621 | static int el1_close(struct net_device *dev); | |
38622 | static struct net_device_stats *el1_get_stats(struct net_device *dev); | |
38623 | static void set_multicast_list(struct net_device *dev); | |
38624 | -static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd); | |
38625 | +static struct ethtool_ops netdev_ethtool_ops; | |
38626 | ||
38627 | #define EL1_IO_EXTENT 16 | |
38628 | ||
38629 | diff -Nru a/drivers/net/3c503.c b/drivers/net/3c503.c | |
38630 | --- a/drivers/net/3c503.c Mon Feb 24 10:34:15 2003 | |
38631 | +++ b/drivers/net/3c503.c Tue Aug 26 13:29:32 2003 | |
38632 | @@ -80,7 +80,7 @@ | |
38633 | int ring_offset); | |
38634 | static void el2_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, | |
38635 | int ring_page); | |
38636 | -static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd); | |
38637 | +static struct ethtool_ops netdev_ethtool_ops; | |
38638 | ||
38639 | \f | |
38640 | /* This routine probes for a memory-mapped 3c503 board by looking for | |
38641 | @@ -308,7 +308,7 @@ | |
38642 | ||
38643 | dev->open = &el2_open; | |
38644 | dev->stop = &el2_close; | |
38645 | - dev->do_ioctl = &netdev_ioctl; | |
38646 | + dev->ethtool_ops = &netdev_ethtool_ops; | |
38647 | ||
38648 | if (dev->mem_start) | |
38649 | printk("%s: %s - %dkB RAM, 8kB shared mem window at %#6lx-%#6lx.\n", | |
38650 | @@ -617,69 +617,18 @@ | |
38651 | return; | |
38652 | } | |
38653 | ||
38654 | -/** | |
38655 | - * netdev_ethtool_ioctl: Handle network interface SIOCETHTOOL ioctls | |
38656 | - * @dev: network interface on which out-of-band action is to be performed | |
38657 | - * @useraddr: userspace address to which data is to be read and returned | |
38658 | - * | |
38659 | - * Process the various commands of the SIOCETHTOOL interface. | |
38660 | - */ | |
38661 | ||
38662 | -static int netdev_ethtool_ioctl (struct net_device *dev, void *useraddr) | |
38663 | +static void netdev_get_drvinfo(struct net_device *dev, | |
38664 | + struct ethtool_drvinfo *info) | |
38665 | { | |
38666 | - u32 ethcmd; | |
38667 | - | |
38668 | - /* dev_ioctl() in ../../net/core/dev.c has already checked | |
38669 | - capable(CAP_NET_ADMIN), so don't bother with that here. */ | |
38670 | - | |
38671 | - if (get_user(ethcmd, (u32 *)useraddr)) | |
38672 | - return -EFAULT; | |
38673 | - | |
38674 | - switch (ethcmd) { | |
38675 | - | |
38676 | - case ETHTOOL_GDRVINFO: { | |
38677 | - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; | |
38678 | - strcpy (info.driver, DRV_NAME); | |
38679 | - strcpy (info.version, DRV_VERSION); | |
38680 | - sprintf(info.bus_info, "ISA 0x%lx", dev->base_addr); | |
38681 | - if (copy_to_user (useraddr, &info, sizeof (info))) | |
38682 | - return -EFAULT; | |
38683 | - return 0; | |
38684 | - } | |
38685 | - | |
38686 | - default: | |
38687 | - break; | |
38688 | - } | |
38689 | - | |
38690 | - return -EOPNOTSUPP; | |
38691 | + strcpy(info->driver, DRV_NAME); | |
38692 | + strcpy(info->version, DRV_VERSION); | |
38693 | + sprintf(info->bus_info, "ISA 0x%lx", dev->base_addr); | |
38694 | } | |
38695 | ||
38696 | -/** | |
38697 | - * netdev_ioctl: Handle network interface ioctls | |
38698 | - * @dev: network interface on which out-of-band action is to be performed | |
38699 | - * @rq: user request data | |
38700 | - * @cmd: command issued by user | |
38701 | - * | |
38702 | - * Process the various out-of-band ioctls passed to this driver. | |
38703 | - */ | |
38704 | - | |
38705 | -static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |
38706 | -{ | |
38707 | - int rc = 0; | |
38708 | - | |
38709 | - switch (cmd) { | |
38710 | - case SIOCETHTOOL: | |
38711 | - rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); | |
38712 | - break; | |
38713 | - | |
38714 | - default: | |
38715 | - rc = -EOPNOTSUPP; | |
38716 | - break; | |
38717 | - } | |
38718 | - | |
38719 | - return rc; | |
38720 | -} | |
38721 | - | |
38722 | +static struct ethtool_ops netdev_ethtool_ops = { | |
38723 | + .get_drvinfo = netdev_get_drvinfo, | |
38724 | +}; | |
38725 | ||
38726 | #ifdef MODULE | |
38727 | #define MAX_EL2_CARDS 4 /* Max number of EL2 cards per module */ | |
38728 | diff -Nru a/drivers/net/3c505.c b/drivers/net/3c505.c | |
38729 | --- a/drivers/net/3c505.c Wed Jun 4 06:07:40 2003 | |
38730 | +++ b/drivers/net/3c505.c Tue Aug 26 13:29:32 2003 | |
38731 | @@ -1163,86 +1163,30 @@ | |
38732 | return &adapter->stats; | |
38733 | } | |
38734 | ||
38735 | -/** | |
38736 | - * netdev_ethtool_ioctl: Handle network interface SIOCETHTOOL ioctls | |
38737 | - * @dev: network interface on which out-of-band action is to be performed | |
38738 | - * @useraddr: userspace address to which data is to be read and returned | |
38739 | - * | |
38740 | - * Process the various commands of the SIOCETHTOOL interface. | |
38741 | - */ | |
38742 | - | |
38743 | -static int netdev_ethtool_ioctl (struct net_device *dev, void *useraddr) | |
38744 | -{ | |
38745 | - u32 ethcmd; | |
38746 | - | |
38747 | - /* dev_ioctl() in ../../net/core/dev.c has already checked | |
38748 | - capable(CAP_NET_ADMIN), so don't bother with that here. */ | |
38749 | - | |
38750 | - if (get_user(ethcmd, (u32 *)useraddr)) | |
38751 | - return -EFAULT; | |
38752 | - | |
38753 | - switch (ethcmd) { | |
38754 | - | |
38755 | - case ETHTOOL_GDRVINFO: { | |
38756 | - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; | |
38757 | - strcpy (info.driver, DRV_NAME); | |
38758 | - strcpy (info.version, DRV_VERSION); | |
38759 | - sprintf(info.bus_info, "ISA 0x%lx", dev->base_addr); | |
38760 | - if (copy_to_user (useraddr, &info, sizeof (info))) | |
38761 | - return -EFAULT; | |
38762 | - return 0; | |
38763 | - } | |
38764 | - | |
38765 | - /* get message-level */ | |
38766 | - case ETHTOOL_GMSGLVL: { | |
38767 | - struct ethtool_value edata = {ETHTOOL_GMSGLVL}; | |
38768 | - edata.data = debug; | |
38769 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
38770 | - return -EFAULT; | |
38771 | - return 0; | |
38772 | - } | |
38773 | - /* set message-level */ | |
38774 | - case ETHTOOL_SMSGLVL: { | |
38775 | - struct ethtool_value edata; | |
38776 | - if (copy_from_user(&edata, useraddr, sizeof(edata))) | |
38777 | - return -EFAULT; | |
38778 | - debug = edata.data; | |
38779 | - return 0; | |
38780 | - } | |
38781 | - | |
38782 | - default: | |
38783 | - break; | |
38784 | - } | |
38785 | ||
38786 | - return -EOPNOTSUPP; | |
38787 | +static void netdev_get_drvinfo(struct net_device *dev, | |
38788 | + struct ethtool_drvinfo *info) | |
38789 | +{ | |
38790 | + strcpy(info->driver, DRV_NAME); | |
38791 | + strcpy(info->version, DRV_VERSION); | |
38792 | + sprintf(info->bus_info, "ISA 0x%lx", dev->base_addr); | |
38793 | } | |
38794 | ||
38795 | -/** | |
38796 | - * netdev_ioctl: Handle network interface ioctls | |
38797 | - * @dev: network interface on which out-of-band action is to be performed | |
38798 | - * @rq: user request data | |
38799 | - * @cmd: command issued by user | |
38800 | - * | |
38801 | - * Process the various out-of-band ioctls passed to this driver. | |
38802 | - */ | |
38803 | - | |
38804 | -static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |
38805 | -{ | |
38806 | - int rc = 0; | |
38807 | - | |
38808 | - switch (cmd) { | |
38809 | - case SIOCETHTOOL: | |
38810 | - rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); | |
38811 | - break; | |
38812 | - | |
38813 | - default: | |
38814 | - rc = -EOPNOTSUPP; | |
38815 | - break; | |
38816 | - } | |
38817 | +static u32 netdev_get_msglevel(struct net_device *dev) | |
38818 | +{ | |
38819 | + return debug; | |
38820 | +} | |
38821 | ||
38822 | - return rc; | |
38823 | +static void netdev_set_msglevel(struct net_device *dev, u32 level) | |
38824 | +{ | |
38825 | + debug = level; | |
38826 | } | |
38827 | - | |
38828 | + | |
38829 | +static struct ethtool_ops netdev_ethtool_ops = { | |
38830 | + .get_drvinfo = netdev_get_drvinfo, | |
38831 | + .get_msglevel = netdev_get_msglevel, | |
38832 | + .set_msglevel = netdev_set_msglevel, | |
38833 | +}; | |
38834 | ||
38835 | /****************************************************** | |
38836 | * | |
38837 | @@ -1373,7 +1317,7 @@ | |
38838 | dev->tx_timeout = elp_timeout; /* local */ | |
38839 | dev->watchdog_timeo = 10*HZ; | |
38840 | dev->set_multicast_list = elp_set_mc_list; /* local */ | |
38841 | - dev->do_ioctl = netdev_ioctl; /* local */ | |
38842 | + dev->ethtool_ops = &netdev_ethtool_ops; /* local */ | |
38843 | ||
38844 | /* Setup the generic properties */ | |
38845 | ether_setup(dev); | |
38846 | diff -Nru a/drivers/net/3c507.c b/drivers/net/3c507.c | |
38847 | --- a/drivers/net/3c507.c Sun Apr 20 22:41:08 2003 | |
38848 | +++ b/drivers/net/3c507.c Tue Aug 26 13:29:32 2003 | |
38849 | @@ -299,7 +299,7 @@ | |
38850 | ||
38851 | static void hardware_send_packet(struct net_device *dev, void *buf, short length, short pad); | |
38852 | static void init_82586_mem(struct net_device *dev); | |
38853 | -static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd); | |
38854 | +static struct ethtool_ops netdev_ethtool_ops; | |
38855 | ||
38856 | \f | |
38857 | /* Check for a network adaptor of this type, and return '0' iff one exists. | |
38858 | @@ -431,7 +431,7 @@ | |
38859 | dev->get_stats = el16_get_stats; | |
38860 | dev->tx_timeout = el16_tx_timeout; | |
38861 | dev->watchdog_timeo = TX_TIMEOUT; | |
38862 | - dev->do_ioctl = netdev_ioctl; | |
38863 | + dev->ethtool_ops = &netdev_ethtool_ops; | |
38864 | ||
38865 | ether_setup(dev); /* Generic ethernet behaviour */ | |
38866 | ||
38867 | @@ -874,86 +874,29 @@ | |
38868 | lp->rx_tail = rx_tail; | |
38869 | } | |
38870 | ||
38871 | -/** | |
38872 | - * netdev_ethtool_ioctl: Handle network interface SIOCETHTOOL ioctls | |
38873 | - * @dev: network interface on which out-of-band action is to be performed | |
38874 | - * @useraddr: userspace address to which data is to be read and returned | |
38875 | - * | |
38876 | - * Process the various commands of the SIOCETHTOOL interface. | |
38877 | - */ | |
38878 | - | |
38879 | -static int netdev_ethtool_ioctl (struct net_device *dev, void *useraddr) | |
38880 | -{ | |
38881 | - u32 ethcmd; | |
38882 | - | |
38883 | - /* dev_ioctl() in ../../net/core/dev.c has already checked | |
38884 | - capable(CAP_NET_ADMIN), so don't bother with that here. */ | |
38885 | - | |
38886 | - if (get_user(ethcmd, (u32 *)useraddr)) | |
38887 | - return -EFAULT; | |
38888 | - | |
38889 | - switch (ethcmd) { | |
38890 | - | |
38891 | - case ETHTOOL_GDRVINFO: { | |
38892 | - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; | |
38893 | - strcpy (info.driver, DRV_NAME); | |
38894 | - strcpy (info.version, DRV_VERSION); | |
38895 | - sprintf(info.bus_info, "ISA 0x%lx", dev->base_addr); | |
38896 | - if (copy_to_user (useraddr, &info, sizeof (info))) | |
38897 | - return -EFAULT; | |
38898 | - return 0; | |
38899 | - } | |
38900 | - | |
38901 | - /* get message-level */ | |
38902 | - case ETHTOOL_GMSGLVL: { | |
38903 | - struct ethtool_value edata = {ETHTOOL_GMSGLVL}; | |
38904 | - edata.data = debug; | |
38905 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
38906 | - return -EFAULT; | |
38907 | - return 0; | |
38908 | - } | |
38909 | - /* set message-level */ | |
38910 | - case ETHTOOL_SMSGLVL: { | |
38911 | - struct ethtool_value edata; | |
38912 | - if (copy_from_user(&edata, useraddr, sizeof(edata))) | |
38913 | - return -EFAULT; | |
38914 | - debug = edata.data; | |
38915 | - return 0; | |
38916 | - } | |
38917 | - | |
38918 | - default: | |
38919 | - break; | |
38920 | - } | |
38921 | - | |
38922 | - return -EOPNOTSUPP; | |
38923 | +static void netdev_get_drvinfo(struct net_device *dev, | |
38924 | + struct ethtool_drvinfo *info) | |
38925 | +{ | |
38926 | + strcpy(info->driver, DRV_NAME); | |
38927 | + strcpy(info->version, DRV_VERSION); | |
38928 | + sprintf(info->bus_info, "ISA 0x%lx", dev->base_addr); | |
38929 | } | |
38930 | ||
38931 | -/** | |
38932 | - * netdev_ioctl: Handle network interface ioctls | |
38933 | - * @dev: network interface on which out-of-band action is to be performed | |
38934 | - * @rq: user request data | |
38935 | - * @cmd: command issued by user | |
38936 | - * | |
38937 | - * Process the various out-of-band ioctls passed to this driver. | |
38938 | - */ | |
38939 | - | |
38940 | -static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |
38941 | +static u32 netdev_get_msglevel(struct net_device *dev) | |
38942 | { | |
38943 | - int rc = 0; | |
38944 | - | |
38945 | - switch (cmd) { | |
38946 | - case SIOCETHTOOL: | |
38947 | - rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); | |
38948 | - break; | |
38949 | - | |
38950 | - default: | |
38951 | - rc = -EOPNOTSUPP; | |
38952 | - break; | |
38953 | - } | |
38954 | + return debug; | |
38955 | +} | |
38956 | ||
38957 | - return rc; | |
38958 | +static void netdev_set_msglevel(struct net_device *dev, u32 level) | |
38959 | +{ | |
38960 | + debug = level; | |
38961 | } | |
38962 | - | |
38963 | + | |
38964 | +static struct ethtool_ops netdev_ethtool_ops = { | |
38965 | + .get_drvinfo = netdev_get_drvinfo, | |
38966 | + .get_msglevel = netdev_get_msglevel, | |
38967 | + .set_msglevel = netdev_set_msglevel, | |
38968 | +}; | |
38969 | ||
38970 | #ifdef MODULE | |
38971 | static struct net_device dev_3c507; | |
38972 | diff -Nru a/drivers/net/3c509.c b/drivers/net/3c509.c | |
38973 | --- a/drivers/net/3c509.c Tue Aug 19 20:53:14 2003 | |
38974 | +++ b/drivers/net/3c509.c Sun Aug 31 22:52:48 2003 | |
38975 | @@ -300,10 +300,11 @@ | |
38976 | * | |
38977 | * Both call el3_common_init/el3_common_remove. */ | |
38978 | ||
38979 | -static void __init el3_common_init(struct net_device *dev) | |
38980 | +static int __init el3_common_init(struct net_device *dev) | |
38981 | { | |
38982 | struct el3_private *lp = dev->priv; | |
38983 | short i; | |
38984 | + int err; | |
38985 | ||
38986 | spin_lock_init(&lp->lock); | |
38987 | ||
38988 | @@ -314,10 +315,29 @@ | |
38989 | dev->if_port |= (dev->mem_start & 0x08); | |
38990 | } | |
38991 | ||
38992 | + /* The EL3-specific entries in the device structure. */ | |
38993 | + dev->open = &el3_open; | |
38994 | + dev->hard_start_xmit = &el3_start_xmit; | |
38995 | + dev->stop = &el3_close; | |
38996 | + dev->get_stats = &el3_get_stats; | |
38997 | + dev->set_multicast_list = &set_multicast_list; | |
38998 | + dev->tx_timeout = el3_tx_timeout; | |
38999 | + dev->watchdog_timeo = TX_TIMEOUT; | |
39000 | + dev->do_ioctl = netdev_ioctl; | |
39001 | + | |
39002 | + err = register_netdev(dev); | |
39003 | + if (err) { | |
39004 | + printk(KERN_ERR "Failed to register 3c5x9 at %#3.3lx, IRQ %d.\n", | |
39005 | + dev->base_addr, dev->irq); | |
39006 | + release_region(dev->base_addr, EL3_IO_EXTENT); | |
39007 | + return err; | |
39008 | + } | |
39009 | + | |
39010 | { | |
39011 | const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"}; | |
39012 | - printk("%s: 3c5x9 at %#3.3lx, %s port, address ", | |
39013 | - dev->name, dev->base_addr, if_names[(dev->if_port & 0x03)]); | |
39014 | + printk("%s: 3c5x9 found at %#3.3lx, %s port, address ", | |
39015 | + dev->name, dev->base_addr, | |
39016 | + if_names[(dev->if_port & 0x03)]); | |
39017 | } | |
39018 | ||
39019 | /* Read in the station address. */ | |
39020 | @@ -327,16 +347,8 @@ | |
39021 | ||
39022 | if (el3_debug > 0) | |
39023 | printk(KERN_INFO "%s" KERN_INFO "%s", versionA, versionB); | |
39024 | + return 0; | |
39025 | ||
39026 | - /* The EL3-specific entries in the device structure. */ | |
39027 | - dev->open = &el3_open; | |
39028 | - dev->hard_start_xmit = &el3_start_xmit; | |
39029 | - dev->stop = &el3_close; | |
39030 | - dev->get_stats = &el3_get_stats; | |
39031 | - dev->set_multicast_list = &set_multicast_list; | |
39032 | - dev->tx_timeout = el3_tx_timeout; | |
39033 | - dev->watchdog_timeo = TX_TIMEOUT; | |
39034 | - dev->do_ioctl = netdev_ioctl; | |
39035 | } | |
39036 | ||
39037 | static void el3_common_remove (struct net_device *dev) | |
39038 | @@ -564,9 +576,8 @@ | |
39039 | #if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800) | |
39040 | lp->dev = &idev->dev; | |
39041 | #endif | |
39042 | - el3_common_init(dev); | |
39043 | + err = el3_common_init(dev); | |
39044 | ||
39045 | - err = register_netdev(dev); | |
39046 | if (err) | |
39047 | goto out1; | |
39048 | ||
39049 | @@ -588,7 +599,6 @@ | |
39050 | return 0; | |
39051 | ||
39052 | out1: | |
39053 | - release_region(ioaddr, EL3_IO_EXTENT); | |
39054 | #if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800) | |
39055 | if (idev) | |
39056 | pnp_device_detach(idev); | |
39057 | @@ -629,8 +639,8 @@ | |
39058 | el3_mca_adapter_names[mdev->index], slot + 1); | |
39059 | ||
39060 | /* claim the slot */ | |
39061 | - strncpy(device->name, el3_mca_adapter_names[mdev->index], | |
39062 | - sizeof(device->name)); | |
39063 | + strncpy(mdev->name, el3_mca_adapter_names[mdev->index], | |
39064 | + sizeof(mdev->name)); | |
39065 | mca_device_set_claim(mdev, 1); | |
39066 | ||
39067 | if_port = pos4 & 0x03; | |
39068 | @@ -662,11 +672,9 @@ | |
39069 | lp->dev = device; | |
39070 | lp->type = EL3_MCA; | |
39071 | device->driver_data = dev; | |
39072 | - el3_common_init(dev); | |
39073 | + err = el3_common_init(dev); | |
39074 | ||
39075 | - err = register_netdev(dev); | |
39076 | if (err) { | |
39077 | - release_region(ioaddr, EL3_IO_EXTENT); | |
39078 | return -ENOMEM; | |
39079 | } | |
39080 | ||
39081 | @@ -723,11 +731,9 @@ | |
39082 | lp->dev = device; | |
39083 | lp->type = EL3_EISA; | |
39084 | eisa_set_drvdata (edev, dev); | |
39085 | - el3_common_init(dev); | |
39086 | + err = el3_common_init(dev); | |
39087 | ||
39088 | - err = register_netdev(dev); | |
39089 | if (err) { | |
39090 | - release_region(ioaddr, EL3_IO_EXTENT); | |
39091 | return err; | |
39092 | } | |
39093 | ||
39094 | diff -Nru a/drivers/net/3c515.c b/drivers/net/3c515.c | |
39095 | --- a/drivers/net/3c515.c Tue Aug 19 20:53:14 2003 | |
39096 | +++ b/drivers/net/3c515.c Tue Sep 2 06:44:18 2003 | |
39097 | @@ -392,7 +392,7 @@ | |
39098 | static void update_stats(int addr, struct net_device *dev); | |
39099 | static struct net_device_stats *corkscrew_get_stats(struct net_device *dev); | |
39100 | static void set_rx_mode(struct net_device *dev); | |
39101 | -static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd); | |
39102 | +static struct ethtool_ops netdev_ethtool_ops; | |
39103 | \f | |
39104 | ||
39105 | /* | |
39106 | @@ -718,7 +718,7 @@ | |
39107 | dev->stop = &corkscrew_close; | |
39108 | dev->get_stats = &corkscrew_get_stats; | |
39109 | dev->set_multicast_list = &set_rx_mode; | |
39110 | - dev->do_ioctl = netdev_ioctl; | |
39111 | + dev->ethtool_ops = &netdev_ethtool_ops; | |
39112 | ||
39113 | return 0; | |
39114 | } | |
39115 | @@ -1580,86 +1580,30 @@ | |
39116 | outw(new_mode, ioaddr + EL3_CMD); | |
39117 | } | |
39118 | ||
39119 | -/** | |
39120 | - * netdev_ethtool_ioctl: Handle network interface SIOCETHTOOL ioctls | |
39121 | - * @dev: network interface on which out-of-band action is to be performed | |
39122 | - * @useraddr: userspace address to which data is to be read and returned | |
39123 | - * | |
39124 | - * Process the various commands of the SIOCETHTOOL interface. | |
39125 | - */ | |
39126 | - | |
39127 | -static int netdev_ethtool_ioctl (struct net_device *dev, void *useraddr) | |
39128 | +static void netdev_get_drvinfo(struct net_device *dev, | |
39129 | + struct ethtool_drvinfo *info) | |
39130 | { | |
39131 | - u32 ethcmd; | |
39132 | - | |
39133 | - /* dev_ioctl() in ../../net/core/dev.c has already checked | |
39134 | - capable(CAP_NET_ADMIN), so don't bother with that here. */ | |
39135 | - | |
39136 | - if (get_user(ethcmd, (u32 *)useraddr)) | |
39137 | - return -EFAULT; | |
39138 | - | |
39139 | - switch (ethcmd) { | |
39140 | - | |
39141 | - case ETHTOOL_GDRVINFO: { | |
39142 | - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; | |
39143 | - strcpy (info.driver, DRV_NAME); | |
39144 | - strcpy (info.version, DRV_VERSION); | |
39145 | - sprintf(info.bus_info, "ISA 0x%lx", dev->base_addr); | |
39146 | - if (copy_to_user (useraddr, &info, sizeof (info))) | |
39147 | - return -EFAULT; | |
39148 | - return 0; | |
39149 | - } | |
39150 | - | |
39151 | - /* get message-level */ | |
39152 | - case ETHTOOL_GMSGLVL: { | |
39153 | - struct ethtool_value edata = {ETHTOOL_GMSGLVL}; | |
39154 | - edata.data = corkscrew_debug; | |
39155 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
39156 | - return -EFAULT; | |
39157 | - return 0; | |
39158 | - } | |
39159 | - /* set message-level */ | |
39160 | - case ETHTOOL_SMSGLVL: { | |
39161 | - struct ethtool_value edata; | |
39162 | - if (copy_from_user(&edata, useraddr, sizeof(edata))) | |
39163 | - return -EFAULT; | |
39164 | - corkscrew_debug = edata.data; | |
39165 | - return 0; | |
39166 | - } | |
39167 | - | |
39168 | - default: | |
39169 | - break; | |
39170 | - } | |
39171 | - | |
39172 | - return -EOPNOTSUPP; | |
39173 | + strcpy(info->driver, DRV_NAME); | |
39174 | + strcpy(info->version, DRV_VERSION); | |
39175 | + sprintf(info->bus_info, "ISA 0x%lx", dev->base_addr); | |
39176 | } | |
39177 | ||
39178 | -/** | |
39179 | - * netdev_ioctl: Handle network interface ioctls | |
39180 | - * @dev: network interface on which out-of-band action is to be performed | |
39181 | - * @rq: user request data | |
39182 | - * @cmd: command issued by user | |
39183 | - * | |
39184 | - * Process the various out-of-band ioctls passed to this driver. | |
39185 | - */ | |
39186 | - | |
39187 | -static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |
39188 | +static u32 netdev_get_msglevel(struct net_device *dev) | |
39189 | { | |
39190 | - int rc = 0; | |
39191 | + return corkscrew_debug; | |
39192 | +} | |
39193 | ||
39194 | - switch (cmd) { | |
39195 | - case SIOCETHTOOL: | |
39196 | - rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); | |
39197 | - break; | |
39198 | +static void netdev_set_msglevel(struct net_device *dev, u32 level) | |
39199 | +{ | |
39200 | + corkscrew_debug = level; | |
39201 | +} | |
39202 | ||
39203 | - default: | |
39204 | - rc = -EOPNOTSUPP; | |
39205 | - break; | |
39206 | - } | |
39207 | +static struct ethtool_ops netdev_ethtool_ops = { | |
39208 | + .get_drvinfo = netdev_get_drvinfo, | |
39209 | + .get_msglevel = netdev_get_msglevel, | |
39210 | + .set_msglevel = netdev_set_msglevel, | |
39211 | +}; | |
39212 | ||
39213 | - return rc; | |
39214 | -} | |
39215 | - | |
39216 | \f | |
39217 | #ifdef MODULE | |
39218 | void cleanup_module(void) | |
39219 | diff -Nru a/drivers/net/3c523.c b/drivers/net/3c523.c | |
39220 | --- a/drivers/net/3c523.c Sun Apr 27 20:36:18 2003 | |
39221 | +++ b/drivers/net/3c523.c Tue Aug 26 13:42:22 2003 | |
39222 | @@ -188,7 +188,7 @@ | |
39223 | #ifdef ELMC_MULTICAST | |
39224 | static void set_multicast_list(struct net_device *dev); | |
39225 | #endif | |
39226 | -static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd); | |
39227 | +static struct ethtool_ops netdev_ethtool_ops; | |
39228 | ||
39229 | /* helper-functions */ | |
39230 | static int init586(struct net_device *dev); | |
39231 | @@ -571,7 +571,7 @@ | |
39232 | #else | |
39233 | dev->set_multicast_list = NULL; | |
39234 | #endif | |
39235 | - dev->do_ioctl = netdev_ioctl; | |
39236 | + dev->ethtool_ops = &netdev_ethtool_ops; | |
39237 | ||
39238 | ether_setup(dev); | |
39239 | ||
39240 | @@ -1228,70 +1228,17 @@ | |
39241 | } | |
39242 | #endif | |
39243 | ||
39244 | -/** | |
39245 | - * netdev_ethtool_ioctl: Handle network interface SIOCETHTOOL ioctls | |
39246 | - * @dev: network interface on which out-of-band action is to be performed | |
39247 | - * @useraddr: userspace address to which data is to be read and returned | |
39248 | - * | |
39249 | - * Process the various commands of the SIOCETHTOOL interface. | |
39250 | - */ | |
39251 | - | |
39252 | -static int netdev_ethtool_ioctl (struct net_device *dev, void *useraddr) | |
39253 | +static void netdev_get_drvinfo(struct net_device *dev, | |
39254 | + struct ethtool_drvinfo *info) | |
39255 | { | |
39256 | - u32 ethcmd; | |
39257 | - | |
39258 | - /* dev_ioctl() in ../../net/core/dev.c has already checked | |
39259 | - capable(CAP_NET_ADMIN), so don't bother with that here. */ | |
39260 | - | |
39261 | - if (get_user(ethcmd, (u32 *)useraddr)) | |
39262 | - return -EFAULT; | |
39263 | - | |
39264 | - switch (ethcmd) { | |
39265 | - | |
39266 | - case ETHTOOL_GDRVINFO: { | |
39267 | - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; | |
39268 | - strcpy (info.driver, DRV_NAME); | |
39269 | - strcpy (info.version, DRV_VERSION); | |
39270 | - sprintf(info.bus_info, "MCA 0x%lx", dev->base_addr); | |
39271 | - if (copy_to_user (useraddr, &info, sizeof (info))) | |
39272 | - return -EFAULT; | |
39273 | - return 0; | |
39274 | - } | |
39275 | - | |
39276 | - default: | |
39277 | - break; | |
39278 | - } | |
39279 | - | |
39280 | - return -EOPNOTSUPP; | |
39281 | + strcpy(info->driver, DRV_NAME); | |
39282 | + strcpy(info->version, DRV_VERSION); | |
39283 | + sprintf(info->bus_info, "MCA 0x%lx", dev->base_addr); | |
39284 | } | |
39285 | ||
39286 | -/** | |
39287 | - * netdev_ioctl: Handle network interface ioctls | |
39288 | - * @dev: network interface on which out-of-band action is to be performed | |
39289 | - * @rq: user request data | |
39290 | - * @cmd: command issued by user | |
39291 | - * | |
39292 | - * Process the various out-of-band ioctls passed to this driver. | |
39293 | - */ | |
39294 | - | |
39295 | -static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |
39296 | -{ | |
39297 | - int rc = 0; | |
39298 | - | |
39299 | - switch (cmd) { | |
39300 | - case SIOCETHTOOL: | |
39301 | - rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); | |
39302 | - break; | |
39303 | - | |
39304 | - default: | |
39305 | - rc = -EOPNOTSUPP; | |
39306 | - break; | |
39307 | - } | |
39308 | - | |
39309 | - return rc; | |
39310 | -} | |
39311 | - | |
39312 | -/*************************************************************************/ | |
39313 | +static struct ethtool_ops netdev_ethtool_ops = { | |
39314 | + .get_drvinfo = netdev_get_drvinfo, | |
39315 | +}; | |
39316 | ||
39317 | #ifdef MODULE | |
39318 | ||
39319 | diff -Nru a/drivers/net/3c527.c b/drivers/net/3c527.c | |
39320 | --- a/drivers/net/3c527.c Sun Apr 27 20:36:18 2003 | |
39321 | +++ b/drivers/net/3c527.c Sun Aug 31 06:34:16 2003 | |
39322 | @@ -218,7 +218,7 @@ | |
39323 | static struct net_device_stats *mc32_get_stats(struct net_device *dev); | |
39324 | static void mc32_set_multicast_list(struct net_device *dev); | |
39325 | static void mc32_reset_multicast_list(struct net_device *dev); | |
39326 | -static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd); | |
39327 | +static struct ethtool_ops netdev_ethtool_ops; | |
39328 | ||
39329 | /** | |
39330 | * mc32_probe - Search for supported boards | |
39331 | @@ -508,7 +508,7 @@ | |
39332 | dev->set_multicast_list = mc32_set_multicast_list; | |
39333 | dev->tx_timeout = mc32_timeout; | |
39334 | dev->watchdog_timeo = HZ*5; /* Board does all the work */ | |
39335 | - dev->do_ioctl = netdev_ioctl; | |
39336 | + dev->ethtool_ops = &netdev_ethtool_ops; | |
39337 | ||
39338 | lp->xceiver_state = HALTED; | |
39339 | ||
39340 | @@ -1081,14 +1081,15 @@ | |
39341 | /* NP is the buffer we will be loading */ | |
39342 | np=lp->tx_ring[lp->tx_ring_head].p; | |
39343 | ||
39344 | - /* We will need this to flush the buffer out */ | |
39345 | - lp->tx_ring[lp->tx_ring_head].skb=skb; | |
39346 | - | |
39347 | if (skb->len < ETH_ZLEN) { | |
39348 | skb = skb_padto(skb, ETH_ZLEN); | |
39349 | if (skb == NULL) | |
39350 | goto out; | |
39351 | } | |
39352 | + | |
39353 | + /* We will need this to flush the buffer out */ | |
39354 | + lp->tx_ring[lp->tx_ring_head].skb = skb; | |
39355 | + | |
39356 | np->length = (skb->len < ETH_ZLEN) ? ETH_ZLEN : skb->len; | |
39357 | ||
39358 | np->data = isa_virt_to_bus(skb->data); | |
39359 | @@ -1655,86 +1656,30 @@ | |
39360 | do_mc32_set_multicast_list(dev,1); | |
39361 | } | |
39362 | ||
39363 | -/** | |
39364 | - * netdev_ethtool_ioctl: Handle network interface SIOCETHTOOL ioctls | |
39365 | - * @dev: network interface on which out-of-band action is to be performed | |
39366 | - * @useraddr: userspace address to which data is to be read and returned | |
39367 | - * | |
39368 | - * Process the various commands of the SIOCETHTOOL interface. | |
39369 | - */ | |
39370 | - | |
39371 | -static int netdev_ethtool_ioctl (struct net_device *dev, void *useraddr) | |
39372 | +static void netdev_get_drvinfo(struct net_device *dev, | |
39373 | + struct ethtool_drvinfo *info) | |
39374 | { | |
39375 | - u32 ethcmd; | |
39376 | - | |
39377 | - /* dev_ioctl() in ../../net/core/dev.c has already checked | |
39378 | - capable(CAP_NET_ADMIN), so don't bother with that here. */ | |
39379 | - | |
39380 | - if (get_user(ethcmd, (u32 *)useraddr)) | |
39381 | - return -EFAULT; | |
39382 | - | |
39383 | - switch (ethcmd) { | |
39384 | - | |
39385 | - case ETHTOOL_GDRVINFO: { | |
39386 | - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; | |
39387 | - strcpy (info.driver, DRV_NAME); | |
39388 | - strcpy (info.version, DRV_VERSION); | |
39389 | - sprintf(info.bus_info, "MCA 0x%lx", dev->base_addr); | |
39390 | - if (copy_to_user (useraddr, &info, sizeof (info))) | |
39391 | - return -EFAULT; | |
39392 | - return 0; | |
39393 | - } | |
39394 | - | |
39395 | - /* get message-level */ | |
39396 | - case ETHTOOL_GMSGLVL: { | |
39397 | - struct ethtool_value edata = {ETHTOOL_GMSGLVL}; | |
39398 | - edata.data = mc32_debug; | |
39399 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
39400 | - return -EFAULT; | |
39401 | - return 0; | |
39402 | - } | |
39403 | - /* set message-level */ | |
39404 | - case ETHTOOL_SMSGLVL: { | |
39405 | - struct ethtool_value edata; | |
39406 | - if (copy_from_user(&edata, useraddr, sizeof(edata))) | |
39407 | - return -EFAULT; | |
39408 | - mc32_debug = edata.data; | |
39409 | - return 0; | |
39410 | - } | |
39411 | - | |
39412 | - default: | |
39413 | - break; | |
39414 | - } | |
39415 | - | |
39416 | - return -EOPNOTSUPP; | |
39417 | + strcpy(info->driver, DRV_NAME); | |
39418 | + strcpy(info->version, DRV_VERSION); | |
39419 | + sprintf(info->bus_info, "MCA 0x%lx", dev->base_addr); | |
39420 | } | |
39421 | ||
39422 | -/** | |
39423 | - * netdev_ioctl: Handle network interface ioctls | |
39424 | - * @dev: network interface on which out-of-band action is to be performed | |
39425 | - * @rq: user request data | |
39426 | - * @cmd: command issued by user | |
39427 | - * | |
39428 | - * Process the various out-of-band ioctls passed to this driver. | |
39429 | - */ | |
39430 | +static u32 netdev_get_msglevel(struct net_device *dev) | |
39431 | +{ | |
39432 | + return mc32_debug; | |
39433 | +} | |
39434 | ||
39435 | -static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |
39436 | +static void netdev_set_msglevel(struct net_device *dev, u32 level) | |
39437 | { | |
39438 | - int rc = 0; | |
39439 | + mc32_debug = level; | |
39440 | +} | |
39441 | ||
39442 | - switch (cmd) { | |
39443 | - case SIOCETHTOOL: | |
39444 | - rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); | |
39445 | - break; | |
39446 | +static struct ethtool_ops netdev_ethtool_ops = { | |
39447 | + .get_drvinfo = netdev_get_drvinfo, | |
39448 | + .get_msglevel = netdev_get_msglevel, | |
39449 | + .set_msglevel = netdev_set_msglevel, | |
39450 | +}; | |
39451 | ||
39452 | - default: | |
39453 | - rc = -EOPNOTSUPP; | |
39454 | - break; | |
39455 | - } | |
39456 | - | |
39457 | - return rc; | |
39458 | -} | |
39459 | - | |
39460 | #ifdef MODULE | |
39461 | ||
39462 | static struct net_device this_device; | |
39463 | diff -Nru a/drivers/net/3c59x.c b/drivers/net/3c59x.c | |
39464 | --- a/drivers/net/3c59x.c Tue Aug 19 20:53:15 2003 | |
39465 | +++ b/drivers/net/3c59x.c Tue Aug 26 11:23:22 2003 | |
39466 | @@ -900,6 +900,7 @@ | |
39467 | static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | |
39468 | static void vortex_tx_timeout(struct net_device *dev); | |
39469 | static void acpi_set_WOL(struct net_device *dev); | |
39470 | +static struct ethtool_ops vortex_ethtool_ops; | |
39471 | \f | |
39472 | /* This driver uses 'options' to pass the media type, full-duplex flag, etc. */ | |
39473 | /* Option count limit only -- unlimited interfaces are supported. */ | |
39474 | @@ -1445,6 +1446,7 @@ | |
39475 | dev->stop = vortex_close; | |
39476 | dev->get_stats = vortex_get_stats; | |
39477 | dev->do_ioctl = vortex_ioctl; | |
39478 | + dev->ethtool_ops = &vortex_ethtool_ops; | |
39479 | dev->set_multicast_list = set_rx_mode; | |
39480 | dev->tx_timeout = vortex_tx_timeout; | |
39481 | dev->watchdog_timeo = (watchdog * HZ) / 1000; | |
39482 | @@ -2816,38 +2818,28 @@ | |
39483 | } | |
39484 | ||
39485 | ||
39486 | -static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr) | |
39487 | +static void vortex_get_drvinfo(struct net_device *dev, | |
39488 | + struct ethtool_drvinfo *info) | |
39489 | { | |
39490 | struct vortex_private *vp = dev->priv; | |
39491 | - u32 ethcmd; | |
39492 | - | |
39493 | - if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd))) | |
39494 | - return -EFAULT; | |
39495 | ||
39496 | - switch (ethcmd) { | |
39497 | - case ETHTOOL_GDRVINFO: { | |
39498 | - struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO}; | |
39499 | - strcpy(info.driver, DRV_NAME); | |
39500 | - strcpy(info.version, DRV_VERSION); | |
39501 | - if (VORTEX_PCI(vp)) | |
39502 | - strcpy(info.bus_info, pci_name(VORTEX_PCI(vp))); | |
39503 | - else { | |
39504 | - if (VORTEX_EISA(vp)) | |
39505 | - sprintf (info.bus_info, vp->gendev->bus_id); | |
39506 | - else | |
39507 | - sprintf(info.bus_info, "EISA 0x%lx %d", | |
39508 | - dev->base_addr, dev->irq); | |
39509 | - } | |
39510 | - if (copy_to_user(useraddr, &info, sizeof(info))) | |
39511 | - return -EFAULT; | |
39512 | - return 0; | |
39513 | + strcpy(info->driver, DRV_NAME); | |
39514 | + strcpy(info->version, DRV_VERSION); | |
39515 | + if (VORTEX_PCI(vp)) { | |
39516 | + strcpy(info->bus_info, pci_name(VORTEX_PCI(vp))); | |
39517 | + } else { | |
39518 | + if (VORTEX_EISA(vp)) | |
39519 | + sprintf(info->bus_info, vp->gendev->bus_id); | |
39520 | + else | |
39521 | + sprintf(info->bus_info, "EISA 0x%lx %d", | |
39522 | + dev->base_addr, dev->irq); | |
39523 | } | |
39524 | - | |
39525 | - } | |
39526 | - | |
39527 | - return -EOPNOTSUPP; | |
39528 | } | |
39529 | ||
39530 | +static struct ethtool_ops vortex_ethtool_ops = { | |
39531 | + .get_drvinfo = vortex_get_drvinfo, | |
39532 | +}; | |
39533 | + | |
39534 | static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |
39535 | { | |
39536 | struct vortex_private *vp = (struct vortex_private *)dev->priv; | |
39537 | @@ -2857,9 +2849,6 @@ | |
39538 | int retval; | |
39539 | ||
39540 | switch(cmd) { | |
39541 | - case SIOCETHTOOL: | |
39542 | - return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); | |
39543 | - | |
39544 | case SIOCGMIIPHY: /* Get address of MII PHY in use. */ | |
39545 | data->phy_id = phy; | |
39546 | ||
39547 | diff -Nru a/drivers/net/8139cp.c b/drivers/net/8139cp.c | |
39548 | --- a/drivers/net/8139cp.c Tue Aug 19 20:13:55 2003 | |
39549 | +++ b/drivers/net/8139cp.c Mon Sep 1 17:25:54 2003 | |
39550 | @@ -24,15 +24,13 @@ | |
39551 | PCI suspend/resume - Felipe Damasio <felipewd@terra.com.br> | |
39552 | LinkChg interrupt - Felipe Damasio <felipewd@terra.com.br> | |
39553 | ||
39554 | - TODO, in rough priority order: | |
39555 | + TODO: | |
39556 | * Test Tx checksumming thoroughly | |
39557 | - * dev->tx_timeout | |
39558 | - * Constants (module parms?) for Rx work limit | |
39559 | + * Implement dev->tx_timeout | |
39560 | + | |
39561 | + Low priority TODO: | |
39562 | * Complete reset on PciErr | |
39563 | * Consider Rx interrupt mitigation using TimerIntr | |
39564 | - * Implement 8139C+ statistics dump; maybe not... | |
39565 | - h/w stats can be reset only by software reset | |
39566 | - * Handle netif_rx return value | |
39567 | * Investigate using skb->priority with h/w VLAN priority | |
39568 | * Investigate using High Priority Tx Queue with skb->priority | |
39569 | * Adjust Rx FIFO threshold and Max Rx DMA burst on Rx FIFO error | |
39570 | @@ -41,14 +39,17 @@ | |
39571 | Tx descriptor bit | |
39572 | * The real minimum of CP_MIN_MTU is 4 bytes. However, | |
39573 | for this to be supported, one must(?) turn on packet padding. | |
39574 | - * Support 8169 GMII | |
39575 | - * Support external MII transceivers | |
39576 | + * Support external MII transceivers (patch available) | |
39577 | + | |
39578 | + NOTES: | |
39579 | + * TX checksumming is considered experimental. It is off by | |
39580 | + default, use ethtool to turn it on. | |
39581 | ||
39582 | */ | |
39583 | ||
39584 | #define DRV_NAME "8139cp" | |
39585 | -#define DRV_VERSION "0.3.0" | |
39586 | -#define DRV_RELDATE "Sep 29, 2002" | |
39587 | +#define DRV_VERSION "1.1" | |
39588 | +#define DRV_RELDATE "Aug 30, 2003" | |
39589 | ||
39590 | ||
39591 | #include <linux/config.h> | |
39592 | @@ -71,9 +72,6 @@ | |
39593 | #include <asm/io.h> | |
39594 | #include <asm/uaccess.h> | |
39595 | ||
39596 | -/* experimental TX checksumming feature enable/disable */ | |
39597 | -#undef CP_TX_CHECKSUM | |
39598 | - | |
39599 | /* VLAN tagging feature enable/disable */ | |
39600 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | |
39601 | #define CP_VLAN_TAG_USED 1 | |
39602 | @@ -86,7 +84,7 @@ | |
39603 | #endif | |
39604 | ||
39605 | /* These identify the driver base version and may not be removed. */ | |
39606 | -static char version[] __devinitdata = | |
39607 | +static char version[] = | |
39608 | KERN_INFO DRV_NAME ": 10/100 PCI Ethernet driver v" DRV_VERSION " (" DRV_RELDATE ")\n"; | |
39609 | ||
39610 | MODULE_AUTHOR("Jeff Garzik <jgarzik@pobox.com>"); | |
39611 | @@ -160,6 +158,7 @@ | |
39612 | TxConfig = 0x40, /* Tx configuration */ | |
39613 | ChipVersion = 0x43, /* 8-bit chip version, inside TxConfig */ | |
39614 | RxConfig = 0x44, /* Rx configuration */ | |
39615 | + RxMissed = 0x4C, /* 24 bits valid, write clears */ | |
39616 | Cfg9346 = 0x50, /* EEPROM select/control; Cfg reg [un]lock */ | |
39617 | Config1 = 0x52, /* Config1 */ | |
39618 | Config3 = 0x59, /* Config3 */ | |
39619 | @@ -292,12 +291,11 @@ | |
39620 | UWF = (1 << 4), /* Accept Unicast wakeup frame */ | |
39621 | LANWake = (1 << 1), /* Enable LANWake signal */ | |
39622 | PMEStatus = (1 << 0), /* PME status can be reset by PCI RST# */ | |
39623 | -}; | |
39624 | ||
39625 | -static const unsigned int cp_intr_mask = | |
39626 | - PciErr | LinkChg | | |
39627 | - RxOK | RxErr | RxEmpty | RxFIFOOvr | | |
39628 | - TxOK | TxErr | TxEmpty; | |
39629 | + cp_norx_intr_mask = PciErr | LinkChg | TxOK | TxErr | TxEmpty, | |
39630 | + cp_rx_intr_mask = RxOK | RxErr | RxEmpty | RxFIFOOvr, | |
39631 | + cp_intr_mask = cp_rx_intr_mask | cp_norx_intr_mask, | |
39632 | +}; | |
39633 | ||
39634 | static const unsigned int cp_rx_config = | |
39635 | (RX_FIFO_THRESH << RxCfgFIFOShift) | | |
39636 | @@ -364,11 +362,7 @@ | |
39637 | ||
39638 | struct pci_dev *pdev; | |
39639 | u32 rx_config; | |
39640 | - | |
39641 | - struct sk_buff *frag_skb; | |
39642 | - unsigned dropping_frag : 1; | |
39643 | - unsigned pci_using_dac : 1; | |
39644 | - unsigned int board_type; | |
39645 | + u16 cpcmd; | |
39646 | ||
39647 | unsigned int wol_enabled : 1; /* Is Wake-on-LAN enabled? */ | |
39648 | u32 power_state[16]; | |
39649 | @@ -400,28 +394,9 @@ | |
39650 | static void cp_tx (struct cp_private *cp); | |
39651 | static void cp_clean_rings (struct cp_private *cp); | |
39652 | ||
39653 | -enum board_type { | |
39654 | - RTL8139Cp, | |
39655 | - RTL8169, | |
39656 | -}; | |
39657 | - | |
39658 | -static struct cp_board_info { | |
39659 | - const char *name; | |
39660 | -} cp_board_tbl[] __devinitdata = { | |
39661 | - /* RTL8139Cp */ | |
39662 | - { "RTL-8139C+" }, | |
39663 | - | |
39664 | - /* RTL8169 */ | |
39665 | - { "RTL-8169" }, | |
39666 | -}; | |
39667 | - | |
39668 | static struct pci_device_id cp_pci_tbl[] = { | |
39669 | { PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139, | |
39670 | - PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139Cp }, | |
39671 | -#if 0 | |
39672 | - { PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8169, | |
39673 | - PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8169 }, | |
39674 | -#endif | |
39675 | + PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, | |
39676 | { }, | |
39677 | }; | |
39678 | MODULE_DEVICE_TABLE(pci, cp_pci_tbl); | |
39679 | @@ -446,6 +421,31 @@ | |
39680 | }; | |
39681 | ||
39682 | ||
39683 | +#if CP_VLAN_TAG_USED | |
39684 | +static void cp_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) | |
39685 | +{ | |
39686 | + struct cp_private *cp = dev->priv; | |
39687 | + | |
39688 | + spin_lock_irq(&cp->lock); | |
39689 | + cp->vlgrp = grp; | |
39690 | + cp->cpcmd |= RxVlanOn; | |
39691 | + cpw16(CpCmd, cp->cpcmd); | |
39692 | + spin_unlock_irq(&cp->lock); | |
39693 | +} | |
39694 | + | |
39695 | +static void cp_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |
39696 | +{ | |
39697 | + struct cp_private *cp = dev->priv; | |
39698 | + | |
39699 | + spin_lock_irq(&cp->lock); | |
39700 | + cp->cpcmd &= ~RxVlanOn; | |
39701 | + cpw16(CpCmd, cp->cpcmd); | |
39702 | + if (cp->vlgrp) | |
39703 | + cp->vlgrp->vlan_devices[vid] = NULL; | |
39704 | + spin_unlock_irq(&cp->lock); | |
39705 | +} | |
39706 | +#endif /* CP_VLAN_TAG_USED */ | |
39707 | + | |
39708 | static inline void cp_set_rxbufsize (struct cp_private *cp) | |
39709 | { | |
39710 | unsigned int mtu = cp->dev->mtu; | |
39711 | @@ -468,10 +468,11 @@ | |
39712 | ||
39713 | #if CP_VLAN_TAG_USED | |
39714 | if (cp->vlgrp && (desc->opts2 & RxVlanTagged)) { | |
39715 | - vlan_hwaccel_rx(skb, cp->vlgrp, be16_to_cpu(desc->opts2 & 0xffff)); | |
39716 | + vlan_hwaccel_receive_skb(skb, cp->vlgrp, | |
39717 | + be16_to_cpu(desc->opts2 & 0xffff)); | |
39718 | } else | |
39719 | #endif | |
39720 | - netif_rx(skb); | |
39721 | + netif_receive_skb(skb); | |
39722 | } | |
39723 | ||
39724 | static void cp_rx_err_acct (struct cp_private *cp, unsigned rx_tail, | |
39725 | @@ -486,81 +487,14 @@ | |
39726 | cp->net_stats.rx_frame_errors++; | |
39727 | if (status & RxErrCRC) | |
39728 | cp->net_stats.rx_crc_errors++; | |
39729 | - if (status & RxErrRunt) | |
39730 | + if ((status & RxErrRunt) || (status & RxErrLong)) | |
39731 | cp->net_stats.rx_length_errors++; | |
39732 | - if (status & RxErrLong) | |
39733 | + if ((status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag)) | |
39734 | cp->net_stats.rx_length_errors++; | |
39735 | if (status & RxErrFIFO) | |
39736 | cp->net_stats.rx_fifo_errors++; | |
39737 | } | |
39738 | ||
39739 | -static void cp_rx_frag (struct cp_private *cp, unsigned rx_tail, | |
39740 | - struct sk_buff *skb, u32 status, u32 len) | |
39741 | -{ | |
39742 | - struct sk_buff *copy_skb, *frag_skb = cp->frag_skb; | |
39743 | - unsigned orig_len = frag_skb ? frag_skb->len : 0; | |
39744 | - unsigned target_len = orig_len + len; | |
39745 | - unsigned first_frag = status & FirstFrag; | |
39746 | - unsigned last_frag = status & LastFrag; | |
39747 | - | |
39748 | - if (netif_msg_rx_status (cp)) | |
39749 | - printk (KERN_DEBUG "%s: rx %s%sfrag, slot %d status 0x%x len %d\n", | |
39750 | - cp->dev->name, | |
39751 | - cp->dropping_frag ? "dropping " : "", | |
39752 | - first_frag ? "first " : | |
39753 | - last_frag ? "last " : "", | |
39754 | - rx_tail, status, len); | |
39755 | - | |
39756 | - cp->cp_stats.rx_frags++; | |
39757 | - | |
39758 | - if (!frag_skb && !first_frag) | |
39759 | - cp->dropping_frag = 1; | |
39760 | - if (cp->dropping_frag) | |
39761 | - goto drop_frag; | |
39762 | - | |
39763 | - copy_skb = dev_alloc_skb (target_len + RX_OFFSET); | |
39764 | - if (!copy_skb) { | |
39765 | - printk(KERN_WARNING "%s: rx slot %d alloc failed\n", | |
39766 | - cp->dev->name, rx_tail); | |
39767 | - | |
39768 | - cp->dropping_frag = 1; | |
39769 | -drop_frag: | |
39770 | - if (frag_skb) { | |
39771 | - dev_kfree_skb_irq(frag_skb); | |
39772 | - cp->frag_skb = NULL; | |
39773 | - } | |
39774 | - if (last_frag) { | |
39775 | - cp->net_stats.rx_dropped++; | |
39776 | - cp->dropping_frag = 0; | |
39777 | - } | |
39778 | - return; | |
39779 | - } | |
39780 | - | |
39781 | - copy_skb->dev = cp->dev; | |
39782 | - skb_reserve(copy_skb, RX_OFFSET); | |
39783 | - skb_put(copy_skb, target_len); | |
39784 | - if (frag_skb) { | |
39785 | - memcpy(copy_skb->data, frag_skb->data, orig_len); | |
39786 | - dev_kfree_skb_irq(frag_skb); | |
39787 | - } | |
39788 | - pci_dma_sync_single(cp->pdev, cp->rx_skb[rx_tail].mapping, | |
39789 | - len, PCI_DMA_FROMDEVICE); | |
39790 | - memcpy(copy_skb->data + orig_len, skb->data, len); | |
39791 | - | |
39792 | - copy_skb->ip_summed = CHECKSUM_NONE; | |
39793 | - | |
39794 | - if (last_frag) { | |
39795 | - if (status & (RxError | RxErrFIFO)) { | |
39796 | - cp_rx_err_acct(cp, rx_tail, status, len); | |
39797 | - dev_kfree_skb_irq(copy_skb); | |
39798 | - } else | |
39799 | - cp_rx_skb(cp, copy_skb, &cp->rx_ring[rx_tail]); | |
39800 | - cp->frag_skb = NULL; | |
39801 | - } else { | |
39802 | - cp->frag_skb = copy_skb; | |
39803 | - } | |
39804 | -} | |
39805 | - | |
39806 | static inline unsigned int cp_rx_csum_ok (u32 status) | |
39807 | { | |
39808 | unsigned int protocol = (status >> 16) & 0x3; | |
39809 | @@ -574,12 +508,18 @@ | |
39810 | return 0; | |
39811 | } | |
39812 | ||
39813 | -static void cp_rx (struct cp_private *cp) | |
39814 | +static int cp_rx_poll (struct net_device *dev, int *budget) | |
39815 | { | |
39816 | + struct cp_private *cp = dev->priv; | |
39817 | unsigned rx_tail = cp->rx_tail; | |
39818 | - unsigned rx_work = 100; | |
39819 | + unsigned rx_work = dev->quota; | |
39820 | + unsigned rx; | |
39821 | + | |
39822 | +rx_status_loop: | |
39823 | + rx = 0; | |
39824 | + cpw16(IntrStatus, cp_rx_intr_mask); | |
39825 | ||
39826 | - while (rx_work--) { | |
39827 | + while (1) { | |
39828 | u32 status, len; | |
39829 | dma_addr_t mapping; | |
39830 | struct sk_buff *skb, *new_skb; | |
39831 | @@ -599,7 +539,14 @@ | |
39832 | mapping = cp->rx_skb[rx_tail].mapping; | |
39833 | ||
39834 | if ((status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag)) { | |
39835 | - cp_rx_frag(cp, rx_tail, skb, status, len); | |
39836 | + /* we don't support incoming fragmented frames. | |
39837 | + * instead, we attempt to ensure that the | |
39838 | + * pre-allocated RX skbs are properly sized such | |
39839 | + * that RX fragments are never encountered | |
39840 | + */ | |
39841 | + cp_rx_err_acct(cp, rx_tail, status, len); | |
39842 | + cp->net_stats.rx_dropped++; | |
39843 | + cp->cp_stats.rx_frags++; | |
39844 | goto rx_next; | |
39845 | } | |
39846 | ||
39847 | @@ -640,6 +587,7 @@ | |
39848 | cp->rx_skb[rx_tail].skb = new_skb; | |
39849 | ||
39850 | cp_rx_skb(cp, skb, desc); | |
39851 | + rx++; | |
39852 | ||
39853 | rx_next: | |
39854 | cp->rx_ring[rx_tail].opts2 = 0; | |
39855 | @@ -650,12 +598,30 @@ | |
39856 | else | |
39857 | desc->opts1 = cpu_to_le32(DescOwn | cp->rx_buf_sz); | |
39858 | rx_tail = NEXT_RX(rx_tail); | |
39859 | - } | |
39860 | ||
39861 | - if (!rx_work) | |
39862 | - printk(KERN_WARNING "%s: rx work limit reached\n", cp->dev->name); | |
39863 | + if (!rx_work--) | |
39864 | + break; | |
39865 | + } | |
39866 | ||
39867 | cp->rx_tail = rx_tail; | |
39868 | + | |
39869 | + dev->quota -= rx; | |
39870 | + *budget -= rx; | |
39871 | + | |
39872 | + /* if we did not reach work limit, then we're done with | |
39873 | + * this round of polling | |
39874 | + */ | |
39875 | + if (rx_work) { | |
39876 | + if (cpr16(IntrStatus) & cp_rx_intr_mask) | |
39877 | + goto rx_status_loop; | |
39878 | + | |
39879 | + cpw16_f(IntrMask, cp_intr_mask); | |
39880 | + netif_rx_complete(dev); | |
39881 | + | |
39882 | + return 0; /* done */ | |
39883 | + } | |
39884 | + | |
39885 | + return 1; /* not done */ | |
39886 | } | |
39887 | ||
39888 | static irqreturn_t | |
39889 | @@ -673,12 +639,16 @@ | |
39890 | printk(KERN_DEBUG "%s: intr, status %04x cmd %02x cpcmd %04x\n", | |
39891 | dev->name, status, cpr8(Cmd), cpr16(CpCmd)); | |
39892 | ||
39893 | - cpw16_f(IntrStatus, status); | |
39894 | + cpw16(IntrStatus, status & ~cp_rx_intr_mask); | |
39895 | ||
39896 | spin_lock(&cp->lock); | |
39897 | ||
39898 | - if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr)) | |
39899 | - cp_rx(cp); | |
39900 | + if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr)) { | |
39901 | + if (netif_rx_schedule_prep(dev)) { | |
39902 | + cpw16_f(IntrMask, cp_norx_intr_mask); | |
39903 | + __netif_rx_schedule(dev); | |
39904 | + } | |
39905 | + } | |
39906 | if (status & (TxOK | TxErr | TxEmpty | SWInt)) | |
39907 | cp_tx(cp); | |
39908 | if (status & LinkChg) | |
39909 | @@ -691,6 +661,8 @@ | |
39910 | pci_write_config_word(cp->pdev, PCI_STATUS, pci_status); | |
39911 | printk(KERN_ERR "%s: PCI bus error, status=%04x, PCI status=%04x\n", | |
39912 | dev->name, status, pci_status); | |
39913 | + | |
39914 | + /* TODO: reset hardware */ | |
39915 | } | |
39916 | ||
39917 | spin_unlock(&cp->lock); | |
39918 | @@ -750,7 +722,7 @@ | |
39919 | ||
39920 | cp->tx_tail = tx_tail; | |
39921 | ||
39922 | - if (netif_queue_stopped(cp->dev) && (TX_BUFFS_AVAIL(cp) > (MAX_SKB_FRAGS + 1))) | |
39923 | + if (TX_BUFFS_AVAIL(cp) > (MAX_SKB_FRAGS + 1)) | |
39924 | netif_wake_queue(cp->dev); | |
39925 | } | |
39926 | ||
39927 | @@ -792,7 +764,6 @@ | |
39928 | txd->addr = cpu_to_le64(mapping); | |
39929 | wmb(); | |
39930 | ||
39931 | -#ifdef CP_TX_CHECKSUM | |
39932 | if (skb->ip_summed == CHECKSUM_HW) { | |
39933 | const struct iphdr *ip = skb->nh.iph; | |
39934 | if (ip->protocol == IPPROTO_TCP) | |
39935 | @@ -806,7 +777,6 @@ | |
39936 | else | |
39937 | BUG(); | |
39938 | } else | |
39939 | -#endif | |
39940 | txd->opts1 = cpu_to_le32(eor | len | DescOwn | | |
39941 | FirstFrag | LastFrag); | |
39942 | wmb(); | |
39943 | @@ -820,9 +790,7 @@ | |
39944 | u32 first_len, first_eor; | |
39945 | dma_addr_t first_mapping; | |
39946 | int frag, first_entry = entry; | |
39947 | -#ifdef CP_TX_CHECKSUM | |
39948 | const struct iphdr *ip = skb->nh.iph; | |
39949 | -#endif | |
39950 | ||
39951 | /* We must give this initial chunk to the device last. | |
39952 | * Otherwise we could race with the device. | |
39953 | @@ -848,7 +816,7 @@ | |
39954 | this_frag->page_offset), | |
39955 | len, PCI_DMA_TODEVICE); | |
39956 | eor = (entry == (CP_TX_RING_SIZE - 1)) ? RingEnd : 0; | |
39957 | -#ifdef CP_TX_CHECKSUM | |
39958 | + | |
39959 | if (skb->ip_summed == CHECKSUM_HW) { | |
39960 | ctrl = eor | len | DescOwn | IPCS; | |
39961 | if (ip->protocol == IPPROTO_TCP) | |
39962 | @@ -858,7 +826,6 @@ | |
39963 | else | |
39964 | BUG(); | |
39965 | } else | |
39966 | -#endif | |
39967 | ctrl = eor | len | DescOwn; | |
39968 | ||
39969 | if (frag == skb_shinfo(skb)->nr_frags - 1) | |
39970 | @@ -883,7 +850,6 @@ | |
39971 | txd->addr = cpu_to_le64(first_mapping); | |
39972 | wmb(); | |
39973 | ||
39974 | -#ifdef CP_TX_CHECKSUM | |
39975 | if (skb->ip_summed == CHECKSUM_HW) { | |
39976 | if (ip->protocol == IPPROTO_TCP) | |
39977 | txd->opts1 = cpu_to_le32(first_eor | first_len | | |
39978 | @@ -896,7 +862,6 @@ | |
39979 | else | |
39980 | BUG(); | |
39981 | } else | |
39982 | -#endif | |
39983 | txd->opts1 = cpu_to_le32(first_eor | first_len | | |
39984 | FirstFrag | DescOwn); | |
39985 | wmb(); | |
39986 | @@ -975,7 +940,9 @@ | |
39987 | ||
39988 | static void __cp_get_stats(struct cp_private *cp) | |
39989 | { | |
39990 | - /* XXX implement */ | |
39991 | + /* only lower 24 bits valid; write any value to clear */ | |
39992 | + cp->net_stats.rx_missed_errors += (cpr32 (RxMissed) & 0xffffff); | |
39993 | + cpw32 (RxMissed, 0); | |
39994 | } | |
39995 | ||
39996 | static struct net_device_stats *cp_get_stats(struct net_device *dev) | |
39997 | @@ -995,11 +962,10 @@ | |
39998 | { | |
39999 | struct net_device *dev = cp->dev; | |
40000 | ||
40001 | - cpw16(IntrMask, 0); | |
40002 | - cpr16(IntrMask); | |
40003 | + cpw16(IntrStatus, ~(cpr16(IntrStatus))); | |
40004 | + cpw16_f(IntrMask, 0); | |
40005 | cpw8(Cmd, 0); | |
40006 | - cpw16(CpCmd, 0); | |
40007 | - cpr16(CpCmd); | |
40008 | + cpw16_f(CpCmd, 0); | |
40009 | cpw16(IntrStatus, ~(cpr16(IntrStatus))); | |
40010 | synchronize_irq(dev->irq); | |
40011 | udelay(10); | |
40012 | @@ -1031,11 +997,7 @@ | |
40013 | ||
40014 | static inline void cp_start_hw (struct cp_private *cp) | |
40015 | { | |
40016 | - u16 pci_dac = cp->pci_using_dac ? PCIDAC : 0; | |
40017 | - if (cp->board_type == RTL8169) | |
40018 | - cpw16(CpCmd, pci_dac | PCIMulRW | RxChkSum); | |
40019 | - else | |
40020 | - cpw16(CpCmd, pci_dac | PCIMulRW | RxChkSum | CpRxOn | CpTxOn); | |
40021 | + cpw16(CpCmd, cp->cpcmd); | |
40022 | cpw8(Cmd, RxOn | TxOn); | |
40023 | } | |
40024 | ||
40025 | @@ -1059,13 +1021,10 @@ | |
40026 | ||
40027 | cpw8(Config1, cpr8(Config1) | DriverLoaded | PMEnable); | |
40028 | /* Disable Wake-on-LAN. Can be turned on with ETHTOOL_SWOL */ | |
40029 | - if (cp->board_type == RTL8139Cp) { | |
40030 | - cpw8(Config3, PARMEnable); | |
40031 | - cp->wol_enabled = 0; | |
40032 | - } | |
40033 | + cpw8(Config3, PARMEnable); | |
40034 | + cp->wol_enabled = 0; | |
40035 | + | |
40036 | cpw8(Config5, cpr8(Config5) & PMEStatus); | |
40037 | - if (cp->board_type == RTL8169) | |
40038 | - cpw16(RxMaxSize, cp->rx_buf_sz); | |
40039 | ||
40040 | cpw32_f(HiTxRingAddr, 0); | |
40041 | cpw32_f(HiTxRingAddr + 4, 0); | |
40042 | @@ -1258,8 +1217,6 @@ | |
40043 | ||
40044 | dev->mtu = new_mtu; | |
40045 | cp_set_rxbufsize(cp); /* set new rx buf size */ | |
40046 | - if (cp->board_type == RTL8169) | |
40047 | - cpw16(RxMaxSize, cp->rx_buf_sz); | |
40048 | ||
40049 | rc = cp_init_rings(cp); /* realloc and restart h/w */ | |
40050 | cp_start_hw(cp); | |
40051 | @@ -1304,8 +1261,8 @@ | |
40052 | } | |
40053 | ||
40054 | /* Set the ethtool Wake-on-LAN settings */ | |
40055 | -static void netdev_set_wol (struct cp_private *cp, | |
40056 | - const struct ethtool_wolinfo *wol) | |
40057 | +static int netdev_set_wol (struct cp_private *cp, | |
40058 | + const struct ethtool_wolinfo *wol) | |
40059 | { | |
40060 | u8 options; | |
40061 | ||
40062 | @@ -1332,6 +1289,8 @@ | |
40063 | cpw8 (Config5, options); | |
40064 | ||
40065 | cp->wol_enabled = (wol->wolopts) ? 1 : 0; | |
40066 | + | |
40067 | + return 0; | |
40068 | } | |
40069 | ||
40070 | /* Get the ethtool Wake-on-LAN settings */ | |
40071 | @@ -1357,308 +1316,205 @@ | |
40072 | if (options & MWF) wol->wolopts |= WAKE_MCAST; | |
40073 | } | |
40074 | ||
40075 | -static int cp_ethtool_ioctl (struct cp_private *cp, void *useraddr) | |
40076 | +static void cp_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info) | |
40077 | { | |
40078 | - u32 ethcmd; | |
40079 | + struct cp_private *cp = dev->priv; | |
40080 | ||
40081 | - /* dev_ioctl() in ../../net/core/dev.c has already checked | |
40082 | - capable(CAP_NET_ADMIN), so don't bother with that here. */ | |
40083 | + strcpy (info->driver, DRV_NAME); | |
40084 | + strcpy (info->version, DRV_VERSION); | |
40085 | + strcpy (info->bus_info, pci_name(cp->pdev)); | |
40086 | +} | |
40087 | ||
40088 | - if (get_user(ethcmd, (u32 *)useraddr)) | |
40089 | - return -EFAULT; | |
40090 | - | |
40091 | - switch (ethcmd) { | |
40092 | - | |
40093 | - case ETHTOOL_GDRVINFO: { | |
40094 | - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; | |
40095 | - strcpy (info.driver, DRV_NAME); | |
40096 | - strcpy (info.version, DRV_VERSION); | |
40097 | - strcpy (info.bus_info, pci_name(cp->pdev)); | |
40098 | - info.regdump_len = CP_REGS_SIZE; | |
40099 | - info.n_stats = CP_NUM_STATS; | |
40100 | - if (copy_to_user (useraddr, &info, sizeof (info))) | |
40101 | - return -EFAULT; | |
40102 | - return 0; | |
40103 | - } | |
40104 | +static int cp_get_regs_len(struct net_device *dev) | |
40105 | +{ | |
40106 | + return CP_REGS_SIZE; | |
40107 | +} | |
40108 | ||
40109 | - /* get settings */ | |
40110 | - case ETHTOOL_GSET: { | |
40111 | - struct ethtool_cmd ecmd = { ETHTOOL_GSET }; | |
40112 | - spin_lock_irq(&cp->lock); | |
40113 | - mii_ethtool_gset(&cp->mii_if, &ecmd); | |
40114 | - spin_unlock_irq(&cp->lock); | |
40115 | - if (copy_to_user(useraddr, &ecmd, sizeof(ecmd))) | |
40116 | - return -EFAULT; | |
40117 | - return 0; | |
40118 | - } | |
40119 | - /* set settings */ | |
40120 | - case ETHTOOL_SSET: { | |
40121 | - int r; | |
40122 | - struct ethtool_cmd ecmd; | |
40123 | - if (copy_from_user(&ecmd, useraddr, sizeof(ecmd))) | |
40124 | - return -EFAULT; | |
40125 | - spin_lock_irq(&cp->lock); | |
40126 | - r = mii_ethtool_sset(&cp->mii_if, &ecmd); | |
40127 | - spin_unlock_irq(&cp->lock); | |
40128 | - return r; | |
40129 | - } | |
40130 | - /* restart autonegotiation */ | |
40131 | - case ETHTOOL_NWAY_RST: { | |
40132 | - return mii_nway_restart(&cp->mii_if); | |
40133 | - } | |
40134 | - /* get link status */ | |
40135 | - case ETHTOOL_GLINK: { | |
40136 | - struct ethtool_value edata = {ETHTOOL_GLINK}; | |
40137 | - edata.data = mii_link_ok(&cp->mii_if); | |
40138 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
40139 | - return -EFAULT; | |
40140 | - return 0; | |
40141 | - } | |
40142 | +static int cp_get_stats_count (struct net_device *dev) | |
40143 | +{ | |
40144 | + return CP_NUM_STATS; | |
40145 | +} | |
40146 | ||
40147 | - /* get message-level */ | |
40148 | - case ETHTOOL_GMSGLVL: { | |
40149 | - struct ethtool_value edata = {ETHTOOL_GMSGLVL}; | |
40150 | - edata.data = cp->msg_enable; | |
40151 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
40152 | - return -EFAULT; | |
40153 | - return 0; | |
40154 | - } | |
40155 | - /* set message-level */ | |
40156 | - case ETHTOOL_SMSGLVL: { | |
40157 | - struct ethtool_value edata; | |
40158 | - if (copy_from_user(&edata, useraddr, sizeof(edata))) | |
40159 | - return -EFAULT; | |
40160 | - cp->msg_enable = edata.data; | |
40161 | - return 0; | |
40162 | - } | |
40163 | +static int cp_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |
40164 | +{ | |
40165 | + struct cp_private *cp = dev->priv; | |
40166 | + int rc; | |
40167 | ||
40168 | - /* NIC register dump */ | |
40169 | - case ETHTOOL_GREGS: { | |
40170 | - struct ethtool_regs regs; | |
40171 | - u8 *regbuf = kmalloc(CP_REGS_SIZE, GFP_KERNEL); | |
40172 | - int rc; | |
40173 | - | |
40174 | - if (!regbuf) | |
40175 | - return -ENOMEM; | |
40176 | - memset(regbuf, 0, CP_REGS_SIZE); | |
40177 | + spin_lock_irq(&cp->lock); | |
40178 | + rc = mii_ethtool_gset(&cp->mii_if, cmd); | |
40179 | + spin_unlock_irq(&cp->lock); | |
40180 | ||
40181 | - rc = copy_from_user(®s, useraddr, sizeof(regs)); | |
40182 | - if (rc) { | |
40183 | - rc = -EFAULT; | |
40184 | - goto err_out_gregs; | |
40185 | - } | |
40186 | - | |
40187 | - if (regs.len > CP_REGS_SIZE) | |
40188 | - regs.len = CP_REGS_SIZE; | |
40189 | - if (regs.len < CP_REGS_SIZE) { | |
40190 | - rc = -EINVAL; | |
40191 | - goto err_out_gregs; | |
40192 | - } | |
40193 | + return rc; | |
40194 | +} | |
40195 | ||
40196 | - regs.version = CP_REGS_VER; | |
40197 | - rc = copy_to_user(useraddr, ®s, sizeof(regs)); | |
40198 | - if (rc) { | |
40199 | - rc = -EFAULT; | |
40200 | - goto err_out_gregs; | |
40201 | - } | |
40202 | +static int cp_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |
40203 | +{ | |
40204 | + struct cp_private *cp = dev->priv; | |
40205 | + int rc; | |
40206 | ||
40207 | - useraddr += offsetof(struct ethtool_regs, data); | |
40208 | + spin_lock_irq(&cp->lock); | |
40209 | + rc = mii_ethtool_sset(&cp->mii_if, cmd); | |
40210 | + spin_unlock_irq(&cp->lock); | |
40211 | ||
40212 | - spin_lock_irq(&cp->lock); | |
40213 | - memcpy_fromio(regbuf, cp->regs, CP_REGS_SIZE); | |
40214 | - spin_unlock_irq(&cp->lock); | |
40215 | + return rc; | |
40216 | +} | |
40217 | ||
40218 | - if (copy_to_user(useraddr, regbuf, regs.len)) | |
40219 | - rc = -EFAULT; | |
40220 | +static int cp_nway_reset(struct net_device *dev) | |
40221 | +{ | |
40222 | + struct cp_private *cp = dev->priv; | |
40223 | + return mii_nway_restart(&cp->mii_if); | |
40224 | +} | |
40225 | ||
40226 | -err_out_gregs: | |
40227 | - kfree(regbuf); | |
40228 | - return rc; | |
40229 | - } | |
40230 | +static u32 cp_get_msglevel(struct net_device *dev) | |
40231 | +{ | |
40232 | + struct cp_private *cp = dev->priv; | |
40233 | + return cp->msg_enable; | |
40234 | +} | |
40235 | ||
40236 | - /* get/set RX checksumming */ | |
40237 | - case ETHTOOL_GRXCSUM: { | |
40238 | - struct ethtool_value edata = { ETHTOOL_GRXCSUM }; | |
40239 | - u16 cmd = cpr16(CpCmd) & RxChkSum; | |
40240 | - | |
40241 | - edata.data = cmd ? 1 : 0; | |
40242 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
40243 | - return -EFAULT; | |
40244 | - return 0; | |
40245 | - } | |
40246 | - case ETHTOOL_SRXCSUM: { | |
40247 | - struct ethtool_value edata; | |
40248 | - u16 cmd = cpr16(CpCmd), newcmd; | |
40249 | +static void cp_set_msglevel(struct net_device *dev, u32 value) | |
40250 | +{ | |
40251 | + struct cp_private *cp = dev->priv; | |
40252 | + cp->msg_enable = value; | |
40253 | +} | |
40254 | ||
40255 | - newcmd = cmd; | |
40256 | +static u32 cp_get_rx_csum(struct net_device *dev) | |
40257 | +{ | |
40258 | + struct cp_private *cp = dev->priv; | |
40259 | + return (cpr16(CpCmd) & RxChkSum) ? 1 : 0; | |
40260 | +} | |
40261 | ||
40262 | - if (copy_from_user(&edata, useraddr, sizeof(edata))) | |
40263 | - return -EFAULT; | |
40264 | +static int cp_set_rx_csum(struct net_device *dev, u32 data) | |
40265 | +{ | |
40266 | + struct cp_private *cp = dev->priv; | |
40267 | + u16 cmd = cp->cpcmd, newcmd; | |
40268 | ||
40269 | - if (edata.data) | |
40270 | - newcmd |= RxChkSum; | |
40271 | - else | |
40272 | - newcmd &= ~RxChkSum; | |
40273 | + newcmd = cmd; | |
40274 | ||
40275 | - if (newcmd == cmd) | |
40276 | - return 0; | |
40277 | + if (data) | |
40278 | + newcmd |= RxChkSum; | |
40279 | + else | |
40280 | + newcmd &= ~RxChkSum; | |
40281 | ||
40282 | + if (newcmd != cmd) { | |
40283 | spin_lock_irq(&cp->lock); | |
40284 | + cp->cpcmd = newcmd; | |
40285 | cpw16_f(CpCmd, newcmd); | |
40286 | spin_unlock_irq(&cp->lock); | |
40287 | } | |
40288 | ||
40289 | - /* get/set TX checksumming */ | |
40290 | - case ETHTOOL_GTXCSUM: { | |
40291 | - struct ethtool_value edata = { ETHTOOL_GTXCSUM }; | |
40292 | - | |
40293 | - edata.data = (cp->dev->features & NETIF_F_IP_CSUM) != 0; | |
40294 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
40295 | - return -EFAULT; | |
40296 | - return 0; | |
40297 | - } | |
40298 | - case ETHTOOL_STXCSUM: { | |
40299 | - struct ethtool_value edata; | |
40300 | - | |
40301 | - if (copy_from_user(&edata, useraddr, sizeof(edata))) | |
40302 | - return -EFAULT; | |
40303 | - | |
40304 | - if (edata.data) | |
40305 | - cp->dev->features |= NETIF_F_IP_CSUM; | |
40306 | - else | |
40307 | - cp->dev->features &= ~NETIF_F_IP_CSUM; | |
40308 | - | |
40309 | - return 0; | |
40310 | - } | |
40311 | + return 0; | |
40312 | +} | |
40313 | ||
40314 | - /* get/set scatter-gather */ | |
40315 | - case ETHTOOL_GSG: { | |
40316 | - struct ethtool_value edata = { ETHTOOL_GSG }; | |
40317 | - | |
40318 | - edata.data = (cp->dev->features & NETIF_F_SG) != 0; | |
40319 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
40320 | - return -EFAULT; | |
40321 | - return 0; | |
40322 | - } | |
40323 | - case ETHTOOL_SSG: { | |
40324 | - struct ethtool_value edata; | |
40325 | +static void cp_get_regs(struct net_device *dev, struct ethtool_regs *regs, | |
40326 | + void *p) | |
40327 | +{ | |
40328 | + struct cp_private *cp = dev->priv; | |
40329 | ||
40330 | - if (copy_from_user(&edata, useraddr, sizeof(edata))) | |
40331 | - return -EFAULT; | |
40332 | + if (regs->len < CP_REGS_SIZE) | |
40333 | + return /* -EINVAL */; | |
40334 | ||
40335 | - if (edata.data) | |
40336 | - cp->dev->features |= NETIF_F_SG; | |
40337 | - else | |
40338 | - cp->dev->features &= ~NETIF_F_SG; | |
40339 | + regs->version = CP_REGS_VER; | |
40340 | ||
40341 | - return 0; | |
40342 | - } | |
40343 | + spin_lock_irq(&cp->lock); | |
40344 | + memcpy_fromio(p, cp->regs, CP_REGS_SIZE); | |
40345 | + spin_unlock_irq(&cp->lock); | |
40346 | +} | |
40347 | ||
40348 | - /* get string list(s) */ | |
40349 | - case ETHTOOL_GSTRINGS: { | |
40350 | - struct ethtool_gstrings estr = { ETHTOOL_GSTRINGS }; | |
40351 | - | |
40352 | - if (copy_from_user(&estr, useraddr, sizeof(estr))) | |
40353 | - return -EFAULT; | |
40354 | - if (estr.string_set != ETH_SS_STATS) | |
40355 | - return -EINVAL; | |
40356 | - | |
40357 | - estr.len = CP_NUM_STATS; | |
40358 | - if (copy_to_user(useraddr, &estr, sizeof(estr))) | |
40359 | - return -EFAULT; | |
40360 | - if (copy_to_user(useraddr + sizeof(estr), | |
40361 | - ðtool_stats_keys, | |
40362 | - sizeof(ethtool_stats_keys))) | |
40363 | - return -EFAULT; | |
40364 | - return 0; | |
40365 | - } | |
40366 | +static void cp_get_wol (struct net_device *dev, struct ethtool_wolinfo *wol) | |
40367 | +{ | |
40368 | + struct cp_private *cp = dev->priv; | |
40369 | ||
40370 | - /* get NIC-specific statistics */ | |
40371 | - case ETHTOOL_GSTATS: { | |
40372 | - struct ethtool_stats estats = { ETHTOOL_GSTATS }; | |
40373 | - u64 *tmp_stats; | |
40374 | - unsigned int work = 100; | |
40375 | - const unsigned int sz = sizeof(u64) * CP_NUM_STATS; | |
40376 | - int i; | |
40377 | - | |
40378 | - /* begin NIC statistics dump */ | |
40379 | - cpw32(StatsAddr + 4, 0); /* FIXME: 64-bit PCI */ | |
40380 | - cpw32(StatsAddr, cp->nic_stats_dma | DumpStats); | |
40381 | - cpr32(StatsAddr); | |
40382 | - | |
40383 | - estats.n_stats = CP_NUM_STATS; | |
40384 | - if (copy_to_user(useraddr, &estats, sizeof(estats))) | |
40385 | - return -EFAULT; | |
40386 | - | |
40387 | - while (work-- > 0) { | |
40388 | - if ((cpr32(StatsAddr) & DumpStats) == 0) | |
40389 | - break; | |
40390 | - cpu_relax(); | |
40391 | - } | |
40392 | + spin_lock_irq (&cp->lock); | |
40393 | + netdev_get_wol (cp, wol); | |
40394 | + spin_unlock_irq (&cp->lock); | |
40395 | +} | |
40396 | ||
40397 | - if (cpr32(StatsAddr) & DumpStats) | |
40398 | - return -EIO; | |
40399 | +static int cp_set_wol (struct net_device *dev, struct ethtool_wolinfo *wol) | |
40400 | +{ | |
40401 | + struct cp_private *cp = dev->priv; | |
40402 | + int rc; | |
40403 | ||
40404 | - tmp_stats = kmalloc(sz, GFP_KERNEL); | |
40405 | - if (!tmp_stats) | |
40406 | - return -ENOMEM; | |
40407 | - memset(tmp_stats, 0, sz); | |
40408 | - | |
40409 | - i = 0; | |
40410 | - tmp_stats[i++] = le64_to_cpu(cp->nic_stats->tx_ok); | |
40411 | - tmp_stats[i++] = le64_to_cpu(cp->nic_stats->rx_ok); | |
40412 | - tmp_stats[i++] = le64_to_cpu(cp->nic_stats->tx_err); | |
40413 | - tmp_stats[i++] = le32_to_cpu(cp->nic_stats->rx_err); | |
40414 | - tmp_stats[i++] = le16_to_cpu(cp->nic_stats->rx_fifo); | |
40415 | - tmp_stats[i++] = le16_to_cpu(cp->nic_stats->frame_align); | |
40416 | - tmp_stats[i++] = le32_to_cpu(cp->nic_stats->tx_ok_1col); | |
40417 | - tmp_stats[i++] = le32_to_cpu(cp->nic_stats->tx_ok_mcol); | |
40418 | - tmp_stats[i++] = le64_to_cpu(cp->nic_stats->rx_ok_phys); | |
40419 | - tmp_stats[i++] = le64_to_cpu(cp->nic_stats->rx_ok_bcast); | |
40420 | - tmp_stats[i++] = le32_to_cpu(cp->nic_stats->rx_ok_mcast); | |
40421 | - tmp_stats[i++] = le16_to_cpu(cp->nic_stats->tx_abort); | |
40422 | - tmp_stats[i++] = le16_to_cpu(cp->nic_stats->tx_underrun); | |
40423 | - tmp_stats[i++] = cp->cp_stats.rx_frags; | |
40424 | - if (i != CP_NUM_STATS) | |
40425 | - BUG(); | |
40426 | + spin_lock_irq (&cp->lock); | |
40427 | + rc = netdev_set_wol (cp, wol); | |
40428 | + spin_unlock_irq (&cp->lock); | |
40429 | ||
40430 | - i = copy_to_user(useraddr + sizeof(estats), | |
40431 | - tmp_stats, sz); | |
40432 | - kfree(tmp_stats); | |
40433 | + return rc; | |
40434 | +} | |
40435 | ||
40436 | - if (i) | |
40437 | - return -EFAULT; | |
40438 | - return 0; | |
40439 | +static void cp_get_strings (struct net_device *dev, u32 stringset, u8 *buf) | |
40440 | +{ | |
40441 | + switch (stringset) { | |
40442 | + case ETH_SS_STATS: | |
40443 | + memcpy(buf, ðtool_stats_keys, sizeof(ethtool_stats_keys)); | |
40444 | + break; | |
40445 | + default: | |
40446 | + BUG(); | |
40447 | + break; | |
40448 | } | |
40449 | +} | |
40450 | ||
40451 | - /* get/set Wake-on-LAN settings */ | |
40452 | - case ETHTOOL_GWOL: { | |
40453 | - struct ethtool_wolinfo wol = { ETHTOOL_GWOL }; | |
40454 | - | |
40455 | - spin_lock_irq (&cp->lock); | |
40456 | - netdev_get_wol (cp, &wol); | |
40457 | - spin_unlock_irq (&cp->lock); | |
40458 | - return ((copy_to_user (useraddr, &wol, sizeof (wol)))? -EFAULT : 0); | |
40459 | - } | |
40460 | - | |
40461 | - case ETHTOOL_SWOL: { | |
40462 | - struct ethtool_wolinfo wol; | |
40463 | +static void cp_get_ethtool_stats (struct net_device *dev, | |
40464 | + struct ethtool_stats *estats, u64 *tmp_stats) | |
40465 | +{ | |
40466 | + struct cp_private *cp = dev->priv; | |
40467 | + unsigned int work = 100; | |
40468 | + int i; | |
40469 | ||
40470 | - if (copy_from_user (&wol, useraddr, sizeof (wol))) | |
40471 | - return -EFAULT; | |
40472 | - spin_lock_irq (&cp->lock); | |
40473 | - netdev_set_wol (cp, &wol); | |
40474 | - spin_unlock_irq (&cp->lock); | |
40475 | - return 0; | |
40476 | - } | |
40477 | + /* begin NIC statistics dump */ | |
40478 | + cpw32(StatsAddr + 4, 0); /* FIXME: 64-bit PCI */ | |
40479 | + cpw32(StatsAddr, cp->nic_stats_dma | DumpStats); | |
40480 | + cpr32(StatsAddr); | |
40481 | ||
40482 | - default: | |
40483 | - break; | |
40484 | + while (work-- > 0) { | |
40485 | + if ((cpr32(StatsAddr) & DumpStats) == 0) | |
40486 | + break; | |
40487 | + cpu_relax(); | |
40488 | } | |
40489 | ||
40490 | - return -EOPNOTSUPP; | |
40491 | + if (cpr32(StatsAddr) & DumpStats) | |
40492 | + return /* -EIO */; | |
40493 | + | |
40494 | + i = 0; | |
40495 | + tmp_stats[i++] = le64_to_cpu(cp->nic_stats->tx_ok); | |
40496 | + tmp_stats[i++] = le64_to_cpu(cp->nic_stats->rx_ok); | |
40497 | + tmp_stats[i++] = le64_to_cpu(cp->nic_stats->tx_err); | |
40498 | + tmp_stats[i++] = le32_to_cpu(cp->nic_stats->rx_err); | |
40499 | + tmp_stats[i++] = le16_to_cpu(cp->nic_stats->rx_fifo); | |
40500 | + tmp_stats[i++] = le16_to_cpu(cp->nic_stats->frame_align); | |
40501 | + tmp_stats[i++] = le32_to_cpu(cp->nic_stats->tx_ok_1col); | |
40502 | + tmp_stats[i++] = le32_to_cpu(cp->nic_stats->tx_ok_mcol); | |
40503 | + tmp_stats[i++] = le64_to_cpu(cp->nic_stats->rx_ok_phys); | |
40504 | + tmp_stats[i++] = le64_to_cpu(cp->nic_stats->rx_ok_bcast); | |
40505 | + tmp_stats[i++] = le32_to_cpu(cp->nic_stats->rx_ok_mcast); | |
40506 | + tmp_stats[i++] = le16_to_cpu(cp->nic_stats->tx_abort); | |
40507 | + tmp_stats[i++] = le16_to_cpu(cp->nic_stats->tx_underrun); | |
40508 | + tmp_stats[i++] = cp->cp_stats.rx_frags; | |
40509 | + if (i != CP_NUM_STATS) | |
40510 | + BUG(); | |
40511 | } | |
40512 | ||
40513 | +static struct ethtool_ops cp_ethtool_ops = { | |
40514 | + .get_drvinfo = cp_get_drvinfo, | |
40515 | + .get_regs_len = cp_get_regs_len, | |
40516 | + .get_stats_count = cp_get_stats_count, | |
40517 | + .get_settings = cp_get_settings, | |
40518 | + .set_settings = cp_set_settings, | |
40519 | + .nway_reset = cp_nway_reset, | |
40520 | + .get_link = ethtool_op_get_link, | |
40521 | + .get_msglevel = cp_get_msglevel, | |
40522 | + .set_msglevel = cp_set_msglevel, | |
40523 | + .get_rx_csum = cp_get_rx_csum, | |
40524 | + .set_rx_csum = cp_set_rx_csum, | |
40525 | + .get_tx_csum = ethtool_op_get_tx_csum, | |
40526 | + .set_tx_csum = ethtool_op_set_tx_csum, /* local! */ | |
40527 | + .get_sg = ethtool_op_get_sg, | |
40528 | + .set_sg = ethtool_op_set_sg, | |
40529 | + .get_regs = cp_get_regs, | |
40530 | + .get_wol = cp_get_wol, | |
40531 | + .set_wol = cp_set_wol, | |
40532 | + .get_strings = cp_get_strings, | |
40533 | + .get_ethtool_stats = cp_get_ethtool_stats, | |
40534 | +}; | |
40535 | ||
40536 | static int cp_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |
40537 | { | |
40538 | @@ -1669,38 +1525,12 @@ | |
40539 | if (!netif_running(dev)) | |
40540 | return -EINVAL; | |
40541 | ||
40542 | - if (cmd == SIOCETHTOOL) | |
40543 | - return cp_ethtool_ioctl(cp, (void *) rq->ifr_data); | |
40544 | - | |
40545 | spin_lock_irq(&cp->lock); | |
40546 | rc = generic_mii_ioctl(&cp->mii_if, mii, cmd, NULL); | |
40547 | spin_unlock_irq(&cp->lock); | |
40548 | return rc; | |
40549 | } | |
40550 | ||
40551 | -#if CP_VLAN_TAG_USED | |
40552 | -static void cp_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) | |
40553 | -{ | |
40554 | - struct cp_private *cp = dev->priv; | |
40555 | - | |
40556 | - spin_lock_irq(&cp->lock); | |
40557 | - cp->vlgrp = grp; | |
40558 | - cpw16(CpCmd, cpr16(CpCmd) | RxVlanOn); | |
40559 | - spin_unlock_irq(&cp->lock); | |
40560 | -} | |
40561 | - | |
40562 | -static void cp_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |
40563 | -{ | |
40564 | - struct cp_private *cp = dev->priv; | |
40565 | - | |
40566 | - spin_lock_irq(&cp->lock); | |
40567 | - cpw16(CpCmd, cpr16(CpCmd) & ~RxVlanOn); | |
40568 | - if (cp->vlgrp) | |
40569 | - cp->vlgrp->vlan_devices[vid] = NULL; | |
40570 | - spin_unlock_irq(&cp->lock); | |
40571 | -} | |
40572 | -#endif | |
40573 | - | |
40574 | /* Serial EEPROM section. */ | |
40575 | ||
40576 | /* EEPROM_Ctrl bits. */ | |
40577 | @@ -1723,7 +1553,7 @@ | |
40578 | #define EE_READ_CMD (6) | |
40579 | #define EE_ERASE_CMD (7) | |
40580 | ||
40581 | -static int __devinit read_eeprom (void *ioaddr, int location, int addr_len) | |
40582 | +static int read_eeprom (void *ioaddr, int location, int addr_len) | |
40583 | { | |
40584 | int i; | |
40585 | unsigned retval = 0; | |
40586 | @@ -1769,17 +1599,15 @@ | |
40587 | pci_set_power_state (cp->pdev, 3); | |
40588 | } | |
40589 | ||
40590 | -static int __devinit cp_init_one (struct pci_dev *pdev, | |
40591 | - const struct pci_device_id *ent) | |
40592 | +static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |
40593 | { | |
40594 | struct net_device *dev; | |
40595 | struct cp_private *cp; | |
40596 | int rc; | |
40597 | void *regs; | |
40598 | long pciaddr; | |
40599 | - unsigned int addr_len, i; | |
40600 | - u8 pci_rev, cache_size; | |
40601 | - unsigned int board_type = (unsigned int) ent->driver_data; | |
40602 | + unsigned int addr_len, i, pci_using_dac; | |
40603 | + u8 pci_rev; | |
40604 | ||
40605 | #ifndef MODULE | |
40606 | static int version_printed; | |
40607 | @@ -1805,7 +1633,6 @@ | |
40608 | ||
40609 | cp = dev->priv; | |
40610 | cp->pdev = pdev; | |
40611 | - cp->board_type = board_type; | |
40612 | cp->dev = dev; | |
40613 | cp->msg_enable = (debug < 0 ? CP_DEF_MSG_ENABLE : debug); | |
40614 | spin_lock_init (&cp->lock); | |
40615 | @@ -1821,10 +1648,14 @@ | |
40616 | if (rc) | |
40617 | goto err_out_free; | |
40618 | ||
40619 | - rc = pci_request_regions(pdev, DRV_NAME); | |
40620 | + rc = pci_set_mwi(pdev); | |
40621 | if (rc) | |
40622 | goto err_out_disable; | |
40623 | ||
40624 | + rc = pci_request_regions(pdev, DRV_NAME); | |
40625 | + if (rc) | |
40626 | + goto err_out_mwi; | |
40627 | + | |
40628 | if (pdev->irq < 2) { | |
40629 | rc = -EIO; | |
40630 | printk(KERN_ERR PFX "invalid irq (%d) for pci dev %s\n", | |
40631 | @@ -1846,18 +1677,22 @@ | |
40632 | } | |
40633 | ||
40634 | /* Configure DMA attributes. */ | |
40635 | - if (!pci_set_dma_mask(pdev, (u64) 0xffffffffffffffffULL)) { | |
40636 | - cp->pci_using_dac = 1; | |
40637 | + if ((sizeof(dma_addr_t) > 32) && | |
40638 | + !pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) { | |
40639 | + pci_using_dac = 1; | |
40640 | } else { | |
40641 | - rc = pci_set_dma_mask(pdev, (u64) 0xffffffff); | |
40642 | + rc = pci_set_dma_mask(pdev, 0xffffffffULL); | |
40643 | if (rc) { | |
40644 | printk(KERN_ERR PFX "No usable DMA configuration, " | |
40645 | "aborting.\n"); | |
40646 | goto err_out_res; | |
40647 | } | |
40648 | - cp->pci_using_dac = 0; | |
40649 | + pci_using_dac = 0; | |
40650 | } | |
40651 | ||
40652 | + cp->cpcmd = (pci_using_dac ? PCIDAC : 0) | | |
40653 | + PCIMulRW | RxChkSum | CpRxOn | CpTxOn; | |
40654 | + | |
40655 | regs = ioremap_nocache(pciaddr, CP_REGS_SIZE); | |
40656 | if (!regs) { | |
40657 | rc = -EIO; | |
40658 | @@ -1882,16 +1717,17 @@ | |
40659 | dev->hard_start_xmit = cp_start_xmit; | |
40660 | dev->get_stats = cp_get_stats; | |
40661 | dev->do_ioctl = cp_ioctl; | |
40662 | + dev->poll = cp_rx_poll; | |
40663 | + dev->weight = 16; /* arbitrary? from NAPI_HOWTO.txt. */ | |
40664 | #ifdef BROKEN | |
40665 | dev->change_mtu = cp_change_mtu; | |
40666 | #endif | |
40667 | + dev->ethtool_ops = &cp_ethtool_ops; | |
40668 | #if 0 | |
40669 | dev->tx_timeout = cp_tx_timeout; | |
40670 | dev->watchdog_timeo = TX_TIMEOUT; | |
40671 | #endif | |
40672 | -#ifdef CP_TX_CHECKSUM | |
40673 | - dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; | |
40674 | -#endif | |
40675 | + | |
40676 | #if CP_VLAN_TAG_USED | |
40677 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | |
40678 | dev->vlan_rx_register = cp_vlan_rx_register; | |
40679 | @@ -1904,11 +1740,10 @@ | |
40680 | if (rc) | |
40681 | goto err_out_iomap; | |
40682 | ||
40683 | - printk (KERN_INFO "%s: %s at 0x%lx, " | |
40684 | + printk (KERN_INFO "%s: RTL-8139C+ at 0x%lx, " | |
40685 | "%02x:%02x:%02x:%02x:%02x:%02x, " | |
40686 | "IRQ %d\n", | |
40687 | dev->name, | |
40688 | - cp_board_tbl[board_type].name, | |
40689 | dev->base_addr, | |
40690 | dev->dev_addr[0], dev->dev_addr[1], | |
40691 | dev->dev_addr[2], dev->dev_addr[3], | |
40692 | @@ -1917,29 +1752,8 @@ | |
40693 | ||
40694 | pci_set_drvdata(pdev, dev); | |
40695 | ||
40696 | - /* | |
40697 | - * Looks like this is necessary to deal with on all architectures, | |
40698 | - * even this %$#%$# N440BX Intel based thing doesn't get it right. | |
40699 | - * Ie. having two NICs in the machine, one will have the cache | |
40700 | - * line set at boot time, the other will not. | |
40701 | - */ | |
40702 | - pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &cache_size); | |
40703 | - cache_size <<= 2; | |
40704 | - if (cache_size != SMP_CACHE_BYTES) { | |
40705 | - printk(KERN_INFO "%s: PCI cache line size set incorrectly " | |
40706 | - "(%i bytes) by BIOS/FW, ", dev->name, cache_size); | |
40707 | - if (cache_size > SMP_CACHE_BYTES) | |
40708 | - printk("expecting %i\n", SMP_CACHE_BYTES); | |
40709 | - else { | |
40710 | - printk("correcting to %i\n", SMP_CACHE_BYTES); | |
40711 | - pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, | |
40712 | - SMP_CACHE_BYTES >> 2); | |
40713 | - } | |
40714 | - } | |
40715 | - | |
40716 | /* enable busmastering and memory-write-invalidate */ | |
40717 | pci_set_master(pdev); | |
40718 | - pci_set_mwi(pdev); | |
40719 | ||
40720 | if (cp->wol_enabled) cp_set_d3_state (cp); | |
40721 | ||
40722 | @@ -1949,6 +1763,8 @@ | |
40723 | iounmap(regs); | |
40724 | err_out_res: | |
40725 | pci_release_regions(pdev); | |
40726 | +err_out_mwi: | |
40727 | + pci_clear_mwi(pdev); | |
40728 | err_out_disable: | |
40729 | pci_disable_device(pdev); | |
40730 | err_out_free: | |
40731 | @@ -1956,7 +1772,7 @@ | |
40732 | return rc; | |
40733 | } | |
40734 | ||
40735 | -static void __devexit cp_remove_one (struct pci_dev *pdev) | |
40736 | +static void cp_remove_one (struct pci_dev *pdev) | |
40737 | { | |
40738 | struct net_device *dev = pci_get_drvdata(pdev); | |
40739 | struct cp_private *cp = dev->priv; | |
40740 | @@ -1967,6 +1783,7 @@ | |
40741 | iounmap(cp->regs); | |
40742 | if (cp->wol_enabled) pci_set_power_state (pdev, 0); | |
40743 | pci_release_regions(pdev); | |
40744 | + pci_clear_mwi(pdev); | |
40745 | pci_disable_device(pdev); | |
40746 | pci_set_drvdata(pdev, NULL); | |
40747 | free_netdev(dev); | |
40748 | @@ -2029,7 +1846,7 @@ | |
40749 | .name = DRV_NAME, | |
40750 | .id_table = cp_pci_tbl, | |
40751 | .probe = cp_init_one, | |
40752 | - .remove = __devexit_p(cp_remove_one), | |
40753 | + .remove = cp_remove_one, | |
40754 | #ifdef CONFIG_PM | |
40755 | .resume = cp_resume, | |
40756 | .suspend = cp_suspend, | |
40757 | diff -Nru a/drivers/net/8139too.c b/drivers/net/8139too.c | |
40758 | --- a/drivers/net/8139too.c Tue Aug 19 20:13:55 2003 | |
40759 | +++ b/drivers/net/8139too.c Sun Aug 31 12:38:16 2003 | |
40760 | @@ -123,6 +123,11 @@ | |
40761 | #define USE_IO_OPS 1 | |
40762 | #endif | |
40763 | ||
40764 | +/* use a 16K rx ring buffer instead of the default 32K */ | |
40765 | +#ifdef CONFIG_SH_DREAMCAST | |
40766 | +#define USE_BUF16K 1 | |
40767 | +#endif | |
40768 | + | |
40769 | /* define to 1 to enable copious debugging info */ | |
40770 | #undef RTL8139_DEBUG | |
40771 | ||
40772 | @@ -165,7 +170,11 @@ | |
40773 | static int debug = -1; | |
40774 | ||
40775 | /* Size of the in-memory receive ring. */ | |
40776 | +#ifdef USE_BUF16K | |
40777 | +#define RX_BUF_LEN_IDX 1 /* 0==8K, 1==16K, 2==32K, 3==64K */ | |
40778 | +#else | |
40779 | #define RX_BUF_LEN_IDX 2 /* 0==8K, 1==16K, 2==32K, 3==64K */ | |
40780 | +#endif | |
40781 | #define RX_BUF_LEN (8192 << RX_BUF_LEN_IDX) | |
40782 | #define RX_BUF_PAD 16 | |
40783 | #define RX_BUF_WRAP_PAD 2048 /* spare padding to handle lack of packet wrap */ | |
40784 | @@ -212,18 +221,7 @@ | |
40785 | ||
40786 | typedef enum { | |
40787 | RTL8139 = 0, | |
40788 | - RTL8139_CB, | |
40789 | - SMC1211TX, | |
40790 | - /*MPX5030,*/ | |
40791 | - DELTA8139, | |
40792 | - ADDTRON8139, | |
40793 | - DFE538TX, | |
40794 | - DFE690TXD, | |
40795 | - FE2000VX, | |
40796 | - ALLIED8139, | |
40797 | RTL8129, | |
40798 | - FNW3603TX, | |
40799 | - FNW3800TX, | |
40800 | } board_t; | |
40801 | ||
40802 | ||
40803 | @@ -232,36 +230,29 @@ | |
40804 | const char *name; | |
40805 | u32 hw_flags; | |
40806 | } board_info[] __devinitdata = { | |
40807 | - { "RealTek RTL8139 Fast Ethernet", RTL8139_CAPS }, | |
40808 | - { "RealTek RTL8139B PCI/CardBus", RTL8139_CAPS }, | |
40809 | - { "SMC1211TX EZCard 10/100 (RealTek RTL8139)", RTL8139_CAPS }, | |
40810 | -/* { MPX5030, "Accton MPX5030 (RealTek RTL8139)", RTL8139_CAPS },*/ | |
40811 | - { "Delta Electronics 8139 10/100BaseTX", RTL8139_CAPS }, | |
40812 | - { "Addtron Technolgy 8139 10/100BaseTX", RTL8139_CAPS }, | |
40813 | - { "D-Link DFE-538TX (RealTek RTL8139)", RTL8139_CAPS }, | |
40814 | - { "D-Link DFE-690TXD (RealTek RTL8139)", RTL8139_CAPS }, | |
40815 | - { "AboCom FE2000VX (RealTek RTL8139)", RTL8139_CAPS }, | |
40816 | - { "Allied Telesyn 8139 CardBus", RTL8139_CAPS }, | |
40817 | + { "RealTek RTL8139", RTL8139_CAPS }, | |
40818 | { "RealTek RTL8129", RTL8129_CAPS }, | |
40819 | - { "Planex FNW-3603-TX 10/100 CardBus", RTL8139_CAPS }, | |
40820 | - { "Planex FNW-3800-TX 10/100 CardBus", RTL8139_CAPS }, | |
40821 | }; | |
40822 | ||
40823 | ||
40824 | static struct pci_device_id rtl8139_pci_tbl[] = { | |
40825 | {0x10ec, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, | |
40826 | - {0x10ec, 0x8138, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139_CB }, | |
40827 | - {0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SMC1211TX }, | |
40828 | -/* {0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MPX5030 },*/ | |
40829 | - {0x1500, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DELTA8139 }, | |
40830 | - {0x4033, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ADDTRON8139 }, | |
40831 | - {0x1186, 0x1300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DFE538TX }, | |
40832 | - {0x1186, 0x1340, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DFE690TXD }, | |
40833 | - {0x13d1, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, FE2000VX }, | |
40834 | - {0x1259, 0xa117, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ALLIED8139 }, | |
40835 | - {0x14ea, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, FNW3603TX }, | |
40836 | - {0x14ea, 0xab07, PCI_ANY_ID, PCI_ANY_ID, 0, 0, FNW3800TX }, | |
40837 | - | |
40838 | + {0x10ec, 0x8138, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, | |
40839 | + {0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, | |
40840 | + {0x1500, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, | |
40841 | + {0x4033, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, | |
40842 | + {0x1186, 0x1300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, | |
40843 | + {0x1186, 0x1340, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, | |
40844 | + {0x13d1, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, | |
40845 | + {0x1259, 0xa117, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, | |
40846 | + {0x14ea, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, | |
40847 | + {0x14ea, 0xab07, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, | |
40848 | + {0x11db, 0x1234, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, | |
40849 | + | |
40850 | +#ifdef CONFIG_SH_SECUREEDGE5410 | |
40851 | + /* Bogus 8139 silicon reports 8129 without external PROM :-( */ | |
40852 | + {0x10ec, 0x8129, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 }, | |
40853 | +#endif | |
40854 | #ifdef CONFIG_8139TOO_8129 | |
40855 | {0x10ec, 0x8129, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8129 }, | |
40856 | #endif | |
40857 | @@ -271,8 +262,8 @@ | |
40858 | * so we simply don't match on the main vendor id. | |
40859 | */ | |
40860 | {PCI_ANY_ID, 0x8139, 0x10ec, 0x8139, 0, 0, RTL8139 }, | |
40861 | - {PCI_ANY_ID, 0x8139, 0x1186, 0x1300, 0, 0, DFE538TX }, | |
40862 | - {PCI_ANY_ID, 0x8139, 0x13d1, 0xab06, 0, 0, FE2000VX }, | |
40863 | + {PCI_ANY_ID, 0x8139, 0x1186, 0x1300, 0, 0, RTL8139 }, | |
40864 | + {PCI_ANY_ID, 0x8139, 0x13d1, 0xab06, 0, 0, RTL8139 }, | |
40865 | ||
40866 | {0,} | |
40867 | }; | |
40868 | @@ -302,7 +293,6 @@ | |
40869 | IntrMask = 0x3C, | |
40870 | IntrStatus = 0x3E, | |
40871 | TxConfig = 0x40, | |
40872 | - ChipVersion = 0x43, | |
40873 | RxConfig = 0x44, | |
40874 | Timer = 0x48, /* A general-purpose counter. */ | |
40875 | RxMissed = 0x4C, /* 24 bits valid, write clears. */ | |
40876 | @@ -461,7 +451,6 @@ | |
40877 | RxNoWrap = (1 << 7), | |
40878 | }; | |
40879 | ||
40880 | - | |
40881 | /* Twister tuning parameters from RealTek. | |
40882 | Completely undocumented, but required to tune bad links on some boards. */ | |
40883 | enum CSCRBits { | |
40884 | @@ -472,36 +461,22 @@ | |
40885 | CSCR_LinkDownCmd = 0x0f3c0, | |
40886 | }; | |
40887 | ||
40888 | - | |
40889 | enum Cfg9346Bits { | |
40890 | Cfg9346_Lock = 0x00, | |
40891 | Cfg9346_Unlock = 0xC0, | |
40892 | }; | |
40893 | ||
40894 | -#ifdef CONFIG_8139TOO_TUNE_TWISTER | |
40895 | - | |
40896 | -enum TwisterParamVals { | |
40897 | - PARA78_default = 0x78fa8388, | |
40898 | - PARA7c_default = 0xcb38de43, /* param[0][3] */ | |
40899 | - PARA7c_xxx = 0xcb38de43, | |
40900 | -}; | |
40901 | - | |
40902 | -static const unsigned long param[4][4] = { | |
40903 | - {0xcb39de43, 0xcb39ce43, 0xfb38de03, 0xcb38de43}, | |
40904 | - {0xcb39de43, 0xcb39ce43, 0xcb39ce83, 0xcb39ce83}, | |
40905 | - {0xcb39de43, 0xcb39ce43, 0xcb39ce83, 0xcb39ce83}, | |
40906 | - {0xbb39de43, 0xbb39ce43, 0xbb39ce83, 0xbb39ce83} | |
40907 | -}; | |
40908 | - | |
40909 | -#endif /* CONFIG_8139TOO_TUNE_TWISTER */ | |
40910 | - | |
40911 | typedef enum { | |
40912 | CH_8139 = 0, | |
40913 | CH_8139_K, | |
40914 | CH_8139A, | |
40915 | + CH_8139A_G, | |
40916 | CH_8139B, | |
40917 | CH_8130, | |
40918 | CH_8139C, | |
40919 | + CH_8100, | |
40920 | + CH_8100B_8139D, | |
40921 | + CH_8101, | |
40922 | } chip_t; | |
40923 | ||
40924 | enum chip_flags { | |
40925 | @@ -509,50 +484,65 @@ | |
40926 | HasLWake = (1 << 1), | |
40927 | }; | |
40928 | ||
40929 | +#define HW_REVID(b30, b29, b28, b27, b26, b23, b22) \ | |
40930 | + (b30<<30 | b29<<29 | b28<<28 | b27<<27 | b26<<26 | b23<<23 | b22<<22) | |
40931 | +#define HW_REVID_MASK HW_REVID(1, 1, 1, 1, 1, 1, 1) | |
40932 | ||
40933 | /* directly indexed by chip_t, above */ | |
40934 | const static struct { | |
40935 | const char *name; | |
40936 | - u8 version; /* from RTL8139C docs */ | |
40937 | - u32 RxConfigMask; /* should clear the bits supported by this chip */ | |
40938 | + u32 version; /* from RTL8139C/RTL8139D docs */ | |
40939 | u32 flags; | |
40940 | } rtl_chip_info[] = { | |
40941 | { "RTL-8139", | |
40942 | - 0x40, | |
40943 | - 0xf0fe0040, /* XXX copied from RTL8139A, verify */ | |
40944 | + HW_REVID(1, 0, 0, 0, 0, 0, 0), | |
40945 | HasHltClk, | |
40946 | }, | |
40947 | ||
40948 | { "RTL-8139 rev K", | |
40949 | - 0x60, | |
40950 | - 0xf0fe0040, | |
40951 | + HW_REVID(1, 1, 0, 0, 0, 0, 0), | |
40952 | HasHltClk, | |
40953 | }, | |
40954 | ||
40955 | { "RTL-8139A", | |
40956 | - 0x70, | |
40957 | - 0xf0fe0040, | |
40958 | + HW_REVID(1, 1, 1, 0, 0, 0, 0), | |
40959 | + HasHltClk, /* XXX undocumented? */ | |
40960 | + }, | |
40961 | + | |
40962 | + { "RTL-8139A rev G", | |
40963 | + HW_REVID(1, 1, 1, 0, 0, 1, 0), | |
40964 | HasHltClk, /* XXX undocumented? */ | |
40965 | }, | |
40966 | ||
40967 | { "RTL-8139B", | |
40968 | - 0x78, | |
40969 | - 0xf0fc0040, | |
40970 | + HW_REVID(1, 1, 1, 1, 0, 0, 0), | |
40971 | HasLWake, | |
40972 | }, | |
40973 | ||
40974 | { "RTL-8130", | |
40975 | - 0x7C, | |
40976 | - 0xf0fe0040, /* XXX copied from RTL8139A, verify */ | |
40977 | + HW_REVID(1, 1, 1, 1, 1, 0, 0), | |
40978 | HasLWake, | |
40979 | }, | |
40980 | ||
40981 | { "RTL-8139C", | |
40982 | - 0x74, | |
40983 | - 0xf0fc0040, /* XXX copied from RTL8139B, verify */ | |
40984 | + HW_REVID(1, 1, 1, 0, 1, 0, 0), | |
40985 | HasLWake, | |
40986 | }, | |
40987 | ||
40988 | + { "RTL-8100", | |
40989 | + HW_REVID(1, 1, 1, 1, 0, 1, 0), | |
40990 | + HasLWake, | |
40991 | + }, | |
40992 | + | |
40993 | + { "RTL-8100B/8139D", | |
40994 | + HW_REVID(1, 1, 1, 0, 1, 0, 1), | |
40995 | + HasLWake, | |
40996 | + }, | |
40997 | + | |
40998 | + { "RTL-8101", | |
40999 | + HW_REVID(1, 1, 1, 0, 1, 1, 1), | |
41000 | + HasLWake, | |
41001 | + }, | |
41002 | }; | |
41003 | ||
41004 | struct rtl_extra_stats { | |
41005 | @@ -612,7 +602,7 @@ | |
41006 | static int mdio_read (struct net_device *dev, int phy_id, int location); | |
41007 | static void mdio_write (struct net_device *dev, int phy_id, int location, | |
41008 | int val); | |
41009 | -static int rtl8139_thread (void *data); | |
41010 | +static inline void rtl8139_start_thread(struct net_device *dev); | |
41011 | static void rtl8139_tx_timeout (struct net_device *dev); | |
41012 | static void rtl8139_init_ring (struct net_device *dev); | |
41013 | static int rtl8139_start_xmit (struct sk_buff *skb, | |
41014 | @@ -625,6 +615,7 @@ | |
41015 | static void rtl8139_set_rx_mode (struct net_device *dev); | |
41016 | static void __set_rx_mode (struct net_device *dev); | |
41017 | static void rtl8139_hw_start (struct net_device *dev); | |
41018 | +static struct ethtool_ops rtl8139_ethtool_ops; | |
41019 | ||
41020 | #ifdef USE_IO_OPS | |
41021 | ||
41022 | @@ -688,10 +679,17 @@ | |
41023 | PCIErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver | | |
41024 | TxErr | TxOK | RxErr | RxOK; | |
41025 | ||
41026 | +#ifdef USE_BUF16K | |
41027 | +static const unsigned int rtl8139_rx_config = | |
41028 | + RxCfgRcv16K | RxNoWrap | | |
41029 | + (RX_FIFO_THRESH << RxCfgFIFOShift) | | |
41030 | + (RX_DMA_BURST << RxCfgDMAShift); | |
41031 | +#else | |
41032 | static const unsigned int rtl8139_rx_config = | |
41033 | RxCfgRcv32K | RxNoWrap | | |
41034 | (RX_FIFO_THRESH << RxCfgFIFOShift) | | |
41035 | (RX_DMA_BURST << RxCfgDMAShift); | |
41036 | +#endif | |
41037 | ||
41038 | static const unsigned int rtl8139_tx_config = | |
41039 | (TX_DMA_BURST << TxDMAShift) | (TX_RETRY << TxRetryShift); | |
41040 | @@ -716,13 +714,6 @@ | |
41041 | /* it's ok to call this even if we have no regions to free */ | |
41042 | pci_release_regions (pdev); | |
41043 | ||
41044 | -#ifndef RTL8139_NDEBUG | |
41045 | - /* poison memory before freeing */ | |
41046 | - memset (dev, 0xBC, | |
41047 | - sizeof (struct net_device) + | |
41048 | - sizeof (struct rtl8139_private)); | |
41049 | -#endif /* RTL8139_NDEBUG */ | |
41050 | - | |
41051 | free_netdev(dev); | |
41052 | ||
41053 | pci_set_drvdata (pdev, NULL); | |
41054 | @@ -757,7 +748,7 @@ | |
41055 | unsigned int i; | |
41056 | u32 pio_start, pio_end, pio_flags, pio_len; | |
41057 | unsigned long mmio_start, mmio_end, mmio_flags, mmio_len; | |
41058 | - u32 tmp; | |
41059 | + u32 version; | |
41060 | ||
41061 | assert (pdev != NULL); | |
41062 | ||
41063 | @@ -859,9 +850,9 @@ | |
41064 | } | |
41065 | ||
41066 | /* identify chip attached to board */ | |
41067 | - tmp = RTL_R8 (ChipVersion); | |
41068 | + version = RTL_R32 (TxConfig) & HW_REVID_MASK; | |
41069 | for (i = 0; i < ARRAY_SIZE (rtl_chip_info); i++) | |
41070 | - if (tmp == rtl_chip_info[i].version) { | |
41071 | + if (version == rtl_chip_info[i].version) { | |
41072 | tp->chipset = i; | |
41073 | goto match; | |
41074 | } | |
41075 | @@ -892,8 +883,11 @@ | |
41076 | } | |
41077 | if (rtl_chip_info[tp->chipset].flags & HasLWake) { | |
41078 | tmp8 = RTL_R8 (Config4); | |
41079 | - if (tmp8 & LWPTN) | |
41080 | + if (tmp8 & LWPTN) { | |
41081 | + RTL_W8 (Cfg9346, Cfg9346_Unlock); | |
41082 | RTL_W8 (Config4, tmp8 & ~LWPTN); | |
41083 | + RTL_W8 (Cfg9346, Cfg9346_Lock); | |
41084 | + } | |
41085 | } | |
41086 | } else { | |
41087 | DPRINTK("Old chip wakeup\n"); | |
41088 | @@ -971,6 +965,7 @@ | |
41089 | dev->get_stats = rtl8139_get_stats; | |
41090 | dev->set_multicast_list = rtl8139_set_rx_mode; | |
41091 | dev->do_ioctl = netdev_ioctl; | |
41092 | + dev->ethtool_ops = &rtl8139_ethtool_ops; | |
41093 | dev->tx_timeout = rtl8139_tx_timeout; | |
41094 | dev->watchdog_timeo = TX_TIMEOUT; | |
41095 | ||
41096 | @@ -1318,8 +1313,6 @@ | |
41097 | ||
41098 | tp->mii.full_duplex = tp->mii.force_media; | |
41099 | tp->tx_flag = (TX_FIFO_THRESH << 11) & 0x003f0000; | |
41100 | - tp->twistie = (tp->chipset == CH_8139_K) ? 1 : 0; | |
41101 | - tp->time_to_die = 0; | |
41102 | ||
41103 | rtl8139_init_ring (dev); | |
41104 | rtl8139_hw_start (dev); | |
41105 | @@ -1330,32 +1323,18 @@ | |
41106 | dev->irq, RTL_R8 (MediaStatus), | |
41107 | tp->mii.full_duplex ? "full" : "half"); | |
41108 | ||
41109 | - tp->thr_pid = kernel_thread (rtl8139_thread, dev, CLONE_FS | CLONE_FILES); | |
41110 | - if (tp->thr_pid < 0) | |
41111 | - printk (KERN_WARNING "%s: unable to start kernel thread\n", | |
41112 | - dev->name); | |
41113 | + rtl8139_start_thread(dev); | |
41114 | ||
41115 | return 0; | |
41116 | } | |
41117 | ||
41118 | ||
41119 | -static void rtl_check_media (struct net_device *dev) | |
41120 | +static void rtl_check_media (struct net_device *dev, unsigned int init_media) | |
41121 | { | |
41122 | struct rtl8139_private *tp = dev->priv; | |
41123 | ||
41124 | if (tp->phys[0] >= 0) { | |
41125 | - u16 mii_lpa = mdio_read(dev, tp->phys[0], MII_LPA); | |
41126 | - if (mii_lpa == 0xffff) | |
41127 | - ; /* Not there */ | |
41128 | - else if ((mii_lpa & LPA_100FULL) == LPA_100FULL | |
41129 | - || (mii_lpa & 0x00C0) == LPA_10FULL) | |
41130 | - tp->mii.full_duplex = 1; | |
41131 | - | |
41132 | - printk (KERN_INFO"%s: Setting %s%s-duplex based on" | |
41133 | - " auto-negotiated partner ability %4.4x.\n", | |
41134 | - dev->name, mii_lpa == 0 ? "" : | |
41135 | - (mii_lpa & 0x0180) ? "100mbps " : "10mbps ", | |
41136 | - tp->mii.full_duplex ? "full" : "half", mii_lpa); | |
41137 | + mii_check_media(&tp->mii, 1, init_media); | |
41138 | } | |
41139 | } | |
41140 | ||
41141 | @@ -1390,7 +1369,7 @@ | |
41142 | ||
41143 | tp->cur_rx = 0; | |
41144 | ||
41145 | - rtl_check_media (dev); | |
41146 | + rtl_check_media (dev, 1); | |
41147 | ||
41148 | if (tp->chipset >= CH_8139B) { | |
41149 | /* Disable magic packet scanning, which is enabled | |
41150 | @@ -1452,6 +1431,19 @@ | |
41151 | static inline void rtl8139_tune_twister (struct net_device *dev, | |
41152 | struct rtl8139_private *tp) {} | |
41153 | #else | |
41154 | +enum TwisterParamVals { | |
41155 | + PARA78_default = 0x78fa8388, | |
41156 | + PARA7c_default = 0xcb38de43, /* param[0][3] */ | |
41157 | + PARA7c_xxx = 0xcb38de43, | |
41158 | +}; | |
41159 | + | |
41160 | +static const unsigned long param[4][4] = { | |
41161 | + {0xcb39de43, 0xcb39ce43, 0xfb38de03, 0xcb38de43}, | |
41162 | + {0xcb39de43, 0xcb39ce43, 0xcb39ce83, 0xcb39ce83}, | |
41163 | + {0xcb39de43, 0xcb39ce43, 0xcb39ce83, 0xcb39ce83}, | |
41164 | + {0xbb39de43, 0xbb39ce43, 0xbb39ce83, 0xbb39ce83} | |
41165 | +}; | |
41166 | + | |
41167 | static void rtl8139_tune_twister (struct net_device *dev, | |
41168 | struct rtl8139_private *tp) | |
41169 | { | |
41170 | @@ -1538,7 +1530,6 @@ | |
41171 | } | |
41172 | #endif /* CONFIG_8139TOO_TUNE_TWISTER */ | |
41173 | ||
41174 | - | |
41175 | static inline void rtl8139_thread_iter (struct net_device *dev, | |
41176 | struct rtl8139_private *tp, | |
41177 | void *ioaddr) | |
41178 | @@ -1585,7 +1576,6 @@ | |
41179 | RTL_R8 (Config1)); | |
41180 | } | |
41181 | ||
41182 | - | |
41183 | static int rtl8139_thread (void *data) | |
41184 | { | |
41185 | struct net_device *dev = data; | |
41186 | @@ -1619,6 +1609,24 @@ | |
41187 | complete_and_exit (&tp->thr_exited, 0); | |
41188 | } | |
41189 | ||
41190 | +static inline void rtl8139_start_thread(struct net_device *dev) | |
41191 | +{ | |
41192 | + struct rtl8139_private *tp = dev->priv; | |
41193 | + | |
41194 | + tp->thr_pid = -1; | |
41195 | + tp->twistie = 0; | |
41196 | + tp->time_to_die = 0; | |
41197 | + if (tp->chipset == CH_8139_K) | |
41198 | + tp->twistie = 1; | |
41199 | + else if (tp->drv_flags & HAS_LNK_CHNG) | |
41200 | + return; | |
41201 | + | |
41202 | + tp->thr_pid = kernel_thread(rtl8139_thread, dev, CLONE_FS|CLONE_FILES); | |
41203 | + if (tp->thr_pid < 0) { | |
41204 | + printk (KERN_WARNING "%s: unable to start kernel thread\n", | |
41205 | + dev->name); | |
41206 | + } | |
41207 | +} | |
41208 | ||
41209 | static void rtl8139_tx_clear (struct rtl8139_private *tp) | |
41210 | { | |
41211 | @@ -1999,18 +2007,7 @@ | |
41212 | ||
41213 | if ((status & RxUnderrun) && link_changed && | |
41214 | (tp->drv_flags & HAS_LNK_CHNG)) { | |
41215 | - /* Really link-change on new chips. */ | |
41216 | - int lpar = RTL_R16 (NWayLPAR); | |
41217 | - int duplex = (lpar & LPA_100FULL) || (lpar & 0x01C0) == 0x0040 | |
41218 | - || tp->mii.force_media; | |
41219 | - if (tp->mii.full_duplex != duplex) { | |
41220 | - tp->mii.full_duplex = duplex; | |
41221 | -#if 0 | |
41222 | - RTL_W8 (Cfg9346, Cfg9346_Unlock); | |
41223 | - RTL_W8 (Config1, tp->mii.full_duplex ? 0x60 : 0x20); | |
41224 | - RTL_W8 (Cfg9346, Cfg9346_Lock); | |
41225 | -#endif | |
41226 | - } | |
41227 | + rtl_check_media(dev, 0); | |
41228 | status &= ~RxUnderrun; | |
41229 | } | |
41230 | ||
41231 | @@ -2173,11 +2170,12 @@ | |
41232 | /* Get the ethtool Wake-on-LAN settings. Assumes that wol points to | |
41233 | kernel memory, *wol has been initialized as {ETHTOOL_GWOL}, and | |
41234 | other threads or interrupts aren't messing with the 8139. */ | |
41235 | -static void netdev_get_wol (struct net_device *dev, struct ethtool_wolinfo *wol) | |
41236 | +static void rtl8139_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |
41237 | { | |
41238 | struct rtl8139_private *np = dev->priv; | |
41239 | void *ioaddr = np->mmio_addr; | |
41240 | ||
41241 | + spin_lock_irq(&np->lock); | |
41242 | if (rtl_chip_info[np->chipset].flags & HasLWake) { | |
41243 | u8 cfg3 = RTL_R8 (Config3); | |
41244 | u8 cfg5 = RTL_R8 (Config5); | |
41245 | @@ -2199,14 +2197,14 @@ | |
41246 | if (cfg5 & Cfg5_BWF) | |
41247 | wol->wolopts |= WAKE_BCAST; | |
41248 | } | |
41249 | + spin_unlock_irq(&np->lock); | |
41250 | } | |
41251 | ||
41252 | ||
41253 | /* Set the ethtool Wake-on-LAN settings. Return 0 or -errno. Assumes | |
41254 | that wol points to kernel memory and other threads or interrupts | |
41255 | aren't messing with the 8139. */ | |
41256 | -static int netdev_set_wol (struct net_device *dev, | |
41257 | - const struct ethtool_wolinfo *wol) | |
41258 | +static int rtl8139_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |
41259 | { | |
41260 | struct rtl8139_private *np = dev->priv; | |
41261 | void *ioaddr = np->mmio_addr; | |
41262 | @@ -2220,6 +2218,7 @@ | |
41263 | if (wol->wolopts & ~support) | |
41264 | return -EINVAL; | |
41265 | ||
41266 | + spin_lock_irq(&np->lock); | |
41267 | cfg3 = RTL_R8 (Config3) & ~(Cfg3_LinkUp | Cfg3_Magic); | |
41268 | if (wol->wolopts & WAKE_PHY) | |
41269 | cfg3 |= Cfg3_LinkUp; | |
41270 | @@ -2240,213 +2239,120 @@ | |
41271 | if (wol->wolopts & WAKE_BCAST) | |
41272 | cfg5 |= Cfg5_BWF; | |
41273 | RTL_W8 (Config5, cfg5); /* need not unlock via Cfg9346 */ | |
41274 | + spin_unlock_irq(&np->lock); | |
41275 | ||
41276 | return 0; | |
41277 | } | |
41278 | ||
41279 | -static int netdev_ethtool_ioctl (struct net_device *dev, void *useraddr) | |
41280 | +static void rtl8139_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | |
41281 | { | |
41282 | struct rtl8139_private *np = dev->priv; | |
41283 | - u32 ethcmd; | |
41284 | - | |
41285 | - /* dev_ioctl() in ../../net/core/dev.c has already checked | |
41286 | - capable(CAP_NET_ADMIN), so don't bother with that here. */ | |
41287 | + strcpy(info->driver, DRV_NAME); | |
41288 | + strcpy(info->version, DRV_VERSION); | |
41289 | + strcpy(info->bus_info, pci_name(np->pci_dev)); | |
41290 | + info->regdump_len = np->regs_len; | |
41291 | +} | |
41292 | ||
41293 | - if (get_user(ethcmd, (u32 *)useraddr)) | |
41294 | - return -EFAULT; | |
41295 | +static int rtl8139_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |
41296 | +{ | |
41297 | + struct rtl8139_private *np = dev->priv; | |
41298 | + spin_lock_irq(&np->lock); | |
41299 | + mii_ethtool_gset(&np->mii, cmd); | |
41300 | + spin_unlock_irq(&np->lock); | |
41301 | + return 0; | |
41302 | +} | |
41303 | ||
41304 | - switch (ethcmd) { | |
41305 | - | |
41306 | - case ETHTOOL_GDRVINFO: { | |
41307 | - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; | |
41308 | - strcpy (info.driver, DRV_NAME); | |
41309 | - strcpy (info.version, DRV_VERSION); | |
41310 | - strcpy (info.bus_info, pci_name(np->pci_dev)); | |
41311 | - info.regdump_len = np->regs_len; | |
41312 | - if (copy_to_user (useraddr, &info, sizeof (info))) | |
41313 | - return -EFAULT; | |
41314 | - return 0; | |
41315 | - } | |
41316 | +static int rtl8139_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |
41317 | +{ | |
41318 | + struct rtl8139_private *np = dev->priv; | |
41319 | + int rc; | |
41320 | + spin_lock_irq(&np->lock); | |
41321 | + rc = mii_ethtool_sset(&np->mii, cmd); | |
41322 | + spin_unlock_irq(&np->lock); | |
41323 | + return rc; | |
41324 | +} | |
41325 | ||
41326 | - /* get settings */ | |
41327 | - case ETHTOOL_GSET: { | |
41328 | - struct ethtool_cmd ecmd = { ETHTOOL_GSET }; | |
41329 | - spin_lock_irq(&np->lock); | |
41330 | - mii_ethtool_gset(&np->mii, &ecmd); | |
41331 | - spin_unlock_irq(&np->lock); | |
41332 | - if (copy_to_user(useraddr, &ecmd, sizeof(ecmd))) | |
41333 | - return -EFAULT; | |
41334 | - return 0; | |
41335 | - } | |
41336 | - /* set settings */ | |
41337 | - case ETHTOOL_SSET: { | |
41338 | - int r; | |
41339 | - struct ethtool_cmd ecmd; | |
41340 | - if (copy_from_user(&ecmd, useraddr, sizeof(ecmd))) | |
41341 | - return -EFAULT; | |
41342 | - spin_lock_irq(&np->lock); | |
41343 | - r = mii_ethtool_sset(&np->mii, &ecmd); | |
41344 | - spin_unlock_irq(&np->lock); | |
41345 | - return r; | |
41346 | - } | |
41347 | - /* restart autonegotiation */ | |
41348 | - case ETHTOOL_NWAY_RST: { | |
41349 | - return mii_nway_restart(&np->mii); | |
41350 | - } | |
41351 | - /* get link status */ | |
41352 | - case ETHTOOL_GLINK: { | |
41353 | - struct ethtool_value edata = {ETHTOOL_GLINK}; | |
41354 | - edata.data = mii_link_ok(&np->mii); | |
41355 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
41356 | - return -EFAULT; | |
41357 | - return 0; | |
41358 | - } | |
41359 | +static int rtl8139_nway_reset(struct net_device *dev) | |
41360 | +{ | |
41361 | + struct rtl8139_private *np = dev->priv; | |
41362 | + return mii_nway_restart(&np->mii); | |
41363 | +} | |
41364 | ||
41365 | - /* get message-level */ | |
41366 | - case ETHTOOL_GMSGLVL: { | |
41367 | - struct ethtool_value edata = {ETHTOOL_GMSGLVL}; | |
41368 | - edata.data = debug; | |
41369 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
41370 | - return -EFAULT; | |
41371 | - return 0; | |
41372 | - } | |
41373 | - /* set message-level */ | |
41374 | - case ETHTOOL_SMSGLVL: { | |
41375 | - struct ethtool_value edata; | |
41376 | - if (copy_from_user(&edata, useraddr, sizeof(edata))) | |
41377 | - return -EFAULT; | |
41378 | - debug = edata.data; | |
41379 | - return 0; | |
41380 | - } | |
41381 | +static u32 rtl8139_get_link(struct net_device *dev) | |
41382 | +{ | |
41383 | + struct rtl8139_private *np = dev->priv; | |
41384 | + return mii_link_ok(&np->mii); | |
41385 | +} | |
41386 | ||
41387 | - case ETHTOOL_GWOL: | |
41388 | - { | |
41389 | - struct ethtool_wolinfo wol = { ETHTOOL_GWOL }; | |
41390 | - spin_lock_irq (&np->lock); | |
41391 | - netdev_get_wol (dev, &wol); | |
41392 | - spin_unlock_irq (&np->lock); | |
41393 | - if (copy_to_user (useraddr, &wol, sizeof (wol))) | |
41394 | - return -EFAULT; | |
41395 | - return 0; | |
41396 | - } | |
41397 | +static u32 rtl8139_get_msglevel(struct net_device *dev) | |
41398 | +{ | |
41399 | + return debug; | |
41400 | +} | |
41401 | ||
41402 | - case ETHTOOL_SWOL: | |
41403 | - { | |
41404 | - struct ethtool_wolinfo wol; | |
41405 | - int rc; | |
41406 | - if (copy_from_user (&wol, useraddr, sizeof (wol))) | |
41407 | - return -EFAULT; | |
41408 | - spin_lock_irq (&np->lock); | |
41409 | - rc = netdev_set_wol (dev, &wol); | |
41410 | - spin_unlock_irq (&np->lock); | |
41411 | - return rc; | |
41412 | - } | |
41413 | +static void rtl8139_set_msglevel(struct net_device *dev, u32 datum) | |
41414 | +{ | |
41415 | + debug = datum; | |
41416 | +} | |
41417 | ||
41418 | /* TODO: we are too slack to do reg dumping for pio, for now */ | |
41419 | -#ifndef CONFIG_8139TOO_PIO | |
41420 | - /* NIC register dump */ | |
41421 | - case ETHTOOL_GREGS: { | |
41422 | - struct ethtool_regs regs; | |
41423 | - unsigned int regs_len = np->regs_len; | |
41424 | - u8 *regbuf = kmalloc(regs_len, GFP_KERNEL); | |
41425 | - int rc; | |
41426 | - | |
41427 | - if (!regbuf) | |
41428 | - return -ENOMEM; | |
41429 | - memset(regbuf, 0, regs_len); | |
41430 | - | |
41431 | - rc = copy_from_user(®s, useraddr, sizeof(regs)); | |
41432 | - if (rc) { | |
41433 | - rc = -EFAULT; | |
41434 | - goto err_out_gregs; | |
41435 | - } | |
41436 | - | |
41437 | - if (regs.len > regs_len) | |
41438 | - regs.len = regs_len; | |
41439 | - if (regs.len < regs_len) { | |
41440 | - rc = -EINVAL; | |
41441 | - goto err_out_gregs; | |
41442 | - } | |
41443 | - | |
41444 | - regs.version = RTL_REGS_VER; | |
41445 | - rc = copy_to_user(useraddr, ®s, sizeof(regs)); | |
41446 | - if (rc) { | |
41447 | - rc = -EFAULT; | |
41448 | - goto err_out_gregs; | |
41449 | - } | |
41450 | - | |
41451 | - useraddr += offsetof(struct ethtool_regs, data); | |
41452 | - | |
41453 | - spin_lock_irq(&np->lock); | |
41454 | - memcpy_fromio(regbuf, np->mmio_addr, regs_len); | |
41455 | - spin_unlock_irq(&np->lock); | |
41456 | - | |
41457 | - if (copy_to_user(useraddr, regbuf, regs_len)) | |
41458 | - rc = -EFAULT; | |
41459 | - | |
41460 | -err_out_gregs: | |
41461 | - kfree(regbuf); | |
41462 | - return rc; | |
41463 | - } | |
41464 | -#endif /* CONFIG_8139TOO_PIO */ | |
41465 | - | |
41466 | - /* get string list(s) */ | |
41467 | - case ETHTOOL_GSTRINGS: { | |
41468 | - struct ethtool_gstrings estr = { ETHTOOL_GSTRINGS }; | |
41469 | - | |
41470 | - if (copy_from_user(&estr, useraddr, sizeof(estr))) | |
41471 | - return -EFAULT; | |
41472 | - if (estr.string_set != ETH_SS_STATS) | |
41473 | - return -EINVAL; | |
41474 | - | |
41475 | - estr.len = RTL_NUM_STATS; | |
41476 | - if (copy_to_user(useraddr, &estr, sizeof(estr))) | |
41477 | - return -EFAULT; | |
41478 | - if (copy_to_user(useraddr + sizeof(estr), | |
41479 | - ðtool_stats_keys, | |
41480 | - sizeof(ethtool_stats_keys))) | |
41481 | - return -EFAULT; | |
41482 | - return 0; | |
41483 | - } | |
41484 | +#ifdef CONFIG_8139TOO_PIO | |
41485 | +#define rtl8139_get_regs_len NULL | |
41486 | +#define rtl8139_get_regs NULL | |
41487 | +#else | |
41488 | +static int rtl8139_get_regs_len(struct net_device *dev) | |
41489 | +{ | |
41490 | + struct rtl8139_private *np = dev->priv; | |
41491 | + return np->regs_len; | |
41492 | +} | |
41493 | ||
41494 | - /* get NIC-specific statistics */ | |
41495 | - case ETHTOOL_GSTATS: { | |
41496 | - struct ethtool_stats estats = { ETHTOOL_GSTATS }; | |
41497 | - u64 *tmp_stats; | |
41498 | - const unsigned int sz = sizeof(u64) * RTL_NUM_STATS; | |
41499 | - int i; | |
41500 | - | |
41501 | - estats.n_stats = RTL_NUM_STATS; | |
41502 | - if (copy_to_user(useraddr, &estats, sizeof(estats))) | |
41503 | - return -EFAULT; | |
41504 | - | |
41505 | - tmp_stats = kmalloc(sz, GFP_KERNEL); | |
41506 | - if (!tmp_stats) | |
41507 | - return -ENOMEM; | |
41508 | - memset(tmp_stats, 0, sz); | |
41509 | - | |
41510 | - i = 0; | |
41511 | - tmp_stats[i++] = np->xstats.early_rx; | |
41512 | - tmp_stats[i++] = np->xstats.tx_buf_mapped; | |
41513 | - tmp_stats[i++] = np->xstats.tx_timeouts; | |
41514 | - tmp_stats[i++] = np->xstats.rx_lost_in_ring; | |
41515 | - if (i != RTL_NUM_STATS) | |
41516 | - BUG(); | |
41517 | +static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *regbuf) | |
41518 | +{ | |
41519 | + struct rtl8139_private *np = dev->priv; | |
41520 | ||
41521 | - i = copy_to_user(useraddr + sizeof(estats), tmp_stats, sz); | |
41522 | - kfree(tmp_stats); | |
41523 | + regs->version = RTL_REGS_VER; | |
41524 | ||
41525 | - if (i) | |
41526 | - return -EFAULT; | |
41527 | - return 0; | |
41528 | - } | |
41529 | - default: | |
41530 | - break; | |
41531 | - } | |
41532 | + spin_lock_irq(&np->lock); | |
41533 | + memcpy_fromio(regbuf, np->mmio_addr, regs->len); | |
41534 | + spin_unlock_irq(&np->lock); | |
41535 | +} | |
41536 | +#endif /* CONFIG_8139TOO_MMIO */ | |
41537 | ||
41538 | - return -EOPNOTSUPP; | |
41539 | +static int rtl8139_get_stats_count(struct net_device *dev) | |
41540 | +{ | |
41541 | + return RTL_NUM_STATS; | |
41542 | } | |
41543 | ||
41544 | +static void rtl8139_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data) | |
41545 | +{ | |
41546 | + struct rtl8139_private *np = dev->priv; | |
41547 | + | |
41548 | + data[0] = np->xstats.early_rx; | |
41549 | + data[1] = np->xstats.tx_buf_mapped; | |
41550 | + data[2] = np->xstats.tx_timeouts; | |
41551 | + data[3] = np->xstats.rx_lost_in_ring; | |
41552 | +} | |
41553 | + | |
41554 | +static void rtl8139_get_strings(struct net_device *dev, u32 stringset, u8 *data) | |
41555 | +{ | |
41556 | + memcpy(data, ethtool_stats_keys, sizeof(ethtool_stats_keys)); | |
41557 | +} | |
41558 | + | |
41559 | +static struct ethtool_ops rtl8139_ethtool_ops = { | |
41560 | + .get_drvinfo = rtl8139_get_drvinfo, | |
41561 | + .get_settings = rtl8139_get_settings, | |
41562 | + .set_settings = rtl8139_set_settings, | |
41563 | + .get_regs_len = rtl8139_get_regs_len, | |
41564 | + .get_regs = rtl8139_get_regs, | |
41565 | + .nway_reset = rtl8139_nway_reset, | |
41566 | + .get_link = rtl8139_get_link, | |
41567 | + .get_msglevel = rtl8139_get_msglevel, | |
41568 | + .set_msglevel = rtl8139_set_msglevel, | |
41569 | + .get_wol = rtl8139_get_wol, | |
41570 | + .set_wol = rtl8139_set_wol, | |
41571 | + .get_strings = rtl8139_get_strings, | |
41572 | + .get_stats_count = rtl8139_get_stats_count, | |
41573 | + .get_ethtool_stats = rtl8139_get_ethtool_stats, | |
41574 | +}; | |
41575 | ||
41576 | static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |
41577 | { | |
41578 | @@ -2457,14 +2363,9 @@ | |
41579 | if (!netif_running(dev)) | |
41580 | return -EINVAL; | |
41581 | ||
41582 | - if (cmd == SIOCETHTOOL) | |
41583 | - rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); | |
41584 | - | |
41585 | - else { | |
41586 | - spin_lock_irq(&np->lock); | |
41587 | - rc = generic_mii_ioctl(&np->mii, data, cmd, NULL); | |
41588 | - spin_unlock_irq(&np->lock); | |
41589 | - } | |
41590 | + spin_lock_irq(&np->lock); | |
41591 | + rc = generic_mii_ioctl(&np->mii, data, cmd, NULL); | |
41592 | + spin_unlock_irq(&np->lock); | |
41593 | ||
41594 | return rc; | |
41595 | } | |
41596 | diff -Nru a/drivers/net/8390.c b/drivers/net/8390.c | |
41597 | --- a/drivers/net/8390.c Sun Apr 20 21:26:41 2003 | |
41598 | +++ b/drivers/net/8390.c Mon Sep 1 09:50:20 2003 | |
41599 | @@ -997,6 +997,11 @@ | |
41600 | spin_unlock_irqrestore(&ei_local->page_lock, flags); | |
41601 | } | |
41602 | ||
41603 | +static inline void ei_device_init(struct ei_device *ei_local) | |
41604 | +{ | |
41605 | + spin_lock_init(&ei_local->page_lock); | |
41606 | +} | |
41607 | + | |
41608 | /** | |
41609 | * ethdev_init - init rest of 8390 device struct | |
41610 | * @dev: network device structure to init | |
41611 | @@ -1012,14 +1017,11 @@ | |
41612 | ||
41613 | if (dev->priv == NULL) | |
41614 | { | |
41615 | - struct ei_device *ei_local; | |
41616 | - | |
41617 | dev->priv = kmalloc(sizeof(struct ei_device), GFP_KERNEL); | |
41618 | if (dev->priv == NULL) | |
41619 | return -ENOMEM; | |
41620 | memset(dev->priv, 0, sizeof(struct ei_device)); | |
41621 | - ei_local = (struct ei_device *)dev->priv; | |
41622 | - spin_lock_init(&ei_local->page_lock); | |
41623 | + ei_device_init(dev->priv); | |
41624 | } | |
41625 | ||
41626 | dev->hard_start_xmit = &ei_start_xmit; | |
41627 | @@ -1030,6 +1032,29 @@ | |
41628 | ||
41629 | return 0; | |
41630 | } | |
41631 | + | |
41632 | +/* wrapper to make alloc_netdev happy; probably should just cast... */ | |
41633 | +static void __ethdev_init(struct net_device *dev) | |
41634 | +{ | |
41635 | + ethdev_init(dev); | |
41636 | +} | |
41637 | + | |
41638 | +/** | |
41639 | + * alloc_ei_netdev - alloc_etherdev counterpart for 8390 | |
41640 | + * | |
41641 | + * Allocate 8390-specific net_device. | |
41642 | + */ | |
41643 | +struct net_device *alloc_ei_netdev(void) | |
41644 | +{ | |
41645 | + struct net_device *dev; | |
41646 | + | |
41647 | + dev = alloc_netdev(sizeof(struct ei_device), "eth%d", __ethdev_init); | |
41648 | + if (dev) | |
41649 | + ei_device_init(dev->priv); | |
41650 | + | |
41651 | + return dev; | |
41652 | +} | |
41653 | + | |
41654 | \f | |
41655 | ||
41656 | ||
41657 | @@ -1133,6 +1158,7 @@ | |
41658 | EXPORT_SYMBOL(ei_tx_timeout); | |
41659 | EXPORT_SYMBOL(ethdev_init); | |
41660 | EXPORT_SYMBOL(NS8390_init); | |
41661 | +EXPORT_SYMBOL(alloc_ei_netdev); | |
41662 | ||
41663 | #if defined(MODULE) | |
41664 | ||
41665 | diff -Nru a/drivers/net/8390.h b/drivers/net/8390.h | |
41666 | --- a/drivers/net/8390.h Sat Jun 28 10:57:01 2003 | |
41667 | +++ b/drivers/net/8390.h Mon Sep 1 09:50:20 2003 | |
41668 | @@ -44,6 +44,7 @@ | |
41669 | extern int ei_open(struct net_device *dev); | |
41670 | extern int ei_close(struct net_device *dev); | |
41671 | extern irqreturn_t ei_interrupt(int irq, void *dev_id, struct pt_regs *regs); | |
41672 | +extern struct net_device *alloc_ei_netdev(void); | |
41673 | ||
41674 | /* You have one of these per-board */ | |
41675 | struct ei_device { | |
41676 | diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig | |
41677 | --- a/drivers/net/Kconfig Mon Aug 18 20:59:59 2003 | |
41678 | +++ b/drivers/net/Kconfig Tue Sep 2 15:05:18 2003 | |
41679 | @@ -132,8 +132,8 @@ | |
41680 | If you don't know what to use this for, you don't need it. | |
41681 | ||
41682 | config ETHERTAP | |
41683 | - tristate "Ethertap network tap (OBSOLETE)" | |
41684 | - depends on NETDEVICES && EXPERIMENTAL | |
41685 | + tristate "Ethertap network tap" | |
41686 | + depends on NETDEVICES && EXPERIMENTAL && NETLINK_DEV | |
41687 | ---help--- | |
41688 | If you say Y here (and have said Y to "Kernel/User network link | |
41689 | driver", above) and create a character special file /dev/tap0 with | |
41690 | @@ -502,7 +502,7 @@ | |
41691 | ||
41692 | config SGI_IOC3_ETH | |
41693 | bool "SGI IOC3 Ethernet" | |
41694 | - depends on NET_ETHERNET && (IA64_SGI_SN1 || SGI_IP27) | |
41695 | + depends on NET_ETHERNET && SGI_IP27 | |
41696 | help | |
41697 | If you have a network (Ethernet) card of this type, say Y and read | |
41698 | the Ethernet-HOWTO, available from | |
41699 | @@ -704,7 +704,7 @@ | |
41700 | ||
41701 | config ELMC_II | |
41702 | tristate "3c527 \"EtherLink/MC 32\" support (EXPERIMENTAL)" | |
41703 | - depends on NET_VENDOR_3COM && MCA && EXPERIMENTAL | |
41704 | + depends on NET_VENDOR_3COM && MCA && EXPERIMENTAL && BROKEN_ON_SMP | |
41705 | help | |
41706 | If you have a network (Ethernet) card of this type, say Y and read | |
41707 | the Ethernet-HOWTO, available from | |
41708 | @@ -882,7 +882,7 @@ | |
41709 | ||
41710 | config NI5010 | |
41711 | tristate "NI5010 support (EXPERIMENTAL)" | |
41712 | - depends on NET_VENDOR_RACAL && ISA && EXPERIMENTAL | |
41713 | + depends on NET_VENDOR_RACAL && ISA && EXPERIMENTAL && BROKEN_ON_SMP | |
41714 | ---help--- | |
41715 | If you have a network (Ethernet) card of this type, say Y and read | |
41716 | the Ethernet-HOWTO, available from | |
41717 | @@ -1221,7 +1221,7 @@ | |
41718 | ||
41719 | config SKMC | |
41720 | tristate "SKnet MCA support" | |
41721 | - depends on NET_ETHERNET && MCA | |
41722 | + depends on NET_ETHERNET && MCA && BROKEN | |
41723 | ---help--- | |
41724 | These are Micro Channel Ethernet adapters. You need to say Y to "MCA | |
41725 | support" in order to use this driver. Supported cards are the SKnet | |
41726 | @@ -2670,7 +2670,7 @@ | |
41727 | ||
41728 | config IPHASE5526 | |
41729 | tristate "Interphase 5526 Tachyon chipset based adapter support" | |
41730 | - depends on NET_FC && SCSI && PCI | |
41731 | + depends on NET_FC && SCSI && PCI && BROKEN | |
41732 | help | |
41733 | Say Y here if you have a Fibre Channel adaptor of this kind. | |
41734 | ||
41735 | diff -Nru a/drivers/net/Makefile.lib b/drivers/net/Makefile.lib | |
41736 | --- a/drivers/net/Makefile.lib Sun Aug 17 09:55:22 2003 | |
41737 | +++ b/drivers/net/Makefile.lib Wed Sep 3 10:43:37 2003 | |
41738 | @@ -5,6 +5,7 @@ | |
41739 | obj-$(CONFIG_ARM_AM79C961A) += crc32.o | |
41740 | obj-$(CONFIG_AT1700) += crc32.o | |
41741 | obj-$(CONFIG_ATP) += crc32.o | |
41742 | +obj-$(CONFIG_BMAC) += crc32.o | |
41743 | obj-$(CONFIG_DE2104X) += crc32.o | |
41744 | obj-$(CONFIG_DE4X5) += crc32.o | |
41745 | obj-$(CONFIG_DECLANCE) += crc32.o | |
41746 | diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c | |
41747 | --- a/drivers/net/Space.c Wed Jun 25 14:00:07 2003 | |
41748 | +++ b/drivers/net/Space.c Wed Sep 3 10:39:23 2003 | |
41749 | @@ -62,7 +62,6 @@ | |
41750 | extern int depca_probe(struct net_device *); | |
41751 | extern int i82596_probe(struct net_device *); | |
41752 | extern int ewrk3_probe(struct net_device *); | |
41753 | -extern int de4x5_probe(struct net_device *); | |
41754 | extern int el1_probe(struct net_device *); | |
41755 | extern int wavelan_probe(struct net_device *); | |
41756 | extern int arlan_probe(struct net_device *); | |
41757 | @@ -89,7 +88,6 @@ | |
41758 | extern int bionet_probe(struct net_device *); | |
41759 | extern int pamsnet_probe(struct net_device *); | |
41760 | extern int cs89x0_probe(struct net_device *dev); | |
41761 | -extern int ethertap_probe(struct net_device *dev); | |
41762 | extern int hplance_probe(struct net_device *dev); | |
41763 | extern int bagetlance_probe(struct net_device *); | |
41764 | extern int mvme147lance_probe(struct net_device *dev); | |
41765 | @@ -153,12 +151,9 @@ | |
41766 | * This is a bit of an artificial separation as there are PCI drivers | |
41767 | * that also probe for EISA cards (in the PCI group) and there are ISA | |
41768 | * drivers that probe for EISA cards (in the ISA group). These are the | |
41769 | - * EISA only driver probes, and also the legacy PCI probes | |
41770 | + * legacy EISA only driver probes, and also the legacy PCI probes | |
41771 | */ | |
41772 | static struct devprobe eisa_probes[] __initdata = { | |
41773 | -#ifdef CONFIG_DE4X5 /* DEC DE425, DE434, DE435 adapters */ | |
41774 | - {de4x5_probe, 0}, | |
41775 | -#endif | |
41776 | #ifdef CONFIG_ULTRA32 | |
41777 | {ultra32_probe, 0}, | |
41778 | #endif | |
41779 | @@ -386,17 +381,6 @@ | |
41780 | return 0; | |
41781 | return -ENODEV; | |
41782 | } | |
41783 | - | |
41784 | -#ifdef CONFIG_ETHERTAP | |
41785 | -static struct net_device tap0_dev = { | |
41786 | - .name = "tap0", | |
41787 | - .base_addr = NETLINK_TAPBASE, | |
41788 | - .next = NEXT_DEV, | |
41789 | - .init = ethertap_probe, | |
41790 | -}; | |
41791 | -#undef NEXT_DEV | |
41792 | -#define NEXT_DEV (&tap0_dev) | |
41793 | -#endif | |
41794 | ||
41795 | #ifdef CONFIG_SDLA | |
41796 | extern int sdla_init(struct net_device *); | |
41797 | diff -Nru a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c | |
41798 | --- a/drivers/net/arcnet/arcnet.c Mon Jul 21 05:31:03 2003 | |
41799 | +++ b/drivers/net/arcnet/arcnet.c Sun Aug 31 16:14:40 2003 | |
41800 | @@ -135,7 +135,7 @@ | |
41801 | arc_proto_map[count] = arc_proto_default; | |
41802 | ||
41803 | BUGLVL(D_DURING) | |
41804 | - printk("arcnet: struct sizes: %d %d %d %d %d\n", | |
41805 | + printk("arcnet: struct sizes: %Zd %Zd %Zd %Zd %Zd\n", | |
41806 | sizeof(struct arc_hardware), sizeof(struct arc_rfc1201), | |
41807 | sizeof(struct arc_rfc1051), sizeof(struct arc_eth_encap), | |
41808 | sizeof(struct archdr)); | |
41809 | diff -Nru a/drivers/net/arm/ether00.c b/drivers/net/arm/ether00.c | |
41810 | --- a/drivers/net/arm/ether00.c Tue Aug 19 20:53:15 2003 | |
41811 | +++ b/drivers/net/arm/ether00.c Sun Aug 31 16:14:08 2003 | |
41812 | @@ -991,9 +991,9 @@ | |
41813 | } | |
41814 | ||
41815 | static struct pld_hotswap_ops ether00_pldhs_ops={ | |
41816 | - name: ETHER00_NAME, | |
41817 | - add_device: ether00_add_device, | |
41818 | - remove_devices: ether00_remove_devices, | |
41819 | + .name = ETHER00_NAME, | |
41820 | + .add_device = ether00_add_device, | |
41821 | + .remove_devices = ether00_remove_devices, | |
41822 | }; | |
41823 | ||
41824 | ||
41825 | diff -Nru a/drivers/net/dummy.c b/drivers/net/dummy.c | |
41826 | --- a/drivers/net/dummy.c Tue Aug 19 20:53:15 2003 | |
41827 | +++ b/drivers/net/dummy.c Sun Aug 24 04:54:46 2003 | |
41828 | @@ -28,8 +28,6 @@ | |
41829 | Alan Cox, 30th May 1994 | |
41830 | */ | |
41831 | ||
41832 | -/* To have statistics (just packets sent) define this */ | |
41833 | - | |
41834 | #include <linux/config.h> | |
41835 | #include <linux/module.h> | |
41836 | #include <linux/kernel.h> | |
41837 | diff -Nru a/drivers/net/epic100.c b/drivers/net/epic100.c | |
41838 | --- a/drivers/net/epic100.c Tue Aug 19 20:53:15 2003 | |
41839 | +++ b/drivers/net/epic100.c Mon Sep 1 14:05:11 2003 | |
41840 | @@ -362,6 +362,7 @@ | |
41841 | static int epic_rx(struct net_device *dev); | |
41842 | static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs); | |
41843 | static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | |
41844 | +static struct ethtool_ops netdev_ethtool_ops; | |
41845 | static int epic_close(struct net_device *dev); | |
41846 | static struct net_device_stats *epic_get_stats(struct net_device *dev); | |
41847 | static void set_rx_mode(struct net_device *dev); | |
41848 | @@ -539,6 +540,7 @@ | |
41849 | dev->get_stats = &epic_get_stats; | |
41850 | dev->set_multicast_list = &set_rx_mode; | |
41851 | dev->do_ioctl = &netdev_ioctl; | |
41852 | + dev->ethtool_ops = &netdev_ethtool_ops; | |
41853 | dev->watchdog_timeo = TX_TIMEOUT; | |
41854 | dev->tx_timeout = &epic_tx_timeout; | |
41855 | ||
41856 | @@ -1361,82 +1363,73 @@ | |
41857 | return; | |
41858 | } | |
41859 | ||
41860 | -static int netdev_ethtool_ioctl (struct net_device *dev, void *useraddr) | |
41861 | +static void netdev_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info) | |
41862 | { | |
41863 | struct epic_private *np = dev->priv; | |
41864 | - u32 ethcmd; | |
41865 | ||
41866 | - if (copy_from_user (ðcmd, useraddr, sizeof (ethcmd))) | |
41867 | - return -EFAULT; | |
41868 | + strcpy (info->driver, DRV_NAME); | |
41869 | + strcpy (info->version, DRV_VERSION); | |
41870 | + strcpy (info->bus_info, pci_name(np->pci_dev)); | |
41871 | +} | |
41872 | ||
41873 | - switch (ethcmd) { | |
41874 | - case ETHTOOL_GDRVINFO: { | |
41875 | - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; | |
41876 | - strcpy (info.driver, DRV_NAME); | |
41877 | - strcpy (info.version, DRV_VERSION); | |
41878 | - strcpy (info.bus_info, pci_name(np->pci_dev)); | |
41879 | - if (copy_to_user (useraddr, &info, sizeof (info))) | |
41880 | - return -EFAULT; | |
41881 | - return 0; | |
41882 | - } | |
41883 | - | |
41884 | - /* get settings */ | |
41885 | - case ETHTOOL_GSET: { | |
41886 | - struct ethtool_cmd ecmd = { ETHTOOL_GSET }; | |
41887 | - spin_lock_irq(&np->lock); | |
41888 | - mii_ethtool_gset(&np->mii, &ecmd); | |
41889 | - spin_unlock_irq(&np->lock); | |
41890 | - if (copy_to_user(useraddr, &ecmd, sizeof(ecmd))) | |
41891 | - return -EFAULT; | |
41892 | - return 0; | |
41893 | - } | |
41894 | - /* set settings */ | |
41895 | - case ETHTOOL_SSET: { | |
41896 | - int r; | |
41897 | - struct ethtool_cmd ecmd; | |
41898 | - if (copy_from_user(&ecmd, useraddr, sizeof(ecmd))) | |
41899 | - return -EFAULT; | |
41900 | - spin_lock_irq(&np->lock); | |
41901 | - r = mii_ethtool_sset(&np->mii, &ecmd); | |
41902 | - spin_unlock_irq(&np->lock); | |
41903 | - return r; | |
41904 | - } | |
41905 | - /* restart autonegotiation */ | |
41906 | - case ETHTOOL_NWAY_RST: { | |
41907 | - return mii_nway_restart(&np->mii); | |
41908 | - } | |
41909 | - /* get link status */ | |
41910 | - case ETHTOOL_GLINK: { | |
41911 | - struct ethtool_value edata = {ETHTOOL_GLINK}; | |
41912 | - edata.data = mii_link_ok(&np->mii); | |
41913 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
41914 | - return -EFAULT; | |
41915 | - return 0; | |
41916 | - } | |
41917 | - | |
41918 | - /* get message-level */ | |
41919 | - case ETHTOOL_GMSGLVL: { | |
41920 | - struct ethtool_value edata = {ETHTOOL_GMSGLVL}; | |
41921 | - edata.data = debug; | |
41922 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
41923 | - return -EFAULT; | |
41924 | - return 0; | |
41925 | - } | |
41926 | - /* set message-level */ | |
41927 | - case ETHTOOL_SMSGLVL: { | |
41928 | - struct ethtool_value edata; | |
41929 | - if (copy_from_user(&edata, useraddr, sizeof(edata))) | |
41930 | - return -EFAULT; | |
41931 | - debug = edata.data; | |
41932 | - return 0; | |
41933 | - } | |
41934 | - default: | |
41935 | - break; | |
41936 | - } | |
41937 | +static int netdev_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |
41938 | +{ | |
41939 | + struct epic_private *np = dev->priv; | |
41940 | + int rc; | |
41941 | + | |
41942 | + spin_lock_irq(&np->lock); | |
41943 | + rc = mii_ethtool_gset(&np->mii, cmd); | |
41944 | + spin_unlock_irq(&np->lock); | |
41945 | + | |
41946 | + return rc; | |
41947 | +} | |
41948 | + | |
41949 | +static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |
41950 | +{ | |
41951 | + struct epic_private *np = dev->priv; | |
41952 | + int rc; | |
41953 | + | |
41954 | + spin_lock_irq(&np->lock); | |
41955 | + rc = mii_ethtool_sset(&np->mii, cmd); | |
41956 | + spin_unlock_irq(&np->lock); | |
41957 | + | |
41958 | + return rc; | |
41959 | +} | |
41960 | + | |
41961 | +static int netdev_nway_reset(struct net_device *dev) | |
41962 | +{ | |
41963 | + struct epic_private *np = dev->priv; | |
41964 | + return mii_nway_restart(&np->mii); | |
41965 | +} | |
41966 | ||
41967 | - return -EOPNOTSUPP; | |
41968 | +static u32 netdev_get_link(struct net_device *dev) | |
41969 | +{ | |
41970 | + struct epic_private *np = dev->priv; | |
41971 | + return mii_link_ok(&np->mii); | |
41972 | } | |
41973 | ||
41974 | +static u32 netdev_get_msglevel(struct net_device *dev) | |
41975 | +{ | |
41976 | + return debug; | |
41977 | +} | |
41978 | + | |
41979 | +static void netdev_set_msglevel(struct net_device *dev, u32 value) | |
41980 | +{ | |
41981 | + debug = value; | |
41982 | +} | |
41983 | + | |
41984 | +static struct ethtool_ops netdev_ethtool_ops = { | |
41985 | + .get_drvinfo = netdev_get_drvinfo, | |
41986 | + .get_settings = netdev_get_settings, | |
41987 | + .set_settings = netdev_set_settings, | |
41988 | + .nway_reset = netdev_nway_reset, | |
41989 | + .get_link = netdev_get_link, | |
41990 | + .get_msglevel = netdev_get_msglevel, | |
41991 | + .set_msglevel = netdev_set_msglevel, | |
41992 | + .get_sg = ethtool_op_get_sg, | |
41993 | + .get_tx_csum = ethtool_op_get_tx_csum, | |
41994 | +}; | |
41995 | + | |
41996 | static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |
41997 | { | |
41998 | struct epic_private *np = dev->priv; | |
41999 | @@ -1450,16 +1443,10 @@ | |
42000 | outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL); | |
42001 | } | |
42002 | ||
42003 | - /* ethtool commands */ | |
42004 | - if (cmd == SIOCETHTOOL) | |
42005 | - rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); | |
42006 | - | |
42007 | - /* all other ioctls (the SIOC[GS]MIIxxx ioctls) */ | |
42008 | - else { | |
42009 | - spin_lock_irq(&np->lock); | |
42010 | - rc = generic_mii_ioctl(&np->mii, data, cmd, NULL); | |
42011 | - spin_unlock_irq(&np->lock); | |
42012 | - } | |
42013 | + /* all non-ethtool ioctls (the SIOC[GS]MIIxxx ioctls) */ | |
42014 | + spin_lock_irq(&np->lock); | |
42015 | + rc = generic_mii_ioctl(&np->mii, data, cmd, NULL); | |
42016 | + spin_unlock_irq(&np->lock); | |
42017 | ||
42018 | /* power-down, if interface is down */ | |
42019 | if (! netif_running(dev)) { | |
42020 | diff -Nru a/drivers/net/eth16i.c b/drivers/net/eth16i.c | |
42021 | --- a/drivers/net/eth16i.c Sun Apr 27 20:36:19 2003 | |
42022 | +++ b/drivers/net/eth16i.c Sun Aug 31 06:34:16 2003 | |
42023 | @@ -1053,7 +1053,7 @@ | |
42024 | int ioaddr = dev->base_addr; | |
42025 | int status = 0; | |
42026 | ushort length = skb->len; | |
42027 | - unsigned char *buf = skb->data; | |
42028 | + unsigned char *buf; | |
42029 | unsigned long flags; | |
42030 | ||
42031 | if (length < ETH_ZLEN) { | |
42032 | @@ -1062,6 +1062,7 @@ | |
42033 | return 0; | |
42034 | length = ETH_ZLEN; | |
42035 | } | |
42036 | + buf = skb->data; | |
42037 | ||
42038 | netif_stop_queue(dev); | |
42039 | ||
42040 | diff -Nru a/drivers/net/ethertap.c b/drivers/net/ethertap.c | |
42041 | --- a/drivers/net/ethertap.c Sat Jun 7 14:14:59 2003 | |
42042 | +++ b/drivers/net/ethertap.c Tue Sep 2 13:28:19 2003 | |
42043 | @@ -33,7 +33,6 @@ | |
42044 | * Index to functions. | |
42045 | */ | |
42046 | ||
42047 | -int ethertap_probe(struct net_device *dev); | |
42048 | static int ethertap_open(struct net_device *dev); | |
42049 | static int ethertap_start_xmit(struct sk_buff *skb, struct net_device *dev); | |
42050 | static int ethertap_close(struct net_device *dev); | |
42051 | @@ -45,7 +44,11 @@ | |
42052 | ||
42053 | static int ethertap_debug; | |
42054 | ||
42055 | -static struct net_device *tap_map[32]; /* Returns the tap device for a given netlink */ | |
42056 | +static int max_taps = 1; | |
42057 | +MODULE_PARM(max_taps, "i"); | |
42058 | +MODULE_PARM_DESC(max_taps,"Max number of ethernet tap devices"); | |
42059 | + | |
42060 | +static struct net_device **tap_map; /* Returns the tap device for a given netlink */ | |
42061 | ||
42062 | /* | |
42063 | * Board-specific info in dev->priv. | |
42064 | @@ -64,25 +67,29 @@ | |
42065 | * To call this a probe is a bit misleading, however for real | |
42066 | * hardware it would have to check what was present. | |
42067 | */ | |
42068 | - | |
42069 | -int __init ethertap_probe(struct net_device *dev) | |
42070 | +static int __init ethertap_probe(int unit) | |
42071 | { | |
42072 | + struct net_device *dev; | |
42073 | + int err = -ENOMEM; | |
42074 | + | |
42075 | + dev = alloc_netdev(sizeof(struct net_local), "tap%d", | |
42076 | + ether_setup); | |
42077 | + | |
42078 | + if (!dev) | |
42079 | + goto out; | |
42080 | + | |
42081 | SET_MODULE_OWNER(dev); | |
42082 | ||
42083 | + sprintf(dev->name, "tap%d", unit); | |
42084 | + dev->base_addr = unit + NETLINK_TAPBASE; | |
42085 | + | |
42086 | + netdev_boot_setup_check(dev); | |
42087 | + | |
42088 | memcpy(dev->dev_addr, "\xFE\xFD\x00\x00\x00\x00", 6); | |
42089 | if (dev->mem_start & 0xf) | |
42090 | ethertap_debug = dev->mem_start & 0x7; | |
42091 | ||
42092 | /* | |
42093 | - * Initialize the device structure. | |
42094 | - */ | |
42095 | - | |
42096 | - dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL); | |
42097 | - if (dev->priv == NULL) | |
42098 | - return -ENOMEM; | |
42099 | - memset(dev->priv, 0, sizeof(struct net_local)); | |
42100 | - | |
42101 | - /* | |
42102 | * The tap specific entries in the device structure. | |
42103 | */ | |
42104 | ||
42105 | @@ -94,17 +101,19 @@ | |
42106 | dev->set_multicast_list = set_multicast_list; | |
42107 | #endif | |
42108 | ||
42109 | - /* | |
42110 | - * Setup the generic properties | |
42111 | - */ | |
42112 | - | |
42113 | - ether_setup(dev); | |
42114 | - | |
42115 | dev->tx_queue_len = 0; | |
42116 | dev->flags|=IFF_NOARP; | |
42117 | - tap_map[dev->base_addr]=dev; | |
42118 | ||
42119 | + err = register_netdev(dev); | |
42120 | + if (err) | |
42121 | + goto out_free; | |
42122 | + | |
42123 | + tap_map[unit]=dev; | |
42124 | return 0; | |
42125 | +out_free: | |
42126 | + free_netdev(dev); | |
42127 | +out: | |
42128 | + return err; | |
42129 | } | |
42130 | ||
42131 | /* | |
42132 | @@ -116,11 +125,12 @@ | |
42133 | struct net_local *lp = (struct net_local*)dev->priv; | |
42134 | ||
42135 | if (ethertap_debug > 2) | |
42136 | - printk("%s: Doing ethertap_open()...", dev->name); | |
42137 | + printk(KERN_DEBUG "%s: Doing ethertap_open()...", dev->name); | |
42138 | ||
42139 | lp->nl = netlink_kernel_create(dev->base_addr, ethertap_rx); | |
42140 | if (lp->nl == NULL) | |
42141 | return -ENOBUFS; | |
42142 | + | |
42143 | netif_start_queue(dev); | |
42144 | return 0; | |
42145 | } | |
42146 | @@ -302,7 +312,7 @@ | |
42147 | } | |
42148 | ||
42149 | if (ethertap_debug > 3) | |
42150 | - printk("%s: ethertap_rx()\n", dev->name); | |
42151 | + printk(KERN_DEBUG "%s: ethertap_rx()\n", dev->name); | |
42152 | ||
42153 | while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) | |
42154 | ethertap_rx_skb(skb, dev); | |
42155 | @@ -314,7 +324,7 @@ | |
42156 | struct sock *sk = lp->nl; | |
42157 | ||
42158 | if (ethertap_debug > 2) | |
42159 | - printk("%s: Shutting down.\n", dev->name); | |
42160 | + printk(KERN_DEBUG "%s: Shutting down.\n", dev->name); | |
42161 | ||
42162 | netif_stop_queue(dev); | |
42163 | ||
42164 | @@ -332,45 +342,49 @@ | |
42165 | return &lp->stats; | |
42166 | } | |
42167 | ||
42168 | -#ifdef MODULE | |
42169 | - | |
42170 | -static int unit; | |
42171 | -MODULE_PARM(unit,"i"); | |
42172 | -MODULE_PARM_DESC(unit,"Ethertap device number"); | |
42173 | ||
42174 | -static struct net_device dev_ethertap = | |
42175 | +int __init ethertap_init(void) | |
42176 | { | |
42177 | - .name = " ", | |
42178 | - .init = ethertap_probe | |
42179 | -}; | |
42180 | + int i, err = 0; | |
42181 | ||
42182 | -int init_module(void) | |
42183 | -{ | |
42184 | - dev_ethertap.base_addr=unit+NETLINK_TAPBASE; | |
42185 | - sprintf(dev_ethertap.name,"tap%d",unit); | |
42186 | - if (dev_get(dev_ethertap.name)) | |
42187 | - { | |
42188 | - printk(KERN_INFO "%s already loaded.\n", dev_ethertap.name); | |
42189 | - return -EBUSY; | |
42190 | - } | |
42191 | - if (register_netdev(&dev_ethertap) != 0) | |
42192 | - return -EIO; | |
42193 | - return 0; | |
42194 | -} | |
42195 | - | |
42196 | -void cleanup_module(void) | |
42197 | -{ | |
42198 | - tap_map[dev_ethertap.base_addr]=NULL; | |
42199 | - unregister_netdev(&dev_ethertap); | |
42200 | + /* netlink can only hande 16 entries unless modified */ | |
42201 | + if (max_taps > MAX_LINKS - NETLINK_TAPBASE) | |
42202 | + return -E2BIG; | |
42203 | ||
42204 | - /* | |
42205 | - * Free up the private structure. | |
42206 | - */ | |
42207 | + tap_map = kmalloc(sizeof(struct net_device *)*max_taps, GFP_KERNEL); | |
42208 | + if (!tap_map) | |
42209 | + return -ENOMEM; | |
42210 | ||
42211 | - kfree(dev_ethertap.priv); | |
42212 | - dev_ethertap.priv = NULL; /* gets re-allocated by ethertap_probe */ | |
42213 | + for (i = 0; i < max_taps; i++) { | |
42214 | + err = ethertap_probe(i); | |
42215 | + if (err) { | |
42216 | + while (--i > 0) { | |
42217 | + unregister_netdev(tap_map[i]); | |
42218 | + free_netdev(tap_map[i]); | |
42219 | + } | |
42220 | + break; | |
42221 | + } | |
42222 | + } | |
42223 | + if (err) | |
42224 | + kfree(tap_map); | |
42225 | + return err; | |
42226 | +} | |
42227 | +module_init(ethertap_init); | |
42228 | + | |
42229 | +void __exit ethertap_cleanup(void) | |
42230 | +{ | |
42231 | + int i; | |
42232 | + | |
42233 | + for (i = 0; i < max_taps; i++) { | |
42234 | + struct net_device *dev = tap_map[i]; | |
42235 | + if (dev) { | |
42236 | + tap_map[i] = NULL; | |
42237 | + unregister_netdev(dev); | |
42238 | + free_netdev(dev); | |
42239 | + } | |
42240 | + } | |
42241 | + kfree(tap_map); | |
42242 | } | |
42243 | +module_exit(ethertap_cleanup); | |
42244 | ||
42245 | -#endif /* MODULE */ | |
42246 | MODULE_LICENSE("GPL"); | |
42247 | - | |
42248 | diff -Nru a/drivers/net/fealnx.c b/drivers/net/fealnx.c | |
42249 | --- a/drivers/net/fealnx.c Tue Aug 19 20:53:16 2003 | |
42250 | +++ b/drivers/net/fealnx.c Mon Sep 1 14:18:01 2003 | |
42251 | @@ -443,6 +443,7 @@ | |
42252 | static void set_rx_mode(struct net_device *dev); | |
42253 | static struct net_device_stats *get_stats(struct net_device *dev); | |
42254 | static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | |
42255 | +static struct ethtool_ops netdev_ethtool_ops; | |
42256 | static int netdev_close(struct net_device *dev); | |
42257 | static void reset_rx_descriptors(struct net_device *dev); | |
42258 | ||
42259 | @@ -667,6 +668,7 @@ | |
42260 | dev->get_stats = &get_stats; | |
42261 | dev->set_multicast_list = &set_rx_mode; | |
42262 | dev->do_ioctl = &mii_ioctl; | |
42263 | + dev->ethtool_ops = &netdev_ethtool_ops; | |
42264 | dev->tx_timeout = tx_timeout; | |
42265 | dev->watchdog_timeo = TX_TIMEOUT; | |
42266 | ||
42267 | @@ -938,7 +940,7 @@ | |
42268 | // 89/9/1 modify, | |
42269 | // np->bcrvalue=0x38; | |
42270 | np->bcrvalue = 0x10; | |
42271 | - np->cralue = 0xe00; /* rx 128 burst length */ | |
42272 | + np->crvalue = 0xe00; /* rx 128 burst length */ | |
42273 | #warning Processor architecture undefined! | |
42274 | #endif | |
42275 | // 89/12/29 add, | |
42276 | @@ -1760,82 +1762,72 @@ | |
42277 | writel(np->crvalue, ioaddr + TCRRCR); | |
42278 | } | |
42279 | ||
42280 | -static int netdev_ethtool_ioctl (struct net_device *dev, void *useraddr) | |
42281 | +static void netdev_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info) | |
42282 | { | |
42283 | struct netdev_private *np = dev->priv; | |
42284 | - u32 ethcmd; | |
42285 | ||
42286 | - if (copy_from_user (ðcmd, useraddr, sizeof (ethcmd))) | |
42287 | - return -EFAULT; | |
42288 | + strcpy (info->driver, DRV_NAME); | |
42289 | + strcpy (info->version, DRV_VERSION); | |
42290 | + strcpy (info->bus_info, pci_name(np->pci_dev)); | |
42291 | +} | |
42292 | ||
42293 | - switch (ethcmd) { | |
42294 | - case ETHTOOL_GDRVINFO: { | |
42295 | - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; | |
42296 | - strcpy (info.driver, DRV_NAME); | |
42297 | - strcpy (info.version, DRV_VERSION); | |
42298 | - strcpy (info.bus_info, pci_name(np->pci_dev)); | |
42299 | - if (copy_to_user (useraddr, &info, sizeof (info))) | |
42300 | - return -EFAULT; | |
42301 | - return 0; | |
42302 | - } | |
42303 | - | |
42304 | - /* get settings */ | |
42305 | - case ETHTOOL_GSET: { | |
42306 | - struct ethtool_cmd ecmd = { ETHTOOL_GSET }; | |
42307 | - spin_lock_irq(&np->lock); | |
42308 | - mii_ethtool_gset(&np->mii, &ecmd); | |
42309 | - spin_unlock_irq(&np->lock); | |
42310 | - if (copy_to_user(useraddr, &ecmd, sizeof(ecmd))) | |
42311 | - return -EFAULT; | |
42312 | - return 0; | |
42313 | - } | |
42314 | - /* set settings */ | |
42315 | - case ETHTOOL_SSET: { | |
42316 | - int r; | |
42317 | - struct ethtool_cmd ecmd; | |
42318 | - if (copy_from_user(&ecmd, useraddr, sizeof(ecmd))) | |
42319 | - return -EFAULT; | |
42320 | - spin_lock_irq(&np->lock); | |
42321 | - r = mii_ethtool_sset(&np->mii, &ecmd); | |
42322 | - spin_unlock_irq(&np->lock); | |
42323 | - return r; | |
42324 | - } | |
42325 | - /* restart autonegotiation */ | |
42326 | - case ETHTOOL_NWAY_RST: { | |
42327 | - return mii_nway_restart(&np->mii); | |
42328 | - } | |
42329 | - /* get link status */ | |
42330 | - case ETHTOOL_GLINK: { | |
42331 | - struct ethtool_value edata = {ETHTOOL_GLINK}; | |
42332 | - edata.data = mii_link_ok(&np->mii); | |
42333 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
42334 | - return -EFAULT; | |
42335 | - return 0; | |
42336 | - } | |
42337 | - | |
42338 | - /* get message-level */ | |
42339 | - case ETHTOOL_GMSGLVL: { | |
42340 | - struct ethtool_value edata = {ETHTOOL_GMSGLVL}; | |
42341 | - edata.data = debug; | |
42342 | - if (copy_to_user(useraddr, &edata, sizeof(edata))) | |
42343 | - return -EFAULT; | |
42344 | - return 0; | |
42345 | - } | |
42346 | - /* set message-level */ | |
42347 | - case ETHTOOL_SMSGLVL: { | |
42348 | - struct ethtool_value edata; | |
42349 | - if (copy_from_user(&edata, useraddr, sizeof(edata))) | |
42350 | - return -EFAULT; | |
42351 | - debug = edata.data; | |
42352 | - return 0; | |
42353 | - } | |
42354 | - default: | |
42355 | - break; | |
42356 | - } | |
42357 | +static int netdev_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |
42358 | +{ | |
42359 | + struct netdev_private *np = dev->priv; | |
42360 | + int rc; | |
42361 | + | |
42362 | + spin_lock_irq(&np->lock); | |
42363 | + rc = mii_ethtool_gset(&np->mii, cmd); | |
42364 | + spin_unlock_irq(&np->lock); | |
42365 | + | |
42366 | + return rc; | |
42367 | +} | |
42368 | + | |
42369 | +static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |
42370 | +{ | |
42371 | + struct netdev_private *np = dev->priv; | |
42372 | + int rc; | |
42373 | + | |
42374 | + spin_lock_irq(&np->lock); | |
42375 | + rc = mii_ethtool_sset(&np->mii, cmd); | |
42376 | + spin_unlock_irq(&np->lock); | |
42377 | + | |
42378 | + return rc; | |
42379 | +} | |
42380 | + | |
42381 | +static int netdev_nway_reset(struct net_device *dev) | |
42382 | +{ | |
42383 | + struct netdev_private *np = dev->priv; | |
42384 | + return mii_nway_restart(&np->mii); | |
42385 | +} | |
42386 | + | |
42387 | +static u32 netdev_get_link(struct net_device *dev) | |
42388 | +{ | |
42389 | + struct netdev_private *np = dev->priv; | |
42390 | + return mii_link_ok(&np->mii); | |
42391 | +} | |
42392 | + | |
42393 | +static u32 netdev_get_msglevel(struct net_device *dev) | |
42394 | +{ | |
42395 | + return debug; | |
42396 | +} | |
42397 | ||
42398 | - return -EOPNOTSUPP; | |
42399 | +static void netdev_set_msglevel(struct net_device *dev, u32 value) | |
42400 | +{ | |
42401 | + debug = value; | |
42402 | } | |
42403 | ||
42404 | +static struct ethtool_ops netdev_ethtool_ops = { | |
42405 | + .get_drvinfo = netdev_get_drvinfo, | |
42406 | + .get_settings = netdev_get_settings, | |
42407 | + .set_settings = netdev_set_settings, | |
42408 | + .nway_reset = netdev_nway_reset, | |
42409 | + .get_link = netdev_get_link, | |
42410 | + .get_msglevel = netdev_get_msglevel, | |
42411 | + .set_msglevel = netdev_set_msglevel, | |
42412 | + .get_sg = ethtool_op_get_sg, | |
42413 | + .get_tx_csum = ethtool_op_get_tx_csum, | |
42414 | +}; | |
42415 | ||
42416 | static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |
42417 | { | |
42418 | @@ -1846,14 +1838,9 @@ | |
42419 | if (!netif_running(dev)) | |
42420 | return -EINVAL; | |
42421 | ||
42422 | - if (cmd == SIOCETHTOOL) | |
42423 | - rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); | |
42424 | - | |
42425 | - else { | |
42426 | - spin_lock_irq(&np->lock); | |
42427 | - rc = generic_mii_ioctl(&np->mii, data, cmd, NULL); | |
42428 | - spin_unlock_irq(&np->lock); | |
42429 | - } | |
42430 | + spin_lock_irq(&np->lock); | |
42431 | + rc = generic_mii_ioctl(&np->mii, data, cmd, NULL); | |
42432 | + spin_unlock_irq(&np->lock); | |
42433 | ||
42434 | return rc; | |
42435 | } | |
42436 | diff -Nru a/drivers/net/fmv18x.c b/drivers/net/fmv18x.c | |
42437 | --- a/drivers/net/fmv18x.c Sun May 11 19:48:01 2003 | |
42438 | +++ b/drivers/net/fmv18x.c Sun Aug 31 06:34:16 2003 | |
42439 | @@ -367,7 +367,7 @@ | |
42440 | struct net_local *lp = dev->priv; | |
42441 | int ioaddr = dev->base_addr; | |
42442 | short length = skb->len; | |
42443 | - unsigned char *buf = skb->data; | |
42444 | + unsigned char *buf; | |
42445 | unsigned long flags; | |
42446 | ||
42447 | /* Block a transmit from overlapping. */ | |
42448 | @@ -385,6 +385,7 @@ | |
42449 | return 0; | |
42450 | length = ETH_ZLEN; | |
42451 | } | |
42452 | + buf = skb->data; | |
42453 | ||
42454 | if (net_debug > 4) | |
42455 | printk("%s: Transmitting a packet of length %lu.\n", dev->name, | |
42456 | diff -Nru a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c | |
42457 | --- a/drivers/net/hamradio/6pack.c Fri Aug 1 03:02:07 2003 | |
42458 | +++ b/drivers/net/hamradio/6pack.c Wed Sep 3 23:40:16 2003 | |
42459 | @@ -1064,6 +1064,7 @@ | |
42460 |