Commit 312d62f3 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.99pre2-5

parent c0ccd8dc
...@@ -14211,7 +14211,7 @@ CONFIG_ARCH_NETWINDER ...@@ -14211,7 +14211,7 @@ CONFIG_ARCH_NETWINDER
Say Y here if you intend to run this kernel on the NetWinder. Say Y here if you intend to run this kernel on the NetWinder.
Include support for the Compaq Personal Server Include support for the Compaq Personal Server
CONFIG_PERSONAL_SERVER CONFIG_ARCH_PERSONAL_SERVER
Say Y here if you intend to run this kernel on the Compaq Say Y here if you intend to run this kernel on the Compaq
Personal Server. Personal Server.
......
...@@ -107,6 +107,7 @@ EXPORT_SYMBOL(pci_map_single); ...@@ -107,6 +107,7 @@ EXPORT_SYMBOL(pci_map_single);
EXPORT_SYMBOL(pci_unmap_single); EXPORT_SYMBOL(pci_unmap_single);
EXPORT_SYMBOL(pci_map_sg); EXPORT_SYMBOL(pci_map_sg);
EXPORT_SYMBOL(pci_unmap_sg); EXPORT_SYMBOL(pci_unmap_sg);
EXPORT_SYMBOL(pci_dma_supported);
EXPORT_SYMBOL(dump_thread); EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(dump_fpu); EXPORT_SYMBOL(dump_fpu);
......
...@@ -35,9 +35,9 @@ fi ...@@ -35,9 +35,9 @@ fi
if [ "$CONFIG_HOST_FOOTBRIDGE" = "y" ]; then if [ "$CONFIG_HOST_FOOTBRIDGE" = "y" ]; then
bool ' Include support for EBSA285' CONFIG_ARCH_EBSA285 bool ' Include support for EBSA285' CONFIG_ARCH_EBSA285
bool ' Include support for CATS' CONFIG_CATS bool ' Include support for CATS' CONFIG_ARCH_CATS
bool ' Include support for NetWinder' CONFIG_ARCH_NETWINDER bool ' Include support for NetWinder' CONFIG_ARCH_NETWINDER
bool ' Include support for Compaq Personal Server' CONFIG_PERSONAL_SERVER bool ' Include support for Compaq Personal Server' CONFIG_ARCH_PERSONAL_SERVER
fi fi
if [ "$CONFIG_ADDIN_FOOTBRIDGE" = "y" ]; then if [ "$CONFIG_ADDIN_FOOTBRIDGE" = "y" ]; then
...@@ -124,7 +124,7 @@ fi ...@@ -124,7 +124,7 @@ fi
# #
# These machines have ISA-DMA # These machines have ISA-DMA
# #
if [ "$CONFIG_CATS" = "y" -o \ if [ "$CONFIG_ARCH_CATS" = "y" -o \
"$CONFIG_ARCH_SHARK" = "y" -o \ "$CONFIG_ARCH_SHARK" = "y" -o \
"$CONFIG_ARCH_NETWINDER" = "y" ]; then "$CONFIG_ARCH_NETWINDER" = "y" ]; then
define_bool CONFIG_ISA_DMA y define_bool CONFIG_ISA_DMA y
...@@ -171,8 +171,8 @@ source drivers/parport/Config.in ...@@ -171,8 +171,8 @@ source drivers/parport/Config.in
if [ "$CONFIG_ARCH_EBSA110" = "y" -o \ if [ "$CONFIG_ARCH_EBSA110" = "y" -o \
"$CONFIG_ARCH_SA1100" = "y" -o \ "$CONFIG_ARCH_SA1100" = "y" -o \
"$CONFIG_ARCH_NETWINDER" = "y" -o \ "$CONFIG_ARCH_NETWINDER" = "y" -o \
"$CONFIG_PERSONAL_SERVER" = "y" -o \ "$CONFIG_ARCH_PERSONAL_SERVER" = "y" -o \
"$CONFIG_CATS" = "y" ]; then "$CONFIG_ARCH_CATS" = "y" ]; then
string 'Initial kernel command string' CONFIG_CMDLINE string 'Initial kernel command string' CONFIG_CMDLINE
fi fi
if [ "$CONFIG_ARCH_NETWINDER" = "y" -o \ if [ "$CONFIG_ARCH_NETWINDER" = "y" -o \
......
...@@ -192,6 +192,7 @@ fixup_sa1100(struct machine_desc *desc, struct param_struct *params, ...@@ -192,6 +192,7 @@ fixup_sa1100(struct machine_desc *desc, struct param_struct *params,
* in head-armv.S. * in head-armv.S.
*/ */
static struct machine_desc machine_desc[] __attribute__ ((__section__ (".arch.info"))) = { static struct machine_desc machine_desc[] __attribute__ ((__section__ (".arch.info"))) = {
#ifdef CONFIG_ARCH_EBSA110
{ {
MACH_TYPE_EBSA110, MACH_TYPE_EBSA110,
"EBSA110", /* RMK */ "EBSA110", /* RMK */
...@@ -199,119 +200,160 @@ static struct machine_desc machine_desc[] __attribute__ ((__section__ (".arch.in ...@@ -199,119 +200,160 @@ static struct machine_desc machine_desc[] __attribute__ ((__section__ (".arch.in
NO_VIDEO, NO_VIDEO,
1, 0, 1, 1, 1, 1, 0, 1, 1, 1,
NULL NULL
}, { },
#endif
#ifdef CONFIG_ARCH_RPC
{
MACH_TYPE_RISCPC, MACH_TYPE_RISCPC,
"Acorn-RiscPC", /* RMK */ "Acorn-RiscPC", /* RMK */
0x10000100, 0x10000100,
NO_VIDEO, NO_VIDEO,
1, 1, 0, 0, 0, 1, 1, 0, 0, 0,
fixup_acorn fixup_acorn
}, { },
2, #endif
"unknown", #ifdef CONFIG_ARCH_NEXUSPCI
NO_PARAMS, {
NO_VIDEO,
0, 0, 0, 0, 0,
NULL
}, {
MACH_TYPE_NEXUSPCI, MACH_TYPE_NEXUSPCI,
"FTV/PCI", /* Philip Blundell */ "FTV/PCI", /* Philip Blundell */
NO_PARAMS, NO_PARAMS,
NO_VIDEO, NO_VIDEO,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
NULL NULL
}, { },
#endif
#ifdef CONFIG_ARCH_EBSA285
{
MACH_TYPE_EBSA285, MACH_TYPE_EBSA285,
"EBSA285", /* RMK */ "EBSA285", /* RMK */
0x00000100, 0x00000100,
0x000a0000, 0x000bffff, 0x000a0000, 0x000bffff,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
fixup_ebsa285 fixup_ebsa285
}, { },
#endif
#ifdef CONFIG_ARCH_NETWINDER
{
MACH_TYPE_NETWINDER, MACH_TYPE_NETWINDER,
"Rebel-NetWinder", /* RMK */ "Rebel-NetWinder", /* RMK */
0x00000100, 0x00000100,
0x000a0000, 0x000bffff, 0x000a0000, 0x000bffff,
1, 0, 1, 0, 0, 1, 0, 1, 0, 0,
fixup_netwinder fixup_netwinder
}, { },
#endif
#ifdef CONFIG_ARCH_CATS
{
MACH_TYPE_CATS, MACH_TYPE_CATS,
"Chalice-CATS", /* Philip Blundell */ "Chalice-CATS", /* Philip Blundell */
NO_PARAMS, NO_PARAMS,
0x000a0000, 0x000bffff, 0x000a0000, 0x000bffff,
0, 0, 0, 0, 1, 0, 0, 0, 0, 1,
fixup_cats fixup_cats
}, { },
#endif
#ifdef CONFIG_ARCH_TBOX
{
MACH_TYPE_TBOX, MACH_TYPE_TBOX,
"unknown-TBOX", /* Philip Blundell */ "unknown-TBOX", /* Philip Blundell */
NO_PARAMS, NO_PARAMS,
NO_VIDEO, NO_VIDEO,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
NULL NULL
}, { },
#endif
#ifdef CONFIG_ARCH_CO285
{
MACH_TYPE_CO285, MACH_TYPE_CO285,
"co-EBSA285", /* Mark van Doesburg */ "co-EBSA285", /* Mark van Doesburg */
NO_PARAMS, NO_PARAMS,
NO_VIDEO, NO_VIDEO,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
fixup_coebsa285 fixup_coebsa285
}, { },
#endif
#ifdef CONFIG_ARCH_CLPS7110
{
MACH_TYPE_CLPS7110, MACH_TYPE_CLPS7110,
"CL-PS7110", /* Werner Almesberger */ "CL-PS7110", /* Werner Almesberger */
NO_PARAMS, NO_PARAMS,
NO_VIDEO, NO_VIDEO,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
NULL NULL
}, { },
#endif
#ifdef CONFIG_ARCH_ARC
{
MACH_TYPE_ARCHIMEDES, MACH_TYPE_ARCHIMEDES,
"Acorn-Archimedes",/* RMK/DAG */ "Acorn-Archimedes",/* RMK/DAG */
0x0207c000, 0x0207c000,
NO_VIDEO, NO_VIDEO,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
fixup_acorn fixup_acorn
}, { },
#endif
#ifdef CONFIG_ARCH_A5K
{
MACH_TYPE_A5K, MACH_TYPE_A5K,
"Acorn-A5000", /* RMK/PB */ "Acorn-A5000", /* RMK/PB */
0x0207c000, 0x0207c000,
NO_VIDEO, NO_VIDEO,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
fixup_acorn fixup_acorn
}, { },
#endif
#ifdef CONFIG_ARCH_ETOILE
{
MACH_TYPE_ETOILE, MACH_TYPE_ETOILE,
"Etoile", /* Alex de Vries */ "Etoile", /* Alex de Vries */
NO_PARAMS, NO_PARAMS,
NO_VIDEO, NO_VIDEO,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
NULL NULL
}, { },
#endif
#ifdef CONFIG_ARCH_LACIE_NAS
{
MACH_TYPE_LACIE_NAS, MACH_TYPE_LACIE_NAS,
"LaCie_NAS", /* Benjamin Herrenschmidt */ "LaCie_NAS", /* Benjamin Herrenschmidt */
NO_PARAMS, NO_PARAMS,
NO_VIDEO, NO_VIDEO,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
NULL NULL
}, { },
#endif
#ifdef CONFIG_ARCH_CLPS7500
{
MACH_TYPE_CLPS7500, MACH_TYPE_CLPS7500,
"CL-PS7500", /* Philip Blundell */ "CL-PS7500", /* Philip Blundell */
NO_PARAMS, NO_PARAMS,
NO_VIDEO, NO_VIDEO,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
NULL NULL
}, { },
#endif
#ifdef CONFIG_ARCH_SHARK
{
MACH_TYPE_SHARK, MACH_TYPE_SHARK,
"Shark", /* Alexander Schulz */ "Shark", /* Alexander Schulz */
NO_PARAMS, NO_PARAMS,
0x06000000, 0x06000000+0x001fffff, 0x06000000, 0x06000000+0x001fffff,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
NULL NULL
}, { },
#endif
#ifdef CONFIG_ARCH_SA1100
{
MACH_TYPE_SA1100, MACH_TYPE_SA1100,
"SA1100-based", /* Nicolas Pitre */ "SA1100-based", /* Nicolas Pitre */
NO_PARAMS, NO_PARAMS,
NO_VIDEO, NO_VIDEO,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
fixup_sa1100 fixup_sa1100
}, { },
#endif
#ifdef CONFIG_ARCH_PERSONAL_SERVER
{
MACH_TYPE_PERSONAL_SERVER, MACH_TYPE_PERSONAL_SERVER,
"Compaq Personal Server", "Compaq Personal Server",
NO_PARAMS, NO_PARAMS,
...@@ -319,4 +361,5 @@ static struct machine_desc machine_desc[] __attribute__ ((__section__ (".arch.in ...@@ -319,4 +361,5 @@ static struct machine_desc machine_desc[] __attribute__ ((__section__ (".arch.in
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
NULL NULL
} }
#endif
}; };
...@@ -164,7 +164,52 @@ void __init pcibios_update_irq(struct pci_dev *dev, int irq) ...@@ -164,7 +164,52 @@ void __init pcibios_update_irq(struct pci_dev *dev, int irq)
void __init pcibios_fixup_bus(struct pci_bus *bus) void __init pcibios_fixup_bus(struct pci_bus *bus)
{ {
struct list_head *walk = &bus->devices; struct list_head *walk = &bus->devices;
struct arm_pci_sysdata *sysdata =
(struct arm_pci_sysdata *)bus->sysdata;
struct arm_bus_sysdata *busdata;
if (bus->number < MAX_NR_BUS)
busdata = sysdata->bus + bus->number;
else
BUG();
/*
* Walk the devices on this bus, working out what we can
* and can't support.
*/
for (walk = walk->next; walk != &bus->devices; walk = walk->next) {
struct pci_dev *dev = pci_dev_b(walk);
u16 status;
pci_read_config_word(dev, PCI_STATUS, &status);
/*
* If this device does not support fast back to back
* transfers, the bus as a whole cannot support them.
*/
if (!(status & PCI_STATUS_FAST_BACK))
busdata->features &= ~PCI_COMMAND_FAST_BACK;
/*
* Calculate the maximum devsel latency.
*/
if (busdata->maxdevsel < (status & PCI_STATUS_DEVSEL_MASK))
busdata->maxdevsel = (status & PCI_STATUS_DEVSEL_MASK);
/*
* If this device is an ISA bridge, set the have_isa_bridge
* flag. We will then go looking for things like keyboard,
* etc
*/
if (dev->class >> 8 == PCI_CLASS_BRIDGE_ISA ||
dev->class >> 8 == PCI_CLASS_BRIDGE_EISA)
have_isa_bridge = !0;
}
/*
* Now walk the devices again, this time setting them up.
*/
walk = &bus->devices;
for (walk = walk->next; walk != &bus->devices; walk = walk->next) { for (walk = walk->next; walk != &bus->devices; walk = walk->next) {
struct pci_dev *dev = pci_dev_b(walk); struct pci_dev *dev = pci_dev_b(walk);
u16 cmd; u16 cmd;
...@@ -181,26 +226,16 @@ void __init pcibios_fixup_bus(struct pci_bus *bus) ...@@ -181,26 +226,16 @@ void __init pcibios_fixup_bus(struct pci_bus *bus)
/* Put the chip to sleep in case the driver isn't loaded */ /* Put the chip to sleep in case the driver isn't loaded */
pci_write_config_dword(dev, 0x40, 0x80000000); pci_write_config_dword(dev, 0x40, 0x80000000);
/*
* If this device is an ISA bridge, set the have_isa_bridge
* flag. We will then go looking for things like keyboard,
* etc
*/
if (dev->class >> 8 == PCI_CLASS_BRIDGE_ISA ||
dev->class >> 8 == PCI_CLASS_BRIDGE_EISA)
have_isa_bridge = !0;
/* /*
* Set latency timer to 32, and a cache line size to 32 bytes. * Set latency timer to 32, and a cache line size to 32 bytes.
* Also, set system error enable, parity error enable, and * Also, set system error enable, parity error enable.
* fast back to back transaction enable. Disable ROM. * Disable ROM.
*/ */
pci_write_config_byte(dev, PCI_LATENCY_TIMER, 32); pci_write_config_byte(dev, PCI_LATENCY_TIMER, 32);
pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 8); pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 8);
pci_read_config_word(dev, PCI_COMMAND, &cmd); pci_read_config_word(dev, PCI_COMMAND, &cmd);
cmd |= PCI_COMMAND_FAST_BACK | PCI_COMMAND_SERR | cmd |= busdata->features;
PCI_COMMAND_PARITY;
pci_write_config_word(dev, PCI_COMMAND, cmd); pci_write_config_word(dev, PCI_COMMAND, cmd);
pci_read_config_word(dev, PCI_COMMAND, &cmd); pci_read_config_word(dev, PCI_COMMAND, &cmd);
...@@ -254,7 +289,7 @@ static struct hw_pci ebsa285_pci __initdata = { ...@@ -254,7 +289,7 @@ static struct hw_pci ebsa285_pci __initdata = {
}; };
#endif #endif
#ifdef CONFIG_CATS #ifdef CONFIG_ARCH_CATS
/* cats host-specific stuff */ /* cats host-specific stuff */
static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 }; static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };
...@@ -323,7 +358,7 @@ static struct hw_pci netwinder_pci __initdata = { ...@@ -323,7 +358,7 @@ static struct hw_pci netwinder_pci __initdata = {
}; };
#endif #endif
#ifdef CONFIG_PERSONAL_SERVER #ifdef CONFIG_ARCH_PERSONAL_SERVER
static int irqmap_personal_server[] __initdata = { static int irqmap_personal_server[] __initdata = {
IRQ_IN0, IRQ_IN1, IRQ_IN2, IRQ_IN3, 0, 0, 0, IRQ_IN0, IRQ_IN1, IRQ_IN2, IRQ_IN3, 0, 0, 0,
IRQ_DOORBELLHOST, IRQ_DMA1, IRQ_DMA2, IRQ_PCI IRQ_DOORBELLHOST, IRQ_DMA1, IRQ_DMA2, IRQ_PCI
...@@ -399,7 +434,7 @@ void __init pcibios_init(void) ...@@ -399,7 +434,7 @@ void __init pcibios_init(void)
break; break;
} }
#endif #endif
#ifdef CONFIG_CATS #ifdef CONFIG_ARCH_CATS
if (machine_is_cats()) { if (machine_is_cats()) {
hw_pci = &cats_pci; hw_pci = &cats_pci;
break; break;
...@@ -411,7 +446,7 @@ void __init pcibios_init(void) ...@@ -411,7 +446,7 @@ void __init pcibios_init(void)
break; break;
} }
#endif #endif
#ifdef CONFIG_PERSONAL_SERVER #ifdef CONFIG_ARCH_PERSONAL_SERVER
if (machine_is_personal_server()) { if (machine_is_personal_server()) {
hw_pci = &personal_server_pci; hw_pci = &personal_server_pci;
break; break;
......
#define MAX_NR_BUS 2
struct arm_bus_sysdata {
/*
* bitmask of features we can turn.
* See PCI command register for more info.
*/
u16 features;
/*
* Maximum devsel for this bus.
*/
u16 maxdevsel;
};
struct arm_pci_sysdata {
struct arm_bus_sysdata bus[MAX_NR_BUS];
};
struct hw_pci { struct hw_pci {
void (*init)(void); void (*init)(void);
unsigned long io_start; unsigned long io_start;
unsigned long mem_start; unsigned long mem_start;
u8 (*swizzle)(struct pci_dev *dev, u8 *pin); u8 (*swizzle)(struct pci_dev *dev, u8 *pin);
int (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin); int (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
}; };
void __init dc21285_init(void); void __init dc21285_init(void);
......
...@@ -206,8 +206,11 @@ static struct irqaction dc21285_error_action = { ...@@ -206,8 +206,11 @@ static struct irqaction dc21285_error_action = {
void __init dc21285_init(void) void __init dc21285_init(void)
{ {
static struct resource csrmem, csrio; static struct resource csrmem, csrio;
unsigned int mem_size; struct arm_pci_sysdata sysdata;
unsigned long cntl; unsigned long cntl;
unsigned int mem_size, pci_cmd = PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE;
int i;
mem_size = (unsigned int)high_memory - PAGE_OFFSET; mem_size = (unsigned int)high_memory - PAGE_OFFSET;
*CSR_SDRAMBASEMASK = (mem_size - 1) & 0x0ffc0000; *CSR_SDRAMBASEMASK = (mem_size - 1) & 0x0ffc0000;
...@@ -240,25 +243,34 @@ void __init dc21285_init(void) ...@@ -240,25 +243,34 @@ void __init dc21285_init(void)
*CSR_PCICSRIOBASE = csrio.start; *CSR_PCICSRIOBASE = csrio.start;
*CSR_PCISDRAMBASE = virt_to_bus((void *)PAGE_OFFSET); *CSR_PCISDRAMBASE = virt_to_bus((void *)PAGE_OFFSET);
*CSR_PCIROMBASE = 0; *CSR_PCIROMBASE = 0;
*CSR_PCICMD = PCI_COMMAND_IO | PCI_COMMAND_MEMORY | *CSR_PCICMD = pci_cmd |
PCI_COMMAND_MASTER | PCI_COMMAND_FAST_BACK |
PCI_COMMAND_INVALIDATE | PCI_COMMAND_PARITY |
(1 << 31) | (1 << 29) | (1 << 28) | (1 << 24); (1 << 31) | (1 << 29) | (1 << 28) | (1 << 24);
#endif #endif
printk(KERN_DEBUG "PCI: DC21285 footbridge, revision %02lX\n", printk(KERN_DEBUG "PCI: DC21285 footbridge, revision %02lX\n",
*CSR_CLASSREV & 0xff); *CSR_CLASSREV & 0xff);
pci_scan_bus(0, &dc21285_ops, NULL); for (i = 0; i < MAX_NR_BUS; i++) {
sysdata.bus[i].features = PCI_COMMAND_FAST_BACK |
PCI_COMMAND_SERR |
PCI_COMMAND_PARITY;
sysdata.bus[i].maxdevsel = PCI_STATUS_DEVSEL_FAST;
}
pci_scan_bus(0, &dc21285_ops, &sysdata);
pci_cmd |= sysdata.bus[0].features;
printk("Fast back to back PCI transfers %sabled\n",
(sysdata.bus[0].features & PCI_COMMAND_FAST_BACK) ? "en" : "dis");
/* /*
* Clear any existing errors - we aren't * Clear any existing errors - we aren't
* interested in historical data... * interested in historical data...
*/ */
cntl = *CSR_SA110_CNTL & 0xffffde07; cntl = *CSR_SA110_CNTL & 0xffffde07;
*CSR_SA110_CNTL = cntl | SA110_CNTL_RXSERR; *CSR_SA110_CNTL = cntl | SA110_CNTL_RXSERR;
cntl = *CSR_PCICMD & 0x0000ffff; *CSR_PCICMD = pci_cmd | 1 << 31 | 1 << 29 | 1 << 28 | 1 << 24;
*CSR_PCICMD = cntl | 1 << 31 | 1 << 29 | 1 << 28 | 1 << 24;
/* /*
* Initialise PCI error IRQ after we've finished probing * Initialise PCI error IRQ after we've finished probing
......
...@@ -613,7 +613,7 @@ EXPORT_SYMBOL(cpld_modify); ...@@ -613,7 +613,7 @@ EXPORT_SYMBOL(cpld_modify);
/* /*
* CATS stuff * CATS stuff
*/ */
#ifdef CONFIG_CATS #ifdef CONFIG_ARCH_CATS
#define CONFIG_PORT 0x370 #define CONFIG_PORT 0x370
#define INDEX_PORT (CONFIG_PORT) #define INDEX_PORT (CONFIG_PORT)
...@@ -698,7 +698,7 @@ void __init hw_init(void) ...@@ -698,7 +698,7 @@ void __init hw_init(void)
#endif #endif
} }
#endif #endif
#ifdef CONFIG_CATS #ifdef CONFIG_ARCH_CATS
if (machine_is_cats()) if (machine_is_cats())
cats_hw_init(); cats_hw_init();
#endif #endif
......
/* /*
* linux/arch/arm/kernel/process.c * linux/arch/arm/kernel/process.c
* *
* Copyright (C) 1996-1999 Russell King - Converted to ARM. * Copyright (C) 1996-2000 Russell King - Converted to ARM.
* Origional Copyright (C) 1995 Linus Torvalds * Origional Copyright (C) 1995 Linus Torvalds
*/ */
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <asm/io.h> #include <asm/io.h>
extern char *processor_modes[]; extern char *processor_modes[];
extern void setup_mm_for_reboot(char mode);
asmlinkage void ret_from_sys_call(void) __asm__("ret_from_sys_call"); asmlinkage void ret_from_sys_call(void) __asm__("ret_from_sys_call");
...@@ -96,15 +97,28 @@ __setup("reboot=", reboot_setup); ...@@ -96,15 +97,28 @@ __setup("reboot=", reboot_setup);
void machine_restart(char * __unused) void machine_restart(char * __unused)
{ {
/* /*
* Turn off caches, interrupts, etc * Clean and disable cache, and turn off interrupts
*/ */
cpu_proc_fin(); cpu_proc_fin();
/*
* Tell the mm system that we are going to reboot -
* we may need it to insert some 1:1 mappings so that
* soft boot works.
*/
setup_mm_for_reboot(reboot_mode);
/*
* Now call the architecture specific reboot code.
*/
arch_reset(reboot_mode); arch_reset(reboot_mode);
/*
* Whoops - the architecture was unable to reboot.
* Tell the user!
*/
mdelay(1000); mdelay(1000);
printk("Reboot failed -- System halted\n"); printk("Reboot failed -- System halted\n");
cli();
while (1); while (1);
} }
......
...@@ -379,7 +379,8 @@ static const struct fsr_info { ...@@ -379,7 +379,8 @@ static const struct fsr_info {
*/ */
#define BUG_PROC_MSG \ #define BUG_PROC_MSG \
KERN_DEBUG "Weird data abort (%08X).\n" \ KERN_DEBUG "Weird data abort (%08X).\n" \
KERN_DEBUG "Please see http://www.arm.linux.org.uk/state.html for more information" KERN_DEBUG "Please see http://www.arm.linux.org.uk/state.html for " \
"more information\n"
asmlinkage void asmlinkage void
do_DataAbort(unsigned long addr, int fsr, int error_code, struct pt_regs *regs) do_DataAbort(unsigned long addr, int fsr, int error_code, struct pt_regs *regs)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Page table sludge for older ARM processor architectures. * Page table sludge for older ARM processor architectures.
* *
* Copyright (C) 1998-1999 Russell King * Copyright (C) 1998-2000 Russell King
*/ */
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/mm.h> #include <linux/mm.h>
...@@ -134,6 +134,13 @@ pte_t *get_pte_slow(pmd_t *pmd, unsigned long offset) ...@@ -134,6 +134,13 @@ pte_t *get_pte_slow(pmd_t *pmd, unsigned long offset)
return (pte_t *) pmd_page(*pmd) + offset; return (pte_t *) pmd_page(*pmd) + offset;
} }
/*
* No special code is required here.
*/
void setup_mm_for_reboot(char mode)
{
}
/* /*
* This contains the code to setup the memory map on an ARM2/ARM250/ARM3 * This contains the code to setup the memory map on an ARM2/ARM250/ARM3
* machine. This is both processor & architecture specific, and requires * machine. This is both processor & architecture specific, and requires
...@@ -155,6 +162,9 @@ void __init pagetable_init(void) ...@@ -155,6 +162,9 @@ void __init pagetable_init(void)
pgd_val(swapper_pg_dir[i]) = 0; pgd_val(swapper_pg_dir[i]) = 0;
} }
/*
* We never have holes in the memmap
*/
void __init create_memmap_holes(void) void __init create_memmap_holes(void)
{ {
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Page table sludge for ARM v3 and v4 processor architectures. * Page table sludge for ARM v3 and v4 processor architectures.
* *
* Copyright (C) 1998-1999 Russell King * Copyright (C) 1998-2000 Russell King
*/ */
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/mm.h> #include <linux/mm.h>
...@@ -286,6 +286,25 @@ static void __init create_mapping(struct map_desc *md) ...@@ -286,6 +286,25 @@ static void __init create_mapping(struct map_desc *md)
} }
} }
/*
* In order to soft-boot, we need to insert a 1:1 mapping in place of
* the user-mode pages. This will then ensure that we have predictable
* results when turning the mmu off
*/
void setup_mm_for_reboot(char mode)
{
pgd_t *pgd = current->mm->pgd;
pmd_t pmd;
int i;
for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++) {
pmd_val(pmd) = (i << PGDIR_SHIFT) |
PMD_SECT_AP_WRITE | PMD_SECT_AP_READ |
PMD_TYPE_SECT;
set_pmd(pmd_offset(pgd + i, i << PGDIR_SHIFT), pmd);
}
}
void __init pagetable_init(void) void __init pagetable_init(void)
{ {
struct map_desc *init_maps, *p, *q; struct map_desc *init_maps, *p, *q;
......
/* /*
* linux/arch/arm/mm/proc-arm6,7.S: MMU functions for ARM6 * linux/arch/arm/mm/proc-arm6,7.S: MMU functions for ARM6
* *
* (C) 1997-1999 Russell King * (C) 1997-2000 Russell King
* *
* These are the low level assembler for performing cache and TLB * These are the low level assembler for performing cache and TLB
* functions on the ARM6 & ARM7. * functions on the ARM6 & ARM7.
...@@ -342,15 +342,17 @@ ENTRY(cpu_arm7_set_pte) ...@@ -342,15 +342,17 @@ ENTRY(cpu_arm7_set_pte)
/* /*
* Function: _arm6_7_reset * Function: _arm6_7_reset
* * Params : r0 = address to jump to
* Notes : This sets up everything for a reset * Notes : This sets up everything for a reset
*/ */
ENTRY(cpu_arm6_reset) ENTRY(cpu_arm6_reset)
ENTRY(cpu_arm7_reset) ENTRY(cpu_arm7_reset)
mov r0, #0 mov r1, #0
mcr p15, 0, r0, c7, c0, 0 @ flush cache mcr p15, 0, r1, c7, c0, 0 @ flush cache
mcr p15, 0, r0, c5, c0, 0 @ flush TLB mcr p15, 0, r1, c5, c0, 0 @ flush TLB
mov pc, lr mov r1, #0x30
mcr p15, 0, r1, c1, c0, 0 @ turn off MMU etc
mov pc, r0
cpu_armvlsi_name: cpu_armvlsi_name:
.asciz "ARM/VLSI" .asciz "ARM/VLSI"
......
/* /*
* linux/arch/arm/mm/proc-sa110.S: MMU functions for SA110 * linux/arch/arm/mm/proc-sa110.S: MMU functions for SA110
* *
* (C) 1997-1999 Russell King * (C) 1997-2000 Russell King
* *
* These are the low level assembler for performing cache and TLB * These are the low level assembler for performing cache and TLB
* functions on the StrongARM-110 and StrongARM-1100 * functions on the StrongARM-110 and StrongARM-1100
...@@ -225,9 +225,9 @@ ENTRY(cpu_sa1100_flush_ram_page) ...@@ -225,9 +225,9 @@ ENTRY(cpu_sa1100_flush_ram_page)
.align 5 .align 5
ENTRY(cpu_sa110_flush_tlb_all) ENTRY(cpu_sa110_flush_tlb_all)
ENTRY(cpu_sa1100_flush_tlb_all) ENTRY(cpu_sa1100_flush_tlb_all)
mov r0, #0 mov ip, #0
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, ip, c7, c10, 4 @ drain WB
mcr p15, 0, r0, c8, c7, 0 @ flush I & D tlbs mcr p15, 0, ip, c8, c7, 0 @ flush I & D tlbs
mov pc, lr mov pc, lr
/* /*
...@@ -421,16 +421,18 @@ ENTRY(cpu_sa1100_proc_init) ...@@ -421,16 +421,18 @@ ENTRY(cpu_sa1100_proc_init)
ENTRY(cpu_sa110_proc_fin) ENTRY(cpu_sa110_proc_fin)
ENTRY(cpu_sa1100_proc_fin) ENTRY(cpu_sa1100_proc_fin)
stmfd sp!, {r1, lr}
mrs r0, cpsr mrs r0, cpsr
orr r0, r0, #F_BIT | I_BIT orr r0, r0, #F_BIT | I_BIT
msr cpsr, r0 msr cpsr, r0
bl cpu_sa110_flush_cache_all @ clean caches
mov r0, #0 mov r0, #0
mcr p15, 0, r0, c15, c2, 2 @ Disable clock switching mcr p15, 0, r0, c15, c2, 2 @ Disable clock switching
mrc p15, 0, r0, c1, c0, 0 mrc p15, 0, r0, c1, c0, 0
bic r0, r0, #0x1100 @ ...i...s........ bic r0, r0, #0x1000 @ ...i............
bic r0, r0, #0x000e @ ............wca. bic r0, r0, #0x000e @ ............wca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
mov pc, lr ldmfd sp!, {r1, pc}
.align 5 .align 5
ENTRY(cpu_sa110_do_idle) ENTRY(cpu_sa110_do_idle)
...@@ -448,18 +450,21 @@ ENTRY(cpu_sa1100_do_idle) ...@@ -448,18 +450,21 @@ ENTRY(cpu_sa1100_do_idle)
/* /*
* Function: sa110_reset * Function: sa110_reset
* Params : r0 = address to jump to
* Notes : This sets up everything for a reset * Notes : This sets up everything for a reset
*/ */
.align 5
ENTRY(cpu_sa110_reset) ENTRY(cpu_sa110_reset)
ENTRY(cpu_sa1100_reset) ENTRY(cpu_sa1100_reset)
stmfd sp!, {r1, lr} mov ip, #0
bl cpu_sa110_flush_cache_all
bl cpu_sa110_flush_tlb_all
mcr p15, 0, ip, c7, c7, 0 @ flush I,D caches mcr p15, 0, ip, c7, c7, 0 @ flush I,D caches
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c7, c10, 4 @ drain WB
bic r0, r0, #0x000f @ ............wcam mcr p15, 0, ip, c8, c7, 0 @ flush I & D tlbs
bic r0, r0, #0x1100 @ ...i...s........ mrc p15, 0, ip, c1, c0, 0 @ ctrl register
ldmfd sp!, {r1, pc} bic ip, ip, #0x000f @ ............wcam
bic ip, ip, #0x1100 @ ...i...s........
mcr p15, 0, ip, c1, c0, 0 @ ctrl register
mov pc, r0
/* /*
* Purpose : Function pointers used to access above functions - all calls * Purpose : Function pointers used to access above functions - all calls
* come through these * come through these
......
...@@ -33,10 +33,10 @@ startup_32: ...@@ -33,10 +33,10 @@ startup_32:
cld cld
cli cli
movl $(__KERNEL_DS),%eax movl $(__KERNEL_DS),%eax
movl %ax,%ds movl %eax,%ds
movl %ax,%es movl %eax,%es
movl %ax,%fs movl %eax,%fs
movl %ax,%gs movl %eax,%gs
lss SYMBOL_NAME(stack_start),%esp lss SYMBOL_NAME(stack_start),%esp
xorl %eax,%eax xorl %eax,%eax
......
...@@ -793,7 +793,7 @@ static int __init get_model_name(struct cpuinfo_x86 *c) ...@@ -793,7 +793,7 @@ static int __init get_model_name(struct cpuinfo_x86 *c)
unsigned int n, dummy, *v, ecx, edx; unsigned int n, dummy, *v, ecx, edx;
/* Actually we must have cpuid or we could never have /* Actually we must have cpuid or we could never have
* figured out that this was AMD from the vendor info :-). * figured out that this was AMD/Cyrix from the vendor info :-).
*/ */
cpuid(0x80000000, &n, &dummy, &dummy, &dummy); cpuid(0x80000000, &n, &dummy, &dummy, &dummy);
...@@ -806,23 +806,27 @@ static int __init get_model_name(struct cpuinfo_x86 *c) ...@@ -806,23 +806,27 @@ static int __init get_model_name(struct cpuinfo_x86 *c)
cpuid(0x80000004, &v[8], &v[9], &v[10], &v[11]); cpuid(0x80000004, &v[8], &v[9], &v[10], &v[11]);
c->x86_model_id[48] = 0; c->x86_model_id[48] = 0;
/* Set MTRR capability flag if appropriate */ /* Set MTRR capability flag if appropriate */
if(boot_cpu_data.x86 == 5) {
if((boot_cpu_data.x86_model == 9) || if(c->x86_vendor==X86_VENDOR_AMD)
((boot_cpu_data.x86_model == 8) && {
(boot_cpu_data.x86_mask >= 8))) if(boot_cpu_data.x86 == 5) {
c->x86_capability |= X86_FEATURE_MTRR; if((boot_cpu_data.x86_model == 9) ||
} ((boot_cpu_data.x86_model == 8) &&
(boot_cpu_data.x86_mask >= 8)))
if (n >= 0x80000005){ c->x86_capability |= X86_FEATURE_MTRR;
cpuid(0x80000005, &dummy, &dummy, &ecx, &edx); }
printk("CPU: L1 I Cache: %dK L1 D Cache: %dK\n",
ecx>>24, edx>>24); if (n >= 0x80000005){
c->x86_cache_size=(ecx>>24)+(edx>>24); cpuid(0x80000005, &dummy, &dummy, &ecx, &edx);
} printk("CPU: L1 I Cache: %dK L1 D Cache: %dK\n",
if (n >= 0x80000006){ ecx>>24, edx>>24);
cpuid(0x80000006, &dummy, &dummy, &ecx, &edx); c->x86_cache_size=(ecx>>24)+(edx>>24);
printk("CPU: L2 Cache: %dK\n", ecx>>16); }
c->x86_cache_size=(ecx>>16); if (n >= 0x80000006){
cpuid(0x80000006, &dummy, &dummy, &ecx, &edx);
printk("CPU: L2 Cache: %dK\n", ecx>>16);
c->x86_cache_size=(ecx>>16);
}
} }
return 1; return 1;
} }
...@@ -1034,6 +1038,8 @@ static void __init cyrix_model(struct cpuinfo_x86 *c) ...@@ -1034,6 +1038,8 @@ static void __init cyrix_model(struct cpuinfo_x86 *c)
printk(KERN_INFO "Working around Cyrix MediaGX virtual DMA bugs.\n"); printk(KERN_INFO "Working around Cyrix MediaGX virtual DMA bugs.\n");
isa_dma_bridge_buggy = 2; isa_dma_bridge_buggy = 2;
#endif #endif
c->x86_cache_size=16; /* Yep 16K integrated cache thats it */
/* GXm supports extended cpuid levels 'ala' AMD */ /* GXm supports extended cpuid levels 'ala' AMD */
if (c->cpuid_level == 2) { if (c->cpuid_level == 2) {
get_model_name(c); /* get CPU marketing name */ get_model_name(c); /* get CPU marketing name */
......
...@@ -226,6 +226,7 @@ if [ "$CONFIG_NET" = "y" ]; then ...@@ -226,6 +226,7 @@ if [ "$CONFIG_NET" = "y" ]; then
tristate ' Sun QuadEthernet support' CONFIG_SUNQE tristate ' Sun QuadEthernet support' CONFIG_SUNQE
if [ "$CONFIG_PCI" = "y" ]; then if [ "$CONFIG_PCI" = "y" ]; then
tristate 'Generic DECchip & DIGITAL EtherWORKS PCI/EISA' CONFIG_DE4X5 tristate 'Generic DECchip & DIGITAL EtherWORKS PCI/EISA' CONFIG_DE4X5
tristate 'DECchip Tulip (dc21x4x) PCI support' CONFIG_TULIP
tristate '3c590/3c900 series (592/595/597) "Vortex/Boomerang" support' CONFIG_VORTEX tristate '3c590/3c900 series (592/595/597) "Vortex/Boomerang" support' CONFIG_VORTEX
tristate 'RealTek RTL-8139 support' CONFIG_8139TOO tristate 'RealTek RTL-8139 support' CONFIG_8139TOO
tristate 'PCI NE2000 support' CONFIG_NE2K_PCI tristate 'PCI NE2000 support' CONFIG_NE2K_PCI
......
...@@ -332,6 +332,7 @@ CONFIG_HAPPYMEAL=y ...@@ -332,6 +332,7 @@ CONFIG_HAPPYMEAL=y
CONFIG_SUNBMAC=m CONFIG_SUNBMAC=m
CONFIG_SUNQE=m CONFIG_SUNQE=m
CONFIG_DE4X5=m CONFIG_DE4X5=m
CONFIG_TULIP=m
CONFIG_VORTEX=m CONFIG_VORTEX=m
CONFIG_8139TOO=m CONFIG_8139TOO=m
CONFIG_NE2K_PCI=m CONFIG_NE2K_PCI=m
......
...@@ -31,7 +31,7 @@ if [ "$CONFIG_ATARI" = "y" ]; then ...@@ -31,7 +31,7 @@ if [ "$CONFIG_ATARI" = "y" ]; then
fi fi
fi fi
tristate 'XT hard disk support' CONFIG_BLK_DEV_XD tristate 'XT hard disk support' CONFIG_BLK_DEV_XD
dep_tristate 'Parallel port IDE device support' CONFIG_PARIDE $CONFIG_PARIDE_PARPORT dep_tristate 'Parallel port IDE device support' CONFIG_PARIDE $CONFIG_PARPORT
if [ "$CONFIG_PARIDE" = "y" -o "$CONFIG_PARIDE" = "m" ]; then if [ "$CONFIG_PARIDE" = "y" -o "$CONFIG_PARIDE" = "m" ]; then
source drivers/block/paride/Config.in source drivers/block/paride/Config.in
fi fi
......
/* -*- linux-c -*- /* -*- linux-c -*-
* dtlk.c - DoubleTalk PC driver for Linux kernel 2.0.29 * dtlk.c - DoubleTalk PC driver for Linux
*
* $Id: dtlk.c,v 1.19 1999/02/28 12:13:13 jrv Exp jrv $
* *
* Original author: Chris Pallotta <chris@allmedia.com> * Original author: Chris Pallotta <chris@allmedia.com>
* Current maintainer: Jim Van Zandt <jrv@vanzandt.mv.com> * Current maintainer: Jim Van Zandt <jrv@vanzandt.mv.com>
*
* 2000-03-18 Jim Van Zandt: Fix polling.
* Eliminate dtlk_timer_active flag and separate dtlk_stop_timer
* function. Don't restart timer in dtlk_timer_tick. Restart timer
* in dtlk_poll after every poll. dtlk_poll returns mask (duh).
* Eliminate unused function dtlk_write_byte. Misc. code cleanups.
*/ */
/* This driver is for the DoubleTalk PC, a speech synthesizer /* This driver is for the DoubleTalk PC, a speech synthesizer
...@@ -79,7 +83,6 @@ static int dtlk_major; ...@@ -79,7 +83,6 @@ static int dtlk_major;
static int dtlk_port_lpc; static int dtlk_port_lpc;
static int dtlk_port_tts; static int dtlk_port_tts;
static int dtlk_busy; static int dtlk_busy;
static int dtlk_timer_active;
static int dtlk_has_indexing; static int dtlk_has_indexing;
static unsigned int dtlk_portlist[] = static unsigned int dtlk_portlist[] =
{0x25e, 0x29e, 0x2de, 0x31e, 0x35e, 0x39e, 0}; {0x25e, 0x29e, 0x2de, 0x31e, 0x35e, 0x39e, 0};
...@@ -114,13 +117,11 @@ static struct dtlk_settings *dtlk_interrogate(void); ...@@ -114,13 +117,11 @@ static struct dtlk_settings *dtlk_interrogate(void);
static int dtlk_readable(void); static int dtlk_readable(void);
static char dtlk_read_lpc(void); static char dtlk_read_lpc(void);
static char dtlk_read_tts(void); static char dtlk_read_tts(void);
static void dtlk_stop_timer(void);
static int dtlk_writeable(void); static int dtlk_writeable(void);
static char dtlk_write_bytes(const char *buf, int n); static char dtlk_write_bytes(const char *buf, int n);
static char dtlk_write_tts(char); static char dtlk_write_tts(char);
/* /*
static void dtlk_handle_error(char, char, unsigned int); static void dtlk_handle_error(char, char, unsigned int);
static char dtlk_write_byte(unsigned int, const char*);
*/ */
static void dtlk_timer_tick(unsigned long data); static void dtlk_timer_tick(unsigned long data);
...@@ -250,43 +251,27 @@ static unsigned int dtlk_poll(struct file *file, poll_table * wait) ...@@ -250,43 +251,27 @@ static unsigned int dtlk_poll(struct file *file, poll_table * wait)
poll_wait(file, &dtlk_process_list, wait); poll_wait(file, &dtlk_process_list, wait);
if (dtlk_has_indexing && dtlk_readable()) { if (dtlk_has_indexing && dtlk_readable()) {
dtlk_stop_timer(); del_timer(&dtlk_timer);
mask = POLLIN | POLLRDNORM; mask = POLLIN | POLLRDNORM;
} }
if (dtlk_writeable()) { if (dtlk_writeable()) {
dtlk_stop_timer(); del_timer(&dtlk_timer);
mask |= POLLOUT | POLLWRNORM; mask |= POLLOUT | POLLWRNORM;
} }
/* there are no exception conditions */ /* there are no exception conditions */
if (mask == 0 && !dtlk_timer_active) { /* There won't be any interrupts, so we set a timer instead. */
/* not ready just yet. There won't be any interrupts, del_timer(&dtlk_timer);
so we set a timer instead. */ dtlk_timer.expires = jiffies + 3*HZ / 100;
dtlk_timer_active = 1; add_timer(&dtlk_timer);
dtlk_timer.expires = jiffies + HZ / 100;
add_timer(&dtlk_timer);
}
return 0;
}
static void dtlk_stop_timer() return mask;
{
if (dtlk_timer_active) {
dtlk_timer_active = 0;
del_timer(&dtlk_timer);
}
} }
static void dtlk_timer_tick(unsigned long data) static void dtlk_timer_tick(unsigned long data)
{ {
TRACE_TEXT(" dtlk_timer_tick");
wake_up_interruptible(&dtlk_process_list); wake_up_interruptible(&dtlk_process_list);
if (dtlk_timer_active) {
del_timer(&dtlk_timer);
dtlk_timer.expires = jiffies + HZ / 100;
add_timer(&dtlk_timer);
}
} }
static int dtlk_ioctl(struct inode *inode, static int dtlk_ioctl(struct inode *inode,
...@@ -348,7 +333,7 @@ static int dtlk_release(struct inode *inode, struct file *file) ...@@ -348,7 +333,7 @@ static int dtlk_release(struct inode *inode, struct file *file)
} }
TRACE_RET; TRACE_RET;
dtlk_stop_timer(); del_timer(&dtlk_timer);
return 0; return 0;
} }
...@@ -360,7 +345,6 @@ static int __init dtlk_init(void) ...@@ -360,7 +345,6 @@ static int __init dtlk_init(void)
dtlk_port_lpc = 0; dtlk_port_lpc = 0;
dtlk_port_tts = 0; dtlk_port_tts = 0;
dtlk_busy = 0; dtlk_busy = 0;
dtlk_timer_active = 0;
dtlk_major = devfs_register_chrdev(0, "dtlk", &dtlk_fops); dtlk_major = devfs_register_chrdev(0, "dtlk", &dtlk_fops);
if (dtlk_major == 0) { if (dtlk_major == 0) {
printk(KERN_ERR "DoubleTalk PC - cannot register device\n"); printk(KERN_ERR "DoubleTalk PC - cannot register device\n");
...@@ -410,15 +394,17 @@ static void dtlk_delay(int ms) ...@@ -410,15 +394,17 @@ static void dtlk_delay(int ms)
static int dtlk_readable(void) static int dtlk_readable(void)
{ {
TRACE_TEXT(" dtlk_readable"); #ifdef TRACING
printk(" dtlk_readable=%u@%u", inb_p(dtlk_port_lpc) != 0x7f, jiffies);
#endif
return inb_p(dtlk_port_lpc) != 0x7f; return inb_p(dtlk_port_lpc) != 0x7f;
} }
static int dtlk_writeable(void) static int dtlk_writeable(void)
{ {
/* TRACE_TEXT(" dtlk_writeable"); */ /* TRACE_TEXT(" dtlk_writeable"); */
#ifdef TRACING #ifdef TRACINGMORE
printk(" dtlk_writeable(%02x)", inb_p(dtlk_port_tts)); printk(" dtlk_writeable=%u", (inb_p(dtlk_port_tts) & TTS_WRITABLE)!=0);
#endif #endif
return inb_p(dtlk_port_tts) & TTS_WRITABLE; return inb_p(dtlk_port_tts) & TTS_WRITABLE;
} }
...@@ -465,7 +451,9 @@ static int __init dtlk_dev_probe(void) ...@@ -465,7 +451,9 @@ static int __init dtlk_dev_probe(void)
appears. */ appears. */
dtlk_delay(100); dtlk_delay(100);
dtlk_has_indexing = dtlk_readable(); dtlk_has_indexing = dtlk_readable();
#ifdef TRACING
printk(", indexing %d\n", dtlk_has_indexing);
#endif
#ifdef INSCOPE #ifdef INSCOPE
{ {
/* This macro records ten samples read from the LPC port, for later display */ /* This macro records ten samples read from the LPC port, for later display */
...@@ -479,17 +467,17 @@ for (i = 0; i < 10; i++) \ ...@@ -479,17 +467,17 @@ for (i = 0; i < 10; i++) \
int b = 0, i, j; int b = 0, i, j;
LOOK LOOK
outb_p(0xff, dtlk_port_lpc); outb_p(0xff, dtlk_port_lpc);
buffer[b++] = 0; buffer[b++] = 0;
LOOK LOOK
dtlk_write_bytes("\0012I\r", 4); dtlk_write_bytes("\0012I\r", 4);
buffer[b++] = 0; buffer[b++] = 0;
__delay(50 * loops_per_sec / 1000); __delay(50 * loops_per_sec / 1000);
outb_p(0xff, dtlk_port_lpc); outb_p(0xff, dtlk_port_lpc);
buffer[b++] = 0; buffer[b++] = 0;
LOOK LOOK
printk("\n"); printk("\n");
for (j = 0; j < b; j++) for (j = 0; j < b; j++)
printk(" %02x", buffer[j]); printk(" %02x", buffer[j]);
printk("\n"); printk("\n");
...@@ -510,12 +498,12 @@ for (i = 0; i < 10; i++) \ ...@@ -510,12 +498,12 @@ for (i = 0; i < 10; i++) \
__delay(loops_per_sec / 100); /* 10 ms */ __delay(loops_per_sec / 100); /* 10 ms */
LOOK LOOK
outb_p(0x03, dtlk_port_tts); outb_p(0x03, dtlk_port_tts);
buffer[b++] = 0; buffer[b++] = 0;
LOOK LOOK
LOOK LOOK
printk("\n"); printk("\n");
for (j = 0; j < b; j++) for (j = 0; j < b; j++)
printk(" %02x", buffer[j]); printk(" %02x", buffer[j]);
printk("\n"); printk("\n");
...@@ -555,7 +543,7 @@ static struct dtlk_settings *dtlk_interrogate(void) ...@@ -555,7 +543,7 @@ static struct dtlk_settings *dtlk_interrogate(void)
if (total > 2 && buf[total] == 0x7f) if (total > 2 && buf[total] == 0x7f)
break; break;
if (total < sizeof(struct dtlk_settings)) if (total < sizeof(struct dtlk_settings))
total++; total++;
} }
/* /*
if (i==50) printk("interrogate() read overrun\n"); if (i==50) printk("interrogate() read overrun\n");
...@@ -606,7 +594,8 @@ static char dtlk_read_tts(void) ...@@ -606,7 +594,8 @@ static char dtlk_read_tts(void)
/* verify DT is ready, read char, wait for ACK */ /* verify DT is ready, read char, wait for ACK */
do { do {
portval = inb_p(dtlk_port_tts); portval = inb_p(dtlk_port_tts);
} while ((portval & TTS_READABLE) == 0 && retries++ < DTLK_MAX_RETRIES); } while ((portval & TTS_READABLE) == 0 &&
retries++ < DTLK_MAX_RETRIES);
if (retries == DTLK_MAX_RETRIES) if (retries == DTLK_MAX_RETRIES)
printk(KERN_ERR "dtlk_read_tts() timeout\n"); printk(KERN_ERR "dtlk_read_tts() timeout\n");
...@@ -617,7 +606,8 @@ static char dtlk_read_tts(void) ...@@ -617,7 +606,8 @@ static char dtlk_read_tts(void)
retries = 0; retries = 0;
do { do {
portval = inb_p(dtlk_port_tts); portval = inb_p(dtlk_port_tts);
} while ((portval & TTS_READABLE) != 0 && retries++ < DTLK_MAX_RETRIES); } while ((portval & TTS_READABLE) != 0 &&
retries++ < DTLK_MAX_RETRIES);
if (retries == DTLK_MAX_RETRIES) if (retries == DTLK_MAX_RETRIES)
printk(KERN_ERR "dtlk_read_tts() timeout\n"); printk(KERN_ERR "dtlk_read_tts() timeout\n");
...@@ -649,22 +639,6 @@ static char dtlk_read_lpc(void) ...@@ -649,22 +639,6 @@ static char dtlk_read_lpc(void)
return ch; return ch;
} }
#ifdef NEVER
static char dtlk_write_byte(unsigned int minor, const char *buf)
{
char ch;
int err;
/* TRACE_TEXT("(dtlk_write_byte"); */
err = get_user(ch, buf);
/* printk(" dtlk_write_byte(%d, 0x%02x)", minor, (int)ch); */
ch = dtlk_write_tts(ch);
/*
TRACE_RET; */
return ch;
}
#endif /* NEVER */
/* write n bytes to tts port */ /* write n bytes to tts port */
static char dtlk_write_bytes(const char *buf, int n) static char dtlk_write_bytes(const char *buf, int n)
{ {
...@@ -680,7 +654,7 @@ static char dtlk_write_bytes(const char *buf, int n) ...@@ -680,7 +654,7 @@ static char dtlk_write_bytes(const char *buf, int n)
static char dtlk_write_tts(char ch) static char dtlk_write_tts(char ch)
{ {
int retries = 0; int retries = 0;
#ifdef TRACING #ifdef TRACINGMORE
printk(" dtlk_write_tts("); printk(" dtlk_write_tts(");
if (' ' <= ch && ch <= '~') if (' ' <= ch && ch <= '~')
printk("'%c'", ch); printk("'%c'", ch);
...@@ -702,7 +676,7 @@ static char dtlk_write_tts(char ch) ...@@ -702,7 +676,7 @@ static char dtlk_write_tts(char ch)
if ((inb_p(dtlk_port_tts) & TTS_WRITABLE) == 0) if ((inb_p(dtlk_port_tts) & TTS_WRITABLE) == 0)
break; break;
#ifdef TRACING #ifdef TRACINGMORE
printk(")\n"); printk(")\n");
#endif #endif
return 0; return 0;
......
...@@ -470,11 +470,13 @@ static void probe_hwif (ide_hwif_t *hwif) ...@@ -470,11 +470,13 @@ static void probe_hwif (ide_hwif_t *hwif)
if (hwif->noprobe) if (hwif->noprobe)
return; return;
#ifdef CONFIG_BLK_DEV_IDE
if (hwif->io_ports[IDE_DATA_OFFSET] == HD_DATA) { if (hwif->io_ports[IDE_DATA_OFFSET] == HD_DATA) {
extern void probe_cmos_for_drives(ide_hwif_t *); extern void probe_cmos_for_drives(ide_hwif_t *);
probe_cmos_for_drives (hwif); probe_cmos_for_drives (hwif);
} }
#endif
if ((hwif->chipset != ide_4drives || !hwif->mate->present) && if ((hwif->chipset != ide_4drives || !hwif->mate->present) &&
#if CONFIG_BLK_DEV_PDC4030 #if CONFIG_BLK_DEV_PDC4030
......
...@@ -478,7 +478,9 @@ void ei_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -478,7 +478,9 @@ void ei_interrupt(int irq, void *dev_id, struct pt_regs * regs)
outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, e8390_base + E8390_CMD); outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, e8390_base + E8390_CMD);
if (nr_serviced >= MAX_SERVICE) if (nr_serviced >= MAX_SERVICE)
{ {
printk(KERN_WARNING "%s: Too much work at interrupt, status %#2.2x\n", /* 0xFF is valid for a card removal */
if(interrupts!=0xFF)
printk(KERN_WARNING "%s: Too much work at interrupt, status %#2.2x\n",
dev->name, interrupts); dev->name, interrupts);
outb_p(ENISR_ALL, e8390_base + EN0_ISR); /* Ack. most intrs. */ outb_p(ENISR_ALL, e8390_base + EN0_ISR); /* Ack. most intrs. */
} else { } else {
...@@ -588,8 +590,8 @@ static void ei_tx_intr(struct net_device *dev) ...@@ -588,8 +590,8 @@ static void ei_tx_intr(struct net_device *dev)
else else
ei_local->lasttx = 10, ei_local->txing = 0; ei_local->lasttx = 10, ei_local->txing = 0;
} }
else printk(KERN_WARNING "%s: unexpected TX-done interrupt, lasttx=%d.\n", // else printk(KERN_WARNING "%s: unexpected TX-done interrupt, lasttx=%d.\n",
dev->name, ei_local->lasttx); // dev->name, ei_local->lasttx);
#else /* EI_PINGPONG */ #else /* EI_PINGPONG */
/* /*
...@@ -651,8 +653,12 @@ static void ei_receive(struct net_device *dev) ...@@ -651,8 +653,12 @@ static void ei_receive(struct net_device *dev)
this_frame = ei_local->rx_start_page; this_frame = ei_local->rx_start_page;
/* Someday we'll omit the previous, iff we never get this message. /* Someday we'll omit the previous, iff we never get this message.
(There is at least one clone claimed to have a problem.) */ (There is at least one clone claimed to have a problem.)
if (ei_debug > 0 && this_frame != ei_local->current_page)
Keep quiet if it looks like a card removal. One problem here
is that some clones crash in roughly the same way.
*/
if (ei_debug > 0 && this_frame != ei_local->current_page && (this_frame!=0x0 || rxing_page!=0xFF))
printk(KERN_ERR "%s: mismatched read page pointers %2x vs %2x.\n", printk(KERN_ERR "%s: mismatched read page pointers %2x vs %2x.\n",
dev->name, this_frame, ei_local->current_page); dev->name, this_frame, ei_local->current_page);
......
...@@ -395,6 +395,8 @@ int ether_config(struct net_device *dev, struct ifmap *map) ...@@ -395,6 +395,8 @@ int ether_config(struct net_device *dev, struct ifmap *map)
int register_netdev(struct net_device *dev) int register_netdev(struct net_device *dev)
{ {
int err;
rtnl_lock(); rtnl_lock();
/* /*
...@@ -404,8 +406,9 @@ int register_netdev(struct net_device *dev) ...@@ -404,8 +406,9 @@ int register_netdev(struct net_device *dev)
if (dev->name && strchr(dev->name, '%')) if (dev->name && strchr(dev->name, '%'))
{ {
err = -EBUSY;
if(dev_alloc_name(dev, dev->name)<0) if(dev_alloc_name(dev, dev->name)<0)
return -EBUSY; goto out;
} }
/* /*
...@@ -414,17 +417,21 @@ int register_netdev(struct net_device *dev) ...@@ -414,17 +417,21 @@ int register_netdev(struct net_device *dev)
if (dev->name && (dev->name[0]==0 || dev->name[0]==' ')) if (dev->name && (dev->name[0]==0 || dev->name[0]==' '))
{ {
err = -EBUSY;
if(dev_alloc_name(dev, "eth%d")<0) if(dev_alloc_name(dev, "eth%d")<0)
return -EBUSY; goto out;
} }
if (register_netdevice(dev)) { err = -EIO;
rtnl_unlock(); if (register_netdevice(dev))
return -EIO; goto out;
}
err = 0;
out:
rtnl_unlock(); rtnl_unlock();
return 0; return err;
} }
void unregister_netdev(struct net_device *dev) void unregister_netdev(struct net_device *dev)
......
...@@ -929,7 +929,7 @@ pcnet32_init_ring(struct net_device *dev) ...@@ -929,7 +929,7 @@ pcnet32_init_ring(struct net_device *dev)
lp->tx_ring[i].status = 0; lp->tx_ring[i].status = 0;
} }
lp->init_block.tlen_rlen = TX_RING_LEN_BITS | RX_RING_LEN_BITS; lp->init_block.tlen_rlen = le16_to_cpu(TX_RING_LEN_BITS | RX_RING_LEN_BITS);
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
lp->init_block.phys_addr[i] = dev->dev_addr[i]; lp->init_block.phys_addr[i] = dev->dev_addr[i];
lp->init_block.rx_ring = (u32)le32_to_cpu(virt_to_bus(lp->rx_ring)); lp->init_block.rx_ring = (u32)le32_to_cpu(virt_to_bus(lp->rx_ring));
...@@ -1050,8 +1050,10 @@ pcnet32_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1050,8 +1050,10 @@ pcnet32_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (lp->tx_ring[(entry+1) & TX_RING_MOD_MASK].base == 0) if (lp->tx_ring[(entry+1) & TX_RING_MOD_MASK].base == 0)
netif_start_queue(dev); netif_start_queue(dev);
else else {
lp->tx_full = 1; lp->tx_full = 1;
netif_stop_queue(dev);
}
spin_unlock_irqrestore(&lp->lock, flags); spin_unlock_irqrestore(&lp->lock, flags);
return 0; return 0;
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "tulip.h" #include "tulip.h"
#include <asm/io.h> #include <asm/io.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/pci.h>
int tulip_rx_copybreak; int tulip_rx_copybreak;
...@@ -32,13 +33,20 @@ static int tulip_refill_rx(struct net_device *dev) ...@@ -32,13 +33,20 @@ static int tulip_refill_rx(struct net_device *dev)
/* Refill the Rx ring buffers. */ /* Refill the Rx ring buffers. */
for (; tp->cur_rx - tp->dirty_rx > 0; tp->dirty_rx++) { for (; tp->cur_rx - tp->dirty_rx > 0; tp->dirty_rx++) {
entry = tp->dirty_rx % RX_RING_SIZE; entry = tp->dirty_rx % RX_RING_SIZE;
if (tp->rx_skbuff[entry] == NULL) { if (tp->rx_buffers[entry].skb == NULL) {
struct sk_buff *skb; struct sk_buff *skb;
skb = tp->rx_skbuff[entry] = dev_alloc_skb(PKT_BUF_SZ); dma_addr_t mapping;
skb = tp->rx_buffers[entry].skb = dev_alloc_skb(PKT_BUF_SZ);
if (skb == NULL) if (skb == NULL)
break; break;
mapping = pci_map_single(tp->pdev, skb->tail, PKT_BUF_SZ,
PCI_DMA_FROMDEVICE);
tp->rx_buffers[entry].mapping = mapping;
skb->dev = dev; /* Mark as being used by this device. */ skb->dev = dev; /* Mark as being used by this device. */
tp->rx_ring[entry].buffer1 = virt_to_le32desc(skb->tail); tp->rx_ring[entry].buffer1 = cpu_to_le32(mapping);
refilled++; refilled++;
} }
tp->rx_ring[entry].status = cpu_to_le32(DescOwned); tp->rx_ring[entry].status = cpu_to_le32(DescOwned);
...@@ -106,24 +114,39 @@ static int tulip_rx(struct net_device *dev) ...@@ -106,24 +114,39 @@ static int tulip_rx(struct net_device *dev)
&& (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
skb->dev = dev; skb->dev = dev;
skb_reserve(skb, 2); /* 16 byte align the IP header */ skb_reserve(skb, 2); /* 16 byte align the IP header */
pci_dma_sync_single(tp->pdev,
tp->rx_buffers[entry].mapping,
pkt_len, PCI_DMA_FROMDEVICE);
#if ! defined(__alpha__) #if ! defined(__alpha__)
eth_copy_and_sum(skb, tp->rx_skbuff[entry]->tail, pkt_len, 0); eth_copy_and_sum(skb, tp->rx_buffers[entry].skb->tail,
pkt_len, 0);
skb_put(skb, pkt_len); skb_put(skb, pkt_len);
#else #else
memcpy(skb_put(skb, pkt_len), tp->rx_skbuff[entry]->tail, memcpy(skb_put(skb, pkt_len),
pkt_len); tp->rx_buffers[entry].skb->tail,
pkt_len);
#endif #endif
} else { /* Pass up the skb already on the Rx ring. */ } else { /* Pass up the skb already on the Rx ring. */
char *temp = skb_put(skb = tp->rx_skbuff[entry], pkt_len); char *temp = skb_put(skb = tp->rx_buffers[entry].skb,
tp->rx_skbuff[entry] = NULL; pkt_len);
#ifndef final_version #ifndef final_version
if (le32desc_to_virt(tp->rx_ring[entry].buffer1) != temp) if (tp->rx_buffers[entry].mapping !=
le32_to_cpu(tp->rx_ring[entry].buffer1)) {
printk(KERN_ERR "%s: Internal fault: The skbuff addresses " printk(KERN_ERR "%s: Internal fault: The skbuff addresses "
"do not match in tulip_rx: %p vs. %p / %p.\n", "do not match in tulip_rx: %08x vs. %08x %p / %p.\n",
dev->name, dev->name,
le32desc_to_virt(tp->rx_ring[entry].buffer1), le32_to_cpu(tp->rx_ring[entry].buffer1),
skb->head, temp); tp->rx_buffers[entry].mapping,
skb->head, temp);
}
#endif #endif
pci_unmap_single(tp->pdev, tp->rx_buffers[entry].mapping,
PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
tp->rx_buffers[entry].skb = NULL;
tp->rx_buffers[entry].mapping = 0;
} }
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb); netif_rx(skb);
...@@ -189,8 +212,13 @@ void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs) ...@@ -189,8 +212,13 @@ void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
if (status < 0) if (status < 0)
break; /* It still has not been Txed */ break; /* It still has not been Txed */
/* Check for Rx filter setup frames. */ /* Check for Rx filter setup frames. */
if (tp->tx_skbuff[entry] == NULL) if (tp->tx_buffers[entry].skb == NULL) {
pci_unmap_single(tp->pdev,
tp->tx_buffers[entry].mapping,
sizeof(tp->setup_frame),
PCI_DMA_TODEVICE);
continue; continue;
}
if (status & 0x8000) { if (status & 0x8000) {
/* There was an major error, log it. */ /* There was an major error, log it. */
...@@ -213,14 +241,20 @@ void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs) ...@@ -213,14 +241,20 @@ void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
#ifdef ETHER_STATS #ifdef ETHER_STATS
if (status & 0x0001) tp->stats.tx_deferred++; if (status & 0x0001) tp->stats.tx_deferred++;
#endif #endif
tp->stats.tx_bytes += tp->tx_skbuff[entry]->len; tp->stats.tx_bytes +=
tp->tx_buffers[entry].skb->len;
tp->stats.collisions += (status >> 3) & 15; tp->stats.collisions += (status >> 3) & 15;
tp->stats.tx_packets++; tp->stats.tx_packets++;
} }
pci_unmap_single(tp->pdev, tp->tx_buffers[entry].mapping,
tp->tx_buffers[entry].skb->len,
PCI_DMA_TODEVICE);
/* Free the original skb. */ /* Free the original skb. */
dev_kfree_skb_irq(tp->tx_skbuff[entry]); dev_kfree_skb_irq(tp->tx_buffers[entry].skb);
tp->tx_skbuff[entry] = 0; tp->tx_buffers[entry].skb = NULL;
tp->tx_buffers[entry].mapping = 0;
tx++; tx++;
} }
...@@ -311,7 +345,7 @@ void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs) ...@@ -311,7 +345,7 @@ void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
/* check if we card is in suspend mode */ /* check if we card is in suspend mode */
entry = tp->dirty_rx % RX_RING_SIZE; entry = tp->dirty_rx % RX_RING_SIZE;
if (tp->rx_skbuff[entry] == NULL) { if (tp->rx_buffers[entry].skb == NULL) {
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_WARNING "%s: in rx suspend mode: (%lu) (tp->cur_rx = %u, ttimer = %d, rx = %d) go/stay in suspend mode\n", dev->name, tp->nir, tp->cur_rx, tp->ttimer, rx); printk(KERN_WARNING "%s: in rx suspend mode: (%lu) (tp->cur_rx = %u, ttimer = %d, rx = %d) go/stay in suspend mode\n", dev->name, tp->nir, tp->cur_rx, tp->ttimer, rx);
if (tp->ttimer == 0 || (inl(ioaddr + CSR11) & 0xffff) == 0) { if (tp->ttimer == 0 || (inl(ioaddr + CSR11) & 0xffff) == 0) {
......
...@@ -204,12 +204,6 @@ enum desc_status_bits { ...@@ -204,12 +204,6 @@ enum desc_status_bits {
#define get_u16(ptr) (((u8*)(ptr))[0] + (((u8*)(ptr))[1]<<8)) #define get_u16(ptr) (((u8*)(ptr))[0] + (((u8*)(ptr))[1]<<8))
#endif #endif
/* Condensed operations for readability. */
#define virt_to_le32desc(addr) cpu_to_le32(virt_to_bus(addr))
#define le32desc_to_virt(addr) bus_to_virt(le32_to_cpu(addr))
struct medialeaf { struct medialeaf {
u8 type; u8 type;
u8 media; u8 media;
...@@ -237,6 +231,10 @@ struct mediainfo { ...@@ -237,6 +231,10 @@ struct mediainfo {
unsigned char *info; unsigned char *info;
}; };
struct ring_info {
struct sk_buff *skb;
dma_addr_t mapping;
};
struct tulip_private { struct tulip_private {
const char *product_name; const char *product_name;
...@@ -246,10 +244,9 @@ struct tulip_private { ...@@ -246,10 +244,9 @@ struct tulip_private {
dma_addr_t rx_ring_dma; dma_addr_t rx_ring_dma;
dma_addr_t tx_ring_dma; dma_addr_t tx_ring_dma;
/* The saved address of a sent-in-place packet/buffer, for skfree(). */ /* The saved address of a sent-in-place packet/buffer, for skfree(). */
struct sk_buff *tx_skbuff[TX_RING_SIZE]; struct ring_info tx_buffers[TX_RING_SIZE];
/* The addresses of receive-in-place skbuffs. */ /* The addresses of receive-in-place skbuffs. */
struct sk_buff *rx_skbuff[RX_RING_SIZE]; struct ring_info rx_buffers[RX_RING_SIZE];
char *rx_buffs; /* Address of temporary Rx buffers. */
u16 setup_frame[96]; /* Pseudo-Tx frame to init address table. */ u16 setup_frame[96]; /* Pseudo-Tx frame to init address table. */
int chip_id; int chip_id;
int revision; int revision;
......
...@@ -51,7 +51,7 @@ const char * const medianame[] = { ...@@ -51,7 +51,7 @@ const char * const medianame[] = {
}; };
/* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */ /* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */
#if defined(__alpha__) || defined(__arm__) #if defined(__alpha__) || defined(__arm__) || defined(__sparc__)
static int rx_copybreak = 1518; static int rx_copybreak = 1518;
#else #else
static int rx_copybreak = 100; static int rx_copybreak = 100;
...@@ -72,8 +72,14 @@ static int rx_copybreak = 100; ...@@ -72,8 +72,14 @@ static int rx_copybreak = 100;
#if defined(__alpha__) #if defined(__alpha__)
static int csr0 = 0x01A00000 | 0xE000; static int csr0 = 0x01A00000 | 0xE000;
#elif defined(__i386__) || defined(__powerpc__) || defined(__sparc__) #elif defined(__i386__) || defined(__powerpc__)
static int csr0 = 0x01A00000 | 0x8000; static int csr0 = 0x01A00000 | 0x8000;
#elif defined(__sparc__)
/* The UltraSparc PCI controllers will disconnect at every 64-byte
* crossing anyways so it makes no sense to tell Tulip to burst
* any more than that.
*/
static int csr0 = 0x01A00000 | 0x9000;
#elif defined(__arm__) #elif defined(__arm__)
static int csr0 = 0x01A00000 | 0x4800; static int csr0 = 0x01A00000 | 0x4800;
#else #else
...@@ -285,6 +291,7 @@ static void tulip_up(struct net_device *dev) ...@@ -285,6 +291,7 @@ static void tulip_up(struct net_device *dev)
/* This is set_rx_mode(), but without starting the transmitter. */ /* This is set_rx_mode(), but without starting the transmitter. */
u16 *eaddrs = (u16 *)dev->dev_addr; u16 *eaddrs = (u16 *)dev->dev_addr;
u16 *setup_frm = &tp->setup_frame[15*6]; u16 *setup_frm = &tp->setup_frame[15*6];
dma_addr_t mapping;
/* 21140 bug: you must add the broadcast address. */ /* 21140 bug: you must add the broadcast address. */
memset(tp->setup_frame, 0xff, sizeof(tp->setup_frame)); memset(tp->setup_frame, 0xff, sizeof(tp->setup_frame));
...@@ -292,9 +299,16 @@ static void tulip_up(struct net_device *dev) ...@@ -292,9 +299,16 @@ static void tulip_up(struct net_device *dev)
*setup_frm++ = eaddrs[0]; *setup_frm++ = eaddrs[0]; *setup_frm++ = eaddrs[0]; *setup_frm++ = eaddrs[0];
*setup_frm++ = eaddrs[1]; *setup_frm++ = eaddrs[1]; *setup_frm++ = eaddrs[1]; *setup_frm++ = eaddrs[1];
*setup_frm++ = eaddrs[2]; *setup_frm++ = eaddrs[2]; *setup_frm++ = eaddrs[2]; *setup_frm++ = eaddrs[2];
mapping = pci_map_single(tp->pdev, tp->setup_frame,
sizeof(tp->setup_frame),
PCI_DMA_TODEVICE);
tp->tx_buffers[0].skb = NULL;
tp->tx_buffers[0].mapping = mapping;
/* Put the setup frame on the Tx list. */ /* Put the setup frame on the Tx list. */
tp->tx_ring[0].length = cpu_to_le32(0x08000000 | 192); tp->tx_ring[0].length = cpu_to_le32(0x08000000 | 192);
tp->tx_ring[0].buffer1 = virt_to_le32desc(tp->setup_frame); tp->tx_ring[0].buffer1 = cpu_to_le32(mapping);
tp->tx_ring[0].status = cpu_to_le32(DescOwned); tp->tx_ring[0].status = cpu_to_le32(DescOwned);
tp->cur_tx++; tp->cur_tx++;
...@@ -569,30 +583,37 @@ static void tulip_init_ring(struct net_device *dev) ...@@ -569,30 +583,37 @@ static void tulip_init_ring(struct net_device *dev)
tp->rx_ring[i].status = 0x00000000; tp->rx_ring[i].status = 0x00000000;
tp->rx_ring[i].length = cpu_to_le32(PKT_BUF_SZ); tp->rx_ring[i].length = cpu_to_le32(PKT_BUF_SZ);
tp->rx_ring[i].buffer2 = cpu_to_le32(tp->rx_ring_dma + sizeof(struct tulip_rx_desc) * (i + 1)); tp->rx_ring[i].buffer2 = cpu_to_le32(tp->rx_ring_dma + sizeof(struct tulip_rx_desc) * (i + 1));
tp->rx_skbuff[i] = NULL; tp->rx_buffers[i].skb = NULL;
tp->rx_buffers[i].mapping = 0;
} }
/* Mark the last entry as wrapping the ring. */ /* Mark the last entry as wrapping the ring. */
tp->rx_ring[i-1].length = cpu_to_le32(PKT_BUF_SZ | DESC_RING_WRAP); tp->rx_ring[i-1].length = cpu_to_le32(PKT_BUF_SZ | DESC_RING_WRAP);
tp->rx_ring[i-1].buffer2 = cpu_to_le32(tp->rx_ring_dma); tp->rx_ring[i-1].buffer2 = cpu_to_le32(tp->rx_ring_dma);
for (i = 0; i < RX_RING_SIZE; i++) { for (i = 0; i < RX_RING_SIZE; i++) {
dma_addr_t mapping;
/* Note the receive buffer must be longword aligned. /* Note the receive buffer must be longword aligned.
dev_alloc_skb() provides 16 byte alignment. But do *not* dev_alloc_skb() provides 16 byte alignment. But do *not*
use skb_reserve() to align the IP header! */ use skb_reserve() to align the IP header! */
struct sk_buff *skb = dev_alloc_skb(PKT_BUF_SZ); struct sk_buff *skb = dev_alloc_skb(PKT_BUF_SZ);
tp->rx_skbuff[i] = skb; tp->rx_buffers[i].skb = skb;
if (skb == NULL) if (skb == NULL)
break; break;
mapping = pci_map_single(tp->pdev, skb->tail,
PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
tp->rx_buffers[i].mapping = mapping;
skb->dev = dev; /* Mark as being used by this device. */ skb->dev = dev; /* Mark as being used by this device. */
tp->rx_ring[i].status = cpu_to_le32(DescOwned); /* Owned by Tulip chip */ tp->rx_ring[i].status = cpu_to_le32(DescOwned); /* Owned by Tulip chip */
tp->rx_ring[i].buffer1 = virt_to_le32desc(skb->tail); tp->rx_ring[i].buffer1 = cpu_to_le32(mapping);
} }
tp->dirty_rx = (unsigned int)(i - RX_RING_SIZE); tp->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
/* The Tx buffer descriptor is filled in as needed, but we /* The Tx buffer descriptor is filled in as needed, but we
do need to clear the ownership bit. */ do need to clear the ownership bit. */
for (i = 0; i < TX_RING_SIZE; i++) { for (i = 0; i < TX_RING_SIZE; i++) {
tp->tx_skbuff[i] = 0; tp->tx_buffers[i].skb = NULL;
tp->tx_buffers[i].mapping = 0;
tp->tx_ring[i].status = 0x00000000; tp->tx_ring[i].status = 0x00000000;
tp->tx_ring[i].buffer2 = cpu_to_le32(tp->tx_ring_dma + sizeof(struct tulip_tx_desc) * (i + 1)); tp->tx_ring[i].buffer2 = cpu_to_le32(tp->tx_ring_dma + sizeof(struct tulip_tx_desc) * (i + 1));
} }
...@@ -605,6 +626,7 @@ tulip_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -605,6 +626,7 @@ tulip_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct tulip_private *tp = (struct tulip_private *)dev->priv; struct tulip_private *tp = (struct tulip_private *)dev->priv;
int entry; int entry;
u32 flag; u32 flag;
dma_addr_t mapping;
unsigned long cpuflags; unsigned long cpuflags;
/* Caution: the write order is important here, set the field /* Caution: the write order is important here, set the field
...@@ -615,8 +637,11 @@ tulip_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -615,8 +637,11 @@ tulip_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Calculate the next Tx descriptor entry. */ /* Calculate the next Tx descriptor entry. */
entry = tp->cur_tx % TX_RING_SIZE; entry = tp->cur_tx % TX_RING_SIZE;
tp->tx_skbuff[entry] = skb; tp->tx_buffers[entry].skb = skb;
tp->tx_ring[entry].buffer1 = virt_to_le32desc(skb->data); mapping = pci_map_single(tp->pdev, skb->data,
skb->len, PCI_DMA_TODEVICE);
tp->tx_buffers[entry].mapping = mapping;
tp->tx_ring[entry].buffer1 = cpu_to_le32(mapping);
if (tp->cur_tx - tp->dirty_tx < TX_RING_SIZE/2) {/* Typical path */ if (tp->cur_tx - tp->dirty_tx < TX_RING_SIZE/2) {/* Typical path */
flag = 0x60000000; /* No interrupt */ flag = 0x60000000; /* No interrupt */
...@@ -697,19 +722,31 @@ static int tulip_close (struct net_device *dev) ...@@ -697,19 +722,31 @@ static int tulip_close (struct net_device *dev)
/* Free all the skbuffs in the Rx queue. */ /* Free all the skbuffs in the Rx queue. */
for (i = 0; i < RX_RING_SIZE; i++) { for (i = 0; i < RX_RING_SIZE; i++) {
struct sk_buff *skb = tp->rx_skbuff[i]; struct sk_buff *skb = tp->rx_buffers[i].skb;
tp->rx_skbuff[i] = 0; dma_addr_t mapping = tp->rx_buffers[i].mapping;
tp->rx_buffers[i].skb = NULL;
tp->rx_buffers[i].mapping = 0;
tp->rx_ring[i].status = 0; /* Not owned by Tulip chip. */ tp->rx_ring[i].status = 0; /* Not owned by Tulip chip. */
tp->rx_ring[i].length = 0; tp->rx_ring[i].length = 0;
tp->rx_ring[i].buffer1 = 0xBADF00D0; /* An invalid address. */ tp->rx_ring[i].buffer1 = 0xBADF00D0; /* An invalid address. */
if (skb) { if (skb) {
pci_unmap_single(tp->pdev, mapping, PKT_BUF_SZ,
PCI_DMA_FROMDEVICE);
dev_kfree_skb (skb); dev_kfree_skb (skb);
} }
} }
for (i = 0; i < TX_RING_SIZE; i++) { for (i = 0; i < TX_RING_SIZE; i++) {
if (tp->tx_skbuff[i]) struct sk_buff *skb = tp->tx_buffers[i].skb;
dev_kfree_skb (tp->tx_skbuff[i]);
tp->tx_skbuff[i] = 0; if (skb != NULL) {
pci_unmap_single(tp->pdev, tp->tx_buffers[i].mapping,
skb->len, PCI_DMA_TODEVICE);
dev_kfree_skb (skb);
}
tp->tx_buffers[i].skb = NULL;
tp->tx_buffers[i].mapping = 0;
} }
MOD_DEC_USE_COUNT; MOD_DEC_USE_COUNT;
...@@ -937,7 +974,8 @@ static void set_rx_mode(struct net_device *dev) ...@@ -937,7 +974,8 @@ static void set_rx_mode(struct net_device *dev)
if (entry != 0) { if (entry != 0) {
/* Avoid a chip errata by prefixing a dummy entry. */ /* Avoid a chip errata by prefixing a dummy entry. */
tp->tx_skbuff[entry] = 0; tp->tx_buffers[entry].skb = NULL;
tp->tx_buffers[entry].mapping = 0;
tp->tx_ring[entry].length = tp->tx_ring[entry].length =
(entry == TX_RING_SIZE-1) ? cpu_to_le32(DESC_RING_WRAP) : 0; (entry == TX_RING_SIZE-1) ? cpu_to_le32(DESC_RING_WRAP) : 0;
tp->tx_ring[entry].buffer1 = 0; tp->tx_ring[entry].buffer1 = 0;
...@@ -945,12 +983,17 @@ static void set_rx_mode(struct net_device *dev) ...@@ -945,12 +983,17 @@ static void set_rx_mode(struct net_device *dev)
entry = tp->cur_tx++ % TX_RING_SIZE; entry = tp->cur_tx++ % TX_RING_SIZE;
} }
tp->tx_skbuff[entry] = 0; tp->tx_buffers[entry].skb = NULL;
tp->tx_buffers[entry].mapping =
pci_map_single(tp->pdev, tp->setup_frame,
sizeof(tp->setup_frame),
PCI_DMA_TODEVICE);
/* Put the setup frame on the Tx list. */ /* Put the setup frame on the Tx list. */
if (entry == TX_RING_SIZE-1) if (entry == TX_RING_SIZE-1)
tx_flags |= DESC_RING_WRAP; /* Wrap ring. */ tx_flags |= DESC_RING_WRAP; /* Wrap ring. */
tp->tx_ring[entry].length = cpu_to_le32(tx_flags); tp->tx_ring[entry].length = cpu_to_le32(tx_flags);
tp->tx_ring[entry].buffer1 = virt_to_le32desc(tp->setup_frame); tp->tx_ring[entry].buffer1 =
cpu_to_le32(tp->tx_buffers[entry].mapping);
tp->tx_ring[entry].status = cpu_to_le32(DescOwned); tp->tx_ring[entry].status = cpu_to_le32(DescOwned);
if (tp->cur_tx - tp->dirty_tx >= TX_RING_SIZE - 2) { if (tp->cur_tx - tp->dirty_tx >= TX_RING_SIZE - 2) {
netif_stop_queue(dev); netif_stop_queue(dev);
...@@ -1163,8 +1206,10 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, ...@@ -1163,8 +1206,10 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
And the ASIX must have a burst limit or horrible things happen. */ And the ASIX must have a burst limit or horrible things happen. */
if (chip_idx == DC21143 && chip_rev == 65) if (chip_idx == DC21143 && chip_rev == 65)
tp->csr0 &= ~0x01000000; tp->csr0 &= ~0x01000000;
else if (chip_idx == AX88140) else if (chip_idx == AX88140) {
tp->csr0 |= 0x2000; if ((tp->csr0 & 0x3f00) == 0)
tp->csr0 |= 0x2000;
}
/* The lower four bits are the media type. */ /* The lower four bits are the media type. */
if (board_idx >= 0 && board_idx < MAX_UNITS) { if (board_idx >= 0 && board_idx < MAX_UNITS) {
......
...@@ -695,10 +695,13 @@ ...@@ -695,10 +695,13 @@
ac18 PCI1260 ac18 PCI1260
ac19 PCI1221 ac19 PCI1221
ac1a PCI1210 ac1a PCI1210
ac1b PCI1221 ac1b PCI1450
ac1c PCI1225 ac1c PCI1225
ac1d PCI1251 ac1d PCI1251A
ac1e PCI1211
ac1f PCI1251B
ac20 TI 2030 ac20 TI 2030
ac51 PCI1420
fe00 FireWire Host Controller fe00 FireWire Host Controller
fe03 12C01A FireWire Host Controller fe03 12C01A FireWire Host Controller
104d Sony Corporation 104d Sony Corporation
......
...@@ -136,6 +136,46 @@ ...@@ -136,6 +136,46 @@
#ifdef CONFIG_CARDBUS #ifdef CONFIG_CARDBUS
/*
* Generic TI open - TI has an extension for the
* INTCTL register that sets the PCI CSC interrupt.
* Make sure we set it correctly at open and init
* time.
*/
static int ti_open(pci_socket_t *socket)
{
u8 new, reg = exca_readb(socket, I365_INTCTL);
new = reg & ~I365_INTR_ENA;
if (socket->cb_irq)
new |= I365_INTR_ENA;
if (new != reg)
exca_writeb(socket, I365_INTCTL, new);
return 0;
}
static int ti_init(pci_socket_t *socket)
{
yenta_init(socket);
ti_open(socket);
return 0;
}
static struct pci_socket_ops ti_ops = {
ti_open,
yenta_close,
ti_init,
yenta_suspend,
yenta_get_status,
yenta_get_socket,
yenta_set_socket,
yenta_get_io_map,
yenta_set_io_map,
yenta_get_mem_map,
yenta_set_mem_map,
yenta_proc_setup
};
#define ti_sysctl(socket) ((socket)->private[0]) #define ti_sysctl(socket) ((socket)->private[0])
#define ti_cardctl(socket) ((socket)->private[1]) #define ti_cardctl(socket) ((socket)->private[1])
#define ti_devctl(socket) ((socket)->private[2]) #define ti_devctl(socket) ((socket)->private[2])
...@@ -149,6 +189,7 @@ static int ti113x_open(pci_socket_t *socket) ...@@ -149,6 +189,7 @@ static int ti113x_open(pci_socket_t *socket)
ti_cardctl(socket) &= ~(TI113X_CCR_PCI_IRQ_ENA | TI113X_CCR_PCI_IREQ | TI113X_CCR_PCI_CSC); ti_cardctl(socket) &= ~(TI113X_CCR_PCI_IRQ_ENA | TI113X_CCR_PCI_IREQ | TI113X_CCR_PCI_CSC);
if (socket->cb_irq) if (socket->cb_irq)
ti_cardctl(socket) |= TI113X_CCR_PCI_IRQ_ENA | TI113X_CCR_PCI_CSC | TI113X_CCR_PCI_IREQ; ti_cardctl(socket) |= TI113X_CCR_PCI_IRQ_ENA | TI113X_CCR_PCI_CSC | TI113X_CCR_PCI_IREQ;
ti_open(socket);
return 0; return 0;
} }
...@@ -159,7 +200,7 @@ static int ti113x_init(pci_socket_t *socket) ...@@ -159,7 +200,7 @@ static int ti113x_init(pci_socket_t *socket)
config_writel(socket, TI113X_SYSTEM_CONTROL, ti_sysctl(socket)); config_writel(socket, TI113X_SYSTEM_CONTROL, ti_sysctl(socket));
config_writeb(socket, TI113X_CARD_CONTROL, ti_cardctl(socket)); config_writeb(socket, TI113X_CARD_CONTROL, ti_cardctl(socket));
config_writeb(socket, TI113X_DEVICE_CONTROL, ti_devctl(socket)); config_writeb(socket, TI113X_DEVICE_CONTROL, ti_devctl(socket));
ti_open(socket);
return 0; return 0;
} }
...@@ -187,6 +228,7 @@ static int ti1250_open(pci_socket_t *socket) ...@@ -187,6 +228,7 @@ static int ti1250_open(pci_socket_t *socket)
ti_diag(socket) &= ~(TI1250_DIAG_PCI_CSC | TI1250_DIAG_PCI_IREQ); ti_diag(socket) &= ~(TI1250_DIAG_PCI_CSC | TI1250_DIAG_PCI_IREQ);
if (socket->cb_irq) if (socket->cb_irq)
ti_diag(socket) |= TI1250_DIAG_PCI_CSC | TI1250_DIAG_PCI_IREQ; ti_diag(socket) |= TI1250_DIAG_PCI_CSC | TI1250_DIAG_PCI_IREQ;
ti_open(socket);
return 0; return 0;
} }
...@@ -195,6 +237,7 @@ static int ti1250_init(pci_socket_t *socket) ...@@ -195,6 +237,7 @@ static int ti1250_init(pci_socket_t *socket)
yenta_init(socket); yenta_init(socket);
config_writeb(socket, TI1250_DIAGNOSTIC, ti_diag(socket)); config_writeb(socket, TI1250_DIAGNOSTIC, ti_diag(socket));
ti_open(socket);
return 0; return 0;
} }
......
...@@ -740,8 +740,18 @@ static struct cardbus_override_struct { ...@@ -740,8 +740,18 @@ static struct cardbus_override_struct {
struct pci_socket_ops *op; struct pci_socket_ops *op;
} cardbus_override[] = { } cardbus_override[] = {
{ PD(TI,1130), &ti113x_ops }, { PD(TI,1130), &ti113x_ops },
{ PD(TI,1031), &ti_ops },
{ PD(TI,1131), &ti113x_ops }, { PD(TI,1131), &ti113x_ops },
{ PD(TI,1250), &ti1250_ops }, { PD(TI,1250), &ti1250_ops },
{ PD(TI,1220), &ti_ops },
{ PD(TI,1221), &ti_ops },
{ PD(TI,1210), &ti_ops },
{ PD(TI,1450), &ti_ops },
{ PD(TI,1225), &ti_ops },
{ PD(TI,1251A), &ti_ops },
{ PD(TI,1211), &ti_ops },
{ PD(TI,1251B), &ti_ops },
{ PD(TI,1420), &ti_ops },
{ PD(RICOH,RL5C465), &ricoh_ops }, { PD(RICOH,RL5C465), &ricoh_ops },
{ PD(RICOH,RL5C466), &ricoh_ops }, { PD(RICOH,RL5C466), &ricoh_ops },
......
...@@ -108,6 +108,8 @@ static struct dev_info device_list[] = ...@@ -108,6 +108,8 @@ static struct dev_info device_list[] =
{"YAMAHA", "CDR100", "1.00", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */ {"YAMAHA", "CDR100", "1.00", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */
{"YAMAHA", "CDR102", "1.00", BLIST_NOLUN}, /* Locks up if polled for lun != 0 {"YAMAHA", "CDR102", "1.00", BLIST_NOLUN}, /* Locks up if polled for lun != 0
* extra reset */ * extra reset */
{"YAMAHA", "CRW8424S", "1.0", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */
{"YAMAHA", "CRW6416S", "1.0c", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */
{"MITSUMI", "CD-R CR-2201CS", "6119", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */ {"MITSUMI", "CD-R CR-2201CS", "6119", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */
{"RELISYS", "Scorpio", "*", BLIST_NOLUN}, /* responds to all LUN */ {"RELISYS", "Scorpio", "*", BLIST_NOLUN}, /* responds to all LUN */
{"MICROTEK", "ScanMaker II", "5.61", BLIST_NOLUN}, /* responds to all LUN */ {"MICROTEK", "ScanMaker II", "5.61", BLIST_NOLUN}, /* responds to all LUN */
...@@ -137,10 +139,12 @@ static struct dev_info device_list[] = ...@@ -137,10 +139,12 @@ static struct dev_info device_list[] =
{"iomega", "jaz 1GB", "J.86", BLIST_NOTQ | BLIST_NOLUN}, {"iomega", "jaz 1GB", "J.86", BLIST_NOTQ | BLIST_NOLUN},
{"CREATIVE","DVD-RAM RAM","*", BLIST_GHOST}, {"CREATIVE","DVD-RAM RAM","*", BLIST_GHOST},
{"MATSHITA","PD-2 LF-D100","*", BLIST_GHOST}, {"MATSHITA","PD-2 LF-D100","*", BLIST_GHOST},
{"AOpen", "PD-2 DVD-520S", "*", BLIST_GHOST},
{"HITACHI", "GF-1050","*", BLIST_GHOST}, /* Hitachi SCSI DVD-RAM */ {"HITACHI", "GF-1050","*", BLIST_GHOST}, /* Hitachi SCSI DVD-RAM */
{"TOSHIBA","CDROM","*", BLIST_ISROM}, {"TOSHIBA","CDROM","*", BLIST_ISROM},
{"TOSHIBA","DVD-RAM SD-W1101","*", BLIST_GHOST}, {"TOSHIBA","DVD-RAM SD-W1101","*", BLIST_GHOST},
{"TOSHIBA","DVD-RAM SD-W1111","*", BLIST_GHOST}, {"TOSHIBA","DVD-RAM SD-W1111","*", BLIST_GHOST},
{"MegaRAID", "LD", "*", BLIST_FORCELUN},
/* /*
* Must be at end of list... * Must be at end of list...
......
...@@ -69,7 +69,11 @@ static ssize_t usb_driver_read(struct file *file, char *buf, size_t nbytes, loff ...@@ -69,7 +69,11 @@ static ssize_t usb_driver_read(struct file *file, char *buf, size_t nbytes, loff
pos = *ppos; pos = *ppos;
for (; tmp != &usb_driver_list; tmp = tmp->next) { for (; tmp != &usb_driver_list; tmp = tmp->next) {
struct usb_driver *driver = list_entry(tmp, struct usb_driver, driver_list); struct usb_driver *driver = list_entry(tmp, struct usb_driver, driver_list);
start += sprintf (start, "%s\n", driver->name); int minor = driver->fops ? driver->minor : -1;
if (minor == -1)
start += sprintf (start, " %s\n", driver->name);
else
start += sprintf (start, "%3d-%3d: %s\n", minor, minor + 15, driver->name);
if (start > end) { if (start > end) {
start += sprintf(start, "(truncated)\n"); start += sprintf(start, "(truncated)\n");
break; break;
......
...@@ -1175,6 +1175,7 @@ static struct fb_ops cyber2000fb_ops = ...@@ -1175,6 +1175,7 @@ static struct fb_ops cyber2000fb_ops =
int cyber2000fb_attach(struct cyberpro_info *info) int cyber2000fb_attach(struct cyberpro_info *info)
{ {
if (current_par.initialised) { if (current_par.initialised) {
info->dev = current_par.dev;
info->regs = CyberRegs; info->regs = CyberRegs;
info->fb = current_par.screen_base; info->fb = current_par.screen_base;
info->fb_size = current_par.screen_size; info->fb_size = current_par.screen_size;
...@@ -1402,8 +1403,16 @@ int __init cyber2000fb_init(void) ...@@ -1402,8 +1403,16 @@ int __init cyber2000fb_init(void)
smem_base = dev->resource[0].start; smem_base = dev->resource[0].start;
mmio_base = dev->resource[0].start + 0x00800000; mmio_base = dev->resource[0].start + 0x00800000;
current_par.dev = dev;
current_par.dev_id = dev->device; current_par.dev_id = dev->device;
err = pci_enable_device(dev);
if (err) {
printk("%s: unable to enable device: %d\n",
current_par.dev_name, err);
return err;
}
/* /*
* Map in the registers * Map in the registers
*/ */
......
...@@ -50,8 +50,9 @@ struct cyber2000fb_par { ...@@ -50,8 +50,9 @@ struct cyber2000fb_par {
unsigned int palette_size; unsigned int palette_size;
signed int currcon; signed int currcon;
char dev_name[32]; char dev_name[32];
unsigned int initialised; struct pci_dev *dev;
unsigned int dev_id; unsigned int dev_id;
unsigned int initialised:1;
unsigned int bus_64bit:1; unsigned int bus_64bit:1;
/* /*
...@@ -276,6 +277,7 @@ struct cyber2000fb_par { ...@@ -276,6 +277,7 @@ struct cyber2000fb_par {
#define CO_REG_DEST_WIDTH 0xbf218 #define CO_REG_DEST_WIDTH 0xbf218
struct cyberpro_info { struct cyberpro_info {
struct pci_dev *dev;
unsigned char *regs; unsigned char *regs;
char *fb; char *fb;
char dev_name[32]; char dev_name[32];
......
...@@ -137,8 +137,8 @@ static int ext2_readdir(struct file * filp, ...@@ -137,8 +137,8 @@ static int ext2_readdir(struct file * filp,
bh, offset)) { bh, offset)) {
/* On error, skip the f_pos to the /* On error, skip the f_pos to the
next block. */ next block. */
filp->f_pos = (filp->f_pos & (sb->s_blocksize - 1)) filp->f_pos = (filp->f_pos | (sb->s_blocksize - 1))
+ sb->s_blocksize; + 1;
brelse (bh); brelse (bh);
return stored; return stored;
} }
......
...@@ -1497,16 +1497,17 @@ asmlinkage long sys_rename(const char * oldname, const char * newname) ...@@ -1497,16 +1497,17 @@ asmlinkage long sys_rename(const char * oldname, const char * newname)
int vfs_readlink(struct dentry *dentry, char *buffer, int buflen, const char *link) int vfs_readlink(struct dentry *dentry, char *buffer, int buflen, const char *link)
{ {
u32 len; int len;
len = PTR_ERR(link); len = PTR_ERR(link);
if (IS_ERR(link)) if (IS_ERR(link))
goto out; goto out;
len = strlen(link); len = strlen(link);
if (len > buflen) if (len > (unsigned) buflen)
len = buflen; len = buflen;
copy_to_user(buffer, link, len); if (copy_to_user(buffer, link, len))
len = -EFAULT;
out: out:
return len; return len;
} }
......
...@@ -98,7 +98,7 @@ static int riscix_partition(struct gendisk *hd, kdev_t dev, unsigned long first_ ...@@ -98,7 +98,7 @@ static int riscix_partition(struct gendisk *hd, kdev_t dev, unsigned long first_
} }
} }
printk(" >"); printk(" >\n");
if (hd->part[riscix_minor].nr_sects > 2) if (hd->part[riscix_minor].nr_sects > 2)
hd->part[riscix_minor].nr_sects = 2; hd->part[riscix_minor].nr_sects = 2;
...@@ -139,7 +139,7 @@ static int linux_partition(struct gendisk *hd, kdev_t dev, unsigned long first_s ...@@ -139,7 +139,7 @@ static int linux_partition(struct gendisk *hd, kdev_t dev, unsigned long first_s
le32_to_cpu(linuxp->nr_sects)); le32_to_cpu(linuxp->nr_sects));
linuxp ++; linuxp ++;
} }
printk(" >"); printk(" >\n");
/* /*
* Prevent someone doing a mkswap or mkfs on this partition * Prevent someone doing a mkswap or mkfs on this partition
*/ */
......
...@@ -106,9 +106,9 @@ ufs_readdir (struct file * filp, void * dirent, filldir_t filldir) ...@@ -106,9 +106,9 @@ ufs_readdir (struct file * filp, void * dirent, filldir_t filldir)
bh, offset)) { bh, offset)) {
/* On error, skip the f_pos to the /* On error, skip the f_pos to the
next block. */ next block. */
filp->f_pos = (filp->f_pos & filp->f_pos = (filp->f_pos |
(sb->s_blocksize - 1)) + (sb->s_blocksize - 1)) +
sb->s_blocksize; 1;
brelse (bh); brelse (bh);
return stored; return stored;
} }
......
...@@ -8,18 +8,14 @@ ...@@ -8,18 +8,14 @@
#include <asm/iomd.h> #include <asm/iomd.h>
#define arch_do_idle() \ #define arch_do_idle() \
outb(0, IOMD_SUSMODE) outb(0, IOMD_SUSMODE)
#define arch_reset(mode) { \ #define arch_reset(mode) \
outb (0, IOMD_ROMCR0); \ do { \
cli(); \ outb (0, IOMD_ROMCR0); \
__asm__ __volatile__("msr spsr, r1;" \ cpu_reset(0); \
"mcr p15, 0, %0, c1, c0, 0;" \ } while (0);
"movs pc, #0" \
: \
: "r" (cpu_reset())); \
}
#define arch_power_off() do { } while (0) #define arch_power_off() do { } while (0)
......
...@@ -8,15 +8,6 @@ ...@@ -8,15 +8,6 @@
#define arch_do_idle() cpu_do_idle() #define arch_do_idle() cpu_do_idle()
#define arch_power_off() do { } while (0) #define arch_power_off() do { } while (0)
#define arch_reset(mode) cpu_reset(0x80000000)
extern __inline__ void arch_reset(char mode)
{
if (mode == 's') {
__asm__ volatile(
"mcr p15, 0, %0, c1, c0, 0 @ MMU off
mov pc, #0x80000000 @ jump to flash"
: : "r" (cpu_reset()) : "cc");
}
}
#endif #endif
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
extern __inline__ void arch_reset(char mode) extern __inline__ void arch_reset(char mode)
{ {
if (mode == 's') { if (mode == 's') {
__asm__ volatile ( /*
"mcr p15, 0, %0, c1, c0, 0 @ MMU off * Jump into the ROM
mov pc, #0x41000000 @ jump to ROM" : : */
"r" (cpu_reset()) : "cc"); cpu_reset(0x41000000);
} else { } else {
if (machine_is_netwinder()) { if (machine_is_netwinder()) {
/* open up the SuperIO chip /* open up the SuperIO chip
......
...@@ -18,8 +18,8 @@ extern __inline__ void arch_reset(char mode) ...@@ -18,8 +18,8 @@ extern __inline__ void arch_reset(char mode)
outb(0, IOMD_ROMCR0); outb(0, IOMD_ROMCR0);
__asm__ __volatile__( /*
"mcr p15, 0, %0, c1, c0, 0\n\t" * Jump into the ROM
"mov pc, #0" */
: : "r" (cpu_reset())); cpu_reset(0);
} }
...@@ -16,11 +16,7 @@ ...@@ -16,11 +16,7 @@
#else #else
#define arch_reset(x) { \ #define arch_reset(x) cpu_reset(0)
__asm__ volatile ( \
" mcr p15, 0, %0, c1, c0 @ MMU off\n" \
" mov pc, #0\n" : : "r" (cpu_reset()) : "cc"); \
}
#endif #endif
......
...@@ -75,7 +75,7 @@ extern struct processor { ...@@ -75,7 +75,7 @@ extern struct processor {
/* /*
* Special stuff for a reset * Special stuff for a reset
*/ */
unsigned long (*reset)(void); volatile void (*reset)(unsigned long addr);
/* /*
* flush an icached page * flush an icached page
*/ */
...@@ -123,7 +123,7 @@ extern const struct processor sa110_processor_functions; ...@@ -123,7 +123,7 @@ extern const struct processor sa110_processor_functions;
#define cpu_set_pgd(pgd) processor._set_pgd(pgd) #define cpu_set_pgd(pgd) processor._set_pgd(pgd)
#define cpu_set_pmd(pmdp, pmd) processor._set_pmd(pmdp, pmd) #define cpu_set_pmd(pmdp, pmd) processor._set_pmd(pmdp, pmd)
#define cpu_set_pte(ptep, pte) processor._set_pte(ptep, pte) #define cpu_set_pte(ptep, pte) processor._set_pte(ptep, pte)
#define cpu_reset() processor.reset() #define cpu_reset(addr) processor.reset(addr)
#define cpu_flush_icache_area(start,end) processor._flush_icache_area(start,end) #define cpu_flush_icache_area(start,end) processor._flush_icache_area(start,end)
#define cpu_cache_wback_area(start,end) processor._cache_wback_area(start,end) #define cpu_cache_wback_area(start,end) processor._cache_wback_area(start,end)
#define cpu_cache_purge_area(start,end) processor._cache_purge_area(start,end) #define cpu_cache_purge_area(start,end) processor._cache_purge_area(start,end)
......
...@@ -62,7 +62,7 @@ extern void cpu_flush_tlb_page(unsigned long address, int flags); ...@@ -62,7 +62,7 @@ extern void cpu_flush_tlb_page(unsigned long address, int flags);
extern void cpu_set_pgd(unsigned long pgd_phys); extern void cpu_set_pgd(unsigned long pgd_phys);
extern void cpu_set_pmd(pmd_t *pmdp, pmd_t pmd); extern void cpu_set_pmd(pmd_t *pmdp, pmd_t pmd);
extern void cpu_set_pte(pte_t *ptep, pte_t pte); extern void cpu_set_pte(pte_t *ptep, pte_t pte);
extern unsigned long cpu_reset(void); extern volatile void cpu_reset(unsigned long addr);
extern void cpu_flush_icache_area(unsigned long start, unsigned long size); extern void cpu_flush_icache_area(unsigned long start, unsigned long size);
extern void cpu_cache_wback_area(unsigned long start, unsigned long end); extern void cpu_cache_wback_area(unsigned long start, unsigned long end);
extern void cpu_cache_purge_area(unsigned long start, unsigned long end); extern void cpu_cache_purge_area(unsigned long start, unsigned long end);
......
...@@ -25,6 +25,12 @@ ...@@ -25,6 +25,12 @@
#define MCL_CURRENT 1 /* lock all current mappings */ #define MCL_CURRENT 1 /* lock all current mappings */
#define MCL_FUTURE 2 /* lock all future mappings */ #define MCL_FUTURE 2 /* lock all future mappings */
#define MADV_NORMAL 0x0 /* default page-in behavior */
#define MADV_RANDOM 0x1 /* page-in minimum required */
#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
#define MADV_WILLNEED 0x3 /* pre-fault pages */
#define MADV_DONTNEED 0x4 /* discard these pages */
/* compatibility flags */ /* compatibility flags */
#define MAP_ANON MAP_ANONYMOUS #define MAP_ANON MAP_ANONYMOUS
#define MAP_FILE 0 #define MAP_FILE 0
......
...@@ -96,7 +96,7 @@ extern unsigned int __machine_arch_type; ...@@ -96,7 +96,7 @@ extern unsigned int __machine_arch_type;
# define machine_is_netwinder() (0) # define machine_is_netwinder() (0)
#endif #endif
#ifdef CONFIG_CATS #ifdef CONFIG_ARCH_CATS
# ifdef machine_arch_type # ifdef machine_arch_type
# undef machine_arch_type # undef machine_arch_type
# define machine_arch_type __machine_arch_type # define machine_arch_type __machine_arch_type
...@@ -180,7 +180,7 @@ extern unsigned int __machine_arch_type; ...@@ -180,7 +180,7 @@ extern unsigned int __machine_arch_type;
# define machine_is_sa1100() (0) # define machine_is_sa1100() (0)
#endif #endif
#ifdef CONFIG_PERSONAL_SERVER #ifdef CONFIG_ARCH_PERSONAL_SERVER
# ifdef machine_arch_type # ifdef machine_arch_type
# undef machine_arch_type # undef machine_arch_type
# define machine_arch_type __machine_arch_type # define machine_arch_type __machine_arch_type
......
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