Commit a19c0fb8 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.110pre2

parent 42b1d071
......@@ -62,10 +62,12 @@ S: USA
N: Andrea Arcangeli
E: arcangeli@mbox.queen.it
W: http://www.cs.unibo.it/~arcangel/
W: http://e-mind.com/~andrea/
P: 1024/CB4660B9 CC A0 71 81 F4 A0 63 AC C0 4B 81 1D 8C 15 C8 E5
D: Parport sharing hacker.
D: Various other kernel hacks.
D: Parport hacker
D: Implemented a workaround for some interrupt buggy printers
D: Author of pscan that helps to fix lp/parport bug
D: Various other kernel hacks
S: Via Ciaclini 26
S: Imola 40026
S: Italy
......
......@@ -125,7 +125,7 @@ with no lp device associated with the second port (parport1). Note
that this is different to the way older kernels worked; there used to
be a static association between the I/O port address and the device
name, so /dev/lp0 was always the port at 0x3bc. This is no longer the
case - if you only have one port, it will always be /dev/lp0,
case - if you only have one port, it will default to being /dev/lp0,
regardless of base address.
Also:
......
OPL3-SA sound driver (opl3sa.o)
The Yamaha OPL3-SAx sound chip is usually found built into motherboards, and
it's a decent little chip offering a WSS mode, a SB Pro emulation mode, MPU401
and OPL3 FM Synth capabilities.
You can enable inclusion of the driver via CONFIG_SOUND_OPL3SA1=m, or
CONFIG_SOUND_OPL3SA1=y through 'make config/xconfig/menuconfig'.
You'll need to know all of the relevant info (irq, dma, and io port) for the
chip's WSS mode, since that is the mode the kernel sound driver uses, and of
course you'll also need to know about where the MPU401 and OPL3 ports and
irq's are if you want to use those.
Here's the skinny on how to load it as a module:
modprobe opl3sa io=0x530 irq=11 dma=0 dma2=1 mpu_io=0x330 mpu_irq=5
Module options in detail:
io: This is the WSS's port base.
irq: This is the WSS's irq.
dma: This is the WSS's dma line. In my BIOS setup screen this was
listed as "WSS Play DMA"
dma2: This is the WSS's secondary dma line. My BIOS calls it the
"WSS capture DMA"
mpu_io: This is the MPU401's port base.
mpu_irq: This is the MPU401's irq.
If you'd like to use the OPL3 FM Synthesizer, make sure you enable
CONFIG_YM3812 (in 'make config'). That'll build the opl3.o module.
Then a simple 'insmod opl3 io=0x388', and you now have FM Synth.
You can also use the SoftOSS software synthesizer instead of the builtin OPL3.
Here's how:
Say 'y' or 'm' to "SoftOSS software wave table engine" in make config.
If you said yes, the software synth is availible once you boot your new
kernel.
If you chose to build it as a module, just insmod the resulting softoss2.o
A 'cat /dev/sndstat' with all the above options should look similar to this:
OSS/Free:3.8s2++-971130
Load type: Driver loaded as a module
Kernel: Linux iniquity 2.1.105 #145 Mon Jun 8 11:40:47 MST 1998 i586
Config options: 0
Installed drivers:
Card config:
Audio devices:
0: MSS audio codec (CS4231) (DUPLEX)
Synth devices:
0: Yamaha OPL-3
1: SoftOSS
Midi devices:
0: OPL3-SA (MPU401)
Timers:
0: System clock
1: MSS audio codec (CS4231)
Mixers:
0: MSS audio codec (CS4231)
Questions? Comments?
<stiker@northlink.com>
......@@ -82,6 +82,14 @@ options mad16 irq=10 dma=0 dma16=1 io=0x530 joystick=1 cdtype=0
options opl3 io=0x388
post-install mad16 /sbin/ad1848_mixer_reroute 14 8 15 3 16 6
If you have an MPU daughtercard or onboard MPU you will want to add to the
"options mad16" line - eg
options mad16 irq=5 dma=0 dma16=3 io=0x530 mpu_io=0x330 mpu_irq=9
To set the I/O and IRQ of the MPU.
Explain:
alias mixer0 mad16
......
From: Paul Barton-Davis <pbd@op.net>
Here is the configuration I use with a Tropez+ and my modular
driver:
alias char-major-14 wavefront
alias synth0 wavefront
alias mixer0 cs4232
alias audio0 cs4232
pre-install wavefront modprobe "-k" "cs4232"
post-install wavefront modprobe "-k" "opl3"
options wavefront io=0x200 irq=9
options cs4232 synthirq=9 synthio=0x200 io=0x530 irq=5 dma=1 dma2=0
options opl3 io=0x388
Things to note:
the wavefront options "io" and "irq" ***MUST*** match the "synthio"
and "synthirq" cs4232 options.
you can do without the opl3 module if you don't
want to use the OPL/[34] synth on the soundcard
the opl3 io parameter is conventionally not adjustable.
Please see drivers/sound/README.wavefront for more details.
This diff is collapsed.
......@@ -439,13 +439,15 @@ M: emoenke@gwdg.de
L: linux-kernel@vger.rutgers.edu
S: Maintained
PARALLEL PORT SHARING SUPPORT
PARALLEL PORT SUPPORT
P: Phil Blundell
M: Philip.Blundell@pobox.com
P: Tim Waugh
M: tim@cyberelk.demon.co.uk
P: David Campbell
M: campbell@tirian.che.curtin.edu.au
M: campbell@torque.net
P: Andrea Arcangeli
M: arcangeli@mbox.queen.it
L: linux-parport@torque.net
L: pnp-list@redhat.com
W: http://www.cyberelk.demon.co.uk/parport.html
......
......@@ -64,7 +64,7 @@ EXPORT_SYMBOL(_writew);
EXPORT_SYMBOL(_writel);
EXPORT_SYMBOL(_memcpy_fromio);
EXPORT_SYMBOL(_memcpy_toio);
EXPORT_SYMBOL(_memset_c_io);
EXPORT_SYMBOL(_memset_io);
EXPORT_SYMBOL(insb);
EXPORT_SYMBOL(insw);
EXPORT_SYMBOL(insl);
......@@ -87,7 +87,6 @@ EXPORT_SYMBOL(memcmp);
EXPORT_SYMBOL(memmove);
EXPORT_SYMBOL(__memcpy);
EXPORT_SYMBOL(__memset);
EXPORT_SYMBOL(__memsetw);
EXPORT_SYMBOL(__constant_c_memset);
EXPORT_SYMBOL(dump_thread);
......
......@@ -1946,8 +1946,8 @@ static inline void sio_fixup(void)
}
void __init
pcibios_fixup(void)
__initfunc(void
pcibios_fixup(void))
{
struct pci_bus *cur;
......@@ -2022,6 +2022,12 @@ pcibios_fixup(void)
}
__initfunc(void
pcibios_fixup_bus(struct pci_bus *bus))
{
}
asmlinkage int sys_pciconfig_read(unsigned long bus, unsigned long dfn,
unsigned long off, unsigned long len,
unsigned char *buf)
......
......@@ -13,6 +13,7 @@
#include <asm/ptrace.h>
#include <asm/system.h>
#include <asm/io.h>
##include <asm/smp.h>
/*
* BIOS32-style PCI interface:
......
......@@ -6,6 +6,7 @@
#include <linux/malloc.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <asm/hwrpb.h>
#include <asm/io.h>
......
......@@ -9,12 +9,12 @@
#include <linux/smp_lock.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <asm/hwrpb.h>
#include <asm/ptrace.h>
#include <asm/atomic.h>
#include <asm/delay.h>
#include <asm/irq.h>
#include <asm/bitops.h>
#include <asm/pgtable.h>
......
......@@ -21,6 +21,9 @@ ASFLAGS_PROC :=
ifeq ($(CONFIG_CPU_26),y)
PROCESSOR = armo
TEXTADDR = 0x02080000
ZTEXTADDR = 0x01800000
ZRELADDR = 0x02080000
ifeq ($(CONFIG_BINUTILS_NEW),y)
CFLAGS_PROC += -mapcs-26 -mshort-load-bytes
ifeq ($(CONFIG_CPU_ARM2),y)
......@@ -45,6 +48,7 @@ endif
ifeq ($(CONFIG_CPU_32),y)
PROCESSOR = armv
TEXTADDR = 0xC0008000
ifeq ($(CONFIG_BINUTILS_NEW),y)
CFLAGS_PROC += -mapcs-32 -mshort-load-bytes
ifeq ($(CONFIG_CPU_ARM6),y)
......@@ -72,12 +76,6 @@ endif
COMPRESSED_HEAD = head.o
ifeq ($(PROCESSOR),armo)
TEXTADDR = 0x02080000
ZTEXTADDR = 0x01800000
ZRELADDR = 0x02080000
endif
ifeq ($(CONFIG_ARCH_A5K),y)
MACHINE = a5k
ARCHDIR = arc
......@@ -90,9 +88,6 @@ ARCHDIR = arc
COMPRESSED_EXTRA = $(TOPDIR)/arch/arm/lib/ll_char_wr.o
endif
ifeq ($(PROCESSOR),armv)
TEXTADDR = 0xC0008000
ifeq ($(CONFIG_ARCH_RPC),y)
MACHINE = rpc
ARCHDIR = rpc
......@@ -118,12 +113,22 @@ endif
ifeq ($(CONFIG_ARCH_NEXUSPCI),y)
MACHINE = nexuspci
ARCHDIR = nexuspci
TEXTADDR = 0xc0000000
ZTEXTADDR = 0x40200000
ZRELADDR = 0x40000000
ZRELADDR = 0x40008000
COMPRESSED_EXTRA = $(TOPDIR)/arch/arm/lib/ll_char_wr_scc.o
COMPRESSED_HEAD = head-nexuspci.o
endif
ifeq ($(CONFIG_ARCH_VNC),y)
MACHINE = vnc
ARCHDIR = vnc
endif
ifeq ($(CONFIG_ARCH_TBOX),y)
MACHINE = tbox
ARCHDIR = tbox
ZTEXTADDR = 0x80008000
ZRELDIR = 0x80008000
endif
PERL = perl
......@@ -144,23 +149,28 @@ CFLAGS := $(CFLAGS:-fomit-frame-pointer=)
endif
CFLAGS := $(CFLAGS_PROC) $(CFLAGS) -pipe
ASFLAGS := $(ASFLAGS_PROC) $(ASFLAGS)
LINKFLAGS = -T $(TOPDIR)/arch/arm/vmlinux.lds -e stext -Ttext $(TEXTADDR)
LINKFLAGS = -T $(TOPDIR)/arch/arm/vmlinux-$(PROCESSOR).lds -e stext -Ttext $(TEXTADDR)
ZLINKFLAGS = -Ttext $(ZTEXTADDR)
SUBDIRS := $(SUBDIRS:drivers=) arch/arm/lib arch/arm/kernel arch/arm/mm arch/arm/drivers
SUBDIRS := $(SUBDIRS:drivers=arch/arm/drivers) arch/arm/lib arch/arm/kernel arch/arm/mm
HEAD := arch/arm/kernel/head-$(PROCESSOR).o arch/arm/kernel/init_task.o
CORE_FILES := arch/arm/kernel/kernel.o arch/arm/mm/mm.o $(CORE_FILES)
LIBS := arch/arm/lib/lib.a $(LIBS) $(GCCLIB)
BLOCK_DRIVERS := arch/arm/drivers/block/block.a
CDROM_DRIVERS := drivers/cdrom/cdrom.a
ifeq ($(CONFIG_FB),y)
CHAR_DRIVERS := arch/arm/drivers/char1/char.a
else
CHAR_DRIVERS := arch/arm/drivers/char/char.a
endif
MISC_DRIVERS := drivers/misc/misc.a
NET_DRIVERS := drivers/net/net.a
PARIDE_DRIVERS := drivers/block/paride/paride.a
PCI_DRIVERS := drivers/pci/pci.a
SCSI_DRIVERS := drivers/scsi/scsi.a
SOUND_DRIVERS := drivers/sound/sound.a
VIDEO_DRIVERS := drivers/video/video.a
ifeq ($(CONFIG_ARCH_ACORN),y)
BLOCK_DRIVERS += drivers/acorn/block/acorn-block.a
......@@ -171,6 +181,9 @@ endif
DRIVERS := $(BLOCK_DRIVERS) $(CHAR_DRIVERS) $(MISC_DRIVERS) $(NET_DRIVERS)
ifeq ($(CONFIG_FB),y)
DRIVERS := $(DRIVERS) $(VIDEO_DRIVERS)
endif
ifeq ($(CONFIG_SCSI),y)
DRIVERS := $(DRIVERS) $(SCSI_DRIVERS)
endif
......@@ -192,7 +205,7 @@ symlinks::
(cd include/asm-arm; ln -sf arch-$(ARCHDIR) arch; ln -sf proc-$(PROCESSOR) proc)
# Once we've finished integrating the sources, the @$(MAKE) will disappear
mrproper::
archmrproper:
rm -f include/asm-arm/arch include/asm-arm/proc
@$(MAKE) -C arch/$(ARCH)/drivers mrproper
......@@ -202,6 +215,9 @@ arch/arm/kernel: dummy
arch/arm/mm: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/arm/mm
arch/arm/lib: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/arm/lib
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
zImage: vmlinux
......@@ -226,8 +242,6 @@ archclean:
@$(MAKEBOOT) clean
$(RM) arch/arm/lib/constants.h
archmrproper:
archdep:
@$(MAKEBOOT) dep
sed -e /^MACHINE..*=/s,= .*,= rpc,;/^PROCESSOR..*=/s,= .*,= armv, linux/arch/arm/Makefile.normal
......@@ -5,12 +5,19 @@
#
COMPRESSED_EXTRA=../../lib/ll_char_wr.o
OBJECTS=misc-debug.o $(COMPRESSED_EXTRA)
OBJECTS=misc-debug.o ll_char_wr.aout.o
CFLAGS=-D__KERNEL__ -O2 -DSTDC_HEADERS -DSTANDALONE_DEBUG -Wall -I../../../../include -c
test-gzip: piggy.o $(OBJECTS)
$(CC) -o $@ $(OBJECTS) piggy.o
test-gzip: piggy.aout.o $(OBJECTS)
$(CC) -o $@ $(OBJECTS) piggy.aout.o
misc-debug.o: misc.c
$(CC) $(CFLAGS) -o $@ misc.c
piggy.aout.o: piggy.o
arm-linuxelf-objcopy --change-leading-char -I elf32-arm -O arm-aout32-linux piggy.o piggy.aout.o
ll_char_wr.aout.o: $(COMPRESSED_EXTRA)
arm-linuxelf-objcopy --change-leading-char -I elf32-arm -O arm-aout32-linux $(COMPRESSED_EXTRA) ll_char_wr.aout.o
/*
* linux/arch/arm/boot/compressed/head-nexuspci.S
*
* Copyright (C) 1996 Philip Blundell
* Copyright (C) 1996, 1997, 1998 Philip Blundell
*
* NexusPCI is unusual because we don't have a bootloader -- the kernel is
* run directly out of ROM at the moment. Maybe this will change one day and
* then this file can go away.
*
*/
#define ARM_CP p15
#define ARM610_REG_CONTROL cr1
#define ARM_REG_ZERO cr0
.text
start: b skip1
b go_uncompress
b go_uncompress
b go_uncompress
b go_uncompress
.globl _start
_start: b reset
b undefined
b undefined
b undefined
b undefined
b undefined
b undefined
b undefined
b go_uncompress
b go_uncompress
b go_uncompress
b go_uncompress
b go_uncompress
skip1: mov sp, #0x40000000
add sp, sp, #0x200000
mov r2, #0x20000000
reset: mov r2, #0x20000000 @ LED off
mov r1, #0x1a
str r1, [r2]
MOV r0, #0x30
MCR ARM_CP, 0, r0, ARM610_REG_CONTROL, ARM_REG_ZERO
mov r2, #0x10000000
mov r2, #0x10000000 @ SCC init
mov r1, #42
strb r1, [r2, #8]
......@@ -57,37 +54,46 @@ skip1: mov sp, #0x40000000
mov r1, #5
strb r1, [r2, #0x8]
mov r0, #0x50
ldr r2, =_start
ldr r3, =_edata
mov r8, r2
mov r0, #0
1:
ldmia r0!, {r4, r5, r6, r7}
stmia r2!, {r4, r5, r6, r7}
cmp r2, r3
ble 1b
ldr r3, =_edata
ldr r1, =_end
mov r2, #0
1:
strb r2, [r3]
cmp r3, r1
beq 2f
add r3, r3, #1
b 1b
2:
add pc, r8, #0x20
undefined: ldr r4, =undef_msg
1: ldrb r0, [r4], #1
movs r0, r0
2: beq 2b
bl _ll_write_char
b 1b
mov r4, #0x40000000
mov r1, #0x00200000
add r4, r4, r1
copylp:
ldr r3, [r1]
str r3, [r4, r1]
subs r1, r1, #4
bne copylp
add pc, r4, #0x28
undef_msg: .ascii "Undefined instruction (or other problem)\000"
.align 4
/*
* Uncompress the kernel
*/
go_uncompress:
mov r0, #0x40000000
add r0, r0, #0x300000
bl _decompress_kernel
mov r0, #0x40000000
add r1, r0, #0x300000
mov r2, #0x100000
clp2: ldr r3, [r1, r2]
str r3, [r0, r2]
subs r2, r2, #4
bne clp2
mov r0, #0x40000000
ldr sp, =user_stack
add sp, sp, #4096
bl decompress_kernel
mov r2, #0x40000000
mov r0, #0
......
......@@ -20,7 +20,10 @@ start: mov r0, r0
mov r0, r0
mov r0, r0
mov r0, r0
teq r0, #0
b 1f
.word 0x016f2818 @ Magic numbers to help the loader
.word _start
1: teq r0, #0
beq 2f
mov r4, #0x02000000
add r4, r4, #0x7C000
......@@ -59,11 +62,13 @@ start: mov r0, r0
* Uncompress the kernel
*/
mov r1, #0x8000
add r2, r2, r1, lsl #1 @ Add 64k for malloc
add r3, r2, r1, lsl #1 @ Add 64k for malloc
sub r1, r1, #1
add r2, r2, r1
bic r5, r2, r1 @ decompress kernel to after end of the compressed
add r3, r3, r1
bic r5, r3, r1 @ decompress kernel to after end of the compressed
mov r0, r5
mov r1, r2
mov r2, r0
bl SYMBOL_NAME(decompress_kernel)
add r0, r0, #7
bic r2, r0, #7
......
......@@ -274,10 +274,10 @@ ulg user_stack [STACK_SIZE];
#ifndef STANDALONE_DEBUG
ulg decompress_kernel(ulg output_start)
ulg decompress_kernel(ulg output_start, ulg free_mem_ptr_p, ulg free_mem_ptr_end_p)
{
free_mem_ptr = (ulg)&end;
free_mem_ptr_end = output_start;
free_mem_ptr = free_mem_ptr_p;
free_mem_ptr_end = free_mem_ptr_end_p;
proc_decomp_setup ();
arch_decomp_setup ();
......
......@@ -172,7 +172,6 @@ CONFIG_PPP=m
CONFIG_ETHER1=m
CONFIG_ETHER3=m
CONFIG_ETHERH=m
CONFIG_CDROM=y
#
# Filesystems
......
......@@ -5,10 +5,11 @@
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <asm/ecard.h>
#include <asm/elf.h>
#include <asm/io.h>
#include <asm/delay.h>
#include <asm/dma.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
......@@ -73,6 +74,9 @@ EXPORT_SYMBOL(ecard_readchunk);
EXPORT_SYMBOL(ecard_address);
#endif
EXPORT_SYMBOL(enable_irq);
EXPORT_SYMBOL(disable_irq);
/* processor dependencies */
EXPORT_SYMBOL(processor);
......@@ -100,26 +104,23 @@ EXPORT_SYMBOL(quicklists);
EXPORT_SYMBOL(__bad_pmd);
EXPORT_SYMBOL(__bad_pmd_kernel);
#define EXPORT_VERS0(sym,orig) \
const char __kstrtab_##sym##[] __attribute__((section(".kstrtab"))) = \
__MODULE_STRING(##sym##_R00000000); \
const struct module_symbol __ksymtab_##sym __attribute__((section("__ksymtab"))) = \
{ (unsigned long)&##orig, __kstrtab_##sym };
/*
* floating point math emulator support.
* These symbols will never change their calling convention...
*/
EXPORT_SYMBOL_NOVERS(fpreturn);
EXPORT_SYMBOL_NOVERS(fpundefinstr);
EXPORT_SYMBOL_NOVERS(fp_enter);
EXPORT_SYMBOL_NOVERS(fp_save);
EXPORT_SYMBOL_NOVERS(fp_restore);
EXPORT_SYMBOL_NOVERS(fp_setup);
const char __kstrtab_fp_printk[] __attribute__((section(".kstrtab"))) = __MODULE_STRING(fp_printk);
const struct module_symbol __ksymtab_fp_printk __attribute__((section("__ksymtab"))) =
{ (unsigned long)&printk, __kstrtab_fp_printk };
const char __kstrtab_fp_send_sig[] __attribute__((section(".kstrtab"))) = __MODULE_STRING(fp_send_sig);
const struct module_symbol __ksymtab_fp_send_sig __attribute__((section("__ksymtab"))) =
{ (unsigned long)&send_sig, __kstrtab_fp_send_sig };
//EXPORT_SYMBOL_NOVERS(fp_current);
EXPORT_VERS0(fpreturn,fpreturn);
EXPORT_VERS0(fpundefinstr,fpundefinstr);
EXPORT_VERS0(fp_enter,fp_enter);
EXPORT_VERS0(fp_save,fp_save);
EXPORT_VERS0(fp_restore,fp_restore);
EXPORT_VERS0(fp_setup,fp_setup);
EXPORT_VERS0(fp_printk,printk);
EXPORT_VERS0(fp_send_sig,send_sig);
/*
* string / mem functions
......@@ -183,3 +184,8 @@ EXPORT_SYMBOL(change_bit);
EXPORT_SYMBOL(test_and_change_bit);
EXPORT_SYMBOL(find_first_zero_bit);
EXPORT_SYMBOL(find_next_zero_bit);
/* elf */
EXPORT_SYMBOL(armidlist);
EXPORT_SYMBOL(armidindex);
EXPORT_SYMBOL(elf_platform);
/*
* linux/arch/arm/lib/calls.h
*
* Copyright (C) 1995, 1996 Russell King
* Copyright (C) 1995-1998 Russell King
*
* This file is included twice in entry-common.S
*/
#ifndef NR_SYSCALLS
#ifndef NR_syscalls
#define NR_syscalls 256
#define NR_SYSCALLS 184
#else
/* 0 */ .long SYMBOL_NAME(sys_setup)
......@@ -24,7 +25,7 @@
.long SYMBOL_NAME(sys_time)
.long SYMBOL_NAME(sys_mknod)
/* 15 */ .long SYMBOL_NAME(sys_chmod)
.long SYMBOL_NAME(sys_chown)
.long SYMBOL_NAME(sys_lchown)
.long SYMBOL_NAME(sys_ni_syscall) /* was sys_break */
.long SYMBOL_NAME(sys_stat)
.long SYMBOL_NAME(sys_lseek)
......@@ -190,11 +191,13 @@
.long SYMBOL_NAME(sys_rt_sigsuspend_wrapper)
/* 180 */ .long SYMBOL_NAME(sys_pread)
.long SYMBOL_NAME(sys_pwrite)
#if 0
.long SYMBOL_NAME(sys_xstat)
.long SYMBOL_NAME(sys_xmknod)
#else
.space 8
#endif
.space (NR_syscalls - 184) * 4
.long SYMBOL_NAME(sys_chown)
.long SYMBOL_NAME(sys_getcwd)
.long SYMBOL_NAME(sys_capget)
/* 185 */ .long SYMBOL_NAME(sys_capset)
.long SYMBOL_NAME(sys_sigaltstack_wrapper)
.rept NR_syscalls-186
.long SYMBOL_NAME(sys_ni_syscall)
.endr
#endif
......@@ -109,6 +109,7 @@ __initfunc(void pcibios_fixup(void))
{
struct pci_dev *dev;
unsigned char pin;
unsigned int cmd;
for (dev = pci_devices; dev; dev = dev->next) {
pcibios_read_config_byte(dev->bus->number,
......@@ -127,6 +128,10 @@ __initfunc(void pcibios_fixup(void))
dev->bus->number, dev->devfn,
dev->vendor, dev->device,
pin, dev->irq);
/* Turn on bus mastering - boot loader doesn't - perhaps it should! */
pcibios_read_config_byte(dev->bus->number, dev->devfn, PCI_COMMAND, &cmd);
pcibios_write_config_byte(dev->bus->number, dev->devfn, PCI_COMMAND, cmd | PCI_COMMAND_MASTER);
}
}
......@@ -138,6 +143,10 @@ __initfunc(void pcibios_init(void))
printk("DEC21285 PCI revision %02X\n", rev);
}
__initfunc(void pcibios_fixup_bus(struct pci_bus *bus))
{
}
__initfunc(char *pcibios_setup(char *str))
{
return str;
......
......@@ -9,12 +9,15 @@
#include <linux/init.h>
#include <asm/dma.h>
#include <asm/fiq.h>
#include <asm/io.h>
#include <asm/hardware.h>
#include <asm/pgtable.h>
#include "dma.h"
static struct fiq_handler fh = { "floppydma", NULL };
int arch_request_dma(dmach_t channel, dma_t *dma, const char *dev_id)
{
if (channel == DMA_VIRTUAL_FLOPPY)
......@@ -26,13 +29,13 @@ int arch_request_dma(dmach_t channel, dma_t *dma, const char *dev_id)
void arch_free_dma(dmach_t channel, dma_t *dma)
{
if (channel != DMA_VIRTUAL_FLOPPY)
printk ("arch_free_dma: invalid channel %d\n", channel);
printk("arch_free_dma: invalid channel %d\n", channel);
}
int arch_get_dma_residue(dmach_t channel, dma_t *dma)
{
if (channel != DMA_VIRTUAL_FLOPPY)
printk ("arch_dma_count: invalid channel %d\n", channel);
printk("arch_dma_count: invalid channel %d\n", channel);
else {
extern int floppy_fiqresidual(void);
return floppy_fiqresidual();
......@@ -43,11 +46,11 @@ int arch_get_dma_residue(dmach_t channel, dma_t *dma)
void arch_enable_dma(dmach_t channel, dma_t *dma)
{
if (channel != DMA_VIRTUAL_FLOPPY)
printk ("arch_enable_dma: invalid channel %d\n", channel);
printk("arch_enable_dma: invalid channel %d\n", channel);
else {
void *fiqhandler_start;
unsigned int fiqhandler_length;
extern void floppy_fiqsetup (unsigned long len, unsigned long addr,
extern void floppy_fiqsetup(unsigned long len, unsigned long addr,
unsigned long port);
if (dma->dma_mode == DMA_MODE_READ) {
......@@ -59,19 +62,25 @@ void arch_enable_dma(dmach_t channel, dma_t *dma)
fiqhandler_start = &floppy_fiqout_start;
fiqhandler_length = &floppy_fiqout_end - &floppy_fiqout_start;
}
memcpy ((void *)0x1c, fiqhandler_start, fiqhandler_length);
if (claim_fiq(&fh)) {
printk("floppydma: couldn't claim FIQ.\n");
return;
}
memcpy((void *)0x1c, fiqhandler_start, fiqhandler_length);
flush_page_to_ram(0);
floppy_fiqsetup (dma->buf.length, __bus_to_virt(dma->buf.address), (int)PCIO_FLOPPYDMABASE);
enable_irq (dma->dma_irq);
floppy_fiqsetup(dma->buf.length, __bus_to_virt(dma->buf.address), (int)PCIO_FLOPPYDMABASE);
enable_irq(dma->dma_irq);
}
}
void arch_disable_dma(dmach_t channel, dma_t *dma)
{
if (channel != DMA_VIRTUAL_FLOPPY)
printk ("arch_disable_dma: invalid channel %d\n", channel);
else
disable_irq (dma->dma_irq);
printk("arch_disable_dma: invalid channel %d\n", channel);
else {
disable_irq(dma->dma_irq);
release_fiq(&fh);
}
}
__initfunc(void arch_dma_init(dma_t *dma))
......
......@@ -13,12 +13,15 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/dma.h>
#include <asm/fiq.h>
#include <asm/io.h>
#include <asm/hardware.h>
#include <asm/uaccess.h>
#include "dma.h"
static struct fiq_handler fh = { "floppydma", NULL };
#if 0
typedef enum {
dma_size_8 = 1,
......@@ -270,6 +273,10 @@ void arch_enable_dma(dmach_t channel, dma_t *dma)
fiqhandler_start = &floppy_fiqout_start;
fiqhandler_length = &floppy_fiqout_end - &floppy_fiqout_start;
}
if (claim_fiq(&fh)) {
printk("floppydma: couldn't claim FIQ.\n");
return;
}
/* Allow access to page 0 via domains */
__asm__ __volatile__("mcr p15, 0, %0, c3, c0" :
: "r" (DOMAIN_USER_MANAGER |
......
......@@ -9,12 +9,13 @@
* Note: there is a StrongARM bug in the STMIA rn, {regs}^ instruction that causes
* it to save wrong values... Be aware!
*/
#include <linux/config.h> /* for CONFIG_ARCH_EBSA110 */
#include <linux/config.h> /* for CONFIG_ARCH_xxxx */
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/errno.h>
#include <asm/hardware.h>
#include <asm/arch/irqs.h>
#include "../lib/constants.h"
......@@ -89,7 +90,7 @@
adreq \base, irq_prio_l
teq \irqstat, #0
ldrneb \irqnr, [r5, \irqstat] @ get IRQ number
ldrneb \irqnr, [\base, \irqstat] @ get IRQ number
.endm
/*
......@@ -159,7 +160,7 @@ irq_prio_h: .byte 0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
adr \base, irq_prio_ebsa110
teq \irqstat, #0
ldrneb \irqnr, [r5, \irqstat] @ get IRQ number
ldrneb \irqnr, [\base, \irqstat] @ get IRQ number
.endm
.macro irq_prio_table
......@@ -225,6 +226,65 @@ irq_prio_ebsa110:
.macro irq_prio_table
.endm
#elif defined(CONFIG_ARCH_VNC)
.macro disable_fiq
.endm
.macro get_irqnr_and_base, irqnr, irqstat, base
mov r4, #IO_BASE_ARM_CSR
ldr \irqstat, [r4, #IRQ_STATUS] @ just show us the unmasked ones
@ run through hard priorities
@ timer
tst \irqstat, #IRQ_MASK_TIMER0
movne \irqnr, #IRQ_TIMER0
bne 1f
@ ether10
tst \irqstat, #IRQ_MASK_ETHER10
movne \irqnr, #IRQ_ETHER10
bne 1f
@ ether100
tst \irqstat, #IRQ_MASK_ETHER100
movne \irqnr, #IRQ_ETHER100
bne 1f
@ video compressor
tst \irqstat, #IRQ_VIDCOMP_MASK
movne \irqnr, #IRQ_VIDCOMP
bne 1f
@ now try all the PIC sources
@ determine whether we have an irq
tst \irqstat, #IRQ_MASK_EXTERN_IRQ
beq 3f
mov r4, #(IO_BASE_PCI_IACK & 0xff000000)
orr r4, r4, #(IO_BASE_PCI_IACK & 0x00ff0000)
ldrb \irqnr, [r4] @ get the IACK byte
b 1f
3: @ PCI errors
tst \irqstat, #IRQ_MASK_PCI_ERR
movne \irqnr, #IRQ_PCI_ERR
bne 1f
@ softint
tst \irqstat, #IRQ_MASK_SOFT_IRQ
movne \irqnr, #IRQ_SOFT_IRQ
bne 1f
@ debug uart
tst \irqstat, #IRQ_MASK_UART_DEBUG
movne \irqnr, #IRQ_UART_DEBUG
bne 1f
@ watchdog
tst \irqstat, #IRQ_WATCHDOG_MASK
movne \irqnr, #IRQ_WATCHDOG
1: @ If Z is set, then we will not enter an interrupt
#else
#error Unknown architecture
#endif
......
......@@ -73,7 +73,7 @@ vector_swi: save_user_regs
bic r6, r6, #0xff000000 @ mask off SWI op-code
eor r6, r6, #OS_NUMBER<<20 @ check OS number
cmp r6, #NR_SYSCALLS @ check upper syscall limit
cmp r6, #NR_syscalls @ check upper syscall limit
bcs 2f
get_current_task r5
......@@ -133,7 +133,7 @@ vector_swi: save_user_regs
SYMBOL_NAME(sys_syscall):
mov r6, r0
eor r6, r6, #OS_NUMBER << 20
cmp r6, #NR_SYSCALLS @ check range
cmp r6, #NR_syscalls @ check range
movgt r0, #-ENOSYS
movgt pc, lr
add sp, sp, #4 @ take of the save of our r4
......@@ -193,6 +193,10 @@ sys_rt_sigreturn_wrapper:
add r0, sp, #4
b SYMBOL_NAME(sys_rt_sigreturn)
sys_sigaltstack_wrapper:
ldr r2, [sp, #4 + S_SP]
b do_sigaltstack
/*
*=============================================================================
* Low-level interface code
......
......@@ -22,18 +22,20 @@
* MMU off. Note! These should be unique!!! Please read Documentation/ARM-README
* for more information.
*
* r1 = 0 -> ebsa110 (Ram @ 0x00000000)
* r1 = 1 -> RPC (Ram @ 0x10000000)
* r1 = 2 -> ebsit (???)
* r1 = 0 -> ebsa110
* r1 = 1 -> RPC
* r1 = 2 -> ebsit
* r1 = 3 -> nexuspci
* r1 = 4 -> ebsa285 (Ram @ 0x00000000)
* r1 = 4 -> ebsa285
* r1 = 5 -> vnc
* r1 = 6 -> CATS
*/
ENTRY(stext)
ENTRY(_stext)
__entry:
teq r0, #0 @ check for illegal entry...
bne .Lerror @ loop indefinitely
cmp r1, #5 @ Unknown machine architecture
cmp r1, #7 @ Unknown machine architecture
bge .Lerror
@
@ First thing to do is to get the page tables set up so that we can call the kernel
......@@ -119,7 +121,8 @@ __entry:
@ we lose this page!
mov pc, lr
.Lerror: mov r0, #0x02000000
.Lerror:
1: mov r0, #0x02000000
mov r1, #0x11
orr r1, r1, r1, lsl #8
orr r1, r1, r1, lsl #16
......@@ -127,7 +130,7 @@ __entry:
str r1, [r0], #4
str r1, [r0], #4
str r1, [r0], #4
b .Lerror
b 1b
.Lbranch: .long .Lalready_done_mmap @ Real address of routine
......@@ -156,12 +159,22 @@ __entry:
.long 0
@ EBSA285
.long SYMBOL_NAME(swapper_pg_dir) - 0xc0000000 @ Address of page tables (physical)
.long SYMBOL_NAME(swapper_pg_dir) - 0xc0000000 @ Address of page tables (physical)
.long 0 @ Address of RAM
.long 0x24000000 @ I/O base address (0x42000000 -> 0xFE000000)
.long 0
@ Corel VNC
.long SYMBOL_NAME(swapper_pg_dir) - 0xc0000000 @ Address of page tables (physical)
.long 0 @ Address of RAM
.long 0x24000000 @ I/O base address (0x42000000 -> 0xfe000000)
.long 0
@ CATS
.long SYMBOL_NAME(swapper_pg_dir) - 0xc0000000 @ Address of page tables (physical)
.long 0 @ Address of RAM
.long 0x24000000 @ I/O base address (0x42000000 -> 0xfe000000)
.long 0
.LCProcTypes: @ ARM6 / 610
.long 0x41560600
......@@ -170,13 +183,20 @@ __entry:
b .Larmv3_flush_early @ arm v3 flush & ctrl early setup
mov pc, lr
@ ARM7 / 710
@ ARM7
.long 0x41007000
.long 0xfffff000
.long 0x00000c12
b .Larmv3_flush_late @ arm v3 flush & ctrl late setup
mov pc, lr
@ ARM710
.long 0x41007000
.long 0xfff8f000 @ arm710 processors are weird
.long 0x00000c12
b .Larmv3_flush_late @ arm v3 flush & ctrl late setup
mov pc, lr
@ StrongARM
.long 0x4401a100
.long 0xfffffff0
......@@ -267,6 +287,7 @@ __entry:
.macro busyuart,rd,rx
1002: ldrb \rd, [\rx, #0x14]
and \rd, \rd, #0x60
teq \rd, #0x60
bne 1002b
.endm
......@@ -289,6 +310,7 @@ __entry:
.macro busyuart,rd,rx
1002: ldrb \rd, [\rx, #0x14]
and \rd, \rd, #0x60
teq \rd, #0x60
bne 1002b
.endm
......@@ -298,7 +320,7 @@ __entry:
beq 1001b
.endm
#elif defined(CONFIG_ARCH_EBSA285)
#elif defined(CONFIG_ARCH_EBSA285) || defined(CONFIG_ARCH_VNC)
.macro addruart,rx
mov \rx, #0xfe000000
.endm
......
......@@ -6,8 +6,9 @@
* IIC is used to get the current time from the CMOS rtc.
*/
#include <linux/delay.h>
#include <asm/system.h>
#include <asm/delay.h>
#include <asm/io.h>
#include <asm/hardware.h>
......
......@@ -2,7 +2,8 @@
* linux/arch/arm/kernel/irq.c
*
* Copyright (C) 1992 Linus Torvalds
* Modifications for ARM processor Copyright (C) 1995, 1996 Russell King.
* Modifications for ARM processor Copyright (C) 1995-1998 Russell King.
* FIQ support written by Philip Blundell <philb@gnu.org>, 1998.
*
* This file contains the code used by various IRQ handling routines:
* asking for different IRQ's should be done through these routines
......@@ -30,14 +31,20 @@
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <asm/fiq.h>
#include <asm/hardware.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/system.h>
#include <asm/hardware.h>
#include <asm/arch/irq.h>
unsigned int local_bh_count[NR_CPUS];
unsigned int local_irq_count[NR_CPUS];
spinlock_t irq_controller_lock;
static struct fiq_handler *current_fiq;
static unsigned long no_fiq_insn;
#define FIQ_VECTOR ((unsigned long *)0x1c)
#ifndef SMP
#define irq_enter(cpu, irq) (++local_irq_count[cpu])
......@@ -46,6 +53,20 @@ spinlock_t irq_controller_lock;
#error SMP not supported
#endif
#ifdef CONFIG_ARCH_ACORN
/* Bitmask indicating valid interrupt numbers
* (to be moved to include/asm-arm/arch-*)
*/
unsigned long validirqs[NR_IRQS / 32] = {
0x003ffe7f, 0x000001ff, 0x000000ff, 0x00000000
};
#define valid_irq(x) ((x) < NR_IRQS && validirqs[(x) >> 5] & (1 << ((x) & 31)))
#else
#define valid_irq(x) ((x) < NR_IRQS)
#endif
void disable_irq(unsigned int irq_nr)
{
unsigned long flags;
......@@ -74,21 +95,6 @@ void enable_irq(unsigned int irq_nr)
struct irqaction *irq_action[NR_IRQS];
#ifdef CONFIG_ARCH_ACORN
/* Bitmask indicating valid interrupt numbers
* (to be moved to include/asm-arm/arch-*)
*/
unsigned long validirqs[NR_IRQS / 32] = {
0x003ffe7f, 0x000001ff, 0x000000ff, 0x00000000
};
#define valid_irq(x) ((x) < NR_IRQS && validirqs[(x) >> 5] & (1 << ((x) & 31)))
#else
#define valid_irq(x) ((x) < NR_IRQS)
#endif
int get_irq_list(char *buf)
{
int i;
......@@ -106,6 +112,8 @@ int get_irq_list(char *buf)
}
*p++ = '\n';
}
p += sprintf(p, "FIQ: %s\n",
current_fiq?current_fiq->name:"unused");
return p - buf;
}
......@@ -186,7 +194,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
}
}
#if defined(HAS_IOMD) || defined(HAS_IOC)
#if defined(CONFIG_ARCH_ACORN)
void do_ecard_IRQ(int irq, struct pt_regs *regs)
{
struct irqaction * action;
......@@ -336,9 +344,41 @@ int probe_irq_off (unsigned long irqs)
return i;
}
int claim_fiq(struct fiq_handler *f)
{
if (current_fiq) {
if (current_fiq->callback == NULL || (*current_fiq->callback)())
return -EBUSY;
}
current_fiq = f;
return 0;
}
void release_fiq(struct fiq_handler *f)
{
if (current_fiq != f) {
printk(KERN_ERR "%s tried to release FIQ when not owner!\n",
f->name);
#ifdef CONFIG_DEBUG_ERRORS
__backtrace();
#endif
return;
}
current_fiq = NULL;
*FIQ_VECTOR = no_fiq_insn;
__flush_entry_to_ram(FIQ_VECTOR);
}
__initfunc(void init_IRQ(void))
{
extern void init_dma(void);
irq_init_irq();
current_fiq = NULL;
no_fiq_insn = *FIQ_VECTOR;
init_dma();
}
......@@ -38,6 +38,8 @@
#include <asm/system.h>
#include <asm/io.h>
struct task_struct *last_task_used_math;
extern void fpe_save(struct fp_soft_struct *);
extern char *processor_modes[];
......@@ -171,18 +173,10 @@ void flush_thread(void)
current->flags &= ~PF_USEDFPU;
}
void release_segments(struct mm_struct *mm)
{
}
void release_thread(struct task_struct *dead_task)
{
}
void copy_segments(int nr, struct task_struct *p, struct mm_struct *new_mm)
{
}
int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
struct task_struct * p, struct pt_regs * regs)
{
......
......@@ -26,6 +26,7 @@
#include <linux/major.h>
#include <linux/utsname.h>
#include <linux/init.h>
#include <linux/console.h>
#include <asm/hardware.h>
#include <asm/pgtable.h>
......@@ -58,7 +59,7 @@ int armidindex;
extern int root_mountflags;
extern int _etext, _edata, _end;
static char command_line[COMMAND_LINE_SIZE] = { 0, };
static char command_line[COMMAND_LINE_SIZE] __initdata = { 0, };
char saved_command_line[COMMAND_LINE_SIZE];
#ifdef CONFIG_BLK_DEV_RAM
......@@ -164,6 +165,10 @@ __initfunc(void setup_arch(char **cmdline_p,
*memory_start_p = memory_start;
*memory_end_p = memory_end;
strcpy (system_utsname.machine, "sa110");
#ifdef CONFIG_FB
conswitchp = &fb_con;
#endif
}
int get_cpuinfo(char * buffer)
......
......@@ -27,7 +27,9 @@
#include <linux/utsname.h>
#include <linux/blk.h>
#include <linux/init.h>
#include <linux/console.h>
#include <asm/elf.h>
#include <asm/hardware.h>
#include <asm/io.h>
#include <asm/pgtable.h>
......@@ -38,7 +40,9 @@
#include <asm/arch/mmu.h>
struct drive_info_struct { char dummy[32]; } drive_info;
struct screen_info screen_info;
struct screen_info screen_info = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8
};
struct processor processor;
unsigned char aux_device_present;
......@@ -49,27 +53,39 @@ extern const struct processor arm6_processor_functions;
extern const struct processor arm7_processor_functions;
extern const struct processor sa110_processor_functions;
struct armversions armidlist[] = {
char elf_platform[ELF_PLATFORM_SIZE];
const struct armversions armidlist[] = {
/*-- Match -- --- Mask -- -- Manu -- Processor uname -m --- ELF STUFF ---
--- processor asm funcs --- */
#if defined(CONFIG_CPU_26)
{ 0x41560200, 0xfffffff0, F_MEMC , "ARM/VLSI", "arm2" , &arm2_processor_functions , "arm2"},
{ 0x41560250, 0xfffffff0, F_MEMC , "ARM/VLSI", "arm250" , &arm250_processor_functions , "arm3"},
{ 0x41560300, 0xfffffff0, F_MEMC|F_CACHE, "ARM/VLSI", "arm3" , &arm3_processor_functions , "arm3"},
{ 0x41560200, 0xfffffff0, "ARM/VLSI", "arm2" , "armv1" , "v1", 0,
&arm2_processor_functions },
{ 0x41560250, 0xfffffff0, "ARM/VLSI", "arm250" , "armv2" , "v2", HWCAP_SWP,
&arm250_processor_functions },
{ 0x41560300, 0xfffffff0, "ARM/VLSI", "arm3" , "armv2" , "v2", HWCAP_SWP,
&arm3_processor_functions },
#elif defined(CONFIG_CPU_32)
{ 0x41560600, 0xfffffff0, F_MMU|F_32BIT , "ARM/VLSI", "arm6" , &arm6_processor_functions , "arm6"},
{ 0x41560610, 0xfffffff0, F_MMU|F_32BIT , "ARM/VLSI", "arm610" , &arm6_processor_functions , "arm6"},
{ 0x41007000, 0xffffff00, F_MMU|F_32BIT , "ARM/VLSI", "arm7" , &arm7_processor_functions , "arm6"},
{ 0x41007100, 0xffffff00, F_MMU|F_32BIT , "ARM/VLSI", "arm710" , &arm7_processor_functions , "arm6"},
{ 0x4401a100, 0xfffffff0, F_MMU|F_32BIT , "DEC", "sa110" , &sa110_processor_functions , "sa1x"},
{ 0x41560600, 0xfffffff0, "ARM/VLSI", "arm6" , "armv3" , "v3", HWCAP_SWP,
&arm6_processor_functions },
{ 0x41560610, 0xfffffff0, "ARM/VLSI", "arm610" , "armv3" , "v3", HWCAP_SWP,
&arm6_processor_functions },
{ 0x41007000, 0xffffff00, "ARM/VLSI", "arm7" , "armv3" , "v3", HWCAP_SWP,
&arm7_processor_functions },
/* ARM710 IDs are non-standard */
{ 0x41007100, 0xfff8ff00, "ARM/VLSI", "arm710" , "armv3" , "v3", HWCAP_SWP,
&arm7_processor_functions },
{ 0x4401a100, 0xfffffff0, "DEC", "sa110" , "armv4" , "v3", HWCAP_SWP|HWCAP_HALF,
&sa110_processor_functions },
#endif
{ 0x00000000, 0x00000000, 0 , "***", "*unknown*" , NULL , NULL }
{ 0x00000000, 0x00000000, "***", "unknown", "unknown", "**", 0, NULL }
};
static struct param_struct *params = (struct param_struct *)PARAMS_BASE;
static const struct param_struct *params = (struct param_struct *)PARAMS_BASE;
unsigned long arm_id;
unsigned int vram_half_sam;
int armidindex;
int ioebpresent;
int memc_ctrl_reg;
int number_ide_drives;
int number_mfm_drives;
......@@ -91,9 +107,11 @@ extern unsigned long real_end_mem;
*/
#ifdef CONFIG_ARCH_RPC
extern void init_dram_banks(struct param_struct *params);
extern void
init_dram_banks(const struct param_struct *params);
static void setup_rpc (struct param_struct *params)
static void
setup_rpc(const struct param_struct *params)
{
init_dram_banks(params);
......@@ -123,11 +141,12 @@ extern int rd_doload; /* 1 = load ramdisk, 0 = don't load */
extern int rd_prompt; /* 1 = prompt for ramdisk, 0 = don't prompt */
extern int rd_image_start; /* starting block # of image */
static void setup_ramdisk (struct param_struct *params)
static void
setup_ramdisk(const struct param_struct *params)
{
rd_image_start = params->u1.s.rd_start;
rd_prompt = (params->u1.s.flags & FLAG_RDPROMPT) == 0;
rd_doload = (params->u1.s.flags & FLAG_RDLOAD) == 0;
rd_image_start = params->u1.s.rd_start;
rd_prompt = (params->u1.s.flags & FLAG_RDPROMPT) == 0;
rd_doload = (params->u1.s.flags & FLAG_RDLOAD) == 0;
}
#else
#define setup_ramdisk(p)
......@@ -137,33 +156,30 @@ static void setup_ramdisk (struct param_struct *params)
* initial ram disk
*/
#ifdef CONFIG_BLK_DEV_INITRD
static void setup_initrd (struct param_struct *params, unsigned long memory_end)
static void
setup_initrd(const struct param_struct *params, unsigned long memory_end)
{
initrd_start = params->u1.s.initrd_start;
initrd_end = params->u1.s.initrd_start + params->u1.s.initrd_size;
if (initrd_end > memory_end) {
printk ("initrd extends beyond end of memory "
"(0x%08lx > 0x%08lx) - disabling initrd\n",
initrd_end, memory_end);
initrd_start = 0;
}
}
#else
#define setup_initrd(p,m)
#endif
if (params->u1.s.initrd_start) {
initrd_start = params->u1.s.initrd_start;
initrd_end = initrd_start + params->u1.s.initrd_size;
} else {
initrd_start = 0;
initrd_end = 0;
}
#ifdef IOEB_BASE
static inline void check_ioeb_present(void)
{
if (((*IOEB_BASE) & 15) == 5)
armidlist[armidindex].features |= F_IOEB;
if (initrd_end > memory_end) {
printk ("initrd extends beyond end of memory "
"(0x%08lx > 0x%08lx) - disabling initrd\n",
initrd_end, memory_end);
initrd_start = 0;
}
}
#else
#define check_ioeb_present()
#define setup_initrd(p,m)
#endif
static inline void get_processor_type (void)
static inline void
get_processor_type(void)
{
for (armidindex = 0; ; armidindex ++)
if (!((armidlist[armidindex].id ^ arm_id) &
......@@ -186,7 +202,7 @@ static inline void get_processor_type (void)
/* Can this be initdata? --pb
* command_line can be, saved_command_line can't though
*/
static char command_line[COMMAND_LINE_SIZE] = { 0, };
static char command_line[COMMAND_LINE_SIZE] __initdata = { 0, };
char saved_command_line[COMMAND_LINE_SIZE];
__initfunc(void setup_arch(char **cmdline_p,
......@@ -194,7 +210,8 @@ __initfunc(void setup_arch(char **cmdline_p,
{
static unsigned char smptrap;
unsigned long memory_start, memory_end;
char c = ' ', *to = command_line, *from;
char endian = 'l', c = ' ', *to = command_line;
char *from;
int len = 0;
if (smptrap == 1)
......@@ -202,12 +219,13 @@ __initfunc(void setup_arch(char **cmdline_p,
smptrap = 1;
get_processor_type ();
check_ioeb_present ();
processor._proc_init ();
#ifndef CONFIG_FB
bytes_per_char_h = params->u1.s.bytes_per_char_h;
bytes_per_char_v = params->u1.s.bytes_per_char_v;
from = params->commandline;
#endif
from = (char *)params->commandline;
ROOT_DEV = to_kdev_t (params->u1.s.rootdev);
ORIG_X = params->u1.s.video_x;
ORIG_Y = params->u1.s.video_y;
......@@ -217,8 +235,8 @@ __initfunc(void setup_arch(char **cmdline_p,
number_ide_drives = (params->u1.s.adfsdrives >> 6) & 3;
number_mfm_drives = (params->u1.s.adfsdrives >> 3) & 3;
setup_rpc (params);
setup_ramdisk (params);
setup_rpc(params);
setup_ramdisk(params);
if (!(params->u1.s.flags & FLAG_READONLY))
root_mountflags &= ~MS_RDONLY;
......@@ -264,36 +282,73 @@ __initfunc(void setup_arch(char **cmdline_p,
*memory_start_p = memory_start;
*memory_end_p = memory_end;
setup_initrd (params, memory_end);
setup_initrd(params, memory_end);
sprintf(system_utsname.machine, "%s%c", armidlist[armidindex].arch_vsn, endian);
sprintf(elf_platform, "%s%c", armidlist[armidindex].elf_vsn, endian);
strcpy (system_utsname.machine, armidlist[armidindex].name);
#ifdef CONFIG_FB
conswitchp = &fb_con;
#endif
}
#define ISSET(bit) (armidlist[armidindex].features & bit)
#if defined(CONFIG_ARCH_ARC)
#define HARDWARE "Acorn-Archimedes"
#define IO_BUS "Acorn"
#elif defined(CONFIG_ARCH_A5K)
#define HARDWARE "Acorn-A5000"
#define IO_BUS "Acorn"
#elif defined(CONFIG_ARCH_RPC)
#define HARDWARE "Acorn-RiscPC"
#define IO_BUS "Acorn"
#elif defined(CONFIG_ARCH_EBSA110)
#define HARDWARE "DEC-EBSA110"
#define IO_BUS "DEC"
#elif defined(CONFIG_ARCH_EBSA285)
#define HARDWARE "DEC-EBSA285"
#define IO_BUS "PCI"
#elif defined(CONFIG_ARCH_NEXUSPCI)
#define HARDWARE "Nexus-NexusPCI"
#define IO_BUS "PCI"
#elif defined(CONFIG_ARCH_VNC)
#define HARDWARE "Corel-VNC"
#define IO_BUS "PCI"
#else
#define HARDWARE "unknown"
#define IO_BUS "unknown"
#endif
#if defined(CONFIG_CPU_ARM2)
#define OPTIMISATION "ARM2"
#elif defined(CONFIG_CPU_ARM3)
#define OPTIMISATION "ARM3"
#elif defined(CONFIG_CPU_ARM6)
#define OPTIMISATION "ARM6"
#elif defined(CONFIG_CPU_ARM7)
#define OPTIMISATION "ARM7"
#elif defined(CONFIG_CPU_SA110)
#define OPTIMISATION "StrongARM"
#else
#define OPTIMISATION "unknown"
#endif
int get_cpuinfo(char * buffer)
{
int len;
len = sprintf (buffer, "CPU:\n"
"Type\t\t: %s\n"
"Revision\t: %d\n"
"Manufacturer\t: %s\n"
"32bit modes\t: %s\n"
"BogoMips\t: %lu.%02lu\n",
armidlist[armidindex].name,
(int)arm_id & 15,
armidlist[armidindex].manu,
ISSET (F_32BIT) ? "yes" : "no",
(loops_per_sec+2500) / 500000,
((loops_per_sec+2500) / 5000) % 100);
len += sprintf (buffer + len,
"\nHardware:\n"
"Mem System\t: %s\n"
"IOEB\t\t: %s\n",
ISSET(F_MEMC) ? "MEMC" :
ISSET(F_MMU) ? "MMU" : "*unknown*",
ISSET(F_IOEB) ? "present" : "absent"
);
len = sprintf(buffer,
"Processor\t: %s %s rev %d\n"
"BogoMips\t: %lu.%02lu\n"
"Hardware\t: %s\n"
"Optimisation\t: %s\n"
"IO Bus\t: %s\n",
armidlist[armidindex].manu,
armidlist[armidindex].name,
(int)arm_id & 15,
(loops_per_sec+2500) / 500000,
((loops_per_sec+2500) / 5000) % 100,
HARDWARE,
OPTIMISATION,
IO_BUS);
return len;
}
......@@ -4,7 +4,7 @@
* Copyright (C) 1995, 1996 Russell King
*/
#include <linux/config.h> /* for CONFIG_CPU_ARM6 and CONFIG_CPU_SA110 */
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp.h>
......@@ -37,7 +37,6 @@ extern int ptrace_set_bpt (struct task_struct *);
*/
asmlinkage int sys_sigsuspend(int restart, unsigned long oldmask, old_sigset_t mask, struct pt_regs *regs)
{
sigset_t saveset;
mask &= _BLOCKABLE;
......
......@@ -239,7 +239,6 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, struct
lock_kernel();
if (!newsp)
newsp = regs->ARM_sp;
ret = do_fork(clone_flags, newsp, regs);
unlock_kernel();
return ret;
......
......@@ -24,11 +24,11 @@
#include <linux/init.h>
#include <linux/smp.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/delay.h>
#include <linux/timex.h>
#include <asm/hardware.h>
......
......@@ -24,6 +24,7 @@
#include <asm/atomic.h>
#include <asm/pgtable.h>
extern struct task_struct *last_task_used_math;
extern void fpe_save(struct fp_soft_struct *);
extern void fpe_restore(struct fp_soft_struct *);
extern void die_if_kernel(char *str, struct pt_regs *regs, int err, int ret);
......@@ -306,7 +307,7 @@ asmlinkage void arm_syscall (int no, struct pt_regs *regs)
asmlinkage void deferred(int n, struct pt_regs *regs)
{
dump_state("old system call", regs, 0);
dump_state("old system call", regs, n);
force_sig (SIGILL, current);
}
......
......@@ -6,7 +6,7 @@
L_TARGET := lib.a
L_OBJS := backtrace.o bitops.o checksum.o delay.o fp_support.o \
loaders.o memcpy.o system.o string.o uaccess.o
loaders.o memcpy.o system.o string.o uaccess.o io.o
ifeq ($(PROCESSOR),armo)
L_OBJS += uaccess-armo.o
......
......@@ -24,7 +24,7 @@ while (<DATA>) {
/elf32/ && ( $elf = 1 );
/a.out/ && ( $aout = 1 );
next if ($aout && ! / 07 /);
next if ($elf && ! (/^00...... g/ && /.data/));
next if ($elf && ! (/^0*0...... g/ && /.data/));
next if (!$aout && !$elf);
if ($aout) {
......@@ -33,7 +33,7 @@ while (<DATA>) {
}
if ($elf) {
chomp;
$addr = substr ($_, 0, 8);
$addr = substr ($_, 0, index($_, " "));
$name = substr ($_, rindex($_, " ") + 1);
$nam[hex($addr)] = $name;
}
......
/*
* linux/arch/arm/lib/getconstants.c
*
* Copyright (C) 1995, 1996 Russell King
*/
#include <linux/mm.h>
#include <asm/pgtable.h>
#include <stdio.h>
#include <linux/unistd.h>
void printdef(char *def, int no)
{
printf("#define %s\t%d\n", def, no);
}
#include "getconstants.h"
int main()
{
printf("/*\n * contants.h generated by getconstants\n * DO NOT EDIT!\n */\n");
printf("#define _current\t_%s\n", "current_set");
#ifdef _PAGE_PRESENT
printdef("PAGE_PRESENT", _PAGE_PRESENT);
#endif
#ifdef _PAGE_RW
printdef("PAGE_RW", _PAGE_RW);
#endif
#ifdef _PAGE_USER
printdef("PAGE_USER", _PAGE_USER);
#endif
#ifdef _PAGE_ACCESSED
printdef("PAGE_ACCESSED", _PAGE_ACCESSED);
#endif
#ifdef _PAGE_DIRTY
printdef("PAGE_DIRTY", _PAGE_DIRTY);
#endif
#ifdef _PAGE_READONLY
printdef("PAGE_READONLY", _PAGE_READONLY);
#endif
#ifdef _PAGE_NOT_USER
printdef("PAGE_NOT_USER", _PAGE_NOT_USER);
#endif
#ifdef _PAGE_OLD
printdef("PAGE_OLD", _PAGE_OLD);
#endif
#ifdef _PAGE_CLEAN
printdef("PAGE_CLEAN", _PAGE_CLEAN);
#endif
printdef("TSS_MEMMAP", (int)tss_memmap);
printdef("TSS_SAVE", (int)tss_save);
#ifdef __HAS_tss_memcmap
printdef("TSS_MEMCMAP", (int)tss_memcmap);
#endif
#ifdef __HAS_addr_limit
printdef("ADDR_LIMIT", (int)addr_limit);
#endif
#ifdef __HAS_kernel_domain
printdef("KERNEL_DOMAIN", kernel_domain);
#endif
#ifdef __HAS_user_domain
printdef("USER_DOMAIN", user_domain);
#endif
printdef("TSS_FPESAVE", (int)tss_fpesave);
printdef("MM", (int)mm);
printdef("PGD", (int)pgd);
printf("#define KSWI_BASE 0x900000\n");
printf("#define KSWI_SYS_BASE 0x9F0000\n");
printf("#define SYS_ERROR0 0x9F0000\n");
return 0;
}
/*
* *** THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT! ***
*/
unsigned long addr_limit = 56;
#define __HAS_addr_limit
unsigned long tss_memmap = 640;
#define __HAS_tss_memmap
unsigned long mm = 1676;
#define __HAS_mm
unsigned long pgd = 8;
#define __HAS_pgd
unsigned long tss_save = 636;
#define __HAS_tss_save
unsigned long tss_fpesave = 492;
#define __HAS_tss_fpesave
unsigned long tss_memcmap = 644;
#define __HAS_tss_memcmap
......@@ -97,12 +97,50 @@ ENTRY(outsl)
bne 4b
mov pc, lr
/* Nobody could say these are optimal, but not to worry. */
ENTRY(outsw)
ENTRY(outswb)
mov r2, r2, lsr #1
ENTRY(outsw)
add r0, r0, #0xff000000
add r0, r0, #0x00e00000
1: teq r2, #0
ldrneh r3, [r1], #2
strneh r3, [r0]
subne r2, r2, #1
bne 1b
mov pc, lr
ENTRY(insw)
ENTRY(inswb)
mov r2, r2, lsr #1
ENTRY(insw)
add r0, r0, #0xff000000
add r0, r0, #0x00e00000
1: teq r2, #0
ldrneh r3, [r0]
strneh r3, [r1], #2
subne r2, r2, #1
bne 1b
mov pc, lr
ENTRY(insb)
add r0, r0, #0xff000000
add r0, r0, #0x00e00000
1: teq r2, #0
ldrneb r3, [r0]
strneb r3, [r1], #1
subne r2, r2, #1
bne 1b
mov pc, lr
ENTRY(outsb)
add r0, r0, #0xff000000
add r0, r0, #0x00e00000
1: teq r2, #0
ldrneb r3, [r1], #1
strneb r3, [r0]
subne r2, r2, #1
bne 1b
mov pc, lr
#include <asm/io.h>
/*
* Copy data from IO memory space to "real" memory space.
* This needs to be optimized.
*/
void _memcpy_fromio(void * to, unsigned long from, unsigned long count)
{
while (count) {
count--;
*(char *) to = readb(from);
((char *) to)++;
from++;
}
}
/*
* Copy data from "real" memory space to IO memory space.
* This needs to be optimized.
*/
void _memcpy_toio(unsigned long to, void * from, unsigned long count)
{
while (count) {
count--;
writeb(*(char *) from, to);
((char *) from)++;
to++;
}
}
/*
* "memset" on IO memory space.
* This needs to be optimized.
*/
void _memset_io(unsigned long dst, int c, unsigned long count)
{
while (count) {
count--;
writeb(c, dst);
dst++;
}
}
......@@ -28,8 +28,6 @@
#define FAULT_CODE_WRITE 0x02
#define FAULT_CODE_USER 0x01
#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
struct pgtable_cache_struct quicklists;
void __bad_pmd(pmd_t *pmd)
......
/*
* arch/arm/mm/mm-a5k.c
*
* Extra MM routines for the Archimedes architecture
*
* Copyright (C) 1998 Russell King
*/
......@@ -5,6 +5,7 @@
*
* Copyright (C) 1998 Russell King
*/
#include <linux/init.h>
#include <asm/hardware.h>
#include <asm/pgtable.h>
......@@ -13,7 +14,7 @@ unsigned long phys_screen_end;
/*
* This routine needs more work to make it dynamically release/allocate mem!
*/
unsigned long map_screen_mem(unsigned long log_start, unsigned long kmem, int update)
__initfunc(unsigned long map_screen_mem(unsigned long log_start, unsigned long kmem, int update))
{
static int updated = 0;
......@@ -75,8 +76,7 @@ unsigned long map_screen_mem(unsigned long log_start, unsigned long kmem, int up
phys_screen_end = offset;
flush_tlb_all ();
update_mm_cache_all ();
update_memc_all ();
}
return kmem;
}
/*
* arch/arm/mm/mm-armv.c
*
* Common routines for ARM v3 and v4 architectures.
*
* Copyright (C) 1998 Russell King
*
* Do not compile this file directly!
*/
#ifndef MAPPING
#error MAPPING not defined - do not compile this file individually
#endif
static const struct mapping {
unsigned long virtual;
unsigned long physical;
unsigned long length;
int domain:4,
prot_read:1,
prot_write:1;
} mapping[] __initdata = {
MAPPING
};
#define SIZEOFMAP (sizeof(mapping) / sizeof(mapping[0]))
__initfunc(unsigned long setup_io_pagetables(unsigned long start_mem))
{
const struct mapping *mp;
int i;
for (i = 0, mp = mapping; i < SIZEOFMAP; i++, mp++) {
unsigned long virtual, physical, length;
int prot;
virtual = mp->virtual;
physical = mp->physical;
length = mp->length;
prot = (mp->prot_read ? PTE_AP_READ : 0) | (mp->prot_write ? PTE_AP_WRITE : 0);
while ((virtual & 1048575 || physical & 1048575) && length >= PAGE_SIZE) {
alloc_init_page(&start_mem, virtual, physical, mp->domain, prot);
length -= PAGE_SIZE;
virtual += PAGE_SIZE;
physical += PAGE_SIZE;
}
prot = (mp->prot_read ? PMD_SECT_AP_READ : 0) |
(mp->prot_write ? PMD_SECT_AP_WRITE : 0);
while (length >= 1048576) {
alloc_init_section(&start_mem, virtual, physical, mp->domain, prot);
length -= 1048576;
virtual += 1048576;
physical += 1048576;
}
prot = (mp->prot_read ? PTE_AP_READ : 0) | (mp->prot_write ? PTE_AP_WRITE : 0);
while (length >= PAGE_SIZE) {
alloc_init_page(&start_mem, virtual, physical, mp->domain, prot);
length -= PAGE_SIZE;
virtual += PAGE_SIZE;
physical += PAGE_SIZE;
}
}
return start_mem;
}
/*
* arch/arm/mm/mm-ebsa110.c
*
* Extra MM routines for the Archimedes architecture
* Extra MM routines for the EBSA-110 architecture
*
* Copyright (C) 1998 Russell King
*/
#include <linux/init.h>
#include <asm/io.h>
/* map in IO */
void setup_io_pagetables(void)
{
unsigned long address = IO_START;
int spi = IO_BASE >> PGDIR_SHIFT;
pgd_val(swapper_pg_dir[spi-1]) = 0xc0000000 | PMD_TYPE_SECT |
PMD_DOMAIN(DOMAIN_KERNEL) | PMD_SECT_AP_WRITE;
#define MAPPING \
{ IO_BASE - PGDIR_SIZE , 0xc0000000 , PGDIR_SIZE , DOMAIN_IO, 0, 1 }, \
{ IO_BASE , IO_START , IO_SIZE , DOMAIN_IO, 0, 1 }
while (address < IO_START + IO_SIZE && address) {
pgd_val(swapper_pg_dir[spi++]) = address | PMD_TYPE_SECT |
PMD_DOMAIN(DOMAIN_IO) |
PMD_SECT_AP_WRITE;
address += PGDIR_SIZE;
}
}
#include "mm-armv.c"
......@@ -3,16 +3,47 @@
*
* Extra MM routines for the EBSA285 architecture
*
* Copyright (C) 1998 Russell King
* Copyright (C) 1998 Russell King, Dave Gilbert.
*/
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/io.h>
#include <asm/proc/mm-init.h>
/*
* These two functions convert PCI bus addresses to virtual addresses
* and back again.
*/
unsigned long __virt_to_bus(unsigned long res)
{
if (res < PAGE_OFFSET || res >= 0xD0000000) {
printk("__virt_to_bus: invalid address 0x%08lx\n", res);
#ifdef CONFIG_DEBUG_ERRORS
__backtrace();
#endif
} else
res = (res - PAGE_OFFSET) + 0x10000000;
return res;
}
unsigned long __bus_to_virt(unsigned long res)
{
if (res < 0x10000000 || res >= 0x20000000) {
printk("__bus_to_virt: invalid address 0x%08lx\n", res);
#ifdef CONFIG_DEBUG_ERRORS
__backtrace();
#endif
} else
res = (res - 0x10000000) + PAGE_OFFSET;
return res;
}
/* Logical Physical
* 0xfff00000 0x40000000 X-Bus
* 0xffe00000 0x7c000000 PCI I/O space
......@@ -23,75 +54,25 @@
* 0xf8000000 0x7b000000 PCI Config type 0
*/
static struct mapping {
unsigned long virtual;
unsigned long physical;
unsigned long length;
} io_mapping[] = {
/*
* This is to allow us to fiddle with the EEPROM
* This entry will go away in time
*/
{ 0xd8000000, 0x41000000, 0x00400000 },
/*
* These ones are so that we can fiddle
* with the various cards (eg VGA)
* until we're happy with them...
*/
{ 0xdc000000, 0x7c000000, 0x00100000 },
{ 0xe0000000, 0x80000000, 0x10000000 },
{ 0xf8000000, 0x7b000000, 0x01000000 }, /* Type 0 Config */
{ 0xf9000000, 0x7a000000, 0x01000000 }, /* Type 1 Config */
{ 0xfc000000, 0x79000000, 0x01000000 }, /* PCI IACK */
{ 0xfd000000, 0x78000000, 0x01000000 }, /* Outbound wflsh*/
{ 0xfe000000, 0x42000000, 0x01000000 }, /* CSR */
{ 0xffe00000, 0x7c000000, 0x00100000 }, /* PCI I/O */
{ 0xfff00000, 0x40000000, 0x00100000 }, /* X-Bus */
};
#define SIZEOFIO (sizeof(io_mapping) / sizeof(io_mapping[0]))
/* map in IO */
unsigned long setup_io_pagetables(unsigned long start_mem)
{
struct mapping *mp;
int i;
for (i = 0, mp = io_mapping; i < SIZEOFIO; i++, mp++) {
while ((mp->virtual & 1048575 || mp->physical & 1048575) && mp->length >= PAGE_SIZE) {
alloc_init_page(&start_mem, mp->virtual, mp->physical, DOMAIN_IO,
PTE_AP_WRITE);
mp->length -= PAGE_SIZE;
mp->virtual += PAGE_SIZE;
mp->physical += PAGE_SIZE;
}
while (mp->length >= 1048576) {
if (mp->virtual > 0xf0000000)
alloc_init_section(&start_mem, mp->virtual, mp->physical, DOMAIN_IO,
PMD_SECT_AP_WRITE);
else
alloc_init_section(&start_mem, mp->virtual, mp->physical, DOMAIN_USER, PMD_SECT_AP_WRITE | PMD_SECT_AP_READ);
mp->length -= 1048576;
mp->virtual += 1048576;
mp->physical += 1048576;
}
while (mp->length >= PAGE_SIZE) {
alloc_init_page(&start_mem, mp->virtual, mp->physical, DOMAIN_IO,
PTE_AP_WRITE);
mp->length -= PAGE_SIZE;
mp->virtual += PAGE_SIZE;
mp->physical += PAGE_SIZE;
}
}
return start_mem;
}
/*
* This is to allow us to fiddle with the EEPROM
* This entry will go away in time, once the fmu
* can mmap() the flash.
*
* These ones are so that we can fiddle
* with the various cards (eg VGA)
* until we're happy with them...
*/
#define MAPPING \
{ 0xd8000000, 0x41000000, 0x00400000, DOMAIN_USER, 1, 1 }, /* EEPROM */ \
{ 0xdc000000, 0x7c000000, 0x00100000, DOMAIN_USER, 1, 1 }, /* VGA */ \
{ 0xe0000000, 0x80000000, 0x10000000, DOMAIN_USER, 1, 1 }, /* VGA */ \
{ 0xf8000000, 0x7b000000, 0x01000000, DOMAIN_IO , 0, 1 }, /* Type 0 Config */ \
{ 0xf9000000, 0x7a000000, 0x01000000, DOMAIN_IO , 0, 1 }, /* Type 1 Config */ \
{ 0xfc000000, 0x79000000, 0x01000000, DOMAIN_IO , 0, 1 }, /* PCI IACK */ \
{ 0xfd000000, 0x78000000, 0x01000000, DOMAIN_IO , 0, 1 }, /* Outbound wflsh*/ \
{ 0xfe000000, 0x42000000, 0x01000000, DOMAIN_IO , 0, 1 }, /* CSR */ \
{ 0xffe00000, 0x7c000000, 0x00100000, DOMAIN_IO , 0, 1 }, /* PCI I/O */ \
{ 0xfff00000, 0x40000000, 0x00100000, DOMAIN_IO , 0, 1 }, /* X-Bus */
#include "mm-armv.c"
......@@ -4,25 +4,24 @@
*
* Extra MM routines for the NexusPCI architecture
*
* Copyright (C) 1998 Phil Blundell
* Copyright (C) 1998 Russell King
*/
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/io.h>
#include <asm/proc/mm-init.h>
/* map in IO */
void setup_io_pagetables(void)
{
unsigned long address = IO_START;
int spi = IO_BASE >> PGDIR_SHIFT;
pgd_val(swapper_pg_dir[spi-1]) = 0xc0000000 | PMD_TYPE_SECT |
PMD_DOMAIN(DOMAIN_KERNEL) | PMD_SECT_AP_WRITE;
while (address < IO_START + IO_SIZE && address) {
pgd_val(swapper_pg_dir[spi++]) = address | PMD_TYPE_SECT |
PMD_DOMAIN(DOMAIN_IO) |
PMD_SECT_AP_WRITE;
address += PGDIR_SIZE;
}
}
#define MAPPING \
{ 0xfff00000, 0x10000000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffe00000, 0x20000000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffc00000, 0x60000000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xfe000000, 0x80000000, 0x00100000, DOMAIN_IO, 0, 1 }, \
{ 0xfd000000, 0x88000000, 0x00100000, DOMAIN_IO, 0, 1 }
#include "mm-armv.c"
......@@ -5,9 +5,9 @@
*
* Copyright (C) 1998 Russell King
*/
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <asm/pgtable.h>
#include <asm/setup.h>
......@@ -88,50 +88,10 @@ void init_dram_banks(struct param_struct *params)
current->tss.memmap = __virt_to_phys((unsigned long)swapper_pg_dir);
}
static struct mapping {
unsigned long virtual;
unsigned long physical;
unsigned long length;
} io_mapping[] = {
{ SCREEN2_BASE, SCREEN_START, 2*1048576 }, /* VRAM */
{ IO_BASE, IO_START, IO_SIZE } /* IO space */
};
#define SIZEOFIO (sizeof(io_mapping) / sizeof(io_mapping[0]))
/* map in IO */
unsigned long setup_io_pagetables(unsigned long start_mem)
{
struct mapping *mp;
int i;
for (i = 0, mp = io_mapping; i < SIZEOFIO; i++, mp++) {
while ((mp->virtual & 1048575 || mp->physical & 1048575) && mp->length >= PAGE_SIZE) {
alloc_init_page(&start_mem, mp->virtual, mp->physical, DOMAIN_IO,
PTE_AP_WRITE);
mp->length -= PAGE_SIZE;
mp->virtual += PAGE_SIZE;
mp->physical += PAGE_SIZE;
}
while (mp->length >= 1048576) {
alloc_init_section(&start_mem, mp->virtual, mp->physical, DOMAIN_IO,
PMD_SECT_AP_WRITE);
mp->length -= 1048576;
mp->virtual += 1048576;
mp->physical += 1048576;
}
while (mp->length >= PAGE_SIZE) {
alloc_init_page(&start_mem, mp->virtual, mp->physical, DOMAIN_IO,
PTE_AP_WRITE);
mp->length -= PAGE_SIZE;
mp->virtual += PAGE_SIZE;
mp->physical += PAGE_SIZE;
}
}
return start_mem;
}
#define MAPPING \
{ SCREEN2_BASE, SCREEN_START, 2*1048576, DOMAIN_IO, 0, 1 }, /* VRAM */ \
{ IO_BASE, IO_START, IO_SIZE , DOMAIN_IO, 0, 1 } /* IO space */
/*
* Include common routine to set up page tables
*/
#include "mm-armv.c"
/*
* arch/arm/mm/mm-tbox.c
* from arch/arm/mm/mm-ebsa110.c
*
* Extra MM routines for the Tbox architecture
*
* Copyright (C) 1998 Phil Blundell
* Copyright (C) 1998 Russell King
*/
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/proc/mm-init.h>
/* Logical Physical
* 0xffff1000 0x00100000 DMA registers
* 0xffff2000 0x00200000 MPEG
* 0xffff3000 0x00300000 FPGA1 local control
* 0xffff4000 0x00400000 External serial
* 0xffff5000 0x00500000 Internal serial
* 0xffff6000 0x00600000 Parallel
* 0xffff7000 0x00700000 Interrupt control
* 0xffff8000 0x00800000 Computer video
* 0xffff9000 0x00900000 Control register 0
* 0xffffs000 0x00a00000 Control register 1
* 0xffffb000 0x00b00000 Control register 2
* 0xffffc000 0x00c00000 FPGA2 local control
* 0xffffd000 0x00d00000 Interrupt reset
* 0xffffe000 0x00e00000 MPEG DMA throttle
*/
#define MAPPING \
{ 0xffff0000, 0x01000000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffff1000, 0x00100000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffff2000, 0x00200000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffff3000, 0x00300000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffff4000, 0x00400000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xfe000000, 0x00400000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffff5000, 0x00500000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffff6000, 0x00600000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffff7000, 0x00700000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffff8000, 0x00800000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffff9000, 0x00900000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffffa000, 0x00a00000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffffb000, 0x00b00000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffffc000, 0x00c00000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffffd000, 0x00d00000, 0x00001000, DOMAIN_IO, 0, 1 }, \
{ 0xffffe000, 0x00e00000, 0x00001000, DOMAIN_IO, 0, 1 }
#include "mm-armv.c"
/*
* arch/arm/mm/mm-vnc.c
*
* Extra MM routines for the Corel VNC architecture
*
* Copyright (C) 1998 Russell King
*/
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/io.h>
#include <asm/proc/mm-init.h>
/* Table describing the MMU translation mapping
* mainly used to set up the I/O mappings.
*/
#define MAPPING \
{ 0xe0000000, DC21285_PCI_IO, 0x00100000, DOMAIN_IO, 0, 1 }, /* PCI I/O */ \
{ 0xe0100000, DC21285_PCI_TYPE_0_CONFIG, 0x00f00000, DOMAIN_IO, 0, 1 }, /* Type 0 Config */ \
{ 0xe1000000, DC21285_ARMCSR_BASE, 0x00100000, DOMAIN_IO, 0, 1 }, /* ARM CSR */ \
{ 0xe1100000, DC21285_PCI_IACK, 0x00100000, DOMAIN_IO, 0, 1 }, /* PCI IACK */ \
{ 0xe1300000, DC21285_OUTBOUND_WRITE_FLUSH, 0x00100000, DOMAIN_IO, 0, 1 }, /* Out wrflsh */ \
{ 0xe1400000, DC21285_OUTBOUND_WRITE_FLUSH, 0x00100000, DOMAIN_IO, 0, 1 }, /* Out wrflsh */ \
{ 0xe1500000, DC21285_OUTBOUND_WRITE_FLUSH, 0x00100000, DOMAIN_IO, 0, 1 }, /* Out wrflsh */ \
{ 0xe1600000, DC21285_OUTBOUND_WRITE_FLUSH, 0x00100000, DOMAIN_IO, 0, 1 }, /* Out wrflsh */ \
{ 0xe1700000, DC21285_OUTBOUND_WRITE_FLUSH, 0x00100000, DOMAIN_IO, 0, 1 }, /* Out wrflsh */ \
{ 0xe1800000, DC21285_FLASH, 0x00800000, DOMAIN_IO, 0, 1 } /* Flash */
#include "mm-armv.c"
......@@ -347,12 +347,11 @@ _arm6_7_proc_fin:
*
* Purpose : Set a PMD and flush it out of any WB cache
*/
_arm6_set_pmd: and r2, r1, #3
teq r2, #2
andeq r2, r1, #8
orreq r1, r1, r2, lsl #1 @ Updatable = Cachable
_arm6_set_pmd: and r2, r1, #11
teq r2, #1
orreq r1, r1, #16 @ Updatable = 1 if Page table
teqne r2, #9
teqne r2, #10
orreq r1, r1, #16 @ Updatable = 1 if Page table/Cacheable section
str r1, [r0]
mov pc, lr
......@@ -364,7 +363,8 @@ _arm6_set_pmd: and r2, r1, #3
*
* Purpose : Set a PMD and flush it out of any WB cache
*/
_arm7_set_pmd: orr r1, r1, #16 @ Updatable bit is always set on ARM7
_arm7_set_pmd: tst r1, #3
orrne r1, r1, #16 @ Updatable bit is always set on ARM7
str r1, [r0]
mov pc, lr
......
/* ld script to make ARM Linux kernel
* taken from the i386 version
* Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
*/
OUTPUT_FORMAT("elf32-arm", "elf32-arm", "elf32-arm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
_text = .; /* Text and read-only data */
.text : {
*(.text)
*(.fixup)
*(.gnu.warning)
} = 0x9090
.text.lock : { *(.text.lock) } /* out-of-line lock text */
.rodata : { *(.rodata) }
.kstrtab : { *(.kstrtab) }
. = ALIGN(16); /* Exception table */
__start___ex_table = .;
__ex_table : { *(__ex_table) }
__stop___ex_table = .;
__start___ksymtab = .; /* Kernel symbol table */
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
_etext = .; /* End of text section */
.data : { /* Data */
*(.data)
CONSTRUCTORS
}
_edata = .; /* End of data section */
/* This has to be aligned to a page boundary to do us any good. This
alignment is overkill for ARM6 up but needed for ARM3. Since all this
data will be thrown away I don't think the extra padding will hurt.
-- pb */
. = ALIGN(4096); /* Init code and data */
__init_begin = .;
.text.init : { *(.text.init) }
.data.init : { *(.data.init) }
. = ALIGN(4096);
__init_end = .;
__bss_start = .; /* BSS */
.bss : {
*(.bss)
}
_end = . ;
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
}
......@@ -269,7 +269,6 @@ CONFIG_82C710_MOUSE=y
# CONFIG_VIDEO_DEV is not set
# CONFIG_NVRAM is not set
# CONFIG_JOYSTICK is not set
# CONFIG_MISC_RADIO is not set
#
# Ftape, the floppy tape device driver
......
/*
* bios32.c - Low-Level PCI Access
*
* $Id: bios32.c,v 1.37 1998/06/19 17:11:37 mj Exp $
* $Id: bios32.c,v 1.40 1998/07/16 21:16:03 mj Exp $
*
* Copyright 1993, 1994 Drew Eckhardt
* Visionary Computing
......@@ -80,7 +80,6 @@
#include <asm/segment.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/smp.h>
#include <asm/spinlock.h>
......@@ -795,7 +794,7 @@ __initfunc(void pcibios_sort(void))
break;
}
}
if (!idx) {
if (e == dev) {
printk("PCI: Device %02x:%02x not found by BIOS\n",
dev->bus->number, dev->devfn);
d = dev;
......@@ -869,6 +868,46 @@ __initfunc(void pcibios_fixup_io_addr(struct pci_dev *dev, int idx))
pcibios_write_config_word(bus, devfn, PCI_COMMAND, cmd);
}
/*
* Several buggy motherboards address only 16 devices and mirror
* them to next 16 IDs. We try to detect this `feature' on all
* primary busses (those containing host bridges as they are
* expected to be unique) and remove the ghost devices.
*/
__initfunc(void pcibios_fixup_ghosts(struct pci_bus *b))
{
struct pci_dev *d, *e, **z;
int mirror = PCI_DEVFN(16,0);
int seen_host_bridge = 0;
DBG("PCI: Scanning for ghost devices on bus %d\n", b->number);
for(d=b->devices; d && d->devfn < mirror; d=d->sibling) {
if ((d->class >> 8) == PCI_CLASS_BRIDGE_HOST)
seen_host_bridge++;
for(e=d->next; e; e=e->sibling)
if (e->devfn == d->devfn + mirror &&
e->vendor == d->vendor &&
e->device == d->device &&
e->class == d->class &&
!memcmp(e->base_address, d->base_address, sizeof(e->base_address)))
break;
if (!e)
return;
}
if (!seen_host_bridge)
return;
printk("PCI: Ignoring ghost devices on bus %d\n", b->number);
for(e=b->devices; e->sibling != d; e=e->sibling);
e->sibling = NULL;
for(z=&pci_devices; (d=*z);)
if (d->bus == b && d->devfn >= mirror) {
*z = d->next;
kfree_s(d, sizeof(*d));
} else
z = &d->next;
}
/*
* In case there are peer host bridges, scan bus behind each of them.
* Although several sources claim that the host bridges should have
......@@ -962,7 +1001,7 @@ __initfunc(void pcibios_fixup_devices(void))
}
#endif
/*
* Fix out-of-range IRQ numbers and report bogus IRQ.
* Fix out-of-range IRQ numbers
*/
if (dev->irq >= NR_IRQS)
dev->irq = 0;
......@@ -984,6 +1023,11 @@ __initfunc(void pcibios_fixup(void))
#endif
}
__initfunc(void pcibios_fixup_bus(struct pci_bus *b))
{
pcibios_fixup_ghosts(b);
}
/*
* Initialization. Try all known PCI access methods. Note that we support
* using both PCI BIOS and direct access: in such cases, we use I/O ports
......
......@@ -147,8 +147,13 @@ __initfunc(void setup_arch(char **cmdline_p,
memory_end = memory_alt_end;
}
#endif
if (memory_end > (1024-64)*1024*1024)
memory_end = (1024-64)*1024*1024;
#define VMALLOC_RESERVE (64 << 20) /* 64MB for vmalloc */
#define MAXMEM ((unsigned long)(-PAGE_OFFSET-VMALLOC_RESERVE))
if (memory_end > MAXMEM)
memory_end = MAXMEM;
memory_end &= PAGE_MASK;
#ifdef CONFIG_BLK_DEV_RAM
rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK;
......
......@@ -587,6 +587,10 @@ __initfunc(void pcibios_fixup(void))
hades_fixup();
}
__initfunc(void pcibios_fixup_bus(struct pci_bus *bus))
{
}
__initfunc(char *pcibios_setup(char *str))
{
return str;
......
......@@ -129,4 +129,13 @@ int pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn,
return pci_ops->pcibios_write_config_dword(bus, dev_fn, where, val);
}
__initfunc(void pcibios_fixup_bus(struct pci_bus *bus))
{
}
__initfunc(char *pcibios_setup(char *str))
{
return str;
}
#endif /* defined(CONFIG_PCI) */
......@@ -245,6 +245,10 @@ __initfunc(void pcibios_fixup(void))
}
}
__initfunc(void pcibios_fixup_bus(struct pci_bus *bus))
{
}
__initfunc(char *pcibios_setup(char *str))
{
return str;
......
......@@ -2381,6 +2381,10 @@ asmlinkage int sys_pciconfig_write(unsigned long bus,
return err;
}
__initfunc(void pcibios_fixup_bus(struct pci_bus *bus))
{
}
__initfunc(char *pcibios_setup(char *str))
{
return str;
......
......@@ -87,6 +87,8 @@
* 17/1/97:RMK: Upgraded to 2.1 kernels.
*
* 4/3/98:RMK: Changed major number to 21.
*
* 27/6/98:RMK: Changed asm/delay.h to linux/delay.h for mdelay().
*/
/*
......@@ -109,15 +111,15 @@
#include <linux/genhd.h>
#include <linux/major.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#define MAJOR_NR MFM_ACORN_MAJOR
#include <linux/blk.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/irq-no.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
#include <asm/delay.h>
#include <asm/dma.h>
#include <asm/hardware.h>
#include <asm/ecard.h>
......
......@@ -52,6 +52,7 @@ static inline int serial_register_onedev (unsigned long port, int irq)
req.baud_base = MY_BAUD_BASE;
req.irq = irq;
req.port = port;
req.flags = 0;
return register_serial(&req);
}
......
......@@ -15,4 +15,3 @@
#define MY_PORT_ADDRESS(port,cardaddress) \
((cardaddress) + (port) * 8)
#include "serial-card.c"
......@@ -27,13 +27,18 @@
* 1.10 RMK 15/07/1997 Fixed autoprobing of NQ8004.
* 1.11 RMK 16/11/1997 Fixed autoprobing of NQ8005A.
* 1.12 RMK 31/12/1997 Removed reference to dev_tint for Linux 2.1.
*
* RMK 27/06/1998 Changed asm/delay.h to linux/delay.h.
* 1.13 RMK 29/06/1998 Fixed problem with transmission of packets.
* Chip seems to have a bug in, whereby if the
* packet starts two bytes from the end of the
* buffer, it corrupts the receiver chain, and
* never updates the transmit status correctly.
* TODO:
* When we detect a fatal error on the interface, we should restart it.
* Reap transmit packets after some time even if the buffer never filled.
*/
static char *version = "ether3 ethernet driver (c) 1995-1998 R.M.King v1.12\n";
static char *version = "ether3 ethernet driver (c) 1995-1998 R.M.King v1.13\n";
#include <linux/module.h>
#include <linux/kernel.h>
......@@ -51,20 +56,16 @@ static char *version = "ether3 ethernet driver (c) 1995-1998 R.M.King v1.12\n";
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <asm/ecard.h>
#include <asm/delay.h>
#include <asm/io.h>
#include <asm/irq.h>
#include "ether3.h"
#ifndef MODULE
#define CLAIM_IRQ_AT_OPEN
#endif
static unsigned int net_debug = NET_DEBUG;
static const card_ids ether3_cids[] = {
{ MANU_ANT2, PROD_ANT_ETHER3 },
......@@ -135,7 +136,7 @@ ether3_setbuffer(struct device *dev, buffer_rw_t read, int start)
#define ether3_writelong(dev,data) { \
unsigned long reg_bufwin = REG_BUFWIN; \
outw((data), reg_bufwin); \
outw((data) >> 16, reg_bufwin); \
outw((data) >> 16, reg_bufwin); \
}
/*
......@@ -263,6 +264,7 @@ ether3_init_2(struct device *dev))
priv->regs.config1 = CFG1_RECVCOMPSTAT0|CFG1_DMABURST8;
priv->regs.config2 = CFG2_CTRLO|CFG2_RECVCRC|CFG2_ERRENCRC;
priv->regs.command = 0;
/*
* Set up our hardware address
*/
......@@ -311,6 +313,10 @@ ether3_init_for_open(struct device *dev)
memset(&priv->stats, 0, sizeof(struct enet_statistics));
/* Reset the chip */
outw(CFG2_RESET, REG_CONFIG2);
udelay(4);
priv->regs.command = 0;
outw(CMD_RXOFF|CMD_TXOFF, REG_COMMAND);
while (inw(REG_STATUS) & (STAT_RXON|STAT_TXON));
......@@ -425,12 +431,8 @@ ether3_probe1(struct device *dev))
/* Fill in the fields of the device structure with ethernet values. */
ether_setup(dev);
#ifndef CLAIM_IRQ_AT_OPEN
if (request_irq(dev->irq, ether3_interrupt, 0, "ether3", dev))
error = EAGAIN;
else
#endif
return 0;
return 0;
}
failed:
......@@ -475,20 +477,19 @@ ether3_probe(struct device *dev))
static int
ether3_open(struct device *dev)
{
ether3_init_for_open(dev);
MOD_INC_USE_COUNT;
#ifdef CLAIM_IRQ_AT_OPEN
if (request_irq(dev->irq, ether3_interrupt, 0, "ether3", dev)) {
MOD_DEC_USE_COUNT;
return -EAGAIN;
}
#endif
dev->tbusy = 0;
dev->interrupt = 0;
dev->start = 1;
ether3_init_for_open(dev);
return 0;
}
......@@ -511,10 +512,7 @@ ether3_close(struct device *dev)
outb(0x80, REG_CONFIG2 + 1);
outw(0, REG_COMMAND);
enable_irq(dev->irq);
#ifdef CLAIM_IRQ_AT_OPEN
free_irq(dev->irq, dev);
#endif
MOD_DEC_USE_COUNT;
return 0;
......@@ -545,8 +543,7 @@ static void ether3_setmulticastlist(struct device *dev)
if (dev->flags & IFF_PROMISC) {
/* promiscuous mode */
priv->regs.config1 |= CFG1_RECVPROMISC;
} else
if (dev->flags & IFF_ALLMULTI) {
} else if (dev->flags & IFF_ALLMULTI) {
priv->regs.config1 |= CFG1_RECVSPECBRMULTI;
} else
priv->regs.config1 |= CFG1_RECVSPECBROAD;
......@@ -571,7 +568,7 @@ ether3_sendpacket(struct sk_buff *skb, struct device *dev)
unsigned int length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
unsigned int ptr, nextptr;
length = (length + 1) & ~1;
length = (length + 3) & ~3;
if (priv->broken) {
dev_kfree_skb(skb);
......@@ -589,32 +586,42 @@ ether3_sendpacket(struct sk_buff *skb, struct device *dev)
priv->tx_head = nextptr;
save_flags_cli(flags);
#define TXHDR_FLAGS (TXHDR_TRANSMIT|TXHDR_CHAINCONTINUE|TXHDR_DATAFOLLOWS|TXHDR_ENSUCCESS)
ether3_setbuffer(dev, buffer_write, nextptr);
ether3_writelong(dev, 0);
ether3_setbuffer(dev, buffer_write, ptr + 4);
ether3_writebuffer(dev, skb->data, length);
ether3_writeword(dev, htons(nextptr));
ether3_writeword(dev, (TXHDR_TRANSMIT|TXHDR_CHAINCONTINUE) >> 16);
ether3_setbuffer(dev, buffer_write, ptr);
#define TXHDR_FLAGS (TXHDR_TRANSMIT|TXHDR_CHAINCONTINUE|TXHDR_DATAFOLLOWS|TXHDR_ENSUCCESS)
ether3_writeword(dev, htons(ptr + length + 4));
ether3_writeword(dev, (TXHDR_FLAGS >> 16));
ether3_writeword(dev, TXHDR_FLAGS >> 16);
ether3_ledon(dev, priv);
priv->tx_used ++;
if (priv->tx_used < MAX_TX_BUFFERED)
dev->tbusy = 0;
if (priv->tx_used >= (MAX_TX_BUFFERED * 3 / 4)) {
priv->regs.command |= CMD_ENINTTX;
outw(priv->regs.command, REG_COMMAND);
}
restore_flags(flags);
dev->trans_start = jiffies;
dev_kfree_skb(skb);
if (!(inw(REG_STATUS) & STAT_TXON)) {
outw(ptr, REG_TRANSMITPTR);
outw(priv->regs.command | CMD_TXON, REG_COMMAND);
}
if (priv->tx_used < MAX_TX_BUFFERED)
dev->tbusy = 0;
dev->trans_start = jiffies;
restore_flags(flags);
dev_kfree_skb(skb);
return 0;
} else {
printk("%s: transmitter access conflict.\n", dev->name);
......@@ -625,12 +632,27 @@ ether3_sendpacket(struct sk_buff *skb, struct device *dev)
* There should really be a "kick me" function call instead.
*/
int tickssofar = jiffies - dev->trans_start;
unsigned long flags;
if (tickssofar < 5)
return 1;
del_timer(&priv->timer);
printk("%s: transmit timed out, network cable problem?\n", dev->name);
save_flags_cli(flags);
printk(KERN_ERR "%s: transmit timed out, network cable problem?\n", dev->name);
printk(KERN_ERR "%s: state: { status=%04X cfg1=%04X cfg2=%04X }\n", dev->name,
inw(REG_STATUS), inw(REG_CONFIG1), inw(REG_CONFIG2));
printk(KERN_ERR "%s: { rpr=%04X rea=%04X tpr=%04X }\n", dev->name,
inw(REG_RECVPTR), inw(REG_RECVEND), inw(REG_TRANSMITPTR));
printk(KERN_ERR "%s: tx head=%04X tx tail=%04X\n", dev->name,
priv->tx_head, priv->tx_tail);
ether3_setbuffer(dev, buffer_read, priv->tx_tail);
printk(KERN_ERR "%s: packet status = %08X\n", dev->name, ether3_readlong(dev));
restore_flags(flags);
dev->tbusy = 0;
priv->regs.config2 |= CFG2_CTRLO;
priv->stats.tx_errors += 1;
outw(priv->regs.config2 , REG_CONFIG2);
dev->trans_start = jiffies;
goto retry;
......@@ -709,7 +731,8 @@ ether3_rx(struct device *dev, struct dev_priv *priv, unsigned int maxcnt)
ether3_setbuffer(dev, buffer_read, next_ptr);
temp_ptr = ether3_readword(dev);
status = ether3_readword(dev);
if (!(status & RXSTAT_DONE) || !temp_ptr)
if ((status & (RXSTAT_DONE | RXHDR_CHAINCONTINUE | RXHDR_RECEIVE)) !=
(RXSTAT_DONE | RXHDR_CHAINCONTINUE) || !temp_ptr)
break;
this_ptr = next_ptr + 4;
......@@ -754,7 +777,7 @@ ether3_rx(struct device *dev, struct dev_priv *priv, unsigned int maxcnt)
} else {
struct enet_statistics *stats = &priv->stats;
outw(next_ptr >> 8, REG_RECVEND);
if (status & RXSTAT_OVERSIZE) stats->rx_length_errors ++;
if (status & RXSTAT_OVERSIZE) stats->rx_over_errors ++;
if (status & RXSTAT_CRCERROR) stats->rx_crc_errors ++;
if (status & RXSTAT_DRIBBLEERROR) stats->rx_fifo_errors ++;
if (status & RXSTAT_SHORTPACKET) stats->rx_length_errors ++;
......@@ -804,6 +827,7 @@ ether3_tx(struct device *dev, struct dev_priv *priv)
do {
unsigned long status;
/*
* Read the packet header
*/
......@@ -813,7 +837,8 @@ ether3_tx(struct device *dev, struct dev_priv *priv)
/*
* Check to see if this packet has been transmitted
*/
if (!(status & TXSTAT_DONE) || !(status & TXHDR_TRANSMIT))
if ((status & (TXSTAT_DONE | TXHDR_TRANSMIT)) !=
(TXSTAT_DONE | TXHDR_TRANSMIT))
break;
/*
......
......@@ -36,11 +36,11 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <asm/ecard.h>
#include <asm/delay.h>
#include <asm/io.h>
#include <asm/irq.h>
......@@ -525,8 +525,8 @@ static char ethernames[MAX_ETHERH_CARDS][9];
static struct device *my_ethers[MAX_ETHERH_CARDS];
static struct expansion_card *ec[MAX_ETHERH_CARDS];
int
init_module(void)
static int
init_all_cards(void)
{
struct device *dev = NULL;
struct expansion_card *boguscards[MAX_ETHERH_CARDS];
......@@ -550,6 +550,7 @@ init_module(void)
if (!io[i]) {
if ((ec[i] = ecard_find (0, etherh_cids)) == NULL)
continue;
if (!dev)
return -ENOMEM;
......@@ -567,7 +568,7 @@ init_module(void)
my_ethers[i] = dev;
if (register_netdev (my_ethers[i]) != 0) {
if (register_netdev(dev) != 0) {
printk (KERN_WARNING "No etherh card found at %08lX\n", dev->base_addr);
if (ec[i]) {
boguscards[i] = ec[i];
......@@ -578,16 +579,36 @@ init_module(void)
found ++;
dev = NULL;
}
if (dev)
kfree (dev);
for (i = 0; i < MAX_ETHERH_CARDS; i++)
if (boguscards[i]) {
boguscards[i]->ops = NULL;
ecard_release (boguscards[i]);
}
if (!found)
return -ENODEV;
return 0;
return found ? 0 : -ENODEV;
}
int
init_module(void)
{
int ret;
if (load_8390_module(__FILE__))
return -ENOSYS;
lock_8390_module();
ret = init_all_cards();
if (ret) {
unlock_8390_module();
}
return ret;
}
void
......@@ -607,5 +628,6 @@ cleanup_module(void)
ec[i] = NULL;
}
}
unlock_8390_module();
}
#endif /* MODULE */
......@@ -20,6 +20,7 @@
* reconnect race condition causing a warning message.
* 12-Oct-1997 RMK Added catch for re-entering interrupt routine.
* 15-Oct-1997 RMK Improved handling of commands.
* 27-Jun-1998 RMK Changed asm/delay.h to linux/delay.h.
*/
#define DEBUG_NO_WRITE 1
#define DEBUG_QUEUES 2
......@@ -136,8 +137,9 @@
#include <linux/stat.h>
#include <linux/ioport.h>
#include <linux/blk.h>
#include <linux/delay.h>
#include <asm/bitops.h>
#include <asm/delay.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/ecard.h>
......
......@@ -128,7 +128,7 @@ int cumanascsi_detect(Scsi_Host_Template * tpnt)
outb(0x00, instance->io_port - 577);
if (instance->irq != IRQ_NONE)
if (request_irq(instance->irq, cumanascsi_intr, SA_INTERRUPT, "CumanaSCSI-1", NULL)) {
if (request_irq(instance->irq, do_cumanascsi_intr, SA_INTERRUPT, "CumanaSCSI-1", NULL)) {
printk("scsi%d: IRQ%d not free, interrupts disabled\n",
instance->host_no, instance->irq);
instance->irq = IRQ_NONE;
......
......@@ -90,7 +90,7 @@ use_clustering: DISABLE_CLUSTERING \
#define NCR5380_read(reg) cumanascsi_read(_instance, reg)
#define NCR5380_write(reg, value) cumanascsi_write(_instance, reg, value)
#define NCR5380_intr cumanascsi_intr
#define do_NCR5380_intr do_cumanascsi_intr
#define NCR5380_queue_command cumanascsi_queue_command
#define NCR5380_abort cumanascsi_abort
#define NCR5380_reset cumanascsi_reset
......
......@@ -8,6 +8,7 @@
* 22-01-1998 RMK 0.0.1 Updated to 2.1.80
* 15-04-1998 RMK 0.0.1 Only do PIO if FAS216 will allow it.
* 02-05-1998 RMK 0.0.2 Updated & added DMA support
* 27-06-1998 RMK Changed asm/delay.h to linux/delay.h
*/
#include <linux/module.h>
......@@ -19,8 +20,8 @@
#include <linux/proc_fs.h>
#include <linux/unistd.h>
#include <linux/stat.h>
#include <linux/delay.h>
#include <asm/delay.h>
#include <asm/dma.h>
#include <asm/ecard.h>
#include <asm/io.h>
......@@ -72,6 +73,11 @@
static struct expansion_card *ecs[MAX_ECARDS];
MODULE_AUTHOR("Russell King");
MODULE_DESCRIPTION("Cumana SCSI II driver");
MODULE_PARM(term, "1-8i");
MODULE_PARM_DESC(term, "SCSI bus termination");
/*
* Use term=0,1,0,0,0 to turn terminators on/off
*/
......@@ -250,7 +256,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
if (!(status & STATUS_DRQ))
continue;
word = *addr | (*addr + 1) << 8;
word = *addr | *(addr + 1) << 8;
outw (info->dmaarea);
addr += 2;
length -= 2;
......@@ -361,6 +367,7 @@ cumanascsi_2_detect(Scsi_Host_Template *tpnt)
info->info.ifcfg.asyncperiod = CUMANASCSI2_ASYNC_PERIOD;
info->info.ifcfg.sync_max_depth = CUMANASCSI2_SYNC_DEPTH;
info->info.ifcfg.cntl3 = CNTL3_BS8 | CNTL3_FASTSCSI | CNTL3_FASTCLK;
info->info.ifcfg.disconnect_ok = 1;
info->info.dma.setup = cumanascsi_2_dma_setup;
info->info.dma.pseudo = cumanascsi_2_dma_pseudo;
info->info.dma.stop = cumanascsi_2_dma_stop;
......
......@@ -131,7 +131,7 @@ int ecoscsi_detect(Scsi_Host_Template * tpnt)
request_region (instance->io_port, instance->n_io_port, "ecoscsi");
if (instance->irq != IRQ_NONE)
if (request_irq(instance->irq, ecoscsi_intr, SA_INTERRUPT, "ecoscsi", NULL)) {
if (request_irq(instance->irq, do_ecoscsi_intr, SA_INTERRUPT, "ecoscsi", NULL)) {
printk("scsi%d: IRQ%d not free, interrupts disabled\n",
instance->host_no, instance->irq);
instance->irq = IRQ_NONE;
......
......@@ -81,7 +81,7 @@ use_clustering: DISABLE_CLUSTERING \
#define NCR5380_read(reg) ecoscsi_read(_instance, reg)
#define NCR5380_write(reg, value) ecoscsi_write(_instance, reg, value)
#define NCR5380_intr ecoscsi_intr
#define do_NCR5380_intr do_ecoscsi_intr
#define NCR5380_queue_command ecoscsi_queue_command
#define NCR5380_abort ecoscsi_abort
#define NCR5380_reset ecoscsi_reset
......
......@@ -14,6 +14,7 @@
* 14-03-1998 RMK Updated DMA support
* Added terminator control
* 15-04-1998 RMK Only do PIO if FAS216 will allow it.
* 27-06-1998 RMK Changed asm/delay.h to linux/delay.h
*/
#include <linux/module.h>
......@@ -25,8 +26,8 @@
#include <linux/proc_fs.h>
#include <linux/unistd.h>
#include <linux/stat.h>
#include <linux/delay.h>
#include <asm/delay.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/dma.h>
......@@ -73,6 +74,11 @@
static struct expansion_card *ecs[MAX_ECARDS];
MODULE_AUTHOR("Russell King");
MODULE_DESCRIPTION("EESOX SCSI driver");
MODULE_PARM(term, "1-8i");
MODULE_PARM_DESC(term, "SCSI bus termination");
/*
* Use term=0,1,0,0,0 to turn terminators on/off
*/
......@@ -377,6 +383,7 @@ eesoxscsi_detect(Scsi_Host_Template *tpnt)
info->info.ifcfg.asyncperiod = EESOX_ASYNC_PERIOD;
info->info.ifcfg.sync_max_depth = EESOX_SYNC_DEPTH;
info->info.ifcfg.cntl3 = CNTL3_BS8 | CNTL3_FASTSCSI | CNTL3_FASTCLK;
info->info.ifcfg.disconnect_ok = 1;
info->info.dma.setup = eesoxscsi_dma_setup;
info->info.dma.pseudo = eesoxscsi_dma_pseudo;
info->info.dma.stop = eesoxscsi_dma_stop;
......
......@@ -22,6 +22,8 @@
* 06-04-1998 RMK Tightened conditions for printing incomplete
* transfers
* 02-05-1998 RMK Added extra checks in fas216_reset
* 24-05-1998 RMK Fixed synchronous transfers with period >= 200ns
* 27-06-1998 RMK Changed asm/delay.h to linux/delay.h
*
* Todo:
* - tighten up the MESSAGE_REJECT support.
......@@ -37,8 +39,8 @@
#include <linux/proc_fs.h>
#include <linux/unistd.h>
#include <linux/stat.h>
#include <linux/delay.h>
#include <asm/delay.h>
#include <asm/dma.h>
#include <asm/io.h>
#include <asm/irq.h>
......@@ -50,9 +52,12 @@
#include "../../scsi/hosts.h"
#include "fas216.h"
MODULE_AUTHOR("Russell King");
MODULE_DESCRIPTION("Generic FAS216/NCR53C9x driver");
#define VER_MAJOR 0
#define VER_MINOR 0
#define VER_PATCH 3
#define VER_PATCH 4
#define SCSI2_TAG
......@@ -81,7 +86,6 @@
*/
#define SCSI2_SYNC
#undef NO_DISCONNECTS
#undef DEBUG_CONNECT
#undef DEBUG_BUSSERVICE
#undef DEBUG_FUNCTIONDONE
......@@ -94,8 +98,7 @@ static int ptr;
static void fas216_dumpstate(FAS216_Info *info)
{
printk("FAS216 registers:\n");
printk(" CTCL=%02X CTCM=%02X CMD=%02X STAT=%02X"
printk("FAS216: CTCL=%02X CTCM=%02X CMD=%02X STAT=%02X"
" INST=%02X IS=%02X CFIS=%02X",
inb(REG_CTCL(info)), inb(REG_CTCM(info)),
inb(REG_CMD(info)), inb(REG_STAT(info)),
......@@ -114,7 +117,7 @@ static void fas216_dumpinfo(FAS216_Info *info)
if (used++)
return;
printk("FAS216_Info = \n");
printk("FAS216_Info=\n");
printk(" { magic_start=%lX host=%p SCpnt=%p origSCpnt=%p\n",
info->magic_start, info->host, info->SCpnt,
info->origSCpnt);
......@@ -122,17 +125,18 @@ static void fas216_dumpinfo(FAS216_Info *info)
info->scsi.io_port, info->scsi.io_shift, info->scsi.irq,
info->scsi.cfg[0], info->scsi.cfg[1], info->scsi.cfg[2],
info->scsi.cfg[3]);
printk(" type=%p phase=%X reconnected = { target=%d lun=%d tag=%d }\n",
printk(" type=%p phase=%X reconnected={ target=%d lun=%d tag=%d }\n",
info->scsi.type, info->scsi.phase,
info->scsi.reconnected.target,
info->scsi.reconnected.lun, info->scsi.reconnected.tag);
printk(" SCp = { ptr=%p this_residual=%X buffer=%p buffers_residual=%X }\n",
printk(" SCp={ ptr=%p this_residual=%X buffer=%p buffers_residual=%X }\n",
info->scsi.SCp.ptr, info->scsi.SCp.this_residual,
info->scsi.SCp.buffer, info->scsi.SCp.buffers_residual);
printk(" msgs async_stp=%X last_message=%X disconnectable=%d aborting=%d }\n",
info->scsi.async_stp, info->scsi.last_message,
info->scsi.disconnectable, info->scsi.aborting);
printk(" stats={ queues=%X removes=%X fins=%X reads=%X writes=%X miscs=%X disconnects=%X aborts=%X resets=%X }\n",
printk(" stats={ queues=%X removes=%X fins=%X reads=%X writes=%X miscs=%X\n"
" disconnects=%X aborts=%X resets=%X }\n",
info->stats.queues, info->stats.removes, info->stats.fins,
info->stats.reads, info->stats.writes, info->stats.miscs,
info->stats.disconnects, info->stats.aborts, info->stats.resets);
......@@ -148,7 +152,7 @@ static void fas216_dumpinfo(FAS216_Info *info)
printk(" dma={ transfer_type=%X setup=%p pseudo=%p stop=%p }\n",
info->dma.transfer_type, info->dma.setup,
info->dma.pseudo, info->dma.stop);
printk(" internal_done=%X magic_end=%lX\n",
printk(" internal_done=%X magic_end=%lX }\n",
info->internal_done, info->magic_end);
}
......@@ -228,9 +232,9 @@ static void print_debug_list(void)
i = ptr;
printk(KERN_ERR "SCSI state trail: ");
printk(KERN_ERR "SCSI IRQ trail: ");
do {
printk("%02X:%02X:%02X:%02X ",
printk("%02X:%02X:%02X:%1X ",
list[i].stat, list[i].ssr,
list[i].isr, list[i].ph);
i = (i + 1) & 7;
......@@ -265,7 +269,8 @@ static int fas216_clockrate(int clock)
* : ns - period in ns (between subsequent bytes)
* Returns : Value suitable for REG_STP
*/
static int fas216_syncperiod(FAS216_Info *info, int ns)
static int
fas216_syncperiod(FAS216_Info *info, int ns)
{
int value = (info->ifcfg.clockrate * ns) / 1000;
......@@ -279,6 +284,25 @@ static int fas216_syncperiod(FAS216_Info *info, int ns)
return value & 31;
}
/* Function: void fas216_set_sync(FAS216_Info *info, int target)
* Purpose : Correctly setup FAS216 chip for specified transfer period.
* Params : info - state structure for interface
* : target - target
* Notes : we need to switch the chip out of FASTSCSI mode if we have
* a transfer period >= 200ns - otherwise the chip will violate
* the SCSI timings.
*/
static void
fas216_set_sync(FAS216_Info *info, int target)
{
outb(info->device[target].sof, REG_SOF(info));
outb(info->device[target].stp, REG_STP(info));
if (info->device[target].period >= (200 / 4))
outb(info->scsi.cfg[2] & ~CNTL3_FASTSCSI, REG_CNTL3(info));
else
outb(info->scsi.cfg[2], REG_CNTL3(info));
}
/* Function: void fas216_updateptrs(FAS216_Info *info, int bytes_transferred)
* Purpose : update data pointers after transfer suspended/paused
* Params : info - interface's local pointer to update
......@@ -504,6 +528,8 @@ fas216_stoptransfer(FAS216_Info *info)
fas216_updateptrs(info, total - residual);
info->dma.transfer_type = fasdma_none;
}
if (info->scsi.phase == PHASE_DATAOUT)
outb(CMD_FLUSHFIFO, REG_CMD(info));
}
/* Function: void fas216_disconnected_intr(FAS216_Info *info)
......@@ -857,13 +883,13 @@ static void fas216_message(FAS216_Info *info)
info->scsi.phase = PHASE_MSGOUT;
case syncneg_sent:
info->device[info->SCpnt->target].negstate = syncneg_complete;
info->device[info->SCpnt->target].period = message[3];
info->device[info->SCpnt->target].sof = message[4];
info->device[info->SCpnt->target].stp =
fas216_syncperiod(info, message[3] * 4);
printk(KERN_NOTICE "scsi%d.%c: using synchronous transfer, offset %d, %d ns\n",
info->host->host_no, fas216_target(info), message[4], message[3] * 4);
outb(info->device[info->SCpnt->target].sof, REG_SOF(info));
outb(info->device[info->SCpnt->target].stp, REG_STP(info));
fas216_set_sync(info, info->SCpnt->target);
break;
}
break;
......@@ -1416,8 +1442,7 @@ static void fas216_kick(FAS216_Info *info)
outb(info->ifcfg.select_timeout, REG_STIM(info));
/* synchronous transfers */
outb(info->device[SCpnt->target].sof, REG_SOF(info));
outb(info->device[SCpnt->target].stp, REG_STP(info));
fas216_set_sync(info, SCpnt->target);
msglen = msgqueue_msglength(&info->scsi.msgs);
......@@ -1742,8 +1767,8 @@ int fas216_abort(Scsi_Cmnd *SCpnt)
info->stats.aborts += 1;
print_debug_list();
fas216_dumpinfo(info);
fas216_dumpstate(info);
fas216_dumpinfo(info);
printk(KERN_WARNING "scsi%d: fas216_abort: ", info->host->host_no);
do {
......@@ -1823,12 +1848,9 @@ static void fas216_reset_state(FAS216_Info *info)
#endif
for (i = 0; i < 8; i++) {
#ifndef NO_DISCONNECTS
info->device[i].disconnect_ok = 1;
#else
info->device[i].disconnect_ok = 0;
#endif
info->device[i].disconnect_ok = info->ifcfg.disconnect_ok;
info->device[i].negstate = negstate;
info->device[i].period = info->ifcfg.asyncperiod / 4;
info->device[i].stp = info->scsi.async_stp;
info->device[i].sof = 0;
}
......@@ -1980,6 +2002,8 @@ int fas216_init(struct Scsi_Host *instance)
return 1;
}
outb(CMD_RESETCHIP, REG_CMD(info));
outb(0, REG_CNTL3(info));
outb(CNTL2_S2FE, REG_CNTL2(info));
......
......@@ -257,6 +257,7 @@ typedef struct {
unsigned char sync_max_depth; /* Synchronous xfer max fifo depth */
unsigned char cntl3; /* Control Reg 3 */
unsigned int asyncperiod; /* Async transfer period (ns) */
unsigned int disconnect_ok:1; /* Disconnects allowed? */
} ifcfg;
/* queue handling */
......@@ -268,6 +269,7 @@ typedef struct {
/* per-device info */
struct {
unsigned char disconnect_ok:1; /* device can disconnect */
unsigned int period; /* sync xfer period (*4ns) */
unsigned char stp; /* synchronous transfer period */
unsigned char sof; /* synchronous offset register */
syncneg_t negstate; /* synchronous transfer mode */
......
/*
* drivers/acorn/scsi/msgqueue.c: message queue handling
*
* Copyright (C) 1997,8 Russell King
* Copyright (C) 1997-1998 Russell King
*/
#include <linux/module.h>
......@@ -10,6 +10,9 @@
#include "msgqueue.h"
MODULE_AUTHOR("Russell King");
MODULE_DESCRIPTION("SCSI message queue handling");
/*
* Function: struct msgqueue_entry *mqe_alloc(MsgQueue_t *msgq)
* Purpose : Allocate a message queue entry
......
......@@ -116,7 +116,7 @@ int oakscsi_detect(Scsi_Host_Template * tpnt)
request_region (instance->io_port, instance->n_io_port, "Oak SCSI");
if (instance->irq != IRQ_NONE)
if (request_irq(instance->irq, oakscsi_intr, SA_INTERRUPT, "Oak SCSI", NULL)) {
if (request_irq(instance->irq, do_oakscsi_intr, SA_INTERRUPT, "Oak SCSI", NULL)) {
printk("scsi%d: IRQ%d not free, interrupts disabled\n",
instance->host_no, instance->irq);
instance->irq = IRQ_NONE;
......
......@@ -85,7 +85,7 @@ use_clustering: DISABLE_CLUSTERING \
#define NCR5380_read(reg) oakscsi_read(_instance, reg)
#define NCR5380_write(reg, value) oakscsi_write(_instance, reg, value)
#define NCR5380_intr oakscsi_intr
#define do_NCR5380_intr do_oakscsi_intr
#define NCR5380_queue_command oakscsi_queue_command
#define NCR5380_abort oakscsi_abort
#define NCR5380_reset oakscsi_reset
......
......@@ -12,6 +12,7 @@
* 15-02-1998 RMK Added DMA support and hardware definitions.
* 15-04-1998 RMK Only do PIO if FAS216 will allow it.
* 02-05-1998 RMK Moved DMA sg list into per-interface structure.
* 27-06-1998 RMK Changed asm/delay.h to linux/delay.h
*/
#include <linux/module.h>
......@@ -23,8 +24,8 @@
#include <linux/proc_fs.h>
#include <linux/unistd.h>
#include <linux/stat.h>
#include <linux/delay.h>
#include <asm/delay.h>
#include <asm/dma.h>
#include <asm/ecard.h>
#include <asm/io.h>
......@@ -68,6 +69,11 @@
#define VER_MINOR 0
#define VER_PATCH 2
MODULE_AUTHOR("Russell King");
MODULE_DESCRIPTION("Powertec SCSI driver");
MODULE_PARM(term, "1-8i");
MODULE_PARM_DESC(term, "SCSI bus termination");
static struct expansion_card *ecs[MAX_ECARDS];
/*
......@@ -271,6 +277,7 @@ powertecscsi_detect(Scsi_Host_Template *tpnt)
info->info.ifcfg.asyncperiod = POWERTEC_ASYNC_PERIOD;
info->info.ifcfg.sync_max_depth = POWERTEC_SYNC_DEPTH;
info->info.ifcfg.cntl3 = CNTL3_BS8 | CNTL3_FASTSCSI | CNTL3_FASTCLK;
info->info.ifcfg.disconnect_ok = 1;
info->info.dma.setup = powertecscsi_dma_setup;
info->info.dma.pseudo = NULL;
info->info.dma.stop = powertecscsi_dma_stop;
......
......@@ -20,6 +20,9 @@
#include "../../scsi/scsi.h"
MODULE_AUTHOR("Russell King");
MODULE_DESCRIPTION("SCSI command queueing");
typedef struct queue_entry {
struct queue_entry *next;
struct queue_entry *prev;
......
......@@ -132,16 +132,13 @@ if [ "$CONFIG_VIDEO_DEV" != "n" ]; then
if [ "$CONFIG_RADIO_SF16FMI" = "y" ]; then
hex ' SF16FMI I/O port (0x284 or 0x384)' CONFIG_RADIO_SF16FMI_PORT 284
fi
dep_tristate 'Zoltrix Radio' CONFIG_RADIO_ZOLTRIX $CONFIG_VIDEO_DEV
if [ "$CONFIG_RADIO_ZOLTRIX" != "n" ]; then
hex ' ZOLTRIX I/O port (0x20c or 0x30c)' CONFIG_RADIO_ZOLTRIX_PORT 20c
fi
fi
tristate '/dev/nvram support' CONFIG_NVRAM
tristate 'PC joystick support' CONFIG_JOYSTICK
bool 'Radio Device Support' CONFIG_MISC_RADIO
if [ "$CONFIG_MISC_RADIO" != "n" ]; then
bool ' AIMSlab RadioTrack (aka RadioReveal) support' CONFIG_RADIO_RTRACK
if [ "$CONFIG_RADIO_RTRACK" != "n" ]; then
hex ' RadioTrack i/o port (0x20f or 0x30f)' CONFIG_RADIO_RTRACK_PORT 20f
fi
fi
mainmenu_option next_comment
comment 'Ftape, the floppy tape device driver'
......
This diff is collapsed.
......@@ -54,7 +54,7 @@ struct bttv_window
ushort swidth, sheight;
short cropx, cropy;
ushort cropwidth, cropheight;
unsigned int vidadr;
unsigned long vidadr;
ushort freq;
int norm;
int interlace;
......@@ -74,12 +74,11 @@ struct bttv
struct i2c_bus i2c;
int have_msp3400;
int have_tuner;
int tuner_type;
unsigned short id;
unsigned char bus; /* PCI bus the Bt848 is on */
unsigned char devfn;
struct pci_dev *dev;
unsigned char revision;
unsigned char irq; /* IRQ used by Bt848 card */
unsigned int bt848_adr; /* bus address of IO mem returned by PCI BIOS */
unsigned char *bt848_mem; /* pointer to mapped IO memory */
unsigned long busriscmem;
......
This diff is collapsed.
......@@ -62,6 +62,8 @@
#define bell_pitch (vc_cons[currcons].d->vc_bell_pitch)
#define bell_duration (vc_cons[currcons].d->vc_bell_duration)
#define cursor_type (vc_cons[currcons].d->vc_cursor_type)
#define display_fg (vc_cons[currcons].d->vc_display_fg)
#define vcmode (vt_cons[currcons]->vc_mode)
#define structsize (sizeof(struct vc_data) + sizeof(struct vt_struct))
......@@ -83,8 +83,6 @@ extern void hpfb_init(void);
extern void hpfb_setup(char *options, int *ints);
extern void sbusfb_init(void);
extern void sbusfb_setup(char *options, int *ints);
extern void promfb_init(void);
extern void promfb_setup(char *options, int *ints);
static struct {
const char *name;
......@@ -145,9 +143,6 @@ static struct {
#ifdef CONFIG_FB_SBUS
{ "sbus", sbusfb_init, sbusfb_setup },
#endif
#ifdef CONFIG_FB_PROM
{ "prom", promfb_init, promfb_setup },
#endif
#ifdef CONFIG_GSP_RESOLVER
/* Not a real frame buffer device... */
{ "resolver", NULL, resolver_video_setup },
......@@ -474,27 +469,6 @@ static struct file_operations fb_fops = {
NULL /* fsync */
};
static inline void take_over_console(struct consw *sw)
{
int i;
extern void set_palette(void);
conswitchp = sw;
conswitchp->con_startup();
for (i = 0; i < MAX_NR_CONSOLES; i++) {
if (!vc_cons[i].d || !vc_cons[i].d->vc_sw)
continue;
if (i == fg_console &&
vc_cons[i].d->vc_sw->con_save_screen)
vc_cons[i].d->vc_sw->con_save_screen(vc_cons[i].d);
vc_cons[i].d->vc_sw->con_deinit(vc_cons[i].d);
vc_cons[i].d->vc_sw = conswitchp;
vc_cons[i].d->vc_sw->con_init(vc_cons[i].d, 0);
}
set_palette();
}
int
register_framebuffer(struct fb_info *fb_info)
{
......@@ -523,7 +497,7 @@ register_framebuffer(struct fb_info *fb_info)
if (first) {
first = 0;
take_over_console(&fb_con);
take_over_console(&fb_con, 0, MAX_NR_CONSOLES-1, 1);
}
return 0;
......
......@@ -68,7 +68,7 @@ static int rdtsc_ok = 1;
#ifdef __i386__
__initfunc(static void i386_capability(void))
{
if (boot_cpu_data.x86_capability & X86_FEATURE_TSC))
if (boot_cpu_data.x86_capability & X86_FEATURE_TSC)
rdtsc_ok = 1;
else
printk(KERN_INFO "%s: cpu does not support the rdtsc instruction\n", hfmodem_drvname);
......
......@@ -34,11 +34,18 @@ static struct i2c_bus *busses[I2C_BUS_MAX];
static struct i2c_driver *drivers[I2C_DRIVER_MAX];
static int bus_count = 0, driver_count = 0;
extern int i2c_tuner_init(void);
extern int msp3400c_init(void);
int i2c_init(void)
{
printk(KERN_INFO "i2c: initialized%s\n",
scan ? " (i2c bus scan enabled)" : "");
/* anything to do here ? */
#ifdef CONFIG_VIDEO_BT848
i2c_tuner_init();
msp3400c_init();
#endif
return 0;
}
......
......@@ -566,6 +566,9 @@ __initfunc(int chr_dev_init(void))
#ifdef CONFIG_FTAPE
ftape_init();
#endif
#ifdef CONFIG_VIDEO_BT848
i2c_init();
#endif
#ifdef CONFIG_VIDEO_DEV
videodev_init();
#endif
......
......@@ -43,6 +43,7 @@ struct rt_device
int port;
int curvol;
unsigned long curfreq;
int muted;
};
......@@ -51,7 +52,7 @@ struct rt_device
static void sleep_delay(long n)
{
/* Sleep nicely for 'n' uS */
int d=n/1000000/HZ;
int d=n/(1000000/HZ);
if(!d)
udelay(n);
else
......@@ -77,26 +78,33 @@ static void rt_incvol(void)
outb(0xd8, io); /* volume steady + sigstr + on */
}
static void rt_mute(void)
static void rt_mute(struct rt_device *dev)
{
outb(0x48, io); /* volume down but still "on" */
sleep_delay(2000000); /* make sure it's totally down */
outb(0xc0, io); /* volume steady, off */
dev->muted = 1;
outb(0xd0, io); /* volume steady, off */
}
static int rt_setvol(struct rt_device *dev, int vol)
{
int i;
if(vol == dev->curvol) /* no change needed */
if(vol == dev->curvol) { /* requested volume = current */
if (dev->muted) { /* user is unmuting the card */
dev->muted = 0;
outb (0xd8, io); /* enable card */
}
return 0;
}
if(vol == 0) { /* volume = 0 means mute the card */
rt_mute();
dev->curvol = 0;
outb(0x48, io); /* volume down but still "on" */
sleep_delay(2000000); /* make sure it's totally down */
outb(0xd0, io); /* volume steady, off */
return 0;
}
dev->muted = 0;
if(vol > dev->curvol)
for(i = dev->curvol; i < vol; i++)
rt_incvol();
......@@ -116,7 +124,7 @@ static int rt_setvol(struct rt_device *dev, int vol)
void send_0_byte(int port, struct rt_device *dev)
{
if (dev->curvol == 0) {
if ((dev->curvol == 0) || (dev->muted)) {
outb_p(128+64+16+ 1, port); /* wr-enable + data low */
outb_p(128+64+16+2+1, port); /* clock */
}
......@@ -129,7 +137,7 @@ void send_0_byte(int port, struct rt_device *dev)
void send_1_byte(int port, struct rt_device *dev)
{
if (dev->curvol == 0) {
if ((dev->curvol == 0) || (dev->muted)) {
outb_p(128+64+16+4 +1, port); /* wr-enable+data high */
outb_p(128+64+16+4+2+1, port); /* clock */
}
......@@ -172,7 +180,7 @@ static int rt_setfreq(struct rt_device *dev, unsigned long freq)
send_0_byte (io, dev); /* 22: spacing (0 = 25 kHz) */
send_1_byte (io, dev); /* 23: AM/FM (FM = 1, always) */
if (dev->curvol == 0)
if ((dev->curvol == 0) || (dev->muted))
outb (0xd0, io); /* volume steady + sigstr */
else
outb (0xd8, io); /* volume steady + sigstr + on */
......@@ -262,10 +270,8 @@ static int rt_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
if(v.audio)
return -EINVAL;
if(v.flags&VIDEO_AUDIO_MUTE) {
rt_mute();
rt->curvol=0;
}
if(v.flags&VIDEO_AUDIO_MUTE)
rt_mute(rt);
else
rt_setvol(rt,v.volume/6554);
......@@ -322,9 +328,15 @@ __initfunc(int rtrack_init(struct video_init *v))
request_region(io, 2, "rtrack");
printk(KERN_INFO "AIMSlab Radiotrack/radioreveal card driver.\n");
/* mute card - prevents noisy bootups */
rt_mute();
/* mute card - prevents noisy bootups */
/* this ensures that the volume is all the way down */
outb(0x48, io); /* volume down but still "on" */
sleep_delay(2000000); /* make sure it's totally down */
outb(0xc0, io); /* steady volume, mute card */
rtrack_unit.curvol = 0;
return 0;
}
......
......@@ -39,7 +39,7 @@ static int io = CONFIG_RADIO_SF16FMI_PORT;
static int users = 0;
/* local things */
#define RSF16_ENCODE(x) ((x*(1000/RADIO_FM_RES)+10700)/50)
#define RSF16_ENCODE(x) ((x*(1000/4)+10700)/50)
static void outbits(int bits, int data, int port)
{
......
This diff is collapsed.
This diff is collapsed.
......@@ -8,8 +8,6 @@
#ifndef __RSF16FMI_H
#define __RSF16FMI_H
#include <linux/radio.h>
int radiosf16fmi_init(void);
#endif /* __RSF16FMI_H */
This diff is collapsed.
/* RadioTrack (RadioReveal) include file.
* (c) 1997 M. Kirkwood
*
* Not in include/linux/ because there's no need for anyone
* to know about these details, I reckon.
*/
#ifndef __RTRACK_H
#define __RTRACK_H
#include <linux/radio.h>
void radiotrack_init(void);
int rt_setvol(struct radio_device *dev, int vol);
int rt_setband(struct radio_device *dev, int vol);
int rt_setfreq(struct radio_device *dev, int vol);
int rt_getsigstr(struct radio_device *dev);
/* frequency encoding stuff... */
/* we have to careful not to introduce fp stuff here */
#define RTRACK_ENCODE(x) (((((x)*2)/5)-(40*88))+0xf6c)
#define RTRACK_DECODE(x) (((((x)-0xf6c)+(40*88))*5)/2)
/* we shouldn't actually need the decode macro (or the excessive bracketing :-) */
#endif /* __RTRACK_H */
......@@ -48,8 +48,6 @@
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/bios32.h>
#include <linux/malloc.h>
#include <asm/io.h>
#include <asm/uaccess.h>
......
......@@ -12,8 +12,8 @@
#include "tuner.h"
int debug = 0; /* insmod parameter */
int type = 0; /* tuner type */
static int debug = 0; /* insmod parameter */
static int type = 0; /* tuner type */
#define dprintk if (debug) printk
......@@ -248,7 +248,7 @@ EXPORT_NO_SYMBOLS;
#ifdef MODULE
int init_module(void)
#else
int msp3400c_init(void)
int i2c_tuner_init(void)
#endif
{
i2c_register_driver(&i2c_driver_tuner);
......
......@@ -27,6 +27,10 @@
#include <asm/uaccess.h>
#include <asm/system.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
#define VIDEO_NUM_DEVICES 256
......@@ -38,6 +42,7 @@ static struct video_device *video_device[VIDEO_NUM_DEVICES];
#ifdef CONFIG_VIDEO_BT848
extern int init_bttv_cards(struct video_init *);
extern int i2c_tuner_init(struct video_init *);
#endif
#ifdef CONFIG_VIDEO_SAA5249
extern int init_saa_5249(struct video_init *);
......@@ -60,6 +65,7 @@ extern int fmi_init(struct video_init *);
static struct video_init video_init_list[]={
#ifdef CONFIG_VIDEO_BT848
{"i2c-tuner", i2c_tuner_init},
{"bttv", init_bttv_cards},
#endif
#ifdef CONFIG_VIDEO_SAA5249
......@@ -132,8 +138,17 @@ static int video_open(struct inode *inode, struct file *file)
return -ENODEV;
vfl=video_device[minor];
if(vfl==NULL)
return -ENODEV;
if(vfl==NULL) {
#ifdef CONFIG_KMOD
char modname[20];
sprintf (modname, "char-major-%d-%d", VIDEO_MAJOR, minor);
request_module(modname);
vfl=video_device[minor];
if (vfl==NULL)
#endif
return -ENODEV;
}
if(vfl->busy)
return -EBUSY;
vfl->busy=1; /* In case vfl->open sleeps */
......
......@@ -58,6 +58,16 @@ static void arc_dec_use_count(void)
#endif
}
static void arc_fill_inode(struct inode *inode, int fill)
{
#ifdef MODULE
if (fill)
MOD_INC_USE_COUNT;
else
MOD_DEC_USE_COUNT;
#endif
}
static struct parport_operations parport_arc_ops =
{
arc_write_data,
......@@ -103,7 +113,8 @@ static struct parport_operations parport_arc_ops =
arc_examine_irq,
arc_inc_use_count,
arc_dec_use_count
arc_dec_use_count,
arc_fill_inode
};
/* --- Initialisation code -------------------------------- */
......
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.
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.
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.
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.
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.
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