Commit 6994774a authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.36pre6

parent f3da3d88
......@@ -7906,15 +7906,62 @@ CONFIG_USB_OHCI_HCD
The module will be called usb-ohci-hcd.o. If you want to compile it
as a module, say M here and read Documentation/modules.txt.
USB mouse support
USB Human Interface Device (HID) support
CONFIG_USB_HID
Say Y here if you want to connect a keyboard, mouse, joystick,
graphic tablet, UPS or any other HID based devices to your computer
via USB.
USB HIDBP Keyboard support
CONFIG_USB_KBD
Say Y here if you don't want to use the generic HID driver for your
USB keyboard and prefer to use the keyboard in its limited Boot
Protocol mode. This driver is much smaller than the HID one.
USB HIDBP Mouse support
CONFIG_USB_MOUSE
Say Y here if you want to connect a USB mouse to your computer's USB
port.
Say Y here if you don't want to use the generic HID driver for your
USB mouse and prefer to use the mouse in its limited Boot Protocol
mode. This driver is much smaller than the HID one.
Keyboard support
CONFIG_INPUT_KEYBDEV
Say Y here if you want your USB HID keyboard to be able to serve as
a system keyboard.
Mouse support
CONFIG_INPUT_MOUSEDEV
Say Y here if you want your USB HID mouse to be accessible as
misc devices 32+ under /dev/, as an emulated PS/2 mouse.
Mix all mice into one device
CONFIG_INPUT_MOUSEDEV_MIX
Say Y here if you want input from all your USB HID mice to be mixed
into one misc device. If you say N, you'll have a separate
device for each your USB mouse.
This code is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called mouse.o. If you want to compile it as a
module, say M here and read Documentation/modules.txt.
Joystick support
CONFIG_INPUT_JOYDEV
Say Y here if you want your USB HID joystick or gamepad to be
accessible as /dev/js device. You can't use a normal joystick
if you select this.
Event interface support
CONFIG_INPUT_EVDEV
Say Y here if you want your USB HID device events be accessible
under /dev/inputX (misc 64+) in a generic way.
This is the future ...
USB HID debug output
CONFIG_USB_HID_DEBUG
Say Y here if you want to see what the HID driver is doing,
perhaps it's doing something wrong with your device.
USB HID lots of debug output
CONFIG_USB_HID_DEBUG_LOTS
Say Y here if you don't fear to read all the HID dumps the
HID driver will generate when you switch this on. Really LOTS
of debug output.
USB scanner support
CONFIG_USB_SCANNER
......@@ -7927,16 +7974,6 @@ CONFIG_USB_SCANNER
The module will be called hp_scanner.o. If you want to compile it as
a module, say M here and read Documentation/modules.txt.
USB keyboard support
CONFIG_USB_KBD
Say Y here if you want to connect a USB keyboard to your computer's
USB port.
This code is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called usb-keyboard.o. If you want to compile it
as a module, say M here and read Documentation/modules.txt.
USB audio parsing support
CONFIG_USB_AUDIO
Say Y here if you want to connect USB audio equipment such as
......@@ -7961,9 +7998,9 @@ CONFIG_USB_ACM
USB serial converter support
CONFIG_USB_SERIAL
Say Y here if you want to connect a Connect Tech WhiteHEAT
multi-port USB to serial converter, or a Belkin, Peracom, or eTek
single port USB to serial converter.
multi-port USB to serial converter; a Belkin, Peracom, or eTek
single port USB to serial converter; or a Handspring Visor.
This code is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called usb-serial.o. If you want to compile it
......@@ -7989,6 +8026,20 @@ CONFIG_USB_CPIA
The module will be called cpia.o. If you want to compile it as a
module, say M here and read Documentation/modules.txt.
USB OV511 Camera support
CONFIG_USB_OV511
Say Y here if you want to connect this type of camera to your
computer's USB port. See drivers/usb/README.ov511 for more
information and for a list of supported cameras.
NOTE: This code is experimental and you will not get video with it
yet.
This code is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called ov511.o. If you want to compile it as a
module, say M here and read Documentation/modules.txt.
USB Kodak DC-2xx Camera support
CONFIG_USB_DC2XX
Say Y here if you want to connect this type of still camera to
......@@ -13497,4 +13548,4 @@ CONFIG_I2C_CHARDEV
# LocalWords: adbmouse DRI DRM dlabs GMX PLCs Applicom fieldbus applicom int
# LocalWords: VWSND eg ESSSOLO CFU CFNR scribed eiconctrl eicon hylafax KFPU
# LocalWords: EXTRAPREC fpu mainboards KHTTPD kHTTPd khttpd Xcelerator
# LocalWords: LOGIBUSMOUSE
# LocalWords: LOGIBUSMOUSE OV511 ov511
......@@ -256,25 +256,31 @@ static void __init pcibios_assign_resources(void)
struct resource *r;
for(dev=pci_devices; dev; dev=dev->next) {
int class = dev->class >> 8;
/* Don't touch classless devices and host bridges */
if (!class || class == PCI_CLASS_BRIDGE_HOST)
continue;
for(idx=0; idx<6; idx++) {
r = &dev->resource[idx];
if (((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && idx < 4) ||
((dev->class >> 8) == PCI_CLASS_DISPLAY_VGA && (r->flags & IORESOURCE_IO)) ||
!dev->class || (dev->class >> 8) == PCI_CLASS_BRIDGE_HOST)
/*
* Don't touch IDE controllers and I/O ports of video cards!
* Also avoid classless devices and host bridges.
*/
/*
* Don't touch IDE controllers and I/O ports of video cards!
*/
if ((class == PCI_CLASS_STORAGE_IDE && idx < 4) ||
(class == PCI_CLASS_DISPLAY_VGA && (r->flags & IORESOURCE_IO)))
continue;
if (!r->start && r->end) {
/*
* We shall assign a new address to this resource, either because
* the BIOS forgot to do so or because we have decided the old
* address was unusable for some reason.
*/
/*
* We shall assign a new address to this resource, either because
* the BIOS forgot to do so or because we have decided the old
* address was unusable for some reason.
*/
if (!r->start && r->end)
pci_assign_resource(dev, idx);
}
}
if (pci_probe & PCI_ASSIGN_ROMS) {
r = &dev->resource[PCI_ROM_RESOURCE];
r->end -= r->start;
......
/* $Id: ioport.c,v 1.27 1999/11/14 06:23:04 zaitcev Exp $
/* $Id: ioport.c,v 1.28 1999/12/27 06:08:28 anton Exp $
* ioport.c: Simple io mapping allocator.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......@@ -20,6 +20,7 @@
#include <asm/vaddrs.h>
#include <asm/oplib.h>
#include <asm/page.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
struct resource *sparc_find_resource_bystart(struct resource *, unsigned long);
......@@ -228,7 +229,7 @@ _sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz)
if (allocate_resource(&sparc_iomap, res,
(offset + sz + PAGE_SIZE-1) & PAGE_MASK,
sparc_iomap.start, sparc_iomap.end, PAGE_SIZE) != 0) {
sparc_iomap.start, sparc_iomap.end, PAGE_SIZE, NULL, NULL) != 0) {
/* Usually we cannot see printks in this case. */
prom_printf("alloc_io_res(%s): cannot occupy\n",
(res->name != NULL)? res->name: "???");
......@@ -320,7 +321,7 @@ void *sbus_alloc_consistant(struct sbus_dev *sdev, long len, u32 *dma_addrp)
}
if (allocate_resource(&sparc_dvma, res, len_total,
sparc_dvma.start, sparc_dvma.end, PAGE_SIZE) != 0) {
sparc_dvma.start, sparc_dvma.end, PAGE_SIZE, NULL, NULL) != 0) {
printk("sbus_alloc_consistant: cannot occupy 0x%lx", len);
free_pages(va, order);
kfree(res);
......@@ -460,10 +461,16 @@ void sbus_unmap_single(struct sbus_dev *sdev, u32 ba, long n)
#endif
}
void sbus_map_sg(struct sbus_dev *sdev, struct scatterlist *sg, int n)
int sbus_map_sg(struct sbus_dev *sdev, struct scatterlist *sg, int n)
{
/* BTFIXUPDEF_CALL(void, mmu_get_scsi_sgl, struct scatterlist *, int, struct sbus_bus *sbus) */
mmu_get_scsi_sgl(sg, n, sdev->bus);
/*
* XXX sparc64 can return a partial length here. sun4c should do this
* but it currently panics if it can't fulfill the request - Anton
*/
return n;
}
void sbus_unmap_sg(struct sbus_dev *sdev, struct scatterlist *sg, int n)
......
/* $Id: irq.c,v 1.98 1999/11/17 07:34:05 zaitcev Exp $
/* $Id: irq.c,v 1.99 1999/12/27 06:08:29 anton Exp $
* arch/sparc/kernel/irq.c: Interrupt request handling routines. On the
* Sparc the IRQ's are basically 'cast in stone'
* and you are supposed to probe the prom's device
......@@ -40,6 +40,7 @@
#include <asm/traps.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
......
/* $Id: process.c,v 1.141 1999/10/24 06:25:02 anton Exp $
/* $Id: process.c,v 1.142 1999/12/27 06:08:31 anton Exp $
* linux/arch/sparc/kernel/process.c
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......@@ -33,6 +33,7 @@
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/page.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/delay.h>
#include <asm/processor.h>
......
/* $Id: semaphore.c,v 1.1 1999/08/31 13:26:15 anton Exp $
* Generic semaphore code. Buyer beware. Do your own
/* $Id: semaphore.c,v 1.2 1999/12/28 11:50:37 jj Exp $
* Generic semaphore code. Buyer beware. Do your own
* specific changes in <asm/semaphore-helper.h>
*/
......@@ -62,8 +62,7 @@ void __up(struct semaphore *sem)
#define DOWN_VAR \
struct task_struct *tsk = current; \
wait_queue_t wait; \
init_waitqueue_entry(&wait, tsk);
DECLARE_WAITQUEUE(wait, tsk);
#define DOWN_HEAD(task_state) \
\
......@@ -127,3 +126,115 @@ int __down_trylock(struct semaphore * sem)
{
return waking_non_zero_trylock(sem);
}
/* rw mutexes
* Implemented by Jakub Jelinek (jakub@redhat.com) based on
* i386 implementation by Ben LaHaise (bcrl@redhat.com).
*/
extern inline int ldstub(unsigned char *p)
{
int ret;
asm volatile("ldstub %1, %0" : "=r" (ret) : "m" (*p) : "memory");
return ret;
}
void down_read_failed_biased(struct rw_semaphore *sem)
{
DOWN_VAR
add_wait_queue(&sem->wait, &wait); /* put ourselves at the head of the list */
for (;;) {
if (!ldstub(&sem->read_not_granted))
break;
set_task_state(tsk, TASK_UNINTERRUPTIBLE);
if (sem->read_not_granted)
schedule();
}
remove_wait_queue(&sem->wait, &wait);
tsk->state = TASK_RUNNING;
}
void down_write_failed_biased(struct rw_semaphore *sem)
{
DOWN_VAR
add_wait_queue_exclusive(&sem->write_bias_wait, &wait); /* put ourselves at the end of the list */
for (;;) {
if (!ldstub(&sem->write_not_granted))
break;
set_task_state(tsk, TASK_UNINTERRUPTIBLE | TASK_EXCLUSIVE);
if (sem->write_not_granted)
schedule();
}
remove_wait_queue(&sem->write_bias_wait, &wait);
tsk->state = TASK_RUNNING;
/* if the lock is currently unbiased, awaken the sleepers
* FIXME: this wakes up the readers early in a bit of a
* stampede -> bad!
*/
if (sem->count >= 0)
wake_up(&sem->wait);
}
/* Wait for the lock to become unbiased. Readers
* are non-exclusive. =)
*/
void down_read_failed(struct rw_semaphore *sem)
{
DOWN_VAR
__up_read(sem); /* this takes care of granting the lock */
add_wait_queue(&sem->wait, &wait);
while (sem->count < 0) {
set_task_state(tsk, TASK_UNINTERRUPTIBLE);
if (sem->count >= 0)
break;
schedule();
}
remove_wait_queue(&sem->wait, &wait);
tsk->state = TASK_RUNNING;
}
/* Wait for the lock to become unbiased. Since we're
* a writer, we'll make ourselves exclusive.
*/
void down_write_failed(struct rw_semaphore *sem)
{
DOWN_VAR
__up_write(sem); /* this takes care of granting the lock */
add_wait_queue_exclusive(&sem->wait, &wait);
while (sem->count < 0) {
set_task_state(tsk, TASK_UNINTERRUPTIBLE | TASK_EXCLUSIVE);
if (sem->count >= 0)
break; /* we must attempt to aquire or bias the lock */
schedule();
}
remove_wait_queue(&sem->wait, &wait);
tsk->state = TASK_RUNNING;
}
void __rwsem_wake(struct rw_semaphore *sem, unsigned long readers)
{
if (readers) {
/* Due to lame ldstub we don't do here
a BUG() consistency check */
sem->read_not_granted = 0;
wake_up(&sem->wait);
} else {
sem->write_not_granted = 0;
wake_up(&sem->write_bias_wait);
}
}
/* $Id: signal.c,v 1.98 1999/12/15 22:24:23 davem Exp $
/* $Id: signal.c,v 1.99 1999/12/27 06:08:32 anton Exp $
* linux/arch/sparc/kernel/signal.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
......@@ -22,6 +22,7 @@
#include <asm/bitops.h>
#include <asm/ptrace.h>
#include <asm/svr4.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
......
......@@ -22,6 +22,7 @@
#include <asm/delay.h>
#include <asm/irq.h>
#include <asm/page.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/oplib.h>
#include <asm/atops.h>
......
/* $Id: sparc-stub.c,v 1.25 1999/07/23 01:56:13 davem Exp $
/* $Id: sparc-stub.c,v 1.26 1999/12/27 06:08:34 anton Exp $
* sparc-stub.c: KGDB support for the Linux kernel.
*
* Modifications to run under Linux
......@@ -107,6 +107,7 @@
#include <asm/traps.h>
#include <asm/vac-ops.h>
#include <asm/kgdb.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
/*
*
......
/* $Id: sun4d_irq.c,v 1.23 1999/10/19 04:33:26 zaitcev Exp $
/* $Id: sun4d_irq.c,v 1.24 1999/12/27 06:08:34 anton Exp $
* arch/sparc/kernel/sun4d_irq.c:
* SS1000/SC2000 interrupt handling.
*
......@@ -32,6 +32,7 @@
#include <asm/traps.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/sbus.h>
#include <asm/sbi.h>
......
......@@ -25,6 +25,7 @@
#include <asm/delay.h>
#include <asm/irq.h>
#include <asm/page.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/oplib.h>
#include <asm/atops.h>
......
......@@ -30,6 +30,7 @@
#include <asm/openprom.h>
#include <asm/oplib.h>
#include <asm/traps.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/smp.h>
#include <asm/irq.h>
......
......@@ -21,6 +21,7 @@
#include <asm/delay.h>
#include <asm/irq.h>
#include <asm/page.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/oplib.h>
#include <asm/atops.h>
......
/* $Id: sys_sunos.c,v 1.106 1999/12/16 11:57:27 anton Exp $
/* $Id: sys_sunos.c,v 1.107 1999/12/27 06:08:37 anton Exp $
* sys_sunos.c: SunOS specific syscall compatibility support.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......@@ -198,7 +198,7 @@ asmlinkage int sunos_brk(unsigned long brk)
freepages = atomic_read(&buffermem_pages) >> PAGE_SHIFT;
freepages += atomic_read(&page_cache_size);
freepages >>= 1;
freepages += nr_free_pages;
freepages += nr_free_pages();
freepages += nr_swap_pages;
freepages -= num_physpages >> 4;
freepages -= (newbrk-oldbrk) >> PAGE_SHIFT;
......
# $Id: Makefile,v 1.30 1999/12/21 04:02:18 davem Exp $
# $Id: Makefile,v 1.31 1999/12/28 11:50:39 jj Exp $
# Makefile for Sparc library files..
#
......@@ -6,7 +6,7 @@ OBJS = mul.o rem.o sdiv.o udiv.o umul.o urem.o ashrdi3.o memcpy.o memset.o \
strlen.o checksum.o blockops.o memscan.o memcmp.o strncmp.o \
strncpy_from_user.o divdi3.o udivdi3.o strlen_user.o \
copy_user.o locks.o atomic.o bitops.o debuglocks.o lshrdi3.o \
ashldi3.o
ashldi3.o rwsem.o
ifdef CONFIG_SMP
OBJS += irqlock.o
......@@ -16,85 +16,11 @@ lib.a: $(OBJS)
$(AR) rcs lib.a $(OBJS)
sync
checksum.o: checksum.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o checksum.o checksum.S
.S.s:
$(CPP) -D__ASSEMBLY__ $(AFLAGS) -ansi -DST_DIV0=0x2 $< -o $*.s
memcpy.o: memcpy.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o memcpy.o memcpy.S
memcmp.o: memcmp.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o memcmp.o memcmp.S
memscan.o: memscan.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o memscan.o memscan.S
strncmp.o: strncmp.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o strncmp.o strncmp.S
strncpy_from_user.o: strncpy_from_user.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o strncpy_from_user.o strncpy_from_user.S
strlen_user.o: strlen_user.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o strlen_user.o strlen_user.S
copy_user.o: copy_user.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o copy_user.o copy_user.S
blockops.o: blockops.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o blockops.o blockops.S
memset.o: memset.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o memset.o memset.S
locks.o: locks.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o locks.o locks.S
atomic.o: atomic.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o atomic.o atomic.S
bitops.o: bitops.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o bitops.o bitops.S
ifdef CONFIG_SMP
irqlock.o: irqlock.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o irqlock.o irqlock.S
endif
strlen.o: strlen.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o strlen.o strlen.S
divdi3.o: divdi3.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o divdi3.o divdi3.S
udivdi3.o: udivdi3.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o udivdi3.o udivdi3.S
mul.o: mul.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o mul.o mul.S
rem.o: rem.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -DST_DIV0=0x2 -c -o rem.o rem.S
sdiv.o: sdiv.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -DST_DIV0=0x2 -c -o sdiv.o sdiv.S
udiv.o: udiv.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -DST_DIV0=0x2 -c -o udiv.o udiv.S
umul.o: umul.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o umul.o umul.S
urem.o: urem.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -DST_DIV0=0x2 -c -o urem.o urem.S
ashrdi3.o: ashrdi3.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o ashrdi3.o ashrdi3.S
ashldi3.o: ashldi3.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o ashldi3.o ashldi3.S
lshrdi3.o: lshrdi3.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o lshrdi3.o lshrdi3.S
.S.o:
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -DST_DIV0=0x2 -c $< -o $*.o
dep:
......
/* $Id: rwsem.S,v 1.1 1999/12/28 11:50:39 jj Exp $
* Assembly part of rw semaphores.
*
* Copyright (C) 1999 Jakub Jelinek (jakub@redhat.com)
*/
#include <linux/config.h>
#include <asm/ptrace.h>
#include <asm/psr.h>
.text
.align 4
.globl ___down_read
___down_read:
rd %psr, %g3
nop
nop
nop
or %g3, PSR_PIL, %g7
wr %g7, 0, %psr
nop
nop
nop
#ifdef __SMP__
1: ldstub [%g1 + 4], %g7
tst %g7
bne 1b
ld [%g1], %g7
subcc %g7, 1, %g7
st %g7, [%g1]
stb %g0, [%g1 + 4]
#else
ld [%g1], %g7
subcc %g7, 1, %g7
st %g7, [%g1]
#endif
wr %g3, 0, %psr
nop
bneg 3f
nop
2: jmpl %o7, %g0
mov %g4, %o7
3: save %sp, -64, %sp
mov %g1, %l1
mov %g4, %l4
bcs 4f
mov %g5, %l5
call down_read_failed
mov %l1, %o0
mov %l1, %g1
mov %l4, %g4
ba ___down_read
restore %l5, %g0, %g5
4: call down_read_failed_biased
mov %l1, %o0
mov %l1, %g1
mov %l4, %g4
ba 2b
restore %l5, %g0, %g5
.globl ___down_write
___down_write:
rd %psr, %g3
nop
nop
nop
or %g3, PSR_PIL, %g7
wr %g7, 0, %psr
sethi %hi(0x01000000), %g2
nop
nop
#ifdef __SMP__
1: ldstub [%g1 + 4], %g7
tst %g7
bne 1b
ld [%g1], %g7
subcc %g7, %g2, %g7
st %g7, [%g1]
stb %g0, [%g1 + 4]
#else
ld [%g1], %g7
subcc %g7, %g2, %g7
st %g7, [%g1]
#endif
wr %g3, 0, %psr
nop
bne 3f
nop
2: jmpl %o7, %g0
mov %g4, %o7
3: save %sp, -64, %sp
mov %g1, %l1
mov %g4, %l4
bcs 4f
mov %g5, %l5
call down_write_failed
mov %l1, %o0
mov %l1, %g1
mov %l4, %g4
ba ___down_write
restore %l5, %g0, %g5
4: call down_write_failed_biased
mov %l1, %o0
mov %l1, %g1
mov %l4, %g4
ba 2b
restore %l5, %g0, %g5
.globl ___up_read
___up_read:
rd %psr, %g3
nop
nop
nop
or %g3, PSR_PIL, %g7
wr %g7, 0, %psr
nop
nop
nop
#ifdef __SMP__
1: ldstub [%g1 + 4], %g7
tst %g7
bne 1b
ld [%g1], %g7
addcc %g7, 1, %g7
st %g7, [%g1]
stb %g0, [%g1 + 4]
#else
ld [%g1], %g7
addcc %g7, 1, %g7
st %g7, [%g1]
#endif
wr %g3, 0, %psr
nop
be 3f
nop
2: jmpl %o7, %g0
mov %g4, %o7
3: save %sp, -64, %sp
mov %g1, %l1
mov %g4, %l4
mov %g5, %l5
clr %o1
call __rwsem_wake
mov %l1, %o0
mov %l1, %g1
mov %l4, %g4
ba 2b
restore %l5, %g0, %g5
.globl ___up_write
___up_write:
rd %psr, %g3
nop
nop
nop
or %g3, PSR_PIL, %g7
wr %g7, 0, %psr
sethi %hi(0x01000000), %g2
nop
nop
#ifdef __SMP__
1: ldstub [%g1 + 4], %g7
tst %g7
bne 1b
ld [%g1], %g7
addcc %g7, %g2, %g7
st %g7, [%g1]
stb %g0, [%g1 + 4]
#else
ld [%g1], %g7
addcc %g7, %g2, %g7
st %g7, [%g1]
#endif
wr %g3, 0, %psr
nop
bcs 3f
nop
2: jmpl %o7, %g0
mov %g4, %o7
3: save %sp, -64, %sp
mov %g1, %l1
mov %g4, %l4
mov %g5, %l5
mov %g7, %o1
call __rwsem_wake
mov %l1, %o0
mov %l1, %g1
mov %l4, %g4
ba 2b
restore %l5, %g0, %g5
/* $Id: asyncd.c,v 1.17 1999/08/14 03:51:44 anton Exp $
/* $Id: asyncd.c,v 1.18 1999/12/27 06:30:02 anton Exp $
* The asyncd kernel daemon. This handles paging on behalf of
* processes that receive page faults due to remote (async) memory
* accesses.
......@@ -25,6 +25,7 @@
#include <asm/system.h> /* for cli()/sti() */
#include <asm/segment.h> /* for memcpy_to/fromfs */
#include <asm/bitops.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#define DEBUG 0
......
/* $Id: btfixup.c,v 1.8 1999/08/31 06:54:31 davem Exp $
/* $Id: btfixup.c,v 1.9 1999/12/27 06:30:02 anton Exp $
* btfixup.c: Boot time code fixup and relocator, so that
* we can get rid of most indirect calls to achieve single
* image sun4c and srmmu kernel.
......@@ -11,6 +11,7 @@
#include <linux/init.h>
#include <asm/btfixup.h>
#include <asm/page.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/oplib.h>
#include <asm/system.h>
......
/* $Id: generic.c,v 1.8 1999/12/20 05:01:49 davem Exp $
/* $Id: generic.c,v 1.9 1999/12/27 06:30:03 anton Exp $
* generic.c: Generic Sparc mm routines that are not dependent upon
* MMU type but are Sparc specific.
*
......@@ -9,6 +9,7 @@
#include <linux/mm.h>
#include <linux/swap.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/page.h>
......@@ -27,7 +28,7 @@ static inline void forget_pte(pte_t page)
free_page_and_swap_cache(mem_map+nr);
return;
}
swap_free(page);
swap_free(pte_to_swp_entry(page));
}
/* Remap IO memory, the same way as remap_page_range(), but use
......
/* $Id: init.c,v 1.71 1999/12/16 12:58:33 anton Exp $
/* $Id: init.c,v 1.72 1999/12/27 06:30:06 anton Exp $
* linux/arch/sparc/mm/init.c
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......@@ -82,7 +82,7 @@ void show_mem(void)
printk("Free swap: %6dkB\n",
nr_swap_pages << (PAGE_SHIFT-10));
printk("%ld pages of RAM\n", totalram_pages);
printk("%d free pages\n", nr_free_pages);
printk("%d free pages\n", nr_free_pages());
printk("%ld pages in page table cache\n",pgtable_cache_size);
#ifndef __SMP__
if (sparc_cpu_model == sun4m || sparc_cpu_model == sun4d)
......@@ -395,15 +395,17 @@ void __init mem_init(void)
taint_real_pages();
max_mapnr = last_valid_pfn;
high_memory = __va(last_valid_pfn << PAGE_SHIFT);
#ifdef DEBUG_BOOTMEM
prom_printf("mem_init: Calling free_all_bootmem().\n");
#endif
num_physpages = totalram_pages = free_all_bootmem();
#if 0
free_unused_mem_map();
max_mapnr = last_valid_pfn;
high_memory = __va(last_valid_pfn << PAGE_SHIFT);
#endif
codepages = (((unsigned long) &etext) - ((unsigned long)&_start));
codepages = PAGE_ALIGN(codepages) >> PAGE_SHIFT;
......@@ -413,7 +415,7 @@ void __init mem_init(void)
initpages = PAGE_ALIGN(initpages) >> PAGE_SHIFT;
printk("Memory: %dk available (%dk kernel code, %dk data, %dk init) [%08lx,%08lx]\n",
nr_free_pages << (PAGE_SHIFT-10),
nr_free_pages() << (PAGE_SHIFT-10),
codepages << (PAGE_SHIFT-10),
datapages << (PAGE_SHIFT-10),
initpages << (PAGE_SHIFT-10),
......@@ -423,7 +425,7 @@ void __init mem_init(void)
* Please keep track of things and make sure this
* always matches the code in mm/page_alloc.c -DaveM
*/
i = nr_free_pages >> 7;
i = nr_free_pages() >> 7;
if (i < 48)
i = 48;
if (i > 256)
......@@ -439,9 +441,17 @@ void free_initmem (void)
addr = (unsigned long)(&__init_begin);
for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
ClearPageReserved(mem_map + MAP_NR(addr));
set_page_count(mem_map + MAP_NR(addr), 1);
free_page(addr);
unsigned long page;
struct page *p;
page = (addr +
((unsigned long) __va(phys_base)) -
PAGE_OFFSET);
p = mem_map + MAP_NR(page);
ClearPageReserved(p);
set_page_count(p, 1);
__free_page(p);
totalram_pages++;
num_physpages++;
}
......@@ -451,11 +461,11 @@ void si_meminfo(struct sysinfo *val)
{
val->totalram = totalram_pages;
val->sharedram = 0;
val->freeram = nr_free_pages;
val->freeram = nr_free_pages();
val->bufferram = atomic_read(&buffermem_pages);
val->totalhigh = 0;
val->freehigh = nr_free_highpages;
val->freehigh = 0;
val->mem_unit = PAGE_SIZE;
}
/* $Id: io-unit.c,v 1.17 1999/10/18 01:46:54 zaitcev Exp $
/* $Id: io-unit.c,v 1.18 1999/12/28 04:28:55 anton Exp $
* io-unit.c: IO-UNIT specific routines for memory management.
*
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
......@@ -10,6 +10,7 @@
#include <linux/malloc.h>
#include <linux/spinlock.h>
#include <asm/scatterlist.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/sbus.h>
#include <asm/io.h>
......
/* $Id: iommu.c,v 1.15 1999/11/19 04:11:53 davem Exp $
/* $Id: iommu.c,v 1.16 1999/12/28 04:28:54 anton Exp $
* iommu.c: IOMMU specific routines for memory management.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......@@ -13,6 +13,7 @@
#include <linux/mm.h>
#include <linux/malloc.h>
#include <asm/scatterlist.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/sbus.h>
#include <asm/io.h>
......
/* $Id: sun4c.c,v 1.181 1999/12/16 14:34:21 anton Exp $
/* $Id: sun4c.c,v 1.182 1999/12/27 06:30:04 anton Exp $
* sun4c.c: Doing in software what should be done in hardware.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
......@@ -18,6 +18,7 @@
#include <asm/scatterlist.h>
#include <asm/page.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/vaddrs.h>
#include <asm/idprom.h>
......@@ -1967,10 +1968,6 @@ static void sun4c_switch_mm_hw(struct mm_struct *old_mm, struct mm_struct *mm, s
} else {
/* Update the LRU ring of contexts. */
ctx = ctx_list_pool + mm->context;
#ifdef DEBUG_SUN4C_MM
if (!ctx->ctx_mm)
panic("context was not set up");
#endif
remove_from_ctx_list(ctx);
add_to_used_ctxlist(ctx);
}
......@@ -2027,10 +2024,6 @@ static void sun4c_switch_mm_sw(struct mm_struct *old_mm, struct mm_struct *mm, s
} else {
/* Update the LRU ring of contexts. */
ctx = ctx_list_pool + mm->context;
#ifdef DEBUG_SUN4C_MM
if (!ctx->ctx_mm)
panic("context was not set up");
#endif
remove_from_ctx_list(ctx);
add_to_used_ctxlist(ctx);
}
......@@ -2464,7 +2457,7 @@ static void sun4c_vac_alias_fixup(struct vm_area_struct *vma, unsigned long addr
pgdp = sun4c_pgd_offset(vma->vm_mm, address);
ptep = sun4c_pte_offset((pmd_t *) pgdp, address);
*ptep = __pte(pte_val(*ptep) | _SUN4C_PAGE_NOCACHE);
pte = pte_val(*ptep);
pte = *ptep;
}
}
}
......@@ -2586,7 +2579,14 @@ void __init sun4c_paging_init(void)
swapper_pg_dir[vaddr>>SUN4C_PGDIR_SHIFT] = __pgd(PGD_TABLE | (unsigned long) pg3);
sun4c_init_ss2_cache_bug();
sparc_context_init(num_contexts);
free_area_init(end_pfn);
{
unsigned int zones_size[MAX_NR_ZONES] = { 0, 0, 0};
zones_size[ZONE_DMA] = end_pfn;
free_area_init(zones_size);
}
cnt = 0;
for (i = 0; i < num_segmaps; i++)
if (mmu_entry_pool[i].locked)
......
......@@ -302,6 +302,7 @@ CONFIG_MSDOS_FS=m
# CONFIG_UMSDOS_FS is not set
CONFIG_VFAT_FS=m
CONFIG_EFS_FS=m
CONFIG_CRAMFS=m
CONFIG_ISO9660_FS=m
# CONFIG_JOLIET is not set
CONFIG_MINIX_FS=m
......
/* $Id: pci.c,v 1.11 1999/12/20 05:02:07 davem Exp $
/* $Id: pci.c,v 1.12 2000/01/01 03:32:50 davem Exp $
* pci.c: UltraSparc PCI controller support.
*
* Copyright (C) 1997, 1998, 1999 David S. Miller (davem@redhat.com)
......@@ -229,6 +229,11 @@ void pcibios_align_resource(void *data, struct resource *res, unsigned long size
{
}
int pci_assign_resource(struct pci_dev *dev, int i)
{
return -ENOSYS; /* :-)... actually implement this soon */
}
char * __init pcibios_setup(char *str)
{
if (!strcmp(str, "onboardfirst")) {
......
/* $Id: semaphore.c,v 1.1 1999/08/30 10:00:50 davem Exp $
/* $Id: semaphore.c,v 1.2 1999/12/23 17:12:03 jj Exp $
* Generic semaphore code. Buyer beware. Do your own
* specific changes in <asm/semaphore-helper.h>
*/
......@@ -62,8 +62,7 @@ void __up(struct semaphore *sem)
#define DOWN_VAR \
struct task_struct *tsk = current; \
wait_queue_t wait; \
init_waitqueue_entry(&wait, tsk);
DECLARE_WAITQUEUE(wait, tsk);
#define DOWN_HEAD(task_state) \
\
......@@ -127,3 +126,172 @@ int __down_trylock(struct semaphore * sem)
{
return waking_non_zero_trylock(sem);
}
/* rw mutexes
* Implemented by Jakub Jelinek (jakub@redhat.com) based on
* i386 implementation by Ben LaHaise (bcrl@redhat.com).
*/
asm("
.text
.align 32
.globl __down_read_failed
__down_read_failed:
save %sp, -160, %sp
membar #StoreStore
brz,pt %g5, 3f
mov %g7, %l0
1: call down_read_failed
mov %l0, %o0
2: lduw [%l0], %l1
sub %l1, 1, %l2
cas [%l0], %l1, %l2
cmp %l1, %l2
bne,pn %icc, 2b
membar #StoreStore
subcc %l1, 1, %g0
bpos,pt %icc, 4f
nop
bcc,pn %icc, 1b
nop
3: call down_read_failed_biased
mov %l0, %o0
4: ret
restore
.previous
");
asm("
.text
.align 32
.globl __down_write_failed
__down_write_failed:
save %sp, -160, %sp
membar #StoreStore
tst %g5
bge,pt %icc, 3f
mov %g7, %l0
1: call down_write_failed
mov %l0, %o0
2: lduw [%l0], %l1
sethi %hi (" RW_LOCK_BIAS_STR "), %l3
sub %l1, %l3, %l2
cas [%l0], %l1, %l2
cmp %l1, %l2
bne,pn %icc, 2b
membar #StoreStore
subcc %l1, %l3, %g0
be,pt %icc, 4f
nop
bcc,pn %icc, 1b
nop
3: call down_write_failed_biased
mov %l0, %o0
4: ret
restore
.previous
");
void down_read_failed_biased(struct rw_semaphore *sem)
{
DOWN_VAR
add_wait_queue(&sem->wait, &wait); /* put ourselves at the head of the list */
for (;;) {
if (clear_le_bit(0, &sem->granted))
break;
set_task_state(tsk, TASK_UNINTERRUPTIBLE);
if (!test_le_bit(0, &sem->granted))
schedule();
}
remove_wait_queue(&sem->wait, &wait);
tsk->state = TASK_RUNNING;
}
void down_write_failed_biased(struct rw_semaphore *sem)
{
DOWN_VAR
add_wait_queue_exclusive(&sem->write_bias_wait, &wait); /* put ourselves at the end of the list */
for (;;) {
if (clear_le_bit(1, &sem->granted))
break;
set_task_state(tsk, TASK_UNINTERRUPTIBLE | TASK_EXCLUSIVE);
if (!test_le_bit(1, &sem->granted))
schedule();
}
remove_wait_queue(&sem->write_bias_wait, &wait);
tsk->state = TASK_RUNNING;
/* if the lock is currently unbiased, awaken the sleepers
* FIXME: this wakes up the readers early in a bit of a
* stampede -> bad!
*/
if (sem->count >= 0)
wake_up(&sem->wait);
}
/* Wait for the lock to become unbiased. Readers
* are non-exclusive. =)
*/
void down_read_failed(struct rw_semaphore *sem)
{
DOWN_VAR
__up_read(sem); /* this takes care of granting the lock */
add_wait_queue(&sem->wait, &wait);
while (sem->count < 0) {
set_task_state(tsk, TASK_UNINTERRUPTIBLE);
if (sem->count >= 0)
break;
schedule();
}
remove_wait_queue(&sem->wait, &wait);
tsk->state = TASK_RUNNING;
}
/* Wait for the lock to become unbiased. Since we're
* a writer, we'll make ourselves exclusive.
*/
void down_write_failed(struct rw_semaphore *sem)
{
DOWN_VAR
__up_write(sem); /* this takes care of granting the lock */
add_wait_queue_exclusive(&sem->wait, &wait);
while (sem->count < 0) {
set_task_state(tsk, TASK_UNINTERRUPTIBLE | TASK_EXCLUSIVE);
if (sem->count >= 0)
break; /* we must attempt to aquire or bias the lock */
schedule();
}
remove_wait_queue(&sem->wait, &wait);
tsk->state = TASK_RUNNING;
}
void __rwsem_wake(struct rw_semaphore *sem, unsigned long readers)
{
if (readers) {
if (set_le_bit(0, &sem->granted))
BUG();
wake_up(&sem->wait);
} else {
if (set_le_bit(1, &sem->granted))
BUG();
wake_up(&sem->write_bias_wait);
}
}
/* $Id: VISmemset.S,v 1.9 1999/05/25 16:53:01 jj Exp $
/* $Id: VISmemset.S,v 1.10 1999/12/23 17:02:16 jj Exp $
* VISmemset.S: High speed memset operations utilizing the UltraSparc
* Visual Instruction Set.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
* Copyright (C) 1996, 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
* Copyright (C) 1996, 1997, 1999 Jakub Jelinek (jakub@redhat.com)
*/
#include "VIS.h"
......@@ -32,12 +32,7 @@
#endif
#ifdef __KERNEL__
#include <asm/visasm.h>
#define RETL clr %o0
#else
#define RETL mov %g3, %o0
#endif
/* Well, memset is a lot easier to get right than bcopy... */
......@@ -55,8 +50,8 @@ memset:
#ifndef REGS_64BIT
srl %o2, 0, %o2
#endif
mov %o0, %g3
#endif
mov %o0, %o4
cmp %o2, 7
bleu,pn %xcc, 17f
andcc %o0, 3, %g5
......@@ -188,19 +183,19 @@ memset:
andcc %o2, 7, %o2
#ifdef __KERNEL__
14: srl %g5, 1, %o3
sethi %hi(13f), %o4
sub %o4, %o3, %o4
jmpl %o4 + %lo(13f), %g0
sethi %hi(13f), %g3
sub %g3, %o3, %g3
jmpl %g3 + %lo(13f), %g0
add %o0, %g5, %o0
#else
14: rd %pc, %o4
14: rd %pc, %g3
#ifdef REGS_64BIT
srl %g5, 1, %o3
sub %o4, %o3, %o4
sub %g3, %o3, %g3
#else
sub %o4, %g5, %o4
sub %g3, %g5, %g3
#endif
jmpl %o4 + (13f - 14b), %g0
jmpl %g3 + (13f - 14b), %g0
add %o0, %g5, %o0
#endif
12: SET_BLOCKS(%o0, 0x68, %o1)
......@@ -220,14 +215,14 @@ memset:
1: bne,a,pn %xcc, 8f
stb %o1, [%o0]
8: retl
RETL
mov %o4, %o0
17: brz,pn %o2, 0f
8: add %o0, 1, %o0
subcc %o2, 1, %o2
bne,pt %xcc, 8b
stb %o1, [%o0 - 1]
0: retl
RETL
mov %o4, %o0
6:
#ifdef REGS_64BIT
stx %o1, [%o0]
......
......@@ -123,7 +123,6 @@ pci_class_name(u32 class)
void __init pci_name_device(struct pci_dev *dev)
{
sprintf(dev->name, "PCI device %04x:%04x", dev->vendor, dev->device);
}
char *
......
......@@ -269,7 +269,7 @@ static inline unsigned int pci_resource_flags(unsigned int flags)
return IORESOURCE_MEM;
}
static void __init pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
{
unsigned int pos, reg, next;
u32 l, sz, tmp;
......@@ -447,6 +447,7 @@ static struct pci_bus * __init pci_add_new_bus(struct pci_bus *parent, struct pc
*/
static int __init pci_scan_cardbus(struct pci_bus *bus, struct pci_dev *dev, int busnr)
{
int i;
unsigned short cr;
unsigned int buses;
struct pci_bus *child;
......@@ -455,7 +456,14 @@ static int __init pci_scan_cardbus(struct pci_bus *bus, struct pci_dev *dev, int
* Insert it into the tree of buses.
*/
child = pci_add_new_bus(bus, dev, ++busnr);
child->subordinate = busnr;
for (i = 0; i < 4; i++)
child->resource[i] = &dev->resource[PCI_BRIDGE_RESOURCES+i];
/*
* Maybe we'll have another bus behind this one?
*/
child->subordinate = ++busnr;
sprintf(child->name, "PCI CardBus #%02x", child->number);
/*
......@@ -566,7 +574,7 @@ static int __init pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int
* Read interrupt line and base address registers.
* The architecture-dependent code can tweak these, of course.
*/
static void __init pci_read_irq(struct pci_dev *dev)
static void pci_read_irq(struct pci_dev *dev)
{
unsigned char irq;
......@@ -577,31 +585,15 @@ static void __init pci_read_irq(struct pci_dev *dev)
}
/*
* Read the config data for a PCI device, sanity-check it
* and fill in the dev structure...
* Fill in class and map information of a device
*/
static struct pci_dev * __init pci_scan_device(struct pci_dev *temp)
int pci_setup_device(struct pci_dev * dev)
{
struct pci_dev *dev;
u32 l, class;
if (pci_read_config_dword(temp, PCI_VENDOR_ID, &l))
return NULL;
/* some broken boards return 0 or ~0 if a slot is empty: */
if (l == 0xffffffff || l == 0x00000000 || l == 0x0000ffff || l == 0xffff0000)
return NULL;
dev = kmalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
return NULL;
u32 class;
memcpy(dev, temp, sizeof(*dev));
dev->vendor = l & 0xffff;
dev->device = (l >> 16) & 0xffff;
sprintf(dev->slot_name, "%02x:%02x.%d", dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
pci_name_device(dev);
sprintf(dev->name, "PCI device %04x:%04x", dev->vendor, dev->device);
pci_read_config_dword(dev, PCI_CLASS_REVISION, &class);
class >>= 8; /* upper 3 bytes */
dev->class = class;
......@@ -635,8 +627,7 @@ static struct pci_dev * __init pci_scan_device(struct pci_dev *temp)
default: /* unknown header */
printk(KERN_ERR "PCI: device %s has unknown header type %02x, ignoring.\n",
dev->slot_name, dev->hdr_type);
kfree(dev);
return NULL;
return -1;
bad:
printk(KERN_ERR "PCI: %s: class %x doesn't match header type %02x. Ignoring class.\n",
......@@ -645,6 +636,36 @@ static struct pci_dev * __init pci_scan_device(struct pci_dev *temp)
}
/* We found a fine healthy device, go go go... */
return 0;
}
/*
* Read the config data for a PCI device, sanity-check it
* and fill in the dev structure...
*/
static struct pci_dev * __init pci_scan_device(struct pci_dev *temp)
{
struct pci_dev *dev;
u32 l;
if (pci_read_config_dword(temp, PCI_VENDOR_ID, &l))
return NULL;
/* some broken boards return 0 or ~0 if a slot is empty: */
if (l == 0xffffffff || l == 0x00000000 || l == 0x0000ffff || l == 0xffff0000)
return NULL;
dev = kmalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
return NULL;
memcpy(dev, temp, sizeof(*dev));
dev->vendor = l & 0xffff;
dev->device = (l >> 16) & 0xffff;
if (pci_setup_device(dev) < 0) {
kfree(dev);
dev = NULL;
}
return dev;
}
......@@ -667,6 +688,7 @@ struct pci_dev * __init pci_scan_slot(struct pci_dev *temp)
dev = pci_scan_device(temp);
if (!dev)
continue;
pci_name_device(dev);
if (!func) {
is_multi = hdr_type & 0x80;
first_dev = dev;
......
......@@ -8,7 +8,6 @@ tristate 'PCMCIA/CardBus support' CONFIG_PCMCIA
if [ "$CONFIG_PCMCIA" != "n" ]; then
if [ "$CONFIG_PCI" != "n" ]; then
bool ' CardBus support' CONFIG_CARDBUS
dep_tristate ' Yenta Cardbus support' CONFIG_YENTA $CONFIG_CARDBUS
fi
bool ' i82365 compatible bridge support' CONFIG_I82365
bool ' Databook TCIC host bridge support' CONFIG_TCIC
......
......@@ -18,19 +18,16 @@ ifeq ($(CONFIG_PCMCIA),y)
O_OBJS := cistpl.o rsrc_mgr.o bulkmem.o
OX_OBJS := ds.o cs.o
O_TARGET := pcmcia.o
ifeq ($(CONFIG_CARDBUS),y)
O_OBJS += cardbus.o
OX_OBJS += cb_enabler.o yenta.o pci_socket.o
endif
ifeq ($(CONFIG_I82365),y)
O_OBJS += i82365.o
endif
ifeq ($(CONFIG_TCIC),y)
O_OBJS += tcic.o
endif
ifeq ($(CONFIG_YENTA),y)
OX_OBJS += yenta.o pci_socket.o
endif
ifeq ($(CONFIG_CARDBUS),y)
O_OBJS += cardbus.o
OX_OBJS += cb_enabler.o
endif
else
ifeq ($(CONFIG_PCMCIA),m)
M_OBJS := pcmcia_core.o
......@@ -45,7 +42,7 @@ else
endif
ifeq ($(CONFIG_CARDBUS),y)
CORE_OBJS += cardbus.o
MX_OBJS += cb_enabler.o
MX_OBJS += cb_enabler.o yenta.o pci_socket.o
endif
endif
endif
......
This diff is collapsed.
......@@ -59,6 +59,7 @@
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/bus_ops.h>
#include "cs_internal.h"
#include "rsrc_mgr.h"
......
......@@ -136,8 +136,7 @@ typedef struct socket_info_t {
u_char *cis_virt;
config_t *config;
#ifdef CONFIG_CARDBUS
u_int cb_cis_space;
cb_bridge_map cb_cis_map;
struct resource * cb_cis_res;
u_char *cb_cis_virt;
struct cb_config_t *cb_config;
#endif
......@@ -206,8 +205,7 @@ void cb_enable(socket_info_t *s);
void cb_disable(socket_info_t *s);
void read_cb_mem(socket_info_t *s, u_char fn, int space,
u_int addr, u_int len, void *ptr);
int cb_setup_cis_mem(socket_info_t *s, int space);
void cb_release_cis_mem(socket_info_t *s);
void cb_release_cis_mem(socket_info_t * s);
/* In cistpl.c */
void read_cis_mem(socket_info_t *s, int attr,
......
This diff is collapsed.
......@@ -28,13 +28,6 @@
#include "pci_socket.h"
static struct pci_simple_probe_entry controller_list[] = {
{ PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1225, 0, 0, &yenta_operations },
{ 0x1180, 0x0475, 0, 0, &ricoh_operations },
{ 0, 0, 0, 0, NULL }
};
/*
* Arbitrary define. This is the array of active cardbus
* entries.
......@@ -146,24 +139,6 @@ static int pci_set_mem_map(unsigned int sock, struct pccard_mem_map *mem)
return -EINVAL;
}
static int pci_get_bridge(unsigned int sock, struct cb_bridge_map *m)
{
pci_socket_t *socket = pci_socket_array + sock;
if (socket->op && socket->op->get_bridge)
return socket->op->get_bridge(socket, m);
return -EINVAL;
}
static int pci_set_bridge(unsigned int sock, struct cb_bridge_map *m)
{
pci_socket_t *socket = pci_socket_array + sock;
if (socket->op && socket->op->set_bridge)
return socket->op->set_bridge(socket, m);
return -EINVAL;
}
static void pci_proc_setup(unsigned int sock, struct proc_dir_entry *base)
{
pci_socket_t *socket = pci_socket_array + sock;
......@@ -184,29 +159,32 @@ static struct pccard_operations pci_socket_operations = {
pci_set_io_map,
pci_get_mem_map,
pci_set_mem_map,
pci_get_bridge,
pci_set_bridge,
pci_proc_setup
};
static int __init pci_socket_probe(struct pci_dev *dev, int nr, const struct pci_simple_probe_entry * entry, void *data)
static int __init add_pci_socket(int nr, struct pci_dev *dev, struct pci_socket_ops *ops)
{
pci_socket_t *socket = nr + pci_socket_array;
printk("Found controller %d: %s\n", nr, dev->name);
socket->dev = dev;
socket->op = entry->dev_data;
socket->op->open(socket);
return 0;
socket->op = ops;
return socket->op->open(socket);
}
static int __init pci_socket_init(void)
{
int sockets = pci_simple_probe(controller_list, MAX_SOCKETS, pci_socket_probe, NULL);
struct pci_dev *dev = NULL;
int nr = 0;
while ((dev = pci_find_class(PCI_CLASS_BRIDGE_CARDBUS << 8, dev)) != NULL) {
printk("Adding cardbus controller %d: %s\n", nr, dev->name);
add_pci_socket(nr, dev, &yenta_operations);
nr++;
}
if (sockets <= 0)
if (nr <= 0)
return -1;
register_ss_entry(sockets, &pci_socket_operations);
register_ss_entry(nr, &pci_socket_operations);
return 0;
}
......
......@@ -30,8 +30,6 @@ struct pci_socket_ops {
int (*set_io_map)(struct pci_socket *, struct pccard_io_map *);
int (*get_mem_map)(struct pci_socket *, struct pccard_mem_map *);
int (*set_mem_map)(struct pci_socket *, struct pccard_mem_map *);
int (*get_bridge)(struct pci_socket *, struct cb_bridge_map *);
int (*set_bridge)(struct pci_socket *, struct cb_bridge_map *);
void (*proc_setup)(struct pci_socket *, struct proc_dir_entry *base);
};
......
......@@ -929,13 +929,6 @@ static int tcic_set_mem_map(unsigned int lsock, struct pccard_mem_map *mem)
/*====================================================================*/
static int tcic_get_bridge(unsigned int sock, struct cb_bridge_map *m)
{
return -EINVAL;
}
#define tcic_set_bridge tcic_get_bridge
static void tcic_proc_setup(unsigned int sock, struct proc_dir_entry *base)
{
}
......@@ -976,8 +969,6 @@ static struct pccard_operations tcic_operations = {
tcic_set_io_map,
tcic_get_mem_map,
tcic_set_mem_map,
tcic_get_bridge,
tcic_set_bridge,
tcic_proc_setup
};
......
/*
* Regular lowlevel cardbus driver ("yenta")
*
* (C) Copyright 1999 Linus Torvalds
* (C) Copyright 1999, 2000 Linus Torvalds
*/
#include <linux/init.h>
#include <linux/pci.h>
......@@ -185,44 +185,20 @@ static void yenta_set_power(pci_socket_t *socket, socket_state_t *state)
cb_writel(socket, CB_SOCKET_CONTROL, reg);
}
static void yenta_bridge_control(pci_socket_t *socket, u16 bridgectl)
{
struct pci_dev *dev = socket->dev;
/* MAGIC NUMBERS! Fixme */
config_writew(socket, CB_BRIDGE_CONTROL, bridgectl);
config_writel(socket, CB_LEGACY_MODE_BASE, 0);
config_writel(socket, PCI_BASE_ADDRESS_0, dev->resource[0].start);
config_writew(socket, PCI_COMMAND,
PCI_COMMAND_IO |
PCI_COMMAND_MEMORY |
PCI_COMMAND_MASTER |
PCI_COMMAND_WAIT);
config_writeb(socket, PCI_CACHE_LINE_SIZE, 32);
config_writeb(socket, PCI_LATENCY_TIMER, 168);
config_writeb(socket, PCI_SEC_LATENCY_TIMER, 176);
config_writeb(socket, PCI_PRIMARY_BUS, dev->bus->number);
config_writeb(socket, PCI_SECONDARY_BUS, dev->subordinate->number);
config_writeb(socket, PCI_SUBORDINATE_BUS, dev->subordinate->number);
config_writew(socket, CB_BRIDGE_CONTROL, bridgectl);
}
static int yenta_set_socket(pci_socket_t *socket, socket_state_t *state)
{
u16 bridge;
yenta_set_power(socket, state);
bridge = config_readw(socket, CB_BRIDGE_CONTROL) & ~CB_BRIDGE_CRST;
if (cb_readl(socket, CB_SOCKET_STATE) & CB_CBCARD) {
bridge |= (state->flags & SS_RESET) ? CB_BRIDGE_CRST : 0;
bridge |= CB_BRIDGE_PREFETCH0 | CB_BRIDGE_POSTEN;
/* ISA interrupt control? */
if (bridge & CB_BRIDGE_INTR) {
u8 intr = exca_readb(socket, I365_INTCTL);
intr = (intr & ~0xf) | state->io_irq;
intr = (intr & ~0xf) ; // | state->io_irq;
exca_writeb(socket, I365_INTCTL, intr);
}
} else {
......@@ -254,8 +230,7 @@ static int yenta_set_socket(pci_socket_t *socket, socket_state_t *state)
exca_writeb(socket, I365_CSCINT, reg);
exca_readb(socket, I365_CSC);
}
yenta_bridge_control(socket, bridge);
config_writew(socket, CB_BRIDGE_CONTROL, bridge);
/* Socket event mask: get card insert/remove events.. */
cb_writel(socket, CB_SOCKET_EVENT, -1);
cb_writel(socket, CB_SOCKET_MASK, CB_CDMASK);
......@@ -406,69 +381,6 @@ static int yenta_set_mem_map(pci_socket_t *socket, struct pccard_mem_map *mem)
return 0;
}
static int yenta_get_bridge(pci_socket_t *socket, struct cb_bridge_map *m)
{
unsigned map;
map = m->map;
if (map > 1)
return -EINVAL;
m->flags &= MAP_IOSPACE;
map += (m->flags & MAP_IOSPACE) ? 2 : 0;
m->start = config_readl(socket, CB_BRIDGE_BASE(map));
m->stop = config_readl(socket, CB_BRIDGE_LIMIT(map));
if (m->start || m->stop) {
m->flags |= MAP_ACTIVE;
m->stop |= (map > 1) ? 3 : 0x0fff;
}
/* Get prefetch state for memory mappings */
if (map < 2) {
u16 ctrl, prefetch_mask = CB_BRIDGE_PREFETCH0 << map;
ctrl = config_readw(socket, CB_BRIDGE_CONTROL);
m->flags |= (ctrl & prefetch_mask) ? MAP_PREFETCH : 0;
}
return 0;
}
static int yenta_set_bridge(pci_socket_t *socket, struct cb_bridge_map *m)
{
unsigned map;
u32 start, end;
map = m->map;
if (map > 1 || m->stop < m->start)
return -EINVAL;
if (m->flags & MAP_IOSPACE) {
if ((m->stop > 0xffff) || (m->start & 3) ||
((m->stop & 3) != 3))
return -EINVAL;
map += 2;
} else {
u16 ctrl, prefetch_mask = CB_BRIDGE_PREFETCH0 << map;
if ((m->start & 0x0fff) || ((m->stop & 0x0fff) != 0x0fff))
return -EINVAL;
ctrl = config_readw(socket, CB_BRIDGE_CONTROL);
ctrl &= ~prefetch_mask;
ctrl |= (m->flags & MAP_PREFETCH) ? prefetch_mask : 0;
config_writew(socket, CB_BRIDGE_CONTROL, ctrl);
}
start = 0;
end = 0;
if (m->flags & MAP_ACTIVE) {
start = m->start;
end = m->stop;
}
config_writel(socket, CB_BRIDGE_BASE(map), start);
config_writel(socket, CB_BRIDGE_LIMIT(map), end);
return 0;
}
static void yenta_proc_setup(pci_socket_t *socket, struct proc_dir_entry *base)
{
/* Not done yet */
......@@ -533,22 +445,12 @@ static unsigned int yenta_probe_irq(pci_socket_t *socket)
return probe_irq_mask(val);
}
/* Called at resume and initialization events */
static int yenta_init(pci_socket_t *socket)
static void yenta_clear_maps(pci_socket_t *socket)
{
int i;
pccard_io_map io = { 0, 0, 0, 0, 1 };
pccard_mem_map mem = { 0, 0, 0, 0, 0, 0 };
pci_set_power_state(socket->dev, 0);
/* MAGIC NUMBERS! Fixme */
config_writeb(socket, PCI_LATENCY_TIMER, 168);
config_writeb(socket, PCI_SEC_LATENCY_TIMER, 176);
exca_writeb(socket, I365_GBLCTL, 0x00);
exca_writeb(socket, I365_GENCTL, 0x00);
mem.sys_stop = 0x0fff;
yenta_set_socket(socket, &dead_socket);
for (i = 0; i < 2; i++) {
......@@ -559,6 +461,35 @@ static int yenta_init(pci_socket_t *socket)
mem.map = i;
yenta_set_mem_map(socket, &mem);
}
}
/* Called at resume and initialization events */
static int yenta_init(pci_socket_t *socket)
{
struct pci_dev *dev = socket->dev;
pci_set_power_state(socket->dev, 0);
config_writel(socket, CB_LEGACY_MODE_BASE, 0);
config_writel(socket, PCI_BASE_ADDRESS_0, dev->resource[0].start);
config_writew(socket, PCI_COMMAND,
PCI_COMMAND_IO |
PCI_COMMAND_MEMORY |
PCI_COMMAND_MASTER |
PCI_COMMAND_WAIT);
/* MAGIC NUMBERS! Fixme */
config_writeb(socket, PCI_CACHE_LINE_SIZE, 32);
config_writeb(socket, PCI_LATENCY_TIMER, 168);
config_writeb(socket, PCI_SEC_LATENCY_TIMER, 176);
config_writeb(socket, PCI_PRIMARY_BUS, dev->bus->number);
config_writeb(socket, PCI_SECONDARY_BUS, dev->subordinate->number);
config_writeb(socket, PCI_SUBORDINATE_BUS, dev->subordinate->number);
exca_writeb(socket, I365_GBLCTL, 0x00);
exca_writeb(socket, I365_GENCTL, 0x00);
yenta_clear_maps(socket);
return 0;
}
......@@ -607,6 +538,63 @@ static void yenta_get_socket_capabilities(pci_socket_t *socket)
printk("Yenta IRQ list %04x\n", socket->cap.irq_mask);
}
static void yenta_allocate_res(pci_socket_t *socket, int nr, unsigned type)
{
struct pci_bus *bus;
struct resource *root, *res;
u32 start, end;
u32 align, size, min, max;
unsigned offset;
offset = 0x1c + 8*nr;
bus = socket->dev->subordinate;
res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr;
printk("dev=%p, bus=%p, parent=%p\n", socket->dev, bus, socket->dev->bus);
printk("res = %p, bus->res = %p\n", res, bus->resource[nr]);
res->name = bus->name;
res->flags = type;
res->start = 0;
res->end = 0;
root = pci_find_parent_resource(socket->dev, res);
if (!root)
return;
start = config_readl(socket, offset);
end = config_readl(socket, offset+4) | 0xfff;
if (start && end > start) {
res->start = start;
res->end = end;
request_resource(root, res);
return;
}
align = size = 4*1024*1024;
min = 0x10000000; max = ~0U;
if (type & IORESOURCE_IO) {
align = 1024;
size = 256;
min = 0x1000;
max = 0xffff;
}
if (allocate_resource(root, res, size, min, max, align, NULL, NULL) < 0)
return;
config_writel(socket, offset, res->start);
config_writel(socket, offset+4, res->end);
}
/*
* Allocate the bridge mappings for the device..
*/
static void yenta_allocate_resources(pci_socket_t *socket)
{
yenta_allocate_res(socket, 0, IORESOURCE_MEM|IORESOURCE_PREFETCH);
yenta_allocate_res(socket, 1, IORESOURCE_MEM);
yenta_allocate_res(socket, 2, IORESOURCE_IO);
}
/*
* Initialize a cardbus controller. Make sure we have a usable
* interrupt, and that we can map the cardbus area. Fill in the
......@@ -636,14 +624,17 @@ static int yenta_open(pci_socket_t *socket)
if (!socket->base)
return -1;
/* Disable all events */
cb_writel(socket, CB_SOCKET_MASK, 0x0);
if (dev->irq && !request_irq(dev->irq, yenta_interrupt, SA_SHIRQ, dev->name, socket))
socket->cb_irq = dev->irq;
/* Figure out what the dang thing can do.. */
yenta_get_socket_capabilities(socket);
/* Disable all events */
cb_writel(socket, CB_SOCKET_MASK, 0x0);
/* Set up the bridge regions.. */
yenta_allocate_resources(socket);
printk("Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE));
return 0;
......@@ -676,8 +667,6 @@ struct pci_socket_ops yenta_operations = {
yenta_set_io_map,
yenta_get_mem_map,
yenta_set_mem_map,
yenta_get_bridge,
yenta_set_bridge,
yenta_proc_setup
};
......@@ -698,7 +687,5 @@ struct pci_socket_ops ricoh_operations = {
yenta_set_io_map,
yenta_get_mem_map,
yenta_set_mem_map,
yenta_get_bridge,
yenta_set_bridge,
yenta_proc_setup
};
......@@ -19,14 +19,31 @@ comment 'Miscellaneous USB options'
fi
comment 'USB Devices'
dep_tristate ' USB keyboard support' CONFIG_USB_KBD $CONFIG_USB
dep_tristate ' USB mouse support' CONFIG_USB_MOUSE $CONFIG_USB
dep_tristate ' USB Human Interface Device (HID) support' CONFIG_USB_HID $CONFIG_USB
if [ "$CONFIG_USB_HID" != "y" ]; then
dep_tristate ' USB HIDBP Keyboard support' CONFIG_USB_KBD $CONFIG_USB
dep_tristate ' USB HIDBP Mouse support' CONFIG_USB_MOUSE $CONFIG_USB
fi
if [ "$CONFIG_USB_HID" != "n" ]; then
dep_tristate ' Keyboard support' CONFIG_INPUT_KEYBDEV $CONFIG_USB_HID
dep_tristate ' Mouse support' CONFIG_INPUT_MOUSEDEV $CONFIG_USB_HID
if [ "$CONFIG_INPUT_MOUSEDEV" != "n" ]; then
bool ' Mix all mice into one device' CONFIG_INPUT_MOUSEDEV_MIX $CONFIG_USB_HID
fi
dep_tristate ' Joystick support' CONFIG_INPUT_JOYDEV $CONFIG_USB_HID
dep_tristate ' Event interface support' CONFIG_INPUT_EVDEV $CONFIG_USB_HID
bool ' USB HID debug output' CONFIG_USB_HID_DEBUG
if [ "$CONFIG_USB_HID_DEBUG" != "n" ]; then
bool ' USB HID lots of debug output' CONFIG_USB_HID_DEBUG_LOTS
fi
fi
dep_tristate ' USB Printer support' CONFIG_USB_PRINTER $CONFIG_USB
dep_tristate ' USB Scanner support' CONFIG_USB_SCANNER $CONFIG_USB
dep_tristate ' USB Audio support' CONFIG_USB_AUDIO $CONFIG_USB
dep_tristate ' USB Communications Device Class (ACM) support' CONFIG_USB_ACM $CONFIG_USB
dep_tristate ' USB Serial Converter support' CONFIG_USB_SERIAL $CONFIG_USB
dep_tristate ' USB CPiA Camera support' CONFIG_USB_CPIA $CONFIG_USB
dep_tristate ' USB OV511 Camera support' CONFIG_USB_OV511 $CONFIG_USB
dep_tristate ' USB Kodak DC-2xx Camera support' CONFIG_USB_DC2XX $CONFIG_USB
dep_tristate ' USB SCSI (mass storage) support' CONFIG_USB_SCSI $CONFIG_USB
if [ "$CONFIG_USB_SCSI" != "n" ]; then
......
#
# Makefile for the kernel usb device drivers.
# Makefile for the kernel USB device drivers.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now inherited from the
# parent makes..
SUB_DIRS :=
MOD_SUB_DIRS := $(SUB_DIRS)
ALL_SUB_DIRS := $(SUB_DIRS)
L_TARGET := usb.a
M_OBJS :=
L_OBJS :=
MOD_LIST_NAME := USB_MODULES
ifeq ($(CONFIG_USB),y)
......@@ -48,13 +40,6 @@ ifeq ($(CONFIG_USB_OHCI_HCD),m)
MI_OBJS += ohci-hcd.o
endif
ifeq ($(CONFIG_USB_MOUSE),y)
L_OBJS += mouse.o
endif
ifeq ($(CONFIG_USB_MOUSE),m)
M_OBJS += mouse.o
endif
ifeq ($(CONFIG_USB_SCANNER),y)
L_OBJS += scanner.o
endif
......@@ -85,21 +70,6 @@ ifeq ($(CONFIG_USB_SERIAL),m)
M_OBJS += usb-serial.o
endif
ifneq ($(CONFIG_ADB_KEYBOARD),y)
KEYMAP=keymap
else
KEYMAP=keymap-mac
endif
ifeq ($(CONFIG_USB_KBD),y)
L_OBJS += keyboard.o $(KEYMAP).o
endif
ifeq ($(CONFIG_USB_KBD),m)
M_OBJS += usb-keyboard.o
MI_OBJS += keyboard.o $(KEYMAP).o
endif
ifeq ($(CONFIG_USB_AUDIO),y)
L_OBJS += audio.o
endif
......@@ -116,6 +86,24 @@ ifeq ($(CONFIG_USB_CPIA),m)
M_OBJS += cpia.o
endif
ifeq ($(CONFIG_USB_OV511),y)
L_OBJS += ov511.o
endif
ifeq ($(CONFIG_USB_OV511),m)
M_OBJS += ov511.o
MI_OBJS += ov511.o
endif
ifeq ($(CONFIG_USB_OV511),y)
L_OBJS += ov511.o
endif
ifeq ($(CONFIG_USB_OV511),m)
M_OBJS += ov511.o
MI_OBJS += ov511.o
endif
ifeq ($(CONFIG_USB_DC2XX),y)
L_OBJS += dc2xx.o
endif
......@@ -146,6 +134,71 @@ ifeq ($(CONFIG_USB_EZUSB),m)
M_OBJS += ezusb.o
endif
ifeq ($(CONFIG_USB_HID),y)
L_OBJS += hid.o
ILX_OBJS := input.o
endif
ifeq ($(CONFIG_USB_HID),m)
M_OBJS += hid.o
IMX_OBJS := input.o
endif
ifeq ($(CONFIG_USB_KBD),y)
L_OBJS += usbkbd.o
ILX_OBJS := input.o
endif
ifeq ($(CONFIG_USB_KBD),m)
M_OBJS += usbkbd.o
IMX_OBJS := input.o
endif
ifeq ($(CONFIG_USB_MOUSE),y)
L_OBJS += usbmouse.o
ILX_OBJS := input.o
endif
ifeq ($(CONFIG_USB_MOUSE),m)
M_OBJS += usbmouse.o
IMX_OBJS := input.o
endif
LX_OBJS += $(ILX_OBJS)
MX_OBJS += $(IMX_OBJS)
ifeq ($(CONFIG_INPUT_KEYBDEV),y)
L_OBJS += keybdev.o
endif
ifeq ($(CONFIG_INPUT_KEYBDEV),m)
M_OBJS += keybdev.o
endif
ifeq ($(CONFIG_INPUT_MOUSEDEV),y)
L_OBJS += mousedev.o
endif
ifeq ($(CONFIG_INPUT_MOUSEDEV),m)
M_OBJS += mousedev.o
endif
ifeq ($(CONFIG_INPUT_JOYDEV),y)
L_OBJS += joydev.o
endif
ifeq ($(CONFIG_INPUT_JOYDEV),m)
M_OBJS += joydev.o
endif
ifeq ($(CONFIG_INPUT_EVDEV),y)
L_OBJS += evdev.o
endif
ifeq ($(CONFIG_INPUT_EVDEV),m)
M_OBJS += evdev.o
endif
ifeq ($(CONFIG_USB_USS720),y)
L_OBJS += uss720.o
endif
......@@ -164,18 +217,6 @@ endif
include $(TOPDIR)/Rules.make
keymap.o: keymap.c
keymap.c: maps/serial.map maps/usb.map maps/fixup.map
./mkmap > $@
keymap-mac.o: keymap-mac.c
keymap-mac.c: maps/mac.map maps/usb.map
./mkmap.adb > $@
usb-keyboard.o: $(KEYMAP).o keyboard.o
$(LD) $(LD_RFLAG) -r -o $@ $(KEYMAP).o keyboard.o
ifeq ($(CONFIG_USB_SCSI_DEBUG),y)
usb-scsi.o: usb_scsi.o usb_scsi_debug.o
$(LD) $(LD_RFLAG) -r -o $@ usb_scsi.o usb_scsi_debug.o
......
Linux HID driver v0.8
(c) 1999 Vojtech Pavlik <vojtech@suse.cz>
(c) 1999 Andreas Gal <agal@uwsp.edu>
Sponsored by SuSE
----------------------------------------------------------------------------
0. Disclaimer
~~~~~~~~~~~~~
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA
Should you need to contact me, the author, you can do so either by e-mail
- mail your message to <vojtech@suse.cz>, or by paper mail: Vojtech Pavlik,
Ucitelska 1576, Prague 8, 182 00 Czech Republic
For your convenience, the GNU General Public License version 2 is included
in the package: See the file COPYING.
1. Introduction
~~~~~~~~~~~~~~~
This is a driver for USB devices conforming to the USB HID (Human Input
Device) standard. These devices include namely keyboards, mice and
joysticks.
However many other devices (monitors, speakers, UPSs ...) also communicate
through the same protocol, which makes its specification somewhat bloated.
This isn't a problem, though, because the driver doesn't need to know about
all the possible devices it can control, and can just parse the protocol and
leave the rest of the job (for example understanding what the UPS wants to
say) to the userland.
Because of this, the USB HID driver has two interfaces. One is via the
proc filesystem, allowing userland applications send and read arbitrary
reports to and from a connected USB device. The other is via a very simple
yet generic input device driver, which dispatches input events (keystrokes,
mouse or joystick movements) to specific, backward compatible userland
interfaces. This way a PS/2 mouse, an AT keyboard or a Linux joystick driver
interface are emulated, and allow applications to immediately work with USB
mice, USB keyboards and USB joysticks without any changes.
The input driver is aimed for a little more than USB device handling in
the future, though. It's generic enough so that it can be used for any
mouse, keyboard or joystick (and more, of course). A PS/2 mouse driver, a
serial mouse, Sun mouse, and most of the busmouse drivers were rewritten to
use this as well as the AT keyboard and Sun keyboard drivers. This will
hopefully allow conversion of all Linux keyboard and mouse and joystick
drivers to this scheme.
This effort has it's home page at:
http://www.suse.cz/development/input/
You'll find both the latest HID driver and the complete Input driver there.
There is also a mailing list for this:
listproc@atrey.karlin.mff.cuni.cz
Send "subscribe linux-joystick Your Name" to subscribe to it.
2. Usage
~~~~~~~~
Since the driver comes with recent 2.3 kernels, all that's needed to use
it is to enable it either as a module or compiled-in into the kernel.
After that, after reboot (and possibly also inserting the USB and HID
modules) the following will happen:
* If you selected keyboard support, all USB keystrokes will be also routed
to the Linux keyboard driver as if being input through the ordinary system
keyboard.
* If you selected mouse support, there will be (one or more) simulated PS/2
mouse devices on major 10, minor 32, 33 and more. These simulated mice can
in addition to a standard 3-button PS/2 mouse behave like MS Intellimice,
with a wheel. If you want to use the wheel, just specify '-t imps2' to gpm
and 'Protocol "ImPS/2"' to X, and it will work. A single emulated mouse
device can be open by any number of processes (unlike the /dev/psaux), and
for each of them the emulation is separate, each can use a different mode.
The mousedev driver, which emulates the mice, can also emulate a Genius
NewScroll 5 buttons-and-a-wheel mouse, if you set it to a Genius PS/2
mode ('-t netmouse' 'Protocol "NetMousePS/2"'). However, not gpm, nor X
can decode the 5 buttons yet, so this isn't very useful right now.
* If you selected joystick support, the driver will take over major 15, the
joystick major number, and will emulate joysticks on it. This means the
normal joystick driver can't be used together with it (now, after the
normal joystick drivers are converted to the input scheme, all will work
nicely together). Also, you'll probably need to calibrate your joystick
manually ('man jscal') to be able to use it, because the USB
autocalibration is far from perfect yet.
* If you selected event device support, there will be devices on major 10,
minors 64, 65 and more for each input device connected through this
driver. These devices output raw events the input driver dispatches. Each
has a timestamp. This hopefully will be THE way X will talk to keyboard
and mice, because it's hardware independent, and not limited by existing
de-facto standards.
3. Verifying if it works
~~~~~~~~~~~~~~~~~~~~~~~~
Typing a couple keys on the keyboard should be enough to check that a USB
keyboard works and is correctly connected to the kernel keyboard driver.
Doing a cat /dev/hidmouse (c, 10, 32) will verify that a mouse is also
emulated, characters should appear if you move it.
You can test the joystick emulation with the 'jstest' utility, available
in the joystick package (see Documentation/joystick.txt).
You can test the event devics with the 'evtest' utitily available on the
input driver homepage (see the URL above).
4. FAQ
~~~~~~
Q: Why aren't any questions here yet?
A: Because none were frequent enough yet.
5. Event interface
~~~~~~~~~~~~~~~~~~
Should you want to add event device support into any application (X, gpm,
svgalib ...) I (vojtech@suse.cz) will be happy to provide you any help I
can. Here goes a description of the current state of things, which is going
to be extended, but not changed incompatibly as time goes:
You can use blocking and nonblocking reads, also select() on the
/dev/inputX devices, and you'll always get a whole number of input events on
a read. Their layout is:
struct input_event {
struct timeval time;
unsigned short type;
unsigned short code;
unsigned int value;
};
'time' is the timestamp, it returns the time at which the event happened.
Type is for example EV_REL for relative momement, REL_KEY for a keypress or
release. More types are defined in include/linux/input.h.
'code' is event code, for example REL_X or KEY_BACKSPACE, again a complete
list is in include/linux/input.h.
'value' is the value the event carries. Either a relative change for
EV_REL, absolute new value for EV_ABS (joysticks ...), or 0 for EV_KEY for
release, 1 for keypress and 2 for autorepeat.
6. Proc interface
~~~~~~~~~~~~~~~~~
For HID-specific devices there is also the /proc interface. It isn't
present in this release yet, though, so it's description will appear here
together with the code in the driver.
This is a simple USB keyboard driver written from Linus'
USB driver (started with Greg's usb-0.03b.tar.gz source
tree)
It works fine with my BTC keyboard but I'm still investigating
trouble with my MS keyboard (trouble starts with an inability
to set into boot protocol mode, though, this very well could
be all due to crappy hardware).
Anyway, I would appreciate you taking a look if you have
any USB keyboards lying around. Oh also, I'm doing this on
UHCI so sorry if it breaks with OHCI.
-ham
Keyboard patch
--------------
Instead of using the multiple keyboard patch and then running into all
of the kernel version problems that the current Linux-USB project has
had, I'm just mapping the USB keycodes to the standard AT-101 keycodes
and sending them directly to "handle_scancode".
This may or may not be considered a hack. Anyway it is effective, and
I think safe, and allows USB keyboards to coexist with a serial
keyboard (oh yeah, one side effect is that you can for example hold
down the control key on the serial keyboard and press "a" on the USB
keyboard and you get Control-a like with Windows USB) and works
fine for console and X.
You do need to make a *tiny* patch the kernel source tree so that the
function "handle_scancode" is exported from keyboard.c though.
$ cd /usr/src/linux
$ patch -p0 < kbd.patch
And, of course, then, you need to rebuild and install the kernel.
** [Vojtech]: Alternately, just 'insmod kbd-stub', if you don't want
to use the keyboard and are too lazy to patch the kernel.
Keyboard map
------------
I'm including a stupid utility "mkmap" which generates the USB->serial
keymap. It takes in maps/serial.map (the current serial keymap,
generated by "dumpkeys"), maps/usb.map (the USB keymap), and
maps/fixup.map (fixes for e0 keys and misc.) and spits out keymap.c
Anyway, it is not beautiful but should serve its purpose for the
moment.
Other changes
-------------
uhci.c:
* added a context value to the irq callback function
(this is exactly like the "dev_id" field to request_irq)
* played with uhci_reset_port to get better hot-plug results
(eg. do a wait_ms(200) before calling uhci_reset_port)
usb.c:
* disconnect all devices after uhci-control thread is killed
* skip over the HID descriptor
* disconnect the high-level driver in usb_disconnect
-------------------------------------------------------------------------------
Readme for Linux device driver for the OmniVision OV511 USB to camera bridge IC
-------------------------------------------------------------------------------
INTRODUCTION:
This is a preliminary version of my OV511 Linux device driver. At the moment,
it does not do much more than detect the chip and initialize it. As trivial
as this sounds, it represents many hours of my work. Since OmniVision refused
to release the full specs to me, I had to write code to probe out the register
read/write commands. Some code is in place to allow a frame to be grabbed, but
it is nowhere near complete.
SUPPORTED CAMERAS:
____________________________________________
Manufacturer | Model | Custom ID
-----------------+--------------+-----------
D-Link | DSB-C300 | 3
Creative Labs | WebCam 3 | 21
--------------------------------------------
Any camera using the OV511 and the OV7610 CCD should work with this driver. The
driver only detects known cameras though, based on their custom id number. If
you have a currently unsupported camera, the ID number should be reported to you
in the kernel logs. If you have an unsupported camera, please send me the model,
manufacturer and ID number and I will add it to the detection code. In the
meantime, you can add to the code yourself in the function ov511_probe()
WHAT YOU NEED:
- If you want to help with the development, get the chip's specification docs at
http://www.ovt.com/omniusbp.html
- A Video4Linux compatible frame grabber program (I recommend vidcat)
(see: http://www.exploits.org/v4l/ )
WHAT NEEDS TO BE DONE:
In short, a lot.
UPDATE:
Currently, the control messages are working fine ("vendor commands"; for
reading and writing the OV511 registers.) The I2C bus commands for reading and
writing the camera (OV7610) registers are implemented and working, with at least
one person's camera. The isochronous-in endpoint for video data is finally
producing data, but since ov511_parse_data() is not implemented you will not see
a picture yet.
Support for specific CCD's will have to be implemented as well (such as the
OV7610.)
The rest of the work will involve implementing support for all the different
resolutions, color depths, etc. Also, while support for the OV511's proprietary
lossy compression is apparently not necessary (the code currently disables it,)
it would be a nice addition as it improves performance quite a bit. OmniVision
wouldn't tell me how the algorithm works, so we can't really work on that yet.
Please kindly inform OmniVision that you would like them to release their
specifications to the Linux community.
HOW TO CONTACT ME:
You can email me at mmcclelland@delphi.com . Please prefix the subject line
with "OV511: " so that I am certain to notice your message.
CREDITS:
The code is based in no small part on the CPiA driver by Johannes Erdfelt,
Randy Dunlap, and others. Big thanks to them for their pioneering work on that
and the USB stack. Thanks to Bret Wallach for getting camera reg IO and ISOC
working.
This diff is collapsed.
/*
* driver/usb/hid-debug.h
*
* (c) 1999 Andreas Gal <gal@cs.uni-magdeburg.de>
* (c) 1999 Vojtech Pavlik <vojtech@suse.cz>
*
* Some debug stuff for the HID parser.
*
* Sponsored by SuSE
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
* Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
*/
struct hid_usage_entry {
unsigned page;
unsigned usage;
char *description;
};
static struct hid_usage_entry hid_usage_table[] = {
{ 1, 0, "GenericDesktop" },
{0, 0x01, "Pointer"},
{0, 0x02, "Mouse"},
{0, 0x04, "Joystick"},
{0, 0x05, "GamePad"},
{0, 0x06, "Keyboard"},
{0, 0x07, "Keypad"},
{0, 0x08, "MultiAxis"},
{0, 0x30, "X"},
{0, 0x31, "Y"},
{0, 0x32, "Z"},
{0, 0x33, "Rx"},
{0, 0x34, "Ry"},
{0, 0x35, "Rz"},
{0, 0x36, "Slider"},
{0, 0x37, "Dial"},
{0, 0x38, "Wheel"},
{0, 0x39, "HatSwitch"},
{0, 0x3a, "CountedBuffer"},
{0, 0x3b, "ByteCount"},
{0, 0x3c, "MotionWakeup"},
{0, 0x3d, "Start"},
{0, 0x3e, "Select"},
{0, 0x40, "Vx"},
{0, 0x41, "Vy"},
{0, 0x42, "Vz"},
{0, 0x43, "Vbrx"},
{0, 0x44, "Vbry"},
{0, 0x45, "Vbrz"},
{0, 0x46, "Vno"},
{0, 0x80, "SystemControl"},
{0, 0x81, "System PowerDown"},
{0, 0x82, "System Sleep"},
{0, 0x83, "System WakeUp"},
{0, 0x84, "System ContextMenu"},
{0, 0x85, "System MainMenu"},
{0, 0x86, "System AppMenu"},
{0, 0x87, "System MenuHelp"},
{0, 0x88, "System MenuExit"},
{0, 0x89, "System MenuSelect"},
{0, 0x8a, "System MenuRight"},
{0, 0x8b, "System MenuLeft"},
{0, 0x8c, "System MenuUp"},
{0, 0x8d, "System MenuDown"},
{0, 0x90, "D-padUp"},
{0, 0x91, "D-padDown"},
{0, 0x92, "D-padRight"},
{0, 0x93, "D-padLeft"},
{ 7, 0, "Keyboard" },
{ 8, 0, "LED" },
{ 9, 0, "Button" },
{ 13, 0, "Digitizers" },
{0, 0x01, "Digitizer"},
{0, 0x02, "Pen"},
{0, 0x03, "LightPen"},
{0, 0x04, "TouchScreen"},
{0, 0x05, "TouchPad"},
{0, 0x20, "Stylus"},
{0, 0x21, "Puck"},
{0, 0x22, "Finger"},
{0, 0x30, "TipPressure"},
{0, 0x31, "BarrelPressure"},
{0, 0x32, "InRange"},
{0, 0x33, "Touch"},
{0, 0x34, "UnTouch"},
{0, 0x35, "Tap"},
{0, 0x39, "TabletFunctionKey"},
{0, 0x3a, "ProgramChangeKey"},
{0, 0x42, "TipSwitch"},
{0, 0x43, "SecondaryTipSwitch"},
{0, 0x44, "BarrelSwitch"},
{0, 0x45, "Eraser"},
{0, 0x46, "TabletPick"},
{ 15, 0, "PhysicalInterfaceDevice" },
{ 0, 0, NULL }
};
static void resolv_usage_page(unsigned page) {
struct hid_usage_entry *p;
for (p = hid_usage_table; p->description; p++)
if (p->page == page) {
printk("%s", p->description);
return;
}
printk("%04x", page);
}
static void resolv_usage(unsigned usage) {
struct hid_usage_entry *p;
resolv_usage_page(usage >> 16);
printk(".");
for (p = hid_usage_table; p->description; p++)
if (p->page == (usage >> 16)) {
for(++p; p->description && p->page == 0; p++)
if (p->usage == (usage & 0xffff)) {
printk("%s", p->description);
return;
}
break;
}
printk("%04x", usage & 0xffff);
}
__inline__ static void tab(int n) {
while (n--) printk(" ");
}
static void hid_dump_field(struct hid_field *field, int n) {
int j;
if (field->physical) {
tab(n);
printk("Physical(");
resolv_usage(field->physical); printk(")\n");
}
if (field->logical) {
tab(n);
printk("Logical(");
resolv_usage(field->logical); printk(")\n");
}
tab(n); printk("Usage(%d)\n", field->maxusage);
for (j = 0; j < field->maxusage; j++) {
tab(n+2);resolv_usage(field->usage[j].hid); printk("\n");
}
if (field->logical_minimum != field->logical_maximum) {
tab(n); printk("Logical Minimum(%d)\n", field->logical_minimum);
tab(n); printk("Logical Maximum(%d)\n", field->logical_maximum);
}
if (field->physical_minimum != field->physical_maximum) {
tab(n); printk("Physical Minimum(%d)\n", field->physical_minimum);
tab(n); printk("Physical Maximum(%d)\n", field->physical_maximum);
}
if (field->unit_exponent) {
tab(n); printk("Unit Exponent(%d)\n", field->unit_exponent);
}
if (field->unit) {
tab(n); printk("Unit(%u)\n", field->unit);
}
tab(n); printk("Report Size(%u)\n", field->report_size);
tab(n); printk("Report Count(%u)\n", field->report_count);
tab(n); printk("Report Offset(%u)\n", field->report_offset);
tab(n); printk("Flags( ");
j = field->flags;
printk("%s", HID_MAIN_ITEM_CONSTANT & j ? "Constant " : "");
printk("%s", HID_MAIN_ITEM_VARIABLE & j ? "Variable " : "Array ");
printk("%s", HID_MAIN_ITEM_RELATIVE & j ? "Relative " : "Absolute ");
printk("%s", HID_MAIN_ITEM_WRAP & j ? "Wrap " : "");
printk("%s", HID_MAIN_ITEM_NONLINEAR & j ? "NonLinear " : "");
printk("%s", HID_MAIN_ITEM_NO_PREFERRED & j ? "NoPrefferedState " : "");
printk("%s", HID_MAIN_ITEM_NULL_STATE & j ? "NullState " : "");
printk("%s", HID_MAIN_ITEM_VOLATILE & j ? "Volatile " : "");
printk("%s", HID_MAIN_ITEM_BUFFERED_BYTE & j ? "BufferedByte " : "");
printk(")\n");
}
void hid_dump_device(struct hid_device *device) {
struct hid_report_enum *report_enum;
struct hid_report *report;
struct list_head *list;
unsigned i,k;
static char *table[] = {"INPUT", "OUTPUT", "FEATURE"};
printk("Application(");
resolv_usage(device->application);
printk(")\n");
for (i = 0; i < HID_REPORT_TYPES; i++) {
report_enum = device->report_enum + i;
list = report_enum->report_list.next;
while (list != &report_enum->report_list) {
report = (struct hid_report *) list;
tab(2);
printk("%s", table[i]);
if (report->id)
printk("(%d)", report->id);
printk("[%s]", table[report->type]);
printk("\n");
for (k = 0; k < report->maxfield; k++) {
tab(4);
printk("Field(%d)\n", k);
hid_dump_field(report->field[k], 6);
}
list = list->next;
}
}
}
void hid_dump_input(struct hid_usage *usage, __s32 value) {
printk("hidd: input ");
resolv_usage(usage->hid);
printk(" = %d\n", value);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -26,9 +26,9 @@
# uncompression can be done without blocking on allocation).
#
OBJECTFILES=adler32.o infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o uncompr.o
O_TARGET := zlib.o
zlib.o: $(OBJECTFILES)
ld -r -o zlib.o $(OBJECTFILES)
O_OBJS := adler32.o infblock.o infcodes.o inffast.o inflate.o \
inftrees.o infutil.o uncompr.o
include $(TOPDIR)/Rules.make
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -52,6 +52,10 @@ extern int init_coda(void);
extern int init_devpts_fs(void);
#endif
#ifdef CONFIG_SUN_OPENPROMFS
extern int init_openprom_fs(void);
#endif
void __init filesystem_setup(void)
{
#ifdef CONFIG_MINIX_FS
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment