* upgrade ixp4xx to 2.6.23.12
[openwrt.git] / target / linux / olpc / patches / 100-olpc.patch
1 diff --git a/MAINTAINERS b/MAINTAINERS
2 index 9c54a5e..f88d691 100644
3 --- a/MAINTAINERS
4 +++ b/MAINTAINERS
5 @@ -3026,6 +3026,13 @@ L: linux-wireless@vger.kernel.org
6 W: http://prism54.org
7 S: Maintained
8
9 +ADM8211 WIRELESS DRIVER
10 +P: Michael Wu
11 +M: flamingice@sourmilk.net
12 +L: netdev@vger.kernel.org
13 +W: http://aluminum.sourmilk.net/adm8211/netdev/
14 +S: Maintained
15 +
16 PROMISE DC4030 CACHING DISK CONTROLLER DRIVER
17 P: Peter Denison
18 M: promise@pnd-pc.demon.co.uk
19 diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
20 index 97b64d7..92ceab7 100644
21 --- a/arch/i386/Kconfig
22 +++ b/arch/i386/Kconfig
23 @@ -796,6 +796,15 @@ config SECCOMP
24
25 If unsure, say Y. Only embedded should say N here.
26
27 +config VGA_NOPROBE
28 + bool "Don't probe VGA at boot" if EMBEDDED
29 + default n
30 + help
31 + Saying Y here will cause the kernel to not probe VGA at boot time.
32 + This will break everything that depends on the probed screen
33 + data. Say N here unless you are absolutely sure this is what you
34 + want.
35 +
36 source kernel/Kconfig.hz
37
38 config KEXEC
39 @@ -1120,6 +1129,9 @@ config PCI_GODIRECT
40 config PCI_GOANY
41 bool "Any"
42
43 +config PCI_GOOLPC
44 + bool "OLPC"
45 +
46 endchoice
47
48 config PCI_BIOS
49 @@ -1129,7 +1141,7 @@ config PCI_BIOS
50
51 config PCI_DIRECT
52 bool
53 - depends on PCI && ((PCI_GODIRECT || PCI_GOANY) || X86_VISWS)
54 + depends on PCI && ((PCI_GODIRECT || PCI_GOANY || PCI_GOOLPC) || X86_VISWS)
55 default y
56
57 config PCI_MMCONFIG
58 @@ -1137,6 +1149,11 @@ config PCI_MMCONFIG
59 depends on PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY)
60 default y
61
62 +config PCI_OLPC
63 + bool
64 + depends on PCI && PCI_GOOLPC
65 + default y
66 +
67 source "drivers/pci/pcie/Kconfig"
68
69 source "drivers/pci/Kconfig"
70 @@ -1206,10 +1223,43 @@ config SCx200HR_TIMER
71 processor goes idle (as is done by the scheduler). The
72 other workaround is idle=poll boot option.
73
74 +config GEODE_MFGPT_TIMER
75 + bool "Geode Multi-Function General Purpose Timer (mfgpt) Support"
76 + depends on MGEODE_LX && GENERIC_TIME && GENERIC_CLOCKEVENTS
77 + default y
78 + help
79 + This driver provides a clock event source based on the MFGPT
80 + timer(s) in the CS5535 and CS5536 companion chip for the geode.
81 + MFGPTs have a better resolution and max interval than the
82 + generic PIT, and are suitable for use as high-res timers.
83 +
84 config K8_NB
85 def_bool y
86 depends on AGP_AMD64
87
88 +config OLPC
89 + bool "OLPC Support"
90 + default n
91 + help
92 + Add support for detecting the unique features of the OLPC
93 + Childrens Machine
94 +
95 +config OLPC_PM
96 + tristate "OLPC power management support"
97 + default y
98 + depends on OLPC
99 + help
100 + Add support for the Geode power management facilities on the
101 + OLPC Childrens Machine
102 +
103 +config OPEN_FIRMWARE
104 + bool "Support for Open Firmware"
105 + default y if OLPC
106 + help
107 + This option adds support for the implementation of Open Firmware
108 + that is used on the OLPC Children's Machine.
109 + If unsure, say N here.
110 +
111 source "drivers/pcmcia/Kconfig"
112
113 source "drivers/pci/hotplug/Kconfig"
114 diff --git a/arch/i386/boot/setup.S b/arch/i386/boot/setup.S
115 new file mode 100644
116 index 0000000..4cf6e23
117 --- /dev/null
118 +++ b/arch/i386/boot/setup.S
119 @@ -0,0 +1,1080 @@
120 +/*
121 + * setup.S Copyright (C) 1991, 1992 Linus Torvalds
122 + *
123 + * setup.s is responsible for getting the system data from the BIOS,
124 + * and putting them into the appropriate places in system memory.
125 + * both setup.s and system has been loaded by the bootblock.
126 + *
127 + * This code asks the bios for memory/disk/other parameters, and
128 + * puts them in a "safe" place: 0x90000-0x901FF, ie where the
129 + * boot-block used to be. It is then up to the protected mode
130 + * system to read them from there before the area is overwritten
131 + * for buffer-blocks.
132 + *
133 + * Move PS/2 aux init code to psaux.c
134 + * (troyer@saifr00.cfsat.Honeywell.COM) 03Oct92
135 + *
136 + * some changes and additional features by Christoph Niemann,
137 + * March 1993/June 1994 (Christoph.Niemann@linux.org)
138 + *
139 + * add APM BIOS checking by Stephen Rothwell, May 1994
140 + * (sfr@canb.auug.org.au)
141 + *
142 + * High load stuff, initrd support and position independency
143 + * by Hans Lermen & Werner Almesberger, February 1996
144 + * <lermen@elserv.ffm.fgan.de>, <almesber@lrc.epfl.ch>
145 + *
146 + * Video handling moved to video.S by Martin Mares, March 1996
147 + * <mj@k332.feld.cvut.cz>
148 + *
149 + * Extended memory detection scheme retwiddled by orc@pell.chi.il.us (david
150 + * parsons) to avoid loadlin confusion, July 1997
151 + *
152 + * Transcribed from Intel (as86) -> AT&T (gas) by Chris Noe, May 1999.
153 + * <stiker@northlink.com>
154 + *
155 + * Fix to work around buggy BIOSes which don't use carry bit correctly
156 + * and/or report extended memory in CX/DX for e801h memory size detection
157 + * call. As a result the kernel got wrong figures. The int15/e801h docs
158 + * from Ralf Brown interrupt list seem to indicate AX/BX should be used
159 + * anyway. So to avoid breaking many machines (presumably there was a reason
160 + * to orginally use CX/DX instead of AX/BX), we do a kludge to see
161 + * if CX/DX have been changed in the e801 call and if so use AX/BX .
162 + * Michael Miller, April 2001 <michaelm@mjmm.org>
163 + *
164 + * New A20 code ported from SYSLINUX by H. Peter Anvin. AMD Elan bugfixes
165 + * by Robert Schwebel, December 2001 <robert@schwebel.de>
166 + */
167 +
168 +#include <asm/segment.h>
169 +#include <linux/utsrelease.h>
170 +#include <linux/compile.h>
171 +#include <asm/boot.h>
172 +#include <asm/e820.h>
173 +#include <asm/page.h>
174 +#include <asm/setup.h>
175 +
176 +/* Signature words to ensure LILO loaded us right */
177 +#define SIG1 0xAA55
178 +#define SIG2 0x5A5A
179 +
180 +INITSEG = DEF_INITSEG # 0x9000, we move boot here, out of the way
181 +SYSSEG = DEF_SYSSEG # 0x1000, system loaded at 0x10000 (65536).
182 +SETUPSEG = DEF_SETUPSEG # 0x9020, this is the current segment
183 + # ... and the former contents of CS
184 +
185 +DELTA_INITSEG = SETUPSEG - INITSEG # 0x0020
186 +
187 +.code16
188 +.globl begtext, begdata, begbss, endtext, enddata, endbss
189 +
190 +.text
191 +begtext:
192 +.data
193 +begdata:
194 +.bss
195 +begbss:
196 +.text
197 +
198 +start:
199 + jmp trampoline
200 +
201 +# This is the setup header, and it must start at %cs:2 (old 0x9020:2)
202 +
203 + .ascii "HdrS" # header signature
204 + .word 0x0206 # header version number (>= 0x0105)
205 + # or else old loadlin-1.5 will fail)
206 +realmode_swtch: .word 0, 0 # default_switch, SETUPSEG
207 +start_sys_seg: .word SYSSEG
208 + .word kernel_version # pointing to kernel version string
209 + # above section of header is compatible
210 + # with loadlin-1.5 (header v1.5). Don't
211 + # change it.
212 +
213 +type_of_loader: .byte 0 # = 0, old one (LILO, Loadlin,
214 + # Bootlin, SYSLX, bootsect...)
215 + # See Documentation/i386/boot.txt for
216 + # assigned ids
217 +
218 +# flags, unused bits must be zero (RFU) bit within loadflags
219 +loadflags:
220 +LOADED_HIGH = 1 # If set, the kernel is loaded high
221 +CAN_USE_HEAP = 0x80 # If set, the loader also has set
222 + # heap_end_ptr to tell how much
223 + # space behind setup.S can be used for
224 + # heap purposes.
225 + # Only the loader knows what is free
226 +#ifndef __BIG_KERNEL__
227 + .byte 0
228 +#else
229 + .byte LOADED_HIGH
230 +#endif
231 +
232 +setup_move_size: .word 0x8000 # size to move, when setup is not
233 + # loaded at 0x90000. We will move setup
234 + # to 0x90000 then just before jumping
235 + # into the kernel. However, only the
236 + # loader knows how much data behind
237 + # us also needs to be loaded.
238 +
239 +code32_start: # here loaders can put a different
240 + # start address for 32-bit code.
241 +#ifndef __BIG_KERNEL__
242 + .long 0x1000 # 0x1000 = default for zImage
243 +#else
244 + .long 0x100000 # 0x100000 = default for big kernel
245 +#endif
246 +
247 +ramdisk_image: .long 0 # address of loaded ramdisk image
248 + # Here the loader puts the 32-bit
249 + # address where it loaded the image.
250 + # This only will be read by the kernel.
251 +
252 +ramdisk_size: .long 0 # its size in bytes
253 +
254 +bootsect_kludge:
255 + .long 0 # obsolete
256 +
257 +heap_end_ptr: .word modelist+1024 # (Header version 0x0201 or later)
258 + # space from here (exclusive) down to
259 + # end of setup code can be used by setup
260 + # for local heap purposes.
261 +
262 +pad1: .word 0
263 +cmd_line_ptr: .long 0 # (Header version 0x0202 or later)
264 + # If nonzero, a 32-bit pointer
265 + # to the kernel command line.
266 + # The command line should be
267 + # located between the start of
268 + # setup and the end of low
269 + # memory (0xa0000), or it may
270 + # get overwritten before it
271 + # gets read. If this field is
272 + # used, there is no longer
273 + # anything magical about the
274 + # 0x90000 segment; the setup
275 + # can be located anywhere in
276 + # low memory 0x10000 or higher.
277 +
278 +ramdisk_max: .long (-__PAGE_OFFSET-(512 << 20)-1) & 0x7fffffff
279 + # (Header version 0x0203 or later)
280 + # The highest safe address for
281 + # the contents of an initrd
282 +
283 +kernel_alignment: .long CONFIG_PHYSICAL_ALIGN #physical addr alignment
284 + #required for protected mode
285 + #kernel
286 +#ifdef CONFIG_RELOCATABLE
287 +relocatable_kernel: .byte 1
288 +#else
289 +relocatable_kernel: .byte 0
290 +#endif
291 +pad2: .byte 0
292 +pad3: .word 0
293 +
294 +cmdline_size: .long COMMAND_LINE_SIZE-1 #length of the command line,
295 + #added with boot protocol
296 + #version 2.06
297 +
298 +trampoline: call start_of_setup
299 + .align 16
300 + # The offset at this point is 0x240
301 + .space (0xeff-0x240+1) # E820 & EDD space (ending at 0xeff)
302 +# End of setup header #####################################################
303 +
304 +start_of_setup:
305 +# Bootlin depends on this being done early
306 + movw $0x01500, %ax
307 + movb $0x81, %dl
308 + int $0x13
309 +
310 +#ifdef SAFE_RESET_DISK_CONTROLLER
311 +# Reset the disk controller.
312 + movw $0x0000, %ax
313 + movb $0x80, %dl
314 + int $0x13
315 +#endif
316 +
317 +# Set %ds = %cs, we know that SETUPSEG = %cs at this point
318 + movw %cs, %ax # aka SETUPSEG
319 + movw %ax, %ds
320 +# Check signature at end of setup
321 + cmpw $SIG1, setup_sig1
322 + jne bad_sig
323 +
324 + cmpw $SIG2, setup_sig2
325 + jne bad_sig
326 +
327 + jmp good_sig1
328 +
329 +# Routine to print asciiz string at ds:si
330 +prtstr:
331 + lodsb
332 + andb %al, %al
333 + jz fin
334 +
335 + call prtchr
336 + jmp prtstr
337 +
338 +fin: ret
339 +
340 +# Space printing
341 +prtsp2: call prtspc # Print double space
342 +prtspc: movb $0x20, %al # Print single space (note: fall-thru)
343 +
344 +# Part of above routine, this one just prints ascii al
345 +prtchr: pushw %ax
346 + pushw %cx
347 + movw $7,%bx
348 + movw $0x01, %cx
349 + movb $0x0e, %ah
350 + int $0x10
351 + popw %cx
352 + popw %ax
353 + ret
354 +
355 +beep: movb $0x07, %al
356 + jmp prtchr
357 +
358 +no_sig_mess: .string "No setup signature found ..."
359 +
360 +good_sig1:
361 + jmp good_sig
362 +
363 +# We now have to find the rest of the setup code/data
364 +bad_sig:
365 + movw %cs, %ax # SETUPSEG
366 + subw $DELTA_INITSEG, %ax # INITSEG
367 + movw %ax, %ds
368 + xorb %bh, %bh
369 + movb (497), %bl # get setup sect from bootsect
370 + subw $4, %bx # LILO loads 4 sectors of setup
371 + shlw $8, %bx # convert to words (1sect=2^8 words)
372 + movw %bx, %cx
373 + shrw $3, %bx # convert to segment
374 + addw $SYSSEG, %bx
375 + movw %bx, %cs:start_sys_seg
376 +# Move rest of setup code/data to here
377 + movw $2048, %di # four sectors loaded by LILO
378 + subw %si, %si
379 + pushw %cs
380 + popw %es
381 + movw $SYSSEG, %ax
382 + movw %ax, %ds
383 + rep
384 + movsw
385 + movw %cs, %ax # aka SETUPSEG
386 + movw %ax, %ds
387 + cmpw $SIG1, setup_sig1
388 + jne no_sig
389 +
390 + cmpw $SIG2, setup_sig2
391 + jne no_sig
392 +
393 + jmp good_sig
394 +
395 +no_sig:
396 + lea no_sig_mess, %si
397 + call prtstr
398 +
399 +no_sig_loop:
400 + hlt
401 + jmp no_sig_loop
402 +
403 +good_sig:
404 + movw %cs, %ax # aka SETUPSEG
405 + subw $DELTA_INITSEG, %ax # aka INITSEG
406 + movw %ax, %ds
407 +# Check if an old loader tries to load a big-kernel
408 + testb $LOADED_HIGH, %cs:loadflags # Do we have a big kernel?
409 + jz loader_ok # No, no danger for old loaders.
410 +
411 + cmpb $0, %cs:type_of_loader # Do we have a loader that
412 + # can deal with us?
413 + jnz loader_ok # Yes, continue.
414 +
415 + pushw %cs # No, we have an old loader,
416 + popw %ds # die.
417 + lea loader_panic_mess, %si
418 + call prtstr
419 +
420 + jmp no_sig_loop
421 +
422 +loader_panic_mess: .string "Wrong loader, giving up..."
423 +
424 +# check minimum cpuid
425 +# we do this here because it is the last place we can actually
426 +# show a user visible error message. Later the video modus
427 +# might be already messed up.
428 +loader_ok:
429 + call verify_cpu
430 + testl %eax,%eax
431 + jz cpu_ok
432 + movw %cs,%ax # aka SETUPSEG
433 + movw %ax,%ds
434 + lea cpu_panic_mess,%si
435 + call prtstr
436 +1: jmp 1b
437 +
438 +cpu_panic_mess:
439 + .asciz "PANIC: CPU too old for this kernel."
440 +
441 +#include "../kernel/verify_cpu.S"
442 +
443 +cpu_ok:
444 +# Get memory size (extended mem, kB)
445 +
446 + xorl %eax, %eax
447 + movl %eax, (0x1e0)
448 +#ifndef STANDARD_MEMORY_BIOS_CALL
449 + movb %al, (E820NR)
450 +# Try three different memory detection schemes. First, try
451 +# e820h, which lets us assemble a memory map, then try e801h,
452 +# which returns a 32-bit memory size, and finally 88h, which
453 +# returns 0-64m
454 +
455 +# method E820H:
456 +# the memory map from hell. e820h returns memory classified into
457 +# a whole bunch of different types, and allows memory holes and
458 +# everything. We scan through this memory map and build a list
459 +# of the first 32 memory areas, which we return at [E820MAP].
460 +# This is documented at http://www.acpi.info/, in the ACPI 2.0 specification.
461 +
462 +#define SMAP 0x534d4150
463 +
464 +meme820:
465 + xorl %ebx, %ebx # continuation counter
466 + movw $E820MAP, %di # point into the whitelist
467 + # so we can have the bios
468 + # directly write into it.
469 +
470 +jmpe820:
471 + movl $0x0000e820, %eax # e820, upper word zeroed
472 + movl $SMAP, %edx # ascii 'SMAP'
473 + movl $20, %ecx # size of the e820rec
474 + pushw %ds # data record.
475 + popw %es
476 + int $0x15 # make the call
477 + jc bail820 # fall to e801 if it fails
478 +
479 + cmpl $SMAP, %eax # check the return is `SMAP'
480 + jne bail820 # fall to e801 if it fails
481 +
482 +# cmpl $1, 16(%di) # is this usable memory?
483 +# jne again820
484 +
485 + # If this is usable memory, we save it by simply advancing %di by
486 + # sizeof(e820rec).
487 + #
488 +good820:
489 + movb (E820NR), %al # up to 128 entries
490 + cmpb $E820MAX, %al
491 + jae bail820
492 +
493 + incb (E820NR)
494 + movw %di, %ax
495 + addw $20, %ax
496 + movw %ax, %di
497 +again820:
498 + cmpl $0, %ebx # check to see if
499 + jne jmpe820 # %ebx is set to EOF
500 +bail820:
501 +
502 +
503 +# method E801H:
504 +# memory size is in 1k chunksizes, to avoid confusing loadlin.
505 +# we store the 0xe801 memory size in a completely different place,
506 +# because it will most likely be longer than 16 bits.
507 +# (use 1e0 because that's what Larry Augustine uses in his
508 +# alternative new memory detection scheme, and it's sensible
509 +# to write everything into the same place.)
510 +
511 +meme801:
512 + stc # fix to work around buggy
513 + xorw %cx,%cx # BIOSes which don't clear/set
514 + xorw %dx,%dx # carry on pass/error of
515 + # e801h memory size call
516 + # or merely pass cx,dx though
517 + # without changing them.
518 + movw $0xe801, %ax
519 + int $0x15
520 + jc mem88
521 +
522 + cmpw $0x0, %cx # Kludge to handle BIOSes
523 + jne e801usecxdx # which report their extended
524 + cmpw $0x0, %dx # memory in AX/BX rather than
525 + jne e801usecxdx # CX/DX. The spec I have read
526 + movw %ax, %cx # seems to indicate AX/BX
527 + movw %bx, %dx # are more reasonable anyway...
528 +
529 +e801usecxdx:
530 + andl $0xffff, %edx # clear sign extend
531 + shll $6, %edx # and go from 64k to 1k chunks
532 + movl %edx, (0x1e0) # store extended memory size
533 + andl $0xffff, %ecx # clear sign extend
534 + addl %ecx, (0x1e0) # and add lower memory into
535 + # total size.
536 +
537 +# Ye Olde Traditional Methode. Returns the memory size (up to 16mb or
538 +# 64mb, depending on the bios) in ax.
539 +mem88:
540 +
541 +#endif
542 + movb $0x88, %ah
543 + int $0x15
544 + movw %ax, (2)
545 +
546 +# Set the keyboard repeat rate to the max
547 + movw $0x0305, %ax
548 + xorw %bx, %bx
549 + int $0x16
550 +
551 +#ifndef CONFIG_VGA_NOPROBE
552 +
553 +# Check for video adapter and its parameters and allow the
554 +# user to browse video modes.
555 + call video # NOTE: we need %ds pointing
556 + # to bootsector
557 +#endif
558 +
559 +# Get hd0 data...
560 + xorw %ax, %ax
561 + movw %ax, %ds
562 + ldsw (4 * 0x41), %si
563 + movw %cs, %ax # aka SETUPSEG
564 + subw $DELTA_INITSEG, %ax # aka INITSEG
565 + pushw %ax
566 + movw %ax, %es
567 + movw $0x0080, %di
568 + movw $0x10, %cx
569 + pushw %cx
570 + cld
571 + rep
572 + movsb
573 +# Get hd1 data...
574 + xorw %ax, %ax
575 + movw %ax, %ds
576 + ldsw (4 * 0x46), %si
577 + popw %cx
578 + popw %es
579 + movw $0x0090, %di
580 + rep
581 + movsb
582 +# Check that there IS a hd1 :-)
583 + movw $0x01500, %ax
584 + movb $0x81, %dl
585 + int $0x13
586 + jc no_disk1
587 +
588 + cmpb $3, %ah
589 + je is_disk1
590 +
591 +no_disk1:
592 + movw %cs, %ax # aka SETUPSEG
593 + subw $DELTA_INITSEG, %ax # aka INITSEG
594 + movw %ax, %es
595 + movw $0x0090, %di
596 + movw $0x10, %cx
597 + xorw %ax, %ax
598 + cld
599 + rep
600 + stosb
601 +is_disk1:
602 +# check for Micro Channel (MCA) bus
603 + movw %cs, %ax # aka SETUPSEG
604 + subw $DELTA_INITSEG, %ax # aka INITSEG
605 + movw %ax, %ds
606 + xorw %ax, %ax
607 + movw %ax, (0xa0) # set table length to 0
608 + movb $0xc0, %ah
609 + stc
610 + int $0x15 # moves feature table to es:bx
611 + jc no_mca
612 +
613 + pushw %ds
614 + movw %es, %ax
615 + movw %ax, %ds
616 + movw %cs, %ax # aka SETUPSEG
617 + subw $DELTA_INITSEG, %ax # aka INITSEG
618 + movw %ax, %es
619 + movw %bx, %si
620 + movw $0xa0, %di
621 + movw (%si), %cx
622 + addw $2, %cx # table length is a short
623 + cmpw $0x10, %cx
624 + jc sysdesc_ok
625 +
626 + movw $0x10, %cx # we keep only first 16 bytes
627 +sysdesc_ok:
628 + rep
629 + movsb
630 + popw %ds
631 +no_mca:
632 +#ifdef CONFIG_X86_VOYAGER
633 + movb $0xff, 0x40 # flag on config found
634 + movb $0xc0, %al
635 + mov $0xff, %ah
636 + int $0x15 # put voyager config info at es:di
637 + jc no_voyager
638 + movw $0x40, %si # place voyager info in apm table
639 + cld
640 + movw $7, %cx
641 +voyager_rep:
642 + movb %es:(%di), %al
643 + movb %al,(%si)
644 + incw %di
645 + incw %si
646 + decw %cx
647 + jnz voyager_rep
648 +no_voyager:
649 +#endif
650 +# Check for PS/2 pointing device
651 + movw %cs, %ax # aka SETUPSEG
652 + subw $DELTA_INITSEG, %ax # aka INITSEG
653 + movw %ax, %ds
654 + movb $0, (0x1ff) # default is no pointing device
655 + int $0x11 # int 0x11: equipment list
656 + testb $0x04, %al # check if mouse installed
657 + jz no_psmouse
658 +
659 + movb $0xAA, (0x1ff) # device present
660 +no_psmouse:
661 +
662 +#if defined(CONFIG_X86_SPEEDSTEP_SMI) || defined(CONFIG_X86_SPEEDSTEP_SMI_MODULE)
663 + movl $0x0000E980, %eax # IST Support
664 + movl $0x47534943, %edx # Request value
665 + int $0x15
666 +
667 + movl %eax, (96)
668 + movl %ebx, (100)
669 + movl %ecx, (104)
670 + movl %edx, (108)
671 +#endif
672 +
673 +#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
674 +# Then check for an APM BIOS...
675 + # %ds points to the bootsector
676 + movw $0, 0x40 # version = 0 means no APM BIOS
677 + movw $0x05300, %ax # APM BIOS installation check
678 + xorw %bx, %bx
679 + int $0x15
680 + jc done_apm_bios # Nope, no APM BIOS
681 +
682 + cmpw $0x0504d, %bx # Check for "PM" signature
683 + jne done_apm_bios # No signature, no APM BIOS
684 +
685 + andw $0x02, %cx # Is 32 bit supported?
686 + je done_apm_bios # No 32-bit, no (good) APM BIOS
687 +
688 + movw $0x05304, %ax # Disconnect first just in case
689 + xorw %bx, %bx
690 + int $0x15 # ignore return code
691 + movw $0x05303, %ax # 32 bit connect
692 + xorl %ebx, %ebx
693 + xorw %cx, %cx # paranoia :-)
694 + xorw %dx, %dx # ...
695 + xorl %esi, %esi # ...
696 + xorw %di, %di # ...
697 + int $0x15
698 + jc no_32_apm_bios # Ack, error.
699 +
700 + movw %ax, (66) # BIOS code segment
701 + movl %ebx, (68) # BIOS entry point offset
702 + movw %cx, (72) # BIOS 16 bit code segment
703 + movw %dx, (74) # BIOS data segment
704 + movl %esi, (78) # BIOS code segment lengths
705 + movw %di, (82) # BIOS data segment length
706 +# Redo the installation check as the 32 bit connect
707 +# modifies the flags returned on some BIOSs
708 + movw $0x05300, %ax # APM BIOS installation check
709 + xorw %bx, %bx
710 + xorw %cx, %cx # paranoia
711 + int $0x15
712 + jc apm_disconnect # error -> shouldn't happen
713 +
714 + cmpw $0x0504d, %bx # check for "PM" signature
715 + jne apm_disconnect # no sig -> shouldn't happen
716 +
717 + movw %ax, (64) # record the APM BIOS version
718 + movw %cx, (76) # and flags
719 + jmp done_apm_bios
720 +
721 +apm_disconnect: # Tidy up
722 + movw $0x05304, %ax # Disconnect
723 + xorw %bx, %bx
724 + int $0x15 # ignore return code
725 +
726 + jmp done_apm_bios
727 +
728 +no_32_apm_bios:
729 + andw $0xfffd, (76) # remove 32 bit support bit
730 +done_apm_bios:
731 +#endif
732 +
733 +#include "edd.S"
734 +
735 +# Now we want to move to protected mode ...
736 + cmpw $0, %cs:realmode_swtch
737 + jz rmodeswtch_normal
738 +
739 + lcall *%cs:realmode_swtch
740 +
741 + jmp rmodeswtch_end
742 +
743 +rmodeswtch_normal:
744 + pushw %cs
745 + call default_switch
746 +
747 +rmodeswtch_end:
748 +# Now we move the system to its rightful place ... but we check if we have a
749 +# big-kernel. In that case we *must* not move it ...
750 + testb $LOADED_HIGH, %cs:loadflags
751 + jz do_move0 # .. then we have a normal low
752 + # loaded zImage
753 + # .. or else we have a high
754 + # loaded bzImage
755 + jmp end_move # ... and we skip moving
756 +
757 +do_move0:
758 + movw $0x100, %ax # start of destination segment
759 + movw %cs, %bp # aka SETUPSEG
760 + subw $DELTA_INITSEG, %bp # aka INITSEG
761 + movw %cs:start_sys_seg, %bx # start of source segment
762 + cld
763 +do_move:
764 + movw %ax, %es # destination segment
765 + incb %ah # instead of add ax,#0x100
766 + movw %bx, %ds # source segment
767 + addw $0x100, %bx
768 + subw %di, %di
769 + subw %si, %si
770 + movw $0x800, %cx
771 + rep
772 + movsw
773 + cmpw %bp, %bx # assume start_sys_seg > 0x200,
774 + # so we will perhaps read one
775 + # page more than needed, but
776 + # never overwrite INITSEG
777 + # because destination is a
778 + # minimum one page below source
779 + jb do_move
780 +
781 +end_move:
782 +# then we load the segment descriptors
783 + movw %cs, %ax # aka SETUPSEG
784 + movw %ax, %ds
785 +
786 +# Check whether we need to be downward compatible with version <=201
787 + cmpl $0, cmd_line_ptr
788 + jne end_move_self # loader uses version >=202 features
789 + cmpb $0x20, type_of_loader
790 + je end_move_self # bootsect loader, we know of it
791 +
792 +# Boot loader doesnt support boot protocol version 2.02.
793 +# If we have our code not at 0x90000, we need to move it there now.
794 +# We also then need to move the params behind it (commandline)
795 +# Because we would overwrite the code on the current IP, we move
796 +# it in two steps, jumping high after the first one.
797 + movw %cs, %ax
798 + cmpw $SETUPSEG, %ax
799 + je end_move_self
800 +
801 + cli # make sure we really have
802 + # interrupts disabled !
803 + # because after this the stack
804 + # should not be used
805 + subw $DELTA_INITSEG, %ax # aka INITSEG
806 + movw %ss, %dx
807 + cmpw %ax, %dx
808 + jb move_self_1
809 +
810 + addw $INITSEG, %dx
811 + subw %ax, %dx # this will go into %ss after
812 + # the move
813 +move_self_1:
814 + movw %ax, %ds
815 + movw $INITSEG, %ax # real INITSEG
816 + movw %ax, %es
817 + movw %cs:setup_move_size, %cx
818 + std # we have to move up, so we use
819 + # direction down because the
820 + # areas may overlap
821 + movw %cx, %di
822 + decw %di
823 + movw %di, %si
824 + subw $move_self_here+0x200, %cx
825 + rep
826 + movsb
827 + ljmp $SETUPSEG, $move_self_here
828 +
829 +move_self_here:
830 + movw $move_self_here+0x200, %cx
831 + rep
832 + movsb
833 + movw $SETUPSEG, %ax
834 + movw %ax, %ds
835 + movw %dx, %ss
836 +end_move_self: # now we are at the right place
837 +
838 +#
839 +# Enable A20. This is at the very best an annoying procedure.
840 +# A20 code ported from SYSLINUX 1.52-1.63 by H. Peter Anvin.
841 +# AMD Elan bug fix by Robert Schwebel.
842 +#
843 +
844 +#if defined(CONFIG_X86_ELAN)
845 + movb $0x02, %al # alternate A20 gate
846 + outb %al, $0x92 # this works on SC410/SC520
847 +a20_elan_wait:
848 + call a20_test
849 + jz a20_elan_wait
850 + jmp a20_done
851 +#endif
852 +
853 +
854 +A20_TEST_LOOPS = 32 # Iterations per wait
855 +A20_ENABLE_LOOPS = 255 # Total loops to try
856 +
857 +
858 +#ifndef CONFIG_X86_VOYAGER
859 +a20_try_loop:
860 +
861 + # First, see if we are on a system with no A20 gate.
862 +a20_none:
863 + call a20_test
864 + jnz a20_done
865 +
866 + # Next, try the BIOS (INT 0x15, AX=0x2401)
867 +a20_bios:
868 + movw $0x2401, %ax
869 + pushfl # Be paranoid about flags
870 + int $0x15
871 + popfl
872 +
873 + call a20_test
874 + jnz a20_done
875 +
876 + # Try enabling A20 through the keyboard controller
877 +#endif /* CONFIG_X86_VOYAGER */
878 +a20_kbc:
879 + call empty_8042
880 +
881 +#ifndef CONFIG_X86_VOYAGER
882 + call a20_test # Just in case the BIOS worked
883 + jnz a20_done # but had a delayed reaction.
884 +#endif
885 +
886 + movb $0xD1, %al # command write
887 + outb %al, $0x64
888 + call empty_8042
889 +
890 + movb $0xDF, %al # A20 on
891 + outb %al, $0x60
892 + call empty_8042
893 +
894 +#ifndef CONFIG_X86_VOYAGER
895 + # Wait until a20 really *is* enabled; it can take a fair amount of
896 + # time on certain systems; Toshiba Tecras are known to have this
897 + # problem.
898 +a20_kbc_wait:
899 + xorw %cx, %cx
900 +a20_kbc_wait_loop:
901 + call a20_test
902 + jnz a20_done
903 + loop a20_kbc_wait_loop
904 +
905 + # Final attempt: use "configuration port A"
906 +a20_fast:
907 + inb $0x92, %al # Configuration Port A
908 + orb $0x02, %al # "fast A20" version
909 + andb $0xFE, %al # don't accidentally reset
910 + outb %al, $0x92
911 +
912 + # Wait for configuration port A to take effect
913 +a20_fast_wait:
914 + xorw %cx, %cx
915 +a20_fast_wait_loop:
916 + call a20_test
917 + jnz a20_done
918 + loop a20_fast_wait_loop
919 +
920 + # A20 is still not responding. Try frobbing it again.
921 + #
922 + decb (a20_tries)
923 + jnz a20_try_loop
924 +
925 + movw $a20_err_msg, %si
926 + call prtstr
927 +
928 +a20_die:
929 + hlt
930 + jmp a20_die
931 +
932 +a20_tries:
933 + .byte A20_ENABLE_LOOPS
934 +
935 +a20_err_msg:
936 + .ascii "linux: fatal error: A20 gate not responding!"
937 + .byte 13, 10, 0
938 +
939 + # If we get here, all is good
940 +a20_done:
941 +
942 +#endif /* CONFIG_X86_VOYAGER */
943 +# set up gdt and idt and 32bit start address
944 + lidt idt_48 # load idt with 0,0
945 + xorl %eax, %eax # Compute gdt_base
946 + movw %ds, %ax # (Convert %ds:gdt to a linear ptr)
947 + shll $4, %eax
948 + addl %eax, code32
949 + addl $gdt, %eax
950 + movl %eax, (gdt_48+2)
951 + lgdt gdt_48 # load gdt with whatever is
952 + # appropriate
953 +
954 +# make sure any possible coprocessor is properly reset..
955 + xorw %ax, %ax
956 + outb %al, $0xf0
957 + call delay
958 +
959 + outb %al, $0xf1
960 + call delay
961 +
962 +# well, that went ok, I hope. Now we mask all interrupts - the rest
963 +# is done in init_IRQ().
964 + movb $0xFF, %al # mask all interrupts for now
965 + outb %al, $0xA1
966 + call delay
967 +
968 + movb $0xFB, %al # mask all irq's but irq2 which
969 + outb %al, $0x21 # is cascaded
970 +
971 +# Well, that certainly wasn't fun :-(. Hopefully it works, and we don't
972 +# need no steenking BIOS anyway (except for the initial loading :-).
973 +# The BIOS-routine wants lots of unnecessary data, and it's less
974 +# "interesting" anyway. This is how REAL programmers do it.
975 +#
976 +# Well, now's the time to actually move into protected mode. To make
977 +# things as simple as possible, we do no register set-up or anything,
978 +# we let the gnu-compiled 32-bit programs do that. We just jump to
979 +# absolute address 0x1000 (or the loader supplied one),
980 +# in 32-bit protected mode.
981 +#
982 +# Note that the short jump isn't strictly needed, although there are
983 +# reasons why it might be a good idea. It won't hurt in any case.
984 + movw $1, %ax # protected mode (PE) bit
985 + lmsw %ax # This is it!
986 + jmp flush_instr
987 +
988 +flush_instr:
989 + xorw %bx, %bx # Flag to indicate a boot
990 + xorl %esi, %esi # Pointer to real-mode code
991 + movw %cs, %si
992 + subw $DELTA_INITSEG, %si
993 + shll $4, %esi # Convert to 32-bit pointer
994 +
995 +# jump to startup_32 in arch/i386/boot/compressed/head.S
996 +#
997 +# NOTE: For high loaded big kernels we need a
998 +# jmpi 0x100000,__BOOT_CS
999 +#
1000 +# but we yet haven't reloaded the CS register, so the default size
1001 +# of the target offset still is 16 bit.
1002 +# However, using an operand prefix (0x66), the CPU will properly
1003 +# take our 48 bit far pointer. (INTeL 80386 Programmer's Reference
1004 +# Manual, Mixing 16-bit and 32-bit code, page 16-6)
1005 +
1006 + .byte 0x66, 0xea # prefix + jmpi-opcode
1007 +code32: .long startup_32 # will be set to %cs+startup_32
1008 + .word __BOOT_CS
1009 +.code32
1010 +startup_32:
1011 + movl $(__BOOT_DS), %eax
1012 + movl %eax, %ds
1013 + movl %eax, %es
1014 + movl %eax, %fs
1015 + movl %eax, %gs
1016 + movl %eax, %ss
1017 +
1018 + xorl %eax, %eax
1019 +1: incl %eax # check that A20 really IS enabled
1020 + movl %eax, 0x00000000 # loop forever if it isn't
1021 + cmpl %eax, 0x00100000
1022 + je 1b
1023 +
1024 + # Jump to the 32bit entry point
1025 + jmpl *(code32_start - start + (DELTA_INITSEG << 4))(%esi)
1026 +.code16
1027 +
1028 +# Here's a bunch of information about your current kernel..
1029 +kernel_version: .ascii UTS_RELEASE
1030 + .ascii " ("
1031 + .ascii LINUX_COMPILE_BY
1032 + .ascii "@"
1033 + .ascii LINUX_COMPILE_HOST
1034 + .ascii ") "
1035 + .ascii UTS_VERSION
1036 + .byte 0
1037 +
1038 +# This is the default real mode switch routine.
1039 +# to be called just before protected mode transition
1040 +default_switch:
1041 + cli # no interrupts allowed !
1042 + movb $0x80, %al # disable NMI for bootup
1043 + # sequence
1044 + outb %al, $0x70
1045 + lret
1046 +
1047 +
1048 +#ifndef CONFIG_X86_VOYAGER
1049 +# This routine tests whether or not A20 is enabled. If so, it
1050 +# exits with zf = 0.
1051 +#
1052 +# The memory address used, 0x200, is the int $0x80 vector, which
1053 +# should be safe.
1054 +
1055 +A20_TEST_ADDR = 4*0x80
1056 +
1057 +a20_test:
1058 + pushw %cx
1059 + pushw %ax
1060 + xorw %cx, %cx
1061 + movw %cx, %fs # Low memory
1062 + decw %cx
1063 + movw %cx, %gs # High memory area
1064 + movw $A20_TEST_LOOPS, %cx
1065 + movw %fs:(A20_TEST_ADDR), %ax
1066 + pushw %ax
1067 +a20_test_wait:
1068 + incw %ax
1069 + movw %ax, %fs:(A20_TEST_ADDR)
1070 + call delay # Serialize and make delay constant
1071 + cmpw %gs:(A20_TEST_ADDR+0x10), %ax
1072 + loope a20_test_wait
1073 +
1074 + popw %fs:(A20_TEST_ADDR)
1075 + popw %ax
1076 + popw %cx
1077 + ret
1078 +
1079 +#endif /* CONFIG_X86_VOYAGER */
1080 +
1081 +# This routine checks that the keyboard command queue is empty
1082 +# (after emptying the output buffers)
1083 +#
1084 +# Some machines have delusions that the keyboard buffer is always full
1085 +# with no keyboard attached...
1086 +#
1087 +# If there is no keyboard controller, we will usually get 0xff
1088 +# to all the reads. With each IO taking a microsecond and
1089 +# a timeout of 100,000 iterations, this can take about half a
1090 +# second ("delay" == outb to port 0x80). That should be ok,
1091 +# and should also be plenty of time for a real keyboard controller
1092 +# to empty.
1093 +#
1094 +
1095 +empty_8042:
1096 + pushl %ecx
1097 + movl $100000, %ecx
1098 +
1099 +empty_8042_loop:
1100 + decl %ecx
1101 + jz empty_8042_end_loop
1102 +
1103 + call delay
1104 +
1105 + inb $0x64, %al # 8042 status port
1106 + testb $1, %al # output buffer?
1107 + jz no_output
1108 +
1109 + call delay
1110 + inb $0x60, %al # read it
1111 + jmp empty_8042_loop
1112 +
1113 +no_output:
1114 + testb $2, %al # is input buffer full?
1115 + jnz empty_8042_loop # yes - loop
1116 +empty_8042_end_loop:
1117 + popl %ecx
1118 + ret
1119 +
1120 +# Read the cmos clock. Return the seconds in al
1121 +gettime:
1122 + pushw %cx
1123 + movb $0x02, %ah
1124 + int $0x1a
1125 + movb %dh, %al # %dh contains the seconds
1126 + andb $0x0f, %al
1127 + movb %dh, %ah
1128 + movb $0x04, %cl
1129 + shrb %cl, %ah
1130 + aad
1131 + popw %cx
1132 + ret
1133 +
1134 +# Delay is needed after doing I/O
1135 +delay:
1136 + outb %al,$0x80
1137 + ret
1138 +
1139 +# Descriptor tables
1140 +#
1141 +# NOTE: The intel manual says gdt should be sixteen bytes aligned for
1142 +# efficiency reasons. However, there are machines which are known not
1143 +# to boot with misaligned GDTs, so alter this at your peril! If you alter
1144 +# GDT_ENTRY_BOOT_CS (in asm/segment.h) remember to leave at least two
1145 +# empty GDT entries (one for NULL and one reserved).
1146 +#
1147 +# NOTE: On some CPUs, the GDT must be 8 byte aligned. This is
1148 +# true for the Voyager Quad CPU card which will not boot without
1149 +# This directive. 16 byte aligment is recommended by intel.
1150 +#
1151 + .align 16
1152 +gdt:
1153 + .fill GDT_ENTRY_BOOT_CS,8,0
1154 +
1155 + .word 0xFFFF # 4Gb - (0x100000*0x1000 = 4Gb)
1156 + .word 0 # base address = 0
1157 + .word 0x9A00 # code read/exec
1158 + .word 0x00CF # granularity = 4096, 386
1159 + # (+5th nibble of limit)
1160 +
1161 + .word 0xFFFF # 4Gb - (0x100000*0x1000 = 4Gb)
1162 + .word 0 # base address = 0
1163 + .word 0x9200 # data read/write
1164 + .word 0x00CF # granularity = 4096, 386
1165 + # (+5th nibble of limit)
1166 +gdt_end:
1167 + .align 4
1168 +
1169 + .word 0 # alignment byte
1170 +idt_48:
1171 + .word 0 # idt limit = 0
1172 + .word 0, 0 # idt base = 0L
1173 +
1174 + .word 0 # alignment byte
1175 +gdt_48:
1176 + .word gdt_end - gdt - 1 # gdt limit
1177 + .word 0, 0 # gdt base (filled in later)
1178 +
1179 +#ifndef CONFIG_VGA_NOPROBE
1180 +# Include video setup & detection code
1181 +
1182 +#include "video.S"
1183 +#endif
1184 +
1185 +# Setup signature -- must be last
1186 +setup_sig1: .word SIG1
1187 +setup_sig2: .word SIG2
1188 +
1189 +# After this point, there is some free space which is used by the video mode
1190 +# handling code to store the temporary mode table (not used by the kernel).
1191 +
1192 +modelist:
1193 +
1194 +.text
1195 +endtext:
1196 +.data
1197 +enddata:
1198 +.bss
1199 +endbss:
1200 diff --git a/arch/i386/configs/olpc_defconfig b/arch/i386/configs/olpc_defconfig
1201 new file mode 100644
1202 index 0000000..f1675e8
1203 --- /dev/null
1204 +++ b/arch/i386/configs/olpc_defconfig
1205 @@ -0,0 +1,2183 @@
1206 +#
1207 +# Automatically generated make config: don't edit
1208 +# Linux kernel version: 2.6.22-rc5
1209 +# Wed Jun 20 08:26:53 2007
1210 +#
1211 +CONFIG_X86_32=y
1212 +CONFIG_GENERIC_TIME=y
1213 +CONFIG_CLOCKSOURCE_WATCHDOG=y
1214 +CONFIG_GENERIC_CLOCKEVENTS=y
1215 +CONFIG_LOCKDEP_SUPPORT=y
1216 +CONFIG_STACKTRACE_SUPPORT=y
1217 +CONFIG_SEMAPHORE_SLEEPERS=y
1218 +CONFIG_X86=y
1219 +CONFIG_MMU=y
1220 +CONFIG_ZONE_DMA=y
1221 +CONFIG_QUICKLIST=y
1222 +CONFIG_GENERIC_ISA_DMA=y
1223 +CONFIG_GENERIC_IOMAP=y
1224 +CONFIG_GENERIC_BUG=y
1225 +CONFIG_GENERIC_HWEIGHT=y
1226 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
1227 +CONFIG_DMI=y
1228 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
1229 +
1230 +#
1231 +# Code maturity level options
1232 +#
1233 +CONFIG_EXPERIMENTAL=y
1234 +CONFIG_BROKEN_ON_SMP=y
1235 +CONFIG_LOCK_KERNEL=y
1236 +CONFIG_INIT_ENV_ARG_LIMIT=32
1237 +
1238 +#
1239 +# General setup
1240 +#
1241 +CONFIG_LOCALVERSION=""
1242 +# CONFIG_LOCALVERSION_AUTO is not set
1243 +CONFIG_SWAP=y
1244 +CONFIG_SYSVIPC=y
1245 +# CONFIG_IPC_NS is not set
1246 +CONFIG_SYSVIPC_SYSCTL=y
1247 +CONFIG_POSIX_MQUEUE=y
1248 +CONFIG_BSD_PROCESS_ACCT=y
1249 +# CONFIG_BSD_PROCESS_ACCT_V3 is not set
1250 +# CONFIG_TASKSTATS is not set
1251 +# CONFIG_UTS_NS is not set
1252 +CONFIG_AUDIT=y
1253 +CONFIG_AUDITSYSCALL=y
1254 +# CONFIG_IKCONFIG is not set
1255 +CONFIG_LOG_BUF_SHIFT=17
1256 +# CONFIG_SYSFS_DEPRECATED is not set
1257 +CONFIG_RELAY=y
1258 +CONFIG_BLK_DEV_INITRD=y
1259 +CONFIG_INITRAMFS_SOURCE=""
1260 +CONFIG_CC_OPTIMIZE_FOR_SIZE=y
1261 +CONFIG_SYSCTL=y
1262 +CONFIG_EMBEDDED=y
1263 +CONFIG_UID16=y
1264 +# CONFIG_SYSCTL_SYSCALL is not set
1265 +CONFIG_KALLSYMS=y
1266 +# CONFIG_KALLSYMS_ALL is not set
1267 +CONFIG_KALLSYMS_EXTRA_PASS=y
1268 +CONFIG_HOTPLUG=y
1269 +CONFIG_PRINTK=y
1270 +CONFIG_BUG=y
1271 +CONFIG_ELF_CORE=y
1272 +# CONFIG_BASE_FULL is not set
1273 +CONFIG_FUTEX=y
1274 +CONFIG_ANON_INODES=y
1275 +CONFIG_EPOLL=y
1276 +CONFIG_SIGNALFD=y
1277 +CONFIG_TIMERFD=y
1278 +CONFIG_EVENTFD=y
1279 +CONFIG_SHMEM=y
1280 +CONFIG_VM_EVENT_COUNTERS=y
1281 +CONFIG_SLAB=y
1282 +# CONFIG_SLUB is not set
1283 +# CONFIG_SLOB is not set
1284 +CONFIG_RT_MUTEXES=y
1285 +# CONFIG_TINY_SHMEM is not set
1286 +CONFIG_BASE_SMALL=1
1287 +
1288 +#
1289 +# Loadable module support
1290 +#
1291 +CONFIG_MODULES=y
1292 +CONFIG_MODULE_UNLOAD=y
1293 +# CONFIG_MODULE_FORCE_UNLOAD is not set
1294 +CONFIG_MODVERSIONS=y
1295 +CONFIG_MODULE_SRCVERSION_ALL=y
1296 +CONFIG_KMOD=y
1297 +
1298 +#
1299 +# Block layer
1300 +#
1301 +CONFIG_BLOCK=y
1302 +# CONFIG_LBD is not set
1303 +# CONFIG_BLK_DEV_IO_TRACE is not set
1304 +# CONFIG_LSF is not set
1305 +
1306 +#
1307 +# IO Schedulers
1308 +#
1309 +CONFIG_IOSCHED_NOOP=y
1310 +# CONFIG_IOSCHED_AS is not set
1311 +# CONFIG_IOSCHED_DEADLINE is not set
1312 +CONFIG_IOSCHED_CFQ=y
1313 +# CONFIG_DEFAULT_AS is not set
1314 +# CONFIG_DEFAULT_DEADLINE is not set
1315 +CONFIG_DEFAULT_CFQ=y
1316 +# CONFIG_DEFAULT_NOOP is not set
1317 +CONFIG_DEFAULT_IOSCHED="cfq"
1318 +
1319 +#
1320 +# Processor type and features
1321 +#
1322 +CONFIG_TICK_ONESHOT=y
1323 +CONFIG_NO_HZ=y
1324 +CONFIG_HIGH_RES_TIMERS=y
1325 +# CONFIG_SMP is not set
1326 +CONFIG_X86_PC=y
1327 +# CONFIG_X86_ELAN is not set
1328 +# CONFIG_X86_VOYAGER is not set
1329 +# CONFIG_X86_NUMAQ is not set
1330 +# CONFIG_X86_SUMMIT is not set
1331 +# CONFIG_X86_BIGSMP is not set
1332 +# CONFIG_X86_VISWS is not set
1333 +# CONFIG_X86_GENERICARCH is not set
1334 +# CONFIG_X86_ES7000 is not set
1335 +# CONFIG_PARAVIRT is not set
1336 +# CONFIG_M386 is not set
1337 +# CONFIG_M486 is not set
1338 +# CONFIG_M586 is not set
1339 +# CONFIG_M586TSC is not set
1340 +# CONFIG_M586MMX is not set
1341 +# CONFIG_M686 is not set
1342 +# CONFIG_MPENTIUMII is not set
1343 +# CONFIG_MPENTIUMIII is not set
1344 +# CONFIG_MPENTIUMM is not set
1345 +# CONFIG_MCORE2 is not set
1346 +# CONFIG_MPENTIUM4 is not set
1347 +# CONFIG_MK6 is not set
1348 +# CONFIG_MK7 is not set
1349 +# CONFIG_MK8 is not set
1350 +# CONFIG_MCRUSOE is not set
1351 +# CONFIG_MEFFICEON is not set
1352 +# CONFIG_MWINCHIPC6 is not set
1353 +# CONFIG_MWINCHIP2 is not set
1354 +# CONFIG_MWINCHIP3D is not set
1355 +# CONFIG_MGEODEGX1 is not set
1356 +CONFIG_MGEODE_LX=y
1357 +# CONFIG_MCYRIXIII is not set
1358 +# CONFIG_MVIAC3_2 is not set
1359 +# CONFIG_MVIAC7 is not set
1360 +# CONFIG_X86_GENERIC is not set
1361 +CONFIG_X86_CMPXCHG=y
1362 +CONFIG_X86_L1_CACHE_SHIFT=5
1363 +CONFIG_X86_XADD=y
1364 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
1365 +# CONFIG_ARCH_HAS_ILOG2_U32 is not set
1366 +# CONFIG_ARCH_HAS_ILOG2_U64 is not set
1367 +CONFIG_GENERIC_CALIBRATE_DELAY=y
1368 +CONFIG_X86_WP_WORKS_OK=y
1369 +CONFIG_X86_INVLPG=y
1370 +CONFIG_X86_BSWAP=y
1371 +CONFIG_X86_POPAD_OK=y
1372 +CONFIG_X86_USE_PPRO_CHECKSUM=y
1373 +CONFIG_X86_USE_3DNOW=y
1374 +CONFIG_X86_TSC=y
1375 +CONFIG_X86_MINIMUM_CPU_MODEL=4
1376 +# CONFIG_HPET_TIMER is not set
1377 +# CONFIG_PREEMPT_NONE is not set
1378 +# CONFIG_PREEMPT_VOLUNTARY is not set
1379 +CONFIG_PREEMPT=y
1380 +CONFIG_PREEMPT_BKL=y
1381 +# CONFIG_X86_UP_APIC is not set
1382 +# CONFIG_X86_MCE is not set
1383 +# CONFIG_VM86 is not set
1384 +# CONFIG_TOSHIBA is not set
1385 +# CONFIG_I8K is not set
1386 +CONFIG_X86_REBOOTFIXUPS=y
1387 +# CONFIG_MICROCODE is not set
1388 +CONFIG_X86_MSR=y
1389 +CONFIG_X86_CPUID=m
1390 +
1391 +#
1392 +# Firmware Drivers
1393 +#
1394 +# CONFIG_EDD is not set
1395 +# CONFIG_DELL_RBU is not set
1396 +# CONFIG_DCDBAS is not set
1397 +CONFIG_NOHIGHMEM=y
1398 +# CONFIG_HIGHMEM4G is not set
1399 +# CONFIG_HIGHMEM64G is not set
1400 +CONFIG_VMSPLIT_3G=y
1401 +# CONFIG_VMSPLIT_3G_OPT is not set
1402 +# CONFIG_VMSPLIT_2G is not set
1403 +# CONFIG_VMSPLIT_2G_OPT is not set
1404 +# CONFIG_VMSPLIT_1G is not set
1405 +CONFIG_PAGE_OFFSET=0xC0000000
1406 +CONFIG_ARCH_FLATMEM_ENABLE=y
1407 +CONFIG_ARCH_SPARSEMEM_ENABLE=y
1408 +CONFIG_ARCH_SELECT_MEMORY_MODEL=y
1409 +CONFIG_ARCH_POPULATES_NODE_MAP=y
1410 +CONFIG_SELECT_MEMORY_MODEL=y
1411 +CONFIG_FLATMEM_MANUAL=y
1412 +# CONFIG_DISCONTIGMEM_MANUAL is not set
1413 +# CONFIG_SPARSEMEM_MANUAL is not set
1414 +CONFIG_FLATMEM=y
1415 +CONFIG_FLAT_NODE_MEM_MAP=y
1416 +CONFIG_SPARSEMEM_STATIC=y
1417 +CONFIG_SPLIT_PTLOCK_CPUS=4
1418 +# CONFIG_RESOURCES_64BIT is not set
1419 +CONFIG_ZONE_DMA_FLAG=1
1420 +CONFIG_NR_QUICK=1
1421 +# CONFIG_MATH_EMULATION is not set
1422 +# CONFIG_MTRR is not set
1423 +# CONFIG_SECCOMP is not set
1424 +# CONFIG_VGA_NOPROBE is not set
1425 +CONFIG_HZ_100=y
1426 +# CONFIG_HZ_250 is not set
1427 +# CONFIG_HZ_300 is not set
1428 +# CONFIG_HZ_1000 is not set
1429 +CONFIG_HZ=100
1430 +CONFIG_KEXEC=y
1431 +CONFIG_PHYSICAL_START=0x400000
1432 +# CONFIG_RELOCATABLE is not set
1433 +CONFIG_PHYSICAL_ALIGN=0x100000
1434 +# CONFIG_COMPAT_VDSO is not set
1435 +
1436 +#
1437 +# Power management options (ACPI, APM)
1438 +#
1439 +CONFIG_PM=y
1440 +CONFIG_PM_LEGACY=y
1441 +CONFIG_PM_DEBUG=y
1442 +CONFIG_DISABLE_SUSPEND_VT_SWITCH=y
1443 +# CONFIG_PM_TRACE is not set
1444 +# CONFIG_PM_SYSFS_DEPRECATED is not set
1445 +CONFIG_SOFTWARE_SUSPEND=y
1446 +CONFIG_PM_STD_PARTITION=""
1447 +
1448 +#
1449 +# ACPI (Advanced Configuration and Power Interface) Support
1450 +#
1451 +# CONFIG_ACPI is not set
1452 +# CONFIG_APM is not set
1453 +
1454 +#
1455 +# CPU Frequency scaling
1456 +#
1457 +# CONFIG_CPU_FREQ is not set
1458 +
1459 +#
1460 +# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
1461 +#
1462 +CONFIG_PCI=y
1463 +# CONFIG_PCI_GOBIOS is not set
1464 +# CONFIG_PCI_GOMMCONFIG is not set
1465 +# CONFIG_PCI_GODIRECT is not set
1466 +# CONFIG_PCI_GOANY is not set
1467 +CONFIG_PCI_GOOLPC=y
1468 +CONFIG_PCI_DIRECT=y
1469 +CONFIG_PCI_OLPC=y
1470 +# CONFIG_PCIEPORTBUS is not set
1471 +# CONFIG_ARCH_SUPPORTS_MSI is not set
1472 +# CONFIG_PCI_DEBUG is not set
1473 +CONFIG_ISA_DMA_API=y
1474 +# CONFIG_ISA is not set
1475 +# CONFIG_MCA is not set
1476 +# CONFIG_SCx200 is not set
1477 +CONFIG_GEODE_MFGPT_TIMER=y
1478 +CONFIG_OLPC=y
1479 +CONFIG_OLPC_PM=y
1480 +CONFIG_OPEN_FIRMWARE=y
1481 +
1482 +#
1483 +# PCCARD (PCMCIA/CardBus) support
1484 +#
1485 +# CONFIG_PCCARD is not set
1486 +# CONFIG_HOTPLUG_PCI is not set
1487 +
1488 +#
1489 +# Executable file formats
1490 +#
1491 +CONFIG_BINFMT_ELF=y
1492 +# CONFIG_BINFMT_AOUT is not set
1493 +CONFIG_BINFMT_MISC=y
1494 +
1495 +#
1496 +# Networking
1497 +#
1498 +CONFIG_NET=y
1499 +
1500 +#
1501 +# Networking options
1502 +#
1503 +CONFIG_PACKET=y
1504 +CONFIG_PACKET_MMAP=y
1505 +CONFIG_UNIX=y
1506 +CONFIG_XFRM=y
1507 +CONFIG_XFRM_USER=y
1508 +# CONFIG_XFRM_SUB_POLICY is not set
1509 +CONFIG_XFRM_MIGRATE=y
1510 +CONFIG_NET_KEY=m
1511 +CONFIG_NET_KEY_MIGRATE=y
1512 +CONFIG_INET=y
1513 +CONFIG_IP_MULTICAST=y
1514 +CONFIG_IP_ADVANCED_ROUTER=y
1515 +CONFIG_ASK_IP_FIB_HASH=y
1516 +# CONFIG_IP_FIB_TRIE is not set
1517 +CONFIG_IP_FIB_HASH=y
1518 +CONFIG_IP_MULTIPLE_TABLES=y
1519 +CONFIG_IP_ROUTE_MULTIPATH=y
1520 +# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
1521 +CONFIG_IP_ROUTE_VERBOSE=y
1522 +# CONFIG_IP_PNP is not set
1523 +# CONFIG_NET_IPIP is not set
1524 +# CONFIG_NET_IPGRE is not set
1525 +# CONFIG_IP_MROUTE is not set
1526 +# CONFIG_ARPD is not set
1527 +CONFIG_SYN_COOKIES=y
1528 +CONFIG_INET_AH=m
1529 +CONFIG_INET_ESP=m
1530 +CONFIG_INET_IPCOMP=m
1531 +CONFIG_INET_XFRM_TUNNEL=m
1532 +CONFIG_INET_TUNNEL=m
1533 +CONFIG_INET_XFRM_MODE_TRANSPORT=y
1534 +CONFIG_INET_XFRM_MODE_TUNNEL=y
1535 +CONFIG_INET_XFRM_MODE_BEET=y
1536 +# CONFIG_INET_DIAG is not set
1537 +CONFIG_TCP_CONG_ADVANCED=y
1538 +CONFIG_TCP_CONG_BIC=y
1539 +CONFIG_TCP_CONG_CUBIC=m
1540 +CONFIG_TCP_CONG_WESTWOOD=m
1541 +CONFIG_TCP_CONG_HTCP=m
1542 +CONFIG_TCP_CONG_HSTCP=m
1543 +CONFIG_TCP_CONG_HYBLA=m
1544 +CONFIG_TCP_CONG_VEGAS=m
1545 +CONFIG_TCP_CONG_SCALABLE=m
1546 +CONFIG_TCP_CONG_LP=m
1547 +CONFIG_TCP_CONG_VENO=m
1548 +CONFIG_TCP_CONG_YEAH=m
1549 +CONFIG_TCP_CONG_ILLINOIS=m
1550 +CONFIG_DEFAULT_BIC=y
1551 +# CONFIG_DEFAULT_CUBIC is not set
1552 +# CONFIG_DEFAULT_HTCP is not set
1553 +# CONFIG_DEFAULT_VEGAS is not set
1554 +# CONFIG_DEFAULT_WESTWOOD is not set
1555 +# CONFIG_DEFAULT_RENO is not set
1556 +CONFIG_DEFAULT_TCP_CONG="bic"
1557 +# CONFIG_TCP_MD5SIG is not set
1558 +# CONFIG_IP_VS is not set
1559 +CONFIG_IPV6=y
1560 +CONFIG_IPV6_PRIVACY=y
1561 +CONFIG_IPV6_ROUTER_PREF=y
1562 +CONFIG_IPV6_ROUTE_INFO=y
1563 +CONFIG_IPV6_OPTIMISTIC_DAD=y
1564 +CONFIG_INET6_AH=m
1565 +CONFIG_INET6_ESP=m
1566 +CONFIG_INET6_IPCOMP=m
1567 +CONFIG_IPV6_MIP6=y
1568 +CONFIG_INET6_XFRM_TUNNEL=m
1569 +CONFIG_INET6_TUNNEL=m
1570 +CONFIG_INET6_XFRM_MODE_TRANSPORT=m
1571 +CONFIG_INET6_XFRM_MODE_TUNNEL=m
1572 +CONFIG_INET6_XFRM_MODE_BEET=m
1573 +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
1574 +CONFIG_IPV6_SIT=m
1575 +CONFIG_IPV6_TUNNEL=m
1576 +CONFIG_IPV6_MULTIPLE_TABLES=y
1577 +CONFIG_IPV6_SUBTREES=y
1578 +# CONFIG_NETLABEL is not set
1579 +CONFIG_NETWORK_SECMARK=y
1580 +CONFIG_NETFILTER=y
1581 +# CONFIG_NETFILTER_DEBUG is not set
1582 +
1583 +#
1584 +# Core Netfilter Configuration
1585 +#
1586 +CONFIG_NETFILTER_NETLINK=m
1587 +# CONFIG_NETFILTER_NETLINK_QUEUE is not set
1588 +# CONFIG_NETFILTER_NETLINK_LOG is not set
1589 +CONFIG_NF_CONNTRACK_ENABLED=m
1590 +CONFIG_NF_CONNTRACK=m
1591 +# CONFIG_NF_CT_ACCT is not set
1592 +# CONFIG_NF_CONNTRACK_MARK is not set
1593 +# CONFIG_NF_CONNTRACK_SECMARK is not set
1594 +# CONFIG_NF_CONNTRACK_EVENTS is not set
1595 +# CONFIG_NF_CT_PROTO_SCTP is not set
1596 +# CONFIG_NF_CONNTRACK_AMANDA is not set
1597 +CONFIG_NF_CONNTRACK_FTP=m
1598 +# CONFIG_NF_CONNTRACK_H323 is not set
1599 +CONFIG_NF_CONNTRACK_IRC=m
1600 +# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
1601 +# CONFIG_NF_CONNTRACK_PPTP is not set
1602 +# CONFIG_NF_CONNTRACK_SANE is not set
1603 +# CONFIG_NF_CONNTRACK_SIP is not set
1604 +# CONFIG_NF_CONNTRACK_TFTP is not set
1605 +# CONFIG_NF_CT_NETLINK is not set
1606 +CONFIG_NETFILTER_XTABLES=m
1607 +# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
1608 +# CONFIG_NETFILTER_XT_TARGET_MARK is not set
1609 +# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
1610 +CONFIG_NETFILTER_XT_TARGET_NFLOG=m
1611 +# CONFIG_NETFILTER_XT_TARGET_SECMARK is not set
1612 +# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
1613 +# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
1614 +# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set
1615 +# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set
1616 +# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set
1617 +# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
1618 +# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
1619 +# CONFIG_NETFILTER_XT_MATCH_ESP is not set
1620 +# CONFIG_NETFILTER_XT_MATCH_HELPER is not set
1621 +# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
1622 +# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
1623 +# CONFIG_NETFILTER_XT_MATCH_MAC is not set
1624 +# CONFIG_NETFILTER_XT_MATCH_MARK is not set
1625 +# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
1626 +# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
1627 +# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
1628 +# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
1629 +# CONFIG_NETFILTER_XT_MATCH_REALM is not set
1630 +# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
1631 +CONFIG_NETFILTER_XT_MATCH_STATE=m
1632 +# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
1633 +# CONFIG_NETFILTER_XT_MATCH_STRING is not set
1634 +# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
1635 +# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
1636 +
1637 +#
1638 +# IP: Netfilter Configuration
1639 +#
1640 +CONFIG_NF_CONNTRACK_IPV4=m
1641 +CONFIG_NF_CONNTRACK_PROC_COMPAT=y
1642 +# CONFIG_IP_NF_QUEUE is not set
1643 +CONFIG_IP_NF_IPTABLES=m
1644 +# CONFIG_IP_NF_MATCH_IPRANGE is not set
1645 +# CONFIG_IP_NF_MATCH_TOS is not set
1646 +# CONFIG_IP_NF_MATCH_RECENT is not set
1647 +# CONFIG_IP_NF_MATCH_ECN is not set
1648 +# CONFIG_IP_NF_MATCH_AH is not set
1649 +# CONFIG_IP_NF_MATCH_TTL is not set
1650 +# CONFIG_IP_NF_MATCH_OWNER is not set
1651 +# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
1652 +CONFIG_IP_NF_FILTER=m
1653 +# CONFIG_IP_NF_TARGET_REJECT is not set
1654 +CONFIG_IP_NF_TARGET_LOG=m
1655 +# CONFIG_IP_NF_TARGET_ULOG is not set
1656 +CONFIG_NF_NAT=m
1657 +CONFIG_NF_NAT_NEEDED=y
1658 +CONFIG_IP_NF_TARGET_MASQUERADE=m
1659 +# CONFIG_IP_NF_TARGET_REDIRECT is not set
1660 +# CONFIG_IP_NF_TARGET_NETMAP is not set
1661 +# CONFIG_IP_NF_TARGET_SAME is not set
1662 +# CONFIG_NF_NAT_SNMP_BASIC is not set
1663 +CONFIG_NF_NAT_FTP=m
1664 +CONFIG_NF_NAT_IRC=m
1665 +# CONFIG_NF_NAT_TFTP is not set
1666 +# CONFIG_NF_NAT_AMANDA is not set
1667 +# CONFIG_NF_NAT_PPTP is not set
1668 +# CONFIG_NF_NAT_H323 is not set
1669 +# CONFIG_NF_NAT_SIP is not set
1670 +# CONFIG_IP_NF_MANGLE is not set
1671 +# CONFIG_IP_NF_RAW is not set
1672 +# CONFIG_IP_NF_ARPTABLES is not set
1673 +
1674 +#
1675 +# IPv6: Netfilter Configuration (EXPERIMENTAL)
1676 +#
1677 +# CONFIG_NF_CONNTRACK_IPV6 is not set
1678 +# CONFIG_IP6_NF_QUEUE is not set
1679 +# CONFIG_IP6_NF_IPTABLES is not set
1680 +# CONFIG_IP_DCCP is not set
1681 +# CONFIG_IP_SCTP is not set
1682 +# CONFIG_TIPC is not set
1683 +# CONFIG_ATM is not set
1684 +# CONFIG_BRIDGE is not set
1685 +# CONFIG_VLAN_8021Q is not set
1686 +# CONFIG_DECNET is not set
1687 +# CONFIG_LLC2 is not set
1688 +# CONFIG_IPX is not set
1689 +# CONFIG_ATALK is not set
1690 +# CONFIG_X25 is not set
1691 +# CONFIG_LAPB is not set
1692 +# CONFIG_ECONET is not set
1693 +# CONFIG_WAN_ROUTER is not set
1694 +
1695 +#
1696 +# QoS and/or fair queueing
1697 +#
1698 +CONFIG_NET_SCHED=y
1699 +CONFIG_NET_SCH_FIFO=y
1700 +
1701 +#
1702 +# Queueing/Scheduling
1703 +#
1704 +CONFIG_NET_SCH_CBQ=m
1705 +CONFIG_NET_SCH_HTB=m
1706 +CONFIG_NET_SCH_HFSC=m
1707 +CONFIG_NET_SCH_PRIO=m
1708 +CONFIG_NET_SCH_RED=m
1709 +CONFIG_NET_SCH_SFQ=m
1710 +CONFIG_NET_SCH_TEQL=m
1711 +CONFIG_NET_SCH_TBF=m
1712 +CONFIG_NET_SCH_GRED=m
1713 +CONFIG_NET_SCH_DSMARK=m
1714 +CONFIG_NET_SCH_NETEM=m
1715 +CONFIG_NET_SCH_INGRESS=m
1716 +
1717 +#
1718 +# Classification
1719 +#
1720 +CONFIG_NET_CLS=y
1721 +CONFIG_NET_CLS_BASIC=m
1722 +CONFIG_NET_CLS_TCINDEX=m
1723 +CONFIG_NET_CLS_ROUTE4=m
1724 +CONFIG_NET_CLS_ROUTE=y
1725 +CONFIG_NET_CLS_FW=m
1726 +CONFIG_NET_CLS_U32=m
1727 +CONFIG_CLS_U32_PERF=y
1728 +CONFIG_CLS_U32_MARK=y
1729 +CONFIG_NET_CLS_RSVP=m
1730 +CONFIG_NET_CLS_RSVP6=m
1731 +CONFIG_NET_EMATCH=y
1732 +CONFIG_NET_EMATCH_STACK=32
1733 +CONFIG_NET_EMATCH_CMP=m
1734 +CONFIG_NET_EMATCH_NBYTE=m
1735 +CONFIG_NET_EMATCH_U32=m
1736 +CONFIG_NET_EMATCH_META=m
1737 +CONFIG_NET_EMATCH_TEXT=m
1738 +CONFIG_NET_CLS_ACT=y
1739 +CONFIG_NET_ACT_POLICE=m
1740 +CONFIG_NET_ACT_GACT=m
1741 +CONFIG_GACT_PROB=y
1742 +CONFIG_NET_ACT_MIRRED=m
1743 +# CONFIG_NET_ACT_IPT is not set
1744 +CONFIG_NET_ACT_PEDIT=m
1745 +CONFIG_NET_ACT_SIMP=m
1746 +CONFIG_NET_CLS_IND=y
1747 +CONFIG_NET_ESTIMATOR=y
1748 +
1749 +#
1750 +# Network testing
1751 +#
1752 +# CONFIG_NET_PKTGEN is not set
1753 +# CONFIG_NET_TCPPROBE is not set
1754 +# CONFIG_HAMRADIO is not set
1755 +# CONFIG_IRDA is not set
1756 +# CONFIG_BT is not set
1757 +# CONFIG_AF_RXRPC is not set
1758 +CONFIG_FIB_RULES=y
1759 +
1760 +#
1761 +# Wireless
1762 +#
1763 +# CONFIG_CFG80211 is not set
1764 +CONFIG_WIRELESS_EXT=y
1765 +# CONFIG_MAC80211 is not set
1766 +CONFIG_IEEE80211=m
1767 +# CONFIG_IEEE80211_DEBUG is not set
1768 +CONFIG_IEEE80211_CRYPT_WEP=m
1769 +CONFIG_IEEE80211_CRYPT_CCMP=m
1770 +CONFIG_IEEE80211_CRYPT_TKIP=m
1771 +CONFIG_IEEE80211_SOFTMAC=m
1772 +CONFIG_IEEE80211_SOFTMAC_DEBUG=y
1773 +# CONFIG_RFKILL is not set
1774 +
1775 +#
1776 +# Device Drivers
1777 +#
1778 +
1779 +#
1780 +# Generic Driver Options
1781 +#
1782 +CONFIG_STANDALONE=y
1783 +CONFIG_PREVENT_FIRMWARE_BUILD=y
1784 +CONFIG_FW_LOADER=y
1785 +# CONFIG_DEBUG_DRIVER is not set
1786 +# CONFIG_DEBUG_DEVRES is not set
1787 +# CONFIG_SYS_HYPERVISOR is not set
1788 +
1789 +#
1790 +# Connector - unified userspace <-> kernelspace linker
1791 +#
1792 +# CONFIG_CONNECTOR is not set
1793 +CONFIG_MTD=y
1794 +# CONFIG_MTD_DEBUG is not set
1795 +CONFIG_MTD_CONCAT=m
1796 +CONFIG_MTD_PARTITIONS=y
1797 +# CONFIG_MTD_REDBOOT_PARTS is not set
1798 +# CONFIG_MTD_CMDLINE_PARTS is not set
1799 +
1800 +#
1801 +# User Modules And Translation Layers
1802 +#
1803 +CONFIG_MTD_CHAR=m
1804 +CONFIG_MTD_BLKDEVS=m
1805 +CONFIG_MTD_BLOCK=m
1806 +CONFIG_MTD_BLOCK_RO=m
1807 +# CONFIG_FTL is not set
1808 +# CONFIG_NFTL is not set
1809 +# CONFIG_INFTL is not set
1810 +# CONFIG_RFD_FTL is not set
1811 +# CONFIG_SSFDC is not set
1812 +# CONFIG_MTD_OOPS is not set
1813 +
1814 +#
1815 +# RAM/ROM/Flash chip drivers
1816 +#
1817 +# CONFIG_MTD_CFI is not set
1818 +# CONFIG_MTD_JEDECPROBE is not set
1819 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
1820 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
1821 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
1822 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
1823 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
1824 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
1825 +CONFIG_MTD_CFI_I1=y
1826 +CONFIG_MTD_CFI_I2=y
1827 +# CONFIG_MTD_CFI_I4 is not set
1828 +# CONFIG_MTD_CFI_I8 is not set
1829 +# CONFIG_MTD_RAM is not set
1830 +# CONFIG_MTD_ROM is not set
1831 +# CONFIG_MTD_ABSENT is not set
1832 +
1833 +#
1834 +# Mapping drivers for chip access
1835 +#
1836 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
1837 +# CONFIG_MTD_TS5500 is not set
1838 +# CONFIG_MTD_PLATRAM is not set
1839 +
1840 +#
1841 +# Self-contained MTD device drivers
1842 +#
1843 +# CONFIG_MTD_PMC551 is not set
1844 +# CONFIG_MTD_SLRAM is not set
1845 +# CONFIG_MTD_PHRAM is not set
1846 +# CONFIG_MTD_MTDRAM is not set
1847 +# CONFIG_MTD_BLOCK2MTD is not set
1848 +
1849 +#
1850 +# Disk-On-Chip Device Drivers
1851 +#
1852 +# CONFIG_MTD_DOC2000 is not set
1853 +# CONFIG_MTD_DOC2001 is not set
1854 +# CONFIG_MTD_DOC2001PLUS is not set
1855 +CONFIG_MTD_NAND=y
1856 +# CONFIG_MTD_NAND_VERIFY_WRITE is not set
1857 +# CONFIG_MTD_NAND_ECC_SMC is not set
1858 +# CONFIG_MTD_NAND_MUSEUM_IDS is not set
1859 +CONFIG_MTD_NAND_IDS=y
1860 +# CONFIG_MTD_NAND_DISKONCHIP is not set
1861 +CONFIG_MTD_NAND_CAFE=y
1862 +# CONFIG_MTD_NAND_CS553X is not set
1863 +# CONFIG_MTD_NAND_NANDSIM is not set
1864 +# CONFIG_MTD_NAND_PLATFORM is not set
1865 +# CONFIG_MTD_ONENAND is not set
1866 +
1867 +#
1868 +# UBI - Unsorted block images
1869 +#
1870 +# CONFIG_MTD_UBI is not set
1871 +
1872 +#
1873 +# Parallel port support
1874 +#
1875 +# CONFIG_PARPORT is not set
1876 +
1877 +#
1878 +# Plug and Play support
1879 +#
1880 +# CONFIG_PNPACPI is not set
1881 +
1882 +#
1883 +# Block devices
1884 +#
1885 +# CONFIG_BLK_DEV_FD is not set
1886 +# CONFIG_BLK_CPQ_DA is not set
1887 +# CONFIG_BLK_CPQ_CISS_DA is not set
1888 +# CONFIG_BLK_DEV_DAC960 is not set
1889 +# CONFIG_BLK_DEV_UMEM is not set
1890 +# CONFIG_BLK_DEV_COW_COMMON is not set
1891 +CONFIG_BLK_DEV_LOOP=m
1892 +CONFIG_BLK_DEV_CRYPTOLOOP=m
1893 +CONFIG_BLK_DEV_NBD=m
1894 +# CONFIG_BLK_DEV_SX8 is not set
1895 +CONFIG_BLK_DEV_UB=m
1896 +CONFIG_BLK_DEV_RAM=y
1897 +CONFIG_BLK_DEV_RAM_COUNT=16
1898 +CONFIG_BLK_DEV_RAM_SIZE=16384
1899 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
1900 +# CONFIG_CDROM_PKTCDVD is not set
1901 +# CONFIG_ATA_OVER_ETH is not set
1902 +
1903 +#
1904 +# Misc devices
1905 +#
1906 +# CONFIG_IBM_ASM is not set
1907 +# CONFIG_PHANTOM is not set
1908 +# CONFIG_SGI_IOC4 is not set
1909 +# CONFIG_TIFM_CORE is not set
1910 +# CONFIG_EEPROM_93CX6 is not set
1911 +CONFIG_IDE=m
1912 +CONFIG_IDE_MAX_HWIFS=4
1913 +CONFIG_BLK_DEV_IDE=m
1914 +
1915 +#
1916 +# Please see Documentation/ide.txt for help/info on IDE drives
1917 +#
1918 +# CONFIG_BLK_DEV_IDE_SATA is not set
1919 +# CONFIG_BLK_DEV_HD_IDE is not set
1920 +CONFIG_BLK_DEV_IDEDISK=m
1921 +CONFIG_IDEDISK_MULTI_MODE=y
1922 +# CONFIG_BLK_DEV_IDECD is not set
1923 +# CONFIG_BLK_DEV_IDETAPE is not set
1924 +# CONFIG_BLK_DEV_IDEFLOPPY is not set
1925 +# CONFIG_BLK_DEV_IDESCSI is not set
1926 +CONFIG_IDE_TASK_IOCTL=y
1927 +# CONFIG_IDE_PROC_FS is not set
1928 +
1929 +#
1930 +# IDE chipset support/bugfixes
1931 +#
1932 +CONFIG_IDE_GENERIC=m
1933 +# CONFIG_BLK_DEV_CMD640 is not set
1934 +CONFIG_BLK_DEV_IDEPCI=y
1935 +CONFIG_IDEPCI_SHARE_IRQ=y
1936 +# CONFIG_IDEPCI_PCIBUS_ORDER is not set
1937 +# CONFIG_BLK_DEV_OFFBOARD is not set
1938 +# CONFIG_BLK_DEV_GENERIC is not set
1939 +# CONFIG_BLK_DEV_OPTI621 is not set
1940 +# CONFIG_BLK_DEV_RZ1000 is not set
1941 +CONFIG_BLK_DEV_IDEDMA_PCI=y
1942 +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
1943 +CONFIG_IDEDMA_ONLYDISK=y
1944 +# CONFIG_BLK_DEV_AEC62XX is not set
1945 +# CONFIG_BLK_DEV_ALI15X3 is not set
1946 +# CONFIG_BLK_DEV_AMD74XX is not set
1947 +# CONFIG_BLK_DEV_ATIIXP is not set
1948 +# CONFIG_BLK_DEV_CMD64X is not set
1949 +# CONFIG_BLK_DEV_TRIFLEX is not set
1950 +# CONFIG_BLK_DEV_CY82C693 is not set
1951 +# CONFIG_BLK_DEV_CS5520 is not set
1952 +# CONFIG_BLK_DEV_CS5530 is not set
1953 +# CONFIG_BLK_DEV_CS5535 is not set
1954 +# CONFIG_BLK_DEV_HPT34X is not set
1955 +# CONFIG_BLK_DEV_HPT366 is not set
1956 +# CONFIG_BLK_DEV_JMICRON is not set
1957 +# CONFIG_BLK_DEV_SC1200 is not set
1958 +CONFIG_BLK_DEV_PIIX=m
1959 +# CONFIG_BLK_DEV_IT8213 is not set
1960 +# CONFIG_BLK_DEV_IT821X is not set
1961 +# CONFIG_BLK_DEV_NS87415 is not set
1962 +# CONFIG_BLK_DEV_PDC202XX_OLD is not set
1963 +# CONFIG_BLK_DEV_PDC202XX_NEW is not set
1964 +# CONFIG_BLK_DEV_SVWKS is not set
1965 +# CONFIG_BLK_DEV_SIIMAGE is not set
1966 +# CONFIG_BLK_DEV_SIS5513 is not set
1967 +# CONFIG_BLK_DEV_SLC90E66 is not set
1968 +# CONFIG_BLK_DEV_TRM290 is not set
1969 +# CONFIG_BLK_DEV_VIA82CXXX is not set
1970 +# CONFIG_BLK_DEV_TC86C001 is not set
1971 +# CONFIG_IDE_ARM is not set
1972 +CONFIG_BLK_DEV_IDEDMA=y
1973 +# CONFIG_IDEDMA_IVB is not set
1974 +# CONFIG_BLK_DEV_HD is not set
1975 +
1976 +#
1977 +# SCSI device support
1978 +#
1979 +# CONFIG_RAID_ATTRS is not set
1980 +CONFIG_SCSI=y
1981 +# CONFIG_SCSI_TGT is not set
1982 +# CONFIG_SCSI_NETLINK is not set
1983 +CONFIG_SCSI_PROC_FS=y
1984 +
1985 +#
1986 +# SCSI support type (disk, tape, CD-ROM)
1987 +#
1988 +CONFIG_BLK_DEV_SD=y
1989 +# CONFIG_CHR_DEV_ST is not set
1990 +# CONFIG_CHR_DEV_OSST is not set
1991 +CONFIG_BLK_DEV_SR=m
1992 +CONFIG_BLK_DEV_SR_VENDOR=y
1993 +CONFIG_CHR_DEV_SG=m
1994 +CONFIG_CHR_DEV_SCH=m
1995 +
1996 +#
1997 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
1998 +#
1999 +CONFIG_SCSI_MULTI_LUN=y
2000 +CONFIG_SCSI_CONSTANTS=y
2001 +CONFIG_SCSI_LOGGING=y
2002 +# CONFIG_SCSI_SCAN_ASYNC is not set
2003 +CONFIG_SCSI_WAIT_SCAN=m
2004 +
2005 +#
2006 +# SCSI Transports
2007 +#
2008 +# CONFIG_SCSI_SPI_ATTRS is not set
2009 +# CONFIG_SCSI_FC_ATTRS is not set
2010 +# CONFIG_SCSI_ISCSI_ATTRS is not set
2011 +# CONFIG_SCSI_SAS_ATTRS is not set
2012 +# CONFIG_SCSI_SAS_LIBSAS is not set
2013 +
2014 +#
2015 +# SCSI low-level drivers
2016 +#
2017 +# CONFIG_ISCSI_TCP is not set
2018 +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
2019 +# CONFIG_SCSI_3W_9XXX is not set
2020 +# CONFIG_SCSI_ACARD is not set
2021 +# CONFIG_SCSI_AACRAID is not set
2022 +# CONFIG_SCSI_AIC7XXX is not set
2023 +# CONFIG_SCSI_AIC7XXX_OLD is not set
2024 +# CONFIG_SCSI_AIC79XX is not set
2025 +# CONFIG_SCSI_AIC94XX is not set
2026 +# CONFIG_SCSI_DPT_I2O is not set
2027 +# CONFIG_SCSI_ADVANSYS is not set
2028 +# CONFIG_SCSI_ARCMSR is not set
2029 +# CONFIG_MEGARAID_NEWGEN is not set
2030 +# CONFIG_MEGARAID_LEGACY is not set
2031 +# CONFIG_MEGARAID_SAS is not set
2032 +# CONFIG_SCSI_HPTIOP is not set
2033 +# CONFIG_SCSI_BUSLOGIC is not set
2034 +# CONFIG_SCSI_DMX3191D is not set
2035 +# CONFIG_SCSI_EATA is not set
2036 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
2037 +# CONFIG_SCSI_GDTH is not set
2038 +# CONFIG_SCSI_IPS is not set
2039 +# CONFIG_SCSI_INITIO is not set
2040 +# CONFIG_SCSI_INIA100 is not set
2041 +# CONFIG_SCSI_STEX is not set
2042 +# CONFIG_SCSI_SYM53C8XX_2 is not set
2043 +# CONFIG_SCSI_QLOGIC_1280 is not set
2044 +# CONFIG_SCSI_QLA_FC is not set
2045 +# CONFIG_SCSI_QLA_ISCSI is not set
2046 +# CONFIG_SCSI_LPFC is not set
2047 +# CONFIG_SCSI_DC395x is not set
2048 +# CONFIG_SCSI_DC390T is not set
2049 +# CONFIG_SCSI_NSP32 is not set
2050 +# CONFIG_SCSI_DEBUG is not set
2051 +# CONFIG_SCSI_SRP is not set
2052 +# CONFIG_ATA is not set
2053 +
2054 +#
2055 +# Multi-device support (RAID and LVM)
2056 +#
2057 +# CONFIG_MD is not set
2058 +
2059 +#
2060 +# Fusion MPT device support
2061 +#
2062 +# CONFIG_FUSION is not set
2063 +# CONFIG_FUSION_SPI is not set
2064 +# CONFIG_FUSION_FC is not set
2065 +# CONFIG_FUSION_SAS is not set
2066 +
2067 +#
2068 +# IEEE 1394 (FireWire) support
2069 +#
2070 +# CONFIG_FIREWIRE is not set
2071 +# CONFIG_IEEE1394 is not set
2072 +
2073 +#
2074 +# I2O device support
2075 +#
2076 +# CONFIG_I2O is not set
2077 +# CONFIG_MACINTOSH_DRIVERS is not set
2078 +
2079 +#
2080 +# Network device support
2081 +#
2082 +CONFIG_NETDEVICES=y
2083 +CONFIG_IFB=m
2084 +CONFIG_DUMMY=m
2085 +# CONFIG_BONDING is not set
2086 +# CONFIG_EQUALIZER is not set
2087 +CONFIG_TUN=m
2088 +# CONFIG_ARCNET is not set
2089 +# CONFIG_PHYLIB is not set
2090 +
2091 +#
2092 +# Ethernet (10 or 100Mbit)
2093 +#
2094 +CONFIG_NET_ETHERNET=y
2095 +CONFIG_MII=m
2096 +# CONFIG_HAPPYMEAL is not set
2097 +# CONFIG_SUNGEM is not set
2098 +# CONFIG_CASSINI is not set
2099 +# CONFIG_NET_VENDOR_3COM is not set
2100 +
2101 +#
2102 +# Tulip family network device support
2103 +#
2104 +# CONFIG_NET_TULIP is not set
2105 +# CONFIG_HP100 is not set
2106 +CONFIG_NET_PCI=y
2107 +CONFIG_PCNET32=m
2108 +# CONFIG_PCNET32_NAPI is not set
2109 +# CONFIG_AMD8111_ETH is not set
2110 +# CONFIG_ADAPTEC_STARFIRE is not set
2111 +# CONFIG_B44 is not set
2112 +# CONFIG_FORCEDETH is not set
2113 +# CONFIG_DGRS is not set
2114 +# CONFIG_EEPRO100 is not set
2115 +# CONFIG_E100 is not set
2116 +# CONFIG_FEALNX is not set
2117 +# CONFIG_NATSEMI is not set
2118 +CONFIG_NE2K_PCI=m
2119 +CONFIG_8139CP=m
2120 +# CONFIG_8139TOO is not set
2121 +# CONFIG_SIS900 is not set
2122 +# CONFIG_EPIC100 is not set
2123 +# CONFIG_SUNDANCE is not set
2124 +# CONFIG_TLAN is not set
2125 +# CONFIG_VIA_RHINE is not set
2126 +# CONFIG_SC92031 is not set
2127 +CONFIG_NETDEV_1000=y
2128 +# CONFIG_ACENIC is not set
2129 +# CONFIG_DL2K is not set
2130 +# CONFIG_E1000 is not set
2131 +# CONFIG_NS83820 is not set
2132 +# CONFIG_HAMACHI is not set
2133 +# CONFIG_YELLOWFIN is not set
2134 +# CONFIG_R8169 is not set
2135 +# CONFIG_SIS190 is not set
2136 +# CONFIG_SKGE is not set
2137 +# CONFIG_SKY2 is not set
2138 +# CONFIG_SK98LIN is not set
2139 +# CONFIG_VIA_VELOCITY is not set
2140 +# CONFIG_TIGON3 is not set
2141 +# CONFIG_BNX2 is not set
2142 +# CONFIG_QLA3XXX is not set
2143 +# CONFIG_ATL1 is not set
2144 +CONFIG_NETDEV_10000=y
2145 +# CONFIG_CHELSIO_T1 is not set
2146 +# CONFIG_CHELSIO_T3 is not set
2147 +# CONFIG_IXGB is not set
2148 +# CONFIG_S2IO is not set
2149 +# CONFIG_MYRI10GE is not set
2150 +# CONFIG_NETXEN_NIC is not set
2151 +# CONFIG_MLX4_CORE is not set
2152 +# CONFIG_TR is not set
2153 +
2154 +#
2155 +# Wireless LAN
2156 +#
2157 +# CONFIG_WLAN_PRE80211 is not set
2158 +CONFIG_WLAN_80211=y
2159 +# CONFIG_IPW2100 is not set
2160 +# CONFIG_IPW2200 is not set
2161 +CONFIG_LIBERTAS=m
2162 +CONFIG_LIBERTAS_USB=m
2163 +CONFIG_LIBERTAS_DEBUG=y
2164 +# CONFIG_AIRO is not set
2165 +# CONFIG_HERMES is not set
2166 +# CONFIG_ATMEL is not set
2167 +# CONFIG_PRISM54 is not set
2168 +# CONFIG_USB_ZD1201 is not set
2169 +# CONFIG_PRISM54_USB is not set
2170 +# CONFIG_HOSTAP is not set
2171 +# CONFIG_BCM43XX is not set
2172 +# CONFIG_ZD1211RW is not set
2173 +# CONFIG_ADM8211 is not set
2174 +# CONFIG_ACX_PCI is not set
2175 +# CONFIG_ACX_USB is not set
2176 +
2177 +#
2178 +# USB Network Adapters
2179 +#
2180 +CONFIG_USB_CATC=m
2181 +CONFIG_USB_KAWETH=m
2182 +CONFIG_USB_PEGASUS=m
2183 +CONFIG_USB_RTL8150=m
2184 +CONFIG_USB_USBNET_MII=m
2185 +CONFIG_USB_USBNET=m
2186 +CONFIG_USB_NET_AX8817X=m
2187 +CONFIG_USB_NET_CDCETHER=m
2188 +CONFIG_USB_NET_DM9601=m
2189 +CONFIG_USB_NET_GL620A=m
2190 +CONFIG_USB_NET_NET1080=m
2191 +CONFIG_USB_NET_PLUSB=m
2192 +CONFIG_USB_NET_MCS7830=m
2193 +CONFIG_USB_NET_RNDIS_HOST=m
2194 +CONFIG_USB_NET_CDC_SUBSET=m
2195 +CONFIG_USB_ALI_M5632=y
2196 +CONFIG_USB_AN2720=y
2197 +CONFIG_USB_BELKIN=y
2198 +CONFIG_USB_ARMLINUX=y
2199 +CONFIG_USB_EPSON2888=y
2200 +# CONFIG_USB_KC2190 is not set
2201 +CONFIG_USB_NET_ZAURUS=m
2202 +# CONFIG_WAN is not set
2203 +# CONFIG_FDDI is not set
2204 +# CONFIG_HIPPI is not set
2205 +CONFIG_PPP=m
2206 +CONFIG_PPP_MULTILINK=y
2207 +CONFIG_PPP_FILTER=y
2208 +CONFIG_PPP_ASYNC=m
2209 +CONFIG_PPP_SYNC_TTY=m
2210 +CONFIG_PPP_DEFLATE=m
2211 +# CONFIG_PPP_BSDCOMP is not set
2212 +CONFIG_PPP_MPPE=m
2213 +CONFIG_PPPOE=m
2214 +CONFIG_SLIP=m
2215 +CONFIG_SLIP_COMPRESSED=y
2216 +CONFIG_SLHC=m
2217 +CONFIG_SLIP_SMART=y
2218 +# CONFIG_SLIP_MODE_SLIP6 is not set
2219 +# CONFIG_NET_FC is not set
2220 +# CONFIG_SHAPER is not set
2221 +CONFIG_NETCONSOLE=m
2222 +CONFIG_NETPOLL=y
2223 +CONFIG_NETPOLL_TRAP=y
2224 +CONFIG_NET_POLL_CONTROLLER=y
2225 +
2226 +#
2227 +# ISDN subsystem
2228 +#
2229 +# CONFIG_ISDN is not set
2230 +
2231 +#
2232 +# Telephony Support
2233 +#
2234 +# CONFIG_PHONE is not set
2235 +
2236 +#
2237 +# Input device support
2238 +#
2239 +CONFIG_INPUT=y
2240 +# CONFIG_INPUT_FF_MEMLESS is not set
2241 +# CONFIG_INPUT_POLLDEV is not set
2242 +
2243 +#
2244 +# Userland interfaces
2245 +#
2246 +CONFIG_INPUT_MOUSEDEV=m
2247 +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
2248 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
2249 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
2250 +CONFIG_INPUT_JOYDEV=m
2251 +# CONFIG_INPUT_TSDEV is not set
2252 +CONFIG_INPUT_EVDEV=y
2253 +# CONFIG_INPUT_EVBUG is not set
2254 +
2255 +#
2256 +# Input Device Drivers
2257 +#
2258 +CONFIG_INPUT_KEYBOARD=y
2259 +CONFIG_KEYBOARD_ATKBD=y
2260 +# CONFIG_KEYBOARD_SUNKBD is not set
2261 +# CONFIG_KEYBOARD_LKKBD is not set
2262 +# CONFIG_KEYBOARD_XTKBD is not set
2263 +# CONFIG_KEYBOARD_NEWTON is not set
2264 +# CONFIG_KEYBOARD_STOWAWAY is not set
2265 +CONFIG_INPUT_MOUSE=y
2266 +CONFIG_MOUSE_PS2=m
2267 +# CONFIG_MOUSE_PS2_ALPS is not set
2268 +# CONFIG_MOUSE_PS2_LOGIPS2PP is not set
2269 +# CONFIG_MOUSE_PS2_SYNAPTICS is not set
2270 +# CONFIG_MOUSE_PS2_LIFEBOOK is not set
2271 +# CONFIG_MOUSE_PS2_TRACKPOINT is not set
2272 +# CONFIG_MOUSE_PS2_TOUCHKIT is not set
2273 +CONFIG_MOUSE_PS2_OLPC=y
2274 +# CONFIG_MOUSE_SERIAL is not set
2275 +# CONFIG_MOUSE_APPLETOUCH is not set
2276 +# CONFIG_MOUSE_VSXXXAA is not set
2277 +# CONFIG_INPUT_JOYSTICK is not set
2278 +# CONFIG_INPUT_TABLET is not set
2279 +# CONFIG_INPUT_TOUCHSCREEN is not set
2280 +CONFIG_INPUT_MISC=y
2281 +CONFIG_INPUT_PCSPKR=m
2282 +# CONFIG_INPUT_WISTRON_BTNS is not set
2283 +# CONFIG_INPUT_ATI_REMOTE is not set
2284 +# CONFIG_INPUT_ATI_REMOTE2 is not set
2285 +# CONFIG_INPUT_KEYSPAN_REMOTE is not set
2286 +# CONFIG_INPUT_POWERMATE is not set
2287 +# CONFIG_INPUT_YEALINK is not set
2288 +CONFIG_INPUT_UINPUT=m
2289 +
2290 +#
2291 +# Hardware I/O ports
2292 +#
2293 +CONFIG_SERIO=y
2294 +CONFIG_SERIO_I8042=y
2295 +CONFIG_SERIO_SERPORT=y
2296 +# CONFIG_SERIO_CT82C710 is not set
2297 +# CONFIG_SERIO_PCIPS2 is not set
2298 +CONFIG_SERIO_LIBPS2=y
2299 +CONFIG_SERIO_RAW=m
2300 +# CONFIG_GAMEPORT is not set
2301 +
2302 +#
2303 +# Character devices
2304 +#
2305 +CONFIG_VT=y
2306 +CONFIG_VT_CONSOLE=y
2307 +CONFIG_HW_CONSOLE=y
2308 +# CONFIG_VT_HW_CONSOLE_BINDING is not set
2309 +# CONFIG_SERIAL_NONSTANDARD is not set
2310 +
2311 +#
2312 +# Serial drivers
2313 +#
2314 +CONFIG_SERIAL_8250=y
2315 +CONFIG_SERIAL_8250_CONSOLE=y
2316 +CONFIG_SERIAL_8250_PCI=y
2317 +CONFIG_SERIAL_8250_NR_UARTS=1
2318 +CONFIG_SERIAL_8250_RUNTIME_UARTS=1
2319 +CONFIG_SERIAL_8250_EXTENDED=y
2320 +CONFIG_SERIAL_8250_MANY_PORTS=y
2321 +CONFIG_SERIAL_8250_SHARE_IRQ=y
2322 +CONFIG_SERIAL_8250_DETECT_IRQ=y
2323 +CONFIG_SERIAL_8250_RSA=y
2324 +
2325 +#
2326 +# Non-8250 serial port support
2327 +#
2328 +CONFIG_SERIAL_CORE=y
2329 +CONFIG_SERIAL_CORE_CONSOLE=y
2330 +# CONFIG_SERIAL_JSM is not set
2331 +CONFIG_UNIX98_PTYS=y
2332 +# CONFIG_LEGACY_PTYS is not set
2333 +
2334 +#
2335 +# IPMI
2336 +#
2337 +# CONFIG_IPMI_HANDLER is not set
2338 +CONFIG_WATCHDOG=y
2339 +# CONFIG_WATCHDOG_NOWAYOUT is not set
2340 +
2341 +#
2342 +# Watchdog Device Drivers
2343 +#
2344 +CONFIG_SOFT_WATCHDOG=m
2345 +# CONFIG_ACQUIRE_WDT is not set
2346 +# CONFIG_ADVANTECH_WDT is not set
2347 +# CONFIG_ALIM1535_WDT is not set
2348 +# CONFIG_ALIM7101_WDT is not set
2349 +# CONFIG_SC520_WDT is not set
2350 +# CONFIG_EUROTECH_WDT is not set
2351 +# CONFIG_IB700_WDT is not set
2352 +# CONFIG_IBMASR is not set
2353 +# CONFIG_WAFER_WDT is not set
2354 +# CONFIG_I6300ESB_WDT is not set
2355 +# CONFIG_ITCO_WDT is not set
2356 +# CONFIG_SC1200_WDT is not set
2357 +# CONFIG_PC87413_WDT is not set
2358 +# CONFIG_60XX_WDT is not set
2359 +# CONFIG_SBC8360_WDT is not set
2360 +# CONFIG_CPU5_WDT is not set
2361 +# CONFIG_SMSC37B787_WDT is not set
2362 +# CONFIG_W83627HF_WDT is not set
2363 +# CONFIG_W83697HF_WDT is not set
2364 +# CONFIG_W83877F_WDT is not set
2365 +# CONFIG_W83977F_WDT is not set
2366 +# CONFIG_MACHZ_WDT is not set
2367 +# CONFIG_SBC_EPX_C3_WATCHDOG is not set
2368 +
2369 +#
2370 +# PCI-based Watchdog Cards
2371 +#
2372 +# CONFIG_PCIPCWATCHDOG is not set
2373 +# CONFIG_WDTPCI is not set
2374 +
2375 +#
2376 +# USB-based Watchdog Cards
2377 +#
2378 +# CONFIG_USBPCWATCHDOG is not set
2379 +CONFIG_HW_RANDOM=y
2380 +# CONFIG_HW_RANDOM_INTEL is not set
2381 +# CONFIG_HW_RANDOM_AMD is not set
2382 +CONFIG_HW_RANDOM_GEODE=y
2383 +# CONFIG_HW_RANDOM_VIA is not set
2384 +CONFIG_NVRAM=y
2385 +# CONFIG_RTC is not set
2386 +# CONFIG_GEN_RTC is not set
2387 +# CONFIG_R3964 is not set
2388 +# CONFIG_APPLICOM is not set
2389 +# CONFIG_SONYPI is not set
2390 +# CONFIG_AGP is not set
2391 +# CONFIG_DRM is not set
2392 +# CONFIG_MWAVE is not set
2393 +# CONFIG_PC8736x_GPIO is not set
2394 +# CONFIG_NSC_GPIO is not set
2395 +CONFIG_CS5535_GPIO=m
2396 +# CONFIG_RAW_DRIVER is not set
2397 +CONFIG_HANGCHECK_TIMER=m
2398 +
2399 +#
2400 +# TPM devices
2401 +#
2402 +# CONFIG_TCG_TPM is not set
2403 +# CONFIG_TELCLOCK is not set
2404 +CONFIG_DEVPORT=y
2405 +CONFIG_I2C=y
2406 +CONFIG_I2C_BOARDINFO=y
2407 +CONFIG_I2C_CHARDEV=m
2408 +
2409 +#
2410 +# I2C Algorithms
2411 +#
2412 +# CONFIG_I2C_ALGOBIT is not set
2413 +# CONFIG_I2C_ALGOPCF is not set
2414 +# CONFIG_I2C_ALGOPCA is not set
2415 +
2416 +#
2417 +# I2C Hardware Bus support
2418 +#
2419 +# CONFIG_I2C_ALI1535 is not set
2420 +# CONFIG_I2C_ALI1563 is not set
2421 +# CONFIG_I2C_ALI15X3 is not set
2422 +# CONFIG_I2C_AMD756 is not set
2423 +# CONFIG_I2C_AMD8111 is not set
2424 +# CONFIG_I2C_I801 is not set
2425 +# CONFIG_I2C_I810 is not set
2426 +# CONFIG_I2C_PIIX4 is not set
2427 +# CONFIG_I2C_NFORCE2 is not set
2428 +# CONFIG_I2C_OCORES is not set
2429 +# CONFIG_I2C_PARPORT_LIGHT is not set
2430 +# CONFIG_I2C_PROSAVAGE is not set
2431 +# CONFIG_I2C_SAVAGE4 is not set
2432 +# CONFIG_I2C_SIMTEC is not set
2433 +CONFIG_SCx200_ACB=y
2434 +# CONFIG_I2C_SIS5595 is not set
2435 +# CONFIG_I2C_SIS630 is not set
2436 +# CONFIG_I2C_SIS96X is not set
2437 +# CONFIG_I2C_STUB is not set
2438 +# CONFIG_I2C_TINY_USB is not set
2439 +# CONFIG_I2C_VIA is not set
2440 +# CONFIG_I2C_VIAPRO is not set
2441 +# CONFIG_I2C_VOODOO3 is not set
2442 +
2443 +#
2444 +# Miscellaneous I2C Chip support
2445 +#
2446 +# CONFIG_SENSORS_DS1337 is not set
2447 +# CONFIG_SENSORS_DS1374 is not set
2448 +# CONFIG_SENSORS_EEPROM is not set
2449 +# CONFIG_SENSORS_PCF8574 is not set
2450 +# CONFIG_SENSORS_PCA9539 is not set
2451 +# CONFIG_SENSORS_PCF8591 is not set
2452 +# CONFIG_SENSORS_MAX6875 is not set
2453 +# CONFIG_I2C_DEBUG_CORE is not set
2454 +# CONFIG_I2C_DEBUG_ALGO is not set
2455 +# CONFIG_I2C_DEBUG_BUS is not set
2456 +# CONFIG_I2C_DEBUG_CHIP is not set
2457 +
2458 +#
2459 +# SPI support
2460 +#
2461 +# CONFIG_SPI is not set
2462 +# CONFIG_SPI_MASTER is not set
2463 +
2464 +#
2465 +# Dallas's 1-wire bus
2466 +#
2467 +# CONFIG_W1 is not set
2468 +CONFIG_POWER_SUPPLY=y
2469 +# CONFIG_POWER_SUPPLY_DEBUG is not set
2470 +# CONFIG_PDA_POWER is not set
2471 +# CONFIG_BATTERY_DS2760 is not set
2472 +CONFIG_BATTERY_OLPC=y
2473 +# CONFIG_HWMON is not set
2474 +
2475 +#
2476 +# Multifunction device drivers
2477 +#
2478 +# CONFIG_MFD_SM501 is not set
2479 +
2480 +#
2481 +# Multimedia devices
2482 +#
2483 +CONFIG_VIDEO_DEV=y
2484 +# CONFIG_VIDEO_V4L1 is not set
2485 +CONFIG_VIDEO_V4L1_COMPAT=y
2486 +CONFIG_VIDEO_V4L2=y
2487 +CONFIG_VIDEO_CAPTURE_DRIVERS=y
2488 +# CONFIG_VIDEO_ADV_DEBUG is not set
2489 +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
2490 +
2491 +#
2492 +# Encoders/decoders and other helper chips
2493 +#
2494 +
2495 +#
2496 +# Audio decoders
2497 +#
2498 +# CONFIG_VIDEO_TDA9840 is not set
2499 +# CONFIG_VIDEO_TEA6415C is not set
2500 +# CONFIG_VIDEO_TEA6420 is not set
2501 +# CONFIG_VIDEO_MSP3400 is not set
2502 +# CONFIG_VIDEO_CS53L32A is not set
2503 +# CONFIG_VIDEO_TLV320AIC23B is not set
2504 +# CONFIG_VIDEO_WM8775 is not set
2505 +# CONFIG_VIDEO_WM8739 is not set
2506 +
2507 +#
2508 +# Video decoders
2509 +#
2510 +CONFIG_VIDEO_OV7670=y
2511 +# CONFIG_VIDEO_SAA711X is not set
2512 +# CONFIG_VIDEO_TVP5150 is not set
2513 +
2514 +#
2515 +# Video and audio decoders
2516 +#
2517 +# CONFIG_VIDEO_CX25840 is not set
2518 +
2519 +#
2520 +# MPEG video encoders
2521 +#
2522 +# CONFIG_VIDEO_CX2341X is not set
2523 +
2524 +#
2525 +# Video encoders
2526 +#
2527 +# CONFIG_VIDEO_SAA7127 is not set
2528 +
2529 +#
2530 +# Video improvement chips
2531 +#
2532 +# CONFIG_VIDEO_UPD64031A is not set
2533 +# CONFIG_VIDEO_UPD64083 is not set
2534 +# CONFIG_VIDEO_VIVI is not set
2535 +# CONFIG_VIDEO_SAA5246A is not set
2536 +# CONFIG_VIDEO_SAA5249 is not set
2537 +# CONFIG_VIDEO_SAA7134 is not set
2538 +# CONFIG_VIDEO_HEXIUM_ORION is not set
2539 +# CONFIG_VIDEO_HEXIUM_GEMINI is not set
2540 +# CONFIG_VIDEO_CX88 is not set
2541 +CONFIG_VIDEO_CAFE_CCIC=y
2542 +CONFIG_V4L_USB_DRIVERS=y
2543 +# CONFIG_VIDEO_PVRUSB2 is not set
2544 +# CONFIG_VIDEO_USBVISION is not set
2545 +# CONFIG_USB_SN9C102 is not set
2546 +# CONFIG_USB_ZR364XX is not set
2547 +CONFIG_RADIO_ADAPTERS=y
2548 +# CONFIG_RADIO_GEMTEK_PCI is not set
2549 +# CONFIG_RADIO_MAXIRADIO is not set
2550 +# CONFIG_RADIO_MAESTRO is not set
2551 +# CONFIG_USB_DSBR is not set
2552 +# CONFIG_DVB_CORE is not set
2553 +CONFIG_DAB=y
2554 +# CONFIG_USB_DABUSB is not set
2555 +
2556 +#
2557 +# Graphics support
2558 +#
2559 +CONFIG_BACKLIGHT_LCD_SUPPORT=y
2560 +CONFIG_BACKLIGHT_CLASS_DEVICE=y
2561 +CONFIG_LCD_CLASS_DEVICE=y
2562 +# CONFIG_BACKLIGHT_PROGEAR is not set
2563 +
2564 +#
2565 +# Display device support
2566 +#
2567 +# CONFIG_DISPLAY_SUPPORT is not set
2568 +CONFIG_VGASTATE=m
2569 +CONFIG_FB=y
2570 +# CONFIG_FIRMWARE_EDID is not set
2571 +# CONFIG_FB_DDC is not set
2572 +CONFIG_FB_CFB_FILLRECT=y
2573 +CONFIG_FB_CFB_COPYAREA=y
2574 +CONFIG_FB_CFB_IMAGEBLIT=y
2575 +# CONFIG_FB_SYS_FILLRECT is not set
2576 +# CONFIG_FB_SYS_COPYAREA is not set
2577 +# CONFIG_FB_SYS_IMAGEBLIT is not set
2578 +# CONFIG_FB_SYS_FOPS is not set
2579 +CONFIG_FB_DEFERRED_IO=y
2580 +# CONFIG_FB_SVGALIB is not set
2581 +# CONFIG_FB_MACMODES is not set
2582 +# CONFIG_FB_BACKLIGHT is not set
2583 +CONFIG_FB_MODE_HELPERS=y
2584 +CONFIG_FB_TILEBLITTING=y
2585 +
2586 +#
2587 +# Frame buffer hardware drivers
2588 +#
2589 +# CONFIG_FB_CIRRUS is not set
2590 +# CONFIG_FB_PM2 is not set
2591 +# CONFIG_FB_CYBER2000 is not set
2592 +# CONFIG_FB_ARC is not set
2593 +# CONFIG_FB_ASILIANT is not set
2594 +# CONFIG_FB_IMSTT is not set
2595 +CONFIG_FB_VGA16=m
2596 +CONFIG_FB_VESA=y
2597 +# CONFIG_FB_HECUBA is not set
2598 +# CONFIG_FB_HGA is not set
2599 +# CONFIG_FB_S1D13XXX is not set
2600 +# CONFIG_FB_NVIDIA is not set
2601 +# CONFIG_FB_RIVA is not set
2602 +# CONFIG_FB_I810 is not set
2603 +# CONFIG_FB_LE80578 is not set
2604 +# CONFIG_FB_INTEL is not set
2605 +# CONFIG_FB_MATROX is not set
2606 +# CONFIG_FB_RADEON is not set
2607 +# CONFIG_FB_ATY128 is not set
2608 +# CONFIG_FB_ATY is not set
2609 +# CONFIG_FB_S3 is not set
2610 +# CONFIG_FB_SAVAGE is not set
2611 +# CONFIG_FB_SIS is not set
2612 +# CONFIG_FB_NEOMAGIC is not set
2613 +# CONFIG_FB_KYRO is not set
2614 +# CONFIG_FB_3DFX is not set
2615 +# CONFIG_FB_VOODOO1 is not set
2616 +# CONFIG_FB_VT8623 is not set
2617 +# CONFIG_FB_CYBLA is not set
2618 +# CONFIG_FB_TRIDENT is not set
2619 +# CONFIG_FB_ARK is not set
2620 +# CONFIG_FB_PM3 is not set
2621 +CONFIG_FB_GEODE=y
2622 +CONFIG_FB_GEODE_LX=y
2623 +CONFIG_FB_GEODE_GX=y
2624 +# CONFIG_FB_GEODE_GX1 is not set
2625 +CONFIG_FB_OLPC_DCON=y
2626 +# CONFIG_FB_VIRTUAL is not set
2627 +
2628 +#
2629 +# Console display driver support
2630 +#
2631 +CONFIG_VGA_CONSOLE=y
2632 +CONFIG_VGACON_SOFT_SCROLLBACK=y
2633 +CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64
2634 +CONFIG_VIDEO_SELECT=y
2635 +CONFIG_DUMMY_CONSOLE=y
2636 +CONFIG_FRAMEBUFFER_CONSOLE=y
2637 +CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
2638 +CONFIG_FONTS=y
2639 +# CONFIG_FONT_8x8 is not set
2640 +CONFIG_FONT_8x16=y
2641 +# CONFIG_FONT_6x11 is not set
2642 +# CONFIG_FONT_7x14 is not set
2643 +# CONFIG_FONT_PEARL_8x8 is not set
2644 +# CONFIG_FONT_ACORN_8x8 is not set
2645 +# CONFIG_FONT_MINI_4x6 is not set
2646 +# CONFIG_FONT_SUN8x16 is not set
2647 +CONFIG_FONT_SUN12x22=y
2648 +# CONFIG_FONT_10x18 is not set
2649 +CONFIG_LOGO=y
2650 +# CONFIG_LOGO_LINUX_MONO is not set
2651 +# CONFIG_LOGO_LINUX_VGA16 is not set
2652 +CONFIG_LOGO_LINUX_CLUT224=y
2653 +
2654 +#
2655 +# Sound
2656 +#
2657 +CONFIG_SOUND=y
2658 +
2659 +#
2660 +# Advanced Linux Sound Architecture
2661 +#
2662 +CONFIG_SND=y
2663 +CONFIG_SND_TIMER=y
2664 +CONFIG_SND_PCM=y
2665 +CONFIG_SND_HWDEP=m
2666 +CONFIG_SND_RAWMIDI=m
2667 +CONFIG_SND_SEQUENCER=m
2668 +CONFIG_SND_SEQ_DUMMY=m
2669 +CONFIG_SND_OSSEMUL=y
2670 +CONFIG_SND_MIXER_OSS=m
2671 +CONFIG_SND_PCM_OSS=m
2672 +CONFIG_SND_PCM_OSS_PLUGINS=y
2673 +CONFIG_SND_SEQUENCER_OSS=y
2674 +CONFIG_SND_DYNAMIC_MINORS=y
2675 +# CONFIG_SND_SUPPORT_OLD_API is not set
2676 +CONFIG_SND_VERBOSE_PROCFS=y
2677 +# CONFIG_SND_VERBOSE_PRINTK is not set
2678 +# CONFIG_SND_DEBUG is not set
2679 +
2680 +#
2681 +# Generic devices
2682 +#
2683 +CONFIG_SND_MPU401_UART=m
2684 +CONFIG_SND_AC97_CODEC=y
2685 +CONFIG_SND_DUMMY=m
2686 +CONFIG_SND_VIRMIDI=m
2687 +CONFIG_SND_MTPAV=m
2688 +# CONFIG_SND_SERIAL_U16550 is not set
2689 +CONFIG_SND_MPU401=m
2690 +
2691 +#
2692 +# PCI devices
2693 +#
2694 +# CONFIG_SND_AD1889 is not set
2695 +# CONFIG_SND_ALS300 is not set
2696 +# CONFIG_SND_ALS4000 is not set
2697 +# CONFIG_SND_ALI5451 is not set
2698 +# CONFIG_SND_ATIIXP is not set
2699 +# CONFIG_SND_ATIIXP_MODEM is not set
2700 +# CONFIG_SND_AU8810 is not set
2701 +# CONFIG_SND_AU8820 is not set
2702 +# CONFIG_SND_AU8830 is not set
2703 +# CONFIG_SND_AZT3328 is not set
2704 +# CONFIG_SND_BT87X is not set
2705 +# CONFIG_SND_CA0106 is not set
2706 +# CONFIG_SND_CMIPCI is not set
2707 +# CONFIG_SND_CS4281 is not set
2708 +# CONFIG_SND_CS46XX is not set
2709 +CONFIG_SND_CS5535AUDIO=y
2710 +# CONFIG_SND_DARLA20 is not set
2711 +# CONFIG_SND_GINA20 is not set
2712 +# CONFIG_SND_LAYLA20 is not set
2713 +# CONFIG_SND_DARLA24 is not set
2714 +# CONFIG_SND_GINA24 is not set
2715 +# CONFIG_SND_LAYLA24 is not set
2716 +# CONFIG_SND_MONA is not set
2717 +# CONFIG_SND_MIA is not set
2718 +# CONFIG_SND_ECHO3G is not set
2719 +# CONFIG_SND_INDIGO is not set
2720 +# CONFIG_SND_INDIGOIO is not set
2721 +# CONFIG_SND_INDIGODJ is not set
2722 +# CONFIG_SND_EMU10K1 is not set
2723 +# CONFIG_SND_EMU10K1X is not set
2724 +CONFIG_SND_ENS1370=m
2725 +CONFIG_SND_ENS1371=m
2726 +# CONFIG_SND_ES1938 is not set
2727 +# CONFIG_SND_ES1968 is not set
2728 +# CONFIG_SND_FM801 is not set
2729 +# CONFIG_SND_HDA_INTEL is not set
2730 +# CONFIG_SND_HDSP is not set
2731 +# CONFIG_SND_HDSPM is not set
2732 +# CONFIG_SND_ICE1712 is not set
2733 +# CONFIG_SND_ICE1724 is not set
2734 +CONFIG_SND_INTEL8X0=m
2735 +# CONFIG_SND_INTEL8X0M is not set
2736 +# CONFIG_SND_KORG1212 is not set
2737 +# CONFIG_SND_MAESTRO3 is not set
2738 +# CONFIG_SND_MIXART is not set
2739 +# CONFIG_SND_NM256 is not set
2740 +# CONFIG_SND_PCXHR is not set
2741 +# CONFIG_SND_RIPTIDE is not set
2742 +# CONFIG_SND_RME32 is not set
2743 +# CONFIG_SND_RME96 is not set
2744 +# CONFIG_SND_RME9652 is not set
2745 +# CONFIG_SND_SONICVIBES is not set
2746 +# CONFIG_SND_TRIDENT is not set
2747 +# CONFIG_SND_VIA82XX is not set
2748 +# CONFIG_SND_VIA82XX_MODEM is not set
2749 +# CONFIG_SND_VX222 is not set
2750 +# CONFIG_SND_YMFPCI is not set
2751 +CONFIG_SND_AC97_POWER_SAVE=y
2752 +
2753 +#
2754 +# USB devices
2755 +#
2756 +CONFIG_SND_USB_AUDIO=m
2757 +CONFIG_SND_USB_USX2Y=m
2758 +# CONFIG_SND_USB_CAIAQ is not set
2759 +
2760 +#
2761 +# System on Chip audio support
2762 +#
2763 +# CONFIG_SND_SOC is not set
2764 +
2765 +#
2766 +# Open Sound System
2767 +#
2768 +# CONFIG_SOUND_PRIME is not set
2769 +CONFIG_AC97_BUS=y
2770 +
2771 +#
2772 +# HID Devices
2773 +#
2774 +CONFIG_HID=y
2775 +# CONFIG_HID_DEBUG is not set
2776 +
2777 +#
2778 +# USB Input Devices
2779 +#
2780 +CONFIG_USB_HID=y
2781 +# CONFIG_USB_HIDINPUT_POWERBOOK is not set
2782 +# CONFIG_HID_FF is not set
2783 +CONFIG_USB_HIDDEV=y
2784 +
2785 +#
2786 +# USB support
2787 +#
2788 +CONFIG_USB_ARCH_HAS_HCD=y
2789 +CONFIG_USB_ARCH_HAS_OHCI=y
2790 +CONFIG_USB_ARCH_HAS_EHCI=y
2791 +CONFIG_USB=y
2792 +# CONFIG_USB_DEBUG is not set
2793 +
2794 +#
2795 +# Miscellaneous USB options
2796 +#
2797 +CONFIG_USB_DEVICEFS=y
2798 +# CONFIG_USB_DEVICE_CLASS is not set
2799 +# CONFIG_USB_DYNAMIC_MINORS is not set
2800 +# CONFIG_USB_SUSPEND is not set
2801 +CONFIG_USB_PERSIST=y
2802 +# CONFIG_USB_OTG is not set
2803 +
2804 +#
2805 +# USB Host Controller Drivers
2806 +#
2807 +CONFIG_USB_EHCI_HCD=y
2808 +CONFIG_USB_EHCI_SPLIT_ISO=y
2809 +CONFIG_USB_EHCI_ROOT_HUB_TT=y
2810 +# CONFIG_USB_EHCI_TT_NEWSCHED is not set
2811 +# CONFIG_USB_EHCI_BIG_ENDIAN_MMIO is not set
2812 +# CONFIG_USB_ISP116X_HCD is not set
2813 +CONFIG_USB_OHCI_HCD=y
2814 +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
2815 +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
2816 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
2817 +# CONFIG_USB_UHCI_HCD is not set
2818 +# CONFIG_USB_SL811_HCD is not set
2819 +
2820 +#
2821 +# USB Device Class drivers
2822 +#
2823 +CONFIG_USB_ACM=m
2824 +CONFIG_USB_PRINTER=m
2825 +
2826 +#
2827 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
2828 +#
2829 +
2830 +#
2831 +# may also be needed; see USB_STORAGE Help for more information
2832 +#
2833 +CONFIG_USB_STORAGE=y
2834 +# CONFIG_USB_STORAGE_DEBUG is not set
2835 +CONFIG_USB_STORAGE_DATAFAB=y
2836 +CONFIG_USB_STORAGE_FREECOM=y
2837 +CONFIG_USB_STORAGE_DPCM=y
2838 +CONFIG_USB_STORAGE_USBAT=y
2839 +CONFIG_USB_STORAGE_SDDR09=y
2840 +CONFIG_USB_STORAGE_SDDR55=y
2841 +CONFIG_USB_STORAGE_JUMPSHOT=y
2842 +CONFIG_USB_STORAGE_ALAUDA=y
2843 +# CONFIG_USB_STORAGE_KARMA is not set
2844 +CONFIG_USB_LIBUSUAL=y
2845 +
2846 +#
2847 +# USB Imaging devices
2848 +#
2849 +# CONFIG_USB_MDC800 is not set
2850 +# CONFIG_USB_MICROTEK is not set
2851 +CONFIG_USB_MON=y
2852 +
2853 +#
2854 +# USB port drivers
2855 +#
2856 +
2857 +#
2858 +# USB Serial Converter support
2859 +#
2860 +CONFIG_USB_SERIAL=m
2861 +CONFIG_USB_SERIAL_GENERIC=y
2862 +# CONFIG_USB_SERIAL_AIRCABLE is not set
2863 +# CONFIG_USB_SERIAL_AIRPRIME is not set
2864 +# CONFIG_USB_SERIAL_ARK3116 is not set
2865 +# CONFIG_USB_SERIAL_BELKIN is not set
2866 +# CONFIG_USB_SERIAL_WHITEHEAT is not set
2867 +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
2868 +CONFIG_USB_SERIAL_CP2101=m
2869 +# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
2870 +# CONFIG_USB_SERIAL_EMPEG is not set
2871 +CONFIG_USB_SERIAL_FTDI_SIO=m
2872 +# CONFIG_USB_SERIAL_FUNSOFT is not set
2873 +# CONFIG_USB_SERIAL_VISOR is not set
2874 +# CONFIG_USB_SERIAL_IPAQ is not set
2875 +# CONFIG_USB_SERIAL_IR is not set
2876 +# CONFIG_USB_SERIAL_EDGEPORT is not set
2877 +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
2878 +# CONFIG_USB_SERIAL_GARMIN is not set
2879 +# CONFIG_USB_SERIAL_IPW is not set
2880 +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
2881 +# CONFIG_USB_SERIAL_KEYSPAN is not set
2882 +# CONFIG_USB_SERIAL_KLSI is not set
2883 +# CONFIG_USB_SERIAL_KOBIL_SCT is not set
2884 +# CONFIG_USB_SERIAL_MCT_U232 is not set
2885 +# CONFIG_USB_SERIAL_MOS7720 is not set
2886 +# CONFIG_USB_SERIAL_MOS7840 is not set
2887 +# CONFIG_USB_SERIAL_NAVMAN is not set
2888 +CONFIG_USB_SERIAL_PL2303=m
2889 +# CONFIG_USB_SERIAL_HP4X is not set
2890 +# CONFIG_USB_SERIAL_SAFE is not set
2891 +# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
2892 +# CONFIG_USB_SERIAL_TI is not set
2893 +# CONFIG_USB_SERIAL_CYBERJACK is not set
2894 +# CONFIG_USB_SERIAL_XIRCOM is not set
2895 +# CONFIG_USB_SERIAL_OPTION is not set
2896 +# CONFIG_USB_SERIAL_OMNINET is not set
2897 +# CONFIG_USB_SERIAL_DEBUG is not set
2898 +
2899 +#
2900 +# USB Miscellaneous drivers
2901 +#
2902 +# CONFIG_USB_EMI62 is not set
2903 +# CONFIG_USB_EMI26 is not set
2904 +# CONFIG_USB_ADUTUX is not set
2905 +# CONFIG_USB_AUERSWALD is not set
2906 +# CONFIG_USB_RIO500 is not set
2907 +# CONFIG_USB_LEGOTOWER is not set
2908 +# CONFIG_USB_LCD is not set
2909 +# CONFIG_USB_BERRY_CHARGE is not set
2910 +# CONFIG_USB_LED is not set
2911 +# CONFIG_USB_CYPRESS_CY7C63 is not set
2912 +# CONFIG_USB_CYTHERM is not set
2913 +# CONFIG_USB_PHIDGET is not set
2914 +# CONFIG_USB_IDMOUSE is not set
2915 +# CONFIG_USB_FTDI_ELAN is not set
2916 +# CONFIG_USB_APPLEDISPLAY is not set
2917 +# CONFIG_USB_SISUSBVGA is not set
2918 +# CONFIG_USB_LD is not set
2919 +# CONFIG_USB_TRANCEVIBRATOR is not set
2920 +# CONFIG_USB_IOWARRIOR is not set
2921 +# CONFIG_USB_TEST is not set
2922 +
2923 +#
2924 +# USB DSL modem support
2925 +#
2926 +
2927 +#
2928 +# USB Gadget Support
2929 +#
2930 +# CONFIG_USB_GADGET is not set
2931 +CONFIG_MMC=y
2932 +# CONFIG_MMC_DEBUG is not set
2933 +# CONFIG_MMC_UNSAFE_RESUME is not set
2934 +
2935 +#
2936 +# MMC/SD Card Drivers
2937 +#
2938 +CONFIG_MMC_BLOCK=y
2939 +
2940 +#
2941 +# MMC/SD Host Controller Drivers
2942 +#
2943 +CONFIG_MMC_SDHCI=y
2944 +# CONFIG_MMC_WBSD is not set
2945 +# CONFIG_MMC_TIFM_SD is not set
2946 +
2947 +#
2948 +# LED devices
2949 +#
2950 +CONFIG_NEW_LEDS=y
2951 +CONFIG_LEDS_CLASS=y
2952 +
2953 +#
2954 +# LED drivers
2955 +#
2956 +
2957 +#
2958 +# LED Triggers
2959 +#
2960 +CONFIG_LEDS_TRIGGERS=y
2961 +CONFIG_LEDS_TRIGGER_TIMER=y
2962 +# CONFIG_LEDS_TRIGGER_IDE_DISK is not set
2963 +CONFIG_LEDS_TRIGGER_HEARTBEAT=y
2964 +
2965 +#
2966 +# InfiniBand support
2967 +#
2968 +# CONFIG_INFINIBAND is not set
2969 +
2970 +#
2971 +# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
2972 +#
2973 +# CONFIG_EDAC is not set
2974 +
2975 +#
2976 +# Real Time Clock
2977 +#
2978 +CONFIG_RTC_LIB=y
2979 +CONFIG_RTC_CLASS=y
2980 +# CONFIG_RTC_HCTOSYS is not set
2981 +# CONFIG_RTC_DEBUG is not set
2982 +
2983 +#
2984 +# RTC interfaces
2985 +#
2986 +CONFIG_RTC_INTF_SYSFS=y
2987 +CONFIG_RTC_INTF_PROC=y
2988 +CONFIG_RTC_INTF_DEV=y
2989 +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
2990 +# CONFIG_RTC_DRV_TEST is not set
2991 +
2992 +#
2993 +# I2C RTC drivers
2994 +#
2995 +# CONFIG_RTC_DRV_DS1307 is not set
2996 +# CONFIG_RTC_DRV_DS1672 is not set
2997 +# CONFIG_RTC_DRV_MAX6900 is not set
2998 +# CONFIG_RTC_DRV_RS5C372 is not set
2999 +# CONFIG_RTC_DRV_ISL1208 is not set
3000 +# CONFIG_RTC_DRV_X1205 is not set
3001 +# CONFIG_RTC_DRV_PCF8563 is not set
3002 +# CONFIG_RTC_DRV_PCF8583 is not set
3003 +
3004 +#
3005 +# SPI RTC drivers
3006 +#
3007 +
3008 +#
3009 +# Platform RTC drivers
3010 +#
3011 +CONFIG_RTC_DRV_CMOS=y
3012 +# CONFIG_RTC_DRV_DS1553 is not set
3013 +# CONFIG_RTC_DRV_DS1742 is not set
3014 +# CONFIG_RTC_DRV_M48T86 is not set
3015 +# CONFIG_RTC_DRV_V3020 is not set
3016 +
3017 +#
3018 +# on-CPU RTC drivers
3019 +#
3020 +
3021 +#
3022 +# DMA Engine support
3023 +#
3024 +# CONFIG_DMA_ENGINE is not set
3025 +
3026 +#
3027 +# DMA Clients
3028 +#
3029 +
3030 +#
3031 +# DMA Devices
3032 +#
3033 +
3034 +#
3035 +# Virtualization
3036 +#
3037 +# CONFIG_KVM is not set
3038 +
3039 +#
3040 +# Sysprof
3041 +#
3042 +CONFIG_SYSPROF=m
3043 +
3044 +#
3045 +# File systems
3046 +#
3047 +CONFIG_EXT2_FS=y
3048 +CONFIG_EXT2_FS_XATTR=y
3049 +# CONFIG_EXT2_FS_POSIX_ACL is not set
3050 +CONFIG_EXT2_FS_SECURITY=y
3051 +CONFIG_EXT2_FS_XIP=y
3052 +CONFIG_FS_XIP=y
3053 +CONFIG_EXT3_FS=y
3054 +CONFIG_EXT3_FS_XATTR=y
3055 +# CONFIG_EXT3_FS_POSIX_ACL is not set
3056 +CONFIG_EXT3_FS_SECURITY=y
3057 +# CONFIG_EXT4DEV_FS is not set
3058 +CONFIG_JBD=y
3059 +# CONFIG_JBD_DEBUG is not set
3060 +CONFIG_FS_MBCACHE=y
3061 +# CONFIG_REISERFS_FS is not set
3062 +# CONFIG_JFS_FS is not set
3063 +# CONFIG_FS_POSIX_ACL is not set
3064 +# CONFIG_XFS_FS is not set
3065 +# CONFIG_GFS2_FS is not set
3066 +# CONFIG_OCFS2_FS is not set
3067 +# CONFIG_MINIX_FS is not set
3068 +# CONFIG_ROMFS_FS is not set
3069 +CONFIG_INOTIFY=y
3070 +CONFIG_INOTIFY_USER=y
3071 +CONFIG_QUOTA=y
3072 +# CONFIG_QFMT_V1 is not set
3073 +CONFIG_QFMT_V2=y
3074 +CONFIG_QUOTACTL=y
3075 +CONFIG_DNOTIFY=y
3076 +CONFIG_AUTOFS_FS=m
3077 +CONFIG_AUTOFS4_FS=m
3078 +# CONFIG_FUSE_FS is not set
3079 +
3080 +#
3081 +# CD-ROM/DVD Filesystems
3082 +#
3083 +CONFIG_ISO9660_FS=m
3084 +CONFIG_JOLIET=y
3085 +CONFIG_ZISOFS=y
3086 +CONFIG_UDF_FS=m
3087 +CONFIG_UDF_NLS=y
3088 +
3089 +#
3090 +# DOS/FAT/NT Filesystems
3091 +#
3092 +CONFIG_FAT_FS=m
3093 +CONFIG_MSDOS_FS=m
3094 +CONFIG_VFAT_FS=m
3095 +CONFIG_FAT_DEFAULT_CODEPAGE=437
3096 +CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
3097 +# CONFIG_NTFS_FS is not set
3098 +
3099 +#
3100 +# Pseudo filesystems
3101 +#
3102 +CONFIG_PROC_FS=y
3103 +CONFIG_PROC_KCORE=y
3104 +CONFIG_PROC_SYSCTL=y
3105 +CONFIG_SYSFS=y
3106 +CONFIG_TMPFS=y
3107 +# CONFIG_TMPFS_POSIX_ACL is not set
3108 +CONFIG_HUGETLBFS=y
3109 +CONFIG_HUGETLB_PAGE=y
3110 +CONFIG_PROMFS_FS=y
3111 +CONFIG_RAMFS=y
3112 +# CONFIG_CONFIGFS_FS is not set
3113 +
3114 +#
3115 +# Miscellaneous filesystems
3116 +#
3117 +# CONFIG_ADFS_FS is not set
3118 +# CONFIG_AFFS_FS is not set
3119 +# CONFIG_ECRYPT_FS is not set
3120 +# CONFIG_HFS_FS is not set
3121 +# CONFIG_HFSPLUS_FS is not set
3122 +# CONFIG_BEFS_FS is not set
3123 +# CONFIG_BFS_FS is not set
3124 +# CONFIG_EFS_FS is not set
3125 +CONFIG_JFFS2_FS=y
3126 +CONFIG_JFFS2_FS_DEBUG=0
3127 +CONFIG_JFFS2_FS_WRITEBUFFER=y
3128 +CONFIG_JFFS2_FS_WBUF_VERIFY=y
3129 +CONFIG_JFFS2_SUMMARY=y
3130 +CONFIG_JFFS2_FS_XATTR=y
3131 +# CONFIG_JFFS2_FS_POSIX_ACL is not set
3132 +CONFIG_JFFS2_FS_SECURITY=y
3133 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
3134 +CONFIG_JFFS2_ZLIB=y
3135 +CONFIG_JFFS2_RTIME=y
3136 +# CONFIG_JFFS2_RUBIN is not set
3137 +CONFIG_CRAMFS=m
3138 +# CONFIG_VXFS_FS is not set
3139 +# CONFIG_HPFS_FS is not set
3140 +# CONFIG_QNX4FS_FS is not set
3141 +# CONFIG_SYSV_FS is not set
3142 +# CONFIG_UFS_FS is not set
3143 +
3144 +#
3145 +# Network File Systems
3146 +#
3147 +CONFIG_NFS_FS=m
3148 +CONFIG_NFS_V3=y
3149 +# CONFIG_NFS_V3_ACL is not set
3150 +CONFIG_NFS_V4=y
3151 +CONFIG_NFS_DIRECTIO=y
3152 +# CONFIG_NFSD is not set
3153 +CONFIG_LOCKD=m
3154 +CONFIG_LOCKD_V4=y
3155 +CONFIG_NFS_COMMON=y
3156 +CONFIG_SUNRPC=m
3157 +CONFIG_SUNRPC_GSS=m
3158 +# CONFIG_SUNRPC_BIND34 is not set
3159 +CONFIG_RPCSEC_GSS_KRB5=m
3160 +CONFIG_RPCSEC_GSS_SPKM3=m
3161 +# CONFIG_SMB_FS is not set
3162 +# CONFIG_CIFS is not set
3163 +# CONFIG_NCP_FS is not set
3164 +# CONFIG_CODA_FS is not set
3165 +# CONFIG_AFS_FS is not set
3166 +# CONFIG_9P_FS is not set
3167 +
3168 +#
3169 +# Partition Types
3170 +#
3171 +CONFIG_PARTITION_ADVANCED=y
3172 +# CONFIG_ACORN_PARTITION is not set
3173 +# CONFIG_OSF_PARTITION is not set
3174 +# CONFIG_AMIGA_PARTITION is not set
3175 +# CONFIG_ATARI_PARTITION is not set
3176 +# CONFIG_MAC_PARTITION is not set
3177 +CONFIG_MSDOS_PARTITION=y
3178 +# CONFIG_BSD_DISKLABEL is not set
3179 +# CONFIG_MINIX_SUBPARTITION is not set
3180 +# CONFIG_SOLARIS_X86_PARTITION is not set
3181 +# CONFIG_UNIXWARE_DISKLABEL is not set
3182 +# CONFIG_LDM_PARTITION is not set
3183 +# CONFIG_SGI_PARTITION is not set
3184 +# CONFIG_ULTRIX_PARTITION is not set
3185 +# CONFIG_SUN_PARTITION is not set
3186 +# CONFIG_KARMA_PARTITION is not set
3187 +# CONFIG_EFI_PARTITION is not set
3188 +# CONFIG_SYSV68_PARTITION is not set
3189 +
3190 +#
3191 +# Native Language Support
3192 +#
3193 +CONFIG_NLS=y
3194 +CONFIG_NLS_DEFAULT="utf8"
3195 +CONFIG_NLS_CODEPAGE_437=y
3196 +CONFIG_NLS_CODEPAGE_737=m
3197 +CONFIG_NLS_CODEPAGE_775=m
3198 +CONFIG_NLS_CODEPAGE_850=m
3199 +CONFIG_NLS_CODEPAGE_852=m
3200 +CONFIG_NLS_CODEPAGE_855=m
3201 +CONFIG_NLS_CODEPAGE_857=m
3202 +CONFIG_NLS_CODEPAGE_860=m
3203 +CONFIG_NLS_CODEPAGE_861=m
3204 +CONFIG_NLS_CODEPAGE_862=m
3205 +CONFIG_NLS_CODEPAGE_863=m
3206 +CONFIG_NLS_CODEPAGE_864=m
3207 +CONFIG_NLS_CODEPAGE_865=m
3208 +CONFIG_NLS_CODEPAGE_866=m
3209 +CONFIG_NLS_CODEPAGE_869=m
3210 +CONFIG_NLS_CODEPAGE_936=m
3211 +CONFIG_NLS_CODEPAGE_950=m
3212 +CONFIG_NLS_CODEPAGE_932=m
3213 +CONFIG_NLS_CODEPAGE_949=m
3214 +CONFIG_NLS_CODEPAGE_874=m
3215 +CONFIG_NLS_ISO8859_8=m
3216 +CONFIG_NLS_CODEPAGE_1250=m
3217 +CONFIG_NLS_CODEPAGE_1251=m
3218 +CONFIG_NLS_ASCII=y
3219 +CONFIG_NLS_ISO8859_1=m
3220 +CONFIG_NLS_ISO8859_2=m
3221 +CONFIG_NLS_ISO8859_3=m
3222 +CONFIG_NLS_ISO8859_4=m
3223 +CONFIG_NLS_ISO8859_5=m
3224 +CONFIG_NLS_ISO8859_6=m
3225 +CONFIG_NLS_ISO8859_7=m
3226 +CONFIG_NLS_ISO8859_9=m
3227 +CONFIG_NLS_ISO8859_13=m
3228 +CONFIG_NLS_ISO8859_14=m
3229 +CONFIG_NLS_ISO8859_15=m
3230 +CONFIG_NLS_KOI8_R=m
3231 +CONFIG_NLS_KOI8_U=m
3232 +CONFIG_NLS_UTF8=m
3233 +
3234 +#
3235 +# Distributed Lock Manager
3236 +#
3237 +# CONFIG_DLM is not set
3238 +
3239 +#
3240 +# Instrumentation Support
3241 +#
3242 +CONFIG_PROFILING=y
3243 +CONFIG_OPROFILE=m
3244 +CONFIG_KPROBES=y
3245 +
3246 +#
3247 +# Kernel hacking
3248 +#
3249 +CONFIG_TRACE_IRQFLAGS_SUPPORT=y
3250 +CONFIG_PRINTK_TIME=y
3251 +# CONFIG_ENABLE_MUST_CHECK is not set
3252 +CONFIG_MAGIC_SYSRQ=y
3253 +CONFIG_UNUSED_SYMBOLS=y
3254 +CONFIG_DEBUG_FS=y
3255 +# CONFIG_HEADERS_CHECK is not set
3256 +CONFIG_DEBUG_KERNEL=y
3257 +# CONFIG_DEBUG_SHIRQ is not set
3258 +CONFIG_DETECT_SOFTLOCKUP=y
3259 +CONFIG_SCHEDSTATS=y
3260 +CONFIG_TIMER_STATS=y
3261 +# CONFIG_DEBUG_SLAB is not set
3262 +CONFIG_DEBUG_PREEMPT=y
3263 +# CONFIG_DEBUG_RT_MUTEXES is not set
3264 +# CONFIG_RT_MUTEX_TESTER is not set
3265 +CONFIG_DEBUG_SPINLOCK=y
3266 +# CONFIG_DEBUG_MUTEXES is not set
3267 +# CONFIG_DEBUG_LOCK_ALLOC is not set
3268 +# CONFIG_PROVE_LOCKING is not set
3269 +CONFIG_DEBUG_SPINLOCK_SLEEP=y
3270 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
3271 +# CONFIG_DEBUG_KOBJECT is not set
3272 +# CONFIG_DEBUG_BUGVERBOSE is not set
3273 +CONFIG_DEBUG_INFO=y
3274 +CONFIG_DEBUG_VM=y
3275 +CONFIG_DEBUG_LIST=y
3276 +# CONFIG_FRAME_POINTER is not set
3277 +# CONFIG_FORCED_INLINING is not set
3278 +# CONFIG_RCU_TORTURE_TEST is not set
3279 +# CONFIG_LKDTM is not set
3280 +# CONFIG_FAULT_INJECTION is not set
3281 +CONFIG_EARLY_PRINTK=y
3282 +CONFIG_DEBUG_STACKOVERFLOW=y
3283 +CONFIG_DEBUG_STACK_USAGE=y
3284 +
3285 +#
3286 +# Page alloc debug is incompatible with Software Suspend on i386
3287 +#
3288 +CONFIG_DEBUG_RODATA=y
3289 +CONFIG_4KSTACKS=y
3290 +CONFIG_DOUBLEFAULT=y
3291 +
3292 +#
3293 +# Security options
3294 +#
3295 +CONFIG_KEYS=y
3296 +CONFIG_KEYS_DEBUG_PROC_KEYS=y
3297 +CONFIG_SECURITY=y
3298 +CONFIG_SECURITY_NETWORK=y
3299 +CONFIG_SECURITY_NETWORK_XFRM=y
3300 +CONFIG_SECURITY_CAPABILITIES=y
3301 +# CONFIG_SECURITY_ROOTPLUG is not set
3302 +CONFIG_SECURITY_SELINUX=y
3303 +CONFIG_SECURITY_SELINUX_BOOTPARAM=y
3304 +CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
3305 +# CONFIG_SECURITY_SELINUX_DISABLE is not set
3306 +CONFIG_SECURITY_SELINUX_DEVELOP=y
3307 +CONFIG_SECURITY_SELINUX_AVC_STATS=y
3308 +CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
3309 +# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set
3310 +# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
3311 +
3312 +#
3313 +# Cryptographic options
3314 +#
3315 +CONFIG_CRYPTO=y
3316 +CONFIG_CRYPTO_ALGAPI=y
3317 +CONFIG_CRYPTO_BLKCIPHER=y
3318 +CONFIG_CRYPTO_HASH=y
3319 +CONFIG_CRYPTO_MANAGER=y
3320 +CONFIG_CRYPTO_HMAC=y
3321 +CONFIG_CRYPTO_XCBC=m
3322 +CONFIG_CRYPTO_NULL=m
3323 +CONFIG_CRYPTO_MD4=m
3324 +CONFIG_CRYPTO_MD5=y
3325 +CONFIG_CRYPTO_SHA1=y
3326 +CONFIG_CRYPTO_SHA256=m
3327 +CONFIG_CRYPTO_SHA512=m
3328 +CONFIG_CRYPTO_WP512=m
3329 +CONFIG_CRYPTO_TGR192=m
3330 +CONFIG_CRYPTO_GF128MUL=m
3331 +CONFIG_CRYPTO_ECB=m
3332 +CONFIG_CRYPTO_CBC=m
3333 +CONFIG_CRYPTO_PCBC=m
3334 +CONFIG_CRYPTO_LRW=m
3335 +# CONFIG_CRYPTO_CRYPTD is not set
3336 +CONFIG_CRYPTO_DES=m
3337 +CONFIG_CRYPTO_FCRYPT=m
3338 +CONFIG_CRYPTO_BLOWFISH=m
3339 +CONFIG_CRYPTO_TWOFISH=m
3340 +CONFIG_CRYPTO_TWOFISH_COMMON=m
3341 +# CONFIG_CRYPTO_TWOFISH_586 is not set
3342 +CONFIG_CRYPTO_SERPENT=m
3343 +CONFIG_CRYPTO_AES=m
3344 +CONFIG_CRYPTO_AES_586=m
3345 +CONFIG_CRYPTO_CAST5=m
3346 +CONFIG_CRYPTO_CAST6=m
3347 +CONFIG_CRYPTO_TEA=m
3348 +CONFIG_CRYPTO_ARC4=m
3349 +CONFIG_CRYPTO_KHAZAD=m
3350 +CONFIG_CRYPTO_ANUBIS=m
3351 +CONFIG_CRYPTO_DEFLATE=m
3352 +CONFIG_CRYPTO_MICHAEL_MIC=m
3353 +CONFIG_CRYPTO_CRC32C=m
3354 +CONFIG_CRYPTO_CAMELLIA=m
3355 +# CONFIG_CRYPTO_TEST is not set
3356 +
3357 +#
3358 +# Hardware crypto devices
3359 +#
3360 +# CONFIG_CRYPTO_DEV_PADLOCK is not set
3361 +CONFIG_CRYPTO_DEV_GEODE=y
3362 +
3363 +#
3364 +# Library routines
3365 +#
3366 +CONFIG_BITREVERSE=y
3367 +CONFIG_CRC_CCITT=m
3368 +CONFIG_CRC16=m
3369 +# CONFIG_CRC_ITU_T is not set
3370 +CONFIG_CRC32=y
3371 +CONFIG_LIBCRC32C=m
3372 +CONFIG_AUDIT_GENERIC=y
3373 +CONFIG_ZLIB_INFLATE=y
3374 +CONFIG_ZLIB_DEFLATE=y
3375 +CONFIG_REED_SOLOMON=y
3376 +CONFIG_REED_SOLOMON_DEC16=y
3377 +CONFIG_TEXTSEARCH=y
3378 +CONFIG_TEXTSEARCH_KMP=m
3379 +CONFIG_TEXTSEARCH_BM=m
3380 +CONFIG_TEXTSEARCH_FSM=m
3381 +CONFIG_PLIST=y
3382 +CONFIG_HAS_IOMEM=y
3383 +CONFIG_HAS_IOPORT=y
3384 +CONFIG_HAS_DMA=y
3385 +CONFIG_GENERIC_HARDIRQS=y
3386 +CONFIG_GENERIC_IRQ_PROBE=y
3387 +CONFIG_X86_BIOS_REBOOT=y
3388 +CONFIG_KTIME_SCALAR=y
3389 diff --git a/arch/i386/configs/xs_defconfig b/arch/i386/configs/xs_defconfig
3390 new file mode 100644
3391 index 0000000..b937de5
3392 --- /dev/null
3393 +++ b/arch/i386/configs/xs_defconfig
3394 @@ -0,0 +1,2221 @@
3395 +#
3396 +# Automatically generated make config: don't edit
3397 +# Linux kernel version: 2.6.22-rc5
3398 +# Wed Jun 20 08:26:53 2007
3399 +#
3400 +CONFIG_X86_32=y
3401 +CONFIG_GENERIC_TIME=y
3402 +CONFIG_CLOCKSOURCE_WATCHDOG=y
3403 +CONFIG_GENERIC_CLOCKEVENTS=y
3404 +CONFIG_LOCKDEP_SUPPORT=y
3405 +CONFIG_STACKTRACE_SUPPORT=y
3406 +CONFIG_SEMAPHORE_SLEEPERS=y
3407 +CONFIG_X86=y
3408 +CONFIG_MMU=y
3409 +CONFIG_ZONE_DMA=y
3410 +CONFIG_QUICKLIST=y
3411 +CONFIG_GENERIC_ISA_DMA=y
3412 +CONFIG_GENERIC_IOMAP=y
3413 +CONFIG_GENERIC_BUG=y
3414 +CONFIG_GENERIC_HWEIGHT=y
3415 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
3416 +CONFIG_DMI=y
3417 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
3418 +
3419 +#
3420 +# Code maturity level options
3421 +#
3422 +CONFIG_EXPERIMENTAL=y
3423 +CONFIG_BROKEN_ON_SMP=y
3424 +CONFIG_LOCK_KERNEL=y
3425 +CONFIG_INIT_ENV_ARG_LIMIT=32
3426 +
3427 +#
3428 +# General setup
3429 +#
3430 +CONFIG_LOCALVERSION=""
3431 +# CONFIG_LOCALVERSION_AUTO is not set
3432 +CONFIG_SWAP=y
3433 +CONFIG_SYSVIPC=y
3434 +# CONFIG_IPC_NS is not set
3435 +CONFIG_SYSVIPC_SYSCTL=y
3436 +CONFIG_POSIX_MQUEUE=y
3437 +CONFIG_BSD_PROCESS_ACCT=y
3438 +# CONFIG_BSD_PROCESS_ACCT_V3 is not set
3439 +# CONFIG_TASKSTATS is not set
3440 +# CONFIG_UTS_NS is not set
3441 +CONFIG_AUDIT=y
3442 +CONFIG_AUDITSYSCALL=y
3443 +# CONFIG_IKCONFIG is not set
3444 +CONFIG_LOG_BUF_SHIFT=17
3445 +# CONFIG_SYSFS_DEPRECATED is not set
3446 +CONFIG_RELAY=y
3447 +CONFIG_BLK_DEV_INITRD=y
3448 +CONFIG_INITRAMFS_SOURCE=""
3449 +CONFIG_CC_OPTIMIZE_FOR_SIZE=y
3450 +CONFIG_SYSCTL=y
3451 +CONFIG_EMBEDDED=y
3452 +CONFIG_UID16=y
3453 +# CONFIG_SYSCTL_SYSCALL is not set
3454 +CONFIG_KALLSYMS=y
3455 +# CONFIG_KALLSYMS_ALL is not set
3456 +CONFIG_KALLSYMS_EXTRA_PASS=y
3457 +CONFIG_HOTPLUG=y
3458 +CONFIG_PRINTK=y
3459 +CONFIG_BUG=y
3460 +CONFIG_ELF_CORE=y
3461 +# CONFIG_BASE_FULL is not set
3462 +CONFIG_FUTEX=y
3463 +CONFIG_ANON_INODES=y
3464 +CONFIG_EPOLL=y
3465 +CONFIG_SIGNALFD=y
3466 +CONFIG_TIMERFD=y
3467 +CONFIG_EVENTFD=y
3468 +CONFIG_SHMEM=y
3469 +CONFIG_VM_EVENT_COUNTERS=y
3470 +CONFIG_SLAB=y
3471 +# CONFIG_SLUB is not set
3472 +# CONFIG_SLOB is not set
3473 +CONFIG_RT_MUTEXES=y
3474 +# CONFIG_TINY_SHMEM is not set
3475 +CONFIG_BASE_SMALL=1
3476 +
3477 +#
3478 +# Loadable module support
3479 +#
3480 +CONFIG_MODULES=y
3481 +CONFIG_MODULE_UNLOAD=y
3482 +# CONFIG_MODULE_FORCE_UNLOAD is not set
3483 +CONFIG_MODVERSIONS=y
3484 +CONFIG_MODULE_SRCVERSION_ALL=y
3485 +CONFIG_KMOD=y
3486 +
3487 +#
3488 +# Block layer
3489 +#
3490 +CONFIG_BLOCK=y
3491 +# CONFIG_LBD is not set
3492 +# CONFIG_BLK_DEV_IO_TRACE is not set
3493 +# CONFIG_LSF is not set
3494 +
3495 +#
3496 +# IO Schedulers
3497 +#
3498 +CONFIG_IOSCHED_NOOP=y
3499 +# CONFIG_IOSCHED_AS is not set
3500 +# CONFIG_IOSCHED_DEADLINE is not set
3501 +CONFIG_IOSCHED_CFQ=y
3502 +# CONFIG_DEFAULT_AS is not set
3503 +# CONFIG_DEFAULT_DEADLINE is not set
3504 +CONFIG_DEFAULT_CFQ=y
3505 +# CONFIG_DEFAULT_NOOP is not set
3506 +CONFIG_DEFAULT_IOSCHED="cfq"
3507 +
3508 +#
3509 +# Processor type and features
3510 +#
3511 +CONFIG_TICK_ONESHOT=y
3512 +CONFIG_NO_HZ=y
3513 +CONFIG_HIGH_RES_TIMERS=y
3514 +# CONFIG_SMP is not set
3515 +CONFIG_X86_PC=y
3516 +# CONFIG_X86_ELAN is not set
3517 +# CONFIG_X86_VOYAGER is not set
3518 +# CONFIG_X86_NUMAQ is not set
3519 +# CONFIG_X86_SUMMIT is not set
3520 +# CONFIG_X86_BIGSMP is not set
3521 +# CONFIG_X86_VISWS is not set
3522 +# CONFIG_X86_GENERICARCH is not set
3523 +# CONFIG_X86_ES7000 is not set
3524 +# CONFIG_PARAVIRT is not set
3525 +# CONFIG_M386 is not set
3526 +# CONFIG_M486 is not set
3527 +# CONFIG_M586 is not set
3528 +# CONFIG_M586TSC is not set
3529 +# CONFIG_M586MMX is not set
3530 +# CONFIG_M686 is not set
3531 +# CONFIG_MPENTIUMII is not set
3532 +# CONFIG_MPENTIUMIII is not set
3533 +# CONFIG_MPENTIUMM is not set
3534 +# CONFIG_MCORE2 is not set
3535 +# CONFIG_MPENTIUM4 is not set
3536 +# CONFIG_MK6 is not set
3537 +# CONFIG_MK7 is not set
3538 +# CONFIG_MK8 is not set
3539 +# CONFIG_MCRUSOE is not set
3540 +# CONFIG_MEFFICEON is not set
3541 +# CONFIG_MWINCHIPC6 is not set
3542 +# CONFIG_MWINCHIP2 is not set
3543 +# CONFIG_MWINCHIP3D is not set
3544 +# CONFIG_MGEODEGX1 is not set
3545 +CONFIG_MGEODE_LX=y
3546 +# CONFIG_MCYRIXIII is not set
3547 +# CONFIG_MVIAC3_2 is not set
3548 +# CONFIG_MVIAC7 is not set
3549 +# CONFIG_X86_GENERIC is not set
3550 +CONFIG_X86_CMPXCHG=y
3551 +CONFIG_X86_L1_CACHE_SHIFT=5
3552 +CONFIG_X86_XADD=y
3553 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
3554 +# CONFIG_ARCH_HAS_ILOG2_U32 is not set
3555 +# CONFIG_ARCH_HAS_ILOG2_U64 is not set
3556 +CONFIG_GENERIC_CALIBRATE_DELAY=y
3557 +CONFIG_X86_WP_WORKS_OK=y
3558 +CONFIG_X86_INVLPG=y
3559 +CONFIG_X86_BSWAP=y
3560 +CONFIG_X86_POPAD_OK=y
3561 +CONFIG_X86_CMPXCHG64=y
3562 +CONFIG_X86_USE_PPRO_CHECKSUM=y
3563 +CONFIG_X86_USE_3DNOW=y
3564 +CONFIG_X86_TSC=y
3565 +CONFIG_X86_MINIMUM_CPU_MODEL=4
3566 +# CONFIG_HPET_TIMER is not set
3567 +# CONFIG_PREEMPT_NONE is not set
3568 +# CONFIG_PREEMPT_VOLUNTARY is not set
3569 +CONFIG_PREEMPT=y
3570 +CONFIG_PREEMPT_BKL=y
3571 +# CONFIG_X86_UP_APIC is not set
3572 +# CONFIG_X86_MCE is not set
3573 +# CONFIG_VM86 is not set
3574 +# CONFIG_TOSHIBA is not set
3575 +# CONFIG_I8K is not set
3576 +CONFIG_X86_REBOOTFIXUPS=y
3577 +# CONFIG_MICROCODE is not set
3578 +CONFIG_X86_MSR=y
3579 +CONFIG_X86_CPUID=m
3580 +
3581 +#
3582 +# Firmware Drivers
3583 +#
3584 +# CONFIG_EDD is not set
3585 +# CONFIG_DELL_RBU is not set
3586 +# CONFIG_DCDBAS is not set
3587 +CONFIG_NOHIGHMEM=y
3588 +# CONFIG_HIGHMEM4G is not set
3589 +# CONFIG_HIGHMEM64G is not set
3590 +CONFIG_VMSPLIT_3G=y
3591 +# CONFIG_VMSPLIT_3G_OPT is not set
3592 +# CONFIG_VMSPLIT_2G is not set
3593 +# CONFIG_VMSPLIT_2G_OPT is not set
3594 +# CONFIG_VMSPLIT_1G is not set
3595 +CONFIG_PAGE_OFFSET=0xC0000000
3596 +CONFIG_ARCH_FLATMEM_ENABLE=y
3597 +CONFIG_ARCH_SPARSEMEM_ENABLE=y
3598 +CONFIG_ARCH_SELECT_MEMORY_MODEL=y
3599 +CONFIG_ARCH_POPULATES_NODE_MAP=y
3600 +CONFIG_SELECT_MEMORY_MODEL=y
3601 +CONFIG_FLATMEM_MANUAL=y
3602 +# CONFIG_DISCONTIGMEM_MANUAL is not set
3603 +# CONFIG_SPARSEMEM_MANUAL is not set
3604 +CONFIG_FLATMEM=y
3605 +CONFIG_FLAT_NODE_MEM_MAP=y
3606 +CONFIG_SPARSEMEM_STATIC=y
3607 +CONFIG_SPLIT_PTLOCK_CPUS=4
3608 +# CONFIG_RESOURCES_64BIT is not set
3609 +CONFIG_ZONE_DMA_FLAG=1
3610 +CONFIG_NR_QUICK=1
3611 +# CONFIG_MATH_EMULATION is not set
3612 +# CONFIG_MTRR is not set
3613 +# CONFIG_SECCOMP is not set
3614 +# CONFIG_VGA_NOPROBE is not set
3615 +CONFIG_HZ_100=y
3616 +# CONFIG_HZ_250 is not set
3617 +# CONFIG_HZ_300 is not set
3618 +# CONFIG_HZ_1000 is not set
3619 +CONFIG_HZ=100
3620 +CONFIG_KEXEC=y
3621 +CONFIG_PHYSICAL_START=0x400000
3622 +# CONFIG_RELOCATABLE is not set
3623 +CONFIG_PHYSICAL_ALIGN=0x100000
3624 +# CONFIG_COMPAT_VDSO is not set
3625 +
3626 +#
3627 +# Power management options (ACPI, APM)
3628 +#
3629 +CONFIG_PM=y
3630 +CONFIG_PM_LEGACY=y
3631 +CONFIG_PM_DEBUG=y
3632 +# CONFIG_DISABLE_CONSOLE_SUSPEND is not set
3633 +CONFIG_DISABLE_SUSPEND_VT_SWITCH=y
3634 +# CONFIG_PM_TRACE is not set
3635 +# CONFIG_PM_SYSFS_DEPRECATED is not set
3636 +CONFIG_SOFTWARE_SUSPEND=y
3637 +CONFIG_PM_STD_PARTITION=""
3638 +
3639 +#
3640 +# ACPI (Advanced Configuration and Power Interface) Support
3641 +#
3642 +# CONFIG_ACPI is not set
3643 +# CONFIG_APM is not set
3644 +
3645 +#
3646 +# CPU Frequency scaling
3647 +#
3648 +# CONFIG_CPU_FREQ is not set
3649 +
3650 +#
3651 +# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
3652 +#
3653 +CONFIG_PCI=y
3654 +# CONFIG_PCI_GOBIOS is not set
3655 +# CONFIG_PCI_GOMMCONFIG is not set
3656 +# CONFIG_PCI_GODIRECT is not set
3657 +# CONFIG_PCI_GOANY is not set
3658 +CONFIG_PCI_GOOLPC=y
3659 +CONFIG_PCI_DIRECT=y
3660 +CONFIG_PCI_OLPC=y
3661 +# CONFIG_PCIEPORTBUS is not set
3662 +# CONFIG_ARCH_SUPPORTS_MSI is not set
3663 +# CONFIG_PCI_DEBUG is not set
3664 +CONFIG_ISA_DMA_API=y
3665 +# CONFIG_ISA is not set
3666 +# CONFIG_MCA is not set
3667 +# CONFIG_SCx200 is not set
3668 +CONFIG_GEODE_MFGPT_TIMER=y
3669 +CONFIG_OLPC=y
3670 +CONFIG_OLPC_PM=y
3671 +CONFIG_OPEN_FIRMWARE=y
3672 +
3673 +#
3674 +# PCCARD (PCMCIA/CardBus) support
3675 +#
3676 +# CONFIG_PCCARD is not set
3677 +# CONFIG_HOTPLUG_PCI is not set
3678 +
3679 +#
3680 +# Executable file formats
3681 +#
3682 +CONFIG_BINFMT_ELF=y
3683 +# CONFIG_BINFMT_AOUT is not set
3684 +CONFIG_BINFMT_MISC=y
3685 +
3686 +#
3687 +# Networking
3688 +#
3689 +CONFIG_NET=y
3690 +
3691 +#
3692 +# Networking options
3693 +#
3694 +CONFIG_PACKET=y
3695 +CONFIG_PACKET_MMAP=y
3696 +CONFIG_UNIX=y
3697 +CONFIG_XFRM=y
3698 +CONFIG_XFRM_USER=y
3699 +# CONFIG_XFRM_SUB_POLICY is not set
3700 +CONFIG_XFRM_MIGRATE=y
3701 +CONFIG_NET_KEY=m
3702 +CONFIG_NET_KEY_MIGRATE=y
3703 +CONFIG_INET=y
3704 +CONFIG_IP_MULTICAST=y
3705 +CONFIG_IP_ADVANCED_ROUTER=y
3706 +CONFIG_ASK_IP_FIB_HASH=y
3707 +# CONFIG_IP_FIB_TRIE is not set
3708 +CONFIG_IP_FIB_HASH=y
3709 +CONFIG_IP_MULTIPLE_TABLES=y
3710 +CONFIG_IP_ROUTE_MULTIPATH=y
3711 +# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
3712 +CONFIG_IP_ROUTE_VERBOSE=y
3713 +# CONFIG_IP_PNP is not set
3714 +# CONFIG_NET_IPIP is not set
3715 +# CONFIG_NET_IPGRE is not set
3716 +# CONFIG_IP_MROUTE is not set
3717 +# CONFIG_ARPD is not set
3718 +CONFIG_SYN_COOKIES=y
3719 +CONFIG_INET_AH=m
3720 +CONFIG_INET_ESP=m
3721 +CONFIG_INET_IPCOMP=m
3722 +CONFIG_INET_XFRM_TUNNEL=m
3723 +CONFIG_INET_TUNNEL=m
3724 +CONFIG_INET_XFRM_MODE_TRANSPORT=y
3725 +CONFIG_INET_XFRM_MODE_TUNNEL=y
3726 +CONFIG_INET_XFRM_MODE_BEET=y
3727 +# CONFIG_INET_DIAG is not set
3728 +CONFIG_TCP_CONG_ADVANCED=y
3729 +CONFIG_TCP_CONG_BIC=y
3730 +CONFIG_TCP_CONG_CUBIC=m
3731 +CONFIG_TCP_CONG_WESTWOOD=m
3732 +CONFIG_TCP_CONG_HTCP=m
3733 +CONFIG_TCP_CONG_HSTCP=m
3734 +CONFIG_TCP_CONG_HYBLA=m
3735 +CONFIG_TCP_CONG_VEGAS=m
3736 +CONFIG_TCP_CONG_SCALABLE=m
3737 +CONFIG_TCP_CONG_LP=m
3738 +CONFIG_TCP_CONG_VENO=m
3739 +CONFIG_TCP_CONG_YEAH=m
3740 +CONFIG_TCP_CONG_ILLINOIS=m
3741 +CONFIG_DEFAULT_BIC=y
3742 +# CONFIG_DEFAULT_CUBIC is not set
3743 +# CONFIG_DEFAULT_HTCP is not set
3744 +# CONFIG_DEFAULT_VEGAS is not set
3745 +# CONFIG_DEFAULT_WESTWOOD is not set
3746 +# CONFIG_DEFAULT_RENO is not set
3747 +CONFIG_DEFAULT_TCP_CONG="bic"
3748 +# CONFIG_TCP_MD5SIG is not set
3749 +# CONFIG_IP_VS is not set
3750 +CONFIG_IPV6=m
3751 +CONFIG_IPV6_PRIVACY=y
3752 +CONFIG_IPV6_ROUTER_PREF=y
3753 +CONFIG_IPV6_ROUTE_INFO=y
3754 +CONFIG_IPV6_OPTIMISTIC_DAD=y
3755 +CONFIG_INET6_AH=m
3756 +CONFIG_INET6_ESP=m
3757 +CONFIG_INET6_IPCOMP=m
3758 +CONFIG_IPV6_MIP6=y
3759 +CONFIG_INET6_XFRM_TUNNEL=m
3760 +CONFIG_INET6_TUNNEL=m
3761 +CONFIG_INET6_XFRM_MODE_TRANSPORT=m
3762 +CONFIG_INET6_XFRM_MODE_TUNNEL=m
3763 +CONFIG_INET6_XFRM_MODE_BEET=m
3764 +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
3765 +CONFIG_IPV6_SIT=m
3766 +CONFIG_IPV6_TUNNEL=m
3767 +CONFIG_IPV6_MULTIPLE_TABLES=y
3768 +CONFIG_IPV6_SUBTREES=y
3769 +# CONFIG_NETLABEL is not set
3770 +CONFIG_NETWORK_SECMARK=y
3771 +CONFIG_NETFILTER=y
3772 +# CONFIG_NETFILTER_DEBUG is not set
3773 +
3774 +#
3775 +# Core Netfilter Configuration
3776 +#
3777 +CONFIG_NETFILTER_NETLINK=m
3778 +# CONFIG_NETFILTER_NETLINK_QUEUE is not set
3779 +# CONFIG_NETFILTER_NETLINK_LOG is not set
3780 +CONFIG_NF_CONNTRACK_ENABLED=m
3781 +CONFIG_NF_CONNTRACK=m
3782 +# CONFIG_NF_CT_ACCT is not set
3783 +# CONFIG_NF_CONNTRACK_MARK is not set
3784 +# CONFIG_NF_CONNTRACK_SECMARK is not set
3785 +# CONFIG_NF_CONNTRACK_EVENTS is not set
3786 +# CONFIG_NF_CT_PROTO_SCTP is not set
3787 +# CONFIG_NF_CONNTRACK_AMANDA is not set
3788 +CONFIG_NF_CONNTRACK_FTP=m
3789 +# CONFIG_NF_CONNTRACK_H323 is not set
3790 +CONFIG_NF_CONNTRACK_IRC=m
3791 +# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
3792 +# CONFIG_NF_CONNTRACK_PPTP is not set
3793 +# CONFIG_NF_CONNTRACK_SANE is not set
3794 +# CONFIG_NF_CONNTRACK_SIP is not set
3795 +# CONFIG_NF_CONNTRACK_TFTP is not set
3796 +# CONFIG_NF_CT_NETLINK is not set
3797 +CONFIG_NETFILTER_XTABLES=m
3798 +# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
3799 +# CONFIG_NETFILTER_XT_TARGET_MARK is not set
3800 +# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
3801 +CONFIG_NETFILTER_XT_TARGET_NFLOG=m
3802 +# CONFIG_NETFILTER_XT_TARGET_SECMARK is not set
3803 +# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
3804 +# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
3805 +# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set
3806 +# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set
3807 +# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set
3808 +# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
3809 +# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
3810 +# CONFIG_NETFILTER_XT_MATCH_ESP is not set
3811 +# CONFIG_NETFILTER_XT_MATCH_HELPER is not set
3812 +# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
3813 +# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
3814 +# CONFIG_NETFILTER_XT_MATCH_MAC is not set
3815 +# CONFIG_NETFILTER_XT_MATCH_MARK is not set
3816 +# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
3817 +# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
3818 +# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
3819 +# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
3820 +# CONFIG_NETFILTER_XT_MATCH_REALM is not set
3821 +# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
3822 +CONFIG_NETFILTER_XT_MATCH_STATE=m
3823 +# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
3824 +# CONFIG_NETFILTER_XT_MATCH_STRING is not set
3825 +# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
3826 +# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
3827 +
3828 +#
3829 +# IP: Netfilter Configuration
3830 +#
3831 +CONFIG_NF_CONNTRACK_IPV4=m
3832 +CONFIG_NF_CONNTRACK_PROC_COMPAT=y
3833 +# CONFIG_IP_NF_QUEUE is not set
3834 +CONFIG_IP_NF_IPTABLES=m
3835 +# CONFIG_IP_NF_MATCH_IPRANGE is not set
3836 +# CONFIG_IP_NF_MATCH_TOS is not set
3837 +# CONFIG_IP_NF_MATCH_RECENT is not set
3838 +# CONFIG_IP_NF_MATCH_ECN is not set
3839 +# CONFIG_IP_NF_MATCH_AH is not set
3840 +# CONFIG_IP_NF_MATCH_TTL is not set
3841 +# CONFIG_IP_NF_MATCH_OWNER is not set
3842 +# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
3843 +CONFIG_IP_NF_FILTER=m
3844 +# CONFIG_IP_NF_TARGET_REJECT is not set
3845 +CONFIG_IP_NF_TARGET_LOG=m
3846 +# CONFIG_IP_NF_TARGET_ULOG is not set
3847 +CONFIG_NF_NAT=m
3848 +CONFIG_NF_NAT_NEEDED=y
3849 +CONFIG_IP_NF_TARGET_MASQUERADE=m
3850 +# CONFIG_IP_NF_TARGET_REDIRECT is not set
3851 +# CONFIG_IP_NF_TARGET_NETMAP is not set
3852 +# CONFIG_IP_NF_TARGET_SAME is not set
3853 +# CONFIG_NF_NAT_SNMP_BASIC is not set
3854 +CONFIG_NF_NAT_FTP=m
3855 +CONFIG_NF_NAT_IRC=m
3856 +# CONFIG_NF_NAT_TFTP is not set
3857 +# CONFIG_NF_NAT_AMANDA is not set
3858 +# CONFIG_NF_NAT_PPTP is not set
3859 +# CONFIG_NF_NAT_H323 is not set
3860 +# CONFIG_NF_NAT_SIP is not set
3861 +# CONFIG_IP_NF_MANGLE is not set
3862 +# CONFIG_IP_NF_RAW is not set
3863 +# CONFIG_IP_NF_ARPTABLES is not set
3864 +
3865 +#
3866 +# IPv6: Netfilter Configuration (EXPERIMENTAL)
3867 +#
3868 +# CONFIG_NF_CONNTRACK_IPV6 is not set
3869 +# CONFIG_IP6_NF_QUEUE is not set
3870 +# CONFIG_IP6_NF_IPTABLES is not set
3871 +# CONFIG_IP_DCCP is not set
3872 +# CONFIG_IP_SCTP is not set
3873 +# CONFIG_TIPC is not set
3874 +# CONFIG_ATM is not set
3875 +# CONFIG_BRIDGE is not set
3876 +# CONFIG_VLAN_8021Q is not set
3877 +# CONFIG_DECNET is not set
3878 +# CONFIG_LLC2 is not set
3879 +# CONFIG_IPX is not set
3880 +# CONFIG_ATALK is not set
3881 +# CONFIG_X25 is not set
3882 +# CONFIG_LAPB is not set
3883 +# CONFIG_ECONET is not set
3884 +# CONFIG_WAN_ROUTER is not set
3885 +
3886 +#
3887 +# QoS and/or fair queueing
3888 +#
3889 +CONFIG_NET_SCHED=y
3890 +CONFIG_NET_SCH_FIFO=y
3891 +
3892 +#
3893 +# Queueing/Scheduling
3894 +#
3895 +CONFIG_NET_SCH_CBQ=m
3896 +CONFIG_NET_SCH_HTB=m
3897 +CONFIG_NET_SCH_HFSC=m
3898 +CONFIG_NET_SCH_PRIO=m
3899 +CONFIG_NET_SCH_RED=m
3900 +CONFIG_NET_SCH_SFQ=m
3901 +CONFIG_NET_SCH_TEQL=m
3902 +CONFIG_NET_SCH_TBF=m
3903 +CONFIG_NET_SCH_GRED=m
3904 +CONFIG_NET_SCH_DSMARK=m
3905 +CONFIG_NET_SCH_NETEM=m
3906 +CONFIG_NET_SCH_INGRESS=m
3907 +
3908 +#
3909 +# Classification
3910 +#
3911 +CONFIG_NET_CLS=y
3912 +CONFIG_NET_CLS_BASIC=m
3913 +CONFIG_NET_CLS_TCINDEX=m
3914 +CONFIG_NET_CLS_ROUTE4=m
3915 +CONFIG_NET_CLS_ROUTE=y
3916 +CONFIG_NET_CLS_FW=m
3917 +CONFIG_NET_CLS_U32=m
3918 +CONFIG_CLS_U32_PERF=y
3919 +CONFIG_CLS_U32_MARK=y
3920 +CONFIG_NET_CLS_RSVP=m
3921 +CONFIG_NET_CLS_RSVP6=m
3922 +CONFIG_NET_EMATCH=y
3923 +CONFIG_NET_EMATCH_STACK=32
3924 +CONFIG_NET_EMATCH_CMP=m
3925 +CONFIG_NET_EMATCH_NBYTE=m
3926 +CONFIG_NET_EMATCH_U32=m
3927 +CONFIG_NET_EMATCH_META=m
3928 +CONFIG_NET_EMATCH_TEXT=m
3929 +CONFIG_NET_CLS_ACT=y
3930 +CONFIG_NET_ACT_POLICE=m
3931 +CONFIG_NET_ACT_GACT=m
3932 +CONFIG_GACT_PROB=y
3933 +CONFIG_NET_ACT_MIRRED=m
3934 +# CONFIG_NET_ACT_IPT is not set
3935 +CONFIG_NET_ACT_PEDIT=m
3936 +CONFIG_NET_ACT_SIMP=m
3937 +CONFIG_NET_CLS_IND=y
3938 +CONFIG_NET_ESTIMATOR=y
3939 +
3940 +#
3941 +# Network testing
3942 +#
3943 +# CONFIG_NET_PKTGEN is not set
3944 +# CONFIG_NET_TCPPROBE is not set
3945 +# CONFIG_HAMRADIO is not set
3946 +# CONFIG_IRDA is not set
3947 +# CONFIG_BT is not set
3948 +# CONFIG_AF_RXRPC is not set
3949 +CONFIG_FIB_RULES=y
3950 +
3951 +#
3952 +# Wireless
3953 +#
3954 +# CONFIG_CFG80211 is not set
3955 +CONFIG_WIRELESS_EXT=y
3956 +# CONFIG_MAC80211 is not set
3957 +CONFIG_IEEE80211=m
3958 +# CONFIG_IEEE80211_DEBUG is not set
3959 +CONFIG_IEEE80211_CRYPT_WEP=m
3960 +CONFIG_IEEE80211_CRYPT_CCMP=m
3961 +CONFIG_IEEE80211_CRYPT_TKIP=m
3962 +CONFIG_IEEE80211_SOFTMAC=m
3963 +CONFIG_IEEE80211_SOFTMAC_DEBUG=y
3964 +# CONFIG_RFKILL is not set
3965 +
3966 +#
3967 +# Device Drivers
3968 +#
3969 +
3970 +#
3971 +# Generic Driver Options
3972 +#
3973 +CONFIG_STANDALONE=y
3974 +CONFIG_PREVENT_FIRMWARE_BUILD=y
3975 +CONFIG_FW_LOADER=y
3976 +# CONFIG_DEBUG_DRIVER is not set
3977 +# CONFIG_DEBUG_DEVRES is not set
3978 +# CONFIG_SYS_HYPERVISOR is not set
3979 +
3980 +#
3981 +# Connector - unified userspace <-> kernelspace linker
3982 +#
3983 +# CONFIG_CONNECTOR is not set
3984 +CONFIG_MTD=y
3985 +# CONFIG_MTD_DEBUG is not set
3986 +CONFIG_MTD_CONCAT=m
3987 +CONFIG_MTD_PARTITIONS=y
3988 +CONFIG_MTD_REDBOOT_PARTS=m
3989 +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
3990 +# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
3991 +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
3992 +CONFIG_MTD_CMDLINE_PARTS=y
3993 +
3994 +#
3995 +# User Modules And Translation Layers
3996 +#
3997 +CONFIG_MTD_CHAR=m
3998 +CONFIG_MTD_BLKDEVS=m
3999 +CONFIG_MTD_BLOCK=m
4000 +CONFIG_MTD_BLOCK_RO=m
4001 +CONFIG_FTL=m
4002 +CONFIG_NFTL=m
4003 +CONFIG_NFTL_RW=y
4004 +CONFIG_INFTL=m
4005 +CONFIG_RFD_FTL=m
4006 +# CONFIG_SSFDC is not set
4007 +
4008 +#
4009 +# RAM/ROM/Flash chip drivers
4010 +#
4011 +CONFIG_MTD_CFI=m
4012 +CONFIG_MTD_JEDECPROBE=m
4013 +CONFIG_MTD_GEN_PROBE=m
4014 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
4015 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
4016 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
4017 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
4018 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
4019 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
4020 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
4021 +CONFIG_MTD_CFI_I1=y
4022 +CONFIG_MTD_CFI_I2=y
4023 +# CONFIG_MTD_CFI_I4 is not set
4024 +# CONFIG_MTD_CFI_I8 is not set
4025 +CONFIG_MTD_CFI_INTELEXT=m
4026 +CONFIG_MTD_CFI_AMDSTD=m
4027 +CONFIG_MTD_CFI_STAA=m
4028 +CONFIG_MTD_CFI_UTIL=m
4029 +CONFIG_MTD_RAM=m
4030 +CONFIG_MTD_ROM=m
4031 +CONFIG_MTD_ABSENT=m
4032 +
4033 +#
4034 +# Mapping drivers for chip access
4035 +#
4036 +CONFIG_MTD_COMPLEX_MAPPINGS=y
4037 +# CONFIG_MTD_PHYSMAP is not set
4038 +# CONFIG_MTD_PNC2000 is not set
4039 +CONFIG_MTD_SC520CDP=m
4040 +CONFIG_MTD_NETSC520=m
4041 +CONFIG_MTD_TS5500=m
4042 +# CONFIG_MTD_SBC_GXX is not set
4043 +# CONFIG_MTD_AMD76XROM is not set
4044 +# CONFIG_MTD_ICHXROM is not set
4045 +# CONFIG_MTD_ESB2ROM is not set
4046 +# CONFIG_MTD_CK804XROM is not set
4047 +CONFIG_MTD_SCB2_FLASH=m
4048 +# CONFIG_MTD_NETtel is not set
4049 +# CONFIG_MTD_DILNETPC is not set
4050 +# CONFIG_MTD_L440GX is not set
4051 +CONFIG_MTD_PCI=m
4052 +# CONFIG_MTD_PLATRAM is not set
4053 +
4054 +#
4055 +# Self-contained MTD device drivers
4056 +#
4057 +CONFIG_MTD_PMC551=m
4058 +# CONFIG_MTD_PMC551_BUGFIX is not set
4059 +# CONFIG_MTD_PMC551_DEBUG is not set
4060 +# CONFIG_MTD_SLRAM is not set
4061 +# CONFIG_MTD_PHRAM is not set
4062 +CONFIG_MTD_MTDRAM=m
4063 +CONFIG_MTDRAM_TOTAL_SIZE=4096
4064 +CONFIG_MTDRAM_ERASE_SIZE=128
4065 +CONFIG_MTD_BLOCK2MTD=m
4066 +
4067 +#
4068 +# Disk-On-Chip Device Drivers
4069 +#
4070 +# CONFIG_MTD_DOC2000 is not set
4071 +# CONFIG_MTD_DOC2001 is not set
4072 +# CONFIG_MTD_DOC2001PLUS is not set
4073 +CONFIG_MTD_NAND=y
4074 +# CONFIG_MTD_NAND_VERIFY_WRITE is not set
4075 +# CONFIG_MTD_NAND_ECC_SMC is not set
4076 +# CONFIG_MTD_NAND_MUSEUM_IDS is not set
4077 +CONFIG_MTD_NAND_IDS=y
4078 +CONFIG_MTD_NAND_DISKONCHIP=m
4079 +# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
4080 +CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
4081 +# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
4082 +CONFIG_MTD_NAND_CAFE=y
4083 +CONFIG_MTD_NAND_CS553X=y
4084 +CONFIG_MTD_NAND_NANDSIM=m
4085 +# CONFIG_MTD_NAND_PLATFORM is not set
4086 +# CONFIG_MTD_ONENAND is not set
4087 +
4088 +#
4089 +# UBI - Unsorted block images
4090 +#
4091 +# CONFIG_MTD_UBI is not set
4092 +
4093 +#
4094 +# Parallel port support
4095 +#
4096 +# CONFIG_PARPORT is not set
4097 +
4098 +#
4099 +# Plug and Play support
4100 +#
4101 +# CONFIG_PNPACPI is not set
4102 +
4103 +#
4104 +# Block devices
4105 +#
4106 +# CONFIG_BLK_DEV_FD is not set
4107 +# CONFIG_BLK_CPQ_DA is not set
4108 +# CONFIG_BLK_CPQ_CISS_DA is not set
4109 +# CONFIG_BLK_DEV_DAC960 is not set
4110 +# CONFIG_BLK_DEV_UMEM is not set
4111 +# CONFIG_BLK_DEV_COW_COMMON is not set
4112 +CONFIG_BLK_DEV_LOOP=m
4113 +CONFIG_BLK_DEV_CRYPTOLOOP=m
4114 +CONFIG_BLK_DEV_NBD=m
4115 +# CONFIG_BLK_DEV_SX8 is not set
4116 +CONFIG_BLK_DEV_UB=m
4117 +CONFIG_BLK_DEV_RAM=y
4118 +CONFIG_BLK_DEV_RAM_COUNT=16
4119 +CONFIG_BLK_DEV_RAM_SIZE=16384
4120 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
4121 +# CONFIG_CDROM_PKTCDVD is not set
4122 +# CONFIG_ATA_OVER_ETH is not set
4123 +
4124 +#
4125 +# Misc devices
4126 +#
4127 +# CONFIG_IBM_ASM is not set
4128 +# CONFIG_PHANTOM is not set
4129 +# CONFIG_SGI_IOC4 is not set
4130 +# CONFIG_TIFM_CORE is not set
4131 +# CONFIG_BLINK is not set
4132 +# CONFIG_EEPROM_93CX6 is not set
4133 +CONFIG_IDE=m
4134 +CONFIG_IDE_MAX_HWIFS=4
4135 +CONFIG_BLK_DEV_IDE=m
4136 +
4137 +#
4138 +# Please see Documentation/ide.txt for help/info on IDE drives
4139 +#
4140 +# CONFIG_BLK_DEV_IDE_SATA is not set
4141 +# CONFIG_BLK_DEV_HD_IDE is not set
4142 +CONFIG_BLK_DEV_IDEDISK=m
4143 +CONFIG_IDEDISK_MULTI_MODE=y
4144 +# CONFIG_BLK_DEV_IDECD is not set
4145 +# CONFIG_BLK_DEV_IDETAPE is not set
4146 +# CONFIG_BLK_DEV_IDEFLOPPY is not set
4147 +# CONFIG_BLK_DEV_IDESCSI is not set
4148 +CONFIG_IDE_TASK_IOCTL=y
4149 +# CONFIG_IDE_PROC_FS is not set
4150 +
4151 +#
4152 +# IDE chipset support/bugfixes
4153 +#
4154 +CONFIG_IDE_GENERIC=m
4155 +# CONFIG_BLK_DEV_CMD640 is not set
4156 +CONFIG_BLK_DEV_IDEPCI=y
4157 +CONFIG_IDEPCI_SHARE_IRQ=y
4158 +# CONFIG_IDEPCI_PCIBUS_ORDER is not set
4159 +# CONFIG_BLK_DEV_OFFBOARD is not set
4160 +# CONFIG_BLK_DEV_GENERIC is not set
4161 +# CONFIG_BLK_DEV_OPTI621 is not set
4162 +# CONFIG_BLK_DEV_RZ1000 is not set
4163 +CONFIG_BLK_DEV_IDEDMA_PCI=y
4164 +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
4165 +CONFIG_IDEDMA_ONLYDISK=y
4166 +# CONFIG_BLK_DEV_AEC62XX is not set
4167 +# CONFIG_BLK_DEV_ALI15X3 is not set
4168 +# CONFIG_BLK_DEV_AMD74XX is not set
4169 +# CONFIG_BLK_DEV_ATIIXP is not set
4170 +# CONFIG_BLK_DEV_CMD64X is not set
4171 +# CONFIG_BLK_DEV_TRIFLEX is not set
4172 +# CONFIG_BLK_DEV_CY82C693 is not set
4173 +# CONFIG_BLK_DEV_CS5520 is not set
4174 +# CONFIG_BLK_DEV_CS5530 is not set
4175 +# CONFIG_BLK_DEV_CS5535 is not set
4176 +# CONFIG_BLK_DEV_HPT34X is not set
4177 +# CONFIG_BLK_DEV_HPT366 is not set
4178 +# CONFIG_BLK_DEV_JMICRON is not set
4179 +# CONFIG_BLK_DEV_SC1200 is not set
4180 +CONFIG_BLK_DEV_PIIX=m
4181 +# CONFIG_BLK_DEV_IT8213 is not set
4182 +# CONFIG_BLK_DEV_IT821X is not set
4183 +# CONFIG_BLK_DEV_NS87415 is not set
4184 +# CONFIG_BLK_DEV_PDC202XX_OLD is not set
4185 +# CONFIG_BLK_DEV_PDC202XX_NEW is not set
4186 +# CONFIG_BLK_DEV_SVWKS is not set
4187 +# CONFIG_BLK_DEV_SIIMAGE is not set
4188 +# CONFIG_BLK_DEV_SIS5513 is not set
4189 +# CONFIG_BLK_DEV_SLC90E66 is not set
4190 +# CONFIG_BLK_DEV_TRM290 is not set
4191 +# CONFIG_BLK_DEV_VIA82CXXX is not set
4192 +# CONFIG_BLK_DEV_TC86C001 is not set
4193 +# CONFIG_IDE_ARM is not set
4194 +CONFIG_BLK_DEV_IDEDMA=y
4195 +# CONFIG_IDEDMA_IVB is not set
4196 +# CONFIG_BLK_DEV_HD is not set
4197 +
4198 +#
4199 +# SCSI device support
4200 +#
4201 +# CONFIG_RAID_ATTRS is not set
4202 +CONFIG_SCSI=y
4203 +# CONFIG_SCSI_TGT is not set
4204 +# CONFIG_SCSI_NETLINK is not set
4205 +CONFIG_SCSI_PROC_FS=y
4206 +
4207 +#
4208 +# SCSI support type (disk, tape, CD-ROM)
4209 +#
4210 +CONFIG_BLK_DEV_SD=y
4211 +# CONFIG_CHR_DEV_ST is not set
4212 +# CONFIG_CHR_DEV_OSST is not set
4213 +CONFIG_BLK_DEV_SR=m
4214 +CONFIG_BLK_DEV_SR_VENDOR=y
4215 +CONFIG_CHR_DEV_SG=m
4216 +CONFIG_CHR_DEV_SCH=m
4217 +
4218 +#
4219 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
4220 +#
4221 +CONFIG_SCSI_MULTI_LUN=y
4222 +CONFIG_SCSI_CONSTANTS=y
4223 +CONFIG_SCSI_LOGGING=y
4224 +# CONFIG_SCSI_SCAN_ASYNC is not set
4225 +CONFIG_SCSI_WAIT_SCAN=m
4226 +
4227 +#
4228 +# SCSI Transports
4229 +#
4230 +# CONFIG_SCSI_SPI_ATTRS is not set
4231 +# CONFIG_SCSI_FC_ATTRS is not set
4232 +# CONFIG_SCSI_ISCSI_ATTRS is not set
4233 +# CONFIG_SCSI_SAS_ATTRS is not set
4234 +# CONFIG_SCSI_SAS_LIBSAS is not set
4235 +
4236 +#
4237 +# SCSI low-level drivers
4238 +#
4239 +# CONFIG_ISCSI_TCP is not set
4240 +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
4241 +# CONFIG_SCSI_3W_9XXX is not set
4242 +# CONFIG_SCSI_ACARD is not set
4243 +# CONFIG_SCSI_AACRAID is not set
4244 +# CONFIG_SCSI_AIC7XXX is not set
4245 +# CONFIG_SCSI_AIC7XXX_OLD is not set
4246 +# CONFIG_SCSI_AIC79XX is not set
4247 +# CONFIG_SCSI_AIC94XX is not set
4248 +# CONFIG_SCSI_DPT_I2O is not set
4249 +# CONFIG_SCSI_ADVANSYS is not set
4250 +# CONFIG_SCSI_ARCMSR is not set
4251 +# CONFIG_MEGARAID_NEWGEN is not set
4252 +# CONFIG_MEGARAID_LEGACY is not set
4253 +# CONFIG_MEGARAID_SAS is not set
4254 +# CONFIG_SCSI_HPTIOP is not set
4255 +# CONFIG_SCSI_BUSLOGIC is not set
4256 +# CONFIG_SCSI_DMX3191D is not set
4257 +# CONFIG_SCSI_EATA is not set
4258 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
4259 +# CONFIG_SCSI_GDTH is not set
4260 +# CONFIG_SCSI_IPS is not set
4261 +# CONFIG_SCSI_INITIO is not set
4262 +# CONFIG_SCSI_INIA100 is not set
4263 +# CONFIG_SCSI_STEX is not set
4264 +# CONFIG_SCSI_SYM53C8XX_2 is not set
4265 +# CONFIG_SCSI_QLOGIC_1280 is not set
4266 +# CONFIG_SCSI_QLA_FC is not set
4267 +# CONFIG_SCSI_QLA_ISCSI is not set
4268 +# CONFIG_SCSI_LPFC is not set
4269 +# CONFIG_SCSI_DC395x is not set
4270 +# CONFIG_SCSI_DC390T is not set
4271 +# CONFIG_SCSI_NSP32 is not set
4272 +# CONFIG_SCSI_DEBUG is not set
4273 +# CONFIG_SCSI_SRP is not set
4274 +# CONFIG_ATA is not set
4275 +
4276 +#
4277 +# Multi-device support (RAID and LVM)
4278 +#
4279 +# CONFIG_MD is not set
4280 +
4281 +#
4282 +# Fusion MPT device support
4283 +#
4284 +# CONFIG_FUSION is not set
4285 +# CONFIG_FUSION_SPI is not set
4286 +# CONFIG_FUSION_FC is not set
4287 +# CONFIG_FUSION_SAS is not set
4288 +
4289 +#
4290 +# IEEE 1394 (FireWire) support
4291 +#
4292 +# CONFIG_FIREWIRE is not set
4293 +# CONFIG_IEEE1394 is not set
4294 +
4295 +#
4296 +# I2O device support
4297 +#
4298 +# CONFIG_I2O is not set
4299 +
4300 +#
4301 +# Battery support
4302 +#
4303 +# CONFIG_BATTERY_CLASS is not set
4304 +# CONFIG_MACINTOSH_DRIVERS is not set
4305 +
4306 +#
4307 +# Network device support
4308 +#
4309 +CONFIG_NETDEVICES=y
4310 +CONFIG_IFB=m
4311 +CONFIG_DUMMY=m
4312 +# CONFIG_BONDING is not set
4313 +# CONFIG_EQUALIZER is not set
4314 +CONFIG_TUN=m
4315 +# CONFIG_ARCNET is not set
4316 +# CONFIG_PHYLIB is not set
4317 +
4318 +#
4319 +# Ethernet (10 or 100Mbit)
4320 +#
4321 +CONFIG_NET_ETHERNET=y
4322 +CONFIG_MII=m
4323 +# CONFIG_HAPPYMEAL is not set
4324 +# CONFIG_SUNGEM is not set
4325 +# CONFIG_CASSINI is not set
4326 +# CONFIG_NET_VENDOR_3COM is not set
4327 +
4328 +#
4329 +# Tulip family network device support
4330 +#
4331 +# CONFIG_NET_TULIP is not set
4332 +# CONFIG_HP100 is not set
4333 +CONFIG_NET_PCI=y
4334 +# CONFIG_PCNET32 is not set
4335 +# CONFIG_AMD8111_ETH is not set
4336 +# CONFIG_ADAPTEC_STARFIRE is not set
4337 +# CONFIG_B44 is not set
4338 +# CONFIG_FORCEDETH is not set
4339 +# CONFIG_DGRS is not set
4340 +# CONFIG_EEPRO100 is not set
4341 +# CONFIG_E100 is not set
4342 +# CONFIG_FEALNX is not set
4343 +# CONFIG_NATSEMI is not set
4344 +CONFIG_NE2K_PCI=m
4345 +# CONFIG_8139CP is not set
4346 +# CONFIG_8139TOO is not set
4347 +# CONFIG_SIS900 is not set
4348 +# CONFIG_EPIC100 is not set
4349 +# CONFIG_SUNDANCE is not set
4350 +# CONFIG_TLAN is not set
4351 +# CONFIG_VIA_RHINE is not set
4352 +# CONFIG_SC92031 is not set
4353 +CONFIG_NETDEV_1000=y
4354 +# CONFIG_ACENIC is not set
4355 +# CONFIG_DL2K is not set
4356 +# CONFIG_E1000 is not set
4357 +# CONFIG_NS83820 is not set
4358 +# CONFIG_HAMACHI is not set
4359 +# CONFIG_YELLOWFIN is not set
4360 +# CONFIG_R8169 is not set
4361 +# CONFIG_SIS190 is not set
4362 +# CONFIG_SKGE is not set
4363 +# CONFIG_SKY2 is not set
4364 +# CONFIG_SK98LIN is not set
4365 +# CONFIG_VIA_VELOCITY is not set
4366 +# CONFIG_TIGON3 is not set
4367 +# CONFIG_BNX2 is not set
4368 +# CONFIG_QLA3XXX is not set
4369 +# CONFIG_ATL1 is not set
4370 +CONFIG_NETDEV_10000=y
4371 +# CONFIG_CHELSIO_T1 is not set
4372 +# CONFIG_CHELSIO_T3 is not set
4373 +# CONFIG_IXGB is not set
4374 +# CONFIG_S2IO is not set
4375 +# CONFIG_MYRI10GE is not set
4376 +# CONFIG_NETXEN_NIC is not set
4377 +# CONFIG_MLX4_CORE is not set
4378 +# CONFIG_TR is not set
4379 +
4380 +#
4381 +# Wireless LAN
4382 +#
4383 +# CONFIG_WLAN_PRE80211 is not set
4384 +CONFIG_WLAN_80211=y
4385 +# CONFIG_IPW2100 is not set
4386 +# CONFIG_IPW2200 is not set
4387 +CONFIG_LIBERTAS=m
4388 +CONFIG_LIBERTAS_USB=m
4389 +CONFIG_LIBERTAS_DEBUG=y
4390 +# CONFIG_AIRO is not set
4391 +# CONFIG_HERMES is not set
4392 +# CONFIG_ATMEL is not set
4393 +# CONFIG_PRISM54 is not set
4394 +# CONFIG_USB_ZD1201 is not set
4395 +# CONFIG_PRISM54_USB is not set
4396 +# CONFIG_HOSTAP is not set
4397 +# CONFIG_BCM43XX is not set
4398 +# CONFIG_ZD1211RW is not set
4399 +# CONFIG_ADM8211 is not set
4400 +# CONFIG_ACX_PCI is not set
4401 +# CONFIG_ACX_USB is not set
4402 +
4403 +#
4404 +# USB Network Adapters
4405 +#
4406 +CONFIG_USB_CATC=m
4407 +CONFIG_USB_KAWETH=m
4408 +CONFIG_USB_PEGASUS=m
4409 +CONFIG_USB_RTL8150=m
4410 +CONFIG_USB_USBNET_MII=m
4411 +CONFIG_USB_USBNET=m
4412 +CONFIG_USB_NET_AX8817X=m
4413 +CONFIG_USB_NET_CDCETHER=m
4414 +CONFIG_USB_NET_DM9601=m
4415 +CONFIG_USB_NET_GL620A=m
4416 +CONFIG_USB_NET_NET1080=m
4417 +CONFIG_USB_NET_PLUSB=m
4418 +CONFIG_USB_NET_MCS7830=m
4419 +CONFIG_USB_NET_RNDIS_HOST=m
4420 +CONFIG_USB_NET_CDC_SUBSET=m
4421 +CONFIG_USB_ALI_M5632=y
4422 +CONFIG_USB_AN2720=y
4423 +CONFIG_USB_BELKIN=y
4424 +CONFIG_USB_ARMLINUX=y
4425 +CONFIG_USB_EPSON2888=y
4426 +# CONFIG_USB_KC2190 is not set
4427 +CONFIG_USB_NET_ZAURUS=m
4428 +# CONFIG_WAN is not set
4429 +# CONFIG_FDDI is not set
4430 +# CONFIG_HIPPI is not set
4431 +CONFIG_PPP=m
4432 +CONFIG_PPP_MULTILINK=y
4433 +CONFIG_PPP_FILTER=y
4434 +CONFIG_PPP_ASYNC=m
4435 +CONFIG_PPP_SYNC_TTY=m
4436 +CONFIG_PPP_DEFLATE=m
4437 +# CONFIG_PPP_BSDCOMP is not set
4438 +CONFIG_PPP_MPPE=m
4439 +CONFIG_PPPOE=m
4440 +CONFIG_SLIP=m
4441 +CONFIG_SLIP_COMPRESSED=y
4442 +CONFIG_SLHC=m
4443 +CONFIG_SLIP_SMART=y
4444 +# CONFIG_SLIP_MODE_SLIP6 is not set
4445 +# CONFIG_NET_FC is not set
4446 +# CONFIG_SHAPER is not set
4447 +CONFIG_NETCONSOLE=m
4448 +CONFIG_NETPOLL=y
4449 +CONFIG_NETPOLL_TRAP=y
4450 +CONFIG_NET_POLL_CONTROLLER=y
4451 +
4452 +#
4453 +# ISDN subsystem
4454 +#
4455 +# CONFIG_ISDN is not set
4456 +
4457 +#
4458 +# Telephony Support
4459 +#
4460 +# CONFIG_PHONE is not set
4461 +
4462 +#
4463 +# Input device support
4464 +#
4465 +CONFIG_INPUT=y
4466 +# CONFIG_INPUT_FF_MEMLESS is not set
4467 +# CONFIG_INPUT_POLLDEV is not set
4468 +
4469 +#
4470 +# Userland interfaces
4471 +#
4472 +CONFIG_INPUT_MOUSEDEV=m
4473 +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
4474 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
4475 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
4476 +CONFIG_INPUT_JOYDEV=m
4477 +# CONFIG_INPUT_TSDEV is not set
4478 +CONFIG_INPUT_EVDEV=y
4479 +# CONFIG_INPUT_EVBUG is not set
4480 +
4481 +#
4482 +# Input Device Drivers
4483 +#
4484 +CONFIG_INPUT_KEYBOARD=y
4485 +CONFIG_KEYBOARD_ATKBD=y
4486 +# CONFIG_KEYBOARD_SUNKBD is not set
4487 +# CONFIG_KEYBOARD_LKKBD is not set
4488 +# CONFIG_KEYBOARD_XTKBD is not set
4489 +# CONFIG_KEYBOARD_NEWTON is not set
4490 +# CONFIG_KEYBOARD_STOWAWAY is not set
4491 +CONFIG_INPUT_MOUSE=y
4492 +CONFIG_MOUSE_PS2=m
4493 +# CONFIG_MOUSE_PS2_ALPS is not set
4494 +# CONFIG_MOUSE_PS2_LOGIPS2PP is not set
4495 +# CONFIG_MOUSE_PS2_SYNAPTICS is not set
4496 +# CONFIG_MOUSE_PS2_LIFEBOOK is not set
4497 +# CONFIG_MOUSE_PS2_TRACKPOINT is not set
4498 +# CONFIG_MOUSE_PS2_TOUCHKIT is not set
4499 +CONFIG_MOUSE_PS2_OLPC=y
4500 +# CONFIG_MOUSE_SERIAL is not set
4501 +# CONFIG_MOUSE_APPLETOUCH is not set
4502 +# CONFIG_MOUSE_VSXXXAA is not set
4503 +# CONFIG_INPUT_JOYSTICK is not set
4504 +# CONFIG_INPUT_TABLET is not set
4505 +# CONFIG_INPUT_TOUCHSCREEN is not set
4506 +CONFIG_INPUT_MISC=y
4507 +CONFIG_INPUT_PCSPKR=m
4508 +# CONFIG_INPUT_WISTRON_BTNS is not set
4509 +# CONFIG_INPUT_ATI_REMOTE is not set
4510 +# CONFIG_INPUT_ATI_REMOTE2 is not set
4511 +# CONFIG_INPUT_KEYSPAN_REMOTE is not set
4512 +# CONFIG_INPUT_POWERMATE is not set
4513 +# CONFIG_INPUT_YEALINK is not set
4514 +CONFIG_INPUT_UINPUT=m
4515 +
4516 +#
4517 +# Hardware I/O ports
4518 +#
4519 +CONFIG_SERIO=y
4520 +CONFIG_SERIO_I8042=y
4521 +CONFIG_SERIO_SERPORT=y
4522 +# CONFIG_SERIO_CT82C710 is not set
4523 +# CONFIG_SERIO_PCIPS2 is not set
4524 +CONFIG_SERIO_LIBPS2=y
4525 +CONFIG_SERIO_RAW=m
4526 +# CONFIG_GAMEPORT is not set
4527 +
4528 +#
4529 +# Character devices
4530 +#
4531 +CONFIG_VT=y
4532 +CONFIG_VT_CONSOLE=y
4533 +CONFIG_HW_CONSOLE=y
4534 +# CONFIG_VT_HW_CONSOLE_BINDING is not set
4535 +# CONFIG_SERIAL_NONSTANDARD is not set
4536 +
4537 +#
4538 +# Serial drivers
4539 +#
4540 +CONFIG_SERIAL_8250=y
4541 +CONFIG_SERIAL_8250_CONSOLE=y
4542 +CONFIG_SERIAL_8250_PCI=y
4543 +CONFIG_SERIAL_8250_NR_UARTS=1
4544 +CONFIG_SERIAL_8250_RUNTIME_UARTS=1
4545 +CONFIG_SERIAL_8250_EXTENDED=y
4546 +CONFIG_SERIAL_8250_MANY_PORTS=y
4547 +CONFIG_SERIAL_8250_SHARE_IRQ=y
4548 +CONFIG_SERIAL_8250_DETECT_IRQ=y
4549 +CONFIG_SERIAL_8250_RSA=y
4550 +
4551 +#
4552 +# Non-8250 serial port support
4553 +#
4554 +CONFIG_SERIAL_CORE=y
4555 +CONFIG_SERIAL_CORE_CONSOLE=y
4556 +# CONFIG_SERIAL_JSM is not set
4557 +CONFIG_UNIX98_PTYS=y
4558 +# CONFIG_LEGACY_PTYS is not set
4559 +
4560 +#
4561 +# IPMI
4562 +#
4563 +# CONFIG_IPMI_HANDLER is not set
4564 +CONFIG_WATCHDOG=y
4565 +# CONFIG_WATCHDOG_NOWAYOUT is not set
4566 +
4567 +#
4568 +# Watchdog Device Drivers
4569 +#
4570 +CONFIG_SOFT_WATCHDOG=m
4571 +# CONFIG_ACQUIRE_WDT is not set
4572 +# CONFIG_ADVANTECH_WDT is not set
4573 +# CONFIG_ALIM1535_WDT is not set
4574 +# CONFIG_ALIM7101_WDT is not set
4575 +# CONFIG_SC520_WDT is not set
4576 +# CONFIG_EUROTECH_WDT is not set
4577 +# CONFIG_IB700_WDT is not set
4578 +# CONFIG_IBMASR is not set
4579 +# CONFIG_WAFER_WDT is not set
4580 +# CONFIG_I6300ESB_WDT is not set
4581 +# CONFIG_ITCO_WDT is not set
4582 +# CONFIG_SC1200_WDT is not set
4583 +# CONFIG_PC87413_WDT is not set
4584 +# CONFIG_60XX_WDT is not set
4585 +# CONFIG_SBC8360_WDT is not set
4586 +# CONFIG_CPU5_WDT is not set
4587 +# CONFIG_SMSC37B787_WDT is not set
4588 +# CONFIG_W83627HF_WDT is not set
4589 +# CONFIG_W83697HF_WDT is not set
4590 +# CONFIG_W83877F_WDT is not set
4591 +# CONFIG_W83977F_WDT is not set
4592 +# CONFIG_MACHZ_WDT is not set
4593 +# CONFIG_SBC_EPX_C3_WATCHDOG is not set
4594 +
4595 +#
4596 +# PCI-based Watchdog Cards
4597 +#
4598 +# CONFIG_PCIPCWATCHDOG is not set
4599 +# CONFIG_WDTPCI is not set
4600 +
4601 +#
4602 +# USB-based Watchdog Cards
4603 +#
4604 +# CONFIG_USBPCWATCHDOG is not set
4605 +CONFIG_HW_RANDOM=y
4606 +# CONFIG_HW_RANDOM_INTEL is not set
4607 +# CONFIG_HW_RANDOM_AMD is not set
4608 +CONFIG_HW_RANDOM_GEODE=y
4609 +# CONFIG_HW_RANDOM_VIA is not set
4610 +CONFIG_NVRAM=y
4611 +# CONFIG_RTC is not set
4612 +# CONFIG_GEN_RTC is not set
4613 +# CONFIG_R3964 is not set
4614 +# CONFIG_APPLICOM is not set
4615 +# CONFIG_SONYPI is not set
4616 +# CONFIG_AGP is not set
4617 +# CONFIG_DRM is not set
4618 +# CONFIG_MWAVE is not set
4619 +# CONFIG_PC8736x_GPIO is not set
4620 +# CONFIG_NSC_GPIO is not set
4621 +CONFIG_CS5535_GPIO=m
4622 +# CONFIG_RAW_DRIVER is not set
4623 +CONFIG_HANGCHECK_TIMER=m
4624 +
4625 +#
4626 +# TPM devices
4627 +#
4628 +# CONFIG_TCG_TPM is not set
4629 +# CONFIG_TELCLOCK is not set
4630 +CONFIG_DEVPORT=y
4631 +CONFIG_I2C=y
4632 +CONFIG_I2C_BOARDINFO=y
4633 +CONFIG_I2C_CHARDEV=m
4634 +
4635 +#
4636 +# I2C Algorithms
4637 +#
4638 +# CONFIG_I2C_ALGOBIT is not set
4639 +# CONFIG_I2C_ALGOPCF is not set
4640 +# CONFIG_I2C_ALGOPCA is not set
4641 +
4642 +#
4643 +# I2C Hardware Bus support
4644 +#
4645 +# CONFIG_I2C_ALI1535 is not set
4646 +# CONFIG_I2C_ALI1563 is not set
4647 +# CONFIG_I2C_ALI15X3 is not set
4648 +# CONFIG_I2C_AMD756 is not set
4649 +# CONFIG_I2C_AMD8111 is not set
4650 +# CONFIG_I2C_I801 is not set
4651 +# CONFIG_I2C_I810 is not set
4652 +# CONFIG_I2C_PIIX4 is not set
4653 +# CONFIG_I2C_NFORCE2 is not set
4654 +# CONFIG_I2C_OCORES is not set
4655 +# CONFIG_I2C_PARPORT_LIGHT is not set
4656 +# CONFIG_I2C_PROSAVAGE is not set
4657 +# CONFIG_I2C_SAVAGE4 is not set
4658 +# CONFIG_I2C_SIMTEC is not set
4659 +CONFIG_SCx200_ACB=y
4660 +# CONFIG_I2C_SIS5595 is not set
4661 +# CONFIG_I2C_SIS630 is not set
4662 +# CONFIG_I2C_SIS96X is not set
4663 +# CONFIG_I2C_STUB is not set
4664 +# CONFIG_I2C_TINY_USB is not set
4665 +# CONFIG_I2C_VIA is not set
4666 +# CONFIG_I2C_VIAPRO is not set
4667 +# CONFIG_I2C_VOODOO3 is not set
4668 +
4669 +#
4670 +# Miscellaneous I2C Chip support
4671 +#
4672 +# CONFIG_SENSORS_DS1337 is not set
4673 +# CONFIG_SENSORS_DS1374 is not set
4674 +# CONFIG_SENSORS_EEPROM is not set
4675 +# CONFIG_SENSORS_PCF8574 is not set
4676 +# CONFIG_SENSORS_PCA9539 is not set
4677 +# CONFIG_SENSORS_PCF8591 is not set
4678 +# CONFIG_SENSORS_MAX6875 is not set
4679 +# CONFIG_I2C_DEBUG_CORE is not set
4680 +# CONFIG_I2C_DEBUG_ALGO is not set
4681 +# CONFIG_I2C_DEBUG_BUS is not set
4682 +# CONFIG_I2C_DEBUG_CHIP is not set
4683 +
4684 +#
4685 +# SPI support
4686 +#
4687 +# CONFIG_SPI is not set
4688 +# CONFIG_SPI_MASTER is not set
4689 +
4690 +#
4691 +# Dallas's 1-wire bus
4692 +#
4693 +# CONFIG_W1 is not set
4694 +CONFIG_POWER_SUPPLY=m
4695 +# CONFIG_POWER_SUPPLY_DEBUG is not set
4696 +# CONFIG_PDA_POWER is not set
4697 +# CONFIG_BATTERY_DS2760 is not set
4698 +CONFIG_BATTERY_OLPC=m
4699 +# CONFIG_HWMON is not set
4700 +
4701 +#
4702 +# Multifunction device drivers
4703 +#
4704 +# CONFIG_MFD_SM501 is not set
4705 +
4706 +#
4707 +# Multimedia devices
4708 +#
4709 +CONFIG_VIDEO_DEV=m
4710 +# CONFIG_VIDEO_V4L1 is not set
4711 +CONFIG_VIDEO_V4L1_COMPAT=y
4712 +CONFIG_VIDEO_V4L2=y
4713 +CONFIG_VIDEO_CAPTURE_DRIVERS=y
4714 +# CONFIG_VIDEO_ADV_DEBUG is not set
4715 +# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
4716 +
4717 +#
4718 +# Encoders/decoders and other helper chips
4719 +#
4720 +
4721 +#
4722 +# Audio decoders
4723 +#
4724 +# CONFIG_VIDEO_TDA9840 is not set
4725 +# CONFIG_VIDEO_TEA6415C is not set
4726 +# CONFIG_VIDEO_TEA6420 is not set
4727 +# CONFIG_VIDEO_MSP3400 is not set
4728 +# CONFIG_VIDEO_CS53L32A is not set
4729 +# CONFIG_VIDEO_TLV320AIC23B is not set
4730 +# CONFIG_VIDEO_WM8775 is not set
4731 +# CONFIG_VIDEO_WM8739 is not set
4732 +
4733 +#
4734 +# Video decoders
4735 +#
4736 +CONFIG_VIDEO_OV7670=m
4737 +# CONFIG_VIDEO_SAA711X is not set
4738 +# CONFIG_VIDEO_TVP5150 is not set
4739 +
4740 +#
4741 +# Video and audio decoders
4742 +#
4743 +# CONFIG_VIDEO_CX25840 is not set
4744 +
4745 +#
4746 +# MPEG video encoders
4747 +#
4748 +# CONFIG_VIDEO_CX2341X is not set
4749 +
4750 +#
4751 +# Video encoders
4752 +#
4753 +# CONFIG_VIDEO_SAA7127 is not set
4754 +
4755 +#
4756 +# Video improvement chips
4757 +#
4758 +# CONFIG_VIDEO_UPD64031A is not set
4759 +# CONFIG_VIDEO_UPD64083 is not set
4760 +# CONFIG_VIDEO_VIVI is not set
4761 +# CONFIG_VIDEO_SAA5246A is not set
4762 +# CONFIG_VIDEO_SAA5249 is not set
4763 +# CONFIG_VIDEO_SAA7134 is not set
4764 +# CONFIG_VIDEO_HEXIUM_ORION is not set
4765 +# CONFIG_VIDEO_HEXIUM_GEMINI is not set
4766 +# CONFIG_VIDEO_CX88 is not set
4767 +CONFIG_VIDEO_CAFE_CCIC=m
4768 +CONFIG_V4L_USB_DRIVERS=y
4769 +# CONFIG_VIDEO_PVRUSB2 is not set
4770 +# CONFIG_VIDEO_USBVISION is not set
4771 +# CONFIG_USB_SN9C102 is not set
4772 +# CONFIG_USB_ZR364XX is not set
4773 +CONFIG_RADIO_ADAPTERS=y
4774 +# CONFIG_RADIO_GEMTEK_PCI is not set
4775 +# CONFIG_RADIO_MAXIRADIO is not set
4776 +# CONFIG_RADIO_MAESTRO is not set
4777 +# CONFIG_USB_DSBR is not set
4778 +# CONFIG_DVB_CORE is not set
4779 +CONFIG_DAB=y
4780 +# CONFIG_USB_DABUSB is not set
4781 +
4782 +#
4783 +# Graphics support
4784 +#
4785 +CONFIG_BACKLIGHT_LCD_SUPPORT=y
4786 +CONFIG_BACKLIGHT_CLASS_DEVICE=y
4787 +CONFIG_LCD_CLASS_DEVICE=y
4788 +# CONFIG_BACKLIGHT_PROGEAR is not set
4789 +
4790 +#
4791 +# Display device support
4792 +#
4793 +# CONFIG_DISPLAY_SUPPORT is not set
4794 +CONFIG_VGASTATE=m
4795 +CONFIG_FB=y
4796 +# CONFIG_FIRMWARE_EDID is not set
4797 +# CONFIG_FB_DDC is not set
4798 +CONFIG_FB_CFB_FILLRECT=y
4799 +CONFIG_FB_CFB_COPYAREA=y
4800 +CONFIG_FB_CFB_IMAGEBLIT=y
4801 +# CONFIG_FB_SYS_FILLRECT is not set
4802 +# CONFIG_FB_SYS_COPYAREA is not set
4803 +# CONFIG_FB_SYS_IMAGEBLIT is not set
4804 +# CONFIG_FB_SYS_FOPS is not set
4805 +CONFIG_FB_DEFERRED_IO=y
4806 +# CONFIG_FB_SVGALIB is not set
4807 +# CONFIG_FB_MACMODES is not set
4808 +# CONFIG_FB_BACKLIGHT is not set
4809 +CONFIG_FB_MODE_HELPERS=y
4810 +CONFIG_FB_TILEBLITTING=y
4811 +
4812 +#
4813 +# Frame buffer hardware drivers
4814 +#
4815 +# CONFIG_FB_CIRRUS is not set
4816 +# CONFIG_FB_PM2 is not set
4817 +# CONFIG_FB_CYBER2000 is not set
4818 +# CONFIG_FB_ARC is not set
4819 +# CONFIG_FB_ASILIANT is not set
4820 +# CONFIG_FB_IMSTT is not set
4821 +CONFIG_FB_VGA16=m
4822 +CONFIG_FB_VESA=y
4823 +# CONFIG_FB_HECUBA is not set
4824 +# CONFIG_FB_HGA is not set
4825 +# CONFIG_FB_S1D13XXX is not set
4826 +# CONFIG_FB_NVIDIA is not set
4827 +# CONFIG_FB_RIVA is not set
4828 +# CONFIG_FB_I810 is not set
4829 +# CONFIG_FB_LE80578 is not set
4830 +# CONFIG_FB_INTEL is not set
4831 +# CONFIG_FB_MATROX is not set
4832 +# CONFIG_FB_RADEON is not set
4833 +# CONFIG_FB_ATY128 is not set
4834 +# CONFIG_FB_ATY is not set
4835 +# CONFIG_FB_S3 is not set
4836 +# CONFIG_FB_SAVAGE is not set
4837 +# CONFIG_FB_SIS is not set
4838 +# CONFIG_FB_NEOMAGIC is not set
4839 +# CONFIG_FB_KYRO is not set
4840 +# CONFIG_FB_3DFX is not set
4841 +# CONFIG_FB_VOODOO1 is not set
4842 +# CONFIG_FB_VT8623 is not set
4843 +# CONFIG_FB_CYBLA is not set
4844 +# CONFIG_FB_TRIDENT is not set
4845 +# CONFIG_FB_ARK is not set
4846 +# CONFIG_FB_PM3 is not set
4847 +CONFIG_FB_GEODE=y
4848 +CONFIG_FB_GEODE_LX=y
4849 +CONFIG_FB_GEODE_GX=y
4850 +# CONFIG_FB_GEODE_GX1 is not set
4851 +CONFIG_FB_OLPC_DCON=y
4852 +# CONFIG_FB_VIRTUAL is not set
4853 +
4854 +#
4855 +# Console display driver support
4856 +#
4857 +CONFIG_VGA_CONSOLE=y
4858 +CONFIG_VGACON_SOFT_SCROLLBACK=y
4859 +CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64
4860 +CONFIG_VIDEO_SELECT=y
4861 +CONFIG_DUMMY_CONSOLE=y
4862 +CONFIG_FRAMEBUFFER_CONSOLE=y
4863 +CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
4864 +CONFIG_FONTS=y
4865 +# CONFIG_FONT_8x8 is not set
4866 +CONFIG_FONT_8x16=y
4867 +# CONFIG_FONT_6x11 is not set
4868 +# CONFIG_FONT_7x14 is not set
4869 +# CONFIG_FONT_PEARL_8x8 is not set
4870 +# CONFIG_FONT_ACORN_8x8 is not set
4871 +# CONFIG_FONT_MINI_4x6 is not set
4872 +# CONFIG_FONT_SUN8x16 is not set
4873 +CONFIG_FONT_SUN12x22=y
4874 +# CONFIG_FONT_10x18 is not set
4875 +CONFIG_LOGO=y
4876 +# CONFIG_LOGO_LINUX_MONO is not set
4877 +# CONFIG_LOGO_LINUX_VGA16 is not set
4878 +CONFIG_LOGO_LINUX_CLUT224=y
4879 +
4880 +#
4881 +# Sound
4882 +#
4883 +CONFIG_SOUND=m
4884 +
4885 +#
4886 +# Advanced Linux Sound Architecture
4887 +#
4888 +CONFIG_SND=m
4889 +CONFIG_SND_TIMER=m
4890 +CONFIG_SND_PCM=m
4891 +CONFIG_SND_HWDEP=m
4892 +CONFIG_SND_RAWMIDI=m
4893 +CONFIG_SND_SEQUENCER=m
4894 +CONFIG_SND_SEQ_DUMMY=m
4895 +CONFIG_SND_OSSEMUL=y
4896 +CONFIG_SND_MIXER_OSS=m
4897 +CONFIG_SND_PCM_OSS=m
4898 +CONFIG_SND_PCM_OSS_PLUGINS=y
4899 +CONFIG_SND_SEQUENCER_OSS=y
4900 +CONFIG_SND_DYNAMIC_MINORS=y
4901 +# CONFIG_SND_SUPPORT_OLD_API is not set
4902 +CONFIG_SND_VERBOSE_PROCFS=y
4903 +# CONFIG_SND_VERBOSE_PRINTK is not set
4904 +# CONFIG_SND_DEBUG is not set
4905 +
4906 +#
4907 +# Generic devices
4908 +#
4909 +CONFIG_SND_MPU401_UART=m
4910 +CONFIG_SND_AC97_CODEC=m
4911 +CONFIG_SND_DUMMY=m
4912 +CONFIG_SND_VIRMIDI=m
4913 +CONFIG_SND_MTPAV=m
4914 +# CONFIG_SND_SERIAL_U16550 is not set
4915 +CONFIG_SND_MPU401=m
4916 +
4917 +#
4918 +# PCI devices
4919 +#
4920 +# CONFIG_SND_AD1889 is not set
4921 +# CONFIG_SND_ALS300 is not set
4922 +# CONFIG_SND_ALS4000 is not set
4923 +# CONFIG_SND_ALI5451 is not set
4924 +# CONFIG_SND_ATIIXP is not set
4925 +# CONFIG_SND_ATIIXP_MODEM is not set
4926 +# CONFIG_SND_AU8810 is not set
4927 +# CONFIG_SND_AU8820 is not set
4928 +# CONFIG_SND_AU8830 is not set
4929 +# CONFIG_SND_AZT3328 is not set
4930 +# CONFIG_SND_BT87X is not set
4931 +# CONFIG_SND_CA0106 is not set
4932 +# CONFIG_SND_CMIPCI is not set
4933 +# CONFIG_SND_CS4281 is not set
4934 +# CONFIG_SND_CS46XX is not set
4935 +CONFIG_SND_CS5535AUDIO=m
4936 +# CONFIG_SND_DARLA20 is not set
4937 +# CONFIG_SND_GINA20 is not set
4938 +# CONFIG_SND_LAYLA20 is not set
4939 +# CONFIG_SND_DARLA24 is not set
4940 +# CONFIG_SND_GINA24 is not set
4941 +# CONFIG_SND_LAYLA24 is not set
4942 +# CONFIG_SND_MONA is not set
4943 +# CONFIG_SND_MIA is not set
4944 +# CONFIG_SND_ECHO3G is not set
4945 +# CONFIG_SND_INDIGO is not set
4946 +# CONFIG_SND_INDIGOIO is not set
4947 +# CONFIG_SND_INDIGODJ is not set
4948 +# CONFIG_SND_EMU10K1 is not set
4949 +# CONFIG_SND_EMU10K1X is not set
4950 +CONFIG_SND_ENS1370=m
4951 +# CONFIG_SND_ENS1371 is not set
4952 +# CONFIG_SND_ES1938 is not set
4953 +# CONFIG_SND_ES1968 is not set
4954 +# CONFIG_SND_FM801 is not set
4955 +# CONFIG_SND_HDA_INTEL is not set
4956 +# CONFIG_SND_HDSP is not set
4957 +# CONFIG_SND_HDSPM is not set
4958 +# CONFIG_SND_ICE1712 is not set
4959 +# CONFIG_SND_ICE1724 is not set
4960 +# CONFIG_SND_INTEL8X0 is not set
4961 +# CONFIG_SND_INTEL8X0M is not set
4962 +# CONFIG_SND_KORG1212 is not set
4963 +# CONFIG_SND_MAESTRO3 is not set
4964 +# CONFIG_SND_MIXART is not set
4965 +# CONFIG_SND_NM256 is not set
4966 +# CONFIG_SND_PCXHR is not set
4967 +# CONFIG_SND_RIPTIDE is not set
4968 +# CONFIG_SND_RME32 is not set
4969 +# CONFIG_SND_RME96 is not set
4970 +# CONFIG_SND_RME9652 is not set
4971 +# CONFIG_SND_SONICVIBES is not set
4972 +# CONFIG_SND_TRIDENT is not set
4973 +# CONFIG_SND_VIA82XX is not set
4974 +# CONFIG_SND_VIA82XX_MODEM is not set
4975 +# CONFIG_SND_VX222 is not set
4976 +# CONFIG_SND_YMFPCI is not set
4977 +CONFIG_SND_AC97_POWER_SAVE=y
4978 +
4979 +#
4980 +# USB devices
4981 +#
4982 +CONFIG_SND_USB_AUDIO=m
4983 +CONFIG_SND_USB_USX2Y=m
4984 +# CONFIG_SND_USB_CAIAQ is not set
4985 +
4986 +#
4987 +# System on Chip audio support
4988 +#
4989 +# CONFIG_SND_SOC is not set
4990 +
4991 +#
4992 +# Open Sound System
4993 +#
4994 +# CONFIG_SOUND_PRIME is not set
4995 +CONFIG_AC97_BUS=m
4996 +
4997 +#
4998 +# HID Devices
4999 +#
5000 +CONFIG_HID=y
5001 +# CONFIG_HID_DEBUG is not set
5002 +
5003 +#
5004 +# USB Input Devices
5005 +#
5006 +CONFIG_USB_HID=y
5007 +# CONFIG_USB_HIDINPUT_POWERBOOK is not set
5008 +# CONFIG_HID_FF is not set
5009 +CONFIG_USB_HIDDEV=y
5010 +
5011 +#
5012 +# USB support
5013 +#
5014 +CONFIG_USB_ARCH_HAS_HCD=y
5015 +CONFIG_USB_ARCH_HAS_OHCI=y
5016 +CONFIG_USB_ARCH_HAS_EHCI=y
5017 +CONFIG_USB=y
5018 +# CONFIG_USB_DEBUG is not set
5019 +
5020 +#
5021 +# Miscellaneous USB options
5022 +#
5023 +CONFIG_USB_DEVICEFS=y
5024 +# CONFIG_USB_DEVICE_CLASS is not set
5025 +# CONFIG_USB_DYNAMIC_MINORS is not set
5026 +# CONFIG_USB_SUSPEND is not set
5027 +CONFIG_USB_PERSIST=y
5028 +# CONFIG_USB_OTG is not set
5029 +
5030 +#
5031 +# USB Host Controller Drivers
5032 +#
5033 +CONFIG_USB_EHCI_HCD=y
5034 +CONFIG_USB_EHCI_SPLIT_ISO=y
5035 +CONFIG_USB_EHCI_ROOT_HUB_TT=y
5036 +# CONFIG_USB_EHCI_TT_NEWSCHED is not set
5037 +# CONFIG_USB_EHCI_BIG_ENDIAN_MMIO is not set
5038 +# CONFIG_USB_ISP116X_HCD is not set
5039 +CONFIG_USB_OHCI_HCD=y
5040 +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
5041 +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
5042 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
5043 +# CONFIG_USB_UHCI_HCD is not set
5044 +# CONFIG_USB_SL811_HCD is not set
5045 +
5046 +#
5047 +# USB Device Class drivers
5048 +#
5049 +CONFIG_USB_ACM=m
5050 +CONFIG_USB_PRINTER=m
5051 +
5052 +#
5053 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
5054 +#
5055 +
5056 +#
5057 +# may also be needed; see USB_STORAGE Help for more information
5058 +#
5059 +CONFIG_USB_STORAGE=y
5060 +# CONFIG_USB_STORAGE_DEBUG is not set
5061 +CONFIG_USB_STORAGE_DATAFAB=y
5062 +CONFIG_USB_STORAGE_FREECOM=y
5063 +CONFIG_USB_STORAGE_DPCM=y
5064 +CONFIG_USB_STORAGE_USBAT=y
5065 +CONFIG_USB_STORAGE_SDDR09=y
5066 +CONFIG_USB_STORAGE_SDDR55=y
5067 +CONFIG_USB_STORAGE_JUMPSHOT=y
5068 +CONFIG_USB_STORAGE_ALAUDA=y
5069 +# CONFIG_USB_STORAGE_KARMA is not set
5070 +CONFIG_USB_LIBUSUAL=y
5071 +
5072 +#
5073 +# USB Imaging devices
5074 +#
5075 +# CONFIG_USB_MDC800 is not set
5076 +# CONFIG_USB_MICROTEK is not set
5077 +CONFIG_USB_MON=y
5078 +
5079 +#
5080 +# USB port drivers
5081 +#
5082 +
5083 +#
5084 +# USB Serial Converter support
5085 +#
5086 +CONFIG_USB_SERIAL=m
5087 +CONFIG_USB_SERIAL_GENERIC=y
5088 +# CONFIG_USB_SERIAL_AIRCABLE is not set
5089 +# CONFIG_USB_SERIAL_AIRPRIME is not set
5090 +# CONFIG_USB_SERIAL_ARK3116 is not set
5091 +# CONFIG_USB_SERIAL_BELKIN is not set
5092 +# CONFIG_USB_SERIAL_WHITEHEAT is not set
5093 +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
5094 +CONFIG_USB_SERIAL_CP2101=m
5095 +# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
5096 +# CONFIG_USB_SERIAL_EMPEG is not set
5097 +# CONFIG_USB_SERIAL_FTDI_SIO is not set
5098 +# CONFIG_USB_SERIAL_FUNSOFT is not set
5099 +# CONFIG_USB_SERIAL_VISOR is not set
5100 +# CONFIG_USB_SERIAL_IPAQ is not set
5101 +# CONFIG_USB_SERIAL_IR is not set
5102 +# CONFIG_USB_SERIAL_EDGEPORT is not set
5103 +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
5104 +# CONFIG_USB_SERIAL_GARMIN is not set
5105 +# CONFIG_USB_SERIAL_IPW is not set
5106 +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
5107 +# CONFIG_USB_SERIAL_KEYSPAN is not set
5108 +# CONFIG_USB_SERIAL_KLSI is not set
5109 +# CONFIG_USB_SERIAL_KOBIL_SCT is not set
5110 +# CONFIG_USB_SERIAL_MCT_U232 is not set
5111 +# CONFIG_USB_SERIAL_MOS7720 is not set
5112 +# CONFIG_USB_SERIAL_MOS7840 is not set
5113 +# CONFIG_USB_SERIAL_NAVMAN is not set
5114 +CONFIG_USB_SERIAL_PL2303=m
5115 +# CONFIG_USB_SERIAL_HP4X is not set
5116 +# CONFIG_USB_SERIAL_SAFE is not set
5117 +# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
5118 +# CONFIG_USB_SERIAL_TI is not set
5119 +# CONFIG_USB_SERIAL_CYBERJACK is not set
5120 +# CONFIG_USB_SERIAL_XIRCOM is not set
5121 +# CONFIG_USB_SERIAL_OPTION is not set
5122 +# CONFIG_USB_SERIAL_OMNINET is not set
5123 +# CONFIG_USB_SERIAL_DEBUG is not set
5124 +
5125 +#
5126 +# USB Miscellaneous drivers
5127 +#
5128 +# CONFIG_USB_EMI62 is not set
5129 +# CONFIG_USB_EMI26 is not set
5130 +# CONFIG_USB_ADUTUX is not set
5131 +# CONFIG_USB_AUERSWALD is not set
5132 +# CONFIG_USB_RIO500 is not set
5133 +# CONFIG_USB_LEGOTOWER is not set
5134 +# CONFIG_USB_LCD is not set
5135 +# CONFIG_USB_BERRY_CHARGE is not set
5136 +# CONFIG_USB_LED is not set
5137 +# CONFIG_USB_CYPRESS_CY7C63 is not set
5138 +# CONFIG_USB_CYTHERM is not set
5139 +# CONFIG_USB_PHIDGET is not set
5140 +# CONFIG_USB_IDMOUSE is not set
5141 +# CONFIG_USB_FTDI_ELAN is not set
5142 +# CONFIG_USB_APPLEDISPLAY is not set
5143 +# CONFIG_USB_SISUSBVGA is not set
5144 +# CONFIG_USB_LD is not set
5145 +# CONFIG_USB_TRANCEVIBRATOR is not set
5146 +# CONFIG_USB_IOWARRIOR is not set
5147 +# CONFIG_USB_TEST is not set
5148 +
5149 +#
5150 +# USB DSL modem support
5151 +#
5152 +
5153 +#
5154 +# USB Gadget Support
5155 +#
5156 +# CONFIG_USB_GADGET is not set
5157 +CONFIG_MMC=y
5158 +# CONFIG_MMC_DEBUG is not set
5159 +# CONFIG_MMC_UNSAFE_RESUME is not set
5160 +
5161 +#
5162 +# MMC/SD Card Drivers
5163 +#
5164 +CONFIG_MMC_BLOCK=y
5165 +
5166 +#
5167 +# MMC/SD Host Controller Drivers
5168 +#
5169 +CONFIG_MMC_SDHCI=y
5170 +# CONFIG_MMC_WBSD is not set
5171 +# CONFIG_MMC_TIFM_SD is not set
5172 +
5173 +#
5174 +# LED devices
5175 +#
5176 +CONFIG_NEW_LEDS=y
5177 +CONFIG_LEDS_CLASS=y
5178 +
5179 +#
5180 +# LED drivers
5181 +#
5182 +CONFIG_LEDS_OLPC=y
5183 +
5184 +#
5185 +# LED Triggers
5186 +#
5187 +CONFIG_LEDS_TRIGGERS=y
5188 +CONFIG_LEDS_TRIGGER_TIMER=y
5189 +# CONFIG_LEDS_TRIGGER_IDE_DISK is not set
5190 +CONFIG_LEDS_TRIGGER_HEARTBEAT=y
5191 +
5192 +#
5193 +# InfiniBand support
5194 +#
5195 +# CONFIG_INFINIBAND is not set
5196 +
5197 +#
5198 +# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
5199 +#
5200 +# CONFIG_EDAC is not set
5201 +
5202 +#
5203 +# Real Time Clock
5204 +#
5205 +CONFIG_RTC_LIB=y
5206 +CONFIG_RTC_CLASS=y
5207 +# CONFIG_RTC_HCTOSYS is not set
5208 +# CONFIG_RTC_DEBUG is not set
5209 +
5210 +#
5211 +# RTC interfaces
5212 +#
5213 +CONFIG_RTC_INTF_SYSFS=y
5214 +CONFIG_RTC_INTF_PROC=y
5215 +CONFIG_RTC_INTF_DEV=y
5216 +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
5217 +# CONFIG_RTC_DRV_TEST is not set
5218 +
5219 +#
5220 +# I2C RTC drivers
5221 +#
5222 +# CONFIG_RTC_DRV_DS1307 is not set
5223 +# CONFIG_RTC_DRV_DS1672 is not set
5224 +# CONFIG_RTC_DRV_MAX6900 is not set
5225 +# CONFIG_RTC_DRV_RS5C372 is not set
5226 +# CONFIG_RTC_DRV_ISL1208 is not set
5227 +# CONFIG_RTC_DRV_X1205 is not set
5228 +# CONFIG_RTC_DRV_PCF8563 is not set
5229 +# CONFIG_RTC_DRV_PCF8583 is not set
5230 +
5231 +#
5232 +# SPI RTC drivers
5233 +#
5234 +
5235 +#
5236 +# Platform RTC drivers
5237 +#
5238 +CONFIG_RTC_DRV_CMOS=y
5239 +# CONFIG_RTC_DRV_DS1553 is not set
5240 +# CONFIG_RTC_DRV_DS1742 is not set
5241 +# CONFIG_RTC_DRV_M48T86 is not set
5242 +# CONFIG_RTC_DRV_V3020 is not set
5243 +
5244 +#
5245 +# on-CPU RTC drivers
5246 +#
5247 +
5248 +#
5249 +# DMA Engine support
5250 +#
5251 +# CONFIG_DMA_ENGINE is not set
5252 +
5253 +#
5254 +# DMA Clients
5255 +#
5256 +
5257 +#
5258 +# DMA Devices
5259 +#
5260 +
5261 +#
5262 +# Virtualization
5263 +#
5264 +# CONFIG_KVM is not set
5265 +
5266 +#
5267 +# Sysprof
5268 +#
5269 +CONFIG_SYSPROF=m
5270 +
5271 +#
5272 +# File systems
5273 +#
5274 +CONFIG_EXT2_FS=y
5275 +CONFIG_EXT2_FS_XATTR=y
5276 +CONFIG_EXT2_FS_POSIX_ACL=y
5277 +CONFIG_EXT2_FS_SECURITY=y
5278 +CONFIG_EXT2_FS_XIP=y
5279 +CONFIG_FS_XIP=y
5280 +CONFIG_EXT3_FS=y
5281 +CONFIG_EXT3_FS_XATTR=y
5282 +CONFIG_EXT3_FS_POSIX_ACL=y
5283 +CONFIG_EXT3_FS_SECURITY=y
5284 +# CONFIG_EXT4DEV_FS is not set
5285 +CONFIG_JBD=y
5286 +# CONFIG_JBD_DEBUG is not set
5287 +CONFIG_FS_MBCACHE=y
5288 +# CONFIG_REISERFS_FS is not set
5289 +# CONFIG_JFS_FS is not set
5290 +CONFIG_FS_POSIX_ACL=y
5291 +# CONFIG_XFS_FS is not set
5292 +# CONFIG_GFS2_FS is not set
5293 +# CONFIG_OCFS2_FS is not set
5294 +# CONFIG_MINIX_FS is not set
5295 +# CONFIG_ROMFS_FS is not set
5296 +CONFIG_INOTIFY=y
5297 +CONFIG_INOTIFY_USER=y
5298 +CONFIG_QUOTA=y
5299 +# CONFIG_QFMT_V1 is not set
5300 +CONFIG_QFMT_V2=y
5301 +CONFIG_QUOTACTL=y
5302 +CONFIG_DNOTIFY=y
5303 +CONFIG_AUTOFS_FS=m
5304 +CONFIG_AUTOFS4_FS=m
5305 +# CONFIG_FUSE_FS is not set
5306 +
5307 +#
5308 +# CD-ROM/DVD Filesystems
5309 +#
5310 +CONFIG_ISO9660_FS=y
5311 +CONFIG_JOLIET=y
5312 +CONFIG_ZISOFS=y
5313 +CONFIG_UDF_FS=m
5314 +CONFIG_UDF_NLS=y
5315 +
5316 +#
5317 +# DOS/FAT/NT Filesystems
5318 +#
5319 +CONFIG_FAT_FS=m
5320 +CONFIG_MSDOS_FS=m
5321 +CONFIG_VFAT_FS=m
5322 +CONFIG_FAT_DEFAULT_CODEPAGE=437
5323 +CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
5324 +# CONFIG_NTFS_FS is not set
5325 +
5326 +#
5327 +# Pseudo filesystems
5328 +#
5329 +CONFIG_PROC_FS=y
5330 +CONFIG_PROC_KCORE=y
5331 +CONFIG_PROC_SYSCTL=y
5332 +CONFIG_SYSFS=y
5333 +CONFIG_TMPFS=y
5334 +# CONFIG_TMPFS_POSIX_ACL is not set
5335 +CONFIG_HUGETLBFS=y
5336 +CONFIG_HUGETLB_PAGE=y
5337 +CONFIG_PROMFS_FS=y
5338 +CONFIG_RAMFS=y
5339 +# CONFIG_CONFIGFS_FS is not set
5340 +
5341 +#
5342 +# Miscellaneous filesystems
5343 +#
5344 +# CONFIG_ADFS_FS is not set
5345 +# CONFIG_AFFS_FS is not set
5346 +# CONFIG_ECRYPT_FS is not set
5347 +# CONFIG_HFS_FS is not set
5348 +# CONFIG_HFSPLUS_FS is not set
5349 +# CONFIG_BEFS_FS is not set
5350 +# CONFIG_BFS_FS is not set
5351 +# CONFIG_EFS_FS is not set
5352 +CONFIG_JFFS2_FS=y
5353 +CONFIG_JFFS2_FS_DEBUG=0
5354 +CONFIG_JFFS2_FS_WRITEBUFFER=y
5355 +CONFIG_JFFS2_SUMMARY=y
5356 +CONFIG_JFFS2_FS_XATTR=y
5357 +CONFIG_JFFS2_FS_POSIX_ACL=y
5358 +CONFIG_JFFS2_FS_SECURITY=y
5359 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
5360 +CONFIG_JFFS2_ZLIB=y
5361 +CONFIG_JFFS2_RTIME=y
5362 +# CONFIG_JFFS2_RUBIN is not set
5363 +CONFIG_CRAMFS=m
5364 +# CONFIG_VXFS_FS is not set
5365 +# CONFIG_HPFS_FS is not set
5366 +# CONFIG_QNX4FS_FS is not set
5367 +# CONFIG_SYSV_FS is not set
5368 +# CONFIG_UFS_FS is not set
5369 +
5370 +#
5371 +# Network File Systems
5372 +#
5373 +CONFIG_NFS_FS=m
5374 +CONFIG_NFS_V3=y
5375 +CONFIG_NFS_V3_ACL=y
5376 +CONFIG_NFS_V4=y
5377 +CONFIG_NFS_DIRECTIO=y
5378 +# CONFIG_NFSD is not set
5379 +CONFIG_LOCKD=m
5380 +CONFIG_LOCKD_V4=y
5381 +CONFIG_NFS_ACL_SUPPORT=m
5382 +CONFIG_NFS_COMMON=y
5383 +CONFIG_SUNRPC=m
5384 +CONFIG_SUNRPC_GSS=m
5385 +# CONFIG_SUNRPC_BIND34 is not set
5386 +CONFIG_RPCSEC_GSS_KRB5=m
5387 +CONFIG_RPCSEC_GSS_SPKM3=m
5388 +# CONFIG_SMB_FS is not set
5389 +# CONFIG_CIFS is not set
5390 +# CONFIG_NCP_FS is not set
5391 +# CONFIG_CODA_FS is not set
5392 +# CONFIG_AFS_FS is not set
5393 +# CONFIG_9P_FS is not set
5394 +
5395 +#
5396 +# Partition Types
5397 +#
5398 +CONFIG_PARTITION_ADVANCED=y
5399 +# CONFIG_ACORN_PARTITION is not set
5400 +# CONFIG_OSF_PARTITION is not set
5401 +# CONFIG_AMIGA_PARTITION is not set
5402 +# CONFIG_ATARI_PARTITION is not set
5403 +# CONFIG_MAC_PARTITION is not set
5404 +CONFIG_MSDOS_PARTITION=y
5405 +# CONFIG_BSD_DISKLABEL is not set
5406 +# CONFIG_MINIX_SUBPARTITION is not set
5407 +# CONFIG_SOLARIS_X86_PARTITION is not set
5408 +# CONFIG_UNIXWARE_DISKLABEL is not set
5409 +# CONFIG_LDM_PARTITION is not set
5410 +# CONFIG_SGI_PARTITION is not set
5411 +# CONFIG_ULTRIX_PARTITION is not set
5412 +# CONFIG_SUN_PARTITION is not set
5413 +# CONFIG_KARMA_PARTITION is not set
5414 +# CONFIG_EFI_PARTITION is not set
5415 +# CONFIG_SYSV68_PARTITION is not set
5416 +
5417 +#
5418 +# Native Language Support
5419 +#
5420 +CONFIG_NLS=y
5421 +CONFIG_NLS_DEFAULT="utf8"
5422 +CONFIG_NLS_CODEPAGE_437=y
5423 +CONFIG_NLS_CODEPAGE_737=m
5424 +CONFIG_NLS_CODEPAGE_775=m
5425 +CONFIG_NLS_CODEPAGE_850=m
5426 +CONFIG_NLS_CODEPAGE_852=m
5427 +CONFIG_NLS_CODEPAGE_855=m
5428 +CONFIG_NLS_CODEPAGE_857=m
5429 +CONFIG_NLS_CODEPAGE_860=m
5430 +CONFIG_NLS_CODEPAGE_861=m
5431 +CONFIG_NLS_CODEPAGE_862=m
5432 +CONFIG_NLS_CODEPAGE_863=m
5433 +CONFIG_NLS_CODEPAGE_864=m
5434 +CONFIG_NLS_CODEPAGE_865=m
5435 +CONFIG_NLS_CODEPAGE_866=m
5436 +CONFIG_NLS_CODEPAGE_869=m
5437 +CONFIG_NLS_CODEPAGE_936=m
5438 +CONFIG_NLS_CODEPAGE_950=m
5439 +CONFIG_NLS_CODEPAGE_932=m
5440 +CONFIG_NLS_CODEPAGE_949=m
5441 +CONFIG_NLS_CODEPAGE_874=m
5442 +CONFIG_NLS_ISO8859_8=m
5443 +CONFIG_NLS_CODEPAGE_1250=m
5444 +CONFIG_NLS_CODEPAGE_1251=m
5445 +CONFIG_NLS_ASCII=y
5446 +CONFIG_NLS_ISO8859_1=m
5447 +CONFIG_NLS_ISO8859_2=m
5448 +CONFIG_NLS_ISO8859_3=m
5449 +CONFIG_NLS_ISO8859_4=m
5450 +CONFIG_NLS_ISO8859_5=m
5451 +CONFIG_NLS_ISO8859_6=m
5452 +CONFIG_NLS_ISO8859_7=m
5453 +CONFIG_NLS_ISO8859_9=m
5454 +CONFIG_NLS_ISO8859_13=m
5455 +CONFIG_NLS_ISO8859_14=m
5456 +CONFIG_NLS_ISO8859_15=m
5457 +CONFIG_NLS_KOI8_R=m
5458 +CONFIG_NLS_KOI8_U=m
5459 +CONFIG_NLS_UTF8=m
5460 +
5461 +#
5462 +# Distributed Lock Manager
5463 +#
5464 +# CONFIG_DLM is not set
5465 +
5466 +#
5467 +# Instrumentation Support
5468 +#
5469 +CONFIG_PROFILING=y
5470 +CONFIG_OPROFILE=m
5471 +CONFIG_KPROBES=y
5472 +
5473 +#
5474 +# Kernel hacking
5475 +#
5476 +CONFIG_TRACE_IRQFLAGS_SUPPORT=y
5477 +CONFIG_PRINTK_TIME=y
5478 +# CONFIG_ENABLE_MUST_CHECK is not set
5479 +CONFIG_MAGIC_SYSRQ=y
5480 +CONFIG_UNUSED_SYMBOLS=y
5481 +CONFIG_DEBUG_FS=y
5482 +# CONFIG_HEADERS_CHECK is not set
5483 +CONFIG_DEBUG_KERNEL=y
5484 +# CONFIG_DEBUG_SHIRQ is not set
5485 +CONFIG_DETECT_SOFTLOCKUP=y
5486 +CONFIG_SCHEDSTATS=y
5487 +CONFIG_TIMER_STATS=y
5488 +# CONFIG_DEBUG_SLAB is not set
5489 +CONFIG_DEBUG_PREEMPT=y
5490 +# CONFIG_DEBUG_RT_MUTEXES is not set
5491 +# CONFIG_RT_MUTEX_TESTER is not set
5492 +CONFIG_DEBUG_SPINLOCK=y
5493 +# CONFIG_DEBUG_MUTEXES is not set
5494 +# CONFIG_DEBUG_LOCK_ALLOC is not set
5495 +# CONFIG_PROVE_LOCKING is not set
5496 +CONFIG_DEBUG_SPINLOCK_SLEEP=y
5497 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
5498 +# CONFIG_DEBUG_KOBJECT is not set
5499 +# CONFIG_DEBUG_BUGVERBOSE is not set
5500 +CONFIG_DEBUG_INFO=y
5501 +CONFIG_DEBUG_VM=y
5502 +CONFIG_DEBUG_LIST=y
5503 +# CONFIG_FRAME_POINTER is not set
5504 +# CONFIG_FORCED_INLINING is not set
5505 +# CONFIG_RCU_TORTURE_TEST is not set
5506 +# CONFIG_LKDTM is not set
5507 +# CONFIG_FAULT_INJECTION is not set
5508 +CONFIG_EARLY_PRINTK=y
5509 +CONFIG_DEBUG_STACKOVERFLOW=y
5510 +CONFIG_DEBUG_STACK_USAGE=y
5511 +
5512 +#
5513 +# Page alloc debug is incompatible with Software Suspend on i386
5514 +#
5515 +CONFIG_DEBUG_RODATA=y
5516 +CONFIG_4KSTACKS=y
5517 +CONFIG_DOUBLEFAULT=y
5518 +
5519 +#
5520 +# Security options
5521 +#
5522 +CONFIG_KEYS=y
5523 +CONFIG_KEYS_DEBUG_PROC_KEYS=y
5524 +CONFIG_SECURITY=y
5525 +CONFIG_SECURITY_NETWORK=y
5526 +CONFIG_SECURITY_NETWORK_XFRM=y
5527 +CONFIG_SECURITY_CAPABILITIES=y
5528 +# CONFIG_SECURITY_ROOTPLUG is not set
5529 +CONFIG_SECURITY_SELINUX=y
5530 +CONFIG_SECURITY_SELINUX_BOOTPARAM=y
5531 +CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
5532 +# CONFIG_SECURITY_SELINUX_DISABLE is not set
5533 +CONFIG_SECURITY_SELINUX_DEVELOP=y
5534 +CONFIG_SECURITY_SELINUX_AVC_STATS=y
5535 +CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
5536 +# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set
5537 +# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
5538 +
5539 +#
5540 +# Cryptographic options
5541 +#
5542 +CONFIG_CRYPTO=y
5543 +CONFIG_CRYPTO_ALGAPI=y
5544 +CONFIG_CRYPTO_BLKCIPHER=y
5545 +CONFIG_CRYPTO_HASH=y
5546 +CONFIG_CRYPTO_MANAGER=y
5547 +CONFIG_CRYPTO_HMAC=y
5548 +CONFIG_CRYPTO_XCBC=m
5549 +CONFIG_CRYPTO_NULL=m
5550 +CONFIG_CRYPTO_MD4=m
5551 +CONFIG_CRYPTO_MD5=y
5552 +CONFIG_CRYPTO_SHA1=y
5553 +CONFIG_CRYPTO_SHA256=m
5554 +CONFIG_CRYPTO_SHA512=m
5555 +CONFIG_CRYPTO_WP512=m
5556 +CONFIG_CRYPTO_TGR192=m
5557 +CONFIG_CRYPTO_GF128MUL=m
5558 +CONFIG_CRYPTO_ECB=m
5559 +CONFIG_CRYPTO_CBC=m
5560 +CONFIG_CRYPTO_PCBC=m
5561 +CONFIG_CRYPTO_LRW=m
5562 +# CONFIG_CRYPTO_CRYPTD is not set
5563 +CONFIG_CRYPTO_DES=m
5564 +CONFIG_CRYPTO_FCRYPT=m
5565 +CONFIG_CRYPTO_BLOWFISH=m
5566 +CONFIG_CRYPTO_TWOFISH=m
5567 +CONFIG_CRYPTO_TWOFISH_COMMON=m
5568 +# CONFIG_CRYPTO_TWOFISH_586 is not set
5569 +CONFIG_CRYPTO_SERPENT=m
5570 +CONFIG_CRYPTO_AES=m
5571 +CONFIG_CRYPTO_AES_586=m
5572 +CONFIG_CRYPTO_CAST5=m
5573 +CONFIG_CRYPTO_CAST6=m
5574 +CONFIG_CRYPTO_TEA=m
5575 +CONFIG_CRYPTO_ARC4=m
5576 +CONFIG_CRYPTO_KHAZAD=m
5577 +CONFIG_CRYPTO_ANUBIS=m
5578 +CONFIG_CRYPTO_DEFLATE=m
5579 +CONFIG_CRYPTO_MICHAEL_MIC=m
5580 +CONFIG_CRYPTO_CRC32C=m
5581 +CONFIG_CRYPTO_CAMELLIA=m
5582 +# CONFIG_CRYPTO_TEST is not set
5583 +
5584 +#
5585 +# Hardware crypto devices
5586 +#
5587 +# CONFIG_CRYPTO_DEV_PADLOCK is not set
5588 +CONFIG_CRYPTO_DEV_GEODE=y
5589 +
5590 +#
5591 +# Library routines
5592 +#
5593 +CONFIG_BITREVERSE=y
5594 +CONFIG_CRC_CCITT=m
5595 +CONFIG_CRC16=m
5596 +# CONFIG_CRC_ITU_T is not set
5597 +CONFIG_CRC32=y
5598 +CONFIG_LIBCRC32C=m
5599 +CONFIG_AUDIT_GENERIC=y
5600 +CONFIG_ZLIB_INFLATE=y
5601 +CONFIG_ZLIB_DEFLATE=y
5602 +CONFIG_REED_SOLOMON=y
5603 +CONFIG_REED_SOLOMON_DEC16=y
5604 +CONFIG_TEXTSEARCH=y
5605 +CONFIG_TEXTSEARCH_KMP=m
5606 +CONFIG_TEXTSEARCH_BM=m
5607 +CONFIG_TEXTSEARCH_FSM=m
5608 +CONFIG_PLIST=y
5609 +CONFIG_HAS_IOMEM=y
5610 +CONFIG_HAS_IOPORT=y
5611 +CONFIG_HAS_DMA=y
5612 +CONFIG_GENERIC_HARDIRQS=y
5613 +CONFIG_GENERIC_IRQ_PROBE=y
5614 +CONFIG_X86_BIOS_REBOOT=y
5615 +CONFIG_KTIME_SCALAR=y
5616 diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
5617 index 9d33b00..2e2cf42 100644
5618 --- a/arch/i386/kernel/Makefile
5619 +++ b/arch/i386/kernel/Makefile
5620 @@ -39,13 +39,17 @@ obj-$(CONFIG_VM86) += vm86.o
5621 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
5622 obj-$(CONFIG_HPET_TIMER) += hpet.o
5623 obj-$(CONFIG_K8_NB) += k8.o
5624 -obj-$(CONFIG_MGEODE_LX) += geode.o
5625 +obj-$(CONFIG_MGEODE_LX) += geode.o mfgpt.o
5626
5627 obj-$(CONFIG_VMI) += vmi.o vmiclock.o
5628 obj-$(CONFIG_PARAVIRT) += paravirt.o
5629 obj-y += pcspeaker.o
5630
5631 obj-$(CONFIG_SCx200) += scx200.o
5632 +obj-$(CONFIG_OLPC) += olpc.o
5633 +obj-$(CONFIG_OLPC_PM) += olpc-pm.o olpc-wakeup.o
5634 +obj-$(CONFIG_OPEN_FIRMWARE) += ofw.o
5635 +obj-$(CONFIG_PROMFS_FS) += prom.o
5636
5637 # vsyscall.o contains the vsyscall DSO images as __initdata.
5638 # We must build both images before we can assemble it.
5639 diff --git a/arch/i386/kernel/geode.c b/arch/i386/kernel/geode.c
5640 index 41e8aec..637e301 100644
5641 --- a/arch/i386/kernel/geode.c
5642 +++ b/arch/i386/kernel/geode.c
5643 @@ -145,10 +145,14 @@ EXPORT_SYMBOL_GPL(geode_gpio_setup_event);
5644
5645 static int __init geode_southbridge_init(void)
5646 {
5647 + int timers;
5648 +
5649 if (!is_geode())
5650 return -ENODEV;
5651
5652 init_lbars();
5653 + timers = geode_mfgpt_detect();
5654 + printk(KERN_INFO "geode-mfgpt: %d timers available.\n", timers);
5655 return 0;
5656 }
5657
5658 diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
5659 index 8f03821..3176280 100644
5660 --- a/arch/i386/kernel/head.S
5661 +++ b/arch/i386/kernel/head.S
5662 @@ -117,8 +117,34 @@ ENTRY(startup_32)
5663 movl $(COMMAND_LINE_SIZE/4),%ecx
5664 rep
5665 movsl
5666 +
5667 +#ifdef CONFIG_OPEN_FIRMWARE
5668 +/*
5669 + * If Open Firmware booted us, save the OFW client interface callback address
5670 + * and preserve the OFW page mappings by priming the kernel's new page
5671 + * directory area with a copy of the OFW page directory. That lets OFW stay
5672 + * resident in high memory (high in both the virtual and physical spaces)
5673 + * for at least long enough to copy out the device tree.
5674 + */
5675 1:
5676 + movl $(boot_params - __PAGE_OFFSET + OFW_INFO_OFFSET), %ebp
5677 + cmpl $0x2057464F, (%ebp) /* Magic number "OFW " */
5678 + jne 1f
5679 +
5680 + mov 0x8(%ebp), %eax /* Save callback address */
5681 + mov %eax, call_firmware - __PAGE_OFFSET
5682
5683 + /* Copy the OFW pdir into swapper_pg_dir */
5684 + movl %esi, %edx /* save %esi */
5685 + movl $(swapper_pg_dir - __PAGE_OFFSET), %edi
5686 + movl %cr3, %esi /* Source is current pg_dir base address */
5687 + movl $1024, %ecx /* Number of page directory entries */
5688 + rep
5689 + movsl
5690 + movl %edx, %esi /* restore %esi */
5691 +#endif
5692 +
5693 +1:
5694 /*
5695 * Initialize page tables. This creates a PDE and a set of page
5696 * tables, which are located immediately beyond _end. The variable
5697 @@ -129,6 +155,7 @@ ENTRY(startup_32)
5698 * Warning: don't use %esi or the stack in this code. However, %esp
5699 * can be used as a GPR if you really need it...
5700 */
5701 +
5702 page_pde_offset = (__PAGE_OFFSET >> 20);
5703
5704 movl $(pg0 - __PAGE_OFFSET), %edi
5705 diff --git a/arch/i386/kernel/mfgpt.c b/arch/i386/kernel/mfgpt.c
5706 new file mode 100644
5707 index 0000000..2e62a41
5708 --- /dev/null
5709 +++ b/arch/i386/kernel/mfgpt.c
5710 @@ -0,0 +1,354 @@
5711 +/* Driver/API for AMD Geode Multi-Function General Purpose Timers (MFGPT)
5712 + *
5713 + * Copyright (C) 2006, Advanced Micro Devices, Inc.
5714 + *
5715 + * This program is free software; you can redistribute it and/or
5716 + * modify it under the terms of the GNU General Public License
5717 + * as published by the Free Software Foundation; either version
5718 + * 2 of the License, or (at your option) any later version.
5719 + */
5720 +
5721 +/* The MFPGT timers on the CS5536 provide us with suitable timers to use
5722 + * as clock event sources - not as good as a HPET or APIC, but certainly
5723 + * better then the PIT. This isn't a general purpose MFGPT driver, but
5724 + * a simplified one designed specifically to act as a clock event source.
5725 + * For full details about the MFGPT, please consult the CS5536 data sheet.
5726 +*/
5727 +
5728 +/* We are using the 32Khz input clock - its the only one that has the
5729 + * ranges we find desirable. The following table lists the suitable
5730 + * divisors and the associated hz, minimum interval
5731 + * and the maximum interval:
5732 +
5733 + Divisor Hz Min Delta (S) Max Delta (S)
5734 + 1 32000 .0005 2.048
5735 + 2 16000 .001 4.096
5736 + 4 8000 .002 8.192
5737 + 8 4000 .004 16.384
5738 + 16 2000 .008 32.768
5739 + 32 1000 .016 65.536
5740 + 64 500 .032 131.072
5741 + 128 250 .064 262.144
5742 + 256 125 .128 524.288
5743 +*/
5744 +
5745 +#include <linux/kernel.h>
5746 +#include <linux/interrupt.h>
5747 +#include <linux/module.h>
5748 +#include <linux/clocksource.h>
5749 +#include <linux/clockchips.h>
5750 +#include <asm/geode.h>
5751 +
5752 +#include "do_timer.h"
5753 +
5754 +#define MFGPT_MAX_TIMERS 8
5755 +
5756 +#define F_AVAIL 0x01
5757 +
5758 +static struct mfgpt_timer_t {
5759 + int flags;
5760 + struct module *owner;
5761 +} mfgpt_timers[MFGPT_MAX_TIMERS];
5762 +
5763 +/* Selected from the table above */
5764 +
5765 +#define MFGPT_DIVISOR 16
5766 +#define MFGPT_SCALE 4 /* divisor = 2^(scale) */
5767 +#define MFGPT_HZ (32000 / MFGPT_DIVISOR)
5768 +#define MFGPT_PERIODIC (MFGPT_HZ / HZ)
5769 +
5770 +#ifdef CONFIG_GEODE_MFGPT_TIMER
5771 +static int __init mfgpt_timer_setup(void);
5772 +#else
5773 +#define mfgpt_timer_setup() (0)
5774 +#endif
5775 +
5776 +/* Allow for disabling of MFGPTs */
5777 +static int disable = 0;
5778 +static int __init mfgpt_disable(char *s)
5779 +{
5780 + disable = 1;
5781 + return 1;
5782 +}
5783 +__setup("nomfgpt", mfgpt_disable);
5784 +
5785 +/*
5786 + * Check whether any MFGPTs are available for the kernel to use. In most
5787 + * cases, firmware that uses AMD's VSA code will claim all timers during
5788 + * bootup; we certainly don't want to take them if they're already in use.
5789 + * In other cases (such as with VSAless OpenFirmware), the system firmware
5790 + * leaves timers available for us to use.
5791 + */
5792 +int __init geode_mfgpt_detect(void)
5793 +{
5794 + int count = 0, i;
5795 + u16 val;
5796 +
5797 + if (disable) {
5798 + printk(KERN_INFO "geode-mfgpt: Skipping MFGPT setup\n");
5799 + return 0;
5800 + }
5801 +
5802 + for (i = 0; i < MFGPT_MAX_TIMERS; i++) {
5803 + val = geode_mfgpt_read(i, MFGPT_REG_SETUP);
5804 + if (!(val & MFGPT_SETUP_SETUP)) {
5805 + mfgpt_timers[i].flags = F_AVAIL;
5806 + count++;
5807 + }
5808 + }
5809 +
5810 + /* set up clock event device, if desired */
5811 + i = mfgpt_timer_setup();
5812 +
5813 + return count;
5814 +}
5815 +
5816 +int geode_mfgpt_toggle_event(int timer, int cmp, int event, int enable)
5817 +{
5818 + u32 msr, mask, value, dummy;
5819 + int shift = (cmp == MFGPT_CMP1) ? 0 : 8;
5820 +
5821 + if (timer < 0 || timer >= MFGPT_MAX_TIMERS)
5822 + return -EIO;
5823 +
5824 + /*
5825 + * The register maps for these are described in sections 6.17.1.x of
5826 + * the AMD Geode CS5536 Companion Device Data Book.
5827 + */
5828 + switch(event) {
5829 + case MFGPT_EVENT_RESET:
5830 + /* XXX: According to the docs, we cannot reset timers above
5831 + * 6; that is, resets for 7 and 8 will be ignored. Is this
5832 + * a problem? */
5833 + msr = MFGPT_NR_MSR;
5834 + mask = 1 << (timer + 24);
5835 + break;
5836 +
5837 + case MFGPT_EVENT_NMI:
5838 + msr = MFGPT_NR_MSR;
5839 + mask = 1 << (timer + shift);
5840 + break;
5841 +
5842 + case MFGPT_EVENT_IRQ:
5843 + msr = MFGPT_IRQ_MSR;
5844 + mask = 1 << (timer + shift);
5845 + break;
5846 +
5847 + default:
5848 + return -EIO;
5849 + }
5850 +
5851 + rdmsr(msr, value, dummy);
5852 +
5853 + if (enable)
5854 + value |= mask;
5855 + else
5856 + value &= ~mask;
5857 +
5858 + wrmsr(msr, value, dummy);
5859 + return 0;
5860 +}
5861 +EXPORT_SYMBOL(geode_mfgpt_toggle_event);
5862 +
5863 +int geode_mfgpt_set_irq(int timer, int cmp, int irq, int enable)
5864 +{
5865 + u32 val, dummy;
5866 + int offset;
5867 +
5868 + if (timer < 0 || timer >= MFGPT_MAX_TIMERS)
5869 + return -EIO;
5870 +
5871 + if (geode_mfgpt_toggle_event(timer, cmp, MFGPT_EVENT_IRQ, enable))
5872 + return -EIO;
5873 +
5874 + rdmsr(0x51400022, val, dummy);
5875 +
5876 + offset = (timer % 4) * 4;
5877 +
5878 + val &= ~((0xF << offset) | (0xF << (offset + 16)));
5879 +
5880 + if (enable) {
5881 + val |= (irq & 0x0F) << (offset);
5882 + val |= (irq & 0x0F) << (offset + 16);
5883 + }
5884 +
5885 + wrmsr(0x51400022, val, dummy);
5886 + return 0;
5887 +}
5888 +EXPORT_SYMBOL(geode_mfgpt_set_irq);
5889 +
5890 +static int mfgpt_get(int timer, struct module *owner)
5891 +{
5892 + mfgpt_timers[timer].flags &= ~F_AVAIL;
5893 + mfgpt_timers[timer].owner = owner;
5894 + printk(KERN_INFO "geode-mfgpt: Registered timer %d\n", timer);
5895 + return timer;
5896 +}
5897 +
5898 +int geode_mfgpt_alloc_timer(int timer, int domain, struct module *owner)
5899 +{
5900 + int i;
5901 +
5902 + if (!geode_get_dev_base(GEODE_DEV_MFGPT))
5903 + return -ENODEV;
5904 + if (timer >= MFGPT_MAX_TIMERS)
5905 + return -EIO;
5906 +
5907 + if (timer < 0) {
5908 + /* Try to find an available timer */
5909 + for (i = 0; i < MFGPT_MAX_TIMERS; i++) {
5910 + if (mfgpt_timers[i].flags & F_AVAIL)
5911 + return mfgpt_get(i, owner);
5912 +
5913 + if (i == 5 && domain == MFGPT_DOMAIN_WORKING)
5914 + break;
5915 + }
5916 + }
5917 + else {
5918 + /* If they requested a specific timer, try to honor that */
5919 + if (mfgpt_timers[timer].flags & F_AVAIL)
5920 + return mfgpt_get(timer, owner);
5921 + }
5922 +
5923 + /* No timers available - too bad */
5924 + return -1;
5925 +}
5926 +EXPORT_SYMBOL(geode_mfgpt_alloc_timer);
5927 +
5928 +#ifdef CONFIG_GEODE_MFGPT_TIMER
5929 +
5930 +static unsigned int mfgpt_tick_mode = CLOCK_EVT_MODE_SHUTDOWN;
5931 +static u16 mfgpt_event_clock;
5932 +
5933 +static int irq = 7;
5934 +static int __init mfgpt_setup(char *str)
5935 +{
5936 + get_option(&str, &irq);
5937 + return 1;
5938 +}
5939 +__setup("mfgpt_irq=", mfgpt_setup);
5940 +
5941 +static inline void mfgpt_disable_timer(u16 clock)
5942 +{
5943 + u16 val = geode_mfgpt_read(clock, MFGPT_REG_SETUP);
5944 + geode_mfgpt_write(clock, MFGPT_REG_SETUP, val & ~MFGPT_SETUP_CNTEN);
5945 +}
5946 +
5947 +static int mfgpt_next_event(unsigned long, struct clock_event_device *);
5948 +static void mfgpt_set_mode(enum clock_event_mode, struct clock_event_device *);
5949 +
5950 +static struct clock_event_device mfgpt_clockevent = {
5951 + .name = "mfgpt-timer",
5952 + .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
5953 + .set_mode = mfgpt_set_mode,
5954 + .set_next_event = mfgpt_next_event,
5955 + .rating = 250,
5956 + .cpumask = CPU_MASK_ALL,
5957 + .shift = 32
5958 +};
5959 +
5960 +static inline void mfgpt_start_timer(u16 clock, u16 delta)
5961 +{
5962 + geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_CMP2, (u16) delta);
5963 + geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_COUNTER, 0);
5964 +
5965 + geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP,
5966 + MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2);
5967 +}
5968 +
5969 +static void mfgpt_set_mode(enum clock_event_mode mode,
5970 + struct clock_event_device *evt)
5971 +{
5972 + mfgpt_disable_timer(mfgpt_event_clock);
5973 +
5974 + if (mode == CLOCK_EVT_MODE_PERIODIC)
5975 + mfgpt_start_timer(mfgpt_event_clock, MFGPT_PERIODIC);
5976 +
5977 + mfgpt_tick_mode = mode;
5978 +}
5979 +
5980 +static int mfgpt_next_event(unsigned long delta, struct clock_event_device *evt)
5981 +{
5982 + mfgpt_start_timer(mfgpt_event_clock, delta);
5983 + return 0;
5984 +}
5985 +
5986 +/* Assume (foolishly?), that this interrupt was due to our tick */
5987 +
5988 +static irqreturn_t mfgpt_tick(int irq, void *dev_id)
5989 +{
5990 + if (mfgpt_tick_mode == CLOCK_EVT_MODE_SHUTDOWN)
5991 + return IRQ_HANDLED;
5992 +
5993 + /* Turn off the clock */
5994 + mfgpt_disable_timer(mfgpt_event_clock);
5995 +
5996 + /* Clear the counter */
5997 + geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_COUNTER, 0);
5998 +
5999 + /* Restart the clock in periodic mode */
6000 +
6001 + if (mfgpt_tick_mode == CLOCK_EVT_MODE_PERIODIC) {
6002 + geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP,
6003 + MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2);
6004 + }
6005 +
6006 + mfgpt_clockevent.event_handler(&mfgpt_clockevent);
6007 + return IRQ_HANDLED;
6008 +}
6009 +
6010 +static struct irqaction mfgptirq = {
6011 + .handler = mfgpt_tick,
6012 + .flags = IRQF_DISABLED | IRQF_NOBALANCING,
6013 + .mask = CPU_MASK_NONE,
6014 + .name = "mfgpt-timer"
6015 +};
6016 +
6017 +static int __init mfgpt_timer_setup(void)
6018 +{
6019 + int timer, ret;
6020 + u16 val;
6021 +
6022 + timer = geode_mfgpt_alloc_timer(MFGPT_TIMER_ANY, MFGPT_DOMAIN_WORKING, THIS_MODULE);
6023 + if (timer < 0) {
6024 + printk(KERN_ERR "mfgpt-timer: Could not allocate a MFPGT timer\n");
6025 + return -ENODEV;
6026 + }
6027 +
6028 + mfgpt_event_clock = timer;
6029 + /* Set the clock scale and enable the event mode for CMP2 */
6030 + val = MFGPT_SCALE | (3 << 8);
6031 +
6032 + geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP, val);
6033 +
6034 + /* Set up the IRQ on the MFGPT side */
6035 + if (geode_mfgpt_setup_irq(mfgpt_event_clock, MFGPT_CMP2, irq)) {
6036 + printk(KERN_ERR "mfgpt-timer: Could not set up IRQ %d\n", irq);
6037 + return -EIO;
6038 + }
6039 +
6040 + /* And register it with the kernel */
6041 + ret = setup_irq(irq, &mfgptirq);
6042 +
6043 + if (ret) {
6044 + printk(KERN_ERR "mfgpt-timer: Unable to set up the interrupt.\n");
6045 + goto err;
6046 + }
6047 +
6048 + /* Set up the clock event */
6049 + mfgpt_clockevent.mult = div_sc(MFGPT_HZ, NSEC_PER_SEC, 32);
6050 + mfgpt_clockevent.min_delta_ns = clockevent_delta2ns(0xF, &mfgpt_clockevent);
6051 + mfgpt_clockevent.max_delta_ns = clockevent_delta2ns(0xFFFE, &mfgpt_clockevent);
6052 +
6053 + printk("mfgpt-timer: registering the MFGT timer as a clock event.\n");
6054 + clockevents_register_device(&mfgpt_clockevent);
6055 +
6056 + return 0;
6057 +
6058 +err:
6059 + geode_mfgpt_release_irq(mfgpt_event_clock, MFGPT_CMP2, irq);
6060 + printk(KERN_ERR "mfgpt-timer: Unable to set up the MFGPT clock source\n");
6061 + return -EIO;
6062 +}
6063 +
6064 +#endif
6065 diff --git a/arch/i386/kernel/ofw.c b/arch/i386/kernel/ofw.c
6066 new file mode 100644
6067 index 0000000..fdcd936
6068 --- /dev/null
6069 +++ b/arch/i386/kernel/ofw.c
6070 @@ -0,0 +1,100 @@
6071 +/*
6072 + * ofw.c - Open Firmware client interface for 32-bit systems.
6073 + * This code is intended to be portable to any 32-bit Open Firmware
6074 + * implementation with a standard client interface that can be
6075 + * called when Linux is running.
6076 + *
6077 + * Copyright (C) 2007 Mitch Bradley <wmb@firmworks.com>
6078 + * Copyright (C) 2007 Andres Salomon <dilinger@debian.org>
6079 + */
6080 +
6081 +#include <stdarg.h>
6082 +#include <linux/spinlock.h>
6083 +#include <linux/module.h>
6084 +#include <asm/ofw.h>
6085 +
6086 +
6087 +int (*call_firmware)(int *);
6088 +
6089 +static DEFINE_SPINLOCK(prom_lock);
6090 +
6091 +#define MAXARGS 20
6092 +
6093 +/*
6094 + * The return value from ofw() in all cases is 0 if the attempt to call the
6095 + * function succeeded, <0 otherwise. That return value is from the
6096 + * gateway function only. Any results from the called function are returned
6097 + * via output argument pointers.
6098 + *
6099 + * Here are call templates for all the standard OFW client services:
6100 + *
6101 + * ofw("test", 1, 1, namestr, &missing);
6102 + * ofw("peer", 1, 1, phandle, &sibling_phandle);
6103 + * ofw("child", 1, 1, phandle, &child_phandle);
6104 + * ofw("parent", 1, 1, phandle, &parent_phandle);
6105 + * ofw("instance_to_package", 1, 1, ihandle, &phandle);
6106 + * ofw("getproplen", 2, 1, phandle, namestr, &proplen);
6107 + * ofw("getprop", 4, 1, phandle, namestr, bufaddr, buflen, &size);
6108 + * ofw("nextprop", 3, 1, phandle, previousstr, bufaddr, &flag);
6109 + * ofw("setprop", 4, 1, phandle, namestr, bufaddr, len, &size);
6110 + * ofw("canon", 3, 1, devspecstr, bufaddr, buflen, &length);
6111 + * ofw("finddevice", 1, 1, devspecstr, &phandle);
6112 + * ofw("instance-to-path", 3, 1, ihandle, bufaddr, buflen, &length);
6113 + * ofw("package-to-path", 3, 1, phandle, bufaddr, buflen, &length);
6114 + * ofw("call_method", numin, numout, in0, in1, ..., &out0, &out1, ...);
6115 + * ofw("open", 1, 1, devspecstr, &ihandle);
6116 + * ofw("close", 1, 0, ihandle);
6117 + * ofw("read", 3, 1, ihandle, addr, len, &actual);
6118 + * ofw("write", 3, 1, ihandle, addr, len, &actual);
6119 + * ofw("seek", 3, 1, ihandle, pos_hi, pos_lo, &status);
6120 + * ofw("claim", 3, 1, virtaddr, size, align, &baseaddr);
6121 + * ofw("release", 2, 0, virtaddr, size);
6122 + * ofw("boot", 1, 0, bootspecstr);
6123 + * ofw("enter", 0, 0);
6124 + * ofw("exit", 0, 0);
6125 + * ofw("chain", 5, 0, virtaddr, size, entryaddr, argsaddr, len);
6126 + * ofw("interpret", numin+1, numout+1, cmdstr, in0, ..., &catchres, &out0, ...);
6127 + * ofw("set-callback", 1, 1, newfuncaddr, &oldfuncaddr);
6128 + * ofw("set-symbol-lookup", 2, 0, symtovaladdr, valtosymaddr);
6129 + * ofw("milliseconds", 0, 1, &ms);
6130 + */
6131 +
6132 +int ofw(char *name, int numargs, int numres, ...)
6133 +{
6134 + va_list ap;
6135 + int argarray[MAXARGS+3];
6136 + int argnum = 3;
6137 + int retval;
6138 + int *intp;
6139 + unsigned long flags;
6140 +
6141 + if (!call_firmware)
6142 + return -1;
6143 + if ((numargs + numres) > MAXARGS)
6144 + return -1; /* spit out an error? */
6145 +
6146 + argarray[0] = (int) name;
6147 + argarray[1] = numargs;
6148 + argarray[2] = numres;
6149 +
6150 + va_start(ap, numres);
6151 + while (numargs) {
6152 + argarray[argnum++] = va_arg(ap, int);
6153 + numargs--;
6154 + }
6155 +
6156 + spin_lock_irqsave(&prom_lock, flags);
6157 + retval = call_firmware(argarray);
6158 + spin_unlock_irqrestore(&prom_lock, flags);
6159 +
6160 + if (retval == 0) {
6161 + while (numres) {
6162 + intp = va_arg(ap, int *);
6163 + *intp = argarray[argnum++];
6164 + numres--;
6165 + }
6166 + }
6167 + va_end(ap);
6168 + return retval;
6169 +}
6170 +EXPORT_SYMBOL(ofw);
6171 diff --git a/arch/i386/kernel/olpc-pm.c b/arch/i386/kernel/olpc-pm.c
6172 new file mode 100644
6173 index 0000000..93149f1
6174 --- /dev/null
6175 +++ b/arch/i386/kernel/olpc-pm.c
6176 @@ -0,0 +1,785 @@
6177 +/* olpc-pm.c
6178 + * © 2006 Red Hat, Inc.
6179 + * Portions also copyright 2006 Advanced Micro Devices, Inc.
6180 + * GPLv2
6181 + */
6182 +
6183 +#include <linux/kernel.h>
6184 +#include <linux/interrupt.h>
6185 +#include <linux/module.h>
6186 +#include <linux/delay.h>
6187 +#include <linux/input.h>
6188 +#include <linux/suspend.h>
6189 +#include <linux/bootmem.h>
6190 +#include <linux/platform_device.h>
6191 +#include <linux/rtc.h>
6192 +#include <linux/mc146818rtc.h>
6193 +#include <asm/io.h>
6194 +
6195 +#include <asm/olpc.h>
6196 +
6197 +/* A few words about accessing the ACPI and PM registers. Long story short,
6198 + byte and word accesses of the ACPI and PM registers is broken. The only
6199 + way to do it really correctly is to use dword accesses, which we do
6200 + throughout this code. For more details, please consult Eratta 17 and 18
6201 + here:
6202 +
6203 + http://www.amd.com/files/connectivitysolutions/geode/geode_gx/34472D_CS5536_B1_specupdate.pdf
6204 +*/
6205 +
6206 +#define PM_IRQ 3
6207 +
6208 +#define CS5536_PM_PWRBTN (1 << 8)
6209 +#define CS5536_PM_RTC (1 << 10)
6210 +
6211 +#define GPIO_WAKEUP_EC (1 << 31)
6212 +#define GPIO_WAKEUP_LID (1 << 30)
6213 +
6214 +#define PM_MODE_NORMAL 0
6215 +#define PM_MODE_TEST 1
6216 +#define PM_MODE_MAX 2
6217 +
6218 +/* These, and the battery EC commands, should be in an olpc.h. */
6219 +#define EC_WRITE_SCI_MASK 0x1b
6220 +#define EC_READ_SCI_MASK 0x1c
6221 +
6222 +extern void do_olpc_suspend_lowlevel(void);
6223 +
6224 +static struct {
6225 + unsigned long address;
6226 + unsigned short segment;
6227 +} ofw_bios_entry = { 0, __KERNEL_CS };
6228 +
6229 +static int olpc_pm_mode = PM_MODE_NORMAL;
6230 +static unsigned long acpi_base;
6231 +static unsigned long pms_base;
6232 +static int sci_irq;
6233 +static int olpc_lid_flag;
6234 +
6235 +static struct input_dev *pm_inputdev;
6236 +static struct input_dev *lid_inputdev;
6237 +static struct input_dev *ebook_inputdev;
6238 +static struct pm_ops olpc_pm_ops;
6239 +
6240 +static int gpio_wake_events = 0;
6241 +static int ebook_state = -1;
6242 +static u16 olpc_wakeup_mask = 0;
6243 +
6244 +struct platform_device olpc_powerbutton_dev = {
6245 + .name = "powerbutton",
6246 + .id = -1,
6247 +};
6248 +
6249 +struct platform_device olpc_lid_dev = {
6250 + .name = "lid",
6251 + .id = -1,
6252 +};
6253 +
6254 +static void __init init_ebook_state(void)
6255 +{
6256 + if (olpc_ec_cmd(0x2a, NULL, 0, (unsigned char *) &ebook_state, 1)) {
6257 + printk(KERN_WARNING "olpc-pm: failed to get EBOOK state!\n");
6258 + ebook_state = 0;
6259 + }
6260 + ebook_state &= 1;
6261 +
6262 + /* the input layer needs to know what value to default to as well */
6263 + input_report_switch(ebook_inputdev, SW_TABLET_MODE, ebook_state);
6264 + input_sync(ebook_inputdev);
6265 +}
6266 +
6267 +static void (*battery_callback)(unsigned long);
6268 +static DEFINE_SPINLOCK(battery_callback_lock);
6269 +
6270 +/* propagate_events is non-NULL if run from workqueue,
6271 + NULL when called at init time to flush SCI queue */
6272 +static void process_sci_queue(struct work_struct *propagate_events)
6273 +{
6274 + unsigned char data = 0;
6275 + unsigned char battery_events = 0;
6276 + int ret;
6277 +
6278 + do {
6279 + ret = olpc_ec_cmd(0x84, NULL, 0, &data, 1);
6280 + if (!ret) {
6281 + printk(KERN_DEBUG "olpc-pm: SCI 0x%x received\n",
6282 + data);
6283 +
6284 + switch (data) {
6285 + case EC_SCI_SRC_EMPTY:
6286 + case EC_SCI_SRC_GAME:
6287 + case EC_SCI_SRC_WLAN:
6288 + /* we ignore these for now */
6289 + break;
6290 + case EC_SCI_SRC_BATERR:
6291 + printk(KERN_ERR "olpc-pm: Battery Management System detected an error! Remove turnip from battery slot.\n");
6292 + case EC_SCI_SRC_BATSOC:
6293 + case EC_SCI_SRC_BATTERY:
6294 + case EC_SCI_SRC_ACPWR:
6295 + battery_events |= data;
6296 + break;
6297 + case EC_SCI_SRC_EBOOK:
6298 + ebook_state = !ebook_state;
6299 + if (propagate_events) {
6300 + input_report_switch(ebook_inputdev,
6301 + SW_TABLET_MODE, ebook_state);
6302 + input_sync(ebook_inputdev);
6303 + }
6304 + break;
6305 + default:
6306 + printk(KERN_ERR "olpc-pm: Unknown SCI event 0x%x occurred!\n", data);
6307 + }
6308 + }
6309 + } while (data && !ret);
6310 +
6311 + if (battery_events && battery_callback && propagate_events) {
6312 + void (*cbk)(unsigned long);
6313 +
6314 + /* Older EC versions didn't distinguish between AC and battery
6315 + events */
6316 + if (olpc_platform_info.ecver < 0x45)
6317 + battery_events = EC_SCI_SRC_BATTERY | EC_SCI_SRC_ACPWR;
6318 +
6319 + spin_lock(&battery_callback_lock);
6320 + cbk = battery_callback;
6321 + spin_unlock(&battery_callback_lock);
6322 +
6323 + cbk(battery_events);
6324 + }
6325 +
6326 + if (ret)
6327 + printk(KERN_WARNING "Failed to clear SCI queue!\n");
6328 +}
6329 +
6330 +static DECLARE_WORK(sci_work, process_sci_queue);
6331 +
6332 +void olpc_register_battery_callback(void (*f)(unsigned long))
6333 +{
6334 + spin_lock(&battery_callback_lock);
6335 + battery_callback = f;
6336 + spin_unlock(&battery_callback_lock);
6337 +}
6338 +EXPORT_SYMBOL_GPL(olpc_register_battery_callback);
6339 +
6340 +void olpc_deregister_battery_callback(void)
6341 +{
6342 + spin_lock(&battery_callback_lock);
6343 + battery_callback = NULL;
6344 + spin_unlock(&battery_callback_lock);
6345 + cancel_work_sync(&sci_work);
6346 +}
6347 +EXPORT_SYMBOL_GPL(olpc_deregister_battery_callback);
6348 +
6349 +
6350 +static int olpc_pm_interrupt(int irq, void *id)
6351 +{
6352 + uint32_t sts, gpe = 0;
6353 +
6354 + sts = inl(acpi_base + PM1_STS);
6355 + outl(sts | 0xFFFF, acpi_base + PM1_STS);
6356 +
6357 + if (olpc_get_rev() >= OLPC_REV_B2) {
6358 + gpe = inl(acpi_base + PM_GPE0_STS);
6359 + outl(0xFFFFFFFF, acpi_base + PM_GPE0_STS);
6360 + }
6361 +
6362 + if (sts & CS5536_PM_PWRBTN) {
6363 + input_report_key(pm_inputdev, KEY_POWER, 1);
6364 + input_sync(pm_inputdev);
6365 + printk(KERN_DEBUG "olpm-pm: PM_PWRBTN event received\n");
6366 + /* Do we need to delay this (and hence schedule_work)? */
6367 + input_report_key(pm_inputdev, KEY_POWER, 0);
6368 + input_sync(pm_inputdev);
6369 + }
6370 +
6371 + if (gpe & GPIO_WAKEUP_EC) {
6372 + geode_gpio_clear(OLPC_GPIO_ECSCI, GPIO_NEGATIVE_EDGE_STS);
6373 + schedule_work(&sci_work);
6374 + }
6375 +
6376 + if (gpe & GPIO_WAKEUP_LID) {
6377 + /* Disable events */
6378 + geode_gpio_clear(OLPC_GPIO_LID, GPIO_EVENTS_ENABLE);
6379 +
6380 + /* Clear the edge */
6381 +
6382 + if (olpc_lid_flag)
6383 + geode_gpio_clear(OLPC_GPIO_LID, GPIO_NEGATIVE_EDGE_EN);
6384 + else
6385 + geode_gpio_clear(OLPC_GPIO_LID, GPIO_POSITIVE_EDGE_EN);
6386 +
6387 + /* Clear the status too */
6388 + geode_gpio_set(OLPC_GPIO_LID, GPIO_NEGATIVE_EDGE_STS);
6389 + geode_gpio_set(OLPC_GPIO_LID, GPIO_POSITIVE_EDGE_STS);
6390 +
6391 + /* The line is high when the LID is open, but SW_LID
6392 + * should be high when the LID is closed, so we pass the old
6393 + * value of olpc_lid_flag
6394 + */
6395 +
6396 + input_report_switch(lid_inputdev, SW_LID, olpc_lid_flag);
6397 + input_sync(lid_inputdev);
6398 +
6399 + /* Swap the status */
6400 + olpc_lid_flag = !olpc_lid_flag;
6401 +
6402 + if (olpc_lid_flag)
6403 + geode_gpio_set(OLPC_GPIO_LID, GPIO_NEGATIVE_EDGE_EN);
6404 + else
6405 + geode_gpio_set(OLPC_GPIO_LID, GPIO_POSITIVE_EDGE_EN);
6406 +
6407 + /* re-enable the event */
6408 + geode_gpio_set(OLPC_GPIO_LID, GPIO_EVENTS_ENABLE);
6409 + }
6410 +
6411 + return IRQ_HANDLED;
6412 +}
6413 +
6414 +/*
6415 + * For now, only support STR. We also don't support suspending on
6416 + * B1s, due to difficulties with the cafe FPGA.
6417 + */
6418 +static int olpc_pm_state_valid(suspend_state_t pm_state)
6419 +{
6420 + if (pm_state == PM_SUSPEND_MEM && olpc_rev_after(OLPC_REV_B1))
6421 + return 1;
6422 +
6423 + return 0;
6424 +}
6425 +
6426 +/* This is a catchall function for operations that just don't belong
6427 + * anywhere else. Later we will evaluate if these belong in the
6428 + * individual device drivers or the firmware.
6429 + * If you add something to this function, please explain yourself with
6430 + * a comment.
6431 + */
6432 +
6433 +extern void gxfb_flatpanel_control(int state);
6434 +
6435 +static u32 gpio_wakeup[2];
6436 +static u64 irq_sources[4];
6437 +static u64 mfgpt_irq_msr, mfgpt_nr_msr;
6438 +
6439 +void olpc_fixup_wakeup(void)
6440 +{
6441 + u32 base = geode_gpio_base();
6442 + int i;
6443 +
6444 + /* This clears any pending events from the status register -
6445 + * the firmware also does this, but its possible that it tries
6446 + * it too early before the key has a chance to debounce
6447 + */
6448 +
6449 + outl((CS5536_PM_PWRBTN << 16) | 0xFFFF, acpi_base + PM1_STS);
6450 +
6451 + /* Enable the flatpanel sequencing as early as possible, because
6452 + it takes ~64ms to resume. This probably belongs in the firmware */
6453 +
6454 + //gxfb_flatpanel_control(1);
6455 +
6456 + /* Restore the interrupt sources */
6457 + wrmsrl(MSR_PIC_YSEL_LOW, irq_sources[0]);
6458 + wrmsrl(MSR_PIC_ZSEL_LOW, irq_sources[1]);
6459 + wrmsrl(MSR_PIC_YSEL_HIGH, irq_sources[2]);
6460 + wrmsrl(MSR_PIC_ZSEL_HIGH, irq_sources[3]);
6461 +
6462 + /* Restore the X and Y sources for GPIO */
6463 + outl(gpio_wakeup[0], base + GPIO_MAP_X);
6464 + outl(gpio_wakeup[1], base + GPIO_MAP_Y);
6465 +
6466 + /* Resture the MFGPT MSRs */
6467 + wrmsrl(MFGPT_IRQ_MSR, mfgpt_irq_msr);
6468 + wrmsrl(MFGPT_NR_MSR, mfgpt_nr_msr);
6469 +
6470 + for (i=0;i<2;i++) {
6471 + /* tell the wireless module to restart USB communication */
6472 + olpc_ec_cmd(0x24, NULL, 0, NULL, 0);
6473 + }
6474 +}
6475 +
6476 +void olpc_fixup_sleep(void)
6477 +{
6478 + u32 base = geode_gpio_base();
6479 + int i;
6480 +
6481 + /* Save the X and Y sources for GPIO */
6482 + gpio_wakeup[0] = inl(base + GPIO_MAP_X);
6483 + gpio_wakeup[1] = inl(base + GPIO_MAP_Y);
6484 +
6485 + /* Save the Y and Z unrestricted sources */
6486 +
6487 + rdmsrl(MSR_PIC_YSEL_LOW, irq_sources[0]);
6488 + rdmsrl(MSR_PIC_ZSEL_LOW, irq_sources[1]);
6489 + rdmsrl(MSR_PIC_YSEL_HIGH, irq_sources[2]);
6490 + rdmsrl(MSR_PIC_ZSEL_HIGH, irq_sources[3]);
6491 +
6492 + /* Turn off the MFGPT timers on the way down */
6493 +
6494 + for(i = 0; i < 8; i++) {
6495 + u32 val = geode_mfgpt_read(i, MFGPT_REG_SETUP);
6496 +
6497 + if (val & MFGPT_SETUP_SETUP) {
6498 + val &= ~MFGPT_SETUP_CNTEN;
6499 + geode_mfgpt_write(i, MFGPT_REG_SETUP, val);
6500 + }
6501 + }
6502 +
6503 + /* Save the MFGPT MSRs */
6504 + rdmsrl(MFGPT_IRQ_MSR, mfgpt_irq_msr);
6505 + rdmsrl(MFGPT_NR_MSR, mfgpt_nr_msr);
6506 +
6507 + if (device_may_wakeup(&olpc_powerbutton_dev.dev))
6508 + olpc_wakeup_mask |= CS5536_PM_PWRBTN;
6509 + else
6510 + olpc_wakeup_mask &= ~(CS5536_PM_PWRBTN);
6511 +
6512 + if (device_may_wakeup(&olpc_lid_dev.dev)) {
6513 + geode_gpio_set(OLPC_GPIO_LID, GPIO_EVENTS_ENABLE);
6514 + gpio_wake_events |= GPIO_WAKEUP_LID;
6515 + } else {
6516 + geode_gpio_clear(OLPC_GPIO_LID, GPIO_EVENTS_ENABLE);
6517 + gpio_wake_events &= ~(GPIO_WAKEUP_LID);
6518 + }
6519 +}
6520 +
6521 +static int olpc_pm_enter(suspend_state_t pm_state)
6522 +{
6523 + /* Only STR is supported */
6524 + if (pm_state != PM_SUSPEND_MEM)
6525 + return -EINVAL;
6526 +
6527 + olpc_fixup_sleep();
6528 +
6529 + /* Set the GPIO wakeup bits */
6530 + outl(gpio_wake_events, acpi_base + PM_GPE0_EN);
6531 + outl(0xFFFFFFFF, acpi_base + PM_GPE0_STS);
6532 +
6533 + /* Save CPU state */
6534 + do_olpc_suspend_lowlevel();
6535 +
6536 + olpc_fixup_wakeup();
6537 +
6538 + /* Restore the SCI wakeup events */
6539 + outl(gpio_wake_events, acpi_base + PM_GPE0_EN);
6540 +
6541 + return 0;
6542 +}
6543 +
6544 +int asmlinkage olpc_do_sleep(u8 sleep_state)
6545 +{
6546 + void *pgd_addr = __va(read_cr3());
6547 + printk(KERN_ERR "olpc_do_sleep!\n"); /* this needs to remain here so
6548 + * that gcc doesn't optimize
6549 + * away our __va! */
6550 + /* FIXME: Set the SCI bits we want to wake up on here */
6551 +
6552 + /* FIXME: Set any other SCI events that we might want here */
6553 +
6554 + outl((olpc_wakeup_mask << 16) | 0xFFFF, acpi_base + PM1_STS);
6555 +
6556 + /* If we are in test mode, then just return (simulate a successful
6557 + suspend/resume). Otherwise, if we are doing the real thing,
6558 + then go for the gusto */
6559 +
6560 + if (olpc_pm_mode != PM_MODE_TEST) {
6561 + __asm__ __volatile__("movl %0,%%eax" : : "r" (pgd_addr));
6562 + __asm__("call *(%%edi); cld"
6563 + : : "D" (&ofw_bios_entry));
6564 + }
6565 +
6566 + return 0;
6567 +}
6568 +
6569 +/* This code will slowly disappear as we fixup the issues in the BIOS */
6570 +
6571 +static void __init olpc_fixup_bios(void)
6572 +{
6573 + unsigned long hi, lo;
6574 +
6575 + if (olpc_has_vsa()) {
6576 + /* The VSA aggressively sets up the ACPI and PM register for
6577 + * trapping - its not enough to force these values in the BIOS -
6578 + * they seem to be changed during PCI init as well.
6579 + */
6580 +
6581 + /* Change the PM registers to decode to the DD */
6582 +
6583 + rdmsr(0x510100e2, lo, hi);
6584 + hi |= 0x80000000;
6585 + wrmsr(0x510100e2, lo, hi);
6586 +
6587 + /* Change the ACPI registers to decode to the DD */
6588 +
6589 + rdmsr(0x510100e3, lo, hi);
6590 + hi |= 0x80000000;
6591 + wrmsr(0x510100e3, lo, hi);
6592 + }
6593 +
6594 + /* GPIO24 controls WORK_AUX */
6595 +
6596 + geode_gpio_set(OLPC_GPIO_WORKAUX, GPIO_OUTPUT_ENABLE);
6597 + geode_gpio_set(OLPC_GPIO_WORKAUX, GPIO_OUTPUT_AUX1);
6598 +
6599 + if (olpc_get_rev() >= OLPC_REV_B2) {
6600 + /* GPIO10 is connected to the thermal alarm */
6601 + geode_gpio_set(OLPC_GPIO_THRM_ALRM, GPIO_INPUT_ENABLE);
6602 + geode_gpio_set(OLPC_GPIO_THRM_ALRM, GPIO_INPUT_AUX1);
6603 +
6604 + /* Set up to get LID events */
6605 + geode_gpio_set(OLPC_GPIO_LID, GPIO_INPUT_ENABLE);
6606 +
6607 + /* Clear edge detection and event enable for now */
6608 + geode_gpio_clear(OLPC_GPIO_LID, GPIO_EVENTS_ENABLE);
6609 + geode_gpio_clear(OLPC_GPIO_LID, GPIO_NEGATIVE_EDGE_EN);
6610 + geode_gpio_clear(OLPC_GPIO_LID, GPIO_POSITIVE_EDGE_EN);
6611 +
6612 + geode_gpio_set(OLPC_GPIO_LID, GPIO_NEGATIVE_EDGE_STS);
6613 + geode_gpio_set(OLPC_GPIO_LID, GPIO_POSITIVE_EDGE_STS);
6614 +
6615 + /* Set the LID to cause an PME event on group 6 */
6616 + geode_gpio_event_pme(OLPC_GPIO_LID, 6);
6617 +
6618 + /* Set PME group 6 to fire the SCI interrupt */
6619 + geode_gpio_set_irq(6, sci_irq);
6620 + }
6621 +
6622 + geode_gpio_set(OLPC_GPIO_ECSCI, GPIO_INPUT_ENABLE);
6623 +
6624 + /* Clear pending events */
6625 +
6626 + geode_gpio_set(OLPC_GPIO_ECSCI, GPIO_NEGATIVE_EDGE_STS);
6627 + geode_gpio_set(OLPC_GPIO_ECSCI, GPIO_POSITIVE_EDGE_STS);
6628 +
6629 + //geode_gpio_set(OLPC_GPIO_ECSCI, GPIO_NEGATIVE_EDGE_EN);
6630 + geode_gpio_set(OLPC_GPIO_ECSCI, GPIO_EVENTS_ENABLE);
6631 +
6632 + /* Set the SCI to cause a PME event on group 7 */
6633 + geode_gpio_event_pme(OLPC_GPIO_ECSCI, 7);
6634 +
6635 + /* And have group 6 also fire the SCI interrupt */
6636 + geode_gpio_set_irq(7, sci_irq);
6637 +}
6638 +
6639 +/* This provides a control file for setting up testing of the
6640 + power management system. For now, there is just one setting:
6641 + "test" which means that we don't actually enter the power
6642 + off routine.
6643 +*/
6644 +
6645 +static const char * const pm_states[] = {
6646 + [PM_MODE_NORMAL] = "normal",
6647 + [PM_MODE_TEST] = "test",
6648 +};
6649 +
6650 +extern struct mutex pm_mutex;
6651 +extern struct kset power_subsys;
6652 +
6653 +static ssize_t control_show(struct kset *s, char *buf)
6654 +{
6655 + return sprintf(buf, "%s\n", pm_states[olpc_pm_mode]);
6656 +}
6657 +
6658 +static ssize_t control_store(struct kset *s, const char *buf, size_t n)
6659 +{
6660 + int i, len;
6661 + char *p;
6662 +
6663 + p = memchr(buf, '\n', n);
6664 + len = p ? p - buf : n;
6665 +
6666 + /* Grab the mutex */
6667 + mutex_lock(&pm_mutex);
6668 +
6669 + for(i = 0; i < PM_MODE_MAX; i++) {
6670 + if (!strncmp(buf, pm_states[i], len)) {
6671 + olpc_pm_mode = i;
6672 + break;
6673 + }
6674 + }
6675 +
6676 + mutex_unlock(&pm_mutex);
6677 +
6678 + return (i == PM_MODE_MAX) ? -EINVAL : n;
6679 +}
6680 +
6681 +static struct subsys_attribute control_attr = {
6682 + .attr = {
6683 + .name = "olpc-pm",
6684 + .mode = 0644,
6685 + },
6686 + .show = control_show,
6687 + .store = control_store,
6688 +};
6689 +
6690 +static struct attribute * olpc_attributes[] = {
6691 + &control_attr.attr,
6692 + NULL
6693 +};
6694 +
6695 +static struct attribute_group olpc_attrs = {
6696 + .attrs = olpc_attributes,
6697 +};
6698 +
6699 +static int __init alloc_inputdevs(void)
6700 +{
6701 + int ret = -ENOMEM;
6702 +
6703 + pm_inputdev = input_allocate_device();
6704 + if (!pm_inputdev)
6705 + goto err;
6706 +
6707 + pm_inputdev->name = "OLPC PM";
6708 + pm_inputdev->phys = "olpc_pm/input0";
6709 + set_bit(EV_KEY, pm_inputdev->evbit);
6710 + set_bit(KEY_POWER, pm_inputdev->keybit);
6711 +
6712 + ret = input_register_device(pm_inputdev);
6713 + if (ret) {
6714 + printk(KERN_ERR "olpc-pm: failed to register PM input device: %d\n", ret);
6715 + goto err;
6716 + }
6717 +
6718 + lid_inputdev = input_allocate_device();
6719 + if (!lid_inputdev)
6720 + goto err;
6721 +
6722 + lid_inputdev->name = "OLPC lid switch";
6723 + lid_inputdev->phys = "olpc_pm/input1";
6724 + set_bit(EV_SW, lid_inputdev->evbit);
6725 + set_bit(SW_LID, lid_inputdev->swbit);
6726 +
6727 + ret = input_register_device(lid_inputdev);
6728 + if (ret) {
6729 + printk(KERN_ERR "olpc-pm: failed to register lid input device: %d\n", ret);
6730 + goto err;
6731 + }
6732 +
6733 + ebook_inputdev = input_allocate_device();
6734 + if (!ebook_inputdev)
6735 + goto err;
6736 +
6737 + ebook_inputdev->name = "OLPC ebook switch";
6738 + ebook_inputdev->phys = "olpc_pm/input2";
6739 + set_bit(EV_SW, ebook_inputdev->evbit);
6740 + set_bit(SW_TABLET_MODE, ebook_inputdev->swbit);
6741 +
6742 + ret = input_register_device(ebook_inputdev);
6743 + if (ret) {
6744 + printk(KERN_ERR "olpc-pm: failed to register ebook input device: %d\n", ret);
6745 + goto err;
6746 + }
6747 +
6748 + return ret;
6749 +err:
6750 + if (ebook_inputdev) {
6751 + input_unregister_device(ebook_inputdev);
6752 + ebook_inputdev = NULL;
6753 + }
6754 + if (lid_inputdev) {
6755 + input_unregister_device(lid_inputdev);
6756 + lid_inputdev = NULL;
6757 + }
6758 + if (pm_inputdev) {
6759 + input_unregister_device(pm_inputdev);
6760 + pm_inputdev = NULL;
6761 + }
6762 +
6763 + return ret;
6764 +}
6765 +
6766 +static int __init olpc_pm_init(void)
6767 +{
6768 + uint32_t lo, hi;
6769 + int ret;
6770 + uint8_t ec_byte;
6771 +
6772 + if (!machine_is_olpc())
6773 + return -ENODEV;
6774 +
6775 + acpi_base = geode_acpi_base();
6776 + pms_base = geode_pms_base();
6777 +
6778 + if (!acpi_base || !pms_base)
6779 + return -ENODEV;
6780 +
6781 + ret = alloc_inputdevs();
6782 + if (ret)
6783 + return ret;
6784 +
6785 + rdmsr(0x51400020, lo, hi);
6786 + sci_irq = (lo >> 20) & 15;
6787 +
6788 + if (sci_irq) {
6789 + printk(KERN_INFO "SCI is mapped to IRQ %d\n", sci_irq);
6790 + } else {
6791 + /* Zero doesn't mean zero -- it means masked */
6792 + printk(KERN_INFO "SCI unmapped. Mapping to IRQ 3\n");
6793 + sci_irq = 3;
6794 + lo |= 0x00300000;
6795 + wrmsrl(0x51400020, lo);
6796 + }
6797 +
6798 + olpc_fixup_bios();
6799 +
6800 + lo = inl(pms_base + PM_FSD);
6801 +
6802 + /* Lock, enable failsafe, 4 seconds */
6803 + outl(0xc001f400, pms_base + PM_FSD);
6804 +
6805 + /* Here we set up the SCI events we're interested in during
6806 + * real-time. We have no sleep button, and the RTC doesn't make
6807 + * sense, so set up the power button
6808 + */
6809 +
6810 + outl(inl(acpi_base) | ((CS5536_PM_PWRBTN) << 16), acpi_base);
6811 +
6812 + if (olpc_get_rev() >= OLPC_REV_B2) {
6813 + gpio_wake_events |= GPIO_WAKEUP_LID;
6814 +
6815 + /* Get the current value of the GPIO, and set up the edges */
6816 + olpc_lid_flag = geode_gpio_isset(OLPC_GPIO_LID, GPIO_READ_BACK);
6817 +
6818 + /* Watch for the opposite edge */
6819 +
6820 + if (olpc_lid_flag)
6821 + geode_gpio_set(OLPC_GPIO_LID, GPIO_NEGATIVE_EDGE_EN);
6822 + else
6823 + geode_gpio_set(OLPC_GPIO_LID, GPIO_POSITIVE_EDGE_EN);
6824 +
6825 + /* Enable the event */
6826 + geode_gpio_set(OLPC_GPIO_LID, GPIO_EVENTS_ENABLE);
6827 + }
6828 +
6829 + /* Set up the mask for wakeups the EC will generate SCIs on */
6830 +
6831 + ret = olpc_ec_cmd(EC_READ_SCI_MASK, NULL, 0, &ec_byte, 1);
6832 + if (ret)
6833 + printk(KERN_ERR "Error getting the EC SCI mask: %d\n", ret);
6834 +
6835 + /* Disable battery 1% charge wakeups */
6836 + ec_byte &= ~EC_SCI_SRC_BATSOC;
6837 +
6838 + ret = olpc_ec_cmd(EC_WRITE_SCI_MASK, &ec_byte, 1, NULL, 0);
6839 + if (ret)
6840 + printk(KERN_ERR "Error setting the EC SCI mask: %d\n", ret);
6841 +
6842 + /* Set up the EC SCI */
6843 +
6844 + gpio_wake_events |= GPIO_WAKEUP_EC;
6845 +
6846 + outl(gpio_wake_events, acpi_base + PM_GPE0_EN);
6847 + outl(0xFFFFFFFF, acpi_base + PM_GPE0_STS);
6848 +
6849 + /* Select level triggered in PIC */
6850 +
6851 + if (sci_irq < 8) {
6852 + lo = inb(0x4d0);
6853 + lo |= 1 << sci_irq;
6854 + outb(lo, 0x4d0);
6855 + } else {
6856 + lo = inb(0x4d1);
6857 + lo |= 1 << (sci_irq - 8);
6858 + outb(lo, 0x4d1);
6859 + }
6860 + /* Clear pending interrupt */
6861 + outl(inl(acpi_base) | 0xFFFF, acpi_base);
6862 + process_sci_queue(0); /* we just want to flush the queue here */
6863 + init_ebook_state();
6864 +
6865 + /* Enable the interrupt */
6866 +
6867 + ret = request_irq(sci_irq, &olpc_pm_interrupt, 0, "SCI", &acpi_base);
6868 +
6869 + if (ret) {
6870 + printk(KERN_ERR "Error registering SCI: %d\n", ret);
6871 + return ret;
6872 + }
6873 +
6874 + ofw_bios_entry.address = 0xF0000 + PAGE_OFFSET;
6875 + pm_set_ops(&olpc_pm_ops);
6876 +
6877 + sysfs_create_group(&power_subsys.kobj, &olpc_attrs);
6878 +
6879 + return 0;
6880 +}
6881 +
6882 +
6883 +#if defined (CONFIG_RTC_DRV_CMOS) || defined (CONFIG_RTC_DRV_CMOS_MODULE)
6884 +struct resource rtc_platform_resource[2] = {
6885 + {
6886 + .flags = IORESOURCE_IO,
6887 + .start = RTC_PORT(0),
6888 + .end = RTC_PORT(0) + RTC_IO_EXTENT
6889 + },
6890 + {
6891 + .flags = IORESOURCE_IRQ,
6892 + .start = 8,
6893 + .end = 8,
6894 + },
6895 +};
6896 +
6897 +
6898 +static void rtc_wake_on(struct device *dev)
6899 +{
6900 + olpc_wakeup_mask |= CS5536_PM_RTC;
6901 +}
6902 +
6903 +static void rtc_wake_off(struct device *dev)
6904 +{
6905 + olpc_wakeup_mask &= ~(CS5536_PM_RTC);
6906 +}
6907 +
6908 +static struct cmos_rtc_board_info rtc_info = {
6909 + .rtc_day_alarm = 0,
6910 + .rtc_mon_alarm = 0,
6911 + .rtc_century = 0,
6912 + .wake_on = rtc_wake_on,
6913 + .wake_off = rtc_wake_off,
6914 +};
6915 +
6916 +struct platform_device olpc_rtc_device = {
6917 + .name = "rtc_cmos",
6918 + .id = -1,
6919 + .num_resources = ARRAY_SIZE(rtc_platform_resource),
6920 + .dev.platform_data = &rtc_info,
6921 + .resource = rtc_platform_resource,
6922 +};
6923 +
6924 +static int __init olpc_platform_init(void)
6925 +{
6926 + (void)platform_device_register(&olpc_rtc_device);
6927 + device_init_wakeup(&olpc_rtc_device.dev, 1);
6928 +
6929 + (void)platform_device_register(&olpc_powerbutton_dev);
6930 + device_init_wakeup(&olpc_powerbutton_dev.dev, 1);
6931 +
6932 + (void)platform_device_register(&olpc_lid_dev);
6933 + device_init_wakeup(&olpc_lid_dev.dev, 1);
6934 +
6935 + return 0;
6936 +}
6937 +arch_initcall(olpc_platform_init);
6938 +#endif /* CONFIG_RTC_DRV_CMOS */
6939 +
6940 +static void olpc_pm_exit(void)
6941 +{
6942 + /* Clear any pending events, and disable them */
6943 + outl(0xFFFF, acpi_base+2);
6944 +
6945 + free_irq(sci_irq, &acpi_base);
6946 + input_unregister_device(pm_inputdev);
6947 + input_unregister_device(lid_inputdev);
6948 + input_unregister_device(ebook_inputdev);
6949 +}
6950 +
6951 +static struct pm_ops olpc_pm_ops = {
6952 + .valid = olpc_pm_state_valid,
6953 + .enter = olpc_pm_enter,
6954 +};
6955 +
6956 +module_init(olpc_pm_init);
6957 +module_exit(olpc_pm_exit);
6958 +
6959 +MODULE_LICENSE("GPL");
6960 +MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
6961 +MODULE_DESCRIPTION("AMD Geode power management for OLPC CL1");
6962 diff --git a/arch/i386/kernel/olpc-sleep.S b/arch/i386/kernel/olpc-sleep.S
6963 new file mode 100644
6964 index 0000000..9535c9a
6965 --- /dev/null
6966 +++ b/arch/i386/kernel/olpc-sleep.S
6967 @@ -0,0 +1,39 @@
6968 +.text
6969 +
6970 +ENTRY(olpc_sleep_asm)
6971 +olpc_sleep:
6972 + ;; Get the value of PM1_CNT and store it off
6973 +
6974 + add 08h, ax
6975 + mov bx,dx
6976 + in dx,eax
6977 + or 2000h, ax
6978 + mov ax,di
6979 +
6980 + ;; flush the cache
6981 + wbinvd
6982 +
6983 + ;; GX2 must disable refresh before going into self-refresh
6984 + mov 2000000180xh, ecx
6985 + rdmsr
6986 + mov eax, esi
6987 + and 0FF0000FFh, eax
6988 + wrmsr
6989 +
6990 + ;; Now, put the memory into self refresh
6991 + mov 2004, cx
6992 + xor edx, edx
6993 + xor eax, eax
6994 + mov 04h, al
6995 + wrmsr
6996 +
6997 + ;; Thats all she wrote - time to go to sleep
6998 +
6999 + mov bx, dx
7000 + movzx di, eax
7001 + out eax, dx
7002 +
7003 + ;;
7004 +
7005 +
7006 +
7007 diff --git a/arch/i386/kernel/olpc-wakeup.S b/arch/i386/kernel/olpc-wakeup.S
7008 new file mode 100644
7009 index 0000000..a92cc61
7010 --- /dev/null
7011 +++ b/arch/i386/kernel/olpc-wakeup.S
7012 @@ -0,0 +1,122 @@
7013 +.text
7014 +#include <linux/linkage.h>
7015 +#include <asm/segment.h>
7016 +#include <asm/page.h>
7017 +
7018 +ALIGN
7019 + .align 4096
7020 +
7021 +wakeup_start:
7022 +# jmp wakeup_start
7023 +
7024 + cli
7025 + cld
7026 +
7027 + # Clear any dangerous flags
7028 +
7029 + pushl $0
7030 + popfl
7031 +
7032 + # Set up %cr3
7033 + movl $swsusp_pg_dir - __PAGE_OFFSET, %eax
7034 + movl %eax, %cr3
7035 +
7036 + movl saved_cr4, %eax
7037 + movl %eax, %cr4
7038 +
7039 + movl saved_cr0, %eax
7040 + movl %eax, %cr0
7041 +
7042 + jmp 1f
7043 +1:
7044 + ljmpl $__KERNEL_CS,$wakeup_return
7045 +
7046 +
7047 +.org 0x1000
7048 +
7049 +wakeup_return:
7050 + movw $__KERNEL_DS, %ax
7051 + movw %ax, %ss
7052 + movw %ax, %ds
7053 + movw %ax, %es
7054 + movw %ax, %fs
7055 + movw %ax, %gs
7056 +
7057 + lgdt saved_gdt
7058 + lidt saved_idt
7059 + lldt saved_ldt
7060 + ljmp $(__KERNEL_CS),$1f
7061 +1:
7062 + movl %cr3, %eax
7063 + movl %eax, %cr3
7064 + wbinvd
7065 +
7066 + # Go back to the return point
7067 + jmp ret_point
7068 +
7069 +save_registers:
7070 + sgdt saved_gdt
7071 + sidt saved_idt
7072 + sldt saved_ldt
7073 +
7074 + pushl %edx
7075 + movl %cr4, %edx
7076 + movl %edx, saved_cr4
7077 +
7078 + movl %cr0, %edx
7079 + movl %edx, saved_cr0
7080 +
7081 + popl %edx
7082 +
7083 +
7084 + movl %ebx, saved_context_ebx
7085 + movl %ebp, saved_context_ebp
7086 + movl %esi, saved_context_esi
7087 + movl %edi, saved_context_edi
7088 +
7089 + pushfl
7090 + popl saved_context_eflags
7091 +
7092 + ret
7093 +
7094 +
7095 +restore_registers:
7096 + movl saved_context_ebp, %ebp
7097 + movl saved_context_ebx, %ebx
7098 + movl saved_context_esi, %esi
7099 + movl saved_context_edi, %edi
7100 +
7101 + pushl saved_context_eflags
7102 + popfl
7103 +
7104 + ret
7105 +
7106 +
7107 +ENTRY(do_olpc_suspend_lowlevel)
7108 + call save_processor_state
7109 + call save_registers
7110 +
7111 + # This is the stack context we want to remember
7112 + movl %esp, saved_context_esp
7113 +
7114 + pushl $3
7115 + call olpc_do_sleep
7116 +
7117 + jmp wakeup_start
7118 + .p2align 4,,7
7119 +ret_point:
7120 + movl saved_context_esp, %esp
7121 +
7122 + call restore_registers
7123 + call restore_processor_state
7124 + ret
7125 +
7126 +.data
7127 +ALIGN
7128 +
7129 +saved_gdt: .long 0,0
7130 +saved_idt: .long 0,0
7131 +saved_ldt: .long 0
7132 +saved_cr4: .long 0
7133 +saved_cr0: .long 0
7134 +
7135 diff --git a/arch/i386/kernel/olpc.c b/arch/i386/kernel/olpc.c
7136 new file mode 100644
7137 index 0000000..d540cb0
7138 --- /dev/null
7139 +++ b/arch/i386/kernel/olpc.c
7140 @@ -0,0 +1,320 @@
7141 +/* Support for the OLPC DCON and OLPC EC access
7142 + * Copyright (C) 2006, Advanced Micro Devices, Inc.
7143 + *
7144 + * This program is free software; you can redistribute it and/or modify
7145 + * it under the terms of the GNU General Public License as published by
7146 + * the Free Software Foundation; either version 2 of the License, or
7147 + * (at your option) any later version.
7148 + */
7149 +
7150 +#include <linux/autoconf.h>
7151 +#include <linux/kernel.h>
7152 +#include <linux/init.h>
7153 +#include <linux/mc146818rtc.h>
7154 +#include <linux/delay.h>
7155 +#include <linux/spinlock.h>
7156 +
7157 +#include <asm/olpc.h>
7158 +#include <asm/ofw.h>
7159 +
7160 +/* This is our new multi-purpose structure used to contain the
7161 + * information about the platform that we detect
7162 + */
7163 +
7164 +struct olpc_platform_t olpc_platform_info;
7165 +EXPORT_SYMBOL_GPL(olpc_platform_info);
7166 +
7167 +/*********************************************************************
7168 + * EC locking and access
7169 + *********************************************************************/
7170 +
7171 +static DEFINE_SPINLOCK(ec_lock);
7172 +
7173 +/* what the timeout *should* be (in ms) */
7174 +#define EC_BASE_TIMEOUT 20
7175 +
7176 +/* the timeout that bugs in the EC might force us to actually use */
7177 +static int ec_timeout = EC_BASE_TIMEOUT;
7178 +
7179 +static int __init olpc_ec_timeout_set(char *str)
7180 +{
7181 + if (get_option(&str, &ec_timeout) != 1) {
7182 + ec_timeout = EC_BASE_TIMEOUT;
7183 + printk(KERN_ERR "olpc-ec: invalid argument to "
7184 + "'olpc_ec_timeout=', ignoring!\n");
7185 + }
7186 + printk(KERN_DEBUG "olpc-ec: using %d ms delay for EC commands.\n",
7187 + ec_timeout);
7188 + return 1;
7189 +}
7190 +__setup("olpc_ec_timeout=", olpc_ec_timeout_set);
7191 +
7192 +/*
7193 + * These *bf_status functions return whether the buffers are full or not.
7194 + */
7195 +
7196 +static inline unsigned int ibf_status(unsigned int port)
7197 +{
7198 + return inb(port) & 0x02;
7199 +}
7200 +
7201 +static inline unsigned int obf_status(unsigned int port)
7202 +{
7203 + return inb(port) & 0x01;
7204 +}
7205 +
7206 +#define wait_on_ibf(p, d) __wait_on_ibf(__LINE__, (p), (d))
7207 +static int __wait_on_ibf(unsigned int line, unsigned int port, int desired)
7208 +{
7209 + unsigned int timeo;
7210 + int state = ibf_status(port);
7211 +
7212 + for (timeo = ec_timeout; state != desired && timeo; timeo--) {
7213 + mdelay(1);
7214 + state = ibf_status(port);
7215 + }
7216 +
7217 + if ((state == desired) && (ec_timeout > EC_BASE_TIMEOUT) &&
7218 + timeo < (ec_timeout - EC_BASE_TIMEOUT)) {
7219 + printk(KERN_WARNING "olpc-ec: waited %u ms for IBF (%d)!\n",
7220 + EC_BASE_TIMEOUT-timeo, line);
7221 + }
7222 +
7223 + return !(state == desired);
7224 +}
7225 +
7226 +#define wait_on_obf(p, d) __wait_on_obf(__LINE__, (p), (d))
7227 +static int __wait_on_obf(unsigned int line, unsigned int port, int desired)
7228 +{
7229 + unsigned int timeo;
7230 + int state = obf_status(port);
7231 +
7232 + for (timeo = ec_timeout; state != desired && timeo; timeo--) {
7233 + mdelay(1);
7234 + state = obf_status(port);
7235 + }
7236 +
7237 + if ((state == desired) && (ec_timeout > EC_BASE_TIMEOUT) &&
7238 + timeo < (ec_timeout - EC_BASE_TIMEOUT)) {
7239 + printk(KERN_WARNING "olpc-ec: waited %u ms for OBF (%d)!\n",
7240 + EC_BASE_TIMEOUT-timeo, line);
7241 + }
7242 +
7243 + return !(state == desired);
7244 +}
7245 +
7246 +int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen,
7247 + unsigned char *outbuf, size_t outlen)
7248 +{
7249 + unsigned long flags;
7250 + int ret = -EIO;
7251 + int i;
7252 +
7253 + spin_lock_irqsave(&ec_lock, flags);
7254 +
7255 + if (wait_on_ibf(0x6c, 0)) {
7256 + printk(KERN_ERR "olpc-ec: timeout waiting for EC to "
7257 + "quiesce!\n");
7258 + goto err;
7259 + }
7260 +
7261 +restart:
7262 + /*
7263 + * Note that if we time out during any IBF checks, that's a failure;
7264 + * we have to return. There's no way for the kernel to clear that.
7265 + *
7266 + * If we time out during an OBF check, we can restart the command;
7267 + * reissuing it will clear the OBF flag, and we should be alright.
7268 + * The OBF flag will sometimes misbehave due to what we believe
7269 + * is a hardware quirk..
7270 + */
7271 + printk(KERN_DEBUG "olpc-ec: running cmd 0x%x\n", cmd);
7272 + outb(cmd, 0x6c);
7273 +
7274 + if (wait_on_ibf(0x6c, 0)) {
7275 + printk(KERN_ERR "olpc-ec: timeout waiting for EC to read "
7276 + "command!\n");
7277 + goto err;
7278 + }
7279 +
7280 + if (inbuf && inlen) {
7281 + /* write data to EC */
7282 + for (i = 0; i < inlen; i++) {
7283 + if (wait_on_ibf(0x6c, 0)) {
7284 + printk(KERN_ERR "olpc-ec: timeout waiting for"
7285 + " EC accept data!\n");
7286 + goto err;
7287 + }
7288 + printk(KERN_DEBUG "olpc-ec: sending cmd arg 0x%x\n",
7289 + inbuf[i]);
7290 + outb(inbuf[i], 0x68);
7291 + }
7292 + }
7293 + if (outbuf && outlen) {
7294 + /* read data from EC */
7295 + for (i = 0; i < outlen; i++) {
7296 + if (wait_on_obf(0x6c, 1)) {
7297 + printk(KERN_ERR "olpc-ec: timeout waiting for"
7298 + " EC to provide data!\n");
7299 + goto restart;
7300 + }
7301 + outbuf[i] = inb(0x68);
7302 + printk(KERN_DEBUG "olpc-ec: received 0x%x\n",
7303 + outbuf[i]);
7304 + }
7305 + }
7306 +
7307 + ret = 0;
7308 +err:
7309 + spin_unlock_irqrestore(&ec_lock, flags);
7310 + return ret;
7311 +}
7312 +EXPORT_SYMBOL_GPL(olpc_ec_cmd);
7313 +
7314 +/*********************************************************************
7315 + * DCON stuff
7316 + *********************************************************************/
7317 +
7318 +static void olpc_power_off(void)
7319 +{
7320 + printk(KERN_INFO "OLPC power off sequence...\n");
7321 + outb(0xff, 0x381);
7322 + outb(0x14, 0x382);
7323 + outb(0x01, 0x383);
7324 + outb(0xff, 0x381);
7325 + outb(0x14, 0x382);
7326 + outb(0x00, 0x383);
7327 +}
7328 +
7329 +static void __init
7330 +ec_detect(void)
7331 +{
7332 + olpc_ec_cmd(0x08, NULL, 0, (unsigned char *) &olpc_platform_info.ecver, 1);
7333 +}
7334 +
7335 +/* Check to see if this version of the OLPC board has VSA built
7336 + * in, and set a flag
7337 + */
7338 +
7339 +static void __init vsa_detect(void)
7340 +{
7341 + u16 rev;
7342 +
7343 + outw(0xFC53, 0xAC1C);
7344 + outw(0x0003, 0xAC1C);
7345 +
7346 + rev = inw(0xAC1E);
7347 +
7348 + if (rev == 0x4132)
7349 + olpc_platform_info.flags |= OLPC_F_VSA;
7350 +}
7351 +
7352 +/* Map OFW revisions to what OLPC_REV_* */
7353 +static const char __initdata *olpc_boardrev_str[] = {
7354 + "A1",
7355 + "preB1",
7356 + "B1",
7357 + "preB2",
7358 + "B2",
7359 + "preB3",
7360 + "B3",
7361 + "B4",
7362 + "C1",
7363 + "R1",
7364 +};
7365 +
7366 +static void __init platform_detect(char *revision, size_t len)
7367 +{
7368 + size_t propsize;
7369 + int i;
7370 +
7371 + BUG_ON(ARRAY_SIZE(olpc_boardrev_str) != OLPC_REV_UNKNOWN);
7372 +
7373 + if (ofw("getprop", 4, 1, NULL, "model", revision, len, &propsize)) {
7374 + printk(KERN_ERR "ofw: getprop call failed!\n");
7375 + goto failed;
7376 + }
7377 + if (len < propsize) {
7378 + printk(KERN_ERR "ofw: revision string is too long!\n");
7379 + goto failed;
7380 + }
7381 +
7382 + for (i=0; i < ARRAY_SIZE(olpc_boardrev_str); i++) {
7383 + if (strcmp(revision, olpc_boardrev_str[i]) == 0) {
7384 + olpc_platform_info.boardrev = i;
7385 + return;
7386 + }
7387 + }
7388 +
7389 +failed:
7390 + strncpy(revision, "Unknown", len);
7391 + olpc_platform_info.boardrev = OLPC_REV_UNKNOWN;
7392 +}
7393 +
7394 +static int olpc_dcon_present = -1;
7395 +module_param(olpc_dcon_present, int, 0444);
7396 +
7397 +/* REV_A CMOS map:
7398 + * bit 440; DCON present bit
7399 + */
7400 +
7401 +#define OLPC_CMOS_DCON_OFFSET (440 / 8)
7402 +#define OLPC_CMOS_DCON_MASK 0x01
7403 +
7404 +static int __init olpc_init(void)
7405 +{
7406 + unsigned char *romsig;
7407 + char revision[10];
7408 +
7409 + spin_lock_init(&ec_lock);
7410 +
7411 + romsig = ioremap(0xffffffc0, 16);
7412 +
7413 + if (!romsig)
7414 + return 0;
7415 +
7416 + if (strncmp(romsig, "CL1 Q", 7))
7417 + goto unmap;
7418 + if (strncmp(romsig+6, romsig+13, 3)) {
7419 + printk(KERN_INFO "OLPC BIOS signature looks invalid. Assuming not OLPC\n");
7420 + goto unmap;
7421 + }
7422 + printk(KERN_INFO "OLPC board with OpenFirmware: %.16s\n", romsig);
7423 +
7424 + olpc_platform_info.flags |= OLPC_F_PRESENT;
7425 +
7426 + pm_power_off = olpc_power_off;
7427 +
7428 + /* Get the platform revision */
7429 + platform_detect(revision, sizeof(revision));
7430 +
7431 + /* If olpc_dcon_present isn't set by the command line, then
7432 + * "detect" it
7433 + */
7434 +
7435 + if (olpc_dcon_present == -1) {
7436 + /* B1 and greater always has a DCON */
7437 + if (olpc_platform_info.boardrev >= OLPC_REV_B1 &&
7438 + olpc_platform_info.boardrev < OLPC_REV_UNKNOWN)
7439 + olpc_dcon_present = 1;
7440 + }
7441 +
7442 + if (olpc_dcon_present)
7443 + olpc_platform_info.flags |= OLPC_F_DCON;
7444 +
7445 + /* Get the EC revision */
7446 + ec_detect();
7447 +
7448 + /* Check to see if the VSA exists */
7449 + vsa_detect();
7450 +
7451 + printk(KERN_INFO "OLPC board revision: %s (EC=%x)\n", revision,
7452 + olpc_platform_info.ecver);
7453 +
7454 + unmap:
7455 + iounmap(romsig);
7456 +
7457 + return 0;
7458 +}
7459 +
7460 +postcore_initcall(olpc_init);
7461 diff --git a/arch/i386/kernel/prom.c b/arch/i386/kernel/prom.c
7462 new file mode 100644
7463 index 0000000..d64bb27
7464 --- /dev/null
7465 +++ b/arch/i386/kernel/prom.c
7466 @@ -0,0 +1,478 @@
7467 +/*
7468 + * Procedures for creating, accessing and interpreting the device tree.
7469 + *
7470 + * Paul Mackerras August 1996.
7471 + * Copyright (C) 1996-2005 Paul Mackerras.
7472 + *
7473 + * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
7474 + * {engebret|bergner}@us.ibm.com
7475 + *
7476 + * Adapted for sparc64 by David S. Miller davem@davemloft.net
7477 + *
7478 + * Adapter for i386/OLPC by Andres Salomon <dilinger@debian.org>
7479 + *
7480 + * This program is free software; you can redistribute it and/or
7481 + * modify it under the terms of the GNU General Public License
7482 + * as published by the Free Software Foundation; either version
7483 + * 2 of the License, or (at your option) any later version.
7484 + */
7485 +
7486 +#include <linux/kernel.h>
7487 +#include <linux/types.h>
7488 +#include <linux/string.h>
7489 +#include <linux/mm.h>
7490 +#include <linux/bootmem.h>
7491 +#include <linux/module.h>
7492 +#include <asm/prom.h>
7493 +#include <asm/ofw.h>
7494 +
7495 +/*
7496 + * XXX: This is very much a stub; right now we're keeping 2 device trees
7497 + * in memory (one for promfs, and one here). That will not remain
7498 + * for long!
7499 + */
7500 +
7501 +static struct device_node *allnodes;
7502 +
7503 +/* use when traversing tree through the allnext, child, sibling,
7504 + * or parent members of struct device_node.
7505 + */
7506 +static DEFINE_RWLOCK(devtree_lock);
7507 +
7508 +int of_device_is_compatible(const struct device_node *device,
7509 + const char *compat)
7510 +{
7511 + const char* cp;
7512 + int cplen, l;
7513 +
7514 + cp = of_get_property(device, "compatible", &cplen);
7515 + if (cp == NULL)
7516 + return 0;
7517 + while (cplen > 0) {
7518 + if (strncmp(cp, compat, strlen(compat)) == 0)
7519 + return 1;
7520 + l = strlen(cp) + 1;
7521 + cp += l;
7522 + cplen -= l;
7523 + }
7524 +
7525 + return 0;
7526 +}
7527 +EXPORT_SYMBOL(of_device_is_compatible);
7528 +
7529 +struct device_node *of_get_parent(const struct device_node *node)
7530 +{
7531 + struct device_node *np;
7532 +
7533 + if (!node)
7534 + return NULL;
7535 +
7536 + np = node->parent;
7537 +
7538 + return np;
7539 +}
7540 +EXPORT_SYMBOL(of_get_parent);
7541 +
7542 +struct device_node *of_get_next_child(const struct device_node *node,
7543 + struct device_node *prev)
7544 +{
7545 + struct device_node *next;
7546 +
7547 + next = prev ? prev->sibling : node->child;
7548 + for (; next != 0; next = next->sibling) {
7549 + break;
7550 + }
7551 +
7552 + return next;
7553 +}
7554 +EXPORT_SYMBOL(of_get_next_child);
7555 +
7556 +struct device_node *of_find_node_by_path(const char *path)
7557 +{
7558 + struct device_node *np = allnodes;
7559 +
7560 + for (; np != 0; np = np->allnext) {
7561 + if (np->full_name != 0 && strcmp(np->full_name, path) == 0)
7562 + break;
7563 + }
7564 +
7565 + return np;
7566 +}
7567 +EXPORT_SYMBOL(of_find_node_by_path);
7568 +
7569 +struct device_node *of_find_node_by_phandle(phandle handle)
7570 +{
7571 + struct device_node *np;
7572 +
7573 + for (np = allnodes; np != 0; np = np->allnext)
7574 + if (np->node == handle)
7575 + break;
7576 +
7577 + return np;
7578 +}
7579 +EXPORT_SYMBOL(of_find_node_by_phandle);
7580 +
7581 +struct device_node *of_find_node_by_name(struct device_node *from,
7582 + const char *name)
7583 +{
7584 + struct device_node *np;
7585 +
7586 + np = from ? from->allnext : allnodes;
7587 + for (; np != NULL; np = np->allnext)
7588 + if (np->name != NULL && strcmp(np->name, name) == 0)
7589 + break;
7590 +
7591 + return np;
7592 +}
7593 +EXPORT_SYMBOL(of_find_node_by_name);
7594 +
7595 +struct device_node *of_find_node_by_type(struct device_node *from,
7596 + const char *type)
7597 +{
7598 + struct device_node *np;
7599 +
7600 + np = from ? from->allnext : allnodes;
7601 + for (; np != 0; np = np->allnext)
7602 + if (np->type != 0 && strcmp(np->type, type) == 0)
7603 + break;
7604 +
7605 + return np;
7606 +}
7607 +EXPORT_SYMBOL(of_find_node_by_type);
7608 +
7609 +struct device_node *of_find_compatible_node(struct device_node *from,
7610 + const char *type, const char *compatible)
7611 +{
7612 + struct device_node *np;
7613 +
7614 + np = from ? from->allnext : allnodes;
7615 + for (; np != 0; np = np->allnext) {
7616 + if (type != NULL
7617 + && !(np->type != 0 && strcmp(np->type, type) == 0))
7618 + continue;
7619 + if (of_device_is_compatible(np, compatible))
7620 + break;
7621 + }
7622 +
7623 + return np;
7624 +}
7625 +EXPORT_SYMBOL(of_find_compatible_node);
7626 +
7627 +struct property *of_find_property(const struct device_node *np,
7628 + const char *name,
7629 + int *lenp)
7630 +{
7631 + struct property *pp;
7632 +
7633 + for (pp = np->properties; pp != 0; pp = pp->next) {
7634 + if (strcasecmp(pp->name, name) == 0) {
7635 + if (lenp != 0)
7636 + *lenp = pp->length;
7637 + break;
7638 + }
7639 + }
7640 + return pp;
7641 +}
7642 +EXPORT_SYMBOL(of_find_property);
7643 +
7644 +/*
7645 + * Find a property with a given name for a given node
7646 + * and return the value.
7647 + */
7648 +const void *of_get_property(const struct device_node *np, const char *name,
7649 + int *lenp)
7650 +{
7651 + struct property *pp = of_find_property(np,name,lenp);
7652 + return pp ? pp->value : NULL;
7653 +}
7654 +EXPORT_SYMBOL(of_get_property);
7655 +
7656 +int of_getintprop_default(struct device_node *np, const char *name, int def)
7657 +{
7658 + struct property *prop;
7659 + int len;
7660 +
7661 + prop = of_find_property(np, name, &len);
7662 + if (!prop || len != 4)
7663 + return def;
7664 +
7665 + return *(int *) prop->value;
7666 +}
7667 +EXPORT_SYMBOL(of_getintprop_default);
7668 +
7669 +int of_n_addr_cells(struct device_node *np)
7670 +{
7671 + const int* ip;
7672 + do {
7673 + if (np->parent)
7674 + np = np->parent;
7675 + ip = of_get_property(np, "#address-cells", NULL);
7676 + if (ip != NULL)
7677 + return *ip;
7678 + } while (np->parent);
7679 + /* No #address-cells property for the root node, default to 2 */
7680 + return 2;
7681 +}
7682 +EXPORT_SYMBOL(of_n_addr_cells);
7683 +
7684 +int of_n_size_cells(struct device_node *np)
7685 +{
7686 + const int* ip;
7687 + do {
7688 + if (np->parent)
7689 + np = np->parent;
7690 + ip = of_get_property(np, "#size-cells", NULL);
7691 + if (ip != NULL)
7692 + return *ip;
7693 + } while (np->parent);
7694 + /* No #size-cells property for the root node, default to 1 */
7695 + return 1;
7696 +}
7697 +EXPORT_SYMBOL(of_n_size_cells);
7698 +
7699 +int of_set_property(struct device_node *dp, const char *name, void *val, int len)
7700 +{
7701 + return -EIO;
7702 +}
7703 +EXPORT_SYMBOL(of_set_property);
7704 +
7705 +static unsigned int prom_early_allocated;
7706 +
7707 +static void * __init prom_early_alloc(unsigned long size)
7708 +{
7709 + void *ret;
7710 +
7711 + ret = kmalloc(size, GFP_KERNEL);
7712 + if (ret != NULL)
7713 + memset(ret, 0, size);
7714 + else
7715 + printk(KERN_ERR "ACK! couldn't allocate prom memory!\n");
7716 +
7717 + prom_early_allocated += size;
7718 +
7719 + return ret;
7720 +}
7721 +
7722 +static int is_root_node(const struct device_node *dp)
7723 +{
7724 + if (!dp)
7725 + return 0;
7726 +
7727 + return (dp->parent == NULL);
7728 +}
7729 +
7730 +static char * __init build_path_component(struct device_node *dp)
7731 +{
7732 + int pathlen;
7733 + char *n, *i;
7734 +
7735 + if (ofw("package-to-path", 3, 1, dp->node, NULL, 0, &pathlen)) {
7736 + printk(KERN_ERR "PROM: unable to get path name from OFW!\n");
7737 + return "ERROR";
7738 + }
7739 + n = prom_early_alloc(pathlen + 1);
7740 + if (ofw("package-to-path", 3, 1, dp->node, n, pathlen+1, &pathlen))
7741 + printk(KERN_ERR "PROM: unable to get path name from OFW\n");
7742 +
7743 + if ((i = strrchr(n, '/')))
7744 + n = ++i; /* we only want the file name */
7745 + return n;
7746 +}
7747 +
7748 +static char * __init build_full_name(struct device_node *dp)
7749 +{
7750 + int len, ourlen, plen;
7751 + char *n;
7752 +
7753 + plen = strlen(dp->parent->full_name);
7754 + ourlen = strlen(dp->path_component_name);
7755 + len = ourlen + plen + 2;
7756 +
7757 + n = prom_early_alloc(len);
7758 + strcpy(n, dp->parent->full_name);
7759 + if (!is_root_node(dp->parent)) {
7760 + strcpy(n + plen, "/");
7761 + plen++;
7762 + }
7763 + strcpy(n + plen, dp->path_component_name);
7764 +
7765 + return n;
7766 +}
7767 +
7768 +static struct property * __init build_one_prop(phandle node, char *prev, char *special_name, void *special_val, int special_len)
7769 +{
7770 + static struct property *tmp = NULL;
7771 + struct property *p;
7772 +
7773 + if (tmp) {
7774 + p = tmp;
7775 + memset(p, 0, sizeof(*p) + 32);
7776 + tmp = NULL;
7777 + } else {
7778 + p = prom_early_alloc(sizeof(struct property) + 32);
7779 + }
7780 +
7781 + p->name = (char *) (p + 1);
7782 + if (special_name) {
7783 + strcpy(p->name, special_name);
7784 + p->length = special_len;
7785 + p->value = prom_early_alloc(special_len);
7786 + memcpy(p->value, special_val, special_len);
7787 + } else {
7788 + int fl;
7789 + if (prev == NULL) {
7790 + if (ofw("nextprop", 3, 1, node, "", p->name, &fl)) {
7791 + printk(KERN_ERR "PROM: %s: nextprop failed!\n", __func__);
7792 + return NULL;
7793 + }
7794 + } else {
7795 + if (ofw("nextprop", 3, 1, node, prev, p->name, &fl)) {
7796 + printk(KERN_ERR "PROM: %s: nextprop failed!\n", __func__);
7797 + return NULL;
7798 + }
7799 + }
7800 + if (strlen(p->name) == 0 || fl != 1) {
7801 + tmp = p;
7802 + return NULL;
7803 + }
7804 + if (ofw("getproplen", 2, 1, node, p->name, &p->length)) {
7805 + printk(KERN_ERR "PROM: %s: getproplen failed!\n", __func__);
7806 + return NULL;
7807 + }
7808 + if (p->length <= 0) {
7809 + p->length = 0;
7810 + } else {
7811 + p->value = prom_early_alloc(p->length + 1);
7812 + if (ofw("getprop", 4, 1, node, p->name, p->value, p->length, &p->length)) {
7813 + printk(KERN_ERR "PROM: %s: getprop failed!\n", __func__);
7814 + return NULL;
7815 + }
7816 + ((unsigned char *)p->value)[p->length] = '\0';
7817 + }
7818 + }
7819 + return p;
7820 +}
7821 +
7822 +static struct property * __init build_prop_list(phandle node)
7823 +{
7824 + struct property *head, *tail;
7825 +
7826 + head = tail = build_one_prop(node, NULL,
7827 + ".node", &node, sizeof(node));
7828 +
7829 + tail->next = build_one_prop(node, NULL, NULL, NULL, 0);
7830 + tail = tail->next;
7831 + while(tail) {
7832 + tail->next = build_one_prop(node, tail->name,
7833 + NULL, NULL, 0);
7834 + tail = tail->next;
7835 + }
7836 +
7837 + return head;
7838 +}
7839 +
7840 +static char * __init get_one_property(phandle node, const char *name)
7841 +{
7842 + char *buf = "<NULL>";
7843 + int len;
7844 +
7845 + if (ofw("getproplen", 2, 1, node, name, &len)) {
7846 + printk(KERN_ERR "PROM: %s: getproplen failed!\n", __func__);
7847 + return NULL;
7848 + }
7849 + if (len > 0) {
7850 + buf = prom_early_alloc(len);
7851 + if (ofw("getprop", 4, 1, node, name, buf, len, &len)) {
7852 + printk(KERN_ERR "PROM: %s: getprop failed!\n", __func__);
7853 + return NULL;
7854 + }
7855 + }
7856 +
7857 + return buf;
7858 +}
7859 +
7860 +static struct device_node * __init create_node(phandle node, struct device_node *parent)
7861 +{
7862 + struct device_node *dp;
7863 +
7864 + if (!node)
7865 + return NULL;
7866 +
7867 + dp = prom_early_alloc(sizeof(*dp));
7868 + dp->parent = parent;
7869 +
7870 + kref_init(&dp->kref);
7871 +
7872 + dp->name = get_one_property(node, "name");
7873 + dp->type = get_one_property(node, "device_type");
7874 + dp->node = node;
7875 +
7876 + dp->properties = build_prop_list(node);
7877 +
7878 + return dp;
7879 +}
7880 +
7881 +static struct device_node * __init build_tree(struct device_node *parent, phandle node, struct device_node ***nextp)
7882 +{
7883 + struct device_node *ret = NULL, *prev_sibling = NULL;
7884 + struct device_node *dp;
7885 + u32 child;
7886 +
7887 + while (1) {
7888 + dp = create_node(node, parent);
7889 + if (!dp)
7890 + break;
7891 +
7892 + if (prev_sibling)
7893 + prev_sibling->sibling = dp;
7894 +
7895 + if (!ret)
7896 + ret = dp;
7897 + prev_sibling = dp;
7898 +
7899 + *(*nextp) = dp;
7900 + *nextp = &dp->allnext;
7901 +
7902 + dp->path_component_name = build_path_component(dp);
7903 + dp->full_name = build_full_name(dp);
7904 +
7905 + if (ofw("child", 1, 1, node, &child)) {
7906 + printk(KERN_ERR "PROM: %s: fetching child failed!\n", __func__);
7907 + return NULL;
7908 + }
7909 + dp->child = build_tree(dp, child, nextp);
7910 +
7911 + if (ofw("peer", 1, 1, node, &node)) {
7912 + printk(KERN_ERR "PROM: %s: fetching peer failed!\n", __func__);
7913 + return NULL;
7914 + }
7915 + }
7916 +
7917 + return ret;
7918 +}
7919 +
7920 +static phandle root_node;
7921 +
7922 +void __init prom_build_devicetree(void)
7923 +{
7924 + struct device_node **nextp;
7925 + u32 child;
7926 +
7927 + if (ofw("peer", 1, 1, 0, &root_node)) {
7928 + printk(KERN_ERR "PROM: unable to get root node from OFW!\n");
7929 + return;
7930 + }
7931 +
7932 + allnodes = create_node(root_node, NULL);
7933 + allnodes->path_component_name = "";
7934 + allnodes->full_name = "/";
7935 +
7936 + nextp = &allnodes->allnext;
7937 + if (ofw("child", 1, 1, allnodes->node, &child)) {
7938 + printk(KERN_ERR "PROM: unable to get child node from OFW!\n");
7939 + return;
7940 + }
7941 + allnodes->child = build_tree(allnodes, child, &nextp);
7942 + printk("PROM: Built device tree with %u bytes of memory.\n",
7943 + prom_early_allocated);
7944 +}
7945 diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
7946 index d474cd6..c4b26ba 100644
7947 --- a/arch/i386/kernel/setup.c
7948 +++ b/arch/i386/kernel/setup.c
7949 @@ -362,8 +362,10 @@ void __init zone_sizes_init(void)
7950 {
7951 unsigned long max_zone_pfns[MAX_NR_ZONES];
7952 memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
7953 +#ifdef CONFIG_ZONE_DMA
7954 max_zone_pfns[ZONE_DMA] =
7955 virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
7956 +#endif
7957 max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
7958 #ifdef CONFIG_HIGHMEM
7959 max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;
7960 @@ -428,6 +430,9 @@ void __init setup_bootmem_allocator(void)
7961 */
7962 acpi_reserve_bootmem();
7963 #endif
7964 +#ifdef CONFIG_OLPC_PM
7965 + reserve_bootmem(0xf0000, PAGE_SIZE);
7966 +#endif
7967 #ifdef CONFIG_X86_FIND_SMP_CONFIG
7968 /*
7969 * Find and reserve possible boot-time SMP configuration:
7970 diff --git a/arch/i386/pci/Makefile b/arch/i386/pci/Makefile
7971 index 44650e0..1250a7b 100644
7972 --- a/arch/i386/pci/Makefile
7973 +++ b/arch/i386/pci/Makefile
7974 @@ -3,6 +3,7 @@ obj-y := i386.o init.o
7975 obj-$(CONFIG_PCI_BIOS) += pcbios.o
7976 obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o mmconfig-shared.o
7977 obj-$(CONFIG_PCI_DIRECT) += direct.o
7978 +obj-$(CONFIG_PCI_OLPC) += olpc.o
7979
7980 pci-y := fixup.o
7981 pci-$(CONFIG_ACPI) += acpi.o
7982 diff --git a/arch/i386/pci/init.c b/arch/i386/pci/init.c
7983 index 3de9f9b..0f5f7dd 100644
7984 --- a/arch/i386/pci/init.c
7985 +++ b/arch/i386/pci/init.c
7986 @@ -14,6 +14,9 @@ static __init int pci_access_init(void)
7987 #ifdef CONFIG_PCI_MMCONFIG
7988 pci_mmcfg_init(type);
7989 #endif
7990 +#ifdef CONFIG_PCI_OLPC
7991 + pci_olpc_init();
7992 +#endif
7993 if (raw_pci_ops)
7994 return 0;
7995 #ifdef CONFIG_PCI_BIOS
7996 diff --git a/arch/i386/pci/olpc.c b/arch/i386/pci/olpc.c
7997 new file mode 100644
7998 index 0000000..1518d25
7999 --- /dev/null
8000 +++ b/arch/i386/pci/olpc.c
8001 @@ -0,0 +1,298 @@
8002 +/*
8003 + * olpcpci.c - Low-level PCI config space access for OLPC systems
8004 + * without the VSA PCI virtualization software.
8005 + *
8006 + * The AMD Geode chipset (GX2 processor, cs5536 I/O companion device)
8007 + * has some I/O functions (display, southbridge, sound, USB HCIs, etc)
8008 + * that more or less behave like PCI devices, but the hardware doesn't
8009 + * directly implement the PCI configuration space headers. AMD provides
8010 + * "VSA" (Virtual System Architecture) software that emulates PCI config
8011 + * space for these devices, by trapping I/O accesses to PCI config register
8012 + * (CF8/CFC) and running some code in System Management Mode interrupt state.
8013 + * On the OLPC platform, we don't want to use that VSA code because
8014 + * (a) it slows down suspend/resume, and (b) recompiling it requires special
8015 + * compilers that are hard to get. So instead of letting the complex VSA
8016 + * code simulate the PCI config registers for the on-chip devices, we
8017 + * just simulate them the easy way, by inserting the code into the
8018 + * pci_write_config and pci_read_config path. Most of the config registers
8019 + * are read-only anyway, so the bulk of the simulation is just table lookup.
8020 + */
8021 +
8022 +#include <linux/pci.h>
8023 +#include <linux/init.h>
8024 +#include <asm/olpc.h>
8025 +#include <asm/geode.h>
8026 +#include "pci.h"
8027 +
8028 +static int is_lx;
8029 +
8030 +/*
8031 + * In the tables below, the first two line (8 longwords) are the
8032 + * size masks that are used when the higher level PCI code determines
8033 + * the size of the region by writing ~0 to a base address register
8034 + * and reading back the result.
8035 + *
8036 + * The following lines are the values that are read during normal
8037 + * PCI config access cycles, i.e. not after just having written
8038 + * ~0 to a base address register.
8039 + */
8040 +
8041 +static const u32 lxnb_hdr[] = { /* dev 1 function 0 - devfn = 8 */
8042 + 0x0 , 0x0 , 0x0 , 0x0 ,
8043 + 0x0 , 0x0 , 0x0 , 0x0 ,
8044 +
8045 + 0x281022 , 0x2200005 , 0x6000021 , 0x80f808 , /* AMD Vendor ID */
8046 + 0x0 , 0x0 , 0x0 , 0x0 , /* No virtual registers, hence no BAR for them */
8047 + 0x0 , 0x0 , 0x0 , 0x28100b ,
8048 + 0x0 , 0x0 , 0x0 , 0x0 ,
8049 + 0x0 , 0x0 , 0x0 , 0x0 ,
8050 + 0x0 , 0x0 , 0x0 , 0x0 ,
8051 + 0x0 , 0x0 , 0x0 , 0x0 ,
8052 +};
8053 +
8054 +static const u32 gxnb_hdr[] = { /* dev 1 function 0 - devfn = 8 */
8055 + 0xfffffffd , 0x0 , 0x0 , 0x0 ,
8056 + 0x0 , 0x0 , 0x0 , 0x0 ,
8057 +
8058 + 0x28100b , 0x2200005 , 0x6000021 , 0x80f808 , /* NSC Vendor ID */
8059 + 0xac1d , 0x0 , 0x0 , 0x0 , /* I/O BAR - base of virtual registers */
8060 + 0x0 , 0x0 , 0x0 , 0x28100b ,
8061 + 0x0 , 0x0 , 0x0 , 0x0 ,
8062 + 0x0 , 0x0 , 0x0 , 0x0 ,
8063 + 0x0 , 0x0 , 0x0 , 0x0 ,
8064 + 0x0 , 0x0 , 0x0 , 0x0 ,
8065 +};
8066 +
8067 +static const u32 lxfb_hdr[] = { /* dev 1 function 1 - devfn = 9 */
8068 + 0xff800008 , 0xffffc000 , 0xffffc000 , 0xffffc000 ,
8069 + 0x0 , 0x0 , 0x0 , 0x0 ,
8070 +
8071 + 0x20811022 , 0x2200003 , 0x3000000 , 0x0 , /* AMD Vendor ID */
8072 + 0xfd000000 , 0xfe000000 , 0xfe004000 , 0xfe008000 , /* FB, GP, VG, DF */
8073 + 0xfe00c000 , 0x0 , 0x0 , 0x30100b , /* VIP */
8074 + 0x0 , 0x0 , 0x0 , 0x10e , /* INTA, IRQ14 for graphics accel */
8075 + 0x0 , 0x0 , 0x0 , 0x0 ,
8076 + 0x3d0 , 0x3c0 , 0xa0000 , 0x0 , /* VG IO, VG IO, EGA FB, MONO FB */
8077 + 0x0 , 0x0 , 0x0 , 0x0 ,
8078 +};
8079 +
8080 +static const u32 gxfb_hdr[] = { /* dev 1 function 1 - devfn = 9 */
8081 + 0xff800008 , 0xffffc000 , 0xffffc000 , 0xffffc000 ,
8082 + 0x0 , 0x0 , 0x0 , 0x0 ,
8083 +
8084 + 0x30100b , 0x2200003 , 0x3000000 , 0x0 , /* NSC Vendor ID */
8085 + 0xfd000000 , 0xfe000000 , 0xfe004000 , 0xfe008000 , /* FB, GP, VG, DF */
8086 + 0x0 , 0x0 , 0x0 , 0x30100b ,
8087 + 0x0 , 0x0 , 0x0 , 0x0 ,
8088 + 0x0 , 0x0 , 0x0 , 0x0 ,
8089 + 0x3d0 , 0x3c0 , 0xa0000 , 0x0 , /* VG IO, VG IO, EGA FB, MONO FB */
8090 + 0x0 , 0x0 , 0x0 , 0x0 ,
8091 +};
8092 +
8093 +static const u32 aes_hdr[] = { /* dev 1 function 2 - devfn = 0xa */
8094 + 0xffffc000 , 0x0 , 0x0 , 0x0 ,
8095 + 0x0 , 0x0 , 0x0 , 0x0 ,
8096 +
8097 + 0x20821022 , 0x2a00006 , 0x10100000 , 0x8 , /* NSC Vendor ID */
8098 + 0xfe010000 , 0x0 , 0x0 , 0x0 , /* AES registers */
8099 + 0x0 , 0x0 , 0x0 , 0x20821022 ,
8100 + 0x0 , 0x0 , 0x0 , 0x0 ,
8101 + 0x0 , 0x0 , 0x0 , 0x0 ,
8102 + 0x0 , 0x0 , 0x0 , 0x0 ,
8103 + 0x0 , 0x0 , 0x0 , 0x0 ,
8104 +};
8105 +
8106 +
8107 +static const u32 isa_hdr[] = { /* dev f function 0 - devfn = 78 */
8108 + 0xfffffff9 , 0xffffff01 , 0xffffffc1 , 0xffffffe1 ,
8109 + 0xffffff81 , 0xffffffc1 , 0x0 , 0x0 ,
8110 +
8111 + 0x20901022 , 0x2a00049 , 0x6010003 , 0x802000 ,
8112 + 0x18b1 , 0x1001 , 0x1801 , 0x1881 , /* SMB-8 GPIO-256 MFGPT-64 IRQ-32 */
8113 + 0x1401 , 0x1841 , 0x0 , 0x20901022 , /* PMS-128 ACPI-64 */
8114 + 0x0 , 0x0 , 0x0 , 0x0 ,
8115 + 0x0 , 0x0 , 0x0 , 0x0 ,
8116 + 0x0 , 0x0 , 0x0 , 0xaa5b , /* interrupt steering */
8117 + 0x0 , 0x0 , 0x0 , 0x0 ,
8118 +};
8119 +
8120 +static const u32 ac97_hdr[] = { /* dev f function 3 - devfn = 7b */
8121 + 0xffffff81 , 0x0 , 0x0 , 0x0 ,
8122 + 0x0 , 0x0 , 0x0 , 0x0 ,
8123 +
8124 + 0x20931022 , 0x2a00041 , 0x4010001 , 0x0 ,
8125 + 0x1481 , 0x0 , 0x0 , 0x0 , /* I/O BAR-128 */
8126 + 0x0 , 0x0 , 0x0 , 0x20931022 ,
8127 + 0x0 , 0x0 , 0x0 , 0x205 , /* IntB , IRQ5 */
8128 + 0x0 , 0x0 , 0x0 , 0x0 ,
8129 + 0x0 , 0x0 , 0x0 , 0x0 ,
8130 + 0x0 , 0x0 , 0x0 , 0x0 ,
8131 +};
8132 +
8133 +static const u32 ohci_hdr[] = { /* dev f function 4 - devfn = 7c */
8134 + 0xfffff000 , 0x0 , 0x0 , 0x0 ,
8135 + 0x0 , 0x0 , 0x0 , 0x0 ,
8136 +
8137 + 0x20941022 , 0x2300006 , 0xc031002 , 0x0 ,
8138 + 0xfe01a000 , 0x0 , 0x0 , 0x0 , /* MEMBAR-1000 */
8139 + 0x0 , 0x0 , 0x0 , 0x20941022 ,
8140 + 0x0 , 0x40 , 0x0 , 0x40a , /* CapPtr INT-D, IRQ A */
8141 + 0xc8020001 , 0x0 , 0x0 , 0x0 , /* Capabilities - 40 is R/O, 44 is mask 8103 (power control) */
8142 + 0x0 , 0x0 , 0x0 , 0x0 ,
8143 + 0x0 , 0x0 , 0x0 , 0x0 ,
8144 +};
8145 +
8146 +static const u32 ehci_hdr[] = { /* dev f function 4 - devfn = 7d */
8147 + 0xfffff000 , 0x0 , 0x0 , 0x0 ,
8148 + 0x0 , 0x0 , 0x0 , 0x0 ,
8149 +
8150 + 0x20951022 , 0x2300006 , 0xc032002 , 0x0 ,
8151 + 0xfe01b000 , 0x0 , 0x0 , 0x0 , /* MEMBAR-1000 */
8152 + 0x0 , 0x0 , 0x0 , 0x20951022 ,
8153 + 0x0 , 0x40 , 0x0 , 0x40a , /* CapPtr INT-D, IRQ A */
8154 + 0xc8020001 , 0x0 , 0x0 , 0x0 , /* Capabilities - 40 is R/O, 44 is mask 8103 (power control) */
8155 +#if 0
8156 + 0x1 , 0x40080000 , 0x0 , 0x0 , /* EECP - see section 2.1.7 of EHCI spec */
8157 +#endif
8158 + 0x01000001 , 0x00000000 , 0x0 , 0x0 , /* EECP - see section 2.1.7 of EHCI spec */
8159 + 0x2020 , 0x0 , 0x0 , 0x0 , /* (EHCI page 8) 60 SBRN (R/O), 61 FLADJ (R/W), PORTWAKECAP */
8160 +};
8161 +
8162 +static u32 ff_loc = ~0;
8163 +static u32 zero_loc = 0;
8164 +
8165 +static int bar_probing = 0; /* Set after a write of ~0 to a BAR */
8166 +
8167 +#define NB_SLOT 0x1 /* Northbridge - GX chip - Device 1 */
8168 +#define SB_SLOT 0xf /* Southbridge - CS5536 chip - Device F */
8169 +#define SIMULATED(bus, devfn) (((bus) == 0) && ((PCI_SLOT(devfn) == NB_SLOT) || (PCI_SLOT(devfn) == SB_SLOT)))
8170 +
8171 +static u32 *hdr_addr(const u32 *hdr, int reg)
8172 +{
8173 + u32 addr;
8174 +
8175 + /*
8176 + * This is a little bit tricky. The header maps consist of
8177 + * 0x20 bytes of size masks, followed by 0x70 bytes of header data.
8178 + * In the normal case, when not probing a BAR's size, we want
8179 + * to access the header data, so we add 0x20 to the reg offset,
8180 + * thus skipping the size mask area.
8181 + * In the BAR probing case, we want to access the size mask for
8182 + * the BAR, so we subtract 0x10 (the config header offset for
8183 + * BAR0), and don't skip the size mask area.
8184 + */
8185 +
8186 + addr = (u32)hdr + reg + (bar_probing ? -0x10 : 0x20);
8187 +
8188 + bar_probing = 0;
8189 + return (u32 *)addr;
8190 +}
8191 +
8192 +static int pci_olpc_read(unsigned int seg, unsigned int bus,
8193 + unsigned int devfn, int reg, int len, u32 *value)
8194 +{
8195 + u32 *addr;
8196 +
8197 + /* Use the hardware mechanism for non-simulated devices */
8198 + if (!SIMULATED(bus, devfn))
8199 + return pci_conf1_read(seg, bus, devfn, reg, len, value);
8200 +
8201 + /*
8202 + * No device has config registers past 0x70, so we save table space
8203 + * by not storing entries for the nonexistent registers
8204 + */
8205 + if (reg >= 0x70)
8206 + addr = &zero_loc;
8207 + else {
8208 + switch (devfn) {
8209 + case 0x8:
8210 + addr = hdr_addr(is_lx ? lxnb_hdr : gxnb_hdr, reg);
8211 + break;
8212 + case 0x9:
8213 + addr = hdr_addr(is_lx ? lxfb_hdr : gxfb_hdr, reg);
8214 + break;
8215 + case 0xa:
8216 + addr = is_lx ? hdr_addr(aes_hdr, reg) : &ff_loc;
8217 + break;
8218 + case 0x78:
8219 + addr = hdr_addr(isa_hdr, reg);
8220 + break;
8221 + case 0x7b:
8222 + addr = hdr_addr(ac97_hdr, reg);
8223 + break;
8224 + case 0x7c:
8225 + addr = hdr_addr(ohci_hdr, reg);
8226 + break;
8227 + case 0x7d:
8228 + addr = hdr_addr(ehci_hdr, reg);
8229 + break;
8230 + default:
8231 + addr = &ff_loc;
8232 + break;
8233 + }
8234 + }
8235 + switch (len) {
8236 + case 1:
8237 + *value = *(u8 *) addr;
8238 + break;
8239 + case 2:
8240 + *value = *(u16 *) addr;
8241 + break;
8242 + case 4:
8243 + *value = *addr;
8244 + break;
8245 + default:
8246 + BUG();
8247 + }
8248 +
8249 + return 0;
8250 +}
8251 +
8252 +static int pci_olpc_write(unsigned int seg, unsigned int bus,
8253 + unsigned int devfn, int reg, int len, u32 value)
8254 +{
8255 + /* Use the hardware mechanism for non-simulated devices */
8256 + if (!SIMULATED(bus, devfn))
8257 + return pci_conf1_write(seg, bus, devfn, reg, len, value);
8258 +
8259 + /* XXX we may want to extend this to simulate EHCI power management */
8260 +
8261 + /*
8262 + * Mostly we just discard writes, but if the write is a size probe
8263 + * (i.e. writing ~0 to a BAR), we remember it and arrange to return
8264 + * the appropriate size mask on the next read. This is cheating
8265 + * to some extent, because it depends on the fact that the next
8266 + * access after such a write will always be a read to the same BAR.
8267 + */
8268 +
8269 + if ((reg >= 0x10) && (reg < 0x2c)) {
8270 + /* Write is to a BAR */
8271 + if (value == ~0)
8272 + bar_probing = 1;
8273 + } else {
8274 + /*
8275 + * No warning on writes to ROM BAR, CMD, LATENCY_TIMER,
8276 + * CACHE_LINE_SIZE, or PM registers.
8277 + */
8278 + if ((reg != 0x30) && (reg != 0x04) && (reg != 0x0d) &&
8279 + (reg != 0x0c) && (reg != 0x44))
8280 + printk(KERN_WARNING "OLPC PCI: Config write to devfn %x reg %x value %x\n", devfn, reg, value);
8281 + }
8282 +
8283 + return 0;
8284 +}
8285 +
8286 +static struct pci_raw_ops pci_olpc_conf = {
8287 + .read = pci_olpc_read,
8288 + .write = pci_olpc_write,
8289 +};
8290 +
8291 +void __init pci_olpc_init(void)
8292 +{
8293 + if (!machine_is_olpc() || olpc_has_vsa())
8294 + return;
8295 +
8296 + printk(KERN_INFO "PCI: Using configuration type OLPC\n");
8297 + raw_pci_ops = &pci_olpc_conf;
8298 + is_lx = is_geode_lx();
8299 +}
8300 diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h
8301 index 8c66f27..a67e617 100644
8302 --- a/arch/i386/pci/pci.h
8303 +++ b/arch/i386/pci/pci.h
8304 @@ -93,6 +93,7 @@ extern void pci_direct_init(int type);
8305 extern void pci_pcbios_init(void);
8306 extern void pci_mmcfg_init(int type);
8307 extern void pcibios_sort(void);
8308 +extern void pci_olpc_init(void);
8309
8310 /* pci-mmconfig.c */
8311
8312 diff --git a/drivers/Makefile b/drivers/Makefile
8313 index f0878b2..c033d30 100644
8314 --- a/drivers/Makefile
8315 +++ b/drivers/Makefile
8316 @@ -23,6 +23,8 @@ obj-y += char/
8317
8318 obj-$(CONFIG_CONNECTOR) += connector/
8319
8320 +obj-$(CONFIG_SYSPROF) += sysprof/
8321 +
8322 # i810fb and intelfb depend on char/agp/
8323 obj-$(CONFIG_FB_I810) += video/i810/
8324 obj-$(CONFIG_FB_INTEL) += video/intelfb/
8325 diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
8326 index c6f6f42..55ae42c 100644
8327 --- a/drivers/char/vt_ioctl.c
8328 +++ b/drivers/char/vt_ioctl.c
8329 @@ -37,6 +37,9 @@
8330 char vt_dont_switch;
8331 extern struct tty_driver *console_driver;
8332
8333 +/* Add a notifier chain to inform drivers of a VT_TEXT/VT_GRAPHICS switch */
8334 +RAW_NOTIFIER_HEAD(console_notifier_list);
8335 +
8336 #define VT_IS_IN_USE(i) (console_driver->ttys[i] && console_driver->ttys[i]->count)
8337 #define VT_BUSY(i) (VT_IS_IN_USE(i) || i == fg_console || vc_cons[i].d == sel_cons)
8338
8339 @@ -491,6 +494,14 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
8340 vc->vc_mode = (unsigned char) arg;
8341 if (console != fg_console)
8342 return 0;
8343 +
8344 + /* Notify listeners if the current fg_console has switched */
8345 +
8346 + raw_notifier_call_chain(&console_notifier_list,
8347 + (arg == KD_TEXT) ?
8348 + CONSOLE_EVENT_SWITCH_TEXT :
8349 + CONSOLE_EVENT_SWITCH_GRAPHICS, 0);
8350 +
8351 /*
8352 * explicitly blank/unblank the screen if switching modes
8353 */
8354 diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
8355 index e6c4a2b..874d623 100644
8356 --- a/drivers/i2c/busses/scx200_acb.c
8357 +++ b/drivers/i2c/busses/scx200_acb.c
8358 @@ -46,6 +46,10 @@ static int base[MAX_DEVICES] = { 0x820, 0x840 };
8359 module_param_array(base, int, NULL, 0);
8360 MODULE_PARM_DESC(base, "Base addresses for the ACCESS.bus controllers");
8361
8362 +static unsigned int smbclk = 0x70;
8363 +module_param(smbclk, uint, 0);
8364 +MODULE_PARM_DESC(smbclk, "Specify the SMB_CLK value");
8365 +
8366 #define POLL_TIMEOUT (HZ/5)
8367
8368 enum scx200_acb_state {
8369 @@ -108,6 +112,7 @@ struct scx200_acb_iface {
8370 #define ACBADDR (iface->base + 4)
8371 #define ACBCTL2 (iface->base + 5)
8372 #define ACBCTL2_ENABLE 0x01
8373 +#define ACBCTL3 (iface->base + 6)
8374
8375 /************************************************************************/
8376
8377 @@ -392,11 +397,13 @@ static __init int scx200_acb_probe(struct scx200_acb_iface *iface)
8378 {
8379 u8 val;
8380
8381 - /* Disable the ACCESS.bus device and Configure the SCL
8382 - frequency: 16 clock cycles */
8383 - outb(0x70, ACBCTL2);
8384 + /* Disable the ACCESS.bus device and Configure the SCL */
8385 +
8386 + outb((smbclk & 0x7F) << 1, ACBCTL2);
8387 +
8388 + outb((smbclk >> 7) & 0xFF, ACBCTL3);
8389
8390 - if (inb(ACBCTL2) != 0x70) {
8391 + if (inb(ACBCTL2) != ((smbclk & 0x7F) << 1)) {
8392 pr_debug(NAME ": ACBCTL2 readback failed\n");
8393 return -ENXIO;
8394 }
8395 diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
8396 index 41fc3d0..a15e7a9 100644
8397 --- a/drivers/input/keyboard/atkbd.c
8398 +++ b/drivers/input/keyboard/atkbd.c
8399 @@ -63,12 +63,25 @@ static int atkbd_extra;
8400 module_param_named(extra, atkbd_extra, bool, 0);
8401 MODULE_PARM_DESC(extra, "Enable extra LEDs and keys on IBM RapidAcces, EzKey and similar keyboards");
8402
8403 +#define ATKBD_KEY_UNKNOWN 0
8404 +#define ATKBD_KEY_NULL 0xFF0000FF
8405 +
8406 +#define ATKBD_SCR_1 0xFF0000FE
8407 +#define ATKBD_SCR_2 0xFF0000FD
8408 +#define ATKBD_SCR_4 0xFF0000FC
8409 +#define ATKBD_SCR_8 0xFF0000FB
8410 +#define ATKBD_SCR_CLICK 0xFF0000FA
8411 +#define ATKBD_SCR_LEFT 0xFF0000F9
8412 +#define ATKBD_SCR_RIGHT 0xFF0000F8
8413 +
8414 +#define ATKBD_SPECIAL 0xFF0000F8
8415 +
8416 /*
8417 * Scancode to keycode tables. These are just the default setting, and
8418 * are loadable via an userland utility.
8419 */
8420
8421 -static unsigned char atkbd_set2_keycode[512] = {
8422 +static unsigned int atkbd_set2_keycode[512] = {
8423
8424 #ifdef CONFIG_KEYBOARD_ATKBD_HP_KEYCODES
8425
8426 @@ -87,11 +100,17 @@ static unsigned char atkbd_set2_keycode[512] = {
8427 82, 83, 80, 76, 77, 72, 1, 69, 87, 78, 81, 74, 55, 73, 70, 99,
8428
8429 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8430 - 217,100,255, 0, 97,165, 0, 0,156, 0, 0, 0, 0, 0, 0,125,
8431 +
8432 + 217,100,ATKBD_KEY_NULL, 0, 97,165, 0, 0,
8433 + 156, 0, 0, 0, 0, 0, 0,125,
8434 +
8435 173,114, 0,113, 0, 0, 0,126,128, 0, 0,140, 0, 0, 0,127,
8436 159, 0,115, 0,164, 0, 0,116,158, 0,172,166, 0, 0, 0,142,
8437 157, 0, 0, 0, 0, 0, 0, 0,155, 0, 98, 0, 0,163, 0, 0,
8438 - 226, 0, 0, 0, 0, 0, 0, 0, 0,255, 96, 0, 0, 0,143, 0,
8439 +
8440 + 226, 0, 0, 0, 0, 0, 0, 0,
8441 + 0,ATKBD_KEY_NULL, 96, 0, 0, 0,143, 0,
8442 +
8443 0, 0, 0, 0, 0, 0, 0, 0, 0,107, 0,105,102, 0, 0,112,
8444 110,111,108,112,106,103, 0,119, 0,118,109, 0, 99,104,119, 0,
8445
8446 @@ -150,19 +169,6 @@ static unsigned char atkbd_unxlate_table[128] = {
8447 #define ATKBD_RET_HANGEUL 0xf2
8448 #define ATKBD_RET_ERR 0xff
8449
8450 -#define ATKBD_KEY_UNKNOWN 0
8451 -#define ATKBD_KEY_NULL 255
8452 -
8453 -#define ATKBD_SCR_1 254
8454 -#define ATKBD_SCR_2 253
8455 -#define ATKBD_SCR_4 252
8456 -#define ATKBD_SCR_8 251
8457 -#define ATKBD_SCR_CLICK 250
8458 -#define ATKBD_SCR_LEFT 249
8459 -#define ATKBD_SCR_RIGHT 248
8460 -
8461 -#define ATKBD_SPECIAL 248
8462 -
8463 #define ATKBD_LED_EVENT_BIT 0
8464 #define ATKBD_REP_EVENT_BIT 1
8465
8466 @@ -174,7 +180,7 @@ static unsigned char atkbd_unxlate_table[128] = {
8467 #define ATKBD_XL_HANJA 0x20
8468
8469 static struct {
8470 - unsigned char keycode;
8471 + unsigned int keycode;
8472 unsigned char set2;
8473 } atkbd_scroll_keys[] = {
8474 { ATKBD_SCR_1, 0xc5 },
8475 @@ -200,7 +206,7 @@ struct atkbd {
8476 char phys[32];
8477
8478 unsigned short id;
8479 - unsigned char keycode[512];
8480 + unsigned int keycode[512];
8481 unsigned char set;
8482 unsigned char translated;
8483 unsigned char extra;
8484 @@ -351,7 +357,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
8485 unsigned int code = data;
8486 int scroll = 0, hscroll = 0, click = -1, add_release_event = 0;
8487 int value;
8488 - unsigned char keycode;
8489 + unsigned int keycode;
8490
8491 #ifdef ATKBD_DEBUG
8492 printk(KERN_DEBUG "atkbd.c: Received %02x flags %02x\n", data, flags);
8493 @@ -856,9 +862,11 @@ static void atkbd_set_keycode_table(struct atkbd *atkbd)
8494 atkbd->keycode[i | 0x80] = atkbd_scroll_keys[j].keycode;
8495 }
8496 } else if (atkbd->set == 3) {
8497 - memcpy(atkbd->keycode, atkbd_set3_keycode, sizeof(atkbd->keycode));
8498 + for (i = 0; i < ARRAY_SIZE(atkbd_set3_keycode); i++)
8499 + atkbd->keycode[i] = atkbd_set3_keycode[i];
8500 } else {
8501 - memcpy(atkbd->keycode, atkbd_set2_keycode, sizeof(atkbd->keycode));
8502 + for (i = 0; i < ARRAY_SIZE(atkbd_set2_keycode); i++)
8503 + atkbd->keycode[i] = atkbd_set2_keycode[i];
8504
8505 if (atkbd->scroll)
8506 for (i = 0; i < ARRAY_SIZE(atkbd_scroll_keys); i++)
8507 @@ -925,8 +933,8 @@ static void atkbd_set_device_attrs(struct atkbd *atkbd)
8508 }
8509
8510 input_dev->keycode = atkbd->keycode;
8511 - input_dev->keycodesize = sizeof(unsigned char);
8512 - input_dev->keycodemax = ARRAY_SIZE(atkbd_set2_keycode);
8513 + input_dev->keycodesize = sizeof(unsigned int);
8514 + input_dev->keycodemax = ARRAY_SIZE(atkbd->keycode);
8515
8516 for (i = 0; i < 512; i++)
8517 if (atkbd->keycode[i] && atkbd->keycode[i] < ATKBD_SPECIAL)
8518 @@ -1017,6 +1025,10 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv)
8519 return err;
8520 }
8521
8522 +#ifdef CONFIG_OLPC
8523 +#include <asm/olpc.h>
8524 +#endif
8525 +
8526 /*
8527 * atkbd_reconnect() tries to restore keyboard into a sane state and is
8528 * most likely called on resume.
8529 @@ -1027,6 +1039,12 @@ static int atkbd_reconnect(struct serio *serio)
8530 struct atkbd *atkbd = serio_get_drvdata(serio);
8531 struct serio_driver *drv = serio->drv;
8532
8533 +#ifdef CONFIG_OLPC
8534 + if (olpc_rev_after(OLPC_REV_B2))
8535 + if (serio->dev.power.power_state.event != PM_EVENT_ON)
8536 + return 0;
8537 +#endif
8538 +
8539 if (!atkbd || !drv) {
8540 printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n");
8541 return -1;
8542 diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
8543 index 7bbea09..6febbc5 100644
8544 --- a/drivers/input/mouse/Kconfig
8545 +++ b/drivers/input/mouse/Kconfig
8546 @@ -96,6 +96,16 @@ config MOUSE_PS2_TOUCHKIT
8547
8548 If unsure, say N.
8549
8550 +config MOUSE_PS2_OLPC
8551 + bool "OLPC PS/2 mouse protocol extension" if EMBEDDED
8552 + default n
8553 + depends on MOUSE_PS2 && OLPC
8554 + ---help---
8555 + Say Y here if you have an OLPC PS/2 touchpad connected to
8556 + your system.
8557 +
8558 + If unsure, say N.
8559 +
8560 config MOUSE_SERIAL
8561 tristate "Serial mouse"
8562 select SERIO
8563 diff --git a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
8564 index 9e6e363..f4654ce 100644
8565 --- a/drivers/input/mouse/Makefile
8566 +++ b/drivers/input/mouse/Makefile
8567 @@ -24,3 +24,4 @@ psmouse-$(CONFIG_MOUSE_PS2_LOGIPS2PP) += logips2pp.o
8568 psmouse-$(CONFIG_MOUSE_PS2_LIFEBOOK) += lifebook.o
8569 psmouse-$(CONFIG_MOUSE_PS2_TRACKPOINT) += trackpoint.o
8570 psmouse-$(CONFIG_MOUSE_PS2_TOUCHKIT) += touchkit_ps2.o
8571 +psmouse-$(CONFIG_MOUSE_PS2_OLPC) += olpc.o
8572 diff --git a/drivers/input/mouse/olpc.c b/drivers/input/mouse/olpc.c
8573 new file mode 100644
8574 index 0000000..dc575ac
8575 --- /dev/null
8576 +++ b/drivers/input/mouse/olpc.c
8577 @@ -0,0 +1,554 @@
8578 +/*
8579 + * OLPC touchpad PS/2 mouse driver
8580 + *
8581 + * Copyright (c) 2006 One Laptop Per Child, inc.
8582 + * Authors Zephaniah E. Hull and Andres Salomon <dilinger@laptop.org>
8583 + *
8584 + * This driver is partly based on the ALPS driver, which is:
8585 + *
8586 + * Copyright (c) 2003 Neil Brown <neilb@cse.unsw.edu.au>
8587 + * Copyright (c) 2003-2005 Peter Osterlund <petero2@telia.com>
8588 + * Copyright (c) 2004 Dmitry Torokhov <dtor@mail.ru>
8589 + * Copyright (c) 2005 Vojtech Pavlik <vojtech@suse.cz>
8590 + *
8591 + * This program is free software; you can redistribute it and/or modify
8592 + * it under the terms of the GNU General Public License version 2 as
8593 + * published by the Free Software Foundation.
8594 + */
8595 +
8596 +/*
8597 + * The touchpad on the OLPC is fairly wide, with the entire area usable
8598 + * as a tablet ("PT mode"), and the center 1/3rd also usable as a touchpad
8599 + * ("GS mode").
8600 + *
8601 + * Earlier version of the device had simultaneous reporting; however, that
8602 + * was removed. Instead, the device now reports packets in one mode, and
8603 + * tells the driver when a mode switch needs to happen.
8604 + */
8605 +
8606 +#include <linux/input.h>
8607 +#include <linux/serio.h>
8608 +#include <linux/libps2.h>
8609 +#include <linux/delay.h>
8610 +#include <asm/olpc.h>
8611 +
8612 +#include "psmouse.h"
8613 +#include "olpc.h"
8614 +
8615 +static int tpdebug;
8616 +module_param(tpdebug, int, 0644);
8617 +
8618 +#define OLPC_GS 1 /* The GS sensor. */
8619 +#define OLPC_PT 2 /* The PT sensor. */
8620 +
8621 +static struct olpc_model_info olpc_model_data[] = {
8622 + { { 0x67, 0x00, 0x00 }, OLPC_GS | OLPC_PT }, /* unknown ID */
8623 + { { 0x67, 0x00, 0x0a }, OLPC_GS | OLPC_PT }, /* pre-B1 */
8624 + { { 0x67, 0x00, 0x14 }, OLPC_GS }, /* B1.*/
8625 + { { 0x67, 0x00, 0x28 }, OLPC_GS | OLPC_PT }, /* B2 */
8626 + { { 0x67, 0x00, 0x3c }, OLPC_GS | OLPC_PT }, /* B2-2 */
8627 + { { 0x67, 0x00, 0x50 }, OLPC_GS | OLPC_PT }, /* C1 */
8628 +};
8629 +
8630 +#define OLPC_PKT_PT 0xcf
8631 +#define OLPC_PKT_GS 0xff
8632 +
8633 +static int olpc_absolute_mode(struct psmouse *psmouse, int mode);
8634 +
8635 +/*
8636 + * OLPC absolute Mode - single-mode format
8637 + *
8638 + * byte 0: 1 1 0 0 1 1 1 1
8639 + * byte 1: 0 x6 x5 x4 x3 x2 x1 x0
8640 + * byte 2(PT): 0 0 x9 x8 x7 ? pt-dsw gs-dsw
8641 + * byte 2(GS): 0 x10 x9 x8 x7 ? gs-dsw pt-dsw
8642 + * byte 3: 0 y9 y8 y7 1 0 swr swl
8643 + * byte 4: 0 y6 y5 y4 y3 y2 y1 y0
8644 + * byte 5: 0 z6 z5 z4 z3 z2 z1 z0
8645 + *
8646 + * ?'s are not defined in the protocol spec, may vary between models.
8647 + *
8648 + * swr/swl are the left/right buttons.
8649 + *
8650 + * pt-dsw/gs-dsw indicate that the pt/gs sensor is detecting a
8651 + * pen/finger
8652 + */
8653 +
8654 +static void olpc_process_packet_gspt(struct psmouse *psmouse)
8655 +{
8656 + struct olpc_data *priv = psmouse->private;
8657 + unsigned char *packet = psmouse->packet;
8658 + struct input_dev *dev = psmouse->dev;
8659 + struct input_dev *dev2 = priv->dev2;
8660 + int x, y, z, gs_down = 0, pt_down = 0, left, right;
8661 + struct timeval now_tv;
8662 + s64 now_ns;
8663 +
8664 + left = packet[3] & 1;
8665 + right = packet[3] & 2;
8666 + x = packet[1] | ((packet[2] & 0x78) << 4);
8667 + y = packet[4] | ((packet[3] & 0x70) << 3);
8668 + z = packet[5];
8669 +
8670 + if (psmouse->packet[0] == OLPC_PKT_GS) {
8671 + pt_down = !!(packet[2] & 1);
8672 + gs_down = !!(packet[2] & 2);
8673 + } else if (psmouse->packet[0] == OLPC_PKT_PT) {
8674 + gs_down = !!(packet[2] & 1);
8675 + pt_down = !!(packet[2] & 2);
8676 + }
8677 +
8678 + /*
8679 + * XXX: Kludge.
8680 + * If it's been more than 30ms since the last packet,
8681 + * assume that there was a lift we were never told about.
8682 + */
8683 + do_gettimeofday(&now_tv);
8684 + now_ns = timeval_to_ns (&now_tv);
8685 + if (now_ns >= priv->late) {
8686 + input_report_key(dev, BTN_TOUCH, 0);
8687 + input_report_key(dev, BTN_TOOL_PEN, 0);
8688 + input_report_key(dev2, BTN_TOUCH, 0);
8689 + input_report_key(dev2, BTN_TOOL_FINGER, 0);
8690 +
8691 + input_sync(dev);
8692 + input_sync(dev2);
8693 + }
8694 +
8695 + priv->late = now_ns + (30 * NSEC_PER_MSEC);
8696 +
8697 +
8698 + if (tpdebug) {
8699 + printk(KERN_DEBUG "%s %02x %02x %02x %02x %02x %02x\n",
8700 + __FUNCTION__, psmouse->packet[0], psmouse->packet[1],
8701 + psmouse->packet[2], psmouse->packet[3], psmouse->packet[4],
8702 + psmouse->packet[5]);
8703 + printk(KERN_DEBUG "l=%d r=%d p=%d g=%d x=%d y=%d z=%d\n",
8704 + left, right, pt_down, gs_down, x, y, z);
8705 + }
8706 +
8707 + if (psmouse->packet[0] == OLPC_PKT_PT) {
8708 + input_report_key(dev, BTN_LEFT, left);
8709 + input_report_key(dev, BTN_RIGHT, right);
8710 + } else if (psmouse->packet[0] == OLPC_PKT_GS) {
8711 + input_report_key(dev, BTN_LEFT, left);
8712 + input_report_key(dev, BTN_RIGHT, right);
8713 + input_report_key(dev2, BTN_LEFT, left);
8714 + input_report_key(dev2, BTN_RIGHT, right);
8715 + }
8716 +
8717 + input_report_key(dev, BTN_TOUCH, pt_down);
8718 + input_report_key(dev, BTN_TOOL_PEN, pt_down);
8719 + input_report_key(dev2, BTN_TOUCH, gs_down);
8720 + input_report_key(dev2, BTN_TOOL_FINGER, gs_down);
8721 +
8722 + input_report_abs(dev2, ABS_PRESSURE, z);
8723 +
8724 + if (psmouse->packet[0] == OLPC_PKT_PT && pt_down) {
8725 + input_report_abs(dev, ABS_X, x);
8726 + input_report_abs(dev, ABS_Y, y);
8727 + } else if (psmouse->packet[0] == OLPC_PKT_GS && gs_down) {
8728 + input_report_abs(dev2, ABS_X, x);
8729 + input_report_abs(dev2, ABS_Y, y);
8730 + }
8731 +
8732 + input_sync(dev);
8733 + input_sync(dev2);
8734 +
8735 + if (priv->pending_mode == OLPC_GS &&
8736 + psmouse->packet[0] == OLPC_PKT_PT && pt_down) {
8737 + priv->pending_mode = 0;
8738 + cancel_delayed_work(&priv->mode_switch);
8739 + }
8740 +
8741 + if (priv->i->flags & (OLPC_PT|OLPC_GS)) {
8742 + int pending = 0;
8743 + if (psmouse->packet[0] == OLPC_PKT_PT && !pt_down)
8744 + pending = OLPC_GS;
8745 + else if (psmouse->packet[0] == OLPC_PKT_GS && pt_down)
8746 + pending = OLPC_PT;
8747 +
8748 + if (priv->current_mode == pending) {
8749 + priv->pending_mode = 0;
8750 + pending = priv->current_mode;
8751 + }
8752 + else if (priv->pending_mode != pending) {
8753 + priv->pending_mode = pending;
8754 + if (tpdebug)
8755 + printk(KERN_WARNING "Scheduling mode switch to %s.\n",
8756 + pending == OLPC_GS ? "GS" : "PT");
8757 +
8758 + /*
8759 + * Apply a de-bounce when switching from PT to GS, to allow for
8760 + * spurious PT-up packets.
8761 + */
8762 + if (priv->pending_mode == OLPC_GS)
8763 + queue_delayed_work(kpsmoused_wq, &priv->mode_switch, msecs_to_jiffies(50));
8764 + else
8765 + queue_delayed_work(kpsmoused_wq, &priv->mode_switch, 0);
8766 + }
8767 + }
8768 +}
8769 +
8770 +static psmouse_ret_t olpc_process_byte(struct psmouse *psmouse)
8771 +{
8772 + psmouse_ret_t ret = PSMOUSE_BAD_DATA;
8773 +
8774 + if (psmouse->packet[0] != OLPC_PKT_PT &&
8775 + psmouse->packet[0] != OLPC_PKT_GS)
8776 + goto out;
8777 +
8778 + /* Bytes 2 - 6 should have 0 in the highest bit */
8779 + if (psmouse->pktcnt >= 2 && psmouse->pktcnt <= 6 &&
8780 + (psmouse->packet[psmouse->pktcnt - 1] & 0x80))
8781 + goto out;
8782 +
8783 + if (psmouse->pktcnt == 6) {
8784 + olpc_process_packet_gspt(psmouse);
8785 + ret = PSMOUSE_FULL_PACKET;
8786 + goto out;
8787 + }
8788 +
8789 + ret = PSMOUSE_GOOD_DATA;
8790 +out:
8791 + if (ret != PSMOUSE_GOOD_DATA && ret != PSMOUSE_FULL_PACKET)
8792 + printk(KERN_DEBUG "%s: (%d) %02x %02x %02x %02x %02x %02x\n",
8793 + __FUNCTION__, psmouse->pktcnt, psmouse->packet[0],
8794 + psmouse->packet[1], psmouse->packet[2],
8795 + psmouse->packet[3], psmouse->packet[4],
8796 + psmouse->packet[5]);
8797 + return ret;
8798 +}
8799 +
8800 +static struct olpc_model_info *olpc_get_model(struct psmouse *psmouse)
8801 +{
8802 + struct ps2dev *ps2dev = &psmouse->ps2dev;
8803 + unsigned char param[4];
8804 + int i;
8805 +
8806 + /*
8807 + * Now try "E7 report". Allowed responses are in
8808 + * olpc_model_data[].signature
8809 + */
8810 + if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) ||
8811 + ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) ||
8812 + ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21))
8813 + return NULL;
8814 +
8815 + param[0] = param[1] = param[2] = 0xff;
8816 + if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO))
8817 + return NULL;
8818 +
8819 + pr_debug("olpc.c(%d): E7 report: %2.2x %2.2x %2.2x",
8820 + __LINE__, param[0], param[1], param[2]);
8821 +
8822 + for (i = 0; i < ARRAY_SIZE(olpc_model_data); i++) {
8823 + if (!memcmp(param, olpc_model_data[i].signature,
8824 + sizeof(olpc_model_data[i].signature))) {
8825 + printk(KERN_INFO __FILE__ ": OLPC touchpad revision 0x%x.\n", param[2]);
8826 + return olpc_model_data + i;
8827 + }
8828 + }
8829 +
8830 + /*
8831 + * ALPS creates new IDs pretty frequently; rather than listing them
8832 + * all, just assume they support the defaults. We've set aside the
8833 + * first entry of olpc_model_data as the catch-all.
8834 + */
8835 + if (!memcmp(param, olpc_model_data[0].signature, 2)) {
8836 + printk(KERN_INFO __FILE__ ": unknown ALPS revision %x, assuming default flags.\n", param[2]);
8837 + return &olpc_model_data[0];
8838 + }
8839 +
8840 + return NULL;
8841 +}
8842 +
8843 +static int olpc_find_mode(struct psmouse *psmouse)
8844 +{
8845 + struct olpc_data *priv = psmouse->private;
8846 + int mode = priv->i->flags;
8847 +
8848 + if (mode & OLPC_GS)
8849 + mode = OLPC_GS;
8850 + else if (mode & OLPC_PT)
8851 + mode = OLPC_PT;
8852 + else
8853 + mode = -1;
8854 +
8855 + return mode;
8856 +}
8857 +
8858 +/*
8859 + * Touchpad should be disabled before calling this!
8860 + */
8861 +static int olpc_new_mode(struct psmouse *psmouse, int mode)
8862 +{
8863 + struct ps2dev *ps2dev = &psmouse->ps2dev;
8864 + struct olpc_data *priv = psmouse->private;
8865 + unsigned char param;
8866 + int ret;
8867 +
8868 + if (tpdebug)
8869 + printk(KERN_WARNING __FILE__ ": Switching to %d. [%lu]\n", mode, jiffies);
8870 +
8871 + if ((ret = ps2_command(ps2dev, &param, 0x01F2)))
8872 + goto failed;
8873 + if ((ret = ps2_command(ps2dev, &param, 0x01F2)))
8874 + goto failed;
8875 + if ((ret = ps2_command(ps2dev, &param, 0x01F2)))
8876 + goto failed;
8877 +
8878 + switch (mode) {
8879 + default:
8880 + printk(KERN_WARNING __FILE__ ": Invalid mode %d. Defaulting to OLPC_GS.\n", mode);
8881 + case OLPC_GS:
8882 + ret = ps2_command(ps2dev, NULL, 0xE6);
8883 + break;
8884 + case OLPC_PT:
8885 + ret = ps2_command(ps2dev, NULL, 0xE7);
8886 + break;
8887 + }
8888 + if (ret)
8889 + goto failed;
8890 +
8891 + /* XXX: This is a bit hacky, make sure this isn't screwing stuff up. */
8892 + psmouse->pktcnt = psmouse->out_of_sync = 0;
8893 + psmouse->last = jiffies;
8894 + psmouse->state = PSMOUSE_ACTIVATED;
8895 +
8896 + if ((ret = ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE)))
8897 + goto failed;
8898 +
8899 + priv->current_mode = mode;
8900 + priv->pending_mode = 0;
8901 + if (tpdebug)
8902 + printk(KERN_WARNING __FILE__ ": Switched to mode %d successful.\n", mode);
8903 +
8904 +failed:
8905 + if (ret)
8906 + printk(KERN_WARNING __FILE__ ": Mode switch to %d failed! (%d) [%lu]\n", mode, ret, jiffies);
8907 + return ret;
8908 +}
8909 +
8910 +static int olpc_absolute_mode(struct psmouse *psmouse, int mode)
8911 +{
8912 + struct ps2dev *ps2dev = &psmouse->ps2dev;
8913 +
8914 + /* Switch to 'Advanced mode.', four disables in a row. */
8915 + if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE) ||
8916 + ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE) ||
8917 + ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE) ||
8918 + ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE))
8919 + return -1;
8920 +
8921 + return olpc_new_mode(psmouse, mode);
8922 +}
8923 +
8924 +/*
8925 + * olpc_poll() - poll the touchpad for current motion packet.
8926 + * Used in resync.
8927 + * Note: We can't poll, so always return failure.
8928 + */
8929 +static int olpc_poll(struct psmouse *psmouse)
8930 +{
8931 + return -1;
8932 +}
8933 +
8934 +static int olpc_reconnect(struct psmouse *psmouse)
8935 +{
8936 + struct olpc_data *priv = psmouse->private;
8937 + int mode;
8938 +
8939 + if (olpc_rev_after(OLPC_REV_B2))
8940 + if (psmouse->ps2dev.serio->dev.power.power_state.event != PM_EVENT_ON)
8941 + return 0;
8942 +
8943 + psmouse_reset(psmouse);
8944 +
8945 + if (!(priv->i = olpc_get_model(psmouse)))
8946 + return -1;
8947 +
8948 + mode = olpc_find_mode(psmouse);
8949 + if (mode < 0)
8950 + return -1;
8951 +
8952 + if (olpc_absolute_mode(psmouse, mode)) {
8953 + printk(KERN_ERR __FILE__ ": Failed to reenable absolute mode.\n");
8954 + return -1;
8955 + }
8956 +
8957 + return 0;
8958 +}
8959 +
8960 +static void olpc_disconnect(struct psmouse *psmouse)
8961 +{
8962 + struct olpc_data *priv = psmouse->private;
8963 +
8964 + psmouse_reset(psmouse);
8965 + input_unregister_device(priv->dev2);
8966 + kfree(priv);
8967 +}
8968 +
8969 +static void olpc_mode_switch(struct work_struct *w)
8970 +{
8971 + struct delayed_work *work = container_of(w, struct delayed_work, work);
8972 + struct olpc_data *priv = container_of(work, struct olpc_data, mode_switch);
8973 + struct psmouse *psmouse = priv->psmouse;
8974 + struct ps2dev *ps2dev = &psmouse->ps2dev;
8975 + int pending_mode, ret;
8976 +
8977 + if (priv->pending_mode == priv->current_mode) {
8978 + priv->pending_mode = 0;
8979 + printk (KERN_DEBUG __FILE__ ": In switch_mode, no target mode.\n");
8980 + return;
8981 + }
8982 +
8983 + if (tpdebug)
8984 + printk(KERN_WARNING __FILE__ ": Disable for switch to %d. [%lu]\n", priv->pending_mode, jiffies);
8985 +
8986 + /* XXX: This is a bit hacky, make sure this isn't screwing stuff up. */
8987 + psmouse->state = PSMOUSE_INITIALIZING;
8988 +
8989 + ret = ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE);
8990 + if (ret) {
8991 + /* XXX: if this ever fails, we need to do a full reset! */
8992 + printk(KERN_WARNING __FILE__ ": Disable failed for switch to %d. (%d) [%lu]\n", priv->pending_mode, ret, jiffies);
8993 + return;
8994 + }
8995 +
8996 + /*
8997 + * ALPS tells us that it may take up to 20msec for the disable to
8998 + * take effect; however, ps2_command() will wait up to 200msec for
8999 + * the ACK to come back (and I'm assuming that by the time the
9000 + * hardware sends back its ACK, it has stopped sending bytes).
9001 + */
9002 + pending_mode = priv->pending_mode;
9003 +
9004 + if (olpc_new_mode(psmouse, priv->pending_mode))
9005 + goto bad;
9006 +
9007 + /*
9008 + * Deal with a potential race condition.
9009 + *
9010 + * If there is a brief tap of a stylus or a fingernail that
9011 + * triggers a mode switch to PT mode, and the stylus/fingernail is
9012 + * lifted after the DISABLE above, but before we reenable in the new mode,
9013 + * then we can get stuck in PT mode.
9014 + */
9015 + if (pending_mode == OLPC_PT) {
9016 + priv->pending_mode = OLPC_GS;
9017 + queue_delayed_work(kpsmoused_wq, &priv->mode_switch, msecs_to_jiffies(50));
9018 + }
9019 +
9020 + return;
9021 +
9022 +bad:
9023 + printk(KERN_WARNING __FILE__ ": Failure to switch modes, resetting device...\n");
9024 + olpc_reconnect(psmouse);
9025 +}
9026 +
9027 +int olpc_init(struct psmouse *psmouse)
9028 +{
9029 + struct olpc_data *priv;
9030 + struct input_dev *dev = psmouse->dev;
9031 + struct input_dev *dev2;
9032 + int mode;
9033 +
9034 + priv = kzalloc(sizeof(struct olpc_data), GFP_KERNEL);
9035 + dev2 = input_allocate_device();
9036 + if (!priv || !dev2)
9037 + goto init_fail;
9038 +
9039 + psmouse->private = priv;
9040 + priv->dev2 = dev2;
9041 + priv->psmouse = psmouse;
9042 +
9043 + psmouse_reset(psmouse);
9044 + if (!(priv->i = olpc_get_model(psmouse)))
9045 + goto init_fail;
9046 +
9047 + mode = olpc_find_mode(psmouse);
9048 + if (mode < 0) {
9049 + printk(KERN_ERR __FILE__ ": Failed to identify proper mode\n");
9050 + goto init_fail;
9051 + }
9052 +
9053 + if (olpc_absolute_mode(psmouse, mode)) {
9054 + printk(KERN_ERR __FILE__ ": Failed to enable absolute mode\n");
9055 + goto init_fail;
9056 + }
9057 +
9058 + /*
9059 + * Unset some of the default bits for things we don't have.
9060 + */
9061 + dev->evbit[LONG(EV_REL)] &= ~BIT(EV_REL);
9062 + dev->relbit[LONG(REL_X)] &= ~(BIT(REL_X) | BIT(REL_Y));
9063 + dev->keybit[LONG(BTN_MIDDLE)] &= ~BIT(BTN_MIDDLE);
9064 +
9065 + dev->evbit[LONG(EV_KEY)] |= BIT(EV_KEY);
9066 + dev->keybit[LONG(BTN_TOUCH)] |= BIT(BTN_TOUCH);
9067 + dev->keybit[LONG(BTN_TOOL_PEN)] |= BIT(BTN_TOOL_PEN);
9068 + dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT);
9069 +
9070 + dev->evbit[LONG(EV_ABS)] |= BIT(EV_ABS);
9071 + input_set_abs_params(dev, ABS_X, 2, 1000, 0, 0);
9072 + input_set_abs_params(dev, ABS_Y, 0, 717, 0, 0);
9073 +
9074 + snprintf(priv->phys, sizeof(priv->phys),
9075 + "%s/input1", psmouse->ps2dev.serio->phys);
9076 + dev2->phys = priv->phys;
9077 + dev2->name = "OLPC ALPS GlideSensor";
9078 + dev2->id.bustype = BUS_I8042;
9079 + dev2->id.vendor = 0x0002;
9080 + dev2->id.product = PSMOUSE_OLPC;
9081 + dev2->id.version = 0x0000;
9082 +
9083 + dev2->evbit[LONG(EV_KEY)] |= BIT(EV_KEY);
9084 + dev2->keybit[LONG(BTN_TOUCH)] |= BIT(BTN_TOUCH);
9085 + dev2->keybit[LONG(BTN_TOOL_FINGER)] |= BIT(BTN_TOOL_FINGER);
9086 + dev2->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT);
9087 +
9088 + dev2->evbit[LONG(EV_ABS)] |= BIT(EV_ABS);
9089 + input_set_abs_params(dev2, ABS_X, 350, 512, 0, 0);
9090 + input_set_abs_params(dev2, ABS_Y, 70, 325, 0, 0);
9091 + input_set_abs_params(dev2, ABS_PRESSURE, 0, 63, 0, 0);
9092 +
9093 + if (input_register_device(dev2)) {
9094 + printk(KERN_ERR __FILE__ ": Failed to register GlideSensor\n");
9095 + goto init_fail;
9096 + }
9097 +
9098 + psmouse->protocol_handler = olpc_process_byte;
9099 + psmouse->poll = olpc_poll;
9100 + psmouse->disconnect = olpc_disconnect;
9101 + psmouse->reconnect = olpc_reconnect;
9102 + psmouse->pktsize = 6;
9103 +
9104 + /* Disable the idle resync. */
9105 + psmouse->resync_time = 0;
9106 + /* Reset after a lot of bad bytes. */
9107 + psmouse->resetafter = 1024;
9108 +
9109 + INIT_DELAYED_WORK(&priv->mode_switch, olpc_mode_switch);
9110 +
9111 + return 0;
9112 +
9113 +init_fail:
9114 + input_free_device(dev2);
9115 + kfree(priv);
9116 + return -1;
9117 +}
9118 +
9119 +int olpc_detect(struct psmouse *psmouse, int set_properties)
9120 +{
9121 + if (!olpc_get_model(psmouse))
9122 + return -1;
9123 +
9124 + if (set_properties) {
9125 + psmouse->vendor = "ALPS";
9126 + psmouse->name = "PenTablet";
9127 + psmouse->model = 0;
9128 + }
9129 + return 0;
9130 +}
9131 +
9132 diff --git a/drivers/input/mouse/olpc.h b/drivers/input/mouse/olpc.h
9133 new file mode 100644
9134 index 0000000..426f8b4
9135 --- /dev/null
9136 +++ b/drivers/input/mouse/olpc.h
9137 @@ -0,0 +1,49 @@
9138 +/*
9139 + * OLPC touchpad PS/2 mouse driver
9140 + *
9141 + * Copyright (c) 2006 One Laptop Per Child, inc.
9142 + *
9143 + * This driver is partly based on the ALPS driver.
9144 + * Copyright (c) 2003 Peter Osterlund <petero2@telia.com>
9145 + * Copyright (c) 2005 Vojtech Pavlik <vojtech@suse.cz>
9146 + *
9147 + * This program is free software; you can redistribute it and/or modify it
9148 + * under the terms of the GNU General Public License version 2 as published by
9149 + * the Free Software Foundation.
9150 + */
9151 +
9152 +#ifndef _OLPC_H
9153 +#define _OLPC_H
9154 +
9155 +struct olpc_model_info {
9156 + unsigned char signature[3];
9157 + unsigned char flags;
9158 +};
9159 +
9160 +struct olpc_data {
9161 + struct input_dev *dev2; /* Relative device */
9162 + struct psmouse *psmouse;
9163 + char name[32]; /* Name */
9164 + char phys[32]; /* Phys */
9165 + struct olpc_model_info *i; /* Info */
9166 + int pending_mode;
9167 + int current_mode;
9168 + s64 late;
9169 + struct delayed_work mode_switch;
9170 +};
9171 +
9172 +#ifdef CONFIG_MOUSE_PS2_OLPC
9173 +int olpc_detect(struct psmouse *psmouse, int set_properties);
9174 +int olpc_init(struct psmouse *psmouse);
9175 +#else
9176 +inline int olpc_detect(struct psmouse *psmouse, int set_properties)
9177 +{
9178 + return -ENOSYS;
9179 +}
9180 +inline int olpc_init(struct psmouse *psmouse)
9181 +{
9182 + return -ENOSYS;
9183 +}
9184 +#endif
9185 +
9186 +#endif
9187 diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
9188 index b9f0fb2..edcdb68 100644
9189 --- a/drivers/input/mouse/psmouse-base.c
9190 +++ b/drivers/input/mouse/psmouse-base.c
9191 @@ -26,6 +26,7 @@
9192 #include "synaptics.h"
9193 #include "logips2pp.h"
9194 #include "alps.h"
9195 +#include "olpc.h"
9196 #include "lifebook.h"
9197 #include "trackpoint.h"
9198 #include "touchkit_ps2.h"
9199 @@ -103,7 +104,7 @@ static struct attribute_group psmouse_attribute_group = {
9200 */
9201 static DEFINE_MUTEX(psmouse_mutex);
9202
9203 -static struct workqueue_struct *kpsmoused_wq;
9204 +struct workqueue_struct *kpsmoused_wq;
9205
9206 struct psmouse_protocol {
9207 enum psmouse_type type;
9208 @@ -320,7 +321,7 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
9209 goto out;
9210 }
9211
9212 - if (psmouse->packet[1] == PSMOUSE_RET_ID) {
9213 + if (psmouse->packet[1] == PSMOUSE_RET_ID || psmouse->packet[1] == PSMOUSE_RET_BAT) {
9214 __psmouse_set_state(psmouse, PSMOUSE_IGNORE);
9215 serio_reconnect(serio);
9216 goto out;
9217 @@ -631,8 +632,21 @@ static int psmouse_extensions(struct psmouse *psmouse,
9218 }
9219 }
9220
9221 +/*
9222 + * Try OLPC touchpad.
9223 + */
9224 if (max_proto > PSMOUSE_IMEX) {
9225 + if (olpc_detect(psmouse, set_properties) == 0) {
9226 + if (!set_properties || olpc_init(psmouse) == 0)
9227 + return PSMOUSE_OLPC;
9228 +/*
9229 + * Init failed, try basic relative protocols
9230 + */
9231 + max_proto = PSMOUSE_IMEX;
9232 + }
9233 + }
9234
9235 + if (max_proto > PSMOUSE_IMEX) {
9236 if (genius_detect(psmouse, set_properties) == 0)
9237 return PSMOUSE_GENPS;
9238
9239 @@ -762,6 +776,14 @@ static const struct psmouse_protocol psmouse_protocols[] = {
9240 .detect = touchkit_ps2_detect,
9241 },
9242 #endif
9243 +#ifdef CONFIG_MOUSE_PS2_OLPC
9244 + {
9245 + .type = PSMOUSE_OLPC,
9246 + .name = "OLPC",
9247 + .alias = "olpc",
9248 + .detect = olpc_detect,
9249 + },
9250 +#endif
9251 {
9252 .type = PSMOUSE_CORTRON,
9253 .name = "CortronPS/2",
9254 diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
9255 index 1317bdd..c4857df 100644
9256 --- a/drivers/input/mouse/psmouse.h
9257 +++ b/drivers/input/mouse/psmouse.h
9258 @@ -89,6 +89,7 @@ enum psmouse_type {
9259 PSMOUSE_TRACKPOINT,
9260 PSMOUSE_TOUCHKIT_PS2,
9261 PSMOUSE_CORTRON,
9262 + PSMOUSE_OLPC,
9263 PSMOUSE_AUTO /* This one should always be last */
9264 };
9265
9266 @@ -96,6 +97,7 @@ int psmouse_sliced_command(struct psmouse *psmouse, unsigned char command);
9267 int psmouse_reset(struct psmouse *psmouse);
9268 void psmouse_set_resolution(struct psmouse *psmouse, unsigned int resolution);
9269
9270 +extern struct workqueue_struct *kpsmoused_wq;
9271
9272 struct psmouse_attribute {
9273 struct device_attribute dattr;
9274 diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
9275 index c2eea27..3510726 100644
9276 --- a/drivers/input/serio/i8042.c
9277 +++ b/drivers/input/serio/i8042.c
9278 @@ -868,6 +868,11 @@ static long i8042_panic_blink(long count)
9279 #undef DELAY
9280
9281 #ifdef CONFIG_PM
9282 +
9283 +#ifdef CONFIG_OLPC
9284 +#include <asm/olpc.h>
9285 +#endif
9286 +
9287 /*
9288 * Here we try to restore the original BIOS settings. We only want to
9289 * do that once, when we really suspend, not when we taking memory
9290 @@ -878,8 +883,15 @@ static long i8042_panic_blink(long count)
9291 static int i8042_suspend(struct platform_device *dev, pm_message_t state)
9292 {
9293 if (dev->dev.power.power_state.event != state.event) {
9294 +#ifdef CONFIG_OLPC
9295 + /* Anything newer than B2 remains powered; no reset needed */
9296 + if (olpc_rev_before(OLPC_REV_PRE_B3)) {
9297 +#endif
9298 if (state.event == PM_EVENT_SUSPEND)
9299 i8042_controller_reset();
9300 +#ifdef CONFIG_OLPC
9301 + }
9302 +#endif
9303
9304 dev->dev.power.power_state = state;
9305 }
9306 @@ -902,9 +914,15 @@ static int i8042_resume(struct platform_device *dev)
9307 if (dev->dev.power.power_state.event == PM_EVENT_ON)
9308 return 0;
9309
9310 +#ifdef CONFIG_OLPC
9311 + if (olpc_rev_before(OLPC_REV_PRE_B3)) {
9312 +#endif
9313 error = i8042_controller_check();
9314 if (error)
9315 return error;
9316 +#ifdef CONFIG_OLPC
9317 + }
9318 +#endif
9319
9320 error = i8042_controller_selftest();
9321 if (error)
9322 diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
9323 index 372ca49..c9e5308 100644
9324 --- a/drivers/input/serio/serio.c
9325 +++ b/drivers/input/serio/serio.c
9326 @@ -916,11 +916,22 @@ static int serio_uevent(struct device *dev, char **envp, int num_envp, char *buf
9327 #endif /* CONFIG_HOTPLUG */
9328
9329 #ifdef CONFIG_PM
9330 +
9331 +#ifdef CONFIG_OLPC
9332 +#include <asm/olpc.h>
9333 +#endif
9334 +
9335 static int serio_suspend(struct device *dev, pm_message_t state)
9336 {
9337 if (dev->power.power_state.event != state.event) {
9338 +#ifdef CONFIG_OLPC
9339 + if (olpc_rev_before(OLPC_REV_PRE_B3)) {
9340 +#endif
9341 if (state.event == PM_EVENT_SUSPEND)
9342 serio_cleanup(to_serio_port(dev));
9343 +#ifdef CONFIG_OLPC
9344 + }
9345 +#endif
9346
9347 dev->power.power_state = state;
9348 }
9349 diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
9350 index ef53618..47881d2 100644
9351 --- a/drivers/media/video/cafe_ccic.c
9352 +++ b/drivers/media/video/cafe_ccic.c
9353 @@ -63,13 +63,13 @@ MODULE_SUPPORTED_DEVICE("Video");
9354 */
9355
9356 #define MAX_DMA_BUFS 3
9357 -static int alloc_bufs_at_load = 0;
9358 -module_param(alloc_bufs_at_load, bool, 0444);
9359 -MODULE_PARM_DESC(alloc_bufs_at_load,
9360 - "Non-zero value causes DMA buffers to be allocated at module "
9361 - "load time. This increases the chances of successfully getting "
9362 - "those buffers, but at the cost of nailing down the memory from "
9363 - "the outset.");
9364 +static int alloc_bufs_at_read = 0;
9365 +module_param(alloc_bufs_at_read, bool, 0444);
9366 +MODULE_PARM_DESC(alloc_bufs_at_read,
9367 + "Non-zero value causes DMA buffers to be allocated when the "
9368 + "video capture device is read, rather than at module load "
9369 + "time. This saves memory, but decreases the chances of "
9370 + "successfully getting those buffers.");
9371
9372 static int n_dma_bufs = 3;
9373 module_param(n_dma_bufs, uint, 0644);
9374 @@ -370,6 +370,10 @@ static int cafe_smbus_write_data(struct cafe_camera *cam,
9375 rval = value | ((command << TWSIC1_ADDR_SHIFT) & TWSIC1_ADDR);
9376 cafe_reg_write(cam, REG_TWSIC1, rval);
9377 spin_unlock_irqrestore(&cam->dev_lock, flags);
9378 + mdelay(2); /* It'll probably take about 900µs anyway, and the
9379 + CAFÉ is apparently quite sensitive to being poked
9380 + at this point. If we can work out precisely what's
9381 + going on and reduce this delay, it would be nice. */
9382
9383 /*
9384 * Time to wait for the write to complete. THIS IS A RACY
9385 @@ -1503,7 +1507,7 @@ static int cafe_v4l_release(struct inode *inode, struct file *filp)
9386 }
9387 if (cam->users == 0) {
9388 cafe_ctlr_power_down(cam);
9389 - if (! alloc_bufs_at_load)
9390 + if (alloc_bufs_at_read)
9391 cafe_free_dma_bufs(cam);
9392 }
9393 mutex_unlock(&cam->s_mutex);
9394 @@ -2162,7 +2166,7 @@ static int cafe_pci_probe(struct pci_dev *pdev,
9395 /*
9396 * If so requested, try to get our DMA buffers now.
9397 */
9398 - if (alloc_bufs_at_load) {
9399 + if (!alloc_bufs_at_read) {
9400 if (cafe_alloc_dma_bufs(cam, 1))
9401 cam_warn(cam, "Unable to alloc DMA buffers at load"
9402 " will try again later.");
9403 diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
9404 index 73e248f..f7afde3 100644
9405 --- a/drivers/misc/Kconfig
9406 +++ b/drivers/misc/Kconfig
9407 @@ -202,5 +202,10 @@ config THINKPAD_ACPI_BAY
9408
9409 If you are not sure, say Y here.
9410
9411 +config EEPROM_93CX6
9412 + tristate "EEPROM 93CX6 support"
9413 + ---help---
9414 + This is a driver for the EEPROM chipsets 93c46 and 93c66.
9415 + The driver supports both read as well as write commands.
9416
9417 endif # MISC_DEVICES
9418 diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
9419 index 93fe2e5..e17eb8e 100644
9420 --- a/drivers/mmc/card/block.c
9421 +++ b/drivers/mmc/card/block.c
9422 @@ -229,6 +229,11 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
9423 if (brq.data.blocks > card->host->max_blk_count)
9424 brq.data.blocks = card->host->max_blk_count;
9425
9426 + if (mmc_card_sd(card) && !card->host->ios.clock) {
9427 + printk(KERN_ERR "%s: I/O to stopped card\n",
9428 + req->rq_disk->disk_name);
9429 + goto cmd_err;
9430 + }
9431 mmc_set_data_timeout(&brq.data, card, rq_data_dir(req) != READ);
9432
9433 /*
9434 diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
9435 index 20a7d89..9abbb58 100644
9436 --- a/drivers/mmc/host/sdhci.c
9437 +++ b/drivers/mmc/host/sdhci.c
9438 @@ -411,6 +411,12 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
9439 break;
9440 }
9441
9442 + /*
9443 + * There's an off-by-one error in the hw that we need to
9444 + * compensate for.
9445 + */
9446 + count++;
9447 +
9448 if (count >= 0xF) {
9449 printk(KERN_WARNING "%s: Too large timeout requested!\n",
9450 mmc_hostname(host->mmc));
9451 @@ -676,19 +682,17 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power)
9452 if (!(host->chip->quirks & SDHCI_QUIRK_SINGLE_POWER_WRITE))
9453 writeb(0, host->ioaddr + SDHCI_POWER_CONTROL);
9454
9455 - pwr = SDHCI_POWER_ON;
9456 -
9457 switch (1 << power) {
9458 case MMC_VDD_165_195:
9459 - pwr |= SDHCI_POWER_180;
9460 + pwr = SDHCI_POWER_180;
9461 break;
9462 case MMC_VDD_29_30:
9463 case MMC_VDD_30_31:
9464 - pwr |= SDHCI_POWER_300;
9465 + pwr = SDHCI_POWER_300;
9466 break;
9467 case MMC_VDD_32_33:
9468 case MMC_VDD_33_34:
9469 - pwr |= SDHCI_POWER_330;
9470 + pwr = SDHCI_POWER_330;
9471 break;
9472 default:
9473 BUG();
9474 @@ -696,6 +700,10 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power)
9475
9476 writeb(pwr, host->ioaddr + SDHCI_POWER_CONTROL);
9477
9478 + pwr |= SDHCI_POWER_ON;
9479 +
9480 + writeb(pwr, host->ioaddr + SDHCI_POWER_CONTROL);
9481 +
9482 out:
9483 host->power = power;
9484 }
9485 diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
9486 index fbec8cd..8848e8a 100644
9487 --- a/drivers/mtd/Kconfig
9488 +++ b/drivers/mtd/Kconfig
9489 @@ -278,6 +278,14 @@ config SSFDC
9490 This enables read only access to SmartMedia formatted NAND
9491 flash. You can mount it with FAT file system.
9492
9493 +config MTD_OOPS
9494 + tristate "Log panic/oops to an MTD buffer"
9495 + depends on MTD
9496 + help
9497 + This enables panic and oops messages to be logged to a circular
9498 + buffer in a flash partition where it can be read back at some
9499 + later point.
9500 +
9501 source "drivers/mtd/chips/Kconfig"
9502
9503 source "drivers/mtd/maps/Kconfig"
9504 diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
9505 index 6d958a4..7f0b04b 100644
9506 --- a/drivers/mtd/Makefile
9507 +++ b/drivers/mtd/Makefile
9508 @@ -22,6 +22,7 @@ obj-$(CONFIG_NFTL) += nftl.o
9509 obj-$(CONFIG_INFTL) += inftl.o
9510 obj-$(CONFIG_RFD_FTL) += rfd_ftl.o
9511 obj-$(CONFIG_SSFDC) += ssfdc.o
9512 +obj-$(CONFIG_MTD_OOPS) += mtdoops.o
9513
9514 nftl-objs := nftlcore.o nftlmount.o
9515 inftl-objs := inftlcore.o inftlmount.o
9516 diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
9517 index 2f19fa7..39eff9f 100644
9518 --- a/drivers/mtd/chips/cfi_cmdset_0001.c
9519 +++ b/drivers/mtd/chips/cfi_cmdset_0001.c
9520 @@ -526,7 +526,7 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd,
9521 struct cfi_pri_intelext *extp = cfi->cmdset_priv;
9522
9523 /*
9524 - * Probing of multi-partition flash ships.
9525 + * Probing of multi-partition flash chips.
9526 *
9527 * To support multiple partitions when available, we simply arrange
9528 * for each of them to have their own flchip structure even if they
9529 @@ -1780,7 +1780,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
9530 return ret;
9531 }
9532
9533 -int cfi_intelext_erase_varsize(struct mtd_info *mtd, struct erase_info *instr)
9534 +static int cfi_intelext_erase_varsize(struct mtd_info *mtd, struct erase_info *instr)
9535 {
9536 unsigned long ofs, len;
9537 int ret;
9538 @@ -1930,7 +1930,7 @@ static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, size_t len)
9539 printk(KERN_DEBUG "%s: lock status before, ofs=0x%08llx, len=0x%08X\n",
9540 __FUNCTION__, ofs, len);
9541 cfi_varsize_frob(mtd, do_printlockstatus_oneblock,
9542 - ofs, len, 0);
9543 + ofs, len, NULL);
9544 #endif
9545
9546 ret = cfi_varsize_frob(mtd, do_xxlock_oneblock,
9547 @@ -1940,7 +1940,7 @@ static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, size_t len)
9548 printk(KERN_DEBUG "%s: lock status after, ret=%d\n",
9549 __FUNCTION__, ret);
9550 cfi_varsize_frob(mtd, do_printlockstatus_oneblock,
9551 - ofs, len, 0);
9552 + ofs, len, NULL);
9553 #endif
9554
9555 return ret;
9556 @@ -1954,7 +1954,7 @@ static int cfi_intelext_unlock(struct mtd_info *mtd, loff_t ofs, size_t len)
9557 printk(KERN_DEBUG "%s: lock status before, ofs=0x%08llx, len=0x%08X\n",
9558 __FUNCTION__, ofs, len);
9559 cfi_varsize_frob(mtd, do_printlockstatus_oneblock,
9560 - ofs, len, 0);
9561 + ofs, len, NULL);
9562 #endif
9563
9564 ret = cfi_varsize_frob(mtd, do_xxlock_oneblock,
9565 @@ -1964,7 +1964,7 @@ static int cfi_intelext_unlock(struct mtd_info *mtd, loff_t ofs, size_t len)
9566 printk(KERN_DEBUG "%s: lock status after, ret=%d\n",
9567 __FUNCTION__, ret);
9568 cfi_varsize_frob(mtd, do_printlockstatus_oneblock,
9569 - ofs, len, 0);
9570 + ofs, len, NULL);
9571 #endif
9572
9573 return ret;
9574 @@ -2255,7 +2255,7 @@ static void cfi_intelext_save_locks(struct mtd_info *mtd)
9575 adr = region->offset + block * len;
9576
9577 status = cfi_varsize_frob(mtd,
9578 - do_getlockstatus_oneblock, adr, len, 0);
9579 + do_getlockstatus_oneblock, adr, len, NULL);
9580 if (status)
9581 set_bit(block, region->lockmap);
9582 else
9583 diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
9584 index 1f64458..389acc6 100644
9585 --- a/drivers/mtd/chips/cfi_cmdset_0002.c
9586 +++ b/drivers/mtd/chips/cfi_cmdset_0002.c
9587 @@ -1609,7 +1609,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
9588 }
9589
9590
9591 -int cfi_amdstd_erase_varsize(struct mtd_info *mtd, struct erase_info *instr)
9592 +static int cfi_amdstd_erase_varsize(struct mtd_info *mtd, struct erase_info *instr)
9593 {
9594 unsigned long ofs, len;
9595 int ret;
9596 diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c
9597 index 58e561e..593e9d6 100644
9598 --- a/drivers/mtd/chips/jedec_probe.c
9599 +++ b/drivers/mtd/chips/jedec_probe.c
9600 @@ -70,6 +70,7 @@
9601
9602 /* Fujitsu */
9603 #define MBM29F040C 0x00A4
9604 +#define MBM29F800BA 0x2258
9605 #define MBM29LV650UE 0x22D7
9606 #define MBM29LV320TE 0x22F6
9607 #define MBM29LV320BE 0x22F9
9608 @@ -129,6 +130,7 @@
9609 #define LH28F640BF 0x00b0
9610
9611 /* ST - www.st.com */
9612 +#define M29F800AB 0x0058
9613 #define M29W800DT 0x00D7
9614 #define M29W800DB 0x005B
9615 #define M29W160DT 0x22C4
9616 @@ -646,6 +648,23 @@ static const struct amd_flash_info jedec_table[] = {
9617 }
9618 }, {
9619 .mfr_id = MANUFACTURER_FUJITSU,
9620 + .dev_id = MBM29F800BA,
9621 + .name = "Fujitsu MBM29F800BA",
9622 + .uaddr = {
9623 + [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
9624 + [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
9625 + },
9626 + .DevSize = SIZE_1MiB,
9627 + .CmdSet = P_ID_AMD_STD,
9628 + .NumEraseRegions= 4,
9629 + .regions = {
9630 + ERASEINFO(0x04000,1),
9631 + ERASEINFO(0x02000,2),
9632 + ERASEINFO(0x08000,1),
9633 + ERASEINFO(0x10000,15),
9634 + }
9635 + }, {
9636 + .mfr_id = MANUFACTURER_FUJITSU,
9637 .dev_id = MBM29LV650UE,
9638 .name = "Fujitsu MBM29LV650UE",
9639 .uaddr = {
9640 @@ -1510,6 +1529,23 @@ static const struct amd_flash_info jedec_table[] = {
9641 ERASEINFO(0x1000,256)
9642 }
9643
9644 + }, {
9645 + .mfr_id = MANUFACTURER_ST,
9646 + .dev_id = M29F800AB,
9647 + .name = "ST M29F800AB",
9648 + .uaddr = {
9649 + [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
9650 + [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
9651 + },
9652 + .DevSize = SIZE_1MiB,
9653 + .CmdSet = P_ID_AMD_STD,
9654 + .NumEraseRegions= 4,
9655 + .regions = {
9656 + ERASEINFO(0x04000,1),
9657 + ERASEINFO(0x02000,2),
9658 + ERASEINFO(0x08000,1),
9659 + ERASEINFO(0x10000,15),
9660 + }
9661 }, {
9662 .mfr_id = MANUFACTURER_ST, /* FIXME - CFI device? */
9663 .dev_id = M29W800DT,
9664 diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig
9665 index ff642f8..b4ea64d 100644
9666 --- a/drivers/mtd/devices/Kconfig
9667 +++ b/drivers/mtd/devices/Kconfig
9668 @@ -69,12 +69,21 @@ config MTD_DATAFLASH26
9669 If you have such a board and such a DataFlash, say 'Y'.
9670
9671 config MTD_M25P80
9672 - tristate "Support for M25 SPI Flash"
9673 + tristate "Support most SPI Flash chips (AT26DF, M25P, W25X, ...)"
9674 depends on SPI_MASTER && EXPERIMENTAL
9675 help
9676 - This enables access to ST M25P80 and similar SPI flash chips,
9677 - used for program and data storage. Set up your spi devices
9678 - with the right board-specific platform data.
9679 + This enables access to most modern SPI flash chips, used for
9680 + program and data storage. Series supported include Atmel AT26DF,
9681 + Spansion S25SL, SST 25VF, ST M25P, and Winbond W25X. Other chips
9682 + are supported as well. See the driver source for the current list,
9683 + or to add other chips.
9684 +
9685 + Note that the original DataFlash chips (AT45 series, not AT26DF),
9686 + need an entirely different driver.
9687 +
9688 + Set up your spi devices with the right board-specific platform data,
9689 + if you want to specify device partitioning or to use a device which
9690 + doesn't support the JEDEC ID instruction.
9691
9692 config MTD_SLRAM
9693 tristate "Uncached system RAM"
9694 diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
9695 index 78c2511..98df5bc 100644
9696 --- a/drivers/mtd/devices/m25p80.c
9697 +++ b/drivers/mtd/devices/m25p80.c
9698 @@ -1,5 +1,5 @@
9699 /*
9700 - * MTD SPI driver for ST M25Pxx flash chips
9701 + * MTD SPI driver for ST M25Pxx (and similar) serial flash chips
9702 *
9703 * Author: Mike Lavender, mike@steroidmicros.com
9704 *
9705 @@ -19,33 +19,32 @@
9706 #include <linux/module.h>
9707 #include <linux/device.h>
9708 #include <linux/interrupt.h>
9709 -#include <linux/interrupt.h>
9710 +#include <linux/mutex.h>
9711 +
9712 #include <linux/mtd/mtd.h>
9713 #include <linux/mtd/partitions.h>
9714 +
9715 #include <linux/spi/spi.h>
9716 #include <linux/spi/flash.h>
9717
9718 -#include <asm/semaphore.h>
9719 -
9720 -
9721 -/* NOTE: AT 25F and SST 25LF series are very similar,
9722 - * but commands for sector erase and chip id differ...
9723 - */
9724
9725 #define FLASH_PAGESIZE 256
9726
9727 /* Flash opcodes. */
9728 -#define OPCODE_WREN 6 /* Write enable */
9729 -#define OPCODE_RDSR 5 /* Read status register */
9730 -#define OPCODE_READ 3 /* Read data bytes */
9731 -#define OPCODE_PP 2 /* Page program */
9732 -#define OPCODE_SE 0xd8 /* Sector erase */
9733 -#define OPCODE_RES 0xab /* Read Electronic Signature */
9734 +#define OPCODE_WREN 0x06 /* Write enable */
9735 +#define OPCODE_RDSR 0x05 /* Read status register */
9736 +#define OPCODE_READ 0x03 /* Read data bytes (low frequency) */
9737 +#define OPCODE_FAST_READ 0x0b /* Read data bytes (high frequency) */
9738 +#define OPCODE_PP 0x02 /* Page program (up to 256 bytes) */
9739 +#define OPCODE_BE_4K 0x20 /* Erase 4KiB block */
9740 +#define OPCODE_BE_32K 0x52 /* Erase 32KiB block */
9741 +#define OPCODE_SE 0xd8 /* Sector erase (usually 64KiB) */
9742 #define OPCODE_RDID 0x9f /* Read JEDEC ID */
9743
9744 /* Status Register bits. */
9745 #define SR_WIP 1 /* Write in progress */
9746 #define SR_WEL 2 /* Write enable latch */
9747 +/* meaning of other SR_* bits may differ between vendors */
9748 #define SR_BP0 4 /* Block protect 0 */
9749 #define SR_BP1 8 /* Block protect 1 */
9750 #define SR_BP2 0x10 /* Block protect 2 */
9751 @@ -65,9 +64,10 @@
9752
9753 struct m25p {
9754 struct spi_device *spi;
9755 - struct semaphore lock;
9756 + struct mutex lock;
9757 struct mtd_info mtd;
9758 - unsigned partitioned;
9759 + unsigned partitioned:1;
9760 + u8 erase_opcode;
9761 u8 command[4];
9762 };
9763
9764 @@ -150,8 +150,9 @@ static int wait_till_ready(struct m25p *flash)
9765 */
9766 static int erase_sector(struct m25p *flash, u32 offset)
9767 {
9768 - DEBUG(MTD_DEBUG_LEVEL3, "%s: %s at 0x%08x\n", flash->spi->dev.bus_id,
9769 - __FUNCTION__, offset);
9770 + DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB at 0x%08x\n",
9771 + flash->spi->dev.bus_id, __FUNCTION__,
9772 + flash->mtd.erasesize / 1024, offset);
9773
9774 /* Wait until finished previous write command. */
9775 if (wait_till_ready(flash))
9776 @@ -161,7 +162,7 @@ static int erase_sector(struct m25p *flash, u32 offset)
9777 write_enable(flash);
9778
9779 /* Set up command buffer. */
9780 - flash->command[0] = OPCODE_SE;
9781 + flash->command[0] = flash->erase_opcode;
9782 flash->command[1] = offset >> 16;
9783 flash->command[2] = offset >> 8;
9784 flash->command[3] = offset;
9785 @@ -201,13 +202,17 @@ static int m25p80_erase(struct mtd_info *mtd, struct erase_info *instr)
9786 addr = instr->addr;
9787 len = instr->len;
9788
9789 - down(&flash->lock);
9790 + mutex_lock(&flash->lock);
9791 +
9792 + /* REVISIT in some cases we could speed up erasing large regions
9793 + * by using OPCODE_SE instead of OPCODE_BE_4K
9794 + */
9795
9796 /* now erase those sectors */
9797 while (len) {
9798 if (erase_sector(flash, addr)) {
9799 instr->state = MTD_ERASE_FAILED;
9800 - up(&flash->lock);
9801 + mutex_unlock(&flash->lock);
9802 return -EIO;
9803 }
9804
9805 @@ -215,7 +220,7 @@ static int m25p80_erase(struct mtd_info *mtd, struct erase_info *instr)
9806 len -= mtd->erasesize;
9807 }
9808
9809 - up(&flash->lock);
9810 + mutex_unlock(&flash->lock);
9811
9812 instr->state = MTD_ERASE_DONE;
9813 mtd_erase_callback(instr);
9814 @@ -260,16 +265,19 @@ static int m25p80_read(struct mtd_info *mtd, loff_t from, size_t len,
9815 if (retlen)
9816 *retlen = 0;
9817
9818 - down(&flash->lock);
9819 + mutex_lock(&flash->lock);
9820
9821 /* Wait till previous write/erase is done. */
9822 if (wait_till_ready(flash)) {
9823 /* REVISIT status return?? */
9824 - up(&flash->lock);
9825 + mutex_unlock(&flash->lock);
9826 return 1;
9827 }
9828
9829 - /* NOTE: OPCODE_FAST_READ (if available) is faster... */
9830 + /* FIXME switch to OPCODE_FAST_READ. It's required for higher
9831 + * clocks; and at this writing, every chip this driver handles
9832 + * supports that opcode.
9833 + */
9834
9835 /* Set up the write data buffer. */
9836 flash->command[0] = OPCODE_READ;
9837 @@ -281,7 +289,7 @@ static int m25p80_read(struct mtd_info *mtd, loff_t from, size_t len,
9838
9839 *retlen = m.actual_length - sizeof(flash->command);
9840
9841 - up(&flash->lock);
9842 + mutex_unlock(&flash->lock);
9843
9844 return 0;
9845 }
9846 @@ -323,7 +331,7 @@ static int m25p80_write(struct mtd_info *mtd, loff_t to, size_t len,
9847 t[1].tx_buf = buf;
9848 spi_message_add_tail(&t[1], &m);
9849
9850 - down(&flash->lock);
9851 + mutex_lock(&flash->lock);
9852
9853 /* Wait until finished previous write command. */
9854 if (wait_till_ready(flash))
9855 @@ -381,10 +389,10 @@ static int m25p80_write(struct mtd_info *mtd, loff_t to, size_t len,
9856 if (retlen)
9857 *retlen += m.actual_length
9858 - sizeof(flash->command);
9859 - }
9860 - }
9861 + }
9862 + }
9863
9864 - up(&flash->lock);
9865 + mutex_unlock(&flash->lock);
9866
9867 return 0;
9868 }
9869 @@ -398,24 +406,118 @@ static int m25p80_write(struct mtd_info *mtd, loff_t to, size_t len,
9870
9871 struct flash_info {
9872 char *name;
9873 - u8 id;
9874 - u16 jedec_id;
9875 +
9876 + /* JEDEC id zero means "no ID" (most older chips); otherwise it has
9877 + * a high byte of zero plus three data bytes: the manufacturer id,
9878 + * then a two byte device id.
9879 + */
9880 + u32 jedec_id;
9881 +
9882 + /* The size listed here is what works with OPCODE_SE, which isn't
9883 + * necessarily called a "sector" by the vendor.
9884 + */
9885 unsigned sector_size;
9886 - unsigned n_sectors;
9887 + u16 n_sectors;
9888 +
9889 + u16 flags;
9890 +#define SECT_4K 0x01 /* OPCODE_BE_4K works uniformly */
9891 };
9892
9893 +
9894 +/* NOTE: double check command sets and memory organization when you add
9895 + * more flash chips. This current list focusses on newer chips, which
9896 + * have been converging on command sets which including JEDEC ID.
9897 + */
9898 static struct flash_info __devinitdata m25p_data [] = {
9899 - /* REVISIT: fill in JEDEC ids, for parts that have them */
9900 - { "m25p05", 0x05, 0x2010, 32 * 1024, 2 },
9901 - { "m25p10", 0x10, 0x2011, 32 * 1024, 4 },
9902 - { "m25p20", 0x11, 0x2012, 64 * 1024, 4 },
9903 - { "m25p40", 0x12, 0x2013, 64 * 1024, 8 },
9904 - { "m25p80", 0x13, 0x0000, 64 * 1024, 16 },
9905 - { "m25p16", 0x14, 0x2015, 64 * 1024, 32 },
9906 - { "m25p32", 0x15, 0x2016, 64 * 1024, 64 },
9907 - { "m25p64", 0x16, 0x2017, 64 * 1024, 128 },
9908 +
9909 + /* Atmel -- some are (confusingly) marketed as "DataFlash" */
9910 + { "at25fs010", 0x1f6601, 32 * 1024, 4, SECT_4K, },
9911 + { "at25fs040", 0x1f6604, 64 * 1024, 8, SECT_4K, },
9912 +
9913 + { "at25df041a", 0x1f4401, 64 * 1024, 8, SECT_4K, },
9914 +
9915 + { "at26f004", 0x1f0400, 64 * 1024, 8, SECT_4K, },
9916 + { "at26df081a", 0x1f4501, 64 * 1024, 16, SECT_4K, },
9917 + { "at26df161a", 0x1f4601, 64 * 1024, 32, SECT_4K, },
9918 + { "at26df321", 0x1f4701, 64 * 1024, 64, SECT_4K, },
9919 +
9920 + /* Spansion -- single (large) sector size only, at least
9921 + * for the chips listed here (without boot sectors).
9922 + */
9923 + { "s25sl004a", 0x010212, 64 * 1024, 8, },
9924 + { "s25sl008a", 0x010213, 64 * 1024, 16, },
9925 + { "s25sl016a", 0x010214, 64 * 1024, 32, },
9926 + { "s25sl032a", 0x010215, 64 * 1024, 64, },
9927 + { "s25sl064a", 0x010216, 64 * 1024, 128, },
9928 +
9929 + /* SST -- large erase sizes are "overlays", "sectors" are 4K */
9930 + { "sst25vf040b", 0xbf258d, 64 * 1024, 8, SECT_4K, },
9931 + { "sst25vf080b", 0xbf258e, 64 * 1024, 16, SECT_4K, },
9932 + { "sst25vf016b", 0xbf2541, 64 * 1024, 32, SECT_4K, },
9933 + { "sst25vf032b", 0xbf254a, 64 * 1024, 64, SECT_4K, },
9934 +
9935 + /* ST Microelectronics -- newer production may have feature updates */
9936 + { "m25p05", 0x202010, 32 * 1024, 2, },
9937 + { "m25p10", 0x202011, 32 * 1024, 4, },
9938 + { "m25p20", 0x202012, 64 * 1024, 4, },
9939 + { "m25p40", 0x202013, 64 * 1024, 8, },
9940 + { "m25p80", 0, 64 * 1024, 16, },
9941 + { "m25p16", 0x202015, 64 * 1024, 32, },
9942 + { "m25p32", 0x202016, 64 * 1024, 64, },
9943 + { "m25p64", 0x202017, 64 * 1024, 128, },
9944 + { "m25p128", 0x202018, 256 * 1024, 64, },
9945 +
9946 + { "m45pe80", 0x204014, 64 * 1024, 16, },
9947 + { "m45pe16", 0x204015, 64 * 1024, 32, },
9948 +
9949 + { "m25pe80", 0x208014, 64 * 1024, 16, },
9950 + { "m25pe16", 0x208015, 64 * 1024, 32, SECT_4K, },
9951 +
9952 + /* Winbond -- w25x "blocks" are 64K, "sectors" are 4KiB */
9953 + { "w25x10", 0xef3011, 64 * 1024, 2, SECT_4K, },
9954 + { "w25x20", 0xef3012, 64 * 1024, 4, SECT_4K, },
9955 + { "w25x40", 0xef3013, 64 * 1024, 8, SECT_4K, },
9956 + { "w25x80", 0xef3014, 64 * 1024, 16, SECT_4K, },
9957 + { "w25x16", 0xef3015, 64 * 1024, 32, SECT_4K, },
9958 + { "w25x32", 0xef3016, 64 * 1024, 64, SECT_4K, },
9959 + { "w25x64", 0xef3017, 64 * 1024, 128, SECT_4K, },
9960 };
9961
9962 +static struct flash_info *__devinit jedec_probe(struct spi_device *spi)
9963 +{
9964 + int tmp;
9965 + u8 code = OPCODE_RDID;
9966 + u8 id[3];
9967 + u32 jedec;
9968 + struct flash_info *info;
9969 +
9970 + /* JEDEC also defines an optional "extended device information"
9971 + * string for after vendor-specific data, after the three bytes
9972 + * we use here. Supporting some chips might require using it.
9973 + */
9974 + tmp = spi_write_then_read(spi, &code, 1, id, 3);
9975 + if (tmp < 0) {
9976 + DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n",
9977 + spi->dev.bus_id, tmp);
9978 + return NULL;
9979 + }
9980 + jedec = id[0];
9981 + jedec = jedec << 8;
9982 + jedec |= id[1];
9983 + jedec = jedec << 8;
9984 + jedec |= id[2];
9985 +
9986 + for (tmp = 0, info = m25p_data;
9987 + tmp < ARRAY_SIZE(m25p_data);
9988 + tmp++, info++) {
9989 + if (info->jedec_id == jedec)
9990 + return info;
9991 + }
9992 + dev_err(&spi->dev, "unrecognized JEDEC id %06x\n", jedec);
9993 + return NULL;
9994 +}
9995 +
9996 +
9997 /*
9998 * board specific setup should have ensured the SPI clock used here
9999 * matches what the READ command supports, at least until this driver
10000 @@ -429,37 +531,51 @@ static int __devinit m25p_probe(struct spi_device *spi)
10001 unsigned i;
10002
10003 /* Platform data helps sort out which chip type we have, as
10004 - * well as how this board partitions it.
10005 + * well as how this board partitions it. If we don't have
10006 + * a chip ID, try the JEDEC id commands; they'll work for most
10007 + * newer chips, even if we don't recognize the particular chip.
10008 */
10009 data = spi->dev.platform_data;
10010 - if (!data || !data->type) {
10011 - /* FIXME some chips can identify themselves with RES
10012 - * or JEDEC get-id commands. Try them ...
10013 - */
10014 - DEBUG(MTD_DEBUG_LEVEL1, "%s: no chip id\n",
10015 - spi->dev.bus_id);
10016 - return -ENODEV;
10017 - }
10018 + if (data && data->type) {
10019 + for (i = 0, info = m25p_data;
10020 + i < ARRAY_SIZE(m25p_data);
10021 + i++, info++) {
10022 + if (strcmp(data->type, info->name) == 0)
10023 + break;
10024 + }
10025
10026 - for (i = 0, info = m25p_data; i < ARRAY_SIZE(m25p_data); i++, info++) {
10027 - if (strcmp(data->type, info->name) == 0)
10028 - break;
10029 - }
10030 - if (i == ARRAY_SIZE(m25p_data)) {
10031 - DEBUG(MTD_DEBUG_LEVEL1, "%s: unrecognized id %s\n",
10032 - spi->dev.bus_id, data->type);
10033 + /* unrecognized chip? */
10034 + if (i == ARRAY_SIZE(m25p_data)) {
10035 + DEBUG(MTD_DEBUG_LEVEL0, "%s: unrecognized id %s\n",
10036 + spi->dev.bus_id, data->type);
10037 + info = NULL;
10038 +
10039 + /* recognized; is that chip really what's there? */
10040 + } else if (info->jedec_id) {
10041 + struct flash_info *chip = jedec_probe(spi);
10042 +
10043 + if (!chip || chip != info) {
10044 + dev_warn(&spi->dev, "found %s, expected %s\n",
10045 + chip ? chip->name : "UNKNOWN",
10046 + info->name);
10047 + info = NULL;
10048 + }
10049 + }
10050 + } else
10051 + info = jedec_probe(spi);
10052 +
10053 + if (!info)
10054 return -ENODEV;
10055 - }
10056
10057 flash = kzalloc(sizeof *flash, GFP_KERNEL);
10058 if (!flash)
10059 return -ENOMEM;
10060
10061 flash->spi = spi;
10062 - init_MUTEX(&flash->lock);
10063 + mutex_init(&flash->lock);
10064 dev_set_drvdata(&spi->dev, flash);
10065
10066 - if (data->name)
10067 + if (data && data->name)
10068 flash->mtd.name = data->name;
10069 else
10070 flash->mtd.name = spi->dev.bus_id;
10071 @@ -468,17 +584,25 @@ static int __devinit m25p_probe(struct spi_device *spi)
10072 flash->mtd.writesize = 1;
10073 flash->mtd.flags = MTD_CAP_NORFLASH;
10074 flash->mtd.size = info->sector_size * info->n_sectors;
10075 - flash->mtd.erasesize = info->sector_size;
10076 flash->mtd.erase = m25p80_erase;
10077 flash->mtd.read = m25p80_read;
10078 flash->mtd.write = m25p80_write;
10079
10080 + /* prefer "small sector" erase if possible */
10081 + if (info->flags & SECT_4K) {
10082 + flash->erase_opcode = OPCODE_BE_4K;
10083 + flash->mtd.erasesize = 4096;
10084 + } else {
10085 + flash->erase_opcode = OPCODE_SE;
10086 + flash->mtd.erasesize = info->sector_size;
10087 + }
10088 +
10089 dev_info(&spi->dev, "%s (%d Kbytes)\n", info->name,
10090 flash->mtd.size / 1024);
10091
10092 DEBUG(MTD_DEBUG_LEVEL2,
10093 - "mtd .name = %s, .size = 0x%.8x (%uM) "
10094 - ".erasesize = 0x%.8x (%uK) .numeraseregions = %d\n",
10095 + "mtd .name = %s, .size = 0x%.8x (%uMiB) "
10096 + ".erasesize = 0x%.8x (%uKiB) .numeraseregions = %d\n",
10097 flash->mtd.name,
10098 flash->mtd.size, flash->mtd.size / (1024*1024),
10099 flash->mtd.erasesize, flash->mtd.erasesize / 1024,
10100 @@ -488,7 +612,7 @@ static int __devinit m25p_probe(struct spi_device *spi)
10101 for (i = 0; i < flash->mtd.numeraseregions; i++)
10102 DEBUG(MTD_DEBUG_LEVEL2,
10103 "mtd.eraseregions[%d] = { .offset = 0x%.8x, "
10104 - ".erasesize = 0x%.8x (%uK), "
10105 + ".erasesize = 0x%.8x (%uKiB), "
10106 ".numblocks = %d }\n",
10107 i, flash->mtd.eraseregions[i].offset,
10108 flash->mtd.eraseregions[i].erasesize,
10109 @@ -516,14 +640,14 @@ static int __devinit m25p_probe(struct spi_device *spi)
10110 }
10111
10112 if (nr_parts > 0) {
10113 - for (i = 0; i < data->nr_parts; i++) {
10114 + for (i = 0; i < nr_parts; i++) {
10115 DEBUG(MTD_DEBUG_LEVEL2, "partitions[%d] = "
10116 "{.name = %s, .offset = 0x%.8x, "
10117 - ".size = 0x%.8x (%uK) }\n",
10118 - i, data->parts[i].name,
10119 - data->parts[i].offset,
10120 - data->parts[i].size,
10121 - data->parts[i].size / 1024);
10122 + ".size = 0x%.8x (%uKiB) }\n",
10123 + i, parts[i].name,
10124 + parts[i].offset,
10125 + parts[i].size,
10126 + parts[i].size / 1024);
10127 }
10128 flash->partitioned = 1;
10129 return add_mtd_partitions(&flash->mtd, parts, nr_parts);
10130 @@ -560,6 +684,11 @@ static struct spi_driver m25p80_driver = {
10131 },
10132 .probe = m25p_probe,
10133 .remove = __devexit_p(m25p_remove),
10134 +
10135 + /* REVISIT: many of these chips have deep power-down modes, which
10136 + * should clearly be entered on suspend() to minimize power use.
10137 + * And also when they're otherwise idle...
10138 + */
10139 };
10140
10141
10142 diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
10143 index a987e91..a5ed6d2 100644
10144 --- a/drivers/mtd/devices/mtd_dataflash.c
10145 +++ b/drivers/mtd/devices/mtd_dataflash.c
10146 @@ -14,6 +14,7 @@
10147 #include <linux/slab.h>
10148 #include <linux/delay.h>
10149 #include <linux/device.h>
10150 +#include <linux/mutex.h>
10151 #include <linux/spi/spi.h>
10152 #include <linux/spi/flash.h>
10153
10154 @@ -89,7 +90,7 @@ struct dataflash {
10155 unsigned short page_offset; /* offset in flash address */
10156 unsigned int page_size; /* of bytes per page */
10157
10158 - struct semaphore lock;
10159 + struct mutex lock;
10160 struct spi_device *spi;
10161
10162 struct mtd_info mtd;
10163 @@ -167,7 +168,7 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
10164 x.len = 4;
10165 spi_message_add_tail(&x, &msg);
10166
10167 - down(&priv->lock);
10168 + mutex_lock(&priv->lock);
10169 while (instr->len > 0) {
10170 unsigned int pageaddr;
10171 int status;
10172 @@ -210,7 +211,7 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
10173 instr->len -= priv->page_size;
10174 }
10175 }
10176 - up(&priv->lock);
10177 + mutex_unlock(&priv->lock);
10178
10179 /* Inform MTD subsystem that erase is complete */
10180 instr->state = MTD_ERASE_DONE;
10181 @@ -266,7 +267,7 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len,
10182 x[1].len = len;
10183 spi_message_add_tail(&x[1], &msg);
10184
10185 - down(&priv->lock);
10186 + mutex_lock(&priv->lock);
10187
10188 /* Continuous read, max clock = f(car) which may be less than
10189 * the peak rate available. Some chips support commands with
10190 @@ -279,7 +280,7 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len,
10191 /* plus 4 "don't care" bytes */
10192
10193 status = spi_sync(priv->spi, &msg);
10194 - up(&priv->lock);
10195 + mutex_unlock(&priv->lock);
10196
10197 if (status >= 0) {
10198 *retlen = msg.actual_length - 8;
10199 @@ -336,7 +337,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len,
10200 else
10201 writelen = len;
10202
10203 - down(&priv->lock);
10204 + mutex_lock(&priv->lock);
10205 while (remaining > 0) {
10206 DEBUG(MTD_DEBUG_LEVEL3, "write @ %i:%i len=%i\n",
10207 pageaddr, offset, writelen);
10208 @@ -441,7 +442,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len,
10209 else
10210 writelen = remaining;
10211 }
10212 - up(&priv->lock);
10213 + mutex_unlock(&priv->lock);
10214
10215 return status;
10216 }
10217 @@ -463,7 +464,7 @@ add_dataflash(struct spi_device *spi, char *name,
10218 if (!priv)
10219 return -ENOMEM;
10220
10221 - init_MUTEX(&priv->lock);
10222 + mutex_init(&priv->lock);
10223 priv->spi = spi;
10224 priv->page_size = pagesize;
10225 priv->page_offset = pageoffset;
10226 diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c
10227 index e8f686f..7060a08 100644
10228 --- a/drivers/mtd/devices/pmc551.c
10229 +++ b/drivers/mtd/devices/pmc551.c
10230 @@ -30,8 +30,8 @@
10231 *
10232 * Notes:
10233 * Due to what I assume is more buggy SROM, the 64M PMC551 I
10234 - * have available claims that all 4 of it's DRAM banks have 64M
10235 - * of ram configured (making a grand total of 256M onboard).
10236 + * have available claims that all 4 of its DRAM banks have 64MiB
10237 + * of ram configured (making a grand total of 256MiB onboard).
10238 * This is slightly annoying since the BAR0 size reflects the
10239 * aperture size, not the dram size, and the V370PDC supplies no
10240 * other method for memory size discovery. This problem is
10241 @@ -70,7 +70,7 @@
10242 * made the memory unusable, added a fix to code to touch up
10243 * the DRAM some.
10244 *
10245 - * Bugs/FIXME's:
10246 + * Bugs/FIXMEs:
10247 * * MUST fix the init function to not spin on a register
10248 * waiting for it to set .. this does not safely handle busted
10249 * devices that never reset the register correctly which will
10250 @@ -562,10 +562,10 @@ static u32 fixup_pmc551(struct pci_dev *dev)
10251 /*
10252 * Some screen fun
10253 */
10254 - printk(KERN_DEBUG "pmc551: %d%c (0x%x) of %sprefetchable memory at "
10255 + printk(KERN_DEBUG "pmc551: %d%sB (0x%x) of %sprefetchable memory at "
10256 "0x%llx\n", (size < 1024) ? size : (size < 1048576) ?
10257 size >> 10 : size >> 20,
10258 - (size < 1024) ? 'B' : (size < 1048576) ? 'K' : 'M', size,
10259 + (size < 1024) ? "" : (size < 1048576) ? "Ki" : "Mi", size,
10260 ((dcmd & (0x1 << 3)) == 0) ? "non-" : "",
10261 (unsigned long long)pci_resource_start(dev, 0));
10262
10263 @@ -649,14 +649,10 @@ MODULE_DESCRIPTION(PMC551_VERSION);
10264 * Stuff these outside the ifdef so as to not bust compiled in driver support
10265 */
10266 static int msize = 0;
10267 -#if defined(CONFIG_MTD_PMC551_APERTURE_SIZE)
10268 -static int asize = CONFIG_MTD_PMC551_APERTURE_SIZE;
10269 -#else
10270 static int asize = 0;
10271 -#endif
10272
10273 module_param(msize, int, 0);
10274 -MODULE_PARM_DESC(msize, "memory size in Megabytes [1 - 1024]");
10275 +MODULE_PARM_DESC(msize, "memory size in MiB [1 - 1024]");
10276 module_param(asize, int, 0);
10277 MODULE_PARM_DESC(asize, "aperture size, must be <= memsize [1-1024]");
10278
10279 @@ -799,8 +795,7 @@ static int __init init_pmc551(void)
10280 mtd->owner = THIS_MODULE;
10281
10282 if (add_mtd_device(mtd)) {
10283 - printk(KERN_NOTICE "pmc551: Failed to register new "
10284 - "device\n");
10285 + printk(KERN_NOTICE "pmc551: Failed to register new device\n");
10286 pci_iounmap(PCI_Device, priv->start);
10287 kfree(mtd->priv);
10288 kfree(mtd);
10289 @@ -811,13 +806,13 @@ static int __init init_pmc551(void)
10290 pci_dev_get(PCI_Device);
10291
10292 printk(KERN_NOTICE "Registered pmc551 memory device.\n");
10293 - printk(KERN_NOTICE "Mapped %dM of memory from 0x%p to 0x%p\n",
10294 + printk(KERN_NOTICE "Mapped %dMiB of memory from 0x%p to 0x%p\n",
10295 priv->asize >> 20,
10296 priv->start, priv->start + priv->asize);
10297 - printk(KERN_NOTICE "Total memory is %d%c\n",
10298 + printk(KERN_NOTICE "Total memory is %d%sB\n",
10299 (length < 1024) ? length :
10300 (length < 1048576) ? length >> 10 : length >> 20,
10301 - (length < 1024) ? 'B' : (length < 1048576) ? 'K' : 'M');
10302 + (length < 1024) ? "" : (length < 1048576) ? "Ki" : "Mi");
10303 priv->nextpmc551 = pmc551list;
10304 pmc551list = mtd;
10305 found++;
10306 @@ -850,7 +845,7 @@ static void __exit cleanup_pmc551(void)
10307 pmc551list = priv->nextpmc551;
10308
10309 if (priv->start) {
10310 - printk(KERN_DEBUG "pmc551: unmapping %dM starting at "
10311 + printk(KERN_DEBUG "pmc551: unmapping %dMiB starting at "
10312 "0x%p\n", priv->asize >> 20, priv->start);
10313 pci_iounmap(priv->dev, priv->start);
10314 }
10315 diff --git a/drivers/mtd/maps/nettel.c b/drivers/mtd/maps/nettel.c
10316 index 7b96cd0..0c9b305 100644
10317 --- a/drivers/mtd/maps/nettel.c
10318 +++ b/drivers/mtd/maps/nettel.c
10319 @@ -158,68 +158,11 @@ static struct notifier_block nettel_notifier_block = {
10320 nettel_reboot_notifier, NULL, 0
10321 };
10322
10323 -/*
10324 - * Erase the configuration file system.
10325 - * Used to support the software reset button.
10326 - */
10327 -static void nettel_erasecallback(struct erase_info *done)
10328 -{
10329 - wait_queue_head_t *wait_q = (wait_queue_head_t *)done->priv;
10330 - wake_up(wait_q);
10331 -}
10332 -
10333 -static struct erase_info nettel_erase;
10334 -
10335 -int nettel_eraseconfig(void)
10336 -{
10337 - struct mtd_info *mtd;
10338 - DECLARE_WAITQUEUE(wait, current);
10339 - wait_queue_head_t wait_q;
10340 - int ret;
10341 -
10342 - init_waitqueue_head(&wait_q);
10343 - mtd = get_mtd_device(NULL, 2);
10344 - if (!IS_ERR(mtd)) {
10345 - nettel_erase.mtd = mtd;
10346 - nettel_erase.callback = nettel_erasecallback;
10347 - nettel_erase.callback = NULL;
10348 - nettel_erase.addr = 0;
10349 - nettel_erase.len = mtd->size;
10350 - nettel_erase.priv = (u_long) &wait_q;
10351 - nettel_erase.priv = 0;
10352 -
10353 - set_current_state(TASK_INTERRUPTIBLE);
10354 - add_wait_queue(&wait_q, &wait);
10355 -
10356 - ret = mtd->erase(mtd, &nettel_erase);
10357 - if (ret) {
10358 - set_current_state(TASK_RUNNING);
10359 - remove_wait_queue(&wait_q, &wait);
10360 - put_mtd_device(mtd);
10361 - return(ret);
10362 - }
10363 -
10364 - schedule(); /* Wait for erase to finish. */
10365 - remove_wait_queue(&wait_q, &wait);
10366 -
10367 - put_mtd_device(mtd);
10368 - }
10369 -
10370 - return(0);
10371 -}
10372 -
10373 -#else
10374 -
10375 -int nettel_eraseconfig(void)
10376 -{
10377 - return(0);
10378 -}
10379 -
10380 #endif
10381
10382 /****************************************************************************/
10383
10384 -int __init nettel_init(void)
10385 +static int __init nettel_init(void)
10386 {
10387 volatile unsigned long *amdpar;
10388 unsigned long amdaddr, maxsize;
10389 @@ -421,10 +364,6 @@ int __init nettel_init(void)
10390
10391 intel_mtd->owner = THIS_MODULE;
10392
10393 -#ifndef CONFIG_BLK_DEV_INITRD
10394 - ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, 1);
10395 -#endif
10396 -
10397 num_intel_partitions = sizeof(nettel_intel_partitions) /
10398 sizeof(nettel_intel_partitions[0]);
10399
10400 @@ -477,7 +416,7 @@ out_unmap2:
10401
10402 /****************************************************************************/
10403
10404 -void __exit nettel_cleanup(void)
10405 +static void __exit nettel_cleanup(void)
10406 {
10407 #ifdef CONFIG_MTD_CFI_INTELEXT
10408 unregister_reboot_notifier(&nettel_notifier_block);
10409 diff --git a/drivers/mtd/maps/pmcmsp-ramroot.c b/drivers/mtd/maps/pmcmsp-ramroot.c
10410 index 18049bc..30de5c0 100644
10411 --- a/drivers/mtd/maps/pmcmsp-ramroot.c
10412 +++ b/drivers/mtd/maps/pmcmsp-ramroot.c
10413 @@ -79,7 +79,6 @@ static int __init init_rrmap(void)
10414 rr_mtd->owner = THIS_MODULE;
10415
10416 add_mtd_device(rr_mtd);
10417 - ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, rr_mtd->index);
10418
10419 return 0;
10420 }
10421 diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
10422 index ef89780..74d9d30 100644
10423 --- a/drivers/mtd/mtd_blkdevs.c
10424 +++ b/drivers/mtd/mtd_blkdevs.c
10425 @@ -24,10 +24,9 @@
10426 #include <linux/kthread.h>
10427 #include <asm/uaccess.h>
10428
10429 -static LIST_HEAD(blktrans_majors);
10430 +#include "mtdcore.h"
10431
10432 -extern struct mutex mtd_table_mutex;
10433 -extern struct mtd_info *mtd_table[];
10434 +static LIST_HEAD(blktrans_majors);
10435
10436 struct mtd_blkcore_priv {
10437 struct task_struct *thread;
10438 @@ -202,7 +201,7 @@ static int blktrans_ioctl(struct inode *inode, struct file *file,
10439 }
10440 }
10441
10442 -struct block_device_operations mtd_blktrans_ops = {
10443 +static struct block_device_operations mtd_blktrans_ops = {
10444 .owner = THIS_MODULE,
10445 .open = blktrans_open,
10446 .release = blktrans_release,
10447 diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
10448 index d091b24..22ed96c 100644
10449 --- a/drivers/mtd/mtdchar.c
10450 +++ b/drivers/mtd/mtdchar.c
10451 @@ -136,7 +136,8 @@ static int mtd_close(struct inode *inode, struct file *file)
10452
10453 DEBUG(MTD_DEBUG_LEVEL0, "MTD_close\n");
10454
10455 - if (mtd->sync)
10456 + /* Only sync if opened RW */
10457 + if ((file->f_mode & 2) && mtd->sync)
10458 mtd->sync(mtd);
10459
10460 put_mtd_device(mtd);
10461 diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
10462 index c153b64..6c2645e 100644
10463 --- a/drivers/mtd/mtdcore.c
10464 +++ b/drivers/mtd/mtdcore.c
10465 @@ -22,6 +22,8 @@
10466
10467 #include <linux/mtd/mtd.h>
10468
10469 +#include "mtdcore.h"
10470 +
10471 /* These are exported solely for the purpose of mtd_blkdevs.c. You
10472 should not use them for _anything_ else */
10473 DEFINE_MUTEX(mtd_table_mutex);
10474 diff --git a/drivers/mtd/mtdcore.h b/drivers/mtd/mtdcore.h
10475 new file mode 100644
10476 index 0000000..a33251f
10477 --- /dev/null
10478 +++ b/drivers/mtd/mtdcore.h
10479 @@ -0,0 +1,11 @@
10480 +/* linux/drivers/mtd/mtdcore.h
10481 + *
10482 + * Header file for driver private mtdcore exports
10483 + *
10484 + */
10485 +
10486 +/* These are exported solely for the purpose of mtd_blkdevs.c. You
10487 + should not use them for _anything_ else */
10488 +
10489 +extern struct mutex mtd_table_mutex;
10490 +extern struct mtd_info *mtd_table[MAX_MTD_DEVICES];
10491 diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
10492 new file mode 100644
10493 index 0000000..cfc28ab
10494 --- /dev/null
10495 +++ b/drivers/mtd/mtdoops.c
10496 @@ -0,0 +1,365 @@
10497 +/*
10498 + * MTD Oops/Panic logger
10499 + *
10500 + * Copyright (C) 2007 Nokia Corporation. All rights reserved.
10501 + *
10502 + * Author: Richard Purdie <rpurdie@openedhand.com>
10503 + *
10504 + * This program is free software; you can redistribute it and/or
10505 + * modify it under the terms of the GNU General Public License
10506 + * version 2 as published by the Free Software Foundation.
10507 + *
10508 + * This program is distributed in the hope that it will be useful, but
10509 + * WITHOUT ANY WARRANTY; without even the implied warranty of
10510 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10511 + * General Public License for more details.
10512 + *
10513 + * You should have received a copy of the GNU General Public License
10514 + * along with this program; if not, write to the Free Software
10515 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
10516 + * 02110-1301 USA
10517 + *
10518 + */
10519 +
10520 +#include <linux/kernel.h>
10521 +#include <linux/module.h>
10522 +#include <linux/console.h>
10523 +#include <linux/vmalloc.h>
10524 +#include <linux/workqueue.h>
10525 +#include <linux/sched.h>
10526 +#include <linux/wait.h>
10527 +#include <linux/mtd/mtd.h>
10528 +
10529 +#define OOPS_PAGE_SIZE 4096
10530 +
10531 +static struct mtdoops_context {
10532 + int mtd_index;
10533 + struct work_struct work;
10534 + struct mtd_info *mtd;
10535 + int oops_pages;
10536 + int nextpage;
10537 + int nextcount;
10538 +
10539 + void *oops_buf;
10540 + int ready;
10541 + int writecount;
10542 +} oops_cxt;
10543 +
10544 +static void mtdoops_erase_callback(struct erase_info *done)
10545 +{
10546 + wait_queue_head_t *wait_q = (wait_queue_head_t *)done->priv;
10547 + wake_up(wait_q);
10548 +}
10549 +
10550 +static int mtdoops_erase_block(struct mtd_info *mtd, int offset)
10551 +{
10552 + struct erase_info erase;
10553 + DECLARE_WAITQUEUE(wait, current);
10554 + wait_queue_head_t wait_q;
10555 + int ret;
10556 +
10557 + init_waitqueue_head(&wait_q);
10558 + erase.mtd = mtd;
10559 + erase.callback = mtdoops_erase_callback;
10560 + erase.addr = offset;
10561 + if (mtd->erasesize < OOPS_PAGE_SIZE)
10562 + erase.len = OOPS_PAGE_SIZE;
10563 + else
10564 + erase.len = mtd->erasesize;
10565 + erase.priv = (u_long)&wait_q;
10566 +
10567 + set_current_state(TASK_INTERRUPTIBLE);
10568 + add_wait_queue(&wait_q, &wait);
10569 +
10570 + ret = mtd->erase(mtd, &erase);
10571 + if (ret) {
10572 + set_current_state(TASK_RUNNING);
10573 + remove_wait_queue(&wait_q, &wait);
10574 + printk (KERN_WARNING "mtdoops: erase of region [0x%x, 0x%x] "
10575 + "on \"%s\" failed\n",
10576 + erase.addr, erase.len, mtd->name);
10577 + return ret;
10578 + }
10579 +
10580 + schedule(); /* Wait for erase to finish. */
10581 + remove_wait_queue(&wait_q, &wait);
10582 +
10583 + return 0;
10584 +}
10585 +
10586 +static int mtdoops_inc_counter(struct mtdoops_context *cxt)
10587 +{
10588 + struct mtd_info *mtd = cxt->mtd;
10589 + size_t retlen;
10590 + u32 count;
10591 + int ret;
10592 +
10593 + cxt->nextpage++;
10594 + if (cxt->nextpage > cxt->oops_pages)
10595 + cxt->nextpage = 0;
10596 + cxt->nextcount++;
10597 + if (cxt->nextcount == 0xffffffff)
10598 + cxt->nextcount = 0;
10599 +
10600 + ret = mtd->read(mtd, cxt->nextpage * OOPS_PAGE_SIZE, 4,
10601 + &retlen, (u_char *) &count);
10602 + if ((retlen != 4) || (ret < 0)) {
10603 + printk(KERN_ERR "mtdoops: Read failure at %d (%d of 4 read)"
10604 + ", err %d.\n", cxt->nextpage * OOPS_PAGE_SIZE,
10605 + retlen, ret);
10606 + return 1;
10607 + }
10608 +
10609 + /* See if we need to erase the next block */
10610 + if (count != 0xffffffff)
10611 + return 1;
10612 +
10613 + printk(KERN_DEBUG "mtdoops: Ready %d, %d (no erase)\n",
10614 + cxt->nextpage, cxt->nextcount);
10615 + cxt->ready = 1;
10616 + return 0;
10617 +}
10618 +
10619 +static void mtdoops_prepare(struct mtdoops_context *cxt)
10620 +{
10621 + struct mtd_info *mtd = cxt->mtd;
10622 + int i = 0, j, ret, mod;
10623 +
10624 + /* We were unregistered */
10625 + if (!mtd)
10626 + return;
10627 +
10628 + mod = (cxt->nextpage * OOPS_PAGE_SIZE) % mtd->erasesize;
10629 + if (mod != 0) {
10630 + cxt->nextpage = cxt->nextpage + ((mtd->erasesize - mod) / OOPS_PAGE_SIZE);
10631 + if (cxt->nextpage > cxt->oops_pages)
10632 + cxt->nextpage = 0;
10633 + }
10634 +
10635 + while (mtd->block_isbad &&
10636 + mtd->block_isbad(mtd, cxt->nextpage * OOPS_PAGE_SIZE)) {
10637 +badblock:
10638 + printk(KERN_WARNING "mtdoops: Bad block at %08x\n",
10639 + cxt->nextpage * OOPS_PAGE_SIZE);
10640 + i++;
10641 + cxt->nextpage = cxt->nextpage + (mtd->erasesize / OOPS_PAGE_SIZE);
10642 + if (cxt->nextpage > cxt->oops_pages)
10643 + cxt->nextpage = 0;
10644 + if (i == (cxt->oops_pages / (mtd->erasesize / OOPS_PAGE_SIZE))) {
10645 + printk(KERN_ERR "mtdoops: All blocks bad!\n");
10646 + return;
10647 + }
10648 + }
10649 +
10650 + for (j = 0, ret = -1; (j < 3) && (ret < 0); j++)
10651 + ret = mtdoops_erase_block(mtd, cxt->nextpage * OOPS_PAGE_SIZE);
10652 +
10653 + if (ret < 0) {
10654 + if (mtd->block_markbad)
10655 + mtd->block_markbad(mtd, cxt->nextpage * OOPS_PAGE_SIZE);
10656 + goto badblock;
10657 + }
10658 +
10659 + printk(KERN_DEBUG "mtdoops: Ready %d, %d \n", cxt->nextpage, cxt->nextcount);
10660 +
10661 + cxt->ready = 1;
10662 +}
10663 +
10664 +static void mtdoops_workfunc(struct work_struct *work)
10665 +{
10666 + struct mtdoops_context *cxt =
10667 + container_of(work, struct mtdoops_context, work);
10668 +
10669 + mtdoops_prepare(cxt);
10670 +}
10671 +
10672 +static int find_next_position(struct mtdoops_context *cxt)
10673 +{
10674 + struct mtd_info *mtd = cxt->mtd;
10675 + int page, maxpos = 0;
10676 + u32 count, maxcount = 0xffffffff;
10677 + size_t retlen;
10678 +
10679 + for (page = 0; page < cxt->oops_pages; page++) {
10680 + mtd->read(mtd, page * OOPS_PAGE_SIZE, 4, &retlen, (u_char *) &count);
10681 + if (count == 0xffffffff)
10682 + continue;
10683 + if (maxcount == 0xffffffff) {
10684 + maxcount = count;
10685 + maxpos = page;
10686 + } else if ((count < 0x40000000) && (maxcount > 0xc0000000)) {
10687 + maxcount = count;
10688 + maxpos = page;
10689 + } else if ((count > maxcount) && (count < 0xc0000000)) {
10690 + maxcount = count;
10691 + maxpos = page;
10692 + } else if ((count > maxcount) && (count > 0xc0000000)
10693 + && (maxcount > 0x80000000)) {
10694 + maxcount = count;
10695 + maxpos = page;
10696 + }
10697 + }
10698 + if (maxcount == 0xffffffff) {
10699 + cxt->nextpage = 0;
10700 + cxt->nextcount = 1;
10701 + cxt->ready = 1;
10702 + printk(KERN_DEBUG "mtdoops: Ready %d, %d (first init)\n",
10703 + cxt->nextpage, cxt->nextcount);
10704 + return 0;
10705 + }
10706 +
10707 + cxt->nextpage = maxpos;
10708 + cxt->nextcount = maxcount;
10709 +
10710 + return mtdoops_inc_counter(cxt);
10711 +}
10712 +
10713 +
10714 +static void mtdoops_notify_add(struct mtd_info *mtd)
10715 +{
10716 + struct mtdoops_context *cxt = &oops_cxt;
10717 + int ret;
10718 +
10719 + if ((mtd->index != cxt->mtd_index) || cxt->mtd_index < 0)
10720 + return;
10721 +
10722 + if (mtd->size < (mtd->erasesize * 2)) {
10723 + printk(KERN_ERR "MTD partition %d not big enough for mtdoops\n",
10724 + mtd->index);
10725 + return;
10726 + }
10727 +
10728 + cxt->mtd = mtd;
10729 + cxt->oops_pages = mtd->size / OOPS_PAGE_SIZE;
10730 +
10731 + ret = find_next_position(cxt);
10732 + if (ret == 1)
10733 + mtdoops_prepare(cxt);
10734 +
10735 + printk(KERN_DEBUG "mtdoops: Attached to MTD device %d\n", mtd->index);
10736 +}
10737 +
10738 +static void mtdoops_notify_remove(struct mtd_info *mtd)
10739 +{
10740 + struct mtdoops_context *cxt = &oops_cxt;
10741 +
10742 + if ((mtd->index != cxt->mtd_index) || cxt->mtd_index < 0)
10743 + return;
10744 +
10745 + cxt->mtd = NULL;
10746 + flush_scheduled_work();
10747 +}
10748 +
10749 +
10750 +static void
10751 +mtdoops_console_write(struct console *co, const char *s, unsigned int count)
10752 +{
10753 + struct mtdoops_context *cxt = co->data;
10754 + struct mtd_info *mtd = cxt->mtd;
10755 + int i, ret;
10756 +
10757 + if (!cxt->ready || !mtd)
10758 + return;
10759 +
10760 + if (!oops_in_progress && cxt->writecount != 0) {
10761 + size_t retlen;
10762 + if (cxt->writecount < OOPS_PAGE_SIZE)
10763 + memset(cxt->oops_buf + cxt->writecount, 0xff,
10764 + OOPS_PAGE_SIZE - cxt->writecount);
10765 +
10766 + ret = mtd->write(mtd, cxt->nextpage * OOPS_PAGE_SIZE,
10767 + OOPS_PAGE_SIZE, &retlen, cxt->oops_buf);
10768 + cxt->ready = 0;
10769 + cxt->writecount = 0;
10770 +
10771 + if ((retlen != OOPS_PAGE_SIZE) || (ret < 0))
10772 + printk(KERN_ERR "mtdoops: Write failure at %d (%d of %d"
10773 + " written), err %d.\n",
10774 + cxt->nextpage * OOPS_PAGE_SIZE, retlen,
10775 + OOPS_PAGE_SIZE, ret);
10776 +
10777 + ret = mtdoops_inc_counter(cxt);
10778 + if (ret == 1)
10779 + schedule_work(&cxt->work);
10780 + }
10781 +
10782 + if (!oops_in_progress)
10783 + return;
10784 +
10785 + if (cxt->writecount == 0) {
10786 + u32 *stamp = cxt->oops_buf;
10787 + *stamp = cxt->nextcount;
10788 + cxt->writecount = 4;
10789 + }
10790 +
10791 + if ((count + cxt->writecount) > OOPS_PAGE_SIZE)
10792 + count = OOPS_PAGE_SIZE - cxt->writecount;
10793 +
10794 + for (i = 0; i < count; i++, s++)
10795 + *((char *)(cxt->oops_buf) + cxt->writecount + i) = *s;
10796 +
10797 + cxt->writecount = cxt->writecount + count;
10798 +}
10799 +
10800 +static int __init mtdoops_console_setup(struct console *co, char *options)
10801 +{
10802 + struct mtdoops_context *cxt = co->data;
10803 +
10804 + if (cxt->mtd_index != -1)
10805 + return -EBUSY;
10806 + if (co->index == -1)
10807 + return -EINVAL;
10808 +
10809 + cxt->mtd_index = co->index;
10810 + return 0;
10811 +}
10812 +
10813 +static struct mtd_notifier mtdoops_notifier = {
10814 + .add = mtdoops_notify_add,
10815 + .remove = mtdoops_notify_remove,
10816 +};
10817 +
10818 +static struct console mtdoops_console = {
10819 + .name = "ttyMTD",
10820 + .write = mtdoops_console_write,
10821 + .setup = mtdoops_console_setup,
10822 + .flags = CON_PRINTBUFFER,
10823 + .index = -1,
10824 + .data = &oops_cxt,
10825 +};
10826 +
10827 +static int __init mtdoops_console_init(void)
10828 +{
10829 + struct mtdoops_context *cxt = &oops_cxt;
10830 +
10831 + cxt->mtd_index = -1;
10832 + cxt->oops_buf = vmalloc(OOPS_PAGE_SIZE);
10833 +
10834 + if (!cxt->oops_buf) {
10835 + printk(KERN_ERR "Failed to allocate oops buffer workspace\n");
10836 + return -ENOMEM;
10837 + }
10838 +
10839 + INIT_WORK(&cxt->work, mtdoops_workfunc);
10840 +
10841 + register_console(&mtdoops_console);
10842 + register_mtd_user(&mtdoops_notifier);
10843 + return 0;
10844 +}
10845 +
10846 +static void __exit mtdoops_console_exit(void)
10847 +{
10848 + struct mtdoops_context *cxt = &oops_cxt;
10849 +
10850 + unregister_mtd_user(&mtdoops_notifier);
10851 + unregister_console(&mtdoops_console);
10852 + vfree(cxt->oops_buf);
10853 +}
10854 +
10855 +
10856 +subsys_initcall(mtdoops_console_init);
10857 +module_exit(mtdoops_console_exit);
10858 +
10859 +MODULE_LICENSE("GPL");
10860 +MODULE_AUTHOR("Richard Purdie <rpurdie@openedhand.com>");
10861 +MODULE_DESCRIPTION("MTD Oops/Panic console logger/driver");
10862 diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
10863 index f1d60b6..df25cab 100644
10864 --- a/drivers/mtd/nand/Kconfig
10865 +++ b/drivers/mtd/nand/Kconfig
10866 @@ -134,10 +134,10 @@ config MTD_NAND_S3C2410_HWECC
10867
10868 config MTD_NAND_NDFC
10869 tristate "NDFC NanD Flash Controller"
10870 - depends on 44x
10871 + depends on 4xx
10872 select MTD_NAND_ECC_SMC
10873 help
10874 - NDFC Nand Flash Controllers are integrated in EP44x SoCs
10875 + NDFC Nand Flash Controllers are integrated in IBM/AMCC's 4xx SoCs
10876
10877 config MTD_NAND_S3C2410_CLKSTOP
10878 bool "S3C2410 NAND IDLE clock stop"
10879 @@ -237,7 +237,7 @@ config MTD_NAND_CAFE
10880 select REED_SOLOMON
10881 select REED_SOLOMON_DEC16
10882 help
10883 - Use NAND flash attached to the CAFÉ chip designed for the $100
10884 + Use NAND flash attached to the CAFÉ chip designed for the OLPC
10885 laptop.
10886
10887 config MTD_NAND_CS553X
10888 diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
10889 index cff969d..cca69b3 100644
10890 --- a/drivers/mtd/nand/cafe_nand.c
10891 +++ b/drivers/mtd/nand/cafe_nand.c
10892 @@ -821,14 +821,53 @@ static struct pci_device_id cafe_nand_tbl[] = {
10893
10894 MODULE_DEVICE_TABLE(pci, cafe_nand_tbl);
10895
10896 +static int cafe_nand_resume(struct pci_dev *pdev)
10897 +{
10898 + uint32_t timing1, timing2, timing3;
10899 + uint32_t ctrl;
10900 + struct mtd_info *mtd = pci_get_drvdata(pdev);
10901 + struct cafe_priv *cafe = mtd->priv;
10902 +
10903 + timing1 = timing2 = timing3 = 0xffffffff;
10904 + /* Start off by resetting the NAND controller completely */
10905 + cafe_writel(cafe, 1, NAND_RESET);
10906 + cafe_writel(cafe, 0, NAND_RESET);
10907 + cafe_writel(cafe, timing1, NAND_TIMING1);
10908 + cafe_writel(cafe, timing2, NAND_TIMING2);
10909 + cafe_writel(cafe, timing3, NAND_TIMING3);
10910 + cafe_writel(cafe, 0xffffffff, NAND_IRQ_MASK);
10911 +
10912 + /* Disable master reset, enable NAND clock */
10913 + ctrl = cafe_readl(cafe, GLOBAL_CTRL);
10914 + ctrl &= 0xffffeff0;
10915 + ctrl |= 0x00007000;
10916 + cafe_writel(cafe, ctrl | 0x05, GLOBAL_CTRL);
10917 + cafe_writel(cafe, ctrl | 0x0a, GLOBAL_CTRL);
10918 + cafe_writel(cafe, 0, NAND_DMA_CTRL);
10919 + cafe_writel(cafe, 0x7006, GLOBAL_CTRL);
10920 + cafe_writel(cafe, 0x700a, GLOBAL_CTRL);
10921 +
10922 + /* Set up DMA address */
10923 + cafe_writel(cafe, cafe->dmaaddr & 0xffffffff, NAND_DMA_ADDR0);
10924 + if (sizeof(cafe->dmaaddr) > 4)
10925 + /* Shift in two parts to shut the compiler up */
10926 + cafe_writel(cafe, (cafe->dmaaddr >> 16) >> 16, NAND_DMA_ADDR1);
10927 + else
10928 + cafe_writel(cafe, 0, NAND_DMA_ADDR1);
10929 +
10930 + /* Enable NAND IRQ in global IRQ mask register */
10931 + cafe_writel(cafe, 0x80000007, GLOBAL_IRQ_MASK);
10932 + return 0;
10933 +}
10934 +
10935 static struct pci_driver cafe_nand_pci_driver = {
10936 .name = "CAFÉ NAND",
10937 .id_table = cafe_nand_tbl,
10938 .probe = cafe_nand_probe,
10939 .remove = __devexit_p(cafe_nand_remove),
10940 + .resume = cafe_nand_resume,
10941 #ifdef CONFIG_PMx
10942 .suspend = cafe_nand_suspend,
10943 - .resume = cafe_nand_resume,
10944 #endif
10945 };
10946
10947 diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
10948 index fd7a8d5..1c0e89f 100644
10949 --- a/drivers/mtd/nand/ndfc.c
10950 +++ b/drivers/mtd/nand/ndfc.c
10951 @@ -24,7 +24,11 @@
10952 #include <linux/platform_device.h>
10953
10954 #include <asm/io.h>
10955 +#ifdef CONFIG_40x
10956 +#include <asm/ibm405.h>
10957 +#else
10958 #include <asm/ibm44x.h>
10959 +#endif
10960
10961 struct ndfc_nand_mtd {
10962 struct mtd_info mtd;
10963 @@ -230,7 +234,11 @@ static int ndfc_nand_probe(struct platform_device *pdev)
10964 struct ndfc_controller *ndfc = &ndfc_ctrl;
10965 unsigned long long phys = settings->ndfc_erpn | res->start;
10966
10967 +#ifndef CONFIG_PHYS_64BIT
10968 + ndfc->ndfcbase = ioremap((phys_addr_t)phys, res->end - res->start + 1);
10969 +#else
10970 ndfc->ndfcbase = ioremap64(phys, res->end - res->start + 1);
10971 +#endif
10972 if (!ndfc->ndfcbase) {
10973 printk(KERN_ERR "NDFC: ioremap failed\n");
10974 return -EIO;
10975 diff --git a/drivers/mtd/onenand/Kconfig b/drivers/mtd/onenand/Kconfig
10976 index c257d39..cb41cbc 100644
10977 --- a/drivers/mtd/onenand/Kconfig
10978 +++ b/drivers/mtd/onenand/Kconfig
10979 @@ -40,4 +40,27 @@ config MTD_ONENAND_OTP
10980
10981 OTP block is fully-guaranteed to be a valid block.
10982
10983 +config MTD_ONENAND_2X_PROGRAM
10984 + bool "OneNAND 2X program support"
10985 + help
10986 + The 2X Program is an extension of Program Operation.
10987 + Since the device is equipped with two DataRAMs, and two-plane NAND
10988 + Flash memory array, these two component enables simultaneous program
10989 + of 4KiB. Plane1 has only even blocks such as block0, block2, block4
10990 + while Plane2 has only odd blocks such as block1, block3, block5.
10991 + So MTD regards it as 4KiB page size and 256KiB block size
10992 +
10993 + Now the following chips support it. (KFXXX16Q2M)
10994 + Demux: KFG2G16Q2M, KFH4G16Q2M, KFW8G16Q2M,
10995 + Mux: KFM2G16Q2M, KFN4G16Q2M,
10996 +
10997 + And more recent chips
10998 +
10999 +config MTD_ONENAND_SIM
11000 + tristate "OneNAND simulator support"
11001 + depends on MTD_PARTITIONS
11002 + help
11003 + The simulator may simulate various OneNAND flash chips for the
11004 + OneNAND MTD layer.
11005 +
11006 endif # MTD_ONENAND
11007 diff --git a/drivers/mtd/onenand/Makefile b/drivers/mtd/onenand/Makefile
11008 index 269cfe4..4d2eacf 100644
11009 --- a/drivers/mtd/onenand/Makefile
11010 +++ b/drivers/mtd/onenand/Makefile
11011 @@ -8,4 +8,7 @@ obj-$(CONFIG_MTD_ONENAND) += onenand.o
11012 # Board specific.
11013 obj-$(CONFIG_MTD_ONENAND_GENERIC) += generic.o
11014
11015 +# Simulator
11016 +obj-$(CONFIG_MTD_ONENAND_SIM) += onenand_sim.o
11017 +
11018 onenand-objs = onenand_base.o onenand_bbt.o
11019 diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
11020 index 0537fac..7d194cf 100644
11021 --- a/drivers/mtd/onenand/onenand_base.c
11022 +++ b/drivers/mtd/onenand/onenand_base.c
11023 @@ -206,6 +206,15 @@ static int onenand_command(struct mtd_info *mtd, int cmd, loff_t addr, size_t le
11024 default:
11025 block = (int) (addr >> this->erase_shift);
11026 page = (int) (addr >> this->page_shift);
11027 +
11028 + if (ONENAND_IS_2PLANE(this)) {
11029 + /* Make the even block number */
11030 + block &= ~1;
11031 + /* Is it the odd plane? */
11032 + if (addr & this->writesize)
11033 + block++;
11034 + page >>= 1;
11035 + }
11036 page &= this->page_mask;
11037 break;
11038 }
11039 @@ -216,8 +225,12 @@ static int onenand_command(struct mtd_info *mtd, int cmd, loff_t addr, size_t le
11040 value = onenand_bufferram_address(this, block);
11041 this->write_word(value, this->base + ONENAND_REG_START_ADDRESS2);
11042
11043 - /* Switch to the next data buffer */
11044 - ONENAND_SET_NEXT_BUFFERRAM(this);
11045 + if (ONENAND_IS_2PLANE(this))
11046 + /* It is always BufferRAM0 */
11047 + ONENAND_SET_BUFFERRAM0(this);
11048 + else
11049 + /* Switch to the next data buffer */
11050 + ONENAND_SET_NEXT_BUFFERRAM(this);
11051
11052 return 0;
11053 }
11054 @@ -247,6 +260,8 @@ static int onenand_command(struct mtd_info *mtd, int cmd, loff_t addr, size_t le
11055 break;
11056
11057 default:
11058 + if (ONENAND_IS_2PLANE(this) && cmd == ONENAND_CMD_PROG)
11059 + cmd = ONENAND_CMD_2X_PROG;
11060 dataram = ONENAND_CURRENT_BUFFERRAM(this);
11061 break;
11062 }
11063 @@ -445,8 +460,9 @@ static inline int onenand_bufferram_offset(struct mtd_info *mtd, int area)
11064 struct onenand_chip *this = mtd->priv;
11065
11066 if (ONENAND_CURRENT_BUFFERRAM(this)) {
11067 + /* Note: the 'this->writesize' is a real page size */
11068 if (area == ONENAND_DATARAM)
11069 - return mtd->writesize;
11070 + return this->writesize;
11071 if (area == ONENAND_SPARERAM)
11072 return mtd->oobsize;
11073 }
11074 @@ -572,6 +588,30 @@ static int onenand_write_bufferram(struct mtd_info *mtd, int area,
11075 }
11076
11077 /**
11078 + * onenand_get_2x_blockpage - [GENERIC] Get blockpage at 2x program mode
11079 + * @param mtd MTD data structure
11080 + * @param addr address to check
11081 + * @return blockpage address
11082 + *
11083 + * Get blockpage address at 2x program mode
11084 + */
11085 +static int onenand_get_2x_blockpage(struct mtd_info *mtd, loff_t addr)
11086 +{
11087 + struct onenand_chip *this = mtd->priv;
11088 + int blockpage, block, page;
11089 +
11090 + /* Calculate the even block number */
11091 + block = (int) (addr >> this->erase_shift) & ~1;
11092 + /* Is it the odd plane? */
11093 + if (addr & this->writesize)
11094 + block++;
11095 + page = (int) (addr >> (this->page_shift + 1)) & this->page_mask;
11096 + blockpage = (block << 7) | page;
11097 +
11098 + return blockpage;
11099 +}
11100 +
11101 +/**
11102 * onenand_check_bufferram - [GENERIC] Check BufferRAM information
11103 * @param mtd MTD data structure
11104 * @param addr address to check
11105 @@ -585,7 +625,10 @@ static int onenand_check_bufferram(struct mtd_info *mtd, loff_t addr)
11106 int blockpage, found = 0;
11107 unsigned int i;
11108
11109 - blockpage = (int) (addr >> this->page_shift);
11110 + if (ONENAND_IS_2PLANE(this))
11111 + blockpage = onenand_get_2x_blockpage(mtd, addr);
11112 + else
11113 + blockpage = (int) (addr >> this->page_shift);
11114
11115 /* Is there valid data? */
11116 i = ONENAND_CURRENT_BUFFERRAM(this);
11117 @@ -625,7 +668,10 @@ static void onenand_update_bufferram(struct mtd_info *mtd, loff_t addr,
11118 int blockpage;
11119 unsigned int i;
11120
11121 - blockpage = (int) (addr >> this->page_shift);
11122 + if (ONENAND_IS_2PLANE(this))
11123 + blockpage = onenand_get_2x_blockpage(mtd, addr);
11124 + else
11125 + blockpage = (int) (addr >> this->page_shift);
11126
11127 /* Invalidate another BufferRAM */
11128 i = ONENAND_NEXT_BUFFERRAM(this);
11129 @@ -734,6 +780,7 @@ static int onenand_read(struct mtd_info *mtd, loff_t from, size_t len,
11130 int read = 0, column;
11131 int thislen;
11132 int ret = 0, boundary = 0;
11133 + int writesize = this->writesize;
11134
11135 DEBUG(MTD_DEBUG_LEVEL3, "onenand_read: from = 0x%08x, len = %i\n", (unsigned int) from, (int) len);
11136
11137 @@ -754,22 +801,22 @@ static int onenand_read(struct mtd_info *mtd, loff_t from, size_t len,
11138 /* Do first load to bufferRAM */
11139 if (read < len) {
11140 if (!onenand_check_bufferram(mtd, from)) {
11141 - this->command(mtd, ONENAND_CMD_READ, from, mtd->writesize);
11142 + this->command(mtd, ONENAND_CMD_READ, from, writesize);
11143 ret = this->wait(mtd, FL_READING);
11144 onenand_update_bufferram(mtd, from, !ret);
11145 }
11146 }
11147
11148 - thislen = min_t(int, mtd->writesize, len - read);
11149 - column = from & (mtd->writesize - 1);
11150 - if (column + thislen > mtd->writesize)
11151 - thislen = mtd->writesize - column;
11152 + thislen = min_t(int, writesize, len - read);
11153 + column = from & (writesize - 1);
11154 + if (column + thislen > writesize)
11155 + thislen = writesize - column;
11156
11157 while (!ret) {
11158 /* If there is more to load then start next load */
11159 from += thislen;
11160 if (read + thislen < len) {
11161 - this->command(mtd, ONENAND_CMD_READ, from, mtd->writesize);
11162 + this->command(mtd, ONENAND_CMD_READ, from, writesize);
11163 /*
11164 * Chip boundary handling in DDP
11165 * Now we issued chip 1 read and pointed chip 1
11166 @@ -794,7 +841,7 @@ static int onenand_read(struct mtd_info *mtd, loff_t from, size_t len,
11167 this->write_word(ONENAND_DDP_CHIP1, this->base + ONENAND_REG_START_ADDRESS2);
11168 ONENAND_SET_NEXT_BUFFERRAM(this);
11169 buf += thislen;
11170 - thislen = min_t(int, mtd->writesize, len - read);
11171 + thislen = min_t(int, writesize, len - read);
11172 column = 0;
11173 cond_resched();
11174 /* Now wait for load */
11175 @@ -1079,7 +1126,7 @@ int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from,
11176 /* Read more? */
11177 if (read < len) {
11178 /* Update Page size */
11179 - from += mtd->writesize;
11180 + from += this->writesize;
11181 column = 0;
11182 }
11183 }
11184 @@ -1135,12 +1182,12 @@ static int onenand_verify(struct mtd_info *mtd, const u_char *buf, loff_t addr,
11185 int thislen, column;
11186
11187 while (len != 0) {
11188 - thislen = min_t(int, mtd->writesize, len);
11189 - column = addr & (mtd->writesize - 1);
11190 - if (column + thislen > mtd->writesize)
11191 - thislen = mtd->writesize - column;
11192 + thislen = min_t(int, this->writesize, len);
11193 + column = addr & (this->writesize - 1);
11194 + if (column + thislen > this->writesize)
11195 + thislen = this->writesize - column;
11196
11197 - this->command(mtd, ONENAND_CMD_READ, addr, mtd->writesize);
11198 + this->command(mtd, ONENAND_CMD_READ, addr, this->writesize);
11199
11200 onenand_update_bufferram(mtd, addr, 0);
11201
11202 @@ -1236,6 +1283,10 @@ static int onenand_write(struct mtd_info *mtd, loff_t to, size_t len,
11203
11204 /* In partial page write we don't update bufferram */
11205 onenand_update_bufferram(mtd, to, !ret && !subpage);
11206 + if (ONENAND_IS_2PLANE(this)) {
11207 + ONENAND_SET_BUFFERRAM1(this);
11208 + onenand_update_bufferram(mtd, to + this->writesize, !ret && !subpage);
11209 + }
11210
11211 if (ret) {
11212 printk(KERN_ERR "onenand_write: write filaed %d\n", ret);
11213 @@ -1384,6 +1435,10 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len,
11214 this->command(mtd, ONENAND_CMD_PROGOOB, to, mtd->oobsize);
11215
11216 onenand_update_bufferram(mtd, to, 0);
11217 + if (ONENAND_IS_2PLANE(this)) {
11218 + ONENAND_SET_BUFFERRAM1(this);
11219 + onenand_update_bufferram(mtd, to + this->writesize, 0);
11220 + }
11221
11222 ret = this->wait(mtd, FL_WRITING);
11223 if (ret) {
11224 @@ -2107,6 +2162,7 @@ static int onenand_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
11225 *
11226 * Check and set OneNAND features
11227 * - lock scheme
11228 + * - two plane
11229 */
11230 static void onenand_check_features(struct mtd_info *mtd)
11231 {
11232 @@ -2118,19 +2174,35 @@ static void onenand_check_features(struct mtd_info *mtd)
11233 process = this->version_id >> ONENAND_VERSION_PROCESS_SHIFT;
11234
11235 /* Lock scheme */
11236 - if (density >= ONENAND_DEVICE_DENSITY_1Gb) {
11237 + switch (density) {
11238 + case ONENAND_DEVICE_DENSITY_4Gb:
11239 + this->options |= ONENAND_HAS_2PLANE;
11240 +
11241 + case ONENAND_DEVICE_DENSITY_2Gb:
11242 + /* 2Gb DDP don't have 2 plane */
11243 + if (!ONENAND_IS_DDP(this))
11244 + this->options |= ONENAND_HAS_2PLANE;
11245 + this->options |= ONENAND_HAS_UNLOCK_ALL;
11246 +
11247 + case ONENAND_DEVICE_DENSITY_1Gb:
11248 /* A-Die has all block unlock */
11249 - if (process) {
11250 - printk(KERN_DEBUG "Chip support all block unlock\n");
11251 + if (process)
11252 this->options |= ONENAND_HAS_UNLOCK_ALL;
11253 - }
11254 - } else {
11255 - /* Some OneNAND has continues lock scheme */
11256 - if (!process) {
11257 - printk(KERN_DEBUG "Lock scheme is Continues Lock\n");
11258 + break;
11259 +
11260 + default:
11261 + /* Some OneNAND has continuous lock scheme */
11262 + if (!process)
11263 this->options |= ONENAND_HAS_CONT_LOCK;
11264 - }
11265 + break;
11266 }
11267 +
11268 + if (this->options & ONENAND_HAS_CONT_LOCK)
11269 + printk(KERN_DEBUG "Lock scheme is Continuous Lock\n");
11270 + if (this->options & ONENAND_HAS_UNLOCK_ALL)
11271 + printk(KERN_DEBUG "Chip support all block unlock\n");
11272 + if (this->options & ONENAND_HAS_2PLANE)
11273 + printk(KERN_DEBUG "Chip has 2 plane\n");
11274 }
11275
11276 /**
11277 @@ -2257,6 +2329,8 @@ static int onenand_probe(struct mtd_info *mtd)
11278 this->erase_shift = ffs(mtd->erasesize) - 1;
11279 this->page_shift = ffs(mtd->writesize) - 1;
11280 this->page_mask = (1 << (this->erase_shift - this->page_shift)) - 1;
11281 + /* It's real page size */
11282 + this->writesize = mtd->writesize;
11283
11284 /* REVIST: Multichip handling */
11285
11286 @@ -2265,6 +2339,17 @@ static int onenand_probe(struct mtd_info *mtd)
11287 /* Check OneNAND features */
11288 onenand_check_features(mtd);
11289
11290 + /*
11291 + * We emulate the 4KiB page and 256KiB erase block size
11292 + * But oobsize is still 64 bytes.
11293 + * It is only valid if you turn on 2X program support,
11294 + * Otherwise it will be ignored by compiler.
11295 + */
11296 + if (ONENAND_IS_2PLANE(this)) {
11297 + mtd->writesize <<= 1;
11298 + mtd->erasesize <<= 1;
11299 + }
11300 +
11301 return 0;
11302 }
11303
11304 diff --git a/drivers/mtd/onenand/onenand_sim.c b/drivers/mtd/onenand/onenand_sim.c
11305 new file mode 100644
11306 index 0000000..b806673
11307 --- /dev/null
11308 +++ b/drivers/mtd/onenand/onenand_sim.c
11309 @@ -0,0 +1,495 @@
11310 +/*
11311 + * linux/drivers/mtd/onenand/onenand_sim.c
11312 + *
11313 + * The OneNAND simulator
11314 + *
11315 + * Copyright © 2005-2007 Samsung Electronics
11316 + * Kyungmin Park <kyungmin.park@samsung.com>
11317 + *
11318 + * This program is free software; you can redistribute it and/or modify
11319 + * it under the terms of the GNU General Public License version 2 as
11320 + * published by the Free Software Foundation.
11321 + */
11322 +
11323 +#include <linux/kernel.h>
11324 +#include <linux/module.h>
11325 +#include <linux/init.h>
11326 +#include <linux/vmalloc.h>
11327 +#include <linux/mtd/mtd.h>
11328 +#include <linux/mtd/partitions.h>
11329 +#include <linux/mtd/onenand.h>
11330 +
11331 +#include <linux/io.h>
11332 +
11333 +#ifndef CONFIG_ONENAND_SIM_MANUFACTURER
11334 +#define CONFIG_ONENAND_SIM_MANUFACTURER 0xec
11335 +#endif
11336 +#ifndef CONFIG_ONENAND_SIM_DEVICE_ID
11337 +#define CONFIG_ONENAND_SIM_DEVICE_ID 0x04
11338 +#endif
11339 +#ifndef CONFIG_ONENAND_SIM_VERSION_ID
11340 +#define CONFIG_ONENAND_SIM_VERSION_ID 0x1e
11341 +#endif
11342 +
11343 +static int manuf_id = CONFIG_ONENAND_SIM_MANUFACTURER;
11344 +static int device_id = CONFIG_ONENAND_SIM_DEVICE_ID;
11345 +static int version_id = CONFIG_ONENAND_SIM_VERSION_ID;
11346 +
11347 +struct onenand_flash {
11348 + void __iomem *base;
11349 + void __iomem *data;
11350 +};
11351 +
11352 +#define ONENAND_CORE(flash) (flash->data)
11353 +#define ONENAND_CORE_SPARE(flash, this, offset) \
11354 + ((flash->data) + (this->chipsize) + (offset >> 5))
11355 +
11356 +#define ONENAND_MAIN_AREA(this, offset) \
11357 + (this->base + ONENAND_DATARAM + offset)
11358 +
11359 +#define ONENAND_SPARE_AREA(this, offset) \
11360 + (this->base + ONENAND_SPARERAM + offset)
11361 +
11362 +#define ONENAND_GET_WP_STATUS(this) \
11363 + (readw(this->base + ONENAND_REG_WP_STATUS))
11364 +
11365 +#define ONENAND_SET_WP_STATUS(v, this) \
11366 + (writew(v, this->base + ONENAND_REG_WP_STATUS))
11367 +
11368 +/* It has all 0xff chars */
11369 +#define MAX_ONENAND_PAGESIZE (2048 + 64)
11370 +static unsigned char *ffchars;
11371 +
11372 +static struct mtd_partition os_partitions[] = {
11373 + {
11374 + .name = "OneNAND simulator partition",
11375 + .offset = 0,
11376 + .size = MTDPART_SIZ_FULL,
11377 + },
11378 +};
11379 +
11380 +/*
11381 + * OneNAND simulator mtd
11382 + */
11383 +struct onenand_info {
11384 + struct mtd_info mtd;
11385 + struct mtd_partition *parts;
11386 + struct onenand_chip onenand;
11387 + struct onenand_flash flash;
11388 +};
11389 +
11390 +struct onenand_info *info;
11391 +
11392 +#define DPRINTK(format, args...) \
11393 +do { \
11394 + printk(KERN_DEBUG "%s[%d]: " format "\n", __func__, \
11395 + __LINE__, ##args); \
11396 +} while (0)
11397 +
11398 +/**
11399 + * onenand_lock_handle - Handle Lock scheme
11400 + * @param this OneNAND device structure
11401 + * @param cmd The command to be sent
11402 + *
11403 + * Send lock command to OneNAND device.
11404 + * The lock scheme is depends on chip type.
11405 + */
11406 +static void onenand_lock_handle(struct onenand_chip *this, int cmd)
11407 +{
11408 + int block_lock_scheme;
11409 + int status;
11410 +
11411 + status = ONENAND_GET_WP_STATUS(this);
11412 + block_lock_scheme = !(this->options & ONENAND_HAS_CONT_LOCK);
11413 +
11414 + switch (cmd) {
11415 + case ONENAND_CMD_UNLOCK:
11416 + if (block_lock_scheme)
11417 + ONENAND_SET_WP_STATUS(ONENAND_WP_US, this);
11418 + else
11419 + ONENAND_SET_WP_STATUS(status | ONENAND_WP_US, this);
11420 + break;
11421 +
11422 + case ONENAND_CMD_LOCK:
11423 + if (block_lock_scheme)
11424 + ONENAND_SET_WP_STATUS(ONENAND_WP_LS, this);
11425 + else
11426 + ONENAND_SET_WP_STATUS(status | ONENAND_WP_LS, this);
11427 + break;
11428 +
11429 + case ONENAND_CMD_LOCK_TIGHT:
11430 + if (block_lock_scheme)
11431 + ONENAND_SET_WP_STATUS(ONENAND_WP_LTS, this);
11432 + else
11433 + ONENAND_SET_WP_STATUS(status | ONENAND_WP_LTS, this);
11434 + break;
11435 +
11436 + default:
11437 + break;
11438 + }
11439 +}
11440 +
11441 +/**
11442 + * onenand_bootram_handle - Handle BootRAM area
11443 + * @param this OneNAND device structure
11444 + * @param cmd The command to be sent
11445 + *
11446 + * Emulate BootRAM area. It is possible to do basic operation using BootRAM.
11447 + */
11448 +static void onenand_bootram_handle(struct onenand_chip *this, int cmd)
11449 +{
11450 + switch (cmd) {
11451 + case ONENAND_CMD_READID:
11452 + writew(manuf_id, this->base);
11453 + writew(device_id, this->base + 2);
11454 + writew(version_id, this->base + 4);
11455 + break;
11456 +
11457 + default:
11458 + /* REVIST: Handle other commands */
11459 + break;
11460 + }
11461 +}
11462 +
11463 +/**
11464 + * onenand_update_interrupt - Set interrupt register
11465 + * @param this OneNAND device structure
11466 + * @param cmd The command to be sent
11467 + *
11468 + * Update interrupt register. The status is depends on command.
11469 + */
11470 +static void onenand_update_interrupt(struct onenand_chip *this, int cmd)
11471 +{
11472 + int interrupt = ONENAND_INT_MASTER;
11473 +
11474 + switch (cmd) {
11475 + case ONENAND_CMD_READ:
11476 + case ONENAND_CMD_READOOB:
11477 + interrupt |= ONENAND_INT_READ;
11478 + break;
11479 +
11480 + case ONENAND_CMD_PROG:
11481 + case ONENAND_CMD_PROGOOB:
11482 + interrupt |= ONENAND_INT_WRITE;
11483 + break;
11484 +
11485 + case ONENAND_CMD_ERASE:
11486 + interrupt |= ONENAND_INT_ERASE;
11487 + break;
11488 +
11489 + case ONENAND_CMD_RESET:
11490 + interrupt |= ONENAND_INT_RESET;
11491 + break;
11492 +
11493 + default:
11494 + break;
11495 + }
11496 +
11497 + writew(interrupt, this->base + ONENAND_REG_INTERRUPT);
11498 +}
11499 +
11500 +/**
11501 + * onenand_check_overwrite - Check over-write if happend
11502 + * @param dest The destination pointer
11503 + * @param src The source pointer
11504 + * @param count The length to be check
11505 + * @return 0 on same, otherwise 1
11506 + *
11507 + * Compare the source with destination
11508 + */
11509 +static int onenand_check_overwrite(void *dest, void *src, size_t count)
11510 +{
11511 + unsigned int *s = (unsigned int *) src;
11512 + unsigned int *d = (unsigned int *) dest;
11513 + int i;
11514 +
11515 + count >>= 2;
11516 + for (i = 0; i < count; i++)
11517 + if ((*s++ ^ *d++) != 0)
11518 + return 1;
11519 +
11520 + return 0;
11521 +}
11522 +
11523 +/**
11524 + * onenand_data_handle - Handle OneNAND Core and DataRAM
11525 + * @param this OneNAND device structure
11526 + * @param cmd The command to be sent
11527 + * @param dataram Which dataram used
11528 + * @param offset The offset to OneNAND Core
11529 + *
11530 + * Copy data from OneNAND Core to DataRAM (read)
11531 + * Copy data from DataRAM to OneNAND Core (write)
11532 + * Erase the OneNAND Core (erase)
11533 + */
11534 +static void onenand_data_handle(struct onenand_chip *this, int cmd,
11535 + int dataram, unsigned int offset)
11536 +{
11537 + struct mtd_info *mtd = &info->mtd;
11538 + struct onenand_flash *flash = this->priv;
11539 + int main_offset, spare_offset;
11540 + void __iomem *src;
11541 + void __iomem *dest;
11542 + unsigned int i;
11543 +
11544 + if (dataram) {
11545 + main_offset = mtd->writesize;
11546 + spare_offset = mtd->oobsize;
11547 + } else {
11548 + main_offset = 0;
11549 + spare_offset = 0;
11550 + }
11551 +
11552 + switch (cmd) {
11553 + case ONENAND_CMD_READ:
11554 + src = ONENAND_CORE(flash) + offset;
11555 + dest = ONENAND_MAIN_AREA(this, main_offset);
11556 + memcpy(dest, src, mtd->writesize);
11557 + /* Fall through */
11558 +
11559 + case ONENAND_CMD_READOOB:
11560 + src = ONENAND_CORE_SPARE(flash, this, offset);
11561 + dest = ONENAND_SPARE_AREA(this, spare_offset);
11562 + memcpy(dest, src, mtd->oobsize);
11563 + break;
11564 +
11565 + case ONENAND_CMD_PROG:
11566 + src = ONENAND_MAIN_AREA(this, main_offset);
11567 + dest = ONENAND_CORE(flash) + offset;
11568 + /* To handle partial write */
11569 + for (i = 0; i < (1 << mtd->subpage_sft); i++) {
11570 + int off = i * this->subpagesize;
11571 + if (!memcmp(src + off, ffchars, this->subpagesize))
11572 + continue;
11573 + if (memcmp(dest + off, ffchars, this->subpagesize) &&
11574 + onenand_check_overwrite(dest + off, src + off, this->subpagesize))
11575 + printk(KERN_ERR "over-write happend at 0x%08x\n", offset);
11576 + memcpy(dest + off, src + off, this->subpagesize);
11577 + }
11578 + /* Fall through */
11579 +
11580 + case ONENAND_CMD_PROGOOB:
11581 + src = ONENAND_SPARE_AREA(this, spare_offset);
11582 + /* Check all data is 0xff chars */
11583 + if (!memcmp(src, ffchars, mtd->oobsize))
11584 + break;
11585 +
11586 + dest = ONENAND_CORE_SPARE(flash, this, offset);
11587 + if (memcmp(dest, ffchars, mtd->oobsize) &&
11588 + onenand_check_overwrite(dest, src, mtd->oobsize))
11589 + printk(KERN_ERR "OOB: over-write happend at 0x%08x\n",
11590 + offset);
11591 + memcpy(dest, src, mtd->oobsize);
11592 + break;
11593 +
11594 + case ONENAND_CMD_ERASE:
11595 + memset(ONENAND_CORE(flash) + offset, 0xff, mtd->erasesize);
11596 + memset(ONENAND_CORE_SPARE(flash, this, offset), 0xff,
11597 + (mtd->erasesize >> 5));
11598 + break;
11599 +
11600 + default:
11601 + break;
11602 + }
11603 +}
11604 +
11605 +/**
11606 + * onenand_command_handle - Handle command
11607 + * @param this OneNAND device structure
11608 + * @param cmd The command to be sent
11609 + *
11610 + * Emulate OneNAND command.
11611 + */
11612 +static void onenand_command_handle(struct onenand_chip *this, int cmd)
11613 +{
11614 + unsigned long offset = 0;
11615 + int block = -1, page = -1, bufferram = -1;
11616 + int dataram = 0;
11617 +
11618 + switch (cmd) {
11619 + case ONENAND_CMD_UNLOCK:
11620 + case ONENAND_CMD_LOCK:
11621 + case ONENAND_CMD_LOCK_TIGHT:
11622 + case ONENAND_CMD_UNLOCK_ALL:
11623 + onenand_lock_handle(this, cmd);
11624 + break;
11625 +
11626 + case ONENAND_CMD_BUFFERRAM:
11627 + /* Do nothing */
11628 + return;
11629 +
11630 + default:
11631 + block = (int) readw(this->base + ONENAND_REG_START_ADDRESS1);
11632 + if (block & (1 << ONENAND_DDP_SHIFT)) {
11633 + block &= ~(1 << ONENAND_DDP_SHIFT);
11634 + /* The half of chip block */
11635 + block += this->chipsize >> (this->erase_shift + 1);
11636 + }
11637 + if (cmd == ONENAND_CMD_ERASE)
11638 + break;
11639 +
11640 + page = (int) readw(this->base + ONENAND_REG_START_ADDRESS8);
11641 + page = (page >> ONENAND_FPA_SHIFT);
11642 + bufferram = (int) readw(this->base + ONENAND_REG_START_BUFFER);
11643 + bufferram >>= ONENAND_BSA_SHIFT;
11644 + bufferram &= ONENAND_BSA_DATARAM1;
11645 + dataram = (bufferram == ONENAND_BSA_DATARAM1) ? 1 : 0;
11646 + break;
11647 + }
11648 +
11649 + if (block != -1)
11650 + offset += block << this->erase_shift;
11651 +
11652 + if (page != -1)
11653 + offset += page << this->page_shift;
11654 +
11655 + onenand_data_handle(this, cmd, dataram, offset);
11656 +
11657 + onenand_update_interrupt(this, cmd);
11658 +}
11659 +
11660 +/**
11661 + * onenand_writew - [OneNAND Interface] Emulate write operation
11662 + * @param value value to write
11663 + * @param addr address to write
11664 + *
11665 + * Write OneNAND register with value
11666 + */
11667 +static void onenand_writew(unsigned short value, void __iomem * addr)
11668 +{
11669 + struct onenand_chip *this = info->mtd.priv;
11670 +
11671 + /* BootRAM handling */
11672 + if (addr < this->base + ONENAND_DATARAM) {
11673 + onenand_bootram_handle(this, value);
11674 + return;
11675 + }
11676 + /* Command handling */
11677 + if (addr == this->base + ONENAND_REG_COMMAND)
11678 + onenand_command_handle(this, value);
11679 +
11680 + writew(value, addr);
11681 +}
11682 +
11683 +/**
11684 + * flash_init - Initialize OneNAND simulator
11685 + * @param flash OneNAND simulaotr data strucutres
11686 + *
11687 + * Initialize OneNAND simulator.
11688 + */
11689 +static int __init flash_init(struct onenand_flash *flash)
11690 +{
11691 + int density, size;
11692 + int buffer_size;
11693 +
11694 + flash->base = kzalloc(131072, GFP_KERNEL);
11695 + if (!flash->base) {
11696 + printk(KERN_ERR "Unable to allocate base address.\n");
11697 + return -ENOMEM;
11698 + }
11699 +
11700 + density = device_id >> ONENAND_DEVICE_DENSITY_SHIFT;
11701 + size = ((16 << 20) << density);
11702 +
11703 + ONENAND_CORE(flash) = vmalloc(size + (size >> 5));
11704 + if (!ONENAND_CORE(flash)) {
11705 + printk(KERN_ERR "Unable to allocate nand core address.\n");
11706 + kfree(flash->base);
11707 + return -ENOMEM;
11708 + }
11709 +
11710 + memset(ONENAND_CORE(flash), 0xff, size + (size >> 5));
11711 +
11712 + /* Setup registers */
11713 + writew(manuf_id, flash->base + ONENAND_REG_MANUFACTURER_ID);
11714 + writew(device_id, flash->base + ONENAND_REG_DEVICE_ID);
11715 + writew(version_id, flash->base + ONENAND_REG_VERSION_ID);
11716 +
11717 + if (density < 2)
11718 + buffer_size = 0x0400; /* 1KiB page */
11719 + else
11720 + buffer_size = 0x0800; /* 2KiB page */
11721 + writew(buffer_size, flash->base + ONENAND_REG_DATA_BUFFER_SIZE);
11722 +
11723 + return 0;
11724 +}
11725 +
11726 +/**
11727 + * flash_exit - Clean up OneNAND simulator
11728 + * @param flash OneNAND simulaotr data strucutres
11729 + *
11730 + * Clean up OneNAND simulator.
11731 + */
11732 +static void flash_exit(struct onenand_flash *flash)
11733 +{
11734 + vfree(ONENAND_CORE(flash));
11735 + kfree(flash->base);
11736 + kfree(flash);
11737 +}
11738 +
11739 +static int __init onenand_sim_init(void)
11740 +{
11741 + /* Allocate all 0xff chars pointer */
11742 + ffchars = kmalloc(MAX_ONENAND_PAGESIZE, GFP_KERNEL);
11743 + if (!ffchars) {
11744 + printk(KERN_ERR "Unable to allocate ff chars.\n");
11745 + return -ENOMEM;
11746 + }
11747 + memset(ffchars, 0xff, MAX_ONENAND_PAGESIZE);
11748 +
11749 + /* Allocate OneNAND simulator mtd pointer */
11750 + info = kzalloc(sizeof(struct onenand_info), GFP_KERNEL);
11751 + if (!info) {
11752 + printk(KERN_ERR "Unable to allocate core structures.\n");
11753 + kfree(ffchars);
11754 + return -ENOMEM;
11755 + }
11756 +
11757 + /* Override write_word function */
11758 + info->onenand.write_word = onenand_writew;
11759 +
11760 + if (flash_init(&info->flash)) {
11761 + printk(KERN_ERR "Unable to allocat flash.\n");
11762 + kfree(ffchars);
11763 + kfree(info);
11764 + return -ENOMEM;
11765 + }
11766 +
11767 + info->parts = os_partitions;
11768 +
11769 + info->onenand.base = info->flash.base;
11770 + info->onenand.priv = &info->flash;
11771 +
11772 + info->mtd.name = "OneNAND simulator";
11773 + info->mtd.priv = &info->onenand;
11774 + info->mtd.owner = THIS_MODULE;
11775 +
11776 + if (onenand_scan(&info->mtd, 1)) {
11777 + flash_exit(&info->flash);
11778 + kfree(ffchars);
11779 + kfree(info);
11780 + return -ENXIO;
11781 + }
11782 +
11783 + add_mtd_partitions(&info->mtd, info->parts, ARRAY_SIZE(os_partitions));
11784 +
11785 + return 0;
11786 +}
11787 +
11788 +static void __exit onenand_sim_exit(void)
11789 +{
11790 + struct onenand_chip *this = info->mtd.priv;
11791 + struct onenand_flash *flash = this->priv;
11792 +
11793 + onenand_release(&info->mtd);
11794 + flash_exit(flash);
11795 + kfree(ffchars);
11796 + kfree(info);
11797 +}
11798 +
11799 +module_init(onenand_sim_init);
11800 +module_exit(onenand_sim_exit);
11801 +
11802 +MODULE_AUTHOR("Kyungmin Park <kyungmin.park@samsung.com>");
11803 +MODULE_DESCRIPTION("The OneNAND flash simulator");
11804 +MODULE_LICENSE("GPL");
11805 diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
11806 index 1938d6d..cc01dbd 100644
11807 --- a/drivers/net/forcedeth.c
11808 +++ b/drivers/net/forcedeth.c
11809 @@ -3556,10 +3556,12 @@ static int nv_request_irq(struct net_device *dev, int intr_test)
11810 }
11811 if (ret != 0 && np->msi_flags & NV_MSI_CAPABLE) {
11812 if ((ret = pci_enable_msi(np->pci_dev)) == 0) {
11813 + pci_intx(np->pci_dev, 0);
11814 np->msi_flags |= NV_MSI_ENABLED;
11815 if (request_irq(np->pci_dev->irq, handler, IRQF_SHARED, dev->name, dev) != 0) {
11816 printk(KERN_INFO "forcedeth: request_irq failed %d\n", ret);
11817 pci_disable_msi(np->pci_dev);
11818 + pci_intx(np->pci_dev, 1);
11819 np->msi_flags &= ~NV_MSI_ENABLED;
11820 goto out_err;
11821 }
11822 @@ -3601,6 +3603,7 @@ static void nv_free_irq(struct net_device *dev)
11823 free_irq(np->pci_dev->irq, dev);
11824 if (np->msi_flags & NV_MSI_ENABLED) {
11825 pci_disable_msi(np->pci_dev);
11826 + pci_intx(np->pci_dev, 1);
11827 np->msi_flags &= ~NV_MSI_ENABLED;
11828 }
11829 }
11830 diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
11831 index 7dcaa09..eb69d4d 100644
11832 --- a/drivers/pci/quirks.c
11833 +++ b/drivers/pci/quirks.c
11834 @@ -1390,6 +1390,17 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm);
11835 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm);
11836
11837 /*
11838 + * According to Tom Sylla, the Geode does not support PCI power management
11839 + * transition, so we shouldn't need the D3hot delay.
11840 + */
11841 +static void __init quirk_geode_pci_pm(struct pci_dev *dev)
11842 +{
11843 + pci_pm_d3_delay = 0;
11844 +}
11845 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, quirk_geode_pci_pm);
11846 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA, quirk_geode_pci_pm);
11847 +
11848 +/*
11849 * Toshiba TC86C001 IDE controller reports the standard 8-byte BAR0 size
11850 * but the PIO transfers won't work if BAR0 falls at the odd 8 bytes.
11851 * Re-allocate the region if needed...
11852 diff --git a/drivers/sysprof/Kconfig b/drivers/sysprof/Kconfig
11853 new file mode 100644
11854 index 0000000..b99c13a
11855 --- /dev/null
11856 +++ b/drivers/sysprof/Kconfig
11857 @@ -0,0 +1,12 @@
11858 +
11859 +menu "Sysprof"
11860 +
11861 +config SYSPROF
11862 + tristate "Sysprof support"
11863 + help
11864 + Say M here to include the sysprof-module.
11865 +
11866 + Sysprof is a sampling profiler that uses a kernel module,
11867 + sysprof-module, to generate stacktraces which are then interpreted by
11868 + the userspace program "sysprof".
11869 +endmenu
11870 diff --git a/drivers/sysprof/Makefile b/drivers/sysprof/Makefile
11871 new file mode 100644
11872 index 0000000..cd465e9
11873 --- /dev/null
11874 +++ b/drivers/sysprof/Makefile
11875 @@ -0,0 +1 @@
11876 +obj-$(CONFIG_SYSPROF) += sysprof-module.o
11877 diff --git a/drivers/sysprof/config.h b/drivers/sysprof/config.h
11878 new file mode 100644
11879 index 0000000..bb62689
11880 --- /dev/null
11881 +++ b/drivers/sysprof/config.h
11882 @@ -0,0 +1,23 @@
11883 +/* config.h. Generated by configure. */
11884 +/* config.h.in. Generated from configure.ac by autoheader. */
11885 +
11886 +/* Look for global separate debug info in this path */
11887 +#define DEBUGDIR "/usr/local/lib/debug"
11888 +
11889 +/* Define to 1 if you have the `iberty' library (-liberty). */
11890 +/* #undef HAVE_LIBIBERTY */
11891 +
11892 +/* Define to the address where bug reports for this package should be sent. */
11893 +#define PACKAGE_BUGREPORT ""
11894 +
11895 +/* Define to the full name of this package. */
11896 +#define PACKAGE_NAME "sysprof"
11897 +
11898 +/* Define to the full name and version of this package. */
11899 +#define PACKAGE_STRING "sysprof 1.0.8"
11900 +
11901 +/* Define to the one symbol short name of this package. */
11902 +#define PACKAGE_TARNAME "sysprof"
11903 +
11904 +/* Define to the version of this package. */
11905 +#define PACKAGE_VERSION "1.0.8"
11906 diff --git a/drivers/sysprof/sysprof-module.c b/drivers/sysprof/sysprof-module.c
11907 new file mode 100644
11908 index 0000000..36e0b51
11909 --- /dev/null
11910 +++ b/drivers/sysprof/sysprof-module.c
11911 @@ -0,0 +1,271 @@
11912 +/* -*- c-basic-offset: 8 -*- */
11913 +
11914 +/* Sysprof -- Sampling, systemwide CPU profiler
11915 + * Copyright 2004, Red Hat, Inc.
11916 + * Copyright 2004, 2005, Soeren Sandmann
11917 + *
11918 + * This program is free software; you can redistribute it and/or modify
11919 + * it under the terms of the GNU General Public License as published by
11920 + * the Free Software Foundation; either version 2 of the License, or
11921 + * (at your option) any later version.
11922 + *
11923 + * This program is distributed in the hope that it will be useful,
11924 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
11925 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11926 + * GNU General Public License for more details.
11927 + *
11928 + * You should have received a copy of the GNU General Public License
11929 + * along with this program; if not, write to the Free Software
11930 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
11931 + */
11932 +
11933 +#ifdef CONFIG_SMP
11934 +# define __SMP__
11935 +#endif
11936 +#include <asm/atomic.h>
11937 +#include <linux/kernel.h> /* Needed for KERN_ALERT */
11938 +#include <linux/module.h> /* Needed by all modules */
11939 +#include <linux/sched.h>
11940 +
11941 +#include <linux/proc_fs.h>
11942 +#include <asm/uaccess.h>
11943 +#include <linux/poll.h>
11944 +#include <linux/highmem.h>
11945 +#include <linux/pagemap.h>
11946 +#include <linux/profile.h>
11947 +
11948 +#include "sysprof-module.h"
11949 +
11950 +#include "config.h"
11951 +
11952 +#include <linux/version.h>
11953 +
11954 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
11955 +#include <linux/config.h>
11956 +#endif
11957 +
11958 +#if !CONFIG_PROFILING
11959 +# error Sysprof needs a kernel with profiling support compiled in.
11960 +#endif
11961 +
11962 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
11963 +# error Sysprof needs a Linux 2.6.11 kernel or later
11964 +#endif
11965 +#include <linux/kallsyms.h>
11966 +
11967 +MODULE_LICENSE("GPL");
11968 +MODULE_AUTHOR("Soeren Sandmann (sandmann@daimi.au.dk)");
11969 +
11970 +#define SAMPLES_PER_SECOND (200)
11971 +#define INTERVAL ((HZ <= SAMPLES_PER_SECOND)? 1 : (HZ / SAMPLES_PER_SECOND))
11972 +#define N_TRACES 256
11973 +
11974 +static SysprofStackTrace stack_traces[N_TRACES];
11975 +static SysprofStackTrace * head = &stack_traces[0];
11976 +static SysprofStackTrace * tail = &stack_traces[0];
11977 +DECLARE_WAIT_QUEUE_HEAD (wait_for_trace);
11978 +DECLARE_WAIT_QUEUE_HEAD (wait_for_exit);
11979 +
11980 +/* Macro the names of the registers that are used on each architecture */
11981 +#if defined(CONFIG_X86_64)
11982 +# define REG_FRAME_PTR rbp
11983 +# define REG_INS_PTR rip
11984 +# define REG_STACK_PTR rsp
11985 +#elif defined(CONFIG_X86)
11986 +# define REG_FRAME_PTR ebp
11987 +# define REG_INS_PTR eip
11988 +# define REG_STACK_PTR esp
11989 +#else
11990 +# error Sysprof only supports the i386 and x86-64 architectures
11991 +#endif
11992 +
11993 +typedef struct userspace_reader userspace_reader;
11994 +struct userspace_reader
11995 +{
11996 + struct task_struct *task;
11997 + unsigned long cache_address;
11998 + unsigned long *cache;
11999 +};
12000 +
12001 +typedef struct StackFrame StackFrame;
12002 +struct StackFrame {
12003 + unsigned long next;
12004 + unsigned long return_address;
12005 +};
12006 +
12007 +struct work_struct work;
12008 +
12009 +static int
12010 +read_frame (void *frame_pointer, StackFrame *frame)
12011 +{
12012 +#if 0
12013 + /* This is commented out because we seem to be called with
12014 + * (current_thread_info()->addr_limit.seg)) == 0
12015 + * which means access_ok() _always_ fails.
12016 + *
12017 + * Not sure why (or if) this isn't the case for oprofile
12018 + */
12019 + if (!access_ok(VERIFY_READ, frame_pointer, sizeof(StackFrame)))
12020 + return 1;
12021 +#endif
12022 +
12023 + if (__copy_from_user_inatomic (
12024 + frame, frame_pointer, sizeof (StackFrame)))
12025 + return 1;
12026 +
12027 + return 0;
12028 +}
12029 +
12030 +DEFINE_PER_CPU(int, n_samples);
12031 +
12032 +static int
12033 +timer_notify (struct pt_regs *regs)
12034 +{
12035 + SysprofStackTrace *trace = head;
12036 + int i;
12037 + int is_user;
12038 + static atomic_t in_timer_notify = ATOMIC_INIT(1);
12039 + int n;
12040 +
12041 + n = ++get_cpu_var(n_samples);
12042 + put_cpu_var(n_samples);
12043 +
12044 + if (n % INTERVAL != 0)
12045 + return 0;
12046 +
12047 + /* 0: locked, 1: unlocked */
12048 +
12049 + if (!atomic_dec_and_test(&in_timer_notify))
12050 + goto out;
12051 +
12052 + is_user = user_mode(regs);
12053 +
12054 + if (!current || current->pid == 0)
12055 + goto out;
12056 +
12057 + if (is_user && current->state != TASK_RUNNING)
12058 + goto out;
12059 +
12060 + if (!is_user)
12061 + {
12062 + /* kernel */
12063 +
12064 + trace->pid = current->pid;
12065 + trace->truncated = 0;
12066 + trace->n_addresses = 1;
12067 +
12068 + /* 0x1 is taken by sysprof to mean "in kernel" */
12069 + trace->addresses[0] = (void *)0x1;
12070 + }
12071 + else
12072 + {
12073 + StackFrame *frame_pointer;
12074 + StackFrame frame;
12075 + memset(trace, 0, sizeof (SysprofStackTrace));
12076 +
12077 + trace->pid = current->pid;
12078 + trace->truncated = 0;
12079 +
12080 + i = 0;
12081 +
12082 + trace->addresses[i++] = (void *)regs->REG_INS_PTR;
12083 +
12084 + frame_pointer = (void *)regs->REG_FRAME_PTR;
12085 +
12086 + while (read_frame (frame_pointer, &frame) == 0 &&
12087 + i < SYSPROF_MAX_ADDRESSES &&
12088 + (unsigned long)frame_pointer >= regs->REG_STACK_PTR)
12089 + {
12090 + trace->addresses[i++] = (void *)frame.return_address;
12091 + frame_pointer = (StackFrame *)frame.next;
12092 + }
12093 +
12094 + trace->n_addresses = i;
12095 +
12096 + if (i == SYSPROF_MAX_ADDRESSES)
12097 + trace->truncated = 1;
12098 + else
12099 + trace->truncated = 0;
12100 + }
12101 +
12102 + if (head++ == &stack_traces[N_TRACES - 1])
12103 + head = &stack_traces[0];
12104 +
12105 + wake_up (&wait_for_trace);
12106 +
12107 +out:
12108 + atomic_inc(&in_timer_notify);
12109 + return 0;
12110 +}
12111 +
12112 +static int
12113 +procfile_read(char *buffer,
12114 + char **buffer_location,
12115 + off_t offset,
12116 + int buffer_len,
12117 + int *eof,
12118 + void *data)
12119 +{
12120 + if (head == tail)
12121 + return -EWOULDBLOCK;
12122 +
12123 + *buffer_location = (char *)tail;
12124 +
12125 + BUG_ON(tail->pid == 0);
12126 +
12127 + if (tail++ == &stack_traces[N_TRACES - 1])
12128 + tail = &stack_traces[0];
12129 +
12130 + return sizeof (SysprofStackTrace);
12131 +}
12132 +
12133 +struct proc_dir_entry *trace_proc_file;
12134 +static unsigned int
12135 +procfile_poll(struct file *filp, poll_table *poll_table)
12136 +{
12137 + if (head != tail)
12138 + return POLLIN | POLLRDNORM;
12139 +
12140 + poll_wait(filp, &wait_for_trace, poll_table);
12141 +
12142 + if (head != tail)
12143 + return POLLIN | POLLRDNORM;
12144 +
12145 + return 0;
12146 +}
12147 +
12148 +int
12149 +init_module(void)
12150 +{
12151 + static struct file_operations fops;
12152 +
12153 + trace_proc_file =
12154 + create_proc_entry ("sysprof-trace", S_IFREG | S_IRUGO, &proc_root);
12155 +
12156 + if (!trace_proc_file)
12157 + return 1;
12158 +
12159 + fops = *trace_proc_file->proc_fops;
12160 + fops.poll = procfile_poll;
12161 +
12162 + trace_proc_file->read_proc = procfile_read;
12163 + trace_proc_file->proc_fops = &fops;
12164 + trace_proc_file->size = sizeof (SysprofStackTrace);
12165 +
12166 + register_timer_hook (timer_notify);
12167 +
12168 + printk(KERN_ALERT "sysprof: loaded (%s)\n", PACKAGE_VERSION);
12169 +
12170 + return 0;
12171 +}
12172 +
12173 +void
12174 +cleanup_module(void)
12175 +{
12176 + unregister_timer_hook (timer_notify);
12177 +
12178 + remove_proc_entry("sysprof-trace", &proc_root);
12179 +
12180 + printk(KERN_ALERT "sysprof: unloaded\n");
12181 +}
12182 +
12183 diff --git a/drivers/sysprof/sysprof-module.h b/drivers/sysprof/sysprof-module.h
12184 new file mode 100644
12185 index 0000000..66a11ae
12186 --- /dev/null
12187 +++ b/drivers/sysprof/sysprof-module.h
12188 @@ -0,0 +1,37 @@
12189 +/* Sysprof -- Sampling, systemwide CPU profiler
12190 + * Copyright 2004, Red Hat, Inc.
12191 + * Copyright 2004, 2005, Soeren Sandmann
12192 + *
12193 + * This program is free software; you can redistribute it and/or modify
12194 + * it under the terms of the GNU General Public License as published by
12195 + * the Free Software Foundation; either version 2 of the License, or
12196 + * (at your option) any later version.
12197 + *
12198 + * This program is distributed in the hope that it will be useful,
12199 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12200 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12201 + * GNU General Public License for more details.
12202 + *
12203 + * You should have received a copy of the GNU General Public License
12204 + * along with this program; if not, write to the Free Software
12205 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
12206 + */
12207 +
12208 +#ifndef SYSPROF_MODULE_H
12209 +#define SYSPROF_MODULE_H
12210 +
12211 +typedef struct SysprofStackTrace SysprofStackTrace;
12212 +
12213 +#define SYSPROF_MAX_ADDRESSES 512
12214 +
12215 +struct SysprofStackTrace
12216 +{
12217 + int pid; /* -1 if in kernel */
12218 + int truncated;
12219 + int n_addresses; /* note: this can be 1 if the process was compiled
12220 + * with -fomit-frame-pointer or is otherwise weird
12221 + */
12222 + void *addresses[SYSPROF_MAX_ADDRESSES];
12223 +};
12224 +
12225 +#endif
12226 diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
12227 index 5216c11..3e3df7e 100644
12228 --- a/drivers/video/Kconfig
12229 +++ b/drivers/video/Kconfig
12230 @@ -594,7 +594,7 @@ config FB_TGA
12231
12232 config FB_VESA
12233 bool "VESA VGA graphics support"
12234 - depends on (FB = y) && X86
12235 + depends on (FB = y) && X86 && !VGA_NOPROBE
12236 select FB_CFB_FILLRECT
12237 select FB_CFB_COPYAREA
12238 select FB_CFB_IMAGEBLIT
12239 @@ -1028,7 +1028,7 @@ config FB_CARILLO_RANCH
12240
12241 config FB_INTEL
12242 tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G support (EXPERIMENTAL)"
12243 - depends on FB && EXPERIMENTAL && PCI && X86
12244 + depends on FB && EXPERIMENTAL && PCI && X86 && !VGA_NOPROBE
12245 select AGP
12246 select AGP_INTEL
12247 select FB_MODE_HELPERS
12248 @@ -1383,7 +1383,7 @@ config FB_SAVAGE_ACCEL
12249
12250 config FB_SIS
12251 tristate "SiS/XGI display support"
12252 - depends on FB && PCI
12253 + depends on FB && PCI && !VGA_NOPROBE
12254 select FB_CFB_FILLRECT
12255 select FB_CFB_COPYAREA
12256 select FB_CFB_IMAGEBLIT
12257 @@ -1822,6 +1822,15 @@ config FB_PS3_DEFAULT_SIZE_M
12258 The default value can be overridden on the kernel command line
12259 using the "ps3fb" option (e.g. "ps3fb=9M");
12260
12261 +config FB_OLPC_DCON
12262 + tristate "One Laptop Per Child Display CONtroller support"
12263 + depends on OLPC
12264 + select I2C
12265 + ---help---
12266 + Add support for the OLPC DCON controller. This controller is only
12267 + available on OLPC platforms. Unless you have one of these
12268 + platforms, you will want to say 'N'.
12269 +
12270 config FB_XILINX
12271 tristate "Xilinx frame buffer support"
12272 depends on FB && XILINX_VIRTEX
12273 diff --git a/drivers/video/Makefile b/drivers/video/Makefile
12274 index 06eec7b..fc535fb 100644
12275 --- a/drivers/video/Makefile
12276 +++ b/drivers/video/Makefile
12277 @@ -111,6 +111,7 @@ obj-$(CONFIG_FB_PNX4008_DUM_RGB) += pnx4008/
12278 obj-$(CONFIG_FB_IBM_GXT4500) += gxt4500.o
12279 obj-$(CONFIG_FB_PS3) += ps3fb.o
12280 obj-$(CONFIG_FB_SM501) += sm501fb.o
12281 +obj-$(CONFIG_FB_OLPC_DCON) += olpc_dcon.o
12282 obj-$(CONFIG_FB_XILINX) += xilinxfb.o
12283 obj-$(CONFIG_FB_OMAP) += omap/
12284
12285 diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
12286 index 0740272..4ac6a95 100644
12287 --- a/drivers/video/fbmem.c
12288 +++ b/drivers/video/fbmem.c
12289 @@ -820,6 +820,53 @@ static void try_to_load(int fb)
12290 #endif /* CONFIG_KMOD */
12291
12292 int
12293 +fb_powerup(struct fb_info *info)
12294 +{
12295 + int ret = 0;
12296 +
12297 + if (!info || info->state == FBINFO_STATE_RUNNING)
12298 + return 0;
12299 +
12300 + if (info->fbops->fb_powerup)
12301 + ret = info->fbops->fb_powerup(info);
12302 +
12303 + if (!ret) {
12304 + acquire_console_sem();
12305 + fb_set_suspend(info, 0);
12306 + release_console_sem();
12307 + }
12308 +
12309 + return ret;
12310 +}
12311 +
12312 +int
12313 +fb_powerdown(struct fb_info *info)
12314 +{
12315 + int ret = 0;
12316 +
12317 + if (!info || info->state == FBINFO_STATE_SUSPENDED)
12318 + return 0;
12319 +
12320 + /* Tell everybody that the fbdev is going down */
12321 + acquire_console_sem();
12322 + fb_set_suspend(info, 1);
12323 + release_console_sem();
12324 +
12325 + if (info->fbops->fb_powerdown)
12326 + ret = info->fbops->fb_powerdown(info);
12327 +
12328 + /* If the power down failed, then un-notify */
12329 +
12330 + if (ret) {
12331 + acquire_console_sem();
12332 + fb_set_suspend(info, 0);
12333 + release_console_sem();
12334 + }
12335 +
12336 + return ret;
12337 +}
12338 +
12339 +int
12340 fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
12341 {
12342 struct fb_fix_screeninfo *fix = &info->fix;
12343 diff --git a/drivers/video/geode/Makefile b/drivers/video/geode/Makefile
12344 index 957304b..5c98da1 100644
12345 --- a/drivers/video/geode/Makefile
12346 +++ b/drivers/video/geode/Makefile
12347 @@ -5,5 +5,5 @@ obj-$(CONFIG_FB_GEODE_GX) += gxfb.o
12348 obj-$(CONFIG_FB_GEODE_LX) += lxfb.o
12349
12350 gx1fb-objs := gx1fb_core.o display_gx1.o video_cs5530.o
12351 -gxfb-objs := gxfb_core.o display_gx.o video_gx.o
12352 +gxfb-objs := gxfb_core.o display_gx.o video_gx.o suspend_gx.o
12353 lxfb-objs := lxfb_core.o lxfb_ops.o
12354 diff --git a/drivers/video/geode/display_gx.c b/drivers/video/geode/display_gx.c
12355 index 0f16e4b..a432b99 100644
12356 --- a/drivers/video/geode/display_gx.c
12357 +++ b/drivers/video/geode/display_gx.c
12358 @@ -11,26 +11,44 @@
12359 * Free Software Foundation; either version 2 of the License, or * (at your
12360 * option) any later version.
12361 */
12362 +
12363 +#include <linux/kernel.h>
12364 #include <linux/spinlock.h>
12365 #include <linux/fb.h>
12366 #include <linux/delay.h>
12367 #include <asm/io.h>
12368 #include <asm/div64.h>
12369 #include <asm/delay.h>
12370 +#include <asm/olpc.h>
12371
12372 #include "geodefb.h"
12373 #include "display_gx.h"
12374
12375 -#ifdef CONFIG_FB_GEODE_GX_SET_FBSIZE
12376 -unsigned int gx_frame_buffer_size(void)
12377 +static inline void rmwl(u32 val, u32 *reg)
12378 {
12379 - return CONFIG_FB_GEODE_GX_FBSIZE;
12380 + u32 in = readl(reg);
12381 + if (in != val)
12382 + writel(val, reg);
12383 }
12384 -#else
12385 +
12386 unsigned int gx_frame_buffer_size(void)
12387 {
12388 unsigned int val;
12389
12390 +#ifdef CONFIG_OLPC
12391 + if (machine_is_olpc() && !olpc_has_vsa()) {
12392 + u32 hi,lo;
12393 + rdmsr(GLIU0_P2D_RO0, lo, hi);
12394 +
12395 + /* Top page number */
12396 + val = ((hi & 0xff) << 12) | ((lo & 0xfff00000) >> 20);
12397 +
12398 + val -= (lo & 0x000fffff); /* Subtract bottom page number */
12399 + val += 1; /* Adjust page count */
12400 + return (val << 12);
12401 + }
12402 +#endif
12403 +
12404 /* FB size is reported by a virtual register */
12405 /* Virtual register class = 0x02 */
12406 /* VG_MEM_SIZE(512Kb units) = 0x00 */
12407 @@ -41,7 +59,6 @@ unsigned int gx_frame_buffer_size(void)
12408 val = (unsigned int)(inw(0xAC1E)) & 0xFFl;
12409 return (val << 19);
12410 }
12411 -#endif
12412
12413 int gx_line_delta(int xres, int bpp)
12414 {
12415 @@ -63,23 +80,23 @@ static void gx_set_mode(struct fb_info *info)
12416 gcfg = readl(par->dc_regs + DC_GENERAL_CFG);
12417 dcfg = readl(par->dc_regs + DC_DISPLAY_CFG);
12418
12419 - /* Disable the timing generator. */
12420 - dcfg &= ~(DC_DCFG_TGEN);
12421 - writel(dcfg, par->dc_regs + DC_DISPLAY_CFG);
12422 + /* Programming the clock is costly and ugly, so avoid if if we can */
12423
12424 - /* Wait for pending memory requests before disabling the FIFO load. */
12425 - udelay(100);
12426 + if (par->curdclk != info->var.pixclock) {
12427 + /* Disable the timing generator. */
12428 + dcfg &= ~(DC_DCFG_TGEN);
12429 + writel(dcfg, par->dc_regs + DC_DISPLAY_CFG);
12430
12431 - /* Disable FIFO load and compression. */
12432 - gcfg &= ~(DC_GCFG_DFLE | DC_GCFG_CMPE | DC_GCFG_DECE);
12433 - writel(gcfg, par->dc_regs + DC_GENERAL_CFG);
12434 + /* Wait for pending memory requests before disabling the FIFO load. */
12435 + udelay(100);
12436
12437 - /* Setup DCLK and its divisor. */
12438 - par->vid_ops->set_dclk(info);
12439 + /* Disable FIFO load and compression. */
12440 + gcfg &= ~(DC_GCFG_DFLE | DC_GCFG_CMPE | DC_GCFG_DECE);
12441 + writel(gcfg, par->dc_regs + DC_GENERAL_CFG);
12442
12443 - /*
12444 - * Setup new mode.
12445 - */
12446 + /* Setup DCLK and its divisor. */
12447 + par->vid_ops->set_dclk(info);
12448 + }
12449
12450 /* Clear all unused feature bits. */
12451 gcfg &= DC_GCFG_YUVM | DC_GCFG_VDSE;
12452 @@ -90,12 +107,13 @@ static void gx_set_mode(struct fb_info *info)
12453 gcfg |= (6 << DC_GCFG_DFHPEL_POS) | (5 << DC_GCFG_DFHPSL_POS) | DC_GCFG_DFLE;
12454
12455 /* Framebuffer start offset. */
12456 - writel(0, par->dc_regs + DC_FB_ST_OFFSET);
12457 + rmwl(0, par->dc_regs + DC_FB_ST_OFFSET);
12458
12459 /* Line delta and line buffer length. */
12460 - writel(info->fix.line_length >> 3, par->dc_regs + DC_GFX_PITCH);
12461 - writel(((info->var.xres * info->var.bits_per_pixel/8) >> 3) + 2,
12462 - par->dc_regs + DC_LINE_SIZE);
12463 + rmwl(info->fix.line_length >> 3, par->dc_regs + DC_GFX_PITCH);
12464 +
12465 + rmwl(((info->var.xres * info->var.bits_per_pixel/8) >> 3) + 2,
12466 + par->dc_regs + DC_LINE_SIZE);
12467
12468
12469 /* Enable graphics and video data and unmask address lines. */
12470 @@ -134,17 +152,16 @@ static void gx_set_mode(struct fb_info *info)
12471 vblankend = vsyncend + info->var.upper_margin;
12472 vtotal = vblankend;
12473
12474 - writel((hactive - 1) | ((htotal - 1) << 16), par->dc_regs + DC_H_ACTIVE_TIMING);
12475 - writel((hblankstart - 1) | ((hblankend - 1) << 16), par->dc_regs + DC_H_BLANK_TIMING);
12476 - writel((hsyncstart - 1) | ((hsyncend - 1) << 16), par->dc_regs + DC_H_SYNC_TIMING);
12477 -
12478 - writel((vactive - 1) | ((vtotal - 1) << 16), par->dc_regs + DC_V_ACTIVE_TIMING);
12479 - writel((vblankstart - 1) | ((vblankend - 1) << 16), par->dc_regs + DC_V_BLANK_TIMING);
12480 - writel((vsyncstart - 1) | ((vsyncend - 1) << 16), par->dc_regs + DC_V_SYNC_TIMING);
12481 + rmwl((hactive - 1) | ((htotal - 1) << 16), par->dc_regs + DC_H_ACTIVE_TIMING);
12482 + rmwl((hblankstart - 1) | ((hblankend - 1) << 16), par->dc_regs + DC_H_BLANK_TIMING);
12483 + rmwl((hsyncstart - 1) | ((hsyncend - 1) << 16), par->dc_regs + DC_H_SYNC_TIMING);
12484 + rmwl((vactive - 1) | ((vtotal - 1) << 16), par->dc_regs + DC_V_ACTIVE_TIMING);
12485 + rmwl((vblankstart - 1) | ((vblankend - 1) << 16), par->dc_regs + DC_V_BLANK_TIMING);
12486 + rmwl((vsyncstart - 1) | ((vsyncend - 1) << 16), par->dc_regs + DC_V_SYNC_TIMING);
12487
12488 /* Write final register values. */
12489 - writel(dcfg, par->dc_regs + DC_DISPLAY_CFG);
12490 - writel(gcfg, par->dc_regs + DC_GENERAL_CFG);
12491 + rmwl(dcfg, par->dc_regs + DC_DISPLAY_CFG);
12492 + rmwl(gcfg, par->dc_regs + DC_GENERAL_CFG);
12493
12494 par->vid_ops->configure_display(info);
12495
12496 diff --git a/drivers/video/geode/display_gx.h b/drivers/video/geode/display_gx.h
12497 index 0af33f3..d20b877 100644
12498 --- a/drivers/video/geode/display_gx.h
12499 +++ b/drivers/video/geode/display_gx.h
12500 @@ -20,6 +20,9 @@ extern struct geode_dc_ops gx_dc_ops;
12501 #define GLD_MSR_CONFIG 0xC0002001
12502 #define GLD_MSR_CONFIG_DM_FP 0x40
12503
12504 +/* Used for memory dection on the OLPC */
12505 +#define GLIU0_P2D_RO0 0x10000029
12506 +
12507 /* Display controller registers */
12508
12509 #define DC_UNLOCK 0x00
12510 diff --git a/drivers/video/geode/geode_regs.h b/drivers/video/geode/geode_regs.h
12511 new file mode 100644
12512 index 0000000..9e75505
12513 --- /dev/null
12514 +++ b/drivers/video/geode/geode_regs.h
12515 @@ -0,0 +1,242 @@
12516 +/* This header file defines the registers and suspend/resume
12517 + structures for the Geode GX and LX. The lxfb driver defines
12518 + _GEODELX_ before including this file, which will unlock the
12519 + extra registers that are only valid for LX.
12520 +*/
12521 +
12522 +#ifndef _GEODE_REGS_H_
12523 +#define _GEODE_REGS_H_
12524 +
12525 +/* MSRs */
12526 +
12527 +#define GX_VP_MSR_PAD_SELECT 0xC0002011
12528 +#define LX_VP_MSR_PAD_SELECT 0x48000011
12529 +
12530 +#define GEODE_MSR_GLCP_DOTPLL 0x4c000015
12531 +
12532 +#define GLCP_DOTPLL_RESET (1 << 0)
12533 +#define GLCP_DOTPLL_BYPASS (1 << 15)
12534 +#define GLCP_DOTPLL_HALFPIX (1 << 24)
12535 +#define GLCP_DOTPLL_LOCK (1 << 25)
12536 +
12537 +/* Registers */
12538 +#define VP_FP_START 0x400
12539 +
12540 +
12541 +#ifdef _GEODELX_
12542 +
12543 +#define GP_REG_SIZE 0x7C
12544 +#define DC_REG_SIZE 0xF0
12545 +#define VP_REG_SIZE 0x158
12546 +#define FP_REG_SIZE 0x70
12547 +
12548 +#else
12549 +
12550 +#define GP_REG_SIZE 0x50
12551 +#define DC_REG_SIZE 0x90
12552 +#define VP_REG_SIZE 0x138
12553 +#define FP_REG_SIZE 0x70
12554 +
12555 +#endif
12556 +
12557 +#define DC_PAL_SIZE 0x105
12558 +
12559 +struct geoderegs {
12560 +
12561 + struct {
12562 + u64 padsel;
12563 + u64 dotpll;
12564 +
12565 +#ifdef _GEODELX_
12566 + u64 dfglcfg;
12567 + u64 dcspare;
12568 +#else
12569 + u64 rstpll;
12570 +#endif
12571 + } msr;
12572 +
12573 + union {
12574 + unsigned char b[GP_REG_SIZE];
12575 + struct {
12576 + u32 dst_offset; /* 0x00 */
12577 + u32 src_offset; /* 0x04 */
12578 + u32 stride; /* 0x08 */
12579 + u32 wid_height; /* 0x0C */
12580 + u32 src_color_fg; /* 0x10 */
12581 + u32 src_color_bg; /* 0x14 */
12582 + u32 pat_color_0; /* 0x18 */
12583 + u32 pat_color_1; /* 0x1C */
12584 + u32 pat_color_2; /* 0x20 */
12585 + u32 pat_color_3; /* 0x24 */
12586 + u32 pat_color_4; /* 0x28 */
12587 + u32 pat_color_5; /* 0x2C */
12588 + u32 pat_data_0; /* 0x30 */
12589 + u32 pat_data_1; /* 0x34 */
12590 + u32 raster_mode; /* 0x38 */
12591 + u32 vector_mode; /* 0x3C */
12592 + u32 blt_mode; /* 0x40 */
12593 + u32 blit_status; /* 0x4C */
12594 + u32 hst_src; /* 0x48 */
12595 + u32 base_offset; /* 0x4C */
12596 +
12597 +#ifdef _GEODELX_
12598 + u32 cmd_top; /* 0x50 */
12599 + u32 cmd_bot; /* 0x54 */
12600 + u32 cmd_read; /* 0x58 */
12601 + u32 cmd_write; /* 0x5C */
12602 + u32 ch3_offset; /* 0x60 */
12603 + u32 ch3_mode_str; /* 0x64 */
12604 + u32 ch3_width; /* 0x68 */
12605 + u32 ch3_hsrc; /* 0x6C */
12606 + u32 lut_index; /* 0x70 */
12607 + u32 lut_data; /* 0x74 */
12608 + u32 int_cntrl; /* 0x78 */
12609 +#endif
12610 + } r;
12611 + } gp;
12612 +
12613 + union {
12614 + unsigned char b[DC_REG_SIZE];
12615 +
12616 + struct {
12617 + u32 unlock; /* 0x00 */
12618 + u32 gcfg; /* 0x04 */
12619 + u32 dcfg; /* 0x08 */
12620 + u32 arb; /* 0x0C */
12621 + u32 fb_st_offset; /* 0x10 */
12622 + u32 cb_st_offset; /* 0x14 */
12623 + u32 curs_st_offset; /* 0x18 */
12624 + u32 icon_st_offset; /* 0x1C */
12625 + u32 vid_y_st_offset; /* 0x20 */
12626 + u32 vid_u_st_offset; /* 0x24 */
12627 + u32 vid_v_st_offset; /* 0x28 */
12628 + u32 dctop; /* 0x2c */
12629 + u32 line_size; /* 0x30 */
12630 + u32 gfx_pitch; /* 0x34 */
12631 + u32 vid_yuv_pitch; /* 0x38 */
12632 + u32 rsvd2; /* 0x3C */
12633 + u32 h_active_timing; /* 0x40 */
12634 + u32 h_blank_timing; /* 0x44 */
12635 + u32 h_sync_timing; /* 0x48 */
12636 + u32 rsvd3; /* 0x4C */
12637 + u32 v_active_timing; /* 0x50 */
12638 + u32 v_blank_timing; /* 0x54 */
12639 + u32 v_sync_timing; /* 0x58 */
12640 + u32 fbactive; /* 0x5C */
12641 + u32 dc_cursor_x; /* 0x60 */
12642 + u32 dc_cursor_y; /* 0x64 */
12643 + u32 dc_icon_x; /* 0x68 */
12644 + u32 dc_line_cnt; /* 0x6C */
12645 + u32 rsvd5; /* 0x70 - palette address */
12646 + u32 rsvd6; /* 0x74 - palette data */
12647 + u32 dfifo_diag; /* 0x78 */
12648 + u32 cfifo_diag; /* 0x7C */
12649 + u32 dc_vid_ds_delta; /* 0x80 */
12650 + u32 gliu0_mem_offset; /* 0x84 */
12651 + u32 dv_ctl; /* 0x88 - added by LX */
12652 + u32 dv_acc; /* 0x8C */
12653 +
12654 +#ifdef _GEODELX_
12655 + u32 gfx_scale;
12656 + u32 irq_filt_ctl;
12657 + u32 filt_coeff1;
12658 + u32 filt_coeff2;
12659 + u32 vbi_event_ctl;
12660 + u32 vbi_odd_ctl;
12661 + u32 vbi_hor;
12662 + u32 vbi_ln_odd;
12663 + u32 vbi_ln_event;
12664 + u32 vbi_pitch;
12665 + u32 clr_key;
12666 + u32 clr_key_mask;
12667 + u32 clr_key_x;
12668 + u32 clr_key_y;
12669 + u32 irq;
12670 + u32 rsvd8;
12671 + u32 genlk_ctrl;
12672 + u32 vid_even_y_st_offset; /* 0xD8 */
12673 + u32 vid_even_u_st_offset; /* 0xDC */
12674 + u32 vid_even_v_st_offset; /* 0xE0 */
12675 + u32 v_active_even_timing; /* 0xE4 */
12676 + u32 v_blank_even_timing; /* 0xE8 */
12677 + u32 v_sync_even_timing; /* 0xEC */
12678 +#endif
12679 + } r;
12680 + } dc;
12681 +
12682 + union {
12683 + unsigned char b[VP_REG_SIZE];
12684 +
12685 + struct {
12686 + u64 vcfg; /* 0x00 */
12687 + u64 dcfg; /* 0x08 */
12688 + u64 vx; /* 0x10 */
12689 + u64 vy; /* 0x18 */
12690 + u64 vs; /* 0x20 */
12691 + u64 vck; /* 0x28 */
12692 + u64 vcm; /* 0x30 */
12693 + u64 rsvd1; /* 0x38 - Gamma address*/
12694 + u64 rsvd2; /* 0x40 - Gamma data*/
12695 + u64 rsvd3; /* 0x48 */
12696 + u64 misc; /* 0x50 */
12697 + u64 ccs; /* 0x58 */
12698 + u64 rsvd4[3]; /* 0x60-0x70 */
12699 + u64 vdc; /* 0x78 */
12700 + u64 vco; /* 0x80 */
12701 + u64 crc; /* 0x88 */
12702 + u64 crc32; /* 0x90 */
12703 + u64 vde; /* 0x98 */
12704 + u64 cck; /* 0xA0 */
12705 + u64 ccm; /* 0xA8 */
12706 + u64 cc1; /* 0xB0 */
12707 + u64 cc2; /* 0xB8 */
12708 + u64 a1x; /* 0xC0 */
12709 + u64 a1y; /* 0xC8 */
12710 + u64 a1c; /* 0xD0 */
12711 + u64 a1t; /* 0xD8 */
12712 + u64 a2x; /* 0xE0 */
12713 + u64 a2y; /* 0xE8 */
12714 + u64 a2c; /* 0xF0 */
12715 + u64 a2t; /* 0xF8 */
12716 + u64 a3x; /* 0x100 */
12717 + u64 a3y; /* 0x108 */
12718 + u64 a3c; /* 0x110 */
12719 + u64 a3t; /* 0x118 */
12720 + u64 vrr; /* 0x120 */
12721 + u64 awt; /* 0x128 */
12722 + u64 vtm; /* 0x130 */
12723 +#ifdef _GEODELX_
12724 + u64 vye; /* 0x138 */
12725 + u64 a1ye; /* 0x140 */
12726 + u32 a2ye; /* 0x148 */
12727 + u32 a3ye; /* 0x150 */
12728 +#endif
12729 + } r;
12730 + } vp;
12731 +
12732 + union {
12733 + unsigned char b[FP_REG_SIZE];
12734 +
12735 + struct {
12736 + u64 pt1; /* 0x400 */
12737 + u64 pt2; /* 0x408 */
12738 + u64 pm; /* 0x410 */
12739 + u64 dfc; /* 0x418 */
12740 + u64 blfsr; /* 0x420 */
12741 + u64 rlfsr; /* 0x428 */
12742 + u64 fmi; /* 0x430 */
12743 + u64 fmd; /* 0x438 */
12744 + u64 rsvd; /* 0x440 */
12745 + u64 dca; /* 0x448 */
12746 + u64 dmd; /* 0x450 */
12747 + u64 crc; /* 0x458 */
12748 + u64 fbb; /* 0x460 */
12749 + u64 crc32; /* 0x468 */
12750 + } r;
12751 + } fp;
12752 +
12753 + u32 pal[DC_PAL_SIZE];
12754 + u32 gamma[256];
12755 +};
12756 +
12757 +#endif
12758 diff --git a/drivers/video/geode/geodefb.h b/drivers/video/geode/geodefb.h
12759 index ae04820..0214d11 100644
12760 --- a/drivers/video/geode/geodefb.h
12761 +++ b/drivers/video/geode/geodefb.h
12762 @@ -12,6 +12,10 @@
12763 #ifndef __GEODEFB_H__
12764 #define __GEODEFB_H__
12765
12766 +#define FB_POWER_STATE_OFF 0
12767 +#define FB_POWER_STATE_SUSPEND 1
12768 +#define FB_POWER_STATE_ON 2
12769 +
12770 struct geodefb_info;
12771
12772 struct geode_dc_ops {
12773 @@ -21,18 +25,24 @@ struct geode_dc_ops {
12774
12775 struct geode_vid_ops {
12776 void (*set_dclk)(struct fb_info *);
12777 + unsigned int (*get_dclk)(struct fb_info *);
12778 void (*configure_display)(struct fb_info *);
12779 int (*blank_display)(struct fb_info *, int blank_mode);
12780 };
12781
12782 struct geodefb_par {
12783 int enable_crt;
12784 + int fbactive; /* True if the current console is in KD_GRAPHICS mode */
12785 int panel_x; /* dimensions of an attached flat panel, non-zero => enable panel */
12786 int panel_y;
12787 + unsigned int curdclk; /* Used by GX to avoid unnessesary clock switching */
12788 void __iomem *dc_regs;
12789 void __iomem *vid_regs;
12790 + void __iomem *gp_regs;
12791 struct geode_dc_ops *dc_ops;
12792 struct geode_vid_ops *vid_ops;
12793 +
12794 + int state;
12795 };
12796
12797 #endif /* !__GEODEFB_H__ */
12798 diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c
12799 index cf841ef..3eabc53 100644
12800 --- a/drivers/video/geode/gxfb_core.c
12801 +++ b/drivers/video/geode/gxfb_core.c
12802 @@ -30,12 +30,31 @@
12803 #include <linux/fb.h>
12804 #include <linux/init.h>
12805 #include <linux/pci.h>
12806 +#include <linux/notifier.h>
12807 +#include <linux/vt_kern.h>
12808 +#include <linux/console.h>
12809 +#include <asm/uaccess.h>
12810 +#include <asm/olpc.h>
12811
12812 #include "geodefb.h"
12813 #include "display_gx.h"
12814 #include "video_gx.h"
12815
12816 +#define FBIOSGAMMA _IOW('F', 0x20, void *)
12817 +#define FBIOGGAMMA _IOW('F', 0x21, void *)
12818 +
12819 +#ifdef DEBUG
12820 +
12821 +#define FBIODUMPGP _IOW('F', 0x22, void *)
12822 +#define FBIODUMPDC _IOW('F', 0x23, void *)
12823 +#define FBIODUMPVP _IOW('F', 0x24, void *)
12824 +#define FBIODUMPFP _IOW('F', 0x25, void *)
12825 +
12826 +#endif
12827 +
12828 static char *mode_option;
12829 +static int noclear;
12830 +struct fb_info *gxfb_info;
12831
12832 /* Modes relevant to the GX (taken from modedb.c) */
12833 static const struct fb_videomode gx_modedb[] __initdata = {
12834 @@ -103,8 +122,20 @@ static const struct fb_videomode gx_modedb[] __initdata = {
12835 { NULL, 85, 1600, 1200, 4357, 304, 64, 46, 1, 192, 3,
12836 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
12837 FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
12838 + /* 1200x900-75 - CRT timings for the OLPC mode */
12839 + { NULL, 75, 1200, 900, 8049, 104, 240, 29, 54, 136, 3,
12840 + 0, FB_VMODE_NONINTERLACED, 0 }
12841 };
12842
12843 +#ifdef CONFIG_OLPC
12844 +static const struct fb_videomode gx_dcon_modedb[] __initdata = {
12845 + /* The only mode the DCON has is 1200x900 */
12846 + { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3,
12847 + 0, FB_VMODE_NONINTERLACED, 0 }
12848 +};
12849 +#endif
12850 +
12851 +
12852 static int gxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
12853 {
12854 if (var->xres > 1600 || var->yres > 1200)
12855 @@ -137,7 +168,7 @@ static int gxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
12856 return 0;
12857 }
12858
12859 -static int gxfb_set_par(struct fb_info *info)
12860 +int gxfb_set_par(struct fb_info *info)
12861 {
12862 struct geodefb_par *par = info->par;
12863
12864 @@ -204,16 +235,26 @@ static int gxfb_blank(int blank_mode, struct fb_info *info)
12865 return par->vid_ops->blank_display(info, blank_mode);
12866 }
12867
12868 +static int fbsize;
12869 +
12870 static int __init gxfb_map_video_memory(struct fb_info *info, struct pci_dev *dev)
12871 {
12872 struct geodefb_par *par = info->par;
12873 - int fb_len;
12874 int ret;
12875
12876 ret = pci_enable_device(dev);
12877 if (ret < 0)
12878 return ret;
12879
12880 + ret = pci_request_region(dev, 1, "gxfb (graphics processor)");
12881 + if (ret < 0)
12882 + return ret;
12883 +
12884 + par->gp_regs = ioremap(pci_resource_start(dev, 1),
12885 + pci_resource_len(dev, 1));
12886 + if (!par->gp_regs)
12887 + return -ENOMEM;
12888 +
12889 ret = pci_request_region(dev, 3, "gxfb (video processor)");
12890 if (ret < 0)
12891 return ret;
12892 @@ -232,36 +273,118 @@ static int __init gxfb_map_video_memory(struct fb_info *info, struct pci_dev *de
12893 ret = pci_request_region(dev, 0, "gxfb (framebuffer)");
12894 if (ret < 0)
12895 return ret;
12896 - if ((fb_len = gx_frame_buffer_size()) < 0)
12897 - return -ENOMEM;
12898 +
12899 + /* If the fbsize wasn't specified then try to probe it */
12900 +
12901 + if (!fbsize) {
12902 + fbsize = gx_frame_buffer_size();
12903 + if (fbsize == 0)
12904 + return -ENOMEM;
12905 + }
12906 +
12907 info->fix.smem_start = pci_resource_start(dev, 0);
12908 - info->fix.smem_len = fb_len;
12909 + info->fix.smem_len = fbsize;
12910 info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len);
12911 if (!info->screen_base)
12912 return -ENOMEM;
12913
12914 - /* Set the 16MB aligned base address of the graphics memory region
12915 + /* Set the 16MiB aligned base address of the graphics memory region
12916 * in the display controller */
12917
12918 writel(info->fix.smem_start & 0xFF000000,
12919 par->dc_regs + DC_GLIU0_MEM_OFFSET);
12920
12921 - dev_info(&dev->dev, "%d Kibyte of video memory at 0x%lx\n",
12922 + dev_info(&dev->dev, "%d KiB of video memory at 0x%lx\n",
12923 info->fix.smem_len / 1024, info->fix.smem_start);
12924
12925 return 0;
12926 }
12927
12928 +static int gxfb_ioctl( struct fb_info *info, unsigned int cmd,
12929 + unsigned long arg)
12930 +{
12931 + unsigned int gamma[GXFB_GAMMA_DWORDS];
12932 + int ret = -EINVAL;
12933 + struct geodefb_par *par = info->par;
12934 + int i;
12935 +
12936 + switch(cmd) {
12937 + case FBIOSGAMMA:
12938 + /* Read the gamma information from the user - 256 dwords */
12939 +
12940 + if (copy_from_user(gamma, (void * __user) arg, GXFB_GAMMA_SIZE))
12941 + return -EFAULT;
12942 +
12943 + writel(0, par->vid_regs + GX_GAR);
12944 +
12945 + /* Sequential writes to the data register will increment the
12946 + address automatically */
12947 +
12948 + for(i = 0; i < GXFB_GAMMA_DWORDS; i++)
12949 + writel(gamma[i] & 0xFFFFFF, par->vid_regs + GX_GDR);
12950 +
12951 + writel(readl(par->vid_regs + GX_MISC) & ~GX_MISC_GAM_EN,
12952 + par->vid_regs + GX_MISC);
12953 +
12954 + ret = 0;
12955 + break;
12956 +
12957 + case FBIOGGAMMA:
12958 + if (readl(par->vid_regs + GX_MISC) & GX_MISC_GAM_EN)
12959 + return -EINVAL;
12960 +
12961 + memset(gamma, 0, GXFB_GAMMA_SIZE);
12962 + writel(0, par->vid_regs + GX_GAR);
12963 +
12964 + for(i = 0; i < GXFB_GAMMA_DWORDS;i++)
12965 + gamma[i] = readl(par->vid_regs + GX_GDR);
12966 +
12967 + if (copy_to_user((void * __user) arg, gamma, GXFB_GAMMA_SIZE))
12968 + ret = -EFAULT;
12969 + else
12970 + ret = 0;
12971 +
12972 + break;
12973 +
12974 +#ifdef DEBUG
12975 + case FBIODUMPGP:
12976 + ret = 0;
12977 + dump_regs(info, 0);
12978 + break;
12979 +
12980 + case FBIODUMPDC:
12981 + ret = 0;
12982 + dump_regs(info, 1);
12983 + break;
12984 +
12985 + case FBIODUMPVP:
12986 + ret = 0;
12987 + dump_regs(info, 2);
12988 + break;
12989 +
12990 + case FBIODUMPFP:
12991 + ret = 0;
12992 + dump_regs(info, 3);
12993 + break;
12994 +#endif
12995 + }
12996 +
12997 + return ret;
12998 +}
12999 +
13000 static struct fb_ops gxfb_ops = {
13001 .owner = THIS_MODULE,
13002 .fb_check_var = gxfb_check_var,
13003 .fb_set_par = gxfb_set_par,
13004 .fb_setcolreg = gxfb_setcolreg,
13005 .fb_blank = gxfb_blank,
13006 + .fb_ioctl = gxfb_ioctl,
13007 /* No HW acceleration for now. */
13008 .fb_fillrect = cfb_fillrect,
13009 .fb_copyarea = cfb_copyarea,
13010 .fb_imageblit = cfb_imageblit,
13011 + .fb_powerdown = gxfb_powerdown,
13012 + .fb_powerup = gxfb_powerup,
13013 };
13014
13015 static struct fb_info * __init gxfb_init_fbinfo(struct device *dev)
13016 @@ -303,23 +426,86 @@ static struct fb_info * __init gxfb_init_fbinfo(struct device *dev)
13017 return info;
13018 }
13019
13020 -static int __init gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
13021 +static int gxfb_console_notify(struct notifier_block *self,
13022 + unsigned long action, void *data)
13023 +{
13024 + if (gxfb_info != NULL) {
13025 + struct geodefb_par *par = gxfb_info->par;
13026 + par->fbactive = (action == CONSOLE_EVENT_SWITCH_TEXT) ? 0 : 1;
13027 + }
13028 +
13029 + return NOTIFY_OK;
13030 +}
13031 +
13032 +static struct notifier_block gxfb_console_notifier = {
13033 + .notifier_call = gxfb_console_notify
13034 +};
13035 +
13036 +#ifdef CONFIG_PM
13037 +
13038 +static int gxfb_suspend(struct pci_dev *pdev, pm_message_t state)
13039 +{
13040 + struct fb_info *info = pci_get_drvdata(pdev);
13041 + struct geodefb_par *par = info->par;
13042 +
13043 + if (pdev->dev.power.power_state.event == state.event)
13044 + return 0;
13045 +
13046 + if (state.event == PM_EVENT_SUSPEND) {
13047 +
13048 + acquire_console_sem();
13049 + gxfb_powerdown(info);
13050 +
13051 + par->state = FB_POWER_STATE_OFF;
13052 + fb_set_suspend(info, 1);
13053 +
13054 + release_console_sem();
13055 + }
13056 +
13057 + pdev->dev.power.power_state = state;
13058 + return 0;
13059 +}
13060 +
13061 +static int gxfb_resume(struct pci_dev *pdev)
13062 +{
13063 + struct fb_info *info = pci_get_drvdata(pdev);
13064 +
13065 + acquire_console_sem();
13066 +
13067 + /* Turn the engine completely on */
13068 +
13069 + if (gxfb_powerup(info))
13070 + printk(KERN_ERR "gxfb: Powerup failed\n");
13071 +
13072 + fb_set_suspend(info, 0);
13073 + release_console_sem();
13074 +
13075 + pdev->dev.power.power_state = PMSG_ON;
13076 + return 0;
13077 +}
13078 +#endif
13079 +
13080 +static int __init gxfb_probe(struct pci_dev *pdev,
13081 + const struct pci_device_id *id)
13082 {
13083 struct geodefb_par *par;
13084 - struct fb_info *info;
13085 int ret;
13086 unsigned long val;
13087
13088 - info = gxfb_init_fbinfo(&pdev->dev);
13089 - if (!info)
13090 + struct fb_videomode *modedb_ptr;
13091 + int modedb_size;
13092 +
13093 + gxfb_info = gxfb_init_fbinfo(&pdev->dev);
13094 + if (gxfb_info == NULL)
13095 return -ENOMEM;
13096 - par = info->par;
13097 +
13098 + par = gxfb_info->par;
13099
13100 /* GX display controller and GX video device. */
13101 par->dc_ops = &gx_dc_ops;
13102 par->vid_ops = &gx_vid_ops;
13103
13104 - if ((ret = gxfb_map_video_memory(info, pdev)) < 0) {
13105 + if ((ret = gxfb_map_video_memory(gxfb_info, pdev)) < 0) {
13106 dev_err(&pdev->dev, "failed to map frame buffer or controller registers\n");
13107 goto err;
13108 }
13109 @@ -333,32 +519,60 @@ static int __init gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *i
13110 else
13111 par->enable_crt = 1;
13112
13113 - ret = fb_find_mode(&info->var, info, mode_option,
13114 - gx_modedb, ARRAY_SIZE(gx_modedb), NULL, 16);
13115 + /* Get the current dotclock */
13116 +
13117 + par->curdclk = (par->vid_ops->get_dclk) ? par->vid_ops->get_dclk(gxfb_info) : 0;
13118 +
13119 + /* We need to determine a display mode right now, so we will
13120 + * check to see if the DCON was previously detected by the BIOS
13121 + * and use that to make our mode database decision.
13122 + */
13123 +
13124 + modedb_ptr = (struct fb_videomode *) gx_modedb;
13125 + modedb_size = ARRAY_SIZE(gx_modedb);
13126 +
13127 +#ifdef CONFIG_OLPC
13128 + if (olpc_has_dcon()) {
13129 + modedb_ptr = (struct fb_videomode *) gx_dcon_modedb;
13130 + modedb_size = ARRAY_SIZE(gx_dcon_modedb);
13131 + }
13132 +#endif
13133 +
13134 + ret = fb_find_mode(&gxfb_info->var, gxfb_info, mode_option,
13135 + modedb_ptr, modedb_size, NULL, 16);
13136 +
13137 if (ret == 0 || ret == 4) {
13138 dev_err(&pdev->dev, "could not find valid video mode\n");
13139 ret = -EINVAL;
13140 goto err;
13141 }
13142
13143 + /* Clear the screen of garbage, unless noclear was specified,
13144 + * in which case we assume the user knows what he is doing */
13145 +
13146 + if (!noclear)
13147 + memset_io(gxfb_info->screen_base, 0, gxfb_info->fix.smem_len);
13148 +
13149 + gxfb_check_var(&gxfb_info->var, gxfb_info);
13150 + gxfb_set_par(gxfb_info);
13151 +
13152 + /* We are powered up */
13153 + par->state = FB_POWER_STATE_ON;
13154
13155 - /* Clear the frame buffer of garbage. */
13156 - memset_io(info->screen_base, 0, info->fix.smem_len);
13157
13158 - gxfb_check_var(&info->var, info);
13159 - gxfb_set_par(info);
13160 + console_event_register(&gxfb_console_notifier);
13161
13162 - if (register_framebuffer(info) < 0) {
13163 + if (register_framebuffer(gxfb_info) < 0) {
13164 ret = -EINVAL;
13165 goto err;
13166 }
13167 - pci_set_drvdata(pdev, info);
13168 - printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id);
13169 + pci_set_drvdata(pdev, gxfb_info);
13170 + printk(KERN_INFO "fb%d: %s frame buffer device\n", gxfb_info->node, gxfb_info->fix.id);
13171 return 0;
13172
13173 err:
13174 - if (info->screen_base) {
13175 - iounmap(info->screen_base);
13176 + if (gxfb_info->screen_base) {
13177 + iounmap(gxfb_info->screen_base);
13178 pci_release_region(pdev, 0);
13179 }
13180 if (par->vid_regs) {
13181 @@ -370,8 +584,9 @@ static int __init gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *i
13182 pci_release_region(pdev, 2);
13183 }
13184
13185 - if (info)
13186 - framebuffer_release(info);
13187 + if (gxfb_info)
13188 + framebuffer_release(gxfb_info);
13189 +
13190 return ret;
13191 }
13192
13193 @@ -397,9 +612,7 @@ static void gxfb_remove(struct pci_dev *pdev)
13194 }
13195
13196 static struct pci_device_id gxfb_id_table[] = {
13197 - { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_GX_VIDEO,
13198 - PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16,
13199 - 0xff0000, 0 },
13200 + { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_GX_VIDEO) },
13201 { 0, }
13202 };
13203
13204 @@ -410,22 +623,30 @@ static struct pci_driver gxfb_driver = {
13205 .id_table = gxfb_id_table,
13206 .probe = gxfb_probe,
13207 .remove = gxfb_remove,
13208 +#ifdef CONFIG_PM
13209 + .suspend = gxfb_suspend,
13210 + .resume = gxfb_resume
13211 +#endif
13212 };
13213
13214 #ifndef MODULE
13215 -static int __init gxfb_setup(char *options)
13216 -{
13217 +static int __init gxfb_setup(char *options) {
13218
13219 char *opt;
13220
13221 if (!options || !*options)
13222 return 0;
13223
13224 - while ((opt = strsep(&options, ",")) != NULL) {
13225 + while((opt = strsep(&options, ",")) != NULL) {
13226 if (!*opt)
13227 continue;
13228
13229 - mode_option = opt;
13230 + if (!strncmp(opt, "fbsize:", 7))
13231 + fbsize = simple_strtoul(opt+7, NULL, 0);
13232 + else if (!strcmp(opt, "noclear"))
13233 + noclear = 1;
13234 + else
13235 + mode_option = opt;
13236 }
13237
13238 return 0;
13239 @@ -444,7 +665,6 @@ static int __init gxfb_init(void)
13240 #endif
13241 return pci_register_driver(&gxfb_driver);
13242 }
13243 -
13244 static void __exit gxfb_cleanup(void)
13245 {
13246 pci_unregister_driver(&gxfb_driver);
13247 @@ -456,5 +676,8 @@ module_exit(gxfb_cleanup);
13248 module_param(mode_option, charp, 0);
13249 MODULE_PARM_DESC(mode_option, "video mode (<x>x<y>[-<bpp>][@<refr>])");
13250
13251 +module_param(fbsize, int, 0);
13252 +MODULE_PARM_DESC(fbsize, "video memory size");
13253 +
13254 MODULE_DESCRIPTION("Framebuffer driver for the AMD Geode GX");
13255 MODULE_LICENSE("GPL");
13256 diff --git a/drivers/video/geode/lxfb.h b/drivers/video/geode/lxfb.h
13257 index 6c227f9..5be8a4d 100644
13258 --- a/drivers/video/geode/lxfb.h
13259 +++ b/drivers/video/geode/lxfb.h
13260 @@ -25,10 +25,23 @@ void lx_set_mode(struct fb_info *);
13261 void lx_get_gamma(struct fb_info *, unsigned int *, int);
13262 void lx_set_gamma(struct fb_info *, unsigned int *, int);
13263 unsigned int lx_framebuffer_size(void);
13264 +int lx_shutdown(struct fb_info *);
13265 +int lx_powerup(struct fb_info *);
13266 int lx_blank_display(struct fb_info *, int);
13267 void lx_set_palette_reg(struct fb_info *, unsigned int, unsigned int,
13268 unsigned int, unsigned int);
13269
13270 +
13271 +
13272 +/* ioctl() defines */
13273 +
13274 +#define FBIOSGAMMA _IOW('F', 0x20, void *)
13275 +#define FBIOGGAMMA _IOW('F', 0x21, void *)
13276 +
13277 +/* General definitions */
13278 +#define LXFB_GAMMA_DWORDS 256 /* number of dwords in the gamma ram */
13279 +#define LXFB_GAMMA_SIZE (LXFB_GAMMA_DWORDS * sizeof(unsigned int))
13280 +
13281 /* MSRS */
13282
13283 #define MSR_LX_GLD_CONFIG 0x48002001
13284 diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c
13285 index 5e30b40..c9060ed 100644
13286 --- a/drivers/video/geode/lxfb_core.c
13287 +++ b/drivers/video/geode/lxfb_core.c
13288 @@ -22,6 +22,7 @@
13289 #include <linux/init.h>
13290 #include <linux/pci.h>
13291 #include <linux/uaccess.h>
13292 +#include <asm/olpc.h>
13293
13294 #include "lxfb.h"
13295
13296 @@ -35,186 +36,84 @@ static int fbsize;
13297 */
13298
13299 const struct fb_videomode geode_modedb[] __initdata = {
13300 - /* 640x480-60 */
13301 - { NULL, 60, 640, 480, 39682, 48, 8, 25, 2, 88, 2,
13302 + /* 640x480-60 VESA */
13303 + { NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2,
13304 + 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13305 + /* 640x480-75 VESA */
13306 + { NULL, 75, 640, 480, 31746, 120, 16, 16, 01, 64, 3,
13307 + 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13308 + /* 640x480-85 VESA */
13309 + { NULL, 85, 640, 480, 27777, 80, 56, 25, 01, 56, 3,
13310 + 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13311 + /* 800x600-60 VESA */
13312 + { NULL, 60, 800, 600, 25000, 88, 40, 23, 01, 128, 4,
13313 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13314 - FB_VMODE_NONINTERLACED, 0 },
13315 - /* 640x400-70 */
13316 - { NULL, 70, 640, 400, 39770, 40, 8, 28, 5, 96, 2,
13317 - FB_SYNC_HOR_HIGH_ACT,
13318 - FB_VMODE_NONINTERLACED, 0 },
13319 - /* 640x480-70 */
13320 - { NULL, 70, 640, 480, 35014, 88, 24, 15, 2, 64, 3,
13321 - 0, FB_VMODE_NONINTERLACED, 0 },
13322 - /* 640x480-72 */
13323 - { NULL, 72, 640, 480, 32102, 120, 16, 20, 1, 40, 3,
13324 + FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13325 + /* 800x600-75 VESA */
13326 + { NULL, 75, 800, 600, 20202, 160, 16, 21, 01, 80, 3,
13327 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13328 - FB_VMODE_NONINTERLACED, 0 },
13329 - /* 640x480-75 */
13330 - { NULL, 75, 640, 480, 31746, 120, 16, 16, 1, 64, 3,
13331 + FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13332 + /* 800x600-85 VESA */
13333 + { NULL, 85, 800, 600, 17761, 152, 32, 27, 01, 64, 3,
13334 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13335 - FB_VMODE_NONINTERLACED, 0 },
13336 - /* 640x480-85 */
13337 - { NULL, 85, 640, 480, 27780, 80, 56, 25, 1, 56, 3,
13338 + FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13339 + /* 1024x768-60 VESA */
13340 + { NULL, 60, 1024, 768, 15384, 160, 24, 29, 3, 136, 6,
13341 + 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13342 + /* 1024x768-75 VESA */
13343 + { NULL, 75, 1024, 768, 12690, 176, 16, 28, 1, 96, 3,
13344 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13345 - FB_VMODE_NONINTERLACED, 0 },
13346 - /* 640x480-90 */
13347 - { NULL, 90, 640, 480, 26392, 96, 32, 22, 1, 64, 3,
13348 - 0, FB_VMODE_NONINTERLACED, 0 },
13349 - /* 640x480-100 */
13350 - { NULL, 100, 640, 480, 23167, 104, 40, 25, 1, 64, 3,
13351 - 0, FB_VMODE_NONINTERLACED, 0 },
13352 - /* 640x480-60 */
13353 - { NULL, 60, 640, 480, 39682, 48, 16, 25, 10, 88, 2,
13354 + FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13355 + /* 1024x768-85 VESA */
13356 + { NULL, 85, 1024, 768, 10582, 208, 48, 36, 1, 96, 3,
13357 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13358 - FB_VMODE_NONINTERLACED, 0 },
13359 - /* 800x600-56 */
13360 - { NULL, 56, 800, 600, 27901, 128, 24, 22, 1, 72, 2,
13361 - 0, FB_VMODE_NONINTERLACED, 0 },
13362 - /* 800x600-60 */
13363 - { NULL, 60, 800, 600, 25131, 72, 32, 23, 1, 136, 4,
13364 - 0, FB_VMODE_NONINTERLACED, 0 },
13365 - /* 800x600-70 */
13366 - { NULL, 70, 800, 600, 21873, 120, 40, 21, 4, 80, 3,
13367 - 0, FB_VMODE_NONINTERLACED, 0 },
13368 - /* 800x600-72 */
13369 - { NULL, 72, 800, 600, 20052, 64, 56, 23, 37, 120, 6,
13370 - 0, FB_VMODE_NONINTERLACED, 0 },
13371 - /* 800x600-75 */
13372 - { NULL, 75, 800, 600, 20202, 160, 16, 21, 1, 80, 3,
13373 - 0, FB_VMODE_NONINTERLACED, 0 },
13374 - /* 800x600-85 */
13375 - { NULL, 85, 800, 600, 17790, 152, 32, 27, 1, 64, 3,
13376 - 0, FB_VMODE_NONINTERLACED, 0 },
13377 - /* 800x600-90 */
13378 - { NULL, 90, 800, 600, 16648, 128, 40, 28, 1, 88, 3,
13379 - 0, FB_VMODE_NONINTERLACED, 0 },
13380 - /* 800x600-100 */
13381 - { NULL, 100, 800, 600, 14667, 136, 48, 27, 1, 88, 3,
13382 - 0, FB_VMODE_NONINTERLACED, 0 },
13383 - /* 800x600-60 */
13384 - { NULL, 60, 800, 600, 25131, 88, 40, 23, 1, 128, 4,
13385 + FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13386 + /* 1280x960-60 VESA */
13387 + { NULL, 60, 1280, 960, 9259, 312, 96, 36, 1, 112, 3,
13388 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13389 - FB_VMODE_NONINTERLACED, 0 },
13390 - /* 1024x768-60 */
13391 - { NULL, 60, 1024, 768, 15385, 160, 24, 29, 3, 136, 6,
13392 + FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13393 + /* 1280x960-85 VESA */
13394 + { NULL, 85, 1280, 960, 6734, 224, 64, 47, 1, 160, 3,
13395 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13396 - FB_VMODE_NONINTERLACED, 0 },
13397 - /* 1024x768-70 */
13398 - { NULL, 70, 1024, 768, 13346, 144, 24, 29, 3, 136, 6,
13399 + FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13400 + /* 1280x1024-60 VESA */
13401 + { NULL, 60, 1280, 1024, 9259, 248, 48, 38, 1, 112, 3,
13402 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13403 - FB_VMODE_NONINTERLACED, 0 },
13404 - /* 1024x768-72 */
13405 - { NULL, 72, 1024, 768, 12702, 168, 56, 29, 4, 112, 3,
13406 - 0, FB_VMODE_NONINTERLACED, 0 },
13407 - /* 1024x768-75 */
13408 - { NULL, 75, 1024, 768, 12703, 176, 16, 28, 1, 96, 3,
13409 - 0, FB_VMODE_NONINTERLACED, 0 },
13410 - /* 1024x768-85 */
13411 - { NULL, 85, 1024, 768, 10581, 208, 48, 36, 1, 96, 3,
13412 - 0, FB_VMODE_NONINTERLACED, 0 },
13413 - /* 1024x768-90 */
13414 - { NULL, 90, 1024, 768, 9981, 176, 64, 37, 1, 112, 3,
13415 - 0, FB_VMODE_NONINTERLACED, 0 },
13416 - /* 1024x768-100 */
13417 - { NULL, 100, 1024, 768, 8825, 184, 72, 42, 1, 112, 3,
13418 - 0, FB_VMODE_NONINTERLACED, 0 },
13419 - /* 1024x768-60 */
13420 - { NULL, 60, 1024, 768, 15385, 160, 24, 29, 3, 136, 6,
13421 + FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13422 + /* 1280x1024-75 VESA */
13423 + { NULL, 75, 1280, 1024, 7407, 248, 16, 38, 1, 144, 3,
13424 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13425 - FB_VMODE_NONINTERLACED, 0 },
13426 - /* 1152x864-60 */
13427 - { NULL, 60, 1152, 864, 12251, 184, 64, 27, 1, 120, 3,
13428 - 0, FB_VMODE_NONINTERLACED, 0 },
13429 - /* 1152x864-70 */
13430 - { NULL, 70, 1152, 864, 10254, 192, 72, 32, 8, 120, 3,
13431 - 0, FB_VMODE_NONINTERLACED, 0 },
13432 - /* 1152x864-72 */
13433 - { NULL, 72, 1152, 864, 9866, 200, 72, 33, 7, 128, 3,
13434 - 0, FB_VMODE_NONINTERLACED, 0 },
13435 - /* 1152x864-75 */
13436 - { NULL, 75, 1152, 864, 9259, 256, 64, 32, 1, 128, 3,
13437 - 0, FB_VMODE_NONINTERLACED, 0 },
13438 - /* 1152x864-85 */
13439 - { NULL, 85, 1152, 864, 8357, 200, 72, 37, 3, 128, 3,
13440 - 0, FB_VMODE_NONINTERLACED, 0 },
13441 - /* 1152x864-90 */
13442 - { NULL, 90, 1152, 864, 7719, 208, 80, 42, 9, 128, 3,
13443 - 0, FB_VMODE_NONINTERLACED, 0 },
13444 - /* 1152x864-100 */
13445 - { NULL, 100, 1152, 864, 6947, 208, 80, 48, 3, 128, 3,
13446 - 0, FB_VMODE_NONINTERLACED, 0 },
13447 - /* 1152x864-60 */
13448 - { NULL, 60, 1152, 864, 12251, 184, 64, 27, 1, 120, 3,
13449 + FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13450 + /* 1280x1024-85 VESA */
13451 + { NULL, 85, 1280, 1024, 6349, 224, 64, 44, 1, 160, 3,
13452 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13453 - FB_VMODE_NONINTERLACED, 0 },
13454 - /* 1280x1024-60 */
13455 - { NULL, 60, 1280, 1024, 9262, 248, 48, 38, 1, 112, 3,
13456 - 0, FB_VMODE_NONINTERLACED, 0 },
13457 - /* 1280x1024-70 */
13458 - { NULL, 70, 1280, 1024, 7719, 224, 88, 38, 6, 136, 3,
13459 - 0, FB_VMODE_NONINTERLACED, 0 },
13460 - /* 1280x1024-72 */
13461 - { NULL, 72, 1280, 1024, 7490, 224, 88, 39, 7, 136, 3,
13462 - 0, FB_VMODE_NONINTERLACED, 0 },
13463 - /* 1280x1024-75 */
13464 - { NULL, 75, 1280, 1024, 7409, 248, 16, 38, 1, 144, 3,
13465 - 0, FB_VMODE_NONINTERLACED, 0 },
13466 - /* 1280x1024-85 */
13467 - { NULL, 85, 1280, 1024, 6351, 224, 64, 44, 1, 160, 3,
13468 - 0, FB_VMODE_NONINTERLACED, 0 },
13469 - /* 1280x1024-90 */
13470 - { NULL, 90, 1280, 1024, 5791, 240, 96, 51, 12, 144, 3,
13471 - 0, FB_VMODE_NONINTERLACED, 0 },
13472 - /* 1280x1024-100 */
13473 - { NULL, 100, 1280, 1024, 5212, 240, 96, 57, 6, 144, 3,
13474 - 0, FB_VMODE_NONINTERLACED, 0 },
13475 - /* 1280x1024-60 */
13476 - { NULL, 60, 1280, 1024, 9262, 248, 48, 38, 1, 112, 3,
13477 - FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13478 - FB_VMODE_NONINTERLACED, 0 },
13479 - /* 1600x1200-60 */
13480 + FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13481 + /* 1600x1200-60 VESA */
13482 { NULL, 60, 1600, 1200, 6172, 304, 64, 46, 1, 192, 3,
13483 - 0, FB_VMODE_NONINTERLACED, 0 },
13484 - /* 1600x1200-70 */
13485 - { NULL, 70, 1600, 1200, 5291, 304, 64, 46, 1, 192, 3,
13486 - 0, FB_VMODE_NONINTERLACED, 0 },
13487 - /* 1600x1200-72 */
13488 - { NULL, 72, 1600, 1200, 5053, 288, 112, 47, 13, 176, 3,
13489 - 0, FB_VMODE_NONINTERLACED, 0 },
13490 - /* 1600x1200-75 */
13491 + FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13492 + FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13493 + /* 1600x1200-75 VESA */
13494 { NULL, 75, 1600, 1200, 4938, 304, 64, 46, 1, 192, 3,
13495 - 0, FB_VMODE_NONINTERLACED, 0 },
13496 - /* 1600x1200-85 */
13497 + FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13498 + FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13499 + /* 1600x1200-85 VESA */
13500 { NULL, 85, 1600, 1200, 4357, 304, 64, 46, 1, 192, 3,
13501 - 0, FB_VMODE_NONINTERLACED, 0 },
13502 - /* 1600x1200-90 */
13503 - { NULL, 90, 1600, 1200, 3981, 304, 128, 60, 1, 176, 3,
13504 - 0, FB_VMODE_NONINTERLACED, 0 },
13505 - /* 1600x1200-100 */
13506 - { NULL, 100, 1600, 1200, 3563, 304, 128, 67, 1, 176, 3,
13507 - 0, FB_VMODE_NONINTERLACED, 0 },
13508 - /* 1600x1200-60 */
13509 - { NULL, 60, 1600, 1200, 6172, 304, 64, 46, 1, 192, 3,
13510 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13511 - FB_VMODE_NONINTERLACED, 0 },
13512 - /* 1920x1440-60 */
13513 - { NULL, 60, 1920, 1440, 4273, 344, 128, 56, 1, 208, 3,
13514 - 0, FB_VMODE_NONINTERLACED, 0 },
13515 - /* 1920x1440-70 */
13516 - { NULL, 70, 1920, 1440, 3593, 360, 152, 55, 8, 208, 3,
13517 - 0, FB_VMODE_NONINTERLACED, 0 },
13518 - /* 1920x1440-72 */
13519 - { NULL, 72, 1920, 1440, 3472, 360, 152, 68, 4, 208, 3,
13520 - 0, FB_VMODE_NONINTERLACED, 0 },
13521 - /* 1920x1440-75 */
13522 - { NULL, 75, 1920, 1440, 3367, 352, 144, 56, 1, 224, 3,
13523 - 0, FB_VMODE_NONINTERLACED, 0 },
13524 - /* 1920x1440-85 */
13525 - { NULL, 85, 1920, 1440, 2929, 368, 152, 68, 1, 216, 3,
13526 - 0, FB_VMODE_NONINTERLACED, 0 },
13527 + FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
13528 + /* 1200x900-75 - CRT timings for the OLPC mode */
13529 + { NULL, 75, 1200, 900, 8049, 104, 240, 29, 54, 136, 3,
13530 + 0, FB_VMODE_NONINTERLACED, 0 }
13531 };
13532
13533 +#ifdef CONFIG_OLPC
13534 +const struct fb_videomode olpc_dcon_modedb[] __initdata = {
13535 + /* The only mode the DCON has is 1200x900 */
13536 + { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3,
13537 + FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
13538 + FB_VMODE_NONINTERLACED, 0 }
13539 +};
13540 +#endif
13541 +
13542 static int lxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
13543 {
13544 if (var->xres > 1920 || var->yres > 1440)
13545 @@ -379,16 +278,55 @@ static int __init lxfb_map_video_memory(struct fb_info *info,
13546 return 0;
13547 }
13548
13549 +static int lxfb_set_gamma(struct fb_info *info, void * __user data)
13550 +{
13551 + unsigned int gamma[LXFB_GAMMA_DWORDS];
13552 +
13553 + if (copy_from_user(gamma, data, LXFB_GAMMA_SIZE))
13554 + return -EFAULT;
13555 +
13556 + lx_set_gamma(info, gamma, LXFB_GAMMA_SIZE);
13557 + return 0;
13558 +}
13559 +
13560 +static int lxfb_get_gamma(struct fb_info *info, void * __user data)
13561 +{
13562 + unsigned int gamma[LXFB_GAMMA_DWORDS];
13563 + memset(gamma, 0, sizeof(gamma));
13564 +
13565 + lx_get_gamma(info, gamma, LXFB_GAMMA_DWORDS);
13566 +
13567 + return copy_to_user(data, gamma, LXFB_GAMMA_SIZE) ?
13568 + -EFAULT : 0;
13569 +}
13570 +
13571 +static int lxfb_ioctl( struct fb_info *info, unsigned int cmd,
13572 + unsigned long arg)
13573 +{
13574 + switch(cmd) {
13575 + case FBIOSGAMMA:
13576 + return lxfb_set_gamma(info, (void * __user) arg);
13577 +
13578 + case FBIOGGAMMA:
13579 + return lxfb_get_gamma(info, (void * __user) arg);
13580 + }
13581 +
13582 + return -ENOTTY;
13583 +}
13584 +
13585 static struct fb_ops lxfb_ops = {
13586 .owner = THIS_MODULE,
13587 .fb_check_var = lxfb_check_var,
13588 .fb_set_par = lxfb_set_par,
13589 .fb_setcolreg = lxfb_setcolreg,
13590 .fb_blank = lxfb_blank,
13591 + .fb_ioctl = lxfb_ioctl,
13592 /* No HW acceleration for now. */
13593 .fb_fillrect = cfb_fillrect,
13594 .fb_copyarea = cfb_copyarea,
13595 .fb_imageblit = cfb_imageblit,
13596 + .fb_powerdown = lx_shutdown,
13597 + .fb_powerup = lx_powerup,
13598 };
13599
13600 static struct fb_info * __init lxfb_init_fbinfo(struct device *dev)
13601 @@ -431,6 +369,45 @@ static struct fb_info * __init lxfb_init_fbinfo(struct device *dev)
13602 return info;
13603 }
13604
13605 +#ifdef CONFIG_PM
13606 +
13607 +static int lxfb_suspend(struct pci_dev *pdev, pm_message_t state)
13608 +{
13609 + struct fb_info *info = pci_get_drvdata(pdev);
13610 +
13611 + if (pdev->dev.power.power_state.event == state.event)
13612 + return 0;
13613 +
13614 + if (state.event == PM_EVENT_SUSPEND) {
13615 +
13616 + acquire_console_sem();
13617 + lx_shutdown(info);
13618 + fb_set_suspend(info, 1);
13619 + release_console_sem();
13620 + }
13621 +
13622 + pdev->dev.power.power_state = state;
13623 + return 0;
13624 +}
13625 +
13626 +static int lxfb_resume(struct pci_dev *pdev)
13627 +{
13628 + struct fb_info *info = pci_get_drvdata(pdev);
13629 +
13630 + acquire_console_sem();
13631 +
13632 + /* Turn the engine completely on */
13633 +
13634 + lx_powerup(info);
13635 + fb_set_suspend(info, 0);
13636 + release_console_sem();
13637 +
13638 + pdev->dev.power.power_state = PMSG_ON;
13639 + return 0;
13640 +}
13641 +
13642 +#endif
13643 +
13644 static int __init lxfb_probe(struct pci_dev *pdev,
13645 const struct pci_device_id *id)
13646 {
13647 @@ -467,6 +444,13 @@ static int __init lxfb_probe(struct pci_dev *pdev,
13648 modedb_ptr = (struct fb_videomode *) geode_modedb;
13649 modedb_size = ARRAY_SIZE(geode_modedb);
13650
13651 +#ifdef CONFIG_OLPC
13652 + if (olpc_has_dcon()) {
13653 + modedb_ptr = (struct fb_videomode *) olpc_dcon_modedb;
13654 + modedb_size = ARRAY_SIZE(olpc_dcon_modedb);
13655 + }
13656 +#endif
13657 +
13658 ret = fb_find_mode(&info->var, info, mode_option,
13659 modedb_ptr, modedb_size, NULL, 16);
13660
13661 @@ -556,6 +540,10 @@ static struct pci_driver lxfb_driver = {
13662 .id_table = lxfb_id_table,
13663 .probe = lxfb_probe,
13664 .remove = lxfb_remove,
13665 +#ifdef CONFIG_PM
13666 + .suspend = lxfb_suspend,
13667 + .resume = lxfb_resume
13668 +#endif
13669 };
13670
13671 #ifndef MODULE
13672 diff --git a/drivers/video/geode/lxfb_ops.c b/drivers/video/geode/lxfb_ops.c
13673 index 4fbc99b..47ed9de 100644
13674 --- a/drivers/video/geode/lxfb_ops.c
13675 +++ b/drivers/video/geode/lxfb_ops.c
13676 @@ -13,9 +13,13 @@
13677 #include <linux/fb.h>
13678 #include <linux/uaccess.h>
13679 #include <linux/delay.h>
13680 +#include <asm/olpc.h>
13681
13682 #include "lxfb.h"
13683
13684 +#define _GEODELX_
13685 +#include "geode_regs.h"
13686 +
13687 /* TODO
13688 * Support panel scaling
13689 * Add acceleration
13690 @@ -290,6 +294,19 @@ unsigned int lx_framebuffer_size(void)
13691 {
13692 unsigned int val;
13693
13694 +#ifdef CONFIG_OLPC
13695 + if (machine_is_olpc() && !olpc_has_vsa()) {
13696 + u32 hi,lo;
13697 + rdmsr(MSR_LX_GLIU0_P2D_RO0, lo, hi);
13698 +
13699 + /* Top page number */
13700 + val = ((hi & 0xff) << 12) | ((lo & 0xfff00000) >> 20);
13701 + val -= (lo & 0x000fffff); /* Subtract bottom page number */
13702 + val += 1; /* Adjust page count */
13703 + return (val << 12);
13704 + }
13705 +#endif
13706 +
13707 /* The frame buffer size is reported by a VSM in VSA II */
13708 /* Virtual Register Class = 0x02 */
13709 /* VG_MEM_SIZE (1MB units) = 0x00 */
13710 @@ -301,6 +318,34 @@ unsigned int lx_framebuffer_size(void)
13711 return (val << 20);
13712 }
13713
13714 +void lx_set_gamma(struct fb_info *info, unsigned int *gamma, int len)
13715 +{
13716 + int i;
13717 + struct lxfb_par *par = info->par;
13718 +
13719 + writel(0, par->df_regs + DF_PAR);
13720 +
13721 + /* Sequential writes to the data register will increment the
13722 + address automatically */
13723 +
13724 + for(i = 0; i < len; i++)
13725 + writel(gamma[i] & 0xFFFFFF, par->df_regs + DF_PDR);
13726 +
13727 + writel(readl(par->df_regs + DF_MISC) & ~DF_MISC_GAM_BYPASS,
13728 + par->df_regs + DF_MISC);
13729 +}
13730 +
13731 +void lx_get_gamma(struct fb_info *info, unsigned int *gamma, int len)
13732 +{
13733 + int i;
13734 + struct lxfb_par *par = info->par;
13735 +
13736 + writel(0, par->df_regs + DF_PAR);
13737 +
13738 + for(i = 0; i < len;i++)
13739 + gamma[i] = readl(par->df_regs + DF_PDR);
13740 +}
13741 +
13742 void lx_set_mode(struct fb_info *info)
13743 {
13744 struct lxfb_par *par = info->par;
13745 @@ -313,6 +358,7 @@ void lx_set_mode(struct fb_info *info)
13746 int vactive, vblankstart, vsyncstart, vsyncend, vblankend, vtotal;
13747
13748 /* Unlock the DC registers */
13749 + readl(par->dc_regs + DC_UNLOCK);
13750 writel(DC_UNLOCK_CODE, par->dc_regs + DC_UNLOCK);
13751
13752 lx_graphics_disable(info);
13753 @@ -534,3 +580,285 @@ int lx_blank_display(struct fb_info *info, int blank_mode)
13754
13755 return 0;
13756 }
13757 +
13758 +static struct geoderegs saved_regs;
13759 +
13760 +static void lx_save_regs(struct fb_info *info, struct geoderegs *regs)
13761 +{
13762 + struct lxfb_par *par = info->par;
13763 + int i;
13764 +
13765 + /* Wait for the command buffer to empty */
13766 + while(!(readl(par->gp_regs + 0x44) & (1 << 4)));
13767 +
13768 + rdmsrl(MSR_LX_DF_PADSEL, regs->msr.padsel);
13769 + rdmsrl(MSR_LX_GLCP_DOTPLL, regs->msr.dotpll);
13770 + rdmsrl(MSR_LX_DF_GLCONFIG, regs->msr.dfglcfg);
13771 + rdmsrl(MSR_LX_DC_SPARE, regs->msr.dcspare);
13772 +
13773 + writel(0x4758, par->dc_regs + 0x00);
13774 +
13775 + memcpy(regs->gp.b, par->gp_regs, GP_REG_SIZE);
13776 + memcpy(regs->dc.b, par->dc_regs, DC_REG_SIZE);
13777 + memcpy(regs->vp.b, par->df_regs, VP_REG_SIZE);
13778 + memcpy(regs->fp.b, par->df_regs + VP_FP_START, FP_REG_SIZE);
13779 +
13780 + /* Save the palettes */
13781 + writel(0, par->dc_regs + 0x70);
13782 +
13783 + for(i = 0; i < DC_PAL_SIZE; i++)
13784 + regs->pal[i] = readl(par->dc_regs + 0x74);
13785 +
13786 + writel(0, par->df_regs + 0x38);
13787 +
13788 + for(i = 0; i <= 0xFF; i++)
13789 + regs->gamma[i] = readl(par->df_regs + 0x40);
13790 +}
13791 +
13792 +static void lx_restore_regs(struct fb_info *info, struct geoderegs *regs)
13793 +{
13794 + struct lxfb_par *par = info->par;
13795 + u32 val, i;
13796 +
13797 + /* == DOTPLL == */
13798 +
13799 + lx_set_dotpll((u32) (regs->msr.dotpll >> 32));
13800 +
13801 + /* MSRs */
13802 +
13803 + wrmsrl(MSR_LX_DF_GLCONFIG, regs->msr.dfglcfg);
13804 +
13805 + /* == GP == */
13806 +
13807 + writel(regs->gp.r.dst_offset, par->gp_regs + 0x00);
13808 + writel(regs->gp.r.src_offset, par->gp_regs + 0x04);
13809 + writel(regs->gp.r.stride, par->gp_regs + 0x08);
13810 + writel(regs->gp.r.wid_height, par->gp_regs + 0x0C);
13811 + writel(regs->gp.r.src_color_fg, par->gp_regs + 0x10);
13812 + writel(regs->gp.r.src_color_bg, par->gp_regs + 0x14);
13813 + writel(regs->gp.r.pat_color_0, par->gp_regs + 0x18);
13814 + writel(regs->gp.r.pat_color_1, par->gp_regs + 0x1C);
13815 + writel(regs->gp.r.pat_color_2, par->gp_regs + 0x20);
13816 + writel(regs->gp.r.pat_color_3, par->gp_regs + 0x24);
13817 + writel(regs->gp.r.pat_color_4, par->gp_regs + 0x28);
13818 + writel(regs->gp.r.pat_color_5, par->gp_regs + 0x2C);
13819 + writel(regs->gp.r.pat_data_0, par->gp_regs + 0x30);
13820 + writel(regs->gp.r.pat_data_1, par->gp_regs + 0x34);
13821 +
13822 + /* Writing to these registers would cause a blt to happen */
13823 + /* 0x38, 0x3c, 0x40 */
13824 +
13825 + /* Status register (0x44) is read only */
13826 +
13827 + writel(regs->gp.r.hst_src, par->gp_regs + 0x48);
13828 + writel(regs->gp.r.base_offset, par->gp_regs + 0x4c);
13829 + writel(regs->gp.r.cmd_top, par->gp_regs + 0x50);
13830 + writel(regs->gp.r.cmd_bot, par->gp_regs + 0x54);
13831 + writel(regs->gp.r.cmd_read, par->gp_regs + 0x58);
13832 + writel(regs->gp.r.cmd_write, par->gp_regs + 0x5C);
13833 + writel(regs->gp.r.ch3_offset, par->gp_regs + 0x60);
13834 + writel(regs->gp.r.ch3_mode_str, par->gp_regs + 0x64);
13835 + writel(regs->gp.r.ch3_width, par->gp_regs + 0x6C);
13836 + writel(regs->gp.r.ch3_hsrc, par->gp_regs + 0x70);
13837 +
13838 + /* FIXME: Restore the LUT data here */
13839 +
13840 + writel(regs->gp.r.int_cntrl, par->gp_regs + 0x70);
13841 +
13842 + /* == DC == */
13843 +
13844 + /* Write the unlock value */
13845 + writel(0x4758, par->dc_regs + 0x00);
13846 +
13847 + /* Write the palette data first */
13848 +
13849 + writel(0, par->dc_regs + 0x70);
13850 +
13851 + for(i = 0; i < DC_PAL_SIZE; i++)
13852 + writel(regs->pal[i], par->dc_regs + 0x74);
13853 +
13854 + /* MSRs */
13855 + wrmsrl(MSR_LX_DC_SPARE, regs->msr.dcspare);
13856 +
13857 + /* Write the gcfg register without the enables */
13858 + writel(regs->dc.r.gcfg & ~0x0F, par->dc_regs + 0x04);
13859 +
13860 + /* Write the vcfg register without the enables */
13861 + writel(regs->dc.r.dcfg & ~0x19, par->dc_regs + 0x08);
13862 +
13863 + /* Write the rest of the active registers */
13864 + writel(regs->dc.r.arb, par->dc_regs + 0x0C);
13865 + writel(regs->dc.r.fb_st_offset, par->dc_regs + 0x10);
13866 + writel(regs->dc.r.cb_st_offset, par->dc_regs + 0x14);
13867 + writel(regs->dc.r.curs_st_offset, par->dc_regs + 0x18);
13868 + writel(regs->dc.r.icon_st_offset, par->dc_regs + 0x1C);
13869 + writel(regs->dc.r.vid_y_st_offset, par->dc_regs + 0x20);
13870 + writel(regs->dc.r.vid_u_st_offset, par->dc_regs + 0x24);
13871 + writel(regs->dc.r.vid_v_st_offset, par->dc_regs + 0x28);
13872 + writel(regs->dc.r.dctop, par->dc_regs + 0x2c);
13873 + writel(regs->dc.r.line_size, par->dc_regs + 0x30);
13874 + writel(regs->dc.r.gfx_pitch, par->dc_regs + 0x34);
13875 + writel(regs->dc.r.vid_yuv_pitch, par->dc_regs + 0x38);
13876 + writel(regs->dc.r.h_active_timing, par->dc_regs + 0x40);
13877 + writel(regs->dc.r.h_blank_timing, par->dc_regs + 0x44);
13878 + writel(regs->dc.r.h_sync_timing, par->dc_regs + 0x48);
13879 + writel(regs->dc.r.v_active_timing, par->dc_regs + 0x50);
13880 + writel(regs->dc.r.v_blank_timing, par->dc_regs + 0x54);
13881 + writel(regs->dc.r.v_sync_timing, par->dc_regs + 0x58);
13882 + writel(regs->dc.r.fbactive, par->dc_regs + 0x5c);
13883 + writel(regs->dc.r.dc_cursor_x, par->dc_regs + 0x60);
13884 + writel(regs->dc.r.dc_cursor_y, par->dc_regs + 0x64);
13885 + writel(regs->dc.r.dc_icon_x, par->dc_regs + 0x68);
13886 +
13887 + /* Skip register 0x6C (line_cnt), 0x70/0x74 (palette),
13888 + 0x78 (diagnostic), and 0x7c (diagnostic)
13889 + */
13890 +
13891 + writel(regs->dc.r.dc_vid_ds_delta, par->dc_regs + 0x80);
13892 + writel(regs->dc.r.gliu0_mem_offset, par->dc_regs + 0x84);
13893 + writel(regs->dc.r.dv_ctl, par->dc_regs + 0x88);
13894 + writel(regs->dc.r.dv_acc, par->dc_regs + 0x8C);
13895 +
13896 + writel(regs->dc.r.gfx_scale, par->dc_regs + 0x90);
13897 + writel(regs->dc.r.irq_filt_ctl, par->dc_regs + 0x94);
13898 + writel(regs->dc.r.filt_coeff1, par->dc_regs + 0x98);
13899 + writel(regs->dc.r.filt_coeff2, par->dc_regs + 0x9C);
13900 + writel(regs->dc.r.vbi_event_ctl, par->dc_regs + 0xA0);
13901 +
13902 + writel(regs->dc.r.vbi_odd_ctl, par->dc_regs + 0xA4);
13903 + writel(regs->dc.r.vbi_hor, par->dc_regs + 0xA8);
13904 + writel(regs->dc.r.vbi_ln_odd, par->dc_regs + 0xAC);
13905 + writel(regs->dc.r.vbi_ln_event, par->dc_regs + 0xB0);
13906 + writel(regs->dc.r.vbi_pitch, par->dc_regs + 0xB4);
13907 + writel(regs->dc.r.clr_key, par->dc_regs + 0xB8);
13908 + writel(regs->dc.r.clr_key_mask, par->dc_regs + 0xBC);
13909 +
13910 + writel(regs->dc.r.clr_key_x, par->dc_regs + 0xC0);
13911 + writel(regs->dc.r.clr_key_y, par->dc_regs + 0xC4);
13912 + writel(regs->dc.r.irq, par->dc_regs + 0xC8);
13913 + writel(regs->dc.r.genlk_ctrl, par->dc_regs + 0xD4);
13914 +
13915 + writel(regs->dc.r.vid_even_y_st_offset, par->dc_regs + 0xD8);
13916 + writel(regs->dc.r.vid_even_u_st_offset, par->dc_regs + 0xDC);
13917 + writel(regs->dc.r.vid_even_v_st_offset, par->dc_regs + 0xE0);
13918 +
13919 + writel(regs->dc.r.v_active_even_timing, par->dc_regs + 0xE4);
13920 + writel(regs->dc.r.v_blank_even_timing, par->dc_regs + 0xE8);
13921 + writel(regs->dc.r.v_sync_even_timing, par->dc_regs + 0xEC);
13922 +
13923 + /* == VP == */
13924 +
13925 + /* MSR */
13926 + wrmsrl(MSR_LX_DF_PADSEL, regs->msr.padsel);
13927 +
13928 + /* Write gamma information first */
13929 +
13930 + writel(0, par->df_regs + 0x38);
13931 +
13932 + for(i = 0; i <= 0xFF; i++)
13933 + writel((u32) regs->gamma[i], par->df_regs + 0x40);
13934 +
13935 + /* Don't enable video yet */
13936 + writel((u32) regs->vp.r.vcfg & ~0x01, par->df_regs + 0x00);
13937 +
13938 + /* Don't enable the CRT yet */
13939 + writel((u32) regs->vp.r.dcfg & ~0x0F, par->df_regs + 0x08);
13940 +
13941 + /* Write the rest of the VP registers */
13942 +
13943 + writel((u32) regs->vp.r.vx, par->df_regs + 0x10);
13944 + writel((u32) regs->vp.r.vy, par->df_regs + 0x18);
13945 + writel((u32) regs->vp.r.vs, par->df_regs + 0x20);
13946 + writel((u32) regs->vp.r.vck, par->df_regs + 0x28);
13947 + writel((u32) regs->vp.r.vcm, par->df_regs + 0x30);
13948 + writel((u32) regs->vp.r.misc, par->df_regs + 0x50);
13949 + writel((u32) regs->vp.r.ccs, par->df_regs + 0x58);
13950 + writel((u32) regs->vp.r.vdc, par->df_regs + 0x78);
13951 + writel((u32) regs->vp.r.vco, par->df_regs + 0x80);
13952 + writel((u32) regs->vp.r.crc, par->df_regs + 0x88);
13953 + writel((u32) regs->vp.r.vde, par->df_regs + 0x98);
13954 + writel((u32) regs->vp.r.cck, par->df_regs + 0xA0);
13955 + writel((u32) regs->vp.r.ccm, par->df_regs + 0xA8);
13956 + writel((u32) regs->vp.r.cc1, par->df_regs + 0xB0);
13957 + writel((u32) regs->vp.r.cc2, par->df_regs + 0xB8);
13958 + writel((u32) regs->vp.r.a1x, par->df_regs + 0xC0);
13959 + writel((u32) regs->vp.r.a1y, par->df_regs + 0xC8);
13960 + writel((u32) regs->vp.r.a1c, par->df_regs + 0xD0);
13961 + writel((u32) regs->vp.r.a1t, par->df_regs + 0xD8);
13962 + writel((u32) regs->vp.r.a2x, par->df_regs + 0xE0);
13963 + writel((u32) regs->vp.r.a2y, par->df_regs + 0xE8);
13964 + writel((u32) regs->vp.r.a2c, par->df_regs + 0xF0);
13965 + writel((u32) regs->vp.r.a2t, par->df_regs + 0xF8);
13966 + writel((u32) regs->vp.r.a3x, par->df_regs + 0x100);
13967 + writel((u32) regs->vp.r.a3y, par->df_regs + 0x108);
13968 + writel((u32) regs->vp.r.a3c, par->df_regs + 0x110);
13969 + writel((u32) regs->vp.r.a3t, par->df_regs + 0x118);
13970 + writel((u32) regs->vp.r.vrr, par->df_regs + 0x120);
13971 +
13972 + writel((u32) regs->vp.r.vye, par->df_regs + 0x138);
13973 + writel((u32) regs->vp.r.a1ye, par->df_regs + 0x140);
13974 + writel((u32) regs->vp.r.a2ye, par->df_regs + 0x148);
13975 + writel((u32) regs->vp.r.a3ye, par->df_regs + 0x150);
13976 +
13977 + /* == FP == */
13978 +
13979 + writel((u32) regs->fp.r.pt1, par->df_regs + 0x400);
13980 + writel((u32) regs->fp.r.pt2, par->df_regs + 0x408);
13981 + writel((u32) regs->fp.r.dfc, par->df_regs + 0x418);
13982 + writel(regs->fp.r.dca, par->df_regs + 0x448);
13983 + writel(regs->fp.r.dmd, par->df_regs + 0x450);
13984 + writel(regs->fp.r.crc, par->df_regs + 0x458);
13985 +
13986 + /* Final enables */
13987 +
13988 + val = readl(par->df_regs + 0x410);
13989 +
13990 + /* Control the panel */
13991 + if (regs->fp.r.pm & (1 << 24)) {
13992 +
13993 + if (!(val & 0x09))
13994 + writel(regs->fp.r.pm, par->df_regs + 0x410);
13995 + }
13996 + else {
13997 + if (!(val & 0x05))
13998 + writel(regs->fp.r.pm, par->df_regs + 0x410);
13999 + }
14000 +
14001 + /* Turn everything on */
14002 +
14003 + writel(regs->dc.r.gcfg, par->dc_regs + 0x04);
14004 + writel((u32) regs->vp.r.vcfg, par->df_regs + 0x00);
14005 + writel((u32) regs->vp.r.dcfg, par->df_regs + 0x08);
14006 + writel(regs->dc.r.dcfg, par->dc_regs + 0x08);
14007 +}
14008 +
14009 +static int lx_power_on = 1;
14010 +
14011 +int lx_shutdown(struct fb_info *info)
14012 +{
14013 + struct lxfb_par *par = info->par;
14014 +
14015 + if (lx_power_on == 0)
14016 + return 0;
14017 +
14018 + writel(DC_UNLOCK_CODE, par->dc_regs + DC_UNLOCK);
14019 + lx_save_regs(info, &saved_regs);
14020 + lx_graphics_disable(info);
14021 +
14022 + lx_power_on = 0;
14023 + return 0;
14024 +}
14025 +
14026 +int lx_powerup(struct fb_info *info)
14027 +{
14028 + struct lxfb_par *par = info->par;
14029 +
14030 + if (lx_power_on == 1)
14031 + return 0;
14032 +
14033 + lx_restore_regs(info, &saved_regs);
14034 + writel(0, par->dc_regs + DC_UNLOCK);
14035 +
14036 + lx_power_on = 1;
14037 + return 0;
14038 +}
14039 diff --git a/drivers/video/geode/suspend_gx.c b/drivers/video/geode/suspend_gx.c
14040 new file mode 100644
14041 index 0000000..43c25be
14042 --- /dev/null
14043 +++ b/drivers/video/geode/suspend_gx.c
14044 @@ -0,0 +1,272 @@
14045 +#include <linux/fb.h>
14046 +#include <asm/io.h>
14047 +#include <asm/msr.h>
14048 +
14049 +#include "geodefb.h"
14050 +#include "video_gx.h"
14051 +
14052 +void gx_set_dotpll(struct fb_info *info, struct geoderegs *regs)
14053 +{
14054 + int timeout = 1000;
14055 +
14056 + u64 rstpll, dotpll;
14057 +
14058 + rdmsrl(MSR_GLCP_SYS_RSTPLL, rstpll);
14059 + rdmsrl(MSR_GLCP_DOTPLL, dotpll);
14060 +
14061 + dotpll &= 0x00000000ffffffffull;
14062 + dotpll |= regs->msr.dotpll & 0xffffffff00000000ull;
14063 +
14064 + dotpll |= MSR_GLCP_DOTPLL_DOTRESET;
14065 + dotpll &= ~MSR_GLCP_DOTPLL_BYPASS;
14066 +
14067 + wrmsrl(MSR_GLCP_DOTPLL, dotpll);
14068 +
14069 + rstpll |= (regs->msr.rstpll &
14070 + ( MSR_GLCP_SYS_RSTPLL_DOTPREDIV2 |
14071 + MSR_GLCP_SYS_RSTPLL_DOTPREMULT2 |
14072 + MSR_GLCP_SYS_RSTPLL_DOTPOSTDIV3));
14073 +
14074 + wrmsrl(MSR_GLCP_SYS_RSTPLL, rstpll);
14075 + dotpll &= ~(MSR_GLCP_DOTPLL_DOTRESET);
14076 + wrmsrl(MSR_GLCP_DOTPLL, dotpll);
14077 +
14078 + do {
14079 + rdmsrl(MSR_GLCP_DOTPLL, dotpll);
14080 + } while (timeout-- && !(dotpll & MSR_GLCP_DOTPLL_LOCK));
14081 +}
14082 +
14083 +/* FIXME: Make sure nothing is read to clear */
14084 +
14085 +void gx_save_regs(struct fb_info *info, struct geoderegs *regs)
14086 +{
14087 + struct geodefb_par *par = info->par;
14088 + int i;
14089 +
14090 + /* Wait for the BLT engine to stop being busy */
14091 + while(readl(par->gp_regs + 0x44) & 0x05);
14092 +
14093 + rdmsrl(GX_VP_MSR_PAD_SELECT, regs->msr.padsel);
14094 + rdmsrl(MSR_GLCP_DOTPLL, regs->msr.dotpll);
14095 + rdmsrl(MSR_GLCP_SYS_RSTPLL, regs->msr.rstpll);
14096 +
14097 + writel(0x4758, par->dc_regs + 0x00);
14098 +
14099 + memcpy(regs->gp.b, par->gp_regs, GP_REG_SIZE);
14100 + memcpy(regs->dc.b, par->dc_regs, DC_REG_SIZE);
14101 + memcpy(regs->vp.b, par->vid_regs, VP_REG_SIZE);
14102 + memcpy(regs->fp.b, par->vid_regs + 0x400, FP_REG_SIZE);
14103 +
14104 + /* Save the palettes */
14105 + writel(0, par->dc_regs + 0x70);
14106 +
14107 + for(i = 0; i < DC_PAL_SIZE; i++)
14108 + regs->pal[i] = readl(par->dc_regs + 0x74);
14109 +
14110 + writel(0, par->vid_regs + 0x38);
14111 +
14112 + for(i = 0; i < 0xFF; i++)
14113 + regs->gamma[i] = readl(par->vid_regs + 0x40);
14114 +}
14115 +
14116 +void gx_restore_regs(struct fb_info *info, struct geoderegs *regs)
14117 +{
14118 + struct geodefb_par *par = info->par;
14119 + u32 val, i;
14120 +
14121 + /* DOTPLL */
14122 + gx_set_dotpll(info, regs);
14123 +
14124 + /* GP */
14125 +
14126 + writel(regs->gp.r.dst_offset, par->gp_regs + 0x00);
14127 + writel(regs->gp.r.src_offset, par->gp_regs + 0x04);
14128 + writel(regs->gp.r.stride, par->gp_regs + 0x08);
14129 + writel(regs->gp.r.wid_height, par->gp_regs + 0x0C);
14130 + writel(regs->gp.r.src_color_fg, par->gp_regs + 0x10);
14131 + writel(regs->gp.r.src_color_bg, par->gp_regs + 0x14);
14132 + writel(regs->gp.r.pat_color_0, par->gp_regs + 0x18);
14133 + writel(regs->gp.r.pat_color_1, par->gp_regs + 0x1C);
14134 + writel(regs->gp.r.pat_color_2, par->gp_regs + 0x20);
14135 + writel(regs->gp.r.pat_color_3, par->gp_regs + 0x24);
14136 + writel(regs->gp.r.pat_color_4, par->gp_regs + 0x28);
14137 + writel(regs->gp.r.pat_color_5, par->gp_regs + 0x2C);
14138 + writel(regs->gp.r.pat_data_0, par->gp_regs + 0x30);
14139 + writel(regs->gp.r.pat_data_1, par->gp_regs + 0x34);
14140 +
14141 + /* Don't write the raster / vector / blt mode regs */
14142 + /* status register is read only */
14143 +
14144 + writel(regs->gp.r.hst_src, par->gp_regs + 0x48);
14145 + writel(regs->gp.r.base_offset, par->gp_regs + 0x4c);
14146 +
14147 + /* DC */
14148 +
14149 + /* Write the unlock value */
14150 + writel(0x4758, par->dc_regs + 0x00);
14151 +
14152 + writel(0, par->dc_regs + 0x70);
14153 +
14154 + for(i = 0; i < DC_PAL_SIZE; i++)
14155 + writel(regs->pal[i], par->dc_regs + 0x74);
14156 +
14157 + /* Write the gcfg register without the enables */
14158 + writel(regs->dc.r.gcfg & ~0x0F, par->dc_regs + 0x04);
14159 +
14160 + /* Write the vcfg register without the enables */
14161 + writel(regs->dc.r.dcfg & ~0x19, par->dc_regs + 0x08);
14162 +
14163 + /* Write the rest of the active registers */
14164 +
14165 + writel(regs->dc.r.fb_st_offset, par->dc_regs + 0x10);
14166 + writel(regs->dc.r.cb_st_offset, par->dc_regs + 0x14);
14167 + writel(regs->dc.r.curs_st_offset, par->dc_regs + 0x18);
14168 + writel(regs->dc.r.icon_st_offset, par->dc_regs + 0x1C);
14169 + writel(regs->dc.r.vid_y_st_offset, par->dc_regs + 0x20);
14170 + writel(regs->dc.r.vid_u_st_offset, par->dc_regs + 0x24);
14171 + writel(regs->dc.r.vid_v_st_offset, par->dc_regs + 0x28);
14172 + writel(regs->dc.r.line_size, par->dc_regs + 0x30);
14173 + writel(regs->dc.r.gfx_pitch, par->dc_regs + 0x34);
14174 + writel(regs->dc.r.vid_yuv_pitch, par->dc_regs + 0x38);
14175 + writel(regs->dc.r.h_active_timing, par->dc_regs + 0x40);
14176 + writel(regs->dc.r.h_blank_timing, par->dc_regs + 0x44);
14177 + writel(regs->dc.r.h_sync_timing, par->dc_regs + 0x48);
14178 + writel(regs->dc.r.v_active_timing, par->dc_regs + 0x50);
14179 + writel(regs->dc.r.v_blank_timing, par->dc_regs + 0x54);
14180 + writel(regs->dc.r.v_sync_timing, par->dc_regs + 0x58);
14181 + writel(regs->dc.r.dc_cursor_x, par->dc_regs + 0x60);
14182 + writel(regs->dc.r.dc_cursor_y, par->dc_regs + 0x64);
14183 + writel(regs->dc.r.dc_icon_x, par->dc_regs + 0x68);
14184 +
14185 + /* Don't write the line_cnt or diag registers */
14186 +
14187 + writel(regs->dc.r.dc_vid_ds_delta, par->dc_regs + 0x80);
14188 + writel(regs->dc.r.gliu0_mem_offset, par->dc_regs + 0x84);
14189 + writel(regs->dc.r.dv_acc, par->dc_regs + 0x8C);
14190 +
14191 + /* VP */
14192 +
14193 + /* MSR */
14194 + wrmsrl(GX_VP_MSR_PAD_SELECT, regs->msr.padsel);
14195 +
14196 + writel(0, par->vid_regs + 0x38);
14197 +
14198 + for(i = 0; i < 0xFF; i++)
14199 + writel((u32) regs->gamma[i], par->vid_regs + 0x40);
14200 +
14201 + /* Don't enable video yet */
14202 + writel((u32) regs->vp.r.vcfg & ~0x01, par->vid_regs + 0x00);
14203 +
14204 + /* Don't enable the CRT yet */
14205 + writel((u32) regs->vp.r.dcfg & ~0x0F, par->vid_regs + 0x08);
14206 +
14207 + /* Write the rest of the VP registers */
14208 +
14209 + writel((u32) regs->vp.r.vx, par->vid_regs + 0x10);
14210 + writel((u32) regs->vp.r.vy, par->vid_regs + 0x18);
14211 + writel((u32) regs->vp.r.vs, par->vid_regs + 0x20);
14212 + writel((u32) regs->vp.r.vck, par->vid_regs + 0x28);
14213 + writel((u32) regs->vp.r.vcm, par->vid_regs + 0x30);
14214 + writel((u32) regs->vp.r.misc, par->vid_regs + 0x50);
14215 + writel((u32) regs->vp.r.ccs, par->vid_regs + 0x58);
14216 + writel((u32) regs->vp.r.vdc, par->vid_regs + 0x78);
14217 + writel((u32) regs->vp.r.vco, par->vid_regs + 0x80);
14218 + writel((u32) regs->vp.r.crc, par->vid_regs + 0x88);
14219 + writel((u32) regs->vp.r.vde, par->vid_regs + 0x98);
14220 + writel((u32) regs->vp.r.cck, par->vid_regs + 0xA0);
14221 + writel((u32) regs->vp.r.ccm, par->vid_regs + 0xA8);
14222 + writel((u32) regs->vp.r.cc1, par->vid_regs + 0xB0);
14223 + writel((u32) regs->vp.r.cc2, par->vid_regs + 0xB8);
14224 + writel((u32) regs->vp.r.a1x, par->vid_regs + 0xC0);
14225 + writel((u32) regs->vp.r.a1y, par->vid_regs + 0xC8);
14226 + writel((u32) regs->vp.r.a1c, par->vid_regs + 0xD0);
14227 + writel((u32) regs->vp.r.a1t, par->vid_regs + 0xD8);
14228 + writel((u32) regs->vp.r.a2x, par->vid_regs + 0xE0);
14229 + writel((u32) regs->vp.r.a2y, par->vid_regs + 0xE8);
14230 + writel((u32) regs->vp.r.a2c, par->vid_regs + 0xF0);
14231 + writel((u32) regs->vp.r.a2t, par->vid_regs + 0xF8);
14232 + writel((u32) regs->vp.r.a3x, par->vid_regs + 0x100);
14233 + writel((u32) regs->vp.r.a3y, par->vid_regs + 0x108);
14234 + writel((u32) regs->vp.r.a3c, par->vid_regs + 0x110);
14235 + writel((u32) regs->vp.r.a3t, par->vid_regs + 0x118);
14236 + writel((u32) regs->vp.r.vrr, par->vid_regs + 0x120);
14237 +
14238 +
14239 + /* FP registers */
14240 +
14241 + writel((u32) regs->fp.r.pt1, par->vid_regs + 0x400);
14242 + writel((u32) regs->fp.r.pt2, par->vid_regs + 0x408);
14243 +
14244 + writel((u32) regs->fp.r.dfc, par->vid_regs + 0x418);
14245 + writel(regs->fp.r.blfsr, par->vid_regs + 0x420);
14246 + writel(regs->fp.r.rlfsr, par->vid_regs + 0x428);
14247 + writel(regs->fp.r.fmi, par->vid_regs + 0x430);
14248 + writel(regs->fp.r.fmd, par->vid_regs + 0x438);
14249 + writel(regs->fp.r.dca, par->vid_regs + 0x448);
14250 + writel(regs->fp.r.dmd, par->vid_regs + 0x450);
14251 + writel(regs->fp.r.crc, par->vid_regs + 0x458);
14252 + writel(regs->fp.r.fbb, par->vid_regs + 0x460);
14253 +
14254 + /* Final enables */
14255 +
14256 + val = readl(par->vid_regs + 0x410);
14257 +
14258 + /* Control the panel */
14259 + if (regs->fp.r.pm & (1 << 24)) {
14260 +
14261 + if (!(val & 0x09))
14262 + writel(regs->fp.r.pm, par->vid_regs + 0x410);
14263 + }
14264 + else {
14265 + if (!(val & 0x05))
14266 + writel(regs->fp.r.pm, par->vid_regs + 0x410);
14267 + }
14268 +
14269 + /* Turn everything on */
14270 +
14271 + writel(regs->dc.r.gcfg, par->dc_regs + 0x04);
14272 + writel((u32) regs->vp.r.vcfg, par->vid_regs + 0x00);
14273 + writel((u32) regs->vp.r.dcfg, par->vid_regs + 0x08);
14274 + writel(regs->dc.r.dcfg, par->dc_regs + 0x08);
14275 +}
14276 +
14277 +
14278 +#ifdef DEBUG
14279 +
14280 +void dump_regs(struct fb_info *info, int mode) {
14281 +
14282 + struct geodefb_par *par = info->par;
14283 + u32 val;
14284 + int i;
14285 +
14286 + if (mode == 0) {
14287 + for(i = 0; i < GP_REG_SIZE; i += 4) {
14288 + val = readl(par->gp_regs + i);
14289 + }
14290 + }
14291 +
14292 + if (mode == 1) {
14293 + writel(0x4758, par->dc_regs + 0x00);
14294 +
14295 + for(i = 0; i < DC_REG_SIZE; i += 4) {
14296 + val = readl(par->dc_regs + i);
14297 + printk("DC%x: %x\n", i, val);
14298 + }
14299 + }
14300 +
14301 + if (mode == 2) {
14302 + for(i = 0; i < VP_REG_SIZE; i += 8) {
14303 + val = readl(par->vid_regs + i);
14304 + printk("VP%x: %x\n", i, val);
14305 + }
14306 + }
14307 +
14308 + if (mode == 3) {
14309 + for(i = 0; i < FP_REG_SIZE; i += 8) {
14310 + val = readl(par->vid_regs + 0x400 + i);
14311 + printk("FP%x: %x\n", i, val);
14312 + }
14313 + }
14314 +}
14315 +
14316 +#endif
14317 diff --git a/drivers/video/geode/video_gx.c b/drivers/video/geode/video_gx.c
14318 index 7f3f18d..e282e74 100644
14319 --- a/drivers/video/geode/video_gx.c
14320 +++ b/drivers/video/geode/video_gx.c
14321 @@ -16,10 +16,14 @@
14322 #include <asm/io.h>
14323 #include <asm/delay.h>
14324 #include <asm/msr.h>
14325 +#include <asm/olpc.h>
14326
14327 #include "geodefb.h"
14328 #include "video_gx.h"
14329 +#include "display_gx.h"
14330
14331 +/* This structure is used to store the saved registers during suspend */
14332 +static struct geoderegs gx_saved_regs;
14333
14334 /*
14335 * Tables of register settings for various DOTCLKs.
14336 @@ -58,7 +62,7 @@ static const struct gx_pll_entry gx_pll_table_48MHz[] = {
14337 { 13888, POSTDIV3, 0x000007E1 }, /* 72.0000 */
14338 { 13426, PREMULT2, 0x00000F4A }, /* 74.4810 */
14339 { 13333, 0, 0x00000052 }, /* 75.0000 */
14340 - { 12698, 0, 0x00000056 }, /* 78.7500 */
14341 + { 12698, 0, 0x00000056 }, /* 78.7500 */
14342 { 12500, POSTDIV3|PREMULT2, 0x00000709 }, /* 80.0000 */
14343 { 11135, PREMULT2, 0x00000262 }, /* 89.8000 */
14344 { 10582, 0, 0x000002D2 }, /* 94.5000 */
14345 @@ -117,8 +121,9 @@ static const struct gx_pll_entry gx_pll_table_14MHz[] = {
14346 { 4357, 0, 0x0000057D }, /* 229.5000 */
14347 };
14348
14349 -static void gx_set_dclk_frequency(struct fb_info *info)
14350 +void gx_set_dclk_frequency(struct fb_info *info)
14351 {
14352 + struct geodefb_par *par = info->par;
14353 const struct gx_pll_entry *pll_table;
14354 int pll_table_len;
14355 int i, best_i;
14356 @@ -173,115 +178,169 @@ static void gx_set_dclk_frequency(struct fb_info *info)
14357 do {
14358 rdmsrl(MSR_GLCP_DOTPLL, dotpll);
14359 } while (timeout-- && !(dotpll & MSR_GLCP_DOTPLL_LOCK));
14360 +
14361 + par->curdclk = pll_table[best_i].dotpll_value;
14362 }
14363
14364 -static void
14365 -gx_configure_tft(struct fb_info *info)
14366 +/* Find out the current clock - we will use this information to avoid
14367 + re-programming it if we don't need to */
14368 +
14369 +unsigned int gx_get_dclk(struct fb_info *info)
14370 {
14371 - struct geodefb_par *par = info->par;
14372 - unsigned long val;
14373 - unsigned long fp;
14374 + const struct gx_pll_entry *pll_table;
14375 + int pll_table_len;
14376 + u64 dotpll;
14377 + int i;
14378
14379 - /* Set up the DF pad select MSR */
14380 + if (cpu_data->x86_mask == 1) {
14381 + pll_table = gx_pll_table_14MHz;
14382 + pll_table_len = ARRAY_SIZE(gx_pll_table_14MHz);
14383 + } else {
14384 + pll_table = gx_pll_table_48MHz;
14385 + pll_table_len = ARRAY_SIZE(gx_pll_table_48MHz);
14386 + }
14387
14388 - rdmsrl(GX_VP_MSR_PAD_SELECT, val);
14389 - val &= ~GX_VP_PAD_SELECT_MASK;
14390 - val |= GX_VP_PAD_SELECT_TFT;
14391 - wrmsrl(GX_VP_MSR_PAD_SELECT, val);
14392 + rdmsrl(MSR_GLCP_DOTPLL, dotpll);
14393
14394 - /* Turn off the panel */
14395 + for(i = 0; i < pll_table_len; i++) {
14396 + if (pll_table[i].dotpll_value == (u32) (dotpll >> 32))
14397 + break;
14398 + }
14399
14400 - fp = readl(par->vid_regs + GX_FP_PM);
14401 - fp &= ~GX_FP_PM_P;
14402 - writel(fp, par->vid_regs + GX_FP_PM);
14403 + return (i == pll_table_len) ? 0 : pll_table[i].pixclock;
14404 +}
14405 +
14406 +
14407 +#define CMP(val, mask, res) (((val) & (mask)) == (res))
14408
14409 - /* Set timing 1 */
14410 +static void
14411 +gx_configure_tft(struct fb_info *info) {
14412
14413 - fp = readl(par->vid_regs + GX_FP_PT1);
14414 - fp &= GX_FP_PT1_VSIZE_MASK;
14415 - fp |= info->var.yres << GX_FP_PT1_VSIZE_SHIFT;
14416 - writel(fp, par->vid_regs + GX_FP_PT1);
14417 + struct geodefb_par *par = info->par;
14418 + u32 val, fp = 0, fp1, fp2, sync = 0;
14419
14420 - /* Timing 2 */
14421 - /* Set bits that are always on for TFT */
14422 + /* Set up the DF pad select MSR */
14423
14424 - fp = 0x0F100000;
14425 + rdmsrl(GX_VP_MSR_PAD_SELECT, val);
14426
14427 - /* Add sync polarity */
14428 + if ((val & GX_VP_PAD_SELECT_MASK) != GX_VP_PAD_SELECT_TFT) {
14429 + val &= ~GX_VP_PAD_SELECT_MASK;
14430 + val |= GX_VP_PAD_SELECT_TFT;
14431 + wrmsrl(GX_VP_MSR_PAD_SELECT, val);
14432 + }
14433
14434 if (!(info->var.sync & FB_SYNC_VERT_HIGH_ACT))
14435 - fp |= GX_FP_PT2_VSP;
14436 + sync |= GX_FP_PT2_VSP;
14437
14438 if (!(info->var.sync & FB_SYNC_HOR_HIGH_ACT))
14439 - fp |= GX_FP_PT2_HSP;
14440 + sync |= GX_FP_PT2_HSP;
14441
14442 - writel(fp, par->vid_regs + GX_FP_PT2);
14443 + /* We only need to turn off the panel if something changed */
14444
14445 - /* Set the dither control */
14446 - writel(0x70, par->vid_regs + GX_FP_DFC);
14447 + fp1 = readl(par->vid_regs + GX_FP_PT1);
14448 + fp2 = readl(par->vid_regs + GX_FP_PT2);
14449 +
14450 + if (!CMP(fp1, GX_FP_PT1_VSIZE_MASK, info->var.yres << GX_FP_PT1_VSIZE_SHIFT) ||
14451 + (fp2 != (0x0F100000 | sync))) {
14452
14453 - /* Enable the FP data and power (in case the BIOS didn't) */
14454 + /* Turn off the panel */
14455
14456 - fp = readl(par->vid_regs + GX_DCFG);
14457 - fp |= GX_DCFG_FP_PWR_EN | GX_DCFG_FP_DATA_EN;
14458 - writel(fp, par->vid_regs + GX_DCFG);
14459 +#ifdef NOTUSED
14460 + /* Do we really need to turn off the panel? */
14461 + /* Possibly - we have a glitch somewhere */
14462
14463 - /* Unblank the panel */
14464 + fp = readl(par->vid_regs + GX_FP_PM);
14465 + fp &= ~GX_FP_PM_P;
14466 + writel(fp, par->vid_regs + GX_FP_PM);
14467 +#endif
14468 +
14469 + /* Timing 1 */
14470 + fp1 &= GX_FP_PT1_VSIZE_MASK;
14471 + fp1 |= info->var.yres << GX_FP_PT1_VSIZE_SHIFT;
14472 + writel(fp, par->vid_regs + GX_FP_PT1);
14473 +
14474 + /* Timing 2 */
14475 + writel(0x0F100000 | sync, par->vid_regs + GX_FP_PT2);
14476 + }
14477 +
14478 + /* Set the dither control */
14479 + if (readl(par->vid_regs + GX_FP_DFC) != 0x70) {
14480 + writel(0x70, par->vid_regs + GX_FP_DFC);
14481 + }
14482 +
14483 + /* Turn on the panel */
14484
14485 fp = readl(par->vid_regs + GX_FP_PM);
14486 - fp |= GX_FP_PM_P;
14487 - writel(fp, par->vid_regs + GX_FP_PM);
14488 +
14489 + if (!(fp & 0x09))
14490 + writel(fp | GX_FP_PM_P, par->vid_regs + GX_FP_PM);
14491 }
14492
14493 +#define DCFG_DEFAULT_VAL GX_DCFG_CRT_SYNC_SKW_DFLT | GX_DCFG_HSYNC_EN | GX_DCFG_VSYNC_EN | \
14494 +GX_DCFG_CRT_EN | GX_DCFG_DAC_BL_EN
14495 +
14496 static void gx_configure_display(struct fb_info *info)
14497 {
14498 struct geodefb_par *par = info->par;
14499 - u32 dcfg, misc;
14500 + u32 dcfg, misc, sync = 0;
14501
14502 /* Set up the MISC register */
14503 -
14504 misc = readl(par->vid_regs + GX_MISC);
14505
14506 - /* Power up the DAC */
14507 - misc &= ~(GX_MISC_A_PWRDN | GX_MISC_DAC_PWRDN);
14508 + /* We leave gamma enabled if it was already enabled.
14509 + Although the hardware enables it without setting
14510 + up the gamma table, the BIOS or bootloader ought
14511 + to have either disabled it or loaded a table by now */
14512
14513 - /* Disable gamma correction */
14514 - misc |= GX_MISC_GAM_EN;
14515
14516 - writel(misc, par->vid_regs + GX_MISC);
14517
14518 - /* Write the display configuration */
14519 - dcfg = readl(par->vid_regs + GX_DCFG);
14520 + if (par->enable_crt) {
14521 + /* Power up the CRT DACs */
14522 + if (misc & ( GX_MISC_A_PWRDN | GX_MISC_DAC_PWRDN)) {
14523 + misc &= ~(GX_MISC_A_PWRDN | GX_MISC_DAC_PWRDN);
14524 + writel(misc, par->vid_regs + GX_MISC);
14525 + }
14526
14527 - /* Disable hsync and vsync */
14528 - dcfg &= ~(GX_DCFG_VSYNC_EN | GX_DCFG_HSYNC_EN);
14529 - writel(dcfg, par->vid_regs + GX_DCFG);
14530 + if (!(info->var.sync & FB_SYNC_HOR_HIGH_ACT))
14531 + sync |= GX_DCFG_CRT_HSYNC_POL;
14532
14533 - /* Clear bits from existing mode. */
14534 - dcfg &= ~(GX_DCFG_CRT_SYNC_SKW_MASK
14535 - | GX_DCFG_CRT_HSYNC_POL | GX_DCFG_CRT_VSYNC_POL
14536 - | GX_DCFG_VSYNC_EN | GX_DCFG_HSYNC_EN);
14537 + if (!(info->var.sync & FB_SYNC_VERT_HIGH_ACT))
14538 + sync |= GX_DCFG_CRT_VSYNC_POL;
14539 + }
14540 + else {
14541 + /* Turn off the CRT DACs in FP mode - we don't need them */
14542 + if ((misc & (GX_MISC_A_PWRDN | GX_MISC_DAC_PWRDN))) {
14543 + misc |= (GX_MISC_A_PWRDN | GX_MISC_DAC_PWRDN);
14544 + writel(misc, par->vid_regs + GX_MISC);
14545 + }
14546 + }
14547
14548 - /* Set default sync skew. */
14549 - dcfg |= GX_DCFG_CRT_SYNC_SKW_DFLT;
14550 + /* Write the display configuration */
14551 + dcfg = readl(par->vid_regs + GX_DCFG);
14552
14553 - /* Enable hsync and vsync. */
14554 - dcfg |= GX_DCFG_HSYNC_EN | GX_DCFG_VSYNC_EN;
14555 + if (!CMP(dcfg, DCFG_DEFAULT_VAL | GX_DCFG_CRT_HSYNC_POL | GX_DCFG_CRT_VSYNC_POL,
14556 + DCFG_DEFAULT_VAL | sync)) {
14557
14558 - /* Sync polarities. */
14559 - if (info->var.sync & FB_SYNC_HOR_HIGH_ACT)
14560 - dcfg |= GX_DCFG_CRT_HSYNC_POL;
14561 - if (info->var.sync & FB_SYNC_VERT_HIGH_ACT)
14562 - dcfg |= GX_DCFG_CRT_VSYNC_POL;
14563 + /* Disable hsync and vsync */
14564 + dcfg &= ~(GX_DCFG_VSYNC_EN | GX_DCFG_HSYNC_EN);
14565 + writel(dcfg, par->vid_regs + GX_DCFG);
14566
14567 - /* Enable the display logic */
14568 - /* Set up the DACS to blank normally */
14569 + /* Clear bits from existing mode. */
14570 + dcfg &= ~(GX_DCFG_CRT_SYNC_SKW_MASK
14571 + | GX_DCFG_CRT_HSYNC_POL | GX_DCFG_CRT_VSYNC_POL
14572 + | GX_DCFG_VSYNC_EN | GX_DCFG_HSYNC_EN);
14573
14574 - dcfg |= GX_DCFG_CRT_EN | GX_DCFG_DAC_BL_EN;
14575 + /* Set default sync skew. */
14576 + dcfg |= GX_DCFG_CRT_SYNC_SKW_DFLT;
14577
14578 - /* Enable the external DAC VREF? */
14579 + /* Enable hsync and vsync. */
14580 + dcfg |= GX_DCFG_HSYNC_EN | GX_DCFG_VSYNC_EN;
14581
14582 - writel(dcfg, par->vid_regs + GX_DCFG);
14583 + /* Enable the display logic */
14584 + dcfg |= GX_DCFG_CRT_EN | GX_DCFG_DAC_BL_EN;
14585 +
14586 + writel(dcfg, par->vid_regs + GX_DCFG);
14587 + }
14588
14589 /* Set up the flat panel (if it is enabled) */
14590
14591 @@ -289,6 +348,100 @@ static void gx_configure_display(struct fb_info *info)
14592 gx_configure_tft(info);
14593 }
14594
14595 +int gxfb_powerdown(struct fb_info *info)
14596 +{
14597 + struct geodefb_par *par = info->par;
14598 +
14599 + /* We're already suspended */
14600 +
14601 + if (par->state != FB_POWER_STATE_ON)
14602 + return 0;
14603 +
14604 + /* Save the registers */
14605 + gx_save_regs(info, &gx_saved_regs);
14606 +
14607 + /* Shut down the engine */
14608 +
14609 + writel(gx_saved_regs.vp.r.vcfg & ~0x01, par->vid_regs + GX_VCFG);
14610 + writel(gx_saved_regs.vp.r.dcfg & ~0x0F, par->vid_regs + GX_DCFG);
14611 +
14612 + /* Turn off the flat panel unless we are attached to a DCON */
14613 + if (!olpc_has_dcon())
14614 + writel(gx_saved_regs.fp.r.pm & ~GX_FP_PM_P, par->vid_regs + GX_FP_PM);
14615 +
14616 + writel(0x4758, par->dc_regs + DC_UNLOCK);
14617 +
14618 + writel(gx_saved_regs.dc.r.gcfg & ~0x0F,
14619 + par->dc_regs + DC_GENERAL_CFG);
14620 +
14621 + writel(gx_saved_regs.dc.r.dcfg & ~0x19,
14622 + par->dc_regs + DC_DISPLAY_CFG);
14623 +
14624 + par->state = FB_POWER_STATE_SUSPEND;
14625 +
14626 + return 0;
14627 +}
14628 +
14629 +int gxfb_powerup(struct fb_info *info)
14630 +{
14631 + struct geodefb_par *par = info->par;
14632 + u32 val;
14633 +
14634 + if (par->state == FB_POWER_STATE_SUSPEND) {
14635 +
14636 + writel(gx_saved_regs.dc.r.dcfg,
14637 + par->dc_regs + DC_DISPLAY_CFG);
14638 +
14639 + writel(gx_saved_regs.vp.r.vcfg, par->vid_regs + GX_VCFG);
14640 + writel(gx_saved_regs.vp.r.dcfg, par->vid_regs + GX_DCFG);
14641 +
14642 + val = readl(par->vid_regs + GX_FP_PM);
14643 +
14644 + /* power up the panel if it needs it; we don't always power it down */
14645 + if (!(val & 0x09)) {
14646 + writel(gx_saved_regs.fp.r.pm, par->vid_regs + GX_FP_PM);
14647 + mdelay(64);
14648 + }
14649 + }
14650 +
14651 + /* If the panel is currently on its way up, then wait up to 100ms
14652 + for it */
14653 +
14654 + if (readl(par->vid_regs + GX_FP_PM) & 0x08) {
14655 + int i;
14656 +
14657 + for(i = 0; i < 10; i++) {
14658 + if (readl(par->vid_regs + GX_FP_PM) & 0x01)
14659 + break;
14660 +
14661 + mdelay(10);
14662 + }
14663 +
14664 + if (i == 10)
14665 + printk(KERN_ERR "gxfb: Panel power up timed out\n");
14666 + }
14667 +
14668 + if (par->state == FB_POWER_STATE_ON)
14669 + return 0;
14670 +
14671 + switch(par->state) {
14672 + case FB_POWER_STATE_OFF:
14673 + gx_restore_regs(info, &gx_saved_regs);
14674 + break;
14675 +
14676 + case FB_POWER_STATE_SUSPEND:
14677 + /* Do this because it will turn on the FIFO which will
14678 + start the line count */
14679 + writel(gx_saved_regs.dc.r.gcfg,
14680 + par->dc_regs + DC_GENERAL_CFG);
14681 + writel(0x0, par->dc_regs + DC_UNLOCK);
14682 + break;
14683 + }
14684 +
14685 + par->state = FB_POWER_STATE_ON;
14686 + return 0;
14687 +}
14688 +
14689 static int gx_blank_display(struct fb_info *info, int blank_mode)
14690 {
14691 struct geodefb_par *par = info->par;
14692 @@ -315,6 +468,7 @@ static int gx_blank_display(struct fb_info *info, int blank_mode)
14693 default:
14694 return -EINVAL;
14695 }
14696 +
14697 dcfg = readl(par->vid_regs + GX_DCFG);
14698 dcfg &= ~(GX_DCFG_DAC_BL_EN
14699 | GX_DCFG_HSYNC_EN | GX_DCFG_VSYNC_EN);
14700 @@ -326,7 +480,7 @@ static int gx_blank_display(struct fb_info *info, int blank_mode)
14701 dcfg |= GX_DCFG_VSYNC_EN;
14702 writel(dcfg, par->vid_regs + GX_DCFG);
14703
14704 - /* Power on/off flat panel. */
14705 + /* Power on/off flat panel */
14706
14707 if (par->enable_crt == 0) {
14708 fp_pm = readl(par->vid_regs + GX_FP_PM);
14709 @@ -340,8 +494,37 @@ static int gx_blank_display(struct fb_info *info, int blank_mode)
14710 return 0;
14711 }
14712
14713 +extern struct fb_info *gxfb_info;
14714 +
14715 +/* This function controls the flatpanel power sequencing - this is used
14716 + by the OLPC power management engine to enable the FP sequencing much
14717 + earlier in the resume process
14718 +*/
14719 +
14720 +void gxfb_flatpanel_control(int state)
14721 +{
14722 + struct geodefb_par *par = gxfb_info->par;
14723 + u32 val, fp = readl(par->vid_regs + GX_FP_PM);
14724 + val = fp;
14725 +
14726 + /* Turn on the panel if it isn't aleady */
14727 +
14728 + if (state) {
14729 + if (!(val & 0x01))
14730 + val |= GX_FP_PM_P;
14731 + }
14732 + else {
14733 + if (!(val & 0x02))
14734 + val &= ~GX_FP_PM_P;
14735 + }
14736 +
14737 + if (val != fp)
14738 + writel(val, par->vid_regs + GX_FP_PM);
14739 +}
14740 +
14741 struct geode_vid_ops gx_vid_ops = {
14742 .set_dclk = gx_set_dclk_frequency,
14743 + .get_dclk = gx_get_dclk,
14744 .configure_display = gx_configure_display,
14745 .blank_display = gx_blank_display,
14746 };
14747 diff --git a/drivers/video/geode/video_gx.h b/drivers/video/geode/video_gx.h
14748 index ce28d8f..c57b36b 100644
14749 --- a/drivers/video/geode/video_gx.h
14750 +++ b/drivers/video/geode/video_gx.h
14751 @@ -11,6 +11,8 @@
14752 #ifndef __VIDEO_GX_H__
14753 #define __VIDEO_GX_H__
14754
14755 +#include "geode_regs.h"
14756 +
14757 extern struct geode_vid_ops gx_vid_ops;
14758
14759 /* GX Flatpanel control MSR */
14760 @@ -20,6 +22,8 @@ extern struct geode_vid_ops gx_vid_ops;
14761
14762 /* Geode GX video processor registers */
14763
14764 +#define GX_VCFG 0x0000
14765 +
14766 #define GX_DCFG 0x0008
14767 # define GX_DCFG_CRT_EN 0x00000001
14768 # define GX_DCFG_HSYNC_EN 0x00000002
14769 @@ -42,6 +46,14 @@ extern struct geode_vid_ops gx_vid_ops;
14770 #define GX_MISC_DAC_PWRDN 0x00000400
14771 #define GX_MISC_A_PWRDN 0x00000800
14772
14773 +/* Gamma correction RAM - address and data registers */
14774 +
14775 +#define GX_GAR 0x038
14776 +#define GX_GDR 0x040
14777 +
14778 +#define GXFB_GAMMA_DWORDS 256 /* number of dwords in the gamma ram */
14779 +#define GXFB_GAMMA_SIZE (GXFB_GAMMA_DWORDS * sizeof(unsigned int))
14780 +
14781 /* Geode GX flat panel display control registers */
14782
14783 #define GX_FP_PT1 0x0400
14784 @@ -69,4 +81,13 @@ extern struct geode_vid_ops gx_vid_ops;
14785 # define MSR_GLCP_DOTPLL_BYPASS (0x0000000000008000ull)
14786 # define MSR_GLCP_DOTPLL_LOCK (0x0000000002000000ull)
14787
14788 +int gxfb_powerdown(struct fb_info *info);
14789 +int gxfb_powerup(struct fb_info *info);
14790 +
14791 +void gx_set_dclk_frequency(struct fb_info *info);
14792 +unsigned int gx_get_dclk(struct fb_info *info);
14793 +
14794 +void gx_save_regs(struct fb_info *info, struct geoderegs *regs);
14795 +void gx_restore_regs(struct fb_info *info, struct geoderegs *regs);
14796 +
14797 #endif /* !__VIDEO_GX_H__ */
14798 diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
14799 index 3741ad7..49f6db5 100644
14800 --- a/drivers/video/modedb.c
14801 +++ b/drivers/video/modedb.c
14802 @@ -33,6 +33,8 @@ const char *global_mode_option;
14803 * Standard video mode definitions (taken from XFree86)
14804 */
14805
14806 +#define DEFAULT_MODEDB_INDEX 0
14807 +
14808 static const struct fb_videomode modedb[] = {
14809 {
14810 /* 640x400 @ 70 Hz, 31.5 kHz hsync */
14811 @@ -504,7 +506,8 @@ int fb_find_mode(struct fb_var_screeninfo *var,
14812 }
14813
14814 if (!default_mode)
14815 - default_mode = &db[0];
14816 + default_mode = (db == modedb) ?
14817 + &modedb[DEFAULT_MODEDB_INDEX] : &db[0];
14818
14819 if (!default_bpp)
14820 default_bpp = 8;
14821 diff --git a/drivers/video/olpc_dcon.c b/drivers/video/olpc_dcon.c
14822 new file mode 100644
14823 index 0000000..d4ef138
14824 --- /dev/null
14825 +++ b/drivers/video/olpc_dcon.c
14826 @@ -0,0 +1,824 @@
14827 +/*
14828 + * Mainly by David Woodhouse, somewhat modified by Jordan Crouse
14829 + *
14830 + * Copyright © 2006-2007 Red Hat, Inc.
14831 + * Copyright © 2006-2007 Advanced Micro Devices, Inc.
14832 + *
14833 + * This program is free software. You can redistribute it and/or
14834 + * modify it under the terms of version 2 of the GNU General Public
14835 + * License as published by the Free Software Foundation.
14836 + */
14837 +
14838 +
14839 +#include <linux/kernel.h>
14840 +#include <linux/fb.h>
14841 +#include <linux/i2c.h>
14842 +#include <linux/platform_device.h>
14843 +#include <linux/i2c-id.h>
14844 +#include <linux/pci.h>
14845 +#include <linux/vt_kern.h>
14846 +#include <linux/pci_ids.h>
14847 +#include <linux/interrupt.h>
14848 +#include <linux/delay.h>
14849 +#include <linux/backlight.h>
14850 +#include <linux/device.h>
14851 +#include <asm/uaccess.h>
14852 +#include <linux/ctype.h>
14853 +#include <linux/reboot.h>
14854 +#include <asm/tsc.h>
14855 +#include <asm/olpc.h>
14856 +
14857 +#include "olpc_dcon.h"
14858 +
14859 +/* Module definitions */
14860 +
14861 +static int resumeline = 898;
14862 +module_param(resumeline, int, 0444);
14863 +
14864 +static int noinit;
14865 +module_param(noinit, int, 0444);
14866 +
14867 +/* Default off since it doesn't work on DCON ASIC in B-test OLPC board */
14868 +static int useaa = 1;
14869 +module_param(useaa, int, 0444);
14870 +
14871 +/* I2C structures */
14872 +
14873 +static struct i2c_driver dcon_driver;
14874 +static struct i2c_client *dcon_client;
14875 +
14876 +/* Platform devices */
14877 +static struct platform_device *dcon_device;
14878 +
14879 +/* Backlight device */
14880 +static struct backlight_device *dcon_bl_dev;
14881 +
14882 +/* Base address of the GPIO registers */
14883 +static unsigned long gpio_base;
14884 +
14885 +static struct fb_info *fbinfo;
14886 +
14887 +/* Current source, initialized at probe time */
14888 +static int dcon_source;
14889 +
14890 +/* Desired source */
14891 +static int dcon_pending;
14892 +
14893 +/* Current output type */
14894 +static int dcon_output = DCON_OUTPUT_COLOR;
14895 +
14896 +/* Current sleep status (not yet implemented) */
14897 +static int dcon_sleep_val = DCON_ACTIVE;
14898 +
14899 +/* Shadow register for the DCON_REG_MODE register */
14900 +static unsigned short dcon_disp_mode;
14901 +
14902 +/* Variables used during switches */
14903 +static int dcon_switched;
14904 +
14905 +static DECLARE_WAIT_QUEUE_HEAD(dcon_wait_queue);
14906 +
14907 +static unsigned short normal_i2c[] = { 0x0D, I2C_CLIENT_END };
14908 +I2C_CLIENT_INSMOD;
14909 +
14910 +#define dcon_write(reg,val) i2c_smbus_write_word_data(dcon_client,reg,val)
14911 +#define dcon_read(reg) i2c_smbus_read_word_data(dcon_client,reg)
14912 +
14913 +/* The current backlight value - this saves us some smbus traffic */
14914 +static int bl_val = -1;
14915 +
14916 +/* ===== API functions - these are called by a variety of users ==== */
14917 +
14918 +/* Backlight notes - turning off the backlight enable bit in the DCON
14919 + * doesn't save us any power over just pushing the BL to zero, so we
14920 + * don't use that bit in this code.
14921 + */
14922 +
14923 +static int dcon_get_backlight(void)
14924 +{
14925 + if (dcon_client == NULL)
14926 + return 0;
14927 +
14928 + if (bl_val == -1)
14929 + bl_val = dcon_read(DCON_REG_BRIGHT) & 0x0F;
14930 +
14931 + return bl_val;
14932 +}
14933 +
14934 +static void dcon_set_backlight(int level)
14935 +{
14936 + if (dcon_client == NULL)
14937 + return;
14938 +
14939 + if (bl_val == (level & 0x0F))
14940 + return;
14941 +
14942 + bl_val = level & 0x0F;
14943 + dcon_write(DCON_REG_BRIGHT, bl_val);
14944 +
14945 + /* Purposely turn off the backlight when we go to level 0 */
14946 +
14947 + if (bl_val == 0) {
14948 + dcon_disp_mode &= ~MODE_BL_ENABLE;
14949 + dcon_write(DCON_REG_MODE, dcon_disp_mode);
14950 + }
14951 + else if (!(dcon_disp_mode & MODE_BL_ENABLE)) {
14952 + dcon_disp_mode |= MODE_BL_ENABLE;
14953 + dcon_write(DCON_REG_MODE, dcon_disp_mode);
14954 + }
14955 +}
14956 +
14957 +/* Set the output type to either color or mono */
14958 +
14959 +static int dcon_set_output(int arg)
14960 +{
14961 + if (dcon_output == arg)
14962 + return 0;
14963 +
14964 + dcon_output = arg;
14965 +
14966 + if (arg == DCON_OUTPUT_MONO) {
14967 + dcon_disp_mode &= ~(MODE_CSWIZZLE | MODE_COL_AA);
14968 + dcon_disp_mode |= MODE_MONO_LUMA;
14969 + }
14970 + else {
14971 + dcon_disp_mode &= ~(MODE_MONO_LUMA);
14972 + dcon_disp_mode |= MODE_CSWIZZLE;
14973 + if (useaa)
14974 + dcon_disp_mode |= MODE_COL_AA;
14975 + }
14976 +
14977 + dcon_write(DCON_REG_MODE, dcon_disp_mode);
14978 + return 0;
14979 +}
14980 +
14981 +/* For now, this will be really stupid - we need to address how
14982 + * DCONLOAD works in a sleep and account for it accordingly
14983 + */
14984 +
14985 +static void dcon_sleep(int state)
14986 +{
14987 + /* Turn off the backlight and put the DCON to sleep */
14988 +
14989 + if (state == dcon_sleep_val)
14990 + return;
14991 +
14992 + if (state == DCON_SLEEP) {
14993 + dcon_disp_mode &= ~MODE_BL_ENABLE;
14994 + dcon_disp_mode |= MODE_SLEEP;
14995 + }
14996 + else {
14997 + /* Only re-enable the backlight if the backlight value is set */
14998 +
14999 + if (bl_val != 0)
15000 + dcon_disp_mode |= MODE_BL_ENABLE;
15001 +
15002 + dcon_disp_mode &= ~MODE_SLEEP;
15003 + }
15004 +
15005 + dcon_sleep_val = state;
15006 + dcon_write(DCON_REG_MODE, dcon_disp_mode);
15007 +
15008 + /* We should turn off some stuff in the framebuffer - but what? */
15009 +}
15010 +
15011 +/* Set the source of the display (CPU or DCON) */
15012 +
15013 +static void dcon_source_switch(struct work_struct *work)
15014 +{
15015 + DECLARE_WAITQUEUE(wait, current);
15016 + int source = dcon_pending;
15017 +
15018 + if (dcon_source == source)
15019 + return;
15020 +
15021 + dcon_switched = 0;
15022 +
15023 + switch (source) {
15024 + case DCON_SOURCE_CPU:
15025 +
15026 + /* Enable the scanline interrupt bit */
15027 + if (dcon_write(DCON_REG_MODE, dcon_disp_mode | MODE_SCAN_INT))
15028 + printk(KERN_ERR "olpc-dcon: couldn't enable scanline interrupt!\n");
15029 + else {
15030 + /* Wait up to one second for the scanline interrupt */
15031 + wait_event_timeout(dcon_wait_queue, dcon_switched == 1, HZ);
15032 + }
15033 +
15034 + if (!dcon_switched)
15035 + printk(KERN_ERR "olpc-dcon: Timeout entering CPU mode; expect a screen glitch.\n");
15036 +
15037 + /*
15038 + * Ideally we'd like to disable interrupts here so that the
15039 + * fb_powerup and DCON turn on happen at a known time value;
15040 + * however, we can't do that right now with fb_set_suspend
15041 + * messing with semaphores.
15042 + *
15043 + * For now, we just hope..
15044 + */
15045 + if (fb_powerup(fbinfo)) {
15046 + printk(KERN_ERR "olpc-dcon: Failed to enter CPU mode\n");
15047 + dcon_pending = DCON_SOURCE_DCON;
15048 + return;
15049 + }
15050 +
15051 + /* And turn off the DCON */
15052 + outl(1<<11, gpio_base + GPIOx_OUT_VAL);
15053 +
15054 + /* Turn off the scanline interrupt */
15055 + if (dcon_write(DCON_REG_MODE, dcon_disp_mode))
15056 + printk(KERN_ERR "olpc-dcon: couldn't disable scanline interrupt!\n");
15057 +
15058 + printk(KERN_INFO "olpc-dcon: The CPU has control\n");
15059 + break;
15060 + case DCON_SOURCE_DCON:
15061 + {
15062 + int t;
15063 +
15064 + add_wait_queue(&dcon_wait_queue, &wait);
15065 + set_current_state(TASK_UNINTERRUPTIBLE);
15066 +
15067 + /* Clear GPIO11 (DCONLOAD) - this implies that the DCON is in
15068 + control */
15069 +
15070 + outl(1 << (11 + 16), gpio_base + GPIOx_OUT_VAL);
15071 +
15072 + t = schedule_timeout(HZ/2);
15073 + remove_wait_queue(&dcon_wait_queue, &wait);
15074 + set_current_state(TASK_RUNNING);
15075 +
15076 + if (!dcon_switched)
15077 + printk(KERN_ERR "olpc-dcon: Timeout entering DCON mode; expect a screen glitch.\n");
15078 +
15079 + /* Turn off the graphics engine completely */
15080 + fb_powerdown(fbinfo);
15081 +
15082 + printk(KERN_INFO "olpc-dcon: The DCON has control\n");
15083 + break;
15084 + }
15085 + default:
15086 + BUG();
15087 + }
15088 +
15089 + dcon_source = source;
15090 +}
15091 +
15092 +static DECLARE_WORK(dcon_work, dcon_source_switch);
15093 +
15094 +static int dcon_set_source(int arg)
15095 +{
15096 + if (arg != DCON_SOURCE_CPU && arg != DCON_SOURCE_DCON)
15097 + return -EINVAL;
15098 +
15099 + if (dcon_pending == arg)
15100 + return 0;
15101 +
15102 + dcon_pending = arg;
15103 + if ((dcon_source != arg) && !work_pending(&dcon_work))
15104 + schedule_work(&dcon_work);
15105 +
15106 + return 0;
15107 +}
15108 +
15109 +static int dcon_set_source_sync(int arg)
15110 +{
15111 + int ret = dcon_set_source(arg);
15112 + if (!ret)
15113 + flush_scheduled_work();
15114 + return ret;
15115 +}
15116 +
15117 +static int dconbl_set(struct backlight_device *dev) {
15118 +
15119 + int level = dev->props.brightness;
15120 +
15121 + if (dev->props.power != FB_BLANK_UNBLANK)
15122 + level = 0;
15123 +
15124 + dcon_set_backlight(level);
15125 + return 0;
15126 +}
15127 +
15128 +static int dconbl_get(struct backlight_device *dev) {
15129 + return dcon_get_backlight();
15130 +}
15131 +
15132 +static ssize_t dcon_mode_show(struct device *dev,
15133 + struct device_attribute *attr, char *buf)
15134 +{
15135 + return sprintf(buf, "%4.4X\n", dcon_disp_mode);
15136 +}
15137 +
15138 +static ssize_t dcon_sleep_show(struct device *dev,
15139 + struct device_attribute *attr, char *buf)
15140 +{
15141 + return sprintf(buf, "%d\n", dcon_sleep_val);
15142 +}
15143 +
15144 +static ssize_t /* __deprecated */ dcon_source_show(struct device *dev,
15145 + struct device_attribute *attr, char *buf)
15146 +{
15147 + printk(KERN_WARNING "olpc-dcon: using deprecated sysfs 'source' interface; use 'freeze' instead!\n");
15148 + return sprintf(buf, "%d\n", dcon_source);
15149 +}
15150 +
15151 +static ssize_t dcon_freeze_show(struct device *dev,
15152 + struct device_attribute *attr, char *buf)
15153 +{
15154 + return sprintf(buf, "%d\n", dcon_source == DCON_SOURCE_DCON ? 1 : 0);
15155 +}
15156 +
15157 +static ssize_t dcon_output_show(struct device *dev,
15158 + struct device_attribute *attr, char *buf)
15159 +{
15160 + return sprintf(buf, "%d\n", dcon_output);
15161 +}
15162 +
15163 +static ssize_t dcon_resumeline_show(struct device *dev,
15164 + struct device_attribute *attr, char *buf)
15165 +{
15166 + return sprintf(buf, "%d\n", resumeline);
15167 +}
15168 +
15169 +static int _strtoul(const char *buf, int len, unsigned int *val)
15170 +{
15171 +
15172 + char *endp;
15173 + unsigned int output = simple_strtoul(buf, &endp, 0);
15174 + int size = endp - buf;
15175 +
15176 + if (*endp && isspace(*endp))
15177 + size++;
15178 +
15179 + if (size != len)
15180 + return -EINVAL;
15181 +
15182 + *val = output;
15183 + return 0;
15184 +}
15185 +
15186 +static ssize_t dcon_output_store(struct device *dev,
15187 + struct device_attribute *attr, const char *buf, size_t count)
15188 +{
15189 + int output;
15190 + int rc = -EINVAL;
15191 +
15192 + if (_strtoul(buf, count, &output))
15193 + return -EINVAL;
15194 +
15195 + if (output == DCON_OUTPUT_COLOR || output == DCON_OUTPUT_MONO) {
15196 + dcon_set_output(output);
15197 + rc = count;
15198 + }
15199 +
15200 + return rc;
15201 +}
15202 +
15203 +static ssize_t /* __deprecated */ dcon_source_store(struct device *dev,
15204 + struct device_attribute *attr, const char *buf, size_t count)
15205 +{
15206 + int output;
15207 + int rc = -EINVAL;
15208 +
15209 + printk(KERN_WARNING "olpc-dcon: using deprecated sysfs 'source' interface; use 'freeze' instead!\n");
15210 + if (_strtoul(buf, count, &output))
15211 + return -EINVAL;
15212 +
15213 + dcon_set_source(output);
15214 + rc = count;
15215 +
15216 + return rc;
15217 +}
15218 +
15219 +static ssize_t dcon_freeze_store(struct device *dev,
15220 + struct device_attribute *attr, const char *buf, size_t count)
15221 +{
15222 + int output;
15223 + int rc = -EINVAL;
15224 +
15225 + if (_strtoul(buf, count, &output))
15226 + return rc;
15227 +
15228 + dcon_set_source(output ? DCON_SOURCE_DCON : DCON_SOURCE_CPU);
15229 + rc = count;
15230 +
15231 + return rc;
15232 +}
15233 +
15234 +static ssize_t dcon_resumeline_store(struct device *dev,
15235 + struct device_attribute *attr, const char *buf, size_t count)
15236 +{
15237 + int rl;
15238 + int rc = -EINVAL;
15239 +
15240 + if (_strtoul(buf, count, &rl))
15241 + return rc;
15242 +
15243 + resumeline = rl;
15244 + dcon_write(DCON_REG_SCAN_INT, resumeline);
15245 + rc = count;
15246 +
15247 + return rc;
15248 +}
15249 +
15250 +static ssize_t dcon_sleep_store(struct device *dev,
15251 + struct device_attribute *attr, const char *buf, size_t count)
15252 +{
15253 + int output;
15254 +
15255 + if (_strtoul(buf, count, &output))
15256 + return -EINVAL;
15257 +
15258 + dcon_sleep(output ? DCON_SLEEP : DCON_ACTIVE);
15259 + return count;
15260 +}
15261 +
15262 +static struct device_attribute dcon_device_files[] = {
15263 + __ATTR(mode, 0444, dcon_mode_show, NULL),
15264 + __ATTR(sleep, 0644, dcon_sleep_show, dcon_sleep_store),
15265 + __ATTR(source, 0644, dcon_source_show, dcon_source_store),
15266 + __ATTR(freeze, 0644, dcon_freeze_show, dcon_freeze_store),
15267 + __ATTR(output, 0644, dcon_output_show, dcon_output_store),
15268 + __ATTR(resumeline, 0644, dcon_resumeline_show, dcon_resumeline_store),
15269 +};
15270 +
15271 +static struct backlight_ops dcon_bl_ops = {
15272 + .get_brightness = dconbl_get,
15273 + .update_status = dconbl_set
15274 +};
15275 +
15276 +/* List of GPIOs that we care about:
15277 + (in) GPIO12 -- DCONBLNK
15278 + (in) GPIO[56] -- DCONSTAT[01]
15279 + (out) GPIO11 -- DCONLOAD
15280 +*/
15281 +
15282 +#define IN_GPIOS ((1<<5) | (1<<6) | (1<<7) | (1<<12))
15283 +#define OUT_GPIOS (1<<11)
15284 +
15285 +static irqreturn_t dcon_interrupt(int, void *);
15286 +
15287 +static int dcon_request_irq(void)
15288 +{
15289 + unsigned long lo, hi;
15290 + unsigned char lob;
15291 +
15292 + rdmsr(MSR_LBAR_GPIO, lo, hi);
15293 +
15294 + /* Check the mask and whether GPIO is enabled (sanity check) */
15295 + if (hi != 0x0000f001) {
15296 + printk(KERN_ERR "GPIO not enabled -- cannot use DCON\n");
15297 + return -ENODEV;
15298 + }
15299 +
15300 + /* Mask off the IO base address */
15301 + gpio_base = lo & 0x0000ff00;
15302 +
15303 + /* Turn off the event enable for GPIO7 just to be safe */
15304 + outl(1 << (16+7), gpio_base + GPIOx_EVNT_EN);
15305 +
15306 + /* Set the directions for the GPIO pins */
15307 + outl(OUT_GPIOS | (IN_GPIOS << 16), gpio_base + GPIOx_OUT_EN);
15308 + outl(IN_GPIOS | (OUT_GPIOS << 16), gpio_base + GPIOx_IN_EN);
15309 +
15310 + /* Set up the interrupt mappings */
15311 +
15312 + /* Set the IRQ to pair 2 */
15313 + geode_gpio_event_irq(OLPC_GPIO_DCON_IRQ, 2);
15314 +
15315 + /* Enable group 2 to trigger the DCON interrupt */
15316 + geode_gpio_set_irq(2, DCON_IRQ);
15317 +
15318 + /* Select edge level for interrupt (in PIC) */
15319 +
15320 + lob = inb(0x4d0);
15321 + lob &= ~(1 << DCON_IRQ);
15322 + outb(lob, 0x4d0);
15323 +
15324 + /* Register the interupt handler */
15325 + if (request_irq(DCON_IRQ, &dcon_interrupt, 0, "DCON", &dcon_driver))
15326 + return -EIO;
15327 +
15328 + /* Clear INV_EN for GPIO7 (DCONIRQ) */
15329 + outl((1<<(16+7)), gpio_base + GPIOx_INV_EN);
15330 +
15331 + /* Enable filter for GPIO12 (DCONBLANK) */
15332 + outl(1<<(12), gpio_base + GPIOx_IN_FLTR_EN);
15333 +
15334 + /* Disable filter for GPIO7 */
15335 + outl(1<<(16+7), gpio_base + GPIOx_IN_FLTR_EN);
15336 +
15337 + /* Disable event counter for GPIO7 (DCONIRQ) and GPIO12 (DCONBLANK) */
15338 +
15339 + outl(1<<(16+7), gpio_base + GPIOx_EVNTCNT_EN);
15340 + outl(1<<(16+12), gpio_base + GPIOx_EVNTCNT_EN);
15341 +
15342 + /* Add GPIO12 to the Filter Event Pair #7 */
15343 + outb(12, gpio_base + GPIO_FE7_SEL);
15344 +
15345 + /* Turn off negative Edge Enable for GPIO12 */
15346 + outl(1<<(16+12), gpio_base + GPIOx_NEGEDGE_EN);
15347 +
15348 + /* Enable negative Edge Enable for GPIO7 */
15349 + outl(1<<7, gpio_base + GPIOx_NEGEDGE_EN);
15350 +
15351 + /* Zero the filter amount for Filter Event Pair #7 */
15352 + outw(0, gpio_base + GPIO_FLT7_AMNT);
15353 +
15354 + /* Clear the negative edge status for GPIO7 and GPIO12 */
15355 + outl((1<<7) | (1<<12), gpio_base+0x4c);
15356 +
15357 + /* FIXME: Clear the posiitive status as well, just to be sure */
15358 + outl((1<<7) | (1<<12), gpio_base+0x48);
15359 +
15360 + /* Enable events for GPIO7 (DCONIRQ) and GPIO12 (DCONBLANK) */
15361 + outl((1<<(7))|(1<<12), gpio_base + GPIOx_EVNT_EN);
15362 +
15363 + /* Determine the current state by reading the GPIO bit */
15364 + /* Earlier stages of the boot process have established the state */
15365 + dcon_source = inl(gpio_base + GPIOx_OUT_VAL) & (1<<11)
15366 + ? DCON_SOURCE_CPU
15367 + : DCON_SOURCE_DCON;
15368 + dcon_pending = dcon_source;
15369 +
15370 + return 0;
15371 +}
15372 +
15373 +static int dcon_reboot_notify(struct notifier_block *nb, unsigned long foo, void *bar)
15374 +{
15375 + if (dcon_client == NULL)
15376 + return 0;
15377 +
15378 + /* Turn off the DCON. Entirely. */
15379 + dcon_write(DCON_REG_MODE, 0x39);
15380 + dcon_write(DCON_REG_MODE, 0x32);
15381 + return 0;
15382 +}
15383 +
15384 +static int dcon_conswitch_notify(struct notifier_block *nb,
15385 + unsigned long mode, void *dummy)
15386 +{
15387 + if (mode == CONSOLE_EVENT_SWITCH_TEXT)
15388 + dcon_sleep(DCON_ACTIVE);
15389 +
15390 + return 0;
15391 +}
15392 +
15393 +static struct notifier_block dcon_nb = {
15394 + .notifier_call = dcon_reboot_notify,
15395 + .priority = -1,
15396 +};
15397 +
15398 +static struct notifier_block dcon_console_nb = {
15399 + .notifier_call = dcon_conswitch_notify,
15400 + .priority = -1,
15401 +};
15402 +
15403 +static int dcon_probe(struct i2c_adapter *adap, int addr, int kind)
15404 +{
15405 + struct i2c_client *client;
15406 + uint16_t ver;
15407 + int rc, i;
15408 +
15409 + if (!olpc_has_dcon()) {
15410 + printk("olpc-dcon: No DCON is attached.\n");
15411 + return -ENODEV;
15412 + }
15413 +
15414 + if (num_registered_fb >= 1)
15415 + fbinfo = registered_fb[0];
15416 +
15417 + if (adap->id != I2C_HW_SMBUS_SCX200) {
15418 + printk(KERN_ERR "olpc-dcon: Invalid I2C bus (%d not %d)\n",
15419 + adap->id, I2C_HW_SMBUS_SCX200);
15420 + return -ENXIO;
15421 + }
15422 +
15423 + client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
15424 + if (client == NULL)
15425 + return -ENOMEM;
15426 +
15427 + strncpy(client->name, "OLPC-DCON", I2C_NAME_SIZE);
15428 + client->addr = addr;
15429 + client->adapter = adap;
15430 + client->driver = &dcon_driver;
15431 +
15432 + if ((rc = i2c_attach_client(client)) != 0) {
15433 + printk(KERN_ERR "olpc-dcon: Unable to attach the I2C client.\n");
15434 + goto eclient;
15435 + }
15436 +
15437 + ver = i2c_smbus_read_word_data(client, DCON_REG_ID);
15438 +
15439 + if ((ver >> 8) != 0xDC) {
15440 + printk(KERN_ERR "olpc-dcon: DCON ID not 0xDCxx: 0x%04x instead.\n", ver);
15441 + rc = -ENXIO;
15442 + goto ei2c;
15443 + }
15444 +
15445 + if ((rc = dcon_request_irq())) {
15446 + printk(KERN_ERR "olpc-dcon: Unable to grab IRQ.\n");
15447 + goto ei2c;
15448 + }
15449 +
15450 + if (ver < 0xdc02 && !noinit) {
15451 + /* Initialize the DCON registers */
15452 +
15453 + /* Start with work-arounds for DCON ASIC */
15454 + i2c_smbus_write_word_data(client, 0x4b, 0x00cc);
15455 + i2c_smbus_write_word_data(client, 0x4b, 0x00cc);
15456 + i2c_smbus_write_word_data(client, 0x4b, 0x00cc);
15457 + i2c_smbus_write_word_data(client, 0x0b, 0x007a);
15458 + i2c_smbus_write_word_data(client, 0x36, 0x025c);
15459 + i2c_smbus_write_word_data(client, 0x37, 0x025e);
15460 +
15461 + /* Initialise SDRAM */
15462 +
15463 + i2c_smbus_write_word_data(client, 0x3b, 0x002b);
15464 + i2c_smbus_write_word_data(client, 0x41, 0x0101);
15465 + i2c_smbus_write_word_data(client, 0x42, 0x0101);
15466 + }
15467 +
15468 + /* Colour swizzle, AA, no passthrough, backlight */
15469 +
15470 + dcon_disp_mode = MODE_PASSTHRU | MODE_BL_ENABLE | MODE_CSWIZZLE;
15471 + if (useaa)
15472 + dcon_disp_mode |= MODE_COL_AA;
15473 + i2c_smbus_write_word_data(client, DCON_REG_MODE, dcon_disp_mode);
15474 +
15475 +
15476 + /* Set the scanline to interrupt on during resume */
15477 +
15478 + i2c_smbus_write_word_data(client, DCON_REG_SCAN_INT, resumeline);
15479 +
15480 + /* Add the DCON device */
15481 +
15482 + dcon_device = platform_device_alloc("dcon", -1);
15483 +
15484 + if (dcon_device == NULL) {
15485 + printk(KERN_ERR "dcon: Unable to create the DCON device\n");
15486 + rc = -ENOMEM;
15487 + goto eirq;
15488 + }
15489 +
15490 + if ((rc = platform_device_add(dcon_device))) {
15491 + printk(KERN_ERR "dcon: Unable to add the DCON device\n");
15492 + goto edev;
15493 + }
15494 +
15495 + for(i = 0; i < ARRAY_SIZE(dcon_device_files); i++)
15496 + device_create_file(&dcon_device->dev, &dcon_device_files[i]);
15497 +
15498 + /* Add the backlight device for the DCON */
15499 +
15500 + dcon_client = client;
15501 +
15502 + dcon_bl_dev = backlight_device_register("dcon-bl", &dcon_device->dev,
15503 + NULL, &dcon_bl_ops);
15504 +
15505 + if (IS_ERR(dcon_bl_dev)) {
15506 + printk(KERN_INFO "Could not register the backlight device for the DCON (%ld)\n", PTR_ERR(dcon_bl_dev));
15507 + dcon_bl_dev = NULL;
15508 + }
15509 + else {
15510 + dcon_bl_dev->props.max_brightness = 15;
15511 + dcon_bl_dev->props.power = FB_BLANK_UNBLANK;
15512 + dcon_bl_dev->props.brightness = dcon_get_backlight();
15513 +
15514 + backlight_update_status(dcon_bl_dev);
15515 + }
15516 +
15517 + register_reboot_notifier(&dcon_nb);
15518 + console_event_register(&dcon_console_nb);
15519 +
15520 + printk(KERN_INFO "olpc-dcon: Discovered DCON version %x\n", ver & 0xFF);
15521 +
15522 + return 0;
15523 +
15524 + edev:
15525 + platform_device_unregister(dcon_device);
15526 + dcon_device = NULL;
15527 + eirq:
15528 + free_irq(DCON_IRQ, &dcon_driver);
15529 + ei2c:
15530 + i2c_detach_client(client);
15531 + eclient:
15532 + kfree(client);
15533 +
15534 + return rc;
15535 +}
15536 +
15537 +static int dcon_attach(struct i2c_adapter *adap)
15538 +{
15539 + int ret;
15540 +
15541 + ret = i2c_probe(adap, &addr_data, dcon_probe);
15542 +
15543 + if (dcon_client == NULL)
15544 + printk(KERN_ERR "olpc-dcon: No DCON found on SMBus\n");
15545 +
15546 + return ret;
15547 +}
15548 +
15549 +static int dcon_detach(struct i2c_client *client)
15550 +{
15551 + int rc;
15552 + dcon_client = NULL;
15553 +
15554 + unregister_reboot_notifier(&dcon_nb);
15555 + console_event_unregister(&dcon_console_nb);
15556 +
15557 + free_irq(DCON_IRQ, &dcon_driver);
15558 +
15559 + if ((rc = i2c_detach_client(client)) == 0)
15560 + kfree(i2c_get_clientdata(client));
15561 +
15562 + if (dcon_bl_dev != NULL)
15563 + backlight_device_unregister(dcon_bl_dev);
15564 +
15565 + if (dcon_device != NULL)
15566 + platform_device_unregister(dcon_device);
15567 + cancel_work_sync(&dcon_work);
15568 +
15569 + return rc;
15570 +}
15571 +
15572 +
15573 +#ifdef CONFIG_PM
15574 +static int dcon_suspend(struct i2c_client *client, pm_message_t state)
15575 +{
15576 + if (dcon_sleep_val != DCON_ACTIVE)
15577 + return 0;
15578 +
15579 + /* Set up the DCON to have the source */
15580 + return dcon_set_source_sync(DCON_SOURCE_DCON);
15581 +}
15582 +
15583 +static int dcon_resume(struct i2c_client *client)
15584 +{
15585 + int x;
15586 + if (dcon_sleep_val != DCON_ACTIVE)
15587 + return 0;
15588 +
15589 + /* HACK: ensure the bus is stable */
15590 + do {
15591 + x = dcon_read(DCON_REG_ID);
15592 + } while (x < 0);
15593 +
15594 + return dcon_set_source(DCON_SOURCE_CPU);
15595 +}
15596 +
15597 +#endif
15598 +
15599 +static irqreturn_t dcon_interrupt(int irq, void *id)
15600 +{
15601 + int status = inl(gpio_base + GPIOx_READ_BACK) >> 5;
15602 +
15603 + /* Clear the negative edge status for GPIO7 */
15604 + outl(1 << 7, gpio_base + GPIOx_NEGEDGE_STS);
15605 +
15606 + switch (status & 3) {
15607 + case 3:
15608 + printk(KERN_DEBUG "olpc-dcon: DCONLOAD_MISSED interrupt\n");
15609 + break;
15610 + case 2: /* switch to DCON mode */
15611 + case 1: /* switch to CPU mode */
15612 + dcon_switched = 1;
15613 + wake_up(&dcon_wait_queue);
15614 + break;
15615 + case 0:
15616 + printk(KERN_DEBUG "olpc-dcon: scanline interrupt w/CPU\n");
15617 + }
15618 +
15619 + return IRQ_HANDLED;
15620 +}
15621 +
15622 +static struct i2c_driver dcon_driver = {
15623 + .driver = {
15624 + .name = "OLPC-DCON",
15625 + },
15626 + .id = I2C_DRIVERID_DCON,
15627 + .attach_adapter = dcon_attach,
15628 + .detach_client = dcon_detach,
15629 +#ifdef CONFIG_PM
15630 + .suspend = dcon_suspend,
15631 + .resume = dcon_resume,
15632 +#endif
15633 +};
15634 +
15635 +
15636 +static int __init olpc_dcon_init(void)
15637 +{
15638 + i2c_add_driver(&dcon_driver);
15639 + return 0;
15640 +}
15641 +
15642 +static void __exit olpc_dcon_exit(void)
15643 +{
15644 + i2c_del_driver(&dcon_driver);
15645 +}
15646 +
15647 +module_init(olpc_dcon_init);
15648 +module_exit(olpc_dcon_exit);
15649 +
15650 +MODULE_LICENSE("GPL");
15651 diff --git a/drivers/video/olpc_dcon.h b/drivers/video/olpc_dcon.h
15652 new file mode 100644
15653 index 0000000..6453ca4
15654 --- /dev/null
15655 +++ b/drivers/video/olpc_dcon.h
15656 @@ -0,0 +1,75 @@
15657 +#ifndef OLPC_DCON_H_
15658 +#define OLPC_DCON_H_
15659 +
15660 +/* DCON registers */
15661 +
15662 +#define DCON_REG_ID 0
15663 +#define DCON_REG_MODE 1
15664 +
15665 +#define MODE_PASSTHRU (1<<0)
15666 +#define MODE_SLEEP (1<<1)
15667 +#define MODE_SLEEP_AUTO (1<<2)
15668 +#define MODE_BL_ENABLE (1<<3)
15669 +#define MODE_BLANK (1<<4)
15670 +#define MODE_CSWIZZLE (1<<5)
15671 +#define MODE_COL_AA (1<<6)
15672 +#define MODE_MONO_LUMA (1<<7)
15673 +#define MODE_SCAN_INT (1<<8)
15674 +#define MODE_CLOCKDIV (1<<9)
15675 +#define MODE_DEBUG (1<<14)
15676 +#define MODE_SELFTEST (1<<15)
15677 +
15678 +#define DCON_REG_HRES 2
15679 +#define DCON_REG_HTOTAL 3
15680 +#define DCON_REG_HSYNC_WIDTH 4
15681 +#define DCON_REG_VRES 5
15682 +#define DCON_REG_VTOTAL 6
15683 +#define DCON_REG_VSYNC_WIDTH 7
15684 +#define DCON_REG_TIMEOUT 8
15685 +#define DCON_REG_SCAN_INT 9
15686 +#define DCON_REG_BRIGHT 10
15687 +
15688 +/* GPIO registers (CS5536) */
15689 +
15690 +#define MSR_LBAR_GPIO 0x5140000C
15691 +
15692 +#define GPIOx_OUT_VAL 0x00
15693 +#define GPIOx_OUT_EN 0x04
15694 +#define GPIOx_IN_EN 0x20
15695 +#define GPIOx_INV_EN 0x24
15696 +#define GPIOx_IN_FLTR_EN 0x28
15697 +#define GPIOx_EVNTCNT_EN 0x2C
15698 +#define GPIOx_READ_BACK 0x30
15699 +#define GPIOx_EVNT_EN 0x38
15700 +#define GPIOx_NEGEDGE_EN 0x44
15701 +#define GPIOx_NEGEDGE_STS 0x4C
15702 +#define GPIO_FLT7_AMNT 0xD8
15703 +#define GPIO_MAP_X 0xE0
15704 +#define GPIO_MAP_Y 0xE4
15705 +#define GPIO_FE7_SEL 0xF7
15706 +
15707 +
15708 +/* Status values */
15709 +
15710 +#define DCONSTAT_SCANINT 0
15711 +#define DCONSTAT_SCANINT_DCON 1
15712 +#define DCONSTAT_DISPLAYLOAD 2
15713 +#define DCONSTAT_MISSED 3
15714 +
15715 +/* Source values */
15716 +
15717 +#define DCON_SOURCE_DCON 0
15718 +#define DCON_SOURCE_CPU 1
15719 +
15720 +/* Output values */
15721 +#define DCON_OUTPUT_COLOR 0
15722 +#define DCON_OUTPUT_MONO 1
15723 +
15724 +/* Sleep values */
15725 +#define DCON_ACTIVE 0
15726 +#define DCON_SLEEP 1
15727 +
15728 +/* Interrupt */
15729 +#define DCON_IRQ 6
15730 +
15731 +#endif
15732 diff --git a/fs/Kconfig b/fs/Kconfig
15733 index f9eed6d..6fa3ea2 100644
15734 --- a/fs/Kconfig
15735 +++ b/fs/Kconfig
15736 @@ -999,6 +999,23 @@ config HUGETLBFS
15737 config HUGETLB_PAGE
15738 def_bool HUGETLBFS
15739
15740 +config PROMFS_FS
15741 + tristate "PromFS IEEE 1275 file system support"
15742 + depends on SPARC || PPC || OLPC
15743 + help
15744 + PromFS is a file system interface to various IEEE-1275 compatible
15745 + firmwares. If you have such a firmware (Sparc64, PowerPC, and
15746 + some other architectures and embedded systems have such firmwares,
15747 + with names like "OpenBoot (tm)" and "OpenFirmware"), say Y here
15748 + to be able to access the firmware's device-tree from Linux.
15749 +
15750 + The firmware device-tree is available as a virtual file system,
15751 + can be mounted under /prom with the command "mount -t promfs
15752 + none /prom".
15753 +
15754 + To compile PromFS support as a module, choose M here; the module
15755 + will be called promfs. If unsure, choose M.
15756 +
15757 config RAMFS
15758 bool
15759 default y
15760 @@ -1225,6 +1242,14 @@ config JFFS2_FS_WRITEBUFFER
15761 - NOR flash with transparent ECC
15762 - DataFlash
15763
15764 +config JFFS2_FS_WBUF_VERIFY
15765 + bool "Verify JFFS2 write-buffer reads"
15766 + depends on JFFS2_FS_WRITEBUFFER
15767 + default n
15768 + help
15769 + This causes JFFS2 to read back every page written through the
15770 + write-buffer, and check for errors.
15771 +
15772 config JFFS2_SUMMARY
15773 bool "JFFS2 summary support (EXPERIMENTAL)"
15774 depends on JFFS2_FS && EXPERIMENTAL
15775 @@ -1295,52 +1320,52 @@ config JFFS2_ZLIB
15776 select ZLIB_DEFLATE
15777 depends on JFFS2_FS
15778 default y
15779 - help
15780 - Zlib is designed to be a free, general-purpose, legally unencumbered,
15781 - lossless data-compression library for use on virtually any computer
15782 - hardware and operating system. See <http://www.gzip.org/zlib/> for
15783 - further information.
15784 + help
15785 + Zlib is designed to be a free, general-purpose, legally unencumbered,
15786 + lossless data-compression library for use on virtually any computer
15787 + hardware and operating system. See <http://www.gzip.org/zlib/> for
15788 + further information.
15789
15790 - Say 'Y' if unsure.
15791 + Say 'Y' if unsure.
15792
15793 config JFFS2_RTIME
15794 bool "JFFS2 RTIME compression support" if JFFS2_COMPRESSION_OPTIONS
15795 depends on JFFS2_FS
15796 default y
15797 - help
15798 - Rtime does manage to recompress already-compressed data. Say 'Y' if unsure.
15799 + help
15800 + Rtime does manage to recompress already-compressed data. Say 'Y' if unsure.
15801
15802 config JFFS2_RUBIN
15803 bool "JFFS2 RUBIN compression support" if JFFS2_COMPRESSION_OPTIONS
15804 depends on JFFS2_FS
15805 default n
15806 - help
15807 - RUBINMIPS and DYNRUBIN compressors. Say 'N' if unsure.
15808 + help
15809 + RUBINMIPS and DYNRUBIN compressors. Say 'N' if unsure.
15810
15811 choice
15812 - prompt "JFFS2 default compression mode" if JFFS2_COMPRESSION_OPTIONS
15813 - default JFFS2_CMODE_PRIORITY
15814 - depends on JFFS2_FS
15815 - help
15816 - You can set here the default compression mode of JFFS2 from
15817 - the available compression modes. Don't touch if unsure.
15818 + prompt "JFFS2 default compression mode" if JFFS2_COMPRESSION_OPTIONS
15819 + default JFFS2_CMODE_PRIORITY
15820 + depends on JFFS2_FS
15821 + help
15822 + You can set here the default compression mode of JFFS2 from
15823 + the available compression modes. Don't touch if unsure.
15824
15825 config JFFS2_CMODE_NONE
15826 - bool "no compression"
15827 - help
15828 - Uses no compression.
15829 + bool "no compression"
15830 + help
15831 + Uses no compression.
15832
15833 config JFFS2_CMODE_PRIORITY
15834 - bool "priority"
15835 - help
15836 - Tries the compressors in a predefined order and chooses the first
15837 - successful one.
15838 + bool "priority"
15839 + help
15840 + Tries the compressors in a predefined order and chooses the first
15841 + successful one.
15842
15843 config JFFS2_CMODE_SIZE
15844 - bool "size (EXPERIMENTAL)"
15845 - help
15846 - Tries all compressors and chooses the one which has the smallest
15847 - result.
15848 + bool "size (EXPERIMENTAL)"
15849 + help
15850 + Tries all compressors and chooses the one which has the smallest
15851 + result.
15852
15853 endchoice
15854
15855 diff --git a/fs/Makefile b/fs/Makefile
15856 index 720c29d..61f1a4d 100644
15857 --- a/fs/Makefile
15858 +++ b/fs/Makefile
15859 @@ -108,6 +108,7 @@ obj-$(CONFIG_ADFS_FS) += adfs/
15860 obj-$(CONFIG_FUSE_FS) += fuse/
15861 obj-$(CONFIG_UDF_FS) += udf/
15862 obj-$(CONFIG_SUN_OPENPROMFS) += openpromfs/
15863 +obj-$(CONFIG_PROMFS_FS) += promfs/
15864 obj-$(CONFIG_JFS_FS) += jfs/
15865 obj-$(CONFIG_XFS_FS) += xfs/
15866 obj-$(CONFIG_9P_FS) += 9p/
15867 diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c
15868 index 504643f..d568ae8 100644
15869 --- a/fs/jffs2/background.c
15870 +++ b/fs/jffs2/background.c
15871 @@ -23,8 +23,8 @@ static int jffs2_garbage_collect_thread(void *);
15872 void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c)
15873 {
15874 spin_lock(&c->erase_completion_lock);
15875 - if (c->gc_task && jffs2_thread_should_wake(c))
15876 - send_sig(SIGHUP, c->gc_task, 1);
15877 + if (c->gc_task && jffs2_thread_should_wake(c))
15878 + send_sig(SIGHUP, c->gc_task, 1);
15879 spin_unlock(&c->erase_completion_lock);
15880 }
15881
15882 diff --git a/fs/jffs2/compr.c b/fs/jffs2/compr.c
15883 index 485d065..d90ca05 100644
15884 --- a/fs/jffs2/compr.c
15885 +++ b/fs/jffs2/compr.c
15886 @@ -5,7 +5,7 @@
15887 * Created by Arjan van de Ven <arjanv@redhat.com>
15888 *
15889 * Copyright © 2004 Ferenc Havasi <havasi@inf.u-szeged.hu>,
15890 - * University of Szeged, Hungary
15891 + * University of Szeged, Hungary
15892 *
15893 * For licensing information, see the file 'LICENCE' in this directory.
15894 *
15895 @@ -43,121 +43,122 @@ static uint32_t none_stat_compr_blocks=0,none_stat_decompr_blocks=0,none_stat_co
15896 * *datalen accordingly to show the amount of data which were compressed.
15897 */
15898 uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
15899 - unsigned char *data_in, unsigned char **cpage_out,
15900 - uint32_t *datalen, uint32_t *cdatalen)
15901 + unsigned char *data_in, unsigned char **cpage_out,
15902 + uint32_t *datalen, uint32_t *cdatalen)
15903 {
15904 int ret = JFFS2_COMPR_NONE;
15905 - int compr_ret;
15906 - struct jffs2_compressor *this, *best=NULL;
15907 - unsigned char *output_buf = NULL, *tmp_buf;
15908 - uint32_t orig_slen, orig_dlen;
15909 - uint32_t best_slen=0, best_dlen=0;
15910 + int compr_ret;
15911 + struct jffs2_compressor *this, *best=NULL;
15912 + unsigned char *output_buf = NULL, *tmp_buf;
15913 + uint32_t orig_slen, orig_dlen;
15914 + uint32_t best_slen=0, best_dlen=0;
15915
15916 - switch (jffs2_compression_mode) {
15917 - case JFFS2_COMPR_MODE_NONE:
15918 - break;
15919 - case JFFS2_COMPR_MODE_PRIORITY:
15920 - output_buf = kmalloc(*cdatalen,GFP_KERNEL);
15921 - if (!output_buf) {
15922 - printk(KERN_WARNING "JFFS2: No memory for compressor allocation. Compression failed.\n");
15923 - goto out;
15924 - }
15925 - orig_slen = *datalen;
15926 - orig_dlen = *cdatalen;
15927 - spin_lock(&jffs2_compressor_list_lock);
15928 - list_for_each_entry(this, &jffs2_compressor_list, list) {
15929 - /* Skip decompress-only backwards-compatibility and disabled modules */
15930 - if ((!this->compress)||(this->disabled))
15931 - continue;
15932 + switch (jffs2_compression_mode) {
15933 + case JFFS2_COMPR_MODE_NONE:
15934 + break;
15935 + case JFFS2_COMPR_MODE_PRIORITY:
15936 + output_buf = kmalloc(*cdatalen,GFP_KERNEL);
15937 + if (!output_buf) {
15938 + printk(KERN_WARNING "JFFS2: No memory for compressor allocation. Compression failed.\n");
15939 + goto out;
15940 + }
15941 + orig_slen = *datalen;
15942 + orig_dlen = *cdatalen;
15943 + spin_lock(&jffs2_compressor_list_lock);
15944 + list_for_each_entry(this, &jffs2_compressor_list, list) {
15945 + /* Skip decompress-only backwards-compatibility and disabled modules */
15946 + if ((!this->compress)||(this->disabled))
15947 + continue;
15948
15949 - this->usecount++;
15950 - spin_unlock(&jffs2_compressor_list_lock);
15951 - *datalen = orig_slen;
15952 - *cdatalen = orig_dlen;
15953 - compr_ret = this->compress(data_in, output_buf, datalen, cdatalen, NULL);
15954 - spin_lock(&jffs2_compressor_list_lock);
15955 - this->usecount--;
15956 - if (!compr_ret) {
15957 - ret = this->compr;
15958 - this->stat_compr_blocks++;
15959 - this->stat_compr_orig_size += *datalen;
15960 - this->stat_compr_new_size += *cdatalen;
15961 - break;
15962 - }
15963 - }
15964 - spin_unlock(&jffs2_compressor_list_lock);
15965 - if (ret == JFFS2_COMPR_NONE) kfree(output_buf);
15966 - break;
15967 - case JFFS2_COMPR_MODE_SIZE:
15968 - orig_slen = *datalen;
15969 - orig_dlen = *cdatalen;
15970 - spin_lock(&jffs2_compressor_list_lock);
15971 - list_for_each_entry(this, &jffs2_compressor_list, list) {
15972 - /* Skip decompress-only backwards-compatibility and disabled modules */
15973 - if ((!this->compress)||(this->disabled))
15974 - continue;
15975 - /* Allocating memory for output buffer if necessary */
15976 - if ((this->compr_buf_size<orig_dlen)&&(this->compr_buf)) {
15977 - spin_unlock(&jffs2_compressor_list_lock);
15978 - kfree(this->compr_buf);
15979 - spin_lock(&jffs2_compressor_list_lock);
15980 - this->compr_buf_size=0;
15981 - this->compr_buf=NULL;
15982 - }
15983 - if (!this->compr_buf) {
15984 - spin_unlock(&jffs2_compressor_list_lock);
15985 - tmp_buf = kmalloc(orig_dlen,GFP_KERNEL);
15986 - spin_lock(&jffs2_compressor_list_lock);
15987 - if (!tmp_buf) {
15988 - printk(KERN_WARNING "JFFS2: No memory for compressor allocation. (%d bytes)\n",orig_dlen);
15989 - continue;
15990 - }
15991 - else {
15992 - this->compr_buf = tmp_buf;
15993 - this->compr_buf_size = orig_dlen;
15994 - }
15995 - }
15996 - this->usecount++;
15997 - spin_unlock(&jffs2_compressor_list_lock);
15998 - *datalen = orig_slen;
15999 - *cdatalen = orig_dlen;
16000 - compr_ret = this->compress(data_in, this->compr_buf, datalen, cdatalen, NULL);
16001 - spin_lock(&jffs2_compressor_list_lock);
16002 - this->usecount--;
16003 - if (!compr_ret) {
16004 - if ((!best_dlen)||(best_dlen>*cdatalen)) {
16005 - best_dlen = *cdatalen;
16006 - best_slen = *datalen;
16007 - best = this;
16008 - }
16009 - }
16010 - }
16011 - if (best_dlen) {
16012 - *cdatalen = best_dlen;
16013 - *datalen = best_slen;
16014 - output_buf = best->compr_buf;
16015 - best->compr_buf = NULL;
16016 - best->compr_buf_size = 0;
16017 - best->stat_compr_blocks++;
16018 - best->stat_compr_orig_size += best_slen;
16019 - best->stat_compr_new_size += best_dlen;
16020 - ret = best->compr;
16021 - }
16022 - spin_unlock(&jffs2_compressor_list_lock);
16023 - break;
16024 - default:
16025 - printk(KERN_ERR "JFFS2: unknow compression mode.\n");
16026 - }
16027 + this->usecount++;
16028 + spin_unlock(&jffs2_compressor_list_lock);
16029 + *datalen = orig_slen;
16030 + *cdatalen = orig_dlen;
16031 + compr_ret = this->compress(data_in, output_buf, datalen, cdatalen, NULL);
16032 + spin_lock(&jffs2_compressor_list_lock);
16033 + this->usecount--;
16034 + if (!compr_ret) {
16035 + ret = this->compr;
16036 + this->stat_compr_blocks++;
16037 + this->stat_compr_orig_size += *datalen;
16038 + this->stat_compr_new_size += *cdatalen;
16039 + break;
16040 + }
16041 + }
16042 + spin_unlock(&jffs2_compressor_list_lock);
16043 + if (ret == JFFS2_COMPR_NONE)
16044 + kfree(output_buf);
16045 + break;
16046 + case JFFS2_COMPR_MODE_SIZE:
16047 + orig_slen = *datalen;
16048 + orig_dlen = *cdatalen;
16049 + spin_lock(&jffs2_compressor_list_lock);
16050 + list_for_each_entry(this, &jffs2_compressor_list, list) {
16051 + /* Skip decompress-only backwards-compatibility and disabled modules */
16052 + if ((!this->compress)||(this->disabled))
16053 + continue;
16054 + /* Allocating memory for output buffer if necessary */
16055 + if ((this->compr_buf_size<orig_dlen)&&(this->compr_buf)) {
16056 + spin_unlock(&jffs2_compressor_list_lock);
16057 + kfree(this->compr_buf);
16058 + spin_lock(&jffs2_compressor_list_lock);
16059 + this->compr_buf_size=0;
16060 + this->compr_buf=NULL;
16061 + }
16062 + if (!this->compr_buf) {
16063 + spin_unlock(&jffs2_compressor_list_lock);
16064 + tmp_buf = kmalloc(orig_dlen,GFP_KERNEL);
16065 + spin_lock(&jffs2_compressor_list_lock);
16066 + if (!tmp_buf) {
16067 + printk(KERN_WARNING "JFFS2: No memory for compressor allocation. (%d bytes)\n",orig_dlen);
16068 + continue;
16069 + }
16070 + else {
16071 + this->compr_buf = tmp_buf;
16072 + this->compr_buf_size = orig_dlen;
16073 + }
16074 + }
16075 + this->usecount++;
16076 + spin_unlock(&jffs2_compressor_list_lock);
16077 + *datalen = orig_slen;
16078 + *cdatalen = orig_dlen;
16079 + compr_ret = this->compress(data_in, this->compr_buf, datalen, cdatalen, NULL);
16080 + spin_lock(&jffs2_compressor_list_lock);
16081 + this->usecount--;
16082 + if (!compr_ret) {
16083 + if ((!best_dlen)||(best_dlen>*cdatalen)) {
16084 + best_dlen = *cdatalen;
16085 + best_slen = *datalen;
16086 + best = this;
16087 + }
16088 + }
16089 + }
16090 + if (best_dlen) {
16091 + *cdatalen = best_dlen;
16092 + *datalen = best_slen;
16093 + output_buf = best->compr_buf;
16094 + best->compr_buf = NULL;
16095 + best->compr_buf_size = 0;
16096 + best->stat_compr_blocks++;
16097 + best->stat_compr_orig_size += best_slen;
16098 + best->stat_compr_new_size += best_dlen;
16099 + ret = best->compr;
16100 + }
16101 + spin_unlock(&jffs2_compressor_list_lock);
16102 + break;
16103 + default:
16104 + printk(KERN_ERR "JFFS2: unknow compression mode.\n");
16105 + }
16106 out:
16107 - if (ret == JFFS2_COMPR_NONE) {
16108 - *cpage_out = data_in;
16109 - *datalen = *cdatalen;
16110 - none_stat_compr_blocks++;
16111 - none_stat_compr_size += *datalen;
16112 - }
16113 - else {
16114 - *cpage_out = output_buf;
16115 - }
16116 + if (ret == JFFS2_COMPR_NONE) {
16117 + *cpage_out = data_in;
16118 + *datalen = *cdatalen;
16119 + none_stat_compr_blocks++;
16120 + none_stat_compr_size += *datalen;
16121 + }
16122 + else {
16123 + *cpage_out = output_buf;
16124 + }
16125 return ret;
16126 }
16127
16128 @@ -165,8 +166,8 @@ int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
16129 uint16_t comprtype, unsigned char *cdata_in,
16130 unsigned char *data_out, uint32_t cdatalen, uint32_t datalen)
16131 {
16132 - struct jffs2_compressor *this;
16133 - int ret;
16134 + struct jffs2_compressor *this;
16135 + int ret;
16136
16137 /* Older code had a bug where it would write non-zero 'usercompr'
16138 fields. Deal with it. */
16139 @@ -177,32 +178,32 @@ int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
16140 case JFFS2_COMPR_NONE:
16141 /* This should be special-cased elsewhere, but we might as well deal with it */
16142 memcpy(data_out, cdata_in, datalen);
16143 - none_stat_decompr_blocks++;
16144 + none_stat_decompr_blocks++;
16145 break;
16146 case JFFS2_COMPR_ZERO:
16147 memset(data_out, 0, datalen);
16148 break;
16149 default:
16150 - spin_lock(&jffs2_compressor_list_lock);
16151 - list_for_each_entry(this, &jffs2_compressor_list, list) {
16152 - if (comprtype == this->compr) {
16153 - this->usecount++;
16154 - spin_unlock(&jffs2_compressor_list_lock);
16155 - ret = this->decompress(cdata_in, data_out, cdatalen, datalen, NULL);
16156 - spin_lock(&jffs2_compressor_list_lock);
16157 - if (ret) {
16158 - printk(KERN_WARNING "Decompressor \"%s\" returned %d\n", this->name, ret);
16159 - }
16160 - else {
16161 - this->stat_decompr_blocks++;
16162 - }
16163 - this->usecount--;
16164 - spin_unlock(&jffs2_compressor_list_lock);
16165 - return ret;
16166 - }
16167 - }
16168 + spin_lock(&jffs2_compressor_list_lock);
16169 + list_for_each_entry(this, &jffs2_compressor_list, list) {
16170 + if (comprtype == this->compr) {
16171 + this->usecount++;
16172 + spin_unlock(&jffs2_compressor_list_lock);
16173 + ret = this->decompress(cdata_in, data_out, cdatalen, datalen, NULL);
16174 + spin_lock(&jffs2_compressor_list_lock);
16175 + if (ret) {
16176 + printk(KERN_WARNING "Decompressor \"%s\" returned %d\n", this->name, ret);
16177 + }
16178 + else {
16179 + this->stat_decompr_blocks++;
16180 + }
16181 + this->usecount--;
16182 + spin_unlock(&jffs2_compressor_list_lock);
16183 + return ret;
16184 + }
16185 + }
16186 printk(KERN_WARNING "JFFS2 compression type 0x%02x not available.\n", comprtype);
16187 - spin_unlock(&jffs2_compressor_list_lock);
16188 + spin_unlock(&jffs2_compressor_list_lock);
16189 return -EIO;
16190 }
16191 return 0;
16192 @@ -210,108 +211,108 @@ int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
16193
16194 int jffs2_register_compressor(struct jffs2_compressor *comp)
16195 {
16196 - struct jffs2_compressor *this;
16197 + struct jffs2_compressor *this;
16198
16199 - if (!comp->name) {
16200 - printk(KERN_WARNING "NULL compressor name at registering JFFS2 compressor. Failed.\n");
16201 - return -1;
16202 - }
16203 - comp->compr_buf_size=0;
16204 - comp->compr_buf=NULL;
16205 - comp->usecount=0;
16206 - comp->stat_compr_orig_size=0;
16207 - comp->stat_compr_new_size=0;
16208 - comp->stat_compr_blocks=0;
16209 - comp->stat_decompr_blocks=0;
16210 - D1(printk(KERN_DEBUG "Registering JFFS2 compressor \"%s\"\n", comp->name));
16211 + if (!comp->name) {
16212 + printk(KERN_WARNING "NULL compressor name at registering JFFS2 compressor. Failed.\n");
16213 + return -1;
16214 + }
16215 + comp->compr_buf_size=0;
16216 + comp->compr_buf=NULL;
16217 + comp->usecount=0;
16218 + comp->stat_compr_orig_size=0;
16219 + comp->stat_compr_new_size=0;
16220 + comp->stat_compr_blocks=0;
16221 + comp->stat_decompr_blocks=0;
16222 + D1(printk(KERN_DEBUG "Registering JFFS2 compressor \"%s\"\n", comp->name));
16223
16224 - spin_lock(&jffs2_compressor_list_lock);
16225 + spin_lock(&jffs2_compressor_list_lock);
16226
16227 - list_for_each_entry(this, &jffs2_compressor_list, list) {
16228 - if (this->priority < comp->priority) {
16229 - list_add(&comp->list, this->list.prev);
16230 - goto out;
16231 - }
16232 - }
16233 - list_add_tail(&comp->list, &jffs2_compressor_list);
16234 + list_for_each_entry(this, &jffs2_compressor_list, list) {
16235 + if (this->priority < comp->priority) {
16236 + list_add(&comp->list, this->list.prev);
16237 + goto out;
16238 + }
16239 + }
16240 + list_add_tail(&comp->list, &jffs2_compressor_list);
16241 out:
16242 - D2(list_for_each_entry(this, &jffs2_compressor_list, list) {
16243 - printk(KERN_DEBUG "Compressor \"%s\", prio %d\n", this->name, this->priority);
16244 - })
16245 + D2(list_for_each_entry(this, &jffs2_compressor_list, list) {
16246 + printk(KERN_DEBUG "Compressor \"%s\", prio %d\n", this->name, this->priority);
16247 + })
16248
16249 - spin_unlock(&jffs2_compressor_list_lock);
16250 + spin_unlock(&jffs2_compressor_list_lock);
16251
16252 - return 0;
16253 + return 0;
16254 }
16255
16256 int jffs2_unregister_compressor(struct jffs2_compressor *comp)
16257 {
16258 - D2(struct jffs2_compressor *this;)
16259 + D2(struct jffs2_compressor *this;)
16260
16261 - D1(printk(KERN_DEBUG "Unregistering JFFS2 compressor \"%s\"\n", comp->name));
16262 + D1(printk(KERN_DEBUG "Unregistering JFFS2 compressor \"%s\"\n", comp->name));
16263
16264 - spin_lock(&jffs2_compressor_list_lock);
16265 + spin_lock(&jffs2_compressor_list_lock);
16266
16267 - if (comp->usecount) {
16268 - spin_unlock(&jffs2_compressor_list_lock);
16269 - printk(KERN_WARNING "JFFS2: Compressor modul is in use. Unregister failed.\n");
16270 - return -1;
16271 - }
16272 - list_del(&comp->list);
16273 + if (comp->usecount) {
16274 + spin_unlock(&jffs2_compressor_list_lock);
16275 + printk(KERN_WARNING "JFFS2: Compressor modul is in use. Unregister failed.\n");
16276 + return -1;
16277 + }
16278 + list_del(&comp->list);
16279
16280 - D2(list_for_each_entry(this, &jffs2_compressor_list, list) {
16281 - printk(KERN_DEBUG "Compressor \"%s\", prio %d\n", this->name, this->priority);
16282 - })
16283 - spin_unlock(&jffs2_compressor_list_lock);
16284 - return 0;
16285 + D2(list_for_each_entry(this, &jffs2_compressor_list, list) {
16286 + printk(KERN_DEBUG "Compressor \"%s\", prio %d\n", this->name, this->priority);
16287 + })
16288 + spin_unlock(&jffs2_compressor_list_lock);
16289 + return 0;
16290 }
16291
16292 void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig)
16293 {
16294 - if (orig != comprbuf)
16295 - kfree(comprbuf);
16296 + if (orig != comprbuf)
16297 + kfree(comprbuf);
16298 }
16299
16300 int __init jffs2_compressors_init(void)
16301 {
16302 /* Registering compressors */
16303 #ifdef CONFIG_JFFS2_ZLIB
16304 - jffs2_zlib_init();
16305 + jffs2_zlib_init();
16306 #endif
16307 #ifdef CONFIG_JFFS2_RTIME
16308 - jffs2_rtime_init();
16309 + jffs2_rtime_init();
16310 #endif
16311 #ifdef CONFIG_JFFS2_RUBIN
16312 - jffs2_rubinmips_init();
16313 - jffs2_dynrubin_init();
16314 + jffs2_rubinmips_init();
16315 + jffs2_dynrubin_init();
16316 #endif
16317 /* Setting default compression mode */
16318 #ifdef CONFIG_JFFS2_CMODE_NONE
16319 - jffs2_compression_mode = JFFS2_COMPR_MODE_NONE;
16320 - D1(printk(KERN_INFO "JFFS2: default compression mode: none\n");)
16321 + jffs2_compression_mode = JFFS2_COMPR_MODE_NONE;
16322 + D1(printk(KERN_INFO "JFFS2: default compression mode: none\n");)
16323 #else
16324 #ifdef CONFIG_JFFS2_CMODE_SIZE
16325 - jffs2_compression_mode = JFFS2_COMPR_MODE_SIZE;
16326 - D1(printk(KERN_INFO "JFFS2: default compression mode: size\n");)
16327 + jffs2_compression_mode = JFFS2_COMPR_MODE_SIZE;
16328 + D1(printk(KERN_INFO "JFFS2: default compression mode: size\n");)
16329 #else
16330 - D1(printk(KERN_INFO "JFFS2: default compression mode: priority\n");)
16331 + D1(printk(KERN_INFO "JFFS2: default compression mode: priority\n");)
16332 #endif
16333 #endif
16334 - return 0;
16335 + return 0;
16336 }
16337
16338 int jffs2_compressors_exit(void)
16339 {
16340 /* Unregistering compressors */
16341 #ifdef CONFIG_JFFS2_RUBIN
16342 - jffs2_dynrubin_exit();
16343 - jffs2_rubinmips_exit();
16344 + jffs2_dynrubin_exit();
16345 + jffs2_rubinmips_exit();
16346 #endif
16347 #ifdef CONFIG_JFFS2_RTIME
16348 - jffs2_rtime_exit();
16349 + jffs2_rtime_exit();
16350 #endif
16351 #ifdef CONFIG_JFFS2_ZLIB
16352 - jffs2_zlib_exit();
16353 + jffs2_zlib_exit();
16354 #endif
16355 - return 0;
16356 + return 0;
16357 }
16358 diff --git a/fs/jffs2/compr.h b/fs/jffs2/compr.h
16359 index 68cc701..1070275 100644
16360 --- a/fs/jffs2/compr.h
16361 +++ b/fs/jffs2/compr.h
16362 @@ -2,7 +2,7 @@
16363 * JFFS2 -- Journalling Flash File System, Version 2.
16364 *
16365 * Copyright © 2004 Ferenc Havasi <havasi@inf.u-szeged.hu>,
16366 - * University of Szeged, Hungary
16367 + * University of Szeged, Hungary
16368 *
16369 * For licensing information, see the file 'LICENCE' in this directory.
16370 *
16371 @@ -32,29 +32,29 @@
16372 #define JFFS2_ZLIB_PRIORITY 60
16373
16374 #define JFFS2_RUBINMIPS_DISABLED /* RUBINs will be used only */
16375 -#define JFFS2_DYNRUBIN_DISABLED /* for decompression */
16376 +#define JFFS2_DYNRUBIN_DISABLED /* for decompression */
16377
16378 #define JFFS2_COMPR_MODE_NONE 0
16379 #define JFFS2_COMPR_MODE_PRIORITY 1
16380 #define JFFS2_COMPR_MODE_SIZE 2
16381
16382 struct jffs2_compressor {
16383 - struct list_head list;
16384 - int priority; /* used by prirority comr. mode */
16385 - char *name;
16386 - char compr; /* JFFS2_COMPR_XXX */
16387 - int (*compress)(unsigned char *data_in, unsigned char *cpage_out,
16388 - uint32_t *srclen, uint32_t *destlen, void *model);
16389 - int (*decompress)(unsigned char *cdata_in, unsigned char *data_out,
16390 - uint32_t cdatalen, uint32_t datalen, void *model);
16391 - int usecount;
16392 - int disabled; /* if seted the compressor won't compress */
16393 - unsigned char *compr_buf; /* used by size compr. mode */
16394 - uint32_t compr_buf_size; /* used by size compr. mode */
16395 - uint32_t stat_compr_orig_size;
16396 - uint32_t stat_compr_new_size;
16397 - uint32_t stat_compr_blocks;
16398 - uint32_t stat_decompr_blocks;
16399 + struct list_head list;
16400 + int priority; /* used by prirority comr. mode */
16401 + char *name;
16402 + char compr; /* JFFS2_COMPR_XXX */
16403 + int (*compress)(unsigned char *data_in, unsigned char *cpage_out,
16404 + uint32_t *srclen, uint32_t *destlen, void *model);
16405 + int (*decompress)(unsigned char *cdata_in, unsigned char *data_out,
16406 + uint32_t cdatalen, uint32_t datalen, void *model);
16407 + int usecount;
16408 + int disabled; /* if set the compressor won't compress */
16409 + unsigned char *compr_buf; /* used by size compr. mode */
16410 + uint32_t compr_buf_size; /* used by size compr. mode */
16411 + uint32_t stat_compr_orig_size;
16412 + uint32_t stat_compr_new_size;
16413 + uint32_t stat_compr_blocks;
16414 + uint32_t stat_decompr_blocks;
16415 };
16416
16417 int jffs2_register_compressor(struct jffs2_compressor *comp);
16418 @@ -64,12 +64,12 @@ int jffs2_compressors_init(void);
16419 int jffs2_compressors_exit(void);
16420
16421 uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
16422 - unsigned char *data_in, unsigned char **cpage_out,
16423 - uint32_t *datalen, uint32_t *cdatalen);
16424 + unsigned char *data_in, unsigned char **cpage_out,
16425 + uint32_t *datalen, uint32_t *cdatalen);
16426
16427 int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
16428 - uint16_t comprtype, unsigned char *cdata_in,
16429 - unsigned char *data_out, uint32_t cdatalen, uint32_t datalen);
16430 + uint16_t comprtype, unsigned char *cdata_in,
16431 + unsigned char *data_out, uint32_t cdatalen, uint32_t datalen);
16432
16433 void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig);
16434
16435 diff --git a/fs/jffs2/compr_rtime.c b/fs/jffs2/compr_rtime.c
16436 index 0d0bfd2..546d153 100644
16437 --- a/fs/jffs2/compr_rtime.c
16438 +++ b/fs/jffs2/compr_rtime.c
16439 @@ -104,7 +104,7 @@ static int jffs2_rtime_decompress(unsigned char *data_in,
16440 }
16441 }
16442 }
16443 - return 0;
16444 + return 0;
16445 }
16446
16447 static struct jffs2_compressor jffs2_rtime_comp = {
16448 diff --git a/fs/jffs2/compr_rubin.c b/fs/jffs2/compr_rubin.c
16449 index ea0431e..c73fa89 100644
16450 --- a/fs/jffs2/compr_rubin.c
16451 +++ b/fs/jffs2/compr_rubin.c
16452 @@ -384,7 +384,7 @@ static int jffs2_rubinmips_decompress(unsigned char *data_in,
16453 void *model)
16454 {
16455 rubin_do_decompress(BIT_DIVIDER_MIPS, bits_mips, data_in, cpage_out, sourcelen, dstlen);
16456 - return 0;
16457 + return 0;
16458 }
16459
16460 static int jffs2_dynrubin_decompress(unsigned char *data_in,
16461 @@ -399,7 +399,7 @@ static int jffs2_dynrubin_decompress(unsigned char *data_in,
16462 bits[c] = data_in[c];
16463
16464 rubin_do_decompress(256, bits, data_in+8, cpage_out, sourcelen-8, dstlen);
16465 - return 0;
16466 + return 0;
16467 }
16468
16469 static struct jffs2_compressor jffs2_rubinmips_comp = {
16470 diff --git a/fs/jffs2/compr_zlib.c b/fs/jffs2/compr_zlib.c
16471 index 2b87fcc..cfd301a 100644
16472 --- a/fs/jffs2/compr_zlib.c
16473 +++ b/fs/jffs2/compr_zlib.c
16474 @@ -181,7 +181,7 @@ static int jffs2_zlib_decompress(unsigned char *data_in,
16475 }
16476 zlib_inflateEnd(&inf_strm);
16477 mutex_unlock(&inflate_mutex);
16478 - return 0;
16479 + return 0;
16480 }
16481
16482 static struct jffs2_compressor jffs2_zlib_comp = {
16483 @@ -203,11 +203,11 @@ int __init jffs2_zlib_init(void)
16484
16485 ret = alloc_workspaces();
16486 if (ret)
16487 - return ret;
16488 + return ret;
16489
16490 ret = jffs2_register_compressor(&jffs2_zlib_comp);
16491 if (ret)
16492 - free_workspaces();
16493 + free_workspaces();
16494
16495 return ret;
16496 }
16497 diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c
16498 index c1dfca3..d293a1f 100644
16499 --- a/fs/jffs2/dir.c
16500 +++ b/fs/jffs2/dir.c
16501 @@ -32,7 +32,7 @@ static int jffs2_mkdir (struct inode *,struct dentry *,int);
16502 static int jffs2_rmdir (struct inode *,struct dentry *);
16503 static int jffs2_mknod (struct inode *,struct dentry *,int,dev_t);
16504 static int jffs2_rename (struct inode *, struct dentry *,
16505 - struct inode *, struct dentry *);
16506 + struct inode *, struct dentry *);
16507
16508 const struct file_operations jffs2_dir_operations =
16509 {
16510 @@ -770,7 +770,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
16511 }
16512
16513 static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
16514 - struct inode *new_dir_i, struct dentry *new_dentry)
16515 + struct inode *new_dir_i, struct dentry *new_dentry)
16516 {
16517 int ret;
16518 struct jffs2_sb_info *c = JFFS2_SB_INFO(old_dir_i->i_sb);
16519 diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
16520 index 66e7c2f..efd83f3 100644
16521 --- a/fs/jffs2/erase.c
16522 +++ b/fs/jffs2/erase.c
16523 @@ -38,8 +38,8 @@ static void jffs2_erase_block(struct jffs2_sb_info *c,
16524 #ifdef __ECOS
16525 ret = jffs2_flash_erase(c, jeb);
16526 if (!ret) {
16527 - jffs2_erase_succeeded(c, jeb);
16528 - return;
16529 + jffs2_erase_succeeded(c, jeb);
16530 + return;
16531 }
16532 bad_offset = jeb->offset;
16533 #else /* Linux */
16534 @@ -50,12 +50,14 @@ static void jffs2_erase_block(struct jffs2_sb_info *c,
16535 instr = kmalloc(sizeof(struct erase_info) + sizeof(struct erase_priv_struct), GFP_KERNEL);
16536 if (!instr) {
16537 printk(KERN_WARNING "kmalloc for struct erase_info in jffs2_erase_block failed. Refiling block for later\n");
16538 + down(&c->erase_free_sem);
16539 spin_lock(&c->erase_completion_lock);
16540 list_move(&jeb->list, &c->erase_pending_list);
16541 c->erasing_size -= c->sector_size;
16542 c->dirty_size += c->sector_size;
16543 jeb->dirty_size = c->sector_size;
16544 spin_unlock(&c->erase_completion_lock);
16545 + up(&c->erase_free_sem);
16546 return;
16547 }
16548
16549 @@ -82,12 +84,14 @@ static void jffs2_erase_block(struct jffs2_sb_info *c,
16550 if (ret == -ENOMEM || ret == -EAGAIN) {
16551 /* Erase failed immediately. Refile it on the list */
16552 D1(printk(KERN_DEBUG "Erase at 0x%08x failed: %d. Refiling on erase_pending_list\n", jeb->offset, ret));
16553 + down(&c->erase_free_sem);
16554 spin_lock(&c->erase_completion_lock);
16555 list_move(&jeb->list, &c->erase_pending_list);
16556 c->erasing_size -= c->sector_size;
16557 c->dirty_size += c->sector_size;
16558 jeb->dirty_size = c->sector_size;
16559 spin_unlock(&c->erase_completion_lock);
16560 + up(&c->erase_free_sem);
16561 return;
16562 }
16563
16564 @@ -114,6 +118,7 @@ void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count)
16565 jeb = list_entry(c->erase_complete_list.next, struct jffs2_eraseblock, list);
16566 list_del(&jeb->list);
16567 spin_unlock(&c->erase_completion_lock);
16568 + up(&c->erase_free_sem);
16569 jffs2_mark_erased_block(c, jeb);
16570
16571 if (!--count) {
16572 @@ -134,6 +139,7 @@ void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count)
16573 jffs2_free_jeb_node_refs(c, jeb);
16574 list_add(&jeb->list, &c->erasing_list);
16575 spin_unlock(&c->erase_completion_lock);
16576 + up(&c->erase_free_sem);
16577
16578 jffs2_erase_block(c, jeb);
16579
16580 @@ -142,23 +148,25 @@ void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count)
16581 }
16582
16583 /* Be nice */
16584 - cond_resched();
16585 + yield();
16586 + down(&c->erase_free_sem);
16587 spin_lock(&c->erase_completion_lock);
16588 }
16589
16590 spin_unlock(&c->erase_completion_lock);
16591 + up(&c->erase_free_sem);
16592 done:
16593 D1(printk(KERN_DEBUG "jffs2_erase_pending_blocks completed\n"));
16594 -
16595 - up(&c->erase_free_sem);
16596 }
16597
16598 static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
16599 {
16600 D1(printk(KERN_DEBUG "Erase completed successfully at 0x%08x\n", jeb->offset));
16601 + down(&c->erase_free_sem);
16602 spin_lock(&c->erase_completion_lock);
16603 list_move_tail(&jeb->list, &c->erase_complete_list);
16604 spin_unlock(&c->erase_completion_lock);
16605 + up(&c->erase_free_sem);
16606 /* Ensure that kupdated calls us again to mark them clean */
16607 jffs2_erase_pending_trigger(c);
16608 }
16609 @@ -172,22 +180,26 @@ static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock
16610 failed too many times. */
16611 if (!jffs2_write_nand_badblock(c, jeb, bad_offset)) {
16612 /* We'd like to give this block another try. */
16613 + down(&c->erase_free_sem);
16614 spin_lock(&c->erase_completion_lock);
16615 list_move(&jeb->list, &c->erase_pending_list);
16616 c->erasing_size -= c->sector_size;
16617 c->dirty_size += c->sector_size;
16618 jeb->dirty_size = c->sector_size;
16619 spin_unlock(&c->erase_completion_lock);
16620 + up(&c->erase_free_sem);
16621 return;
16622 }
16623 }
16624
16625 + down(&c->erase_free_sem);
16626 spin_lock(&c->erase_completion_lock);
16627 c->erasing_size -= c->sector_size;
16628 c->bad_size += c->sector_size;
16629 list_move(&jeb->list, &c->bad_list);
16630 c->nr_erasing_blocks--;
16631 spin_unlock(&c->erase_completion_lock);
16632 + up(&c->erase_free_sem);
16633 wake_up(&c->erase_wait);
16634 }
16635
16636 @@ -317,6 +329,33 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl
16637 size_t retlen;
16638 int ret = -EIO;
16639
16640 + if (c->mtd->point) {
16641 + unsigned long *wordebuf;
16642 +
16643 + ret = c->mtd->point(c->mtd, jeb->offset, c->sector_size, &retlen, (unsigned char **)&ebuf);
16644 + if (ret) {
16645 + D1(printk(KERN_DEBUG "MTD point failed %d\n", ret));
16646 + goto do_flash_read;
16647 + }
16648 + if (retlen < c->sector_size) {
16649 + /* Don't muck about if it won't let us point to the whole erase sector */
16650 + D1(printk(KERN_DEBUG "MTD point returned len too short: 0x%zx\n", retlen));
16651 + c->mtd->unpoint(c->mtd, ebuf, jeb->offset, c->sector_size);
16652 + goto do_flash_read;
16653 + }
16654 + wordebuf = ebuf-sizeof(*wordebuf);
16655 + retlen /= sizeof(*wordebuf);
16656 + do {
16657 + if (*++wordebuf != ~0)
16658 + break;
16659 + } while(--retlen);
16660 + c->mtd->unpoint(c->mtd, ebuf, jeb->offset, c->sector_size);
16661 + if (retlen)
16662 + printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08x\n",
16663 + *wordebuf, jeb->offset + c->sector_size-retlen*sizeof(*wordebuf));
16664 + return 0;
16665 + }
16666 + do_flash_read:
16667 ebuf = kmalloc(PAGE_SIZE, GFP_KERNEL);
16668 if (!ebuf) {
16669 printk(KERN_WARNING "Failed to allocate page buffer for verifying erase at 0x%08x. Refiling\n", jeb->offset);
16670 @@ -417,6 +456,7 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
16671 jffs2_link_node_ref(c, jeb, jeb->offset | REF_NORMAL, c->cleanmarker_size, NULL);
16672 }
16673
16674 + down(&c->erase_free_sem);
16675 spin_lock(&c->erase_completion_lock);
16676 c->erasing_size -= c->sector_size;
16677 c->free_size += jeb->free_size;
16678 @@ -429,23 +469,28 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
16679 c->nr_erasing_blocks--;
16680 c->nr_free_blocks++;
16681 spin_unlock(&c->erase_completion_lock);
16682 + up(&c->erase_free_sem);
16683 wake_up(&c->erase_wait);
16684 return;
16685
16686 filebad:
16687 + down(&c->erase_free_sem);
16688 spin_lock(&c->erase_completion_lock);
16689 /* Stick it on a list (any list) so erase_failed can take it
16690 right off again. Silly, but shouldn't happen often. */
16691 list_add(&jeb->list, &c->erasing_list);
16692 spin_unlock(&c->erase_completion_lock);
16693 + up(&c->erase_free_sem);
16694 jffs2_erase_failed(c, jeb, bad_offset);
16695 return;
16696
16697 refile:
16698 /* Stick it back on the list from whence it came and come back later */
16699 jffs2_erase_pending_trigger(c);
16700 + down(&c->erase_free_sem);
16701 spin_lock(&c->erase_completion_lock);
16702 list_add(&jeb->list, &c->erase_complete_list);
16703 spin_unlock(&c->erase_completion_lock);
16704 + up(&c->erase_free_sem);
16705 return;
16706 }
16707 diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c
16708 index 2d99e06..eded819 100644
16709 --- a/fs/jffs2/gc.c
16710 +++ b/fs/jffs2/gc.c
16711 @@ -556,7 +556,7 @@ static int jffs2_garbage_collect_pristine(struct jffs2_sb_info *c,
16712
16713 node = kmalloc(rawlen, GFP_KERNEL);
16714 if (!node)
16715 - return -ENOMEM;
16716 + return -ENOMEM;
16717
16718 ret = jffs2_flash_read(c, ref_offset(raw), rawlen, &retlen, (char *)node);
16719 if (!ret && retlen != rawlen)
16720 @@ -624,7 +624,7 @@ static int jffs2_garbage_collect_pristine(struct jffs2_sb_info *c,
16721
16722 if (ret || (retlen != rawlen)) {
16723 printk(KERN_NOTICE "Write of %d bytes at 0x%08x failed. returned %d, retlen %zd\n",
16724 - rawlen, phys_ofs, ret, retlen);
16725 + rawlen, phys_ofs, ret, retlen);
16726 if (retlen) {
16727 jffs2_add_physical_node_ref(c, phys_ofs | REF_OBSOLETE, rawlen, NULL);
16728 } else {
16729 diff --git a/fs/jffs2/jffs2_fs_sb.h b/fs/jffs2/jffs2_fs_sb.h
16730 index b13298a..ae99cd7 100644
16731 --- a/fs/jffs2/jffs2_fs_sb.h
16732 +++ b/fs/jffs2/jffs2_fs_sb.h
16733 @@ -106,6 +106,9 @@ struct jffs2_sb_info {
16734
16735 uint32_t wbuf_pagesize; /* 0 for NOR and other flashes with no wbuf */
16736
16737 +#ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
16738 + unsigned char *wbuf_verify; /* read-back buffer for verification */
16739 +#endif
16740 #ifdef CONFIG_JFFS2_FS_WRITEBUFFER
16741 unsigned char *wbuf; /* Write-behind buffer for NAND flash */
16742 uint32_t wbuf_ofs;
16743 diff --git a/fs/jffs2/nodelist.h b/fs/jffs2/nodelist.h
16744 index bc5509f..8b4955a 100644
16745 --- a/fs/jffs2/nodelist.h
16746 +++ b/fs/jffs2/nodelist.h
16747 @@ -127,7 +127,7 @@ static inline struct jffs2_inode_cache *jffs2_raw_ref_to_ic(struct jffs2_raw_nod
16748 return ((struct jffs2_inode_cache *)raw);
16749 }
16750
16751 - /* flash_offset & 3 always has to be zero, because nodes are
16752 + /* flash_offset & 3 always has to be zero, because nodes are
16753 always aligned at 4 bytes. So we have a couple of extra bits
16754 to play with, which indicate the node's status; see below: */
16755 #define REF_UNCHECKED 0 /* We haven't yet checked the CRC or built its inode */
16756 @@ -197,7 +197,7 @@ struct jffs2_inode_cache {
16757 #define RAWNODE_CLASS_XATTR_DATUM 1
16758 #define RAWNODE_CLASS_XATTR_REF 2
16759
16760 -#define INOCACHE_HASHSIZE 128
16761 +#define INOCACHE_HASHSIZE 1024
16762
16763 #define write_ofs(c) ((c)->nextblock->offset + (c)->sector_size - (c)->nextblock->free_size)
16764
16765 diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c
16766 index dbc908a..5b49bff 100644
16767 --- a/fs/jffs2/nodemgmt.c
16768 +++ b/fs/jffs2/nodemgmt.c
16769 @@ -154,7 +154,7 @@ int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize,
16770 while(ret == -EAGAIN) {
16771 ret = jffs2_do_reserve_space(c, minsize, len, sumsize);
16772 if (ret) {
16773 - D1(printk(KERN_DEBUG "jffs2_reserve_space_gc: looping, ret is %d\n", ret));
16774 + D1(printk(KERN_DEBUG "jffs2_reserve_space_gc: looping, ret is %d\n", ret));
16775 }
16776 }
16777 spin_unlock(&c->erase_completion_lock);
16778 @@ -423,7 +423,12 @@ struct jffs2_raw_node_ref *jffs2_add_physical_node_ref(struct jffs2_sb_info *c,
16779 even after refiling c->nextblock */
16780 if ((c->nextblock || ((ofs & 3) != REF_OBSOLETE))
16781 && (jeb != c->nextblock || (ofs & ~3) != jeb->offset + (c->sector_size - jeb->free_size))) {
16782 - printk(KERN_WARNING "argh. node added in wrong place\n");
16783 + printk(KERN_WARNING "argh. node added in wrong place at 0x%08x(%d)\n", ofs & ~3, ofs & 3);
16784 + if (c->nextblock)
16785 + printk(KERN_WARNING "nextblock 0x%08x", c->nextblock->offset);
16786 + else
16787 + printk(KERN_WARNING "No nextblock");
16788 + printk(", expected at %08x\n", jeb->offset + (c->sector_size - jeb->free_size));
16789 return ERR_PTR(-EINVAL);
16790 }
16791 #endif
16792 diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
16793 index b5baa35..8d4319c 100644
16794 --- a/fs/jffs2/readinode.c
16795 +++ b/fs/jffs2/readinode.c
16796 @@ -211,7 +211,7 @@ static void jffs2_kill_tn(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info *
16797 * ordering.
16798 *
16799 * Returns 0 if the node was handled (including marking it obsolete)
16800 - * < 0 an if error occurred
16801 + * < 0 an if error occurred
16802 */
16803 static int jffs2_add_tn_to_tree(struct jffs2_sb_info *c,
16804 struct jffs2_readinode_info *rii,
16805 @@ -862,8 +862,8 @@ static inline int read_unknown(struct jffs2_sb_info *c, struct jffs2_raw_node_re
16806 JFFS2_ERROR("REF_UNCHECKED but unknown node at %#08x\n",
16807 ref_offset(ref));
16808 JFFS2_ERROR("Node is {%04x,%04x,%08x,%08x}. Please report this error.\n",
16809 - je16_to_cpu(un->magic), je16_to_cpu(un->nodetype),
16810 - je32_to_cpu(un->totlen), je32_to_cpu(un->hdr_crc));
16811 + je16_to_cpu(un->magic), je16_to_cpu(un->nodetype),
16812 + je32_to_cpu(un->totlen), je32_to_cpu(un->hdr_crc));
16813 jffs2_mark_node_obsolete(c, ref);
16814 return 0;
16815 }
16816 diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
16817 index 6c75cd4..59dd408 100644
16818 --- a/fs/jffs2/scan.c
16819 +++ b/fs/jffs2/scan.c
16820 @@ -863,7 +863,7 @@ scan_more:
16821 switch (je16_to_cpu(node->nodetype) & JFFS2_COMPAT_MASK) {
16822 case JFFS2_FEATURE_ROCOMPAT:
16823 printk(KERN_NOTICE "Read-only compatible feature node (0x%04x) found at offset 0x%08x\n", je16_to_cpu(node->nodetype), ofs);
16824 - c->flags |= JFFS2_SB_FLAG_RO;
16825 + c->flags |= JFFS2_SB_FLAG_RO;
16826 if (!(jffs2_is_readonly(c)))
16827 return -EROFS;
16828 if ((err = jffs2_scan_dirty_space(c, jeb, PAD(je32_to_cpu(node->totlen)))))
16829 diff --git a/fs/jffs2/security.c b/fs/jffs2/security.c
16830 index bc9f6ba..02c39c6 100644
16831 --- a/fs/jffs2/security.c
16832 +++ b/fs/jffs2/security.c
16833 @@ -38,9 +38,9 @@ int jffs2_init_security(struct inode *inode, struct inode *dir)
16834 }
16835 rc = do_jffs2_setxattr(inode, JFFS2_XPREFIX_SECURITY, name, value, len, 0);
16836
16837 - kfree(name);
16838 - kfree(value);
16839 - return rc;
16840 + kfree(name);
16841 + kfree(value);
16842 + return rc;
16843 }
16844
16845 /* ---- XATTR Handler for "security.*" ----------------- */
16846 diff --git a/fs/jffs2/summary.c b/fs/jffs2/summary.c
16847 index d828b29..2a77d3f 100644
16848 --- a/fs/jffs2/summary.c
16849 +++ b/fs/jffs2/summary.c
16850 @@ -2,10 +2,10 @@
16851 * JFFS2 -- Journalling Flash File System, Version 2.
16852 *
16853 * Copyright © 2004 Ferenc Havasi <havasi@inf.u-szeged.hu>,
16854 - * Zoltan Sogor <weth@inf.u-szeged.hu>,
16855 - * Patrik Kluba <pajko@halom.u-szeged.hu>,
16856 - * University of Szeged, Hungary
16857 - * 2006 KaiGai Kohei <kaigai@ak.jp.nec.com>
16858 + * Zoltan Sogor <weth@inf.u-szeged.hu>,
16859 + * Patrik Kluba <pajko@halom.u-szeged.hu>,
16860 + * University of Szeged, Hungary
16861 + * 2006 KaiGai Kohei <kaigai@ak.jp.nec.com>
16862 *
16863 * For licensing information, see the file 'LICENCE' in this directory.
16864 *
16865 diff --git a/fs/jffs2/summary.h b/fs/jffs2/summary.h
16866 index 0c6669e..8bf34f2 100644
16867 --- a/fs/jffs2/summary.h
16868 +++ b/fs/jffs2/summary.h
16869 @@ -2,9 +2,9 @@
16870 * JFFS2 -- Journalling Flash File System, Version 2.
16871 *
16872 * Copyright © 2004 Ferenc Havasi <havasi@inf.u-szeged.hu>,
16873 - * Zoltan Sogor <weth@inf.u-szeged.hu>,
16874 - * Patrik Kluba <pajko@halom.u-szeged.hu>,
16875 - * University of Szeged, Hungary
16876 + * Zoltan Sogor <weth@inf.u-szeged.hu>,
16877 + * Patrik Kluba <pajko@halom.u-szeged.hu>,
16878 + * University of Szeged, Hungary
16879 *
16880 * For licensing information, see the file 'LICENCE' in this directory.
16881 *
16882 diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
16883 index 91d1d0f..d1d4f27 100644
16884 --- a/fs/jffs2/wbuf.c
16885 +++ b/fs/jffs2/wbuf.c
16886 @@ -220,6 +220,47 @@ static struct jffs2_raw_node_ref **jffs2_incore_replace_raw(struct jffs2_sb_info
16887 return NULL;
16888 }
16889
16890 +#ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
16891 +static int jffs2_verify_write(struct jffs2_sb_info *c, unsigned char *buf,
16892 + uint32_t ofs)
16893 +{
16894 + int ret;
16895 + size_t retlen;
16896 + char *eccstr;
16897 +
16898 + ret = c->mtd->read(c->mtd, ofs, c->wbuf_pagesize, &retlen, c->wbuf_verify);
16899 + if (ret && ret != -EUCLEAN && ret != -EBADMSG) {
16900 + printk(KERN_WARNING "jffs2_verify_write(): Read back of page at %08x failed: %d\n", c->wbuf_ofs, ret);
16901 + return ret;
16902 + } else if (retlen != c->wbuf_pagesize) {
16903 + printk(KERN_WARNING "jffs2_verify_write(): Read back of page at %08x gave short read: %zd not %d.\n", ofs, retlen, c->wbuf_pagesize);
16904 + return -EIO;
16905 + }
16906 + if (!memcmp(buf, c->wbuf_verify, c->wbuf_pagesize))
16907 + return 0;
16908 +
16909 + if (ret == -EUCLEAN)
16910 + eccstr = "corrected";
16911 + else if (ret == -EBADMSG)
16912 + eccstr = "correction failed";
16913 + else
16914 + eccstr = "OK or unused";
16915 +
16916 + printk(KERN_WARNING "Write verify error (ECC %s) at %08x. Wrote:\n",
16917 + eccstr, c->wbuf_ofs);
16918 + print_hex_dump(KERN_WARNING, "", DUMP_PREFIX_OFFSET, 16, 1,
16919 + c->wbuf, c->wbuf_pagesize, 0);
16920 +
16921 + printk(KERN_WARNING "Read back:\n");
16922 + print_hex_dump(KERN_WARNING, "", DUMP_PREFIX_OFFSET, 16, 1,
16923 + c->wbuf_verify, c->wbuf_pagesize, 0);
16924 +
16925 + return -EIO;
16926 +}
16927 +#else
16928 +#define jffs2_verify_write(c,b,o) (0)
16929 +#endif
16930 +
16931 /* Recover from failure to write wbuf. Recover the nodes up to the
16932 * wbuf, not the one which we were starting to try to write. */
16933
16934 @@ -380,7 +421,7 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c)
16935 ret = c->mtd->write(c->mtd, ofs, towrite, &retlen,
16936 rewrite_buf);
16937
16938 - if (ret || retlen != towrite) {
16939 + if (ret || retlen != towrite || jffs2_verify_write(c, rewrite_buf, ofs)) {
16940 /* Argh. We tried. Really we did. */
16941 printk(KERN_CRIT "Recovery of wbuf failed due to a second write error\n");
16942 kfree(buf);
16943 @@ -587,15 +628,16 @@ static int __jffs2_flush_wbuf(struct jffs2_sb_info *c, int pad)
16944
16945 ret = c->mtd->write(c->mtd, c->wbuf_ofs, c->wbuf_pagesize, &retlen, c->wbuf);
16946
16947 - if (ret || retlen != c->wbuf_pagesize) {
16948 - if (ret)
16949 - printk(KERN_WARNING "jffs2_flush_wbuf(): Write failed with %d\n",ret);
16950 - else {
16951 - printk(KERN_WARNING "jffs2_flush_wbuf(): Write was short: %zd instead of %d\n",
16952 - retlen, c->wbuf_pagesize);
16953 - ret = -EIO;
16954 - }
16955 -
16956 + if (ret) {
16957 + printk(KERN_WARNING "jffs2_flush_wbuf(): Write failed with %d\n", ret);
16958 + goto wfail;
16959 + } else if (retlen != c->wbuf_pagesize) {
16960 + printk(KERN_WARNING "jffs2_flush_wbuf(): Write was short: %zd instead of %d\n",
16961 + retlen, c->wbuf_pagesize);
16962 + ret = -EIO;
16963 + goto wfail;
16964 + } else if ((ret = jffs2_verify_write(c, c->wbuf, c->wbuf_ofs))) {
16965 + wfail:
16966 jffs2_wbuf_recover(c);
16967
16968 return ret;
16969 @@ -966,8 +1008,8 @@ exit:
16970
16971 #define NR_OOB_SCAN_PAGES 4
16972
16973 -/* For historical reasons we use only 12 bytes for OOB clean marker */
16974 -#define OOB_CM_SIZE 12
16975 +/* For historical reasons we use only 8 bytes for OOB clean marker */
16976 +#define OOB_CM_SIZE 8
16977
16978 static const struct jffs2_unknown_node oob_cleanmarker =
16979 {
16980 @@ -1021,8 +1063,8 @@ int jffs2_check_oob_empty(struct jffs2_sb_info *c,
16981 /*
16982 * Check for a valid cleanmarker.
16983 * Returns: 0 if a valid cleanmarker was found
16984 - * 1 if no cleanmarker was found
16985 - * negative error code if an error occurred
16986 + * 1 if no cleanmarker was found
16987 + * negative error code if an error occurred
16988 */
16989 int jffs2_check_nand_cleanmarker(struct jffs2_sb_info *c,
16990 struct jffs2_eraseblock *jeb)
16991 @@ -1138,11 +1180,22 @@ int jffs2_nand_flash_setup(struct jffs2_sb_info *c)
16992 return -ENOMEM;
16993 }
16994
16995 +#ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
16996 + c->wbuf_verify = kmalloc(c->wbuf_pagesize, GFP_KERNEL);
16997 + if (!c->wbuf_verify) {
16998 + kfree(c->oobbuf);
16999 + kfree(c->wbuf);
17000 + return -ENOMEM;
17001 + }
17002 +#endif
17003 return 0;
17004 }
17005
17006 void jffs2_nand_flash_cleanup(struct jffs2_sb_info *c)
17007 {
17008 +#ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
17009 + kfree(c->wbuf_verify);
17010 +#endif
17011 kfree(c->wbuf);
17012 kfree(c->oobbuf);
17013 }
17014 diff --git a/fs/jffs2/xattr.h b/fs/jffs2/xattr.h
17015 index 3b0ff29..6e3b5dd 100644
17016 --- a/fs/jffs2/xattr.h
17017 +++ b/fs/jffs2/xattr.h
17018 @@ -75,7 +75,7 @@ extern void jffs2_build_xattr_subsystem(struct jffs2_sb_info *c);
17019 extern void jffs2_clear_xattr_subsystem(struct jffs2_sb_info *c);
17020
17021 extern struct jffs2_xattr_datum *jffs2_setup_xattr_datum(struct jffs2_sb_info *c,
17022 - uint32_t xid, uint32_t version);
17023 + uint32_t xid, uint32_t version);
17024
17025 extern void jffs2_xattr_delete_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic);
17026 extern void jffs2_xattr_free_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic);
17027 diff --git a/fs/jffs2/xattr_user.c b/fs/jffs2/xattr_user.c
17028 index 40942bc..8bbeab9 100644
17029 --- a/fs/jffs2/xattr_user.c
17030 +++ b/fs/jffs2/xattr_user.c
17031 @@ -17,7 +17,7 @@
17032 #include "nodelist.h"
17033
17034 static int jffs2_user_getxattr(struct inode *inode, const char *name,
17035 - void *buffer, size_t size)
17036 + void *buffer, size_t size)
17037 {
17038 if (!strcmp(name, ""))
17039 return -EINVAL;
17040 @@ -25,7 +25,7 @@ static int jffs2_user_getxattr(struct inode *inode, const char *name,
17041 }
17042
17043 static int jffs2_user_setxattr(struct inode *inode, const char *name, const void *buffer,
17044 - size_t size, int flags)
17045 + size_t size, int flags)
17046 {
17047 if (!strcmp(name, ""))
17048 return -EINVAL;
17049 diff --git a/fs/promfs/Makefile b/fs/promfs/Makefile
17050 new file mode 100644
17051 index 0000000..940a51b
17052 --- /dev/null
17053 +++ b/fs/promfs/Makefile
17054 @@ -0,0 +1 @@
17055 +obj-$(CONFIG_PROMFS_FS) += promfs.o
17056 diff --git a/fs/promfs/promfs.c b/fs/promfs/promfs.c
17057 new file mode 100644
17058 index 0000000..9fb2bfa
17059 --- /dev/null
17060 +++ b/fs/promfs/promfs.c
17061 @@ -0,0 +1,295 @@
17062 +/*
17063 + * promfs.c - generic inode/dentry functions for IEEE 1275-based filesystems.
17064 + *
17065 + * This is based heavily upon prior ieee1275 and other virtual filesystems
17066 + * implementations; openpromfs, proc_devtree.c, oprofilefs, procfs, ...
17067 + *
17068 + * Copyright (C) 2007 Andres Salomon <dilinger@debian.org>
17069 + *
17070 + * This program is free software; you can redistribute it and/or modify
17071 + * it under the terms of the GNU General Public License as published by
17072 + * the Free Software Foundation; either version 2 of the License, or
17073 + * (at your option) any later version.
17074 + *
17075 + * This program is distributed in the hope that it will be useful,
17076 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
17077 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17078 + * GNU General Public License for more details.
17079 + *
17080 + * You should have received a copy of the GNU General Public License along
17081 + * with this program; if not, write to the Free Software Foundation, Inc.,
17082 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17083 + */
17084 +
17085 +#include <linux/init.h>
17086 +#include <linux/module.h>
17087 +#include <linux/pagemap.h>
17088 +#include <linux/fs.h>
17089 +//#include <linux/promfs.h>
17090 +#include <asm/prom.h>
17091 +
17092 +#define PROMFS_MAGIC 0x1f2f3fff
17093 +
17094 +MODULE_LICENSE("GPL");
17095 +MODULE_AUTHOR("Andres Salomon");
17096 +
17097 +struct promfs_inode
17098 +{
17099 + struct inode ino;
17100 + struct property *prop;
17101 +};
17102 +
17103 +static inline struct promfs_inode *to_promfs_inode(struct inode *inode)
17104 +{
17105 + return container_of(inode, struct promfs_inode, ino);
17106 +}
17107 +
17108 +#if 0
17109 +static DEFINE_SPINLOCK(promfs_lock);
17110 +
17111 +static struct of_node *of_tree = NULL;
17112 +static DEFINE_RWLOCK(of_tree_lock);
17113 +
17114 +void __init of_build_tree(void)
17115 +{
17116 +
17117 +
17118 +}
17119 +#endif
17120 +
17121 +static int promfs_open_file(struct inode *inode, struct file *file)
17122 +{
17123 + struct promfs_inode *ino;
17124 +
17125 + ino = to_promfs_inode(inode);
17126 + if (!ino->prop)
17127 + return -EIO;
17128 + file->private_data = ino->prop;
17129 +
17130 + return 0;
17131 +}
17132 +
17133 +static ssize_t promfs_read_file(struct file *file, char __user *data,
17134 + size_t len, loff_t *ppos)
17135 +{
17136 + struct property *prop = (struct property *) file->private_data;
17137 + return simple_read_from_buffer(data, len, ppos, prop->value,
17138 + prop->length);
17139 +}
17140 +
17141 +static ssize_t promfs_write_file(struct file *file, char const __user *buf,
17142 + size_t count, loff_t * offset)
17143 +{
17144 + /* TODO.... 'cause, y'know, it would be nice. */
17145 + return -EIO;
17146 +}
17147 +
17148 +static struct file_operations promfs_file_ops = {
17149 + .open = promfs_open_file,
17150 + .read = promfs_read_file,
17151 + .write = promfs_write_file,
17152 +};
17153 +
17154 +static struct kmem_cache *promfs_inode_cachep;
17155 +
17156 +static struct inode *promfs_alloc_inode(struct super_block *sb)
17157 +{
17158 + struct promfs_inode *pr_ino;
17159 +
17160 + pr_ino = kmem_cache_alloc(promfs_inode_cachep, GFP_KERNEL);
17161 + if (!pr_ino)
17162 + return NULL;
17163 + pr_ino->prop = NULL;
17164 +
17165 + return &pr_ino->ino;
17166 +}
17167 +
17168 +static void promfs_destroy_inode(struct inode *inode)
17169 +{
17170 + kmem_cache_free(promfs_inode_cachep, to_promfs_inode(inode));
17171 +}
17172 +
17173 +static void promfs_read_inode(struct inode *inode)
17174 +{
17175 + inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
17176 +}
17177 +
17178 +static int promfs_remount(struct super_block *sb, int *flags, char *data)
17179 +{
17180 + *flags |= MS_NOATIME;
17181 + return 0;
17182 +}
17183 +
17184 +static struct super_operations promfs_s_ops = {
17185 + .alloc_inode = promfs_alloc_inode,
17186 + .destroy_inode = promfs_destroy_inode,
17187 + .read_inode = promfs_read_inode,
17188 + .statfs = simple_statfs,
17189 + .drop_inode = generic_delete_inode,
17190 + .remount_fs = promfs_remount,
17191 +};
17192 +
17193 +static struct inode *promfs_get_inode(struct super_block *sb, int mode)
17194 +{
17195 + struct inode *inode = new_inode(sb);
17196 +
17197 + if (inode) {
17198 + inode->i_mode = mode;
17199 + inode->i_uid = 0;
17200 + inode->i_gid = 0;
17201 + inode->i_blocks = 0;
17202 + inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
17203 + }
17204 +
17205 + return inode;
17206 +}
17207 +
17208 +static int promfs_create_file(struct super_block *sb, struct dentry *root,
17209 + struct property *prop, const struct file_operations *fops)
17210 +{
17211 + struct dentry *dentry;
17212 + struct inode *inode;
17213 + struct promfs_inode *ino;
17214 +
17215 + dentry = d_alloc_name(root, prop->name);
17216 + if (!dentry)
17217 + goto err;
17218 +
17219 + inode = promfs_get_inode(sb, S_IFREG | 0644);
17220 + if (!inode)
17221 + goto err_dput;
17222 + inode->i_fop = fops;
17223 + ino = to_promfs_inode(inode);
17224 + ino->prop = prop;
17225 + d_add(dentry, inode);
17226 +
17227 + return 0;
17228 +
17229 +err_dput:
17230 + dput(dentry);
17231 +err:
17232 + return -EFAULT;
17233 +}
17234 +
17235 +struct dentry *promfs_create_dir(struct super_block *sb, struct dentry *root,
17236 + char const *name)
17237 +{
17238 + struct dentry *dentry;
17239 + struct inode *inode;
17240 +
17241 + dentry = d_alloc_name(root, name);
17242 + if (!dentry)
17243 + goto err;
17244 +
17245 + inode = promfs_get_inode(sb, S_IFDIR | 0755);
17246 + if (!inode)
17247 + goto err_dput;
17248 + inode->i_op = &simple_dir_inode_operations;
17249 + inode->i_fop = &simple_dir_operations;
17250 + d_add(dentry, inode);
17251 + return dentry;
17252 +
17253 +err_dput:
17254 + dput(dentry);
17255 +err:
17256 + return NULL;
17257 +}
17258 +
17259 +void promfs_populate(struct super_block *sb, struct dentry *root,
17260 + struct device_node *node)
17261 +{
17262 + struct dentry *dentry;
17263 + struct device_node *child;
17264 + struct property *prop;
17265 +
17266 + if (!node)
17267 + return;
17268 +
17269 + for (child = node->child; child; child = child->sibling) {
17270 + dentry = promfs_create_dir(sb, root, child->path_component_name);
17271 + promfs_populate(sb, dentry, child);
17272 + }
17273 + for (prop = node->properties; prop; prop = prop->next)
17274 + promfs_create_file(sb, root, prop, &promfs_file_ops);
17275 +}
17276 +
17277 +static int promfs_fill_super(struct super_block *sb, void *data, int silent)
17278 +{
17279 + struct inode *root_inode;
17280 + struct dentry *root_dentry;
17281 + struct promfs_inode *inode;
17282 +
17283 + sb->s_blocksize = PAGE_CACHE_SIZE;
17284 + sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
17285 + sb->s_magic = PROMFS_MAGIC;
17286 + sb->s_op = &promfs_s_ops;
17287 + sb->s_time_gran = 1;
17288 + sb->s_flags |= MS_NOATIME;
17289 +
17290 + root_inode = promfs_get_inode(sb, S_IFDIR | 0755);
17291 + if (!root_inode)
17292 + goto err;
17293 + root_inode->i_op = &simple_dir_inode_operations;
17294 + root_inode->i_fop = &simple_dir_operations;
17295 +
17296 + inode = to_promfs_inode(root_inode);
17297 +
17298 + root_dentry = d_alloc_root(root_inode);
17299 + if (!root_dentry)
17300 + goto err_iput;
17301 + sb->s_root = root_dentry;
17302 +
17303 + promfs_populate(sb, root_dentry, of_find_node_by_path("/"));
17304 + return 0;
17305 +
17306 +err_iput:
17307 + iput(root_inode);
17308 +err:
17309 + return -ENOMEM;
17310 +}
17311 +
17312 +static int promfs_get_sb(struct file_system_type *fs_type, int flags,
17313 + const char *dev_name, void *data, struct vfsmount *mnt)
17314 +{
17315 + return get_sb_single(fs_type, flags, data, promfs_fill_super, mnt);
17316 +}
17317 +
17318 +static struct file_system_type promfs_fs_type = {
17319 + .owner = THIS_MODULE,
17320 + .name = "promfs",
17321 + .get_sb = promfs_get_sb,
17322 + .kill_sb = kill_litter_super,
17323 +};
17324 +
17325 +static void init_once(void *i, struct kmem_cache *cachep, unsigned long fl)
17326 +{
17327 + struct promfs_inode *inode = (struct promfs_inode *) i;
17328 + inode_init_once(&inode->ino);
17329 +}
17330 +
17331 +static int __init init_promfs(void)
17332 +{
17333 + int err;
17334 +
17335 + prom_build_devicetree();
17336 + promfs_inode_cachep = kmem_cache_create("promfs_inode_cache",
17337 + sizeof(struct promfs_inode), 0,
17338 + SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, init_once, NULL);
17339 + if (!promfs_inode_cachep)
17340 + return -ENOMEM;
17341 +
17342 + err = register_filesystem(&promfs_fs_type);
17343 + if (err)
17344 + kmem_cache_destroy(promfs_inode_cachep);
17345 +
17346 + return err;
17347 +}
17348 +
17349 +static void __exit exit_promfs(void)
17350 +{
17351 + unregister_filesystem(&promfs_fs_type);
17352 + kmem_cache_destroy(promfs_inode_cachep);
17353 +}
17354 +
17355 +module_init(init_promfs);
17356 +module_exit(exit_promfs);
17357 diff --git a/include/asm-i386/geode.h b/include/asm-i386/geode.h
17358 index 6da4bbb..f18ebe2 100644
17359 --- a/include/asm-i386/geode.h
17360 +++ b/include/asm-i386/geode.h
17361 @@ -135,6 +135,55 @@ static inline void geode_gpio_event_pme(unsigned int gpio, int pair)
17362 geode_gpio_setup_event(gpio, pair, 1);
17363 }
17364
17365 +/* MFGPT */
17366 +
17367 +#define MFGPT_TIMER_ANY -1
17368 +
17369 +#define MFGPT_DOMAIN_WORKING 1
17370 +#define MFGPT_DOMAIN_STANDBY 2
17371 +#define MFGPT_DOMAIN_ANY (MFGPT_DOMAIN_WORKING | MFGPT_DOMAIN_STANDBY)
17372 +
17373 +#define MFGPT_CMP1 0
17374 +#define MFGPT_CMP2 1
17375 +
17376 +#define MFGPT_EVENT_IRQ 0
17377 +#define MFGPT_EVENT_NMI 1
17378 +#define MFGPT_EVENT_RESET 3
17379 +
17380 +#define MFGPT_REG_CMP1 0
17381 +#define MFGPT_REG_CMP2 2
17382 +#define MFGPT_REG_COUNTER 4
17383 +#define MFGPT_REG_SETUP 6
17384 +
17385 +#define MFGPT_SETUP_CNTEN (1 << 15)
17386 +#define MFGPT_SETUP_CMP2 (1 << 14)
17387 +#define MFGPT_SETUP_CMP1 (1 << 13)
17388 +#define MFGPT_SETUP_SETUP (1 << 12)
17389 +#define MFGPT_SETUP_STOPEN (1 << 11)
17390 +#define MFGPT_SETUP_EXTEN (1 << 10)
17391 +#define MFGPT_SETUP_REVEN (1 << 5)
17392 +#define MFGPT_SETUP_CLKSEL (1 << 4)
17393 +
17394 +static inline void geode_mfgpt_write(int timer, u16 reg, u16 value)
17395 +{
17396 + u32 base = geode_get_dev_base(GEODE_DEV_MFGPT);
17397 + outw(value, base + reg + (timer * 8));
17398 +}
17399 +
17400 +static inline u16 geode_mfgpt_read(int timer, u16 reg)
17401 +{
17402 + u32 base = geode_get_dev_base(GEODE_DEV_MFGPT);
17403 + return inw(base + reg + (timer * 8));
17404 +}
17405 +
17406 +extern int __init geode_mfgpt_detect(void);
17407 +extern int geode_mfgpt_toggle_event(int timer, int cmp, int event, int enable);
17408 +extern int geode_mfgpt_set_irq(int timer, int cmp, int irq, int enable);
17409 +extern int geode_mfgpt_alloc_timer(int timer, int domain, struct module *owner);
17410 +
17411 +#define geode_mfgpt_setup_irq(t,c,i) geode_mfgpt_set_irq((t),(c),(i),1)
17412 +#define geode_mfgpt_release_irq(t,c,i) geode_mfgpt_set_irq((t),(c),(i),0)
17413 +
17414 /* Specific geode tests */
17415
17416 static inline int is_geode_gx(void)
17417 diff --git a/include/asm-i386/ofw.h b/include/asm-i386/ofw.h
17418 new file mode 100644
17419 index 0000000..79b08b1
17420 --- /dev/null
17421 +++ b/include/asm-i386/ofw.h
17422 @@ -0,0 +1,16 @@
17423 +/*
17424 + * Definitions for Open Firmware client interface on 32-bit system.
17425 + * OF Cell size is 4. Integer properties are encoded big endian,
17426 + * as with all OF implementations.
17427 + *
17428 + * This program is free software; you can redistribute it and/or
17429 + * modify it under the terms of the GNU General Public License
17430 + * as published by the Free Software Foundation; either version
17431 + * 2 of the License, or (at your option) any later version.
17432 + */
17433 +#ifndef _OFW_H
17434 +#define _OFW_H
17435 +
17436 +extern int ofw(char *, int, int, ...);
17437 +
17438 +#endif
17439 diff --git a/include/asm-i386/olpc.h b/include/asm-i386/olpc.h
17440 new file mode 100644
17441 index 0000000..26bc1a8
17442 --- /dev/null
17443 +++ b/include/asm-i386/olpc.h
17444 @@ -0,0 +1,116 @@
17445 +/* OLPC machine specific definitions */
17446 +
17447 +#ifndef ASM_OLPC_H_
17448 +#define ASM_OLPC_H_
17449 +
17450 +#include <asm/geode.h>
17451 +
17452 +struct olpc_platform_t {
17453 + int flags;
17454 + int boardrev;
17455 + int ecver;
17456 +};
17457 +
17458 +#define OLPC_F_PRESENT 0x01
17459 +#define OLPC_F_DCON 0x02
17460 +#define OLPC_F_VSA 0x04
17461 +
17462 +enum
17463 +{
17464 + OLPC_REV_A = 0,
17465 +
17466 + OLPC_REV_PRE_B1,
17467 + OLPC_REV_B1,
17468 + OLPC_REV_PRE_B2,
17469 + OLPC_REV_B2,
17470 + OLPC_REV_PRE_B3,
17471 + OLPC_REV_B3,
17472 + OLPC_REV_B4,
17473 + OLPC_REV_C1,
17474 + OLPC_REV_R1,
17475 + OLPC_REV_UNKNOWN /* this should always come last */
17476 +};
17477 +
17478 +#ifndef CONFIG_OLPC
17479 +
17480 +static inline int machine_is_olpc(void) { return 0; }
17481 +static inline int olpc_has_dcon(void) { return 0; }
17482 +static inline int olpc_has_vsa(void) { return 0; }
17483 +static inline int olpc_get_rev(void) { return OLPC_REV_UNKNOWN; }
17484 +
17485 +#else
17486 +
17487 +extern struct olpc_platform_t olpc_platform_info;
17488 +
17489 +static inline int
17490 +machine_is_olpc(void)
17491 +{
17492 + return (olpc_platform_info.flags & OLPC_F_PRESENT) ? 1 : 0;
17493 +}
17494 +
17495 +static inline int
17496 +olpc_has_dcon(void)
17497 +{
17498 + return (olpc_platform_info.flags & OLPC_F_DCON) ? 1 : 0;
17499 +}
17500 +
17501 +static inline int
17502 +olpc_has_vsa(void)
17503 +{
17504 + return (olpc_platform_info.flags & OLPC_F_VSA) ? 1 : 0;
17505 +}
17506 +
17507 +static inline int
17508 +olpc_get_rev(void)
17509 +{
17510 + return olpc_platform_info.boardrev;
17511 +}
17512 +
17513 +static inline int
17514 +olpc_rev_after(int rev)
17515 +{
17516 + return olpc_platform_info.boardrev > rev &&
17517 + olpc_platform_info.boardrev != OLPC_REV_UNKNOWN;
17518 +}
17519 +
17520 +static inline int
17521 +olpc_rev_before(int rev)
17522 +{
17523 + return olpc_platform_info.boardrev < rev ||
17524 + olpc_platform_info.boardrev == OLPC_REV_UNKNOWN;
17525 +}
17526 +
17527 +#endif
17528 +
17529 +/* EC functions */
17530 +
17531 +int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen,
17532 + unsigned char *outbuf, size_t outlen);
17533 +
17534 +void olpc_register_battery_callback(void (*f)(unsigned long));
17535 +void olpc_deregister_battery_callback(void);
17536 +
17537 +/* EC commands and responses */
17538 +
17539 +/* SCI source values */
17540 +
17541 +#define EC_SCI_SRC_EMPTY 0x00
17542 +#define EC_SCI_SRC_GAME 0x01
17543 +#define EC_SCI_SRC_BATTERY 0x02
17544 +#define EC_SCI_SRC_BATSOC 0x04
17545 +#define EC_SCI_SRC_BATERR 0x08
17546 +#define EC_SCI_SRC_EBOOK 0x10
17547 +#define EC_SCI_SRC_WLAN 0x20
17548 +#define EC_SCI_SRC_ACPWR 0x40
17549 +
17550 +/* GPIO assignments */
17551 +
17552 +#define OLPC_GPIO_MIC_AC 1
17553 +#define OLPC_GPIO_DCON_IRQ 7
17554 +#define OLPC_GPIO_THRM_ALRM 10
17555 +#define OLPC_GPIO_WORKAUX 24
17556 +#define OLPC_GPIO_LID 26
17557 +#define OLPC_GPIO_ECSCI 27
17558 +
17559 +#endif
17560 +
17561 diff --git a/include/asm-i386/prom.h b/include/asm-i386/prom.h
17562 new file mode 100644
17563 index 0000000..59d3bdd
17564 --- /dev/null
17565 +++ b/include/asm-i386/prom.h
17566 @@ -0,0 +1,108 @@
17567 +#ifndef _I386_PROM_H
17568 +#define _I386_PROM_H
17569 +#ifdef __KERNEL__
17570 +
17571 +
17572 +/*
17573 + * Definitions for talking to the Open Firmware PROM on
17574 + * Power Macintosh computers.
17575 + *
17576 + * Copyright (C) 1996-2005 Paul Mackerras.
17577 + *
17578 + * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
17579 + * Updates for SPARC64 by David S. Miller
17580 + * Updates for i386/OLPC by Andres Salomon
17581 + *
17582 + * This program is free software; you can redistribute it and/or
17583 + * modify it under the terms of the GNU General Public License
17584 + * as published by the Free Software Foundation; either version
17585 + * 2 of the License, or (at your option) any later version.
17586 + */
17587 +
17588 +#include <linux/types.h>
17589 +#include <linux/proc_fs.h>
17590 +#include <asm/atomic.h>
17591 +
17592 +typedef u32 phandle;
17593 +typedef u32 ihandle;
17594 +
17595 +struct property {
17596 + char *name;
17597 + int length;
17598 + void *value;
17599 + struct property *next;
17600 +};
17601 +
17602 +struct device_node {
17603 + const char *name;
17604 + const char *type;
17605 + phandle node;
17606 +// phandle linux_phandle;
17607 + char *path_component_name;
17608 + char *full_name;
17609 +
17610 + struct property *properties;
17611 + struct property *deadprops; /* removed properties */
17612 + struct device_node *parent;
17613 + struct device_node *child;
17614 + struct device_node *sibling;
17615 + struct device_node *next; /* next device of same type */
17616 + struct device_node *allnext; /* next in list of all nodes */
17617 + struct proc_dir_entry *pde; /* this node's proc directory */
17618 + struct kref kref;
17619 + unsigned long _flags;
17620 + void *data;
17621 +};
17622 +
17623 +/* flag descriptions */
17624 +#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
17625 +
17626 +#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
17627 +#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
17628 +
17629 +#define OF_BAD_ADDR ((u64)-1)
17630 +
17631 +static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
17632 +{
17633 + dn->pde = de;
17634 +}
17635 +
17636 +extern struct device_node *of_find_node_by_name(struct device_node *from,
17637 + const char *name);
17638 +#define for_each_node_by_name(dn, name) \
17639 + for (dn = of_find_node_by_name(NULL, name); dn; \
17640 + dn = of_find_node_by_name(dn, name))
17641 +extern struct device_node *of_find_node_by_type(struct device_node *from,
17642 + const char *type);
17643 +#define for_each_node_by_type(dn, type) \
17644 + for (dn = of_find_node_by_type(NULL, type); dn; \
17645 + dn = of_find_node_by_type(dn, type))
17646 +extern struct device_node *of_find_compatible_node(struct device_node *from,
17647 + const char *type, const char *compat);
17648 +extern struct device_node *of_find_node_by_path(const char *path);
17649 +extern struct device_node *of_find_node_by_phandle(phandle handle);
17650 +extern struct device_node *of_get_parent(const struct device_node *node);
17651 +extern struct device_node *of_get_next_child(const struct device_node *node,
17652 + struct device_node *prev);
17653 +extern struct property *of_find_property(const struct device_node *np,
17654 + const char *name,
17655 + int *lenp);
17656 +//extern struct device_node *of_node_get(struct device_node *node);
17657 +//extern void of_node_put(struct device_node *node);
17658 +extern int of_device_is_compatible(const struct device_node *device,
17659 + const char *);
17660 +extern const void *of_get_property(const struct device_node *node,
17661 + const char *name,
17662 + int *lenp);
17663 +#define get_property(node,name,lenp) of_get_property(node,name,lenp)
17664 +extern int of_set_property(struct device_node *node, const char *name, void *val, int len);
17665 +extern int of_getintprop_default(struct device_node *np,
17666 + const char *name,
17667 + int def);
17668 +extern int of_n_addr_cells(struct device_node *np);
17669 +extern int of_n_size_cells(struct device_node *np);
17670 +
17671 +extern void prom_build_devicetree(void);
17672 +
17673 +#endif /* __KERNEL__ */
17674 +#endif
17675 diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h
17676 index 7862fe8..d7146c0 100644
17677 --- a/include/asm-i386/setup.h
17678 +++ b/include/asm-i386/setup.h
17679 @@ -24,6 +24,7 @@
17680 #define OLD_CL_BASE_ADDR 0x90000
17681 #define OLD_CL_OFFSET 0x90022
17682 #define NEW_CL_POINTER 0x228 /* Relative to real mode data */
17683 +#define OFW_INFO_OFFSET 0xb0 /* Relative to real mode data */
17684
17685 #ifndef __ASSEMBLY__
17686
17687 diff --git a/include/linux/battery.h b/include/linux/battery.h
17688 new file mode 100644
17689 index 0000000..2f856a0
17690 --- /dev/null
17691 +++ b/include/linux/battery.h
17692 @@ -0,0 +1,101 @@
17693 +/*
17694 + * Driver model for batteries
17695 + *
17696 + * © 2006 David Woodhouse <dwmw2@infradead.org>
17697 + *
17698 + * Based on LED Class support, by John Lenz and Richard Purdie:
17699 + *
17700 + * © 2005 John Lenz <lenz@cs.wisc.edu>
17701 + * © 2005-2006 Richard Purdie <rpurdie@openedhand.com>
17702 + *
17703 + * This program is free software; you can redistribute it and/or modify
17704 + * it under the terms of the GNU General Public License version 2 as
17705 + * published by the Free Software Foundation.
17706 + *
17707 + */
17708 +#ifndef __LINUX_BATTERY_H__
17709 +#define __LINUX_BATTERY_H__
17710 +
17711 +struct device;
17712 +struct class_device;
17713 +
17714 +/*
17715 + * Battery Core
17716 + */
17717 +#define PWRDEV_TYPE_BATTERY 0
17718 +#define PWRDEV_TYPE_AC 1
17719 +
17720 +#define BAT_STAT_PRESENT (1<<0)
17721 +#define BAT_STAT_LOW (1<<1)
17722 +#define BAT_STAT_FULL (1<<2)
17723 +#define BAT_STAT_CHARGING (1<<3)
17724 +#define BAT_STAT_DISCHARGING (1<<4)
17725 +#define BAT_STAT_OVERTEMP (1<<5)
17726 +#define BAT_STAT_CRITICAL (1<<6)
17727 +#define BAT_STAT_FIRE (1<<7)
17728 +#define BAT_STAT_CHARGE_DONE (1<<8)
17729 +
17730 +/* Thou shalt not export any attributes in sysfs except these, and
17731 + with these units: */
17732 +#define BAT_INFO_STATUS "status" /* Not free-form. Use
17733 + provided function */
17734 +#define BAT_INFO_TEMP1 "temp1" /* °C/1000 */
17735 +#define BAT_INFO_TEMP1_NAME "temp1_name" /* string */
17736 +
17737 +#define BAT_INFO_TEMP2 "temp2" /* °C/1000 */
17738 +#define BAT_INFO_TEMP2_NAME "temp2_name" /* string */
17739 +
17740 +#define BAT_INFO_VOLTAGE "voltage" /* mV */
17741 +#define BAT_INFO_VOLTAGE_DESIGN "voltage_design" /* mV */
17742 +
17743 +#define BAT_INFO_CURRENT "current" /* mA */
17744 +#define BAT_INFO_CURRENT_NOW "current_now" /* mA */
17745 +
17746 +#define BAT_INFO_POWER "power" /* mW */
17747 +#define BAT_INFO_POWER_NOW "power_now" /* mW */
17748 +
17749 +/* The following capacity/charge properties are represented in either
17750 + mA or mW. The CAP_UNITS property MUST be provided if any of these are. */
17751 +#define BAT_INFO_RATE "rate" /* CAP_UNITS */
17752 +#define BAT_INFO_CAP_LEFT "capacity_left" /* CAP_UNITS*h */
17753 +#define BAT_INFO_CAP_DESIGN "capacity_design" /* CAP_UNITS*h */
17754 +#define BAT_INFO_CAP_LAST_FULL "capacity_last_full" /* CAP_UNITS*h */
17755 +#define BAT_INFO_CAP_LOW "capacity_low_thresh" /* CAP_UNITS*h */
17756 +#define BAT_INFO_CAP_WARN "capacity_warn_thresh" /* CAP_UNITS*h */
17757 +#define BAT_INFO_CAP_UNITS "capacity_units" /* string: must be
17758 + either mA or mW */
17759 +
17760 +#define BAT_INFO_CAP_PCT "capacity_percentage" /* integer */
17761 +
17762 +#define BAT_INFO_TIME_EMPTY "time_to_empty" /* seconds */
17763 +#define BAT_INFO_TIME_EMPTY_NOW "time_to_empty_now" /* seconds */
17764 +#define BAT_INFO_TIME_FULL "time_to_full" /* seconds */
17765 +#define BAT_INFO_TIME_FULL_NOW "time_to_full_now" /* seconds */
17766 +
17767 +#define BAT_INFO_MANUFACTURER "manufacturer" /* string */
17768 +#define BAT_INFO_TECHNOLOGY "technology" /* string */
17769 +#define BAT_INFO_MODEL "model" /* string */
17770 +#define BAT_INFO_SERIAL "serial" /* string */
17771 +#define BAT_INFO_OEM_INFO "oem_info" /* string */
17772 +
17773 +#define BAT_INFO_CYCLE_COUNT "cycle_count" /* integer */
17774 +#define BAT_INFO_DATE_MFR "date_manufactured" /* YYYY[-MM[-DD]] */
17775 +#define BAT_INFO_DATE_FIRST_USE "date_first_use" /* YYYY[-MM[-DD]] */
17776 +
17777 +struct battery_dev {
17778 + int status_cap;
17779 + int id;
17780 + int type;
17781 + const char *name;
17782 +
17783 + struct device *dev;
17784 +};
17785 +
17786 +int battery_device_register(struct device *parent,
17787 + struct battery_dev *battery_cdev);
17788 +void battery_device_unregister(struct battery_dev *battery_cdev);
17789 +
17790 +
17791 +ssize_t battery_attribute_show_status(char *buf, unsigned long status);
17792 +ssize_t battery_attribute_show_ac_status(char *buf, unsigned long status);
17793 +#endif /* __LINUX_BATTERY_H__ */
17794 diff --git a/include/linux/console.h b/include/linux/console.h
17795 index 56a7bcd..1a8b034 100644
17796 --- a/include/linux/console.h
17797 +++ b/include/linux/console.h
17798 @@ -121,14 +121,11 @@ extern void console_stop(struct console *);
17799 extern void console_start(struct console *);
17800 extern int is_console_locked(void);
17801
17802 -#ifndef CONFIG_DISABLE_CONSOLE_SUSPEND
17803 +extern int serial_console_suspend_enabled;
17804 +
17805 /* Suspend and resume console messages over PM events */
17806 extern void suspend_console(void);
17807 extern void resume_console(void);
17808 -#else
17809 -static inline void suspend_console(void) {}
17810 -static inline void resume_console(void) {}
17811 -#endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */
17812
17813 int mda_console_init(void);
17814 void prom_con_init(void);
17815 diff --git a/include/linux/fb.h b/include/linux/fb.h
17816 index cec5410..6b59db5 100644
17817 --- a/include/linux/fb.h
17818 +++ b/include/linux/fb.h
17819 @@ -664,6 +664,12 @@ struct fb_ops {
17820 /* restore saved state */
17821 void (*fb_restore_state)(struct fb_info *info);
17822
17823 + /* Shut down the graphics engine to save power */
17824 + int (*fb_powerdown)(struct fb_info *info);
17825 +
17826 + /* Power it back up */
17827 + int (*fb_powerup)(struct fb_info *info);
17828 +
17829 /* get capability given var */
17830 void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps,
17831 struct fb_var_screeninfo *var);
17832 @@ -943,6 +949,9 @@ extern int fb_get_color_depth(struct fb_var_screeninfo *var,
17833 extern int fb_get_options(char *name, char **option);
17834 extern int fb_new_modelist(struct fb_info *info);
17835
17836 +extern int fb_powerdown(struct fb_info *info);
17837 +extern int fb_powerup(struct fb_info *info);
17838 +
17839 extern struct fb_info *registered_fb[FB_MAX];
17840 extern int num_registered_fb;
17841 extern struct class *fb_class;
17842 diff --git a/include/linux/isl_38xx.h b/include/linux/isl_38xx.h
17843 new file mode 100644
17844 index 0000000..c7e98f2
17845 --- /dev/null
17846 +++ b/include/linux/isl_38xx.h
17847 @@ -0,0 +1,127 @@
17848 +/*
17849 + * Copyright (C) 2002 Intersil Americas Inc.
17850 + *
17851 + * This program is free software; you can redistribute it and/or modify
17852 + * it under the terms of the GNU General Public License as published by
17853 + * the Free Software Foundation; either version 2 of the License
17854 + *
17855 + * This program is distributed in the hope that it will be useful,
17856 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
17857 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17858 + * GNU General Public License for more details.
17859 + *
17860 + * You should have received a copy of the GNU General Public License
17861 + * along with this program; if not, write to the Free Software
17862 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17863 + */
17864 +
17865 +#ifndef _LINUX_ISL_38XX_H
17866 +#define _LINUX_ISL_38XX_H
17867 +
17868 +#include <asm/io.h>
17869 +
17870 +#define ISL38XX_CB_RX_QSIZE 8
17871 +#define ISL38XX_CB_TX_QSIZE 32
17872 +
17873 +/* ISL38XX Access Point Specific definitions */
17874 +#define ISL38XX_MAX_WDS_LINKS 8
17875 +
17876 +/* ISL38xx Client Specific definitions */
17877 +#define ISL38XX_PSM_ACTIVE_STATE 0
17878 +#define ISL38XX_PSM_POWERSAVE_STATE 1
17879 +
17880 +/* ISL38XX Host Interface Definitions */
17881 +#define ISL38XX_PCI_MEM_SIZE 0x02000
17882 +#define ISL38XX_MEMORY_WINDOW_SIZE 0x01000
17883 +#define ISL38XX_DEV_FIRMWARE_ADDRES 0x20000
17884 +#define ISL38XX_WRITEIO_DELAY 10 /* in us */
17885 +#define ISL38XX_RESET_DELAY 50 /* in ms */
17886 +#define ISL38XX_WAIT_CYCLE 10 /* in 10ms */
17887 +#define ISL38XX_MAX_WAIT_CYCLES 10
17888 +
17889 +/* PCI Memory Area */
17890 +#define ISL38XX_HARDWARE_REG 0x0000
17891 +#define ISL38XX_CARDBUS_CIS 0x0800
17892 +#define ISL38XX_DIRECT_MEM_WIN 0x1000
17893 +
17894 +/* Hardware registers */
17895 +#define ISL38XX_DEV_INT_REG 0x0000
17896 +#define ISL38XX_INT_IDENT_REG 0x0010
17897 +#define ISL38XX_INT_ACK_REG 0x0014
17898 +#define ISL38XX_INT_EN_REG 0x0018
17899 +#define ISL38XX_GEN_PURP_COM_REG_1 0x0020
17900 +#define ISL38XX_GEN_PURP_COM_REG_2 0x0024
17901 +#define ISL38XX_CTRL_BLK_BASE_REG ISL38XX_GEN_PURP_COM_REG_1
17902 +#define ISL38XX_DIR_MEM_BASE_REG 0x0030
17903 +#define ISL38XX_CTRL_STAT_REG 0x0078
17904 +
17905 +/* High end mobos queue up pci writes, the following
17906 + * is used to "read" from after a write to force flush */
17907 +#define ISL38XX_PCI_POSTING_FLUSH ISL38XX_INT_EN_REG
17908 +
17909 +/**
17910 + * isl38xx_w32_flush - PCI iomem write helper
17911 + * @base: (host) memory base address of the device
17912 + * @val: 32bit value (host order) to write
17913 + * @offset: byte offset into @base to write value to
17914 + *
17915 + * This helper takes care of writing a 32bit datum to the
17916 + * specified offset into the device's pci memory space, and making sure
17917 + * the pci memory buffers get flushed by performing one harmless read
17918 + * from the %ISL38XX_PCI_POSTING_FLUSH offset.
17919 + */
17920 +static inline void
17921 +isl38xx_w32_flush(void __iomem *base, u32 val, unsigned long offset)
17922 +{
17923 + writel(val, base + offset);
17924 + (void) readl(base + ISL38XX_PCI_POSTING_FLUSH);
17925 +}
17926 +
17927 +/* Device Interrupt register bits */
17928 +#define ISL38XX_DEV_INT_RESET 0x0001
17929 +#define ISL38XX_DEV_INT_UPDATE 0x0002
17930 +#define ISL38XX_DEV_INT_WAKEUP 0x0008
17931 +#define ISL38XX_DEV_INT_SLEEP 0x0010
17932 +#define ISL38XX_DEV_INT_ABORT 0x0020
17933 +/* thos two only used in USB */
17934 +#define ISL38XX_DEV_INT_DATA 0x0040
17935 +#define ISL38XX_DEV_INT_MGMT 0x0080
17936 +
17937 +#define ISL38XX_DEV_INT_PCIUART_CTS 0x4000
17938 +#define ISL38XX_DEV_INT_PCIUART_DR 0x8000
17939 +
17940 +/* Interrupt Identification/Acknowledge/Enable register bits */
17941 +#define ISL38XX_INT_IDENT_UPDATE 0x0002
17942 +#define ISL38XX_INT_IDENT_INIT 0x0004
17943 +#define ISL38XX_INT_IDENT_WAKEUP 0x0008
17944 +#define ISL38XX_INT_IDENT_SLEEP 0x0010
17945 +#define ISL38XX_INT_IDENT_PCIUART_CTS 0x4000
17946 +#define ISL38XX_INT_IDENT_PCIUART_DR 0x8000
17947 +
17948 +#define ISL38XX_INT_SOURCES (ISL38XX_INT_IDENT_UPDATE | \
17949 + ISL38XX_INT_IDENT_INIT | \
17950 + ISL38XX_INT_IDENT_WAKEUP | \
17951 + ISL38XX_INT_IDENT_SLEEP | \
17952 + ISL38XX_INT_IDENT_PCIUART_CTS | \
17953 + ISL38XX_INT_IDENT_PCIUART_DR)
17954 +
17955 +/* Control/Status register bits */
17956 +/* Looks like there are other meaningful bits
17957 + 0x20004400 seen in normal operation,
17958 + 0x200044db at 'timeout waiting for mgmt response'
17959 +*/
17960 +#define ISL38XX_CTRL_STAT_SLEEPMODE 0x00000200
17961 +#define ISL38XX_CTRL_STAT_CLKRUN 0x00800000
17962 +#define ISL38XX_CTRL_STAT_RESET 0x10000000
17963 +#define ISL38XX_CTRL_STAT_RAMBOOT 0x20000000
17964 +#define ISL38XX_CTRL_STAT_STARTHALTED 0x40000000
17965 +#define ISL38XX_CTRL_STAT_HOST_OVERRIDE 0x80000000
17966 +
17967 +/* Some flags for the isl hardware registers controlling DMA inside the
17968 + * chip */
17969 +#define ISL38XX_DMA_STATUS_DONE 0x00000001
17970 +#define ISL38XX_DMA_STATUS_READY 0x00000002
17971 +#define NET2280_EPA_FIFO_PCI_ADDR 0x20000000
17972 +#define ISL38XX_DMA_MASTER_CONTROL_TRIGGER 0x00000004
17973 +
17974 +#endif /* _LINUX_ISL_38XX_H */
17975 diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
17976 index a56d24a..fd0a260 100644
17977 --- a/include/linux/mtd/onenand.h
17978 +++ b/include/linux/mtd/onenand.h
17979 @@ -60,6 +60,7 @@ struct onenand_bufferram {
17980 * @erase_shift: [INTERN] number of address bits in a block
17981 * @page_shift: [INTERN] number of address bits in a page
17982 * @page_mask: [INTERN] a page per block mask
17983 + * @writesize: [INTERN] a real page size
17984 * @bufferram_index: [INTERN] BufferRAM index
17985 * @bufferram: [INTERN] BufferRAM info
17986 * @readw: [REPLACEABLE] hardware specific function for read short
17987 @@ -100,6 +101,7 @@ struct onenand_chip {
17988 unsigned int erase_shift;
17989 unsigned int page_shift;
17990 unsigned int page_mask;
17991 + unsigned int writesize;
17992
17993 unsigned int bufferram_index;
17994 struct onenand_bufferram bufferram[MAX_BUFFERRAM];
17995 @@ -140,6 +142,8 @@ struct onenand_chip {
17996 #define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1)
17997 #define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1)
17998 #define ONENAND_SET_PREV_BUFFERRAM(this) (this->bufferram_index ^= 1)
17999 +#define ONENAND_SET_BUFFERRAM0(this) (this->bufferram_index = 0)
18000 +#define ONENAND_SET_BUFFERRAM1(this) (this->bufferram_index = 1)
18001
18002 #define ONENAND_GET_SYS_CFG1(this) \
18003 (this->read_word(this->base + ONENAND_REG_SYS_CFG1))
18004 @@ -149,6 +153,13 @@ struct onenand_chip {
18005 #define ONENAND_IS_DDP(this) \
18006 (this->device_id & ONENAND_DEVICE_IS_DDP)
18007
18008 +#ifdef CONFIG_MTD_ONENAND_2X_PROGRAM
18009 +#define ONENAND_IS_2PLANE(this) \
18010 + (this->options & ONENAND_HAS_2PLANE)
18011 +#else
18012 +#define ONENAND_IS_2PLANE(this) (0)
18013 +#endif
18014 +
18015 /* Check byte access in OneNAND */
18016 #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)
18017
18018 @@ -157,6 +168,7 @@ struct onenand_chip {
18019 */
18020 #define ONENAND_HAS_CONT_LOCK (0x0001)
18021 #define ONENAND_HAS_UNLOCK_ALL (0x0002)
18022 +#define ONENAND_HAS_2PLANE (0x0004)
18023 #define ONENAND_PAGEBUF_ALLOC (0x1000)
18024 #define ONENAND_OOBBUF_ALLOC (0x2000)
18025
18026 diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
18027 index af94719..c46161f 100644
18028 --- a/include/linux/mtd/onenand_regs.h
18029 +++ b/include/linux/mtd/onenand_regs.h
18030 @@ -74,6 +74,8 @@
18031
18032 #define ONENAND_DEVICE_DENSITY_512Mb (0x002)
18033 #define ONENAND_DEVICE_DENSITY_1Gb (0x003)
18034 +#define ONENAND_DEVICE_DENSITY_2Gb (0x004)
18035 +#define ONENAND_DEVICE_DENSITY_4Gb (0x005)
18036
18037 /*
18038 * Version ID Register F002h (R)
18039 @@ -111,6 +113,8 @@
18040 #define ONENAND_CMD_READOOB (0x13)
18041 #define ONENAND_CMD_PROG (0x80)
18042 #define ONENAND_CMD_PROGOOB (0x1A)
18043 +#define ONENAND_CMD_2X_PROG (0x7D)
18044 +#define ONENAND_CMD_2X_CACHE_PROG (0x7F)
18045 #define ONENAND_CMD_UNLOCK (0x23)
18046 #define ONENAND_CMD_LOCK (0x2A)
18047 #define ONENAND_CMD_LOCK_TIGHT (0x2C)
18048 diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
18049 index 699b7e9..b44facf 100644
18050 --- a/include/linux/vt_kern.h
18051 +++ b/include/linux/vt_kern.h
18052 @@ -95,4 +95,23 @@ struct vt_spawn_console {
18053 };
18054 extern struct vt_spawn_console vt_spawn_con;
18055
18056 +/* A notifier list for console events */
18057 +extern struct raw_notifier_head console_notifier_list;
18058 +
18059 +/* Called when the FG console switches to KD_TEXT mode */
18060 +#define CONSOLE_EVENT_SWITCH_TEXT 0x01
18061 +
18062 +/* Called when the FG console switches to KD_GRAPHICS mode */
18063 +#define CONSOLE_EVENT_SWITCH_GRAPHICS 0x02
18064 +
18065 +static inline int console_event_register(struct notifier_block *n)
18066 +{
18067 + return raw_notifier_chain_register(&console_notifier_list, n);
18068 +}
18069 +
18070 +static inline int console_event_unregister(struct notifier_block *n)
18071 +{
18072 + return raw_notifier_chain_unregister(&console_notifier_list, n);
18073 +}
18074 +
18075 #endif /* _VT_KERN_H */
18076 diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
18077 index 246ac23..874a2c8 100644
18078 --- a/include/sound/ac97_codec.h
18079 +++ b/include/sound/ac97_codec.h
18080 @@ -281,10 +281,12 @@
18081 /* specific - Analog Devices */
18082 #define AC97_AD_TEST 0x5a /* test register */
18083 #define AC97_AD_TEST2 0x5c /* undocumented test register 2 */
18084 +#define AC97_AD_HPFD_SHIFT 12 /* High Pass Filter Disable */
18085 #define AC97_AD_CODEC_CFG 0x70 /* codec configuration */
18086 #define AC97_AD_JACK_SPDIF 0x72 /* Jack Sense & S/PDIF */
18087 #define AC97_AD_SERIAL_CFG 0x74 /* Serial Configuration */
18088 #define AC97_AD_MISC 0x76 /* Misc Control Bits */
18089 +#define AC97_AD_VREFD_SHIFT 2 /* V_REFOUT Disable (AD1888) */
18090
18091 /* specific - Cirrus Logic */
18092 #define AC97_CSR_ACMODE 0x5e /* AC Mode Register */
18093 diff --git a/kernel/power/console.c b/kernel/power/console.c
18094 index 89bcf49..dca98f5 100644
18095 --- a/kernel/power/console.c
18096 +++ b/kernel/power/console.c
18097 @@ -9,7 +9,7 @@
18098 #include <linux/console.h>
18099 #include "power.h"
18100
18101 -#if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
18102 +#if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) && !defined(CONFIG_DISABLE_SUSPEND_VT_SWITCH)
18103 #define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1)
18104
18105 static int orig_fgconsole, orig_kmsg;
18106 diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
18107 index bbed644..090e852 100644
18108 --- a/sound/pci/ac97/ac97_codec.c
18109 +++ b/sound/pci/ac97/ac97_codec.c
18110 @@ -49,7 +49,7 @@ module_param(enable_loopback, bool, 0444);
18111 MODULE_PARM_DESC(enable_loopback, "Enable AC97 ADC/DAC Loopback Control");
18112
18113 #ifdef CONFIG_SND_AC97_POWER_SAVE
18114 -static int power_save;
18115 +static int power_save = 1;
18116 module_param(power_save, bool, 0644);
18117 MODULE_PARM_DESC(power_save, "Enable AC97 power-saving control");
18118 #endif
18119 diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
18120 index 581ebba..06637f7 100644
18121 --- a/sound/pci/ac97/ac97_patch.c
18122 +++ b/sound/pci/ac97/ac97_patch.c
18123 @@ -1973,8 +1973,9 @@ static const struct snd_kcontrol_new snd_ac97_ad1888_controls[] = {
18124 .get = snd_ac97_ad1888_lohpsel_get,
18125 .put = snd_ac97_ad1888_lohpsel_put
18126 },
18127 - AC97_SINGLE("V_REFOUT Enable", AC97_AD_MISC, 2, 1, 1),
18128 - AC97_SINGLE("High Pass Filter Enable", AC97_AD_TEST2, 12, 1, 1),
18129 + AC97_SINGLE("V_REFOUT Enable", AC97_AD_MISC, AC97_AD_VREFD_SHIFT, 1, 1),
18130 + AC97_SINGLE("High Pass Filter Enable", AC97_AD_TEST2,
18131 + AC97_AD_HPFD_SHIFT, 1, 1),
18132 AC97_SINGLE("Spread Front to Surround and Center/LFE", AC97_AD_MISC, 7, 1, 0),
18133 {
18134 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
18135 diff --git a/sound/pci/cs5535audio/Makefile b/sound/pci/cs5535audio/Makefile
18136 index ad947b4..3866c4d 100644
18137 --- a/sound/pci/cs5535audio/Makefile
18138 +++ b/sound/pci/cs5535audio/Makefile
18139 @@ -8,5 +8,9 @@ ifeq ($(CONFIG_PM),y)
18140 snd-cs5535audio-objs += cs5535audio_pm.o
18141 endif
18142
18143 +ifdef CONFIG_OLPC
18144 +snd-cs5535audio-objs += cs5535audio_olpc.o
18145 +endif
18146 +
18147 # Toplevel Module Dependency
18148 obj-$(CONFIG_SND_CS5535AUDIO) += snd-cs5535audio.o
18149 diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
18150 index b8e75ef..389d9da 100644
18151 --- a/sound/pci/cs5535audio/cs5535audio.c
18152 +++ b/sound/pci/cs5535audio/cs5535audio.c
18153 @@ -145,7 +145,7 @@ static unsigned short snd_cs5535audio_ac97_codec_read(struct snd_ac97 *ac97,
18154 return snd_cs5535audio_codec_read(cs5535au, reg);
18155 }
18156
18157 -static int snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
18158 +static int __devinit snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
18159 {
18160 struct snd_card *card = cs5535au->card;
18161 struct snd_ac97_bus *pbus;
18162 @@ -160,10 +160,14 @@ static int snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
18163 return err;
18164
18165 memset(&ac97, 0, sizeof(ac97));
18166 - ac97.scaps = AC97_SCAP_AUDIO|AC97_SCAP_SKIP_MODEM;
18167 + ac97.scaps = AC97_SCAP_AUDIO | AC97_SCAP_SKIP_MODEM
18168 + | AC97_SCAP_POWER_SAVE;
18169 ac97.private_data = cs5535au;
18170 ac97.pci = cs5535au->pci;
18171
18172 + /* olpc_prequirks is dummied out if not olpc */
18173 + olpc_prequirks(card, &ac97);
18174 +
18175 if ((err = snd_ac97_mixer(pbus, &ac97, &cs5535au->ac97)) < 0) {
18176 snd_printk(KERN_ERR "mixer failed\n");
18177 return err;
18178 @@ -171,6 +175,12 @@ static int snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
18179
18180 snd_ac97_tune_hardware(cs5535au->ac97, ac97_quirks, ac97_quirk);
18181
18182 + /* olpc_quirks is dummied out if not olpc */
18183 + if (( err = olpc_quirks(card, cs5535au->ac97)) < 0) {
18184 + snd_printk(KERN_ERR "olpc quirks failed\n");
18185 + return err;
18186 + }
18187 +
18188 return 0;
18189 }
18190
18191 @@ -206,7 +216,6 @@ static void process_bm1_irq(struct cs5535audio *cs5535au)
18192 static irqreturn_t snd_cs5535audio_interrupt(int irq, void *dev_id)
18193 {
18194 u16 acc_irq_stat;
18195 - u8 bm_stat;
18196 unsigned char count;
18197 struct cs5535audio *cs5535au = dev_id;
18198
18199 @@ -217,7 +226,7 @@ static irqreturn_t snd_cs5535audio_interrupt(int irq, void *dev_id)
18200
18201 if (!acc_irq_stat)
18202 return IRQ_NONE;
18203 - for (count = 0; count < 10; count++) {
18204 + for (count = 0; count < 4; count++) {
18205 if (acc_irq_stat & (1 << count)) {
18206 switch (count) {
18207 case IRQ_STS:
18208 @@ -232,26 +241,9 @@ static irqreturn_t snd_cs5535audio_interrupt(int irq, void *dev_id)
18209 case BM1_IRQ_STS:
18210 process_bm1_irq(cs5535au);
18211 break;
18212 - case BM2_IRQ_STS:
18213 - bm_stat = cs_readb(cs5535au, ACC_BM2_STATUS);
18214 - break;
18215 - case BM3_IRQ_STS:
18216 - bm_stat = cs_readb(cs5535au, ACC_BM3_STATUS);
18217 - break;
18218 - case BM4_IRQ_STS:
18219 - bm_stat = cs_readb(cs5535au, ACC_BM4_STATUS);
18220 - break;
18221 - case BM5_IRQ_STS:
18222 - bm_stat = cs_readb(cs5535au, ACC_BM5_STATUS);
18223 - break;
18224 - case BM6_IRQ_STS:
18225 - bm_stat = cs_readb(cs5535au, ACC_BM6_STATUS);
18226 - break;
18227 - case BM7_IRQ_STS:
18228 - bm_stat = cs_readb(cs5535au, ACC_BM7_STATUS);
18229 - break;
18230 default:
18231 - snd_printk(KERN_ERR "Unexpected irq src\n");
18232 + snd_printk(KERN_ERR "Unexpected irq src: "
18233 + "0x%x\n", acc_irq_stat);
18234 break;
18235 }
18236 }
18237 diff --git a/sound/pci/cs5535audio/cs5535audio.h b/sound/pci/cs5535audio/cs5535audio.h
18238 index 4fd1f31..ff82f10 100644
18239 --- a/sound/pci/cs5535audio/cs5535audio.h
18240 +++ b/sound/pci/cs5535audio/cs5535audio.h
18241 @@ -16,57 +16,28 @@
18242 #define ACC_IRQ_STATUS 0x12
18243 #define ACC_BM0_CMD 0x20
18244 #define ACC_BM1_CMD 0x28
18245 -#define ACC_BM2_CMD 0x30
18246 -#define ACC_BM3_CMD 0x38
18247 -#define ACC_BM4_CMD 0x40
18248 -#define ACC_BM5_CMD 0x48
18249 -#define ACC_BM6_CMD 0x50
18250 -#define ACC_BM7_CMD 0x58
18251 #define ACC_BM0_PRD 0x24
18252 #define ACC_BM1_PRD 0x2C
18253 -#define ACC_BM2_PRD 0x34
18254 -#define ACC_BM3_PRD 0x3C
18255 -#define ACC_BM4_PRD 0x44
18256 -#define ACC_BM5_PRD 0x4C
18257 -#define ACC_BM6_PRD 0x54
18258 -#define ACC_BM7_PRD 0x5C
18259 #define ACC_BM0_STATUS 0x21
18260 #define ACC_BM1_STATUS 0x29
18261 -#define ACC_BM2_STATUS 0x31
18262 -#define ACC_BM3_STATUS 0x39
18263 -#define ACC_BM4_STATUS 0x41
18264 -#define ACC_BM5_STATUS 0x49
18265 -#define ACC_BM6_STATUS 0x51
18266 -#define ACC_BM7_STATUS 0x59
18267 #define ACC_BM0_PNTR 0x60
18268 #define ACC_BM1_PNTR 0x64
18269 -#define ACC_BM2_PNTR 0x68
18270 -#define ACC_BM3_PNTR 0x6C
18271 -#define ACC_BM4_PNTR 0x70
18272 -#define ACC_BM5_PNTR 0x74
18273 -#define ACC_BM6_PNTR 0x78
18274 -#define ACC_BM7_PNTR 0x7C
18275 +
18276 /* acc_codec bar0 reg bits */
18277 /* ACC_IRQ_STATUS */
18278 #define IRQ_STS 0
18279 #define WU_IRQ_STS 1
18280 #define BM0_IRQ_STS 2
18281 #define BM1_IRQ_STS 3
18282 -#define BM2_IRQ_STS 4
18283 -#define BM3_IRQ_STS 5
18284 -#define BM4_IRQ_STS 6
18285 -#define BM5_IRQ_STS 7
18286 -#define BM6_IRQ_STS 8
18287 -#define BM7_IRQ_STS 9
18288 /* ACC_BMX_STATUS */
18289 #define EOP (1<<0)
18290 #define BM_EOP_ERR (1<<1)
18291 /* ACC_BMX_CTL */
18292 -#define BM_CTL_EN 0x00000001
18293 -#define BM_CTL_PAUSE 0x00000011
18294 -#define BM_CTL_DIS 0x00000000
18295 -#define BM_CTL_BYTE_ORD_LE 0x00000000
18296 -#define BM_CTL_BYTE_ORD_BE 0x00000100
18297 +#define BM_CTL_EN 0x01
18298 +#define BM_CTL_PAUSE 0x03
18299 +#define BM_CTL_DIS 0x00
18300 +#define BM_CTL_BYTE_ORD_LE 0x00
18301 +#define BM_CTL_BYTE_ORD_BE 0x04
18302 /* cs5535 specific ac97 codec register defines */
18303 #define CMD_MASK 0xFF00FFFF
18304 #define CMD_NEW 0x00010000
18305 @@ -106,8 +77,8 @@ struct cs5535audio_dma {
18306 struct snd_pcm_substream *substream;
18307 unsigned int buf_addr, buf_bytes;
18308 unsigned int period_bytes, periods;
18309 - int suspended;
18310 u32 saved_prd;
18311 + int pcm_open_flag;
18312 };
18313
18314 struct cs5535audio {
18315 @@ -123,8 +94,21 @@ struct cs5535audio {
18316 struct cs5535audio_dma dmas[NUM_CS5535AUDIO_DMAS];
18317 };
18318
18319 +#ifdef CONFIG_PM
18320 int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state);
18321 int snd_cs5535audio_resume(struct pci_dev *pci);
18322 +#endif
18323 +
18324 +#ifdef CONFIG_OLPC
18325 +void olpc_prequirks(struct snd_card *card, struct snd_ac97_template *ac97) __devinit;
18326 +int olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97) __devinit;
18327 +int olpc_ai_enable(struct snd_ac97 *ac97, u8 val);
18328 +#else
18329 +#define olpc_prequirks(arg,arg2) do {} while (0)
18330 +#define olpc_quirks(arg,arg2) (0)
18331 +#define olpc_ai_enable(a, v) (0)
18332 +#endif
18333 +
18334 int __devinit snd_cs5535audio_pcm(struct cs5535audio *cs5535audio);
18335
18336 #endif /* __SOUND_CS5535AUDIO_H */
18337 diff --git a/sound/pci/cs5535audio/cs5535audio_olpc.c b/sound/pci/cs5535audio/cs5535audio_olpc.c
18338 new file mode 100644
18339 index 0000000..791be73
18340 --- /dev/null
18341 +++ b/sound/pci/cs5535audio/cs5535audio_olpc.c
18342 @@ -0,0 +1,110 @@
18343 +#include <sound/driver.h>
18344 +#include <sound/core.h>
18345 +#include <sound/info.h>
18346 +#include <sound/control.h>
18347 +#include <sound/ac97_codec.h>
18348 +
18349 +#include <asm/olpc.h>
18350 +#include "cs5535audio.h"
18351 +
18352 +/*
18353 + * OLPC has an additional feature on top of the regular AD1888 codec features.
18354 + * It has an Analog Input mode that is switched into (after disabling the
18355 + * High Pass Filter) via GPIO. It is only supported on B2 and later models.
18356 + */
18357 +
18358 +int olpc_ai_enable(struct snd_ac97 *ac97, u8 val)
18359 +{
18360 + int err;
18361 +
18362 + /*
18363 + * update the High Pass Filter (via AC97_AD_TEST2), and then set
18364 + * Analog Input mode through a GPIO.
18365 + */
18366 +
18367 + if (val) {
18368 + err = snd_ac97_update_bits(ac97, AC97_AD_TEST2,
18369 + 1<<AC97_AD_HPFD_SHIFT, 1<<AC97_AD_HPFD_SHIFT);
18370 + geode_gpio_set(OLPC_GPIO_MIC_AC, GPIO_OUTPUT_VAL);
18371 + }
18372 + else {
18373 + err = snd_ac97_update_bits(ac97, AC97_AD_TEST2,
18374 + 1<<AC97_AD_HPFD_SHIFT, 0);
18375 + geode_gpio_clear(OLPC_GPIO_MIC_AC, GPIO_OUTPUT_VAL);
18376 + }
18377 + if (err < 0)
18378 + snd_printk(KERN_ERR "Error updating AD_TEST2: %d\n", err);
18379 +
18380 + return err;
18381 +}
18382 +EXPORT_SYMBOL_GPL(olpc_ai_enable);
18383 +
18384 +static int snd_cs5535audio_ai_info(struct snd_kcontrol *kcontrol,
18385 + struct snd_ctl_elem_info *uinfo)
18386 +{
18387 + uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
18388 + uinfo->count = 1;
18389 + uinfo->value.integer.min = 0;
18390 + uinfo->value.integer.max = 1;
18391 + return 0;
18392 +}
18393 +
18394 +static int snd_cs5535audio_ai_get(struct snd_kcontrol *kcontrol,
18395 + struct snd_ctl_elem_value *ucontrol)
18396 +{
18397 + ucontrol->value.integer.value[0] = geode_gpio_isset(OLPC_GPIO_MIC_AC,
18398 + GPIO_OUTPUT_VAL);
18399 + return 0;
18400 +}
18401 +
18402 +static int snd_cs5535audio_ai_put(struct snd_kcontrol *kcontrol,
18403 + struct snd_ctl_elem_value *ucontrol)
18404 +{
18405 + struct cs5535audio *cs5535au = snd_kcontrol_chip(kcontrol);
18406 + struct snd_ac97 *ac97 = cs5535au->ac97;
18407 +
18408 + olpc_ai_enable(ac97, ucontrol->value.integer.value[0]);
18409 +
18410 + return 1;
18411 +}
18412 +
18413 +static struct snd_kcontrol_new snd_cs5535audio_controls __devinitdata =
18414 +{
18415 + .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
18416 + .name = "DC Mode Enable",
18417 + .info = snd_cs5535audio_ai_info,
18418 + .get = snd_cs5535audio_ai_get,
18419 + .put = snd_cs5535audio_ai_put,
18420 + .private_value = 0
18421 +};
18422 +
18423 +void __devinit olpc_prequirks(struct snd_card *card,
18424 + struct snd_ac97_template *ac97)
18425 +{
18426 + /* Bail if this isn't an OLPC platform */
18427 + if (!machine_is_olpc())
18428 + return;
18429 +
18430 + /* If on an OLPC B3 or higher, invert EAPD. */
18431 + if (olpc_rev_after(OLPC_REV_B2))
18432 + ac97->scaps |= AC97_SCAP_INV_EAPD;
18433 +}
18434 +
18435 +int __devinit olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97)
18436 +{
18437 + struct snd_ctl_elem_id elem;
18438 +
18439 + /* Bail if this isn't an OLPC platform */
18440 + if (!machine_is_olpc())
18441 + return 0;
18442 +
18443 + /* drop the original ad1888 HPF control */
18444 + memset(&elem, 0, sizeof(elem));
18445 + elem.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
18446 + strcpy(elem.name, "High Pass Filter Enable");
18447 + snd_ctl_remove_id(card, &elem);
18448 +
18449 + /* add the override for OLPC's HPF */
18450 + return snd_ctl_add(card, snd_ctl_new1(&snd_cs5535audio_controls,
18451 + ac97->private_data));
18452 +}
18453 diff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c
18454 index 5450a9e..d23f8ea 100644
18455 --- a/sound/pci/cs5535audio/cs5535audio_pcm.c
18456 +++ b/sound/pci/cs5535audio/cs5535audio_pcm.c
18457 @@ -164,6 +164,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
18458 jmpprd_addr = cpu_to_le32(lastdesc->addr +
18459 (sizeof(struct cs5535audio_dma_desc)*periods));
18460
18461 + dma->substream = substream;
18462 dma->period_bytes = period_bytes;
18463 dma->periods = periods;
18464 spin_lock_irq(&cs5535au->reg_lock);
18465 @@ -241,6 +242,7 @@ static void cs5535audio_clear_dma_packets(struct cs5535audio *cs5535au,
18466 {
18467 snd_dma_free_pages(&dma->desc_buf);
18468 dma->desc_buf.area = NULL;
18469 + dma->substream = NULL;
18470 }
18471
18472 static int snd_cs5535audio_hw_params(struct snd_pcm_substream *substream,
18473 @@ -260,6 +262,9 @@ static int snd_cs5535audio_hw_params(struct snd_pcm_substream *substream,
18474 err = cs5535audio_build_dma_packets(cs5535au, dma, substream,
18475 params_periods(hw_params),
18476 params_period_bytes(hw_params));
18477 + if (!err)
18478 + dma->pcm_open_flag = 1;
18479 +
18480 return err;
18481 }
18482
18483 @@ -268,6 +273,15 @@ static int snd_cs5535audio_hw_free(struct snd_pcm_substream *substream)
18484 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
18485 struct cs5535audio_dma *dma = substream->runtime->private_data;
18486
18487 + if (dma->pcm_open_flag) {
18488 + if (substream == cs5535au->playback_substream)
18489 + snd_ac97_update_power(cs5535au->ac97,
18490 + AC97_PCM_FRONT_DAC_RATE, 0);
18491 + else
18492 + snd_ac97_update_power(cs5535au->ac97,
18493 + AC97_PCM_LR_ADC_RATE, 0);
18494 + dma->pcm_open_flag = 0;
18495 + }
18496 cs5535audio_clear_dma_packets(cs5535au, dma, substream);
18497 return snd_pcm_lib_free_pages(substream);
18498 }
18499 @@ -298,14 +312,12 @@ static int snd_cs5535audio_trigger(struct snd_pcm_substream *substream, int cmd)
18500 break;
18501 case SNDRV_PCM_TRIGGER_RESUME:
18502 dma->ops->enable_dma(cs5535au);
18503 - dma->suspended = 0;
18504 break;
18505 case SNDRV_PCM_TRIGGER_STOP:
18506 dma->ops->disable_dma(cs5535au);
18507 break;
18508 case SNDRV_PCM_TRIGGER_SUSPEND:
18509 dma->ops->disable_dma(cs5535au);
18510 - dma->suspended = 1;
18511 break;
18512 default:
18513 snd_printk(KERN_ERR "unhandled trigger\n");
18514 @@ -344,6 +356,7 @@ static int snd_cs5535audio_capture_open(struct snd_pcm_substream *substream)
18515 int err;
18516 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
18517 struct snd_pcm_runtime *runtime = substream->runtime;
18518 + struct snd_ac97 *ac97 = cs5535au->ac97;
18519
18520 runtime->hw = snd_cs5535audio_capture;
18521 cs5535au->capture_substream = substream;
18522 @@ -352,11 +365,29 @@ static int snd_cs5535audio_capture_open(struct snd_pcm_substream *substream)
18523 if ((err = snd_pcm_hw_constraint_integer(runtime,
18524 SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
18525 return err;
18526 - return 0;
18527 +
18528 +#ifdef CONFIG_OLPC
18529 + /* Disable Analog Input */
18530 + olpc_ai_enable(ac97, 0);
18531 + /* Enable V_ref bias while recording. */
18532 + snd_ac97_update_bits(ac97, AC97_AD_MISC, 1<<AC97_AD_VREFD_SHIFT, 0);
18533 +#endif
18534 + return err;
18535 }
18536
18537 static int snd_cs5535audio_capture_close(struct snd_pcm_substream *substream)
18538 {
18539 +#ifdef CONFIG_OLPC
18540 + struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
18541 + struct snd_ac97 *ac97 = cs5535au->ac97;
18542 +
18543 + /* Disable Analog Input */
18544 + olpc_ai_enable(ac97, 0);
18545 + /* Disable V_ref bias. */
18546 + snd_ac97_update_bits(ac97, AC97_AD_MISC, 1<<AC97_AD_VREFD_SHIFT,
18547 + 1<<AC97_AD_VREFD_SHIFT);
18548 +#endif
18549 +
18550 return 0;
18551 }
18552
18553 diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c
18554 index 3e4d198..838708f 100644
18555 --- a/sound/pci/cs5535audio/cs5535audio_pm.c
18556 +++ b/sound/pci/cs5535audio/cs5535audio_pm.c
18557 @@ -64,18 +64,21 @@ int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state)
18558 int i;
18559
18560 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
18561 + snd_pcm_suspend_all(cs5535au->pcm);
18562 + snd_ac97_suspend(cs5535au->ac97);
18563 for (i = 0; i < NUM_CS5535AUDIO_DMAS; i++) {
18564 struct cs5535audio_dma *dma = &cs5535au->dmas[i];
18565 - if (dma && dma->substream && !dma->suspended)
18566 + if (dma && dma->substream)
18567 dma->saved_prd = dma->ops->read_prd(cs5535au);
18568 }
18569 - snd_pcm_suspend_all(cs5535au->pcm);
18570 - snd_ac97_suspend(cs5535au->ac97);
18571 /* save important regs, then disable aclink in hw */
18572 snd_cs5535audio_stop_hardware(cs5535au);
18573
18574 + if (pci_save_state(pci)) {
18575 + printk(KERN_ERR "cs5535audio: pci_save_state failed!\n");
18576 + return -EIO;
18577 + }
18578 pci_disable_device(pci);
18579 - pci_save_state(pci);
18580 pci_set_power_state(pci, pci_choose_state(pci, state));
18581 return 0;
18582 }
18583 @@ -89,7 +92,12 @@ int snd_cs5535audio_resume(struct pci_dev *pci)
18584 int i;
18585
18586 pci_set_power_state(pci, PCI_D0);
18587 - pci_restore_state(pci);
18588 + if (pci_restore_state(pci) < 0) {
18589 + printk(KERN_ERR "cs5535audio: pci_restore_state failed, "
18590 + "disabling device\n");
18591 + snd_card_disconnect(card);
18592 + return -EIO;
18593 + }
18594 if (pci_enable_device(pci) < 0) {
18595 printk(KERN_ERR "cs5535audio: pci_enable_device failed, "
18596 "disabling device\n");
18597 @@ -112,17 +120,17 @@ int snd_cs5535audio_resume(struct pci_dev *pci)
18598 if (!timeout)
18599 snd_printk(KERN_ERR "Failure getting AC Link ready\n");
18600
18601 - /* we depend on ac97 to perform the codec power up */
18602 - snd_ac97_resume(cs5535au->ac97);
18603 /* set up rate regs, dma. actual initiation is done in trig */
18604 for (i = 0; i < NUM_CS5535AUDIO_DMAS; i++) {
18605 struct cs5535audio_dma *dma = &cs5535au->dmas[i];
18606 - if (dma && dma->substream && dma->suspended) {
18607 + if (dma && dma->substream) {
18608 dma->substream->ops->prepare(dma->substream);
18609 dma->ops->setup_prd(cs5535au, dma->saved_prd);
18610 }
18611 }
18612 -
18613 +
18614 + /* we depend on ac97 to perform the codec power up */
18615 + snd_ac97_resume(cs5535au->ac97);
18616 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
18617
18618 return 0;
This page took 0.807443 seconds and 5 git commands to generate.