diff -ruN linux-2.4.27-vrs1/Documentation/Configure.help linux-2.4.27-vrs1-kvd1/Documentation/Configure.help --- linux-2.4.27-vrs1/Documentation/Configure.help Sat Aug 14 22:08:26 2004 +++ linux-2.4.27-vrs1-kvd1/Documentation/Configure.help Fri Dec 31 09:24:48 2004 @@ -325,24 +325,25 @@ If you say Y here, the LEDs on your machine will be used to provide useful information about your current system status. - If you are compiling a kernel for a NetWinder or EBSA-285, you will - be able to select which LEDs are active using the options below. If - you are compiling a kernel for the EBSA-110 or the LART however, the - red LED will simply flash regularly to indicate that the system is - still functional. It is safe to say Y here if you have a CATS - system, but the driver will do nothing. + If you are compiling a kernel for a NetWinder, EBSA-285 or Psion + netBook/Series 7, you will be able to select which LEDs are active + using the options below. If you are compiling a kernel for the + EBSA-110 or the LART however, the red LED will simply flash + regularly to indicate that the system is still functional. It is + safe to say Y here if you have a CATS system, but the driver will + do nothing. Timer LED CONFIG_LEDS_TIMER If you say Y here, one of the system LEDs (the green one on the - NetWinder, the amber one on the EBSA285, or the red one on the LART) - will flash regularly to indicate that the system is still - operational. This is mainly useful to kernel hackers who are - debugging unstable kernels. - - The LART uses the same LED for both Timer LED and CPU usage LED - functions. You may choose to use both, but the Timer LED function - will overrule the CPU usage LED. + NetWinder, the amber one on the EBSA285, or the red one on the LART + and Psion netBook/Series 7) will flash regularly to indicate that the + system is still operational. This is mainly useful to kernel hackers + who are debugging unstable kernels. + + The LART and Psion netBook/Series 7 use the same LED for both Timer + and CPU usage LED functions. You may choose to use both, but the + Timer LED function will overrule the CPU usage LED. CPU usage LED CONFIG_LEDS_CPU @@ -350,9 +351,9 @@ time indication of CPU usage, by lighting whenever the idle task is not currently executing. - The LART uses the same LED for both Timer LED and CPU usage LED - functions. You may choose to use both, but the Timer LED function - will overrule the CPU usage LED. + The LART and Psion netBook/Series 7 use the same LED for both Timer + and CPU usage LED functions. You may choose to use both, but the + Timer LED function will overrule the CPU usage LED. Kernel FP software completion CONFIG_MATHEMU @@ -16969,6 +16970,36 @@ directory /) cannot be a module, so don't say M here if you intend to use UMSDOS as your root file system. +EPOC FAT support +CONFIG_EPOC_FAT_FS + This allows sharing a FAT partition with EPOC 5 (perhaps also + relevant for later versions of EPOC aka Symbian). See + + + In the FAT standard the end of the directory file index is marked + by 00. All entries after it should be ignored. The current FAT + implementation ignores such marked entries, but continues scanning + the directory. This is good enough for most FAT implementations, + because they also mark all remaining entries after the last with a + 00 byte. + + The filesystem implementation of EPOC 5 (and perhaps of newer + versions of EPOC) does not clear old entries after the end of the + directory file index. This means that without this patch, Linux will + show old previously deleted or even never assigned entries. + + If you say Y here, all FAT-based filesystems will be handled in a way + compatible with EPOC. Examples are filesystems of the type `msdos' or + `vfat'. + + Issues: all FAT-based partitions will use the new policy; there is no + mount option. In most cases it should work well enough; if you want to + be completely safe, mount FAT-based partitions read-only. + + Unless you plan to exchange compact flash cards, microdrives or similar + devices between machines running linux and EPOC, or run both linux and + EPOC on the same device, you most likely want to say 'N' here. + MSDOS fs support CONFIG_MSDOS_FS This allows you to mount MSDOS partitions of your hard drive (unless @@ -25820,6 +25851,41 @@ CONFIG_SA1100_BRUTUS Say Y here if you are using the Intel(R) StrongARM(R) SA-1100 Microprocessor Development Board (also known as the Brutus). + +Psion Netbook/Series 7 +CONFIG_SA1100_NETBOOK + Say Y here if you are using the Psion Netbook and/or Series 7. + See , and + for more information on + running Linux on these machines. + +# Choice: Netbook_ram +Netbook/Series 7 available RAM +CONFIG_SA1100_NETBOOK_RAM_DEF + Options here are: + - default: use default random-access memory size (16MB); + if the bootloader provides memory layout information, + that will be used instead. + - fixed random-access memory layout (32 or 64 MB) + This will force any information from the bootloader + regarding memory layout to be ignored. + +Netbook/Series 7 with 32MB RAM +CONFIG_SA1100_NETBOOK_RAM_32MB + Declare that the Netbook/Series 7 has 32MB RAM. + This will force any information from the bootloader + regarding memory layout to be ignored. + +Netbook/Series 7 with 64MB RAM +CONFIG_SA1100_NETBOOK_RAM_64MB + Declare that the Netbook/Series 7 has 64MB RAM. + This will force any information from the bootloader + regarding memory layout to be ignored. + +Netbook/Series 7 touchscreen +CONFIG_SA1100_NETBOOK_TOUCHSCREEN + Say yes if you want touchscreen support. + Also available as a module named "netbook_touchscreen". LART CONFIG_SA1100_LART diff -ruN linux-2.4.27-vrs1/Documentation/arm/SA1100/Netbook_and_Series7 linux-2.4.27-vrs1-kvd1/Documentation/arm/SA1100/Netbook_and_Series7 --- linux-2.4.27-vrs1/Documentation/arm/SA1100/Netbook_and_Series7 Thu Jan 1 01:00:00 1970 +++ linux-2.4.27-vrs1-kvd1/Documentation/arm/SA1100/Netbook_and_Series7 Fri Dec 31 10:01:34 2004 @@ -0,0 +1,163 @@ +Psion Netbook and Series 7 +========================== + +Status +------ + +* working: +- serial +- keyboard +- lcd +- red LED (green/amber LED is hardware controlled) +- rtc (with an offset) +- cf card +- pcmcia card +- brightness and contrast (either from /proc/netbook/(contrast|brightness) + or use the controls on the keyboard (fn+space cycles brightness)). +- read presence of battery, external power and charging status +- detect battery/external power +- touchscreen + +* doesn't work yet: +- irDA (being worked on) +- sound (some initial steps done) +- soft reboots + +* known issues: +- values of TEXTADDR other than 0xc0008000 appear not to work + hint: the kernel fails near flush_tlb_all and paging_init +- only compressed (zImage) kernels will work with arlo + this is directly related to the above problem with TEXTADDR + and the fact that arlo assumes 0xc0208000. (the decompression + code automatically resolves this inconsistency). +- the location of the bootparameters is weird, and purely based on + compatibility with arlo v1.0.2. Very large kernels (near 2MB + or larger) will cause problems. +- PCMCIA interrupts are not handled properly yet (but they work for + some, YMMV) +- if you define NETBOOK_PROC_DEBUG in + arch/arm/mach-sa1100/netbook_proc.c, + there's /proc/netbook which has several registers that can be + read or written to +- it hasn't been tested whether /proc/netbook/flash is a valid dump. + +Intro: +------ + +The Netbook and Series 7 are SA1100-based machines produced by Psion Ltd. +(www.psion.com). + +Several different variants are known to exist: +1. the Netbook +2. the 'Malaybook', a version of the Netbook produced for a discontinued + Malaysian school project. +3. the Series 7. The hardware in these apparently varied somewhat over + time. They can be distinguished with the OS revision the machine + was originally supplied with (751, 754 or 756). +4. the '7book'; this refers to a Series 7 equiped with a Netbook personality + module. + +The main known differences between these models appear to be located +in a small removable expansion board, called a 'personality module'. +Exchanging the expansion boards makes the Series 7 act much like a Netbook +and vice versa. + +It appears that power that is available for PCMCIA is lower in the +Series 7/7book than in the Netbook/Malaybook. In addition, the different +revisions of the Series 7 have different limits to the power +they can supply to the PCMCIA port. +See e.g. http://www.epocfaq.co.uk/faqNetworks.htm#LANcompat +Linux does not (yet) take these differences in account. You have been +warned. + +The Netbook is designed to boot its operating system from compact flash card +[from a file called 'os.img' located on the first (FAT) partition of the CF +card], while the Series 7 boots EPOC from ROM. It appears +that the bootloader of the Malaybook is slightly different from the bootloader +in the Netbook. As a result, the os.img files provided by the suppliers +can not be directly interchanged. + +The standard Netbook and Malaybook come with 32MB of RAM. +The standard Series 7 comes with 16MB RAM, and a similar amount of ROM, +containing the EPOC operating system, on the personality module. Expansion +modules (which will work with all three variants) with an additional 32MB are +commercially available. + +Linux should run just fine on these machines (if only we had the docs...). +More information is available from the website http://linux-7110.sf.net, +and the mailing list linux-7110-psion@lists.sourceforge.net + +Compiling: +---------- + +- if you are cross-compiling, first make sure the toplevel Makefile is properly + setup for this; i.e., make sure the ARCH and CROSS_COMPILE lines read: + ARCH := arm + CROSS_COMPILE = arm-linux- +- next, do: + make netbook_config + make oldconfig # or: make menuconfig + make dep + make zImage + make modules + make modules_install INSTALL_MOD_PATH=/absolute/path/to/your/arm/root/dir + +Booting: +-------- + +Two cases can be distinguished: +1. booting Linux via EPOC (for the Series 7 this is the only option) +2. booting Linux directly from an os.img file + +To boot linux on via EPOC a bootloader called Arlo is available. +It contains a second-stage bootloader called boot2nd. Both were +developed by Peter van Sebille. See linux-7110.sf.net and www.yipton.net +Note that among other things EPOC enables the built-in watchdog of the +SA-1100 CPU, and this can not be disabled subsequently. + +To boot Linux directly from compact flash card you will need an os.img file. +A package called 'bookboot' exists that will produce an os.img file from the +necessary input (zImage, optionally initrd.gz). Note that there are differences +in the format of the os.img file depending on whether you have the Netbook +or the Malaybook. In practice, the os.img files produced by bookboot +have been reported to work on Malaybook, Netbook, and 7book. +Bookboot is available from the web. See +http://linux-7110.sf.net/files/People/Klaasjan/netbook/ + + +Developer's info: +----------------- + +For clarity, in the code the various machines are all refered to as 'netbook'. +The change in machine name definition (from CONFIG_SA1100_PSION_SERIES7 to +CONFIG_SA1100_NETBOOK) has not been incorporated in the main arm repository +(yet). + +Documentation on the StrongARM SA-1100 processor +(the basis of the Netbook), including GPIOs, serial ports etc can be found +in the SA-1100 Microprocessor Developer's Manual, available from the +LART website: +http://www.lart.tudelft.nl/doc.php3 + +Extensive information on the ARM architecture is also available from ARM +Ltd (fill in a web form, and they'll mail you a cd full of pdf +documentation). +http://www.arm.com/documentation/cd_request.html + + +History/credits: +---------------- + +- Peter van Sebille made the initial port to linux-2.4.2-rmk1 + He got the serial port, lcd, keyboard and watchdog working. +- based on Peter's work, Quentin Gunn and Klaasjan van Druten moved over to + linux-2.4.19-rmk7 and 2.4.21-rmk2 +- Brian Dushaw improved keyboard support by adding the menu, fn, on/off + and external keys +- Matthew Lewis added red LED support, battery/external power detection and + touchscreen support. +- Taneli Leppa added many things: CompactFlash, PCMCIA, /proc, brightness + and contrast support, start of IrDA and sound support. +- Klaasjan van Druten added support for non-arlo boots + +- Last update: December 31, 2004, by Klaasjan van Druten diff -ruN linux-2.4.27-vrs1/Makefile linux-2.4.27-vrs1-kvd1/Makefile --- linux-2.4.27-vrs1/Makefile Sat Aug 14 22:08:26 2004 +++ linux-2.4.27-vrs1-kvd1/Makefile Fri Dec 31 10:05:00 2004 @@ -1,11 +1,11 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 27 -EXTRAVERSION = -vrs1 +EXTRAVERSION = -vrs1-kvd1 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) -ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) +ARCH := arm KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g") CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ @@ -19,7 +19,7 @@ HOSTCC = gcc HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -CROSS_COMPILE = +CROSS_COMPILE = arm-linux- # # Include the make variables (CC, etc...) @@ -238,6 +238,7 @@ MRPROPER_FILES = \ include/linux/autoconf.h include/linux/version.h \ lib/crc32table.h lib/gen_crc32table \ + drivers/char/netbook_keymap.c \ drivers/net/hamradio/soundmodem/sm_tbl_{afsk1200,afsk2666,fsk9600}.h \ drivers/net/hamradio/soundmodem/sm_tbl_{hapn4800,psk4800}.h \ drivers/net/hamradio/soundmodem/sm_tbl_{afsk2400_7,afsk2400_8}.h \ @@ -421,7 +422,7 @@ endif .PHONY: _modinst_post _modinst_post: _modinst_post_pcmcia - if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi + if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE) || /bin/true; fi # Backwards compatibilty symlinks for people still using old versions # of pcmcia-cs with hard coded pathnames on insmod. Remove diff -ruN linux-2.4.27-vrs1/arch/arm/config.in linux-2.4.27-vrs1-kvd1/arch/arm/config.in --- linux-2.4.27-vrs1/arch/arm/config.in Sat Aug 14 22:08:26 2004 +++ linux-2.4.27-vrs1-kvd1/arch/arm/config.in Fri Dec 31 08:15:19 2004 @@ -79,6 +79,15 @@ dep_bool ' ADS Bitsy' CONFIG_SA1100_ADSBITSY $CONFIG_ARCH_SA1100 dep_bool ' ADS Bitsy Plus' CONFIG_SA1100_ADSBITSYPLUS $CONFIG_ARCH_SA1100 dep_bool ' Brutus' CONFIG_SA1100_BRUTUS $CONFIG_ARCH_SA1100 +dep_bool ' Psion Series 7 and Netbook' CONFIG_SA1100_NETBOOK $CONFIG_ARCH_SA1100 +if [ "$CONFIG_SA1100_NETBOOK" = "y" ]; then + choice 'Psion Netbook/Series 7 RAM available' \ + "default CONFIG_SA1100_NETBOOK_RAM_DEF \ + 32MB CONFIG_SA1100_NETBOOK_RAM_32MB \ + 64MB CONFIG_SA1100_NETBOOK_RAM_64MB" default + tristate ' Psion NetBook/Series 7 touchscreen' \ + CONFIG_SA1100_NETBOOK_TOUCHSCREEN +fi dep_bool ' Cep' CONFIG_SA1100_CEP $CONFIG_ARCH_SA1100 dep_bool ' CerfBoard' CONFIG_SA1100_CERF $CONFIG_ARCH_SA1100 if [ "$CONFIG_SA1100_CERF" = "y" ]; then diff -ruN linux-2.4.27-vrs1/arch/arm/def-configs/netbook linux-2.4.27-vrs1-kvd1/arch/arm/def-configs/netbook --- linux-2.4.27-vrs1/arch/arm/def-configs/netbook Thu Jan 1 01:00:00 1970 +++ linux-2.4.27-vrs1-kvd1/arch/arm/def-configs/netbook Fri Dec 31 09:14:06 2004 @@ -0,0 +1,858 @@ +# +# Automatically generated by make menuconfig: don't edit +# +CONFIG_ARM=y +# CONFIG_EISA is not set +# CONFIG_SBUS is not set +# CONFIG_MCA is not set +CONFIG_UID16=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +# CONFIG_GENERIC_BUST_SPINLOCK is not set +# CONFIG_GENERIC_ISA_DMA is not set + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +# CONFIG_OBSOLETE is not set + +# +# Loadable module support +# +CONFIG_MODULES=y +# CONFIG_MODVERSIONS is not set +# CONFIG_KMOD is not set + +# +# System Type +# +# CONFIG_ARCH_ANAKIN is not set +# CONFIG_ARCH_ARCA5K is not set +# CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_CO285 is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_CAMELOT is not set +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_OMAHA is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_MX1ADS is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_RISCSTATION is not set +CONFIG_ARCH_SA1100=y +# CONFIG_ARCH_SHARK is not set +# CONFIG_ARCH_AT91RM9200 is not set + +# +# Archimedes/A5000 Implementations +# +# CONFIG_ARCH_ARC is not set +# CONFIG_ARCH_A5K is not set + +# +# Footbridge Implementations +# +# CONFIG_ARCH_CATS is not set +# CONFIG_ARCH_PERSONAL_SERVER is not set +# CONFIG_ARCH_EBSA285_ADDIN is not set +# CONFIG_ARCH_EBSA285_HOST is not set +# CONFIG_ARCH_NETWINDER is not set + +# +# SA11x0 Implementations +# +# CONFIG_SA1100_ACCELENT is not set +# CONFIG_SA1100_ASSABET is not set +# CONFIG_ASSABET_NEPONSET is not set +# CONFIG_SA1100_ADSAGC is not set +# CONFIG_SA1100_ADSBITSY is not set +# CONFIG_SA1100_ADSBITSYPLUS is not set +# CONFIG_SA1100_BRUTUS is not set +CONFIG_SA1100_NETBOOK=y +CONFIG_SA1100_NETBOOK_RAM_DEF=y +# CONFIG_SA1100_NETBOOK_RAM_32MB is not set +# CONFIG_SA1100_NETBOOK_RAM_64MB is not set +CONFIG_SA1100_NETBOOK_TOUCHSCREEN=y +# CONFIG_SA1100_CEP is not set +# CONFIG_SA1100_CERF is not set +# CONFIG_SA1100_H3100 is not set +# CONFIG_SA1100_H3600 is not set +# CONFIG_SA1100_H3800 is not set +# CONFIG_SA1100_H3XXX is not set +# CONFIG_H3600_SLEEVE is not set +# CONFIG_SA1100_EXTENEX1 is not set +# CONFIG_SA1100_FLEXANET is not set +# CONFIG_SA1100_FREEBIRD is not set +# CONFIG_SA1100_FRODO is not set +# CONFIG_SA1100_GRAPHICSCLIENT is not set +# CONFIG_SA1100_GRAPHICSMASTER is not set +# CONFIG_SA1100_HACKKIT is not set +# CONFIG_SA1100_BADGE4 is not set +# CONFIG_SA1100_JORNADA720 is not set +# CONFIG_SA1100_HUW_WEBPANEL is not set +# CONFIG_SA1100_ITSY is not set +# CONFIG_SA1100_LART is not set +# CONFIG_SA1100_NANOENGINE is not set +# CONFIG_SA1100_OMNIMETER is not set +# CONFIG_SA1100_PANGOLIN is not set +# CONFIG_SA1100_PLEB is not set +# CONFIG_SA1100_PT_SYSTEM3 is not set +# CONFIG_SA1100_SHANNON is not set +# CONFIG_SA1100_SHERMAN is not set +# CONFIG_SA1100_SIMPAD is not set +# CONFIG_SA1100_SIMPUTER is not set +# CONFIG_SA1100_PFS168 is not set +# CONFIG_SA1100_VICTOR is not set +# CONFIG_SA1100_XP860 is not set +# CONFIG_SA1100_YOPY is not set +# CONFIG_SA1100_USB is not set +# CONFIG_SA1100_USB_NETLINK is not set +# CONFIG_SA1100_USB_CHAR is not set +# CONFIG_SA1100_SSP is not set + +# +# AT91RM9200 Implementations +# +# CONFIG_ARCH_AT91RM9200DK is not set +# CONFIG_MACH_CSB337 is not set + +# +# CLPS711X/EP721X Implementations +# +# CONFIG_ARCH_AUTCPU12 is not set +# CONFIG_ARCH_CDB89712 is not set +# CONFIG_ARCH_CLEP7312 is not set +# CONFIG_ARCH_EDB7211 is not set +# CONFIG_ARCH_FORTUNET is not set +# CONFIG_ARCH_GUIDEA07 is not set +# CONFIG_ARCH_P720T is not set +# CONFIG_ARCH_EP7211 is not set +# CONFIG_ARCH_EP7212 is not set +# CONFIG_ARCH_ACORN is not set +# CONFIG_PLD is not set +# CONFIG_FOOTBRIDGE is not set +# CONFIG_FOOTBRIDGE_HOST is not set +# CONFIG_FOOTBRIDGE_ADDIN is not set +CONFIG_CPU_32=y +# CONFIG_CPU_26 is not set +# CONFIG_CPU_ARM610 is not set +# CONFIG_CPU_ARM710 is not set +# CONFIG_CPU_ARM720T is not set +# CONFIG_CPU_ARM920T is not set +# CONFIG_CPU_ARM922T is not set +# CONFIG_CPU_ARM926T is not set +# CONFIG_CPU_ARM1020 is not set +# CONFIG_CPU_ARM1020E is not set +# CONFIG_CPU_ARM1022 is not set +# CONFIG_CPU_ARM1026 is not set +# CONFIG_CPU_SA110 is not set +CONFIG_CPU_SA1100=y +# CONFIG_CPU_32v3 is not set +CONFIG_CPU_32v4=y +CONFIG_DISCONTIGMEM=y + +# +# General setup +# +# CONFIG_PCI is not set +CONFIG_ISA=y +# CONFIG_ISA_DMA is not set +# CONFIG_ZBOOT_ROM is not set +CONFIG_ZBOOT_ROM_TEXT=0 +CONFIG_ZBOOT_ROM_BSS=0 +CONFIG_CPU_FREQ=y +CONFIG_HOTPLUG=y + +# +# PCMCIA/CardBus support +# +CONFIG_PCMCIA=y +CONFIG_PCMCIA_PROBE=y +# CONFIG_I82092 is not set +# CONFIG_I82365 is not set +# CONFIG_TCIC is not set +# CONFIG_PCMCIA_CLPS6700 is not set +CONFIG_PCMCIA_SA1100=y +CONFIG_NET=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_FPE_NWFPE is not set +CONFIG_FPE_FASTFPE=y +CONFIG_KCORE_ELF=y +# CONFIG_KCORE_AOUT is not set +# CONFIG_BINFMT_AOUT is not set +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_PM is not set +# CONFIG_ARTHUR is not set +CONFIG_CMDLINE="keepinitrd" +CONFIG_LEDS=y +CONFIG_LEDS_TIMER=y +CONFIG_LEDS_CPU=y +CONFIG_ALIGNMENT_TRAP=y + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_CISS_SCSI_TAPE is not set +# CONFIG_CISS_MONITOR_THREAD is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=16384 +CONFIG_BLK_DEV_INITRD=y +# CONFIG_BLK_STATS is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# Networking options +# +CONFIG_PACKET=m +# CONFIG_PACKET_MMAP is not set +# CONFIG_NETLINK_DEV is not set +# CONFIG_NETFILTER is not set +# CONFIG_FILTER is not set +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set + +# +# Appletalk devices +# +# CONFIG_DEV_APPLETALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +CONFIG_DUMMY=m +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +# CONFIG_ARM_AM79C961A is not set +# CONFIG_ARM_CIRRUS is not set +# CONFIG_SUNLANCE is not set +# CONFIG_SUNBMAC is not set +# CONFIG_SUNQE is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_AT1700 is not set +# CONFIG_DEPCA is not set +# CONFIG_HP100 is not set +# CONFIG_NET_ISA is not set +# CONFIG_NET_PCI is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_E1000 is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +CONFIG_PPP=m +# CONFIG_PPP_MULTILINK is not set +# CONFIG_PPP_FILTER is not set +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPPOE=m +CONFIG_SLIP=m +CONFIG_SLIP_COMPRESSED=y +# CONFIG_SLIP_SMART is not set +# CONFIG_SLIP_MODE_SLIP6 is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# PCMCIA network device support +# +CONFIG_NET_PCMCIA=y +CONFIG_PCMCIA_3C589=m +CONFIG_PCMCIA_3C574=m +CONFIG_PCMCIA_FMVJ18X=m +CONFIG_PCMCIA_PCNET=m +CONFIG_PCMCIA_AXNET=m +CONFIG_PCMCIA_NMCLAN=m +CONFIG_PCMCIA_SMC91C92=m +CONFIG_PCMCIA_XIRC2PS=m +# CONFIG_ARCNET_COM20020_CS is not set +# CONFIG_PCMCIA_IBMTR is not set +CONFIG_NET_PCMCIA_RADIO=y +CONFIG_PCMCIA_RAYCS=m +CONFIG_PCMCIA_NETWAVE=m +CONFIG_PCMCIA_WAVELAN=m +CONFIG_AIRONET4500_CS=m + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# IrDA (infrared) support +# +CONFIG_IRDA=m +CONFIG_IRLAN=m +CONFIG_IRNET=m +CONFIG_IRCOMM=m +# CONFIG_IRDA_ULTRA is not set +# CONFIG_IRDA_CACHE_LAST_LSAP is not set +# CONFIG_IRDA_FAST_RR is not set +# CONFIG_IRDA_DEBUG is not set + +# +# Infrared-port device drivers +# +CONFIG_IRTTY_SIR=m +CONFIG_IRPORT_SIR=m +# CONFIG_DONGLE is not set +# CONFIG_USB_IRDA is not set +# CONFIG_NSC_FIR is not set +# CONFIG_WINBOND_FIR is not set +# CONFIG_TOSHIBA_OLD is not set +# CONFIG_TOSHIBA_FIR is not set +# CONFIG_SMC_IRCC_FIR is not set +# CONFIG_ALI_FIR is not set +# CONFIG_VLSI_FIR is not set +# CONFIG_VIA_IRCC_FIR is not set +CONFIG_SA1100_FIR=m + +# +# ATA/ATAPI/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEDISK_STROKE is not set +CONFIG_BLK_DEV_IDECS=m +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set +# CONFIG_BLK_DEV_ATARAID_SII is not set + +# +# SCSI support +# +# CONFIG_SCSI is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_UINPUT is not set +# CONFIG_INPUT_MX1TS is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +# CONFIG_SERIAL is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +# CONFIG_SERIAL_ANAKIN is not set +# CONFIG_SERIAL_ANAKIN_CONSOLE is not set +# CONFIG_SERIAL_AMBA is not set +# CONFIG_SERIAL_AMBA_CONSOLE is not set +# CONFIG_SERIAL_CLPS711X is not set +# CONFIG_SERIAL_CLPS711X_CONSOLE is not set +# CONFIG_SERIAL_21285 is not set +# CONFIG_SERIAL_21285_OLD is not set +# CONFIG_SERIAL_21285_CONSOLE is not set +# CONFIG_SERIAL_UART00 is not set +# CONFIG_SERIAL_UART00_CONSOLE is not set +CONFIG_SERIAL_SA1100=y +# CONFIG_SERIAL_SA1100_CONSOLE is not set +CONFIG_SA1100_DEFAULT_BAUDRATE=115200 +# CONFIG_SERIAL_OMAHA is not set +# CONFIG_SERIAL_OMAHA_CONSOLE is not set +# CONFIG_SERIAL_AT91 is not set +# CONFIG_SERIAL_AT91_CONSOLE is not set +# CONFIG_SERIAL_8250 is not set +# CONFIG_SERIAL_8250_CONSOLE is not set +# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250_MANY_PORTS is not set +# CONFIG_SERIAL_8250_SHARE_IRQ is not set +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +# CONFIG_SERIAL_8250_MULTIPORT is not set +# CONFIG_SERIAL_8250_HUB6 is not set +CONFIG_SERIAL_CORE=y +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=32 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# L3 serial bus support +# +# CONFIG_L3 is not set +# CONFIG_L3_ALGOBIT is not set +# CONFIG_L3_BIT_SA1100_GPIO is not set +# CONFIG_L3_SA1111 is not set +# CONFIG_BIT_SA1100_GPIO is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set +# CONFIG_QIC02_TAPE is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_IPMI_PANIC_EVENT is not set +# CONFIG_IPMI_DEVICE_INTERFACE is not set +# CONFIG_IPMI_KCS is not set +# CONFIG_IPMI_WATCHDOG is not set + +# +# Watchdog Cards +# +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set +# CONFIG_ACQUIRE_WDT is not set +# CONFIG_ADVANTECH_WDT is not set +# CONFIG_ALIM1535_WDT is not set +# CONFIG_ALIM7101_WDT is not set +# CONFIG_SC520_WDT is not set +# CONFIG_PCWATCHDOG is not set +# CONFIG_21285_WATCHDOG is not set +# CONFIG_977_WATCHDOG is not set +CONFIG_SA1100_WATCHDOG=m +# CONFIG_EPXA_WATCHDOG is not set +# CONFIG_OMAHA_WATCHDOG is not set +# CONFIG_AT91_WATCHDOG is not set +# CONFIG_EUROTECH_WDT is not set +# CONFIG_IB700_WDT is not set +# CONFIG_WAFER_WDT is not set +# CONFIG_I810_TCO is not set +# CONFIG_MIXCOMWD is not set +# CONFIG_60XX_WDT is not set +# CONFIG_SC1200_WDT is not set +# CONFIG_SCx200_WDT is not set +# CONFIG_SOFT_WATCHDOG is not set +# CONFIG_W83877F_WDT is not set +# CONFIG_WDT is not set +# CONFIG_WDTPCI is not set +# CONFIG_MACHZ_WDT is not set +# CONFIG_SCx200 is not set +# CONFIG_SCx200_GPIO is not set +# CONFIG_AMD_PM768 is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +CONFIG_SA1100_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set + +# +# Direct Rendering Manager (XFree86 DRI support) +# +# CONFIG_DRM is not set + +# +# PCMCIA character devices +# +# CONFIG_SYNCLINK_CS is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_QFMT_V2 is not set +CONFIG_AUTOFS_FS=m +CONFIG_AUTOFS4_FS=m +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BEFS_DEBUG is not set +# CONFIG_BFS_FS is not set +CONFIG_EXT3_FS=m +CONFIG_JBD=m +# CONFIG_JBD_DEBUG is not set +CONFIG_FAT_FS=m +CONFIG_EPOC_FAT_FS=y +CONFIG_MSDOS_FS=m +CONFIG_UMSDOS_FS=m +CONFIG_VFAT_FS=m +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +CONFIG_RAMFS=y +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_ZISOFS is not set +# CONFIG_JFS_FS is not set +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_FS is not set +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_TRACE is not set +# CONFIG_XFS_DEBUG is not set + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set +# CONFIG_NFS_FS is not set +# CONFIG_NFS_V3 is not set +# CONFIG_NFS_DIRECTIO is not set +# CONFIG_ROOT_NFS is not set +# CONFIG_NFSD is not set +# CONFIG_NFSD_V3 is not set +# CONFIG_NFSD_TCP is not set +# CONFIG_SUNRPC is not set +# CONFIG_LOCKD is not set +# CONFIG_SMB_FS is not set +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set +# CONFIG_ZISOFS_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Console drivers +# +CONFIG_PC_KEYMAP=y +# CONFIG_VGA_CONSOLE is not set + +# +# Frame-buffer support +# +CONFIG_FB=y +CONFIG_DUMMY_CONSOLE=y +# CONFIG_FB_ACORN is not set +# CONFIG_FB_ANAKIN is not set +# CONFIG_FB_CLPS711X is not set +CONFIG_FB_SA1100=y +# CONFIG_FB_DBMX1 is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FBCON_ADVANCED is not set +CONFIG_FBCON_CFB2=y +CONFIG_FBCON_CFB4=y +CONFIG_FBCON_CFB8=y +CONFIG_FBCON_CFB16=y +# CONFIG_FBCON_FONTWIDTH8_ONLY is not set +CONFIG_FBCON_FONTS=y +# CONFIG_FONT_8x8 is not set +CONFIG_FONT_8x16=y +# CONFIG_FONT_SUN8x16 is not set +# CONFIG_FONT_SUN12x22 is not set +# CONFIG_FONT_6x11 is not set +# CONFIG_FONT_PEARL_8x8 is not set +# CONFIG_FONT_ACORN_8x8 is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# Multimedia Capabilities Port drivers +# +# CONFIG_MCP is not set +# CONFIG_MCP_SA1100 is not set +# CONFIG_MCP_UCB1200 is not set +# CONFIG_MCP_UCB1200_AUDIO is not set +# CONFIG_MCP_UCB1200_TS is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# Support for USB gadgets +# +# CONFIG_USB_GADGET is not set + +# +# Bluetooth support +# +# CONFIG_BLUEZ is not set + +# +# Kernel hacking +# +CONFIG_FRAME_POINTER=y +# CONFIG_DEBUG_USER is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_NO_PGT_CACHE is not set +# CONFIG_DEBUG_KERNEL is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_WAITQ is not set +# CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_DEBUG_ERRORS is not set +# CONFIG_DEBUG_LL is not set +# CONFIG_DEBUG_DC21285_PORT is not set +# CONFIG_DEBUG_CLPS711X_UART2 is not set + +# +# Library routines +# +# CONFIG_CRC32 is not set +CONFIG_ZLIB_INFLATE=m +CONFIG_ZLIB_DEFLATE=m +# CONFIG_FW_LOADER is not set diff -ruN linux-2.4.27-vrs1/arch/arm/kernel/armksyms.c linux-2.4.27-vrs1-kvd1/arch/arm/kernel/armksyms.c --- linux-2.4.27-vrs1/arch/arm/kernel/armksyms.c Mon Aug 25 13:44:39 2003 +++ linux-2.4.27-vrs1-kvd1/arch/arm/kernel/armksyms.c Thu Dec 30 20:11:17 2004 @@ -67,6 +67,7 @@ extern void __udivsi3(void); extern void __umodsi3(void); extern void abort(void); +extern void do_div64(void); extern void ret_from_exception(void); extern void fpundefinstr(void); @@ -238,6 +239,7 @@ EXPORT_SYMBOL_NOVERS(__udivsi3); EXPORT_SYMBOL_NOVERS(__umodsi3); EXPORT_SYMBOL_NOVERS(abort); +EXPORT_SYMBOL_NOVERS(do_div64); /* bitops */ EXPORT_SYMBOL(set_bit); diff -ruN linux-2.4.27-vrs1/arch/arm/kernel/irq.c linux-2.4.27-vrs1-kvd1/arch/arm/kernel/irq.c --- linux-2.4.27-vrs1/arch/arm/kernel/irq.c Sat Aug 14 22:08:26 2004 +++ linux-2.4.27-vrs1-kvd1/arch/arm/kernel/irq.c Sat Aug 14 22:10:29 2004 @@ -80,6 +80,9 @@ struct irqdesc *desc = irq_desc + irq; unsigned long flags; + if (!desc) + return; + spin_lock_irqsave(&irq_controller_lock, flags); if (!desc->disable_depth++) { #ifndef CONFIG_CPU_SA1100 @@ -103,6 +106,9 @@ { struct irqdesc *desc = irq_desc + irq; unsigned long flags; + + if (!desc) + return; spin_lock_irqsave(&irq_controller_lock, flags); if (!desc->disable_depth) { diff -ruN linux-2.4.27-vrs1/arch/arm/kernel/time.c linux-2.4.27-vrs1-kvd1/arch/arm/kernel/time.c --- linux-2.4.27-vrs1/arch/arm/kernel/time.c Mon Aug 25 13:44:39 2003 +++ linux-2.4.27-vrs1-kvd1/arch/arm/kernel/time.c Fri Dec 31 08:17:33 2004 @@ -201,9 +201,17 @@ write_unlock_irq(&xtime_lock); } +#ifdef CONFIG_SA1100_NETBOOK +static char *netbook_timer_dev_id = "netbook_timer"; +#endif + static struct irqaction timer_irq = { .name = "timer", +#ifndef CONFIG_SA1100_NETBOOK .flags = SA_INTERRUPT, +#else + .flags = SA_SHIRQ, +#endif }; /* @@ -221,6 +229,8 @@ { xtime.tv_usec = 0; xtime.tv_sec = 0; - +#ifdef CONFIG_SA1100_NETBOOK + timer_irq.dev_id = (void *)netbook_timer_dev_id; +#endif setup_timer(); } diff -ruN linux-2.4.27-vrs1/arch/arm/mach-sa1100/Makefile linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/Makefile --- linux-2.4.27-vrs1/arch/arm/mach-sa1100/Makefile Mon Aug 25 13:44:39 2003 +++ linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/Makefile Fri Dec 31 08:18:10 2004 @@ -78,6 +78,7 @@ obj-$(CONFIG_SA1100_VICTOR) += victor.o obj-$(CONFIG_SA1100_XP860) += xp860.o obj-$(CONFIG_SA1100_YOPY) += yopy.o +obj-$(CONFIG_SA1100_NETBOOK) += netbook.o netbook_proc.o netbook_spi.o # LEDs support leds-y := leds.o @@ -97,6 +98,7 @@ leds-$(CONFIG_SA1100_PFS168) += leds-pfs168.o leds-$(CONFIG_SA1100_SIMPAD) += leds-simpad.o leds-$(CONFIG_SA1100_PT_SYSTEM3) += leds-system3.o +leds-$(CONFIG_SA1100_NETBOOK) += leds-netbook.o obj-$(CONFIG_LEDS) += $(leds-y) # SA1110 USB client support @@ -110,6 +112,8 @@ obj-$(CONFIG_PM) += pm.o sleep.o obj-$(CONFIG_SA1100_SSP) += ssp.o + +obj-$(CONFIG_SA1100_NETBOOK_TOUCHSCREEN) += netbook_touchscreen.o include $(TOPDIR)/Rules.make diff -ruN linux-2.4.27-vrs1/arch/arm/mach-sa1100/leds-netbook.c linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/leds-netbook.c --- linux-2.4.27-vrs1/arch/arm/mach-sa1100/leds-netbook.c Thu Jan 1 01:00:00 1970 +++ linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/leds-netbook.c Thu Dec 30 21:55:25 2004 @@ -0,0 +1,165 @@ +/* + * linux/arch/arm/mach-sa1100/leds-netbook.c + * + * By Matthew Lewis + * Copyright (C) 2004 Mobile Innovation Ltd, www.mobileinnovation.co.uk + * + * small cosmetic changes (moved definition of netbook/series7-specific + * LED bit to include file, rename to leds-netbook.c) + * by Klaasjan van Druten, July-December 2004 + * + * Use of red LED depends on macros: + * CONFIG_LEDS_TIMER: Toggle every 50 timer interrupts + * CONFIG_LEDS_CPU: LED on when CPU not in idle + * + * If both are defined then the timer wins - the timer can be stopped + * (with event led_stop_timer_mode) in which case the CPU LED starts. + * + * The LEDs can also be "claimed": the timer/CPU behaviour stops and + * the LEDs respond to on/off requests. + */ + +#include +#include +#include +#include "leds.h" + + +#define LED_STATE_ENABLED 1 +#define LED_STATE_CLAIMED 2 +#ifdef CONFIG_LEDS_TIMER +#define LED_STATE_TIMER_STOPPED 4 +#endif + +static unsigned int led_state; +static unsigned int hw_led_state; + +#define LED_RED NETBOOK_GPIO_LED_RED +#define LED_MASK (NETBOOK_GPIO_LED_RED) + +/* + * Helper functions + */ + +static inline void init_unclaimed_led(void) +{ +#if defined CONFIG_LEDS_TIMER || defined CONFIG_LEDS_CPU + hw_led_state |= LED_RED; +#else + hw_led_state = 0; +#endif +} + + +#ifdef CONFIG_LEDS_CPU +static inline int cpu_led_available(void) +{ +# ifdef CONFIG_LEDS_TIMER + return !(led_state & LED_STATE_CLAIMED) + && (led_state & LED_STATE_TIMER_STOPPED); +# else + return !(led_state & LED_STATE_CLAIMED); +# endif +} +#endif + + +static void netbook_led_update(unsigned int state) +{ + GPSR = state; + GPCR = state ^ LED_MASK; +} + + +/* + * The function that does the work + */ +void netbook_leds_event(led_event_t evt) +{ + unsigned long flags; + + local_irq_save(flags); + + switch (evt) { /* The set of events is defined in include/asm-arm/leds.h */ + + case led_start: + if (!(led_state & (LED_STATE_ENABLED | LED_STATE_CLAIMED))) + init_unclaimed_led(); + led_state |= LED_STATE_ENABLED; + break; + + case led_stop: + /* Leave hw_led_state flags unchanged, but switch off LEDs */ + netbook_led_update(0); + led_state &= ~LED_STATE_ENABLED; + break; + + case led_claim: + if (!(led_state & LED_STATE_CLAIMED)) + hw_led_state = 0; + led_state |= LED_STATE_CLAIMED; + break; + + case led_release: + if (led_state & LED_STATE_CLAIMED) { + if (led_state & LED_STATE_ENABLED) + init_unclaimed_led(); + else + hw_led_state = 0; + } + led_state &= ~LED_STATE_CLAIMED; + break; + +#ifdef CONFIG_LEDS_TIMER + case led_start_timer_mode: + /* Just leave LED in current state - it will toggle soon enough */ + led_state &= ~LED_STATE_TIMER_STOPPED; + break; + + case led_stop_timer_mode: + if (!(led_state & (LED_STATE_CLAIMED|LED_STATE_TIMER_STOPPED))) +#ifdef CONFIG_LEDS_CPU + hw_led_state |= LED_RED; +#else + hw_led_state &= ~LED_RED; +#endif + led_state |= LED_STATE_TIMER_STOPPED; + break; + + case led_timer: + if (!(led_state & (LED_STATE_CLAIMED|LED_STATE_TIMER_STOPPED))) + hw_led_state ^= LED_RED; + break; +#endif + +#ifdef CONFIG_LEDS_CPU + case led_idle_start: + if (cpu_led_available()) + hw_led_state &= ~LED_RED; + break; + + case led_idle_end: + if (cpu_led_available()) + hw_led_state |= LED_RED; + break; +#endif + + case led_red_on: + if (led_state & LED_STATE_CLAIMED) + hw_led_state |= LED_RED; + break; + + case led_red_off: + if (led_state & LED_STATE_CLAIMED) + hw_led_state &= ~LED_RED; + break; + + default: + break; + } + + if (led_state & LED_STATE_ENABLED) + netbook_led_update(hw_led_state); + + local_irq_restore(flags); +} diff -ruN linux-2.4.27-vrs1/arch/arm/mach-sa1100/leds.c linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/leds.c --- linux-2.4.27-vrs1/arch/arm/mach-sa1100/leds.c Mon Aug 25 13:44:39 2003 +++ linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/leds.c Fri Dec 31 08:26:16 2004 @@ -43,6 +43,8 @@ leds_event = lart_leds_event; if (machine_is_pfs168()) leds_event = pfs168_leds_event; + if (machine_is_netbook()) + leds_event = netbook_leds_event; if (machine_is_pt_system3()) leds_event = system3_leds_event; diff -ruN linux-2.4.27-vrs1/arch/arm/mach-sa1100/leds.h linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/leds.h --- linux-2.4.27-vrs1/arch/arm/mach-sa1100/leds.h Mon Aug 25 13:44:39 2003 +++ linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/leds.h Thu Dec 30 21:56:01 2004 @@ -12,4 +12,5 @@ extern void hackkit_leds_event(led_event_t evt); extern void lart_leds_event(led_event_t evt); extern void pfs168_leds_event(led_event_t evt); +extern void netbook_leds_event(led_event_t evt); extern void system3_leds_event(led_event_t evt); diff -ruN linux-2.4.27-vrs1/arch/arm/mach-sa1100/netbook.c linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/netbook.c --- linux-2.4.27-vrs1/arch/arm/mach-sa1100/netbook.c Thu Jan 1 01:00:00 1970 +++ linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/netbook.c Fri Dec 31 08:18:43 2004 @@ -0,0 +1,99 @@ +/* + * linux/arch/arm/mach-sa1100/netbook.c + * + * This file contains the basic tweaks specific to the + * Psion Netbook and Series 7 machines. + * + * Copyright (C) 2003-2004 Klaasjan van Druten + * + * initial version, heavily based on similar files in this directory, + * and on the initial port to linux 2.4.2-rmk1 by Peter van Sebille. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "generic.h" + +static void __init +fixup_netbook(struct machine_desc *desc, struct param_struct *params, + char **cmdline, struct meminfo *mi) +{ +#ifdef CONFIG_SA1100_NETBOOK_RAM_DEF + /* default memory config: no info needed */ +#elif CONFIG_SA1100_NETBOOK_RAM_32MB + SET_BANK(0, 0xc0000000, 16*1024*1024); + SET_BANK(1, 0xc8000000, 16*1024*1024); + mi->nr_banks = 2; +#elif CONFIG_SA1100_NETBOOK_RAM_64MB + SET_BANK(0, 0xc0000000, 16*1024*1024); + SET_BANK(1, 0xc8000000, 16*1024*1024); + SET_BANK(2, 0xd0000000, 16*1024*1024); + SET_BANK(3, 0xd8000000, 16*1024*1024); + mi->nr_banks = 4; +#else +# error Unknown Netbook/Series 7 memory layout! +#endif +} + +static struct map_desc netbook_io_desc[] __initdata = { + /* virtual physical length domain r w c b */ + { NETBOOK_ASIC14_V, NETBOOK_ASIC14_P, NETBOOK_ASIC14_LENGTH, DOMAIN_IO, 1, 1, 0, 0 }, +#ifdef CONFIG_PROC_FS + { NETBOOK_FLASH_V, NETBOOK_FLASH_P, NETBOOK_FLASH_SIZE, DOMAIN_IO, 1, 0, 0, 0 }, +#endif + LAST_DESC +}; + +static void __init netbook_map_io(void) +{ + u32 lcd_mask=0; + int i; + + for (i = 8; i < 16; i++){ + lcd_mask |= GPIO_LDD(i); + } + sa1100_map_io(); + iotable_init(netbook_io_desc); + + sa1100_register_uart(0, 3); + + GAFR = lcd_mask | GPIO_32_768kHz; + GPDR = lcd_mask | NETBOOK_GPIO_LED_RED | NETBOOK_GPIO_LCD | + GPIO_32_768kHz; + GPDR |= NETBOOK_GPIO_IRDA1 | NETBOOK_GPIO_IRDA2 | NETBOOK_GPIO_IRDA3 + | NETBOOK_GPIO_IRDA4; + GPDR |= NETBOOK_GPIO_UNKNOWN_OUTPUT; + + GPSR = NETBOOK_GPIO_LCD; + NETBOOK_ASIC14_MEM32(NETBOOK_ASIC14_CTRL0_REG) = + ( NETBOOK_ASIC14_MEM32(NETBOOK_ASIC14_CTRL0_REG) & + ~NETBOOK_ASIC14_CTRL0_BR_MASK ) | NETBOOK_ASIC14_CTRL0_BR_ON; + +} + +MACHINE_START(NETBOOK, "Psion Netbook/Series 7") + MAINTAINER("The OpenPsion team: http://linux-7110.sf.net") + BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) + FIXUP(fixup_netbook) + +/* should match with bootloader */ +/* for arlo v1.0.2: 0xc0208000 - 128*1024 */ + BOOT_PARAMS(0xc01e8000) + + MAPIO(netbook_map_io) + INITIRQ(sa1100_init_irq) +MACHINE_END diff -ruN linux-2.4.27-vrs1/arch/arm/mach-sa1100/netbook_proc.c linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/netbook_proc.c --- linux-2.4.27-vrs1/arch/arm/mach-sa1100/netbook_proc.c Thu Jan 1 01:00:00 1970 +++ linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/netbook_proc.c Fri Dec 31 09:50:32 2004 @@ -0,0 +1,582 @@ +/* /proc interface for Netbook, + * + * based on simpad.c, sa1100_generic.c, sm_osl.c, kcore.c + * + * Series7/Netbook specific stuff + * Copyright (C) 2004 Taneli Leppa + * + * External-power/battery/recharge additions by Matthew Lewis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Changes: + * 2004-10-18: Matthew Lewis - Removed touchscreen debug entries + * Exported proc_netbook + */ +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#ifdef CONFIG_PROC_FS +#include +#include +#include + +#define NETBOOK_PROC_REGISTERS 32 +/* #define NETBOOK_PROC_DEBUG 1 */ + +struct proc_dir_entry *proc_netbook = NULL; + +static struct proc_dir_entry *proc_netbook_contrast = NULL; +static struct proc_dir_entry *proc_netbook_brightness = NULL; +static struct proc_dir_entry *proc_netbook_recharge = NULL; +static struct proc_dir_entry *proc_netbook_extpower = NULL; +static struct proc_dir_entry *proc_netbook_battery = NULL; +static struct proc_dir_entry *proc_netbook_flash = NULL; + +#ifdef NETBOOK_PROC_DEBUG +struct sa1100_internal_reg { + volatile u32 *regaddr; + char *regname; + struct proc_dir_entry *proc; +}; + +struct sa1100_internal_reg proc_sa1100_regs[] = +{ + /* GPIO registers */ + { &GPLR, "gplr", NULL }, + { &GPDR, "gpdr", NULL }, + { &GPSR, "gpsr", NULL }, + { &GPCR, "gpcr", NULL }, + { &GRER, "grer", NULL }, + { &GFER, "gfer", NULL }, + { &GEDR, "gedr", NULL }, + { &GAFR, "gafr", NULL }, + /* Interrupt controller registers */ + { &ICMR, "icmr", NULL }, + { &ICIP, "icip", NULL }, + { &ICLR, "iclr", NULL }, + { &ICCR, "iccr", NULL }, + { &ICFP, "icfp", NULL }, + { &ICPR, "icpr", NULL }, + /* Power manager registers */ + { &PMCR, "pcmr", NULL }, + { &PSSR, "pssr", NULL }, + { &PSPR, "pspr", NULL }, + { &PWER, "pwer", NULL }, + { &PCFR, "pcfr", NULL }, + { &PPCR, "ppcr", NULL }, + { &PGSR, "pgsr", NULL }, + { &POSR, "posr", NULL }, + /* RTC registers */ + { &RTAR, "rtar", NULL }, + { &RCNR, "rcnr", NULL }, + { &RTTR, "rttr", NULL }, + { &RTSR, "rstr", NULL }, + /* OS timer registers */ + { &OSMR0, "osmr0", NULL }, + { &OSMR1, "osmr1", NULL }, + { &OSMR2, "osmr2", NULL }, + { &OSMR3, "osmr3", NULL }, + { &OSCR, "oscr", NULL }, + { &OSSR, "ossr", NULL }, + { &OWER, "ower", NULL }, + { &OIER, "oier", NULL }, + /* Peripheral pin controller registers */ + { &PPDR, "ppdr", NULL }, + { &PPSR, "ppsr", NULL }, + { &PPAR, "ppar", NULL }, + { &PSDR, "psdr", NULL }, + { &PPFR, "ppfr", NULL }, + /* Serial port 0 UARTs */ + { &Ser0UDCCR, "ser0_udccr", NULL }, + { &Ser0UDCAR, "ser0_udcar", NULL }, + { &Ser0UDCOMP, "ser0_udcomp", NULL }, + { &Ser0UDCIMP, "ser0_udcimp", NULL }, + { &Ser0UDCCS0, "ser0_udccs0", NULL }, + { &Ser0UDCCS1, "ser0_udccs1", NULL }, + { &Ser0UDCCS2, "ser0_udccs2", NULL }, + { &Ser0UDCD0, "ser0_udcd0", NULL }, + { &Ser0UDCWC, "ser0_udcwc", NULL }, + { &Ser0UDCDR, "ser0_udcdr", NULL }, + { &Ser0UDCSR, "ser0_udcsr", NULL }, + /* Serial port 1 UARTs */ + { &Ser1UTCR0, "ser1_utcr0", NULL }, + { &Ser1UTCR1, "ser1_utcr1", NULL }, + { &Ser1UTCR2, "ser1_utcr2", NULL }, + { &Ser1UTCR3, "ser1_utcr3", NULL }, + { &Ser1UTDR, "ser1_utdr", NULL }, + { &Ser1UTSR0, "ser1_utsr0", NULL }, + { &Ser1UTSR1, "ser1_utsr1", NULL }, + /* Serial port 2 UARTs */ + { &Ser2UTCR0, "ser2_utcr0", NULL }, + { &Ser2UTCR1, "ser2_utcr1", NULL }, + { &Ser2UTCR2, "ser2_utcr2", NULL }, + { &Ser2UTCR3, "ser2_utcr3", NULL }, + { &Ser2UTCR4, "ser2_utcr4", NULL }, + { &Ser2UTDR, "ser2_utdr", NULL }, + { &Ser2UTSR0, "ser2_utsr0", NULL }, + { &Ser2UTSR1, "ser2_utsr1", NULL }, + /* Serial port 3 UARTs */ + { &Ser3UTCR0, "ser3_utcr0", NULL }, + { &Ser3UTCR1, "ser3_utcr1", NULL }, + { &Ser3UTCR2, "ser3_utcr2", NULL }, + { &Ser3UTCR3, "ser3_utcr3", NULL }, + { &Ser3UTDR, "ser3_utdr", NULL }, + { &Ser3UTSR0, "ser3_utsr0", NULL }, + { &Ser3UTSR1, "ser3_utsr1", NULL }, + /* Serial port 1 SDLC */ + { &Ser1SDCR0, "ser1_sdcr0", NULL }, + { &Ser1SDCR1, "ser1_sdcr1", NULL }, + { &Ser1SDCR2, "ser1_sdcr2", NULL }, + { &Ser1SDCR3, "ser1_sdcr3", NULL }, + { &Ser1SDCR4, "ser1_sdcr4", NULL }, + { &Ser1SDDR, "ser1_sddr", NULL }, + { &Ser1SDSR0, "ser1_sdsr0", NULL }, + { &Ser1SDSR1, "ser1_sdsr1", NULL }, + /* Serial port 2 HSSP */ + { &Ser2HSCR0, "ser2_hscr0", NULL }, + { &Ser2HSCR1, "ser2_hscr1", NULL }, + { &Ser2HSDR, "ser2_hsdr", NULL }, + { &Ser2HSSR0, "ser2_hssr0", NULL }, + { &Ser2HSSR1, "ser2_hssr1", NULL }, + { &Ser2HSCR2, "ser2_hscr2", NULL }, + /* Serial port 4 MCP */ + { &Ser4MCCR0, "ser4_mccr0", NULL }, + { &Ser4MCDR0, "ser4_mcdr0", NULL }, + { &Ser4MCDR1, "ser4_mcdr1", NULL }, + { &Ser4MCDR2, "ser4_mcdr2", NULL }, + { &Ser4MCSR, "ser4_mcsr", NULL }, + { &Ser4MCCR1, "ser4_mccr1", NULL }, + /* Serial port 4 SSP */ + { &Ser4SSCR0, "ser4_sscr0", NULL }, + { &Ser4SSCR1, "ser4_sscr1", NULL }, + { &Ser4SSDR, "ser4_ssdr", NULL }, + { &Ser4SSSR, "ser4_sssr", NULL } +}; + +static struct proc_dir_entry *proc_netbook_regdir = NULL; +static struct proc_dir_entry *proc_netbook_saregdir = NULL; +static struct proc_dir_entry *proc_netbook_regs[NETBOOK_PROC_REGISTERS*2]; +static struct proc_dir_entry *proc_netbook_allregs = NULL; +#endif + +u16 netbook_get_contrast(void) +{ + return 33 - (1 + (NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_CONTRAST_REG))); +} + +/* contrast: 1-32 */ +void netbook_set_contrast(u16 contrast) +{ + if (contrast > 0 && contrast < 33) + { + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_CONTRAST_REG) = (33 - contrast) - 1; + } +} + +u16 netbook_get_brightness(void) +{ + return 1 + (NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_BRIGHTNESS_REG) / 4); +} + +/* brightness: 1-9 */ +void netbook_set_brightness(u16 brightness) +{ + if (brightness > 0 && brightness < 10) + { + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_BRIGHTNESS_REG) = ((brightness - 1) * 4); + } +} + +u16 netbook_get_recharge(void) +{ + u16 value=NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_STATUS6); + value&=NETBOOK_ASIC14_STAT6_RECHARGE_MASK; + value>>=NETBOOK_ASIC14_STAT6_RECHARGE_SHIFT; + return value; +} + +u16 netbook_get_extpower(void) +{ + u16 value=NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_STATUS6); + value&=NETBOOK_ASIC14_STAT6_EXTPOWER; + value>>=NETBOOK_ASIC14_STAT6_EXTPOWER_BIT; + return value; +} + +u16 netbook_get_battery(void) +{ + u16 value=NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_STATUS6); + value&=NETBOOK_ASIC14_STAT6_BATTERY; + value>>=NETBOOK_ASIC14_STAT6_BATTERY_BIT; + return value; +} + +#ifdef NETBOOK_PROC_DEBUG +static int netbook_proc_write(struct file *file, const char *buf, + unsigned long count, void *data) +{ + char cdata[7]; + unsigned int val; + u16 value; + u32 reg; + int ret; + + reg = (u32) data; + + if (count > sizeof(cdata) - 1) + return -EINVAL; + + if (copy_from_user(cdata, buf, count)) + return -EFAULT; + + cdata[count] = '\0'; + if ((ret = sscanf(cdata, "%x", &val)) == 1) + { + value = (u16) val; + NETBOOK_ASIC14_MEM16(reg) = value; + } else + return -EINVAL; + + return count; +} + +static int netbook_proc_read(char *buf, char **start, off_t pos, + int count, int *eof, void *data) +{ + int reg = (int) data; + char *p = buf; + u16 regdata = 0; + + regdata = NETBOOK_ASIC14_MEM16(reg); + p += sprintf(p, "%04x\n", regdata); + + return p - buf; +} + +static int netbook_proc_sareg_write(struct file *file, const char *buf, + unsigned long count, void *data) +{ + char cdata[16]; + unsigned int val; + u32 value; + u32 reg; + int ret; + u32 *ptr; + + reg = (u32) data; + + if (count > sizeof(cdata) - 1) + return -EINVAL; + + if (copy_from_user(cdata, buf, count)) + return -EFAULT; + + cdata[count] = '\0'; + if ((ret = sscanf(cdata, "%x", &val)) == 1) + { + value = (u32) val; + ptr = (u32 *) proc_sa1100_regs[reg].regaddr; + printk("Writing %08x to %08x (%s).\n", + value, (u32)proc_sa1100_regs[reg].regaddr, + proc_sa1100_regs[reg].regname); + *ptr = value; + } else + return -EINVAL; + + return count; +} + +static int netbook_proc_sareg_read(char *buf, char **start, off_t pos, + int count, int *eof, void *data) +{ + int reg = (int) data; + char *p = buf; + u32 regdata = 0; + u32 *ptr; + + ptr = (u32 *)proc_sa1100_regs[reg].regaddr; + regdata = *ptr; + + p += sprintf(p, "%08x\n", regdata); + return p - buf; +} + +static int netbook_proc_read_all(char *buf, char **start, off_t pos, + int count, int *eof, void *data) +{ + char *p = buf; + u32 regdata = 0; + int i; + + for (i = 0; i < NETBOOK_PROC_REGISTERS; i++) + { + regdata = NETBOOK_ASIC14_MEM32(i * 4); + p += sprintf(p, "%08x ", regdata); + if (i % 6 == 5) + p += sprintf(p, "\n"); + } + p += sprintf(p, "\n"); + return p - buf; +} +#endif + +static ssize_t netbook_proc_flash_read(struct file *file, char *buf, + size_t count, loff_t *ppos) +{ + loff_t p = *ppos; + ssize_t read; + + if (p > NETBOOK_FLASH_SIZE) + return 0; + if (count > (NETBOOK_FLASH_SIZE - p)) + count = NETBOOK_FLASH_SIZE - p; + + read = 0; + if (count > 0) + { + if (copy_to_user(buf, (void *) (NETBOOK_FLASH_V + p), count)) + return (ssize_t)-EFAULT; + read += count; + } + *ppos += read; + return read; + +} + +static int netbook_proc_flash_open(struct inode * inode, struct file * filp) +{ + return capable(CAP_SYS_RAWIO) ? 0 : -EPERM; +} + +struct file_operations proc_netbook_flash_operations = { + read: netbook_proc_flash_read, + open: netbook_proc_flash_open, +}; + + +static int netbook_proc_bc_read(char *buf, char **start, off_t pos, + int count, int *eof, void *data) +{ + int reg = (int) data; + char *p = buf; + + switch (reg) + { + case 1: /* Brightness */ + p += sprintf(p, "%u\n", netbook_get_brightness()); + break; + case 2: /* Contrast */ + p += sprintf(p, "%u\n", netbook_get_contrast()); + break; + } + return p - buf; +} + +static int netbook_proc_bc_write(struct file *file, const char *buf, + unsigned long count, void *data) +{ + char cdata[4]; + unsigned int val; + int reg = (int) data; + int ret; + + if (count > sizeof(cdata) - 1) + return -EINVAL; + + if (copy_from_user(cdata, buf, count)) + return -EFAULT; + + cdata[count] = '\0'; + if ((ret = sscanf(cdata, "%u", &val)) == 1) + { + switch (reg) + { + case 1: /* Brightness */ + netbook_set_brightness((u16) val); + break; + case 2: /* Contrast */ + netbook_set_contrast((u16) val); + break; + } + } else + return -EINVAL; + + return count; +} + + +static int netbook_proc_power_read(char *buf, char **start, off_t pos, + int count, int *eof, void *data) +{ + int reg = (int) data; + char *p = buf; + + switch (reg) + { + case 1: /* Recharging status */ + p += sprintf(p, "%u\n", netbook_get_recharge()); + break; + case 2: /* External power present */ + p += sprintf(p, "%u\n", netbook_get_extpower()); + break; + case 3: /* Battery present */ + p += sprintf(p, "%u\n", netbook_get_battery()); + break; + } + return p - buf; +} + +static int __init netbook_proc_init(void) +{ +#ifdef NETBOOK_PROC_DEBUG + int i; + char name[6]; +#endif + + /* Create /proc/netbook */ + proc_netbook = proc_mkdir("netbook", 0); + if (proc_netbook) + { + proc_netbook_flash = create_proc_entry("flash", S_IRUSR, + proc_netbook); + if (proc_netbook_flash) + { + proc_netbook_flash->proc_fops = &proc_netbook_flash_operations; + proc_netbook_flash->size = (size_t) NETBOOK_FLASH_SIZE; + } + + proc_netbook_brightness = create_proc_entry("brightness", 0, + proc_netbook); + if (proc_netbook_brightness) + { + proc_netbook_brightness->read_proc = netbook_proc_bc_read; + proc_netbook_brightness->write_proc = netbook_proc_bc_write; + proc_netbook_brightness->data = (void *) 1; + } + + proc_netbook_contrast = create_proc_entry("contrast", 0, + proc_netbook); + if (proc_netbook_contrast) + { + proc_netbook_contrast->read_proc = netbook_proc_bc_read; + proc_netbook_contrast->write_proc = netbook_proc_bc_write; + proc_netbook_contrast->data = (void *) 2; + } + + proc_netbook_recharge = create_proc_entry("recharge", 0, proc_netbook); + if (proc_netbook_recharge) { + proc_netbook_recharge->read_proc = netbook_proc_power_read; + proc_netbook_recharge->data = (void *) 1; + } + + proc_netbook_extpower = create_proc_entry("external-power", 0, + proc_netbook); + if (proc_netbook_extpower) { + proc_netbook_extpower->read_proc = netbook_proc_power_read; + proc_netbook_extpower->data = (void *) 2; + } + + proc_netbook_battery = create_proc_entry("battery", 0, proc_netbook); + if (proc_netbook_battery) { + proc_netbook_battery->read_proc = netbook_proc_power_read; + proc_netbook_battery->data = (void *) 3; + } + +#ifdef NETBOOK_PROC_DEBUG + proc_netbook_regdir = proc_mkdir("regs", proc_netbook); + if (proc_netbook_regdir) + { + for (i = 0; i < (NETBOOK_PROC_REGISTERS * 2); i++) + { + sprintf(name, "%d", i * 2); + proc_netbook_regs[i] = + create_proc_entry(name, 0, proc_netbook_regdir); + if (proc_netbook_regs[i]) + { + proc_netbook_regs[i]->read_proc = netbook_proc_read; + proc_netbook_regs[i]->write_proc = netbook_proc_write; + proc_netbook_regs[i]->data = (void *)(i * 2); + } else + printk("Could not create /proc/netbook/regs/%s\n", name); + } + } + + proc_netbook_allregs = create_proc_entry("registers", 0, proc_netbook); + proc_netbook_allregs->read_proc = netbook_proc_read_all; + + /* These are /proc entries for SA-1100 registers. */ + + proc_netbook_saregdir = proc_mkdir("sa1100", proc_netbook); + for (i = 0; i < sizeof(proc_sa1100_regs) / sizeof(proc_sa1100_regs[0]); i++) + { + proc_sa1100_regs[i].proc = create_proc_entry(proc_sa1100_regs[i].regname, 0, proc_netbook_saregdir); + proc_sa1100_regs[i].proc->read_proc = netbook_proc_sareg_read; + proc_sa1100_regs[i].proc->write_proc = netbook_proc_sareg_write; + proc_sa1100_regs[i].proc->data = (void *) i; + } +#endif + } else + printk(KERN_WARNING "Unable to create /proc interface for Netbook\n"); + return 0; +} + +static int __exit netbook_exit(void) +{ +#ifdef NETBOOK_PROC_DEBUG + int i; + char name[4]; +#endif + + if (proc_netbook) + { +#ifdef NETBOOK_PROC_DEBUG + for (i = 0; i < sizeof(proc_sa1100_regs) / sizeof(proc_sa1100_regs[0]); i++) + { + remove_proc_entry(proc_sa1100_regs[i].regname, + proc_netbook_saregdir); + } + for (i = 0; i < NETBOOK_PROC_REGISTERS; i++) + { + sprintf(name, "%d", i * 2); + remove_proc_entry(name, proc_netbook_regdir); + } + remove_proc_entry("regs", proc_netbook); + remove_proc_entry("sa1100", proc_netbook); + remove_proc_entry("registers", proc_netbook); +#endif + remove_proc_entry("flash", proc_netbook); + remove_proc_entry("brightness", proc_netbook); + remove_proc_entry("contrast", proc_netbook); + + remove_proc_entry("recharge", proc_netbook); + remove_proc_entry("external-power", proc_netbook); + remove_proc_entry("battery", proc_netbook); + + remove_proc_entry("netbook", 0); + + } + return 0; +} + +__initcall(netbook_proc_init); +#endif + +/* +EXPORT_SYMBOL(netbook_get_brightness); +EXPORT_SYMBOL(netbook_set_brightness); +EXPORT_SYMBOL(netbook_get_contrast); +EXPORT_SYMBOL(netbook_set_contrast); +*/ diff -ruN linux-2.4.27-vrs1/arch/arm/mach-sa1100/netbook_spi.c linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/netbook_spi.c --- linux-2.4.27-vrs1/arch/arm/mach-sa1100/netbook_spi.c Thu Jan 1 01:00:00 1970 +++ linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/netbook_spi.c Thu Dec 30 21:31:37 2004 @@ -0,0 +1,146 @@ +/* + * linux/arch/arm/mach-sa1100/netbook_spi.c + * + * ASIC14 SPI code by Matthew Lewis + * Copyright (C) 2004 Mobile Innovation Ltd, www.mobileinnovation.co.uk + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include + +#include "netbook_spi.h" + +/* + * The ASIC14 SPI is used to read the ADC (for touchscreen and battery + * monitoring), and also to read data from the EEPROM. + */ + +/* Circular buffer for SPI requests */ +#define SPI_REQUEST_BUFFER_SIZE 8 +static struct asic14_spi_request spi_buffer[SPI_REQUEST_BUFFER_SIZE]; +static struct asic14_spi_request *spi_buffer_head=spi_buffer; +static struct asic14_spi_request *spi_buffer_tail=spi_buffer; +static int spi_buffer_count=0; +static spinlock_t asic14_spi_spinlock = SPIN_LOCK_UNLOCKED; + + +/* SPI initialisation */ +#define ASIC14_SPI_DEVICE_NAME "asic14-spi" +static void asic14_spi_irq_handler(int irq, void *dev_id, struct pt_regs *regs); + +static int __init asic14_spi_init(void) +{ + int ret; + + /* Register as irq handler for shared interrupt (for ADC-ready) */ + irq_desc[NETBOOK_SHARED_IRQ].valid=1; + irq_desc[NETBOOK_SHARED_IRQ].probe_ok=0; + set_GPIO_IRQ_edge(NETBOOK_SHARED_IRQ_GPIO, GPIO_FALLING_EDGE); + + ret=request_irq(NETBOOK_SHARED_IRQ,asic14_spi_irq_handler, + SA_SHIRQ|SA_SAMPLE_RANDOM, + ASIC14_SPI_DEVICE_NAME,ASIC14_SPI_DEVICE_NAME); + return ret; +} + +__initcall(asic14_spi_init); + + +/* + * asic14_make_spi_request() is called from the interrupt handler, or + * from asic14_queue_spi_request() when the queue is empty. In either + * case queue locking is taken care of by the calling function. + */ +static void asic14_make_spi_request(void) +{ + /* Write out the next request from the circular buffer */ + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_SPI_DATA) = spi_buffer_tail->data; + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_SPI_FN) = spi_buffer_tail->fn; + + /* Enable ADC interrupts if needed */ + if (spi_buffer_tail->fn == NETBOOK_ASIC14_SPI_FN_ADC) { + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_IRQ_MASK)|= + NETBOOK_ASIC14_IRQ_ADC; + } +} + +/* This function is the interface to be used by device drivers */ +int asic14_queue_spi_request(struct asic14_spi_request *request) +{ + int ret=0; + unsigned long irq_flags; + + spin_lock_irqsave(&asic14_spi_spinlock, irq_flags); + + if (spi_buffer_count==SPI_REQUEST_BUFFER_SIZE) { + printk(KERN_WARNING ASIC14_SPI_DEVICE_NAME": Buffer full\n"); + ret= -1; + goto unlockandret; + } + + spi_buffer_count++; + *spi_buffer_head++=*request; + if (spi_buffer_head==&spi_buffer[SPI_REQUEST_BUFFER_SIZE]) + spi_buffer_head=spi_buffer; + + /* If we have just added to an empty queue, we need to make request */ + if (spi_buffer_count==1) + asic14_make_spi_request(); + +unlockandret: + spin_unlock_irqrestore(&asic14_spi_spinlock, irq_flags); + return ret; +} + + +/* Handle SPI interrupts (from ADC) */ +static void asic14_spi_irq_handler(int irq, void *dev_id, struct pt_regs *regs) +{ + /* Shared interrupt - return immediately if it's not us */ + if (!(NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_STATUS6) + &NETBOOK_ASIC14_STAT6_ADC)) { + return; + } + + /* printk(KERN_INFO "SPI int\n"); */ + + /* Dispatch SPI handler */ + spi_buffer_tail->handler(spi_buffer_tail->arg, + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_SPI_DATA)); + + /* Disable ADC interrupts - they will be re-enabled if needed */ + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_IRQ_MASK)&= + 0xffff^NETBOOK_ASIC14_IRQ_ADC; + + /* Clear ints on ASIC14 and SA1100 */ + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_STATUS6)=NETBOOK_ASIC14_STAT6_ADC; + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_IRQ_STATUS)=NETBOOK_ASIC14_IRQ_ADC; + GEDR=NETBOOK_SHARED_IRQ; + + /* Deal with the queue */ + spin_lock(&asic14_spi_spinlock); + spi_buffer_tail++; + if (spi_buffer_tail==&spi_buffer[SPI_REQUEST_BUFFER_SIZE]) + spi_buffer_tail=spi_buffer; + spi_buffer_count--; + if (spi_buffer_count) + asic14_make_spi_request(); + spin_unlock(&asic14_spi_spinlock); +} + diff -ruN linux-2.4.27-vrs1/arch/arm/mach-sa1100/netbook_spi.h linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/netbook_spi.h --- linux-2.4.27-vrs1/arch/arm/mach-sa1100/netbook_spi.h Thu Jan 1 01:00:00 1970 +++ linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/netbook_spi.h Thu Dec 30 21:34:17 2004 @@ -0,0 +1,27 @@ +/* + * linux/arch/arm/mach-sa1100/netbook_spi.h + * By Matthew Lewis + * Copyright (C) 2004 Mobile Innovation Ltd, www.mobileinnovation.co.uk + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 2004/09/08: Matthew Lewis: ASIC14 SPI related functions + * 2004/12/30: split off in separate file by Klaasjan van Druten + * + * + */ + +/* + * ASIC14 Serial Peripheral Interface requests + */ +struct asic14_spi_request { + u16 data; + u16 fn; + void (*handler)(void *, unsigned int); + void *arg; + }; + +int asic14_queue_spi_request(struct asic14_spi_request *request); + diff -ruN linux-2.4.27-vrs1/arch/arm/mach-sa1100/netbook_touchscreen.c linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/netbook_touchscreen.c --- linux-2.4.27-vrs1/arch/arm/mach-sa1100/netbook_touchscreen.c Thu Jan 1 01:00:00 1970 +++ linux-2.4.27-vrs1-kvd1/arch/arm/mach-sa1100/netbook_touchscreen.c Thu Dec 30 21:34:56 2004 @@ -0,0 +1,835 @@ +/* + * linux/arch/arm/mach-sa1100/netbook_touchscreen.c + * + * Device driver for the Psion NetBook and Series 7 touchscreen. + * Emulates SummaSketch tablet in absolute mode. + * + * By Matthew Lewis + * Copyright (C) 2004 Mobile Innovation Ltd, www.mobileinnovation.co.uk + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#ifdef CONFIG_PROC_FS +#include +#endif + +#include "netbook_spi.h" + +/* + * Constants and settings that people may want to adjust + */ +#define ASIC14_TS_READ_FREQ 20 +#define TS_DATA_QUEUE_SIZE (16*sizeof(point_data)) +#define USE_SUMMA_PROTOCOL + +/* Default calibration - these values seem reasonable. + Change using /proc/netboot/touchscreen/min-x etc before starting X */ +#define TS_DEFAULT_MINX 375 +#define TS_DEFAULT_MINY 255 +#define TS_DEFAULT_MAXX 3575 +#define TS_DEFAULT_MAXY 3750 +/* Offset sets the coordinates of the top-left of the screen */ +#define TS_DEFAULT_OFFSETX 0 +#define TS_DEFAULT_OFFSETY 0 + +/* Debug */ +#define ASIC14_TS_DEBUG_MASK 0 +/* Possible values to be or'ed: */ +#define ASIC14_TS_DEBUG_FS 1 +#define ASIC14_TS_DEBUG_READ 2 +#define ASIC14_TS_DEBUG_XY 4 +#define ASIC14_TS_DEBUG_SUMMA 8 +#define ASIC14_TS_DEBUG_ALL 15 + +/* + * Variables, and constants not designed for tweaking + */ +#ifdef CONFIG_PROC_FS +extern struct proc_dir_entry *proc_netbook; +#endif + +#define ASIC14_TS_DEVICE_NAME "netbook_touchscreen" +static int asic14_ts_major; +static volatile int asic14_ts_isopen = 0; + +static enum {penup, penjustdown, pendown} ts_state; + +static struct {int x; int y;} ts_point[2]; +static int ts_valid_point; +static spinlock_t ts_valid_point_spinlock = SPIN_LOCK_UNLOCKED; + +static struct timer_list ts_timer; + +DECLARE_WAIT_QUEUE_HEAD(ts_wq); + +/* Calibration variables */ +#ifdef CONFIG_PROC_FS +enum asic14_ts_config + {asic14_ts_config_minx, asic14_ts_config_miny, + asic14_ts_config_maxx, asic14_ts_config_maxy, + asic14_ts_config_buttons, + asic14_ts_config_offsetx, asic14_ts_config_offsety}; +#define TS_CONFIG_ENTRIES (asic14_ts_config_offsety+1) +static uint ts_config_var[TS_CONFIG_ENTRIES]; +#define ts_minx ts_config_var[asic14_ts_config_minx] +#define ts_miny ts_config_var[asic14_ts_config_miny] +#define ts_maxx ts_config_var[asic14_ts_config_maxx] +#define ts_maxy ts_config_var[asic14_ts_config_maxy] +#define ts_buttons ts_config_var[asic14_ts_config_buttons] +#define ts_offsetx ts_config_var[asic14_ts_config_offsetx] +#define ts_offsety ts_config_var[asic14_ts_config_offsety] +#else +/* No /proc fs, so these are constants */ +#define ts_minx TS_DEFAULT_MINX +#define ts_miny TS_DEFAULT_MINY +#define ts_maxx TS_DEFAULT_MAXX +#define ts_maxy TS_DEFAULT_MAXY +#define ts_buttons 1 +#define ts_offsetx TS_DEFAULT_OFFSETX +#define ts_offsety TS_DEFAULT_OFFSETY +#endif + +/* Debug macros */ +#define ASIC14_TS_DEBUG_PRINT_ALWAYS(fmt, args...) \ + printk("<4>" ASIC14_TS_DEVICE_NAME": " fmt, ## args) + +#if ASIC14_TS_DEBUG_MASK +# define ASIC14_TS_DEBUG_PRINT(fmt, args...) \ + ASIC14_TS_DEBUG_PRINT_ALWAYS(fmt, ## args) +#else +# define ASIC14_TS_DEBUG_PRINT(fmt, args...) /* empty */ +#endif + +#if ASIC14_TS_DEBUG_MASK&ASIC14_TS_DEBUG_FS +# define ASIC14_TS_DEBUG_FS_PRINT(fmt, args...) \ + ASIC14_TS_DEBUG_PRINT_ALWAYS(fmt, ## args) +#else +# define ASIC14_TS_DEBUG_FS_PRINT(fmt, args...) /* empty */ +#endif + +#if ASIC14_TS_DEBUG_MASK&ASIC14_TS_DEBUG_READ +# define ASIC14_TS_DEBUG_READ_PRINT(fmt, args...) \ + ASIC14_TS_DEBUG_PRINT_ALWAYS(fmt, ## args) +#else +# define ASIC14_TS_DEBUG_READ_PRINT(fmt, args...) /* empty */ +#endif + +#if ASIC14_TS_DEBUG_MASK&ASIC14_TS_DEBUG_XY +# define ASIC14_TS_DEBUG_XY_PRINT(fmt, args...) \ + ASIC14_TS_DEBUG_PRINT_ALWAYS(fmt, ## args) +#else +# define ASIC14_TS_DEBUG_XY_PRINT(fmt, args...) /* empty */ +#endif + +#if ASIC14_TS_DEBUG_MASK&ASIC14_TS_DEBUG_SUMMA +# define ASIC14_TS_DEBUG_SUMMA_PRINT(fmt, args...) \ + ASIC14_TS_DEBUG_PRINT_ALWAYS(fmt, ## args) +#else +# define ASIC14_TS_DEBUG_SUMMA_PRINT(fmt, args...) /* empty */ +#endif + +/* Summa protocol */ +#ifdef USE_SUMMA_PROTOCOL +struct summa_point_data { + u8 byte0; + u8 x1; + u8 x2; + u8 y1; + u8 y2; +}; + +#define SUMMA_BYTE0_BUTTON0 0x01 +#define SUMMA_BYTE0_BUTTON1 0x02 +#define SUMMA_BYTE0_BUTTON2 0x04 +#define SUMMA_BYTE0_ABSY 0x08 +#define SUMMA_BYTE0_ABSX 0x10 +#define SUMMA_BYTE0_TABLET_ID 0x20 +#define SUMMA_BYTE0_PROXIMITY 0x40 +#define SUMMA_BYTE0_PHASING 0x80 + +#define SUMMA_BYTE0_ABS (SUMMA_BYTE0_PHASING|SUMMA_BYTE0_ABSX|SUMMA_BYTE0_ABSY) +#define SUMMA_BYTE0_NULL SUMMA_BYTE0_PHASING + +typedef struct summa_point_data point_data; + +static enum {prompt, stream} ts_summa_mode; + +#else +# error No touchscreen protocol specified + /* Idea for the future: have protocol depend on minor device no */ +#endif + +/* Circular buffer */ +static u8 ts_data_queue[TS_DATA_QUEUE_SIZE]; +static u8 *ts_queue_head; +static u8 *ts_queue_tail; +static int ts_queue_count; +static spinlock_t ts_queue_spinlock = SPIN_LOCK_UNLOCKED; + +static void ts_queue_write_byte_nocheck(int byte) +{ + /* Callers deal with locking, overflow checks and the waitqueue */ + *ts_queue_head = byte; + ts_queue_head++; + if (ts_queue_head==&ts_data_queue[TS_DATA_QUEUE_SIZE]) + ts_queue_head=ts_data_queue; + ts_queue_count++; +} + +static void ts_queue_write_string(char *str, uint len) +{ + /* Assumes len is nonzero */ + unsigned long irq_flags; + + spin_lock_irqsave(&ts_queue_spinlock, irq_flags); + if (ts_queue_count+len <= TS_DATA_QUEUE_SIZE) + do { + ts_queue_write_byte_nocheck(*str); + str++; + } while (--len); + spin_unlock_irqrestore(&ts_queue_spinlock, irq_flags); +} + + +/* + * Declare file operations + */ +static ssize_t asic14_ts_read(struct file *filp, char *buf, size_t count, loff_t *f_pos); +static ssize_t asic14_ts_write(struct file *filp, const char *buf, size_t count, loff_t *f_pos); +static unsigned int asic14_ts_poll(struct file *filp, struct poll_table_struct *wait); +static int asic14_ts_open(struct inode *inode, struct file *filp); +static int asic14_ts_release(struct inode *inode, struct file *filp); + +static struct file_operations asic14_ts_fops = { + owner: THIS_MODULE, + read: asic14_ts_read, + write: asic14_ts_write, + poll: asic14_ts_poll, + open: asic14_ts_open, + release: asic14_ts_release, +}; + + +/* + * Touchscreen initialisation/cleanup + */ +static void asic14_ts_irq_handler(int irq, void *dev_id, struct pt_regs *regs); +static void asic14_ts_timer_handler(unsigned long); +static void ts_reads_addqueue(void); +#ifdef CONFIG_PROC_FS +static void __init asic14_ts_proc_init(void); +#endif + +static int __init asic14_ts_init(void) +{ + ASIC14_TS_DEBUG_PRINT("asic14_ts_init()\n"); + + /* Some initialisation has already been done in asic14_spi_init() */ + + /* Get device number */ + asic14_ts_major= register_chrdev(0, ASIC14_TS_DEVICE_NAME, + &asic14_ts_fops); + if (asic14_ts_major<=0) { + printk(KERN_ERR ASIC14_TS_DEVICE_NAME + ": Failed to get device no\n"); + return asic14_ts_major; + } + printk(KERN_INFO ASIC14_TS_DEVICE_NAME": Got device no %d\n", + asic14_ts_major); + + /* Set which edges trigger pen interrupts */ + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_IRQ_EDGE_REG)&= + 0xffff^NETBOOK_ASIC14_IEDGE_PEN; + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_IRQ_EDGE_REG)|= + NETBOOK_ASIC14_IEDGE_PEN<>7)&0x7f); + ts_queue_write_byte_nocheck(y&0x7f); + ts_queue_write_byte_nocheck((y>>7)&0x7f); + wake_up_interruptible(&ts_wq); + } + spin_unlock_irqrestore(&ts_queue_spinlock, irq_flags); +} +#endif + +/* + * Service routine to read one coord of touchscreen input + */ +static void asic14_read_ts_input(void *ptr, unsigned int data) +{ + ASIC14_TS_DEBUG_READ_PRINT("asic14_read_ts_input()\n"); + + data &= 0x1fff; /* Top three bits are always set */ + + /* Write data to ptr */ + *(int *)((unsigned int)ptr & (0xffffffff^DONE_X_AND_Y_FLAG)) = data; + + /* If there's still the y-coord to come, we're done for now */ + if (!((unsigned int)ptr & DONE_X_AND_Y_FLAG)) + return; + + /* We have both x and y values! */ + + if (!hw_pendown()) { + /* Pen up, so discard point */ + ASIC14_TS_DEBUG_READ_PRINT("Pen up\n"); + + ts_state=penup; + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_IRQ_MASK)|= + NETBOOK_ASIC14_IRQ_PEN; +#ifdef USE_SUMMA_PROTOCOL + /* Write last point with button up */ + if (ts_summa_mode==stream && (ts_buttons&0x07)) + ts_queue_write_summa_data(SUMMA_BYTE0_ABS, + ts_point[ts_valid_point].x, + ts_point[ts_valid_point].y); +#endif + return; + } + + ts_state=pendown; /* In case we're in state penjustdown */ + + spin_lock(&ts_valid_point_spinlock); + ts_valid_point^=1; + spin_unlock(&ts_valid_point_spinlock); + +#ifdef USE_SUMMA_PROTOCOL + if (ts_summa_mode==stream) + ts_queue_write_summa_data(SUMMA_BYTE0_ABS|(ts_buttons&0x07), + ts_point[ts_valid_point].x, + ts_point[ts_valid_point].y); +#endif + + ASIC14_TS_DEBUG_XY_PRINT("X,Y: %d,%d\n",ts_point[ts_valid_point].x, + ts_point[ts_valid_point].y); + + /* Set timer to queue another pair of reads */ + ASIC14_TS_DEBUG_READ_PRINT("Call add_timer()\n"); + ts_timer.expires = jiffies + (HZ / ASIC14_TS_READ_FREQ); + add_timer(&ts_timer); +} + + + +/* + * File operations + */ +static ssize_t +asic14_ts_read(struct file *filp, char *buf, size_t count, loff_t *f_pos) +{ + char* dest; + unsigned long irq_flags; + + ASIC14_TS_DEBUG_FS_PRINT("read %d\n", count); + + if (count==0) + return 0; + + wait_event_interruptible(ts_wq, ts_queue_count); + + dest=buf; + spin_lock_irqsave(&ts_queue_spinlock, irq_flags); + do { + int ret, blockcount; + + /* Work out how much to copy in this block */ + blockcount = &ts_data_queue[TS_DATA_QUEUE_SIZE]-ts_queue_tail; + if (count= TS_CONFIG_ENTRIES) + return -EFAULT; + + if (count>=sizeof(buf_copy)) + return -EINVAL; + if (copy_from_user(buf_copy,buffer,count)) + return -EFAULT; + buf_copy[count]='\0'; + + if (sscanf(buf_copy, "%u", &i) != 1) + return -EINVAL; + + ts_config_var[(uint)data]=i; + + return count; +} + + +static void __init asic14_ts_proc_init(void) +{ + int i; + + if (!proc_netbook) + return; + + asic14_ts_proc_dir = proc_mkdir("touchscreen", proc_netbook); + if (!asic14_ts_proc_dir) { + printk(KERN_WARNING ASIC14_TS_DEVICE_NAME + ": Failed to create /proc interface\n"); + return; + } + + for (i=0; idata = (void *)i; + asic14_ts_proc_entry[i]->read_proc = + asic14_ts_proc_read; + asic14_ts_proc_entry[i]->write_proc = + asic14_ts_proc_write; + } + } +} + +#ifdef MODULE +static void asic14_ts_proc_cleanup(void) +{ + int i; + + if (!proc_netbook) + return; + + for (i=0; i $@ qtronixmap.c: qtronixmap.map + set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@ + +netbook_keymap.c: netbook_keymap.map set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@ diff -ruN linux-2.4.27-vrs1/drivers/char/netbook_keyb.c linux-2.4.27-vrs1-kvd1/drivers/char/netbook_keyb.c --- linux-2.4.27-vrs1/drivers/char/netbook_keyb.c Thu Jan 1 01:00:00 1970 +++ linux-2.4.27-vrs1-kvd1/drivers/char/netbook_keyb.c Fri Dec 31 09:43:25 2004 @@ -0,0 +1,270 @@ +/* + * linux/drivers/char/netbook_keyb.c + * + * Copyright (C) 2002 Peter van Sebille + * + * changed for 2.4.19-rmk7: + * - added k_translate and co, as per keyboard.h, copied from cerf_keyb.c, + * Klaasjan van Druten + * - added keycodes 58-61, following Brian Dushaw's suggestions + * - renamed from s7_keyb.c to netbook_keyb.c, KvD dec 2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +/* + * TODO: + * test whether the behavior below is still present now that we have + * a longer udelay + * - pressing 'b' and 'n' at roughly the same time results in '3' and ';' + */ + +#define NETBOOK_KBD_ROWS 8 +#define NETBOOK_KBD_COLS 8 + +static unsigned rows_reported_down[NETBOOK_KBD_COLS]; + +#define SCANHZ (HZ/20) +#define NUL 0 + +struct timer_list scan_timer; + +static const int netbook_keymap[NETBOOK_KBD_ROWS][NETBOOK_KBD_COLS] = +{ + /* 0 1 2 3 4 5 6 7 */ + /* 0 */ { 28, 14, 61, 0, 57, 58, 60, 1}, + /* 1 */ { 77, 0, 37, 51, 19, 33, 16, 2}, + /* 2 */ { 15, 12, 23, 41, 5, 47, 30, 3}, + /* 3 */ { 21, 13, 9, 50, 6, 46, 44, 7}, + /* 4 */ { 75, 11, 10, 36, 20, 32, 31, 52}, + /* 5 */ { 80, 25, 24, 22, 34, 18, 17, 72}, + /* 6 */ { 49, 39, 38, 8, 48, 4, 45, 35}, + /* 7 */ { 42, 54, 29, 59, 43, 53, 0, 0} +}; + + +// shorthands +#define NETBOOKKeyScan (*((volatile unsigned short *) ( NETBOOK_ASIC14_V + \ + NETBOOK_ASIC14_KBD_SCAN_REG) )) +#define NETBOOKPADR (*((volatile unsigned short *) ( NETBOOK_ASIC14_V + \ + NETBOOK_ASIC14_KBD_PADR_REG ) )) +#define NETBOOK_KBSC_COL0 8 + + +// the 32 udelay as used previously was not long enough. +unsigned kbd_delay[]={48 ,48 ,48 ,48 ,48 ,48 ,48 ,48 ,48}; + +extern u16 netbook_get_contrast(void); +extern void netbook_set_contrast(u16 contrast); +extern u16 netbook_get_brightness(void); +extern void netbook_set_brightness(u16 brightness); + +void netbook_cycle_brightness(void) +{ + u16 brightness; + + brightness = netbook_get_brightness(); + if (brightness == 9) + brightness = 1; + else + brightness++; + netbook_set_brightness(brightness); +} + +void netbook_down_contrast(void) +{ + u16 contrast; + contrast = netbook_get_contrast(); + netbook_set_contrast(contrast - 1); +} + +void netbook_up_contrast(void) +{ + u16 contrast; + contrast = netbook_get_contrast(); + netbook_set_contrast(contrast + 1); +} + +static void check_kbd(void) +{ + int col, row, scancode; + unsigned newup, newdown, rows_down; + int need_tasklet_schedule=0; + unsigned char state; + static int fn_down = 0; + + for (col=0; col>= 1; + newup >>= 1; + } + + rows_reported_down[col] = rows_down; + } + + if(need_tasklet_schedule) + tasklet_schedule(&keyboard_tasklet); +} + +static void reset_watchdog(void) +{ + /* + * The watchdog has been enabled from under EPOC. Once enabled + * it can't be disabled, so each keyboard tick we advance the + * watchdog timer as far ahead as possible. + */ + OSMR3 = OSCR - 1; +} + + +static void netbook_scan_kbd(unsigned long dummy) +{ + check_kbd(); + reset_watchdog(); + + init_timer(&scan_timer); + scan_timer.expires = jiffies + SCANHZ; + scan_timer.data = 0; + scan_timer.function = netbook_scan_kbd; + add_timer(&scan_timer); +} + + +void netbook_leds(unsigned char leds) +{ +} +char netbook_unexpected_up(unsigned char keycode) +{ +return 0; +} +int netbook_getkeycode(unsigned int scancode) +{ +return 0; +} +int netbook_setkeycode(unsigned int scancode, unsigned int keycode) +{ +return 0; +} + +int netbook_kbd_translate(unsigned char scancode, unsigned char *keycode, + char raw_mode) +{ + static int prev_scancode; + static int bc_scancode; + + if (scancode == 0xe0 || scancode == 0xe1) { + prev_scancode = scancode; + return 0; + } + + if (scancode == 0x00 || scancode == 0xff) { + prev_scancode = 0; + return 0; + } + + scancode &= 0x7f; + + if (prev_scancode) { + if (prev_scancode != 0xe0) { + if (prev_scancode == 0xe1 && scancode == 0x1d) { + prev_scancode = 0x100; + return 0; + } else if (prev_scancode == 0x100 && scancode == 0x45) { + prev_scancode = 0; + } else { +#ifdef KBD_REPORT_UNKN + if (!raw_mode) + printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); +#endif + prev_scancode = 0; + return 0; + } + } else { + prev_scancode = 0; + if (scancode == 0x2a || scancode == 0x36) + return 0; + else { +#ifdef KBD_REPORT_UNKN + if (!raw_mode) + printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", + scancode); +#endif + return 0; + } + } + } else + *keycode = scancode; + return 1; +} + +void __init netbook_kbd_init_hw(void) +{ + + + k_setkeycode = netbook_setkeycode; + k_getkeycode = netbook_getkeycode; + k_translate = netbook_kbd_translate; + k_unexpected_up = netbook_unexpected_up; + k_leds = netbook_leds; + init_timer(&scan_timer); + scan_timer.expires = jiffies + SCANHZ; + + scan_timer.data = 0; + scan_timer.function = netbook_scan_kbd; + add_timer(&scan_timer); + + printk("Psion Series 7-Netbook keyboard driver initialized\n"); +} + + + diff -ruN linux-2.4.27-vrs1/drivers/char/netbook_keymap.map linux-2.4.27-vrs1-kvd1/drivers/char/netbook_keymap.map --- linux-2.4.27-vrs1/drivers/char/netbook_keymap.map Thu Jan 1 01:00:00 1970 +++ linux-2.4.27-vrs1-kvd1/drivers/char/netbook_keymap.map Thu Dec 30 22:11:57 2004 @@ -0,0 +1,252 @@ +# A keymap for linux on the netBook - as modified by B. Dushaw +# These key definitions work for my malaybook. All keys are defined +# that I know of except the euro key (which failed?) and the screen +# darken/lighted function keys. will even reboot +# the psion - so if you have the OS.img file on your compactflash when +# you do that, I think it will automatically reboot back to EPOC. +# +# The outside button of the netBook (at the edge in the front) also gives +# a keystroke - this keystroke is presently defined as 60; +# The on/off switch as 61 +# +# BDD - Dec. 2003 +# slight modifications by Klaasjan van Druten, Jan. 2004 +###################################################################### +# This uses 7 modifier combinations. +keymaps 0-2,4-5,8,12 +# Change the above line into +# keymaps 0-2,4-6,8,12 +# in case you want the entries +# altgr control keycode 83 = Boot +# altgr control keycode 111 = Boot +# below. +# +# In fact AltGr is used very little, and one more keymap can +# be saved by mapping AltGr to Alt (and adapting a few entries): +# keycode 100 = Alt +# +keycode 1 = Escape Escape + alt keycode 1 = Meta_Escape +keycode 2 = one exclam + alt keycode 2 = Console_1 +keycode 3 = two quotedbl at + control keycode 3 = nul + shift control keycode 3 = nul + alt keycode 3 = Console_2 +keycode 4 = three pound + control keycode 4 = Escape + alt keycode 4 = Console_3 +keycode 5 = four dollar dollar + control keycode 5 = Control_backslash + alt keycode 5 = Meta_four +# altgr keycode 5 = Euro +keycode 6 = five percent + control keycode 6 = Control_bracketright + alt keycode 6 = Meta_five + altgr keycode 6 = grave +keycode 7 = six asciicircum + control keycode 7 = Control_asciicircum + alt keycode 7 = Meta_six + altgr keycode 7 = apostrophe +keycode 8 = seven ampersand braceleft + control keycode 8 = Control_underscore + alt keycode 8 = Meta_seven + altgr keycode 8 = braceleft +keycode 9 = eight asterisk bracketleft + alt keycode 9 = Meta_eight + altgr keycode 9 = braceright +keycode 10 = nine parenleft bracketright + alt keycode 10 = Meta_nine + altgr keycode 10 = bracketleft +keycode 11 = zero parenright braceright + alt keycode 11 = Meta_zero + altgr keycode 11 = bracketright +keycode 12 = minus underscore numbersign + control keycode 12 = Control_underscore + shift control keycode 12 = Control_underscore + altgr keycode 12 = numbersign +keycode 13 = equal plus + alt keycode 13 = Meta_equal +keycode 14 = Delete Delete + control keycode 14 = BackSpace + alt keycode 14 = Meta_Delete + control alt keycode 14 = Boot +keycode 15 = Tab + altgr keycode 15 = Caps_Lock +keycode 16 = q +keycode 17 = w +keycode 18 = e + altgr keycode 18 = Hex_E +keycode 19 = r +keycode 20 = t + control keycode 20 = bar +keycode 21 = y +keycode 22 = u +keycode 23 = i +keycode 24 = o +keycode 25 = p +keycode 26 = bracketleft braceleft + control keycode 26 = Escape + alt keycode 26 = Meta_bracketleft +keycode 27 = bracketright braceright asciitilde + control keycode 27 = Control_bracketright + alt keycode 27 = Meta_bracketright +keycode 28 = Return + alt keycode 28 = Meta_Control_m +keycode 29 = Control +keycode 30 = a + altgr keycode 30 = Hex_A +keycode 31 = s +keycode 32 = d + altgr keycode 32 = Hex_D +keycode 33 = f + altgr keycode 33 = Hex_F +keycode 34 = g +keycode 35 = h +keycode 36 = j +keycode 37 = k +keycode 38 = l +keycode 39 = semicolon colon + alt keycode 39 = Meta_semicolon +keycode 41 = apostrophe at + control keycode 41 = nul + alt keycode 41 = Meta_grave +keycode 42 = Shift +keycode 43 = backslash asciitilde + control keycode 43 = Control_backslash + alt keycode 43 = Meta_backslash +keycode 44 = z +keycode 45 = x +keycode 46 = c + altgr keycode 46 = Hex_C +keycode 47 = v +keycode 48 = b + altgr keycode 48 = Hex_B +keycode 49 = n +keycode 50 = m +keycode 51 = comma less +keycode 52 = period greater + control keycode 52 = Compose + alt keycode 52 = Meta_period +keycode 53 = slash question + control keycode 53 = Delete + alt keycode 53 = Meta_slash +keycode 54 = Shift +#keycode 55 = +#keycode 56 = +keycode 57 = space space + control keycode 57 = nul + alt keycode 57 = Meta_space +keycode 58 = Alt +keycode 59 = AltGr +# keycode 60 is the exterior button on the netBook +keycode 60 = F1 F2 + control keycode 60 = F3 + alt keycode 60 = F4 + altgr keycode 60 = F5 +# keycode 61 is the on/off switch on the netBook +keycode 61 = p +keycode 72 = Up + altgr keycode 72 = Prior +keycode 75 = Left + altgr keycode 75 = Home +keycode 77 = Right + altgr keycode 77 = End +keycode 80 = Down + altgr keycode 80 = Next +string F1 = "\033[[A" +string F2 = "\033[[B" +string F3 = "\033[[C" +string F4 = "\033[[D" +string F5 = "\033[[E" +string F6 = "\033[17~" +string F7 = "\033[18~" +string F8 = "\033[19~" +string F9 = "\033[20~" +string F10 = "\033[21~" +string F11 = "\033[23~" +string F12 = "\033[24~" +string F13 = "\033[25~" +string F14 = "\033[26~" +string F15 = "\033[28~" +string F16 = "\033[29~" +string F17 = "\033[31~" +string F18 = "\033[32~" +string F19 = "\033[33~" +string F20 = "\033[34~" +string Find = "\033[1~" +string Insert = "\033[2~" +string Remove = "\033[3~" +string Select = "\033[4~" +string Prior = "\033[5~" +string Next = "\033[6~" +string Macro = "\033[M" +string Pause = "\033[P" +compose '`' 'A' to 'À' +compose '`' 'a' to 'à' +compose '\'' 'A' to 'Á' +compose '\'' 'a' to 'á' +compose '^' 'A' to 'Â' +compose '^' 'a' to 'â' +compose '~' 'A' to 'Ã' +compose '~' 'a' to 'ã' +compose '"' 'A' to 'Ä' +compose '"' 'a' to 'ä' +compose 'O' 'A' to 'Å' +compose 'o' 'a' to 'å' +compose '0' 'A' to 'Å' +compose '0' 'a' to 'å' +compose 'A' 'A' to 'Å' +compose 'a' 'a' to 'å' +compose 'A' 'E' to 'Æ' +compose 'a' 'e' to 'æ' +compose ',' 'C' to 'Ç' +compose ',' 'c' to 'ç' +compose '`' 'E' to 'È' +compose '`' 'e' to 'è' +compose '\'' 'E' to 'É' +compose '\'' 'e' to 'é' +compose '^' 'E' to 'Ê' +compose '^' 'e' to 'ê' +compose '"' 'E' to 'Ë' +compose '"' 'e' to 'ë' +compose '`' 'I' to 'Ì' +compose '`' 'i' to 'ì' +compose '\'' 'I' to 'Í' +compose '\'' 'i' to 'í' +compose '^' 'I' to 'Î' +compose '^' 'i' to 'î' +compose '"' 'I' to 'Ï' +compose '"' 'i' to 'ï' +compose '-' 'D' to 'Ð' +compose '-' 'd' to 'ð' +compose '~' 'N' to 'Ñ' +compose '~' 'n' to 'ñ' +compose '`' 'O' to 'Ò' +compose '`' 'o' to 'ò' +compose '\'' 'O' to 'Ó' +compose '\'' 'o' to 'ó' +compose '^' 'O' to 'Ô' +compose '^' 'o' to 'ô' +compose '~' 'O' to 'Õ' +compose '~' 'o' to 'õ' +compose '"' 'O' to 'Ö' +compose '"' 'o' to 'ö' +compose '/' 'O' to 'Ø' +compose '/' 'o' to 'ø' +compose '`' 'U' to 'Ù' +compose '`' 'u' to 'ù' +compose '\'' 'U' to 'Ú' +compose '\'' 'u' to 'ú' +compose '^' 'U' to 'Û' +compose '^' 'u' to 'û' +compose '"' 'U' to 'Ü' +compose '"' 'u' to 'ü' +compose '\'' 'Y' to 'Ý' +compose '\'' 'y' to 'ý' +compose 'T' 'H' to 'Þ' +compose 't' 'h' to 'þ' +compose 's' 's' to 'ß' +compose '"' 'y' to 'ÿ' +compose 's' 'z' to 'ß' +compose 'i' 'j' to 'ÿ' diff -ruN linux-2.4.27-vrs1/drivers/ide/ide-probe.c linux-2.4.27-vrs1-kvd1/drivers/ide/ide-probe.c --- linux-2.4.27-vrs1/drivers/ide/ide-probe.c Sat Aug 14 22:08:26 2004 +++ linux-2.4.27-vrs1-kvd1/drivers/ide/ide-probe.c Fri Dec 31 08:20:57 2004 @@ -1088,7 +1088,9 @@ sa |= SA_INTERRUPT; #endif /* CONFIG_IDEPCI_SHARE_IRQ */ } - +#ifdef CONFIG_SA1100_NETBOOK + sa = SA_SHIRQ; +#endif if (hwif->io_ports[IDE_CONTROL_OFFSET]) /* clear nIEN */ hwif->OUTB(0x08, hwif->io_ports[IDE_CONTROL_OFFSET]); diff -ruN linux-2.4.27-vrs1/drivers/ide/legacy/ide-cs.c linux-2.4.27-vrs1-kvd1/drivers/ide/legacy/ide-cs.c --- linux-2.4.27-vrs1/drivers/ide/legacy/ide-cs.c Fri Jun 13 16:51:33 2003 +++ linux-2.4.27-vrs1-kvd1/drivers/ide/legacy/ide-cs.c Fri Dec 31 08:21:13 2004 @@ -69,7 +69,12 @@ /* Parameters that can be set with 'insmod' */ /* Bit map of interrupts to choose from */ +#ifndef CONFIG_SA1100_NETBOOK static u_int irq_mask = 0xdeb8; +#else +/* We'll take pretty much any IRQ the system throws at us. */ +static u_int irq_mask = 0x0fffffff; +#endif static int irq_list[4] = { -1 }; MODULE_PARM(irq_mask, "i"); diff -ruN linux-2.4.27-vrs1/drivers/net/irda/sa1100_ir.c linux-2.4.27-vrs1-kvd1/drivers/net/irda/sa1100_ir.c --- linux-2.4.27-vrs1/drivers/net/irda/sa1100_ir.c Sat Aug 14 22:08:26 2004 +++ linux-2.4.27-vrs1-kvd1/drivers/net/irda/sa1100_ir.c Fri Dec 31 08:27:52 2004 @@ -260,6 +260,23 @@ } /* + * This turns the IRDA power on or off on the Psion Series 7/Netbook + */ +static inline int +sa1100_irda_set_power_netbook(struct sa1100_irda *si, unsigned int state) +{ + if (state) { + GPSR = (NETBOOK_GPIO_IRDA1 | NETBOOK_GPIO_IRDA2); + GPCR = (NETBOOK_GPIO_IRDA3 | NETBOOK_GPIO_IRDA4); + } else { + GPCR = (NETBOOK_GPIO_IRDA1 | NETBOOK_GPIO_IRDA2); + GPSR = (NETBOOK_GPIO_IRDA3 | NETBOOK_GPIO_IRDA4); + } + return 0; +} + + +/* * Control the power state of the IrDA transmitter. * State: * 0 - off @@ -280,6 +297,8 @@ ret = sa1100_irda_set_power_h3600(si, state); if (machine_is_yopy()) ret = sa1100_irda_set_power_yopy(si, state); + if (machine_is_netbook()) + ret = sa1100_irda_set_power_netbook(si, state); return ret; } @@ -1008,7 +1027,7 @@ irda_qos_bits_to_value(&si->qos); si->utcr4 = UTCR4_HPSIR; - if (tx_lpm) + if (tx_lpm || machine_is_netbook()) si->utcr4 |= UTCR4_Z1_6us; /* diff -ruN linux-2.4.27-vrs1/drivers/pcmcia/Makefile linux-2.4.27-vrs1-kvd1/drivers/pcmcia/Makefile --- linux-2.4.27-vrs1/drivers/pcmcia/Makefile Sat Aug 14 22:08:26 2004 +++ linux-2.4.27-vrs1-kvd1/drivers/pcmcia/Makefile Fri Dec 31 08:21:48 2004 @@ -86,6 +86,7 @@ sa1100_cs-objs-$(CONFIG_SA1100_JORNADA720) += sa1100_jornada720.o sa1111_generic.o sa1100_cs-objs-$(CONFIG_SA1100_PANGOLIN) += sa1100_pangolin.o sa1100_cs-objs-$(CONFIG_SA1100_PFS168) += sa1100_pfs168.o sa1111_generic.o +sa1100_cs-objs-$(CONFIG_SA1100_NETBOOK) += sa1100_netbook.o sa1100_cs-objs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o sa1100_cs-objs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o sa1100_cs-objs-$(CONFIG_SA1100_STORK) += sa1100_stork.o diff -ruN linux-2.4.27-vrs1/drivers/pcmcia/cs.c linux-2.4.27-vrs1-kvd1/drivers/pcmcia/cs.c --- linux-2.4.27-vrs1/drivers/pcmcia/cs.c Sat Aug 14 22:08:27 2004 +++ linux-2.4.27-vrs1-kvd1/drivers/pcmcia/cs.c Fri Dec 31 08:21:58 2004 @@ -1914,6 +1914,11 @@ irq = s->cap.pci_irq; } +#ifdef CONFIG_SA1100_NETBOOK + if (!(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) + req->Attributes |= IRQ_TYPE_DYNAMIC_SHARING; +#endif + if (req->Attributes & IRQ_HANDLE_PRESENT) { if (bus_request_irq(s->cap.bus, irq, req->Handler, ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) || diff -ruN linux-2.4.27-vrs1/drivers/pcmcia/sa1100.h linux-2.4.27-vrs1-kvd1/drivers/pcmcia/sa1100.h --- linux-2.4.27-vrs1/drivers/pcmcia/sa1100.h Sat Aug 14 22:08:27 2004 +++ linux-2.4.27-vrs1-kvd1/drivers/pcmcia/sa1100.h Fri Dec 31 10:09:25 2004 @@ -209,5 +209,6 @@ extern struct pcmcia_low_level adsbitsyplus_pcmcia_ops; extern struct pcmcia_low_level stork_pcmcia_ops; extern struct pcmcia_low_level badge4_pcmcia_ops; +extern struct pcmcia_low_level netbook_pcmcia_ops; #endif /* !defined(_PCMCIA_SA1100_H) */ diff -ruN linux-2.4.27-vrs1/drivers/pcmcia/sa1100_generic.c linux-2.4.27-vrs1-kvd1/drivers/pcmcia/sa1100_generic.c --- linux-2.4.27-vrs1/drivers/pcmcia/sa1100_generic.c Sat Aug 14 22:08:27 2004 +++ linux-2.4.27-vrs1-kvd1/drivers/pcmcia/sa1100_generic.c Fri Dec 31 08:22:50 2004 @@ -603,7 +603,6 @@ __FUNCTION__, sock, MECR_FAST_GET(mecr, sock), sock, MECR_BSM_GET(mecr, sock), sock, MECR_BSA_GET(mecr, sock), sock, MECR_BSIO_GET(mecr, sock)); - MECR = mecr; } @@ -870,8 +869,11 @@ sa1100_pcmcia_mecr_bs(sa1100_pcmcia_socket[sock].speed_mem, clock)); } - +#ifndef CONFIG_SA1100_NETBOOK MECR = mecr; +#else + MECR = 0x12662525; +#endif } @@ -1008,7 +1010,10 @@ if(machine_is_stork()) pcmcia_low_level = &stork_pcmcia_ops; #endif - +#ifdef CONFIG_SA1100_NETBOOK + if(machine_is_netbook()) + pcmcia_low_level = &netbook_pcmcia_ops; +#endif if (!pcmcia_low_level) { printk(KERN_ERR "This hardware is not supported by the SA1100 Card Service driver\n"); return -ENODEV; diff -ruN linux-2.4.27-vrs1/drivers/pcmcia/sa1100_netbook.c linux-2.4.27-vrs1-kvd1/drivers/pcmcia/sa1100_netbook.c --- linux-2.4.27-vrs1/drivers/pcmcia/sa1100_netbook.c Thu Jan 1 01:00:00 1970 +++ linux-2.4.27-vrs1-kvd1/drivers/pcmcia/sa1100_netbook.c Sun Dec 26 16:53:53 2004 @@ -0,0 +1,339 @@ +/* + * drivers/pcmcia/sa1100_netbook.c + * + * PCMCIA implementation routines for Psion Series7/Netbook. + * Based on the Assabet implementation. + * + * My apologies to not adhering to CodingStyle (I just can't handle + * full 8 character tabs without weeping uncontrollably). + * Taneli Leppa + */ +#include +#include + +#include +#include + +#include "sa1100_generic.h" + +static char *netbook_pcmcia_devid = NETBOOK_PCMCIA_DEVID; +static u16 netbook_pcmcia_last_status = 0; + +static struct irqs { + int irq; + unsigned int gpio; + const char *str; +} irqs[] = { + { NETBOOK_CF_IRQ, NETBOOK_CF_GPIO, "CF" }, + { NETBOOK_PCMCIA_EVENT_IRQ, NETBOOK_PCMCIA_EVENT_GPIO, "PCMCIA" } +}; + + +/* This is for sleeping during config. + */ +static void netbook_sleep(unsigned int n_cs) +{ + current->state = TASK_INTERRUPTIBLE; + schedule_timeout((n_cs * HZ + 99) / 100); +} + + +static int netbook_pcmcia_init(struct pcmcia_init *init) +{ + int res; + unsigned int i; + printk(KERN_INFO "Psion Netbook/Series7 CF/PCMCIA support version %u\n", + NETBOOK_PCMCIA_SUPPORT_VERSION); + + + /* Register the Netbook PCMCIA interrupt. It's a single pin + that multiplexes all PCMCIA related events. + + We also mark the interrupts as shared. The idea is + to have all same slot PCMCIA related interrupts on a single shared + interrupt. For that, we need a dev_id (for that we just + make up some crap, at least for now). + */ + + for (i = 0; i < ARRAY_SIZE(irqs); i++) + { + set_GPIO_IRQ_edge(irqs[i].gpio, GPIO_RISING_EDGE | GPIO_FALLING_EDGE); + + res = request_irq(irqs[i].irq, init->handler, SA_SHIRQ, + irqs[i].str, (void *)netbook_pcmcia_devid); + if (res) + goto irq_err; + } + + /* Prevent spurious interrupts */ + disable_irq(NETBOOK_CF_IRQ); + + /* This seems to be required for PCMCIA to start working. */ + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_STATUS3_REG) = 0x00ff; + netbook_sleep(10); + + netbook_pcmcia_last_status = NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_STATUS_REG); + + enable_irq(NETBOOK_CF_IRQ); + + /* We have two slots. Slot 1 is the CompactFlash slot. Slot 0 is + the PCMCIA slot. */ + + return 2; + + irq_err: + printk(KERN_ERR "%s: request for IRQ%d failed\n", + __FUNCTION__, irqs[i].irq); + + while (i--) + free_irq(irqs[i].irq, NULL); + + return -1; +} + +/* + * Release all resources. + */ +static int netbook_pcmcia_shutdown(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(irqs); i++) + free_irq(irqs[i].irq, NULL); + + return 0; +} + +static int +netbook_pcmcia_socket_state(struct pcmcia_state_array *state_array) +{ + u16 status = 0; + + if (state_array->size < 2) + return -1; + + /* On GPIO output pin levels: + * Pin 15 is high from boot (clearing: screen goes gray) + * Pin 21 is high from boot (clearing: nothing happens?) + * Pin 23 is high from boot (clearing: nothing happens?) + * + */ + + /* Let's read the status from ASIC14. + */ + + status = NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_STATUS_REG); + + /* Status is: + * 0x0000 when both cards inserted + * 0x0031 when just PCMCIA card inserted + * 0x000c when just CompactFlash inserted + * + * Note: the ready signal is not yet detected. It's seems like + * it's not used too much and there are no adverse effects in + * not detecting it properly. */ + + state_array->state[0].detect = (status == 0x0031 || status == 0x0000); + state_array->state[0].ready = (status == 0x0031 || status == 0x0000); + state_array->state[0].bvd1 = 0; + state_array->state[0].bvd2 = 0; + state_array->state[0].wrprot = 0; /* What's this anyway? */ + state_array->state[0].vs_3v = 0; + state_array->state[0].vs_Xv = 0; + + state_array->state[1].detect = (status == 0x000c || status == 0x0000); + state_array->state[1].ready = (status == 0x000c || status == 0x0000); + state_array->state[1].bvd1 = 0; + state_array->state[1].bvd2 = 0; + state_array->state[1].wrprot = 0; /* What's this anyway? */ + state_array->state[1].vs_3v = 0; + state_array->state[1].vs_Xv = 0; + + return 1; +} + +static int netbook_pcmcia_get_irq_info(struct pcmcia_irq_info *info) +{ + if (info->sock > 1) + return -1; + + if (info->sock == 0) + info->irq = NETBOOK_PCMCIA_IRQ; + + if (info->sock == 1) + info->irq = NETBOOK_CF_IRQ; + + return 0; +} + +static int +netbook_pcmcia_configure_socket(const struct pcmcia_configure *configure) +{ + u16 status; + u16 power = 0; + u16 status2; + u16 status3; + u16 status4; + u16 reset = 0; + u32 o = 0; + + if (configure->sock > 1) + return -1; + + /* XXX: Fix voltage for 3.3 volt PCMCIA cards. I don't have any, + * but I can get my 5 volt network card's leds to glow faintly. + * + * Powering off the PCMCIA slot totally: + * 1. Write 0x0000 to location 8 (decimal) + * 2. Write 0x0b43 to location 18 (decimal) + * + */ + status = NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_STATUS_REG); + + status3 = 0; + switch (configure->vcc) + { + case 0: + case 50: + case 33: + if (configure->sock == 0) + { + /* Prevent spurious interrupts */ + disable_irq(NETBOOK_CF_IRQ); + + /* Required when PCMCIA card wasn't plugged in from the + boot. */ + + if (NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_IRQ_STATUS) != 0x0000) + { + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_IRQ_STATUS) = 0xffff; + netbook_sleep(30); + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_IRQ_STATUS) = 0x0000; + netbook_sleep(20); + } + + + status4 = 0x0b40; + reset = 0x0; + if (status == 0x0031 || status == 0x0000) + { + /* Apply power to PCMCIA slot */ + power |= NETBOOK_ASIC14_POWER_PCMCIA; + status2 = 0x007f; + if (status == 0x0031) + status2 = 0x007c; + status3 |= NETBOOK_ASIC14_STATUS3_PCMCIA; + + /* Issue a reset if both cards are in and + * last status was something else than PCMCIA in. + */ + if (status == 0x0000 && + netbook_pcmcia_last_status != 0x0031) + reset = status3 | 0x4; + } + if (status == 0x000c || status == 0x0000) + { + power |= NETBOOK_ASIC14_POWER_CF; + if (status == 0x000c) + status2 = 0x007c; + + status3 |= NETBOOK_ASIC14_STATUS3_CF; + } + + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_POWER_REG) = power; + netbook_sleep(10); + + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_STATUS4_REG) = status4; + netbook_sleep(10); + + if (reset) + { + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_STATUS3_REG) = reset; + netbook_sleep(10); + } + + NETBOOK_ASIC14_MEM16(NETBOOK_ASIC14_STATUS3_REG) = status3; + netbook_sleep(10); + + /* Re-enable interrupts */ + enable_irq(NETBOOK_CF_IRQ); + } + break; + default: + printk(KERN_ERR "%s(): unrecognized Vcc %u\n", __FUNCTION__, + configure->vcc); + + return -1; + } + + if (configure->reset) + { +/* + printk(KERN_WARNING "%s(): Don't know how to issue a PCMCIA reset yet\n", + __FUNCTION__); +*/ + } + netbook_pcmcia_last_status = status; + + return 0; +} + +/* + * Enable card status IRQs on (re-)initialisation. This can + * be called at initialisation, power management event, or + * pcmcia event. + */ +static int netbook_pcmcia_socket_init(int sock) +{ + int i; + u16 status; + u16 power = 0; + u16 status2; + u16 status3; + + /* FIX: We should read the status from ASIC14 here, and + * start giving power to the CF/PCMCIA slot. + * + * But we don't, yet. Because we probably can't suspend anyway + * now. + */ + +/* + for (i = 0; i < ARRAY_SIZE(irqs); i++) + { + set_GPIO_IRQ_edge(irqs[i].gpio, GPIO_RISING_EDGE | GPIO_FALLING_EDGE); + } +*/ + + return 0; +} + +/* + * Disable card status IRQs on suspend. + */ +static int netbook_pcmcia_socket_suspend(int sock) +{ + int i; + +/* + for (i = 0; i < ARRAY_SIZE(irqs); i++) + set_GPIO_IRQ_edge(irqs[i].gpio, GPIO_NO_EDGES); +*/ + + /* FIX: We should probably power off the PCMCIA bus somehow. + * But I believe suspend is not supported yet. + */ + + return 0; +} + +struct pcmcia_low_level netbook_pcmcia_ops = { + init: netbook_pcmcia_init, + shutdown: netbook_pcmcia_shutdown, + socket_state: netbook_pcmcia_socket_state, + get_irq_info: netbook_pcmcia_get_irq_info, + configure_socket: netbook_pcmcia_configure_socket, + socket_init: netbook_pcmcia_socket_init, + socket_suspend: netbook_pcmcia_socket_suspend, +}; + diff -ruN linux-2.4.27-vrs1/drivers/sound/sa1100ssp.c linux-2.4.27-vrs1-kvd1/drivers/sound/sa1100ssp.c --- linux-2.4.27-vrs1/drivers/sound/sa1100ssp.c Sat Aug 14 22:08:27 2004 +++ linux-2.4.27-vrs1-kvd1/drivers/sound/sa1100ssp.c Fri Dec 31 08:29:27 2004 @@ -69,9 +69,21 @@ /* turn on the SSP */ Ser4SSCR0 = 0; - Ser4SSCR0 = (SSCR0_DataSize(16) | SSCR0_TI | SSCR0_SerClkDiv(2) | - SSCR0_SSE); - Ser4SSCR1 = (SSCR1_SClkIactL | SSCR1_SClk1P | SSCR1_ExtClk); + + if (machine_is_netbook()) + { + /* 12-bit, 9600 hz sound - high-end HiFi, that is. */ + Ser4SSCR0 = (SSCR0_DataSize(12) | SSCR0_National | + SSCR0_SerClkDiv(15) | + SSCR0_SSE); + Ser4SSCR1 = (SSCR1_SClkIactH | SSCR1_SClk1P | SSCR1_IntClk); + + sample_rate = 9600; + } else { + Ser4SSCR0 = (SSCR0_DataSize(16) | SSCR0_TI | SSCR0_SerClkDiv(2) | + SSCR0_SSE); + Ser4SSCR1 = (SSCR1_SClkIactL | SSCR1_SClk1P | SSCR1_ExtClk); + } } static void ssp_audio_shutdown(void) @@ -95,13 +107,20 @@ if (ret) return ret; /* Simple standard DACs are stereo only */ - ret = (val == 0) ? -EINVAL : 1; + if (machine_is_netbook()) + ret = (val != 0) ? -EINVAL : 1; + else + ret = (val == 0) ? -EINVAL : 1; return put_user(ret, (int *) arg); case SNDCTL_DSP_CHANNELS: case SOUND_PCM_READ_CHANNELS: - /* Simple standard DACs are stereo only */ - return put_user(AUDIO_CHANNELS, (long *) arg); + if (machine_is_netbook()) + /* Psion Series7/Netbook audio is mono */ + return put_user(1, (long *) arg); + else + /* Simple standard DACs are stereo only */ + return put_user(AUDIO_CHANNELS, (long *) arg); case SNDCTL_DSP_SPEED: case SOUND_PCM_READ_RATE: @@ -110,8 +129,15 @@ case SNDCTL_DSP_SETFMT: case SNDCTL_DSP_GETFMTS: - /* Simple standard DACs are 16-bit only */ - return put_user(AUDIO_FMT, (long *) arg); + if (machine_is_netbook()) + /* Psion Series7/Netbook audio is 12-bit, however + it's not supported in Linux. Let's pretend we + have 8-bit audio and let the userspace programs + worry about feeding the right mount of bytes. */ + return put_user(AFMT_U8, (long *) arg); + else + /* Simple standard DACs are 16-bit only */ + return put_user(AUDIO_FMT, (long *) arg); default: return -EINVAL; @@ -151,12 +177,16 @@ static int __init sa1100ssp_audio_init(void) { int ret; - - if (!machine_is_lart()) { - printk(KERN_ERR AUDIO_NAME ": no support for this SA-1100 design!\n"); - /* look at ssp_audio_init() for specific initialisations */ - return -ENODEV; - } + + if (machine_is_netbook()) + { + printk(KERN_WARNING AUDIO_NAME ": trying for Netbook/Series7, probably doesn't work\n"); + } else + if (!machine_is_lart()) { + printk(KERN_ERR AUDIO_NAME ": no support for this SA-1100 design!\n"); + /* look at ssp_audio_init() for specific initialisations */ + return -ENODEV; + } /* register devices */ audio_dev_id = register_sound_dsp(&ssp_audio_fops, -1); diff -ruN linux-2.4.27-vrs1/drivers/video/sa1100fb.c linux-2.4.27-vrs1-kvd1/drivers/video/sa1100fb.c --- linux-2.4.27-vrs1/drivers/video/sa1100fb.c Sat Aug 14 22:08:27 2004 +++ linux-2.4.27-vrs1-kvd1/drivers/video/sa1100fb.c Fri Dec 31 08:23:38 2004 @@ -162,6 +162,10 @@ * 2002/02/21: * - Added support for ICP LCD-Kit01 on Frodo. * - Added support for backlight via CPLDs on Frodo. + * + * 2003/12: + * - Add some support from Psion Netbook/Series 7 + * */ #include @@ -629,6 +633,26 @@ }; #endif +#ifdef CONFIG_SA1100_NETBOOK +static struct sa1100fb_mach_info netbook_info __initdata = { + /* these settings are intented to reproduce the values of + * of lccr0-3 as used by EPOC (as revealed by arlo) + */ + pixclock: 242105, bpp: 8, + xres: 640, yres: 480, + + hsync_len: 3, vsync_len: 4, + left_margin: 2, upper_margin: 0, + right_margin: 2, lower_margin: 0, + + sync: FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, + + lccr0: LCCR0_DMADel(128) | LCCR0_Color | LCCR0_Dual | LCCR0_Pas, + lccr3: LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512) | + LCCR3_ACBsCntOff, +}; +#endif + #ifdef CONFIG_SA1100_SIMPUTER static struct sa1100fb_mach_info simputer_info __initdata = { pixclock: 70000, bpp: 4, @@ -813,6 +837,11 @@ inf = &frodo_kit01_info; } #endif +#ifdef CONFIG_SA1100_NETBOOK + if (machine_is_netbook()) { + inf = &netbook_info; + } +#endif #ifdef CONFIG_SA1100_SHANNON if (machine_is_shannon()) { inf = &shannon_info; @@ -1876,7 +1905,7 @@ GPDR |= SHANNON_GPIO_DISP_EN; GPSR |= SHANNON_GPIO_DISP_EN; } - + DPRINTK("DBAR1 = %p\n", DBAR1); DPRINTK("DBAR2 = %p\n", DBAR2); DPRINTK("LCCR0 = 0x%08x\n", LCCR0); diff -ruN linux-2.4.27-vrs1/fs/Config.in linux-2.4.27-vrs1-kvd1/fs/Config.in --- linux-2.4.27-vrs1/fs/Config.in Wed Feb 18 14:36:31 2004 +++ linux-2.4.27-vrs1-kvd1/fs/Config.in Fri Dec 31 09:11:01 2004 @@ -37,6 +37,7 @@ # msdos file systems tristate 'DOS FAT fs support' CONFIG_FAT_FS +dep_mbool ' EPOC fat support' CONFIG_EPOC_FAT_FS $CONFIG_FAT_FS dep_tristate ' MSDOS fs support' CONFIG_MSDOS_FS $CONFIG_FAT_FS dep_tristate ' UMSDOS: Unix-like file system on top of standard MSDOS fs' CONFIG_UMSDOS_FS $CONFIG_MSDOS_FS dep_tristate ' VFAT (Windows-95) fs support' CONFIG_VFAT_FS $CONFIG_FAT_FS diff -ruN linux-2.4.27-vrs1/fs/fat/dir.c linux-2.4.27-vrs1-kvd1/fs/fat/dir.c --- linux-2.4.27-vrs1/fs/fat/dir.c Wed Feb 18 14:36:31 2004 +++ linux-2.4.27-vrs1-kvd1/fs/fat/dir.c Fri Dec 31 11:26:53 2004 @@ -11,6 +11,9 @@ * Merged with msdos fs by Henrik Storner * Rewritten for constant inumbers. Plugged buffer overrun in readdir(). AV * Short name translation 1999, 2001 by Wolfram Pienkoss + * + * EPOC support: Frodo Looijaard (turned into a compile-time option by Klaasjan + * van Druten) */ #include @@ -200,12 +203,21 @@ unsigned short opt_shortname = MSDOS_SB(sb)->options.shortname; int chl, i, j, last_u, res = 0; loff_t i_pos, cpos = 0; +#ifdef CONFIG_EPOC_FAT_FS + int last_entry = 0; +#endif CONFIG_EPOC_FAT_FS while(1) { if (fat_get_entry(inode,&cpos,&bh,&de,&i_pos) == -1) goto EODir; parse_record: long_slots = 0; +#ifdef CONFIG_EPOC_FAT_FS + if (!de->name[0]) + last_entry = 1; + if (last_entry) + continue; +#endif if (de->name[0] == (__s8) DELETED_FLAG) continue; if (de->attr != ATTR_EXT && (de->attr & ATTR_VOLUME)) @@ -265,6 +277,12 @@ if (ds->alias_checksum != alias_checksum) goto parse_long; } +#ifdef CONFIG_EPOC_FAT_FS + if (!de->name[0]) + last_entry = 1; + if (last_entry) + continue; +#endif if (de->name[0] == (__s8) DELETED_FLAG) continue; if (de->attr == ATTR_EXT) @@ -370,6 +388,9 @@ unsigned short opt_shortname = MSDOS_SB(sb)->options.shortname; unsigned long inum; int chi, chl, i, i2, j, last, last_u, dotoffset = 0; +#ifdef CONFIG_EPOC_FAT_FS + int last_entry = 0; +#endif loff_t i_pos, cpos; cpos = filp->f_pos; @@ -395,6 +416,14 @@ long_slots = 0; if (fat_get_entry(inode,&cpos,&bh,&de,&i_pos) == -1) goto EODir; + +#ifdef CONFIG_EPOC_FAT_FS + if (!de->name[0]) + last_entry = 1; + if (last_entry) + goto RecEnd; +#endif + /* Check for long filename entry */ if (isvfat) { if (de->name[0] == (__s8) DELETED_FLAG) @@ -462,6 +491,12 @@ if (ds->alias_checksum != alias_checksum) goto ParseLong; } +#ifdef CONFIG_EPOC_FAT_FS + if (!de->name[0]) + last_entry = 1; + if (last_entry) + goto RecEnd; +#endif if (de->name[0] == (__s8) DELETED_FLAG) goto RecEnd; if (de->attr == ATTR_EXT) @@ -724,11 +759,15 @@ loff_t offset, curr; int row; struct buffer_head *new_bh; +#ifdef CONFIG_EPOC_FAT_FS + int last_entry = 0; +#endif offset = curr = 0; *bh = NULL; row = 0; while (fat_get_entry(dir,&curr,bh,de,i_pos) > -1) { +#ifndef CONFIG_EPOC_FAT_FS if (IS_FREE((*de)->name)) { if (++row == slots) return offset; @@ -736,6 +775,27 @@ row = 0; offset = curr; } +#else + if (!(*de)->name[0]) + last_entry = 1; + if (last_entry || IS_FREE((*de)->name)) { + if (++row == slots) { + /* If we encountered a last_entry, we need to + * mark the entry after the one to be inserted + * as last_entry now! */ + if (last_entry) { + if (fat_get_entry(dir,&curr,bh,de,i_pos) > -1) { + (*de)->name[0] = 0; + mark_inode_dirty(dir); + } + } + return offset; + } + } else { + row = 0; + offset = curr; + } +#endif } if ((dir->i_ino == MSDOS_ROOT_INO) && (MSDOS_SB(sb)->fat_bits != 32)) return -ENOSPC; diff -ruN linux-2.4.27-vrs1/include/asm-arm/arch-sa1100/hardware.h linux-2.4.27-vrs1-kvd1/include/asm-arm/arch-sa1100/hardware.h --- linux-2.4.27-vrs1/include/asm-arm/arch-sa1100/hardware.h Mon Aug 25 13:44:43 2003 +++ linux-2.4.27-vrs1-kvd1/include/asm-arm/arch-sa1100/hardware.h Fri Dec 31 10:08:31 2004 @@ -124,6 +124,8 @@ #include "h3600.h" +#include "netbook.h" + #include "system3.h" #ifdef CONFIG_SA1100_PANGOLIN diff -ruN linux-2.4.27-vrs1/include/asm-arm/arch-sa1100/keyboard.h linux-2.4.27-vrs1-kvd1/include/asm-arm/arch-sa1100/keyboard.h --- linux-2.4.27-vrs1/include/asm-arm/arch-sa1100/keyboard.h Mon Aug 25 13:44:43 2003 +++ linux-2.4.27-vrs1-kvd1/include/asm-arm/arch-sa1100/keyboard.h Fri Dec 31 10:08:58 2004 @@ -16,6 +16,7 @@ extern int sa1111_kbd_init_hw(void); extern void gc_kbd_init_hw(void); extern void smartio_kbd_init_hw(void); +extern void netbook_kbd_init_hw(void); extern void cerf_kbd_init_hw(void); static inline void kbd_init_hw(void) @@ -27,6 +28,8 @@ gc_kbd_init_hw(); if (machine_is_adsbitsy() || machine_is_adsbitsyplus()) smartio_kbd_init_hw(); + if (machine_is_netbook()) + netbook_kbd_init_hw(); #ifdef CONFIG_SA1100_CERF_CPLD if (machine_is_cerf()) cerf_kbd_init_hw(); diff -ruN linux-2.4.27-vrs1/include/asm-arm/arch-sa1100/netbook.h linux-2.4.27-vrs1-kvd1/include/asm-arm/arch-sa1100/netbook.h --- linux-2.4.27-vrs1/include/asm-arm/arch-sa1100/netbook.h Thu Jan 1 01:00:00 1970 +++ linux-2.4.27-vrs1-kvd1/include/asm-arm/arch-sa1100/netbook.h Fri Dec 31 09:40:32 2004 @@ -0,0 +1,202 @@ +/* + * linux/include/asm-arm/arch-sa1100/netbook.h + * + * + * This file contains the hardware specific definitions for + * Psion's Netbook and Series7 devices. For brevity, the defines + * are not NETBOOK_SERIES7_* nor PSION_SERIES7_* + * but NETBOOK_ (unless there is a proven difference among the machines) + * + * History: + * 2004/06/22: created by Taneli Leppa + * 2004/07/02: Klaasjan van Druten: + * add red LED and LCD power definitions, plus some cosmetic changes + * (including rename to netbook_series7.h) + * 2004/07/20: Taneli Leppa: add irDA GPIOs + * 2004/07/30: Matthew Lewis: added external-power/battery/recharge flags + * 2004/09/08: Matthew Lewis: added more ASIC14 definitions, including + * SPI and interrupt related registers + * 2004/12/30: Klaasjan van Druten: renamed to netbook.h + */ + +#ifndef __ASM_ARCH_HARDWARE_H +#error "include instead" +#endif + +/* LEDs: + - Green/Amber LED is hardware controlled (external power/charger) + - Red LED is software controlled + */ +#define NETBOOK_GPIO_LED_RED GPIO_GPIO(14) + +#define NETBOOK_GPIO_LCD GPIO_GPIO(15) + +/* These GPIOs may have something to do with IrDA. + Observed during IrDA activity on EPOC: GPIO 17 & 19 = high, 21 & 23 = low */ +#define NETBOOK_GPIO_IRDA1 GPIO_GPIO(17) +#define NETBOOK_GPIO_IRDA2 GPIO_GPIO(19) +#define NETBOOK_GPIO_IRDA3 GPIO_GPIO(21) +#define NETBOOK_GPIO_IRDA4 GPIO_GPIO(23) + +/* remaining output GPIOs (as deduced with arlo), function unknown */ +#define NETBOOK_GPIO_UNKNOWN_OUTPUT ( GPIO_GPIO(22) |\ + GPIO_GPIO(13) | GPIO_GPIO(12) ) + +/* 1 Mbyte "personality" Flash at 0x00000000. + + Is this 1 Mbyte or 2 Mbytes? Not sure, but lets assume 1 Mbyte. +*/ +#define NETBOOK_FLASH_SIZE 1048576 +#define NETBOOK_FLASH_P 0x00000000 +#define NETBOOK_FLASH_V 0xf2000000 + +/* This is just tracking versions easier, nothing hardware related. */ +#define NETBOOK_PCMCIA_SUPPORT_VERSION 2 + +#define NETBOOK_PCMCIA_DEVID "netbook-pcmcia" + +/* + This is where we get card plug/unplug notifications. + + Maybe this shared like the CompactFlash interrupt. + + Oh, and GPIO 10 is sometimes seems when CF or PCMCIA card is + ejected (properly, using the button next to the slot). + */ +#define NETBOOK_PCMCIA_EVENT_IRQ IRQ_GPIO25 +#define NETBOOK_PCMCIA_EVENT_GPIO GPIO_GPIO(25) + +#define NETBOOK_PCMCIA_GPIO GPIO_GPIO(25) +/* + Currently, we use the timer interrupt as the PCMCIA interrupt. + This is because we don't know yet how to enable PCMCIA interrupts + (I'm pretty sure they are somehow enabled, but how?) +*/ +#define NETBOOK_PCMCIA_IRQ IRQ_OST0 + +#define NETBOOK_CF_IRQ IRQ_GPIO11 +#define NETBOOK_CF_GPIO GPIO_GPIO(11) + +/* Shared interrupt - used by: + - PCMCIA and CF cards + - Pen down + - ADC (touchscreen, battery monitor) +*/ +#define NETBOOK_SHARED_IRQ_GPIO GPIO_GPIO(10) +#define NETBOOK_SHARED_IRQ (IRQ_GPIO10) + + +// ASIC14 is the helper chip for Netbook specific functions. +#define NETBOOK_ASIC14_P 0x10000000 +#define NETBOOK_ASIC14_V 0xf1000000 +#define NETBOOK_ASIC14_LENGTH 0x00001000 + +#define NETBOOK_ASIC14_MEM32(x) *((volatile u32 *)(NETBOOK_ASIC14_V + x)) +#define NETBOOK_ASIC14_MEM16(x) *((volatile u16 *)(NETBOOK_ASIC14_V + x)) +#define NETBOOK_ASIC14_MEM8(x) *((volatile u8 *)(NETBOOK_ASIC14_V + x)) + +#define NETBOOK_ASIC14_CTRL0_REG 0x0 +#define NETBOOK_ASIC14_KBD_PADR_REG 0x4 +#define NETBOOK_ASIC14_CTRL_STATUS_REG 0x6 +#define NETBOOK_ASIC14_POWER_REG 0x8 +#define NETBOOK_ASIC14_STATUS_REG 0xa +#define NETBOOK_ASIC14_STATUS4_REG 0x12 +#define NETBOOK_ASIC14_CONTRAST_REG 0x16 +#define NETBOOK_ASIC14_BRIGHTNESS_REG 0x18 +#define NETBOOK_ASIC14_IRQ_STATUS 0x2a +#define NETBOOK_ASIC14_IRQ_MASK 0x2c +#define NETBOOK_ASIC14_STATUS3_REG 0x2e +#define NETBOOK_ASIC14_KBD_SCAN_REG 0x30 +#define NETBOOK_ASIC14_IRQ_EDGE_REG 0x32 +#define NETBOOK_ASIC14_STATUS6 0x40 +#define NETBOOK_ASIC14_SPI_DATA 0x48 +#define NETBOOK_ASIC14_SPI_FN 0x4c + +/* NETBOOK_ASIC14_IRQ_STATUS and NETBOOK_ASIC14_IRQ_MASK bits */ +#define NETBOOK_ASIC14_IRQ_TIMER0_BIT 0 +#define NETBOOK_ASIC14_IRQ_TIMER0 (1<