1 diff --git a/MAINTAINERS b/MAINTAINERS
2 index 9c54a5e..f88d691 100644
5 @@ -3026,6 +3026,13 @@ L: linux-wireless@vger.kernel.org
9 +ADM8211 WIRELESS DRIVER
11 +M: flamingice@sourmilk.net
12 +L: netdev@vger.kernel.org
13 +W: http://aluminum.sourmilk.net/adm8211/netdev/
16 PROMISE DC4030 CACHING DISK CONTROLLER DRIVER
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
25 If unsure, say Y. Only embedded should say N here.
28 + bool "Don't probe VGA at boot" if EMBEDDED
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
36 source kernel/Kconfig.hz
39 @@ -1120,6 +1129,9 @@ config PCI_GODIRECT
49 @@ -1129,7 +1141,7 @@ config PCI_BIOS
53 - depends on PCI && ((PCI_GODIRECT || PCI_GOANY) || X86_VISWS)
54 + depends on PCI && ((PCI_GODIRECT || PCI_GOANY || PCI_GOOLPC) || X86_VISWS)
58 @@ -1137,6 +1149,11 @@ config PCI_MMCONFIG
59 depends on PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY)
64 + depends on PCI && PCI_GOOLPC
67 source "drivers/pci/pcie/Kconfig"
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.
74 +config GEODE_MFGPT_TIMER
75 + bool "Geode Multi-Function General Purpose Timer (mfgpt) Support"
76 + depends on MGEODE_LX && GENERIC_TIME && GENERIC_CLOCKEVENTS
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.
92 + Add support for detecting the unique features of the OLPC
96 + tristate "OLPC power management support"
100 + Add support for the Geode power management facilities on the
101 + OLPC Childrens Machine
103 +config OPEN_FIRMWARE
104 + bool "Support for Open Firmware"
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.
111 source "drivers/pcmcia/Kconfig"
113 source "drivers/pci/hotplug/Kconfig"
114 diff --git a/arch/i386/boot/setup.S b/arch/i386/boot/setup.S
116 index 0000000..4cf6e23
118 +++ b/arch/i386/boot/setup.S
121 + * setup.S Copyright (C) 1991, 1992 Linus Torvalds
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.
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.
133 + * Move PS/2 aux init code to psaux.c
134 + * (troyer@saifr00.cfsat.Honeywell.COM) 03Oct92
136 + * some changes and additional features by Christoph Niemann,
137 + * March 1993/June 1994 (Christoph.Niemann@linux.org)
139 + * add APM BIOS checking by Stephen Rothwell, May 1994
140 + * (sfr@canb.auug.org.au)
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>
146 + * Video handling moved to video.S by Martin Mares, March 1996
147 + * <mj@k332.feld.cvut.cz>
149 + * Extended memory detection scheme retwiddled by orc@pell.chi.il.us (david
150 + * parsons) to avoid loadlin confusion, July 1997
152 + * Transcribed from Intel (as86) -> AT&T (gas) by Chris Noe, May 1999.
153 + * <stiker@northlink.com>
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>
164 + * New A20 code ported from SYSLINUX by H. Peter Anvin. AMD Elan bugfixes
165 + * by Robert Schwebel, December 2001 <robert@schwebel.de>
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>
176 +/* Signature words to ensure LILO loaded us right */
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
185 +DELTA_INITSEG = SETUPSEG - INITSEG # 0x0020
188 +.globl begtext, begdata, begbss, endtext, enddata, endbss
201 +# This is the setup header, and it must start at %cs:2 (old 0x9020:2)
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
213 +type_of_loader: .byte 0 # = 0, old one (LILO, Loadlin,
214 + # Bootlin, SYSLX, bootsect...)
215 + # See Documentation/i386/boot.txt for
218 +# flags, unused bits must be zero (RFU) bit within 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
225 + # Only the loader knows what is free
226 +#ifndef __BIG_KERNEL__
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.
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
244 + .long 0x100000 # 0x100000 = default for big kernel
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.
252 +ramdisk_size: .long 0 # its size in bytes
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.
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.
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
283 +kernel_alignment: .long CONFIG_PHYSICAL_ALIGN #physical addr alignment
284 + #required for protected mode
286 +#ifdef CONFIG_RELOCATABLE
287 +relocatable_kernel: .byte 1
289 +relocatable_kernel: .byte 0
294 +cmdline_size: .long COMMAND_LINE_SIZE-1 #length of the command line,
295 + #added with boot protocol
298 +trampoline: call start_of_setup
300 + # The offset at this point is 0x240
301 + .space (0xeff-0x240+1) # E820 & EDD space (ending at 0xeff)
302 +# End of setup header #####################################################
305 +# Bootlin depends on this being done early
310 +#ifdef SAFE_RESET_DISK_CONTROLLER
311 +# Reset the disk controller.
317 +# Set %ds = %cs, we know that SETUPSEG = %cs at this point
318 + movw %cs, %ax # aka SETUPSEG
320 +# Check signature at end of setup
321 + cmpw $SIG1, setup_sig1
324 + cmpw $SIG2, setup_sig2
329 +# Routine to print asciiz string at ds:si
341 +prtsp2: call prtspc # Print double space
342 +prtspc: movb $0x20, %al # Print single space (note: fall-thru)
344 +# Part of above routine, this one just prints ascii al
355 +beep: movb $0x07, %al
358 +no_sig_mess: .string "No setup signature found ..."
363 +# We now have to find the rest of the setup code/data
365 + movw %cs, %ax # SETUPSEG
366 + subw $DELTA_INITSEG, %ax # INITSEG
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)
373 + shrw $3, %bx # convert to segment
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
385 + movw %cs, %ax # aka SETUPSEG
387 + cmpw $SIG1, setup_sig1
390 + cmpw $SIG2, setup_sig2
396 + lea no_sig_mess, %si
404 + movw %cs, %ax # aka SETUPSEG
405 + subw $DELTA_INITSEG, %ax # aka INITSEG
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.
411 + cmpb $0, %cs:type_of_loader # Do we have a loader that
412 + # can deal with us?
413 + jnz loader_ok # Yes, continue.
415 + pushw %cs # No, we have an old loader,
417 + lea loader_panic_mess, %si
422 +loader_panic_mess: .string "Wrong loader, giving up..."
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.
432 + movw %cs,%ax # aka SETUPSEG
434 + lea cpu_panic_mess,%si
439 + .asciz "PANIC: CPU too old for this kernel."
441 +#include "../kernel/verify_cpu.S"
444 +# Get memory size (extended mem, kB)
448 +#ifndef STANDARD_MEMORY_BIOS_CALL
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
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.
462 +#define SMAP 0x534d4150
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.
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.
476 + int $0x15 # make the call
477 + jc bail820 # fall to e801 if it fails
479 + cmpl $SMAP, %eax # check the return is `SMAP'
480 + jne bail820 # fall to e801 if it fails
482 +# cmpl $1, 16(%di) # is this usable memory?
485 + # If this is usable memory, we save it by simply advancing %di by
489 + movb (E820NR), %al # up to 128 entries
498 + cmpl $0, %ebx # check to see if
499 + jne jmpe820 # %ebx is set to EOF
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.)
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.
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...
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
537 +# Ye Olde Traditional Methode. Returns the memory size (up to 16mb or
538 +# 64mb, depending on the bios) in ax.
546 +# Set the keyboard repeat rate to the max
551 +#ifndef CONFIG_VGA_NOPROBE
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
562 + ldsw (4 * 0x41), %si
563 + movw %cs, %ax # aka SETUPSEG
564 + subw $DELTA_INITSEG, %ax # aka INITSEG
576 + ldsw (4 * 0x46), %si
582 +# Check that there IS a hd1 :-)
592 + movw %cs, %ax # aka SETUPSEG
593 + subw $DELTA_INITSEG, %ax # aka INITSEG
602 +# check for Micro Channel (MCA) bus
603 + movw %cs, %ax # aka SETUPSEG
604 + subw $DELTA_INITSEG, %ax # aka INITSEG
607 + movw %ax, (0xa0) # set table length to 0
610 + int $0x15 # moves feature table to es:bx
616 + movw %cs, %ax # aka SETUPSEG
617 + subw $DELTA_INITSEG, %ax # aka INITSEG
622 + addw $2, %cx # table length is a short
626 + movw $0x10, %cx # we keep only first 16 bytes
632 +#ifdef CONFIG_X86_VOYAGER
633 + movb $0xff, 0x40 # flag on config found
636 + int $0x15 # put voyager config info at es:di
638 + movw $0x40, %si # place voyager info in apm table
642 + movb %es:(%di), %al
650 +# Check for PS/2 pointing device
651 + movw %cs, %ax # aka SETUPSEG
652 + subw $DELTA_INITSEG, %ax # aka INITSEG
654 + movb $0, (0x1ff) # default is no pointing device
655 + int $0x11 # int 0x11: equipment list
656 + testb $0x04, %al # check if mouse installed
659 + movb $0xAA, (0x1ff) # device present
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
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
680 + jc done_apm_bios # Nope, no APM BIOS
682 + cmpw $0x0504d, %bx # Check for "PM" signature
683 + jne done_apm_bios # No signature, no APM BIOS
685 + andw $0x02, %cx # Is 32 bit supported?
686 + je done_apm_bios # No 32-bit, no (good) APM BIOS
688 + movw $0x05304, %ax # Disconnect first just in case
690 + int $0x15 # ignore return code
691 + movw $0x05303, %ax # 32 bit connect
693 + xorw %cx, %cx # paranoia :-)
694 + xorw %dx, %dx # ...
695 + xorl %esi, %esi # ...
696 + xorw %di, %di # ...
698 + jc no_32_apm_bios # Ack, error.
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
710 + xorw %cx, %cx # paranoia
712 + jc apm_disconnect # error -> shouldn't happen
714 + cmpw $0x0504d, %bx # check for "PM" signature
715 + jne apm_disconnect # no sig -> shouldn't happen
717 + movw %ax, (64) # record the APM BIOS version
718 + movw %cx, (76) # and flags
721 +apm_disconnect: # Tidy up
722 + movw $0x05304, %ax # Disconnect
724 + int $0x15 # ignore return code
729 + andw $0xfffd, (76) # remove 32 bit support bit
735 +# Now we want to move to protected mode ...
736 + cmpw $0, %cs:realmode_swtch
737 + jz rmodeswtch_normal
739 + lcall *%cs:realmode_swtch
745 + call default_switch
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
753 + # .. or else we have a high
755 + jmp end_move # ... and we skip moving
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
764 + movw %ax, %es # destination segment
765 + incb %ah # instead of add ax,#0x100
766 + movw %bx, %ds # source segment
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
782 +# then we load the segment descriptors
783 + movw %cs, %ax # aka SETUPSEG
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
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.
798 + cmpw $SETUPSEG, %ax
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
811 + subw %ax, %dx # this will go into %ss after
815 + movw $INITSEG, %ax # real INITSEG
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
824 + subw $move_self_here+0x200, %cx
827 + ljmp $SETUPSEG, $move_self_here
830 + movw $move_self_here+0x200, %cx
833 + movw $SETUPSEG, %ax
836 +end_move_self: # now we are at the right place
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.
844 +#if defined(CONFIG_X86_ELAN)
845 + movb $0x02, %al # alternate A20 gate
846 + outb %al, $0x92 # this works on SC410/SC520
854 +A20_TEST_LOOPS = 32 # Iterations per wait
855 +A20_ENABLE_LOOPS = 255 # Total loops to try
858 +#ifndef CONFIG_X86_VOYAGER
861 + # First, see if we are on a system with no A20 gate.
866 + # Next, try the BIOS (INT 0x15, AX=0x2401)
869 + pushfl # Be paranoid about flags
876 + # Try enabling A20 through the keyboard controller
877 +#endif /* CONFIG_X86_VOYAGER */
881 +#ifndef CONFIG_X86_VOYAGER
882 + call a20_test # Just in case the BIOS worked
883 + jnz a20_done # but had a delayed reaction.
886 + movb $0xD1, %al # command write
890 + movb $0xDF, %al # A20 on
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
903 + loop a20_kbc_wait_loop
905 + # Final attempt: use "configuration port A"
907 + inb $0x92, %al # Configuration Port A
908 + orb $0x02, %al # "fast A20" version
909 + andb $0xFE, %al # don't accidentally reset
912 + # Wait for configuration port A to take effect
918 + loop a20_fast_wait_loop
920 + # A20 is still not responding. Try frobbing it again.
925 + movw $a20_err_msg, %si
933 + .byte A20_ENABLE_LOOPS
936 + .ascii "linux: fatal error: A20 gate not responding!"
939 + # If we get here, all is good
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)
950 + movl %eax, (gdt_48+2)
951 + lgdt gdt_48 # load gdt with whatever is
954 +# make sure any possible coprocessor is properly reset..
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
968 + movb $0xFB, %al # mask all irq's but irq2 which
969 + outb %al, $0x21 # is cascaded
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.
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.
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!
989 + xorw %bx, %bx # Flag to indicate a boot
990 + xorl %esi, %esi # Pointer to real-mode code
992 + subw $DELTA_INITSEG, %si
993 + shll $4, %esi # Convert to 32-bit pointer
995 +# jump to startup_32 in arch/i386/boot/compressed/head.S
997 +# NOTE: For high loaded big kernels we need a
998 +# jmpi 0x100000,__BOOT_CS
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)
1006 + .byte 0x66, 0xea # prefix + jmpi-opcode
1007 +code32: .long startup_32 # will be set to %cs+startup_32
1011 + movl $(__BOOT_DS), %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
1024 + # Jump to the 32bit entry point
1025 + jmpl *(code32_start - start + (DELTA_INITSEG << 4))(%esi)
1028 +# Here's a bunch of information about your current kernel..
1029 +kernel_version: .ascii UTS_RELEASE
1031 + .ascii LINUX_COMPILE_BY
1033 + .ascii LINUX_COMPILE_HOST
1035 + .ascii UTS_VERSION
1038 +# This is the default real mode switch routine.
1039 +# to be called just before protected mode transition
1041 + cli # no interrupts allowed !
1042 + movb $0x80, %al # disable NMI for bootup
1048 +#ifndef CONFIG_X86_VOYAGER
1049 +# This routine tests whether or not A20 is enabled. If so, it
1050 +# exits with zf = 0.
1052 +# The memory address used, 0x200, is the int $0x80 vector, which
1055 +A20_TEST_ADDR = 4*0x80
1061 + movw %cx, %fs # Low memory
1063 + movw %cx, %gs # High memory area
1064 + movw $A20_TEST_LOOPS, %cx
1065 + movw %fs:(A20_TEST_ADDR), %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
1074 + popw %fs:(A20_TEST_ADDR)
1079 +#endif /* CONFIG_X86_VOYAGER */
1081 +# This routine checks that the keyboard command queue is empty
1082 +# (after emptying the output buffers)
1084 +# Some machines have delusions that the keyboard buffer is always full
1085 +# with no keyboard attached...
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
1097 + movl $100000, %ecx
1101 + jz empty_8042_end_loop
1105 + inb $0x64, %al # 8042 status port
1106 + testb $1, %al # output buffer?
1110 + inb $0x60, %al # read it
1111 + jmp empty_8042_loop
1114 + testb $2, %al # is input buffer full?
1115 + jnz empty_8042_loop # yes - loop
1116 +empty_8042_end_loop:
1120 +# Read the cmos clock. Return the seconds in al
1125 + movb %dh, %al # %dh contains the seconds
1134 +# Delay is needed after doing I/O
1139 +# Descriptor tables
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).
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.
1153 + .fill GDT_ENTRY_BOOT_CS,8,0
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)
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)
1169 + .word 0 # alignment byte
1171 + .word 0 # idt limit = 0
1172 + .word 0, 0 # idt base = 0L
1174 + .word 0 # alignment byte
1176 + .word gdt_end - gdt - 1 # gdt limit
1177 + .word 0, 0 # gdt base (filled in later)
1179 +#ifndef CONFIG_VGA_NOPROBE
1180 +# Include video setup & detection code
1185 +# Setup signature -- must be last
1186 +setup_sig1: .word SIG1
1187 +setup_sig2: .word SIG2
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).
1200 diff --git a/arch/i386/configs/olpc_defconfig b/arch/i386/configs/olpc_defconfig
1201 new file mode 100644
1202 index 0000000..f1675e8
1204 +++ b/arch/i386/configs/olpc_defconfig
1207 +# Automatically generated make config: don't edit
1208 +# Linux kernel version: 2.6.22-rc5
1209 +# Wed Jun 20 08:26:53 2007
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
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
1228 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
1231 +# Code maturity level options
1233 +CONFIG_EXPERIMENTAL=y
1234 +CONFIG_BROKEN_ON_SMP=y
1235 +CONFIG_LOCK_KERNEL=y
1236 +CONFIG_INIT_ENV_ARG_LIMIT=32
1241 +CONFIG_LOCALVERSION=""
1242 +# CONFIG_LOCALVERSION_AUTO is not set
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
1253 +CONFIG_AUDITSYSCALL=y
1254 +# CONFIG_IKCONFIG is not set
1255 +CONFIG_LOG_BUF_SHIFT=17
1256 +# CONFIG_SYSFS_DEPRECATED is not set
1258 +CONFIG_BLK_DEV_INITRD=y
1259 +CONFIG_INITRAMFS_SOURCE=""
1260 +CONFIG_CC_OPTIMIZE_FOR_SIZE=y
1264 +# CONFIG_SYSCTL_SYSCALL is not set
1266 +# CONFIG_KALLSYMS_ALL is not set
1267 +CONFIG_KALLSYMS_EXTRA_PASS=y
1272 +# CONFIG_BASE_FULL is not set
1274 +CONFIG_ANON_INODES=y
1280 +CONFIG_VM_EVENT_COUNTERS=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
1289 +# Loadable module support
1292 +CONFIG_MODULE_UNLOAD=y
1293 +# CONFIG_MODULE_FORCE_UNLOAD is not set
1294 +CONFIG_MODVERSIONS=y
1295 +CONFIG_MODULE_SRCVERSION_ALL=y
1302 +# CONFIG_LBD is not set
1303 +# CONFIG_BLK_DEV_IO_TRACE is not set
1304 +# CONFIG_LSF is not set
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"
1320 +# Processor type and features
1322 +CONFIG_TICK_ONESHOT=y
1324 +CONFIG_HIGH_RES_TIMERS=y
1325 +# CONFIG_SMP is not set
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
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
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
1371 +CONFIG_X86_POPAD_OK=y
1372 +CONFIG_X86_USE_PPRO_CHECKSUM=y
1373 +CONFIG_X86_USE_3DNOW=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
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
1394 +# CONFIG_EDD is not set
1395 +# CONFIG_DELL_RBU is not set
1396 +# CONFIG_DCDBAS is not set
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
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
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
1426 +# CONFIG_HZ_250 is not set
1427 +# CONFIG_HZ_300 is not set
1428 +# CONFIG_HZ_1000 is not set
1431 +CONFIG_PHYSICAL_START=0x400000
1432 +# CONFIG_RELOCATABLE is not set
1433 +CONFIG_PHYSICAL_ALIGN=0x100000
1434 +# CONFIG_COMPAT_VDSO is not set
1437 +# Power management options (ACPI, APM)
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=""
1449 +# ACPI (Advanced Configuration and Power Interface) Support
1451 +# CONFIG_ACPI is not set
1452 +# CONFIG_APM is not set
1455 +# CPU Frequency scaling
1457 +# CONFIG_CPU_FREQ is not set
1460 +# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
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
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
1480 +CONFIG_OPEN_FIRMWARE=y
1483 +# PCCARD (PCMCIA/CardBus) support
1485 +# CONFIG_PCCARD is not set
1486 +# CONFIG_HOTPLUG_PCI is not set
1489 +# Executable file formats
1491 +CONFIG_BINFMT_ELF=y
1492 +# CONFIG_BINFMT_AOUT is not set
1493 +CONFIG_BINFMT_MISC=y
1501 +# Networking options
1504 +CONFIG_PACKET_MMAP=y
1508 +# CONFIG_XFRM_SUB_POLICY is not set
1509 +CONFIG_XFRM_MIGRATE=y
1511 +CONFIG_NET_KEY_MIGRATE=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
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
1560 +CONFIG_IPV6_PRIVACY=y
1561 +CONFIG_IPV6_ROUTER_PREF=y
1562 +CONFIG_IPV6_ROUTE_INFO=y
1563 +CONFIG_IPV6_OPTIMISTIC_DAD=y
1566 +CONFIG_INET6_IPCOMP=m
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
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
1581 +# CONFIG_NETFILTER_DEBUG is not set
1584 +# Core Netfilter Configuration
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
1638 +# IP: Netfilter Configuration
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
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
1675 +# IPv6: Netfilter Configuration (EXPERIMENTAL)
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
1696 +# QoS and/or fair queueing
1699 +CONFIG_NET_SCH_FIFO=y
1702 +# Queueing/Scheduling
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
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
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
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
1763 +# CONFIG_CFG80211 is not set
1764 +CONFIG_WIRELESS_EXT=y
1765 +# CONFIG_MAC80211 is not set
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
1780 +# Generic Driver Options
1782 +CONFIG_STANDALONE=y
1783 +CONFIG_PREVENT_FIRMWARE_BUILD=y
1785 +# CONFIG_DEBUG_DRIVER is not set
1786 +# CONFIG_DEBUG_DEVRES is not set
1787 +# CONFIG_SYS_HYPERVISOR is not set
1790 +# Connector - unified userspace <-> kernelspace linker
1792 +# CONFIG_CONNECTOR is not set
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
1801 +# User Modules And Translation Layers
1804 +CONFIG_MTD_BLKDEVS=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
1815 +# RAM/ROM/Flash chip drivers
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
1834 +# Mapping drivers for chip access
1836 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
1837 +# CONFIG_MTD_TS5500 is not set
1838 +# CONFIG_MTD_PLATRAM is not set
1841 +# Self-contained MTD device drivers
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
1850 +# Disk-On-Chip Device Drivers
1852 +# CONFIG_MTD_DOC2000 is not set
1853 +# CONFIG_MTD_DOC2001 is not set
1854 +# CONFIG_MTD_DOC2001PLUS is not set
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
1868 +# UBI - Unsorted block images
1870 +# CONFIG_MTD_UBI is not set
1873 +# Parallel port support
1875 +# CONFIG_PARPORT is not set
1878 +# Plug and Play support
1880 +# CONFIG_PNPACPI is not set
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
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
1912 +CONFIG_IDE_MAX_HWIFS=4
1913 +CONFIG_BLK_DEV_IDE=m
1916 +# Please see Documentation/ide.txt for help/info on IDE drives
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
1930 +# IDE chipset support/bugfixes
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
1977 +# SCSI device support
1979 +# CONFIG_RAID_ATTRS is not set
1981 +# CONFIG_SCSI_TGT is not set
1982 +# CONFIG_SCSI_NETLINK is not set
1983 +CONFIG_SCSI_PROC_FS=y
1986 +# SCSI support type (disk, tape, CD-ROM)
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
1997 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
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
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
2015 +# SCSI low-level drivers
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
2055 +# Multi-device support (RAID and LVM)
2057 +# CONFIG_MD is not set
2060 +# Fusion MPT device support
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
2068 +# IEEE 1394 (FireWire) support
2070 +# CONFIG_FIREWIRE is not set
2071 +# CONFIG_IEEE1394 is not set
2074 +# I2O device support
2076 +# CONFIG_I2O is not set
2077 +# CONFIG_MACINTOSH_DRIVERS is not set
2080 +# Network device support
2082 +CONFIG_NETDEVICES=y
2085 +# CONFIG_BONDING is not set
2086 +# CONFIG_EQUALIZER is not set
2088 +# CONFIG_ARCNET is not set
2089 +# CONFIG_PHYLIB is not set
2092 +# Ethernet (10 or 100Mbit)
2094 +CONFIG_NET_ETHERNET=y
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
2102 +# Tulip family network device support
2104 +# CONFIG_NET_TULIP is not set
2105 +# CONFIG_HP100 is not set
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
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
2157 +# CONFIG_WLAN_PRE80211 is not set
2158 +CONFIG_WLAN_80211=y
2159 +# CONFIG_IPW2100 is not set
2160 +# CONFIG_IPW2200 is not set
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
2178 +# USB Network Adapters
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
2206 +CONFIG_PPP_MULTILINK=y
2207 +CONFIG_PPP_FILTER=y
2209 +CONFIG_PPP_SYNC_TTY=m
2210 +CONFIG_PPP_DEFLATE=m
2211 +# CONFIG_PPP_BSDCOMP is not set
2215 +CONFIG_SLIP_COMPRESSED=y
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
2223 +CONFIG_NETPOLL_TRAP=y
2224 +CONFIG_NET_POLL_CONTROLLER=y
2229 +# CONFIG_ISDN is not set
2232 +# Telephony Support
2234 +# CONFIG_PHONE is not set
2237 +# Input device support
2240 +# CONFIG_INPUT_FF_MEMLESS is not set
2241 +# CONFIG_INPUT_POLLDEV is not set
2244 +# Userland interfaces
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
2256 +# Input Device Drivers
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
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
2291 +# Hardware I/O ports
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
2300 +# CONFIG_GAMEPORT is not set
2303 +# Character devices
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
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
2326 +# Non-8250 serial port support
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
2337 +# CONFIG_IPMI_HANDLER is not set
2339 +# CONFIG_WATCHDOG_NOWAYOUT is not set
2342 +# Watchdog Device Drivers
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
2370 +# PCI-based Watchdog Cards
2372 +# CONFIG_PCIPCWATCHDOG is not set
2373 +# CONFIG_WDTPCI is not set
2376 +# USB-based Watchdog Cards
2378 +# CONFIG_USBPCWATCHDOG is not set
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
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
2402 +# CONFIG_TCG_TPM is not set
2403 +# CONFIG_TELCLOCK is not set
2406 +CONFIG_I2C_BOARDINFO=y
2407 +CONFIG_I2C_CHARDEV=m
2412 +# CONFIG_I2C_ALGOBIT is not set
2413 +# CONFIG_I2C_ALGOPCF is not set
2414 +# CONFIG_I2C_ALGOPCA is not set
2417 +# I2C Hardware Bus support
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
2444 +# Miscellaneous I2C Chip support
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
2461 +# CONFIG_SPI is not set
2462 +# CONFIG_SPI_MASTER is not set
2465 +# Dallas's 1-wire bus
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
2476 +# Multifunction device drivers
2478 +# CONFIG_MFD_SM501 is not set
2481 +# Multimedia devices
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
2492 +# Encoders/decoders and other helper chips
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
2510 +CONFIG_VIDEO_OV7670=y
2511 +# CONFIG_VIDEO_SAA711X is not set
2512 +# CONFIG_VIDEO_TVP5150 is not set
2515 +# Video and audio decoders
2517 +# CONFIG_VIDEO_CX25840 is not set
2520 +# MPEG video encoders
2522 +# CONFIG_VIDEO_CX2341X is not set
2527 +# CONFIG_VIDEO_SAA7127 is not set
2530 +# Video improvement chips
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
2554 +# CONFIG_USB_DABUSB is not set
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
2565 +# Display device support
2567 +# CONFIG_DISPLAY_SUPPORT is not set
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
2587 +# Frame buffer hardware drivers
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
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
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
2629 +# Console display driver support
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
2639 +# CONFIG_FONT_8x8 is not set
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
2650 +# CONFIG_LOGO_LINUX_MONO is not set
2651 +# CONFIG_LOGO_LINUX_VGA16 is not set
2652 +CONFIG_LOGO_LINUX_CLUT224=y
2660 +# Advanced Linux Sound Architecture
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
2683 +CONFIG_SND_MPU401_UART=m
2684 +CONFIG_SND_AC97_CODEC=y
2686 +CONFIG_SND_VIRMIDI=m
2688 +# CONFIG_SND_SERIAL_U16550 is not set
2689 +CONFIG_SND_MPU401=m
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
2756 +CONFIG_SND_USB_AUDIO=m
2757 +CONFIG_SND_USB_USX2Y=m
2758 +# CONFIG_SND_USB_CAIAQ is not set
2761 +# System on Chip audio support
2763 +# CONFIG_SND_SOC is not set
2766 +# Open Sound System
2768 +# CONFIG_SOUND_PRIME is not set
2775 +# CONFIG_HID_DEBUG is not set
2778 +# USB Input Devices
2781 +# CONFIG_USB_HIDINPUT_POWERBOOK is not set
2782 +# CONFIG_HID_FF is not set
2783 +CONFIG_USB_HIDDEV=y
2788 +CONFIG_USB_ARCH_HAS_HCD=y
2789 +CONFIG_USB_ARCH_HAS_OHCI=y
2790 +CONFIG_USB_ARCH_HAS_EHCI=y
2792 +# CONFIG_USB_DEBUG is not set
2795 +# Miscellaneous USB options
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
2805 +# USB Host Controller Drivers
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
2821 +# USB Device Class drivers
2824 +CONFIG_USB_PRINTER=m
2827 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
2831 +# may also be needed; see USB_STORAGE Help for more information
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
2847 +# USB Imaging devices
2849 +# CONFIG_USB_MDC800 is not set
2850 +# CONFIG_USB_MICROTEK is not set
2858 +# USB Serial Converter support
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
2900 +# USB Miscellaneous drivers
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
2924 +# USB DSL modem support
2928 +# USB Gadget Support
2930 +# CONFIG_USB_GADGET is not set
2932 +# CONFIG_MMC_DEBUG is not set
2933 +# CONFIG_MMC_UNSAFE_RESUME is not set
2936 +# MMC/SD Card Drivers
2941 +# MMC/SD Host Controller Drivers
2944 +# CONFIG_MMC_WBSD is not set
2945 +# CONFIG_MMC_TIFM_SD is not set
2951 +CONFIG_LEDS_CLASS=y
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
2966 +# InfiniBand support
2968 +# CONFIG_INFINIBAND is not set
2971 +# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
2973 +# CONFIG_EDAC is not set
2980 +# CONFIG_RTC_HCTOSYS is not set
2981 +# CONFIG_RTC_DEBUG is not set
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
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
3009 +# Platform RTC drivers
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
3018 +# on-CPU RTC drivers
3022 +# DMA Engine support
3024 +# CONFIG_DMA_ENGINE is not set
3037 +# CONFIG_KVM is not set
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
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
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
3070 +CONFIG_INOTIFY_USER=y
3072 +# CONFIG_QFMT_V1 is not set
3077 +CONFIG_AUTOFS4_FS=m
3078 +# CONFIG_FUSE_FS is not set
3081 +# CD-ROM/DVD Filesystems
3083 +CONFIG_ISO9660_FS=m
3090 +# DOS/FAT/NT Filesystems
3095 +CONFIG_FAT_DEFAULT_CODEPAGE=437
3096 +CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
3097 +# CONFIG_NTFS_FS is not set
3100 +# Pseudo filesystems
3103 +CONFIG_PROC_KCORE=y
3104 +CONFIG_PROC_SYSCTL=y
3107 +# CONFIG_TMPFS_POSIX_ACL is not set
3109 +CONFIG_HUGETLB_PAGE=y
3112 +# CONFIG_CONFIGFS_FS is not set
3115 +# Miscellaneous filesystems
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
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
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
3145 +# Network File Systems
3149 +# CONFIG_NFS_V3_ACL is not set
3151 +CONFIG_NFS_DIRECTIO=y
3152 +# CONFIG_NFSD is not set
3155 +CONFIG_NFS_COMMON=y
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
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
3191 +# Native Language Support
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
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
3235 +# Distributed Lock Manager
3237 +# CONFIG_DLM is not set
3240 +# Instrumentation Support
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
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
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
3286 +# Page alloc debug is incompatible with Software Suspend on i386
3288 +CONFIG_DEBUG_RODATA=y
3290 +CONFIG_DOUBLEFAULT=y
3296 +CONFIG_KEYS_DEBUG_PROC_KEYS=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
3313 +# Cryptographic options
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
3358 +# Hardware crypto devices
3360 +# CONFIG_CRYPTO_DEV_PADLOCK is not set
3361 +CONFIG_CRYPTO_DEV_GEODE=y
3366 +CONFIG_BITREVERSE=y
3369 +# CONFIG_CRC_ITU_T is not set
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
3383 +CONFIG_HAS_IOPORT=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
3393 +++ b/arch/i386/configs/xs_defconfig
3396 +# Automatically generated make config: don't edit
3397 +# Linux kernel version: 2.6.22-rc5
3398 +# Wed Jun 20 08:26:53 2007
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
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
3417 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
3420 +# Code maturity level options
3422 +CONFIG_EXPERIMENTAL=y
3423 +CONFIG_BROKEN_ON_SMP=y
3424 +CONFIG_LOCK_KERNEL=y
3425 +CONFIG_INIT_ENV_ARG_LIMIT=32
3430 +CONFIG_LOCALVERSION=""
3431 +# CONFIG_LOCALVERSION_AUTO is not set
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
3442 +CONFIG_AUDITSYSCALL=y
3443 +# CONFIG_IKCONFIG is not set
3444 +CONFIG_LOG_BUF_SHIFT=17
3445 +# CONFIG_SYSFS_DEPRECATED is not set
3447 +CONFIG_BLK_DEV_INITRD=y
3448 +CONFIG_INITRAMFS_SOURCE=""
3449 +CONFIG_CC_OPTIMIZE_FOR_SIZE=y
3453 +# CONFIG_SYSCTL_SYSCALL is not set
3455 +# CONFIG_KALLSYMS_ALL is not set
3456 +CONFIG_KALLSYMS_EXTRA_PASS=y
3461 +# CONFIG_BASE_FULL is not set
3463 +CONFIG_ANON_INODES=y
3469 +CONFIG_VM_EVENT_COUNTERS=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
3478 +# Loadable module support
3481 +CONFIG_MODULE_UNLOAD=y
3482 +# CONFIG_MODULE_FORCE_UNLOAD is not set
3483 +CONFIG_MODVERSIONS=y
3484 +CONFIG_MODULE_SRCVERSION_ALL=y
3491 +# CONFIG_LBD is not set
3492 +# CONFIG_BLK_DEV_IO_TRACE is not set
3493 +# CONFIG_LSF is not set
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"
3509 +# Processor type and features
3511 +CONFIG_TICK_ONESHOT=y
3513 +CONFIG_HIGH_RES_TIMERS=y
3514 +# CONFIG_SMP is not set
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
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
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
3560 +CONFIG_X86_POPAD_OK=y
3561 +CONFIG_X86_CMPXCHG64=y
3562 +CONFIG_X86_USE_PPRO_CHECKSUM=y
3563 +CONFIG_X86_USE_3DNOW=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
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
3584 +# CONFIG_EDD is not set
3585 +# CONFIG_DELL_RBU is not set
3586 +# CONFIG_DCDBAS is not set
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
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
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
3616 +# CONFIG_HZ_250 is not set
3617 +# CONFIG_HZ_300 is not set
3618 +# CONFIG_HZ_1000 is not set
3621 +CONFIG_PHYSICAL_START=0x400000
3622 +# CONFIG_RELOCATABLE is not set
3623 +CONFIG_PHYSICAL_ALIGN=0x100000
3624 +# CONFIG_COMPAT_VDSO is not set
3627 +# Power management options (ACPI, APM)
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=""
3640 +# ACPI (Advanced Configuration and Power Interface) Support
3642 +# CONFIG_ACPI is not set
3643 +# CONFIG_APM is not set
3646 +# CPU Frequency scaling
3648 +# CONFIG_CPU_FREQ is not set
3651 +# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
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
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
3671 +CONFIG_OPEN_FIRMWARE=y
3674 +# PCCARD (PCMCIA/CardBus) support
3676 +# CONFIG_PCCARD is not set
3677 +# CONFIG_HOTPLUG_PCI is not set
3680 +# Executable file formats
3682 +CONFIG_BINFMT_ELF=y
3683 +# CONFIG_BINFMT_AOUT is not set
3684 +CONFIG_BINFMT_MISC=y
3692 +# Networking options
3695 +CONFIG_PACKET_MMAP=y
3699 +# CONFIG_XFRM_SUB_POLICY is not set
3700 +CONFIG_XFRM_MIGRATE=y
3702 +CONFIG_NET_KEY_MIGRATE=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
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
3751 +CONFIG_IPV6_PRIVACY=y
3752 +CONFIG_IPV6_ROUTER_PREF=y
3753 +CONFIG_IPV6_ROUTE_INFO=y
3754 +CONFIG_IPV6_OPTIMISTIC_DAD=y
3757 +CONFIG_INET6_IPCOMP=m
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
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
3772 +# CONFIG_NETFILTER_DEBUG is not set
3775 +# Core Netfilter Configuration
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
3829 +# IP: Netfilter Configuration
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
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
3866 +# IPv6: Netfilter Configuration (EXPERIMENTAL)
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
3887 +# QoS and/or fair queueing
3890 +CONFIG_NET_SCH_FIFO=y
3893 +# Queueing/Scheduling
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
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
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
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
3954 +# CONFIG_CFG80211 is not set
3955 +CONFIG_WIRELESS_EXT=y
3956 +# CONFIG_MAC80211 is not set
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
3971 +# Generic Driver Options
3973 +CONFIG_STANDALONE=y
3974 +CONFIG_PREVENT_FIRMWARE_BUILD=y
3976 +# CONFIG_DEBUG_DRIVER is not set
3977 +# CONFIG_DEBUG_DEVRES is not set
3978 +# CONFIG_SYS_HYPERVISOR is not set
3981 +# Connector - unified userspace <-> kernelspace linker
3983 +# CONFIG_CONNECTOR is not set
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
3995 +# User Modules And Translation Layers
3998 +CONFIG_MTD_BLKDEVS=m
4000 +CONFIG_MTD_BLOCK_RO=m
4006 +# CONFIG_SSFDC is not set
4009 +# RAM/ROM/Flash chip drivers
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
4031 +CONFIG_MTD_ABSENT=m
4034 +# Mapping drivers for chip access
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
4052 +# CONFIG_MTD_PLATRAM is not set
4055 +# Self-contained MTD device drivers
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
4068 +# Disk-On-Chip Device Drivers
4070 +# CONFIG_MTD_DOC2000 is not set
4071 +# CONFIG_MTD_DOC2001 is not set
4072 +# CONFIG_MTD_DOC2001PLUS is not set
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
4089 +# UBI - Unsorted block images
4091 +# CONFIG_MTD_UBI is not set
4094 +# Parallel port support
4096 +# CONFIG_PARPORT is not set
4099 +# Plug and Play support
4101 +# CONFIG_PNPACPI is not set
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
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
4134 +CONFIG_IDE_MAX_HWIFS=4
4135 +CONFIG_BLK_DEV_IDE=m
4138 +# Please see Documentation/ide.txt for help/info on IDE drives
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
4152 +# IDE chipset support/bugfixes
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
4199 +# SCSI device support
4201 +# CONFIG_RAID_ATTRS is not set
4203 +# CONFIG_SCSI_TGT is not set
4204 +# CONFIG_SCSI_NETLINK is not set
4205 +CONFIG_SCSI_PROC_FS=y
4208 +# SCSI support type (disk, tape, CD-ROM)
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
4219 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
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
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
4237 +# SCSI low-level drivers
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
4277 +# Multi-device support (RAID and LVM)
4279 +# CONFIG_MD is not set
4282 +# Fusion MPT device support
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
4290 +# IEEE 1394 (FireWire) support
4292 +# CONFIG_FIREWIRE is not set
4293 +# CONFIG_IEEE1394 is not set
4296 +# I2O device support
4298 +# CONFIG_I2O is not set
4303 +# CONFIG_BATTERY_CLASS is not set
4304 +# CONFIG_MACINTOSH_DRIVERS is not set
4307 +# Network device support
4309 +CONFIG_NETDEVICES=y
4312 +# CONFIG_BONDING is not set
4313 +# CONFIG_EQUALIZER is not set
4315 +# CONFIG_ARCNET is not set
4316 +# CONFIG_PHYLIB is not set
4319 +# Ethernet (10 or 100Mbit)
4321 +CONFIG_NET_ETHERNET=y
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
4329 +# Tulip family network device support
4331 +# CONFIG_NET_TULIP is not set
4332 +# CONFIG_HP100 is not set
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
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
4383 +# CONFIG_WLAN_PRE80211 is not set
4384 +CONFIG_WLAN_80211=y
4385 +# CONFIG_IPW2100 is not set
4386 +# CONFIG_IPW2200 is not set
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
4404 +# USB Network Adapters
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
4432 +CONFIG_PPP_MULTILINK=y
4433 +CONFIG_PPP_FILTER=y
4435 +CONFIG_PPP_SYNC_TTY=m
4436 +CONFIG_PPP_DEFLATE=m
4437 +# CONFIG_PPP_BSDCOMP is not set
4441 +CONFIG_SLIP_COMPRESSED=y
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
4449 +CONFIG_NETPOLL_TRAP=y
4450 +CONFIG_NET_POLL_CONTROLLER=y
4455 +# CONFIG_ISDN is not set
4458 +# Telephony Support
4460 +# CONFIG_PHONE is not set
4463 +# Input device support
4466 +# CONFIG_INPUT_FF_MEMLESS is not set
4467 +# CONFIG_INPUT_POLLDEV is not set
4470 +# Userland interfaces
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
4482 +# Input Device Drivers
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
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
4517 +# Hardware I/O ports
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
4526 +# CONFIG_GAMEPORT is not set
4529 +# Character devices
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
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
4552 +# Non-8250 serial port support
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
4563 +# CONFIG_IPMI_HANDLER is not set
4565 +# CONFIG_WATCHDOG_NOWAYOUT is not set
4568 +# Watchdog Device Drivers
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
4596 +# PCI-based Watchdog Cards
4598 +# CONFIG_PCIPCWATCHDOG is not set
4599 +# CONFIG_WDTPCI is not set
4602 +# USB-based Watchdog Cards
4604 +# CONFIG_USBPCWATCHDOG is not set
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
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
4628 +# CONFIG_TCG_TPM is not set
4629 +# CONFIG_TELCLOCK is not set
4632 +CONFIG_I2C_BOARDINFO=y
4633 +CONFIG_I2C_CHARDEV=m
4638 +# CONFIG_I2C_ALGOBIT is not set
4639 +# CONFIG_I2C_ALGOPCF is not set
4640 +# CONFIG_I2C_ALGOPCA is not set
4643 +# I2C Hardware Bus support
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
4670 +# Miscellaneous I2C Chip support
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
4687 +# CONFIG_SPI is not set
4688 +# CONFIG_SPI_MASTER is not set
4691 +# Dallas's 1-wire bus
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
4702 +# Multifunction device drivers
4704 +# CONFIG_MFD_SM501 is not set
4707 +# Multimedia devices
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
4718 +# Encoders/decoders and other helper chips
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
4736 +CONFIG_VIDEO_OV7670=m
4737 +# CONFIG_VIDEO_SAA711X is not set
4738 +# CONFIG_VIDEO_TVP5150 is not set
4741 +# Video and audio decoders
4743 +# CONFIG_VIDEO_CX25840 is not set
4746 +# MPEG video encoders
4748 +# CONFIG_VIDEO_CX2341X is not set
4753 +# CONFIG_VIDEO_SAA7127 is not set
4756 +# Video improvement chips
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
4780 +# CONFIG_USB_DABUSB is not set
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
4791 +# Display device support
4793 +# CONFIG_DISPLAY_SUPPORT is not set
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
4813 +# Frame buffer hardware drivers
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
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
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
4855 +# Console display driver support
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
4865 +# CONFIG_FONT_8x8 is not set
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
4876 +# CONFIG_LOGO_LINUX_MONO is not set
4877 +# CONFIG_LOGO_LINUX_VGA16 is not set
4878 +CONFIG_LOGO_LINUX_CLUT224=y
4886 +# Advanced Linux Sound Architecture
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
4909 +CONFIG_SND_MPU401_UART=m
4910 +CONFIG_SND_AC97_CODEC=m
4912 +CONFIG_SND_VIRMIDI=m
4914 +# CONFIG_SND_SERIAL_U16550 is not set
4915 +CONFIG_SND_MPU401=m
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
4982 +CONFIG_SND_USB_AUDIO=m
4983 +CONFIG_SND_USB_USX2Y=m
4984 +# CONFIG_SND_USB_CAIAQ is not set
4987 +# System on Chip audio support
4989 +# CONFIG_SND_SOC is not set
4992 +# Open Sound System
4994 +# CONFIG_SOUND_PRIME is not set
5001 +# CONFIG_HID_DEBUG is not set
5004 +# USB Input Devices
5007 +# CONFIG_USB_HIDINPUT_POWERBOOK is not set
5008 +# CONFIG_HID_FF is not set
5009 +CONFIG_USB_HIDDEV=y
5014 +CONFIG_USB_ARCH_HAS_HCD=y
5015 +CONFIG_USB_ARCH_HAS_OHCI=y
5016 +CONFIG_USB_ARCH_HAS_EHCI=y
5018 +# CONFIG_USB_DEBUG is not set
5021 +# Miscellaneous USB options
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
5031 +# USB Host Controller Drivers
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
5047 +# USB Device Class drivers
5050 +CONFIG_USB_PRINTER=m
5053 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
5057 +# may also be needed; see USB_STORAGE Help for more information
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
5073 +# USB Imaging devices
5075 +# CONFIG_USB_MDC800 is not set
5076 +# CONFIG_USB_MICROTEK is not set
5084 +# USB Serial Converter support
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
5126 +# USB Miscellaneous drivers
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
5150 +# USB DSL modem support
5154 +# USB Gadget Support
5156 +# CONFIG_USB_GADGET is not set
5158 +# CONFIG_MMC_DEBUG is not set
5159 +# CONFIG_MMC_UNSAFE_RESUME is not set
5162 +# MMC/SD Card Drivers
5167 +# MMC/SD Host Controller Drivers
5170 +# CONFIG_MMC_WBSD is not set
5171 +# CONFIG_MMC_TIFM_SD is not set
5177 +CONFIG_LEDS_CLASS=y
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
5193 +# InfiniBand support
5195 +# CONFIG_INFINIBAND is not set
5198 +# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
5200 +# CONFIG_EDAC is not set
5207 +# CONFIG_RTC_HCTOSYS is not set
5208 +# CONFIG_RTC_DEBUG is not set
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
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
5236 +# Platform RTC drivers
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
5245 +# on-CPU RTC drivers
5249 +# DMA Engine support
5251 +# CONFIG_DMA_ENGINE is not set
5264 +# CONFIG_KVM is not set
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
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
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
5297 +CONFIG_INOTIFY_USER=y
5299 +# CONFIG_QFMT_V1 is not set
5304 +CONFIG_AUTOFS4_FS=m
5305 +# CONFIG_FUSE_FS is not set
5308 +# CD-ROM/DVD Filesystems
5310 +CONFIG_ISO9660_FS=y
5317 +# DOS/FAT/NT Filesystems
5322 +CONFIG_FAT_DEFAULT_CODEPAGE=437
5323 +CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
5324 +# CONFIG_NTFS_FS is not set
5327 +# Pseudo filesystems
5330 +CONFIG_PROC_KCORE=y
5331 +CONFIG_PROC_SYSCTL=y
5334 +# CONFIG_TMPFS_POSIX_ACL is not set
5336 +CONFIG_HUGETLB_PAGE=y
5339 +# CONFIG_CONFIGFS_FS is not set
5342 +# Miscellaneous filesystems
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
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
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
5371 +# Network File Systems
5375 +CONFIG_NFS_V3_ACL=y
5377 +CONFIG_NFS_DIRECTIO=y
5378 +# CONFIG_NFSD is not set
5381 +CONFIG_NFS_ACL_SUPPORT=m
5382 +CONFIG_NFS_COMMON=y
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
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
5418 +# Native Language Support
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
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
5462 +# Distributed Lock Manager
5464 +# CONFIG_DLM is not set
5467 +# Instrumentation Support
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
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
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
5513 +# Page alloc debug is incompatible with Software Suspend on i386
5515 +CONFIG_DEBUG_RODATA=y
5517 +CONFIG_DOUBLEFAULT=y
5523 +CONFIG_KEYS_DEBUG_PROC_KEYS=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
5540 +# Cryptographic options
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
5585 +# Hardware crypto devices
5587 +# CONFIG_CRYPTO_DEV_PADLOCK is not set
5588 +CONFIG_CRYPTO_DEV_GEODE=y
5593 +CONFIG_BITREVERSE=y
5596 +# CONFIG_CRC_ITU_T is not set
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
5610 +CONFIG_HAS_IOPORT=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
5627 obj-$(CONFIG_VMI) += vmi.o vmiclock.o
5628 obj-$(CONFIG_PARAVIRT) += paravirt.o
5629 obj-y += pcspeaker.o
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
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);
5645 static int __init geode_southbridge_init(void)
5653 + timers = geode_mfgpt_detect();
5654 + printk(KERN_INFO "geode-mfgpt: %d timers available.\n", timers);
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
5667 +#ifdef CONFIG_OPEN_FIRMWARE
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.
5676 + movl $(boot_params - __PAGE_OFFSET + OFW_INFO_OFFSET), %ebp
5677 + cmpl $0x2057464F, (%ebp) /* Magic number "OFW " */
5680 + mov 0x8(%ebp), %eax /* Save callback address */
5681 + mov %eax, call_firmware - __PAGE_OFFSET
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 */
5690 + movl %edx, %esi /* restore %esi */
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...
5702 page_pde_offset = (__PAGE_OFFSET >> 20);
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
5709 +++ b/arch/i386/kernel/mfgpt.c
5711 +/* Driver/API for AMD Geode Multi-Function General Purpose Timers (MFGPT)
5713 + * Copyright (C) 2006, Advanced Micro Devices, Inc.
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.
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.
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:
5733 + Divisor Hz Min Delta (S) Max Delta (S)
5734 + 1 32000 .0005 2.048
5735 + 2 16000 .001 4.096
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
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>
5752 +#include "do_timer.h"
5754 +#define MFGPT_MAX_TIMERS 8
5756 +#define F_AVAIL 0x01
5758 +static struct mfgpt_timer_t {
5760 + struct module *owner;
5761 +} mfgpt_timers[MFGPT_MAX_TIMERS];
5763 +/* Selected from the table above */
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)
5770 +#ifdef CONFIG_GEODE_MFGPT_TIMER
5771 +static int __init mfgpt_timer_setup(void);
5773 +#define mfgpt_timer_setup() (0)
5776 +/* Allow for disabling of MFGPTs */
5777 +static int disable = 0;
5778 +static int __init mfgpt_disable(char *s)
5783 +__setup("nomfgpt", mfgpt_disable);
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.
5792 +int __init geode_mfgpt_detect(void)
5798 + printk(KERN_INFO "geode-mfgpt: Skipping MFGPT setup\n");
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;
5810 + /* set up clock event device, if desired */
5811 + i = mfgpt_timer_setup();
5816 +int geode_mfgpt_toggle_event(int timer, int cmp, int event, int enable)
5818 + u32 msr, mask, value, dummy;
5819 + int shift = (cmp == MFGPT_CMP1) ? 0 : 8;
5821 + if (timer < 0 || timer >= MFGPT_MAX_TIMERS)
5825 + * The register maps for these are described in sections 6.17.1.x of
5826 + * the AMD Geode CS5536 Companion Device Data Book.
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
5833 + msr = MFGPT_NR_MSR;
5834 + mask = 1 << (timer + 24);
5837 + case MFGPT_EVENT_NMI:
5838 + msr = MFGPT_NR_MSR;
5839 + mask = 1 << (timer + shift);
5842 + case MFGPT_EVENT_IRQ:
5843 + msr = MFGPT_IRQ_MSR;
5844 + mask = 1 << (timer + shift);
5851 + rdmsr(msr, value, dummy);
5858 + wrmsr(msr, value, dummy);
5861 +EXPORT_SYMBOL(geode_mfgpt_toggle_event);
5863 +int geode_mfgpt_set_irq(int timer, int cmp, int irq, int enable)
5868 + if (timer < 0 || timer >= MFGPT_MAX_TIMERS)
5871 + if (geode_mfgpt_toggle_event(timer, cmp, MFGPT_EVENT_IRQ, enable))
5874 + rdmsr(0x51400022, val, dummy);
5876 + offset = (timer % 4) * 4;
5878 + val &= ~((0xF << offset) | (0xF << (offset + 16)));
5881 + val |= (irq & 0x0F) << (offset);
5882 + val |= (irq & 0x0F) << (offset + 16);
5885 + wrmsr(0x51400022, val, dummy);
5888 +EXPORT_SYMBOL(geode_mfgpt_set_irq);
5890 +static int mfgpt_get(int timer, struct module *owner)
5892 + mfgpt_timers[timer].flags &= ~F_AVAIL;
5893 + mfgpt_timers[timer].owner = owner;
5894 + printk(KERN_INFO "geode-mfgpt: Registered timer %d\n", timer);
5898 +int geode_mfgpt_alloc_timer(int timer, int domain, struct module *owner)
5902 + if (!geode_get_dev_base(GEODE_DEV_MFGPT))
5904 + if (timer >= MFGPT_MAX_TIMERS)
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);
5913 + if (i == 5 && domain == MFGPT_DOMAIN_WORKING)
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);
5923 + /* No timers available - too bad */
5926 +EXPORT_SYMBOL(geode_mfgpt_alloc_timer);
5928 +#ifdef CONFIG_GEODE_MFGPT_TIMER
5930 +static unsigned int mfgpt_tick_mode = CLOCK_EVT_MODE_SHUTDOWN;
5931 +static u16 mfgpt_event_clock;
5933 +static int irq = 7;
5934 +static int __init mfgpt_setup(char *str)
5936 + get_option(&str, &irq);
5939 +__setup("mfgpt_irq=", mfgpt_setup);
5941 +static inline void mfgpt_disable_timer(u16 clock)
5943 + u16 val = geode_mfgpt_read(clock, MFGPT_REG_SETUP);
5944 + geode_mfgpt_write(clock, MFGPT_REG_SETUP, val & ~MFGPT_SETUP_CNTEN);
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 *);
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,
5956 + .cpumask = CPU_MASK_ALL,
5960 +static inline void mfgpt_start_timer(u16 clock, u16 delta)
5962 + geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_CMP2, (u16) delta);
5963 + geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_COUNTER, 0);
5965 + geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP,
5966 + MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2);
5969 +static void mfgpt_set_mode(enum clock_event_mode mode,
5970 + struct clock_event_device *evt)
5972 + mfgpt_disable_timer(mfgpt_event_clock);
5974 + if (mode == CLOCK_EVT_MODE_PERIODIC)
5975 + mfgpt_start_timer(mfgpt_event_clock, MFGPT_PERIODIC);
5977 + mfgpt_tick_mode = mode;
5980 +static int mfgpt_next_event(unsigned long delta, struct clock_event_device *evt)
5982 + mfgpt_start_timer(mfgpt_event_clock, delta);
5986 +/* Assume (foolishly?), that this interrupt was due to our tick */
5988 +static irqreturn_t mfgpt_tick(int irq, void *dev_id)
5990 + if (mfgpt_tick_mode == CLOCK_EVT_MODE_SHUTDOWN)
5991 + return IRQ_HANDLED;
5993 + /* Turn off the clock */
5994 + mfgpt_disable_timer(mfgpt_event_clock);
5996 + /* Clear the counter */
5997 + geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_COUNTER, 0);
5999 + /* Restart the clock in periodic mode */
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);
6006 + mfgpt_clockevent.event_handler(&mfgpt_clockevent);
6007 + return IRQ_HANDLED;
6010 +static struct irqaction mfgptirq = {
6011 + .handler = mfgpt_tick,
6012 + .flags = IRQF_DISABLED | IRQF_NOBALANCING,
6013 + .mask = CPU_MASK_NONE,
6014 + .name = "mfgpt-timer"
6017 +static int __init mfgpt_timer_setup(void)
6022 + timer = geode_mfgpt_alloc_timer(MFGPT_TIMER_ANY, MFGPT_DOMAIN_WORKING, THIS_MODULE);
6024 + printk(KERN_ERR "mfgpt-timer: Could not allocate a MFPGT timer\n");
6028 + mfgpt_event_clock = timer;
6029 + /* Set the clock scale and enable the event mode for CMP2 */
6030 + val = MFGPT_SCALE | (3 << 8);
6032 + geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP, val);
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);
6040 + /* And register it with the kernel */
6041 + ret = setup_irq(irq, &mfgptirq);
6044 + printk(KERN_ERR "mfgpt-timer: Unable to set up the interrupt.\n");
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);
6053 + printk("mfgpt-timer: registering the MFGT timer as a clock event.\n");
6054 + clockevents_register_device(&mfgpt_clockevent);
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");
6065 diff --git a/arch/i386/kernel/ofw.c b/arch/i386/kernel/ofw.c
6066 new file mode 100644
6067 index 0000000..fdcd936
6069 +++ b/arch/i386/kernel/ofw.c
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.
6077 + * Copyright (C) 2007 Mitch Bradley <wmb@firmworks.com>
6078 + * Copyright (C) 2007 Andres Salomon <dilinger@debian.org>
6081 +#include <stdarg.h>
6082 +#include <linux/spinlock.h>
6083 +#include <linux/module.h>
6084 +#include <asm/ofw.h>
6087 +int (*call_firmware)(int *);
6089 +static DEFINE_SPINLOCK(prom_lock);
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.
6099 + * Here are call templates for all the standard OFW client services:
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);
6132 +int ofw(char *name, int numargs, int numres, ...)
6135 + int argarray[MAXARGS+3];
6139 + unsigned long flags;
6141 + if (!call_firmware)
6143 + if ((numargs + numres) > MAXARGS)
6144 + return -1; /* spit out an error? */
6146 + argarray[0] = (int) name;
6147 + argarray[1] = numargs;
6148 + argarray[2] = numres;
6150 + va_start(ap, numres);
6152 + argarray[argnum++] = va_arg(ap, int);
6156 + spin_lock_irqsave(&prom_lock, flags);
6157 + retval = call_firmware(argarray);
6158 + spin_unlock_irqrestore(&prom_lock, flags);
6160 + if (retval == 0) {
6162 + intp = va_arg(ap, int *);
6163 + *intp = argarray[argnum++];
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
6175 +++ b/arch/i386/kernel/olpc-pm.c
6178 + * © 2006 Red Hat, Inc.
6179 + * Portions also copyright 2006 Advanced Micro Devices, Inc.
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>
6195 +#include <asm/olpc.h>
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
6203 + http://www.amd.com/files/connectivitysolutions/geode/geode_gx/34472D_CS5536_B1_specupdate.pdf
6208 +#define CS5536_PM_PWRBTN (1 << 8)
6209 +#define CS5536_PM_RTC (1 << 10)
6211 +#define GPIO_WAKEUP_EC (1 << 31)
6212 +#define GPIO_WAKEUP_LID (1 << 30)
6214 +#define PM_MODE_NORMAL 0
6215 +#define PM_MODE_TEST 1
6216 +#define PM_MODE_MAX 2
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
6222 +extern void do_olpc_suspend_lowlevel(void);
6225 + unsigned long address;
6226 + unsigned short segment;
6227 +} ofw_bios_entry = { 0, __KERNEL_CS };
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;
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;
6240 +static int gpio_wake_events = 0;
6241 +static int ebook_state = -1;
6242 +static u16 olpc_wakeup_mask = 0;
6244 +struct platform_device olpc_powerbutton_dev = {
6245 + .name = "powerbutton",
6249 +struct platform_device olpc_lid_dev = {
6254 +static void __init init_ebook_state(void)
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");
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);
6267 +static void (*battery_callback)(unsigned long);
6268 +static DEFINE_SPINLOCK(battery_callback_lock);
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)
6274 + unsigned char data = 0;
6275 + unsigned char battery_events = 0;
6279 + ret = olpc_ec_cmd(0x84, NULL, 0, &data, 1);
6281 + printk(KERN_DEBUG "olpc-pm: SCI 0x%x received\n",
6285 + case EC_SCI_SRC_EMPTY:
6286 + case EC_SCI_SRC_GAME:
6287 + case EC_SCI_SRC_WLAN:
6288 + /* we ignore these for now */
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;
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);
6306 + printk(KERN_ERR "olpc-pm: Unknown SCI event 0x%x occurred!\n", data);
6309 + } while (data && !ret);
6311 + if (battery_events && battery_callback && propagate_events) {
6312 + void (*cbk)(unsigned long);
6314 + /* Older EC versions didn't distinguish between AC and battery
6316 + if (olpc_platform_info.ecver < 0x45)
6317 + battery_events = EC_SCI_SRC_BATTERY | EC_SCI_SRC_ACPWR;
6319 + spin_lock(&battery_callback_lock);
6320 + cbk = battery_callback;
6321 + spin_unlock(&battery_callback_lock);
6323 + cbk(battery_events);
6327 + printk(KERN_WARNING "Failed to clear SCI queue!\n");
6330 +static DECLARE_WORK(sci_work, process_sci_queue);
6332 +void olpc_register_battery_callback(void (*f)(unsigned long))
6334 + spin_lock(&battery_callback_lock);
6335 + battery_callback = f;
6336 + spin_unlock(&battery_callback_lock);
6338 +EXPORT_SYMBOL_GPL(olpc_register_battery_callback);
6340 +void olpc_deregister_battery_callback(void)
6342 + spin_lock(&battery_callback_lock);
6343 + battery_callback = NULL;
6344 + spin_unlock(&battery_callback_lock);
6345 + cancel_work_sync(&sci_work);
6347 +EXPORT_SYMBOL_GPL(olpc_deregister_battery_callback);
6350 +static int olpc_pm_interrupt(int irq, void *id)
6352 + uint32_t sts, gpe = 0;
6354 + sts = inl(acpi_base + PM1_STS);
6355 + outl(sts | 0xFFFF, acpi_base + PM1_STS);
6357 + if (olpc_get_rev() >= OLPC_REV_B2) {
6358 + gpe = inl(acpi_base + PM_GPE0_STS);
6359 + outl(0xFFFFFFFF, acpi_base + PM_GPE0_STS);
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);
6371 + if (gpe & GPIO_WAKEUP_EC) {
6372 + geode_gpio_clear(OLPC_GPIO_ECSCI, GPIO_NEGATIVE_EDGE_STS);
6373 + schedule_work(&sci_work);
6376 + if (gpe & GPIO_WAKEUP_LID) {
6377 + /* Disable events */
6378 + geode_gpio_clear(OLPC_GPIO_LID, GPIO_EVENTS_ENABLE);
6380 + /* Clear the edge */
6382 + if (olpc_lid_flag)
6383 + geode_gpio_clear(OLPC_GPIO_LID, GPIO_NEGATIVE_EDGE_EN);
6385 + geode_gpio_clear(OLPC_GPIO_LID, GPIO_POSITIVE_EDGE_EN);
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);
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
6396 + input_report_switch(lid_inputdev, SW_LID, olpc_lid_flag);
6397 + input_sync(lid_inputdev);
6399 + /* Swap the status */
6400 + olpc_lid_flag = !olpc_lid_flag;
6402 + if (olpc_lid_flag)
6403 + geode_gpio_set(OLPC_GPIO_LID, GPIO_NEGATIVE_EDGE_EN);
6405 + geode_gpio_set(OLPC_GPIO_LID, GPIO_POSITIVE_EDGE_EN);
6407 + /* re-enable the event */
6408 + geode_gpio_set(OLPC_GPIO_LID, GPIO_EVENTS_ENABLE);
6411 + return IRQ_HANDLED;
6415 + * For now, only support STR. We also don't support suspending on
6416 + * B1s, due to difficulties with the cafe FPGA.
6418 +static int olpc_pm_state_valid(suspend_state_t pm_state)
6420 + if (pm_state == PM_SUSPEND_MEM && olpc_rev_after(OLPC_REV_B1))
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
6433 +extern void gxfb_flatpanel_control(int state);
6435 +static u32 gpio_wakeup[2];
6436 +static u64 irq_sources[4];
6437 +static u64 mfgpt_irq_msr, mfgpt_nr_msr;
6439 +void olpc_fixup_wakeup(void)
6441 + u32 base = geode_gpio_base();
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
6449 + outl((CS5536_PM_PWRBTN << 16) | 0xFFFF, acpi_base + PM1_STS);
6451 + /* Enable the flatpanel sequencing as early as possible, because
6452 + it takes ~64ms to resume. This probably belongs in the firmware */
6454 + //gxfb_flatpanel_control(1);
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]);
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);
6466 + /* Resture the MFGPT MSRs */
6467 + wrmsrl(MFGPT_IRQ_MSR, mfgpt_irq_msr);
6468 + wrmsrl(MFGPT_NR_MSR, mfgpt_nr_msr);
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);
6476 +void olpc_fixup_sleep(void)
6478 + u32 base = geode_gpio_base();
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);
6485 + /* Save the Y and Z unrestricted sources */
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]);
6492 + /* Turn off the MFGPT timers on the way down */
6494 + for(i = 0; i < 8; i++) {
6495 + u32 val = geode_mfgpt_read(i, MFGPT_REG_SETUP);
6497 + if (val & MFGPT_SETUP_SETUP) {
6498 + val &= ~MFGPT_SETUP_CNTEN;
6499 + geode_mfgpt_write(i, MFGPT_REG_SETUP, val);
6503 + /* Save the MFGPT MSRs */
6504 + rdmsrl(MFGPT_IRQ_MSR, mfgpt_irq_msr);
6505 + rdmsrl(MFGPT_NR_MSR, mfgpt_nr_msr);
6507 + if (device_may_wakeup(&olpc_powerbutton_dev.dev))
6508 + olpc_wakeup_mask |= CS5536_PM_PWRBTN;
6510 + olpc_wakeup_mask &= ~(CS5536_PM_PWRBTN);
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;
6516 + geode_gpio_clear(OLPC_GPIO_LID, GPIO_EVENTS_ENABLE);
6517 + gpio_wake_events &= ~(GPIO_WAKEUP_LID);
6521 +static int olpc_pm_enter(suspend_state_t pm_state)
6523 + /* Only STR is supported */
6524 + if (pm_state != PM_SUSPEND_MEM)
6527 + olpc_fixup_sleep();
6529 + /* Set the GPIO wakeup bits */
6530 + outl(gpio_wake_events, acpi_base + PM_GPE0_EN);
6531 + outl(0xFFFFFFFF, acpi_base + PM_GPE0_STS);
6533 + /* Save CPU state */
6534 + do_olpc_suspend_lowlevel();
6536 + olpc_fixup_wakeup();
6538 + /* Restore the SCI wakeup events */
6539 + outl(gpio_wake_events, acpi_base + PM_GPE0_EN);
6544 +int asmlinkage olpc_do_sleep(u8 sleep_state)
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 */
6552 + /* FIXME: Set any other SCI events that we might want here */
6554 + outl((olpc_wakeup_mask << 16) | 0xFFFF, acpi_base + PM1_STS);
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 */
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));
6569 +/* This code will slowly disappear as we fixup the issues in the BIOS */
6571 +static void __init olpc_fixup_bios(void)
6573 + unsigned long hi, lo;
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.
6581 + /* Change the PM registers to decode to the DD */
6583 + rdmsr(0x510100e2, lo, hi);
6585 + wrmsr(0x510100e2, lo, hi);
6587 + /* Change the ACPI registers to decode to the DD */
6589 + rdmsr(0x510100e3, lo, hi);
6591 + wrmsr(0x510100e3, lo, hi);
6594 + /* GPIO24 controls WORK_AUX */
6596 + geode_gpio_set(OLPC_GPIO_WORKAUX, GPIO_OUTPUT_ENABLE);
6597 + geode_gpio_set(OLPC_GPIO_WORKAUX, GPIO_OUTPUT_AUX1);
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);
6604 + /* Set up to get LID events */
6605 + geode_gpio_set(OLPC_GPIO_LID, GPIO_INPUT_ENABLE);
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);
6612 + geode_gpio_set(OLPC_GPIO_LID, GPIO_NEGATIVE_EDGE_STS);
6613 + geode_gpio_set(OLPC_GPIO_LID, GPIO_POSITIVE_EDGE_STS);
6615 + /* Set the LID to cause an PME event on group 6 */
6616 + geode_gpio_event_pme(OLPC_GPIO_LID, 6);
6618 + /* Set PME group 6 to fire the SCI interrupt */
6619 + geode_gpio_set_irq(6, sci_irq);
6622 + geode_gpio_set(OLPC_GPIO_ECSCI, GPIO_INPUT_ENABLE);
6624 + /* Clear pending events */
6626 + geode_gpio_set(OLPC_GPIO_ECSCI, GPIO_NEGATIVE_EDGE_STS);
6627 + geode_gpio_set(OLPC_GPIO_ECSCI, GPIO_POSITIVE_EDGE_STS);
6629 + //geode_gpio_set(OLPC_GPIO_ECSCI, GPIO_NEGATIVE_EDGE_EN);
6630 + geode_gpio_set(OLPC_GPIO_ECSCI, GPIO_EVENTS_ENABLE);
6632 + /* Set the SCI to cause a PME event on group 7 */
6633 + geode_gpio_event_pme(OLPC_GPIO_ECSCI, 7);
6635 + /* And have group 6 also fire the SCI interrupt */
6636 + geode_gpio_set_irq(7, sci_irq);
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
6645 +static const char * const pm_states[] = {
6646 + [PM_MODE_NORMAL] = "normal",
6647 + [PM_MODE_TEST] = "test",
6650 +extern struct mutex pm_mutex;
6651 +extern struct kset power_subsys;
6653 +static ssize_t control_show(struct kset *s, char *buf)
6655 + return sprintf(buf, "%s\n", pm_states[olpc_pm_mode]);
6658 +static ssize_t control_store(struct kset *s, const char *buf, size_t n)
6663 + p = memchr(buf, '\n', n);
6664 + len = p ? p - buf : n;
6666 + /* Grab the mutex */
6667 + mutex_lock(&pm_mutex);
6669 + for(i = 0; i < PM_MODE_MAX; i++) {
6670 + if (!strncmp(buf, pm_states[i], len)) {
6676 + mutex_unlock(&pm_mutex);
6678 + return (i == PM_MODE_MAX) ? -EINVAL : n;
6681 +static struct subsys_attribute control_attr = {
6683 + .name = "olpc-pm",
6686 + .show = control_show,
6687 + .store = control_store,
6690 +static struct attribute * olpc_attributes[] = {
6691 + &control_attr.attr,
6695 +static struct attribute_group olpc_attrs = {
6696 + .attrs = olpc_attributes,
6699 +static int __init alloc_inputdevs(void)
6701 + int ret = -ENOMEM;
6703 + pm_inputdev = input_allocate_device();
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);
6712 + ret = input_register_device(pm_inputdev);
6714 + printk(KERN_ERR "olpc-pm: failed to register PM input device: %d\n", ret);
6718 + lid_inputdev = input_allocate_device();
6719 + if (!lid_inputdev)
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);
6727 + ret = input_register_device(lid_inputdev);
6729 + printk(KERN_ERR "olpc-pm: failed to register lid input device: %d\n", ret);
6733 + ebook_inputdev = input_allocate_device();
6734 + if (!ebook_inputdev)
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);
6742 + ret = input_register_device(ebook_inputdev);
6744 + printk(KERN_ERR "olpc-pm: failed to register ebook input device: %d\n", ret);
6750 + if (ebook_inputdev) {
6751 + input_unregister_device(ebook_inputdev);
6752 + ebook_inputdev = NULL;
6754 + if (lid_inputdev) {
6755 + input_unregister_device(lid_inputdev);
6756 + lid_inputdev = NULL;
6758 + if (pm_inputdev) {
6759 + input_unregister_device(pm_inputdev);
6760 + pm_inputdev = NULL;
6766 +static int __init olpc_pm_init(void)
6772 + if (!machine_is_olpc())
6775 + acpi_base = geode_acpi_base();
6776 + pms_base = geode_pms_base();
6778 + if (!acpi_base || !pms_base)
6781 + ret = alloc_inputdevs();
6785 + rdmsr(0x51400020, lo, hi);
6786 + sci_irq = (lo >> 20) & 15;
6789 + printk(KERN_INFO "SCI is mapped to IRQ %d\n", sci_irq);
6791 + /* Zero doesn't mean zero -- it means masked */
6792 + printk(KERN_INFO "SCI unmapped. Mapping to IRQ 3\n");
6795 + wrmsrl(0x51400020, lo);
6798 + olpc_fixup_bios();
6800 + lo = inl(pms_base + PM_FSD);
6802 + /* Lock, enable failsafe, 4 seconds */
6803 + outl(0xc001f400, pms_base + PM_FSD);
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
6810 + outl(inl(acpi_base) | ((CS5536_PM_PWRBTN) << 16), acpi_base);
6812 + if (olpc_get_rev() >= OLPC_REV_B2) {
6813 + gpio_wake_events |= GPIO_WAKEUP_LID;
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);
6818 + /* Watch for the opposite edge */
6820 + if (olpc_lid_flag)
6821 + geode_gpio_set(OLPC_GPIO_LID, GPIO_NEGATIVE_EDGE_EN);
6823 + geode_gpio_set(OLPC_GPIO_LID, GPIO_POSITIVE_EDGE_EN);
6825 + /* Enable the event */
6826 + geode_gpio_set(OLPC_GPIO_LID, GPIO_EVENTS_ENABLE);
6829 + /* Set up the mask for wakeups the EC will generate SCIs on */
6831 + ret = olpc_ec_cmd(EC_READ_SCI_MASK, NULL, 0, &ec_byte, 1);
6833 + printk(KERN_ERR "Error getting the EC SCI mask: %d\n", ret);
6835 + /* Disable battery 1% charge wakeups */
6836 + ec_byte &= ~EC_SCI_SRC_BATSOC;
6838 + ret = olpc_ec_cmd(EC_WRITE_SCI_MASK, &ec_byte, 1, NULL, 0);
6840 + printk(KERN_ERR "Error setting the EC SCI mask: %d\n", ret);
6842 + /* Set up the EC SCI */
6844 + gpio_wake_events |= GPIO_WAKEUP_EC;
6846 + outl(gpio_wake_events, acpi_base + PM_GPE0_EN);
6847 + outl(0xFFFFFFFF, acpi_base + PM_GPE0_STS);
6849 + /* Select level triggered in PIC */
6851 + if (sci_irq < 8) {
6853 + lo |= 1 << sci_irq;
6857 + lo |= 1 << (sci_irq - 8);
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();
6865 + /* Enable the interrupt */
6867 + ret = request_irq(sci_irq, &olpc_pm_interrupt, 0, "SCI", &acpi_base);
6870 + printk(KERN_ERR "Error registering SCI: %d\n", ret);
6874 + ofw_bios_entry.address = 0xF0000 + PAGE_OFFSET;
6875 + pm_set_ops(&olpc_pm_ops);
6877 + sysfs_create_group(&power_subsys.kobj, &olpc_attrs);
6883 +#if defined (CONFIG_RTC_DRV_CMOS) || defined (CONFIG_RTC_DRV_CMOS_MODULE)
6884 +struct resource rtc_platform_resource[2] = {
6886 + .flags = IORESOURCE_IO,
6887 + .start = RTC_PORT(0),
6888 + .end = RTC_PORT(0) + RTC_IO_EXTENT
6891 + .flags = IORESOURCE_IRQ,
6898 +static void rtc_wake_on(struct device *dev)
6900 + olpc_wakeup_mask |= CS5536_PM_RTC;
6903 +static void rtc_wake_off(struct device *dev)
6905 + olpc_wakeup_mask &= ~(CS5536_PM_RTC);
6908 +static struct cmos_rtc_board_info rtc_info = {
6909 + .rtc_day_alarm = 0,
6910 + .rtc_mon_alarm = 0,
6912 + .wake_on = rtc_wake_on,
6913 + .wake_off = rtc_wake_off,
6916 +struct platform_device olpc_rtc_device = {
6917 + .name = "rtc_cmos",
6919 + .num_resources = ARRAY_SIZE(rtc_platform_resource),
6920 + .dev.platform_data = &rtc_info,
6921 + .resource = rtc_platform_resource,
6924 +static int __init olpc_platform_init(void)
6926 + (void)platform_device_register(&olpc_rtc_device);
6927 + device_init_wakeup(&olpc_rtc_device.dev, 1);
6929 + (void)platform_device_register(&olpc_powerbutton_dev);
6930 + device_init_wakeup(&olpc_powerbutton_dev.dev, 1);
6932 + (void)platform_device_register(&olpc_lid_dev);
6933 + device_init_wakeup(&olpc_lid_dev.dev, 1);
6937 +arch_initcall(olpc_platform_init);
6938 +#endif /* CONFIG_RTC_DRV_CMOS */
6940 +static void olpc_pm_exit(void)
6942 + /* Clear any pending events, and disable them */
6943 + outl(0xFFFF, acpi_base+2);
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);
6951 +static struct pm_ops olpc_pm_ops = {
6952 + .valid = olpc_pm_state_valid,
6953 + .enter = olpc_pm_enter,
6956 +module_init(olpc_pm_init);
6957 +module_exit(olpc_pm_exit);
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
6966 +++ b/arch/i386/kernel/olpc-sleep.S
6970 +ENTRY(olpc_sleep_asm)
6972 + ;; Get the value of PM1_CNT and store it off
6980 + ;; flush the cache
6983 + ;; GX2 must disable refresh before going into self-refresh
6984 + mov 2000000180xh, ecx
6987 + and 0FF0000FFh, eax
6990 + ;; Now, put the memory into self refresh
6997 + ;; Thats all she wrote - time to go to sleep
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
7011 +++ b/arch/i386/kernel/olpc-wakeup.S
7014 +#include <linux/linkage.h>
7015 +#include <asm/segment.h>
7016 +#include <asm/page.h>
7027 + # Clear any dangerous flags
7033 + movl $swsusp_pg_dir - __PAGE_OFFSET, %eax
7036 + movl saved_cr4, %eax
7039 + movl saved_cr0, %eax
7044 + ljmpl $__KERNEL_CS,$wakeup_return
7050 + movw $__KERNEL_DS, %ax
7060 + ljmp $(__KERNEL_CS),$1f
7066 + # Go back to the return point
7076 + movl %edx, saved_cr4
7079 + movl %edx, saved_cr0
7084 + movl %ebx, saved_context_ebx
7085 + movl %ebp, saved_context_ebp
7086 + movl %esi, saved_context_esi
7087 + movl %edi, saved_context_edi
7090 + popl saved_context_eflags
7096 + movl saved_context_ebp, %ebp
7097 + movl saved_context_ebx, %ebx
7098 + movl saved_context_esi, %esi
7099 + movl saved_context_edi, %edi
7101 + pushl saved_context_eflags
7107 +ENTRY(do_olpc_suspend_lowlevel)
7108 + call save_processor_state
7109 + call save_registers
7111 + # This is the stack context we want to remember
7112 + movl %esp, saved_context_esp
7115 + call olpc_do_sleep
7120 + movl saved_context_esp, %esp
7122 + call restore_registers
7123 + call restore_processor_state
7129 +saved_gdt: .long 0,0
7130 +saved_idt: .long 0,0
7135 diff --git a/arch/i386/kernel/olpc.c b/arch/i386/kernel/olpc.c
7136 new file mode 100644
7137 index 0000000..d540cb0
7139 +++ b/arch/i386/kernel/olpc.c
7141 +/* Support for the OLPC DCON and OLPC EC access
7142 + * Copyright (C) 2006, Advanced Micro Devices, Inc.
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.
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>
7157 +#include <asm/olpc.h>
7158 +#include <asm/ofw.h>
7160 +/* This is our new multi-purpose structure used to contain the
7161 + * information about the platform that we detect
7164 +struct olpc_platform_t olpc_platform_info;
7165 +EXPORT_SYMBOL_GPL(olpc_platform_info);
7167 +/*********************************************************************
7168 + * EC locking and access
7169 + *********************************************************************/
7171 +static DEFINE_SPINLOCK(ec_lock);
7173 +/* what the timeout *should* be (in ms) */
7174 +#define EC_BASE_TIMEOUT 20
7176 +/* the timeout that bugs in the EC might force us to actually use */
7177 +static int ec_timeout = EC_BASE_TIMEOUT;
7179 +static int __init olpc_ec_timeout_set(char *str)
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");
7186 + printk(KERN_DEBUG "olpc-ec: using %d ms delay for EC commands.\n",
7190 +__setup("olpc_ec_timeout=", olpc_ec_timeout_set);
7193 + * These *bf_status functions return whether the buffers are full or not.
7196 +static inline unsigned int ibf_status(unsigned int port)
7198 + return inb(port) & 0x02;
7201 +static inline unsigned int obf_status(unsigned int port)
7203 + return inb(port) & 0x01;
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)
7209 + unsigned int timeo;
7210 + int state = ibf_status(port);
7212 + for (timeo = ec_timeout; state != desired && timeo; timeo--) {
7214 + state = ibf_status(port);
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);
7223 + return !(state == desired);
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)
7229 + unsigned int timeo;
7230 + int state = obf_status(port);
7232 + for (timeo = ec_timeout; state != desired && timeo; timeo--) {
7234 + state = obf_status(port);
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);
7243 + return !(state == desired);
7246 +int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen,
7247 + unsigned char *outbuf, size_t outlen)
7249 + unsigned long flags;
7253 + spin_lock_irqsave(&ec_lock, flags);
7255 + if (wait_on_ibf(0x6c, 0)) {
7256 + printk(KERN_ERR "olpc-ec: timeout waiting for EC to "
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.
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..
7271 + printk(KERN_DEBUG "olpc-ec: running cmd 0x%x\n", cmd);
7274 + if (wait_on_ibf(0x6c, 0)) {
7275 + printk(KERN_ERR "olpc-ec: timeout waiting for EC to read "
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");
7288 + printk(KERN_DEBUG "olpc-ec: sending cmd arg 0x%x\n",
7290 + outb(inbuf[i], 0x68);
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");
7301 + outbuf[i] = inb(0x68);
7302 + printk(KERN_DEBUG "olpc-ec: received 0x%x\n",
7309 + spin_unlock_irqrestore(&ec_lock, flags);
7312 +EXPORT_SYMBOL_GPL(olpc_ec_cmd);
7314 +/*********************************************************************
7316 + *********************************************************************/
7318 +static void olpc_power_off(void)
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);
7332 + olpc_ec_cmd(0x08, NULL, 0, (unsigned char *) &olpc_platform_info.ecver, 1);
7335 +/* Check to see if this version of the OLPC board has VSA built
7336 + * in, and set a flag
7339 +static void __init vsa_detect(void)
7343 + outw(0xFC53, 0xAC1C);
7344 + outw(0x0003, 0xAC1C);
7346 + rev = inw(0xAC1E);
7348 + if (rev == 0x4132)
7349 + olpc_platform_info.flags |= OLPC_F_VSA;
7352 +/* Map OFW revisions to what OLPC_REV_* */
7353 +static const char __initdata *olpc_boardrev_str[] = {
7366 +static void __init platform_detect(char *revision, size_t len)
7371 + BUG_ON(ARRAY_SIZE(olpc_boardrev_str) != OLPC_REV_UNKNOWN);
7373 + if (ofw("getprop", 4, 1, NULL, "model", revision, len, &propsize)) {
7374 + printk(KERN_ERR "ofw: getprop call failed!\n");
7377 + if (len < propsize) {
7378 + printk(KERN_ERR "ofw: revision string is too long!\n");
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;
7390 + strncpy(revision, "Unknown", len);
7391 + olpc_platform_info.boardrev = OLPC_REV_UNKNOWN;
7394 +static int olpc_dcon_present = -1;
7395 +module_param(olpc_dcon_present, int, 0444);
7398 + * bit 440; DCON present bit
7401 +#define OLPC_CMOS_DCON_OFFSET (440 / 8)
7402 +#define OLPC_CMOS_DCON_MASK 0x01
7404 +static int __init olpc_init(void)
7406 + unsigned char *romsig;
7407 + char revision[10];
7409 + spin_lock_init(&ec_lock);
7411 + romsig = ioremap(0xffffffc0, 16);
7416 + if (strncmp(romsig, "CL1 Q", 7))
7418 + if (strncmp(romsig+6, romsig+13, 3)) {
7419 + printk(KERN_INFO "OLPC BIOS signature looks invalid. Assuming not OLPC\n");
7422 + printk(KERN_INFO "OLPC board with OpenFirmware: %.16s\n", romsig);
7424 + olpc_platform_info.flags |= OLPC_F_PRESENT;
7426 + pm_power_off = olpc_power_off;
7428 + /* Get the platform revision */
7429 + platform_detect(revision, sizeof(revision));
7431 + /* If olpc_dcon_present isn't set by the command line, then
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;
7442 + if (olpc_dcon_present)
7443 + olpc_platform_info.flags |= OLPC_F_DCON;
7445 + /* Get the EC revision */
7448 + /* Check to see if the VSA exists */
7451 + printk(KERN_INFO "OLPC board revision: %s (EC=%x)\n", revision,
7452 + olpc_platform_info.ecver);
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
7465 +++ b/arch/i386/kernel/prom.c
7468 + * Procedures for creating, accessing and interpreting the device tree.
7470 + * Paul Mackerras August 1996.
7471 + * Copyright (C) 1996-2005 Paul Mackerras.
7473 + * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
7474 + * {engebret|bergner}@us.ibm.com
7476 + * Adapted for sparc64 by David S. Miller davem@davemloft.net
7478 + * Adapter for i386/OLPC by Andres Salomon <dilinger@debian.org>
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.
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>
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
7501 +static struct device_node *allnodes;
7503 +/* use when traversing tree through the allnext, child, sibling,
7504 + * or parent members of struct device_node.
7506 +static DEFINE_RWLOCK(devtree_lock);
7508 +int of_device_is_compatible(const struct device_node *device,
7509 + const char *compat)
7514 + cp = of_get_property(device, "compatible", &cplen);
7517 + while (cplen > 0) {
7518 + if (strncmp(cp, compat, strlen(compat)) == 0)
7520 + l = strlen(cp) + 1;
7527 +EXPORT_SYMBOL(of_device_is_compatible);
7529 +struct device_node *of_get_parent(const struct device_node *node)
7531 + struct device_node *np;
7536 + np = node->parent;
7540 +EXPORT_SYMBOL(of_get_parent);
7542 +struct device_node *of_get_next_child(const struct device_node *node,
7543 + struct device_node *prev)
7545 + struct device_node *next;
7547 + next = prev ? prev->sibling : node->child;
7548 + for (; next != 0; next = next->sibling) {
7554 +EXPORT_SYMBOL(of_get_next_child);
7556 +struct device_node *of_find_node_by_path(const char *path)
7558 + struct device_node *np = allnodes;
7560 + for (; np != 0; np = np->allnext) {
7561 + if (np->full_name != 0 && strcmp(np->full_name, path) == 0)
7567 +EXPORT_SYMBOL(of_find_node_by_path);
7569 +struct device_node *of_find_node_by_phandle(phandle handle)
7571 + struct device_node *np;
7573 + for (np = allnodes; np != 0; np = np->allnext)
7574 + if (np->node == handle)
7579 +EXPORT_SYMBOL(of_find_node_by_phandle);
7581 +struct device_node *of_find_node_by_name(struct device_node *from,
7584 + struct device_node *np;
7586 + np = from ? from->allnext : allnodes;
7587 + for (; np != NULL; np = np->allnext)
7588 + if (np->name != NULL && strcmp(np->name, name) == 0)
7593 +EXPORT_SYMBOL(of_find_node_by_name);
7595 +struct device_node *of_find_node_by_type(struct device_node *from,
7598 + struct device_node *np;
7600 + np = from ? from->allnext : allnodes;
7601 + for (; np != 0; np = np->allnext)
7602 + if (np->type != 0 && strcmp(np->type, type) == 0)
7607 +EXPORT_SYMBOL(of_find_node_by_type);
7609 +struct device_node *of_find_compatible_node(struct device_node *from,
7610 + const char *type, const char *compatible)
7612 + struct device_node *np;
7614 + np = from ? from->allnext : allnodes;
7615 + for (; np != 0; np = np->allnext) {
7617 + && !(np->type != 0 && strcmp(np->type, type) == 0))
7619 + if (of_device_is_compatible(np, compatible))
7625 +EXPORT_SYMBOL(of_find_compatible_node);
7627 +struct property *of_find_property(const struct device_node *np,
7631 + struct property *pp;
7633 + for (pp = np->properties; pp != 0; pp = pp->next) {
7634 + if (strcasecmp(pp->name, name) == 0) {
7636 + *lenp = pp->length;
7642 +EXPORT_SYMBOL(of_find_property);
7645 + * Find a property with a given name for a given node
7646 + * and return the value.
7648 +const void *of_get_property(const struct device_node *np, const char *name,
7651 + struct property *pp = of_find_property(np,name,lenp);
7652 + return pp ? pp->value : NULL;
7654 +EXPORT_SYMBOL(of_get_property);
7656 +int of_getintprop_default(struct device_node *np, const char *name, int def)
7658 + struct property *prop;
7661 + prop = of_find_property(np, name, &len);
7662 + if (!prop || len != 4)
7665 + return *(int *) prop->value;
7667 +EXPORT_SYMBOL(of_getintprop_default);
7669 +int of_n_addr_cells(struct device_node *np)
7675 + ip = of_get_property(np, "#address-cells", NULL);
7678 + } while (np->parent);
7679 + /* No #address-cells property for the root node, default to 2 */
7682 +EXPORT_SYMBOL(of_n_addr_cells);
7684 +int of_n_size_cells(struct device_node *np)
7690 + ip = of_get_property(np, "#size-cells", NULL);
7693 + } while (np->parent);
7694 + /* No #size-cells property for the root node, default to 1 */
7697 +EXPORT_SYMBOL(of_n_size_cells);
7699 +int of_set_property(struct device_node *dp, const char *name, void *val, int len)
7703 +EXPORT_SYMBOL(of_set_property);
7705 +static unsigned int prom_early_allocated;
7707 +static void * __init prom_early_alloc(unsigned long size)
7711 + ret = kmalloc(size, GFP_KERNEL);
7713 + memset(ret, 0, size);
7715 + printk(KERN_ERR "ACK! couldn't allocate prom memory!\n");
7717 + prom_early_allocated += size;
7722 +static int is_root_node(const struct device_node *dp)
7727 + return (dp->parent == NULL);
7730 +static char * __init build_path_component(struct device_node *dp)
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");
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");
7743 + if ((i = strrchr(n, '/')))
7744 + n = ++i; /* we only want the file name */
7748 +static char * __init build_full_name(struct device_node *dp)
7750 + int len, ourlen, plen;
7753 + plen = strlen(dp->parent->full_name);
7754 + ourlen = strlen(dp->path_component_name);
7755 + len = ourlen + plen + 2;
7757 + n = prom_early_alloc(len);
7758 + strcpy(n, dp->parent->full_name);
7759 + if (!is_root_node(dp->parent)) {
7760 + strcpy(n + plen, "/");
7763 + strcpy(n + plen, dp->path_component_name);
7768 +static struct property * __init build_one_prop(phandle node, char *prev, char *special_name, void *special_val, int special_len)
7770 + static struct property *tmp = NULL;
7771 + struct property *p;
7775 + memset(p, 0, sizeof(*p) + 32);
7778 + p = prom_early_alloc(sizeof(struct property) + 32);
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);
7789 + if (prev == NULL) {
7790 + if (ofw("nextprop", 3, 1, node, "", p->name, &fl)) {
7791 + printk(KERN_ERR "PROM: %s: nextprop failed!\n", __func__);
7795 + if (ofw("nextprop", 3, 1, node, prev, p->name, &fl)) {
7796 + printk(KERN_ERR "PROM: %s: nextprop failed!\n", __func__);
7800 + if (strlen(p->name) == 0 || fl != 1) {
7804 + if (ofw("getproplen", 2, 1, node, p->name, &p->length)) {
7805 + printk(KERN_ERR "PROM: %s: getproplen failed!\n", __func__);
7808 + if (p->length <= 0) {
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__);
7816 + ((unsigned char *)p->value)[p->length] = '\0';
7822 +static struct property * __init build_prop_list(phandle node)
7824 + struct property *head, *tail;
7826 + head = tail = build_one_prop(node, NULL,
7827 + ".node", &node, sizeof(node));
7829 + tail->next = build_one_prop(node, NULL, NULL, NULL, 0);
7830 + tail = tail->next;
7832 + tail->next = build_one_prop(node, tail->name,
7834 + tail = tail->next;
7840 +static char * __init get_one_property(phandle node, const char *name)
7842 + char *buf = "<NULL>";
7845 + if (ofw("getproplen", 2, 1, node, name, &len)) {
7846 + printk(KERN_ERR "PROM: %s: getproplen failed!\n", __func__);
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__);
7860 +static struct device_node * __init create_node(phandle node, struct device_node *parent)
7862 + struct device_node *dp;
7867 + dp = prom_early_alloc(sizeof(*dp));
7868 + dp->parent = parent;
7870 + kref_init(&dp->kref);
7872 + dp->name = get_one_property(node, "name");
7873 + dp->type = get_one_property(node, "device_type");
7876 + dp->properties = build_prop_list(node);
7881 +static struct device_node * __init build_tree(struct device_node *parent, phandle node, struct device_node ***nextp)
7883 + struct device_node *ret = NULL, *prev_sibling = NULL;
7884 + struct device_node *dp;
7888 + dp = create_node(node, parent);
7893 + prev_sibling->sibling = dp;
7897 + prev_sibling = dp;
7900 + *nextp = &dp->allnext;
7902 + dp->path_component_name = build_path_component(dp);
7903 + dp->full_name = build_full_name(dp);
7905 + if (ofw("child", 1, 1, node, &child)) {
7906 + printk(KERN_ERR "PROM: %s: fetching child failed!\n", __func__);
7909 + dp->child = build_tree(dp, child, nextp);
7911 + if (ofw("peer", 1, 1, node, &node)) {
7912 + printk(KERN_ERR "PROM: %s: fetching peer failed!\n", __func__);
7920 +static phandle root_node;
7922 +void __init prom_build_devicetree(void)
7924 + struct device_node **nextp;
7927 + if (ofw("peer", 1, 1, 0, &root_node)) {
7928 + printk(KERN_ERR "PROM: unable to get root node from OFW!\n");
7932 + allnodes = create_node(root_node, NULL);
7933 + allnodes->path_component_name = "";
7934 + allnodes->full_name = "/";
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");
7941 + allnodes->child = build_tree(allnodes, child, &nextp);
7942 + printk("PROM: Built device tree with %u bytes of memory.\n",
7943 + prom_early_allocated);
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)
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;
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)
7962 acpi_reserve_bootmem();
7964 +#ifdef CONFIG_OLPC_PM
7965 + reserve_bootmem(0xf0000, PAGE_SIZE);
7967 #ifdef CONFIG_X86_FIND_SMP_CONFIG
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
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);
7990 +#ifdef CONFIG_PCI_OLPC
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
8000 +++ b/arch/i386/pci/olpc.c
8003 + * olpcpci.c - Low-level PCI config space access for OLPC systems
8004 + * without the VSA PCI virtualization software.
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.
8022 +#include <linux/pci.h>
8023 +#include <linux/init.h>
8024 +#include <asm/olpc.h>
8025 +#include <asm/geode.h>
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.
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.
8041 +static const u32 lxnb_hdr[] = { /* dev 1 function 0 - devfn = 8 */
8042 + 0x0 , 0x0 , 0x0 , 0x0 ,
8043 + 0x0 , 0x0 , 0x0 , 0x0 ,
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 ,
8054 +static const u32 gxnb_hdr[] = { /* dev 1 function 0 - devfn = 8 */
8055 + 0xfffffffd , 0x0 , 0x0 , 0x0 ,
8056 + 0x0 , 0x0 , 0x0 , 0x0 ,
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 ,
8067 +static const u32 lxfb_hdr[] = { /* dev 1 function 1 - devfn = 9 */
8068 + 0xff800008 , 0xffffc000 , 0xffffc000 , 0xffffc000 ,
8069 + 0x0 , 0x0 , 0x0 , 0x0 ,
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 ,
8080 +static const u32 gxfb_hdr[] = { /* dev 1 function 1 - devfn = 9 */
8081 + 0xff800008 , 0xffffc000 , 0xffffc000 , 0xffffc000 ,
8082 + 0x0 , 0x0 , 0x0 , 0x0 ,
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 ,
8093 +static const u32 aes_hdr[] = { /* dev 1 function 2 - devfn = 0xa */
8094 + 0xffffc000 , 0x0 , 0x0 , 0x0 ,
8095 + 0x0 , 0x0 , 0x0 , 0x0 ,
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 ,
8107 +static const u32 isa_hdr[] = { /* dev f function 0 - devfn = 78 */
8108 + 0xfffffff9 , 0xffffff01 , 0xffffffc1 , 0xffffffe1 ,
8109 + 0xffffff81 , 0xffffffc1 , 0x0 , 0x0 ,
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 ,
8120 +static const u32 ac97_hdr[] = { /* dev f function 3 - devfn = 7b */
8121 + 0xffffff81 , 0x0 , 0x0 , 0x0 ,
8122 + 0x0 , 0x0 , 0x0 , 0x0 ,
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 ,
8133 +static const u32 ohci_hdr[] = { /* dev f function 4 - devfn = 7c */
8134 + 0xfffff000 , 0x0 , 0x0 , 0x0 ,
8135 + 0x0 , 0x0 , 0x0 , 0x0 ,
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 ,
8146 +static const u32 ehci_hdr[] = { /* dev f function 4 - devfn = 7d */
8147 + 0xfffff000 , 0x0 , 0x0 , 0x0 ,
8148 + 0x0 , 0x0 , 0x0 , 0x0 ,
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) */
8156 + 0x1 , 0x40080000 , 0x0 , 0x0 , /* EECP - see section 2.1.7 of EHCI spec */
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 */
8162 +static u32 ff_loc = ~0;
8163 +static u32 zero_loc = 0;
8165 +static int bar_probing = 0; /* Set after a write of ~0 to a BAR */
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)))
8171 +static u32 *hdr_addr(const u32 *hdr, int reg)
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.
8186 + addr = (u32)hdr + reg + (bar_probing ? -0x10 : 0x20);
8189 + return (u32 *)addr;
8192 +static int pci_olpc_read(unsigned int seg, unsigned int bus,
8193 + unsigned int devfn, int reg, int len, u32 *value)
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);
8202 + * No device has config registers past 0x70, so we save table space
8203 + * by not storing entries for the nonexistent registers
8210 + addr = hdr_addr(is_lx ? lxnb_hdr : gxnb_hdr, reg);
8213 + addr = hdr_addr(is_lx ? lxfb_hdr : gxfb_hdr, reg);
8216 + addr = is_lx ? hdr_addr(aes_hdr, reg) : &ff_loc;
8219 + addr = hdr_addr(isa_hdr, reg);
8222 + addr = hdr_addr(ac97_hdr, reg);
8225 + addr = hdr_addr(ohci_hdr, reg);
8228 + addr = hdr_addr(ehci_hdr, reg);
8237 + *value = *(u8 *) addr;
8240 + *value = *(u16 *) addr;
8252 +static int pci_olpc_write(unsigned int seg, unsigned int bus,
8253 + unsigned int devfn, int reg, int len, u32 value)
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);
8259 + /* XXX we may want to extend this to simulate EHCI power management */
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.
8269 + if ((reg >= 0x10) && (reg < 0x2c)) {
8270 + /* Write is to a BAR */
8275 + * No warning on writes to ROM BAR, CMD, LATENCY_TIMER,
8276 + * CACHE_LINE_SIZE, or PM registers.
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);
8286 +static struct pci_raw_ops pci_olpc_conf = {
8287 + .read = pci_olpc_read,
8288 + .write = pci_olpc_write,
8291 +void __init pci_olpc_init(void)
8293 + if (!machine_is_olpc() || olpc_has_vsa())
8296 + printk(KERN_INFO "PCI: Using configuration type OLPC\n");
8297 + raw_pci_ops = &pci_olpc_conf;
8298 + is_lx = is_geode_lx();
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);
8310 /* pci-mmconfig.c */
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/
8318 obj-$(CONFIG_CONNECTOR) += connector/
8320 +obj-$(CONFIG_SYSPROF) += sysprof/
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
8330 char vt_dont_switch;
8331 extern struct tty_driver *console_driver;
8333 +/* Add a notifier chain to inform drivers of a VT_TEXT/VT_GRAPHICS switch */
8334 +RAW_NOTIFIER_HEAD(console_notifier_list);
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)
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)
8344 + /* Notify listeners if the current fg_console has switched */
8346 + raw_notifier_call_chain(&console_notifier_list,
8347 + (arg == KD_TEXT) ?
8348 + CONSOLE_EVENT_SWITCH_TEXT :
8349 + CONSOLE_EVENT_SWITCH_GRAPHICS, 0);
8352 * explicitly blank/unblank the screen if switching modes
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");
8362 +static unsigned int smbclk = 0x70;
8363 +module_param(smbclk, uint, 0);
8364 +MODULE_PARM_DESC(smbclk, "Specify the SMB_CLK value");
8366 #define POLL_TIMEOUT (HZ/5)
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)
8375 /************************************************************************/
8377 @@ -392,11 +397,13 @@ static __init int scx200_acb_probe(struct scx200_acb_iface *iface)
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 */
8386 + outb((smbclk & 0x7F) << 1, ACBCTL2);
8388 + outb((smbclk >> 7) & 0xFF, ACBCTL3);
8390 - if (inb(ACBCTL2) != 0x70) {
8391 + if (inb(ACBCTL2) != ((smbclk & 0x7F) << 1)) {
8392 pr_debug(NAME ": ACBCTL2 readback failed\n");
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");
8403 +#define ATKBD_KEY_UNKNOWN 0
8404 +#define ATKBD_KEY_NULL 0xFF0000FF
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
8414 +#define ATKBD_SPECIAL 0xFF0000F8
8417 * Scancode to keycode tables. These are just the default setting, and
8418 * are loadable via an userland utility.
8421 -static unsigned char atkbd_set2_keycode[512] = {
8422 +static unsigned int atkbd_set2_keycode[512] = {
8424 #ifdef CONFIG_KEYBOARD_ATKBD_HP_KEYCODES
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,
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,
8432 + 217,100,ATKBD_KEY_NULL, 0, 97,165, 0, 0,
8433 + 156, 0, 0, 0, 0, 0, 0,125,
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,
8440 + 226, 0, 0, 0, 0, 0, 0, 0,
8441 + 0,ATKBD_KEY_NULL, 96, 0, 0, 0,143, 0,
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,
8446 @@ -150,19 +169,6 @@ static unsigned char atkbd_unxlate_table[128] = {
8447 #define ATKBD_RET_HANGEUL 0xf2
8448 #define ATKBD_RET_ERR 0xff
8450 -#define ATKBD_KEY_UNKNOWN 0
8451 -#define ATKBD_KEY_NULL 255
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
8461 -#define ATKBD_SPECIAL 248
8463 #define ATKBD_LED_EVENT_BIT 0
8464 #define ATKBD_REP_EVENT_BIT 1
8466 @@ -174,7 +180,7 @@ static unsigned char atkbd_unxlate_table[128] = {
8467 #define ATKBD_XL_HANJA 0x20
8470 - unsigned char keycode;
8471 + unsigned int keycode;
8473 } atkbd_scroll_keys[] = {
8474 { ATKBD_SCR_1, 0xc5 },
8475 @@ -200,7 +206,7 @@ struct atkbd {
8479 - unsigned char keycode[512];
8480 + unsigned int keycode[512];
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;
8488 - unsigned char keycode;
8489 + unsigned int keycode;
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;
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];
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];
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)
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);
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)
8523 +#include <asm/olpc.h>
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;
8534 + if (olpc_rev_after(OLPC_REV_B2))
8535 + if (serio->dev.power.power_state.event != PM_EVENT_ON)
8539 if (!atkbd || !drv) {
8540 printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n");
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
8550 +config MOUSE_PS2_OLPC
8551 + bool "OLPC PS/2 mouse protocol extension" if EMBEDDED
8553 + depends on MOUSE_PS2 && OLPC
8555 + Say Y here if you have an OLPC PS/2 touchpad connected to
8561 tristate "Serial mouse"
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
8576 +++ b/drivers/input/mouse/olpc.c
8579 + * OLPC touchpad PS/2 mouse driver
8581 + * Copyright (c) 2006 One Laptop Per Child, inc.
8582 + * Authors Zephaniah E. Hull and Andres Salomon <dilinger@laptop.org>
8584 + * This driver is partly based on the ALPS driver, which is:
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>
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.
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
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.
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>
8612 +#include "psmouse.h"
8615 +static int tpdebug;
8616 +module_param(tpdebug, int, 0644);
8618 +#define OLPC_GS 1 /* The GS sensor. */
8619 +#define OLPC_PT 2 /* The PT sensor. */
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 */
8630 +#define OLPC_PKT_PT 0xcf
8631 +#define OLPC_PKT_GS 0xff
8633 +static int olpc_absolute_mode(struct psmouse *psmouse, int mode);
8636 + * OLPC absolute Mode - single-mode format
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
8646 + * ?'s are not defined in the protocol spec, may vary between models.
8648 + * swr/swl are the left/right buttons.
8650 + * pt-dsw/gs-dsw indicate that the pt/gs sensor is detecting a
8654 +static void olpc_process_packet_gspt(struct psmouse *psmouse)
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;
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);
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);
8680 + * If it's been more than 30ms since the last packet,
8681 + * assume that there was a lift we were never told about.
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);
8695 + priv->late = now_ns + (30 * NSEC_PER_MSEC);
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);
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);
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);
8722 + input_report_abs(dev2, ABS_PRESSURE, z);
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);
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);
8741 + if (priv->i->flags & (OLPC_PT|OLPC_GS)) {
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;
8748 + if (priv->current_mode == pending) {
8749 + priv->pending_mode = 0;
8750 + pending = priv->current_mode;
8752 + else if (priv->pending_mode != pending) {
8753 + priv->pending_mode = pending;
8755 + printk(KERN_WARNING "Scheduling mode switch to %s.\n",
8756 + pending == OLPC_GS ? "GS" : "PT");
8759 + * Apply a de-bounce when switching from PT to GS, to allow for
8760 + * spurious PT-up packets.
8762 + if (priv->pending_mode == OLPC_GS)
8763 + queue_delayed_work(kpsmoused_wq, &priv->mode_switch, msecs_to_jiffies(50));
8765 + queue_delayed_work(kpsmoused_wq, &priv->mode_switch, 0);
8770 +static psmouse_ret_t olpc_process_byte(struct psmouse *psmouse)
8772 + psmouse_ret_t ret = PSMOUSE_BAD_DATA;
8774 + if (psmouse->packet[0] != OLPC_PKT_PT &&
8775 + psmouse->packet[0] != OLPC_PKT_GS)
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))
8783 + if (psmouse->pktcnt == 6) {
8784 + olpc_process_packet_gspt(psmouse);
8785 + ret = PSMOUSE_FULL_PACKET;
8789 + ret = PSMOUSE_GOOD_DATA;
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]);
8800 +static struct olpc_model_info *olpc_get_model(struct psmouse *psmouse)
8802 + struct ps2dev *ps2dev = &psmouse->ps2dev;
8803 + unsigned char param[4];
8807 + * Now try "E7 report". Allowed responses are in
8808 + * olpc_model_data[].signature
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))
8815 + param[0] = param[1] = param[2] = 0xff;
8816 + if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO))
8819 + pr_debug("olpc.c(%d): E7 report: %2.2x %2.2x %2.2x",
8820 + __LINE__, param[0], param[1], param[2]);
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;
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.
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];
8843 +static int olpc_find_mode(struct psmouse *psmouse)
8845 + struct olpc_data *priv = psmouse->private;
8846 + int mode = priv->i->flags;
8848 + if (mode & OLPC_GS)
8850 + else if (mode & OLPC_PT)
8859 + * Touchpad should be disabled before calling this!
8861 +static int olpc_new_mode(struct psmouse *psmouse, int mode)
8863 + struct ps2dev *ps2dev = &psmouse->ps2dev;
8864 + struct olpc_data *priv = psmouse->private;
8865 + unsigned char param;
8869 + printk(KERN_WARNING __FILE__ ": Switching to %d. [%lu]\n", mode, jiffies);
8871 + if ((ret = ps2_command(ps2dev, ¶m, 0x01F2)))
8873 + if ((ret = ps2_command(ps2dev, ¶m, 0x01F2)))
8875 + if ((ret = ps2_command(ps2dev, ¶m, 0x01F2)))
8880 + printk(KERN_WARNING __FILE__ ": Invalid mode %d. Defaulting to OLPC_GS.\n", mode);
8882 + ret = ps2_command(ps2dev, NULL, 0xE6);
8885 + ret = ps2_command(ps2dev, NULL, 0xE7);
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;
8896 + if ((ret = ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE)))
8899 + priv->current_mode = mode;
8900 + priv->pending_mode = 0;
8902 + printk(KERN_WARNING __FILE__ ": Switched to mode %d successful.\n", mode);
8906 + printk(KERN_WARNING __FILE__ ": Mode switch to %d failed! (%d) [%lu]\n", mode, ret, jiffies);
8910 +static int olpc_absolute_mode(struct psmouse *psmouse, int mode)
8912 + struct ps2dev *ps2dev = &psmouse->ps2dev;
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))
8921 + return olpc_new_mode(psmouse, mode);
8925 + * olpc_poll() - poll the touchpad for current motion packet.
8927 + * Note: We can't poll, so always return failure.
8929 +static int olpc_poll(struct psmouse *psmouse)
8934 +static int olpc_reconnect(struct psmouse *psmouse)
8936 + struct olpc_data *priv = psmouse->private;
8939 + if (olpc_rev_after(OLPC_REV_B2))
8940 + if (psmouse->ps2dev.serio->dev.power.power_state.event != PM_EVENT_ON)
8943 + psmouse_reset(psmouse);
8945 + if (!(priv->i = olpc_get_model(psmouse)))
8948 + mode = olpc_find_mode(psmouse);
8952 + if (olpc_absolute_mode(psmouse, mode)) {
8953 + printk(KERN_ERR __FILE__ ": Failed to reenable absolute mode.\n");
8960 +static void olpc_disconnect(struct psmouse *psmouse)
8962 + struct olpc_data *priv = psmouse->private;
8964 + psmouse_reset(psmouse);
8965 + input_unregister_device(priv->dev2);
8969 +static void olpc_mode_switch(struct work_struct *w)
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;
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");
8984 + printk(KERN_WARNING __FILE__ ": Disable for switch to %d. [%lu]\n", priv->pending_mode, jiffies);
8986 + /* XXX: This is a bit hacky, make sure this isn't screwing stuff up. */
8987 + psmouse->state = PSMOUSE_INITIALIZING;
8989 + ret = ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE);
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);
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).
9002 + pending_mode = priv->pending_mode;
9004 + if (olpc_new_mode(psmouse, priv->pending_mode))
9008 + * Deal with a potential race condition.
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.
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));
9023 + printk(KERN_WARNING __FILE__ ": Failure to switch modes, resetting device...\n");
9024 + olpc_reconnect(psmouse);
9027 +int olpc_init(struct psmouse *psmouse)
9029 + struct olpc_data *priv;
9030 + struct input_dev *dev = psmouse->dev;
9031 + struct input_dev *dev2;
9034 + priv = kzalloc(sizeof(struct olpc_data), GFP_KERNEL);
9035 + dev2 = input_allocate_device();
9036 + if (!priv || !dev2)
9039 + psmouse->private = priv;
9040 + priv->dev2 = dev2;
9041 + priv->psmouse = psmouse;
9043 + psmouse_reset(psmouse);
9044 + if (!(priv->i = olpc_get_model(psmouse)))
9047 + mode = olpc_find_mode(psmouse);
9049 + printk(KERN_ERR __FILE__ ": Failed to identify proper mode\n");
9053 + if (olpc_absolute_mode(psmouse, mode)) {
9054 + printk(KERN_ERR __FILE__ ": Failed to enable absolute mode\n");
9059 + * Unset some of the default bits for things we don't have.
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);
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);
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);
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;
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);
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);
9093 + if (input_register_device(dev2)) {
9094 + printk(KERN_ERR __FILE__ ": Failed to register GlideSensor\n");
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;
9104 + /* Disable the idle resync. */
9105 + psmouse->resync_time = 0;
9106 + /* Reset after a lot of bad bytes. */
9107 + psmouse->resetafter = 1024;
9109 + INIT_DELAYED_WORK(&priv->mode_switch, olpc_mode_switch);
9114 + input_free_device(dev2);
9119 +int olpc_detect(struct psmouse *psmouse, int set_properties)
9121 + if (!olpc_get_model(psmouse))
9124 + if (set_properties) {
9125 + psmouse->vendor = "ALPS";
9126 + psmouse->name = "PenTablet";
9127 + psmouse->model = 0;
9132 diff --git a/drivers/input/mouse/olpc.h b/drivers/input/mouse/olpc.h
9133 new file mode 100644
9134 index 0000000..426f8b4
9136 +++ b/drivers/input/mouse/olpc.h
9139 + * OLPC touchpad PS/2 mouse driver
9141 + * Copyright (c) 2006 One Laptop Per Child, inc.
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>
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.
9155 +struct olpc_model_info {
9156 + unsigned char signature[3];
9157 + unsigned char flags;
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 */
9169 + struct delayed_work mode_switch;
9172 +#ifdef CONFIG_MOUSE_PS2_OLPC
9173 +int olpc_detect(struct psmouse *psmouse, int set_properties);
9174 +int olpc_init(struct psmouse *psmouse);
9176 +inline int olpc_detect(struct psmouse *psmouse, int set_properties)
9180 +inline int olpc_init(struct psmouse *psmouse)
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
9192 #include "synaptics.h"
9193 #include "logips2pp.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 = {
9201 static DEFINE_MUTEX(psmouse_mutex);
9203 -static struct workqueue_struct *kpsmoused_wq;
9204 +struct workqueue_struct *kpsmoused_wq;
9206 struct psmouse_protocol {
9207 enum psmouse_type type;
9208 @@ -320,7 +321,7 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
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);
9217 @@ -631,8 +632,21 @@ static int psmouse_extensions(struct psmouse *psmouse,
9222 + * Try OLPC touchpad.
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;
9229 + * Init failed, try basic relative protocols
9231 + max_proto = PSMOUSE_IMEX;
9235 + if (max_proto > PSMOUSE_IMEX) {
9236 if (genius_detect(psmouse, set_properties) == 0)
9237 return PSMOUSE_GENPS;
9239 @@ -762,6 +776,14 @@ static const struct psmouse_protocol psmouse_protocols[] = {
9240 .detect = touchkit_ps2_detect,
9243 +#ifdef CONFIG_MOUSE_PS2_OLPC
9245 + .type = PSMOUSE_OLPC,
9248 + .detect = olpc_detect,
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 {
9260 PSMOUSE_TOUCHKIT_PS2,
9263 PSMOUSE_AUTO /* This one should always be last */
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);
9270 +extern struct workqueue_struct *kpsmoused_wq;
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)
9284 +#include <asm/olpc.h>
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)
9293 if (dev->dev.power.power_state.event != state.event) {
9295 + /* Anything newer than B2 remains powered; no reset needed */
9296 + if (olpc_rev_before(OLPC_REV_PRE_B3)) {
9298 if (state.event == PM_EVENT_SUSPEND)
9299 i8042_controller_reset();
9304 dev->dev.power.power_state = state;
9306 @@ -902,9 +914,15 @@ static int i8042_resume(struct platform_device *dev)
9307 if (dev->dev.power.power_state.event == PM_EVENT_ON)
9311 + if (olpc_rev_before(OLPC_REV_PRE_B3)) {
9313 error = i8042_controller_check();
9320 error = i8042_controller_selftest();
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 */
9332 +#include <asm/olpc.h>
9335 static int serio_suspend(struct device *dev, pm_message_t state)
9337 if (dev->power.power_state.event != state.event) {
9339 + if (olpc_rev_before(OLPC_REV_PRE_B3)) {
9341 if (state.event == PM_EVENT_SUSPEND)
9342 serio_cleanup(to_serio_port(dev));
9347 dev->power.power_state = state;
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");
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 "
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.");
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. */
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)
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);
9393 mutex_unlock(&cam->s_mutex);
9394 @@ -2162,7 +2166,7 @@ static int cafe_pci_probe(struct pci_dev *pdev,
9396 * If so requested, try to get our DMA buffers now.
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
9409 If you are not sure, say Y here.
9411 +config EEPROM_93CX6
9412 + tristate "EEPROM 93CX6 support"
9414 + This is a driver for the EEPROM chipsets 93c46 and 93c66.
9415 + The driver supports both read as well as write commands.
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;
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);
9431 mmc_set_data_timeout(&brq.data, card, rq_data_dir(req) != READ);
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)
9443 + * There's an off-by-one error in the hw that we need to
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);
9455 - pwr = SDHCI_POWER_ON;
9457 switch (1 << power) {
9458 case MMC_VDD_165_195:
9459 - pwr |= SDHCI_POWER_180;
9460 + pwr = SDHCI_POWER_180;
9464 - pwr |= SDHCI_POWER_300;
9465 + pwr = SDHCI_POWER_300;
9469 - pwr |= SDHCI_POWER_330;
9470 + pwr = SDHCI_POWER_330;
9474 @@ -696,6 +700,10 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power)
9476 writeb(pwr, host->ioaddr + SDHCI_POWER_CONTROL);
9478 + pwr |= SDHCI_POWER_ON;
9480 + writeb(pwr, host->ioaddr + SDHCI_POWER_CONTROL);
9483 host->power = power;
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.
9494 + tristate "Log panic/oops to an MTD buffer"
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
9501 source "drivers/mtd/chips/Kconfig"
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
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;
9524 - * Probing of multi-partition flash ships.
9525 + * Probing of multi-partition flash chips.
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,
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)
9536 unsigned long ofs, len;
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,
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",
9550 cfi_varsize_frob(mtd, do_printlockstatus_oneblock,
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,
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",
9568 cfi_varsize_frob(mtd, do_printlockstatus_oneblock,
9574 @@ -2255,7 +2255,7 @@ static void cfi_intelext_save_locks(struct mtd_info *mtd)
9575 adr = region->offset + block * len;
9577 status = cfi_varsize_frob(mtd,
9578 - do_getlockstatus_oneblock, adr, len, 0);
9579 + do_getlockstatus_oneblock, adr, len, NULL);
9581 set_bit(block, region->lockmap);
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,
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)
9594 unsigned long ofs, len;
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
9603 #define MBM29F040C 0x00A4
9604 +#define MBM29F800BA 0x2258
9605 #define MBM29LV650UE 0x22D7
9606 #define MBM29LV320TE 0x22F6
9607 #define MBM29LV320BE 0x22F9
9609 #define LH28F640BF 0x00b0
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[] = {
9619 .mfr_id = MANUFACTURER_FUJITSU,
9620 + .dev_id = MBM29F800BA,
9621 + .name = "Fujitsu MBM29F800BA",
9623 + [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
9624 + [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
9626 + .DevSize = SIZE_1MiB,
9627 + .CmdSet = P_ID_AMD_STD,
9628 + .NumEraseRegions= 4,
9630 + ERASEINFO(0x04000,1),
9631 + ERASEINFO(0x02000,2),
9632 + ERASEINFO(0x08000,1),
9633 + ERASEINFO(0x10000,15),
9636 + .mfr_id = MANUFACTURER_FUJITSU,
9637 .dev_id = MBM29LV650UE,
9638 .name = "Fujitsu MBM29LV650UE",
9640 @@ -1510,6 +1529,23 @@ static const struct amd_flash_info jedec_table[] = {
9641 ERASEINFO(0x1000,256)
9645 + .mfr_id = MANUFACTURER_ST,
9646 + .dev_id = M29F800AB,
9647 + .name = "ST M29F800AB",
9649 + [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
9650 + [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
9652 + .DevSize = SIZE_1MiB,
9653 + .CmdSet = P_ID_AMD_STD,
9654 + .NumEraseRegions= 4,
9656 + ERASEINFO(0x04000,1),
9657 + ERASEINFO(0x02000,2),
9658 + ERASEINFO(0x08000,1),
9659 + ERASEINFO(0x10000,15),
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'.
9672 - tristate "Support for M25 SPI Flash"
9673 + tristate "Support most SPI Flash chips (AT26DF, M25P, W25X, ...)"
9674 depends on SPI_MASTER && EXPERIMENTAL
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.
9685 + Note that the original DataFlash chips (AT45 series, not AT26DF),
9686 + need an entirely different driver.
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.
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
9700 - * MTD SPI driver for ST M25Pxx flash chips
9701 + * MTD SPI driver for ST M25Pxx (and similar) serial flash chips
9703 * Author: Mike Lavender, mike@steroidmicros.com
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>
9712 #include <linux/mtd/mtd.h>
9713 #include <linux/mtd/partitions.h>
9715 #include <linux/spi/spi.h>
9716 #include <linux/spi/flash.h>
9718 -#include <asm/semaphore.h>
9721 -/* NOTE: AT 25F and SST 25LF series are very similar,
9722 - * but commands for sector erase and chip id differ...
9725 #define FLASH_PAGESIZE 256
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 */
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 */
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;
9764 @@ -150,8 +150,9 @@ static int wait_till_ready(struct m25p *flash)
9766 static int erase_sector(struct m25p *flash, u32 offset)
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);
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);
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)
9789 - down(&flash->lock);
9790 + mutex_lock(&flash->lock);
9792 + /* REVISIT in some cases we could speed up erasing large regions
9793 + * by using OPCODE_SE instead of OPCODE_BE_4K
9796 /* now erase those sectors */
9798 if (erase_sector(flash, addr)) {
9799 instr->state = MTD_ERASE_FAILED;
9801 + mutex_unlock(&flash->lock);
9805 @@ -215,7 +220,7 @@ static int m25p80_erase(struct mtd_info *mtd, struct erase_info *instr)
9806 len -= mtd->erasesize;
9810 + mutex_unlock(&flash->lock);
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,
9818 - down(&flash->lock);
9819 + mutex_lock(&flash->lock);
9821 /* Wait till previous write/erase is done. */
9822 if (wait_till_ready(flash)) {
9823 /* REVISIT status return?? */
9825 + mutex_unlock(&flash->lock);
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.
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,
9839 *retlen = m.actual_length - sizeof(flash->command);
9842 + mutex_unlock(&flash->lock);
9846 @@ -323,7 +331,7 @@ static int m25p80_write(struct mtd_info *mtd, loff_t to, size_t len,
9848 spi_message_add_tail(&t[1], &m);
9850 - down(&flash->lock);
9851 + mutex_lock(&flash->lock);
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,
9857 *retlen += m.actual_length
9858 - sizeof(flash->command);
9865 + mutex_unlock(&flash->lock);
9869 @@ -398,24 +406,118 @@ static int m25p80_write(struct mtd_info *mtd, loff_t to, size_t len,
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.
9882 + /* The size listed here is what works with OPCODE_SE, which isn't
9883 + * necessarily called a "sector" by the vendor.
9885 unsigned sector_size;
9886 - unsigned n_sectors;
9890 +#define SECT_4K 0x01 /* OPCODE_BE_4K works uniformly */
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.
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 },
9909 + /* Atmel -- some are (confusingly) marketed as "DataFlash" */
9910 + { "at25fs010", 0x1f6601, 32 * 1024, 4, SECT_4K, },
9911 + { "at25fs040", 0x1f6604, 64 * 1024, 8, SECT_4K, },
9913 + { "at25df041a", 0x1f4401, 64 * 1024, 8, SECT_4K, },
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, },
9920 + /* Spansion -- single (large) sector size only, at least
9921 + * for the chips listed here (without boot sectors).
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, },
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, },
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, },
9946 + { "m45pe80", 0x204014, 64 * 1024, 16, },
9947 + { "m45pe16", 0x204015, 64 * 1024, 32, },
9949 + { "m25pe80", 0x208014, 64 * 1024, 16, },
9950 + { "m25pe16", 0x208015, 64 * 1024, 32, SECT_4K, },
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, },
9962 +static struct flash_info *__devinit jedec_probe(struct spi_device *spi)
9965 + u8 code = OPCODE_RDID;
9968 + struct flash_info *info;
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.
9974 + tmp = spi_write_then_read(spi, &code, 1, id, 3);
9976 + DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n",
9977 + spi->dev.bus_id, tmp);
9981 + jedec = jedec << 8;
9983 + jedec = jedec << 8;
9986 + for (tmp = 0, info = m25p_data;
9987 + tmp < ARRAY_SIZE(m25p_data);
9989 + if (info->jedec_id == jedec)
9992 + dev_err(&spi->dev, "unrecognized JEDEC id %06x\n", jedec);
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)
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.
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 ...
10014 - DEBUG(MTD_DEBUG_LEVEL1, "%s: no chip id\n",
10015 - spi->dev.bus_id);
10018 + if (data && data->type) {
10019 + for (i = 0, info = m25p_data;
10020 + i < ARRAY_SIZE(m25p_data);
10022 + if (strcmp(data->type, info->name) == 0)
10026 - for (i = 0, info = m25p_data; i < ARRAY_SIZE(m25p_data); i++, info++) {
10027 - if (strcmp(data->type, info->name) == 0)
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);
10039 + /* recognized; is that chip really what's there? */
10040 + } else if (info->jedec_id) {
10041 + struct flash_info *chip = jedec_probe(spi);
10043 + if (!chip || chip != info) {
10044 + dev_warn(&spi->dev, "found %s, expected %s\n",
10045 + chip ? chip->name : "UNKNOWN",
10051 + info = jedec_probe(spi);
10057 flash = kzalloc(sizeof *flash, GFP_KERNEL);
10062 - init_MUTEX(&flash->lock);
10063 + mutex_init(&flash->lock);
10064 dev_set_drvdata(&spi->dev, flash);
10067 + if (data && data->name)
10068 flash->mtd.name = data->name;
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;
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;
10085 + flash->erase_opcode = OPCODE_SE;
10086 + flash->mtd.erasesize = info->sector_size;
10089 dev_info(&spi->dev, "%s (%d Kbytes)\n", info->name,
10090 flash->mtd.size / 1024);
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",
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)
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,
10126 + parts[i].size / 1024);
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 = {
10132 .probe = m25p_probe,
10133 .remove = __devexit_p(m25p_remove),
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...
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
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>
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 */
10158 - struct semaphore lock;
10159 + struct mutex lock;
10160 struct spi_device *spi;
10162 struct mtd_info mtd;
10163 @@ -167,7 +168,7 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
10165 spi_message_add_tail(&x, &msg);
10167 - down(&priv->lock);
10168 + mutex_lock(&priv->lock);
10169 while (instr->len > 0) {
10170 unsigned int pageaddr;
10172 @@ -210,7 +211,7 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
10173 instr->len -= priv->page_size;
10177 + mutex_unlock(&priv->lock);
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,
10183 spi_message_add_tail(&x[1], &msg);
10185 - down(&priv->lock);
10186 + mutex_lock(&priv->lock);
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 */
10193 status = spi_sync(priv->spi, &msg);
10195 + mutex_unlock(&priv->lock);
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,
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,
10210 writelen = remaining;
10213 + mutex_unlock(&priv->lock);
10217 @@ -463,7 +464,7 @@ add_dataflash(struct spi_device *spi, char *name,
10221 - init_MUTEX(&priv->lock);
10222 + mutex_init(&priv->lock);
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
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
10242 * made the memory unusable, added a fix to code to touch up
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)
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));
10263 @@ -649,14 +649,10 @@ MODULE_DESCRIPTION(PMC551_VERSION);
10264 * Stuff these outside the ifdef so as to not bust compiled in driver support
10266 static int msize = 0;
10267 -#if defined(CONFIG_MTD_PMC551_APERTURE_SIZE)
10268 -static int asize = CONFIG_MTD_PMC551_APERTURE_SIZE;
10270 static int asize = 0;
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]");
10279 @@ -799,8 +795,7 @@ static int __init init_pmc551(void)
10280 mtd->owner = THIS_MODULE;
10282 if (add_mtd_device(mtd)) {
10283 - printk(KERN_NOTICE "pmc551: Failed to register new "
10285 + printk(KERN_NOTICE "pmc551: Failed to register new device\n");
10286 pci_iounmap(PCI_Device, priv->start);
10289 @@ -811,13 +806,13 @@ static int __init init_pmc551(void)
10290 pci_dev_get(PCI_Device);
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",
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;
10306 @@ -850,7 +845,7 @@ static void __exit cleanup_pmc551(void)
10307 pmc551list = priv->nextpmc551;
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);
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
10324 - * Erase the configuration file system.
10325 - * Used to support the software reset button.
10327 -static void nettel_erasecallback(struct erase_info *done)
10329 - wait_queue_head_t *wait_q = (wait_queue_head_t *)done->priv;
10333 -static struct erase_info nettel_erase;
10335 -int nettel_eraseconfig(void)
10337 - struct mtd_info *mtd;
10338 - DECLARE_WAITQUEUE(wait, current);
10339 - wait_queue_head_t wait_q;
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;
10353 - set_current_state(TASK_INTERRUPTIBLE);
10354 - add_wait_queue(&wait_q, &wait);
10356 - ret = mtd->erase(mtd, &nettel_erase);
10358 - set_current_state(TASK_RUNNING);
10359 - remove_wait_queue(&wait_q, &wait);
10360 - put_mtd_device(mtd);
10364 - schedule(); /* Wait for erase to finish. */
10365 - remove_wait_queue(&wait_q, &wait);
10367 - put_mtd_device(mtd);
10375 -int nettel_eraseconfig(void)
10382 /****************************************************************************/
10384 -int __init nettel_init(void)
10385 +static int __init nettel_init(void)
10387 volatile unsigned long *amdpar;
10388 unsigned long amdaddr, maxsize;
10389 @@ -421,10 +364,6 @@ int __init nettel_init(void)
10391 intel_mtd->owner = THIS_MODULE;
10393 -#ifndef CONFIG_BLK_DEV_INITRD
10394 - ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, 1);
10397 num_intel_partitions = sizeof(nettel_intel_partitions) /
10398 sizeof(nettel_intel_partitions[0]);
10400 @@ -477,7 +416,7 @@ out_unmap2:
10402 /****************************************************************************/
10404 -void __exit nettel_cleanup(void)
10405 +static void __exit nettel_cleanup(void)
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;
10416 add_mtd_device(rr_mtd);
10417 - ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, rr_mtd->index);
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
10426 #include <linux/kthread.h>
10427 #include <asm/uaccess.h>
10429 -static LIST_HEAD(blktrans_majors);
10430 +#include "mtdcore.h"
10432 -extern struct mutex mtd_table_mutex;
10433 -extern struct mtd_info *mtd_table[];
10434 +static LIST_HEAD(blktrans_majors);
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,
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)
10453 DEBUG(MTD_DEBUG_LEVEL0, "MTD_close\n");
10456 + /* Only sync if opened RW */
10457 + if ((file->f_mode & 2) && mtd->sync)
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
10467 #include <linux/mtd/mtd.h>
10469 +#include "mtdcore.h"
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
10478 +++ b/drivers/mtd/mtdcore.h
10480 +/* linux/drivers/mtd/mtdcore.h
10482 + * Header file for driver private mtdcore exports
10486 +/* These are exported solely for the purpose of mtd_blkdevs.c. You
10487 + should not use them for _anything_ else */
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
10495 +++ b/drivers/mtd/mtdoops.c
10498 + * MTD Oops/Panic logger
10500 + * Copyright (C) 2007 Nokia Corporation. All rights reserved.
10502 + * Author: Richard Purdie <rpurdie@openedhand.com>
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.
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.
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
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>
10529 +#define OOPS_PAGE_SIZE 4096
10531 +static struct mtdoops_context {
10533 + struct work_struct work;
10534 + struct mtd_info *mtd;
10544 +static void mtdoops_erase_callback(struct erase_info *done)
10546 + wait_queue_head_t *wait_q = (wait_queue_head_t *)done->priv;
10550 +static int mtdoops_erase_block(struct mtd_info *mtd, int offset)
10552 + struct erase_info erase;
10553 + DECLARE_WAITQUEUE(wait, current);
10554 + wait_queue_head_t wait_q;
10557 + init_waitqueue_head(&wait_q);
10559 + erase.callback = mtdoops_erase_callback;
10560 + erase.addr = offset;
10561 + if (mtd->erasesize < OOPS_PAGE_SIZE)
10562 + erase.len = OOPS_PAGE_SIZE;
10564 + erase.len = mtd->erasesize;
10565 + erase.priv = (u_long)&wait_q;
10567 + set_current_state(TASK_INTERRUPTIBLE);
10568 + add_wait_queue(&wait_q, &wait);
10570 + ret = mtd->erase(mtd, &erase);
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);
10580 + schedule(); /* Wait for erase to finish. */
10581 + remove_wait_queue(&wait_q, &wait);
10586 +static int mtdoops_inc_counter(struct mtdoops_context *cxt)
10588 + struct mtd_info *mtd = cxt->mtd;
10594 + if (cxt->nextpage > cxt->oops_pages)
10595 + cxt->nextpage = 0;
10596 + cxt->nextcount++;
10597 + if (cxt->nextcount == 0xffffffff)
10598 + cxt->nextcount = 0;
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,
10609 + /* See if we need to erase the next block */
10610 + if (count != 0xffffffff)
10613 + printk(KERN_DEBUG "mtdoops: Ready %d, %d (no erase)\n",
10614 + cxt->nextpage, cxt->nextcount);
10619 +static void mtdoops_prepare(struct mtdoops_context *cxt)
10621 + struct mtd_info *mtd = cxt->mtd;
10622 + int i = 0, j, ret, mod;
10624 + /* We were unregistered */
10628 + mod = (cxt->nextpage * OOPS_PAGE_SIZE) % mtd->erasesize;
10630 + cxt->nextpage = cxt->nextpage + ((mtd->erasesize - mod) / OOPS_PAGE_SIZE);
10631 + if (cxt->nextpage > cxt->oops_pages)
10632 + cxt->nextpage = 0;
10635 + while (mtd->block_isbad &&
10636 + mtd->block_isbad(mtd, cxt->nextpage * OOPS_PAGE_SIZE)) {
10638 + printk(KERN_WARNING "mtdoops: Bad block at %08x\n",
10639 + cxt->nextpage * OOPS_PAGE_SIZE);
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");
10650 + for (j = 0, ret = -1; (j < 3) && (ret < 0); j++)
10651 + ret = mtdoops_erase_block(mtd, cxt->nextpage * OOPS_PAGE_SIZE);
10654 + if (mtd->block_markbad)
10655 + mtd->block_markbad(mtd, cxt->nextpage * OOPS_PAGE_SIZE);
10659 + printk(KERN_DEBUG "mtdoops: Ready %d, %d \n", cxt->nextpage, cxt->nextcount);
10664 +static void mtdoops_workfunc(struct work_struct *work)
10666 + struct mtdoops_context *cxt =
10667 + container_of(work, struct mtdoops_context, work);
10669 + mtdoops_prepare(cxt);
10672 +static int find_next_position(struct mtdoops_context *cxt)
10674 + struct mtd_info *mtd = cxt->mtd;
10675 + int page, maxpos = 0;
10676 + u32 count, maxcount = 0xffffffff;
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)
10683 + if (maxcount == 0xffffffff) {
10684 + maxcount = count;
10686 + } else if ((count < 0x40000000) && (maxcount > 0xc0000000)) {
10687 + maxcount = count;
10689 + } else if ((count > maxcount) && (count < 0xc0000000)) {
10690 + maxcount = count;
10692 + } else if ((count > maxcount) && (count > 0xc0000000)
10693 + && (maxcount > 0x80000000)) {
10694 + maxcount = count;
10698 + if (maxcount == 0xffffffff) {
10699 + cxt->nextpage = 0;
10700 + cxt->nextcount = 1;
10702 + printk(KERN_DEBUG "mtdoops: Ready %d, %d (first init)\n",
10703 + cxt->nextpage, cxt->nextcount);
10707 + cxt->nextpage = maxpos;
10708 + cxt->nextcount = maxcount;
10710 + return mtdoops_inc_counter(cxt);
10714 +static void mtdoops_notify_add(struct mtd_info *mtd)
10716 + struct mtdoops_context *cxt = &oops_cxt;
10719 + if ((mtd->index != cxt->mtd_index) || cxt->mtd_index < 0)
10722 + if (mtd->size < (mtd->erasesize * 2)) {
10723 + printk(KERN_ERR "MTD partition %d not big enough for mtdoops\n",
10729 + cxt->oops_pages = mtd->size / OOPS_PAGE_SIZE;
10731 + ret = find_next_position(cxt);
10733 + mtdoops_prepare(cxt);
10735 + printk(KERN_DEBUG "mtdoops: Attached to MTD device %d\n", mtd->index);
10738 +static void mtdoops_notify_remove(struct mtd_info *mtd)
10740 + struct mtdoops_context *cxt = &oops_cxt;
10742 + if ((mtd->index != cxt->mtd_index) || cxt->mtd_index < 0)
10746 + flush_scheduled_work();
10751 +mtdoops_console_write(struct console *co, const char *s, unsigned int count)
10753 + struct mtdoops_context *cxt = co->data;
10754 + struct mtd_info *mtd = cxt->mtd;
10757 + if (!cxt->ready || !mtd)
10760 + if (!oops_in_progress && cxt->writecount != 0) {
10762 + if (cxt->writecount < OOPS_PAGE_SIZE)
10763 + memset(cxt->oops_buf + cxt->writecount, 0xff,
10764 + OOPS_PAGE_SIZE - cxt->writecount);
10766 + ret = mtd->write(mtd, cxt->nextpage * OOPS_PAGE_SIZE,
10767 + OOPS_PAGE_SIZE, &retlen, cxt->oops_buf);
10769 + cxt->writecount = 0;
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);
10777 + ret = mtdoops_inc_counter(cxt);
10779 + schedule_work(&cxt->work);
10782 + if (!oops_in_progress)
10785 + if (cxt->writecount == 0) {
10786 + u32 *stamp = cxt->oops_buf;
10787 + *stamp = cxt->nextcount;
10788 + cxt->writecount = 4;
10791 + if ((count + cxt->writecount) > OOPS_PAGE_SIZE)
10792 + count = OOPS_PAGE_SIZE - cxt->writecount;
10794 + for (i = 0; i < count; i++, s++)
10795 + *((char *)(cxt->oops_buf) + cxt->writecount + i) = *s;
10797 + cxt->writecount = cxt->writecount + count;
10800 +static int __init mtdoops_console_setup(struct console *co, char *options)
10802 + struct mtdoops_context *cxt = co->data;
10804 + if (cxt->mtd_index != -1)
10806 + if (co->index == -1)
10809 + cxt->mtd_index = co->index;
10813 +static struct mtd_notifier mtdoops_notifier = {
10814 + .add = mtdoops_notify_add,
10815 + .remove = mtdoops_notify_remove,
10818 +static struct console mtdoops_console = {
10819 + .name = "ttyMTD",
10820 + .write = mtdoops_console_write,
10821 + .setup = mtdoops_console_setup,
10822 + .flags = CON_PRINTBUFFER,
10824 + .data = &oops_cxt,
10827 +static int __init mtdoops_console_init(void)
10829 + struct mtdoops_context *cxt = &oops_cxt;
10831 + cxt->mtd_index = -1;
10832 + cxt->oops_buf = vmalloc(OOPS_PAGE_SIZE);
10834 + if (!cxt->oops_buf) {
10835 + printk(KERN_ERR "Failed to allocate oops buffer workspace\n");
10839 + INIT_WORK(&cxt->work, mtdoops_workfunc);
10841 + register_console(&mtdoops_console);
10842 + register_mtd_user(&mtdoops_notifier);
10846 +static void __exit mtdoops_console_exit(void)
10848 + struct mtdoops_context *cxt = &oops_cxt;
10850 + unregister_mtd_user(&mtdoops_notifier);
10851 + unregister_console(&mtdoops_console);
10852 + vfree(cxt->oops_buf);
10856 +subsys_initcall(mtdoops_console_init);
10857 +module_exit(mtdoops_console_exit);
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
10868 config MTD_NAND_NDFC
10869 tristate "NDFC NanD Flash Controller"
10872 select MTD_NAND_ECC_SMC
10874 - NDFC Nand Flash Controllers are integrated in EP44x SoCs
10875 + NDFC Nand Flash Controllers are integrated in IBM/AMCC's 4xx SoCs
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
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
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[] = {
10894 MODULE_DEVICE_TABLE(pci, cafe_nand_tbl);
10896 +static int cafe_nand_resume(struct pci_dev *pdev)
10898 + uint32_t timing1, timing2, timing3;
10900 + struct mtd_info *mtd = pci_get_drvdata(pdev);
10901 + struct cafe_priv *cafe = mtd->priv;
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);
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);
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);
10928 + cafe_writel(cafe, 0, NAND_DMA_ADDR1);
10930 + /* Enable NAND IRQ in global IRQ mask register */
10931 + cafe_writel(cafe, 0x80000007, GLOBAL_IRQ_MASK);
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,
10942 .suspend = cafe_nand_suspend,
10943 - .resume = cafe_nand_resume,
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
10952 #include <linux/platform_device.h>
10954 #include <asm/io.h>
10956 +#include <asm/ibm405.h>
10958 #include <asm/ibm44x.h>
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;
10967 +#ifndef CONFIG_PHYS_64BIT
10968 + ndfc->ndfcbase = ioremap((phys_addr_t)phys, res->end - res->start + 1);
10970 ndfc->ndfcbase = ioremap64(phys, res->end - res->start + 1);
10972 if (!ndfc->ndfcbase) {
10973 printk(KERN_ERR "NDFC: ioremap failed\n");
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
10981 OTP block is fully-guaranteed to be a valid block.
10983 +config MTD_ONENAND_2X_PROGRAM
10984 + bool "OneNAND 2X program support"
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
10993 + Now the following chips support it. (KFXXX16Q2M)
10994 + Demux: KFG2G16Q2M, KFH4G16Q2M, KFW8G16Q2M,
10995 + Mux: KFM2G16Q2M, KFN4G16Q2M,
10997 + And more recent chips
10999 +config MTD_ONENAND_SIM
11000 + tristate "OneNAND simulator support"
11001 + depends on MTD_PARTITIONS
11003 + The simulator may simulate various OneNAND flash chips for the
11004 + OneNAND MTD layer.
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
11013 obj-$(CONFIG_MTD_ONENAND_GENERIC) += generic.o
11016 +obj-$(CONFIG_MTD_ONENAND_SIM) += onenand_sim.o
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
11025 block = (int) (addr >> this->erase_shift);
11026 page = (int) (addr >> this->page_shift);
11028 + if (ONENAND_IS_2PLANE(this)) {
11029 + /* Make the even block number */
11031 + /* Is it the odd plane? */
11032 + if (addr & this->writesize)
11036 page &= this->page_mask;
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);
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);
11049 + /* Switch to the next data buffer */
11050 + ONENAND_SET_NEXT_BUFFERRAM(this);
11054 @@ -247,6 +260,8 @@ static int onenand_command(struct mtd_info *mtd, int cmd, loff_t addr, size_t le
11058 + if (ONENAND_IS_2PLANE(this) && cmd == ONENAND_CMD_PROG)
11059 + cmd = ONENAND_CMD_2X_PROG;
11060 dataram = ONENAND_CURRENT_BUFFERRAM(this);
11063 @@ -445,8 +460,9 @@ static inline int onenand_bufferram_offset(struct mtd_info *mtd, int area)
11064 struct onenand_chip *this = mtd->priv;
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;
11074 @@ -572,6 +588,30 @@ static int onenand_write_bufferram(struct mtd_info *mtd, int area,
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
11083 + * Get blockpage address at 2x program mode
11085 +static int onenand_get_2x_blockpage(struct mtd_info *mtd, loff_t addr)
11087 + struct onenand_chip *this = mtd->priv;
11088 + int blockpage, block, page;
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)
11095 + page = (int) (addr >> (this->page_shift + 1)) & this->page_mask;
11096 + blockpage = (block << 7) | page;
11098 + return blockpage;
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;
11109 - blockpage = (int) (addr >> this->page_shift);
11110 + if (ONENAND_IS_2PLANE(this))
11111 + blockpage = onenand_get_2x_blockpage(mtd, addr);
11113 + blockpage = (int) (addr >> this->page_shift);
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,
11121 - blockpage = (int) (addr >> this->page_shift);
11122 + if (ONENAND_IS_2PLANE(this))
11123 + blockpage = onenand_get_2x_blockpage(mtd, addr);
11125 + blockpage = (int) (addr >> this->page_shift);
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;
11132 int ret = 0, boundary = 0;
11133 + int writesize = this->writesize;
11135 DEBUG(MTD_DEBUG_LEVEL3, "onenand_read: from = 0x%08x, len = %i\n", (unsigned int) from, (int) len);
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 */
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);
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;
11158 /* If there is more to load then start next load */
11160 if (read + thislen < len) {
11161 - this->command(mtd, ONENAND_CMD_READ, from, mtd->writesize);
11162 + this->command(mtd, ONENAND_CMD_READ, from, writesize);
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);
11170 - thislen = min_t(int, mtd->writesize, len - read);
11171 + thislen = min_t(int, writesize, len - read);
11174 /* Now wait for load */
11175 @@ -1079,7 +1126,7 @@ int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from,
11178 /* Update Page size */
11179 - from += mtd->writesize;
11180 + from += this->writesize;
11184 @@ -1135,12 +1182,12 @@ static int onenand_verify(struct mtd_info *mtd, const u_char *buf, loff_t addr,
11185 int thislen, column;
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;
11197 - this->command(mtd, ONENAND_CMD_READ, addr, mtd->writesize);
11198 + this->command(mtd, ONENAND_CMD_READ, addr, this->writesize);
11200 onenand_update_bufferram(mtd, addr, 0);
11202 @@ -1236,6 +1283,10 @@ static int onenand_write(struct mtd_info *mtd, loff_t to, size_t len,
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);
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);
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);
11222 ret = this->wait(mtd, FL_WRITING);
11224 @@ -2107,6 +2162,7 @@ static int onenand_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
11226 * Check and set OneNAND features
11230 static void onenand_check_features(struct mtd_info *mtd)
11232 @@ -2118,19 +2174,35 @@ static void onenand_check_features(struct mtd_info *mtd)
11233 process = this->version_id >> ONENAND_VERSION_PROCESS_SHIFT;
11236 - if (density >= ONENAND_DEVICE_DENSITY_1Gb) {
11237 + switch (density) {
11238 + case ONENAND_DEVICE_DENSITY_4Gb:
11239 + this->options |= ONENAND_HAS_2PLANE;
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;
11247 + case ONENAND_DEVICE_DENSITY_1Gb:
11248 /* A-Die has all block unlock */
11250 - printk(KERN_DEBUG "Chip support all block unlock\n");
11252 this->options |= ONENAND_HAS_UNLOCK_ALL;
11255 - /* Some OneNAND has continues lock scheme */
11257 - printk(KERN_DEBUG "Lock scheme is Continues Lock\n");
11261 + /* Some OneNAND has continuous lock scheme */
11263 this->options |= ONENAND_HAS_CONT_LOCK;
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");
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;
11284 /* REVIST: Multichip handling */
11286 @@ -2265,6 +2339,17 @@ static int onenand_probe(struct mtd_info *mtd)
11287 /* Check OneNAND features */
11288 onenand_check_features(mtd);
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.
11296 + if (ONENAND_IS_2PLANE(this)) {
11297 + mtd->writesize <<= 1;
11298 + mtd->erasesize <<= 1;
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
11308 +++ b/drivers/mtd/onenand/onenand_sim.c
11311 + * linux/drivers/mtd/onenand/onenand_sim.c
11313 + * The OneNAND simulator
11315 + * Copyright © 2005-2007 Samsung Electronics
11316 + * Kyungmin Park <kyungmin.park@samsung.com>
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.
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>
11331 +#include <linux/io.h>
11333 +#ifndef CONFIG_ONENAND_SIM_MANUFACTURER
11334 +#define CONFIG_ONENAND_SIM_MANUFACTURER 0xec
11336 +#ifndef CONFIG_ONENAND_SIM_DEVICE_ID
11337 +#define CONFIG_ONENAND_SIM_DEVICE_ID 0x04
11339 +#ifndef CONFIG_ONENAND_SIM_VERSION_ID
11340 +#define CONFIG_ONENAND_SIM_VERSION_ID 0x1e
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;
11347 +struct onenand_flash {
11348 + void __iomem *base;
11349 + void __iomem *data;
11352 +#define ONENAND_CORE(flash) (flash->data)
11353 +#define ONENAND_CORE_SPARE(flash, this, offset) \
11354 + ((flash->data) + (this->chipsize) + (offset >> 5))
11356 +#define ONENAND_MAIN_AREA(this, offset) \
11357 + (this->base + ONENAND_DATARAM + offset)
11359 +#define ONENAND_SPARE_AREA(this, offset) \
11360 + (this->base + ONENAND_SPARERAM + offset)
11362 +#define ONENAND_GET_WP_STATUS(this) \
11363 + (readw(this->base + ONENAND_REG_WP_STATUS))
11365 +#define ONENAND_SET_WP_STATUS(v, this) \
11366 + (writew(v, this->base + ONENAND_REG_WP_STATUS))
11368 +/* It has all 0xff chars */
11369 +#define MAX_ONENAND_PAGESIZE (2048 + 64)
11370 +static unsigned char *ffchars;
11372 +static struct mtd_partition os_partitions[] = {
11374 + .name = "OneNAND simulator partition",
11376 + .size = MTDPART_SIZ_FULL,
11381 + * OneNAND simulator mtd
11383 +struct onenand_info {
11384 + struct mtd_info mtd;
11385 + struct mtd_partition *parts;
11386 + struct onenand_chip onenand;
11387 + struct onenand_flash flash;
11390 +struct onenand_info *info;
11392 +#define DPRINTK(format, args...) \
11394 + printk(KERN_DEBUG "%s[%d]: " format "\n", __func__, \
11395 + __LINE__, ##args); \
11399 + * onenand_lock_handle - Handle Lock scheme
11400 + * @param this OneNAND device structure
11401 + * @param cmd The command to be sent
11403 + * Send lock command to OneNAND device.
11404 + * The lock scheme is depends on chip type.
11406 +static void onenand_lock_handle(struct onenand_chip *this, int cmd)
11408 + int block_lock_scheme;
11411 + status = ONENAND_GET_WP_STATUS(this);
11412 + block_lock_scheme = !(this->options & ONENAND_HAS_CONT_LOCK);
11415 + case ONENAND_CMD_UNLOCK:
11416 + if (block_lock_scheme)
11417 + ONENAND_SET_WP_STATUS(ONENAND_WP_US, this);
11419 + ONENAND_SET_WP_STATUS(status | ONENAND_WP_US, this);
11422 + case ONENAND_CMD_LOCK:
11423 + if (block_lock_scheme)
11424 + ONENAND_SET_WP_STATUS(ONENAND_WP_LS, this);
11426 + ONENAND_SET_WP_STATUS(status | ONENAND_WP_LS, this);
11429 + case ONENAND_CMD_LOCK_TIGHT:
11430 + if (block_lock_scheme)
11431 + ONENAND_SET_WP_STATUS(ONENAND_WP_LTS, this);
11433 + ONENAND_SET_WP_STATUS(status | ONENAND_WP_LTS, this);
11442 + * onenand_bootram_handle - Handle BootRAM area
11443 + * @param this OneNAND device structure
11444 + * @param cmd The command to be sent
11446 + * Emulate BootRAM area. It is possible to do basic operation using BootRAM.
11448 +static void onenand_bootram_handle(struct onenand_chip *this, int 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);
11458 + /* REVIST: Handle other commands */
11464 + * onenand_update_interrupt - Set interrupt register
11465 + * @param this OneNAND device structure
11466 + * @param cmd The command to be sent
11468 + * Update interrupt register. The status is depends on command.
11470 +static void onenand_update_interrupt(struct onenand_chip *this, int cmd)
11472 + int interrupt = ONENAND_INT_MASTER;
11475 + case ONENAND_CMD_READ:
11476 + case ONENAND_CMD_READOOB:
11477 + interrupt |= ONENAND_INT_READ;
11480 + case ONENAND_CMD_PROG:
11481 + case ONENAND_CMD_PROGOOB:
11482 + interrupt |= ONENAND_INT_WRITE;
11485 + case ONENAND_CMD_ERASE:
11486 + interrupt |= ONENAND_INT_ERASE;
11489 + case ONENAND_CMD_RESET:
11490 + interrupt |= ONENAND_INT_RESET;
11497 + writew(interrupt, this->base + ONENAND_REG_INTERRUPT);
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
11507 + * Compare the source with destination
11509 +static int onenand_check_overwrite(void *dest, void *src, size_t count)
11511 + unsigned int *s = (unsigned int *) src;
11512 + unsigned int *d = (unsigned int *) dest;
11516 + for (i = 0; i < count; i++)
11517 + if ((*s++ ^ *d++) != 0)
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
11530 + * Copy data from OneNAND Core to DataRAM (read)
11531 + * Copy data from DataRAM to OneNAND Core (write)
11532 + * Erase the OneNAND Core (erase)
11534 +static void onenand_data_handle(struct onenand_chip *this, int cmd,
11535 + int dataram, unsigned int offset)
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;
11545 + main_offset = mtd->writesize;
11546 + spare_offset = mtd->oobsize;
11549 + spare_offset = 0;
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 */
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);
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))
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);
11578 + /* Fall through */
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))
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",
11591 + memcpy(dest, src, mtd->oobsize);
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));
11606 + * onenand_command_handle - Handle command
11607 + * @param this OneNAND device structure
11608 + * @param cmd The command to be sent
11610 + * Emulate OneNAND command.
11612 +static void onenand_command_handle(struct onenand_chip *this, int cmd)
11614 + unsigned long offset = 0;
11615 + int block = -1, page = -1, bufferram = -1;
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);
11626 + case ONENAND_CMD_BUFFERRAM:
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);
11637 + if (cmd == ONENAND_CMD_ERASE)
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;
11650 + offset += block << this->erase_shift;
11653 + offset += page << this->page_shift;
11655 + onenand_data_handle(this, cmd, dataram, offset);
11657 + onenand_update_interrupt(this, cmd);
11661 + * onenand_writew - [OneNAND Interface] Emulate write operation
11662 + * @param value value to write
11663 + * @param addr address to write
11665 + * Write OneNAND register with value
11667 +static void onenand_writew(unsigned short value, void __iomem * addr)
11669 + struct onenand_chip *this = info->mtd.priv;
11671 + /* BootRAM handling */
11672 + if (addr < this->base + ONENAND_DATARAM) {
11673 + onenand_bootram_handle(this, value);
11676 + /* Command handling */
11677 + if (addr == this->base + ONENAND_REG_COMMAND)
11678 + onenand_command_handle(this, value);
11680 + writew(value, addr);
11684 + * flash_init - Initialize OneNAND simulator
11685 + * @param flash OneNAND simulaotr data strucutres
11687 + * Initialize OneNAND simulator.
11689 +static int __init flash_init(struct onenand_flash *flash)
11691 + int density, size;
11694 + flash->base = kzalloc(131072, GFP_KERNEL);
11695 + if (!flash->base) {
11696 + printk(KERN_ERR "Unable to allocate base address.\n");
11700 + density = device_id >> ONENAND_DEVICE_DENSITY_SHIFT;
11701 + size = ((16 << 20) << density);
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);
11710 + memset(ONENAND_CORE(flash), 0xff, size + (size >> 5));
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);
11718 + buffer_size = 0x0400; /* 1KiB page */
11720 + buffer_size = 0x0800; /* 2KiB page */
11721 + writew(buffer_size, flash->base + ONENAND_REG_DATA_BUFFER_SIZE);
11727 + * flash_exit - Clean up OneNAND simulator
11728 + * @param flash OneNAND simulaotr data strucutres
11730 + * Clean up OneNAND simulator.
11732 +static void flash_exit(struct onenand_flash *flash)
11734 + vfree(ONENAND_CORE(flash));
11735 + kfree(flash->base);
11739 +static int __init onenand_sim_init(void)
11741 + /* Allocate all 0xff chars pointer */
11742 + ffchars = kmalloc(MAX_ONENAND_PAGESIZE, GFP_KERNEL);
11744 + printk(KERN_ERR "Unable to allocate ff chars.\n");
11747 + memset(ffchars, 0xff, MAX_ONENAND_PAGESIZE);
11749 + /* Allocate OneNAND simulator mtd pointer */
11750 + info = kzalloc(sizeof(struct onenand_info), GFP_KERNEL);
11752 + printk(KERN_ERR "Unable to allocate core structures.\n");
11757 + /* Override write_word function */
11758 + info->onenand.write_word = onenand_writew;
11760 + if (flash_init(&info->flash)) {
11761 + printk(KERN_ERR "Unable to allocat flash.\n");
11767 + info->parts = os_partitions;
11769 + info->onenand.base = info->flash.base;
11770 + info->onenand.priv = &info->flash;
11772 + info->mtd.name = "OneNAND simulator";
11773 + info->mtd.priv = &info->onenand;
11774 + info->mtd.owner = THIS_MODULE;
11776 + if (onenand_scan(&info->mtd, 1)) {
11777 + flash_exit(&info->flash);
11783 + add_mtd_partitions(&info->mtd, info->parts, ARRAY_SIZE(os_partitions));
11788 +static void __exit onenand_sim_exit(void)
11790 + struct onenand_chip *this = info->mtd.priv;
11791 + struct onenand_flash *flash = this->priv;
11793 + onenand_release(&info->mtd);
11794 + flash_exit(flash);
11799 +module_init(onenand_sim_init);
11800 +module_exit(onenand_sim_exit);
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)
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;
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;
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);
11838 + * According to Tom Sylla, the Geode does not support PCI power management
11839 + * transition, so we shouldn't need the D3hot delay.
11841 +static void __init quirk_geode_pci_pm(struct pci_dev *dev)
11843 + pci_pm_d3_delay = 0;
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);
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
11856 +++ b/drivers/sysprof/Kconfig
11862 + tristate "Sysprof support"
11864 + Say M here to include the sysprof-module.
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".
11870 diff --git a/drivers/sysprof/Makefile b/drivers/sysprof/Makefile
11871 new file mode 100644
11872 index 0000000..cd465e9
11874 +++ b/drivers/sysprof/Makefile
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
11881 +++ b/drivers/sysprof/config.h
11883 +/* config.h. Generated by configure. */
11884 +/* config.h.in. Generated from configure.ac by autoheader. */
11886 +/* Look for global separate debug info in this path */
11887 +#define DEBUGDIR "/usr/local/lib/debug"
11889 +/* Define to 1 if you have the `iberty' library (-liberty). */
11890 +/* #undef HAVE_LIBIBERTY */
11892 +/* Define to the address where bug reports for this package should be sent. */
11893 +#define PACKAGE_BUGREPORT ""
11895 +/* Define to the full name of this package. */
11896 +#define PACKAGE_NAME "sysprof"
11898 +/* Define to the full name and version of this package. */
11899 +#define PACKAGE_STRING "sysprof 1.0.8"
11901 +/* Define to the one symbol short name of this package. */
11902 +#define PACKAGE_TARNAME "sysprof"
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
11910 +++ b/drivers/sysprof/sysprof-module.c
11912 +/* -*- c-basic-offset: 8 -*- */
11914 +/* Sysprof -- Sampling, systemwide CPU profiler
11915 + * Copyright 2004, Red Hat, Inc.
11916 + * Copyright 2004, 2005, Soeren Sandmann
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.
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.
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.
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>
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>
11948 +#include "sysprof-module.h"
11950 +#include "config.h"
11952 +#include <linux/version.h>
11954 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
11955 +#include <linux/config.h>
11958 +#if !CONFIG_PROFILING
11959 +# error Sysprof needs a kernel with profiling support compiled in.
11962 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
11963 +# error Sysprof needs a Linux 2.6.11 kernel or later
11965 +#include <linux/kallsyms.h>
11967 +MODULE_LICENSE("GPL");
11968 +MODULE_AUTHOR("Soeren Sandmann (sandmann@daimi.au.dk)");
11970 +#define SAMPLES_PER_SECOND (200)
11971 +#define INTERVAL ((HZ <= SAMPLES_PER_SECOND)? 1 : (HZ / SAMPLES_PER_SECOND))
11972 +#define N_TRACES 256
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);
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
11990 +# error Sysprof only supports the i386 and x86-64 architectures
11993 +typedef struct userspace_reader userspace_reader;
11994 +struct userspace_reader
11996 + struct task_struct *task;
11997 + unsigned long cache_address;
11998 + unsigned long *cache;
12001 +typedef struct StackFrame StackFrame;
12002 +struct StackFrame {
12003 + unsigned long next;
12004 + unsigned long return_address;
12007 +struct work_struct work;
12010 +read_frame (void *frame_pointer, StackFrame *frame)
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.
12017 + * Not sure why (or if) this isn't the case for oprofile
12019 + if (!access_ok(VERIFY_READ, frame_pointer, sizeof(StackFrame)))
12023 + if (__copy_from_user_inatomic (
12024 + frame, frame_pointer, sizeof (StackFrame)))
12030 +DEFINE_PER_CPU(int, n_samples);
12033 +timer_notify (struct pt_regs *regs)
12035 + SysprofStackTrace *trace = head;
12038 + static atomic_t in_timer_notify = ATOMIC_INIT(1);
12041 + n = ++get_cpu_var(n_samples);
12042 + put_cpu_var(n_samples);
12044 + if (n % INTERVAL != 0)
12047 + /* 0: locked, 1: unlocked */
12049 + if (!atomic_dec_and_test(&in_timer_notify))
12052 + is_user = user_mode(regs);
12054 + if (!current || current->pid == 0)
12057 + if (is_user && current->state != TASK_RUNNING)
12064 + trace->pid = current->pid;
12065 + trace->truncated = 0;
12066 + trace->n_addresses = 1;
12068 + /* 0x1 is taken by sysprof to mean "in kernel" */
12069 + trace->addresses[0] = (void *)0x1;
12073 + StackFrame *frame_pointer;
12074 + StackFrame frame;
12075 + memset(trace, 0, sizeof (SysprofStackTrace));
12077 + trace->pid = current->pid;
12078 + trace->truncated = 0;
12082 + trace->addresses[i++] = (void *)regs->REG_INS_PTR;
12084 + frame_pointer = (void *)regs->REG_FRAME_PTR;
12086 + while (read_frame (frame_pointer, &frame) == 0 &&
12087 + i < SYSPROF_MAX_ADDRESSES &&
12088 + (unsigned long)frame_pointer >= regs->REG_STACK_PTR)
12090 + trace->addresses[i++] = (void *)frame.return_address;
12091 + frame_pointer = (StackFrame *)frame.next;
12094 + trace->n_addresses = i;
12096 + if (i == SYSPROF_MAX_ADDRESSES)
12097 + trace->truncated = 1;
12099 + trace->truncated = 0;
12102 + if (head++ == &stack_traces[N_TRACES - 1])
12103 + head = &stack_traces[0];
12105 + wake_up (&wait_for_trace);
12108 + atomic_inc(&in_timer_notify);
12113 +procfile_read(char *buffer,
12114 + char **buffer_location,
12120 + if (head == tail)
12121 + return -EWOULDBLOCK;
12123 + *buffer_location = (char *)tail;
12125 + BUG_ON(tail->pid == 0);
12127 + if (tail++ == &stack_traces[N_TRACES - 1])
12128 + tail = &stack_traces[0];
12130 + return sizeof (SysprofStackTrace);
12133 +struct proc_dir_entry *trace_proc_file;
12134 +static unsigned int
12135 +procfile_poll(struct file *filp, poll_table *poll_table)
12137 + if (head != tail)
12138 + return POLLIN | POLLRDNORM;
12140 + poll_wait(filp, &wait_for_trace, poll_table);
12142 + if (head != tail)
12143 + return POLLIN | POLLRDNORM;
12151 + static struct file_operations fops;
12153 + trace_proc_file =
12154 + create_proc_entry ("sysprof-trace", S_IFREG | S_IRUGO, &proc_root);
12156 + if (!trace_proc_file)
12159 + fops = *trace_proc_file->proc_fops;
12160 + fops.poll = procfile_poll;
12162 + trace_proc_file->read_proc = procfile_read;
12163 + trace_proc_file->proc_fops = &fops;
12164 + trace_proc_file->size = sizeof (SysprofStackTrace);
12166 + register_timer_hook (timer_notify);
12168 + printk(KERN_ALERT "sysprof: loaded (%s)\n", PACKAGE_VERSION);
12174 +cleanup_module(void)
12176 + unregister_timer_hook (timer_notify);
12178 + remove_proc_entry("sysprof-trace", &proc_root);
12180 + printk(KERN_ALERT "sysprof: unloaded\n");
12183 diff --git a/drivers/sysprof/sysprof-module.h b/drivers/sysprof/sysprof-module.h
12184 new file mode 100644
12185 index 0000000..66a11ae
12187 +++ b/drivers/sysprof/sysprof-module.h
12189 +/* Sysprof -- Sampling, systemwide CPU profiler
12190 + * Copyright 2004, Red Hat, Inc.
12191 + * Copyright 2004, 2005, Soeren Sandmann
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.
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.
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.
12208 +#ifndef SYSPROF_MODULE_H
12209 +#define SYSPROF_MODULE_H
12211 +typedef struct SysprofStackTrace SysprofStackTrace;
12213 +#define SYSPROF_MAX_ADDRESSES 512
12215 +struct SysprofStackTrace
12217 + int pid; /* -1 if in kernel */
12219 + int n_addresses; /* note: this can be 1 if the process was compiled
12220 + * with -fomit-frame-pointer or is otherwise weird
12222 + void *addresses[SYSPROF_MAX_ADDRESSES];
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
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
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
12247 select FB_MODE_HELPERS
12248 @@ -1383,7 +1383,7 @@ config FB_SAVAGE_ACCEL
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");
12261 +config FB_OLPC_DCON
12262 + tristate "One Laptop Per Child Display CONtroller support"
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'.
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/
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 */
12293 +fb_powerup(struct fb_info *info)
12297 + if (!info || info->state == FBINFO_STATE_RUNNING)
12300 + if (info->fbops->fb_powerup)
12301 + ret = info->fbops->fb_powerup(info);
12304 + acquire_console_sem();
12305 + fb_set_suspend(info, 0);
12306 + release_console_sem();
12313 +fb_powerdown(struct fb_info *info)
12317 + if (!info || info->state == FBINFO_STATE_SUSPENDED)
12320 + /* Tell everybody that the fbdev is going down */
12321 + acquire_console_sem();
12322 + fb_set_suspend(info, 1);
12323 + release_console_sem();
12325 + if (info->fbops->fb_powerdown)
12326 + ret = info->fbops->fb_powerdown(info);
12328 + /* If the power down failed, then un-notify */
12331 + acquire_console_sem();
12332 + fb_set_suspend(info, 0);
12333 + release_console_sem();
12340 fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
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
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.
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>
12372 #include "geodefb.h"
12373 #include "display_gx.h"
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)
12379 - return CONFIG_FB_GEODE_GX_FBSIZE;
12380 + u32 in = readl(reg);
12382 + writel(val, reg);
12386 unsigned int gx_frame_buffer_size(void)
12390 +#ifdef CONFIG_OLPC
12391 + if (machine_is_olpc() && !olpc_has_vsa()) {
12393 + rdmsr(GLIU0_P2D_RO0, lo, hi);
12395 + /* Top page number */
12396 + val = ((hi & 0xff) << 12) | ((lo & 0xfff00000) >> 20);
12398 + val -= (lo & 0x000fffff); /* Subtract bottom page number */
12399 + val += 1; /* Adjust page count */
12400 + return (val << 12);
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);
12413 int gx_line_delta(int xres, int bpp)
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);
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 */
12424 - /* Wait for pending memory requests before disabling the FIFO load. */
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);
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. */
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);
12444 - * Setup new mode.
12446 + /* Setup DCLK and its divisor. */
12447 + par->vid_ops->set_dclk(info);
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;
12455 /* Framebuffer start offset. */
12456 - writel(0, par->dc_regs + DC_FB_ST_OFFSET);
12457 + rmwl(0, par->dc_regs + DC_FB_ST_OFFSET);
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);
12465 + rmwl(((info->var.xres * info->var.bits_per_pixel/8) >> 3) + 2,
12466 + par->dc_regs + DC_LINE_SIZE);
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;
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);
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);
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);
12494 par->vid_ops->configure_display(info);
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
12504 +/* Used for memory dection on the OLPC */
12505 +#define GLIU0_P2D_RO0 0x10000029
12507 /* Display controller registers */
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
12514 +++ b/drivers/video/geode/geode_regs.h
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.
12522 +#ifndef _GEODE_REGS_H_
12523 +#define _GEODE_REGS_H_
12527 +#define GX_VP_MSR_PAD_SELECT 0xC0002011
12528 +#define LX_VP_MSR_PAD_SELECT 0x48000011
12530 +#define GEODE_MSR_GLCP_DOTPLL 0x4c000015
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)
12538 +#define VP_FP_START 0x400
12543 +#define GP_REG_SIZE 0x7C
12544 +#define DC_REG_SIZE 0xF0
12545 +#define VP_REG_SIZE 0x158
12546 +#define FP_REG_SIZE 0x70
12550 +#define GP_REG_SIZE 0x50
12551 +#define DC_REG_SIZE 0x90
12552 +#define VP_REG_SIZE 0x138
12553 +#define FP_REG_SIZE 0x70
12557 +#define DC_PAL_SIZE 0x105
12559 +struct geoderegs {
12574 + unsigned char b[GP_REG_SIZE];
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 */
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 */
12614 + unsigned char b[DC_REG_SIZE];
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 */
12656 + u32 irq_filt_ctl;
12659 + u32 vbi_event_ctl;
12663 + u32 vbi_ln_event;
12666 + u32 clr_key_mask;
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 */
12683 + unsigned char b[VP_REG_SIZE];
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 */
12724 + u64 vye; /* 0x138 */
12725 + u64 a1ye; /* 0x140 */
12726 + u32 a2ye; /* 0x148 */
12727 + u32 a3ye; /* 0x150 */
12733 + unsigned char b[FP_REG_SIZE];
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 */
12753 + u32 pal[DC_PAL_SIZE];
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
12763 #ifndef __GEODEFB_H__
12764 #define __GEODEFB_H__
12766 +#define FB_POWER_STATE_OFF 0
12767 +#define FB_POWER_STATE_SUSPEND 1
12768 +#define FB_POWER_STATE_ON 2
12770 struct geodefb_info;
12772 struct geode_dc_ops {
12773 @@ -21,18 +25,24 @@ struct geode_dc_ops {
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);
12782 struct geodefb_par {
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 */
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;
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>
12812 #include "geodefb.h"
12813 #include "display_gx.h"
12814 #include "video_gx.h"
12816 +#define FBIOSGAMMA _IOW('F', 0x20, void *)
12817 +#define FBIOGGAMMA _IOW('F', 0x21, void *)
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 *)
12828 static char *mode_option;
12829 +static int noclear;
12830 +struct fb_info *gxfb_info;
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 }
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 }
12852 static int gxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
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)
12859 -static int gxfb_set_par(struct fb_info *info)
12860 +int gxfb_set_par(struct fb_info *info)
12862 struct geodefb_par *par = info->par;
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);
12868 +static int fbsize;
12870 static int __init gxfb_map_video_memory(struct fb_info *info, struct pci_dev *dev)
12872 struct geodefb_par *par = info->par;
12876 ret = pci_enable_device(dev);
12880 + ret = pci_request_region(dev, 1, "gxfb (graphics processor)");
12884 + par->gp_regs = ioremap(pci_resource_start(dev, 1),
12885 + pci_resource_len(dev, 1));
12886 + if (!par->gp_regs)
12889 ret = pci_request_region(dev, 3, "gxfb (video processor)");
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)");
12896 - if ((fb_len = gx_frame_buffer_size()) < 0)
12899 + /* If the fbsize wasn't specified then try to probe it */
12902 + fbsize = gx_frame_buffer_size();
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)
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 */
12918 writel(info->fix.smem_start & 0xFF000000,
12919 par->dc_regs + DC_GLIU0_MEM_OFFSET);
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);
12928 +static int gxfb_ioctl( struct fb_info *info, unsigned int cmd,
12929 + unsigned long arg)
12931 + unsigned int gamma[GXFB_GAMMA_DWORDS];
12932 + int ret = -EINVAL;
12933 + struct geodefb_par *par = info->par;
12938 + /* Read the gamma information from the user - 256 dwords */
12940 + if (copy_from_user(gamma, (void * __user) arg, GXFB_GAMMA_SIZE))
12943 + writel(0, par->vid_regs + GX_GAR);
12945 + /* Sequential writes to the data register will increment the
12946 + address automatically */
12948 + for(i = 0; i < GXFB_GAMMA_DWORDS; i++)
12949 + writel(gamma[i] & 0xFFFFFF, par->vid_regs + GX_GDR);
12951 + writel(readl(par->vid_regs + GX_MISC) & ~GX_MISC_GAM_EN,
12952 + par->vid_regs + GX_MISC);
12958 + if (readl(par->vid_regs + GX_MISC) & GX_MISC_GAM_EN)
12961 + memset(gamma, 0, GXFB_GAMMA_SIZE);
12962 + writel(0, par->vid_regs + GX_GAR);
12964 + for(i = 0; i < GXFB_GAMMA_DWORDS;i++)
12965 + gamma[i] = readl(par->vid_regs + GX_GDR);
12967 + if (copy_to_user((void * __user) arg, gamma, GXFB_GAMMA_SIZE))
12977 + dump_regs(info, 0);
12982 + dump_regs(info, 1);
12987 + dump_regs(info, 2);
12992 + dump_regs(info, 3);
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,
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)
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)
13024 + if (gxfb_info != NULL) {
13025 + struct geodefb_par *par = gxfb_info->par;
13026 + par->fbactive = (action == CONSOLE_EVENT_SWITCH_TEXT) ? 0 : 1;
13029 + return NOTIFY_OK;
13032 +static struct notifier_block gxfb_console_notifier = {
13033 + .notifier_call = gxfb_console_notify
13038 +static int gxfb_suspend(struct pci_dev *pdev, pm_message_t state)
13040 + struct fb_info *info = pci_get_drvdata(pdev);
13041 + struct geodefb_par *par = info->par;
13043 + if (pdev->dev.power.power_state.event == state.event)
13046 + if (state.event == PM_EVENT_SUSPEND) {
13048 + acquire_console_sem();
13049 + gxfb_powerdown(info);
13051 + par->state = FB_POWER_STATE_OFF;
13052 + fb_set_suspend(info, 1);
13054 + release_console_sem();
13057 + pdev->dev.power.power_state = state;
13061 +static int gxfb_resume(struct pci_dev *pdev)
13063 + struct fb_info *info = pci_get_drvdata(pdev);
13065 + acquire_console_sem();
13067 + /* Turn the engine completely on */
13069 + if (gxfb_powerup(info))
13070 + printk(KERN_ERR "gxfb: Powerup failed\n");
13072 + fb_set_suspend(info, 0);
13073 + release_console_sem();
13075 + pdev->dev.power.power_state = PMSG_ON;
13080 +static int __init gxfb_probe(struct pci_dev *pdev,
13081 + const struct pci_device_id *id)
13083 struct geodefb_par *par;
13084 - struct fb_info *info;
13088 - info = gxfb_init_fbinfo(&pdev->dev);
13090 + struct fb_videomode *modedb_ptr;
13093 + gxfb_info = gxfb_init_fbinfo(&pdev->dev);
13094 + if (gxfb_info == NULL)
13098 + par = gxfb_info->par;
13100 /* GX display controller and GX video device. */
13101 par->dc_ops = &gx_dc_ops;
13102 par->vid_ops = &gx_vid_ops;
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");
13109 @@ -333,32 +519,60 @@ static int __init gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *i
13111 par->enable_crt = 1;
13113 - ret = fb_find_mode(&info->var, info, mode_option,
13114 - gx_modedb, ARRAY_SIZE(gx_modedb), NULL, 16);
13115 + /* Get the current dotclock */
13117 + par->curdclk = (par->vid_ops->get_dclk) ? par->vid_ops->get_dclk(gxfb_info) : 0;
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.
13124 + modedb_ptr = (struct fb_videomode *) gx_modedb;
13125 + modedb_size = ARRAY_SIZE(gx_modedb);
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);
13134 + ret = fb_find_mode(&gxfb_info->var, gxfb_info, mode_option,
13135 + modedb_ptr, modedb_size, NULL, 16);
13137 if (ret == 0 || ret == 4) {
13138 dev_err(&pdev->dev, "could not find valid video mode\n");
13143 + /* Clear the screen of garbage, unless noclear was specified,
13144 + * in which case we assume the user knows what he is doing */
13147 + memset_io(gxfb_info->screen_base, 0, gxfb_info->fix.smem_len);
13149 + gxfb_check_var(&gxfb_info->var, gxfb_info);
13150 + gxfb_set_par(gxfb_info);
13152 + /* We are powered up */
13153 + par->state = FB_POWER_STATE_ON;
13155 - /* Clear the frame buffer of garbage. */
13156 - memset_io(info->screen_base, 0, info->fix.smem_len);
13158 - gxfb_check_var(&info->var, info);
13159 - gxfb_set_par(info);
13160 + console_event_register(&gxfb_console_notifier);
13162 - if (register_framebuffer(info) < 0) {
13163 + if (register_framebuffer(gxfb_info) < 0) {
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);
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);
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);
13186 - framebuffer_release(info);
13188 + framebuffer_release(gxfb_info);
13193 @@ -397,9 +612,7 @@ static void gxfb_remove(struct pci_dev *pdev)
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,
13200 + { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_GX_VIDEO) },
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,
13209 + .suspend = gxfb_suspend,
13210 + .resume = gxfb_resume
13215 -static int __init gxfb_setup(char *options)
13217 +static int __init gxfb_setup(char *options) {
13221 if (!options || !*options)
13224 - while ((opt = strsep(&options, ",")) != NULL) {
13225 + while((opt = strsep(&options, ",")) != NULL) {
13229 - mode_option = opt;
13230 + if (!strncmp(opt, "fbsize:", 7))
13231 + fbsize = simple_strtoul(opt+7, NULL, 0);
13232 + else if (!strcmp(opt, "noclear"))
13235 + mode_option = opt;
13239 @@ -444,7 +665,6 @@ static int __init gxfb_init(void)
13241 return pci_register_driver(&gxfb_driver);
13244 static void __exit gxfb_cleanup(void)
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>])");
13251 +module_param(fbsize, int, 0);
13252 +MODULE_PARM_DESC(fbsize, "video memory size");
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);
13272 +/* ioctl() defines */
13274 +#define FBIOSGAMMA _IOW('F', 0x20, void *)
13275 +#define FBIOGGAMMA _IOW('F', 0x21, void *)
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))
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
13289 #include <linux/init.h>
13290 #include <linux/pci.h>
13291 #include <linux/uaccess.h>
13292 +#include <asm/olpc.h>
13296 @@ -35,186 +36,84 @@ static int fbsize;
13299 const struct fb_videomode geode_modedb[] __initdata = {
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 },
13316 - { NULL, 70, 640, 400, 39770, 40, 8, 28, 5, 96, 2,
13317 - FB_SYNC_HOR_HIGH_ACT,
13318 - FB_VMODE_NONINTERLACED, 0 },
13320 - { NULL, 70, 640, 480, 35014, 88, 24, 15, 2, 64, 3,
13321 - 0, FB_VMODE_NONINTERLACED, 0 },
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 },
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 },
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 },
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 },
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 },
13360 - { NULL, 56, 800, 600, 27901, 128, 24, 22, 1, 72, 2,
13361 - 0, FB_VMODE_NONINTERLACED, 0 },
13363 - { NULL, 60, 800, 600, 25131, 72, 32, 23, 1, 136, 4,
13364 - 0, FB_VMODE_NONINTERLACED, 0 },
13366 - { NULL, 70, 800, 600, 21873, 120, 40, 21, 4, 80, 3,
13367 - 0, FB_VMODE_NONINTERLACED, 0 },
13369 - { NULL, 72, 800, 600, 20052, 64, 56, 23, 37, 120, 6,
13370 - 0, FB_VMODE_NONINTERLACED, 0 },
13372 - { NULL, 75, 800, 600, 20202, 160, 16, 21, 1, 80, 3,
13373 - 0, FB_VMODE_NONINTERLACED, 0 },
13375 - { NULL, 85, 800, 600, 17790, 152, 32, 27, 1, 64, 3,
13376 - 0, FB_VMODE_NONINTERLACED, 0 },
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 },
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 }
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 }
13542 static int lxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
13544 if (var->xres > 1920 || var->yres > 1440)
13545 @@ -379,16 +278,55 @@ static int __init lxfb_map_video_memory(struct fb_info *info,
13549 +static int lxfb_set_gamma(struct fb_info *info, void * __user data)
13551 + unsigned int gamma[LXFB_GAMMA_DWORDS];
13553 + if (copy_from_user(gamma, data, LXFB_GAMMA_SIZE))
13556 + lx_set_gamma(info, gamma, LXFB_GAMMA_SIZE);
13560 +static int lxfb_get_gamma(struct fb_info *info, void * __user data)
13562 + unsigned int gamma[LXFB_GAMMA_DWORDS];
13563 + memset(gamma, 0, sizeof(gamma));
13565 + lx_get_gamma(info, gamma, LXFB_GAMMA_DWORDS);
13567 + return copy_to_user(data, gamma, LXFB_GAMMA_SIZE) ?
13571 +static int lxfb_ioctl( struct fb_info *info, unsigned int cmd,
13572 + unsigned long arg)
13576 + return lxfb_set_gamma(info, (void * __user) arg);
13579 + return lxfb_get_gamma(info, (void * __user) arg);
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,
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)
13607 +static int lxfb_suspend(struct pci_dev *pdev, pm_message_t state)
13609 + struct fb_info *info = pci_get_drvdata(pdev);
13611 + if (pdev->dev.power.power_state.event == state.event)
13614 + if (state.event == PM_EVENT_SUSPEND) {
13616 + acquire_console_sem();
13617 + lx_shutdown(info);
13618 + fb_set_suspend(info, 1);
13619 + release_console_sem();
13622 + pdev->dev.power.power_state = state;
13626 +static int lxfb_resume(struct pci_dev *pdev)
13628 + struct fb_info *info = pci_get_drvdata(pdev);
13630 + acquire_console_sem();
13632 + /* Turn the engine completely on */
13634 + lx_powerup(info);
13635 + fb_set_suspend(info, 0);
13636 + release_console_sem();
13638 + pdev->dev.power.power_state = PMSG_ON;
13644 static int __init lxfb_probe(struct pci_dev *pdev,
13645 const struct pci_device_id *id)
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);
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);
13658 ret = fb_find_mode(&info->var, info, mode_option,
13659 modedb_ptr, modedb_size, NULL, 16);
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,
13666 + .suspend = lxfb_suspend,
13667 + .resume = lxfb_resume
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
13677 #include <linux/fb.h>
13678 #include <linux/uaccess.h>
13679 #include <linux/delay.h>
13680 +#include <asm/olpc.h>
13685 +#include "geode_regs.h"
13688 * Support panel scaling
13690 @@ -290,6 +294,19 @@ unsigned int lx_framebuffer_size(void)
13694 +#ifdef CONFIG_OLPC
13695 + if (machine_is_olpc() && !olpc_has_vsa()) {
13697 + rdmsr(MSR_LX_GLIU0_P2D_RO0, lo, hi);
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);
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);
13714 +void lx_set_gamma(struct fb_info *info, unsigned int *gamma, int len)
13717 + struct lxfb_par *par = info->par;
13719 + writel(0, par->df_regs + DF_PAR);
13721 + /* Sequential writes to the data register will increment the
13722 + address automatically */
13724 + for(i = 0; i < len; i++)
13725 + writel(gamma[i] & 0xFFFFFF, par->df_regs + DF_PDR);
13727 + writel(readl(par->df_regs + DF_MISC) & ~DF_MISC_GAM_BYPASS,
13728 + par->df_regs + DF_MISC);
13731 +void lx_get_gamma(struct fb_info *info, unsigned int *gamma, int len)
13734 + struct lxfb_par *par = info->par;
13736 + writel(0, par->df_regs + DF_PAR);
13738 + for(i = 0; i < len;i++)
13739 + gamma[i] = readl(par->df_regs + DF_PDR);
13742 void lx_set_mode(struct fb_info *info)
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;
13748 /* Unlock the DC registers */
13749 + readl(par->dc_regs + DC_UNLOCK);
13750 writel(DC_UNLOCK_CODE, par->dc_regs + DC_UNLOCK);
13752 lx_graphics_disable(info);
13753 @@ -534,3 +580,285 @@ int lx_blank_display(struct fb_info *info, int blank_mode)
13758 +static struct geoderegs saved_regs;
13760 +static void lx_save_regs(struct fb_info *info, struct geoderegs *regs)
13762 + struct lxfb_par *par = info->par;
13765 + /* Wait for the command buffer to empty */
13766 + while(!(readl(par->gp_regs + 0x44) & (1 << 4)));
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);
13773 + writel(0x4758, par->dc_regs + 0x00);
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);
13780 + /* Save the palettes */
13781 + writel(0, par->dc_regs + 0x70);
13783 + for(i = 0; i < DC_PAL_SIZE; i++)
13784 + regs->pal[i] = readl(par->dc_regs + 0x74);
13786 + writel(0, par->df_regs + 0x38);
13788 + for(i = 0; i <= 0xFF; i++)
13789 + regs->gamma[i] = readl(par->df_regs + 0x40);
13792 +static void lx_restore_regs(struct fb_info *info, struct geoderegs *regs)
13794 + struct lxfb_par *par = info->par;
13797 + /* == DOTPLL == */
13799 + lx_set_dotpll((u32) (regs->msr.dotpll >> 32));
13803 + wrmsrl(MSR_LX_DF_GLCONFIG, regs->msr.dfglcfg);
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);
13822 + /* Writing to these registers would cause a blt to happen */
13823 + /* 0x38, 0x3c, 0x40 */
13825 + /* Status register (0x44) is read only */
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);
13838 + /* FIXME: Restore the LUT data here */
13840 + writel(regs->gp.r.int_cntrl, par->gp_regs + 0x70);
13844 + /* Write the unlock value */
13845 + writel(0x4758, par->dc_regs + 0x00);
13847 + /* Write the palette data first */
13849 + writel(0, par->dc_regs + 0x70);
13851 + for(i = 0; i < DC_PAL_SIZE; i++)
13852 + writel(regs->pal[i], par->dc_regs + 0x74);
13855 + wrmsrl(MSR_LX_DC_SPARE, regs->msr.dcspare);
13857 + /* Write the gcfg register without the enables */
13858 + writel(regs->dc.r.gcfg & ~0x0F, par->dc_regs + 0x04);
13860 + /* Write the vcfg register without the enables */
13861 + writel(regs->dc.r.dcfg & ~0x19, par->dc_regs + 0x08);
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);
13887 + /* Skip register 0x6C (line_cnt), 0x70/0x74 (palette),
13888 + 0x78 (diagnostic), and 0x7c (diagnostic)
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);
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);
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);
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);
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);
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);
13926 + wrmsrl(MSR_LX_DF_PADSEL, regs->msr.padsel);
13928 + /* Write gamma information first */
13930 + writel(0, par->df_regs + 0x38);
13932 + for(i = 0; i <= 0xFF; i++)
13933 + writel((u32) regs->gamma[i], par->df_regs + 0x40);
13935 + /* Don't enable video yet */
13936 + writel((u32) regs->vp.r.vcfg & ~0x01, par->df_regs + 0x00);
13938 + /* Don't enable the CRT yet */
13939 + writel((u32) regs->vp.r.dcfg & ~0x0F, par->df_regs + 0x08);
13941 + /* Write the rest of the VP registers */
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);
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);
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);
13986 + /* Final enables */
13988 + val = readl(par->df_regs + 0x410);
13990 + /* Control the panel */
13991 + if (regs->fp.r.pm & (1 << 24)) {
13993 + if (!(val & 0x09))
13994 + writel(regs->fp.r.pm, par->df_regs + 0x410);
13997 + if (!(val & 0x05))
13998 + writel(regs->fp.r.pm, par->df_regs + 0x410);
14001 + /* Turn everything on */
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);
14009 +static int lx_power_on = 1;
14011 +int lx_shutdown(struct fb_info *info)
14013 + struct lxfb_par *par = info->par;
14015 + if (lx_power_on == 0)
14018 + writel(DC_UNLOCK_CODE, par->dc_regs + DC_UNLOCK);
14019 + lx_save_regs(info, &saved_regs);
14020 + lx_graphics_disable(info);
14026 +int lx_powerup(struct fb_info *info)
14028 + struct lxfb_par *par = info->par;
14030 + if (lx_power_on == 1)
14033 + lx_restore_regs(info, &saved_regs);
14034 + writel(0, par->dc_regs + DC_UNLOCK);
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
14043 +++ b/drivers/video/geode/suspend_gx.c
14045 +#include <linux/fb.h>
14046 +#include <asm/io.h>
14047 +#include <asm/msr.h>
14049 +#include "geodefb.h"
14050 +#include "video_gx.h"
14052 +void gx_set_dotpll(struct fb_info *info, struct geoderegs *regs)
14054 + int timeout = 1000;
14056 + u64 rstpll, dotpll;
14058 + rdmsrl(MSR_GLCP_SYS_RSTPLL, rstpll);
14059 + rdmsrl(MSR_GLCP_DOTPLL, dotpll);
14061 + dotpll &= 0x00000000ffffffffull;
14062 + dotpll |= regs->msr.dotpll & 0xffffffff00000000ull;
14064 + dotpll |= MSR_GLCP_DOTPLL_DOTRESET;
14065 + dotpll &= ~MSR_GLCP_DOTPLL_BYPASS;
14067 + wrmsrl(MSR_GLCP_DOTPLL, dotpll);
14069 + rstpll |= (regs->msr.rstpll &
14070 + ( MSR_GLCP_SYS_RSTPLL_DOTPREDIV2 |
14071 + MSR_GLCP_SYS_RSTPLL_DOTPREMULT2 |
14072 + MSR_GLCP_SYS_RSTPLL_DOTPOSTDIV3));
14074 + wrmsrl(MSR_GLCP_SYS_RSTPLL, rstpll);
14075 + dotpll &= ~(MSR_GLCP_DOTPLL_DOTRESET);
14076 + wrmsrl(MSR_GLCP_DOTPLL, dotpll);
14079 + rdmsrl(MSR_GLCP_DOTPLL, dotpll);
14080 + } while (timeout-- && !(dotpll & MSR_GLCP_DOTPLL_LOCK));
14083 +/* FIXME: Make sure nothing is read to clear */
14085 +void gx_save_regs(struct fb_info *info, struct geoderegs *regs)
14087 + struct geodefb_par *par = info->par;
14090 + /* Wait for the BLT engine to stop being busy */
14091 + while(readl(par->gp_regs + 0x44) & 0x05);
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);
14097 + writel(0x4758, par->dc_regs + 0x00);
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);
14104 + /* Save the palettes */
14105 + writel(0, par->dc_regs + 0x70);
14107 + for(i = 0; i < DC_PAL_SIZE; i++)
14108 + regs->pal[i] = readl(par->dc_regs + 0x74);
14110 + writel(0, par->vid_regs + 0x38);
14112 + for(i = 0; i < 0xFF; i++)
14113 + regs->gamma[i] = readl(par->vid_regs + 0x40);
14116 +void gx_restore_regs(struct fb_info *info, struct geoderegs *regs)
14118 + struct geodefb_par *par = info->par;
14122 + gx_set_dotpll(info, regs);
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);
14141 + /* Don't write the raster / vector / blt mode regs */
14142 + /* status register is read only */
14144 + writel(regs->gp.r.hst_src, par->gp_regs + 0x48);
14145 + writel(regs->gp.r.base_offset, par->gp_regs + 0x4c);
14149 + /* Write the unlock value */
14150 + writel(0x4758, par->dc_regs + 0x00);
14152 + writel(0, par->dc_regs + 0x70);
14154 + for(i = 0; i < DC_PAL_SIZE; i++)
14155 + writel(regs->pal[i], par->dc_regs + 0x74);
14157 + /* Write the gcfg register without the enables */
14158 + writel(regs->dc.r.gcfg & ~0x0F, par->dc_regs + 0x04);
14160 + /* Write the vcfg register without the enables */
14161 + writel(regs->dc.r.dcfg & ~0x19, par->dc_regs + 0x08);
14163 + /* Write the rest of the active registers */
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);
14185 + /* Don't write the line_cnt or diag registers */
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);
14194 + wrmsrl(GX_VP_MSR_PAD_SELECT, regs->msr.padsel);
14196 + writel(0, par->vid_regs + 0x38);
14198 + for(i = 0; i < 0xFF; i++)
14199 + writel((u32) regs->gamma[i], par->vid_regs + 0x40);
14201 + /* Don't enable video yet */
14202 + writel((u32) regs->vp.r.vcfg & ~0x01, par->vid_regs + 0x00);
14204 + /* Don't enable the CRT yet */
14205 + writel((u32) regs->vp.r.dcfg & ~0x0F, par->vid_regs + 0x08);
14207 + /* Write the rest of the VP registers */
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);
14239 + /* FP registers */
14241 + writel((u32) regs->fp.r.pt1, par->vid_regs + 0x400);
14242 + writel((u32) regs->fp.r.pt2, par->vid_regs + 0x408);
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);
14254 + /* Final enables */
14256 + val = readl(par->vid_regs + 0x410);
14258 + /* Control the panel */
14259 + if (regs->fp.r.pm & (1 << 24)) {
14261 + if (!(val & 0x09))
14262 + writel(regs->fp.r.pm, par->vid_regs + 0x410);
14265 + if (!(val & 0x05))
14266 + writel(regs->fp.r.pm, par->vid_regs + 0x410);
14269 + /* Turn everything on */
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);
14280 +void dump_regs(struct fb_info *info, int mode) {
14282 + struct geodefb_par *par = info->par;
14287 + for(i = 0; i < GP_REG_SIZE; i += 4) {
14288 + val = readl(par->gp_regs + i);
14293 + writel(0x4758, par->dc_regs + 0x00);
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);
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);
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);
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>
14327 #include "geodefb.h"
14328 #include "video_gx.h"
14329 +#include "display_gx.h"
14331 +/* This structure is used to store the saved registers during suspend */
14332 +static struct geoderegs gx_saved_regs;
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 */
14349 -static void gx_set_dclk_frequency(struct fb_info *info)
14350 +void gx_set_dclk_frequency(struct fb_info *info)
14352 + struct geodefb_par *par = info->par;
14353 const struct gx_pll_entry *pll_table;
14356 @@ -173,115 +178,169 @@ static void gx_set_dclk_frequency(struct fb_info *info)
14358 rdmsrl(MSR_GLCP_DOTPLL, dotpll);
14359 } while (timeout-- && !(dotpll & MSR_GLCP_DOTPLL_LOCK));
14361 + par->curdclk = pll_table[best_i].dotpll_value;
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 */
14369 +unsigned int gx_get_dclk(struct fb_info *info)
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;
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);
14384 + pll_table = gx_pll_table_48MHz;
14385 + pll_table_len = ARRAY_SIZE(gx_pll_table_48MHz);
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);
14394 - /* Turn off the panel */
14395 + for(i = 0; i < pll_table_len; i++) {
14396 + if (pll_table[i].dotpll_value == (u32) (dotpll >> 32))
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;
14407 +#define CMP(val, mask, res) (((val) & (mask)) == (res))
14409 - /* Set timing 1 */
14411 +gx_configure_tft(struct fb_info *info) {
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;
14421 - /* Set bits that are always on for TFT */
14422 + /* Set up the DF pad select MSR */
14425 + rdmsrl(GX_VP_MSR_PAD_SELECT, val);
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);
14434 if (!(info->var.sync & FB_SYNC_VERT_HIGH_ACT))
14435 - fp |= GX_FP_PT2_VSP;
14436 + sync |= GX_FP_PT2_VSP;
14438 if (!(info->var.sync & FB_SYNC_HOR_HIGH_ACT))
14439 - fp |= GX_FP_PT2_HSP;
14440 + sync |= GX_FP_PT2_HSP;
14442 - writel(fp, par->vid_regs + GX_FP_PT2);
14443 + /* We only need to turn off the panel if something changed */
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);
14450 + if (!CMP(fp1, GX_FP_PT1_VSIZE_MASK, info->var.yres << GX_FP_PT1_VSIZE_SHIFT) ||
14451 + (fp2 != (0x0F100000 | sync))) {
14453 - /* Enable the FP data and power (in case the BIOS didn't) */
14454 + /* Turn off the panel */
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);
14460 + /* Do we really need to turn off the panel? */
14461 + /* Possibly - we have a glitch somewhere */
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);
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);
14475 + writel(0x0F100000 | sync, par->vid_regs + GX_FP_PT2);
14478 + /* Set the dither control */
14479 + if (readl(par->vid_regs + GX_FP_DFC) != 0x70) {
14480 + writel(0x70, par->vid_regs + GX_FP_DFC);
14483 + /* Turn on the panel */
14485 fp = readl(par->vid_regs + GX_FP_PM);
14486 - fp |= GX_FP_PM_P;
14487 - writel(fp, par->vid_regs + GX_FP_PM);
14489 + if (!(fp & 0x09))
14490 + writel(fp | GX_FP_PM_P, par->vid_regs + GX_FP_PM);
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
14496 static void gx_configure_display(struct fb_info *info)
14498 struct geodefb_par *par = info->par;
14500 + u32 dcfg, misc, sync = 0;
14502 /* Set up the MISC register */
14504 misc = readl(par->vid_regs + GX_MISC);
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 */
14513 - /* Disable gamma correction */
14514 - misc |= GX_MISC_GAM_EN;
14516 - writel(misc, par->vid_regs + GX_MISC);
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);
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;
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;
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);
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);
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)) {
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);
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);
14574 - dcfg |= GX_DCFG_CRT_EN | GX_DCFG_DAC_BL_EN;
14575 + /* Set default sync skew. */
14576 + dcfg |= GX_DCFG_CRT_SYNC_SKW_DFLT;
14578 - /* Enable the external DAC VREF? */
14579 + /* Enable hsync and vsync. */
14580 + dcfg |= GX_DCFG_HSYNC_EN | GX_DCFG_VSYNC_EN;
14582 - writel(dcfg, par->vid_regs + GX_DCFG);
14583 + /* Enable the display logic */
14584 + dcfg |= GX_DCFG_CRT_EN | GX_DCFG_DAC_BL_EN;
14586 + writel(dcfg, par->vid_regs + GX_DCFG);
14589 /* Set up the flat panel (if it is enabled) */
14591 @@ -289,6 +348,100 @@ static void gx_configure_display(struct fb_info *info)
14592 gx_configure_tft(info);
14595 +int gxfb_powerdown(struct fb_info *info)
14597 + struct geodefb_par *par = info->par;
14599 + /* We're already suspended */
14601 + if (par->state != FB_POWER_STATE_ON)
14604 + /* Save the registers */
14605 + gx_save_regs(info, &gx_saved_regs);
14607 + /* Shut down the engine */
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);
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);
14616 + writel(0x4758, par->dc_regs + DC_UNLOCK);
14618 + writel(gx_saved_regs.dc.r.gcfg & ~0x0F,
14619 + par->dc_regs + DC_GENERAL_CFG);
14621 + writel(gx_saved_regs.dc.r.dcfg & ~0x19,
14622 + par->dc_regs + DC_DISPLAY_CFG);
14624 + par->state = FB_POWER_STATE_SUSPEND;
14629 +int gxfb_powerup(struct fb_info *info)
14631 + struct geodefb_par *par = info->par;
14634 + if (par->state == FB_POWER_STATE_SUSPEND) {
14636 + writel(gx_saved_regs.dc.r.dcfg,
14637 + par->dc_regs + DC_DISPLAY_CFG);
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);
14642 + val = readl(par->vid_regs + GX_FP_PM);
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);
14651 + /* If the panel is currently on its way up, then wait up to 100ms
14654 + if (readl(par->vid_regs + GX_FP_PM) & 0x08) {
14657 + for(i = 0; i < 10; i++) {
14658 + if (readl(par->vid_regs + GX_FP_PM) & 0x01)
14665 + printk(KERN_ERR "gxfb: Panel power up timed out\n");
14668 + if (par->state == FB_POWER_STATE_ON)
14671 + switch(par->state) {
14672 + case FB_POWER_STATE_OFF:
14673 + gx_restore_regs(info, &gx_saved_regs);
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);
14685 + par->state = FB_POWER_STATE_ON;
14689 static int gx_blank_display(struct fb_info *info, int blank_mode)
14691 struct geodefb_par *par = info->par;
14692 @@ -315,6 +468,7 @@ static int gx_blank_display(struct fb_info *info, int blank_mode)
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);
14704 - /* Power on/off flat panel. */
14705 + /* Power on/off flat panel */
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)
14713 +extern struct fb_info *gxfb_info;
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
14720 +void gxfb_flatpanel_control(int state)
14722 + struct geodefb_par *par = gxfb_info->par;
14723 + u32 val, fp = readl(par->vid_regs + GX_FP_PM);
14726 + /* Turn on the panel if it isn't aleady */
14729 + if (!(val & 0x01))
14730 + val |= GX_FP_PM_P;
14733 + if (!(val & 0x02))
14734 + val &= ~GX_FP_PM_P;
14738 + writel(val, par->vid_regs + GX_FP_PM);
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,
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
14752 #ifndef __VIDEO_GX_H__
14753 #define __VIDEO_GX_H__
14755 +#include "geode_regs.h"
14757 extern struct geode_vid_ops gx_vid_ops;
14759 /* GX Flatpanel control MSR */
14760 @@ -20,6 +22,8 @@ extern struct geode_vid_ops gx_vid_ops;
14762 /* Geode GX video processor registers */
14764 +#define GX_VCFG 0x0000
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
14773 +/* Gamma correction RAM - address and data registers */
14775 +#define GX_GAR 0x038
14776 +#define GX_GDR 0x040
14778 +#define GXFB_GAMMA_DWORDS 256 /* number of dwords in the gamma ram */
14779 +#define GXFB_GAMMA_SIZE (GXFB_GAMMA_DWORDS * sizeof(unsigned int))
14781 /* Geode GX flat panel display control registers */
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)
14788 +int gxfb_powerdown(struct fb_info *info);
14789 +int gxfb_powerup(struct fb_info *info);
14791 +void gx_set_dclk_frequency(struct fb_info *info);
14792 +unsigned int gx_get_dclk(struct fb_info *info);
14794 +void gx_save_regs(struct fb_info *info, struct geoderegs *regs);
14795 +void gx_restore_regs(struct fb_info *info, struct geoderegs *regs);
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)
14806 +#define DEFAULT_MODEDB_INDEX 0
14808 static const struct fb_videomode modedb[] = {
14810 /* 640x400 @ 70 Hz, 31.5 kHz hsync */
14811 @@ -504,7 +506,8 @@ int fb_find_mode(struct fb_var_screeninfo *var,
14815 - default_mode = &db[0];
14816 + default_mode = (db == modedb) ?
14817 + &modedb[DEFAULT_MODEDB_INDEX] : &db[0];
14821 diff --git a/drivers/video/olpc_dcon.c b/drivers/video/olpc_dcon.c
14822 new file mode 100644
14823 index 0000000..d4ef138
14825 +++ b/drivers/video/olpc_dcon.c
14828 + * Mainly by David Woodhouse, somewhat modified by Jordan Crouse
14830 + * Copyright © 2006-2007 Red Hat, Inc.
14831 + * Copyright © 2006-2007 Advanced Micro Devices, Inc.
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.
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>
14857 +#include "olpc_dcon.h"
14859 +/* Module definitions */
14861 +static int resumeline = 898;
14862 +module_param(resumeline, int, 0444);
14864 +static int noinit;
14865 +module_param(noinit, int, 0444);
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);
14871 +/* I2C structures */
14873 +static struct i2c_driver dcon_driver;
14874 +static struct i2c_client *dcon_client;
14876 +/* Platform devices */
14877 +static struct platform_device *dcon_device;
14879 +/* Backlight device */
14880 +static struct backlight_device *dcon_bl_dev;
14882 +/* Base address of the GPIO registers */
14883 +static unsigned long gpio_base;
14885 +static struct fb_info *fbinfo;
14887 +/* Current source, initialized at probe time */
14888 +static int dcon_source;
14890 +/* Desired source */
14891 +static int dcon_pending;
14893 +/* Current output type */
14894 +static int dcon_output = DCON_OUTPUT_COLOR;
14896 +/* Current sleep status (not yet implemented) */
14897 +static int dcon_sleep_val = DCON_ACTIVE;
14899 +/* Shadow register for the DCON_REG_MODE register */
14900 +static unsigned short dcon_disp_mode;
14902 +/* Variables used during switches */
14903 +static int dcon_switched;
14905 +static DECLARE_WAIT_QUEUE_HEAD(dcon_wait_queue);
14907 +static unsigned short normal_i2c[] = { 0x0D, I2C_CLIENT_END };
14908 +I2C_CLIENT_INSMOD;
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)
14913 +/* The current backlight value - this saves us some smbus traffic */
14914 +static int bl_val = -1;
14916 +/* ===== API functions - these are called by a variety of users ==== */
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.
14923 +static int dcon_get_backlight(void)
14925 + if (dcon_client == NULL)
14928 + if (bl_val == -1)
14929 + bl_val = dcon_read(DCON_REG_BRIGHT) & 0x0F;
14934 +static void dcon_set_backlight(int level)
14936 + if (dcon_client == NULL)
14939 + if (bl_val == (level & 0x0F))
14942 + bl_val = level & 0x0F;
14943 + dcon_write(DCON_REG_BRIGHT, bl_val);
14945 + /* Purposely turn off the backlight when we go to level 0 */
14947 + if (bl_val == 0) {
14948 + dcon_disp_mode &= ~MODE_BL_ENABLE;
14949 + dcon_write(DCON_REG_MODE, dcon_disp_mode);
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);
14957 +/* Set the output type to either color or mono */
14959 +static int dcon_set_output(int arg)
14961 + if (dcon_output == arg)
14964 + dcon_output = arg;
14966 + if (arg == DCON_OUTPUT_MONO) {
14967 + dcon_disp_mode &= ~(MODE_CSWIZZLE | MODE_COL_AA);
14968 + dcon_disp_mode |= MODE_MONO_LUMA;
14971 + dcon_disp_mode &= ~(MODE_MONO_LUMA);
14972 + dcon_disp_mode |= MODE_CSWIZZLE;
14974 + dcon_disp_mode |= MODE_COL_AA;
14977 + dcon_write(DCON_REG_MODE, dcon_disp_mode);
14981 +/* For now, this will be really stupid - we need to address how
14982 + * DCONLOAD works in a sleep and account for it accordingly
14985 +static void dcon_sleep(int state)
14987 + /* Turn off the backlight and put the DCON to sleep */
14989 + if (state == dcon_sleep_val)
14992 + if (state == DCON_SLEEP) {
14993 + dcon_disp_mode &= ~MODE_BL_ENABLE;
14994 + dcon_disp_mode |= MODE_SLEEP;
14997 + /* Only re-enable the backlight if the backlight value is set */
15000 + dcon_disp_mode |= MODE_BL_ENABLE;
15002 + dcon_disp_mode &= ~MODE_SLEEP;
15005 + dcon_sleep_val = state;
15006 + dcon_write(DCON_REG_MODE, dcon_disp_mode);
15008 + /* We should turn off some stuff in the framebuffer - but what? */
15011 +/* Set the source of the display (CPU or DCON) */
15013 +static void dcon_source_switch(struct work_struct *work)
15015 + DECLARE_WAITQUEUE(wait, current);
15016 + int source = dcon_pending;
15018 + if (dcon_source == source)
15021 + dcon_switched = 0;
15023 + switch (source) {
15024 + case DCON_SOURCE_CPU:
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");
15030 + /* Wait up to one second for the scanline interrupt */
15031 + wait_event_timeout(dcon_wait_queue, dcon_switched == 1, HZ);
15034 + if (!dcon_switched)
15035 + printk(KERN_ERR "olpc-dcon: Timeout entering CPU mode; expect a screen glitch.\n");
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.
15043 + * For now, we just hope..
15045 + if (fb_powerup(fbinfo)) {
15046 + printk(KERN_ERR "olpc-dcon: Failed to enter CPU mode\n");
15047 + dcon_pending = DCON_SOURCE_DCON;
15051 + /* And turn off the DCON */
15052 + outl(1<<11, gpio_base + GPIOx_OUT_VAL);
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");
15058 + printk(KERN_INFO "olpc-dcon: The CPU has control\n");
15060 + case DCON_SOURCE_DCON:
15064 + add_wait_queue(&dcon_wait_queue, &wait);
15065 + set_current_state(TASK_UNINTERRUPTIBLE);
15067 + /* Clear GPIO11 (DCONLOAD) - this implies that the DCON is in
15070 + outl(1 << (11 + 16), gpio_base + GPIOx_OUT_VAL);
15072 + t = schedule_timeout(HZ/2);
15073 + remove_wait_queue(&dcon_wait_queue, &wait);
15074 + set_current_state(TASK_RUNNING);
15076 + if (!dcon_switched)
15077 + printk(KERN_ERR "olpc-dcon: Timeout entering DCON mode; expect a screen glitch.\n");
15079 + /* Turn off the graphics engine completely */
15080 + fb_powerdown(fbinfo);
15082 + printk(KERN_INFO "olpc-dcon: The DCON has control\n");
15089 + dcon_source = source;
15092 +static DECLARE_WORK(dcon_work, dcon_source_switch);
15094 +static int dcon_set_source(int arg)
15096 + if (arg != DCON_SOURCE_CPU && arg != DCON_SOURCE_DCON)
15099 + if (dcon_pending == arg)
15102 + dcon_pending = arg;
15103 + if ((dcon_source != arg) && !work_pending(&dcon_work))
15104 + schedule_work(&dcon_work);
15109 +static int dcon_set_source_sync(int arg)
15111 + int ret = dcon_set_source(arg);
15113 + flush_scheduled_work();
15117 +static int dconbl_set(struct backlight_device *dev) {
15119 + int level = dev->props.brightness;
15121 + if (dev->props.power != FB_BLANK_UNBLANK)
15124 + dcon_set_backlight(level);
15128 +static int dconbl_get(struct backlight_device *dev) {
15129 + return dcon_get_backlight();
15132 +static ssize_t dcon_mode_show(struct device *dev,
15133 + struct device_attribute *attr, char *buf)
15135 + return sprintf(buf, "%4.4X\n", dcon_disp_mode);
15138 +static ssize_t dcon_sleep_show(struct device *dev,
15139 + struct device_attribute *attr, char *buf)
15141 + return sprintf(buf, "%d\n", dcon_sleep_val);
15144 +static ssize_t /* __deprecated */ dcon_source_show(struct device *dev,
15145 + struct device_attribute *attr, char *buf)
15147 + printk(KERN_WARNING "olpc-dcon: using deprecated sysfs 'source' interface; use 'freeze' instead!\n");
15148 + return sprintf(buf, "%d\n", dcon_source);
15151 +static ssize_t dcon_freeze_show(struct device *dev,
15152 + struct device_attribute *attr, char *buf)
15154 + return sprintf(buf, "%d\n", dcon_source == DCON_SOURCE_DCON ? 1 : 0);
15157 +static ssize_t dcon_output_show(struct device *dev,
15158 + struct device_attribute *attr, char *buf)
15160 + return sprintf(buf, "%d\n", dcon_output);
15163 +static ssize_t dcon_resumeline_show(struct device *dev,
15164 + struct device_attribute *attr, char *buf)
15166 + return sprintf(buf, "%d\n", resumeline);
15169 +static int _strtoul(const char *buf, int len, unsigned int *val)
15173 + unsigned int output = simple_strtoul(buf, &endp, 0);
15174 + int size = endp - buf;
15176 + if (*endp && isspace(*endp))
15186 +static ssize_t dcon_output_store(struct device *dev,
15187 + struct device_attribute *attr, const char *buf, size_t count)
15190 + int rc = -EINVAL;
15192 + if (_strtoul(buf, count, &output))
15195 + if (output == DCON_OUTPUT_COLOR || output == DCON_OUTPUT_MONO) {
15196 + dcon_set_output(output);
15203 +static ssize_t /* __deprecated */ dcon_source_store(struct device *dev,
15204 + struct device_attribute *attr, const char *buf, size_t count)
15207 + int rc = -EINVAL;
15209 + printk(KERN_WARNING "olpc-dcon: using deprecated sysfs 'source' interface; use 'freeze' instead!\n");
15210 + if (_strtoul(buf, count, &output))
15213 + dcon_set_source(output);
15219 +static ssize_t dcon_freeze_store(struct device *dev,
15220 + struct device_attribute *attr, const char *buf, size_t count)
15223 + int rc = -EINVAL;
15225 + if (_strtoul(buf, count, &output))
15228 + dcon_set_source(output ? DCON_SOURCE_DCON : DCON_SOURCE_CPU);
15234 +static ssize_t dcon_resumeline_store(struct device *dev,
15235 + struct device_attribute *attr, const char *buf, size_t count)
15238 + int rc = -EINVAL;
15240 + if (_strtoul(buf, count, &rl))
15244 + dcon_write(DCON_REG_SCAN_INT, resumeline);
15250 +static ssize_t dcon_sleep_store(struct device *dev,
15251 + struct device_attribute *attr, const char *buf, size_t count)
15255 + if (_strtoul(buf, count, &output))
15258 + dcon_sleep(output ? DCON_SLEEP : DCON_ACTIVE);
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),
15271 +static struct backlight_ops dcon_bl_ops = {
15272 + .get_brightness = dconbl_get,
15273 + .update_status = dconbl_set
15276 +/* List of GPIOs that we care about:
15277 + (in) GPIO12 -- DCONBLNK
15278 + (in) GPIO[56] -- DCONSTAT[01]
15279 + (out) GPIO11 -- DCONLOAD
15282 +#define IN_GPIOS ((1<<5) | (1<<6) | (1<<7) | (1<<12))
15283 +#define OUT_GPIOS (1<<11)
15285 +static irqreturn_t dcon_interrupt(int, void *);
15287 +static int dcon_request_irq(void)
15289 + unsigned long lo, hi;
15290 + unsigned char lob;
15292 + rdmsr(MSR_LBAR_GPIO, lo, hi);
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");
15300 + /* Mask off the IO base address */
15301 + gpio_base = lo & 0x0000ff00;
15303 + /* Turn off the event enable for GPIO7 just to be safe */
15304 + outl(1 << (16+7), gpio_base + GPIOx_EVNT_EN);
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);
15310 + /* Set up the interrupt mappings */
15312 + /* Set the IRQ to pair 2 */
15313 + geode_gpio_event_irq(OLPC_GPIO_DCON_IRQ, 2);
15315 + /* Enable group 2 to trigger the DCON interrupt */
15316 + geode_gpio_set_irq(2, DCON_IRQ);
15318 + /* Select edge level for interrupt (in PIC) */
15320 + lob = inb(0x4d0);
15321 + lob &= ~(1 << DCON_IRQ);
15322 + outb(lob, 0x4d0);
15324 + /* Register the interupt handler */
15325 + if (request_irq(DCON_IRQ, &dcon_interrupt, 0, "DCON", &dcon_driver))
15328 + /* Clear INV_EN for GPIO7 (DCONIRQ) */
15329 + outl((1<<(16+7)), gpio_base + GPIOx_INV_EN);
15331 + /* Enable filter for GPIO12 (DCONBLANK) */
15332 + outl(1<<(12), gpio_base + GPIOx_IN_FLTR_EN);
15334 + /* Disable filter for GPIO7 */
15335 + outl(1<<(16+7), gpio_base + GPIOx_IN_FLTR_EN);
15337 + /* Disable event counter for GPIO7 (DCONIRQ) and GPIO12 (DCONBLANK) */
15339 + outl(1<<(16+7), gpio_base + GPIOx_EVNTCNT_EN);
15340 + outl(1<<(16+12), gpio_base + GPIOx_EVNTCNT_EN);
15342 + /* Add GPIO12 to the Filter Event Pair #7 */
15343 + outb(12, gpio_base + GPIO_FE7_SEL);
15345 + /* Turn off negative Edge Enable for GPIO12 */
15346 + outl(1<<(16+12), gpio_base + GPIOx_NEGEDGE_EN);
15348 + /* Enable negative Edge Enable for GPIO7 */
15349 + outl(1<<7, gpio_base + GPIOx_NEGEDGE_EN);
15351 + /* Zero the filter amount for Filter Event Pair #7 */
15352 + outw(0, gpio_base + GPIO_FLT7_AMNT);
15354 + /* Clear the negative edge status for GPIO7 and GPIO12 */
15355 + outl((1<<7) | (1<<12), gpio_base+0x4c);
15357 + /* FIXME: Clear the posiitive status as well, just to be sure */
15358 + outl((1<<7) | (1<<12), gpio_base+0x48);
15360 + /* Enable events for GPIO7 (DCONIRQ) and GPIO12 (DCONBLANK) */
15361 + outl((1<<(7))|(1<<12), gpio_base + GPIOx_EVNT_EN);
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;
15373 +static int dcon_reboot_notify(struct notifier_block *nb, unsigned long foo, void *bar)
15375 + if (dcon_client == NULL)
15378 + /* Turn off the DCON. Entirely. */
15379 + dcon_write(DCON_REG_MODE, 0x39);
15380 + dcon_write(DCON_REG_MODE, 0x32);
15384 +static int dcon_conswitch_notify(struct notifier_block *nb,
15385 + unsigned long mode, void *dummy)
15387 + if (mode == CONSOLE_EVENT_SWITCH_TEXT)
15388 + dcon_sleep(DCON_ACTIVE);
15393 +static struct notifier_block dcon_nb = {
15394 + .notifier_call = dcon_reboot_notify,
15398 +static struct notifier_block dcon_console_nb = {
15399 + .notifier_call = dcon_conswitch_notify,
15403 +static int dcon_probe(struct i2c_adapter *adap, int addr, int kind)
15405 + struct i2c_client *client;
15409 + if (!olpc_has_dcon()) {
15410 + printk("olpc-dcon: No DCON is attached.\n");
15414 + if (num_registered_fb >= 1)
15415 + fbinfo = registered_fb[0];
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);
15423 + client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
15424 + if (client == NULL)
15427 + strncpy(client->name, "OLPC-DCON", I2C_NAME_SIZE);
15428 + client->addr = addr;
15429 + client->adapter = adap;
15430 + client->driver = &dcon_driver;
15432 + if ((rc = i2c_attach_client(client)) != 0) {
15433 + printk(KERN_ERR "olpc-dcon: Unable to attach the I2C client.\n");
15437 + ver = i2c_smbus_read_word_data(client, DCON_REG_ID);
15439 + if ((ver >> 8) != 0xDC) {
15440 + printk(KERN_ERR "olpc-dcon: DCON ID not 0xDCxx: 0x%04x instead.\n", ver);
15445 + if ((rc = dcon_request_irq())) {
15446 + printk(KERN_ERR "olpc-dcon: Unable to grab IRQ.\n");
15450 + if (ver < 0xdc02 && !noinit) {
15451 + /* Initialize the DCON registers */
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);
15461 + /* Initialise SDRAM */
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);
15468 + /* Colour swizzle, AA, no passthrough, backlight */
15470 + dcon_disp_mode = MODE_PASSTHRU | MODE_BL_ENABLE | MODE_CSWIZZLE;
15472 + dcon_disp_mode |= MODE_COL_AA;
15473 + i2c_smbus_write_word_data(client, DCON_REG_MODE, dcon_disp_mode);
15476 + /* Set the scanline to interrupt on during resume */
15478 + i2c_smbus_write_word_data(client, DCON_REG_SCAN_INT, resumeline);
15480 + /* Add the DCON device */
15482 + dcon_device = platform_device_alloc("dcon", -1);
15484 + if (dcon_device == NULL) {
15485 + printk(KERN_ERR "dcon: Unable to create the DCON device\n");
15490 + if ((rc = platform_device_add(dcon_device))) {
15491 + printk(KERN_ERR "dcon: Unable to add the DCON device\n");
15495 + for(i = 0; i < ARRAY_SIZE(dcon_device_files); i++)
15496 + device_create_file(&dcon_device->dev, &dcon_device_files[i]);
15498 + /* Add the backlight device for the DCON */
15500 + dcon_client = client;
15502 + dcon_bl_dev = backlight_device_register("dcon-bl", &dcon_device->dev,
15503 + NULL, &dcon_bl_ops);
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;
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();
15514 + backlight_update_status(dcon_bl_dev);
15517 + register_reboot_notifier(&dcon_nb);
15518 + console_event_register(&dcon_console_nb);
15520 + printk(KERN_INFO "olpc-dcon: Discovered DCON version %x\n", ver & 0xFF);
15525 + platform_device_unregister(dcon_device);
15526 + dcon_device = NULL;
15528 + free_irq(DCON_IRQ, &dcon_driver);
15530 + i2c_detach_client(client);
15537 +static int dcon_attach(struct i2c_adapter *adap)
15541 + ret = i2c_probe(adap, &addr_data, dcon_probe);
15543 + if (dcon_client == NULL)
15544 + printk(KERN_ERR "olpc-dcon: No DCON found on SMBus\n");
15549 +static int dcon_detach(struct i2c_client *client)
15552 + dcon_client = NULL;
15554 + unregister_reboot_notifier(&dcon_nb);
15555 + console_event_unregister(&dcon_console_nb);
15557 + free_irq(DCON_IRQ, &dcon_driver);
15559 + if ((rc = i2c_detach_client(client)) == 0)
15560 + kfree(i2c_get_clientdata(client));
15562 + if (dcon_bl_dev != NULL)
15563 + backlight_device_unregister(dcon_bl_dev);
15565 + if (dcon_device != NULL)
15566 + platform_device_unregister(dcon_device);
15567 + cancel_work_sync(&dcon_work);
15574 +static int dcon_suspend(struct i2c_client *client, pm_message_t state)
15576 + if (dcon_sleep_val != DCON_ACTIVE)
15579 + /* Set up the DCON to have the source */
15580 + return dcon_set_source_sync(DCON_SOURCE_DCON);
15583 +static int dcon_resume(struct i2c_client *client)
15586 + if (dcon_sleep_val != DCON_ACTIVE)
15589 + /* HACK: ensure the bus is stable */
15591 + x = dcon_read(DCON_REG_ID);
15594 + return dcon_set_source(DCON_SOURCE_CPU);
15599 +static irqreturn_t dcon_interrupt(int irq, void *id)
15601 + int status = inl(gpio_base + GPIOx_READ_BACK) >> 5;
15603 + /* Clear the negative edge status for GPIO7 */
15604 + outl(1 << 7, gpio_base + GPIOx_NEGEDGE_STS);
15606 + switch (status & 3) {
15608 + printk(KERN_DEBUG "olpc-dcon: DCONLOAD_MISSED interrupt\n");
15610 + case 2: /* switch to DCON mode */
15611 + case 1: /* switch to CPU mode */
15612 + dcon_switched = 1;
15613 + wake_up(&dcon_wait_queue);
15616 + printk(KERN_DEBUG "olpc-dcon: scanline interrupt w/CPU\n");
15619 + return IRQ_HANDLED;
15622 +static struct i2c_driver dcon_driver = {
15624 + .name = "OLPC-DCON",
15626 + .id = I2C_DRIVERID_DCON,
15627 + .attach_adapter = dcon_attach,
15628 + .detach_client = dcon_detach,
15630 + .suspend = dcon_suspend,
15631 + .resume = dcon_resume,
15636 +static int __init olpc_dcon_init(void)
15638 + i2c_add_driver(&dcon_driver);
15642 +static void __exit olpc_dcon_exit(void)
15644 + i2c_del_driver(&dcon_driver);
15647 +module_init(olpc_dcon_init);
15648 +module_exit(olpc_dcon_exit);
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
15655 +++ b/drivers/video/olpc_dcon.h
15657 +#ifndef OLPC_DCON_H_
15658 +#define OLPC_DCON_H_
15660 +/* DCON registers */
15662 +#define DCON_REG_ID 0
15663 +#define DCON_REG_MODE 1
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)
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
15688 +/* GPIO registers (CS5536) */
15690 +#define MSR_LBAR_GPIO 0x5140000C
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
15708 +/* Status values */
15710 +#define DCONSTAT_SCANINT 0
15711 +#define DCONSTAT_SCANINT_DCON 1
15712 +#define DCONSTAT_DISPLAYLOAD 2
15713 +#define DCONSTAT_MISSED 3
15715 +/* Source values */
15717 +#define DCON_SOURCE_DCON 0
15718 +#define DCON_SOURCE_CPU 1
15720 +/* Output values */
15721 +#define DCON_OUTPUT_COLOR 0
15722 +#define DCON_OUTPUT_MONO 1
15724 +/* Sleep values */
15725 +#define DCON_ACTIVE 0
15726 +#define DCON_SLEEP 1
15729 +#define DCON_IRQ 6
15732 diff --git a/fs/Kconfig b/fs/Kconfig
15733 index f9eed6d..6fa3ea2 100644
15736 @@ -999,6 +999,23 @@ config HUGETLBFS
15737 config HUGETLB_PAGE
15741 + tristate "PromFS IEEE 1275 file system support"
15742 + depends on SPARC || PPC || OLPC
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.
15750 + The firmware device-tree is available as a virtual file system,
15751 + can be mounted under /prom with the command "mount -t promfs
15754 + To compile PromFS support as a module, choose M here; the module
15755 + will be called promfs. If unsure, choose M.
15760 @@ -1225,6 +1242,14 @@ config JFFS2_FS_WRITEBUFFER
15761 - NOR flash with transparent ECC
15764 +config JFFS2_FS_WBUF_VERIFY
15765 + bool "Verify JFFS2 write-buffer reads"
15766 + depends on JFFS2_FS_WRITEBUFFER
15769 + This causes JFFS2 to read back every page written through the
15770 + write-buffer, and check for errors.
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
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.
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.
15790 - Say 'Y' if unsure.
15791 + Say 'Y' if unsure.
15794 bool "JFFS2 RTIME compression support" if JFFS2_COMPRESSION_OPTIONS
15795 depends on JFFS2_FS
15798 - Rtime does manage to recompress already-compressed data. Say 'Y' if unsure.
15800 + Rtime does manage to recompress already-compressed data. Say 'Y' if unsure.
15803 bool "JFFS2 RUBIN compression support" if JFFS2_COMPRESSION_OPTIONS
15804 depends on JFFS2_FS
15807 - RUBINMIPS and DYNRUBIN compressors. Say 'N' if unsure.
15809 + RUBINMIPS and DYNRUBIN compressors. Say 'N' if unsure.
15812 - prompt "JFFS2 default compression mode" if JFFS2_COMPRESSION_OPTIONS
15813 - default JFFS2_CMODE_PRIORITY
15814 - depends on JFFS2_FS
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
15822 + You can set here the default compression mode of JFFS2 from
15823 + the available compression modes. Don't touch if unsure.
15825 config JFFS2_CMODE_NONE
15826 - bool "no compression"
15828 - Uses no compression.
15829 + bool "no compression"
15831 + Uses no compression.
15833 config JFFS2_CMODE_PRIORITY
15836 - Tries the compressors in a predefined order and chooses the first
15840 + Tries the compressors in a predefined order and chooses the first
15843 config JFFS2_CMODE_SIZE
15844 - bool "size (EXPERIMENTAL)"
15846 - Tries all compressors and chooses the one which has the smallest
15848 + bool "size (EXPERIMENTAL)"
15850 + Tries all compressors and chooses the one which has the smallest
15855 diff --git a/fs/Makefile b/fs/Makefile
15856 index 720c29d..61f1a4d 100644
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)
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);
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
15887 * Created by Arjan van de Ven <arjanv@redhat.com>
15889 * Copyright © 2004 Ferenc Havasi <havasi@inf.u-szeged.hu>,
15890 - * University of Szeged, Hungary
15891 + * University of Szeged, Hungary
15893 * For licensing information, see the file 'LICENCE' in this directory.
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.
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)
15904 int ret = JFFS2_COMPR_NONE;
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;
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;
15916 - switch (jffs2_compression_mode) {
15917 - case JFFS2_COMPR_MODE_NONE:
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");
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))
15932 + switch (jffs2_compression_mode) {
15933 + case JFFS2_COMPR_MODE_NONE:
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");
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))
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;
15964 - spin_unlock(&jffs2_compressor_list_lock);
15965 - if (ret == JFFS2_COMPR_NONE) kfree(output_buf);
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))
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;
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);
15988 - printk(KERN_WARNING "JFFS2: No memory for compressor allocation. (%d bytes)\n",orig_dlen);
15992 - this->compr_buf = tmp_buf;
15993 - this->compr_buf_size = orig_dlen;
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;
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;
16022 - spin_unlock(&jffs2_compressor_list_lock);
16025 - printk(KERN_ERR "JFFS2: unknow compression mode.\n");
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;
16042 + spin_unlock(&jffs2_compressor_list_lock);
16043 + if (ret == JFFS2_COMPR_NONE)
16044 + kfree(output_buf);
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))
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;
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);
16067 + printk(KERN_WARNING "JFFS2: No memory for compressor allocation. (%d bytes)\n",orig_dlen);
16071 + this->compr_buf = tmp_buf;
16072 + this->compr_buf_size = orig_dlen;
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;
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;
16101 + spin_unlock(&jffs2_compressor_list_lock);
16104 + printk(KERN_ERR "JFFS2: unknow compression mode.\n");
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;
16114 - *cpage_out = output_buf;
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;
16123 + *cpage_out = output_buf;
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)
16132 - struct jffs2_compressor *this;
16134 + struct jffs2_compressor *this;
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++;
16146 case JFFS2_COMPR_ZERO:
16147 memset(data_out, 0, datalen);
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);
16158 - printk(KERN_WARNING "Decompressor \"%s\" returned %d\n", this->name, ret);
16161 - this->stat_decompr_blocks++;
16163 - this->usecount--;
16164 - spin_unlock(&jffs2_compressor_list_lock);
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);
16176 + printk(KERN_WARNING "Decompressor \"%s\" returned %d\n", this->name, ret);
16179 + this->stat_decompr_blocks++;
16181 + this->usecount--;
16182 + spin_unlock(&jffs2_compressor_list_lock);
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);
16192 @@ -210,108 +211,108 @@ int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
16194 int jffs2_register_compressor(struct jffs2_compressor *comp)
16196 - struct jffs2_compressor *this;
16197 + struct jffs2_compressor *this;
16199 - if (!comp->name) {
16200 - printk(KERN_WARNING "NULL compressor name at registering JFFS2 compressor. Failed.\n");
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");
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));
16224 - spin_lock(&jffs2_compressor_list_lock);
16225 + spin_lock(&jffs2_compressor_list_lock);
16227 - list_for_each_entry(this, &jffs2_compressor_list, list) {
16228 - if (this->priority < comp->priority) {
16229 - list_add(&comp->list, this->list.prev);
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);
16240 + list_add_tail(&comp->list, &jffs2_compressor_list);
16242 - D2(list_for_each_entry(this, &jffs2_compressor_list, list) {
16243 - printk(KERN_DEBUG "Compressor \"%s\", prio %d\n", this->name, this->priority);
16245 + D2(list_for_each_entry(this, &jffs2_compressor_list, list) {
16246 + printk(KERN_DEBUG "Compressor \"%s\", prio %d\n", this->name, this->priority);
16249 - spin_unlock(&jffs2_compressor_list_lock);
16250 + spin_unlock(&jffs2_compressor_list_lock);
16256 int jffs2_unregister_compressor(struct jffs2_compressor *comp)
16258 - D2(struct jffs2_compressor *this;)
16259 + D2(struct jffs2_compressor *this;)
16261 - D1(printk(KERN_DEBUG "Unregistering JFFS2 compressor \"%s\"\n", comp->name));
16262 + D1(printk(KERN_DEBUG "Unregistering JFFS2 compressor \"%s\"\n", comp->name));
16264 - spin_lock(&jffs2_compressor_list_lock);
16265 + spin_lock(&jffs2_compressor_list_lock);
16267 - if (comp->usecount) {
16268 - spin_unlock(&jffs2_compressor_list_lock);
16269 - printk(KERN_WARNING "JFFS2: Compressor modul is in use. Unregister failed.\n");
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");
16278 + list_del(&comp->list);
16280 - D2(list_for_each_entry(this, &jffs2_compressor_list, list) {
16281 - printk(KERN_DEBUG "Compressor \"%s\", prio %d\n", this->name, this->priority);
16283 - spin_unlock(&jffs2_compressor_list_lock);
16285 + D2(list_for_each_entry(this, &jffs2_compressor_list, list) {
16286 + printk(KERN_DEBUG "Compressor \"%s\", prio %d\n", this->name, this->priority);
16288 + spin_unlock(&jffs2_compressor_list_lock);
16292 void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig)
16294 - if (orig != comprbuf)
16296 + if (orig != comprbuf)
16300 int __init jffs2_compressors_init(void)
16302 /* Registering compressors */
16303 #ifdef CONFIG_JFFS2_ZLIB
16304 - jffs2_zlib_init();
16305 + jffs2_zlib_init();
16307 #ifdef CONFIG_JFFS2_RTIME
16308 - jffs2_rtime_init();
16309 + jffs2_rtime_init();
16311 #ifdef CONFIG_JFFS2_RUBIN
16312 - jffs2_rubinmips_init();
16313 - jffs2_dynrubin_init();
16314 + jffs2_rubinmips_init();
16315 + jffs2_dynrubin_init();
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");)
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");)
16330 - D1(printk(KERN_INFO "JFFS2: default compression mode: priority\n");)
16331 + D1(printk(KERN_INFO "JFFS2: default compression mode: priority\n");)
16338 int jffs2_compressors_exit(void)
16340 /* Unregistering compressors */
16341 #ifdef CONFIG_JFFS2_RUBIN
16342 - jffs2_dynrubin_exit();
16343 - jffs2_rubinmips_exit();
16344 + jffs2_dynrubin_exit();
16345 + jffs2_rubinmips_exit();
16347 #ifdef CONFIG_JFFS2_RTIME
16348 - jffs2_rtime_exit();
16349 + jffs2_rtime_exit();
16351 #ifdef CONFIG_JFFS2_ZLIB
16352 - jffs2_zlib_exit();
16353 + jffs2_zlib_exit();
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
16363 * JFFS2 -- Journalling Flash File System, Version 2.
16365 * Copyright © 2004 Ferenc Havasi <havasi@inf.u-szeged.hu>,
16366 - * University of Szeged, Hungary
16367 + * University of Szeged, Hungary
16369 * For licensing information, see the file 'LICENCE' in this directory.
16371 @@ -32,29 +32,29 @@
16372 #define JFFS2_ZLIB_PRIORITY 60
16374 #define JFFS2_RUBINMIPS_DISABLED /* RUBINs will be used only */
16375 -#define JFFS2_DYNRUBIN_DISABLED /* for decompression */
16376 +#define JFFS2_DYNRUBIN_DISABLED /* for decompression */
16378 #define JFFS2_COMPR_MODE_NONE 0
16379 #define JFFS2_COMPR_MODE_PRIORITY 1
16380 #define JFFS2_COMPR_MODE_SIZE 2
16382 struct jffs2_compressor {
16383 - struct list_head list;
16384 - int priority; /* used by prirority comr. mode */
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);
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 */
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);
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;
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);
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);
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);
16433 void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig);
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,
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,
16455 rubin_do_decompress(BIT_DIVIDER_MIPS, bits_mips, data_in, cpage_out, sourcelen, dstlen);
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];
16464 rubin_do_decompress(256, bits, data_in+8, cpage_out, sourcelen-8, dstlen);
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,
16476 zlib_inflateEnd(&inf_strm);
16477 mutex_unlock(&inflate_mutex);
16482 static struct jffs2_compressor jffs2_zlib_comp = {
16483 @@ -203,11 +203,11 @@ int __init jffs2_zlib_init(void)
16485 ret = alloc_workspaces();
16490 ret = jffs2_register_compressor(&jffs2_zlib_comp);
16492 - free_workspaces();
16493 + free_workspaces();
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 *);
16508 const struct file_operations jffs2_dir_operations =
16510 @@ -770,7 +770,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
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)
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,
16525 ret = jffs2_flash_erase(c, jeb);
16527 - jffs2_erase_succeeded(c, jeb);
16529 + jffs2_erase_succeeded(c, jeb);
16532 bad_offset = jeb->offset;
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);
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);
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);
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);
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);
16578 jffs2_erase_block(c, jeb);
16580 @@ -142,23 +148,25 @@ void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count)
16586 + down(&c->erase_free_sem);
16587 spin_lock(&c->erase_completion_lock);
16590 spin_unlock(&c->erase_completion_lock);
16591 + up(&c->erase_free_sem);
16593 D1(printk(KERN_DEBUG "jffs2_erase_pending_blocks completed\n"));
16595 - up(&c->erase_free_sem);
16598 static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
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);
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);
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);
16636 @@ -317,6 +329,33 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl
16640 + if (c->mtd->point) {
16641 + unsigned long *wordebuf;
16643 + ret = c->mtd->point(c->mtd, jeb->offset, c->sector_size, &retlen, (unsigned char **)&ebuf);
16645 + D1(printk(KERN_DEBUG "MTD point failed %d\n", ret));
16646 + goto do_flash_read;
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;
16654 + wordebuf = ebuf-sizeof(*wordebuf);
16655 + retlen /= sizeof(*wordebuf);
16657 + if (*++wordebuf != ~0)
16659 + } while(--retlen);
16660 + c->mtd->unpoint(c->mtd, ebuf, jeb->offset, c->sector_size);
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));
16667 ebuf = kmalloc(PAGE_SIZE, GFP_KERNEL);
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);
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);
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);
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);
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,
16713 node = kmalloc(rawlen, GFP_KERNEL);
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,
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);
16727 jffs2_add_physical_node_ref(c, phys_ofs | REF_OBSOLETE, rawlen, NULL);
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 {
16735 uint32_t wbuf_pagesize; /* 0 for NOR and other flashes with no wbuf */
16737 +#ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
16738 + unsigned char *wbuf_verify; /* read-back buffer for verification */
16740 #ifdef CONFIG_JFFS2_FS_WRITEBUFFER
16741 unsigned char *wbuf; /* Write-behind buffer for NAND flash */
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);
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
16760 -#define INOCACHE_HASHSIZE 128
16761 +#define INOCACHE_HASHSIZE 1024
16763 #define write_ofs(c) ((c)->nextblock->offset + (c)->sector_size - (c)->nextblock->free_size)
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);
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));
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);
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);
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 *
16799 * Returns 0 if the node was handled (including marking it obsolete)
16800 - * < 0 an if error occurred
16801 + * < 0 an if error occurred
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",
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);
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)))
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)
16835 rc = do_jffs2_setxattr(inode, JFFS2_XPREFIX_SECURITY, name, value, len, 0);
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
16851 * JFFS2 -- Journalling Flash File System, Version 2.
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>
16863 * For licensing information, see the file 'LICENCE' in this directory.
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
16870 * JFFS2 -- Journalling Flash File System, Version 2.
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
16880 * For licensing information, see the file 'LICENCE' in this directory.
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
16890 +#ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
16891 +static int jffs2_verify_write(struct jffs2_sb_info *c, unsigned char *buf,
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);
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);
16906 + if (!memcmp(buf, c->wbuf_verify, c->wbuf_pagesize))
16909 + if (ret == -EUCLEAN)
16910 + eccstr = "corrected";
16911 + else if (ret == -EBADMSG)
16912 + eccstr = "correction failed";
16914 + eccstr = "OK or unused";
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);
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);
16928 +#define jffs2_verify_write(c,b,o) (0)
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. */
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,
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");
16943 @@ -587,15 +628,16 @@ static int __jffs2_flush_wbuf(struct jffs2_sb_info *c, int pad)
16945 ret = c->mtd->write(c->mtd, c->wbuf_ofs, c->wbuf_pagesize, &retlen, c->wbuf);
16947 - if (ret || retlen != c->wbuf_pagesize) {
16949 - printk(KERN_WARNING "jffs2_flush_wbuf(): Write failed with %d\n",ret);
16951 - printk(KERN_WARNING "jffs2_flush_wbuf(): Write was short: %zd instead of %d\n",
16952 - retlen, c->wbuf_pagesize);
16957 + printk(KERN_WARNING "jffs2_flush_wbuf(): Write failed with %d\n", ret);
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);
16964 + } else if ((ret = jffs2_verify_write(c, c->wbuf, c->wbuf_ofs))) {
16966 jffs2_wbuf_recover(c);
16969 @@ -966,8 +1008,8 @@ exit:
16971 #define NR_OOB_SCAN_PAGES 4
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
16978 static const struct jffs2_unknown_node oob_cleanmarker =
16980 @@ -1021,8 +1063,8 @@ int jffs2_check_oob_empty(struct jffs2_sb_info *c,
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
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)
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);
17006 void jffs2_nand_flash_cleanup(struct jffs2_sb_info *c)
17008 +#ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
17009 + kfree(c->wbuf_verify);
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);
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);
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
17032 #include "nodelist.h"
17034 static int jffs2_user_getxattr(struct inode *inode, const char *name,
17035 - void *buffer, size_t size)
17036 + void *buffer, size_t size)
17038 if (!strcmp(name, ""))
17040 @@ -25,7 +25,7 @@ static int jffs2_user_getxattr(struct inode *inode, const char *name,
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)
17047 if (!strcmp(name, ""))
17049 diff --git a/fs/promfs/Makefile b/fs/promfs/Makefile
17050 new file mode 100644
17051 index 0000000..940a51b
17053 +++ b/fs/promfs/Makefile
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
17060 +++ b/fs/promfs/promfs.c
17063 + * promfs.c - generic inode/dentry functions for IEEE 1275-based filesystems.
17065 + * This is based heavily upon prior ieee1275 and other virtual filesystems
17066 + * implementations; openpromfs, proc_devtree.c, oprofilefs, procfs, ...
17068 + * Copyright (C) 2007 Andres Salomon <dilinger@debian.org>
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.
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.
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.
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>
17092 +#define PROMFS_MAGIC 0x1f2f3fff
17094 +MODULE_LICENSE("GPL");
17095 +MODULE_AUTHOR("Andres Salomon");
17097 +struct promfs_inode
17099 + struct inode ino;
17100 + struct property *prop;
17103 +static inline struct promfs_inode *to_promfs_inode(struct inode *inode)
17105 + return container_of(inode, struct promfs_inode, ino);
17109 +static DEFINE_SPINLOCK(promfs_lock);
17111 +static struct of_node *of_tree = NULL;
17112 +static DEFINE_RWLOCK(of_tree_lock);
17114 +void __init of_build_tree(void)
17121 +static int promfs_open_file(struct inode *inode, struct file *file)
17123 + struct promfs_inode *ino;
17125 + ino = to_promfs_inode(inode);
17128 + file->private_data = ino->prop;
17133 +static ssize_t promfs_read_file(struct file *file, char __user *data,
17134 + size_t len, loff_t *ppos)
17136 + struct property *prop = (struct property *) file->private_data;
17137 + return simple_read_from_buffer(data, len, ppos, prop->value,
17141 +static ssize_t promfs_write_file(struct file *file, char const __user *buf,
17142 + size_t count, loff_t * offset)
17144 + /* TODO.... 'cause, y'know, it would be nice. */
17148 +static struct file_operations promfs_file_ops = {
17149 + .open = promfs_open_file,
17150 + .read = promfs_read_file,
17151 + .write = promfs_write_file,
17154 +static struct kmem_cache *promfs_inode_cachep;
17156 +static struct inode *promfs_alloc_inode(struct super_block *sb)
17158 + struct promfs_inode *pr_ino;
17160 + pr_ino = kmem_cache_alloc(promfs_inode_cachep, GFP_KERNEL);
17163 + pr_ino->prop = NULL;
17165 + return &pr_ino->ino;
17168 +static void promfs_destroy_inode(struct inode *inode)
17170 + kmem_cache_free(promfs_inode_cachep, to_promfs_inode(inode));
17173 +static void promfs_read_inode(struct inode *inode)
17175 + inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
17178 +static int promfs_remount(struct super_block *sb, int *flags, char *data)
17180 + *flags |= MS_NOATIME;
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,
17193 +static struct inode *promfs_get_inode(struct super_block *sb, int mode)
17195 + struct inode *inode = new_inode(sb);
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;
17208 +static int promfs_create_file(struct super_block *sb, struct dentry *root,
17209 + struct property *prop, const struct file_operations *fops)
17211 + struct dentry *dentry;
17212 + struct inode *inode;
17213 + struct promfs_inode *ino;
17215 + dentry = d_alloc_name(root, prop->name);
17219 + inode = promfs_get_inode(sb, S_IFREG | 0644);
17222 + inode->i_fop = fops;
17223 + ino = to_promfs_inode(inode);
17224 + ino->prop = prop;
17225 + d_add(dentry, inode);
17235 +struct dentry *promfs_create_dir(struct super_block *sb, struct dentry *root,
17236 + char const *name)
17238 + struct dentry *dentry;
17239 + struct inode *inode;
17241 + dentry = d_alloc_name(root, name);
17245 + inode = promfs_get_inode(sb, S_IFDIR | 0755);
17248 + inode->i_op = &simple_dir_inode_operations;
17249 + inode->i_fop = &simple_dir_operations;
17250 + d_add(dentry, inode);
17259 +void promfs_populate(struct super_block *sb, struct dentry *root,
17260 + struct device_node *node)
17262 + struct dentry *dentry;
17263 + struct device_node *child;
17264 + struct property *prop;
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);
17273 + for (prop = node->properties; prop; prop = prop->next)
17274 + promfs_create_file(sb, root, prop, &promfs_file_ops);
17277 +static int promfs_fill_super(struct super_block *sb, void *data, int silent)
17279 + struct inode *root_inode;
17280 + struct dentry *root_dentry;
17281 + struct promfs_inode *inode;
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;
17290 + root_inode = promfs_get_inode(sb, S_IFDIR | 0755);
17293 + root_inode->i_op = &simple_dir_inode_operations;
17294 + root_inode->i_fop = &simple_dir_operations;
17296 + inode = to_promfs_inode(root_inode);
17298 + root_dentry = d_alloc_root(root_inode);
17299 + if (!root_dentry)
17301 + sb->s_root = root_dentry;
17303 + promfs_populate(sb, root_dentry, of_find_node_by_path("/"));
17307 + iput(root_inode);
17312 +static int promfs_get_sb(struct file_system_type *fs_type, int flags,
17313 + const char *dev_name, void *data, struct vfsmount *mnt)
17315 + return get_sb_single(fs_type, flags, data, promfs_fill_super, mnt);
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,
17325 +static void init_once(void *i, struct kmem_cache *cachep, unsigned long fl)
17327 + struct promfs_inode *inode = (struct promfs_inode *) i;
17328 + inode_init_once(&inode->ino);
17331 +static int __init init_promfs(void)
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)
17342 + err = register_filesystem(&promfs_fs_type);
17344 + kmem_cache_destroy(promfs_inode_cachep);
17349 +static void __exit exit_promfs(void)
17351 + unregister_filesystem(&promfs_fs_type);
17352 + kmem_cache_destroy(promfs_inode_cachep);
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);
17367 +#define MFGPT_TIMER_ANY -1
17369 +#define MFGPT_DOMAIN_WORKING 1
17370 +#define MFGPT_DOMAIN_STANDBY 2
17371 +#define MFGPT_DOMAIN_ANY (MFGPT_DOMAIN_WORKING | MFGPT_DOMAIN_STANDBY)
17373 +#define MFGPT_CMP1 0
17374 +#define MFGPT_CMP2 1
17376 +#define MFGPT_EVENT_IRQ 0
17377 +#define MFGPT_EVENT_NMI 1
17378 +#define MFGPT_EVENT_RESET 3
17380 +#define MFGPT_REG_CMP1 0
17381 +#define MFGPT_REG_CMP2 2
17382 +#define MFGPT_REG_COUNTER 4
17383 +#define MFGPT_REG_SETUP 6
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)
17394 +static inline void geode_mfgpt_write(int timer, u16 reg, u16 value)
17396 + u32 base = geode_get_dev_base(GEODE_DEV_MFGPT);
17397 + outw(value, base + reg + (timer * 8));
17400 +static inline u16 geode_mfgpt_read(int timer, u16 reg)
17402 + u32 base = geode_get_dev_base(GEODE_DEV_MFGPT);
17403 + return inw(base + reg + (timer * 8));
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);
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)
17414 /* Specific geode tests */
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
17421 +++ b/include/asm-i386/ofw.h
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.
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.
17436 +extern int ofw(char *, int, int, ...);
17439 diff --git a/include/asm-i386/olpc.h b/include/asm-i386/olpc.h
17440 new file mode 100644
17441 index 0000000..26bc1a8
17443 +++ b/include/asm-i386/olpc.h
17445 +/* OLPC machine specific definitions */
17447 +#ifndef ASM_OLPC_H_
17448 +#define ASM_OLPC_H_
17450 +#include <asm/geode.h>
17452 +struct olpc_platform_t {
17458 +#define OLPC_F_PRESENT 0x01
17459 +#define OLPC_F_DCON 0x02
17460 +#define OLPC_F_VSA 0x04
17475 + OLPC_REV_UNKNOWN /* this should always come last */
17478 +#ifndef CONFIG_OLPC
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; }
17487 +extern struct olpc_platform_t olpc_platform_info;
17490 +machine_is_olpc(void)
17492 + return (olpc_platform_info.flags & OLPC_F_PRESENT) ? 1 : 0;
17496 +olpc_has_dcon(void)
17498 + return (olpc_platform_info.flags & OLPC_F_DCON) ? 1 : 0;
17502 +olpc_has_vsa(void)
17504 + return (olpc_platform_info.flags & OLPC_F_VSA) ? 1 : 0;
17508 +olpc_get_rev(void)
17510 + return olpc_platform_info.boardrev;
17514 +olpc_rev_after(int rev)
17516 + return olpc_platform_info.boardrev > rev &&
17517 + olpc_platform_info.boardrev != OLPC_REV_UNKNOWN;
17521 +olpc_rev_before(int rev)
17523 + return olpc_platform_info.boardrev < rev ||
17524 + olpc_platform_info.boardrev == OLPC_REV_UNKNOWN;
17529 +/* EC functions */
17531 +int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen,
17532 + unsigned char *outbuf, size_t outlen);
17534 +void olpc_register_battery_callback(void (*f)(unsigned long));
17535 +void olpc_deregister_battery_callback(void);
17537 +/* EC commands and responses */
17539 +/* SCI source values */
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
17550 +/* GPIO assignments */
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
17561 diff --git a/include/asm-i386/prom.h b/include/asm-i386/prom.h
17562 new file mode 100644
17563 index 0000000..59d3bdd
17565 +++ b/include/asm-i386/prom.h
17567 +#ifndef _I386_PROM_H
17568 +#define _I386_PROM_H
17573 + * Definitions for talking to the Open Firmware PROM on
17574 + * Power Macintosh computers.
17576 + * Copyright (C) 1996-2005 Paul Mackerras.
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
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.
17588 +#include <linux/types.h>
17589 +#include <linux/proc_fs.h>
17590 +#include <asm/atomic.h>
17592 +typedef u32 phandle;
17593 +typedef u32 ihandle;
17599 + struct property *next;
17602 +struct device_node {
17603 + const char *name;
17604 + const char *type;
17606 +// phandle linux_phandle;
17607 + char *path_component_name;
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;
17623 +/* flag descriptions */
17624 +#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
17626 +#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
17627 +#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
17629 +#define OF_BAD_ADDR ((u64)-1)
17631 +static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
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,
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,
17660 +extern const void *of_get_property(const struct device_node *node,
17661 + const char *name,
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,
17668 +extern int of_n_addr_cells(struct device_node *np);
17669 +extern int of_n_size_cells(struct device_node *np);
17671 +extern void prom_build_devicetree(void);
17673 +#endif /* __KERNEL__ */
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
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 */
17685 #ifndef __ASSEMBLY__
17687 diff --git a/include/linux/battery.h b/include/linux/battery.h
17688 new file mode 100644
17689 index 0000000..2f856a0
17691 +++ b/include/linux/battery.h
17694 + * Driver model for batteries
17696 + * © 2006 David Woodhouse <dwmw2@infradead.org>
17698 + * Based on LED Class support, by John Lenz and Richard Purdie:
17700 + * © 2005 John Lenz <lenz@cs.wisc.edu>
17701 + * © 2005-2006 Richard Purdie <rpurdie@openedhand.com>
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.
17708 +#ifndef __LINUX_BATTERY_H__
17709 +#define __LINUX_BATTERY_H__
17712 +struct class_device;
17717 +#define PWRDEV_TYPE_BATTERY 0
17718 +#define PWRDEV_TYPE_AC 1
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)
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 */
17737 +#define BAT_INFO_TEMP2 "temp2" /* °C/1000 */
17738 +#define BAT_INFO_TEMP2_NAME "temp2_name" /* string */
17740 +#define BAT_INFO_VOLTAGE "voltage" /* mV */
17741 +#define BAT_INFO_VOLTAGE_DESIGN "voltage_design" /* mV */
17743 +#define BAT_INFO_CURRENT "current" /* mA */
17744 +#define BAT_INFO_CURRENT_NOW "current_now" /* mA */
17746 +#define BAT_INFO_POWER "power" /* mW */
17747 +#define BAT_INFO_POWER_NOW "power_now" /* mW */
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 */
17760 +#define BAT_INFO_CAP_PCT "capacity_percentage" /* integer */
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 */
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 */
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]] */
17777 +struct battery_dev {
17781 + const char *name;
17783 + struct device *dev;
17786 +int battery_device_register(struct device *parent,
17787 + struct battery_dev *battery_cdev);
17788 +void battery_device_unregister(struct battery_dev *battery_cdev);
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);
17802 -#ifndef CONFIG_DISABLE_CONSOLE_SUSPEND
17803 +extern int serial_console_suspend_enabled;
17805 /* Suspend and resume console messages over PM events */
17806 extern void suspend_console(void);
17807 extern void resume_console(void);
17809 -static inline void suspend_console(void) {}
17810 -static inline void resume_console(void) {}
17811 -#endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */
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);
17823 + /* Shut down the graphics engine to save power */
17824 + int (*fb_powerdown)(struct fb_info *info);
17826 + /* Power it back up */
17827 + int (*fb_powerup)(struct fb_info *info);
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);
17836 +extern int fb_powerdown(struct fb_info *info);
17837 +extern int fb_powerup(struct fb_info *info);
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
17846 +++ b/include/linux/isl_38xx.h
17849 + * Copyright (C) 2002 Intersil Americas Inc.
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
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.
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
17865 +#ifndef _LINUX_ISL_38XX_H
17866 +#define _LINUX_ISL_38XX_H
17868 +#include <asm/io.h>
17870 +#define ISL38XX_CB_RX_QSIZE 8
17871 +#define ISL38XX_CB_TX_QSIZE 32
17873 +/* ISL38XX Access Point Specific definitions */
17874 +#define ISL38XX_MAX_WDS_LINKS 8
17876 +/* ISL38xx Client Specific definitions */
17877 +#define ISL38XX_PSM_ACTIVE_STATE 0
17878 +#define ISL38XX_PSM_POWERSAVE_STATE 1
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
17889 +/* PCI Memory Area */
17890 +#define ISL38XX_HARDWARE_REG 0x0000
17891 +#define ISL38XX_CARDBUS_CIS 0x0800
17892 +#define ISL38XX_DIRECT_MEM_WIN 0x1000
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
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
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
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.
17920 +static inline void
17921 +isl38xx_w32_flush(void __iomem *base, u32 val, unsigned long offset)
17923 + writel(val, base + offset);
17924 + (void) readl(base + ISL38XX_PCI_POSTING_FLUSH);
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
17937 +#define ISL38XX_DEV_INT_PCIUART_CTS 0x4000
17938 +#define ISL38XX_DEV_INT_PCIUART_DR 0x8000
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
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)
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'
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
17967 +/* Some flags for the isl hardware registers controlling DMA inside the
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
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;
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)
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)
18008 +#ifdef CONFIG_MTD_ONENAND_2X_PROGRAM
18009 +#define ONENAND_IS_2PLANE(this) \
18010 + (this->options & ONENAND_HAS_2PLANE)
18012 +#define ONENAND_IS_2PLANE(this) (0)
18015 /* Check byte access in OneNAND */
18016 #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)
18018 @@ -157,6 +168,7 @@ struct onenand_chip {
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)
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
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)
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 {
18054 extern struct vt_spawn_console vt_spawn_con;
18056 +/* A notifier list for console events */
18057 +extern struct raw_notifier_head console_notifier_list;
18059 +/* Called when the FG console switches to KD_TEXT mode */
18060 +#define CONSOLE_EVENT_SWITCH_TEXT 0x01
18062 +/* Called when the FG console switches to KD_GRAPHICS mode */
18063 +#define CONSOLE_EVENT_SWITCH_GRAPHICS 0x02
18065 +static inline int console_event_register(struct notifier_block *n)
18067 + return raw_notifier_chain_register(&console_notifier_list, n);
18070 +static inline int console_event_unregister(struct notifier_block *n)
18072 + return raw_notifier_chain_unregister(&console_notifier_list, n);
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) */
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
18098 #include <linux/console.h>
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)
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");
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");
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
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),
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
18144 +snd-cs5535audio-objs += cs5535audio_olpc.o
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);
18157 -static int snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
18158 +static int __devinit snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
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)
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;
18172 + /* olpc_prequirks is dummied out if not olpc */
18173 + olpc_prequirks(card, &ac97);
18175 if ((err = snd_ac97_mixer(pbus, &ac97, &cs5535au->ac97)) < 0) {
18176 snd_printk(KERN_ERR "mixer failed\n");
18178 @@ -171,6 +175,12 @@ static int snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
18180 snd_ac97_tune_hardware(cs5535au->ac97, ac97_quirks, ac97_quirk);
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");
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)
18196 unsigned char count;
18197 struct cs5535audio *cs5535au = dev_id;
18199 @@ -217,7 +226,7 @@ static irqreturn_t snd_cs5535audio_interrupt(int irq, void *dev_id)
18203 - for (count = 0; count < 10; count++) {
18204 + for (count = 0; count < 4; count++) {
18205 if (acc_irq_stat & (1 << count)) {
18208 @@ -232,26 +241,9 @@ static irqreturn_t snd_cs5535audio_interrupt(int irq, void *dev_id)
18210 process_bm1_irq(cs5535au);
18212 - case BM2_IRQ_STS:
18213 - bm_stat = cs_readb(cs5535au, ACC_BM2_STATUS);
18215 - case BM3_IRQ_STS:
18216 - bm_stat = cs_readb(cs5535au, ACC_BM3_STATUS);
18218 - case BM4_IRQ_STS:
18219 - bm_stat = cs_readb(cs5535au, ACC_BM4_STATUS);
18221 - case BM5_IRQ_STS:
18222 - bm_stat = cs_readb(cs5535au, ACC_BM5_STATUS);
18224 - case BM6_IRQ_STS:
18225 - bm_stat = cs_readb(cs5535au, ACC_BM6_STATUS);
18227 - case BM7_IRQ_STS:
18228 - bm_stat = cs_readb(cs5535au, ACC_BM7_STATUS);
18231 - snd_printk(KERN_ERR "Unexpected irq src\n");
18232 + snd_printk(KERN_ERR "Unexpected irq src: "
18233 + "0x%x\n", acc_irq_stat);
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
18276 /* acc_codec bar0 reg bits */
18277 /* ACC_IRQ_STATUS */
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 */
18290 #define BM_EOP_ERR (1<<1)
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;
18311 + int pcm_open_flag;
18314 struct cs5535audio {
18315 @@ -123,8 +94,21 @@ struct cs5535audio {
18316 struct cs5535audio_dma dmas[NUM_CS5535AUDIO_DMAS];
18320 int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state);
18321 int snd_cs5535audio_resume(struct pci_dev *pci);
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);
18329 +#define olpc_prequirks(arg,arg2) do {} while (0)
18330 +#define olpc_quirks(arg,arg2) (0)
18331 +#define olpc_ai_enable(a, v) (0)
18334 int __devinit snd_cs5535audio_pcm(struct cs5535audio *cs5535audio);
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
18341 +++ b/sound/pci/cs5535audio/cs5535audio_olpc.c
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>
18349 +#include <asm/olpc.h>
18350 +#include "cs5535audio.h"
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.
18358 +int olpc_ai_enable(struct snd_ac97 *ac97, u8 val)
18363 + * update the High Pass Filter (via AC97_AD_TEST2), and then set
18364 + * Analog Input mode through a GPIO.
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);
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);
18378 + snd_printk(KERN_ERR "Error updating AD_TEST2: %d\n", err);
18382 +EXPORT_SYMBOL_GPL(olpc_ai_enable);
18384 +static int snd_cs5535audio_ai_info(struct snd_kcontrol *kcontrol,
18385 + struct snd_ctl_elem_info *uinfo)
18387 + uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
18388 + uinfo->count = 1;
18389 + uinfo->value.integer.min = 0;
18390 + uinfo->value.integer.max = 1;
18394 +static int snd_cs5535audio_ai_get(struct snd_kcontrol *kcontrol,
18395 + struct snd_ctl_elem_value *ucontrol)
18397 + ucontrol->value.integer.value[0] = geode_gpio_isset(OLPC_GPIO_MIC_AC,
18398 + GPIO_OUTPUT_VAL);
18402 +static int snd_cs5535audio_ai_put(struct snd_kcontrol *kcontrol,
18403 + struct snd_ctl_elem_value *ucontrol)
18405 + struct cs5535audio *cs5535au = snd_kcontrol_chip(kcontrol);
18406 + struct snd_ac97 *ac97 = cs5535au->ac97;
18408 + olpc_ai_enable(ac97, ucontrol->value.integer.value[0]);
18413 +static struct snd_kcontrol_new snd_cs5535audio_controls __devinitdata =
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
18423 +void __devinit olpc_prequirks(struct snd_card *card,
18424 + struct snd_ac97_template *ac97)
18426 + /* Bail if this isn't an OLPC platform */
18427 + if (!machine_is_olpc())
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;
18435 +int __devinit olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97)
18437 + struct snd_ctl_elem_id elem;
18439 + /* Bail if this isn't an OLPC platform */
18440 + if (!machine_is_olpc())
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);
18449 + /* add the override for OLPC's HPF */
18450 + return snd_ctl_add(card, snd_ctl_new1(&snd_cs5535audio_controls,
18451 + ac97->private_data));
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));
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,
18467 snd_dma_free_pages(&dma->desc_buf);
18468 dma->desc_buf.area = NULL;
18469 + dma->substream = NULL;
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));
18478 + dma->pcm_open_flag = 1;
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;
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);
18492 + snd_ac97_update_power(cs5535au->ac97,
18493 + AC97_PCM_LR_ADC_RATE, 0);
18494 + dma->pcm_open_flag = 0;
18496 cs5535audio_clear_dma_packets(cs5535au, dma, substream);
18497 return snd_pcm_lib_free_pages(substream);
18499 @@ -298,14 +312,12 @@ static int snd_cs5535audio_trigger(struct snd_pcm_substream *substream, int cmd)
18501 case SNDRV_PCM_TRIGGER_RESUME:
18502 dma->ops->enable_dma(cs5535au);
18503 - dma->suspended = 0;
18505 case SNDRV_PCM_TRIGGER_STOP:
18506 dma->ops->disable_dma(cs5535au);
18508 case SNDRV_PCM_TRIGGER_SUSPEND:
18509 dma->ops->disable_dma(cs5535au);
18510 - dma->suspended = 1;
18513 snd_printk(KERN_ERR "unhandled trigger\n");
18514 @@ -344,6 +356,7 @@ static int snd_cs5535audio_capture_open(struct snd_pcm_substream *substream)
18516 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
18517 struct snd_pcm_runtime *runtime = substream->runtime;
18518 + struct snd_ac97 *ac97 = cs5535au->ac97;
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)
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);
18537 static int snd_cs5535audio_capture_close(struct snd_pcm_substream *substream)
18539 +#ifdef CONFIG_OLPC
18540 + struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
18541 + struct snd_ac97 *ac97 = cs5535au->ac97;
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);
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)
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);
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);
18574 + if (pci_save_state(pci)) {
18575 + printk(KERN_ERR "cs5535audio: pci_save_state failed!\n");
18578 pci_disable_device(pci);
18579 - pci_save_state(pci);
18580 pci_set_power_state(pci, pci_choose_state(pci, state));
18583 @@ -89,7 +92,12 @@ int snd_cs5535audio_resume(struct pci_dev *pci)
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);
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)
18599 snd_printk(KERN_ERR "Failure getting AC Link ready\n");
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);
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);